/*! For license information please see 1273.fa73758b99e56c899c4b.js.LICENSE.txt */
(globalThis.webpackChunk_rio_rio_ui=globalThis.webpackChunk_rio_rio_ui||[]).push([[1273],{32055(e,t,i){"use strict";i.d(t,{j:()=>ms});var n=i(15567),s=i(51718),r=i(410),o=i(78953),a=new n.C("ClientDevice_Browser");var l,c,h,u,d,p,g,f,m,y,v,b,C,w,S,x,E,A,M,T,D,I,R,k,P,_,L,N,O,F,G,B,V,H,U,z,W,j,$,K,Y,q,X,Z,Q,J,ee,te,ie,ne,se,re,oe,ae,le,ce,he,ue,de,pe,ge,fe,me,ye,ve,be,Ce,we,Se,xe,Ee,Ae,Me,Te,De,Ie,Re,ke,Pe,_e,Le,Ne,Oe,Fe,Ge,Be,Ve,He,Ue,ze,We,je,$e,Ke,Ye,qe,Xe,Ze,Qe,Je,et,tt,it,nt,st,rt,ot,at,lt,ct,ht,ut,dt,pt,gt,ft,mt,yt,vt,bt,Ct,wt,St,xt,Et,At,Mt,Tt,Dt,It,Rt,kt=function(){function e(){}return e.clientInfo=function(){return"undefined"==typeof window?{}:function(){if("undefined"==typeof window)return a.warn("No window object available to get browser client info"),{};var e=window.navigator;if(!e)return a.warn("No navigator object available to get browser client info"),{};var t,i=e.platform,n=e.product,s=e.vendor,r=e.userAgent,o=e.language,l=function(e){var t=/.+(Opera[\s[A-Z]*|OPR[\sA-Z]*)\/([0-9\.]+).*/i.exec(e);if(t)return{type:t[1],version:t[2]};var i=/.+(Trident|Edge)\/([0-9\.]+).*/i.exec(e);if(i)return{type:i[1],version:i[2]};var n=/.+(Chrome|Firefox|FxiOS)\/([0-9\.]+).*/i.exec(e);if(n)return{type:n[1],version:n[2]};var s=/.+(Safari)\/([0-9\.]+).*/i.exec(e);if(s)return{type:s[1],version:s[2]};var r=/.+(AppleWebKit)\/([0-9\.]+).*/i.exec(e);if(r)return{type:r[1],version:r[2]};var o=/.*([A-Z]+)\/([0-9\.]+).*/i.exec(e);return o?{type:o[1],version:o[2]}:{type:"",version:""}}(r),c=(t=/\(([A-Za-z\s].*)\)/.exec((new Date).toString()))&&t[1]||"";return{platform:i,make:n||s,model:l.type,version:l.version,appVersion:[l.type,l.version].join("/"),language:o,timezone:c}}()},e.dimension=function(){return"undefined"==typeof window?(a.warn("No window object available to get browser client info"),{width:320,height:320}):{width:window.innerWidth,height:window.innerHeight}},e}(),Pt=i(56059),_t=i(81504),Lt=i(71481),Nt={clockOffset:0,getDateWithClockOffset:function(){return Nt.clockOffset?new Date((new Date).getTime()+Nt.clockOffset):new Date},getClockOffset:function(){return Nt.clockOffset},getHeaderStringFromDate:function(e){return void 0===e&&(e=Nt.getDateWithClockOffset()),e.toISOString().replace(/[:\-]|\.\d{3}/g,"")},getDateFromHeaderString:function(e){var t=function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,s,r=i.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=r.next()).done;)o.push(n.value)}catch(e){s={error:e}}finally{try{n&&!n.done&&(i=r.return)&&i.call(r)}finally{if(s)throw s.error}}return o}(e.match(/^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2}).+/),7),i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6];return new Date(Date.UTC(Number(i),Number(n)-1,Number(s),Number(r),Number(o),Number(a)))},isClockSkewed:function(e){return Math.abs(e.getTime()-Nt.getDateWithClockOffset().getTime())>=3e5},isClockSkewError:function(e){if(!e.response||!e.response.headers)return!1;var t=e.response.headers;return Boolean(["BadRequestException","InvalidSignatureException"].includes(t["x-amzn-errortype"])&&(t.date||t.Date))},setClockOffset:function(e){Nt.clockOffset=e}},Ot=function(){return Ot=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var s in t=arguments[i])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},Ot.apply(this,arguments)},Ft=new n.C("Signer"),Gt="AWS4-HMAC-SHA256",Bt=function(e,t){var i=new Pt.Sha256(e);return i.update(t),i.digestSync()},Vt=function(e){var t=e||"",i=new Pt.Sha256;return i.update(t),(0,_t.n)(i.digestSync())},Ht=function(e){return Object.keys(e).map(function(e){return e.toLowerCase()}).sort().join(";")},Ut=function(e){var t,i,n=(0,Lt.parse)(e.url);return[e.method||"/",encodeURIComponent(n.pathname).replace(/%2F/gi,"/"),(i=n.query,i&&0!==i.length?i.split("&").map(function(e){var t=e.split("=");if(1===t.length)return e;var i=t[1].replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()});return t[0]+"="+i}).sort(function(e,t){var i=e.split("=")[0],n=t.split("=")[0];return i===n?e<t?-1:1:i<n?-1:1}).join("&"):""),(t=e.headers,t&&0!==Object.keys(t).length?Object.keys(t).map(function(e){return{key:e.toLowerCase(),value:t[e]?t[e].trim().replace(/\s+/g," "):""}}).sort(function(e,t){return e.key<t.key?-1:1}).map(function(e){return e.key+":"+e.value}).join("\n")+"\n":""),Ht(e.headers),Vt(e.data)].join("\n")},zt=function(e){var t=((0,Lt.parse)(e.url).host.match(/([^\.]+)\.(?:([^\.]*)\.)?amazonaws\.com$/)||[]).slice(1,3);return"es"===t[1]&&(t=t.reverse()),{service:e.service||t[0],region:e.region||t[1]}},Wt=function(e,t,i){return[e,t,i,"aws4_request"].join("/")},jt=function(e,t,i,n){return[e,i,n,Vt(t)].join("\n")},$t=function(e,t,i){Ft.debug(i);var n=Bt("AWS4"+e,t),s=Bt(n,i.region),r=Bt(s,i.service);return Bt(r,"aws4_request")},Kt=function(e,t){return(0,_t.n)(Bt(e,t))},Yt=function(){function e(){}return e.sign=function(e,t,i){if(void 0===i&&(i=null),e.headers=e.headers||{},e.body&&!e.data)throw new Error('The attribute "body" was found on the request object. Please use the attribute "data" instead.');var n=Nt.getDateWithClockOffset().toISOString().replace(/[:\-]|\.\d{3}/g,""),s=n.substr(0,8),r=(0,Lt.parse)(e.url);e.headers.host=r.host,e.headers["x-amz-date"]=n,t.session_token&&(e.headers["X-Amz-Security-Token"]=t.session_token);var o=Ut(e);Ft.debug(o);var a=i||zt(e),l=Wt(s,a.region,a.service),c=jt(Gt,o,n,l),h=$t(t.secret_key,s,a),u=Kt(h,c),d=function(e,t,i,n,s){return[e+" Credential="+t+"/"+i,"SignedHeaders="+n,"Signature="+s].join(", ")}(Gt,t.access_key,l,Ht(e.headers),u);return e.headers.Authorization=d,e},e.signUrl=function(e,t,i,n){var s="object"==typeof e?e.url:e,r="object"==typeof e?e.method:"GET",o="object"==typeof e?e.body:void 0,a=Nt.getDateWithClockOffset().toISOString().replace(/[:\-]|\.\d{3}/g,""),l=a.substr(0,8),c=(0,Lt.parse)(s,!0,!0),h=(c.search,function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(i[n[s]]=e[n[s]])}return i}(c,["search"])),u={host:h.host},d=i||zt({url:(0,Lt.format)(h)}),p=d.region,g=d.service,f=Wt(l,p,g),m=t.session_token&&"iotdevicegateway"!==g,y=Ot(Ot(Ot({"X-Amz-Algorithm":Gt,"X-Amz-Credential":[t.access_key,f].join("/"),"X-Amz-Date":a.substr(0,16)},m?{"X-Amz-Security-Token":""+t.session_token}:{}),n?{"X-Amz-Expires":""+n}:{}),{"X-Amz-SignedHeaders":Object.keys(u).join(",")}),v=Ut({method:r,url:(0,Lt.format)(Ot(Ot({},h),{query:Ot(Ot({},h.query),y)})),headers:u,data:o}),b=jt(Gt,v,a,f),C=$t(t.secret_key,l,{region:p,service:g}),w=Kt(C,b),S=Ot({"X-Amz-Signature":w},t.session_token&&{"X-Amz-Security-Token":t.session_token});return(0,Lt.format)({protocol:h.protocol,slashes:!0,hostname:h.hostname,port:h.port,pathname:h.pathname,query:Ot(Ot(Ot({},h.query),y),S)})},e}(),qt=i(51678),Xt=i(41547),Zt=i(99550),Qt=i(65959);!function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(l||(l={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(c||(c={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(h||(h={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(u||(u={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(d||(d={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(p||(p={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(g||(g={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(f||(f={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(m||(m={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(y||(y={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(v||(v={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(b||(b={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(C||(C={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(w||(w={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(S||(S={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(x||(x={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(E||(E={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(A||(A={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(M||(M={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(T||(T={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(D||(D={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(I||(I={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(R||(R={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(k||(k={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(P||(P={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(_||(_={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(L||(L={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(N||(N={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(O||(O={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(F||(F={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(G||(G={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(B||(B={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(V||(V={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(H||(H={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(U||(U={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(z||(z={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(W||(W={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(j||(j={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}($||($={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(K||(K={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Y||(Y={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(q||(q={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(X||(X={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Z||(Z={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Q||(Q={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(J||(J={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(ee||(ee={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(te||(te={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(ie||(ie={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(ne||(ne={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(se||(se={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(re||(re={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(oe||(oe={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(ae||(ae={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(le||(le={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(ce||(ce={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(he||(he={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(ue||(ue={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(de||(de={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(pe||(pe={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(ge||(ge={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(fe||(fe={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(me||(me={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(ye||(ye={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(ve||(ve={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(be||(be={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Ce||(Ce={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(we||(we={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Se||(Se={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(xe||(xe={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Ee||(Ee={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Ae||(Ae={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Me||(Me={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Te||(Te={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(De||(De={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Ie||(Ie={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Re||(Re={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(ke||(ke={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Pe||(Pe={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(_e||(_e={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Le||(Le={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Ne||(Ne={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Oe||(Oe={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Fe||(Fe={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Ge||(Ge={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Be||(Be={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Ve||(Ve={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(He||(He={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Ue||(Ue={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(ze||(ze={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(We||(We={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(je||(je={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}($e||($e={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Ke||(Ke={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Ye||(Ye={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(qe||(qe={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Xe||(Xe={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Ze||(Ze={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Qe||(Qe={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Je||(Je={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(et||(et={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(tt||(tt={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(it||(it={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(nt||(nt={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(st||(st={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(rt||(rt={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(ot||(ot={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(at||(at={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(lt||(lt={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(ct||(ct={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(ht||(ht={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(ut||(ut={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(dt||(dt={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(pt||(pt={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(gt||(gt={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(ft||(ft={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(mt||(mt={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(yt||(yt={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(vt||(vt={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(bt||(bt={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Ct||(Ct={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(wt||(wt={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(St||(St={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(xt||(xt={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Et||(Et={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(At||(At={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Mt||(Mt={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Tt||(Tt={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Dt||(Dt={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(It||(It={})),function(e){e.filterSensitiveLog=function(e){return(0,Qt.__assign)({},e)}}(Rt||(Rt={}));var Jt=i(59027),ei=i(11538),ti=function(e,t){return(0,Qt.__awaiter)(void 0,void 0,void 0,function(){var i,n,s,r,o,a,l,c,h,u,d,p,g,f;return(0,Qt.__generator)(this,function(m){switch(m.label){case 0:return n=[(0,Qt.__assign)({},e)],f={},[4,Ei(e.body,t)];case 1:switch(i=Qt.__assign.apply(void 0,n.concat([(f.body=m.sent(),f)])),r="UnknownError",r=Ai(e,i.body)){case"BadRequestException":case"com.amazonaws.pinpoint#BadRequestException":return[3,2];case"ForbiddenException":case"com.amazonaws.pinpoint#ForbiddenException":return[3,4];case"InternalServerErrorException":case"com.amazonaws.pinpoint#InternalServerErrorException":return[3,6];case"MethodNotAllowedException":case"com.amazonaws.pinpoint#MethodNotAllowedException":return[3,8];case"NotFoundException":case"com.amazonaws.pinpoint#NotFoundException":return[3,10];case"PayloadTooLargeException":case"com.amazonaws.pinpoint#PayloadTooLargeException":return[3,12];case"TooManyRequestsException":case"com.amazonaws.pinpoint#TooManyRequestsException":return[3,14]}return[3,16];case 2:return o=[{}],[4,ni(i,t)];case 3:return s=Qt.__assign.apply(void 0,[Qt.__assign.apply(void 0,o.concat([m.sent()])),{name:r,$metadata:xi(e)}]),[3,17];case 4:return a=[{}],[4,si(i,t)];case 5:return s=Qt.__assign.apply(void 0,[Qt.__assign.apply(void 0,a.concat([m.sent()])),{name:r,$metadata:xi(e)}]),[3,17];case 6:return l=[{}],[4,ri(i,t)];case 7:return s=Qt.__assign.apply(void 0,[Qt.__assign.apply(void 0,l.concat([m.sent()])),{name:r,$metadata:xi(e)}]),[3,17];case 8:return c=[{}],[4,oi(i,t)];case 9:return s=Qt.__assign.apply(void 0,[Qt.__assign.apply(void 0,c.concat([m.sent()])),{name:r,$metadata:xi(e)}]),[3,17];case 10:return h=[{}],[4,ai(i,t)];case 11:return s=Qt.__assign.apply(void 0,[Qt.__assign.apply(void 0,h.concat([m.sent()])),{name:r,$metadata:xi(e)}]),[3,17];case 12:return u=[{}],[4,li(i,t)];case 13:return s=Qt.__assign.apply(void 0,[Qt.__assign.apply(void 0,u.concat([m.sent()])),{name:r,$metadata:xi(e)}]),[3,17];case 14:return d=[{}],[4,ci(i,t)];case 15:return s=Qt.__assign.apply(void 0,[Qt.__assign.apply(void 0,d.concat([m.sent()])),{name:r,$metadata:xi(e)}]),[3,17];case 16:p=i.body,r=p.code||p.Code||r,s=(0,Qt.__assign)((0,Qt.__assign)({},p),{name:""+r,message:p.message||p.Message||r,$fault:"client",$metadata:xi(e)}),m.label=17;case 17:return g=s.message||s.Message||r,s.message=g,delete s.Message,[2,Promise.reject(Object.assign(new Error(g),s))]}})})},ii=function(e,t){return(0,Qt.__awaiter)(void 0,void 0,void 0,function(){var i,n,s,r,o,a,l,c,h,u,d,p,g,f;return(0,Qt.__generator)(this,function(m){switch(m.label){case 0:return n=[(0,Qt.__assign)({},e)],f={},[4,Ei(e.body,t)];case 1:switch(i=Qt.__assign.apply(void 0,n.concat([(f.body=m.sent(),f)])),r="UnknownError",r=Ai(e,i.body)){case"BadRequestException":case"com.amazonaws.pinpoint#BadRequestException":return[3,2];case"ForbiddenException":case"com.amazonaws.pinpoint#ForbiddenException":return[3,4];case"InternalServerErrorException":case"com.amazonaws.pinpoint#InternalServerErrorException":return[3,6];case"MethodNotAllowedException":case"com.amazonaws.pinpoint#MethodNotAllowedException":return[3,8];case"NotFoundException":case"com.amazonaws.pinpoint#NotFoundException":return[3,10];case"PayloadTooLargeException":case"com.amazonaws.pinpoint#PayloadTooLargeException":return[3,12];case"TooManyRequestsException":case"com.amazonaws.pinpoint#TooManyRequestsException":return[3,14]}return[3,16];case 2:return o=[{}],[4,ni(i,t)];case 3:return s=Qt.__assign.apply(void 0,[Qt.__assign.apply(void 0,o.concat([m.sent()])),{name:r,$metadata:xi(e)}]),[3,17];case 4:return a=[{}],[4,si(i,t)];case 5:return s=Qt.__assign.apply(void 0,[Qt.__assign.apply(void 0,a.concat([m.sent()])),{name:r,$metadata:xi(e)}]),[3,17];case 6:return l=[{}],[4,ri(i,t)];case 7:return s=Qt.__assign.apply(void 0,[Qt.__assign.apply(void 0,l.concat([m.sent()])),{name:r,$metadata:xi(e)}]),[3,17];case 8:return c=[{}],[4,oi(i,t)];case 9:return s=Qt.__assign.apply(void 0,[Qt.__assign.apply(void 0,c.concat([m.sent()])),{name:r,$metadata:xi(e)}]),[3,17];case 10:return h=[{}],[4,ai(i,t)];case 11:return s=Qt.__assign.apply(void 0,[Qt.__assign.apply(void 0,h.concat([m.sent()])),{name:r,$metadata:xi(e)}]),[3,17];case 12:return u=[{}],[4,li(i,t)];case 13:return s=Qt.__assign.apply(void 0,[Qt.__assign.apply(void 0,u.concat([m.sent()])),{name:r,$metadata:xi(e)}]),[3,17];case 14:return d=[{}],[4,ci(i,t)];case 15:return s=Qt.__assign.apply(void 0,[Qt.__assign.apply(void 0,d.concat([m.sent()])),{name:r,$metadata:xi(e)}]),[3,17];case 16:p=i.body,r=p.code||p.Code||r,s=(0,Qt.__assign)((0,Qt.__assign)({},p),{name:""+r,message:p.message||p.Message||r,$fault:"client",$metadata:xi(e)}),m.label=17;case 17:return g=s.message||s.Message||r,s.message=g,delete s.Message,[2,Promise.reject(Object.assign(new Error(g),s))]}})})},ni=function(e,t){return(0,Qt.__awaiter)(void 0,void 0,void 0,function(){var t,i;return(0,Qt.__generator)(this,function(n){return t={name:"BadRequestException",$fault:"client",$metadata:xi(e),Message:void 0,RequestID:void 0},void 0!==(i=e.body).Message&&null!==i.Message&&(t.Message=i.Message),void 0!==i.RequestID&&null!==i.RequestID&&(t.RequestID=i.RequestID),[2,t]})})},si=function(e,t){return(0,Qt.__awaiter)(void 0,void 0,void 0,function(){var t,i;return(0,Qt.__generator)(this,function(n){return t={name:"ForbiddenException",$fault:"client",$metadata:xi(e),Message:void 0,RequestID:void 0},void 0!==(i=e.body).Message&&null!==i.Message&&(t.Message=i.Message),void 0!==i.RequestID&&null!==i.RequestID&&(t.RequestID=i.RequestID),[2,t]})})},ri=function(e,t){return(0,Qt.__awaiter)(void 0,void 0,void 0,function(){var t,i;return(0,Qt.__generator)(this,function(n){return t={name:"InternalServerErrorException",$fault:"server",$metadata:xi(e),Message:void 0,RequestID:void 0},void 0!==(i=e.body).Message&&null!==i.Message&&(t.Message=i.Message),void 0!==i.RequestID&&null!==i.RequestID&&(t.RequestID=i.RequestID),[2,t]})})},oi=function(e,t){return(0,Qt.__awaiter)(void 0,void 0,void 0,function(){var t,i;return(0,Qt.__generator)(this,function(n){return t={name:"MethodNotAllowedException",$fault:"client",$metadata:xi(e),Message:void 0,RequestID:void 0},void 0!==(i=e.body).Message&&null!==i.Message&&(t.Message=i.Message),void 0!==i.RequestID&&null!==i.RequestID&&(t.RequestID=i.RequestID),[2,t]})})},ai=function(e,t){return(0,Qt.__awaiter)(void 0,void 0,void 0,function(){var t,i;return(0,Qt.__generator)(this,function(n){return t={name:"NotFoundException",$fault:"client",$metadata:xi(e),Message:void 0,RequestID:void 0},void 0!==(i=e.body).Message&&null!==i.Message&&(t.Message=i.Message),void 0!==i.RequestID&&null!==i.RequestID&&(t.RequestID=i.RequestID),[2,t]})})},li=function(e,t){return(0,Qt.__awaiter)(void 0,void 0,void 0,function(){var t,i;return(0,Qt.__generator)(this,function(n){return t={name:"PayloadTooLargeException",$fault:"client",$metadata:xi(e),Message:void 0,RequestID:void 0},void 0!==(i=e.body).Message&&null!==i.Message&&(t.Message=i.Message),void 0!==i.RequestID&&null!==i.RequestID&&(t.RequestID=i.RequestID),[2,t]})})},ci=function(e,t){return(0,Qt.__awaiter)(void 0,void 0,void 0,function(){var t,i;return(0,Qt.__generator)(this,function(n){return t={name:"TooManyRequestsException",$fault:"client",$metadata:xi(e),Message:void 0,RequestID:void 0},void 0!==(i=e.body).Message&&null!==i.Message&&(t.Message=i.Message),void 0!==i.RequestID&&null!==i.RequestID&&(t.RequestID=i.RequestID),[2,t]})})},hi=function(e,t){return(0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)({},void 0!==e.AppVersion&&null!==e.AppVersion&&{AppVersion:e.AppVersion}),void 0!==e.Locale&&null!==e.Locale&&{Locale:e.Locale}),void 0!==e.Make&&null!==e.Make&&{Make:e.Make}),void 0!==e.Model&&null!==e.Model&&{Model:e.Model}),void 0!==e.ModelVersion&&null!==e.ModelVersion&&{ModelVersion:e.ModelVersion}),void 0!==e.Platform&&null!==e.Platform&&{Platform:e.Platform}),void 0!==e.PlatformVersion&&null!==e.PlatformVersion&&{PlatformVersion:e.PlatformVersion}),void 0!==e.Timezone&&null!==e.Timezone&&{Timezone:e.Timezone})},ui=function(e,t){return(0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)({},void 0!==e.City&&null!==e.City&&{City:e.City}),void 0!==e.Country&&null!==e.Country&&{Country:e.Country}),void 0!==e.Latitude&&null!==e.Latitude&&{Latitude:e.Latitude}),void 0!==e.Longitude&&null!==e.Longitude&&{Longitude:e.Longitude}),void 0!==e.PostalCode&&null!==e.PostalCode&&{PostalCode:e.PostalCode}),void 0!==e.Region&&null!==e.Region&&{Region:e.Region})},di=function(e,t){return(0,Qt.__assign)((0,Qt.__assign)({},void 0!==e.UserAttributes&&null!==e.UserAttributes&&{UserAttributes:yi(e.UserAttributes,t)}),void 0!==e.UserId&&null!==e.UserId&&{UserId:e.UserId})},pi=function(e,t){return Object.entries(e).reduce(function(e,t){var i,n=(0,Qt.__read)(t,2),s=n[0],r=n[1];return null===r?e:(0,Qt.__assign)((0,Qt.__assign)({},e),((i={})[s]=r,i))},{})},gi=function(e,t){return Object.entries(e).reduce(function(e,t){var i,n=(0,Qt.__read)(t,2),s=n[0],r=n[1];return null===r?e:(0,Qt.__assign)((0,Qt.__assign)({},e),((i={})[s]=r,i))},{})},fi=function(e,t){return Object.entries(e).reduce(function(e,i){var n,s=(0,Qt.__read)(i,2),r=s[0],o=s[1];return null===o?e:(0,Qt.__assign)((0,Qt.__assign)({},e),((n={})[r]=function(e,t){return(0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)({},void 0!==e.AppPackageName&&null!==e.AppPackageName&&{AppPackageName:e.AppPackageName}),void 0!==e.AppTitle&&null!==e.AppTitle&&{AppTitle:e.AppTitle}),void 0!==e.AppVersionCode&&null!==e.AppVersionCode&&{AppVersionCode:e.AppVersionCode}),void 0!==e.Attributes&&null!==e.Attributes&&{Attributes:gi(e.Attributes)}),void 0!==e.ClientSdkVersion&&null!==e.ClientSdkVersion&&{ClientSdkVersion:e.ClientSdkVersion}),void 0!==e.EventType&&null!==e.EventType&&{EventType:e.EventType}),void 0!==e.Metrics&&null!==e.Metrics&&{Metrics:pi(e.Metrics,t)}),void 0!==e.SdkName&&null!==e.SdkName&&{SdkName:e.SdkName}),void 0!==e.Session&&null!==e.Session&&{Session:bi(e.Session,t)}),void 0!==e.Timestamp&&null!==e.Timestamp&&{Timestamp:e.Timestamp})}(o,t),n))},{})},mi=function(e,t){return Object.entries(e).reduce(function(e,i){var n,s=(0,Qt.__read)(i,2),r=s[0],o=s[1];return null===o?e:(0,Qt.__assign)((0,Qt.__assign)({},e),((n={})[r]=function(e,t){return(0,Qt.__assign)((0,Qt.__assign)({},void 0!==e.Endpoint&&null!==e.Endpoint&&{Endpoint:vi(e.Endpoint,t)}),void 0!==e.Events&&null!==e.Events&&{Events:fi(e.Events,t)})}(o,t),n))},{})},yi=function(e,t){return Object.entries(e).reduce(function(e,t){var i,n=(0,Qt.__read)(t,2),s=n[0],r=n[1];return null===r?e:(0,Qt.__assign)((0,Qt.__assign)({},e),((i={})[s]=function(e){return e.filter(function(e){return null!=e}).map(function(e){return null===e?null:e})}(r),i))},{})},vi=function(e,t){return(0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)({},void 0!==e.Address&&null!==e.Address&&{Address:e.Address}),void 0!==e.Attributes&&null!==e.Attributes&&{Attributes:yi(e.Attributes,t)}),void 0!==e.ChannelType&&null!==e.ChannelType&&{ChannelType:e.ChannelType}),void 0!==e.Demographic&&null!==e.Demographic&&{Demographic:hi(e.Demographic)}),void 0!==e.EffectiveDate&&null!==e.EffectiveDate&&{EffectiveDate:e.EffectiveDate}),void 0!==e.EndpointStatus&&null!==e.EndpointStatus&&{EndpointStatus:e.EndpointStatus}),void 0!==e.Location&&null!==e.Location&&{Location:ui(e.Location)}),void 0!==e.Metrics&&null!==e.Metrics&&{Metrics:pi(e.Metrics,t)}),void 0!==e.OptOut&&null!==e.OptOut&&{OptOut:e.OptOut}),void 0!==e.RequestId&&null!==e.RequestId&&{RequestId:e.RequestId}),void 0!==e.User&&null!==e.User&&{User:di(e.User,t)})},bi=function(e,t){return(0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)({},void 0!==e.Duration&&null!==e.Duration&&{Duration:e.Duration}),void 0!==e.Id&&null!==e.Id&&{Id:e.Id}),void 0!==e.StartTimestamp&&null!==e.StartTimestamp&&{StartTimestamp:e.StartTimestamp}),void 0!==e.StopTimestamp&&null!==e.StopTimestamp&&{StopTimestamp:e.StopTimestamp})},Ci=function(e,t){return{Message:void 0!==e.Message&&null!==e.Message?e.Message:void 0,StatusCode:void 0!==e.StatusCode&&null!==e.StatusCode?e.StatusCode:void 0}},wi=function(e,t){return Object.entries(e).reduce(function(e,t){var i,n=(0,Qt.__read)(t,2),s=n[0],r=n[1];return null===r?e:(0,Qt.__assign)((0,Qt.__assign)({},e),((i={})[s]=function(e){return{Message:void 0!==e.Message&&null!==e.Message?e.Message:void 0,StatusCode:void 0!==e.StatusCode&&null!==e.StatusCode?e.StatusCode:void 0}}(r),i))},{})},Si=function(e,t){return Object.entries(e).reduce(function(e,t){var i,n=(0,Qt.__read)(t,2),s=n[0],r=n[1];return null===r?e:(0,Qt.__assign)((0,Qt.__assign)({},e),((i={})[s]=function(e){return{EndpointItemResponse:void 0!==e.EndpointItemResponse&&null!==e.EndpointItemResponse?Ci(e.EndpointItemResponse):void 0,EventsItemResponse:void 0!==e.EventsItemResponse&&null!==e.EventsItemResponse?wi(e.EventsItemResponse):void 0}}(r),i))},{})},xi=function(e){var t;return{httpStatusCode:e.statusCode,requestId:null!==(t=e.headers["x-amzn-requestid"])&&void 0!==t?t:e.headers["x-amzn-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}},Ei=function(e,t){return function(e,t){return function(e,t){return void 0===e&&(e=new Uint8Array),e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array)}(e,t).then(function(e){return t.utf8Encoder(e)})}(e,t).then(function(e){return e.length?JSON.parse(e):{}})},Ai=function(e,t){var i,n=function(e){var t=e;return t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},s=(i=e.headers,Object.keys(i).find(function(e){return e.toLowerCase()==="x-amzn-errortype".toLowerCase()}));return void 0!==s?n(e.headers[s]):void 0!==t.code?n(t.code):void 0!==t.__type?n(t.__type):""},Mi=i(74052),Ti=function(e){function t(t){var i=e.call(this)||this;return i.input=t,i}return(0,Qt.__extends)(t,e),t.prototype.resolveMiddleware=function(e,t,i){this.middlewareStack.use((0,Mi.TM)(t,this.serialize,this.deserialize));var n=e.concat(this.middlewareStack),s={logger:t.logger,clientName:"PinpointClient",commandName:"PutEventsCommand",inputFilterSensitiveLog:ve.filterSensitiveLog,outputFilterSensitiveLog:be.filterSensitiveLog},r=t.requestHandler;return n.resolve(function(e){return r.handle(e.request,i||{})},s)},t.prototype.serialize=function(e,t){return function(e,t){return(0,Qt.__awaiter)(void 0,void 0,void 0,function(){var i,n,s,r,o,a,l,c,h;return(0,Qt.__generator)(this,function(u){switch(u.label){case 0:if(i={"content-type":"application/json"},n="/v1/apps/{ApplicationId}/events",void 0===e.ApplicationId)throw new Error("No value provided for input HTTP label: ApplicationId.");if((s=e.ApplicationId).length<=0)throw new Error("Empty value provided for input HTTP label: ApplicationId.");return n=n.replace("{ApplicationId}",(0,ei.$6)(s)),void 0!==e.EventsRequest&&(r=function(e,t){return(0,Qt.__assign)({},void 0!==e.BatchItem&&null!==e.BatchItem&&{BatchItem:mi(e.BatchItem,t)})}(e.EventsRequest,t)),void 0===r&&(r={}),r=JSON.stringify(r),[4,t.endpoint()];case 1:return o=u.sent(),a=o.hostname,l=o.protocol,c=void 0===l?"https":l,h=o.port,[2,new Jt.Kd({protocol:c,hostname:a,port:h,method:"POST",headers:i,path:n,body:r})]}})})}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return(0,Qt.__awaiter)(void 0,void 0,void 0,function(){var i,n;return(0,Qt.__generator)(this,function(s){switch(s.label){case 0:return 202!==e.statusCode&&e.statusCode>=300?[2,ti(e,t)]:(i={$metadata:xi(e),EventsResponse:void 0},[4,Ei(e.body,t)]);case 1:return n=s.sent(),i.EventsResponse=function(e,t){return{Results:void 0!==e.Results&&null!==e.Results?Si(e.Results,t):void 0}}(n,t),[2,Promise.resolve(i)]}})})}(e,t)},t}(ei.uB),Di=function(e){function t(t){var i=e.call(this)||this;return i.input=t,i}return(0,Qt.__extends)(t,e),t.prototype.resolveMiddleware=function(e,t,i){this.middlewareStack.use((0,Mi.TM)(t,this.serialize,this.deserialize));var n=e.concat(this.middlewareStack),s={logger:t.logger,clientName:"PinpointClient",commandName:"UpdateEndpointCommand",inputFilterSensitiveLog:tt.filterSensitiveLog,outputFilterSensitiveLog:it.filterSensitiveLog},r=t.requestHandler;return n.resolve(function(e){return r.handle(e.request,i||{})},s)},t.prototype.serialize=function(e,t){return function(e,t){return(0,Qt.__awaiter)(void 0,void 0,void 0,function(){var i,n,s,r,o,a,l,c,h;return(0,Qt.__generator)(this,function(u){switch(u.label){case 0:if(i={"content-type":"application/json"},n="/v1/apps/{ApplicationId}/endpoints/{EndpointId}",void 0===e.ApplicationId)throw new Error("No value provided for input HTTP label: ApplicationId.");if((s=e.ApplicationId).length<=0)throw new Error("Empty value provided for input HTTP label: ApplicationId.");if(n=n.replace("{ApplicationId}",(0,ei.$6)(s)),void 0===e.EndpointId)throw new Error("No value provided for input HTTP label: EndpointId.");if((s=e.EndpointId).length<=0)throw new Error("Empty value provided for input HTTP label: EndpointId.");return n=n.replace("{EndpointId}",(0,ei.$6)(s)),void 0!==e.EndpointRequest&&(r=function(e,t){return(0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)((0,Qt.__assign)({},void 0!==e.Address&&null!==e.Address&&{Address:e.Address}),void 0!==e.Attributes&&null!==e.Attributes&&{Attributes:yi(e.Attributes,t)}),void 0!==e.ChannelType&&null!==e.ChannelType&&{ChannelType:e.ChannelType}),void 0!==e.Demographic&&null!==e.Demographic&&{Demographic:hi(e.Demographic)}),void 0!==e.EffectiveDate&&null!==e.EffectiveDate&&{EffectiveDate:e.EffectiveDate}),void 0!==e.EndpointStatus&&null!==e.EndpointStatus&&{EndpointStatus:e.EndpointStatus}),void 0!==e.Location&&null!==e.Location&&{Location:ui(e.Location)}),void 0!==e.Metrics&&null!==e.Metrics&&{Metrics:pi(e.Metrics,t)}),void 0!==e.OptOut&&null!==e.OptOut&&{OptOut:e.OptOut}),void 0!==e.RequestId&&null!==e.RequestId&&{RequestId:e.RequestId}),void 0!==e.User&&null!==e.User&&{User:di(e.User,t)})}(e.EndpointRequest,t)),void 0===r&&(r={}),r=JSON.stringify(r),[4,t.endpoint()];case 1:return o=u.sent(),a=o.hostname,l=o.protocol,c=void 0===l?"https":l,h=o.port,[2,new Jt.Kd({protocol:c,hostname:a,port:h,method:"PUT",headers:i,path:n,body:r})]}})})}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return(0,Qt.__awaiter)(void 0,void 0,void 0,function(){var i,n;return(0,Qt.__generator)(this,function(s){switch(s.label){case 0:return 202!==e.statusCode&&e.statusCode>=300?[2,ii(e,t)]:(i={$metadata:xi(e),MessageBody:void 0},[4,Ei(e.body,t)]);case 1:return n=s.sent(),i.MessageBody=function(e){return{Message:void 0!==e.Message&&null!==e.Message?e.Message:void 0,RequestID:void 0!==e.RequestID&&null!==e.RequestID?e.RequestID:void 0}}(n),[2,Promise.resolve(i)]}})})}(e,t)},t}(ei.uB),Ii=i(54218),Ri=i(22292),ki=i(10078),Pi=i(16307),_i=i(68380),Li=i(93972),Ni=i(39448),Oi=i(31643),Fi="pinpoint.{region}.amazonaws.com",Gi=new Set(["af-south-1","ap-east-1","ap-northeast-1","ap-northeast-2","ap-south-1","ap-southeast-1","ap-southeast-2","ca-central-1","eu-central-1","eu-north-1","eu-south-1","eu-west-1","eu-west-2","eu-west-3","me-south-1","sa-east-1","us-east-1","us-east-2","us-west-1","us-west-2"]),Bi=new Set(["cn-north-1","cn-northwest-1"]),Vi=new Set(["us-iso-east-1"]),Hi=new Set(["us-isob-east-1"]),Ui=new Set(["us-gov-east-1","us-gov-west-1"]),zi={apiVersion:"2016-12-01",disableHostPrefix:!1,logger:{},regionInfoProvider:function(e,t){var i=void 0;switch(e){case"ap-northeast-1":i={hostname:"pinpoint.ap-northeast-1.amazonaws.com",partition:"aws",signingService:"mobiletargeting"};break;case"ap-northeast-2":i={hostname:"pinpoint.ap-northeast-2.amazonaws.com",partition:"aws",signingService:"mobiletargeting"};break;case"ap-south-1":i={hostname:"pinpoint.ap-south-1.amazonaws.com",partition:"aws",signingService:"mobiletargeting"};break;case"ap-southeast-1":i={hostname:"pinpoint.ap-southeast-1.amazonaws.com",partition:"aws",signingService:"mobiletargeting"};break;case"ap-southeast-2":i={hostname:"pinpoint.ap-southeast-2.amazonaws.com",partition:"aws",signingService:"mobiletargeting"};break;case"ca-central-1":i={hostname:"pinpoint.ca-central-1.amazonaws.com",partition:"aws",signingService:"mobiletargeting"};break;case"eu-central-1":i={hostname:"pinpoint.eu-central-1.amazonaws.com",partition:"aws",signingService:"mobiletargeting"};break;case"eu-west-1":i={hostname:"pinpoint.eu-west-1.amazonaws.com",partition:"aws",signingService:"mobiletargeting"};break;case"eu-west-2":i={hostname:"pinpoint.eu-west-2.amazonaws.com",partition:"aws",signingService:"mobiletargeting"};break;case"fips-us-east-1":i={hostname:"pinpoint-fips.us-east-1.amazonaws.com",partition:"aws",signingRegion:"us-east-1"};break;case"fips-us-gov-west-1":i={hostname:"pinpoint-fips.us-gov-west-1.amazonaws.com",partition:"aws-us-gov",signingRegion:"us-gov-west-1"};break;case"fips-us-west-2":i={hostname:"pinpoint-fips.us-west-2.amazonaws.com",partition:"aws",signingRegion:"us-west-2"};break;case"us-east-1":i={hostname:"pinpoint.us-east-1.amazonaws.com",partition:"aws",signingRegion:"us-east-1"};break;case"us-gov-west-1":i={hostname:"pinpoint.us-gov-west-1.amazonaws.com",partition:"aws-us-gov",signingRegion:"us-gov-west-1"};break;case"us-west-2":i={hostname:"pinpoint.us-west-2.amazonaws.com",partition:"aws",signingRegion:"us-west-2"};break;default:Gi.has(e)&&(i={hostname:Fi.replace("{region}",e),partition:"aws",signingService:"mobiletargeting"}),Bi.has(e)&&(i={hostname:"pinpoint.{region}.amazonaws.com.cn".replace("{region}",e),partition:"aws-cn"}),Vi.has(e)&&(i={hostname:"pinpoint.{region}.c2s.ic.gov".replace("{region}",e),partition:"aws-iso"}),Hi.has(e)&&(i={hostname:"pinpoint.{region}.sc2s.sgov.gov".replace("{region}",e),partition:"aws-iso-b"}),Ui.has(e)&&(i={hostname:"pinpoint.{region}.amazonaws.com".replace("{region}",e),partition:"aws-us-gov",signingService:"mobiletargeting"}),void 0===i&&(i={hostname:Fi.replace("{region}",e),partition:"aws",signingService:"mobiletargeting"})}return Promise.resolve((0,Qt.__assign)({signingService:"mobiletargeting"},i))},serviceId:"Pinpoint",urlParser:i(2049).D},Wi=(0,Qt.__assign)((0,Qt.__assign)({},zi),{runtime:"browser",base64Decoder:_i.E,base64Encoder:_i.n,bodyLengthChecker:Li.n,credentialDefaultProvider:function(e){return function(){return Promise.reject(new Error("Credential is missing"))}},defaultUserAgentProvider:(0,Ni.m)({serviceId:zi.serviceId,clientVersion:"3.6.1"}),maxAttempts:Pi.Gz,region:(0,ki.B)("Region is missing"),requestHandler:new Ri.N,sha256:Ii.Sha256,streamCollector:Ri.k,utf8Decoder:Oi.fromUtf8,utf8Encoder:Oi.toUtf8}),ji=i(85775),$i=i(23788),Ki=i(14188),Yi=i(64996),qi=i(88428),Xi=i(44625),Zi=function(e){function t(t){var i=this,n=(0,Qt.__assign)((0,Qt.__assign)({},Wi),t),s=(0,ji.TD)(n),r=(0,ji.vJ)(s),o=(0,qi.k9)(r),a=(0,Pi.$z)(o),l=(0,Ki.OV)(a),c=(0,Xi.Dc)(l);return(i=e.call(this,c)||this).config=c,i.middlewareStack.use((0,qi.DF)(i.config)),i.middlewareStack.use((0,Pi.ey)(i.config)),i.middlewareStack.use((0,$i.vK)(i.config)),i.middlewareStack.use((0,Ki.TC)(i.config)),i.middlewareStack.use((0,Yi.Y7)(i.config)),i.middlewareStack.use((0,Xi.sM)(i.config)),i}return(0,Qt.__extends)(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this)},t}(ei.Kj),Qi={keyPrefix:"aws-amplify-cache",capacityInBytes:1048576,itemMaxSize:21e4,defaultTTL:2592e5,defaultPriority:5,warningThreshold:.8,storage:(new(i(75315).i1)).getStorage()};function Ji(e){var t=0;t=e.length;for(var i=e.length;i>=0;i-=1){var n=e.charCodeAt(i);n>127&&n<=2047?t+=1:n>2047&&n<=65535&&(t+=2),n>=56320&&n<=57343&&(i-=1)}return t}function en(){return(new Date).getTime()}function tn(e){return Number.isInteger?Number.isInteger(e):function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}(e)}var nn,sn={},rn=(function(){function e(){}e.clear=function(){sn={}},e.getItem=function(e){return sn[e]||null},e.setItem=function(e,t){sn[e]=t},e.removeItem=function(e){delete sn[e]}}(),new n.C("StorageCache")),on=function(){function e(e){this.config=Object.assign({},e),this.cacheCurSizeKey=this.config.keyPrefix+"CurSize",this.checkConfig()}return e.prototype.getModuleName=function(){return"Cache"},e.prototype.checkConfig=function(){tn(this.config.capacityInBytes)||(rn.error("Invalid parameter: capacityInBytes. It should be an Integer. Setting back to default."),this.config.capacityInBytes=Qi.capacityInBytes),tn(this.config.itemMaxSize)||(rn.error("Invalid parameter: itemMaxSize. It should be an Integer. Setting back to default."),this.config.itemMaxSize=Qi.itemMaxSize),tn(this.config.defaultTTL)||(rn.error("Invalid parameter: defaultTTL. It should be an Integer. Setting back to default."),this.config.defaultTTL=Qi.defaultTTL),tn(this.config.defaultPriority)||(rn.error("Invalid parameter: defaultPriority. It should be an Integer. Setting back to default."),this.config.defaultPriority=Qi.defaultPriority),this.config.itemMaxSize>this.config.capacityInBytes&&(rn.error("Invalid parameter: itemMaxSize. It should be smaller than capacityInBytes. Setting back to default."),this.config.itemMaxSize=Qi.itemMaxSize),(this.config.defaultPriority>5||this.config.defaultPriority<1)&&(rn.error("Invalid parameter: defaultPriority. It should be between 1 and 5. Setting back to default."),this.config.defaultPriority=Qi.defaultPriority),(Number(this.config.warningThreshold)>1||Number(this.config.warningThreshold)<0)&&(rn.error("Invalid parameter: warningThreshold. It should be between 0 and 1. Setting back to default."),this.config.warningThreshold=Qi.warningThreshold),this.config.capacityInBytes>5242880&&(rn.error("Cache Capacity should be less than 5MB. Setting back to default. Setting back to default."),this.config.capacityInBytes=Qi.capacityInBytes)},e.prototype.fillCacheItem=function(e,t,i){var n={key:e,data:t,timestamp:en(),visitedTime:en(),priority:i.priority,expires:i.expires,type:typeof t,byteSize:0};return n.byteSize=Ji(JSON.stringify(n)),n.byteSize=Ji(JSON.stringify(n)),n},e.prototype.configure=function(e){return e?(e.keyPrefix&&rn.warn("Don't try to configure keyPrefix!"),this.config=Object.assign({},this.config,e,e.Cache),this.checkConfig(),this.config):this.config},e}(),an=(nn=function(e,t){return nn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},nn(e,t)},function(e,t){function i(){this.constructor=e}nn(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),ln=new n.C("Cache"),cn=new(function(e){function t(t){var i=this,n=t?Object.assign({},Qi,t):Qi;return(i=e.call(this,n)||this).config.storage=n.storage,i.getItem=i.getItem.bind(i),i.setItem=i.setItem.bind(i),i.removeItem=i.removeItem.bind(i),i}return an(t,e),t.prototype._decreaseCurSizeInBytes=function(e){var t=this.getCacheCurSize();this.config.storage.setItem(this.cacheCurSizeKey,(t-e).toString())},t.prototype._increaseCurSizeInBytes=function(e){var t=this.getCacheCurSize();this.config.storage.setItem(this.cacheCurSizeKey,(t+e).toString())},t.prototype._refreshItem=function(e,t){return e.visitedTime=en(),this.config.storage.setItem(t,JSON.stringify(e)),e},t.prototype._isExpired=function(e){var t=this.config.storage.getItem(e),i=JSON.parse(t);return en()>=i.expires},t.prototype._removeItem=function(e,t){var i=t||JSON.parse(this.config.storage.getItem(e)).byteSize;this._decreaseCurSizeInBytes(i),this.config.storage.removeItem(e)},t.prototype._setItem=function(e,t){this._increaseCurSizeInBytes(t.byteSize);try{this.config.storage.setItem(e,JSON.stringify(t))}catch(e){this._decreaseCurSizeInBytes(t.byteSize),ln.error("Failed to set item "+e)}},t.prototype._sizeToPop=function(e){var t=this.getCacheCurSize()+e-this.config.capacityInBytes,i=(1-this.config.warningThreshold)*this.config.capacityInBytes;return t>i?t:i},t.prototype._isCacheFull=function(e){return e+this.getCacheCurSize()>this.config.capacityInBytes},t.prototype._findValidKeys=function(){for(var e=[],t=[],i=0;i<this.config.storage.length;i+=1)t.push(this.config.storage.key(i));for(i=0;i<t.length;i+=1){var n=t[i];0===n.indexOf(this.config.keyPrefix)&&n!==this.cacheCurSizeKey&&(this._isExpired(n)?this._removeItem(n):e.push(n))}return e},t.prototype._popOutItems=function(e,t){for(var i=[],n=t,s=0;s<e.length;s+=1){var r=this.config.storage.getItem(e[s]);if(null!=r){var o=JSON.parse(r);i.push(o)}}for(i.sort(function(e,t){return e.priority>t.priority?-1:e.priority<t.priority?1:e.visitedTime<t.visitedTime?-1:1}),s=0;s<i.length;s+=1)if(this._removeItem(i[s].key,i[s].byteSize),(n-=i[s].byteSize)<=0)return},t.prototype.setItem=function(e,t,i){ln.log("Set item: key is "+e+", value is "+t+" with options: "+i);var n=this.config.keyPrefix+e;if(n!==this.config.keyPrefix&&n!==this.cacheCurSizeKey)if(void 0!==t){var s={priority:i&&void 0!==i.priority?i.priority:this.config.defaultPriority,expires:i&&void 0!==i.expires?i.expires:this.config.defaultTTL+en()};if(s.priority<1||s.priority>5)ln.warn("Invalid parameter: priority due to out or range. It should be within 1 and 5.");else{var r=this.fillCacheItem(n,t,s);if(r.byteSize>this.config.itemMaxSize)ln.warn("Item with key: "+e+" you are trying to put into is too big!");else try{var o=this.config.storage.getItem(n);if(o&&this._removeItem(n,JSON.parse(o).byteSize),this._isCacheFull(r.byteSize)){var a=this._findValidKeys();if(this._isCacheFull(r.byteSize)){var l=this._sizeToPop(r.byteSize);this._popOutItems(a,l)}}this._setItem(n,r)}catch(e){ln.warn("setItem failed! "+e)}}}else ln.warn("The value of item should not be undefined!");else ln.warn("Invalid key: should not be empty or 'CurSize'")},t.prototype.getItem=function(e,t){ln.log("Get item: key is "+e+" with options "+t);var i=null,n=this.config.keyPrefix+e;if(n===this.config.keyPrefix||n===this.cacheCurSizeKey)return ln.warn("Invalid key: should not be empty or 'CurSize'"),null;try{if(null!=(i=this.config.storage.getItem(n))){if(!this._isExpired(n)){var s=JSON.parse(i);return(s=this._refreshItem(s,n)).data}this._removeItem(n,JSON.parse(i).byteSize),i=null}if(t&&void 0!==t.callback){var r=t.callback();return null!==r&&this.setItem(e,r,t),r}return null}catch(e){return ln.warn("getItem failed! "+e),null}},t.prototype.removeItem=function(e){ln.log("Remove item: key is "+e);var t=this.config.keyPrefix+e;if(t!==this.config.keyPrefix&&t!==this.cacheCurSizeKey)try{var i=this.config.storage.getItem(t);i&&this._removeItem(t,JSON.parse(i).byteSize)}catch(e){ln.warn("removeItem failed! "+e)}},t.prototype.clear=function(){ln.log("Clear Cache");for(var e=[],t=0;t<this.config.storage.length;t+=1){var i=this.config.storage.key(t);0===i.indexOf(this.config.keyPrefix)&&e.push(i)}try{for(t=0;t<e.length;t+=1)this.config.storage.removeItem(e[t])}catch(e){ln.warn("clear failed! "+e)}},t.prototype.getAllKeys=function(){for(var e=[],t=0;t<this.config.storage.length;t+=1){var i=this.config.storage.key(t);0===i.indexOf(this.config.keyPrefix)&&i!==this.cacheCurSizeKey&&e.push(i.substring(this.config.keyPrefix.length))}return e},t.prototype.getCacheCurSize=function(){var e=this.config.storage.getItem(this.cacheCurSizeKey);return e||(this.config.storage.setItem(this.cacheCurSizeKey,"0"),e="0"),Number(e)},t.prototype.createInstance=function(e){return e.keyPrefix&&e.keyPrefix!==Qi.keyPrefix||(ln.error("invalid keyPrefix, setting keyPrefix with timeStamp"),e.keyPrefix=en.toString()),new t(e)},t}(on));const hn=cn;o.HA.register(cn);var un=i(16699),dn=function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,s,r=i.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=r.next()).done;)o.push(n.value)}catch(e){s={error:e}}finally{try{n&&!n.done&&(i=r.return)&&i.call(r)}finally{if(s)throw s.error}}return o},pn=new n.C("EventsBuffer"),gn=[429,500],fn=[202];const mn=function(){function e(e,t){this._pause=!1,this._flush=!1,pn.debug("Instantiating buffer with config:",t),this._buffer=[],this._client=e,this._config=t,this._sendBatch=this._sendBatch.bind(this),this._startLoop()}return e.prototype.push=function(e){var t;if(this._buffer.length>=this._config.bufferSize)return pn.debug("Exceeded analytics events buffer size"),e.handlers.reject(new Error("Exceeded the size of analytics events buffer"));var i=((t={})[e.params.event.eventId]=e,t);this._buffer.push(i)},e.prototype.pause=function(){this._pause=!0},e.prototype.resume=function(){this._pause=!1},e.prototype.updateClient=function(e){this._client=e},e.prototype.flush=function(){this._flush=!0},e.prototype._startLoop=function(){this._interval&&clearInterval(this._interval);var e=this._config.flushInterval;this._interval=setInterval(this._sendBatch,e)},e.prototype._sendBatch=function(){var e=this._buffer.length;if(this._flush&&!e&&clearInterval(this._interval),!this._pause&&e){var t=this._config.flushSize,i=Math.min(t,e),n=this._buffer.splice(0,i);this._putEvents(n)}},e.prototype._putEvents=function(e){return t=this,i=void 0,s=function(){var t,i,n,s,r;return function(e,t){var i,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,n&&(s=2&r[0]?n.return:r[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,r[1])).done)return s;switch(n=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,n=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!((s=(s=o.trys).length>0&&s[s.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){o.label=r[1];break}if(6===r[0]&&o.label<s[1]){o.label=s[1],s=r;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(r);break}s[2]&&o.ops.pop(),o.trys.pop();continue}r=t.call(e,o)}catch(e){r=[6,e],n=0}finally{i=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}}(this,function(o){switch(o.label){case 0:t=this._bufferToMap(e),i=this._generateBatchEventParams(t),o.label=1;case 1:return o.trys.push([1,3,,4]),n=new Ti(i),[4,this._client.send(n)];case 2:return s=o.sent(),this._processPutEventsSuccessResponse(s,t),[3,4];case 3:return r=o.sent(),[2,this._handlePutEventsFailure(r,t)];case 4:return[2]}})},new((n=void 0)||(n=Promise))(function(e,r){function o(e){try{l(s.next(e))}catch(e){r(e)}}function a(e){try{l(s.throw(e))}catch(e){r(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof n?i:new n(function(e){e(i)})).then(o,a)}l((s=s.apply(t,i||[])).next())});var t,i,n,s},e.prototype._generateBatchEventParams=function(e){var t={ApplicationId:"",EventsRequest:{BatchItem:{}}};return Object.values(e).forEach(function(e){var i=e.params,n=i.event,s=i.timestamp,r=i.config,o=n.name,a=n.attributes,l=n.metrics,c=n.eventId,h=n.session,u=r.appId,d=r.endpointId,p=t.EventsRequest.BatchItem;t.ApplicationId=t.ApplicationId||u,p[d]||(p[d]={Endpoint:{},Events:{}}),p[d].Events[c]={EventType:o,Timestamp:new Date(s).toISOString(),Attributes:a,Metrics:l,Session:h}}),t},e.prototype._handlePutEventsFailure=function(e,t){pn.debug("_putEvents Failed: ",e);var i=e.$metadata&&e.$metadata.httpStatusCode;if(gn.includes(i)){var n=Object.values(t);this._retry(n)}},e.prototype._processPutEventsSuccessResponse=function(e,t){var i=e.EventsResponse.Results,n=[];Object.entries(i).forEach(function(e){var i=dn(e,2),s=i[0],r=i[1].EventsItemResponse;Object.entries(r).forEach(function(e){var i,r,o=dn(e,2),a=o[0],l=o[1],c=l.StatusCode,h=l.Message,u=t[a],d={EventsResponse:{Results:(i={},i[s]={EventsItemResponse:(r={},r[a]={StatusCode:c,Message:h},r)},i)}};if(fn.includes(c))u.handlers.resolve(d);else{if(!gn.includes(c)){var p=u.params.event.name;return pn.error("event "+a+" : "+p+" failed with error: "+h),u.handlers.reject(d)}n.push(u)}})}),n.length&&this._retry(n)},e.prototype._retry=function(e){var t,i=[];e.forEach(function(e){var t,n=e.params,s=n.event,r=s.eventId,o=s.name;if(n.resendLimit-- >0)return pn.debug("resending event "+r+" : "+o+" with "+n.resendLimit+" retry attempts remaining"),void i.push((t={},t[r]=e,t));pn.debug("no retry attempts remaining for event "+r+" : "+o)}),(t=this._buffer).unshift.apply(t,function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(dn(arguments[t]));return e}(i))},e.prototype._bufferToMap=function(e){return e.reduce(function(e,t){var i=dn(Object.entries(t),1),n=dn(i[0],2),s=n[0],r=n[1];return e[s]=r,e},{})},e}();var yn=function(){return yn=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var s in t=arguments[i])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},yn.apply(this,arguments)},vn=function(e,t,i,n){return new(i||(i=Promise))(function(s,r){function o(e){try{l(n.next(e))}catch(e){r(e)}}function a(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})},bn=function(e,t){var i,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,n&&(s=2&r[0]?n.return:r[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,r[1])).done)return s;switch(n=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,n=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!((s=(s=o.trys).length>0&&s[s.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){o.label=r[1];break}if(6===r[0]&&o.label<s[1]){o.label=s[1],s=r;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(r);break}s[2]&&o.ops.pop(),o.trys.pop();continue}r=t.call(e,o)}catch(e){r=[6,e],n=0}finally{i=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}},Cn=function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(i[n[s]]=e[n[s]])}return i},wn="undefined"!=typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default",Sn=function(e,t){s.YZ.dispatch("analytics",{event:e,data:t},"Analytics",wn)},xn=new n.C("AWSPinpointProvider"),En=[429,500],An=[202],Mn="_update_endpoint",Tn="_session.stop",Dn="undefined"!=typeof navigator&&navigator&&"function"==typeof navigator.sendBeacon,In=function(){function e(e){this._endpointGenerating=!0,this._endpointUpdateInProgress=!1,this._buffer=null,this._endpointBuffer=[],this._config=e||{},this._config.bufferSize=this._config.bufferSize||1e3,this._config.flushSize=this._config.flushSize||100,this._config.flushInterval=this._config.flushInterval||5e3,this._config.resendLimit=this._config.resendLimit||5,this._clientInfo=kt.clientInfo()}return e.prototype.getCategory=function(){return e.category},e.prototype.getProviderName=function(){return e.providerName},e.prototype.configure=function(e){var t=this;xn.debug("configure Analytics",e);var i=e||{};if(this._config=Object.assign({},this._config,i),this._endpointGenerating=!!e.autoSessionRecord,this._config.appId&&!this._config.disabled)if(this._config.endpointId)Sn("pinpointProvider_configured",null);else{var n=this.getProviderName()+"_"+this._config.appId;this._getEndpointId(n).then(function(e){xn.debug("setting endpoint id from the cache",e),t._config.endpointId=e,Sn("pinpointProvider_configured",null)}).catch(function(e){xn.debug("Failed to generate endpointId",e)})}else this._flushBuffer();return this._config},e.prototype.record=function(e,t){return vn(this,void 0,void 0,function(){var i,n;return bn(this,function(s){switch(s.label){case 0:return xn.debug("_public record",e),[4,this._getCredentials()];case 1:return(i=s.sent())&&this._config.appId&&this._config.region?(this._initClients(i),n=(new Date).getTime(),this._generateSession(e),e.event.eventId=(0,un.v1)(),Object.assign(e,{timestamp:n,config:this._config}),e.event.immediate?[2,this._send(e,t)]:(this._putToBuffer(e,t),[2])):(xn.debug("cannot send events without credentials, applicationId or region"),[2,t.reject(new Error("No credentials, applicationId or region"))])}})})},e.prototype._sendEndpointUpdate=function(e){return vn(this,void 0,void 0,function(){var t;return bn(this,function(i){switch(i.label){case 0:return this._endpointUpdateInProgress?(this._endpointBuffer.push(e),[2]):(this._endpointUpdateInProgress=!0,[4,this._updateEndpoint(e)]);case 1:return i.sent(),t=this._endpointBuffer.shift(),this._endpointUpdateInProgress=!1,t&&this._sendEndpointUpdate(t),[2]}})})},e.prototype._putToBuffer=function(e,t){e.event.name!==Mn?this._buffer&&this._buffer.push({params:e,handlers:t}):this._sendEndpointUpdate({params:e,handlers:t})},e.prototype._generateSession=function(e){this._sessionId=this._sessionId||(0,un.v1)();var t=e.event;switch(t.name){case"_session.start":this._sessionStartTimestamp=(new Date).getTime(),this._sessionId=(0,un.v1)(),t.session={Id:this._sessionId,StartTimestamp:new Date(this._sessionStartTimestamp).toISOString()};break;case Tn:var i=(new Date).getTime();this._sessionStartTimestamp=this._sessionStartTimestamp||(new Date).getTime(),this._sessionId=this._sessionId||(0,un.v1)(),t.session={Id:this._sessionId,Duration:i-this._sessionStartTimestamp,StartTimestamp:new Date(this._sessionStartTimestamp).toISOString(),StopTimestamp:new Date(i).toISOString()},this._sessionId=void 0,this._sessionStartTimestamp=void 0;break;default:this._sessionStartTimestamp=this._sessionStartTimestamp||(new Date).getTime(),this._sessionId=this._sessionId||(0,un.v1)(),t.session={Id:this._sessionId,StartTimestamp:new Date(this._sessionStartTimestamp).toISOString()}}},e.prototype._send=function(e,t){return vn(this,void 0,void 0,function(){return bn(this,function(i){switch(e.event.name){case Mn:return[2,this._updateEndpoint({params:e,handlers:t})];case Tn:return[2,this._pinpointSendStopSession(e,t)];default:return[2,this._pinpointPutEvents(e,t)]}return[2]})})},e.prototype._generateBatchItemContext=function(e){var t,i=e.event,n=e.timestamp,s=e.config,r=i.name,o=i.attributes,a=i.metrics,l=i.eventId,c=i.session,h=s.appId,u=s.endpointId,d={ApplicationId:h,EventsRequest:{BatchItem:{}}},p={Endpoint:{}};return p.Events=((t={})[l]={EventType:r,Timestamp:new Date(n).toISOString(),Attributes:o,Metrics:a,Session:c},t),d.EventsRequest.BatchItem[u]=p,d},e.prototype._pinpointPutEvents=function(e,t){return vn(this,void 0,void 0,function(){var i,n,s,r,o,a,l,c,h,u,d;return bn(this,function(p){switch(p.label){case 0:i=e.event.eventId,n=e.config.endpointId,s=this._generateBatchItemContext(e),r=new Ti(s),p.label=1;case 1:return p.trys.push([1,3,,4]),[4,this.pinpointClient.send(r)];case 2:return o=p.sent(),a=n,l=i,c=o.EventsResponse.Results[a].EventsItemResponse[l],h=c.StatusCode,u=c.Message,An.includes(h)?(xn.debug("record event success. ",o),[2,t.resolve(o)]):En.includes(h)?(this._retry(e,t),[3,4]):(xn.error("Event "+i+" is not accepted, the error is "+u),[2,t.reject(o)]);case 3:return d=p.sent(),this._eventError(d),[2,t.reject(d)];case 4:return[2]}})})},e.prototype._pinpointSendStopSession=function(e,t){if(Dn){var i=this._generateBatchItemContext(e),n=this._config.region,s=i.ApplicationId,r=i.EventsRequest,o={secret_key:this._config.credentials.secretAccessKey,access_key:this._config.credentials.accessKeyId,session_token:this._config.credentials.sessionToken},a="https://pinpoint."+n+".amazonaws.com/v1/apps/"+s+"/events/legacy",l=JSON.stringify(r),c={url:a,body:l,method:"POST"},h={region:n,service:"mobiletargeting"},u=Yt.signUrl(c,o,h,null);return navigator.sendBeacon(u,l)?t.resolve("sendBeacon success"):t.reject("sendBeacon failure")}this._pinpointPutEvents(e,t)},e.prototype._retry=function(e,t){var i=e.config.resendLimit;e.resendLimit="number"==typeof e.resendLimit?e.resendLimit:i,e.resendLimit-- >0?(xn.debug("resending event "+e.eventName+" with "+e.resendLimit+" retry times left"),this._pinpointPutEvents(e,t)):xn.debug("retry times used up for event "+e.eventName)},e.prototype._updateEndpoint=function(e){return vn(this,void 0,void 0,function(){var t,i,n,s,r,o,a,l,c,h,u,d;return bn(this,function(p){switch(p.label){case 0:t=e.params,i=e.handlers,n=t.config,s=t.event,r=n.appId,o=n.endpointId,a=this._endpointRequest(n,qt.JS.transferKeyToLowerCase(s,[],["attributes","userAttributes","Attributes","UserAttributes"])),l={ApplicationId:r,EndpointId:o,EndpointRequest:a},p.label=1;case 1:return p.trys.push([1,3,,4]),c=new Di(l),[4,this.pinpointClient.send(c)];case 2:return h=p.sent(),xn.debug("updateEndpoint success",h),this._endpointGenerating=!1,this._resumeBuffer(),i.resolve(h),[2];case 3:return u=p.sent(),d={err:u,update_params:l,endpointObject:e},[2,this._handleEndpointUpdateFailure(d)];case 4:return[2]}})})},e.prototype._handleEndpointUpdateFailure=function(e){return vn(this,void 0,void 0,function(){var t,i,n;return bn(this,function(s){return t=e.err,i=e.endpointObject,n=t.$metadata&&t.$metadata.httpStatusCode,xn.debug("updateEndpoint error",t),403===n?[2,this._handleEndpointUpdateForbidden(e)]:En.includes(n)?[2,this._retryEndpointUpdate(i,!0)]:(xn.error("updateEndpoint failed",t),i.handlers.reject(t),[2])})})},e.prototype._handleEndpointUpdateForbidden=function(e){var t=e.err,i=e.endpointObject,n=t.code,s=t.retryable;if("ExpiredTokenException"!==n&&!s)return i.handlers.reject(t);this._retryEndpointUpdate(i)},e.prototype._retryEndpointUpdate=function(e,t){void 0===t&&(t=!1),xn.debug("_retryEndpointUpdate",e);var i=e.params,n=i.config.resendLimit;if(i.resendLimit="number"==typeof i.resendLimit?i.resendLimit:n,i.resendLimit-- >0)return xn.debug("resending endpoint update "+i.event.eventId+" with "+i.resendLimit+" retry attempts remaining"),void(this._endpointBuffer.length?this._endpointBuffer.unshift(e):this._updateEndpoint(e));xn.warn("resending endpoint update "+i.event.eventId+" failed after "+i.config.resendLimit+" attempts"),this._endpointGenerating&&xn.error("Initial endpoint update failed. ")},e.prototype._initClients=function(e){return vn(this,void 0,void 0,function(){var t,i;return bn(this,function(n){return xn.debug("init clients"),this.pinpointClient&&this._config.credentials&&this._config.credentials.sessionToken===e.sessionToken&&this._config.credentials.identityId===e.identityId?(xn.debug("no change for aws credentials, directly return from init"),[2]):(t=this._config.credentials?this._config.credentials.identityId:null,this._config.credentials=e,i=this._config.region,xn.debug("init clients with credentials",e),this.pinpointClient=new Zi({region:i,credentials:e,customUserAgent:(0,Xt.fE)()}),this.pinpointClient.middlewareStack.addRelativeTo(function(e){return function(t){return delete t.request.headers["amz-sdk-invocation-id"],delete t.request.headers["amz-sdk-request"],e(t)}},{step:"finalizeRequest",relation:"after",toMiddleware:"retryMiddleware"}),this._bufferExists()&&t===e.identityId?this._updateBufferClient():this._initBuffer(),this._customizePinpointClientReq(),[2])})})},e.prototype._bufferExists=function(){return this._buffer&&this._buffer instanceof mn},e.prototype._initBuffer=function(){this._bufferExists()&&this._flushBuffer(),this._buffer=new mn(this.pinpointClient,this._config),this._endpointGenerating&&this._buffer.pause()},e.prototype._updateBufferClient=function(){this._bufferExists()&&this._buffer.updateClient(this.pinpointClient)},e.prototype._flushBuffer=function(){this._bufferExists()&&(this._buffer.flush(),this._buffer=null)},e.prototype._resumeBuffer=function(){this._bufferExists()&&this._buffer.resume()},e.prototype._customizePinpointClientReq=function(){},e.prototype._getEndpointId=function(e){return vn(this,void 0,void 0,function(){var t,i;return bn(this,function(n){switch(n.label){case 0:return[4,hn.getItem(e)];case 1:return t=n.sent(),xn.debug("endpointId from cache",t,"type",typeof t),t||(t=(0,un.v1)(),i=(new Date).getTime()+31536e8,hn.setItem(e,t,{expires:i,priority:1})),[2,t]}})})},e.prototype._endpointRequest=function(e,t){var i=e.credentials,n=this._clientInfo||{},s=e.clientContext||{},r=e.endpoint||{},o={appVersion:n.appVersion,make:n.make,model:n.model,modelVersion:n.version,platform:n.platform},a=(s.clientId,s.appTitle,s.appVersionName,s.appVersionCode,s.appPackageName,Cn(s,["clientId","appTitle","appVersionName","appVersionCode","appPackageName"])),l=t.address?"android"===n.platform?"GCM":"APNS":void 0,c=yn(yn(yn({channelType:l,requestId:(0,un.v1)(),effectiveDate:(new Date).toISOString()},r),t),{attributes:yn(yn({},r.attributes),t.attributes),demographic:yn(yn(yn(yn({},o),a),r.demographic),t.demographic),location:yn(yn({},r.location),t.location),metrics:yn(yn({},r.metrics),t.metrics),user:{userId:t.userId||r.userId||i.identityId,userAttributes:yn(yn({},r.userAttributes),t.userAttributes)}}),h=(c.userId,c.userAttributes,c.name,c.session,c.eventId,c.immediate,Cn(c,["userId","userAttributes","name","session","eventId","immediate"]));return qt.JS.transferKeyToUpperCase(h,[],["metrics","userAttributes","attributes"])},e.prototype._eventError=function(e){xn.error("record event failed.",e),xn.warn('Please ensure you have updated your Pinpoint IAM Policy with the Action: "mobiletargeting:PutEvents" in order to record events')},e.prototype._getCredentials=function(){return vn(this,void 0,void 0,function(){var e,t;return bn(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,Zt.Ji.get()];case 1:return(e=i.sent())?(xn.debug("set credentials for analytics",e),[2,Zt.Ji.shear(e)]):[2,null];case 2:return t=i.sent(),xn.debug("ensure credentials error",t),[2,null];case 3:return[2]}})})},e.category="Analytics",e.providerName="AWSPinpoint",e}(),Rn=function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,s,r=i.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=r.next()).done;)o.push(n.value)}catch(e){s={error:e}}finally{try{n&&!n.done&&(i=r.return)&&i.call(r)}finally{if(s)throw s.error}}return o},kn=[],Pn=function(){function e(e,t){this.context=e,this.methodName=t,this._originalMethod=e[t].bind(e)}return e.add=function(e,t,i){_n(e,t).set(i)},e.remove=function(e,t){_n(e,t).remove()},e.prototype.set=function(e){var t=this;this.context[this.methodName]=function(){for(var i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];return e(t._originalMethod.apply(t,function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Rn(arguments[t]));return e}(i)))}},e.prototype.remove=function(){this.context[this.methodName]=this._originalMethod},e}();function _n(e,t){var i=kn.filter(function(i){return i.context===e&&i.methodName===t})[0];return i||(i=new Pn(e,t),kn.push(i)),i}var Ln=function(e,t,i,n){return new(i||(i=Promise))(function(s,r){function o(e){try{l(n.next(e))}catch(e){r(e)}}function a(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})},Nn=function(e,t){var i,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,n&&(s=2&r[0]?n.return:r[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,r[1])).done)return s;switch(n=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,n=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!((s=(s=o.trys).length>0&&s[s.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){o.label=r[1];break}if(6===r[0]&&o.label<s[1]){o.label=s[1],s=r;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(r);break}s[2]&&o.ops.pop(),o.trys.pop();continue}r=t.call(e,o)}catch(e){r=[6,e],n=0}finally{i=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}},On=new n.C("PageViewTracker"),Fn="aws-amplify-analytics-prevUrl",Gn={enable:!1,provider:"AWSPinpoint",getUrl:function(){return qt.JS.browserOrNode().isBrowser?window.location.origin+window.location.pathname:""}},Bn=function(){function e(e,t){On.debug("initialize pageview tracker with opts",t),this._config=Object.assign({},Gn,t),this._tracker=e,this._hasEnabled=!1,this._trackFunc=this._trackFunc.bind(this),"SPA"===this._config.type?this._pageViewTrackSPA():this._pageViewTrackDefault()}return e.prototype.configure=function(e){return Object.assign(this._config,e),"SPA"===this._config.type&&this._pageViewTrackSPA(),this._config},e.prototype._isSameUrl=function(){return sessionStorage.getItem(Fn)===this._config.getUrl()&&(On.debug("the url is same"),!0)},e.prototype._pageViewTrackDefault=function(){return Ln(this,void 0,void 0,function(){var e,t,i,n;return Nn(this,function(s){switch(s.label){case 0:return qt.JS.browserOrNode().isBrowser&&window.addEventListener&&window.sessionStorage?(e=this._config.getUrl(),"function"!=typeof this._config.attributes?[3,2]:[4,this._config.attributes()]):(On.debug("not in the supported web enviroment"),[2]);case 1:return i=s.sent(),[3,3];case 2:i=this._config.attributes,s.label=3;case 3:return t=i,n=Object.assign({url:e},t),this._config.enable&&!this._isSameUrl()&&(this._tracker({name:this._config.eventName||"pageView",attributes:n},this._config.provider).catch(function(e){On.debug("Failed to record the page view event",e)}),sessionStorage.setItem(Fn,e)),[2]}})})},e.prototype._trackFunc=function(){return Ln(this,void 0,void 0,function(){var e,t,i,n;return Nn(this,function(s){switch(s.label){case 0:return qt.JS.browserOrNode().isBrowser&&window.addEventListener&&history.pushState&&window.sessionStorage?(e=this._config.getUrl(),"function"!=typeof this._config.attributes?[3,2]:[4,this._config.attributes()]):(On.debug("not in the supported web enviroment"),[2]);case 1:return i=s.sent(),[3,3];case 2:i=this._config.attributes,s.label=3;case 3:return t=i,n=Object.assign({url:e},t),this._isSameUrl()||(this._tracker({name:this._config.eventName||"pageView",attributes:n},this._config.provider).catch(function(e){On.debug("Failed to record the page view event",e)}),sessionStorage.setItem(Fn,e)),[2]}})})},e.prototype._pageViewTrackSPA=function(){qt.JS.browserOrNode().isBrowser&&window.addEventListener&&history.pushState?this._config.enable&&!this._hasEnabled?(Pn.add(history,"pushState",this._trackFunc),Pn.add(history,"replaceState",this._trackFunc),window.addEventListener("popstate",this._trackFunc),this._trackFunc(),this._hasEnabled=!0):(Pn.remove(history,"pushState"),Pn.remove(history,"replaceState"),window.removeEventListener("popstate",this._trackFunc),this._hasEnabled=!1):On.debug("not in the supported web enviroment")},e}();const Vn=Bn;var Hn=qt.JS.browserOrNode().isBrowser&&window.Element?window.Element.prototype:null,Un=Hn?Hn.matches||Hn.matchesSelector||Hn.webkitMatchesSelector||Hn.mozMatchesSelector||Hn.msMatchesSelector||Hn.oMatchesSelector:null;function zn(e,t){if(e&&1===e.nodeType&&t){if("string"==typeof t||1===t.nodeType)return e===t||Wn(e,t);if("length"in t)for(var i=0,n=void 0;n=t[i];i++)if(e===n||Wn(e,n))return!0}return!1}function Wn(e,t){if("string"!=typeof t)return!1;if(Un)return Un.call(e,t);for(var i=e.parentNode.querySelectorAll(t),n=0,s=void 0;s=i[n];n++)if(s===e)return!0;return!1}var jn=new n.C("EventTracker"),$n={enable:!1,events:["click"],selectorPrefix:"data-amplify-analytics-",provider:"AWSPinpoint"};const Kn=function(){function e(e,t){qt.JS.browserOrNode().isBrowser&&window.addEventListener?(this._config=Object.assign({},$n,t),this._tracker=e,this._delegates={},this._trackFunc=this._trackFunc.bind(this),jn.debug("initialize pageview tracker with opts",this._config),this.configure(this._config)):jn.debug("not in the supported web environment")}return e.prototype.configure=function(e){var t=this;if(Object.assign(this._config,e),this._config.enable){if(this._config.enable&&0===Object.keys(this._delegates).length){var i="["+this._config.selectorPrefix+"on]";this._config.events.forEach(function(e){t._delegates[e]=function(e,t,i,n,s){void 0===s&&(s={});var r=function(e){var t;if(s.composed&&"function"==typeof e.composedPath)for(var r=e.composedPath(),o=0,a=void 0;a=r[o];o++)1===a.nodeType&&zn(a,i)&&(t=a);else t=function(e,t,i){if(void 0===i&&(i=!1),e&&1===e.nodeType&&t)for(var n,s=(i?[e]:[]).concat(function(e){for(var t=[],i=e;i&&i.parentNode&&1===i.parentNode.nodeType;)i=i.parentNode,t.push(i);return t}(e)),r=0;n=s[r];r++)if(zn(n,t))return n}(e.target,i,!0);t&&n.call(t,e,t)};return e.addEventListener(t,r,s.useCapture),{destroy:function(){e.removeEventListener(t,r,s.useCapture)}}}(document,e,i,t._trackFunc,{composed:!0,useCapture:!0})})}}else Object.keys(this._delegates).forEach(function(e){"function"==typeof t._delegates[e].destroy&&t._delegates[e].destroy()}),this._delegates={};return this._config},e.prototype._trackFunc=function(e,t){return i=this,n=void 0,r=function(){var i,n,s,r,o,a,l;return function(e,t){var i,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,n&&(s=2&r[0]?n.return:r[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,r[1])).done)return s;switch(n=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,n=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!((s=(s=o.trys).length>0&&s[s.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){o.label=r[1];break}if(6===r[0]&&o.label<s[1]){o.label=s[1],s=r;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(r);break}s[2]&&o.ops.pop(),o.trys.pop();continue}r=t.call(e,o)}catch(e){r=[6,e],n=0}finally{i=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}}(this,function(c){switch(c.label){case 0:return i={},n=t.getAttribute(this._config.selectorPrefix+"on").split(/\s*,\s*/),s=t.getAttribute(this._config.selectorPrefix+"name"),(r=t.getAttribute(this._config.selectorPrefix+"attrs"))&&r.split(/\s*,\s*/).forEach(function(e){var t=e.trim().split(/\s*:\s*/);i[t[0]]=t[1]}),"function"!=typeof this._config.attributes?[3,2]:[4,this._config.attributes()];case 1:return a=c.sent(),[3,3];case 2:a=this._config.attributes,c.label=3;case 3:return o=a,l=Object.assign({type:e.type,target:e.target.localName+" with id "+e.target.id},o,i),jn.debug("events needed to be recorded",n),jn.debug("attributes needed to be attached",i),n.indexOf(e.type)<0?(jn.debug("event "+e.type+" is not selected to be recorded"),[2]):(this._tracker({name:s||"event",attributes:l},this._config.provider).catch(function(t){jn.debug("Failed to record the "+e.type+" event', "+t)}),[2])}})},new((s=void 0)||(s=Promise))(function(e,t){function o(e){try{l(r.next(e))}catch(e){t(e)}}function a(e){try{l(r.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s(function(e){e(i)})).then(o,a)}l((r=r.apply(i,n||[])).next())});var i,n,s,r},e}();var Yn=function(e,t,i,n){return new(i||(i=Promise))(function(s,r){function o(e){try{l(n.next(e))}catch(e){r(e)}}function a(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})},qn=function(e,t){var i,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,n&&(s=2&r[0]?n.return:r[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,r[1])).done)return s;switch(n=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,n=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!((s=(s=o.trys).length>0&&s[s.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){o.label=r[1];break}if(6===r[0]&&o.label<s[1]){o.label=s[1],s=r;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(r);break}s[2]&&o.ops.pop(),o.trys.pop();continue}r=t.call(e,o)}catch(e){r=[6,e],n=0}finally{i=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}},Xn=new n.C("SessionTracker"),Zn={enable:!1,provider:"AWSPinpoint"},Qn=!1;const Jn=function(){function e(e,t){this._config=Object.assign({},Zn,t),this._tracker=e,this._hasEnabled=!1,this._trackFunc=this._trackFunc.bind(this),this._trackBeforeUnload=this._trackBeforeUnload.bind(this),this.configure(this._config)}return e.prototype._envCheck=function(){if(!qt.JS.browserOrNode().isBrowser)return!1;if(!document||!document.addEventListener)return Xn.debug("not in the supported web environment"),!1;if(void 0!==document.hidden)this._hidden="hidden",this._visibilityChange="visibilitychange";else if(void 0!==document.msHidden)this._hidden="msHidden",this._visibilityChange="msvisibilitychange";else{if(void 0===document.webkitHidden)return Xn.debug("not in the supported web environment"),!1;this._hidden="webkitHidden",this._visibilityChange="webkitvisibilitychange"}return!0},e.prototype._trackFunc=function(){return Yn(this,void 0,void 0,function(){var e,t,i;return qn(this,function(n){switch(n.label){case 0:return"function"!=typeof this._config.attributes?[3,2]:[4,this._config.attributes()];case 1:return t=n.sent(),[3,3];case 2:t=this._config.attributes,n.label=3;case 3:return e=t,i=Object.assign({},e),document.visibilityState===this._hidden?this._tracker({name:"_session.stop",attributes:i},this._config.provider).catch(function(e){Xn.debug("record session stop event failed.",e)}):this._tracker({name:"_session.start",attributes:i},this._config.provider).catch(function(e){Xn.debug("record session start event failed.",e)}),[2]}})})},e.prototype._trackBeforeUnload=function(e){var t=this;("function"==typeof this._config.attributes?Promise.resolve(this._config.attributes()):Promise.resolve(this._config.attributes)).then(function(e){var i=Object.assign({},e);t._tracker({name:"_session.stop",attributes:i,immediate:!0},t._config.provider).catch(function(e){Xn.debug("record session stop event failed.",e)})})},e.prototype._sendInitialEvent=function(){return Yn(this,void 0,void 0,function(){var e,t,i;return qn(this,function(n){switch(n.label){case 0:return Qn?(Xn.debug("the start session has been sent when the page is loaded"),[2]):(Qn=!0,"function"!=typeof this._config.attributes?[3,2]:[4,this._config.attributes()]);case 1:return t=n.sent(),[3,3];case 2:t=this._config.attributes,n.label=3;case 3:return e=t,i=Object.assign({},e),this._tracker({name:"_session.start",attributes:i},this._config.provider).catch(function(e){Xn.debug("record session start event failed.",e)}),[2]}})})},e.prototype.configure=function(e){return this._envCheck()?(Object.assign(this._config,e),this._config.enable&&!this._hasEnabled?(this._sendInitialEvent(),document.addEventListener(this._visibilityChange,this._trackFunc,!1),window.addEventListener("beforeunload",this._trackBeforeUnload,!1),this._hasEnabled=!0):!this._config.enable&&this._hasEnabled&&(document.removeEventListener(this._visibilityChange,this._trackFunc,!1),window.removeEventListener("beforeunload",this._trackBeforeUnload,!1),this._hasEnabled=!1),this._config):this._config},e}();var es=function(){return es=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var s in t=arguments[i])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},es.apply(this,arguments)},ts=function(e,t,i,n){return new(i||(i=Promise))(function(s,r){function o(e){try{l(n.next(e))}catch(e){r(e)}}function a(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})},is=function(e,t){var i,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,n&&(s=2&r[0]?n.return:r[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,r[1])).done)return s;switch(n=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,n=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!((s=(s=o.trys).length>0&&s[s.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){o.label=r[1];break}if(6===r[0]&&o.label<s[1]){o.label=s[1],s=r;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(r);break}s[2]&&o.ops.pop(),o.trys.pop();continue}r=t.call(e,o)}catch(e){r=[6,e],n=0}finally{i=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}},ns=new n.C("AnalyticsClass"),ss="undefined"!=typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default",rs={pageView:Vn,event:Kn,session:Jn},os=null,as=function(){function e(){this._config={},this._pluggables=[],this._disabled=!1,this._trackers={},os=this,this.record=this.record.bind(this),s.YZ.listen("auth",us),s.YZ.listen("storage",us),s.YZ.listen("analytics",us)}return e.prototype.getModuleName=function(){return"Analytics"},e.prototype.configure=function(e){var t=this;if(!e)return this._config;ns.debug("configure Analytics",e);var i=r.iX.parseMobilehubConfig(e);return this._config=Object.assign({},this._config,i.Analytics,e),this._config.disabled&&(this._disabled=!0),void 0===this._config.autoSessionRecord&&(this._config.autoSessionRecord=!0),this._pluggables.forEach(function(e){var i="AWSPinpoint"!==e.getProviderName()||t._config.AWSPinpoint?t._config[e.getProviderName()]:t._config;e.configure(es({disabled:t._config.disabled,autoSessionRecord:t._config.autoSessionRecord},i))}),0===this._pluggables.length&&this.addPluggable(new In),s.YZ.dispatch("analytics",{event:"configured",data:null,message:"The Analytics category has been configured successfully"},"Analytics",ss),ns.debug("current configuration",this._config),this._config},e.prototype.addPluggable=function(e){if(e&&"Analytics"===e.getCategory()){this._pluggables.push(e);var t="AWSPinpoint"!==e.getProviderName()||this._config.AWSPinpoint?this._config[e.getProviderName()]:this._config,i=es({disabled:this._config.disabled},t);return e.configure(i),i}},e.prototype.getPluggable=function(e){for(var t=0;t<this._pluggables.length;t+=1){var i=this._pluggables[t];if(i.getProviderName()===e)return i}return ns.debug("No plugin found with providerName",e),null},e.prototype.removePluggable=function(e){for(var t=0;t<this._pluggables.length&&this._pluggables[t].getProviderName()!==e;)t+=1;return t===this._pluggables.length?void ns.debug("No plugin found with providerName",e):void this._pluggables.splice(t,t+1)},e.prototype.disable=function(){this._disabled=!0},e.prototype.enable=function(){this._disabled=!1},e.prototype.startSession=function(e){return ts(this,void 0,void 0,function(){var t;return is(this,function(i){return t={event:{name:"_session.start"},provider:e},[2,this._sendEvent(t)]})})},e.prototype.stopSession=function(e){return ts(this,void 0,void 0,function(){var t;return is(this,function(i){return t={event:{name:"_session.stop"},provider:e},[2,this._sendEvent(t)]})})},e.prototype.record=function(e,t,i){return ts(this,void 0,void 0,function(){var n;return is(this,function(s){return null,n="string"==typeof e?{event:{name:e,attributes:t,metrics:i},provider:"AWSPinpoint"}:{event:e,provider:t},[2,this._sendEvent(n)]})})},e.prototype.updateEndpoint=function(e,t){return ts(this,void 0,void 0,function(){var i;return is(this,function(n){return i=es(es({},e),{name:"_update_endpoint"}),[2,this.record(i,t)]})})},e.prototype._sendEvent=function(e){var t=this;if(this._disabled)return ns.debug("Analytics has been disabled"),Promise.resolve();var i=e.provider?e.provider:"AWSPinpoint";return new Promise(function(n,s){t._pluggables.forEach(function(t){t.getProviderName()===i&&t.record(e,{resolve:n,reject:s})})})},e.prototype.autoTrack=function(e,t){if(rs[e]){"session"===e&&(this._config.autoSessionRecord=t.enable);var i=this._trackers[e];i?i.configure(t):this._trackers[e]=new rs[e](this.record,t)}else ns.debug("invalid tracker type")},e}(),ls=!1,cs=!1,hs=!1,us=function(e){var t=e.channel,i=e.payload;switch(ns.debug("on hub capsule "+t,i),t){case"auth":ps(i);break;case"storage":ds(i);break;case"analytics":gs(i)}},ds=function(e){var t=e.data,i=t.attrs,n=t.metrics;i&&hs&&os.record({name:"Storage",attributes:i,metrics:n}).catch(function(e){ns.debug("Failed to send the storage event automatically",e)})},ps=function(e){var t=e.event;if(t){var i=function(e){return ts(void 0,void 0,void 0,function(){var t;return is(this,function(i){switch(i.label){case 0:if(!cs||!hs)return[3,4];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,os.record({name:"_userauth."+e})];case 2:return[2,i.sent()];case 3:return t=i.sent(),ns.debug("Failed to send the "+e+" event automatically",t),[3,4];case 4:return[2]}})})};switch(t){case"signIn":return i("sign_in");case"signUp":return i("sign_up");case"signOut":return i("sign_out");case"signIn_failure":return i("auth_fail");case"configured":(cs=!0)&&hs&&fs()}}},gs=function(e){var t=e.event;t&&"pinpointProvider_configured"===t&&(hs=!0,cs&&hs&&fs())},fs=function(){var e=os.configure();!ls&&e.autoSessionRecord&&(os.updateEndpoint({immediate:!0}).catch(function(e){ns.debug("Failed to update the endpoint",e)}),ls=!0),os.autoTrack("session",{enable:e.autoSessionRecord})},ms=new as;o.HA.register(ms)},27021(e,t,i){"use strict";var n,s,r;function o(e){return e&&!!["provider"].find(function(t){return e.hasOwnProperty(t)})}function a(e){return void 0!==e.redirectSignIn}i.d(t,{N:()=>Xe}),function(e){e.Cognito="COGNITO",e.Google="Google",e.Facebook="Facebook",e.Amazon="LoginWithAmazon",e.Apple="SignInWithApple"}(n||(n={})),function(e){e.NoConfig="noConfig",e.MissingAuthConfig="missingAuthConfig",e.EmptyUsername="emptyUsername",e.InvalidUsername="invalidUsername",e.EmptyPassword="emptyPassword",e.EmptyCode="emptyCode",e.SignUpError="signUpError",e.NoMFA="noMFA",e.InvalidMFA="invalidMFA",e.EmptyChallengeResponse="emptyChallengeResponse",e.NoUserSession="noUserSession",e.Default="default",e.DeviceConfig="deviceConfig",e.NetworkError="networkError",e.AutoSignInError="autoSignInError"}(s||(s={})),function(e){e.API_KEY="API_KEY",e.AWS_IAM="AWS_IAM",e.OPENID_CONNECT="OPENID_CONNECT",e.AMAZON_COGNITO_USER_POOLS="AMAZON_COGNITO_USER_POOLS",e.AWS_LAMBDA="AWS_LAMBDA"}(r||(r={}));var l,c=i(15567),h=i(51718),u=i(99550),d=i(410),p=i(12599),g=i(51678),f=(0,g.gy)().isBrowser,m=function(){function e(e){void 0===e&&(e={}),this.cookies=new p.A,this.store=f?window.localStorage:Object.create(null),this.cookies=e.req?new p.A(e.req.headers.cookie):new p.A,Object.assign(this.store,this.cookies.getAll())}return Object.defineProperty(e.prototype,"length",{get:function(){return Object.entries(this.store).length},enumerable:!0,configurable:!0}),e.prototype.clear=function(){var e=this;Array.from(new Array(this.length)).map(function(t,i){return e.key(i)}).forEach(function(t){return e.removeItem(t)})},e.prototype.getItem=function(e){return this.getLocalItem(e)},e.prototype.getLocalItem=function(e){return Object.prototype.hasOwnProperty.call(this.store,e)?this.store[e]:null},e.prototype.getUniversalItem=function(e){return this.cookies.get(e)},e.prototype.key=function(e){return Object.keys(this.store)[e]},e.prototype.removeItem=function(e){this.removeLocalItem(e),this.removeUniversalItem(e)},e.prototype.removeLocalItem=function(e){delete this.store[e]},e.prototype.removeUniversalItem=function(e){this.cookies.remove(e,{path:"/"})},e.prototype.setItem=function(e,t){switch(this.setLocalItem(e,t),e.split(".").pop()){case"LastAuthUser":case"accessToken":case"refreshToken":case"idToken":f?this.setUniversalItem(e,t):this.setLocalItem(e,t)}},e.prototype.setLocalItem=function(e,t){this.store[e]=t},e.prototype.setUniversalItem=function(e,t){this.cookies.set(e,t,{path:"/",sameSite:!0,secure:"localhost"!==window.location.hostname})},e}(),y=i(75315),v=i(78953),b=function(){function e(e){var t=e||{},i=t.ValidationData,n=t.Username,s=t.Password,r=t.AuthParameters,o=t.ClientMetadata;this.validationData=i||{},this.authParameters=r||{},this.clientMetadata=o||{},this.username=n,this.password=s}var t=e.prototype;return t.getUsername=function(){return this.username},t.getPassword=function(){return this.password},t.getValidationData=function(){return this.validationData},t.getAuthParameters=function(){return this.authParameters},t.getClientMetadata=function(){return this.clientMetadata},e}(),C=i(74380),w=i(60095),S=i.n(w),x=(i(74842),i(9331)),E=i.n(x),A=i(31939),M=i.n(A);if("undefined"!=typeof window&&window.crypto&&(l=window.crypto),!l&&"undefined"!=typeof window&&window.msCrypto&&(l=window.msCrypto),!l&&"undefined"!=typeof globalThis&&globalThis.crypto&&(l=globalThis.crypto),!l)try{l=i(55595)}catch(e){}function T(){if(l){if("function"==typeof l.getRandomValues)try{return l.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof l.randomBytes)try{return l.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")}var D=function(){function e(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length}var t=e.prototype;return t.random=function(t){for(var i=[],n=0;n<t;n+=4)i.push(T());return new e(i,t)},t.toString=function(){return function(e){for(var t=e.words,i=e.sigBytes,n=[],s=0;s<i;s++){var r=t[s>>>2]>>>24-s%4*8&255;n.push((r>>>4).toString(16)),n.push((15&r).toString(16))}return n.join("")}(this)},e}();const I=R;function R(e,t){null!=e&&this.fromString(e,t)}function k(){return new R(null)}var P,_="undefined"!=typeof navigator;_&&"Microsoft Internet Explorer"==navigator.appName?(R.prototype.am=function(e,t,i,n,s,r){for(var o=32767&t,a=t>>15;--r>=0;){var l=32767&this[e],c=this[e++]>>15,h=a*l+c*o;s=((l=o*l+((32767&h)<<15)+i[n]+(1073741823&s))>>>30)+(h>>>15)+a*c+(s>>>30),i[n++]=1073741823&l}return s},P=30):_&&"Netscape"!=navigator.appName?(R.prototype.am=function(e,t,i,n,s,r){for(;--r>=0;){var o=t*this[e++]+i[n]+s;s=Math.floor(o/67108864),i[n++]=67108863&o}return s},P=26):(R.prototype.am=function(e,t,i,n,s,r){for(var o=16383&t,a=t>>14;--r>=0;){var l=16383&this[e],c=this[e++]>>14,h=a*l+c*o;s=((l=o*l+((16383&h)<<14)+i[n]+s)>>28)+(h>>14)+a*c,i[n++]=268435455&l}return s},P=28),R.prototype.DB=P,R.prototype.DM=(1<<P)-1,R.prototype.DV=1<<P,R.prototype.FV=Math.pow(2,52),R.prototype.F1=52-P,R.prototype.F2=2*P-52;var L,N,O=new Array;for(L="0".charCodeAt(0),N=0;N<=9;++N)O[L++]=N;for(L="a".charCodeAt(0),N=10;N<36;++N)O[L++]=N;for(L="A".charCodeAt(0),N=10;N<36;++N)O[L++]=N;function F(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function G(e,t){var i=O[e.charCodeAt(t)];return null==i?-1:i}function B(e){var t=k();return t.fromInt(e),t}function V(e){var t,i=1;return 0!=(t=e>>>16)&&(e=t,i+=16),0!=(t=e>>8)&&(e=t,i+=8),0!=(t=e>>4)&&(e=t,i+=4),0!=(t=e>>2)&&(e=t,i+=2),0!=(t=e>>1)&&(e=t,i+=1),i}function H(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function U(e){return C.hp.from((new D).random(e).toString(),"hex")}H.prototype.convert=function(e){var t=k();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(R.ZERO)>0&&this.m.subTo(t,t),t},H.prototype.revert=function(e){var t=k();return e.copyTo(t),this.reduce(t),t},H.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var i=32767&e[t],n=i*this.mpl+((i*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[i=t+this.m.t]+=this.m.am(0,n,e,t,0,this.m.t);e[i]>=e.DV;)e[i]-=e.DV,e[++i]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},H.prototype.mulTo=function(e,t,i){e.multiplyTo(t,i),this.reduce(i)},H.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},R.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},R.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},R.prototype.fromString=function(e,t){var i;if(16==t)i=4;else if(8==t)i=3;else if(2==t)i=1;else if(32==t)i=5;else{if(4!=t)throw new Error("Only radix 2, 4, 8, 16, 32 are supported");i=2}this.t=0,this.s=0;for(var n=e.length,s=!1,r=0;--n>=0;){var o=G(e,n);o<0?"-"==e.charAt(n)&&(s=!0):(s=!1,0==r?this[this.t++]=o:r+i>this.DB?(this[this.t-1]|=(o&(1<<this.DB-r)-1)<<r,this[this.t++]=o>>this.DB-r):this[this.t-1]|=o<<r,(r+=i)>=this.DB&&(r-=this.DB))}this.clamp(),s&&R.ZERO.subTo(this,this)},R.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},R.prototype.dlShiftTo=function(e,t){var i;for(i=this.t-1;i>=0;--i)t[i+e]=this[i];for(i=e-1;i>=0;--i)t[i]=0;t.t=this.t+e,t.s=this.s},R.prototype.drShiftTo=function(e,t){for(var i=e;i<this.t;++i)t[i-e]=this[i];t.t=Math.max(this.t-e,0),t.s=this.s},R.prototype.lShiftTo=function(e,t){var i,n=e%this.DB,s=this.DB-n,r=(1<<s)-1,o=Math.floor(e/this.DB),a=this.s<<n&this.DM;for(i=this.t-1;i>=0;--i)t[i+o+1]=this[i]>>s|a,a=(this[i]&r)<<n;for(i=o-1;i>=0;--i)t[i]=0;t[o]=a,t.t=this.t+o+1,t.s=this.s,t.clamp()},R.prototype.rShiftTo=function(e,t){t.s=this.s;var i=Math.floor(e/this.DB);if(i>=this.t)t.t=0;else{var n=e%this.DB,s=this.DB-n,r=(1<<n)-1;t[0]=this[i]>>n;for(var o=i+1;o<this.t;++o)t[o-i-1]|=(this[o]&r)<<s,t[o-i]=this[o]>>n;n>0&&(t[this.t-i-1]|=(this.s&r)<<s),t.t=this.t-i,t.clamp()}},R.prototype.subTo=function(e,t){for(var i=0,n=0,s=Math.min(e.t,this.t);i<s;)n+=this[i]-e[i],t[i++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;i<this.t;)n+=this[i],t[i++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;i<e.t;)n-=e[i],t[i++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t[i++]=this.DV+n:n>0&&(t[i++]=n),t.t=i,t.clamp()},R.prototype.multiplyTo=function(e,t){var i=this.abs(),n=e.abs(),s=i.t;for(t.t=s+n.t;--s>=0;)t[s]=0;for(s=0;s<n.t;++s)t[s+i.t]=i.am(0,n[s],t,s,0,i.t);t.s=0,t.clamp(),this.s!=e.s&&R.ZERO.subTo(t,t)},R.prototype.squareTo=function(e){for(var t=this.abs(),i=e.t=2*t.t;--i>=0;)e[i]=0;for(i=0;i<t.t-1;++i){var n=t.am(i,t[i],e,2*i,0,1);(e[i+t.t]+=t.am(i+1,2*t[i],e,2*i+1,n,t.t-i-1))>=t.DV&&(e[i+t.t]-=t.DV,e[i+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(i,t[i],e,2*i,0,1)),e.s=0,e.clamp()},R.prototype.divRemTo=function(e,t,i){var n=e.abs();if(!(n.t<=0)){var s=this.abs();if(s.t<n.t)return null!=t&&t.fromInt(0),void(null!=i&&this.copyTo(i));null==i&&(i=k());var r=k(),o=this.s,a=e.s,l=this.DB-V(n[n.t-1]);l>0?(n.lShiftTo(l,r),s.lShiftTo(l,i)):(n.copyTo(r),s.copyTo(i));var c=r.t,h=r[c-1];if(0!=h){var u=h*(1<<this.F1)+(c>1?r[c-2]>>this.F2:0),d=this.FV/u,p=(1<<this.F1)/u,g=1<<this.F2,f=i.t,m=f-c,y=null==t?k():t;for(r.dlShiftTo(m,y),i.compareTo(y)>=0&&(i[i.t++]=1,i.subTo(y,i)),R.ONE.dlShiftTo(c,y),y.subTo(r,r);r.t<c;)r[r.t++]=0;for(;--m>=0;){var v=i[--f]==h?this.DM:Math.floor(i[f]*d+(i[f-1]+g)*p);if((i[f]+=r.am(0,v,i,m,0,c))<v)for(r.dlShiftTo(m,y),i.subTo(y,i);i[f]<--v;)i.subTo(y,i)}null!=t&&(i.drShiftTo(c,t),o!=a&&R.ZERO.subTo(t,t)),i.t=c,i.clamp(),l>0&&i.rShiftTo(l,i),o<0&&R.ZERO.subTo(i,i)}}},R.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(!(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},R.prototype.addTo=function(e,t){for(var i=0,n=0,s=Math.min(e.t,this.t);i<s;)n+=this[i]+e[i],t[i++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;i<this.t;)n+=this[i],t[i++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;i<e.t;)n+=e[i],t[i++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t[i++]=n:n<-1&&(t[i++]=this.DV+n),t.t=i,t.clamp()},R.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)throw new Error("Only radix 2, 4, 8, 16, 32 are supported");t=2}var i,n=(1<<t)-1,s=!1,r="",o=this.t,a=this.DB-o*this.DB%t;if(o-- >0)for(a<this.DB&&(i=this[o]>>a)>0&&(s=!0,r=F(i));o>=0;)a<t?(i=(this[o]&(1<<a)-1)<<t-a,i|=this[--o]>>(a+=this.DB-t)):(i=this[o]>>(a-=t)&n,a<=0&&(a+=this.DB,--o)),i>0&&(s=!0),s&&(r+=F(i));return s?r:"0"},R.prototype.negate=function(){var e=k();return R.ZERO.subTo(this,e),e},R.prototype.abs=function(){return this.s<0?this.negate():this},R.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var i=this.t;if(0!=(t=i-e.t))return this.s<0?-t:t;for(;--i>=0;)if(0!=(t=this[i]-e[i]))return t;return 0},R.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+V(this[this.t-1]^this.s&this.DM)},R.prototype.mod=function(e){var t=k();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(R.ZERO)>0&&e.subTo(t,t),t},R.prototype.equals=function(e){return 0==this.compareTo(e)},R.prototype.add=function(e){var t=k();return this.addTo(e,t),t},R.prototype.subtract=function(e){var t=k();return this.subTo(e,t),t},R.prototype.multiply=function(e){var t=k();return this.multiplyTo(e,t),t},R.prototype.divide=function(e){var t=k();return this.divRemTo(e,t,null),t},R.prototype.modPow=function(e,t,i){var n,s=e.bitLength(),r=B(1),o=new H(t);if(s<=0)return r;n=s<18?1:s<48?3:s<144?4:s<768?5:6;var a=new Array,l=3,c=n-1,h=(1<<n)-1;if(a[1]=o.convert(this),n>1){var u=k();for(o.sqrTo(a[1],u);l<=h;)a[l]=k(),o.mulTo(u,a[l-2],a[l]),l+=2}var d,p,g=e.t-1,f=!0,m=k();for(s=V(e[g])-1;g>=0;){for(s>=c?d=e[g]>>s-c&h:(d=(e[g]&(1<<s+1)-1)<<c-s,g>0&&(d|=e[g-1]>>this.DB+s-c)),l=n;!(1&d);)d>>=1,--l;if((s-=l)<0&&(s+=this.DB,--g),f)a[d].copyTo(r),f=!1;else{for(;l>1;)o.sqrTo(r,m),o.sqrTo(m,r),l-=2;l>0?o.sqrTo(r,m):(p=r,r=m,m=p),o.mulTo(m,a[d],r)}for(;g>=0&&!(e[g]&1<<s);)o.sqrTo(r,m),p=r,r=m,m=p,--s<0&&(s=this.DB-1,--g)}var y=o.revert(r);return i(null,y),y},R.ZERO=B(0),R.ONE=B(1);var z=/^[89a-f]/i,W=function(){function e(e){this.N=new I("FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200CBBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF",16),this.g=new I("2",16),this.k=new I(this.hexHash(""+this.padHex(this.N)+this.padHex(this.g)),16),this.smallAValue=this.generateRandomSmallA(),this.getLargeAValue(function(){}),this.infoBits=C.hp.from("Caldera Derived Key","utf8"),this.poolName=e}var t=e.prototype;return t.getSmallAValue=function(){return this.smallAValue},t.getLargeAValue=function(e){var t=this;this.largeAValue?e(null,this.largeAValue):this.calculateA(this.smallAValue,function(i,n){i&&e(i,null),t.largeAValue=n,e(null,t.largeAValue)})},t.generateRandomSmallA=function(){var e=U(128).toString("hex");return new I(e,16)},t.generateRandomString=function(){return U(40).toString("base64")},t.getRandomPassword=function(){return this.randomPassword},t.getSaltDevices=function(){return this.SaltToHashDevices},t.getVerifierDevices=function(){return this.verifierDevices},t.generateHashDevice=function(e,t,i){var n=this;this.randomPassword=this.generateRandomString();var s=""+e+t+":"+this.randomPassword,r=this.hash(s),o=U(16).toString("hex");this.SaltToHashDevices=this.padHex(new I(o,16)),this.g.modPow(new I(this.hexHash(this.SaltToHashDevices+r),16),this.N,function(e,t){e&&i(e,null),n.verifierDevices=n.padHex(t),i(null,null)})},t.calculateA=function(e,t){var i=this;this.g.modPow(e,this.N,function(e,n){e&&t(e,null),n.mod(i.N).equals(I.ZERO)&&t(new Error("Illegal paramater. A mod N cannot be 0."),null),t(null,n)})},t.calculateU=function(e,t){return this.UHexHash=this.hexHash(this.padHex(e)+this.padHex(t)),new I(this.UHexHash,16)},t.hash=function(e){var t=e instanceof C.hp?S().lib.WordArray.create(e):e,i=E()(t).toString();return new Array(64-i.length).join("0")+i},t.hexHash=function(e){return this.hash(C.hp.from(e,"hex"))},t.computehkdf=function(e,t){var i=S().lib.WordArray.create(C.hp.concat([this.infoBits,C.hp.from(String.fromCharCode(1),"utf8")])),n=e instanceof C.hp?S().lib.WordArray.create(e):e,s=t instanceof C.hp?S().lib.WordArray.create(t):t,r=M()(n,s),o=M()(i,r);return C.hp.from(o.toString(),"hex").slice(0,16)},t.getPasswordAuthenticationKey=function(e,t,i,n,s){var r=this;if(i.mod(this.N).equals(I.ZERO))throw new Error("B cannot be zero.");if(this.UValue=this.calculateU(this.largeAValue,i),this.UValue.equals(I.ZERO))throw new Error("U cannot be zero.");var o=""+this.poolName+e+":"+t,a=this.hash(o),l=new I(this.hexHash(this.padHex(n)+a),16);this.calculateS(l,i,function(e,t){e&&s(e,null);var i=r.computehkdf(C.hp.from(r.padHex(t),"hex"),C.hp.from(r.padHex(r.UValue),"hex"));s(null,i)})},t.calculateS=function(e,t,i){var n=this;this.g.modPow(e,this.N,function(s,r){s&&i(s,null),t.subtract(n.k.multiply(r)).modPow(n.smallAValue.add(n.UValue.multiply(e)),n.N,function(e,t){e&&i(e,null),i(null,t.mod(n.N))})})},t.getNewPasswordRequiredChallengeUserAttributePrefix=function(){return"userAttributes."},t.padHex=function(e){if(!(e instanceof I))throw new Error("Not a BigInteger");var t=e.compareTo(I.ZERO)<0,i=e.abs().toString(16);if(i=i.length%2!=0?"0"+i:i,i=z.test(i)?"00"+i:i,t){var n=i.split("").map(function(e){var t=15&~parseInt(e,16);return"0123456789ABCDEF".charAt(t)}).join("");(i=new I(n,16).add(I.ONE).toString(16)).toUpperCase().startsWith("FF8")&&(i=i.substring(2))}return i},e}(),j=function(){function e(e){this.jwtToken=e||"",this.payload=this.decodePayload()}var t=e.prototype;return t.getJwtToken=function(){return this.jwtToken},t.getExpiration=function(){return this.payload.exp},t.getIssuedAt=function(){return this.payload.iat},t.decodePayload=function(){var e=this.jwtToken.split(".")[1];try{return JSON.parse(C.hp.from(e,"base64").toString("utf8"))}catch(e){return{}}},e}();function $(e,t){return $=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},$(e,t)}var K=function(e){var t,i;function n(t){var i=(void 0===t?{}:t).AccessToken;return e.call(this,i||"")||this}return i=e,(t=n).prototype=Object.create(i.prototype),t.prototype.constructor=t,$(t,i),n}(j);function Y(e,t){return Y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Y(e,t)}var q=function(e){var t,i;function n(t){var i=(void 0===t?{}:t).IdToken;return e.call(this,i||"")||this}return i=e,(t=n).prototype=Object.create(i.prototype),t.prototype.constructor=t,Y(t,i),n}(j),X=function(){function e(e){var t=(void 0===e?{}:e).RefreshToken;this.token=t||""}return e.prototype.getToken=function(){return this.token},e}(),Z=i(81716),Q=i.n(Z),J=function(){function e(e){var t=void 0===e?{}:e,i=t.IdToken,n=t.RefreshToken,s=t.AccessToken,r=t.ClockDrift;if(null==s||null==i)throw new Error("Id token and Access Token must be present.");this.idToken=i,this.refreshToken=n,this.accessToken=s,this.clockDrift=void 0===r?this.calculateClockDrift():r}var t=e.prototype;return t.getIdToken=function(){return this.idToken},t.getRefreshToken=function(){return this.refreshToken},t.getAccessToken=function(){return this.accessToken},t.getClockDrift=function(){return this.clockDrift},t.calculateClockDrift=function(){return Math.floor(new Date/1e3)-Math.min(this.accessToken.getIssuedAt(),this.idToken.getIssuedAt())},t.isValid=function(){var e=Math.floor(new Date/1e3)-this.clockDrift;return e<this.accessToken.getExpiration()&&e<this.idToken.getExpiration()},e}(),ee=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],te=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ie=function(){function e(){}return e.prototype.getNowString=function(){var e=new Date,t=te[e.getUTCDay()],i=ee[e.getUTCMonth()],n=e.getUTCDate(),s=e.getUTCHours();s<10&&(s="0"+s);var r=e.getUTCMinutes();r<10&&(r="0"+r);var o=e.getUTCSeconds();return o<10&&(o="0"+o),t+" "+i+" "+n+" "+s+":"+r+":"+o+" UTC "+e.getUTCFullYear()},e}(),ne=function(){function e(e){var t=void 0===e?{}:e,i=t.Name,n=t.Value;this.Name=i||"",this.Value=n||""}var t=e.prototype;return t.getValue=function(){return this.Value},t.setValue=function(e){return this.Value=e,this},t.getName=function(){return this.Name},t.setName=function(e){return this.Name=e,this},t.toString=function(){return JSON.stringify(this)},t.toJSON=function(){return{Name:this.Name,Value:this.Value}},e}(),se={},re=function(){function e(){}return e.setItem=function(e,t){return se[e]=t,se[e]},e.getItem=function(e){return Object.prototype.hasOwnProperty.call(se,e)?se[e]:void 0},e.removeItem=function(e){return delete se[e]},e.clear=function(){return se={}},e}(),oe=function(){function e(){try{this.storageWindow=window.localStorage,this.storageWindow.setItem("aws.cognito.test-ls",1),this.storageWindow.removeItem("aws.cognito.test-ls")}catch(e){this.storageWindow=re}}return e.prototype.getStorage=function(){return this.storageWindow},e}(),ae="undefined"!=typeof navigator?navigator.userAgent:"nodejs",le=function(){function e(e){if(null==e||null==e.Username||null==e.Pool)throw new Error("Username and Pool information are required.");this.username=e.Username||"",this.pool=e.Pool,this.Session=null,this.client=e.Pool.client,this.signInUserSession=null,this.authenticationFlowType="USER_SRP_AUTH",this.storage=e.Storage||(new oe).getStorage(),this.keyPrefix="CognitoIdentityServiceProvider."+this.pool.getClientId(),this.userDataKey=this.keyPrefix+"."+this.username+".userData"}var t=e.prototype;return t.setSignInUserSession=function(e){this.clearCachedUserData(),this.signInUserSession=e,this.cacheTokens()},t.getSignInUserSession=function(){return this.signInUserSession},t.getUsername=function(){return this.username},t.getAuthenticationFlowType=function(){return this.authenticationFlowType},t.setAuthenticationFlowType=function(e){this.authenticationFlowType=e},t.initiateAuth=function(e,t){var i=this,n=e.getAuthParameters();n.USERNAME=this.username;var s=0!==Object.keys(e.getValidationData()).length?e.getValidationData():e.getClientMetadata(),r={AuthFlow:"CUSTOM_AUTH",ClientId:this.pool.getClientId(),AuthParameters:n,ClientMetadata:s};this.getUserContextData()&&(r.UserContextData=this.getUserContextData()),this.client.request("InitiateAuth",r,function(e,n){if(e)return t.onFailure(e);var s=n.ChallengeName,r=n.ChallengeParameters;return"CUSTOM_CHALLENGE"===s?(i.Session=n.Session,t.customChallenge(r)):(i.signInUserSession=i.getCognitoUserSession(n.AuthenticationResult),i.cacheTokens(),t.onSuccess(i.signInUserSession))})},t.authenticateUser=function(e,t){return"USER_PASSWORD_AUTH"===this.authenticationFlowType?this.authenticateUserPlainUsernamePassword(e,t):"USER_SRP_AUTH"===this.authenticationFlowType||"CUSTOM_AUTH"===this.authenticationFlowType?this.authenticateUserDefaultAuth(e,t):t.onFailure(new Error("Authentication flow type is invalid."))},t.authenticateUserDefaultAuth=function(e,t){var i,n,s=this,r=new W(this.pool.getUserPoolName()),o=new ie,a={};null!=this.deviceKey&&(a.DEVICE_KEY=this.deviceKey),a.USERNAME=this.username,r.getLargeAValue(function(l,c){l&&t.onFailure(l),a.SRP_A=c.toString(16),"CUSTOM_AUTH"===s.authenticationFlowType&&(a.CHALLENGE_NAME="SRP_A");var h=0!==Object.keys(e.getValidationData()).length?e.getValidationData():e.getClientMetadata(),u={AuthFlow:s.authenticationFlowType,ClientId:s.pool.getClientId(),AuthParameters:a,ClientMetadata:h};s.getUserContextData(s.username)&&(u.UserContextData=s.getUserContextData(s.username)),s.client.request("InitiateAuth",u,function(a,l){if(a)return t.onFailure(a);var c=l.ChallengeParameters;s.username=c.USER_ID_FOR_SRP,s.userDataKey=s.keyPrefix+"."+s.username+".userData",i=new I(c.SRP_B,16),n=new I(c.SALT,16),s.getCachedDeviceKeyAndPassword(),r.getPasswordAuthenticationKey(s.username,e.getPassword(),i,n,function(e,i){e&&t.onFailure(e);var n=o.getNowString(),a=S().lib.WordArray.create(C.hp.concat([C.hp.from(s.pool.getUserPoolName(),"utf8"),C.hp.from(s.username,"utf8"),C.hp.from(c.SECRET_BLOCK,"base64"),C.hp.from(n,"utf8")])),u=S().lib.WordArray.create(i),d=Q().stringify(M()(a,u)),p={};p.USERNAME=s.username,p.PASSWORD_CLAIM_SECRET_BLOCK=c.SECRET_BLOCK,p.TIMESTAMP=n,p.PASSWORD_CLAIM_SIGNATURE=d,null!=s.deviceKey&&(p.DEVICE_KEY=s.deviceKey);var g={ChallengeName:"PASSWORD_VERIFIER",ClientId:s.pool.getClientId(),ChallengeResponses:p,Session:l.Session,ClientMetadata:h};s.getUserContextData()&&(g.UserContextData=s.getUserContextData()),function e(t,i){return s.client.request("RespondToAuthChallenge",t,function(n,r){return n&&"ResourceNotFoundException"===n.code&&-1!==n.message.toLowerCase().indexOf("device")?(p.DEVICE_KEY=null,s.deviceKey=null,s.randomPassword=null,s.deviceGroupKey=null,s.clearCachedDeviceKeyAndPassword(),e(t,i)):i(n,r)})}(g,function(e,i){return e?t.onFailure(e):s.authenticateUserInternal(i,r,t)})})})})},t.authenticateUserPlainUsernamePassword=function(e,t){var i=this,n={};if(n.USERNAME=this.username,n.PASSWORD=e.getPassword(),n.PASSWORD){var s=new W(this.pool.getUserPoolName());this.getCachedDeviceKeyAndPassword(),null!=this.deviceKey&&(n.DEVICE_KEY=this.deviceKey);var r=0!==Object.keys(e.getValidationData()).length?e.getValidationData():e.getClientMetadata(),o={AuthFlow:"USER_PASSWORD_AUTH",ClientId:this.pool.getClientId(),AuthParameters:n,ClientMetadata:r};this.getUserContextData(this.username)&&(o.UserContextData=this.getUserContextData(this.username)),this.client.request("InitiateAuth",o,function(e,n){return e?t.onFailure(e):i.authenticateUserInternal(n,s,t)})}else t.onFailure(new Error("PASSWORD parameter is required"))},t.authenticateUserInternal=function(e,t,i){var n=this,s=e.ChallengeName,r=e.ChallengeParameters;if("SMS_MFA"===s)return this.Session=e.Session,i.mfaRequired(s,r);if("SELECT_MFA_TYPE"===s)return this.Session=e.Session,i.selectMFAType(s,r);if("MFA_SETUP"===s)return this.Session=e.Session,i.mfaSetup(s,r);if("SOFTWARE_TOKEN_MFA"===s)return this.Session=e.Session,i.totpRequired(s,r);if("CUSTOM_CHALLENGE"===s)return this.Session=e.Session,i.customChallenge(r);if("NEW_PASSWORD_REQUIRED"===s){this.Session=e.Session;var o=null,a=null,l=[],c=t.getNewPasswordRequiredChallengeUserAttributePrefix();if(r&&(o=JSON.parse(e.ChallengeParameters.userAttributes),a=JSON.parse(e.ChallengeParameters.requiredAttributes)),a)for(var h=0;h<a.length;h++)l[h]=a[h].substr(c.length);return i.newPasswordRequired(o,l)}if("DEVICE_SRP_AUTH"===s)return this.Session=e.Session,void this.getDeviceResponse(i);this.signInUserSession=this.getCognitoUserSession(e.AuthenticationResult),this.challengeName=s,this.cacheTokens();var u=e.AuthenticationResult.NewDeviceMetadata;if(null==u)return i.onSuccess(this.signInUserSession);t.generateHashDevice(e.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,e.AuthenticationResult.NewDeviceMetadata.DeviceKey,function(s){if(s)return i.onFailure(s);var r={Salt:C.hp.from(t.getSaltDevices(),"hex").toString("base64"),PasswordVerifier:C.hp.from(t.getVerifierDevices(),"hex").toString("base64")};n.verifierDevices=r.PasswordVerifier,n.deviceGroupKey=u.DeviceGroupKey,n.randomPassword=t.getRandomPassword(),n.client.request("ConfirmDevice",{DeviceKey:u.DeviceKey,AccessToken:n.signInUserSession.getAccessToken().getJwtToken(),DeviceSecretVerifierConfig:r,DeviceName:ae},function(t,s){return t?i.onFailure(t):(n.deviceKey=e.AuthenticationResult.NewDeviceMetadata.DeviceKey,n.cacheDeviceKeyAndPassword(),!0===s.UserConfirmationNecessary?i.onSuccess(n.signInUserSession,s.UserConfirmationNecessary):i.onSuccess(n.signInUserSession))})})},t.completeNewPasswordChallenge=function(e,t,i,n){var s=this;if(!e)return i.onFailure(new Error("New password is required."));var r=new W(this.pool.getUserPoolName()),o=r.getNewPasswordRequiredChallengeUserAttributePrefix(),a={};t&&Object.keys(t).forEach(function(e){a[o+e]=t[e]}),a.NEW_PASSWORD=e,a.USERNAME=this.username;var l={ChallengeName:"NEW_PASSWORD_REQUIRED",ClientId:this.pool.getClientId(),ChallengeResponses:a,Session:this.Session,ClientMetadata:n};this.getUserContextData()&&(l.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",l,function(e,t){return e?i.onFailure(e):s.authenticateUserInternal(t,r,i)})},t.getDeviceResponse=function(e,t){var i=this,n=new W(this.deviceGroupKey),s=new ie,r={};r.USERNAME=this.username,r.DEVICE_KEY=this.deviceKey,n.getLargeAValue(function(o,a){o&&e.onFailure(o),r.SRP_A=a.toString(16);var l={ChallengeName:"DEVICE_SRP_AUTH",ClientId:i.pool.getClientId(),ChallengeResponses:r,ClientMetadata:t,Session:i.Session};i.getUserContextData()&&(l.UserContextData=i.getUserContextData()),i.client.request("RespondToAuthChallenge",l,function(t,r){if(t)return e.onFailure(t);var o=r.ChallengeParameters,a=new I(o.SRP_B,16),l=new I(o.SALT,16);n.getPasswordAuthenticationKey(i.deviceKey,i.randomPassword,a,l,function(t,n){if(t)return e.onFailure(t);var a=s.getNowString(),l=S().lib.WordArray.create(C.hp.concat([C.hp.from(i.deviceGroupKey,"utf8"),C.hp.from(i.deviceKey,"utf8"),C.hp.from(o.SECRET_BLOCK,"base64"),C.hp.from(a,"utf8")])),c=S().lib.WordArray.create(n),h=Q().stringify(M()(l,c)),u={};u.USERNAME=i.username,u.PASSWORD_CLAIM_SECRET_BLOCK=o.SECRET_BLOCK,u.TIMESTAMP=a,u.PASSWORD_CLAIM_SIGNATURE=h,u.DEVICE_KEY=i.deviceKey;var d={ChallengeName:"DEVICE_PASSWORD_VERIFIER",ClientId:i.pool.getClientId(),ChallengeResponses:u,Session:r.Session};i.getUserContextData()&&(d.UserContextData=i.getUserContextData()),i.client.request("RespondToAuthChallenge",d,function(t,n){return t?e.onFailure(t):(i.signInUserSession=i.getCognitoUserSession(n.AuthenticationResult),i.cacheTokens(),e.onSuccess(i.signInUserSession))})})})})},t.confirmRegistration=function(e,t,i,n){var s={ClientId:this.pool.getClientId(),ConfirmationCode:e,Username:this.username,ForceAliasCreation:t,ClientMetadata:n};this.getUserContextData()&&(s.UserContextData=this.getUserContextData()),this.client.request("ConfirmSignUp",s,function(e){return e?i(e,null):i(null,"SUCCESS")})},t.sendCustomChallengeAnswer=function(e,t,i){var n=this,s={};s.USERNAME=this.username,s.ANSWER=e;var r=new W(this.pool.getUserPoolName());this.getCachedDeviceKeyAndPassword(),null!=this.deviceKey&&(s.DEVICE_KEY=this.deviceKey);var o={ChallengeName:"CUSTOM_CHALLENGE",ChallengeResponses:s,ClientId:this.pool.getClientId(),Session:this.Session,ClientMetadata:i};this.getUserContextData()&&(o.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",o,function(e,i){return e?t.onFailure(e):n.authenticateUserInternal(i,r,t)})},t.sendMFACode=function(e,t,i,n){var s=this,r={};r.USERNAME=this.username,r.SMS_MFA_CODE=e;var o=i||"SMS_MFA";"SOFTWARE_TOKEN_MFA"===o&&(r.SOFTWARE_TOKEN_MFA_CODE=e),null!=this.deviceKey&&(r.DEVICE_KEY=this.deviceKey);var a={ChallengeName:o,ChallengeResponses:r,ClientId:this.pool.getClientId(),Session:this.Session,ClientMetadata:n};this.getUserContextData()&&(a.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",a,function(e,i){if(e)return t.onFailure(e);if("DEVICE_SRP_AUTH"!==i.ChallengeName){if(s.signInUserSession=s.getCognitoUserSession(i.AuthenticationResult),s.cacheTokens(),null==i.AuthenticationResult.NewDeviceMetadata)return t.onSuccess(s.signInUserSession);var n=new W(s.pool.getUserPoolName());n.generateHashDevice(i.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,i.AuthenticationResult.NewDeviceMetadata.DeviceKey,function(e){if(e)return t.onFailure(e);var r={Salt:C.hp.from(n.getSaltDevices(),"hex").toString("base64"),PasswordVerifier:C.hp.from(n.getVerifierDevices(),"hex").toString("base64")};s.verifierDevices=r.PasswordVerifier,s.deviceGroupKey=i.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,s.randomPassword=n.getRandomPassword(),s.client.request("ConfirmDevice",{DeviceKey:i.AuthenticationResult.NewDeviceMetadata.DeviceKey,AccessToken:s.signInUserSession.getAccessToken().getJwtToken(),DeviceSecretVerifierConfig:r,DeviceName:ae},function(e,n){return e?t.onFailure(e):(s.deviceKey=i.AuthenticationResult.NewDeviceMetadata.DeviceKey,s.cacheDeviceKeyAndPassword(),!0===n.UserConfirmationNecessary?t.onSuccess(s.signInUserSession,n.UserConfirmationNecessary):t.onSuccess(s.signInUserSession))})})}else s.getDeviceResponse(t)})},t.changePassword=function(e,t,i,n){if(null==this.signInUserSession||!this.signInUserSession.isValid())return i(new Error("User is not authenticated"),null);this.client.request("ChangePassword",{PreviousPassword:e,ProposedPassword:t,AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:n},function(e){return e?i(e,null):i(null,"SUCCESS")})},t.enableMFA=function(e){if(null==this.signInUserSession||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);var t=[];t.push({DeliveryMedium:"SMS",AttributeName:"phone_number"}),this.client.request("SetUserSettings",{MFAOptions:t,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(t){return t?e(t,null):e(null,"SUCCESS")})},t.setUserMfaPreference=function(e,t,i){if(null==this.signInUserSession||!this.signInUserSession.isValid())return i(new Error("User is not authenticated"),null);this.client.request("SetUserMFAPreference",{SMSMfaSettings:e,SoftwareTokenMfaSettings:t,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(e){return e?i(e,null):i(null,"SUCCESS")})},t.disableMFA=function(e){if(null==this.signInUserSession||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);this.client.request("SetUserSettings",{MFAOptions:[],AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(t){return t?e(t,null):e(null,"SUCCESS")})},t.deleteUser=function(e,t){var i=this;if(null==this.signInUserSession||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);this.client.request("DeleteUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:t},function(t){return t?e(t,null):(i.clearCachedUser(),e(null,"SUCCESS"))})},t.updateAttributes=function(e,t,i){var n=this;if(null==this.signInUserSession||!this.signInUserSession.isValid())return t(new Error("User is not authenticated"),null);this.client.request("UpdateUserAttributes",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),UserAttributes:e,ClientMetadata:i},function(e){return e?t(e,null):n.getUserData(function(){return t(null,"SUCCESS")},{bypassCache:!0})})},t.getUserAttributes=function(e){if(null==this.signInUserSession||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);this.client.request("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(t,i){if(t)return e(t,null);for(var n=[],s=0;s<i.UserAttributes.length;s++){var r={Name:i.UserAttributes[s].Name,Value:i.UserAttributes[s].Value},o=new ne(r);n.push(o)}return e(null,n)})},t.getMFAOptions=function(e){if(null==this.signInUserSession||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);this.client.request("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(t,i){return t?e(t,null):e(null,i.MFAOptions)})},t.createGetUserRequest=function(){return this.client.promisifyRequest("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()})},t.refreshSessionIfPossible=function(e){var t=this;return void 0===e&&(e={}),new Promise(function(i){var n=t.signInUserSession.getRefreshToken();n&&n.getToken()?t.refreshSession(n,i,e.clientMetadata):i()})},t.getUserData=function(e,t){var i=this;if(null==this.signInUserSession||!this.signInUserSession.isValid())return this.clearCachedUserData(),e(new Error("User is not authenticated"),null);var n=this.getUserDataFromCache();if(n)if(this.isFetchUserDataAndTokenRequired(t))this.fetchUserData().then(function(e){return i.refreshSessionIfPossible(t).then(function(){return e})}).then(function(t){return e(null,t)}).catch(e);else try{return void e(null,JSON.parse(n))}catch(t){return this.clearCachedUserData(),void e(t,null)}else this.fetchUserData().then(function(t){e(null,t)}).catch(e)},t.getUserDataFromCache=function(){return this.storage.getItem(this.userDataKey)},t.isFetchUserDataAndTokenRequired=function(e){var t=(e||{}).bypassCache;return void 0!==t&&t},t.fetchUserData=function(){var e=this;return this.createGetUserRequest().then(function(t){return e.cacheUserData(t),t})},t.deleteAttributes=function(e,t){var i=this;if(null==this.signInUserSession||!this.signInUserSession.isValid())return t(new Error("User is not authenticated"),null);this.client.request("DeleteUserAttributes",{UserAttributeNames:e,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(e){return e?t(e,null):i.getUserData(function(){return t(null,"SUCCESS")},{bypassCache:!0})})},t.resendConfirmationCode=function(e,t){var i={ClientId:this.pool.getClientId(),Username:this.username,ClientMetadata:t};this.client.request("ResendConfirmationCode",i,function(t,i){return t?e(t,null):e(null,i)})},t.getSession=function(e,t){if(void 0===t&&(t={}),null==this.username)return e(new Error("Username is null. Cannot retrieve a new session"),null);if(null!=this.signInUserSession&&this.signInUserSession.isValid())return e(null,this.signInUserSession);var i="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,n=i+".idToken",s=i+".accessToken",r=i+".refreshToken",o=i+".clockDrift";if(this.storage.getItem(n)){var a=new q({IdToken:this.storage.getItem(n)}),l=new K({AccessToken:this.storage.getItem(s)}),c=new X({RefreshToken:this.storage.getItem(r)}),h=parseInt(this.storage.getItem(o),0)||0,u=new J({IdToken:a,AccessToken:l,RefreshToken:c,ClockDrift:h});if(u.isValid())return this.signInUserSession=u,e(null,this.signInUserSession);if(!c.getToken())return e(new Error("Cannot retrieve a new session. Please authenticate."),null);this.refreshSession(c,e,t.clientMetadata)}else e(new Error("Local storage is missing an ID Token, Please authenticate"),null)},t.refreshSession=function(e,t,i){var n=this,s=this.pool.wrapRefreshSessionCallback?this.pool.wrapRefreshSessionCallback(t):t,r={};r.REFRESH_TOKEN=e.getToken();var o="CognitoIdentityServiceProvider."+this.pool.getClientId(),a=o+".LastAuthUser";if(this.storage.getItem(a)){this.username=this.storage.getItem(a);var l=o+"."+this.username+".deviceKey";this.deviceKey=this.storage.getItem(l),r.DEVICE_KEY=this.deviceKey}var c={ClientId:this.pool.getClientId(),AuthFlow:"REFRESH_TOKEN_AUTH",AuthParameters:r,ClientMetadata:i};this.getUserContextData()&&(c.UserContextData=this.getUserContextData()),this.client.request("InitiateAuth",c,function(t,i){if(t)return"NotAuthorizedException"===t.code&&n.clearCachedUser(),s(t,null);if(i){var r=i.AuthenticationResult;return Object.prototype.hasOwnProperty.call(r,"RefreshToken")||(r.RefreshToken=e.getToken()),n.signInUserSession=n.getCognitoUserSession(r),n.cacheTokens(),s(null,n.signInUserSession)}})},t.cacheTokens=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId(),t=e+"."+this.username+".idToken",i=e+"."+this.username+".accessToken",n=e+"."+this.username+".refreshToken",s=e+"."+this.username+".clockDrift",r=e+".LastAuthUser";this.storage.setItem(t,this.signInUserSession.getIdToken().getJwtToken()),this.storage.setItem(i,this.signInUserSession.getAccessToken().getJwtToken()),this.storage.setItem(n,this.signInUserSession.getRefreshToken().getToken()),this.storage.setItem(s,""+this.signInUserSession.getClockDrift()),this.storage.setItem(r,this.username)},t.cacheUserData=function(e){this.storage.setItem(this.userDataKey,JSON.stringify(e))},t.clearCachedUserData=function(){this.storage.removeItem(this.userDataKey)},t.clearCachedUser=function(){this.clearCachedTokens(),this.clearCachedUserData()},t.cacheDeviceKeyAndPassword=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,t=e+".deviceKey",i=e+".randomPasswordKey",n=e+".deviceGroupKey";this.storage.setItem(t,this.deviceKey),this.storage.setItem(i,this.randomPassword),this.storage.setItem(n,this.deviceGroupKey)},t.getCachedDeviceKeyAndPassword=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,t=e+".deviceKey",i=e+".randomPasswordKey",n=e+".deviceGroupKey";this.storage.getItem(t)&&(this.deviceKey=this.storage.getItem(t),this.randomPassword=this.storage.getItem(i),this.deviceGroupKey=this.storage.getItem(n))},t.clearCachedDeviceKeyAndPassword=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,t=e+".deviceKey",i=e+".randomPasswordKey",n=e+".deviceGroupKey";this.storage.removeItem(t),this.storage.removeItem(i),this.storage.removeItem(n)},t.clearCachedTokens=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId(),t=e+"."+this.username+".idToken",i=e+"."+this.username+".accessToken",n=e+"."+this.username+".refreshToken",s=e+".LastAuthUser",r=e+"."+this.username+".clockDrift";this.storage.removeItem(t),this.storage.removeItem(i),this.storage.removeItem(n),this.storage.removeItem(s),this.storage.removeItem(r)},t.getCognitoUserSession=function(e){var t=new q(e),i=new K(e),n=new X(e);return new J({IdToken:t,AccessToken:i,RefreshToken:n})},t.forgotPassword=function(e,t){var i={ClientId:this.pool.getClientId(),Username:this.username,ClientMetadata:t};this.getUserContextData()&&(i.UserContextData=this.getUserContextData()),this.client.request("ForgotPassword",i,function(t,i){return t?e.onFailure(t):"function"==typeof e.inputVerificationCode?e.inputVerificationCode(i):e.onSuccess(i)})},t.confirmPassword=function(e,t,i,n){var s={ClientId:this.pool.getClientId(),Username:this.username,ConfirmationCode:e,Password:t,ClientMetadata:n};this.getUserContextData()&&(s.UserContextData=this.getUserContextData()),this.client.request("ConfirmForgotPassword",s,function(e){return e?i.onFailure(e):i.onSuccess("SUCCESS")})},t.getAttributeVerificationCode=function(e,t,i){if(null==this.signInUserSession||!this.signInUserSession.isValid())return t.onFailure(new Error("User is not authenticated"));this.client.request("GetUserAttributeVerificationCode",{AttributeName:e,AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:i},function(e,i){return e?t.onFailure(e):"function"==typeof t.inputVerificationCode?t.inputVerificationCode(i):t.onSuccess("SUCCESS")})},t.verifyAttribute=function(e,t,i){if(null==this.signInUserSession||!this.signInUserSession.isValid())return i.onFailure(new Error("User is not authenticated"));this.client.request("VerifyUserAttribute",{AttributeName:e,Code:t,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(e){return e?i.onFailure(e):i.onSuccess("SUCCESS")})},t.getDevice=function(e){if(null==this.signInUserSession||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("GetDevice",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey},function(t,i){return t?e.onFailure(t):e.onSuccess(i)})},t.forgetSpecificDevice=function(e,t){if(null==this.signInUserSession||!this.signInUserSession.isValid())return t.onFailure(new Error("User is not authenticated"));this.client.request("ForgetDevice",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:e},function(e){return e?t.onFailure(e):t.onSuccess("SUCCESS")})},t.forgetDevice=function(e){var t=this;this.forgetSpecificDevice(this.deviceKey,{onFailure:e.onFailure,onSuccess:function(i){return t.deviceKey=null,t.deviceGroupKey=null,t.randomPassword=null,t.clearCachedDeviceKeyAndPassword(),e.onSuccess(i)}})},t.setDeviceStatusRemembered=function(e){if(null==this.signInUserSession||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("UpdateDeviceStatus",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey,DeviceRememberedStatus:"remembered"},function(t){return t?e.onFailure(t):e.onSuccess("SUCCESS")})},t.setDeviceStatusNotRemembered=function(e){if(null==this.signInUserSession||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("UpdateDeviceStatus",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey,DeviceRememberedStatus:"not_remembered"},function(t){return t?e.onFailure(t):e.onSuccess("SUCCESS")})},t.listDevices=function(e,t,i){if(null==this.signInUserSession||!this.signInUserSession.isValid())return i.onFailure(new Error("User is not authenticated"));var n={AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),Limit:e};t&&(n.PaginationToken=t),this.client.request("ListDevices",n,function(e,t){return e?i.onFailure(e):i.onSuccess(t)})},t.globalSignOut=function(e){var t=this;if(null==this.signInUserSession||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("GlobalSignOut",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(i){return i?e.onFailure(i):(t.clearCachedUser(),e.onSuccess("SUCCESS"))})},t.signOut=function(e){var t=this;e&&"function"==typeof e?this.getSession(function(i,n){if(i)return e(i);t.revokeTokens(function(i){t.cleanClientData(),e(i)})}):this.cleanClientData()},t.revokeTokens=function(e){if(void 0===e&&(e=function(){}),"function"!=typeof e)throw new Error("Invalid revokeTokenCallback. It should be a function.");if(!this.signInUserSession)return e(new Error("User is not authenticated"));if(!this.signInUserSession.getAccessToken())return e(new Error("No Access token available"));var t=this.signInUserSession.getRefreshToken().getToken(),i=this.signInUserSession.getAccessToken();if(this.isSessionRevocable(i)&&t)return this.revokeToken({token:t,callback:e});e()},t.isSessionRevocable=function(e){if(e&&"function"==typeof e.decodePayload)try{return!!e.decodePayload().origin_jti}catch(e){}return!1},t.cleanClientData=function(){this.signInUserSession=null,this.clearCachedUser()},t.revokeToken=function(e){var t=e.token,i=e.callback;this.client.requestWithRetry("RevokeToken",{Token:t,ClientId:this.pool.getClientId()},function(e){if(e)return i(e);i()})},t.sendMFASelectionAnswer=function(e,t){var i=this,n={};n.USERNAME=this.username,n.ANSWER=e;var s={ChallengeName:"SELECT_MFA_TYPE",ChallengeResponses:n,ClientId:this.pool.getClientId(),Session:this.Session};this.getUserContextData()&&(s.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",s,function(n,s){return n?t.onFailure(n):(i.Session=s.Session,"SMS_MFA"===e?t.mfaRequired(s.ChallengeName,s.ChallengeParameters):"SOFTWARE_TOKEN_MFA"===e?t.totpRequired(s.ChallengeName,s.ChallengeParameters):void 0)})},t.getUserContextData=function(){return this.pool.getUserContextData(this.username)},t.associateSoftwareToken=function(e){var t=this;null!=this.signInUserSession&&this.signInUserSession.isValid()?this.client.request("AssociateSoftwareToken",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(t,i){return t?e.onFailure(t):e.associateSecretCode(i.SecretCode)}):this.client.request("AssociateSoftwareToken",{Session:this.Session},function(i,n){return i?e.onFailure(i):(t.Session=n.Session,e.associateSecretCode(n.SecretCode))})},t.verifySoftwareToken=function(e,t,i){var n=this;null!=this.signInUserSession&&this.signInUserSession.isValid()?this.client.request("VerifySoftwareToken",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),UserCode:e,FriendlyDeviceName:t},function(e,t){return e?i.onFailure(e):i.onSuccess(t)}):this.client.request("VerifySoftwareToken",{Session:this.Session,UserCode:e,FriendlyDeviceName:t},function(e,t){if(e)return i.onFailure(e);n.Session=t.Session;var s={};s.USERNAME=n.username;var r={ChallengeName:"MFA_SETUP",ClientId:n.pool.getClientId(),ChallengeResponses:s,Session:n.Session};n.getUserContextData()&&(r.UserContextData=n.getUserContextData()),n.client.request("RespondToAuthChallenge",r,function(e,t){return e?i.onFailure(e):(n.signInUserSession=n.getCognitoUserSession(t.AuthenticationResult),n.cacheTokens(),i.onSuccess(n.signInUserSession))})})},e}(),ce=(i(40061),"aws-amplify/5.0.4"),he={userAgent:ce+" js",product:"",navigator:null,isReactNative:!1};function ue(){}"undefined"!=typeof navigator&&navigator.product&&(he.product=navigator.product||"",he.navigator=navigator||null,"ReactNative"===navigator.product?(he.userAgent=ce+" react-native",he.isReactNative=!0):(he.userAgent=ce+" js",he.isReactNative=!1)),ue.prototype.userAgent=he.userAgent;const de=ue;function pe(e){var t="function"==typeof Map?new Map:void 0;return pe=function(e){if(null===e||(i=e,-1===Function.toString.call(i).indexOf("[native code]")))return e;var i;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return ge(e,arguments,me(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),fe(n,e)},pe(e)}function ge(e,t,i){return ge=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}()?Reflect.construct.bind():function(e,t,i){var n=[null];n.push.apply(n,t);var s=new(Function.bind.apply(e,n));return i&&fe(s,i.prototype),s},ge.apply(null,arguments)}function fe(e,t){return fe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},fe(e,t)}function me(e){return me=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},me(e)}var ye=function(e){function t(t,i,n,s){var r;return(r=e.call(this,t)||this).code=i,r.name=n,r.statusCode=s,r}return n=e,(i=t).prototype=Object.create(n.prototype),i.prototype.constructor=i,fe(i,n),t;var i,n}(pe(Error)),ve=function(){function e(e,t,i){this.endpoint=t||"https://cognito-idp."+e+".amazonaws.com/";var n=(i||{}).credentials;this.fetchOptions=n?{credentials:n}:{}}var t=e.prototype;return t.promisifyRequest=function(e,t){var i=this;return new Promise(function(n,s){i.request(e,t,function(e,t){e?s(new ye(e.message,e.code,e.name,e.statusCode)):n(t)})})},t.requestWithRetry=function(e,t,i){var n,s,r=this;(n=[t],s=5e3,void 0===s&&(s=3e5),be(function(t){return new Promise(function(i,n){r.request(e,t,function(e,t){e?n(e):i(t)})})},n,function(e){return function(t){var i=100*Math.pow(2,t)+100*Math.random();return!(i>e)&&i}}(s))).then(function(e){return i(null,e)}).catch(function(e){return i(e)})},t.request=function(e,t,i){var n,s={"Content-Type":"application/x-amz-json-1.1","X-Amz-Target":"AWSCognitoIdentityProviderService."+e,"X-Amz-User-Agent":de.prototype.userAgent,"Cache-Control":"no-store"},r=Object.assign({},this.fetchOptions,{headers:s,method:"POST",mode:"cors",body:JSON.stringify(t)});fetch(this.endpoint,r).then(function(e){return n=e,e},function(e){if(e instanceof TypeError)throw new Error("Network error");throw e}).then(function(e){return e.json().catch(function(){return{}})}).then(function(e){if(n.ok)return i(null,e);var t=(e.__type||e.code).split("#").pop(),s=new Error(e.message||e.Message||null);return s.name=t,s.code=t,i(s)}).catch(function(e){if(n&&n.headers&&n.headers.get("x-amzn-errortype"))try{var t=n.headers.get("x-amzn-errortype").split(":")[0],s=new Error(n.status?n.status.toString():null);return s.code=t,s.name=t,s.statusCode=n.status,i(s)}catch(t){return i(e)}else e instanceof Error&&"Network error"===e.message&&(e.code="NetworkError");return i(e)})},e}();function be(e,t,i,n){if(void 0===n&&(n=1),"function"!=typeof e)throw Error("functionToRetry must be a function");return e.name,JSON.stringify(t),e.apply(void 0,t).catch(function(s){if(e.name,(r=s)&&r.nonRetryable)throw e.name,s;var r,o=i(n,t,s);if(e.name,!1!==o)return new Promise(function(e){return setTimeout(e,o)}).then(function(){return be(e,t,i,n+1)});throw s})}var Ce=function(){function e(e,t){var i=e||{},n=i.UserPoolId,s=i.ClientId,r=i.endpoint,o=i.fetchOptions,a=i.AdvancedSecurityDataCollectionFlag;if(!n||!s)throw new Error("Both UserPoolId and ClientId are required.");if(n.length>55||!/^[\w-]+_[0-9a-zA-Z]+$/.test(n))throw new Error("Invalid UserPoolId format.");var l=n.split("_")[0];this.userPoolId=n,this.clientId=s,this.client=new ve(l,r,o),this.advancedSecurityDataCollectionFlag=!1!==a,this.storage=e.Storage||(new oe).getStorage(),t&&(this.wrapRefreshSessionCallback=t)}var t=e.prototype;return t.getUserPoolId=function(){return this.userPoolId},t.getUserPoolName=function(){return this.getUserPoolId().split("_")[1]},t.getClientId=function(){return this.clientId},t.signUp=function(e,t,i,n,s,r){var o=this,a={ClientId:this.clientId,Username:e,Password:t,UserAttributes:i,ValidationData:n,ClientMetadata:r};this.getUserContextData(e)&&(a.UserContextData=this.getUserContextData(e)),this.client.request("SignUp",a,function(t,i){if(t)return s(t,null);var n={Username:e,Pool:o,Storage:o.storage},r={user:new le(n),userConfirmed:i.UserConfirmed,userSub:i.UserSub,codeDeliveryDetails:i.CodeDeliveryDetails};return s(null,r)})},t.getCurrentUser=function(){var e="CognitoIdentityServiceProvider."+this.clientId+".LastAuthUser",t=this.storage.getItem(e);if(t){var i={Username:t,Pool:this,Storage:this.storage};return new le(i)}return null},t.getUserContextData=function(e){if("undefined"!=typeof AmazonCognitoAdvancedSecurityData){var t=AmazonCognitoAdvancedSecurityData;if(this.advancedSecurityDataCollectionFlag){var i=t.getData(e,this.userPoolId,this.clientId);if(i)return{EncodedData:i}}return{}}},e}(),we=i(97351),Se=function(){function e(e){if(!e.domain)throw new Error("The domain of cookieStorage can not be undefined.");if(this.domain=e.domain,e.path?this.path=e.path:this.path="/",Object.prototype.hasOwnProperty.call(e,"expires")?this.expires=e.expires:this.expires=365,Object.prototype.hasOwnProperty.call(e,"secure")?this.secure=e.secure:this.secure=!0,Object.prototype.hasOwnProperty.call(e,"sameSite")){if(!["strict","lax","none"].includes(e.sameSite))throw new Error('The sameSite value of cookieStorage must be "lax", "strict" or "none".');if("none"===e.sameSite&&!this.secure)throw new Error("sameSite = None requires the Secure attribute in latest browser versions.");this.sameSite=e.sameSite}else this.sameSite=null}var t=e.prototype;return t.setItem=function(e,t){var i={path:this.path,expires:this.expires,domain:this.domain,secure:this.secure};return this.sameSite&&(i.sameSite=this.sameSite),we.set(e,t,i),we.get(e)},t.getItem=function(e){return we.get(e)},t.removeItem=function(e){var t={path:this.path,expires:this.expires,domain:this.domain,secure:this.secure};return this.sameSite&&(t.sameSite=this.sameSite),we.remove(e,t)},t.clear=function(){for(var e=we.get(),t=Object.keys(e).length,i=0;i<t;++i)this.removeItem(Object.keys(e)[i]);return{}},e}(),xe=i(71481),Ee=function(e){var t=window.open(e,"_self");return t?Promise.resolve(t):Promise.reject()},Ae=function(){return Ae=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var s in t=arguments[i])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},Ae.apply(this,arguments)},Me=function(e,t,i,n){return new(i||(i=Promise))(function(s,r){function o(e){try{l(n.next(e))}catch(e){r(e)}}function a(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})},Te=function(e,t){var i,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,n&&(s=2&r[0]?n.return:r[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,r[1])).done)return s;switch(n=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,n=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!((s=(s=o.trys).length>0&&s[s.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){o.label=r[1];break}if(6===r[0]&&o.label<s[1]){o.label=s[1],s=r;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(r);break}s[2]&&o.ops.pop(),o.trys.pop();continue}r=t.call(e,o)}catch(e){r=[6,e],n=0}finally{i=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}},De=function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,s,r=i.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=r.next()).done;)o.push(n.value)}catch(e){s={error:e}}finally{try{n&&!n.done&&(i=r.return)&&i.call(r)}finally{if(s)throw s.error}}return o},Ie="undefined"!=typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default",Re=function(e,t,i){h.YZ.dispatch("auth",{event:e,data:t,message:i},"Auth",Ie)},ke=new c.C("OAuth"),Pe=function(){function e(e){var t=e.config,i=e.cognitoClientId,n=e.scopes,s=void 0===n?[]:n;if(this._urlOpener=t.urlOpener||Ee,this._config=t,this._cognitoClientId=i,!this.isValidScopes(s))throw Error("scopes must be a String Array");this._scopes=s}return e.prototype.isValidScopes=function(e){return Array.isArray(e)&&e.every(function(e){return"string"==typeof e})},e.prototype.oauthSignIn=function(e,t,i,s,r,o){void 0===e&&(e="code"),void 0===r&&(r=n.Cognito);var a=this._generateState(32),l=o?a+"-"+o.split("").map(function(e){return e.charCodeAt(0).toString(16).padStart(2,"0")}).join(""):a;!function(e){window.sessionStorage.setItem("oauth_state",e)}(l);var c,h=this._generateRandom(128);c=h,window.sessionStorage.setItem("ouath_pkce_key",c);var u=this._generateChallenge(h),d=this._scopes.join(" "),p="https://"+t+"/oauth2/authorize?"+Object.entries(Ae(Ae({redirect_uri:i,response_type:e,client_id:s,identity_provider:r,scope:d,state:l},"code"===e?{code_challenge:u}:{}),"code"===e?{code_challenge_method:"S256"}:{})).map(function(e){var t=De(e,2),i=t[0],n=t[1];return encodeURIComponent(i)+"="+encodeURIComponent(n)}).join("&");ke.debug("Redirecting to "+p),this._urlOpener(p,i)},e.prototype._handleCodeFlow=function(e){return Me(this,void 0,void 0,function(){var t,i,n,s,r,o,l,c,h,u,d,p,g,f;return Te(this,function(m){switch(m.label){case 0:return t=((0,xe.parse)(e).query||"").split("&").map(function(e){return e.split("=")}).reduce(function(e,t){var i,n=De(t,2),s=n[0],r=n[1];return Ae(Ae({},e),((i={})[s]=r,i))},{code:void 0}).code,i=(0,xe.parse)(e).pathname||"/",n=(0,xe.parse)(this._config.redirectSignIn).pathname||"/",t&&i===n?(s="https://"+this._config.domain+"/oauth2/token",Re("codeFlow",{},"Retrieving tokens from "+s),r=a(this._config)?this._cognitoClientId:this._config.clientID,o=a(this._config)?this._config.redirectSignIn:this._config.redirectUri,y=window.sessionStorage.getItem("ouath_pkce_key"),window.sessionStorage.removeItem("ouath_pkce_key"),c=Ae({grant_type:"authorization_code",code:t,client_id:r,redirect_uri:o},(l=y)?{code_verifier:l}:{}),ke.debug("Calling token endpoint: "+s+" with",c),h=Object.entries(c).map(function(e){var t=De(e,2),i=t[0],n=t[1];return encodeURIComponent(i)+"="+encodeURIComponent(n)}).join("&"),[4,fetch(s,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:h})]):[2];case 1:return[4,m.sent().json()];case 2:if(u=m.sent(),d=u.access_token,p=u.refresh_token,g=u.id_token,f=u.error)throw new Error(f);return[2,{accessToken:d,refreshToken:p,idToken:g}]}var y})})},e.prototype._handleImplicitFlow=function(e){return Me(this,void 0,void 0,function(){var t,i,n;return Te(this,function(s){return t=((0,xe.parse)(e).hash||"#").substr(1).split("&").map(function(e){return e.split("=")}).reduce(function(e,t){var i,n=De(t,2),s=n[0],r=n[1];return Ae(Ae({},e),((i={})[s]=r,i))},{id_token:void 0,access_token:void 0}),i=t.id_token,n=t.access_token,Re("implicitFlow",{},"Got tokens from "+e),ke.debug("Retrieving implicit tokens from "+e+" with"),[2,{accessToken:n,idToken:i,refreshToken:null}]})})},e.prototype.handleAuthResponse=function(e){return Me(this,void 0,void 0,function(){var t,i,n,s,r,o,a;return Te(this,function(l){switch(l.label){case 0:if(l.trys.push([0,5,,6]),t=e?Ae(Ae({},((0,xe.parse)(e).hash||"#").substr(1).split("&").map(function(e){return e.split("=")}).reduce(function(e,t){var i=De(t,2),n=i[0],s=i[1];return e[n]=s,e},{})),((0,xe.parse)(e).query||"").split("&").map(function(e){return e.split("=")}).reduce(function(e,t){var i=De(t,2),n=i[0],s=i[1];return e[n]=s,e},{})):{},i=t.error,n=t.error_description,i)throw new Error(n);return s=this._validateState(t),ke.debug("Starting "+this._config.responseType+" flow with "+e),"code"!==this._config.responseType?[3,2]:(r=[{}],[4,this._handleCodeFlow(e)]);case 1:return[2,Ae.apply(void 0,[Ae.apply(void 0,r.concat([l.sent()])),{state:s}])];case 2:return o=[{}],[4,this._handleImplicitFlow(e)];case 3:return[2,Ae.apply(void 0,[Ae.apply(void 0,o.concat([l.sent()])),{state:s}])];case 4:return[3,6];case 5:throw a=l.sent(),ke.error("Error handling auth response.",a),a;case 6:return[2]}})})},e.prototype._validateState=function(e){if(e){var t,i=(t=window.sessionStorage.getItem("oauth_state"),window.sessionStorage.removeItem("oauth_state"),t),n=e.state;if(i&&i!==n)throw new Error("Invalid state in OAuth flow");return n}},e.prototype.signOut=function(){return Me(this,void 0,void 0,function(){var e,t,i;return Te(this,function(n){return e="https://"+this._config.domain+"/logout?",t=a(this._config)?this._cognitoClientId:this._config.oauth.clientID,i=a(this._config)?this._config.redirectSignOut:this._config.returnTo,e+=Object.entries({client_id:t,logout_uri:encodeURIComponent(i)}).map(function(e){var t=De(e,2);return t[0]+"="+t[1]}).join("&"),Re("oAuthSignOut",{oAuth:"signOut"},"Signing out from "+e),ke.debug("Signing out from "+e),[2,this._urlOpener(e,i)]})})},e.prototype._generateState=function(e){for(var t="",i=e;i>0;--i)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.round(61*Math.random())];return t},e.prototype._generateChallenge=function(e){return this._base64URL(E()(e))},e.prototype._base64URL=function(e){return e.toString(Q()).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},e.prototype._generateRandom=function(e){var t=new Uint8Array(e);if("undefined"!=typeof window&&window.crypto)window.crypto.getRandomValues(t);else for(var i=0;i<e;i+=1)t[i]=66*Math.random()|0;return this._bufferToString(t)},e.prototype._bufferToString=function(e){for(var t=[],i=0;i<e.byteLength;i+=1){var n=e[i]%62;t.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"[n])}return t.join("")},e}();const _e=Pe;var Le;!function(e){e.DEFAULT_MSG="Authentication Error",e.EMPTY_EMAIL="Email cannot be empty",e.EMPTY_PHONE="Phone number cannot be empty",e.EMPTY_USERNAME="Username cannot be empty",e.INVALID_USERNAME="The username should either be a string or one of the sign in types",e.EMPTY_PASSWORD="Password cannot be empty",e.EMPTY_CODE="Confirmation code cannot be empty",e.SIGN_UP_ERROR="Error creating account",e.NO_MFA="No valid MFA method provided",e.INVALID_MFA="Invalid MFA type",e.EMPTY_CHALLENGE="Challenge response cannot be empty",e.NO_USER_SESSION="Failed to get the session because the user is empty",e.NETWORK_ERROR="Network Error",e.DEVICE_CONFIG="Device tracking has not been configured in this User Pool",e.AUTOSIGNIN_ERROR="Please use your credentials to sign in"}(Le||(Le={}));var Ne,Oe=(Ne=function(e,t){return Ne=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},Ne(e,t)},function(e,t){function i(){this.constructor=e}Ne(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),Fe=new c.C("AuthError"),Ge=function(e){function t(i){var n=this,s=Ve[i],r=s.message,o=s.log;return(n=e.call(this,r)||this).constructor=t,Object.setPrototypeOf(n,t.prototype),n.name="AuthError",n.log=o||r,Fe.error(n.log),n}return Oe(t,e),t}(Error),Be=function(e){function t(i){var n=e.call(this,i)||this;return n.constructor=t,Object.setPrototypeOf(n,t.prototype),n.name="NoUserPoolError",n}return Oe(t,e),t}(Ge),Ve={noConfig:{message:Le.DEFAULT_MSG,log:"\n            Error: Amplify has not been configured correctly.\n            This error is typically caused by one of the following scenarios:\n\n            1. Make sure you're passing the awsconfig object to Amplify.configure() in your app's entry point\n                See https://aws-amplify.github.io/docs/js/authentication#configure-your-app for more information\n            \n            2. There might be multiple conflicting versions of amplify packages in your node_modules.\n\t\t\t\tRefer to our docs site for help upgrading Amplify packages (https://docs.amplify.aws/lib/troubleshooting/upgrading/q/platform/js)\n        "},missingAuthConfig:{message:Le.DEFAULT_MSG,log:"\n            Error: Amplify has not been configured correctly. \n            The configuration object is missing required auth properties.\n            This error is typically caused by one of the following scenarios:\n\n            1. Did you run `amplify push` after adding auth via `amplify add auth`?\n                See https://aws-amplify.github.io/docs/js/authentication#amplify-project-setup for more information\n\n            2. This could also be caused by multiple conflicting versions of amplify packages, see (https://docs.amplify.aws/lib/troubleshooting/upgrading/q/platform/js) for help upgrading Amplify packages.\n        "},emptyUsername:{message:Le.EMPTY_USERNAME},invalidUsername:{message:Le.INVALID_USERNAME},emptyPassword:{message:Le.EMPTY_PASSWORD},emptyCode:{message:Le.EMPTY_CODE},signUpError:{message:Le.SIGN_UP_ERROR,log:"The first parameter should either be non-null string or object"},noMFA:{message:Le.NO_MFA},invalidMFA:{message:Le.INVALID_MFA},emptyChallengeResponse:{message:Le.EMPTY_CHALLENGE},noUserSession:{message:Le.NO_USER_SESSION},deviceConfig:{message:Le.DEVICE_CONFIG},networkError:{message:Le.NETWORK_ERROR},autoSignInError:{message:Le.AUTOSIGNIN_ERROR},default:{message:Le.DEFAULT_MSG}},He=function(){return He=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var s in t=arguments[i])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},He.apply(this,arguments)},Ue=function(e,t,i,n){return new(i||(i=Promise))(function(s,r){function o(e){try{l(n.next(e))}catch(e){r(e)}}function a(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})},ze=function(e,t){var i,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,n&&(s=2&r[0]?n.return:r[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,r[1])).done)return s;switch(n=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,n=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!((s=(s=o.trys).length>0&&s[s.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){o.label=r[1];break}if(6===r[0]&&o.label<s[1]){o.label=s[1],s=r;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(r);break}s[2]&&o.ops.pop(),o.trys.pop();continue}r=t.call(e,o)}catch(e){r=[6,e],n=0}finally{i=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}},We=function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,s,r=i.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=r.next()).done;)o.push(n.value)}catch(e){s={error:e}}finally{try{n&&!n.done&&(i=r.return)&&i.call(r)}finally{if(s)throw s.error}}return o},je=new c.C("AuthClass"),$e="aws.cognito.signin.user.admin",Ke="undefined"!=typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default",Ye=function(e,t,i){h.YZ.dispatch("auth",{event:e,data:t,message:i},"Auth",Ke)},qe=function(){function e(e){var t=this;this.userPool=null,this.user=null,this.oAuthFlowInProgress=!1,this.autoSignInInitiated=!1,this.Credentials=u.Ji,this.wrapRefreshSessionCallback=function(e){return function(t,i){return i?Ye("tokenRefresh",void 0,"New token retrieved"):Ye("tokenRefresh_failure",t,"Failed to retrieve new token"),e(t,i)}},this.configure(e),this.currentCredentials=this.currentCredentials.bind(this),this.currentUserCredentials=this.currentUserCredentials.bind(this),h.YZ.listen("auth",function(e){switch(e.payload.event){case"signIn":t._storage.setItem("amplify-signin-with-hostedUI","false");break;case"signOut":t._storage.removeItem("amplify-signin-with-hostedUI");break;case"cognitoHostedUI":t._storage.setItem("amplify-signin-with-hostedUI","true")}})}return e.prototype.getModuleName=function(){return"Auth"},e.prototype.configure=function(e){var t=this;if(!e)return this._config||{};je.debug("configure Auth");var i=Object.assign({},this._config,d.iX.parseMobilehubConfig(e).Auth,e);this._config=i;var n=this._config,r=n.userPoolId,o=n.userPoolWebClientId,l=n.cookieStorage,c=n.oauth,h=n.region,u=n.identityPoolId,p=n.mandatorySignIn,f=n.refreshHandlers,v=n.identityPoolRegion,b=n.clientMetadata,C=n.endpoint;if(this._config.storage){if(!this._isValidAuthStorage(this._config.storage))throw je.error("The storage in the Auth config is not valid!"),new Error("Empty storage object");this._storage=this._config.storage}else this._storage=l?new Se(l):e.ssr?new m:(new y.i1).getStorage();if(this._storageSync=Promise.resolve(),"function"==typeof this._storage.sync&&(this._storageSync=this._storage.sync()),r){var w={UserPoolId:r,ClientId:o,endpoint:C};w.Storage=this._storage,this.userPool=new Ce(w,this.wrapRefreshSessionCallback)}this.Credentials.configure({mandatorySignIn:p,region:v||h,userPoolId:r,identityPoolId:u,refreshHandlers:f,storage:this._storage});var S=c?a(this._config.oauth)?c:c.awsCognito:void 0;if(S){var x=Object.assign({cognitoClientId:o,UserPoolId:r,domain:S.domain,scopes:S.scope,redirectSignIn:S.redirectSignIn,redirectSignOut:S.redirectSignOut,responseType:S.responseType,Storage:this._storage,urlOpener:S.urlOpener,clientMetadata:b},S.options);this._oAuthHandler=new _e({scopes:x.scopes,config:x,cognitoClientId:x.cognitoClientId});var E={};!function(){if((0,g.gy)().isBrowser&&window.location)!function(e){var i=e.url;E[i]||(E[i]=!0,t._handleAuthResponse(i))}({url:window.location.href});else if(!(0,g.gy)().isNode)throw new Error("Not supported")}()}return Ye("configured",null,"The Auth category has been configured successfully"),this.autoSignInInitiated||"function"!=typeof this._storage.getItem||(this.isTrueStorageValue("amplify-polling-started")&&(Ye("autoSignIn_failure",null,s.AutoSignInError),this._storage.removeItem("amplify-auto-sign-in")),this._storage.removeItem("amplify-polling-started")),this._config},e.prototype.signUp=function(e){for(var t,i,n,r=this,o=[],a=1;a<arguments.length;a++)o[a-1]=arguments[a];if(!this.userPool)return this.rejectNoUserPool();var l,c=null,h=null,u=[],d=null,p={enabled:!1},g={},f={};if(e&&"string"==typeof e){c=e,h=o?o[0]:null;var m=o?o[1]:null,y=o?o[2]:null;m&&u.push(new ne({Name:"email",Value:m})),y&&u.push(new ne({Name:"phone_number",Value:y}))}else{if(!e||"object"!=typeof e)return this.rejectAuthError(s.SignUpError);c=e.username,h=e.password,e&&e.clientMetadata?l=e.clientMetadata:this._config.clientMetadata&&(l=this._config.clientMetadata);var v=e.attributes;v&&Object.keys(v).map(function(e){u.push(new ne({Name:e,Value:v[e]}))});var b=e.validationData;b&&(d=[],Object.keys(b).map(function(e){d.push(new ne({Name:e,Value:b[e]}))})),(p=null!==(t=e.autoSignIn)&&void 0!==t?t:{enabled:!1}).enabled&&(this._storage.setItem("amplify-auto-sign-in","true"),g=null!==(i=p.validationData)&&void 0!==i?i:{},f=null!==(n=p.clientMetaData)&&void 0!==n?n:{})}return c?h?(je.debug("signUp attrs:",u),je.debug("signUp validation data:",d),new Promise(function(e,t){r.userPool.signUp(c,h,u,d,function(i,n){i?(Ye("signUp_failure",i,c+" failed to signup"),t(i)):(Ye("signUp",n,c+" has signed up successfully"),p.enabled&&r.handleAutoSignIn(c,h,g,f,n),e(n))},l)})):this.rejectAuthError(s.EmptyPassword):this.rejectAuthError(s.EmptyUsername)},e.prototype.handleAutoSignIn=function(e,t,i,n,s){this.autoSignInInitiated=!0;var r=new b({Username:e,Password:t,ValidationData:i,ClientMetadata:n});s.userConfirmed?this.signInAfterUserConfirmed(r):"link"===this._config.signUpVerificationMethod?this.handleLinkAutoSignIn(r):this.handleCodeAutoSignIn(r)},e.prototype.handleCodeAutoSignIn=function(e){var t=this,i=function(n){"confirmSignUp"===n.payload.event&&t.signInAfterUserConfirmed(e,i)};h.YZ.listen("auth",i)},e.prototype.handleLinkAutoSignIn=function(e){var t=this;this._storage.setItem("amplify-polling-started","true");var i=Date.now(),n=setInterval(function(){Date.now()-i>18e4?(clearInterval(n),Ye("autoSignIn_failure",null,"Please confirm your account and use your credentials to sign in."),t._storage.removeItem("amplify-auto-sign-in")):t.signInAfterUserConfirmed(e,null,n)},5e3)},e.prototype.signInAfterUserConfirmed=function(e,t,i){return Ue(this,void 0,void 0,function(){var n,s,r=this;return ze(this,function(o){switch(o.label){case 0:n=this.createCognitoUser(e.getUsername()),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,n.authenticateUser(e,this.authCallbacks(n,function(n){Ye("autoSignIn",n,e.getUsername()+" has signed in successfully"),t&&h.YZ.remove("auth",t),i&&(clearInterval(i),r._storage.removeItem("amplify-polling-started")),r._storage.removeItem("amplify-auto-sign-in")},function(e){je.error(e),r._storage.removeItem("amplify-auto-sign-in")}))];case 2:return o.sent(),[3,4];case 3:return s=o.sent(),je.error(s),[3,4];case 4:return[2]}})})},e.prototype.confirmSignUp=function(e,t,i){var n=this;if(!this.userPool)return this.rejectNoUserPool();if(!e)return this.rejectAuthError(s.EmptyUsername);if(!t)return this.rejectAuthError(s.EmptyCode);var r,o=this.createCognitoUser(e),a=!i||"boolean"!=typeof i.forceAliasCreation||i.forceAliasCreation;return i&&i.clientMetadata?r=i.clientMetadata:this._config.clientMetadata&&(r=this._config.clientMetadata),new Promise(function(i,l){o.confirmRegistration(t,a,function(t,r){t?l(t):(Ye("confirmSignUp",r,e+" has been confirmed successfully"),n.isTrueStorageValue("amplify-auto-sign-in")&&!n.autoSignInInitiated&&(Ye("autoSignIn_failure",null,s.AutoSignInError),n._storage.removeItem("amplify-auto-sign-in")),i(r))},r)})},e.prototype.isTrueStorageValue=function(e){var t=this._storage.getItem(e);return!!t&&"true"===t},e.prototype.resendSignUp=function(e,t){if(void 0===t&&(t=this._config.clientMetadata),!this.userPool)return this.rejectNoUserPool();if(!e)return this.rejectAuthError(s.EmptyUsername);var i=this.createCognitoUser(e);return new Promise(function(e,n){i.resendConfirmationCode(function(t,i){t?n(t):e(i)},t)})},e.prototype.signIn=function(e,t,i){if(void 0===i&&(i=this._config.clientMetadata),!this.userPool)return this.rejectNoUserPool();var n=null,r=null,o={};if("string"==typeof e)n=e,r=t;else{if(!e.username)return this.rejectAuthError(s.InvalidUsername);void 0!==t&&je.warn("The password should be defined under the first parameter object!"),n=e.username,r=e.password,o=e.validationData}if(!n)return this.rejectAuthError(s.EmptyUsername);var a=new b({Username:n,Password:r,ValidationData:o,ClientMetadata:i});return r?this.signInWithPassword(a):this.signInWithoutPassword(a)},e.prototype.authCallbacks=function(e,t,i){var n=this,s=this;return{onSuccess:function(r){return Ue(n,void 0,void 0,function(){var n,o,a,l;return ze(this,function(c){switch(c.label){case 0:je.debug(r),delete e.challengeName,delete e.challengeParam,c.label=1;case 1:return c.trys.push([1,4,5,9]),[4,this.Credentials.clear()];case 2:return c.sent(),[4,this.Credentials.set(r,"session")];case 3:return n=c.sent(),je.debug("succeed to get cognito credentials",n),[3,9];case 4:return o=c.sent(),je.debug("cannot get cognito credentials",o),[3,9];case 5:return c.trys.push([5,7,,8]),[4,this.currentUserPoolUser()];case 6:return a=c.sent(),s.user=a,Ye("signIn",a,"A user "+e.getUsername()+" has been signed in"),t(a),[3,8];case 7:return l=c.sent(),je.error("Failed to get the signed in user",l),i(l),[3,8];case 8:return[7];case 9:return[2]}})})},onFailure:function(t){je.debug("signIn failure",t),Ye("signIn_failure",t,e.getUsername()+" failed to signin"),i(t)},customChallenge:function(i){je.debug("signIn custom challenge answer required"),e.challengeName="CUSTOM_CHALLENGE",e.challengeParam=i,t(e)},mfaRequired:function(i,n){je.debug("signIn MFA required"),e.challengeName=i,e.challengeParam=n,t(e)},mfaSetup:function(i,n){je.debug("signIn mfa setup",i),e.challengeName=i,e.challengeParam=n,t(e)},newPasswordRequired:function(i,n){je.debug("signIn new password"),e.challengeName="NEW_PASSWORD_REQUIRED",e.challengeParam={userAttributes:i,requiredAttributes:n},t(e)},totpRequired:function(i,n){je.debug("signIn totpRequired"),e.challengeName=i,e.challengeParam=n,t(e)},selectMFAType:function(i,n){je.debug("signIn selectMFAType",i),e.challengeName=i,e.challengeParam=n,t(e)}}},e.prototype.signInWithPassword=function(e){var t=this;if(this.pendingSignIn)throw new Error("Pending sign-in attempt already in progress");var i=this.createCognitoUser(e.getUsername());return this.pendingSignIn=new Promise(function(n,s){i.authenticateUser(e,t.authCallbacks(i,function(e){t.pendingSignIn=null,n(e)},function(e){t.pendingSignIn=null,s(e)}))}),this.pendingSignIn},e.prototype.signInWithoutPassword=function(e){var t=this,i=this.createCognitoUser(e.getUsername());return i.setAuthenticationFlowType("CUSTOM_AUTH"),new Promise(function(n,s){i.initiateAuth(e,t.authCallbacks(i,n,s))})},e.prototype.getMFAOptions=function(e){return new Promise(function(t,i){e.getMFAOptions(function(e,n){if(e)return je.debug("get MFA Options failed",e),void i(e);je.debug("get MFA options success",n),t(n)})})},e.prototype.getPreferredMFA=function(e,t){var i=this,n=this;return new Promise(function(s,r){var o=i._config.clientMetadata,a=!!t&&t.bypassCache;e.getUserData(function(t,o){return Ue(i,void 0,void 0,function(){var i,a;return ze(this,function(l){switch(l.label){case 0:if(!t)return[3,5];if(je.debug("getting preferred mfa failed",t),!this.isSessionInvalid(t))return[3,4];l.label=1;case 1:return l.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(e)];case 2:return l.sent(),[3,4];case 3:return i=l.sent(),r(new Error("Session is invalid due to: "+t.message+" and failed to clean up invalid session: "+i.message)),[2];case 4:return r(t),[2];case 5:return(a=n._getMfaTypeFromUserData(o))?(s(a),[2]):(r("invalid MFA Type"),[2])}})})},{bypassCache:a,clientMetadata:o})})},e.prototype._getMfaTypeFromUserData=function(e){var t=null,i=e.PreferredMfaSetting;if(i)t=i;else{var n=e.UserMFASettingList;n?0===n.length?t="NOMFA":je.debug("invalid case for getPreferredMFA",e):t=e.MFAOptions?"SMS_MFA":"NOMFA"}return t},e.prototype._getUserData=function(e,t){var i=this;return new Promise(function(n,s){e.getUserData(function(t,r){return Ue(i,void 0,void 0,function(){var i;return ze(this,function(o){switch(o.label){case 0:if(!t)return[3,5];if(je.debug("getting user data failed",t),!this.isSessionInvalid(t))return[3,4];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(e)];case 2:return o.sent(),[3,4];case 3:return i=o.sent(),s(new Error("Session is invalid due to: "+t.message+" and failed to clean up invalid session: "+i.message)),[2];case 4:return s(t),[2];case 5:n(r),o.label=6;case 6:return[2]}})})},t)})},e.prototype.setPreferredMFA=function(e,t){return Ue(this,void 0,void 0,function(){var i,n,r,o,a,l,c=this;return ze(this,function(h){switch(h.label){case 0:return i=this._config.clientMetadata,[4,this._getUserData(e,{bypassCache:!0,clientMetadata:i})];case 1:switch(n=h.sent(),r=null,o=null,t){case"TOTP":case"SOFTWARE_TOKEN_MFA":return[3,2];case"SMS":case"SMS_MFA":return[3,3];case"NOMFA":return[3,4]}return[3,6];case 2:return o={PreferredMfa:!0,Enabled:!0},[3,7];case 3:return r={PreferredMfa:!0,Enabled:!0},[3,7];case 4:return a=n.UserMFASettingList,[4,this._getMfaTypeFromUserData(n)];case 5:if("NOMFA"===(l=h.sent()))return[2,Promise.resolve("No change for mfa type")];if("SMS_MFA"===l)r={PreferredMfa:!1,Enabled:!1};else{if("SOFTWARE_TOKEN_MFA"!==l)return[2,this.rejectAuthError(s.InvalidMFA)];o={PreferredMfa:!1,Enabled:!1}}return a&&0!==a.length&&a.forEach(function(e){"SMS_MFA"===e?r={PreferredMfa:!1,Enabled:!1}:"SOFTWARE_TOKEN_MFA"===e&&(o={PreferredMfa:!1,Enabled:!1})}),[3,7];case 6:return je.debug("no validmfa method provided"),[2,this.rejectAuthError(s.NoMFA)];case 7:return[2,new Promise(function(t,n){e.setUserMfaPreference(r,o,function(s,r){if(s)return je.debug("Set user mfa preference error",s),n(s);je.debug("Set user mfa success",r),je.debug("Caching the latest user data into local"),e.getUserData(function(i,s){return Ue(c,void 0,void 0,function(){var s;return ze(this,function(o){switch(o.label){case 0:if(!i)return[3,5];if(je.debug("getting user data failed",i),!this.isSessionInvalid(i))return[3,4];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(e)];case 2:return o.sent(),[3,4];case 3:return s=o.sent(),n(new Error("Session is invalid due to: "+i.message+" and failed to clean up invalid session: "+s.message)),[2];case 4:return[2,n(i)];case 5:return[2,t(r)]}})})},{bypassCache:!0,clientMetadata:i})})})]}})})},e.prototype.disableSMS=function(e){return new Promise(function(t,i){e.disableMFA(function(e,n){if(e)return je.debug("disable mfa failed",e),void i(e);je.debug("disable mfa succeed",n),t(n)})})},e.prototype.enableSMS=function(e){return new Promise(function(t,i){e.enableMFA(function(e,n){if(e)return je.debug("enable mfa failed",e),void i(e);je.debug("enable mfa succeed",n),t(n)})})},e.prototype.setupTOTP=function(e){return new Promise(function(t,i){e.associateSoftwareToken({onFailure:function(e){je.debug("associateSoftwareToken failed",e),i(e)},associateSecretCode:function(e){je.debug("associateSoftwareToken sucess",e),t(e)}})})},e.prototype.verifyTotpToken=function(e,t){return je.debug("verification totp token",e,t),new Promise(function(i,n){e.verifySoftwareToken(t,"My TOTP device",{onFailure:function(e){je.debug("verifyTotpToken failed",e),n(e)},onSuccess:function(t){Ye("signIn",e,"A user "+e.getUsername()+" has been signed in"),je.debug("verifyTotpToken success",t),i(t)}})})},e.prototype.confirmSignIn=function(e,t,i,n){var r=this;if(void 0===n&&(n=this._config.clientMetadata),!t)return this.rejectAuthError(s.EmptyCode);var o=this;return new Promise(function(s,a){e.sendMFACode(t,{onSuccess:function(t){return Ue(r,void 0,void 0,function(){var i,n;return ze(this,function(r){switch(r.label){case 0:je.debug(t),r.label=1;case 1:return r.trys.push([1,4,5,6]),[4,this.Credentials.clear()];case 2:return r.sent(),[4,this.Credentials.set(t,"session")];case 3:return i=r.sent(),je.debug("succeed to get cognito credentials",i),[3,6];case 4:return n=r.sent(),je.debug("cannot get cognito credentials",n),[3,6];case 5:return o.user=e,Ye("signIn",e,"A user "+e.getUsername()+" has been signed in"),s(e),[7];case 6:return[2]}})})},onFailure:function(e){je.debug("confirm signIn failure",e),a(e)}},i,n)})},e.prototype.completeNewPassword=function(e,t,i,n){var r=this;if(void 0===i&&(i={}),void 0===n&&(n=this._config.clientMetadata),!t)return this.rejectAuthError(s.EmptyPassword);var o=this;return new Promise(function(s,a){e.completeNewPasswordChallenge(t,i,{onSuccess:function(t){return Ue(r,void 0,void 0,function(){var i,n;return ze(this,function(r){switch(r.label){case 0:je.debug(t),r.label=1;case 1:return r.trys.push([1,4,5,6]),[4,this.Credentials.clear()];case 2:return r.sent(),[4,this.Credentials.set(t,"session")];case 3:return i=r.sent(),je.debug("succeed to get cognito credentials",i),[3,6];case 4:return n=r.sent(),je.debug("cannot get cognito credentials",n),[3,6];case 5:return o.user=e,Ye("signIn",e,"A user "+e.getUsername()+" has been signed in"),s(e),[7];case 6:return[2]}})})},onFailure:function(e){je.debug("completeNewPassword failure",e),Ye("completeNewPassword_failure",e,r.user+" failed to complete the new password flow"),a(e)},mfaRequired:function(t,i){je.debug("signIn MFA required"),e.challengeName=t,e.challengeParam=i,s(e)},mfaSetup:function(t,i){je.debug("signIn mfa setup",t),e.challengeName=t,e.challengeParam=i,s(e)},totpRequired:function(t,i){je.debug("signIn mfa setup",t),e.challengeName=t,e.challengeParam=i,s(e)}},n)})},e.prototype.sendCustomChallengeAnswer=function(e,t,i){var n=this;return void 0===i&&(i=this._config.clientMetadata),this.userPool?t?new Promise(function(s,r){e.sendCustomChallengeAnswer(t,n.authCallbacks(e,s,r),i)}):this.rejectAuthError(s.EmptyChallengeResponse):this.rejectNoUserPool()},e.prototype.deleteUserAttributes=function(e,t){var i=this;return new Promise(function(n,s){i.userSession(e).then(function(i){e.deleteAttributes(t,function(e,t){return e?s(e):n(t)})})})},e.prototype.deleteUser=function(){return Ue(this,void 0,void 0,function(){var e,t,i=this;return ze(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this._storageSync];case 1:return n.sent(),[3,3];case 2:throw e=n.sent(),je.debug("Failed to sync cache info into memory",e),new Error(e);case 3:return t=this._oAuthHandler&&"true"===this._storage.getItem("amplify-signin-with-hostedUI"),[2,new Promise(function(e,n){return Ue(i,void 0,void 0,function(){var i,s=this;return ze(this,function(r){if(this.userPool){if(!(i=this.userPool.getCurrentUser()))return je.debug("Failed to get user from user pool"),[2,n(new Error("No current user."))];i.getSession(function(r,o){return Ue(s,void 0,void 0,function(){var s,o=this;return ze(this,function(a){switch(a.label){case 0:if(!r)return[3,5];if(je.debug("Failed to get the user session",r),!this.isSessionInvalid(r))return[3,4];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(i)];case 2:return a.sent(),[3,4];case 3:return s=a.sent(),n(new Error("Session is invalid due to: "+r.message+" and failed to clean up invalid session: "+s.message)),[2];case 4:return[2,n(r)];case 5:i.deleteUser(function(s,r){if(s)n(s);else{Ye("userDeleted",r,"The authenticated user has been deleted."),i.signOut(),o.user=null;try{o.cleanCachedItems()}catch(e){je.debug("failed to clear cached items")}t?o.oAuthSignOutRedirect(e,n):(Ye("signOut",o.user,"A user has been signed out"),e(r))}}),a.label=6;case 6:return[2]}})})})}else je.debug("no Congito User pool"),n(new Error("Cognito User pool does not exist"));return[2]})})})]}})})},e.prototype.updateUserAttributes=function(e,t,i){void 0===i&&(i=this._config.clientMetadata);var n=[],s=this;return new Promise(function(r,o){s.userSession(e).then(function(s){for(var a in t)if("sub"!==a&&a.indexOf("_verified")<0){var l={Name:a,Value:t[a]};n.push(l)}e.updateAttributes(n,function(e,t){return e?o(e):r(t)},i)})})},e.prototype.userAttributes=function(e){var t=this;return new Promise(function(i,n){t.userSession(e).then(function(t){e.getUserAttributes(function(e,t){e?n(e):i(t)})})})},e.prototype.verifiedContact=function(e){var t=this;return this.userAttributes(e).then(function(e){var i=t.attributesToObject(e),n={},s={};return i.email&&(i.email_verified?s.email=i.email:n.email=i.email),i.phone_number&&(i.phone_number_verified?s.phone_number=i.phone_number:n.phone_number=i.phone_number),{verified:s,unverified:n}})},e.prototype.isErrorWithMessage=function(e){return"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"message")},e.prototype.isTokenRevokedError=function(e){return this.isErrorWithMessage(e)&&"Access Token has been revoked"===e.message},e.prototype.isRefreshTokenRevokedError=function(e){return this.isErrorWithMessage(e)&&"Refresh Token has been revoked"===e.message},e.prototype.isUserDisabledError=function(e){return this.isErrorWithMessage(e)&&"User is disabled."===e.message},e.prototype.isUserDoesNotExistError=function(e){return this.isErrorWithMessage(e)&&"User does not exist."===e.message},e.prototype.isRefreshTokenExpiredError=function(e){return this.isErrorWithMessage(e)&&"Refresh Token has expired"===e.message},e.prototype.isSignedInHostedUI=function(){return this._oAuthHandler&&"true"===this._storage.getItem("amplify-signin-with-hostedUI")},e.prototype.isSessionInvalid=function(e){return this.isUserDisabledError(e)||this.isUserDoesNotExistError(e)||this.isTokenRevokedError(e)||this.isRefreshTokenRevokedError(e)||this.isRefreshTokenExpiredError(e)},e.prototype.cleanUpInvalidSession=function(e){return Ue(this,void 0,void 0,function(){var t=this;return ze(this,function(i){switch(i.label){case 0:e.signOut(),this.user=null,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.cleanCachedItems()];case 2:return i.sent(),[3,4];case 3:return i.sent(),je.debug("failed to clear cached items"),[3,4];case 4:return this.isSignedInHostedUI()?[2,new Promise(function(e,i){t.oAuthSignOutRedirect(e,i)})]:(Ye("signOut",this.user,"A user has been signed out"),[2])}})})},e.prototype.currentUserPoolUser=function(e){var t=this;return this.userPool?new Promise(function(i,n){t._storageSync.then(function(){return Ue(t,void 0,void 0,function(){var t,s,r=this;return ze(this,function(o){switch(o.label){case 0:return this.isOAuthInProgress()?(je.debug("OAuth signIn in progress, waiting for resolution..."),[4,new Promise(function(e){var t=setTimeout(function(){je.debug("OAuth signIn in progress timeout"),h.YZ.remove("auth",i),e()},1e4);function i(n){var s=n.payload.event;"cognitoHostedUI"!==s&&"cognitoHostedUI_failure"!==s||(je.debug("OAuth signIn resolved: "+s),clearTimeout(t),h.YZ.remove("auth",i),e())}h.YZ.listen("auth",i)})]):[3,2];case 1:o.sent(),o.label=2;case 2:return(t=this.userPool.getCurrentUser())?(s=this._config.clientMetadata,t.getSession(function(s,o){return Ue(r,void 0,void 0,function(){var r,a,l,c,h=this;return ze(this,function(u){switch(u.label){case 0:if(!s)return[3,5];if(je.debug("Failed to get the user session",s),!this.isSessionInvalid(s))return[3,4];u.label=1;case 1:return u.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(t)];case 2:return u.sent(),[3,4];case 3:return r=u.sent(),n(new Error("Session is invalid due to: "+s.message+" and failed to clean up invalid session: "+r.message)),[2];case 4:return n(s),[2];case 5:return(a=!!e&&e.bypassCache)?[4,this.Credentials.clear()]:[3,7];case 6:u.sent(),u.label=7;case 7:return l=this._config.clientMetadata,(void 0===(c=o.getAccessToken().decodePayload().scope)?"":c).split(" ").includes($e)?(t.getUserData(function(e,s){return Ue(h,void 0,void 0,function(){var r,o,a,l,c,h,u;return ze(this,function(d){switch(d.label){case 0:if(!e)return[3,7];if(je.debug("getting user data failed",e),!this.isSessionInvalid(e))return[3,5];d.label=1;case 1:return d.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(t)];case 2:return d.sent(),[3,4];case 3:return r=d.sent(),n(new Error("Session is invalid due to: "+e.message+" and failed to clean up invalid session: "+r.message)),[2];case 4:return n(e),[3,6];case 5:i(t),d.label=6;case 6:return[2];case 7:for(o=s.PreferredMfaSetting||"NOMFA",a=[],l=0;l<s.UserAttributes.length;l++)c={Name:s.UserAttributes[l].Name,Value:s.UserAttributes[l].Value},h=new ne(c),a.push(h);return u=this.attributesToObject(a),Object.assign(t,{attributes:u,preferredMFA:o}),[2,i(t)]}})})},{bypassCache:a,clientMetadata:l}),[2]):(je.debug("Unable to get the user data because the "+$e+" is not in the scopes of the access token"),[2,i(t)])}})})},{clientMetadata:s}),[2]):(je.debug("Failed to get user from user pool"),n("No current user"),[2])}})})}).catch(function(e){return je.debug("Failed to sync cache info into memory",e),n(e)})}):this.rejectNoUserPool()},e.prototype.isOAuthInProgress=function(){return this.oAuthFlowInProgress},e.prototype.currentAuthenticatedUser=function(e){return Ue(this,void 0,void 0,function(){var t,i,n,s,r;return ze(this,function(o){switch(o.label){case 0:je.debug("getting current authenticated user"),t=null,o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this._storageSync];case 2:return o.sent(),[3,4];case 3:throw i=o.sent(),je.debug("Failed to sync cache info into memory",i),i;case 4:try{(n=JSON.parse(this._storage.getItem("aws-amplify-federatedInfo")))&&(t=He(He({},n.user),{token:n.token}))}catch(e){je.debug("cannot load federated user from auth storage")}return t?(this.user=t,je.debug("get current authenticated federated user",this.user),[2,this.user]):[3,5];case 5:je.debug("get current authenticated userpool user"),s=null,o.label=6;case 6:return o.trys.push([6,8,,9]),[4,this.currentUserPoolUser(e)];case 7:return s=o.sent(),[3,9];case 8:return"No userPool"===(r=o.sent())&&je.error("Cannot get the current user because the user pool is missing. Please make sure the Auth module is configured with a valid Cognito User Pool ID"),je.debug("The user is not authenticated by the error",r),[2,Promise.reject("The user is not authenticated")];case 9:return this.user=s,[2,this.user]}})})},e.prototype.currentSession=function(){var e=this;return je.debug("Getting current session"),this.userPool?new Promise(function(t,i){e.currentUserPoolUser().then(function(n){e.userSession(n).then(function(e){t(e)}).catch(function(e){je.debug("Failed to get the current session",e),i(e)})}).catch(function(e){je.debug("Failed to get the current user",e),i(e)})}):Promise.reject(new Error("No User Pool in the configuration."))},e.prototype.userSession=function(e){var t=this;if(!e)return je.debug("the user is null"),this.rejectAuthError(s.NoUserSession);var i=this._config.clientMetadata;return new Promise(function(n,s){je.debug("Getting the session from this user:",e),e.getSession(function(i,r){return Ue(t,void 0,void 0,function(){var t;return ze(this,function(o){switch(o.label){case 0:if(!i)return[3,5];if(je.debug("Failed to get the session from user",e),!this.isSessionInvalid(i))return[3,4];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(e)];case 2:return o.sent(),[3,4];case 3:return t=o.sent(),s(new Error("Session is invalid due to: "+i.message+" and failed to clean up invalid session: "+t.message)),[2];case 4:return s(i),[2];case 5:return je.debug("Succeed to get the user session",r),n(r),[2]}})})},{clientMetadata:i})})},e.prototype.currentUserCredentials=function(){return Ue(this,void 0,void 0,function(){var e,t,i=this;return ze(this,function(n){switch(n.label){case 0:je.debug("Getting current user credentials"),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this._storageSync];case 2:return n.sent(),[3,4];case 3:throw e=n.sent(),je.debug("Failed to sync cache info into memory",e),e;case 4:t=null;try{t=JSON.parse(this._storage.getItem("aws-amplify-federatedInfo"))}catch(e){je.debug("failed to get or parse item aws-amplify-federatedInfo",e)}return t?[2,this.Credentials.refreshFederatedToken(t)]:[2,this.currentSession().then(function(e){return je.debug("getting session success",e),i.Credentials.set(e,"session")}).catch(function(){return je.debug("getting guest credentials"),i.Credentials.set(null,"guest")})]}})})},e.prototype.currentCredentials=function(){return je.debug("getting current credentials"),this.Credentials.get()},e.prototype.verifyUserAttribute=function(e,t,i){return void 0===i&&(i=this._config.clientMetadata),new Promise(function(n,s){e.getAttributeVerificationCode(t,{onSuccess:function(e){return n(e)},onFailure:function(e){return s(e)}},i)})},e.prototype.verifyUserAttributeSubmit=function(e,t,i){return i?new Promise(function(n,s){e.verifyAttribute(t,i,{onSuccess:function(e){n(e)},onFailure:function(e){s(e)}})}):this.rejectAuthError(s.EmptyCode)},e.prototype.verifyCurrentUserAttribute=function(e){var t=this;return t.currentUserPoolUser().then(function(i){return t.verifyUserAttribute(i,e)})},e.prototype.verifyCurrentUserAttributeSubmit=function(e,t){var i=this;return i.currentUserPoolUser().then(function(n){return i.verifyUserAttributeSubmit(n,e,t)})},e.prototype.cognitoIdentitySignOut=function(e,t){return Ue(this,void 0,void 0,function(){var i,n,s=this;return ze(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this._storageSync];case 1:return r.sent(),[3,3];case 2:throw i=r.sent(),je.debug("Failed to sync cache info into memory",i),i;case 3:return n=this._oAuthHandler&&"true"===this._storage.getItem("amplify-signin-with-hostedUI"),[2,new Promise(function(i,r){if(e&&e.global){je.debug("user global sign out",t);var o=s._config.clientMetadata;t.getSession(function(e,o){return Ue(s,void 0,void 0,function(){var s,o=this;return ze(this,function(a){switch(a.label){case 0:if(!e)return[3,5];if(je.debug("failed to get the user session",e),!this.isSessionInvalid(e))return[3,4];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(t)];case 2:return a.sent(),[3,4];case 3:return s=a.sent(),r(new Error("Session is invalid due to: "+e.message+" and failed to clean up invalid session: "+s.message)),[2];case 4:return[2,r(e)];case 5:return t.globalSignOut({onSuccess:function(e){if(je.debug("global sign out success"),!n)return i();o.oAuthSignOutRedirect(i,r)},onFailure:function(e){return je.debug("global sign out failed",e),r(e)}}),[2]}})})},{clientMetadata:o})}else je.debug("user sign out",t),t.signOut(function(){if(!n)return i();s.oAuthSignOutRedirect(i,r)})})]}})})},e.prototype.oAuthSignOutRedirect=function(e,t){(0,g.gy)().isBrowser?this.oAuthSignOutRedirectOrReject(t):this.oAuthSignOutAndResolve(e)},e.prototype.oAuthSignOutAndResolve=function(e){this._oAuthHandler.signOut(),e()},e.prototype.oAuthSignOutRedirectOrReject=function(e){this._oAuthHandler.signOut(),setTimeout(function(){return e(Error("Signout timeout fail"))},3e3)},e.prototype.signOut=function(e){return Ue(this,void 0,void 0,function(){var t;return ze(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.cleanCachedItems()];case 1:return i.sent(),[3,3];case 2:return i.sent(),je.debug("failed to clear cached items"),[3,3];case 3:return this.userPool?(t=this.userPool.getCurrentUser())?[4,this.cognitoIdentitySignOut(e,t)]:[3,5]:[3,7];case 4:return i.sent(),[3,6];case 5:je.debug("no current Cognito user"),i.label=6;case 6:return[3,8];case 7:je.debug("no Cognito User pool"),i.label=8;case 8:return Ye("signOut",this.user,"A user has been signed out"),this.user=null,[2]}})})},e.prototype.cleanCachedItems=function(){return Ue(this,void 0,void 0,function(){return ze(this,function(e){switch(e.label){case 0:return[4,this.Credentials.clear()];case 1:return e.sent(),[2]}})})},e.prototype.changePassword=function(e,t,i,n){var s=this;return void 0===n&&(n=this._config.clientMetadata),new Promise(function(r,o){s.userSession(e).then(function(s){e.changePassword(t,i,function(e,t){return e?(je.debug("change password failure",e),o(e)):r(t)},n)})})},e.prototype.forgotPassword=function(e,t){if(void 0===t&&(t=this._config.clientMetadata),!this.userPool)return this.rejectNoUserPool();if(!e)return this.rejectAuthError(s.EmptyUsername);var i=this.createCognitoUser(e);return new Promise(function(n,s){i.forgotPassword({onSuccess:function(){n()},onFailure:function(t){je.debug("forgot password failure",t),Ye("forgotPassword_failure",t,e+" forgotPassword failed"),s(t)},inputVerificationCode:function(t){Ye("forgotPassword",i,e+" has initiated forgot password flow"),n(t)}},t)})},e.prototype.forgotPasswordSubmit=function(e,t,i,n){if(void 0===n&&(n=this._config.clientMetadata),!this.userPool)return this.rejectNoUserPool();if(!e)return this.rejectAuthError(s.EmptyUsername);if(!t)return this.rejectAuthError(s.EmptyCode);if(!i)return this.rejectAuthError(s.EmptyPassword);var r=this.createCognitoUser(e);return new Promise(function(s,o){r.confirmPassword(t,i,{onSuccess:function(t){Ye("forgotPasswordSubmit",r,e+" forgotPasswordSubmit successful"),s(t)},onFailure:function(t){Ye("forgotPasswordSubmit_failure",t,e+" forgotPasswordSubmit failed"),o(t)}},n)})},e.prototype.currentUserInfo=function(){return Ue(this,void 0,void 0,function(){var e,t,i,n,s,r,o;return ze(this,function(a){switch(a.label){case 0:return(e=this.Credentials.getCredSource())&&"aws"!==e&&"userPool"!==e?[3,9]:[4,this.currentUserPoolUser().catch(function(e){return je.error(e)})];case 1:if(!(o=a.sent()))return[2,null];a.label=2;case 2:return a.trys.push([2,8,,9]),[4,this.userAttributes(o)];case 3:t=a.sent(),i=this.attributesToObject(t),n=null,a.label=4;case 4:return a.trys.push([4,6,,7]),[4,this.currentCredentials()];case 5:return n=a.sent(),[3,7];case 6:return s=a.sent(),je.debug("Failed to retrieve credentials while getting current user info",s),[3,7];case 7:return[2,{id:n?n.identityId:void 0,username:o.getUsername(),attributes:i}];case 8:return r=a.sent(),je.error("currentUserInfo error",r),[2,{}];case 9:return"federated"===e?[2,(o=this.user)||{}]:[2]}})})},e.prototype.federatedSignIn=function(e,t,i){return Ue(this,void 0,void 0,function(){var s,r,l,c,h,u,d,p,g,f,m;return ze(this,function(y){switch(y.label){case 0:if(!this._config.identityPoolId&&!this._config.userPoolId)throw new Error("Federation requires either a User Pool or Identity Pool in config");if(void 0===e&&this._config.identityPoolId&&!this._config.userPoolId)throw new Error("Federation with Identity Pools requires tokens passed as arguments");return o(e)||(v=e)&&["customProvider"].find(function(e){return v.hasOwnProperty(e)})||function(e){return e&&!!["customState"].find(function(t){return e.hasOwnProperty(t)})}(e)||void 0===e?(s=e||{provider:n.Cognito},h=o(s)?s.provider:s.customProvider,o(s),r=s.customState,this._config.userPoolId&&(l=a(this._config.oauth)?this._config.userPoolWebClientId:this._config.oauth.clientID,c=a(this._config.oauth)?this._config.oauth.redirectSignIn:this._config.oauth.redirectUri,this._oAuthHandler.oauthSignIn(this._config.oauth.responseType,this._config.oauth.domain,c,l,h,r)),[3,4]):[3,1];case 1:h=e;try{(u=JSON.stringify(JSON.parse(this._storage.getItem("aws-amplify-federatedInfo")).user))&&je.warn("There is already a signed in user: "+u+" in your app.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tYou should not call Auth.federatedSignIn method again as it may cause unexpected behavior.")}catch(e){}return d=t.token,p=t.identity_id,g=t.expires_at,[4,this.Credentials.set({provider:h,token:d,identity_id:p,user:i,expires_at:g},"federation")];case 2:return f=y.sent(),[4,this.currentAuthenticatedUser()];case 3:return m=y.sent(),Ye("signIn",m,"A user "+m.username+" has been signed in"),je.debug("federated sign in credentials",f),[2,f];case 4:return[2]}var v})})},e.prototype._handleAuthResponse=function(e){return Ue(this,void 0,void 0,function(){var t,i,n,s,r,o,a,l,c,h,u,d,p,f;return ze(this,function(m){switch(m.label){case 0:if(this.oAuthFlowInProgress)return je.debug("Skipping URL "+e+" current flow in progress"),[2];m.label=1;case 1:if(m.trys.push([1,,8,9]),this.oAuthFlowInProgress=!0,!this._config.userPoolId)throw new Error("OAuth responses require a User Pool defined in config");if(Ye("parsingCallbackUrl",{url:e},"The callback url is being parsed"),t=e||((0,g.gy)().isBrowser?window.location.href:""),i=!!((0,xe.parse)(t).query||"").split("&").map(function(e){return e.split("=")}).find(function(e){var t=We(e,1)[0];return"code"===t||"error"===t}),n=!!((0,xe.parse)(t).hash||"#").substr(1).split("&").map(function(e){return e.split("=")}).find(function(e){var t=We(e,1)[0];return"access_token"===t||"error"===t}),!i&&!n)return[3,7];this._storage.setItem("amplify-redirected-from-hosted-ui","true"),m.label=2;case 2:return m.trys.push([2,6,,7]),[4,this._oAuthHandler.handleAuthResponse(t)];case 3:return s=m.sent(),r=s.accessToken,o=s.idToken,a=s.refreshToken,l=s.state,c=new J({IdToken:new q({IdToken:o}),RefreshToken:new X({RefreshToken:a}),AccessToken:new K({AccessToken:r})}),h=void 0,this._config.identityPoolId?[4,this.Credentials.set(c,"session")]:[3,5];case 4:h=m.sent(),je.debug("AWS credentials",h),m.label=5;case 5:return u=/-/.test(l),(d=this.createCognitoUser(c.getIdToken().decodePayload()["cognito:username"])).setSignInUserSession(c),window&&void 0!==window.history&&window.history.replaceState({},null,this._config.oauth.redirectSignIn),Ye("signIn",d,"A user "+d.getUsername()+" has been signed in"),Ye("cognitoHostedUI",d,"A user "+d.getUsername()+" has been signed in via Cognito Hosted UI"),u&&(p=l.split("-").splice(1).join("-"),Ye("customOAuthState",p.match(/.{2}/g).map(function(e){return String.fromCharCode(parseInt(e,16))}).join(""),"State for user "+d.getUsername())),[2,h];case 6:return f=m.sent(),je.debug("Error in cognito hosted auth response",f),window&&void 0!==window.history&&window.history.replaceState({},null,this._config.oauth.redirectSignIn),Ye("signIn_failure",f,"The OAuth response flow failed"),Ye("cognitoHostedUI_failure",f,"A failure occurred when returning to the Cognito Hosted UI"),Ye("customState_failure",f,"A failure occurred when returning state"),[3,7];case 7:return[3,9];case 8:return this.oAuthFlowInProgress=!1,[7];case 9:return[2]}})})},e.prototype.essentialCredentials=function(e){return{accessKeyId:e.accessKeyId,sessionToken:e.sessionToken,secretAccessKey:e.secretAccessKey,identityId:e.identityId,authenticated:e.authenticated}},e.prototype.attributesToObject=function(e){var t=this,i={};return e&&e.map(function(e){"email_verified"===e.Name||"phone_number_verified"===e.Name?i[e.Name]=t.isTruthyString(e.Value)||!0===e.Value:i[e.Name]=e.Value}),i},e.prototype.isTruthyString=function(e){return"function"==typeof e.toLowerCase&&"true"===e.toLowerCase()},e.prototype.createCognitoUser=function(e){var t={Username:e,Pool:this.userPool};t.Storage=this._storage;var i=this._config.authenticationFlowType,n=new le(t);return i&&n.setAuthenticationFlowType(i),n},e.prototype._isValidAuthStorage=function(e){return!!e&&"function"==typeof e.getItem&&"function"==typeof e.setItem&&"function"==typeof e.removeItem&&"function"==typeof e.clear},e.prototype.noUserPoolErrorHandler=function(e){return!e||e.userPoolId&&e.identityPoolId?s.NoConfig:s.MissingAuthConfig},e.prototype.rejectAuthError=function(e){return Promise.reject(new Ge(e))},e.prototype.rejectNoUserPool=function(){var e=this.noUserPoolErrorHandler(this._config);return Promise.reject(new Be(e))},e.prototype.rememberDevice=function(){return Ue(this,void 0,void 0,function(){var e,t;return ze(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.currentUserPoolUser()];case 1:return e=i.sent(),[3,3];case 2:return t=i.sent(),je.debug("The user is not authenticated by the error",t),[2,Promise.reject("The user is not authenticated")];case 3:return e.getCachedDeviceKeyAndPassword(),[2,new Promise(function(t,i){e.setDeviceStatusRemembered({onSuccess:function(e){t(e)},onFailure:function(e){"InvalidParameterException"===e.code?i(new Ge(s.DeviceConfig)):"NetworkError"===e.code?i(new Ge(s.NetworkError)):i(e)}})})]}})})},e.prototype.forgetDevice=function(){return Ue(this,void 0,void 0,function(){var e,t;return ze(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.currentUserPoolUser()];case 1:return e=i.sent(),[3,3];case 2:return t=i.sent(),je.debug("The user is not authenticated by the error",t),[2,Promise.reject("The user is not authenticated")];case 3:return e.getCachedDeviceKeyAndPassword(),[2,new Promise(function(t,i){e.forgetDevice({onSuccess:function(e){t(e)},onFailure:function(e){"InvalidParameterException"===e.code?i(new Ge(s.DeviceConfig)):"NetworkError"===e.code?i(new Ge(s.NetworkError)):i(e)}})})]}})})},e.prototype.fetchDevices=function(){return Ue(this,void 0,void 0,function(){var e,t;return ze(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.currentUserPoolUser()];case 1:return e=i.sent(),[3,3];case 2:throw t=i.sent(),je.debug("The user is not authenticated by the error",t),new Error("The user is not authenticated");case 3:return e.getCachedDeviceKeyAndPassword(),[2,new Promise(function(t,i){var n={onSuccess:function(e){var i=e.Devices.map(function(e){var t=e.DeviceAttributes.find(function(e){return"device_name"===e.Name})||{};return{id:e.DeviceKey,name:t.Value}});t(i)},onFailure:function(e){"InvalidParameterException"===e.code?i(new Ge(s.DeviceConfig)):"NetworkError"===e.code?i(new Ge(s.NetworkError)):i(e)}};e.listDevices(60,null,n)})]}})})},e}(),Xe=new qe(null);v.HA.register(Xe)},78953(e,t,i){"use strict";i.d(t,{HA:()=>r});var n=i(15567),s=new n.C("Amplify"),r=new(function(){function e(){this._components=[],this._config={},this._modules={},this.Auth=null,this.Analytics=null,this.API=null,this.Credentials=null,this.Storage=null,this.I18n=null,this.Cache=null,this.PubSub=null,this.Interactions=null,this.Pushnotification=null,this.UI=null,this.XR=null,this.Predictions=null,this.DataStore=null,this.Geo=null,this.Logger=n.C,this.ServiceWorker=null}return e.prototype.register=function(e){s.debug("component registered in amplify",e),this._components.push(e),"function"==typeof e.getModuleName?(this._modules[e.getModuleName()]=e,this[e.getModuleName()]=e):s.debug("no getModuleName method for component",e),e.configure(this._config)},e.prototype.configure=function(e){var t=this;return e?(this._config=Object.assign(this._config,e),s.debug("amplify config",this._config),Object.entries(this._modules).forEach(function(e){var i=function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,s,r=i.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=r.next()).done;)o.push(n.value)}catch(e){s={error:e}}finally{try{n&&!n.done&&(i=r.return)&&i.call(r)}finally{if(s)throw s.error}}return o}(e,2),n=(i[0],i[1]);Object.keys(n).forEach(function(e){t._modules[e]&&(n[e]=t._modules[e])})}),this._components.map(function(e){e.configure(t._config)}),this._config):this._config},e.prototype.addPluggable=function(e){e&&e.getCategory&&"function"==typeof e.getCategory&&this._components.map(function(t){t.addPluggable&&"function"==typeof t.addPluggable&&t.addPluggable(e)})},e}())},99550(e,t,i){"use strict";i.d(t,{Ji:()=>Ut});var n,s,r,o,a,l,c,h,u,d,p,g,f,m,y,v,b,C,w,S,x,E,A,M,T,D,I,R,k,P,_,L,N,O,F,G,B,V,H,U,z,W,j,$,K,Y,q,X,Z,Q,J,ee,te,ie,ne,se,re,oe,ae=i(15567),le=i(75315),ce=i(51678),he=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},n(e,t)},function(e,t){function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),ue=function(e,t,i,n){return new(i||(i=Promise))(function(s,r){function o(e){try{l(n.next(e))}catch(e){r(e)}}function a(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})},de=function(e,t){var i,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,n&&(s=2&r[0]?n.return:r[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,r[1])).done)return s;switch(n=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,n=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!((s=(s=o.trys).length>0&&s[s.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){o.label=r[1];break}if(6===r[0]&&o.label<s[1]){o.label=s[1],s=r;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(r);break}s[2]&&o.ops.pop(),o.trys.pop();continue}r=t.call(e,o)}catch(e){r=[6,e],n=0}finally{i=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}},pe=function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,s,r=i.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=r.next()).done;)o.push(n.value)}catch(e){s={error:e}}finally{try{n&&!n.done&&(i=r.return)&&i.call(r)}finally{if(s)throw s.error}}return o},ge=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(pe(arguments[t]));return e},fe=new ae.C("Util"),me=function(e){function t(t){var i=e.call(this,t)||this;return i.nonRetryable=!0,i}return he(t,e),t}(Error),ye=3e5,ve=new ae.C("CognitoCredentials"),be=new Promise(function(e,t){return(0,ce.gy)().isBrowser?window.gapi&&window.gapi.auth2&&window.gapi.auth2?(ve.debug("google api already loaded"),e()):void setTimeout(function(){return e()},2e3):(ve.debug("not in the browser, directly resolved"),e())}),Ce=function(){function e(){this.initialized=!1,this.refreshGoogleToken=this.refreshGoogleToken.bind(this),this._refreshGoogleTokenImpl=this._refreshGoogleTokenImpl.bind(this)}return e.prototype.refreshGoogleToken=function(){return e=this,t=void 0,n=function(){return function(e,t){var i,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,n&&(s=2&r[0]?n.return:r[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,r[1])).done)return s;switch(n=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,n=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!((s=(s=o.trys).length>0&&s[s.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){o.label=r[1];break}if(6===r[0]&&o.label<s[1]){o.label=s[1],s=r;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(r);break}s[2]&&o.ops.pop(),o.trys.pop();continue}r=t.call(e,o)}catch(e){r=[6,e],n=0}finally{i=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}}(this,function(e){switch(e.label){case 0:return this.initialized?[3,2]:(ve.debug("need to wait for the Google SDK loaded"),[4,be]);case 1:e.sent(),this.initialized=!0,ve.debug("finish waiting"),e.label=2;case 2:return[2,this._refreshGoogleTokenImpl()]}})},new((i=void 0)||(i=Promise))(function(s,r){function o(e){try{l(n.next(e))}catch(e){r(e)}}function a(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())});var e,t,i,n},e.prototype._refreshGoogleTokenImpl=function(){var e=null;return(0,ce.gy)().isBrowser&&(e=window.gapi&&window.gapi.auth2?window.gapi.auth2:null),e?new Promise(function(t,i){e.getAuthInstance().then(function(e){e||(ve.debug("google Auth undefined"),i(new me("google Auth undefined")));var n=e.currentUser.get();n.isSignedIn()?(ve.debug("refreshing the google access token"),n.reloadAuthResponse().then(function(e){var i=e.id_token,n=e.expires_at;t({token:i,expires_at:n})}).catch(function(e){e&&"network_error"===e.error?i("Network error reloading google auth response"):i(new me("Failed to reload google auth response"))})):i(new me("User is not signed in with Google"))}).catch(function(e){ve.debug("Failed to refresh google token",e),i(new me("Failed to refresh google token"))})}):(ve.debug("no gapi auth2 available"),Promise.reject("no gapi auth2 available"))},e}(),we=new ae.C("CognitoCredentials"),Se=new Promise(function(e,t){return(0,ce.gy)().isBrowser?window.FB?(we.debug("FB SDK already loaded"),e()):void setTimeout(function(){return e()},2e3):(we.debug("not in the browser, directly resolved"),e())}),xe=function(){function e(){this.initialized=!1,this.refreshFacebookToken=this.refreshFacebookToken.bind(this),this._refreshFacebookTokenImpl=this._refreshFacebookTokenImpl.bind(this)}return e.prototype.refreshFacebookToken=function(){return e=this,t=void 0,n=function(){return function(e,t){var i,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,n&&(s=2&r[0]?n.return:r[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,r[1])).done)return s;switch(n=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,n=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!((s=(s=o.trys).length>0&&s[s.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){o.label=r[1];break}if(6===r[0]&&o.label<s[1]){o.label=s[1],s=r;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(r);break}s[2]&&o.ops.pop(),o.trys.pop();continue}r=t.call(e,o)}catch(e){r=[6,e],n=0}finally{i=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}}(this,function(e){switch(e.label){case 0:return this.initialized?[3,2]:(we.debug("need to wait for the Facebook SDK loaded"),[4,Se]);case 1:e.sent(),this.initialized=!0,we.debug("finish waiting"),e.label=2;case 2:return[2,this._refreshFacebookTokenImpl()]}})},new((i=void 0)||(i=Promise))(function(s,r){function o(e){try{l(n.next(e))}catch(e){r(e)}}function a(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())});var e,t,i,n},e.prototype._refreshFacebookTokenImpl=function(){var e=null;if((0,ce.gy)().isBrowser&&(e=window.FB),!e){var t="no fb sdk available";return we.debug(t),Promise.reject(new me(t))}return new Promise(function(t,i){e.getLoginStatus(function(e){if(e&&e.authResponse){var n=e.authResponse,s=n.accessToken,r=1e3*n.expiresIn+(new Date).getTime();s||(o="the jwtToken is undefined",we.debug(o),i(new me(o))),t({token:s,expires_at:r})}else{var o="no response from facebook when refreshing the jwt token";we.debug(o),i(new me(o))}},{scope:"public_profile,email"})})},e}(),Ee=new Ce,Ae=new xe,Me=i(78953),Te=i(65927),De=i(65959);!function(e){e.AUTHENTICATED_ROLE="AuthenticatedRole",e.DENY="Deny"}(s||(s={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(r||(r={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(o||(o={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(a||(a={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(l||(l={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(c||(c={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(h||(h={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(u||(u={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(d||(d={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(p||(p={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(g||(g={})),function(e){e.ACCESS_DENIED="AccessDenied",e.INTERNAL_SERVER_ERROR="InternalServerError"}(f||(f={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(m||(m={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(y||(y={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(v||(v={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(b||(b={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(C||(C={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(w||(w={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(S||(S={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(x||(x={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(E||(E={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(A||(A={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(M||(M={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(T||(T={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(D||(D={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(I||(I={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(R||(R={})),function(e){e.CONTAINS="Contains",e.EQUALS="Equals",e.NOT_EQUAL="NotEqual",e.STARTS_WITH="StartsWith"}(k||(k={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(P||(P={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(_||(_={})),function(e){e.RULES="Rules",e.TOKEN="Token"}(L||(L={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(N||(N={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(O||(O={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(F||(F={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(G||(G={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(B||(B={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(V||(V={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(H||(H={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(U||(U={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(z||(z={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(W||(W={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(j||(j={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}($||($={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(K||(K={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(Y||(Y={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(q||(q={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(X||(X={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(Z||(Z={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(Q||(Q={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(J||(J={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(ee||(ee={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(te||(te={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(ie||(ie={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(ne||(ne={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(se||(se={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(re||(re={})),function(e){e.filterSensitiveLog=function(e){return(0,De.__assign)({},e)}}(oe||(oe={}));var Ie=i(59027),Re=function(e,t){return(0,De.__awaiter)(void 0,void 0,void 0,function(){var i,n,s,r,o,a,l,c,h,u,d,p,g,f,m;return(0,De.__generator)(this,function(y){switch(y.label){case 0:return n=[(0,De.__assign)({},e)],m={},[4,et(e.body,t)];case 1:switch(i=De.__assign.apply(void 0,n.concat([(m.body=y.sent(),m)])),r="UnknownError",r=tt(e,i.body)){case"ExternalServiceException":case"com.amazonaws.cognitoidentity#ExternalServiceException":return[3,2];case"InternalErrorException":case"com.amazonaws.cognitoidentity#InternalErrorException":return[3,4];case"InvalidIdentityPoolConfigurationException":case"com.amazonaws.cognitoidentity#InvalidIdentityPoolConfigurationException":return[3,6];case"InvalidParameterException":case"com.amazonaws.cognitoidentity#InvalidParameterException":return[3,8];case"NotAuthorizedException":case"com.amazonaws.cognitoidentity#NotAuthorizedException":return[3,10];case"ResourceConflictException":case"com.amazonaws.cognitoidentity#ResourceConflictException":return[3,12];case"ResourceNotFoundException":case"com.amazonaws.cognitoidentity#ResourceNotFoundException":return[3,14];case"TooManyRequestsException":case"com.amazonaws.cognitoidentity#TooManyRequestsException":return[3,16]}return[3,18];case 2:return o=[{}],[4,Pe(i,t)];case 3:return s=De.__assign.apply(void 0,[De.__assign.apply(void 0,o.concat([y.sent()])),{name:r,$metadata:Qe(e)}]),[3,19];case 4:return a=[{}],[4,_e(i,t)];case 5:return s=De.__assign.apply(void 0,[De.__assign.apply(void 0,a.concat([y.sent()])),{name:r,$metadata:Qe(e)}]),[3,19];case 6:return l=[{}],[4,Le(i,t)];case 7:return s=De.__assign.apply(void 0,[De.__assign.apply(void 0,l.concat([y.sent()])),{name:r,$metadata:Qe(e)}]),[3,19];case 8:return c=[{}],[4,Ne(i,t)];case 9:return s=De.__assign.apply(void 0,[De.__assign.apply(void 0,c.concat([y.sent()])),{name:r,$metadata:Qe(e)}]),[3,19];case 10:return h=[{}],[4,Fe(i,t)];case 11:return s=De.__assign.apply(void 0,[De.__assign.apply(void 0,h.concat([y.sent()])),{name:r,$metadata:Qe(e)}]),[3,19];case 12:return u=[{}],[4,Ge(i,t)];case 13:return s=De.__assign.apply(void 0,[De.__assign.apply(void 0,u.concat([y.sent()])),{name:r,$metadata:Qe(e)}]),[3,19];case 14:return d=[{}],[4,Be(i,t)];case 15:return s=De.__assign.apply(void 0,[De.__assign.apply(void 0,d.concat([y.sent()])),{name:r,$metadata:Qe(e)}]),[3,19];case 16:return p=[{}],[4,Ve(i,t)];case 17:return s=De.__assign.apply(void 0,[De.__assign.apply(void 0,p.concat([y.sent()])),{name:r,$metadata:Qe(e)}]),[3,19];case 18:g=i.body,r=g.code||g.Code||r,s=(0,De.__assign)((0,De.__assign)({},g),{name:""+r,message:g.message||g.Message||r,$fault:"client",$metadata:Qe(e)}),y.label=19;case 19:return f=s.message||s.Message||r,s.message=f,delete s.Message,[2,Promise.reject(Object.assign(new Error(f),s))]}})})},ke=function(e,t){return(0,De.__awaiter)(void 0,void 0,void 0,function(){var i,n,s,r,o,a,l,c,h,u,d,p,g,f,m;return(0,De.__generator)(this,function(y){switch(y.label){case 0:return n=[(0,De.__assign)({},e)],m={},[4,et(e.body,t)];case 1:switch(i=De.__assign.apply(void 0,n.concat([(m.body=y.sent(),m)])),r="UnknownError",r=tt(e,i.body)){case"ExternalServiceException":case"com.amazonaws.cognitoidentity#ExternalServiceException":return[3,2];case"InternalErrorException":case"com.amazonaws.cognitoidentity#InternalErrorException":return[3,4];case"InvalidParameterException":case"com.amazonaws.cognitoidentity#InvalidParameterException":return[3,6];case"LimitExceededException":case"com.amazonaws.cognitoidentity#LimitExceededException":return[3,8];case"NotAuthorizedException":case"com.amazonaws.cognitoidentity#NotAuthorizedException":return[3,10];case"ResourceConflictException":case"com.amazonaws.cognitoidentity#ResourceConflictException":return[3,12];case"ResourceNotFoundException":case"com.amazonaws.cognitoidentity#ResourceNotFoundException":return[3,14];case"TooManyRequestsException":case"com.amazonaws.cognitoidentity#TooManyRequestsException":return[3,16]}return[3,18];case 2:return o=[{}],[4,Pe(i,t)];case 3:return s=De.__assign.apply(void 0,[De.__assign.apply(void 0,o.concat([y.sent()])),{name:r,$metadata:Qe(e)}]),[3,19];case 4:return a=[{}],[4,_e(i,t)];case 5:return s=De.__assign.apply(void 0,[De.__assign.apply(void 0,a.concat([y.sent()])),{name:r,$metadata:Qe(e)}]),[3,19];case 6:return l=[{}],[4,Ne(i,t)];case 7:return s=De.__assign.apply(void 0,[De.__assign.apply(void 0,l.concat([y.sent()])),{name:r,$metadata:Qe(e)}]),[3,19];case 8:return c=[{}],[4,Oe(i,t)];case 9:return s=De.__assign.apply(void 0,[De.__assign.apply(void 0,c.concat([y.sent()])),{name:r,$metadata:Qe(e)}]),[3,19];case 10:return h=[{}],[4,Fe(i,t)];case 11:return s=De.__assign.apply(void 0,[De.__assign.apply(void 0,h.concat([y.sent()])),{name:r,$metadata:Qe(e)}]),[3,19];case 12:return u=[{}],[4,Ge(i,t)];case 13:return s=De.__assign.apply(void 0,[De.__assign.apply(void 0,u.concat([y.sent()])),{name:r,$metadata:Qe(e)}]),[3,19];case 14:return d=[{}],[4,Be(i,t)];case 15:return s=De.__assign.apply(void 0,[De.__assign.apply(void 0,d.concat([y.sent()])),{name:r,$metadata:Qe(e)}]),[3,19];case 16:return p=[{}],[4,Ve(i,t)];case 17:return s=De.__assign.apply(void 0,[De.__assign.apply(void 0,p.concat([y.sent()])),{name:r,$metadata:Qe(e)}]),[3,19];case 18:g=i.body,r=g.code||g.Code||r,s=(0,De.__assign)((0,De.__assign)({},g),{name:""+r,message:g.message||g.Message||r,$fault:"client",$metadata:Qe(e)}),y.label=19;case 19:return f=s.message||s.Message||r,s.message=f,delete s.Message,[2,Promise.reject(Object.assign(new Error(f),s))]}})})},Pe=function(e,t){return(0,De.__awaiter)(void 0,void 0,void 0,function(){var i,n;return(0,De.__generator)(this,function(s){return i=e.body,n=ze(i,t),[2,(0,De.__assign)({name:"ExternalServiceException",$fault:"client",$metadata:Qe(e)},n)]})})},_e=function(e,t){return(0,De.__awaiter)(void 0,void 0,void 0,function(){var i,n;return(0,De.__generator)(this,function(s){return i=e.body,n=We(i,t),[2,(0,De.__assign)({name:"InternalErrorException",$fault:"server",$metadata:Qe(e)},n)]})})},Le=function(e,t){return(0,De.__awaiter)(void 0,void 0,void 0,function(){var i,n;return(0,De.__generator)(this,function(s){return i=e.body,n=je(i,t),[2,(0,De.__assign)({name:"InvalidIdentityPoolConfigurationException",$fault:"client",$metadata:Qe(e)},n)]})})},Ne=function(e,t){return(0,De.__awaiter)(void 0,void 0,void 0,function(){var i,n;return(0,De.__generator)(this,function(s){return i=e.body,n=$e(i,t),[2,(0,De.__assign)({name:"InvalidParameterException",$fault:"client",$metadata:Qe(e)},n)]})})},Oe=function(e,t){return(0,De.__awaiter)(void 0,void 0,void 0,function(){var i,n;return(0,De.__generator)(this,function(s){return i=e.body,n=Ke(i,t),[2,(0,De.__assign)({name:"LimitExceededException",$fault:"client",$metadata:Qe(e)},n)]})})},Fe=function(e,t){return(0,De.__awaiter)(void 0,void 0,void 0,function(){var i,n;return(0,De.__generator)(this,function(s){return i=e.body,n=Ye(i,t),[2,(0,De.__assign)({name:"NotAuthorizedException",$fault:"client",$metadata:Qe(e)},n)]})})},Ge=function(e,t){return(0,De.__awaiter)(void 0,void 0,void 0,function(){var i,n;return(0,De.__generator)(this,function(s){return i=e.body,n=qe(i,t),[2,(0,De.__assign)({name:"ResourceConflictException",$fault:"client",$metadata:Qe(e)},n)]})})},Be=function(e,t){return(0,De.__awaiter)(void 0,void 0,void 0,function(){var i,n;return(0,De.__generator)(this,function(s){return i=e.body,n=Xe(i,t),[2,(0,De.__assign)({name:"ResourceNotFoundException",$fault:"client",$metadata:Qe(e)},n)]})})},Ve=function(e,t){return(0,De.__awaiter)(void 0,void 0,void 0,function(){var i,n;return(0,De.__generator)(this,function(s){return i=e.body,n=Ze(i,t),[2,(0,De.__assign)({name:"TooManyRequestsException",$fault:"client",$metadata:Qe(e)},n)]})})},He=function(e,t){return Object.entries(e).reduce(function(e,t){var i,n=(0,De.__read)(t,2),s=n[0],r=n[1];return null===r?e:(0,De.__assign)((0,De.__assign)({},e),((i={})[s]=r,i))},{})},Ue=function(e,t){return{AccessKeyId:void 0!==e.AccessKeyId&&null!==e.AccessKeyId?e.AccessKeyId:void 0,Expiration:void 0!==e.Expiration&&null!==e.Expiration?new Date(Math.round(1e3*e.Expiration)):void 0,SecretKey:void 0!==e.SecretKey&&null!==e.SecretKey?e.SecretKey:void 0,SessionToken:void 0!==e.SessionToken&&null!==e.SessionToken?e.SessionToken:void 0}},ze=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},We=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},je=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},$e=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Ke=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Ye=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},qe=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Xe=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Ze=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Qe=function(e){var t;return{httpStatusCode:e.statusCode,requestId:null!==(t=e.headers["x-amzn-requestid"])&&void 0!==t?t:e.headers["x-amzn-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}},Je=function(e,t,i,n,s){return(0,De.__awaiter)(void 0,void 0,void 0,function(){var r,o,a,l,c,h;return(0,De.__generator)(this,function(u){switch(u.label){case 0:return[4,e.endpoint()];case 1:return r=u.sent(),o=r.hostname,a=r.protocol,l=void 0===a?"https":a,c=r.port,h={protocol:l,hostname:o,port:c,method:"POST",path:i,headers:t},void 0!==n&&(h.hostname=n),void 0!==s&&(h.body=s),[2,new Ie.Kd(h)]}})})},et=function(e,t){return function(e,t){return function(e,t){return void 0===e&&(e=new Uint8Array),e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array)}(e,t).then(function(e){return t.utf8Encoder(e)})}(e,t).then(function(e){return e.length?JSON.parse(e):{}})},tt=function(e,t){var i,n=function(e){var t=e;return t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},s=(i=e.headers,Object.keys(i).find(function(e){return e.toLowerCase()==="x-amzn-errortype".toLowerCase()}));return void 0!==s?n(e.headers[s]):void 0!==t.code?n(t.code):void 0!==t.__type?n(t.__type):""},it=i(74052),nt=i(11538),st=function(e){function t(t){var i=e.call(this)||this;return i.input=t,i}return(0,De.__extends)(t,e),t.prototype.resolveMiddleware=function(e,t,i){this.middlewareStack.use((0,it.TM)(t,this.serialize,this.deserialize));var n=e.concat(this.middlewareStack),s={logger:t.logger,clientName:"CognitoIdentityClient",commandName:"GetCredentialsForIdentityCommand",inputFilterSensitiveLog:E.filterSensitiveLog,outputFilterSensitiveLog:M.filterSensitiveLog},r=t.requestHandler;return n.resolve(function(e){return r.handle(e.request,i||{})},s)},t.prototype.serialize=function(e,t){return function(e,t){return(0,De.__awaiter)(void 0,void 0,void 0,function(){var i,n;return(0,De.__generator)(this,function(s){return i={"content-type":"application/x-amz-json-1.1","x-amz-target":"AWSCognitoIdentityService.GetCredentialsForIdentity"},n=JSON.stringify(function(e,t){return(0,De.__assign)((0,De.__assign)((0,De.__assign)({},void 0!==e.CustomRoleArn&&null!==e.CustomRoleArn&&{CustomRoleArn:e.CustomRoleArn}),void 0!==e.IdentityId&&null!==e.IdentityId&&{IdentityId:e.IdentityId}),void 0!==e.Logins&&null!==e.Logins&&{Logins:He(e.Logins,t)})}(e,t)),[2,Je(t,i,"/",void 0,n)]})})}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return(0,De.__awaiter)(void 0,void 0,void 0,function(){var i,n,s;return(0,De.__generator)(this,function(r){switch(r.label){case 0:return e.statusCode>=300?[2,Re(e,t)]:[4,et(e.body,t)];case 1:return i=r.sent(),n=function(e){return{Credentials:void 0!==e.Credentials&&null!==e.Credentials?Ue(e.Credentials):void 0,IdentityId:void 0!==e.IdentityId&&null!==e.IdentityId?e.IdentityId:void 0}}(i),s=(0,De.__assign)({$metadata:Qe(e)},n),[2,Promise.resolve(s)]}})})}(e,t)},t}(nt.uB),rt=function(e){function t(t,i){void 0===i&&(i=!0);var n=e.call(this,t)||this;return n.tryNextLink=i,n}return(0,Te.__extends)(t,e),t}(Error);function ot(e){return Promise.all(Object.keys(e).reduce(function(t,i){var n=e[i];return"string"==typeof n?t.push([i,n]):t.push(n().then(function(e){return[i,e]})),t},[])).then(function(e){return e.reduce(function(e,t){var i=(0,Te.__read)(t,2),n=i[0],s=i[1];return e[n]=s,e},{})})}function at(e){var t=this;return function(){return(0,Te.__awaiter)(t,void 0,void 0,function(){var t,i,n,s,r,o,a,l,c,h,u,d,p;return(0,Te.__generator)(this,function(g){switch(g.label){case 0:return h=(c=e.client).send,u=st.bind,p={CustomRoleArn:e.customRoleArn,IdentityId:e.identityId},e.logins?[4,ot(e.logins)]:[3,2];case 1:return d=g.sent(),[3,3];case 2:d=void 0,g.label=3;case 3:return[4,h.apply(c,[new(u.apply(st,[void 0,(p.Logins=d,p)]))])];case 4:return t=g.sent().Credentials,i=void 0===t?function(){throw new rt("Response from Amazon Cognito contained no credentials")}():t,n=i.AccessKeyId,s=void 0===n?function(){throw new rt("Response from Amazon Cognito contained no access key ID")}():n,r=i.Expiration,o=i.SecretKey,a=void 0===o?function(){throw new rt("Response from Amazon Cognito contained no secret key")}():o,l=i.SessionToken,[2,{identityId:e.identityId,accessKeyId:s,secretAccessKey:a,sessionToken:l,expiration:r}]}})})}}var lt=function(e){function t(t){var i=e.call(this)||this;return i.input=t,i}return(0,De.__extends)(t,e),t.prototype.resolveMiddleware=function(e,t,i){this.middlewareStack.use((0,it.TM)(t,this.serialize,this.deserialize));var n=e.concat(this.middlewareStack),s={logger:t.logger,clientName:"CognitoIdentityClient",commandName:"GetIdCommand",inputFilterSensitiveLog:D.filterSensitiveLog,outputFilterSensitiveLog:I.filterSensitiveLog},r=t.requestHandler;return n.resolve(function(e){return r.handle(e.request,i||{})},s)},t.prototype.serialize=function(e,t){return function(e,t){return(0,De.__awaiter)(void 0,void 0,void 0,function(){var i,n;return(0,De.__generator)(this,function(s){return i={"content-type":"application/x-amz-json-1.1","x-amz-target":"AWSCognitoIdentityService.GetId"},n=JSON.stringify(function(e,t){return(0,De.__assign)((0,De.__assign)((0,De.__assign)({},void 0!==e.AccountId&&null!==e.AccountId&&{AccountId:e.AccountId}),void 0!==e.IdentityPoolId&&null!==e.IdentityPoolId&&{IdentityPoolId:e.IdentityPoolId}),void 0!==e.Logins&&null!==e.Logins&&{Logins:He(e.Logins,t)})}(e,t)),[2,Je(t,i,"/",void 0,n)]})})}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return(0,De.__awaiter)(void 0,void 0,void 0,function(){var i,n,s;return(0,De.__generator)(this,function(r){switch(r.label){case 0:return e.statusCode>=300?[2,ke(e,t)]:[4,et(e.body,t)];case 1:return i=r.sent(),n=function(e){return{IdentityId:void 0!==e.IdentityId&&null!==e.IdentityId?e.IdentityId:void 0}}(i),s=(0,De.__assign)({$metadata:Qe(e)},n),[2,Promise.resolve(s)]}})})}(e,t)},t}(nt.uB),ct="IdentityIds",ht=function(){function e(e){void 0===e&&(e="aws:cognito-identity-ids"),this.dbName=e}return e.prototype.getItem=function(e){return this.withObjectStore("readonly",function(t){var i=t.get(e);return new Promise(function(e){i.onerror=function(){return e(null)},i.onsuccess=function(){return e(i.result?i.result.value:null)}})}).catch(function(){return null})},e.prototype.removeItem=function(e){return this.withObjectStore("readwrite",function(t){var i=t.delete(e);return new Promise(function(e,t){i.onerror=function(){return t(i.error)},i.onsuccess=function(){return e()}})})},e.prototype.setItem=function(e,t){return this.withObjectStore("readwrite",function(i){var n=i.put({id:e,value:t});return new Promise(function(e,t){n.onerror=function(){return t(n.error)},n.onsuccess=function(){return e()}})})},e.prototype.getDb=function(){var e=self.indexedDB.open(this.dbName,1);return new Promise(function(t,i){e.onsuccess=function(){t(e.result)},e.onerror=function(){i(e.error)},e.onblocked=function(){i(new Error("Unable to access DB"))},e.onupgradeneeded=function(){var t=e.result;t.onerror=function(){i(new Error("Failed to create object store"))},t.createObjectStore(ct,{keyPath:"id"})}})},e.prototype.withObjectStore=function(e,t){return this.getDb().then(function(i){var n=i.transaction(ct,e);return n.oncomplete=function(){return i.close()},new Promise(function(e,i){n.onerror=function(){return i(n.error)},e(t(n.objectStore(ct)))}).catch(function(e){throw i.close(),e})})},e}(),ut=new(function(){function e(e){void 0===e&&(e={}),this.store=e}return e.prototype.getItem=function(e){return e in this.store?this.store[e]:null},e.prototype.removeItem=function(e){delete this.store[e]},e.prototype.setItem=function(e,t){this.store[e]=t},e}());var dt=i(54218),pt=i(22292),gt=i(10078),ft=i(16307),mt=i(68380),yt=i(93972),vt=i(39448),bt=i(31643),Ct="cognito-identity.{region}.amazonaws.com",wt=new Set(["af-south-1","ap-east-1","ap-northeast-1","ap-northeast-2","ap-south-1","ap-southeast-1","ap-southeast-2","ca-central-1","eu-central-1","eu-north-1","eu-south-1","eu-west-1","eu-west-2","eu-west-3","me-south-1","sa-east-1","us-east-1","us-east-2","us-west-1","us-west-2"]),St=new Set(["cn-north-1","cn-northwest-1"]),xt=new Set(["us-iso-east-1"]),Et=new Set(["us-isob-east-1"]),At=new Set(["us-gov-east-1","us-gov-west-1"]),Mt={apiVersion:"2014-06-30",disableHostPrefix:!1,logger:{},regionInfoProvider:function(e,t){var i=void 0;switch(e){case"ap-northeast-1":i={hostname:"cognito-identity.ap-northeast-1.amazonaws.com",partition:"aws"};break;case"ap-northeast-2":i={hostname:"cognito-identity.ap-northeast-2.amazonaws.com",partition:"aws"};break;case"ap-south-1":i={hostname:"cognito-identity.ap-south-1.amazonaws.com",partition:"aws"};break;case"ap-southeast-1":i={hostname:"cognito-identity.ap-southeast-1.amazonaws.com",partition:"aws"};break;case"ap-southeast-2":i={hostname:"cognito-identity.ap-southeast-2.amazonaws.com",partition:"aws"};break;case"ca-central-1":i={hostname:"cognito-identity.ca-central-1.amazonaws.com",partition:"aws"};break;case"cn-north-1":i={hostname:"cognito-identity.cn-north-1.amazonaws.com.cn",partition:"aws-cn"};break;case"eu-central-1":i={hostname:"cognito-identity.eu-central-1.amazonaws.com",partition:"aws"};break;case"eu-north-1":i={hostname:"cognito-identity.eu-north-1.amazonaws.com",partition:"aws"};break;case"eu-west-1":i={hostname:"cognito-identity.eu-west-1.amazonaws.com",partition:"aws"};break;case"eu-west-2":i={hostname:"cognito-identity.eu-west-2.amazonaws.com",partition:"aws"};break;case"eu-west-3":i={hostname:"cognito-identity.eu-west-3.amazonaws.com",partition:"aws"};break;case"fips-us-east-1":i={hostname:"cognito-identity-fips.us-east-1.amazonaws.com",partition:"aws",signingRegion:"us-east-1"};break;case"fips-us-east-2":i={hostname:"cognito-identity-fips.us-east-2.amazonaws.com",partition:"aws",signingRegion:"us-east-2"};break;case"fips-us-gov-west-1":i={hostname:"cognito-identity-fips.us-gov-west-1.amazonaws.com",partition:"aws-us-gov",signingRegion:"us-gov-west-1"};break;case"fips-us-west-2":i={hostname:"cognito-identity-fips.us-west-2.amazonaws.com",partition:"aws",signingRegion:"us-west-2"};break;case"sa-east-1":i={hostname:"cognito-identity.sa-east-1.amazonaws.com",partition:"aws"};break;case"us-east-1":i={hostname:"cognito-identity.us-east-1.amazonaws.com",partition:"aws"};break;case"us-east-2":i={hostname:"cognito-identity.us-east-2.amazonaws.com",partition:"aws"};break;case"us-gov-west-1":i={hostname:"cognito-identity.us-gov-west-1.amazonaws.com",partition:"aws-us-gov"};break;case"us-west-1":i={hostname:"cognito-identity.us-west-1.amazonaws.com",partition:"aws"};break;case"us-west-2":i={hostname:"cognito-identity.us-west-2.amazonaws.com",partition:"aws"};break;default:wt.has(e)&&(i={hostname:Ct.replace("{region}",e),partition:"aws"}),St.has(e)&&(i={hostname:"cognito-identity.{region}.amazonaws.com.cn".replace("{region}",e),partition:"aws-cn"}),xt.has(e)&&(i={hostname:"cognito-identity.{region}.c2s.ic.gov".replace("{region}",e),partition:"aws-iso"}),Et.has(e)&&(i={hostname:"cognito-identity.{region}.sc2s.sgov.gov".replace("{region}",e),partition:"aws-iso-b"}),At.has(e)&&(i={hostname:"cognito-identity.{region}.amazonaws.com".replace("{region}",e),partition:"aws-us-gov"}),void 0===i&&(i={hostname:Ct.replace("{region}",e),partition:"aws"})}return Promise.resolve((0,De.__assign)({signingService:"cognito-identity"},i))},serviceId:"Cognito Identity",urlParser:i(2049).D},Tt=(0,De.__assign)((0,De.__assign)({},Mt),{runtime:"browser",base64Decoder:mt.E,base64Encoder:mt.n,bodyLengthChecker:yt.n,credentialDefaultProvider:function(e){return function(){return Promise.reject(new Error("Credential is missing"))}},defaultUserAgentProvider:(0,vt.m)({serviceId:Mt.serviceId,clientVersion:"3.6.1"}),maxAttempts:ft.Gz,region:(0,gt.B)("Region is missing"),requestHandler:new pt.N,sha256:dt.Sha256,streamCollector:pt.k,utf8Decoder:bt.fromUtf8,utf8Encoder:bt.toUtf8}),Dt=i(85775),It=i(23788),Rt=i(14188),kt=i(64996),Pt=i(88428),_t=i(44625),Lt=function(e){function t(t){var i=this,n=(0,De.__assign)((0,De.__assign)({},Tt),t),s=(0,Dt.TD)(n),r=(0,Dt.vJ)(s),o=(0,Pt.k9)(r),a=(0,ft.$z)(o),l=(0,Rt.OV)(a),c=(0,_t.Dc)(l);return(i=e.call(this,c)||this).config=c,i.middlewareStack.use((0,ft.ey)(i.config)),i.middlewareStack.use((0,It.vK)(i.config)),i.middlewareStack.use((0,Rt.TC)(i.config)),i.middlewareStack.use((0,kt.Y7)(i.config)),i.middlewareStack.use((0,_t.sM)(i.config)),i}return(0,De.__extends)(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this)},t}(nt.Kj),Nt=i(41547),Ot=function(){return Ot=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var s in t=arguments[i])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},Ot.apply(this,arguments)};function Ft(e){var t=new Lt({region:e.region,customUserAgent:(0,Nt.fE)()});return t.middlewareStack.add(function(e,t){return function(t){return e(function(e){return Ot(Ot({},e),{request:Ot(Ot({},e.request),{headers:Ot(Ot({},e.request.headers),{"cache-control":"no-store"})})})}(t))}},{step:"build",name:"cacheControlMiddleWare"}),t}var Gt=function(){return Gt=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var s in t=arguments[i])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},Gt.apply(this,arguments)},Bt=function(e,t,i,n){return new(i||(i=Promise))(function(s,r){function o(e){try{l(n.next(e))}catch(e){r(e)}}function a(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})},Vt=function(e,t){var i,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,n&&(s=2&r[0]?n.return:r[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,r[1])).done)return s;switch(n=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,n=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!((s=(s=o.trys).length>0&&s[s.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){o.label=r[1];break}if(6===r[0]&&o.label<s[1]){o.label=s[1],s=r;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(r);break}s[2]&&o.ops.pop(),o.trys.pop();continue}r=t.call(e,o)}catch(e){r=[6,e],n=0}finally{i=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}},Ht=new ae.C("Credentials"),Ut=new(function(){function e(e){this._gettingCredPromise=null,this._refreshHandlers={},this.Auth=void 0,this.configure(e),this._refreshHandlers.google=Ee.refreshGoogleToken,this._refreshHandlers.facebook=Ae.refreshFacebookToken}return e.prototype.getModuleName=function(){return"Credentials"},e.prototype.getCredSource=function(){return this._credentials_source},e.prototype.configure=function(e){if(!e)return this._config||{};this._config=Object.assign({},this._config,e);var t=this._config.refreshHandlers;return t&&(this._refreshHandlers=Gt(Gt({},this._refreshHandlers),t)),this._storage=this._config.storage,this._storage||(this._storage=(new le.i1).getStorage()),this._storageSync=Promise.resolve(),"function"==typeof this._storage.sync&&(this._storageSync=this._storage.sync()),this._config},e.prototype.get=function(){return Ht.debug("getting credentials"),this._pickupCredentials()},e.prototype._getCognitoIdentityIdStorageKey=function(e){return"CognitoIdentityId-"+e},e.prototype._pickupCredentials=function(){return Ht.debug("picking up credentials"),this._gettingCredPromise&&this._gettingCredPromise.isPending()?Ht.debug("getting old cred promise"):(Ht.debug("getting new cred promise"),this._gettingCredPromise=(0,ce.VN)(this._keepAlive())),this._gettingCredPromise},e.prototype._keepAlive=function(){return Bt(this,void 0,void 0,function(){var e,t,i,n,s,r,o;return Vt(this,function(a){switch(a.label){case 0:if(Ht.debug("checking if credentials exists and not expired"),(e=this._credentials)&&!this._isExpired(e)&&!this._isPastTTL())return Ht.debug("credentials not changed and not expired, directly return"),[2,Promise.resolve(e)];if(Ht.debug("need to get a new credential or refresh the existing one"),t=this.Auth,!(i=void 0===t?Me.HA.Auth:t)||"function"!=typeof i.currentUserCredentials)return[2,Promise.reject("No Auth module registered in Amplify")];if(this._isExpired(e)||!this._isPastTTL())return[3,6];Ht.debug("ttl has passed but token is not yet expired"),a.label=1;case 1:return a.trys.push([1,5,,6]),[4,i.currentUserPoolUser()];case 2:return n=a.sent(),[4,i.currentSession()];case 3:return s=a.sent(),r=s.refreshToken,[4,new Promise(function(e,t){n.refreshSession(r,function(i,n){return i?t(i):e(n)})})];case 4:return a.sent(),[3,6];case 5:return o=a.sent(),Ht.debug("Error attempting to refreshing the session",o),[3,6];case 6:return[2,i.currentUserCredentials()]}})})},e.prototype.refreshFederatedToken=function(e){Ht.debug("Getting federated credentials");var t=e.provider,i=e.user,n=e.token,s=e.identity_id,r=e.expires_at;r=1970===new Date(r).getFullYear()?1e3*r:r;var o=this;return Ht.debug("checking if federated jwt token expired"),r>(new Date).getTime()?(Ht.debug("token not expired"),this._setCredentialsFromFederation({provider:t,token:n,user:i,identity_id:s,expires_at:r})):o._refreshHandlers[t]&&"function"==typeof o._refreshHandlers[t]?(Ht.debug("getting refreshed jwt token from federation provider"),this._providerRefreshWithRetry({refreshHandler:o._refreshHandlers[t],provider:t,user:i})):(Ht.debug("no refresh handler for provider:",t),this.clear(),Promise.reject("no refresh handler for provider"))},e.prototype._providerRefreshWithRetry=function(e){var t,i,n,s,r=this,o=e.refreshHandler,a=e.provider,l=e.user;return(t=o,i=[],n=1e4,void 0===n&&(n=ye),function(e,t,i,n){return ue(this,void 0,void 0,function(){var s=this;return de(this,function(r){if("function"!=typeof e)throw Error("functionToRetry must be a function");return[2,new Promise(function(r,o){return ue(s,void 0,void 0,function(){var s,a,l,c,h,u,d;return de(this,function(p){switch(p.label){case 0:s=0,a=!1,c=function(){},n&&n.then(function(){a=!0,clearTimeout(l),c()}),u=function(){var n,u,d,p;return de(this,function(g){switch(g.label){case 0:s++,fe.debug(e.name+" attempt #"+s+" with this vars: "+JSON.stringify(t)),g.label=1;case 1:return g.trys.push([1,3,,7]),n={},u=r,[4,e.apply(void 0,ge(t))];case 2:return[2,(n.value=u.apply(void 0,[g.sent()]),n)];case 3:return d=g.sent(),h=d,fe.debug("error on "+e.name,d),(f=d)&&f.nonRetryable?(fe.debug(e.name+" non retryable error",d),[2,{value:o(d)}]):(p=i(s,t,d),fe.debug(e.name+" retrying in "+p+" ms"),!1===p||a?[2,{value:o(d)}]:[3,4]);case 4:return[4,new Promise(function(e){c=e,l=setTimeout(c,p)})];case 5:g.sent(),g.label=6;case 6:return[3,7];case 7:return[2]}var f})},p.label=1;case 1:return a?[3,3]:[5,u()];case 2:return"object"==typeof(d=p.sent())?[2,d.value]:[3,1];case 3:return o(h),[2]}})})})]})})}(t,i,function(e){return void 0===e&&(e=ye),function(t){var i=100*Math.pow(2,t)+100*Math.random();return!(i>e)&&i}}(n),s)).then(function(e){return Ht.debug("refresh federated token sucessfully",e),r._setCredentialsFromFederation({provider:a,token:e.token,user:l,identity_id:e.identity_id,expires_at:e.expires_at})}).catch(function(e){return"string"==typeof e&&0===e.toLowerCase().lastIndexOf("network error",e.length)||r.clear(),Ht.debug("refresh federated token failed",e),Promise.reject("refreshing federation token failed: "+e)})},e.prototype._isExpired=function(e){if(!e)return Ht.debug("no credentials for expiration check"),!0;Ht.debug("are these credentials expired?",e);var t=Date.now();return e.expiration.getTime()<=t},e.prototype._isPastTTL=function(){return this._nextCredentialsRefresh<=Date.now()},e.prototype._setCredentialsForGuest=function(){return Bt(this,void 0,void 0,function(){var e,t,i,n,s,r,o,a,l=this;return Vt(this,function(c){switch(c.label){case 0:return Ht.debug("setting credentials for guest"),e=this._config,t=e.identityPoolId,i=e.region,e.mandatorySignIn?[2,Promise.reject("cannot get guest credentials when mandatory signin enabled")]:t?i?(s=this,[4,this._getGuestIdentityId()]):(Ht.debug("region is not configured for getting the credentials"),[2,Promise.reject("region is not configured for getting the credentials")]):(Ht.debug("No Cognito Identity pool provided for unauthenticated access"),[2,Promise.reject("No Cognito Identity pool provided for unauthenticated access")]);case 1:return n=s._identityId=c.sent(),r=Ft({region:i}),o=void 0,n?o=at({identityId:n,client:r})():(a=function(){return Bt(l,void 0,void 0,function(){var e;return Vt(this,function(i){switch(i.label){case 0:return[4,r.send(new lt({IdentityPoolId:t}))];case 1:return e=i.sent().IdentityId,this._identityId=e,[2,at({client:r,identityId:e})()]}})})},o=a().catch(function(e){return Bt(l,void 0,void 0,function(){return Vt(this,function(t){throw e})})})),[2,this._loadCredentials(o,"guest",!1,null).then(function(e){return e}).catch(function(e){return Bt(l,void 0,void 0,function(){var i,s=this;return Vt(this,function(a){switch(a.label){case 0:return"ResourceNotFoundException"!==e.name||e.message!=="Identity '"+n+"' not found."?[3,2]:(Ht.debug("Failed to load guest credentials"),[4,this._removeGuestIdentityId()]);case 1:return a.sent(),i=function(){return Bt(s,void 0,void 0,function(){var e;return Vt(this,function(i){switch(i.label){case 0:return[4,r.send(new lt({IdentityPoolId:t}))];case 1:return e=i.sent().IdentityId,this._identityId=e,[2,at({client:r,identityId:e})()]}})})},o=i().catch(function(e){return Bt(s,void 0,void 0,function(){return Vt(this,function(t){throw e})})}),[2,this._loadCredentials(o,"guest",!1,null)];case 2:return[2,e]}})})})]}})})},e.prototype._setCredentialsFromFederation=function(e){var t=e.provider,i=e.token,n=e.identity_id,s={google:"accounts.google.com",facebook:"graph.facebook.com",amazon:"www.amazon.com",developer:"cognito-identity.amazonaws.com"}[t]||t;if(!s)return Promise.reject("You must specify a federated provider");var r={};r[s]=i;var o=this._config,a=o.identityPoolId,l=o.region;if(!a)return Ht.debug("No Cognito Federated Identity pool provided"),Promise.reject("No Cognito Federated Identity pool provided");if(!l)return Ht.debug("region is not configured for getting the credentials"),Promise.reject("region is not configured for getting the credentials");var c=Ft({region:l}),h=void 0;return h=n?at({identityId:n,logins:r,client:c})():function(e){var t=this,i=e.accountId,n=e.cache,s=void 0===n?"object"==typeof self&&self.indexedDB?new ht:"object"==typeof window&&window.localStorage?window.localStorage:ut:n,r=e.client,o=e.customRoleArn,a=e.identityPoolId,l=e.logins,c=e.userIdentifier,h=void 0===c?l&&0!==Object.keys(l).length?void 0:"ANONYMOUS":c,u=h?"aws:cognito-identity-credentials:"+a+":"+h:void 0,d=function(){return(0,Te.__awaiter)(t,void 0,void 0,function(){var e,t,n,c,h,p,g,f,m;return(0,Te.__generator)(this,function(y){switch(y.label){case 0:return(t=u)?[4,s.getItem(u)]:[3,2];case 1:t=y.sent(),y.label=2;case 2:return(e=t)?[3,7]:(p=(h=r).send,g=lt.bind,m={AccountId:i,IdentityPoolId:a},l?[4,ot(l)]:[3,4]);case 3:return f=y.sent(),[3,5];case 4:f=void 0,y.label=5;case 5:return[4,p.apply(h,[new(g.apply(lt,[void 0,(m.Logins=f,m)]))])];case 6:n=y.sent().IdentityId,c=void 0===n?function(){throw new rt("Response from Amazon Cognito contained no identity ID")}():n,e=c,u&&Promise.resolve(s.setItem(u,e)).catch(function(){}),y.label=7;case 7:return[2,(d=at({client:r,customRoleArn:o,logins:l,identityId:e}))()]}})})};return function(){return d().catch(function(e){return(0,Te.__awaiter)(t,void 0,void 0,function(){return(0,Te.__generator)(this,function(t){throw u&&Promise.resolve(s.removeItem(u)).catch(function(){}),e})})})}}({logins:r,identityPoolId:a,client:c})(),this._loadCredentials(h,"federated",!0,e)},e.prototype._setCredentialsFromSession=function(e){var t=this;Ht.debug("set credentials from session");var i=e.getIdToken().getJwtToken(),n=this._config,s=n.region,r=n.userPoolId,o=n.identityPoolId;if(!o)return Ht.debug("No Cognito Federated Identity pool provided"),Promise.reject("No Cognito Federated Identity pool provided");if(!s)return Ht.debug("region is not configured for getting the credentials"),Promise.reject("region is not configured for getting the credentials");var a={};a["cognito-idp."+s+".amazonaws.com/"+r]=i;var l=Ft({region:s}),c=Bt(t,void 0,void 0,function(){var e,t,i,n,s,r,c,h,u,d;return Vt(this,function(p){switch(p.label){case 0:return[4,this._getGuestIdentityId()];case 1:return(e=p.sent())?[3,3]:[4,l.send(new lt({IdentityPoolId:o,Logins:a}))];case 2:i=p.sent().IdentityId,t=i,p.label=3;case 3:return[4,l.send(new st({IdentityId:e||t,Logins:a}))];case 4:return n=p.sent(),s=n.Credentials,r=s.AccessKeyId,c=s.Expiration,h=s.SecretKey,u=s.SessionToken,d=n.IdentityId,this._identityId=d,e?(Ht.debug("The guest identity "+e+" has been successfully linked to the logins"),e===d&&Ht.debug("The guest identity "+e+" has become the primary identity"),[4,this._removeGuestIdentityId()]):[3,6];case 5:p.sent(),p.label=6;case 6:return[2,{accessKeyId:r,secretAccessKey:h,sessionToken:u,expiration:c,identityId:d}]}})}).catch(function(e){return Bt(t,void 0,void 0,function(){return Vt(this,function(t){throw e})})});return this._loadCredentials(c,"userPool",!0,null)},e.prototype._loadCredentials=function(e,t,i,n){var s=this,r=this;return new Promise(function(o,a){e.then(function(e){return Bt(s,void 0,void 0,function(){var s,a,l,c,h;return Vt(this,function(u){switch(u.label){case 0:if(Ht.debug("Load credentials successfully",e),this._identityId&&!e.identityId&&(e.identityId=this._identityId),r._credentials=e,r._credentials.authenticated=i,r._credentials_source=t,r._nextCredentialsRefresh=(new Date).getTime()+3e6,"federated"===t){s=Object.assign({id:this._credentials.identityId},n.user),a=n.provider,l=n.token,c=n.expires_at,h=n.identity_id;try{this._storage.setItem("aws-amplify-federatedInfo",JSON.stringify({provider:a,token:l,user:s,expires_at:c,identity_id:h}))}catch(e){Ht.debug("Failed to put federated info into auth storage",e)}}return"guest"!==t?[3,2]:[4,this._setGuestIdentityId(e.identityId)];case 1:u.sent(),u.label=2;case 2:return o(r._credentials),[2]}})})}).catch(function(t){if(t)return Ht.debug("Failed to load credentials",e),Ht.debug("Error loading credentials",t),void a(t)})})},e.prototype.set=function(e,t){return"session"===t?this._setCredentialsFromSession(e):"federation"===t?this._setCredentialsFromFederation(e):"guest"===t?this._setCredentialsForGuest():(Ht.debug("no source specified for setting credentials"),Promise.reject("invalid source"))},e.prototype.clear=function(){return Bt(this,void 0,void 0,function(){return Vt(this,function(e){return this._credentials=null,this._credentials_source=null,Ht.debug("removing aws-amplify-federatedInfo from storage"),this._storage.removeItem("aws-amplify-federatedInfo"),[2]})})},e.prototype._getGuestIdentityId=function(){return Bt(this,void 0,void 0,function(){var e,t;return Vt(this,function(i){switch(i.label){case 0:e=this._config.identityPoolId,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this._storageSync];case 2:return i.sent(),[2,this._storage.getItem(this._getCognitoIdentityIdStorageKey(e))];case 3:return t=i.sent(),Ht.debug("Failed to get the cached guest identityId",t),[3,4];case 4:return[2]}})})},e.prototype._setGuestIdentityId=function(e){return Bt(this,void 0,void 0,function(){var t,i;return Vt(this,function(n){switch(n.label){case 0:t=this._config.identityPoolId,n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this._storageSync];case 2:return n.sent(),this._storage.setItem(this._getCognitoIdentityIdStorageKey(t),e),[3,4];case 3:return i=n.sent(),Ht.debug("Failed to cache guest identityId",i),[3,4];case 4:return[2]}})})},e.prototype._removeGuestIdentityId=function(){return Bt(this,void 0,void 0,function(){var e;return Vt(this,function(t){return e=this._config.identityPoolId,Ht.debug("removing "+this._getCognitoIdentityIdStorageKey(e)+" from storage"),this._storage.removeItem(this._getCognitoIdentityIdStorageKey(e)),[2]})})},e.prototype.shear=function(e){return{accessKeyId:e.accessKeyId,sessionToken:e.sessionToken,secretAccessKey:e.secretAccessKey,identityId:e.identityId,authenticated:e.authenticated}},e}())(null);Me.HA.register(Ut)},51718(e,t,i){"use strict";i.d(t,{YZ:()=>c});var n=i(15567),s=function(){return s=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var s in t=arguments[i])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},s.apply(this,arguments)},r=function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,s,r=i.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=r.next()).done;)o.push(n.value)}catch(e){s={error:e}}finally{try{n&&!n.done&&(i=r.return)&&i.call(r)}finally{if(s)throw s.error}}return o},o=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(r(arguments[t]));return e},a=new n.C("Hub"),l="undefined"!=typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default",c=new(function(){function e(e){this.listeners=[],this.patterns=[],this.protectedChannels=["core","auth","api","analytics","interactions","pubsub","storage","ui","xr"],this.name=e}return e.prototype.remove=function(e,t){if(e instanceof RegExp){var i=this.patterns.find(function(t){return t.pattern.source===e.source});if(!i)return void a.warn("No listeners for "+e);this.patterns=o(this.patterns.filter(function(e){return e!==i}))}else{var n=this.listeners[e];if(!n)return void a.warn("No listeners for "+e);this.listeners[e]=o(n.filter(function(e){return e.callback!==t}))}},e.prototype.dispatch=function(e,t,i,n){void 0===i&&(i=""),this.protectedChannels.indexOf(e)>-1&&(n===l||a.warn("WARNING: "+e+" is protected and dispatching on it can have unintended consequences"));var r={channel:e,payload:s({},t),source:i,patternInfo:[]};try{this._toListeners(r)}catch(e){a.error(e)}},e.prototype.listen=function(e,t,i){var n,s=this;if(void 0===i&&(i="noname"),function(e){return void 0!==e.onHubCapsule}(t))a.warn("WARNING onHubCapsule is Deprecated. Please pass in a callback."),n=t.onHubCapsule.bind(t);else{if("function"!=typeof t)throw new Error("No callback supplied to Hub");n=t}if(e instanceof RegExp)this.patterns.push({pattern:e,callback:n});else{var r=this.listeners[e];r||(r=[],this.listeners[e]=r),r.push({name:i,callback:n})}return function(){s.remove(e,n)}},e.prototype._toListeners=function(e){var t=e.channel,i=e.payload,n=this.listeners[t];if(n&&n.forEach(function(n){a.debug("Dispatching to "+t+" with ",i);try{n.callback(e)}catch(e){a.error(e)}}),this.patterns.length>0){if(!i.message)return void a.warn("Cannot perform pattern matching without a message key");var o=i.message;this.patterns.forEach(function(t){var i=o.match(t.pattern);if(i){var n=r(i).slice(1),l=s(s({},e),{patternInfo:n});try{t.callback(l)}catch(e){a.error(e)}}})}},e}())("__default__")},51678(e,t,i){"use strict";i.d(t,{JS:()=>y,VN:()=>u,gy:()=>p});var n=i(85409),s=[{type:"text/plain",ext:"txt"},{type:"text/html",ext:"html"},{type:"text/javascript",ext:"js"},{type:"text/css",ext:"css"},{type:"text/csv",ext:"csv"},{type:"text/yaml",ext:"yml"},{type:"text/yaml",ext:"yaml"},{type:"text/calendar",ext:"ics"},{type:"text/calendar",ext:"ical"},{type:"image/apng",ext:"apng"},{type:"image/bmp",ext:"bmp"},{type:"image/gif",ext:"gif"},{type:"image/x-icon",ext:"ico"},{type:"image/x-icon",ext:"cur"},{type:"image/jpeg",ext:"jpg"},{type:"image/jpeg",ext:"jpeg"},{type:"image/jpeg",ext:"jfif"},{type:"image/jpeg",ext:"pjp"},{type:"image/jpeg",ext:"pjpeg"},{type:"image/png",ext:"png"},{type:"image/svg+xml",ext:"svg"},{type:"image/tiff",ext:"tif"},{type:"image/tiff",ext:"tiff"},{type:"image/webp",ext:"webp"},{type:"application/json",ext:"json"},{type:"application/xml",ext:"xml"},{type:"application/x-sh",ext:"sh"},{type:"application/zip",ext:"zip"},{type:"application/x-rar-compressed",ext:"rar"},{type:"application/x-tar",ext:"tar"},{type:"application/x-bzip",ext:"bz"},{type:"application/x-bzip2",ext:"bz2"},{type:"application/pdf",ext:"pdf"},{type:"application/java-archive",ext:"jar"},{type:"application/msword",ext:"doc"},{type:"application/vnd.ms-excel",ext:"xls"},{type:"application/vnd.ms-excel",ext:"xlsx"},{type:"message/rfc822",ext:"eml"}],r=function(e){return void 0===e&&(e={}),0===Object.keys(e).length},o=function(e,t,i){if(!e||!e.sort)return!1;var n=i&&"desc"===i?-1:1;return e.sort(function(e,i){var s=e[t],r=i[t];return void 0===r?void 0===s?0:1*n:void 0===s||s<r?-1*n:s>r?1*n:0}),!0},a=function(e,t){var i=Object.assign({},e);return t&&("string"==typeof t?delete i[t]:t.forEach(function(e){delete i[e]})),i},l=function(e,t){void 0===t&&(t="application/octet-stream");var i=e.toLowerCase(),n=s.filter(function(e){return i.endsWith("."+e.ext)});return n.length>0?n[0].type:t},c=function(e){var t=e.toLowerCase();return!!t.startsWith("text/")||"application/json"===t||"application/xml"===t||"application/sh"===t},h=function(){for(var e="",t=32;t>0;t-=1)e+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return e},u=function(e){if(e.isResolved)return e;var t=!0,i=!1,n=!1,s=e.then(function(e){return n=!0,t=!1,e},function(e){throw i=!0,t=!1,e});return s.isFullfilled=function(){return n},s.isPending=function(){return t},s.isRejected=function(){return i},s},d=function(){if("undefined"==typeof self)return!1;var e=self;return void 0!==e.WorkerGlobalScope&&self instanceof e.WorkerGlobalScope},p=function(){return{isBrowser:"undefined"!=typeof window&&void 0!==window.document,isNode:void 0!==n&&null!=n.versions&&null!=n.versions.node}},g=function(e,t,i){if(void 0===t&&(t=[]),void 0===i&&(i=[]),!m(e))return e;var n={};for(var s in e)e.hasOwnProperty(s)&&(n[t.includes(s)?s:s[0].toLowerCase()+s.slice(1)]=i.includes(s)?e[s]:g(e[s],t,i));return n},f=function(e,t,i){if(void 0===t&&(t=[]),void 0===i&&(i=[]),!m(e))return e;var n={};for(var s in e)e.hasOwnProperty(s)&&(n[t.includes(s)?s:s[0].toUpperCase()+s.slice(1)]=i.includes(s)?e[s]:f(e[s],t,i));return n},m=function(e){return!(!(e instanceof Object)||e instanceof Array||e instanceof Function||e instanceof Number||e instanceof String||e instanceof Boolean)},y=function(){function e(){}return e.isEmpty=r,e.sortByField=o,e.objectLessAttributes=a,e.filenameToContentType=l,e.isTextFile=c,e.generateRandomString=h,e.makeQuerablePromise=u,e.isWebWorker=d,e.browserOrNode=p,e.transferKeyToLowerCase=g,e.transferKeyToUpperCase=f,e.isStrictObject=m,e}()},15567(e,t,i){"use strict";i.d(t,{C:()=>a});var n,s=function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,s,r=i.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=r.next()).done;)o.push(n.value)}catch(e){s={error:e}}finally{try{n&&!n.done&&(i=r.return)&&i.call(r)}finally{if(s)throw s.error}}return o},r=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(s(arguments[t]));return e},o={VERBOSE:1,DEBUG:2,INFO:3,WARN:4,ERROR:5};!function(e){e.DEBUG="DEBUG",e.ERROR="ERROR",e.INFO="INFO",e.WARN="WARN",e.VERBOSE="VERBOSE"}(n||(n={}));var a=function(){function e(e,t){void 0===t&&(t=n.WARN),this.name=e,this.level=t,this._pluggables=[]}return e.prototype._padding=function(e){return e<10?"0"+e:""+e},e.prototype._ts=function(){var e=new Date;return[this._padding(e.getMinutes()),this._padding(e.getSeconds())].join(":")+"."+e.getMilliseconds()},e.prototype.configure=function(e){return e?(this._config=e,this._config):this._config},e.prototype._log=function(t){for(var i,s,r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];var l=this.level;if(e.LOG_LEVEL&&(l=e.LOG_LEVEL),"undefined"!=typeof window&&window.LOG_LEVEL&&(l=window.LOG_LEVEL),o[t]>=o[l]){var c=console.log.bind(console);t===n.ERROR&&console.error&&(c=console.error.bind(console)),t===n.WARN&&console.warn&&(c=console.warn.bind(console));var h="["+t+"] "+this._ts()+" "+this.name,u="";if(1===r.length&&"string"==typeof r[0])c(u=h+" - "+r[0]);else if(1===r.length)u=h+" "+r[0],c(h,r[0]);else if("string"==typeof r[0]){var d=r.slice(1);1===d.length&&(d=d[0]),u=h+" - "+r[0]+" "+d,c(h+" - "+r[0],d)}else u=h+" "+r,c(h,r);try{for(var p=function(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],n=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(this._pluggables),g=p.next();!g.done;g=p.next()){var f=g.value,m={message:u,timestamp:Date.now()};f.pushLogs([m])}}catch(e){i={error:e}}finally{try{g&&!g.done&&(s=p.return)&&s.call(p)}finally{if(i)throw i.error}}}},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,r([n.INFO],e))},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,r([n.INFO],e))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,r([n.WARN],e))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,r([n.ERROR],e))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,r([n.DEBUG],e))},e.prototype.verbose=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,r([n.VERBOSE],e))},e.prototype.addPluggable=function(e){e&&"Logging"===e.getCategoryName()&&(this._pluggables.push(e),e.configure(this._config))},e.prototype.listPluggables=function(){return this._pluggables},e.LOG_LEVEL=null,e}()},410(e,t,i){"use strict";i.d(t,{iX:()=>a});var n=i(15567),s=function(){return s=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var s in t=arguments[i])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},s.apply(this,arguments)},r=new n.C("Parser"),o=function(e){var t,i={};if(e.aws_mobile_analytics_app_id){var n={AWSPinpoint:{appId:e.aws_mobile_analytics_app_id,region:e.aws_mobile_analytics_app_region}};i.Analytics=n}return(e.aws_cognito_identity_pool_id||e.aws_user_pools_id)&&(i.Auth={userPoolId:e.aws_user_pools_id,userPoolWebClientId:e.aws_user_pools_web_client_id,region:e.aws_cognito_region,identityPoolId:e.aws_cognito_identity_pool_id,identityPoolRegion:e.aws_cognito_region,mandatorySignIn:"enable"===e.aws_mandatory_sign_in,signUpVerificationMethod:e.aws_cognito_sign_up_verification_method||"code"}),t=e.aws_user_files_s3_bucket?{AWSS3:{bucket:e.aws_user_files_s3_bucket,region:e.aws_user_files_s3_bucket_region,dangerouslyConnectToHttpEndpointForTesting:e.aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing}}:e?e.Storage||e:{},e.Logging&&(i.Logging=s(s({},e.Logging),{region:e.aws_project_region})),e.geo&&(i.Geo=Object.assign({},e.geo),e.geo.amazon_location_service&&(i.Geo={AmazonLocationService:e.geo.amazon_location_service})),i.Analytics=Object.assign({},i.Analytics,e.Analytics),i.Auth=Object.assign({},i.Auth,e.Auth),i.Storage=Object.assign({},t),i.Logging=Object.assign({},i.Logging,e.Logging),r.debug("parse config",e,"to amplifyconfig",i),i},a=function(){function e(){}return e.parseMobilehubConfig=o,e}()},41547(e,t,i){"use strict";i.d(t,{fE:()=>r});var n="aws-amplify/4.7.14",s={userAgent:n+" js",product:"",navigator:null,isReactNative:!1};"undefined"!=typeof navigator&&navigator.product&&(s.product=navigator.product||"",s.navigator=navigator||null,"ReactNative"===navigator.product?(s.userAgent=n+" react-native",s.isReactNative=!0):(s.userAgent=n+" js",s.isReactNative=!1));var r=function(e){return""+s.userAgent+(e||"")}},75315(e,t,i){"use strict";i.d(t,{i1:()=>r});var n={},s=function(){function e(){}return e.setItem=function(e,t){return n[e]=t,n[e]},e.getItem=function(e){return Object.prototype.hasOwnProperty.call(n,e)?n[e]:void 0},e.removeItem=function(e){return delete n[e]},e.clear=function(){return n={}},e}(),r=function(){function e(){try{this.storageWindow=window.localStorage,this.storageWindow.setItem("aws.amplify.test-ls",1),this.storageWindow.removeItem("aws.amplify.test-ls")}catch(e){this.storageWindow=s}}return e.prototype.getStorage=function(){return this.storageWindow},e}()},56692(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},36637(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},21516(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},19840(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},15784(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isMsWindow=void 0;var i=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];t.isMsWindow=function(e){if(function(e){return"MSInputMethodContext"in e&&"msCrypto"in e}(e)&&void 0!==e.msCrypto.subtle){var t=e.msCrypto,n=t.getRandomValues,s=t.subtle;return i.map(function(e){return s[e]}).concat(n).every(function(e){return"function"==typeof e})}return!1}},10098(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(65927);n.__exportStar(i(56692),t),n.__exportStar(i(36637),t),n.__exportStar(i(21516),t),n.__exportStar(i(19840),t),n.__exportStar(i(15784),t)},90843(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EMPTY_DATA_SHA_256=t.SHA_256_HMAC_ALGO=t.SHA_256_HASH=void 0,t.SHA_256_HASH={name:"SHA-256"},t.SHA_256_HMAC_ALGO={name:"HMAC",hash:t.SHA_256_HASH},t.EMPTY_DATA_SHA_256=new Uint8Array([227,176,196,66,152,252,28,20,154,251,244,200,153,111,185,36,39,174,65,228,100,155,147,76,164,149,153,27,120,82,184,85])},87098(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sha256=void 0;var n=i(25515),s=i(22038),r=i(18558),o=i(91014),a=i(10098),l=i(79251),c=function(){function e(e){(0,o.supportsWebCrypto)((0,l.locateWindow)())?this.hash=new s.Sha256(e):(0,a.isMsWindow)((0,l.locateWindow)())?this.hash=new n.Sha256(e):this.hash=new r.Sha256(e)}return e.prototype.update=function(e,t){this.hash.update(e,t)},e.prototype.digest=function(){return this.hash.digest()},e}();t.Sha256=c},25515(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sha256=void 0;var n=i(27755),s=i(90843),r=i(31643),o=i(79251),a=function(){function e(e){e?(this.operation=function(e){return new Promise(function(t,i){var n=(0,o.locateWindow)().msCrypto.subtle.importKey("raw",l(e),s.SHA_256_HMAC_ALGO,!1,["sign"]);n.oncomplete=function(){n.result&&t(n.result),i(new Error("ImportKey completed without importing key."))},n.onerror=function(){i(new Error("ImportKey failed to import key."))}})}(e).then(function(e){return(0,o.locateWindow)().msCrypto.subtle.sign(s.SHA_256_HMAC_ALGO,e)}),this.operation.catch(function(){})):this.operation=Promise.resolve((0,o.locateWindow)().msCrypto.subtle.digest("SHA-256"))}return e.prototype.update=function(e){var t=this;(0,n.isEmptyData)(e)||(this.operation=this.operation.then(function(i){return i.onerror=function(){t.operation=Promise.reject(new Error("Error encountered updating hash"))},i.process(l(e)),i}),this.operation.catch(function(){}))},e.prototype.digest=function(){return this.operation.then(function(e){return new Promise(function(t,i){e.onerror=function(){i(new Error("Error encountered finalizing hash"))},e.oncomplete=function(){e.result&&t(new Uint8Array(e.result)),i(new Error("Error encountered finalizing hash"))},e.finish()})})},e}();function l(e){return"string"==typeof e?(0,r.fromUtf8)(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}t.Sha256=a},54218(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebCryptoSha256=t.Ie11Sha256=void 0,(0,i(65927).__exportStar)(i(87098),t);var n=i(25515);Object.defineProperty(t,"Ie11Sha256",{enumerable:!0,get:function(){return n.Sha256}});var s=i(22038);Object.defineProperty(t,"WebCryptoSha256",{enumerable:!0,get:function(){return s.Sha256}})},27755(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEmptyData=void 0,t.isEmptyData=function(e){return"string"==typeof e?0===e.length:0===e.byteLength}},22038(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sha256=void 0;var n=i(47062),s=i(90843),r=i(79251),o=function(){function e(e){this.toHash=new Uint8Array(0),void 0!==e&&(this.key=new Promise(function(t,i){(0,r.locateWindow)().crypto.subtle.importKey("raw",(0,n.convertToBuffer)(e),s.SHA_256_HMAC_ALGO,!1,["sign"]).then(t,i)}),this.key.catch(function(){}))}return e.prototype.update=function(e){if(!(0,n.isEmptyData)(e)){var t=(0,n.convertToBuffer)(e),i=new Uint8Array(this.toHash.byteLength+t.byteLength);i.set(this.toHash,0),i.set(t,this.toHash.byteLength),this.toHash=i}},e.prototype.digest=function(){var e=this;return this.key?this.key.then(function(t){return(0,r.locateWindow)().crypto.subtle.sign(s.SHA_256_HMAC_ALGO,t,e.toHash).then(function(e){return new Uint8Array(e)})}):(0,n.isEmptyData)(this.toHash)?Promise.resolve(s.EMPTY_DATA_SHA_256):Promise.resolve().then(function(){return(0,r.locateWindow)().crypto.subtle.digest(s.SHA_256_HASH,e.toHash)}).then(function(e){return Promise.resolve(new Uint8Array(e))})},e}();t.Sha256=o},50930(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(17214),s=function(){function e(){this.state=Int32Array.from(n.INIT),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");var t=0,i=e.byteLength;if(this.bytesHashed+=i,8*this.bytesHashed>n.MAX_HASHABLE_LENGTH)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;i>0;)this.buffer[this.bufferLength++]=e[t++],i--,this.bufferLength===n.BLOCK_SIZE&&(this.hashBuffer(),this.bufferLength=0)},e.prototype.digest=function(){if(!this.finished){var e=8*this.bytesHashed,t=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),i=this.bufferLength;if(t.setUint8(this.bufferLength++,128),i%n.BLOCK_SIZE>=n.BLOCK_SIZE-8){for(var s=this.bufferLength;s<n.BLOCK_SIZE;s++)t.setUint8(s,0);this.hashBuffer(),this.bufferLength=0}for(s=this.bufferLength;s<n.BLOCK_SIZE-8;s++)t.setUint8(s,0);t.setUint32(n.BLOCK_SIZE-8,Math.floor(e/4294967296),!0),t.setUint32(n.BLOCK_SIZE-4,e),this.hashBuffer(),this.finished=!0}var r=new Uint8Array(n.DIGEST_LENGTH);for(s=0;s<8;s++)r[4*s]=this.state[s]>>>24&255,r[4*s+1]=this.state[s]>>>16&255,r[4*s+2]=this.state[s]>>>8&255,r[4*s+3]=this.state[s]>>>0&255;return r},e.prototype.hashBuffer=function(){for(var e=this.buffer,t=this.state,i=t[0],s=t[1],r=t[2],o=t[3],a=t[4],l=t[5],c=t[6],h=t[7],u=0;u<n.BLOCK_SIZE;u++){if(u<16)this.temp[u]=(255&e[4*u])<<24|(255&e[4*u+1])<<16|(255&e[4*u+2])<<8|255&e[4*u+3];else{var d=this.temp[u-2],p=(d>>>17|d<<15)^(d>>>19|d<<13)^d>>>10,g=((d=this.temp[u-15])>>>7|d<<25)^(d>>>18|d<<14)^d>>>3;this.temp[u]=(p+this.temp[u-7]|0)+(g+this.temp[u-16]|0)}var f=(((a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7))+(a&l^~a&c)|0)+(h+(n.KEY[u]+this.temp[u]|0)|0)|0,m=((i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10))+(i&s^i&r^s&r)|0;h=c,c=l,l=a,a=o+f|0,o=r,r=s,s=i,i=f+m|0}t[0]+=i,t[1]+=s,t[2]+=r,t[3]+=o,t[4]+=a,t[5]+=l,t[6]+=c,t[7]+=h},e}();t.RawSha256=s},17214(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BLOCK_SIZE=64,t.DIGEST_LENGTH=32,t.KEY=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),t.INIT=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],t.MAX_HASHABLE_LENGTH=Math.pow(2,53)-1},56059(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),i(65927).__exportStar(i(15119),t)},15119(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(65927),s=i(17214),r=i(50930),o=i(94518),a=function(){function e(e){if(this.hash=new r.RawSha256,e){this.outer=new r.RawSha256;var t=function(e){var t=l(e);if(t.byteLength>s.BLOCK_SIZE){var i=new r.RawSha256;i.update(t),t=i.digest()}var n=new Uint8Array(s.BLOCK_SIZE);return n.set(t),n}(e),i=new Uint8Array(s.BLOCK_SIZE);i.set(t);for(var n=0;n<s.BLOCK_SIZE;n++)t[n]^=54,i[n]^=92;for(this.hash.update(t),this.outer.update(i),n=0;n<t.byteLength;n++)t[n]=0}}return e.prototype.update=function(e){if(!(t=e,("string"==typeof t?0===t.length:0===t.byteLength)||this.error))try{this.hash.update(l(e))}catch(e){this.error=e}var t},e.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},e.prototype.digest=function(){return n.__awaiter(this,void 0,void 0,function(){return n.__generator(this,function(e){return[2,this.digestSync()]})})},e}();function l(e){return"string"==typeof e?o.fromUtf8(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}t.Sha256=a},615(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RawSha256=void 0;var n=i(44335),s=function(){function e(){this.state=Int32Array.from(n.INIT),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");var t=0,i=e.byteLength;if(this.bytesHashed+=i,8*this.bytesHashed>n.MAX_HASHABLE_LENGTH)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;i>0;)this.buffer[this.bufferLength++]=e[t++],i--,this.bufferLength===n.BLOCK_SIZE&&(this.hashBuffer(),this.bufferLength=0)},e.prototype.digest=function(){if(!this.finished){var e=8*this.bytesHashed,t=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),i=this.bufferLength;if(t.setUint8(this.bufferLength++,128),i%n.BLOCK_SIZE>=n.BLOCK_SIZE-8){for(var s=this.bufferLength;s<n.BLOCK_SIZE;s++)t.setUint8(s,0);this.hashBuffer(),this.bufferLength=0}for(s=this.bufferLength;s<n.BLOCK_SIZE-8;s++)t.setUint8(s,0);t.setUint32(n.BLOCK_SIZE-8,Math.floor(e/4294967296),!0),t.setUint32(n.BLOCK_SIZE-4,e),this.hashBuffer(),this.finished=!0}var r=new Uint8Array(n.DIGEST_LENGTH);for(s=0;s<8;s++)r[4*s]=this.state[s]>>>24&255,r[4*s+1]=this.state[s]>>>16&255,r[4*s+2]=this.state[s]>>>8&255,r[4*s+3]=this.state[s]>>>0&255;return r},e.prototype.hashBuffer=function(){for(var e=this.buffer,t=this.state,i=t[0],s=t[1],r=t[2],o=t[3],a=t[4],l=t[5],c=t[6],h=t[7],u=0;u<n.BLOCK_SIZE;u++){if(u<16)this.temp[u]=(255&e[4*u])<<24|(255&e[4*u+1])<<16|(255&e[4*u+2])<<8|255&e[4*u+3];else{var d=this.temp[u-2],p=(d>>>17|d<<15)^(d>>>19|d<<13)^d>>>10,g=((d=this.temp[u-15])>>>7|d<<25)^(d>>>18|d<<14)^d>>>3;this.temp[u]=(p+this.temp[u-7]|0)+(g+this.temp[u-16]|0)}var f=(((a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7))+(a&l^~a&c)|0)+(h+(n.KEY[u]+this.temp[u]|0)|0)|0,m=((i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10))+(i&s^i&r^s&r)|0;h=c,c=l,l=a,a=o+f|0,o=r,r=s,s=i,i=f+m|0}t[0]+=i,t[1]+=s,t[2]+=r,t[3]+=o,t[4]+=a,t[5]+=l,t[6]+=c,t[7]+=h},e}();t.RawSha256=s},44335(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MAX_HASHABLE_LENGTH=t.INIT=t.KEY=t.DIGEST_LENGTH=t.BLOCK_SIZE=void 0,t.BLOCK_SIZE=64,t.DIGEST_LENGTH=32,t.KEY=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),t.INIT=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],t.MAX_HASHABLE_LENGTH=Math.pow(2,53)-1},18558(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),(0,i(65927).__exportStar)(i(21048),t)},21048(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sha256=void 0;var n=i(65927),s=i(44335),r=i(615),o=i(47062),a=function(){function e(e){if(this.hash=new r.RawSha256,e){this.outer=new r.RawSha256;var t=function(e){var t=(0,o.convertToBuffer)(e);if(t.byteLength>s.BLOCK_SIZE){var i=new r.RawSha256;i.update(t),t=i.digest()}var n=new Uint8Array(s.BLOCK_SIZE);return n.set(t),n}(e),i=new Uint8Array(s.BLOCK_SIZE);i.set(t);for(var n=0;n<s.BLOCK_SIZE;n++)t[n]^=54,i[n]^=92;for(this.hash.update(t),this.outer.update(i),n=0;n<t.byteLength;n++)t[n]=0}}return e.prototype.update=function(e){if(!(0,o.isEmptyData)(e)&&!this.error)try{this.hash.update((0,o.convertToBuffer)(e))}catch(e){this.error=e}},e.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},e.prototype.digest=function(){return(0,n.__awaiter)(this,void 0,void 0,function(){return(0,n.__generator)(this,function(e){return[2,this.digestSync()]})})},e}();t.Sha256=a},91014(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),i(65927).__exportStar(i(9301),t)},9301(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.supportsZeroByteGCM=t.supportsSubtleCrypto=t.supportsSecureRandom=t.supportsWebCrypto=void 0;var n=i(65927),s=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function r(e){return"object"==typeof e&&"object"==typeof e.crypto&&"function"==typeof e.crypto.getRandomValues}function o(e){return e&&s.every(function(t){return"function"==typeof e[t]})}t.supportsWebCrypto=function(e){return!(!r(e)||"object"!=typeof e.crypto.subtle)&&o(e.crypto.subtle)},t.supportsSecureRandom=r,t.supportsSubtleCrypto=o,t.supportsZeroByteGCM=function(e){return n.__awaiter(this,void 0,void 0,function(){var t;return n.__generator(this,function(i){switch(i.label){case 0:if(!o(e))return[2,!1];i.label=1;case 1:return i.trys.push([1,4,,5]),[4,e.generateKey({name:"AES-GCM",length:128},!1,["encrypt"])];case 2:return t=i.sent(),[4,e.encrypt({name:"AES-GCM",iv:new Uint8Array(Array(12)),additionalData:new Uint8Array(Array(16)),tagLength:128},t,new Uint8Array(0))];case 3:return[2,16===i.sent().byteLength];case 4:return i.sent(),[2,!1];case 5:return[2]}})})}},29046(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.convertToBuffer=void 0;var n=i(91486),s="undefined"!=typeof Buffer&&Buffer.from?function(e){return Buffer.from(e,"utf8")}:n.fromUtf8;t.convertToBuffer=function(e){return e instanceof Uint8Array?e:"string"==typeof e?s(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}},47062(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uint32ArrayFrom=t.numToUint8=t.isEmptyData=t.convertToBuffer=void 0;var n=i(29046);Object.defineProperty(t,"convertToBuffer",{enumerable:!0,get:function(){return n.convertToBuffer}});var s=i(69783);Object.defineProperty(t,"isEmptyData",{enumerable:!0,get:function(){return s.isEmptyData}});var r=i(41739);Object.defineProperty(t,"numToUint8",{enumerable:!0,get:function(){return r.numToUint8}});var o=i(77780);Object.defineProperty(t,"uint32ArrayFrom",{enumerable:!0,get:function(){return o.uint32ArrayFrom}})},69783(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEmptyData=void 0,t.isEmptyData=function(e){return"string"==typeof e?0===e.length:0===e.byteLength}},41739(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.numToUint8=void 0,t.numToUint8=function(e){return new Uint8Array([(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e])}},77780(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uint32ArrayFrom=void 0,t.uint32ArrayFrom=function(e){if(!Array.from){for(var t=new Uint32Array(e.length);0<e.length;)t[0]=e[0];return t}return Uint32Array.from(e)}},85775(e,t,i){"use strict";i.d(t,{vJ:()=>s,TD:()=>a});var n=i(65927),s=function(e){var t;return(0,n.__assign)((0,n.__assign)({},e),{tls:null===(t=e.tls)||void 0===t||t,endpoint:e.endpoint?r(e):function(){return o(e)},isCustomEndpoint:!!e.endpoint})},r=function(e){var t=e.endpoint,i=e.urlParser;if("string"==typeof t){var n=Promise.resolve(i(t));return function(){return n}}if("object"==typeof t){var s=Promise.resolve(t);return function(){return s}}return t},o=function(e){return(0,n.__awaiter)(void 0,void 0,void 0,function(){var t,i,s,r,o;return(0,n.__generator)(this,function(n){switch(n.label){case 0:return t=e.tls,i=void 0===t||t,[4,e.region()];case 1:if(s=n.sent(),!new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/).test(s))throw new Error("Invalid region in client config");return[4,e.regionInfoProvider(s)];case 2:if(!(r=(null!==(o=n.sent())&&void 0!==o?o:{}).hostname))throw new Error("Cannot resolve hostname from client config");return[2,e.urlParser((i?"https:":"http:")+"//"+r)]}})})},a=function(e){if(!e.region)throw new Error("Region is missing");return(0,n.__assign)((0,n.__assign)({},e),{region:l(e.region)})},l=function(e){if("string"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e}},22292(e,t,i){"use strict";i.d(t,{N:()=>o,k:()=>l});var n=i(65927),s=i(59027),r=i(2726),o=function(){function e(e){var t=(void 0===e?{}:e).requestTimeout;this.requestTimeout=t}return e.prototype.destroy=function(){},e.prototype.handle=function(e,t){var i=(void 0===t?{}:t).abortSignal,o=this.requestTimeout;if(null==i?void 0:i.aborted){var a=new Error("Request aborted");return a.name="AbortError",Promise.reject(a)}var l=e.path;if(e.query){var c=function(e){var t,i,s=[];try{for(var o=(0,n.__values)(Object.keys(e).sort()),a=o.next();!a.done;a=o.next()){var l=a.value,c=e[l];if(l=(0,r.o)(l),Array.isArray(c))for(var h=0,u=c.length;h<u;h++)s.push(l+"="+(0,r.o)(c[h]));else{var d=l;(c||"string"==typeof c)&&(d+="="+(0,r.o)(c)),s.push(d)}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}return s.join("&")}(e.query);c&&(l+="?"+c)}var h=e.port,u=e.method,d=e.protocol+"//"+e.hostname+(h?":"+h:"")+l,p={body:"GET"===u||"HEAD"===u?void 0:e.body,headers:new Headers(e.headers),method:u};"undefined"!=typeof AbortController&&(p.signal=i);var g,f=new Request(d,p),m=[fetch(f).then(function(e){var t,i,r=e.headers,o={};try{for(var a=(0,n.__values)(r.entries()),l=a.next();!l.done;l=a.next()){var c=l.value;o[c[0]]=c[1]}}catch(e){t={error:e}}finally{try{l&&!l.done&&(i=a.return)&&i.call(a)}finally{if(t)throw t.error}}return void 0!==e.body?{response:new s.cS({headers:o,statusCode:e.status,body:e.body})}:e.blob().then(function(t){return{response:new s.cS({headers:o,statusCode:e.status,body:t})}})}),(g=o,void 0===g&&(g=0),new Promise(function(e,t){g&&setTimeout(function(){var e=new Error("Request did not complete within "+g+" ms");e.name="TimeoutError",t(e)},g)}))];return i&&m.push(new Promise(function(e,t){i.onabort=function(){var e=new Error("Request aborted");e.name="AbortError",t(e)}})),Promise.race(m)},e}(),a=i(68380),l=function(e){return"function"==typeof Blob&&e instanceof Blob?function(e){return(0,n.__awaiter)(this,void 0,void 0,function(){var t,i;return(0,n.__generator)(this,function(n){switch(n.label){case 0:return[4,c(e)];case 1:return t=n.sent(),i=(0,a.E)(t),[2,new Uint8Array(i)]}})})}(e):function(e){return(0,n.__awaiter)(this,void 0,void 0,function(){var t,i,s,r,o,a,l;return(0,n.__generator)(this,function(n){switch(n.label){case 0:t=new Uint8Array(0),i=e.getReader(),s=!1,n.label=1;case 1:return s?[3,3]:[4,i.read()];case 2:return r=n.sent(),o=r.done,(a=r.value)&&(l=t,(t=new Uint8Array(l.length+a.length)).set(l),t.set(a,l.length)),s=o,[3,1];case 3:return[2,t]}})})}(e)};function c(e){return new Promise(function(t,i){var n=new FileReader;n.onloadend=function(){var e;if(2!==n.readyState)return i(new Error("Reader aborted too early"));var s=null!==(e=n.result)&&void 0!==e?e:"",r=s.indexOf(","),o=r>-1?r+1:s.length;t(s.substring(o))},n.onabort=function(){return i(new Error("Read aborted"))},n.onerror=function(){return i(n.error)},n.readAsDataURL(e)})}},10078(e,t,i){"use strict";i.d(t,{B:()=>n});var n=function(e){return function(){return Promise.reject(e)}}},23788(e,t,i){"use strict";i.d(t,{vK:()=>a});var n=i(65927),s=i(59027),r="content-length",o={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},a=function(e){return{applyToStack:function(t){t.add(function(e){var t=this;return function(i){return function(o){return(0,n.__awaiter)(t,void 0,void 0,function(){var t,a,l,c,h;return(0,n.__generator)(this,function(u){return t=o.request,s.Kd.isInstance(t)&&(a=t.body,l=t.headers,a&&-1===Object.keys(l).map(function(e){return e.toLowerCase()}).indexOf(r)&&void 0!==(c=e(a))&&(t.headers=(0,n.__assign)((0,n.__assign)({},t.headers),((h={})[r]=String(c),h)))),[2,i((0,n.__assign)((0,n.__assign)({},o),{request:t}))]})})}}}(e.bodyLengthChecker),o)}}}},14188(e,t,i){"use strict";i.d(t,{OV:()=>r,TC:()=>a});var n=i(65927),s=i(59027);function r(e){return e}var o={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},a=function(e){return{applyToStack:function(t){t.add(function(e){return function(t){return function(i){return(0,n.__awaiter)(void 0,void 0,void 0,function(){var r,o;return(0,n.__generator)(this,function(n){return s.Kd.isInstance(i.request)?(r=i.request,(void 0===(o=(e.requestHandler.metadata||{}).handlerProtocol)?"":o).indexOf("h2")>=0&&!r.headers[":authority"]?(delete r.headers.host,r.headers[":authority"]=""):r.headers.host||(r.headers.host=r.hostname),[2,t(i)]):[2,t(i)]})})}}}(e),o)}}}},64996(e,t,i){"use strict";i.d(t,{Y7:()=>r});var n=i(65927),s={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},r=function(e){return{applyToStack:function(e){e.add(function(e,t){return function(i){return(0,n.__awaiter)(void 0,void 0,void 0,function(){var s,r,o,a,l,c,h,u,d;return(0,n.__generator)(this,function(p){switch(p.label){case 0:return s=t.clientName,r=t.commandName,o=t.inputFilterSensitiveLog,a=t.logger,l=t.outputFilterSensitiveLog,[4,e(i)];case 1:return c=p.sent(),a?("function"==typeof a.info&&(h=c.output,u=h.$metadata,d=(0,n.__rest)(h,["$metadata"]),a.info({clientName:s,commandName:r,input:o(i.input),output:l(d),metadata:u})),[2,c]):[2,c]}})})}},s)}}}},16307(e,t,i){"use strict";i.d(t,{Gz:()=>f,ey:()=>r,$z:()=>y});var n=i(65927),s={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},r=function(e){return{applyToStack:function(t){t.add(function(e){return function(t,i){return function(s){return(0,n.__awaiter)(void 0,void 0,void 0,function(){var r;return(0,n.__generator)(this,function(o){return(null===(r=null==e?void 0:e.retryStrategy)||void 0===r?void 0:r.mode)&&(i.userAgent=(0,n.__spread)(i.userAgent||[],[["cfg/retry-mode",e.retryStrategy.mode]])),[2,e.retryStrategy.retry(t,s)]})})}}}(e),s)}}},o=i(59027),a=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch"],l=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],c=["AbortError","TimeoutError","RequestTimeout","RequestTimeoutException"],h=[500,502,503,504],u=function(e){var t,i;return 429===(null===(t=e.$metadata)||void 0===t?void 0:t.httpStatusCode)||l.includes(e.name)||1==(null===(i=e.$retryable)||void 0===i?void 0:i.throttling)},d=i(16699),p=function(e,t){return Math.floor(Math.min(2e4,Math.random()*Math.pow(2,t)*e))},g=function(e){return!!e&&(function(e){return void 0!==e.$retryable}(e)||function(e){return a.includes(e.name)}(e)||u(e)||function(e){var t;return c.includes(e.name)||h.includes((null===(t=e.$metadata)||void 0===t?void 0:t.httpStatusCode)||0)}(e))},f=3,m=function(){function e(e,t){var i,n,s,r,o,a,l;this.maxAttemptsProvider=e,this.mode="standard",this.retryDecider=null!==(i=null==t?void 0:t.retryDecider)&&void 0!==i?i:g,this.delayDecider=null!==(n=null==t?void 0:t.delayDecider)&&void 0!==n?n:p,this.retryQuota=null!==(s=null==t?void 0:t.retryQuota)&&void 0!==s?s:(r=500,o=500,a=function(e){return"TimeoutError"===e.name?10:5},l=function(e){return a(e)<=o},Object.freeze({hasRetryTokens:l,retrieveRetryTokens:function(e){if(!l(e))throw new Error("No retry token available");var t=a(e);return o-=t,t},releaseRetryTokens:function(e){o+=null!=e?e:1,o=Math.min(o,r)}}))}return e.prototype.shouldRetry=function(e,t,i){return t<i&&this.retryDecider(e)&&this.retryQuota.hasRetryTokens(e)},e.prototype.getMaxAttempts=function(){return(0,n.__awaiter)(this,void 0,void 0,function(){var e;return(0,n.__generator)(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.maxAttemptsProvider()];case 1:return e=t.sent(),[3,3];case 2:return t.sent(),e=f,[3,3];case 3:return[2,e]}})})},e.prototype.retry=function(e,t){return(0,n.__awaiter)(this,void 0,void 0,function(){var i,s,r,a,l,c,h,p;return(0,n.__generator)(this,function(g){switch(g.label){case 0:return s=0,r=0,[4,this.getMaxAttempts()];case 1:a=g.sent(),l=t.request,o.Kd.isInstance(l)&&(l.headers["amz-sdk-invocation-id"]=(0,d.v4)()),c=function(){var c,d,p,g,f;return(0,n.__generator)(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,5]),o.Kd.isInstance(l)&&(l.headers["amz-sdk-request"]="attempt="+(s+1)+"; max="+a),[4,e(t)];case 1:return c=n.sent(),d=c.response,p=c.output,h.retryQuota.releaseRetryTokens(i),p.$metadata.attempts=s+1,p.$metadata.totalRetryDelay=r,[2,{value:{response:d,output:p}}];case 2:return g=n.sent(),s++,h.shouldRetry(g,s,a)?(i=h.retryQuota.retrieveRetryTokens(g),f=h.delayDecider(u(g)?500:100,s),r+=f,[4,new Promise(function(e){return setTimeout(e,f)})]):[3,4];case 3:return n.sent(),[2,"continue"];case 4:throw g.$metadata||(g.$metadata={}),g.$metadata.attempts=s,g.$metadata.totalRetryDelay=r,g;case 5:return[2]}})},h=this,g.label=2;case 2:return[5,c()];case 3:return"object"==typeof(p=g.sent())?[2,p.value]:[3,2];case 4:return[2]}})})},e}(),y=function(e){var t=v(e.maxAttempts);return(0,n.__assign)((0,n.__assign)({},e),{maxAttempts:t,retryStrategy:e.retryStrategy||new m(t)})},v=function(e){if(void 0===e&&(e=f),"number"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e}},74052(e,t,i){"use strict";i.d(t,{TM:()=>o});var n=i(65927),s={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},r={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function o(e,t,i){return{applyToStack:function(o){o.add(function(e,t){return function(i,s){return function(s){return(0,n.__awaiter)(void 0,void 0,void 0,function(){var r,o;return(0,n.__generator)(this,function(n){switch(n.label){case 0:return[4,i(s)];case 1:return r=n.sent().response,[4,t(r,e)];case 2:return o=n.sent(),[2,{response:r,output:o}]}})})}}}(e,i),s),o.add(function(e,t){return function(i,s){return function(s){return(0,n.__awaiter)(void 0,void 0,void 0,function(){var r;return(0,n.__generator)(this,function(o){switch(o.label){case 0:return[4,t(s.input,e)];case 1:return r=o.sent(),[2,i((0,n.__assign)((0,n.__assign)({},s),{request:r}))]}})})}}}(e,t),r)}}}},88428(e,t,i){"use strict";i.d(t,{DF:()=>V,k9:()=>N});var n=i(65927),s=i(81504),r="X-Amz-Date",o="X-Amz-Signature",a="X-Amz-Security-Token",l="authorization",c=r.toLowerCase(),h=[l,c,"date"],u=o.toLowerCase(),d="x-amz-content-sha256",p=a.toLowerCase(),g={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},f=/^proxy-/,m=/^sec-/,y="AWS4-HMAC-SHA256",v="AWS4-HMAC-SHA256-PAYLOAD",b="aws4_request",C={},w=[];function S(e,t,i){return e+"/"+t+"/"+i+"/"+b}function x(e,t,i){var n=new e(t);return n.update(i),n.digest()}function E(e,t,i){var s,r,o=e.headers,a={};try{for(var l=(0,n.__values)(Object.keys(o).sort()),c=l.next();!c.done;c=l.next()){var h=c.value,u=h.toLowerCase();(u in g||(null==t?void 0:t.has(u))||f.test(u)||m.test(u))&&(!i||i&&!i.has(u))||(a[u]=o[h].trim().replace(/\s+/g," "))}}catch(e){s={error:e}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(s)throw s.error}}return a}var A=i(2726);function M(e,t){var i=e.headers,r=e.body;return(0,n.__awaiter)(this,void 0,void 0,function(){var e,o,a,l,c,h,u;return(0,n.__generator)(this,function(p){switch(p.label){case 0:try{for(e=(0,n.__values)(Object.keys(i)),o=e.next();!o.done;o=e.next())if((a=o.value).toLowerCase()===d)return[2,i[a]]}catch(e){h={error:e}}finally{try{o&&!o.done&&(u=e.return)&&u.call(e)}finally{if(h)throw h.error}}return null!=r?[3,1]:[2,"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"];case 1:return"string"==typeof r||ArrayBuffer.isView(r)||(g=r,"function"==typeof ArrayBuffer&&g instanceof ArrayBuffer||"[object ArrayBuffer]"===Object.prototype.toString.call(g))?((l=new t).update(r),c=s.n,[4,l.digest()]):[3,3];case 2:return[2,c.apply(void 0,[p.sent()])];case 3:return[2,"UNSIGNED-PAYLOAD"]}var g})})}function T(e){var t=e.headers,i=e.query,s=(0,n.__rest)(e,["headers","query"]);return(0,n.__assign)((0,n.__assign)({},s),{headers:(0,n.__assign)({},t),query:i?D(i):void 0})}function D(e){return Object.keys(e).reduce(function(t,i){var s,r=e[i];return(0,n.__assign)((0,n.__assign)({},t),((s={})[i]=Array.isArray(r)?(0,n.__spread)(r):r,s))},{})}function I(e){var t,i;e="function"==typeof e.clone?e.clone():T(e);try{for(var s=(0,n.__values)(Object.keys(e.headers)),r=s.next();!r.done;r=s.next()){var o=r.value;h.indexOf(o.toLowerCase())>-1&&delete e.headers[o]}}catch(e){t={error:e}}finally{try{r&&!r.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}return e}var R=function(){function e(e){var t=e.applyChecksum,i=e.credentials,n=e.region,s=e.service,r=e.sha256,o=e.uriEscapePath,a=void 0===o||o;this.service=s,this.sha256=r,this.uriEscapePath=a,this.applyChecksum="boolean"!=typeof t||t,this.regionProvider=_(n),this.credentialProvider=L(i)}return e.prototype.presign=function(e,t){return void 0===t&&(t={}),(0,n.__awaiter)(this,void 0,void 0,function(){var i,s,l,c,h,u,d,p,g,f,m,v,b,C,w,x,A,D,R,_,L,N,O,F;return(0,n.__generator)(this,function(G){switch(G.label){case 0:return i=t.signingDate,s=void 0===i?new Date:i,l=t.expiresIn,c=void 0===l?3600:l,h=t.unsignableHeaders,u=t.unhoistableHeaders,d=t.signableHeaders,p=t.signingRegion,g=t.signingService,[4,this.credentialProvider()];case 1:return f=G.sent(),null==p?[3,2]:(v=p,[3,4]);case 2:return[4,this.regionProvider()];case 3:v=G.sent(),G.label=4;case 4:return m=v,b=k(s),C=b.longDate,w=b.shortDate,c>604800?[2,Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future")]:(x=S(w,m,null!=g?g:this.service),A=function(e,t){var i,s,r;void 0===t&&(t={});var o="function"==typeof e.clone?e.clone():T(e),a=o.headers,l=o.query,c=void 0===l?{}:l;try{for(var h=(0,n.__values)(Object.keys(a)),u=h.next();!u.done;u=h.next()){var d=u.value,p=d.toLowerCase();"x-amz-"!==p.substr(0,6)||(null===(r=t.unhoistableHeaders)||void 0===r?void 0:r.has(p))||(c[d]=a[d],delete a[d])}}catch(e){i={error:e}}finally{try{u&&!u.done&&(s=h.return)&&s.call(h)}finally{if(i)throw i.error}}return(0,n.__assign)((0,n.__assign)({},e),{headers:a,query:c})}(I(e),{unhoistableHeaders:u}),f.sessionToken&&(A.query[a]=f.sessionToken),A.query["X-Amz-Algorithm"]=y,A.query["X-Amz-Credential"]=f.accessKeyId+"/"+x,A.query[r]=C,A.query["X-Amz-Expires"]=c.toString(10),D=E(A,h,d),A.query["X-Amz-SignedHeaders"]=P(D),R=A.query,_=o,L=this.getSignature,N=[C,x,this.getSigningKey(f,m,w,g)],O=this.createCanonicalRequest,F=[A,D],[4,M(e,this.sha256)]);case 5:return[4,L.apply(this,N.concat([O.apply(this,F.concat([G.sent()]))]))];case 6:return R[_]=G.sent(),[2,A]}})})},e.prototype.sign=function(e,t){return(0,n.__awaiter)(this,void 0,void 0,function(){return(0,n.__generator)(this,function(i){return"string"==typeof e?[2,this.signString(e,t)]:e.headers&&e.payload?[2,this.signEvent(e,t)]:[2,this.signRequest(e,t)]})})},e.prototype.signEvent=function(e,t){var i=e.headers,r=e.payload,o=t.signingDate,a=void 0===o?new Date:o,l=t.priorSignature,c=t.signingRegion,h=t.signingService;return(0,n.__awaiter)(this,void 0,void 0,function(){var e,t,o,u,d,p,g,f,m,y,b;return(0,n.__generator)(this,function(n){switch(n.label){case 0:return null==c?[3,1]:(t=c,[3,3]);case 1:return[4,this.regionProvider()];case 2:t=n.sent(),n.label=3;case 3:return e=t,o=k(a),u=o.shortDate,d=o.longDate,p=S(u,e,null!=h?h:this.service),[4,M({headers:{},body:r},this.sha256)];case 4:return g=n.sent(),(f=new this.sha256).update(i),y=s.n,[4,f.digest()];case 5:return m=y.apply(void 0,[n.sent()]),b=[v,d,p,l,m,g].join("\n"),[2,this.signString(b,{signingDate:a,signingRegion:e,signingService:h})]}})})},e.prototype.signString=function(e,t){var i=void 0===t?{}:t,r=i.signingDate,o=void 0===r?new Date:r,a=i.signingRegion,l=i.signingService;return(0,n.__awaiter)(this,void 0,void 0,function(){var t,i,r,c,h,u,d,p;return(0,n.__generator)(this,function(n){switch(n.label){case 0:return[4,this.credentialProvider()];case 1:return t=n.sent(),null==a?[3,2]:(r=a,[3,4]);case 2:return[4,this.regionProvider()];case 3:r=n.sent(),n.label=4;case 4:return i=r,c=k(o).shortDate,d=(u=this.sha256).bind,[4,this.getSigningKey(t,i,c,l)];case 5:return(h=new(d.apply(u,[void 0,n.sent()]))).update(e),p=s.n,[4,h.digest()];case 6:return[2,p.apply(void 0,[n.sent()])]}})})},e.prototype.signRequest=function(e,t){var i=void 0===t?{}:t,s=i.signingDate,r=void 0===s?new Date:s,o=i.signableHeaders,a=i.unsignableHeaders,h=i.signingRegion,u=i.signingService;return(0,n.__awaiter)(this,void 0,void 0,function(){var t,i,s,g,f,m,v,b,C,w,x;return(0,n.__generator)(this,function(A){switch(A.label){case 0:return[4,this.credentialProvider()];case 1:return t=A.sent(),null==h?[3,2]:(s=h,[3,4]);case 2:return[4,this.regionProvider()];case 3:s=A.sent(),A.label=4;case 4:return i=s,g=I(e),f=k(r),m=f.longDate,v=f.shortDate,b=S(v,i,null!=u?u:this.service),g.headers[c]=m,t.sessionToken&&(g.headers[p]=t.sessionToken),[4,M(g,this.sha256)];case 5:return C=A.sent(),!function(e,t){var i,s;e=e.toLowerCase();try{for(var r=(0,n.__values)(Object.keys(t)),o=r.next();!o.done;o=r.next())if(e===o.value.toLowerCase())return!0}catch(e){i={error:e}}finally{try{o&&!o.done&&(s=r.return)&&s.call(r)}finally{if(i)throw i.error}}return!1}(d,g.headers)&&this.applyChecksum&&(g.headers[d]=C),w=E(g,a,o),[4,this.getSignature(m,b,this.getSigningKey(t,i,v,u),this.createCanonicalRequest(g,w,C))];case 6:return x=A.sent(),g.headers[l]=y+" Credential="+t.accessKeyId+"/"+b+", SignedHeaders="+P(w)+", Signature="+x,[2,g]}})})},e.prototype.createCanonicalRequest=function(e,t,i){var s=Object.keys(t).sort();return e.method+"\n"+this.getCanonicalPath(e)+"\n"+function(e){var t,i,s=e.query,r=void 0===s?{}:s,o=[],a={},l=function(e){if(e.toLowerCase()===u)return"continue";o.push(e);var t=r[e];"string"==typeof t?a[e]=(0,A.o)(e)+"="+(0,A.o)(t):Array.isArray(t)&&(a[e]=t.slice(0).sort().reduce(function(t,i){return t.concat([(0,A.o)(e)+"="+(0,A.o)(i)])},[]).join("&"))};try{for(var c=(0,n.__values)(Object.keys(r).sort()),h=c.next();!h.done;h=c.next())l(h.value)}catch(e){t={error:e}}finally{try{h&&!h.done&&(i=c.return)&&i.call(c)}finally{if(t)throw t.error}}return o.map(function(e){return a[e]}).filter(function(e){return e}).join("&")}(e)+"\n"+s.map(function(e){return e+":"+t[e]}).join("\n")+"\n\n"+s.join(";")+"\n"+i},e.prototype.createStringToSign=function(e,t,i){return(0,n.__awaiter)(this,void 0,void 0,function(){var r,o;return(0,n.__generator)(this,function(n){switch(n.label){case 0:return(r=new this.sha256).update(i),[4,r.digest()];case 1:return o=n.sent(),[2,y+"\n"+e+"\n"+t+"\n"+(0,s.n)(o)]}})})},e.prototype.getCanonicalPath=function(e){var t=e.path;return this.uriEscapePath?"/"+encodeURIComponent(t.replace(/^\//,"")).replace(/%2F/g,"/"):t},e.prototype.getSignature=function(e,t,i,r){return(0,n.__awaiter)(this,void 0,void 0,function(){var o,a,l,c,h;return(0,n.__generator)(this,function(n){switch(n.label){case 0:return[4,this.createStringToSign(e,t,r)];case 1:return o=n.sent(),c=(l=this.sha256).bind,[4,i];case 2:return(a=new(c.apply(l,[void 0,n.sent()]))).update(o),h=s.n,[4,a.digest()];case 3:return[2,h.apply(void 0,[n.sent()])]}})})},e.prototype.getSigningKey=function(e,t,i,r){return function(e,t,i,r,o){return(0,n.__awaiter)(void 0,void 0,void 0,function(){var a,l,c,h,u,d,p,g,f;return(0,n.__generator)(this,function(m){switch(m.label){case 0:return[4,x(e,t.secretAccessKey,t.accessKeyId)];case 1:if(a=m.sent(),(l=i+":"+r+":"+o+":"+(0,s.n)(a)+":"+t.sessionToken)in C)return[2,C[l]];for(w.push(l);w.length>50;)delete C[w.shift()];c="AWS4"+t.secretAccessKey,m.label=2;case 2:m.trys.push([2,7,8,9]),h=(0,n.__values)([i,r,o,b]),u=h.next(),m.label=3;case 3:return u.done?[3,6]:(d=u.value,[4,x(e,c,d)]);case 4:c=m.sent(),m.label=5;case 5:return u=h.next(),[3,3];case 6:return[3,9];case 7:return p=m.sent(),g={error:p},[3,9];case 8:try{u&&!u.done&&(f=h.return)&&f.call(h)}finally{if(g)throw g.error}return[7];case 9:return[2,C[l]=c]}})})}(this.sha256,e,i,t,r||this.service)},e}(),k=function(e){var t,i=(t=e,function(e){return"number"==typeof e?new Date(1e3*e):"string"==typeof e?Number(e)?new Date(1e3*Number(e)):new Date(e):e}(t).toISOString().replace(/\.\d{3}Z$/,"Z")).replace(/[\-:]/g,"");return{longDate:i,shortDate:i.substr(0,8)}},P=function(e){return Object.keys(e).sort().join(";")},_=function(e){if("string"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e},L=function(e){if("object"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e};function N(e){var t,i=this,s=O(e.credentials||e.credentialDefaultProvider(e)),r=e.signingEscapePath,o=void 0===r||r,a=e.systemClockOffset,l=void 0===a?e.systemClockOffset||0:a,c=e.sha256;return t=e.signer?O(e.signer):function(){return O(e.region)().then(function(t){return(0,n.__awaiter)(i,void 0,void 0,function(){return(0,n.__generator)(this,function(i){switch(i.label){case 0:return[4,e.regionInfoProvider(t)];case 1:return[2,[i.sent()||{},t]]}})})}).then(function(t){var i=(0,n.__read)(t,2),r=i[0],a=i[1],l=r.signingRegion,h=r.signingService;return e.signingRegion=e.signingRegion||l||a,e.signingName=e.signingName||h||e.serviceId,new R({credentials:s,region:e.signingRegion,service:e.signingName,sha256:c,uriEscapePath:o})})},(0,n.__assign)((0,n.__assign)({},e),{systemClockOffset:l,signingEscapePath:o,credentials:s,signer:t})}function O(e){if("object"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e}var F=i(59027);function G(e){return function(t,i){return function(s){return(0,n.__awaiter)(this,void 0,void 0,function(){var r,o,a,l,c,h,u,d,p;return(0,n.__generator)(this,function(g){switch(g.label){case 0:return F.Kd.isInstance(s.request)?"function"!=typeof e.signer?[3,2]:[4,e.signer()]:[2,t(s)];case 1:return o=g.sent(),[3,3];case 2:o=e.signer,g.label=3;case 3:return r=o,l=t,c=[(0,n.__assign)({},s)],p={},[4,r.sign(s.request,{signingDate:new Date(Date.now()+e.systemClockOffset),signingRegion:i.signing_region,signingService:i.signing_service})];case 4:return[4,l.apply(void 0,[n.__assign.apply(void 0,c.concat([(p.request=g.sent(),p)]))])];case 5:return a=g.sent(),h=a.response.headers,(u=h&&(h.date||h.Date))&&(f=d=Date.parse(u),m=e.systemClockOffset,Math.abs(function(e){return new Date(Date.now()+e)}(m).getTime()-f)>=3e5&&(e.systemClockOffset=d-Date.now())),[2,a]}var f,m})})}}}var B={name:"awsAuthMiddleware",tags:["SIGNATURE","AWSAUTH"],relation:"after",toMiddleware:"retryMiddleware",override:!0},V=function(e){return{applyToStack:function(t){t.addRelativeTo(G(e),B)}}}},44625(e,t,i){"use strict";i.d(t,{sM:()=>h,Dc:()=>s});var n=i(65927);function s(e){return(0,n.__assign)((0,n.__assign)({},e),{customUserAgent:"string"==typeof e.customUserAgent?[[e.customUserAgent]]:e.customUserAgent})}var r=i(59027),o="user-agent",a=/[^\!\#\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,l=function(e){var t=(0,n.__read)(e,2),i=t[0],s=t[1],r=i.indexOf("/"),o=i.substring(0,r),l=i.substring(r+1);return"api"===o&&(l=l.toLowerCase()),[o,l,s].filter(function(e){return e&&e.length>0}).map(function(e){return null==e?void 0:e.replace(a,"_")}).join("/")},c={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},h=function(e){return{applyToStack:function(t){var i;t.add((i=e,function(e,t){return function(s){return(0,n.__awaiter)(void 0,void 0,void 0,function(){var a,c,h,u,d,p,g,f;return(0,n.__generator)(this,function(m){switch(m.label){case 0:return a=s.request,r.Kd.isInstance(a)?(c=a.headers,h=(null===(g=null==t?void 0:t.userAgent)||void 0===g?void 0:g.map(l))||[],[4,i.defaultUserAgentProvider()]):[2,e(s)];case 1:return u=m.sent().map(l),d=(null===(f=null==i?void 0:i.customUserAgent)||void 0===f?void 0:f.map(l))||[],c["x-amz-user-agent"]=(0,n.__spread)(u,h,d).join(" "),p=(0,n.__spread)(u.filter(function(e){return e.startsWith("aws-sdk-")}),d).join(" "),"browser"!==i.runtime&&p&&(c[o]=c[o]?c[o]+" "+p:p),[2,e((0,n.__assign)((0,n.__assign)({},s),{request:a}))]}})})}}),c)}}}},59027(e,t,i){"use strict";i.d(t,{Kd:()=>r,cS:()=>n});var n=function(){function e(e){this.statusCode=e.statusCode,this.headers=e.headers||{},this.body=e.body}return e.isInstance=function(e){if(!e)return!1;var t=e;return"number"==typeof t.statusCode&&"object"==typeof t.headers},e}(),s=i(65927),r=function(){function e(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?":"!==e.protocol.substr(-1)?e.protocol+":":e.protocol:"https:",this.path=e.path?"/"!==e.path.charAt(0)?"/"+e.path:e.path:"/"}return e.isInstance=function(e){if(!e)return!1;var t=e;return"method"in t&&"protocol"in t&&"hostname"in t&&"path"in t&&"object"==typeof t.query&&"object"==typeof t.headers},e.prototype.clone=function(){var t,i=new e((0,s.__assign)((0,s.__assign)({},this),{headers:(0,s.__assign)({},this.headers)}));return i.query&&(i.query=(t=i.query,Object.keys(t).reduce(function(e,i){var n,r=t[i];return(0,s.__assign)((0,s.__assign)({},e),((n={})[i]=Array.isArray(r)?(0,s.__spread)(r):r,n))},{}))),i},e}()},11538(e,t,i){"use strict";i.d(t,{Kj:()=>a,uB:()=>l,$6:()=>c});var n=i(65927),s=function(){var e=[],t=[],i=new Set,a=function(i){return e.forEach(function(e){i.add(e.middleware,(0,n.__assign)({},e))}),t.forEach(function(e){i.addRelativeTo(e.middleware,(0,n.__assign)({},e))}),i},l=function(e){var t=[];return e.before.forEach(function(e){0===e.before.length&&0===e.after.length?t.push(e):t.push.apply(t,(0,n.__spread)(l(e)))}),t.push(e),e.after.reverse().forEach(function(e){0===e.before.length&&0===e.after.length?t.push(e):t.push.apply(t,(0,n.__spread)(l(e)))}),t},c={add:function(t,s){void 0===s&&(s={});var r=s.name,o=s.override,a=(0,n.__assign)({step:"initialize",priority:"normal",middleware:t},s);if(r){if(i.has(r)){if(!o)throw new Error("Duplicate middleware name '"+r+"'");var l=e.findIndex(function(e){return e.name===r}),c=e[l];if(c.step!==a.step||c.priority!==a.priority)throw new Error('"'+r+'" middleware with '+c.priority+" priority in "+c.step+" step cannot be overridden by same-name middleware with "+a.priority+" priority in "+a.step+" step.");e.splice(l,1)}i.add(r)}e.push(a)},addRelativeTo:function(e,s){var r=s.name,o=s.override,a=(0,n.__assign)({middleware:e},s);if(r){if(i.has(r)){if(!o)throw new Error("Duplicate middleware name '"+r+"'");var l=t.findIndex(function(e){return e.name===r}),c=t[l];if(c.toMiddleware!==a.toMiddleware||c.relation!==a.relation)throw new Error('"'+r+'" middleware '+c.relation+' "'+c.toMiddleware+'" middleware cannot be overridden by same-name middleware '+a.relation+' "'+a.toMiddleware+'" middleware.');t.splice(l,1)}i.add(r)}t.push(a)},clone:function(){return a(s())},use:function(e){e.applyToStack(c)},remove:function(n){return"string"==typeof n?function(n){var s=!1,r=function(e){return!e.name||e.name!==n||(s=!0,i.delete(n),!1)};return e=e.filter(r),t=t.filter(r),s}(n):function(n){var s=!1,r=function(e){return e.middleware!==n||(s=!0,e.name&&i.delete(e.name),!1)};return e=e.filter(r),t=t.filter(r),s}(n)},removeByTag:function(n){var s=!1,r=function(e){var t=e.tags,r=e.name;return!t||!t.includes(n)||(r&&i.delete(r),s=!0,!1)};return e=e.filter(r),t=t.filter(r),s},concat:function(e){var t=a(s());return t.use(e),t},applyToStack:a,resolve:function(i,s){var a,c;try{for(var h=(0,n.__values)(function(){var i,s=[],a=[],c={};return e.forEach(function(e){var t=(0,n.__assign)((0,n.__assign)({},e),{before:[],after:[]});t.name&&(c[t.name]=t),s.push(t)}),t.forEach(function(e){var t=(0,n.__assign)((0,n.__assign)({},e),{before:[],after:[]});t.name&&(c[t.name]=t),a.push(t)}),a.forEach(function(e){if(e.toMiddleware){var t=c[e.toMiddleware];if(void 0===t)throw new Error(e.toMiddleware+" is not found when adding "+(e.name||"anonymous")+" middleware "+e.relation+" "+e.toMiddleware);"after"===e.relation&&t.after.push(e),"before"===e.relation&&t.before.push(e)}}),(i=s,i.sort(function(e,t){return r[t.step]-r[e.step]||o[t.priority||"normal"]-o[e.priority||"normal"]})).map(l).reduce(function(e,t){return e.push.apply(e,(0,n.__spread)(t)),e},[]).map(function(e){return e.middleware})}().reverse()),u=h.next();!u.done;u=h.next())i=(0,u.value)(i,s)}catch(e){a={error:e}}finally{try{u&&!u.done&&(c=h.return)&&c.call(h)}finally{if(a)throw a.error}}return i}};return c},r={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},o={high:3,normal:2,low:1},a=function(){function e(e){this.middlewareStack=s(),this.config=e}return e.prototype.send=function(e,t,i){var n="function"!=typeof t?t:void 0,s="function"==typeof t?t:i,r=e.resolveMiddleware(this.middlewareStack,this.config,n);if(!s)return r(e).then(function(e){return e.output});r(e).then(function(e){return s(null,e.output)},function(e){return s(e)}).catch(function(){})},e.prototype.destroy=function(){this.config.requestHandler.destroy&&this.config.requestHandler.destroy()},e}(),l=function(){this.middlewareStack=s()};function c(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16)})}var h=function(){var e=Object.getPrototypeOf(this).constructor,t=new(Function.bind.apply(String,(0,n.__spread)([null],arguments)));return Object.setPrototypeOf(t,e.prototype),t};h.prototype=Object.create(String.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf(h,String),function(e){function t(){return null!==e&&e.apply(this,arguments)||this}(0,n.__extends)(t,e),t.prototype.deserializeJSON=function(){return JSON.parse(e.prototype.toString.call(this))},t.prototype.toJSON=function(){return e.prototype.toString.call(this)},t.fromObject=function(e){return e instanceof t?e:new t(e instanceof String||"string"==typeof e?e:JSON.stringify(e))}}(h)},2049(e,t,i){"use strict";i.d(t,{D:()=>s});var n=i(65927),s=function(e){var t,i=new URL(e),s=i.hostname,r=i.pathname,o=i.port,a=i.protocol,l=i.search;return l&&(t=function(e){var t,i,s={};if(e=e.replace(/^\?/,""))try{for(var r=(0,n.__values)(e.split("&")),o=r.next();!o.done;o=r.next()){var a=o.value,l=(0,n.__read)(a.split("="),2),c=l[0],h=l[1],u=void 0===h?null:h;c=decodeURIComponent(c),u&&(u=decodeURIComponent(u)),c in s?Array.isArray(s[c])?s[c].push(u):s[c]=[s[c],u]:s[c]=u}}catch(e){t={error:e}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}return s}(l)),{hostname:s,port:o?parseInt(o):void 0,protocol:a,path:r,query:t}}},68380(e,t,i){"use strict";i.d(t,{E:()=>h,n:()=>u});for(var n={},s=new Array(64),r=0,o="A".charCodeAt(0),a="Z".charCodeAt(0);r+o<=a;r++){var l=String.fromCharCode(r+o);n[l]=r,s[r]=l}for(r=0,o="a".charCodeAt(0),a="z".charCodeAt(0);r+o<=a;r++){l=String.fromCharCode(r+o);var c=r+26;n[l]=c,s[c]=l}for(r=0;r<10;r++)n[r.toString(10)]=r+52,l=r.toString(10),c=r+52,n[l]=c,s[c]=l;function h(e){var t=e.length/4*3;"=="===e.substr(-2)?t-=2:"="===e.substr(-1)&&t--;for(var i=new ArrayBuffer(t),s=new DataView(i),r=0;r<e.length;r+=4){for(var o=0,a=0,l=r,c=r+3;l<=c;l++)"="!==e[l]?(o|=n[e[l]]<<6*(c-l),a+=6):o>>=6;var h=r/4*3;o>>=a%8;for(var u=Math.floor(a/8),d=0;d<u;d++){var p=8*(u-d-1);s.setUint8(h+d,(o&255<<p)>>p)}}return new Uint8Array(i)}function u(e){for(var t="",i=0;i<e.length;i+=3){for(var n=0,r=0,o=i,a=Math.min(i+3,e.length);o<a;o++)n|=e[o]<<8*(a-o-1),r+=8;var l=Math.ceil(r/6);n<<=6*l-r;for(var c=1;c<=l;c++){var h=6*(l-c);t+=s[(n&63<<h)>>h]}t+="==".slice(0,4-l)}return t}n["+"]=62,s[62]="+",n["/"]=63,s[63]="/"},93972(e,t,i){"use strict";function n(e){if("string"==typeof e){for(var t=e.length,i=t-1;i>=0;i--){var n=e.charCodeAt(i);n>127&&n<=2047?t++:n>2047&&n<=65535&&(t+=2)}return t}return"number"==typeof e.byteLength?e.byteLength:"number"==typeof e.size?e.size:void 0}i.d(t,{n:()=>n})},93065(e,t,i){"use strict";i.d(t,{n:()=>n.n});var n=i(67520)},81504(e,t,i){"use strict";i.d(t,{n:()=>a});for(var n={},s={},r=0;r<256;r++){var o=r.toString(16).toLowerCase();1===o.length&&(o="0"+o),n[r]=o,s[o]=r}function a(e){for(var t="",i=0;i<e.byteLength;i++)t+=n[e[i]];return t}},79251(e,t,i){"use strict";i.r(t),i.d(t,{locateWindow:()=>s});const n={};function s(){return"undefined"!=typeof window?window:"undefined"!=typeof self?self:n}},2726(e,t,i){"use strict";i.d(t,{o:()=>n});var n=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,s)},s=function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}},39448(e,t,i){"use strict";i.d(t,{m:()=>o});var n=i(65927),s=i(36621),r=i.n(s),o=function(e){var t=e.serviceId,i=e.clientVersion;return function(){return(0,n.__awaiter)(void 0,void 0,void 0,function(){var e,s,o,a,l,c,h,u,d;return(0,n.__generator)(this,function(n){return e=(null===(o=null===window||void 0===window?void 0:window.navigator)||void 0===o?void 0:o.userAgent)?r().parse(window.navigator.userAgent):void 0,s=[["aws-sdk-js",i],["os/"+((null===(a=null==e?void 0:e.os)||void 0===a?void 0:a.name)||"other"),null===(l=null==e?void 0:e.os)||void 0===l?void 0:l.version],["lang/js"],["md/browser",(null!==(h=null===(c=null==e?void 0:e.browser)||void 0===c?void 0:c.name)&&void 0!==h?h:"unknown")+"_"+(null!==(d=null===(u=null==e?void 0:e.browser)||void 0===u?void 0:u.version)&&void 0!==d?d:"unknown")]],t&&s.push(["api/"+t,i]),[2,s]})})}}},94518(e,t,i){"use strict";i.r(t),i.d(t,{fromUtf8:()=>n,toUtf8:()=>s});var n=function(e){return"function"==typeof TextEncoder?function(e){return(new TextEncoder).encode(e)}(e):function(e){for(var t=[],i=0,n=e.length;i<n;i++){var s=e.charCodeAt(i);if(s<128)t.push(s);else if(s<2048)t.push(s>>6|192,63&s|128);else if(i+1<e.length&&55296==(64512&s)&&56320==(64512&e.charCodeAt(i+1))){var r=65536+((1023&s)<<10)+(1023&e.charCodeAt(++i));t.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else t.push(s>>12|224,s>>6&63|128,63&s|128)}return Uint8Array.from(t)}(e)},s=function(e){return"function"==typeof TextDecoder?function(e){return new TextDecoder("utf-8").decode(e)}(e):function(e){for(var t="",i=0,n=e.length;i<n;i++){var s=e[i];if(s<128)t+=String.fromCharCode(s);else if(192<=s&&s<224){var r=e[++i];t+=String.fromCharCode((31&s)<<6|63&r)}else if(240<=s&&s<365){var o="%"+[s,e[++i],e[++i],e[++i]].map(function(e){return e.toString(16)}).join("%");t+=decodeURIComponent(o)}else t+=String.fromCharCode((15&s)<<12|(63&e[++i])<<6|63&e[++i])}return t}(e)}},91486(e,t,i){"use strict";i.r(t),i.d(t,{fromUtf8:()=>n,toUtf8:()=>s});const n=e=>"function"==typeof TextEncoder?function(e){return(new TextEncoder).encode(e)}(e):(e=>{const t=[];for(let i=0,n=e.length;i<n;i++){const n=e.charCodeAt(i);if(n<128)t.push(n);else if(n<2048)t.push(n>>6|192,63&n|128);else if(i+1<e.length&&55296==(64512&n)&&56320==(64512&e.charCodeAt(i+1))){const s=65536+((1023&n)<<10)+(1023&e.charCodeAt(++i));t.push(s>>18|240,s>>12&63|128,s>>6&63|128,63&s|128)}else t.push(n>>12|224,n>>6&63|128,63&n|128)}return Uint8Array.from(t)})(e),s=e=>"function"==typeof TextDecoder?function(e){return new TextDecoder("utf-8").decode(e)}(e):(e=>{let t="";for(let i=0,n=e.length;i<n;i++){const n=e[i];if(n<128)t+=String.fromCharCode(n);else if(192<=n&&n<224){const s=e[++i];t+=String.fromCharCode((31&n)<<6|63&s)}else if(240<=n&&n<365){const s="%"+[n,e[++i],e[++i],e[++i]].map(e=>e.toString(16)).join("%");t+=decodeURIComponent(s)}else t+=String.fromCharCode((15&n)<<12|(63&e[++i])<<6|63&e[++i])}return t})(e)},31643(e,t,i){"use strict";i.r(t),i.d(t,{fromUtf8:()=>n,toUtf8:()=>s});var n=function(e){return"function"==typeof TextEncoder?function(e){return(new TextEncoder).encode(e)}(e):function(e){for(var t=[],i=0,n=e.length;i<n;i++){var s=e.charCodeAt(i);if(s<128)t.push(s);else if(s<2048)t.push(s>>6|192,63&s|128);else if(i+1<e.length&&55296==(64512&s)&&56320==(64512&e.charCodeAt(i+1))){var r=65536+((1023&s)<<10)+(1023&e.charCodeAt(++i));t.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else t.push(s>>12|224,s>>6&63|128,63&s|128)}return Uint8Array.from(t)}(e)},s=function(e){return"function"==typeof TextDecoder?function(e){return new TextDecoder("utf-8").decode(e)}(e):function(e){for(var t="",i=0,n=e.length;i<n;i++){var s=e[i];if(s<128)t+=String.fromCharCode(s);else if(192<=s&&s<224){var r=e[++i];t+=String.fromCharCode((31&s)<<6|63&r)}else if(240<=s&&s<365){var o="%"+[s,e[++i],e[++i],e[++i]].map(function(e){return e.toString(16)}).join("%");t+=decodeURIComponent(o)}else t+=String.fromCharCode((15&s)<<12|(63&e[++i])<<6|63&e[++i])}return t}(e)}},70381(e,t,i){e.exports={graphlib:i(55166),layout:i(79623),debug:i(10698),util:{time:i(82469).time,notime:i(82469).notime},version:i(69741)}},85933(e,t,i){"use strict";let n=i(72046),s=i(82469).uniqueId;e.exports={run:function(e){("greedy"===e.graph().acyclicer?n(e,function(e){return t=>e.edge(t).weight}(e)):function(e){let t=[],i={},n={};return e.nodes().forEach(function s(r){Object.hasOwn(n,r)||(n[r]=!0,i[r]=!0,e.outEdges(r).forEach(e=>{Object.hasOwn(i,e.w)?t.push(e):s(e.w)}),delete i[r])}),t}(e)).forEach(t=>{let i=e.edge(t);e.removeEdge(t),i.forwardName=t.name,i.reversed=!0,e.setEdge(t.w,t.v,i,s("rev"))})},undo:function(e){e.edges().forEach(t=>{let i=e.edge(t);if(i.reversed){e.removeEdge(t);let n=i.forwardName;delete i.reversed,delete i.forwardName,e.setEdge(t.w,t.v,i,n)}})}}},8328(e,t,i){let n=i(82469);function s(e,t,i,s,r,o){let a={width:0,height:0,rank:o,borderType:t},l=r[t][o-1],c=n.addDummyNode(e,"border",a,i);r[t][o]=c,e.setParent(c,s),l&&e.setEdge(l,c,{weight:1})}e.exports=function(e){e.children().forEach(function t(i){let n=e.children(i),r=e.node(i);if(n.length&&n.forEach(t),Object.hasOwn(r,"minRank")){r.borderLeft=[],r.borderRight=[];for(let t=r.minRank,n=r.maxRank+1;t<n;++t)s(e,"borderLeft","_bl",i,r,t),s(e,"borderRight","_br",i,r,t)}})}},29481(e){"use strict";function t(e){e.nodes().forEach(t=>i(e.node(t))),e.edges().forEach(t=>i(e.edge(t)))}function i(e){let t=e.width;e.width=e.height,e.height=t}function n(e){e.y=-e.y}function s(e){let t=e.x;e.x=e.y,e.y=t}e.exports={adjust:function(e){let i=e.graph().rankdir.toLowerCase();"lr"!==i&&"rl"!==i||t(e)},undo:function(e){let i=e.graph().rankdir.toLowerCase();"bt"!==i&&"rl"!==i||function(e){e.nodes().forEach(t=>n(e.node(t))),e.edges().forEach(t=>{let i=e.edge(t);i.points.forEach(n),Object.hasOwn(i,"y")&&n(i)})}(e),"lr"!==i&&"rl"!==i||(function(e){e.nodes().forEach(t=>s(e.node(t))),e.edges().forEach(t=>{let i=e.edge(t);i.points.forEach(s),Object.hasOwn(i,"x")&&s(i)})}(e),t(e))}}},78976(e){function t(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function i(e,t){if("_next"!==e&&"_prev"!==e)return t}e.exports=class{constructor(){let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,i=e._prev;if(i!==e)return t(i),i}enqueue(e){let i=this._sentinel;e._prev&&e._next&&t(e),e._next=i._next,i._next._prev=e,i._next=e,e._prev=i}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,i)),n=n._prev;return"["+e.join(", ")+"]"}}},10698(e,t,i){let n=i(82469),s=i(55166).Graph;e.exports={debugOrdering:function(e){let t=n.buildLayerMatrix(e),i=new s({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(t=>{i.setNode(t,{label:t}),i.setParent(t,"layer"+e.node(t).rank)}),e.edges().forEach(e=>i.setEdge(e.v,e.w,{},e.name)),t.forEach((e,t)=>{let n="layer"+t;i.setNode(n,{rank:"same"}),e.reduce((e,t)=>(i.setEdge(e,t,{style:"invis"}),t))}),i}}},72046(e,t,i){let n=i(55166).Graph,s=i(78976);e.exports=function(e,t){if(e.nodeCount()<=1)return[];let i=function(e,t){let i=new n,r=0,o=0;e.nodes().forEach(e=>{i.setNode(e,{v:e,in:0,out:0})}),e.edges().forEach(e=>{let n=i.edge(e.v,e.w)||0,s=t(e),a=n+s;i.setEdge(e.v,e.w,a),o=Math.max(o,i.node(e.v).out+=s),r=Math.max(r,i.node(e.w).in+=s)});let l=function(e){const t=[];for(let i=0;i<e;i++)t.push(i);return t}(o+r+3).map(()=>new s),c=r+1;return i.nodes().forEach(e=>{a(l,c,i.node(e))}),{graph:i,buckets:l,zeroIdx:c}}(e,t||r);return function(e,t,i){let n,s=[],r=t[t.length-1],a=t[0];for(;e.nodeCount();){for(;n=a.dequeue();)o(e,t,i,n);for(;n=r.dequeue();)o(e,t,i,n);if(e.nodeCount())for(let r=t.length-2;r>0;--r)if(n=t[r].dequeue(),n){s=s.concat(o(e,t,i,n,!0));break}}return s}(i.graph,i.buckets,i.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w))};let r=()=>1;function o(e,t,i,n,s){let r=s?[]:void 0;return e.inEdges(n.v).forEach(n=>{let o=e.edge(n),l=e.node(n.v);s&&r.push({v:n.v,w:n.w}),l.out-=o,a(t,i,l)}),e.outEdges(n.v).forEach(n=>{let s=e.edge(n),r=n.w,o=e.node(r);o.in-=s,a(t,i,o)}),e.removeNode(n.v),r}function a(e,t,i){i.out?i.in?e[i.out-i.in+t].enqueue(i):e[e.length-1].enqueue(i):e[0].enqueue(i)}},79623(e,t,i){"use strict";let n=i(85933),s=i(77798),r=i(83816),o=i(82469).normalizeRanks,a=i(77999),l=i(82469).removeEmptyRanks,c=i(32254),h=i(8328),u=i(29481),d=i(5354),p=i(7489),g=i(82469),f=i(55166).Graph;e.exports=function(e,t){let i=t&&t.debugTiming?g.time:g.notime;i("layout",()=>{let M=i("  buildLayoutGraph",()=>function(e){let t=new f({multigraph:!0,compound:!0}),i=A(e.graph());return t.setGraph(Object.assign({},y,E(i,m),g.pick(i,v))),e.nodes().forEach(i=>{const n=E(A(e.node(i)),b);Object.keys(C).forEach(e=>{void 0===n[e]&&(n[e]=C[e])}),t.setNode(i,n),t.setParent(i,e.parent(i))}),e.edges().forEach(i=>{let n=A(e.edge(i));t.setEdge(i,Object.assign({},S,E(n,w),g.pick(n,x)))}),t}(e));i("  runLayout",()=>function(e,t,i){t("    makeSpaceForEdgeLabels",()=>function(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(i=>{let n=e.edge(i);n.minlen*=2,"c"!==n.labelpos.toLowerCase()&&("TB"===t.rankdir||"BT"===t.rankdir?n.width+=n.labeloffset:n.height+=n.labeloffset)})}(e)),t("    removeSelfEdges",()=>function(e){e.edges().forEach(t=>{if(t.v===t.w){var i=e.node(t.v);i.selfEdges||(i.selfEdges=[]),i.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}(e)),t("    acyclic",()=>n.run(e)),t("    nestingGraph.run",()=>c.run(e)),t("    rank",()=>r(g.asNonCompoundGraph(e))),t("    injectEdgeLabelProxies",()=>function(e){e.edges().forEach(t=>{let i=e.edge(t);if(i.width&&i.height){let i=e.node(t.v),n={rank:(e.node(t.w).rank-i.rank)/2+i.rank,e:t};g.addDummyNode(e,"edge-proxy",n,"_ep")}})}(e)),t("    removeEmptyRanks",()=>l(e)),t("    nestingGraph.cleanup",()=>c.cleanup(e)),t("    normalizeRanks",()=>o(e)),t("    assignRankMinMax",()=>function(e){let t=0;e.nodes().forEach(i=>{let n=e.node(i);n.borderTop&&(n.minRank=e.node(n.borderTop).rank,n.maxRank=e.node(n.borderBottom).rank,t=Math.max(t,n.maxRank))}),e.graph().maxRank=t}(e)),t("    removeEdgeLabelProxies",()=>function(e){e.nodes().forEach(t=>{let i=e.node(t);"edge-proxy"===i.dummy&&(e.edge(i.e).labelRank=i.rank,e.removeNode(t))})}(e)),t("    normalize.run",()=>s.run(e)),t("    parentDummyChains",()=>a(e)),t("    addBorderSegments",()=>h(e)),t("    order",()=>d(e,i)),t("    insertSelfEdges",()=>function(e){g.buildLayerMatrix(e).forEach(t=>{var i=0;t.forEach((t,n)=>{var s=e.node(t);s.order=n+i,(s.selfEdges||[]).forEach(t=>{g.addDummyNode(e,"selfedge",{width:t.label.width,height:t.label.height,rank:s.rank,order:n+ ++i,e:t.e,label:t.label},"_se")}),delete s.selfEdges})})}(e)),t("    adjustCoordinateSystem",()=>u.adjust(e)),t("    position",()=>p(e)),t("    positionSelfEdges",()=>function(e){e.nodes().forEach(t=>{var i=e.node(t);if("selfedge"===i.dummy){var n=e.node(i.e.v),s=n.x+n.width/2,r=n.y,o=i.x-s,a=n.height/2;e.setEdge(i.e,i.label),e.removeNode(t),i.label.points=[{x:s+2*o/3,y:r-a},{x:s+5*o/6,y:r-a},{x:s+o,y:r},{x:s+5*o/6,y:r+a},{x:s+2*o/3,y:r+a}],i.label.x=i.x,i.label.y=i.y}})}(e)),t("    removeBorderNodes",()=>function(e){e.nodes().forEach(t=>{if(e.children(t).length){let i=e.node(t),n=e.node(i.borderTop),s=e.node(i.borderBottom),r=e.node(i.borderLeft[i.borderLeft.length-1]),o=e.node(i.borderRight[i.borderRight.length-1]);i.width=Math.abs(o.x-r.x),i.height=Math.abs(s.y-n.y),i.x=r.x+i.width/2,i.y=n.y+i.height/2}}),e.nodes().forEach(t=>{"border"===e.node(t).dummy&&e.removeNode(t)})}(e)),t("    normalize.undo",()=>s.undo(e)),t("    fixupEdgeLabelCoords",()=>function(e){e.edges().forEach(t=>{let i=e.edge(t);if(Object.hasOwn(i,"x"))switch("l"!==i.labelpos&&"r"!==i.labelpos||(i.width-=i.labeloffset),i.labelpos){case"l":i.x-=i.width/2+i.labeloffset;break;case"r":i.x+=i.width/2+i.labeloffset}})}(e)),t("    undoCoordinateSystem",()=>u.undo(e)),t("    translateGraph",()=>function(e){let t=Number.POSITIVE_INFINITY,i=0,n=Number.POSITIVE_INFINITY,s=0,r=e.graph(),o=r.marginx||0,a=r.marginy||0;function l(e){let r=e.x,o=e.y,a=e.width,l=e.height;t=Math.min(t,r-a/2),i=Math.max(i,r+a/2),n=Math.min(n,o-l/2),s=Math.max(s,o+l/2)}e.nodes().forEach(t=>l(e.node(t))),e.edges().forEach(t=>{let i=e.edge(t);Object.hasOwn(i,"x")&&l(i)}),t-=o,n-=a,e.nodes().forEach(i=>{let s=e.node(i);s.x-=t,s.y-=n}),e.edges().forEach(i=>{let s=e.edge(i);s.points.forEach(e=>{e.x-=t,e.y-=n}),Object.hasOwn(s,"x")&&(s.x-=t),Object.hasOwn(s,"y")&&(s.y-=n)}),r.width=i-t+o,r.height=s-n+a}(e)),t("    assignNodeIntersects",()=>function(e){e.edges().forEach(t=>{let i,n,s=e.edge(t),r=e.node(t.v),o=e.node(t.w);s.points?(i=s.points[0],n=s.points[s.points.length-1]):(s.points=[],i=o,n=r),s.points.unshift(g.intersectRect(r,i)),s.points.push(g.intersectRect(o,n))})}(e)),t("    reversePoints",()=>function(e){e.edges().forEach(t=>{let i=e.edge(t);i.reversed&&i.points.reverse()})}(e)),t("    acyclic.undo",()=>n.undo(e))}(M,i,t)),i("  updateInputGraph",()=>function(e,t){e.nodes().forEach(i=>{let n=e.node(i),s=t.node(i);n&&(n.x=s.x,n.y=s.y,n.rank=s.rank,t.children(i).length&&(n.width=s.width,n.height=s.height))}),e.edges().forEach(i=>{let n=e.edge(i),s=t.edge(i);n.points=s.points,Object.hasOwn(s,"x")&&(n.x=s.x,n.y=s.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}(e,M))})};let m=["nodesep","edgesep","ranksep","marginx","marginy"],y={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},v=["acyclicer","ranker","rankdir","align"],b=["width","height","rank"],C={width:0,height:0},w=["minlen","weight","width","height","labeloffset"],S={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},x=["labelpos"];function E(e,t){return g.mapValues(g.pick(e,t),Number)}function A(e){var t={};return e&&Object.entries(e).forEach(([e,i])=>{"string"==typeof e&&(e=e.toLowerCase()),t[e]=i}),t}},32254(e,t,i){let n=i(82469);function s(e,t,i,r,o,a,l){let c=e.children(l);if(!c.length)return void(l!==t&&e.setEdge(t,l,{weight:0,minlen:i}));let h=n.addBorderNode(e,"_bt"),u=n.addBorderNode(e,"_bb"),d=e.node(l);e.setParent(h,l),d.borderTop=h,e.setParent(u,l),d.borderBottom=u,c.forEach(n=>{s(e,t,i,r,o,a,n);let c=e.node(n),d=c.borderTop?c.borderTop:n,p=c.borderBottom?c.borderBottom:n,g=c.borderTop?r:2*r,f=d!==p?1:o-a[l]+1;e.setEdge(h,d,{weight:g,minlen:f,nestingEdge:!0}),e.setEdge(p,u,{weight:g,minlen:f,nestingEdge:!0})}),e.parent(l)||e.setEdge(t,h,{weight:0,minlen:o+a[l]})}e.exports={run:function(e){let t=n.addDummyNode(e,"root",{},"_root"),i=function(e){var t={};function i(n,s){var r=e.children(n);r&&r.length&&r.forEach(e=>i(e,s+1)),t[n]=s}return e.children().forEach(e=>i(e,1)),t}(e),r=Object.values(i),o=n.applyWithChunking(Math.max,r)-1,a=2*o+1;e.graph().nestingRoot=t,e.edges().forEach(t=>e.edge(t).minlen*=a);let l=function(e){return e.edges().reduce((t,i)=>t+e.edge(i).weight,0)}(e)+1;e.children().forEach(n=>s(e,t,a,l,o,i,n)),e.graph().nodeRankFactor=a},cleanup:function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}}},77798(e,t,i){"use strict";let n=i(82469);e.exports={run:function(e){e.graph().dummyChains=[],e.edges().forEach(t=>function(e,t){let i,s,r,o=t.v,a=e.node(o).rank,l=t.w,c=e.node(l).rank,h=t.name,u=e.edge(t),d=u.labelRank;if(c!==a+1){for(e.removeEdge(t),r=0,++a;a<c;++r,++a)u.points=[],s={width:0,height:0,edgeLabel:u,edgeObj:t,rank:a},i=n.addDummyNode(e,"edge",s,"_d"),a===d&&(s.width=u.width,s.height=u.height,s.dummy="edge-label",s.labelpos=u.labelpos),e.setEdge(o,i,{weight:u.weight},h),0===r&&e.graph().dummyChains.push(i),o=i;e.setEdge(o,l,{weight:u.weight},h)}}(e,t))},undo:function(e){e.graph().dummyChains.forEach(t=>{let i,n=e.node(t),s=n.edgeLabel;for(e.setEdge(n.edgeObj,s);n.dummy;)i=e.successors(t)[0],e.removeNode(t),s.points.push({x:n.x,y:n.y}),"edge-label"===n.dummy&&(s.x=n.x,s.y=n.y,s.width=n.width,s.height=n.height),t=i,n=e.node(t)})}}},6281(e){e.exports=function(e,t,i){let n,s={};i.forEach(i=>{let r,o,a=e.parent(i);for(;a;){if(r=e.parent(a),r?(o=s[r],s[r]=a):(o=n,n=a),o&&o!==a)return void t.setEdge(o,a);a=r}})}},21213(e){e.exports=function(e,t=[]){return t.map(t=>{let i=e.inEdges(t);if(i.length){let n=i.reduce((t,i)=>{let n=e.edge(i),s=e.node(i.v);return{sum:t.sum+n.weight*s.order,weight:t.weight+n.weight}},{sum:0,weight:0});return{v:t,barycenter:n.sum/n.weight,weight:n.weight}}return{v:t}})}},96703(e,t,i){let n=i(55166).Graph,s=i(82469);e.exports=function(e,t,i){let r=function(e){for(var t;e.hasNode(t=s.uniqueId("_root")););return t}(e),o=new n({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(t=>e.node(t));return e.nodes().forEach(n=>{let s=e.node(n),a=e.parent(n);(s.rank===t||s.minRank<=t&&t<=s.maxRank)&&(o.setNode(n),o.setParent(n,a||r),e[i](n).forEach(t=>{let i=t.v===n?t.w:t.v,s=o.edge(i,n),r=void 0!==s?s.weight:0;o.setEdge(i,n,{weight:e.edge(t).weight+r})}),Object.hasOwn(s,"minRank")&&o.setNode(n,{borderLeft:s.borderLeft[t],borderRight:s.borderRight[t]}))}),o}},28304(e,t,i){"use strict";let n=i(82469).zipObject;function s(e,t,i){let s=n(i,i.map((e,t)=>t)),r=t.flatMap(t=>e.outEdges(t).map(t=>({pos:s[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos)),o=1;for(;o<i.length;)o<<=1;let a=2*o-1;o-=1;let l=new Array(a).fill(0),c=0;return r.forEach(e=>{let t=e.pos+o;l[t]+=e.weight;let i=0;for(;t>0;)t%2&&(i+=l[t+1]),t=t-1>>1,l[t]+=e.weight;c+=e.weight*i}),c}e.exports=function(e,t){let i=0;for(let n=1;n<t.length;++n)i+=s(e,t[n-1],t[n]);return i}},5354(e,t,i){"use strict";let n=i(15612),s=i(28304),r=i(93315),o=i(96703),a=i(6281),l=i(55166).Graph,c=i(82469);function h(e,t,i){return t.map(function(t){return o(e,t,i)})}function u(e,t){let i=new l;e.forEach(function(e){let n=e.graph().root,s=r(e,n,i,t);s.vs.forEach((t,i)=>e.node(t).order=i),a(e,i,s.vs)})}function d(e,t){Object.values(t).forEach(t=>t.forEach((t,i)=>e.node(t).order=i))}e.exports=function e(t,i){if(i&&"function"==typeof i.customOrder)return void i.customOrder(t,e);let r=c.maxRank(t),o=h(t,c.range(1,r+1),"inEdges"),a=h(t,c.range(r-1,-1,-1),"outEdges"),l=n(t);if(d(t,l),i&&i.disableOptimalOrderHeuristic)return;let p,g=Number.POSITIVE_INFINITY;for(let e=0,i=0;i<4;++e,++i){u(e%2?o:a,e%4>=2),l=c.buildLayerMatrix(t);let n=s(t,l);n<g&&(i=0,p=Object.assign({},l),g=n)}d(t,p)}},15612(e,t,i){"use strict";let n=i(82469);e.exports=function(e){let t={},i=e.nodes().filter(t=>!e.children(t).length),s=i.map(t=>e.node(t).rank),r=n.applyWithChunking(Math.max,s),o=n.range(r+1).map(()=>[]);return i.sort((t,i)=>e.node(t).rank-e.node(i).rank).forEach(function i(n){if(t[n])return;t[n]=!0;let s=e.node(n);o[s.rank].push(n),e.successors(n).forEach(i)}),o}},7216(e,t,i){"use strict";let n=i(82469);e.exports=function(e,t){let i={};return e.forEach((e,t)=>{let n=i[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};void 0!==e.barycenter&&(n.barycenter=e.barycenter,n.weight=e.weight)}),t.edges().forEach(e=>{let t=i[e.v],n=i[e.w];void 0!==t&&void 0!==n&&(n.indegree++,t.out.push(i[e.w]))}),function(e){let t=[];function i(e){return t=>{t.merged||(void 0===t.barycenter||void 0===e.barycenter||t.barycenter>=e.barycenter)&&function(e,t){let i=0,n=0;e.weight&&(i+=e.barycenter*e.weight,n+=e.weight),t.weight&&(i+=t.barycenter*t.weight,n+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=i/n,e.weight=n,e.i=Math.min(t.i,e.i),t.merged=!0}(e,t)}}function s(t){return i=>{i.in.push(t),0===--i.indegree&&e.push(i)}}for(;e.length;){let n=e.pop();t.push(n),n.in.reverse().forEach(i(n)),n.out.forEach(s(n))}return t.filter(e=>!e.merged).map(e=>n.pick(e,["vs","i","barycenter","weight"]))}(Object.values(i).filter(e=>!e.indegree))}},93315(e,t,i){let n=i(21213),s=i(7216),r=i(31112);e.exports=function e(t,i,o,a){let l=t.children(i),c=t.node(i),h=c?c.borderLeft:void 0,u=c?c.borderRight:void 0,d={};h&&(l=l.filter(e=>e!==h&&e!==u));let p=n(t,l);p.forEach(i=>{if(t.children(i.v).length){let r=e(t,i.v,o,a);d[i.v]=r,Object.hasOwn(r,"barycenter")&&(s=r,void 0!==(n=i).barycenter?(n.barycenter=(n.barycenter*n.weight+s.barycenter*s.weight)/(n.weight+s.weight),n.weight+=s.weight):(n.barycenter=s.barycenter,n.weight=s.weight))}var n,s});let g=s(p,o);!function(e,t){e.forEach(e=>{e.vs=e.vs.flatMap(e=>t[e]?t[e].vs:e)})}(g,d);let f=r(g,a);if(h&&(f.vs=[h,f.vs,u].flat(!0),t.predecessors(h).length)){let e=t.node(t.predecessors(h)[0]),i=t.node(t.predecessors(u)[0]);Object.hasOwn(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+e.order+i.order)/(f.weight+2),f.weight+=2}return f}},31112(e,t,i){let n=i(82469);function s(e,t,i){let n;for(;t.length&&(n=t[t.length-1]).i<=i;)t.pop(),e.push(n.vs),i++;return i}e.exports=function(e,t){let i=n.partition(e,e=>Object.hasOwn(e,"barycenter")),r=i.lhs,o=i.rhs.sort((e,t)=>t.i-e.i),a=[],l=0,c=0,h=0;var u;r.sort((u=!!t,(e,t)=>e.barycenter<t.barycenter?-1:e.barycenter>t.barycenter?1:u?t.i-e.i:e.i-t.i)),h=s(a,o,h),r.forEach(e=>{h+=e.vs.length,a.push(e.vs),l+=e.barycenter*e.weight,c+=e.weight,h=s(a,o,h)});let d={vs:a.flat(!0)};return c&&(d.barycenter=l/c,d.weight=c),d}},77999(e){e.exports=function(e){let t=function(e){let t={},i=0;return e.children().forEach(function n(s){let r=i;e.children(s).forEach(n),t[s]={low:r,lim:i++}}),t}(e);e.graph().dummyChains.forEach(i=>{let n=e.node(i),s=n.edgeObj,r=function(e,t,i,n){let s,r,o=[],a=[],l=Math.min(t[i].low,t[n].low),c=Math.max(t[i].lim,t[n].lim);s=i;do{s=e.parent(s),o.push(s)}while(s&&(t[s].low>l||c>t[s].lim));for(r=s,s=n;(s=e.parent(s))!==r;)a.push(s);return{path:o.concat(a.reverse()),lca:r}}(e,t,s.v,s.w),o=r.path,a=r.lca,l=0,c=o[l],h=!0;for(;i!==s.w;){if(n=e.node(i),h){for(;(c=o[l])!==a&&e.node(c).maxRank<n.rank;)l++;c===a&&(h=!1)}if(!h){for(;l<o.length-1&&e.node(c=o[l+1]).minRank<=n.rank;)l++;c=o[l]}e.setParent(i,c),i=e.successors(i)[0]}})}},95101(e,t,i){"use strict";let n=i(55166).Graph,s=i(82469);function r(e,t){let i={};return t.length&&t.reduce(function(t,n){let s=0,r=0,o=t.length,l=n[n.length-1];return n.forEach((t,c)=>{let h=function(e,t){if(e.node(t).dummy)return e.predecessors(t).find(t=>e.node(t).dummy)}(e,t),u=h?e.node(h).order:o;(h||t===l)&&(n.slice(r,c+1).forEach(t=>{e.predecessors(t).forEach(n=>{let r=e.node(n),o=r.order;!(o<s||u<o)||r.dummy&&e.node(t).dummy||a(i,n,t)})}),r=c+1,s=u)}),n}),i}function o(e,t){let i={};function n(t,n,r,o,l){let c;s.range(n,r).forEach(n=>{c=t[n],e.node(c).dummy&&e.predecessors(c).forEach(t=>{let n=e.node(t);n.dummy&&(n.order<o||n.order>l)&&a(i,t,c)})})}return t.length&&t.reduce(function(t,i){let s,r=-1,o=0;return i.forEach((a,l)=>{if("border"===e.node(a).dummy){let t=e.predecessors(a);t.length&&(s=e.node(t[0]).order,n(i,o,l,r,s),o=l,r=s)}n(i,o,i.length,s,t.length)}),i}),i}function a(e,t,i){if(t>i){let e=t;t=i,i=e}let n=e[t];n||(e[t]=n={}),n[i]=!0}function l(e,t,i){if(t>i){let e=t;t=i,i=e}return!!e[t]&&Object.hasOwn(e[t],i)}function c(e,t,i,n){let s={},r={},o={};return t.forEach(e=>{e.forEach((e,t)=>{s[e]=e,r[e]=e,o[e]=t})}),t.forEach(e=>{let t=-1;e.forEach(e=>{let a=n(e);if(a.length){a=a.sort((e,t)=>o[e]-o[t]);let n=(a.length-1)/2;for(let c=Math.floor(n),h=Math.ceil(n);c<=h;++c){let n=a[c];r[e]===e&&t<o[n]&&!l(i,e,n)&&(r[n]=e,r[e]=s[e]=s[n],t=o[n])}}})}),{root:s,align:r}}function h(e,t,i,s,r){let o={},a=function(e,t,i,s){let r=new n,o=e.graph(),a=function(e,t,i){return(n,s,r)=>{let o,a=n.node(s),l=n.node(r),c=0;if(c+=a.width/2,Object.hasOwn(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":o=-a.width/2;break;case"r":o=a.width/2}if(o&&(c+=i?o:-o),o=0,c+=(a.dummy?t:e)/2,c+=(l.dummy?t:e)/2,c+=l.width/2,Object.hasOwn(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":o=l.width/2;break;case"r":o=-l.width/2}return o&&(c+=i?o:-o),o=0,c}}(o.nodesep,o.edgesep,s);return t.forEach(t=>{let n;t.forEach(t=>{let s=i[t];if(r.setNode(s),n){var o=i[n],l=r.edge(o,s);r.setEdge(o,s,Math.max(a(e,t,n),l||0))}n=t})}),r}(e,t,i,r),l=r?"borderLeft":"borderRight";function c(e,t){let i=a.nodes(),n=i.pop(),s={};for(;n;)s[n]?e(n):(s[n]=!0,i.push(n),i=i.concat(t(n))),n=i.pop()}return c(function(e){o[e]=a.inEdges(e).reduce((e,t)=>Math.max(e,o[t.v]+a.edge(t)),0)},a.predecessors.bind(a)),c(function(t){let i=a.outEdges(t).reduce((e,t)=>Math.min(e,o[t.w]-a.edge(t)),Number.POSITIVE_INFINITY),n=e.node(t);i!==Number.POSITIVE_INFINITY&&n.borderType!==l&&(o[t]=Math.max(o[t],i))},a.successors.bind(a)),Object.keys(s).forEach(e=>o[e]=o[i[e]]),o}function u(e,t){return Object.values(t).reduce((t,i)=>{let n=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY;Object.entries(i).forEach(([t,i])=>{let r=function(e,t){return e.node(t).width}(e,t)/2;n=Math.max(i+r,n),s=Math.min(i-r,s)});const r=n-s;return r<t[0]&&(t=[r,i]),t},[Number.POSITIVE_INFINITY,null])[1]}function d(e,t){let i=Object.values(t),n=s.applyWithChunking(Math.min,i),r=s.applyWithChunking(Math.max,i);["u","d"].forEach(i=>{["l","r"].forEach(o=>{let a=i+o,l=e[a];if(l===t)return;let c=Object.values(l),h=n-s.applyWithChunking(Math.min,c);"l"!==o&&(h=r-s.applyWithChunking(Math.max,c)),h&&(e[a]=s.mapValues(l,e=>e+h))})})}function p(e,t){return s.mapValues(e.ul,(i,n)=>{if(t)return e[t.toLowerCase()][n];{let t=Object.values(e).map(e=>e[n]).sort((e,t)=>e-t);return(t[1]+t[2])/2}})}e.exports={positionX:function(e){let t,i=s.buildLayerMatrix(e),n=Object.assign(r(e,i),o(e,i)),a={};["u","d"].forEach(r=>{t="u"===r?i:Object.values(i).reverse(),["l","r"].forEach(i=>{"r"===i&&(t=t.map(e=>Object.values(e).reverse()));let o=("u"===r?e.predecessors:e.successors).bind(e),l=c(0,t,n,o),u=h(e,t,l.root,l.align,"r"===i);"r"===i&&(u=s.mapValues(u,e=>-e)),a[r+i]=u})});let l=u(e,a);return d(a,l),p(a,e.graph().align)},findType1Conflicts:r,findType2Conflicts:o,addConflict:a,hasConflict:l,verticalAlignment:c,horizontalCompaction:h,alignCoordinates:d,findSmallestWidthAlignment:u,balance:p}},7489(e,t,i){"use strict";let n=i(82469),s=i(95101).positionX;e.exports=function(e){(function(e){let t=n.buildLayerMatrix(e),i=e.graph().ranksep,s=0;t.forEach(t=>{const n=t.reduce((t,i)=>{const n=e.node(i).height;return t>n?t:n},0);t.forEach(t=>e.node(t).y=s+n/2),s+=n+i})})(e=n.asNonCompoundGraph(e)),Object.entries(s(e)).forEach(([t,i])=>e.node(t).x=i)}},44503(e,t,i){"use strict";var n=i(55166).Graph,s=i(74354).slack;function r(e,t){return e.nodes().forEach(function i(n){t.nodeEdges(n).forEach(r=>{var o=r.v,a=n===o?r.w:o;e.hasNode(a)||s(t,r)||(e.setNode(a,{}),e.setEdge(n,a,{}),i(a))})}),e.nodeCount()}function o(e,t){return t.edges().reduce((i,n)=>{let r=Number.POSITIVE_INFINITY;return e.hasNode(n.v)!==e.hasNode(n.w)&&(r=s(t,n)),r<i[0]?[r,n]:i},[Number.POSITIVE_INFINITY,null])[1]}function a(e,t,i){e.nodes().forEach(e=>t.node(e).rank+=i)}e.exports=function(e){var t,i,l=new n({directed:!1}),c=e.nodes()[0],h=e.nodeCount();for(l.setNode(c,{});r(l,e)<h;)t=o(l,e),i=l.hasNode(t.v)?s(e,t):-s(e,t),a(l,e,i);return l}},83816(e,t,i){"use strict";var n=i(74354).longestPath,s=i(44503),r=i(48641);e.exports=function(e){var t=e.graph().ranker;if(t instanceof Function)return t(e);switch(e.graph().ranker){case"network-simplex":default:!function(e){r(e)}(e);break;case"tight-tree":!function(e){n(e),s(e)}(e);break;case"longest-path":o(e);case"none":}};var o=n},48641(e,t,i){"use strict";var n=i(44503),s=i(74354).slack,r=i(74354).longestPath,o=i(55166).alg.preorder,a=i(55166).alg.postorder,l=i(82469).simplify;function c(e){e=l(e),r(e);var t,i=n(e);for(d(i),h(i,e);t=g(i);)m(i,e,t,f(i,e,t))}function h(e,t){var i=a(e,e.nodes());(i=i.slice(0,i.length-1)).forEach(i=>function(e,t,i){var n=e.node(i).parent;e.edge(i,n).cutvalue=u(e,t,i)}(e,t,i))}function u(e,t,i){var n=e.node(i).parent,s=!0,r=t.edge(i,n),o=0;return r||(s=!1,r=t.edge(n,i)),o=r.weight,t.nodeEdges(i).forEach(r=>{var a,l,c=r.v===i,h=c?r.w:r.v;if(h!==n){var u=c===s,d=t.edge(r).weight;if(o+=u?d:-d,a=i,l=h,e.hasEdge(a,l)){var p=e.edge(i,h).cutvalue;o+=u?-p:p}}}),o}function d(e,t){arguments.length<2&&(t=e.nodes()[0]),p(e,{},1,t)}function p(e,t,i,n,s){var r=i,o=e.node(n);return t[n]=!0,e.neighbors(n).forEach(s=>{Object.hasOwn(t,s)||(i=p(e,t,i,s,n))}),o.low=r,o.lim=i++,s?o.parent=s:delete o.parent,i}function g(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function f(e,t,i){var n=i.v,r=i.w;t.hasEdge(n,r)||(n=i.w,r=i.v);var o=e.node(n),a=e.node(r),l=o,c=!1;o.lim>a.lim&&(l=a,c=!0);var h=t.edges().filter(t=>c===y(0,e.node(t.v),l)&&c!==y(0,e.node(t.w),l));return h.reduce((e,i)=>s(t,i)<s(t,e)?i:e)}function m(e,t,i,n){var s=i.v,r=i.w;e.removeEdge(s,r),e.setEdge(n.v,n.w,{}),d(e),h(e,t),function(e,t){var i=e.nodes().find(e=>!t.node(e).parent),n=o(e,i);(n=n.slice(1)).forEach(i=>{var n=e.node(i).parent,s=t.edge(i,n),r=!1;s||(s=t.edge(n,i),r=!0),t.node(i).rank=t.node(n).rank+(r?s.minlen:-s.minlen)})}(e,t)}function y(e,t,i){return i.low<=t.lim&&t.lim<=i.lim}e.exports=c,c.initLowLimValues=d,c.initCutValues=h,c.calcCutValue=u,c.leaveEdge=g,c.enterEdge=f,c.exchangeEdges=m},74354(e,t,i){"use strict";const{applyWithChunking:n}=i(82469);e.exports={longestPath:function(e){var t={};e.sources().forEach(function i(s){var r=e.node(s);if(Object.hasOwn(t,s))return r.rank;t[s]=!0;let o=e.outEdges(s).map(t=>null==t?Number.POSITIVE_INFINITY:i(t.w)-e.edge(t).minlen);var a=n(Math.min,o);return a===Number.POSITIVE_INFINITY&&(a=0),r.rank=a})},slack:function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}},82469(e,t,i){"use strict";let n=i(55166).Graph;function s(e,t,i,n){for(var s=n;e.hasNode(s);)s=l(n);return i.dummy=t,e.setNode(s,i),s}e.exports={addBorderNode:function(e,t,i,n){let r={width:0,height:0};return arguments.length>=4&&(r.rank=i,r.order=n),s(e,"border",r,t)},addDummyNode:s,applyWithChunking:r,asNonCompoundGraph:function(e){let t=new n({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(i=>{e.children(i).length||t.setNode(i,e.node(i))}),e.edges().forEach(i=>{t.setEdge(i,e.edge(i))}),t},buildLayerMatrix:function(e){let t=c(o(e)+1).map(()=>[]);return e.nodes().forEach(i=>{let n=e.node(i),s=n.rank;void 0!==s&&(t[s][n.order]=i)}),t},intersectRect:function(e,t){let i,n,s=e.x,r=e.y,o=t.x-s,a=t.y-r,l=e.width/2,c=e.height/2;if(!o&&!a)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(a)*l>Math.abs(o)*c?(a<0&&(c=-c),i=c*o/a,n=c):(o<0&&(l=-l),i=l,n=l*a/o),{x:s+i,y:r+n}},mapValues:function(e,t){let i=t;return"string"==typeof t&&(i=e=>e[t]),Object.entries(e).reduce((e,[t,n])=>(e[t]=i(n,t),e),{})},maxRank:o,normalizeRanks:function(e){let t=e.nodes().map(t=>{let i=e.node(t).rank;return void 0===i?Number.MAX_VALUE:i}),i=r(Math.min,t);e.nodes().forEach(t=>{let n=e.node(t);Object.hasOwn(n,"rank")&&(n.rank-=i)})},notime:function(e,t){return t()},partition:function(e,t){let i={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?i.lhs.push(e):i.rhs.push(e)}),i},pick:function(e,t){const i={};for(const n of t)void 0!==e[n]&&(i[n]=e[n]);return i},predecessorWeights:function(e){let t=e.nodes().map(t=>{let i={};return e.inEdges(t).forEach(t=>{i[t.v]=(i[t.v]||0)+e.edge(t).weight}),i});return h(e.nodes(),t)},range:c,removeEmptyRanks:function(e){let t=e.nodes().map(t=>e.node(t).rank),i=r(Math.min,t),n=[];e.nodes().forEach(t=>{let s=e.node(t).rank-i;n[s]||(n[s]=[]),n[s].push(t)});let s=0,o=e.graph().nodeRankFactor;Array.from(n).forEach((t,i)=>{void 0===t&&i%o!==0?--s:void 0!==t&&s&&t.forEach(t=>e.node(t).rank+=s)})},simplify:function(e){let t=(new n).setGraph(e.graph());return e.nodes().forEach(i=>t.setNode(i,e.node(i))),e.edges().forEach(i=>{let n=t.edge(i.v,i.w)||{weight:0,minlen:1},s=e.edge(i);t.setEdge(i.v,i.w,{weight:n.weight+s.weight,minlen:Math.max(n.minlen,s.minlen)})}),t},successorWeights:function(e){let t=e.nodes().map(t=>{let i={};return e.outEdges(t).forEach(t=>{i[t.w]=(i[t.w]||0)+e.edge(t).weight}),i});return h(e.nodes(),t)},time:function(e,t){let i=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-i)+"ms")}},uniqueId:l,zipObject:h};function r(e,t){if(t.length>65535){const i=function(e,t=65535){const i=[];for(let n=0;n<e.length;n+=t){const s=e.slice(n,n+t);i.push(s)}return i}(t);return e.apply(null,i.map(t=>e.apply(null,t)))}return e.apply(null,t)}function o(e){const t=e.nodes().map(t=>{let i=e.node(t).rank;return void 0===i?Number.MIN_VALUE:i});return r(Math.max,t)}let a=0;function l(e){return e+""+ ++a}function c(e,t,i=1){null==t&&(t=e,e=0);let n=e=>e<t;i<0&&(n=e=>t<e);const s=[];for(let t=e;n(t);t+=i)s.push(t);return s}function h(e,t){return e.reduce((e,i,n)=>(e[i]=t[n],e),{})}},69741(e){e.exports="1.1.5"},55166(e,t,i){var n=i(72482);e.exports={Graph:n.Graph,json:i(73082),alg:i(42703),version:n.version}},55783(e){e.exports=function(e){var t,i={},n=[];function s(n){Object.hasOwn(i,n)||(i[n]=!0,t.push(n),e.successors(n).forEach(s),e.predecessors(n).forEach(s))}return e.nodes().forEach(function(e){t=[],s(e),t.length&&n.push(t)}),n}},10400(e){function t(e,t,i,s){for(var r=[[e,!1]];r.length>0;){var o=r.pop();o[1]?s.push(o[0]):Object.hasOwn(i,o[0])||(i[o[0]]=!0,r.push([o[0],!0]),n(t(o[0]),e=>r.push([e,!1])))}}function i(e,t,i,s){for(var r=[e];r.length>0;){var o=r.pop();Object.hasOwn(i,o)||(i[o]=!0,s.push(o),n(t(o),e=>r.push(e)))}}function n(e,t){for(var i=e.length;i--;)t(e[i],i,e);return e}e.exports=function(e,n,s){Array.isArray(n)||(n=[n]);var r=e.isDirected()?t=>e.successors(t):t=>e.neighbors(t),o="post"===s?t:i,a=[],l={};return n.forEach(t=>{if(!e.hasNode(t))throw new Error("Graph does not have node: "+t);o(t,r,l,a)}),a}},32843(e,t,i){var n=i(59349);e.exports=function(e,t,i){return e.nodes().reduce(function(s,r){return s[r]=n(e,r,t,i),s},{})}},59349(e,t,i){var n=i(52821);e.exports=function(e,t,i,r){return function(e,t,i,s){var r,o,a={},l=new n,c=function(e){var t=e.v!==r?e.v:e.w,n=a[t],s=i(e),c=o.distance+s;if(s<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+s);c<n.distance&&(n.distance=c,n.predecessor=r,l.decrease(t,c))};for(e.nodes().forEach(function(e){var i=e===t?0:Number.POSITIVE_INFINITY;a[e]={distance:i},l.add(e,i)});l.size()>0&&(r=l.removeMin(),(o=a[r]).distance!==Number.POSITIVE_INFINITY);)s(r).forEach(c);return a}(e,String(t),i||s,r||function(t){return e.outEdges(t)})};var s=()=>1},57706(e,t,i){var n=i(52495);e.exports=function(e){return n(e).filter(function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])})}},85298(e){e.exports=function(e,i,n){return function(e,t,i){var n={},s=e.nodes();return s.forEach(function(e){n[e]={},n[e][e]={distance:0},s.forEach(function(t){e!==t&&(n[e][t]={distance:Number.POSITIVE_INFINITY})}),i(e).forEach(function(i){var s=i.v===e?i.w:i.v,r=t(i);n[e][s]={distance:r,predecessor:e}})}),s.forEach(function(e){var t=n[e];s.forEach(function(i){var r=n[i];s.forEach(function(i){var n=r[e],s=t[i],o=r[i],a=n.distance+s.distance;a<o.distance&&(o.distance=a,o.predecessor=s.predecessor)})})}),n}(e,i||t,n||function(t){return e.outEdges(t)})};var t=()=>1},42703(e,t,i){e.exports={components:i(55783),dijkstra:i(59349),dijkstraAll:i(32843),findCycles:i(57706),floydWarshall:i(85298),isAcyclic:i(20574),postorder:i(26385),preorder:i(35103),prim:i(8523),tarjan:i(52495),topsort:i(81412)}},20574(e,t,i){var n=i(81412);e.exports=function(e){try{n(e)}catch(e){if(e instanceof n.CycleException)return!1;throw e}return!0}},26385(e,t,i){var n=i(10400);e.exports=function(e,t){return n(e,t,"post")}},35103(e,t,i){var n=i(10400);e.exports=function(e,t){return n(e,t,"pre")}},8523(e,t,i){var n=i(76234),s=i(52821);e.exports=function(e,t){var i,r=new n,o={},a=new s;function l(e){var n=e.v===i?e.w:e.v,s=a.priority(n);if(void 0!==s){var r=t(e);r<s&&(o[n]=i,a.decrease(n,r))}}if(0===e.nodeCount())return r;e.nodes().forEach(function(e){a.add(e,Number.POSITIVE_INFINITY),r.setNode(e)}),a.decrease(e.nodes()[0],0);for(var c=!1;a.size()>0;){if(i=a.removeMin(),Object.hasOwn(o,i))r.setEdge(i,o[i]);else{if(c)throw new Error("Input graph is not connected: "+e);c=!0}e.nodeEdges(i).forEach(l)}return r}},52495(e){e.exports=function(e){var t=0,i=[],n={},s=[];function r(o){var a=n[o]={onStack:!0,lowlink:t,index:t++};if(i.push(o),e.successors(o).forEach(function(e){Object.hasOwn(n,e)?n[e].onStack&&(a.lowlink=Math.min(a.lowlink,n[e].index)):(r(e),a.lowlink=Math.min(a.lowlink,n[e].lowlink))}),a.lowlink===a.index){var l,c=[];do{l=i.pop(),n[l].onStack=!1,c.push(l)}while(o!==l);s.push(c)}}return e.nodes().forEach(function(e){Object.hasOwn(n,e)||r(e)}),s}},81412(e){function t(e){var t={},n={},s=[];if(e.sinks().forEach(function r(o){if(Object.hasOwn(n,o))throw new i;Object.hasOwn(t,o)||(n[o]=!0,t[o]=!0,e.predecessors(o).forEach(r),delete n[o],s.push(o))}),Object.keys(t).length!==e.nodeCount())throw new i;return s}class i extends Error{constructor(){super(...arguments)}}e.exports=t,t.CycleException=i},52821(e){e.exports=class{_arr=[];_keyIndices={};size(){return this._arr.length}keys(){return this._arr.map(function(e){return e.key})}has(e){return Object.hasOwn(this._keyIndices,e)}priority(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority}min(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key}add(e,t){var i=this._keyIndices;if(e=String(e),!Object.hasOwn(i,e)){var n=this._arr,s=n.length;return i[e]=s,n.push({key:e,priority:t}),this._decrease(s),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){var i=this._keyIndices[e];if(t>this._arr[i].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[i].priority+" New: "+t);this._arr[i].priority=t,this._decrease(i)}_heapify(e){var t=this._arr,i=2*e,n=i+1,s=e;i<t.length&&(s=t[i].priority<t[s].priority?i:s,n<t.length&&(s=t[n].priority<t[s].priority?n:s),s!==e&&(this._swap(e,s),this._heapify(s)))}_decrease(e){for(var t,i=this._arr,n=i[e].priority;0!==e&&!(i[t=e>>1].priority<n);)this._swap(e,t),e=t}_swap(e,t){var i=this._arr,n=this._keyIndices,s=i[e],r=i[t];i[e]=r,i[t]=s,n[r.key]=e,n[s.key]=t}}},76234(e){"use strict";var t="\0";function i(e,t){e[t]?e[t]++:e[t]=1}function n(e,t){--e[t]||delete e[t]}function s(e,t,i,n){var s=""+t,r=""+i;if(!e&&s>r){var o=s;s=r,r=o}return s+""+r+""+(void 0===n?"\0":n)}function r(e,t){return s(e,t.v,t.w,t.name)}e.exports=class{_isDirected=!0;_isMultigraph=!1;_isCompound=!1;_label;_defaultNodeLabelFn=()=>{};_defaultEdgeLabelFn=()=>{};_nodes={};_in={};_preds={};_out={};_sucs={};_edgeObjs={};_edgeLabels={};_nodeCount=0;_edgeCount=0;_parent;_children;constructor(e){e&&(this._isDirected=!Object.hasOwn(e,"directed")||e.directed,this._isMultigraph=!!Object.hasOwn(e,"multigraph")&&e.multigraph,this._isCompound=!!Object.hasOwn(e,"compound")&&e.compound),this._isCompound&&(this._parent={},this._children={},this._children[t]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=e,"function"!=typeof e&&(this._defaultNodeLabelFn=()=>e),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var e=this;return this.nodes().filter(t=>0===Object.keys(e._in[t]).length)}sinks(){var e=this;return this.nodes().filter(t=>0===Object.keys(e._out[t]).length)}setNodes(e,t){var i=arguments,n=this;return e.forEach(function(e){i.length>1?n.setNode(e,t):n.setNode(e)}),this}setNode(e,i){return Object.hasOwn(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=i),this):(this._nodes[e]=arguments.length>1?i:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=t,this._children[e]={},this._children[t][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.hasOwn(this._nodes,e)}removeNode(e){var t=this;if(Object.hasOwn(this._nodes,e)){var i=e=>t.removeEdge(t._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(function(e){t.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(i),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(i),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,i){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(void 0===i)i=t;else{for(var n=i+="";void 0!==n;n=this.parent(n))if(n===e)throw new Error("Setting "+i+" as parent of "+e+" would create a cycle");this.setNode(i)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=i,this._children[i][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var i=this._parent[e];if(i!==t)return i}}children(e=t){if(this._isCompound){var i=this._children[e];if(i)return Object.keys(i)}else{if(e===t)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var t=this._preds[e];if(t)return Object.keys(t)}successors(e){var t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){var t=this.predecessors(e);if(t){const n=new Set(t);for(var i of this.successors(e))n.add(i);return Array.from(n.values())}}isLeaf(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length}filterNodes(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var i=this;Object.entries(this._nodes).forEach(function([i,n]){e(i)&&t.setNode(i,n)}),Object.values(this._edgeObjs).forEach(function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,i.edge(e))});var n={};function s(e){var r=i.parent(e);return void 0===r||t.hasNode(r)?(n[e]=r,r):r in n?n[r]:s(r)}return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,s(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=e,"function"!=typeof e&&(this._defaultEdgeLabelFn=()=>e),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){var i=this,n=arguments;return e.reduce(function(e,s){return n.length>1?i.setEdge(e,s,t):i.setEdge(e,s),s}),this}setEdge(){var e,t,n,r,o=!1,a=arguments[0];"object"==typeof a&&null!==a&&"v"in a?(e=a.v,t=a.w,n=a.name,2===arguments.length&&(r=arguments[1],o=!0)):(e=a,t=arguments[1],n=arguments[3],arguments.length>2&&(r=arguments[2],o=!0)),e=""+e,t=""+t,void 0!==n&&(n=""+n);var l=s(this._isDirected,e,t,n);if(Object.hasOwn(this._edgeLabels,l))return o&&(this._edgeLabels[l]=r),this;if(void 0!==n&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[l]=o?r:this._defaultEdgeLabelFn(e,t,n);var c=function(e,t,i,n){var s=""+t,r=""+i;if(!e&&s>r){var o=s;s=r,r=o}var a={v:s,w:r};return n&&(a.name=n),a}(this._isDirected,e,t,n);return e=c.v,t=c.w,Object.freeze(c),this._edgeObjs[l]=c,i(this._preds[t],e),i(this._sucs[e],t),this._in[t][l]=c,this._out[e][l]=c,this._edgeCount++,this}edge(e,t,i){var n=1===arguments.length?r(this._isDirected,arguments[0]):s(this._isDirected,e,t,i);return this._edgeLabels[n]}edgeAsObj(){const e=this.edge(...arguments);return"object"!=typeof e?{label:e}:e}hasEdge(e,t,i){var n=1===arguments.length?r(this._isDirected,arguments[0]):s(this._isDirected,e,t,i);return Object.hasOwn(this._edgeLabels,n)}removeEdge(e,t,i){var o=1===arguments.length?r(this._isDirected,arguments[0]):s(this._isDirected,e,t,i),a=this._edgeObjs[o];return a&&(e=a.v,t=a.w,delete this._edgeLabels[o],delete this._edgeObjs[o],n(this._preds[t],e),n(this._sucs[e],t),delete this._in[t][o],delete this._out[e][o],this._edgeCount--),this}inEdges(e,t){var i=this._in[e];if(i){var n=Object.values(i);return t?n.filter(e=>e.v===t):n}}outEdges(e,t){var i=this._out[e];if(i){var n=Object.values(i);return t?n.filter(e=>e.w===t):n}}nodeEdges(e,t){var i=this.inEdges(e,t);if(i)return i.concat(this.outEdges(e,t))}}},72482(e,t,i){e.exports={Graph:i(76234),version:i(51350)}},73082(e,t,i){var n=i(76234);function s(e){return e.nodes().map(function(t){var i=e.node(t),n=e.parent(t),s={v:t};return void 0!==i&&(s.value=i),void 0!==n&&(s.parent=n),s})}function r(e){return e.edges().map(function(t){var i=e.edge(t),n={v:t.v,w:t.w};return void 0!==t.name&&(n.name=t.name),void 0!==i&&(n.value=i),n})}e.exports={write:function(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:s(e),edges:r(e)};return void 0!==e.graph()&&(t.value=structuredClone(e.graph())),t},read:function(e){var t=new n(e.options).setGraph(e.value);return e.nodes.forEach(function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),e.edges.forEach(function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}}},51350(e){e.exports="2.2.4"},41487(e,t,i){"use strict";i.r(t),i.d(t,{default:()=>m});var n=i(8900),s=i(46903),r=i(75612),o=i(16253),a=i(95093),l=i(3746),c=i(39574),h=function(e,t,i){for(var n=0,s=0;n=s,s=(0,a.se)(),38===n&&12===s&&(t[i]=1),!(0,a.Sh)(s);)(0,a.K2)();return(0,a.di)(e,a.G1)},u=new WeakMap,d=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,i=e.parent,n=e.column===i.column&&e.line===i.line;"rule"!==i.type;)if(!(i=i.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||u.get(i))&&!n){u.set(e,!0);for(var s=[],o=function(e,t){return(0,a.VF)(function(e,t){var i=-1,n=44;do{switch((0,a.Sh)(n)){case 0:38===n&&12===(0,a.se)()&&(t[i]=1),e[i]+=h(a.G1-1,t,i);break;case 2:e[i]+=(0,a.Tb)(n);break;case 4:if(44===n){e[++i]=58===(0,a.se)()?"&\f":"",t[i]=e[i].length;break}default:e[i]+=(0,r.HT)(n)}}while(n=(0,a.K2)());return e}((0,a.c4)(e),t))}(t,s),l=i.props,c=0,d=0;c<o.length;c++)for(var p=0;p<l.length;p++,d++)e.props[d]=s[c]?o[c].replace(/&\f/g,l[p]):l[p]+" "+o[c]}}},p=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function g(e,t){switch((0,r.tW)(e,t)){case 5103:return s.j+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return s.j+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return s.j+e+s.vd+e+s.MS+e+e;case 6828:case 4268:return s.j+e+s.MS+e+e;case 6165:return s.j+e+s.MS+"flex-"+e+e;case 5187:return s.j+e+(0,r.HC)(e,/(\w+).+(:[^]+)/,s.j+"box-$1$2"+s.MS+"flex-$1$2")+e;case 5443:return s.j+e+s.MS+"flex-item-"+(0,r.HC)(e,/flex-|-self/,"")+e;case 4675:return s.j+e+s.MS+"flex-line-pack"+(0,r.HC)(e,/align-content|flex-|-self/,"")+e;case 5548:return s.j+e+s.MS+(0,r.HC)(e,"shrink","negative")+e;case 5292:return s.j+e+s.MS+(0,r.HC)(e,"basis","preferred-size")+e;case 6060:return s.j+"box-"+(0,r.HC)(e,"-grow","")+s.j+e+s.MS+(0,r.HC)(e,"grow","positive")+e;case 4554:return s.j+(0,r.HC)(e,/([^-])(transform)/g,"$1"+s.j+"$2")+e;case 6187:return(0,r.HC)((0,r.HC)((0,r.HC)(e,/(zoom-|grab)/,s.j+"$1"),/(image-set)/,s.j+"$1"),e,"")+e;case 5495:case 3959:return(0,r.HC)(e,/(image-set\([^]*)/,s.j+"$1$`$1");case 4968:return(0,r.HC)((0,r.HC)(e,/(.+:)(flex-)?(.*)/,s.j+"box-pack:$3"+s.MS+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+s.j+e+e;case 4095:case 3583:case 4068:case 2532:return(0,r.HC)(e,/(.+)-inline(.+)/,s.j+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if((0,r.b2)(e)-1-t>6)switch((0,r.wN)(e,t+1)){case 109:if(45!==(0,r.wN)(e,t+4))break;case 102:return(0,r.HC)(e,/(.+:)(.+)-([^]+)/,"$1"+s.j+"$2-$3$1"+s.vd+(108==(0,r.wN)(e,t+3)?"$3":"$2-$3"))+e;case 115:return~(0,r.K5)(e,"stretch")?g((0,r.HC)(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==(0,r.wN)(e,t+1))break;case 6444:switch((0,r.wN)(e,(0,r.b2)(e)-3-(~(0,r.K5)(e,"!important")&&10))){case 107:return(0,r.HC)(e,":",":"+s.j)+e;case 101:return(0,r.HC)(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+s.j+(45===(0,r.wN)(e,14)?"inline-":"")+"box$3$1"+s.j+"$2$3$1"+s.MS+"$2box$3")+e}break;case 5936:switch((0,r.wN)(e,t+11)){case 114:return s.j+e+s.MS+(0,r.HC)(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return s.j+e+s.MS+(0,r.HC)(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return s.j+e+s.MS+(0,r.HC)(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return s.j+e+s.MS+e+e}return e}var f=[function(e,t,i,n){if(e.length>-1&&!e.return)switch(e.type){case s.LU:e.return=g(e.value,e.length);break;case s.Sv:return(0,l.l)([(0,a.C)(e,{value:(0,r.HC)(e.value,"@","@"+s.j)})],n);case s.XZ:if(e.length)return(0,r.kg)(e.props,function(t){switch((0,r.YW)(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return(0,l.l)([(0,a.C)(e,{props:[(0,r.HC)(t,/:(read-\w+)/,":"+s.vd+"$1")]})],n);case"::placeholder":return(0,l.l)([(0,a.C)(e,{props:[(0,r.HC)(t,/:(plac\w+)/,":"+s.j+"input-$1")]}),(0,a.C)(e,{props:[(0,r.HC)(t,/:(plac\w+)/,":"+s.vd+"$1")]}),(0,a.C)(e,{props:[(0,r.HC)(t,/:(plac\w+)/,s.MS+"input-$1")]})],n)}return""})}}],m=function(e){var t=e.key;if("css"===t){var i=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(i,function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))})}var s,r,a=e.stylisPlugins||f,h={},u=[];s=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(e){for(var t=e.getAttribute("data-emotion").split(" "),i=1;i<t.length;i++)h[t[i]]=!0;u.push(e)});var g,m=[d,p],y=[l.A,(0,c.MY)(function(e){g.insert(e)})],v=(0,c.r1)(m.concat(a,y));r=function(e,t,i,n){var s;g=i,s=e?e+"{"+t.styles+"}":t.styles,(0,l.l)((0,o.wE)(s),v),n&&(b.inserted[t.name]=!0)};var b={key:t,sheet:new n.StyleSheet({key:t,container:s,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:h,registered:{},insert:r};return b.sheet.hydrate(u),b}},78371(e,t,i){"use strict";function n(e){var t=Object.create(null);return function(i){return void 0===t[i]&&(t[i]=e(i)),t[i]}}i.d(t,{A:()=>n})},95803(e,t,i){"use strict";i.d(t,{C:()=>g,E:()=>M,T:()=>y,_:()=>f,a:()=>C,b:()=>w,c:()=>E,h:()=>S,i:()=>d,u:()=>v,w:()=>m});var n=i(22155),s=i(41487),r=i(69932),o=function(e){var t=new WeakMap;return function(i){if(t.has(i))return t.get(i);var n=e(i);return t.set(i,n),n}},a=i(4674),l=i.n(a),c=i(60966),h=i(22855),u=i(82504),d=!1,p=n.createContext("undefined"!=typeof HTMLElement?(0,s.default)({key:"css"}):null),g=p.Provider,f=function(){return(0,n.useContext)(p)},m=function(e){return(0,n.forwardRef)(function(t,i){var s=(0,n.useContext)(p);return e(t,s,i)})},y=n.createContext({}),v=function(){return n.useContext(y)},b=o(function(e){return o(function(t){return function(e,t){return"function"==typeof t?t(e):(0,r.A)({},e,t)}(e,t)})}),C=function(e){var t=n.useContext(y);return e.theme!==t&&(t=b(t)(e.theme)),n.createElement(y.Provider,{value:t},e.children)};function w(e){var t,i,s=e.displayName||e.name||"Component",o=n.forwardRef(function(t,i){var s=n.useContext(y);return n.createElement(e,(0,r.A)({theme:s,ref:i},t))});return o.displayName="WithTheme("+s+")",t=o,i=e,l()(t,i)}var S={}.hasOwnProperty,x="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",E=function(e,t){var i={};for(var n in t)S.call(t,n)&&(i[n]=t[n]);return i[x]=e,i},A=function(e){var t=e.cache,i=e.serialized,n=e.isStringTag;return(0,c.SF)(t,i,n),(0,u.s)(function(){return(0,c.sk)(t,i,n)}),null},M=m(function(e,t,i){var s=e.css;"string"==typeof s&&void 0!==t.registered[s]&&(s=t.registered[s]);var r=e[x],o=[s],a="";"string"==typeof e.className?a=(0,c.Rk)(t.registered,o,e.className):null!=e.className&&(a=e.className+" ");var l=(0,h.serializeStyles)(o,void 0,n.useContext(y));a+=t.key+"-"+l.name;var u={};for(var p in e)S.call(e,p)&&"css"!==p&&p!==x&&!d&&(u[p]=e[p]);return u.className=a,i&&(u.ref=i),n.createElement(n.Fragment,null,n.createElement(A,{cache:t,serialized:l,isStringTag:"string"==typeof r}),n.createElement(r,u))})},95349(e,t,i){"use strict";i.r(t),i.d(t,{CacheProvider:()=>r.C,ClassNames:()=>m,Global:()=>u,ThemeContext:()=>r.T,ThemeProvider:()=>r.a,__unsafe_useEmotionCache:()=>r._,createElement:()=>h,css:()=>d,jsx:()=>h,keyframes:()=>p,useTheme:()=>r.u,withEmotionCache:()=>r.w,withTheme:()=>r.b});var n,s,r=i(95803),o=i(22155),a=i(60966),l=i(82504),c=i(22855),h=(i(41487),i(4674),function(e,t){var i=arguments;if(null==t||!r.h.call(t,"css"))return o.createElement.apply(void 0,i);var n=i.length,s=new Array(n);s[0]=r.E,s[1]=(0,r.c)(e,t);for(var a=2;a<n;a++)s[a]=i[a];return o.createElement.apply(null,s)});n=h||(h={}),s||(s=n.JSX||(n.JSX={}));var u=(0,r.w)(function(e,t){var i=e.styles,n=(0,c.serializeStyles)([i],void 0,o.useContext(r.T)),s=o.useRef();return(0,l.i)(function(){var e=t.key+"-global",i=new t.sheet.constructor({key:e,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),r=!1,o=document.querySelector('style[data-emotion="'+e+" "+n.name+'"]');return t.sheet.tags.length&&(i.before=t.sheet.tags[0]),null!==o&&(r=!0,o.setAttribute("data-emotion",e),i.hydrate([o])),s.current=[i,r],function(){i.flush()}},[t]),(0,l.i)(function(){var e=s.current,i=e[0];if(e[1])e[1]=!1;else{if(void 0!==n.next&&(0,a.sk)(t,n.next,!0),i.tags.length){var r=i.tags[i.tags.length-1].nextElementSibling;i.before=r,i.flush()}t.insert("",n,i,!1)}},[t,n.name]),null});function d(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return(0,c.serializeStyles)(t)}function p(){var e=d.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}var g=function e(t){for(var i=t.length,n=0,s="";n<i;n++){var r=t[n];if(null!=r){var o=void 0;switch(typeof r){case"boolean":break;case"object":if(Array.isArray(r))o=e(r);else for(var a in o="",r)r[a]&&a&&(o&&(o+=" "),o+=a);break;default:o=r}o&&(s&&(s+=" "),s+=o)}}return s},f=function(e){var t=e.cache,i=e.serializedArr;return(0,l.s)(function(){for(var e=0;e<i.length;e++)(0,a.sk)(t,i[e],!1)}),null},m=(0,r.w)(function(e,t){var i=!1,n=[],s=function(){if(i&&r.i)throw new Error("css can only be used during render");for(var e=arguments.length,s=new Array(e),o=0;o<e;o++)s[o]=arguments[o];var l=(0,c.serializeStyles)(s,t.registered);return n.push(l),(0,a.SF)(t,l,!1),t.key+"-"+l.name},l={css:s,cx:function(){if(i&&r.i)throw new Error("cx can only be used during render");for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return function(e,t,i){var n=[],s=(0,a.Rk)(e,n,i);return n.length<2?i:s+t(n)}(t.registered,s,g(n))},theme:o.useContext(r.T)},h=e.children(l);return i=!0,o.createElement(o.Fragment,null,o.createElement(f,{cache:t,serializedArr:n}),h)})},22855(e,t,i){"use strict";i.r(t),i.d(t,{serializeStyles:()=>g});var n={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},s=i(78371),r=/[A-Z]|^ms/g,o=/_EMO_([^_]+?)_([^]*?)_EMO_/g,a=function(e){return 45===e.charCodeAt(1)},l=function(e){return null!=e&&"boolean"!=typeof e},c=(0,s.A)(function(e){return a(e)?e:e.replace(r,"-$&").toLowerCase()}),h=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(o,function(e,t,i){return d={name:t,styles:i,next:d},t})}return 1===n[e]||a(e)||"number"!=typeof t||0===t?t:t+"px"};function u(e,t,i){if(null==i)return"";var n=i;if(void 0!==n.__emotion_styles)return n;switch(typeof i){case"boolean":return"";case"object":var s=i;if(1===s.anim)return d={name:s.name,styles:s.styles,next:d},s.name;var r=i;if(void 0!==r.styles){var o=r.next;if(void 0!==o)for(;void 0!==o;)d={name:o.name,styles:o.styles,next:d},o=o.next;return r.styles+";"}return function(e,t,i){var n="";if(Array.isArray(i))for(var s=0;s<i.length;s++)n+=u(e,t,i[s])+";";else for(var r in i){var o=i[r];if("object"!=typeof o){var a=o;null!=t&&void 0!==t[a]?n+=r+"{"+t[a]+"}":l(a)&&(n+=c(r)+":"+h(r,a)+";")}else if(!Array.isArray(o)||"string"!=typeof o[0]||null!=t&&void 0!==t[o[0]]){var d=u(e,t,o);switch(r){case"animation":case"animationName":n+=c(r)+":"+d+";";break;default:n+=r+"{"+d+"}"}}else for(var p=0;p<o.length;p++)l(o[p])&&(n+=c(r)+":"+h(r,o[p])+";")}return n}(e,t,i);case"function":if(void 0!==e){var a=d,p=i(e);return d=a,u(e,t,p)}}var g=i;if(null==t)return g;var f=t[g];return void 0!==f?f:g}var d,p=/label:\s*([^\s;{]+)\s*(;|$)/g;function g(e,t,i){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var n=!0,s="";d=void 0;var r=e[0];null==r||void 0===r.raw?(n=!1,s+=u(i,t,r)):s+=r[0];for(var o=1;o<e.length;o++)s+=u(i,t,e[o]),n&&(s+=r[o]);p.lastIndex=0;for(var a,l="";null!==(a=p.exec(s));)l+="-"+a[1];var c=function(e){for(var t,i=0,n=0,s=e.length;s>=4;++n,s-=4)t=1540483477*(65535&(t=255&e.charCodeAt(n)|(255&e.charCodeAt(++n))<<8|(255&e.charCodeAt(++n))<<16|(255&e.charCodeAt(++n))<<24))+(59797*(t>>>16)<<16),i=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&i)+(59797*(i>>>16)<<16);switch(s){case 3:i^=(255&e.charCodeAt(n+2))<<16;case 2:i^=(255&e.charCodeAt(n+1))<<8;case 1:i=1540483477*(65535&(i^=255&e.charCodeAt(n)))+(59797*(i>>>16)<<16)}return(((i=1540483477*(65535&(i^=i>>>13))+(59797*(i>>>16)<<16))^i>>>15)>>>0).toString(36)}(s)+l;return{name:c,styles:s,next:d}}},8900(e,t,i){"use strict";i.r(t),i.d(t,{StyleSheet:()=>n});var n=function(){function e(e){var t=this;this._insertTag=function(e){var i;i=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,i),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var i=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{i.insertRule(e,i.cssRules.length)}catch(e){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)}),this.tags=[],this.ctr=0},e}()},56149(e,t,i){"use strict";i.r(t),i.d(t,{default:()=>m});var n=i(69932),s=i(95803),r=i(22855),o=i(82504),a=i(60966),l=i(22155),c=i(78371),h=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,u=(0,c.A)(function(e){return h.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}),d=function(e){return"theme"!==e},p=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?u:d},g=function(e,t,i){var n;if(t){var s=t.shouldForwardProp;n=e.__emotion_forwardProp&&s?function(t){return e.__emotion_forwardProp(t)&&s(t)}:s}return"function"!=typeof n&&i&&(n=e.__emotion_forwardProp),n},f=function(e){var t=e.cache,i=e.serialized,n=e.isStringTag;return(0,a.SF)(t,i,n),(0,o.s)(function(){return(0,a.sk)(t,i,n)}),null},m=function e(t,i){var o,c,h=t.__emotion_real===t,u=h&&t.__emotion_base||t;void 0!==i&&(o=i.label,c=i.target);var d=g(t,i,h),m=d||p(u),y=!m("as");return function(){var v=arguments,b=h&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==o&&b.push("label:"+o+";"),null==v[0]||void 0===v[0].raw)b.push.apply(b,v);else{var C=v[0];b.push(C[0]);for(var w=v.length,S=1;S<w;S++)b.push(v[S],C[S])}var x=(0,s.w)(function(e,t,i){var n=y&&e.as||u,o="",h=[],g=e;if(null==e.theme){for(var v in g={},e)g[v]=e[v];g.theme=l.useContext(s.T)}"string"==typeof e.className?o=(0,a.Rk)(t.registered,h,e.className):null!=e.className&&(o=e.className+" ");var C=(0,r.serializeStyles)(b.concat(h),t.registered,g);o+=t.key+"-"+C.name,void 0!==c&&(o+=" "+c);var w=y&&void 0===d?p(n):m,S={};for(var x in e)y&&"as"===x||w(x)&&(S[x]=e[x]);return S.className=o,i&&(S.ref=i),l.createElement(l.Fragment,null,l.createElement(f,{cache:t,serialized:C,isStringTag:"string"==typeof n}),l.createElement(n,S))});return x.displayName=void 0!==o?o:"Styled("+("string"==typeof u?u:u.displayName||u.name||"Component")+")",x.defaultProps=t.defaultProps,x.__emotion_real=x,x.__emotion_base=u,x.__emotion_styles=b,x.__emotion_forwardProp=d,Object.defineProperty(x,"toString",{value:function(){return"."+c}}),x.withComponent=function(t,s){return e(t,(0,n.A)({},i,s,{shouldForwardProp:g(x,s,!0)})).apply(void 0,b)},x}}.bind(null);["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach(function(e){m[e]=m(e)})},82504(e,t,i){"use strict";var n;i.d(t,{i:()=>a,s:()=>o});var s=i(22155),r=!!(n||(n=i.t(s,2))).useInsertionEffect&&(n||(n=i.t(s,2))).useInsertionEffect,o=r||function(e){return e()},a=r||s.useLayoutEffect},60966(e,t,i){"use strict";function n(e,t,i){var n="";return i.split(" ").forEach(function(i){void 0!==e[i]?t.push(e[i]+";"):i&&(n+=i+" ")}),n}i.d(t,{Rk:()=>n,SF:()=>s,sk:()=>r});var s=function(e,t,i){var n=e.key+"-"+t.name;!1===i&&void 0===e.registered[n]&&(e.registered[n]=t.styles)},r=function(e,t,i){s(e,t,i);var n=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var r=t;do{e.insert(t===r?"."+n:"",r,e.sheet,!0),r=r.next}while(void 0!==r)}}},62420(e,t,i){"use strict";i.r(t),i.d(t,{Composite:()=>ve,CompositeItem:()=>be,FloatingArrow:()=>Ae,FloatingDelayGroup:()=>ze,FloatingFocusManager:()=>bt,FloatingList:()=>se,FloatingNode:()=>Pe,FloatingOverlay:()=>xt,FloatingPortal:()=>ut,FloatingTree:()=>_e,NextFloatingDelayGroup:()=>$e,arrow:()=>J.UE,autoPlacement:()=>J.RK,autoUpdate:()=>ee.ll,computePosition:()=>ee.rD,detectOverflow:()=>ee.__,flip:()=>J.UU,getOverflowAncestors:()=>r.v9,hide:()=>J.jD,inline:()=>J.mG,inner:()=>Jt,limitShift:()=>J.ER,offset:()=>J.cY,platform:()=>ee.iD,safePolygon:()=>ni,shift:()=>J.BN,size:()=>J.Ej,useClick:()=>Mt,useClientPoint:()=>Dt,useDelayGroup:()=>We,useDelayGroupContext:()=>Ue,useDismiss:()=>Pt,useFloating:()=>Lt,useFloatingNodeId:()=>ke,useFloatingParentNodeId:()=>Ie,useFloatingPortalNode:()=>ht,useFloatingRootContext:()=>_t,useFloatingTree:()=>Re,useFocus:()=>Ot,useHover:()=>Be,useId:()=>Ee,useInnerOffset:()=>ei,useInteractions:()=>Gt,useListItem:()=>re,useListNavigation:()=>Wt,useMergeRefs:()=>te,useNextDelayGroup:()=>Ke,useRole:()=>$t,useTransitionStatus:()=>qt,useTransitionStyles:()=>Xt,useTypeahead:()=>Zt});var n=i(22155),s=i.t(n,2),r=i(32125),o=i(51771),a=i(86668);function l(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function c(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:i}=e;return t+"/"+i}).join(" "):navigator.userAgent}function h(){return/apple/i.test(navigator.vendor)}function u(){const e=/android/i;return e.test(l())||e.test(c())}function d(){return c().includes("jsdom/")}const p="data-floating-ui-focusable",g="ArrowLeft",f="ArrowRight";function m(e){let t=e.activeElement;for(;null!=(null==(i=t)||null==(i=i.shadowRoot)?void 0:i.activeElement);){var i;t=t.shadowRoot.activeElement}return t}function y(e,t){if(!e||!t)return!1;const i=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(i&&(0,r.Ng)(i)){let i=t;for(;i;){if(e===i)return!0;i=i.parentNode||i.host}}return!1}function v(e){return"composedPath"in e?e.composedPath()[0]:e.target}function b(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const i=e;return null!=i.target&&t.contains(i.target)}function C(e){return(null==e?void 0:e.ownerDocument)||document}function w(e){return(0,r.sb)(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function S(e){return!!e&&"combobox"===e.getAttribute("role")&&w(e)}function x(e){return e?e.hasAttribute(p)?e:e.querySelector("["+p+"]")||e:null}function E(e,t,i){return void 0===i&&(i=!0),e.filter(e=>{var n;return e.parentId===t&&(!i||(null==(n=e.context)?void 0:n.open))}).flatMap(t=>[t,...E(e,t.id,i)])}function A(e,t){var i;let n=[],s=null==(i=e.find(e=>e.id===t))?void 0:i.parentId;for(;s;){const t=e.find(e=>e.id===s);s=null==t?void 0:t.parentId,t&&(n=n.concat(t))}return n}function M(e){e.preventDefault(),e.stopPropagation()}function T(e){return!(0!==e.mozInputSource||!e.isTrusted)||(u()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function D(e){return!d()&&(!u()&&0===e.width&&0===e.height||u()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function I(e,t){const i=["mouse","pen"];return t||i.push("",void 0),i.includes(e)}var R="undefined"!=typeof document?n.useLayoutEffect:function(){};function k(e){const t=n.useRef(e);return R(()=>{t.current=e}),t}const P={...s}.useInsertionEffect||(e=>e());function _(e){const t=n.useRef(()=>{});return P(()=>{t.current=e}),n.useCallback(function(){for(var e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return null==t.current?void 0:t.current(...i)},[])}function L(e,t,i){return Math.floor(e/t)!==i}function N(e,t){return t<0||t>=e.current.length}function O(e,t){return G(e,{disabledIndices:t})}function F(e,t){return G(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function G(e,t){let{startingIndex:i=-1,decrement:n=!1,disabledIndices:s,amount:r=1}=void 0===t?{}:t,o=i;do{o+=n?-r:r}while(o>=0&&o<=e.current.length-1&&z(e,o,s));return o}function B(e,t){let{event:i,orientation:n,loop:s,rtl:r,cols:a,disabledIndices:l,minIndex:c,maxIndex:h,prevIndex:u,stopEvent:d=!1}=t,p=u;if("ArrowUp"===i.key){if(d&&M(i),-1===u)p=h;else if(p=G(e,{startingIndex:p,amount:a,decrement:!0,disabledIndices:l}),s&&(u-a<c||p<0)){const e=u%a,t=h%a,i=h-(t-e);p=t===e?h:t>e?i:i-a}N(e,p)&&(p=u)}if("ArrowDown"===i.key&&(d&&M(i),-1===u?p=c:(p=G(e,{startingIndex:u,amount:a,disabledIndices:l}),s&&u+a>h&&(p=G(e,{startingIndex:u%a-a,amount:a,disabledIndices:l}))),N(e,p)&&(p=u)),"both"===n){const t=(0,o.RI)(u/a);i.key===(r?g:f)&&(d&&M(i),u%a!==a-1?(p=G(e,{startingIndex:u,disabledIndices:l}),s&&L(p,a,t)&&(p=G(e,{startingIndex:u-u%a-1,disabledIndices:l}))):s&&(p=G(e,{startingIndex:u-u%a-1,disabledIndices:l})),L(p,a,t)&&(p=u)),i.key===(r?f:g)&&(d&&M(i),u%a!==0?(p=G(e,{startingIndex:u,decrement:!0,disabledIndices:l}),s&&L(p,a,t)&&(p=G(e,{startingIndex:u+(a-u%a),decrement:!0,disabledIndices:l}))):s&&(p=G(e,{startingIndex:u+(a-u%a),decrement:!0,disabledIndices:l})),L(p,a,t)&&(p=u));const n=(0,o.RI)(h/a)===t;N(e,p)&&(p=s&&n?i.key===(r?f:g)?h:G(e,{startingIndex:u-u%a-1,disabledIndices:l}):u)}return p}function V(e,t,i){const n=[];let s=0;return e.forEach((e,r)=>{let{width:o,height:a}=e,l=!1;for(i&&(s=0);!l;){const e=[];for(let i=0;i<o;i++)for(let n=0;n<a;n++)e.push(s+i+n*t);s%t+o<=t&&e.every(e=>null==n[e])?(e.forEach(e=>{n[e]=r}),l=!0):s++}}),[...n]}function H(e,t,i,n,s){if(-1===e)return-1;const r=i.indexOf(e),o=t[e];switch(s){case"tl":return r;case"tr":return o?r+o.width-1:r;case"bl":return o?r+(o.height-1)*n:r;case"br":return i.lastIndexOf(e)}}function U(e,t){return t.flatMap((t,i)=>e.includes(t)?[i]:[])}function z(e,t,i){if("function"==typeof i)return i(t);if(i)return i.includes(t);const n=e.current[t];return null==n||n.hasAttribute("disabled")||"true"===n.getAttribute("aria-disabled")}const W=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function j(e,t){const i=(0,a.Kr)(e,W()),n=i.length;if(0===n)return;const s=m(C(e)),r=i.indexOf(s);return i[-1===r?1===t?0:n-1:r+t]}function $(e){return j(C(e).body,1)||e}function K(e){return j(C(e).body,-1)||e}function Y(e,t){const i=t||e.currentTarget,n=e.relatedTarget;return!n||!y(i,n)}function q(e){(0,a.Kr)(e,W()).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})}function X(e){e.querySelectorAll("[data-tabindex]").forEach(e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")})}var Z=i(65723),Q=i(70316),J=i(18740),ee=i(4830);function te(e){const t=n.useRef(void 0),i=n.useCallback(t=>{const i=e.map(e=>{if(null!=e){if("function"==typeof e){const i=e,n=i(t);return"function"==typeof n?n:()=>{i(null)}}return e.current=t,()=>{e.current=null}}});return()=>{i.forEach(e=>null==e?void 0:e())}},e);return n.useMemo(()=>e.every(e=>null==e)?null:e=>{t.current&&(t.current(),t.current=void 0),null!=e&&(t.current=i(e))},e)}function ie(e,t){const i=e.compareDocumentPosition(t);return i&Node.DOCUMENT_POSITION_FOLLOWING||i&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:i&Node.DOCUMENT_POSITION_PRECEDING||i&Node.DOCUMENT_POSITION_CONTAINS?1:0}const ne=n.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function se(e){const{children:t,elementsRef:i,labelsRef:s}=e,[r,o]=n.useState(()=>new Set),a=n.useCallback(e=>{o(t=>new Set(t).add(e))},[]),l=n.useCallback(e=>{o(t=>{const i=new Set(t);return i.delete(e),i})},[]),c=n.useMemo(()=>{const e=new Map;return Array.from(r.keys()).sort(ie).forEach((t,i)=>{e.set(t,i)}),e},[r]);return(0,Z.jsx)(ne.Provider,{value:n.useMemo(()=>({register:a,unregister:l,map:c,elementsRef:i,labelsRef:s}),[a,l,c,i,s]),children:t})}function re(e){void 0===e&&(e={});const{label:t}=e,{register:i,unregister:s,map:r,elementsRef:o,labelsRef:a}=n.useContext(ne),[l,c]=n.useState(null),h=n.useRef(null),u=n.useCallback(e=>{if(h.current=e,null!==l&&(o.current[l]=e,a)){var i;const n=void 0!==t;a.current[l]=n?t:null!=(i=null==e?void 0:e.textContent)?i:null}},[l,o,a,t]);return R(()=>{const e=h.current;if(e)return i(e),()=>{s(e)}},[i,s]),R(()=>{const e=h.current?r.get(h.current):null;null!=e&&c(e)},[r]),n.useMemo(()=>({ref:u,index:null==l?-1:l}),[l,u])}const oe="data-floating-ui-focusable",ae="active",le="selected",ce="ArrowLeft",he="ArrowRight",ue="ArrowUp",de="ArrowDown";function pe(e,t){return"function"==typeof e?e(t):e?n.cloneElement(e,t):(0,Z.jsx)("div",{...t})}const ge=n.createContext({activeIndex:0,onNavigate:()=>{}}),fe=[ce,he],me=[ue,de],ye=[...fe,...me],ve=n.forwardRef(function(e,t){const{render:i,orientation:s="both",loop:r=!0,rtl:o=!1,cols:a=1,disabledIndices:l,activeIndex:c,onNavigate:h,itemSizes:u,dense:d=!1,...p}=e,[g,f]=n.useState(0),m=null!=c?c:g,y=_(null!=h?h:f),v=n.useRef([]),b=i&&"function"!=typeof i?i.props:{},C=n.useMemo(()=>({activeIndex:m,onNavigate:y}),[m,y]),w=a>1,S={...p,...b,ref:t,"aria-orientation":"both"===s?void 0:s,onKeyDown(e){null==p.onKeyDown||p.onKeyDown(e),null==b.onKeyDown||b.onKeyDown(e),function(e){if(!ye.includes(e.key))return;let t=m;const i=O(v,l),n=F(v,l),c=o?ce:he,h=o?he:ce;if(w){const h=u||Array.from({length:v.current.length},()=>({width:1,height:1})),p=V(h,a,d),g=p.findIndex(e=>null!=e&&!z(v,e,l)),f=p.reduce((e,t,i)=>null==t||z(v,t,l)?e:i,-1),y=p[B({current:p.map(e=>e?v.current[e]:null)},{event:e,orientation:s,loop:r,rtl:o,cols:a,disabledIndices:U([...("function"!=typeof l?l:null)||v.current.map((e,t)=>z(v,t,l)?t:void 0),void 0],p),minIndex:g,maxIndex:f,prevIndex:H(m>n?i:m,h,p,a,e.key===de?"bl":e.key===c?"tr":"tl")})];null!=y&&(t=y)}const p={horizontal:[c],vertical:[de],both:[c,de]}[s],g={horizontal:[h],vertical:[ue],both:[h,ue]}[s],f=w?ye:{horizontal:fe,vertical:me,both:ye}[s];var b;t===m&&[...p,...g].includes(e.key)&&(t=r&&t===n&&p.includes(e.key)?i:r&&t===i&&g.includes(e.key)?n:G(v,{startingIndex:t,decrement:g.includes(e.key),disabledIndices:l})),t===m||N(v,t)||(e.stopPropagation(),f.includes(e.key)&&e.preventDefault(),y(t),null==(b=v.current[t])||b.focus())}(e)}};return(0,Z.jsx)(ge.Provider,{value:C,children:(0,Z.jsx)(se,{elementsRef:v,children:pe(i,S)})})}),be=n.forwardRef(function(e,t){const{render:i,...s}=e,r=i&&"function"!=typeof i?i.props:{},{activeIndex:o,onNavigate:a}=n.useContext(ge),{ref:l,index:c}=re(),h=te([l,t,r.ref]),u=o===c;return pe(i,{...s,...r,ref:h,tabIndex:u?0:-1,"data-active":u?"":void 0,onFocus(e){null==s.onFocus||s.onFocus(e),null==r.onFocus||r.onFocus(e),a(c)}})}),Ce={...s};let we=!1,Se=0;const xe=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Se++,Ee=Ce.useId||function(){const[e,t]=n.useState(()=>we?xe():void 0);return R(()=>{null==e&&t(xe())},[]),n.useEffect(()=>{we=!0},[]),e},Ae=n.forwardRef(function(e,t){const{context:{placement:i,elements:{floating:s},middlewareData:{arrow:o,shift:a}},width:l=14,height:c=7,tipRadius:h=0,strokeWidth:u=0,staticOffset:d,stroke:p,d:g,style:{transform:f,...m}={},...y}=e,v=Ee(),[b,C]=n.useState(!1);if(R(()=>{s&&"rtl"===(0,r.L9)(s).direction&&C(!0)},[s]),!s)return null;const[w,S]=i.split("-"),x="top"===w||"bottom"===w;let E=d;(x&&null!=a&&a.x||!x&&null!=a&&a.y)&&(E=null);const A=2*u,M=A/2,T=l/2*(h/-8+1),D=c/2*h/4,I=!!g,k=E&&"end"===S?"bottom":"top";let P=E&&"end"===S?"right":"left";E&&b&&(P="end"===S?"left":"right");const _=null!=(null==o?void 0:o.x)?E||o.x:"",L=null!=(null==o?void 0:o.y)?E||o.y:"",N=g||"M0,0 H"+l+" L"+(l-T)+","+(c-D)+" Q"+l/2+","+c+" "+T+","+(c-D)+" Z",O={top:I?"rotate(180deg)":"",left:I?"rotate(90deg)":"rotate(-90deg)",bottom:I?"":"rotate(180deg)",right:I?"rotate(-90deg)":"rotate(90deg)"}[w];return(0,Z.jsxs)("svg",{...y,"aria-hidden":!0,ref:t,width:I?l:l+A,height:l,viewBox:"0 0 "+l+" "+(c>l?c:l),style:{position:"absolute",pointerEvents:"none",[P]:_,[k]:L,[w]:x||I?"100%":"calc(100% - "+A/2+"px)",transform:[O,f].filter(e=>!!e).join(" "),...m},children:[A>0&&(0,Z.jsx)("path",{clipPath:"url(#"+v+")",fill:"none",stroke:p,strokeWidth:A+(g?0:1),d:N}),(0,Z.jsx)("path",{stroke:A&&!g?y.fill:"none",d:N}),(0,Z.jsx)("clipPath",{id:v,children:(0,Z.jsx)("rect",{x:-M,y:M*(I?-1:1),width:l+A,height:l})})]})});function Me(){const e=new Map;return{emit(t,i){var n;null==(n=e.get(t))||n.forEach(e=>e(i))},on(t,i){e.has(t)||e.set(t,new Set),e.get(t).add(i)},off(t,i){var n;null==(n=e.get(t))||n.delete(i)}}}const Te=n.createContext(null),De=n.createContext(null),Ie=()=>{var e;return(null==(e=n.useContext(Te))?void 0:e.id)||null},Re=()=>n.useContext(De);function ke(e){const t=Ee(),i=Re(),n=Ie(),s=e||n;return R(()=>{if(!t)return;const e={id:t,parentId:s};return null==i||i.addNode(e),()=>{null==i||i.removeNode(e)}},[i,t,s]),t}function Pe(e){const{children:t,id:i}=e,s=Ie();return(0,Z.jsx)(Te.Provider,{value:n.useMemo(()=>({id:i,parentId:s}),[i,s]),children:t})}function _e(e){const{children:t}=e,i=n.useRef([]),s=n.useCallback(e=>{i.current=[...i.current,e]},[]),r=n.useCallback(e=>{i.current=i.current.filter(t=>t!==e)},[]),[o]=n.useState(()=>Me());return(0,Z.jsx)(De.Provider,{value:n.useMemo(()=>({nodesRef:i,addNode:s,removeNode:r,events:o}),[s,r,o]),children:t})}function Le(e){return"data-floating-ui-"+e}function Ne(e){-1!==e.current&&(clearTimeout(e.current),e.current=-1)}const Oe=Le("safe-polygon");function Fe(e,t,i){if(i&&!I(i))return 0;if("number"==typeof e)return e;if("function"==typeof e){const i=e();return"number"==typeof i?i:null==i?void 0:i[t]}return null==e?void 0:e[t]}function Ge(e){return"function"==typeof e?e():e}function Be(e,t){void 0===t&&(t={});const{open:i,onOpenChange:s,dataRef:o,events:a,elements:l}=e,{enabled:c=!0,delay:h=0,handleClose:u=null,mouseOnly:d=!1,restMs:p=0,move:g=!0}=t,f=Re(),m=Ie(),v=k(u),b=k(h),w=k(i),S=k(p),x=n.useRef(),E=n.useRef(-1),A=n.useRef(),M=n.useRef(-1),T=n.useRef(!0),D=n.useRef(!1),P=n.useRef(()=>{}),L=n.useRef(!1),N=_(()=>{var e;const t=null==(e=o.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t});n.useEffect(()=>{if(c)return a.on("openchange",e),()=>{a.off("openchange",e)};function e(e){let{open:t}=e;t||(Ne(E),Ne(M),T.current=!0,L.current=!1)}},[c,a]),n.useEffect(()=>{if(!c)return;if(!v.current)return;if(!i)return;function e(e){N()&&s(!1,e,"hover")}const t=C(l.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}},[l.floating,i,s,c,v,N]);const O=n.useCallback(function(e,t,i){void 0===t&&(t=!0),void 0===i&&(i="hover");const n=Fe(b.current,"close",x.current);n&&!A.current?(Ne(E),E.current=window.setTimeout(()=>s(!1,e,i),n)):t&&(Ne(E),s(!1,e,i))},[b,s]),F=_(()=>{P.current(),A.current=void 0}),G=_(()=>{if(D.current){const e=C(l.floating).body;e.style.pointerEvents="",e.removeAttribute(Oe),D.current=!1}}),B=_(()=>!!o.current.openEvent&&["click","mousedown"].includes(o.current.openEvent.type));n.useEffect(()=>{if(c&&(0,r.vq)(l.domReference)){const s=l.domReference,r=l.floating;return i&&s.addEventListener("mouseleave",n),g&&s.addEventListener("mousemove",e,{once:!0}),s.addEventListener("mouseenter",e),s.addEventListener("mouseleave",t),r&&(r.addEventListener("mouseleave",n),r.addEventListener("mouseenter",a),r.addEventListener("mouseleave",h)),()=>{i&&s.removeEventListener("mouseleave",n),g&&s.removeEventListener("mousemove",e),s.removeEventListener("mouseenter",e),s.removeEventListener("mouseleave",t),r&&(r.removeEventListener("mouseleave",n),r.removeEventListener("mouseenter",a),r.removeEventListener("mouseleave",h))}}function e(e){if(Ne(E),T.current=!1,d&&!I(x.current)||Ge(S.current)>0&&!Fe(b.current,"open"))return;const t=Fe(b.current,"open",x.current);t?E.current=window.setTimeout(()=>{w.current||s(!0,e,"hover")},t):i||s(!0,e,"hover")}function t(e){if(B())return void G();P.current();const t=C(l.floating);if(Ne(M),L.current=!1,v.current&&o.current.floatingContext){i||Ne(E),A.current=v.current({...o.current.floatingContext,tree:f,x:e.clientX,y:e.clientY,onClose(){G(),F(),B()||O(e,!0,"safe-polygon")}});const n=A.current;return t.addEventListener("mousemove",n),void(P.current=()=>{t.removeEventListener("mousemove",n)})}("touch"!==x.current||!y(l.floating,e.relatedTarget))&&O(e)}function n(e){B()||o.current.floatingContext&&(null==v.current||v.current({...o.current.floatingContext,tree:f,x:e.clientX,y:e.clientY,onClose(){G(),F(),B()||O(e)}})(e))}function a(){Ne(E)}function h(e){B()||O(e,!1)}},[l,c,e,d,g,O,F,G,s,i,w,f,b,v,o,B,S]),R(()=>{var e;if(c&&i&&null!=(e=v.current)&&null!=(e=e.__options)&&e.blockPointerEvents&&N()){D.current=!0;const e=l.floating;if((0,r.vq)(l.domReference)&&e){var t;const i=C(l.floating).body;i.setAttribute(Oe,"");const n=l.domReference,s=null==f||null==(t=f.nodesRef.current.find(e=>e.id===m))||null==(t=t.context)?void 0:t.elements.floating;return s&&(s.style.pointerEvents=""),i.style.pointerEvents="none",n.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{i.style.pointerEvents="",n.style.pointerEvents="",e.style.pointerEvents=""}}}},[c,i,m,l,f,v,N]),R(()=>{i||(x.current=void 0,L.current=!1,F(),G())},[i,F,G]),n.useEffect(()=>()=>{F(),Ne(E),Ne(M),G()},[c,l.domReference,F,G]);const V=n.useMemo(()=>{function e(e){x.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function n(){T.current||w.current||s(!0,t,"hover")}d&&!I(x.current)||i||0===Ge(S.current)||L.current&&e.movementX**2+e.movementY**2<2||(Ne(M),"touch"===x.current?n():(L.current=!0,M.current=window.setTimeout(n,Ge(S.current))))}}},[d,s,i,w,S]);return n.useMemo(()=>c?{reference:V}:{},[c,V])}const Ve=()=>{},He=n.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:Ve,setState:Ve,isInstantPhase:!1}),Ue=()=>n.useContext(He);function ze(e){const{children:t,delay:i,timeoutMs:s=0}=e,[r,o]=n.useReducer((e,t)=>({...e,...t}),{delay:i,timeoutMs:s,initialDelay:i,currentId:null,isInstantPhase:!1}),a=n.useRef(null),l=n.useCallback(e=>{o({currentId:e})},[]);return R(()=>{r.currentId?null===a.current?a.current=r.currentId:r.isInstantPhase||o({isInstantPhase:!0}):(r.isInstantPhase&&o({isInstantPhase:!1}),a.current=null)},[r.currentId,r.isInstantPhase]),(0,Z.jsx)(He.Provider,{value:n.useMemo(()=>({...r,setState:o,setCurrentId:l}),[r,l]),children:t})}function We(e,t){void 0===t&&(t={});const{open:i,onOpenChange:n,floatingId:s}=e,{id:r,enabled:o=!0}=t,a=null!=r?r:s,l=Ue(),{currentId:c,setCurrentId:h,initialDelay:u,setState:d,timeoutMs:p}=l;return R(()=>{o&&c&&(d({delay:{open:1,close:Fe(u,"close")}}),c!==a&&n(!1))},[o,a,n,d,c,u]),R(()=>{function e(){n(!1),d({delay:u,currentId:null})}if(o&&c&&!i&&c===a){if(p){const t=window.setTimeout(e,p);return()=>{clearTimeout(t)}}e()}},[o,i,d,c,a,n,u,p]),R(()=>{o&&h!==Ve&&i&&h(a)},[o,i,h,a]),l}const je=n.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeoutIdRef:{current:-1},currentIdRef:{current:null},currentContextRef:{current:null}});function $e(e){const{children:t,delay:i,timeoutMs:s=0}=e,r=n.useRef(i),o=n.useRef(i),a=n.useRef(null),l=n.useRef(null),c=n.useRef(-1);return(0,Z.jsx)(je.Provider,{value:n.useMemo(()=>({hasProvider:!0,delayRef:r,initialDelayRef:o,currentIdRef:a,timeoutMs:s,currentContextRef:l,timeoutIdRef:c}),[s]),children:t})}function Ke(e,t){void 0===t&&(t={});const{open:i,onOpenChange:s,floatingId:r}=e,{enabled:o=!0}=t,a=n.useContext(je),{currentIdRef:l,delayRef:c,timeoutMs:h,initialDelayRef:u,currentContextRef:d,hasProvider:p,timeoutIdRef:g}=a,[f,m]=n.useState(!1);return R(()=>{function e(){var e;m(!1),null==(e=d.current)||e.setIsInstantPhase(!1),l.current=null,d.current=null,c.current=u.current}if(o&&l.current&&!i&&l.current===r){if(m(!1),h)return g.current=window.setTimeout(e,h),()=>{clearTimeout(g.current)};e()}},[o,i,r,l,c,h,u,d,g]),R(()=>{if(!o)return;if(!i)return;const e=d.current,t=l.current;d.current={onOpenChange:s,setIsInstantPhase:m},l.current=r,c.current={open:0,close:Fe(u.current,"close")},null!==t&&t!==r?(Ne(g),m(!0),null==e||e.setIsInstantPhase(!0),null==e||e.onOpenChange(!1)):(m(!1),null==e||e.setIsInstantPhase(!1))},[o,i,r,s,l,c,h,u,d,g]),R(()=>()=>{d.current=null},[d]),n.useMemo(()=>({hasProvider:p,delayRef:c,isInstantPhase:f}),[p,c,f])}let Ye=0;function qe(e,t){void 0===t&&(t={});const{preventScroll:i=!1,cancelPrevious:n=!0,sync:s=!1}=t;n&&cancelAnimationFrame(Ye);const r=()=>null==e?void 0:e.focus({preventScroll:i});s?r():Ye=requestAnimationFrame(r)}function Xe(e,t){if(!e||!t)return!1;const i=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(i&&(0,r.Ng)(i)){let i=t;for(;i;){if(e===i)return!0;i=i.parentNode||i.host}}return!1}const Ze={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Qe(e){return"inert"===e?Ze.inert:"aria-hidden"===e?Ze["aria-hidden"]:Ze.none}let Je=new WeakSet,et={},tt=0;function it(e){return e?(0,r.Ng)(e)?e.host:it(e.parentNode):null}const nt=(e,t)=>t.map(t=>{if(e.contains(t))return t;const i=it(t);return e.contains(i)?i:null}).filter(e=>null!=e);function st(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=!1);const n=(s=e[0],(null==s?void 0:s.ownerDocument)||document).body;var s;return function(e,t,i,n){const s="data-floating-ui-inert",o=n?"inert":i?"aria-hidden":null,a=nt(t,e),l=new Set,c=new Set(a),h=[];et[s]||(et[s]=new WeakMap);const u=et[s];return a.forEach(function e(t){t&&!l.has(t)&&(l.add(t),t.parentNode&&e(t.parentNode))}),function e(t){t&&!c.has(t)&&[].forEach.call(t.children,t=>{if("script"!==(0,r.mq)(t))if(l.has(t))e(t);else{const e=o?t.getAttribute(o):null,i=null!==e&&"false"!==e,n=Qe(o),r=(n.get(t)||0)+1,a=(u.get(t)||0)+1;n.set(t,r),u.set(t,a),h.push(t),1===r&&i&&Je.add(t),1===a&&t.setAttribute(s,""),!i&&o&&t.setAttribute(o,"inert"===o?"":"true")}})}(t),l.clear(),tt++,()=>{h.forEach(e=>{const t=Qe(o),i=(t.get(e)||0)-1,n=(u.get(e)||0)-1;t.set(e,i),u.set(e,n),i||(!Je.has(e)&&o&&e.removeAttribute(o),Je.delete(e)),n||e.removeAttribute(s)}),tt--,tt||(Ze.inert=new WeakMap,Ze["aria-hidden"]=new WeakMap,Ze.none=new WeakMap,Je=new WeakSet,et={})}}(e.concat(Array.from(n.querySelectorAll('[aria-live],[role="status"],output'))),n,t,i)}const rt={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},ot=n.forwardRef(function(e,t){const[i,s]=n.useState();R(()=>{h()&&s("button")},[]);const r={ref:t,tabIndex:0,role:i,"aria-hidden":!i||void 0,[Le("focus-guard")]:"",style:rt};return(0,Z.jsx)("span",{...e,...r})}),at={clipPath:"inset(50%)",position:"fixed",top:0,left:0},lt=n.createContext(null),ct=Le("portal");function ht(e){void 0===e&&(e={});const{id:t,root:i}=e,s=Ee(),o=dt(),[a,l]=n.useState(null),c=n.useRef(null);return R(()=>()=>{null==a||a.remove(),queueMicrotask(()=>{c.current=null})},[a]),R(()=>{if(!s)return;if(c.current)return;const e=t?document.getElementById(t):null;if(!e)return;const i=document.createElement("div");i.id=s,i.setAttribute(ct,""),e.appendChild(i),c.current=i,l(i)},[t,s]),R(()=>{if(null===i)return;if(!s)return;if(c.current)return;let e=i||(null==o?void 0:o.portalNode);e&&!(0,r.Ll)(e)&&(e=e.current),e=e||document.body;let n=null;t&&(n=document.createElement("div"),n.id=t,e.appendChild(n));const a=document.createElement("div");a.id=s,a.setAttribute(ct,""),e=n||e,e.appendChild(a),c.current=a,l(a)},[t,i,s,o]),a}function ut(e){const{children:t,id:i,root:s,preserveTabOrder:r=!0}=e,o=ht({id:i,root:s}),[a,l]=n.useState(null),c=n.useRef(null),h=n.useRef(null),u=n.useRef(null),d=n.useRef(null),p=null==a?void 0:a.modal,g=null==a?void 0:a.open,f=!!a&&!a.modal&&a.open&&r&&!(!s&&!o);return n.useEffect(()=>{if(o&&r&&!p)return o.addEventListener("focusin",e,!0),o.addEventListener("focusout",e,!0),()=>{o.removeEventListener("focusin",e,!0),o.removeEventListener("focusout",e,!0)};function e(e){o&&Y(e)&&("focusin"===e.type?X:q)(o)}},[o,r,p]),n.useEffect(()=>{o&&(g||X(o))},[g,o]),(0,Z.jsxs)(lt.Provider,{value:n.useMemo(()=>({preserveTabOrder:r,beforeOutsideRef:c,afterOutsideRef:h,beforeInsideRef:u,afterInsideRef:d,portalNode:o,setFocusManagerState:l}),[r,o]),children:[f&&o&&(0,Z.jsx)(ot,{"data-type":"outside",ref:c,onFocus:e=>{if(Y(e,o)){var t;null==(t=u.current)||t.focus()}else{const e=K(a?a.domReference:null);null==e||e.focus()}}}),f&&o&&(0,Z.jsx)("span",{"aria-owns":o.id,style:at}),o&&Q.createPortal(t,o),f&&o&&(0,Z.jsx)(ot,{"data-type":"outside",ref:h,onFocus:e=>{if(Y(e,o)){var t;null==(t=d.current)||t.focus()}else{const t=$(a?a.domReference:null);null==t||t.focus(),(null==a?void 0:a.closeOnFocusOut)&&(null==a||a.onOpenChange(!1,e.nativeEvent,"focus-out"))}}})]})}const dt=()=>n.useContext(lt);function pt(e){return n.useMemo(()=>t=>{e.forEach(e=>{e&&(e.current=t)})},e)}let gt=[];function ft(){gt=gt.filter(e=>{var t;return null==(t=e.deref())?void 0:t.isConnected})}function mt(){ft();const e=gt[gt.length-1];return null==e?void 0:e.deref()}function yt(e,t){var i;if(!(t.current.includes("floating")||null!=(i=e.getAttribute("role"))&&i.includes("dialog")))return;const n=W(),s=(0,a.nq)(e,n).filter(e=>{const t=e.getAttribute("data-tabindex")||"";return(0,a.AO)(e,n)||e.hasAttribute("data-tabindex")&&!t.startsWith("-")}),r=e.getAttribute("tabindex");t.current.includes("floating")||0===s.length?"0"!==r&&e.setAttribute("tabindex","0"):("-1"!==r||e.hasAttribute("data-tabindex")&&"-1"!==e.getAttribute("data-tabindex"))&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}const vt=n.forwardRef(function(e,t){return(0,Z.jsx)("button",{...e,type:"button",ref:t,tabIndex:-1,style:rt})});function bt(e){const{context:t,children:i,disabled:s=!1,order:o=["content"],guards:l=!0,initialFocus:c=0,returnFocus:h=!0,restoreFocus:u=!1,modal:d=!0,visuallyHiddenDismiss:p=!1,closeOnFocusOut:g=!0,outsideElementsInert:f=!1,getInsideElements:b=()=>[]}=e,{open:w,onOpenChange:I,events:P,dataRef:L,elements:{domReference:N,floating:O}}=t,F=_(()=>{var e;return null==(e=L.current.floatingContext)?void 0:e.nodeId}),G=_(b),B="number"==typeof c&&c<0,V=S(N)&&B,H="undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype,U=!H||l,z=!U||H&&f,j=k(o),q=k(c),X=k(h),Q=Re(),J=dt(),ee=n.useRef(null),te=n.useRef(null),ie=n.useRef(!1),ne=n.useRef(!1),se=n.useRef(-1),re=n.useRef(-1),oe=null!=J,ae=x(O),le=_(function(e){return void 0===e&&(e=ae),e?(0,a.Kr)(e,W()):[]}),ce=_(e=>{const t=le(e);return j.current.map(e=>N&&"reference"===e?N:ae&&"floating"===e?ae:t).filter(Boolean).flat()});n.useEffect(()=>{if(s)return;if(!d)return;function e(e){if("Tab"===e.key){y(ae,m(C(ae)))&&0===le().length&&!V&&M(e);const t=ce(),i=v(e);"reference"===j.current[0]&&i===N&&(M(e),e.shiftKey?qe(t[t.length-1]):qe(t[1])),"floating"===j.current[1]&&i===ae&&e.shiftKey&&(M(e),qe(t[0]))}}const t=C(ae);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}},[s,N,ae,d,j,V,le,ce]),n.useEffect(()=>{if(!s&&O)return O.addEventListener("focusin",e),()=>{O.removeEventListener("focusin",e)};function e(e){const t=v(e),i=le().indexOf(t);-1!==i&&(se.current=i)}},[s,O,le]),n.useEffect(()=>{if(s)return;if(!g)return;function e(){ne.current=!0,setTimeout(()=>{ne.current=!1})}function t(e){const t=e.relatedTarget,i=e.currentTarget,n=v(e);queueMicrotask(()=>{const s=F(),o=!(y(N,t)||y(O,t)||y(t,O)||y(null==J?void 0:J.portalNode,t)||null!=t&&t.hasAttribute(Le("focus-guard"))||Q&&(E(Q.nodesRef.current,s).find(e=>{var i,n;return y(null==(i=e.context)?void 0:i.elements.floating,t)||y(null==(n=e.context)?void 0:n.elements.domReference,t)})||A(Q.nodesRef.current,s).find(e=>{var i,n,s;return[null==(i=e.context)?void 0:i.elements.floating,x(null==(n=e.context)?void 0:n.elements.floating)].includes(t)||(null==(s=e.context)?void 0:s.elements.domReference)===t})));if(i===N&&ae&&yt(ae,j),u&&i!==N&&(null==n||!n.isConnected)&&m(C(ae))===C(ae).body){(0,r.sb)(ae)&&ae.focus();const e=se.current,t=le(),i=t[e]||t[t.length-1]||ae;(0,r.sb)(i)&&i.focus()}L.current.insideReactTree?L.current.insideReactTree=!1:!V&&d||!t||!o||ne.current||t===mt()||(ie.current=!0,I(!1,e,"focus-out"))})}const i=Boolean(!Q&&J);function n(){Ne(re),L.current.insideReactTree=!0,re.current=window.setTimeout(()=>{L.current.insideReactTree=!1})}return O&&(0,r.sb)(N)?(N.addEventListener("focusout",t),N.addEventListener("pointerdown",e),O.addEventListener("focusout",t),i&&O.addEventListener("focusout",n,!0),()=>{N.removeEventListener("focusout",t),N.removeEventListener("pointerdown",e),O.removeEventListener("focusout",t),i&&O.removeEventListener("focusout",n,!0)}):void 0},[s,N,O,ae,d,Q,J,I,g,u,le,V,F,j,L]);const he=n.useRef(null),ue=n.useRef(null),de=pt([he,null==J?void 0:J.beforeInsideRef]),pe=pt([ue,null==J?void 0:J.afterInsideRef]);function ge(e){return!s&&p&&d?(0,Z.jsx)(vt,{ref:"start"===e?ee:te,onClick:e=>I(!1,e.nativeEvent),children:"string"==typeof p?p:"Dismiss"}):null}n.useEffect(()=>{var e,t;if(s)return;if(!O)return;const i=Array.from((null==J||null==(e=J.portalNode)?void 0:e.querySelectorAll("["+Le("portal")+"]"))||[]),n=null==(t=(Q?A(Q.nodesRef.current,F()):[]).find(e=>{var t;return S((null==(t=e.context)?void 0:t.elements.domReference)||null)}))||null==(t=t.context)?void 0:t.elements.domReference,r=[O,n,...i,...G(),ee.current,te.current,he.current,ue.current,null==J?void 0:J.beforeOutsideRef.current,null==J?void 0:J.afterOutsideRef.current,j.current.includes("reference")||V?N:null].filter(e=>null!=e),o=d||V?st(r,!z,z):st(r);return()=>{o()}},[s,N,O,d,j,J,V,U,z,Q,F,G]),R(()=>{if(s||!(0,r.sb)(ae))return;const e=m(C(ae));queueMicrotask(()=>{const t=ce(ae),i=q.current,n=("number"==typeof i?t[i]:i.current)||ae,s=y(ae,e);B||s||!w||qe(n,{preventScroll:n===ae})})},[s,w,ae,B,ce,q]),R(()=>{if(s||!ae)return;const e=C(ae);var t;function i(e){let{reason:t,event:i,nested:n}=e;if(["hover","safe-polygon"].includes(t)&&"mouseleave"===i.type&&(ie.current=!0),"outside-press"===t)if(n)ie.current=!1;else if(T(i)||D(i))ie.current=!1;else{let e=!1;document.createElement("div").focus({get preventScroll(){return e=!0,!1}}),ie.current=!e}}t=m(e),ft(),t&&"body"!==(0,r.mq)(t)&&(gt.push(new WeakRef(t)),gt.length>20&&(gt=gt.slice(-20))),P.on("openchange",i);const n=e.createElement("span");return n.setAttribute("tabindex","-1"),n.setAttribute("aria-hidden","true"),Object.assign(n.style,rt),oe&&N&&N.insertAdjacentElement("afterend",n),()=>{P.off("openchange",i);const t=m(e),s=y(O,t)||Q&&E(Q.nodesRef.current,F(),!1).some(e=>{var i;return y(null==(i=e.context)?void 0:i.elements.floating,t)}),o=function(){if("boolean"==typeof X.current){const e=N||mt();return e&&e.isConnected?e:n}return X.current.current||n}();queueMicrotask(()=>{const i=function(e){const t=W();return(0,a.AO)(e,t)?e:(0,a.Kr)(e,t)[0]||e}(o);X.current&&!ie.current&&(0,r.sb)(i)&&(i===t||t===e.body||s)&&i.focus({preventScroll:!0}),n.remove()})}},[s,O,ae,X,L,P,Q,oe,N,F]),n.useEffect(()=>(queueMicrotask(()=>{ie.current=!1}),()=>{queueMicrotask(ft)}),[s]),R(()=>{if(!s&&J)return J.setFocusManagerState({modal:d,closeOnFocusOut:g,open:w,onOpenChange:I,domReference:N}),()=>{J.setFocusManagerState(null)}},[s,J,d,w,I,g,N]),R(()=>{s||ae&&yt(ae,j)},[s,ae,j]);const fe=!s&&U&&(!d||!V)&&(oe||d);return(0,Z.jsxs)(Z.Fragment,{children:[fe&&(0,Z.jsx)(ot,{"data-type":"inside",ref:de,onFocus:e=>{if(d){const e=ce();qe("reference"===o[0]?e[0]:e[e.length-1])}else if(null!=J&&J.preserveTabOrder&&J.portalNode)if(ie.current=!1,Y(e,J.portalNode)){const e=$(N);null==e||e.focus()}else{var t;null==(t=J.beforeOutsideRef.current)||t.focus()}}}),!V&&ge("start"),i,ge("end"),fe&&(0,Z.jsx)(ot,{"data-type":"inside",ref:pe,onFocus:e=>{if(d)qe(ce()[0]);else if(null!=J&&J.preserveTabOrder&&J.portalNode)if(g&&(ie.current=!0),Y(e,J.portalNode)){const e=K(N);null==e||e.focus()}else{var t;null==(t=J.afterOutsideRef.current)||t.focus()}}})]})}let Ct=0;const wt="--floating-ui-scrollbar-width";let St=()=>{};const xt=n.forwardRef(function(e,t){const{lockScroll:i=!1,...n}=e;return R(()=>{if(i)return Ct++,1===Ct&&(St=function(){const e=l(),t=/iP(hone|ad|od)|iOS/.test(e)||"MacIntel"===e&&navigator.maxTouchPoints>1,i=document.body.style,n=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",s=window.innerWidth-document.documentElement.clientWidth,r=i.left?parseFloat(i.left):window.scrollX,o=i.top?parseFloat(i.top):window.scrollY;if(i.overflow="hidden",i.setProperty(wt,s+"px"),s&&(i[n]=s+"px"),t){var a,c;const e=(null==(a=window.visualViewport)?void 0:a.offsetLeft)||0,t=(null==(c=window.visualViewport)?void 0:c.offsetTop)||0;Object.assign(i,{position:"fixed",top:-(o-Math.floor(t))+"px",left:-(r-Math.floor(e))+"px",right:"0"})}return()=>{Object.assign(i,{overflow:"",[n]:""}),i.removeProperty(wt),t&&(Object.assign(i,{position:"",top:"",left:"",right:""}),window.scrollTo(r,o))}}()),()=>{Ct--,0===Ct&&St()}},[i]),(0,Z.jsx)("div",{ref:t,...n,style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...n.style}})});function Et(e){return(0,r.sb)(e.target)&&"BUTTON"===e.target.tagName}function At(e){return w(e)}function Mt(e,t){void 0===t&&(t={});const{open:i,onOpenChange:s,dataRef:o,elements:{domReference:a}}=e,{enabled:l=!0,event:c="click",toggle:h=!0,ignoreMouse:u=!1,keyboardHandlers:d=!0,stickIfOpen:p=!0}=t,g=n.useRef(),f=n.useRef(!1),m=n.useMemo(()=>({onPointerDown(e){g.current=e.pointerType},onMouseDown(e){const t=g.current;0===e.button&&"click"!==c&&(I(t,!0)&&u||(!i||!h||o.current.openEvent&&p&&"mousedown"!==o.current.openEvent.type?(e.preventDefault(),s(!0,e.nativeEvent,"click")):s(!1,e.nativeEvent,"click")))},onClick(e){const t=g.current;"mousedown"===c&&g.current?g.current=void 0:I(t,!0)&&u||(!i||!h||o.current.openEvent&&p&&"click"!==o.current.openEvent.type?s(!0,e.nativeEvent,"click"):s(!1,e.nativeEvent,"click"))},onKeyDown(e){g.current=void 0,e.defaultPrevented||!d||Et(e)||(" "!==e.key||At(a)||(e.preventDefault(),f.current=!0),function(e){return(0,r.sb)(e.target)&&"A"===e.target.tagName}(e)||"Enter"===e.key&&s(!i||!h,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!d||Et(e)||At(a)||" "===e.key&&f.current&&(f.current=!1,s(!i||!h,e.nativeEvent,"click"))}}),[o,a,c,u,d,s,i,p,h]);return n.useMemo(()=>l?{reference:m}:{},[l,m])}function Tt(e){return null!=e&&null!=e.clientX}function Dt(e,t){void 0===t&&(t={});const{open:i,dataRef:s,elements:{floating:o,domReference:a},refs:l}=e,{enabled:c=!0,axis:h="both",x:u=null,y:d=null}=t,p=n.useRef(!1),g=n.useRef(null),[f,m]=n.useState(),[b,C]=n.useState([]),w=_((e,t)=>{p.current||s.current.openEvent&&!Tt(s.current.openEvent)||l.setPositionReference(function(e,t){let i=null,n=null,s=!1;return{contextElement:e||void 0,getBoundingClientRect(){var r;const o=(null==e?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},a="x"===t.axis||"both"===t.axis,l="y"===t.axis||"both"===t.axis,c=["mouseenter","mousemove"].includes((null==(r=t.dataRef.current.openEvent)?void 0:r.type)||"")&&"touch"!==t.pointerType;let h=o.width,u=o.height,d=o.x,p=o.y;return null==i&&t.x&&a&&(i=o.x-t.x),null==n&&t.y&&l&&(n=o.y-t.y),d-=i||0,p-=n||0,h=0,u=0,!s||c?(h="y"===t.axis?o.width:0,u="x"===t.axis?o.height:0,d=a&&null!=t.x?t.x:d,p=l&&null!=t.y?t.y:p):s&&!c&&(u="x"===t.axis?o.height:u,h="y"===t.axis?o.width:h),s=!0,{width:h,height:u,x:d,y:p,top:p,right:d+h,bottom:p+u,left:d}}}}(a,{x:e,y:t,axis:h,dataRef:s,pointerType:f}))}),S=_(e=>{null==u&&null==d&&(i?g.current||C([]):w(e.clientX,e.clientY))}),x=I(f)?o:i,E=n.useCallback(()=>{if(!x||!c||null!=u||null!=d)return;const e=(0,r.zk)(o);function t(i){const n=v(i);y(o,n)?(e.removeEventListener("mousemove",t),g.current=null):w(i.clientX,i.clientY)}if(!s.current.openEvent||Tt(s.current.openEvent)){e.addEventListener("mousemove",t);const i=()=>{e.removeEventListener("mousemove",t),g.current=null};return g.current=i,i}l.setPositionReference(a)},[x,c,u,d,o,s,l,a,w]);n.useEffect(()=>E(),[E,b]),n.useEffect(()=>{c&&!o&&(p.current=!1)},[c,o]),n.useEffect(()=>{!c&&i&&(p.current=!0)},[c,i]),R(()=>{!c||null==u&&null==d||(p.current=!1,w(u,d))},[c,u,d,w]);const A=n.useMemo(()=>{function e(e){let{pointerType:t}=e;m(t)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:S,onMouseEnter:S}},[S]);return n.useMemo(()=>c?{reference:A}:{},[c,A])}const It={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Rt={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},kt=e=>{var t,i;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(i=null==e?void 0:e.outsidePress)||i}};function Pt(e,t){void 0===t&&(t={});const{open:i,onOpenChange:s,elements:o,dataRef:a}=e,{enabled:l=!0,escapeKey:c=!0,outsidePress:h=!0,outsidePressEvent:u="pointerdown",referencePress:d=!1,referencePressEvent:p="pointerdown",ancestorScroll:g=!1,bubbles:f,capture:m}=t,w=Re(),S=_("function"==typeof h?h:()=>!1),x="function"==typeof h?S:h,A=n.useRef(!1),{escapeKey:M,outsidePress:T}=kt(f),{escapeKey:D,outsidePress:I}=kt(m),R=n.useRef(!1),k=_(e=>{var t;if(!i||!l||!c||"Escape"!==e.key)return;if(R.current)return;const n=null==(t=a.current.floatingContext)?void 0:t.nodeId,r=w?E(w.nodesRef.current,n):[];if(!M&&(e.stopPropagation(),r.length>0)){let e=!0;if(r.forEach(t=>{var i;null==(i=t.context)||!i.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)}),!e)return}s(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")}),P=_(e=>{var t;const i=()=>{var t;k(e),null==(t=v(e))||t.removeEventListener("keydown",i)};null==(t=v(e))||t.addEventListener("keydown",i)}),L=_(e=>{var t;const i=a.current.insideReactTree;a.current.insideReactTree=!1;const n=A.current;if(A.current=!1,"click"===u&&n)return;if(i)return;if("function"==typeof x&&!x(e))return;const l=v(e),c="["+Le("inert")+"]",h=C(o.floating).querySelectorAll(c);let d=(0,r.vq)(l)?l:null;for(;d&&!(0,r.eu)(d);){const e=(0,r.$4)(d);if((0,r.eu)(e)||!(0,r.vq)(e))break;d=e}if(h.length&&(0,r.vq)(l)&&!l.matches("html,body")&&!y(l,o.floating)&&Array.from(h).every(e=>!y(d,e)))return;if((0,r.sb)(l)&&F){const t=(0,r.eu)(l),i=(0,r.L9)(l),n=/auto|scroll/,s=t||n.test(i.overflowX),o=t||n.test(i.overflowY),a=s&&l.clientWidth>0&&l.scrollWidth>l.clientWidth,c=o&&l.clientHeight>0&&l.scrollHeight>l.clientHeight,h="rtl"===i.direction,u=c&&(h?e.offsetX<=l.offsetWidth-l.clientWidth:e.offsetX>l.clientWidth),d=a&&e.offsetY>l.clientHeight;if(u||d)return}const p=null==(t=a.current.floatingContext)?void 0:t.nodeId,g=w&&E(w.nodesRef.current,p).some(t=>{var i;return b(e,null==(i=t.context)?void 0:i.elements.floating)});if(b(e,o.floating)||b(e,o.domReference)||g)return;const f=w?E(w.nodesRef.current,p):[];if(f.length>0){let e=!0;if(f.forEach(t=>{var i;null==(i=t.context)||!i.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)}),!e)return}s(!1,e,"outside-press")}),N=_(e=>{var t;const i=()=>{var t;L(e),null==(t=v(e))||t.removeEventListener(u,i)};null==(t=v(e))||t.addEventListener(u,i)});n.useEffect(()=>{if(!i||!l)return;a.current.__escapeKeyBubbles=M,a.current.__outsidePressBubbles=T;let e=-1;function t(e){s(!1,e,"ancestor-scroll")}function n(){window.clearTimeout(e),R.current=!0}function h(){e=window.setTimeout(()=>{R.current=!1},(0,r.Tc)()?5:0)}const d=C(o.floating);c&&(d.addEventListener("keydown",D?P:k,D),d.addEventListener("compositionstart",n),d.addEventListener("compositionend",h)),x&&d.addEventListener(u,I?N:L,I);let p=[];return g&&((0,r.vq)(o.domReference)&&(p=(0,r.v9)(o.domReference)),(0,r.vq)(o.floating)&&(p=p.concat((0,r.v9)(o.floating))),!(0,r.vq)(o.reference)&&o.reference&&o.reference.contextElement&&(p=p.concat((0,r.v9)(o.reference.contextElement)))),p=p.filter(e=>{var t;return e!==(null==(t=d.defaultView)?void 0:t.visualViewport)}),p.forEach(e=>{e.addEventListener("scroll",t,{passive:!0})}),()=>{c&&(d.removeEventListener("keydown",D?P:k,D),d.removeEventListener("compositionstart",n),d.removeEventListener("compositionend",h)),x&&d.removeEventListener(u,I?N:L,I),p.forEach(e=>{e.removeEventListener("scroll",t)}),window.clearTimeout(e)}},[a,o,c,x,u,i,s,g,l,M,T,k,D,P,L,I,N]),n.useEffect(()=>{a.current.insideReactTree=!1},[a,x,u]);const O=n.useMemo(()=>({onKeyDown:k,...d&&{[It[p]]:e=>{s(!1,e.nativeEvent,"reference-press")},..."click"!==p&&{onClick(e){s(!1,e.nativeEvent,"reference-press")}}}}),[k,s,d,p]),F=n.useMemo(()=>{function e(e){0===e.button&&(A.current=!0)}return{onKeyDown:k,onMouseDown:e,onMouseUp:e,[Rt[u]]:()=>{a.current.insideReactTree=!0}}},[k,u,a]);return n.useMemo(()=>l?{reference:O,floating:F}:{},[l,O,F])}function _t(e){const{open:t=!1,onOpenChange:i,elements:s}=e,r=Ee(),o=n.useRef({}),[a]=n.useState(()=>Me()),l=null!=Ie(),[c,h]=n.useState(s.reference),u=_((e,t,n)=>{o.current.openEvent=e?t:void 0,a.emit("openchange",{open:e,event:t,reason:n,nested:l}),null==i||i(e,t,n)}),d=n.useMemo(()=>({setPositionReference:h}),[]),p=n.useMemo(()=>({reference:c||s.reference||null,floating:s.floating||null,domReference:s.reference}),[c,s.reference,s.floating]);return n.useMemo(()=>({dataRef:o,open:t,onOpenChange:u,elements:p,events:a,floatingId:r,refs:d}),[t,u,p,a,r,d])}function Lt(e){void 0===e&&(e={});const{nodeId:t}=e,i=_t({...e,elements:{reference:null,floating:null,...e.elements}}),s=e.rootContext||i,o=s.elements,[a,l]=n.useState(null),[c,h]=n.useState(null),u=(null==o?void 0:o.domReference)||a,d=n.useRef(null),p=Re();R(()=>{u&&(d.current=u)},[u]);const g=(0,J.we)({...e,elements:{...o,...c&&{reference:c}}}),f=n.useCallback(e=>{const t=(0,r.vq)(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;h(t),g.refs.setReference(t)},[g.refs]),m=n.useCallback(e=>{((0,r.vq)(e)||null===e)&&(d.current=e,l(e)),((0,r.vq)(g.refs.reference.current)||null===g.refs.reference.current||null!==e&&!(0,r.vq)(e))&&g.refs.setReference(e)},[g.refs]),y=n.useMemo(()=>({...g.refs,setReference:m,setPositionReference:f,domReference:d}),[g.refs,m,f]),v=n.useMemo(()=>({...g.elements,domReference:u}),[g.elements,u]),b=n.useMemo(()=>({...g,...s,refs:y,elements:v,nodeId:t}),[g,y,v,t,s]);return R(()=>{s.dataRef.current.floatingContext=b;const e=null==p?void 0:p.nodesRef.current.find(e=>e.id===t);e&&(e.context=b)}),n.useMemo(()=>({...g,context:b,refs:y,elements:v}),[g,y,v,b])}function Nt(){return l().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints&&h()}function Ot(e,t){void 0===t&&(t={});const{open:i,onOpenChange:s,events:o,dataRef:a,elements:l}=e,{enabled:c=!0,visibleOnly:h=!0}=t,u=n.useRef(!1),p=n.useRef(-1),g=n.useRef(!0);n.useEffect(()=>{if(!c)return;const e=(0,r.zk)(l.domReference);function t(){!i&&(0,r.sb)(l.domReference)&&l.domReference===m(C(l.domReference))&&(u.current=!0)}function n(){g.current=!0}function s(){g.current=!1}return e.addEventListener("blur",t),Nt()&&(e.addEventListener("keydown",n,!0),e.addEventListener("pointerdown",s,!0)),()=>{e.removeEventListener("blur",t),Nt()&&(e.removeEventListener("keydown",n,!0),e.removeEventListener("pointerdown",s,!0))}},[l.domReference,i,c]),n.useEffect(()=>{if(c)return o.on("openchange",e),()=>{o.off("openchange",e)};function e(e){let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(u.current=!0)}},[o,c]),n.useEffect(()=>()=>{Ne(p)},[]);const f=n.useMemo(()=>({onMouseLeave(){u.current=!1},onFocus(e){if(u.current)return;const t=v(e.nativeEvent);if(h&&(0,r.vq)(t))if(Nt()&&!e.relatedTarget){if(!g.current&&!w(t))return}else if(!function(e){if(!e||d())return!0;try{return e.matches(":focus-visible")}catch(e){return!0}}(t))return;s(!0,e.nativeEvent,"focus")},onBlur(e){u.current=!1;const t=e.relatedTarget,i=e.nativeEvent,n=(0,r.vq)(t)&&t.hasAttribute(Le("focus-guard"))&&"outside"===t.getAttribute("data-type");p.current=window.setTimeout(()=>{var e;const r=m(l.domReference?l.domReference.ownerDocument:document);(t||r!==l.domReference)&&(y(null==(e=a.current.floatingContext)?void 0:e.refs.floating.current,r)||y(l.domReference,r)||n||s(!1,i,"focus"))})}}),[a,l.domReference,s,h]);return n.useMemo(()=>c?{reference:f}:{},[c,f])}function Ft(e,t,i){const n=new Map,s="item"===i;let r=e;if(s&&e){const{[ae]:t,[le]:i,...n}=e;r=n}return{..."floating"===i&&{tabIndex:-1,[oe]:""},...r,...t.map(t=>{const n=t?t[i]:null;return"function"==typeof n?e?n(e):null:n}).concat(e).reduce((e,t)=>t?(Object.entries(t).forEach(t=>{let[i,r]=t;var o;s&&[ae,le].includes(i)||(0===i.indexOf("on")?(n.has(i)||n.set(i,[]),"function"==typeof r&&(null==(o=n.get(i))||o.push(r),e[i]=function(){for(var e,t=arguments.length,s=new Array(t),r=0;r<t;r++)s[r]=arguments[r];return null==(e=n.get(i))?void 0:e.map(e=>e(...s)).find(e=>void 0!==e)})):e[i]=r)}),e):e,{})}}function Gt(e){void 0===e&&(e=[]);const t=e.map(e=>null==e?void 0:e.reference),i=e.map(e=>null==e?void 0:e.floating),s=e.map(e=>null==e?void 0:e.item),r=n.useCallback(t=>Ft(t,e,"reference"),t),o=n.useCallback(t=>Ft(t,e,"floating"),i),a=n.useCallback(t=>Ft(t,e,"item"),s);return n.useMemo(()=>({getReferenceProps:r,getFloatingProps:o,getItemProps:a}),[r,o,a])}function Bt(e,t,i){switch(e){case"vertical":return t;case"horizontal":return i;default:return t||i}}function Vt(e,t){return Bt(t,e===ue||e===de,e===ce||e===he)}function Ht(e,t,i){return Bt(t,e===de,i?e===ce:e===he)||"Enter"===e||" "===e||""===e}function Ut(e,t,i){return Bt(t,i?e===ce:e===he,e===de)}function zt(e,t,i,n){return"both"===t||"horizontal"===t&&n&&n>1?"Escape"===e:Bt(t,i?e===he:e===ce,e===ue)}function Wt(e,t){const{open:i,onOpenChange:s,elements:o,floatingId:a}=e,{listRef:l,activeIndex:c,onNavigate:h=()=>{},enabled:u=!0,selectedIndex:d=null,allowEscape:p=!1,loop:g=!1,nested:f=!1,rtl:v=!1,virtual:b=!1,focusItemOnOpen:w="auto",focusItemOnHover:A=!0,openOnArrowKeyDown:I=!0,disabledIndices:P,orientation:L="vertical",parentOrientation:W,cols:j=1,scrollItemIntoView:$=!0,virtualItemRef:K,itemSizes:Y,dense:q=!1}=t,X=k(x(o.floating)),Z=Ie(),Q=Re();R(()=>{e.dataRef.current.orientation=L},[e,L]);const J=_(()=>{h(-1===ie.current?null:ie.current)}),ee=S(o.domReference),te=n.useRef(w),ie=n.useRef(null!=d?d:-1),ne=n.useRef(null),se=n.useRef(!0),re=n.useRef(J),oe=n.useRef(!!o.floating),ae=n.useRef(i),le=n.useRef(!1),ue=n.useRef(!1),pe=k(P),ge=k(i),fe=k($),me=k(d),[ye,ve]=n.useState(),[be,Ce]=n.useState(),we=_(()=>{function e(e){var t;b?(null!=(t=e.id)&&t.endsWith("-fui-option")&&(e.id=a+"-"+Math.random().toString(16).slice(2,10)),ve(e.id),null==Q||Q.events.emit("virtualfocus",e),K&&(K.current=e)):qe(e,{sync:le.current,preventScroll:!0})}const t=l.current[ie.current],i=ue.current;t&&e(t),(le.current?e=>e():requestAnimationFrame)(()=>{const n=l.current[ie.current]||t;if(!n)return;t||e(n);const s=fe.current;s&&xe&&(i||!se.current)&&(null==n.scrollIntoView||n.scrollIntoView("boolean"==typeof s?{block:"nearest",inline:"nearest"}:s))})});R(()=>{u&&(i&&o.floating?te.current&&null!=d&&(ue.current=!0,ie.current=d,J()):oe.current&&(ie.current=-1,re.current()))},[u,i,o.floating,d,J]),R(()=>{if(u&&i&&o.floating)if(null==c){if(le.current=!1,null!=me.current)return;if(oe.current&&(ie.current=-1,we()),(!ae.current||!oe.current)&&te.current&&(null!=ne.current||!0===te.current&&null==ne.current)){let e=0;const t=()=>{null==l.current[0]?(e<2&&(e?requestAnimationFrame:queueMicrotask)(t),e++):(ie.current=null==ne.current||Ht(ne.current,L,v)||f?O(l,pe.current):F(l,pe.current),ne.current=null,J())};t()}}else N(l,c)||(ie.current=c,we(),ue.current=!1)},[u,i,o.floating,c,me,f,l,L,v,J,we,pe]),R(()=>{var e;if(!u||o.floating||!Q||b||!oe.current)return;const t=Q.nodesRef.current,i=null==(e=t.find(e=>e.id===Z))||null==(e=e.context)?void 0:e.elements.floating,n=m(C(o.floating)),s=t.some(e=>e.context&&y(e.context.elements.floating,n));i&&!s&&se.current&&i.focus({preventScroll:!0})},[u,o.floating,Q,Z,b]),R(()=>{if(u&&Q&&b&&!Z)return Q.events.on("virtualfocus",e),()=>{Q.events.off("virtualfocus",e)};function e(e){Ce(e.id),K&&(K.current=e)}},[u,Q,b,Z,K]),R(()=>{re.current=J,ae.current=i,oe.current=!!o.floating}),R(()=>{i||(ne.current=null,te.current=w)},[i,w]);const Se=null!=c,xe=n.useMemo(()=>{function e(e){if(!ge.current)return;const t=l.current.indexOf(e);-1!==t&&ie.current!==t&&(ie.current=t,J())}return{onFocus(t){let{currentTarget:i}=t;le.current=!0,e(i)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},onMouseMove(t){let{currentTarget:i}=t;le.current=!0,ue.current=!1,A&&e(i)},onPointerLeave(e){let{pointerType:t}=e;var i;se.current&&"touch"!==t&&(le.current=!0,A&&(ie.current=-1,J(),b||null==(i=X.current)||i.focus({preventScroll:!0})))}}},[ge,X,A,l,J,b]),Ee=n.useCallback(()=>{var e;return null!=W?W:null==Q||null==(e=Q.nodesRef.current.find(e=>e.id===Z))||null==(e=e.context)||null==(e=e.dataRef)?void 0:e.current.orientation},[Z,Q,W]),Ae=_(e=>{if(se.current=!1,le.current=!0,229===e.which)return;if(!ge.current&&e.currentTarget===X.current)return;if(f&&zt(e.key,L,v,j))return Vt(e.key,Ee())||M(e),s(!1,e.nativeEvent,"list-navigation"),void((0,r.sb)(o.domReference)&&(b?null==Q||Q.events.emit("virtualfocus",o.domReference):o.domReference.focus()));const t=ie.current,n=O(l,P),a=F(l,P);if(ee||("Home"===e.key&&(M(e),ie.current=n,J()),"End"===e.key&&(M(e),ie.current=a,J())),j>1){const t=Y||Array.from({length:l.current.length},()=>({width:1,height:1})),i=V(t,j,q),s=i.findIndex(e=>null!=e&&!z(l,e,P)),r=i.reduce((e,t,i)=>null==t||z(l,t,P)?e:i,-1),o=i[B({current:i.map(e=>null!=e?l.current[e]:null)},{event:e,orientation:L,loop:g,rtl:v,cols:j,disabledIndices:U([...("function"!=typeof P?P:null)||l.current.map((e,t)=>z(l,t,P)?t:void 0),void 0],i),minIndex:s,maxIndex:r,prevIndex:H(ie.current>a?n:ie.current,t,i,j,e.key===de?"bl":e.key===(v?ce:he)?"tr":"tl"),stopEvent:!0})];if(null!=o&&(ie.current=o,J()),"both"===L)return}if(Vt(e.key,L)){if(M(e),i&&!b&&m(e.currentTarget.ownerDocument)===e.currentTarget)return ie.current=Ht(e.key,L,v)?n:a,void J();Ht(e.key,L,v)?ie.current=g?t>=a?p&&t!==l.current.length?-1:n:G(l,{startingIndex:t,disabledIndices:P}):Math.min(a,G(l,{startingIndex:t,disabledIndices:P})):ie.current=g?t<=n?p&&-1!==t?l.current.length:a:G(l,{startingIndex:t,decrement:!0,disabledIndices:P}):Math.max(n,G(l,{startingIndex:t,decrement:!0,disabledIndices:P})),N(l,ie.current)&&(ie.current=-1),J()}}),Me=n.useMemo(()=>b&&i&&Se&&{"aria-activedescendant":be||ye},[b,i,Se,be,ye]),Te=n.useMemo(()=>({"aria-orientation":"both"===L?void 0:L,...ee?{}:Me,onKeyDown:Ae,onPointerMove(){se.current=!0}}),[Me,Ae,L,ee]),De=n.useMemo(()=>{function e(e){"auto"===w&&T(e.nativeEvent)&&(te.current=!0)}function t(e){te.current=w,"auto"===w&&D(e.nativeEvent)&&(te.current=!0)}return{...Me,onKeyDown(e){se.current=!1;const t=e.key.startsWith("Arrow"),n=["Home","End"].includes(e.key),r=t||n,o=Ut(e.key,L,v),a=zt(e.key,L,v,j),c=Ut(e.key,Ee(),v),h=Vt(e.key,L),u=(f?c:h)||"Enter"===e.key||""===e.key.trim();if(b&&i){const t=null==Q?void 0:Q.nodesRef.current.find(e=>null==e.parentId),i=Q&&t?function(e,t){let i,n=-1;return function t(s,r){r>n&&(i=s,n=r),E(e,s).forEach(e=>{t(e.id,r+1)})}(t,0),e.find(e=>e.id===i)}(Q.nodesRef.current,t.id):null;if(r&&i&&K){const t=new KeyboardEvent("keydown",{key:e.key,bubbles:!0});if(o||a){var p,g;const n=(null==(p=i.context)?void 0:p.elements.domReference)===e.currentTarget,s=a&&!n?null==(g=i.context)?void 0:g.elements.domReference:o?l.current.find(e=>(null==e?void 0:e.id)===ye):null;s&&(M(e),s.dispatchEvent(t),Ce(void 0))}var m;if((h||n)&&i.context&&i.context.open&&i.parentId&&e.currentTarget!==i.context.elements.domReference)return M(e),void(null==(m=i.context.elements.domReference)||m.dispatchEvent(t))}return Ae(e)}if(i||I||!t){if(u){const t=Vt(e.key,Ee());ne.current=f&&t?null:e.key}f?c&&(M(e),i?(ie.current=O(l,pe.current),J()):s(!0,e.nativeEvent,"list-navigation")):h&&(null!=d&&(ie.current=d),M(e),!i&&I?s(!0,e.nativeEvent,"list-navigation"):Ae(e),i&&J())}},onFocus(){i&&!b&&(ie.current=-1,J())},onPointerDown:t,onPointerEnter:t,onMouseDown:e,onClick:e}},[ye,Me,j,Ae,pe,w,l,f,J,s,i,I,L,Ee,v,d,Q,b,K]);return n.useMemo(()=>u?{reference:De,floating:Te,item:xe}:{},[u,De,Te,xe])}const jt=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function $t(e,t){var i,s;void 0===t&&(t={});const{open:r,elements:o,floatingId:a}=e,{enabled:l=!0,role:c="dialog"}=t,h=Ee(),u=(null==(i=o.domReference)?void 0:i.id)||h,d=n.useMemo(()=>{var e;return(null==(e=x(o.floating))?void 0:e.id)||a},[o.floating,a]),p=null!=(s=jt.get(c))?s:c,g=null!=Ie(),f=n.useMemo(()=>"tooltip"===p||"label"===c?{["aria-"+("label"===c?"labelledby":"describedby")]:r?d:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":"alertdialog"===p?"dialog":p,"aria-controls":r?d:void 0,..."listbox"===p&&{role:"combobox"},..."menu"===p&&{id:u},..."menu"===p&&g&&{role:"menuitem"},..."select"===c&&{"aria-autocomplete":"none"},..."combobox"===c&&{"aria-autocomplete":"list"}},[p,d,g,r,u,c]),m=n.useMemo(()=>{const e={id:d,...p&&{role:p}};return"tooltip"===p||"label"===c?e:{...e,..."menu"===p&&{"aria-labelledby":u}}},[p,d,u,c]),y=n.useCallback(e=>{let{active:t,selected:i}=e;const n={role:"option",...t&&{id:d+"-fui-option"}};switch(c){case"select":case"combobox":return{...n,"aria-selected":i}}return{}},[d,c]);return n.useMemo(()=>l?{reference:f,floating:m,item:y}:{},[l,f,m,y])}const Kt=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,t)=>(t?"-":"")+e.toLowerCase());function Yt(e,t){return"function"==typeof e?e(t):e}function qt(e,t){void 0===t&&(t={});const{open:i,elements:{floating:s}}=e,{duration:r=250}=t,o=("number"==typeof r?r:r.close)||0,[a,l]=n.useState("unmounted"),c=function(e,t){const[i,s]=n.useState(e);return e&&!i&&s(!0),n.useEffect(()=>{if(!e&&i){const e=setTimeout(()=>s(!1),t);return()=>clearTimeout(e)}},[e,i,t]),i}(i,o);return c||"close"!==a||l("unmounted"),R(()=>{if(s){if(i){l("initial");const e=requestAnimationFrame(()=>{Q.flushSync(()=>{l("open")})});return()=>{cancelAnimationFrame(e)}}l("close")}},[i,s]),{isMounted:c,status:a}}function Xt(e,t){void 0===t&&(t={});const{initial:i={opacity:0},open:s,close:r,common:o,duration:a=250}=t,l=e.placement,c=l.split("-")[0],h=n.useMemo(()=>({side:c,placement:l}),[c,l]),u="number"==typeof a,d=(u?a:a.open)||0,p=(u?a:a.close)||0,[g,f]=n.useState(()=>({...Yt(o,h),...Yt(i,h)})),{isMounted:m,status:y}=qt(e,{duration:a}),v=k(i),b=k(s),C=k(r),w=k(o);return R(()=>{const e=Yt(v.current,h),t=Yt(C.current,h),i=Yt(w.current,h),n=Yt(b.current,h)||Object.keys(e).reduce((e,t)=>(e[t]="",e),{});if("initial"===y&&f(t=>({transitionProperty:t.transitionProperty,...i,...e})),"open"===y&&f({transitionProperty:Object.keys(n).map(Kt).join(","),transitionDuration:d+"ms",...i,...n}),"close"===y){const n=t||e;f({transitionProperty:Object.keys(n).map(Kt).join(","),transitionDuration:p+"ms",...i,...n})}},[p,C,v,b,w,d,y,h]),{isMounted:m,styles:g}}function Zt(e,t){var i;const{open:s,dataRef:r}=e,{listRef:o,activeIndex:a,onMatch:l,onTypingChange:c,enabled:h=!0,findMatch:u=null,resetMs:d=750,ignoreKeys:p=[],selectedIndex:g=null}=t,f=n.useRef(-1),m=n.useRef(""),y=n.useRef(null!=(i=null!=g?g:a)?i:-1),v=n.useRef(null),b=_(l),C=_(c),w=k(u),S=k(p);R(()=>{s&&(Ne(f),v.current=null,m.current="")},[s]),R(()=>{var e;s&&""===m.current&&(y.current=null!=(e=null!=g?g:a)?e:-1)},[s,g,a]);const x=_(e=>{e?r.current.typing||(r.current.typing=e,C(e)):r.current.typing&&(r.current.typing=e,C(e))}),E=_(e=>{function t(e,t,i){const n=w.current?w.current(t,i):t.find(e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(i.toLocaleLowerCase())));return n?e.indexOf(n):-1}const i=o.current;if(m.current.length>0&&" "!==m.current[0]&&(-1===t(i,i,m.current)?x(!1):" "===e.key&&M(e)),null==i||S.current.includes(e.key)||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey)return;s&&" "!==e.key&&(M(e),x(!0)),i.every(e=>{var t,i;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(i=e[1])?void 0:i.toLocaleLowerCase())})&&m.current===e.key&&(m.current="",y.current=v.current),m.current+=e.key,Ne(f),f.current=window.setTimeout(()=>{m.current="",y.current=v.current,x(!1)},d);const n=y.current,r=t(i,[...i.slice((n||0)+1),...i.slice(0,(n||0)+1)],m.current);-1!==r?(b(r),v.current=r):" "!==e.key&&(m.current="",x(!1))}),A=n.useMemo(()=>({onKeyDown:E}),[E]),T=n.useMemo(()=>({onKeyDown:E,onKeyUp(e){" "===e.key&&x(!1)}}),[E,x]);return n.useMemo(()=>h?{reference:A,floating:T}:{},[h,A,T])}function Qt(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const Jt=e=>({name:"inner",options:e,async fn(t){const{listRef:i,overflowRef:n,onFallbackChange:s,offset:r=0,index:a=0,minItemsVisible:l=4,referenceOverflowThreshold:c=0,scrollRef:h,...u}=(0,o._3)(e,t),{rects:d,platform:p,elements:{floating:g}}=t,f=i.current[a],m=(null==h?void 0:h.current)||g,y=g.clientTop||m.clientTop,v=0!==g.clientTop,b=0!==m.clientTop,C=g===m;if(!f)return{};const w={...t,...await(0,J.cY)(-f.offsetTop-g.clientTop-d.reference.height/2-f.offsetHeight/2-r).fn(t)},S=await p.detectOverflow(Qt(w,m.scrollHeight+y+g.clientTop),u),x=await p.detectOverflow(w,{...u,elementContext:"reference"}),E=(0,o.T9)(0,S.top),A=w.y+E,M=(m.scrollHeight>m.clientHeight?e=>e:o.LI)((0,o.T9)(0,m.scrollHeight+(v&&C||b?2*y:0)-E-(0,o.T9)(0,S.bottom)));if(m.style.maxHeight=M+"px",m.scrollTop=E,s){const e=m.offsetHeight<f.offsetHeight*(0,o.jk)(l,i.current.length)-1||x.top>=-c||x.bottom>=-c;Q.flushSync(()=>s(e))}return n&&(n.current=await p.detectOverflow(Qt({...w,y:A},m.offsetHeight+y+g.clientTop),u)),{y:A}}});function ei(e,t){const{open:i,elements:s}=e,{enabled:r=!0,overflowRef:o,scrollRef:a,onChange:l}=t,h=_(l),u=n.useRef(!1),d=n.useRef(null),p=n.useRef(null);n.useEffect(()=>{if(!r)return;function e(e){if(e.ctrlKey||!t||null==o.current)return;const i=e.deltaY,n=o.current.top>=-.5,s=o.current.bottom>=-.5,r=t.scrollHeight-t.clientHeight,a=i<0?-1:1,l=i<0?"max":"min";t.scrollHeight<=t.clientHeight||(!n&&i>0||!s&&i<0?(e.preventDefault(),Q.flushSync(()=>{h(e=>e+Math[l](i,r*a))})):/firefox/i.test(c())&&(t.scrollTop+=i))}const t=(null==a?void 0:a.current)||s.floating;return i&&t?(t.addEventListener("wheel",e),requestAnimationFrame(()=>{d.current=t.scrollTop,null!=o.current&&(p.current={...o.current})}),()=>{d.current=null,p.current=null,t.removeEventListener("wheel",e)}):void 0},[r,i,s.floating,o,a,h]);const g=n.useMemo(()=>({onKeyDown(){u.current=!0},onWheel(){u.current=!1},onPointerMove(){u.current=!1},onScroll(){const e=(null==a?void 0:a.current)||s.floating;if(o.current&&e&&u.current){if(null!==d.current){const t=e.scrollTop-d.current;(o.current.bottom<-.5&&t<-1||o.current.top<-.5&&t>1)&&Q.flushSync(()=>h(e=>e+t))}requestAnimationFrame(()=>{d.current=e.scrollTop})}}}),[s.floating,h,o,a]);return n.useMemo(()=>r?{floating:g}:{},[r,g])}function ti(e,t,i){return void 0===i&&(i=!0),e.filter(e=>{var n;return e.parentId===t&&(!i||(null==(n=e.context)?void 0:n.open))}).flatMap(t=>[t,...ti(e,t.id,i)])}function ii(e,t){const[i,n]=e;let s=!1;const r=t.length;for(let e=0,o=r-1;e<r;o=e++){const[r,a]=t[e]||[0,0],[l,c]=t[o]||[0,0];a>=n!=c>=n&&i<=(l-r)*(n-a)/(c-a)+r&&(s=!s)}return s}function ni(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:i=!1,requireIntent:n=!0}=e,s={current:-1};let o=!1,a=null,l=null,c="undefined"!=typeof performance?performance.now():0;const h=e=>{let{x:i,y:h,placement:u,elements:d,onClose:p,nodeId:g,tree:f}=e;return function(e){function m(){Ne(s),p()}if(Ne(s),!d.domReference||!d.floating||null==u||null==i||null==h)return;const{clientX:y,clientY:v}=e,b=[y,v],C=function(e){return"composedPath"in e?e.composedPath()[0]:e.target}(e),w="mouseleave"===e.type,S=Xe(d.floating,C),x=Xe(d.domReference,C),E=d.domReference.getBoundingClientRect(),A=d.floating.getBoundingClientRect(),M=u.split("-")[0],T=i>A.right-A.width/2,D=h>A.bottom-A.height/2,I=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(b,E),R=A.width>E.width,k=A.height>E.height,P=(R?E:A).left,_=(R?E:A).right,L=(k?E:A).top,N=(k?E:A).bottom;if(S&&(o=!0,!w))return;if(x&&(o=!1),x&&!w)return void(o=!0);if(w&&(0,r.vq)(e.relatedTarget)&&Xe(d.floating,e.relatedTarget))return;if(f&&ti(f.nodesRef.current,g).length)return;if("top"===M&&h>=E.bottom-1||"bottom"===M&&h<=E.top+1||"left"===M&&i>=E.right-1||"right"===M&&i<=E.left+1)return m();let O=[];switch(M){case"top":O=[[P,E.top+1],[P,A.bottom-1],[_,A.bottom-1],[_,E.top+1]];break;case"bottom":O=[[P,A.top+1],[P,E.bottom-1],[_,E.bottom-1],[_,A.top+1]];break;case"left":O=[[A.right-1,N],[A.right-1,L],[E.left+1,L],[E.left+1,N]];break;case"right":O=[[E.right-1,N],[E.right-1,L],[A.left+1,L],[A.left+1,N]]}if(!ii([y,v],O)){if(o&&!I)return m();if(!w&&n){const t=function(e,t){const i=performance.now(),n=i-c;if(null===a||null===l||0===n)return a=e,l=t,c=i,null;const s=e-a,r=t-l,o=Math.sqrt(s*s+r*r);return a=e,l=t,c=i,o/n}(e.clientX,e.clientY);if(null!==t&&t<.1)return m()}ii([y,v],function(e){let[i,n]=e;switch(M){case"top":return[[R?i+t/2:T?i+4*t:i-4*t,n+t+1],[R?i-t/2:T?i+4*t:i-4*t,n+t+1],[A.left,T||R?A.bottom-t:A.top],[A.right,T?R?A.bottom-t:A.top:A.bottom-t]];case"bottom":return[[R?i+t/2:T?i+4*t:i-4*t,n-t],[R?i-t/2:T?i+4*t:i-4*t,n-t],[A.left,T||R?A.top+t:A.bottom],[A.right,T?R?A.top+t:A.bottom:A.top+t]];case"left":{const e=[i+t+1,k?n+t/2:D?n+4*t:n-4*t],s=[i+t+1,k?n-t/2:D?n+4*t:n-4*t];return[[D||k?A.right-t:A.left,A.top],[D?k?A.right-t:A.left:A.right-t,A.bottom],e,s]}case"right":return[[i-t,k?n+t/2:D?n+4*t:n-4*t],[i-t,k?n-t/2:D?n+4*t:n-4*t],[D||k?A.left+t:A.right,A.top],[D?k?A.left+t:A.right:A.left+t,A.bottom]]}}([i,h]))?!o&&n&&(s.current=window.setTimeout(m,40)):m()}}};return h.__options={blockPointerEvents:i},h}},57735(e,t,i){"use strict";var n;i.r(t),i.d(t,{activeElement:()=>y,contains:()=>v,createGridCellMap:()=>j,disableFocusInside:()=>ee,enableFocusInside:()=>te,findNonDisabledListIndex:()=>z,getDeepestNode:()=>D,getDocument:()=>S,getFloatingFocusElement:()=>M,getGridCellIndexOfCorner:()=>$,getGridCellIndices:()=>K,getGridNavigatedIndex:()=>W,getMaxListIndex:()=>U,getMinListIndex:()=>H,getNextTabbable:()=>Z,getNodeAncestors:()=>I,getNodeChildren:()=>T,getPlatform:()=>l,getPreviousTabbable:()=>Q,getTabbableOptions:()=>q,getTarget:()=>b,getUserAgent:()=>c,isAndroid:()=>u,isDifferentGridRow:()=>B,isEventTargetWithin:()=>C,isIndexOutOfListBounds:()=>V,isJSDOM:()=>p,isListIndexDisabled:()=>Y,isMac:()=>d,isMouseLikePointerType:()=>L,isOutsideEvent:()=>J,isReactEvent:()=>k,isRootElement:()=>w,isSafari:()=>h,isTypeableCombobox:()=>E,isTypeableElement:()=>x,isVirtualClick:()=>P,isVirtualPointerEvent:()=>_,matchesFocusVisible:()=>A,stopEvent:()=>R,useEffectEvent:()=>G,useLatestRef:()=>O,useModernLayoutEffect:()=>N});var s=i(32125),r=i(22155),o=i(51771),a=i(86668);function l(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function c(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:i}=e;return t+"/"+i}).join(" "):navigator.userAgent}function h(){return/apple/i.test(navigator.vendor)}function u(){const e=/android/i;return e.test(l())||e.test(c())}function d(){return l().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function p(){return c().includes("jsdom/")}const g="data-floating-ui-focusable",f="ArrowLeft",m="ArrowRight";function y(e){let t=e.activeElement;for(;null!=(null==(i=t)||null==(i=i.shadowRoot)?void 0:i.activeElement);){var i;t=t.shadowRoot.activeElement}return t}function v(e,t){if(!e||!t)return!1;const i=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(i&&(0,s.Ng)(i)){let i=t;for(;i;){if(e===i)return!0;i=i.parentNode||i.host}}return!1}function b(e){return"composedPath"in e?e.composedPath()[0]:e.target}function C(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const i=e;return null!=i.target&&t.contains(i.target)}function w(e){return e.matches("html,body")}function S(e){return(null==e?void 0:e.ownerDocument)||document}function x(e){return(0,s.sb)(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function E(e){return!!e&&"combobox"===e.getAttribute("role")&&x(e)}function A(e){if(!e||p())return!0;try{return e.matches(":focus-visible")}catch(e){return!0}}function M(e){return e?e.hasAttribute(g)?e:e.querySelector("["+g+"]")||e:null}function T(e,t,i){return void 0===i&&(i=!0),e.filter(e=>{var n;return e.parentId===t&&(!i||(null==(n=e.context)?void 0:n.open))}).flatMap(t=>[t,...T(e,t.id,i)])}function D(e,t){let i,n=-1;return function t(s,r){r>n&&(i=s,n=r),T(e,s).forEach(e=>{t(e.id,r+1)})}(t,0),e.find(e=>e.id===i)}function I(e,t){var i;let n=[],s=null==(i=e.find(e=>e.id===t))?void 0:i.parentId;for(;s;){const t=e.find(e=>e.id===s);s=null==t?void 0:t.parentId,t&&(n=n.concat(t))}return n}function R(e){e.preventDefault(),e.stopPropagation()}function k(e){return"nativeEvent"in e}function P(e){return!(0!==e.mozInputSource||!e.isTrusted)||(u()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function _(e){return!p()&&(!u()&&0===e.width&&0===e.height||u()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function L(e,t){const i=["mouse","pen"];return t||i.push("",void 0),i.includes(e)}var N="undefined"!=typeof document?r.useLayoutEffect:function(){};function O(e){const t=r.useRef(e);return N(()=>{t.current=e}),t}const F={...n||(n=i.t(r,2))}.useInsertionEffect||(e=>e());function G(e){const t=r.useRef(()=>{});return F(()=>{t.current=e}),r.useCallback(function(){for(var e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return null==t.current?void 0:t.current(...i)},[])}function B(e,t,i){return Math.floor(e/t)!==i}function V(e,t){return t<0||t>=e.current.length}function H(e,t){return z(e,{disabledIndices:t})}function U(e,t){return z(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function z(e,t){let{startingIndex:i=-1,decrement:n=!1,disabledIndices:s,amount:r=1}=void 0===t?{}:t,o=i;do{o+=n?-r:r}while(o>=0&&o<=e.current.length-1&&Y(e,o,s));return o}function W(e,t){let{event:i,orientation:n,loop:s,rtl:r,cols:a,disabledIndices:l,minIndex:c,maxIndex:h,prevIndex:u,stopEvent:d=!1}=t,p=u;if("ArrowUp"===i.key){if(d&&R(i),-1===u)p=h;else if(p=z(e,{startingIndex:p,amount:a,decrement:!0,disabledIndices:l}),s&&(u-a<c||p<0)){const e=u%a,t=h%a,i=h-(t-e);p=t===e?h:t>e?i:i-a}V(e,p)&&(p=u)}if("ArrowDown"===i.key&&(d&&R(i),-1===u?p=c:(p=z(e,{startingIndex:u,amount:a,disabledIndices:l}),s&&u+a>h&&(p=z(e,{startingIndex:u%a-a,amount:a,disabledIndices:l}))),V(e,p)&&(p=u)),"both"===n){const t=(0,o.RI)(u/a);i.key===(r?f:m)&&(d&&R(i),u%a!==a-1?(p=z(e,{startingIndex:u,disabledIndices:l}),s&&B(p,a,t)&&(p=z(e,{startingIndex:u-u%a-1,disabledIndices:l}))):s&&(p=z(e,{startingIndex:u-u%a-1,disabledIndices:l})),B(p,a,t)&&(p=u)),i.key===(r?m:f)&&(d&&R(i),u%a!==0?(p=z(e,{startingIndex:u,decrement:!0,disabledIndices:l}),s&&B(p,a,t)&&(p=z(e,{startingIndex:u+(a-u%a),decrement:!0,disabledIndices:l}))):s&&(p=z(e,{startingIndex:u+(a-u%a),decrement:!0,disabledIndices:l})),B(p,a,t)&&(p=u));const n=(0,o.RI)(h/a)===t;V(e,p)&&(p=s&&n?i.key===(r?m:f)?h:z(e,{startingIndex:u-u%a-1,disabledIndices:l}):u)}return p}function j(e,t,i){const n=[];let s=0;return e.forEach((e,r)=>{let{width:o,height:a}=e,l=!1;for(i&&(s=0);!l;){const e=[];for(let i=0;i<o;i++)for(let n=0;n<a;n++)e.push(s+i+n*t);s%t+o<=t&&e.every(e=>null==n[e])?(e.forEach(e=>{n[e]=r}),l=!0):s++}}),[...n]}function $(e,t,i,n,s){if(-1===e)return-1;const r=i.indexOf(e),o=t[e];switch(s){case"tl":return r;case"tr":return o?r+o.width-1:r;case"bl":return o?r+(o.height-1)*n:r;case"br":return i.lastIndexOf(e)}}function K(e,t){return t.flatMap((t,i)=>e.includes(t)?[i]:[])}function Y(e,t,i){if("function"==typeof i)return i(t);if(i)return i.includes(t);const n=e.current[t];return null==n||n.hasAttribute("disabled")||"true"===n.getAttribute("aria-disabled")}const q=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function X(e,t){const i=(0,a.Kr)(e,q()),n=i.length;if(0===n)return;const s=y(S(e)),r=i.indexOf(s);return i[-1===r?1===t?0:n-1:r+t]}function Z(e){return X(S(e).body,1)||e}function Q(e){return X(S(e).body,-1)||e}function J(e,t){const i=t||e.currentTarget,n=e.relatedTarget;return!n||!v(i,n)}function ee(e){(0,a.Kr)(e,q()).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})}function te(e){e.querySelectorAll("[data-tabindex]").forEach(e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")})}},31924(e,t,i){"use strict";i.r(t),i.d(t,{alignments:()=>s,clamp:()=>d,createCoords:()=>h,evaluate:()=>p,expandPaddingObject:()=>I,floor:()=>c,getAlignment:()=>f,getAlignmentAxis:()=>b,getAlignmentSides:()=>C,getAxisLength:()=>y,getExpandedPlacements:()=>w,getOppositeAlignmentPlacement:()=>S,getOppositeAxis:()=>m,getOppositeAxisPlacements:()=>T,getOppositePlacement:()=>D,getPaddingObject:()=>R,getSide:()=>g,getSideAxis:()=>v,max:()=>a,min:()=>o,placements:()=>r,rectToClientRect:()=>k,round:()=>l,sides:()=>n});const n=["top","right","bottom","left"],s=["start","end"],r=n.reduce((e,t)=>e.concat(t,t+"-"+s[0],t+"-"+s[1]),[]),o=Math.min,a=Math.max,l=Math.round,c=Math.floor,h=e=>({x:e,y:e}),u={left:"right",right:"left",bottom:"top",top:"bottom"};function d(e,t,i){return a(e,o(t,i))}function p(e,t){return"function"==typeof e?e(t):e}function g(e){return e.split("-")[0]}function f(e){return e.split("-")[1]}function m(e){return"x"===e?"y":"x"}function y(e){return"y"===e?"height":"width"}function v(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function b(e){return m(v(e))}function C(e,t,i){void 0===i&&(i=!1);const n=f(e),s=b(e),r=y(s);let o="x"===s?n===(i?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[r]>t.floating[r]&&(o=D(o)),[o,D(o)]}function w(e){const t=D(e);return[S(e),t,S(t)]}function S(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const x=["left","right"],E=["right","left"],A=["top","bottom"],M=["bottom","top"];function T(e,t,i,n){const s=f(e);let r=function(e,t,i){switch(e){case"top":case"bottom":return i?t?E:x:t?x:E;case"left":case"right":return t?A:M;default:return[]}}(g(e),"start"===i,n);return s&&(r=r.map(e=>e+"-"+s),t&&(r=r.concat(r.map(S)))),r}function D(e){const t=g(e);return u[t]+e.slice(t.length)}function I(e){return{top:0,right:0,bottom:0,left:0,...e}}function R(e){return"number"!=typeof e?I(e):{top:e,right:e,bottom:e,left:e}}function k(e){const{x:t,y:i,width:n,height:s}=e;return{width:n,height:s,top:i,left:t,right:t+n,bottom:i+s,x:t,y:i}}},81323(e,t,i){"use strict";function n(e,t,i){if(void 0===i&&(i=Error),!e)throw new i(t)}i.d(t,{V1:()=>n})},59556(e,t,i){"use strict";function n(e,t){var i=t&&t.cache?t.cache:h,n=t&&t.serializer?t.serializer:l;return(t&&t.strategy?t.strategy:a)(e,{cache:i,serializer:n})}function s(e,t,i,n){var s,r=null==(s=n)||"number"==typeof s||"boolean"==typeof s?n:i(n),o=t.get(r);return void 0===o&&(o=e.call(this,n),t.set(r,o)),o}function r(e,t,i){var n=Array.prototype.slice.call(arguments,3),s=i(n),r=t.get(s);return void 0===r&&(r=e.apply(this,n),t.set(s,r)),r}function o(e,t,i,n,s){return i.bind(t,e,n,s)}function a(e,t){return o(e,this,1===e.length?s:r,t.cache.create(),t.serializer)}i.d(t,{A:()=>n,W:()=>u});var l=function(){return JSON.stringify(arguments)};function c(){this.cache=Object.create(null)}c.prototype.get=function(e){return this.cache[e]},c.prototype.set=function(e,t){this.cache[e]=t};var h={create:function(){return new c}},u={variadic:function(e,t){return o(e,this,r,t.cache.create(),t.serializer)},monadic:function(e,t){return o(e,this,s,t.cache.create(),t.serializer)}}},9991(e,t,i){"use strict";function n(e,t){var i=t&&t.cache?t.cache:h,n=t&&t.serializer?t.serializer:l;return(t&&t.strategy?t.strategy:a)(e,{cache:i,serializer:n})}function s(e,t,i,n){var s,r=null==(s=n)||"number"==typeof s||"boolean"==typeof s?n:i(n),o=t.get(r);return void 0===o&&(o=e.call(this,n),t.set(r,o)),o}function r(e,t,i){var n=Array.prototype.slice.call(arguments,3),s=i(n),r=t.get(s);return void 0===r&&(r=e.apply(this,n),t.set(s,r)),r}function o(e,t,i,n,s){return i.bind(t,e,n,s)}function a(e,t){return o(e,this,1===e.length?s:r,t.cache.create(),t.serializer)}i.d(t,{B:()=>n,W:()=>u});var l=function(){return JSON.stringify(arguments)},c=function(){function e(){this.cache=Object.create(null)}return e.prototype.get=function(e){return this.cache[e]},e.prototype.set=function(e,t){this.cache[e]=t},e}(),h={create:function(){return new c}},u={variadic:function(e,t){return o(e,this,r,t.cache.create(),t.serializer)},monadic:function(e,t){return o(e,this,s,t.cache.create(),t.serializer)}}},26140(e,t,i){"use strict";i.d(t,{ZE:()=>s,Im:()=>l,tv:()=>h,Tu:()=>y,eW:()=>a,oF:()=>c,N1:()=>m,N6:()=>p,jA:()=>g,Jp:()=>d,xm:()=>f,Qh:()=>u,qg:()=>ae});var n,s,r,o=i(65959);function a(e){return e.type===s.literal}function l(e){return e.type===s.argument}function c(e){return e.type===s.number}function h(e){return e.type===s.date}function u(e){return e.type===s.time}function d(e){return e.type===s.select}function p(e){return e.type===s.plural}function g(e){return e.type===s.pound}function f(e){return e.type===s.tag}function m(e){return!(!e||"object"!=typeof e||e.type!==r.number)}function y(e){return!(!e||"object"!=typeof e||e.type!==r.dateTime)}!function(e){e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"}(n||(n={})),function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"}(s||(s={})),function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"}(r||(r={}));var v=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,b=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function C(e){var t={};return e.replace(b,function(e){var i=e.length;switch(e[0]){case"G":t.era=4===i?"long":5===i?"narrow":"short";break;case"y":t.year=2===i?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][i-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][i-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=4===i?"short":5===i?"narrow":"short";break;case"e":if(i<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][i-4];break;case"c":if(i<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][i-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][i-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][i-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][i-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][i-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][i-1];break;case"s":t.second=["numeric","2-digit"][i-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=i<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),t}var w=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function S(e){return e.replace(/^(.*?)-/,"")}var x=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,E=/^(@+)?(\+|#+)?[rs]?$/g,A=/(\*)(0+)|(#+)(0+)|(0+)/g,M=/^(0+)$/;function T(e){var t={};return"r"===e[e.length-1]?t.roundingPriority="morePrecision":"s"===e[e.length-1]&&(t.roundingPriority="lessPrecision"),e.replace(E,function(e,i,n){return"string"!=typeof n?(t.minimumSignificantDigits=i.length,t.maximumSignificantDigits=i.length):"+"===n?t.minimumSignificantDigits=i.length:"#"===i[0]?t.maximumSignificantDigits=i.length:(t.minimumSignificantDigits=i.length,t.maximumSignificantDigits=i.length+("string"==typeof n?n.length:0)),""}),t}function D(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function I(e){var t;if("E"===e[0]&&"E"===e[1]?(t={notation:"engineering"},e=e.slice(2)):"E"===e[0]&&(t={notation:"scientific"},e=e.slice(1)),t){var i=e.slice(0,2);if("+!"===i?(t.signDisplay="always",e=e.slice(2)):"+?"===i&&(t.signDisplay="exceptZero",e=e.slice(2)),!M.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function R(e){return D(e)||{}}function k(e){for(var t={},i=0,n=e;i<n.length;i++){var s=n[i];switch(s.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=s.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=S(s.options[0]);continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t=(0,o.__assign)((0,o.__assign)((0,o.__assign)({},t),{notation:"scientific"}),s.options.reduce(function(e,t){return(0,o.__assign)((0,o.__assign)({},e),R(t))},{}));continue;case"engineering":t=(0,o.__assign)((0,o.__assign)((0,o.__assign)({},t),{notation:"engineering"}),s.options.reduce(function(e,t){return(0,o.__assign)((0,o.__assign)({},e),R(t))},{}));continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(s.options[0]);continue;case"integer-width":if(s.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");s.options[0].replace(A,function(e,i,n,s,r,o){if(i)t.minimumIntegerDigits=n.length;else{if(s&&r)throw new Error("We currently do not support maximum integer digits");if(o)throw new Error("We currently do not support exact integer digits")}return""});continue}if(M.test(s.stem))t.minimumIntegerDigits=s.stem.length;else if(x.test(s.stem)){if(s.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");s.stem.replace(x,function(e,i,n,s,r,o){return"*"===n?t.minimumFractionDigits=i.length:s&&"#"===s[0]?t.maximumFractionDigits=s.length:r&&o?(t.minimumFractionDigits=r.length,t.maximumFractionDigits=r.length+o.length):(t.minimumFractionDigits=i.length,t.maximumFractionDigits=i.length),""});var r=s.options[0];"w"===r?t=(0,o.__assign)((0,o.__assign)({},t),{trailingZeroDisplay:"stripIfInteger"}):r&&(t=(0,o.__assign)((0,o.__assign)({},t),T(r)))}else if(E.test(s.stem))t=(0,o.__assign)((0,o.__assign)({},t),T(s.stem));else{var a=D(s.stem);a&&(t=(0,o.__assign)((0,o.__assign)({},t),a));var l=I(s.stem);l&&(t=(0,o.__assign)((0,o.__assign)({},t),l))}}return t}var P,_={AX:["H"],BQ:["H"],CP:["H"],CZ:["H"],DK:["H"],FI:["H"],ID:["H"],IS:["H"],ML:["H"],NE:["H"],RU:["H"],SE:["H"],SJ:["H"],SK:["H"],AS:["h","H"],BT:["h","H"],DJ:["h","H"],ER:["h","H"],GH:["h","H"],IN:["h","H"],LS:["h","H"],PG:["h","H"],PW:["h","H"],SO:["h","H"],TO:["h","H"],VU:["h","H"],WS:["h","H"],"001":["H","h"],AL:["h","H","hB"],TD:["h","H","hB"],"ca-ES":["H","h","hB"],CF:["H","h","hB"],CM:["H","h","hB"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],LU:["H","h","hB"],NP:["H","h","hB"],PF:["H","h","hB"],SC:["H","h","hB"],SM:["H","h","hB"],SN:["H","h","hB"],TF:["H","h","hB"],VA:["H","h","hB"],CY:["h","H","hb","hB"],GR:["h","H","hb","hB"],CO:["h","H","hB","hb"],DO:["h","H","hB","hb"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],NA:["h","H","hB","hb"],PA:["h","H","hB","hb"],PR:["h","H","hB","hb"],VE:["h","H","hB","hb"],AC:["H","h","hb","hB"],AI:["H","h","hb","hB"],BW:["H","h","hb","hB"],BZ:["H","h","hb","hB"],CC:["H","h","hb","hB"],CK:["H","h","hb","hB"],CX:["H","h","hb","hB"],DG:["H","h","hb","hB"],FK:["H","h","hb","hB"],GB:["H","h","hb","hB"],GG:["H","h","hb","hB"],GI:["H","h","hb","hB"],IE:["H","h","hb","hB"],IM:["H","h","hb","hB"],IO:["H","h","hb","hB"],JE:["H","h","hb","hB"],LT:["H","h","hb","hB"],MK:["H","h","hb","hB"],MN:["H","h","hb","hB"],MS:["H","h","hb","hB"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],PN:["H","h","hb","hB"],SH:["H","h","hb","hB"],SX:["H","h","hb","hB"],TA:["H","h","hb","hB"],ZA:["H","h","hb","hB"],"af-ZA":["H","h","hB","hb"],AR:["H","h","hB","hb"],CL:["H","h","hB","hb"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],EA:["H","h","hB","hb"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],GT:["H","h","hB","hb"],HN:["H","h","hB","hb"],IC:["H","h","hB","hb"],KG:["H","h","hB","hb"],KM:["H","h","hB","hb"],LK:["H","h","hB","hb"],MA:["H","h","hB","hb"],MX:["H","h","hB","hb"],NI:["H","h","hB","hb"],PY:["H","h","hB","hb"],SV:["H","h","hB","hb"],UY:["H","h","hB","hb"],JP:["H","h","K"],AD:["H","hB"],AM:["H","hB"],AO:["H","hB"],AT:["H","hB"],AW:["H","hB"],BE:["H","hB"],BF:["H","hB"],BJ:["H","hB"],BL:["H","hB"],BR:["H","hB"],CG:["H","hB"],CI:["H","hB"],CV:["H","hB"],DE:["H","hB"],EE:["H","hB"],FR:["H","hB"],GA:["H","hB"],GF:["H","hB"],GN:["H","hB"],GP:["H","hB"],GW:["H","hB"],HR:["H","hB"],IL:["H","hB"],IT:["H","hB"],KZ:["H","hB"],MC:["H","hB"],MD:["H","hB"],MF:["H","hB"],MQ:["H","hB"],MZ:["H","hB"],NC:["H","hB"],NL:["H","hB"],PM:["H","hB"],PT:["H","hB"],RE:["H","hB"],RO:["H","hB"],SI:["H","hB"],SR:["H","hB"],ST:["H","hB"],TG:["H","hB"],TR:["H","hB"],WF:["H","hB"],YT:["H","hB"],BD:["h","hB","H"],PK:["h","hB","H"],AZ:["H","hB","h"],BA:["H","hB","h"],BG:["H","hB","h"],CH:["H","hB","h"],GE:["H","hB","h"],LI:["H","hB","h"],ME:["H","hB","h"],RS:["H","hB","h"],UA:["H","hB","h"],UZ:["H","hB","h"],XK:["H","hB","h"],AG:["h","hb","H","hB"],AU:["h","hb","H","hB"],BB:["h","hb","H","hB"],BM:["h","hb","H","hB"],BS:["h","hb","H","hB"],CA:["h","hb","H","hB"],DM:["h","hb","H","hB"],"en-001":["h","hb","H","hB"],FJ:["h","hb","H","hB"],FM:["h","hb","H","hB"],GD:["h","hb","H","hB"],GM:["h","hb","H","hB"],GU:["h","hb","H","hB"],GY:["h","hb","H","hB"],JM:["h","hb","H","hB"],KI:["h","hb","H","hB"],KN:["h","hb","H","hB"],KY:["h","hb","H","hB"],LC:["h","hb","H","hB"],LR:["h","hb","H","hB"],MH:["h","hb","H","hB"],MP:["h","hb","H","hB"],MW:["h","hb","H","hB"],NZ:["h","hb","H","hB"],SB:["h","hb","H","hB"],SG:["h","hb","H","hB"],SL:["h","hb","H","hB"],SS:["h","hb","H","hB"],SZ:["h","hb","H","hB"],TC:["h","hb","H","hB"],TT:["h","hb","H","hB"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],VC:["h","hb","H","hB"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],ZM:["h","hb","H","hB"],BO:["H","hB","h","hb"],EC:["H","hB","h","hb"],ES:["H","hB","h","hb"],GQ:["H","hB","h","hb"],PE:["H","hB","h","hb"],AE:["h","hB","hb","H"],"ar-001":["h","hB","hb","H"],BH:["h","hB","hb","H"],DZ:["h","hB","hb","H"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],HK:["h","hB","hb","H"],IQ:["h","hB","hb","H"],JO:["h","hB","hb","H"],KW:["h","hB","hb","H"],LB:["h","hB","hb","H"],LY:["h","hB","hb","H"],MO:["h","hB","hb","H"],MR:["h","hB","hb","H"],OM:["h","hB","hb","H"],PH:["h","hB","hb","H"],PS:["h","hB","hb","H"],QA:["h","hB","hb","H"],SA:["h","hB","hb","H"],SD:["h","hB","hb","H"],SY:["h","hB","hb","H"],TN:["h","hB","hb","H"],YE:["h","hB","hb","H"],AF:["H","hb","hB","h"],LA:["H","hb","hB","h"],CN:["H","hB","hb","h"],LV:["H","hB","hb","h"],TL:["H","hB","hb","h"],"zu-ZA":["H","hB","hb","h"],CD:["hB","H"],IR:["hB","H"],"hi-IN":["hB","h","H"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"te-IN":["hB","h","H"],KH:["hB","h","H","hb"],"ta-IN":["hB","h","hb","H"],BN:["hb","hB","h","H"],MY:["hb","hB","h","H"],ET:["hB","hb","h","H"],"gu-IN":["hB","hb","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],TW:["hB","hb","h","H"],KE:["hB","hb","H","h"],MM:["hB","hb","H","h"],TZ:["hB","hb","H","h"],UG:["hB","hb","H","h"]};function L(e){var t=e.hourCycle;if(void 0===t&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var i,n=e.language;return"root"!==n&&(i=e.maximize().region),(_[i||""]||_[n||""]||_["".concat(n,"-001")]||_["001"])[0]}var N=new RegExp("^".concat(v.source,"*")),O=new RegExp("".concat(v.source,"*$"));function F(e,t){return{start:e,end:t}}var G=!!String.prototype.startsWith,B=!!String.fromCodePoint,V=!!Object.fromEntries,H=!!String.prototype.codePointAt,U=!!String.prototype.trimStart,z=!!String.prototype.trimEnd,W=Number.isSafeInteger?Number.isSafeInteger:function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},j=!0;try{j="a"===(null===(P=J("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===P?void 0:P[0])}catch(e){j=!1}var $,K=G?function(e,t,i){return e.startsWith(t,i)}:function(e,t,i){return e.slice(i,i+t.length)===t},Y=B?String.fromCodePoint:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var i,n="",s=e.length,r=0;s>r;){if((i=e[r++])>1114111)throw RangeError(i+" is not a valid code point");n+=i<65536?String.fromCharCode(i):String.fromCharCode(55296+((i-=65536)>>10),i%1024+56320)}return n},q=V?Object.fromEntries:function(e){for(var t={},i=0,n=e;i<n.length;i++){var s=n[i],r=s[0],o=s[1];t[r]=o}return t},X=H?function(e,t){return e.codePointAt(t)}:function(e,t){var i=e.length;if(!(t<0||t>=i)){var n,s=e.charCodeAt(t);return s<55296||s>56319||t+1===i||(n=e.charCodeAt(t+1))<56320||n>57343?s:n-56320+(s-55296<<10)+65536}},Z=U?function(e){return e.trimStart()}:function(e){return e.replace(N,"")},Q=z?function(e){return e.trimEnd()}:function(e){return e.replace(O,"")};function J(e,t){return new RegExp(e,t)}if(j){var ee=J("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");$=function(e,t){var i;return ee.lastIndex=t,null!==(i=ee.exec(e)[1])&&void 0!==i?i:""}}else $=function(e,t){for(var i=[];;){var n=X(e,t);if(void 0===n||se(n)||re(n))break;i.push(n),t+=n>=65536?2:1}return Y.apply(void 0,i)};var te=function(){function e(e,t){void 0===t&&(t={}),this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}return e.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(e,t,i){for(var r=[];!this.isEOF();){var o=this.char();if(123===o){if((a=this.parseArgument(e,i)).err)return a;r.push(a.val)}else{if(125===o&&e>0)break;if(35!==o||"plural"!==t&&"selectordinal"!==t){if(60===o&&!this.ignoreTag&&47===this.peek()){if(i)break;return this.error(n.UNMATCHED_CLOSING_TAG,F(this.clonePosition(),this.clonePosition()))}if(60===o&&!this.ignoreTag&&ie(this.peek()||0)){if((a=this.parseTag(e,t)).err)return a;r.push(a.val)}else{var a;if((a=this.parseLiteral(e,t)).err)return a;r.push(a.val)}}else{var l=this.clonePosition();this.bump(),r.push({type:s.pound,location:F(l,this.clonePosition())})}}}return{val:r,err:null}},e.prototype.parseTag=function(e,t){var i=this.clonePosition();this.bump();var r=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:s.literal,value:"<".concat(r,"/>"),location:F(i,this.clonePosition())},err:null};if(this.bumpIf(">")){var o=this.parseMessage(e+1,t,!0);if(o.err)return o;var a=o.val,l=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!ie(this.char()))return this.error(n.INVALID_TAG,F(l,this.clonePosition()));var c=this.clonePosition();return r!==this.parseTagName()?this.error(n.UNMATCHED_CLOSING_TAG,F(c,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:s.tag,value:r,children:a,location:F(i,this.clonePosition())},err:null}:this.error(n.INVALID_TAG,F(l,this.clonePosition())))}return this.error(n.UNCLOSED_TAG,F(i,this.clonePosition()))}return this.error(n.INVALID_TAG,F(i,this.clonePosition()))},e.prototype.parseTagName=function(){var e=this.offset();for(this.bump();!this.isEOF()&&ne(this.char());)this.bump();return this.message.slice(e,this.offset())},e.prototype.parseLiteral=function(e,t){for(var i=this.clonePosition(),n="";;){var r=this.tryParseQuote(t);if(r)n+=r;else{var o=this.tryParseUnquoted(e,t);if(o)n+=o;else{var a=this.tryParseLeftAngleBracket();if(!a)break;n+=a}}}var l=F(i,this.clonePosition());return{val:{type:s.literal,value:n,location:l},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(ie(e=this.peek()||0)||47===e)?null:(this.bump(),"<");var e},e.prototype.tryParseQuote=function(e){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===e||"selectordinal"===e)break;return null;default:return null}this.bump();var t=[this.char()];for(this.bump();!this.isEOF();){var i=this.char();if(39===i){if(39!==this.peek()){this.bump();break}t.push(39),this.bump()}else t.push(i);this.bump()}return Y.apply(void 0,t)},e.prototype.tryParseUnquoted=function(e,t){if(this.isEOF())return null;var i=this.char();return 60===i||123===i||35===i&&("plural"===t||"selectordinal"===t)||125===i&&e>0?null:(this.bump(),Y(i))},e.prototype.parseArgument=function(e,t){var i=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(n.EXPECT_ARGUMENT_CLOSING_BRACE,F(i,this.clonePosition()));if(125===this.char())return this.bump(),this.error(n.EMPTY_ARGUMENT,F(i,this.clonePosition()));var r=this.parseIdentifierIfPossible().value;if(!r)return this.error(n.MALFORMED_ARGUMENT,F(i,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(n.EXPECT_ARGUMENT_CLOSING_BRACE,F(i,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:s.argument,value:r,location:F(i,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(n.EXPECT_ARGUMENT_CLOSING_BRACE,F(i,this.clonePosition())):this.parseArgumentOptions(e,t,r,i);default:return this.error(n.MALFORMED_ARGUMENT,F(i,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),t=this.offset(),i=$(this.message,t),n=t+i.length;return this.bumpTo(n),{value:i,location:F(e,this.clonePosition())}},e.prototype.parseArgumentOptions=function(e,t,i,a){var l,c=this.clonePosition(),h=this.parseIdentifierIfPossible().value,u=this.clonePosition();switch(h){case"":return this.error(n.EXPECT_ARGUMENT_TYPE,F(c,u));case"number":case"date":case"time":this.bumpSpace();var d=null;if(this.bumpIf(",")){this.bumpSpace();var p=this.clonePosition();if((S=this.parseSimpleArgStyleIfPossible()).err)return S;if(0===(y=Q(S.val)).length)return this.error(n.EXPECT_ARGUMENT_STYLE,F(this.clonePosition(),this.clonePosition()));d={style:y,styleLocation:F(p,this.clonePosition())}}if((x=this.tryParseArgumentClose(a)).err)return x;var g=F(a,this.clonePosition());if(d&&K(null==d?void 0:d.style,"::",0)){var f=Z(d.style.slice(2));if("number"===h)return(S=this.parseNumberSkeletonFromString(f,d.styleLocation)).err?S:{val:{type:s.number,value:i,location:g,style:S.val},err:null};if(0===f.length)return this.error(n.EXPECT_DATE_TIME_SKELETON,g);var m=f;this.locale&&(m=function(e,t){for(var i="",n=0;n<e.length;n++){var s=e.charAt(n);if("j"===s){for(var r=0;n+1<e.length&&e.charAt(n+1)===s;)r++,n++;var o=1+(1&r),a=r<2?1:3+(r>>1),l=L(t);for("H"!=l&&"k"!=l||(a=0);a-- >0;)i+="a";for(;o-- >0;)i=l+i}else i+="J"===s?"H":s}return i}(f,this.locale));var y={type:r.dateTime,pattern:m,location:d.styleLocation,parsedOptions:this.shouldParseSkeletons?C(m):{}};return{val:{type:"date"===h?s.date:s.time,value:i,location:g,style:y},err:null}}return{val:{type:"number"===h?s.number:"date"===h?s.date:s.time,value:i,location:g,style:null!==(l=null==d?void 0:d.style)&&void 0!==l?l:null},err:null};case"plural":case"selectordinal":case"select":var v=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(n.EXPECT_SELECT_ARGUMENT_OPTIONS,F(v,(0,o.__assign)({},v)));this.bumpSpace();var b=this.parseIdentifierIfPossible(),w=0;if("select"!==h&&"offset"===b.value){if(!this.bumpIf(":"))return this.error(n.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,F(this.clonePosition(),this.clonePosition()));var S;if(this.bumpSpace(),(S=this.tryParseDecimalInteger(n.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,n.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return S;this.bumpSpace(),b=this.parseIdentifierIfPossible(),w=S.val}var x,E=this.tryParsePluralOrSelectOptions(e,h,t,b);if(E.err)return E;if((x=this.tryParseArgumentClose(a)).err)return x;var A=F(a,this.clonePosition());return"select"===h?{val:{type:s.select,value:i,options:q(E.val),location:A},err:null}:{val:{type:s.plural,value:i,options:q(E.val),offset:w,pluralType:"plural"===h?"cardinal":"ordinal",location:A},err:null};default:return this.error(n.INVALID_ARGUMENT_TYPE,F(c,u))}},e.prototype.tryParseArgumentClose=function(e){return this.isEOF()||125!==this.char()?this.error(n.EXPECT_ARGUMENT_CLOSING_BRACE,F(e,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var e=0,t=this.clonePosition();!this.isEOF();)switch(this.char()){case 39:this.bump();var i=this.clonePosition();if(!this.bumpUntil("'"))return this.error(n.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,F(i,this.clonePosition()));this.bump();break;case 123:e+=1,this.bump();break;case 125:if(!(e>0))return{val:this.message.slice(t.offset,this.offset()),err:null};e-=1;break;default:this.bump()}return{val:this.message.slice(t.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(e,t){var i=[];try{i=function(e){if(0===e.length)throw new Error("Number skeleton cannot be empty");for(var t=[],i=0,n=e.split(w).filter(function(e){return e.length>0});i<n.length;i++){var s=n[i].split("/");if(0===s.length)throw new Error("Invalid number skeleton");for(var r=s[0],o=s.slice(1),a=0,l=o;a<l.length;a++)if(0===l[a].length)throw new Error("Invalid number skeleton");t.push({stem:r,options:o})}return t}(e)}catch(e){return this.error(n.INVALID_NUMBER_SKELETON,t)}return{val:{type:r.number,tokens:i,location:t,parsedOptions:this.shouldParseSkeletons?k(i):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(e,t,i,s){for(var r,o=!1,a=[],l=new Set,c=s.value,h=s.location;;){if(0===c.length){var u=this.clonePosition();if("select"===t||!this.bumpIf("="))break;var d=this.tryParseDecimalInteger(n.EXPECT_PLURAL_ARGUMENT_SELECTOR,n.INVALID_PLURAL_ARGUMENT_SELECTOR);if(d.err)return d;h=F(u,this.clonePosition()),c=this.message.slice(u.offset,this.offset())}if(l.has(c))return this.error("select"===t?n.DUPLICATE_SELECT_ARGUMENT_SELECTOR:n.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,h);"other"===c&&(o=!0),this.bumpSpace();var p=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===t?n.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:n.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,F(this.clonePosition(),this.clonePosition()));var g=this.parseMessage(e+1,t,i);if(g.err)return g;var f=this.tryParseArgumentClose(p);if(f.err)return f;a.push([c,{value:g.val,location:F(p,this.clonePosition())}]),l.add(c),this.bumpSpace(),c=(r=this.parseIdentifierIfPossible()).value,h=r.location}return 0===a.length?this.error("select"===t?n.EXPECT_SELECT_ARGUMENT_SELECTOR:n.EXPECT_PLURAL_ARGUMENT_SELECTOR,F(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!o?this.error(n.MISSING_OTHER_CLAUSE,F(this.clonePosition(),this.clonePosition())):{val:a,err:null}},e.prototype.tryParseDecimalInteger=function(e,t){var i=1,n=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(i=-1);for(var s=!1,r=0;!this.isEOF();){var o=this.char();if(!(o>=48&&o<=57))break;s=!0,r=10*r+(o-48),this.bump()}var a=F(n,this.clonePosition());return s?W(r*=i)?{val:r,err:null}:this.error(t,a):this.error(e,a)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var t=X(this.message,e);if(void 0===t)throw Error("Offset ".concat(e," is at invalid UTF-16 code unit boundary"));return t},e.prototype.error=function(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}},e.prototype.bump=function(){if(!this.isEOF()){var e=this.char();10===e?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}},e.prototype.bumpIf=function(e){if(K(this.message,e,this.offset())){for(var t=0;t<e.length;t++)this.bump();return!0}return!1},e.prototype.bumpUntil=function(e){var t=this.offset(),i=this.message.indexOf(e,t);return i>=0?(this.bumpTo(i),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(e){if(this.offset()>e)throw Error("targetOffset ".concat(e," must be greater than or equal to the current offset ").concat(this.offset()));for(e=Math.min(e,this.message.length);;){var t=this.offset();if(t===e)break;if(t>e)throw Error("targetOffset ".concat(e," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&se(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var e=this.char(),t=this.offset(),i=this.message.charCodeAt(t+(e>=65536?2:1));return null!=i?i:null},e}();function ie(e){return e>=97&&e<=122||e>=65&&e<=90}function ne(e){return 45===e||46===e||e>=48&&e<=57||95===e||e>=97&&e<=122||e>=65&&e<=90||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function se(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}function re(e){return e>=33&&e<=35||36===e||e>=37&&e<=39||40===e||41===e||42===e||43===e||44===e||45===e||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||91===e||92===e||93===e||94===e||96===e||123===e||124===e||125===e||126===e||161===e||e>=162&&e<=165||166===e||167===e||169===e||171===e||172===e||174===e||176===e||177===e||182===e||187===e||191===e||215===e||247===e||e>=8208&&e<=8213||e>=8214&&e<=8215||8216===e||8217===e||8218===e||e>=8219&&e<=8220||8221===e||8222===e||8223===e||e>=8224&&e<=8231||e>=8240&&e<=8248||8249===e||8250===e||e>=8251&&e<=8254||e>=8257&&e<=8259||8260===e||8261===e||8262===e||e>=8263&&e<=8273||8274===e||8275===e||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||8608===e||e>=8609&&e<=8610||8611===e||e>=8612&&e<=8613||8614===e||e>=8615&&e<=8621||8622===e||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||8658===e||8659===e||8660===e||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||8968===e||8969===e||8970===e||8971===e||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||9001===e||9002===e||e>=9003&&e<=9083||9084===e||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||9655===e||e>=9656&&e<=9664||9665===e||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||9839===e||e>=9840&&e<=10087||10088===e||10089===e||10090===e||10091===e||10092===e||10093===e||10094===e||10095===e||10096===e||10097===e||10098===e||10099===e||10100===e||10101===e||e>=10132&&e<=10175||e>=10176&&e<=10180||10181===e||10182===e||e>=10183&&e<=10213||10214===e||10215===e||10216===e||10217===e||10218===e||10219===e||10220===e||10221===e||10222===e||10223===e||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||10627===e||10628===e||10629===e||10630===e||10631===e||10632===e||10633===e||10634===e||10635===e||10636===e||10637===e||10638===e||10639===e||10640===e||10641===e||10642===e||10643===e||10644===e||10645===e||10646===e||10647===e||10648===e||e>=10649&&e<=10711||10712===e||10713===e||10714===e||10715===e||e>=10716&&e<=10747||10748===e||10749===e||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||11158===e||e>=11159&&e<=11263||e>=11776&&e<=11777||11778===e||11779===e||11780===e||11781===e||e>=11782&&e<=11784||11785===e||11786===e||11787===e||11788===e||11789===e||e>=11790&&e<=11798||11799===e||e>=11800&&e<=11801||11802===e||11803===e||11804===e||11805===e||e>=11806&&e<=11807||11808===e||11809===e||11810===e||11811===e||11812===e||11813===e||11814===e||11815===e||11816===e||11817===e||e>=11818&&e<=11822||11823===e||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||11840===e||11841===e||11842===e||e>=11843&&e<=11855||e>=11856&&e<=11857||11858===e||e>=11859&&e<=11903||e>=12289&&e<=12291||12296===e||12297===e||12298===e||12299===e||12300===e||12301===e||12302===e||12303===e||12304===e||12305===e||e>=12306&&e<=12307||12308===e||12309===e||12310===e||12311===e||12312===e||12313===e||12314===e||12315===e||12316===e||12317===e||e>=12318&&e<=12319||12320===e||12336===e||64830===e||64831===e||e>=65093&&e<=65094}function oe(e){e.forEach(function(e){if(delete e.location,d(e)||p(e))for(var t in e.options)delete e.options[t].location,oe(e.options[t].value);else c(e)&&m(e.style)||(h(e)||u(e))&&y(e.style)?delete e.style.location:f(e)&&oe(e.children)})}function ae(e,t){void 0===t&&(t={}),t=(0,o.__assign)({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var i=new te(e,t).parse();if(i.err){var s=SyntaxError(n[i.err.kind]);throw s.location=i.err.location,s.originalMessage=i.err.message,s}return(null==t?void 0:t.captureLocation)||oe(i.val),i.val}},78582(e,t,i){"use strict";i.d(t,{Im:()=>l,tv:()=>h,Tu:()=>y,eW:()=>a,oF:()=>c,N1:()=>m,N6:()=>p,jA:()=>g,Jp:()=>d,xm:()=>f,Qh:()=>u,qg:()=>ae});var n,s,r,o=i(65959);function a(e){return e.type===s.literal}function l(e){return e.type===s.argument}function c(e){return e.type===s.number}function h(e){return e.type===s.date}function u(e){return e.type===s.time}function d(e){return e.type===s.select}function p(e){return e.type===s.plural}function g(e){return e.type===s.pound}function f(e){return e.type===s.tag}function m(e){return!(!e||"object"!=typeof e||e.type!==r.number)}function y(e){return!(!e||"object"!=typeof e||e.type!==r.dateTime)}!function(e){e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"}(n||(n={})),function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"}(s||(s={})),function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"}(r||(r={}));var v=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,b=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function C(e){var t={};return e.replace(b,function(e){var i=e.length;switch(e[0]){case"G":t.era=4===i?"long":5===i?"narrow":"short";break;case"y":t.year=2===i?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][i-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][i-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=4===i?"long":5===i?"narrow":"short";break;case"e":if(i<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][i-4];break;case"c":if(i<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][i-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][i-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][i-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][i-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][i-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][i-1];break;case"s":t.second=["numeric","2-digit"][i-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=i<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),t}var w=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function S(e){return e.replace(/^(.*?)-/,"")}var x=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,E=/^(@+)?(\+|#+)?[rs]?$/g,A=/(\*)(0+)|(#+)(0+)|(0+)/g,M=/^(0+)$/;function T(e){var t={};return"r"===e[e.length-1]?t.roundingPriority="morePrecision":"s"===e[e.length-1]&&(t.roundingPriority="lessPrecision"),e.replace(E,function(e,i,n){return"string"!=typeof n?(t.minimumSignificantDigits=i.length,t.maximumSignificantDigits=i.length):"+"===n?t.minimumSignificantDigits=i.length:"#"===i[0]?t.maximumSignificantDigits=i.length:(t.minimumSignificantDigits=i.length,t.maximumSignificantDigits=i.length+("string"==typeof n?n.length:0)),""}),t}function D(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function I(e){var t;if("E"===e[0]&&"E"===e[1]?(t={notation:"engineering"},e=e.slice(2)):"E"===e[0]&&(t={notation:"scientific"},e=e.slice(1)),t){var i=e.slice(0,2);if("+!"===i?(t.signDisplay="always",e=e.slice(2)):"+?"===i&&(t.signDisplay="exceptZero",e=e.slice(2)),!M.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function R(e){return D(e)||{}}function k(e){for(var t={},i=0,n=e;i<n.length;i++){var s=n[i];switch(s.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=s.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=S(s.options[0]);continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t=(0,o.__assign)((0,o.__assign)((0,o.__assign)({},t),{notation:"scientific"}),s.options.reduce(function(e,t){return(0,o.__assign)((0,o.__assign)({},e),R(t))},{}));continue;case"engineering":t=(0,o.__assign)((0,o.__assign)((0,o.__assign)({},t),{notation:"engineering"}),s.options.reduce(function(e,t){return(0,o.__assign)((0,o.__assign)({},e),R(t))},{}));continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(s.options[0]);continue;case"rounding-mode-floor":t.roundingMode="floor";continue;case"rounding-mode-ceiling":t.roundingMode="ceil";continue;case"rounding-mode-down":t.roundingMode="trunc";continue;case"rounding-mode-up":t.roundingMode="expand";continue;case"rounding-mode-half-even":t.roundingMode="halfEven";continue;case"rounding-mode-half-down":t.roundingMode="halfTrunc";continue;case"rounding-mode-half-up":t.roundingMode="halfExpand";continue;case"integer-width":if(s.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");s.options[0].replace(A,function(e,i,n,s,r,o){if(i)t.minimumIntegerDigits=n.length;else{if(s&&r)throw new Error("We currently do not support maximum integer digits");if(o)throw new Error("We currently do not support exact integer digits")}return""});continue}if(M.test(s.stem))t.minimumIntegerDigits=s.stem.length;else if(x.test(s.stem)){if(s.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");s.stem.replace(x,function(e,i,n,s,r,o){return"*"===n?t.minimumFractionDigits=i.length:s&&"#"===s[0]?t.maximumFractionDigits=s.length:r&&o?(t.minimumFractionDigits=r.length,t.maximumFractionDigits=r.length+o.length):(t.minimumFractionDigits=i.length,t.maximumFractionDigits=i.length),""});var r=s.options[0];"w"===r?t=(0,o.__assign)((0,o.__assign)({},t),{trailingZeroDisplay:"stripIfInteger"}):r&&(t=(0,o.__assign)((0,o.__assign)({},t),T(r)))}else if(E.test(s.stem))t=(0,o.__assign)((0,o.__assign)({},t),T(s.stem));else{var a=D(s.stem);a&&(t=(0,o.__assign)((0,o.__assign)({},t),a));var l=I(s.stem);l&&(t=(0,o.__assign)((0,o.__assign)({},t),l))}}return t}var P,_={"001":["H","h"],419:["h","H","hB","hb"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["h","H","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["h","H","hB","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["h","H","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["h","H","hB","hb"],CU:["h","H","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["h","H","hB","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GT:["h","H","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["h","H","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["h","H","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["h","H","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["h","H","hB","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["h","H","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["h","H","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["h","H","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"en-HK":["h","hb","H","hB"],"en-IL":["H","h","hb","hB"],"en-MY":["h","hb","H","hB"],"es-BR":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]};function L(e){var t=e.hourCycle;if(void 0===t&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var i,n=e.language;return"root"!==n&&(i=e.maximize().region),(_[i||""]||_[n||""]||_["".concat(n,"-001")]||_["001"])[0]}var N=new RegExp("^".concat(v.source,"*")),O=new RegExp("".concat(v.source,"*$"));function F(e,t){return{start:e,end:t}}var G=!!String.prototype.startsWith&&"_a".startsWith("a",1),B=!!String.fromCodePoint,V=!!Object.fromEntries,H=!!String.prototype.codePointAt,U=!!String.prototype.trimStart,z=!!String.prototype.trimEnd,W=Number.isSafeInteger?Number.isSafeInteger:function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},j=!0;try{j="a"===(null===(P=J("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===P?void 0:P[0])}catch(e){j=!1}var $,K=G?function(e,t,i){return e.startsWith(t,i)}:function(e,t,i){return e.slice(i,i+t.length)===t},Y=B?String.fromCodePoint:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var i,n="",s=e.length,r=0;s>r;){if((i=e[r++])>1114111)throw RangeError(i+" is not a valid code point");n+=i<65536?String.fromCharCode(i):String.fromCharCode(55296+((i-=65536)>>10),i%1024+56320)}return n},q=V?Object.fromEntries:function(e){for(var t={},i=0,n=e;i<n.length;i++){var s=n[i],r=s[0],o=s[1];t[r]=o}return t},X=H?function(e,t){return e.codePointAt(t)}:function(e,t){var i=e.length;if(!(t<0||t>=i)){var n,s=e.charCodeAt(t);return s<55296||s>56319||t+1===i||(n=e.charCodeAt(t+1))<56320||n>57343?s:n-56320+(s-55296<<10)+65536}},Z=U?function(e){return e.trimStart()}:function(e){return e.replace(N,"")},Q=z?function(e){return e.trimEnd()}:function(e){return e.replace(O,"")};function J(e,t){return new RegExp(e,t)}if(j){var ee=J("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");$=function(e,t){var i;return ee.lastIndex=t,null!==(i=ee.exec(e)[1])&&void 0!==i?i:""}}else $=function(e,t){for(var i=[];;){var n=X(e,t);if(void 0===n||se(n)||re(n))break;i.push(n),t+=n>=65536?2:1}return Y.apply(void 0,i)};var te=function(){function e(e,t){void 0===t&&(t={}),this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}return e.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(e,t,i){for(var r=[];!this.isEOF();){var o=this.char();if(123===o){if((a=this.parseArgument(e,i)).err)return a;r.push(a.val)}else{if(125===o&&e>0)break;if(35!==o||"plural"!==t&&"selectordinal"!==t){if(60===o&&!this.ignoreTag&&47===this.peek()){if(i)break;return this.error(n.UNMATCHED_CLOSING_TAG,F(this.clonePosition(),this.clonePosition()))}if(60===o&&!this.ignoreTag&&ie(this.peek()||0)){if((a=this.parseTag(e,t)).err)return a;r.push(a.val)}else{var a;if((a=this.parseLiteral(e,t)).err)return a;r.push(a.val)}}else{var l=this.clonePosition();this.bump(),r.push({type:s.pound,location:F(l,this.clonePosition())})}}}return{val:r,err:null}},e.prototype.parseTag=function(e,t){var i=this.clonePosition();this.bump();var r=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:s.literal,value:"<".concat(r,"/>"),location:F(i,this.clonePosition())},err:null};if(this.bumpIf(">")){var o=this.parseMessage(e+1,t,!0);if(o.err)return o;var a=o.val,l=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!ie(this.char()))return this.error(n.INVALID_TAG,F(l,this.clonePosition()));var c=this.clonePosition();return r!==this.parseTagName()?this.error(n.UNMATCHED_CLOSING_TAG,F(c,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:s.tag,value:r,children:a,location:F(i,this.clonePosition())},err:null}:this.error(n.INVALID_TAG,F(l,this.clonePosition())))}return this.error(n.UNCLOSED_TAG,F(i,this.clonePosition()))}return this.error(n.INVALID_TAG,F(i,this.clonePosition()))},e.prototype.parseTagName=function(){var e=this.offset();for(this.bump();!this.isEOF()&&ne(this.char());)this.bump();return this.message.slice(e,this.offset())},e.prototype.parseLiteral=function(e,t){for(var i=this.clonePosition(),n="";;){var r=this.tryParseQuote(t);if(r)n+=r;else{var o=this.tryParseUnquoted(e,t);if(o)n+=o;else{var a=this.tryParseLeftAngleBracket();if(!a)break;n+=a}}}var l=F(i,this.clonePosition());return{val:{type:s.literal,value:n,location:l},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(ie(e=this.peek()||0)||47===e)?null:(this.bump(),"<");var e},e.prototype.tryParseQuote=function(e){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===e||"selectordinal"===e)break;return null;default:return null}this.bump();var t=[this.char()];for(this.bump();!this.isEOF();){var i=this.char();if(39===i){if(39!==this.peek()){this.bump();break}t.push(39),this.bump()}else t.push(i);this.bump()}return Y.apply(void 0,t)},e.prototype.tryParseUnquoted=function(e,t){if(this.isEOF())return null;var i=this.char();return 60===i||123===i||35===i&&("plural"===t||"selectordinal"===t)||125===i&&e>0?null:(this.bump(),Y(i))},e.prototype.parseArgument=function(e,t){var i=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(n.EXPECT_ARGUMENT_CLOSING_BRACE,F(i,this.clonePosition()));if(125===this.char())return this.bump(),this.error(n.EMPTY_ARGUMENT,F(i,this.clonePosition()));var r=this.parseIdentifierIfPossible().value;if(!r)return this.error(n.MALFORMED_ARGUMENT,F(i,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(n.EXPECT_ARGUMENT_CLOSING_BRACE,F(i,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:s.argument,value:r,location:F(i,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(n.EXPECT_ARGUMENT_CLOSING_BRACE,F(i,this.clonePosition())):this.parseArgumentOptions(e,t,r,i);default:return this.error(n.MALFORMED_ARGUMENT,F(i,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),t=this.offset(),i=$(this.message,t),n=t+i.length;return this.bumpTo(n),{value:i,location:F(e,this.clonePosition())}},e.prototype.parseArgumentOptions=function(e,t,i,a){var l,c=this.clonePosition(),h=this.parseIdentifierIfPossible().value,u=this.clonePosition();switch(h){case"":return this.error(n.EXPECT_ARGUMENT_TYPE,F(c,u));case"number":case"date":case"time":this.bumpSpace();var d=null;if(this.bumpIf(",")){this.bumpSpace();var p=this.clonePosition();if((S=this.parseSimpleArgStyleIfPossible()).err)return S;if(0===(y=Q(S.val)).length)return this.error(n.EXPECT_ARGUMENT_STYLE,F(this.clonePosition(),this.clonePosition()));d={style:y,styleLocation:F(p,this.clonePosition())}}if((x=this.tryParseArgumentClose(a)).err)return x;var g=F(a,this.clonePosition());if(d&&K(null==d?void 0:d.style,"::",0)){var f=Z(d.style.slice(2));if("number"===h)return(S=this.parseNumberSkeletonFromString(f,d.styleLocation)).err?S:{val:{type:s.number,value:i,location:g,style:S.val},err:null};if(0===f.length)return this.error(n.EXPECT_DATE_TIME_SKELETON,g);var m=f;this.locale&&(m=function(e,t){for(var i="",n=0;n<e.length;n++){var s=e.charAt(n);if("j"===s){for(var r=0;n+1<e.length&&e.charAt(n+1)===s;)r++,n++;var o=1+(1&r),a=r<2?1:3+(r>>1),l=L(t);for("H"!=l&&"k"!=l||(a=0);a-- >0;)i+="a";for(;o-- >0;)i=l+i}else i+="J"===s?"H":s}return i}(f,this.locale));var y={type:r.dateTime,pattern:m,location:d.styleLocation,parsedOptions:this.shouldParseSkeletons?C(m):{}};return{val:{type:"date"===h?s.date:s.time,value:i,location:g,style:y},err:null}}return{val:{type:"number"===h?s.number:"date"===h?s.date:s.time,value:i,location:g,style:null!==(l=null==d?void 0:d.style)&&void 0!==l?l:null},err:null};case"plural":case"selectordinal":case"select":var v=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(n.EXPECT_SELECT_ARGUMENT_OPTIONS,F(v,(0,o.__assign)({},v)));this.bumpSpace();var b=this.parseIdentifierIfPossible(),w=0;if("select"!==h&&"offset"===b.value){if(!this.bumpIf(":"))return this.error(n.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,F(this.clonePosition(),this.clonePosition()));var S;if(this.bumpSpace(),(S=this.tryParseDecimalInteger(n.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,n.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return S;this.bumpSpace(),b=this.parseIdentifierIfPossible(),w=S.val}var x,E=this.tryParsePluralOrSelectOptions(e,h,t,b);if(E.err)return E;if((x=this.tryParseArgumentClose(a)).err)return x;var A=F(a,this.clonePosition());return"select"===h?{val:{type:s.select,value:i,options:q(E.val),location:A},err:null}:{val:{type:s.plural,value:i,options:q(E.val),offset:w,pluralType:"plural"===h?"cardinal":"ordinal",location:A},err:null};default:return this.error(n.INVALID_ARGUMENT_TYPE,F(c,u))}},e.prototype.tryParseArgumentClose=function(e){return this.isEOF()||125!==this.char()?this.error(n.EXPECT_ARGUMENT_CLOSING_BRACE,F(e,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var e=0,t=this.clonePosition();!this.isEOF();)switch(this.char()){case 39:this.bump();var i=this.clonePosition();if(!this.bumpUntil("'"))return this.error(n.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,F(i,this.clonePosition()));this.bump();break;case 123:e+=1,this.bump();break;case 125:if(!(e>0))return{val:this.message.slice(t.offset,this.offset()),err:null};e-=1;break;default:this.bump()}return{val:this.message.slice(t.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(e,t){var i=[];try{i=function(e){if(0===e.length)throw new Error("Number skeleton cannot be empty");for(var t=[],i=0,n=e.split(w).filter(function(e){return e.length>0});i<n.length;i++){var s=n[i].split("/");if(0===s.length)throw new Error("Invalid number skeleton");for(var r=s[0],o=s.slice(1),a=0,l=o;a<l.length;a++)if(0===l[a].length)throw new Error("Invalid number skeleton");t.push({stem:r,options:o})}return t}(e)}catch(e){return this.error(n.INVALID_NUMBER_SKELETON,t)}return{val:{type:r.number,tokens:i,location:t,parsedOptions:this.shouldParseSkeletons?k(i):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(e,t,i,s){for(var r,o=!1,a=[],l=new Set,c=s.value,h=s.location;;){if(0===c.length){var u=this.clonePosition();if("select"===t||!this.bumpIf("="))break;var d=this.tryParseDecimalInteger(n.EXPECT_PLURAL_ARGUMENT_SELECTOR,n.INVALID_PLURAL_ARGUMENT_SELECTOR);if(d.err)return d;h=F(u,this.clonePosition()),c=this.message.slice(u.offset,this.offset())}if(l.has(c))return this.error("select"===t?n.DUPLICATE_SELECT_ARGUMENT_SELECTOR:n.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,h);"other"===c&&(o=!0),this.bumpSpace();var p=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===t?n.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:n.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,F(this.clonePosition(),this.clonePosition()));var g=this.parseMessage(e+1,t,i);if(g.err)return g;var f=this.tryParseArgumentClose(p);if(f.err)return f;a.push([c,{value:g.val,location:F(p,this.clonePosition())}]),l.add(c),this.bumpSpace(),c=(r=this.parseIdentifierIfPossible()).value,h=r.location}return 0===a.length?this.error("select"===t?n.EXPECT_SELECT_ARGUMENT_SELECTOR:n.EXPECT_PLURAL_ARGUMENT_SELECTOR,F(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!o?this.error(n.MISSING_OTHER_CLAUSE,F(this.clonePosition(),this.clonePosition())):{val:a,err:null}},e.prototype.tryParseDecimalInteger=function(e,t){var i=1,n=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(i=-1);for(var s=!1,r=0;!this.isEOF();){var o=this.char();if(!(o>=48&&o<=57))break;s=!0,r=10*r+(o-48),this.bump()}var a=F(n,this.clonePosition());return s?W(r*=i)?{val:r,err:null}:this.error(t,a):this.error(e,a)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var t=X(this.message,e);if(void 0===t)throw Error("Offset ".concat(e," is at invalid UTF-16 code unit boundary"));return t},e.prototype.error=function(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}},e.prototype.bump=function(){if(!this.isEOF()){var e=this.char();10===e?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}},e.prototype.bumpIf=function(e){if(K(this.message,e,this.offset())){for(var t=0;t<e.length;t++)this.bump();return!0}return!1},e.prototype.bumpUntil=function(e){var t=this.offset(),i=this.message.indexOf(e,t);return i>=0?(this.bumpTo(i),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(e){if(this.offset()>e)throw Error("targetOffset ".concat(e," must be greater than or equal to the current offset ").concat(this.offset()));for(e=Math.min(e,this.message.length);;){var t=this.offset();if(t===e)break;if(t>e)throw Error("targetOffset ".concat(e," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&se(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var e=this.char(),t=this.offset(),i=this.message.charCodeAt(t+(e>=65536?2:1));return null!=i?i:null},e}();function ie(e){return e>=97&&e<=122||e>=65&&e<=90}function ne(e){return 45===e||46===e||e>=48&&e<=57||95===e||e>=97&&e<=122||e>=65&&e<=90||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function se(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}function re(e){return e>=33&&e<=35||36===e||e>=37&&e<=39||40===e||41===e||42===e||43===e||44===e||45===e||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||91===e||92===e||93===e||94===e||96===e||123===e||124===e||125===e||126===e||161===e||e>=162&&e<=165||166===e||167===e||169===e||171===e||172===e||174===e||176===e||177===e||182===e||187===e||191===e||215===e||247===e||e>=8208&&e<=8213||e>=8214&&e<=8215||8216===e||8217===e||8218===e||e>=8219&&e<=8220||8221===e||8222===e||8223===e||e>=8224&&e<=8231||e>=8240&&e<=8248||8249===e||8250===e||e>=8251&&e<=8254||e>=8257&&e<=8259||8260===e||8261===e||8262===e||e>=8263&&e<=8273||8274===e||8275===e||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||8608===e||e>=8609&&e<=8610||8611===e||e>=8612&&e<=8613||8614===e||e>=8615&&e<=8621||8622===e||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||8658===e||8659===e||8660===e||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||8968===e||8969===e||8970===e||8971===e||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||9001===e||9002===e||e>=9003&&e<=9083||9084===e||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||9655===e||e>=9656&&e<=9664||9665===e||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||9839===e||e>=9840&&e<=10087||10088===e||10089===e||10090===e||10091===e||10092===e||10093===e||10094===e||10095===e||10096===e||10097===e||10098===e||10099===e||10100===e||10101===e||e>=10132&&e<=10175||e>=10176&&e<=10180||10181===e||10182===e||e>=10183&&e<=10213||10214===e||10215===e||10216===e||10217===e||10218===e||10219===e||10220===e||10221===e||10222===e||10223===e||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||10627===e||10628===e||10629===e||10630===e||10631===e||10632===e||10633===e||10634===e||10635===e||10636===e||10637===e||10638===e||10639===e||10640===e||10641===e||10642===e||10643===e||10644===e||10645===e||10646===e||10647===e||10648===e||e>=10649&&e<=10711||10712===e||10713===e||10714===e||10715===e||e>=10716&&e<=10747||10748===e||10749===e||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||11158===e||e>=11159&&e<=11263||e>=11776&&e<=11777||11778===e||11779===e||11780===e||11781===e||e>=11782&&e<=11784||11785===e||11786===e||11787===e||11788===e||11789===e||e>=11790&&e<=11798||11799===e||e>=11800&&e<=11801||11802===e||11803===e||11804===e||11805===e||e>=11806&&e<=11807||11808===e||11809===e||11810===e||11811===e||11812===e||11813===e||11814===e||11815===e||11816===e||11817===e||e>=11818&&e<=11822||11823===e||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||11840===e||11841===e||11842===e||e>=11843&&e<=11855||e>=11856&&e<=11857||11858===e||e>=11859&&e<=11903||e>=12289&&e<=12291||12296===e||12297===e||12298===e||12299===e||12300===e||12301===e||12302===e||12303===e||12304===e||12305===e||e>=12306&&e<=12307||12308===e||12309===e||12310===e||12311===e||12312===e||12313===e||12314===e||12315===e||12316===e||12317===e||e>=12318&&e<=12319||12320===e||12336===e||64830===e||64831===e||e>=65093&&e<=65094}function oe(e){e.forEach(function(e){if(delete e.location,d(e)||p(e))for(var t in e.options)delete e.options[t].location,oe(e.options[t].value);else c(e)&&m(e.style)||(h(e)||u(e))&&y(e.style)?delete e.style.location:f(e)&&oe(e.children)})}function ae(e,t){void 0===t&&(t={}),t=(0,o.__assign)({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var i=new te(e,t).parse();if(i.err){var s=SyntaxError(n[i.err.kind]);throw s.location=i.err.location,s.originalMessage=i.err.message,s}return(null==t?void 0:t.captureLocation)||oe(i.val),i.val}},82607(e,t,i){"use strict";i.d(t,{E:()=>I});var n=i(65959),s=i(14716),r=i(71984),o=["localeMatcher","style","currency","currencyDisplay","unit","unitDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","currencyDisplay","currencySign","notation","signDisplay","unit","unitDisplay","numberingSystem"];function a(e,t,i){var n=e.locale,r=e.formats,a=e.onError;void 0===i&&(i={});var l=i.format,c=l&&(0,s.F3)(r,"number",l,a)||{};return t(n,(0,s.J9)(i,o,c))}function l(e,t,i,n){void 0===n&&(n={});try{return a(e,t,n).format(i)}catch(t){e.onError(new r.Ar(r.lo.FORMAT_ERROR,"Error formatting number.",t))}return String(i)}function c(e,t,i,n){void 0===n&&(n={});try{return a(e,t,n).formatToParts(i)}catch(t){e.onError(new r.Ar(r.lo.FORMAT_ERROR,"Error formatting number.",t))}return[]}var h=i(660),u=["numeric","style"];function d(e,t,i,n,o){void 0===o&&(o={}),n||(n="second"),Intl.RelativeTimeFormat||e.onError(new h.IF('Intl.RelativeTimeFormat is not available in this environment.\nTry polyfilling it using "@formatjs/intl-relativetimeformat"\n',h.O4.MISSING_INTL_API));try{return function(e,t,i){var n=e.locale,r=e.formats,o=e.onError;void 0===i&&(i={});var a=i.format,l=!!a&&(0,s.F3)(r,"relative",a,o)||{};return t(n,(0,s.J9)(i,u,l))}(e,t,o).format(i,n)}catch(t){e.onError(new r.pg("Error formatting relative time.",e.locale,t))}return String(i)}var p=["localeMatcher","formatMatcher","timeZone","hour12","weekday","era","year","month","day","hour","minute","second","timeZoneName","hourCycle","dateStyle","timeStyle","calendar","numberingSystem"];function g(e,t,i,r){var o=e.locale,a=e.formats,l=e.onError,c=e.timeZone;void 0===r&&(r={});var h=r.format,u=(0,n.__assign)((0,n.__assign)({},c&&{timeZone:c}),h&&(0,s.F3)(a,t,h,l)),d=(0,s.J9)(r,p,u);return"time"!==t||d.hour||d.minute||d.second||d.timeStyle||d.dateStyle||(d=(0,n.__assign)((0,n.__assign)({},d),{hour:"numeric",minute:"numeric"})),i(o,d)}function f(e,t){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];var s=i[0],o=i[1],a=void 0===o?{}:o,l="string"==typeof s?new Date(s||0):s;try{return g(e,"date",t,a).format(l)}catch(t){e.onError(new r.Ar(r.lo.FORMAT_ERROR,"Error formatting date.",t))}return String(l)}function m(e,t){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];var s=i[0],o=i[1],a=void 0===o?{}:o,l="string"==typeof s?new Date(s||0):s;try{return g(e,"time",t,a).format(l)}catch(t){e.onError(new r.Ar(r.lo.FORMAT_ERROR,"Error formatting time.",t))}return String(l)}function y(e,t){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];var o=i[0],a=i[1],l=i[2],c=void 0===l?{}:l,h=e.timeZone,u=e.locale,d=e.onError,g=(0,s.J9)(c,p,h?{timeZone:h}:{});try{return t(u,g).formatRange(o,a)}catch(e){d(new r.Ar(r.lo.FORMAT_ERROR,"Error formatting date time range.",e))}return String(o)}function v(e,t){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];var s=i[0],o=i[1],a=void 0===o?{}:o,l="string"==typeof s?new Date(s||0):s;try{return g(e,"date",t,a).formatToParts(l)}catch(t){e.onError(new r.Ar(r.lo.FORMAT_ERROR,"Error formatting date.",t))}return[]}function b(e,t){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];var s=i[0],o=i[1],a=void 0===o?{}:o,l="string"==typeof s?new Date(s||0):s;try{return g(e,"time",t,a).formatToParts(l)}catch(t){e.onError(new r.Ar(r.lo.FORMAT_ERROR,"Error formatting time.",t))}return[]}var C=["localeMatcher","type"];function w(e,t,i,n){var o=e.locale,a=e.onError;void 0===n&&(n={}),Intl.PluralRules||a(new h.IF('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',h.O4.MISSING_INTL_API));var l=(0,s.J9)(n,C);try{return t(o,l).select(i)}catch(e){a(new r.pg("Error formatting plural.",o,e))}return"other"}var S=i(62954),x=["localeMatcher","type","style"],E=Date.now();function A(e,t,i,n){void 0===n&&(n={});var s=M(e,t,i,n).reduce(function(e,t){var i=t.value;return"string"!=typeof i?e.push(i):"string"==typeof e[e.length-1]?e[e.length-1]+=i:e.push(i),e},[]);return 1===s.length?s[0]:s}function M(e,t,i,o){var a=e.locale,l=e.onError;void 0===o&&(o={}),Intl.ListFormat||l(new h.IF('Intl.ListFormat is not available in this environment.\nTry polyfilling it using "@formatjs/intl-listformat"\n',h.O4.MISSING_INTL_API));var c=(0,s.J9)(o,x);try{var u={},d=i.map(function(e,t){if("object"==typeof e){var i=function(e){return"".concat(E,"_").concat(e,"_").concat(E)}(t);return u[i]=e,i}return String(e)});return t(a,c).formatToParts(d).map(function(e){return"literal"===e.type?e:(0,n.__assign)((0,n.__assign)({},e),{value:u[e.value]||e.value})})}catch(e){l(new r.Ar(r.lo.FORMAT_ERROR,"Error formatting list.",e))}return i}var T=["localeMatcher","style","type","fallback"];function D(e,t,i,n){var o=e.locale,a=e.onError;Intl.DisplayNames||a(new h.IF('Intl.DisplayNames is not available in this environment.\nTry polyfilling it using "@formatjs/intl-displaynames"\n',h.O4.MISSING_INTL_API));var l=(0,s.J9)(n,T);try{return t(o,l).of(i)}catch(e){a(new r.Ar(r.lo.FORMAT_ERROR,"Error formatting display name.",e))}}function I(e,t){var i=(0,s.GT)(t),o=(0,n.__assign)((0,n.__assign)({},s.JF),e),a=o.locale,h=o.defaultLocale,u=o.onError;return a?!Intl.NumberFormat.supportedLocalesOf(a).length&&u?u(new r.hr('Missing locale data for locale: "'.concat(a,'" in Intl.NumberFormat. Using default locale: "').concat(h,'" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))):!Intl.DateTimeFormat.supportedLocalesOf(a).length&&u&&u(new r.hr('Missing locale data for locale: "'.concat(a,'" in Intl.DateTimeFormat. Using default locale: "').concat(h,'" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))):(u&&u(new r.uo('"locale" was not configured, using "'.concat(h,'" as fallback. See https://formatjs.io/docs/react-intl/api#intlshape for more details'))),o.locale=o.defaultLocale||"en"),function(e){var t;e.onWarn&&e.defaultRichTextElements&&"string"==typeof((t=e.messages||{})?t[Object.keys(t)[0]]:void 0)&&e.onWarn('[@formatjs/intl] "defaultRichTextElements" was specified but "message" was not pre-compiled. \nPlease consider using "@formatjs/cli" to pre-compile your messages for performance.\nFor more details see https://formatjs.io/docs/getting-started/message-distribution')}(o),(0,n.__assign)((0,n.__assign)({},o),{formatters:i,formatNumber:l.bind(null,o,i.getNumberFormat),formatNumberToParts:c.bind(null,o,i.getNumberFormat),formatRelativeTime:d.bind(null,o,i.getRelativeTimeFormat),formatDate:f.bind(null,o,i.getDateTimeFormat),formatDateToParts:v.bind(null,o,i.getDateTimeFormat),formatTime:m.bind(null,o,i.getDateTimeFormat),formatDateTimeRange:y.bind(null,o,i.getDateTimeFormat),formatTimeToParts:b.bind(null,o,i.getDateTimeFormat),formatPlural:w.bind(null,o,i.getPluralRules),formatMessage:S.h.bind(null,o,i),$t:S.h.bind(null,o,i),formatList:A.bind(null,o,i.getListFormat),formatListToParts:M.bind(null,o,i.getListFormat),formatDisplayName:D.bind(null,o,i.getDisplayNames)})}},71984(e,t,i){"use strict";i.d(t,{Ar:()=>r,Ho:()=>h,OC:()=>o,hr:()=>l,lo:()=>n,pg:()=>c,sb:()=>u,uo:()=>a});var n,s=i(65959);!function(e){e.FORMAT_ERROR="FORMAT_ERROR",e.UNSUPPORTED_FORMATTER="UNSUPPORTED_FORMATTER",e.INVALID_CONFIG="INVALID_CONFIG",e.MISSING_DATA="MISSING_DATA",e.MISSING_TRANSLATION="MISSING_TRANSLATION"}(n||(n={}));var r=function(e){function t(i,n,s){var r=this,o=s?s instanceof Error?s:new Error(String(s)):void 0;return(r=e.call(this,"[@formatjs/intl Error ".concat(i,"] ").concat(n," \n").concat(o?"\n".concat(o.message,"\n").concat(o.stack):""))||this).code=i,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(r,t),r}return(0,s.__extends)(t,e),t}(Error),o=function(e){function t(t,i){return e.call(this,n.UNSUPPORTED_FORMATTER,t,i)||this}return(0,s.__extends)(t,e),t}(r),a=function(e){function t(t,i){return e.call(this,n.INVALID_CONFIG,t,i)||this}return(0,s.__extends)(t,e),t}(r),l=function(e){function t(t,i){return e.call(this,n.MISSING_DATA,t,i)||this}return(0,s.__extends)(t,e),t}(r),c=function(e){function t(t,i,s){return e.call(this,n.FORMAT_ERROR,"".concat(t," \nLocale: ").concat(i,"\n"),s)||this}return(0,s.__extends)(t,e),t}(r),h=function(e){function t(t,i,n,s){var r=e.call(this,"".concat(t," \nMessageID: ").concat(null==n?void 0:n.id,"\nDefault Message: ").concat(null==n?void 0:n.defaultMessage,"\nDescription: ").concat(null==n?void 0:n.description," \n"),i,s)||this;return r.descriptor=n,r}return(0,s.__extends)(t,e),t}(c),u=function(e){function t(t,i){var s=e.call(this,n.MISSING_TRANSLATION,'Missing message: "'.concat(t.id,'" for locale "').concat(i,'", using ').concat(t.defaultMessage?"default message":"id"," as fallback."))||this;return s.descriptor=t,s}return(0,s.__extends)(t,e),t}(r)},62954(e,t,i){"use strict";i.d(t,{h:()=>u});var n=i(65959),s=i(81323),r=i(92859),o=i(71984),a=i(26140);function l(e,t){return Object.keys(e).reduce(function(i,s){return i[s]=(0,n.__assign)({timeZone:t},e[s]),i},{})}function c(e,t){return Object.keys((0,n.__assign)((0,n.__assign)({},e),t)).reduce(function(i,s){return i[s]=(0,n.__assign)((0,n.__assign)({},e[s]||{}),t[s]||{}),i},{})}function h(e,t){if(!t)return e;var i=r.S.formats;return(0,n.__assign)((0,n.__assign)((0,n.__assign)({},i),e),{date:c(l(i.date,t),l(e.date||{},t)),time:c(l(i.time,t),l(e.time||{},t))})}function u(e,t,i,r,l){var c=e.locale,u=e.formats,d=e.messages,p=e.defaultLocale,g=e.defaultFormats,f=e.fallbackOnEmptyString,m=e.onError,y=e.timeZone,v=e.defaultRichTextElements;void 0===i&&(i={id:""});var b=i.id,C=i.defaultMessage;(0,s.V1)(!!b,"[@formatjs/intl] An `id` must be provided to format a message. You can either:\n1. Configure your build toolchain with [babel-plugin-formatjs](https://formatjs.io/docs/tooling/babel-plugin)\nor [@formatjs/ts-transformer](https://formatjs.io/docs/tooling/ts-transformer) OR\n2. Configure your `eslint` config to include [eslint-plugin-formatjs](https://formatjs.io/docs/tooling/linter#enforce-id)\nto autofix this issue");var w=String(b),S=d&&Object.prototype.hasOwnProperty.call(d,w)&&d[w];if(Array.isArray(S)&&1===S.length&&S[0].type===a.ZE.literal)return S[0].value;if(!r&&S&&"string"==typeof S&&!v)return S.replace(/'\{(.*?)\}'/gi,"{$1}");if(r=(0,n.__assign)((0,n.__assign)({},v),r||{}),u=h(u,y),g=h(g,y),!S){if(!1===f&&""===S)return S;if((!C||c&&c.toLowerCase()!==p.toLowerCase())&&m(new o.sb(i,c)),C)try{return t.getMessageFormat(C,p,g,l).format(r)}catch(e){return m(new o.Ho('Error formatting default message for: "'.concat(w,'", rendering default message verbatim'),c,i,e)),"string"==typeof C?C:w}return w}try{return t.getMessageFormat(S,c,u,(0,n.__assign)({formatters:t},l||{})).format(r)}catch(e){m(new o.Ho('Error formatting message: "'.concat(w,'", using ').concat(C?"default message":"id"," as fallback."),c,i,e))}if(C)try{return t.getMessageFormat(C,p,g,l).format(r)}catch(e){m(new o.Ho('Error formatting the default message for: "'.concat(w,'", rendering message verbatim'),c,i,e))}return"string"==typeof S?S:"string"==typeof C?C:w}},14716(e,t,i){"use strict";i.d(t,{F3:()=>d,GT:()=>u,J9:()=>a,JF:()=>l,MT:()=>c});var n=i(65959),s=i(92859),r=i(59556),o=i(71984);function a(e,t,i){return void 0===i&&(i={}),t.reduce(function(t,n){return n in e?t[n]=e[n]:n in i&&(t[n]=i[n]),t},{})}var l={formats:{},messages:{},timeZone:void 0,defaultLocale:"en",defaultFormats:{},fallbackOnEmptyString:!0,onError:function(e){},onWarn:function(e){}};function c(){return{dateTime:{},number:{},message:{},relativeTime:{},pluralRules:{},list:{},displayNames:{}}}function h(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,i){e[t]=i}}}}}function u(e){void 0===e&&(e={dateTime:{},number:{},message:{},relativeTime:{},pluralRules:{},list:{},displayNames:{}});var t=Intl.RelativeTimeFormat,i=Intl.ListFormat,o=Intl.DisplayNames,a=(0,r.A)(function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return new((e=Intl.DateTimeFormat).bind.apply(e,(0,n.__spreadArray)([void 0],t,!1)))},{cache:h(e.dateTime),strategy:r.W.variadic}),l=(0,r.A)(function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return new((e=Intl.NumberFormat).bind.apply(e,(0,n.__spreadArray)([void 0],t,!1)))},{cache:h(e.number),strategy:r.W.variadic}),c=(0,r.A)(function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return new((e=Intl.PluralRules).bind.apply(e,(0,n.__spreadArray)([void 0],t,!1)))},{cache:h(e.pluralRules),strategy:r.W.variadic});return{getDateTimeFormat:a,getNumberFormat:l,getMessageFormat:(0,r.A)(function(e,t,i,r){return new s.S(e,t,i,(0,n.__assign)({formatters:{getNumberFormat:l,getDateTimeFormat:a,getPluralRules:c}},r||{}))},{cache:h(e.message),strategy:r.W.variadic}),getRelativeTimeFormat:(0,r.A)(function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return new(t.bind.apply(t,(0,n.__spreadArray)([void 0],e,!1)))},{cache:h(e.relativeTime),strategy:r.W.variadic}),getPluralRules:c,getListFormat:(0,r.A)(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return new(i.bind.apply(i,(0,n.__spreadArray)([void 0],e,!1)))},{cache:h(e.list),strategy:r.W.variadic}),getDisplayNames:(0,r.A)(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return new(o.bind.apply(o,(0,n.__spreadArray)([void 0],e,!1)))},{cache:h(e.displayNames),strategy:r.W.variadic})}}function d(e,t,i,n){var s,r=e&&e[t];if(r&&(s=r[i]),s)return s;n(new o.OC("No ".concat(t," format named: ").concat(i)))}},47901(e,t,i){"use strict";const n=i(65988),s=/^[\da-fA-F]+$/,r=/^\d+$/,o=new WeakMap;function a(e){e=e.Parser.acorn||e;let t=o.get(e);if(!t){const i=e.tokTypes,n=e.TokContext,s=e.TokenType,r=new n("<tag",!1),a=new n("</tag",!1),l=new n("<tag>...</tag>",!0,!0),c={tc_oTag:r,tc_cTag:a,tc_expr:l},h={jsxName:new s("jsxName"),jsxText:new s("jsxText",{beforeExpr:!0}),jsxTagStart:new s("jsxTagStart",{startsExpr:!0}),jsxTagEnd:new s("jsxTagEnd")};h.jsxTagStart.updateContext=function(){this.context.push(l),this.context.push(r),this.exprAllowed=!1},h.jsxTagEnd.updateContext=function(e){let t=this.context.pop();t===r&&e===i.slash||t===a?(this.context.pop(),this.exprAllowed=this.curContext()===l):this.exprAllowed=!0},t={tokContexts:c,tokTypes:h},o.set(e,t)}return t}function l(e){return e?"JSXIdentifier"===e.type?e.name:"JSXNamespacedName"===e.type?e.namespace.name+":"+e.name.name:"JSXMemberExpression"===e.type?l(e.object)+"."+l(e.property):void 0:e}e.exports=function(e){return e=e||{},function(t){return function(e,t){const o=t.acorn||i(5517),c=a(o),h=o.tokTypes,u=c.tokTypes,d=o.tokContexts,p=c.tokContexts.tc_oTag,g=c.tokContexts.tc_cTag,f=c.tokContexts.tc_expr,m=o.isNewLine,y=o.isIdentifierStart,v=o.isIdentifierChar;return class extends t{static get acornJsx(){return c}jsx_readToken(){let e="",t=this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated JSX contents");let i=this.input.charCodeAt(this.pos);switch(i){case 60:case 123:return this.pos===this.start?60===i&&this.exprAllowed?(++this.pos,this.finishToken(u.jsxTagStart)):this.getTokenFromCode(i):(e+=this.input.slice(t,this.pos),this.finishToken(u.jsxText,e));case 38:e+=this.input.slice(t,this.pos),e+=this.jsx_readEntity(),t=this.pos;break;case 62:case 125:this.raise(this.pos,"Unexpected token `"+this.input[this.pos]+"`. Did you mean `"+(62===i?"&gt;":"&rbrace;")+'` or `{"'+this.input[this.pos]+'"}`?');default:m(i)?(e+=this.input.slice(t,this.pos),e+=this.jsx_readNewLine(!0),t=this.pos):++this.pos}}}jsx_readNewLine(e){let t,i=this.input.charCodeAt(this.pos);return++this.pos,13===i&&10===this.input.charCodeAt(this.pos)?(++this.pos,t=e?"\n":"\r\n"):t=String.fromCharCode(i),this.options.locations&&(++this.curLine,this.lineStart=this.pos),t}jsx_readString(e){let t="",i=++this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");let n=this.input.charCodeAt(this.pos);if(n===e)break;38===n?(t+=this.input.slice(i,this.pos),t+=this.jsx_readEntity(),i=this.pos):m(n)?(t+=this.input.slice(i,this.pos),t+=this.jsx_readNewLine(!1),i=this.pos):++this.pos}return t+=this.input.slice(i,this.pos++),this.finishToken(h.string,t)}jsx_readEntity(){let e,t="",i=0,o=this.input[this.pos];"&"!==o&&this.raise(this.pos,"Entity must start with an ampersand");let a=++this.pos;for(;this.pos<this.input.length&&i++<10;){if(o=this.input[this.pos++],";"===o){"#"===t[0]?"x"===t[1]?(t=t.substr(2),s.test(t)&&(e=String.fromCharCode(parseInt(t,16)))):(t=t.substr(1),r.test(t)&&(e=String.fromCharCode(parseInt(t,10)))):e=n[t];break}t+=o}return e||(this.pos=a,"&")}jsx_readWord(){let e,t=this.pos;do{e=this.input.charCodeAt(++this.pos)}while(v(e)||45===e);return this.finishToken(u.jsxName,this.input.slice(t,this.pos))}jsx_parseIdentifier(){let e=this.startNode();return this.type===u.jsxName?e.name=this.value:this.type.keyword?e.name=this.type.keyword:this.unexpected(),this.next(),this.finishNode(e,"JSXIdentifier")}jsx_parseNamespacedName(){let t=this.start,i=this.startLoc,n=this.jsx_parseIdentifier();if(!e.allowNamespaces||!this.eat(h.colon))return n;var s=this.startNodeAt(t,i);return s.namespace=n,s.name=this.jsx_parseIdentifier(),this.finishNode(s,"JSXNamespacedName")}jsx_parseElementName(){if(this.type===u.jsxTagEnd)return"";let t=this.start,i=this.startLoc,n=this.jsx_parseNamespacedName();for(this.type!==h.dot||"JSXNamespacedName"!==n.type||e.allowNamespacedObjects||this.unexpected();this.eat(h.dot);){let e=this.startNodeAt(t,i);e.object=n,e.property=this.jsx_parseIdentifier(),n=this.finishNode(e,"JSXMemberExpression")}return n}jsx_parseAttributeValue(){switch(this.type){case h.braceL:let e=this.jsx_parseExpressionContainer();return"JSXEmptyExpression"===e.expression.type&&this.raise(e.start,"JSX attributes must only be assigned a non-empty expression"),e;case u.jsxTagStart:case h.string:return this.parseExprAtom();default:this.raise(this.start,"JSX value should be either an expression or a quoted JSX text")}}jsx_parseEmptyExpression(){let e=this.startNodeAt(this.lastTokEnd,this.lastTokEndLoc);return this.finishNodeAt(e,"JSXEmptyExpression",this.start,this.startLoc)}jsx_parseExpressionContainer(){let e=this.startNode();return this.next(),e.expression=this.type===h.braceR?this.jsx_parseEmptyExpression():this.parseExpression(),this.expect(h.braceR),this.finishNode(e,"JSXExpressionContainer")}jsx_parseAttribute(){let e=this.startNode();return this.eat(h.braceL)?(this.expect(h.ellipsis),e.argument=this.parseMaybeAssign(),this.expect(h.braceR),this.finishNode(e,"JSXSpreadAttribute")):(e.name=this.jsx_parseNamespacedName(),e.value=this.eat(h.eq)?this.jsx_parseAttributeValue():null,this.finishNode(e,"JSXAttribute"))}jsx_parseOpeningElementAt(e,t){let i=this.startNodeAt(e,t);i.attributes=[];let n=this.jsx_parseElementName();for(n&&(i.name=n);this.type!==h.slash&&this.type!==u.jsxTagEnd;)i.attributes.push(this.jsx_parseAttribute());return i.selfClosing=this.eat(h.slash),this.expect(u.jsxTagEnd),this.finishNode(i,n?"JSXOpeningElement":"JSXOpeningFragment")}jsx_parseClosingElementAt(e,t){let i=this.startNodeAt(e,t),n=this.jsx_parseElementName();return n&&(i.name=n),this.expect(u.jsxTagEnd),this.finishNode(i,n?"JSXClosingElement":"JSXClosingFragment")}jsx_parseElementAt(e,t){let i=this.startNodeAt(e,t),n=[],s=this.jsx_parseOpeningElementAt(e,t),r=null;if(!s.selfClosing){e:for(;;)switch(this.type){case u.jsxTagStart:if(e=this.start,t=this.startLoc,this.next(),this.eat(h.slash)){r=this.jsx_parseClosingElementAt(e,t);break e}n.push(this.jsx_parseElementAt(e,t));break;case u.jsxText:n.push(this.parseExprAtom());break;case h.braceL:n.push(this.jsx_parseExpressionContainer());break;default:this.unexpected()}l(r.name)!==l(s.name)&&this.raise(r.start,"Expected corresponding JSX closing tag for <"+l(s.name)+">")}let o=s.name?"Element":"Fragment";return i["opening"+o]=s,i["closing"+o]=r,i.children=n,this.type===h.relational&&"<"===this.value&&this.raise(this.start,"Adjacent JSX elements must be wrapped in an enclosing tag"),this.finishNode(i,"JSX"+o)}jsx_parseText(){let e=this.parseLiteral(this.value);return e.type="JSXText",e}jsx_parseElement(){let e=this.start,t=this.startLoc;return this.next(),this.jsx_parseElementAt(e,t)}parseExprAtom(e){return this.type===u.jsxText?this.jsx_parseText():this.type===u.jsxTagStart?this.jsx_parseElement():super.parseExprAtom(e)}readToken(e){let t=this.curContext();if(t===f)return this.jsx_readToken();if(t===p||t===g){if(y(e))return this.jsx_readWord();if(62==e)return++this.pos,this.finishToken(u.jsxTagEnd);if((34===e||39===e)&&t==p)return this.jsx_readString(e)}return 60===e&&this.exprAllowed&&33!==this.input.charCodeAt(this.pos+1)?(++this.pos,this.finishToken(u.jsxTagStart)):super.readToken(e)}updateContext(e){if(this.type==h.braceL){var t=this.curContext();t==p?this.context.push(d.b_expr):t==f?this.context.push(d.b_tmpl):super.updateContext(e),this.exprAllowed=!0}else{if(this.type!==h.slash||e!==u.jsxTagStart)return super.updateContext(e);this.context.length-=2,this.context.push(g),this.exprAllowed=!1}}}}({allowNamespaces:!1!==e.allowNamespaces,allowNamespacedObjects:!!e.allowNamespacedObjects},t)}},Object.defineProperty(e.exports,"tokTypes",{get:function(){return a(i(5517)).tokTypes},configurable:!0,enumerable:!0})},65988(e){e.exports={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}},5517(e,t){!function(e){"use strict";var t=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],i=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],n="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-࢏ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚ౜ౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ೜-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-Ƛ꟱-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ﬀ-ﬆﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼＡ-Ｚａ-ｚｦ-ﾾￂ-ￇￊ-ￏￒ-ￗￚ-ￜ",s={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},r="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",o={5:r,"5module":r+" export import",6:r+" const class extends export import super"},a=/^in(stanceof)?$/,l=new RegExp("["+n+"]"),c=new RegExp("["+n+"‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-᫝᫠-᫫ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏０-９＿･]");function h(e,t){for(var i=65536,n=0;n<t.length;n+=2){if((i+=t[n])>e)return!1;if((i+=t[n+1])>=e)return!0}return!1}function u(e,t){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&l.test(String.fromCharCode(e)):!1!==t&&h(e,i)))}function d(e,n){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&c.test(String.fromCharCode(e)):!1!==n&&(h(e,i)||h(e,t)))))}var p=function(e,t){void 0===t&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function g(e,t){return new p(e,{beforeExpr:!0,binop:t})}var f={beforeExpr:!0},m={startsExpr:!0},y={};function v(e,t){return void 0===t&&(t={}),t.keyword=e,y[e]=new p(e,t)}var b={num:new p("num",m),regexp:new p("regexp",m),string:new p("string",m),name:new p("name",m),privateId:new p("privateId",m),eof:new p("eof"),bracketL:new p("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new p("]"),braceL:new p("{",{beforeExpr:!0,startsExpr:!0}),braceR:new p("}"),parenL:new p("(",{beforeExpr:!0,startsExpr:!0}),parenR:new p(")"),comma:new p(",",f),semi:new p(";",f),colon:new p(":",f),dot:new p("."),question:new p("?",f),questionDot:new p("?."),arrow:new p("=>",f),template:new p("template"),invalidTemplate:new p("invalidTemplate"),ellipsis:new p("...",f),backQuote:new p("`",m),dollarBraceL:new p("${",{beforeExpr:!0,startsExpr:!0}),eq:new p("=",{beforeExpr:!0,isAssign:!0}),assign:new p("_=",{beforeExpr:!0,isAssign:!0}),incDec:new p("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new p("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:g("||",1),logicalAND:g("&&",2),bitwiseOR:g("|",3),bitwiseXOR:g("^",4),bitwiseAND:g("&",5),equality:g("==/!=/===/!==",6),relational:g("</>/<=/>=",7),bitShift:g("<</>>/>>>",8),plusMin:new p("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:g("%",10),star:g("*",10),slash:g("/",10),starstar:new p("**",{beforeExpr:!0}),coalesce:g("??",1),_break:v("break"),_case:v("case",f),_catch:v("catch"),_continue:v("continue"),_debugger:v("debugger"),_default:v("default",f),_do:v("do",{isLoop:!0,beforeExpr:!0}),_else:v("else",f),_finally:v("finally"),_for:v("for",{isLoop:!0}),_function:v("function",m),_if:v("if"),_return:v("return",f),_switch:v("switch"),_throw:v("throw",f),_try:v("try"),_var:v("var"),_const:v("const"),_while:v("while",{isLoop:!0}),_with:v("with"),_new:v("new",{beforeExpr:!0,startsExpr:!0}),_this:v("this",m),_super:v("super",m),_class:v("class",m),_extends:v("extends",f),_export:v("export"),_import:v("import",m),_null:v("null",m),_true:v("true",m),_false:v("false",m),_in:v("in",{beforeExpr:!0,binop:7}),_instanceof:v("instanceof",{beforeExpr:!0,binop:7}),_typeof:v("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:v("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:v("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},C=/\r\n?|\n|\u2028|\u2029/,w=new RegExp(C.source,"g");function S(e){return 10===e||13===e||8232===e||8233===e}function x(e,t,i){void 0===i&&(i=e.length);for(var n=t;n<i;n++){var s=e.charCodeAt(n);if(S(s))return n<i-1&&13===s&&10===e.charCodeAt(n+1)?n+2:n+1}return-1}var E=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,A=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,M=Object.prototype,T=M.hasOwnProperty,D=M.toString,I=Object.hasOwn||function(e,t){return T.call(e,t)},R=Array.isArray||function(e){return"[object Array]"===D.call(e)},k=Object.create(null);function P(e){return k[e]||(k[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function _(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}var L=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,N=function(e,t){this.line=e,this.column=t};N.prototype.offset=function(e){return new N(this.line,this.column+e)};var O=function(e,t,i){this.start=t,this.end=i,null!==e.sourceFile&&(this.source=e.sourceFile)};function F(e,t){for(var i=1,n=0;;){var s=x(e,n,t);if(s<0)return new N(i,t-n);++i,n=s}}var G={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},B=!1;function V(e){var t={};for(var i in G)t[i]=e&&I(e,i)?e[i]:G[i];if("latest"===t.ecmaVersion?t.ecmaVersion=1e8:null==t.ecmaVersion?(!B&&"object"==typeof console&&console.warn&&(B=!0,console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.")),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),e&&null!=e.allowHashBang||(t.allowHashBang=t.ecmaVersion>=14),R(t.onToken)){var n=t.onToken;t.onToken=function(e){return n.push(e)}}if(R(t.onComment)&&(t.onComment=function(e,t){return function(i,n,s,r,o,a){var l={type:i?"Block":"Line",value:n,start:s,end:r};e.locations&&(l.loc=new O(this,o,a)),e.ranges&&(l.range=[s,r]),t.push(l)}}(t,t.onComment)),"commonjs"===t.sourceType&&t.allowAwaitOutsideFunction)throw new Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return t}var H=256,U=259;function z(e,t){return 2|(e?4:0)|(t?8:0)}var W=function(e,t,i){this.options=e=V(e),this.sourceFile=e.sourceFile,this.keywords=P(o[e.ecmaVersion>=6?6:"module"===e.sourceType?"5module":5]);var n="";!0!==e.allowReserved&&(n=s[e.ecmaVersion>=6?6:5===e.ecmaVersion?5:3],"module"===e.sourceType&&(n+=" await")),this.reservedWords=P(n);var r=(n?n+" ":"")+s.strict;this.reservedWordsStrict=P(r),this.reservedWordsStrictBind=P(r+" "+s.strictBind),this.input=String(t),this.containsEsc=!1,i?(this.pos=i,this.lineStart=this.input.lastIndexOf("\n",i-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(C).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=b.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===e.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope("commonjs"===this.options.sourceType?2:1),this.regexpState=null,this.privateNameStack=[]},j={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowReturn:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},allowUsing:{configurable:!0},inClassStaticBlock:{configurable:!0}};W.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},j.inFunction.get=function(){return(2&this.currentVarScope().flags)>0},j.inGenerator.get=function(){return(8&this.currentVarScope().flags)>0},j.inAsync.get=function(){return(4&this.currentVarScope().flags)>0},j.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(768&t)return!1;if(2&t)return(4&t)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},j.allowReturn.get=function(){return!!this.inFunction||!!(this.options.allowReturnOutsideFunction&&1&this.currentVarScope().flags)},j.allowSuper.get=function(){return(64&this.currentThisScope().flags)>0||this.options.allowSuperOutsideMethod},j.allowDirectSuper.get=function(){return(128&this.currentThisScope().flags)>0},j.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},j.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(768&t||2&t&&!(16&t))return!0}return!1},j.allowUsing.get=function(){var e=this.currentScope().flags;return!(1024&e||!this.inModule&&1&e)},j.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&H)>0},W.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var i=this,n=0;n<e.length;n++)i=e[n](i);return i},W.parse=function(e,t){return new this(t,e).parse()},W.parseExpressionAt=function(e,t,i){var n=new this(i,e,t);return n.nextToken(),n.parseExpression()},W.tokenizer=function(e,t){return new this(t,e)},Object.defineProperties(W.prototype,j);var $=W.prototype,K=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;$.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){A.lastIndex=e,e+=A.exec(this.input)[0].length;var t=K.exec(this.input.slice(e));if(!t)return!1;if("use strict"===(t[1]||t[2])){A.lastIndex=e+t[0].length;var i=A.exec(this.input),n=i.index+i[0].length,s=this.input.charAt(n);return";"===s||"}"===s||C.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(s)||"!"===s&&"="===this.input.charAt(n+1))}e+=t[0].length,A.lastIndex=e,e+=A.exec(this.input)[0].length,";"===this.input[e]&&e++}},$.eat=function(e){return this.type===e&&(this.next(),!0)},$.isContextual=function(e){return this.type===b.name&&this.value===e&&!this.containsEsc},$.eatContextual=function(e){return!!this.isContextual(e)&&(this.next(),!0)},$.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},$.canInsertSemicolon=function(){return this.type===b.eof||this.type===b.braceR||C.test(this.input.slice(this.lastTokEnd,this.start))},$.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},$.semicolon=function(){this.eat(b.semi)||this.insertSemicolon()||this.unexpected()},$.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},$.expect=function(e){this.eat(e)||this.unexpected()},$.unexpected=function(e){this.raise(null!=e?e:this.start,"Unexpected token")};var Y=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};$.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var i=t?e.parenthesizedAssign:e.parenthesizedBind;i>-1&&this.raiseRecoverable(i,t?"Assigning to rvalue":"Parenthesized pattern")}},$.checkExpressionErrors=function(e,t){if(!e)return!1;var i=e.shorthandAssign,n=e.doubleProto;if(!t)return i>=0||n>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),n>=0&&this.raiseRecoverable(n,"Redefinition of __proto__ property")},$.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},$.isSimpleAssignTarget=function(e){return"ParenthesizedExpression"===e.type?this.isSimpleAssignTarget(e.expression):"Identifier"===e.type||"MemberExpression"===e.type};var q=W.prototype;q.parseTopLevel=function(e){var t=Object.create(null);for(e.body||(e.body=[]);this.type!==b.eof;){var i=this.parseStatement(null,!0,t);e.body.push(i)}if(this.inModule)for(var n=0,s=Object.keys(this.undefinedExports);n<s.length;n+=1){var r=s[n];this.raiseRecoverable(this.undefinedExports[r].start,"Export '"+r+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType="commonjs"===this.options.sourceType?"script":this.options.sourceType,this.finishNode(e,"Program")};var X={kind:"loop"},Z={kind:"switch"};q.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;A.lastIndex=this.pos;var t=A.exec(this.input),i=this.pos+t[0].length,n=this.fullCharCodeAt(i);if(91===n||92===n)return!0;if(e)return!1;if(123===n)return!0;if(u(n)){var s=i;do{i+=n<=65535?1:2}while(d(n=this.fullCharCodeAt(i)));if(92===n)return!0;var r=this.input.slice(s,i);if(!a.test(r))return!0}return!1},q.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;A.lastIndex=this.pos;var e,t=A.exec(this.input),i=this.pos+t[0].length;return!(C.test(this.input.slice(this.pos,i))||"function"!==this.input.slice(i,i+8)||i+8!==this.input.length&&(d(e=this.fullCharCodeAt(i+8))||92===e))},q.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?"await":"using"))return!1;A.lastIndex=this.pos;var i=A.exec(this.input),n=this.pos+i[0].length;if(C.test(this.input.slice(this.pos,n)))return!1;if(e){var s,r=n+5;if("using"!==this.input.slice(n,r)||r===this.input.length||d(s=this.fullCharCodeAt(r))||92===s)return!1;A.lastIndex=r;var o=A.exec(this.input);if(n=r+o[0].length,o&&C.test(this.input.slice(r,n)))return!1}var l=this.fullCharCodeAt(n);if(!u(l)&&92!==l)return!1;var c=n;do{n+=l<=65535?1:2}while(d(l=this.fullCharCodeAt(n)));if(92===l)return!0;var h=this.input.slice(c,n);return!(a.test(h)||t&&"of"===h)},q.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)},q.isUsing=function(e){return this.isUsingKeyword(!1,e)},q.parseStatement=function(e,t,i){var n,s=this.type,r=this.startNode();switch(this.isLet(e)&&(s=b._var,n="let"),s){case b._break:case b._continue:return this.parseBreakContinueStatement(r,s.keyword);case b._debugger:return this.parseDebuggerStatement(r);case b._do:return this.parseDoStatement(r);case b._for:return this.parseForStatement(r);case b._function:return e&&(this.strict||"if"!==e&&"label"!==e)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(r,!1,!e);case b._class:return e&&this.unexpected(),this.parseClass(r,!0);case b._if:return this.parseIfStatement(r);case b._return:return this.parseReturnStatement(r);case b._switch:return this.parseSwitchStatement(r);case b._throw:return this.parseThrowStatement(r);case b._try:return this.parseTryStatement(r);case b._const:case b._var:return n=n||this.value,e&&"var"!==n&&this.unexpected(),this.parseVarStatement(r,n);case b._while:return this.parseWhileStatement(r);case b._with:return this.parseWithStatement(r);case b.braceL:return this.parseBlock(!0,r);case b.semi:return this.parseEmptyStatement(r);case b._export:case b._import:if(this.options.ecmaVersion>10&&s===b._import){A.lastIndex=this.pos;var o=A.exec(this.input),a=this.pos+o[0].length,l=this.input.charCodeAt(a);if(40===l||46===l)return this.parseExpressionStatement(r,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),s===b._import?this.parseImport(r):this.parseExport(r,i);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(r,!0,!e);var c=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(c)return this.allowUsing||this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"),"await using"===c&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.next(),this.parseVar(r,!1,c),this.semicolon(),this.finishNode(r,"VariableDeclaration");var h=this.value,u=this.parseExpression();return s===b.name&&"Identifier"===u.type&&this.eat(b.colon)?this.parseLabeledStatement(r,h,u,e):this.parseExpressionStatement(r,u)}},q.parseBreakContinueStatement=function(e,t){var i="break"===t;this.next(),this.eat(b.semi)||this.insertSemicolon()?e.label=null:this.type!==b.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var n=0;n<this.labels.length;++n){var s=this.labels[n];if(null==e.label||s.name===e.label.name){if(null!=s.kind&&(i||"loop"===s.kind))break;if(e.label&&i)break}}return n===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,i?"BreakStatement":"ContinueStatement")},q.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")},q.parseDoStatement=function(e){return this.next(),this.labels.push(X),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(b._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(b.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},q.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(X),this.enterScope(0),this.expect(b.parenL),this.type===b.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var i=this.isLet();if(this.type===b._var||this.type===b._const||i){var n=this.startNode(),s=i?"let":this.value;return this.next(),this.parseVar(n,!0,s),this.finishNode(n,"VariableDeclaration"),this.parseForAfterInit(e,n,t)}var r=this.isContextual("let"),o=!1,a=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(a){var l=this.startNode();return this.next(),"await using"===a&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.parseVar(l,!0,a),this.finishNode(l,"VariableDeclaration"),this.parseForAfterInit(e,l,t)}var c=this.containsEsc,h=new Y,u=this.start,d=t>-1?this.parseExprSubscripts(h,"await"):this.parseExpression(!0,h);return this.type===b._in||(o=this.options.ecmaVersion>=6&&this.isContextual("of"))?(t>-1?(this.type===b._in&&this.unexpected(t),e.await=!0):o&&this.options.ecmaVersion>=8&&(d.start!==u||c||"Identifier"!==d.type||"async"!==d.name?this.options.ecmaVersion>=9&&(e.await=!1):this.unexpected()),r&&o&&this.raise(d.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(d,!1,h),this.checkLValPattern(d),this.parseForIn(e,d)):(this.checkExpressionErrors(h,!0),t>-1&&this.unexpected(t),this.parseFor(e,d))},q.parseForAfterInit=function(e,t,i){return(this.type===b._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===t.declarations.length?(this.options.ecmaVersion>=9&&(this.type===b._in?i>-1&&this.unexpected(i):e.await=i>-1),this.parseForIn(e,t)):(i>-1&&this.unexpected(i),this.parseFor(e,t))},q.parseFunctionStatement=function(e,t,i){return this.next(),this.parseFunction(e,J|(i?0:ee),!1,t)},q.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(b._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")},q.parseReturnStatement=function(e){return this.allowReturn||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(b.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},q.parseSwitchStatement=function(e){var t;this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(b.braceL),this.labels.push(Z),this.enterScope(1024);for(var i=!1;this.type!==b.braceR;)if(this.type===b._case||this.type===b._default){var n=this.type===b._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),n?t.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,t.test=null),this.expect(b.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},q.parseThrowStatement=function(e){return this.next(),C.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var Q=[];q.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t="Identifier"===e.type;return this.enterScope(t?32:0),this.checkLValPattern(e,t?4:2),this.expect(b.parenR),e},q.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===b._catch){var t=this.startNode();this.next(),this.eat(b.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(b._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},q.parseVarStatement=function(e,t,i){return this.next(),this.parseVar(e,!1,t,i),this.semicolon(),this.finishNode(e,"VariableDeclaration")},q.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(X),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},q.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")},q.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},q.parseLabeledStatement=function(e,t,i,n){for(var s=0,r=this.labels;s<r.length;s+=1)r[s].name===t&&this.raise(i.start,"Label '"+t+"' is already declared");for(var o=this.type.isLoop?"loop":this.type===b._switch?"switch":null,a=this.labels.length-1;a>=0;a--){var l=this.labels[a];if(l.statementStart!==e.start)break;l.statementStart=this.start,l.kind=o}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(n?-1===n.indexOf("label")?n+"label":n:"label"),this.labels.pop(),e.label=i,this.finishNode(e,"LabeledStatement")},q.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},q.parseBlock=function(e,t,i){for(void 0===e&&(e=!0),void 0===t&&(t=this.startNode()),t.body=[],this.expect(b.braceL),e&&this.enterScope(0);this.type!==b.braceR;){var n=this.parseStatement(null);t.body.push(n)}return i&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")},q.parseFor=function(e,t){return e.init=t,this.expect(b.semi),e.test=this.type===b.semi?null:this.parseExpression(),this.expect(b.semi),e.update=this.type===b.parenR?null:this.parseExpression(),this.expect(b.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},q.parseForIn=function(e,t){var i=this.type===b._in;return this.next(),"VariableDeclaration"===t.type&&null!=t.declarations[0].init&&(!i||this.options.ecmaVersion<8||this.strict||"var"!==t.kind||"Identifier"!==t.declarations[0].id.type)&&this.raise(t.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(b.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,i?"ForInStatement":"ForOfStatement")},q.parseVar=function(e,t,i,n){for(e.declarations=[],e.kind=i;;){var s=this.startNode();if(this.parseVarId(s,i),this.eat(b.eq)?s.init=this.parseMaybeAssign(t):n||"const"!==i||this.type===b._in||this.options.ecmaVersion>=6&&this.isContextual("of")?n||"using"!==i&&"await using"!==i||!(this.options.ecmaVersion>=17)||this.type===b._in||this.isContextual("of")?n||"Identifier"===s.id.type||t&&(this.type===b._in||this.isContextual("of"))?s.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.raise(this.lastTokEnd,"Missing initializer in "+i+" declaration"):this.unexpected(),e.declarations.push(this.finishNode(s,"VariableDeclarator")),!this.eat(b.comma))break}return e},q.parseVarId=function(e,t){e.id="using"===t||"await using"===t?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,"var"===t?1:2,!1)};var J=1,ee=2;function te(e,t){var i=t.key.name,n=e[i],s="true";return"MethodDefinition"!==t.type||"get"!==t.kind&&"set"!==t.kind||(s=(t.static?"s":"i")+t.kind),"iget"===n&&"iset"===s||"iset"===n&&"iget"===s||"sget"===n&&"sset"===s||"sset"===n&&"sget"===s?(e[i]="true",!1):!!n||(e[i]=s,!1)}function ie(e,t){var i=e.computed,n=e.key;return!i&&("Identifier"===n.type&&n.name===t||"Literal"===n.type&&n.value===t)}q.parseFunction=function(e,t,i,n,s){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!n)&&(this.type===b.star&&t&ee&&this.unexpected(),e.generator=this.eat(b.star)),this.options.ecmaVersion>=8&&(e.async=!!n),t&J&&(e.id=4&t&&this.type!==b.name?null:this.parseIdent(),!e.id||t&ee||this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?1:2:3));var r=this.yieldPos,o=this.awaitPos,a=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(z(e.async,e.generator)),t&J||(e.id=this.type===b.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,i,!1,s),this.yieldPos=r,this.awaitPos=o,this.awaitIdentPos=a,this.finishNode(e,t&J?"FunctionDeclaration":"FunctionExpression")},q.parseFunctionParams=function(e){this.expect(b.parenL),e.params=this.parseBindingList(b.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},q.parseClass=function(e,t){this.next();var i=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var n=this.enterClassBody(),s=this.startNode(),r=!1;for(s.body=[],this.expect(b.braceL);this.type!==b.braceR;){var o=this.parseClassElement(null!==e.superClass);o&&(s.body.push(o),"MethodDefinition"===o.type&&"constructor"===o.kind?(r&&this.raiseRecoverable(o.start,"Duplicate constructor in the same class"),r=!0):o.key&&"PrivateIdentifier"===o.key.type&&te(n,o)&&this.raiseRecoverable(o.key.start,"Identifier '#"+o.key.name+"' has already been declared"))}return this.strict=i,this.next(),e.body=this.finishNode(s,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},q.parseClassElement=function(e){if(this.eat(b.semi))return null;var t=this.options.ecmaVersion,i=this.startNode(),n="",s=!1,r=!1,o="method",a=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(b.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===b.star?a=!0:n="static"}if(i.static=a,!n&&t>=8&&this.eatContextual("async")&&(!this.isClassElementNameStart()&&this.type!==b.star||this.canInsertSemicolon()?n="async":r=!0),!n&&(t>=9||!r)&&this.eat(b.star)&&(s=!0),!n&&!r&&!s){var l=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?o=l:n=l)}if(n?(i.computed=!1,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=n,this.finishNode(i.key,"Identifier")):this.parseClassElementName(i),t<13||this.type===b.parenL||"method"!==o||s||r){var c=!i.static&&ie(i,"constructor"),h=c&&e;c&&"method"!==o&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=c?"constructor":o,this.parseClassMethod(i,s,r,h)}else this.parseClassField(i);return i},q.isClassElementNameStart=function(){return this.type===b.name||this.type===b.privateId||this.type===b.num||this.type===b.string||this.type===b.bracketL||this.type.keyword},q.parseClassElementName=function(e){this.type===b.privateId?("constructor"===this.value&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},q.parseClassMethod=function(e,t,i,n){var s=e.key;"constructor"===e.kind?(t&&this.raise(s.start,"Constructor can't be a generator"),i&&this.raise(s.start,"Constructor can't be an async method")):e.static&&ie(e,"prototype")&&this.raise(s.start,"Classes may not have a static property named prototype");var r=e.value=this.parseMethod(t,i,n);return"get"===e.kind&&0!==r.params.length&&this.raiseRecoverable(r.start,"getter should have no params"),"set"===e.kind&&1!==r.params.length&&this.raiseRecoverable(r.start,"setter should have exactly one param"),"set"===e.kind&&"RestElement"===r.params[0].type&&this.raiseRecoverable(r.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")},q.parseClassField=function(e){return ie(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&ie(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(b.eq)?(this.enterScope(576),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,"PropertyDefinition")},q.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(320);this.type!==b.braceR;){var i=this.parseStatement(null);e.body.push(i)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")},q.parseClassId=function(e,t){this.type===b.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,2,!1)):(!0===t&&this.unexpected(),e.id=null)},q.parseClassSuper=function(e){e.superClass=this.eat(b._extends)?this.parseExprSubscripts(null,!1):null},q.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},q.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,i=e.used;if(this.options.checkPrivateFields)for(var n=this.privateNameStack.length,s=0===n?null:this.privateNameStack[n-1],r=0;r<i.length;++r){var o=i[r];I(t,o.name)||(s?s.used.push(o):this.raiseRecoverable(o.start,"Private field '#"+o.name+"' must be declared in an enclosing class"))}},q.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==b.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")},q.parseExport=function(e,t){if(this.next(),this.eat(b.star))return this.parseExportAllDeclaration(e,t);if(this.eat(b._default))return this.checkExport(t,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),"VariableDeclaration"===e.declaration.type?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==b.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var i=0,n=e.specifiers;i<n.length;i+=1){var s=n[i];this.checkUnreserved(s.local),this.checkLocalExport(s.local),"Literal"===s.local.type&&this.raise(s.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[])}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")},q.parseExportDeclaration=function(e){return this.parseStatement(null)},q.parseExportDefaultDeclaration=function(){var e;if(this.type===b._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,4|J,!1,e)}if(this.type===b._class){var i=this.startNode();return this.parseClass(i,"nullableID")}var n=this.parseMaybeAssign();return this.semicolon(),n},q.checkExport=function(e,t,i){e&&("string"!=typeof t&&(t="Identifier"===t.type?t.name:t.value),I(e,t)&&this.raiseRecoverable(i,"Duplicate export '"+t+"'"),e[t]=!0)},q.checkPatternExport=function(e,t){var i=t.type;if("Identifier"===i)this.checkExport(e,t,t.start);else if("ObjectPattern"===i)for(var n=0,s=t.properties;n<s.length;n+=1){var r=s[n];this.checkPatternExport(e,r)}else if("ArrayPattern"===i)for(var o=0,a=t.elements;o<a.length;o+=1){var l=a[o];l&&this.checkPatternExport(e,l)}else"Property"===i?this.checkPatternExport(e,t.value):"AssignmentPattern"===i?this.checkPatternExport(e,t.left):"RestElement"===i&&this.checkPatternExport(e,t.argument)},q.checkVariableExport=function(e,t){if(e)for(var i=0,n=t;i<n.length;i+=1){var s=n[i];this.checkPatternExport(e,s.id)}},q.shouldParseExportStatement=function(){return"var"===this.type.keyword||"const"===this.type.keyword||"class"===this.type.keyword||"function"===this.type.keyword||this.isLet()||this.isAsyncFunction()},q.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual("as")?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,"ExportSpecifier")},q.parseExportSpecifiers=function(e){var t=[],i=!0;for(this.expect(b.braceL);!this.eat(b.braceR);){if(i)i=!1;else if(this.expect(b.comma),this.afterTrailingComma(b.braceR))break;t.push(this.parseExportSpecifier(e))}return t},q.parseImport=function(e){return this.next(),this.type===b.string?(e.specifiers=Q,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===b.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ImportDeclaration")},q.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual("as")?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,2),this.finishNode(e,"ImportSpecifier")},q.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,2),this.finishNode(e,"ImportDefaultSpecifier")},q.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,2),this.finishNode(e,"ImportNamespaceSpecifier")},q.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===b.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(b.comma)))return e;if(this.type===b.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(b.braceL);!this.eat(b.braceR);){if(t)t=!1;else if(this.expect(b.comma),this.afterTrailingComma(b.braceR))break;e.push(this.parseImportSpecifier())}return e},q.parseWithClause=function(){var e=[];if(!this.eat(b._with))return e;this.expect(b.braceL);for(var t={},i=!0;!this.eat(b.braceR);){if(i)i=!1;else if(this.expect(b.comma),this.afterTrailingComma(b.braceR))break;var n=this.parseImportAttribute(),s="Identifier"===n.key.type?n.key.name:n.key.value;I(t,s)&&this.raiseRecoverable(n.key.start,"Duplicate attribute key '"+s+"'"),t[s]=!0,e.push(n)}return e},q.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===b.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved),this.expect(b.colon),this.type!==b.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,"ImportAttribute")},q.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===b.string){var e=this.parseLiteral(this.value);return L.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)},q.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},q.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&"ExpressionStatement"===e.type&&"Literal"===e.expression.type&&"string"==typeof e.expression.value&&('"'===this.input[e.start]||"'"===this.input[e.start])};var ne=W.prototype;ne.toAssignable=function(e,t,i){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&"await"===e.name&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",i&&this.checkPatternErrors(i,!0);for(var n=0,s=e.properties;n<s.length;n+=1){var r=s[n];this.toAssignable(r,t),"RestElement"!==r.type||"ArrayPattern"!==r.argument.type&&"ObjectPattern"!==r.argument.type||this.raise(r.argument.start,"Unexpected token")}break;case"Property":"init"!==e.kind&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,t);break;case"ArrayExpression":e.type="ArrayPattern",i&&this.checkPatternErrors(i,!0),this.toAssignableList(e.elements,t);break;case"SpreadElement":e.type="RestElement",this.toAssignable(e.argument,t),"AssignmentPattern"===e.argument.type&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":"="!==e.operator&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,i);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}else i&&this.checkPatternErrors(i,!0);return e},ne.toAssignableList=function(e,t){for(var i=e.length,n=0;n<i;n++){var s=e[n];s&&this.toAssignable(s,t)}if(i){var r=e[i-1];6===this.options.ecmaVersion&&t&&r&&"RestElement"===r.type&&"Identifier"!==r.argument.type&&this.unexpected(r.argument.start)}return e},ne.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")},ne.parseRestBinding=function(){var e=this.startNode();return this.next(),6===this.options.ecmaVersion&&this.type!==b.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")},ne.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case b.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(b.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case b.braceL:return this.parseObj(!0)}return this.parseIdent()},ne.parseBindingList=function(e,t,i,n){for(var s=[],r=!0;!this.eat(e);)if(r?r=!1:this.expect(b.comma),t&&this.type===b.comma)s.push(null);else{if(i&&this.afterTrailingComma(e))break;if(this.type===b.ellipsis){var o=this.parseRestBinding();this.parseBindingListItem(o),s.push(o),this.type===b.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}s.push(this.parseAssignableListItem(n))}return s},ne.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t},ne.parseBindingListItem=function(e){return e},ne.parseMaybeDefault=function(e,t,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(b.eq))return i;var n=this.startNodeAt(e,t);return n.left=i,n.right=this.parseMaybeAssign(),this.finishNode(n,"AssignmentPattern")},ne.checkLValSimple=function(e,t,i){void 0===t&&(t=0);var n=0!==t;switch(e.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(n?"Binding ":"Assigning to ")+e.name+" in strict mode"),n&&(2===t&&"let"===e.name&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),i&&(I(i,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),i[e.name]=!0),5!==t&&this.declareName(e.name,t,e.start));break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":n&&this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":return n&&this.raiseRecoverable(e.start,"Binding parenthesized expression"),this.checkLValSimple(e.expression,t,i);default:this.raise(e.start,(n?"Binding":"Assigning to")+" rvalue")}},ne.checkLValPattern=function(e,t,i){switch(void 0===t&&(t=0),e.type){case"ObjectPattern":for(var n=0,s=e.properties;n<s.length;n+=1){var r=s[n];this.checkLValInnerPattern(r,t,i)}break;case"ArrayPattern":for(var o=0,a=e.elements;o<a.length;o+=1){var l=a[o];l&&this.checkLValInnerPattern(l,t,i)}break;default:this.checkLValSimple(e,t,i)}},ne.checkLValInnerPattern=function(e,t,i){switch(void 0===t&&(t=0),e.type){case"Property":this.checkLValInnerPattern(e.value,t,i);break;case"AssignmentPattern":this.checkLValPattern(e.left,t,i);break;case"RestElement":this.checkLValPattern(e.argument,t,i);break;default:this.checkLValPattern(e,t,i)}};var se=function(e,t,i,n,s){this.token=e,this.isExpr=!!t,this.preserveSpace=!!i,this.override=n,this.generator=!!s},re={b_stat:new se("{",!1),b_expr:new se("{",!0),b_tmpl:new se("${",!1),p_stat:new se("(",!1),p_expr:new se("(",!0),q_tmpl:new se("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new se("function",!1),f_expr:new se("function",!0),f_expr_gen:new se("function",!0,!1,null,!0),f_gen:new se("function",!1,!1,null,!0)},oe=W.prototype;oe.initialContext=function(){return[re.b_stat]},oe.curContext=function(){return this.context[this.context.length-1]},oe.braceIsBlock=function(e){var t=this.curContext();return t===re.f_expr||t===re.f_stat||(e!==b.colon||t!==re.b_stat&&t!==re.b_expr?e===b._return||e===b.name&&this.exprAllowed?C.test(this.input.slice(this.lastTokEnd,this.start)):e===b._else||e===b.semi||e===b.eof||e===b.parenR||e===b.arrow||(e===b.braceL?t===re.b_stat:e!==b._var&&e!==b._const&&e!==b.name&&!this.exprAllowed):!t.isExpr)},oe.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if("function"===t.token)return t.generator}return!1},oe.updateContext=function(e){var t,i=this.type;i.keyword&&e===b.dot?this.exprAllowed=!1:(t=i.updateContext)?t.call(this,e):this.exprAllowed=i.beforeExpr},oe.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)},b.parenR.updateContext=b.braceR.updateContext=function(){if(1!==this.context.length){var e=this.context.pop();e===re.b_stat&&"function"===this.curContext().token&&(e=this.context.pop()),this.exprAllowed=!e.isExpr}else this.exprAllowed=!0},b.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?re.b_stat:re.b_expr),this.exprAllowed=!0},b.dollarBraceL.updateContext=function(){this.context.push(re.b_tmpl),this.exprAllowed=!0},b.parenL.updateContext=function(e){var t=e===b._if||e===b._for||e===b._with||e===b._while;this.context.push(t?re.p_stat:re.p_expr),this.exprAllowed=!0},b.incDec.updateContext=function(){},b._function.updateContext=b._class.updateContext=function(e){!e.beforeExpr||e===b._else||e===b.semi&&this.curContext()!==re.p_stat||e===b._return&&C.test(this.input.slice(this.lastTokEnd,this.start))||(e===b.colon||e===b.braceL)&&this.curContext()===re.b_stat?this.context.push(re.f_stat):this.context.push(re.f_expr),this.exprAllowed=!1},b.colon.updateContext=function(){"function"===this.curContext().token&&this.context.pop(),this.exprAllowed=!0},b.backQuote.updateContext=function(){this.curContext()===re.q_tmpl?this.context.pop():this.context.push(re.q_tmpl),this.exprAllowed=!1},b.star.updateContext=function(e){if(e===b._function){var t=this.context.length-1;this.context[t]===re.f_expr?this.context[t]=re.f_expr_gen:this.context[t]=re.f_gen}this.exprAllowed=!0},b.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==b.dot&&("of"===this.value&&!this.exprAllowed||"yield"===this.value&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var ae=W.prototype;function le(e){return"Identifier"===e.type||"ParenthesizedExpression"===e.type&&le(e.expression)}function ce(e){return"MemberExpression"===e.type&&"PrivateIdentifier"===e.property.type||"ChainExpression"===e.type&&ce(e.expression)||"ParenthesizedExpression"===e.type&&ce(e.expression)}ae.checkPropClash=function(e,t,i){if(!(this.options.ecmaVersion>=9&&"SpreadElement"===e.type||this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var n,s=e.key;switch(s.type){case"Identifier":n=s.name;break;case"Literal":n=String(s.value);break;default:return}var r=e.kind;if(this.options.ecmaVersion>=6)"__proto__"===n&&"init"===r&&(t.proto&&(i?i.doubleProto<0&&(i.doubleProto=s.start):this.raiseRecoverable(s.start,"Redefinition of __proto__ property")),t.proto=!0);else{var o=t[n="$"+n];o?("init"===r?this.strict&&o.init||o.get||o.set:o.init||o[r])&&this.raiseRecoverable(s.start,"Redefinition of property"):o=t[n]={init:!1,get:!1,set:!1},o[r]=!0}}},ae.parseExpression=function(e,t){var i=this.start,n=this.startLoc,s=this.parseMaybeAssign(e,t);if(this.type===b.comma){var r=this.startNodeAt(i,n);for(r.expressions=[s];this.eat(b.comma);)r.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(r,"SequenceExpression")}return s},ae.parseMaybeAssign=function(e,t,i){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var n=!1,s=-1,r=-1,o=-1;t?(s=t.parenthesizedAssign,r=t.trailingComma,o=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new Y,n=!0);var a=this.start,l=this.startLoc;this.type!==b.parenL&&this.type!==b.name||(this.potentialArrowAt=this.start,this.potentialArrowInForAwait="await"===e);var c=this.parseMaybeConditional(e,t);if(i&&(c=i.call(this,c,a,l)),this.type.isAssign){var h=this.startNodeAt(a,l);return h.operator=this.value,this.type===b.eq&&(c=this.toAssignable(c,!1,t)),n||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=c.start&&(t.shorthandAssign=-1),this.type===b.eq?this.checkLValPattern(c):this.checkLValSimple(c),h.left=c,this.next(),h.right=this.parseMaybeAssign(e),o>-1&&(t.doubleProto=o),this.finishNode(h,"AssignmentExpression")}return n&&this.checkExpressionErrors(t,!0),s>-1&&(t.parenthesizedAssign=s),r>-1&&(t.trailingComma=r),c},ae.parseMaybeConditional=function(e,t){var i=this.start,n=this.startLoc,s=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return s;if(this.eat(b.question)){var r=this.startNodeAt(i,n);return r.test=s,r.consequent=this.parseMaybeAssign(),this.expect(b.colon),r.alternate=this.parseMaybeAssign(e),this.finishNode(r,"ConditionalExpression")}return s},ae.parseExprOps=function(e,t){var i=this.start,n=this.startLoc,s=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||s.start===i&&"ArrowFunctionExpression"===s.type?s:this.parseExprOp(s,i,n,-1,e)},ae.parseExprOp=function(e,t,i,n,s){var r=this.type.binop;if(null!=r&&(!s||this.type!==b._in)&&r>n){var o=this.type===b.logicalOR||this.type===b.logicalAND,a=this.type===b.coalesce;a&&(r=b.logicalAND.binop);var l=this.value;this.next();var c=this.start,h=this.startLoc,u=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,s),c,h,r,s),d=this.buildBinary(t,i,e,u,l,o||a);return(o&&this.type===b.coalesce||a&&(this.type===b.logicalOR||this.type===b.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(d,t,i,n,s)}return e},ae.buildBinary=function(e,t,i,n,s,r){"PrivateIdentifier"===n.type&&this.raise(n.start,"Private identifier can only be left side of binary expression");var o=this.startNodeAt(e,t);return o.left=i,o.operator=s,o.right=n,this.finishNode(o,r?"LogicalExpression":"BinaryExpression")},ae.parseMaybeUnary=function(e,t,i,n){var s,r=this.start,o=this.startLoc;if(this.isContextual("await")&&this.canAwait)s=this.parseAwait(n),t=!0;else if(this.type.prefix){var a=this.startNode(),l=this.type===b.incDec;a.operator=this.value,a.prefix=!0,this.next(),a.argument=this.parseMaybeUnary(null,!0,l,n),this.checkExpressionErrors(e,!0),l?this.checkLValSimple(a.argument):this.strict&&"delete"===a.operator&&le(a.argument)?this.raiseRecoverable(a.start,"Deleting local variable in strict mode"):"delete"===a.operator&&ce(a.argument)?this.raiseRecoverable(a.start,"Private fields can not be deleted"):t=!0,s=this.finishNode(a,l?"UpdateExpression":"UnaryExpression")}else if(t||this.type!==b.privateId){if(s=this.parseExprSubscripts(e,n),this.checkExpressionErrors(e))return s;for(;this.type.postfix&&!this.canInsertSemicolon();){var c=this.startNodeAt(r,o);c.operator=this.value,c.prefix=!1,c.argument=s,this.checkLValSimple(s),this.next(),s=this.finishNode(c,"UpdateExpression")}}else(n||0===this.privateNameStack.length)&&this.options.checkPrivateFields&&this.unexpected(),s=this.parsePrivateIdent(),this.type!==b._in&&this.unexpected();return i||!this.eat(b.starstar)?s:t?void this.unexpected(this.lastTokStart):this.buildBinary(r,o,s,this.parseMaybeUnary(null,!1,!1,n),"**",!1)},ae.parseExprSubscripts=function(e,t){var i=this.start,n=this.startLoc,s=this.parseExprAtom(e,t);if("ArrowFunctionExpression"===s.type&&")"!==this.input.slice(this.lastTokStart,this.lastTokEnd))return s;var r=this.parseSubscripts(s,i,n,!1,t);return e&&"MemberExpression"===r.type&&(e.parenthesizedAssign>=r.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=r.start&&(e.parenthesizedBind=-1),e.trailingComma>=r.start&&(e.trailingComma=-1)),r},ae.parseSubscripts=function(e,t,i,n,s){for(var r=this.options.ecmaVersion>=8&&"Identifier"===e.type&&"async"===e.name&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,o=!1;;){var a=this.parseSubscript(e,t,i,n,r,o,s);if(a.optional&&(o=!0),a===e||"ArrowFunctionExpression"===a.type){if(o){var l=this.startNodeAt(t,i);l.expression=a,a=this.finishNode(l,"ChainExpression")}return a}e=a}},ae.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(b.arrow)},ae.parseSubscriptAsyncArrow=function(e,t,i,n){return this.parseArrowExpression(this.startNodeAt(e,t),i,!0,n)},ae.parseSubscript=function(e,t,i,n,s,r,o){var a=this.options.ecmaVersion>=11,l=a&&this.eat(b.questionDot);n&&l&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var c=this.eat(b.bracketL);if(c||l&&this.type!==b.parenL&&this.type!==b.backQuote||this.eat(b.dot)){var h=this.startNodeAt(t,i);h.object=e,c?(h.property=this.parseExpression(),this.expect(b.bracketR)):this.type===b.privateId&&"Super"!==e.type?h.property=this.parsePrivateIdent():h.property=this.parseIdent("never"!==this.options.allowReserved),h.computed=!!c,a&&(h.optional=l),e=this.finishNode(h,"MemberExpression")}else if(!n&&this.eat(b.parenL)){var u=new Y,d=this.yieldPos,p=this.awaitPos,g=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var f=this.parseExprList(b.parenR,this.options.ecmaVersion>=8,!1,u);if(s&&!l&&this.shouldParseAsyncArrow())return this.checkPatternErrors(u,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=d,this.awaitPos=p,this.awaitIdentPos=g,this.parseSubscriptAsyncArrow(t,i,f,o);this.checkExpressionErrors(u,!0),this.yieldPos=d||this.yieldPos,this.awaitPos=p||this.awaitPos,this.awaitIdentPos=g||this.awaitIdentPos;var m=this.startNodeAt(t,i);m.callee=e,m.arguments=f,a&&(m.optional=l),e=this.finishNode(m,"CallExpression")}else if(this.type===b.backQuote){(l||r)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var y=this.startNodeAt(t,i);y.tag=e,y.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(y,"TaggedTemplateExpression")}return e},ae.parseExprAtom=function(e,t,i){this.type===b.slash&&this.readRegexp();var n,s=this.potentialArrowAt===this.start;switch(this.type){case b._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),n=this.startNode(),this.next(),this.type!==b.parenL||this.allowDirectSuper||this.raise(n.start,"super() call outside constructor of a subclass"),this.type!==b.dot&&this.type!==b.bracketL&&this.type!==b.parenL&&this.unexpected(),this.finishNode(n,"Super");case b._this:return n=this.startNode(),this.next(),this.finishNode(n,"ThisExpression");case b.name:var r=this.start,o=this.startLoc,a=this.containsEsc,l=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!a&&"async"===l.name&&!this.canInsertSemicolon()&&this.eat(b._function))return this.overrideContext(re.f_expr),this.parseFunction(this.startNodeAt(r,o),0,!1,!0,t);if(s&&!this.canInsertSemicolon()){if(this.eat(b.arrow))return this.parseArrowExpression(this.startNodeAt(r,o),[l],!1,t);if(this.options.ecmaVersion>=8&&"async"===l.name&&this.type===b.name&&!a&&(!this.potentialArrowInForAwait||"of"!==this.value||this.containsEsc))return l=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(b.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(r,o),[l],!0,t)}return l;case b.regexp:var c=this.value;return(n=this.parseLiteral(c.value)).regex={pattern:c.pattern,flags:c.flags},n;case b.num:case b.string:return this.parseLiteral(this.value);case b._null:case b._true:case b._false:return(n=this.startNode()).value=this.type===b._null?null:this.type===b._true,n.raw=this.type.keyword,this.next(),this.finishNode(n,"Literal");case b.parenL:var h=this.start,u=this.parseParenAndDistinguishExpression(s,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(u)&&(e.parenthesizedAssign=h),e.parenthesizedBind<0&&(e.parenthesizedBind=h)),u;case b.bracketL:return n=this.startNode(),this.next(),n.elements=this.parseExprList(b.bracketR,!0,!0,e),this.finishNode(n,"ArrayExpression");case b.braceL:return this.overrideContext(re.b_expr),this.parseObj(!1,e);case b._function:return n=this.startNode(),this.next(),this.parseFunction(n,0);case b._class:return this.parseClass(this.startNode(),!1);case b._new:return this.parseNew();case b.backQuote:return this.parseTemplate();case b._import:return this.options.ecmaVersion>=11?this.parseExprImport(i):this.unexpected();default:return this.parseExprAtomDefault()}},ae.parseExprAtomDefault=function(){this.unexpected()},ae.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===b.parenL&&!e)return this.parseDynamicImport(t);if(this.type===b.dot){var i=this.startNodeAt(t.start,t.loc&&t.loc.start);return i.name="import",t.meta=this.finishNode(i,"Identifier"),this.parseImportMeta(t)}this.unexpected()},ae.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(b.parenR)?e.options=null:(this.expect(b.comma),this.afterTrailingComma(b.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(b.parenR)||(this.expect(b.comma),this.afterTrailingComma(b.parenR)||this.unexpected())));else if(!this.eat(b.parenR)){var t=this.start;this.eat(b.comma)&&this.eat(b.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")},ae.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),"meta"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),"module"===this.options.sourceType||this.options.allowImportExportEverywhere||this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")},ae.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),110===t.raw.charCodeAt(t.raw.length-1)&&(t.bigint=null!=t.value?t.value.toString():t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")},ae.parseParenExpression=function(){this.expect(b.parenL);var e=this.parseExpression();return this.expect(b.parenR),e},ae.shouldParseArrow=function(e){return!this.canInsertSemicolon()},ae.parseParenAndDistinguishExpression=function(e,t){var i,n=this.start,s=this.startLoc,r=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o,a=this.start,l=this.startLoc,c=[],h=!0,u=!1,d=new Y,p=this.yieldPos,g=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==b.parenR;){if(h?h=!1:this.expect(b.comma),r&&this.afterTrailingComma(b.parenR,!0)){u=!0;break}if(this.type===b.ellipsis){o=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===b.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}c.push(this.parseMaybeAssign(!1,d,this.parseParenItem))}var f=this.lastTokEnd,m=this.lastTokEndLoc;if(this.expect(b.parenR),e&&this.shouldParseArrow(c)&&this.eat(b.arrow))return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=p,this.awaitPos=g,this.parseParenArrowList(n,s,c,t);c.length&&!u||this.unexpected(this.lastTokStart),o&&this.unexpected(o),this.checkExpressionErrors(d,!0),this.yieldPos=p||this.yieldPos,this.awaitPos=g||this.awaitPos,c.length>1?((i=this.startNodeAt(a,l)).expressions=c,this.finishNodeAt(i,"SequenceExpression",f,m)):i=c[0]}else i=this.parseParenExpression();if(this.options.preserveParens){var y=this.startNodeAt(n,s);return y.expression=i,this.finishNode(y,"ParenthesizedExpression")}return i},ae.parseParenItem=function(e){return e},ae.parseParenArrowList=function(e,t,i,n){return this.parseArrowExpression(this.startNodeAt(e,t),i,!1,n)};var he=[];ae.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===b.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();var i=this.containsEsc;return e.property=this.parseIdent(!0),"target"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),i&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var n=this.start,s=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),n,s,!0,!1),this.eat(b.parenL)?e.arguments=this.parseExprList(b.parenR,this.options.ecmaVersion>=8,!1):e.arguments=he,this.finishNode(e,"NewExpression")},ae.parseTemplateElement=function(e){var t=e.isTagged,i=this.startNode();return this.type===b.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),i.value={raw:this.value.replace(/\r\n?/g,"\n"),cooked:null}):i.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),i.tail=this.type===b.backQuote,this.finishNode(i,"TemplateElement")},ae.parseTemplate=function(e){void 0===e&&(e={});var t=e.isTagged;void 0===t&&(t=!1);var i=this.startNode();this.next(),i.expressions=[];var n=this.parseTemplateElement({isTagged:t});for(i.quasis=[n];!n.tail;)this.type===b.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(b.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(b.braceR),i.quasis.push(n=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(i,"TemplateLiteral")},ae.isAsyncProp=function(e){return!e.computed&&"Identifier"===e.key.type&&"async"===e.key.name&&(this.type===b.name||this.type===b.num||this.type===b.string||this.type===b.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===b.star)&&!C.test(this.input.slice(this.lastTokEnd,this.start))},ae.parseObj=function(e,t){var i=this.startNode(),n=!0,s={};for(i.properties=[],this.next();!this.eat(b.braceR);){if(n)n=!1;else if(this.expect(b.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(b.braceR))break;var r=this.parseProperty(e,t);e||this.checkPropClash(r,s,t),i.properties.push(r)}return this.finishNode(i,e?"ObjectPattern":"ObjectExpression")},ae.parseProperty=function(e,t){var i,n,s,r,o=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(b.ellipsis))return e?(o.argument=this.parseIdent(!1),this.type===b.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(o,"RestElement")):(o.argument=this.parseMaybeAssign(!1,t),this.type===b.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(o,"SpreadElement"));this.options.ecmaVersion>=6&&(o.method=!1,o.shorthand=!1,(e||t)&&(s=this.start,r=this.startLoc),e||(i=this.eat(b.star)));var a=this.containsEsc;return this.parsePropertyName(o),!e&&!a&&this.options.ecmaVersion>=8&&!i&&this.isAsyncProp(o)?(n=!0,i=this.options.ecmaVersion>=9&&this.eat(b.star),this.parsePropertyName(o)):n=!1,this.parsePropertyValue(o,e,i,n,s,r,t,a),this.finishNode(o,"Property")},ae.parseGetterSetter=function(e){var t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(!1),e.kind=t;var i="get"===e.kind?0:1;if(e.value.params.length!==i){var n=e.value.start;"get"===e.kind?this.raiseRecoverable(n,"getter should have no params"):this.raiseRecoverable(n,"setter should have exactly one param")}else"set"===e.kind&&"RestElement"===e.value.params[0].type&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")},ae.parsePropertyValue=function(e,t,i,n,s,r,o,a){(i||n)&&this.type===b.colon&&this.unexpected(),this.eat(b.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind="init"):this.options.ecmaVersion>=6&&this.type===b.parenL?(t&&this.unexpected(),e.method=!0,e.value=this.parseMethod(i,n),e.kind="init"):t||a||!(this.options.ecmaVersion>=5)||e.computed||"Identifier"!==e.key.type||"get"!==e.key.name&&"set"!==e.key.name||this.type===b.comma||this.type===b.braceR||this.type===b.eq?this.options.ecmaVersion>=6&&!e.computed&&"Identifier"===e.key.type?((i||n)&&this.unexpected(),this.checkUnreserved(e.key),"await"!==e.key.name||this.awaitIdentPos||(this.awaitIdentPos=s),t?e.value=this.parseMaybeDefault(s,r,this.copyNode(e.key)):this.type===b.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(s,r,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.kind="init",e.shorthand=!0):this.unexpected():((i||n)&&this.unexpected(),this.parseGetterSetter(e))},ae.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(b.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(b.bracketR),e.key;e.computed=!1}return e.key=this.type===b.num||this.type===b.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},ae.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},ae.parseMethod=function(e,t,i){var n=this.startNode(),s=this.yieldPos,r=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(n),this.options.ecmaVersion>=6&&(n.generator=e),this.options.ecmaVersion>=8&&(n.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|z(t,n.generator)|(i?128:0)),this.expect(b.parenL),n.params=this.parseBindingList(b.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(n,!1,!0,!1),this.yieldPos=s,this.awaitPos=r,this.awaitIdentPos=o,this.finishNode(n,"FunctionExpression")},ae.parseArrowExpression=function(e,t,i,n){var s=this.yieldPos,r=this.awaitPos,o=this.awaitIdentPos;return this.enterScope(16|z(i,!1)),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,n),this.yieldPos=s,this.awaitPos=r,this.awaitIdentPos=o,this.finishNode(e,"ArrowFunctionExpression")},ae.parseFunctionBody=function(e,t,i,n){var s=t&&this.type!==b.braceL,r=this.strict,o=!1;if(s)e.body=this.parseMaybeAssign(n),e.expression=!0,this.checkParams(e,!1);else{var a=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);r&&!a||(o=this.strictDirective(this.end))&&a&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list");var l=this.labels;this.labels=[],o&&(this.strict=!0),this.checkParams(e,!r&&!o&&!t&&!i&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,5),e.body=this.parseBlock(!1,void 0,o&&!r),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=l}this.exitScope()},ae.isSimpleParamList=function(e){for(var t=0,i=e;t<i.length;t+=1)if("Identifier"!==i[t].type)return!1;return!0},ae.checkParams=function(e,t){for(var i=Object.create(null),n=0,s=e.params;n<s.length;n+=1){var r=s[n];this.checkLValInnerPattern(r,1,t?null:i)}},ae.parseExprList=function(e,t,i,n){for(var s=[],r=!0;!this.eat(e);){if(r)r=!1;else if(this.expect(b.comma),t&&this.afterTrailingComma(e))break;var o=void 0;i&&this.type===b.comma?o=null:this.type===b.ellipsis?(o=this.parseSpread(n),n&&this.type===b.comma&&n.trailingComma<0&&(n.trailingComma=this.start)):o=this.parseMaybeAssign(!1,n),s.push(o)}return s},ae.checkUnreserved=function(e){var t=e.start,i=e.end,n=e.name;this.inGenerator&&"yield"===n&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&"await"===n&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),this.currentThisScope().flags&U||"arguments"!==n||this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer"),!this.inClassStaticBlock||"arguments"!==n&&"await"!==n||this.raise(t,"Cannot use "+n+" in class static initialization block"),this.keywords.test(n)&&this.raise(t,"Unexpected keyword '"+n+"'"),this.options.ecmaVersion<6&&-1!==this.input.slice(t,i).indexOf("\\")||(this.strict?this.reservedWordsStrict:this.reservedWords).test(n)&&(this.inAsync||"await"!==n||this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,"The keyword '"+n+"' is reserved"))},ae.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,"Identifier"),e||(this.checkUnreserved(t),"await"!==t.name||this.awaitIdentPos||(this.awaitIdentPos=t.start)),t},ae.parseIdentNode=function(){var e=this.startNode();return this.type===b.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,"class"!==e.name&&"function"!==e.name||this.lastTokEnd===this.lastTokStart+1&&46===this.input.charCodeAt(this.lastTokStart)||this.context.pop(),this.type=b.name):this.unexpected(),e},ae.parsePrivateIdent=function(){var e=this.startNode();return this.type===b.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,"PrivateIdentifier"),this.options.checkPrivateFields&&(0===this.privateNameStack.length?this.raise(e.start,"Private field '#"+e.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e},ae.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);var t=this.startNode();return this.next(),this.type===b.semi||this.canInsertSemicolon()||this.type!==b.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(b.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")},ae.parseAwait=function(e){this.awaitPos||(this.awaitPos=this.start);var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,"AwaitExpression")};var ue=W.prototype;ue.raise=function(e,t){var i=F(this.input,e);t+=" ("+i.line+":"+i.column+")",this.sourceFile&&(t+=" in "+this.sourceFile);var n=new SyntaxError(t);throw n.pos=e,n.loc=i,n.raisedAt=this.pos,n},ue.raiseRecoverable=ue.raise,ue.curPosition=function(){if(this.options.locations)return new N(this.curLine,this.pos-this.lineStart)};var de=W.prototype,pe=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};de.enterScope=function(e){this.scopeStack.push(new pe(e))},de.exitScope=function(){this.scopeStack.pop()},de.treatFunctionsAsVarInScope=function(e){return 2&e.flags||!this.inModule&&1&e.flags},de.declareName=function(e,t,i){var n=!1;if(2===t){var s=this.currentScope();n=s.lexical.indexOf(e)>-1||s.functions.indexOf(e)>-1||s.var.indexOf(e)>-1,s.lexical.push(e),this.inModule&&1&s.flags&&delete this.undefinedExports[e]}else if(4===t)this.currentScope().lexical.push(e);else if(3===t){var r=this.currentScope();n=this.treatFunctionsAsVar?r.lexical.indexOf(e)>-1:r.lexical.indexOf(e)>-1||r.var.indexOf(e)>-1,r.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var a=this.scopeStack[o];if(a.lexical.indexOf(e)>-1&&!(32&a.flags&&a.lexical[0]===e)||!this.treatFunctionsAsVarInScope(a)&&a.functions.indexOf(e)>-1){n=!0;break}if(a.var.push(e),this.inModule&&1&a.flags&&delete this.undefinedExports[e],a.flags&U)break}n&&this.raiseRecoverable(i,"Identifier '"+e+"' has already been declared")},de.checkLocalExport=function(e){-1===this.scopeStack[0].lexical.indexOf(e.name)&&-1===this.scopeStack[0].var.indexOf(e.name)&&(this.undefinedExports[e.name]=e)},de.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},de.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(771&t.flags)return t}},de.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(771&t.flags&&!(16&t.flags))return t}};var ge=function(e,t,i){this.type="",this.start=t,this.end=0,e.options.locations&&(this.loc=new O(e,i)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},fe=W.prototype;function me(e,t,i,n){return e.type=t,e.end=i,this.options.locations&&(e.loc.end=n),this.options.ranges&&(e.range[1]=i),e}fe.startNode=function(){return new ge(this,this.start,this.startLoc)},fe.startNodeAt=function(e,t){return new ge(this,e,t)},fe.finishNode=function(e,t){return me.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},fe.finishNodeAt=function(e,t,i,n){return me.call(this,e,t,i,n)},fe.copyNode=function(e){var t=new ge(this,e.start,this.startLoc);for(var i in e)t[i]=e[i];return t};var ye="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",ve=ye+" Extended_Pictographic",be=ve+" EBase EComp EMod EPres ExtPict",Ce={9:ye,10:ve,11:ve,12:be,13:be,14:be},we={9:"",10:"",11:"",12:"",13:"",14:"Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji"},Se="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",xe="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Ee=xe+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Ae=Ee+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Me=Ae+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Te=Me+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",De={9:xe,10:Ee,11:Ae,12:Me,13:Te,14:Te+" Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz"},Ie={};function Re(e){var t=Ie[e]={binary:P(Ce[e]+" "+Se),binaryOfStrings:P(we[e]),nonBinary:{General_Category:P(Se),Script:P(De[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var ke=0,Pe=[9,10,11,12,13,14];ke<Pe.length;ke+=1)Re(Pe[ke]);var _e=W.prototype,Le=function(e,t){this.parent=e,this.base=t||this};Le.prototype.separatedFrom=function(e){for(var t=this;t;t=t.parent)for(var i=e;i;i=i.parent)if(t.base===i.base&&t!==i)return!0;return!1},Le.prototype.sibling=function(){return new Le(this.parent,this.base)};var Ne=function(e){this.parser=e,this.validFlags="gim"+(e.options.ecmaVersion>=6?"uy":"")+(e.options.ecmaVersion>=9?"s":"")+(e.options.ecmaVersion>=13?"d":"")+(e.options.ecmaVersion>=15?"v":""),this.unicodeProperties=Ie[e.options.ecmaVersion>=14?14:e.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};function Oe(e){return 105===e||109===e||115===e}function Fe(e){return 36===e||e>=40&&e<=43||46===e||63===e||e>=91&&e<=94||e>=123&&e<=125}function Ge(e){return e>=65&&e<=90||e>=97&&e<=122}Ne.prototype.reset=function(e,t,i){var n=-1!==i.indexOf("v"),s=-1!==i.indexOf("u");this.start=0|e,this.source=t+"",this.flags=i,n&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=s&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=s&&this.parser.options.ecmaVersion>=9)},Ne.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},Ne.prototype.at=function(e,t){void 0===t&&(t=!1);var i=this.source,n=i.length;if(e>=n)return-1;var s=i.charCodeAt(e);if(!t&&!this.switchU||s<=55295||s>=57344||e+1>=n)return s;var r=i.charCodeAt(e+1);return r>=56320&&r<=57343?(s<<10)+r-56613888:s},Ne.prototype.nextIndex=function(e,t){void 0===t&&(t=!1);var i=this.source,n=i.length;if(e>=n)return n;var s,r=i.charCodeAt(e);return!t&&!this.switchU||r<=55295||r>=57344||e+1>=n||(s=i.charCodeAt(e+1))<56320||s>57343?e+1:e+2},Ne.prototype.current=function(e){return void 0===e&&(e=!1),this.at(this.pos,e)},Ne.prototype.lookahead=function(e){return void 0===e&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},Ne.prototype.advance=function(e){void 0===e&&(e=!1),this.pos=this.nextIndex(this.pos,e)},Ne.prototype.eat=function(e,t){return void 0===t&&(t=!1),this.current(t)===e&&(this.advance(t),!0)},Ne.prototype.eatChars=function(e,t){void 0===t&&(t=!1);for(var i=this.pos,n=0,s=e;n<s.length;n+=1){var r=s[n],o=this.at(i,t);if(-1===o||o!==r)return!1;i=this.nextIndex(i,t)}return this.pos=i,!0},_e.validateRegExpFlags=function(e){for(var t=e.validFlags,i=e.flags,n=!1,s=!1,r=0;r<i.length;r++){var o=i.charAt(r);-1===t.indexOf(o)&&this.raise(e.start,"Invalid regular expression flag"),i.indexOf(o,r+1)>-1&&this.raise(e.start,"Duplicate regular expression flag"),"u"===o&&(n=!0),"v"===o&&(s=!0)}this.options.ecmaVersion>=15&&n&&s&&this.raise(e.start,"Invalid regular expression flag")},_e.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&function(e){for(var t in e)return!0;return!1}(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))},_e.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,i=e.backReferenceNames;t<i.length;t+=1){var n=i[t];e.groupNames[n]||e.raise("Invalid named capture referenced")}},_e.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new Le(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets")},_e.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},_e.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise("Invalid quantifier"),!0):!!(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))&&(this.regexp_eatQuantifier(e),!0)},_e.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var i=!1;if(this.options.ecmaVersion>=9&&(i=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!i,!0}return e.pos=t,!1},_e.regexp_eatQuantifier=function(e,t){return void 0===t&&(t=!1),!!this.regexp_eatQuantifierPrefix(e,t)&&(e.eat(63),!0)},_e.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},_e.regexp_eatBracedQuantifier=function(e,t){var i=e.pos;if(e.eat(123)){var n=0,s=-1;if(this.regexp_eatDecimalDigits(e)&&(n=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(s=e.lastIntValue),e.eat(125)))return-1!==s&&s<n&&!t&&e.raise("numbers out of order in {} quantifier"),!0;e.switchU&&!t&&e.raise("Incomplete quantifier"),e.pos=i}return!1},_e.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},_e.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},_e.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var i=this.regexp_eatModifiers(e),n=e.eat(45);if(i||n){for(var s=0;s<i.length;s++){var r=i.charAt(s);i.indexOf(r,s+1)>-1&&e.raise("Duplicate regular expression modifiers")}if(n){var o=this.regexp_eatModifiers(e);i||o||58!==e.current()||e.raise("Invalid regular expression modifiers");for(var a=0;a<o.length;a++){var l=o.charAt(a);(o.indexOf(l,a+1)>-1||i.indexOf(l)>-1)&&e.raise("Duplicate regular expression modifiers")}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise("Unterminated group")}}e.pos=t}return!1},_e.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):63===e.current()&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1},_e.regexp_eatModifiers=function(e){for(var t="",i=0;-1!==(i=e.current())&&Oe(i);)t+=_(i),e.advance();return t},_e.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},_e.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},_e.regexp_eatSyntaxCharacter=function(e){var t=e.current();return!!Fe(t)&&(e.lastIntValue=t,e.advance(),!0)},_e.regexp_eatPatternCharacters=function(e){for(var t=e.pos,i=0;-1!==(i=e.current())&&!Fe(i);)e.advance();return e.pos!==t},_e.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return!(-1===t||36===t||t>=40&&t<=43||46===t||63===t||91===t||94===t||124===t||(e.advance(),0))},_e.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise("Invalid group");var t=this.options.ecmaVersion>=16,i=e.groupNames[e.lastStringValue];if(i)if(t)for(var n=0,s=i;n<s.length;n+=1)s[n].separatedFrom(e.branchID)||e.raise("Duplicate capture group name");else e.raise("Duplicate capture group name");t?(i||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=!0}},_e.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1},_e.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=_(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=_(e.lastIntValue);return!0}return!1},_e.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,n=e.current(i);return e.advance(i),92===n&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(n=e.lastIntValue),function(e){return u(e,!0)||36===e||95===e}(n)?(e.lastIntValue=n,!0):(e.pos=t,!1)},_e.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,n=e.current(i);return e.advance(i),92===n&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(n=e.lastIntValue),function(e){return d(e,!0)||36===e||95===e||8204===e||8205===e}(n)?(e.lastIntValue=n,!0):(e.pos=t,!1)},_e.regexp_eatAtomEscape=function(e){return!!(this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e))||(e.switchU&&(99===e.current()&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)},_e.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var i=e.lastIntValue;if(e.switchU)return i>e.maxBackReference&&(e.maxBackReference=i),!0;if(i<=e.numCapturingParens)return!0;e.pos=t}return!1},_e.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1},_e.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},_e.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},_e.regexp_eatZero=function(e){return 48===e.current()&&!He(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},_e.regexp_eatControlEscape=function(e){var t=e.current();return 116===t?(e.lastIntValue=9,e.advance(),!0):110===t?(e.lastIntValue=10,e.advance(),!0):118===t?(e.lastIntValue=11,e.advance(),!0):102===t?(e.lastIntValue=12,e.advance(),!0):114===t&&(e.lastIntValue=13,e.advance(),!0)},_e.regexp_eatControlLetter=function(e){var t=e.current();return!!Ge(t)&&(e.lastIntValue=t%32,e.advance(),!0)},_e.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){void 0===t&&(t=!1);var i,n=e.pos,s=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var r=e.lastIntValue;if(s&&r>=55296&&r<=56319){var o=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var a=e.lastIntValue;if(a>=56320&&a<=57343)return e.lastIntValue=1024*(r-55296)+(a-56320)+65536,!0}e.pos=o,e.lastIntValue=r}return!0}if(s&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&((i=e.lastIntValue)>=0&&i<=1114111))return!0;s&&e.raise("Invalid unicode escape"),e.pos=n}return!1},_e.regexp_eatIdentityEscape=function(e){if(e.switchU)return!!this.regexp_eatSyntaxCharacter(e)||!!e.eat(47)&&(e.lastIntValue=47,!0);var t=e.current();return!(99===t||e.switchN&&107===t||(e.lastIntValue=t,e.advance(),0))},_e.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do{e.lastIntValue=10*e.lastIntValue+(t-48),e.advance()}while((t=e.current())>=48&&t<=57);return!0}return!1};function Be(e){return Ge(e)||95===e}function Ve(e){return Be(e)||He(e)}function He(e){return e>=48&&e<=57}function Ue(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function ze(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e-48}function We(e){return e>=48&&e<=55}_e.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(function(e){return 100===e||68===e||115===e||83===e||119===e||87===e}(t))return e.lastIntValue=-1,e.advance(),1;var i=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((i=80===t)||112===t)){var n;if(e.lastIntValue=-1,e.advance(),e.eat(123)&&(n=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return i&&2===n&&e.raise("Invalid property name"),n;e.raise("Invalid property name")}return 0},_e.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var i=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var n=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,i,n),1}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var s=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,s)}return 0},_e.regexp_validateUnicodePropertyNameAndValue=function(e,t,i){I(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(i)||e.raise("Invalid property value")},_e.regexp_validateUnicodePropertyNameOrValue=function(e,t){return e.unicodeProperties.binary.test(t)?1:e.switchV&&e.unicodeProperties.binaryOfStrings.test(t)?2:void e.raise("Invalid property name")},_e.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";Be(t=e.current());)e.lastStringValue+=_(t),e.advance();return""!==e.lastStringValue},_e.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";Ve(t=e.current());)e.lastStringValue+=_(t),e.advance();return""!==e.lastStringValue},_e.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},_e.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),i=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),t&&2===i&&e.raise("Negated character class may contain strings"),!0}return!1},_e.regexp_classContents=function(e){return 93===e.current()?1:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),1)},_e.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var i=e.lastIntValue;!e.switchU||-1!==t&&-1!==i||e.raise("Invalid character class"),-1!==t&&-1!==i&&t>i&&e.raise("Range out of order in character class")}}},_e.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var i=e.current();(99===i||We(i))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var n=e.current();return 93!==n&&(e.lastIntValue=n,e.advance(),!0)},_e.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},_e.regexp_classSetExpression=function(e){var t,i=1;if(this.regexp_eatClassSetRange(e));else if(t=this.regexp_eatClassSetOperand(e)){2===t&&(i=2);for(var n=e.pos;e.eatChars([38,38]);)38!==e.current()&&(t=this.regexp_eatClassSetOperand(e))?2!==t&&(i=1):e.raise("Invalid character in character class");if(n!==e.pos)return i;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(n!==e.pos)return i}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(!(t=this.regexp_eatClassSetOperand(e)))return i;2===t&&(i=2)}},_e.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var i=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var n=e.lastIntValue;return-1!==i&&-1!==n&&i>n&&e.raise("Range out of order in character class"),!0}e.pos=t}return!1},_e.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?1:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)},_e.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var i=e.eat(94),n=this.regexp_classContents(e);if(e.eat(93))return i&&2===n&&e.raise("Negated character class may contain strings"),n;e.pos=t}if(e.eat(92)){var s=this.regexp_eatCharacterClassEscape(e);if(s)return s;e.pos=t}return null},_e.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var i=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return i}else e.raise("Invalid escape");e.pos=t}return null},_e.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)2===this.regexp_classString(e)&&(t=2);return t},_e.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return 1===t?1:2},_e.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return!(!this.regexp_eatCharacterEscape(e)&&!this.regexp_eatClassSetReservedPunctuator(e)&&(e.eat(98)?(e.lastIntValue=8,0):(e.pos=t,1)));var i=e.current();return!(i<0||i===e.lookahead()&&function(e){return 33===e||e>=35&&e<=38||e>=42&&e<=44||46===e||e>=58&&e<=64||94===e||96===e||126===e}(i)||function(e){return 40===e||41===e||45===e||47===e||e>=91&&e<=93||e>=123&&e<=125}(i)||(e.advance(),e.lastIntValue=i,0))},_e.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return!!function(e){return 33===e||35===e||37===e||38===e||44===e||45===e||e>=58&&e<=62||64===e||96===e||126===e}(t)&&(e.lastIntValue=t,e.advance(),!0)},_e.regexp_eatClassControlLetter=function(e){var t=e.current();return!(!He(t)&&95!==t||(e.lastIntValue=t%32,e.advance(),0))},_e.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1},_e.regexp_eatDecimalDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;He(i=e.current());)e.lastIntValue=10*e.lastIntValue+(i-48),e.advance();return e.pos!==t},_e.regexp_eatHexDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;Ue(i=e.current());)e.lastIntValue=16*e.lastIntValue+ze(i),e.advance();return e.pos!==t},_e.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var i=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=64*t+8*i+e.lastIntValue:e.lastIntValue=8*t+i}else e.lastIntValue=t;return!0}return!1},_e.regexp_eatOctalDigit=function(e){var t=e.current();return We(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)},_e.regexp_eatFixedHexDigits=function(e,t){var i=e.pos;e.lastIntValue=0;for(var n=0;n<t;++n){var s=e.current();if(!Ue(s))return e.pos=i,!1;e.lastIntValue=16*e.lastIntValue+ze(s),e.advance()}return!0};var je=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new O(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},$e=W.prototype;function Ke(e){return"function"!=typeof BigInt?null:BigInt(e.replace(/_/g,""))}$e.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new je(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},$e.getToken=function(){return this.next(),new je(this)},"undefined"!=typeof Symbol&&($e[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===b.eof,value:t}}}}),$e.nextToken=function(){var e=this.curContext();return e&&e.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(b.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},$e.readToken=function(e){return u(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},$e.fullCharCodeAt=function(e){var t=this.input.charCodeAt(e);if(t<=55295||t>=56320)return t;var i=this.input.charCodeAt(e+1);return i<=56319||i>=57344?t:(t<<10)+i-56613888},$e.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)},$e.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(-1===i&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(var n=void 0,s=t;(n=x(this.input,s,this.pos))>-1;)++this.curLine,s=this.lineStart=n;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,i),t,this.pos,e,this.curPosition())},$e.skipLineComment=function(e){for(var t=this.pos,i=this.options.onComment&&this.curPosition(),n=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!S(n);)n=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,i,this.curPosition())},$e.skipSpace=function(){e:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:10===this.input.charCodeAt(this.pos+1)&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(!(e>8&&e<14||e>=5760&&E.test(String.fromCharCode(e))))break e;++this.pos}}},$e.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var i=this.type;this.type=e,this.value=t,this.updateContext(i)},$e.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===e&&46===t?(this.pos+=3,this.finishToken(b.ellipsis)):(++this.pos,this.finishToken(b.dot))},$e.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===e?this.finishOp(b.assign,2):this.finishOp(b.slash,1)},$e.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),i=1,n=42===e?b.star:b.modulo;return this.options.ecmaVersion>=7&&42===e&&42===t&&(++i,n=b.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp(b.assign,i+1):this.finishOp(n,i)},$e.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.options.ecmaVersion>=12&&61===this.input.charCodeAt(this.pos+2)?this.finishOp(b.assign,3):this.finishOp(124===e?b.logicalOR:b.logicalAND,2):61===t?this.finishOp(b.assign,2):this.finishOp(124===e?b.bitwiseOR:b.bitwiseAND,1)},$e.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(b.assign,2):this.finishOp(b.bitwiseXOR,1)},$e.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?45!==t||this.inModule||62!==this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!C.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(b.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===t?this.finishOp(b.assign,2):this.finishOp(b.plusMin,1)},$e.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),i=1;return t===e?(i=62===e&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+i)?this.finishOp(b.assign,i+1):this.finishOp(b.bitShift,i)):33!==t||60!==e||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===t&&(i=2),this.finishOp(b.relational,i)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},$e.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return 61===t?this.finishOp(b.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===e&&62===t&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(b.arrow)):this.finishOp(61===e?b.eq:b.prefix,1)},$e.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(46===t){var i=this.input.charCodeAt(this.pos+2);if(i<48||i>57)return this.finishOp(b.questionDot,2)}if(63===t)return e>=12&&61===this.input.charCodeAt(this.pos+2)?this.finishOp(b.assign,3):this.finishOp(b.coalesce,2)}return this.finishOp(b.question,1)},$e.readToken_numberSign=function(){var e=35;if(this.options.ecmaVersion>=13&&(++this.pos,u(e=this.fullCharCodeAtPos(),!0)||92===e))return this.finishToken(b.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+_(e)+"'")},$e.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(b.parenL);case 41:return++this.pos,this.finishToken(b.parenR);case 59:return++this.pos,this.finishToken(b.semi);case 44:return++this.pos,this.finishToken(b.comma);case 91:return++this.pos,this.finishToken(b.bracketL);case 93:return++this.pos,this.finishToken(b.bracketR);case 123:return++this.pos,this.finishToken(b.braceL);case 125:return++this.pos,this.finishToken(b.braceR);case 58:return++this.pos,this.finishToken(b.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(b.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(120===t||88===t)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===t||79===t)return this.readRadixNumber(8);if(98===t||66===t)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(b.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+_(e)+"'")},$e.finishOp=function(e,t){var i=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,i)},$e.readRegexp=function(){for(var e,t,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var n=this.input.charAt(this.pos);if(C.test(n)&&this.raise(i,"Unterminated regular expression"),e)e=!1;else{if("["===n)t=!0;else if("]"===n&&t)t=!1;else if("/"===n&&!t)break;e="\\"===n}++this.pos}var s=this.input.slice(i,this.pos);++this.pos;var r=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(r);var a=this.regexpState||(this.regexpState=new Ne(this));a.reset(i,s,o),this.validateRegExpFlags(a),this.validateRegExpPattern(a);var l=null;try{l=new RegExp(s,o)}catch(e){}return this.finishToken(b.regexp,{pattern:s,flags:o,value:l})},$e.readInt=function(e,t,i){for(var n=this.options.ecmaVersion>=12&&void 0===t,s=i&&48===this.input.charCodeAt(this.pos),r=this.pos,o=0,a=0,l=0,c=null==t?1/0:t;l<c;++l,++this.pos){var h=this.input.charCodeAt(this.pos),u=void 0;if(n&&95===h)s&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),95===a&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),0===l&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),a=h;else{if((u=h>=97?h-97+10:h>=65?h-65+10:h>=48&&h<=57?h-48:1/0)>=e)break;a=h,o=o*e+u}}return n&&95===a&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===r||null!=t&&this.pos-r!==t?null:o},$e.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var i=this.readInt(e);return null==i&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&110===this.input.charCodeAt(this.pos)?(i=Ke(this.input.slice(t,this.pos)),++this.pos):u(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(b.num,i)},$e.readNumber=function(e){var t=this.pos;e||null!==this.readInt(10,void 0,!0)||this.raise(t,"Invalid number");var i=this.pos-t>=2&&48===this.input.charCodeAt(t);i&&this.strict&&this.raise(t,"Invalid number");var n=this.input.charCodeAt(this.pos);if(!i&&!e&&this.options.ecmaVersion>=11&&110===n){var s=Ke(this.input.slice(t,this.pos));return++this.pos,u(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(b.num,s)}i&&/[89]/.test(this.input.slice(t,this.pos))&&(i=!1),46!==n||i||(++this.pos,this.readInt(10),n=this.input.charCodeAt(this.pos)),69!==n&&101!==n||i||(43!==(n=this.input.charCodeAt(++this.pos))&&45!==n||++this.pos,null===this.readInt(10)&&this.raise(t,"Invalid number")),u(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var r,o=(r=this.input.slice(t,this.pos),i?parseInt(r,8):parseFloat(r.replace(/_/g,"")));return this.finishToken(b.num,o)},$e.readCodePoint=function(){var e;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var t=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else e=this.readHexChar(4);return e},$e.readString=function(e){for(var t="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var n=this.input.charCodeAt(this.pos);if(n===e)break;92===n?(t+=this.input.slice(i,this.pos),t+=this.readEscapedChar(!1),i=this.pos):8232===n||8233===n?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(S(n)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(i,this.pos++),this.finishToken(b.string,t)};var Ye={};$e.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==Ye)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},$e.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Ye;this.raise(e,t)},$e.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var i=this.input.charCodeAt(this.pos);if(96===i||36===i&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==b.template&&this.type!==b.invalidTemplate?(e+=this.input.slice(t,this.pos),this.finishToken(b.template,e)):36===i?(this.pos+=2,this.finishToken(b.dollarBraceL)):(++this.pos,this.finishToken(b.backQuote));if(92===i)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(S(i)){switch(e+=this.input.slice(t,this.pos),++this.pos,i){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(i)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},$e.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if("{"!==this.input[this.pos+1])break;case"`":return this.finishToken(b.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":"\n"===this.input[this.pos+1]&&++this.pos;case"\n":case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1}this.raise(this.start,"Unterminated template")},$e.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return _(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var i=this.pos-1;this.invalidStringToken(i,"Invalid escape sequence in template string")}default:if(t>=48&&t<=55){var n=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],s=parseInt(n,8);return s>255&&(n=n.slice(0,-1),s=parseInt(n,8)),this.pos+=n.length-1,t=this.input.charCodeAt(this.pos),"0"===n&&56!==t&&57!==t||!this.strict&&!e||this.invalidStringToken(this.pos-1-n.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(s)}return S(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(t)}},$e.readHexChar=function(e){var t=this.pos,i=this.readInt(16,e);return null===i&&this.invalidStringToken(t,"Bad character escape sequence"),i},$e.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,i=this.pos,n=this.options.ecmaVersion>=6;this.pos<this.input.length;){var s=this.fullCharCodeAtPos();if(d(s,n))this.pos+=s<=65535?1:2;else{if(92!==s)break;this.containsEsc=!0,e+=this.input.slice(i,this.pos);var r=this.pos;117!==this.input.charCodeAt(++this.pos)&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var o=this.readCodePoint();(t?u:d)(o,n)||this.invalidStringToken(r,"Invalid Unicode escape"),e+=_(o),i=this.pos}t=!1}return e+this.input.slice(i,this.pos)},$e.readWord=function(){var e=this.readWord1(),t=b.name;return this.keywords.test(e)&&(t=y[e]),this.finishToken(t,e)};var qe="8.16.0";W.acorn={Parser:W,version:qe,defaultOptions:G,Position:N,SourceLocation:O,getLineInfo:F,Node:ge,TokenType:p,tokTypes:b,keywordTypes:y,TokContext:se,tokContexts:re,isIdentifierChar:d,isIdentifierStart:u,Token:je,isNewLine:S,lineBreak:C,lineBreakG:w,nonASCIIwhitespace:E},e.Node=ge,e.Parser=W,e.Position=N,e.SourceLocation=O,e.TokContext=se,e.Token=je,e.TokenType=p,e.defaultOptions=G,e.getLineInfo=F,e.isIdentifierChar=d,e.isIdentifierStart=u,e.isNewLine=S,e.keywordTypes=y,e.lineBreak=C,e.lineBreakG=w,e.nonASCIIwhitespace=E,e.parse=function(e,t){return W.parse(e,t)},e.parseExpressionAt=function(e,t,i){return W.parseExpressionAt(e,t,i)},e.tokContexts=re,e.tokTypes=b,e.tokenizer=function(e,t){return W.tokenizer(e,t)},e.version=qe}(t)},21371(e){"use strict";var t,i=Object.defineProperty,n=Object.defineProperties,s=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertyNames,a=Object.getOwnPropertySymbols,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,u=Reflect.get,d=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),p=Math.pow,g=(e,t,n)=>t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,f=(e,t)=>{for(var i in t||(t={}))c.call(t,i)&&g(e,i,t[i]);if(a)for(var i of a(t))h.call(t,i)&&g(e,i,t[i]);return e},m=(e,t)=>n(e,r(t)),y=(e,t)=>{var i={};for(var n in e)c.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&a)for(var n of a(e))t.indexOf(n)<0&&h.call(e,n)&&(i[n]=e[n]);return i},v=(e,t)=>{for(var n in t)i(e,n,{get:t[n],enumerable:!0})},b=(e,t,n,r)=>{for(var o,a=r>1?void 0:r?s(t,n):t,l=e.length-1;l>=0;l--)(o=e[l])&&(a=(r?o(t,n,a):o(a))||a);return r&&a&&i(t,n,a),a},C=(e,t,i)=>u(l(e),i,t),w=(e,t,i)=>new Promise((n,s)=>{var r=e=>{try{a(i.next(e))}catch(e){s(e)}},o=e=>{try{a(i.throw(e))}catch(e){s(e)}},a=e=>e.done?n(e.value):Promise.resolve(e.value).then(r,o);a((i=i.apply(e,t)).next())}),S=function(e,t){this[0]=e,this[1]=t},x=e=>{var t,i=e[d("asyncIterator")],n=!1,s={};return null==i?(i=e[d("iterator")](),t=e=>s[e]=t=>i[e](t)):(i=i.call(e),t=e=>s[e]=t=>{if(n){if(n=!1,"throw"===e)throw t;return t}return n=!0,{done:!1,value:new S(new Promise(n=>{var s=i[e](t);if(!(s instanceof Object))throw TypeError("Object expected");n(s)}),1)}}),s[d("iterator")]=()=>s,t("next"),"throw"in i?t("throw"):s.throw=e=>{throw e},"return"in i&&t("return"),s},E={};v(E,{AgChart:()=>Tf,AgCharts:()=>Mf,AgErrorBarSupportedSeriesTypes:()=>A,AgTooltipPositionType:()=>M,Marker:()=>mu,VERSION:()=>Rf,_ModuleSupport:()=>Wf,_Scale:()=>Hf,_Scene:()=>kf,_Theme:()=>Bf,_Util:()=>Uf,__FORCE_MODULE_DETECTION:()=>T,time:()=>D}),e.exports=(t=E,((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let n of o(t))c.call(e,n)||void 0===n||i(e,n,{get:()=>t[n],enumerable:!(r=s(t,n))||r.enumerable});return e})(i({},"__esModule",{value:!0}),t));var A=["bar","line","scatter"],M=(e=>(e.POINTER="pointer",e.NODE="node",e.TOP="top",e.RIGHT="right",e.BOTTOM="bottom",e.LEFT="left",e.TOP_LEFT="top-left",e.TOP_RIGHT="top-right",e.BOTTOM_RIGHT="bottom-right",e.BOTTOM_LEFT="bottom-left",e))(M||{}),T=0,D={};v(D,{day:()=>ee,friday:()=>le,hour:()=>Q,millisecond:()=>F,minute:()=>q,monday:()=>se,month:()=>ue,saturday:()=>ce,second:()=>$,sunday:()=>ne,thursday:()=>ae,tuesday:()=>re,utcDay:()=>ye,utcHour:()=>me,utcMinute:()=>fe,utcMonth:()=>ve,utcYear:()=>be,wednesday:()=>oe,year:()=>pe});var I=new Map;function R(e,t){I.has(t)||(I.set(t,!0),e())}function k(e){return e}function*P(...e){for(const t of e)yield*x(t)}function _(e,t=0,i){const{leading:n=!0,trailing:s=!0}=null!=i?i:{};let r,o,a=!1;function l(){s&&o?(r=setTimeout(l,t),e(...o)):a=!1,o=null}return Object.assign(function(...i){a?o=i:(a=!0,r=setTimeout(l,t),n?e(...i):o=i)},{cancel(){clearTimeout(r),a=!1,o=null}})}R.clear=()=>I.clear();var L={log(...e){console.log(...e)},warn(e,...t){console.warn(`AG Charts - ${e}`,...t)},error(e,...t){"object"==typeof e?console.error("AG Charts error",e,...t):console.error(`AG Charts - ${e}`,...t)},table(...e){console.table(...e)},warnOnce(e,...t){R(()=>L.warn(e,...t),`Logger.warn: ${e}`)},errorOnce(e,...t){R(()=>L.error(e,...t),`Logger.error: ${e}`)}},N=class{constructor(e,t,i){this._encode=e,this._decode=t,this._rangeCallback=i}floor(e){const t=new Date(e),i=this._encode(t);return this._decode(i)}ceil(e){const t=new Date(Number(e)-1),i=this._encode(t);return this._decode(i+1)}range(e,t,i){var n;const s=null==(n=this._rangeCallback)?void 0:n.call(this,e,t),r=this._encode(i?this.floor(e):this.ceil(e)),o=this._encode(i?this.ceil(t):this.floor(t));if(o<r)return[];const a=[];for(let e=r;e<=o;e++){const t=this._decode(e);a.push(t)}return null==s||s(),a}},O=class extends N{getOffset(e,t){const i="number"==typeof e||e instanceof Date?this._encode(new Date(e)):0;return Math.floor(i)%t}every(e,t){let i,n=0;const s=e;s!==(e=Math.max(1,Math.round(e)))&&L.warnOnce(`interval step of [${s}] rounded to [${e}].`);const{snapTo:r="start"}=null!=t?t:{};if("string"==typeof r){const t=n;i=(i,s)=>{const o="start"===r?i:s;return n=this.getOffset(o,e),()=>n=t}}else"number"==typeof r?n=this.getOffset(new Date(r),e):r instanceof Date&&(n=this.getOffset(r,e));return new N(t=>{const i=this._encode(t);return Math.floor((i-n)/e)},t=>this._decode(t*e+n),i)}},F=new O(function(e){return e.getTime()},function(e){return new Date(e)}),G=F,B=(new Date(0).getFullYear(),1e3),V=6e4,H=36e5,U=864e5,z=6048e5,W=31536e6,j=(new Date).getTimezoneOffset()*V,$=new O(function(e){return Math.floor((e.getTime()-j)/B)},function(e){return new Date(j+e*B)}),K=$,Y=(new Date).getTimezoneOffset()*V,q=new O(function(e){return Math.floor((e.getTime()-Y)/V)},function(e){return new Date(Y+e*V)}),X=q,Z=(new Date).getTimezoneOffset()*V,Q=new O(function(e){return Math.floor((e.getTime()-Z)/H)},function(e){return new Date(Z+e*H)}),J=Q,ee=new O(function(e){const t=e.getTimezoneOffset()*V;return Math.floor((e.getTime()-t)/U)},function(e){const t=new Date(1970,0,1);return t.setDate(t.getDate()+e),t}),te=ee;function ie(e){const t=(7+e-4)%7;return new O(function(e){const i=e.getTimezoneOffset()*V;return Math.floor((e.getTime()-i)/z-t/7)},function(e){const i=new Date(1970,0,1);return i.setDate(i.getDate()+7*e+t),i})}var ne=ie(0),se=ie(1),re=ie(2),oe=ie(3),ae=ie(4),le=ie(5),ce=ie(6),he=ne,ue=new O(function(e){return 12*e.getFullYear()+e.getMonth()},function(e){const t=Math.floor(e/12);return new Date(t,e-12*t,1)}),de=ue,pe=new O(function(e){return e.getFullYear()},function(e){const t=new Date;return t.setFullYear(e),t.setMonth(0,1),t.setHours(0,0,0,0),t}),ge=pe,fe=new O(function(e){return Math.floor(e.getTime()/V)},function(e){return new Date(e*V)}),me=new O(function(e){return Math.floor(e.getTime()/H)},function(e){return new Date(e*H)}),ye=new O(function(e){return Math.floor(e.getTime()/U)},function(e){const t=new Date(0);return t.setUTCDate(t.getUTCDate()+e),t.setUTCHours(0,0,0,0),t}),ve=new O(function(e){return 12*e.getUTCFullYear()+e.getUTCMonth()},function(e){const t=Math.floor(e/12),i=e-12*t;return new Date(Date.UTC(t,i,1))}),be=new O(function(e){return e.getUTCFullYear()},function(e){const t=new Date;return t.setUTCFullYear(e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0),t}),Ce={isEnterprise:!1},we=class{constructor(){this.destroyFns=[]}destroy(){for(const e of this.destroyFns)e()}},Se=new class{constructor(){this.modules=[],this.dependencies=new Set,this.dependents=new Set}register(...e){for(const t of e){this.registerDependencies(t);const e=this.modules.find(e=>t.type===e.type&&t.optionsKey===e.optionsKey&&t.identifier===e.identifier);if(e){if("enterprise"===t.packageType&&"community"===e.packageType){const i=this.modules.indexOf(e);this.modules.splice(i,1,t)}}else this.modules.push(t)}}hasEnterpriseModules(){return this.modules.some(e=>"enterprise"===e.packageType)}*byType(...e){for(const t of this.modules)e.includes(t.type)&&this.dependencies.has(t.optionsKey)&&(yield t);for(const t of this.modules)!e.includes(t.type)||this.dependencies.has(t.optionsKey)||this.dependents.has(t.optionsKey)||(yield t);for(const t of this.modules)e.includes(t.type)&&this.dependents.has(t.optionsKey)&&(yield t)}registerDependencies(e){if(null!=e.dependencies&&0!==e.dependencies.length){if(this.dependencies.has(e.optionsKey))throw new Error(`Module [${e.optionsKey}] can not both be depended upon by any module and have dependencies of [${e.dependencies}].`);for(const t of e.dependencies){if(this.dependents.has(t))throw new Error(`Module [${t}] can not both be depended upon by any module and have dependencies of [${e.optionsKey}].`);this.dependencies.add(t)}this.dependents.add(e.optionsKey)}}},xe=new class{constructor(){this.axesMap=new Map,this.hidden=new Set,this.themeTemplates=new Map}register(e,t){this.axesMap.set(e,t.instanceConstructor),t.themeTemplate&&this.setThemeTemplate(e,t.themeTemplate),t.hidden&&this.hidden.add(e)}create(e,t){const i=this.axesMap.get(e);if(i)return new i(t);throw new Error(`AG Charts - unknown axis type: ${e}`)}has(e){return this.axesMap.has(e)}keys(){return this.axesMap.keys()}publicKeys(){return[...this.keys()].filter(e=>!this.hidden.has(e))}setThemeTemplate(e,t){return this.themeTemplates.set(e,t),this}getThemeTemplate(e){return this.themeTemplates.get(e)}},Ee=Symbol("BREAK"),Ae="__decorator_config";function Me(e,t){null==Object.getOwnPropertyDescriptor(e,Ae)&&Object.defineProperty(e,Ae,{value:{}});const i=e[Ae],n=t.toString();if(void 0!==i[n])return i[n];const s=new WeakMap;i[n]={setters:[],getters:[],observers:[],valuesMap:s};const r=Object.getOwnPropertyDescriptor(e,t),o=null==r?void 0:r.set,a=null==r?void 0:r.get;return Object.defineProperty(e,t,{set:function(e){const{setters:r,observers:l}=i[n];let c;r.some(e=>e.length>2)&&(c=a?a.call(this):s.get(this));for(const i of r)if((e=i(this,t,e,c))===Ee)return;o?o.call(this,e):s.set(this,e);for(const t of l)t(this,e,c)},get:function(){let e=a?a.call(this):s.get(this);for(const s of i[n].getters)if(e=s(this,t,e),e===Ee)return;return e},enumerable:!0,configurable:!1}),i[n]}function Te(e,t,i){return(n,s)=>{const r=Me(n,s);r.setters.push(e),t&&r.getters.unshift(t),i&&Object.assign(r,i)}}function De(e){return void 0!==e&&Ae in e}function Ie(e){const t=new Set;for(;De(e);)t.add(null==e?void 0:e[Ae]),e=Object.getPrototypeOf(e);return Array.from(t).flatMap(e=>Object.keys(e))}function Re(e){return Ie(e).reduce((t,i)=>{var n;return t[i]=null!=(n=e[i])?n:null,t},{})}function ke(e){return null!=e}function Pe(e){return Array.isArray(e)}function _e(e){return"boolean"==typeof e}function Le(e){return e instanceof Date}function Ne(e){return Le(e)&&!isNaN(Number(e))}function Oe(e){return e instanceof RegExp}function Fe(e){return"function"==typeof e}function Ge(e){return"object"==typeof e&&null!==e&&!Pe(e)}function Be(e){return Pe(e)||Ve(e)}function Ve(e){return"object"==typeof e&&null!==e&&e.constructor===Object}function He(e){return"string"==typeof e}function Ue(e){return"number"==typeof e}function ze(e){return Ue(e)&&Number.isFinite(e)}function We(e){return"undefined"!=typeof window&&e instanceof HTMLElement}function je(e,t){return He(t)&&Object.keys(e).includes(t)}function $e(e,t){return Object.values(e).includes(t)}function Ke(e){return"symbol"==typeof e}function Ye(...e){return qe(...e.reverse())}function qe(...e){const t={};for(const i of e){if(!Ge(i))continue;const e=De(i)?Ie(i):Object.keys(i);for(const n of e)Ve(t[n])&&Ve(i[n])?t[n]=qe(t[n],i[n]):null!=t[n]||(t[n]=i[n])}return t}function Xe(e,...t){return t&&Pe(e)?e.map(e=>qe(e,...t)):e}function Ze(e,t){return Object.entries(e).reduce((i,[n,s])=>(i[n]=t(s,n,e),i),{})}function Qe(e,t){const i=f({},e);for(const e of t)delete i[e];return i}function Je(e,t){return(Pe(t)?t:t.split(".")).reduce((e,t)=>e[t],e)}var et=new Set(["__proto__","constructor","prototype"]);function tt(e,t,i){const n=Pe(t)?t.slice():t.split("."),s=n.pop();n.some(e=>et.has(e))||(n.reduce((e,t)=>e[t],e)[s]=i)}function it(e,t,i){if(void 0===i)return t;for(const n of e){const e=i[n];void 0!==e&&(t[n]=e)}return t}var nt=class extends Map{get(e){var t;return null!=(t=super.get(e))?t:"unknown"}isCartesian(e){return"cartesian"===this.get(e)}isPolar(e){return"polar"===this.get(e)}isHierarchy(e){return"hierarchy"===this.get(e)}isTopology(e){return"topology"===this.get(e)}get seriesTypes(){return Array.from(this.keys())}get cartesianTypes(){return this.seriesTypes.filter(e=>this.isCartesian(e))}get polarTypes(){return this.seriesTypes.filter(e=>this.isPolar(e))}get hierarchyTypes(){return this.seriesTypes.filter(e=>this.isHierarchy(e))}get topologyTypes(){return this.seriesTypes.filter(e=>this.isTopology(e))}},st=class extends Map{set(e,t){return super.set(e,qe(t,this.get(e)))}},rt=new nt,ot=new nt,at=new st,lt=[{type:"root",optionsKey:"animation",chartTypes:["cartesian","polar","hierarchy","topology"]},{type:"root",optionsKey:"annotations",chartTypes:["cartesian"]},{type:"root",optionsKey:"background",chartTypes:["cartesian","polar","hierarchy","topology"],optionsInnerKey:"image"},{type:"root",optionsKey:"contextMenu",chartTypes:["cartesian","polar","hierarchy","topology"]},{type:"root",optionsKey:"dataSource",chartTypes:["cartesian","polar","hierarchy","topology"]},{type:"root",optionsKey:"sync",chartTypes:["cartesian"]},{type:"root",optionsKey:"zoom",chartTypes:["cartesian","topology"]},{type:"legend",optionsKey:"gradientLegend",chartTypes:["cartesian","polar","hierarchy","topology"],identifier:"gradient"},{type:"root",optionsKey:"navigator",chartTypes:["cartesian"],optionsInnerKey:"miniChart"},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"angle-category"},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"angle-number"},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"radius-category"},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"radius-number"},{type:"axis",optionsKey:"axes[]",chartTypes:["cartesian"],identifier:"ordinal-time"},{type:"axis-option",optionsKey:"crosshair",chartTypes:["cartesian"]},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"box-plot"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"candlestick"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"ohlc"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"bullet"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"heatmap"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"range-area"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"range-bar"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"waterfall"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"nightingale"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radar-area"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radar-line"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radial-bar"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radial-column"},{type:"series",optionsKey:"series[]",chartTypes:["hierarchy"],identifier:"sunburst"},{type:"series",optionsKey:"series[]",chartTypes:["hierarchy"],identifier:"treemap"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-shape"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-line"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-marker"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-shape-background"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-line-background"},{type:"series-option",optionsKey:"errorBar",chartTypes:["cartesian"],identifier:"error-bars"}];function ct(e){var t;return null==(t=lt.find(t=>"series"===t.type&&t.identifier===e))?void 0:t.chartTypes}function ht(e){if(!function(e){return"enterprise"===e.packageType}(e))throw new Error("AG Charts - internal configuration error, only enterprise modules need verification.");const t=lt.find(t=>t.type===e.type&&t.optionsKey===e.optionsKey&&t.identifier===e.identifier&&e.chartTypes.every(e=>t.chartTypes.includes(e)));return t&&(null!=t.useCount||(t.useCount=0),t.useCount++),null!=t}function ut(e){var t,i,n;return null!=(n=null==(i=null==(t=e.series)?void 0:t[0])?void 0:i.type)?n:"line"}function dt(e){const t=ut(e);return null==t||("cartesian"===t?(L.warnOnce(`type '${t}' is deprecated, use a series type instead`),!0):rt.isCartesian(t)||"cartesian"===(null==(i=ct(t))?void 0:i.find(e=>"cartesian"===e)));var i}function pt(e){const t=ut(e);return null!=t&&("polar"===t?(L.warnOnce(`type '${t}' is deprecated, use a series type instead`),!0):rt.isPolar(t)||"polar"===(null==(i=ct(t))?void 0:i.find(e=>"polar"===e)));var i}function gt(e){const t=ut(e);return null!=t&&("hierarchy"===t?(L.warnOnce(`type '${t}' is deprecated, use a series type instead`),!0):rt.isHierarchy(t)||"hierarchy"===(null==(i=ct(t))?void 0:i.find(e=>"hierarchy"===e)));var i}function ft(e){const t=ut(e);return null!=t&&("topology"===t?(L.warnOnce(`type '${t}' is deprecated, use a series type instead`),!0):rt.isTopology(t)||"topology"===(null==(i=ct(t))?void 0:i.find(e=>"topology"===e)));var i}function mt(e){return null!=e&&xe.has(e)}var yt=class{set(e){const{className:t=this.constructor.name}=this.constructor;if("object"!=typeof e)return L.warn(`unable to set ${t} - expecting a properties object`),this;const i=new Set(Object.keys(e));for(const t of Ie(this))if(i.has(t)){const n=e[t],s=this;bt(s[t])?s[t]=s[t]instanceof vt?s[t].reset(n):s[t].set(n):s[t]=n,i.delete(t)}for(const e of i)L.warn(`unable to set [${e}] in ${t} - property is unknown`);return this}isValid(){return Ie(this).every(e=>{const{optional:t}=function(e,t){const i=t.toString();for(;De(e);){const t=e[Ae];if(Object.hasOwn(t,i))return t[i];e=Object.getPrototypeOf(e)}}(this,e),i=t||void 0!==this[e];return i||L.warnOnce(`[${e}] is required.`),i})}toJson(){return Ie(this).reduce((e,t)=>{const i=this[t];return e[t]=bt(i)?i.toJson():i,e},{})}},vt=class e extends Array{constructor(e,...t){super(t.length),Object.defineProperty(this,"itemFactory",{value:e,enumerable:!1,configurable:!1}),this.set(t)}set(e){if(Pe(e)){this.length=e.length;for(let t=0;t<e.length;t++)this[t]=(new this.itemFactory).set(e[t])}return this}reset(t){return new e(this.itemFactory,...t)}toJson(){return this.map(e=>{var t,i;return null!=(i=null==(t=null==e?void 0:e.toJson)?void 0:t.call(e))?i:e})}};function bt(e){return e instanceof yt||e instanceof vt}var Ct="class-instance";function wt(e,t,i){if(Pe(t)){if(!Pe(e)||e.length!==t.length||t.some((t,i)=>null!=wt(e[i],t)))return t}else{if(Ve(t)){if(!Ve(e))return t;const n={},s=new Set([...Object.keys(e),...Object.keys(t)]);for(const r of s)if(e[r]!==t[r]&&!(null==i?void 0:i.includes(r)))if(typeof e[r]==typeof t[r]){const i=wt(e[r],t[r]);null!==i&&(n[r]=i)}else n[r]=t[r];return Object.keys(n).length?n:null}if(e!==t)return t}return null}function St(e,t){return Pe(e)?e.map(e=>St(e,t)):Ve(e)?Ze(e,(e,i)=>{var n;return(null==(n=null==t?void 0:t.shallow)?void 0:n.includes(i))?xt(e):St(e,t)}):xt(e)}function xt(e){return Pe(e)?[...e]:Ve(e)?f({},e):Le(e)?new Date(e):Oe(e)?new RegExp(e.source,e.flags):e}function Et(e,t,i,...n){var s;if(Pe(e))t(e,...n),e.forEach((e,s)=>{Et(e,t,i,...Mt(n,s))});else if(Ve(e)){t(e,...n);for(const r of Object.keys(e)){if(null==(s=null==i?void 0:i.skip)?void 0:s.includes(r))continue;const o=e[r];(Pe(o)||Ve(o))&&Et(o,t,i,...Mt(n,r))}}}function At(e,t,i={}){const{path:n,constructedArrays:s,matcherPath:r=(null==n?void 0:n.replace(/(\[[0-9+]+])/i,"[]")),skip:o=[]}=i;if(null==e)throw new Error(`AG Charts - target is uninitialised: ${null!=n?n:"<root>"}`);if(null==t)return e;if(bt(e))return e.set(t);const a=e,l=Tt(e);for(const c in t){if(et.has(c))continue;const h=`${r?r+".":""}${c}`;if(o.includes(h))continue;const u=t[c],d=`${n?n+".":""}${c}`,p=a.constructor,g=a[c];let y;try{const t=Tt(g),n=Tt(u);if(l===Ct&&!(c in e)){L.warn(`unable to set [${d}] in ${null==p?void 0:p.name} - property is unknown`);continue}if(null!=t&&null!=n&&n!==t&&(t!==Ct||"object"!==n)){L.warn(`unable to set [${d}] in ${null==p?void 0:p.name} - can't apply type of [${n}], allowed types are: [${t}]`);continue}if(bt(g))a[c].set(u);else if("array"===n)if(null!=y||(y=null==s?void 0:s.get(g)),null==y)a[c]=u;else{const e=u;a[c]=e.map(e=>At(new y,e,m(f({},i),{path:d,matcherPath:h+"[]"})))}else n===Ct?a[c]=u:"object"===n?null!=g?At(g,u,m(f({},i),{path:d,matcherPath:h})):null==y?(a[c]={},At(a[c],u,m(f({},i),{path:d,matcherPath:h}))):a[c]=At(new y,u,m(f({},i),{path:d,matcherPath:h})):a[c]=u}catch(e){L.warn(`unable to set [${d}] in [${null==p?void 0:p.name}]; nested error is: ${e.message}`)}}return e}function Mt(e,t){return e.map(e=>null==e?void 0:e[t])}function Tt(e){return null==e?null:We(e)||Le(e)?"primitive":Pe(e)?"array":Ge(e)?Ve(e)?"object":Ct:Fe(e)?"function":"primitive"}var Dt=new class{constructor(){this.seriesMap=new Map,this.themeTemplates=new Map}register(e,{chartTypes:[t],instanceConstructor:i,defaultAxes:n,themeTemplate:s,enterpriseThemeTemplate:r,paletteFactory:o,solo:a,stackable:l,groupable:c,stackedByDefault:h,swapDefaultAxesCondition:u,hidden:d}){this.setThemeTemplate(e,s,r),this.seriesMap.set(e,{instanceConstructor:i,defaultAxes:n,paletteFactory:o,solo:a,stackable:l,groupable:c,stackedByDefault:h,swapDefaultAxesCondition:u}),rt.set(e,t),d||ot.set(e,t)}create(e,t){var i;const n=null==(i=this.seriesMap.get(e))?void 0:i.instanceConstructor;if(n)return new n(t);throw new Error(`AG Charts - unknown series type: ${e}`)}cloneDefaultAxes(e){var t;const i=null==(t=this.seriesMap.get(e))?void 0:t.defaultAxes;return i?{axes:St(i)}:null}setThemeTemplate(e,t,i={}){const n=this.themeTemplates.get(e);this.themeTemplates.set(e,{community:qe(t,null==n?void 0:n.community),enterprise:qe(i,t,null==n?void 0:n.community)})}getThemeTemplate(e){const t=this.themeTemplates.get(e);return Ce.isEnterprise?null==t?void 0:t.enterprise:null==t?void 0:t.community}getPaletteFactory(e){var t;return null==(t=this.seriesMap.get(e))?void 0:t.paletteFactory}isSolo(e){var t,i;return null!=(i=null==(t=this.seriesMap.get(e))?void 0:t.solo)&&i}isGroupable(e){var t,i;return null!=(i=null==(t=this.seriesMap.get(e))?void 0:t.groupable)&&i}isStackable(e){var t,i;return null!=(i=null==(t=this.seriesMap.get(e))?void 0:t.stackable)&&i}isStackedByDefault(e){var t,i;return null!=(i=null==(t=this.seriesMap.get(e))?void 0:t.stackedByDefault)&&i}isDefaultAxisSwapNeeded(e){var t,i,n;let s;for(const r of null!=(t=e.series)?t:[]){const{type:e="line"}=r,t=null==(n=null==(i=this.seriesMap.get(e))?void 0:i.swapDefaultAxesCondition)?void 0:n.call(i,r);if(null!=t){if(null!=s&&s!=t)throw new Error("AG Charts - The provided series have incompatible directions");s=t}}return s}},It=new class{constructor(){this.legendMap=new Map,this.themeTemplates=new Map}register(e,{optionsKey:t,instanceConstructor:i,themeTemplate:n}){this.legendMap.set(e,{optionsKey:t,instanceConstructor:i}),this.themeTemplates.set(t,n)}create(e,t){var i;const n=null==(i=this.legendMap.get(e))?void 0:i.instanceConstructor;if(n)return new n(t);throw new Error(`AG Charts - unknown legend type: ${e}`)}getThemeTemplates(){return Object.fromEntries(this.themeTemplates)}getKeys(){return Array.from(this.legendMap.entries()).reduce((e,[t,i])=>(e[t]=i.optionsKey,e),{})}},Rt=(e=>(e[e.SMALL=12]="SMALL",e[e.MEDIUM=13]="MEDIUM",e[e.LARGE=17]="LARGE",e))(Rt||{}),kt=(e=>(e.NORMAL="normal",e.BOLD="bold",e.BOLDER="bolder",e.LIGHTER="lighter",e))(kt||{}),Pt=(e=>(e.TOP="top",e.RIGHT="right",e.BOTTOM="bottom",e.LEFT="left",e))(Pt||{}),_t=(e=>(e.CATEGORY="category",e.ORDINAL_TIME="ordinal-time",e.NUMBER="number",e.TIME="time",e.LOG="log",e))(_t||{}),Lt=(e=>(e.ANGLE_CATEGORY="angle-category",e.ANGLE_NUMBER="angle-number",e.RADIUS_CATEGORY="radius-category",e.RADIUS_NUMBER="radius-number",e))(Lt||{}),Nt=(e=>(e.CIRCLE="circle",e.POLYGON="polygon",e))(Nt||{}),Ot={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},Ft={BLUE:"#2b5c95",ORANGE:"#cc6f10",GREEN:"#1e652e",CYAN:"#18859e",YELLOW:"#a69400",VIOLET:"#603c88",GRAY:"#575757",MAGENTA:"#7d2f6d",BROWN:"#4f3508",RED:"#a82529"},Gt=Symbol("is-dark-theme"),Bt=Symbol("extends-axes-defaults"),Vt=Symbol("extends-axes-line-defaults"),Ht=Symbol("extends-axes-tick-defaults"),Ut=Symbol("extends-axes-grid-line-defaults"),zt=Symbol("extends-series-defaults"),Wt=Symbol("extends-cartesian-marker-defaults"),jt=Symbol("default-font"),$t=Symbol("default-label-colour"),Kt=Symbol("default-inverted-label-colour"),Yt=Symbol("default-inside-series-label-colour"),qt=Symbol("default-muted-label-colour"),Xt=Symbol("default-axis-grid-colour"),Zt=Symbol("default-axis-line-colour"),Qt=Symbol("default-cross-lines-colour"),Jt=Symbol("default-background-colour"),ei=Symbol("default-shadow-colour"),ti=Symbol("default-colours"),ii=Symbol("default-waterfall-series-positive-colors"),ni=Symbol("default-waterfall-series-negative-colors"),si=Symbol("default-waterfall-series-total-colors"),ri=Symbol("default-waterfall-series-connector-line-stroke"),oi=Symbol("default-polar-series-stroke"),ai=Symbol("default-diverging-series-colour-range"),li=Symbol("default-hierarchy-fills"),ci=Symbol("default-hierarchy-strokes"),hi=Symbol("default-annotation-stroke"),ui=Symbol("default-annotation-background-fill"),di=Symbol("default-annotation-handle-fill"),pi="white",gi={fills:Object.values(Ot),strokes:Object.values(Ft)},fi={get cartesian(){return{seriesTypes:rt.cartesianTypes,commonOptions:["zoom","navigator"]}},get polar(){return{seriesTypes:rt.polarTypes,commonOptions:[]}},get hierarchy(){return{seriesTypes:rt.hierarchyTypes,commonOptions:[]}},get topology(){return{seriesTypes:rt.topologyTypes,commonOptions:[]}}},mi=Object.values(fi).reduce((e,{commonOptions:t})=>e.concat(t),[]),yi=class e{getPalette(){return gi}static getAxisDefaults(e){return qe(e,{title:{enabled:!1,text:"Axis Title",spacing:25,fontWeight:"normal",fontSize:13,fontFamily:jt,color:$t},label:{fontSize:12,fontFamily:jt,padding:5,color:$t,avoidCollisions:!0},line:{enabled:!0,width:1,color:Zt},tick:{enabled:!1,width:1,color:Zt},gridLine:{enabled:!0,style:[{stroke:Xt,lineDash:[]}]},crossLines:{enabled:!1,fill:Qt,stroke:Qt,fillOpacity:.1,strokeWidth:1,label:{enabled:!1,fontSize:12,fontFamily:jt,padding:5,color:$t}}})}static getSeriesDefaults(){return{visible:!0,showInLegend:!0,highlightStyle:{item:{fill:"#ffffff54",stroke:"#0006",strokeWidth:2},series:{dimOpacity:1}},nodeClickRange:"exact",tooltip:{enabled:!0}}}static getCartesianSeriesMarkerDefaults(){return{enabled:!0,shape:"circle",size:7,strokeWidth:1}}static getChartDefaults(){return{background:{visible:!0,fill:Jt},padding:{top:20,right:20,bottom:20,left:20},keyboard:{enabled:!0},title:{enabled:!1,text:"Title",fontWeight:"normal",fontSize:17,fontFamily:jt,color:$t,wrapping:"hyphenate"},subtitle:{enabled:!1,text:"Subtitle",spacing:20,fontSize:13,fontFamily:jt,color:qt,wrapping:"hyphenate"},footnote:{enabled:!1,text:"Footnote",spacing:20,fontSize:13,fontFamily:jt,color:"rgb(140, 140, 140)",wrapping:"hyphenate"},legend:{position:"bottom",spacing:30,listeners:{},item:{paddingX:16,paddingY:8,marker:{size:15,padding:8},toggleSeriesVisible:!0,label:{color:$t,fontSize:12,fontFamily:jt}},reverseOrder:!1,pagination:{marker:{size:12},activeStyle:{fill:$t},inactiveStyle:{fill:qt},highlightStyle:{fill:$t},label:{color:$t}}},tooltip:{enabled:!0,darkTheme:Gt,range:"nearest",delay:0},overlays:{loading:{darkTheme:Gt},noData:{darkTheme:Gt},noVisibleSeries:{darkTheme:Gt}},listeners:{}}}constructor(e={}){const{overrides:t,palette:i}=St(e),n=this.createChartConfigPerChartType(this.getDefaults());t&&this.mergeOverrides(n,t),this.config=Object.freeze(this.templateTheme(n)),this.palette=qe(i,this.getPalette())}mergeOverrides(e,t){for(const{seriesTypes:i,commonOptions:n}of Object.values(fi)){const s=f({},t.common);for(const e of mi)n.includes(e)||delete s[e];if(s)for(const t of i){const i=t;e[i]=qe(s,e[i])}}rt.seriesTypes.forEach(i=>{const n=i;t[n]&&(e[n]=qe(t[n],e[n]))})}createChartConfigPerChartType(e){for(const[t,{seriesTypes:i}]of Object.entries(fi)){const n=at.get(t);for(const t of i)e[t]||(e[t]=St(n))}return e}getDefaults(){const t=(t,i)=>{var n;const s={},r=f(f(f({axes:{}},It.getThemeTemplates()),e.getChartDefaults()),at.get(t));for(const o of i){s[o]=qe(Dt.getThemeTemplate(o),null!=(n=s[o])?n:St(r));const{axes:i}=s[o];for(const n of xe.keys())i[n]=qe(i[n],xe.getThemeTemplate(n),"cartesian"===t&&e.cartesianAxisDefault[n])}return s};return qe(t("cartesian",rt.cartesianTypes),t("polar",rt.polarTypes),t("hierarchy",rt.hierarchyTypes),t("topology",rt.topologyTypes))}templateTheme(e){const t=St(e),{extensions:i,properties:n}=this.getTemplateParameters();return Et(t,e=>{if(e.__extends__){const t=e.__extends__,n=i.get(t);if(null==n)throw new Error(`AG Charts - no template variable provided for: ${t}`);Object.keys(n).forEach(t=>{t in e?Ge(e[t])&&(e[t]=qe(e[t],n[t])):e[t]=n[t]}),delete e.__extends__}if(Pe(e))for(let t=0;t<e.length;t++){const i=e[t];n.has(i)&&(e[t]=n.get(i))}else for(const[t,i]of Object.entries(e))n.has(i)&&(e[t]=n.get(i))}),St(t)}static getDefaultColors(){return{fills:Ot,strokes:Ft}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:Ot.BLUE,stroke:Ft.BLUE,label:{color:$t}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:Ot.ORANGE,stroke:Ft.ORANGE,label:{color:$t}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:Ot.GRAY,stroke:Ft.GRAY,label:{color:$t}}}getTemplateParameters(){const t=new Map;t.set(Bt,e.getAxisDefaults()),t.set(Vt,e.getAxisDefaults().line),t.set(Ht,e.getAxisDefaults().tick),t.set(Ut,e.getAxisDefaults().gridLine),t.set(zt,e.getSeriesDefaults()),t.set(Wt,e.getCartesianSeriesMarkerDefaults());const i=new Map;return i.set(Gt,!1),i.set(jt,"Verdana, sans-serif"),i.set($t,"rgb(70, 70, 70)"),i.set(Kt,"white"),i.set(qt,"rgb(140, 140, 140)"),i.set(Xt,"rgb(224,234,241)"),i.set(Zt,"rgb(195, 195, 195)"),i.set(Qt,"rgb(70, 70, 70)"),i.set(Yt,pi),i.set(Jt,pi),i.set(ei,"rgba(0, 0, 0, 0.5)"),i.set(ai,[Ot.ORANGE,Ot.YELLOW,Ot.GREEN]),i.set(li,["#ffffff","#e0e5ea","#c1ccd5","#a3b4c1","#859cad"]),i.set(ci,["#ffffff","#c5cbd1","#a4b1bd","#8498a9","#648096"]),i.set(oi,pi),i.set(ti,e.getDefaultColors()),i.set(ii,e.getWaterfallSeriesDefaultPositiveColors()),i.set(ni,e.getWaterfallSeriesDefaultNegativeColors()),i.set(si,e.getWaterfallSeriesDefaultTotalColors()),i.set(ri,e.getWaterfallSeriesDefaultTotalColors().stroke),i.set(hi,Ft.BLUE),i.set(ui,Ot.BLUE),i.set(di,pi),{extensions:t,properties:i}}};yi.cartesianAxisDefault={number:yi.getAxisDefaults({line:{enabled:!1}}),log:yi.getAxisDefaults({base:10,line:{enabled:!1}}),category:yi.getAxisDefaults({groupPaddingInner:.1,label:{autoRotate:!0},gridLine:{enabled:!1}}),time:yi.getAxisDefaults({gridLine:{enabled:!1}}),"grouped-category":yi.getAxisDefaults()};var vi=yi,bi="#192232",Ci={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},wi={BLUE:"#74a8e6",ORANGE:"#ffbe70",GREEN:"#6cb176",CYAN:"#75d4ef",YELLOW:"#f6e559",VIOLET:"#aa86d8",GRAY:"#a1a1a1",MAGENTA:"#ce7ab9",BROWN:"#997b52",RED:"#ff7872"},Si={fills:Object.values(Ci),strokes:Object.values(wi)},xi=class e extends vi{static getDefaultColors(){return{fills:Ci,strokes:wi}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:Ci.BLUE,stroke:wi.BLUE,label:{color:"white"}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:Ci.ORANGE,stroke:wi.ORANGE,label:{color:"white"}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:Ci.GRAY,stroke:wi.GRAY,label:{color:"white"}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.properties.set(Gt,!0),t.properties.set(ti,e.getDefaultColors()),t.properties.set(ii,e.getWaterfallSeriesDefaultPositiveColors()),t.properties.set(ni,e.getWaterfallSeriesDefaultNegativeColors()),t.properties.set(si,e.getWaterfallSeriesDefaultTotalColors()),t.properties.set(ri,e.getWaterfallSeriesDefaultTotalColors().stroke),t.properties.set(oi,bi),t.properties.set($t,"white"),t.properties.set(qt,"#7D91A0"),t.properties.set(Xt,"#545A6E"),t.properties.set(Qt,"white"),t.properties.set(ai,[Ci.ORANGE,Ci.YELLOW,Ci.GREEN]),t.properties.set(li,["#192834","#253746","#324859","#3f596c","#4d6a80"]),t.properties.set(ci,["#192834","#3b5164","#496275","#577287","#668399"]),t.properties.set(Jt,bi),t.properties.set(Yt,bi),t.properties.set(hi,wi.BLUE),t.properties.set(ui,Ci.BLUE),t.properties.set(di,bi),t}getPalette(){return Si}constructor(e){super(e)}},Ei={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},Ai={BLUE:"#90CAF9",ORANGE:"#FFCC80",GREEN:"#A5D6A7",CYAN:"#80DEEA",YELLOW:"#FFF9C4",VIOLET:"#B39DDB",GRAY:"#E0E0E0",MAGENTA:"#F48FB1",BROWN:"#A1887F",RED:"#EF9A9A"},Mi={fills:Object.values(Ei),strokes:Object.values(Ai)},Ti=class e extends xi{static getDefaultColors(){return{fills:Ei,strokes:Ai}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:Ei.BLUE,stroke:Ai.BLUE,label:{color:"white"}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:Ei.RED,stroke:Ai.RED,label:{color:"white"}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:Ei.GRAY,stroke:Ai.GRAY,label:{color:"white"}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.properties.set(ti,e.getDefaultColors()),t.properties.set(ii,e.getWaterfallSeriesDefaultPositiveColors()),t.properties.set(ni,e.getWaterfallSeriesDefaultNegativeColors()),t.properties.set(si,e.getWaterfallSeriesDefaultTotalColors()),t.properties.set(ai,[Ei.ORANGE,Ei.YELLOW,Ei.GREEN]),t.properties.set(ri,e.getWaterfallSeriesDefaultTotalColors().stroke),t.properties.set(hi,Ai.BLUE),t.properties.set(ui,Ei.BLUE),t}getPalette(){return Mi}},Di={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},Ii={BLUE:"#1565C0",ORANGE:"#E65100",GREEN:"#2E7D32",CYAN:"#00838F",YELLOW:"#F9A825",VIOLET:"#4527A0",GRAY:"#616161",MAGENTA:"#C2185B",BROWN:"#4E342E",RED:"#B71C1C"},Ri={fills:Object.values(Di),strokes:Object.values(Ii)},ki=class e extends vi{static getDefaultColors(){return{fills:Di,strokes:Ii}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:Di.BLUE,stroke:Ii.BLUE,label:{color:$t}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:Di.RED,stroke:Ii.RED,label:{color:$t}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:Di.GRAY,stroke:Ii.GRAY,label:{color:$t}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.properties.set(ti,e.getDefaultColors()),t.properties.set(ii,e.getWaterfallSeriesDefaultPositiveColors()),t.properties.set(ni,e.getWaterfallSeriesDefaultNegativeColors()),t.properties.set(si,e.getWaterfallSeriesDefaultTotalColors()),t.properties.set(ai,[Di.ORANGE,Di.YELLOW,Di.GREEN]),t.properties.set(ri,e.getWaterfallSeriesDefaultTotalColors().stroke),t.properties.set(hi,Ii.BLUE),t.properties.set(ui,Di.BLUE),t}getPalette(){return Ri}},Pi={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4"},_i={BLUE:"#6698ff",PURPLE:"#c0a3ff",MAGENTA:"#fc8dfc",PINK:"#ff82b1",RED:"#ff9b70",ORANGE:"#ffcf4e",YELLOW:"#ffff58",GREEN:"#58dd70",CYAN:"#51e2c9",MODERATE_BLUE:"#4fd7ff"},Li={fills:Object.values(Pi),strokes:Object.values(_i)},Ni=class e extends xi{static getDefaultColors(){return{fills:Pi,strokes:_i}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:Pi.BLUE,stroke:_i.BLUE,label:{color:"white"}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:Pi.RED,stroke:_i.RED,label:{color:"white"}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:"#bbbbbb",stroke:"#eeeeee",label:{color:"white"}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.properties.set(ti,e.getDefaultColors()),t.properties.set(ii,e.getWaterfallSeriesDefaultPositiveColors()),t.properties.set(ni,e.getWaterfallSeriesDefaultNegativeColors()),t.properties.set(si,e.getWaterfallSeriesDefaultTotalColors()),t.properties.set(ai,[Pi.BLUE,Pi.RED]),t.properties.set(ri,e.getWaterfallSeriesDefaultTotalColors().stroke),t.properties.set(hi,_i.BLUE),t.properties.set(ui,Pi.BLUE),t}getPalette(){return Li}},Oi={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4"},Fi={BLUE:"#2346c9",PURPLE:"#7653d4",MAGENTA:"#a73da9",PINK:"#c32d66",RED:"#c84b1c",ORANGE:"#c87f00",YELLOW:"#c1b900",GREEN:"#008c1c",CYAN:"#00927c",MODERATE_BLUE:"#0087bb"},Gi={fills:Object.values(Oi),strokes:Object.values(Fi)},Bi=class e extends vi{static getDefaultColors(){return{fills:Oi,strokes:Fi}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:Oi.BLUE,stroke:Fi.BLUE,label:{color:$t}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:Oi.RED,stroke:Fi.RED,label:{color:$t}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:"#bbbbbb",stroke:"#888888",label:{color:$t}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.properties.set(ti,e.getDefaultColors()),t.properties.set(ii,e.getWaterfallSeriesDefaultPositiveColors()),t.properties.set(ni,e.getWaterfallSeriesDefaultNegativeColors()),t.properties.set(si,e.getWaterfallSeriesDefaultTotalColors()),t.properties.set(ai,[Oi.BLUE,Oi.RED]),t.properties.set(ri,e.getWaterfallSeriesDefaultTotalColors().stroke),t.properties.set(hi,Fi.BLUE),t.properties.set(ui,Oi.BLUE),t}getPalette(){return Gi}},Vi={BLUE:"#4472C4",ORANGE:"#ED7D31",GRAY:"#A5A5A5",YELLOW:"#FFC000",MODERATE_BLUE:"#5B9BD5",GREEN:"#70AD47",DARK_GRAY:"#7B7B7B",DARK_BLUE:"#264478",VERY_DARK_GRAY:"#636363",DARK_YELLOW:"#997300"},Hi={BLUE:"#6899ee",ORANGE:"#ffa55d",GRAY:"#cdcdcd",YELLOW:"#ffea53",MODERATE_BLUE:"#82c3ff",GREEN:"#96d56f",DARK_GRAY:"#a1a1a1",DARK_BLUE:"#47689f",VERY_DARK_GRAY:"#878787",DARK_YELLOW:"#c0993d"},Ui={fills:Object.values(Vi),strokes:Object.values(Hi)},zi=class e extends xi{static getDefaultColors(){return{fills:m(f({},Vi),{RED:Vi.ORANGE}),strokes:m(f({},Hi),{RED:Hi.ORANGE})}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:Vi.BLUE,stroke:Hi.BLUE,label:{color:"white"}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:Vi.ORANGE,stroke:Hi.ORANGE,label:{color:"white"}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:Vi.GRAY,stroke:Hi.GRAY,label:{color:"white"}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.properties.set(ti,e.getDefaultColors()),t.properties.set(ii,e.getWaterfallSeriesDefaultPositiveColors()),t.properties.set(ni,e.getWaterfallSeriesDefaultNegativeColors()),t.properties.set(si,e.getWaterfallSeriesDefaultTotalColors()),t.properties.set(ai,[Vi.ORANGE,Vi.YELLOW,Vi.GREEN]),t.properties.set(ri,e.getWaterfallSeriesDefaultTotalColors().stroke),t.properties.set(hi,Hi.BLUE),t.properties.set(ui,Vi.BLUE),t}getPalette(){return Ui}},Wi={BLUE:"#5281d5",ORANGE:"#ff8d44",GRAY:"#b5b5b5",YELLOW:"#ffd02f",MODERATE_BLUE:"#6aabe6",GREEN:"#7fbd57",DARK_GRAY:"#8a8a8a",DARK_BLUE:"#335287",VERY_DARK_GRAY:"#717171",DARK_YELLOW:"#a98220"},ji={BLUE:"#214d9b",ORANGE:"#c25600",GRAY:"#7f7f7f",YELLOW:"#d59800",MODERATE_BLUE:"#3575ac",GREEN:"#4b861a",DARK_GRAY:"#575757",DARK_BLUE:"#062253",VERY_DARK_GRAY:"#414141",DARK_YELLOW:"#734f00"},$i={fills:Object.values(Wi),strokes:Object.values(ji)},Ki=class e extends vi{static getDefaultColors(){return{fills:m(f({},Wi),{RED:Wi.ORANGE}),strokes:m(f({},ji),{RED:ji.ORANGE})}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:Wi.BLUE,stroke:ji.BLUE,label:{color:$t}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:Wi.ORANGE,stroke:ji.ORANGE,label:{color:$t}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:Wi.GRAY,stroke:ji.GRAY,label:{color:$t}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.properties.set(ti,e.getDefaultColors()),t.properties.set(ii,e.getWaterfallSeriesDefaultPositiveColors()),t.properties.set(ni,e.getWaterfallSeriesDefaultNegativeColors()),t.properties.set(si,e.getWaterfallSeriesDefaultTotalColors()),t.properties.set(ai,[Wi.ORANGE,Wi.YELLOW,Wi.GREEN]),t.properties.set(ri,e.getWaterfallSeriesDefaultTotalColors().stroke),t.properties.set(hi,ji.BLUE),t.properties.set(ui,Wi.BLUE),t}getPalette(){return $i}},Yi={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},qi={BLUE:"#67b7ff",ORANGE:"#ffc24d",GREEN:"#5cc86f",CYAN:"#54ebff",VIOLET:"#c18aff",YELLOW:"#fff653",GRAY:"#aeaeae",MAGENTA:"#f078d4",BROWN:"#ba8438",RED:"#ff726e"},Xi={fills:Object.values(Yi),strokes:Object.values(qi)},Zi=class e extends xi{static getDefaultColors(){return{fills:Yi,strokes:qi}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:Yi.BLUE,stroke:qi.BLUE,label:{color:"white"}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:Yi.ORANGE,stroke:qi.ORANGE,label:{color:"white"}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:Yi.GRAY,stroke:qi.GRAY,label:{color:"white"}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.properties.set(ti,e.getDefaultColors()),t.properties.set(ii,e.getWaterfallSeriesDefaultPositiveColors()),t.properties.set(ni,e.getWaterfallSeriesDefaultNegativeColors()),t.properties.set(si,e.getWaterfallSeriesDefaultTotalColors()),t.properties.set(ai,[Yi.ORANGE,Yi.YELLOW,Yi.GREEN]),t.properties.set(ri,e.getWaterfallSeriesDefaultTotalColors().stroke),t.properties.set(hi,qi.BLUE),t.properties.set(ui,Yi.BLUE),t}getPalette(){return Xi}},Qi={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},Ji={BLUE:"#0f68c0",ORANGE:"#d47100",GREEN:"#007922",CYAN:"#009ac2",VIOLET:"#bca400",YELLOW:"#753cac",GRAY:"#646464",MAGENTA:"#9b2685",BROWN:"#6c3b00",RED:"#cb0021"},en={fills:Object.values(Qi),strokes:Object.values(Ji)},tn=class e extends vi{static getDefaultColors(){return{fills:Qi,strokes:Ji}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:Qi.BLUE,stroke:Ji.BLUE,label:{color:$t}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:Qi.ORANGE,stroke:Ji.ORANGE,label:{color:$t}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:Qi.GRAY,stroke:Ji.GRAY,label:{color:$t}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.properties.set(ti,e.getDefaultColors()),t.properties.set(ii,e.getWaterfallSeriesDefaultPositiveColors()),t.properties.set(ni,e.getWaterfallSeriesDefaultNegativeColors()),t.properties.set(si,e.getWaterfallSeriesDefaultTotalColors()),t.properties.set(ai,[Qi.ORANGE,Qi.YELLOW,Qi.GREEN]),t.properties.set(ri,e.getWaterfallSeriesDefaultTotalColors().stroke),t.properties.set(hi,Ji.BLUE),t.properties.set(ui,Qi.BLUE),t}getPalette(){return en}},nn=()=>new vi,sn=()=>new xi,rn={undefined:nn,null:nn,"ag-default":nn,"ag-sheets":()=>new Ki,"ag-polychroma":()=>new Bi,"ag-vivid":()=>new tn,"ag-material":()=>new ki},on=f(f({},{undefined:sn,null:sn,"ag-default-dark":sn,"ag-sheets-dark":()=>new zi,"ag-polychroma-dark":()=>new Ni,"ag-vivid-dark":()=>new Zi,"ag-material-dark":()=>new Ti}),rn);function an(e){let t=function(e){return void 0===e||"string"==typeof e||e instanceof vi?e:"object"==typeof e?function(e){if(null===e)return;let t=!0;const{baseTheme:i,palette:n,overrides:s}=e;if(void 0!==i&&"string"!=typeof i&&"object"!=typeof i&&(L.warn(`invalid theme.baseTheme type ${typeof i}, expected (string | object).`),t=!1),void 0!==s&&"object"!=typeof s&&(L.warn(`invalid theme.overrides type ${typeof s}, expected object.`),t=!1),"object"==typeof n){if(null!==n){const{fills:e,strokes:i}=n;void 0===e||Array.isArray(e)||(L.warn("theme.overrides.fills must be undefined or an array"),t=!1),void 0===i||Array.isArray(i)||(L.warn("theme.overrides.strokes must be undefined or an array"),t=!1)}}else void 0!==n&&(L.warn(`invalid theme.palette type ${typeof n}, expected object.`),t=!1);return t?e:void 0}(e):void L.warn(`invalid theme value type ${typeof e}, expected object or string.`)}(e);if(t instanceof vi)return t;if(null==t||"string"==typeof t){const e=on[t];return e?e():(L.warnOnce(`the theme [${t}] is invalid, using [ag-default] instead.`),nn())}const i=[];let n;for(;"object"==typeof t;)i.push(t.overrides),null!=n||(n=t.palette),t=t.baseTheme;const s={baseTheme:t,overrides:qe(...i),palette:n};return new((s.baseTheme?an(s.baseTheme):nn()).constructor)(s)}function ln(e){if(0===e.length)return;let t=1/0,i=-1/0;for(let n of e)n instanceof Date&&(n=n.getTime()),"number"==typeof n&&(n<t&&(t=n),n>i&&(i=n));const n=[t,i];return n.every(isFinite)?n:void 0}function cn(e,t,i){return hn(e,t,i).extent}function hn(e,t,i){var n;let s=!1;return e.length>2&&(e=null!=(n=ln(e))?n:[NaN,NaN]),isNaN(t)||(s||(s=t>e[0]),e=[t,e[1]]),isNaN(i)||(s||(s=i<e[1]),e=[e[0],i]),e[0]>e[1]&&(e=[]),{extent:e,clipped:s}}function un(e,t){if(null==e||null==t||e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(Array.isArray(e[i])&&Array.isArray(t[i])){if(!un(e[i],t[i]))return!1}else if(e[i]!==t[i])return!1;return!0}function dn(e){return void 0===e?[]:Array.isArray(e)?e:[e]}function pn(e){return Array.from(new Set(e))}function gn(e,t){return e.reduce((e,i)=>{const n=t(i);return null!=e[n]||(e[n]=[]),e[n].push(i),e},{})}function fn(e,t,i=0){if(0===e.length)return[];const n=[];for(let s=0;s<t;s++)n.push(e.at((s+i)%e.length));return n}function mn(e,t){return t.reduce(([t,i],n)=>e(n)?[[...t,n],i]:[t,[...i,n]],[[],[]])}function*yn(e,t){for(const i of e)yield t(i)}function vn(e,t){return!t.some(t=>!function(e,t){return function(e,t){return e.includes(t)}(e,t)}(e,t))}var bn={},Cn=new WeakMap;function wn(e){var t;return e?null==(t=bn.document)?void 0:t[e]:bn.document}function Sn(e){var t;return e?null==(t=bn.window)?void 0:t[e]:bn.window}function xn(e,t,i){const n=wn().createElement(e);return"object"==typeof t&&(i=t,t=void 0),t&&n.classList.add(t),i&&Object.assign(n.style,i),n}function En(e,t){const{body:i}=wn(),n=xn("a",{display:"none"});n.href=e,n.download=t,i.appendChild(n),n.click(),setTimeout(()=>i.removeChild(n))}function An(e,t){var i,n;const s=wn();if(t&&(null==(i=Cn.get(s))?void 0:i.has(t)))return;const r=xn("style");r.innerHTML=e,s.head.insertBefore(r,s.head.querySelector("style")),t&&!Cn.has(s)?Cn.set(s,new Set([t])):t&&(null==(n=Cn.get(s))||n.add(t))}function Mn(e){bn.document=e}function Tn(e){bn.window=e}"undefined"!=typeof window?bn.window=window:"undefined"!=typeof globalThis&&(bn.window=globalThis.window),"undefined"!=typeof document?bn.document=document:"undefined"!=typeof globalThis&&(bn.document=globalThis.document);var Dn=Date.now(),In={create:(...e)=>Object.assign((...t)=>{In.check(...e)&&("function"==typeof t[0]&&(t=dn(t[0]())),(()=>{const e=Date.now()-Dn;if(e>2e3){const t=(Math.floor(e/100)/10).toFixed(1);L.log(`**** ${t}s since last log message ****`)}Dn=Date.now()})(),L.log(...t))},{check:()=>In.check(...e)}),check:(...e)=>(0===e.length&&e.push(!0),dn(Sn("agChartsDebug")).some(t=>e.includes(t)))},Rn=new Set(["map-shape-background","map-line-background"]),kn=class{constructor(e,t){var i,n;const s={shallow:["data"]},r=St(e,s),o=this.optionsType(r);this.sanityCheckAndCleanup(r),this.userOptions=r,this.activeTheme=an(r.theme),this.defaultAxes=this.getDefaultAxes(r),this.specialOverrides=this.specialOverridesDefaults(f({},t));const a=this.getSeriesThemeConfig(o),{axes:l={},annotations:c={},series:h}=a,u=y(a,["axes","annotations","series"]);this.processedOptions=St(qe(this.userOptions,u,this.defaultAxes),s),this.processAxesOptions(this.processedOptions,l),this.processSeriesOptions(this.processedOptions),this.processMiniChartSeriesOptions(this.processedOptions),this.processAnnotationsOptions(this.processedOptions,c),(dt(this.processedOptions)||function(e){const t=ut(e);return pt(e)&&"pie"!==t&&"donut"!==t}(this.processedOptions))&&null==(null==(i=this.processedOptions.legend)?void 0:i.enabled)&&(null!=(n=this.processedOptions).legend||(n.legend={}),this.processedOptions.legend.enabled=this.processedOptions.series.length>1),this.enableConfiguredOptions(this.processedOptions),Ce.isEnterprise||function(e){var t,i,n,s;const r=[],o=rt.get(ut(e));for(const{type:a,chartTypes:l,optionsKey:c,optionsInnerKey:h,identifier:u}of lt)if("unknown"===o||l.includes(o))if("root"===a||"legend"===a){const t=e[c];if(null==t)continue;h?t[h]&&(r.push(`${c}.${h}`),delete t[h]):(r.push(c),delete e[c])}else if("axis"===a){if(!("axes"in e)||!(null==(t=e.axes)?void 0:t.some(e=>e.type===u)))continue;r.push(`axis[type=${u}]`),e.axes=e.axes.filter(e=>e.type!==u)}else if("axis-option"===a){if(!("axes"in e)||!(null==(i=e.axes)?void 0:i.some(e=>e[c])))continue;r.push(`axis.${c}`),e.axes.forEach(e=>{e[c]&&delete e[c]})}else if("series"===a){if(!(null==(n=e.series)?void 0:n.some(e=>e.type===u)))continue;r.push(`series[type=${u}]`),e.series=e.series.filter(e=>e.type!==u)}else if("series-option"===a){if(!(null==(s=e.series)?void 0:s.some(e=>e[c])))continue;r.push(`series.${c}`),e.series.forEach(e=>{e[c]&&delete e[c]})}if(r.length){let t="ag-charts-enterprise",i="https://charts.ag-grid.com/javascript/installation/";"integrated"===e.mode&&(t="ag-grid-charts-enterprise' or 'ag-grid-enterprise/charts-enterprise",i="https://www.ag-grid.com/javascript-data-grid/integrated-charts-installation/"),L.warnOnce([`unable to use these enterprise features as '${t}' has not been loaded:`,"",...r,"",`See: ${i}`].join("\n"))}}(this.processedOptions)}getOptions(){var e;return null!=(e=this.processedOptions)?e:{}}diffOptions(e){return wt(e,this.processedOptions)}getSeriesThemeConfig(e){var t,i;return St(null!=(i=null==(t=this.activeTheme)?void 0:t.config[e])?i:{})}getDefaultAxes(e){const t=this.optionsType(e),i=Dt.cloneDefaultAxes(t);return Dt.isDefaultAxisSwapNeeded(e)&&this.swapAxesPosition(i),i}optionsType(e){var t,i,n;return null!=(n=null==(i=null==(t=e.series)?void 0:t[0])?void 0:i.type)?n:"line"}sanityCheckAndCleanup(e){var t;this.deprecationWarnings(e),this.axesTypeIntegrity(e),this.seriesTypeIntegrity(e),this.soloSeriesIntegrity(e),this.removeDisabledOptions(e),this.removeLeftoverSymbols(e),(null==(t=e.series)?void 0:t.some(e=>"bullet"===e.type))&&null!=e.sync&&!1!==e.sync.enabled&&(L.warnOnce("bullet series cannot be synced, disabling synchronization."),delete e.sync)}swapAxesPosition(e){var t;if(dt(e)){const[i,n]=null!=(t=e.axes)?t:[];e.axes=[m(f({},i),{position:n.position}),m(f({},n),{position:i.position})]}}processAxesOptions(e,t){"axes"in e&&(e.axes=e.axes.map(e=>{var i,n,s;const r=qe(null==(i=t[e.type])?void 0:i[e.position],t[e.type]),{crossLines:o}=r,a=y(r,["crossLines"]);e.crossLines&&(e.crossLines=Xe(e.crossLines,o));const l=null==(n=a.gridLine)?void 0:n.style;(null==(s=e.gridLine)?void 0:s.style)&&(null==l?void 0:l.length)&&(e.gridLine.style=e.gridLine.style.map((e,t)=>null!=e.stroke||null!=e.lineDash?qe(e,l.at(t%l.length)):e));const c=qe(e,a),{top:h,right:u,bottom:d,left:p}=c;return y(c,["top","right","bottom","left"])}))}processSeriesOptions(e){const t=this.getDefaultSeriesType(e),i=this.getTooltipPositionDefaults(e),n=Boolean(Ge(e.theme)&&e.theme.palette),s={colourIndex:0,userPalette:n},r=e.series.map(e=>{var r;null!=e.type||(e.type=t);const o=null!=(r=this.getSeriesThemeConfig(e.type).series)?r:{},{innerLabels:a}=o,l=y(o,["innerLabels"]),c=Rn.has(e.type)?{colourIndex:0,userPalette:n}:s,h=this.getSeriesPalette(e.type,c),u=qe(this.getSeriesGroupingOptions(e),e,i,l,h);return u.innerLabels&&(u.innerLabels=Xe(u.innerLabels,a)),this.activeTheme.templateTheme(u)});e.series=this.setSeriesGroupingOptions(r)}processMiniChartSeriesOptions(e){var t,i;let n=null==(i=null==(t=e.navigator)?void 0:t.miniChart)?void 0:i.series;if(null==n)return;const s={colourIndex:0,userPalette:Boolean(Ge(e.theme)&&e.theme.palette)};n=n.map(e=>{var t;null!=e.type||(e.type="line");const i=null!=(t=this.getSeriesThemeConfig(e.type).series)?t:{},{innerLabels:n}=i,r=y(i,["innerLabels"]),o=qe(this.getSeriesGroupingOptions(e),e,r,this.getSeriesPalette(e.type,s));return this.activeTheme.templateTheme(o)}),e.navigator.miniChart.series=this.setSeriesGroupingOptions(n)}processAnnotationsOptions(e,t){dt(e)}getSeriesPalette(e,t){const i=Dt.getPaletteFactory(e),{colourIndex:n,userPalette:s}=t,{fills:r=[],strokes:o=[]}=this.activeTheme.palette;return null==i?void 0:i({userPalette:s,colorsCount:Math.max(r.length,o.length),themeTemplateParameters:this.activeTheme.getTemplateParameters(),takeColors:e=>(t.colourIndex+=e,{fills:fn(r,e,n),strokes:fn(o,e,n)})})}getSeriesGroupingOptions(e){const t=Dt.isGroupable(e.type),i=Dt.isStackable(e.type),n=Dt.isStackedByDefault(e.type);e.grouped&&!t&&L.warnOnce(`unsupported grouping of series type "${e.type}".`),!e.stacked&&!e.stackGroup||i||L.warnOnce(`unsupported stacking of series type "${e.type}".`);let{grouped:s,stacked:r}=e;return null!=r||(r=(n||null!=e.stackGroup)&&!(t&&s)),null!=s||(s=!0),{stacked:i&&r,grouped:t&&s&&!(i&&r)}}setSeriesGroupingOptions(e){const t=this.getSeriesGrouping(e);In.create(!0,"opts")("setSeriesGroupingOptions() - series grouping: ",t);const i={},n=t.reduce((e,t)=>{var i;return"default"===t.groupType||(null!=e[i=t.seriesType]||(e[i]=0),e[t.seriesType]+="stack"===t.groupType?1:t.series.length),e},{});return t.flatMap(e=>{var t;switch(null!=i[t=e.seriesType]||(i[t]=0),e.groupType){case"stack":const t=i[e.seriesType]++;return e.series.map((i,s)=>Object.assign(i,{seriesGrouping:{groupIndex:t,groupCount:n[e.seriesType],stackIndex:s,stackCount:e.series.length}}));case"group":return e.series.map(t=>Object.assign(t,{seriesGrouping:{groupIndex:i[e.seriesType]++,groupCount:n[e.seriesType],stackIndex:0,stackCount:0}}))}return e.series}).map(e=>{var t=e,{stacked:i,grouped:n}=t;return y(t,["stacked","grouped"])})}getSeriesGroupId(e){var t;return[e.type,e.xKey,e.stacked?null!=(t=e.stackGroup)?t:"stacked":"grouped"].filter(Boolean).join("-")}getSeriesGrouping(e){const t=new Map;return e.reduce((e,i)=>{const n=i.type;if(i.stacked||i.grouped){const s=this.getSeriesGroupId(i);if(!t.has(s)){const r={groupType:i.stacked?"stack":"group",seriesType:n,series:[]};t.set(s,r),e.push(r)}t.get(s).series.push(i)}else e.push({groupType:"default",seriesType:n,series:[i]});return e},[])}getDefaultSeriesType(e){if(dt(e))return"line";if(pt(e))return"pie";if(gt(e))return"treemap";if(ft(e))return"map-shape";throw new Error("Invalid chart options type detected.")}getTooltipPositionDefaults(e){var t;const i=null==(t=e.tooltip)?void 0:t.position;if(!Ve(i))return;const{type:n,xOffset:s,yOffset:r}=i,o={};return He(n)&&$e(M,n)&&(o.type=n),ze(s)&&(o.xOffset=s),ze(r)&&(o.yOffset=r),{tooltip:{position:o}}}deprecationWarnings(e){Object.entries({yKeys:"yKey",yNames:"yName"}).forEach(([t,i])=>{var n;(null==(n=e.series)?void 0:n.some(e=>null!=e[t]))&&L.warnOnce(`Property [series.${t}] is deprecated, please use [series.${i}] and multiple series instead.`)})}axesTypeIntegrity(e){var t;if("axes"in e){const i=null!=(t=e.axes)?t:[];for(const{type:t}of i)if(!mt(t)){delete e.axes;const i=Array.from(xe.publicKeys()).join(", ");L.warnOnce(`unknown axis type: ${t}; expected one of: ${i}`)}}}seriesTypeIntegrity(e){var t;const i=null!=(t=e.series)?t:[];e.series=i.filter(({type:e})=>{if(null==e||null!=(t=e)&&rt.has(t)||function(e){return lt.some(t=>"series"===t.type&&t.identifier===e)}(e))return!0;var t;L.warnOnce(`unknown series type: ${e}; expected one of: ${ot.seriesTypes.join(", ")}`)})}soloSeriesIntegrity(e){const t=e.series;if(t&&t.length>1&&t.some(e=>Dt.isSolo(e.type))){const i=this.optionsType(e);if(Dt.isSolo(i))L.warn(`series[0] of type '${i}' is incompatible with other series types. Only processing series[0]`),e.series=t.slice(0,1);else{const{solo:i,nonSolo:n}=gn(t,e=>Dt.isSolo(e.type)?"solo":"nonSolo"),s=pn(i.map(e=>e.type)).join(", ");L.warn(`Unable to mix these series types with the lead series type: ${s}`),e.series=n}}}enableConfiguredOptions(e){Et(this.userOptions,(e,t)=>{t&&"enabled"in t&&!t._enabledFromTheme&&null==e.enabled&&(t.enabled=!0)},{skip:["data","theme"]},e),Et(e,e=>{null!=e._enabledFromTheme&&delete e._enabledFromTheme},{skip:["data","theme"]})}removeDisabledOptions(e){Et(e,e=>{"enabled"in e&&!1===e.enabled&&Object.keys(e).forEach(t=>{"enabled"!==t&&delete e[t]})},{skip:["data","theme"]})}removeLeftoverSymbols(e){Et(e,e=>{if(e&&Ge(e))for(const[t,i]of Object.entries(e))Ke(i)&&delete e[t]},{skip:["data"]})}specialOverridesDefaults(e){if(null!=e.window?Tn(e.window):"undefined"!=typeof window?e.window=window:"undefined"!=typeof globalThis&&(e.window=globalThis.window),null!=e.document?Mn(e.document):"undefined"!=typeof document?e.document=document:"undefined"!=typeof globalThis&&(e.document=globalThis.document),null==e.window)throw new Error("AG Charts - unable to resolve global window");if(null==e.document)throw new Error("AG Charts - unable to resolve global document");return e}};function Pn(){return(e,t)=>{const i=[`Property [${e}] is deprecated.`,t].filter(Boolean).join(" ");L.warnOnce(i)}}function _n(e,t){const i=Pn(),n=null==t?void 0:t.default;return Te((t,s,r)=>(r!==n&&i(s.toString(),e),r))}function Ln(e,t){const i=Pn();return Te((n,s,r)=>(r!==n[e]&&(i(s.toString(),`Use [${e}] instead.`),tt(n,e,t?t(r):r)),Ee),(t,n)=>(i(n.toString(),`Use [${e}] instead.`),Je(t,e)))}var Nn={};v(Nn,{NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>Is,fromToMotion:()=>Rs,staticFromToMotion:()=>ks});var On=new Map;function Fn(){On.clear()}function Gn(e){var t;const i=e.constructor,n=Object.hasOwn(i,"className")?i.className:i.name;if(!n)throw new Error(`The ${i} is missing the 'className' property.`);const s=(null!=(t=On.get(n))?t:0)+1;return On.set(n,s),`${n}-${s}`}var Bn="$interpolate",Vn=e=>null!=e[Bn];function Hn(e,t,i){return Math.min(i,Math.max(e,t))}function Un(e,t){const[i,n]=zn(t);return Hn(i,e,n)}function zn(e){return e.length?[Math.min(...e),Math.max(...e)]:[]}function Wn(e){const[t,i]=zn(e);return i-t}function jn(e,t,i=1e-10){return Math.abs(e-t)<i}function $n(e){return-1===Math.sign(e)||Object.is(e,-0)}function Kn(e,t=2){const i=p(10,t);return Math.round(e*i)/i}function Yn(e,t=2){const i=Math.floor(Math.log(Math.abs(e))/Math.LN10);return i>=0||!isFinite(i)?e.toFixed(t):e.toFixed(Math.abs(i)-1+t)}function qn(e,t){return Math.floor(e%t+(e<0?t:0))}function Xn(e,t=10){const[,i=""]=(Math.abs(e)%1).toLocaleString("en-GB",{minimumFractionDigits:0,maximumFractionDigits:t}).split(".");return i.length}function Zn(e,t,i,n=1/0){const s={nearest:void 0,distanceSquared:n};for(const n of i){const i=n.distanceSquared(e,t);if(0===i)return{nearest:n,distanceSquared:0};i<s.distanceSquared&&(s.nearest=n,s.distanceSquared=i)}return s}function Qn(e,t,i,n=1/0){const{x:s,y:r}=i.transformPoint(e,t),o={nearest:void 0,distanceSquared:n};for(const e of i.children){const{nearest:t,distanceSquared:i}=e.nearestSquared(s,r,o.distanceSquared);if(0===i)return{nearest:t,distanceSquared:i};i<o.distanceSquared&&(o.nearest=t,o.distanceSquared=i)}return o}var Jn=class e{constructor(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n}clone(){const{x:t,y:i,width:n,height:s}=this;return new e(t,i,n,s)}equals(e){return this.x===e.x&&this.y===e.y&&this.width===e.width&&this.height===e.height}containsPoint(e,t){return e>=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height}collidesBBox(e){return this.x<e.x+e.width&&this.x+this.width>e.x&&this.y<e.y+e.height&&this.y+this.height>e.y}computeCenter(){return{x:this.x+this.width/2,y:this.y+this.height/2}}isFinite(){return Number.isFinite(this.x)&&Number.isFinite(this.y)&&Number.isFinite(this.width)&&Number.isFinite(this.height)}distanceSquared(e,t){if(this.containsPoint(e,t))return 0;const i=e-Hn(this.x,e,this.x+this.width),n=t-Hn(this.y,t,this.y+this.height);return i*i+n*n}static nearestBox(e,t,i){return Zn(e,t,i)}clip(e){if(void 0===e)return this;const t=Math.max(this.x,e.x),i=Math.max(this.y,e.y),n=Math.min(this.x+this.width,e.x+e.width),s=Math.min(this.y+this.height,e.y+e.height);return this.x=t,this.y=i,this.width=Math.max(0,n-t),this.height=Math.max(0,s-i),this}shrink(e,t){const i=(e,t)=>{switch(e){case"top":this.y+=t;case"bottom":this.height-=t;break;case"left":this.x+=t;case"right":this.width-=t;break;case"vertical":this.y+=t,this.height-=2*t;break;case"horizontal":this.x+=t,this.width-=2*t;break;case void 0:this.x+=t,this.width-=2*t,this.y+=t,this.height-=2*t}};return"number"==typeof e?i(t,e):"object"==typeof e&&Object.entries(e).forEach(([e,t])=>i(e,t)),this}grow(e,t){if("number"==typeof e)this.shrink(-e,t);else{const t=f({},e);for(const e in t)t[e]*=-1;this.shrink(t)}return this}combine(e){const{x:t,y:i,width:n,height:s}=this;this.x=Math.min(t,e.x),this.y=Math.min(i,e.y),this.width=Math.max(t+n,e.x+e.width)-this.x,this.height=Math.max(i+s,e.y+e.height)-this.y}static merge(t){let i=1/0,n=1/0,s=-1/0,r=-1/0;for(const e of t)e.x<i&&(i=e.x),e.y<n&&(n=e.y),e.x+e.width>s&&(s=e.x+e.width),e.y+e.height>r&&(r=e.y+e.height);return new e(i,n,s-i,r-n)}[Bn](t,i){return new e(this.x*(1-i)+t.x*i,this.y*(1-i)+t.y*i,this.width*(1-i)+t.width*i,this.height*(1-i)+t.height*i)}};Jn.zero=new Jn(0,0,0,0),Jn.NaN=new Jn(NaN,NaN,NaN,NaN);var es=Jn,ts=(e=>(e[e.NONE=0]="NONE",e[e.TRIVIAL=1]="TRIVIAL",e[e.MINOR=2]="MINOR",e[e.MAJOR=3]="MAJOR",e))(ts||{}),is=function(){try{return new Function("return true"),!0}catch(e){return!1}}();function ns(e){const{changeCb:t,convertor:i}=null!=e?e:{};return function(n,s){const r=`__${s}`;n[s]||(is&&null==t&&null==i?function(e,t,i,n){const{redraw:s=1,type:r="normal",checkDirtyOnAssignment:o=!1}=null!=n?n:{},a=new Function("value",`\n        const oldValue = this.${i};\n        if (value !== oldValue) {\n            this.${i} = value;\n            ${"normal"===r?`this.markDirty(this, ${s});`:""}\n            ${"transform"===r?`this.markDirtyTransform(${s});`:""}\n            ${"path"===r?`if (!this._dirtyPath) { this._dirtyPath = true; this.markDirty(this, ${s}); }`:""}\n            ${"font"===r?`if (!this._dirtyFont) { this._dirtyFont = true; this.markDirty(this, ${s}); }`:""}\n        }\n        ${o?"if (value != null && value._dirty > 0) { this.markDirty(value, value._dirty); }":""}\n`),l=new Function(`return this.${i};`);Object.defineProperty(e,t,{set:a,get:l,enumerable:!0,configurable:!0})}(n,s,r,e):function(e,t,i,n){const{redraw:s=1,type:r="normal",changeCb:o,convertor:a,checkDirtyOnAssignment:l=!1}=null!=n?n:{};Object.defineProperty(e,t,{set:function(e){const t=this[i];(e=a?a(e):e)!==t&&(this[i]=e,"normal"===r&&this.markDirty(this,s),"transform"===r&&this.markDirtyTransform(s),"path"!==r||this._dirtyPath||(this._dirtyPath=!0,this.markDirty(this,s)),"font"!==r||this._dirtyFont||(this._dirtyFont=!0,this.markDirty(this,s)),null==o||o(this)),l&&null!=e&&e._dirty>0&&this.markDirty(e,e._dirty)},get:function(){return this[i]},enumerable:!0,configurable:!0})}(n,s,r,e))}}var ss=class{constructor(){this._dirty=3}markDirty(e,t=1){this._dirty<t&&(this._dirty=t)}markClean(e){this._dirty=0}isDirty(){return this._dirty>0}},rs=class e{get e(){return[...this.elements]}constructor(e=[1,0,0,1,0,0]){this.elements=e}setElements(e){const t=this.elements;return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],this}get identity(){const e=this.elements;return 1===e[0]&&0===e[1]&&0===e[2]&&1===e[3]&&0===e[4]&&0===e[5]}AxB(e,t,i){const n=e[0]*t[0]+e[2]*t[1],s=e[1]*t[0]+e[3]*t[1],r=e[0]*t[2]+e[2]*t[3],o=e[1]*t[2]+e[3]*t[3],a=e[0]*t[4]+e[2]*t[5]+e[4],l=e[1]*t[4]+e[3]*t[5]+e[5];(i=null!=i?i:e)[0]=n,i[1]=s,i[2]=r,i[3]=o,i[4]=a,i[5]=l}multiplySelf(e){return this.AxB(this.elements,e.elements),this}multiply(t){const i=new Array(6);return this.AxB(this.elements,t.elements,i),new e(i)}preMultiplySelf(e){return this.AxB(e.elements,this.elements,this.elements),this}inverse(){const t=this.elements;let i=t[0],n=t[1],s=t[2],r=t[3];const o=t[4],a=t[5],l=1/(i*r-n*s);return i*=l,n*=l,s*=l,r*=l,new e([r,-n,-s,i,s*a-r*o,n*o-i*a])}inverseTo(e){const t=this.elements;let i=t[0],n=t[1],s=t[2],r=t[3];const o=t[4],a=t[5],l=1/(i*r-n*s);return i*=l,n*=l,s*=l,r*=l,e.setElements([r,-n,-s,i,s*a-r*o,n*o-i*a]),this}invertSelf(){const e=this.elements;let t=e[0],i=e[1],n=e[2],s=e[3];const r=e[4],o=e[5],a=1/(t*s-i*n);return t*=a,i*=a,n*=a,s*=a,e[0]=s,e[1]=-i,e[2]=-n,e[3]=t,e[4]=n*o-s*r,e[5]=i*r-t*o,this}transformPoint(e,t){const i=this.elements;return{x:e*i[0]+t*i[2]+i[4],y:e*i[1]+t*i[3]+i[5]}}transformBBox(e,t){const i=this.elements,n=i[0],s=i[1],r=i[2],o=i[3],a=.5*e.width,l=.5*e.height,c=e.x+a,h=e.y+l,u=Math.abs(a*n)+Math.abs(l*r),d=Math.abs(a*s)+Math.abs(l*o);return t||(t=new es(0,0,0,0)),t.x=c*n+h*r+i[4]-u,t.y=c*s+h*o+i[5]-d,t.width=u+u,t.height=d+d,t}toContext(e){if(this.identity)return;const t=this.elements;e.transform(t[0],t[1],t[2],t[3],t[4],t[5])}static flyweight(t){return e.instance.setElements(t.elements)}static updateTransformMatrix(e,t,i,n,s,r,o){const[a,l]=[0,0],c=t,h=i;let u,d;1===c&&1===h?(u=0,d=0):(u=null==(null==o?void 0:o.scalingCenterX)?a:null==o?void 0:o.scalingCenterX,d=null==(null==o?void 0:o.scalingCenterY)?l:null==o?void 0:o.scalingCenterY);const p=n,g=Math.cos(p),f=Math.sin(p);let m,y;0===p?(m=0,y=0):(m=null==(null==o?void 0:o.rotationCenterX)?a:null==o?void 0:o.rotationCenterX,y=null==(null==o?void 0:o.rotationCenterY)?l:null==o?void 0:o.rotationCenterY);const v=s,b=r,C=u*(1-c)-m,w=d*(1-h)-y;return e.setElements([g*c,f*c,-f*h,g*h,g*C-f*w+m+v,f*C+g*w+y+b]),e}static fromContext(t){const i=t.getTransform();return new e([i.a,i.b,i.c,i.d,i.e,i.f])}};rs.instance=new rs;var os=rs,as=(e=>(e[e.All=0]="All",e[e.None=1]="None",e))(as||{}),ls=class e extends ss{constructor({isVirtual:t,tag:i,zIndex:n}={}){super(),this.serialNumber=e._nextSerialNumber++,this.id=Gn(this),this.isContainerNode=!1,this._virtualChildren=[],this._children=[],this.childSet={},this.matrix=new os,this.dirtyTransform=!1,this.scalingX=1,this.scalingY=1,this.scalingCenterX=null,this.scalingCenterY=null,this.rotationCenterX=null,this.rotationCenterY=null,this.rotation=0,this.translationX=0,this.translationY=0,this._childNodeCounts={groups:0,nonGroups:0},this.visible=!0,this.dirtyZIndex=!1,this.zIndex=0,this.zIndexSubOrder=void 0,this.pointerEvents=0,this.isVirtual=null!=t&&t,this.tag=null!=i?i:NaN,this.zIndex=null!=n?n:0}get datum(){var e,t;return null!=(t=this._datum)?t:null==(e=this._parent)?void 0:e.datum}get previousDatum(){return this._previousDatum}set datum(e){this._datum!==e&&(this._previousDatum=this._datum),this._datum=e}_setLayerManager(e){this._layerManager=e,this._debug=null==e?void 0:e.debug;for(const t of this._children)t._setLayerManager(e);for(const t of this._virtualChildren)t._setLayerManager(e)}get layerManager(){return this._layerManager}*ancestors(){let e=this;for(;e=e.parent;)yield e}*traverseUp(){yield this,yield*x(this.ancestors())}get parent(){return this._parent}get children(){return this._virtualChildren.length?this._children.concat(this._virtualChildren.flatMap(e=>e.children)):this._children}get virtualChildren(){return this._virtualChildren}hasVirtualChildren(){return this._virtualChildren.length>0}setProperties(e,t){const i=null!=t?t:Object.keys(e);for(const t of i)this[t]=e[t];return this}append(e){Array.isArray(e)||(e=[e]);for(const t of e){if(t.parent)throw new Error(`${t} already belongs to another parent: ${t.parent}.`);if(t.layerManager)throw new Error(`${t} already belongs to a scene: ${t.layerManager}.`);if(this.childSet[t.id])throw new Error(`Duplicate ${t.constructor.name} node: ${t}`);t.isVirtual?this._virtualChildren.push(t):this._children.push(t),this.childSet[t.id]=!0,t._parent=this,t._setLayerManager(this.layerManager)}this.dirtyZIndex=!0,this.markDirty(this,3)}appendChild(e){return this.append(e),e}removeChild(e){const t=()=>{throw new Error("The node to be removed is not a child of this node.")};if(e.parent!==this&&t(),e.isVirtual){const i=this._virtualChildren.indexOf(e);i<0&&t(),this._virtualChildren.splice(i,1)}else{const i=this._children.indexOf(e);i<0&&t(),this._children.splice(i,1)}return delete this.childSet[e.id],e._parent=void 0,e._setLayerManager(),this.dirtyZIndex=!0,this.markDirty(e,3),e}calculateCumulativeMatrix(){this.computeTransformMatrix();const e=os.flyweight(this.matrix);for(const t of this.ancestors())t.computeTransformMatrix(),e.preMultiplySelf(t.matrix);return e}transformPoint(e,t){return this.calculateCumulativeMatrix().invertSelf().transformPoint(e,t)}inverseTransformPoint(e,t){return this.calculateCumulativeMatrix().transformPoint(e,t)}transformBBox(e){return this.calculateCumulativeMatrix().invertSelf().transformBBox(e)}inverseTransformBBox(e){return this.calculateCumulativeMatrix().transformBBox(e)}markDirtyTransform(){this.dirtyTransform=!0,this.markDirty(this,3)}containsPoint(e,t){return!1}pickNode(e,t){var i;if(!this.visible||1===this.pointerEvents||!this.containsPoint(e,t))return;const{children:n}=this;if(n.length>1e3)for(let s=n.length-1;s>=0;s--){const r=n[s],o=(null==(i=r.computeTransformedBBox())?void 0:i.containsPoint(e,t))?r.pickNode(e,t):void 0;if(o)return o}else if(n.length)for(let i=n.length-1;i>=0;i--){const s=n[i].pickNode(e,t);if(s)return s}else if(!this.isContainerNode)return this}getCachedBBox(){var e;return null!=(e=this.cachedBBox)?e:es.zero}computeBBox(){}computeTransformedBBox(){const e=this.computeBBox();if(!e)return;this.computeTransformMatrix();const t=os.flyweight(this.matrix);for(const e of this.ancestors())e.computeTransformMatrix(),t.preMultiplySelf(e.matrix);return t.transformBBox(e,e),e}computeTransformMatrix(){if(!this.dirtyTransform)return;const{matrix:e,scalingX:t,scalingY:i,rotation:n,translationX:s,translationY:r,scalingCenterX:o,scalingCenterY:a,rotationCenterX:l,rotationCenterY:c}=this;os.updateTransformMatrix(e,t,i,n,s,r,{scalingCenterX:o,scalingCenterY:a,rotationCenterX:l,rotationCenterY:c}),this.dirtyTransform=!1}preRender(){this._childNodeCounts.groups=0,this._childNodeCounts.nonGroups=1;for(const e of this.children){const t=e.preRender();this._childNodeCounts.groups+=t.groups,this._childNodeCounts.nonGroups+=t.nonGroups}return this._childNodeCounts}render(e){const{stats:t}=e;this._dirty=0,this.cachedBBox=this.computeBBox(),t&&t.nodesRendered++}markDirty(e,t=1,i=t){this._dirty>t||this._dirty===t&&t===i||(this._dirty=t,this.parent?this.parent.markDirty(this,i):this.layerManager&&this.layerManager.markDirty())}get dirty(){return this._dirty}markClean(e){const{force:t=!1,recursive:i=!0}=null!=e?e:{};if(0!==this._dirty||t){if(this._dirty=0,!1!==i)for(const e of this._virtualChildren)e.markClean({force:t});if(!0===i)for(const e of this._children)e.markClean({force:t})}}onVisibleChange(){}get nodeCount(){let e=1,t=this._dirty>=0||this.dirtyTransform?1:0,i=this.visible?1:0;const n=n=>{const{count:s,visibleCount:r,dirtyCount:o}=n.nodeCount;e+=s,i+=r,t+=o};for(const e of this._children)n(e);for(const e of this._virtualChildren)n(e);return{count:e,visibleCount:i,dirtyCount:t}}onZIndexChange(){this.parent&&(this.parent.dirtyZIndex=!0)}};ls._nextSerialNumber=0,b([ns({type:"transform"})],ls.prototype,"scalingX",2),b([ns({type:"transform"})],ls.prototype,"scalingY",2),b([ns({type:"transform"})],ls.prototype,"scalingCenterX",2),b([ns({type:"transform"})],ls.prototype,"scalingCenterY",2),b([ns({type:"transform"})],ls.prototype,"rotationCenterX",2),b([ns({type:"transform"})],ls.prototype,"rotationCenterY",2),b([ns({type:"transform"})],ls.prototype,"rotation",2),b([ns({type:"transform"})],ls.prototype,"translationX",2),b([ns({type:"transform"})],ls.prototype,"translationY",2),b([ns({redraw:3,changeCb:e=>e.onVisibleChange()})],ls.prototype,"visible",2),b([ns({redraw:1,changeCb:e=>e.onZIndexChange()})],ls.prototype,"zIndex",2),b([ns({redraw:1,changeCb:e=>e.onZIndexChange()})],ls.prototype,"zIndexSubOrder",2);var cs=ls,hs=e=>{const t=e<0?-1:1,i=Math.abs(e);return i<=.04045?e/12.92:t*p((i+.055)/1.055,2.4)},us=e=>{const t=e<0?-1:1,i=Math.abs(e);return i>.0031308?t*(1.055*p(i,1/2.4)-.055):12.92*e},ds=class e{constructor(e,t,i,n=1){this.r=Hn(0,e||0,1),this.g=Hn(0,t||0,1),this.b=Hn(0,i||0,1),this.a=Hn(0,n||0,1)}static validColorString(t){return t.indexOf("#")>=0?!!e.parseHex(t):t.indexOf("rgb")>=0?!!e.stringToRgba(t):!!e.nameToHex[t.toLowerCase()]}static fromString(t){if(t.indexOf("#")>=0)return e.fromHexString(t);const i=e.nameToHex[t.toLowerCase()];if(i)return e.fromHexString(i);if(t.indexOf("rgb")>=0)return e.fromRgbaString(t);throw new Error(`Invalid color string: '${t}'`)}static tryParseFromString(t){try{return e.fromString(t)}catch(i){return L.warnOnce(`invalid color string: '${t}'.`),e.fromArray([0,0,0])}}static parseHex(e){let t;switch((e=e.replace(/ /g,"").slice(1)).length){case 6:case 8:t=[];for(let i=0;i<e.length;i+=2)t.push(parseInt(`${e[i]}${e[i+1]}`,16));break;case 3:case 4:t=e.split("").map(e=>parseInt(e,16)).map(e=>e+16*e)}if((null==t?void 0:t.length)>=3&&t.every(e=>e>=0))return 3===t.length&&t.push(255),t}static fromHexString(t){const i=e.parseHex(t);if(i){const[t,n,s,r]=i;return new e(t/255,n/255,s/255,r/255)}throw new Error(`Malformed hexadecimal color string: '${t}'`)}static stringToRgba(e){let[t,i]=[NaN,NaN];for(let n=0;n<e.length;n++){const s=e[n];if(t||"("!==s){if(")"===s){i=n;break}}else t=n}const n=t&&i&&e.substring(t+1,i);if(!n)return;const s=n.split(","),r=[];for(let e=0;e<s.length;e++){const t=s[e];let i=parseFloat(t);if(isNaN(i))return;t.indexOf("%")>=0?(i=Hn(0,i,100),i/=100):3===e?i=Hn(0,i,1):(i=Hn(0,i,255),i/=255),r.push(i)}return r}static fromRgbaString(t){const i=e.stringToRgba(t);if(i){if(3===i.length)return new e(i[0],i[1],i[2]);if(4===i.length)return new e(i[0],i[1],i[2],i[3])}throw new Error(`Malformed rgb/rgba color string: '${t}'`)}static fromArray(t){if(4===t.length)return new e(t[0],t[1],t[2],t[3]);if(3===t.length)return new e(t[0],t[1],t[2]);throw new Error("The given array should contain 3 or 4 color components (numbers).")}static fromHSB(t,i,n,s=1){const r=e.HSBtoRGB(t,i,n);return new e(r[0],r[1],r[2],s)}static fromHSL(t,i,n,s=1){const r=e.HSLtoRGB(t,i,n);return new e(r[0],r[1],r[2],s)}static fromOKLCH(t,i,n,s=1){const r=e.OKLCHtoRGB(t,i,n);return new e(r[0],r[1],r[2],s)}static padHex(e){return 1===e.length?"0"+e:e}toHexString(){let t="#"+e.padHex(Math.round(255*this.r).toString(16))+e.padHex(Math.round(255*this.g).toString(16))+e.padHex(Math.round(255*this.b).toString(16));return this.a<1&&(t+=e.padHex(Math.round(255*this.a).toString(16))),t}toRgbaString(e=3){const t=[Math.round(255*this.r),Math.round(255*this.g),Math.round(255*this.b)],i=Math.pow(10,e);return 1!==this.a?(t.push(Math.round(this.a*i)/i),`rgba(${t.join(", ")})`):`rgb(${t.join(", ")})`}toString(){return 1===this.a?this.toHexString():this.toRgbaString()}toHSB(){return e.RGBtoHSB(this.r,this.g,this.b)}static RGBtoOKLCH(e,t,i){const n=hs(e),s=hs(t),r=hs(i),o=Math.cbrt(.4122214708*n+.5363325363*s+.0514459929*r),a=Math.cbrt(.2119034982*n+.6806995451*s+.1073969566*r),l=Math.cbrt(.0883024619*n+.2817188376*s+.6299787005*r),c=.2104542553*o+.793617785*a-.0040720468*l,h=1.9779984951*o-2.428592205*a+.4505937099*l,u=.0259040371*o+.7827717662*a-.808675766*l,d=180*Math.atan2(u,h)/Math.PI;return[c,Math.hypot(h,u),d>=0?d:d+360]}static OKLCHtoRGB(e,t,i){const n=e,s=t*Math.cos(i*Math.PI/180),r=t*Math.sin(i*Math.PI/180),o=p(n+.3963377774*s+.2158037573*r,3),a=p(n-.1055613458*s-.0638541728*r,3),l=p(n-.0894841775*s-1.291485548*r,3),c=-1.2684380046*o+2.6097574011*a-.3413193965*l,h=-.0041960863*o-.7034186147*a+1.707614701*l;return[us(4.0767416621*o-3.3077115913*a+.2309699292*l),us(c),us(h)]}static RGBtoHSL(e,t,i){const n=Math.min(e,t,i),s=Math.max(e,t,i),r=(s+n)/2;let o,a;if(s===n)o=NaN,a=0;else{const l=s-n;a=r>.5?l/(2-s-n):l/(s+n),o=s===e?(t-i)/l+(t<i?6:0):s===t?(i-e)/l+2:(e-t)/l+4,o*=60}return[o,a,r]}static HSLtoRGB(e,t,i){if(0===t)return[i,i,i];const n=i<.5?i*(1+t):i+t-i*t,s=2*i-n;function r(e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?s+6*(n-s)*e:e<.5?n:e<2/3?s+(n-s)*(2/3-e)*6:s}return[r(e/360+1/3),r(e/360),r(e/360-1/3)]}static RGBtoHSB(e,t,i){const n=Math.min(e,t,i),s=Math.max(e,t,i);let r=NaN;if(n!==s){const o=s-n,a=(s-e)/o,l=(s-t)/o,c=(s-i)/o;r=e===s?c-l:t===s?2+a-c:4+l-a,r/=6,r<0&&(r+=1)}return[360*r,0===s?0:(s-n)/s,s]}static HSBtoRGB(e,t,i){isNaN(e)&&(e=0),e=(e%360+360)%360/360;let n=0,s=0,r=0;if(0===t)n=s=r=i;else{const o=6*(e-Math.floor(e)),a=o-Math.floor(o),l=i*(1-t),c=i*(1-t*a),h=i*(1-t*(1-a));switch(0|o){case 0:n=i,s=h,r=l;break;case 1:n=c,s=i,r=l;break;case 2:n=l,s=i,r=h;break;case 3:n=l,s=c,r=i;break;case 4:n=h,s=l,r=i;break;case 5:n=i,s=l,r=c}}return[n,s,r]}derive(t,i,n,s){const r=e.RGBtoHSB(this.r,this.g,this.b);let o=r[2];0==o&&n>1&&(o=.05);const a=((r[0]+t)%360+360)%360,l=Hn(0,r[1]*i,1);o=Hn(0,o*n,1);const c=Hn(0,this.a*s,1),h=e.HSBtoRGB(a,l,o);return h.push(c),e.fromArray(h)}brighter(){return this.derive(0,1,1/.7,1)}darker(){return this.derive(0,1,.7,1)}static interpolate(t,i){const n=e.tryParseFromString(t),s=e.tryParseFromString(i);return t=>{const i=(e,i)=>e*(1-t)+i*t;return new e(i(n.r,s.r),i(n.g,s.g),i(n.b,s.b),i(n.a,s.a)).toString()}}};ds.didDebug=!1,ds.nameToHex=Object.freeze({aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#00FFFF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blue:"#0000FF",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgreen:"#006400",darkgrey:"#A9A9A9",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#FF00FF",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",green:"#008000",greenyellow:"#ADFF2F",grey:"#808080",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgreen:"#90EE90",lightgrey:"#D3D3D3",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#00FF00",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#FF0000",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",transparent:"#00000000",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFFFFF",whitesmoke:"#F5F5F5",yellow:"#FFFF00",yellowgreen:"#9ACD32"});var ps=ds;function gs(e,t){return i=>Number(e)*(1-i)+Number(t)*i}var fs={};v(fs,{easeIn:()=>ys,easeInOut:()=>bs,easeInOutQuad:()=>Ss,easeInQuad:()=>Cs,easeOut:()=>vs,easeOutQuad:()=>ws,inverseEaseOut:()=>xs,linear:()=>ms});var ms=e=>e,ys=e=>1-Math.cos(e*Math.PI/2),vs=e=>Math.sin(e*Math.PI/2),bs=e=>-(Math.cos(e*Math.PI)-1)/2,Cs=e=>e*e,ws=e=>1-p(1-e,2),Ss=e=>e<.5?2*e*e:1-p(-2*e+2,2)/2,xs=e=>2*Math.asin(e)/Math.PI,Es=["initial","remove","update","add","trailing","end","none"],As={initial:{animationDuration:1,animationDelay:0},add:{animationDuration:.25,animationDelay:.75},remove:{animationDuration:.25,animationDelay:0},update:{animationDuration:.5,animationDelay:.25},trailing:{animationDuration:.2,animationDelay:1,skipIfNoEarlierAnimations:!0},end:{animationDelay:1.2,animationDuration:0,skipIfNoEarlierAnimations:!0},none:{animationDuration:0,animationDelay:0}},Ms=(e=>(e.Loop="loop",e.Reverse="reverse",e))(Ms||{});function Ts(e){return e.every(e=>e instanceof cs)?{nodes:e,selections:[]}:{nodes:[],selections:e}}var Ds=class{constructor(e){var t,i,n,s,r,o,a;this.isComplete=!1,this.elapsed=0,this.iteration=0,this.isPlaying=!1,this.isReverse=!1,this.id=e.id,this.groupId=e.groupId,this.autoplay=null==(t=e.autoplay)||t,this.ease=null!=(i=e.ease)?i:ms,this.phase=e.phase;const l=null!=(n=e.duration)?n:As[this.phase].animationDuration;this.duration=l*e.defaultDuration,this.delay=(null!=(s=e.delay)?s:0)*e.defaultDuration,this.onComplete=e.onComplete,this.onPlay=e.onPlay,this.onStop=e.onStop,this.onUpdate=e.onUpdate,this.interpolate=this.createInterpolator(e.from,e.to),this.from=e.from,!0===e.skip&&(null==(r=this.onUpdate)||r.call(this,e.to,!1,this),null==(o=this.onStop)||o.call(this,this),null==(a=this.onComplete)||a.call(this,this),this.isComplete=!0),!1!==e.collapsable&&(this.duration=this.checkCollapse(e,this.duration))}checkCollapse(e,t){return e.from===e.to?0:"object"==typeof e.from&&wt(e.from,e.to)?t:0}play(e=!1){var t,i;this.isPlaying||this.isComplete||(this.isPlaying=!0,null==(t=this.onPlay)||t.call(this,this),this.autoplay&&(this.autoplay=!1,e&&(null==(i=this.onUpdate)||i.call(this,this.from,!0,this))))}pause(){this.isPlaying=!1}stop(){var e;this.isPlaying=!1,this.isComplete||(this.isComplete=!0,null==(e=this.onStop)||e.call(this,this))}update(e){var t,i;if(this.isComplete)return e;!this.isPlaying&&this.autoplay&&this.play(!0);const n=this.elapsed;if(this.elapsed+=e,this.delay>this.elapsed)return 0;const s=this.interpolate(this.isReverse?1-this.delta:this.delta);null==(t=this.onUpdate)||t.call(this,s,!1,this);const r=this.delay+this.duration;return this.elapsed>=r?(this.stop(),this.isComplete=!0,null==(i=this.onComplete)||i.call(this,this),e-(r-n)):0}get delta(){return this.ease(Hn(0,(this.elapsed-this.delay)/this.duration,1))}createInterpolator(e,t){if("object"!=typeof t||Vn(t))return this.interpolateValue(e,t);const i=[];for(const n in t){const s=this.interpolateValue(e[n],t[n]);null!=s&&i.push([n,s])}return e=>{const t={};for(const[n,s]of i)t[n]=s(e);return t}}interpolateValue(e,t){if(void 0!==e&&void 0!==t){if(Vn(e))return i=>e[Bn](t,i);try{switch(typeof e){case"number":return gs(e,t);case"string":return function(e,t){if("string"==typeof e)try{e=ps.fromString(e)}catch(t){e=ps.fromArray([0,0,0])}if("string"==typeof t)try{t=ps.fromString(t)}catch(e){t=ps.fromArray([0,0,0])}const i=gs(e.r,t.r),n=gs(e.g,t.g),s=gs(e.b,t.b),r=gs(e.a,t.a);return e=>ps.fromArray([i(e),n(e),s(e),r(e)]).toRgbaString()}(e,t);case"boolean":if(e===t)return()=>e}}catch(e){}throw new Error(`Unable to interpolate values: ${e}, ${t}`)}}},Is={added:"add",updated:"update",removed:"remove",unknown:"initial","no-op":"none"};function Rs(e,t,i,n,s,r,o){const{fromFn:a,toFn:l,intermediateFn:c}=s,{nodes:h,selections:u}=Ts(n),d=(n,s)=>{var h;let u,d=0,p=0;for(const g of s){const m=n[d]===g,v={last:p>=s.length-1,lastLive:d>=n.length-1,prev:s[p-1],prevFromProps:u,prevLive:n[d-1],next:s[p+1],nextLive:n[d+(m?1:0)]},b=`${e}_${t}_${g.id}`;i.stopByAnimationId(b);let C="unknown";m?r&&o&&(C=Ps(g,g.datum,r,o)):C="removed";const w=a(g,g.datum,C,v),{phase:S,start:x,finish:E,delay:A,duration:M}=w,T=y(w,["phase","start","finish","delay","duration"]),D=l(g,g.datum,C,v),{phase:I,start:R,finish:k,delay:P,duration:_}=D,L=y(D,["phase","start","finish","delay","duration"]),N=null==E&&null==k;i.animate({id:b,groupId:e,phase:null!=(h=null!=S?S:I)?h:"update",duration:null!=M?M:_,delay:null!=A?A:P,from:T,to:L,ease:vs,collapsable:N,onPlay:()=>{g.setProperties(f(f({},x),R))},onUpdate(e){g.setProperties(e),c&&g.setProperties(c(g,g.datum,C,v))},onStop:()=>{g.setProperties(f(f(f(f(f(f({},x),R),T),L),E),k))}}),m&&d++,p++,u=T}};let p=0;for(const n of u){const s=n.nodes();d(s.filter(e=>!n.isGarbage(e)),s),i.animate({id:`${e}_${t}_selection_${p}`,groupId:e,phase:"end",from:0,to:1,ease:vs,onStop(){n.cleanup()}}),p++}d(h,h)}function ks(e,t,i,n,s,r,o){const{nodes:a,selections:l}=Ts(n),{start:c,finish:h,phase:u}=o,d=null==h;i.animate({id:`${e}_${t}`,groupId:e,phase:null!=u?u:"update",from:s,to:r,ease:vs,collapsable:d,onPlay:()=>{if(c){for(const e of a)e.setProperties(c);for(const e of l)for(const t of e.nodes())t.setProperties(c)}},onUpdate(e){for(const t of a)t.setProperties(e);for(const t of l)for(const i of t.nodes())i.setProperties(e)},onStop:()=>{for(const e of a)e.setProperties(f(f({},r),h));for(const e of l)for(const t of e.nodes())t.setProperties(f(f({},r),h))}})}function Ps(e,t,i,n){const s=i(e,t);return n.added.has(s)?"added":n.removed.has(s)?"removed":"updated"}var _s=2*Math.PI;function Ls(e){return e%=_s,(e+=_s)%_s}function Ns(e){return e%=_s,(e+=_s)!==_s&&(e%=_s),e}function Os(e){return(e%=_s)<-Math.PI?e+=_s:e>=Math.PI&&(e-=_s),e}function Fs(e,t,i){const n=Ls(e),s=Ls(t),r=Ns(i);return s<=r?s<=n&&n<=r:s<=n||n<=r}function Gs(e){return e/180*Math.PI}function Bs(e){return e/Math.PI*180}function Vs(e,t){return e=Ls(e),(t=Ls(t))-e+(e>t?2*Math.PI:0)}function Hs(e,t,i,n){return{x:e+i*Math.cos(n),y:t+i*Math.sin(n)}}var Us=(e,t)=>{const i=Symbol(String(t));e[i]=void 0,Object.defineProperty(e,t,{get(){return this[i]},set(e){this[i]!==e&&(this[i]=e,this.invalid=!0)},enumerable:!0,configurable:!1})},zs=class e{constructor(){this.type="band",this.invalid=!0,this.interval=void 0,this.index=new Map,this.ordinalRange=[],this._domain=[],this.range=[0,1],this._bandwidth=1,this._step=1,this._rawBandwidth=1,this._paddingInner=0,this._paddingOuter=0,this.round=!1}static is(t){return t instanceof e}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&L.warnOnce("Expected update to not invalidate scale"))}set domain(e){this.invalid=!0;const t=[];this.index=new Map;const i=this.index;e.forEach(e=>{void 0===this.getIndex(e)&&i.set(e,t.push(e)-1)}),this._domain=t}get domain(){return this._domain}ticks(){this.refresh();let{interval:e=1}=this;"number"!=typeof e&&(e=Number(e));const t=Math.abs(Math.round(e));return this._domain.filter((e,i)=>i%t===0)}convert(e){this.refresh();const t=this.getIndex(e);if(void 0===t)return NaN;const i=this.ordinalRange[t];return void 0===i?NaN:i}invert(e){this.refresh();const t=this.ordinalRange.findIndex(t=>t===e);return this.domain[t]}invertNearest(e){var t;this.refresh();let i=-1,n=1/0;const s=this.ordinalRange.findIndex((t,s)=>{if(t===e)return!0;const r=Math.abs(e-t);return r<n&&(n=r,i=s),!1});return null!=(t=this.domain[s])?t:this.domain[i]}get bandwidth(){return this.refresh(),this._bandwidth}get step(){return this.refresh(),this._step}get rawBandwidth(){return this.refresh(),this._rawBandwidth}set padding(e){e=Hn(0,e,1),this._paddingInner=e,this._paddingOuter=e}get padding(){return this._paddingInner}set paddingInner(e){this._paddingInner=Hn(0,e,1)}get paddingInner(){return this._paddingInner}set paddingOuter(e){this._paddingOuter=Hn(0,e,1)}get paddingOuter(){return this._paddingOuter}update(){const e=this._domain.length;if(0===e)return;const t=this.round,i=this._paddingInner,n=this._paddingOuter,[s,r]=this.range,o=r-s,a=o/Math.max(1,e+2*n-i),l=t?Math.floor(a):a,c=s+(o-l*(e-i))/2,h=t?Math.round(c):c,u=l*(1-i),d=t?Math.round(u):u,p=a*(1-i),g=[];for(let t=0;t<e;t++)g.push(h+l*t);this._bandwidth=d,this._rawBandwidth=p,this._step=l,this.ordinalRange=g}getIndex(e){if(!(e instanceof Date))return this.index.get(e);const t=e.valueOf();let i=0;for(const e of this.index.keys()){if(e instanceof Date&&e.valueOf()===t)return i;i++}}};b([Us],zs.prototype,"interval",2),b([Us],zs.prototype,"range",2),b([Us],zs.prototype,"round",2);var Ws=zs;function js(e,t=[void 0]){return Te((i,n,s)=>t.includes(s)?Fe(e)?e(s):e:s)}function $s(e,t={}){const{optional:i=!1,property:n}=t;return Te((s,r,o)=>{var a;const l=m(f({},t),{target:s,property:r});if(i&&void 0===o||e(o,l))return bt(s[r])&&!bt(o)?(s[r].set(o),s[r]):o;const c=null!=n?n:String(r).replace(/^_*/,""),h=null!=(a=s.constructor.className)?a:s.constructor.name.replace(/Properties$/,"");let u=Ur(o);if(null!=u&&u.length>50){const e=u.length-50;u=u.slice(0,50)+`... (+${e} characters)`}return L.warn(`Property [${c}] of [${h}] cannot be set to [${u}]${e.message?`; expecting ${Vr(e,l)}`:""}, ignoring.`),Ee},void 0,{optional:i})}var Ks,Ys=(...e)=>{const t=[];return Br((i,n)=>(t.length=0,e.every(e=>{const s=e(i,n);return s||t.push(Vr(e,n)),s})),()=>t.filter(Boolean).join(" AND "))},qs=(...e)=>Br((t,i)=>e.some(e=>e(t,i)),t=>e.map(function(e){return t=>Vr(t,e)}(t)).filter(Boolean).join(" OR ")),Xs=Hr(Br((e,t)=>bt(e)||Ge(e)&&bt(t.target[t.property]),"a properties object")),Zs=Hr(Br(e=>Ge(e),"an object")),Qs=Br(_e,"a boolean"),Js=Br(Fe,"a function"),er=Br(He,"a string"),tr=(Ks=Br(ze,"a number"),Object.assign(Ks,{restrict({min:e,max:t}={}){const i=["a number"],n=Ue(e),s=Ue(t);return n&&s?i.push(`between ${e} and ${t} inclusive`):n?i.push(`greater than or equal to ${e}`):s&&i.push(`less than or equal to ${t}`),Br(i=>ze(i)&&(!n||i>=e)&&(!s||i<=t),i.join(" "))}})),ir=Br(e=>Ue(e)&&isNaN(e),"NaN"),nr=tr.restrict({min:0}),sr=tr.restrict({min:0,max:1}),rr=tr.restrict({min:-360,max:360}),or=qs(tr,ir),ar=function(e){return Object.assign(e,{restrict({length:e,minLength:t}={}){let i="an array";return Ue(t)&&t>0?i="a non-empty array":Ue(e)&&(i=`an array of length ${e}`),Br(i=>Pe(i)&&(!Ue(e)||i.length===e)&&(!Ue(t)||i.length>=t),i)}})}(Br(Pe,"an array")),lr=(e,t)=>Br((t,i)=>Pe(t)&&t.every(t=>e(t,i)),e=>{var i;const n=null!=(i=Vr(ar,e))?i:"";return t?`${n} of ${t}`:n}),cr=e=>ze(e)||Ne(e),hr=e=>Br((t,i)=>!cr(t)||!cr(i.target[e])||t<i.target[e],`to be less than ${e}`),ur=e=>Br((t,i)=>!cr(t)||!cr(i.target[e])||t>i.target[e],`to be greater than ${e}`),dr=Br(Ne,"Date object"),pr=qs(dr,nr),gr="A color string can be in one of the following formats to be valid: #rgb, #rrggbb, rgb(r, g, b), rgba(r, g, b, a) or a CSS color name such as 'white', 'orange', 'cyan', etc",fr=Br(e=>He(e)&&ps.validColorString(e),`color String. ${gr}`),mr=Br(lr(fr),`color strings. ${gr}`),yr=lr(Qs,"boolean values"),vr=lr(tr,"numbers"),br=lr(er,"strings"),Cr=Br(lr(dr),"Date objects"),wr=Br(lr(Xs),"objects"),Sr=Or(["butt","round","square"],"a line cap"),xr=Or(["round","bevel","miter"],"a line join"),Er=Br(lr(nr),"numbers specifying the length in pixels of alternating dashes and gaps, for example, [6, 3] means dashes with a length of 6 pixels with gaps between of 3 pixels."),Ar=Or(["top","right","bottom","left"],"a position"),Mr=Or(["normal","italic","oblique"],"a font style"),Tr=qs(Or(["normal","bold","bolder","lighter"],"a font weight"),tr.restrict({min:1,max:1e3})),Dr=Or(["never","always","hyphenate","on-space"],"a text wrap strategy"),Ir=Or(["left","center","right"],"a text align"),Rr=Or(["top","middle","bottom"],"a vertical align"),kr=Or(["ellipsis","hide"],"an overflow strategy"),Pr=Or(["horizontal","vertical"],"a direction"),_r=Or(["inside","outside"],"a placement"),Lr=qs(Or(["exact","nearest"],"interaction range"),tr),Nr=Or(["top","bottom","left","right"]);function Or(e,t="a"){return Br(t=>e.includes(t),`${t} keyword such as ${function(e){const t=e.map(e=>`'${e}'`);if(1===t.length)return t[0];const i=t.pop();return`${t.join(", ")} or ${i}`}(e)}`)}var Fr=qs(Ys(tr.restrict({min:1}),hr("maxSpacing")),ir),Gr=qs(Ys(tr.restrict({min:1}),ur("minSpacing")),ir);function Br(e,t){return e.message=t,e}function Vr(e,t){return Fe(e.message)?e.message(t):e.message}function Hr(e){return Object.assign(e,{restrict:t=>Br(e=>e instanceof t,i=>{var n;return null!=(n=Vr(e,i))?n:`an instance of ${t.name}`})})}function Ur(e){if("number"==typeof e){if(isNaN(e))return"NaN";if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity"}return JSON.stringify(e)}var zr=Br(e=>ze(e)&&e>0||e instanceof N,"a non-zero positive Number value or, for a time axis, a Time Interval such as 'agCharts.time.month'"),Wr=class extends yt{constructor(){super(...arguments),this.enabled=!0,this.width=1,this.size=6,this.color=void 0,this.interval=void 0,this.values=void 0}};b([$s(Qs)],Wr.prototype,"enabled",2),b([$s(nr)],Wr.prototype,"width",2),b([$s(nr)],Wr.prototype,"size",2),b([$s(fr,{optional:!0})],Wr.prototype,"color",2),b([$s(zr,{optional:!0})],Wr.prototype,"interval",2),b([$s(ar,{optional:!0})],Wr.prototype,"values",2);var jr=(e=>(e.X="x",e.Y="y",e))(jr||{}),$r={constructedArrays:new WeakMap};function Kr(e,t){var i;null==(i=$r.constructedArrays)||i.set(e,t)}var Yr=class e{constructor(t,i){this.invalid=!0,this.nice=!1,this.interval=void 0,this.tickCount=e.defaultTickCount,this.minTickCount=0,this.maxTickCount=1/0,this.niceDomain=[],this.defaultClampMode="raw",this.domain=t,this.range=i}static is(t){return t instanceof e}transform(e){return e}transformInvert(e){return e}calcBandwidth(e=1){const{range:t}=this,i=this.getDomain(),n=Math.abs(t[1]-t[0]),s=Math.abs(i[1]-i[0])/e+1,r=Math.floor(n),o=Math.min(s,r);return n/Math.max(1,o)}getDomain(){return this.nice&&(this.refresh(),this.niceDomain.length)?this.niceDomain:this.domain}convert(e,t){var i;const n=null!=(i=null==t?void 0:t.clampMode)?i:this.defaultClampMode;if(!this.domain||this.domain.length<2)return NaN;this.refresh();const s=this.getDomain().map(e=>this.transform(e)),[r,o]=s,{range:a}=this,[l,c]=a;if(e=this.transform(e),"clamped"===n){const[t,i]=zn(s.map(Number));if(Number(e)<t)return l;if(Number(e)>i)return c}return r===o?(l+c)/2:e===r?l:e===o?c:l+(Number(e)-Number(r))/(Number(o)-Number(r))*(c-l)}invert(e){this.refresh();const t=this.getDomain().map(e=>this.transform(e)),[i,n]=t,{range:s}=this,[r,o]=s,a=r>o;let l;return e<(a?o:r)?a?n:i:e>(a?r:o)?a?i:n:(l=r===o?this.toDomain((Number(i)+Number(n))/2):this.toDomain(Number(i)+(e-r)/(o-r)*(Number(n)-Number(i))),this.transformInvert(l))}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&L.warnOnce("Expected update to not invalidate scale"))}getPixelRange(){const[e,t]=this.range;return Math.abs(t-e)}};Yr.defaultTickCount=5,Yr.defaultMaxTickCount=6,b([Us],Yr.prototype,"domain",2),b([Us],Yr.prototype,"range",2),b([Us],Yr.prototype,"nice",2),b([Us],Yr.prototype,"interval",2),b([Us],Yr.prototype,"tickCount",2),b([Us],Yr.prototype,"minTickCount",2),b([Us],Yr.prototype,"maxTickCount",2);var qr=Yr,Xr={periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]};function Zr(e,t=new Date(e.getFullYear(),0,1)){const i=e.getTimezoneOffset()-t.getTimezoneOffset(),n=e.getTime()-t.getTime()+6e4*i;return Math.floor(n/864e5)}function Qr(e,t){const i=(t-new Date(e.getFullYear(),0,1).getDay()+7)%7,n=new Date(e.getFullYear(),0,i+1);return n<=e?Math.floor(Zr(e,n)/7)+1:0}function Jr(e,t=e.getFullYear()){const i=new Date(t,0,1).getDay(),n=new Date(t,0,(4-i+7)%7-3+1);return n<=e?Math.floor(Zr(e,n)/7)+1:Jr(e,t-1)}var eo={a:e=>Xr.shortDays[e.getDay()],A:e=>Xr.days[e.getDay()],b:e=>Xr.shortMonths[e.getMonth()],B:e=>Xr.months[e.getMonth()],c:"%x, %X",d:(e,t)=>io(e.getDate(),2,null!=t?t:"0"),e:"%_d",f:(e,t)=>io(1e3*e.getMilliseconds(),6,null!=t?t:"0"),H:(e,t)=>io(e.getHours(),2,null!=t?t:"0"),I:(e,t)=>{const i=e.getHours()%12;return 0===i?"12":io(i,2,null!=t?t:"0")},j:(e,t)=>io(Zr(e)+1,3,null!=t?t:"0"),m:(e,t)=>io(e.getMonth()+1,2,null!=t?t:"0"),M:(e,t)=>io(e.getMinutes(),2,null!=t?t:"0"),L:(e,t)=>io(e.getMilliseconds(),3,null!=t?t:"0"),p:e=>e.getHours()<12?"AM":"PM",Q:e=>String(e.getTime()),s:e=>String(Math.floor(e.getTime()/1e3)),S:(e,t)=>io(e.getSeconds(),2,null!=t?t:"0"),u:e=>{let t=e.getDay();return t<1&&(t+=7),String(t%7)},U:(e,t)=>io(Qr(e,0),2,null!=t?t:"0"),V:(e,t)=>io(Jr(e),2,null!=t?t:"0"),w:(e,t)=>io(e.getDay(),2,null!=t?t:"0"),W:(e,t)=>io(Qr(e,1),2,null!=t?t:"0"),x:"%-m/%-d/%Y",X:"%-I:%M:%S %p",y:(e,t)=>io(e.getFullYear()%100,2,null!=t?t:"0"),Y:(e,t)=>io(e.getFullYear(),4,null!=t?t:"0"),Z:e=>function(e){const t=e.getTimezoneOffset(),i=Math.abs(t);return`${t>0?"-":"+"}${io(Math.floor(i/60),2,"0")}${io(Math.floor(i%60),2,"0")}`}(e),"%":()=>"%"},to={_:" ",0:"0","-":""};function io(e,t,i){const n=String(Math.floor(e));return n.length>=t?n:`${i.repeat(t-n.length)}${n}`}function no(e){const t=[];for(;e.length>0;){let i=e.indexOf("%");if(0!==i){const n=i>0?e.substring(0,i):e;t.push(n)}if(i<0)break;const n=e[i+1],s=to[n];null!=s&&i++;const r=e[i+1],o=eo[r];if("function"==typeof o)t.push([o,s]);else if("string"==typeof o){const e=no(o);t.push([e,s])}else t.push(`${null!=s?s:""}${r}`);e=e.substring(i+2)}return e=>{const i="number"==typeof e?new Date(e):e;return t.map(e=>"string"==typeof e?e:e[0](i,e[1])).join("")}}function so(e){return e instanceof Date?e.getTime():e}function ro(e,t){const i=oo(e,t);return e=>no(i)(e)}function oo(e=[],t=e){let i=8;const n=e=>{e<i&&(i=e)};for(const t of e)n(ao(t));const s=so(t[0]),r=so(t.at(-1)),o=new Date(s).getFullYear(),a=new Date(r).getFullYear();return function(e,t,i){const n=so(i[0]),s=so(i.at(-1)),r=Math.abs(s-n),o=[["hour",216e5,12096e5,3,"%I %p"],["hour",V,216e5,3,"%I:%M"],["second",1e3,216e5,1,":%S"],["ms",0,216e5,0,".%L"],["am/pm",V,216e5,3,"%p"]," ",["day",U,6048e5,4,"%a"],["month",0===r?0:z,314496e5,5,"%b %d"],["month",3024e6,31536e7,6,"%B"]," ",["year",t||8===e?0:W,1/0,8,"%Y"]].filter(t=>{if("string"==typeof t)return!0;const[i,n,s,o]=t;return o>=e&&n<=r&&r<s}).reduce((e,t)=>("string"==typeof t?e.result.push(t):e.used.has(t[0])||(e.result.push(t),e.used.add(t[0])),e),{result:[],used:new Set}).result,a=o.findIndex(e=>"string"!=typeof e),l=o.length-[...o].reverse().findIndex(e=>"string"!=typeof e);return o.slice(a,l).map(e=>"string"==typeof e?e:e[4]).join("").replaceAll(/\s+/g," ").trim()}(i,a-o>0,e)}function ao(e){return K.floor(e)<e?0:X.floor(e)<e?1:J.floor(e)<e?2:te.floor(e)<e?3:de.floor(e)<e?he.floor(e)<e?4:5:ge.floor(e)<e?6:8}var lo=(e,t=[])=>Object.assign(t,{fractionDigits:e});function co(e,t,i,n,s){if(i<2)return po(e,t,t-e);const r=uo(e,t,i,n,s);return isNaN(r)?lo(0):po(e=Math.ceil(e/r)*r,t=Math.floor(t/r)*r,r)}var ho=[1,2,5,10];function uo(e,t,i,n=0,s=1/0){const r=Math.abs(t-e),o=r/i,a=Math.floor(Math.log10(o)),l=Math.pow(10,a),c=ho.map(e=>{const t=e*l,o=Math.ceil(r/t);return{multiplier:e,isWithinBounds:o>=n&&o<=s,diffCount:Math.abs(o-i)}}).sort((e,t)=>e.isWithinBounds!==t.isWithinBounds?e.isWithinBounds?-1:1:e.diffCount-t.diffCount)[0].multiplier;return!c||isNaN(c)?NaN:c*l}function po(e,t,i){const n=Math.min(e,t),s=Math.max(e,t),r=Xn(i),o=Math.pow(10,r),a=Math.ceil((s-n)/i),l=lo(r);for(let e=0;e<=a;e++){const t=n+i*e;l.push(Math.round(t*o)/o)}return l}function go({start:e,stop:t,interval:i,count:n,availableRange:s}){return null!=n||(n=(t-e)/("number"==typeof i?i:1)),n>=s&&(L.warnOnce("the configured interval results in more than 1 item per pixel, ignoring. Supply a larger interval or omit this configuration"),!0)}var fo=class e extends qr{constructor(){super([],[0,1]),this.type="time"}toDomain(e){return new Date(e)}static getTickInterval({start:t,stop:i,count:n,minCount:s,maxCount:r,target:o}){let a,l;const c=null!=n?n:qr.defaultTickCount,h=null!=o?o:Math.abs(i-t)/Math.max(c,1),u=e.getIntervalIndex(h);if(0===u)l=Math.max(uo(t,i,c,s,r),1),a=G;else if(u===e.tickIntervals.length)l=void 0===o?uo(t/W,i/W,c,s,r):1,a=ge;else{const t=h-e.tickIntervals[u-1][2]<e.tickIntervals[u][2]-h?u-1:u;[a,l]=e.tickIntervals[t]}return a.every(l)}static getIntervalIndex(t){let i=0;for(;i<e.tickIntervals.length&&t>e.tickIntervals[i][2];)i++;return i}invert(e){return new Date(super.invert(e))}ticks(){if(!this.domain||this.domain.length<2)return[];this.refresh();const[t,i]=this.getDomain().map(so),n=Math.min(t,i),s=Math.max(t,i),{interval:r,nice:o,tickCount:a,minTickCount:l,maxTickCount:c}=this;if(void 0!==r){const t=this.getPixelRange(),i=e.getTicksForInterval({start:n,stop:s,interval:r,availableRange:t});return null!=i?i:e.getDefaultTicks({start:n,stop:s,tickCount:a,minTickCount:l,maxTickCount:c})}if(o){if(2===a)return this.niceDomain;if(1===a)return this.niceDomain.slice(0,1)}return e.getDefaultTicks({start:n,stop:s,tickCount:a,minTickCount:l,maxTickCount:c})}static getDefaultTicks({start:t,stop:i,tickCount:n,minTickCount:s,maxTickCount:r}){const o=e.getTickInterval({start:t,stop:i,count:n,minCount:s,maxCount:r});return o?o.range(new Date(t),new Date(i)):[]}static getTicksForInterval({start:t,stop:i,interval:n,availableRange:s}){if(!n)return[];if(n instanceof N){const e=n.range(new Date(t),new Date(i));if(go({start:t,stop:i,interval:n,count:e.length,availableRange:s}))return;return e}const r=Math.abs(n);if(go({start:t,stop:i,interval:r,availableRange:s}))return;const o=[...e.tickIntervals];o.reverse();const a=o.find(e=>r%e[2]===0);if(a)return a[0].every(r/(a[2]/a[1])).range(new Date(t),new Date(i));let l=new Date(t);const c=new Date(i),h=[];for(;l<=c;)h.push(l),l=new Date(l),l.setMilliseconds(l.getMilliseconds()+r);return h}tickFormat({ticks:e,domain:t,specifier:i}){return null==i?ro(e,t):no(i)}update(){!this.domain||this.domain.length<2||this.nice&&this.updateNiceDomain()}updateNiceDomain(){let[e,t]=this.domain;for(let i=0;i<4;i++){this.updateNiceDomainIteration(e,t);const[i,n]=this.niceDomain;if(so(e)===so(i)&&so(t)===so(n))break;e=i,t=n}}updateNiceDomainIteration(t,i){const n=Math.min(so(t),so(i)),s=Math.max(so(t),so(i)),r=t>i,{interval:o}=this;let a;if(o instanceof N)a=o;else{const t="number"==typeof o?(s-n)/Math.max(o,1):this.tickCount;a=e.getTickInterval({start:n,stop:s,count:t,minCount:this.minTickCount,maxCount:this.maxTickCount})}if(a){const e=a.range(new Date(n),new Date(s),!0),t=r?[...e].reverse():e,i=t[0],o=t.at(-1);this.niceDomain=[i,o]}}};fo.tickIntervals=[[K,1,B],[K,5,5e3],[K,15,15e3],[K,30,3e4],[X,1,V],[X,5,3e5],[X,15,9e5],[X,30,18e5],[J,1,H],[J,3,108e5],[J,6,216e5],[J,12,432e5],[te,1,U],[te,2,1728e5],[he,1,z],[he,2,12096e5],[he,3,18144e5],[de,1,2592e6],[de,2,5184e6],[de,3,7776e6],[de,4,10368e6],[de,6,15552e6],[ge,1,W]];var mo=fo,yo=class e extends Ws{constructor(){super(...arguments),this.type="ordinal-time",this.tickCount=qr.defaultTickCount,this.minTickCount=0,this.maxTickCount=1/0,this.interval=void 0,this.index=new Map,this._domain=[]}static is(t){return t instanceof e}toDomain(e){return new Date(e)}set domain(e){if(this.invalid=!0,0===e.length)return void(this._domain=[]);const t=this.updateIndex(e);this._domain=t}get domain(){return this._domain}updateIndex(e){this.index=new Map;const{index:t}=this,i=[],n=[],s=e[0]>e.at(-1),r=s?0:1;e.forEach((o,a)=>{const l=e[a+1],c=s?o:this.toDomain(so(o)+1),h=s?this.toDomain(so(l)+1):l,u=s?[h,c]:[c,h];i.push(o),void 0!==l&&void 0===t.get(u)&&(n.push(Math.abs(so(h)-so(c))),t.set(u,a+r))}),n.sort((e,t)=>e-t);const o=n.length,a=Math.floor(o/2);this.medianInterval=o>2&&o%2==0?(n[a-1]+n[a+1])/2:n[a];const l=Math.max(0,mo.getIntervalIndex(this.medianInterval)-1),[c,h]=mo.tickIntervals[l],u=c.every(h),d=s?e.length-1:0,p=e[d],g=[u.floor(e[d]),p];return t.set(g,d),i}ticks(){if(!this.domain)return[];this.refresh();const[e,t]=[so(this.domain[0]),so(this.domain.at(-1))],i=Math.min(e,t),n=Math.max(e,t),s=e>t;let r;void 0!==this.interval&&(r=this.getTicksForInterval({start:i,stop:n,interval:this.interval}));const o=this.domain.length,{maxTickCount:a,tickCount:l}=this;let c,{minTickCount:h}=this;isFinite(a)&&o<=a&&(h=Math.max(1,o),c=this.medianInterval),null!=r||(r=this.getDefaultTicks({start:i,stop:n,tickCount:l,minTickCount:h,maxTickCount:a,isReversed:s,interval:c}));const u=new Set;return r.filter(e=>{const t=this.convert(e);return!isNaN(t)&&!u.has(t)&&(u.add(t),!0)})}getDefaultTicks({start:e,stop:t,tickCount:i,minTickCount:n,maxTickCount:s,isReversed:r,interval:o}){const a=mo.getTickInterval({start:e,stop:t,count:i,minCount:n,maxCount:s,target:o});if(!a)return[];const l=Math.ceil(this.domain.length/s),c=[];for(const[e,t]of this.index.entries()){if(t%l>0)continue;const i=r?a.ceil(e[0]):a.floor(e[1]);c.splice(t,0,i)}return c}getTicksForInterval({start:e,stop:t,interval:i}){var n;const[s,r]=this.range,o=Math.abs(r-s);return null!=(n=mo.getTicksForInterval({start:e,stop:t,interval:i,availableRange:o}))?n:[]}convert(e){if("number"==typeof e&&(e=new Date(e)),!(e instanceof Date))return NaN;let t;this.refresh();for(const[i,n]of this.index.entries())if(e>=i[0]&&e<=i[1]){t=n;break}if(void 0===t)return NaN;const i=this.ordinalRange[t];return void 0===i?NaN:i}tickFormat({ticks:e,domain:t,specifier:i}){return null==i?ro(e,t):no(i)}invert(e){return new Date(super.invert(e))}invertNearest(e){return new Date(super.invertNearest(e))}};b([Us],yo.prototype,"tickCount",2),b([Us],yo.prototype,"minTickCount",2),b([Us],yo.prototype,"maxTickCount",2),b([Us],yo.prototype,"interval",2);var vo=yo;function bo(e,t){return"number"==typeof e&&"number"==typeof t?e-t:"string"==typeof e&&"string"==typeof t?e.localeCompare(t):null==e&&null==t?0:null==e?-1:null==t?1:String(e).localeCompare(String(t))}function Co(e){return"function"==typeof e?e():e}function wo(e,t,i){for(const n in e){const s=i(Co(e[n]),Co(t[n]));if(0!==s)return s}return 0}var So=class e extends cs{constructor(e){var t;super({isVirtual:null==e?void 0:e.isVirtual}),this.opts=e,this.opacity=1,this.lastBBox=void 0;const{zIndex:i,zIndexSubOrder:n}=null!=e?e:{};this.isContainerNode=!0,void 0!==i&&(this.zIndex=i),void 0!==n&&(this.zIndexSubOrder=n),this.name=null==(t=this.opts)?void 0:t.name}static is(t){return t instanceof e}onZIndexChange(){var e;super.onZIndexChange(),this.layer&&(null==(e=this._layerManager)||e.moveLayer(this.layer,this.zIndex,this.zIndexSubOrder))}isLayer(){return null!=this.layer}_setLayerManager(e){if(this._layerManager&&this.layer&&(this._layerManager.removeLayer(this.layer),this.layer=void 0),this.layer)throw new Error("AG Charts - unable to deregister scene rendering layer!");super._setLayerManager(e)}initialiseLayer(){var e;this.layer||this._layerManager&&!0===(null==(e=this.opts)?void 0:e.layer)&&(this.layer=this._layerManager.addLayer({name:this.name,zIndex:this.zIndex,zIndexSubOrder:this.zIndexSubOrder,getComputedOpacity:()=>this.getComputedOpacity(),getVisibility:()=>this.getVisibility()}))}getComputedOpacity(){let t=1;for(const i of this.traverseUp())i instanceof e&&(t*=i.opacity);return t}getVisibility(){for(const e of this.traverseUp())if(!e.visible)return!1;return!0}onVisibleChange(){this.layer&&(this.layer.enabled=this.visible)}markDirty(e,t=1){if(this.isVirtual)return void super.markDirty(e,t);let i=t;(t<2||null!=this.layer)&&(i=1),super.markDirty(e,t,i)}containsPoint(e,t){return!0}computeBBox(){return this.computeTransformMatrix(),e.computeBBox(this.children)}computeTransformedBBox(){return this.computeBBox()}preRender(){var e,t;const i=super.preRender();return i.groups+=1,i.nonGroups-=1,!0!==(null==(e=this.opts)?void 0:e.layer)||null!=this.layer||(i.nonGroups>0&&this.initialiseLayer(),(null==(t=this.opts)?void 0:t.nonEmptyChildDerivedZIndex)&&i.nonGroups>0&&this.deriveZIndexFromChildren()),i}deriveZIndexFromChildren(){var e;const t=this.children.filter(e=>e._childNodeCounts.nonGroups>0);this.sortChildren(t);const i=t.at(-1);this.zIndex=null!=(e=null==i?void 0:i.zIndex)?e:-1/0,this.zIndexSubOrder=null==i?void 0:i.zIndexSubOrder}render(e){var t,i;const{opts:{name:n}={},_debug:s}=this,{dirty:r,dirtyZIndex:o,layer:a,children:l,clipRect:c,dirtyTransform:h}=this;let{ctx:u,forceRender:d,clipBBox:p}=e;const{resized:g,stats:y}=e,v=u.getTransform(),b=r>=2||o||g;let C=b,w=!1;for(const e of l)if(C||(C=null==e.layerManager&&e.dirty>=1),w||(w=null!=e.layerManager&&e.dirty>=1),C)break;if(n&&(null==s||s({name:n,group:this,isDirty:b,isChildDirty:C,dirtyTransform:h,renderCtx:e,forceRender:d})),h)d="dirtyTransform";else if(a){const e=this.computeBBox();void 0!==this.lastBBox&&this.lastBBox.equals(e)||(d="dirtyTransform",this.lastBBox=e)}if(!(b||C||w||d))return n&&y&&(null==s||s({name:n,result:"skipping",renderCtx:e,counts:this.nodeCount,group:this})),a&&y&&(y.layersSkipped++,y.nodesSkipped+=this.nodeCount.count),void this.markClean({recursive:!1});const S=this.visible;if(a){if(u=a.context,u.save(),u.setTransform(a.pixelRatio,0,0,a.pixelRatio,0,0),"dirtyTransform"!==d&&(d=C||o),d&&a.clear(),p){const{width:t,height:i,x:r,y:o}=p;null==s||s(()=>({name:n,clipBBox:p,ctxTransform:u.getTransform(),renderCtx:e,group:this})),u.beginPath(),u.rect(r,o,t,i),u.clip()}u.setTransform(v)}else u.globalAlpha*=this.opacity;if(this.computeTransformMatrix(),this.matrix.toContext(u),c){const{x:t,y:i,width:r,height:o}=c;u.save(),null==s||s(()=>({name:n,clipRect:c,ctxTransform:u.getTransform(),renderCtx:e,group:this})),u.beginPath(),u.rect(t,i,r,o),u.clip(),p=this.matrix.transformBBox(c)}const x=this.hasVirtualChildren();o?(this.sortChildren(l),"dirtyTransform"!==d&&(d=!0)):x&&this.sortChildren(l);const E=d!==e.forceRender||p!==e.clipBBox||u!==e.ctx?m(f({},e),{ctx:u,forceRender:d,clipBBox:p}):e;let A=0;for(const e of l)e.visible&&S?d||0!==e.dirty?(u.save(),e.render(E),u.restore()):y&&(A+=e.nodeCount.count):(e.markClean(),y&&(A+=e.nodeCount.count));if(y&&(y.nodesSkipped+=A),super.render(e),c&&u.restore(),x)for(const e of this.virtualChildren)e.markClean({recursive:"virtual"});a&&(y&&y.layersRendered++,u.restore(),d&&a.snapshot(),null==(i=(t=a.context).verifyDepthZero)||i.call(t)),n&&y&&(null==s||s({name:n,result:"rendered",skipped:A,renderCtx:e,counts:this.nodeCount,group:this}))}sortChildren(e){this.dirtyZIndex=!1,e.sort((e,t)=>{var i,n;return wo([e.zIndex,...null!=(i=e.zIndexSubOrder)?i:[void 0,void 0],e.serialNumber],[t.zIndex,...null!=(n=t.zIndexSubOrder)?n:[void 0,void 0],t.serialNumber],bo)})}static computeBBox(e){let t=1/0,i=-1/0,n=1/0,s=-1/0;for(const r of e){if(!r.visible)continue;const e=r.computeTransformedBBox();if(!e)continue;const{x:o,y:a,width:l,height:c}=e;o<t&&(t=o),a<n&&(n=a),o+l>i&&(i=o+l),a+c>s&&(s=a+c)}return new es(t,n,i-t,s-n)}setClipRectInGroupCoordinateSpace(e){this.clipRect=e?this.transformBBox(e):void 0}};So.className="Group",b([ns({redraw:3,convertor:e=>Hn(0,e,1)})],So.prototype,"opacity",2);var xo=So,Eo=class{constructor(e=[]){this.stops=e}},Ao=class extends Eo{constructor(e,t=0){super(e),this.angle=t}createGradient(e,t){const{stops:i,angle:n}=this,s=Ls(Gs(n+90)),r=Math.cos(s),o=Math.sin(s),a=t.width,l=t.height,c=t.x+.5*a,h=t.y+.5*l;if(a>0&&l>0){const t=Math.sqrt(l*l+a*a)/2,n=Math.atan2(l,a);let u;u=s<Math.PI/2?s:s<Math.PI?Math.PI-s:s<1.5*Math.PI?s-Math.PI:2*Math.PI-s;const d=t*Math.abs(Math.cos(u-n)),p=e.createLinearGradient(c+r*d,h+o*d,c-r*d,h-o*d);for(const e of i)p.addColorStop(e.offset,e.color);return p}return"black"}},Mo=/^linear-gradient\((.*?)deg,\s*(.*?)\s*\)$/i,To=class e extends cs{constructor(){super(...arguments),this.fillOpacity=1,this.strokeOpacity=1,this.fill=e.defaultStyles.fill,this.stroke=e.defaultStyles.stroke,this.strokeWidth=e.defaultStyles.strokeWidth,this.lineDash=e.defaultStyles.lineDash,this.lineDashOffset=e.defaultStyles.lineDashOffset,this.lineCap=e.defaultStyles.lineCap,this.lineJoin=e.defaultStyles.lineJoin,this.opacity=e.defaultStyles.opacity,this.fillShadow=e.defaultStyles.fillShadow}restoreOwnStyles(){const{defaultStyles:e}=this.constructor;Object.assign(this,e)}onFillChange(){const{fill:e}=this;let t;if((null==e?void 0:e.startsWith("linear-gradient"))&&(t=Mo.exec(e))){const e=parseFloat(t[1]),i=[],n=t[2],s=/(#[0-9a-f]+)|(rgba?\(.+?\))|([a-z]+)/gi;let r;for(;r=s.exec(n);)i.push(r[0]);this.gradient=new Ao(i.map((e,t)=>({color:e,offset:t/(i.length-1)})),e)}else this.gradient=void 0}align(e,t){var i,n,s;const r=null!=(s=null==(n=null==(i=this.layerManager)?void 0:i.canvas)?void 0:n.pixelRatio)?s:1,o=Math.round(e*r)/r;return null==t?o:0===t?0:t<1?Math.ceil(t*r)/r:Math.round((t+e)*r)/r-o}fillStroke(e,t){this.renderFill(e,t),this.renderStroke(e,t)}renderFill(e,t){if(this.fill){const{globalAlpha:i}=e;this.applyFill(e),this.applyFillAlpha(e),this.applyShadow(e),this.executeFill(e,t),e.globalAlpha=i}e.shadowColor="rgba(0, 0, 0, 0)"}executeFill(e,t){t?e.fill(t):e.fill()}applyFill(e){var t,i;e.fillStyle=null!=(i=null==(t=this.gradient)?void 0:t.createGradient(e,this.computeBBox()))?i:this.fill}applyFillAlpha(e){e.globalAlpha*=this.opacity*this.fillOpacity}applyShadow(e){var t,i;const n=null!=(i=null==(t=this.layerManager)?void 0:t.canvas.pixelRatio)?i:1,s=this.fillShadow;(null==s?void 0:s.enabled)&&(e.shadowColor=s.color,e.shadowOffsetX=s.xOffset*n,e.shadowOffsetY=s.yOffset*n,e.shadowBlur=s.blur*n)}renderStroke(e,t){if(this.stroke&&this.strokeWidth){const{globalAlpha:i}=e;e.strokeStyle=this.stroke,e.globalAlpha*=this.opacity*this.strokeOpacity,e.lineWidth=this.strokeWidth,this.lineDash&&e.setLineDash(this.lineDash),this.lineDashOffset&&(e.lineDashOffset=this.lineDashOffset),this.lineCap&&(e.lineCap=this.lineCap),this.lineJoin&&(e.lineJoin=this.lineJoin),this.executeStroke(e,t),e.globalAlpha=i}}executeStroke(e,t){t?e.stroke(t):e.stroke()}containsPoint(e,t){return this.isPointInPath(e,t)}};To.defaultStyles={fill:"black",stroke:void 0,strokeWidth:0,lineDash:void 0,lineDashOffset:0,lineCap:void 0,lineJoin:void 0,opacity:1,fillShadow:void 0},b([ns({redraw:2})],To.prototype,"fillOpacity",2),b([ns({redraw:2})],To.prototype,"strokeOpacity",2),b([ns({redraw:2,changeCb:e=>e.onFillChange()})],To.prototype,"fill",2),b([ns({redraw:2})],To.prototype,"stroke",2),b([ns({redraw:2})],To.prototype,"strokeWidth",2),b([ns({redraw:2})],To.prototype,"lineDash",2),b([ns({redraw:2})],To.prototype,"lineDashOffset",2),b([ns({redraw:2})],To.prototype,"lineCap",2),b([ns({redraw:2})],To.prototype,"lineJoin",2),b([ns({redraw:2,convertor:e=>Hn(0,e,1)})],To.prototype,"opacity",2),b([ns({redraw:2,checkDirtyOnAssignment:!0})],To.prototype,"fillShadow",2);var Do=To,Io=class extends Do{constructor(e={}){super(e),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.startLine=!1,this.endLine=!1,this.isRange=!1,this.restoreOwnStyles()}computeBBox(){return new es(this.x1,this.y1,this.x2-this.x1,this.y2-this.y1)}isPointInPath(e,t){return!1}render(e){var t;const{ctx:i,forceRender:n,stats:s}=e;if(0===this.dirty&&!n)return void(s&&(s.nodesSkipped+=this.nodeCount.count));this.computeTransformMatrix(),this.matrix.toContext(i);let{x1:r,y1:o,x2:a,y2:l}=this;r=this.align(r),o=this.align(o),a=this.align(a),l=this.align(l);const{fill:c,opacity:h,isRange:u}=this;if(u&&c){const{fillOpacity:e}=this;i.fillStyle=c,i.globalAlpha=h*e,i.beginPath(),i.moveTo(r,o),i.lineTo(a,o),i.lineTo(a,l),i.lineTo(r,l),i.closePath(),i.fill()}const{stroke:d,strokeWidth:p,startLine:g,endLine:f}=this;if((g||f)&&d&&p){const{strokeOpacity:e,lineDash:t,lineDashOffset:n,lineCap:s,lineJoin:c}=this;i.strokeStyle=d,i.globalAlpha=h*e,i.lineWidth=p,t&&i.setLineDash(t),n&&(i.lineDashOffset=n),s&&(i.lineCap=s),c&&(i.lineJoin=c),i.beginPath(),g&&(i.moveTo(r,o),i.lineTo(a,o)),f&&(i.moveTo(a,l),i.lineTo(r,l)),i.stroke()}null==(t=this.fillShadow)||t.markClean(),super.render(e)}};Io.className="Range",Io.defaultStyles=m(f({},Do.defaultStyles),{strokeWidth:1}),b([ns({redraw:2})],Io.prototype,"x1",2),b([ns({redraw:2})],Io.prototype,"y1",2),b([ns({redraw:2})],Io.prototype,"x2",2),b([ns({redraw:2})],Io.prototype,"y2",2),b([ns({redraw:2})],Io.prototype,"startLine",2),b([ns({redraw:2})],Io.prototype,"endLine",2),b([ns({redraw:2})],Io.prototype,"isRange",2);var Ro=new WeakMap,ko=new WeakMap;function Po(e,t){var i,n,s;const r=JSON.stringify(e,null,0);return Ro.has(t)||Ro.set(t,new Map),(null==(i=Ro.get(t))?void 0:i.has(r))||null==(n=Ro.get(t))||n.set(r,t(e)),null==(s=Ro.get(t))?void 0:s.get(r)}function _o(e){return(t,...i)=>{var n,s,r;const o=JSON.stringify(t,null,0);return ko.has(e)||ko.set(e,new Map),(null==(n=ko.get(e))?void 0:n.has(o))||null==(s=ko.get(e))||s.set(o,e(t,...i)),null==(r=ko.get(e))?void 0:r.get(o)}}function Lo(e){const{redraw:t=3,changeCb:i}=null!=e?e:{};return ns({redraw:t,type:"font",changeCb:i})}var No=class e extends Do{constructor(){super(...arguments),this.x=0,this.y=0,this.lines=[],this.text=void 0,this._dirtyFont=!0,this.fontSize=10,this.fontFamily="sans-serif",this.textAlign=e.defaultStyles.textAlign,this.textBaseline=e.defaultStyles.textBaseline}onTextChange(){var e,t;this.lines=null!=(t=null==(e=this.text)?void 0:e.split("\n").map(e=>e.trim()))?t:[]}get font(){return(null==this._font||this._dirtyFont)&&(this._dirtyFont=!1,this._font=Go(this)),this._font}computeBBox(){const{x:t,y:i,lines:n,lineHeight:s,textBaseline:r,textAlign:o}=this,{top:a,left:l,width:c,height:h}=e.getTextSizeMultiline(n,Go(this),r,o,s);return new es(t-l,i-a,c,h)}getLineHeight(t){var i,n;if(this.lineHeight)return this.lineHeight;const s=e.measureText(t,this.font,this.textBaseline,this.textAlign);return(null!=(i=s.fontBoundingBoxAscent)?i:s.emHeightAscent)+(null!=(n=s.fontBoundingBoxDescent)?n:s.emHeightDescent)}isPointInPath(e,t){const i=this.transformPoint(e,t),n=this.computeBBox();return!!n&&n.containsPoint(i.x,i.y)}render(e){const{ctx:t,forceRender:i,stats:n}=e;if(0===this.dirty&&!i)return void(n&&(n.nodesSkipped+=this.nodeCount.count));if(!this.lines.length||!this.layerManager)return void(n&&(n.nodesSkipped+=this.nodeCount.count));this.computeTransformMatrix(),this.matrix.toContext(t);const{fill:s,stroke:r,strokeWidth:o}=this;t.font=this.font,t.textAlign=this.textAlign,t.textBaseline=this.textBaseline;const a=this.layerManager.canvas.pixelRatio||1,{globalAlpha:l}=t;if(s){t.fillStyle=s,t.globalAlpha=l*this.opacity*this.fillOpacity;const{fillShadow:e}=this;(null==e?void 0:e.enabled)&&(t.shadowColor=e.color,t.shadowOffsetX=e.xOffset*a,t.shadowOffsetY=e.yOffset*a,t.shadowBlur=e.blur*a),this.renderLines((e,i,n)=>t.fillText(e,i,n))}if(r&&o){t.strokeStyle=r,t.lineWidth=o,t.globalAlpha=l*this.opacity*this.strokeOpacity;const{lineDash:e,lineDashOffset:i,lineCap:n,lineJoin:s}=this;e&&t.setLineDash(e),i&&(t.lineDashOffset=i),n&&(t.lineCap=n),s&&(t.lineJoin=s),this.renderLines((e,i,n)=>t.strokeText(e,i,n))}super.render(e)}renderLines(t){const{lines:i,x:n,y:s}=this,r=i.map(e=>this.getLineHeight(e)),o=r.reduce((e,t)=>e+t,0);let a=(r[0]-o)*e.getVerticalModifier(this.textBaseline);for(let e=0;e<i.length;e++)t(i[e],n,s+a),a+=r[e]}static wrapLines(t,i,n,s,r,o){const a="hide"!==o,l=new Fo(s),c=t.split(/\r?\n/g);if(0===c.length)return{lines:void 0,truncated:!1};if("never"===r){const{text:t,truncated:n}=e.truncateLine(c[0],i,l,a?"auto":"never");return{lines:null!=t?[t]:void 0,truncated:n}}const h=[];let u=0,d=!1;for(const t of c){const o=e.wrapLine(t,i,n,l,s,r,u,a);if(null==o)return{lines:void 0,truncated:!1};if(h.push(...o.result),u=o.cumulativeHeight,o.truncated){d=!0;break}}return{lines:h,truncated:d}}static wrap(t,i,n,s,r,o="ellipsis"){var a;const{lines:l,truncated:c}=e.wrapLines(t,i,n,s,r,o);return{text:null!=(a=null==l?void 0:l.join("\n").trim())?a:"",truncated:c}}static wrapLine(t,i,n,s,r,o,a,l){if(!(t=t.trim()))return{result:[],truncated:!1,cumulativeHeight:a};const c=s.size(t);if(c.width<=i)return{result:[t],truncated:!1,cumulativeHeight:a+c.height};if(c.height>n||s.width("W")>i)return l?{result:[],truncated:!0,cumulativeHeight:a}:void 0;const h=t.split(/\s+/g),u=e.wrapLineSequentially(h,i,n,s,r,o,a,l);if(null==u)return;a=u.cumulativeHeight;let{lines:d}=u;if(!u.wordsBrokenOrTruncated&&!u.linesTruncated){const t=u.lines.length,n=e.wrapLineBalanced(h,i,s,t);n.length===d.length&&(d=n)}return{result:d.map(e=>e.join(" ")),truncated:u.linesTruncated,cumulativeHeight:a}}static breakWord(t,i,n,s,r){const o=i=>e.punctuationMarks.includes(t[i]),a=s?r.width("-"):0,l=[];let c=0,h=0;for(let e=0;e<t.length;e++){const s=t[e],o=r.width(s);c+o+a>(0===h?i:n)&&(l.push(e),c=0,h++),c+=o}const u=[];let d=0;for(const e of l){let i=t.substring(d,e);s&&i.length>0&&!o(e-1)&&!o(e)&&(i+="-"),u.push(i),d=e}return u.push(t.substring(d)),u}static truncateLine(e,t,i,n){e=e.trimEnd();const s=i.width(e);if(s>t&&"never"===n)return{text:void 0,truncated:!1};if(s<=t&&"force"!==n)return{text:e,truncated:!1};const r=i.width("…");let o=e,a=s;for(;o.length>0&&a+r>t;)o=o.slice(0,-1).trimEnd(),a=i.width(o);return a+r<=t?{text:`${o}…`,truncated:!0}:{text:void 0,truncated:!1}}static wrapLineSequentially(t,i,n,s,r,o,a,l){const{fontSize:c=0,lineHeight:h=c*e.defaultLineHeightRatio}=r,u="always"===o||"hyphenate"===o,d="hyphenate"===o,p=s.width(" ");let g=!1,f=!1;const m=[];let y=[],v=0;const b=()=>({lines:m,linesTruncated:f,wordsBrokenOrTruncated:g,cumulativeHeight:a}),C=()=>{if(!l)return;const t=y.join(" "),{text:n}=e.truncateLine(t,i,s,"force");return null!=n?(y.splice(0,y.length,n),f=!0,b()):void 0},w=()=>{const e=a+h;return!(e>=n||(y=[],v=0,a=e,m.push(y),0))};if(!w())return C();for(let n=0;n<t.length;n++){const r=t[n],o=s.width(r),a=0===y.length?0:p,c=v+a+o;if(c<=i)y.push(r),v=c;else if(o<=i){if(!w())return C();y.push(r),v=o}else{if(g=!0,!u){if(l){if(!w())return C();const{text:o}=e.truncateLine(r,i,s,"force");if(null==o)return;y.push(o),n<t.length-1&&(f=!0);break}return}{const t=i-v-a,n=e.breakWord(r,t,i,d,s);for(let e=0;e<n.length;e++){const t=n[e];if(t&&y.push(t),e===n.length-1)v=s.width(t);else if(!w())return C()}}}}return b()}static wrapLineBalanced(e,t,i,n){const s=e.reduce((e,t)=>e+i.width(t),0),r=i.width(" "),o=(s+r*(e.length-n-2))/n,a=[];let l=[],c=i.width(e[0]),h=!0;for(const n of e){const e=i.width(n);if(h){l=[],l.push(n),c=e,h=!1,a.push(l);continue}const s=c+r+e;s<=o?(l.push(n),c=s):s<=t?(l.push(n),h=!0):(l=[n],c=e,a.push(l))}return a}setFont(e){this.fontFamily=e.fontFamily,this.fontSize=e.fontSize,this.fontStyle=e.fontStyle,this.fontWeight=e.fontWeight}setAlign(e){this.textAlign=e.textAlign,this.textBaseline=e.textBaseline}static getVerticalModifier(e){switch(e){case"top":case"hanging":return 0;case"bottom":case"alphabetic":case"ideographic":return 1;case"middle":return.5}}static get textContext(){if(!this._textContext){const e=xn("canvas");e.width=0,e.height=0,this._textContext=e.getContext("2d")}return this._textContext}static measureText(e,t,i,n){return this._measureText({text:e,font:t,textBaseline:i,textAlign:n})}static getTextSize(e,t){return this._getTextSize({text:e,font:t})}static getTextSizeMultiline(t,i,n=e.defaultStyles.textBaseline,s=e.defaultStyles.textAlign,r){var o,a;let l=0,c=0,h=0,u=0,d=0;for(const[e,r]of t.entries()){const p=this._measureText({text:r,font:i,textBaseline:n,textAlign:s});c=Math.max(c,p.actualBoundingBoxLeft),h=Math.max(h,p.width),0==e?(l+=p.actualBoundingBoxAscent,u+=p.actualBoundingBoxAscent):d+=null!=(o=p.fontBoundingBoxAscent)?o:p.emHeightAscent,e==t.length-1?u+=p.actualBoundingBoxDescent:d+=null!=(a=p.fontBoundingBoxDescent)?a:p.emHeightDescent}return null!=r&&(d=(t.length-1)*r),u+=d,l+=d*e.getVerticalModifier(n),{top:l,left:c,width:h,height:u}}};No.className="Text",No.defaultLineHeightRatio=1.15,No.defaultStyles=Object.assign({},Do.defaultStyles,{textAlign:"start",fontStyle:void 0,fontWeight:void 0,fontSize:10,fontFamily:"sans-serif",textBaseline:"alphabetic"}),No.ellipsis="…",No.punctuationMarks=[".",",","-",":",";","!","?","'",'"',"(",")"],No._measureText=_o(({text:e,font:t,textBaseline:i,textAlign:n})=>{const s=No.textContext;return s.font!==t&&(s.font=t),s.textBaseline!==i&&(s.textBaseline=i),s.textAlign!==n&&(s.textAlign=n),s.measureText(e)}),No._getTextSize=_o(({text:e,font:t})=>{const i=No.textContext;i.font!==t&&(i.font=t);const n=i.measureText(e);return{width:n.width,height:n.actualBoundingBoxAscent+n.actualBoundingBoxDescent}}),b([ns({redraw:3})],No.prototype,"x",2),b([ns({redraw:3})],No.prototype,"y",2),b([ns({redraw:3,changeCb:e=>e.onTextChange()})],No.prototype,"text",2),b([Lo()],No.prototype,"fontStyle",2),b([Lo()],No.prototype,"fontWeight",2),b([Lo()],No.prototype,"fontSize",2),b([Lo()],No.prototype,"fontFamily",2),b([ns({redraw:3})],No.prototype,"textAlign",2),b([ns({redraw:3})],No.prototype,"textBaseline",2),b([ns({redraw:3})],No.prototype,"lineHeight",2);var Oo=No,Fo=class{constructor(e){this.font=He(e)?e:Go(e)}size(e){return e.includes("\n")?Oo.getTextSizeMultiline(e.split("\n").map(e=>e.trim()),this.font):Oo.getTextSize(e,this.font)}width(e){const{width:t}=this.size(e);return t}};function Go(e){const{fontFamily:t,fontSize:i,fontStyle:n,fontWeight:s}=e;return[null!=n?n:"",null!=s?s:"",i+"px",t].join(" ").trim()}var Bo=class extends yt{constructor(){super(...arguments),this.enabled=!0,this.fontSize=12,this.fontFamily="Verdana, sans-serif"}getFont(){return Go(this)}};function Vo(e){const{parallelFlipRotation:t=0,regularFlipRotation:i=0}=e,n=e.rotation?Ls(Gs(e.rotation)):0,s=!n&&t>=0&&t<=Math.PI?-1:1,r=!n&&i>=0&&i<=Math.PI?-1:1;let o=0;return e.parallel?o=s*Math.PI/2:-1===r&&(o=Math.PI),{configuredRotation:n,defaultRotation:o,parallelFlipFlag:s,regularFlipFlag:r}}function Ho(e,t,i,n,s){const r=t>0&&t<=Math.PI,o=i>0&&i<=Math.PI;if(e){if(!t&&!i)return"center";if(n*(r||o?-1:1)==-1)return"end"}else if(n*s===-1)return"end";return"start"}function Uo(e,t,i,n,s){const{width:r,height:o}=t,a=new es(i,n,0,0);s.transformBBox(a,t);const{x:l,y:c}=t;return t.width=r,t.height=o,{point:{x:l,y:c},label:{text:e,width:r,height:o}}}b([$s(Qs)],Bo.prototype,"enabled",2),b([$s(fr,{optional:!0})],Bo.prototype,"color",2),b([$s(Mr,{optional:!0})],Bo.prototype,"fontStyle",2),b([$s(Tr,{optional:!0})],Bo.prototype,"fontWeight",2),b([$s(nr)],Bo.prototype,"fontSize",2),b([$s(er)],Bo.prototype,"fontFamily",2),b([$s(Js,{optional:!0})],Bo.prototype,"formatter",2);var zo=(e=>(e[e.SERIES_BACKGROUND_ZINDEX=0]="SERIES_BACKGROUND_ZINDEX",e[e.AXIS_GRID_ZINDEX=1]="AXIS_GRID_ZINDEX",e[e.AXIS_ZINDEX=2]="AXIS_ZINDEX",e[e.SERIES_CROSSLINE_RANGE_ZINDEX=3]="SERIES_CROSSLINE_RANGE_ZINDEX",e[e.SERIES_LAYER_ZINDEX=4]="SERIES_LAYER_ZINDEX",e[e.SERIES_HIGHLIGHT_ZINDEX=5]="SERIES_HIGHLIGHT_ZINDEX",e[e.AXIS_FOREGROUND_ZINDEX=6]="AXIS_FOREGROUND_ZINDEX",e[e.SERIES_CROSSHAIR_ZINDEX=7]="SERIES_CROSSHAIR_ZINDEX",e[e.SERIES_LABEL_ZINDEX=8]="SERIES_LABEL_ZINDEX",e[e.SERIES_CROSSLINE_LINE_ZINDEX=9]="SERIES_CROSSLINE_LINE_ZINDEX",e[e.SERIES_ANNOTATION_ZINDEX=10]="SERIES_ANNOTATION_ZINDEX",e[e.LEGEND_ZINDEX=11]="LEGEND_ZINDEX",e[e.NAVIGATOR_ZINDEX=12]="NAVIGATOR_ZINDEX",e))(zo||{});function Wo(e){return null!=e&&Object.hasOwn(e,"toString")&&He(e.toString())}function jo(e){return null!=e&&Object.hasOwn(e,"valueOf")&&ze(e.valueOf())}function $o(e){return ze(e)||Ne(e)||jo(e)}function Ko(e,t){return null!=e&&(!t||$o(e))}function Yo(e){return Wo(e)&&Object.hasOwn(e,"id")?e.id:e}var qo=e=>"value"===e?Br((e,t)=>"line"===t.target.type,e=>"range"===e.target.type?"crossLine type 'range' to have a 'range' property instead of 'value'":"crossLine property 'type' to be 'line'"):Br((e,t)=>"range"===t.target.type,e=>"line"===e.target.type?"crossLine type 'line' to have a 'value' property instead of 'range'":"crossLine property 'type' to be 'range'"),Xo=(e,t,i,n)=>{const s="line"===e&&void 0!==t,r="range"===e&&void 0!==i;if(!s&&!r)return!0;const[o,a]=null!=i?i:[t,void 0],l=qr.is(n)||vo.is(n),c=Ko(o,l)&&!isNaN(n.convert(o)),h=Ko(a,l)&&!isNaN(n.convert(a));if(s&&c||r&&c&&h)return!0;const u=["Expecting crossLine"];return r?(c||u.push(`range start ${Ur(o)}`),h||u.push(`${c?"":"and "}range end ${Ur(a)}`)):u.push(`value ${Ur(o)}`),u.push("to match the axis scale domain."),L.warnOnce(u.join(" ")),!1},Zo={top:{xTranslationDirection:0,yTranslationDirection:-1},bottom:{xTranslationDirection:0,yTranslationDirection:1},left:{xTranslationDirection:-1,yTranslationDirection:0},right:{xTranslationDirection:1,yTranslationDirection:0},topLeft:{xTranslationDirection:1,yTranslationDirection:-1},topRight:{xTranslationDirection:-1,yTranslationDirection:-1},bottomLeft:{xTranslationDirection:1,yTranslationDirection:1},bottomRight:{xTranslationDirection:-1,yTranslationDirection:1},inside:{xTranslationDirection:0,yTranslationDirection:0},insideLeft:{xTranslationDirection:1,yTranslationDirection:0},insideRight:{xTranslationDirection:-1,yTranslationDirection:0},insideTop:{xTranslationDirection:0,yTranslationDirection:1},insideBottom:{xTranslationDirection:0,yTranslationDirection:-1},insideTopLeft:{xTranslationDirection:1,yTranslationDirection:1},insideBottomLeft:{xTranslationDirection:1,yTranslationDirection:-1},insideTopRight:{xTranslationDirection:-1,yTranslationDirection:1},insideBottomRight:{xTranslationDirection:-1,yTranslationDirection:-1}},Qo={top:{xTranslationDirection:1,yTranslationDirection:0},bottom:{xTranslationDirection:-1,yTranslationDirection:0},left:{xTranslationDirection:0,yTranslationDirection:-1},right:{xTranslationDirection:0,yTranslationDirection:1},topLeft:{xTranslationDirection:-1,yTranslationDirection:-1},topRight:{xTranslationDirection:-1,yTranslationDirection:1},bottomLeft:{xTranslationDirection:1,yTranslationDirection:-1},bottomRight:{xTranslationDirection:1,yTranslationDirection:1},inside:{xTranslationDirection:0,yTranslationDirection:0},insideLeft:{xTranslationDirection:0,yTranslationDirection:1},insideRight:{xTranslationDirection:0,yTranslationDirection:-1},insideTop:{xTranslationDirection:-1,yTranslationDirection:0},insideBottom:{xTranslationDirection:1,yTranslationDirection:0},insideTopLeft:{xTranslationDirection:-1,yTranslationDirection:1},insideBottomLeft:{xTranslationDirection:1,yTranslationDirection:1},insideTopRight:{xTranslationDirection:-1,yTranslationDirection:-1},insideBottomRight:{xTranslationDirection:1,yTranslationDirection:-1}};function Jo({yDirection:e,padding:t=0,position:i="top",bbox:n}){const s=e?Zo:Qo,{xTranslationDirection:r,yTranslationDirection:o}=s[i];return{xTranslation:r*(t+(e?n.width:n.height)/2),yTranslation:o*(t+(e?n.height:n.width)/2)}}var ea=({yDirection:e,xEnd:t,yStart:i,yEnd:n})=>e?{x:t/2,y:i}:{x:t,y:isNaN(n)?i:(i+n)/2},ta=({yDirection:e,xStart:t,xEnd:i,yStart:n,yEnd:s})=>e?{x:t,y:isNaN(s)?n:(n+s)/2}:{x:i/2,y:n},ia=({yDirection:e,xEnd:t,yStart:i,yEnd:n})=>e?{x:t,y:isNaN(n)?i:(i+n)/2}:{x:t/2,y:isNaN(n)?i:n},na=({yDirection:e,xStart:t,xEnd:i,yStart:n,yEnd:s})=>e?{x:i/2,y:isNaN(s)?n:s}:{x:t,y:isNaN(s)?n:(n+s)/2},sa=({yDirection:e,xStart:t,xEnd:i,yStart:n})=>e?{x:t/2,y:n}:{x:i,y:n},ra=({yDirection:e,xStart:t,yStart:i,yEnd:n})=>e?{x:t,y:isNaN(n)?i:n}:{x:t,y:i},oa=({yDirection:e,xEnd:t,yStart:i,yEnd:n})=>e?{x:t,y:i}:{x:t,y:isNaN(n)?i:n},aa=({yDirection:e,xStart:t,xEnd:i,yStart:n,yEnd:s})=>e?{x:i,y:isNaN(s)?n:s}:{x:t,y:isNaN(s)?n:s},la={top:{c:ea},bottom:{c:na},left:{c:ta},right:{c:ia},topLeft:{c:sa},topRight:{c:oa},bottomLeft:{c:ra},bottomRight:{c:aa},inside:{c:({xEnd:e,yStart:t,yEnd:i})=>({x:e/2,y:isNaN(i)?t:(t+i)/2})},insideLeft:{c:ta},insideRight:{c:ia},insideTop:{c:ea},insideBottom:{c:na},insideTopLeft:{c:sa},insideBottomLeft:{c:ra},insideTopRight:{c:oa},insideBottomRight:{c:aa}},ca=Or(["top","left","right","bottom","topLeft","topRight","bottomLeft","bottomRight","inside","insideLeft","insideRight","insideTop","insideBottom","insideTopLeft","insideBottomLeft","insideTopRight","insideBottomRight"],"crossLine label position"),ha=class{constructor(){this.enabled=void 0,this.text=void 0,this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=14,this.fontFamily="Verdana, sans-serif",this.padding=5,this.color="rgba(87, 87, 87, 1)",this.position=void 0,this.rotation=void 0,this.parallel=void 0}};b([$s(Qs,{optional:!0})],ha.prototype,"enabled",2),b([$s(er,{optional:!0})],ha.prototype,"text",2),b([$s(Mr,{optional:!0})],ha.prototype,"fontStyle",2),b([$s(Tr,{optional:!0})],ha.prototype,"fontWeight",2),b([$s(nr)],ha.prototype,"fontSize",2),b([$s(er)],ha.prototype,"fontFamily",2),b([$s(tr)],ha.prototype,"padding",2),b([$s(fr,{optional:!0})],ha.prototype,"color",2),b([$s(ca,{optional:!0})],ha.prototype,"position",2),b([$s(rr,{optional:!0})],ha.prototype,"rotation",2),b([$s(Qs,{optional:!0})],ha.prototype,"parallel",2);var ua=class e{constructor(){this.id=Gn(this),this.enabled=void 0,this.type=void 0,this.range=void 0,this.value=void 0,this.fill=void 0,this.fillOpacity=void 0,this.stroke=void 0,this.strokeWidth=void 0,this.strokeOpacity=void 0,this.lineDash=void 0,this.label=new ha,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.sideFlag=-1,this.parallelFlipRotation=0,this.regularFlipRotation=0,this.direction="x",this.group=new xo({name:`${this.id}`,layer:!0,zIndex:e.LINE_LAYER_ZINDEX}),this.labelGroup=new xo({name:`${this.id}`,layer:!0,zIndex:e.LABEL_LAYER_ZINDEX}),this.crossLineRange=new Io,this.crossLineLabel=new Oo,this.labelPoint=void 0,this.data=[],this.startLine=!1,this.endLine=!1,this.isRange=!1;const{group:t,labelGroup:i,crossLineRange:n,crossLineLabel:s}=this;t.append(n),i.append(s),n.pointerEvents=1}update(e){const{enabled:t,data:i,type:n,value:s,range:r,scale:o}=this;if(!(n&&o&&t&&e&&Xo(n,s,r,o)&&0!==i.length))return this.group.visible=!1,void(this.labelGroup.visible=!1);this.group.visible=e,this.labelGroup.visible=e,this.group.zIndex=this.getZIndex(this.isRange),this.updateNodes()}calculateLayout(e,t){if(!e)return;if(!this.createNodeData(t))return;const{sideFlag:i,gridLength:n,data:s}=this,r=[],o=i*n,a=s[0],l=s[1],c=new es(Math.min(0,o),Math.min(a,l),Math.abs(0-o),Math.abs(a-l));r.push(c);const h=this.computeLabelBBox();return h&&r.push(h),es.merge(r)}updateNodes(){this.updateRangeNode(),this.label.enabled&&(this.updateLabel(),this.positionLabel())}createNodeData(e){var t,i,n;const{scale:s,gridLength:r,sideFlag:o,direction:a,label:{position:l="top"},clippedRange:c,strokeWidth:h=0}=this;if(this.data=[],!s)return!1;const u=null!=(t=s.bandwidth)?t:0,d=null!=(i=s.step)?i:0,p=(e?-1:1)*(s instanceof Ws?(d-u)/2:0),[g,f]=[0,o*r];let[m,y]=this.getRange();const v=void 0===y&&vo.is(s)?u/2+p:0;let[b,C]=[Number(s.convert(m,{clampMode:"clamped"}))-p+v,s.convert(y,{clampMode:"clamped"})+u+p];b=Un(b,c),C=Un(C,c),[m,y]=[Number(s.convert(m))+v,s.convert(y)+u];const w=(m===b||y===C||b!==C)&&Math.abs(C-b)>0;if(w&&b>C&&([b,C]=[C,b],[m,y]=[y,m]),m-p>=b&&(m-=p),y+p<=C&&(y+=p),this.isRange=w,this.startLine=h>0&&m>=b&&m<=b+p,this.endLine=h>0&&y>=C-u-p&&y<=C,!w&&!this.startLine&&!this.endLine)return!1;if(this.data=[b,C],this.label.enabled){const e="y"===a,{c:t=ea}=null!=(n=la[l])?n:{},{x:i,y:s}=t({yDirection:e,xStart:g,xEnd:f,yStart:b,yEnd:C});this.labelPoint={x:i,y:s}}return!0}updateRangeNode(){var e;const{crossLineRange:t,sideFlag:i,gridLength:n,data:s,startLine:r,endLine:o,isRange:a,fill:l,fillOpacity:c,stroke:h,strokeWidth:u,lineDash:d}=this;t.x1=0,t.x2=i*n,t.y1=s[0],t.y2=s[1],t.startLine=r,t.endLine=o,t.isRange=a,t.fill=l,t.fillOpacity=null!=c?c:1,t.stroke=h,t.strokeWidth=null!=u?u:1,t.strokeOpacity=null!=(e=this.strokeOpacity)?e:1,t.lineDash=d}updateLabel(){const{crossLineLabel:e,label:t}=this;t.text&&(e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.fontSize=t.fontSize,e.fontFamily=t.fontFamily,e.fill=t.color,e.text=t.text)}positionLabel(){const{crossLineLabel:e,labelPoint:{x:t,y:i}={},label:{parallel:n,rotation:s,position:r="top",padding:o=0},direction:a,parallelFlipRotation:l,regularFlipRotation:c}=this;if(void 0===t||void 0===i)return;const{defaultRotation:h,configuredRotation:u}=Vo({rotation:s,parallel:n,regularFlipRotation:c,parallelFlipRotation:l});e.rotation=h+u,e.textBaseline="middle",e.textAlign="center";const d=e.computeTransformedBBox();if(!d)return;const p="y"===a,{xTranslation:g,yTranslation:f}=Jo({yDirection:p,padding:o,position:r,bbox:d});e.translationX=t+g,e.translationY=i+f}getZIndex(t=!1){return t?e.RANGE_LAYER_ZINDEX:e.LINE_LAYER_ZINDEX}getRange(){var e;const{value:t,range:i,scale:n}=this,s=qr.is(n)||vo.is(n),r=null!=(e=null==i?void 0:i[0])?e:t;let o=null==i?void 0:i[1];return s||void 0!==o||(o=r),s&&r===o&&(o=void 0),[r,o]}computeLabelBBox(){const{label:e}=this;if(!e.enabled)return;const t=new Oo;t.fontFamily=e.fontFamily,t.fontSize=e.fontSize,t.fontStyle=e.fontStyle,t.fontWeight=e.fontWeight,t.text=e.text;const{labelPoint:{x:i,y:n}={},label:{parallel:s,rotation:r,position:o="top",padding:a=0},direction:l,parallelFlipRotation:c,regularFlipRotation:h}=this;if(void 0===i||void 0===n)return;const{configuredRotation:u}=Vo({rotation:r,parallel:s,regularFlipRotation:h,parallelFlipRotation:c});t.rotation=u,t.textBaseline="middle",t.textAlign="center";const d=t.computeTransformedBBox();if(!d)return;const p="y"===l,{xTranslation:g,yTranslation:f}=Jo({yDirection:p,padding:a,position:o,bbox:d});return t.translationX=i+g,t.translationY=n+f,t.computeTransformedBBox()}calculatePadding(e){var t,i,n,s,r,o,a,l;const{isRange:c,startLine:h,endLine:u,direction:d,label:{padding:p=0,position:g="top"}}=this;if(!c&&!h&&!u)return;const f=this.computeLabelBBox();if(null==(null==f?void 0:f.x)||null==(null==f?void 0:f.y))return;const m=function({yDirection:e,bbox:t,padding:i=0,position:n="top"}){const s={};return n.startsWith("inside")||("top"!==n||e?"bottom"!==n||e?"left"===n&&e?s.left=i+t.width:"right"===n&&e&&(s.right=i+t.width):s.bottom=i+t.height:s.top=i+t.height),s}({yDirection:"y"===d,padding:p,position:g,bbox:f});e.left=Math.max(null!=(t=e.left)?t:0,null!=(i=m.left)?i:0),e.right=Math.max(null!=(n=e.right)?n:0,null!=(s=m.right)?s:0),e.top=Math.max(null!=(r=e.top)?r:0,null!=(o=m.top)?o:0),e.bottom=Math.max(null!=(a=e.bottom)?a:0,null!=(l=m.bottom)?l:0)}};ua.LINE_LAYER_ZINDEX=9,ua.RANGE_LAYER_ZINDEX=3,ua.LABEL_LAYER_ZINDEX=8,ua.className="CrossLine",b([$s(Qs,{optional:!0})],ua.prototype,"enabled",2),b([$s(Or(["range","line"],"a crossLine type"),{optional:!0})],ua.prototype,"type",2),b([$s(Ys(qo("range"),ar.restrict({length:2})),{optional:!0})],ua.prototype,"range",2),b([$s(qo("value"),{optional:!0})],ua.prototype,"value",2),b([$s(fr,{optional:!0})],ua.prototype,"fill",2),b([$s(sr,{optional:!0})],ua.prototype,"fillOpacity",2),b([$s(fr,{optional:!0})],ua.prototype,"stroke",2),b([$s(tr,{optional:!0})],ua.prototype,"strokeWidth",2),b([$s(sr,{optional:!0})],ua.prototype,"strokeOpacity",2),b([$s(Er,{optional:!0})],ua.prototype,"lineDash",2);var da=ua,pa=class{constructor(){this.moduleMap=new Map}*modules(){for(const e of this.moduleMap.values())yield e.moduleInstance}addModule(e,t){if(this.moduleMap.has(e.optionsKey))throw new Error(`AG Charts - module already initialised: ${e.optionsKey}`);this.moduleMap.set(e.optionsKey,{module:e,moduleInstance:t(e)})}removeModule(e){var t;const i=He(e)?e:e.optionsKey;null==(t=this.moduleMap.get(i))||t.moduleInstance.destroy(),this.moduleMap.delete(i)}getModule(e){var t;return null==(t=this.moduleMap.get(He(e)?e:e.optionsKey))?void 0:t.moduleInstance}isEnabled(e){return this.moduleMap.has(He(e)?e:e.optionsKey)}mapModules(e){return Array.from(this.moduleMap.values(),(t,i)=>e(t.moduleInstance,i))}destroy(){var e;for(const t of this.moduleMap.keys())null==(e=this.moduleMap.get(t))||e.moduleInstance.destroy();this.moduleMap.clear()}},ga={};function fa(e,t){const{nodes:i,selections:n}=Ts(e);for(const e of n){for(const i of e.nodes()){const e=t(i,i.datum);i.setProperties(e)}e.cleanup()}for(const e of i){const i=t(e,e.datum);e.setProperties(i)}}v(ga,{resetMotion:()=>fa});var ma=class{constructor(e,t,i){this.states=t,this.preTransitionCb=i,this.debug=In.create(!0,"animation"),this.state=e,this.debug(`%c${this.constructor.name} | init -> ${e}`,"color: green")}transition(e,t){var i,n;const s=this.states[this.state],r=null==s?void 0:s[e];if(!r)return void this.debug(`%c${this.constructor.name} | ${this.state} -> ${e} -> ${this.state}`,"color: grey");let o=this.state;return"string"==typeof r?o=r:"object"==typeof r&&(o=r.target),this.debug(`%c${this.constructor.name} | ${this.state} -> ${e} -> ${o}`,"color: green"),null==(i=this.preTransitionCb)||i.call(this,this.state,o),this.state=o,"function"==typeof r?r(t):"object"==typeof r&&(null==(n=r.action)||n.call(r,t)),this.state}},ya=e=>`(${e})`,va=e=>`${ya(e)}?`,ba=e=>va(`?:${e}`),Ca=new RegExp(["^",ba(`${va(".")}${ya("[<>=^]")}`),va("[+\\-( ]"),va("[$€£¥₣₹#]"),va("0"),va("\\d+"),va(","),ba(`\\.${ya("\\d+")}`),va("~"),va("[%a-z]"),"$"].join(""),"i"),wa=new RegExp(["^",ya(".*?"),`#\\{${ya(".+?")}\\}`,ya(".*?"),"$"].join(""));function Sa(e){let t,i;const n=wa.exec(e);n&&([,t,e,i]=n);const s=Ca.exec(e);if(!s)throw new Error(`The number formatter is invalid: ${e}`);const[,r,o,a,l,c,h,u,d,p,g]=s;return{fill:r,align:o,sign:a,symbol:l,zero:c,width:parseInt(h),comma:u,precision:parseInt(d),trim:Boolean(p),type:g,prefix:t,suffix:i}}function xa(e){const t="string"==typeof e?Sa(e):e,{fill:i,align:n,sign:s="-",symbol:r,zero:o,width:a,comma:l,type:c,prefix:h="",suffix:u="",precision:d}=t;let{trim:p}=t;const g=void 0===d||isNaN(d);let f,m;if(c)if(c in Ma&&c in Aa)f=g?Aa[c]:Ma[c];else if(c in Ma)f=Ma[c];else{if(!(c in Aa))throw new Error(`The number formatter type is invalid: ${c}`);f=Aa[c]}else f=Ma.g,p=!0;return m=null==d||g?c?6:12:d,e=>{let t=f(e,m);return p&&(t=t.replace(/\.0+$/,"").replace(/(\.[1-9])0+$/,"$1")),l&&(t=function(e,t){let i=e.indexOf(".");i<0&&(i=e.length);const n=e.substring(0,i).split(""),s=e.substring(i);for(let e=n.length-3;e>0;e-=3)n.splice(e,0,t);return`${n.join("")}${s}`}(t,l)),t=function(e,t,i=""){if("("===i)return e>=0?t:`(${t})`;return`${e>=0?"+"===i?"+":"":"−"}${t}`}(e,t,s),r&&"#"!==r&&(t=`${r}${t}`),"#"===r&&"x"===c&&(t=`0x${t}`),"s"===c&&(t=`${t}${function(e){return Ra[Ta(e)]}(e)}`),"%"!==c&&"p"!==c||(t=`${t}%`),null==a||isNaN(a)||(t=function(e,t,i=" ",n=">"){let s=e;if(">"!==n&&n){if("<"===n)s=s.padEnd(t,i);else if("^"===n){const e=Math.max(0,t-s.length),n=Math.ceil(e/2),r=Math.floor(e/2);s=s.padStart(n+s.length,i),s=s.padEnd(r+s.length,i)}}else s=s.padStart(t,i);return s}(t,a,null!=i?i:o,n)),t=`${h}${t}${u}`,t}}var Ea=e=>Math.floor(Math.abs(e)),Aa={b:e=>Ea(e).toString(2),c:e=>String.fromCharCode(e),d:e=>Math.round(Math.abs(e)).toFixed(0),o:e=>Ea(e).toString(8),x:e=>Ea(e).toString(16),X:e=>Aa.x(e).toUpperCase(),n:e=>Aa.d(e),"%":e=>`${Ea(100*e).toFixed(0)}`},Ma={e:(e,t)=>Math.abs(e).toExponential(t),E:(e,t)=>Ma.e(e,t).toUpperCase(),f:(e,t)=>Math.abs(e).toFixed(t),F:(e,t)=>Ma.f(e,t).toUpperCase(),g:(e,t)=>{if(0===e)return"0";const i=Math.abs(e),n=Math.floor(Math.log10(i));return n>=-4&&n<t?i.toFixed(t-1-n):i.toExponential(t-1)},G:(e,t)=>Ma.g(e,t).toUpperCase(),n:(e,t)=>Ma.g(e,t),p:(e,t)=>Ma.r(100*e,t),r:(e,t)=>{if(0===e)return"0";const i=Math.abs(e),n=Math.floor(Math.log10(i))-(t-1);if(n<=0)return i.toFixed(-n);const s=Math.pow(10,n);return(Math.round(i/s)*s).toFixed()},s:(e,t)=>{const i=Ta(e);return Ma.r(e/Math.pow(10,i),t)},"%":(e,t)=>Ma.f(100*e,t)};function Ta(e){return Hn(Da,e?3*Math.floor(Math.log10(Math.abs(e))/3):0,Ia)}var Da=-24,Ia=24,Ra={[Da]:"y",[-21]:"z",[-18]:"a",[-15]:"f",[-12]:"p",[-9]:"n",[-6]:"µ",[-3]:"m",0:"",3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",[Ia]:"Y"};function ka(e,t){const i=Sa(null!=t?t:",f"),{precision:n}=i;(null==n||isNaN(n))&&("f"===i.type||"%"===i.type?i.precision=Math.max(...e.map(e=>{if("number"!=typeof e||0===e)return 0;const t=Math.floor(Math.log10(Math.abs(e))),n=i.type?6:12,s=e.toExponential(n-1).replace(/\.?0+e/,"e"),r=s.indexOf(".");if(r<0)return t>=0?0:-t;const o=s.indexOf("e")-r;return Math.max(0,o-t-1)})):i.type&&!(i.type in Ma)||(i.precision=Math.max(...e.map(e=>{if("number"!=typeof e)return 0;const t=e.toExponential((i.type?6:12)-1).replace(/\.?0+e/,"e");return t.substring(0,t.indexOf("e")).replace(".","").length}))));const s=xa(i);return e=>s(Number(e))}var Pa=class e extends qr{constructor(){super([1,10],[0,1]),this.type="log",this.base=10,this.baseLog=k,this.basePow=k,this.log=e=>Math.min(...this.domain)>=0?this.baseLog(e):-this.baseLog(-e),this.pow=e=>Math.min(...this.domain)>=0?this.basePow(e):-this.basePow(-e),this.defaultClampMode="clamped"}toDomain(e){return e}transform(e){return Math.min(...this.domain)>=0?Math.log(e):-Math.log(-e)}transformInvert(e){return Math.min(...this.domain)>=0?Math.exp(e):-Math.exp(-e)}refresh(){this.base<=0&&(this.base=0,L.warnOnce("expecting a finite Number greater than to 0")),super.refresh()}update(){!this.domain||this.domain.length<2||(this.baseLog=e.getBaseLogMethod(this.base),this.basePow=e.getBasePowerMethod(this.base),this.nice&&this.updateNiceDomain())}updateNiceDomain(){const[e,t]=this.domain,i=e>t?Math.ceil:Math.floor,n=e>t?Math.floor:Math.ceil,s=this.pow(i(this.log(e))),r=this.pow(n(this.log(t)));this.niceDomain=[s,r]}ticks(){var e;const t=null!=(e=this.tickCount)?e:10;if(!this.domain||this.domain.length<2||t<1)return[];this.refresh();const i=this.base,[n,s]=this.getDomain(),r=Math.min(n,s),o=Math.max(n,s);let a=this.log(r),l=this.log(o);if(this.interval){const e=Math.abs(this.interval),t=Math.abs(l-a);let i=po(a,l,Math.min(t,e));i=lo(i.fractionDigits,i.map(e=>this.pow(e)).filter(e=>e>=r&&e<=o));const n=this.getPixelRange();if(!go({start:r,stop:o,interval:e,count:i.length,availableRange:n}))return i}if(i%1!=0||l-a>=t){let e=co(a,l,Math.min(l-a,t));return e=lo(e.fractionDigits,e.map(e=>this.pow(e))),e}const c=[],h=r>0;a=Math.floor(a)-1,l=Math.round(l)+1;const u=Wn(this.range)/t;let d=1/0;for(let e=a;e<=l;e++){const t=this.convert(this.pow(e+1));for(let n=1;n<i;n++){const s=h?n:i-n+1,a=this.pow(e)*s,l=this.convert(a),p=Math.abs(d-l),g=Math.abs(l-t);a>=r&&a<=o&&(1===n||p>=u&&g>=u||0===c.length)&&(c.push(a),d=l)}}return c}tickFormat({count:e,ticks:t,specifier:i}){return e!==1/0&&null==t&&this.ticks(),null!=i||(i=10===this.base?".0e":","),He(i)?xa(i):i}static getBaseLogMethod(e){switch(e){case 10:return Math.log10;case Math.E:return Math.log;case 2:return Math.log2;default:const t=Math.log(e);return e=>Math.log(e)/t}}static getBasePowerMethod(e){switch(e){case 10:return e=>e>=0?p(10,e):1/p(10,-e);case Math.E:return Math.exp;default:return t=>p(e,t)}}};b([Us],Pa.prototype,"base",2);var _a=Pa,La=class e{constructor(e,t,i=!0){this.parentNode=e,this.autoCleanup=i,this.garbageBin=new Set,this._nodesMap=new Map,this._nodes=[],this.data=[],this.debug=In.create(!0,"scene","scene:selections"),this.nodeFactory=Object.prototype.isPrototypeOf.call(cs,t)?()=>new t:t}static select(t,i,n=!0){return new e(t,i,n)}static selectAll(e,t){const i=[],n=e=>{t(e)&&i.push(e),e.children.forEach(n)};return n(e),i}static selectByClass(t,i,...n){return e.selectAll(t,e=>e instanceof i||n.some(t=>e instanceof t))}static selectByTag(t,i){return e.selectAll(t,e=>e.tag===i)}createNode(e,t,i){const n=this.nodeFactory(e);return n.datum=e,null==t||t(n),null==i?this._nodes.push(n):this._nodes.splice(i,0,n),this.parentNode.appendChild(n),n}update(e,t,i){if(this.garbageBin.size>0&&this.debug(`Selection - update() called with pending garbage: ${e}`),i){const n=new Map(e.map((e,t)=>[i(e),[e,t]]));for(const[e,t]of this._nodesMap.entries())if(n.has(t)){const[i]=n.get(t);e.datum=i,this.garbageBin.delete(e),n.delete(t)}else this.garbageBin.add(e);for(const[e,[i,s]]of n.entries())this._nodesMap.set(this.createNode(i,t,s),e)}else{const i=Math.max(e.length,this.data.length);for(let n=0;n<i;n++)n>=e.length?this.garbageBin.add(this._nodes[n]):n>=this._nodes.length?this.createNode(e[n],t):(this._nodes[n].datum=e[n],this.garbageBin.delete(this._nodes[n]))}return this.data=e.slice(),this.autoCleanup&&this.cleanup(),this}cleanup(){return 0===this.garbageBin.size||(this._nodes=this._nodes.filter(e=>!this.garbageBin.has(e)||(this._nodesMap.delete(e),this.garbageBin.delete(e),this.parentNode.removeChild(e),!1))),this}clear(){return this.update([]),this}isGarbage(e){return this.garbageBin.has(e)}hasGarbage(){return this.garbageBin.size>0}each(e){for(const t of this._nodes.entries())e(t[1],t[1].datum,t[0]);return this}*[Symbol.iterator](){for(let e=0;e<this._nodes.length;e++){const t=this._nodes[e],i=this._nodes[e].datum;yield{node:t,datum:i,index:e}}}select(t){return e.selectAll(this.parentNode,t)}selectByClass(t){return e.selectByClass(this.parentNode,t)}selectByTag(t){return e.selectByTag(this.parentNode,t)}nodes(){return this._nodes}};function Na(e,t,i,n){const s=e-i,r=t-n;return s*s+r*r}function Oa(e,t,i,n,s,r,o){if(i===s&&n===r)return Math.min(o,Na(e,t,i,n));const a=s-i,l=r-n,c=Math.max(0,Math.min(1,((e-i)*a+(t-n)*l)/(a*a+l*l))),h=i+c*a,u=n+c*l;return Math.min(o,Na(e,t,h,u))}function Fa(e,t,i,n,s,r,o,a,l){if(a&&([o,r]=[r,o]),!Fs(Math.atan2(t-n,e-i),r,o)){const o=i+Math.cos(r)*s,a=n+Math.sin(r)*s,c=i+Math.cos(r)*s,h=n+Math.sin(r)*s;return Math.min(l,Na(e,t,o,a),Na(e,t,c,h))}const c=s-Math.sqrt(Na(e,t,i,n));return Math.min(l,c*c)}var Ga=class extends Do{constructor(e={}){super(e),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.restoreOwnStyles()}set x(e){this.x1=e,this.x2=e}set y(e){this.y1=e,this.y2=e}computeBBox(){return new es(Math.min(this.x1,this.x2),Math.min(this.y1,this.y2),Math.abs(this.x2-this.x1),Math.abs(this.y2-this.y1))}isPointInPath(e,t){if(this.x1===this.x2||this.y1===this.y2){const{x:i,y:n}=this.transformPoint(e,t);return this.computeBBox().grow(this.strokeWidth/2).containsPoint(i,n)}return!1}distanceSquared(e,t){const{x1:i,y1:n,x2:s,y2:r}=this;return Oa(e,t,i,n,s,r,1/0)}render(e){var t;const{ctx:i,forceRender:n,stats:s,devicePixelRatio:r}=e;if(0===this.dirty&&!n)return void(s&&(s.nodesSkipped+=this.nodeCount.count));this.computeTransformMatrix(),this.matrix.toContext(i);let{x1:o,y1:a,x2:l,y2:c}=this;if(o===l){const{strokeWidth:e}=this,t=Math.round(o*r)/r+Math.trunc(e*r)%2/(2*r);o=t,l=t}else if(a===c){const{strokeWidth:e}=this,t=Math.round(a*r)/r+Math.trunc(e*r)%2/(2*r);a=t,c=t}i.beginPath(),i.moveTo(o,a),i.lineTo(l,c),this.fillStroke(i),null==(t=this.fillShadow)||t.markClean(),super.render(e)}};function Ba(e,t,i,n,s,r){if(0===e.size)return!1;let o=e.x,a=e.y;null!=t&&(o-=(t.x-.5)*e.size,a-=(t.y-.5)*e.size);let l=o;o<i?l=i:o>i+s&&(l=i+s);let c=a;a<n?c=n:a>n+r&&(c=n+r);const h=o-l,u=a-c;return Math.sqrt(h*h+u*u)<=.5*e.size}function Va(e,t,i,n,s){const r=e.x+e.width>t&&e.x<t+n,o=e.y+e.height>i&&e.y<i+s;return r&&o}function Ha(e,t,i,n,s){return t+n<e.x+e.width&&t>e.x&&i>e.y&&i+s<e.y+e.height}function Ua(e){return null!=e&&"object"==typeof e.point&&"object"==typeof e.label}Ga.className="Line",Ga.defaultStyles=Object.assign({},Do.defaultStyles,{fill:void 0,strokeWidth:1}),b([ns({redraw:3})],Ga.prototype,"x1",2),b([ns({redraw:3})],Ga.prototype,"y1",2),b([ns({redraw:3})],Ga.prototype,"x2",2),b([ns({redraw:3})],Ga.prototype,"y2",2);var za={top:{x:0,y:-1},bottom:{x:0,y:1},left:{x:-1,y:0},right:{x:1,y:0}};function Wa(e,t){return e.length===t.length&&e.every((e,i)=>{const n=t[i];return Array.isArray(e)&&Array.isArray(n)?Wa(e,n):e===n})}function ja(e,t){return e.length===t.length&&e.every((e,i)=>Number(e)===Number(t[i]))}function $a(e){const t=Pe(e)?e:e.split(".");if(1===t.length){const[e]=t;return Te((t,i,n)=>t[e]=n,t=>t[e])}return Te((e,i,n)=>tt(e,t,n),e=>Je(e,t))}function Ka(e){return Te((t,i,n)=>t[e]=n)}function Ya(e,t){return Te((i,n,s)=>i[e][null!=t?t:n]=s)}function qa(e){const{newValue:t,oldValue:i,changeValue:n}=e;return Te((e,s,r,o)=>(r!==o&&(void 0!==o&&(null==i||i.call(e,o)),void 0!==r&&(null==t||t.call(e,r)),null==n||n.call(e,r,o)),r))}function Xa(e){return t=e,(e,i)=>{Me(e,i).observers.push(t)};var t}function Za(e,t,i){void 0===i||""===i?null==e||e.removeAttribute(t):null==e||e.setAttribute(t,i.toString())}function Qa(e,t,i,n,s){let{top:r,right:o,bottom:a,left:l,width:c,height:h}=s;return null!=l?null!=c?o=i-l+c:null!=o&&(c=i-l-o):null!=o&&null!=c&&(l=i-o-c),null!=r?null!=h?a=n-r-h:null!=a&&(h=n-a-r):null!=a&&null!=h&&(r=n-a-h),null==c?null==h?(c=e,h=t):c=Math.ceil(e*h/t):null==h&&(h=Math.ceil(t*c/e)),null==l&&(l=null==o?Math.floor((i-c)/2):i-o-c),null==r&&(r=null==a?Math.floor((n-h)/2):n-h-a),{x:l,y:r,width:c,height:h}}var Ja="ag-chart-tooltip",el="ag-chart-dark-tooltip",tl={html:"",ariaLabel:""};function il(e){const t=(e,t,i)=>0===t||"."!==i[t-1]?". ":" ";return e.replace(/<br\s*\/?>/g,t).replace(/<\/p\s+>/g,t).replace(/<\/li\s*\/>/g,t).replace(/<[^>]+>/g,"")}function nl(e,t){var i,n,s;if("string"==typeof e)return{html:e,ariaLabel:e};const{content:r=(null!=(i=null==t?void 0:t.content)?i:""),title:o=(null==t?void 0:t.title),color:a=(null!=(n=null==t?void 0:t.color)?n:"white"),backgroundColor:l=(null!=(s=null==t?void 0:t.backgroundColor)?s:"#888")}=e;return{html:`${o?`<div class="${Ja}-title"\n        style="color: ${a}; background-color: ${l}">${o}</div>`:""}${r?`<div class="${Ja}-content">${r}</div>`:""}`,ariaLabel:il(`${o?`${o}: `:""}${r}`)}}var sl=class extends yt{constructor(){super(...arguments),this.type="pointer",this.xOffset=0,this.yOffset=0}};b([$s(Or(["pointer","node","top","right","bottom","left","top-left","top-right","bottom-right","bottom-left"],"a position type"))],sl.prototype,"type",2),b([$s(tr)],sl.prototype,"xOffset",2),b([$s(tr)],sl.prototype,"yOffset",2);var rl=class extends yt{constructor(){super(),this.enabled=!0,this.delay=0,this.range="nearest",this.wrapping="hyphenate",this.position=new sl,this.darkTheme=!1,this.enableInteraction=!1,this.lastVisibilityChange=Date.now(),this.wrapTypes=["always","hyphenate","on-space","never"],this.showTimeout=0,this._showArrow=!0,this.element=xn("div",Ja),Za(this.element,"aria-hidden",!0),this.root=wn("body"),this.root.appendChild(this.element)}destroy(){this.element.remove()}isVisible(){return!this.element.classList.contains(Ja+"-hidden")}show(e,t,i,n=!1){var s,r,o,a,l,c,h,u,d;const{element:p}=this;if(null!=i)p.innerHTML=i.html;else if(!p.innerHTML)return void this.toggle(!1);const g=null!=(r=null==(s=t.position)?void 0:s.type)?r:this.position.type,f=null!=(a=null==(o=t.position)?void 0:o.xOffset)?a:0,m=null!=(c=null==(l=t.position)?void 0:l.yOffset)?c:0,y=this.getTooltipBounds({positionType:g,meta:t,yOffset:m,xOffset:f,canvasRect:e}),v=this.getWindowSize(),b=Qa(p.clientWidth,p.clientHeight,e.width,e.height,y);b.x+=e.x,b.y+=e.y;const C=Hn(0,b.x,v.width-p.clientWidth-1),w=Hn(0,b.y,v.height-p.clientHeight),S=C!==b.x||w!==b.y,x=!("node"!==g&&"pointer"!==g||S||f||m),E=null!=(u=null!=(h=t.showArrow)?h:this.showArrow)?u:x;this.updateShowArrow(E),p.style.transform=`translate(${Math.round(C)}px, ${Math.round(w)}px)`,this.enableInteraction=null!=(d=t.enableInteraction)&&d,this.delay>0&&!n?(this.toggle(!1),this.showTimeout=setTimeout(()=>{this.toggle(!0)},this.delay)):this.toggle(!0)}getWindowSize(){const{innerWidth:e,innerHeight:t}=Sn();return{width:e,height:t}}toggle(e){const{classList:t}=this.element,i=(e,i)=>t.toggle(`${Ja}-${e}`,i),n=this.isVisible();let s=1/0;if(e||clearTimeout(this.showTimeout),n!==e){const e=Date.now();s=e-this.lastVisibilityChange,this.lastVisibilityChange=e}s>5&&i("no-animation",!n&&e&&s>100),i("no-interaction",!this.enableInteraction),i("hidden",!e),i("arrow",this._showArrow),t.toggle(el,this.darkTheme);for(const e of this.wrapTypes)t.toggle(`${Ja}-wrap-${e}`,e===this.wrapping)}pointerLeftOntoTooltip(e){var t;if(!this.enableInteraction)return!1;const i=null==(t=e.sourceEvent.relatedTarget)?void 0:t.classList,n=Boolean(["","-title","-content"].filter(e=>null==i?void 0:i.contains(`${Ja}${e}`)));return void 0!==i&&n}updateShowArrow(e){this._showArrow=e}getTooltipBounds({positionType:e,meta:t,yOffset:i,xOffset:n,canvasRect:s}){const{clientWidth:r,clientHeight:o}=this.element,a={width:r,height:o};switch(e){case"node":case"pointer":return a.top=t.offsetY+i-o-8,a.left=t.offsetX+n-r/2,a;case"top":return a.top=i,a.left=s.width/2-r/2+n,a;case"right":return a.top=s.height/2-o/2+i,a.left=s.width-r/2+n,a;case"left":return a.top=s.height/2-o/2+i,a.left=n,a;case"bottom":return a.top=s.height-o+i,a.left=s.width/2-r/2+n,a;case"top-left":return a.top=i,a.left=n,a;case"top-right":return a.top=i,a.left=s.width-r+n,a;case"bottom-right":return a.top=s.height-o+i,a.left=s.width-r+n,a;case"bottom-left":return a.top=s.height-o+i,a.left=n,a}}};b([$s(Qs)],rl.prototype,"enabled",2),b([$s(Qs,{optional:!0})],rl.prototype,"showArrow",2),b([Xa((e,t,i)=>{t&&e.element.classList.add(t),i&&e.element.classList.remove(i)}),$s(er,{optional:!0})],rl.prototype,"class",2),b([$s(nr)],rl.prototype,"delay",2),b([$s(Lr)],rl.prototype,"range",2),b([$s(Dr)],rl.prototype,"wrapping",2),b([$s(Xs)],rl.prototype,"position",2),b([$s(Qs)],rl.prototype,"darkTheme",2);var ol=class extends yt{constructor(){super(...arguments),this.id=Gn(this),this.node=new Oo({zIndex:1}).setProperties({textAlign:"center",pointerEvents:1}),this.enabled=!1,this.textAlign="center",this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always",this.truncated=!1}getOrAddRegion(e,t){return"root"===t?e.regionManager.getRegion("root"):e.regionManager.addRegionFromProperties({name:t,bboxproviders:[this.node],canInteraction:()=>this.enabled&&this.node.visible})}registerInteraction(e,t){const i=this.getOrAddRegion(e,t);return function(...e){return()=>{for(const t of e)t()}}(i.addListener("hover",t=>this.handleMouseMove(e,t)),i.addListener("leave",t=>this.handleMouseLeave(e,t)))}computeTextWrap(e,t){var i,n;const{text:s,wrapping:r}=this,o=Math.min(null!=(i=this.maxWidth)?i:1/0,e),a=null!=(n=this.maxHeight)?n:t;if(!isFinite(o)&&!isFinite(a))return void(this.node.text=s);const{text:l,truncated:c}=Oo.wrap(null!=s?s:"",o,a,this,r);this.node.text=l,this.truncated=c}updateTooltip(e,t){if(void 0!==t&&this.enabled&&this.node.visible&&this.truncated){const{offsetX:i,offsetY:n}=t;return e.tooltipManager.updateTooltip(this.id,{offsetX:i,offsetY:n,lastPointerEvent:t,showArrow:!1},nl({content:this.text})),!0}return!1}handleMouseMove(e,t){this.updateTooltip(e,t)&&t.consume()}handleMouseLeave(e,t){e.tooltipManager.removeTooltip(this.id)}};ol.SMALL_PADDING=10,ol.LARGE_PADDING=20,b([$s(Qs)],ol.prototype,"enabled",2),b([$s(er,{optional:!0}),Ya("node")],ol.prototype,"text",2),b([$s(Ir,{optional:!0}),Ya("node")],ol.prototype,"textAlign",2),b([$s(Mr,{optional:!0}),Ya("node")],ol.prototype,"fontStyle",2),b([$s(Tr,{optional:!0}),Ya("node")],ol.prototype,"fontWeight",2),b([$s(nr),Ya("node")],ol.prototype,"fontSize",2),b([$s(er),Ya("node")],ol.prototype,"fontFamily",2),b([$s(fr,{optional:!0}),Ya("node","fill")],ol.prototype,"color",2),b([$s(nr,{optional:!0})],ol.prototype,"spacing",2),b([$s(nr,{optional:!0})],ol.prototype,"lineHeight",2),b([$s(nr,{optional:!0})],ol.prototype,"maxWidth",2),b([$s(nr,{optional:!0})],ol.prototype,"maxHeight",2),b([$s(Dr)],ol.prototype,"wrapping",2);var al=["stroke","lineDash"],ll=lr(e=>Ge(e)&&Object.keys(e).every(e=>al.includes(e)),"objects with gridline style properties such as 'stroke' or 'lineDash'"),cl=class{constructor(){this.enabled=!0,this.width=1,this.style=[{stroke:void 0,lineDash:[]}]}};b([$s(Qs)],cl.prototype,"enabled",2),b([$s(nr)],cl.prototype,"width",2),b([$s(ll)],cl.prototype,"style",2);var hl=class extends yt{constructor(){super(...arguments),this.enabled=!0,this.autoWrap=!1,this.fontSize=12,this.fontFamily="Verdana, sans-serif",this.padding=5,this.minSpacing=NaN,this.color="rgba(87, 87, 87, 1)",this.avoidCollisions=!0,this.mirrored=!1,this.parallel=!1}getSideFlag(){return this.mirrored?1:-1}};b([$s(Qs)],hl.prototype,"enabled",2),b([$s(Qs,{optional:!0})],hl.prototype,"autoWrap",2),b([$s(nr,{optional:!0})],hl.prototype,"maxWidth",2),b([$s(nr,{optional:!0})],hl.prototype,"maxHeight",2),b([$s(Mr,{optional:!0})],hl.prototype,"fontStyle",2),b([$s(Tr,{optional:!0})],hl.prototype,"fontWeight",2),b([$s(tr.restrict({min:1}))],hl.prototype,"fontSize",2),b([$s(er)],hl.prototype,"fontFamily",2),b([$s(nr)],hl.prototype,"padding",2),b([$s(or),js(NaN)],hl.prototype,"minSpacing",2),b([$s(fr,{optional:!0})],hl.prototype,"color",2),b([$s(rr,{optional:!0})],hl.prototype,"rotation",2),b([$s(Qs)],hl.prototype,"avoidCollisions",2),b([$s(Qs)],hl.prototype,"mirrored",2),b([$s(Qs)],hl.prototype,"parallel",2),b([$s(Js,{optional:!0})],hl.prototype,"formatter",2),b([$s(er,{optional:!0})],hl.prototype,"format",2);var ul=class{constructor(){this.enabled=!0,this.width=1,this.color=void 0}};b([$s(Qs)],ul.prototype,"enabled",2),b([$s(nr)],ul.prototype,"width",2),b([$s(fr,{optional:!0})],ul.prototype,"color",2);var dl=class extends yt{constructor(){super(...arguments),this.enabled=!1,this.spacing=ol.SMALL_PADDING,this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always"}};function pl(e){const[t,i]=zn(e.range),n=Math.floor(t),s=Math.ceil(i);return{min:n,max:s,visible:n!==s}}b([$s(Qs)],dl.prototype,"enabled",2),b([$s(er,{optional:!0})],dl.prototype,"text",2),b([$s(nr,{optional:!0})],dl.prototype,"spacing",2),b([$s(Mr,{optional:!0})],dl.prototype,"fontStyle",2),b([$s(Tr,{optional:!0})],dl.prototype,"fontWeight",2),b([$s(nr)],dl.prototype,"fontSize",2),b([$s(er)],dl.prototype,"fontFamily",2),b([$s(fr,{optional:!0})],dl.prototype,"color",2),b([$s(Dr)],dl.prototype,"wrapping",2),b([$s(Js,{optional:!0})],dl.prototype,"formatter",2);var gl=2*Math.PI,fl=gl/2;function ml(e){const t=(t,i)=>{const[n=e.min,s=e.max]=zn(null!=i?i:[]);return t<n||t>s},i={fromFn(e,i,n){let s=e.y1+e.translationY,r=e.opacity;return("added"===n||t(e.datum.translationY,e.datum.range))&&(s=i.translationY,r=0),{y:0,translationY:s,opacity:r,phase:Is[n]}},toFn(e,t,i){const n=t.translationY;let s=1;return"removed"===i&&(s=0),{y:0,translationY:n,opacity:s,finish:{y:n,translationY:0}}},intermediateFn:(e,i,n)=>({visible:!t(e.y)})},n={fromFn(e,i,n){var s;const r=null!=(s=e.previousDatum)?s:i,o=r.x,a=r.y,l=r.rotationCenterX;let c=Math.round(e.translationY),h=r.rotation,u=e.opacity;return"removed"===n||t(r.y,r.range)?h=i.rotation:("added"===n||t(e.datum.y,e.datum.range))&&(c=Math.round(r.translationY),u=0,h=i.rotation),{x:o,y:a,rotationCenterX:l,translationY:c,rotation:h,opacity:u,phase:Is[n]}},toFn(e,t,i){var n,s;const r=t.x,o=t.y,a=t.rotationCenterX,l=Math.round(t.translationY);let c=0,h=1;var u,d;return"added"===i?(h=1,c=t.rotation):"removed"===i?(h=0,c=t.rotation):(u=null!=(s=null==(n=e.previousDatum)?void 0:n.rotation)?s:t.rotation,d=t.rotation,c=Math.abs(d-u)<fl?d:u>d?d+gl:d-gl),{x:r,y:o,rotationCenterX:a,translationY:l,rotation:c,opacity:h,finish:{rotation:t.rotation}}}};return{tick:i,line:{fromFn(e,t){var i;return m(f({},null!=(i=e.previousDatum)?i:t),{phase:Is.updated})},toFn:(e,t)=>f({},t)},label:n,group:{fromFn(e,t){const{rotation:i,translationX:n,translationY:s}=e;return{rotation:i,translationX:n,translationY:s,phase:Is.updated}},toFn(e,t){const{rotation:i,translationX:n,translationY:s}=t;return{rotation:i,translationX:n,translationY:s}}}}}function yl(){return(e,t)=>({rotation:t.rotation,rotationCenterX:t.rotationCenterX,rotationCenterY:t.rotationCenterY,translationX:t.translationX,translationY:t.translationY})}function vl(e){const{visible:t,min:i,max:n}=e;return(e,s)=>{const r=s.translationY;return{y:r,translationY:0,opacity:1,visible:t&&r>=i&&r<=n}}}function bl(){return(e,t)=>({x:t.x,y:t.y,translationY:t.translationY,rotation:t.rotation,rotationCenterX:t.rotationCenterX})}function Cl(){return(e,t)=>f({},t)}var wl=class e{constructor(t,i,n){let s;this.moduleCtx=t,this.scale=i,this.id=Gn(this),this.nice=!0,this.reverse=!1,this.keys=[],this.dataDomain={domain:[],clipped:!1},this.boundSeries=[],this.includeInvisibleDomains=!1,this.interactionEnabled=!0,this.axisGroup=new xo({name:`${this.id}-axis`,zIndex:2}),this.lineNode=this.axisGroup.appendChild(new Ga),this.tickLineGroup=this.axisGroup.appendChild(new xo({name:`${this.id}-Axis-tick-lines`,zIndex:2})),this.tickLabelGroup=this.axisGroup.appendChild(new xo({name:`${this.id}-Axis-tick-labels`,zIndex:2})),this.crossLineGroup=new xo({name:`${this.id}-CrossLines`}),this.gridGroup=new xo({name:`${this.id}-Axis-grid`}),this.gridLineGroup=this.gridGroup.appendChild(new xo({name:`${this.id}-gridLines`,zIndex:1})),this.tickLineGroupSelection=La.select(this.tickLineGroup,Ga,!1),this.tickLabelGroupSelection=La.select(this.tickLabelGroup,Oo,!1),this.gridLineGroupSelection=La.select(this.gridLineGroup,Ga,!1),this.line=new ul,this.tick=this.createTick(),this.gridLine=new cl,this.label=this.createLabel(),this.defaultTickMinSpacing=e.defaultTickMinSpacing,this.translation={x:0,y:0},this.rotation=0,this.layout={label:{fractionDigits:0,padding:this.label.padding,format:this.label.format}},this.destroyFns=[],this.range=[0,1],this.visibleRange=[0,1],this.title=new dl,this._titleCaption=new ol,this.gridLength=0,this.fractionDigits=0,this.gridPadding=0,this.seriesAreaPadding=0,this.tickGenerationResult=void 0,this.maxThickness=1/0,this.moduleMap=new pa,this.refreshScale(),this.destroyFns.push(this._titleCaption.registerInteraction(this.moduleCtx,"root")),this._titleCaption.node.rotation=-Math.PI/2,this.axisGroup.appendChild(this._titleCaption.node),this.destroyFns.push(t.regionManager.getRegion("series").addListener("hover",e=>this.checkAxisHover(e))),this.animationManager=t.animationManager,this.animationState=new ma("empty",{empty:{update:{target:"ready",action:()=>this.resetSelectionNodes()},reset:"empty"},ready:{update:e=>this.animateReadyUpdate(e),resize:()=>this.resetSelectionNodes(),reset:"empty"}}),this._crossLines=[],this.assignCrossLineArrayConstructor(this._crossLines),this.destroyFns.push(t.layoutService.addListener("layout-complete",e=>{null!=s&&null!=wt(e.chart,s)&&this.animationState.transition("resize"),s=f({},e.chart)})),!1!==(null==n?void 0:n.respondsToZoom)&&this.destroyFns.push(t.updateService.addListener("update-complete",e=>{this.minRect=e.minRect}))}get type(){var e;return null!=(e=this.constructor.type)?e:""}set crossLines(e){var t,i;null==(t=this._crossLines)||t.forEach(e=>this.detachCrossLine(e)),e&&this.assignCrossLineArrayConstructor(e),this._crossLines=e,null==(i=this._crossLines)||i.forEach(e=>{this.attachCrossLine(e),this.initCrossLine(e)})}get crossLines(){return this._crossLines}resetAnimation(e){"initial"===e&&this.animationState.transition("reset")}attachCrossLine(e){this.crossLineGroup.appendChild(e.group),this.crossLineGroup.appendChild(e.labelGroup)}detachCrossLine(e){this.crossLineGroup.removeChild(e.group),this.crossLineGroup.removeChild(e.labelGroup)}destroy(){this.moduleMap.destroy(),this.destroyFns.forEach(e=>e())}refreshScale(){var e;this.range=this.scale.range.slice(),null==(e=this.crossLines)||e.forEach(this.initCrossLine,this)}updateRange(){var e;const{range:t,visibleRange:i,scale:n}=this,s=(t[1]-t[0])/(i[1]-i[0]),r=s*i[0],o=t[0]-r;n.range=[o,o+s],null==(e=this.crossLines)||e.forEach(e=>{e.clippedRange=[t[0],t[1]]})}setCrossLinesVisible(e){this.crossLineGroup.visible=e}attachAxis(e,t){t.appendChild(this.gridGroup),e.appendChild(this.axisGroup),e.appendChild(this.crossLineGroup)}detachAxis(e,t){t.removeChild(this.gridGroup),e.removeChild(this.axisGroup),e.removeChild(this.crossLineGroup)}inRange(e,t=0,i=0){const[n,s]=zn(this.range);return e+t>=n-i&&e<=s+i}onLabelFormatChange(e,t,i){const{scale:n,fractionDigits:s}=this,r=!(n instanceof _a)&&s>0?e=>"number"==typeof e?e.toFixed(s):String(e):e=>String(e);if(i&&n&&n.tickFormat)try{this.labelFormatter=n.tickFormat({ticks:e,specifier:i})}catch(e){this.labelFormatter=r,L.warnOnce(`the axis label format string ${i} is invalid. No formatting will be applied`)}else this.labelFormatter=r}setTickInterval(e){var t;this.scale.interval=null!=(t=this.tick.interval)?t:e}setTickCount(e,t,i){const{scale:n}=this,s=qr.is(n)||vo.is(n);if(e&&s)return"number"==typeof e?(n.tickCount=e,n.minTickCount=null!=t?t:0,void(n.maxTickCount=null!=i?i:1/0)):void(n instanceof mo&&this.setTickInterval(e))}onGridLengthChange(e,t){var i;(t&&!e||!t&&e)&&this.onGridVisibilityChange(),null==(i=this.crossLines)||i.forEach(this.initCrossLine,this)}onGridVisibilityChange(){this.gridLineGroupSelection.clear()}createLabel(){return new hl}checkAxisHover(e){this.interactionEnabled&&this.computeBBox().containsPoint(e.offsetX,e.offsetY)&&this.moduleCtx.chartEventManager.axisHover(this.id,this.direction)}update(e=0,t=!0){if(!this.tickGenerationResult)return;const{rotation:i,parallelFlipRotation:n,regularFlipRotation:s}=this.calculateRotations(),r=this.label.getSideFlag();this.updatePosition();const o=this.getAxisLineCoordinates(),{tickData:a,combinedRotation:l,textBaseline:c,textAlign:h,primaryTickCount:u}=this.tickGenerationResult,d=this.tickLabelGroupSelection.nodes().map(e=>e.datum.tickId);if(this.updateSelections(o,a.ticks,{combinedRotation:l,textAlign:h,textBaseline:c,range:this.scale.range}),!t||this.animationManager.isSkipped())this.resetSelectionNodes();else{const e=this.calculateUpdateDiff(d,a);this.animationState.transition("update",e)}return this.updateAxisLine(),this.updateLabels(),this.updateVisibility(),this.updateGridLines(r),this.updateTickLines(),this.updateTitle({anyTickVisible:a.ticks.length>0}),this.updateCrossLines({rotation:i,parallelFlipRotation:n,regularFlipRotation:s}),this.updateLayoutState(),u}getAxisLineCoordinates(){const[e,t]=zn(this.range);return{x:0,y1:e,y2:t}}getTickLineCoordinates(e){const t=this.label.getSideFlag()*this.getTickSize(),i=Math.min(0,t);return{x1:i,x2:i+Math.abs(t),y:e.translationY}}getTickLabelProps(e,t){const{label:i}=this,{combinedRotation:n,textBaseline:s,textAlign:r,range:o}=t,a=e.tickLabel,l=i.getSideFlag()*(this.getTickSize()+i.padding+this.seriesAreaPadding),c=""!==a&&null!=a;return{tickId:e.tickId,translationY:e.translationY,fill:i.color,fontFamily:i.fontFamily,fontSize:i.fontSize,fontStyle:i.fontStyle,fontWeight:i.fontWeight,rotation:n,rotationCenterX:l,text:a,textAlign:r,textBaseline:s,visible:c,x:l,y:0,range:o}}getTickSize(){return this.tick.enabled?this.tick.size:this.createTick().size}setTitleProps(e,t){var i;const{title:n}=this;if(n.enabled){if(e.color=n.color,e.fontFamily=n.fontFamily,e.fontSize=n.fontSize,e.fontStyle=n.fontStyle,e.fontWeight=n.fontWeight,e.enabled=n.enabled,e.wrapping=n.wrapping,n.enabled){const s=e.node,r=(null!=(i=n.spacing)?i:0)+t.spacing,o=this.label.getSideFlag(),a=Ls(this.rotation),l=-1===o&&a>Math.PI&&a<2*Math.PI?-1:1,c=l*o*Math.PI/2,h=1===l?"bottom":"top",{range:u}=this,d=Math.floor(l*o*(u[0]+u[1])/2),p=-1===o?Math.floor(l*-r):Math.floor(-r),{callbackCache:g}=this.moduleCtx,{formatter:f=e=>e.defaultValue}=n,m=g.call(f,this.getTitleFormatterParams());s.setProperties({rotation:c,text:m,textBaseline:h,visible:!0,x:d,y:p})}}else e.enabled=!1}calculateLayout(e){var t,i;const{rotation:n,parallelFlipRotation:s,regularFlipRotation:r}=this.calculateRotations(),o=this.label.getSideFlag(),a=o*(this.getTickSize()+this.label.padding+this.seriesAreaPadding);this.updateScale(),this.tickGenerationResult=this.generateTicks({primaryTickCount:e,parallelFlipRotation:s,regularFlipRotation:r,labelX:a,sideFlag:o}),this.updateLayoutState();const l=this.tickGenerationResult,{tickData:c,combinedRotation:h,textBaseline:u,textAlign:d}=l,p=y(l,["tickData","combinedRotation","textBaseline","textAlign"]),g=[],{x:v,y1:b,y2:C}=this.getAxisLineCoordinates(),w=new es(v+Math.min(o*this.seriesAreaPadding,0),b,this.seriesAreaPadding,C-b);if(g.push(w),this.tick.enabled&&c.ticks.forEach(e=>{const{x1:t,x2:i,y:n}=this.getTickLineCoordinates(e),s=new es(t,n,i-t,0);g.push(s)}),this.label.enabled){const e=new Oo;c.ticks.forEach(t=>{const i=this.getTickLabelProps(t,{combinedRotation:h,textAlign:d,textBaseline:u,range:this.scale.range});if(!i.visible)return;e.setProperties(m(f({},i),{translationY:Math.round(t.translationY)}));const n=e.computeTransformedBBox();n&&g.push(n)})}if(null==(t=this.title)?void 0:t.enabled){const e=new ol,t=es.merge(g).width;this.setTitleProps(e,{spacing:t});const i=e.node.computeTransformedBBox();i&&g.push(i)}const S=(e=>{const t=new os,{rotation:i,translationX:n,translationY:s,rotationCenterX:r,rotationCenterY:o}=this.getAxisTransform();return os.updateTransformMatrix(t,1,1,i,n,s,{scalingCenterX:0,scalingCenterY:0,rotationCenterX:r,rotationCenterY:o}),t.transformBBox(e)})(es.merge(g)),x=this.isAnySeriesActive();return null==(i=this.crossLines)||i.forEach(e=>{var t;e.sideFlag=-o,e.direction=n===-Math.PI/2?"x":"y",e instanceof da&&(e.label.parallel=null!=(t=e.label.parallel)?t:this.label.parallel),e.parallelFlipRotation=s,e.regularFlipRotation=r,e.calculateLayout(x,this.reverse)}),{primaryTickCount:e=p.primaryTickCount,bbox:S}}updateLayoutState(){this.layout.label={fractionDigits:this.fractionDigits,padding:this.label.padding,format:this.label.format}}setDomain(e){this.dataDomain=this.normaliseDataDomain(e),this.reverse&&this.dataDomain.domain.reverse(),this.scale.domain=this.dataDomain.domain}updateScale(){this.updateRange(),this.calculateDomain(),this.setTickInterval(this.tick.interval);const{scale:e,nice:t}=this;qr.is(e)&&(e.nice=t,e.update())}calculateRotations(){const e=Gs(this.rotation);return{rotation:e,parallelFlipRotation:Ls(e),regularFlipRotation:Ls(e-Math.PI/2)}}generateTicks({primaryTickCount:e,parallelFlipRotation:t,regularFlipRotation:i,labelX:n,sideFlag:s}){var r;const{scale:o,tick:a,label:{parallel:l,rotation:c,fontFamily:h,fontSize:u,fontStyle:d,fontWeight:p}}=this,g=void 0!==e,{defaultRotation:y,configuredRotation:v,parallelFlipFlag:b,regularFlipFlag:C}=Vo({rotation:c,parallel:l,regularFlipRotation:i,parallelFlipRotation:t}),w=v+y,S=new os,{maxTickCount:x}=this.estimateTickCount({minSpacing:a.minSpacing,maxSpacing:null!=(r=a.maxSpacing)?r:NaN}),E=!qr.is(o)&&!vo.is(o)||isNaN(x)?10:x;let A=Ho(l,v,0,s,C);const M=function(e,t,i,n){return e&&!t?i*n===-1?"hanging":"bottom":"middle"}(l,v,s,b),T={fontFamily:h,fontSize:u,fontStyle:d,fontWeight:p,textBaseline:M,textAlign:A};let D={rawTicks:[],ticks:[],labelCount:0},I=0,R=0,k=!0,P=!1;for(;k&&I<=E&&!P;){R=0,A=Ho(l,v,0,s,C);const t=this.getTickStrategies({secondaryAxis:g,index:I});for(const i of t){({tickData:D,index:I,autoRotation:R,terminate:P}=i({index:I,tickData:D,textProps:T,labelOverlap:k,terminate:P,primaryTickCount:e}));const t=0!==v||0!==R,r=w+R;A=Ho(l,v,R,s,C),k=!!this.label.avoidCollisions&&this.checkLabelOverlap(r,t,S,D.ticks,n,m(f({},T),{textAlign:A}))}}const _=y+v+R;return!g&&D.rawTicks.length>0&&(e=D.rawTicks.length),{tickData:D,primaryTickCount:e,combinedRotation:_,textBaseline:M,textAlign:A}}getTickStrategies({index:e,secondaryAxis:t}){const{scale:i,label:n,tick:s}=this,r=qr.is(i)||vo.is(i),o=n.enabled&&n.avoidCollisions,a=!r&&0!==e&&o,l=!0===n.autoRotate&&void 0===n.rotation,c=[];let h;if(h=this.tick.values?3:t?1:a?2:0,c.push(({index:e,tickData:t,primaryTickCount:i,terminate:n})=>this.createTickData(h,e,t,n,i)),!r&&!isNaN(s.minSpacing)){const e=({index:e,tickData:t,primaryTickCount:i,terminate:n})=>this.createTickData(2,e,t,n,i);c.push(e)}if(!o)return c;if(n.autoWrap){const e=({index:e,tickData:t,textProps:i})=>this.wrapLabels(t,e,i);c.push(e)}else if(l){const e=({index:e,tickData:t,labelOverlap:i,terminate:n})=>({index:e,tickData:t,autoRotation:this.getAutoRotation(i),terminate:n});c.push(e)}return c}createTickData(e,t,i,n,s){var r;const{scale:o,tick:a}=this,{maxTickCount:l,minTickCount:c,defaultTickCount:h}=this.estimateTickCount({minSpacing:a.minSpacing,maxSpacing:null!=(r=a.maxSpacing)?r:NaN}),u=qr.is(o)||vo.is(o),d=!u||isNaN(l)?10:l;let p=u?Math.max(h-t,c):l;const g=void 0===a.interval&&void 0===a.values&&p>c&&(u||2===e);let f=!0;for(;f&&t<=d;){const n=i.rawTicks;p=u?Math.max(h-t,c):l;const{rawTicks:r,ticks:o,labelCount:a}=this.getTicks({tickGenerationType:e,previousTicks:n,tickCount:p,minTickCount:c,maxTickCount:l,primaryTickCount:s});i.rawTicks=r,i.ticks=o,i.labelCount=a,f=!!g&&ja(r,n),t++}const m=void 0!==a.interval||void 0!==a.values;return n||(n=m),{tickData:i,index:t,autoRotation:0,terminate:n}}checkLabelOverlap(e,t,i,n,s,r){os.updateTransformMatrix(i,1,1,e,0,0);const o=this.createLabelData(n,s,r,i),a=function(e,t){return isNaN(e)?t?0:10:e}(this.label.minSpacing,t);return function(e,t){const i=[];for(let n=0;n<e.length;n++){const s=e[n],{point:{x:r,y:o},label:{text:a}}=s;let{label:{width:l,height:c}}=s;if(l+=null!=t?t:0,c+=null!=t?t:0,i.some(e=>Va(e,r,o,l,c)))return!0;i.push({index:n,text:a,x:r,y:o,width:l,height:c,datum:s})}return!1}(o,a)}createLabelData(e,t,i,n){const s=[],r=new Fo(i);for(const{tickLabel:i,translationY:o}of e){if(""===i||null==i)continue;const{width:e,height:a}=r.size(i),l=Uo(i,new es(t,o,e,a),t,o,n);s.push(l)}return s}getAutoRotation(e){var t;return e?Ls(Gs(null!=(t=this.label.autoRotateAngle)?t:0)):0}getTicks({tickGenerationType:e,previousTicks:t,tickCount:i,minTickCount:n,maxTickCount:s,primaryTickCount:r}){var o;const{range:a,scale:l,visibleRange:c}=this;let h;switch(e){case 3:if(qr.is(l)){const[e,t]=zn(l.getDomain().map(Number));h=this.tick.values.filter(i=>i>=e&&i<=t).sort((e,t)=>e-t)}else h=this.tick.values;break;case 1:h=qr.is(l)?this.updateSecondaryAxisTicks(r):this.createTicks(i,n,s);break;case 2:h=this.filterTicks(t,i);break;default:h=this.createTicks(i,n,s)}this.fractionDigits=h.fractionDigits>=0?h.fractionDigits:0;const u=(null!=(o=l.bandwidth)?o:0)/2,d=[];let p=0;const g=new Map,f=Math.max(0,Math.floor(c[0]*h.length)),m=Math.min(h.length,Math.ceil(c[1]*h.length)),y=h.slice(f,m);this.onLabelFormatChange(y,h,this.label.format);for(let e=0;e<y.length;e++){const t=y[e],i=l.convert(t)+u;if(a.length>0&&!this.inRange(i,0,.001))continue;const n=this.formatTick(t,f+e);let s=n;if(g.has(s)){const e=g.get(s);g.set(s,e+1),s=`${s}_${e}`}else g.set(s,1);d.push({tick:t,tickId:s,tickLabel:n,translationY:Math.floor(i)}),""!==n&&null!=n&&p++}return{rawTicks:h,ticks:d,labelCount:p}}filterTicks(e,t){var i;const n=isNaN(this.tick.minSpacing)&&isNaN(null!=(i=this.tick.maxSpacing)?i:NaN)?2:Math.ceil(e.length/t);return e.filter((e,t)=>t%n===0)}createTicks(e,t,i){var n,s,r;return this.setTickCount(e,t,i),null!=(r=null==(s=(n=this.scale).ticks)?void 0:s.call(n))?r:[]}estimateTickCount({minSpacing:e,maxSpacing:t}){const{minRect:i,label:{avoidCollisions:n}}=this;if(!n)return{minTickCount:qr.defaultMaxTickCount,maxTickCount:qr.defaultMaxTickCount,defaultTickCount:qr.defaultMaxTickCount};const s=this.calculateRangeWithBleed(),r=Math.max(this.defaultTickMinSpacing,s/qr.defaultMaxTickCount);let o=!isNaN(t);isNaN(e)&&(e=r),isNaN(t)&&(t=s),e>t&&(e===r?e=t:t=e);let a=1;i&&(a="x"===this.direction?i.width:i.height),o&&(o=a<r);const l=Hn(1,Math.floor(s/e),o?Math.min(Math.floor(s/a),100):100),c=Math.min(l,Math.ceil(s/t));return{minTickCount:c,maxTickCount:l,defaultTickCount:Hn(c,qr.defaultTickCount,l)}}updateVisibility(){this.moduleCtx.animationManager.isSkipped()&&this.resetSelectionNodes(),this.tickLineGroup.visible=this.tick.enabled,this.gridLineGroup.visible=this.gridLine.enabled,this.tickLabelGroup.visible=this.label.enabled}updateCrossLines({rotation:e,parallelFlipRotation:t,regularFlipRotation:i}){var n;const s=this.label.getSideFlag(),r=this.isAnySeriesActive();null==(n=this.crossLines)||n.forEach(n=>{var o;n.sideFlag=-s,n.direction=e===-Math.PI/2?"x":"y",n instanceof da&&(n.label.parallel=null!=(o=n.label.parallel)?o:this.label.parallel),n.parallelFlipRotation=t,n.regularFlipRotation=i,n.update(r)})}updateTickLines(){const{tick:e,label:t}=this,i=t.getSideFlag();this.tickLineGroupSelection.each(t=>{t.strokeWidth=e.width,t.stroke=e.color,t.x1=i*this.getTickSize(),t.x2=0})}calculateAvailableRange(){return Wn(this.range)}calculateRangeWithBleed(){const e=1/Wn(this.visibleRange);return Kn(this.calculateAvailableRange()*e,2)}calculateDomain(){const e=this.boundSeries.filter(e=>this.includeInvisibleDomains||e.isEnabled()).flatMap(e=>e.getDomain(this.direction));this.setDomain(e)}getAxisTransform(){return{rotation:Gs(this.rotation),rotationCenterX:0,rotationCenterY:0,translationX:Math.floor(this.translation.x),translationY:Math.floor(this.translation.y)}}updatePosition(){const{crossLineGroup:e,axisGroup:t,gridGroup:i,translation:n,gridLineGroupSelection:s,gridPadding:r,gridLength:o}=this,{rotation:a}=this.calculateRotations(),l=this.label.getSideFlag(),c=Math.floor(n.x),h=Math.floor(n.y);e.setProperties({rotation:a,translationX:c,translationY:h}),i.setProperties({rotation:a,translationX:c,translationY:h}),t.datum=this.getAxisTransform(),s.each(e=>{e.x1=r,e.x2=-l*o+r})}updateSecondaryAxisTicks(e){throw new Error("AG Charts - unexpected call to updateSecondaryAxisTicks() - check axes configuration.")}updateSelections(e,t,i){this.lineNode.datum=e,this.gridLineGroupSelection.update(this.gridLength?t:[],e=>e.append(new Ga),e=>e.tickId),this.tickLineGroupSelection.update(t,e=>e.appendChild(new Ga),e=>e.tickId),this.tickLabelGroupSelection.update(t.map(e=>this.getTickLabelProps(e,i)),e=>e.appendChild(new Oo),e=>e.tickId)}updateAxisLine(){const{line:e}=this,t=e.enabled?e.width:0;this.lineNode.setProperties({stroke:e.color,strokeWidth:t})}updateGridLines(e){const{gridLine:{style:t,width:i},gridPadding:n,gridLength:s}=this;0!==s&&0!==t.length&&this.gridLineGroupSelection.each((r,o,a)=>{const{stroke:l,lineDash:c}=t[a%t.length];r.setProperties({x1:n,x2:-e*s+n,fill:void 0,stroke:l,strokeWidth:i,lineDash:c})})}updateLabels(){const{label:e}=this;e.enabled&&this.tickLabelGroupSelection.each((e,t)=>{e.setProperties(t,["fill","fontFamily","fontSize","fontStyle","fontWeight","text","textAlign","textBaseline"])})}wrapLabels(e,t,i){const{parallel:n,maxWidth:s,maxHeight:r}=this.label;let o=this.maxThickness,a=Math.round(this.calculateAvailableRange()/e.labelCount);return n&&([o,a]=[a,o]),e.ticks.forEach(e=>{const{text:t}=Oo.wrap(e.tickLabel,null!=s?s:o,null!=r?r:a,i,"hyphenate");e.tickLabel=t}),{tickData:e,index:t,autoRotation:0,terminate:!0}}updateTitle(e){const{rotation:t,title:i,_titleCaption:n,lineNode:s,tickLineGroup:r,tickLabelGroup:o}=this;if(!i)return void(n.enabled=!1);let a=0;if(i.enabled&&e.anyTickVisible){const e=xo.computeBBox([r,o,s]);a+=(0===t?e.width:e.height)+(this.tickLabelGroup.visible?0:this.seriesAreaPadding)}this.setTitleProps(n,{spacing:a})}formatTick(e,t){return this.datumFormatter(t)(e)}formatDatum(e){return String(e)}datumFormatter(e=0){const{label:t,labelFormatter:i,fractionDigits:n,moduleCtx:{callbackCache:s}}=this;return t.formatter?r=>{var o;return null!=(o=s.call(t.formatter,{value:n>0?r:String(r),index:e,fractionDigits:n,formatter:i}))?o:r}:i?e=>{var t;return null!=(t=s.call(i,e))?t:String(e)}:e=>String(e)}computeBBox(){return this.axisGroup.computeBBox()}initCrossLine(e){e.scale=this.scale,e.gridLength=this.gridLength}isAnySeriesActive(){return this.boundSeries.some(e=>this.includeInvisibleDomains||e.isEnabled())}clipTickLines(e,t,i,n){this.tickLineGroup.setClipRectInGroupCoordinateSpace(new es(e,t,i,n))}clipGrid(e,t,i,n){this.gridGroup.setClipRectInGroupCoordinateSpace(new es(e,t,i,n))}calculatePadding(e,t){const i=.01*Math.abs(this.reverse?t:e);return[i,i]}getTitleFormatterParams(){var e;const t=this.boundSeries.reduce((e,t)=>{const i=t.getKeys(this.direction),n=t.getNames(this.direction);for(let t=0;t<i.length;t++)e.push({key:i[t],name:n[t]});return e},[]);return{direction:this.direction,boundSeries:t,defaultValue:null==(e=this.title)?void 0:e.text}}normaliseDataDomain(e){return{domain:[...e],clipped:!1}}getLayoutState(){return f({rect:this.computeBBox(),gridPadding:this.gridPadding,seriesAreaPadding:this.seriesAreaPadding,tickSize:this.getTickSize(),direction:this.direction,domain:this.dataDomain.domain,scale:this.scale},this.layout)}getModuleMap(){return this.moduleMap}createModuleContext(){return null!=this.axisContext||(this.axisContext=this.createAxisContext()),m(f({},this.moduleCtx),{parent:this.axisContext})}createAxisContext(){return{axisId:this.id,direction:this.direction,continuous:qr.is(this.scale),keys:()=>this.boundSeries.flatMap(e=>e.getKeys(this.direction)),seriesKeyProperties:()=>this.boundSeries.reduce((e,t)=>(t.getKeyProperties(this.direction).forEach(t=>{e.indexOf(t)<0&&e.push(t)}),e),[]),scaleValueFormatter:e=>{var t,i;return e?null==(i=(t=this.scale).tickFormat)?void 0:i.call(t,{specifier:e}):this.formatDatum},scaleBandwidth:()=>{var e;return null!=(e=this.scale.bandwidth)?e:0},scaleConvert:e=>this.scale.convert(e),scaleInvert:e=>{var t,i;return null==(i=(t=this.scale).invert)?void 0:i.call(t,e)}}}animateReadyUpdate(e){const{animationManager:t}=this.moduleCtx,i=ml(pl(this));Rs(this.id,"axis-group",t,[this.axisGroup],i.group),Rs(this.id,"line",t,[this.lineNode],i.line),Rs(this.id,"line-paths",t,[this.gridLineGroupSelection,this.tickLineGroupSelection],i.tick,(e,t)=>t.tickId,e),Rs(this.id,"tick-labels",t,[this.tickLabelGroupSelection],i.label,(e,t)=>t.tickId,e)}resetSelectionNodes(){const{gridLineGroupSelection:e,tickLineGroupSelection:t,tickLabelGroupSelection:i,lineNode:n}=this,s=pl(this);fa([this.axisGroup],(e,t)=>({rotation:t.rotation,rotationCenterX:t.rotationCenterX,rotationCenterY:t.rotationCenterY,translationX:t.translationX,translationY:t.translationY})),fa([e,t],vl(s)),fa([i],(e,t)=>({x:t.x,y:t.y,translationY:t.translationY,rotation:t.rotation,rotationCenterX:t.rotationCenterX})),fa([n],Cl())}calculateUpdateDiff(e,t){const i=new Set,n=new Set,s={},r=Math.max(e.length,t.ticks.length);for(let o=0;o<r;o++){const r=t.ticks[o],a=e[o],l=null==r?void 0:r.tickId;s[null!=l?l:a]=r,a!==l&&(n.has(l)?n.delete(l):l&&i.add(l),i.has(a)?i.delete(a):a&&n.add(a))}return{changed:i.size>0||n.size>0,added:i,removed:n}}isReversed(){return this.reverse}};wl.defaultTickMinSpacing=50,b([$s(Qs)],wl.prototype,"nice",2),b([$s(Qs)],wl.prototype,"reverse",2),b([$s(br)],wl.prototype,"keys",2),b([$s(Xs,{optional:!0})],wl.prototype,"title",2),b([Xa((e,t,i)=>e.onGridLengthChange(t,i))],wl.prototype,"gridLength",2);var Sl=wl,xl=class extends hl{constructor(){super(...arguments),this.autoRotateAngle=335}};b([$s(Qs,{optional:!0})],xl.prototype,"autoRotate",2),b([$s(rr)],xl.prototype,"autoRotateAngle",2);var El=class e extends Sl{constructor(){super(...arguments),this.thickness=0,this.position="left"}static is(t){return t instanceof e}get direction(){return["top","bottom"].includes(this.position)?"x":"y"}updateDirection(){switch(this.position){case"top":this.rotation=-90,this.label.mirrored=!0,this.label.parallel=!0;break;case"right":this.rotation=0,this.label.mirrored=!0,this.label.parallel=!1;break;case"bottom":this.rotation=-90,this.label.mirrored=!1,this.label.parallel=!0;break;case"left":this.rotation=0,this.label.mirrored=!1,this.label.parallel=!1}this.axisContext&&(this.axisContext.position=this.position,this.axisContext.direction=this.direction)}update(e,t){return this.updateDirection(),super.update(e,t)}calculateLayout(e){return this.updateDirection(),super.calculateLayout(e)}createAxisContext(){return m(f({},super.createAxisContext()),{position:this.position})}assignCrossLineArrayConstructor(e){Kr(e,da)}createLabel(){return new xl}};b([$s(nr)],El.prototype,"thickness",2),b([$s(Ar)],El.prototype,"position",2);var Al=El,Ml=class extends Wr{constructor(){super(...arguments),this.minSpacing=NaN}};b([$s(Fr),js(NaN)],Ml.prototype,"minSpacing",2);var Tl=class extends Al{constructor(e,t=new Ws){super(e,t),this._paddingOverrideEnabled=!1,this.groupPaddingInner=.1,this.includeInvisibleDomains=!0}set paddingInner(e){this._paddingOverrideEnabled=!0,this.scale.paddingInner=e}get paddingInner(){return this._paddingOverrideEnabled=!0,this.scale.paddingInner}set paddingOuter(e){this.scale.paddingOuter=e}get paddingOuter(){return this.scale.paddingOuter}createTick(){return new Ml}normaliseDataDomain(e){const t=[],i=new Set;for(const n of e){const e=n instanceof Date?n.getTime():n;i.has(e)||(i.add(e),t.push(n))}return{domain:t,clipped:!1}}calculateDomain(){if(!this._paddingOverrideEnabled){const e=this.boundSeries.map(e=>{var t;return null==(t=e.getBandScalePadding)?void 0:t.call(e)}).filter(e=>null!=e);e.length>0&&(this.scale.paddingInner=Math.min(...e.map(e=>e.inner)),this.scale.paddingOuter=Math.max(...e.map(e=>e.outer)))}return super.calculateDomain()}};Tl.className="CategoryAxis",Tl.type="category",b([$s(sr)],Tl.prototype,"groupPaddingInner",2);var Dl=class{constructor(e="",t,i=0){this.x=0,this.y=0,this.subtreeLeft=NaN,this.subtreeRight=NaN,this.screenX=0,this.screenY=0,this.children=[],this.leafCount=0,this.prelim=0,this.mod=0,this.ancestor=this,this.change=0,this.shift=0,this.label=e,this.parent=t,this.depth=t?t.depth+1:0,this.number=i}getLeftSibling(){return this.number>0&&this.parent?this.parent.children[this.number-1]:void 0}getLeftmostSibling(){return this.number>0&&this.parent?this.parent.children[0]:void 0}nextLeft(){return this.children?this.children[0]:this.thread}nextRight(){return this.children?this.children[this.children.length-1]:this.thread}getSiblings(){return this.parent?this.parent.children.filter((e,t)=>t!==this.number):[]}};function Il(e,t,i){const n=i/(t.number-e.number);t.change-=n,t.shift+=i,e.change+=n,t.prelim+=i,t.mod+=i}function Rl(e,t,i){return t.getSiblings().indexOf(e.ancestor)>=0?e.ancestor:i}function kl(e,t){const i=e.children;if(i.length){let n=i[0];i.forEach(e=>{kl(e,t),n=function(e,t,i){const n=e.getLeftSibling();if(n){let s=e,r=e,o=n,a=r.getLeftmostSibling(),l=r.mod,c=s.mod,h=o.mod,u=a.mod;for(;o.nextRight()&&r.nextLeft();){o=o.nextRight(),r=r.nextLeft(),a=a.nextLeft(),s=s.nextRight(),s.ancestor=e;const n=o.prelim+h-(r.prelim+l)+i;n>0&&(Il(Rl(o,e,t),e,n),l+=n,c+=n),h+=o.mod,l+=r.mod,u+=a.mod,c+=s.mod}o.nextRight()&&!s.nextRight()?(s.thread=o.nextRight(),s.mod+=h-c):(r.nextLeft()&&!a.nextLeft()&&(a.thread=r.nextLeft(),a.mod+=l-u),t=e)}return t}(e,n,t)}),function(e){const t=e.children;if(t){let e=0,i=0;for(let n=t.length-1;n>=0;n--){const s=t[n];s.prelim+=e,s.mod+=e,i+=s.change,e+=s.shift+i}}}(e);const s=(i[0].prelim+i.at(-1).prelim)/2,r=e.getLeftSibling();r?(e.prelim=r.prelim+t,e.mod=e.prelim-s):e.prelim=s}else{const i=e.getLeftSibling();e.prelim=i?i.prelim+t:0}}var Pl=class{constructor(){this.top=1/0,this.right=-1/0,this.bottom=-1/0,this.left=1/0}update(e,t){const{x:i,y:n}=t(e);i>this.right&&(this.right=i),i<this.left&&(this.left=i),n>this.bottom&&(this.bottom=n),n<this.top&&(this.top=n)}};function _l(e,t,i){e.x=e.prelim+t,e.y=e.depth,i.update(e),e.children.forEach(n=>_l(n,t+e.mod,i))}function Ll(e){const t=e.children;let i=0;t.forEach(e=>{Ll(e),e.children.length?i+=e.leafCount:i++}),e.leafCount=i,t.length?(e.subtreeLeft=t[0].subtreeLeft,e.subtreeRight=t[e.children.length-1].subtreeRight,e.x=(e.subtreeLeft+e.subtreeRight)/2):(e.subtreeLeft=e.x,e.subtreeRight=e.x)}function Nl(e){const t=new Ol;return kl(e,1),_l(e,-e.prelim,t),Ll(e),t}var Ol=class{constructor(){this.dimensions=new Pl,this.leafCount=0,this.nodes=[],this.leafNodes=[],this.nonLeafNodes=[],this.depth=0}update(e){this.dimensions.update(e,e=>({x:e.x,y:e.y})),e.children.length?this.nonLeafNodes.push(e):(this.leafCount++,this.leafNodes.push(e)),e.depth>this.depth&&(this.depth=e.depth),this.nodes.push(e)}resize(e,t,i=0,n=0,s=!1){const r=this.leafCount-1,o=this.depth,a=this.dimensions;let l=1,c=1;if(e>0&&r){const t=(a.right-a.left)/r;l=e/r/t,s&&(l=-l)}if(t>0&&o){const e=(a.bottom-a.top)/o;c=t/o/e}const h=new Pl;this.nodes.forEach(e=>{e.screenX=e.x*l,e.screenY=e.y*c,h.update(e,e=>({x:e.screenX,y:e.screenY}))});const u=-h.left,d=-h.top;this.nodes.forEach(e=>{e.screenX+=u+i,e.screenY+=d+n})}},Fl=class extends hl{constructor(){super(...arguments),this.grid=!1}};b([$s(Qs)],Fl.prototype,"grid",2);var Gl=class extends Al{constructor(e){super(e,new Ws),this.tickScale=new Ws,this.line=new ul,this.label=new Fl,this.labelColor="rgba(87, 87, 87, 1)",this.includeInvisibleDomains=!0;const{tickLineGroup:t,tickLabelGroup:i,gridLineGroup:n,tickScale:s,scale:r}=this;r.paddingOuter=.1,r.paddingInner=2*r.paddingOuter,this.refreshScale(),s.paddingInner=1,s.paddingOuter=0,this.gridLineSelection=La.select(n,Ga),this.axisLineSelection=La.select(t,Ga),this.separatorSelection=La.select(t,Ga),this.labelSelection=La.select(i,Oo)}updateRange(){const{range:e,visibleRange:t,scale:i}=this,n=(e[1]-e[0])/(t[1]-t[0]),s=n*t[0],r=e[0]-s;this.tickScale.range=i.range=[r,r+n],this.resizeTickTree()}resizeTickTree(){var e;const t=this.scale,i=t.domain.length?[t.convert(t.domain[0]),t.convert(t.domain[t.domain.length-1])]:t.range,n=this.tickTreeLayout,s=this.lineHeight;n&&n.resize(Math.abs(i[1]-i[0]),n.depth*s,(Math.min(i[0],i[1])||0)+(null!=(e=t.bandwidth)?e:0)/2,-n.depth*s,i[1]-i[0]<0)}get lineHeight(){return 1.5*this.label.fontSize}onGridVisibilityChange(){this.gridLineSelection.clear(),this.labelSelection.clear()}createTick(){return new Ml}calculateDomain(){var e;const{direction:t}=this;let i=null;const n=this.boundSeries.filter(e=>e.visible).flatMap(e=>{if("y"===t||i)return e.getDomain(t);if(null===i){const n=e.getDomain(t);return i=Ue(n[0]),n}return[]});this.setDomain(null!=(e=ln(n))?e:pn(n));const{domain:s}=this.dataDomain;this.tickTreeLayout=Nl(function(e,t=!0){const i=new Dl;let n=0;return t&&e.forEach(e=>n=Math.max(n,e.labels.length)),e.forEach(e=>{if(t)for(;e.labels.length<n;)e.labels.unshift("");!function(e,t){const i=t.labels.slice().reverse(),n=i.length-1;i.forEach((t,i)=>{const s=e.children,r=s.find(e=>e.label===t),o=i!==n;if(r&&o)e=r;else{const i=new Dl(t,e);i.number=s.length,s.push(i),o&&(e=i)}})}(i,e)}),i}(s)),this.tickScale.domain=s.concat(""),this.resizeTickTree()}update(){this.computedLayout&&(this.updatePosition(),this.updateTitleCaption(),this.updateCategoryLabels(),this.updateSeparators(),this.updateAxisLines(),this.updateCategoryGridLines(),this.resetSelectionNodes())}updateTitleCaption(){const{_titleCaption:e}=this;e.node.visible=!1}updateCategoryLabels(){if(!this.computedLayout)return;const{tickLabelLayout:e}=this.computedLayout;this.labelSelection.update(e).each((e,t)=>{e.setProperties(t)})}updateSeparators(){if(!this.computedLayout)return;const{separatorLayout:e}=this.computedLayout,{range:t}=this;this.separatorSelection.update(e).each((e,i)=>{e.x1=i.x1,e.x2=i.x2,e.y1=i.y,e.y2=i.y,e.visible=i.y>=t[0]-1e-7&&i.y<=t[1]+1e-7,e.stroke=this.tick.color,e.fill=void 0,e.strokeWidth=1})}updateAxisLines(){if(!this.computedLayout)return;const{axisLineLayout:e}=this.computedLayout;this.axisLineSelection.update(e).each((e,t)=>{e.setProperties(m(f({},t),{stroke:this.line.color,strokeWidth:this.line.width})),e.x1=t.x,e.x2=t.x,e.y1=t.y1,e.y2=t.y2,e.strokeWidth=this.line.width,e.stroke=this.line.color})}updateCategoryGridLines(){const{gridLength:e,gridLine:t,label:i,range:n,tickScale:s}=this,r=s.ticks(),o=i.getSideFlag(),a=this.gridLineSelection.update(e?r:[]);if(e){const{width:i,style:r}=t,l=r.length;a.each((t,a,c)=>{const h=Math.round(s.convert(a));t.x1=0,t.x2=-o*e,t.y1=h,t.y2=h,t.visible=h>=n[0]&&h<=n[1];const{stroke:u,lineDash:d}=r[c%l];t.stroke=u,t.strokeWidth=i,t.lineDash=d,t.fill=void 0})}}computeLayout(){this.updateDirection(),this.calculateDomain(),this.updateRange();const{scale:e,label:t,label:{parallel:i},moduleCtx:{callbackCache:n},range:s,title:r,title:{formatter:o=e=>e.defaultValue}={}}=this,a=e.range[0],l=e.range[1],c=Math.abs(l-a)/e.domain.length||0,h=Math.ceil(t.fontSize/c),u=Gs(this.rotation),d=Math.abs(Math.cos(u))<1e-8,p=t.getSideFlag(),g=this.lineHeight,y=this.tickTreeLayout,v=e.ticks(),b=y?y.nodes:[],C=!!y&&y.depth>1,{defaultRotation:w,configuredRotation:S,parallelFlipFlag:x}=Vo({rotation:t.rotation,parallel:i,regularFlipRotation:Ls(u-Math.PI/2),parallelFlipRotation:Ls(u)}),E=[],A=new Map;let M=0;const T=new Oo,D=(e,i)=>{var a;if(T.setProperties({fill:t.color,fontFamily:t.fontFamily,fontSize:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight,textAlign:"center",textBaseline:-1===x?"bottom":"hanging",translationX:e.screenY-.25*t.fontSize,translationY:e.screenX}),0===i){if(!((null==r?void 0:r.enabled)&&v.length>0))return!1;const i=n.call(o,this.getTitleFormatterParams());T.setProperties({fill:r.color,fontFamily:r.fontFamily,fontSize:r.fontSize,fontStyle:r.fontStyle,fontWeight:r.fontWeight,text:i,textBaseline:"hanging",translationX:e.screenY-.25*t.fontSize,translationY:e.screenX})}else{if(i%h!==0)return!1;if(!(e.screenX>=s[0]&&e.screenX<=s[1]))return!1;t.formatter?T.text=null!=(a=n.call(t.formatter,{value:String(e.label),index:i}))?a:String(e.label):T.text=String(e.label)}return!0};b.forEach((e,t)=>{if(!D(e,t))return;const i=T.computeTransformedBBox();i&&(A.set(t,i),!e.children.length&&i.width>M&&(M=i.width))});const I=p*t.padding,R=this.label.grid,k=[];b.forEach((e,t)=>{let i=D(e,t);const n=t;T.x=I,T.rotationCenterX=I;const s=!e.children.length;if(s)T.rotation=S,T.textAlign="end",T.textBaseline="middle";else{T.translationX-=M-g+this.label.padding;const t=e.leafCount*c,s=A.get(n);s&&s.width>t?(i=!1,A.delete(n)):T.rotation=d?w:-Math.PI/2}if(e.parent&&C){const t=s?e.screenX-c/2:e.screenX-e.leafCount*c/2;if(s)(e.number!==e.children.length-1||R)&&k.push({y:t,x1:0,x2:-M-2*this.label.padding});else{const i=-M-2*this.label.padding+e.screenY;k.push({y:t,x1:i+g,x2:i})}}let r;if(i){const e=T.computeTransformedBBox();e&&A.set(t,e),r=m(f({},{fill:(o=T).fill,fontFamily:o.fontFamily,fontSize:o.fontSize,fontStyle:o.fontStyle,fontWeight:o.fontWeight,rotation:o.rotation,rotationCenterX:o.rotationCenterX,rotationCenterY:o.rotationCenterY,text:o.text,textAlign:o.textAlign,textBaseline:o.textBaseline,translationX:o.translationX,translationY:o.translationY,visible:o.visible,x:o.x,y:o.y}),{visible:i})}else A.delete(t),r={visible:i};var o;E.push(r)});let P=0;k.forEach(e=>P=Math.min(P,e.x2)),k.push({y:Math.max(a,l),x1:0,x2:P});const _=[],L=[];k.forEach(e=>{if(e.y>=s[0]-1e-7&&e.y<=s[1]+1e-7){const{x1:t,x2:i,y:n}=e,s=new es(Math.min(t,i),n,Math.abs(t-i),0);L.push(s),_.push({x1:t,x2:i,y:n})}});const N=[],O=[],F=y?y.depth+1:1;for(let e=0;e<F;e++){const t=v.length>0&&(0===e||R&&C),i=e>0?-M-2*this.label.padding-(e-1)*g:0,n=new es(i,Math.min(...s),0,Math.abs(s[1]-s[0]));O.push(n),N.push({x:i,y1:s[0],y2:s[1],visible:t})}return{bbox:(e=>{const t=new os,{rotation:i,translationX:n,translationY:s,rotationCenterX:r,rotationCenterY:o}=this.getAxisTransform();return os.updateTransformMatrix(t,1,1,i,n,s,{scalingCenterX:0,scalingCenterY:0,rotationCenterX:r,rotationCenterY:o}),t.transformBBox(e)})(es.merge([...A.values(),...L,...O])),tickLabelLayout:E,separatorLayout:_,axisLineLayout:N}}calculateLayout(){const{axisLineLayout:e,separatorLayout:t,tickLabelLayout:i,bbox:n}=this.computeLayout();return this.computedLayout={axisLineLayout:e,separatorLayout:t,tickLabelLayout:i},{bbox:n,primaryTickCount:void 0}}};Gl.className="GroupedCategoryAxis",Gl.type="grouped-category",b([$s(fr,{optional:!0})],Gl.prototype,"labelColor",2);var Bl=class e{constructor(t){this.enabled=!0,this.width=600,this.height=300;const{width:i,height:n,pixelRatio:s,position:r,insertAsFirstChild:o}=t;this.insertAsFirstChild=null!=o&&o,this.pixelRatio=function(){if("undefined"==typeof navigator)return!1;const e=navigator.userAgent.match(/\(iPhone; CPU iPhone OS (\d+_\d+_\d+) like Mac OS X\)/);if(null==e)return!1;const[t,i]=e[1].split("_").map(Number);return t<16||16===t&&i<6}()?1:null!=s?s:Sn("devicePixelRatio"),this.element=xn("canvas"),this.element.width=Math.round((null!=i?i:this.width)*this.pixelRatio),this.element.height=Math.round((null!=n?n:this.height)*this.pixelRatio),r&&(this.element.style.position=r),this.context=this.element.getContext("2d"),this.onEnabledChange(),this.resize(null!=i?i:0,null!=n?n:0),e.debugContext(this.context)}static is(t){return t instanceof e}drawImage(e,t=0,i=0){return e.drawImage(this.context.canvas,t,i)}toDataURL(e){return this.element.toDataURL(e)}resize(e,t){if(!(e>0&&t>0))return;const{element:i,context:n,pixelRatio:s}=this;i.width=Math.round(e*s),i.height=Math.round(t*s),n.setTransform(s,0,0,s,0,0),i.style.width=e+"px",i.style.height=t+"px",this.width=e,this.height=t}snapshot(){}clear(){this.context.save(),this.context.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0),this.context.clearRect(0,0,this.width,this.height),this.context.restore()}destroy(){this.element.remove(),this.element.width=0,this.element.height=0,this.context.clearRect(0,0,0,0),Object.freeze(this)}onContainerChange(e,t){var i,n,s,r;e!==t&&(null==(i=this.element.parentNode)||i.removeChild(this.element),this.insertAsFirstChild&&(null==(n=this.container)?void 0:n.firstChild)?null==(s=this.container)||s.insertBefore(this.element,this.container.firstChild):null==(r=this.container)||r.appendChild(this.element))}onEnabledChange(){this.element&&(this.element.style.display=this.enabled?"block":"none")}static debugContext(e){if(In.check("canvas")){const t=e.save.bind(e),i=e.restore.bind(e);let n=0;Object.assign(e,{save(){t(),n++},restore(){if(0===n)throw new Error("AG Charts - Unable to restore() past depth 0");i(),n--},verifyDepthZero(){if(0!==n)throw new Error(`AG Charts - Save/restore depth is non-zero: ${n}`)}})}}};b([Xa(e=>e.onEnabledChange())],Bl.prototype,"enabled",2),b([Xa((e,t,i)=>e.onContainerChange(t,i))],Bl.prototype,"container",2);var Vl=Bl,Hl=class e{constructor(e,t){this.canvas=e,this.markDirty=t,this.debug=In.create(!0,"scene"),this.layersMap=new Map,this.nextZIndex=0,this.nextLayerId=0}static sortLayers(e,t){var i,n;return wo([e.zIndex,...null!=(i=e.zIndexSubOrder)?i:[void 0,void 0],e.id],[t.zIndex,...null!=(n=t.zIndexSubOrder)?n:[void 0,void 0],t.id],bo)}get size(){return this.layersMap.size}forEach(t){Array.from(this.layersMap.values()).sort(e.sortLayers).forEach(t)}resize(e,t){this.canvas.resize(e,t),this.layersMap.forEach(({canvas:i})=>i.resize(e,t))}addLayer(e){const{width:t,height:i,pixelRatio:n}=this.canvas,{zIndex:s=this.nextZIndex++,name:r,zIndexSubOrder:o,getComputedOpacity:a,getVisibility:l}=e,c=new Vl({width:t,height:i,pixelRatio:n,position:"absolute"}),h={id:this.nextLayerId++,name:r,canvas:c,zIndex:s,zIndexSubOrder:o,getComputedOpacity:a,getVisibility:l};return s>=this.nextZIndex&&(this.nextZIndex=s+1),this.layersMap.set(c,h),this.debug("Scene.addLayer() - layers",this.layersMap),h.canvas}removeLayer(e){this.layersMap.has(e)&&(this.layersMap.delete(e),e.destroy(),this.markDirty(),this.debug("Scene.removeLayer() -  layers",this.layersMap))}moveLayer(e,t,i){const n=this.layersMap.get(e);n&&(n.zIndex=t,n.zIndexSubOrder=i,this.markDirty(),this.debug("Scene.moveLayer() -  layers",this.layersMap))}clear(){this.layersMap.clear()}};function Ul(e,t,i,n,s={}){if(!In.check("scene:stats","scene:stats:verbose"))return;const{layersRendered:r=0,layersSkipped:o=0,nodesRendered:a=0,nodesSkipped:l=0}=null!=n?n:{},c=performance.now(),h=t,{start:u}=h,d=y(h,["start"]),p=Object.entries(d).map(([e,t])=>$l(e,t)).filter(e=>null!=e).join(" + "),g=Object.entries(s).map(([e,t])=>`${e}: ${t}`).join(" ; "),f=In.check("scene:stats:verbose"),m=[`${$l("⏱️",u,c)} (${p})`,`${g}`,`Layers: ${f?jl(r,o):e.size}`,f?`Nodes: ${jl(a,l)}`:null].filter(He),v=new Map(m.map(e=>[e,Oo.getTextSize(e,i.font)])),b=Math.max(...Array.from(v.values(),e=>e.width)),C=function(e,t){let i=0;for(const n of e)i+=t(n);return i}(v.values(),e=>e.height);i.save(),i.fillStyle="white",i.fillRect(0,0,b,C),i.fillStyle="black";let w=0;for(const[e,t]of v.entries())w+=t.height,i.fillText(e,2,w);i.restore()}function zl(e){var t,i;return In.check(!0,"scene")?f(f({node:e,name:null!=(t=e instanceof xo?e.name:null)?t:e.id,dirty:ts[e.dirty]},(null==(i=e.parent)?void 0:i.isVirtual)?{virtualParentDirty:ts[e.parent.dirty],virtualParent:e.parent}:{}),e.children.map(e=>zl(e)).reduce((e,t)=>{let{name:i}=t;const{node:{visible:n,opacity:s,zIndex:r,zIndexSubOrder:o},node:a,virtualParent:l}=t;(!n||s<=0)&&(i=`(${i})`),a instanceof xo&&a.isLayer()&&(i=`*${i}*`);const c=[`${null!=i?i:"<unknown>"}`,`z: ${r}`,o&&`zo: ${o.map(e=>"function"==typeof e?`${e()} (fn)`:e).join(" / ")}`,l&&"(virtual parent)"].filter(e=>!!e).join(" ");let h=c,u=1;for(;null!=e[h]&&u<100;)h=`${c} (${u++})`;return e[h]=t,e},{})):{}}function Wl(e){var t;if(0===e.dirty)return{dirtyTree:{},paths:[]};const i=e.children.map(e=>Wl(e)).filter(e=>e.paths.length>0),n=xo.is(e)&&null!=(t=e.name)?t:e.id,s=i.length?i.flatMap(e=>e.paths).map(e=>`${n}.${e}`):[n];return{dirtyTree:f({name:n,node:e,dirty:ts[e.dirty]},i.map(e=>e.dirtyTree).filter(e=>null!=e.dirty).reduce((e,t)=>{var i;return e[null!=(i=t.name)?i:"<unknown>"]=t,e},{})),paths:s}}function jl(e,t){const i=e+t;return`${e} / ${i} (${Math.round(100*e/i)}%)`}function $l(e,t,i){const n=null!=i?i-t:t;return`${e}: ${Math.round(100*n)/100}ms`}var Kl=class{constructor({width:e,height:t,pixelRatio:i,canvasPosition:n}){this.debug=In.create(!0,"scene"),this.id=Gn(this),this.root=null,this.isDirty=!1,this.canvas=new Vl({width:e,height:t,pixelRatio:i,position:n,insertAsFirstChild:"absolute"===n}),this.layersManager=new Hl(this.canvas,()=>{this.isDirty=!0})}get width(){var e,t;return null!=(t=null==(e=this.pendingSize)?void 0:e[0])?t:this.canvas.width}get height(){var e,t;return null!=(t=null==(e=this.pendingSize)?void 0:e[1])?t:this.canvas.height}setContainer(e){return this.canvas.container=e,this}setRoot(e){var t;return this.root===e||(this.isDirty=!0,null==(t=this.root)||t._setLayerManager(),this.root=e,e&&(e.visible=!0,e._setLayerManager(this.layersManager))),this}attachNode(e){var t;return null==(t=this.root)||t.appendChild(e),()=>this.removeChild(e)}appendChild(e){var t;return null==(t=this.root)||t.appendChild(e),this}removeChild(e){var t;return null==(t=this.root)||t.removeChild(e),this}download(e,t){var i;En(this.canvas.toDataURL(t),null!=(i=null==e?void 0:e.trim())?i:"image")}getDataURL(e){return this.canvas.toDataURL(e)}resize(e,t){return e=Math.round(e),t=Math.round(t),e>0&&t>0&&(e!==this.width||t!==this.height)&&(this.pendingSize=[e,t],this.isDirty=!0,!0)}render(e){return w(this,null,function*(){var t,i;const{debugSplitTimes:n={start:performance.now()},extraDebugStats:s}=null!=e?e:{},{canvas:r,canvas:{context:o}={},root:a,pendingSize:l}=this;if(!o)return;const c=performance.now();if(l&&(this.layersManager.resize(...l),this.pendingSize=void 0),a&&!a.visible)return void(this.isDirty=!1);if(a&&!this.isDirty)return this.debug.check()&&this.debug("Scene.render() - no-op",{redrawType:ts[a.dirty],tree:zl(a)}),void Ul(this.layersManager,n,o,void 0,s);const h={ctx:o,devicePixelRatio:null!=(t=this.canvas.pixelRatio)?t:1,forceRender:!0,resized:Boolean(l),debugNodes:{}};In.check("scene:stats:verbose")&&(h.stats={layersRendered:0,layersSkipped:0,nodesRendered:0,nodesSkipped:0});let u=!1;if((!a||a.dirty>=1)&&(u=!0,r.clear()),a&&In.check("scene:dirtyTree")){const{dirtyTree:e,paths:t}=Wl(a);In.create("scene:dirtyTree")("Scene.render() - dirtyTree",{dirtyTree:e,paths:t})}if(a&&u&&(this.debug("Scene.render() - before",{redrawType:ts[a.dirty],canvasCleared:u,tree:zl(a)}),a.visible&&(a.preRender(),o.save(),a.render(h),o.restore())),n["✍️"]=performance.now()-c,this.layersManager.size&&u){const e=performance.now();o.save(),o.resetTransform(),this.layersManager.forEach(e=>{e.canvas.enabled&&e.getVisibility()&&(o.globalAlpha=e.getComputedOpacity(),e.canvas.drawImage(o))}),o.restore(),n["⛙"]=performance.now()-e}null==(i=o.verifyDepthZero)||i.call(o),this.isDirty=!1,Ul(this.layersManager,n,o,h.stats,s),function(e,t){e.save();for(const[i,n]of Object.entries(t)){const t=n.computeTransformedBBox();t?(e.globalAlpha=.8,e.strokeStyle="red",e.lineWidth=1,e.strokeRect(t.x,t.y,t.width,t.height),e.fillStyle="red",e.strokeStyle="white",e.font="16px sans-serif",e.textBaseline="top",e.textAlign="left",e.lineWidth=2,e.strokeText(i,t.x,t.y,t.width),e.fillText(i,t.x,t.y,t.width)):L.log(`Scene.render() - no bbox for debugged node [${i}].`)}e.restore()}(o,h.debugNodes),a&&this.debug.check()&&this.debug("Scene.render() - after",{redrawType:ts[a.dirty],tree:zl(a),canvasCleared:u})})}strip(){const{context:e,pixelRatio:t}=this.canvas;e.setTransform(t,0,0,t,0,0),this.layersManager.clear(),this.setRoot(null),this.isDirty=!1}destroy(){this.canvas.container=void 0,this.strip(),this.canvas.destroy(),Object.assign(this,{canvas:void 0})}};function Yl(e){return new Promise(t=>{setTimeout(()=>t(void 0),e)})}Kl.className="Scene";var ql=class{constructor(){this.available=!0,this.acquireQueue=[]}acquire(e){return new Promise(t=>{this.acquireQueue.push([e,t]),this.available&&this.dispatchNext().catch(e=>L.errorOnce(e))})}acquireImmediately(e){return w(this,null,function*(){return!!this.available&&(yield this.acquire(e),!0)})}waitForClearAcquireQueue(){return w(this,null,function*(){return this.acquire(()=>w(this,null,function*(){}))})}dispatchNext(){return w(this,null,function*(){var e,t;this.available=!1;let[i,n]=null!=(e=this.acquireQueue.shift())?e:[];for(;i;){try{yield i(),null==n||n()}catch(e){L.error("mutex callback error",e),null==n||n()}[i,n]=null!=(t=this.acquireQueue.shift())?t:[]}this.available=!0})}},Xl=class{constructor(){this.eventListeners=new Map}addEventListener(e,t){if("function"!=typeof t)throw new Error("AG Charts - listener must be a Function");const i=this.eventListeners.get(e);i?i.add(t):this.eventListeners.set(e,new Set([t]))}removeEventListener(e,t){var i;null==(i=this.eventListeners.get(e))||i.delete(t),0===this.eventListeners.size&&this.eventListeners.delete(e)}hasEventListener(e){return this.eventListeners.has(e)}clearEventListeners(){this.eventListeners.clear()}fireEvent(e){var t;null==(t=this.eventListeners.get(e.type))||t.forEach(t=>t(e))}},Zl=class extends yt{constructor(e=0,t=e,i=e,n=t){super(),this.top=e,this.right=t,this.bottom=i,this.left=n}clear(){this.top=this.right=this.bottom=this.left=0}};function Ql(e,t){let i,n,s=0,r=!1;const o=()=>r,a=()=>{r=!1,null==n||n(),n=void 0,i=void 0,s>0&&e(l)},l=()=>{const e=s;s=0,r=!0;const i=t({count:e});i?i.then(a,a):a()};return{schedule(t){0!==s||o()||e(l,t),s++},await(){return w(this,null,function*(){if(o())for(null==i&&(i=new Promise(e=>{n=e}));o();)yield i})}}}b([$s(nr)],Zl.prototype,"top",2),b([$s(nr)],Zl.prototype,"right",2),b([$s(nr)],Zl.prototype,"bottom",2),b([$s(nr)],Zl.prototype,"left",2);var Jl=class{constructor(){var e;this.elements=new Map,this.documentReady=!1,this.queuedObserveRequests=[],this.onLoad=()=>{this.documentReady=!0,this.queuedObserveRequests.forEach(([e,t])=>this.observe(e,t)),this.queuedObserveRequests=[]},"undefined"!=typeof ResizeObserver&&(this.resizeObserver=new ResizeObserver(e=>{for(const{target:t,contentRect:i}of e){const{width:e,height:n}=i;this.checkSize(this.elements.get(t),t,e,n)}}),this.documentReady="complete"===wn("readyState"),this.documentReady||null==(e=Sn())||e.addEventListener("load",this.onLoad))}destroy(){var e,t;null==(e=Sn())||e.removeEventListener("load",this.onLoad),null==(t=this.resizeObserver)||t.disconnect(),this.resizeObserver=null}checkSize(e,t,i,n){var s,r;e&&(i===(null==(s=e.size)?void 0:s.width)&&n===(null==(r=e.size)?void 0:r.height)||(e.size={width:i,height:n},e.cb(e.size,t)))}observe(e,t){var i;this.documentReady?(this.elements.has(e)?this.removeFromQueue(e):null==(i=this.resizeObserver)||i.observe(e),this.elements.set(e,{cb:t})):this.queuedObserveRequests.push([e,t])}unobserve(e){var t;null==(t=this.resizeObserver)||t.unobserve(e),this.elements.delete(e),this.removeFromQueue(e),this.elements.size||this.destroy()}removeFromQueue(e){this.queuedObserveRequests=this.queuedObserveRequests.filter(([t])=>t!==e)}},ec=class{constructor(){this.cache=new WeakMap}call(e,...t){let i,n=this.cache.get(e);const s=()=>{try{const s=e(...t);return n&&null!=i&&n.set(i,s),s}catch(e){return void L.warnOnce("User callback errored, ignoring",e)}};try{i=JSON.stringify(t)}catch(e){return s()}return null==n&&(n=new Map,this.cache.set(e,n)),n.has(i)?n.get(i):s()}invalidateCache(){this.cache=new WeakMap}},tc=class{constructor(e){this.annotationRoot=e}attachNode(e){return this.annotationRoot.append(e),()=>{var t;return null==(t=this.annotationRoot)||t.removeChild(e),this}}setAnnotationStyles(e){this.styles=e}getAnnotationTypeStyles(e){var t;return null==(t=this.styles)?void 0:t[e]}},ic=class{constructor(){this.registeredListeners=new Map}addListener(e,t){const i={symbol:Symbol(e),handler:t};return this.registeredListeners.has(e)?this.registeredListeners.get(e).push(i):this.registeredListeners.set(e,[i]),()=>this.removeListener(i.symbol)}removeListener(e){for(const[t,i]of this.registeredListeners.entries()){const n=i.findIndex(t=>t.symbol===e);if(n>=0){i.splice(n,1),0===i.length&&this.registeredListeners.delete(t);break}}}dispatch(e,...t){for(const i of this.getListenersByType(e))try{i.handler(...t)}catch(e){L.errorOnce(e)}}dispatchWrapHandlers(e,t,...i){for(const n of this.getListenersByType(e))try{t(n.handler,...i)}catch(e){L.errorOnce(e)}}getListenersByType(e){var t;return null!=(t=this.registeredListeners.get(e))?t:[]}destroy(){this.registeredListeners.clear()}},nc=class extends ic{constructor(e){super(),this.animationManager=e,this.dispatchOnlyLatest=!0,this.dispatchThrottle=0,this.requestThrottle=300,this.isLoadingInitialData=!1,this.isLoadingData=!1,this.freshRequests=[],this.requestCounter=0,this.debug=In.create(!0,"data-model","data-source"),this.throttledFetch=this.createThrottledFetch(this.requestThrottle),this.throttledDispatch=this.createThrottledDispatch(this.dispatchThrottle)}updateCallback(e){"function"==typeof e&&(this.debug("DataService - updated data source callback"),this.dataSourceCallback=e,this.isLoadingInitialData=!0,this.animationManager.skip(),this.dispatch("data-source-change"))}clearCallback(){this.dataSourceCallback=void 0}load(e){this.isLoadingData=!0,this.throttledFetch(e)}isLazy(){return null!=this.dataSourceCallback}isLoading(){return this.isLazy()&&(this.isLoadingInitialData||this.isLoadingData)}createThrottledFetch(e){return _(e=>this.fetch(e),e,{leading:!1,trailing:!0})}createThrottledDispatch(e){return _((e,t)=>{this.debug(`DataService - dispatching 'data-load' | ${e}`),this.dispatch("data-load",{type:"data-load",data:t})},e,{leading:!0,trailing:!0})}fetch(e){return w(this,null,function*(){if(!this.dataSourceCallback)throw new Error("DataService - [dataSource.getData] callback not initialised");const t=performance.now(),i=this.requestCounter++;let n;this.debug(`DataService - requesting | ${i}`),this.freshRequests.push(i);try{n=yield this.dataSourceCallback(e),this.debug(`DataService - response | ${performance.now()-t}ms | ${i}`)}catch(e){this.debug(`DataService - request failed | ${i}`),L.errorOnce(`DataService - request failed | [${e}]`)}this.isLoadingInitialData=!1;const s=this.freshRequests.findIndex(e=>e===i);-1===s||this.dispatchOnlyLatest&&s!==this.freshRequests.length-1?this.debug(`DataService - discarding stale request | ${i}`):(this.freshRequests=this.freshRequests.slice(s+1),0===this.freshRequests.length&&(this.isLoadingData=!1),Array.isArray(n)?this.throttledDispatch(i,n):this.dispatch("data-error"))})}};b([qa({newValue(e){this.throttledDispatch=this.createThrottledDispatch(e)}})],nc.prototype,"dispatchThrottle",2),b([qa({newValue(e){this.throttledFetch=this.createThrottledFetch(e)}})],nc.prototype,"requestThrottle",2);var sc=class{constructor(e){this.maxAnimationTime=e,this.debug=In.create(!0,"animation"),this.controllers=new Map,this.stoppedCbs=new Set,this.currentPhase=0,this.phases=new Map(Es.map(e=>[e,[]])),this.skipAnimations=!1,this.animationTimeConsumed=0,this.isReady=!1}get size(){return this.controllers.size}get consumedTimeMs(){return this.animationTimeConsumed}isActive(){return this.controllers.size>0}getActiveControllers(){var e;return null!=(e=this.phases.get(Es[this.currentPhase]))?e:[]}checkOverlappingId(e){null!=e&&this.controllers.has(e)&&(this.controllers.get(e).stop(),this.debug(`Skipping animation batch due to update of existing animation: ${e}`),this.skip())}addAnimation(e){var t;if(!e.isComplete)return Es.indexOf(e.phase)<this.currentPhase?(this.debug("Skipping animation due to being for an earlier phase",e.id),void e.stop()):(this.controllers.set(e.id,e),void(null==(t=this.phases.get(e.phase))||t.push(e)))}removeAnimation(e){this.controllers.delete(e.id);const t=this.phases.get(e.phase),i=null==t?void 0:t.indexOf(e);null!=i&&i>=0&&(null==t||t.splice(i,1))}progress(e){if(!this.isReady)return;let t=0===e?.01:e;const i=()=>{const e=Es[this.currentPhase];return{phaseControllers:[...this.getActiveControllers()],phase:e,phaseMeta:As[e]}};let{phase:n,phaseControllers:s,phaseMeta:r}=i();const o=()=>null==Es[this.currentPhase],a=()=>{for(({phase:n,phaseControllers:s,phaseMeta:r}=i());!o()&&0===s.length;)this.currentPhase++,({phase:n,phaseControllers:s,phaseMeta:r}=i()),this.debug(`AnimationBatch - phase changing to ${n}`,{unusedTime:t},s)},l=this.controllers.size;this.debug(`AnimationBatch - ${e}ms; phase ${n} with ${null==s?void 0:s.length} of ${l}`);do{const e=t,i=r.skipIfNoEarlierAnimations&&0===this.animationTimeConsumed;let n=0;for(const r of s)i?r.stop():t=Math.min(r.update(e),t),r.isComplete&&(n++,this.removeAnimation(r));this.animationTimeConsumed+=e-t,this.debug(`AnimationBatch - updated ${s.length} controllers; ${n} completed`),this.debug(`AnimationBatch - animationTimeConsumed: ${this.animationTimeConsumed}`),a()}while(t>0&&!o());this.animationTimeConsumed>this.maxAnimationTime&&(L.warnOnce("Animation batch exceeded max animation time, skipping.",new Map(this.controllers.entries())),this.stop())}ready(){if(this.isReady)return;this.isReady=!0,this.debug(`AnimationBatch - ready; skipped: ${this.skipAnimations}`,[...this.controllers]);let e=!0;for(const[,t]of this.controllers)if(t.duration>0&&!0!==As[t.phase].skipIfNoEarlierAnimations){e=!1;break}if(!e)for(const[,e]of this.controllers)e.autoplay&&e.play(!0)}skip(e=!0){if(!1===this.skipAnimations&&!0===e){for(const e of this.controllers.values())e.stop();this.controllers.clear()}this.skipAnimations=e}play(){for(const e of this.controllers.values())e.play()}pause(){for(const e of this.controllers.values())e.pause()}stop(){for(const e of this.controllers.values())try{e.stop(),this.removeAnimation(e)}catch(e){L.error("Error during animation stop",e)}this.dispatchStopped()}stopByAnimationId(e){if(null!=e&&this.controllers.has(e)){const t=this.controllers.get(e);t&&(t.stop(),this.removeAnimation(t))}}stopByAnimationGroupId(e){for(const t of this.controllers.values())t.groupId===e&&this.stopByAnimationId(t.id)}dispatchStopped(){this.stoppedCbs.forEach(e=>e()),this.stoppedCbs.clear()}isSkipped(){return this.skipAnimations}destroy(){this.stop(),this.controllers.clear()}},rc=class{constructor(){this.listeners=new ic,this.destroyFns=[]}addListener(e,t){return this.listeners.addListener(e,t)}removeListener(e){this.listeners.removeListener(e)}destroy(){this.listeners.destroy(),this.destroyFns.forEach(e=>e())}};function oc(e){const t=m(f({},e),{consumed:!1,consume(){var i,n;t.consumed=!0,e.sourceEvent instanceof Event?null==(i=e.sourceEvent)||i.preventDefault():null==(n=e.sourceEvent)||n.consume()}});return t}function ac(e,t,i){e.dispatchWrapHandlers(t,(e,t)=>{t.consumed||e(t)},i)}var lc=["click","dblclick","contextmenu","hover","drag-start","drag","drag-end","leave","enter","page-left","wheel"],cc=["blur","focus"],hc=["keydown","keyup"],uc=["pagehide","mousemove","mouseup"],dc=["click","dblclick","contextmenu","mousedown","mouseout","mouseenter","touchstart","touchmove","touchend","touchcancel","wheel","blur","focus","keydown","keyup"],pc=(e=>(e[e.Default=16]="Default",e[e.ZoomDrag=8]="ZoomDrag",e[e.Annotations=4]="Annotations",e[e.ContextMenu=2]="ContextMenu",e[e.Animation=1]="Animation",e[e.All=31]="All",e))(pc||{}),gc=class e extends rc{constructor(e,t){super(),this.keyboardOptions=e,this.debug=In.create(!0,"interaction"),this.eventHandler=e=>this.processEvent(e),this.mouseDown=!1,this.touchDown=!1,this.clickHistory=[{offsetX:NaN,offsetY:NaN,type:"mousedown"}],this.dblclickHistory=[{offsetX:NaN,offsetY:NaN,type:"mousedown"},{offsetX:NaN,offsetY:NaN,type:"mouseup"},{offsetX:NaN,offsetY:NaN,type:"mousedown"}],this.stateQueue=17,this.rootElement=wn("body"),this.element=t;for(const e of dc)e.startsWith("touch")?t.addEventListener(e,this.eventHandler,{passive:!0}):"wheel"===e?t.addEventListener(e,this.eventHandler,{passive:!1}):t.addEventListener(e,this.eventHandler);for(const e of uc)Sn().addEventListener(e,this.eventHandler);An("\n.ag-chart-wrapper {\n    touch-action: none;\n}\n","interactionManager")}destroy(){super.destroy();for(const e of uc)Sn().removeEventListener(e,this.eventHandler);for(const e of dc)this.element.removeEventListener(e,this.eventHandler)}addListener(e,t,i=16){return super.addListener(e,e=>{this.getState()&i&&t(e)})}pushState(e){this.stateQueue|=e}popState(e){this.stateQueue&=~e}getState(){return this.stateQueue&-this.stateQueue}processEvent(e){const t=this.decideInteractionEventTypes(e);t.length>0&&this.dispatchEvent(e,t).catch(e=>L.errorOnce(e))}dispatchEvent(e,t){return w(this,null,function*(){if(vn(lc,t))this.dispatchPointerEvent(e,t);else if(vn(cc,t))for(const i of t)ac(this.listeners,i,oc({type:i,sourceEvent:e}));else if(vn(hc,t))for(const i of t)ac(this.listeners,i,oc({type:i,sourceEvent:e}))})}dispatchPointerEvent(e,t){const i=this.calculateCoordinates(e);if(null!=i)for(const n of t)ac(this.listeners,n,this.buildPointerEvent(f({type:n,event:e},i)))}recordDown(e){e instanceof MouseEvent&&(it(["offsetX","offsetY"],this.clickHistory[0],e),it(["offsetX","offsetY"],this.dblclickHistory[2],this.dblclickHistory[0]),it(["offsetX","offsetY"],this.dblclickHistory[0],e)),this.dragStartElement=e.target}recordUp(e){e instanceof MouseEvent&&it(["offsetX","offsetY"],this.dblclickHistory[1],e),this.dragStartElement=void 0}decideInteractionEventTypes(e){const t="drag-start";switch(e.type){case"blur":case"focus":case"keydown":case"keyup":return this.keyboardOptions.enabled?[e.type]:[];case"click":case"dblclick":case"contextmenu":case"wheel":return[e.type];case"mousedown":return this.isEventOverElement(e)?(this.mouseDown=!0,this.recordDown(e),[t]):[];case"touchstart":return this.isEventOverElement(e)?(this.touchDown=!0,this.recordDown(e),[t]):[];case"touchmove":case"mousemove":return this.mouseDown||this.touchDown||this.isEventOverElement(e)?this.mouseDown||this.touchDown?["drag"]:["hover"]:[];case"mouseup":return this.mouseDown||this.isEventOverElement(e)?(this.mouseDown=!1,this.recordUp(e),["drag-end"]):[];case"touchend":return this.touchDown||this.isEventOverElement(e)?(this.touchDown=!1,this.recordUp(e),["drag-end"]):[];case"mouseout":case"touchcancel":return["leave"];case"mouseenter":const i=e instanceof MouseEvent&&!(1&~e.buttons);return this.mouseDown!==i?(this.mouseDown=i,[i?t:"drag-end"]):["enter"];case"pagehide":return["page-left"]}return[]}isEventOverElement(e){var t,i,n;return e.target===this.element||(null==(t=e.target)?void 0:t.parentElement)===this.element||(null==(n=null==(i=e.target)?void 0:i.parentElement)?void 0:n.parentElement)===this.element}calculateCoordinates(t){var i;if(t instanceof MouseEvent)return this.getMouseEventCoords(t);if("undefined"!=typeof TouchEvent&&t instanceof TouchEvent){const n=null!=(i=t.touches[0])?i:t.changedTouches[0],{clientX:s,clientY:r,pageX:o,pageY:a}=n;return m(f({},e.NULL_COORDS),{clientX:s,clientY:r,pageX:o,pageY:a})}if(t instanceof PageTransitionEvent){if(t.persisted)return;return e.NULL_COORDS}}getMouseEventCoords(e){const{clientX:t,clientY:i,pageX:n,pageY:s}=e;let{offsetX:r,offsetY:o}=e;const a=e=>{let t=0,i=0;for(;e;)t+=e.offsetLeft,i+=e.offsetTop,e=e.offsetParent;return{x:t,y:i}};if(null!=this.dragStartElement&&e.target!==this.dragStartElement){const t=a(this.dragStartElement),i=a(e.target);r-=t.x-i.x,o-=t.y-i.y}return{clientX:t,clientY:i,pageX:n,pageY:s,offsetX:r,offsetY:o}}isWheelEvent(e){return"wheel"===e.type}buildPointerEvent(e){const{type:t,event:i,clientX:n,clientY:s}=e;let{offsetX:r,offsetY:o,pageX:a,pageY:l}=e;if(!ze(r)||!ze(o)){const e=this.element.getBoundingClientRect();r=n-e.left,o=s-e.top}if(!ze(a)||!ze(l)){const e=this.rootElement.getBoundingClientRect();a=n-e.left,l=s-e.top}let[c,h]=[NaN,NaN];if(this.isWheelEvent(i)){const e=0===i.deltaMode?.01:1;c=i.deltaX*e,h=i.deltaY*e}let u=[];"click"===i.type?u=this.clickHistory:"dblclick"===i.type&&(u=this.dblclickHistory);const d=oc({type:t,offsetX:r,offsetY:o,pageX:a,pageY:l,deltaX:c,deltaY:h,pointerHistory:u,sourceEvent:i});return this.debug("InteractionManager - builtEvent: ",d),d}};gc.NULL_COORDS={clientX:-1/0,clientY:-1/0,pageX:-1/0,pageY:-1/0,offsetX:-1/0,offsetY:-1/0};var fc=gc;function mc(e){return null==e||!isNaN(e)&&e>=0&&e<=2}var yc=class extends rc{constructor(e,t){super(),this.interactionManager=e,this.chartUpdateMutex=t,this.defaultDuration=1e3,this.batch=new sc(1.5*this.defaultDuration),this.debug=In.create(!0,"animation"),this.rafAvailable="undefined"!=typeof requestAnimationFrame,this.isPlaying=!1,this.requestId=null,this.skipAnimations=!1}animate(e){var t,i=y(e,[]);const n=this.batch;try{n.checkOverlappingId(i.id)}catch(e){return void this.failsafeOnError(e)}const s=null!=(t=i.id)?t:Math.random().toString(),r=this.isSkipped()||"none"===i.phase;r&&this.debug("AnimationManager - skipping animation");const{delay:o,duration:a}=i;if(!mc(o))throw new Error(`Animation delay of ${o} is unsupported (${s})`);if(!mc(a))throw new Error(`Animation duration of ${a} is unsupported (${s})`);const l=new Ds(m(f({},i),{id:s,skip:r,autoplay:!!this.isPlaying&&i.autoplay,phase:i.phase,defaultDuration:this.defaultDuration}));if(!this.forceTimeJump(l,this.defaultDuration))return this.batch.addAnimation(l),l}play(){if(!this.isPlaying){this.isPlaying=!0,this.debug("AnimationManager.play()");try{this.batch.play()}catch(e){this.failsafeOnError(e)}this.requestAnimation()}}pause(){if(this.isPlaying){this.isPlaying=!1,this.cancelAnimation(),this.debug("AnimationManager.pause()");try{this.batch.pause()}catch(e){this.failsafeOnError(e)}}}stop(){this.isPlaying=!1,this.cancelAnimation(),this.debug("AnimationManager.stop()"),this.batch.stop()}stopByAnimationId(e){try{this.batch.stopByAnimationId(e)}catch(e){this.failsafeOnError(e)}}stopByAnimationGroupId(e){try{this.batch.stopByAnimationGroupId(e)}catch(e){this.failsafeOnError(e)}}reset(){this.isPlaying?(this.stop(),this.play()):this.stop()}skip(e=!0){this.skipAnimations=e}isSkipped(){return!this.rafAvailable||this.skipAnimations||this.batch.isSkipped()}isActive(){return this.isPlaying&&this.batch.isActive()}skipCurrentBatch(){this.debug.check()&&this.debug("AnimationManager - skipCurrentBatch()",{stack:(new Error).stack}),this.batch.skip()}isSkippingFrames(){return!0}scheduleAnimationFrame(e){this.requestId=requestAnimationFrame(e)}forceTimeJump(e,t){return!1}requestAnimation(){if(!this.rafAvailable)return;if(!this.batch.isActive()||null!==this.requestId)return;let e;const t=i=>w(this,null,function*(){const n=()=>w(this,null,function*(){const t=i-(null!=e?e:i);e=i,this.debug("AnimationManager - onAnimationFrame()",{controllersCount:this.batch.size,deltaTime:t}),this.interactionManager.pushState(1);try{this.batch.progress(t)}catch(e){this.failsafeOnError(e)}this.listeners.dispatch("animation-frame",{type:"animation-frame",deltaMs:t})});this.isSkippingFrames()?yield this.chartUpdateMutex.acquireImmediately(n):yield this.chartUpdateMutex.acquire(n),this.batch.isActive()?this.scheduleAnimationFrame(t):(this.batch.stop(),this.listeners.dispatch("animation-stop",{type:"animation-stop",deltaMs:this.batch.consumedTimeMs}))});this.listeners.dispatch("animation-start",{type:"animation-start",deltaMs:0}),this.scheduleAnimationFrame(t)}cancelAnimation(){null!==this.requestId&&(cancelAnimationFrame(this.requestId),this.requestId=null,this.startBatch())}failsafeOnError(e,t=!0){L.error("Error during animation, skipping animations",e),t&&this.cancelAnimation()}startBatch(e){this.debug(`AnimationManager - startBatch() with skipAnimations=${e}.`),this.reset(),this.batch.stop(),this.batch.destroy(),this.batch=new sc(1.5*this.defaultDuration),!0===e&&this.batch.skip()}endBatch(){this.batch.isActive()?(this.batch.ready(),this.requestAnimation()):(this.interactionManager.popState(1),this.batch.isSkipped()&&this.batch.skip(!1))}onBatchStop(e){this.batch.stoppedCbs.add(e)}},vc=class e{constructor(t){this.canvas=t,this.debug=In.create(!0,"aria"),this.canvas.appendChild(this.liveElem=e.createAnnouncer())}static createAnnouncer(){const e=wn().createElement("div");return e.classList.add("ag-charts-aria-announcer"),Za(e,"role","status"),Za(e,"aria-live","assertive"),e}destroy(){this.canvas.removeChild(this.liveElem)}announceValue(e){this.debug(`AriaAnnouncementService - announceValue: ${e}`),this.liveElem.textContent=e}},bc=class extends rc{legendItemClick(e,t,i,n){const s={type:"legend-item-click",series:e,itemId:t,enabled:i,legendItemName:n};this.listeners.dispatch("legend-item-click",s)}legendItemDoubleClick(e,t,i,n,s){const r={type:"legend-item-double-click",series:e,itemId:t,enabled:i,legendItemName:s,numVisibleItems:n};this.listeners.dispatch("legend-item-double-click",r)}axisHover(e,t){const i={type:"axis-hover",axisId:e,direction:t};this.listeners.dispatch("axis-hover",i)}},Cc=class{constructor(){this.defaultActions=[],this.disabledActions=new Set}copyDefaultActions(){return[...this.defaultActions]}registerDefaultAction(e){e.id&&this.defaultActions.find(({id:t})=>t===e.id)||this.defaultActions.push(e)}enableAction(e){this.disabledActions.delete(e)}disableAction(e){this.disabledActions.add(e)}isDisabled(e){return this.disabledActions.has(e)}},wc=class extends Map{constructor(e,t){super(),this.defaultValue=e,this.defaultState=t}set(e,t){return this.delete(e),void 0!==t&&super.set(e,t),this}stateId(){var e;return null!=(e=Array.from(this.keys()).pop())?e:this.defaultState}stateValue(){var e;return null!=(e=Array.from(this.values()).pop())?e:this.defaultValue}},Sc=class{constructor(e){this.element=e,this.stateTracker=new wc("default")}updateCursor(e,t){this.stateTracker.set(e,t),this.element.style.cursor=this.stateTracker.stateValue()}getCursor(){return this.element.style.cursor}};function xc(e,t){return Math.sqrt(function(e,t){const i=e.screenX-t.screenX,n=e.screenY-t.screenY;return i*i+n*n}(e,t))}var Ec=class extends rc{constructor(e){super(),this.touchstart=e=>this.onTouchStart(e),this.touchmove=e=>this.onTouchMove(e),this.touchend=e=>this.onTouchEnd(e),this.touchcancel=e=>this.onTouchCancel(e),this.pinch={finger1:{identifier:NaN,screenX:NaN,screenY:NaN},finger2:{identifier:NaN,screenX:NaN,screenY:NaN},origin:{x:NaN,y:NaN},distance:NaN,status:0},this.element=e,e.addEventListener("touchstart",this.touchstart,{passive:!0}),e.addEventListener("touchmove",this.touchmove,{passive:!0}),e.addEventListener("touchend",this.touchend),e.addEventListener("touchcancel",this.touchcancel)}destroy(){const{element:e}=this;e.removeEventListener("touchstart",this.touchstart),e.removeEventListener("touchmove",this.touchmove),e.removeEventListener("touchend",this.touchend),e.removeEventListener("touchcancel",this.touchcancel)}findPinchTouches(e){const{touches:t}=e,{finger1:i,finger2:n}=this.pinch;if(0!==this.pinch.status&&2===t.length){if(t[0].identifier===i.identifier&&t[1].identifier===n.identifier)return[t[0],t[1]];if(t[0].identifier===n.identifier&&t[1].identifier===i.identifier)return[t[1],t[0]]}}copyTouchData(e){const t=["identifier","screenX","screenY"];it(t,this.pinch.finger1,e.touches[0]),it(t,this.pinch.finger2,e.touches[1]),this.pinch.distance=xc(this.pinch.finger1,this.pinch.finger2)}dispatchPinchEvent(e,t){const{finger1:i,finger2:n,origin:s}=this.pinch,r={type:e,finger1:i,finger2:n,deltaDistance:t,origin:s};this.listeners.dispatch(e,r)}onTouchStart(e){this.stopPinchTracking();const{pinch:t}=this;2===e.touches.length&&(t.status=1,this.copyTouchData(e),t.origin.x=(e.touches[0].clientX+e.touches[1].clientX)/2,t.origin.y=(e.touches[0].clientY+e.touches[1].clientY)/2)}onTouchMove(e){const t=this.findPinchTouches(e);if(void 0!==t){const[i,n]=t,{pinch:s}=this,r=xc(i,n),o=r-s.distance;1===s.status?Math.abs(o)>1&&(s.status=2,this.copyTouchData(e),this.dispatchPinchEvent("pinch-start",0)):2===s.status?(s.distance=r,this.copyTouchData(e),this.dispatchPinchEvent("pinch-move",o)):L.error(`unexpected pinch.status: ${s.status}`)}}onTouchEnd(e){this.stopPinchTracking()}onTouchCancel(e){this.stopPinchTracking()}stopPinchTracking(){const{pinch:e}=this;2===e.status&&this.dispatchPinchEvent("pinch-end",0),this.pinch.status=0}},Ac=class extends rc{constructor(){super(...arguments),this.highlightStates=new wc,this.pickedStates=new wc}updateHighlight(e,t){const{activeHighlight:i}=this;this.highlightStates.set(e,t),this.activeHighlight=this.highlightStates.stateValue(),this.isEqual(this.activeHighlight,i)||this.listeners.dispatch("highlight-change",{type:"highlight-change",currentHighlight:this.activeHighlight,previousHighlight:i})}getActiveHighlight(){return this.activeHighlight}updatePicked(e,t){this.pickedStates.set(e,t),this.activePicked=this.pickedStates.stateValue()}getActivePicked(){return this.activePicked}isEqual(e,t){return e===t||(null==e?void 0:e.series)===(null==t?void 0:t.series)&&(null==e?void 0:e.itemId)===(null==t?void 0:t.itemId)&&(null==e?void 0:e.datum)===(null==t?void 0:t.datum)}},Mc=class extends rc{constructor(e){super(),this.hasBrowserFocus=!1,this.isMouseBlurred=!1,this.isClicking=!1,this.destroyFns.push(e.addListener("drag-start",e=>this.onClickStart(e),31),e.addListener("click",e=>this.onClickStop(e),31),e.addListener("drag-end",e=>this.onClickStop(e),31),e.addListener("wheel",e=>this.mouseBlur(e)),e.addListener("hover",e=>this.mouseBlur(e)),e.addListener("drag",e=>this.mouseBlur(e)),e.addListener("blur",e=>this.onBlur(e),31),e.addListener("focus",e=>this.onFocus(e),31),e.addListener("keydown",e=>this.onKeyDown(e),31))}destroy(){super.destroy()}onClickStart(e){this.isClicking=!0,this.mouseBlur(e)}onClickStop(e){this.isClicking=!1,this.mouseBlur(e)}mouseBlur(e){this.hasBrowserFocus&&(this.isMouseBlurred||(this.dispatch("blur",0,e),this.isMouseBlurred=!0))}onBlur(e){this.hasBrowserFocus=!1,this.isMouseBlurred=!1,this.dispatch("blur",0,e)}onFocus(e){this.hasBrowserFocus=!0,this.isClicking?this.isMouseBlurred=!0:(this.dispatch("browserfocus",1,e),this.dispatch("tab",0,e))}onKeyDown(e){if(this.hasBrowserFocus&&!this.isClicking)switch(this.isMouseBlurred=!1,e.sourceEvent.code){case"Tab":return e.sourceEvent.shiftKey?this.dispatch("tab",-1,e):this.dispatch("tab",1,e);case"ArrowDown":return this.dispatch("nav-vert",1,e);case"ArrowUp":return this.dispatch("nav-vert",-1,e);case"ArrowLeft":return this.dispatch("nav-hori",-1,e);case"ArrowRight":return this.dispatch("nav-hori",1,e);case"Space":case"Enter":return this.dispatch("submit",0,e)}}dispatch(e,t,i){const n=oc({type:e,delta:t,sourceEvent:i});ac(this.listeners,e,n)}},Tc={};v(Tc,{block:()=>Dc,css:()=>kc,elements:()=>Ic,modifiers:()=>Rc});var Dc="ag-charts-focus",Ic={wrapper:`${Dc}__wrapper`,indicator:`${Dc}__indicator`},Rc={hidden:`${Dc}--hidden`},kc=`\n.${Dc}.${Ic.wrapper} {\n    position: relative;\n    display: block;\n    pointer-events: none;\n    user-select: none;\n    overflow: hidden;\n    top: 0;\n    left: 0;\n}\n\n.${Dc}.${Ic.indicator} {\n    position: absolute;\n    display: block;\n    pointer-events: none;\n    user-select: none;\n    border: var(--ag-charts-focus-border);\n    box-shadow: var(--ag-charts-focus-border-shadow);\n}\n\n.${Rc.hidden} {\n    visibility: hidden;\n}\n`,Pc=["series","legend"],_c=class extends ic{},Lc=class{constructor(e,t,i,n){this.interactionManager=e,this.keyNavManager=t,this.canvasElement=i,this.currentTabIndex=0,this.isDragging=!1,this.leftCanvas=!1,this.regions=new Map,this.destroyFns=[],this.destroyFns.push(...lc.map(t=>e.addListener(t,this.processPointerEvent.bind(this),31)),this.keyNavManager.addListener("blur",this.onNav.bind(this)),this.keyNavManager.addListener("browserfocus",this.onFocus.bind(this)),this.keyNavManager.addListener("tab",this.onTab.bind(this)),this.keyNavManager.addListener("nav-vert",this.onNav.bind(this)),this.keyNavManager.addListener("nav-hori",this.onNav.bind(this)),this.keyNavManager.addListener("submit",this.onNav.bind(this))),An(kc,Dc),this.focusWrapper=wn().createElement("div"),this.focusIndicator=wn().createElement("div"),this.focusWrapper.appendChild(this.focusIndicator),n.appendChild(this.focusWrapper);const{block:s,elements:r,modifiers:o}=Tc;this.focusWrapper.classList.add(s,r.wrapper),this.focusIndicator.classList.add(s,r.indicator,o.hidden)}destroy(){this.destroyFns.forEach(e=>e()),this.currentRegion=void 0;for(const e of this.regions.values())e.listeners.destroy();this.focusWrapper.remove(),this.regions.clear()}addRegionFromProperties(e){const t={properties:e,listeners:new _c};return this.regions.set(e.name,t),this.makeObserver(t)}addRegion(e,t,...i){return this.addRegionFromProperties({name:e,bboxproviders:[t,...i],canInteraction:()=>!0})}getRegion(e){return this.makeObserver(this.regions.get(e))}find(e,t){const i=[];for(const[n,s]of this.regions.entries())for(const n of s.properties.bboxproviders){const r=n.getCachedBBox();r.containsPoint(e,t)&&i.push([s,r.width*r.height])}return i.sort((e,t)=>e[1]-t[1]).map(e=>e[0])}makeObserver(e){const{interactionManager:t}=this;return new class{addListener(i,n,s=16){var r;return null!=(r=null==e?void 0:e.listeners.addListener(i,e=>{e.consumed||t.getState()&s&&n(e)}))?r:()=>{}}}}checkPointerHistory(e,t){for(const i of t.pointerHistory){const t=this.pickRegion(i.offsetX,i.offsetY);if(e.properties.name!==(null==t?void 0:t.properties.name))return!1}return!0}dispatch(e,t){null==e||e.listeners.dispatch(t.type,t)}handleDragging(e){const{currentRegion:t}=this;switch(e.type){case"drag-start":this.isDragging=!0,this.leftCanvas=!1;break;case"leave":return this.leftCanvas=!0,this.isDragging;case"enter":return this.leftCanvas=!1,this.isDragging;case"drag":if(this.isDragging)return this.dispatch(t,e),!0;break;case"drag-end":if(this.isDragging)return this.isDragging=!1,this.dispatch(t,e),this.leftCanvas&&this.dispatch(t,m(f({},e),{type:"leave"})),!0}return!1}processPointerEvent(e){if(this.handleDragging(e))return;const{currentRegion:t}=this,i=this.pickRegion(e.offsetX,e.offsetY);void 0!==t&&(null==i?void 0:i.properties.name)!==t.properties.name&&this.dispatch(t,m(f({},e),{type:"leave"})),void 0!==i&&i.properties.name!==(null==t?void 0:t.properties.name)&&this.dispatch(i,m(f({},e),{type:"enter"})),void 0!==i&&this.checkPointerHistory(i,e)&&this.dispatch(i,e),this.currentRegion=i}pickRegion(e,t){const i=this.find(e,t);return i.length>0?i[0]:void 0}getTabRegion(e){if(void 0!==e&&e>=0&&e<Pc.length)return this.regions.get(Pc[e])}dispatchTabStart(e){const{delta:t,sourceEvent:i}=e,n=oc({type:"tab-start",delta:t,sourceEvent:i}),s=this.getTabRegion(this.currentTabIndex);return this.dispatch(s,n),!!n.consumed}getNextInteractableTabIndex(e,t){const i=t<0?-1:1;let n=e;for(;0!==t;){const e=this.getTabRegion(n+i);if(void 0===e)return;e.properties.canInteraction()&&(t-=i),n+=i}return n}validateCurrentTabIndex(){var e;const t=this.getTabRegion(this.currentTabIndex);void 0===t||t.properties.canInteraction()||(this.currentTabIndex=null!=(e=this.getNextInteractableTabIndex(-1,1))?e:0)}onFocus(e){const{delta:t,sourceEvent:i}=e,n=t>0?this.getNextInteractableTabIndex(-1,1):this.getNextInteractableTabIndex(Pc.length,-1);this.currentTabIndex=null!=n?n:0;const s=this.getTabRegion(this.currentTabIndex);s&&this.dispatch(s,oc({type:"tab",delta:t,sourceEvent:i}))}onTab(e){if(this.dispatchTabStart(e))return;this.validateCurrentTabIndex();const t=this.getNextInteractableTabIndex(this.currentTabIndex,e.delta),i=this.getTabRegion(t),n=this.getTabRegion(this.currentTabIndex);if(void 0!==t&&(this.currentTabIndex=t),void 0!==n&&(null==i?void 0:i.properties.name)!==n.properties.name){const{delta:t,sourceEvent:i}=e,s=oc({type:"blur",delta:t,sourceEvent:i});this.dispatch(n,s)}void 0!==i&&i.properties.canInteraction()?this.dispatch(i,e):this.updateFocusIndicatorRect(void 0)}onNav(e){const t=this.getTabRegion(this.currentTabIndex);this.dispatch(t,e)}updateFocusWrapperRect(){this.focusWrapper.style.width=this.canvasElement.style.width,this.focusWrapper.style.height=this.canvasElement.style.height}updateFocusIndicatorRect(e){null!=e?(this.updateFocusWrapperRect(),this.focusIndicator.classList.remove(Rc.hidden),this.focusIndicator.style.width=`${e.width}px`,this.focusIndicator.style.height=`${e.height}px`,this.focusIndicator.style.left=`${e.x}px`,this.focusIndicator.style.top=`${e.y}px`):this.focusIndicator.classList.add(Rc.hidden)}},Nc=class extends rc{constructor(e){super(),this.element=e}static isGroup(e,t){return t.group===e}pressButton(e,t){this.listeners.dispatch("button-pressed",{type:"button-pressed",group:e,value:t})}toggleGroup(e,t){this.listeners.dispatch("group-toggled",{type:"group-toggled",group:e,visible:t})}toggleButton(e,t,i){this.listeners.dispatch("button-toggled",{type:"button-toggled",group:e,value:t,enabled:i})}proxyGroupOptions(e,t){this.listeners.dispatch("proxy-group-options",{type:"proxy-group-options",group:e,options:t})}},Oc=`\n.${Ja} {\n    transition: transform 0.1s ease;\n    max-width: 100%;\n    position: fixed;\n    left: 0px;\n    top: 0px;\n    z-index: 99999;\n    font: 12px Verdana, sans-serif;\n    color: rgb(70, 70, 70);\n    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);\n}\n\n.${Ja}-wrap-always {\n    overflow-wrap: break-word;\n    word-break: break-word;\n    hyphens: none;\n}\n\n.${Ja}-wrap-hyphenate {\n    overflow-wrap: break-word;\n    word-break: break-word;\n    hyphens: auto;\n}\n\n.${Ja}-wrap-on-space {\n    overflow-wrap: normal;\n    word-break: normal;\n}\n\n.${Ja}-wrap-never {\n    white-space: pre;\n    text-overflow: ellipsis;\n}\n\n.${Ja}-no-interaction {\n    pointer-events: none;\n    user-select: none;\n}\n\n.${Ja}-no-animation {\n    transition: none !important;\n}\n\n.${Ja}-hidden {\n    visibility: hidden;\n}\n\n.${Ja}-title {\n    overflow: hidden;\n    position: relative;\n    padding: 8px 14px;\n    border-top-left-radius: 2px;\n    border-top-right-radius: 2px;\n    color: white;\n    background-color: #888888;\n    z-index: 1;\n    text-overflow: inherit;\n}\n\n.${Ja}-title:only-child {\n    border-bottom-left-radius: 2px;\n    border-bottom-right-radius: 2px;\n}\n\n.${Ja}-content {\n    overflow: hidden;\n    padding: 6px 14px;\n    line-height: 1.7em;\n    background: white;\n    border-bottom-left-radius: 2px;\n    border-bottom-right-radius: 2px;\n    border: 1px solid rgba(0, 0, 0, 0.15);\n    overflow: hidden;\n    text-overflow: inherit;\n}\n\n.${Ja}-arrow::before {\n    content: "";\n\n    position: absolute;\n    top: 100%;\n    left: 50%;\n    transform: translateX(-50%);\n\n    border: 5px solid #d9d9d9;\n\n    border-left-color: transparent;\n    border-right-color: transparent;\n    border-bottom-color: transparent;\n\n    width: 0;\n    height: 0;\n\n    margin: 0 auto;\n}\n\n.${Ja}-arrow::after {\n    content: "";\n\n    position: absolute;\n    top: calc(100% - 1px);\n    left: 50%;\n    transform: translateX(-50%);\n\n    border: 5px solid white;\n\n    border-left-color: transparent;\n    border-right-color: transparent;\n    border-bottom-color: transparent;\n\n    width: 0;\n    height: 0;\n\n    margin: 0 auto;\n}\n\n.ag-chart-wrapper {\n    box-sizing: border-box;\n    overflow: hidden;\n}\n`,Fc=class{constructor(e,t){if(this.canvasElement=e,this.tooltip=t,this.stateTracker=new wc,this.appliedState=null,"undefined"!=typeof IntersectionObserver){const e=new IntersectionObserver(e=>{for(const t of e)t.target===this.canvasElement&&0===t.intersectionRatio&&this.tooltip.toggle(!1)},{root:this.tooltip.root});e.observe(this.canvasElement),this.observer=e}An(Oc,"tooltip")}updateTooltip(e,t,i){var n;this.tooltip.enabled&&(null!=i||(i=null==(n=this.stateTracker.get(e))?void 0:n.content),this.stateTracker.set(e,{content:i,meta:t}),this.applyStates())}removeTooltip(e){this.tooltip.enabled&&(this.stateTracker.delete(e),this.applyStates())}getTooltipMeta(e){var t;return null==(t=this.stateTracker.get(e))?void 0:t.meta}destroy(){var e;null==(e=this.observer)||e.unobserve(this.canvasElement)}applyStates(){var e;const t=this.stateTracker.stateId(),i=t?this.stateTracker.get(t):null;if(null==(null==i?void 0:i.meta)||null==(null==i?void 0:i.content))return this.appliedState=null,void this.tooltip.toggle(!1);const n=this.canvasElement.getBoundingClientRect();if((null==(e=this.appliedState)?void 0:e.content)===(null==i?void 0:i.content)){const e=this.tooltip.isVisible();this.tooltip.show(n,null==i?void 0:i.meta,null,e)}else this.tooltip.show(n,null==i?void 0:i.meta,null==i?void 0:i.content);this.appliedState=i}static makeTooltipMeta(e,t){var i,n,s,r,o,a,l;const{offsetX:c,offsetY:h}=e,{tooltip:u}=t.series.properties,d={offsetX:c,offsetY:h,enableInteraction:null!=(n=null==(i=u.interaction)?void 0:i.enabled)&&n,lastPointerEvent:{type:e.type,offsetX:c,offsetY:h},showArrow:u.showArrow,position:{type:u.position.type,xOffset:u.position.xOffset,yOffset:u.position.yOffset}},p=null!=(l=null!=(r=null==(s=t.yBar)?void 0:s.upperPoint)?r:t.midPoint)?l:null==(a=(o=t.series).datumMidPoint)?void 0:a.call(o,t);if("node"===u.position.type&&p){const{x:e,y:i}=p,n=t.series.contentGroup.inverseTransformPoint(e,i);return m(f({},d),{offsetX:Math.round(n.x),offsetY:Math.round(n.y)})}return d}},Gc=class extends ic{constructor(){super(...arguments),this.layoutComplete="layout-complete"}addListener(e,t){if(this.isLayoutStage(e)||this.isLayoutComplete(e))return super.addListener(e,t);throw new Error(`AG Charts - unsupported listener type: ${e}`)}dispatchPerformLayout(e,t){return this.isLayoutStage(e)?this.getListenersByType(e).reduce((e,t)=>{try{return t.handler(e)}catch(t){return L.errorOnce(t),e}},t):t}dispatchLayoutComplete(e){this.dispatch(this.layoutComplete,e)}isLayoutStage(e){return e!==this.layoutComplete}isLayoutComplete(e){return e===this.layoutComplete}},Bc=class{constructor(){this.groups={}}registerSeries({id:e,seriesGrouping:t,visible:i,type:n}){var s;t&&(null!=(s=this.groups)[n]||(s[n]={}),this.groups[n][e]={grouping:t,visible:i})}deregisterSeries({id:e,type:t}){this.groups[t]&&delete this.groups[t][e],this.groups[t]&&0===Object.keys(this.groups[t]).length&&delete this.groups[t]}getVisiblePeerGroupIndex({type:e,seriesGrouping:t,visible:i}){var n;if(!t)return{visibleGroupCount:i?1:0,visibleSameStackCount:i?1:0,index:0};const s=new Set,r=new Set;for(const i of Object.values(null!=(n=this.groups[e])?n:{}))i.visible&&(s.add(i.grouping.groupIndex),i.grouping.groupIndex===t.groupIndex&&r.add(i.grouping.stackIndex));const o=Array.from(s);return o.sort((e,t)=>e-t),{visibleGroupCount:o.length,visibleSameStackCount:r.size,index:o.indexOf(t.groupIndex)}}},Vc=(e=>(e[e.FULL=0]="FULL",e[e.UPDATE_DATA=1]="UPDATE_DATA",e[e.PROCESS_DATA=2]="PROCESS_DATA",e[e.PERFORM_LAYOUT=3]="PERFORM_LAYOUT",e[e.SERIES_UPDATE=4]="SERIES_UPDATE",e[e.TOOLTIP_RECALCULATION=5]="TOOLTIP_RECALCULATION",e[e.SCENE_RENDER=6]="SCENE_RENDER",e[e.NONE=7]="NONE",e))(Vc||{}),Hc=class extends ic{constructor(e){super(),this.updateCallback=e}update(e=0,t){this.updateCallback(e,t)}dispatchUpdateComplete(e){this.dispatch("update-complete",{type:"update-complete",minRect:null==e?void 0:e.minRect,minVisibleRect:null==e?void 0:e.minVisibleRect})}},Uc=class{constructor(e,t){const{scene:i,syncManager:n,element:s,updateCallback:r,updateMutex:o}=t;this.chartService=e,this.scene=i,this.syncManager=n,this.zoomManager=e.zoomManager,this.annotationManager=new tc(e.annotationRoot),this.ariaAnnouncementService=new vc(i.canvas.element),this.chartEventManager=new bc,this.contextMenuRegistry=new Cc,this.cursorManager=new Sc(s),this.highlightManager=new Ac,this.interactionManager=new fc(e.keyboard,s),this.keyNavManager=new Mc(this.interactionManager),this.regionManager=new Lc(this.interactionManager,this.keyNavManager,this.scene.canvas.element,s),this.toolbarManager=new Nc(s),this.gestureDetector=new Ec(s),this.layoutService=new Gc,this.updateService=new Hc(r),this.seriesStateManager=new Bc,this.callbackCache=new ec,this.animationManager=new yc(this.interactionManager,o),this.animationManager.skip(),this.animationManager.play(),this.dataService=new nc(this.animationManager),this.tooltipManager=new Fc(this.scene.canvas.element,e.tooltip)}destroy(){this.tooltipManager.destroy(),this.regionManager.destroy(),this.keyNavManager.destroy(),this.interactionManager.destroy(),this.animationManager.stop(),this.animationManager.destroy(),this.ariaAnnouncementService.destroy(),this.chartEventManager.destroy(),this.highlightManager.destroy(),this.callbackCache.invalidateCache(),this.animationManager.reset(),this.syncManager.destroy()}},zc=class extends yt{constructor(){super(...arguments),this.range="tooltip"}};b([$s(Or(["tooltip","node"],"a range"))],zc.prototype,"range",2);var Wc=class e{constructor(){this.domain=new Set}static is(t){return t instanceof e}extend(e){this.domain.add(e)}getDomain(){return Array.from(this.domain)}},jc=class e{constructor(){this.domain=[1/0,-1/0]}static is(t){return t instanceof e}static extendDomain(e,t=[1/0,-1/0]){for(const i of e)"number"==typeof i&&(t[0]>i&&(t[0]=i),t[1]<i&&(t[1]=i));return t}extend(e){this.domain[0]>e&&(this.domain[0]=e),this.domain[1]<e&&(this.domain[1]=e)}getDomain(){return[...this.domain]}};function $c(e){return e.map(e=>Ge(e)?JSON.stringify(e):e).join("-")}function Kc(e){const t=1e4;return Number.isInteger(e)?e:Math.abs(e)>t?Math.trunc(e):Math.round(e*t)/t}function Yc(e,t){var i;const n=function(e){if(null==e)return[];let[t,i]=e.map(Number);return 0===t&&0===i?[0,1]:t===1/0&&i===-1/0?[]:(t===1/0?t=0:i===-1/0&&(i=0),ze(t)&&ze(i)?[t,i]:[])}(e);if(0===n.length)return n;let[s,r]=n;if(s===r){const[e,n]=null!=(i=null==t?void 0:t.calculatePadding(s,r))?i:[1,1];s-=e,r+=n}return[s,r]}function qc(e,t){var i;return null!=(i=null==t?void 0:t.get(e.id))?i:0}var Xc=Symbol("invalid"),Zc=class{constructor(e,t="standalone"){this.opts=e,this.mode=t,this.debug=In.create(!0,"data-model"),this.scopeCache=new Map,this.keys=[],this.values=[],this.aggregates=[],this.groupProcessors=[],this.propertyProcessors=[],this.reducers=[],this.processors=[];let i=!0;for(const t of e.props){if("key"===t.type&&!i)throw new Error("AG Charts - internal config error: keys must come before values.");"value"===t.type&&i&&(i=!1)}const n=({matchGroupIds:e=[]})=>{for(const t of e)if(this.values.every(e=>e.groupId!==t))throw new Error(`AG Charts - internal config error: matchGroupIds properties must match defined groups (${t}).`)};for(const t of e.props)switch(t.type){case"key":this.keys.push(m(f({},t),{index:this.keys.length,missing:new Map}));break;case"value":if(null==t.property)throw new Error(`AG Charts - internal config error: no properties specified for value definitions: ${JSON.stringify(t)}`);this.values.push(m(f({},t),{index:this.values.length,missing:new Map}));break;case"aggregate":n(t),this.aggregates.push(m(f({},t),{index:this.aggregates.length}));break;case"group-value-processor":n(t),this.groupProcessors.push(m(f({},t),{index:this.groupProcessors.length}));break;case"property-value-processor":this.propertyProcessors.push(m(f({},t),{index:this.propertyProcessors.length}));break;case"reducer":this.reducers.push(m(f({},t),{index:this.reducers.length}));break;case"processor":this.processors.push(m(f({},t),{index:this.processors.length}))}}resolveProcessedDataDefById(e,t){var i;const n=null==(i=this.scopeCache.get(e.id))?void 0:i.get(t);if(!n)throw new Error(`AG Charts - didn't find property definition for [${t}, ${e.id}]`);return{index:n.index,def:n}}resolveProcessedDataIndexById(e,t){return this.resolveProcessedDataDefById(e,t).index}resolveProcessedDataDefsByIds(e,t){return t.map(t=>[t,this.resolveProcessedDataDefById(e,t)])}resolveProcessedDataDefsValues(e,{keys:t,values:i}){const n={};for(const[s,{index:r,def:o}]of e){const e="key"===o.type?t:i;n[s]=e[r]}return n}getDomain(e,t,i="value",n){var s;const r=this.getDomainsByType(i,n);return null!=(s=null==r?void 0:r[this.resolveProcessedDataIndexById(e,t)])?s:[]}getDomainsByType(e,t){switch(e){case"key":return t.domain.keys;case"value":return t.domain.values;case"aggregate":return t.domain.aggValues;case"group-value-processor":return t.domain.groups;default:return null}}processData(e,t){var i;const{opts:{groupByKeys:n,groupByFn:s},aggregates:r,groupProcessors:o,reducers:a,processors:l,propertyProcessors:c}=this,h=performance.now();if(n&&0===this.keys.length)return;let u=this.extractData(e,t);if(n?u=this.groupData(u):s&&(u=this.groupData(u,s(u))),o.length>0&&this.postProcessGroups(u),r.length>0&&this.aggregateData(u),c.length>0&&this.postProcessProperties(u),a.length>0&&this.reduceData(u),l.length>0&&this.postProcessData(u),e.length>0)for(const t of P(this.keys,this.values))for(const[i,n]of t.missing)if(n>=e.length){const e=null==i?"":` for ${i}`;L.warnOnce(`the key '${t.property}' was not found in any data element${e}.`)}const d=performance.now();u.time=d-h,this.debug.check()&&function(e){var t,i;const n=(e,t)=>{t.length>0&&(L.log(`DataModel.processData() - ${e}`),L.table(t))};L.log("DataModel.processData() - processedData",e),n("Key Domains",e.domain.keys),n("Group Domains",null!=(t=e.domain.groups)?t:[]),n("Value Domains",e.domain.values),n("Aggregate Domains",null!=(i=e.domain.aggValues)?i:[]),"grouped"===e.type?n("Values",e.data.reduce((e,t)=>{var i,n;const s=null!=(i=t.keys)?i:[],r=null!=(n=t.aggValues)?n:[],o=t.keys.map(()=>{}),a=null==r?void 0:r.map(()=>{});return e.push(...t.values.map((e,t)=>[...0===t?s:o,...null!=e?e:[],...0==t?r:a])),e},[])):n("Values",e.data.reduce((e,t)=>{var i;const n=null!=(i=t.aggValues)?i:[];return e.push([...t.keys,...t.values,...n]),e},[]))}(u),this.scopeCache.clear();for(const e of P(this.keys,this.values,this.aggregates))if(e.idsMap)for(const[t,n]of e.idsMap)for(const s of n)if(this.scopeCache.has(t)){if(null==(i=this.scopeCache.get(t))?void 0:i.has(s))throw new Error("duplicate definition ids on the same scope are not allowed.");this.scopeCache.get(t).set(s,e)}else this.scopeCache.set(t,new Map([[s,e]]));return u}valueGroupIdxLookup({matchGroupIds:e}){const t=[];for(const[i,n]of this.values.entries())(!e||n.groupId&&e.includes(n.groupId))&&t.push(i);return t}valueIdxLookup(e,t){const i=null==e||0===e.length,n="string"==typeof t?t:t.id,s=this.values.findIndex(t=>(null==t.scopes||i&&!t.scopes.length||t.scopes.some(t=>null==e?void 0:e.includes(t)))&&(t.property===n||t.id===n||(t=>{if(t.idsMap)for(const[i,s]of t.idsMap)if((null==e?void 0:e.includes(i))&&s.has(n))return!0;return!1})(t)));if(-1===s)throw new Error(`AG Charts - configuration error, unknown property ${JSON.stringify(t)} in scope(s) ${JSON.stringify(e)}`);return s}extractData(e,t){var i,n,s;const{dataDomain:r,processValue:o,scopes:a,allScopesHaveSameDefs:l}=this.initDataDomainProcessor(),c=new Map(null==t?void 0:t.map(e=>[e.id,e])),{keys:h,values:u}=this,d=new Array(e.length);let p=0,g=0;for(const[t,r]of e.entries()){const e={},m=a.size>0?new Set(a):void 0,y=new Array(h.length);let v,b=0;for(const e of h){if(v=o(e,r,v),v===Xc)break;y&&(y[b++]=v)}if(v===Xc)continue;const C=u.length>0?new Array(u.length):void 0;let w;for(const[h,d]of u.entries()){for(const s of null!=(i=d.scopes)?i:a){const i=c.get(s);if(w=o(d,null!=(n=null==i?void 0:i.data[t])?n:r,w,s),w!==Xc&&C){if(null!=i&&!1!==d.includeProperty){const t=d.includeProperty&&null!=d.id?d.id:d.property;null!=e[s]||(e[s]={}),e[s][t]=w}C[h]=w}}if(w===Xc){if(l)break;for(const e of null!=(s=d.scopes)?s:a)null==m||m.delete(e);if(0===(null==m?void 0:m.size))break}}if(w===Xc&&l)continue;if(0===(null==m?void 0:m.size))continue;const S={datum:f(f({},r),e),keys:y,values:C};!l&&m&&m.size<a.size&&(g++,S.validScopes=new Set(m)),d[p++]=S}d.length=p;const m=e=>{const t=r.get(e),i=t.getDomain();return jc.is(t)&&i[0]>i[1]?[]:i};return{type:"ungrouped",input:{count:e.length},data:d,domain:{keys:h.map(m),values:u.map(m)},defs:{allScopesHaveSameDefs:l,keys:h,values:u},partialValidDataCount:g,time:0}}groupData(e,t){var i;const n=new Map;for(const s of e.data){const{keys:e,values:r,datum:o,validScopes:a}=s,l=null!=(i=null==t?void 0:t(s))?i:e,c=$c(l);if(n.has(c)){const e=n.get(c);if(e.values.push(r),e.datum.push(o),null!=a&&null!=e.validScopes)for(const t of e.validScopes)a.has(t)||e.validScopes.delete(t)}else n.set(c,{keys:l,values:[r],datum:[o],validScopes:a})}const s=new Array(n.size),r=new Array(n.size);let o=0;for(const{keys:e,values:t,datum:i,validScopes:a}of n.values())0!==(null==a?void 0:a.size)&&(r[o]=e,s[o++]={keys:e,values:t,datum:i,validScopes:a});return m(f({},e),{type:"grouped",data:s,domain:m(f({},e.domain),{groups:r})})}aggregateData(e){var t,i,n,s,r,o;const a="ungrouped"===e.type;e.domain.aggValues=[];for(const[l,c]of this.aggregates.entries()){const h=this.valueGroupIdxLookup(c),u=[1/0,-1/0];for(const d of e.data){if(null!=d.aggValues||(d.aggValues=new Array(this.aggregates.length)),d.validScopes)continue;const e=a?[d.values]:d.values;let p=null!=(i=null==(t=c.groupAggregateFunction)?void 0:t.call(c))?i:[1/0,-1/0];for(const t of e){const e=h.map(e=>t[e]),i=c.aggregateFunction(e,d.keys);i&&(p=null!=(s=null==(n=c.groupAggregateFunction)?void 0:n.call(c,i,p))?s:jc.extendDomain(i,p))}const g=(null!=(o=null==(r=c.finalFunction)?void 0:r.call(c,p))?o:p).map(e=>Kc(e));d.aggValues[l]=g,jc.extendDomain(g,u)}e.domain.aggValues.push(u)}}postProcessGroups(e){var t,i;const{groupProcessors:n}=this,s=new Set,r=new Map,o=new Map,a=new Map;for(const e of n){const t=this.valueGroupIdxLookup(e);o.set(e,t),a.set(e,e.adjust());for(const e of t){const t="category"===this.values[e].valueType;s.add(e),r.set(e,t?new Wc:new jc)}}const l=e=>{var t;for(const i of s)null==(t=r.get(i))||t.extend(e[i])};for(const s of e.data){for(const r of n){if(s.validScopes)continue;const n=null!=(t=o.get(r))?t:[],l=null==(i=a.get(r))?void 0:i();if(l)if("grouped"===e.type)for(const e of s.values)e&&l(e,n);else s.values&&l(s.values,n)}if("grouped"===e.type)for(const e of s.values)l(e);else l(s.values)}for(const[t,i]of r)e.domain.values[t]=i.getDomain()}postProcessProperties(e){for(const{adjust:t,property:i,scopes:n}of this.propertyProcessors)t()(e,this.valueIdxLookup(n,i))}reduceData(e){var t;null!=e.reduced||(e.reduced={});for(const i of this.reducers){const n=i.reducer();let s=i.initialValue;for(const r of e.data)r.validScopes&&!(null==(t=i.scopes)?void 0:t.some(e=>{var t;return null==(t=r.validScopes)?void 0:t.has(e)}))||(s=n(s,r));e.reduced[i.property]=s}}postProcessData(e){null!=e.reduced||(e.reduced={});for(const t of this.processors)e.reduced[t.property]=t.calculate(e)}initDataDomainProcessor(){const{keys:e,values:t}=this,i=new Set;for(const e of t)if(e.scopes)for(const t of e.scopes)i.add(t);const n=new Map,s=new Map;let r=!0;const o=()=>{var s;for(const o of P(e,t))"category"===o.valueType?n.set(o,new Wc):(n.set(o,new jc),r&&(r=(null!=(s=o.scopes)?s:[]).length===i.size))};o();const a=this.buildAccessors(P(e,t));return{dataDomain:n,processValue:(e,t,i,r)=>{var l,c,h,u,d;let p,g;if(a.has(e.property)){try{g=a.get(e.property)(t)}catch(e){}p=null!=g}else p=e.property in t,g=p?t[e.property]:e.missingValue;if(null!=e.forceValue&&(g=p&&$n(g)?-1*e.forceValue:e.forceValue,p=!0),!p&&!("missingValue"in e)){const t=null!=(l=e.missing.get(r))?l:0;e.missing.set(r,t+1)}if(n.has(e)||o(),p&&null!=(h=null==(c=e.validation)?void 0:c.call(e,g,t))&&!h){if(!("invalidValue"in e))return"integrated"!==this.mode&&L.warnOnce(`invalid value of type [${typeof g}] ignored:`,`[${g}]`),Xc;g=e.invalidValue}return e.processor&&(s.has(e)||s.set(e,e.processor()),g=null==(u=s.get(e))?void 0:u(g,i===Xc?void 0:i)),null==(d=n.get(e))||d.extend(g),g},initDataDomain:o,scopes:i,allScopesHaveSameDefs:r}}buildAccessors(e){const t=new Map;if("integrated"===this.mode)return t;for(const i of e){if(!i.property.includes(".")&&!i.property.includes("["))continue;let e;e=i.property.startsWith("[")?`return datum${i.property};`:`return datum.${i.property};`,t.set(i.property,new Function("datum",e))}return t}},Qc=class e{constructor(e){this.mode=e,this.debug=In.create(!0,"data-model"),this.requested=[],this.status="setup"}request(e,t,i){return w(this,null,function*(){if("setup"!==this.status)throw new Error("AG Charts - data request after data setup phase.");return new Promise((n,s)=>{this.requested.push({id:e,opts:i,data:t,resolve:n,reject:s})})})}execute(){if("setup"!==this.status)throw new Error("AG Charts - data request after data setup phase.");this.status="executed",this.debug("DataController.execute() - requested",this.requested);const e=this.validateRequests(this.requested);this.debug("DataController.execute() - validated",e);const t=this.mergeRequested(e);this.debug("DataController.execute() - merged",t),this.debug.check()&&(Sn().processedData=[]);const i=this.requested.map(({id:e})=>e),n=this.hasMultipleDataSources(e);for(const{opts:s,data:r,resolves:o,rejects:a,ids:l}of t)try{const t=new Zc(s,this.mode),c=t.processData(r,e);this.debug.check()&&Sn("processedData").push(c),0===(null==c?void 0:c.partialValidDataCount)?o.forEach((e,s)=>e({dataModel:t,processedData:this.processScopedData(l[s],c,i,n)})):c?this.splitResult(t,c,l,o):a.forEach(e=>e(new Error("AG Charts - no processed data generated")))}catch(e){a.forEach(t=>t(e))}}hasMultipleDataSources(e){if(e.length){const[{data:t},...i]=e;return i.some(e=>t!==e.data)}return!1}processScopedData(e,t,i,n){const s=t=>{if(Array.isArray(t))return t.map(s);const r=n?f(f({},t),t[e]):t;for(const e of i)delete r[e];return r},r=t=>{var i;return Array.isArray(t)?t.map(r):null!=(i=null==t?void 0:t[e])?i:t};return m(f({},t),{data:t.data.map(e=>{var t;return m(f({},e),{datum:s(e.datum),values:n?null==(t=e.values)?void 0:t.map(r):e.values})})})}validateRequests(e){const t=[];for(const[i,n]of e.entries())i>0&&n.data.length!==e[0].data.length&&!1===n.opts.groupByData?n.reject(new Error("all series[].data arrays must be of the same length and have matching keys.")):t.push(n);return t}mergeRequested(t){const i=[];for(const n of t){const t=i.find(e.groupMatch(n));t?t.push(n):i.push([n])}return i.map(e.mergeRequests)}splitResult(e,t,i,n){for(let s=0;s<i.length;s++){const r=i[s];(0,n[s])({dataModel:e,processedData:m(f({},t),{data:t.data.filter(({validScopes:e})=>{var t;return null==(t=null==e?void 0:e.has(r))||t})})})}}static groupMatch({data:e,opts:t}){function i(e){return e.filter(e=>"key"===e.type).map(e=>e.property).join(";")}return([n])=>(!1===t.groupByData||n.data===e)&&n.opts.groupByKeys===t.groupByKeys&&n.opts.groupByFn===t.groupByFn&&i(n.opts.props)===i(t.props)}static mergeRequests(t){return t.reduce((t,i)=>{var n,s,{id:r,data:o,resolve:a,reject:l,opts:c}=i,h=c,{props:u}=h,d=y(h,["props"]);t.ids.push(r),t.rejects.push(l),t.resolves.push(a),null!=t.data||(t.data=o),null!=t.opts||(t.opts=m(f({},d),{props:[]}));for(const i of u){const o=m(f({},i),{scopes:[r]});e.createIdsMap(r,o);const a=t.opts.props.find(t=>t.type===o.type&&e.deepEqual(t,o));a?(null!=a.scopes||(a.scopes=[]),a.scopes.push(...null!=(n=o.scopes)?n:[]),"key"!==a.type&&"value"!==a.type||!(null==(s=o.idsMap)?void 0:s.size)||e.mergeIdsMap(o.idsMap,a.idsMap)):t.opts.props.push(o)}return t},{ids:[],rejects:[],resolves:[],data:null,opts:null})}static mergeIdsMap(e,t){for(const[i,n]of e)if(t.has(i))for(const e of n)t.get(i).add(e);else t.set(i,new Set(n))}static createIdsMap(e,t){null!=t.id&&(null!=t.idsMap||(t.idsMap=new Map),t.idsMap.has(e)?t.idsMap.get(e).add(t.id):t.idsMap.set(e,new Set([t.id])))}static deepEqual(t,i){if(t===i)return!0;if(t&&i&&"object"==typeof t&&"object"==typeof i){if(t.constructor!==i.constructor)return!1;let n,s;if(Array.isArray(t)){if(s=t.length,s!==i.length)return!1;for(n=s-1;n>=0;n--)if(!e.deepEqual(t[n],i[n]))return!1;return!0}const r=Object.keys(t);if(s=r.length,s!==Object.keys(i).length)return!1;for(n=s-1;n>=0;n--){const s=r[n];if(!(e.skipKeys.has(s)||Object.hasOwn(i,s)&&e.deepEqual(t[s],i[s])))return!1}return!0}return!1}};Qc.skipKeys=new Set(["id","idsMap","type","scopes"]);var Jc=Qc,eh=class e extends rc{constructor(e){super(),this.chart=e}subscribe(t=e.DEFAULT_GROUP){let i=this.get(t);return i||(i=new Set,e.chartsGroups.set(t,i)),i.add(this.chart),this}unsubscribe(t=e.DEFAULT_GROUP){var i;return null==(i=this.get(t))||i.delete(this.chart),this}getChart(){return this.chart}getGroup(t=e.DEFAULT_GROUP){const i=this.get(t);return i?Array.from(i):[]}getGroupSiblings(t=e.DEFAULT_GROUP){return this.getGroup(t).filter(e=>e!==this.chart)}get(t){return e.chartsGroups.get(t)}};eh.chartsGroups=new Map,eh.DEFAULT_GROUP=Symbol("sync-group-default");var th=eh,ih=class extends rc{constructor(){super(...arguments),this.axisZoomManagers=new Map,this.state=new wc(void 0,"initial"),this.rejectCallbacks=new Map}updateAxes(e){var t;const i=new Map(e.map(e=>[e.id,this.axisZoomManagers.get(e.id)]));this.axisZoomManagers.clear();for(const n of e)this.axisZoomManagers.set(n.id,null!=(t=i.get(n.id))?t:new nh(n));this.state.size>0&&e.length>0&&this.updateZoom(this.state.stateId(),this.state.stateValue())}updateZoom(e,t,i=!0,n){var s;if(n&&this.rejectCallbacks.set(e,n),0===this.axisZoomManagers.size){const r=this.state.stateId();return void("initial"===r||r===e||i?(this.state.set(e,t),r!==e&&(null==(s=this.rejectCallbacks.get(r))||s(e))):null==n||n(r))}this.state.set(e,t),this.axisZoomManagers.forEach(i=>{i.updateZoom(e,null==t?void 0:t[i.getDirection()])}),this.applyChanges(e)}updateAxisZoom(e,t,i){var n;null==(n=this.axisZoomManagers.get(t))||n.updateZoom(e,i),this.applyChanges(e)}fireZoomPanStartEvent(e){this.listeners.dispatch("zoom-pan-start",{type:"zoom-pan-start",callerId:e})}getZoom(){let e,t;if(this.axisZoomManagers.forEach(i=>{"x"===i.getDirection()?null!=e||(e=i.getZoom()):"y"===i.getDirection()&&(null!=t||(t=i.getZoom()))}),e||t)return{x:e,y:t}}getAxisZoom(e){var t,i;return null!=(i=null==(t=this.axisZoomManagers.get(e))?void 0:t.getZoom())?i:{min:0,max:1}}getAxisZooms(){const e={};for(const[t,i]of this.axisZoomManagers.entries())e[t]={direction:i.getDirection(),zoom:i.getZoom()};return e}applyChanges(e){if(!Array.from(this.axisZoomManagers.values(),e=>e.applyChanges()).some(Boolean))return;const t={};for(const[e,i]of this.axisZoomManagers.entries())t[e]=i.getZoom();this.listeners.dispatch("zoom-change",m(f({type:"zoom-change"},this.getZoom()),{axes:t,callerId:e}))}},nh=class{constructor(e){this.axis=e;const[t=0,i=1]=e.visibleRange;this.state=new wc({min:t,max:i}),this.currentZoom=this.state.stateValue()}getDirection(){return this.axis.direction}updateZoom(e,t){this.state.set(e,t)}getZoom(){return St(this.state.stateValue())}applyChanges(){const e=this.currentZoom;return this.currentZoom=this.state.stateValue(),e.min!==this.currentZoom.min||e.max!==this.currentZoom.max}},sh=class extends yt{constructor(){super(...arguments),this.enabled=!1}};function rh(e,t){const{bbox:i,showFocusBox:n}=t;if(n&&e.updateFocusIndicatorRect(t.bbox),void 0!==i){const{x:e,y:t}=i.computeCenter();return{type:"keyboard",offsetX:e,offsetY:t}}}b([$s(Qs)],sh.prototype,"enabled",2),b([$s(tr)],sh.prototype,"tabIndex",2);var oh=["top","right","bottom","left"],ah=["category","grouped-category","ordinal-time","number","log","time"],lh=class{constructor(){this.result=[],this.valid=[],this.invalid=[]}push(e,t){const{result:i,valid:n,invalid:s}=this;var r;(function(e){return ah.includes(e.type)})(t)&&("string"==typeof(r=t.position)&&oh.includes(r)?n.push(e):s.push(e)),i.push(e)}guessInvalidPositions(){const e=this.valid.filter(e=>ah.includes(e.type)).map(e=>e.position).filter(e=>void 0!==e),t=["top","right","bottom","left"];for(const i of this.invalid){let n=t.pop();for(;e.includes(n)&&void 0!==n;)n=t.pop();if(void 0===n)break;i.position=n}return this.result}},ch=["direction","xKey","yKey","sizeKey","angleKey","radiusKey","normalizedTo","stacked","grouped","stackGroup"],hh=class extends pa{applyOptions(e){for(const t of this.moduleMap.values())t.module.optionsKey in e&&bt(t.moduleInstance)&&t.moduleInstance.set(e[t.module.optionsKey])}*legends(){for(const{module:e,moduleInstance:t}of this.moduleMap.values())"legend"===e.type&&(yield{legendType:e.identifier,legend:t})}},uh="ag-chart-overlay",dh="ag-chart-dark-overlay",ph=class extends yt{constructor(e,t){super(),this.className=e,this.defaultText=t,this.darkTheme=!1}getText(){var e;return null!=(e=this.text)?e:this.defaultText}getElement(e,t){null!=this.element||(this.element=xn("div",uh,{position:"absolute"})),this.element.classList.toggle(dh,this.darkTheme),this.focusBox=t;const i=this.element;if(i.style.left=`${t.x}px`,i.style.top=`${t.y}px`,i.style.width=`${t.width}px`,i.style.height=`${t.height}px`,this.renderer){const e=this.renderer();e instanceof HTMLElement?i.replaceChildren(e):i.innerHTML=e}else{const t=xn("div",{display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",height:"100%",margin:"8px",font:"12px Verdana, sans-serif"});t.innerText=this.getText(),i.replaceChildren(t),null==e||e.animate({from:0,to:1,id:"overlay",phase:"add",groupId:"opacity",onUpdate(e){i.style.opacity=String(e)},onStop(){i.style.opacity="1"}})}return this.element}removeElement(e){if(this.element){if(e){const{element:t}=this;e.animate({from:1,to:0,phase:"remove",id:"overlay",groupId:"opacity",onUpdate(e){t.style.opacity=String(e)},onStop(){t.remove()}})}else this.element.remove();this.element=void 0,this.focusBox=void 0}}};b([$s(er,{optional:!0})],ph.prototype,"text",2),b([$s(Js,{optional:!0})],ph.prototype,"renderer",2),b([$s(Qs)],ph.prototype,"darkTheme",2);var gh=class extends yt{constructor(){super(...arguments),this.loading=new ph("ag-chart-loading-overlay","Loading data..."),this.noData=new ph("ag-chart-no-data-overlay","No data to display"),this.noVisibleSeries=new ph("ag-chart-no-visible-series","No visible series")}getFocusInfo(){for(const e of[this.loading,this.noData,this.noVisibleSeries])if(void 0!==e.focusBox)return{text:e.getText(),rect:e.focusBox}}destroy(){this.loading.removeElement(),this.noData.removeElement(),this.noVisibleSeries.removeElement()}};b([$s(Xs)],gh.prototype,"loading",2),b([$s(Xs)],gh.prototype,"noData",2),b([$s(Xs)],gh.prototype,"noVisibleSeries",2);var fh=`\n.${uh} {\n    color: #181d1f;\n}\n\n.${uh}.${dh} {\n    color: #ffffff;\n}\n\n.${uh}--loading {\n    color: rgb(140, 140, 140); /* DEFAULT_MUTED_LABEL_COLOUR */\n}\n\n.${uh}__loading-background {\n    background: white; /* DEFAULT_BACKGROUND_FILL */\n}\n\n.${uh}.${dh} .${uh}__loading-background {\n    background: #192232; /* DEFAULT_DARK_BACKGROUND_FILL */\n}\n`;function mh(e,t=[0,0]){for(const i of e)"number"==typeof i&&(i<0&&(t[0]+=i),i>0&&(t[1]+=i));return t}function yh(e,t){return{id:e,matchGroupIds:[t],type:"aggregate",aggregateFunction:e=>mh(e)}}function vh(e,t){return{id:e,type:"aggregate",matchGroupIds:t?[t]:void 0,aggregateFunction:e=>mh(e),groupAggregateFunction:(e,t=[0,0])=>{var i,n;return t[0]+=null!=(i=null==e?void 0:e[0])?i:0,t[1]+=null!=(n=null==e?void 0:e[1])?n:0,t}}}function bh(e,t){return{id:e,matchGroupIds:[t],type:"aggregate",aggregateFunction:e=>jc.extendDomain(e)}}function Ch(e){return{id:e,type:"aggregate",aggregateFunction:()=>[0,1],groupAggregateFunction:(e,t=[0,0])=>{var i,n;return t[0]+=null!=(i=null==e?void 0:e[0])?i:0,t[1]+=null!=(n=null==e?void 0:e[1])?n:0,t}}}function wh(e,t){return{id:e,matchGroupIds:t?[t]:void 0,type:"aggregate",aggregateFunction:e=>mh(e),groupAggregateFunction:(e,t=[0,0,-1])=>{var i,n;return t[0]+=null!=(i=null==e?void 0:e[0])?i:0,t[1]+=null!=(n=null==e?void 0:e[1])?n:0,t[2]++,t},finalFunction:(e=[0,0,0])=>{const t=e[0]+e[1];return t>=0?[0,t/e[2]]:[t/e[2],0]}}}function Sh(e,t,i){const n={id:e,matchGroupIds:i?[i]:void 0,type:"aggregate",aggregateFunction:(e,i=[])=>{const n=i[1]-i[0];return t.aggregateFunction(e).map(e=>e/n)}};return t.groupAggregateFunction&&(n.groupAggregateFunction=t.groupAggregateFunction),n}function xh(e){return()=>{let t=0;return i=>ze(i)?(t+=e?Math.max(0,i):i,t):i}}function Eh(){return()=>{let e=0;return t=>{if(!ze(t))return t;const i=e;return e+=t,i}}}var Ah={type:"reducer",property:"smallestKeyInterval",initialValue:1/0,reducer:()=>{let e=NaN;return(t=1/0,i)=>{const n=i.keys[0],s=Math.abs(n-e);return e=n,!isNaN(s)&&s>0&&s<t?s:t}}},Mh={type:"processor",property:"sortedGroupDomain",calculate:({domain:{groups:e}})=>null==e?void 0:e.slice().sort((e,t)=>{for(let i=0;i<e.length;i++){const n=e[i]-t[i];if(0!==n)return n}return 0})};function Th({normaliseTo:e,mode:t}){const i=(t,i)=>{const n=t*e/i;return n>=0?Math.min(e,n):Math.max(-e,n)};return()=>()=>(e,n)=>{const s=[0,0];for(const i of n){const n=e[i],r=n<0?0:1;"sum"===t?s[r]+=n:s[r]=0===r?Math.min(s[r],n):Math.max(s[r],n)}const r=Math.max(Math.abs(s[0]),s[1]);for(const t of n)e[t]=i(e[t],r)}}function Dh(e,t,i="sum"){return{type:"group-value-processor",matchGroupIds:e,adjust:Po({normaliseTo:t,mode:i},Th)}}function Ih({normaliseTo:e,zeroDomain:t,rangeMin:i,rangeMax:n}){const s=e[1]-e[0],r=(i,n,r)=>{const o=e[0]+(i-n)/r*s;return 0===r?t:o>=e[1]?e[1]:o<e[0]?e[0]:o};return()=>(t,s)=>{let[o,a]=t.domain.values[s];null!=i&&(o=i),null!=n&&(a=n);const l=a-o;t.domain.values[s]=[e[0],e[1]];for(const e of t.data){let i=e.values;"ungrouped"===t.type&&(i=[i]);for(const e of i)e[s]=r(e[s],o,l)}}}function Rh(e,t,i,n,s){return{type:"property-value-processor",property:e,adjust:Po({normaliseTo:t,rangeMin:n,rangeMax:s,zeroDomain:i},Ih)}}function kh(e){return{type:"processor",property:"animationValidation",calculate(t){const{keys:i,values:n}=t.defs,{input:s,data:r}=t;let o=!0,a=!0;const l=[];for(let t=0;t<n.length;t++)(null==e?void 0:e.includes(n[t].id))&&l.push([t,n[t]]);const c=(e,i,n)=>{var l;if("category"===i.valueType){const i=t.domain[n][e];return void(o&&(o=i.length===s.count))}let c=null==(l=r[0])?void 0:l[n][e];for(let t=1;(o||a)&&t<r.length;t++){const i=r[t][n][e];a&&(a=c<=i),o&&(o=c!==i),c=i}};for(let e=0;(o||a)&&e<i.length;e++)c(e,i[e],"keys");for(let e=0;(o||a)&&e<l.length;e++){const[t,i]=l[e];c(t,i,"values")}return{uniqueKeys:o,orderedKeys:a}}}}function Ph({mode:e,separateNegative:t}){return()=>()=>(i,n)=>{const s=[0,0];for(const r of n){const n=i[r],o=$n(n)&&t?0:1;ze(n)&&("normal"===e&&(s[o]+=n),i[r]=s[o],"trailing"===e&&(s[o]+=n))}}}function _h({mode:e,sum:t}){return()=>{const i=[];let n=!0;return()=>(s,r)=>{let o=0;for(const a of r){const r=s[a],l=n&&"current"===t?0:i[a];i[a]=r;const c="current"===t?r:l;ze(r)&&ze(l)?("normal"===e&&(o+=c),s[a]=o,"trailing"===e&&(o+=c)):s[a]=o}n=!1}}}function Lh(e,t,i,n=!1){let s;return s=t.startsWith("window")?Po({mode:t.endsWith("-trailing")?"trailing":"normal",sum:i},_h):Po({mode:t,separateNegative:n},Ph),{type:"group-value-processor",matchGroupIds:[e],adjust:s}}function Nh(e,t=!0){return{type:"processor",property:"diff",calculate:i=>{const n=new Map,s=new Map,r=new Map,o=new Map,a=Math.max(e.data.length,i.data.length);for(let l=0;l<a;l++){const a=e.data[l],c=i.data[l],h=a?Oh(a.keys):"",u=c?Oh(c.keys):"";c&&a&&h===u?un(a.values,c.values)||r.set(u,c):(o.has(u)?(!t&&un(o.get(u).values,c.values)||(r.set(u,c),n.set(u,c)),o.delete(u)):c&&s.set(u,c),s.has(h)?(!t&&un(s.get(h).values,a.values)||(r.set(h,a),n.set(h,a)),s.delete(h)):a&&(r.delete(h),o.set(h,a)))}return{changed:s.size>0||r.size>0||o.size>0,added:s,updated:r,removed:o,moved:n}}}}function Oh(e,...t){let i;return i=Pe(e)?e.map(e=>Yo(e)).join("___"):Yo(e),("string"==typeof i||"number"==typeof i||i instanceof Date)&&t.length>0&&(i+=`___${t.join("___")}`),i}var Fh=(e=>(e[e.EXACT_SHAPE_MATCH=0]="EXACT_SHAPE_MATCH",e[e.NEAREST_BY_MAIN_AXIS_FIRST=1]="NEAREST_BY_MAIN_AXIS_FIRST",e[e.NEAREST_BY_MAIN_CATEGORY_AXIS_FIRST=2]="NEAREST_BY_MAIN_CATEGORY_AXIS_FIRST",e[e.NEAREST_NODE=3]="NEAREST_NODE",e))(Fh||{});function Gh(e){return null!=e&&$o(e)}function Bh(e){return null!=e}function Vh(e){switch(e){case"number":case"log":case"ordinal-time":case"time":case"color":return Gh;default:return Bh}}function Hh(e){switch(e){case"number":case"log":case"time":case"color":return"range";default:return"category"}}function Uh(e,t,i={}){return f({property:e,type:"key",valueType:Hh(t),validation:Vh(t)},i)}function zh(e,t,i={}){return f({property:e,type:"value",valueType:Hh(t),validation:Vh(t)},i)}function Wh(e,t={}){const i=t,{min:n=-1/0,max:s=1/0}=i,r=y(i,["min","max"]);return f({type:"value",property:e,valueType:"range",validation:Gh,processor:()=>e=>ze(e)?Hn(n,e,s):e},r)}function jh(e,t,i={}){const n=i,{onlyPositive:s}=n,r=y(n,["onlyPositive"]);return m(f({},zh(e,t,r)),{processor:xh(s)})}function $h(e,t,i={}){return m(f({},zh(e,t,i)),{processor:Eh()})}function Kh(e,t,i="current",n,s){return[zh(e,s,n),Lh(n.groupId,t,i,n.separateNegative),...null!=n.rangeId?[bh(n.rangeId,n.groupId)]:[]]}var Yh=class{constructor(e,t,{datum:i},n){this.type=e,this.event=t,this.datum=i,this.seriesId=n.id}},qh=class{constructor(e,t,i){this.series=e,this.seriesGrouping=t,this.oldGrouping=i,this.type="groupingChanged"}},Xh=class extends Xl{constructor(e){super(),this.destroyFns=[],this.seriesGrouping=void 0,this.NodeEvent=Yh,this.internalId=Gn(this),this.rootGroup=new xo({name:"seriesRoot",isVirtual:!0}),this.axes={x:void 0,y:void 0},this.directions=["x","y"],this.nodeDataRefresh=!0,this.moduleMap=new pa,this._declarationOrder=-1,this.seriesListeners=new ic;const{moduleCtx:t,pickModes:i=[1],directionKeys:n={},directionNames:s={},contentGroupVirtual:r=!0,canHaveAxes:o=!1}=e;this.ctx=t,this.directionKeys=n,this.directionNames=s,this.canHaveAxes=o,this.contentGroup=this.rootGroup.appendChild(new xo({name:`${this.internalId}-content`,isVirtual:r,zIndex:4,zIndexSubOrder:this.getGroupZIndexSubOrder("data")})),this.highlightGroup=new xo({name:`${this.internalId}-highlight`,isVirtual:r,zIndex:4,zIndexSubOrder:this.getGroupZIndexSubOrder("highlight")}),this.highlightNode=this.highlightGroup.appendChild(new xo({name:"highlightNode",zIndex:0})),this.highlightLabel=this.highlightGroup.appendChild(new xo({name:"highlightLabel",zIndex:10})),this.pickModes=i,this.labelGroup=this.rootGroup.appendChild(new xo({name:`${this.internalId}-series-labels`,zIndex:8})),this.annotationGroup=new xo({name:`${this.id}-annotation`,isVirtual:r,zIndex:4,zIndexSubOrder:this.getGroupZIndexSubOrder("annotation")})}get id(){var e,t;return null!=(t=null==(e=this.properties)?void 0:e.id)?t:this.internalId}get type(){var e;return null!=(e=this.constructor.type)?e:""}get data(){var e;return null!=(e=this._data)?e:this._chartData}set visible(e){this.properties.visible=e,this.visibleChanged()}get visible(){return this.properties.visible}get hasData(){return null!=this.data&&this.data.length>0}get tooltipEnabled(){var e,t;return null!=(t=null==(e=this.properties.tooltip)?void 0:e.enabled)&&t}onDataChange(){this.nodeDataRefresh=!0}setOptionsData(e){this._data=e,this.onDataChange()}setChartData(e){this._chartData=e,this.data===e&&this.onDataChange()}onSeriesGroupingChange(e,t){const{internalId:i,type:n,visible:s}=this;e&&this.ctx.seriesStateManager.deregisterSeries({id:i,type:n}),t&&this.ctx.seriesStateManager.registerSeries({id:i,type:n,visible:s,seriesGrouping:t}),this.fireEvent(new qh(this,t,e))}getBandScalePadding(){return{inner:1,outer:0}}getGroupZIndexSubOrder(e,t=0){let i=0;switch(e){case"data":case"paths":break;case"labels":i+=2e4;break;case"marker":i+=1e4;break;case"highlight":t+=15e3;break;case"annotation":i+=15e3}return[()=>this._declarationOrder+i,t]}addListener(e,t){return this.seriesListeners.addListener(e,t)}dispatch(e,t){this.seriesListeners.dispatch(e,t)}addChartEventListeners(){}destroy(){this.destroyFns.forEach(e=>e()),this.destroyFns=[],this.ctx.seriesStateManager.deregisterSeries(this)}getDirectionValues(e,t){const i=this.resolveKeyDirection(e),n=null==t?void 0:t[i],s=[];if(!n)return s;const r=(...e)=>{for(const t of e)Array.isArray(t)?r(...t):"object"==typeof t?r(...Object.values(t)):s.push(t)};return r(...n.map(e=>this.properties[e])),s}getKeys(e){return this.getDirectionValues(e,this.directionKeys)}getKeyProperties(e){var t;return null!=(t=this.directionKeys[this.resolveKeyDirection(e)])?t:[]}getNames(e){return this.getDirectionValues(e,this.directionNames)}resolveKeyDirection(e){return e}getDomain(e){const t=this.getSeriesDomain(e),i=this.moduleMap.mapModules(t=>t.getDomain(e));return t.concat(i.flat())}markNodeDataDirty(){this.nodeDataRefresh=!0}visibleChanged(){this.ctx.seriesStateManager.registerSeries(this)}getOpacity(){const{dimOpacity:e=1,enabled:t=!0}=this.properties.highlightStyle.series;if(!t||1===e)return 1;switch(this.isItemIdHighlighted()){case 0:case 1:return 1;default:return e}}getStrokeWidth(e){const{strokeWidth:t,enabled:i=!0}=this.properties.highlightStyle.series;if(!i||void 0===t)return e;switch(this.isItemIdHighlighted()){case 1:return t;case 0:case 2:return e}}isItemIdHighlighted(){var e,t;const i=null==(t=null==(e=this.ctx.highlightManager)?void 0:e.getActiveHighlight())?void 0:t.series;return null==i?0:i!==this?2:1}getModuleTooltipParams(){return this.moduleMap.mapModules(e=>e.getTooltipParams()).reduce((e,t)=>Object.assign(e,t),{})}pickNode(e,t){const{pickModes:i,visible:n,rootGroup:s}=this;if(n&&s.visible)for(const n of i){if(t&&!t.includes(n))continue;let i;switch(n){case 0:i=this.pickNodeExactShape(e);break;case 1:case 2:i=this.pickNodeMainAxisFirst(e,2===n);break;case 3:i=this.pickNodeClosestDatum(e)}if(i)return{pickMode:n,match:i.datum,distance:i.distance}}}pickNodeExactShape(e){const t=this.contentGroup.pickNode(e.x,e.y);if(t&&!0!==t.datum.missing)return{datum:t.datum,distance:0}}pickNodeClosestDatum(e){throw new Error("AG Charts - Series.pickNodeClosestDatum() not implemented")}pickNodeNearestDistantObject(e,t){const i=Zn(e.x,e.y,t);if(void 0!==i.nearest&&!0!==i.nearest.datum.missing)return{datum:i.nearest.datum,distance:Math.sqrt(i.distanceSquared)}}pickNodeMainAxisFirst(e,t){throw new Error("AG Charts - Series.pickNodeMainAxisFirst() not implemented")}fireNodeClickEvent(e,t){this.fireEvent(new this.NodeEvent("nodeClick",e,t,this))}fireNodeDoubleClickEvent(e,t){this.fireEvent(new this.NodeEvent("nodeDoubleClick",e,t,this))}createNodeContextMenuActionEvent(e,t){return new this.NodeEvent("nodeContextMenuAction",e,t,this)}toggleSeriesItem(e,t){this.visible=t,this.nodeDataRefresh=!0,this.dispatch("visibility-changed",{itemId:e,enabled:t})}isEnabled(){return this.visible}getModuleMap(){return this.moduleMap}createModuleContext(){return m(f({},this.ctx),{series:this})}getLabelText(e,t,i=String){var n;return e.formatter&&null!=(n=this.ctx.callbackCache.call(e.formatter,f({seriesId:this.id},t)))?n:i(t.value)}getMarkerStyle(e,t,i=e.getStyle()){var n,s;const r=qe({size:null!=(s=null==(n=t.datum.point)?void 0:n.size)?s:0},i);return e.formatter?qe(this.ctx.callbackCache.call(e.formatter,m(f(f({seriesId:this.id},r),t),{datum:t.datum.datum})),r):r}updateMarkerStyle(e,t,i,n=t.getStyle(),{applyTranslation:s=!0}={}){const{point:r}=i.datum,o=this.getMarkerStyle(t,i,n),a=this.visible&&o.size>0&&r&&!isNaN(r.x)&&!isNaN(r.y);s?e.setProperties(m(f({visible:a},o),{translationX:null==r?void 0:r.x,translationY:null==r?void 0:r.y})):e.setProperties(f({visible:a},o)),"function"!=typeof t.shape||e.dirtyPath||(e.path.clear(!0),e.updatePath(),e.checkPathDirty())}getMinRects(e,t){}get nodeDataDependencies(){var e;return null!=(e=this._nodeDataDependencies)?e:{seriesRectWidth:NaN,seriesRectHeight:NaN}}checkResize(e){const{width:t,height:i}=null!=e?e:{width:NaN,height:NaN},n=e?{seriesRectWidth:t,seriesRectHeight:i}:void 0,s=null!=wt(this.nodeDataDependencies,n);return s&&(this._nodeDataDependencies=n,this.markNodeDataDirty()),s}pickFocus(e){}};Xh.highlightedZIndex=1e12,b([qa({changeValue:function(e,t){this.onSeriesGroupingChange(t,e)}})],Xh.prototype,"seriesGrouping",2);var Zh=class{constructor(e,t,i){this.seriesRoot=e,this.highlightRoot=t,this.annotationRoot=i,this.groups={},this.series={},this.expectedSeriesCount=1,this.mode="normal"}setSeriesCount(e){this.expectedSeriesCount=e}requestGroup(e){var t,i,n;const{internalId:s,type:r,rootGroup:o,highlightGroup:a,annotationGroup:l,seriesGrouping:c}=e,{groupIndex:h=s}=null!=c?c:{};if(null!=this.series[s])throw new Error(`AG Charts - series already has an allocated layer: ${this.series[s]}`);0===Object.keys(this.series).length&&(this.mode=this.expectedSeriesCount>=30?"aggressive-grouping":"normal"),null!=(t=this.groups)[r]||(t[r]={});const u=this.lookupIdx(h);let d=this.groups[r][u];return d||(d=null!=(n=(i=this.groups[r])[u])?n:i[u]={seriesIds:[],group:this.seriesRoot.appendChild(new xo({name:`${r}-content`,layer:!0,zIndex:4,zIndexSubOrder:e.getGroupZIndexSubOrder("data")})),highlight:this.highlightRoot.appendChild(new xo({name:`${r}-highlight`,zIndex:4,zIndexSubOrder:e.getGroupZIndexSubOrder("highlight")})),annotation:this.annotationRoot.appendChild(new xo({name:`${r}-annotation`,zIndex:4,zIndexSubOrder:e.getGroupZIndexSubOrder("annotation")}))}),this.series[s]={layerState:d,seriesConfig:e},d.seriesIds.push(s),d.group.appendChild(o),d.highlight.appendChild(a),d.annotation.appendChild(l),d.group}changeGroup(e){var t,i;const{internalId:n,seriesGrouping:s,type:r,rootGroup:o,highlightGroup:a,annotationGroup:l,oldGrouping:c}=e,{groupIndex:h=n}=null!=s?s:{};(null==(i=null==(t=this.groups[r])?void 0:t[h])?void 0:i.seriesIds.includes(n))||(null!=this.series[n]&&this.releaseGroup({internalId:n,seriesGrouping:c,type:r,rootGroup:o,highlightGroup:a,annotationGroup:l}),this.requestGroup(e))}releaseGroup(e){var t,i,n,s,r;const{internalId:o,seriesGrouping:a,rootGroup:l,highlightGroup:c,annotationGroup:h,type:u}=e,{groupIndex:d=o}=null!=a?a:{};if(null==this.series[o])throw new Error(`AG Charts - series doesn't have an allocated layer: ${o}`);const p=this.lookupIdx(d),g=null!=(n=null==(t=this.groups[u])?void 0:t[p])?n:null==(i=this.series[o])?void 0:i.layerState;if(g&&(g.seriesIds=g.seriesIds.filter(e=>e!==o),g.group.removeChild(l),g.highlight.removeChild(c),g.annotation.removeChild(h)),0===(null==g?void 0:g.seriesIds.length))this.seriesRoot.removeChild(g.group),this.highlightRoot.removeChild(g.highlight),this.annotationRoot.removeChild(g.annotation),delete this.groups[u][p],delete this.groups[u][o];else if((null==g?void 0:g.seriesIds.length)>0){const e=null==(r=this.series[null==(s=null==g?void 0:g.seriesIds)?void 0:s[0]])?void 0:r.seriesConfig;g.group.zIndexSubOrder=null==e?void 0:e.getGroupZIndexSubOrder("data"),g.highlight.zIndexSubOrder=null==e?void 0:e.getGroupZIndexSubOrder("highlight"),g.annotation.zIndexSubOrder=null==e?void 0:e.getGroupZIndexSubOrder("annotation")}delete this.series[o]}lookupIdx(e){return"normal"===this.mode?e:"string"!=typeof e||(e=Number(e.split("-").slice(-1)[0]))?Math.floor(30*Hn(0,e/this.expectedSeriesCount,1)):0}destroy(){for(const e of Object.values(this.groups))for(const t of Object.values(e))this.seriesRoot.removeChild(t.group),this.highlightRoot.removeChild(t.highlight),this.annotationRoot.removeChild(t.annotation);this.groups={},this.series={}}},Qh=class{constructor(e,t){this.chartLike=e,this.layoutService=t,this.destroyFns=[],this.destroyFns.push(this.layoutService.addListener("start-layout",e=>this.positionPadding(e.shrinkRect)),this.layoutService.addListener("start-layout",e=>this.positionCaptions(e.shrinkRect)))}destroy(){this.destroyFns.forEach(e=>e())}positionPadding(e){const{padding:t}=this.chartLike;return e.shrink(t.left,"left"),e.shrink(t.top,"top"),e.shrink(t.right,"right"),e.shrink(t.bottom,"bottom"),{shrinkRect:e}}positionCaptions(e){var t,i;const{title:n,subtitle:s,footnote:r}=this.chartLike,o=e.clone(),a=t=>{var i;const n=e.height/10,s=null!=(i=t.lineHeight)?i:t.fontSize*Oo.defaultLineHeightRatio,r=e.width,o=Math.max(s,n);t.computeTextWrap(r,o)},l=e=>"left"===e?o.x:"right"===e?o.x+o.width:("center"!==e&&L.error(`invalid textAlign value: ${e}`),o.x+o.width/2),c=(e,t)=>{const i=o.y;e.node.x=l(e.textAlign),e.node.y=i,e.node.textBaseline="top",a(e);const n=e.node.computeBBox(),s=Math.ceil(n.y-i+n.height+t);o.shrink(s,"top")};if(n.node.visible=n.enabled,s.node.visible=s.enabled,r.node.visible=r.enabled,n.enabled){const{spacing:e=(s.enabled?ol.SMALL_PADDING:ol.LARGE_PADDING)}=n;c(n,e)}return s.enabled&&c(s,null!=(t=s.spacing)?t:0),r.enabled&&((e,t)=>{const i=o.y+o.height;e.node.x=l(e.textAlign),e.node.y=i,e.node.textBaseline="bottom",a(e);const n=e.node.computeBBox(),s=Math.ceil(i-n.y+t);o.shrink(s,"bottom")})(r,null!=(i=r.spacing)?i:0),{shrinkRect:o}}},Jh=class{constructor(e,t,i,n){this.chart=e,this.dataService=t,this.updateService=i,this.zoomManager=n,this.dirtyZoom=!1,this.dirtyDataSource=!1,this.lastAxisZooms=new Map,this.destroyFns=[],this.destroyFns.push(this.dataService.addListener("data-source-change",()=>this.onDataSourceChange()),this.dataService.addListener("data-load",()=>this.onDataLoad()),this.dataService.addListener("data-error",()=>this.onDataError()),this.updateService.addListener("update-complete",()=>this.onUpdateComplete()),this.zoomManager.addListener("zoom-change",()=>this.onZoomChange()))}destroy(){this.destroyFns.forEach(e=>e())}onDataLoad(){this.updateService.update(1)}onDataError(){this.updateService.update(3)}onDataSourceChange(){this.dirtyDataSource=!0}onUpdateComplete(){(this.dirtyZoom||this.dirtyDataSource)&&this.updateWindow().catch(e=>L.errorOnce(e))}onZoomChange(){this.dirtyZoom=!0}updateWindow(){return w(this,null,function*(){if(!this.dataService.isLazy())return;const e=this.getValidAxis();let t,i=!0;if(e){const n=this.zoomManager.getAxisZoom(e.id);t=this.getAxisWindow(e,n),i=this.shouldRefresh(e,n)}this.dirtyZoom=!1,this.dirtyDataSource=!1,i&&this.dataService.load({windowStart:null==t?void 0:t.min,windowEnd:null==t?void 0:t.max})})}getValidAxis(){return this.chart.axes.find(e=>"time"===e.type)}shouldRefresh(e,t){if(this.dirtyDataSource)return!0;if(!this.dirtyZoom)return!1;const i=this.lastAxisZooms.get(e.id);return!(i&&t.min===i.min&&t.max===i.max||(this.lastAxisZooms.set(e.id,t),0))}getAxisWindow(e,t){var i,n;const s=null==(n=(i=e.scale).getDomain)?void 0:n.call(i);if(!t||!s||0===s.length||isNaN(Number(s[0])))return;const r=Number(s[1])-Number(s[0]);return{min:new Date(Number(s[0])+r*t.min),max:new Date(Number(s[0])+r*t.max)}}},eu=class{constructor(e,t,i,n,s){this.chartLike=e,this.overlays=t,this.dataService=i,this.layoutService=n,this.animationManager=s,this.destroyFns=[],this.destroyFns.push(this.layoutService.addListener("layout-complete",e=>this.onLayoutComplete(e)))}destroy(){this.destroyFns.forEach(e=>e())}onLayoutComplete({series:{rect:e}}){const t=this.dataService.isLoading(),i=this.chartLike.series.some(e=>e.hasData),n=this.chartLike.series.some(e=>e.visible);this.toggleOverlay(this.overlays.loading,e,t),this.toggleOverlay(this.overlays.noData,e,!t&&!i),this.toggleOverlay(this.overlays.noVisibleSeries,e,i&&!n)}toggleOverlay(e,t,i){if(i){const i=e.getElement(this.animationManager,t);this.chartLike.element.append(i)}else e.removeElement(this.animationManager)}},tu=In.create(!0,"opts"),iu=class extends yt{constructor(){super(...arguments),this.padding=new Zl(0)}};b([$s(Qs,{optional:!0})],iu.prototype,"clip",2),b([$s(Xs)],iu.prototype,"padding",2);var nu=class e extends Xl{constructor(e,t){var i,n;super(),this.id=Gn(this),this.seriesRoot=new xo({name:`${this.id}-series-root`}),this.highlightRoot=new xo({name:`${this.id}-highlight-root`,layer:!0,zIndex:5,nonEmptyChildDerivedZIndex:!0}),this.annotationRoot=new xo({name:`${this.id}-annotation-root`,layer:!0,zIndex:10}),this.debug=In.create(),this.extraDebugStats={},this.data=[],this._firstAutoSize=!0,this.padding=new Zl(20),this.seriesArea=new iu,this.title=new ol,this.subtitle=new ol,this.footnote=new ol,this.keyboard=new sh,this.mode="standalone",this.destroyed=!1,this._skipSync=!1,this._destroyFns=[],this.chartAnimationPhase="initial",this.modulesManager=new hh,this.zoomManager=new ih,this.processors=[],this.processedOptions={},this.userOptions={},this.queuedUserOptions=[],this._pendingFactoryUpdatesCount=0,this._performUpdateNoRenderCount=0,this._performUpdateSkipAnimations=!1,this.performUpdateType=7,this.updateShortcutCount=0,this.seriesToUpdate=new Set,this.updateMutex=new ql,this.updateRequestors={},this.performUpdateTrigger=Ql((e,t=0)=>setTimeout(e,t),e=>w(this,[e],function*({count:e}){this.destroyed||this.updateMutex.acquire(()=>w(this,null,function*(){try{yield this.performUpdate(e)}catch(e){L.error("update error",e)}})).catch(e=>L.errorOnce(e))})),this._performUpdateSplits={},this.axes=[],this.series=[],this.focus={hasFocus:!1,series:void 0,seriesIndex:0,datumIndex:0,datum:void 0},this.pointerScheduler=Ql((e,t)=>requestAnimationFrame(e),()=>{this.lastInteractionEvent&&(this.performUpdateType<=4?this.pointerScheduler.schedule():(this.handlePointer(this.lastInteractionEvent,!1),this.lastInteractionEvent=void 0))}),this.onSeriesNodeClick=e=>{const t=m(f({},e),{type:"seriesNodeClick"});Object.defineProperty(t,"series",{enumerable:!1,get:()=>e.series}),this.fireEvent(t)},this.onSeriesNodeDoubleClick=e=>{const t=m(f({},e),{type:"seriesNodeDoubleClick"});this.fireEvent(t)},this.seriesGroupingChanged=e=>{if(!(e instanceof qh))return;const{series:t,seriesGrouping:i,oldGrouping:n}=e;null!=t.rootGroup.parent&&this.seriesLayerManager.changeGroup({internalId:t.internalId,type:t.type,rootGroup:t.rootGroup,highlightGroup:t.highlightGroup,annotationGroup:t.annotationGroup,getGroupZIndexSubOrder:e=>t.getGroupZIndexSubOrder(e),seriesGrouping:i,oldGrouping:n})},this.dataProcessListeners=new Set,this.chartOptions=e;let s=null==t?void 0:t.scene;const r=null!=(i=null==t?void 0:t.element)?i:xn("div","ag-chart-wrapper",{position:"relative",userSelect:"none"}),o=null==t?void 0:t.container;this.element=r;const a=new xo({name:"root"});a.visible=!1,a.append(this.seriesRoot),a.append(this.highlightRoot),a.append(this.annotationRoot),this.axisGridGroup=new xo({name:"Axes-Grids",layer:!0,zIndex:1}),a.appendChild(this.axisGridGroup),this.axisGroup=new xo({name:"Axes",layer:!0,zIndex:2}),a.appendChild(this.axisGroup),this.sizeMonitor=new Jl,this.sizeMonitor.observe(this.element,e=>this.rawResize(e));const{overrideDevicePixelRatio:l}=e.specialOverrides;null!=s||(s=new Kl({pixelRatio:l,canvasPosition:"absolute"})),s.setRoot(a).setContainer(r),this.autoSize=!0,this.tooltip=new rl,this.seriesLayerManager=new Zh(this.seriesRoot,this.highlightRoot,this.annotationRoot);const c=this.ctx=new Uc(this,{scene:s,syncManager:new th(this),element:r,updateCallback:(e=0,t)=>this.update(e,t),updateMutex:this.updateMutex});this.overlays=new gh,null!=(n=this.overlays.loading).renderer||(n.renderer=()=>function(e,t){const{animationDuration:i}=As.add,n=xn("div",`${uh}--loading`,{display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",height:"100%",boxSizing:"border-box",font:"13px Verdana, sans-serif",userSelect:"none",animation:`ag-charts-loading ${i*t}ms linear 50ms both`}),s=xn("span",{width:"45px",height:"40px",backgroundImage:["linear-gradient(#0000 calc(1 * 100% / 6), #ccc 0 calc(3 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(2 * 100% / 6), #ccc 0 calc(4 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(3 * 100% / 6), #ccc 0 calc(5 * 100% / 6), #0000 0)"].join(""),backgroundSize:"10px 400%",backgroundRepeat:"no-repeat",animation:"ag-charts-loading-matrix 1s infinite linear"}),r=xn("p",{marginTop:"1em"});r.innerText=e;const o=xn("div",`${uh}__loading-background`,{position:"absolute",inset:"0",opacity:"0.5",zIndex:"-1"}),a=xn("style");return a.innerText=["@keyframes ag-charts-loading { from { opacity: 0 } to { opacity: 1 } }","@keyframes ag-charts-loading-matrix {","0% { background-position: 0% 0%, 50% 0%, 100% 0%; }","100% { background-position: 0% 100%, 50% 100%, 100% 100%; }","}"].join(" "),n.replaceChildren(a,s,r,o),An(fh,"chartOverlays"),n}(this.overlays.loading.getText(),c.animationManager.defaultDuration)),this.processors=[new Qh(this,c.layoutService),new Jh(this,c.dataService,c.updateService,c.zoomManager),new eu(this,this.overlays,c.dataService,c.layoutService,c.animationManager)],this.highlight=new zc,this.container=o;const{All:h}=pc,u=this.getModuleContext(),d=c.regionManager.addRegion("series",this.seriesRoot,this.axisGroup);c.regionManager.addRegion("root",a),this._destroyFns.push(c.dataService.addListener("data-load",e=>{this.data=e.data}),c.scene.attachNode(this.title.node),c.scene.attachNode(this.subtitle.node),c.scene.attachNode(this.footnote.node),this.title.registerInteraction(u,"title"),this.subtitle.registerInteraction(u,"subtitle"),this.footnote.registerInteraction(u,"footnote"),c.interactionManager.addListener("click",e=>this.onClick(e)),c.interactionManager.addListener("dblclick",e=>this.onDoubleClick(e)),d.addListener("hover",e=>this.onMouseMove(e)),d.addListener("leave",e=>this.onLeave(e)),d.addListener("blur",()=>this.onBlur()),d.addListener("tab",e=>this.onTab(e)),d.addListener("nav-vert",e=>this.onNavVert(e)),d.addListener("nav-hori",e=>this.onNavHori(e)),d.addListener("submit",e=>this.onSubmit(e)),c.keyNavManager.addListener("browserfocus",e=>this.onBrowserFocus(e)),c.interactionManager.addListener("page-left",()=>this.destroy()),c.interactionManager.addListener("contextmenu",e=>this.onContextMenu(e),h),c.animationManager.addListener("animation-start",()=>this.onAnimationStart()),c.animationManager.addListener("animation-frame",()=>{this.update(6)}),c.highlightManager.addListener("highlight-change",e=>this.changeHighlightDatum(e)),c.zoomManager.addListener("zoom-pan-start",()=>this.resetPointer()),c.zoomManager.addListener("zoom-change",()=>{this.resetPointer(),this.series.map(e=>{var t;return null==(t=e.animationState)?void 0:t.transition("updateData")});const e="initial"!==this.chartAnimationPhase;this.update(3,{forceNodeDataRefresh:!0,skipAnimations:e})}))}static getInstance(t){return e.chartsInstances.get(t)}get canvasElement(){return this.ctx.scene.canvas.element}getCanvasDataURL(e){return this.ctx.scene.getDataURL(e)}onAutoSizeChange(e){const{style:t}=this.element;if(e){if(t.display="block",t.width="100%",t.height="100%",!this._lastAutoSize)return;this.resize(void 0,void 0,"autoSize option")}else t.display="inline-block",t.width="auto",t.height="auto"}download(e,t){this.ctx.scene.download(e,t)}getOptions(){var e;return null!=(e=this.queuedUserOptions.at(-1))?e:this.userOptions}getModuleContext(){return this.ctx}getAriaLabel(){var e;const t=[this.title,this.subtitle,this.footnote].filter(e=>e.enabled&&e.text).map(e=>e.text).join(". ");return`chart, ${null!=(e=this.series.length)?e:0} series, ${t}`}resetAnimations(){this.chartAnimationPhase="initial";for(const e of this.series)e.resetAnimation(this.chartAnimationPhase);for(const e of this.axes)e.resetAnimation(this.chartAnimationPhase);this.animationRect=void 0,this.ctx.animationManager.reset()}skipAnimations(){this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0}destroy(e){if(this.destroyed)return;const t=null==e?void 0:e.keepTransferableResources;let i;return this.performUpdateType=7,this._destroyFns.forEach(e=>e()),this.processors.forEach(e=>e.destroy()),this.tooltip.destroy(),this.overlays.destroy(),this.sizeMonitor.unobserve(this.element),this.modulesManager.destroy(),t?(this.ctx.scene.strip(),i={container:this.container,scene:this.ctx.scene,element:this.element}):(this.ctx.scene.destroy(),this.container=void 0),this.destroySeries(this.series),this.seriesLayerManager.destroy(),this.axes.forEach(e=>e.destroy()),this.axes=[],this.animationRect=void 0,this.ctx.destroy(),this.zoomManager.destroy(),this.destroyed=!0,Object.freeze(this),i}resetPointer(e=!1){e||this.ctx.tooltipManager.removeTooltip(this.id),this.ctx.highlightManager.updateHighlight(this.id),this.lastInteractionEvent=void 0}requestFactoryUpdate(e){this.destroyed||(this._pendingFactoryUpdatesCount++,this.updateMutex.acquire(()=>w(this,null,function*(){this.destroyed||(yield e(this),this.destroyed||this._pendingFactoryUpdatesCount--)})).catch(e=>L.errorOnce(e)))}update(e=0,t){var i,n;const{forceNodeDataRefresh:s=!1,skipAnimations:r,seriesToUpdate:o=this.series,newAnimationBatch:a}=null!=t?t:{};s&&this.series.forEach(e=>e.markNodeDataDirty());for(const e of o)this.seriesToUpdate.add(e);if(r&&(this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0),a&&this.ctx.animationManager.isActive()&&(this._performUpdateSkipAnimations=!0),this._skipSync=null!=(i=null==t?void 0:t.skipSync)&&i,this.debug.check()){let t=null!=(n=(new Error).stack)?n:"<unknown>";t=t.replace(/\([^)]*/g,""),this.updateRequestors[t]=e}e<this.performUpdateType&&(this.performUpdateType=e,this.performUpdateTrigger.schedule(null==t?void 0:t.backOffMs))}performUpdate(e){return w(this,null,function*(){const{performUpdateType:t,extraDebugStats:i,_performUpdateSplits:n,ctx:s}=this,r=[...this.seriesToUpdate];this.performUpdateType=7,this.seriesToUpdate.clear(),0===this.updateShortcutCount&&t<6&&(s.animationManager.startBatch(this._performUpdateSkipAnimations),s.animationManager.onBatchStop(()=>this.chartAnimationPhase="ready")),this.debug("Chart.performUpdate() - start",Vc[t]);let o=performance.now();null!=n.start||(n.start=o);const a=e=>{null!=n[e]||(n[e]=0),n[e]+=performance.now()-o,o=performance.now()};let l=!1;switch(t){case 0:this.updateDOM();case 1:yield this.updateData(),a("⬇️");case 2:yield this.processData(),this.resetPointer(!0),a("🏭");case 3:if(this.checkUpdateShortcut(3))break;if(!this.checkFirstAutoSize(r)){l=!0;break}yield this.processLayout(),a("⌖");case 4:if(this.checkUpdateShortcut(4))break;const{seriesRect:e}=this;yield Promise.all(r.map(t=>t.update({seriesRect:e}))),a("🤔");case 5:if(this.checkUpdateShortcut(5))break;const o=s.tooltipManager.getTooltipMeta(this.id);t<=4&&null!=(null==o?void 0:o.lastPointerEvent)&&this.handlePointer(o.lastPointerEvent,!0),a("↖");case 6:if(this.checkUpdateShortcut(6))break;s.animationManager.endBatch(),i.updateShortcutCount=this.updateShortcutCount,yield s.scene.render({debugSplitTimes:n,extraDebugStats:i}),this.ctx.regionManager.updateFocusWrapperRect(),this.extraDebugStats={};for(const e in n)delete n[e];case 7:this.updateShortcutCount=0,this.updateRequestors={},this._performUpdateSkipAnimations=!1,s.animationManager.endBatch()}l||s.updateService.dispatchUpdateComplete(this.getMinRects());const c=performance.now();this.debug("Chart.performUpdate() - end",{chart:this,durationMs:Math.round(100*(c-n.start))/100,count:e,performUpdateType:Vc[t]})})}updateThemeClassName(){const{element:e,processedOptions:{theme:t}}=this,i="ag-charts-theme-",n=[`${i}default`,`${i}default-dark`];let s=n[0],r=!1;"string"==typeof t?(s=t.replace("ag-",i),r=t.includes("-dark")):"string"==typeof(null==t?void 0:t.baseTheme)&&(s=t.baseTheme.replace("ag-",i),r=t.baseTheme.includes("-dark")),n.includes(s)||(s=r?n[1]:n[0]),e.classList.forEach(t=>{t.startsWith(i)&&t!==s&&e.classList.remove(t)}),e.classList.add(s)}updateDOM(){this.updateThemeClassName();const{enabled:e,tabIndex:t}=this.keyboard;this.element.tabIndex=e?null!=t?t:0:-1,Za(this.ctx.scene.canvas.element,"role","figure"),Za(this.ctx.scene.canvas.element,"aria-label",this.getAriaLabel())}checkUpdateShortcut(e){return this.updateShortcutCount>3?(L.warn("exceeded the maximum number of simultaneous updates (4), discarding changes and rendering",this.updateRequestors),!1):this.performUpdateType<=e&&(this.updateShortcutCount++,!0)}checkFirstAutoSize(e){if(this.autoSize&&!this._lastAutoSize){const t=this._performUpdateNoRenderCount++,i=40*p(t+1,2);if(t<8)return this.update(3,{seriesToUpdate:e,backOffMs:i}),this.debug("Chart.checkFirstAutoSize() - backing off until first size update",i),!1;this.debug("Chart.checkFirstAutoSize() - timeout for first size update.")}return this._performUpdateNoRenderCount=0,!0}onAxisChange(e,t=[]){for(const i of t)e.includes(i)||(i.detachAxis(this.axisGroup,this.axisGridGroup),i.destroy());for(const i of e)(null==t?void 0:t.includes(i))||i.attachAxis(this.axisGroup,this.axisGridGroup)}onSeriesChange(e,t){var i,n;const s=null!=(i=null==t?void 0:t.filter(t=>!e.includes(t)))?i:[];this.destroySeries(s),null==(n=this.seriesLayerManager)||n.setSeriesCount(e.length);for(const i of e){if(null==t?void 0:t.includes(i))continue;null==i.rootGroup.parent&&this.seriesLayerManager.requestGroup(i);const e=this;i.chart={get mode(){return e.mode},get isMiniChart(){return!1},get seriesRect(){return e.seriesRect},placeLabels:()=>e.placeLabels()},i.resetAnimation(this.chartAnimationPhase),this.addSeriesListeners(i),i.addChartEventListeners()}}destroySeries(e){null==e||e.forEach(e=>{e.removeEventListener("nodeClick",this.onSeriesNodeClick),e.removeEventListener("nodeDoubleClick",this.onSeriesNodeDoubleClick),e.removeEventListener("groupingChanged",this.seriesGroupingChanged),e.destroy(),this.seriesLayerManager.releaseGroup(e),e.chart=void 0})}addSeriesListeners(e){this.hasEventListener("seriesNodeClick")&&e.addEventListener("nodeClick",this.onSeriesNodeClick),this.hasEventListener("seriesNodeDoubleClick")&&e.addEventListener("nodeDoubleClick",this.onSeriesNodeDoubleClick),e.addEventListener("groupingChanged",this.seriesGroupingChanged)}updateAllSeriesListeners(){this.series.forEach(e=>{e.removeEventListener("nodeClick",this.onSeriesNodeClick),e.removeEventListener("nodeDoubleClick",this.onSeriesNodeDoubleClick),this.addSeriesListeners(e)})}assignSeriesToAxes(){this.axes.forEach(e=>{e.boundSeries=this.series.filter(t=>t.axes[e.direction]===e)})}assignAxesToSeries(){const e=gn(this.axes,e=>e.direction);this.series.forEach(t=>{t.directions.forEach(i=>{const n=e[i];if(!n)return void L.warnOnce(`no available axis for direction [${i}]; check series and axes configuration.`);const s=t.getKeys(i),r=n.find(e=>!e.keys.length||s.some(t=>e.keys.includes(t)));r?t.axes[i]=r:L.warnOnce(`no matching axis for direction [${i}] and keys [${s}]; check series and axes configuration.`)})})}rawResize({width:e,height:t}){var i;if(!this.autoSize)return;if(e=Math.floor(e),t=Math.floor(t),0===e&&0===t)return;const[n=0,s=0]=null!=(i=this._lastAutoSize)?i:[];n===e&&s===t||(this._lastAutoSize=[e,t],this.resize(void 0,void 0,"SizeMonitor"))}resize(e,t,i){var n,s,r,o;const{scene:a,animationManager:l}=this.ctx;if(null!=e||(e=null!=(s=this.width)?s:this.autoSize?null==(n=this._lastAutoSize)?void 0:n[0]:a.canvas.width),null!=t||(t=null!=(o=this.height)?o:this.autoSize?null==(r=this._lastAutoSize)?void 0:r[1]:a.canvas.height),this.debug(`Chart.resize() from ${i}`,{width:e,height:t,stack:(new Error).stack}),e&&t&&ze(e)&&ze(t)&&a.resize(e,t)){this.resetPointer(),l.reset();let e=!0;this.autoSize&&this._firstAutoSize&&(e=!1,this._firstAutoSize=!1),this.update(3,{forceNodeDataRefresh:!0,skipAnimations:e})}}updateData(){return w(this,null,function*(){this.series.forEach(e=>e.setChartData(this.data));const e=this.modulesManager.mapModules(e=>{var t;return null==(t=e.updateData)?void 0:t.call(e,{data:this.data})});yield Promise.all(e)})}processData(){return w(this,null,function*(){if(this.series.some(e=>e.canHaveAxes)){this.assignAxesToSeries();const e=this.modulesManager.getModule("sync");(null==e?void 0:e.enabled)?e.syncAxes(this._skipSync):this.assignSeriesToAxes()}const e=new Jc(this.mode),t=this.series.map(t=>t.processData(e)),i=this.modulesManager.mapModules(t=>{var i;return null==(i=t.processData)?void 0:i.call(t,{dataController:e})});e.execute(),yield Promise.all([...t,...i]);for(const{legendType:e,legend:t}of this.modulesManager.legends())t.data=this.getLegendData(e,"integrated"!==this.mode);this.dataProcessListeners.forEach(e=>e()),this.dataProcessListeners.clear()})}placeLabels(){const e=[],t=[];for(const i of this.series){if(!i.visible)continue;const n=i.getLabelData();Ua(null==n?void 0:n[0])&&(t.push(n),e.push(i))}const{seriesRect:i}=this,{top:n,right:s,bottom:r,left:o}=this.seriesArea.padding,a=i&&t.length>0?function(e,t,i=5){var n,s;const r=[];e=e.map(e=>e.slice().sort((e,t)=>t.point.size-e.point.size));for(let o=0;o<e.length;o++){const a=r[o]=[],l=e[o];if((null==l?void 0:l.length)&&l[0].label)for(let o=0,c=l.length;o<c;o++){const c=l[o],{point:h,label:u,marker:d}=c,{text:p,width:g,height:f}=u,m=.5*h.size;let y=0,v=0;if(m>0&&null!=c.placement){const e=za[c.placement];y=(.5*g+m+i)*e.x,v=(.5*f+m+i)*e.y}const b=h.x-.5*g+y-((null!=(n=null==d?void 0:d.center.x)?n:.5)-.5)*h.size,C=h.y-.5*f+v-((null!=(s=null==d?void 0:d.center.y)?s:.5)-.5)*h.size;t&&!Ha(t,b,C,g,f)||e.some(e=>e.some(e=>{var t;return Ba(e.point,null==(t=e.marker)?void 0:t.center,b,C,g,f)}))||r.some(e=>e.some(e=>Va(e,b,C,g,f)))||a.push({index:o,text:p,x:b,y:C,width:g,height:f,datum:c})}}return r}(t,{x:-o,y:-n,width:i.width+o+s,height:i.height+n+r}):[];return new Map(a.map((t,i)=>[e[i],t]))}getLegendData(e,t){var i,n;const s=this.series.filter(e=>e.properties.showInLegend).flatMap(t=>t.getLegendData(e));if(t&&s.every(e=>"category"===e.legendType)){const e={},t=new Map(this.series.map(e=>[e.id,e.type]));for(const{seriesId:r,marker:o,label:a}of s){if(null==o.fill)continue;const s=t.get(r),l=null!=(i=e[s])?i:e[s]={};null!=l[n=a.text]||(l[n]=o.fill),l[a.text]!==o.fill&&L.warnOnce(`legend item '${a.text}' has multiple fill colors, this may cause unexpected behaviour.`)}}return s}processLayout(){return w(this,null,function*(){var e;const t=this.animationRect;yield this.performLayout(),t&&!(null==(e=this.animationRect)?void 0:e.equals(t))&&this.ctx.animationManager.skipCurrentBatch(),this.debug("Chart.performUpdate() - seriesRect",this.seriesRect)})}performLayout(){return w(this,null,function*(){const{width:e,height:t}=this.ctx.scene;let i={shrinkRect:new es(0,0,e,t)};i=this.ctx.layoutService.dispatchPerformLayout("start-layout",i),i=this.ctx.layoutService.dispatchPerformLayout("before-series",i);const n=this.modulesManager.mapModules(e=>w(this,null,function*(){null!=e.performLayout&&(i=yield e.performLayout(i))}));return yield Promise.all(n),i.shrinkRect})}pickSeriesNode(e,t,i){var n,s;const r=performance.now(),o=t?[0]:void 0,a=[...this.series].reverse();let l;for(const t of a){if(!t.visible||!t.rootGroup.visible)continue;const{match:s,distance:r}=null!=(n=t.pickNode(e,o))?n:{};if(s&&null!=r&&((!l||l.distance>r)&&r<=(null!=i?i:1/0)&&(l={series:t,distance:r,datum:s}),0===r))break}return this.extraDebugStats.pickSeriesNode=Math.round((null!=(s=this.extraDebugStats.pickSeriesNode)?s:0)+(performance.now()-r)),l}onMouseMove(e){this.lastInteractionEvent=e,this.pointerScheduler.schedule(),this.extraDebugStats.mouseX=e.offsetX,this.extraDebugStats.mouseY=e.offsetY,this.update(6)}onLeave(e){this.tooltip.pointerLeftOntoTooltip(e)||(this.resetPointer(),this.update(6),this.ctx.cursorManager.updateCursor("chart"))}onBrowserFocus(e){e.delta>0?(this.focus.datum=void 0,this.focus.series=void 0,this.focus.datumIndex=0,this.focus.seriesIndex=0):(this.focus.datum=void 0,this.focus.series=void 0,this.focus.datumIndex=1/0,this.focus.seriesIndex=1/0)}onAnimationStart(){this.focus.hasFocus&&this.onBlur()}onBlur(){this.ctx.regionManager.updateFocusIndicatorRect(void 0),this.resetPointer(),this.focus.hasFocus=!1}onTab(e){this.handleFocus(),e.consume(),this.focus.hasFocus=!0}onNavVert(e){this.focus.seriesIndex+=e.delta,this.handleFocus(),e.consume()}onNavHori(e){this.focus.datumIndex+=e.delta,this.handleFocus(e.delta),e.consume()}onSubmit(e){const{series:t,datum:i}=this.focus,n=e.sourceEvent.sourceEvent;void 0!==t&&void 0!==i?t.fireNodeClickEvent(n,i):this.fireEvent({type:"click",event:n})}onContextMenu(e){this.ctx.tooltipManager.removeTooltip(this.id);const{Default:t,ContextMenu:i}=pc;this.ctx.interactionManager.getState()&(t|i)&&this.checkSeriesNodeRange(e,()=>{this.ctx.highlightManager.updateHighlight(this.id)})}handleFocus(e){this.focus.hasFocus=!0;const t=this.overlays.getFocusInfo();null==t?this.handleSeriesFocus(null!=e?e:0):(this.ctx.regionManager.updateFocusIndicatorRect(t.rect),this.ctx.ariaAnnouncementService.announceValue(t.text))}handleSeriesFocus(e){const{series:t,seriesRect:i,focus:n}=this,s=t.filter(e=>e.visible);if(0===s.length)return;n.seriesIndex=Hn(0,n.seriesIndex,s.length-1),n.series=s[n.seriesIndex];const r=n.series.pickFocus({datumIndex:n.datumIndex,datumIndexDelta:e,seriesRect:i});if(void 0===r)return;const{datum:o,datumIndex:a}=r;n.datumIndex=a,n.datum=o;const l=rh(this.ctx.regionManager,r);if(void 0!==l){this.lastInteractionEvent=l;const e=n.series.getTooltipHtml(o),t=Fc.makeTooltipMeta(this.lastInteractionEvent,o);this.ctx.highlightManager.updateHighlight(this.id,o),this.ctx.tooltipManager.updateTooltip(this.id,t,e),this.ctx.ariaAnnouncementService.announceValue(e.ariaLabel)}}static isHoverEvent(e){return void 0!==e&&"hover"===e.type}handlePointer(t,i){if(16!==this.ctx.interactionManager.getState()||!e.isHoverEvent(t))return;const{lastPick:n,hoverRect:s}=this,{offsetX:r,offsetY:o}=t,a=(e=!1)=>{n&&this.resetPointer(e)};(i?!this.ctx.animationManager.isActive():null==s?void 0:s.containsPoint(r,o))?(this.handlePointerTooltip(t,a),this.handlePointerNode(t)):a()}handlePointerTooltip(e,t){const{lastPick:i,tooltip:n}=this,{range:s}=n,{offsetX:r,offsetY:o}=e;let a;ze(s)&&(a=s);const l=this.pickSeriesNode({x:r,y:o},"exact"===s,a);if(!l)return this.ctx.tooltipManager.removeTooltip(this.id),void("tooltip"===this.highlight.range&&t(!0));const c="node"===this.highlight.range||!i||i!==l.datum;let h;c&&(h=l.series.getTooltipHtml(l.datum),"tooltip"===this.highlight.range&&this.ctx.highlightManager.updateHighlight(this.id,l.datum));const u=null!=a,d=this.tooltip.enabled&&l.series.tooltipEnabled,p="exact"===s&&0===l.distance,g=d&&("nearest"===s||u||p)&&(!c||void 0!==h),f=Fc.makeTooltipMeta(e,l.datum);g&&this.ctx.tooltipManager.updateTooltip(this.id,f,h)}handlePointerNode(e){this.checkSeriesNodeRange(e,(e,t)=>{(e.hasEventListener("nodeClick")||e.hasEventListener("nodeDoubleClick"))&&this.ctx.cursorManager.updateCursor("chart","pointer"),"node"===this.highlight.range&&this.ctx.highlightManager.updateHighlight(this.id,t)})||(this.ctx.cursorManager.updateCursor("chart"),"node"===this.highlight.range&&this.ctx.highlightManager.updateHighlight(this.id))}onClick(e){this.checkSeriesNodeClick(e)?this.update(4):this.fireEvent({type:"click",event:e.sourceEvent})}onDoubleClick(e){this.checkSeriesNodeDoubleClick(e)?this.update(4):this.fireEvent({type:"doubleClick",event:e.sourceEvent})}checkSeriesNodeClick(e){return this.checkSeriesNodeRange(e,(t,i)=>t.fireNodeClickEvent(e.sourceEvent,i))}checkSeriesNodeDoubleClick(e){return this.checkSeriesNodeRange(e,(t,i)=>t.fireNodeDoubleClickEvent(e.sourceEvent,i))}checkSeriesNodeRange(e,t){var i;const n=this.pickSeriesNode({x:e.offsetX,y:e.offsetY},!1),s=null==n?void 0:n.datum,r=null==s?void 0:s.series.properties.nodeClickRange;let o;ze(r)&&(o=r);let a=this.pickSeriesNode({x:e.offsetX,y:e.offsetY},!0);if(a?this.ctx.highlightManager.updatePicked(this.id,a.datum):this.ctx.highlightManager.updatePicked(this.id),s&&"nearest"===r)return t(s.series,s),!0;if("exact"!==r&&(a=this.pickSeriesNode({x:e.offsetX,y:e.offsetY},!1,o)),!a)return!1;const l=null!=o,c="exact"===r&&0===a.distance;return!(!l&&!c||void 0!==e.pointerHistory&&!(null==(i=e.pointerHistory)?void 0:i.every(e=>{const t={x:e.offsetX,y:e.offsetY},i=this.pickSeriesNode(t,!1,o);return(null==i?void 0:i.datum)===(null==a?void 0:a.datum)})))&&(t(a.series,a.datum),!0)}changeHighlightDatum(e){var t,i;const n=new Set,{series:s,datum:r}=null!=(t=e.currentHighlight)?t:{},{series:o,datum:a}=null!=(i=e.previousHighlight)?i:{};o&&n.add(o),s&&n.add(s),(null==o?void 0:o.properties.cursor)&&a&&this.ctx.cursorManager.updateCursor(o.id),(null==s?void 0:s.properties.cursor)&&r&&this.ctx.cursorManager.updateCursor(s.id,s.properties.cursor),this.lastPick=e.currentHighlight,null==s||null==o?this.update(4):this.update(4,{seriesToUpdate:n})}waitForUpdate(e=1e4,t=!1){return w(this,null,function*(){const i=performance.now();for(this._pendingFactoryUpdatesCount>0&&(yield this.updateMutex.waitForClearAcquireQueue());7!==this.performUpdateType;){if(performance.now()-i>e){const i=`Chart.waitForUpdate() timeout of ${e} reached - first chart update taking too long.`;if(t)throw new Error(i);L.warnOnce(i)}yield Yl(50)}yield this.updateMutex.waitForClearAcquireQueue()})}waitForDataProcess(e){return new Promise(t=>{this.dataProcessListeners.add(t),Ue(e)&&setTimeout(()=>{this.dataProcessListeners.has(t)&&(this.dataProcessListeners.delete(t),t())},e)})}getMinRects(){const{width:e,height:t}=this.ctx.scene,i=this.series.map(i=>i.getMinRects(e,t)).filter(ke);if(0===i.length)return;let n=0,s=0,r=0,o=0;for(const{minRect:e,minVisibleRect:t}of i)n=Math.max(n,e.width),s=Math.max(s,e.height),r=Math.max(r,t.width),o=Math.max(o,t.height);const a=new es(0,0,n,s);let l=a.clone();return r>0&&o>0&&(l=new es(0,0,r,o)),{minRect:a,minVisibleRect:l}}filterMiniChartSeries(e){return null==e?void 0:e.filter(e=>!1!==e.showInMiniChart)}applyOptions(e){var t,i,n,s,r;const o=this.processedOptions,a=e.diffOptions(o),l=e.userOptions;if(null==a)return;tu("AgChartV2.updateDelta() - applying delta",a);const c=qe(a,o),h=this.applyModules(c);a.listeners&&this.registerListeners(this,a.listeners),At(this,a,{skip:["type","data","series","listeners","theme","legend.listeners","navigator.miniChart.series","navigator.miniChart.label","axes","topology"]});let u=!1,d="no-op";(null==(t=a.series)?void 0:t.length)&&(d=this.applySeries(this,a.series,null==o?void 0:o.series),u=!0),"replaced"===d&&this.resetAnimations(),this.applyAxes(this,c,o,d)&&(u=!0),a.data&&(this.data=a.data),(null==(i=a.legend)?void 0:i.listeners)&&this.modulesManager.isEnabled("legend")&&Object.assign(this.legend.listeners,a.legend.listeners),a.listeners&&this.updateAllSeriesListeners(),this.chartOptions=e,this.processedOptions=c,this.userOptions=qe(l,this.userOptions);const p=this.modulesManager.getModule("navigator"),g=this.modulesManager.getModule("zoom");(null==p?void 0:p.enabled)||(null==g?void 0:g.enabled)||this.ctx.zoomManager.updateZoom("chart");const f=null==p?void 0:p.miniChart,m=null!=(r=null==(s=null==(n=c.navigator)?void 0:n.miniChart)?void 0:s.series)?r:c.series;!0===(null==f?void 0:f.enabled)&&null!=m?this.applyMiniChartOptions(f,m,c,o):!1===(null==f?void 0:f.enabled)&&(f.series=[],f.axes=[]),An("\n/* Reset */\n\n[class^='ag-charts'],\n[class^='ag-charts']:focus,\n[class^='ag-charts']:after,\n[class^='ag-charts']:before {\n    box-sizing: border-box;\n    outline: none;\n}\n\nbutton[class^='ag-charts'] {\n    background: none;\n    border: 0;\n}\n\n\n\n/* Icons */\n\n[class^='ag-charts-icon'] {\n    display: block;\n    /* speak: none; */\n    mask-size: contain;\n    mask-repeat: no-repeat;\n    background-color: currentColor;\n}\n\n.ag-charts-icon-zoom-in {\n    mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXpvb20taW4iPjxjaXJjbGUgY3g9IjExIiBjeT0iMTEiIHI9IjgiLz48bGluZSB4MT0iMjEiIHgyPSIxNi42NSIgeTE9IjIxIiB5Mj0iMTYuNjUiLz48bGluZSB4MT0iMTEiIHgyPSIxMSIgeTE9IjgiIHkyPSIxNCIvPjxsaW5lIHgxPSI4IiB4Mj0iMTQiIHkxPSIxMSIgeTI9IjExIi8+PC9zdmc+);\n}\n\n.ag-charts-icon-zoom-out {\n    mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXpvb20tb3V0Ij48Y2lyY2xlIGN4PSIxMSIgY3k9IjExIiByPSI4Ii8+PGxpbmUgeDE9IjIxIiB4Mj0iMTYuNjUiIHkxPSIyMSIgeTI9IjE2LjY1Ii8+PGxpbmUgeDE9IjgiIHgyPSIxNCIgeTE9IjExIiB5Mj0iMTEiLz48L3N2Zz4=);\n}\n\n.ag-charts-icon-reset {\n    mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXJvdGF0ZS1jY3ciPjxwYXRoIGQ9Ik0zIDEyYTkgOSAwIDEgMCA5LTkgOS43NSA5Ljc1IDAgMCAwLTYuNzQgMi43NEwzIDgiLz48cGF0aCBkPSJNMyAzdjVoNSIvPjwvc3ZnPg==);\n}\n\n.ag-charts-icon-pan-left {\n    mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWNoZXZyb24tbGVmdCI+PHBhdGggZD0ibTE1IDE4LTYtNiA2LTYiLz48L3N2Zz4=);\n}\n\n.ag-charts-icon-pan-right {\n    mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWNoZXZyb24tcmlnaHQiPjxwYXRoIGQ9Im05IDE4IDYtNi02LTYiLz48L3N2Zz4=);\n}\n\n.ag-charts-icon-pan-start {\n    mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWNoZXZyb24tZmlyc3QiPjxwYXRoIGQ9Im0xNyAxOC02LTYgNi02Ii8+PHBhdGggZD0iTTcgNnYxMiIvPjwvc3ZnPg==);\n}\n\n.ag-charts-icon-pan-end {\n    mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWNoZXZyb24tbGFzdCI+PHBhdGggZD0ibTcgMTggNi02LTYtNiIvPjxwYXRoIGQ9Ik0xNyA2djEyIi8+PC9zdmc+);\n}\n\n\n\n/* AG Charts Theme Default */\n\n.ag-charts-theme-default,\n.ag-charts-theme-default-dark {\n    /* Colors */\n    --ag-charts-active-color: var(--ag-active-color, #2196f3);\n    --ag-charts-background-color: var(--ag-background-color, #fff);\n    --ag-charts-foreground-color: var(--ag-foreground-color, #181d1f);\n    --ag-charts-border-color: var(--ag-border-color, #dddddd);\n\n    /* Sizing */\n    --ag-charts-font-size: var(--ag-font-size, 14px);\n    --ag-charts-size: var(--ag-grid-size, 8px);\n\n    /* Borders */\n    --ag-charts-border: var(--ag-borders, solid 1px);\n    --ag-charts-border-critical: var(--ag-borders-critical, solid 1px);\n\n    /* Toolbar */\n    --ag-charts-toolbar-foreground-color: var(--ag-header-foreground-color, var(--ag-charts-foreground-color));\n    --ag-charts-toolbar-background-color: var(\n        --ag-header-background-color,\n        color-mix(in srgb, var(--ag-charts-background-color), var(--ag-charts-foreground-color) 2%)\n    );\n    --ag-charts-toolbar-size: var(--ag-header-height, 48px);\n    --ag-charts-toolbar-padding: calc(var(--ag-charts-size) * 2);\n    --ag-charts-toolbar-border: var(--ag-charts-border, solid 1px) var(--ag-charts-border-color);\n    --ag-charts-toolbar-border-critical: var(--ag-charts-border-critical, solid 1px) var(--ag-charts-border-color);\n    --ag-charts-toolbar-hover-color: color-mix(in srgb, var(--ag-charts-background-color), var(--ag-charts-active-color) 12%);\n    --ag-charts-toolbar-disabled-foreground-color: var(\n        --ag-disabled-foreground-color,\n        color-mix(in srgb, transparent, var(--ag-charts-toolbar-foreground-color) 50%)\n    );\n    --ag-charts-toolbar-disabled-background-color: var(\n        --ag-input-disabled-background-color,\n        color-mix(in srgb, var(--ag-charts-toolbar-background-color), var(--ag-charts-toolbar-foreground-color) 6%)\n    );\n    --ag-charts-toolbar-gap: var(--ag-charts-size);\n\n    /* Buttons */\n    --ag-charts-button-padding: var(--ag-charts-size);\n    --ag-charts-button-radius: var(--ag-border-radius, 4px);\n\n    /* Focus Indicator */\n    --ag-charts-focus-border: solid 2px var(--ag-input-focus-border-color, var(--ag-charts-active-color));\n    --ag-charts-focus-border-shadow: var(--ag-input-focus-box-shadow, 0 0 0 3px color-mix(in srgb, transparent, var(--ag-charts-focus-border) 47%));\n\n    /* Icons */\n    --ag-charts-icon-font-family: 'agChartsDefault';\n    --ag-charts-icon-font-weight: normal;\n    --ag-charts-icon-font-color: color-mix(in srgb, transparent, var(--ag-charts-foreground-color), 90%);\n}\n\n\n\n/* AG Charts Theme Default Dark */\n\n.ag-charts-theme-default-dark {\n    /* Colors */\n    --ag-charts-background-color: var(--ag-background-color, color-mix(in srgb, #fff, #182230 97%));\n    --ag-charts-foreground-color: var(--ag-foreground-color, #fff);\n    --ag-charts-border-color: var(--ag-border-color, rgba(255, 255, 255, 0.16));\n    --ag-charts-hover-color: var(\n        --ag-row-hover-color,\n        color-mix(in srgb, transparent, var(--ag-charts-active-color) 20%)\n    );\n\n    /* Toolbar */\n    --ag-charts-toolbar-background-color: var(--ag-header-background-color, color-mix(in srgb, #fff, #182230 93%));\n}\n\n\n","chart"),this.ctx.annotationManager.setAnnotationStyles(e.annotationThemes),u||(u=this.shouldForceNodeDataRefresh(a,d));const y=u||h?0:3;this.maybeResetAnimations(d),tu("AgChartV2.applyChartOptions() - update type",Vc[y],{seriesStatus:d,forceNodeDataRefresh:u}),this.update(y,{forceNodeDataRefresh:u,newAnimationBatch:!0})}maybeResetAnimations(e){if("standalone"===this.mode)switch(e){case"series-grouping-change":case"replaced":this.resetAnimations()}}shouldForceNodeDataRefresh(e,t){const i=!!e.data||"data-change"===t||"replaced"===t,n=It.getKeys(),s=Object.values(n).some(t=>null!=e[t]),r=null!=e.title&&null!=e.subtitle;return i||s||r}applyMiniChartOptions(e,t,i,n){var s,r,o,a,l;const c=null!=(o=null==(r=null==(s=null==n?void 0:n.navigator)?void 0:s.miniChart)?void 0:r.series)?o:null==n?void 0:n.series,h=this.applySeries(e,this.filterMiniChartSeries(t),this.filterMiniChartSeries(c));this.applyAxes(e,i,n,h,["axes[].tick","axes[].thickness","axes[].title","axes[].crosshair","axes[].gridLine","axes[].label"]);const u=e.axes,d=u.find(e=>"x"===e.direction);for(const e of u)e.gridLine.enabled=!1,e.label.enabled=e===d,e.tick.enabled=!1,e.interactionEnabled=!1;if(null!=d){const e=null==(a=i.navigator)?void 0:a.miniChart,t=null==e?void 0:e.label,n=null==(l=null==e?void 0:e.label)?void 0:l.interval;d.line.enabled=!1,d.label.set(Qe(t,["interval","rotation","minSpacing","autoRotate","autoRotateAngle"])),d.tick.set(Qe(n,["enabled","width","size","color","interval","step"]));const s=null==n?void 0:n.step;null!=s&&(d.tick.interval=s)}}applyModules(e){var t;const{type:i}=this.constructor;let n=!1;for(const s of Se.byType("root","legend")){const r=null!=e[s.optionsKey]&&s.chartTypes.includes(i);r!==this.modulesManager.isEnabled(s)&&(r?(this.modulesManager.addModule(s,e=>new e.instanceConstructor(this.getModuleContext())),"legend"===s.type&&(null==(t=this.modulesManager.getModule(s))||t.attachLegend(this.ctx.scene)),this[s.optionsKey]=this.modulesManager.getModule(s)):(this.modulesManager.removeModule(s),delete this[s.optionsKey]),n=!0)}return n}applySeries(e,t,i){var n;if(!t)return"no-change";const s=function(e,t,i){var n,s,r,o;const a=(e,t)=>{const i=[e];for(const e of ch)e in t&&null!=t[e]&&i.push(`${e}=${t[e]}`);return i.join(";")},l=new Map;let c=0;for(const t of e){const e=a(t.type,t.properties);l.has(e)||l.set(e,[]),null==(n=l.get(e))||n.push([t,c++])}const h=new Map;for(const e of t){const t=a(e.type,e);h.has(t)||h.set(t,[]),null==(s=h.get(t))||s.push(e)}if(![...l.keys()].some(e=>h.has(e)))return{status:"no-overlap",oldKeys:l.keys(),newKeys:h.keys()};const u=[];let d=-1;for(const[e,t]of h.entries())for(const n of t){d++;const t=l.get(e);if(null==t||t.length<1){u.push({opts:n,idx:d,status:"add"}),l.delete(e);continue}const[s,a]=t.shift(),c=wt(null!=(r=null==i?void 0:i[a])?r:{},null!=n?n:{}),{groupIndex:h,stackIndex:p}=null!=(o=null==c?void 0:c.seriesGrouping)?o:{};null!=h||null!=p?u.push({opts:n,series:s,diff:c,idx:a,status:"series-grouping"}):c?u.push({opts:n,series:s,diff:c,idx:a,status:"update"}):u.push({opts:n,series:s,idx:a,status:"no-op"}),0===t.length&&l.delete(e)}for(const e of l.values())for(const[t,i]of e)u.push({series:t,idx:i,status:"remove"});return{status:"overlap",changes:u}}(e.series,t,i);if("no-overlap"===s.status)return tu(`AgChartV2.applySeries() - creating new series instances, status: ${s.status}`,s),e.series=t.map(e=>this.createSeries(e)),"replaced";tu("AgChartV2.applySeries() - matchResult",s);const r=[];let o=!1,a=!1,l=!1;for(const e of s.changes)switch(a||(a="series-grouping"===e.status),o||(o=null!=(null==(n=e.diff)?void 0:n.data)),l||(l="no-op"!==e.status),e.status){case"add":const t=this.createSeries(e.opts);r.push(t),tu("AgChartV2.applySeries() - created new series",t);break;case"remove":tu(`AgChartV2.applySeries() - removing series at previous idx ${e.idx}`,e.series);break;case"no-op":r.push(e.series),tu(`AgChartV2.applySeries() - no change to series at previous idx ${e.idx}`,e.series);break;default:const{series:i,diff:n,idx:s}=e;tu(`AgChartV2.applySeries() - applying series diff previous idx ${s}`,n,i),this.applySeriesValues(i,n),i.markNodeDataDirty(),r.push(i)}for(let e=0;e<r.length;e++)r[e]._declarationOrder=e;return tu("AgChartV2.applySeries() - final series instances",r),e.series=r,a?"series-grouping-change":o?"data-change":l?"updated":"no-op"}applyAxes(e,t,i,n,s=[]){if(!("axes"in t)||!t.axes)return!1;s=["axes[].type",...s];const{axes:r}=t;return"replaced"!==n&&e.axes.length===r.length&&e.axes.every((e,t)=>e.type===r[t].type)&&dt(i)?(e.axes.forEach((e,t)=>{var n,o;const a=wt(null!=(o=null==(n=i.axes)?void 0:n[t])?o:{},r[t]);tu(`AgChartV2.applyAxes() - applying axis diff idx ${t}`,a);const l=`axes[${t}]`;At(e,a,m(f({},$r),{path:l,skip:s}))}),!0):(tu(`AgChartV2.applyAxes() - creating new axes instances; seriesStatus: ${n}`),e.axes=this.createAxis(r,s),!0)}createSeries(e){const t=Dt.create(e.type,this.getModuleContext());return this.applySeriesOptionModules(t,e),this.applySeriesValues(t,e),t}applySeriesOptionModules(e,t){const i=e.createModuleContext(),n=e.getModuleMap();for(const s of Se.byType("series-option"))s.optionsKey in t&&s.seriesTypes.includes(e.type)&&n.addModule(s,e=>new e.instanceConstructor(i))}applySeriesValues(e,t){const i=e.getModuleMap(),n=t,{type:s,data:r,listeners:o,seriesGrouping:a,showInMiniChart:l}=n,c=y(n,["type","data","listeners","seriesGrouping","showInMiniChart"]);for(const e of lt)if("series-option"===e.type&&e.optionsKey in c){const t=i.getModule(e.optionsKey),n=c[e.optionsKey];delete c[e.optionsKey],t.properties.set(n)}e.properties.set(c),"data"in t&&e.setOptionsData(r),o&&this.registerListeners(e,o),"seriesGrouping"in t&&(e.seriesGrouping=null==a?void 0:f(f({},e.seriesGrouping),a))}createAxis(e,t){const i=new lh,n=this.getModuleContext();for(let s=0;s<e.length;s++){const r=e[s],o=xe.create(r.type,n);this.applyAxisModules(o,r),At(o,r,m(f({},$r),{path:`axes[${s}]`,skip:t})),i.push(o,r)}return i.guessInvalidPositions()}applyAxisModules(e,t){const i=e.createModuleContext(),n=e.getModuleMap();for(const s of Se.byType("axis-option")){const r=null!=t[s.optionsKey];r!==n.isEnabled(s)&&(r?(n.addModule(s,e=>new e.instanceConstructor(i)),e[s.optionsKey]=n.getModule(s)):(n.removeModule(s),delete e[s.optionsKey]))}}registerListeners(e,t){e.clearEventListeners();for(const[i,n]of Object.entries(t))Fe(n)&&e.addEventListener(i,n)}};nu.chartsInstances=new WeakMap,b([qa({newValue(e){this.destroyed||(e.setAttribute("data-ag-charts",""),e.appendChild(this.element),nu.chartsInstances.set(e,this))},oldValue(e){e.removeAttribute("data-ag-charts"),e.removeChild(this.element),nu.chartsInstances.delete(e)}})],nu.prototype,"container",2),b([qa({newValue(e){this.resize(e,void 0,"width option")}})],nu.prototype,"width",2),b([qa({newValue(e){this.resize(void 0,e,"height option")}})],nu.prototype,"height",2),b([qa({newValue(e){this.onAutoSizeChange(e)}}),$s(Qs)],nu.prototype,"autoSize",2),b([$s(Xs)],nu.prototype,"padding",2),b([$s(Xs)],nu.prototype,"seriesArea",2),b([$s(Xs)],nu.prototype,"title",2),b([$s(Xs)],nu.prototype,"subtitle",2),b([$s(Xs)],nu.prototype,"footnote",2),b([$s(Xs)],nu.prototype,"keyboard",2),b([$s(Or(["standalone","integrated"],"a chart mode"))],nu.prototype,"mode",2),b([qa({changeValue(e,t){this.onAxisChange(e,t)}})],nu.prototype,"axes",2),b([qa({changeValue(e,t){this.onSeriesChange(e,t)}})],nu.prototype,"series",2);var su=nu;function ru(e,t,i,n,s,r,o,a){const l=(i-e)*(a-r)-(n-t)*(o-s);if(0===l)return 0;const c=((o-s)*(t-r)-(e-s)*(a-r))/l,h=((i-e)*(t-r)-(n-t)*(e-s))/l;return c>=0&&c<=1&&h>=0&&h<=1?1:0}function ou(e,t,i,n,s,r,o,a,l,c,h,u){let d=0;const p=c-u,g=h-l,f=l*(u-c)-c*(h-l),m=au(e,i,s,o),y=au(t,n,r,a),v=function(e,t,i,n){if(0===e)return function(e,t,i){if(0===e)return function(e,t){const i=-t/e;return 0!==e&&i>=0&&i<=1?[i]:[]}(t,i);const n=t*t-4*e*i,s=[];if(0===n){const i=-t/(2*e);i>=0&&i<=1&&s.push(i)}else if(n>0){const i=Math.sqrt(n),r=(-t-i)/(2*e),o=(-t+i)/(2*e);r>=0&&r<=1&&s.push(r),o>=0&&o<=1&&s.push(o)}return s}(t,i,n);const s=t/e,r=i/e,o=(3*r-s*s)/9,a=(9*s*r-n/e*27-2*s*s*s)/54,l=o*o*o+a*a,c=1/3,h=[];if(l>=0){const e=Math.sqrt(l),t=Math.sign(a+e)*Math.pow(Math.abs(a+e),c),i=Math.sign(a-e)*Math.pow(Math.abs(a-e),c),n=Math.abs(Math.sqrt(3)*(t-i)/2),r=-c*s+(t+i);if(r>=0&&r<=1&&h.push(r),0===n){const e=-c*s-(t+i)/2;e>=0&&e<=1&&h.push(e)}}else{const e=Math.acos(a/Math.sqrt(-o*o*o)),t=c*s,i=2*Math.sqrt(-o),n=i*Math.cos(c*e)-t,r=i*Math.cos(c*(e+2*Math.PI))-t,l=i*Math.cos(c*(e+4*Math.PI))-t;n>=0&&n<=1&&h.push(n),r>=0&&r<=1&&h.push(r),l>=0&&l<=1&&h.push(l)}return h}(p*m[0]+g*y[0],p*m[1]+g*y[1],p*m[2]+g*y[2],p*m[3]+g*y[3]+f);for(const e of v){const t=e*e,i=e*t,n=m[0]*i+m[1]*t+m[2]*e+m[3],s=y[0]*i+y[1]*t+y[2]*e+y[3];let r;r=l===h?(s-c)/(u-c):(n-l)/(h-l),r>=0&&r<=1&&d++}return d}function au(e,t,i,n){return[3*t-e-3*i+n,3*e-6*t+3*i,-3*e+3*t,e]}function lu(e,t,i,n,s,r,o,a,l,c){if(isNaN(e)||isNaN(t))return 0;r&&([s,n]=[n,s]);const h=(c-a)/(l-o),u=a-h*o,d=Math.pow(h,2)+1,p=2*(h*(u-t)-e),g=Math.pow(e,2)+Math.pow(u-t,2)-Math.pow(i,2),f=Math.pow(p,2)-4*d*g;if(f<0)return 0;const m=(-p+Math.sqrt(f))/2/d,y=(-p-Math.sqrt(f))/2/d;let v=0;return[m,y].forEach(i=>{if(!(i>=Math.min(o,l)&&i<=Math.max(o,l)))return;const r=i-e,a=h*i+u-t;Fs(Math.atan2(a,r),n,s)&&v++}),v}var cu=class{constructor(){this.path2d=new Path2D,this.previousCommands=[],this.previousParams=[],this.previousClosedPath=!1,this.commands=[],this.params=[],this.openedPath=!1,this.closedPath=!1}isDirty(){return this.closedPath!==this.previousClosedPath||this.previousCommands.length!==this.commands.length||this.previousParams.length!==this.params.length||this.previousCommands.toString()!==this.commands.toString()||this.previousParams.toString()!==this.params.toString()}getPath2D(){return this.path2d}moveTo(e,t){this.openedPath=!0,this.path2d.moveTo(e,t),this.commands.push(0),this.params.push(e,t)}lineTo(e,t){this.openedPath?(this.path2d.lineTo(e,t),this.commands.push(1),this.params.push(e,t)):this.moveTo(e,t)}rect(e,t,i,n){this.moveTo(e,t),this.lineTo(e+i,t),this.lineTo(e+i,t+n),this.lineTo(e,t+n),this.closePath()}roundRect(e,t,i,n,s){s=Math.min(s,i/2,n/2),this.moveTo(e,t+s),this.arc(e+s,t+s,s,Math.PI,1.5*Math.PI),this.lineTo(e+s,t),this.lineTo(e+i-s,t),this.arc(e+i-s,t+s,s,1.5*Math.PI,2*Math.PI),this.lineTo(e+i,t+s),this.lineTo(e+i,t+n-s),this.arc(e+i-s,t+n-s,s,0,Math.PI/2),this.lineTo(e+i-s,t+n),this.lineTo(e+s,t+n),this.arc(e+ +s,t+n-s,s,Math.PI/2,Math.PI),this.lineTo(e,t+n-s),this.closePath()}arc(e,t,i,n,s,r){this.openedPath=!0,this.path2d.arc(e,t,i,n,s,r),this.commands.push(2),this.params.push(e,t,i,n,s,r?1:0)}cubicCurveTo(e,t,i,n,s,r){this.openedPath||this.moveTo(e,t),this.path2d.bezierCurveTo(e,t,i,n,s,r),this.commands.push(3),this.params.push(e,t,i,n,s,r)}closePath(){this.openedPath&&(this.path2d.closePath(),this.commands.push(4),this.openedPath=!1,this.closedPath=!0)}clear(e){e&&(this.previousCommands=this.commands,this.previousParams=this.params,this.previousClosedPath=this.closedPath),this.path2d=new Path2D,this.openedPath=!1,this.closedPath=!1,this.commands=[],this.params=[]}isPointInPath(e,t){const i=this.commands,n=this.params,s=i.length,r=-1e4,o=-1e4;let a=NaN,l=NaN,c=0,h=0,u=0;for(let d=0,p=0;d<s;d++)switch(i[d]){case 0:u+=ru(a,l,c,h,r,o,e,t),c=n[p++],a=c,h=n[p++],l=h;break;case 1:u+=ru(c,h,n[p++],n[p++],r,o,e,t),c=n[p-2],h=n[p-1];break;case 3:u+=ou(c,h,n[p++],n[p++],n[p++],n[p++],n[p++],n[p++],r,o,e,t),c=n[p-2],h=n[p-1];break;case 2:const i=n[p++],s=n[p++],d=n[p++],g=n[p++],f=n[p++];u+=lu(i,s,d,g,f,Boolean(n[p++]),r,o,e,t),isNaN(a)||(u+=ru(c,h,i+Math.cos(g)*d,s+Math.sin(g)*d,r,o,e,t)),c=i+Math.cos(f)*d,h=s+Math.sin(f)*d;break;case 4:u+=ru(a,l,c,h,r,o,e,t)}return u%2==1}distanceSquared(e,t){let i=1/0;const n=this.commands,s=this.params,r=n.length;let o=NaN,a=NaN,l=0,c=0;for(let h=0,u=0;h<r;h++)switch(n[h]){case 0:l=o=s[u++],c=a=s[u++];break;case 1:i=Oa(e,t,l,c,s[u++],s[u++],i);break;case 3:L.error("Command.Curve distanceSquare not implemented");break;case 2:{const n=s[u++],r=s[u++],o=s[u++],a=s[u++],h=s[u++],d=n+Math.cos(a)*o,p=r+Math.sin(a)*o,g=Boolean(s[u++]);i=Oa(e,t,l,c,d,p,i),i=Fa(e,t,n,r,o,a,h,g,i),l=n+Math.cos(h)*o,c=r+Math.sin(h)*o;break}case 4:i=Oa(e,t,l,c,o,a,i)}return i}getPoints(){const{commands:e,params:t}=this,i=[];let n=0;for(let s=0;s<e.length;s++)switch(e[s]){case 0:case 1:i.push({x:t[n++],y:t[n++]});break;case 3:n+=4,i.push({x:t[n++],y:t[n++]});break;case 2:i.push({x:t[n++],y:t[n++]}),n+=4}return i}};function hu(e){const{redraw:t=3,changeCb:i,convertor:n}=null!=e?e:{};return ns({redraw:t,type:"path",convertor:n,changeCb:i})}var uu=class extends Do{constructor(){super(...arguments),this.path=new cu,this._clipX=NaN,this._clipY=NaN,this._dirtyPath=!0}set clipX(e){this._clipX=e,this.dirtyPath=!0}set clipY(e){this._clipY=e,this.dirtyPath=!0}set dirtyPath(e){this._dirtyPath!==e&&(this._dirtyPath=e,e&&this.markDirty(this,3))}get dirtyPath(){return this._dirtyPath}checkPathDirty(){var e,t,i,n;this._dirtyPath||(this.dirtyPath=this.path.isDirty()||null!=(t=null==(e=this.fillShadow)?void 0:e.isDirty())&&t||null!=(n=null==(i=this._clipPath)?void 0:i.isDirty())&&n)}isPointInPath(e,t){const i=this.transformPoint(e,t);return this.path.closedPath&&this.path.isPointInPath(i.x,i.y)}distanceSquared(e,t){const i=this.transformPoint(e,t);return this.path.distanceSquared(i.x,i.y)}isDirtyPath(){return!1}updatePath(){}render(e){var t,i,n,s;const{ctx:r,forceRender:o,stats:a}=e;if(0!==this.dirty||o){if(this.computeTransformMatrix(),this.matrix.toContext(r),(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1),isNaN(this._clipX)||isNaN(this._clipY)||null==this.clipMode)this.drawPath(r);else{r.save();const e=this.strokeWidth/2;if(null!=this._clipPath||(this._clipPath=new cu),this._clipPath.clear(),this._clipPath.rect(-e,-e,this._clipX+e,this._clipY+e+e),"normal"===this.clipMode&&r.clip(null==(t=this._clipPath)?void 0:t.getPath2D()),this._clipX>0&&this._clipY>0&&this.drawPath(r),"punch-out"===this.clipMode){r.clip(null==(i=this._clipPath)?void 0:i.getPath2D());const{x:e=-1e4,y:t=-1e4,width:s=2e4,height:o=2e4}=null!=(n=this.computeBBox())?n:{};r.clearRect(e,t,s,o)}r.restore()}null==(s=this.fillShadow)||s.markClean(),super.render(e)}else a&&(a.nodesSkipped+=this.nodeCount.count)}drawPath(e){this.fillStroke(e,this.path.getPath2D())}};uu.className="Path",b([hu()],uu.prototype,"clipMode",2),b([hu()],uu.prototype,"clipX",1),b([hu()],uu.prototype,"clipY",1);var du=class{constructor(e,t,i){this.root=new fu(e,t,i)}clear(e){this.root.clear(e)}addValue(e,t){const i={hitTester:e,value:t,distanceSquared:(t,i)=>e.distanceSquared(t,i)};this.root.addElem(i)}find(e,t){const i={best:{nearest:void 0,distanceSquared:1/0}};return this.root.find(e,t,i),i.best}},pu=class{constructor(e,t,i,n){this.nw=e,this.ne=t,this.sw=i,this.se=n}addElem(e){this.nw.addElem(e),this.ne.addElem(e),this.sw.addElem(e),this.se.addElem(e)}find(e,t,i){this.nw.find(e,t,i),this.ne.find(e,t,i),this.sw.find(e,t,i),this.se.find(e,t,i)}},gu=class{constructor(e,t,i){this.capacity=e,this.maxdepth=t,this.boundary=null!=i?i:es.NaN,this.elems=[],this.subdivisions=void 0}clear(e){this.elems.length=0,this.boundary=e,this.subdivisions=void 0}addElem(e){this.addCondition(e)&&(void 0===this.subdivisions?0===this.maxdepth||this.elems.length<this.capacity?this.elems.push(e):this.subdivide(e):this.subdivisions.addElem(e))}find(e,t,i){this.findCondition(e,t,i)&&(void 0===this.subdivisions?this.findAction(e,t,i):this.subdivisions.find(e,t,i))}subdivide(e){this.subdivisions=this.makeSubdivisions();for(const e of this.elems)this.subdivisions.addElem(e);this.subdivisions.addElem(e),this.elems.length=0}makeSubdivisions(){const{x:e,y:t,width:i,height:n}=this.boundary,{capacity:s}=this,r=this.maxdepth-1,o=i/2,a=n/2,l=new es(e,t,o,a),c=new es(e+o,t,o,a),h=new es(e,t+a,o,a),u=new es(e+o,t+a,o,a);return new pu(this.child(s,r,l),this.child(s,r,c),this.child(s,r,h),this.child(s,r,u))}},fu=class e extends gu{addCondition(e){const{x:t,y:i}=e.hitTester.midPoint;return this.boundary.containsPoint(t,i)}findCondition(e,t,i){const{best:n}=i;return 0!==n.distanceSquared&&this.boundary.distanceSquared(e,t)<n.distanceSquared}findAction(e,t,i){const n=Zn(e,t,this.elems,i.best.distanceSquared);void 0!==n.nearest&&n.distanceSquared<i.best.distanceSquared&&(i.best=n)}child(t,i,n){return new e(t,i,n)}},mu=class extends uu{constructor(){super(...arguments),this.x=0,this.y=0,this.size=12}computeBBox(){const{x:e,y:t,size:i}=this,{center:n}=this.constructor;return new es(e-i*n.x,t-i*n.y,i,i)}applyPath(e,t){const{path:i}=this;let{x:n,y:s}=this;null!=this.repeat&&(n=0,s=0),i.clear();for(const{x:r,y:o,t:a}of t)n+=r*e,s+=o*e,"move"===a?i.moveTo(n,s):i.lineTo(n,s);i.closePath()}executeFill(e,t){if(!t)return;if(null==this.repeat)return super.executeFill(e,t);e.save();let i=this.translationX,n=this.translationY;for(const s of this.repeat)e.translate(s.x-i,s.y-n),e.fill(t),i=s.x,n=s.y;e.restore()}executeStroke(e,t){if(!t)return;if(null==this.repeat)return super.executeStroke(e,t);e.save();let i=this.translationX,n=this.translationY;for(const s of this.repeat)e.translate(s.x-i,s.y-n),e.stroke(t),i=s.x,n=s.y;e.restore()}};mu.center={x:.5,y:.5},b([hu()],mu.prototype,"x",2),b([hu()],mu.prototype,"y",2),b([hu({convertor:Math.abs})],mu.prototype,"size",2),b([hu()],mu.prototype,"repeat",2);var yu=class extends mu{updatePath(){const{x:e,y:t,path:i,size:n}=this,s=n/2;i.clear(),i.arc(e,t,s,0,2*Math.PI),i.closePath()}};yu.className="Circle";var vu=class e extends mu{updatePath(){const t=this.size/4.2;super.applyPath(t,e.moves)}};vu.className="Cross",vu.moves=[{x:-1,y:0,t:"move"},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1},{x:1,y:1},{x:-1,y:1},{x:-1,y:-1},{x:-1,y:1},{x:-1,y:-1}];var bu=vu,Cu=class e extends mu{updatePath(){const t=this.size/2;super.applyPath(t,e.moves)}};Cu.className="Diamond",Cu.moves=[{x:0,y:-1,t:"move"},{x:1,y:1},{x:-1,y:1},{x:-1,y:-1},{x:1,y:-1}];var wu=Cu,Su=class extends mu{rad(e){return e/180*Math.PI}updatePath(){const{x:e,path:t,size:i,rad:n}=this,s=i/4,r=this.y+s/2;t.clear(),t.arc(e-s,r-s,s,n(130),n(330)),t.arc(e+s,r-s,s,n(220),n(50)),t.lineTo(e,r+s),t.closePath()}};Su.className="Heart";var xu=class extends mu{updatePath(){const{path:e,x:t,y:i}=this,n=this.size,s=.5;e.clear(),e.moveTo(t+-.34375*n,i+-.65625*n),e.cubicCurveTo(t+-.34375*n,i+-.848509*n,t+-.192259*n,i+-1*n,t+0*n,i+-1*n),e.cubicCurveTo(t+(.692259-s)*n,i+-1*n,t+.34375*n,i+-.848509*n,t+.34375*n,i+-.65625*n),e.cubicCurveTo(t+.34375*n,i+-.506176*n,t+.284625*n,i+(.600181-1)*n,t+(.716461-s)*n,i+(.695393-1)*n),e.cubicCurveTo(t+.199009*n,i+-.280231*n,t+(.681271-s)*n,i+-.256896*n,t+(.663785-s)*n,i+(.766105-1)*n),e.cubicCurveTo(t+(.611893-s)*n,i+(.834367-1)*n,t+(.562228-s)*n,i+(.899699-1)*n,t+(.528896-s)*n,i+(.980648-1)*n),e.cubicCurveTo(t+(.524075-s)*n,i+(.992358-1)*n,t+(.512663-s)*n,i+0*n,t+0*n,i+0*n),e.cubicCurveTo(t+(.487337-s)*n,i+0*n,t+(.475925-s)*n,i+(.992358-1)*n,t+(.471104-s)*n,i+(.980648-1)*n),e.cubicCurveTo(t+(.487337-s)*n,i+0*n,t+(.475925-s)*n,i+(.992358-1)*n,t+(.471104-s)*n,i+(.980648-1)*n),e.cubicCurveTo(t+(.437772-s)*n,i+(.899699-1)*n,t+(.388107-s)*n,i+(.834367-1)*n,t+(.336215-s)*n,i+(.766105-1)*n),e.cubicCurveTo(t+(.318729-s)*n,i+-.256896*n,t+-.199009*n,i+-.280231*n,t+(.283539-s)*n,i+(.695393-1)*n),e.cubicCurveTo(t+-.284625*n,i+(.600181-1)*n,t+-.34375*n,i+-.506176*n,t+-.34375*n,i+-.65625*n),e.closePath()}};xu.className="MapPin",xu.center={x:.5,y:1};var Eu=class e extends mu{updatePath(){const t=this.size/3;super.applyPath(t,e.moves)}};Eu.className="Plus",Eu.moves=[{x:-.5,y:-.5,t:"move"},{x:0,y:-1},{x:1,y:0},{x:0,y:1},{x:1,y:0},{x:0,y:1},{x:-1,y:0},{x:0,y:1},{x:-1,y:0},{x:0,y:-1},{x:-1,y:0},{x:0,y:-1}];var Au=Eu,Mu=class extends mu{updatePath(){const{path:e,x:t,y:i}=this,n=this.size/2;e.clear(),e.moveTo(this.align(t-n),this.align(i-n)),e.lineTo(this.align(t+n),this.align(i-n)),e.lineTo(this.align(t+n),this.align(i+n)),e.lineTo(this.align(t-n),this.align(i+n)),e.closePath()}};Mu.className="Square";var Tu=class extends mu{updatePath(){const{x:e,y:t,path:i,size:n}=this,s=n/2,r=Math.PI/2;i.clear();for(let o=0;o<10;o++){const a=o%2==0?n:s,l=o*Math.PI/5-r,c=e+Math.cos(l)*a,h=t+Math.sin(l)*a;i.lineTo(c,h)}i.closePath()}};Tu.className="Star";var Du=class e extends mu{updatePath(){const t=1.1*this.size;super.applyPath(t,e.moves)}};Du.className="Triangle",Du.moves=[{x:0,y:-.48,t:"move"},{x:.5,y:.87},{x:-1,y:0}];var Iu=Du,Ru={circle:yu,cross:bu,diamond:wu,heart:Su,pin:xu,plus:Au,square:Mu,star:Tu,triangle:Iu},ku=Object.keys(Ru);function Pu(e){return"string"==typeof e&&ku.includes(e)}function _u(e=Mu){return Pu(e)?Ru[e]:"function"==typeof e?e:Mu}var Lu=class extends Xh{constructor(){super(...arguments),this.showFocusBox=!0}getScaleInformation({xScale:e,yScale:t}){return{isContinuousX:qr.is(e),isContinuousY:qr.is(t),xScaleType:null==e?void 0:e.type,yScaleType:null==t?void 0:t.type}}getModulePropertyDefinitions(){var e,t;const i=null==(e=this.axes.x)?void 0:e.scale,n=null==(t=this.axes.y)?void 0:t.scale;return this.moduleMap.mapModules(e=>e.getPropertyDefinitions(this.getScaleInformation({xScale:i,yScale:n}))).flat()}requestDataModel(e,t,i){return w(this,null,function*(){i.props.push(...this.getModulePropertyDefinitions());const{dataModel:n,processedData:s}=yield e.request(this.id,null!=t?t:[],i);return this.dataModel=n,this.processedData=s,this.dispatch("data-processed",{dataModel:n,processedData:s}),{dataModel:n,processedData:s}})}isProcessedDataAnimatable(){var e,t;const i=null==(t=null==(e=this.processedData)?void 0:e.reduced)?void 0:t.animationValidation;if(!i)return!0;const{orderedKeys:n,uniqueKeys:s}=i;return n&&s}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}pickFocus(e){return this.doPickFocus(e,this)}doPickFocus(e,t){const i=this.getNodeData();if(void 0===i||0===i.length)return;const{datumIndexDelta:n,seriesRect:s}=e,r=this.computeFocusDatumIndex(e,i,t.seriesItemEnabled);if(void 0===r)return;const{showFocusBox:o}=this,a=i[r],l=this.computeFocusBounds({datumIndex:r,datumIndexDelta:n,seriesRect:s});return void 0!==l?{bbox:l,showFocusBox:o,datum:a,datumIndex:r}:void 0}computeFocusDatumIndex(e,t,i){i&&t.length!==i.length&&L.error(`invalid state: nodeData.length (${t.length} !== seriesItemEnabled.length (${null==i?void 0:i.length})`);const n=e=>{const n=t[e];return(void 0===n.missing||!1===n.missing)&&(void 0===i||i[e])},s=e=>{for(;e>=0&&!n(e);)e--;return-1===e?void 0:e},r=e=>{for(;e<t.length&&!n(e);)e++;return e===t.length?void 0:e};let o;const a=Hn(0,e.datumIndex,t.length-1);return e.datumIndexDelta<0?o=s(a):e.datumIndexDelta>0?o=r(a):(null!=o||(o=r(a)),null!=o||(o=s(a))),void 0===o?0===e.datumIndexDelta?void 0:e.datumIndex-e.datumIndexDelta:o}},Nu=class extends yt{constructor(){super(...arguments),this.fill="rgba(255,255,255, 0.33)",this.stroke="rgba(0, 0, 0, 0.4)",this.strokeWidth=2}};b([$s(fr,{optional:!0})],Nu.prototype,"fill",2),b([$s(sr,{optional:!0})],Nu.prototype,"fillOpacity",2),b([$s(fr,{optional:!0})],Nu.prototype,"stroke",2),b([$s(nr,{optional:!0})],Nu.prototype,"strokeWidth",2),b([$s(sr,{optional:!0})],Nu.prototype,"strokeOpacity",2),b([$s(Er,{optional:!0})],Nu.prototype,"lineDash",2),b([$s(nr,{optional:!0})],Nu.prototype,"lineDashOffset",2);var Ou=class extends yt{};b([$s(nr,{optional:!0})],Ou.prototype,"strokeWidth",2),b([$s(sr,{optional:!0})],Ou.prototype,"dimOpacity",2),b([$s(Qs,{optional:!0})],Ou.prototype,"enabled",2);var Fu=class extends yt{constructor(){super(...arguments),this.color="black"}};b([$s(fr,{optional:!0})],Fu.prototype,"color",2);var Gu=class extends yt{constructor(){super(...arguments),this.item=new Nu,this.series=new Ou,this.text=new Fu}};b([$s(Xs)],Gu.prototype,"item",2),b([$s(Xs)],Gu.prototype,"series",2),b([$s(Xs)],Gu.prototype,"text",2);var Bu=class extends yt{constructor(){super(...arguments),this.visible=!0,this.showInLegend=!0,this.cursor="default",this.nodeClickRange="exact",this.highlightStyle=new Gu}};b([$s(er,{optional:!0})],Bu.prototype,"id",2),b([$s(Qs)],Bu.prototype,"visible",2),b([$s(Qs)],Bu.prototype,"showInLegend",2),b([$s(er)],Bu.prototype,"cursor",2),b([$s(Lr)],Bu.prototype,"nodeClickRange",2),b([$s(Xs)],Bu.prototype,"highlightStyle",2);var Vu={x:["xKey"],y:["yKey"]},Hu={x:["xName"],y:["yName"]},Uu=class extends Yh{constructor(e,t,i,n){super(e,t,i,n),this.xKey=n.properties.xKey,this.yKey=n.properties.yKey}},zu=class extends Bu{};b([$s(er,{optional:!0})],zu.prototype,"legendItemName",2);var Wu=class extends Lu{constructor(e){var t=e,{pathsPerSeries:i=1,hasMarkers:n=!1,hasHighlightedLabels:s=!1,pathsZIndexSubOrderOffset:r=[],datumSelectionGarbageCollection:o=!0,markerSelectionGarbageCollection:a=!0,animationAlwaysUpdateSelections:l=!1,animationResetFns:c,directionKeys:h,directionNames:u}=t,d=y(t,["pathsPerSeries","hasMarkers","hasHighlightedLabels","pathsZIndexSubOrderOffset","datumSelectionGarbageCollection","markerSelectionGarbageCollection","animationAlwaysUpdateSelections","animationResetFns","directionKeys","directionNames"]);if(super(f({directionKeys:h,directionNames:u,canHaveAxes:!0},d)),this.NodeEvent=Uu,this.dataNodeGroup=this.contentGroup.appendChild(new xo({name:`${this.id}-series-dataNodes`,zIndex:4,zIndexSubOrder:this.getGroupZIndexSubOrder("data")})),this.markerGroup=this.contentGroup.appendChild(new xo({name:`${this.id}-series-markers`,zIndex:4,zIndexSubOrder:this.getGroupZIndexSubOrder("marker")})),this.labelGroup=this.contentGroup.appendChild(new xo({name:`${this.id}-series-labels`,zIndex:8,zIndexSubOrder:this.getGroupZIndexSubOrder("labels")})),this.labelSelection=La.select(this.labelGroup,Oo),this.highlightSelection=La.select(this.highlightNode,()=>this.opts.hasMarkers?this.markerFactory():this.nodeFactory()),this.highlightLabelSelection=La.select(this.highlightLabel,Oo),this.annotationSelections=new Set,this.minRectsCache={dirtyNodeData:!0},this.debug=In.create(),!h||!u)throw new Error(`Unable to initialise series type ${this.type}`);this.opts={pathsPerSeries:i,hasMarkers:n,hasHighlightedLabels:s,pathsZIndexSubOrderOffset:r,directionKeys:h,directionNames:u,animationResetFns:c,animationAlwaysUpdateSelections:l,datumSelectionGarbageCollection:o,markerSelectionGarbageCollection:a},this.paths=[];for(let e=0;e<i;e++)this.paths[e]=new uu,this.paths[e].zIndex=4,this.paths[e].zIndexSubOrder=this.getGroupZIndexSubOrder("paths",e),this.contentGroup.appendChild(this.paths[e]);this.datumSelection=La.select(this.dataNodeGroup,()=>this.nodeFactory(),o),this.markerSelection=La.select(this.markerGroup,()=>this.markerFactory(),a),this.animationState=new ma("empty",{empty:{update:{target:"ready",action:e=>this.animateEmptyUpdateReady(e)},reset:"empty",skip:"ready",disable:"disabled"},ready:{updateData:"waiting",clear:"clearing",highlight:e=>this.animateReadyHighlight(e),highlightMarkers:e=>this.animateReadyHighlightMarkers(e),resize:e=>this.animateReadyResize(e),reset:"empty",skip:"ready",disable:"disabled"},waiting:{update:{target:"ready",action:e=>this.animateWaitingUpdateReady(e)},reset:"empty",skip:"ready",disable:"disabled"},disabled:{update:e=>this.resetAllAnimation(e),reset:"empty"},clearing:{update:{target:"empty",action:e=>this.animateClearingUpdateEmpty(e)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}get contextNodeData(){return this._contextNodeData}getNodeData(){var e;return null==(e=this.contextNodeData)?void 0:e.nodeData}resetAnimation(e){"initial"===e?this.animationState.transition("reset"):"ready"===e?this.animationState.transition("skip"):"disabled"===e&&this.animationState.transition("disable")}addChartEventListeners(){this.destroyFns.push(this.ctx.chartEventManager.addListener("legend-item-click",e=>this.onLegendItemClick(e)),this.ctx.chartEventManager.addListener("legend-item-double-click",e=>this.onLegendItemDoubleClick(e)))}destroy(){super.destroy(),this._contextNodeData=void 0}update(e){return w(this,arguments,function*({seriesRect:e}){var t,i;const{visible:n,_contextNodeData:s}=this,r=(null==(i=null==(t=this.ctx.highlightManager)?void 0:t.getActiveHighlight())?void 0:i.series)===this,o=this.checkResize(e),a=yield this.updateHighlightSelection(r);yield this.updateSelections(n),yield this.updateNodes(a,r,n);const l=this.getAnimationData(e,s);l&&(o&&this.animationState.transition("resize",l),this.animationState.transition("update",l))})}updateSelections(e){return w(this,null,function*(){var t;const i=!this.opts.animationAlwaysUpdateSelections&&this.ctx.animationManager.isSkipped();if((e||!i)&&(this.nodeDataRefresh||this.isPathOrSelectionDirty())){if(this.nodeDataRefresh){this.nodeDataRefresh=!1,this.debug("CartesianSeries.updateSelections() - calling createNodeData() for",this.id),this.markQuadtreeDirty(),this._contextNodeData=yield this.createNodeData();const e=this.isProcessedDataAnimatable();this._contextNodeData&&(null!=(t=this._contextNodeData).animationValid||(t.animationValid=e)),this.minRectsCache.dirtyNodeData=!0;const{dataModel:i,processedData:n}=this;void 0!==i&&void 0!==n&&this.dispatch("data-update",{dataModel:i,processedData:n})}yield this.updateSeriesSelections()}})}updateSeriesSelections(e){return w(this,null,function*(){const{datumSelection:t,labelSelection:i,markerSelection:n,paths:s}=this,r=this._contextNodeData;if(!r)return;const{nodeData:o,labelData:a,itemId:l}=r;yield this.updatePaths({seriesHighlighted:e,itemId:l,contextData:r,paths:s}),this.datumSelection=yield this.updateDatumSelection({nodeData:o,datumSelection:t}),this.labelSelection=yield this.updateLabelSelection({labelData:a,labelSelection:i}),this.opts.hasMarkers&&(this.markerSelection=yield this.updateMarkerSelection({nodeData:o,markerSelection:n}))})}markerFactory(){return new(_u())}getGroupZIndexSubOrder(e,t=0){var i;const n=super.getGroupZIndexSubOrder(e,t);if("paths"===e){const[e]=n,s=null!=(i=this.opts.pathsZIndexSubOrderOffset[t])?i:0;n[0]=Fe(e)?()=>Number(e())+s:Number(e)+s}return n}updateNodes(e,t,i){return w(this,null,function*(){var n;const{highlightSelection:s,highlightLabelSelection:r,opts:{hasMarkers:o,hasHighlightedLabels:a}}=this,l=!this.ctx.animationManager.isSkipped(),c=this.visible&&null!=this._contextNodeData&&i;this.rootGroup.visible=l||c,this.contentGroup.visible=l||c,this.highlightGroup.visible=(l||c)&&t;const h=this.getOpacity();o?(yield this.updateMarkerNodes({markerSelection:s,isHighlight:!0}),this.animationState.transition("highlightMarkers",s)):(yield this.updateDatumNodes({datumSelection:s,isHighlight:!0}),this.animationState.transition("highlight",s)),a&&(yield this.updateLabelNodes({labelSelection:r}));const{dataNodeGroup:u,markerGroup:d,datumSelection:p,labelSelection:g,markerSelection:f,paths:m,labelGroup:y}=this,{itemId:v}=null!=(n=this.contextNodeData)?n:{};u.opacity=h,u.visible=l||c,y.visible=c,o&&(d.opacity=h,d.zIndex=u.zIndex>=4?u.zIndex:u.zIndex+1,d.visible=c),y&&(y.opacity=h),yield this.updatePathNodes({seriesHighlighted:t,itemId:v,paths:m,opacity:h,visible:c,animationEnabled:l}),u.visible&&(yield this.updateDatumNodes({datumSelection:p,highlightedItems:e,isHighlight:!1}),yield this.updateLabelNodes({labelSelection:g}),o&&(yield this.updateMarkerNodes({markerSelection:f,isHighlight:!1})))})}getHighlightLabelData(e,t){const i=e.filter(e=>e.datum===t.datum&&e.itemId===t.itemId);return 0===i.length?void 0:i}getHighlightData(e,t){return t?[t]:void 0}updateHighlightSelection(e){return w(this,null,function*(){var t;const{highlightSelection:i,highlightLabelSelection:n,_contextNodeData:s}=this;if(!s)return;const r=null==(t=this.ctx.highlightManager)?void 0:t.getActiveHighlight(),o=e&&(null==r?void 0:r.datum)?r:void 0;let a,l;if(null!=o){const e=this.isLabelEnabled(),{labelData:t,nodeData:i}=s;l=this.getHighlightData(i,o),a=e?this.getHighlightLabelData(t,o):void 0}return this.highlightSelection=yield this.updateHighlightSelectionItem({items:l,highlightSelection:i}),this.highlightLabelSelection=yield this.updateHighlightSelectionLabel({items:a,highlightLabelSelection:n}),l})}markQuadtreeDirty(){this.quadtree=void 0}*datumNodesIter(){for(const{node:e}of this.datumSelection)!0!==e.datum.missing&&(yield e)}getQuadTree(){if(void 0===this.quadtree){const{width:e,height:t}=this.ctx.scene.canvas,i=new es(0,0,e,t);this.quadtree=new du(100,10,i),this.initQuadTree(this.quadtree)}return this.quadtree}initQuadTree(e){}pickNodeExactShape(e){var t;const i=super.pickNodeExactShape(e);if(i)return i;const{x:n,y:s}=e,{opts:{hasMarkers:r}}=this;let o;const{dataNodeGroup:a,markerGroup:l}=this;if(o=a.pickNode(n,s),!o&&r&&(o=null==l?void 0:l.pickNode(n,s)),o&&!0!==o.datum.missing)return{datum:o.datum,distance:0};for(const i of this.moduleMap.modules()){const{datum:n}=null!=(t=i.pickNodeExact(e))?t:{};if(null!=n&&!0!==(null==n?void 0:n.missing))return{datum:n,distance:0}}}pickNodeClosestDatum(e){var t,i;const{x:n,y:s}=e,{axes:r,rootGroup:o,_contextNodeData:a}=this;if(!a)return;const l=r.x,c=r.y,h=o.transformPoint(n,s);let u,d=1/0;for(const e of a.nodeData){const{point:{x:t=NaN,y:i=NaN}={}}=e;if(isNaN(t)||isNaN(i))continue;if(!(null==l?void 0:l.inRange(t))||!(null==c?void 0:c.inRange(i)))continue;const n=Math.max(p(h.x-t,2)+p(h.y-i,2),0);n<d&&(d=n,u=e)}for(const t of this.moduleMap.modules()){const i=t.pickNodeNearest(e);if(void 0!==i&&i.distanceSquared<d){d=i.distanceSquared,u=i.datum;break}}return u?{datum:u,distance:Math.max(Math.sqrt(d)-(null!=(i=null==(t=u.point)?void 0:t.size)?i:0),0)}:void 0}pickNodeMainAxisFirst(e,t){var i,n,s,r;const{x:o,y:a}=e,{axes:l,rootGroup:c,_contextNodeData:h}=this;if(!h)return;const u=l.x,d=l.y,g=[u,d].filter(e=>e instanceof Tl).map(e=>e.direction);if(t&&0===g.length)return;const[f="x"]=g,m=c.transformPoint(o,a),y="x"===f?[m.x,m.y]:[m.y,m.x],v=[1/0,1/0];let b;for(const e of h.nodeData){const{x:t=NaN,y:s=NaN}=null!=(n=null!=(i=e.point)?i:e.midPoint)?n:{};if(isNaN(t)||isNaN(s)||!0===e.missing)continue;if(!(null==u?void 0:u.inRange(t))||!(null==d?void 0:d.inRange(s)))continue;const r="x"===f?[t,s]:[s,t];let o=!0;for(let e=0;e<r.length;e++){const t=Math.abs(r[e]-y[e]);if(t>v[e]){o=!1;break}t<v[e]&&(v[e]=t,v.fill(1/0,e+1,v.length))}o&&(b=e)}if(b){let t=Math.max(p(v[0],2)+p(v[1],2)-(null!=(r=null==(s=b.point)?void 0:s.size)?r:0),0);for(const i of this.moduleMap.modules()){const n=i.pickNodeMainAxisFirst(e);if(void 0!==n&&n.distanceSquared<t){b=n.datum,t=n.distanceSquared;break}}return{datum:b,distance:Math.sqrt(t)}}}onLegendItemClick(e){const{legendItemName:t}=this.properties,{enabled:i,itemId:n,series:s}=e,r=null!=t&&t===e.legendItemName;(s.id===this.id||r)&&this.toggleSeriesItem(n,i)}onLegendItemDoubleClick(e){const{enabled:t,itemId:i,series:n,numVisibleItems:s}=e,{legendItemName:r}=this.properties,o=null!=r&&r===e.legendItemName;n.id===this.id||o||t&&1===s?this.toggleSeriesItem(i,!0):this.toggleSeriesItem(i,!1)}isPathOrSelectionDirty(){return!1}getLabelData(){return[]}shouldFlipXY(){return!1}getMinRects(e,t){const{dirtyNodeData:i,sizeCache:n,minRect:s,minVisibleRect:r}=this.minRectsCache,o=JSON.stringify({width:e,height:t});if(o===n&&!i&&s&&r)return{minRect:s,minVisibleRect:r};const a=this.computeMinRects(e,t);return this.minRectsCache={dirtyNodeData:!1,sizeCache:o,minRect:null==a?void 0:a.minRect,minVisibleRect:null==a?void 0:a.minVisibleRect},a}computeMinRects(e,t){var i,n;const s=this._contextNodeData;if(!(null==s?void 0:s.nodeData.length))return;const{nodeData:r}=s,o=Array(r.length),a=Array(r.length);for(const[e,{midPoint:t}]of r.entries())o[e]=null!=(i=null==t?void 0:t.x)?i:0,a[e]=null!=(n=null==t?void 0:t.y)?n:0;let l,c,h,u;o.sort((e,t)=>e-t),a.sort((e,t)=>e-t);let d=0,p=0;for(let i=1;i<r.length;i++)o[i]>=0&&(null!=l||(l=i)),o[i]>e&&(null!=c||(c=i)),a[i]>=0&&(null!=h||(h=i)),a[i]>t&&(null!=u||(u=i)),d=Math.max(d,o[i]-o[i-1]),p=Math.max(p,a[i]-a[i-1]);null!=c||(c=r.length),null!=u||(u=r.length);const g=null!=l&&null!=c?o.slice(l,c):[],f=null!=h&&null!=u?a.slice(h,u):[];let m=0,y=0;for(let e=1;e<Math.max(g.length,f.length);e++){const t=g[e],i=g[e-1],n=f[e],s=f[e-1];null!=t&&null!=i&&(m=Math.max(m,t-i)),null!=n&&null!=s&&(y=Math.max(y,n-s))}return{minRect:new es(0,0,d,p),minVisibleRect:new es(0,0,m,y)}}updateHighlightSelectionItem(e){const{opts:{hasMarkers:t}}=this,{items:i,highlightSelection:n}=e,s=null!=i?i:[];if(t){const e=n;return this.updateMarkerSelection({nodeData:s,markerSelection:e})}return this.updateDatumSelection({nodeData:s,datumSelection:n})}updateHighlightSelectionLabel(e){var t;return this.updateLabelSelection({labelData:null!=(t=e.items)?t:[],labelSelection:e.highlightLabelSelection})}updateDatumSelection(e){return w(this,null,function*(){return e.datumSelection})}updateDatumNodes(e){return w(this,null,function*(){})}updateMarkerSelection(e){return w(this,null,function*(){return e.markerSelection})}updateMarkerNodes(e){return w(this,null,function*(){})}updatePaths(e){return w(this,null,function*(){e.paths.forEach(e=>e.visible=!1)})}updatePathNodes(e){return w(this,null,function*(){const{paths:t,opacity:i,visible:n}=e;for(const e of t)e.opacity=i,e.visible=n})}resetAllAnimation(e){var t,i,n;const{path:s,datum:r,label:o,marker:a}=null!=(i=null==(t=this.opts)?void 0:t.animationResetFns)?i:{};this.ctx.animationManager.stopByAnimationGroupId(this.id),s&&e.paths.forEach(e=>{fa([e],s)}),r&&fa([e.datumSelection],r),o&&fa([e.labelSelection],o),a&&this.opts.hasMarkers&&fa([e.markerSelection],a),!1===(null==(n=e.contextData)?void 0:n.animationValid)&&this.ctx.animationManager.skipCurrentBatch()}animateEmptyUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateWaitingUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateReadyHighlight(e){var t,i;const{datum:n}=null!=(i=null==(t=this.opts)?void 0:t.animationResetFns)?i:{};n&&fa([e],n)}animateReadyHighlightMarkers(e){var t,i;const{marker:n}=null!=(i=null==(t=this.opts)?void 0:t.animationResetFns)?i:{};n&&fa([e],n)}animateReadyResize(e){this.resetAllAnimation(e)}animateClearingUpdateEmpty(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animationTransitionClear(){const e=this.getAnimationData();e&&this.animationState.transition("clear",e)}getAnimationData(e,t){const{_contextNodeData:i}=this;if(i)return{datumSelection:this.datumSelection,markerSelection:this.markerSelection,labelSelection:this.labelSelection,annotationSelections:[...this.annotationSelections],contextData:i,previousContextData:t,paths:this.paths,seriesRect:e}}calculateScaling(){const e={};for(const t of Object.values(jr)){const i=this.axes[t];if(i)if(i.scale instanceof _a){const{range:n,domain:s}=i.scale;e[t]={type:"log",convert:e=>i.scale.convert(e),domain:[s[0],s[1]],range:[n[0],n[1]]}}else if(i.scale instanceof qr){const{range:n}=i.scale,s=i.scale.getDomain();e[t]={type:"continuous",domain:[s[0],s[1]],range:[n[0],n[1]]}}else if(i.scale){const{domain:n}=i.scale;e[t]={type:"category",domain:n,range:n.map(e=>i.scale.convert(e))}}}return e}},ju=["top","right","bottom","left"],$u=class e extends su{constructor(e,t){super(e,t),this.paired=!0,this.firstSeriesTranslation=!0,this._lastCrossLineIds=void 0,this._lastAxisWidths={top:0,bottom:0,left:0,right:0},this._lastClipSeries=!1,this._lastVisibility={crossLines:!0,series:!0}}onAxisChange(e,t){super.onAxisChange(e,t),this.zoomManager.updateAxes(e)}destroySeries(e){super.destroySeries(e),this.firstSeriesTranslation=!0}performLayout(){return w(this,null,function*(){const t=yield C(e.prototype,this,"performLayout").call(this),{firstSeriesTranslation:i,seriesRoot:n,annotationRoot:s,highlightRoot:r}=this,{animationRect:o,seriesRect:a,visibility:l,clipSeries:c}=this.updateAxes(t);this.seriesRoot.visible=l.series,this.seriesRect=a,this.animationRect=o;const{x:h,y:u}=a;if(i){for(const e of[n,s,r])e.translationX=Math.floor(h),e.translationY=Math.floor(u);this.firstSeriesTranslation=!1}else{const{translationX:e,translationY:t}=n;ks(this.id,"seriesRect",this.ctx.animationManager,[n,r,s],{translationX:e,translationY:t},{translationX:Math.floor(h),translationY:Math.floor(u)},{phase:"update"})}const d=a.clone().grow(this.seriesArea.padding);this.hoverRect=d;const p=this.seriesArea.clip||c?d:void 0;n.setClipRectInGroupCoordinateSpace(p),r.setClipRectInGroupCoordinateSpace(p),s.setClipRectInGroupCoordinateSpace(p),this.ctx.layoutService.dispatchLayoutComplete({type:"layout-complete",chart:{width:this.ctx.scene.width,height:this.ctx.scene.height},clipSeries:c,series:{rect:a,paddedRect:d,visible:l.series,shouldFlipXY:this.shouldFlipXY()},axes:this.axes.map(e=>f({id:e.id},e.getLayoutState()))});const g=this.modulesManager.mapModules(e=>{var t;return null==(t=e.performCartesianLayout)?void 0:t.call(e,{seriesRect:a})});return yield Promise.all(g),t})}updateAxes(e){var t;const i=this.axes.flatMap(e=>{var t;return null!=(t=e.crossLines)?t:[]}).map(e=>e.id);let n,s,r;null!=this._lastCrossLineIds&&this._lastCrossLineIds.length===i.length&&this._lastCrossLineIds.every((e,t)=>i[t]===e)?(n=f({},this._lastAxisWidths),s=this._lastClipSeries,r=f({},this._lastVisibility)):(n={top:0,bottom:0,left:0,right:0},s=!1,r={crossLines:!0,series:!0},this._lastCrossLineIds=i);const o=new Set(this.axes.map(e=>e.position));for(const e of Object.keys(n))o.has(e)||delete n[e];const a=(e,t,i)=>!Object.keys(e).some(e=>null==n[e])&&r.crossLines===i.crossLines&&r.series===i.series&&Object.entries(n).every(([t,i])=>{const n=e[t];return null==i&&null==n||i===n})&&s===t,l=e=>Ze(e,e=>e&&Math.abs(e)===1/0?0:null!=e?Math.ceil(e):e);let c={},h={},u=!1,d=null==(t=this.seriesRect)?void 0:t.clone(),p=0,g={};do{Object.assign(n,c),s=u,Object.assign(r,h);const t=this.updateAxesPass(n,e.clone(),d);if(c=l(t.axisWidths),h=t.visibility,u=t.clipSeries,d=t.seriesRect,g=t.primaryTickCounts,p++>10){L.warn("unable to find stable axis layout.");break}}while(!a(c,u,h));return this.axes.forEach(e=>{e.update(g[e.direction])}),this.axes.forEach(t=>{if(t.setCrossLinesVisible(r.crossLines),d)switch(t.clipGrid(d.x,d.y,d.width+5,d.height+5),t.position){case"left":case"right":t.clipTickLines(e.x,d.y,e.width+5,d.height+5);break;case"top":case"bottom":t.clipTickLines(d.x,e.y,d.width+5,e.height+5)}}),this._lastAxisWidths=n,this._lastVisibility=r,{seriesRect:d,animationRect:e,visibility:r,clipSeries:s}}updateAxesPass(e,t,i){const n={},s={},r={series:!0,crossLines:!0};let o=!1;const a={},l=this.applySeriesPadding(t),c=i?this.buildCrossLinePadding(e):{},h=this.buildAxisBound(l,e,c,r),u=this.buildSeriesRect(h,e);return this.axes.forEach(t=>{var i,r;const{position:c="left"}=t,{clipSeries:d,axisThickness:p,axisOffset:g}=this.calculateAxisDimensions({axis:t,seriesRect:u,paddedBounds:l,axisWidths:e,newAxisWidths:s,primaryTickCounts:a,clipSeries:o,addInterAxisPadding:(null!=(i=n[c])?i:0)>0});n[c]=(null!=(r=n[c])?r:0)+1,o=o||d,this.positionAxis({axis:t,axisBound:h,axisOffset:g,axisThickness:p,axisWidths:e,primaryTickCounts:a,seriesRect:u})}),{clipSeries:o,seriesRect:u,axisWidths:s,visibility:r,primaryTickCounts:a}}buildCrossLinePadding(e){var t;const i={};this.axes.forEach(e=>{e.crossLines&&e.crossLines.forEach(e=>{var t;null==(t=e.calculatePadding)||t.call(e,i)})});for(const[n,s=0]of Object.entries(i))i[n]=Math.max(s-(null!=(t=e[n])?t:0),0);return i}applySeriesPadding(e){const t=e.clone(),i=this.axes.slice().reverse();return ju.forEach(e=>{const n=this.seriesArea.padding[e],s=i.find(t=>t.position===e);s?s.seriesAreaPadding=n:t.shrink(n,e)}),t}buildAxisBound(e,t,i,n){var s,r,o,a;const l=e.clone(),{top:c=0,right:h=0,bottom:u=0,left:d=0}=i,p=d+h,g=c+u,f=(null!=(s=t.left)?s:0)+(null!=(r=t.right)?r:0)+p,m=(null!=(o=t.top)?o:0)+(null!=(a=t.bottom)?a:0)+g;return l.width<=f||l.height<=m?(n.crossLines=!1,n.series=!1,l):(l.x+=d,l.y+=c,l.width-=p,l.height-=g,l)}buildSeriesRect(e,t){const i=e.clone(),{top:n,bottom:s,left:r,right:o}=t;return i.x+=null!=r?r:0,i.y+=null!=n?n:0,i.width-=(null!=r?r:0)+(null!=o?o:0),i.height-=(null!=n?n:0)+(null!=s?s:0),i.width=Math.max(0,i.width),i.height=Math.max(0,i.height),i}clampToOutsideSeriesRect(e,t,i,n){const{x:s,y:r,width:o,height:a}=e,l=[s,r,s+o,r+a][("x"===i?0:1)+(1===n?0:2)];return(1===n?Math.min:Math.max)(t,l)}calculateAxisDimensions(e){var t,i,n;const{axis:s,seriesRect:r,paddedBounds:o,axisWidths:a,newAxisWidths:l,primaryTickCounts:c,addInterAxisPadding:h}=e;let{clipSeries:u}=e;const{position:d="left",direction:p}=s,g=s instanceof Tl||s instanceof Gl,f="left"===d||"right"===d,m=null!=(t=l[d])?t:0,{min:y,max:v}=this.ctx.zoomManager.getAxisZoom(s.id);f?(g?(s.range=[0,r.height],s.visibleRange=[1-v,1-y]):(s.range=[r.height,0],s.visibleRange=[y,v]),s.gridLength=r.width):(s.range=[0,r.width],s.visibleRange=[y,v],s.gridLength=r.height);let b=s.nice?c[p]:void 0;const C="y"===p;s.thickness?s.maxThickness=s.thickness:s.maxThickness=.3*(C?o.width:o.height);const w=s.calculateLayout(b);let S;if(b=w.primaryTickCount,null!=c[p]||(c[p]=b),u||(u=s.dataDomain.clipped||s.visibleRange[0]>0||s.visibleRange[1]<1),null!=s.thickness&&s.thickness>0)S=s.thickness;else{const{bbox:e}=w;S=C?e.width:e.height}return h&&(S+=15),S=Math.ceil(S),l[d]=(null!=(i=l[d])?i:0)+S,s.gridPadding=(null!=(n=a[d])?n:0)-l[d],{clipSeries:u,axisThickness:S,axisOffset:m,primaryTickCount:b}}positionAxis(e){var t,i,n,s;const{axis:r,axisBound:o,axisWidths:a,seriesRect:l,axisOffset:c,axisThickness:h}=e,{position:u}=r;switch(u){case"top":r.translation.x=o.x+(null!=(t=a.left)?t:0),r.translation.y=this.clampToOutsideSeriesRect(l,o.y+1+c+h,"y",1);break;case"bottom":r.translation.x=o.x+(null!=(i=a.left)?i:0),r.translation.y=this.clampToOutsideSeriesRect(l,o.y+o.height+1-h-c,"y",-1);break;case"left":r.translation.y=o.y+(null!=(n=a.top)?n:0),r.translation.x=this.clampToOutsideSeriesRect(l,o.x+c+h,"x",1);break;case"right":r.translation.y=o.y+(null!=(s=a.top)?s:0),r.translation.x=this.clampToOutsideSeriesRect(l,o.x+o.width-h-c,"x",-1)}r.updatePosition({rotation:Gs(r.rotation),sideFlag:r.label.getSideFlag()})}shouldFlipXY(){return!this.series.some(e=>!(e instanceof Wu&&e.shouldFlipXY()))}};$u.className="CartesianChart",$u.type="cartesian";var Ku=$u,Yu=class e{static isInstance(t){var i;return t instanceof e||"AgChartInstanceProxy"===(null==(i=t.constructor)?void 0:i.name)&&null!=t.chart||null!=t.chart&&this.validateImplementation(t)}static validateImplementation(e){var t;const i=Object.keys(null!=(t=Object.getPrototypeOf(e))?t:{});return["getOptions","destroy"].every(e=>i.includes(e))}constructor(e){this.chart=e}getOptions(){return St(this.chart.getOptions())}resetAnimations(){this.chart.resetAnimations()}skipAnimations(){this.chart.skipAnimations()}destroy(){this.chart.destroy()}};Yu.chartInstances=new WeakMap,b([qa({oldValue(e){Yu.chartInstances.delete(e)},newValue(e){Yu.chartInstances.set(e,this)}})],Yu.prototype,"chart",2);var qu=Yu,Xu=class extends qr{constructor(){super([0,1],[0,1]),this.type="number"}toDomain(e){return e}ticks(){var e;const t=null!=(e=this.tickCount)?e:qr.defaultTickCount;if(!this.domain||this.domain.length<2||t<1||this.domain.some(e=>!isFinite(e)))return[];this.refresh();const[i,n]=this.getDomain(),{interval:s}=this;if(s){const e=Math.abs(s);if(!go({start:i,stop:n,interval:e,availableRange:this.getPixelRange()}))return po(i,n,e)}return co(i,n,t,this.minTickCount,this.maxTickCount)}update(){!this.domain||this.domain.length<2||this.nice&&this.updateNiceDomain()}getTickStep(e,t){var i,n;const s=null!=(i=this.tickCount)?i:qr.defaultTickCount;return null!=(n=this.interval)?n:uo(e,t,s,this.minTickCount,this.maxTickCount)}updateNiceDomain(){var e;const t=null!=(e=this.tickCount)?e:qr.defaultTickCount;if(t<1)return void(this.niceDomain=[...this.domain]);let[i,n]=this.domain;if(1===t)[i,n]=function(e,t){const i=Math.abs(t-e),n=Math.floor(Math.log10(i)),s=Math.pow(10,n),r=e>t?Math.ceil:Math.floor,o=t<e?Math.floor:Math.ceil;return ho.map(n=>{const a=n*s,l=r(e/a)*a,c=o(t/a)*a;return{error:1-i/Math.abs(c-l),domain:[l,c]}}).sort((e,t)=>e.error-t.error)[0].domain}(i,n);else{const e=i>n?Math.ceil:Math.floor,t=n<i?Math.floor:Math.ceil,s=4;for(let r=0;r<s;r++){const s=i,r=n,o=this.getTickStep(i,n),[a,l]=this.domain;if(o>=1)i=e(a/o)*o,n=t(l/o)*o;else{const s=1/o;i=e(a*s)/s,n=t(l*s)/s}if(i===s&&n===r)break}}this.niceDomain=[i,n]}tickFormat({ticks:e,specifier:t}){return ka(null!=e?e:this.ticks(),t)}};var Zu=class extends Wr{constructor(){super(...arguments),this.minSpacing=NaN,this.maxSpacing=NaN}};b([$s(Fr),js(NaN)],Zu.prototype,"minSpacing",2),b([$s(Gr),js(NaN)],Zu.prototype,"maxSpacing",2);var Qu=class extends Al{constructor(e,t=new Xu){super(e,t),this.min=NaN,this.max=NaN}normaliseDataDomain(e){const{min:t,max:i}=this,{extent:n,clipped:s}=hn(e,t,i);return{domain:n,clipped:s}}createTick(){return new Zu}updateSecondaryAxisTicks(e){if(null==this.dataDomain)throw new Error("AG Charts - dataDomain not calculated, cannot perform tick calculation.");if(0===this.dataDomain.domain.length)return[];const[t,i]=function(e,t,i){let[n,s]=zn(e);n=function(e,t,i){const n=Math.abs(t-e)/(i-1),s=Math.floor(Math.log10(n)),r=Math.pow(10,s);return Math.floor(e/r)*r}(Math.floor(n),s,t);const r=function(e,t,i){return function(e){const t=Math.floor(Math.log10(e)),i=Math.pow(10,t),n=e/i*10;return n>0&&n<=1?i/10:n>1&&n<=2?2*i/10:n>1&&n<=5?5*i/10:n>5&&n<=10?10*i/10:n>10&&n<=20?20*i/10:n>20&&n<=40?40*i/10:n>40&&n<=50?50*i/10:n>50&&n<=100?100*i/10:n}((t-e)/(i-1))}(n,s,t);s=n+(t-1)*r;const o=i?[s,n]:[n,s],a=function(e,t,i){const n=Math.floor(Math.log10(t)),s=t>0&&t<1?Math.abs(n):0,r=Math.pow(10,s),o=lo(s);for(let n=0;n<i;n++){const i=e+t*n;o[n]=Math.round(i*r)/r}return o}(n,r,t);return[o,a]}(this.dataDomain.domain,null!=e?e:0,this.reverse);return this.scale.nice=!1,this.scale.domain=t,this.scale.update(),i}formatDatum(e){return"number"==typeof e?e.toFixed(2):String(e)}};Qu.className="NumberAxis",Qu.type="number",b([$s(Ys(or,hr("max"))),js(NaN)],Qu.prototype,"min",2),b([$s(Ys(or,ur("min"))),js(NaN)],Qu.prototype,"max",2);var Ju=Br(e=>Ue(e)&&0!==e,"a non-zero number"),ed=class extends Qu{constructor(e){super(e,new _a),this.min=NaN,this.max=NaN}normaliseDataDomain(e){const{min:t,max:i}=this,{extent:n,clipped:s}=hn(e,t,i),r=n[0]>n[1],o=n[0]<0&&n[1]>0,a=0===n[0]&&0===n[1];return(r||o||a)&&(o?L.warn("the data domain crosses zero, the chart data cannot be rendered. See log axis documentation for more information."):a&&L.warn("the data domain has 0 extent, no data is rendered.")),0===n[0]&&(n[0]=1),0===n[1]&&(n[1]=-1),{domain:n,clipped:s}}set base(e){this.scale.base=e}get base(){return this.scale.base}};ed.className="LogAxis",ed.type="log",b([$s(Ys(or,Ju,hr("max"))),js(NaN)],ed.prototype,"min",2),b([$s(Ys(or,Ju,ur("min"))),js(NaN)],ed.prototype,"max",2);var td=class extends Wr{constructor(){super(...arguments),this.minSpacing=NaN,this.maxSpacing=NaN}};b([$s(Fr),js(NaN)],td.prototype,"minSpacing",2),b([$s(Gr),js(NaN)],td.prototype,"maxSpacing",2);var id=class extends Al{constructor(e){super(e,new mo),this.min=void 0,this.max=void 0,this.refreshScale()}normaliseDataDomain(e){var t;let{min:i,max:n}=this,s=!1;return"number"==typeof i&&(i=new Date(i)),"number"==typeof n&&(n=new Date(n)),e.length>2&&(e=(null!=(t=ln(e))?t:[0,1e3]).map(e=>new Date(e))),i instanceof Date&&(s||(s=i>e[0]),e=[i,e[1]]),n instanceof Date&&(s||(s=n<e[1]),e=[e[0],n]),e[0]>e[1]&&(e=[]),{domain:e,clipped:s}}createTick(){return new td}onLabelFormatChange(e,t,i){i?super.onLabelFormatChange(e,t,i):this.labelFormatter=this.scale.tickFormat({ticks:e,domain:t})}calculatePadding(){return[0,0]}formatDatum(e){var t;const i=this.scale.tickFormat({specifier:"%m/%d/%y, %H:%M:%S"});return null!=(t=this.moduleCtx.callbackCache.call(i,e))?t:String(e)}};id.className="TimeAxis",id.type="time",b([$s(Ys(pr,hr("max")),{optional:!0})],id.prototype,"min",2),b([$s(Ys(pr,ur("min")),{optional:!0})],id.prototype,"max",2);var nd=1e-6,sd=(e,t,i,n,s)=>{let r=!1,o=!1,a=n-Math.sqrt(Math.max(p(s,2)-p(i,2),0)),l=0,c=0,h=i-Math.sqrt(Math.max(p(s,2)-p(n,2),0));return a>e?(r=!0,a=e,l=i-Math.sqrt(Math.max(p(s,2)-p(n-e,2)))):a<nd&&(a=0),h>t?(o=!0,c=n-Math.sqrt(Math.max(p(s,2)-p(i-t,2))),h=t):h<nd&&(h=0),{leading0:a,leading1:l,trailing0:c,trailing1:h,leadingClipped:r,trailingClipped:o}},rd=(e,{x0:t,y0:i,x1:n,y1:s,cx:r,cy:o},a,l)=>{if(l&&e.moveTo(t,i),t!==n||i!==s){const l=Math.atan2(i-o,t-r),c=Math.atan2(s-o,n-r);e.arc(r,o,a,l,c)}else e.lineTo(t,i)},od=(e,t,i,n,s,r,o)=>{let{topLeft:a,topRight:l,bottomRight:c,bottomLeft:h}=r;const u=Math.max(a+h,l+c),d=Math.max(a+l,h+c);if(u<=0&&d<=0)return void(null==o?e.rect(t,i,n,s):e.rect(o.x,o.y,o.width,o.height));if(null==o&&a===l&&a===c&&a===h)return void e.roundRect(t,i,n,s,a);if(n<0&&(t+=n,n=Math.abs(n)),s<0&&(i+=s,s=Math.abs(s)),n<=0||s<=0)return;if(null==o)o=new es(t,i,n,s);else{const e=Math.max(t,o.x),r=Math.min(t+n,o.x+o.width),a=Math.max(i,o.y),l=Math.min(i+s,o.y+o.height);o=new es(e,a,r-e,l-a)}const p=Math.max(u/s,d/n,1);p>1&&(a/=p,l/=p,c/=p,h/=p);let g,f,m,y,v=!0,b=!0,C=!0,w=!0;if(v){const e=sd(o.height,o.width,Math.max(t+a-o.x,0),Math.max(i+a-o.y,0),a);e.leadingClipped&&(w=!1),e.trailingClipped&&(b=!1),g={x0:Math.max(o.x+e.leading1,o.x),y0:Math.max(o.y+e.leading0,o.y),x1:Math.max(o.x+e.trailing1,o.x),y1:Math.max(o.y+e.trailing0,o.y),cx:t+a,cy:i+a}}if(b){const e=sd(o.width,o.height,Math.max(i+l-o.y,0),Math.max(o.x+o.width-(t+n-l),0),l);e.leadingClipped&&(v=!1),e.trailingClipped&&(C=!1),f={x0:Math.min(o.x+o.width-e.leading0,o.x+o.width),y0:Math.max(o.y+e.leading1,o.y),x1:Math.min(o.x+o.width-e.trailing0,o.x+o.width),y1:Math.max(o.y+e.trailing1,o.y),cx:t+n-l,cy:i+l}}if(C){const e=sd(o.height,o.width,Math.max(o.x+o.width-(t+n-c),0),Math.max(o.y+o.height-(i+s-c),0),c);e.leadingClipped&&(b=!1),e.trailingClipped&&(w=!1),m={x0:Math.min(o.x+o.width-e.leading1,o.x+o.width),y0:Math.min(o.y+o.height-e.leading0,o.y+o.height),x1:Math.min(o.x+o.width-e.trailing1,o.x+o.width),y1:Math.min(o.y+o.height-e.trailing0,o.y+o.height),cx:t+n-c,cy:i+s-c}}if(w){const e=sd(o.width,o.height,Math.max(o.y+o.height-(i+s-h),0),Math.max(t+h-o.x,0),h);e.leadingClipped&&(C=!1),e.trailingClipped&&(v=!1),y={x0:Math.max(o.x+e.leading0,o.x),y0:Math.min(o.y+o.height-e.leading1,o.y+o.height),x1:Math.max(o.x+e.trailing0,o.x),y1:Math.min(o.y+o.height-e.trailing1,o.y+o.height),cx:t+h,cy:i+s-h}}let S=!1;v&&null!=g&&(rd(e,g,a,!S),S||(S=!0)),b&&null!=f&&(rd(e,f,l,!S),S||(S=!0)),C&&null!=m&&(rd(e,m,c,!S),S||(S=!0)),w&&null!=y&&(rd(e,y,h,!S),S||(S=!0)),e.closePath()},ad=class extends uu{constructor(){super(...arguments),this.borderPath=new cu,this.x=0,this.y=0,this.width=10,this.height=10,this.topLeftCornerRadius=0,this.topRightCornerRadius=0,this.bottomRightCornerRadius=0,this.bottomLeftCornerRadius=0,this.clipBBox=void 0,this.crisp=!1,this.lastUpdatePathStrokeWidth=Do.defaultStyles.strokeWidth,this.effectiveStrokeWidth=Do.defaultStyles.strokeWidth,this.hittester=super.isPointInPath,this.distanceCalculator=super.distanceSquared,this.microPixelEffectOpacity=1}set cornerRadius(e){this.topLeftCornerRadius=e,this.topRightCornerRadius=e,this.bottomRightCornerRadius=e,this.bottomLeftCornerRadius=e}isDirtyPath(){return this.lastUpdatePathStrokeWidth!==this.strokeWidth||Boolean(this.path.isDirty()||this.borderPath.isDirty())}updatePath(){var e,t,i;const{path:n,borderPath:s,crisp:r,topLeftCornerRadius:o,topRightCornerRadius:a,bottomRightCornerRadius:l,bottomLeftCornerRadius:c}=this;let{x:h,y:u,width:d,height:p,strokeWidth:g,clipBBox:f}=this;const m=1/(null!=(t=null==(e=this.layerManager)?void 0:e.canvas.pixelRatio)?t:1);let y=1;if(n.clear(!0),s.clear(!0),r&&(d<=m&&(y*=d/m),p<=m&&(y*=p/m),d=this.align(h,d),p=this.align(u,p),h=this.align(h),u=this.align(u),f=null!=f?new es(this.align(f.x),this.align(f.y),this.align(f.x,f.width),this.align(f.y,f.height)):void 0),g)if(d<m){const e=h+m/2;s.moveTo(e,u),s.lineTo(e,u+p),g=m,this.borderClipPath=void 0}else if(p<m){const e=u+m/2;s.moveTo(h,e),s.lineTo(h+d,e),g=m,this.borderClipPath=void 0}else if(g<d&&g<p){const e=g/2;h+=e,u+=e,d-=g,p-=g;const t=null==f?void 0:f.clone().shrink(e),i={topLeft:o>0?o-g:0,topRight:a>0?a-g:0,bottomRight:l>0?l-g:0,bottomLeft:c>0?c-g:0};this.borderClipPath=void 0,d>0&&p>0&&(null==t||(null==t?void 0:t.width)>0&&(null==t?void 0:t.height)>0)&&(od(n,h,u,d,p,i,t),od(s,h,u,d,p,i,t))}else this.borderClipPath=null!=(i=this.borderClipPath)?i:new cu,this.borderClipPath.clear(!0),this.borderClipPath.rect(h,u,d,p),s.rect(h,u,d,p);else{const e={topLeft:o,topRight:a,bottomRight:l,bottomLeft:c};this.borderClipPath=void 0,od(n,h,u,d,p,e,f)}[o,a,l,c].every(e=>0===e)?(this.hittester=(e,t)=>{const i=this.transformPoint(e,t);return this.getCachedBBox().containsPoint(i.x,i.y)},this.distanceSquared=(e,t)=>this.getCachedBBox().distanceSquared(e,t)):(this.hittester=super.isPointInPath,this.distanceCalculator=super.distanceSquared),this.effectiveStrokeWidth=g,this.lastUpdatePathStrokeWidth=g,this.microPixelEffectOpacity=y}computeBBox(){var e;const{x:t,y:i,width:n,height:s,clipBBox:r}=this;return null!=(e=null==r?void 0:r.clone())?e:new es(t,i,n,s)}isPointInPath(e,t){return this.hittester(e,t)}get midPoint(){return{x:this.x+this.width/2,y:this.y+this.height/2}}distanceSquared(e,t){return this.distanceCalculator(e,t)}applyFillAlpha(e){const{fillOpacity:t,microPixelEffectOpacity:i,opacity:n}=this;e.globalAlpha*=n*t*i}renderStroke(e){const{stroke:t,effectiveStrokeWidth:i}=this;if(t&&i){const{globalAlpha:n}=e,{strokeOpacity:s,lineDash:r,lineDashOffset:o,lineCap:a,lineJoin:l,borderPath:c,borderClipPath:h,opacity:u,microPixelEffectOpacity:d}=this;h&&e.clip(h.getPath2D()),e.strokeStyle=t,e.globalAlpha*=u*s*d,e.lineWidth=i,r&&e.setLineDash(r),o&&(e.lineDashOffset=o),a&&(e.lineCap=a),l&&(e.lineJoin=l),e.stroke(c.getPath2D()),e.globalAlpha=n}}};ad.className="Rect",b([hu()],ad.prototype,"x",2),b([hu()],ad.prototype,"y",2),b([hu()],ad.prototype,"width",2),b([hu()],ad.prototype,"height",2),b([hu()],ad.prototype,"topLeftCornerRadius",2),b([hu()],ad.prototype,"topRightCornerRadius",2),b([hu()],ad.prototype,"bottomRightCornerRadius",2),b([hu()],ad.prototype,"bottomLeftCornerRadius",2),b([hu()],ad.prototype,"clipBBox",2),b([hu()],ad.prototype,"crisp",2);var ld=class extends we{constructor(e){super(),this.node=new xo({name:"background",zIndex:0}),this.rectNode=new ad,this.visible=!0,this.fill="white",this.node.appendChild(this.rectNode),this.destroyFns.push(e.scene.attachNode(this.node),e.layoutService.addListener("layout-complete",e=>this.onLayoutComplete(e)))}onLayoutComplete(e){const{width:t,height:i}=e.chart;this.rectNode.width=t,this.rectNode.height=i}};b([$s(Qs),Ya("node","visible")],ld.prototype,"visible",2),b([$s(fr,{optional:!0}),Ya("rectNode","fill")],ld.prototype,"fill",2),b([$s(Xs,{optional:!0})],ld.prototype,"image",2);var cd={type:"root",optionsKey:"background",packageType:"community",chartTypes:["cartesian","polar","hierarchy","topology"],instanceConstructor:ld};function hd({orientation:e,bboxes:t,maxHeight:i,maxWidth:n,itemPaddingY:s=0,itemPaddingX:r=0,forceResult:o=!1}){const a="horizontal"===e,l={max:a?n:i,fn:a?e=>e.width:e=>e.height,padding:a?r:s},c={max:a?i:n,fn:a?e=>e.height:e=>e.width,padding:a?s:r};let h=0;const u=[];for(;h<t.length;){const e=ud(t.slice(h),h,l,c,o);if(!e)return;h+=e.processedBBoxCount,u.push(e.pageIndices)}return function(e,t,i,n,s){let r=0,o=0;return{pages:e.map(e=>{"horizontal"===t&&(e=function(e){const t=[];for(const i of e[0])t.push([]);return e.forEach((e,i)=>{e.forEach((e,n)=>{t[n][i]=e})}),t}(e));let a=0;const l=e.map(e=>{const t=e.map(e=>(a=Math.max(e,a),i[e]));let r=0,o=0;return t.forEach(e=>{r+=e.height+n,o=Math.max(o,e.width+s)}),{indices:e,bboxes:t,columnHeight:Math.ceil(r),columnWidth:Math.ceil(o)}});let c=0,h=0;return l.forEach(e=>{c+=e.columnWidth,h=Math.max(h,e.columnHeight)}),r=Math.max(c,r),o=Math.max(h,o),{columns:l,startIndex:e[0][0],endIndex:a,pageWidth:c,pageHeight:h}}),maxPageWidth:r,maxPageHeight:o}}(u,e,t,s,r)}function ud(e,t,i,n,s){let r=function(e,t){const i=e.length;let n=0;for(let s=0;s<i;s++)if(n+=t.fn(e[s])+t.padding,n>t.max)return i/s<2?Math.ceil(i/2):s;return i}(e,i);if(r<1){if(!s)return;r=1}let o=r;for(;o>=1;){const r=dd(e,t,o,i,n,s);if(null==r&&o<=1)return;if(null!=r){if("number"!=typeof r)return{processedBBoxCount:r.length*r[0].length,pageIndices:r};if(r<=1)return;o=r<o&&r>1?r:o,o--}else o--}}function dd(e,t,i,n,s,r){var o;const a=[];let l=0,c=0,h=[];const u=[];for(let d=0;d<e.length;d++){const p=(d+i)%i;0===p&&(l+=c,c=0,h.length>0&&a.push(h),h=[]);const g=n.fn(e[d])+n.padding;u[p]=Math.max(null!=(o=u[p])?o:0,g),c=Math.max(c,s.fn(e[d])+s.padding);const f=l+c,m=!r||a.length>0;if(f>s.max&&m){h=[];break}if(u.reduce((e,t)=>e+t,0)>n.max&&!r)return u.length<i?u.length:void 0;h.push(d+t)}return h.length>0&&a.push(h),a.length>0?a:void 0}var pd=class extends xo{constructor(){super({name:"markerLabelGroup"}),this.label=new Oo,this.line=new Ga,this._marker=new Mu,this._markerSize=15,this._spacing=8;const{marker:e,label:t,line:i}=this;t.textBaseline="middle",t.fontSize=12,t.fontFamily="Verdana, sans-serif",t.fill="black",t.y=1,this.append([i,e,t]),this.update()}set marker(e){this._marker!==e&&(this.removeChild(this._marker),this._marker=e,this.appendChild(e),this.update())}get marker(){return this._marker}set markerSize(e){this._markerSize!==e&&(this._markerSize=e,this.update())}get markerSize(){return this._markerSize}set spacing(e){this._spacing!==e&&(this._spacing=e,this.update())}get spacing(){return this._spacing}setSeriesStrokeOffset(e){const t=this.marker.size/2+e;this.line.x1=-t,this.line.x2=t,this.line.y1=0,this.line.y2=0,this.line.markDirtyTransform(),this.update()}update(){const{markerSize:e}=this,t=this.marker.constructor.center;this.marker.size=e,this.marker.x=(t.x-.5)*e,this.marker.y=(t.y-.5)*e;const i=this.line.visible?this.line.x2:-1/0,n=e/2;this.label.x=Math.max(i,n)+this.spacing}render(e){this.marker.opacity=this.opacity,this.label.opacity=this.opacity,this.line.opacity=this.opacity,super.render(e)}};pd.className="MarkerLabel",b([Ya("label")],pd.prototype,"text",2),b([Ya("label")],pd.prototype,"fontStyle",2),b([Ya("label")],pd.prototype,"fontWeight",2),b([Ya("label")],pd.prototype,"fontSize",2),b([Ya("label")],pd.prototype,"fontFamily",2),b([Ya("label","fill")],pd.prototype,"color",2),b([Ya("marker","fill")],pd.prototype,"markerFill",2),b([Ya("marker","stroke")],pd.prototype,"markerStroke",2),b([Ya("marker","strokeWidth")],pd.prototype,"markerStrokeWidth",2),b([Ya("marker","fillOpacity")],pd.prototype,"markerFillOpacity",2),b([Ya("marker","strokeOpacity")],pd.prototype,"markerStrokeOpacity",2),b([Ya("marker","visible")],pd.prototype,"markerVisible",2),b([Ya("line","stroke")],pd.prototype,"lineStroke",2),b([Ya("line","strokeWidth")],pd.prototype,"lineStrokeWidth",2),b([Ya("line","strokeOpacity")],pd.prototype,"lineStrokeOpacity",2),b([Ya("line","lineDash")],pd.prototype,"lineLineDash",2),b([Ya("line","visible")],pd.prototype,"lineVisible",2);var gd=class extends yt{constructor(){super(...arguments),this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=12,this.fontFamily="Verdana, sans-serif"}};b([$s(fr)],gd.prototype,"color",2),b([$s(Mr,{optional:!0})],gd.prototype,"fontStyle",2),b([$s(Tr,{optional:!0})],gd.prototype,"fontWeight",2),b([$s(nr)],gd.prototype,"fontSize",2),b([$s(er)],gd.prototype,"fontFamily",2);var fd=class extends yt{constructor(){super(...arguments),this.size=15,this.fill=void 0,this.fillOpacity=void 0,this.stroke=void 0,this.strokeWidth=1,this.strokeOpacity=1}};b([$s(nr)],fd.prototype,"size",2),b([$s(fr,{optional:!0})],fd.prototype,"fill",2),b([$s(sr,{optional:!0})],fd.prototype,"fillOpacity",2),b([$s(fr,{optional:!0})],fd.prototype,"stroke",2),b([$s(nr)],fd.prototype,"strokeWidth",2),b([$s(sr)],fd.prototype,"strokeOpacity",2);var md=class extends yt{constructor(e){super(),this.parent=e,this.shape=Iu,this.size=15,this.padding=8}};b([qa({changeValue(){this.parent.marker===this&&this.parent.onMarkerShapeChange()}})],md.prototype,"shape",2),b([$s(nr)],md.prototype,"size",2),b([$s(nr)],md.prototype,"padding",2);var yd=class extends yt{constructor(e,t,i,n){super(),this.chartUpdateCallback=e,this.pageUpdateCallback=t,this.regionManager=i,this.cursorManager=n,this.id=Gn(this),this.marker=new md(this),this.activeStyle=new fd,this.inactiveStyle=new fd,this.highlightStyle=new fd,this.label=new gd,this.group=new xo({name:"pagination"}),this.labelNode=new Oo,this.destroyFns=[],this.totalPages=0,this.currentPage=0,this.translationX=0,this.translationY=0,this.nextButtonDisabled=!1,this.previousButtonDisabled=!1,this._visible=!0,this._enabled=!0,this._orientation="vertical",this._nextButton=new Iu,this._previousButton=new Iu,this.labelNode.setProperties({textBaseline:"middle",fontSize:12,fontFamily:"Verdana, sans-serif",fill:"black",y:1}),this.group.append([this.nextButton,this.previousButton,this.labelNode]);const s=this.regionManager.addRegion("pagination",this.group);this.destroyFns.push(s.addListener("click",e=>this.onPaginationClick(e)),s.addListener("hover",e=>this.onPaginationMouseMove(e))),this.update(),this.updateMarkers()}destroy(){this.destroyFns.forEach(e=>e())}set visible(e){this._visible=e,this.updateGroupVisibility()}get visible(){return this._visible}set enabled(e){this._enabled=e,this.updateGroupVisibility()}get enabled(){return this._enabled}updateGroupVisibility(){this.group.visible=this.enabled&&this.visible}set orientation(e){this._orientation=e,"horizontal"===e?(this.previousButton.rotation=-Math.PI/2,this.nextButton.rotation=Math.PI/2):(this.previousButton.rotation=0,this.nextButton.rotation=Math.PI)}get orientation(){return this._orientation}set nextButton(e){this._nextButton!==e&&(this.group.removeChild(this._nextButton),this._nextButton=e,this.group.appendChild(e))}get nextButton(){return this._nextButton}set previousButton(e){this._previousButton!==e&&(this.group.removeChild(this._previousButton),this._previousButton=e,this.group.appendChild(e))}get previousButton(){return this._previousButton}update(){this.updateLabel(),this.updatePositions(),this.enableOrDisableButtons()}updatePositions(){this.group.translationX=this.translationX,this.group.translationY=this.translationY,this.updateLabelPosition(),this.updateNextButtonPosition()}updateLabelPosition(){const{size:e,padding:t}=this.marker;this.nextButton.size=e,this.previousButton.size=e,this.labelNode.x=e/2+t}updateNextButtonPosition(){const e=this.labelNode.computeBBox();this.nextButton.translationX=e.x+e.width+this.marker.size/2+this.marker.padding}updateLabel(){const{currentPage:e,totalPages:t,labelNode:i,label:{color:n,fontStyle:s,fontWeight:r,fontSize:o,fontFamily:a}}=this;i.text=`${e+1} / ${t}`,i.fill=n,i.fontStyle=s,i.fontWeight=r,i.fontSize=o,i.fontFamily=a}updateMarkers(){const{nextButton:e,previousButton:t,nextButtonDisabled:i,previousButtonDisabled:n,activeStyle:s,inactiveStyle:r,highlightStyle:o,highlightActive:a}=this,l=(e,t)=>t?r:e===a?o:s;this.updateMarker(e,l("next",i)),this.updateMarker(t,l("previous",n))}updateMarker(e,t){var i;const{size:n}=this.marker;e.size=n,e.fill=t.fill,e.fillOpacity=null!=(i=t.fillOpacity)?i:1,e.stroke=t.stroke,e.strokeWidth=t.strokeWidth,e.strokeOpacity=t.strokeOpacity}enableOrDisableButtons(){const{currentPage:e,totalPages:t}=this,i=0===t,n=e===t-1,s=0===e;this.nextButtonDisabled=n||i,this.previousButtonDisabled=s||i}nextButtonContainsPoint(e,t){return!this.nextButtonDisabled&&this.nextButton.containsPoint(e,t)}previousButtonContainsPoint(e,t){return!this.previousButtonDisabled&&this.previousButton.containsPoint(e,t)}clickNext(){this.incrementPage(),this.onPaginationChanged()}clickPrevious(){this.decrementPage(),this.onPaginationChanged()}setPage(e){e=Hn(0,e,this.totalPages-1),this.currentPage!==e&&(this.currentPage=e,this.onPaginationChanged())}onPaginationClick(e){const{offsetX:t,offsetY:i}=e;this.nextButtonContainsPoint(t,i)?(this.clickNext(),e.consume()):this.previousButtonContainsPoint(t,i)&&(this.clickPrevious(),e.consume())}onPaginationMouseMove(e){const{offsetX:t,offsetY:i}=e;this.nextButtonContainsPoint(t,i)?(this.cursorManager.updateCursor(this.id,"pointer"),this.highlightActive="next"):this.previousButtonContainsPoint(t,i)?(this.cursorManager.updateCursor(this.id,"pointer"),this.highlightActive="previous"):(this.cursorManager.updateCursor(this.id),this.highlightActive=void 0),this.updateMarkers(),this.chartUpdateCallback(6)}onPaginationChanged(){this.pageUpdateCallback(this.currentPage)}incrementPage(){this.currentPage=Math.min(this.currentPage+1,this.totalPages-1)}decrementPage(){this.currentPage=Math.max(this.currentPage-1,0)}onMarkerShapeChange(){const e=_u(this.marker.shape||Iu);this.previousButton=new e,this.nextButton=new e,this.updatePositions(),this.updateMarkers(),this.chartUpdateCallback(6)}attachPagination(e){e.append(this.group)}computeBBox(){return this.group.computeBBox()}};yd.className="Pagination",b([$s(Xs)],yd.prototype,"marker",2),b([$s(Xs)],yd.prototype,"activeStyle",2),b([$s(Xs)],yd.prototype,"inactiveStyle",2),b([$s(Xs)],yd.prototype,"highlightStyle",2),b([$s(Xs)],yd.prototype,"label",2);var vd=class extends yt{constructor(){super(...arguments),this.maxLength=void 0,this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=12,this.fontFamily="Verdana, sans-serif",this.formatter=void 0}};b([$s(nr,{optional:!0})],vd.prototype,"maxLength",2),b([$s(fr)],vd.prototype,"color",2),b([$s(Mr,{optional:!0})],vd.prototype,"fontStyle",2),b([$s(Tr,{optional:!0})],vd.prototype,"fontWeight",2),b([$s(nr)],vd.prototype,"fontSize",2),b([$s(er)],vd.prototype,"fontFamily",2),b([$s(Js,{optional:!0})],vd.prototype,"formatter",2);var bd=class extends yt{constructor(){super(...arguments),this.size=15,this.padding=8,this.enabled=!0}};b([Xa(e=>{var t;return null==(t=e.parent)?void 0:t.onMarkerShapeChange()})],bd.prototype,"shape",2),b([$s(nr)],bd.prototype,"size",2),b([$s(nr)],bd.prototype,"padding",2),b([$s(nr,{optional:!0})],bd.prototype,"strokeWidth",2),b([$s(Qs)],bd.prototype,"enabled",2);var Cd=class extends yt{};b([$s(nr,{optional:!0})],Cd.prototype,"strokeWidth",2),b([$s(nr,{optional:!0})],Cd.prototype,"length",2);var wd=class extends yt{constructor(){super(...arguments),this.paddingX=16,this.paddingY=8,this.toggleSeriesVisible=!0,this.showSeriesStroke=!1,this.marker=new bd,this.label=new vd,this.line=new Cd}};b([$s(nr,{optional:!0})],wd.prototype,"maxWidth",2),b([$s(nr)],wd.prototype,"paddingX",2),b([$s(nr)],wd.prototype,"paddingY",2),b([$s(Qs)],wd.prototype,"toggleSeriesVisible",2),b([$s(Qs)],wd.prototype,"showSeriesStroke",2),b([$s(Xs)],wd.prototype,"marker",2),b([$s(Xs)],wd.prototype,"label",2),b([$s(Xs)],wd.prototype,"line",2);var Sd=class extends yt{};b([$s(Js,{optional:!0})],Sd.prototype,"legendItemClick",2),b([$s(Js,{optional:!0})],Sd.prototype,"legendItemDoubleClick",2);var xd=class extends yt{constructor(e){super(),this.ctx=e,this.id=Gn(this),this.group=new xo({name:"legend",layer:!0,zIndex:11}),this.itemSelection=La.select(this.group,pd),this.oldSize=[0,0],this.pages=[],this.maxPageSize=[0,0],this.paginationTrackingIndex=0,this.truncatedItems=new Set,this._data=[],this.item=new wd,this.listeners=new Sd,this.enabled=!0,this.position="bottom",this.spacing=20,this.characterWidths=new Map,this.destroyFns=[],this.size=[0,0],this._visible=!0,this.focus={mode:"item",index:0},this.item.marker.parent=this,this.pagination=new yd(t=>e.updateService.update(t),e=>this.updatePageNumber(e),e.regionManager,e.cursorManager),this.pagination.attachPagination(this.group),this.item.marker.parent=this;const t=e.regionManager.addRegionFromProperties({name:"legend",bboxproviders:[this.group],canInteraction:()=>this.enabled&&this.group.visible});this.destroyFns.push(t.addListener("click",e=>this.checkLegendClick(e),17),t.addListener("dblclick",e=>this.checkLegendDoubleClick(e),17),t.addListener("hover",e=>this.handleLegendMouseMove(e)),t.addListener("leave",e=>this.handleLegendMouseExit(e),17),t.addListener("enter",e=>this.handleLegendMouseEnter(e),17),t.addListener("blur",e=>this.onBlur(e)),t.addListener("tab",e=>this.onTab(e)),t.addListener("tab-start",e=>this.onTabStart(e)),t.addListener("nav-vert",e=>this.onNav(e)),t.addListener("nav-hori",e=>this.onNav(e)),t.addListener("submit",e=>this.onSubmit(e)),e.layoutService.addListener("start-layout",e=>this.positionLegend(e.shrinkRect)),()=>this.detachLegend())}set data(e){this._data=e,this.updateGroupVisibility()}get data(){return this._data}destroy(){this.destroyFns.forEach(e=>e()),this.pagination.destroy()}onMarkerShapeChange(){this.itemSelection.clear(),this.group.markDirty(this.group,2)}getOrientation(){if(void 0!==this.orientation)return this.orientation;switch(this.position){case"right":case"left":return"vertical";case"bottom":case"top":return"horizontal"}}getCharacterWidths(e){const{characterWidths:t}=this;if(t.has(e))return t.get(e);const i={"...":Oo.getTextSize("...",e).width};return t.set(e,i),i}set visible(e){this._visible=e,this.updateGroupVisibility()}get visible(){return this._visible}updateGroupVisibility(){this.group.visible=this.enabled&&this.visible&&this.data.length>0}attachLegend(e){e.appendChild(this.group)}detachLegend(){var e;null==(e=this.group.parent)||e.removeChild(this.group)}getItemLabel(e){const{ctx:{callbackCache:t}}=this,{formatter:i}=this.item.label;return i?t.call(i,{itemId:e.itemId,value:e.label.text,seriesId:e.seriesId}):e.label.text}calcLayout(e,t){const{paddingX:i,paddingY:n,label:s,maxWidth:r,marker:{size:o,padding:a,shape:l},label:{maxLength:c=1/0,fontStyle:h,fontWeight:u,fontSize:d,fontFamily:p},line:g,showSeriesStroke:f}=this.item,m=[...this.data];this.reverseOrder&&m.reverse(),this.itemSelection.update(m);const y=[],v=Go(s),b=null!=r?r:.8*e,C=o+a+i;if(this.itemSelection.each((e,t)=>{var i,n,s;const r=_u(null!=l?l:t.marker.shape),m=null!=(i=t.marker.enabled)?i:this.item.marker.enabled;e.marker&&e.marker instanceof r||(e.marker=new r),e.markerSize=o,e.spacing=a,e.fontStyle=h,e.fontWeight=u,e.fontSize=d,e.fontFamily=p;const w=null!=(n=t.itemId)?n:t.id,S=this.getItemLabel(t),x=(null!=S?S:"<unknown>").replace(/\r?\n/g," ");e.text=this.truncate(x,c,b,C,v,w),f&&void 0!==t.line?(e.lineVisible=!0,e.markerVisible=m,e.setSeriesStrokeOffset(null!=(s=g.length)?s:5)):(e.lineVisible=!1,e.markerVisible=!0),y.push(e.computeBBox())}),e=Math.max(1,e),t=Math.max(1,t),!isFinite(e))return!1;const w=this.size,S=this.oldSize;w[0]=e,w[1]=t,w[0]===S[0]&&w[1]===S[1]||(S[0]=w[0],S[1]=w[1]);const{pages:x,maxPageHeight:E,maxPageWidth:A}=this.updatePagination(y,e,t);this.pages=x,this.maxPageSize=[A-i,E-n];const M=this.pagination.currentPage,T=this.pages[M];this.pages.length<1||!T?this.visible=!1:(this.visible=!0,this.updatePositions(M),this.update())}truncate(e,t,i,n,s,r){const o=e.split("");let a=!1;if(e.length>t&&(e=`${e.substring(0,t)}`,a=!0),Math.floor(n+Oo.getTextSize(e,s).width)>i){let t="";const r=this.getCharacterWidths(s);let l=n+r["..."];for(const e of o){if(r[e]||(r[e]=Oo.getTextSize(e,s).width),l+=r[e],l>i)break;t+=e}e=t,a=!0}return a?(e+="...",this.truncatedItems.add(r)):this.truncatedItems.delete(r),e}updatePagination(e,t,i){const n=this.getOrientation(),s=Math.min(this.paginationTrackingIndex,e.length);this.pagination.orientation=n,this.pagination.translationX=0,this.pagination.translationY=0;const{pages:r,maxPageHeight:o,maxPageWidth:a,paginationBBox:l,paginationVertical:c}=this.calculatePagination(e,t,i),h=r.findIndex(e=>e.endIndex>=s);this.pagination.currentPage=Hn(0,h,r.length-1);const{paddingX:u,paddingY:d}=this.item,p=a-u,g=o-d;let f=0,m=-l.y-this.item.marker.size/2;return c?m+=g+8:(f+=-l.x+p+8,m+=(g-l.height)/2),this.pagination.translationX=f,this.pagination.translationY=m,this.pagination.update(),this.pagination.updateMarkers(),{maxPageHeight:o,maxPageWidth:a,pages:r}}calculatePagination(e,t,i){var n,s,r;const{paddingX:o,paddingY:a}=this.item,l=this.getOrientation(),c=["left","right"].includes(this.position);let h=this.pagination.computeBBox(),u=new es(0,0,0,0),d=[],p=0,g=0,f=0;const m=e=>e.width===h.width&&e.height===h.height,y=void 0!==this.maxWidth&&void 0!==this.maxHeight;do{if(f++>10){L.warn("unable to find stable legend layout.");break}h=u;const m=t-(c?0:h.width),v=hd({orientation:l,bboxes:e,maxHeight:i-(c?h.height:0),maxWidth:m,itemPaddingY:a,itemPaddingX:o,forceResult:y});d=null!=(n=null==v?void 0:v.pages)?n:[],p=null!=(s=null==v?void 0:v.maxPageWidth)?s:0,g=null!=(r=null==v?void 0:v.maxPageHeight)?r:0;const b=d.length;if(this.pagination.visible=b>1,this.pagination.totalPages=b,this.pagination.update(),u=this.pagination.computeBBox(),!this.pagination.visible)break}while(!m(u));return{maxPageWidth:p,maxPageHeight:g,pages:d,paginationBBox:h,paginationVertical:c}}getPageItemCount(e){let t=0;for(const i of this.pages[e].columns)t+=i.indices.length;return t}getNodeIndexFromFocusIndex(){const{index:e}=this.focus,t=this.pages[this.pagination.currentPage];let i=0;for(const n of t.columns){if(e<i+n.indices.length)return n.indices[e-i];i+=n.indices.length}return-1}updatePositions(e=0){const{item:{paddingY:t},itemSelection:i,pages:n}=this;if(n.length<1||!n[e])return;const{columns:s,startIndex:r,endIndex:o}=n[e];let a=0,l=0;const c=s.length,h=s[0].indices.length,u="horizontal"===this.getOrientation(),d=s[0].bboxes[0].height+t,p=[];i.each((e,t,i)=>{var n,g;if(i<r||i>o)return void(e.visible=!1);const f=i-r;let m=0,y=0;u?(m=f%c,y=Math.floor(f/c)):(m=Math.floor(f/h),y=f%h),e.visible=!0;const v=s[m];v&&(l=d*y,a=null!=(n=p[y])?n:0,p[y]=(null!=(g=p[y])?g:0)+v.columnWidth,e.translationX=Math.floor(a),e.translationY=Math.floor(l))})}updatePageNumber(e){const{pages:t}=this,{startIndex:i,endIndex:n}=t[e];0===i?this.paginationTrackingIndex=0:e===t.length-1?this.paginationTrackingIndex=n:this.paginationTrackingIndex=Math.floor((i+n)/2),this.pagination.update(),this.pagination.updateMarkers(),this.updatePositions(e),this.ctx.updateService.update(6)}update(){const{label:{color:e},marker:t,line:i,showSeriesStroke:n}=this.item;this.itemSelection.each((s,r)=>{var o,a;const l=r.marker;s.markerFill=l.fill,s.markerStroke=l.stroke,s.markerStrokeWidth=null!=(o=t.strokeWidth)?o:Math.min(2,l.strokeWidth),s.markerFillOpacity=l.fillOpacity,s.markerStrokeOpacity=l.strokeOpacity,s.opacity=r.enabled?1:.5,s.color=e;const{line:c}=r;n&&void 0!==c&&(s.lineStroke=c.stroke,s.lineStrokeOpacity=c.strokeOpacity,s.lineStrokeWidth=null!=(a=i.strokeWidth)?a:Math.min(2,c.strokeWidth),s.lineLineDash=c.lineDash)})}getDatumForPoint(e,t){const i=[],n={dist:1/0,datum:void 0};for(const s of this.group.children){if(!s.visible)continue;if(!(s instanceof pd))continue;const r=s.computeBBox();if(r.grow(this.item.paddingX/2,"horizontal"),r.grow(this.item.paddingY/2,"vertical"),r.containsPoint(e,t))return s.datum;const o=e-r.x-this.item.paddingX/2,a=t-r.y-this.item.paddingY/2,l=p(o,2)+p(a,2);o>=0&&a>=0&&l<n.dist&&(n.dist=l,n.datum=s.datum),i.push(r)}if(es.merge(i).containsPoint(e,t))return n.datum}computePagedBBox(){const e=this.group.computeBBox();if(this.pages.length<=1)return e;const[t,i]=this.maxPageSize;return e.height=Math.max(i,e.height),e.width=Math.max(t,e.width),e}checkLegendClick(e){const t=this.getDatumForPoint(e.offsetX,e.offsetY);this.doClick(t)&&e.consume()}doClick(e){const{listeners:{legendItemClick:t},ctx:{chartService:i,highlightManager:n},item:{toggleSeriesVisible:s},preventHidingAll:r}=this;if(!e)return!1;const{id:o,itemId:a,enabled:l}=e,c=i.series.find(e=>e.id===o);if(!c)return!1;let h=l;if(s){h=!l,r&&!h&&i.series.flatMap(e=>e.getLegendData("category")).filter(e=>e.enabled).length<2&&(h=!0);const t=h?"visible":"hidden";this.ctx.ariaAnnouncementService.announceValue(`${t}`),this.ctx.chartEventManager.legendItemClick(c,a,h,e.legendItemName)}return h?n.updateHighlight(this.id,{series:c,itemId:a,datum:void 0}):n.updateHighlight(this.id),this.ctx.updateService.update(2,{forceNodeDataRefresh:!0}),null==t||t({type:"click",enabled:h,itemId:a,seriesId:c.id}),!0}checkLegendDoubleClick(e){var t;const{listeners:{legendItemDoubleClick:i},ctx:{chartService:n},item:{toggleSeriesVisible:s}}=this;if("integrated"===n.mode)return;const r=this.getDatumForPoint(e.offsetX,e.offsetY);if(!r)return;const{id:o,itemId:a,seriesId:l}=r,c=n.series.find(e=>e.id===o);if(c){if(e.consume(),s){const e=n.series.flatMap(e=>e.getLegendData("category")),i=e.filter(e=>e.enabled).length,s=e.find(e=>e.itemId===a&&e.seriesId===l);this.ctx.chartEventManager.legendItemDoubleClick(c,a,null!=(t=null==s?void 0:s.enabled)&&t,i,null==s?void 0:s.legendItemName)}this.ctx.updateService.update(2,{forceNodeDataRefresh:!0}),null==i||i({type:"dblclick",enabled:!0,itemId:a,seriesId:c.id})}}handleLegendMouseMove(e){if(!this.enabled)return;const{offsetX:t,offsetY:i}=e;e.consume();const n=this.getDatumForPoint(t,i);this.doHover(e,n)}doHover(e,t){var i;const{item:{toggleSeriesVisible:n},listeners:s}=this;if(void 0===e||void 0===t)return this.ctx.cursorManager.updateCursor(this.id),void this.ctx.highlightManager.updateHighlight(this.id);const r=t?this.ctx.chartService.series.find(e=>e.id===(null==t?void 0:t.id)):void 0;if(t&&this.truncatedItems.has(null!=(i=t.itemId)?i:t.id)){const{offsetX:i,offsetY:n}=e;this.ctx.tooltipManager.updateTooltip(this.id,{offsetX:i,offsetY:n,lastPointerEvent:e,showArrow:!1},nl({content:this.getItemLabel(t)}))}else this.ctx.tooltipManager.removeTooltip(this.id);(n||null!=s.legendItemClick||null!=s.legendItemDoubleClick)&&this.ctx.cursorManager.updateCursor(this.id,"pointer"),(null==t?void 0:t.enabled)&&r?this.ctx.highlightManager.updateHighlight(this.id,{series:r,itemId:null==t?void 0:t.itemId,datum:void 0}):this.ctx.highlightManager.updateHighlight(this.id)}handleLegendMouseExit(e){this.doMouseExit()}doMouseExit(){this.ctx.cursorManager.updateCursor(this.id),this.ctx.tooltipManager.removeTooltip(this.id),16===this.ctx.interactionManager.getState()&&this.ctx.highlightManager.updateHighlight(this.id)}handleLegendMouseEnter(e){const{enabled:t,item:{toggleSeriesVisible:i},listeners:{legendItemClick:n,legendItemDoubleClick:s}}=this,r=this.getDatumForPoint(e.offsetX,e.offsetY);t&&void 0!==r&&(i||null!=n||null!=s)&&this.ctx.cursorManager.updateCursor(this.id,"pointer")}onBlur(e){this.doMouseExit(),this.focus.mode="item",this.ctx.regionManager.updateFocusIndicatorRect(void 0)}onTab(e){this.updateFocus(),e.consume()}onTabStart(e){if(!this.pagination.visible||!this.pagination.enabled)return;const t=t=>{this.focus.mode=t,this.updateFocus(),e.consume()};"item"===this.focus.mode&&1===e.delta?(this.focus.index=0===this.pagination.currentPage?1:0,t("page")):"page"===this.focus.mode&&-1===e.delta&&(this.focus.index=0,t("item"))}onNav(e){if("item"===this.focus.mode){const t=this.focus.index+e.delta,i=this.getPageItemCount(this.pagination.currentPage);this.focus.index=Hn(-1,t,i),this.updateFocus(),e.consume()}else"page"===this.focus.mode&&(e.delta<0&&(this.focus.index=0),e.delta>0&&(this.focus.index=1),this.updateFocus(),e.consume())}onSubmit(e){"item"===this.focus.mode?this.doClick(this.getFocusedItem().datum):"page"===this.focus.mode&&(0===this.focus.index&&this.pagination.clickPrevious(),1===this.focus.index&&this.pagination.clickNext(),this.ctx.ariaAnnouncementService.announceValue(`Legend page ${this.pagination.currentPage+1} of ${this.pages.length}`))}maybeChangeFocusPage(){const e=this.pagination.currentPage,t=this.getPageItemCount(e);if(-1===this.focus.index)this.pagination.setPage(e-1);else{if(this.focus.index!==t)return;this.pagination.setPage(e+1)}const{currentPage:i}=this.pagination;e===i?this.focus.index=Hn(0,this.focus.index,t-1):-1===this.focus.index?this.focus.index=this.getPageItemCount(i)-1:this.focus.index=0}getFocusedItem(){if("item"!==this.focus.mode)return L.error("getFocusedItem() should be called only when focus.mode is 'item'"),{nodeIndex:-1,node:void 0,datum:void 0};this.maybeChangeFocusPage();const e=this.getNodeIndexFromFocusIndex();if(e<0)return L.error(`Cannot access negative nodeIndex ${e}`),{nodeIndex:-1,node:void 0,datum:void 0};const t=this.itemSelection.nodes()[e];let i;return e<this.data.length?i=this.data[e]:L.error(`Cannot access datum[${e}]`),{nodeIndex:e,node:t,datum:i}}updateFocus(){const{focus:e,pagination:t}=this;if("item"===e.mode){const{nodeIndex:e,node:t,datum:i}=this.getFocusedItem();if(void 0===i)return;const n=null==t?void 0:t.computeTransformedBBox();this.doHover(rh(this.ctx.regionManager,{bbox:n,showFocusBox:!0}),i);const s=i&&this.getItemLabel(i);if(s){const t=i.enabled?"visible":"hidden";this.ctx.ariaAnnouncementService.announceValue(`Legend item ${e+1} of ${this.data.length}, ${s}, ${t}`)}}else if("page"===e.mode){const i=0===e.index?t.previousButton:t.nextButton;this.ctx.regionManager.updateFocusIndicatorRect(i.computeTransformedBBox());const n=["Previous legend page","Next legend page"][e.index];this.ctx.ariaAnnouncementService.announceValue(`${n}, button`)}}positionLegend(e){const t=e.clone();if(!this.enabled||!this.data.length)return{shrinkRect:t};const[i,n]=this.calculateLegendDimensions(e);this.group.translationX=0,this.group.translationY=0,this.calcLayout(i,n);const s=this.computePagedBBox(),r=()=>{switch(this.position){case"top":case"left":return 0;case"bottom":return e.height-s.height;default:return e.width-s.width}};if(this.visible){let i,n;switch(this.position){case"top":case"bottom":i=(e.width-s.width)/2,n=r(),t.shrink(s.height,this.position);break;default:i=r(),n=(e.height-s.height)/2,t.shrink(s.width,this.position)}this.group.translationX=Math.floor(-s.x+e.x+i),this.group.translationY=Math.floor(-s.y+e.y+n)}if(this.visible&&this.enabled&&this.data.length){const e=this.spacing;t.shrink(e,this.position);const i=s.clone();i.x+=this.group.translationX,i.y+=this.group.translationY}return{shrinkRect:t}}calculateLegendDimensions(e){const{width:t,height:i}=e,n=t/i;let s,r;switch(this.position){case"top":case"bottom":const e=n<1?Math.min(.5,1/n*.2):.2;s=this.maxWidth?Math.min(this.maxWidth,t):t,r=this.maxHeight?Math.min(this.maxHeight,i):Math.round(i*e);break;default:const o=n>1?Math.min(.5,.25*n):.25;s=this.maxWidth?Math.min(this.maxWidth,t):Math.round(t*o),r=this.maxHeight?Math.min(this.maxHeight,i):i}return[s,r]}};xd.className="Legend",b([$s(Xs)],xd.prototype,"pagination",2),b([$s(Xs)],xd.prototype,"item",2),b([$s(Xs)],xd.prototype,"listeners",2),b([Xa(e=>e.updateGroupVisibility()),$s(Qs)],xd.prototype,"enabled",2),b([$s(Ar)],xd.prototype,"position",2),b([$s(nr,{optional:!0})],xd.prototype,"maxWidth",2),b([$s(nr,{optional:!0})],xd.prototype,"maxHeight",2),b([$s(Qs,{optional:!0})],xd.prototype,"reverseOrder",2),b([$s(Or(["horizontal","vertical"],"an orientation"),{optional:!0})],xd.prototype,"orientation",2),b([$s(Qs,{optional:!0})],xd.prototype,"preventHidingAll",2),b([$s(nr)],xd.prototype,"spacing",2);var Ed={type:"legend",optionsKey:"legend",identifier:"category",chartTypes:["cartesian","polar","hierarchy","topology"],instanceConstructor:xd,packageType:"community"},Ad=class extends uu{constructor(){super(...arguments),this.zIndex=3,this._fill="#f2f2f2",this._stroke="#999999",this._strokeWidth=1,this._lineCap="square",this._centerX=0,this._centerY=0,this._width=8,this._gripLineGap=2,this._gripLineLength=8,this._height=16}set centerX(e){this._centerX!==e&&(this._centerX=e,this.dirtyPath=!0)}get centerX(){return this._centerX}set centerY(e){this._centerY!==e&&(this._centerY=e,this.dirtyPath=!0)}get centerY(){return this._centerY}set width(e){this._width!==e&&(this._width=e,this.dirtyPath=!0)}get width(){return this._width}set gripLineGap(e){this._gripLineGap!==e&&(this._gripLineGap=e,this.dirtyPath=!0)}get gripLineGap(){return this._gripLineGap}set gripLineLength(e){this._gripLineLength!==e&&(this._gripLineLength=e,this.dirtyPath=!0)}get gripLineLength(){return this._gripLineLength}set height(e){this._height!==e&&(this._height=e,this.dirtyPath=!0)}get height(){return this._height}layout(e,t){this.centerX=e,this.centerY=t}static align(e,t,i,n,s,r,o,a){const l=e.strokeWidth/2,c=e.align(i+s*o)+l,h=c+e.align(i+s*o,s*(a-o))-2*l,u=e.align(n+r/2)+l;e.layout(c,u),t.layout(h,u)}computeBBox(){const{centerX:e,centerY:t,width:i,height:n}=this;return new es(e-i/2,t-n/2,i,n)}isPointInPath(e,t){const i=this.transformPoint(e,t);return this.computeBBox().containsPoint(i.x,i.y)}updatePath(){var e,t,i;const{centerX:n,centerY:s,path:r,strokeWidth:o,gripLineGap:a,gripLineLength:l}=this,c=null!=(i=null==(t=null==(e=this.layerManager)?void 0:e.canvas)?void 0:t.pixelRatio)?i:1;r.clear();const h=Math.floor(this.width/2*c)/c,u=Math.floor(this.height/2*c)/c;r.moveTo(n-h,s-u),r.lineTo(n+h,s-u),r.lineTo(n+h,s+u),r.lineTo(n-h,s+u),r.closePath();const d=Math.floor((a+o)/2*c)/c,p=Math.floor(l/2*c)/c;r.moveTo(n-d,s-p),r.lineTo(n-d,s+p),r.moveTo(n+d,s-p),r.lineTo(n+d,s+p)}};Ad.className="RangeHandle",b([$s(fr)],Ad.prototype,"_fill",2),b([$s(fr)],Ad.prototype,"_stroke",2),b([$s(nr)],Ad.prototype,"_strokeWidth",2),b([$s(Sr)],Ad.prototype,"_lineCap",2),b([$s(nr)],Ad.prototype,"_width",2),b([$s(nr)],Ad.prototype,"_gripLineGap",2),b([$s(nr)],Ad.prototype,"_gripLineLength",2),b([$s(nr)],Ad.prototype,"_height",2);var Md=class extends uu{constructor(){super(...arguments),this.zIndex=2,this.x=0,this.y=0,this.width=200,this.height=30,this.min=0,this.max=1}layout(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n,this.dirtyPath=!0}update(e,t){this.min=isNaN(e)?this.min:e,this.max=isNaN(t)?this.max:t,this.dirtyPath=!0}computeBBox(){const{x:e,y:t,width:i,height:n}=this;return new es(e,t,i,n)}computeVisibleRangeBBox(){const{x:e,y:t,width:i,height:n,min:s,max:r}=this,o=e+i*s;return new es(o,t,e+i*r-o,n)}updatePath(){const{path:e,x:t,y:i,width:n,height:s,min:r,max:o,strokeWidth:a}=this,l=a/2;e.clear();const c=this.align(t)+l,h=this.align(i)+l,u=c+this.align(t,n)-2*l,d=h+this.align(i,s)-2*l;e.moveTo(c,h),e.lineTo(u,h),e.lineTo(u,d),e.lineTo(c,d),e.closePath();const p=this.align(t+n*r)+l,g=p+this.align(t+n*r,n*(o-r))-2*l;e.moveTo(p,h),e.lineTo(p,d),e.lineTo(g,d),e.lineTo(g,h),e.closePath()}};Md.className="RangeMask";var Td=class extends xo{constructor(e){super({name:"rangeSelectorGroup",layer:!0,zIndex:12}),this.x=0,this.y=0,this.width=200,this.height=30,this.lOffset=0,this.rOffset=0,this.isContainerNode=!0,this.background=new xo({name:"navigator-background"}),this.background.zIndex=1,this.appendChild(this.background),this.append(e)}layout(e,t,i,n,s,r){this.x=e,this.y=t,this.width=i,this.height=n,this.lOffset=s,this.rOffset=r,this.background.translationX=e,this.background.translationY=t}updateBackground(e,t){null!=e&&this.background.removeChild(e),null!=t&&this.background.appendChild(t)}computeBBox(){const{x:e,y:t,width:i,height:n,lOffset:s,rOffset:r}=this;return new es(e-s,t,i+(s+r),n)}},Dd=class extends we{constructor(e){super(),this.ctx=e,this.miniChart=void 0,this.enabled=!1,this.mask=new Md,this.minHandle=new Ad,this.maxHandle=new Ad,this.height=30,this.margin=10,this.x=0,this.y=0,this.width=0,this.rangeSelector=new Td([this.mask,this.minHandle,this.maxHandle]),this._min=0,this._max=1,this.minRange=.001;const t=e.regionManager.addRegion("navigator",this.rangeSelector);this.destroyFns.push(e.scene.attachNode(this.rangeSelector),t.addListener("hover",e=>this.onHover(e),25),t.addListener("drag-start",e=>this.onDragStart(e),25),t.addListener("drag",e=>this.onDrag(e),25),t.addListener("drag-end",()=>this.onDragEnd(),25),t.addListener("leave",e=>this.onLeave(e),25),e.zoomManager.addListener("zoom-change",e=>this.onZoomChange(e))),this.updateGroupVisibility()}updateBackground(e,t){var i;null==(i=this.rangeSelector)||i.updateBackground(e,t)}updateGroupVisibility(){const{enabled:e}=this;null!=this.rangeSelector&&e!==this.rangeSelector.visible&&(this.rangeSelector.visible=e,e?this.updateZoom():this.ctx.zoomManager.updateZoom("navigator"))}performLayout(e){return w(this,arguments,function*({shrinkRect:e}){if(this.enabled){const t=this.height+this.margin;e.shrink(t,"bottom"),this.y=e.y+e.height+this.margin}else this.y=0;return{shrinkRect:e}})}performCartesianLayout(e){return w(this,null,function*(){const{x:t,width:i}=e.seriesRect;if(this.enabled){const{y:e,height:n}=this;this.layoutNodes(t,e,i,n)}this.x=t,this.width=i})}onHover(e){if(!this.enabled)return;const{mask:t,minHandle:i,maxHandle:n}=this,{offsetX:s,offsetY:r}=e;i.containsPoint(s,r)||n.containsPoint(s,r)?this.ctx.cursorManager.updateCursor("navigator","ew-resize"):t.computeVisibleRangeBBox().containsPoint(s,r)?this.ctx.cursorManager.updateCursor("navigator","grab"):this.ctx.cursorManager.updateCursor("navigator")}onDragStart(e){if(!this.enabled)return;const{mask:t,minHandle:i,maxHandle:n,x:s,width:r,_min:o}=this,{offsetX:a,offsetY:l}=e;i.zIndex<n.zIndex?n.containsPoint(a,l)?this.dragging="max":i.containsPoint(a,l)&&(this.dragging="min"):i.containsPoint(a,l)?this.dragging="min":n.containsPoint(a,l)&&(this.dragging="max"),null==this.dragging&&t.computeVisibleRangeBBox().containsPoint(a,l)&&(this.dragging="pan",this.panStart=(a-s)/r-o),null!=this.dragging&&this.ctx.zoomManager.fireZoomPanStartEvent("navigator")}onDrag(e){if(!this.enabled||null==this.dragging)return;const{dragging:t,minRange:i,panStart:n,x:s,width:r}=this;let{_min:o,_max:a}=this;const{offsetX:l}=e,c=(l-s)/r;if("min"===t)o=Hn(0,c,a-i);else if("max"===t)a=Hn(o+i,c,1);else if("pan"===t&&null!=n){const e=a-o;o=Hn(0,c-n,1-e),a=o+e}this._min=o,this._max=a,this.updateZoom()}onDragEnd(){this.dragging=void 0}onLeave(e){this.ctx.cursorManager.updateCursor("navigator")}onZoomChange(e){const{x:t}=e;t&&(this._min=t.min,this._max=t.max,this.updateNodes(t.min,t.max))}layoutNodes(e,t,i,n){const{rangeSelector:s,mask:r,minHandle:o,maxHandle:a,_min:l,_max:c}=this;s.layout(e,t,i,n,o.width/2,a.width/2),r.layout(e,t,i,n),Ad.align(o,a,e,t,i,n,l,c),l+(c-l)/2<.5?(o.zIndex=3,a.zIndex=4):(o.zIndex=4,a.zIndex=3)}updateNodes(e,t){this.mask.update(e,t)}updateZoom(){if(!this.enabled)return;const{_min:e,_max:t}=this,i=this.ctx.zoomManager.getZoom();return null!=e&&null!=t?this.ctx.zoomManager.updateZoom("navigator",{x:{min:e,max:t},y:null==i?void 0:i.y},!1,e=>{null==this.min&&null==this.max||L.warnOnce(`Could not apply [navigator.min] or [navigator.max] as [${e}] has modified the initial zoom state.`)}):void 0}};b([$s(Xs,{optional:!0})],Dd.prototype,"miniChart",2),b([$s(Qs),Xa(e=>e.updateGroupVisibility())],Dd.prototype,"enabled",2),b([$s(nr)],Dd.prototype,"height",2),b([$s(nr)],Dd.prototype,"margin",2),b([qa({newValue(e){this._min=e,this.updateZoom()}}),$s(Ys(sr,hr("max")),{optional:!0})],Dd.prototype,"min",2),b([qa({newValue(e){this._max=e,this.updateZoom()}}),$s(Ys(sr,ur("min")),{optional:!0})],Dd.prototype,"max",2);var Id={type:"root",optionsKey:"navigator",packageType:"community",chartTypes:["cartesian"],instanceConstructor:Dd,themeTemplate:{navigator:{enabled:!1,height:30,mask:{fill:"#999999",stroke:"#999999",strokeWidth:1,fillOpacity:.2},minHandle:{fill:"#f2f2f2",stroke:"#999999",strokeWidth:1,width:9,height:16,gripLineGap:1,gripLineLength:8},maxHandle:{fill:"#f2f2f2",stroke:"#999999",strokeWidth:1,width:9,height:16,gripLineGap:1,gripLineLength:8}}}},Rd=({takeColors:e})=>{const{fills:[t],strokes:[i]}=e(1);return{fill:t,stroke:i}},kd=e=>{const{fill:t,stroke:i}=Rd(e);return{marker:{fill:t,stroke:i}}};function Pd(e,t,i,n,s){const{addPhaseFn:r,updatePhaseFn:o,removePhaseFn:a}=s,l=(n,s,r)=>{i.animate({id:`${e}_${t}_${s.id}_${n}`,groupId:e,from:0,to:1,ease:vs,collapsable:!1,onUpdate(e,t){t&&"removed"!==n||(s.path.clear(!0),r(e,s),s.checkPathDirty())},onStop(){"added"===n&&(s.path.clear(!0),r(1,s),s.checkPathDirty())},phase:Is[n]})};for(const e of n)i.isSkipped()||(l("removed",e,a),l("updated",e,o)),l("added",e,r)}var _d=null;function Ld(e){if(null!=e)return""===e?"":(null!=_d||(_d=xn("div")),_d.textContent=String(e),_d.innerHTML)}function Nd({id:e},t,i,...n){ks(e,t,i,n,{opacity:0},{opacity:1},{phase:"trailing"})}function Od({id:e},t,i,...n){ks(e,t,i,n,{opacity:1},{opacity:0},{phase:"remove"})}function Fd(e){return{opacity:1}}var Gd=class extends yt{constructor(){super(...arguments),this._dirty=3}markDirty(e,t=1){this._dirty<t&&(this._dirty=t)}markClean(e){this._dirty=0}isDirty(){return this._dirty>0}},Bd=class extends Gd{constructor(){super(...arguments),this.enabled=!0,this.color="rgba(0, 0, 0, 0.5)",this.xOffset=0,this.yOffset=0,this.blur=5}};b([$s(Qs),ns({redraw:3})],Bd.prototype,"enabled",2),b([$s(fr),ns({redraw:3})],Bd.prototype,"color",2),b([$s(tr),ns({redraw:3})],Bd.prototype,"xOffset",2),b([$s(tr),ns({redraw:3})],Bd.prototype,"yOffset",2),b([$s(nr),ns({redraw:3})],Bd.prototype,"blur",2);var Vd=Br(e=>Pu(e)||"function"==typeof mu&&Object.create(e.prototype)instanceof mu,"a marker shape keyword such as 'circle', 'diamond' or 'square' or an object extending the Marker class"),Hd=class extends Gd{constructor(){super(...arguments),this.enabled=!0,this.shape=yu,this.size=6,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1}getStyle(){const{size:e,fill:t,fillOpacity:i,stroke:n,strokeWidth:s,strokeOpacity:r}=this;return{size:e,fill:t,fillOpacity:i,stroke:n,strokeWidth:s,strokeOpacity:r}}getDiameter(){return this.size+this.strokeWidth}};b([$s(Qs),ns({redraw:3})],Hd.prototype,"enabled",2),b([$s(Vd),ns({redraw:3})],Hd.prototype,"shape",2),b([$s(nr),ns({redraw:3})],Hd.prototype,"size",2),b([$s(fr,{optional:!0}),ns({redraw:3})],Hd.prototype,"fill",2),b([$s(sr),ns({redraw:3})],Hd.prototype,"fillOpacity",2),b([$s(fr,{optional:!0}),ns({redraw:3})],Hd.prototype,"stroke",2),b([$s(nr),ns({redraw:3})],Hd.prototype,"strokeWidth",2),b([$s(sr),ns({redraw:3})],Hd.prototype,"strokeOpacity",2),b([$s(Js,{optional:!0}),ns({redraw:3})],Hd.prototype,"formatter",2);var Ud=class extends yt{constructor(){super(...arguments),this.enabled=!1}};b([$s(Qs)],Ud.prototype,"enabled",2);var zd=class extends yt{constructor(){super(...arguments),this.enabled=!0,this.interaction=new Ud,this.position=new sl}toTooltipHtml(e,t){return this.renderer?nl(this.renderer(t),e):nl(e)}};b([$s(Qs)],zd.prototype,"enabled",2),b([$s(Qs,{optional:!0})],zd.prototype,"showArrow",2),b([$s(Js,{optional:!0})],zd.prototype,"renderer",2),b([$s(Xs)],zd.prototype,"interaction",2),b([$s(Xs)],zd.prototype,"position",2);var Wd=class extends zu{constructor(){super(...arguments),this.xName=void 0,this.fill="#c16068",this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.shadow=new Bd,this.marker=new Hd,this.label=new Bo,this.tooltip=new zd,this.connectMissingData=!1}};function jd({id:e},t,i,...n){ks(e,"markers",t,n,{opacity:0},{opacity:1},{phase:i?Is[i]:"trailing"}),n.forEach(e=>e.cleanup())}function $d({id:e},t,...i){ks(e,"markers",t,i,{scalingX:0,scalingY:0},{scalingX:1,scalingY:1},{phase:"initial"}),i.forEach(e=>e.cleanup())}function Kd({id:e,nodeDataDependencies:t},i,...n){const s=t.seriesRectWidth;Rs(e,"markers",i,n,{fromFn:(e,t)=>{var i,n;const r=null!=(n=null==(i=t.midPoint)?void 0:i.x)?n:s;let o=Hn(0,xs(r/s),1);return isNaN(o)&&(o=0),{scalingX:0,scalingY:0,delay:o,duration:.2,phase:"initial"}},toFn:()=>({scalingX:1,scalingY:1})})}function Yd(e){return{opacity:1,scalingX:1,scalingY:1}}function qd(e,t){var i,n,s,r;return{translationX:null!=(n=null==(i=t.point)?void 0:i.x)?n:NaN,translationY:null!=(r=null==(s=t.point)?void 0:s.y)?r:NaN}}function Xd(e,t){const i=(t,i)=>{const n=e[i][t];return Array.isArray(n)?n[0]:n},n=t=>{const{xValue:n}=t;return e.moved[n]?{point:i(n,"moved"),status:"updated"}:e.removed[n]?{point:i(n,"removed"),status:"removed"}:e.added[n]?{point:i(n,"added"),status:"added"}:{status:"unknown"}};return{fromFn:(e,i)=>{var s,r,o,a,l,c;const{status:h,point:u}=n(i);if("unknown"===h)return{opacity:0};const d={translationX:null!=(r=null==(s=null==u?void 0:u.from)?void 0:s.x)?r:e.translationX,translationY:null!=(a=null==(o=null==u?void 0:u.from)?void 0:o.y)?a:e.translationY,opacity:e.opacity,phase:Is[h]};return"added"===t?m(f({},d),{opacity:0,translationX:null==(l=null==u?void 0:u.to)?void 0:l.x,translationY:null==(c=null==u?void 0:u.to)?void 0:c.y,phase:Is.added}):("added"===h&&(d.opacity=0),d)},toFn:(e,i)=>{var s,r;const{status:o,point:a}=n(i);if("unknown"===o)return{opacity:0};const l={translationX:i.point.x,translationY:i.point.y,opacity:1,phase:Is[o]};return"removed"===o||"removed"===t?m(f({},l),{translationX:null==(s=null==a?void 0:a.to)?void 0:s.x,translationY:null==(r=null==a?void 0:a.to)?void 0:r.y,opacity:0,phase:Is.removed}):l}}}function Zd(e,{datumIndex:t}){const i=e.getNodeData();if(void 0===i)return;const n=i[t];if(void 0===n||void 0===n.point)return;const s=e.getFormattedMarkerStyle(n).size,r=s/2,{x:o,y:a}=e.contentGroup.inverseTransformPoint(n.point.x-r,n.point.y-r);return new es(o,a,s,s)}function Qd(e){return e.reduce(({min:e,max:t},i)=>((null==e||e.point.x>i.point.x)&&(e=i),(null==t||t.point.x<i.point.x)&&(t=i),{min:e,max:t}),{})}function Jd(e,t,i){const n=(t.y-e.y)/(t.x-e.x);return{x:i,y:(i-e.x)*n+e.y}}function ep(e,t,i,n){let s=-1,r=0;const o=[];for(;r<e.length;)e[r].change!==t?e[r].change!==i?(o.length>0&&(n(o,s,r),o.length=0),s=r,r++):r++:(o.push(e[r]),r++);o.length>0&&n(o,s,r)}function tp(e,t){ep(e,"out","in",(i,n,s)=>{var r,o;-1===n&&e[s]?i.forEach(t=>t.to=e[s].from):s===e.length&&e[n]?i.forEach(t=>t.to=e[n].from):"intersect"===t&&(null==(r=e[n])?void 0:r.from)&&(null==(o=e[s])?void 0:o.from)?i.forEach(t=>t.to=Jd(e[n].from,e[s].from,t.from.x)):i.forEach(e=>e.to=e.from)}),ep(e,"in","out",(i,n,s)=>{var r,o;-1===n&&e[s]?i.forEach(t=>t.from=e[s].to):s===e.length&&e[n]?i.forEach(t=>t.from=e[n].to):"intersect"===t&&(null==(r=e[n])?void 0:r.to)&&(null==(o=e[s])?void 0:o.to)?i.forEach(t=>t.from=Jd(e[n].to,e[s].to,t.to.x)):i.forEach(e=>e.from=e.to)})}function ip(e,t,i){const n=isNaN(e.x)?t.x:e.x,s=isNaN(e.y)?t.y:e.y,r=t.x-e.x,o=t.y-e.y;return{x:n+(isNaN(r)?0:r*i),y:s+(isNaN(o)?0:o*i)}}function np(e,t,i){const{path:n}=i;let s;for(const i of e){const{from:e,to:r}=i,o=t[i.change];if(null==o||null==e||null==r)continue;const{x:a,y:l}=ip(e,r,o);if(!1===i.moveTo)n.lineTo(a,l);else if(!0!==i.moveTo&&s){if(s){const e="in"===i.moveTo?o:1-o,{x:t,y:r}=ip(s,{x:a,y:l},e);n.lineTo(t,r),n.moveTo(a,l)}}else n.moveTo(a,l);s={x:a,y:l}}}function sp({id:e,visible:t,nodeDataDependencies:i},n,...s){const{seriesRectWidth:r,seriesRectHeight:o}=i;ks(e,"path_properties",n,s,{clipX:0},{clipX:r},{phase:"initial",start:{clipMode:"normal",clipY:o,visible:t},finish:{clipMode:void 0,visible:t}})}function rp({id:e},t,i,n="add",...s){ks(e,t,i,s,{opacity:0},{opacity:1},{phase:n})}function op({id:e},t,i,...n){ks(e,t,i,n,{opacity:1},{opacity:0},{phase:"remove"})}function ap(e){return t=>({opacity:e.getOpacity(),clipScalingX:1,clipMode:void 0})}function lp({nodeDataDependencies:e},t){const i=e=>isFinite(e)?e:0;t.clipX=i(e.seriesRectWidth),t.clipY=i(e.seriesRectHeight)}function cp(e){return"continuous"===e.type||"log"===e.type}function hp(e){return"category"===e.type}function up(e,t){return e.domain.length===t.domain.length&&e.range.length===t.range.length&&e.domain.every((e,i)=>e===t.domain[i])&&e.range.every((e,i)=>e===t.range[i])}function dp(e,t){return void 0===e||void 0===t?void 0!==e||void 0!==t:cp(e)&&cp(t)?e.type===t.type&&up(e,t):!(!hp(e)||!hp(t))&&up(e,t)}function pp(e,t){if(!t)return NaN;if(e instanceof Date&&(e=e.getTime()),"continuous"===t.type&&"number"==typeof e)return(e-t.domain[0])/(t.domain[1]-t.domain[0])*(t.range[1]-t.range[0])+t.range[0];if("log"===t.type&&"number"==typeof e)return t.convert(e);const i=t.domain.findIndex(t=>t===e);return i>=0?t.range[i]:NaN}function gp(e,t){const i=Number(e),n=Number(t);return isNaN(i)||isNaN(n)?e===t:Math.abs(n-i)<.25}function fp(e=!1,t=!1){return e===t?Boolean(e):e?"in":"out"}function mp(e,t,i={}){var n,s,r,o;const{backfillSplitMode:a="intersect"}=i,l=t=>{var i,n;return{x:pp(null!=(i=t.xValue)?i:NaN,e.scales.x),y:pp(null!=(n=t.yValue)?n:NaN,e.scales.y)}},c=e=>{var i,n;return{x:pp(null!=(i=e.xValue)?i:NaN,t.scales.x),y:pp(null!=(n=e.yValue)?n:NaN,t.scales.y)}},h=[],u={added:{},moved:{},removed:{}},d=(e,t,i,n="move")=>{e&&(isNaN(e.point.x)||isNaN(e.point.y))&&(e=t);const s={from:null==e?void 0:e.point,to:null==t?void 0:t.point,moveTo:fp(null==e?void 0:e.point.moveTo,null==t?void 0:t.point.moveTo),change:n};"move"===n?(u.moved[i]=s,y++,v++):"in"===n?(u.added[i]=s,v++):"out"===n&&(u.removed[i]=s,y++),h.push(s)},{min:p,max:g}=Qd(t.nodeData),{min:f,max:m}=Qd(e.nodeData);let y=0,v=0;for(;y<t.nodeData.length||v<e.nodeData.length;){const i=t.nodeData[y],a=e.nodeData[v],h=i?l(i):void 0,u=a?c(a):void 0,b=void 0;if(h&&gp(h.x,null==a?void 0:a.point.x))d(i,a,a.xValue,"move");else if(h&&h.x<(null!=(n=null==f?void 0:f.point.x)?n:-1/0))d(i,b,i.xValue,"out");else if(h&&h.x>(null!=(s=null==m?void 0:m.point.x)?s:1/0))d(i,b,i.xValue,"out");else if(u&&u.x<(null!=(r=null==p?void 0:p.point.x)?r:-1/0))d(b,a,a.xValue,"in");else if(u&&u.x>(null!=(o=null==g?void 0:g.point.x)?o:1/0))d(b,a,a.xValue,"in");else if(h&&h.x<(null==a?void 0:a.point.x))d(i,b,i.xValue,"out");else if(u&&u.x<(null==i?void 0:i.point.x))d(b,a,a.xValue,"in");else if(i)d(i,b,i.xValue,"out");else{if(!a)throw new Error("Unable to process points");d(b,a,a.xValue,"in")}}return tp(h,a),{result:h,resultMap:u}}function yp(e,t,i,n={}){var s,r,o;const{backfillSplitMode:a="intersect",multiDatum:l=!1}=n,c=[],h={added:{},moved:{},removed:{}},u={added:{},moved:{},removed:{}},d={in:"added",move:"moved",out:"removed"};let p,g;const m=(e,t)=>{var i;const n=d[t.change];l?(null!=(i=u[n])[e]||(i[e]=[]),u[n][e].push(t)):h[n][e]=t,p=t,g=Yo(e)};let y=0,v=0,b=!1;for(;y<t.nodeData.length||v<e.nodeData.length;){const n=t.nodeData[y],a=e.nodeData[v],h=Yo(null==n?void 0:n.xValue),u=Yo(null==a?void 0:a.xValue);let d;if(h===u)d={change:"move",moveTo:fp(null!=(s=n.point.moveTo)&&s,a.point.moveTo),from:n.point,to:a.point},m(null==n?void 0:n.xValue,d),y++,v++;else if(null==i?void 0:i.removed.has(String(h)))d={change:"out",moveTo:null!=(r=n.point.moveTo)&&r,from:n.point},m(null==n?void 0:n.xValue,d),y++;else if(null==i?void 0:i.added.has(String(u)))d={change:"in",moveTo:null!=(o=a.point.moveTo)&&o,to:a.point},m(null==a?void 0:a.xValue,d),v++;else if(l&&p&&g===h)d=f({},p),m(null==n?void 0:n.xValue,d),y++;else{if(!l||!p||g!==u){b=!0;break}d=f({},p),m(null==a?void 0:a.xValue,d),v++}c.push(d)}let C=-1/0;return b||(b=c.some(e=>{const{change:t,to:{x:i=-1/0}={}}=e;if("out"===t)return;const n=i<C;return C=i,n})),b?{result:void 0,resultMap:void 0}:(tp(c,a),{result:c,resultMap:l?u:h})}function vp(e,t,i){var n,s,r,o;let a="updated";const l=e=>e.visible;if(!l(t)&&l(e))a="added";else if(l(t)&&!l(e))a="removed";else for(let e=0;e<i.length&&"move"===i[e].change&&(null==(n=i[e].from)?void 0:n.x)===(null==(s=i[e].to)?void 0:s.x)&&(null==(r=i[e].from)?void 0:r.y)===(null==(o=i[e].to)?void 0:o.y);e++)if(e===i.length-1)return"no-op";return a}function bp(e,t,i,n,s){const r=vp(e,t,i),o=function(e,t){const i="none"===t?"updated":e,n={fromFn:t=>{let n;return n="removed"===e?{finish:{visible:!1}}:"added"===e?{start:{visible:!0}}:{},f({phase:Is[i]},n)},toFn:e=>({phase:Is[i]})};return"fade"===t?{fromFn:t=>{const i="added"===e?0:t.opacity;return f({opacity:i},n.fromFn(t))},toFn:t=>f({opacity:"removed"===e?0:1},n.toFn(t))}:n}(r,n);return{status:r,path:{addPhaseFn:(e,t)=>{s(i,{move:1,in:e},t)},updatePhaseFn:(e,t)=>{s(i,{move:e},t)},removePhaseFn:(e,t)=>{s(i,{move:0,out:e},t)}},pathProperties:o}}function Cp(e,t,i){var n,s,r;const o="category"===(null==(n=e.scales.x)?void 0:n.type);if(o!==("category"===(null==(s=t.scales.x)?void 0:s.type)))return;const{result:a,resultMap:l}=o?yp(e,t,i):mp(e,t);let c="updated";if(t.visible&&!e.visible?c="removed":!t.visible&&e.visible&&(c="added"),void 0===a||void 0===l)return;const h=null==(r=null==i?void 0:i.changed)||r||function(e,t){return!dp(e.scales.x,t.scales.x)||!dp(e.scales.y,t.scales.y)}(e,t)||"updated"!==c,u=bp(e,t,a,"fade",np),d=Xd(l,c);return m(f({},u),{marker:d,hasMotion:h})}b([$s(er)],Wd.prototype,"xKey",2),b([$s(er,{optional:!0})],Wd.prototype,"xName",2),b([$s(er)],Wd.prototype,"yKey",2),b([$s(er,{optional:!0})],Wd.prototype,"yName",2),b([$s(nr,{optional:!0})],Wd.prototype,"normalizedTo",2),b([$s(fr)],Wd.prototype,"fill",2),b([$s(sr)],Wd.prototype,"fillOpacity",2),b([$s(fr)],Wd.prototype,"stroke",2),b([$s(nr)],Wd.prototype,"strokeWidth",2),b([$s(sr)],Wd.prototype,"strokeOpacity",2),b([$s(Er)],Wd.prototype,"lineDash",2),b([$s(nr)],Wd.prototype,"lineDashOffset",2),b([$s(Xs)],Wd.prototype,"shadow",2),b([$s(Xs)],Wd.prototype,"marker",2),b([$s(Xs)],Wd.prototype,"label",2),b([$s(Xs)],Wd.prototype,"tooltip",2),b([$s(Qs)],Wd.prototype,"connectMissingData",2);var wp=(e=>(e[e.Fill=0]="Fill",e[e.Stroke=1]="Stroke",e[e.Marker=2]="Marker",e[e.Label=3]="Label",e))(wp||{});function Sp(e){const{points:t,phantomPoints:i}=e.fillData;return{top:t,bottom:i}}function xp(e,t,i){return{scales:t.scales,nodeData:i[e],visible:t.visible}}function Ep(e,t,i){var n,s;const r="category"===(null==(n=e.scales.x)?void 0:n.type);if(r!==("category"===(null==(s=t.scales.x)?void 0:s.type)))return;let o="updated";t.visible&&!e.visible?o="removed":!t.visible&&e.visible&&(o="added");const{resultMap:a}=r?yp(e,t,i,{backfillSplitMode:"static",multiDatum:!0}):mp(e,t,{backfillSplitMode:"static"}),{top:l,bottom:c}=r?function(e,t,i){const n=Sp(t),s=Sp(e),r={multiDatum:!0};return{top:yp(xp("top",e,s),xp("top",t,n),i,r),bottom:yp(xp("bottom",e,s),xp("bottom",t,n),i,r)}}(e,t,i):function(e,t){const i=Sp(t),n=Sp(e);return{top:mp(xp("top",e,n),xp("top",t,i)),bottom:mp(xp("bottom",e,n),xp("bottom",t,i))}}(e,t);if(void 0===a||void 0===l.result||void 0===c.result)return;const h=bp(e,t,[...l.result,...c.result.reverse()],!!t.stackVisible&&e.stackVisible?"none":"fade",np),u=Xd(a,o);return{status:h.status,fill:h,marker:u}}var Ap=class extends Wu{constructor(e){super({moduleCtx:e,directionKeys:Vu,directionNames:Hu,pathsPerSeries:2,pathsZIndexSubOrderOffset:[0,1e3],hasMarkers:!0,markerSelectionGarbageCollection:!1,pickModes:[1,0],animationResetFns:{path:ap({getOpacity:()=>this.getOpacity()}),label:Fd,marker:(e,t)=>f(f({},{opacity:1,scalingX:1,scalingY:1}),qd(0,t))}}),this.properties=new Wd}processData(e){return w(this,null,function*(){var t,i;if(null==this.data||!this.properties.isValid())return;const{data:n,visible:s,seriesGrouping:{groupIndex:r=this.id,stackCount:o=1}={}}=this,{xKey:a,yKey:l,connectMissingData:c,normalizedTo:h}=this.properties,u=!this.ctx.animationManager.isSkipped(),d=null==(t=this.axes.x)?void 0:t.scale,p=null==(i=this.axes.y)?void 0:i.scale,{isContinuousX:g,xScaleType:y,yScaleType:v}=this.getScaleInformation({xScale:d,yScale:p}),b=[`area-stack-${r}-yValues`,`area-stack-${r}-yValues-trailing`,`area-stack-${r}-yValues-prev`,`area-stack-${r}-yValues-trailing-prev`,`area-stack-${r}-yValues-marker`],C=[];ke(h)&&(C.push(Dh([b[0],b[1],b[4]],h,"range")),C.push(Dh([b[2],b[3]],h,"range"))),!g&&u&&this.processedData&&C.push(Nh(this.processedData)),u&&C.push(kh());const w={invalidValue:null};c&&o>1&&(w.invalidValue=0),s||(w.forceValue=0),yield this.requestDataModel(e,n,{props:[Uh(a,y,{id:"xValue"}),zh(l,v,f({id:"yValueRaw"},w)),...Kh(l,"window","current",m(f({id:"yValueEnd"},w),{groupId:b[0]}),v),...Kh(l,"window-trailing","current",m(f({id:"yValueStart"},w),{groupId:b[1]}),v),...Kh(l,"window","last",m(f({id:"yValuePreviousEnd"},w),{groupId:b[2]}),v),...Kh(l,"window-trailing","last",m(f({id:"yValuePreviousStart"},w),{groupId:b[3]}),v),...Kh(l,"normal","current",m(f({id:"yValueCumulative"},w),{groupId:b[4]}),v),...C],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")})}getSeriesDomain(e){const{processedData:t,dataModel:i,axes:n}=this;if(!t||!i||0===t.data.length)return[];const s=n.x,r=n.y,o=i.resolveProcessedDataDefById(this,"xValue"),a=i.getDomain(this,"xValue","key",t),l=i.getDomain(this,"yValueEnd","value",t);return"x"===e?"key"===(null==o?void 0:o.def.type)&&"category"===o.def.valueType?a:Yc(ln(a),s):Yc(r instanceof ed||r instanceof id?l:[l[0]>0?0:l[0],l[1]<0?0:l[1]],r)}createNodeData(){return w(this,null,function*(){var e;const{axes:t,data:i,processedData:{data:n}={},dataModel:s}=this,r=t.x,o=t.y;if(!(r&&o&&i&&s&&this.properties.isValid()))return;const{yKey:a,xKey:l,marker:c,label:h,fill:u,stroke:d,connectMissingData:p}=this.properties,{scale:g}=r,{scale:y}=o,{isContinuousY:v}=this.getScaleInformation({xScale:g,yScale:y}),b=(null!=(e=g.bandwidth)?e:0)/2,C=s.resolveProcessedDataDefsByIds(this,["yValueStart","yValueEnd","yValueRaw","yValuePreviousStart","yValuePreviousEnd","yValueCumulative"]),w=e=>m(f({},e),{point:m(f({},e.point),{moveTo:!0})}),S=(e,t,i)=>{const n=g.convert(e)+b,s=y.convert(t);return[{point:{x:n,y:y.convert(i)},yValue:i,xValue:e},{point:{x:n,y:s},yValue:t,xValue:e}]},x=(e,t,i)=>{let n;return(ke(this.properties.normalizedTo)?v&&$o(i):!isNaN(i))&&(n=t),{x:g.convert(e)+b,y:y.convert(n),size:c.size}},E=a,A=[],M=[],{visibleSameStackCount:T}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this),D={itemId:E,fillData:{itemId:E,points:[],phantomPoints:[]},strokeData:{itemId:E,points:[]},labelData:A,nodeData:M,scales:this.calculateScaling(),visible:this.visible,stackVisible:T>0},I=D.fillData.points,R=D.fillData.phantomPoints,k=D.strokeData.points;let P,_=-1,L=-1/0;return null==n||n.forEach(e=>{const{keys:t,keys:[i],datum:n,values:r}=e;r.forEach((e,r)=>{var o,g,f;_++;const m=n[r],y=s.resolveProcessedDataDefsValues(C,{keys:t,values:e}),{yValueRaw:v,yValueCumulative:b}=y;let{yValueStart:T,yValueEnd:D,yValuePreviousStart:N,yValuePreviousEnd:O}=y;const F=null!=v,G=x(i,+b,v);if(F&&c&&M.push({index:_,series:this,itemId:E,datum:m,midPoint:{x:G.x,y:G.y},cumulativeValue:D,yValue:v,xValue:i,yKey:a,xKey:l,point:G,fill:null!=(o=c.fill)?o:u,stroke:null!=(g=c.stroke)?g:d,strokeWidth:null!=(f=c.strokeWidth)?f:this.getStrokeWidth(this.properties.strokeWidth)}),F&&h){const e=this.getLabelText(h,{value:v,datum:m,xKey:l,yKey:a,xName:this.properties.xName,yName:this.properties.yName},e=>ze(e)?e.toFixed(2):String(e));A.push({index:_,series:this,itemId:a,datum:m,x:G.x,y:G.y,label:e?{text:e,fontStyle:h.fontStyle,fontWeight:h.fontWeight,fontSize:h.fontSize,fontFamily:h.fontFamily,textAlign:"center",textBaseline:"bottom",fill:h.color}:void 0})}const B=null!=P&&null!=i,V=null!=L&&F;V||(T=null!=T?T:0,D=null!=T?T:0,N=null!=N?N:0,O=null!=N?N:0);const[H,U]=S(P,N,O),[z,W]=S(i,T,D);!B||p&&!V||(I.push(H,z),R.push(U,W)),V&&_>0&&k.push(w(H),z),P=i,L=v})}),k.length>0&&(k[0]=w(k[0])),D})}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}markerFactory(){const{shape:e}=this.properties.marker;return new(_u(e))}updatePathNodes(e){return w(this,null,function*(){const{opacity:t,visible:i,animationEnabled:n}=e,[s,r]=e.paths,o=this.getStrokeWidth(this.properties.strokeWidth);r.setProperties({tag:1,fill:void 0,lineJoin:r.lineCap="round",pointerEvents:1,stroke:this.properties.stroke,strokeWidth:o,strokeOpacity:this.properties.strokeOpacity,lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset,opacity:t,visible:i}),s.setProperties({tag:0,stroke:void 0,lineJoin:"round",pointerEvents:1,fill:this.properties.fill,fillOpacity:this.properties.fillOpacity,lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset,strokeOpacity:this.properties.strokeOpacity,fillShadow:this.properties.shadow,opacity:t,visible:i||n,strokeWidth:o}),lp(this,r),lp(this,s)})}updatePaths(e){return w(this,null,function*(){this.updateAreaPaths(e.paths,e.contextData)})}updateAreaPaths(e,t){this.updateFillPath(e,t),this.updateStrokePath(e,t)}updateFillPath(e,t){const{fillData:i}=t,[n]=e,{path:s}=n;let r;s.clear(!0);for(const{point:e}of P(i.points,function*(e){for(let t=e.length-1;t>=0;t--)yield e[t]}(i.phantomPoints)))e.moveTo?s.moveTo(e.x,e.y):(null==r?void 0:r.y)!==e.y&&(r&&s.lineTo(r.x,r.y),s.lineTo(e.x,e.y)),r=e;r&&s.lineTo(r.x,r.y),s.closePath(),n.checkPathDirty()}updateStrokePath(e,t){const{strokeData:i}=t,[,n]=e,{path:s}=n;s.clear(!0);for(const{point:e}of i.points)e.moveTo?s.moveTo(e.x,e.y):s.lineTo(e.x,e.y);n.checkPathDirty()}updateMarkerSelection(e){return w(this,null,function*(){const{nodeData:t,markerSelection:i}=e;return this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(this.properties.marker.enabled?t:[])})}updateMarkerNodes(e){return w(this,null,function*(){const{markerSelection:t,isHighlight:i}=e,{xKey:n,yKey:s,marker:r,fill:o,stroke:a,strokeWidth:l,fillOpacity:c,strokeOpacity:h,highlightStyle:u}=this.properties,d=qe(i&&u.item,r.getStyle(),{fill:o,stroke:a,strokeWidth:l,fillOpacity:c,strokeOpacity:h});t.each((e,t)=>{this.updateMarkerStyle(e,r,{datum:t,highlighted:i,xKey:n,yKey:s},d)}),i||this.properties.marker.markClean()})}updateLabelSelection(e){return w(this,null,function*(){const{labelData:t,labelSelection:i}=e;return i.update(t,e=>{e.tag=3})})}updateLabelNodes(e){return w(this,null,function*(){const{labelSelection:t}=e,{enabled:i,fontStyle:n,fontWeight:s,fontSize:r,fontFamily:o,color:a}=this.properties.label;t.each((e,t)=>{const{x:l,y:c,label:h}=t;h&&i&&this.visible?(e.fontStyle=n,e.fontWeight=s,e.fontSize=r,e.fontFamily=o,e.textAlign=h.textAlign,e.textBaseline=h.textBaseline,e.text=h.text,e.x=l,e.y=c-10,e.fill=a,e.visible=!0):e.visible=!1})})}getTooltipHtml(e){const{id:t,axes:i,dataModel:n}=this,{xKey:s,xName:r,yName:o,tooltip:a,marker:l}=this.properties,{yKey:c,xValue:h,yValue:u,datum:d,itemId:p}=e,g=i.x,f=i.y;if(!this.properties.isValid()||!(g&&f&&ze(u))||!n)return tl;const m=g.formatDatum(h),y=f.formatDatum(u),v=Ld(o),b=Ld(m+": "+y),C=qe({fill:this.properties.fill},l.getStyle(),{stroke:this.properties.stroke,strokeWidth:this.properties.strokeWidth}),{fill:w}=this.getMarkerStyle(l,{datum:e,xKey:s,yKey:c,highlighted:!1},C);return a.toTooltipHtml({title:v,content:b,backgroundColor:w},{datum:d,itemId:p,xKey:s,xName:r,yKey:c,yName:o,color:w,title:v,seriesId:t})}getLegendData(e){var t,i,n,s;if(!(null==(t=this.data)?void 0:t.length)||!this.properties.isValid()||"category"!==e)return[];const{yKey:r,yName:o,fill:a,stroke:l,fillOpacity:c,strokeOpacity:h,strokeWidth:u,lineDash:d,marker:p,visible:g}=this.properties,f=!p.enabled||void 0===p.fill;return[{legendType:e,id:this.id,itemId:r,seriesId:this.id,enabled:g,label:{text:null!=o?o:r},marker:{shape:p.shape,fill:f?a:p.fill,fillOpacity:f?c:p.fillOpacity,stroke:null!=(i=p.stroke)?i:l,strokeOpacity:null!=(n=p.strokeOpacity)?n:h,strokeWidth:null!=(s=p.strokeWidth)?s:0,enabled:p.enabled||u<=0},line:{stroke:l,strokeOpacity:h,strokeWidth:u,lineDash:d}}]}animateEmptyUpdateReady(e){const{markerSelection:t,labelSelection:i,contextData:n,paths:s}=e,{animationManager:r}=this.ctx;this.updateAreaPaths(s,n),sp(this,r,...s),fa([t],qd),Kd(this,r,t),Nd(this,"labels",r,i)}animateReadyResize(e){const{contextData:t,paths:i}=e;this.updateAreaPaths(i,t),super.animateReadyResize(e)}animateWaitingUpdateReady(e){var t,i;const{animationManager:n}=this.ctx,{markerSelection:s,labelSelection:r,contextData:o,paths:a,previousContextData:l}=e,[c,h]=a;if(null==c&&null==h)return;super.resetAllAnimation(e);const u=()=>{this.updateAreaPaths(a,o),this.updateStrokePath(a,o)};if(null==o||null==l)return u(),jd(this,n,"added",s),rp(this,"fill_path_properties",n,"add",c),rp(this,"stroke",n,"trailing",h),void Nd(this,"labels",n,r);const d=Ep(o,l,null==(i=null==(t=this.processedData)?void 0:t.reduced)?void 0:i.diff);if(void 0===d)return n.skipCurrentBatch(),void u();"no-op"!==d.status&&(jd(this,n,void 0,s),Rs(this.id,"fill_path_properties",n,[c],d.fill.pathProperties),Pd(this.id,"fill_path_update",n,[c],d.fill.path),this.updateStrokePath(a,o),rp(this,"stroke",n,"trailing",h),Nd(this,"labels",n,r))}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new xo}getFormattedMarkerStyle(e){const{xKey:t,yKey:i}=e;return this.getMarkerStyle(this.properties.marker,{datum:e,xKey:t,yKey:i,highlighted:!0})}computeFocusBounds(e){return Zd(this,e)}};Ap.className="AreaSeries",Ap.type="area";var Mp={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"area",instanceConstructor:Ap,stackable:!0,defaultAxes:[{type:"number",position:"left"},{type:"category",position:"bottom"}],themeTemplate:{series:{__extends__:zt,nodeClickRange:"nearest",tooltip:{position:{type:"node"}},fillOpacity:.8,strokeOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,shadow:{enabled:!1,color:ei,xOffset:3,yOffset:3,blur:5},marker:{__extends__:Wt,enabled:!1,fillOpacity:1,strokeOpacity:1,strokeWidth:0},label:{enabled:!1,fontSize:12,fontFamily:jt,color:$t}}},paletteFactory:e=>{const{marker:t}=kd(e);return{fill:t.fill,stroke:t.stroke,marker:t}}};function*Tp(e){for(const t of e.children)yield t}function Dp(e,t){for(const i of t){const t=i.datum;void 0===t?L.error("undefined datum"):e.addValue(i,t)}}function Ip(e,t){const{x:i,y:n}=e.contentGroup.transformPoint(t.x,t.y),{nearest:s,distanceSquared:r}=e.getQuadTree().find(i,n);if(void 0!==s)return{datum:s.value,distance:Math.sqrt(r)}}var Rp=class extends zu{constructor(){super(...arguments),this.direction="vertical"}};b([$s(Pr)],Rp.prototype,"direction",2);var kp=class extends Wu{constructor(){super(...arguments),this.groupScale=new Ws,this.smallestDataInterval=void 0}getBandScalePadding(){return{inner:.2,outer:.1}}shouldFlipXY(){return!this.isVertical()}isVertical(){return"vertical"===this.properties.direction}getBarDirection(){return this.shouldFlipXY()?"x":"y"}getCategoryDirection(){return this.shouldFlipXY()?"y":"x"}getValueAxis(){const e=this.getBarDirection();return this.axes[e]}getCategoryAxis(){const e=this.getCategoryDirection();return this.axes[e]}updateGroupScale(e){const{groupScale:t,smallestDataInterval:i,ctx:{seriesStateManager:n}}=this,s=e.scale,r=qr.is(s)?s.calcBandwidth(i):s.bandwidth,o=[],{index:a,visibleGroupCount:l}=n.getVisiblePeerGroupIndex(this);for(let e=0;e<l;e++)o.push(String(e));return t.domain=o,t.range=[0,null!=r?r:0],e instanceof Tl?t.paddingInner=e.groupPaddingInner:t.padding=e instanceof Gl?.1:0,t.round=0!==t.padding,{barWidth:t.bandwidth>=1?t.bandwidth:t.rawBandwidth,groupIndex:a}}resolveKeyDirection(e){return"x"===this.getBarDirection()?"x"===e?"y":"x":e}initQuadTree(e){Dp(e,this.datumNodesIter())}pickNodeClosestDatum(e){return Ip(this,e)}},Pp=class extends Bo{constructor(){super(...arguments),this.placement="inside"}};b([$s(_r)],Pp.prototype,"placement",2);var _p=class extends Rp{constructor(){super(...arguments),this.fill="#c16068",this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.shadow=new Bd,this.label=new Pp,this.tooltip=new zd}};function Lp({rect:e,config:t}){const{crisp:i=!0,fill:n,stroke:s,strokeWidth:r,fillOpacity:o,strokeOpacity:a,lineDash:l,lineDashOffset:c,fillShadow:h,cornerRadius:u=0,topLeftCornerRadius:d=!0,topRightCornerRadius:p=!0,bottomRightCornerRadius:g=!0,bottomLeftCornerRadius:f=!0,visible:m=!0}=t;e.crisp=i,e.fill=n,e.stroke=s,e.strokeWidth=r,e.fillOpacity=o,e.strokeOpacity=a,e.lineDash=l,e.lineDashOffset=c,e.fillShadow=h,e.topLeftCornerRadius=d?u:0,e.topRightCornerRadius=p?u:0,e.bottomRightCornerRadius=g?u:0,e.bottomLeftCornerRadius=f?u:0,e.visible=m}function Np(e){var t,i,n,s,r,o,a=e,{datum:l,isHighlighted:c,style:h,highlightStyle:u,formatter:d,seriesId:p,ctx:{callbackCache:g}}=a,m=y(a,["datum","isHighlighted","style","highlightStyle","formatter","seriesId","ctx"]);const{fill:v,fillOpacity:b,stroke:C,strokeWidth:w}=qe(c&&u,h),{strokeOpacity:S,fillShadow:x,lineDash:E,lineDashOffset:A,cornerRadius:M=0,topLeftCornerRadius:T=!0,topRightCornerRadius:D=!0,bottomRightCornerRadius:I=!0,bottomLeftCornerRadius:R=!0}=h;let k;return d&&(k=g.call(d,f({datum:l.datum,xKey:l.xKey,fill:v,stroke:C,strokeWidth:w,cornerRadius:M,highlighted:c,seriesId:p},m))),{fill:null!=(t=null==k?void 0:k.fill)?t:v,stroke:null!=(i=null==k?void 0:k.stroke)?i:C,strokeWidth:null!=(n=null==k?void 0:k.strokeWidth)?n:w,fillOpacity:null!=(s=null==k?void 0:k.fillOpacity)?s:b,strokeOpacity:null!=(r=null==k?void 0:k.strokeOpacity)?r:S,lineDash:E,lineDashOffset:A,fillShadow:x,cornerRadius:null!=(o=null==k?void 0:k.cornerRadius)?o:M,topLeftCornerRadius:T,topRightCornerRadius:D,bottomRightCornerRadius:I,bottomLeftCornerRadius:R}}function Op(e=[]){const[t,i]=e;return!(0!==t||1!==i)}b([$s(er)],_p.prototype,"xKey",2),b([$s(er,{optional:!0})],_p.prototype,"xName",2),b([$s(er)],_p.prototype,"yKey",2),b([$s(er,{optional:!0})],_p.prototype,"yName",2),b([$s(er,{optional:!0})],_p.prototype,"stackGroup",2),b([$s(tr,{optional:!0})],_p.prototype,"normalizedTo",2),b([$s(fr)],_p.prototype,"fill",2),b([$s(sr)],_p.prototype,"fillOpacity",2),b([$s(fr)],_p.prototype,"stroke",2),b([$s(nr)],_p.prototype,"strokeWidth",2),b([$s(sr)],_p.prototype,"strokeOpacity",2),b([$s(Er)],_p.prototype,"lineDash",2),b([$s(nr)],_p.prototype,"lineDashOffset",2),b([$s(nr)],_p.prototype,"cornerRadius",2),b([$s(Js,{optional:!0})],_p.prototype,"formatter",2),b([$s(Xs,{optional:!0})],_p.prototype,"shadow",2),b([$s(Xs)],_p.prototype,"label",2),b([$s(Xs)],_p.prototype,"tooltip",2);var Fp=e=>{var t;return $n(null!=(t=e.yValue)?t:0)};function Gp(e,t,i){const{startingX:n,startingY:s}=function(e,t){const i=t[e?"y":"x"];let n=1/0,s=0;return i?(e?s=i.scale.convert(qr.is(i.scale)?0:Math.max(...i.range)):n=i.scale.convert(qr.is(i.scale)?0:Math.min(...i.range)),{startingX:n,startingY:s}):{startingX:n,startingY:s}}(e,t);return{isVertical:e,calculate:(t,i)=>{let r=e?t.x:n,o=e?s:t.y,a=e?t.width:0,l=e?0:t.height;const{opacity:c}=t;let h;return i&&(isNaN(r)||isNaN(o))&&(({x:r,y:o}=i),a=e?i.width:0,l=e?0:i.height,e&&!Fp(i)?o+=i.height:!e&&Fp(i)&&(r+=i.width)),h=null==t.clipBBox?void 0:Fp(t)?e?new es(r,o-l,a,l):new es(r-a,o,a,l):new es(r,o,a,l),{x:r,y:o,width:a,height:l,clipBBox:h,opacity:c}},mode:i}}function Bp(e,t){return{isVertical:e,calculate:t=>({x:e?t.x:t.x+t.width/2,y:e?t.y+t.height/2:t.y,width:e?t.width:0,height:e?0:t.height,clipBBox:t.clipBBox,opacity:t.opacity}),mode:t}}function Vp(e){const t=e=>null==e||isNaN(e.x)||isNaN(e.y);return{toFn:(i,n,s)=>{let r;return r="removed"===s&&null==i.datum&&"fade"===e.mode?m(f({},Hp(0,n)),{opacity:0}):"removed"===s||t(n)?e.calculate(n,i.previousDatum):{x:n.x,y:n.y,width:n.width,height:n.height,clipBBox:n.clipBBox,opacity:n.opacity},r},fromFn:(i,n,s)=>{let r;"updated"===s&&t(n)?s="removed":"updated"===s&&t(i.previousDatum)&&(s="added"),r="added"===s&&null==i.previousDatum&&"fade"===e.mode?m(f({},Hp(0,n)),{opacity:0}):"unknown"===s||"added"===s?e.calculate(n,i.previousDatum):{x:i.x,y:i.y,width:i.width,height:i.height,clipBBox:i.clipBBox,opacity:i.opacity};const o=Is[s];return m(f({},r),{phase:o})}}}function Hp(e,{x:t,y:i,width:n,height:s,clipBBox:r,opacity:o}){return{x:t,y:i,width:n,height:s,clipBBox:r,opacity:o}}function Up(e,t,i){if(void 0===e)return;const{x:n,y:s,width:r,height:o}=e;return t.inverseTransformBBox(new es(n,s,r,o)).clip(i)}function zp(e,t,i){if(t.enabled&&i){const{x:n,y:s,text:r,textAlign:o,textBaseline:a}=i,{color:l,fontStyle:c,fontWeight:h,fontSize:u,fontFamily:d}=t;e.setProperties({visible:!0,x:n,y:s,text:r,fill:l,fontStyle:c,fontWeight:h,fontSize:u,fontFamily:d,textAlign:o,textBaseline:a})}else e.visible=!1}function Wp({isPositive:e,isVertical:t,placement:i,padding:n=0,rect:s}){let r=s.x+s.width/2,o=s.y+s.height/2,a="center",l="middle";switch(i){case"start":t?(o=e?s.y+s.height+n:s.y-n,l=e?"top":"bottom"):(r=e?s.x-n:s.x+s.width+n,a=e?"start":"end");break;case"outside":case"end":t?(o=e?s.y-n:s.y+s.height+n,l=e?"bottom":"top"):(r=e?s.x+s.width+n:s.x-n,a=e?"start":"end")}return{x:r,y:o,textAlign:a,textBaseline:l}}var jp=class extends kp{constructor(e){super({moduleCtx:e,directionKeys:Vu,directionNames:Hu,pickModes:[0],pathsPerSeries:0,hasHighlightedLabels:!0,datumSelectionGarbageCollection:!1,animationAlwaysUpdateSelections:!0,animationResetFns:{datum:Hp,label:Fd}}),this.properties=new _p}processData(e){return w(this,null,function*(){var t,i,n;if(!this.properties.isValid()||!this.data)return;const{seriesGrouping:{groupIndex:s=this.id}={},data:r=[]}=this,{xKey:o,yKey:a,normalizedTo:l}=this.properties,c=!this.ctx.animationManager.isSkipped(),h=null==(t=this.getCategoryAxis())?void 0:t.scale,u=null==(i=this.getValueAxis())?void 0:i.scale,{isContinuousX:d,xScaleType:p,yScaleType:g}=this.getScaleInformation({xScale:h,yScale:u}),m=`bar-stack-${s}-yValues`,y=`${m}-trailing`,v=[];ze(l)&&v.push(Dh([m,y],Math.abs(l),"range")),c&&this.processedData&&v.push(Nh(this.processedData)),c&&v.push(kh());const b=this.visible?{}:{forceValue:0},{processedData:C}=yield this.requestDataModel(e,r,{props:[Uh(o,p,{id:"xValue"}),zh(a,g,f({id:"yValue-raw",invalidValue:null},b)),...Kh(a,"normal","current",f({id:"yValue-end",rangeId:"yValue-range",invalidValue:null,missingValue:0,groupId:m,separateNegative:!0},b),g),...Kh(a,"trailing","current",f({id:"yValue-start",invalidValue:null,missingValue:0,groupId:y,separateNegative:!0},b),g),...d?[Ah]:[],...v],groupByKeys:!0,groupByData:!1});this.smallestDataInterval=null==(n=C.reduced)?void 0:n.smallestKeyInterval,this.animationState.transition("updateData")})}getSeriesDomain(e){var t;const{processedData:i,dataModel:n,smallestDataInterval:s}=this;if(!i||!n||0===i.data.length)return[];const r=this.getCategoryAxis(),o=this.getValueAxis(),a=n.resolveProcessedDataDefById(this,"xValue"),l=n.getDomain(this,"xValue","key",i),c=n.getDomain(this,"yValue-end","value",i);if(e===this.getCategoryDirection()){if("key"===(null==a?void 0:a.def.type)&&"category"===a.def.valueType)return l;const e=ze(s)?.5*s:0,i=null!=(t=ln(l))?t:[NaN,NaN];return Yc([i[0]+-e,i[1]+e],r)}return this.getValueAxis()instanceof ed?Yc(c,o):Yc([Math.min(0,c[0]),Math.max(0,c[1])],o)}createNodeData(){return w(this,null,function*(){const{dataModel:e}=this,t=this.getCategoryAxis(),i=this.getValueAxis();if(!(e&&t&&i&&this.properties.isValid()))return;const n=t.scale,s=i.scale,{xKey:r,yKey:o,xName:a,yName:l,fill:c,stroke:h,strokeWidth:u,cornerRadius:d,legendItemName:p,label:g}=this.properties,m=i.isReversed(),{barWidth:y,groupIndex:v}=this.updateGroupScale(t),b=qr.is(n)?-.5*y:0,C=e.resolveProcessedDataIndexById(this,"xValue"),w=e.resolveProcessedDataIndexById(this,"yValue-raw"),S=e.resolveProcessedDataIndexById(this,"yValue-start"),x=e.resolveProcessedDataIndexById(this,"yValue-end"),E=e.resolveProcessedDataIndexById(this,"yValue-range"),A=!this.ctx.animationManager.isSkipped(),M={itemId:o,nodeData:[],labelData:[],scales:this.calculateScaling(),visible:this.visible||A},{groupScale:T,processedData:D}=this;return null==D||D.data.forEach(({keys:e,datum:t,values:i,aggValues:A})=>{i.forEach((i,D)=>{var I;const R=e[C],k=n.convert(R),P=+i[x],_=+i[S],L=i[w],N=L>=0&&!Object.is(L,-0),O=N!==m,F=null!=(I=null==A?void 0:A[E][N?1:0])?I:0,G=k+T.convert(String(v))+b;if(isNaN(P))return;const B=s.convert(P),V=s.convert(_),H="x"===this.getBarDirection(),U=s.convert(F),z=s.convert(0),W={x:H?Math.min(B,V):G,y:H?G:Math.min(B,V),width:H?Math.abs(V-B):y,height:H?y:Math.abs(V-B)},j=new es(W.x,W.y,W.width,W.height),$={x:H?Math.min(z,U):G,y:H?G:Math.min(z,U),width:H?Math.abs(z-U):y,height:H?y:Math.abs(z-U),clipBBox:j},{fontStyle:K,fontWeight:Y,fontSize:q,fontFamily:X,color:Z,placement:Q}=g,J=this.getLabelText(this.properties.label,{datum:t[D],value:L,xKey:r,yKey:o,xName:a,yName:l,legendItemName:p},e=>ze(e)?e.toFixed(2):String(e)),ee=J?f({text:J,fill:Z,fontStyle:K,fontWeight:Y,fontSize:q,fontFamily:X},Wp({isPositive:N,isVertical:!H,placement:Q,rect:W})):void 0,te=this.shouldFlipXY()?W.height:W.width,ie={series:this,itemId:o,datum:t[D],valueIndex:D,cumulativeValue:P,xValue:R,yValue:L,yKey:o,xKey:r,capDefaults:{lengthRatioMultiplier:te,lengthMax:te},x:$.x,y:$.y,width:$.width,height:$.height,midPoint:{x:W.x+W.width/2,y:W.y+W.height/2},fill:c,stroke:h,opacity:1,strokeWidth:u,cornerRadius:d,topLeftCornerRadius:H!==O,topRightCornerRadius:O,bottomRightCornerRadius:H===O,bottomLeftCornerRadius:!O,clipBBox:j,label:ee,missing:null==L};M.nodeData.push(ie),M.labelData.push(ie)})}),M})}nodeFactory(){return new ad}updateDatumSelection(e){return w(this,null,function*(){return e.datumSelection.update(e.nodeData,e=>{e.tag=0},e=>Oh(e.xValue,e.valueIndex))})}updateDatumNodes(e){return w(this,null,function*(){if(!this.properties.isValid())return;const{yKey:t,stackGroup:i,fill:n,fillOpacity:s,stroke:r,strokeWidth:o,strokeOpacity:a,lineDash:l,lineDashOffset:c,formatter:h,shadow:u,highlightStyle:{item:d}}=this.properties,p=this.axes.x,g=Op(null==p?void 0:p.visibleRange),f="x"===this.getCategoryDirection();e.datumSelection.each((p,m)=>{var y,v,b,C;const w={fill:n,stroke:r,fillOpacity:s,strokeOpacity:a,lineDash:l,lineDashOffset:c,fillShadow:u,strokeWidth:this.getStrokeWidth(o),cornerRadius:m.cornerRadius,topLeftCornerRadius:m.topLeftCornerRadius,topRightCornerRadius:m.topRightCornerRadius,bottomRightCornerRadius:m.bottomRightCornerRadius,bottomLeftCornerRadius:m.bottomLeftCornerRadius},S=f?(null!=(v=null==(y=m.clipBBox)?void 0:y.width)?v:m.width)>0:(null!=(C=null==(b=m.clipBBox)?void 0:b.height)?C:m.height)>0,x=Np({datum:m,ctx:this.ctx,seriesId:this.id,isHighlighted:e.isHighlight,highlightStyle:d,yKey:t,style:w,formatter:h,stackGroup:i});x.crisp=g,x.visible=S,Lp({rect:p,config:x})})})}updateLabelSelection(e){return w(this,null,function*(){const t=this.isLabelEnabled()?e.labelData:[];return e.labelSelection.update(t,e=>{e.tag=1,e.pointerEvents=1})})}updateLabelNodes(e){return w(this,null,function*(){e.labelSelection.each((e,t)=>{zp(e,this.properties.label,t.label)})})}getTooltipHtml(e){var t;const{id:i,processedData:n,ctx:{callbackCache:s}}=this,r=this.getCategoryAxis(),o=this.getValueAxis();if(!(n&&this.properties.isValid()&&r&&o))return tl;const{xKey:a,yKey:l,xName:c,yName:h,fill:u,stroke:d,strokeWidth:p,tooltip:g,formatter:m,stackGroup:y,legendItemName:v}=this.properties,{xValue:b,yValue:C,datum:w,itemId:S}=e,x=r.formatDatum(b),E=o.formatDatum(C),A=Ld(h),M=Ld(x+": "+E);let T;m&&(T=s.call(m,{seriesId:i,datum:w,xKey:a,yKey:l,stackGroup:y,fill:u,stroke:d,strokeWidth:this.getStrokeWidth(p),highlighted:!1}));const D=null!=(t=null==T?void 0:T.fill)?t:u;return g.toTooltipHtml({title:A,content:M,backgroundColor:D},f({seriesId:i,itemId:S,datum:w,xKey:a,yKey:l,xName:c,yName:h,stackGroup:y,title:A,color:D,legendItemName:v},this.getModuleTooltipParams()))}getLegendData(e){var t,i;const{showInLegend:n}=this.properties;if("category"!==e||!(null==(t=this.data)?void 0:t.length)||!this.properties.isValid()||!n)return[];const{yKey:s,yName:r,fill:o,stroke:a,strokeWidth:l,fillOpacity:c,strokeOpacity:h,legendItemName:u,visible:d}=this.properties;return[{legendType:"category",id:this.id,itemId:s,seriesId:this.id,enabled:d,label:{text:null!=(i=null!=u?u:r)?i:s},marker:{fill:o,fillOpacity:c,stroke:a,strokeWidth:l,strokeOpacity:h},legendItemName:u}]}animateEmptyUpdateReady({datumSelection:e,labelSelection:t,annotationSelections:i}){const n=Vp(Gp(this.isVertical(),this.axes,"normal"));Rs(this.id,"nodes",this.ctx.animationManager,[e],n),Nd(this,"labels",this.ctx.animationManager,t),Nd(this,"annotations",this.ctx.animationManager,...i)}animateWaitingUpdateReady(e){var t,i,n;const{datumSelection:s,labelSelection:r,annotationSelections:o,previousContextData:a}=e;this.ctx.animationManager.stopByAnimationGroupId(this.id);const l=null==(i=null==(t=this.processedData)?void 0:t.reduced)?void 0:i.diff,c=null==a?"fade":"normal",h=Vp(Gp(this.isVertical(),this.axes,c));Rs(this.id,"nodes",this.ctx.animationManager,[s],h,(e,t)=>Oh(t.xValue,t.valueIndex),l),(null==(n=null==l?void 0:l.changed)||n)&&(Nd(this,"labels",this.ctx.animationManager,r),Nd(this,"annotations",this.ctx.animationManager,...o))}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e,seriesRect:t}){var i;return Up(null==(i=this.contextNodeData)?void 0:i.nodeData[e].clipBBox,this.contentGroup,t)}};jp.className="BarSeries",jp.type="bar";var $p={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"bar",instanceConstructor:jp,stackable:!0,groupable:!0,defaultAxes:[{type:"number",position:"left"},{type:"category",position:"bottom"}],swapDefaultAxesCondition:e=>"horizontal"===(null==e?void 0:e.direction),themeTemplate:{series:{__extends__:zt,direction:"vertical",fillOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,label:{enabled:!1,fontWeight:"normal",fontSize:12,fontFamily:jt,color:Yt,placement:"inside"},shadow:{enabled:!1,color:ei,xOffset:3,yOffset:3,blur:5}}},enterpriseThemeTemplate:{series:{errorBar:{cap:{lengthRatio:.3}}}},paletteFactory:Rd},Kp=e=>{const t=ps.fromString(e),[i,n,s]=ps.RGBtoOKLCH(t.r,t.g,t.b);return{l:i,c:n,h:s,a:t.a}},Yp=class{constructor(){this.type="color",this.invalid=!0,this.domain=[0,1],this.range=["red","blue"],this.parsedRange=this.range.map(Kp)}update(){const{domain:e,range:t}=this;e.length<2&&(L.warnOnce("`colorDomain` should have at least 2 values."),0===e.length?e.push(0,1):1===e.length&&e.push(e[0]+1));for(let t=1;t<e.length;t++)if(e[t-1]>=e[t]){L.warnOnce("`colorDomain` values should be supplied in ascending order."),e.sort((e,t)=>e-t);break}if(t.length<e.length)for(let i=t.length;i<e.length;i++)t.push(t.length>0?t[0]:"black");this.parsedRange=this.range.map(Kp)}convert(e){this.refresh();const{domain:t,range:i,parsedRange:n}=this,s=t[0],r=t.at(-1),o=i[0],a=i[i.length-1];if(e<=s)return o;if(e>=r)return a;let l,c;if(2===t.length){const t=(e-s)/(r-s),n=1/(i.length-1);l=i.length<=2?0:Math.min(Math.floor(t*(i.length-1)),i.length-2),c=(t-l*n)/n}else{for(l=0;l<t.length-2&&!(e<t[l+1]);l++);const i=t[l];c=(e-i)/(t[l+1]-i)}return((e,t,i)=>{let n,s;if(i=Hn(0,i,1),Number.isNaN(e.h)&&Number.isNaN(t.h))n=0,s=0;else if(Number.isNaN(e.h))n=t.h,s=t.c;else if(Number.isNaN(t.h))n=e.h,s=e.c;else{const r=e.h;let o=t.h;const a=t.h-e.h;a>180?o-=360:a<-180&&(o+=360),n=r*(1-i)+o*i,s=e.c*(1-i)+t.c*i}const r=e.l*(1-i)+t.l*i,o=e.a*(1-i)+t.a*i;return ps.fromOKLCH(r,s,n,o)})(n[l],n[l+1],c).toRgbaString()}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&L.warnOnce("Expected update to not invalidate scale"))}};b([Us],Yp.prototype,"domain",2),b([Us],Yp.prototype,"range",2);var qp=class extends Hd{constructor(){super(...arguments),this.maxSize=30}};b([$s(nr),ns({redraw:3})],qp.prototype,"maxSize",2),b([$s(vr,{optional:!0}),ns({redraw:3})],qp.prototype,"domain",2);var Xp=class extends Bo{constructor(){super(...arguments),this.placement="top"}};b([$s(Nr)],Xp.prototype,"placement",2);var Zp=class extends zu{constructor(){super(...arguments),this.colorRange=["#ffff00","#00ff00","#0000ff"],this.marker=new qp,this.label=new Xp,this.tooltip=new zd}};b([$s(er)],Zp.prototype,"xKey",2),b([$s(er)],Zp.prototype,"yKey",2),b([$s(er)],Zp.prototype,"sizeKey",2),b([$s(er,{optional:!0})],Zp.prototype,"labelKey",2),b([$s(er,{optional:!0})],Zp.prototype,"colorKey",2),b([$s(er,{optional:!0})],Zp.prototype,"xName",2),b([$s(er,{optional:!0})],Zp.prototype,"yName",2),b([$s(er,{optional:!0})],Zp.prototype,"sizeName",2),b([$s(er,{optional:!0})],Zp.prototype,"labelName",2),b([$s(er,{optional:!0})],Zp.prototype,"colorName",2),b([$s(vr,{optional:!0})],Zp.prototype,"colorDomain",2),b([$s(mr)],Zp.prototype,"colorRange",2),b([$s(er,{optional:!0})],Zp.prototype,"title",2),b([$s(Xs)],Zp.prototype,"marker",2),b([$s(Xs)],Zp.prototype,"label",2),b([$s(Xs)],Zp.prototype,"tooltip",2);var Qp=class extends Uu{constructor(e,t,i,n){super(e,t,i,n),this.sizeKey=n.properties.sizeKey}},Jp=class extends Wu{constructor(e){super({moduleCtx:e,directionKeys:Vu,directionNames:Hu,pickModes:[2,3,0],pathsPerSeries:0,hasMarkers:!0,markerSelectionGarbageCollection:!1,animationResetFns:{label:Fd,marker:Yd}}),this.NodeEvent=Qp,this.properties=new Zp,this.sizeScale=new Xu,this.colorScale=new Yp}processData(e){return w(this,null,function*(){var t,i,n,s;if(!this.properties.isValid()||null==this.data||!this.visible)return;const r=null==(t=this.axes.x)?void 0:t.scale,o=null==(i=this.axes.y)?void 0:i.scale,{xScaleType:a,yScaleType:l}=this.getScaleInformation({xScale:r,yScale:o}),c=this.colorScale.type,h=this.sizeScale.type,{xKey:u,yKey:d,sizeKey:p,labelKey:g,colorDomain:f,colorRange:m,colorKey:y,marker:v}=this.properties,{dataModel:b,processedData:C}=yield this.requestDataModel(e,this.data,{props:[Uh(u,a,{id:"xKey-raw"}),Uh(d,l,{id:"yKey-raw"}),...g?[Uh(g,"band",{id:"labelKey-raw"})]:[],zh(u,a,{id:"xValue"}),zh(d,l,{id:"yValue"}),zh(p,h,{id:"sizeValue"}),...y?[zh(y,c,{id:"colorValue"})]:[],...g?[zh(g,"band",{id:"labelValue"})]:[]]}),w=b.resolveProcessedDataIndexById(this,"sizeValue"),S=null!=(n=C.domain.values[w])?n:[];if(this.sizeScale.domain=v.domain?v.domain:S,y){const e=b.resolveProcessedDataIndexById(this,"colorValue");this.colorScale.domain=null!=(s=null!=f?f:C.domain.values[e])?s:[],this.colorScale.range=m,this.colorScale.update()}this.animationState.transition("updateData")})}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return[];const n="x"===e?"xValue":"yValue",s=t.resolveProcessedDataDefById(this,n),r=t.getDomain(this,n,"value",i);if("value"===(null==s?void 0:s.def.type)&&"category"===(null==s?void 0:s.def.valueType))return r;const o=this.axes[e];return Yc(ln(r),o)}createNodeData(){return w(this,null,function*(){var e,t,i;const{axes:n,dataModel:s,processedData:r,colorScale:o,sizeScale:a}=this,{xKey:l,yKey:c,sizeKey:h,labelKey:u,xName:d,yName:p,sizeName:g,labelName:m,label:y,colorKey:v,marker:b,visible:C}=this.properties,w=_u(b.shape),{placement:S}=y,x=n.x,E=n.y;if(!(s&&r&&C&&x&&E))return;const A=s.resolveProcessedDataIndexById(this,"xValue"),M=s.resolveProcessedDataIndexById(this,"yValue"),T=h?s.resolveProcessedDataIndexById(this,"sizeValue"):-1,D=v?s.resolveProcessedDataIndexById(this,"colorValue"):-1,I=u?s.resolveProcessedDataIndexById(this,"labelValue"):-1,R=x.scale,k=E.scale,P=(null!=(e=R.bandwidth)?e:0)/2,_=(null!=(t=k.bandwidth)?t:0)/2,L=[];a.range=[b.size,b.maxSize];const N=y.getFont();for(const{values:e,datum:t}of null!=(i=r.data)?i:[]){const i=e[A],n=e[M],s=R.convert(i)+P,r=k.convert(n)+_,C=this.getLabelText(y,{value:u?e[I]:n,datum:t,xKey:l,yKey:c,sizeKey:h,labelKey:u,xName:d,yName:p,sizeName:g,labelName:m}),x=Oo.getTextSize(String(C),N),E=h?a.convert(e[T]):b.size,O=v?o.convert(e[D]):void 0;L.push({series:this,itemId:c,yKey:c,xKey:l,datum:t,xValue:i,yValue:n,sizeValue:e[T],point:{x:s,y:r,size:E},midPoint:{x:s,y:r},fill:O,label:f({text:C},x),marker:w,placement:S})}return{itemId:c,nodeData:L,labelData:L,scales:this.calculateScaling(),visible:this.visible}})}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}getLabelData(){var e,t;return null!=(t=null==(e=this.contextNodeData)?void 0:e.labelData)?t:[]}markerFactory(){const{shape:e}=this.properties.marker;return new(_u(e))}updateMarkerSelection(e){return w(this,null,function*(){const{nodeData:t,markerSelection:i}=e;this.properties.marker.isDirty()&&(i.clear(),i.cleanup());const n=this.properties.marker.enabled?t:[];return i.update(n,void 0,e=>Oh([e.xValue,e.yValue,e.label.text]))})}updateMarkerNodes(e){return w(this,null,function*(){const{markerSelection:t,isHighlight:i}=e,{xKey:n,yKey:s,sizeKey:r,labelKey:o,marker:a}=this.properties,l=qe(i&&this.properties.highlightStyle.item,a.getStyle());this.sizeScale.range=[a.size,a.maxSize],t.each((e,t)=>{this.updateMarkerStyle(e,a,{datum:t,highlighted:i,xKey:n,yKey:s,sizeKey:r,labelKey:o},l)}),i||this.properties.marker.markClean()})}updateLabelSelection(e){return w(this,null,function*(){var t,i;const n=this.properties.label.enabled&&null!=(i=null==(t=this.chart)?void 0:t.placeLabels().get(this))?i:[];return e.labelSelection.update(n.map(e=>m(f({},e.datum),{point:{x:e.x,y:e.y,size:e.datum.point.size}})))})}updateLabelNodes(e){return w(this,null,function*(){const{label:t}=this.properties;e.labelSelection.each((e,i)=>{var n,s,r,o;e.text=i.label.text,e.fill=t.color,e.x=null!=(s=null==(n=i.point)?void 0:n.x)?s:0,e.y=null!=(o=null==(r=i.point)?void 0:r.y)?o:0,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.fontSize=t.fontSize,e.fontFamily=t.fontFamily,e.textAlign="left",e.textBaseline="top"})})}getTooltipHtml(e){var t;const i=this.axes.x,n=this.axes.y;if(!this.properties.isValid()||!i||!n)return tl;const{xKey:s,yKey:r,sizeKey:o,labelKey:a,xName:l,yName:c,sizeName:h,labelName:u,marker:d,tooltip:p}=this.properties,g=null!=(t=this.properties.title)?t:c,f=qe({fill:e.fill,strokeWidth:this.getStrokeWidth(d.strokeWidth)},d.getStyle()),{fill:m="gray"}=this.getMarkerStyle(d,{datum:e,highlighted:!1,xKey:s,yKey:r,sizeKey:o,labelKey:a},f),{datum:y,xValue:v,yValue:b,sizeValue:C,label:{text:w},itemId:S}=e,x=Ld(i.formatDatum(v)),E=Ld(n.formatDatum(b));let A=`<b>${Ld(null!=l?l:s)}</b>: ${x}<br><b>${Ld(null!=c?c:r)}</b>: ${E}`;return o&&(A+=`<br><b>${Ld(null!=h?h:o)}</b>: ${Ld(String(C))}`),a&&(A=`<b>${Ld(null!=u?u:a)}</b>: ${Ld(w)}<br>`+A),p.toTooltipHtml({title:g,content:A,backgroundColor:m},{datum:y,itemId:S,xKey:s,xName:l,yKey:r,yName:c,sizeKey:o,sizeName:h,labelKey:a,labelName:u,title:g,color:m,seriesId:this.id})}getLegendData(){var e,t;if(!(null==(e=this.data)?void 0:e.length)||!this.properties.isValid())return[];const{yKey:i,yName:n,title:s,marker:r,visible:o}=this.properties,{shape:a,fill:l,stroke:c,fillOpacity:h,strokeOpacity:u,strokeWidth:d}=r;return[{legendType:"category",id:this.id,itemId:i,seriesId:this.id,enabled:o,label:{text:null!=(t=null!=s?s:n)?t:i},marker:{shape:a,fill:null!=l?l:"rgba(0, 0, 0, 0)",stroke:null!=c?c:"rgba(0, 0, 0, 0)",fillOpacity:null!=h?h:1,strokeOpacity:null!=u?u:1,strokeWidth:null!=d?d:0}}]}animateEmptyUpdateReady({markerSelection:e,labelSelection:t}){$d(this,this.ctx.animationManager,e),Nd(this,"labels",this.ctx.animationManager,t)}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new xo}getFormattedMarkerStyle(e){const{xKey:t,yKey:i,sizeKey:n,labelKey:s}=this.properties;return this.getMarkerStyle(this.properties.marker,{datum:e,xKey:t,yKey:i,sizeKey:n,labelKey:s,highlighted:!1})}computeFocusBounds(e){return Zd(this,e)}};Jp.className="BubbleSeries",Jp.type="bubble";var eg={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"bubble",instanceConstructor:Jp,defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{__extends__:zt,tooltip:{position:{type:"node"}},marker:{__extends__:Wt,maxSize:30,fillOpacity:.8},label:{enabled:!1,fontSize:12,fontFamily:jt,color:$t}}},paletteFactory:kd},tg=class extends zu{constructor(){super(...arguments),this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.areaPlot=!1,this.aggregation="sum",this.shadow=new Bd,this.label=new Bo,this.tooltip=new zd}};b([$s(er)],tg.prototype,"xKey",2),b([$s(er,{optional:!0})],tg.prototype,"yKey",2),b([$s(er,{optional:!0})],tg.prototype,"xName",2),b([$s(er,{optional:!0})],tg.prototype,"yName",2),b([$s(fr,{optional:!0})],tg.prototype,"fill",2),b([$s(sr)],tg.prototype,"fillOpacity",2),b([$s(fr,{optional:!0})],tg.prototype,"stroke",2),b([$s(nr)],tg.prototype,"strokeWidth",2),b([$s(sr)],tg.prototype,"strokeOpacity",2),b([$s(Er)],tg.prototype,"lineDash",2),b([$s(nr)],tg.prototype,"lineDashOffset",2),b([$s(nr)],tg.prototype,"cornerRadius",2),b([$s(Qs)],tg.prototype,"areaPlot",2),b([$s(ar,{optional:!0})],tg.prototype,"bins",2),b([$s(Or(["count","sum","mean"],"a histogram aggregation"))],tg.prototype,"aggregation",2),b([$s(nr,{optional:!0})],tg.prototype,"binCount",2),b([$s(Xs)],tg.prototype,"shadow",2),b([$s(Xs)],tg.prototype,"label",2),b([$s(Xs)],tg.prototype,"tooltip",2);var ig=class extends Wu{constructor(e){super({moduleCtx:e,directionKeys:Vu,directionNames:Hu,pickModes:[0],datumSelectionGarbageCollection:!1,animationResetFns:{datum:Hp,label:Fd}}),this.properties=new tg,this.calculatedBins=[]}deriveBins(e){const t=co(e[0],e[1],10),i=uo(e[0],e[1],10),[n]=t;return[[n-i,n],...t.map(e=>[e,e+i])]}calculateNiceBins(e,t){const i=Math.floor(e[0]),n=e[1],s=t||1,{start:r,binSize:o}=this.calculateNiceStart(i,n,s);return this.getBins(r,n,o,s)}getBins(e,t,i,n){const s=[],r=this.calculatePrecision(i);for(let o=0;o<n;o++){const a=Math.round((e+o*i)*r)/r;let l=Math.round((e+(o+1)*i)*r)/r;o===n-1&&(l=Math.max(l,t)),s[o]=[a,l]}return s}calculatePrecision(e){let t=10;if(isFinite(e)&&e>0)for(;e<1;)t*=10,e*=10;return t}calculateNiceStart(e,t,i){const n=Math.abs(t-e)/i,s=Math.floor(Math.log10(n)),r=Math.pow(10,s);return{start:Math.floor(e/r)*r,binSize:n}}processData(e){return w(this,null,function*(){var t,i;this.visible||(this.processedData=void 0,this.animationState.transition("updateData"));const{xKey:n,yKey:s,areaPlot:r,aggregation:o}=this.properties,a=null==(t=this.axes.x)?void 0:t.scale,l=null==(i=this.axes.y)?void 0:i.scale,{xScaleType:c,yScaleType:h}=this.getScaleInformation({yScale:l,xScale:a}),u=[Uh(n,c),Mh];if(s){let e=Ch("groupAgg");"count"===o||("sum"===o?e=vh("groupAgg"):"mean"===o&&(e=wh("groupAgg"))),r&&(e=Sh("groupAgg",e)),u.push(zh(s,h,{invalidValue:void 0}),e)}else{let e=Ch("groupAgg");r&&(e=Sh("groupAgg",e)),u.push(e)}!this.ctx.animationManager.isSkipped()&&this.processedData&&u.push(Nh(this.processedData,!1)),yield this.requestDataModel(e,this.data,{props:u,groupByFn:e=>{var t;const i=Yc(e.domain.keys[0]);if(0===i.length)return e.domain.groups=[],()=>[];const n=Ue(this.properties.binCount)?this.calculateNiceBins(i,this.properties.binCount):null!=(t=this.properties.bins)?t:this.deriveBins(i),s=n.length;return this.calculatedBins=[...n],e=>{const t=e.keys[0];for(let e=0;e<s;e++){const i=n[e];if(t>=i[0]&&t<i[1])return i;if(e===s-1&&t<=i[1])return i}return[]}}}),this.animationState.transition("updateData")})}getSeriesDomain(e){var t,i,n,s;const{processedData:r,dataModel:o}=this;if(!r||!o||!this.calculatedBins.length)return[];const a=o.getDomain(this,"groupAgg","aggregate",r),l=null==(t=this.calculatedBins)?void 0:t[0][0],c=null==(s=this.calculatedBins)?void 0:s[(null!=(n=null==(i=this.calculatedBins)?void 0:i.length)?n:0)-1][1];return Yc("x"===e?[l,c]:a)}createNodeData(){return w(this,null,function*(){var e;const{id:t,axes:i,processedData:n,ctx:{callbackCache:s}}=this,r=i.x,o=i.y;if(!r||!o)return;const{scale:a}=r,{scale:l}=o,{xKey:c,yKey:h,xName:u,yName:d,fill:p,stroke:g,strokeWidth:f,cornerRadius:m}=this.properties,{formatter:y=e=>String(e.value),fontStyle:v,fontWeight:b,fontSize:C,fontFamily:w,color:S}=this.properties.label,x=[],E={itemId:null!=(e=this.properties.yKey)?e:this.id,nodeData:x,labelData:x,scales:this.calculateScaling(),animationValid:!0,visible:this.visible};return this.visible&&n&&"grouped"===n.type?(n.data.forEach(e=>{var i;const{aggValues:[[n,r]]=[[0,0]],datum:E,datum:{length:A},keys:M,keys:[T,D]}=e,I=a.convert(T),R=a.convert(D),k=n+r,P=l.convert(0),_=l.convert(k),L=Math.abs(R-I),N=Math.abs(_-P),O=Math.min(I,R),F=Math.min(P,_);let G;0!==k&&(G={text:null!=(i=s.call(y,{value:k,datum:E,seriesId:t,xKey:c,yKey:h,xName:u,yName:d}))?i:String(k),fontStyle:v,fontWeight:b,fontSize:C,fontFamily:w,fill:S,x:O+L/2,y:F+N/2});const B={x:O+L/2,y:F+N/2},V=o.isReversed();x.push({series:this,datum:E,aggregatedValue:k,frequency:A,domain:M,yKey:h,xKey:c,x:O,y:F,xValue:I,yValue:_,width:L,height:N,midPoint:B,fill:p,stroke:g,cornerRadius:m,topLeftCornerRadius:!V,topRightCornerRadius:!V,bottomRightCornerRadius:V,bottomLeftCornerRadius:V,opacity:1,strokeWidth:f,label:G})}),x.sort((e,t)=>e.x-t.x),E):E})}nodeFactory(){return new ad}updateDatumSelection(e){return w(this,null,function*(){const{nodeData:t,datumSelection:i}=e;return i.update(t,e=>{e.tag=0,e.crisp=!0},e=>e.domain.join("_"))})}updateDatumNodes(e){return w(this,null,function*(){const{isHighlight:t}=e,{fillOpacity:i,strokeOpacity:n,lineDash:s,lineDashOffset:r,shadow:o,highlightStyle:{item:{fill:a,fillOpacity:l=i,stroke:c,strokeWidth:h}}}=this.properties;e.datumSelection.each((e,u,d)=>{var p,g;const{cornerRadius:f,topLeftCornerRadius:m,topRightCornerRadius:y,bottomRightCornerRadius:v,bottomLeftCornerRadius:b}=u,C=t&&void 0!==h?h:u.strokeWidth,w=t?l:i;e.fill=null!=(p=t?a:void 0)?p:u.fill,e.stroke=null!=(g=t?c:void 0)?g:u.stroke,e.fillOpacity=w,e.strokeOpacity=n,e.strokeWidth=C,e.lineDash=s,e.lineDashOffset=r,e.topLeftCornerRadius=m?f:0,e.topRightCornerRadius=y?f:0,e.bottomRightCornerRadius=v?f:0,e.bottomLeftCornerRadius=b?f:0,e.fillShadow=o,e.zIndex=t?Xh.highlightedZIndex:d,e.visible=u.height>0})})}updateLabelSelection(e){return w(this,null,function*(){const{labelData:t,labelSelection:i}=e;return i.update(t,e=>{e.tag=1,e.pointerEvents=1,e.textAlign="center",e.textBaseline="middle"})})}updateLabelNodes(e){return w(this,null,function*(){const t=this.isLabelEnabled();e.labelSelection.each((e,i)=>{const n=i.label;n&&t?(e.text=n.text,e.x=n.x,e.y=n.y,e.fontStyle=n.fontStyle,e.fontWeight=n.fontWeight,e.fontSize=n.fontSize,e.fontFamily=n.fontFamily,e.fill=n.fill,e.visible=!0):e.visible=!1})})}initQuadTree(e){Dp(e,Tp(this.contentGroup.children[0]))}pickNodeClosestDatum(e){return Ip(this,e)}getTooltipHtml(e){const t=this.axes.x,i=this.axes.y;if(!this.properties.isValid()||!t||!i)return tl;const{xKey:n,yKey:s,xName:r,yName:o,fill:a,aggregation:l,tooltip:c}=this.properties,{aggregatedValue:h,frequency:u,domain:[d,p],itemId:g}=e,f=`${Ld(null!=r?r:n)}: ${t.formatDatum(d)} - ${t.formatDatum(p)}`;let m=s?`<b>${Ld(null!=o?o:s)} (${l})</b>: ${i.formatDatum(h)}<br>`:"";m+=`<b>Frequency</b>: ${u}`;const y={title:f,backgroundColor:a,content:m};return c.toTooltipHtml(y,{datum:{data:e.datum,aggregatedValue:e.aggregatedValue,domain:e.domain,frequency:e.frequency},itemId:g,xKey:n,xName:r,yKey:s,yName:o,color:a,title:f,seriesId:this.id})}getLegendData(e){var t,i;if(!(null==(t=this.data)?void 0:t.length)||"category"!==e)return[];const{xKey:n,yName:s,fill:r,fillOpacity:o,stroke:a,strokeWidth:l,strokeOpacity:c,visible:h}=this.properties;return[{legendType:"category",id:this.id,itemId:n,seriesId:this.id,enabled:h,label:{text:null!=(i=null!=s?s:n)?i:"Frequency"},marker:{fill:null!=r?r:"rgba(0, 0, 0, 0)",stroke:null!=a?a:"rgba(0, 0, 0, 0)",fillOpacity:o,strokeOpacity:c,strokeWidth:l}}]}animateEmptyUpdateReady({datumSelection:e,labelSelection:t}){const i=Vp(Gp(!0,this.axes,"normal"));Rs(this.id,"datums",this.ctx.animationManager,[e],i),Nd(this,"labels",this.ctx.animationManager,t)}animateWaitingUpdateReady(e){var t,i;const n=null==(i=null==(t=this.processedData)?void 0:t.reduced)?void 0:i.diff,s=Vp(Gp(!0,this.axes,"normal"));Rs(this.id,"datums",this.ctx.animationManager,[e.datumSelection],s,(e,t)=>Oh(t.domain),n),Nd(this,"labels",this.ctx.animationManager,e.labelSelection)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e,seriesRect:t}){var i;return Up(null==(i=this.contextNodeData)?void 0:i.nodeData[e],this.contentGroup,t)}};ig.className="HistogramSeries",ig.type="histogram";var ng={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"histogram",instanceConstructor:ig,defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{__extends__:zt,strokeWidth:1,fillOpacity:1,strokeOpacity:1,lineDash:[0],lineDashOffset:0,label:{enabled:!1,fontSize:12,fontFamily:jt,color:Yt},shadow:{enabled:!1,color:ei,xOffset:3,yOffset:3,blur:5}}},paletteFactory:({takeColors:e})=>{const{fills:[t],strokes:[i]}=e(1);return{fill:t,stroke:i}}},sg=class extends zu{constructor(){super(...arguments),this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.marker=new Hd,this.label=new Bo,this.tooltip=new zd,this.connectMissingData=!1}};b([$s(er)],sg.prototype,"xKey",2),b([$s(er)],sg.prototype,"yKey",2),b([$s(er,{optional:!0})],sg.prototype,"xName",2),b([$s(er,{optional:!0})],sg.prototype,"yName",2),b([$s(er,{optional:!0})],sg.prototype,"title",2),b([$s(fr)],sg.prototype,"stroke",2),b([$s(nr)],sg.prototype,"strokeWidth",2),b([$s(sr)],sg.prototype,"strokeOpacity",2),b([$s(Er)],sg.prototype,"lineDash",2),b([$s(nr)],sg.prototype,"lineDashOffset",2),b([$s(Xs)],sg.prototype,"marker",2),b([$s(Xs)],sg.prototype,"label",2),b([$s(Xs)],sg.prototype,"tooltip",2),b([$s(Qs)],sg.prototype,"connectMissingData",2);var rg=class extends Wu{constructor(e){super({moduleCtx:e,directionKeys:Vu,directionNames:Hu,hasMarkers:!0,pickModes:[2,3,0],markerSelectionGarbageCollection:!1,animationResetFns:{path:ap({getOpacity:()=>this.getOpacity()}),label:Fd,marker:(e,t)=>f(f({},{opacity:1,scalingX:1,scalingY:1}),qd(0,t))}}),this.properties=new sg}processData(e){return w(this,null,function*(){var t,i;if(!this.properties.isValid()||null==this.data)return;const{xKey:n,yKey:s}=this.properties,r=!this.ctx.animationManager.isSkipped(),o=null==(t=this.axes.x)?void 0:t.scale,a=null==(i=this.axes.y)?void 0:i.scale,{isContinuousX:l,xScaleType:c,yScaleType:h}=this.getScaleInformation({xScale:o,yScale:a}),u=[];l||u.push(Uh(n,c,{id:"xKey"})),r&&(u.push(kh(l?["xValue"]:void 0)),this.processedData&&u.push(Nh(this.processedData))),u.push(zh(n,c,{id:"xValue"}),zh(s,h,{id:"yValue",invalidValue:void 0})),yield this.requestDataModel(e,this.data,{props:u}),this.animationState.transition("updateData")})}getSeriesDomain(e){const{axes:t,dataModel:i,processedData:n}=this;if(!n||!i)return[];const s=t.x,r=t.y,o=i.resolveProcessedDataDefById(this,"xValue");if("x"===e){const e=i.getDomain(this,"xValue","value",n);return"value"===(null==o?void 0:o.def.type)&&"category"===o.def.valueType?e:Yc(ln(e),s)}return Yc(i.getDomain(this,"yValue","value",n),r)}createNodeData(){return w(this,null,function*(){var e,t,i;const{processedData:n,dataModel:s,axes:r}=this,o=r.x,a=r.y;if(!(n&&s&&o&&a))return;const{xKey:l,yKey:c,xName:h,yName:u,marker:d,label:p,connectMissingData:g,legendItemName:f}=this.properties,m=o.scale,y=a.scale,v=(null!=(e=m.bandwidth)?e:0)/2,b=(null!=(t=y.bandwidth)?t:0)/2,C=[],w=d.enabled?d.size:0,S=s.resolveProcessedDataIndexById(this,"xValue"),x=s.resolveProcessedDataIndexById(this,"yValue");let E,A=!0;for(let e=0;e<n.data.length;e++){const{datum:t,values:s}=null!=E?E:n.data[e],r=s[S],o=s[x];if(void 0===o)A=!g;else{const s=m.convert(r)+v;if(isNaN(s)){A=!g,E=void 0;continue}E=void 0===(null==(i=n.data[e+1])?void 0:i.values[x])?void 0:n.data[e+1];const a=y.convert(o)+b,d=this.getLabelText(p,{value:o,datum:t,xKey:l,yKey:c,xName:h,yName:u,legendItemName:f},e=>ze(e)?e.toFixed(2):String(e));C.push({series:this,datum:t,yKey:c,xKey:l,point:{x:s,y:a,moveTo:A,size:w},midPoint:{x:s,y:a},yValue:o,xValue:r,capDefaults:{lengthRatioMultiplier:this.properties.marker.getDiameter(),lengthMax:1/0},label:d?{text:d,fontStyle:p.fontStyle,fontWeight:p.fontWeight,fontSize:p.fontSize,fontFamily:p.fontFamily,textAlign:"center",textBaseline:"bottom",fill:p.color}:void 0}),A=!1}}return{itemId:c,nodeData:C,labelData:C,scales:this.calculateScaling(),visible:this.visible}})}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}markerFactory(){const{shape:e}=this.properties.marker;return new(_u(e))}updatePathNodes(e){return w(this,null,function*(){const{paths:[t],opacity:i,visible:n,animationEnabled:s}=e;t.setProperties({fill:void 0,lineJoin:"round",pointerEvents:1,opacity:i,stroke:this.properties.stroke,strokeWidth:this.getStrokeWidth(this.properties.strokeWidth),strokeOpacity:this.properties.strokeOpacity,lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset}),s||(t.visible=n),lp(this,t)})}updateMarkerSelection(e){return w(this,null,function*(){let{nodeData:t}=e;const{markerSelection:i}=e,{shape:n,enabled:s}=this.properties.marker;return t=n&&s?t:[],this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(t,void 0,e=>Oh(e.xValue))})}updateMarkerNodes(e){return w(this,null,function*(){const{markerSelection:t,isHighlight:i}=e,{xKey:n,yKey:s,stroke:r,strokeWidth:o,strokeOpacity:a,marker:l,highlightStyle:c}=this.properties,h=qe(i&&c.item,l.getStyle(),{stroke:r,strokeWidth:o,strokeOpacity:a}),u=this.ctx.animationManager.isSkipped();t.each((e,t)=>{this.updateMarkerStyle(e,l,{datum:t,highlighted:i,xKey:n,yKey:s},h,{applyTranslation:u})}),i||l.markClean()})}updateLabelSelection(e){return w(this,null,function*(){return e.labelSelection.update(this.isLabelEnabled()?e.labelData:[])})}updateLabelNodes(e){return w(this,null,function*(){const{enabled:t,fontStyle:i,fontWeight:n,fontSize:s,fontFamily:r,color:o}=this.properties.label;e.labelSelection.each((e,a)=>{const{point:l,label:c}=a;a&&c&&t?(e.fontStyle=i,e.fontWeight=n,e.fontSize=s,e.fontFamily=r,e.textAlign=c.textAlign,e.textBaseline=c.textBaseline,e.text=c.text,e.x=l.x,e.y=l.y-10,e.fill=o,e.visible=!0):e.visible=!1})})}getTooltipHtml(e){var t;const i=this.axes.x,n=this.axes.y;if(!this.properties.isValid()||!i||!n)return tl;const{xKey:s,yKey:r,xName:o,yName:a,strokeWidth:l,marker:c,tooltip:h}=this.properties,{datum:u,xValue:d,yValue:p,itemId:g}=e,m=i.formatDatum(d),y=n.formatDatum(p),v=Ld(null!=(t=this.properties.title)?t:a),b=Ld(m+": "+y),C=qe({fill:c.stroke},c.getStyle(),{strokeWidth:l}),{fill:w}=this.getMarkerStyle(c,{datum:e,xKey:s,yKey:r,highlighted:!1},C);return h.toTooltipHtml({title:v,content:b,backgroundColor:w},f({datum:u,itemId:g,xKey:s,xName:o,yKey:r,yName:a,title:v,color:w,seriesId:this.id},this.getModuleTooltipParams()))}getLegendData(e){var t,i,n,s,r,o,a,l,c,h;if(!(null==(t=this.data)?void 0:t.length)||!this.properties.isValid()||"category"!==e)return[];const{yKey:u,yName:d,stroke:p,strokeOpacity:g,strokeWidth:f,lineDash:m,title:y,marker:v,visible:b,legendItemName:C}=this.properties,w="rgba(0, 0, 0, 0)";return[{legendType:"category",id:this.id,itemId:u,legendItemName:C,seriesId:this.id,enabled:b,label:{text:null!=(n=null!=(i=null!=C?C:y)?i:d)?n:u},marker:{shape:v.shape,fill:null!=(s=v.fill)?s:w,stroke:null!=(o=null!=(r=v.stroke)?r:p)?o:w,fillOpacity:null!=(a=v.fillOpacity)?a:1,strokeOpacity:null!=(c=null!=(l=v.strokeOpacity)?l:g)?c:1,strokeWidth:null!=(h=v.strokeWidth)?h:0,enabled:v.enabled},line:{stroke:null!=p?p:w,strokeOpacity:g,strokeWidth:f,lineDash:m}}]}updatePaths(e){return w(this,null,function*(){this.updateLinePaths(e.paths,e.contextData)})}updateLinePaths(e,t){const{nodeData:i}=t,[n]=e,{path:s}=n;s.clear(!0);for(const e of i)e.point.moveTo?s.moveTo(e.point.x,e.point.y):s.lineTo(e.point.x,e.point.y);n.checkPathDirty()}animateEmptyUpdateReady(e){const{markerSelection:t,labelSelection:i,annotationSelections:n,contextData:s,paths:r}=e,{animationManager:o}=this.ctx;this.updateLinePaths(r,s),sp(this,o,...r),fa([t],qd),Kd(this,o,t),Nd(this,"labels",o,i),Nd(this,"annotations",o,...n)}animateReadyResize(e){const{contextData:t,paths:i}=e;this.updateLinePaths(i,t),super.animateReadyResize(e)}animateWaitingUpdateReady(e){var t,i;const{animationManager:n}=this.ctx,{markerSelection:s,labelSelection:r,annotationSelections:o,contextData:a,paths:l,previousContextData:c}=e,[h]=l;super.resetAllAnimation(e);const u=()=>{this.updateLinePaths(l,a)};if(null==a||null==c)return u(),jd(this,n,"added",s),rp(this,"path_properties",n,"add",h),Nd(this,"labels",n,r),void Nd(this,"annotations",n,...o);const d=Cp(a,c,null==(i=null==(t=this.processedData)?void 0:t.reduced)?void 0:i.diff);if(void 0===d)return n.skipCurrentBatch(),void u();"no-op"!==d.status&&(jd(this,n,void 0,s),Rs(this.id,"path_properties",n,[h],d.pathProperties),Pd(this.id,"path_update",n,[h],d.path),d.hasMotion&&(Nd(this,"labels",n,r),Nd(this,"annotations",n,...o)))}isLabelEnabled(){return this.properties.label.enabled}getBandScalePadding(){return{inner:1,outer:.1}}nodeFactory(){return new xo}getFormattedMarkerStyle(e){const{xKey:t,yKey:i}=this.properties;return this.getMarkerStyle(this.properties.marker,{datum:e,xKey:t,yKey:i,highlighted:!0})}computeFocusBounds(e){return Zd(this,e)}};rg.className="LineSeries",rg.type="line";var og={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"line",instanceConstructor:rg,defaultAxes:[{type:"number",position:"left"},{type:"category",position:"bottom"}],themeTemplate:{series:{__extends__:zt,tooltip:{position:{type:"node"}},strokeWidth:2,strokeOpacity:1,lineDash:[0],lineDashOffset:0,marker:{__extends__:Wt,fillOpacity:1,strokeOpacity:1,strokeWidth:0},label:{enabled:!1,fontSize:12,fontFamily:jt,color:$t}}},enterpriseThemeTemplate:{series:{errorBar:{cap:{lengthRatio:1}}}},paletteFactory:e=>{const{marker:t}=kd(e);return{stroke:t.fill,marker:t}}},ag=class extends Bo{constructor(){super(...arguments),this.placement="top"}};b([$s(Nr)],ag.prototype,"placement",2);var lg=class extends zu{constructor(){super(...arguments),this.colorRange=["#ffff00","#00ff00","#0000ff"],this.marker=new Hd,this.label=new ag,this.tooltip=new zd}};b([$s(er)],lg.prototype,"xKey",2),b([$s(er)],lg.prototype,"yKey",2),b([$s(er,{optional:!0})],lg.prototype,"labelKey",2),b([$s(er,{optional:!0})],lg.prototype,"colorKey",2),b([$s(er,{optional:!0})],lg.prototype,"xName",2),b([$s(er,{optional:!0})],lg.prototype,"yName",2),b([$s(er,{optional:!0})],lg.prototype,"labelName",2),b([$s(er,{optional:!0})],lg.prototype,"colorName",2),b([$s(vr,{optional:!0})],lg.prototype,"colorDomain",2),b([$s(mr)],lg.prototype,"colorRange",2),b([$s(er,{optional:!0})],lg.prototype,"title",2),b([$s(Xs)],lg.prototype,"marker",2),b([$s(Xs)],lg.prototype,"label",2),b([$s(Xs)],lg.prototype,"tooltip",2);var cg=class extends Wu{constructor(e){super({moduleCtx:e,directionKeys:Vu,directionNames:Hu,pickModes:[2,3,0],pathsPerSeries:0,hasMarkers:!0,markerSelectionGarbageCollection:!1,animationResetFns:{marker:Yd,label:Fd}}),this.properties=new lg,this.colorScale=new Yp}processData(e){return w(this,null,function*(){var t,i,n;if(!this.properties.isValid()||null==this.data||!this.visible)return;const s=null==(t=this.axes.x)?void 0:t.scale,r=null==(i=this.axes.y)?void 0:i.scale,{xScaleType:o,yScaleType:a}=this.getScaleInformation({xScale:s,yScale:r}),l=this.colorScale.type,{xKey:c,yKey:h,labelKey:u,colorKey:d,colorDomain:p,colorRange:g}=this.properties,{dataModel:f,processedData:m}=yield this.requestDataModel(e,this.data,{props:[Uh(c,o,{id:"xKey-raw"}),Uh(h,a,{id:"yKey-raw"}),...u?[Uh(u,"band",{id:"labelKey-raw"})]:[],zh(c,o,{id:"xValue"}),zh(h,a,{id:"yValue"}),...d?[zh(d,l,{id:"colorValue"})]:[],...u?[zh(u,"band",{id:"labelValue"})]:[]]});if(d){const e=f.resolveProcessedDataIndexById(this,"colorValue");this.colorScale.domain=null!=(n=null!=p?p:m.domain.values[e])?n:[],this.colorScale.range=g,this.colorScale.update()}this.animationState.transition("updateData")})}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return[];const n="x"===e?"xValue":"yValue",s=t.resolveProcessedDataDefById(this,n),r=t.getDomain(this,n,"value",i);if("value"===(null==s?void 0:s.def.type)&&"category"===(null==s?void 0:s.def.valueType))return r;const o=this.axes[e];return Yc(ln(r),o)}createNodeData(){return w(this,null,function*(){var e,t,i;const{axes:n,dataModel:s,processedData:r,colorScale:o}=this,{xKey:a,yKey:l,labelKey:c,colorKey:h,xName:u,yName:d,labelName:p,marker:g,label:m,visible:y}=this.properties,{placement:v}=m,b=_u(g.shape),C=n.x,w=n.y;if(!(s&&r&&y&&C&&w))return;const S=s.resolveProcessedDataIndexById(this,"xValue"),x=s.resolveProcessedDataIndexById(this,"yValue"),E=h?s.resolveProcessedDataIndexById(this,"colorValue"):-1,A=c?s.resolveProcessedDataIndexById(this,"labelValue"):-1,M=C.scale,T=w.scale,D=(null!=(e=M.bandwidth)?e:0)/2,I=(null!=(t=T.bandwidth)?t:0)/2,R=[],k=m.getFont();for(const{values:e,datum:t}of null!=(i=r.data)?i:[]){const i=e[S],n=e[x],s=M.convert(i)+D,r=T.convert(n)+I,y=this.getLabelText(m,{value:c?e[A]:n,datum:t,xKey:a,yKey:l,labelKey:c,xName:u,yName:d,labelName:p}),C=Oo.getTextSize(y,k),w=h?o.convert(e[E]):void 0;R.push({series:this,itemId:l,yKey:l,xKey:a,datum:t,xValue:i,yValue:n,capDefaults:{lengthRatioMultiplier:g.getDiameter(),lengthMax:1/0},point:{x:s,y:r,size:g.size},midPoint:{x:s,y:r},fill:w,label:f({text:y},C),marker:b,placement:v})}return{itemId:l,nodeData:R,labelData:R,scales:this.calculateScaling(),visible:this.visible}})}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}getLabelData(){var e,t;return null!=(t=null==(e=this.contextNodeData)?void 0:e.labelData)?t:[]}markerFactory(){const{shape:e}=this.properties.marker;return new(_u(e))}updateMarkerSelection(e){return w(this,null,function*(){const{nodeData:t,markerSelection:i}=e;return this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(this.properties.marker.enabled?t:[])})}updateMarkerNodes(e){return w(this,null,function*(){const{markerSelection:t,isHighlight:i}=e,{xKey:n,yKey:s,labelKey:r,marker:o,highlightStyle:a}=this.properties,l=qe(i&&a.item,o.getStyle());t.each((e,t)=>{this.updateMarkerStyle(e,o,{datum:t,highlighted:i,xKey:n,yKey:s,labelKey:r},l)}),i||o.markClean()})}updateLabelSelection(e){return w(this,null,function*(){var t,i;const n=this.isLabelEnabled()&&null!=(i=null==(t=this.chart)?void 0:t.placeLabels().get(this))?i:[];return e.labelSelection.update(n.map(({datum:e,x:t,y:i})=>m(f({},e),{point:{x:t,y:i,size:e.point.size},placement:"top"})),e=>{e.pointerEvents=1})})}updateLabelNodes(e){return w(this,null,function*(){const{label:t}=this.properties;e.labelSelection.each((e,i)=>{var n,s,r,o;e.text=i.label.text,e.fill=t.color,e.x=null!=(s=null==(n=i.point)?void 0:n.x)?s:0,e.y=null!=(o=null==(r=i.point)?void 0:r.y)?o:0,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.fontSize=t.fontSize,e.fontFamily=t.fontFamily,e.textAlign="left",e.textBaseline="top"})})}getTooltipHtml(e){const t=this.axes.x,i=this.axes.y;if(!this.properties.isValid()||!t||!i)return tl;const{xKey:n,yKey:s,labelKey:r,xName:o,yName:a,labelName:l,title:c=a,marker:h,tooltip:u}=this.properties,{datum:d,xValue:p,yValue:g,label:m,itemId:y}=e,v=qe({fill:e.fill,strokeWidth:this.getStrokeWidth(h.strokeWidth)},h.getStyle()),{fill:b="gray"}=this.getMarkerStyle(h,{datum:e,highlighted:!1,xKey:n,yKey:s,labelKey:r},v),C=Ld(t.formatDatum(p)),w=Ld(i.formatDatum(g));let S=`<b>${Ld(null!=o?o:n)}</b>: ${C}<br><b>${Ld(null!=a?a:s)}</b>: ${w}`;return r&&(S=`<b>${Ld(null!=l?l:r)}</b>: ${Ld(m.text)}<br>`+S),u.toTooltipHtml({title:c,content:S,backgroundColor:b},f({datum:d,itemId:y,xKey:n,xName:o,yKey:s,yName:a,labelKey:r,labelName:l,title:c,color:b,seriesId:this.id},this.getModuleTooltipParams()))}getLegendData(e){var t,i,n,s,r,o;const{yKey:a,yName:l,title:c,marker:h,visible:u}=this.properties,{fill:d,stroke:p,fillOpacity:g,strokeOpacity:f,strokeWidth:m}=h;return(null==(t=this.data)?void 0:t.length)&&this.properties.isValid()&&"category"===e?[{legendType:"category",id:this.id,itemId:a,seriesId:this.id,enabled:u,label:{text:null!=(i=null!=c?c:l)?i:a},marker:{shape:h.shape,fill:null!=(s=null!=(n=h.fill)?n:d)?s:"rgba(0, 0, 0, 0)",stroke:null!=(o=null!=(r=h.stroke)?r:p)?o:"rgba(0, 0, 0, 0)",fillOpacity:null!=g?g:1,strokeOpacity:null!=f?f:1,strokeWidth:null!=m?m:0}}]:[]}animateEmptyUpdateReady(e){const{markerSelection:t,labelSelection:i,annotationSelections:n}=e;$d(this,this.ctx.animationManager,t),Nd(this,"labels",this.ctx.animationManager,i),Nd(this,"annotations",this.ctx.animationManager,...n)}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new xo}getFormattedMarkerStyle(e){const{xKey:t,yKey:i,labelKey:n}=this.properties;return this.getMarkerStyle(this.properties.marker,{datum:e,xKey:t,yKey:i,labelKey:n,highlighted:!0})}computeFocusBounds(e){return Zd(this,e)}};cg.className="ScatterSeries",cg.type="scatter";var hg={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"scatter",instanceConstructor:cg,defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{__extends__:zt,tooltip:{position:{type:"node"}},marker:{__extends__:Wt,fillOpacity:.8},label:{enabled:!1,fontSize:12,fontFamily:jt,color:$t}}},enterpriseThemeTemplate:{series:{errorBar:{cap:{lengthRatio:1}}}},paletteFactory:kd},ug=class e{constructor(e,t,i,n){this.startAngle=e,this.endAngle=t,this.innerRadius=i,this.outerRadius=n}clone(){const{startAngle:t,endAngle:i,innerRadius:n,outerRadius:s}=this;return new e(t,i,n,s)}[Bn](t,i){return new e(this.startAngle*(1-i)+t.startAngle*i,this.endAngle*(1-i)+t.endAngle*i,this.innerRadius*(1-i)+t.innerRadius*i,this.outerRadius*(1-i)+t.outerRadius*i)}};function dg(e,t,i){const n=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),{innerRadius:s,outerRadius:r}=i;if(i.startAngle===i.endAngle||n<Math.min(s,r)||n>Math.max(s,r))return!1;const o=Os(i.startAngle),a=Os(i.endAngle),l=Math.atan2(t,e);return o<a?l<=a&&l>=o:l<=a&&l>=-Math.PI||l>=o&&l<=Math.PI}function pg(e,t){const{startAngle:i,endAngle:n,innerRadius:s,outerRadius:r}=t,o={x:r*Math.cos(i),y:r*Math.sin(i)},a={x:r*Math.cos(n),y:r*Math.sin(n)},l=0===s?{x:0,y:0}:{x:s*Math.cos(i),y:s*Math.sin(i)},c=0===s?{x:0,y:0}:{x:s*Math.cos(n),y:s*Math.sin(n)};return ru(e.start.x,e.start.y,e.end.x,e.end.y,o.x,o.y,l.x,l.y)||ru(e.start.x,e.start.y,e.end.x,e.end.y,a.x,a.y,c.x,c.y)||lu(0,0,r,i,n,!0,e.start.x,e.start.y,e.end.x,e.end.y)}function gg(e,t){const i={x:e.x,y:e.y},n={x:e.x+e.width,y:e.y},s={x:e.x,y:e.y+e.height},r={x:e.x+e.width,y:e.y+e.height};return pg({start:i,end:n},t)||pg({start:s,end:r},t)}function fg(e,t,i,n){if(0===i&&0===n)return 0;if(Math.asin(Math.abs(1*i)/(e+1*i))+Math.asin(Math.abs(1*n)/(e+1*n))-t<0)return 1;let s=0,r=1;for(let o=0;o<8;o+=1){const o=(s+r)/2;Math.asin(Math.abs(o*i)/(e+o*i))+Math.asin(Math.abs(o*n)/(e+o*n))-t<0?s=o:r=o}return s}function mg(e,t){return Vs(e,t)<1e-6?t:Ls(e-t)+t}function yg(e,t,i=0){const n=Math.abs(t-e)>=2*Math.PI?2*Math.PI:Ls(t-e);return{startAngle:e=mg(e,i),endAngle:t=e+n}}function vg(e,t,i,n,s,r){const o=Math.sin(r),a=Math.cos(r),l=p(e,2)+p(t,2)-p(i,2);let c=NaN,h=NaN,u=NaN,d=NaN;if(a>.5){const i=o/a,n=1+p(i,2),s=-2*(e+t*i),r=p(s,2)-4*n*l;if(r<0)return;const g=(-s+Math.sqrt(r))/(2*n),f=(-s-Math.sqrt(r))/(2*n);c=g,h=g*i,u=f,d=f*i}else{const i=a/o,n=1+p(i,2),s=-2*(t+e*i),r=p(s,2)-4*n*l;if(r<0)return;const g=(-s+Math.sqrt(r))/(2*n),f=(-s-Math.sqrt(r))/(2*n);c=g*i,h=g,u=f*i,d=f}const g=u*a+d*o,f=c*a+h*o>0?mg(Math.atan2(h-t,c-e),n):NaN,m=g>0?mg(Math.atan2(d-t,u-e),n):NaN;return f>=n&&f<=s?f:m>=n&&m<=s?m:void 0}function bg(e,t,i,n,s,r){const o=Math.hypot(e,t),a=o-(p(o,2)-p(i,2)+p(r,2))/(2*o),l=Math.atan2(t,e),c=Math.acos(-a/i),h=mg(l+c,n),u=mg(l-c,n);return h>=n&&h<=s?h:u>=n&&u<=s?u:void 0}var Cg=class{constructor(e,t,i,n,s){this.cx=e,this.cy=t,this.r=i,this.a0=n,this.a1=s,this.a0>=this.a1&&(this.a0=NaN,this.a1=NaN)}isValid(){return Number.isFinite(this.a0)&&Number.isFinite(this.a1)}pointAt(e){return{x:this.cx+this.r*Math.cos(e),y:this.cy+this.r*Math.sin(e)}}clipStart(e){null==e||!this.isValid()||e<this.a0||(this.a0=e,(Number.isNaN(e)||this.a0>=this.a1)&&(this.a0=NaN,this.a1=NaN))}clipEnd(e){null==e||!this.isValid()||e>this.a1||(this.a1=e,(Number.isNaN(e)||this.a0>=this.a1)&&(this.a0=NaN,this.a1=NaN))}},wg=class extends uu{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.innerRadius=10,this.outerRadius=20,this.startAngle=0,this.endAngle=2*Math.PI,this.clipSector=void 0,this.concentricEdgeInset=0,this.radialEdgeInset=0,this.startOuterCornerRadius=0,this.endOuterCornerRadius=0,this.startInnerCornerRadius=0,this.endInnerCornerRadius=0}set inset(e){this.concentricEdgeInset=e,this.radialEdgeInset=e}set cornerRadius(e){this.startOuterCornerRadius=e,this.endOuterCornerRadius=e,this.startInnerCornerRadius=e,this.endInnerCornerRadius=e}computeBBox(){const e=this.outerRadius;return new es(this.centerX-e,this.centerY-e,2*e,2*e)}normalizedRadii(){const{concentricEdgeInset:e}=this;return{innerRadius:Math.max(Math.min(this.innerRadius,this.outerRadius)+e,0),outerRadius:Math.max(Math.max(this.innerRadius,this.outerRadius)-e,0)}}normalizedClipSector(){const{clipSector:e}=this;if(null==e)return;const{startAngle:t,endAngle:i}=yg(this.startAngle,this.endAngle),{innerRadius:n,outerRadius:s}=this.normalizedRadii(),r=yg(e.startAngle,e.endAngle,t);return new ug(Math.max(t,r.startAngle),Math.min(i,r.endAngle),Math.max(n,e.innerRadius),Math.min(s,e.outerRadius))}getAngleOffset(e){return e>0?this.radialEdgeInset/e:0}arc(e,t,i,n,s,r,o,a){if(e<=0)return;const{startAngle:l,endAngle:c}=yg(this.startAngle,this.endAngle),{innerRadius:h,outerRadius:u}=this.normalizedRadii(),d=this.normalizedClipSector();if(a&&h<=0)return;const p=this.getAngleOffset(h),g=this.getAngleOffset(u),f=a?this.getAngleOffset(h+e):this.getAngleOffset(u-e),m=o?l+f+t:c-f-t,y=a?h+e:u-e,v=y*Math.cos(m),b=y*Math.sin(m);if(null!=d){const e=1e-6;if(!(o||m>=l-e&&m<=d.endAngle-e))return;if(o&&!(m>=d.startAngle+e&&m<=c-e))return;if(a&&!(y>=d.innerRadius-e))return;if(!(a||y<=d.outerRadius+e))return}const C=new Cg(v,b,e,i,n);if(null!=d){let t,c;if(a?(C.clipStart(vg(v,b,e,i,n,d.endAngle-p)),C.clipEnd(vg(v,b,e,i,n,d.startAngle+p))):(C.clipStart(vg(v,b,e,i,n,d.startAngle+g)),C.clipEnd(vg(v,b,e,i,n,d.endAngle-g))),o?(t=bg(v,b,e,i,n,d.innerRadius),c=bg(v,b,e,i,n,d.outerRadius)):(t=bg(v,b,e,i,n,d.outerRadius),c=bg(v,b,e,i,n,d.innerRadius)),C.clipStart(t),C.clipEnd(c),null!=t){const{x:e,y:i}=C.pointAt(t),n=mg(Math.atan2(i,e),l);o?null==r||r.clipStart(n):s.clipEnd(n)}if(null!=c){const{x:e,y:t}=C.pointAt(c),i=mg(Math.atan2(t,e),l);o?s.clipStart(i):null==r||r.clipEnd(i)}}if(null!=d){const{x:e,y:t}=C.pointAt((C.a0+C.a1)/2);if(!dg(e,t,d))return}const{x:w,y:S}=C.pointAt(o===a?C.a0:C.a1),x=mg(Math.atan2(S,w),l),E=a?r:s;return o?null==E||E.clipStart(x):null==E||E.clipEnd(x),C}updatePath(){var e,t,i,n,s;const{path:r,centerX:o,centerY:a,concentricEdgeInset:l,radialEdgeInset:c}=this;let{startOuterCornerRadius:h,endOuterCornerRadius:u,startInnerCornerRadius:d,endInnerCornerRadius:p}=this;const{startAngle:g,endAngle:f}=yg(this.startAngle,this.endAngle),{innerRadius:m,outerRadius:y}=this.normalizedRadii(),v=this.normalizedClipSector(),b=f-g,C=b>=2*Math.PI-1e-6;if(r.clear(),(null!=(e=null==v?void 0:v.startAngle)?e:g)===(null!=(t=null==v?void 0:v.endAngle)?t:f))return;if(C&&null==this.clipSector&&0===h&&0===u&&0===d&&0===p)return r.moveTo(o+y*Math.cos(g),a+y*Math.sin(g)),r.arc(o,a,y,g,f),m>l&&(r.moveTo(o+m*Math.cos(f),a+m*Math.sin(f)),r.arc(o,a,m,f,g,!0)),void r.closePath();const w=this.getAngleOffset(m),S=this.getAngleOffset(y);if(b<2*S)return;const x=(null!=(i=null==v?void 0:v.innerRadius)?i:m)>l,E=m<l||b<2*w,A=y-m,M=Math.max(h,d,u,p),T=M>0?Math.min(A/M,1):1;h*=T,u*=T,d*=T,p*=T;const D=fg(y,b-2*S,-h,-u);if(h*=D,u*=D,!E&&x){const e=fg(m,b-2*w,d,p);d*=e,p*=e}else d=0,p=0;const I=Math.max(h+d,u+p),R=I>0?Math.min(A/I,1):1;h*=R,u*=R,d*=R,p*=R;let k=0,P=0;const _=h/(y-h),L=u/(y-u);if(_>=0&&_<.999999)k=Math.asin(_);else{k=b/2;const e=y/(1/Math.sin(k)+1);h=Math.min(e,h)}if(L>=0&&L<.999999)P=Math.asin(L);else{P=b/2;const e=y/(1/Math.sin(P)+1);u=Math.min(e,u)}const N=Math.asin(d/(m+d)),O=Math.asin(p/(m+p)),F=null!=(n=null==v?void 0:v.outerRadius)?n:y,G=this.getAngleOffset(F),B=new Cg(0,0,F,g+G,f-G),V=null!=(s=null==v?void 0:v.innerRadius)?s:m,H=this.getAngleOffset(V),U=x?new Cg(0,0,V,g+H,f-H):void 0;null!=v&&(B.clipStart(v.startAngle),B.clipEnd(v.endAngle),null==U||U.clipStart(v.startAngle),null==U||U.clipEnd(v.endAngle));const z=this.arc(h,k,g-.5*Math.PI,g+k,B,U,!0,!1),W=this.arc(u,P,f-P,f+.5*Math.PI,B,U,!1,!1),j=this.arc(p,O,f+.5*Math.PI,f+Math.PI-O,B,U,!1,!0),$=this.arc(d,N,g+Math.PI+N,g+1.5*Math.PI,B,U,!0,!0);if(E){const e=b<.5*Math.PI?c*(1+Math.cos(b))/Math.sin(b):NaN;let t;t=e>0&&e<y?Math.max(Math.hypot(c,e),m):m;const i=g+.5*b;r.moveTo(o+t*Math.cos(i),a+t*Math.sin(i))}else if(!0===(null==$?void 0:$.isValid())){const{x:e,y:t}=$.pointAt($.a1);r.moveTo(o+e,a+t)}else if(!0===(null==U?void 0:U.isValid())){const{x:e,y:t}=U.pointAt(U.a0);r.moveTo(o+e,a+t)}else{const e=g+b/2,t=m*Math.cos(e),i=m*Math.sin(e);r.moveTo(o+t,a+i)}if(!0===(null==z?void 0:z.isValid())){const{cx:e,cy:t,r:i,a0:n,a1:s}=z;r.arc(o+e,a+t,i,n,s)}if(B.isValid()){const{r:e,a0:t,a1:i}=B;r.arc(o,a,e,t,i)}if(!0===(null==W?void 0:W.isValid())){const{cx:e,cy:t,r:i,a0:n,a1:s}=W;r.arc(o+e,a+t,i,n,s)}if(!E){if(!0===(null==j?void 0:j.isValid())){const{cx:e,cy:t,r:i,a0:n,a1:s}=j;r.arc(o+e,a+t,i,n,s)}if(!0===(null==U?void 0:U.isValid())){const{r:e,a0:t,a1:i}=U;r.arc(o,a,e,i,t,!0)}if(!0===(null==$?void 0:$.isValid())){const{cx:e,cy:t,r:i,a0:n,a1:s}=$;r.arc(o+e,a+t,i,n,s)}}r.closePath()}isPointInPath(e,t){var i;const n=this.transformPoint(e,t),{startAngle:s,endAngle:r,innerRadius:o,outerRadius:a}=null!=(i=this.clipSector)?i:this;return dg(n.x,n.y,{startAngle:s,endAngle:r,innerRadius:Math.min(o,a),outerRadius:Math.max(o,a)})}};wg.className="Sector",b([hu()],wg.prototype,"centerX",2),b([hu()],wg.prototype,"centerY",2),b([hu()],wg.prototype,"innerRadius",2),b([hu()],wg.prototype,"outerRadius",2),b([hu()],wg.prototype,"startAngle",2),b([hu()],wg.prototype,"endAngle",2),b([hu()],wg.prototype,"clipSector",2),b([hu()],wg.prototype,"concentricEdgeInset",2),b([hu()],wg.prototype,"radialEdgeInset",2),b([hu()],wg.prototype,"startOuterCornerRadius",2),b([hu()],wg.prototype,"endOuterCornerRadius",2),b([hu()],wg.prototype,"startInnerCornerRadius",2),b([hu()],wg.prototype,"endInnerCornerRadius",2);var Sg=class extends ol{constructor(){super(...arguments),this.showInLegend=!1}};b([$s(Qs)],Sg.prototype,"showInLegend",2);var xg=class extends Bo{constructor(){super(...arguments),this.margin=2}set(e,t){return super.set(e)}};b([$s(er)],xg.prototype,"text",2),b([$s(tr)],xg.prototype,"margin",2);var Eg=class extends yt{constructor(){super(...arguments),this.fill="transparent",this.fillOpacity=1}};b([$s(fr)],Eg.prototype,"fill",2),b([$s(sr)],Eg.prototype,"fillOpacity",2);var Ag=class extends Bo{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}};b([$s(nr)],Ag.prototype,"offset",2),b([$s(rr)],Ag.prototype,"minAngle",2),b([$s(nr)],Ag.prototype,"minSpacing",2),b([$s(nr)],Ag.prototype,"maxCollisionOffset",2),b([$s(Qs)],Ag.prototype,"avoidCollisions",2);var Mg=class extends Bo{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}};b([$s(tr)],Mg.prototype,"positionOffset",2),b([$s(sr)],Mg.prototype,"positionRatio",2);var Tg=class extends yt{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}};b([$s(mr,{optional:!0})],Tg.prototype,"colors",2),b([$s(nr)],Tg.prototype,"length",2),b([$s(nr)],Tg.prototype,"strokeWidth",2);var Dg=class extends Bu{constructor(){super(...arguments),this.fills=Object.values(Ot),this.strokes=Object.values(Ft),this.fillOpacity=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.outerRadiusOffset=0,this.outerRadiusRatio=1,this.strokeWidth=1,this.sectorSpacing=void 0,this.innerLabels=new vt(xg),this.title=new Sg,this.innerCircle=new Eg,this.shadow=new Bd,this.calloutLabel=new Ag,this.sectorLabel=new Mg,this.calloutLine=new Tg,this.tooltip=new zd,this.__BACKGROUND_COLOR_DO_NOT_USE=void 0}isValid(){const e=super.isValid();return null==this.innerRadiusRatio&&null==this.innerRadiusOffset?(L.warnOnce("Either an [innerRadiusRatio] or an [innerRadiusOffset] must be set to render a donut series."),!1):e}};function Ig(e,t,i,n){const s=[i.convert(0),i.convert(1)],r=[n.convert(0),n.convert(1)],o=Math.PI/-2+Gs(t),a=e?"initial":"update";return{nodes:{toFn:(e,t,i,{prevLive:n})=>{var r,a;let{startAngle:l,endAngle:c,innerRadius:h,outerRadius:u}=t;const{stroke:d,fill:p}=t.sectorFormat;if("removed"===i&&n?(l=null==(r=n.datum)?void 0:r.endAngle,c=null==(a=n.datum)?void 0:a.endAngle):"removed"!==i||n||(l=o,c=o),"removed"===i){const e=(({radius:e})=>({innerRadius:s[0],outerRadius:s[0]+(s[1]-s[0])*e}))(t);h=e.innerRadius,u=e.outerRadius}return{startAngle:l,endAngle:c,outerRadius:u,innerRadius:h,stroke:d,fill:p}},fromFn:(t,i,n,{prevFromProps:s})=>{var l,c,h,u,d,p;let{startAngle:g,endAngle:f,innerRadius:m,outerRadius:y}=t,{fill:v,stroke:b}=i.sectorFormat;if("unknown"===n||"added"===n&&!s?(g=o,f=o,m=i.innerRadius,y=i.outerRadius):"added"===n&&s&&(g=null!=(l=s.endAngle)?l:o,f=null!=(c=s.endAngle)?c:o,m=null!=(h=s.innerRadius)?h:i.innerRadius,y=null!=(u=s.outerRadius)?u:i.outerRadius),"added"===n&&!e){const e=(({radius:e})=>({innerRadius:r[0],outerRadius:r[0]+(r[1]-r[0])*e}))(i);m=e.innerRadius,y=e.outerRadius}return"updated"===n&&(v=null!=(d=t.fill)?d:v,b=null!=(p=t.stroke)?p:b),{startAngle:g,endAngle:f,innerRadius:m,outerRadius:y,fill:v,stroke:b,phase:a}}},innerCircle:{fromFn:(e,t)=>{var i,n,s;return{size:null!=(s=null!=(n=null==(i=e.previousDatum)?void 0:i.radius)?n:e.size)?s:0,phase:a}},toFn:(e,t)=>{var i;return{size:null!=(i=t.radius)?i:0}}}}}function Rg(e,t){return{startAngle:t.startAngle,endAngle:t.endAngle,innerRadius:t.innerRadius,outerRadius:t.outerRadius,fill:t.sectorFormat.fill,stroke:t.sectorFormat.stroke}}function kg(e,t){const i=t.y-e.centerY,n=t.x-e.centerX,s=Math.atan2(i,n),r=e.getItemNodes();for(const e of r)if(!0!==e.datum.missing&&Fs(s,e.startAngle,e.endAngle)){const t=Math.sqrt(n*n+i*i);let s=0;return t<e.innerRadius?s=e.innerRadius-t:t>e.outerRadius&&(s=t-e.outerRadius),{datum:e.datum,distance:s}}}function Pg(e,t){const i=e.getNodeData();if(void 0===i)return;const{centerX:n,centerY:s}=e,r=i[t.datumIndex],o=[{radius:r.innerRadius,angle:r.startAngle},{radius:r.innerRadius,angle:r.endAngle},{radius:r.outerRadius,angle:r.startAngle},{radius:r.outerRadius,angle:r.endAngle}],a=[0,Math.PI/2,Math.PI,3*Math.PI/2];for(const e of a)Fs(e,r.startAngle,r.endAngle)&&o.push({radius:r.outerRadius,angle:e});const l=o.map(({radius:e,angle:t})=>Hs(n,s,e,t)),c=l.map(e=>e.x),h=l.map(e=>e.y),u=Math.min(...c),d=Math.min(...h),p=Math.max(...c)-u,g=Math.max(...h)-d;return new es(u,d,p,g)}b([$s(er)],Dg.prototype,"angleKey",2),b([$s(er,{optional:!0})],Dg.prototype,"angleName",2),b([$s(er,{optional:!0})],Dg.prototype,"radiusKey",2),b([$s(er,{optional:!0})],Dg.prototype,"radiusName",2),b([$s(nr,{optional:!0})],Dg.prototype,"radiusMin",2),b([$s(nr,{optional:!0})],Dg.prototype,"radiusMax",2),b([$s(er,{optional:!0})],Dg.prototype,"calloutLabelKey",2),b([$s(er,{optional:!0})],Dg.prototype,"calloutLabelName",2),b([$s(er,{optional:!0})],Dg.prototype,"sectorLabelKey",2),b([$s(er,{optional:!0})],Dg.prototype,"sectorLabelName",2),b([$s(er,{optional:!0})],Dg.prototype,"legendItemKey",2),b([$s(mr)],Dg.prototype,"fills",2),b([$s(mr)],Dg.prototype,"strokes",2),b([$s(sr)],Dg.prototype,"fillOpacity",2),b([$s(sr)],Dg.prototype,"strokeOpacity",2),b([$s(Er)],Dg.prototype,"lineDash",2),b([$s(nr)],Dg.prototype,"lineDashOffset",2),b([$s(nr)],Dg.prototype,"cornerRadius",2),b([$s(Js,{optional:!0})],Dg.prototype,"formatter",2),b([$s(rr)],Dg.prototype,"rotation",2),b([$s(tr)],Dg.prototype,"outerRadiusOffset",2),b([$s(sr)],Dg.prototype,"outerRadiusRatio",2),b([$s(tr,{optional:!0})],Dg.prototype,"innerRadiusOffset",2),b([$s(sr,{optional:!0})],Dg.prototype,"innerRadiusRatio",2),b([$s(nr)],Dg.prototype,"strokeWidth",2),b([$s(nr,{optional:!0})],Dg.prototype,"sectorSpacing",2),b([$s(wr)],Dg.prototype,"innerLabels",2),b([$s(Xs)],Dg.prototype,"title",2),b([$s(Xs)],Dg.prototype,"innerCircle",2),b([$s(Xs)],Dg.prototype,"shadow",2),b([$s(Xs)],Dg.prototype,"calloutLabel",2),b([$s(Xs)],Dg.prototype,"sectorLabel",2),b([$s(Xs)],Dg.prototype,"calloutLine",2),b([$s(Xs)],Dg.prototype,"tooltip",2),b([$s(er,{optional:!0})],Dg.prototype,"__BACKGROUND_COLOR_DO_NOT_USE",2);var _g=class extends Lu{constructor(e){var t=e,{useLabelLayer:i=!1,pickModes:n=[0],canHaveAxes:s=!1,animationResetFns:r}=t,o=y(t,["useLabelLayer","pickModes","canHaveAxes","animationResetFns"]);super(m(f({},o),{useLabelLayer:i,pickModes:n,contentGroupVirtual:!1,directionKeys:{x:["angleKey"],y:["radiusKey"]},directionNames:{x:["angleName"],y:["radiusName"]},canHaveAxes:s})),this.itemGroup=this.contentGroup.appendChild(new xo),this.nodeData=[],this.itemSelection=La.select(this.itemGroup,()=>this.nodeFactory(),!1),this.labelSelection=La.select(this.labelGroup,Oo,!1),this.highlightSelection=La.select(this.highlightGroup,()=>this.nodeFactory()),this.centerX=0,this.centerY=0,this.radius=0,this.showFocusBox=!1,this.itemGroup.zIndexSubOrder=[()=>this._declarationOrder,1],this.animationResetFns=r,this.animationState=new ma("empty",{empty:{update:{target:"ready",action:e=>this.animateEmptyUpdateReady(e)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:e=>this.animateReadyHighlight(e),highlightMarkers:e=>this.animateReadyHighlightMarkers(e),resize:e=>this.animateReadyResize(e),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:e=>this.animateWaitingUpdateReady(e)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:e=>this.animateClearingUpdateEmpty(e)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}getItemNodes(){return this.itemGroup.children}getNodeData(){return this.nodeData}resetAnimation(e){"initial"===e?this.animationState.transition("reset"):"ready"===e&&this.animationState.transition("skip")}getLabelData(){return[]}computeLabelsBBox(e,t){return null}resetAllAnimation(){var e;const{item:t,label:i}=null!=(e=this.animationResetFns)?e:{};this.ctx.animationManager.stopByAnimationGroupId(this.id),t&&fa([this.itemSelection,this.highlightSelection],t),i&&fa([this.labelSelection],i),this.itemSelection.cleanup(),this.labelSelection.cleanup(),this.highlightSelection.cleanup()}animateEmptyUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateWaitingUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateReadyHighlight(e){var t;const{item:i}=null!=(t=this.animationResetFns)?t:{};i&&fa([this.highlightSelection],i)}animateReadyHighlightMarkers(e){}animateReadyResize(e){this.resetAllAnimation()}animateClearingUpdateEmpty(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animationTransitionClear(){this.animationState.transition("clear",this.getAnimationData())}getAnimationData(e){return{seriesRect:e}}},Lg=class extends Yh{constructor(e,t,i,n){super(e,t,i,n),this.angleKey=n.properties.angleKey,this.radiusKey=n.properties.radiusKey,this.calloutLabelKey=n.properties.calloutLabelKey,this.sectorLabelKey=n.properties.sectorLabelKey}},Ng=class extends _g{constructor(e){super({moduleCtx:e,pickModes:[0],useLabelLayer:!0,animationResetFns:{item:Rg,label:Fd}}),this.properties=new Dg,this.previousRadiusScale=new Xu,this.radiusScale=new Xu,this.backgroundGroup=this.rootGroup.appendChild(new xo({name:`${this.id}-background`,layer:!0,zIndex:0})),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new xo({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new yu),this.zerosumInnerRing=this.zerosumRingsGroup.appendChild(new yu),this.innerCircleGroup=this.backgroundGroup.appendChild(new xo({name:`${this.id}-innerCircle`})),this.seriesItemEnabled=[],this.surroundingRadius=void 0,this.NodeEvent=Lg,this.angleScale=new Xu,this.angleScale.domain=[0,1],this.angleScale.range=[-Math.PI,Math.PI].map(e=>e+Math.PI/2);const t=new xo({name:"pieCalloutLabels"}),i=new xo({name:"pieSectorLabels"}),n=new xo({name:"innerLabels"});this.labelGroup.append(t),this.labelGroup.append(i),this.labelGroup.append(n),this.calloutLabelSelection=La.select(t,xo),this.sectorLabelSelection=La.select(i,Oo),this.innerLabelsSelection=La.select(n,Oo),this.innerCircleSelection=La.select(this.innerCircleGroup,yu)}addChartEventListeners(){var e;this.destroyFns.push(null==(e=this.ctx.chartEventManager)?void 0:e.addListener("legend-item-click",e=>this.onLegendItemClick(e)))}get visible(){return super.visible&&(0===this.seriesItemEnabled.length||this.seriesItemEnabled.some(e=>e))}nodeFactory(){return new wg}getSeriesDomain(e){return"x"===e?this.angleScale.domain:this.radiusScale.domain}processData(e){return w(this,null,function*(){var t,i,n,s,r;if(null==this.data||!this.properties.isValid())return;let{data:o}=this;const{visible:a,seriesItemEnabled:l}=this,{angleKey:c,radiusKey:h,calloutLabelKey:u,sectorLabelKey:d,legendItemKey:p}=this.properties,g=!this.ctx.animationManager.isSkipped(),y=[],v=[];p?y.push(Uh(p,"band",{id:"legendItemKey"})):u?y.push(Uh(u,"band",{id:"calloutLabelKey"})):d&&y.push(Uh(d,"band",{id:"sectorLabelKey"}));const b=this.radiusScale.type,C=this.radiusScale.type;h&&v.push(Wh(h,{id:"radiusValue",min:null!=(t=this.properties.radiusMin)?t:0,max:this.properties.radiusMax}),zh(h,b,{id:"radiusRaw"}),Rh({id:"radiusValue"},[0,1],1,null!=(i=this.properties.radiusMin)?i:0,this.properties.radiusMax)),u&&v.push(zh(u,"band",{id:"calloutLabelValue"})),d&&v.push(zh(d,"band",{id:"sectorLabelValue"})),p&&v.push(zh(p,"band",{id:"legendItemValue"})),g&&this.processedData&&y.length>0&&v.push(Nh(this.processedData)),v.push(kh()),o=o.map((e,t)=>a&&l[t]?e:m(f({},e),{[c]:0})),yield this.requestDataModel(e,o,{props:[...y,jh(c,C,{id:"angleValue",onlyPositive:!0}),zh(c,C,{id:"angleRaw"}),Rh({id:"angleValue"},[0,1],0,0),...v]});for(const e of null!=(r=null==(s=null==(n=this.processedData)?void 0:n.defs)?void 0:s.values)?r:[]){const{id:t,missing:i,property:n}=e,s=qc(this,i);"angleRaw"!==t&&s>0&&L.warnOnce(`no value was found for the key '${String(n)}' on ${s} data element${s>1?"s":""}`)}this.animationState.transition("updateData")})}maybeRefreshNodeData(){return w(this,null,function*(){var e;if(!this.nodeDataRefresh)return;const{nodeData:t=[]}=null!=(e=yield this.createNodeData())?e:{};this.nodeData=t,this.nodeDataRefresh=!1})}getProcessedDataIndexes(e){return{angleIdx:e.resolveProcessedDataIndexById(this,"angleValue"),radiusIdx:this.properties.radiusKey?e.resolveProcessedDataIndexById(this,"radiusValue"):-1,calloutLabelIdx:this.properties.calloutLabelKey?e.resolveProcessedDataIndexById(this,"calloutLabelValue"):-1,sectorLabelIdx:this.properties.sectorLabelKey?e.resolveProcessedDataIndexById(this,"sectorLabelValue"):-1,legendItemIdx:this.properties.legendItemKey?e.resolveProcessedDataIndexById(this,"legendItemValue"):-1}}createNodeData(){return w(this,null,function*(){const{id:e,processedData:t,dataModel:i,angleScale:n}=this,{rotation:s,innerRadiusRatio:r}=this.properties;if(!this.properties.isValid())return this.zerosumOuterRing.visible=!0,this.zerosumInnerRing.visible=!0,{itemId:e,nodeData:[],labelData:[]};if(!t||!i||"ungrouped"!==t.type)return;const{angleIdx:o,radiusIdx:a,calloutLabelIdx:l,sectorLabelIdx:c,legendItemIdx:h}=this.getProcessedDataIndexes(i);let u=0,d=0;const p=t.data.map((e,t)=>{var i;const{datum:r,values:p}=e,g=p[o],m=n.convert(u)+Gs(s);u=g,d+=g;const y=n.convert(u)+Gs(s),v=Math.abs(y-m),b=m+v/2,C=p[o+1],w=a>=0&&null!=(i=p[a])?i:1,S=a>=0?p[a+1]:void 0,x=h>=0?p[h]:void 0,E=this.getLabels(r,b,v,!0,p[l],p[c],x),A=this.getSectorFormat(r,t,!1);return f({itemId:t,series:this,datum:r,index:t,angleValue:C,midAngle:b,midCos:Math.cos(b),midSin:Math.sin(b),startAngle:m,endAngle:y,sectorFormat:A,radiusValue:S,radius:w,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(w),0),legendItemValue:x},E)});return this.zerosumOuterRing.visible=0===d,this.zerosumInnerRing.visible=0===d&&null!=r&&1!==r&&r>0,{itemId:e,nodeData:p,labelData:p}})}getLabels(e,t,i,n,s,r,o){const{calloutLabel:a,sectorLabel:l,legendItemKey:c}=this.properties,h=!n||a.enabled?this.properties.calloutLabelKey:void 0,u=!n||l.enabled?this.properties.sectorLabelKey:void 0;if(!h&&!u&&!c)return{};const d={datum:e,angleKey:this.properties.angleKey,angleName:this.properties.angleName,radiusKey:this.properties.radiusKey,radiusName:this.properties.radiusName,calloutLabelKey:this.properties.calloutLabelKey,calloutLabelName:this.properties.calloutLabelName,sectorLabelKey:this.properties.sectorLabelKey,sectorLabelName:this.properties.sectorLabelName,legendItemKey:this.properties.legendItemKey},p={};return h&&i>Gs(a.minAngle)&&(p.calloutLabel=m(f({},this.getTextAlignment(t)),{text:this.getLabelText(a,m(f({},d),{value:s})),hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0})),u&&(p.sectorLabel={text:this.getLabelText(l,m(f({},d),{value:r}))}),null!=c&&null!=o&&(p.legendItem={key:c,text:o}),p}getTextAlignment(e){const t=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"hanging"},{textAlign:"right",textBaseline:"middle"}],i=Os(e)- -.75*Math.PI;return t[qn(Math.floor(i/(Math.PI/2)),t.length)]}getSectorFormat(e,t,i){var n,s,r,o,a;const{callbackCache:l,highlightManager:c}=this.ctx,{angleKey:h,radiusKey:u,fills:d,strokes:p,formatter:g,sectorSpacing:f,__BACKGROUND_COLOR_DO_NOT_USE:m}=this.properties,y=c.getActiveHighlight(),v=i&&(null==y?void 0:y.series)===this&&t===y.itemId;let b=p[t%p.length];null==f&&null==b&&(b=m);const{fill:C,fillOpacity:w,stroke:S,strokeWidth:x,strokeOpacity:E}=qe(v&&this.properties.highlightStyle.item,{fill:d.length>0?d[t%d.length]:void 0,fillOpacity:this.properties.fillOpacity,stroke:b,strokeWidth:this.getStrokeWidth(this.properties.strokeWidth),strokeOpacity:this.getOpacity()});let A;return g&&(A=l.call(g,{datum:e,angleKey:h,radiusKey:u,fill:C,stroke:S,fills:d,strokes:p,strokeWidth:x,highlighted:v,seriesId:this.id})),{fill:null!=(n=null==A?void 0:A.fill)?n:C,fillOpacity:null!=(s=null==A?void 0:A.fillOpacity)?s:w,stroke:null!=(r=null==A?void 0:A.stroke)?r:S,strokeWidth:null!=(o=null==A?void 0:A.strokeWidth)?o:x,strokeOpacity:null!=(a=null==A?void 0:A.strokeOpacity)?a:E}}getInnerRadius(){const{radius:e}=this,{innerRadiusRatio:t=1,innerRadiusOffset:i=0}=this.properties,n=e*t+i;return n===e||n<0?0:n}getOuterRadius(){const{outerRadiusRatio:e,outerRadiusOffset:t}=this.properties;return Math.max(this.radius*e+t,0)}updateRadiusScale(e){const t=[this.getInnerRadius(),this.getOuterRadius()];this.radiusScale.range=t,e&&(this.previousRadiusScale.range=t),this.nodeData=this.nodeData.map(e=>{var t=e,{radius:i}=t,n=y(t,["radius"]);return m(f({},n),{radius:i,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(i),0)})})}getTitleTranslationY(){var e,t;const i=Math.max(0,this.radiusScale.range[1]);return 0===i?NaN:-i-(2+(null!=(t=null==(e=this.properties.title)?void 0:e.spacing)?t:0))-Math.max(0,-i)}update(e){return w(this,arguments,function*({seriesRect:e}){const{title:t}=this.properties,i={seriesRectWidth:null==e?void 0:e.width,seriesRectHeight:null==e?void 0:e.height},n=null!=wt(this.nodeDataDependencies,i);if(n&&(this._nodeDataDependencies=i),yield this.maybeRefreshNodeData(),this.updateTitleNodes(),this.updateRadiusScale(n),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.backgroundGroup.translationX=this.centerX,this.backgroundGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),t){const e=this.getTitleTranslationY(),i=t.node.computeBBox();t.node.visible=t.enabled&&isFinite(e)&&!this.bboxIntersectsSurroundingSeries(i,0,e),t.node.translationY=isFinite(e)?e:0}for(const e of[this.zerosumInnerRing,this.zerosumOuterRing])e.fillOpacity=0,e.stroke=this.properties.calloutLabel.color,e.strokeWidth=1,e.strokeOpacity=1;this.updateNodeMidPoint(),yield this.updateSelections(),yield this.updateNodes(e)})}updateTitleNodes(){var e,t;const{oldTitle:i}=this,{title:n}=this.properties;i!==n&&(i&&(null==(e=this.labelGroup)||e.removeChild(i.node)),n&&(n.node.textBaseline="bottom",null==(t=this.labelGroup)||t.appendChild(n.node)),this.oldTitle=n)}updateNodeMidPoint(){this.nodeData.forEach(e=>{const t=e.innerRadius+(e.outerRadius-e.innerRadius)/2;e.midPoint={x:e.midCos*Math.max(0,t),y:e.midSin*Math.max(0,t)}})}updateSelections(){return w(this,null,function*(){yield this.updateGroupSelection(),this.updateInnerCircleSelection()})}updateGroupSelection(){return w(this,null,function*(){const{itemSelection:e,highlightSelection:t,calloutLabelSelection:i,sectorLabelSelection:n,innerLabelsSelection:s}=this,r=(e,t)=>{let i=this.nodeData;t&&(i=i.map(e=>m(f({},e),{sectorFormat:f({},e.sectorFormat)}))),e.update(i,void 0,e=>this.getDatumId(e)),this.ctx.animationManager.isSkipped()&&e.cleanup()};r(e,!1),r(t,!0),i.update(this.nodeData,e=>{const t=new Ga;t.tag=0,t.pointerEvents=1,e.appendChild(t);const i=new Oo;i.tag=1,i.pointerEvents=1,e.appendChild(i)}),n.update(this.nodeData,e=>{e.pointerEvents=1}),s.update(this.properties.innerLabels,e=>{e.pointerEvents=1})})}updateInnerCircleSelection(){const{innerCircle:e}=this.properties;let t=0;const i=this.getInnerRadius();if(i>0){const e=Math.min(i,this.getOuterRadius()),n=1;t=Math.ceil(2*e+n)}const n=e?[{radius:t}]:[];this.innerCircleSelection.update(n)}updateNodes(e){return w(this,null,function*(){const t=this.ctx.highlightManager.getActiveHighlight(),i=this.visible&&this.seriesItemEnabled.indexOf(!0)>=0;this.rootGroup.visible=i,this.backgroundGroup.visible=i,this.contentGroup.visible=i,this.highlightGroup.visible=i&&(null==t?void 0:t.series)===this,this.labelGroup&&(this.labelGroup.visible=i),this.contentGroup.opacity=this.getOpacity(),this.innerCircleSelection.each((e,{radius:t})=>{var i,n;e.setProperties({fill:null==(i=this.properties.innerCircle)?void 0:i.fill,opacity:null==(n=this.properties.innerCircle)?void 0:n.fillOpacity,size:t})});const n=(e,t,i,n)=>{const s=this.getSectorFormat(t.datum,t.itemId,n);t.sectorFormat.fill=s.fill,t.sectorFormat.stroke=s.stroke;const r=this.ctx.animationManager.isSkipped();r&&(e.startAngle=t.startAngle,e.endAngle=t.endAngle,e.innerRadius=t.innerRadius,e.outerRadius=t.outerRadius),(n||r)&&(e.fill=s.fill,e.stroke=s.stroke),e.strokeWidth=s.strokeWidth,e.fillOpacity=s.fillOpacity,e.strokeOpacity=this.properties.strokeOpacity,e.lineDash=this.properties.lineDash,e.lineDashOffset=this.properties.lineDashOffset,e.fillShadow=this.properties.shadow,e.cornerRadius=this.properties.cornerRadius,e.inset=null!=this.properties.sectorSpacing?(this.properties.sectorSpacing+(null!=s.stroke?s.strokeWidth:0))/2:0,e.lineJoin=null!=this.properties.sectorSpacing?"miter":"round"};this.itemSelection.each((e,t,i)=>n(e,t,0,!1)),this.highlightSelection.each((e,i,s)=>{const r=(null==t?void 0:t.series)===this&&e.datum.itemId===t.itemId;n(e,i,0,!0),e.visible=r}),this.updateCalloutLineNodes(),this.updateCalloutLabelNodes(e),this.updateSectorLabelNodes(),this.updateInnerLabelNodes(),this.updateZerosumRings(),this.animationState.transition("update")})}updateCalloutLineNodes(){var e;const{calloutLine:t}=this.properties,i=t.length,n=t.strokeWidth,s=null!=(e=t.colors)?e:this.properties.strokes,{offset:r}=this.properties.calloutLabel;this.calloutLabelSelection.selectByTag(0).forEach((e,t)=>{var o;const a=e.datum,{calloutLabel:l,outerRadius:c}=a;if((null==l?void 0:l.text)&&!l.hidden&&0!==c){e.visible=!0,e.strokeWidth=n,e.stroke=s[t%s.length],e.fill=void 0;const h=a.midCos*c,u=a.midSin*c;let d=a.midCos*(c+i),p=a.midSin*(c+i);if((null!=(o=l.collisionTextAlign)?o:0!==l.collisionOffsetY)&&null!=l.box){const e=l.box;let t=d,i=p;d<e.x?t=e.x:d>e.x+e.width&&(t=e.x+e.width),p<e.y?i=e.y:p>e.y+e.height&&(i=e.y+e.height);const n=t-d,s=i-p,o=Math.sqrt(Math.pow(n,2)+Math.pow(s,2)),a=o-r;a>0&&(d+=n*a/o,p+=s*a/o)}e.x1=h,e.y1=u,e.x2=d,e.y2=p}else e.visible=!1})}getLabelOverflow(e,t,i){const n=i.x-this.centerX,s=i.x+i.width-this.centerX,r=i.y-this.centerY,o=i.y+i.height-this.centerY;let a=1;t.x+1<n?a=(t.x+t.width-n)/t.width:t.x+t.width-1>s&&(a=(s-t.x)/t.width);const l=t.y+1<r||t.y+t.height-1>o;return{textLength:1===a?e.length:Math.floor(e.length*a)-1,hasVerticalOverflow:l,hasSurroundingSeriesOverflow:this.bboxIntersectsSurroundingSeries(t)}}bboxIntersectsSurroundingSeries(e,t=0,i=0){const{surroundingRadius:n}=this;if(null==n)return!1;const s=[{x:e.x+t,y:e.y+i},{x:e.x+e.width+t,y:e.y+i},{x:e.x+e.width+t,y:e.y+e.height+i},{x:e.x+t,y:e.y+e.height+i}],r=p(n,2);return s.some(e=>p(e.x,2)+p(e.y,2)>r)}computeCalloutLabelCollisionOffsets(){const{radiusScale:e}=this,{calloutLabel:t,calloutLine:i}=this.properties,{offset:n,minSpacing:s}=t,r=e.convert(0),o=this.nodeData,a=this.nodeData.filter(e=>{return!(!(t=e).calloutLabel||0===t.outerRadius);var t});if(a.forEach(e=>{const t=e.calloutLabel;null!=t&&(t.hidden=!1,t.collisionTextAlign=void 0,t.collisionOffsetY=0)}),a.length<=1)return;const l=a.filter(e=>e.midCos<0).sort((e,t)=>e.midSin-t.midSin),c=a.filter(e=>e.midCos>=0).sort((e,t)=>e.midSin-t.midSin),h=a.filter(e=>{var t;return e.midSin<0&&"center"===(null==(t=e.calloutLabel)?void 0:t.textAlign)}).sort((e,t)=>e.midCos-t.midCos),u=a.filter(e=>{var t;return e.midSin>=0&&"center"===(null==(t=e.calloutLabel)?void 0:t.textAlign)}).sort((e,t)=>e.midCos-t.midCos),d=new Oo,p=e=>{var t;const s=e.calloutLabel;if(null==s)return new es(0,0,0,0);const r=e.outerRadius+i.length+n,o=e.midCos*r,a=e.midSin*r+s.collisionOffsetY;return d.text=s.text,d.x=o,d.y=a,d.setFont(this.properties.calloutLabel),d.setAlign({textAlign:null!=(t=s.collisionTextAlign)?t:s.textAlign,textBaseline:s.textBaseline}),d.computeBBox()},g=(e,t,i)=>{const n=p(e).grow(s/2),r=p(t).grow(s/2);if(n.x<r.x+r.width&&n.x+n.width>r.x&&("to-top"===i?n.y<r.y+r.height:n.y+n.height>r.y)){const e="to-top"===i?n.y-r.y-r.height:n.y+n.height-r.y;t.calloutLabel.collisionOffsetY=e}},f=e=>{const t=e.slice().sort((e,t)=>Math.abs(e.midSin)-Math.abs(t.midSin))[0],i=e.indexOf(t);for(let t=i-1;t>=0;t--){const i=e[t+1],n=e[t];g(i,n,"to-top")}for(let t=i+1;t<e.length;t++){const i=e[t-1],n=e[t];g(i,n,"to-bottom")}},m=e=>{const t=a.some(e=>0!==e.calloutLabel.collisionOffsetY),i=e.map(e=>p(e)),n=i.map(e=>e.clone().grow(s/2));let l=!1;for(let t=0;t<n.length&&!l;t++){const i=n[t];for(let s=t+1;s<e.length;s++){const e=n[s];if(i.collidesBBox(e)){l=!0;break}}}const c=o.map(e=>{const{startAngle:t,endAngle:i,outerRadius:n}=e;return{startAngle:t,endAngle:i,innerRadius:r,outerRadius:n}}),h=i.some(e=>c.some(t=>gg(e,t)));(l||t||h)&&e.filter(e=>"center"===e.calloutLabel.textAlign).forEach(e=>{const t=e.calloutLabel;e.midCos<0?t.collisionTextAlign="right":e.midCos>0?t.collisionTextAlign="left":t.collisionTextAlign="center"})};f(l),f(c),m(h),m(u)}updateCalloutLabelNodes(e){const{radiusScale:t}=this,{calloutLabel:i,calloutLine:n}=this.properties,s=n.length,{offset:r,color:o}=i,a=new Oo;this.calloutLabelSelection.selectByTag(1).forEach(n=>{var l;const{datum:c}=n,h=c.calloutLabel,u=t.convert(c.radius),d=Math.max(0,u);if(!(null==h?void 0:h.text)||0===d||h.hidden)return void(n.visible=!1);const p=d+s+r,g=c.midCos*p,f=c.midSin*p+h.collisionOffsetY,m={textAlign:null!=(l=h.collisionTextAlign)?l:h.textAlign,textBaseline:h.textBaseline};a.text=h.text,a.x=g,a.y=f,a.setFont(this.properties.calloutLabel),a.setAlign(m);const y=a.computeBBox();let v=h.text,b=!0;if(i.avoidCollisions){const{textLength:t,hasVerticalOverflow:i}=this.getLabelOverflow(h.text,y,e);v=h.text.length===t?h.text:`${h.text.substring(0,t)}…`,b=!i}n.text=v,n.x=g,n.y=f,n.setFont(this.properties.calloutLabel),n.setAlign(m),n.fill=o,n.visible=b})}computeLabelsBBox(e,t){return w(this,null,function*(){const{calloutLabel:i,calloutLine:n}=this.properties,s=n.length,{offset:r,maxCollisionOffset:o,minSpacing:a}=i;if(!i.avoidCollisions)return null;yield this.maybeRefreshNodeData(),this.updateRadiusScale(!1),this.computeCalloutLabelCollisionOffsets();const l=[],c=new Oo;let h;const{title:u}=this.properties;if((null==u?void 0:u.text)&&u.enabled){const e=this.getTitleTranslationY();isFinite(e)&&(c.text=u.text,c.x=0,c.y=e,c.setFont(u),c.setAlign({textBaseline:"bottom",textAlign:"center"}),h=c.computeBBox(),l.push(h))}return this.nodeData.forEach(i=>{var n;const u=i.calloutLabel;if(!u||0===i.outerRadius)return null;const d=i.outerRadius+s+r,p=i.midCos*d,g=i.midSin*d+u.collisionOffsetY;c.text=u.text,c.x=p,c.y=g,c.setFont(this.properties.calloutLabel),c.setAlign({textAlign:null!=(n=u.collisionTextAlign)?n:u.textAlign,textBaseline:u.textBaseline});const f=c.computeBBox();if(u.box=f,Math.abs(u.collisionOffsetY)>o)u.hidden=!0;else{if(h){const e=t.y-this.centerY,i=new es(h.x-a,e,h.width+2*a,h.y+h.height+a-e);if(f.collidesBBox(i))return void(u.hidden=!0)}if(e.hideWhenNecessary){const{textLength:e,hasVerticalOverflow:i,hasSurroundingSeriesOverflow:n}=this.getLabelOverflow(u.text,f,t),s=u.text.length>2&&e<2;if(i||s||n)return void(u.hidden=!0)}u.hidden=!1,l.push(f)}}),0===l.length?null:es.merge(l)})}updateSectorLabelNodes(){const{radiusScale:e}=this,t=e.convert(0),{fontSize:i,fontStyle:n,fontWeight:s,fontFamily:r,positionOffset:o,positionRatio:a,color:l}=this.properties.sectorLabel;this.sectorLabelSelection.each((e,c)=>{const{sectorLabel:h,outerRadius:u}=c;let d=!1;if(h&&0!==u){const p=t*(1-a)+u*a+o;e.fill=l,e.fontStyle=n,e.fontWeight=s,e.fontSize=i,e.fontFamily=r,e.text=h.text,e.x=c.midCos*p,e.y=c.midSin*p,e.textAlign="center",e.textBaseline="middle";const g=e.computeBBox(),f=[[g.x,g.y],[g.x+g.width,g.y],[g.x+g.width,g.y+g.height],[g.x,g.y+g.height]],{startAngle:m,endAngle:y}=c,v={startAngle:m,endAngle:y,innerRadius:t,outerRadius:u};f.every(([e,t])=>dg(e,t,v))&&(d=!0)}e.visible=d})}updateInnerLabelNodes(){const e=[],t=[];this.innerLabelsSelection.each((i,n)=>{const{fontStyle:s,fontWeight:r,fontSize:o,fontFamily:a,color:l}=n;i.fontStyle=s,i.fontWeight=r,i.fontSize=o,i.fontFamily=a,i.text=n.text,i.x=0,i.y=0,i.fill=l,i.textAlign="center",i.textBaseline="alphabetic",e.push(i.computeBBox()),t.push(n.margin)});const i=e=>0===e?0:t[e],n=e=>e===t.length-1?0:t[e],s=e.reduce((e,t,s)=>e+t.height+i(s)+n(s),0),r=Math.max(...e.map(e=>e.width)),o=this.getInnerRadius(),a=Math.sqrt(Math.pow(r/2,2)+Math.pow(s/2,2))<=(o>0?o:this.getOuterRadius()),l=[];for(let t=0,r=-s/2;t<e.length;t++){const s=e[t].height+r+i(t);l.push(s),r=s+n(t)}this.innerLabelsSelection.each((e,t,i)=>{e.y=l[i],e.visible=a})}updateZerosumRings(){this.zerosumOuterRing.size=2*this.getOuterRadius(),this.zerosumInnerRing.size=2*this.getInnerRadius()}getDatumLegendName(e){const{angleKey:t,calloutLabelKey:i,sectorLabelKey:n,legendItemKey:s}=this.properties,{sectorLabel:r,calloutLabel:o,legendItem:a}=e;return s&&void 0!==a?a.text:i&&i!==t&&void 0!==(null==o?void 0:o.text)?o.text:n&&n!==t&&void 0!==(null==r?void 0:r.text)?r.text:void 0}pickNodeClosestDatum(e){return kg(this,e)}getTooltipHtml(e){var t;if(!this.properties.isValid())return tl;const{datum:i,angleValue:n,sectorFormat:{fill:s},itemId:r}=e,o=Ld(null==(t=this.properties.title)?void 0:t.text),a=ze(n)?Yn(n):String(n),l=this.getDatumLegendName(e);return this.properties.tooltip.toTooltipHtml({title:null!=o?o:l,content:o&&l?`${l}: ${a}`:a,backgroundColor:s},{datum:i,itemId:r,title:o,color:s,seriesId:this.id,angleKey:this.properties.angleKey,angleName:this.properties.angleName,radiusKey:this.properties.radiusKey,radiusName:this.properties.radiusName,calloutLabelKey:this.properties.calloutLabelKey,calloutLabelName:this.properties.calloutLabelName,sectorLabelKey:this.properties.sectorLabelKey,sectorLabelName:this.properties.sectorLabelName,legendItemKey:this.properties.legendItemKey})}getLegendData(e){var t,i,n,s,r;const{visible:o,processedData:a,dataModel:l}=this;if(!l||!(null==a?void 0:a.data.length)||!this.properties.isValid()||"category"!==e)return[];const{angleKey:c,calloutLabelKey:h,sectorLabelKey:u,legendItemKey:d}=this.properties;if(!(d||h&&h!==c||u&&u!==c))return[];const{calloutLabelIdx:p,sectorLabelIdx:g,legendItemIdx:f}=this.getProcessedDataIndexes(l),m=(null==(t=this.properties.title)?void 0:t.showInLegend)&&this.properties.title.text,y=[];for(let e=0;e<a.data.length;e++){const{datum:t,values:l}=a.data[e],v=[];m&&v.push(m);const b=this.getLabels(t,2*Math.PI,2*Math.PI,!1,l[p],l[g],l[f]);if(d&&void 0!==b.legendItem?v.push(b.legendItem.text):h&&h!==c&&void 0!==(null==(i=b.calloutLabel)?void 0:i.text)?v.push(null==(n=b.calloutLabel)?void 0:n.text):u&&u!==c&&void 0!==(null==(s=b.sectorLabel)?void 0:s.text)&&v.push(null==(r=b.sectorLabel)?void 0:r.text),0===v.length)continue;const C=this.getSectorFormat(t,e,!1);y.push({legendType:"category",id:this.id,itemId:e,seriesId:this.id,enabled:o&&this.seriesItemEnabled[e],label:{text:v.join(" - ")},marker:{fill:C.fill,stroke:C.stroke,fillOpacity:this.properties.fillOpacity,strokeOpacity:this.properties.strokeOpacity,strokeWidth:this.properties.strokeWidth},legendItemName:null!=d?t[d]:void 0})}return y}onLegendItemClick(e){const{enabled:t,itemId:i,series:n,legendItemName:s}=e;n.id===this.id?this.toggleSeriesItem(i,t):null!=s&&this.toggleOtherSeriesItems(s,t)}toggleSeriesItem(e,t){this.seriesItemEnabled[e]=t,this.nodeDataRefresh=!0}toggleOtherSeriesItems(e,t){var i;if(!this.properties.legendItemKey||!this.dataModel)return;const n=this.dataModel.resolveProcessedDataIndexById(this,"legendItemValue");null==(i=this.processedData)||i.data.forEach(({values:i},s)=>{i[n]===e&&this.toggleSeriesItem(s,t)})}animateEmptyUpdateReady(e){const{animationManager:t}=this.ctx,i=Ig(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);Rs(this.id,"nodes",t,[this.itemSelection,this.highlightSelection],i.nodes),Rs(this.id,"innerCircle",t,[this.innerCircleSelection],i.innerCircle),Nd(this,"callout",t,this.calloutLabelSelection),Nd(this,"sector",t,this.sectorLabelSelection),Nd(this,"inner",t,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){var e,t,i,n,s,r;const{itemSelection:o,highlightSelection:a,processedData:l,radiusScale:c,previousRadiusScale:h}=this,{animationManager:u}=this.ctx,d=null==(e=null==l?void 0:l.reduced)?void 0:e.diff;this.ctx.animationManager.stopByAnimationGroupId(this.id);const p=0===(null!=(t=null==d?void 0:d.moved.size)?t:0),g=(null!=(i=null==l?void 0:l.defs.keys.length)?i:0)>0,f=null==(r=null==(s=null==(n=null==l?void 0:l.reduced)?void 0:n.animationValidation)?void 0:s.uniqueKeys)||r;p&&g&&f||this.ctx.animationManager.skipCurrentBatch();const m=Ig(!1,this.properties.rotation,c,h);Rs(this.id,"nodes",u,[o,a],m.nodes,(e,t)=>this.getDatumId(t),d),Rs(this.id,"innerCircle",u,[this.innerCircleSelection],m.innerCircle),Nd(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Nd(this,"sector",this.ctx.animationManager,this.sectorLabelSelection),Nd(this,"inner",this.ctx.animationManager,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}animateClearingUpdateEmpty(){const{itemSelection:e,highlightSelection:t,radiusScale:i,previousRadiusScale:n}=this,{animationManager:s}=this.ctx,r=Ig(!1,this.properties.rotation,i,n);Rs(this.id,"nodes",s,[e,t],r.nodes),Rs(this.id,"innerCircle",s,[this.innerCircleSelection],r.innerCircle),Od(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Od(this,"sector",this.ctx.animationManager,this.sectorLabelSelection),Od(this,"inner",this.ctx.animationManager,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}getDatumIdFromData(e){var t,i,n;const{calloutLabelKey:s,sectorLabelKey:r,legendItemKey:o}=this.properties;if(null==(n=null==(i=null==(t=this.processedData)?void 0:t.reduced)?void 0:i.animationValidation)?void 0:n.uniqueKeys)return o?e[o]:s?e[s]:r?e[r]:void 0}getDatumId(e){const{index:t}=e,i=this.getDatumIdFromData(e.datum);return null!=i?String(i):`${t}`}onDataChange(){var e;const{data:t,seriesItemEnabled:i}=this;this.seriesItemEnabled=null!=(e=null==t?void 0:t.map((e,t)=>{var n;return null==(n=i[t])||n}))?e:[]}computeFocusBounds(e){return Pg(this,e)}};Ng.className="DonutSeries",Ng.type="donut";var Og={series:{__extends__:zt,title:{enabled:!0,fontStyle:void 0,fontWeight:"normal",fontSize:14,fontFamily:jt,color:qt,spacing:5},calloutLabel:{enabled:!0,fontStyle:void 0,fontWeight:void 0,fontSize:12,fontFamily:jt,color:$t,offset:3,minAngle:0},sectorLabel:{enabled:!0,fontStyle:void 0,fontWeight:"normal",fontSize:12,fontFamily:jt,color:Yt,positionOffset:0,positionRatio:.5},calloutLine:{length:10,strokeWidth:2},fillOpacity:1,strokeOpacity:1,strokeWidth:1,lineDash:[0],lineDashOffset:0,rotation:0,shadow:{enabled:!1,color:ei,xOffset:3,yOffset:3,blur:5},innerLabels:{fontStyle:void 0,fontWeight:void 0,fontSize:12,fontFamily:jt,color:$t,margin:2},__BACKGROUND_COLOR_DO_NOT_USE:Jt}},Fg=({takeColors:e,colorsCount:t,userPalette:i})=>{const{fills:n,strokes:s}=e(t);return{fills:n,strokes:i?s:[],calloutLine:{colors:s}}},Gg={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["polar"],identifier:"donut",instanceConstructor:Ng,themeTemplate:Og,paletteFactory:Fg},Bg=class extends ol{constructor(){super(...arguments),this.showInLegend=!1}};b([$s(Qs)],Bg.prototype,"showInLegend",2);var Vg=class extends Bo{set(e,t){return super.set(e)}};b([_n("Use a Donut Series instead"),$s(er,{optional:!0})],Vg.prototype,"text",2),b([_n("Use a Donut Series instead"),$s(tr,{optional:!0})],Vg.prototype,"margin",2);var Hg=class extends yt{};b([_n("Use a Donut Series instead"),$s(fr,{optional:!0})],Hg.prototype,"fill",2),b([_n("Use a Donut Series instead"),$s(sr,{optional:!0})],Hg.prototype,"fillOpacity",2);var Ug=class extends Bo{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}};b([$s(nr)],Ug.prototype,"offset",2),b([$s(rr)],Ug.prototype,"minAngle",2),b([$s(nr)],Ug.prototype,"minSpacing",2),b([$s(nr)],Ug.prototype,"maxCollisionOffset",2),b([$s(Qs)],Ug.prototype,"avoidCollisions",2);var zg=class extends Bo{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}};b([$s(tr)],zg.prototype,"positionOffset",2),b([$s(sr)],zg.prototype,"positionRatio",2);var Wg=class extends yt{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}};b([$s(mr,{optional:!0})],Wg.prototype,"colors",2),b([$s(nr)],Wg.prototype,"length",2),b([$s(nr)],Wg.prototype,"strokeWidth",2);var jg=class extends Bu{constructor(){super(...arguments),this.fills=Object.values(Ot),this.strokes=Object.values(Ft),this.fillOpacity=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.outerRadiusOffset=0,this.outerRadiusRatio=1,this.strokeWidth=1,this.sectorSpacing=void 0,this.innerLabels=new vt(Vg),this.title=new Bg,this.innerCircle=new Hg,this.shadow=new Bd,this.calloutLabel=new Ug,this.sectorLabel=new zg,this.calloutLine=new Wg,this.tooltip=new zd,this.__BACKGROUND_COLOR_DO_NOT_USE=void 0}};b([$s(er)],jg.prototype,"angleKey",2),b([$s(er,{optional:!0})],jg.prototype,"angleName",2),b([$s(er,{optional:!0})],jg.prototype,"radiusKey",2),b([$s(er,{optional:!0})],jg.prototype,"radiusName",2),b([$s(nr,{optional:!0})],jg.prototype,"radiusMin",2),b([$s(nr,{optional:!0})],jg.prototype,"radiusMax",2),b([$s(er,{optional:!0})],jg.prototype,"calloutLabelKey",2),b([$s(er,{optional:!0})],jg.prototype,"calloutLabelName",2),b([$s(er,{optional:!0})],jg.prototype,"sectorLabelKey",2),b([$s(er,{optional:!0})],jg.prototype,"sectorLabelName",2),b([$s(er,{optional:!0})],jg.prototype,"legendItemKey",2),b([$s(mr)],jg.prototype,"fills",2),b([$s(mr)],jg.prototype,"strokes",2),b([$s(sr)],jg.prototype,"fillOpacity",2),b([$s(sr)],jg.prototype,"strokeOpacity",2),b([$s(Er)],jg.prototype,"lineDash",2),b([$s(nr)],jg.prototype,"lineDashOffset",2),b([$s(nr)],jg.prototype,"cornerRadius",2),b([$s(Js,{optional:!0})],jg.prototype,"formatter",2),b([$s(rr)],jg.prototype,"rotation",2),b([$s(tr)],jg.prototype,"outerRadiusOffset",2),b([$s(sr)],jg.prototype,"outerRadiusRatio",2),b([_n("Use a Donut Series instead"),$s(tr,{optional:!0})],jg.prototype,"innerRadiusOffset",2),b([_n("Use a Donut Series instead"),$s(sr,{optional:!0})],jg.prototype,"innerRadiusRatio",2),b([$s(nr)],jg.prototype,"strokeWidth",2),b([$s(nr,{optional:!0})],jg.prototype,"sectorSpacing",2),b([$s(wr)],jg.prototype,"innerLabels",2),b([$s(Xs)],jg.prototype,"title",2),b([$s(Xs)],jg.prototype,"innerCircle",2),b([$s(Xs)],jg.prototype,"shadow",2),b([$s(Xs)],jg.prototype,"calloutLabel",2),b([$s(Xs)],jg.prototype,"sectorLabel",2),b([$s(Xs)],jg.prototype,"calloutLine",2),b([$s(Xs)],jg.prototype,"tooltip",2),b([$s(er,{optional:!0})],jg.prototype,"__BACKGROUND_COLOR_DO_NOT_USE",2);var $g=class extends Yh{constructor(e,t,i,n){super(e,t,i,n),this.angleKey=n.properties.angleKey,this.radiusKey=n.properties.radiusKey,this.calloutLabelKey=n.properties.calloutLabelKey,this.sectorLabelKey=n.properties.sectorLabelKey}},Kg=class extends _g{constructor(e){super({moduleCtx:e,pickModes:[0],useLabelLayer:!0,animationResetFns:{item:Rg,label:Fd}}),this.properties=new jg,this.previousRadiusScale=new Xu,this.radiusScale=new Xu,this.backgroundGroup=this.rootGroup.appendChild(new xo({name:`${this.id}-background`,layer:!0,zIndex:0})),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new xo({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new yu),this.zerosumInnerRing=this.zerosumRingsGroup.appendChild(new yu),this.innerCircleGroup=this.backgroundGroup.appendChild(new xo({name:`${this.id}-innerCircle`})),this.seriesItemEnabled=[],this.surroundingRadius=void 0,this.NodeEvent=$g,this.angleScale=new Xu,this.angleScale.domain=[0,1],this.angleScale.range=[-Math.PI,Math.PI].map(e=>e+Math.PI/2);const t=new xo({name:"pieCalloutLabels"}),i=new xo({name:"pieSectorLabels"}),n=new xo({name:"innerLabels"});this.labelGroup.append(t),this.labelGroup.append(i),this.labelGroup.append(n),this.calloutLabelSelection=La.select(t,xo),this.sectorLabelSelection=La.select(i,Oo),this.innerLabelsSelection=La.select(n,Oo),this.innerCircleSelection=La.select(this.innerCircleGroup,yu)}addChartEventListeners(){var e;this.destroyFns.push(null==(e=this.ctx.chartEventManager)?void 0:e.addListener("legend-item-click",e=>this.onLegendItemClick(e)))}get visible(){return super.visible&&(0===this.seriesItemEnabled.length||this.seriesItemEnabled.some(e=>e))}nodeFactory(){return new wg}getSeriesDomain(e){return"x"===e?this.angleScale.domain:this.radiusScale.domain}processData(e){return w(this,null,function*(){var t,i,n,s,r;if(null==this.data||!this.properties.isValid())return;let{data:o}=this;const{visible:a,seriesItemEnabled:l}=this,{angleKey:c,radiusKey:h,calloutLabelKey:u,sectorLabelKey:d,legendItemKey:p}=this.properties,g=!this.ctx.animationManager.isSkipped(),y=[],v=[];p?y.push(Uh(p,"band",{id:"legendItemKey"})):u?y.push(Uh(u,"band",{id:"calloutLabelKey"})):d&&y.push(Uh(d,"band",{id:"sectorLabelKey"}));const b=this.radiusScale.type,C=this.radiusScale.type;h&&v.push(Wh(h,{id:"radiusValue",min:null!=(t=this.properties.radiusMin)?t:0,max:this.properties.radiusMax}),zh(h,b,{id:"radiusRaw"}),Rh({id:"radiusValue"},[0,1],1,null!=(i=this.properties.radiusMin)?i:0,this.properties.radiusMax)),u&&v.push(zh(u,"band",{id:"calloutLabelValue"})),d&&v.push(zh(d,"band",{id:"sectorLabelValue"})),p&&v.push(zh(p,"band",{id:"legendItemValue"})),g&&this.processedData&&y.length>0&&v.push(Nh(this.processedData)),v.push(kh()),o=o.map((e,t)=>a&&l[t]?e:m(f({},e),{[c]:0})),yield this.requestDataModel(e,o,{props:[...y,jh(c,C,{id:"angleValue",onlyPositive:!0}),zh(c,C,{id:"angleRaw"}),Rh({id:"angleValue"},[0,1],0,0),...v]});for(const e of null!=(r=null==(s=null==(n=this.processedData)?void 0:n.defs)?void 0:s.values)?r:[]){const{id:t,missing:i,property:n}=e,s=qc(this,i);"angleRaw"!==t&&s>0&&L.warnOnce(`no value was found for the key '${String(n)}' on ${s} data element${s>1?"s":""}`)}this.animationState.transition("updateData")})}maybeRefreshNodeData(){return w(this,null,function*(){var e;if(!this.nodeDataRefresh)return;const{nodeData:t=[]}=null!=(e=yield this.createNodeData())?e:{};this.nodeData=t,this.nodeDataRefresh=!1})}getProcessedDataIndexes(e){return{angleIdx:e.resolveProcessedDataIndexById(this,"angleValue"),radiusIdx:this.properties.radiusKey?e.resolveProcessedDataIndexById(this,"radiusValue"):-1,calloutLabelIdx:this.properties.calloutLabelKey?e.resolveProcessedDataIndexById(this,"calloutLabelValue"):-1,sectorLabelIdx:this.properties.sectorLabelKey?e.resolveProcessedDataIndexById(this,"sectorLabelValue"):-1,legendItemIdx:this.properties.legendItemKey?e.resolveProcessedDataIndexById(this,"legendItemValue"):-1}}createNodeData(){return w(this,null,function*(){const{id:e,processedData:t,dataModel:i,angleScale:n}=this,{rotation:s}=this.properties;if(!t||!i||"ungrouped"!==t.type)return;const{angleIdx:r,radiusIdx:o,calloutLabelIdx:a,sectorLabelIdx:l,legendItemIdx:c}=this.getProcessedDataIndexes(i);let h=0,u=0;const d=t.data.map((e,t)=>{var i;const{datum:d,values:p}=e,g=p[r],m=n.convert(h)+Gs(s);h=g,u+=g;const y=n.convert(h)+Gs(s),v=Math.abs(y-m),b=m+v/2,C=p[r+1],w=o>=0&&null!=(i=p[o])?i:1,S=o>=0?p[o+1]:void 0,x=c>=0?p[c]:void 0,E=this.getLabels(d,b,v,!0,p[a],p[l],x),A=this.getSectorFormat(d,t,!1);return f({itemId:t,series:this,datum:d,index:t,angleValue:C,midAngle:b,midCos:Math.cos(b),midSin:Math.sin(b),startAngle:m,endAngle:y,sectorFormat:A,radiusValue:S,radius:w,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(w),0),legendItemValue:x},E)});this.zerosumOuterRing.visible=0===u;const{innerRadiusRatio:p=1}=this.properties;return this.zerosumInnerRing.visible=0===u&&1!==p&&p>0,{itemId:e,nodeData:d,labelData:d}})}getLabels(e,t,i,n,s,r,o){const{calloutLabel:a,sectorLabel:l,legendItemKey:c}=this.properties,h=!n||a.enabled?this.properties.calloutLabelKey:void 0,u=!n||l.enabled?this.properties.sectorLabelKey:void 0;if(!h&&!u&&!c)return{};const d={datum:e,angleKey:this.properties.angleKey,angleName:this.properties.angleName,radiusKey:this.properties.radiusKey,radiusName:this.properties.radiusName,calloutLabelKey:this.properties.calloutLabelKey,calloutLabelName:this.properties.calloutLabelName,sectorLabelKey:this.properties.sectorLabelKey,sectorLabelName:this.properties.sectorLabelName,legendItemKey:this.properties.legendItemKey},p={};return h&&i>Gs(a.minAngle)&&(p.calloutLabel=m(f({},this.getTextAlignment(t)),{text:this.getLabelText(a,m(f({},d),{value:s})),hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0})),u&&(p.sectorLabel={text:this.getLabelText(l,m(f({},d),{value:r}))}),null!=c&&null!=o&&(p.legendItem={key:c,text:o}),p}getTextAlignment(e){const t=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"hanging"},{textAlign:"right",textBaseline:"middle"}],i=Os(e)- -.75*Math.PI;return t[qn(Math.floor(i/(Math.PI/2)),t.length)]}getSectorFormat(e,t,i){var n,s,r,o,a;const{callbackCache:l,highlightManager:c}=this.ctx,{angleKey:h,radiusKey:u,fills:d,strokes:p,formatter:g,sectorSpacing:f,__BACKGROUND_COLOR_DO_NOT_USE:m}=this.properties,y=c.getActiveHighlight(),v=i&&(null==y?void 0:y.series)===this&&t===y.itemId;let b=p[t%p.length];null!=f&&(null!=b||(b=m));const{fill:C,fillOpacity:w,stroke:S,strokeWidth:x,strokeOpacity:E}=qe(v&&this.properties.highlightStyle.item,{fill:d.length>0?d[t%d.length]:void 0,fillOpacity:this.properties.fillOpacity,stroke:b,strokeWidth:this.getStrokeWidth(this.properties.strokeWidth),strokeOpacity:this.getOpacity()});let A;return g&&(A=l.call(g,{datum:e,angleKey:h,radiusKey:u,fill:C,stroke:S,fills:d,strokes:p,strokeWidth:x,highlighted:v,seriesId:this.id})),{fill:null!=(n=null==A?void 0:A.fill)?n:C,fillOpacity:null!=(s=null==A?void 0:A.fillOpacity)?s:w,stroke:null!=(r=null==A?void 0:A.stroke)?r:S,strokeWidth:null!=(o=null==A?void 0:A.strokeWidth)?o:x,strokeOpacity:null!=(a=null==A?void 0:A.strokeOpacity)?a:E}}getInnerRadius(){const{radius:e}=this,{innerRadiusRatio:t=1,innerRadiusOffset:i=0}=this.properties,n=e*t+i;return n===e||n<0?0:n}getOuterRadius(){return Math.max(this.radius*this.properties.outerRadiusRatio+this.properties.outerRadiusOffset,0)}updateRadiusScale(e){const t=[this.getInnerRadius(),this.getOuterRadius()];this.radiusScale.range=t,e&&(this.previousRadiusScale.range=t),this.nodeData=this.nodeData.map(e=>{var t=e,{radius:i}=t,n=y(t,["radius"]);return m(f({},n),{radius:i,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(i),0)})})}getTitleTranslationY(){var e,t;const i=Math.max(0,this.radiusScale.range[1]);return 0===i?NaN:-i-(2+(null!=(t=null==(e=this.properties.title)?void 0:e.spacing)?t:0))-Math.max(0,-i)}update(e){return w(this,arguments,function*({seriesRect:e}){const{title:t}=this.properties,i={seriesRectWidth:null==e?void 0:e.width,seriesRectHeight:null==e?void 0:e.height},n=null!=wt(this.nodeDataDependencies,i);if(n&&(this._nodeDataDependencies=i),yield this.maybeRefreshNodeData(),this.updateTitleNodes(),this.updateRadiusScale(n),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.backgroundGroup.translationX=this.centerX,this.backgroundGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),t){const e=this.getTitleTranslationY(),i=t.node.computeBBox();t.node.visible=t.enabled&&isFinite(e)&&!this.bboxIntersectsSurroundingSeries(i,0,e),t.node.translationY=isFinite(e)?e:0}for(const e of[this.zerosumInnerRing,this.zerosumOuterRing])e.fillOpacity=0,e.stroke=this.properties.calloutLabel.color,e.strokeWidth=1,e.strokeOpacity=1;this.updateNodeMidPoint(),yield this.updateSelections(),yield this.updateNodes(e)})}updateTitleNodes(){var e,t;const{oldTitle:i}=this,{title:n}=this.properties;i!==n&&(i&&(null==(e=this.labelGroup)||e.removeChild(i.node)),n&&(n.node.textBaseline="bottom",null==(t=this.labelGroup)||t.appendChild(n.node)),this.oldTitle=n)}updateNodeMidPoint(){this.nodeData.forEach(e=>{const t=e.innerRadius+(e.outerRadius-e.innerRadius)/2;e.midPoint={x:e.midCos*Math.max(0,t),y:e.midSin*Math.max(0,t)}})}updateSelections(){return w(this,null,function*(){yield this.updateGroupSelection(),this.updateInnerCircleSelection()})}updateGroupSelection(){return w(this,null,function*(){const{itemSelection:e,highlightSelection:t,calloutLabelSelection:i,sectorLabelSelection:n,innerLabelsSelection:s}=this,r=(e,t)=>{let i=this.nodeData;t&&(i=i.map(e=>m(f({},e),{sectorFormat:f({},e.sectorFormat)}))),e.update(i,void 0,e=>this.getDatumId(e)),this.ctx.animationManager.isSkipped()&&e.cleanup()};r(e,!1),r(t,!0),i.update(this.nodeData,e=>{const t=new Ga;t.tag=0,t.pointerEvents=1,e.appendChild(t);const i=new Oo;i.tag=1,i.pointerEvents=1,e.appendChild(i)}),n.update(this.nodeData,e=>{e.pointerEvents=1}),s.update(this.properties.innerLabels,e=>{e.pointerEvents=1})})}updateInnerCircleSelection(){const{innerCircle:e}=this.properties;let t=0;const i=this.getInnerRadius();if(i>0){const e=Math.min(i,this.getOuterRadius()),n=1;t=Math.ceil(2*e+n)}const n=e?[{radius:t}]:[];this.innerCircleSelection.update(n)}updateNodes(e){return w(this,null,function*(){const t=this.ctx.highlightManager.getActiveHighlight(),i=this.visible&&this.seriesItemEnabled.indexOf(!0)>=0;this.rootGroup.visible=i,this.backgroundGroup.visible=i,this.contentGroup.visible=i,this.highlightGroup.visible=i&&(null==t?void 0:t.series)===this,this.labelGroup&&(this.labelGroup.visible=i),this.contentGroup.opacity=this.getOpacity(),this.innerCircleSelection.each((e,{radius:t})=>{var i,n;e.setProperties({fill:null==(i=this.properties.innerCircle)?void 0:i.fill,opacity:null==(n=this.properties.innerCircle)?void 0:n.fillOpacity,size:t})});const n=(e,t,i,n)=>{const s=this.getSectorFormat(t.datum,t.itemId,n);t.sectorFormat.fill=s.fill,t.sectorFormat.stroke=s.stroke;const r=this.ctx.animationManager.isSkipped();r&&(e.startAngle=t.startAngle,e.endAngle=t.endAngle,e.innerRadius=t.innerRadius,e.outerRadius=t.outerRadius),(n||r)&&(e.fill=s.fill,e.stroke=s.stroke),e.strokeWidth=s.strokeWidth,e.fillOpacity=s.fillOpacity,e.strokeOpacity=this.properties.strokeOpacity,e.lineDash=this.properties.lineDash,e.lineDashOffset=this.properties.lineDashOffset,e.fillShadow=this.properties.shadow,e.cornerRadius=this.properties.cornerRadius,e.inset=null!=this.properties.sectorSpacing?(this.properties.sectorSpacing+(null!=s.stroke?s.strokeWidth:0))/2:0,e.lineJoin=null!=this.properties.sectorSpacing?"miter":"round"};this.itemSelection.each((e,t,i)=>n(e,t,0,!1)),this.highlightSelection.each((e,i,s)=>{const r=(null==t?void 0:t.series)===this&&e.datum.itemId===t.itemId;n(e,i,0,!0),e.visible=r}),this.updateCalloutLineNodes(),this.updateCalloutLabelNodes(e),this.updateSectorLabelNodes(),this.updateInnerLabelNodes(),this.updateZerosumRings(),this.animationState.transition("update")})}updateCalloutLineNodes(){var e;const{calloutLine:t}=this.properties,i=t.length,n=t.strokeWidth,s=null!=(e=t.colors)?e:this.properties.strokes,{offset:r}=this.properties.calloutLabel;this.calloutLabelSelection.selectByTag(0).forEach((e,t)=>{var o;const a=e.datum,{calloutLabel:l,outerRadius:c}=a;if((null==l?void 0:l.text)&&!l.hidden&&0!==c){e.visible=!0,e.strokeWidth=n,e.stroke=s[t%s.length],e.fill=void 0;const h=a.midCos*c,u=a.midSin*c;let d=a.midCos*(c+i),p=a.midSin*(c+i);if((null!=(o=l.collisionTextAlign)?o:0!==l.collisionOffsetY)&&null!=l.box){const e=l.box;let t=d,i=p;d<e.x?t=e.x:d>e.x+e.width&&(t=e.x+e.width),p<e.y?i=e.y:p>e.y+e.height&&(i=e.y+e.height);const n=t-d,s=i-p,o=Math.sqrt(Math.pow(n,2)+Math.pow(s,2)),a=o-r;a>0&&(d+=n*a/o,p+=s*a/o)}e.x1=h,e.y1=u,e.x2=d,e.y2=p}else e.visible=!1})}getLabelOverflow(e,t,i){const n=i.x-this.centerX,s=i.x+i.width-this.centerX,r=i.y-this.centerY,o=i.y+i.height-this.centerY;let a=1;t.x+1<n?a=(t.x+t.width-n)/t.width:t.x+t.width-1>s&&(a=(s-t.x)/t.width);const l=t.y+1<r||t.y+t.height-1>o;return{textLength:1===a?e.length:Math.floor(e.length*a)-1,hasVerticalOverflow:l,hasSurroundingSeriesOverflow:this.bboxIntersectsSurroundingSeries(t)}}bboxIntersectsSurroundingSeries(e,t=0,i=0){const{surroundingRadius:n}=this;if(null==n)return!1;const s=[{x:e.x+t,y:e.y+i},{x:e.x+e.width+t,y:e.y+i},{x:e.x+e.width+t,y:e.y+e.height+i},{x:e.x+t,y:e.y+e.height+i}],r=p(n,2);return s.some(e=>p(e.x,2)+p(e.y,2)>r)}computeCalloutLabelCollisionOffsets(){const{radiusScale:e}=this,{calloutLabel:t,calloutLine:i}=this.properties,{offset:n,minSpacing:s}=t,r=e.convert(0),o=this.nodeData,a=this.nodeData.filter(e=>{return!(!(t=e).calloutLabel||0===t.outerRadius);var t});if(a.forEach(e=>{const t=e.calloutLabel;null!=t&&(t.hidden=!1,t.collisionTextAlign=void 0,t.collisionOffsetY=0)}),a.length<=1)return;const l=a.filter(e=>e.midCos<0).sort((e,t)=>e.midSin-t.midSin),c=a.filter(e=>e.midCos>=0).sort((e,t)=>e.midSin-t.midSin),h=a.filter(e=>{var t;return e.midSin<0&&"center"===(null==(t=e.calloutLabel)?void 0:t.textAlign)}).sort((e,t)=>e.midCos-t.midCos),u=a.filter(e=>{var t;return e.midSin>=0&&"center"===(null==(t=e.calloutLabel)?void 0:t.textAlign)}).sort((e,t)=>e.midCos-t.midCos),d=new Oo,p=e=>{var t;const s=e.calloutLabel;if(null==s)return new es(0,0,0,0);const r=e.outerRadius+i.length+n,o=e.midCos*r,a=e.midSin*r+s.collisionOffsetY;return d.text=s.text,d.x=o,d.y=a,d.setFont(this.properties.calloutLabel),d.setAlign({textAlign:null!=(t=s.collisionTextAlign)?t:s.textAlign,textBaseline:s.textBaseline}),d.computeBBox()},g=(e,t,i)=>{const n=p(e).grow(s/2),r=p(t).grow(s/2);if(n.x<r.x+r.width&&n.x+n.width>r.x&&("to-top"===i?n.y<r.y+r.height:n.y+n.height>r.y)){const e="to-top"===i?n.y-r.y-r.height:n.y+n.height-r.y;t.calloutLabel.collisionOffsetY=e}},f=e=>{const t=e.slice().sort((e,t)=>Math.abs(e.midSin)-Math.abs(t.midSin))[0],i=e.indexOf(t);for(let t=i-1;t>=0;t--){const i=e[t+1],n=e[t];g(i,n,"to-top")}for(let t=i+1;t<e.length;t++){const i=e[t-1],n=e[t];g(i,n,"to-bottom")}},m=e=>{const t=a.some(e=>0!==e.calloutLabel.collisionOffsetY),i=e.map(e=>p(e)),n=i.map(e=>e.clone().grow(s/2));let l=!1;for(let t=0;t<n.length&&!l;t++){const i=n[t];for(let s=t+1;s<e.length;s++){const e=n[s];if(i.collidesBBox(e)){l=!0;break}}}const c=o.map(e=>{const{startAngle:t,endAngle:i,outerRadius:n}=e;return{startAngle:t,endAngle:i,innerRadius:r,outerRadius:n}}),h=i.some(e=>c.some(t=>gg(e,t)));(l||t||h)&&e.filter(e=>"center"===e.calloutLabel.textAlign).forEach(e=>{const t=e.calloutLabel;e.midCos<0?t.collisionTextAlign="right":e.midCos>0?t.collisionTextAlign="left":t.collisionTextAlign="center"})};f(l),f(c),m(h),m(u)}updateCalloutLabelNodes(e){const{radiusScale:t}=this,{calloutLabel:i,calloutLine:n}=this.properties,s=n.length,{offset:r,color:o}=i,a=new Oo;this.calloutLabelSelection.selectByTag(1).forEach(n=>{var l;const{datum:c}=n,h=c.calloutLabel,u=t.convert(c.radius),d=Math.max(0,u);if(!(null==h?void 0:h.text)||0===d||h.hidden)return void(n.visible=!1);const p=d+s+r,g=c.midCos*p,f=c.midSin*p+h.collisionOffsetY,m={textAlign:null!=(l=h.collisionTextAlign)?l:h.textAlign,textBaseline:h.textBaseline};a.text=h.text,a.x=g,a.y=f,a.setFont(this.properties.calloutLabel),a.setAlign(m);const y=a.computeBBox();let v=h.text,b=!0;if(i.avoidCollisions){const{textLength:t,hasVerticalOverflow:i}=this.getLabelOverflow(h.text,y,e);v=h.text.length===t?h.text:`${h.text.substring(0,t)}…`,b=!i}n.text=v,n.x=g,n.y=f,n.setFont(this.properties.calloutLabel),n.setAlign(m),n.fill=o,n.visible=b})}computeLabelsBBox(e,t){return w(this,null,function*(){const{calloutLabel:i,calloutLine:n}=this.properties,s=n.length,{offset:r,maxCollisionOffset:o,minSpacing:a}=i;if(!i.avoidCollisions)return null;yield this.maybeRefreshNodeData(),this.updateRadiusScale(!1),this.computeCalloutLabelCollisionOffsets();const l=[],c=new Oo;let h;const{title:u}=this.properties;if((null==u?void 0:u.text)&&u.enabled){const e=this.getTitleTranslationY();isFinite(e)&&(c.text=u.text,c.x=0,c.y=e,c.setFont(u),c.setAlign({textBaseline:"bottom",textAlign:"center"}),h=c.computeBBox(),l.push(h))}return this.nodeData.forEach(i=>{var n;const u=i.calloutLabel;if(!u||0===i.outerRadius)return null;const d=i.outerRadius+s+r,p=i.midCos*d,g=i.midSin*d+u.collisionOffsetY;c.text=u.text,c.x=p,c.y=g,c.setFont(this.properties.calloutLabel),c.setAlign({textAlign:null!=(n=u.collisionTextAlign)?n:u.textAlign,textBaseline:u.textBaseline});const f=c.computeBBox();if(u.box=f,Math.abs(u.collisionOffsetY)>o)u.hidden=!0;else{if(h){const e=t.y-this.centerY,i=new es(h.x-a,e,h.width+2*a,h.y+h.height+a-e);if(f.collidesBBox(i))return void(u.hidden=!0)}if(e.hideWhenNecessary){const{textLength:e,hasVerticalOverflow:i,hasSurroundingSeriesOverflow:n}=this.getLabelOverflow(u.text,f,t),s=u.text.length>2&&e<2;if(i||s||n)return void(u.hidden=!0)}u.hidden=!1,l.push(f)}}),0===l.length?null:es.merge(l)})}updateSectorLabelNodes(){const{radiusScale:e}=this,t=e.convert(0),{fontSize:i,fontStyle:n,fontWeight:s,fontFamily:r,positionOffset:o,positionRatio:a,color:l}=this.properties.sectorLabel,c=t>0,h=1===this.seriesItemEnabled.filter(Boolean).length;this.sectorLabelSelection.each((e,u)=>{const{sectorLabel:d,outerRadius:p}=u;let g=!1;if(d&&0!==p){const f=t*(1-a)+p*a+o;e.fill=l,e.fontStyle=n,e.fontWeight=s,e.fontSize=i,e.fontFamily=r,e.text=d.text,!c&&h?(e.x=0,e.y=0):(e.x=u.midCos*f,e.y=u.midSin*f),e.textAlign="center",e.textBaseline="middle";const m=e.computeBBox(),y=[[m.x,m.y],[m.x+m.width,m.y],[m.x+m.width,m.y+m.height],[m.x,m.y+m.height]],{startAngle:v,endAngle:b}=u,C={startAngle:v,endAngle:b,innerRadius:t,outerRadius:p};y.every(([e,t])=>dg(e,t,C))&&(g=!0)}e.visible=g})}updateInnerLabelNodes(){const e=[],t=[];this.innerLabelsSelection.each((i,n)=>{const{fontStyle:s,fontWeight:r,fontSize:o,fontFamily:a,color:l,margin:c=2}=n;i.fontStyle=s,i.fontWeight=r,i.fontSize=o,i.fontFamily=a,i.text=n.text,i.x=0,i.y=0,i.fill=l,i.textAlign="center",i.textBaseline="alphabetic",e.push(i.computeBBox()),t.push(c)});const i=e=>0===e?0:t[e],n=e=>e===t.length-1?0:t[e],s=e.reduce((e,t,s)=>e+t.height+i(s)+n(s),0),r=Math.max(...e.map(e=>e.width)),o=this.getInnerRadius(),a=Math.sqrt(Math.pow(r/2,2)+Math.pow(s/2,2))<=(o>0?o:this.getOuterRadius()),l=[];for(let t=0,r=-s/2;t<e.length;t++){const s=e[t].height+r+i(t);l.push(s),r=s+n(t)}this.innerLabelsSelection.each((e,t,i)=>{e.y=l[i],e.visible=a})}updateZerosumRings(){this.zerosumOuterRing.size=2*this.getOuterRadius(),this.zerosumInnerRing.size=2*this.getInnerRadius()}getDatumLegendName(e){const{angleKey:t,calloutLabelKey:i,sectorLabelKey:n,legendItemKey:s}=this.properties,{sectorLabel:r,calloutLabel:o,legendItem:a}=e;return s&&void 0!==a?a.text:i&&i!==t&&void 0!==(null==o?void 0:o.text)?o.text:n&&n!==t&&void 0!==(null==r?void 0:r.text)?r.text:void 0}pickNodeClosestDatum(e){return kg(this,e)}getTooltipHtml(e){var t;if(!this.properties.isValid())return tl;const{datum:i,angleValue:n,sectorFormat:{fill:s},itemId:r}=e,o=Ld(null==(t=this.properties.title)?void 0:t.text),a=ze(n)?Yn(n):String(n),l=this.getDatumLegendName(e);return this.properties.tooltip.toTooltipHtml({title:null!=o?o:l,content:o&&l?`${l}: ${a}`:a,backgroundColor:s},{datum:i,itemId:r,title:o,color:s,seriesId:this.id,angleKey:this.properties.angleKey,angleName:this.properties.angleName,radiusKey:this.properties.radiusKey,radiusName:this.properties.radiusName,calloutLabelKey:this.properties.calloutLabelKey,calloutLabelName:this.properties.calloutLabelName,sectorLabelKey:this.properties.sectorLabelKey,sectorLabelName:this.properties.sectorLabelName,legendItemKey:this.properties.legendItemKey})}getLegendData(e){var t,i,n,s,r;const{visible:o,processedData:a,dataModel:l}=this;if(!l||!(null==a?void 0:a.data.length)||"category"!==e)return[];const{angleKey:c,calloutLabelKey:h,sectorLabelKey:u,legendItemKey:d}=this.properties;if(!(d||h&&h!==c||u&&u!==c))return[];const{calloutLabelIdx:p,sectorLabelIdx:g,legendItemIdx:f}=this.getProcessedDataIndexes(l),m=(null==(t=this.properties.title)?void 0:t.showInLegend)&&this.properties.title.text,y=[];for(let e=0;e<a.data.length;e++){const{datum:t,values:l}=a.data[e],v=[];m&&v.push(m);const b=this.getLabels(t,2*Math.PI,2*Math.PI,!1,l[p],l[g],l[f]);if(d&&void 0!==b.legendItem?v.push(b.legendItem.text):h&&h!==c&&void 0!==(null==(i=b.calloutLabel)?void 0:i.text)?v.push(null==(n=b.calloutLabel)?void 0:n.text):u&&u!==c&&void 0!==(null==(s=b.sectorLabel)?void 0:s.text)&&v.push(null==(r=b.sectorLabel)?void 0:r.text),0===v.length)continue;const C=this.getSectorFormat(t,e,!1);y.push({legendType:"category",id:this.id,itemId:e,seriesId:this.id,enabled:o&&this.seriesItemEnabled[e],label:{text:v.join(" - ")},marker:{fill:C.fill,stroke:C.stroke,fillOpacity:this.properties.fillOpacity,strokeOpacity:this.properties.strokeOpacity,strokeWidth:this.properties.strokeWidth},legendItemName:null!=d?t[d]:void 0})}return y}onLegendItemClick(e){const{enabled:t,itemId:i,series:n,legendItemName:s}=e;n.id===this.id?this.toggleSeriesItem(i,t):null!=s&&this.toggleOtherSeriesItems(s,t)}toggleSeriesItem(e,t){this.seriesItemEnabled[e]=t,this.nodeDataRefresh=!0}toggleOtherSeriesItems(e,t){var i;if(!this.properties.legendItemKey||!this.dataModel)return;const n=this.dataModel.resolveProcessedDataIndexById(this,"legendItemValue");null==(i=this.processedData)||i.data.forEach(({values:i},s)=>{i[n]===e&&this.toggleSeriesItem(s,t)})}animateEmptyUpdateReady(e){const{animationManager:t}=this.ctx,i=Ig(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);Rs(this.id,"nodes",t,[this.itemSelection,this.highlightSelection],i.nodes),Rs(this.id,"innerCircle",t,[this.innerCircleSelection],i.innerCircle),Nd(this,"callout",t,this.calloutLabelSelection),Nd(this,"sector",t,this.sectorLabelSelection),Nd(this,"inner",t,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){var e,t,i,n,s,r;const{itemSelection:o,highlightSelection:a,processedData:l,radiusScale:c,previousRadiusScale:h}=this,{animationManager:u}=this.ctx,d=null==(e=null==l?void 0:l.reduced)?void 0:e.diff;this.ctx.animationManager.stopByAnimationGroupId(this.id);const p=0===(null!=(t=null==d?void 0:d.moved.size)?t:0),g=(null!=(i=null==l?void 0:l.defs.keys.length)?i:0)>0,f=null==(r=null==(s=null==(n=null==l?void 0:l.reduced)?void 0:n.animationValidation)?void 0:s.uniqueKeys)||r;p&&g&&f||this.ctx.animationManager.skipCurrentBatch();const m=Ig(!1,this.properties.rotation,c,h);Rs(this.id,"nodes",u,[o,a],m.nodes,(e,t)=>this.getDatumId(t),d),Rs(this.id,"innerCircle",u,[this.innerCircleSelection],m.innerCircle),Nd(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Nd(this,"sector",this.ctx.animationManager,this.sectorLabelSelection),Nd(this,"inner",this.ctx.animationManager,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}animateClearingUpdateEmpty(){const{itemSelection:e,highlightSelection:t,radiusScale:i,previousRadiusScale:n}=this,{animationManager:s}=this.ctx,r=Ig(!1,this.properties.rotation,i,n);Rs(this.id,"nodes",s,[e,t],r.nodes),Rs(this.id,"innerCircle",s,[this.innerCircleSelection],r.innerCircle),Od(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Od(this,"sector",this.ctx.animationManager,this.sectorLabelSelection),Od(this,"inner",this.ctx.animationManager,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}getDatumIdFromData(e){var t,i,n;const{calloutLabelKey:s,sectorLabelKey:r,legendItemKey:o}=this.properties;if(null==(n=null==(i=null==(t=this.processedData)?void 0:t.reduced)?void 0:i.animationValidation)?void 0:n.uniqueKeys)return o?e[o]:s?e[s]:r?e[r]:void 0}getDatumId(e){const{index:t}=e,i=this.getDatumIdFromData(e.datum);return null!=i?String(i):`${t}`}onDataChange(){var e;const{data:t,seriesItemEnabled:i}=this;this.seriesItemEnabled=null!=(e=null==t?void 0:t.map((e,t)=>{var n;return null==(n=i[t])||n}))?e:[]}computeFocusBounds(e){return Pg(this,e)}};Kg.className="PieSeries",Kg.type="pie";var Yg={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["polar"],identifier:"pie",instanceConstructor:Kg,themeTemplate:Og,paletteFactory:Fg},qg=["start","center","end"],Xg=["annotations","ranges","zoom"],Zg=(e=>(e.Top="top",e.Right="right",e.Bottom="bottom",e.Left="left",e.FloatingTop="floating-top",e.FloatingBottom="floating-bottom",e))(Zg||{}),Qg=Object.values(Zg),Jg=class extends yt{constructor(e,t){super(),this.onChange=e,this.onButtonsChange=t,this.align="start",this.position="top"}};b([Xa(e=>{e.onChange(e.enabled)}),$s(Qs)],Jg.prototype,"enabled",2),b([Xa(e=>{e.onChange(e.enabled)}),$s(Or(["start","center","end"]),{optional:!0})],Jg.prototype,"align",2),b([Xa(e=>{e.onChange(e.enabled)}),$s(Or(["top","right","bottom","left","floating-top","floating-bottom"]),{optional:!0})],Jg.prototype,"position",2),b([Xa(e=>{e.onButtonsChange(e.buttons)}),$s(ar,{optional:!0})],Jg.prototype,"buttons",2);var ef="ag-charts-toolbar",tf={align:`${ef}__align`,button:`${ef}__button`,icon:`${ef}__icon`,label:`${ef}__label`},nf={top:`${ef}--top`,right:`${ef}--right`,bottom:`${ef}--bottom`,left:`${ef}--left`,"floating-top":`${ef}--floating-top`,"floating-bottom":`${ef}--floating-bottom`,hidden:`${ef}--hidden`,preventFlash:`${ef}--prevent-flash`,floatingHidden:`${ef}--floating-hidden`,align:{start:`${tf.align}--start`,center:`${tf.align}--center`,end:`${tf.align}--end`},button:{hidden:`${tf.button}--hidden`}},sf=`\n.${ef} {\n    align-items: center;\n    background: var(--ag-charts-toolbar-background-color);\n    border-bottom: var(--ag-charts-toolbar-border-critical);\n    border-top: var(--ag-charts-toolbar-border-critical);\n    border-left: var(--ag-charts-toolbar-border);\n    border-right: var(--ag-charts-toolbar-border);\n    display: flex;\n    flex-wrap: nowrap;\n    opacity: 1;\n    position: absolute;\n    transform: translateY(0);\n    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;\n}\n\n.${nf.hidden},\n.${nf.preventFlash} {\n    visibility: hidden;\n}\n\n.${nf.floatingHidden} {\n    opacity: 0;\n    transition: opacity 0.4s ease-in-out;\n}\n\n.${nf.top},\n.${nf.bottom} {\n    flex-direction: row;\n    height: var(--ag-charts-toolbar-size);\n    padding: 0 var(--ag-charts-toolbar-padding);\n    width: 100%;\n}\n\n.${nf.left},\n.${nf.right} {\n    flex-direction: column;\n    padding: var(--ag-charts-toolbar-padding) 0;\n    width: var(--ag-charts-toolbar-size);\n}\n\n.${nf["floating-top"]},\n.${nf["floating-bottom"]} {\n    background: none;\n    border: none;\n    flex-direction: row;\n    height: var(--ag-charts-toolbar-size);\n    overflow: hidden;\n    padding: 0 var(--ag-charts-toolbar-padding);\n    pointer-events: none;\n    width: 100%;\n}\n\n.${tf.align} {\n    display: flex;\n    flex-direction: inherit;\n    flex-wrap: inherit;\n    max-width: 100%;\n}\n\n.${nf.align.center},\n.${nf.align.end} {\n    margin-left: auto;\n}\n\n.${nf.left} .${nf.align.center},\n.${nf.left} .${nf.align.end},\n.${nf.right} .${nf.align.center},\n.${nf.right} .${nf.align.end} {\n    margin-left: 0;\n    margin-top: auto;\n}\n\n.${nf["floating-top"]} .${tf.align},\n.${nf["floating-bottom"]} .${tf.align} {\n    gap: var(--ag-charts-toolbar-gap);\n    transition: transform 0.4s ease-in-out;\n}\n\n.${tf.button} {\n    align-items: center;\n    border-radius: var(--ag-charts-button-radius);\n    color: var(--ag-charts-toolbar-foreground-color);\n    display: flex;\n    font-size: 14px;\n    font-weight: 500;\n    justify-content: center;\n    margin: 0;\n    padding: var(--ag-charts-button-padding);\n    pointer-events: all;\n    transition: background-color .25s ease-in-out;\n}\n\n.${nf.left} .${tf.button},\n.${nf.right} .${tf.button} {\n    height: var(--ag-charts-toolbar-size);\n    max-width: 100%;\n    overflow: hidden;\n}\n\n.${nf["floating-top"]} .${tf.button},\n.${nf["floating-bottom"]} .${tf.button} {\n    background: var(--ag-charts-toolbar-background-color);\n    border: var(--ag-charts-toolbar-border-critical);\n}\n\n.${nf.button.hidden} {\n    display: none;\n}\n\n.${tf.button}:hover {\n    background: var(--ag-charts-toolbar-hover-color);\n}\n\n.${tf.button}:disabled {\n    background: var(--ag-charts-toolbar-disabled-background-color);\n    color: var(--ag-charts-toolbar-disabled-foreground-color);\n}\n\n.${tf.button}:not([disabled]) {\n    cursor: pointer;\n}\n\n.${tf.icon} {\n    height: 1.2em;\n    width: 1.2em;\n}\n\n.${tf.icon} + .${tf.label} {\n    margin-left: var(--ag-charts-size);\n}\n\n.${tf.icon},\n.${tf.label} {\n    pointer-events: none;\n}\n\n`,rf=class extends we{constructor(e){super(),this.ctx=e,this.enabled=!0,this.annotations=new Jg(this.onGroupChanged.bind(this,"annotations"),this.onGroupButtonsChanged.bind(this,"annotations")),this.ranges=new Jg(this.onGroupChanged.bind(this,"ranges"),this.onGroupButtonsChanged.bind(this,"ranges")),this.zoom=new Jg(this.onGroupChanged.bind(this,"zoom"),this.onGroupButtonsChanged.bind(this,"zoom")),this.margin=10,this.floatingDetectionRange=28,this.positions={top:new Set,right:new Set,bottom:new Set,left:new Set,"floating-top":new Set,"floating-bottom":new Set},this.positionAlignments={top:{},right:{},bottom:{},left:{},"floating-top":{},"floating-bottom":{}},this.groupCallers={annotations:0,ranges:0,zoom:0},this.groupButtons={annotations:[],ranges:[],zoom:[]},this.pendingButtonToggledEvents=[],this.groupProxied=new Set,this.container=e.toolbarManager.element,this.elements={top:this.container.appendChild(xn("div")),right:this.container.appendChild(xn("div")),bottom:this.container.appendChild(xn("div")),left:this.container.appendChild(xn("div")),"floating-top":this.container.appendChild(xn("div")),"floating-bottom":this.container.appendChild(xn("div"))},An(sf,ef),this.renderToolbar("top"),this.renderToolbar("right"),this.renderToolbar("bottom"),this.renderToolbar("left"),this.renderToolbar("floating-top"),this.renderToolbar("floating-bottom"),this.toggleVisibilities(),this.destroyFns.push(e.interactionManager.addListener("hover",this.onHover.bind(this),31),e.interactionManager.addListener("leave",this.onLeave.bind(this),31),e.toolbarManager.addListener("button-toggled",this.onButtonToggled.bind(this)),e.toolbarManager.addListener("group-toggled",this.onGroupToggled.bind(this)),e.toolbarManager.addListener("proxy-group-options",this.onProxyGroupOptions.bind(this)),e.layoutService.addListener("layout-complete",this.onLayoutComplete.bind(this)),()=>this.destroyElements())}destroyElements(){for(const e of Object.values(this.elements))e.remove()}onHover(e){const{enabled:t,elements:i,floatingDetectionRange:n,ctx:{scene:s}}=this,{offsetY:r,sourceEvent:{target:o}}=e,{FloatingBottom:a,FloatingTop:l}=Zg;if(!t)return;const c=i[a],h=i[l],u=r>c.offsetTop-n&&r<s.canvas.element.offsetHeight||o===c,d=h.offsetTop+h.offsetHeight+n,p=r>0&&r<d||o===h;c.classList.toggle(nf.floatingHidden,!u),h.classList.toggle(nf.floatingHidden,!p),this.translateFloatingElements(a,u),this.translateFloatingElements(l,p)}onLeave(e){const{enabled:t,elements:i,ctx:{scene:n}}=this,{relatedTarget:s,target:r}=e.sourceEvent,{FloatingBottom:o,FloatingTop:a}=Zg;t&&r===n.canvas.element&&(Xg.some(e=>this.groupButtons[e].some(e=>e===s))||(i[o].classList.add(nf.floatingHidden),i[a].classList.add(nf.floatingHidden),this.translateFloatingElements(o,!1),this.translateFloatingElements(a,!1)))}onGroupChanged(e){null==this[e]||this.groupProxied.has(e)||(this.createGroup(e),this.toggleVisibilities())}onGroupButtonsChanged(e,t){this.enabled&&!this.groupProxied.has(e)&&(this.createGroupButtons(e,t),this.toggleVisibilities())}onLayoutComplete(){for(const e of Qg)this.elements[e].classList.remove(nf.preventFlash)}onButtonToggled(e){const{group:t,value:i,enabled:n}=e;if(0!==this.groupButtons[t].length)for(const e of this.groupButtons[t])e.dataset.toolbarValue===`${i}`&&(e.disabled=!n);else this.pendingButtonToggledEvents.push(e)}onGroupToggled(e){const{group:t,visible:i}=e;this.toggleGroup(t,i),this.toggleVisibilities()}onProxyGroupOptions(e){const{group:t,options:i}=e;this.groupProxied.add(t),this.createGroup(t,i.enabled,i.position),this.createGroupButtons(t,i.buttons),this.toggleGroup(t,i.enabled),this[t].set(i)}createGroup(e,t,i){null!=t||(t=this[e].enabled),null!=i||(i=this[e].position);for(const n of Qg)t&&i===n?this.positions[n].add(e):this.positions[n].delete(e)}createGroupButtons(e,t){var i,n;for(const t of this.groupButtons[e])t.remove();this.groupButtons[e]=[];const s=null!=(i=this[e].align)?i:"start",r=null!=(n=this[e].position)?n:"top",o=this.positionAlignments[r][s];for(const i of null!=t?t:[]){const t=this.createButtonElement(e,i);null==o||o.appendChild(t),this.groupButtons[e].push(t)}}toggleGroup(e,t){t?this.groupCallers[e]+=1:this.groupCallers[e]=Math.max(0,this.groupCallers[e]-1)}processPendingEvents(){var e;const t=(null!=(e=this.pendingButtonToggledEvents)?e:[]).slice();for(const e of t)this.onButtonToggled(e);this.pendingButtonToggledEvents=[]}performLayout(e){return w(this,arguments,function*({shrinkRect:e}){const{elements:t,margin:i}=this;return t.top.classList.contains(nf.hidden)||e.shrink(t.top.offsetHeight+2*i,"top"),t.right.classList.contains(nf.hidden)||e.shrink(t.right.offsetWidth+i,"right"),t.bottom.classList.contains(nf.hidden)||e.shrink(t.bottom.offsetHeight+2*i,"bottom"),t.left.classList.contains(nf.hidden)||e.shrink(t.left.offsetWidth+i,"left"),{shrinkRect:e}})}performCartesianLayout(e){return w(this,null,function*(){const{elements:t,margin:i}=this,{seriesRect:n}=e,{FloatingBottom:s,FloatingTop:r}=Zg;t.top.style.top=n.y-t.top.offsetHeight-2*i+"px",t.top.style.left=`${i}px`,t.top.style.width=`calc(100% - ${2*i}px)`,t.right.style.top=`${n.y+i}px`,t.right.style.right=`${i}px`,t.right.style.height=`calc(100% - ${n.y+2*i}px)`,t.bottom.style.bottom=`${i}px`,t.bottom.style.left=`${i}px`,t.bottom.style.width=`calc(100% - ${2*i}px)`,t.left.style.top=`${n.y}px`,t.left.style.left=`${i}px`,t.left.style.height=`calc(100% - ${n.y+2*i}px)`,t[r].style.top=`${n.y}px`,t[r].style.paddingTop=`${i}px`,t[s].style.top=n.y+n.height-t[s].offsetHeight+"px",t[s].style.paddingBottom=`${i}px`})}toggleVisibilities(){var e;if(null==this.elements)return;const t=e=>this[e].enabled&&this.groupCallers[e]>0,i=e=>t=>"string"!=typeof t.value&&"number"!=typeof t.value||`${t.value}`===e.dataset.toolbarValue;for(const e of Qg){const i=this.enabled&&Array.from(this.positions[e].values()).some(t);this.elements[e].classList.toggle(nf.hidden,!i)}for(const n of Xg){if(null==this[n])continue;const s=t(n);for(const t of this.groupButtons[n]){const r=s&&(null==(e=this[n].buttons)?void 0:e.some(i(t)));t.classList.toggle(nf.button.hidden,!r)}}}translateFloatingElements(e,t){const{elements:i,margin:n,positionAlignments:s}=this,r=i[e],o=Object.values(s[e]);for(const e of o)e.style.transform=t&&""!==e.style.transform?"translateY(0)":`translateY(${r.offsetHeight+n}px)`}renderToolbar(e="top"){const t=this.elements[e];t.classList.add(ef,nf[e],nf.preventFlash),"floating-top"!==e&&"floating-bottom"!==e||t.classList.add(nf.floatingHidden);for(const i of qg){const n=xn("div");n.classList.add(tf.align,nf.align[i]),t.appendChild(n),this.positionAlignments[e][i]=n}}createButtonElement(e,t){const i=xn("button");i.classList.add(tf.button),i.dataset.toolbarGroup=e,i.tabIndex=-1,"string"!=typeof t.value&&"number"!=typeof t.value||(i.dataset.toolbarValue=`${t.value}`),t.tooltip&&(i.title=t.tooltip);let n="";return null!=t.icon&&(n=`<span class="ag-charts-icon-${t.icon} ${tf.icon}"></span>`),null!=t.label&&(n=`${n}<span class="${tf.label}">${t.label}</span>`),i.innerHTML=n,i.onclick=this.onButtonPress.bind(this,e,t.value),this.destroyFns.push(()=>i.remove()),i}onButtonPress(e,t){this.ctx.toolbarManager.pressButton(e,t)}};b([Xa(e=>{e.processPendingEvents(),e.toggleVisibilities()}),$s(Qs)],rf.prototype,"enabled",2);var of=864e5,af=30*of,lf={type:"root",optionsKey:"toolbar",packageType:"community",chartTypes:["cartesian"],instanceConstructor:rf,themeTemplate:{toolbar:{enabled:!0,annotations:{enabled:!1,position:"left",align:"start",buttons:[{label:"Li",value:"line"},{label:"PCh",value:"parallel-channel"}]},ranges:{enabled:!1,position:"top",align:"start",buttons:[{label:"1m",value:af},{label:"3m",value:3*af},{label:"6m",value:6*af},{label:"YTD",value:(e,t)=>[new Date(`${new Date(t).getFullYear()}-01-01`).getTime(),t]},{label:"1y",value:365*of},{label:"All",value:(e,t)=>[e,t]}]},zoom:{enabled:!1,position:"top",align:"end",buttons:[{icon:"zoom-out",tooltip:"Zoom out",value:"zoom-out"},{icon:"zoom-in",tooltip:"Zoom in",value:"zoom-in"},{icon:"pan-left",tooltip:"Pan left",value:"pan-left"},{icon:"pan-right",tooltip:"Pan right",value:"pan-right"},{icon:"pan-start",tooltip:"Pan to the start",value:"pan-start"},{icon:"pan-end",tooltip:"Pan to the end",value:"pan-end"},{icon:"reset",tooltip:"Reset the zoom",value:"reset"}]}}}};var cf=class e extends su{constructor(e,t){super(e,t)}performLayout(){return w(this,null,function*(){const t=yield C(e.prototype,this,"performLayout").call(this),{seriesArea:{padding:i},seriesRoot:n,annotationRoot:s,highlightRoot:r}=this,o=t.clone();t.shrink(i.left,"left"),t.shrink(i.top,"top"),t.shrink(i.right,"right"),t.shrink(i.bottom,"bottom"),this.seriesRect=t,this.animationRect=t,this.hoverRect=t;for(const e of[n,s,r])e.translationX=Math.floor(t.x),e.translationY=Math.floor(t.y);return yield Promise.all(this.series.map(e=>w(this,null,function*(){yield e.update({seriesRect:t})}))),n.visible=this.series[0].visible,n.setClipRectInGroupCoordinateSpace(new es(t.x,t.y,t.width,t.height)),this.ctx.layoutService.dispatchLayoutComplete({type:"layout-complete",chart:{width:this.ctx.scene.width,height:this.ctx.scene.height},clipSeries:!1,series:{rect:o,paddedRect:t,visible:!0},axes:[]}),t})}};cf.className="HierarchyChart",cf.type="hierarchy";var hf=cf,uf=class extends Sl{constructor(){super(...arguments),this.shape="polygon",this.innerRadiusRatio=0,this.defaultTickMinSpacing=20}computeLabelsBBox(e,t){return null}};b([$s(Or(["polygon","circle"],"a polar axis shape"))],uf.prototype,"shape",2),b([$s(sr)],uf.prototype,"innerRadiusRatio",2);var df=class e extends su{constructor(e,t){super(e,t),this.padding=new Zl(40),this.axisGroup.zIndex=6}performLayout(){return w(this,null,function*(){const t=yield C(e.prototype,this,"performLayout").call(this),i=t.clone();return this.computeSeriesRect(t),yield this.computeCircle(t),this.axes.forEach(e=>e.update()),this.hoverRect=t,this.ctx.layoutService.dispatchLayoutComplete({type:"layout-complete",chart:{width:this.ctx.scene.width,height:this.ctx.scene.height},clipSeries:!1,series:{rect:i,paddedRect:t,visible:!0},axes:[]}),t})}updateAxes(e,t,i){var n,s;const r=this.axes.find(e=>"x"===e.direction),o=this.axes.find(e=>"y"===e.direction);if(!(r instanceof uf&&o instanceof uf))return;const a=r.scale,l=null==(n=a.ticks)?void 0:n.call(a).map(e=>a.convert(e)),c=o.innerRadiusRatio;r.innerRadiusRatio=c,null==(s=r.computeRange)||s.call(r),r.gridLength=i,o.gridAngles=l,o.gridRange=r.range,o.range=[i,i*c],[r,o].forEach(i=>{i.translation.x=e,i.translation.y=t,i.calculateLayout()})}computeSeriesRect(e){const{seriesArea:{padding:t}}=this;e.shrink(t.left,"left"),e.shrink(t.top,"top"),e.shrink(t.right,"right"),e.shrink(t.bottom,"bottom"),this.seriesRect=e,this.animationRect=e}computeCircle(e){return w(this,null,function*(){const t=this.series.filter(e=>e instanceof _g),i=this.axes.filter(e=>e instanceof uf),n=(e,i,n)=>{this.updateAxes(e,i,n),t.forEach(t=>{t.centerX=e,t.centerY=i,t.radius=n});const s=t.filter(e=>e instanceof Kg||e instanceof Ng);if(s.length>1){const e=s.map(e=>{const t=e.getInnerRadius();return{series:e,innerRadius:t}}).sort((e,t)=>e.innerRadius-t.innerRadius);e.at(-1).series.surroundingRadius=void 0;for(let t=0;t<e.length-1;t++)e[t].series.surroundingRadius=e[t+1].innerRadius}},s=e.x+e.width/2,r=e.y+e.height/2,o=Math.max(0,Math.min(e.width,e.height)/2);let a=o;n(s,r,a);const l=(...l)=>w(this,[...l],function*({hideWhenNecessary:l=!1}={}){const c=[];for(const n of[...i,...t]){const t=yield n.computeLabelsBBox({hideWhenNecessary:l},e);t&&c.push(t)}if(0===c.length)return void n(s,r,o);const h=es.merge(c),u=this.refineCircle(h,a,e);n(u.centerX,u.centerY,u.radius),u.radius!==a&&(a=u.radius)});return yield l(),yield l(),yield l(),yield l({hideWhenNecessary:!0}),yield l({hideWhenNecessary:!0}),{radius:a,centerX:s,centerY:r}})}refineCircle(e,t,i){const n=-t,s=-t,r=t,o=t;let a=Math.max(0,n-e.x),l=Math.max(0,s-e.y),c=Math.max(0,e.x+e.width-r),h=Math.max(0,e.y+e.height-o);a=c=Math.max(a,c),l=h=Math.max(l,h);const u=i.width-a-c,d=i.height-l-h;let p=Math.min(u,d)/2;const g=.5*i.width/2,f=.5*i.height/2,m=Math.min(g,f);if(p<m){p=m;const e=a+c;if(2*p+(l+h)>i.height){const e=i.height-2*p;2*Math.min(l,h)>e?(l=e/2,h=e/2):l>h?l=e-h:h=e-l}if(2*p+e>i.width){const e=i.width-2*p;2*Math.min(a,c)>e?(a=e/2,c=e/2):a>c?a=e-c:c=e-a}}const y=a+2*p+c,v=l+2*p+h;return{centerX:i.x+(i.width-y)/2+a+p,centerY:i.y+(i.height-v)/2+l+p,radius:p}}};df.className="PolarChart",df.type="polar";var pf=df,gf=Math.PI/180,ff=e=>e*gf,mf=e=>-Math.log(Math.tan(.25*Math.PI+e*gf*.5)),yf=e=>e/gf,vf=e=>(Math.atan(Math.exp(-e))-.25*Math.PI)/(.5*gf),bf=class e{constructor(t,i){this.domain=t,this.range=i,this.type="mercator",this.bounds=e.bounds(t)}static bounds(e){const[[t,i],[n,s]]=e,r=ff(t),o=mf(i),a=ff(n),l=mf(s);return new es(Math.min(r,a),Math.min(o,l),Math.abs(a-r),Math.abs(l-o))}static fixedScale(){return new e([[yf(0),vf(0)],[yf(1),vf(1)]],[[0,0],[1,1]])}convert([e,t]){const[[i,n],[s,r]]=this.range,o=(s-i)/this.bounds.width,a=(r-n)/this.bounds.height;return[(ff(e)-this.bounds.x)*o+i,(mf(t)-this.bounds.y)*a+n]}invert([e,t]){const[[i,n],[s,r]]=this.range,o=(s-i)/this.bounds.width,a=(r-n)/this.bounds.height;return[yf((e-i)/o+this.bounds.x),vf((t-n)/a+this.bounds.y)]}};function Cf(e){return"map-shape"===e.type||"map-line"===e.type||"map-marker"===e.type||"map-shape-background"===e.type||"map-line-background"===e.type}var wf=class e extends su{constructor(e,t){super(e,t),this.xAxis=new Qu(this.getModuleContext()),this.xAxis.position="bottom",this.yAxis=new Qu(this.getModuleContext()),this.yAxis.position="left",this.ctx.zoomManager.updateAxes([this.xAxis,this.yAxis])}updateData(){return w(this,null,function*(){yield C(e.prototype,this,"updateData").call(this);const{topology:t}=this.getOptions();this.series.forEach(e=>{Cf(e)&&e.setChartTopology(t)})})}performLayout(){return w(this,null,function*(){const t=yield C(e.prototype,this,"performLayout").call(this),{seriesArea:{padding:i},seriesRoot:n,annotationRoot:s,highlightRoot:r}=this,o=t.clone();t.shrink(i.left,"left"),t.shrink(i.top,"top"),t.shrink(i.right,"right"),t.shrink(i.bottom,"bottom"),this.seriesRect=t,this.animationRect=t,this.hoverRect=t;const a=this.series.filter(Cf),l=a.reduce((e,t)=>{if(!t.visible)return e;const i=t.topologyBounds;return null==i?e:null==e?i:(e.merge(i),e)},void 0);let c;if(null!=l){const{lon0:e,lat0:i,lon1:n,lat1:s}=l,r=[[e,i],[n,s]],o=bf.bounds(r),{width:a,height:h}=t,u=Math.min(a/o.width,h/o.height),d=o.width*u,p=o.height*u,g=(a-d)/2,f=(h-p)/2,m=g,y=f,v=g+d,b=f+p,C=this.ctx.zoomManager.getAxisZoom(this.xAxis.id),w=this.ctx.zoomManager.getAxisZoom(this.yAxis.id),S=(v-m)/(C.max-C.min),x=m-S*C.min,E=(b-y)/(1-w.min-(1-w.max)),A=y-E*(1-w.max);c=new bf(r,[[x,A],[x+S,A+E]])}a.forEach(e=>{e.scale=c});const h=this.series.some(e=>e.visible);n.visible=h;for(const e of[n,s,r])e.translationX=Math.floor(t.x),e.translationY=Math.floor(t.y),e.setClipRectInGroupCoordinateSpace(new es(t.x,t.y,t.width,t.height));return this.ctx.layoutService.dispatchLayoutComplete({type:"layout-complete",chart:{width:this.ctx.scene.width,height:this.ctx.scene.height},clipSeries:!1,series:{rect:o,paddedRect:t,visible:h},axes:[]}),t})}};wf.className="TopologyChart",wf.type="topology";var Sf=wf,xf=In.create(!0,"opts");function Ef(e){if(dt(e))return"cartesian";if(pt(e))return"polar";if(gt(e))return"hierarchy";if(ft(e))return"topology";throw new Error(`AG Chart - unknown type of chart for options with type: ${e.type}`)}var Af=class e{static licenseCheck(e){var t,i,n,s;this.licenseChecked||(this.licenseManager=null==(i=(t=Ce).licenseManager)?void 0:i.call(t,e),null==(n=this.licenseManager)||n.setLicenseKey(this.licenseKey,this.gridContext),null==(s=this.licenseManager)||s.validateLicense(),this.licenseChecked=!0)}static setLicenseKey(e){this.licenseKey=e}static setGridContext(e){this.gridContext=e}static getLicenseDetails(e){var t,i;return null==(i=(t=Ce).licenseManager)?void 0:i.call(t,{}).getLicenseDetails(e)}static getInstance(e){return If.getInstance(e)}static create(e){var t,i,n;this.licenseCheck(e);const s=If.createOrUpdate(e);return(null==(t=this.licenseManager)?void 0:t.isDisplayWatermark())&&(null==(n=(i=Ce).injectWatermark)||n.call(i,s.chart.element,this.licenseManager.getWatermarkMessage())),s}static update(t,i){if(!qu.isInstance(t))throw new Error(e.INVALID_CHART_REF_MESSAGE);If.createOrUpdate(i,t)}static updateDelta(t,i){if(!qu.isInstance(t))throw new Error(e.INVALID_CHART_REF_MESSAGE);If.updateUserDelta(t,i)}static download(t,i){if(!(t instanceof qu))throw new Error(e.INVALID_CHART_REF_MESSAGE);If.download(t,i).catch(e=>L.errorOnce(e))}static getImageDataURL(t,i){if(!(t instanceof qu))throw new Error(e.INVALID_CHART_REF_MESSAGE);return If.getImageDataURL(t,i)}};Af.INVALID_CHART_REF_MESSAGE="AG Charts - invalid chart reference passed",Af.licenseChecked=!1,Af.gridContext=!1;var Mf=Af,Tf=class{static warnDeprecated(e){Pn()(`AgChart.${e}`,`Use AgCharts.${e} instead`)}static create(e){return this.warnDeprecated("create"),Mf.create(e)}static update(e,t){return this.warnDeprecated("update"),Mf.update(e,t)}static updateDelta(e,t){return this.warnDeprecated("updateDelta"),Mf.updateDelta(e,t)}static download(e,t){return this.warnDeprecated("download"),Mf.download(e,t)}static getImageDataURL(e,t){return this.warnDeprecated("getImageDataURL"),Mf.getImageDataURL(e,t)}},Df=class e{static getInstance(e){const t=su.getInstance(e);return t?qu.chartInstances.get(t):void 0}static initialiseModules(){e.initialised||(function(){Se.register(cd,Ed,Id,lf,Mp,$p,eg,og,hg,Gg,Yg,ng);for(const e of[Qu,Tl,id,Gl,ed])xe.register(e.type,{instanceConstructor:e,hidden:e===Gl})}(),function(){for(const e of Se.modules){if("enterprise"!==e.packageType||ht(e)||L.errorOnce("Unexpected enterprise module registered: "+e.identifier),"root"===e.type&&e.themeTemplate)for(const t of e.chartTypes)at.set(t,e.themeTemplate);if("series"===e.type){if(e.chartTypes.length>1)throw new Error(`AG Charts - Module definition error: ${e.identifier}`);Dt.register(e.identifier,e)}if("series-option"===e.type&&e.themeTemplate)for(const t of e.seriesTypes)Dt.setThemeTemplate(t,e.themeTemplate);if("axis-option"===e.type&&e.themeTemplate)for(const t of e.axisTypes){const i=e.themeTemplate[t],n=f(f({},e.themeTemplate),i);for(const t of e.axisTypes)delete n[t];xe.setThemeTemplate(t,n)}"axis"===e.type&&xe.register(e.identifier,e),"legend"===e.type&&It.register(e.identifier,e)}if(Se.hasEnterpriseModules()){const e=lt.filter(({useCount:e})=>null==e||0===e);e.length>0&&L.errorOnce("Enterprise modules expected but not registered: ",e)}}(),e.initialised=!0)}static createOrUpdate(t,i){e.initialiseModules(),xf(">>> AgChartV2.createOrUpdate() user options",t);const n=t,{overrideDevicePixelRatio:s,document:r,window:o}=n,a=y(n,["overrideDevicePixelRatio","document","window"]),l=new kn(a,{overrideDevicePixelRatio:s,document:r,window:o});let c=null==i?void 0:i.chart;return null!=c&&Ef(a)===Ef(c.processedOptions)||(c=e.createChartInstance(l,c)),null==i?i=new qu(c):i.chart=c,xf.check()&&"undefined"!=typeof window&&(null!=window.agChartInstances||(window.agChartInstances={}),window.agChartInstances[c.id]=c),c.queuedUserOptions.push(a),c.requestFactoryUpdate(e=>{e.applyOptions(l),e.queuedUserOptions.splice(0,e.queuedUserOptions.indexOf(a))}),i}static updateUserDelta(t,i){Et(i=St(i,{shallow:["data"]}),e=>{if("object"==typeof e)for(const[t,i]of Object.entries(e))void 0===i&&Object.assign(e,{[t]:Symbol("UNSET")})},{skip:["data"]});const{chart:n}=t,s=n.getOptions(),r=qe(i,s);xf(">>> AgChartV2.updateUserDelta() user delta",i),xf("AgChartV2.updateUserDelta() - base options",s),e.createOrUpdate(r,t)}static download(t,i){return w(this,null,function*(){try{const n=yield e.prepareResizedChart(t,i);n.chart.ctx.scene.download(null==i?void 0:i.fileName,null==i?void 0:i.fileFormat),n.destroy()}catch(e){L.errorOnce(e)}})}static getImageDataURL(t,i){return w(this,null,function*(){const n=yield e.prepareResizedChart(t,i),s=n.chart.ctx.scene.getDataURL(null==i?void 0:i.fileFormat);return n.destroy(),s})}static prepareResizedChart(t){return w(this,arguments,function*({chart:t},i={}){var n,s,r,o;const a=null!=(s=null!=(n=i.width)?n:t.width)?s:t.ctx.scene.canvas.width,l=null!=(o=null!=(r=i.height)?r:t.height)?o:t.ctx.scene.canvas.height,c=qe({container:document.createElement("div"),overrideDevicePixelRatio:1,autoSize:!1,width:a,height:l},Se.hasEnterpriseModules()&&{animation:{enabled:!1}},t.userOptions),h=e.createOrUpdate(c);return h.chart.ctx.zoomManager.updateZoom("agChartV2",t.ctx.zoomManager.getZoom()),t.series.forEach((e,t)=>{e.visible||(h.chart.series[t].visible=!1)}),t.update(0,{forceNodeDataRefresh:!0}),yield h.chart.waitForUpdate(),h})}static createChartInstance(t,i){const n=null==i?void 0:i.destroy({keepTransferableResources:!0});return new(e.getChartByOptions(t.processedOptions))(t,n)}static getChartByOptions(e){if(dt(e))return Ku;if(gt(e))return hf;if(pt(e))return pf;if(ft(e))return Sf;throw new Error("AG Charts - couldn't apply configuration, check options are correctly structured and series types are specified")}};Df.initialised=!1;var If=Df,Rf="9.3.2",kf={};v(kf,{Arc:()=>Pf,BBox:()=>es,BandScale:()=>Ws,Caption:()=>ol,ChangeDetectableProperties:()=>Gd,Circle:()=>yu,ContinuousScale:()=>qr,Diamond:()=>wu,DropShadow:()=>Bd,ExtendedPath2D:()=>cu,Group:()=>xo,HdpiCanvas:()=>Vl,Image:()=>Ff,Label:()=>Bo,Line:()=>Ga,LinearGradientFill:()=>_f,LinearScale:()=>Xu,Marker:()=>mu,Node:()=>cs,OrdinalTimeScale:()=>vo,Path:()=>uu,PointerEvents:()=>as,RadialColumnShape:()=>Nf,Rect:()=>ad,RedrawType:()=>ts,Scene:()=>Kl,SceneChangeDetection:()=>ns,ScenePathChangeDetection:()=>hu,Sector:()=>wg,SectorBox:()=>ug,Selection:()=>La,Shape:()=>Do,Square:()=>Mu,Text:()=>Oo,Tooltip:()=>rl,Triangle:()=>Iu,easing:()=>fs,getFont:()=>Go,getMarker:()=>_u,getRadialColumnWidth:()=>Of,motion:()=>Gf,nearestSquared:()=>Zn,nearestSquaredInContainer:()=>Qn,toRadians:()=>Gs,toTooltipHtml:()=>nl});var Pf=class extends uu{constructor(){super(),this.centerX=0,this.centerY=0,this.radius=10,this.startAngle=0,this.endAngle=2*Math.PI,this.counterClockwise=!1,this.type=0,this.restoreOwnStyles()}get fullPie(){return jn(Ls(this.startAngle),Ls(this.endAngle))}updatePath(){const e=this.path;e.clear(),e.arc(this.centerX,this.centerY,this.radius,this.startAngle,this.endAngle,this.counterClockwise),1===this.type?e.closePath():2!==this.type||this.fullPie||(e.lineTo(this.centerX,this.centerY),e.closePath())}computeBBox(){return new es(this.centerX-this.radius,this.centerY-this.radius,2*this.radius,2*this.radius)}isPointInPath(e,t){const i=this.transformPoint(e,t),n=this.computeBBox();return 0!==this.type&&n.containsPoint(i.x,i.y)&&this.path.isPointInPath(i.x,i.y)}};Pf.className="Arc",Pf.defaultStyles=Object.assign({},Do.defaultStyles,{lineWidth:1,fillStyle:null}),b([hu()],Pf.prototype,"centerX",2),b([hu()],Pf.prototype,"centerY",2),b([hu()],Pf.prototype,"radius",2),b([hu()],Pf.prototype,"startAngle",2),b([hu()],Pf.prototype,"endAngle",2),b([hu()],Pf.prototype,"counterClockwise",2),b([hu()],Pf.prototype,"type",2);var _f=class extends Do{constructor(){super(...arguments),this.direction="to-right",this.stops=void 0,this._mask=void 0}get mask(){return this._mask}set mask(e){null!=this._mask&&this.removeChild(this._mask),null!=e&&this.appendChild(e),this._mask=e}isPointInPath(e,t){var i,n;return null!=(n=null==(i=this.mask)?void 0:i.isPointInPath(e,t))&&n}computeBBox(){var e;return null==(e=this.mask)?void 0:e.computeBBox()}render(e){const{mask:t,stops:i}=this,{ctx:n,devicePixelRatio:s}=e,r=1/s,o=null==t?void 0:t.computeTransformedBBox();if(null==t||null==i||null==o)return;t.dirtyPath&&(t.updatePath(),t.dirtyPath=!1),n.save(),n.clip(t.path.getPath2D()),n.setTransform(s,0,0,s,0,0);const a=Math.floor(o.x),l=Math.ceil(o.x+o.width),c=Math.floor(o.y),h=Math.ceil(o.y+o.height),u=new Yp,[d,p]="to-right"===this.direction?[a,l]:[c,h];if(u.domain=i.map((e,t)=>d+(p-d)*t/(i.length-1)),u.range=i,u.update(),"to-right"===this.direction){const e=h-c;for(let t=a;t<=l;t+=r)n.fillStyle=u.convert(t),n.fillRect(t,c,r,e)}else{const e=l-a;for(let t=c;t<=h;t+=r)n.fillStyle=u.convert(t),n.fillRect(a,t,e,r)}n.restore()}};function Lf(e,t,i){const n=Math.sqrt(p(e,2)+p(t,2)),s=Math.atan2(t,e)+i;return{x:Math.cos(s)*n,y:Math.sin(s)*n}}b([ns({redraw:3})],_f.prototype,"direction",2),b([ns({redraw:3})],_f.prototype,"stops",2),b([ns({redraw:3})],_f.prototype,"_mask",2);var Nf=class extends uu{constructor(){super(...arguments),this.borderPath=new cu,this.isBeveled=!0,this.columnWidth=0,this.startAngle=0,this.endAngle=0,this.outerRadius=0,this.innerRadius=0,this.axisInnerRadius=0,this.axisOuterRadius=0,this.isRadiusAxisReversed=!1}getRotation(){const{startAngle:e,endAngle:t}=this;return Ls(e+Vs(e,t)/2+Math.PI/2)}updatePath(){const{isBeveled:e}=this;e?this.updateBeveledPath():this.updateRectangularPath(),this.checkPathDirty()}updateRectangularPath(){const{columnWidth:e,innerRadius:t,outerRadius:i,path:n}=this,s=-e/2,r=e/2,o=-i,a=-t,l=this.getRotation(),c=[[s,a],[s,o],[r,o],[r,a],[s,a]].map(([e,t])=>Lf(e,t,l));n.clear(!0),n.moveTo(c[0].x,c[0].y),n.lineTo(c[1].x,c[1].y),n.lineTo(c[2].x,c[2].y),n.lineTo(c[3].x,c[3].y),n.lineTo(c[0].x,c[0].y),n.closePath()}updateBeveledPath(){const{columnWidth:e,path:t,outerRadius:i,innerRadius:n,axisInnerRadius:s,axisOuterRadius:r,isRadiusAxisReversed:o}=this,a=jn(n,s),l=Math.asin(e/2/n),c=this.getRotation(),h=(e,t)=>Lf(e,t,c),u=(e,t)=>Math.sqrt(p(e,2)+p(t,2)),d=(e,t)=>t>e?0:Math.sqrt(p(e,2)-p(t,2)),g=(e,t,i)=>i?e<t:e>t,f=a&&!isNaN(l)&&l<Math.PI/6;let m=-e/2,y=e/2;const v=-i,b=-n*(f?Math.cos(l):1),C=g(r,u(n,e/2),!o);if(C){const e=d(r,n);m=-e,y=e}t.clear(!0);const w=h(m,b);t.moveTo(w.x,w.y);const S=jn(n,i),x=g(r,u(i,e/2),!o);if(S&&f)t.arc(0,0,n,Ls(-l-Math.PI/2)+c,Ls(l-Math.PI/2)+c,!1);else if(x){const n=-d(r,e/2),s=d(r,i);if(!C){const e=h(m,n);t.lineTo(e.x,e.y)}if(t.arc(0,0,r,Math.atan2(n,m)+c,Math.atan2(v,-s)+c,!1),!jn(s,0)){const e=h(s,v);t.lineTo(e.x,e.y)}t.arc(0,0,r,Math.atan2(v,s)+c,Math.atan2(n,y)+c,!1)}else{const e=h(m,v),i=h(y,v);t.lineTo(e.x,e.y),t.lineTo(i.x,i.y)}const E=h(y,b);if(t.lineTo(E.x,E.y),f)t.arc(0,0,n,Ls(l-Math.PI/2)+c,Ls(-l-Math.PI/2)+c,!0);else{const e=h(m,b);t.lineTo(e.x,e.y)}t.closePath()}};function Of(e,t,i,n,s){const r=Vs(e,t),o=r*(1-n)/2;if(e+=o,t-=o,r<.001)return 2*i*s;if(r>=2*Math.PI){const i=e+r/2;e=i-Math.PI,t=i+Math.PI}const a=i*Math.cos(e),l=i*Math.sin(e),c=i*Math.cos(t),h=i*Math.sin(t),u=Math.floor(Math.sqrt(p(a-c,2)+p(l-h,2))),d=2*i*s;return Math.max(1,Math.min(d,u))}Nf.className="RadialColumnShape",b([hu()],Nf.prototype,"isBeveled",2),b([hu()],Nf.prototype,"columnWidth",2),b([hu()],Nf.prototype,"startAngle",2),b([hu()],Nf.prototype,"endAngle",2),b([hu()],Nf.prototype,"outerRadius",2),b([hu()],Nf.prototype,"innerRadius",2),b([hu()],Nf.prototype,"axisInnerRadius",2),b([hu()],Nf.prototype,"axisOuterRadius",2),b([hu()],Nf.prototype,"isRadiusAxisReversed",2);var Ff=class extends cs{constructor(e){super(),this.x=0,this.y=0,this.width=0,this.height=0,this.opacity=1,this.sourceImage=e}render(e){const{ctx:t,forceRender:i,stats:n}=e;if(0===this.dirty&&!i)return void(n&&n.nodesSkipped++);this.computeTransformMatrix(),this.matrix.toContext(t);const s=this.sourceImage;t.globalAlpha=this.opacity,t.drawImage(s,0,0,s.width,s.height,this.x,this.y,this.width,this.height),super.render(e)}};b([ns({redraw:3})],Ff.prototype,"x",2),b([ns({redraw:3})],Ff.prototype,"y",2),b([ns({redraw:3})],Ff.prototype,"width",2),b([ns({redraw:3})],Ff.prototype,"height",2),b([ns({redraw:3})],Ff.prototype,"opacity",2);var Gf=f(f({},Nn),ga),Bf={};v(Bf,{CARTESIAN_AXIS_TYPE:()=>_t,ChartTheme:()=>vi,DEFAULT_ANNOTATION_BACKGROUND_FILL:()=>ui,DEFAULT_ANNOTATION_HANDLE_FILL:()=>di,DEFAULT_ANNOTATION_STROKE:()=>hi,DEFAULT_AXIS_GRID_COLOUR:()=>Xt,DEFAULT_AXIS_LINE_COLOUR:()=>Zt,DEFAULT_BACKGROUND_COLOUR:()=>Jt,DEFAULT_COLOURS:()=>ti,DEFAULT_CROSS_LINES_COLOUR:()=>Qt,DEFAULT_DIVERGING_SERIES_COLOUR_RANGE:()=>ai,DEFAULT_FONT_FAMILY:()=>jt,DEFAULT_HIERARCHY_FILLS:()=>li,DEFAULT_HIERARCHY_STROKES:()=>ci,DEFAULT_INSIDE_SERIES_LABEL_COLOUR:()=>Yt,DEFAULT_INVERTED_LABEL_COLOUR:()=>Kt,DEFAULT_LABEL_COLOUR:()=>$t,DEFAULT_MUTED_LABEL_COLOUR:()=>qt,DEFAULT_POLAR_SERIES_STROKE:()=>oi,DEFAULT_SHADOW_COLOUR:()=>ei,DEFAULT_WATERFALL_SERIES_CONNECTOR_LINE_STROKE:()=>ri,DEFAULT_WATERFALL_SERIES_NEGATIVE_COLOURS:()=>ni,DEFAULT_WATERFALL_SERIES_POSITIVE_COLOURS:()=>ii,DEFAULT_WATERFALL_SERIES_TOTAL_COLOURS:()=>si,EXTENDS_AXES_DEFAULTS:()=>Bt,EXTENDS_AXES_GRID_LINE_DEFAULTS:()=>Ut,EXTENDS_AXES_LINE_DEFAULTS:()=>Vt,EXTENDS_AXES_TICK_DEFAULTS:()=>Ht,EXTENDS_CARTESIAN_MARKER_DEFAULTS:()=>Wt,EXTENDS_SERIES_DEFAULTS:()=>zt,FONT_SIZE:()=>Rt,FONT_WEIGHT:()=>kt,IS_DARK_THEME:()=>Gt,POLAR_AXIS_SHAPE:()=>Nt,POLAR_AXIS_TYPE:()=>Lt,POSITION:()=>Pt,getChartTheme:()=>an,markerPaletteFactory:()=>kd,singleSeriesPaletteFactory:()=>Rd,themes:()=>Vf});var Vf=Ze(on,e=>null==e?void 0:e()),Hf={};v(Hf,{BandScale:()=>Ws,ColorScale:()=>Yp,ContinuousScale:()=>qr,Invalidating:()=>Us,LinearScale:()=>Xu,OrdinalTimeScale:()=>vo,TimeScale:()=>mo});var Uf={};function zf(e,t){const i={};if(Array.isArray(t))for(let n=0;n<e.length;n++)i[`${e[n]}`]=t[n];else for(let n=0;n<e.length;n++)i[`${e[n]}`]=t;return i}v(Uf,{Color:()=>ps,Logger:()=>L,Padding:()=>Zl,angleBetween:()=>Vs,areArrayItemsStrictlyEqual:()=>Wa,areArrayNumbersEqual:()=>ja,bifurcate:()=>mn,checkDatum:()=>Ko,clamp:()=>Hn,clampArray:()=>Un,countFractionDigits:()=>Xn,createId:()=>Gn,deepClone:()=>St,displacePointFromVector:()=>Hs,extent:()=>ln,findMinMax:()=>zn,findRangeExtent:()=>Wn,isBetweenAngles:()=>Fs,isContinuous:()=>$o,isDate:()=>Ne,isDenseInterval:()=>go,isEqual:()=>jn,isNegative:()=>$n,isNumber:()=>ze,isNumberEqual:()=>jn,isNumberObject:()=>jo,isString:()=>He,isStringObject:()=>Wo,jsonApply:()=>At,jsonDiff:()=>wt,jsonWalk:()=>Et,mod:()=>qn,normalisedExtent:()=>cn,normalisedExtentWithMetadata:()=>hn,normalizeAngle180:()=>Os,normalizeAngle360:()=>Ls,normalizeAngle360Inclusive:()=>Ns,range:()=>po,resetIds:()=>Fn,round:()=>Kn,sanitizeHtml:()=>Ld,setAttribute:()=>Za,shallowClone:()=>xt,tickFormat:()=>ka,tickStep:()=>uo,ticks:()=>co,toDegrees:()=>Bs,toFixed:()=>Yn,toRadians:()=>Gs,transformIntegratedCategoryValue:()=>Yo,zipObject:()=>zf});var Wf={};function jf({defs:e,values:t,xAxis:i,yAxis:n}){if(!i||!n)throw new Error("Axes must be defined");const s={};for(const[r,{def:o}]of e)if(Object.hasOwn(t,r)){const{scale:e}="key"===o.type?i:n;s[r]=Math.round(e.convert(t[r]))}return s}v(Wf,{AND:()=>Ys,ARRAY:()=>ar,ARRAY_OF:()=>lr,AbstractBarSeries:()=>kp,AbstractBarSeriesProperties:()=>Rp,ActionOnSet:()=>qa,Animation:()=>Ds,AnimationManager:()=>yc,AreaSeriesTag:()=>wp,Axis:()=>Sl,AxisLabel:()=>hl,AxisTick:()=>Wr,BOOLEAN:()=>Qs,BOOLEAN_ARRAY:()=>yr,Background:()=>ld,BackgroundModule:()=>cd,BaseModuleInstance:()=>we,BaseProperties:()=>yt,COLOR_STRING:()=>fr,COLOR_STRING_ARRAY:()=>mr,CartesianAxis:()=>Al,CartesianSeries:()=>Wu,CartesianSeriesNodeEvent:()=>Uu,CartesianSeriesProperties:()=>zu,CategoryAxis:()=>Tl,CategoryAxisTick:()=>Ml,ChartAxisDirection:()=>jr,ChartEventManager:()=>bc,ChartOptions:()=>kn,ChartUpdateType:()=>Vc,ContextMenuRegistry:()=>Cc,CursorManager:()=>Sc,DATE:()=>dr,DATE_ARRAY:()=>Cr,DATE_OR_DATETIME_MS:()=>pr,DEFAULT_CARTESIAN_DIRECTION_KEYS:()=>Vu,DEFAULT_CARTESIAN_DIRECTION_NAMES:()=>Hu,DEFAULT_TOOLTIP_CLASS:()=>Ja,DEFAULT_TOOLTIP_DARK_CLASS:()=>el,DEGREE:()=>rr,DIRECTION:()=>Pr,DataController:()=>Jc,DataModel:()=>Zc,DataModelSeries:()=>Lu,DataService:()=>nc,Default:()=>js,Deprecated:()=>_n,DeprecatedAndRenamedTo:()=>Ln,EMPTY_TOOLTIP_CONTENT:()=>tl,FONT_STYLE:()=>Mr,FONT_WEIGHT:()=>Tr,FUNCTION:()=>Js,GREATER_THAN:()=>ur,GestureDetector:()=>Ec,GroupedCategoryAxis:()=>Gl,HierarchyNode:()=>Kf,HierarchySeries:()=>Yf,HierarchySeriesProperties:()=>qf,HighlightManager:()=>Ac,HighlightStyle:()=>Gu,INTERACTION_RANGE:()=>Lr,InteractionManager:()=>fc,InteractionState:()=>pc,LABEL_PLACEMENT:()=>Nr,LESS_THAN:()=>hr,LINE_CAP:()=>Sr,LINE_DASH:()=>Er,LINE_JOIN:()=>xr,Layers:()=>zo,LayoutService:()=>Gc,LonLatBBox:()=>Xf,MARKER_SHAPE:()=>Vd,MATCHING_CROSSLINE_TYPE:()=>qo,MAX_SPACING:()=>Gr,MIN_SPACING:()=>Fr,MercatorScale:()=>bf,Motion:()=>fs,NAN:()=>ir,NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>Is,NUMBER:()=>tr,NUMBER_ARRAY:()=>vr,NUMBER_OR_NAN:()=>or,Navigator:()=>Dd,NavigatorModule:()=>Id,OBJECT:()=>Xs,OBJECT_ARRAY:()=>wr,OR:()=>qs,OVERFLOW_STRATEGY:()=>kr,ObserveChanges:()=>Xa,PHASE_METADATA:()=>As,PHASE_ORDER:()=>Es,PLACEMENT:()=>_r,PLAIN_OBJECT:()=>Zs,POINTER_INTERACTION_TYPES:()=>lc,POSITION:()=>Ar,POSITIVE_NUMBER:()=>nr,PolarAxis:()=>uf,PolarSeries:()=>_g,PropertiesArray:()=>vt,ProxyOnWrite:()=>Ka,ProxyProperty:()=>$a,ProxyPropertyOnWrite:()=>Ya,QUICK_TRANSITION:()=>.2,RATIO:()=>sr,RepeatType:()=>Ms,SKIP_JS_BUILTINS:()=>et,SMALLEST_KEY_INTERVAL:()=>Ah,SORT_DOMAIN_GROUPS:()=>Mh,STRING:()=>er,STRING_ARRAY:()=>br,Series:()=>Xh,SeriesGroupingChangedEvent:()=>qh,SeriesItemHighlightStyle:()=>Nu,SeriesMarker:()=>Hd,SeriesNodeEvent:()=>Yh,SeriesNodePickMode:()=>Fh,SeriesProperties:()=>Bu,SeriesTooltip:()=>zd,StateMachine:()=>ma,TEXT_ALIGN:()=>Ir,TEXT_WRAP:()=>Dr,ToolbarManager:()=>Nc,Tooltip:()=>rl,TooltipManager:()=>Fc,TooltipPosition:()=>sl,UNION:()=>Or,UpdateService:()=>Hc,VERTICAL_ALIGN:()=>Rr,Validate:()=>$s,ZoomManager:()=>ih,__FORCE_MODULE_DETECTION:()=>Zf,accumulateGroup:()=>Lh,accumulatedValue:()=>xh,accumulativeValueProperty:()=>jh,addHitTestersToQuadtree:()=>Dp,adjustLabelPlacement:()=>Wp,allInStringUnion:()=>vn,animationValidation:()=>kh,area:()=>Sh,arraysEqual:()=>un,assignJsonApplyConstructedArray:()=>Kr,backfillPathPointData:()=>tp,basicContinuousCheckDatumValidation:()=>Gh,bifurcate:()=>mn,buildFormatter:()=>no,buildResetPathFn:()=>ap,calculateDefaultTimeTickFormat:()=>oo,calculatePlacement:()=>Qa,checkCrisp:()=>Op,childrenIter:()=>Tp,circularSliceArray:()=>fn,clamp:()=>Hn,clampArray:()=>Un,collapsedStartingBarPosition:()=>Gp,computeBarFocusBounds:()=>Up,computeMarkerFocusBounds:()=>Zd,computeSectorFocusBounds:()=>Pg,convertValuesToScaleByDefs:()=>jf,countFractionDigits:()=>Xn,createDatumId:()=>Oh,createDeprecationWarning:()=>Pn,createElement:()=>xn,dateToNumber:()=>so,deconstructSelectionsOrNodes:()=>Ts,deepClone:()=>St,deepMerge:()=>Ye,defaultTimeTickFormat:()=>ro,determinePathStatus:()=>vp,diff:()=>Nh,downloadUrl:()=>En,enterpriseModule:()=>Ce,extent:()=>ln,extractDecoratedProperties:()=>Re,findMinMax:()=>zn,findQuadtreeMatch:()=>Ip,findRangeExtent:()=>Wn,fixNumericExtent:()=>Yc,fromToMotion:()=>Rs,getDocument:()=>wn,getMissCount:()=>qc,getPath:()=>Je,getRectConfig:()=>Np,getWindow:()=>Sn,groupAccumulativeValueProperty:()=>Kh,groupAverage:()=>wh,groupBy:()=>gn,groupCount:()=>Ch,groupSum:()=>vh,injectStyle:()=>An,isArray:()=>Pe,isBoolean:()=>_e,isDate:()=>Le,isDecoratedObject:()=>De,isDefined:()=>ke,isEnumKey:()=>je,isEnumValue:()=>$e,isEqual:()=>jn,isFiniteNumber:()=>ze,isFunction:()=>Fe,isHtmlElement:()=>We,isNegative:()=>$n,isNumber:()=>Ue,isObject:()=>Ge,isObjectLike:()=>Be,isPlainObject:()=>Ve,isProperties:()=>bt,isRegExp:()=>Oe,isString:()=>He,isSymbol:()=>Ke,isValidDate:()=>Ne,jsonApply:()=>At,jsonDiff:()=>wt,jsonWalk:()=>Et,keyProperty:()=>Uh,listDecoratedProperties:()=>Ie,mapIterable:()=>yn,mapValues:()=>Ze,markerFadeInAnimation:()=>jd,markerPaletteFactory:()=>kd,markerScaleInAnimation:()=>$d,markerSwipeScaleInAnimation:()=>Kd,mergeArrayDefaults:()=>Xe,mergeDefaults:()=>qe,midpointStartingBarPosition:()=>Bp,minMax:()=>Qd,mod:()=>qn,moduleRegistry:()=>Se,normaliseGroupTo:()=>Dh,normalisePropertyTo:()=>Rh,normalisedExtent:()=>cn,normalisedExtentWithMetadata:()=>hn,pairCategoryData:()=>yp,pairContinuousData:()=>mp,partialAssign:()=>it,pathFadeInAnimation:()=>rp,pathFadeOutAnimation:()=>op,pathSwipeInAnimation:()=>sp,pickByMatchingAngle:()=>kg,predicateWithMessage:()=>Br,prepareAreaPathAnimation:()=>Ep,prepareAxisAnimationContext:()=>pl,prepareAxisAnimationFunctions:()=>ml,prepareBarAnimationFunctions:()=>Vp,prepareLinePathAnimation:()=>Cp,prepareLinePathAnimationFns:()=>bp,prepareMarkerAnimation:()=>Xd,preparePieSeriesAnimationFunctions:()=>Ig,range:()=>bh,rangedValueProperty:()=>Wh,renderPartialPath:()=>np,resetAxisGroupFn:()=>yl,resetAxisLabelSelectionFn:()=>bl,resetAxisLineSelectionFn:()=>Cl,resetAxisSelectionFn:()=>vl,resetBarSelectionsFn:()=>Hp,resetIds:()=>Fn,resetLabelFn:()=>Fd,resetMarkerFn:()=>Yd,resetMarkerPositionFn:()=>qd,resetMotion:()=>fa,resetPieSelectionsFn:()=>Rg,round:()=>Kn,seriesLabelFadeInAnimation:()=>Nd,seriesLabelFadeOutAnimation:()=>Od,setDocument:()=>Mn,setPath:()=>tt,setWindow:()=>Tn,shallowClone:()=>xt,singleSeriesPaletteFactory:()=>Rd,staticFromToMotion:()=>ks,stringify:()=>Ur,sum:()=>yh,sumValues:()=>mh,toArray:()=>dn,toFixed:()=>Yn,toTooltipHtml:()=>nl,trailingAccumulatedValue:()=>Eh,trailingAccumulatedValueProperty:()=>$h,unique:()=>pn,updateClipPath:()=>lp,updateLabelNode:()=>zp,updateRect:()=>Lp,validateCrossLineValues:()=>Xo,valueProperty:()=>zh,without:()=>Qe});var $f=class e{constructor(e,t,i,n,s,r,o,a,l,c,h){this.series=e,this.index=t,this.datum=i,this.size=n,this.colorValue=s,this.fill=r,this.stroke=o,this.sumSize=a,this.depth=l,this.parent=c,this.children=h,this.midPoint={x:0,y:0}}contains(e){let t=e;for(;null!=t&&t.index>=this.index;){if(t===this)return!0;t=t.parent}return!1}walk(t,i=e.Walk.PreOrder){i===e.Walk.PreOrder&&t(this),this.children.forEach(e=>{e.walk(t,i)}),i===e.Walk.PostOrder&&t(this)}*[Symbol.iterator](){yield this;for(const e of this.children)yield*x(e)}};$f.Walk={PreOrder:0,PostOrder:1};var Kf=$f,Yf=class extends Xh{constructor(e){super({moduleCtx:e,pickModes:[0],contentGroupVirtual:!1}),this.rootNode=new Kf(this,0,void 0,0,void 0,void 0,void 0,0,void 0,void 0,[]),this.colorDomain=[0,0],this.maxDepth=0,this.animationState=new ma("empty",{empty:{update:{target:"ready",action:e=>this.animateEmptyUpdateReady(e)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:e=>this.animateReadyHighlight(e),resize:e=>this.animateReadyResize(e),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:e=>this.animateWaitingUpdateReady(e)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:e=>this.animateClearingUpdateEmpty(e)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}resetAnimation(e){"initial"===e?this.animationState.transition("reset"):"ready"===e&&this.animationState.transition("skip")}processData(){return w(this,null,function*(){var e,t;const{childrenKey:i,sizeKey:n,colorKey:s,fills:r,strokes:o,colorRange:a}=this.properties;let l=0,c=0,h=1/0,u=-1/0;const d=new Array((null!=(t=null==(e=this.data)?void 0:e.length)?t:0)+1).fill(void 0),p=(e,t)=>{const r=(l+=1,l),o=null!=t.depth?t.depth+1:0,a=null!=i?e[i]:void 0,p=null==a||0===a.length;let f=null!=n?e[n]:void 0;f=Number.isFinite(f)?Math.max(f,0):p?1:0;const m=f;c=Math.max(c,o);const y=null!=s?e[s]:void 0;return"number"==typeof y&&(d[r]=y,h=Math.min(h,y),u=Math.max(u,y)),g(new Kf(this,r,e,f,y,void 0,void 0,m,o,t,[]),a)},g=(e,t)=>(null==t||t.forEach(t=>{const i=p(t,e);e.children.push(i),e.sumSize+=i.sumSize}),e),f=g(new Kf(this,0,void 0,0,void 0,void 0,void 0,0,void 0,void 0,[]),this.data),m=[h,u];let y;null!=a&&Number.isFinite(h)&&Number.isFinite(u)&&(y=new Yp,y.domain=m,y.range=a,y.update()),f.children.forEach((e,t)=>{e.walk(e=>{let i;const n=d[e.index];null!=n&&(i=null==y?void 0:y.convert(n)),null!=i||(i=null==r?void 0:r[t%r.length]),e.fill=i,e.stroke=null==y?null==o?void 0:o[t%o.length]:"rgba(0, 0, 0, 0.2)"})}),this.rootNode=f,this.maxDepth=c,this.colorDomain=m})}update(e){return w(this,arguments,function*({seriesRect:e}){yield this.updateSelections(),yield this.updateNodes();const t=this.getAnimationData();this.checkResize(e)&&this.animationState.transition("resize",t),this.animationState.transition("update",t)})}resetAllAnimation(e){var t;const i=null==(t=this.animationResetFns)?void 0:t.datum;this.ctx.animationManager.stopByAnimationGroupId(this.id),null!=i&&fa(e.datumSelections,i)}animateEmptyUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateWaitingUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateReadyHighlight(e){var t;const i=null==(t=this.animationResetFns)?void 0:t.datum;null!=i&&fa([e],i)}animateReadyResize(e){this.resetAllAnimation(e)}animateClearingUpdateEmpty(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animationTransitionClear(){this.animationState.transition("clear",this.getAnimationData())}getAnimationData(){return{datumSelections:[this.groupSelection]}}isProcessedDataAnimatable(){return!0}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}getLabelData(){return[]}getSeriesDomain(){return[NaN,NaN]}getLegendData(e){const{colorKey:t,colorName:i,colorRange:n,visible:s}=this.properties;return"gradient"===e&&null!=t&&null!=n?[{legendType:"gradient",enabled:s,seriesId:this.id,colorName:i,colorRange:n,colorDomain:this.colorDomain}]:[]}getDatumIdFromData(e){return`${e.index}`}getDatumId(e){return this.getDatumIdFromData(e)}},qf=class extends Bu{constructor(){super(...arguments),this.childrenKey="children",this.fills=Object.values(Ot),this.strokes=Object.values(Ft)}};b([$s(er)],qf.prototype,"childrenKey",2),b([$s(er,{optional:!0})],qf.prototype,"sizeKey",2),b([$s(er,{optional:!0})],qf.prototype,"colorKey",2),b([$s(er,{optional:!0})],qf.prototype,"colorName",2),b([$s(mr)],qf.prototype,"fills",2),b([$s(mr)],qf.prototype,"strokes",2),b([$s(mr,{optional:!0})],qf.prototype,"colorRange",2);var Xf=class{constructor(e,t,i,n){this.lon0=e,this.lat0=t,this.lon1=i,this.lat1=n}merge(e){this.lon0=Math.min(this.lon0,e.lon0),this.lat0=Math.min(this.lat0,e.lat0),this.lon1=Math.max(this.lon1,e.lon1),this.lat1=Math.max(this.lat1,e.lat1)}},Zf=0},98092(e){var t,i=Object.defineProperty,n=Object.defineProperties,s=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertyNames,a=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable,h=(e,t,n)=>t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,u=(e,t)=>{for(var i in t||(t={}))l.call(t,i)&&h(e,i,t[i]);if(a)for(var i of a(t))c.call(t,i)&&h(e,i,t[i]);return e},d=(e,t)=>n(e,r(t)),p=(e,t)=>{for(var n in t)i(e,n,{get:t[n],enumerable:!0})},g=(e,t,n,r)=>{for(var o,a=r>1?void 0:r?s(t,n):t,l=e.length-1;l>=0;l--)(o=e[l])&&(a=(r?o(t,n,a):o(a))||a);return r&&a&&i(t,n,a),a},f=(e,t)=>(i,n)=>t(i,n,e),m={};p(m,{ALWAYS_SYNC_GLOBAL_EVENTS:()=>ht,AbstractHeaderCellCtrl:()=>el,AgAbstractField:()=>Os,AgAbstractLabel:()=>Ns,AgAutocomplete:()=>vc,AgCheckbox:()=>zs,AgDialog:()=>uc,AgGroupComponent:()=>tc,AgInputDateField:()=>$l,AgInputNumberField:()=>nr,AgInputRange:()=>Kl,AgInputTextArea:()=>jl,AgInputTextField:()=>ir,AgMenuItemComponent:()=>lc,AgMenuItemRenderer:()=>uo,AgMenuList:()=>rc,AgMenuPanel:()=>oc,AgPanel:()=>hc,AgPickerField:()=>Fs,AgPromise:()=>ds,AgPromiseStatus:()=>us,AgRadioButton:()=>Ws,AgRichSelect:()=>Zl,AgSelect:()=>Hs,AgSlider:()=>Jl,AgStackComponentsRegistry:()=>Nt,AgToggleButton:()=>Wl,AlignedGridsService:()=>Mc,AnimateShowChangeCellRenderer:()=>kr,AnimateSlideCellRenderer:()=>Pr,AnimationFrameService:()=>Dl,AutoScrollService:()=>Fo,AutoWidthCalculator:()=>Pl,Autowired:()=>ue,BarColumnLabelPlacement:()=>Wh,BaseComponentWrapper:()=>Uh,BaseCreator:()=>xu,BaseGridSerializingSession:()=>Eu,Bean:()=>he,BeanStub:()=>st,Beans:()=>la,BodyDropPivotTarget:()=>Ua,BodyDropTarget:()=>ja,CellComp:()=>Ba,CellCtrl:()=>fa,CellNavigationService:()=>Ac,CellPositionUtils:()=>Jc,CellRangeType:()=>na,ChangedPath:()=>Gl,ChartMappings:()=>zh,CheckboxCellEditor:()=>ho,CheckboxCellRenderer:()=>co,CheckboxSelectionComponent:()=>Nr,ClientSideRowModelModule:()=>tu,ClientSideRowModelSteps:()=>Il,Column:()=>Se,ColumnApi:()=>Dc,ColumnFactory:()=>rt,ColumnGroup:()=>lt,ColumnKeyCreator:()=>I,ColumnModel:()=>Mt,Component:()=>Cs,ComponentUtil:()=>Lt,Context:()=>oe,CssClassApplier:()=>da,CssClassManager:()=>gs,CsvCreator:()=>Tu,CsvExportModule:()=>Ru,CtrlsService:()=>ch,DataTypeService:()=>Dh,DateCellEditor:()=>ro,DateFilter:()=>Qs,DateStringCellEditor:()=>ao,DisplayedGroupCreator:()=>It,Downloader:()=>Au,DragAndDropService:()=>Br,DragService:()=>Bo,DragSourceType:()=>Gr,Environment:()=>$c,EventService:()=>me,Events:()=>ct,ExcelFactoryMode:()=>No,ExpansionService:()=>Rl,ExpressionService:()=>Rc,FilterManager:()=>jo,FilterWrapperComp:()=>$o,FloatingFilterMapper:()=>_o,FocusService:()=>Oc,GROUP_AUTO_COLUMN_ID:()=>dt,Grid:()=>Bh,GridApi:()=>zo,GridBodyComp:()=>_a,GridBodyCtrl:()=>ta,GridComp:()=>Lc,GridCoreCreator:()=>Hh,GridCtrl:()=>_c,GridHeaderComp:()=>bl,GridHeaderCtrl:()=>yl,GridOptionsService:()=>Sh,GridSerializer:()=>Iu,GroupCellRenderer:()=>$r,GroupCellRendererCtrl:()=>Wr,GroupInstanceIdCreator:()=>ut,HeaderCellCtrl:()=>ol,HeaderFilterCellComp:()=>qo,HeaderFilterCellCtrl:()=>nl,HeaderGroupCellCtrl:()=>cl,HeaderNavigationDirection:()=>fl,HeaderNavigationService:()=>ml,HeaderPositionUtils:()=>rh,HeaderRowComp:()=>Za,HeaderRowContainerComp:()=>gl,HeaderRowContainerCtrl:()=>dl,HeaderRowCtrl:()=>ul,HeaderRowType:()=>Xa,HorizontalDirection:()=>Fr,HorizontalResizeService:()=>Cl,InfiniteRowModelModule:()=>hu,KeyCode:()=>Zn,LargeTextCellEditor:()=>Mr,LayoutCssClasses:()=>Xo,LocaleService:()=>xh,Logger:()=>Pc,LoggerFactory:()=>kc,ManagedFocusFeature:()=>Is,MenuService:()=>kl,ModuleNames:()=>ne,ModuleRegistry:()=>re,MouseEventService:()=>Na,MoveColumnFeature:()=>Wa,NavigationService:()=>Oa,NumberCellEditor:()=>no,NumberFilter:()=>ar,NumberSequence:()=>hs,Optional:()=>de,PaginationProxy:()=>Ul,PillDragComp:()=>Cc,PillDropZonePanel:()=>Sc,PinnedRowModel:()=>Ol,PopupComponent:()=>Er,PopupEditorWrapper:()=>Ga,PopupService:()=>pc,PositionableFeature:()=>Ps,PostConstruct:()=>le,PreConstruct:()=>ae,PreDestroy:()=>ce,PropertyKeys:()=>Pt,ProvidedColumnGroup:()=>Ee,ProvidedFilter:()=>Ls,Qualifier:()=>ge,QuerySelector:()=>ws,RefSelector:()=>Ss,ResizeObserverService:()=>Tl,RowAnimationCssClasses:()=>Jo,RowContainerComp:()=>Ha,RowContainerCtrl:()=>Pa,RowContainerName:()=>Ma,RowContainerType:()=>Ta,RowCtrl:()=>va,RowHighlightPosition:()=>Oo,RowNode:()=>Lr,RowNodeBlock:()=>Vl,RowNodeBlockLoader:()=>Hl,RowNodeSorter:()=>lh,RowPositionUtils:()=>Qc,RowRenderer:()=>Ll,RowType:()=>Du,ScalarFilter:()=>Ys,ScrollVisibleService:()=>La,SelectCellEditor:()=>Tr,SelectableService:()=>Yc,SelectionHandleType:()=>ia,ServerSideTransactionResultStatus:()=>Fl,SetLeftFeature:()=>tl,SimpleFilter:()=>Ks,SortController:()=>Nc,SortIndicatorComp:()=>br,StandardMenuFactory:()=>wl,StylingService:()=>zl,TabGuardClassNames:()=>Sl,TabGuardComp:()=>El,TabGuardCtrl:()=>xl,TabbedLayout:()=>Ml,TextCellEditor:()=>Rr,TextFilter:()=>hr,TextFloatingFilter:()=>fr,Timer:()=>ps,TooltipFeature:()=>ys,TooltipStateManager:()=>ms,TouchListener:()=>yr,UserComponentFactory:()=>Lo,UserComponentRegistry:()=>po,ValueCache:()=>Vc,ValueService:()=>Ic,VanillaFrameworkOverrides:()=>Ec,VerticalDirection:()=>Or,VirtualList:()=>Xl,VirtualListDragFeature:()=>Ho,XmlFactory:()=>Pu,ZipContainer:()=>Hu,_:()=>cs,createGrid:()=>Gh,getRowContainerTypeForName:()=>Da,provideGlobalGridOptions:()=>Fh}),e.exports=(t=m,((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let n of o(t))l.call(e,n)||void 0===n||i(e,n,{get:()=>t[n],enumerable:!(r=s(t,n))||r.enumerable});return e})(i({},"__esModule",{value:!0}),t));var y={};function v(e){return null==e||""===e?null:e}function b(e,t=!1){return null!=e&&(""!==e||t)}function C(e){return!b(e)}function w(e){return null==e||0===e.length}function S(e){return null!=e&&"function"==typeof e.toString?e.toString():null}function x(e){if(void 0===e)return;if(null===e||""===e)return null;if("number"==typeof e)return isNaN(e)?void 0:e;const t=parseInt(e,10);return isNaN(t)?void 0:t}function E(e){if(void 0!==e)return null!==e&&""!==e&&("boolean"==typeof e?e:/true/i.test(e))}function A(e){if(null!=e&&""!==e)return e}function M(e,t){return(e?JSON.stringify(e):null)===(t?JSON.stringify(t):null)}function T(e,t,i=!1){const n=null==e,s=null==t;if(e&&e.toNumber&&(e=e.toNumber()),t&&t.toNumber&&(t=t.toNumber()),n&&s)return 0;if(n)return-1;if(s)return 1;function r(e,t){return e>t?1:e<t?-1:0}if("string"!=typeof e)return r(e,t);if(!i)return r(e,t);try{return e.localeCompare(t)}catch(i){return r(e,t)}}function D(e){if(e instanceof Set||e instanceof Map){const t=[];return e.forEach(e=>t.push(e)),t}return Object.values(e)}p(y,{attrToBoolean:()=>E,attrToNumber:()=>x,attrToString:()=>A,defaultComparator:()=>T,exists:()=>b,jsonEquals:()=>M,makeNull:()=>v,missing:()=>C,missingOrEmpty:()=>w,toStringOrNull:()=>S,values:()=>D});var I=class{constructor(){this.existingKeys={}}addExistingKeys(e){for(let t=0;t<e.length;t++)this.existingKeys[e[t]]=!0}getUniqueKey(e,t){e=S(e);let i=0;for(;;){let n;if(e?(n=e,0!==i&&(n+="_"+i)):t?(n=t,0!==i&&(n+="_"+i)):n=i,!this.existingKeys[n])return this.existingKeys[n]=!0,String(n);i++}}},R={};p(R,{SKIP_JS_BUILTINS:()=>k,cloneObject:()=>_,deepCloneDefinition:()=>L,getAllValuesInObject:()=>N,getValueUsingField:()=>F,isNonNullObject:()=>B,iterateObject:()=>P,mergeDeep:()=>O,removeAllReferences:()=>G});var k=new Set(["__proto__","constructor","prototype"]);function P(e,t){if(null!=e)if(Array.isArray(e))for(let i=0;i<e.length;i++)t(i.toString(),e[i]);else for(const[i,n]of Object.entries(e))t(i,n)}function _(e){const t={},i=Object.keys(e);for(let n=0;n<i.length;n++){if(k.has(i[n]))continue;const s=i[n],r=e[s];t[s]=r}return t}function L(e,t){if(!e)return;const i=e,n={};return Object.keys(i).forEach(e=>{if(t&&t.indexOf(e)>=0||k.has(e))return;const s=i[e],r=B(s)&&s.constructor===Object;n[e]=r?L(s):s}),n}function N(e){if(!e)return[];const t=Object;if("function"==typeof t.values)return t.values(e);const i=[];for(const t in e)e.hasOwnProperty(t)&&e.propertyIsEnumerable(t)&&i.push(e[t]);return i}function O(e,t,i=!0,n=!1){b(t)&&P(t,(t,s)=>{if(k.has(t))return;let r=e[t];r!==s&&(n&&null==r&&null!=s&&"object"==typeof s&&s.constructor===Object&&(r={},e[t]=r),B(s)&&B(r)&&!Array.isArray(r)?O(r,s,i,n):(i||void 0!==s)&&(e[t]=s))})}function F(e,t,i){if(!t||!e)return;if(!i)return e[t];const n=t.split(".");let s=e;for(let e=0;e<n.length;e++){if(null==s)return;s=s[n[e]]}return s}function G(e,t=[],i){Object.keys(e).forEach(i=>{"object"!=typeof e[i]||t.includes(i)||(e[i]=void 0)});const n=Object.getPrototypeOf(e),s={};Object.getOwnPropertyNames(n).forEach(e=>{if("function"==typeof n[e]&&!t.includes(e)){const t=()=>{console.warn((e=>`AG Grid: Grid API function ${e}() cannot be called as the grid has been destroyed.\n    It is recommended to remove local references to the grid api. Alternatively, check gridApi.isDestroyed() to avoid calling methods against a destroyed grid.\n    To run logic when the grid is about to be destroyed use the gridPreDestroy event. See: ${i}`)(e))};s[e]={value:t,writable:!0}}}),Object.defineProperties(e,s)}function B(e){return"object"==typeof e&&null!==e}var V={};p(V,{compose:()=>te,debounce:()=>Q,doOnce:()=>U,errorOnce:()=>W,executeAfter:()=>Z,executeInAWhile:()=>K,executeNextVMTurn:()=>X,getFunctionName:()=>j,isFunction:()=>$,noop:()=>ie,throttle:()=>J,waitUntil:()=>ee,warnOnce:()=>z});var H={};function U(e,t){H[t]||(e(),H[t]=!0)}function z(e){U(()=>console.warn("AG Grid: "+e),e)}function W(e){U(()=>console.error("AG Grid: "+e),e)}function j(e){if(e.name)return e.name;const t=/function\s+([^\(]+)/.exec(e.toString());return t&&2===t.length?t[1].trim():null}function $(e){return!!(e&&e.constructor&&e.call&&e.apply)}function K(e){Z(e,400)}var Y=[],q=!1;function X(e){Y.push(e),q||(q=!0,window.setTimeout(()=>{const e=Y.slice();Y.length=0,q=!1,e.forEach(e=>e())},0))}function Z(e,t=0){e.length>0&&window.setTimeout(()=>e.forEach(e=>e()),t)}function Q(e,t){let i;return function(...n){const s=this;window.clearTimeout(i),i=window.setTimeout(function(){e.apply(s,n)},t)}}function J(e,t){let i=0;return function(...n){const s=(new Date).getTime();s-i<t||(i=s,e.apply(this,n))}}function ee(e,t,i=100,n){const s=(new Date).getTime();let r=null,o=!1;const a=()=>{const a=(new Date).getTime()-s>i;(e()||a)&&(t(),o=!0,null!=r&&(window.clearInterval(r),r=null),a&&n&&console.warn(n))};a(),o||(r=window.setInterval(a,10))}function te(...e){return t=>e.reduce((e,t)=>t(e),t)}var ie=()=>{},ne=(e=>(e.CommunityCoreModule="@ag-grid-community/core",e.InfiniteRowModelModule="@ag-grid-community/infinite-row-model",e.ClientSideRowModelModule="@ag-grid-community/client-side-row-model",e.CsvExportModule="@ag-grid-community/csv-export",e.EnterpriseCoreModule="@ag-grid-enterprise/core",e.RowGroupingModule="@ag-grid-enterprise/row-grouping",e.ColumnsToolPanelModule="@ag-grid-enterprise/column-tool-panel",e.FiltersToolPanelModule="@ag-grid-enterprise/filter-tool-panel",e.MenuModule="@ag-grid-enterprise/menu",e.SetFilterModule="@ag-grid-enterprise/set-filter",e.MultiFilterModule="@ag-grid-enterprise/multi-filter",e.StatusBarModule="@ag-grid-enterprise/status-bar",e.SideBarModule="@ag-grid-enterprise/side-bar",e.RangeSelectionModule="@ag-grid-enterprise/range-selection",e.MasterDetailModule="@ag-grid-enterprise/master-detail",e.RichSelectModule="@ag-grid-enterprise/rich-select",e.GridChartsModule="@ag-grid-enterprise/charts",e.ViewportRowModelModule="@ag-grid-enterprise/viewport-row-model",e.ServerSideRowModelModule="@ag-grid-enterprise/server-side-row-model",e.ExcelExportModule="@ag-grid-enterprise/excel-export",e.ClipboardModule="@ag-grid-enterprise/clipboard",e.SparklinesModule="@ag-grid-enterprise/sparklines",e.AdvancedFilterModule="@ag-grid-enterprise/advanced-filter",e.AngularModule="@ag-grid-community/angular",e.ReactModule="@ag-grid-community/react",e.VueModule="@ag-grid-community/vue",e))(ne||{}),se=class e{static register(t){e.__register(t,!0,void 0)}static registerModules(t){e.__registerModules(t,!0,void 0)}static __register(t,i,n){e.runVersionChecks(t),void 0!==n?(e.areGridScopedModules=!0,void 0===e.gridModulesMap[n]&&(e.gridModulesMap[n]={}),e.gridModulesMap[n][t.moduleName]=t):e.globalModulesMap[t.moduleName]=t,e.setModuleBased(i)}static __unRegisterGridModules(t){delete e.gridModulesMap[t]}static __registerModules(t,i,n){e.setModuleBased(i),t&&t.forEach(t=>e.__register(t,i,n))}static isValidModuleVersion(t){const[i,n]=t.version.split(".")||[],[s,r]=e.currentModuleVersion.split(".")||[];return i===s&&n===r}static runVersionChecks(t){if(e.currentModuleVersion||(e.currentModuleVersion=t.version),t.version?e.isValidModuleVersion(t)||console.error(`AG Grid: You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. '${t.moduleName}' is version ${t.version} but the other modules are version ${this.currentModuleVersion}. Please update all modules to the same version.`):console.error(`AG Grid: You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. '${t.moduleName}' is incompatible. Please update all modules to the same version.`),t.validate){const e=t.validate();if(!e.isValid){const t=e;console.error(`AG Grid: ${t.message}`)}}}static setModuleBased(t){void 0===e.moduleBased?e.moduleBased=t:e.moduleBased!==t&&U(()=>{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(){e.isBundled=!0}static __assertRegistered(t,i,n){var s;if(this.__isRegistered(t,n))return!0;const r=i+t;let o;if(e.isBundled)o=`AG Grid: unable to use ${i} as 'ag-grid-enterprise' has not been loaded. Check you are using the Enterprise bundle:\n        \n        <script src="https://cdn.jsdelivr.net/npm/ag-grid-enterprise@AG_GRID_VERSION/dist/ag-grid-enterprise.min.js"><\/script>\n        \nFor more info see: https://ag-grid.com/javascript-data-grid/getting-started/#getting-started-with-ag-grid-enterprise`;else if(e.moduleBased||void 0===e.moduleBased){let r=null==(s=Object.entries(ne).find(([e,i])=>i===t))?void 0:s[0];o=`AG Grid: unable to use ${i} as the ${r} is not registered${e.areGridScopedModules?` for gridId: ${n}`:""}. Check if you have registered the module:\n           \n    import { ModuleRegistry } from '@ag-grid-community/core';\n    import { ${r} } from '${t}';\n    \n    ModuleRegistry.registerModules([ ${r} ]);\n\nFor more info see: https://www.ag-grid.com/javascript-grid/modules/`}else o=`AG Grid: unable to use ${i} as package 'ag-grid-enterprise' has not been imported. Check that you have imported the package:\n            \n    import 'ag-grid-enterprise';`;return U(()=>{console.warn(o)},r),!1}static __isRegistered(t,i){var n;return!!e.globalModulesMap[t]||!!(null==(n=e.gridModulesMap[i])?void 0:n[t])}static __getRegisteredModules(t){return[...D(e.globalModulesMap),...D(e.gridModulesMap[t]||{})]}static __getGridRegisteredModules(t){var i;return D(null!=(i=e.gridModulesMap[t])?i:{})||[]}static __isPackageBased(){return!e.moduleBased}};se.globalModulesMap={},se.gridModulesMap={},se.areGridScopedModules=!1;var re=se,oe=class{constructor(e,t){if(this.beanWrappers={},this.destroyed=!1,!e||!e.beanClasses)return;this.contextParams=e,this.logger=t,this.logger.log(">> creating ag-Application Context"),this.createBeans();const i=this.getBeanInstances();this.wireBeans(i),this.logger.log(">> ag-Application Context ready - component is alive")}getBeanInstances(){return D(this.beanWrappers).map(e=>e.beanInstance)}createBean(e,t){if(!e)throw Error("Can't wire to bean since it is null");return this.wireBeans([e],t),e}wireBeans(e,t){this.autoWireBeans(e),this.methodWireBeans(e),this.callLifeCycleMethods(e,"preConstructMethods"),b(t)&&e.forEach(t),this.callLifeCycleMethods(e,"postConstructMethods")}createBeans(){this.contextParams.beanClasses.forEach(this.createBeanWrapper.bind(this)),P(this.beanWrappers,(e,t)=>{let i;t.bean.__agBeanMetaData&&t.bean.__agBeanMetaData.autowireMethods&&t.bean.__agBeanMetaData.autowireMethods.agConstructor&&(i=t.bean.__agBeanMetaData.autowireMethods.agConstructor);const n=this.getBeansForParameters(i,t.bean.name),s=new(t.bean.bind.apply(t.bean,[null,...n]));t.beanInstance=s});const e=Object.keys(this.beanWrappers).join(", ");this.logger.log(`created beans: ${e}`)}createBeanWrapper(e){const t=e.__agBeanMetaData;if(!t){let t;return t=e.prototype.constructor?j(e.prototype.constructor):""+e,void console.error(`Context item ${t} is not a bean`)}const i={bean:e,beanInstance:null,beanName:t.beanName};this.beanWrappers[t.beanName]=i}autoWireBeans(e){e.forEach(e=>{this.forEachMetaDataInHierarchy(e,(t,i)=>{const n=t.agClassAttributes;n&&n.forEach(t=>{const n=this.lookupBeanInstance(i,t.beanName,t.optional);e[t.attributeName]=n})})})}methodWireBeans(e){e.forEach(e=>{this.forEachMetaDataInHierarchy(e,(t,i)=>{P(t.autowireMethods,(t,n)=>{if("agConstructor"===t)return;const s=this.getBeansForParameters(n,i);e[t].apply(e,s)})})})}forEachMetaDataInHierarchy(e,t){let i=Object.getPrototypeOf(e);for(;null!=i;){const e=i.constructor;e.hasOwnProperty("__agBeanMetaData")&&t(e.__agBeanMetaData,this.getBeanName(e)),i=Object.getPrototypeOf(i)}}getBeanName(e){if(e.__agBeanMetaData&&e.__agBeanMetaData.beanName)return e.__agBeanMetaData.beanName;const t=e.toString();return t.substring(9,t.indexOf("("))}getBeansForParameters(e,t){const i=[];return e&&P(e,(e,n)=>{const s=this.lookupBeanInstance(t,n);i[Number(e)]=s}),i}lookupBeanInstance(e,t,i=!1){if(this.destroyed)return this.logger.log(`AG Grid: bean reference ${t} is used after the grid is destroyed!`),null;if("context"===t)return this;if(this.contextParams.providedBeanInstances&&this.contextParams.providedBeanInstances.hasOwnProperty(t))return this.contextParams.providedBeanInstances[t];const n=this.beanWrappers[t];return n?n.beanInstance:(i||console.error(`AG Grid: unable to find bean reference ${t} while initialising ${e}`),null)}callLifeCycleMethods(e,t){e.forEach(e=>this.callLifeCycleMethodsOnBean(e,t))}callLifeCycleMethodsOnBean(e,t,i){const n={};this.forEachMetaDataInHierarchy(e,e=>{const s=e[t];s&&s.forEach(e=>{e!=i&&(n[e]=!0)})}),Object.keys(n).forEach(t=>e[t]())}getBean(e){return this.lookupBeanInstance("getBean",e,!0)}destroy(){if(this.destroyed)return;this.destroyed=!0,this.logger.log(">> Shutting down ag-Application Context");const e=this.getBeanInstances();this.destroyBeans(e),this.contextParams.providedBeanInstances=null,re.__unRegisterGridModules(this.contextParams.gridId),this.logger.log(">> ag-Application Context shut down - component is dead")}destroyBean(e){e&&this.destroyBeans([e])}destroyBeans(e){return e?(e.forEach(e=>{this.callLifeCycleMethodsOnBean(e,"preDestroyMethods","destroy");const t=e;"function"==typeof t.destroy&&t.destroy()}),[]):[]}isDestroyed(){return this.destroyed}getGridId(){return this.contextParams.gridId}};function ae(e,t,i){const n=fe(e.constructor);n.preConstructMethods||(n.preConstructMethods=[]),n.preConstructMethods.push(t)}function le(e,t,i){const n=fe(e.constructor);n.postConstructMethods||(n.postConstructMethods=[]),n.postConstructMethods.push(t)}function ce(e,t,i){const n=fe(e.constructor);n.preDestroyMethods||(n.preDestroyMethods=[]),n.preDestroyMethods.push(t)}function he(e){return t=>{fe(t).beanName=e}}function ue(e){return(t,i,n)=>{pe(t,e,!1,0,i,null)}}function de(e){return(t,i,n)=>{pe(t,e,!0,0,i,null)}}function pe(e,t,i,n,s,r){if(null===t)return void console.error("AG Grid: Autowired name should not be null");if("number"==typeof r)return void console.error("AG Grid: Autowired should be on an attribute");const o=fe(e.constructor);o.agClassAttributes||(o.agClassAttributes=[]),o.agClassAttributes.push({attributeName:s,beanName:t,optional:i})}function ge(e){return(t,i,n)=>{const s="function"==typeof t?t:t.constructor;let r;if("number"==typeof n){let t;i?(r=fe(s),t=i):(r=fe(s),t="agConstructor"),r.autowireMethods||(r.autowireMethods={}),r.autowireMethods[t]||(r.autowireMethods[t]={}),r.autowireMethods[t][n]=e}}}function fe(e){return e.hasOwnProperty("__agBeanMetaData")||(e.__agBeanMetaData={}),e.__agBeanMetaData}var me=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(e,t,i=null,n=null){if(this.frameworkOverrides=t,this.gos=e,i){const t=e.useAsyncEvents();this.addGlobalListener(i,t)}n&&this.addGlobalListener(n,!1)}setFrameworkOverrides(e){this.frameworkOverrides=e}getListeners(e,t,i){const n=t?this.allAsyncListeners:this.allSyncListeners;let s=n.get(e);return!s&&i&&(s=new Set,n.set(e,s)),s}noRegisteredListenersExist(){return 0===this.allSyncListeners.size&&0===this.allAsyncListeners.size&&0===this.globalSyncListeners.size&&0===this.globalAsyncListeners.size}addEventListener(e,t,i=!1){this.getListeners(e,i,!0).add(t)}removeEventListener(e,t,i=!1){const n=this.getListeners(e,i,!1);n&&(n.delete(t),0===n.size)&&(i?this.allAsyncListeners:this.allSyncListeners).delete(e)}addGlobalListener(e,t=!1){(t?this.globalAsyncListeners:this.globalSyncListeners).add(e)}removeGlobalListener(e,t=!1){(t?this.globalAsyncListeners:this.globalSyncListeners).delete(e)}dispatchEvent(e){let t=e;this.gos&&this.gos.addGridCommonParams(t),this.dispatchToListeners(t,!0),this.dispatchToListeners(t,!1),this.firedEvents[t.type]=!0}dispatchEventOnce(e){this.firedEvents[e.type]||this.dispatchEvent(e)}dispatchToListeners(e,t){var i;const n=e.type;if(t&&"event"in e){const t=e.event;t instanceof Event&&(e.eventPath=t.composedPath())}const s=null!=(i=this.getListeners(n,t,!1))?i:new Set,r=new Set(s);r.size>0&&((i,n)=>{i.forEach(i=>{if(!n.has(i))return;const s=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming(()=>i(e)):()=>i(e);t?this.dispatchAsync(s):s()})})(r,s),new Set(t?this.globalAsyncListeners:this.globalSyncListeners).forEach(i=>{const s=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming(()=>i(n,e)):()=>i(n,e);t?this.dispatchAsync(s):s()})}dispatchAsync(e){this.asyncFunctionsQueue.push(e),this.scheduled||(this.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(this.flushAsyncQueue.bind(this),0)}),this.scheduled=!0)}flushAsyncQueue(){this.scheduled=!1;const e=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[],e.forEach(e=>e())}};g([f(0,ge("gridOptionsService")),f(1,ge("frameworkOverrides")),f(2,ge("globalEventListener")),f(3,ge("globalSyncEventListener"))],me.prototype,"setBeans",1),me=g([he("eventService")],me);var ye=class{constructor(e){this.frameworkOverrides=e,this.wrappedListeners=new Map,this.wrappedGlobalListeners=new Map}wrap(e){let t=e;return this.frameworkOverrides.shouldWrapOutgoing&&(t=t=>{this.frameworkOverrides.wrapOutgoing(()=>e(t))},this.wrappedListeners.set(e,t)),t}wrapGlobal(e){let t=e;return this.frameworkOverrides.shouldWrapOutgoing&&(t=(t,i)=>{this.frameworkOverrides.wrapOutgoing(()=>e(t,i))},this.wrappedGlobalListeners.set(e,t)),t}unwrap(e){var t;return null!=(t=this.wrappedListeners.get(e))?t:e}unwrapGlobal(e){var t;return null!=(t=this.wrappedGlobalListeners.get(e))?t:e}},ve={resizable:!0,sortable:!0},be=0;function Ce(){return be++}var we=class e{constructor(e,t,i,n){this.instanceId=Ce(),this.autoHeaderHeight=null,this.moving=!1,this.menuVisible=!1,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.filterActive=!1,this.eventService=new me,this.tooltipEnabled=!1,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.colDef=e,this.userProvidedColDef=t,this.colId=i,this.primary=n,this.setState(e)}getInstanceId(){return this.instanceId}setState(e){void 0!==e.sort?"asc"!==e.sort&&"desc"!==e.sort||(this.sort=e.sort):"asc"!==e.initialSort&&"desc"!==e.initialSort||(this.sort=e.initialSort);const t=e.sortIndex,i=e.initialSortIndex;void 0!==t?null!==t&&(this.sortIndex=t):null!==i&&(this.sortIndex=i);const n=e.hide,s=e.initialHide;this.visible=void 0!==n?!n:!s,void 0!==e.pinned?this.setPinned(e.pinned):this.setPinned(e.initialPinned);const r=e.flex,o=e.initialFlex;void 0!==r?this.flex=r:void 0!==o&&(this.flex=o)}setColDef(e,t,i){this.colDef=e,this.userProvidedColDef=t,this.initMinAndMaxWidths(),this.initDotNotation(),this.initTooltip(),this.eventService.dispatchEvent(this.createColumnEvent("colDefChanged",i))}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=b(this.colDef.field)&&this.colDef.field.indexOf(".")>=0&&!e,this.tooltipFieldContainsDots=b(this.colDef.tooltipField)&&this.colDef.tooltipField.indexOf(".")>=0&&!e}initMinAndMaxWidths(){var e,t;const i=this.colDef;this.minWidth=null!=(e=i.minWidth)?e:this.environment.getMinColWidth(),this.maxWidth=null!=(t=i.maxWidth)?t:Number.MAX_SAFE_INTEGER}initTooltip(){this.tooltipEnabled=b(this.colDef.tooltipField)||b(this.colDef.tooltipValueGetter)||b(this.colDef.tooltipComponent)}resetActualWidth(e){const t=this.calculateColInitialWidth(this.colDef);this.setActualWidth(t,e,!0)}calculateColInitialWidth(e){var t,i;const n=null!=(t=e.minWidth)?t:this.environment.getMinColWidth(),s=null!=(i=e.maxWidth)?i:Number.MAX_SAFE_INTEGER;let r;const o=x(e.width),a=x(e.initialWidth);return r=null!=o?o:null!=a?a:200,Math.max(Math.min(r,s),n)}isEmptyGroup(){return!1}isRowGroupDisplayed(e){if(C(this.colDef)||C(this.colDef.showRowGroup))return!1;const t=!0===this.colDef.showRowGroup,i=this.colDef.showRowGroup===e;return t||i}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 i,n;this.frameworkOverrides.shouldWrapOutgoing&&!this.frameworkEventListenerService&&(this.eventService.setFrameworkOverrides(this.frameworkOverrides),this.frameworkEventListenerService=new ye(this.frameworkOverrides));const s=null!=(n=null==(i=this.frameworkEventListenerService)?void 0:i.wrap(t))?n:t;this.eventService.addEventListener(e,s)}removeEventListener(e,t){var i,n;const s=null!=(n=null==(i=this.frameworkEventListenerService)?void 0:i.unwrap(t))?n:t;this.eventService.removeEventListener(e,s)}createColumnFunctionCallbackParams(e){return this.gos.addGridCommonParams({node:e,data:e.data,column:this,colDef:this.colDef})}isSuppressNavigable(e){if("boolean"==typeof this.colDef.suppressNavigable)return this.colDef.suppressNavigable;if("function"==typeof this.colDef.suppressNavigable){const t=this.createColumnFunctionCallbackParams(e);return(0,this.colDef.suppressNavigable)(t)}return!1}isCellEditable(e){return!(e.group&&!this.gos.get("enableGroupEdit"))&&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 null!=(t=this.colDef[e])?t:ve[e]}isColumnFunc(e,t){return"boolean"==typeof t?t:"function"==typeof t&&t(this.createColumnFunctionCallbackParams(e))}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"asc"===this.sort}isSortDescending(){return"desc"===this.sort}isSortNone(){return C(this.sort)}isSorting(){return b(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,i){this.filterActive!==e&&(this.filterActive=e,this.eventService.dispatchEvent(this.createColumnEvent("filterActiveChanged",t)));const n=this.createColumnEvent("filterChanged",t);i&&O(n,i),this.eventService.dispatchEvent(n)}isHovered(){return this.columnHoverService.isHovered(this)}setPinned(e){this.pinned=!0===e||"left"===e?"left":"right"===e?"right":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"left"===this.pinned||"right"===this.pinned}isPinnedLeft(){return"left"===this.pinned}isPinnedRight(){return"right"===this.pinned}getPinned(){return this.pinned}setVisible(e,t){const i=!0===e;this.visible!==i&&(this.visible=i,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 i=!0;for(;e;){if(!e.isPadding()){i=!1;break}e=e.getParent()}return{numberOfParents:t,isSpanningTotal:i}}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(C(this.colDef.colSpan))return 1;const t=this.createBaseColDefParams(e),i=this.colDef.colSpan(t);return Math.max(i,1)}getRowSpan(e){if(C(this.colDef.rowSpan))return 1;const t=this.createBaseColDefParams(e),i=this.colDef.rowSpan(t);return Math.max(i,1)}setActualWidth(e,t,i=!1){null!=this.minWidth&&(e=Math.max(e,this.minWidth)),null!=this.maxWidth&&(e=Math.min(e,this.maxWidth)),this.actualWidth!==e&&(this.actualWidth=e,this.flex&&"flex"!==t&&"gridInitializing"!==t&&(this.flex=null),i||this.fireColumnWidthChangedEvent(t)),this.dispatchStateUpdatedEvent("width")}fireColumnWidthChangedEvent(e){this.eventService.dispatchEvent(this.createColumnEvent("widthChanged",e))}isGreaterThanMax(e){return null!=this.maxWidth&&e>this.maxWidth}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){b(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!0===this.colDef.enablePivot}isAllowValue(){return!0===this.colDef.enableValue}isAllowRowGroup(){return!0===this.colDef.enableRowGroup}getMenuTabs(e){z("As of v31.1, 'getMenuTabs' is deprecated. Use 'getColDef().menuTabs ?? defaultValues' instead.");let t=this.getColDef().menuTabs;return null==t&&(t=e),t}dispatchStateUpdatedEvent(t){this.eventService.dispatchEvent({type:e.EVENT_STATE_UPDATED,key:t})}};we.EVENT_MOVING_CHANGED="movingChanged",we.EVENT_LEFT_CHANGED="leftChanged",we.EVENT_WIDTH_CHANGED="widthChanged",we.EVENT_LAST_LEFT_PINNED_CHANGED="lastLeftPinnedChanged",we.EVENT_FIRST_RIGHT_PINNED_CHANGED="firstRightPinnedChanged",we.EVENT_VISIBLE_CHANGED="visibleChanged",we.EVENT_FILTER_CHANGED="filterChanged",we.EVENT_FILTER_ACTIVE_CHANGED="filterActiveChanged",we.EVENT_SORT_CHANGED="sortChanged",we.EVENT_COL_DEF_CHANGED="colDefChanged",we.EVENT_MENU_VISIBLE_CHANGED="menuVisibleChanged",we.EVENT_ROW_GROUP_CHANGED="columnRowGroupChanged",we.EVENT_PIVOT_CHANGED="columnPivotChanged",we.EVENT_VALUE_CHANGED="columnValueChanged",we.EVENT_STATE_UPDATED="columnStateUpdated",g([ue("gridOptionsService")],we.prototype,"gos",2),g([ue("environment")],we.prototype,"environment",2),g([ue("columnHoverService")],we.prototype,"columnHoverService",2),g([ue("frameworkOverrides")],we.prototype,"frameworkOverrides",2),g([le],we.prototype,"initialise",1);var Se=we,xe=class e{constructor(e,t,i,n){this.localEventService=new me,this.expandable=!1,this.instanceId=Ce(),this.expandableListenerRemoveCallback=null,this.colGroupDef=e,this.groupId=t,this.expanded=!!e&&!!e.openByDefault,this.padding=i,this.level=n}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())}isPadding(){return this.padding}setExpanded(t){this.expanded=void 0!==t&&t;const i={type:e.EVENT_EXPANDED_CHANGED};this.localEventService.dispatchEvent(i)}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(t){this.children&&this.children.forEach(i=>{i instanceof Se?t.push(i):i instanceof e&&i.addLeafColumns(t)})}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 t=!1,i=!1,n=!1;const s=this.findChildrenRemovingPadding();for(let e=0,r=s.length;e<r;e++){const r=s[e];if(!r.isVisible())continue;const o=r.getColumnGroupShow();"open"===o?(t=!0,n=!0):"closed"===o?(i=!0,n=!0):(t=!0,i=!0)}const r=t&&i&&n;if(this.expandable!==r){this.expandable=r;const t={type:e.EVENT_EXPANDABLE_CHANGED};this.localEventService.dispatchEvent(t)}}findChildrenRemovingPadding(){const t=[],i=n=>{n.forEach(n=>{n instanceof e&&n.isPadding()?i(n.children):t.push(n)})};return i(this.children),t}onColumnVisibilityChanged(){this.setExpandable()}addEventListener(e,t){this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService.removeEventListener(e,t)}};xe.EVENT_EXPANDED_CHANGED="expandedChanged",xe.EVENT_EXPANDABLE_CHANGED="expandableChanged",g([ce],xe.prototype,"destroy",1);var Ee=xe,Ae={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}},Me={};p(Me,{addSafePassiveEventListener:()=>it,createEventPath:()=>et,getCtrlForEventTarget:()=>Qe,getEventPath:()=>tt,isElementInEventPath:()=>Je,isEventSupported:()=>Ze,isStopPropagationForAgGrid:()=>Xe,stopPropagationForAgGrid:()=>qe});var Te={};function De(e){return null!=e&&e.length>0}function Ie(e){if(e&&e.length)return e[e.length-1]}function Re(e,t,i){return null==e&&null==t||null!=e&&null!=t&&e.length===t.length&&e.every((e,n)=>i?i(e,t[n]):t[n]===e)}function ke(e,t){return Re(e,t)}function Pe(e){return e.sort((e,t)=>e-t)}function _e(e,t){if(e)for(let i=e.length-2;i>=0;i--){const n=e[i]===t,s=e[i+1]===t;n&&s&&e.splice(i+1,1)}}function Le(e,t){const i=e.indexOf(t);i>=0&&(e[i]=e[e.length-1],e.pop())}function Ne(e,t){const i=e.indexOf(t);i>=0&&e.splice(i,1)}function Oe(e,t){for(let i=0;i<t.length;i++)Le(e,t[i])}function Fe(e,t){for(let i=0;i<t.length;i++)Ne(e,t[i])}function Ge(e,t,i){e.splice(i,0,t)}function Be(e,t,i){if(null!=e&&null!=t)for(let n=t.length-1;n>=0;n--)Ge(e,t[n],i)}function Ve(e,t,i){Fe(e,t),t.slice().reverse().forEach(t=>Ge(e,t,i))}function He(e,t){return e.indexOf(t)>-1}function Ue(e){return[].concat.apply([],e)}function ze(e,t){null!=t&&null!=e&&t.forEach(t=>e.push(t))}function We(e){return e.map(S)}function je(e,t){if(null!=e)for(let i=e.length-1;i>=0;i--)t(e[i],i)}p(Te,{areEqual:()=>Re,existsAndNotEmpty:()=>De,flatten:()=>Ue,forEachReverse:()=>je,includes:()=>He,insertArrayIntoArray:()=>Be,insertIntoArray:()=>Ge,last:()=>Ie,moveInArray:()=>Ve,pushAll:()=>ze,removeAllFromArray:()=>Fe,removeAllFromUnorderedArray:()=>Oe,removeFromArray:()=>Ne,removeFromUnorderedArray:()=>Le,removeRepeatsFromArray:()=>_e,shallowCompare:()=>ke,sortNumerically:()=>Pe,toStrings:()=>We});var $e="__ag_Grid_Stop_Propagation",Ke=["touchstart","touchend","touchmove","touchcancel","scroll"],Ye={};function qe(e){e[$e]=!0}function Xe(e){return!0===e[$e]}var Ze=(()=>{const e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return t=>{if("boolean"==typeof Ye[t])return Ye[t];const i=document.createElement(e[t]||"div");return Ye[t="on"+t]=t in i}})();function Qe(e,t,i){let n=t;for(;n;){const t=e.getDomData(n,i);if(t)return t;n=n.parentElement}return null}function Je(e,t){return!(!t||!e)&&tt(t).indexOf(e)>=0}function et(e){const t=[];let i=e.target;for(;i;)t.push(i),i=i.parentElement;return t}function tt(e){const t=e;return t.path?t.path:t.composedPath?t.composedPath():et(t)}function it(e,t,i,n){const s=He(Ke,i)?{passive:!0}:void 0;e&&e.addEventListener&&e.addEventListener(t,i,n,s)}var nt=class e{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:e.EVENT_DESTROYED})}addEventListener(e,t){this.localEventService||(this.localEventService=new me),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,i){if(this.destroyed)return;e instanceof HTMLElement?it(this.getFrameworkOverrides(),e,t,i):e.addEventListener(t,i);const n=()=>(e.removeEventListener(t,i),null);return this.destroyFunctions.push(n),()=>(n(),this.destroyFunctions=this.destroyFunctions.filter(e=>e!==n),null)}setupGridOptionListener(e,t){this.gos.addEventListener(e,t);const i=()=>(this.gos.removeEventListener(e,t),null);return this.destroyFunctions.push(i),()=>(i(),this.destroyFunctions=this.destroyFunctions.filter(e=>e!==i),null)}addManagedPropertyListener(e,t){return this.destroyed?()=>null:this.setupGridOptionListener(e,t)}addManagedPropertyListeners(e,t){if(this.destroyed)return;const i=e.join("-")+this.propertyListenerId++,n=e=>{if(e.changeSet){if(e.changeSet&&e.changeSet.id===this.lastChangeSetIdLookup[i])return;this.lastChangeSetIdLookup[i]=e.changeSet.id}const n={type:"gridPropertyChanged",changeSet:e.changeSet,source:e.source};t(n)};e.forEach(e=>this.setupGridOptionListener(e,n))}addDestroyFunc(e){this.isAlive()?this.destroyFunctions.push(e):e()}createManagedBean(e,t){const i=this.createBean(e,t);return this.addDestroyFunc(this.destroyBean.bind(this,e,t)),i}createBean(e,t,i){return(t||this.getContext()).createBean(e,i)}destroyBean(e,t){return(t||this.getContext()).destroyBean(e)}destroyBeans(e,t){if(e)for(let i=0;i<e.length;i++)this.destroyBean(e[i],t);return[]}};nt.EVENT_DESTROYED="destroyed",g([ue("frameworkOverrides")],nt.prototype,"frameworkOverrides",2),g([ue("context")],nt.prototype,"context",2),g([ue("eventService")],nt.prototype,"eventService",2),g([ue("gridOptionsService")],nt.prototype,"gos",2),g([ue("localeService")],nt.prototype,"localeService",2),g([ue("environment")],nt.prototype,"environment",2),g([ce],nt.prototype,"destroy",1);var st=nt,rt=class extends st{setBeans(e){this.logger=e.create("ColumnFactory")}createColumnTree(e,t,i,n){const s=new I,{existingCols:r,existingGroups:o,existingColKeys:a}=this.extractExistingTreeData(i);s.addExistingKeys(a);const l=this.recursivelyCreateColumns(e,0,t,r,s,o,n),c=this.findMaxDept(l,0);this.logger.log("Number of levels for grouped columns is "+c);const h=this.balanceColumnTree(l,0,c,s);return ot(null,h,(e,t)=>{e instanceof Ee&&e.setupExpandable(),e.setOriginalParent(t)}),{columnTree:h,treeDept:c}}extractExistingTreeData(e){const t=[],i=[],n=[];return e&&ot(null,e,e=>{if(e instanceof Ee){const t=e;i.push(t)}else{const i=e;n.push(i.getId()),t.push(i)}}),{existingCols:t,existingGroups:i,existingColKeys:n}}createForAutoGroups(e,t){return e.map(e=>this.createAutoGroupTreeItem(t,e))}createAutoGroupTreeItem(e,t){const i=this.findDepth(e);let n=t;for(let e=i-1;e>=0;e--){const i=new Ee(null,`FAKE_PATH_${t.getId()}}_${e}`,!0,e);this.createBean(i),i.setChildren([n]),n.setOriginalParent(i),n=i}return 0===i&&t.setOriginalParent(null),n}findDepth(e){let t=0,i=e;for(;i&&i[0]&&i[0]instanceof Ee;)t++,i=i[0].getChildren();return t}balanceColumnTree(e,t,i,n){const s=[];for(let r=0;r<e.length;r++){const o=e[r];if(o instanceof Ee){const e=o,r=this.balanceColumnTree(e.getChildren(),t+1,i,n);e.setChildren(r),s.push(e)}else{let r,a;for(let e=i-1;e>=t;e--){const e=n.getUniqueKey(null,null),i=this.createMergedColGroupDef(null),s=new Ee(i,e,!0,t);this.createBean(s),a&&a.setChildren([s]),a=s,r||(r=a)}if(r&&a){if(s.push(r),e.some(e=>e instanceof Ee)){a.setChildren([o]);continue}a.setChildren(e);break}s.push(o)}}return s}findMaxDept(e,t){let i=t;for(let n=0;n<e.length;n++){const s=e[n];if(s instanceof Ee){const e=s,n=this.findMaxDept(e.getChildren(),t+1);i<n&&(i=n)}}return i}recursivelyCreateColumns(e,t,i,n,s,r,o){if(!e)return[];const a=new Array(e.length);for(let l=0;l<a.length;l++){const c=e[l];this.isColumnGroup(c)?a[l]=this.createColumnGroup(i,c,t,n,s,r,o):a[l]=this.createColumn(i,c,n,s,o)}return a}createColumnGroup(e,t,i,n,s,r,o){const a=this.createMergedColGroupDef(t),l=s.getUniqueKey(a.groupId||null,null),c=new Ee(a,l,!1,i);this.createBean(c);const h=this.findExistingGroup(t,r);h&&r.splice(h.idx,1);let u=null==h?void 0:h.group;u&&c.setExpanded(u.isExpanded());const d=this.recursivelyCreateColumns(a.children,i+1,e,n,s,r,o);return c.setChildren(d),c}createMergedColGroupDef(e){const t={};return Object.assign(t,this.gos.get("defaultColGroupDef")),Object.assign(t,e),t}createColumn(e,t,i,n,s){const r=this.findExistingColumn(t,i);r&&(null==i||i.splice(r.idx,1));let o=null==r?void 0:r.column;if(o){const e=this.addColumnDefaultAndTypes(t,o.getColId());o.setColDef(e,t,s),this.applyColumnState(o,e,s)}else{const i=n.getUniqueKey(t.colId,t.field),s=this.addColumnDefaultAndTypes(t,i);o=new Se(s,t,i,e),this.context.createBean(o)}return this.dataTypeService.addColumnListeners(o),o}applyColumnState(e,t,i){const n=x(t.flex);if(void 0!==n&&e.setFlex(n),e.getFlex()<=0){const n=x(t.width);if(null!=n)e.setActualWidth(n,i);else{const t=e.getActualWidth();e.setActualWidth(t,i)}}void 0!==t.sort&&("asc"==t.sort||"desc"==t.sort?e.setSort(t.sort,i):e.setSort(void 0,i));const s=x(t.sortIndex);void 0!==s&&e.setSortIndex(s);const r=E(t.hide);void 0!==r&&e.setVisible(!r,i),void 0!==t.pinned&&e.setPinned(t.pinned)}findExistingColumn(e,t){if(t)for(let i=0;i<t.length;i++){const n=t[i].getUserProvidedColDef();if(n)if(null==e.colId){if(null!=e.field){if(n.field===e.field)return{idx:i,column:t[i]}}else if(n===e)return{idx:i,column:t[i]}}else if(t[i].getId()===e.colId)return{idx:i,column:t[i]}}}findExistingGroup(e,t){if(null!=e.groupId)for(let i=0;i<t.length;i++){const n=t[i];if(n.getColGroupDef()&&n.getId()===e.groupId)return{idx:i,group:n}}}addColumnDefaultAndTypes(e,t){const i={};O(i,this.gos.get("defaultColDef"),!1,!0);const n=this.dataTypeService.updateColDefAndGetColumnType(i,e,t);n&&this.assignColumnTypes(n,i),O(i,e,!1,!0);const s=this.gos.get("autoGroupColumnDef"),r=this.gos.isColumnsSortingCoupledToGroup();return e.rowGroup&&s&&r&&O(i,{sort:s.sort,initialSort:s.initialSort},!1,!0),this.dataTypeService.validateColDef(i),i}assignColumnTypes(e,t){if(!e.length)return;const i=Object.assign({},Ae);P(this.gos.get("columnTypes")||{},(e,t)=>{e in i?console.warn(`AG Grid: the column type '${e}' is a default column type and cannot be overridden.`):(t.type&&z("Column type definitions 'columnTypes' with a 'type' attribute are not supported because a column type cannot refer to another column type. Only column definitions 'columnDefs' can use the 'type' attribute to refer to a column type."),i[e]=t)}),e.forEach(e=>{const n=i[e.trim()];n?O(t,n,!1,!0):console.warn("AG Grid: colDef.type '"+e+"' does not correspond to defined gridOptions.columnTypes")})}isColumnGroup(e){return void 0!==e.children}};function ot(e,t,i){if(t)for(let n=0;n<t.length;n++){const s=t[n];s instanceof Ee&&ot(s,s.getChildren(),i),i(s,e)}}g([ue("dataTypeService")],rt.prototype,"dataTypeService",2),g([f(0,ge("loggerFactory"))],rt.prototype,"setBeans",1),rt=g([he("columnFactory")],rt);var at=class e{constructor(e,t,i,n){this.displayedChildren=[],this.localEventService=new me,this.groupId=t,this.partId=i,this.providedColumnGroup=e,this.pinned=n}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 e.createUniqueId(this.groupId,this.partId)}isEmptyGroup(){return 0===this.displayedChildren.length}isMoving(){const e=this.getProvidedColumnGroup().getLeafColumns();return!(!e||0===e.length)&&e.every(e=>e.isMoving())}checkLeft(){if(this.displayedChildren.forEach(t=>{t instanceof e&&t.checkLeft()}),this.displayedChildren.length>0)if(this.gos.get("enableRtl")){const e=Ie(this.displayedChildren).getLeft();this.setLeft(e)}else{const e=this.displayedChildren[0].getLeft();this.setLeft(e)}else this.setLeft(null)}getLeft(){return this.left}getOldLeft(){return this.oldLeft}setLeft(t){this.oldLeft=this.left,this.left!==t&&(this.left=t,this.localEventService.dispatchEvent(this.createAgEvent(e.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(t){let i=!1;return this.children.forEach(n=>{t===n&&(i=!0),n instanceof e&&n.isChildInThisGroupDeepSearch(t)&&(i=!0)}),i}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(t){this.displayedChildren.forEach(i=>{i instanceof Se?t.push(i):i instanceof e&&i.addDisplayedLeafColumns(t)})}addLeafColumns(t){this.children.forEach(i=>{i instanceof Se?t.push(i):i instanceof e&&i.addLeafColumns(t)})}getChildren(){return this.children}getColumnGroupShow(){return this.providedColumnGroup.getColumnGroupShow()}getProvidedColumnGroup(){return this.providedColumnGroup}getPaddingLevel(){const e=this.getParent();return this.isPadding()&&e&&e.isPadding()?1+e.getPaddingLevel():0}calculateDisplayedColumns(){this.displayedChildren=[];let t=this;for(;null!=t&&t.isPadding();)t=t.getParent();if(!t||!t.providedColumnGroup.isExpandable())return this.displayedChildren=this.children,void this.localEventService.dispatchEvent(this.createAgEvent(e.EVENT_DISPLAYED_CHILDREN_CHANGED));this.children.forEach(i=>{if(!(i instanceof e)||i.displayedChildren&&i.displayedChildren.length)switch(i.getColumnGroupShow()){case"open":t.providedColumnGroup.isExpanded()&&this.displayedChildren.push(i);break;case"closed":t.providedColumnGroup.isExpanded()||this.displayedChildren.push(i);break;default:this.displayedChildren.push(i)}}),this.localEventService.dispatchEvent(this.createAgEvent(e.EVENT_DISPLAYED_CHILDREN_CHANGED))}};at.EVENT_LEFT_CHANGED="leftChanged",at.EVENT_DISPLAYED_CHILDREN_CHANGED="displayedChildrenChanged",g([ue("gridOptionsService")],at.prototype,"gos",2);var lt=at,ct=class{};ct.EVENT_COLUMN_EVERYTHING_CHANGED="columnEverythingChanged",ct.EVENT_NEW_COLUMNS_LOADED="newColumnsLoaded",ct.EVENT_COLUMN_PIVOT_MODE_CHANGED="columnPivotModeChanged",ct.EVENT_PIVOT_MAX_COLUMNS_EXCEEDED="pivotMaxColumnsExceeded",ct.EVENT_COLUMN_ROW_GROUP_CHANGED="columnRowGroupChanged",ct.EVENT_EXPAND_COLLAPSE_ALL="expandOrCollapseAll",ct.EVENT_COLUMN_PIVOT_CHANGED="columnPivotChanged",ct.EVENT_GRID_COLUMNS_CHANGED="gridColumnsChanged",ct.EVENT_COLUMN_VALUE_CHANGED="columnValueChanged",ct.EVENT_COLUMN_MOVED="columnMoved",ct.EVENT_COLUMN_VISIBLE="columnVisible",ct.EVENT_COLUMN_PINNED="columnPinned",ct.EVENT_COLUMN_GROUP_OPENED="columnGroupOpened",ct.EVENT_COLUMN_RESIZED="columnResized",ct.EVENT_DISPLAYED_COLUMNS_CHANGED="displayedColumnsChanged",ct.EVENT_SUPPRESS_COLUMN_MOVE_CHANGED="suppressMovableColumns",ct.EVENT_SUPPRESS_MENU_HIDE_CHANGED="suppressMenuHide",ct.EVENT_SUPPRESS_FIELD_DOT_NOTATION="suppressFieldDotNotation",ct.EVENT_VIRTUAL_COLUMNS_CHANGED="virtualColumnsChanged",ct.EVENT_COLUMN_HEADER_MOUSE_OVER="columnHeaderMouseOver",ct.EVENT_COLUMN_HEADER_MOUSE_LEAVE="columnHeaderMouseLeave",ct.EVENT_COLUMN_HEADER_CLICKED="columnHeaderClicked",ct.EVENT_COLUMN_HEADER_CONTEXT_MENU="columnHeaderContextMenu",ct.EVENT_ASYNC_TRANSACTIONS_FLUSHED="asyncTransactionsFlushed",ct.EVENT_ROW_GROUP_OPENED="rowGroupOpened",ct.EVENT_ROW_DATA_UPDATED="rowDataUpdated",ct.EVENT_PINNED_ROW_DATA_CHANGED="pinnedRowDataChanged",ct.EVENT_RANGE_SELECTION_CHANGED="rangeSelectionChanged",ct.EVENT_CHART_CREATED="chartCreated",ct.EVENT_CHART_RANGE_SELECTION_CHANGED="chartRangeSelectionChanged",ct.EVENT_CHART_OPTIONS_CHANGED="chartOptionsChanged",ct.EVENT_CHART_DESTROYED="chartDestroyed",ct.EVENT_TOOL_PANEL_VISIBLE_CHANGED="toolPanelVisibleChanged",ct.EVENT_TOOL_PANEL_SIZE_CHANGED="toolPanelSizeChanged",ct.EVENT_COLUMN_PANEL_ITEM_DRAG_START="columnPanelItemDragStart",ct.EVENT_COLUMN_PANEL_ITEM_DRAG_END="columnPanelItemDragEnd",ct.EVENT_MODEL_UPDATED="modelUpdated",ct.EVENT_CUT_START="cutStart",ct.EVENT_CUT_END="cutEnd",ct.EVENT_PASTE_START="pasteStart",ct.EVENT_PASTE_END="pasteEnd",ct.EVENT_FILL_START="fillStart",ct.EVENT_FILL_END="fillEnd",ct.EVENT_RANGE_DELETE_START="rangeDeleteStart",ct.EVENT_RANGE_DELETE_END="rangeDeleteEnd",ct.EVENT_UNDO_STARTED="undoStarted",ct.EVENT_UNDO_ENDED="undoEnded",ct.EVENT_REDO_STARTED="redoStarted",ct.EVENT_REDO_ENDED="redoEnded",ct.EVENT_KEY_SHORTCUT_CHANGED_CELL_START="keyShortcutChangedCellStart",ct.EVENT_KEY_SHORTCUT_CHANGED_CELL_END="keyShortcutChangedCellEnd",ct.EVENT_CELL_CLICKED="cellClicked",ct.EVENT_CELL_DOUBLE_CLICKED="cellDoubleClicked",ct.EVENT_CELL_MOUSE_DOWN="cellMouseDown",ct.EVENT_CELL_CONTEXT_MENU="cellContextMenu",ct.EVENT_CELL_VALUE_CHANGED="cellValueChanged",ct.EVENT_CELL_EDIT_REQUEST="cellEditRequest",ct.EVENT_ROW_VALUE_CHANGED="rowValueChanged",ct.EVENT_CELL_FOCUSED="cellFocused",ct.EVENT_CELL_FOCUS_CLEARED="cellFocusCleared",ct.EVENT_FULL_WIDTH_ROW_FOCUSED="fullWidthRowFocused",ct.EVENT_ROW_SELECTED="rowSelected",ct.EVENT_SELECTION_CHANGED="selectionChanged",ct.EVENT_TOOLTIP_SHOW="tooltipShow",ct.EVENT_TOOLTIP_HIDE="tooltipHide",ct.EVENT_CELL_KEY_DOWN="cellKeyDown",ct.EVENT_CELL_MOUSE_OVER="cellMouseOver",ct.EVENT_CELL_MOUSE_OUT="cellMouseOut",ct.EVENT_FILTER_CHANGED="filterChanged",ct.EVENT_FILTER_MODIFIED="filterModified",ct.EVENT_FILTER_OPENED="filterOpened",ct.EVENT_ADVANCED_FILTER_BUILDER_VISIBLE_CHANGED="advancedFilterBuilderVisibleChanged",ct.EVENT_SORT_CHANGED="sortChanged",ct.EVENT_VIRTUAL_ROW_REMOVED="virtualRowRemoved",ct.EVENT_ROW_CLICKED="rowClicked",ct.EVENT_ROW_DOUBLE_CLICKED="rowDoubleClicked",ct.EVENT_GRID_READY="gridReady",ct.EVENT_GRID_PRE_DESTROYED="gridPreDestroyed",ct.EVENT_GRID_SIZE_CHANGED="gridSizeChanged",ct.EVENT_VIEWPORT_CHANGED="viewportChanged",ct.EVENT_SCROLLBAR_WIDTH_CHANGED="scrollbarWidthChanged",ct.EVENT_FIRST_DATA_RENDERED="firstDataRendered",ct.EVENT_DRAG_STARTED="dragStarted",ct.EVENT_DRAG_STOPPED="dragStopped",ct.EVENT_CHECKBOX_CHANGED="checkboxChanged",ct.EVENT_ROW_EDITING_STARTED="rowEditingStarted",ct.EVENT_ROW_EDITING_STOPPED="rowEditingStopped",ct.EVENT_CELL_EDITING_STARTED="cellEditingStarted",ct.EVENT_CELL_EDITING_STOPPED="cellEditingStopped",ct.EVENT_BODY_SCROLL="bodyScroll",ct.EVENT_BODY_SCROLL_END="bodyScrollEnd",ct.EVENT_HEIGHT_SCALE_CHANGED="heightScaleChanged",ct.EVENT_PAGINATION_CHANGED="paginationChanged",ct.EVENT_COMPONENT_STATE_CHANGED="componentStateChanged",ct.EVENT_STORE_REFRESHED="storeRefreshed",ct.EVENT_STATE_UPDATED="stateUpdated",ct.EVENT_COLUMN_MENU_VISIBLE_CHANGED="columnMenuVisibleChanged",ct.EVENT_CONTEXT_MENU_VISIBLE_CHANGED="contextMenuVisibleChanged",ct.EVENT_BODY_HEIGHT_CHANGED="bodyHeightChanged",ct.EVENT_COLUMN_CONTAINER_WIDTH_CHANGED="columnContainerWidthChanged",ct.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED="displayedColumnsWidthChanged",ct.EVENT_SCROLL_VISIBILITY_CHANGED="scrollVisibilityChanged",ct.EVENT_COLUMN_HOVER_CHANGED="columnHoverChanged",ct.EVENT_FLASH_CELLS="flashCells",ct.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED="paginationPixelOffsetChanged",ct.EVENT_DISPLAYED_ROWS_CHANGED="displayedRowsChanged",ct.EVENT_LEFT_PINNED_WIDTH_CHANGED="leftPinnedWidthChanged",ct.EVENT_RIGHT_PINNED_WIDTH_CHANGED="rightPinnedWidthChanged",ct.EVENT_ROW_CONTAINER_HEIGHT_CHANGED="rowContainerHeightChanged",ct.EVENT_HEADER_HEIGHT_CHANGED="headerHeightChanged",ct.EVENT_COLUMN_HEADER_HEIGHT_CHANGED="columnHeaderHeightChanged",ct.EVENT_ROW_DRAG_ENTER="rowDragEnter",ct.EVENT_ROW_DRAG_MOVE="rowDragMove",ct.EVENT_ROW_DRAG_LEAVE="rowDragLeave",ct.EVENT_ROW_DRAG_END="rowDragEnd",ct.EVENT_GRID_STYLES_CHANGED="gridStylesChanged",ct.EVENT_COLUMN_ROW_GROUP_CHANGE_REQUEST="columnRowGroupChangeRequest",ct.EVENT_COLUMN_PIVOT_CHANGE_REQUEST="columnPivotChangeRequest",ct.EVENT_COLUMN_VALUE_CHANGE_REQUEST="columnValueChangeRequest",ct.EVENT_COLUMN_AGG_FUNC_CHANGE_REQUEST="columnAggFuncChangeRequest",ct.EVENT_STORE_UPDATED="storeUpdated",ct.EVENT_FILTER_DESTROYED="filterDestroyed",ct.EVENT_ROW_DATA_UPDATE_STARTED="rowDataUpdateStarted",ct.EVENT_ROW_COUNT_READY="rowCountReady",ct.EVENT_ADVANCED_FILTER_ENABLED_CHANGED="advancedFilterEnabledChanged",ct.EVENT_DATA_TYPES_INFERRED="dataTypesInferred",ct.EVENT_FIELD_VALUE_CHANGED="fieldValueChanged",ct.EVENT_FIELD_PICKER_VALUE_SELECTED="fieldPickerValueSelected",ct.EVENT_SIDE_BAR_UPDATED="sideBarUpdated";var ht=new Set([ct.EVENT_GRID_PRE_DESTROYED,ct.EVENT_FILL_START]),ut=class{constructor(){this.existingIds={}}getInstanceIdForKey(e){const t=this.existingIds[e];let i;return i="number"!=typeof t?0:t+1,this.existingIds[e]=i,i}},dt="ag-Grid-AutoColumn",pt=class extends st{createAutoGroupColumns(e){const t=[],i=this.gos.get("treeData");let n=this.gos.isGroupMultiAutoColumn();return i&&n&&(console.warn('AG Grid: you cannot mix groupDisplayType = "multipleColumns" with treeData, only one column can be used to display groups when doing tree data'),n=!1),n?e.forEach((e,i)=>{t.push(this.createOneAutoGroupColumn(e,i))}):t.push(this.createOneAutoGroupColumn()),t}updateAutoGroupColumns(e,t){e.forEach((e,i)=>this.updateOneAutoGroupColumn(e,i,t))}createOneAutoGroupColumn(e,t){let i;i=e?`${dt}-${e.getId()}`:dt;const n=this.createAutoGroupColDef(i,e,t);n.colId=i;const s=new Se(n,null,i,!0);return this.context.createBean(s),s}updateOneAutoGroupColumn(e,t,i){const n=e.getColDef(),s="string"==typeof n.showRowGroup?n.showRowGroup:void 0,r=null!=s?this.columnModel.getPrimaryColumn(s):void 0,o=this.createAutoGroupColDef(e.getId(),null!=r?r:void 0,t);e.setColDef(o,null,i),this.columnFactory.applyColumnState(e,o,i)}createAutoGroupColDef(e,t,i){let n=this.createBaseColDef(t);O(n,this.gos.get("autoGroupColumnDef")),n=this.columnFactory.addColumnDefaultAndTypes(n,e),this.gos.get("treeData")||C(n.field)&&C(n.valueGetter)&&C(n.filterValueGetter)&&"agGroupColumnFilter"!==n.filter&&(n.filter=!1),i&&i>0&&(n.headerCheckboxSelection=!1);const s=this.gos.isColumnsSortingCoupledToGroup(),r=n.valueGetter||null!=n.field;return s&&!r&&(n.sortIndex=void 0,n.initialSort=void 0),n}createBaseColDef(e){const t=this.gos.get("autoGroupColumnDef"),i={headerName:this.localeService.getLocaleTextFunc()("group","Group")};if(t&&(t.cellRenderer||t.cellRendererSelector)||(i.cellRenderer="agGroupCellRenderer"),e){const t=e.getColDef();Object.assign(i,{headerName:this.columnModel.getDisplayNameForColumn(e,"header"),headerValueGetter:t.headerValueGetter}),t.cellRenderer&&Object.assign(i,{cellRendererParams:{innerRenderer:t.cellRenderer,innerRendererParams:t.cellRendererParams}}),i.showRowGroup=e.getColId()}else i.showRowGroup=!0;return i}};g([ue("columnModel")],pt.prototype,"columnModel",2),g([ue("columnFactory")],pt.prototype,"columnFactory",2),pt=g([he("autoGroupColService")],pt);var gt={};p(gt,{camelCaseToHumanText:()=>Ct,camelCaseToHyphenated:()=>wt,capitalise:()=>vt,escapeString:()=>bt,utf8_encode:()=>yt});var ft=/[&<>"']/g,mt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function yt(e){const t=String.fromCharCode;function i(e,i){return t(e>>i&63|128)}function n(e){if(e>=0&&e<=31&&10!==e)return`_x${e.toString(16).toUpperCase().padStart(4,"0")}_`;if(!(4294967168&e))return t(e);let n="";return 4294965248&e?4294901760&e?4292870144&e||(n=t(e>>18&7|240),n+=i(e,12),n+=i(e,6)):(function(e){if(e>=55296&&e<=57343)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value")}(e),n=t(e>>12&15|224),n+=i(e,6)):n=t(e>>6&31|192),n+=t(63&e|128),n}const s=function(e){const t=[];if(!e)return[];const i=e.length;let n,s,r=0;for(;r<i;)n=e.charCodeAt(r++),n>=55296&&n<=56319&&r<i?(s=e.charCodeAt(r++),56320==(64512&s)?t.push(((1023&n)<<10)+(1023&s)+65536):(t.push(n),r--)):t.push(n);return t}(e),r=s.length;let o,a=-1,l="";for(;++a<r;)o=s[a],l+=n(o);return l}function vt(e){return e[0].toUpperCase()+e.substring(1).toLowerCase()}function bt(e,t){if(null==e)return null;const i=e.toString().toString();return t?i:i.replace(ft,e=>mt[e])}function Ct(e){return e&&null!=e?e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z])([a-z])/g,"$1 $2$3").replace(/\./g," ").split(" ").map(e=>e.substring(0,1).toUpperCase()+(e.length>1?e.substring(1,e.length):"")).join(" "):null}function wt(e){return e.replace(/[A-Z]/g,e=>`-${e.toLocaleLowerCase()}`)}var St={};function xt(e){const t=new Map;return e.forEach(e=>t.set(e[0],e[1])),t}function Et(e,t){const i=new Map;return e.forEach(e=>i.set(t(e),e)),i}function At(e){const t=[];return e.forEach((e,i)=>t.push(i)),t}p(St,{convertToMap:()=>xt,keys:()=>At,mapById:()=>Et});var Mt=class extends st{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 e=this.gos.get("pivotMode");this.isPivotSettingAllowed(e)&&(this.pivotMode=e),this.addManagedPropertyListeners(["groupDisplayType","treeData","treeDataDisplayType","groupHideOpenParents"],e=>this.buildAutoGroupColumns(Tt(e.source))),this.addManagedPropertyListener("autoGroupColumnDef",e=>this.onAutoGroupColumnDefChanged(Tt(e.source))),this.addManagedPropertyListeners(["defaultColDef","columnTypes","suppressFieldDotNotation"],e=>this.onSharedColDefChanged(Tt(e.source))),this.addManagedPropertyListener("pivotMode",e=>this.setPivotMode(this.gos.get("pivotMode"),Tt(e.source))),this.addManagedListener(this.eventService,ct.EVENT_FIRST_DATA_RENDERED,()=>this.onFirstDataRendered())}buildAutoGroupColumns(e){this.columnDefs&&(this.autoGroupsNeedBuilding=!0,this.forceRecreateAutoGroups=!0,this.updateGridColumns(),this.updateDisplayedColumns(e))}onAutoGroupColumnDefChanged(e){this.groupAutoColumns&&this.autoGroupColService.updateAutoGroupColumns(this.groupAutoColumns,e)}onSharedColDefChanged(e){this.gridColumns&&(this.groupAutoColumns&&this.autoGroupColService.updateAutoGroupColumns(this.groupAutoColumns,e),this.createColumnsFromColumnDefs(!0,e))}setColumnDefs(e,t){const i=!!this.columnDefs;this.columnDefs=e,this.createColumnsFromColumnDefs(i,t)}recreateColumnDefs(e){this.onSharedColDefChanged(e)}destroyOldColumns(e,t){const i={};if(!e)return;ot(null,e,e=>{i[e.getInstanceId()]=e}),t&&ot(null,t,e=>{i[e.getInstanceId()]=null});const n=Object.values(i).filter(e=>null!=e);this.destroyBeans(n)}destroyColumns(){this.destroyOldColumns(this.primaryColumnTree),this.destroyOldColumns(this.secondaryBalancedTree),this.destroyOldColumns(this.groupAutoColsBalancedTree)}createColumnsFromColumnDefs(e,t){const i=e?this.compareColumnStatesAndDispatchEvents(t):void 0;this.valueCache.expire(),this.autoGroupsNeedBuilding=!0;const n=this.primaryColumns,s=this.primaryColumnTree,r=this.columnFactory.createColumnTree(this.columnDefs,!0,s,t);this.destroyOldColumns(this.primaryColumnTree,r.columnTree),this.primaryColumnTree=r.columnTree,this.primaryHeaderRowCount=r.treeDept+1,this.primaryColumns=this.getColumnsFromTree(this.primaryColumnTree),this.primaryColumnsMap={},this.primaryColumns.forEach(e=>this.primaryColumnsMap[e.getId()]=e),this.extractRowGroupColumns(t,n),this.extractPivotColumns(t,n),this.extractValueColumns(t,n),this.ready=!0;const o=void 0===this.gridColsArePrimary;(this.gridColsArePrimary||o||this.autoGroupsNeedBuilding)&&(this.updateGridColumns(),e&&this.gridColsArePrimary&&!this.gos.get("maintainColumnOrder")&&this.orderGridColumnsLikePrimary(),this.updateDisplayedColumns(t),this.checkViewportColumns()),this.dispatchEverythingChanged(t),this.changeEventsDispatching=!0,i&&i(),this.changeEventsDispatching=!1,this.dispatchNewColumnsLoaded(t)}shouldRowModelIgnoreRefresh(){return this.changeEventsDispatching}dispatchNewColumnsLoaded(e){const t={type:ct.EVENT_NEW_COLUMNS_LOADED,source:e};this.eventService.dispatchEvent(t),"gridInitializing"===e&&this.onColumnsReady()}dispatchEverythingChanged(e){const t={type:ct.EVENT_COLUMN_EVERYTHING_CHANGED,source:e};this.eventService.dispatchEvent(t)}orderGridColumnsLikePrimary(){const e=this.primaryColumns;if(!e)return;const t=e.filter(e=>this.gridColumns.indexOf(e)>=0),i=this.gridColumns.filter(e=>t.indexOf(e)<0);this.gridColumns=[...i,...t],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(e=!1){if(null==this.displayedColumnsCenter)return;if(!this.extractViewport())return;const t={type:ct.EVENT_VIRTUAL_COLUMNS_CHANGED,afterScroll:e};this.eventService.dispatchEvent(t)}setViewportPosition(e,t,i=!1){(e!==this.scrollWidth||t!==this.scrollPosition||this.bodyWidthDirty)&&(this.scrollWidth=e,this.scrollPosition=t,this.bodyWidthDirty=!0,this.setViewport(),this.ready&&this.checkViewportColumns(i))}isPivotMode(){return this.pivotMode}isPivotSettingAllowed(e){return!e||!this.gos.get("treeData")||(z("Pivot mode not available with treeData."),!1)}setPivotMode(e,t){if(e===this.pivotMode||!this.isPivotSettingAllowed(this.pivotMode))return;if(this.pivotMode=e,!this.gridColumns)return;this.autoGroupsNeedBuilding=!0,this.updateGridColumns(),this.updateDisplayedColumns(t);const i={type:ct.EVENT_COLUMN_PIVOT_MODE_CHANGED};this.eventService.dispatchEvent(i)}getSecondaryPivotColumn(e,t){if(C(this.secondaryColumns))return null;const i=this.getPrimaryColumn(t);let n=null;return this.secondaryColumns.forEach(t=>{const s=t.getColDef().pivotKeys,r=t.getColDef().pivotValueColumn;Re(s,e)&&r===i&&(n=t)}),n}setBeans(e){this.logger=e.create("columnModel")}setFirstRightAndLastLeftPinned(e){let t,i;this.gos.get("enableRtl")?(t=this.displayedColumnsLeft?this.displayedColumnsLeft[0]:null,i=this.displayedColumnsRight?Ie(this.displayedColumnsRight):null):(t=this.displayedColumnsLeft?Ie(this.displayedColumnsLeft):null,i=this.displayedColumnsRight?this.displayedColumnsRight[0]:null),this.gridColumns.forEach(n=>{n.setLastLeftPinned(n===t,e),n.setFirstRightPinned(n===i,e)})}autoSizeColumns(e){if(this.shouldQueueResizeOperations)return void this.resizeOperationQueue.push(()=>this.autoSizeColumns(e));const{columns:t,skipHeader:i,skipHeaderGroups:n,stopAtGroup:s,source:r="api"}=e;this.animationFrameService.flushAllFrames();const o=[];let a=-1;const l=null!=i?i:this.gos.get("skipHeaderOnAutoSize"),c=null!=n?n:l;for(;0!==a;)a=0,this.actionOnGridColumns(t,e=>{if(o.indexOf(e)>=0)return!1;const t=this.autoWidthCalculator.getPreferredWidthForColumn(e,l);if(t>0){const i=this.normaliseColumnWidth(e,t);e.setActualWidth(i,r),o.push(e),a++}return!0},r);c||this.autoSizeColumnGroupsByColumns(t,r,s),this.dispatchColumnResizedEvent(o,!0,"autosizeColumns")}dispatchColumnResizedEvent(e,t,i,n=null){if(e&&e.length){const s={type:ct.EVENT_COLUMN_RESIZED,columns:e,column:1===e.length?e[0]:null,flexColumns:n,finished:t,source:i};this.eventService.dispatchEvent(s)}}dispatchColumnChangedEvent(e,t,i){const n={type:e,columns:t,column:t&&1==t.length?t[0]:null,source:i};this.eventService.dispatchEvent(n)}dispatchColumnMovedEvent(e){const{movedColumns:t,source:i,toIndex:n,finished:s}=e,r={type:ct.EVENT_COLUMN_MOVED,columns:t,column:t&&1===t.length?t[0]:null,toIndex:n,finished:s,source:i};this.eventService.dispatchEvent(r)}dispatchColumnPinnedEvent(e,t){if(!e.length)return;const i=1===e.length?e[0]:null,n=this.getCommonValue(e,e=>e.getPinned()),s={type:ct.EVENT_COLUMN_PINNED,pinned:null!=n?n:null,columns:e,column:i,source:t};this.eventService.dispatchEvent(s)}dispatchColumnVisibleEvent(e,t){if(!e.length)return;const i=1===e.length?e[0]:null,n=this.getCommonValue(e,e=>e.isVisible()),s={type:ct.EVENT_COLUMN_VISIBLE,visible:n,columns:e,column:i,source:t};this.eventService.dispatchEvent(s)}autoSizeColumn(e,t,i){e&&this.autoSizeColumns({columns:[e],skipHeader:i,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,i){const n=new Set;let s;this.getGridColumns(e).forEach(e=>{let t=e.getParent();for(;t&&t!=i;)t.isPadding()||n.add(t),t=t.getParent()});for(const e of n){for(const t of this.ctrlsService.getHeaderRowContainerCtrls())if(s=t.getHeaderCtrlForColumn(e),s)break;s&&s.resizeLeafColumnsToFit(t)}return[]}autoSizeAllColumns(e,t){if(this.shouldQueueResizeOperations)return void this.resizeOperationQueue.push(()=>this.autoSizeAllColumns(e,t));const i=this.getAllDisplayedColumns();this.autoSizeColumns({columns:i,skipHeader:t,source:e})}getColumnsFromTree(e){const t=[],i=e=>{for(let n=0;n<e.length;n++){const s=e[n];s instanceof Se?t.push(s):s instanceof Ee&&i(s.getChildren())}};return i(e),t}getAllDisplayedTrees(){return this.displayedTreeLeft&&this.displayedTreeRight&&this.displayedTreeCentre?this.displayedTreeLeft.concat(this.displayedTreeCentre).concat(this.displayedTreeRight):null}getPrimaryColumnTree(){return this.primaryColumnTree}getHeaderRowCount(){return this.gridHeaderRowCount}getDisplayedTreeLeft(){return this.displayedTreeLeft}getDisplayedTreeRight(){return this.displayedTreeRight}getDisplayedTreeCentre(){return this.displayedTreeCentre}isColumnDisplayed(e){return this.getAllDisplayedColumns().indexOf(e)>=0}getAllDisplayedColumns(){return this.displayedColumns}getViewportColumns(){return this.viewportColumns}getDisplayedLeftColumnsForRow(e){return this.colSpanActive?this.getDisplayedColumnsForRow(e,this.displayedColumnsLeft):this.displayedColumnsLeft}getDisplayedRightColumnsForRow(e){return this.colSpanActive?this.getDisplayedColumnsForRow(e,this.displayedColumnsRight):this.displayedColumnsRight}isColSpanActive(){return this.colSpanActive}getDisplayedColumnsForRow(e,t,i,n){const s=[];let r=null;for(let o=0;o<t.length;o++){const a=t[o],l=t.length-o,c=Math.min(a.getColSpan(e),l),h=[a];if(c>1){const e=c-1;for(let i=1;i<=e;i++)h.push(t[o+i]);o+=e}let u;i?(u=!1,h.forEach(e=>{i(e)&&(u=!0)})):u=!0,u&&(0===s.length&&r&&n&&n(a)&&s.push(r),s.push(a)),r=a}return s}getViewportCenterColumnsForRow(e){if(!this.colSpanActive)return this.viewportColumnsCenter;const t=this.isColumnVirtualisationSuppressed()?null:this.isColumnInRowViewport.bind(this);return this.getDisplayedColumnsForRow(e,this.displayedColumnsCenter,t,e=>{const t=e.getLeft();return b(t)&&t>this.viewportLeft})}isColumnAtEdge(e,t){const i=this.getAllDisplayedColumns();if(!i.length)return!1;const n="first"===t;let s;if(e instanceof lt){const t=e.getDisplayedLeafColumns();if(!t.length)return!1;s=n?t[0]:Ie(t)}else s=e;return(n?i[0]:Ie(i))===s}getAriaColumnIndex(e){let t;return t=e instanceof lt?e.getLeafColumns()[0]:e,this.ariaOrderColumns.indexOf(t)+1}isColumnInHeaderViewport(e){return!!e.isAutoHeaderHeight()||this.isColumnInRowViewport(e)}isColumnInRowViewport(e){if(e.isAutoHeight())return!0;const t=e.getLeft()||0,i=t+e.getActualWidth(),n=this.viewportLeft-200,s=this.viewportRight+200;return!(t<n&&i<n||t>s&&i>s)}getDisplayedColumnsLeftWidth(){return this.getWidthOfColsInList(this.displayedColumnsLeft)}getDisplayedColumnsRightWidth(){return this.getWidthOfColsInList(this.displayedColumnsRight)}updatePrimaryColumnList(e,t,i,n,s,r){if(!e||w(e))return;let o=!1;if(e.forEach(e=>{if(!e)return;const s=this.getPrimaryColumn(e);if(s){if(i){if(t.indexOf(s)>=0)return;t.push(s)}else{if(t.indexOf(s)<0)return;Ne(t,s)}n(s),o=!0}}),!o)return;this.autoGroupsNeedBuilding&&this.updateGridColumns(),this.updateDisplayedColumns(r);const a={type:s,columns:t,column:1===t.length?t[0]:null,source:r};this.eventService.dispatchEvent(a)}setRowGroupColumns(e,t){this.autoGroupsNeedBuilding=!0,this.setPrimaryColumnList(e,this.rowGroupColumns,ct.EVENT_COLUMN_ROW_GROUP_CHANGED,!0,this.setRowGroupActive.bind(this),t)}setRowGroupActive(e,t,i){e!==t.isRowGroupActive()&&(t.setRowGroupActive(e,i),e&&!this.gos.get("suppressRowGroupHidesColumns")&&this.setColumnsVisible([t],!1,i),e||this.gos.get("suppressMakeColumnVisibleAfterUnGroup")||this.setColumnsVisible([t],!0,i))}addRowGroupColumns(e,t){this.autoGroupsNeedBuilding=!0,this.updatePrimaryColumnList(e,this.rowGroupColumns,!0,this.setRowGroupActive.bind(this,!0),ct.EVENT_COLUMN_ROW_GROUP_CHANGED,t)}removeRowGroupColumns(e,t){this.autoGroupsNeedBuilding=!0,this.updatePrimaryColumnList(e,this.rowGroupColumns,!1,this.setRowGroupActive.bind(this,!1),ct.EVENT_COLUMN_ROW_GROUP_CHANGED,t)}addPivotColumns(e,t){this.updatePrimaryColumnList(e,this.pivotColumns,!0,e=>e.setPivotActive(!0,t),ct.EVENT_COLUMN_PIVOT_CHANGED,t)}setPivotColumns(e,t){this.setPrimaryColumnList(e,this.pivotColumns,ct.EVENT_COLUMN_PIVOT_CHANGED,!0,(e,i)=>{i.setPivotActive(e,t)},t)}removePivotColumns(e,t){this.updatePrimaryColumnList(e,this.pivotColumns,!1,e=>e.setPivotActive(!1,t),ct.EVENT_COLUMN_PIVOT_CHANGED,t)}setPrimaryColumnList(e,t,i,n,s,r){if(!this.gridColumns)return;const o=new Map;t.forEach((e,t)=>o.set(e,t)),t.length=0,b(e)&&e.forEach(e=>{const i=this.getPrimaryColumn(e);i&&t.push(i)}),t.forEach((e,t)=>{const i=o.get(e);void 0!==i?n&&i!==t||o.delete(e):o.set(e,0)}),(this.primaryColumns||[]).forEach(e=>{const i=t.indexOf(e)>=0;s(i,e)}),this.autoGroupsNeedBuilding&&this.updateGridColumns(),this.updateDisplayedColumns(r),this.dispatchColumnChangedEvent(i,[...o.keys()],r)}setValueColumns(e,t){this.setPrimaryColumnList(e,this.valueColumns,ct.EVENT_COLUMN_VALUE_CHANGED,!1,this.setValueActive.bind(this),t)}setValueActive(e,t,i){if(e!==t.isValueActive()&&(t.setValueActive(e,i),e&&!t.getAggFunc()&&this.aggFuncService)){const e=this.aggFuncService.getDefaultAggFunc(t);t.setAggFunc(e)}}addValueColumns(e,t){this.updatePrimaryColumnList(e,this.valueColumns,!0,this.setValueActive.bind(this,!0),ct.EVENT_COLUMN_VALUE_CHANGED,t)}removeValueColumns(e,t){this.updatePrimaryColumnList(e,this.valueColumns,!1,this.setValueActive.bind(this,!1),ct.EVENT_COLUMN_VALUE_CHANGED,t)}normaliseColumnWidth(e,t){const i=e.getMinWidth();b(i)&&t<i&&(t=i);const n=e.getMaxWidth();return b(n)&&e.isGreaterThanMax(t)&&(t=n),t}getPrimaryOrGridColumn(e){return this.getPrimaryColumn(e)||this.getGridColumn(e)}setColumnWidths(e,t,i,n){const s=[];e.forEach(e=>{const i=this.getPrimaryOrGridColumn(e.key);if(i&&(s.push({width:e.newWidth,ratios:[1],columns:[i]}),"shift"===this.gos.get("colResizeDefault")&&(t=!t),t)){const t=this.getDisplayedColAfter(i);if(!t)return;const n=i.getActualWidth()-e.newWidth,r=t.getActualWidth()+n;s.push({width:r,ratios:[1],columns:[t]})}}),0!==s.length&&this.resizeColumnSets({resizeSets:s,finished:i,source:n})}checkMinAndMaxWidthsForSet(e){const{columns:t,width:i}=e;let n=0,s=0,r=!0;return t.forEach(e=>{const t=e.getMinWidth();n+=t||0;const i=e.getMaxWidth();b(i)&&i>0?s+=i:r=!1}),i>=n&&(!r||i<=s)}resizeColumnSets(e){const{resizeSets:t,finished:i,source:n}=e;if(t&&!t.every(e=>this.checkMinAndMaxWidthsForSet(e))){if(i){const e=t&&t.length>0?t[0].columns:null;this.dispatchColumnResizedEvent(e,i,n)}return}const s=[],r=[];t.forEach(e=>{const{width:t,columns:i,ratios:o}=e,a={},l={};i.forEach(e=>r.push(e));let c=!0,h=0;for(;c;){if(h++,h>1e3){console.error("AG Grid: infinite loop in resizeColumnSets");break}c=!1;const e=[];let n=0,s=t;i.forEach((t,i)=>{if(l[t.getId()])s-=a[t.getId()];else{e.push(t);const s=o[i];n+=s}});const r=1/n;e.forEach((i,n)=>{let h;n===e.length-1?h=s:(h=Math.round(o[n]*t*r),s-=h);const u=i.getMinWidth(),d=i.getMaxWidth();b(u)&&h<u?(h=u,l[i.getId()]=!0,c=!0):b(d)&&d>0&&h>d&&(h=d,l[i.getId()]=!0,c=!0),a[i.getId()]=h})}i.forEach(e=>{const t=a[e.getId()];e.getActualWidth()!==t&&(e.setActualWidth(t,n),s.push(e))})});const o=s.length>0;let a=[];o&&(a=this.refreshFlexedColumns({resizingCols:r,skipSetLeft:!0}),this.setLeftValues(n),this.updateBodyWidths(),this.checkViewportColumns());const l=r.concat(a);(o||i)&&this.dispatchColumnResizedEvent(l,i,n,a)}setColumnAggFunc(e,t,i){if(!e)return;const n=this.getPrimaryColumn(e);n&&(n.setAggFunc(t),this.dispatchColumnChangedEvent(ct.EVENT_COLUMN_VALUE_CHANGED,[n],i))}moveRowGroupColumn(e,t,i){if(this.isRowGroupEmpty())return;const n=this.rowGroupColumns[e],s=this.rowGroupColumns.slice(e,t);this.rowGroupColumns.splice(e,1),this.rowGroupColumns.splice(t,0,n);const r={type:ct.EVENT_COLUMN_ROW_GROUP_CHANGED,columns:s,column:1===s.length?s[0]:null,source:i};this.eventService.dispatchEvent(r)}moveColumns(e,t,i,n=!0){if(!this.gridColumns)return;if(this.columnAnimationService.start(),t>this.gridColumns.length-e.length)return console.warn("AG Grid: tried to insert columns in invalid location, toIndex = "+t),void console.warn("AG Grid: remember that you should not count the moving columns when calculating the new index");const s=this.getGridColumns(e);!this.doesMovePassRules(s,t)||(Ve(this.gridColumns,s,t),this.updateDisplayedColumns(i),this.dispatchColumnMovedEvent({movedColumns:s,source:i,toIndex:t,finished:n}),this.columnAnimationService.finish())}doesMovePassRules(e,t){const i=this.getProposedColumnOrder(e,t);return this.doesOrderPassRules(i)}doesOrderPassRules(e){return!!this.doesMovePassMarryChildren(e)&&!!this.doesMovePassLockedPositions(e)}getProposedColumnOrder(e,t){const i=this.gridColumns.slice();return Ve(i,e,t),i}sortColumnsLikeGridColumns(e){!e||e.length<=1||e.filter(e=>this.gridColumns.indexOf(e)<0).length>0||e.sort((e,t)=>this.gridColumns.indexOf(e)-this.gridColumns.indexOf(t))}doesMovePassLockedPositions(e){let t=0,i=!0;return e.forEach(e=>{const n=(s=e.getColDef().lockPosition)?!0===s||"left"===s?0:2:1;var s;n<t&&(i=!1),t=n}),i}doesMovePassMarryChildren(e){let t=!0;return ot(null,this.gridBalancedTree,i=>{if(!(i instanceof Ee))return;const n=i,s=n.getColGroupDef();if(!s||!s.marryChildren)return;const r=[];n.getLeafColumns().forEach(t=>{const i=e.indexOf(t);r.push(i)}),Math.max.apply(Math,r)-Math.min.apply(Math,r)>n.getLeafColumns().length-1&&(t=!1)}),t}moveColumnByIndex(e,t,i){if(!this.gridColumns)return;const n=this.gridColumns[e];this.moveColumns([n],t,i)}getColumnDefs(){if(!this.primaryColumns)return;const e=this.primaryColumns.slice();return this.gridColsArePrimary?e.sort((e,t)=>this.gridColumns.indexOf(e)-this.gridColumns.indexOf(t)):this.lastPrimaryOrder&&e.sort((e,t)=>this.lastPrimaryOrder.indexOf(e)-this.lastPrimaryOrder.indexOf(t)),this.columnDefFactory.buildColumnDefs(e,this.rowGroupColumns,this.pivotColumns)}getBodyContainerWidth(){return this.bodyWidth}getContainerWidth(e){switch(e){case"left":return this.leftWidth;case"right":return this.rightWidth;default:return this.bodyWidth}}updateBodyWidths(){const e=this.getWidthOfColsInList(this.displayedColumnsCenter),t=this.getWidthOfColsInList(this.displayedColumnsLeft),i=this.getWidthOfColsInList(this.displayedColumnsRight);if(this.bodyWidthDirty=this.bodyWidth!==e,this.bodyWidth!==e||this.leftWidth!==t||this.rightWidth!==i){this.bodyWidth=e,this.leftWidth=t,this.rightWidth=i;const n={type:ct.EVENT_COLUMN_CONTAINER_WIDTH_CHANGED};this.eventService.dispatchEvent(n);const s={type:ct.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED};this.eventService.dispatchEvent(s)}}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 e;return null!=(e=this.gridColumns)?e:[]}isRowGroupEmpty(){return w(this.rowGroupColumns)}setColumnsVisible(e,t=!1,i){this.applyColumnState({state:e.map(e=>({colId:"string"==typeof e?e:e.getColId(),hide:!t}))},i)}setColumnsPinned(e,t,i){if(!this.gridColumns)return;if(this.gos.isDomLayout("print"))return void console.warn("AG Grid: Changing the column pinning status is not allowed with domLayout='print'");let n;this.columnAnimationService.start(),n=!0===t||"left"===t?"left":"right"===t?"right":null,this.actionOnGridColumns(e,e=>e.getPinned()!==n&&(e.setPinned(n),!0),i,()=>({type:ct.EVENT_COLUMN_PINNED,pinned:n,column:null,columns:null,source:i})),this.columnAnimationService.finish()}actionOnGridColumns(e,t,i,n){if(w(e))return;const s=[];if(e.forEach(e=>{if(!e)return;const i=this.getGridColumn(e);i&&!1!==t(i)&&s.push(i)}),s.length&&(this.updateDisplayedColumns(i),b(n)&&n)){const e=n();e.columns=s,e.column=1===s.length?s[0]:null,this.eventService.dispatchEvent(e)}}getDisplayedColBefore(e){const t=this.getAllDisplayedColumns(),i=t.indexOf(e);return i>0?t[i-1]:null}getDisplayedColAfter(e){const t=this.getAllDisplayedColumns(),i=t.indexOf(e);return i<t.length-1?t[i+1]:null}getDisplayedGroupAtDirection(e,t){const i=e.getProvidedColumnGroup().getLevel()+e.getPaddingLevel(),n=e.getDisplayedLeafColumns(),s="After"===t?Ie(n):n[0],r=`getDisplayedCol${t}`;for(;;){const t=this[r](s);if(!t)return null;const n=this.getColumnGroupAtLevel(t,i);if(n!==e)return n}}getColumnGroupAtLevel(e,t){let i,n,s=e.getParent();for(;i=s.getProvidedColumnGroup().getLevel(),n=s.getPaddingLevel(),!(i+n<=t);)s=s.getParent();return s}isPinningLeft(){return this.displayedColumnsLeft.length>0}isPinningRight(){return this.displayedColumnsRight.length>0}getPrimaryAndSecondaryAndAutoColumns(){return[].concat(this.primaryColumns||[],this.groupAutoColumns||[],this.secondaryColumns||[])}createStateItemFromColumn(e){const t=e.isRowGroupActive()?this.rowGroupColumns.indexOf(e):null,i=e.isPivotActive()?this.pivotColumns.indexOf(e):null,n=e.isValueActive()?e.getAggFunc():null,s=null!=e.getSort()?e.getSort():null,r=null!=e.getSortIndex()?e.getSortIndex():null,o=null!=e.getFlex()&&e.getFlex()>0?e.getFlex():null;return{colId:e.getColId(),width:e.getActualWidth(),hide:!e.isVisible(),pinned:e.getPinned(),sort:s,sortIndex:r,aggFunc:n,rowGroup:e.isRowGroupActive(),rowGroupIndex:t,pivot:e.isPivotActive(),pivotIndex:i,flex:o}}getColumnState(){if(C(this.primaryColumns)||!this.isAlive())return[];const e=this.getPrimaryAndSecondaryAndAutoColumns().map(this.createStateItemFromColumn.bind(this));return this.orderColumnStateList(e),e}orderColumnStateList(e){const t=xt(this.gridColumns.map((e,t)=>[e.getColId(),t]));e.sort((e,i)=>(t.has(e.colId)?t.get(e.colId):-1)-(t.has(i.colId)?t.get(i.colId):-1))}resetColumnState(e){if(w(this.primaryColumns))return;const t=this.getColumnsFromTree(this.primaryColumnTree),i=[];let n=1e3,s=1e3,r=[];this.groupAutoColumns&&(r=r.concat(this.groupAutoColumns)),t&&(r=r.concat(t)),r.forEach(e=>{const t=this.getColumnStateFromColDef(e);C(t.rowGroupIndex)&&t.rowGroup&&(t.rowGroupIndex=n++),C(t.pivotIndex)&&t.pivot&&(t.pivotIndex=s++),i.push(t)}),this.applyColumnState({state:i,applyOrder:!0},e)}getColumnStateFromColDef(e){const t=(e,t)=>null!=e?e:null!=t?t:null,i=e.getColDef(),n=t(i.sort,i.initialSort),s=t(i.sortIndex,i.initialSortIndex),r=t(i.hide,i.initialHide),o=t(i.pinned,i.initialPinned),a=t(i.width,i.initialWidth),l=t(i.flex,i.initialFlex);let c=t(i.rowGroupIndex,i.initialRowGroupIndex),h=t(i.rowGroup,i.initialRowGroup);null!=c||null!=h&&0!=h||(c=null,h=null);let u=t(i.pivotIndex,i.initialPivotIndex),d=t(i.pivot,i.initialPivot);null!=u||null!=d&&0!=d||(u=null,d=null);const p=t(i.aggFunc,i.initialAggFunc);return{colId:e.getColId(),sort:n,sortIndex:s,hide:r,pinned:o,width:a,flex:l,rowGroup:h,rowGroupIndex:c,pivot:d,pivotIndex:u,aggFunc:p}}applyColumnState(e,t){if(w(this.primaryColumns))return!1;if(e&&e.state&&!e.state.forEach)return console.warn("AG Grid: applyColumnState() - the state attribute should be an array, however an array was not found. Please provide an array of items (one for each col you want to change) for state."),!1;const i=(i,n,s)=>{const r=this.compareColumnStatesAndDispatchEvents(t);this.autoGroupsNeedBuilding=!0;const o=n.slice(),a={},l={},c=[],h=[];let u=0;const d=this.rowGroupColumns.slice(),p=this.pivotColumns.slice();i.forEach(i=>{const n=i.colId||"";if(n.startsWith(dt))return c.push(i),void h.push(i);const r=s(n);r?(this.syncColumnWithStateItem(r,i,e.defaultState,a,l,!1,t),Ne(o,r)):(h.push(i),u+=1)});const g=i=>this.syncColumnWithStateItem(i,null,e.defaultState,a,l,!1,t);o.forEach(g);const f=(e,t,i,n)=>{const s=e[i.getId()],r=e[n.getId()],o=null!=s,a=null!=r;if(o&&a)return s-r;if(o)return-1;if(a)return 1;const l=t.indexOf(i),c=t.indexOf(n),h=l>=0;return h&&c>=0?l-c:h?-1:1};this.rowGroupColumns.sort(f.bind(this,a,d)),this.pivotColumns.sort(f.bind(this,l,p)),this.updateGridColumns();const m=this.groupAutoColumns?this.groupAutoColumns.slice():[];return c.forEach(i=>{const n=this.getAutoColumn(i.colId);Ne(m,n),this.syncColumnWithStateItem(n,i,e.defaultState,null,null,!0,t)}),m.forEach(g),this.applyOrderAfterApplyState(e),this.updateDisplayedColumns(t),this.dispatchEverythingChanged(t),r(),{unmatchedAndAutoStates:h,unmatchedCount:u}};this.columnAnimationService.start();let{unmatchedAndAutoStates:n,unmatchedCount:s}=i(e.state||[],this.primaryColumns||[],e=>this.getPrimaryColumn(e));return(n.length>0||b(e.defaultState))&&(s=i(n,this.secondaryColumns||[],e=>this.getSecondaryColumn(e)).unmatchedCount),this.columnAnimationService.finish(),0===s}applyOrderAfterApplyState(e){if(!e.applyOrder||!e.state)return;let t=[];const i={};e.state.forEach(e=>{if(!e.colId||i[e.colId])return;const n=this.gridColumnsMap[e.colId];n&&(t.push(n),i[e.colId]=!0)});let n=0;this.gridColumns.forEach(e=>{const s=e.getColId();null==i[s]&&(s.startsWith(dt)?Ge(t,e,n++):t.push(e))}),t=this.placeLockedColumns(t),this.doesMovePassMarryChildren(t)?this.gridColumns=t:console.warn("AG Grid: Applying column order broke a group where columns should be married together. Applying new order has been discarded.")}compareColumnStatesAndDispatchEvents(e){const t={rowGroupColumns:this.rowGroupColumns.slice(),pivotColumns:this.pivotColumns.slice(),valueColumns:this.valueColumns.slice()},i=this.getColumnState(),n={};return i.forEach(e=>{n[e.colId]=e}),()=>{const s=this.getPrimaryAndSecondaryAndAutoColumns(),r=(t,i,n,s)=>{if(Re(i.map(s),n.map(s)))return;const r=new Set(i);n.forEach(e=>{r.delete(e)||r.add(e)});const o=[...r],a={type:t,columns:o,column:1===o.length?o[0]:null,source:e};this.eventService.dispatchEvent(a)},o=e=>{const t=[];return s.forEach(i=>{const s=n[i.getColId()];s&&e(s,i)&&t.push(i)}),t},a=e=>e.getColId();r(ct.EVENT_COLUMN_ROW_GROUP_CHANGED,t.rowGroupColumns,this.rowGroupColumns,a),r(ct.EVENT_COLUMN_PIVOT_CHANGED,t.pivotColumns,this.pivotColumns,a);const l=o((e,t)=>{const i=null!=e.aggFunc,n=i!=t.isValueActive(),s=i&&e.aggFunc!=t.getAggFunc();return n||s});l.length>0&&this.dispatchColumnChangedEvent(ct.EVENT_COLUMN_VALUE_CHANGED,l,e),this.dispatchColumnResizedEvent(o((e,t)=>e.width!=t.getActualWidth()),!0,e),this.dispatchColumnPinnedEvent(o((e,t)=>e.pinned!=t.getPinned()),e),this.dispatchColumnVisibleEvent(o((e,t)=>e.hide==t.isVisible()),e);const c=o((e,t)=>e.sort!=t.getSort()||e.sortIndex!=t.getSortIndex());c.length>0&&this.sortController.dispatchSortChangedEvents(e,c),this.normaliseColumnMovedEventForColumnState(i,e)}}getCommonValue(e,t){if(!e||0==e.length)return;const i=t(e[0]);for(let n=1;n<e.length;n++)if(i!==t(e[n]))return;return i}normaliseColumnMovedEventForColumnState(e,t){const i=this.getColumnState(),n={};i.forEach(e=>n[e.colId]=e);const s={};e.forEach(e=>{n[e.colId]&&(s[e.colId]=!0)});const r=e.filter(e=>s[e.colId]),o=i.filter(e=>s[e.colId]),a=[];o.forEach((e,t)=>{const i=r&&r[t];if(i&&i.colId!==e.colId){const e=this.getGridColumn(i.colId);e&&a.push(e)}}),a.length&&this.dispatchColumnMovedEvent({movedColumns:a,source:t,finished:!0})}syncColumnWithStateItem(e,t,i,n,s,r,o){var a;if(!e)return;const l=(e,n)=>{const s={value1:void 0,value2:void 0};let r=!1;return t&&(void 0!==t[e]&&(s.value1=t[e],r=!0),b(n)&&void 0!==t[n]&&(s.value2=t[n],r=!0)),!r&&i&&(void 0!==i[e]&&(s.value1=i[e]),b(n)&&void 0!==i[n]&&(s.value2=i[n])),s},c=l("hide").value1;void 0!==c&&e.setVisible(!c,o);const h=l("pinned").value1;void 0!==h&&e.setPinned(h);const u=null!=(a=e.getColDef().minWidth)?a:this.environment.getMinColWidth(),d=l("flex").value1;if(void 0!==d&&e.setFlex(d),null==d){const t=l("width").value1;null!=t&&null!=u&&t>=u&&e.setActualWidth(t,o)}const p=l("sort").value1;void 0!==p&&("desc"===p||"asc"===p?e.setSort(p,o):e.setSort(void 0,o));const g=l("sortIndex").value1;if(void 0!==g&&e.setSortIndex(g),r||!e.isPrimary())return;const f=l("aggFunc").value1;void 0!==f&&("string"==typeof f?(e.setAggFunc(f),e.isValueActive()||(e.setValueActive(!0,o),this.valueColumns.push(e))):(b(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."),e.isValueActive()&&(e.setValueActive(!1,o),Ne(this.valueColumns,e))));const{value1:m,value2:y}=l("rowGroup","rowGroupIndex");void 0===m&&void 0===y||("number"==typeof y||m?(e.isRowGroupActive()||(e.setRowGroupActive(!0,o),this.rowGroupColumns.push(e)),n&&"number"==typeof y&&(n[e.getId()]=y)):e.isRowGroupActive()&&(e.setRowGroupActive(!1,o),Ne(this.rowGroupColumns,e)));const{value1:v,value2:C}=l("pivot","pivotIndex");void 0===v&&void 0===C||("number"==typeof C||v?(e.isPivotActive()||(e.setPivotActive(!0,o),this.pivotColumns.push(e)),s&&"number"==typeof C&&(s[e.getId()]=C)):e.isPivotActive()&&(e.setPivotActive(!1,o),Ne(this.pivotColumns,e)))}getGridColumns(e){return this.getColumns(e,this.getGridColumn.bind(this))}getColumns(e,t){const i=[];return e&&e.forEach(e=>{const n=t(e);n&&i.push(n)}),i}getColumnWithValidation(e){if(null==e)return null;const t=this.getGridColumn(e);return t||console.warn("AG Grid: could not find column "+e),t}getPrimaryColumn(e){return this.primaryColumns?this.getColumn(e,this.primaryColumns,this.primaryColumnsMap):null}getGridColumn(e){return this.getColumn(e,this.gridColumns,this.gridColumnsMap)}lookupGridColumn(e){return this.gridColumnsMap[e]}getSecondaryColumn(e){return this.secondaryColumns?this.getColumn(e,this.secondaryColumns,this.secondaryColumnsMap):null}getColumn(e,t,i){if(!e||!i)return null;if("string"==typeof e&&i[e])return i[e];for(let i=0;i<t.length;i++)if(this.columnsMatch(t[i],e))return t[i];return this.getAutoColumn(e)}getSourceColumnsForGroupColumn(e){const t=e.getColDef().showRowGroup;if(!t)return null;if(!0===t)return this.rowGroupColumns.slice(0);const i=this.getPrimaryColumn(t);return i?[i]:null}getAutoColumn(e){return this.groupAutoColumns&&b(this.groupAutoColumns)&&!C(this.groupAutoColumns)&&this.groupAutoColumns.find(t=>this.columnsMatch(t,e))||null}columnsMatch(e,t){const i=e===t,n=e.getColDef()===t,s=e.getColId()==t;return i||n||s}getDisplayNameForColumn(e,t,i=!1){if(!e)return null;const n=this.getHeaderName(e.getColDef(),e,null,null,t);return i?this.wrapHeaderNameWithAggFunc(e,n):n}getDisplayNameForProvidedColumnGroup(e,t,i){const n=t?t.getColGroupDef():null;return n?this.getHeaderName(n,null,e,t,i):null}getDisplayNameForColumnGroup(e,t){return this.getDisplayNameForProvidedColumnGroup(e,e.getProvidedColumnGroup(),t)}getHeaderName(e,t,i,n,s){const r=e.headerValueGetter;if(r){const o=this.gos.addGridCommonParams({colDef:e,column:t,columnGroup:i,providedColumnGroup:n,location:s});return"function"==typeof r?r(o):"string"==typeof r?this.expressionService.evaluate(r,o):(console.warn("AG Grid: headerValueGetter must be a function or a string"),"")}return null!=e.headerName?e.headerName:e.field?Ct(e.field):""}wrapHeaderNameWithAggFunc(e,t){if(this.gos.get("suppressAggFuncInHeader"))return t;const i=e.getColDef().pivotValueColumn;let n,s=null;if(b(i)){const r=this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&1===this.valueColumns.length,o=void 0!==e.getColDef().pivotTotalColumnIds;if(r&&!o)return t;s=i?i.getAggFunc():null,n=!0}else{const t=e.isValueActive(),i=this.pivotMode||!this.isRowGroupEmpty();t&&i?(s=e.getAggFunc(),n=!0):n=!1}if(n){const e="string"==typeof s?s:"func";return`${this.localeService.getLocaleTextFunc()(e,e)}(${t})`}return t}getColumnGroup(e,t){if(!e)return null;if(e instanceof lt)return e;const i=this.getAllDisplayedTrees(),n="number"==typeof t;let s=null;return Dt(i,!1,i=>{if(i instanceof lt){const r=i;let o;o=n?e===r.getGroupId()&&t===r.getPartId():e===r.getGroupId(),o&&(s=r)}}),s}isReady(){return this.ready}extractValueColumns(e,t){this.valueColumns=this.extractColumns(t,this.valueColumns,(t,i)=>t.setValueActive(i,e),()=>{},()=>{},e=>{const t=e.aggFunc;return null===t||""===t?null:void 0!==t?!!t:void 0},e=>null!=e.initialAggFunc&&""!=e.initialAggFunc),this.valueColumns.forEach(e=>{const t=e.getColDef();null!=t.aggFunc&&""!=t.aggFunc?e.setAggFunc(t.aggFunc):e.getAggFunc()||e.setAggFunc(t.initialAggFunc)})}extractRowGroupColumns(e,t){this.rowGroupColumns=this.extractColumns(t,this.rowGroupColumns,(t,i)=>t.setRowGroupActive(i,e),e=>e.rowGroupIndex,e=>e.initialRowGroupIndex,e=>e.rowGroup,e=>e.initialRowGroup)}extractColumns(e=[],t=[],i,n,s,r,o){const a=[],l=[];(this.primaryColumns||[]).forEach(i=>{const c=e.indexOf(i)<0,h=i.getColDef(),u=E(r(h)),d=E(o(h)),p=x(n(h)),g=x(s(h));let f;f=void 0!==u?u:void 0!==p?null!==p&&p>=0:c?void 0!==d?d:!(void 0===g)&&null!=g&&g>=0:t.indexOf(i)>=0,f&&((c?null!=p||null!=g:null!=p)?a.push(i):l.push(i))});const c=e=>{const t=n(e.getColDef()),i=s(e.getColDef());return null!=t?t:i};a.sort((e,t)=>{const i=c(e),n=c(t);return i===n?0:i<n?-1:1});const h=[].concat(a);return t.forEach(e=>{l.indexOf(e)>=0&&h.push(e)}),l.forEach(e=>{h.indexOf(e)<0&&h.push(e)}),t.forEach(e=>{h.indexOf(e)<0&&i(e,!1)}),h.forEach(e=>{t.indexOf(e)<0&&i(e,!0)}),h}extractPivotColumns(e,t){this.pivotColumns=this.extractColumns(t,this.pivotColumns,(t,i)=>t.setPivotActive(i,e),e=>e.pivotIndex,e=>e.initialPivotIndex,e=>e.pivot,e=>e.initialPivot)}resetColumnGroupState(e){if(!this.primaryColumnTree)return;const t=[];ot(null,this.primaryColumnTree,e=>{if(e instanceof Ee){const i=e.getColGroupDef(),n={groupId:e.getGroupId(),open:i?i.openByDefault:void 0};t.push(n)}}),this.setColumnGroupState(t,e)}getColumnGroupState(){const e=[];return ot(null,this.gridBalancedTree,t=>{t instanceof Ee&&e.push({groupId:t.getGroupId(),open:t.isExpanded()})}),e}setColumnGroupState(e,t){if(!this.gridBalancedTree)return;this.columnAnimationService.start();const i=[];if(e.forEach(e=>{const t=e.groupId,n=e.open,s=this.getProvidedColumnGroup(t);s&&s.isExpanded()!==n&&(this.logger.log("columnGroupOpened("+s.getGroupId()+","+n+")"),s.setExpanded(n),i.push(s))}),this.updateGroupsAndDisplayedColumns(t),this.setFirstRightAndLastLeftPinned(t),i.length){const e={type:ct.EVENT_COLUMN_GROUP_OPENED,columnGroup:1===Ee.length?i[0]:void 0,columnGroups:i};this.eventService.dispatchEvent(e)}this.columnAnimationService.finish()}setColumnGroupOpened(e,t,i){let n;n=e instanceof Ee?e.getId():e||"",this.setColumnGroupState([{groupId:n,open:t}],i)}getProvidedColumnGroup(e){"string"!=typeof e&&console.error("AG Grid: group key must be a string");let t=null;return ot(null,this.gridBalancedTree,i=>{i instanceof Ee&&i.getId()===e&&(t=i)}),t}calculateColumnsForDisplay(){let e;return e=this.pivotMode&&C(this.secondaryColumns)?this.gridColumns.filter(e=>{const t=this.groupAutoColumns&&He(this.groupAutoColumns,e),i=this.valueColumns&&He(this.valueColumns,e);return t||i}):this.gridColumns.filter(e=>this.groupAutoColumns&&He(this.groupAutoColumns,e)||e.isVisible()),e}checkColSpanActiveInCols(e){let t=!1;return e.forEach(e=>{b(e.getColDef().colSpan)&&(t=!0)}),t}calculateColumnsForGroupDisplay(){this.groupDisplayColumns=[],this.groupDisplayColumnsMap={},this.gridColumns.forEach(e=>{const t=e.getColDef(),i=t.showRowGroup;t&&b(i)&&(this.groupDisplayColumns.push(e),"string"==typeof i?this.groupDisplayColumnsMap[i]=e:!0===i&&this.getRowGroupColumns().forEach(t=>{this.groupDisplayColumnsMap[t.getId()]=e}))})}getGroupDisplayColumns(){return this.groupDisplayColumns}getGroupDisplayColumnForGroup(e){return this.groupDisplayColumnsMap[e]}updateDisplayedColumns(e){const t=this.calculateColumnsForDisplay();this.buildDisplayedTrees(t),this.updateGroupsAndDisplayedColumns(e),this.setFirstRightAndLastLeftPinned(e)}isSecondaryColumnsPresent(){return b(this.secondaryColumns)}setSecondaryColumns(e,t){if(!this.gridColumns)return;const i=e;if(i||!C(this.secondaryColumns)){if(i){this.processSecondaryColumnDefinitions(e);const i=this.columnFactory.createColumnTree(e,!1,this.secondaryBalancedTree||this.previousSecondaryColumns||void 0,t);this.destroyOldColumns(this.secondaryBalancedTree,i.columnTree),this.secondaryBalancedTree=i.columnTree,this.secondaryHeaderRowCount=i.treeDept+1,this.secondaryColumns=this.getColumnsFromTree(this.secondaryBalancedTree),this.secondaryColumnsMap={},this.secondaryColumns.forEach(e=>this.secondaryColumnsMap[e.getId()]=e),this.previousSecondaryColumns=null}else this.previousSecondaryColumns=this.secondaryBalancedTree,this.secondaryBalancedTree=null,this.secondaryHeaderRowCount=-1,this.secondaryColumns=null,this.secondaryColumnsMap={};this.updateGridColumns(),this.updateDisplayedColumns(t)}}processSecondaryColumnDefinitions(e){const t=this.gos.get("processPivotResultColDef"),i=this.gos.get("processPivotResultColGroupDef");if(!t&&!i)return;const n=e=>{e.forEach(e=>{if(b(e.children)){const t=e;i&&i(t),n(t.children)}else t&&t(e)})};e&&n(e)}updateGridColumns(){const e=this.gridBalancedTree;if(this.gridColsArePrimary?this.lastPrimaryOrder=this.gridColumns:this.lastSecondaryOrder=this.gridColumns,this.createGroupAutoColumnsIfNeeded()){const e=xt(this.groupAutoColumns.map(e=>[e,!0]));this.lastPrimaryOrder&&(this.lastPrimaryOrder=this.lastPrimaryOrder.filter(t=>!e.has(t)),this.lastPrimaryOrder=[...this.groupAutoColumns,...this.lastPrimaryOrder]),this.lastSecondaryOrder&&(this.lastSecondaryOrder=this.lastSecondaryOrder.filter(t=>!e.has(t)),this.lastSecondaryOrder=[...this.groupAutoColumns,...this.lastSecondaryOrder])}let t;if(this.secondaryColumns&&this.secondaryBalancedTree){const e=this.secondaryColumns.some(e=>void 0!==this.gridColumnsMap[e.getColId()]);this.gridBalancedTree=this.secondaryBalancedTree.slice(),this.gridHeaderRowCount=this.secondaryHeaderRowCount,this.gridColumns=this.secondaryColumns.slice(),this.gridColsArePrimary=!1,e&&(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(e=>this.gridColumnsMap[e.getId()]=e),this.setAutoHeightActive(),!Re(e,this.gridBalancedTree)){const e={type:ct.EVENT_GRID_COLUMNS_CHANGED};this.eventService.dispatchEvent(e)}}setAutoHeightActive(){this.autoHeightActive=this.gridColumns.filter(e=>e.isAutoHeight()).length>0,this.autoHeightActive&&(this.autoHeightActiveAtLeastOnce=!0,this.gos.isRowModelType("clientSide")||this.gos.isRowModelType("serverSide")||z("autoHeight columns only work with Client Side Row Model and Server Side Row Model."))}orderGridColsLike(e){if(C(e))return;const t=xt(e.map((e,t)=>[e,t]));let i=!0;if(this.gridColumns.forEach(e=>{t.has(e)&&(i=!1)}),i)return;const n=xt(this.gridColumns.map(e=>[e,!0])),s=e.filter(e=>n.has(e)),r=xt(s.map(e=>[e,!0])),o=this.gridColumns.filter(e=>!r.has(e)),a=s.slice();o.forEach(e=>{let t=e.getOriginalParent();if(!t)return void a.push(e);const i=[];for(;!i.length&&t;)t.getLeafColumns().forEach(e=>{const t=a.indexOf(e)>=0,n=i.indexOf(e)<0;t&&n&&i.push(e)}),t=t.getOriginalParent();if(!i.length)return void a.push(e);const n=i.map(e=>a.indexOf(e)),s=Math.max(...n);Ge(a,e,s+1)}),this.gridColumns=a}isPrimaryColumnGroupsPresent(){return this.primaryHeaderRowCount>1}refreshQuickFilterColumns(){var e;let t=null!=(e=this.isPivotMode()&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")?this.secondaryColumns:this.primaryColumns)?e:[];this.groupAutoColumns&&(t=t.concat(this.groupAutoColumns)),this.columnsForQuickFilter=this.gos.get("includeHiddenColumnsInQuickFilter")?t:t.filter(e=>e.isVisible()||e.isRowGroupActive())}placeLockedColumns(e){const t=[],i=[],n=[];return e.forEach(e=>{const s=e.getColDef().lockPosition;"right"===s?n.push(e):"left"===s||!0===s?t.push(e):i.push(e)}),[...t,...i,...n]}addAutoGroupToGridColumns(){if(C(this.groupAutoColumns))return this.destroyOldColumns(this.groupAutoColsBalancedTree),void(this.groupAutoColsBalancedTree=null);this.gridColumns=this.groupAutoColumns?this.groupAutoColumns.concat(this.gridColumns):this.gridColumns;const e=this.columnFactory.createForAutoGroups(this.groupAutoColumns,this.gridBalancedTree);this.destroyOldColumns(this.groupAutoColsBalancedTree,e),this.groupAutoColsBalancedTree=e,this.gridBalancedTree=e.concat(this.gridBalancedTree)}clearDisplayedAndViewportColumns(){this.viewportRowLeft={},this.viewportRowRight={},this.viewportRowCenter={},this.displayedColumnsLeft=[],this.displayedColumnsRight=[],this.displayedColumnsCenter=[],this.displayedColumns=[],this.ariaOrderColumns=[],this.viewportColumns=[],this.headerViewportColumns=[],this.viewportColumnsHash=""}updateGroupsAndDisplayedColumns(e){this.updateOpenClosedVisibilityInColumnGroups(),this.deriveDisplayedColumns(e),this.refreshFlexedColumns(),this.extractViewport(),this.updateBodyWidths();const t={type:ct.EVENT_DISPLAYED_COLUMNS_CHANGED};this.eventService.dispatchEvent(t)}deriveDisplayedColumns(e){this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeLeft,this.displayedColumnsLeft),this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeCentre,this.displayedColumnsCenter),this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeRight,this.displayedColumnsRight),this.joinColumnsAriaOrder(),this.joinDisplayedColumns(),this.setLeftValues(e),this.displayedAutoHeightCols=this.displayedColumns.filter(e=>e.isAutoHeight())}isAutoRowHeightActive(){return this.autoHeightActive}wasAutoRowHeightEverActive(){return this.autoHeightActiveAtLeastOnce}joinColumnsAriaOrder(){const e=this.getAllGridColumns(),t=[],i=[],n=[];for(const s of e){const e=s.getPinned();e?!0===e||"left"===e?t.push(s):n.push(s):i.push(s)}this.ariaOrderColumns=t.concat(i).concat(n)}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(e){this.setLeftValuesOfColumns(e),this.setLeftValuesOfGroups()}setLeftValuesOfColumns(e){if(!this.primaryColumns)return;const t=this.getPrimaryAndSecondaryAndAutoColumns().slice(0),i=this.gos.get("enableRtl");[this.displayedColumnsLeft,this.displayedColumnsRight,this.displayedColumnsCenter].forEach(n=>{if(i){let t=this.getWidthOfColsInList(n);n.forEach(i=>{t-=i.getActualWidth(),i.setLeft(t,e)})}else{let t=0;n.forEach(i=>{i.setLeft(t,e),t+=i.getActualWidth()})}Oe(t,n)}),t.forEach(t=>{t.setLeft(null,e)})}setLeftValuesOfGroups(){[this.displayedTreeLeft,this.displayedTreeRight,this.displayedTreeCentre].forEach(e=>{e.forEach(e=>{e instanceof lt&&e.checkLeft()})})}derivedDisplayedColumnsFromDisplayedTree(e,t){t.length=0,Dt(e,!0,e=>{e instanceof Se&&t.push(e)})}isColumnVirtualisationSuppressed(){return this.suppressColumnVirtualisation||0===this.viewportRight}extractViewportColumns(){this.isColumnVirtualisationSuppressed()?(this.viewportColumnsCenter=this.displayedColumnsCenter,this.headerViewportColumnsCenter=this.displayedColumnsCenter):(this.viewportColumnsCenter=this.displayedColumnsCenter.filter(this.isColumnInRowViewport.bind(this)),this.headerViewportColumnsCenter=this.displayedColumnsCenter.filter(this.isColumnInHeaderViewport.bind(this))),this.viewportColumns=this.viewportColumnsCenter.concat(this.displayedColumnsLeft).concat(this.displayedColumnsRight),this.headerViewportColumns=this.headerViewportColumnsCenter.concat(this.displayedColumnsLeft).concat(this.displayedColumnsRight)}getVirtualHeaderGroupRow(e,t){let i;switch(e){case"left":i=this.viewportRowLeft[t];break;case"right":i=this.viewportRowRight[t];break;default:i=this.viewportRowCenter[t]}return C(i)&&(i=[]),i}calculateHeaderRows(){this.viewportRowLeft={},this.viewportRowRight={},this.viewportRowCenter={};const e={};this.headerViewportColumns.forEach(t=>e[t.getId()]=!0);const t=(i,n,s)=>{let r=!1;for(let o=0;o<i.length;o++){const a=i[o];let l=!1;if(a instanceof Se)l=!0===e[a.getId()];else{const e=a.getDisplayedChildren();e&&(l=t(e,n,s+1))}l&&(r=!0,n[s]||(n[s]=[]),n[s].push(a))}return r};t(this.displayedTreeLeft,this.viewportRowLeft,0),t(this.displayedTreeRight,this.viewportRowRight,0),t(this.displayedTreeCentre,this.viewportRowCenter,0)}extractViewport(){this.extractViewportColumns();const e=this.viewportColumns.map(e=>`${e.getId()}-${e.getPinned()||"normal"}`).join("#"),t=this.viewportColumnsHash!==e;return t&&(this.viewportColumnsHash=e,this.calculateHeaderRows()),t}refreshFlexedColumns(e={}){var t;const i=e.source?e.source:"flex";if(null!=e.viewportWidth&&(this.flexViewportWidth=e.viewportWidth),!this.flexViewportWidth)return[];let n=-1;if(e.resizingCols){const t=new Set(e.resizingCols);let i=this.displayedColumnsCenter;for(let e=i.length-1;e>=0;e--)if(t.has(i[e])){n=e;break}}let s=0,r=[],o=0,a=0;for(let e=0;e<this.displayedColumnsCenter.length;e++)this.displayedColumnsCenter[e].getFlex()&&e>n?(r.push(this.displayedColumnsCenter[e]),a+=this.displayedColumnsCenter[e].getFlex(),o+=null!=(t=this.displayedColumnsCenter[e].getMinWidth())?t:0):s+=this.displayedColumnsCenter[e].getActualWidth();if(!r.length)return[];let l=[];s+o>this.flexViewportWidth&&(r.forEach(e=>{var t;return e.setActualWidth(null!=(t=e.getMinWidth())?t:0,i)}),l=r,r=[]);const c=[];let h;e:for(;;){h=this.flexViewportWidth-s;const e=h/a;for(let t=0;t<r.length;t++){const n=r[t],o=e*n.getFlex();let h=0;const u=n.getMinWidth(),d=n.getMaxWidth();if(b(u)&&o<u?h=u:b(d)&&o>d&&(h=d),h){n.setActualWidth(h,i),Le(r,n),a-=n.getFlex(),l.push(n),s+=n.getActualWidth();continue e}c[t]=Math.round(o)}break}let u=h;return r.forEach((e,t)=>{e.setActualWidth(Math.min(c[t],u),i),l.push(e),u-=c[t]}),e.skipSetLeft||this.setLeftValues(i),e.updateBodyWidths&&this.updateBodyWidths(),e.fireResizedEvent&&this.dispatchColumnResizedEvent(l,!0,i,r),r}sizeColumnsToFit(e,t="sizeColumnsToFit",i,n){var s,r,o,h,u;if(this.shouldQueueResizeOperations)return void this.resizeOperationQueue.push(()=>this.sizeColumnsToFit(e,t,i,n));const d={};n&&(null==(s=null==n?void 0:n.columnLimits)||s.forEach(e=>{var t=e,{key:i}=t,n=((e,t)=>{var i={};for(var n in e)l.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&a)for(var n of a(e))t.indexOf(n)<0&&c.call(e,n)&&(i[n]=e[n]);return i})(t,["key"]);d["string"==typeof i?i:i.getColId()]=n}));const p=this.getAllDisplayedColumns(),g=e===this.getWidthOfColsInList(p);if(e<=0||!p.length||g)return;const f=[],m=[];p.forEach(e=>{!0===e.getColDef().suppressSizeToFit?m.push(e):f.push(e)});const y=f.slice(0);let v=!1;const C=e=>{Ne(f,e),m.push(e)};for(f.forEach(e=>{var i,s;e.resetActualWidth(t);const r=null==d?void 0:d[e.getId()],o=null!=(i=null==r?void 0:r.minWidth)?i:null==n?void 0:n.defaultMinWidth,a=null!=(s=null==r?void 0:r.maxWidth)?s:null==n?void 0:n.defaultMaxWidth,l=e.getActualWidth();"number"==typeof o&&l<o?e.setActualWidth(o,t,!0):"number"==typeof a&&l>a&&e.setActualWidth(a,t,!0)});!v;){v=!0;const i=e-this.getWidthOfColsInList(m);if(i<=0)f.forEach(e=>{var i,s;const r=null!=(s=null==(i=null==d?void 0:d[e.getId()])?void 0:i.minWidth)?s:null==n?void 0:n.defaultMinWidth;"number"!=typeof r?e.setMinimum(t):e.setActualWidth(r,t,!0)});else{const e=i/this.getWidthOfColsInList(f);let s=i;for(let i=f.length-1;i>=0;i--){const a=f[i],l=null==d?void 0:d[a.getId()],c=null!=(r=null==l?void 0:l.minWidth)?r:null==n?void 0:n.defaultMinWidth,p=null!=(o=null==l?void 0:l.maxWidth)?o:null==n?void 0:n.defaultMaxWidth,g=null!=(h=a.getMinWidth())?h:0,m=null!=(u=a.getMaxWidth())?u:Number.MAX_VALUE,y="number"==typeof c&&c>g?c:a.getMinWidth(),w="number"==typeof p&&p<m?p:a.getMaxWidth();let S=Math.round(a.getActualWidth()*e);b(y)&&S<y?(S=y,C(a),v=!1):b(w)&&S>w?(S=w,C(a),v=!1):0===i&&(S=s),a.setActualWidth(S,t,!0),s-=S}}}y.forEach(e=>{e.fireColumnWidthChangedEvent(t)}),this.setLeftValues(t),this.updateBodyWidths(),i||this.dispatchColumnResizedEvent(y,!0,t)}buildDisplayedTrees(e){const t=[],i=[],n=[];e.forEach(e=>{switch(e.getPinned()){case"left":t.push(e);break;case"right":i.push(e);break;default:n.push(e)}});const s=new ut;this.displayedTreeLeft=this.displayedGroupCreator.createDisplayedGroups(t,s,"left",this.displayedTreeLeft),this.displayedTreeRight=this.displayedGroupCreator.createDisplayedGroups(i,s,"right",this.displayedTreeRight),this.displayedTreeCentre=this.displayedGroupCreator.createDisplayedGroups(n,s,null,this.displayedTreeCentre),this.updateDisplayedMap()}updateDisplayedMap(){this.displayedColumnsAndGroupsMap={};const e=e=>{this.displayedColumnsAndGroupsMap[e.getUniqueId()]=e};Dt(this.displayedTreeCentre,!1,e),Dt(this.displayedTreeLeft,!1,e),Dt(this.displayedTreeRight,!1,e)}isDisplayed(e){return this.displayedColumnsAndGroupsMap[e.getUniqueId()]===e}updateOpenClosedVisibilityInColumnGroups(){Dt(this.getAllDisplayedTrees(),!1,e=>{e instanceof lt&&e.calculateDisplayedColumns()})}getGroupAutoColumns(){return this.groupAutoColumns}createGroupAutoColumnsIfNeeded(){const e=this.forceRecreateAutoGroups;if(this.forceRecreateAutoGroups=!1,!this.autoGroupsNeedBuilding)return!1;this.autoGroupsNeedBuilding=!1;const t=this.gos.isGroupUseEntireRow(this.pivotMode),i=this.pivotMode?this.gos.get("pivotSuppressAutoColumn"):this.isGroupSuppressAutoColumn();if(!(this.rowGroupColumns.length>0||this.gos.get("treeData"))||i||t)this.groupAutoColumns=null;else{const t=this.autoGroupColService.createAutoGroupColumns(this.rowGroupColumns);if(!this.autoColsEqual(t,this.groupAutoColumns)||e)return this.groupAutoColumns=t,!0}return!1}isGroupSuppressAutoColumn(){return"custom"===this.gos.get("groupDisplayType")||"custom"===this.gos.get("treeDataDisplayType")}autoColsEqual(e,t){return Re(e,t,(e,t)=>e.getColId()===t.getColId())}getWidthOfColsInList(e){return e.reduce((e,t)=>e+t.getActualWidth(),0)}getFirstDisplayedColumn(){const e=this.gos.get("enableRtl"),t=["getDisplayedLeftColumns","getDisplayedCenterColumns","getDisplayedRightColumns"];e&&t.reverse();for(let i=0;i<t.length;i++){const n=this[t[i]]();if(n.length)return e?Ie(n):n[0]}return null}setColumnHeaderHeight(e,t){if(e.setAutoHeaderHeight(t)){const t={type:ct.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,column:e,columns:[e],source:"autosizeColumnHeaderHeight"};this.eventService.dispatchEvent(t)}}getColumnGroupHeaderRowHeight(){return this.isPivotMode()?this.getPivotGroupHeaderHeight():this.getGroupHeaderHeight()}getColumnHeaderRowHeight(){const e=this.isPivotMode()?this.getPivotHeaderHeight():this.getHeaderHeight(),t=this.getAllDisplayedColumns().filter(e=>e.isAutoHeaderHeight()).map(e=>e.getAutoHeaderHeight()||0);return Math.max(e,...t)}getHeaderHeight(){var e;return null!=(e=this.gos.get("headerHeight"))?e:this.environment.getFromTheme(25,"headerHeight")}getFloatingFiltersHeight(){var e;return null!=(e=this.gos.get("floatingFiltersHeight"))?e:this.getHeaderHeight()}getGroupHeaderHeight(){var e;return null!=(e=this.gos.get("groupHeaderHeight"))?e:this.getHeaderHeight()}getPivotHeaderHeight(){var e;return null!=(e=this.gos.get("pivotHeaderHeight"))?e:this.getHeaderHeight()}getPivotGroupHeaderHeight(){var e;return null!=(e=this.gos.get("pivotGroupHeaderHeight"))?e:this.getGroupHeaderHeight()}queueResizeOperations(){this.shouldQueueResizeOperations=!0}processResizeOperations(){this.shouldQueueResizeOperations=!1,this.resizeOperationQueue.forEach(e=>e()),this.resizeOperationQueue=[]}resetColumnDefIntoColumn(e,t){const i=e.getUserProvidedColDef();if(!i)return!1;const n=this.columnFactory.addColumnDefaultAndTypes(i,e.getColId());return e.setColDef(n,i,t),!0}isColumnGroupingLocked(e){const t=this.gos.get("groupLockGroupColumns");return!(!e.isRowGroupActive()||0===t)&&(-1===t||t>this.rowGroupColumns.findIndex(t=>t.getColId()===e.getColId()))}generateColumnStateForRowGroupAndPivotIndexes(e,t){let i={};const n=(e,t,n,s,r,o)=>{if(!t.length||!this.primaryColumns)return[];const a=Object.keys(e),l=new Set(a),c=new Set(a),h=new Set(t.map(e=>{const t=e.getColId();return c.delete(t),t}).concat(a)),u=[],d={};let p=0;for(let e=0;e<this.primaryColumns.length;e++){const t=this.primaryColumns[e].getColId();h.has(t)&&(u.push(t),d[t]=p++)}let g=1e3,f=!1,m=0;const y=t=>{const i=d[t];for(let t=m;t<i;t++){const i=u[t];c.has(i)&&(e[i][r]=g++,c.delete(i))}m=i};t.forEach(t=>{const a=t.getColId();if(l.has(a))y(a),e[a][r]=g++;else{const l=t.getColDef();(null===l[r]||void 0===l[r]&&null==l[o])&&(f||(l[n]||void 0===l[n]&&l[s]?y(a):(c.forEach(t=>{e[t][r]=g+d[t]}),g+=u.length,f=!0)),i[a]||(i[a]={colId:a}),i[a][r]=g++)}})};return n(e,this.rowGroupColumns,"rowGroup","initialRowGroup","rowGroupIndex","initialRowGroupIndex"),n(t,this.pivotColumns,"pivot","initialPivot","pivotIndex","initialPivotIndex"),Object.values(i)}onColumnsReady(){const e=this.gos.get("autoSizeStrategy");if(!e)return;const{type:t}=e;setTimeout(()=>{if("fitGridWidth"===t){const{columnLimits:t,defaultMinWidth:i,defaultMaxWidth:n}=e,s=null==t?void 0:t.map(({colId:e,minWidth:t,maxWidth:i})=>({key:e,minWidth:t,maxWidth:i}));this.ctrlsService.getGridBodyCtrl().sizeColumnsToFit({defaultMinWidth:i,defaultMaxWidth:n,columnLimits:s})}else"fitProvidedWidth"===t&&this.sizeColumnsToFit(e.width,"sizeColumnsToFit")})}onFirstDataRendered(){const e=this.gos.get("autoSizeStrategy");if("fitCellContents"!==(null==e?void 0:e.type))return;const{colIds:t,skipHeader:i}=e;setTimeout(()=>{t?this.autoSizeColumns({columns:t,skipHeader:i,source:"autosizeColumns"}):this.autoSizeAllColumns("autosizeColumns",i)})}};function Tt(e){return"gridOptionsUpdated"===e?"gridOptionsChanged":e}function Dt(e,t,i){if(e)for(let n=0;n<e.length;n++){const s=e[n];s instanceof lt&&Dt(t?s.getDisplayedChildren():s.getChildren(),t,i),i(s)}}g([ue("expressionService")],Mt.prototype,"expressionService",2),g([ue("columnFactory")],Mt.prototype,"columnFactory",2),g([ue("displayedGroupCreator")],Mt.prototype,"displayedGroupCreator",2),g([ue("ctrlsService")],Mt.prototype,"ctrlsService",2),g([ue("autoWidthCalculator")],Mt.prototype,"autoWidthCalculator",2),g([ue("columnAnimationService")],Mt.prototype,"columnAnimationService",2),g([ue("autoGroupColService")],Mt.prototype,"autoGroupColService",2),g([ue("valueCache")],Mt.prototype,"valueCache",2),g([ue("animationFrameService")],Mt.prototype,"animationFrameService",2),g([ue("sortController")],Mt.prototype,"sortController",2),g([ue("columnDefFactory")],Mt.prototype,"columnDefFactory",2),g([de("aggFuncService")],Mt.prototype,"aggFuncService",2),g([le],Mt.prototype,"init",1),g([ce],Mt.prototype,"destroyColumns",1),g([f(0,ge("loggerFactory"))],Mt.prototype,"setBeans",1),Mt=g([he("columnModel")],Mt);var It=class extends st{createDisplayedGroups(e,t,i,n){const s=this.mapOldGroupsById(n),r=[];let o=e;for(;o.length;){const e=o;o=[];let n=0;const a=a=>{const l=n;n=a;const c=e[l],h=(c instanceof lt?c.getProvidedColumnGroup():c).getOriginalParent();if(null==h){for(let t=l;t<a;t++)r.push(e[t]);return}const u=this.createColumnGroup(h,t,s,i);for(let t=l;t<a;t++)u.addChild(e[t]);o.push(u)};for(let t=1;t<e.length;t++){const i=e[t],s=(i instanceof lt?i.getProvidedColumnGroup():i).getOriginalParent(),r=e[n];s!==(r instanceof lt?r.getProvidedColumnGroup():r).getOriginalParent()&&a(t)}n<e.length&&a(e.length)}return this.setupParentsIntoColumns(r,null),r}createColumnGroup(e,t,i,n){const s=e.getGroupId(),r=t.getInstanceIdForKey(s);let o=i[lt.createUniqueId(s,r)];return o&&o.getProvidedColumnGroup()!==e&&(o=null),b(o)?o.reset():(o=new lt(e,s,r,n),this.context.createBean(o)),o}mapOldGroupsById(e){const t={},i=e=>{e.forEach(e=>{if(e instanceof lt){const n=e;t[e.getUniqueId()]=n,i(n.getChildren())}})};return e&&i(e),t}setupParentsIntoColumns(e,t){e.forEach(e=>{if(e.setParent(t),e instanceof lt){const t=e;this.setupParentsIntoColumns(t.getChildren(),t)}})}};It=g([he("displayedGroupCreator")],It);var Rt={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},kt=class{};kt.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"],kt.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"],kt.ARRAY_PROPERTIES=["sortingOrder","alignedGrids","rowData","columnDefs","excelStyles","pinnedTopRowData","pinnedBottomRowData","chartThemes","rowClass","paginationPageSizeSelector"],kt.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"],kt.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"],kt.OTHER_PROPERTIES=["suppressStickyTotalRow"],kt.FUNCTIONAL_PROPERTIES=["doesExternalFilterPass","processPivotResultColDef","processPivotResultColGroupDef","getBusinessKeyForNode","isRowSelectable","rowDragText","groupRowRenderer","fullWidthCellRenderer","loadingCellRenderer","loadingOverlayComponent","noRowsOverlayComponent","detailCellRenderer","quickFilterParser","quickFilterMatcher"],kt.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"],kt.FUNCTION_PROPERTIES=[...kt.FUNCTIONAL_PROPERTIES,...kt.CALLBACK_PROPERTIES],kt.ALL_PROPERTIES=[...kt.ARRAY_PROPERTIES,...kt.OBJECT_PROPERTIES,...kt.STRING_PROPERTIES,...kt.NUMBER_PROPERTIES,...kt.FUNCTION_PROPERTIES,...kt.BOOLEAN_PROPERTIES,...kt.OTHER_PROPERTIES];var Pt=kt,_t=class e{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(t,i){"object"!=typeof t&&(t={});const n=u({},t);return e.getGridOptionKeys().forEach(t=>{const s=i[t];void 0!==s&&s!==e.VUE_OMITTED_PROPERTY&&(n[t]=s)}),n}static processOnChange(t,i,n){if(!t)return;const s={};let r=!1;if(Object.keys(t).filter(t=>e.ALL_PROPERTIES_AND_CALLBACKS_SET.has(t)).forEach(e=>{s[e]=t[e],r=!0}),!r)return;i.__internalUpdateGridOptions(s,!0);const o={type:ct.EVENT_COMPONENT_STATE_CHANGED};P(s,(e,t)=>{o[e]=t}),i.dispatchEvent(o)}};_t.EVENTS=D(ct),_t.VUE_OMITTED_PROPERTY="AG-VUE-OMITTED-PROPERTY",_t.EXCLUDED_INTERNAL_EVENTS=[ct.EVENT_SCROLLBAR_WIDTH_CHANGED,ct.EVENT_CHECKBOX_CHANGED,ct.EVENT_HEIGHT_SCALE_CHANGED,ct.EVENT_BODY_HEIGHT_CHANGED,ct.EVENT_COLUMN_CONTAINER_WIDTH_CHANGED,ct.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,ct.EVENT_SCROLL_VISIBILITY_CHANGED,ct.EVENT_COLUMN_HOVER_CHANGED,ct.EVENT_FLASH_CELLS,ct.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED,ct.EVENT_DISPLAYED_ROWS_CHANGED,ct.EVENT_LEFT_PINNED_WIDTH_CHANGED,ct.EVENT_RIGHT_PINNED_WIDTH_CHANGED,ct.EVENT_ROW_CONTAINER_HEIGHT_CHANGED,ct.EVENT_STORE_UPDATED,ct.EVENT_COLUMN_PANEL_ITEM_DRAG_START,ct.EVENT_COLUMN_PANEL_ITEM_DRAG_END,ct.EVENT_KEY_SHORTCUT_CHANGED_CELL_START,ct.EVENT_KEY_SHORTCUT_CHANGED_CELL_END,ct.EVENT_FULL_WIDTH_ROW_FOCUSED,ct.EVENT_HEADER_HEIGHT_CHANGED,ct.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,ct.EVENT_CELL_FOCUS_CLEARED,ct.EVENT_GRID_STYLES_CHANGED,ct.EVENT_FILTER_DESTROYED,ct.EVENT_ROW_DATA_UPDATE_STARTED,ct.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,ct.EVENT_DATA_TYPES_INFERRED,ct.EVENT_FIELD_VALUE_CHANGED,ct.EVENT_FIELD_PICKER_VALUE_SELECTED,ct.EVENT_SUPPRESS_COLUMN_MOVE_CHANGED,ct.EVENT_SUPPRESS_MENU_HIDE_CHANGED,ct.EVENT_SUPPRESS_FIELD_DOT_NOTATION,ct.EVENT_ROW_COUNT_READY,ct.EVENT_SIDE_BAR_UPDATED],_t.PUBLIC_EVENTS=_t.EVENTS.filter(e=>!He(_t.EXCLUDED_INTERNAL_EVENTS,e)),_t.EVENT_CALLBACKS=_t.EVENTS.map(e=>_t.getCallbackForEvent(e)),_t.BOOLEAN_PROPERTIES=Pt.BOOLEAN_PROPERTIES,_t.ALL_PROPERTIES=Pt.ALL_PROPERTIES,_t.ALL_PROPERTIES_AND_CALLBACKS=[..._t.ALL_PROPERTIES,..._t.EVENT_CALLBACKS],_t.ALL_PROPERTIES_AND_CALLBACKS_SET=new Set(_t.ALL_PROPERTIES_AND_CALLBACKS);var Lt=_t,Nt=class extends st{constructor(){super(...arguments),this.componentsMappedByName={}}setupComponents(e){e&&e.forEach(e=>this.addComponent(e))}addComponent(e){const t=e.componentName.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase().toUpperCase();this.componentsMappedByName[t]=e.componentClass}getComponentClass(e){return this.componentsMappedByName[e]}};Nt=g([he("agStackComponentsRegistry")],Nt);var Ot={};function Ft(e,t,i){null==i||"string"==typeof i&&""==i?Bt(e,t):Gt(e,t,i)}function Gt(e,t,i){e.setAttribute(Vt(t),i.toString())}function Bt(e,t){e.removeAttribute(Vt(t))}function Vt(e){return`aria-${e}`}function Ht(e,t){t?e.setAttribute("role",t):e.removeAttribute("role")}function Ut(e){let t;return t="asc"===e?"ascending":"desc"===e?"descending":"mixed"===e?"other":"none",t}function zt(e){return parseInt(e.getAttribute("aria-level"),10)}function Wt(e){return parseInt(e.getAttribute("aria-posinset"),10)}function jt(e){return e.getAttribute("aria-label")}function $t(e,t){Ft(e,"label",t)}function Kt(e,t){Ft(e,"labelledby",t)}function Yt(e,t){Ft(e,"describedby",t)}function qt(e,t){Ft(e,"live",t)}function Xt(e,t){Ft(e,"atomic",t)}function Zt(e,t){Ft(e,"relevant",t)}function Qt(e,t){Ft(e,"level",t)}function Jt(e,t){Ft(e,"disabled",t)}function ei(e,t){Ft(e,"hidden",t)}function ti(e,t){Ft(e,"activedescendant",t)}function ii(e,t){Gt(e,"expanded",t)}function ni(e){Bt(e,"expanded")}function si(e,t){Gt(e,"setsize",t)}function ri(e,t){Gt(e,"posinset",t)}function oi(e,t){Gt(e,"multiselectable",t)}function ai(e,t){Gt(e,"rowcount",t)}function li(e,t){Gt(e,"rowindex",t)}function ci(e,t){Gt(e,"colcount",t)}function hi(e,t){Gt(e,"colindex",t)}function ui(e,t){Gt(e,"colspan",t)}function di(e,t){Gt(e,"sort",t)}function pi(e){Bt(e,"sort")}function gi(e,t){Ft(e,"selected",t)}function fi(e,t){Gt(e,"checked",void 0===t?"mixed":t)}function mi(e,t){Ft(e,"controls",t.id),Kt(t,e.id)}function yi(e,t){return void 0===t?e("ariaIndeterminate","indeterminate"):!0===t?e("ariaChecked","checked"):e("ariaUnchecked","unchecked")}p(Ot,{getAriaCheckboxStateName:()=>yi,getAriaLabel:()=>jt,getAriaLevel:()=>zt,getAriaPosInSet:()=>Wt,getAriaSortState:()=>Ut,removeAriaExpanded:()=>ni,removeAriaSort:()=>pi,setAriaActiveDescendant:()=>ti,setAriaAtomic:()=>Xt,setAriaChecked:()=>fi,setAriaColCount:()=>ci,setAriaColIndex:()=>hi,setAriaColSpan:()=>ui,setAriaControls:()=>mi,setAriaDescribedBy:()=>Yt,setAriaDisabled:()=>Jt,setAriaExpanded:()=>ii,setAriaHidden:()=>ei,setAriaLabel:()=>$t,setAriaLabelledBy:()=>Kt,setAriaLevel:()=>Qt,setAriaLive:()=>qt,setAriaMultiSelectable:()=>oi,setAriaPosInSet:()=>ri,setAriaRelevant:()=>Zt,setAriaRole:()=>Ht,setAriaRowCount:()=>ai,setAriaRowIndex:()=>li,setAriaSelected:()=>gi,setAriaSetSize:()=>si,setAriaSort:()=>di});var vi,bi,Ci,wi,Si,xi,Ei,Ai,Mi={};function Ti(){return void 0===vi&&(vi=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),vi}function Di(){if(void 0===bi)if(Ti()){const e=navigator.userAgent.match(/version\/(\d+)/i);e&&(bi=null!=e[1]?parseFloat(e[1]):0)}else bi=0;return bi}function Ii(){if(void 0===Ci){const e=window;Ci=!!e.chrome&&(!!e.chrome.webstore||!!e.chrome.runtime)||/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}return Ci}function Ri(){return void 0===wi&&(wi=/(firefox)/i.test(navigator.userAgent)),wi}function ki(){return void 0===Si&&(Si=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)),Si}function Pi(){return void 0===xi&&(xi=/iPad|iPhone|iPod/.test(navigator.platform)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1),xi}function _i(){return!Ti()||Di()>=15}function Li(e){if(!e)return null;const t=e.tabIndex,i=e.getAttribute("tabIndex");return-1!==t||null!==i&&(""!==i||Ri())?t.toString():null}function Ni(){if(!document.body)return-1;let e=1e6;const t=navigator.userAgent.toLowerCase().match(/firefox/)?6e6:1e9,i=document.createElement("div");for(document.body.appendChild(i);;){const n=2*e;if(i.style.height=n+"px",n>t||i.clientHeight!==n)break;e=n}return document.body.removeChild(i),e}function Oi(){var e,t,i;return null!=(i=null==(e=document.body)?void 0:e.clientWidth)?i:window.innerHeight||(null==(t=document.documentElement)?void 0:t.clientWidth)||-1}function Fi(){var e,t,i;return null!=(i=null==(e=document.body)?void 0:e.clientHeight)?i:window.innerHeight||(null==(t=document.documentElement)?void 0:t.clientHeight)||-1}function Gi(){return null==Ai&&Bi(),Ai}function Bi(){const e=document.body,t=document.createElement("div");t.style.width=t.style.height="100px",t.style.opacity="0",t.style.overflow="scroll",t.style.msOverflowStyle="scrollbar",t.style.position="absolute",e.appendChild(t);let i=t.offsetWidth-t.clientWidth;0===i&&0===t.clientWidth&&(i=null),t.parentNode&&t.parentNode.removeChild(t),null!=i&&(Ai=i,Ei=0===i)}function Vi(){return null==Ei&&Bi(),Ei}p(Mi,{browserSupportsPreventScroll:()=>_i,getBodyHeight:()=>Fi,getBodyWidth:()=>Oi,getMaxDivHeight:()=>Ni,getSafariVersion:()=>Di,getScrollbarWidth:()=>Gi,getTabIndex:()=>Li,isBrowserChrome:()=>Ii,isBrowserFirefox:()=>Ri,isBrowserSafari:()=>Ti,isIOSUserAgent:()=>Pi,isInvisibleScrollbar:()=>Vi,isMacOsUserAgent:()=>ki});var Hi={};p(Hi,{dateToFormattedString:()=>Qi,parseDateTimeFromString:()=>Ji,serialiseDate:()=>Xi});var Ui={};function zi(e,t){return e.toString().padStart(t,"0")}function Wi(e,t){const i=[];for(let n=e;n<=t;n++)i.push(n);return i}function ji(e){return"string"==typeof e&&(e=parseInt(e,10)),"number"==typeof e?Math.floor(e):null}function $i(e,t){let i="";for(let n=0;n<t;n++)i+=String.fromCharCode(255&e),e>>>=8;return i}function Ki(e,t,i){return"number"!=typeof e?"":Yi(Math.round(100*e)/100,t,i)}function Yi(e,t,i){return"number"!=typeof e?"":e.toString().replace(".",i).replace(/(\d)(?=(\d{3})+(?!\d))/g,`$1${t}`)}function qi(e){return null==e?null:e.reduce((e,t)=>e+t,0)}function Xi(e,t=!0,i="-"){if(!e)return null;let n=[e.getFullYear(),e.getMonth()+1,e.getDate()].map(e=>zi(e,2)).join(i);return t&&(n+=" "+[e.getHours(),e.getMinutes(),e.getSeconds()].map(e=>zi(e,2)).join(":")),n}p(Ui,{cleanNumber:()=>ji,createArrayOfNumbers:()=>Wi,decToHex:()=>$i,formatNumberCommas:()=>Yi,formatNumberTwoDecimalPlacesAndCommas:()=>Ki,padStartWidthZeros:()=>zi,sum:()=>qi});var Zi=e=>{if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd"}return"th"};function Qi(e,t="YYYY-MM-DD"){const i=zi(e.getFullYear(),4),n=["January","February","March","April","May","June","July","August","September","October","November","December"],s=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],r={YYYY:()=>i.slice(i.length-4,i.length),YY:()=>i.slice(i.length-2,i.length),Y:()=>`${e.getFullYear()}`,MMMM:()=>n[e.getMonth()],MMM:()=>n[e.getMonth()].slice(0,3),MM:()=>zi(e.getMonth()+1,2),Mo:()=>`${e.getMonth()+1}${Zi(e.getMonth()+1)}`,M:()=>`${e.getMonth()+1}`,Do:()=>`${e.getDate()}${Zi(e.getDate())}`,DD:()=>zi(e.getDate(),2),D:()=>`${e.getDate()}`,dddd:()=>s[e.getDay()],ddd:()=>s[e.getDay()].slice(0,3),dd:()=>s[e.getDay()].slice(0,2),do:()=>`${e.getDay()}${Zi(e.getDay())}`,d:()=>`${e.getDay()}`},o=new RegExp(Object.keys(r).join("|"),"g");return t.replace(o,e=>e in r?r[e]():e)}function Ji(e){if(!e)return null;const[t,i]=e.split(" ");if(!t)return null;const n=t.split("-").map(e=>parseInt(e,10));if(3!==n.filter(e=>!isNaN(e)).length)return null;const[s,r,o]=n,a=new Date(s,r-1,o);if(a.getFullYear()!==s||a.getMonth()!==r-1||a.getDate()!==o)return null;if(!i||"00:00:00"===i)return a;const[l,c,h]=i.split(":").map(e=>parseInt(e,10));return l>=0&&l<24&&a.setHours(l),c>=0&&c<60&&a.setMinutes(c),h>=0&&h<60&&a.setSeconds(h),a}var en,tn={};function nn(e,t,i){const n=e.parentElement;let s=n&&n.firstChild;for(;s;)t&&s.classList.toggle(t,s===e),i&&s.classList.toggle(i,s!==e),s=s.nextSibling}p(tn,{FOCUSABLE_EXCLUDE:()=>rn,FOCUSABLE_SELECTOR:()=>sn,addOrRemoveAttribute:()=>Bn,addStylesToElement:()=>Dn,bindCellRendererToHtmlElement:()=>Hn,clearElement:()=>Cn,copyNodeList:()=>Fn,ensureDomOrder:()=>An,formatSize:()=>Nn,getAbsoluteHeight:()=>gn,getAbsoluteWidth:()=>fn,getElementRectWithOffset:()=>mn,getElementSize:()=>un,getInnerHeight:()=>dn,getInnerWidth:()=>pn,getScrollLeft:()=>vn,insertWithDomOrder:()=>Tn,isElementChildOfClass:()=>hn,isFocusableFormField:()=>on,isHorizontalScrollShowing:()=>In,isInDOM:()=>Sn,isNodeOrElement:()=>On,isRtlNegativeScroll:()=>yn,isVerticalScrollShowing:()=>Rn,isVisible:()=>xn,iterateNamedNodeMap:()=>Gn,loadTemplate:()=>En,nodeListForEach:()=>Vn,radioCssClass:()=>nn,removeFromParent:()=>wn,setDisabled:()=>cn,setDisplayed:()=>an,setDomChildOrder:()=>Mn,setElementHeight:()=>_n,setElementWidth:()=>kn,setFixedHeight:()=>Ln,setFixedWidth:()=>Pn,setScrollLeft:()=>bn,setVisible:()=>ln});var sn="[tabindex], input, select, button, textarea, [href]",rn="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function on(e){const t=Element.prototype.matches||Element.prototype.msMatchesSelector,i=t.call(e,"input, select, button, textarea"),n=t.call(e,rn),s=xn(e);return i&&!n&&s}function an(e,t,i={}){const{skipAriaHidden:n}=i;e.classList.toggle("ag-hidden",!t),n||ei(e,!t)}function ln(e,t,i={}){const{skipAriaHidden:n}=i;e.classList.toggle("ag-invisible",!t),n||ei(e,!t)}function cn(e,t){const i="disabled",n=t?e=>e.setAttribute(i,""):e=>e.removeAttribute(i);n(e),Vn(e.querySelectorAll("input"),e=>n(e))}function hn(e,t,i){let n=0;for(;e;){if(e.classList.contains(t))return!0;if(e=e.parentElement,"number"==typeof i){if(++n>i)break}else if(e===i)break}return!1}function un(e){const{height:t,width:i,borderTopWidth:n,borderRightWidth:s,borderBottomWidth:r,borderLeftWidth:o,paddingTop:a,paddingRight:l,paddingBottom:c,paddingLeft:h,marginTop:u,marginRight:d,marginBottom:p,marginLeft:g,boxSizing:f}=window.getComputedStyle(e);return{height:parseFloat(t||"0"),width:parseFloat(i||"0"),borderTopWidth:parseFloat(n||"0"),borderRightWidth:parseFloat(s||"0"),borderBottomWidth:parseFloat(r||"0"),borderLeftWidth:parseFloat(o||"0"),paddingTop:parseFloat(a||"0"),paddingRight:parseFloat(l||"0"),paddingBottom:parseFloat(c||"0"),paddingLeft:parseFloat(h||"0"),marginTop:parseFloat(u||"0"),marginRight:parseFloat(d||"0"),marginBottom:parseFloat(p||"0"),marginLeft:parseFloat(g||"0"),boxSizing:f}}function dn(e){const t=un(e);return"border-box"===t.boxSizing?t.height-t.paddingTop-t.paddingBottom:t.height}function pn(e){const t=un(e);return"border-box"===t.boxSizing?t.width-t.paddingLeft-t.paddingRight:t.width}function gn(e){const t=un(e),i=t.marginBottom+t.marginTop;return Math.ceil(e.offsetHeight+i)}function fn(e){const t=un(e),i=t.marginLeft+t.marginRight;return Math.ceil(e.offsetWidth+i)}function mn(e){const t=e.getBoundingClientRect(),{borderTopWidth:i,borderLeftWidth:n,borderRightWidth:s,borderBottomWidth:r}=un(e);return{top:t.top+(i||0),left:t.left+(n||0),right:t.right+(s||0),bottom:t.bottom+(r||0)}}function yn(){if("boolean"==typeof en)return en;const e=document.createElement("div");return e.style.direction="rtl",e.style.width="1px",e.style.height="1px",e.style.position="fixed",e.style.top="0px",e.style.overflow="hidden",e.dir="rtl",e.innerHTML='<div style="width: 2px">\n            <span style="display: inline-block; width: 1px"></span>\n            <span style="display: inline-block; width: 1px"></span>\n        </div>',document.body.appendChild(e),e.scrollLeft=1,en=0===Math.floor(e.scrollLeft),document.body.removeChild(e),en}function vn(e,t){let i=e.scrollLeft;return t&&(i=Math.abs(i),Ii()&&!yn()&&(i=e.scrollWidth-e.clientWidth-i)),i}function bn(e,t,i){i&&(yn()?t*=-1:(Ti()||Ii())&&(t=e.scrollWidth-e.clientWidth-t)),e.scrollLeft=t}function Cn(e){for(;e&&e.firstChild;)e.removeChild(e.firstChild)}function wn(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Sn(e){return!!e.offsetParent}function xn(e){const t=e;return t.checkVisibility?t.checkVisibility({checkVisibilityCSS:!0}):!(!Sn(e)||"visible"!==window.getComputedStyle(e).visibility)}function En(e){const t=document.createElement("div");return t.innerHTML=(e||"").trim(),t.firstChild}function An(e,t,i){i&&i.nextSibling===t||(i?i.nextSibling?e.insertBefore(t,i.nextSibling):e.appendChild(t):e.firstChild&&e.firstChild!==t&&e.insertAdjacentElement("afterbegin",t))}function Mn(e,t){for(let i=0;i<t.length;i++){const n=t[i],s=e.children[i];s!==n&&e.insertBefore(n,s)}}function Tn(e,t,i){i?i.insertAdjacentElement("afterend",t):e.firstChild?e.insertAdjacentElement("afterbegin",t):e.appendChild(t)}function Dn(e,t){if(t)for(const[i,n]of Object.entries(t)){if(!i||!i.length||null==n)continue;const t=wt(i),s=n.toString(),r=s.replace(/\s*!important/g,""),o=r.length!=s.length?"important":void 0;e.style.setProperty(t,r,o)}}function In(e){return e.clientWidth<e.scrollWidth}function Rn(e){return e.clientHeight<e.scrollHeight}function kn(e,t){"flex"===t?(e.style.removeProperty("width"),e.style.removeProperty("minWidth"),e.style.removeProperty("maxWidth"),e.style.flex="1 1 auto"):Pn(e,t)}function Pn(e,t){t=Nn(t),e.style.width=t.toString(),e.style.maxWidth=t.toString(),e.style.minWidth=t.toString()}function _n(e,t){"flex"===t?(e.style.removeProperty("height"),e.style.removeProperty("minHeight"),e.style.removeProperty("maxHeight"),e.style.flex="1 1 auto"):Ln(e,t)}function Ln(e,t){t=Nn(t),e.style.height=t.toString(),e.style.maxHeight=t.toString(),e.style.minHeight=t.toString()}function Nn(e){return"number"==typeof e?`${e}px`:e}function On(e){return e instanceof Node||e instanceof HTMLElement}function Fn(e){if(null==e)return[];const t=[];return Vn(e,e=>t.push(e)),t}function Gn(e,t){if(e)for(let i=0;i<e.length;i++){const n=e[i];t(n.name,n.value)}}function Bn(e,t,i){null==i?e.removeAttribute(t):e.setAttribute(t,i.toString())}function Vn(e,t){if(null!=e)for(let i=0;i<e.length;i++)t(e[i])}function Hn(e,t){e.then(e=>{const i=e.getGui();null!=i&&("object"==typeof i?t.appendChild(i):t.innerHTML=i)})}var Un={};function zn(e,t,i){const n={},s=e.filter(e=>!t.some(t=>t===e));return s.length>0&&s.forEach(e=>n[e]=Wn(e,i).values),n}function Wn(e,t,i,n){let s=t.map((t,i)=>({value:t,relevance:jn(e.toLowerCase(),t.toLocaleLowerCase()),idx:i}));if(s.sort((e,t)=>t.relevance-e.relevance),i&&(s=s.filter(e=>0!==e.relevance)),s.length>0&&n&&n>0){const e=s[0].relevance*n;s=s.filter(t=>e-t.relevance<0)}const r=[],o=[];for(const e of s)r.push(e.value),o.push(e.idx);return{values:r,indices:o}}function jn(e,t){const i=e.replace(/\s/g,""),n=t.replace(/\s/g,"");let s=0,r=-1;for(let e=0;e<i.length;e++){const t=n.indexOf(i[e],r+1);-1!==t&&(r=t,s+=100-100*r/1e4*100)}return s}p(Un,{fuzzyCheckStrings:()=>zn,fuzzySuggestions:()=>Wn});var $n={};p($n,{createIcon:()=>Yn,createIconNoSpan:()=>qn,iconNameClassMap:()=>Kn});var Kn={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 Yn(e,t,i){const n=qn(e,t,i);if(n){const{className:e}=n;if("string"==typeof e&&e.indexOf("ag-icon")>-1||"object"==typeof e&&e["ag-icon"])return n}const s=document.createElement("span");return s.appendChild(n),s}function qn(e,t,i,n){let s=null;const r=i&&i.getColDef().icons;if(r&&(s=r[e]),t&&!s){const i=t.get("icons");i&&(s=i[e])}if(!s){const t=document.createElement("span");let i=Kn[e];return i||(n?i=e:(console.warn(`AG Grid: Did not find icon ${e}`),i="")),t.setAttribute("class",`ag-icon ag-icon-${i}`),t.setAttribute("unselectable","on"),Ht(t,"presentation"),t}{let e;if("function"==typeof s)e=s();else{if("string"!=typeof s)throw new Error("icon from grid options needs to be a string or a function");e=s}if("string"==typeof e)return En(e);if(On(e))return e;console.warn("AG Grid: iconRenderer should return back a string or a dom object")}}var Xn={};p(Xn,{isDeleteKey:()=>is,isEventFromPrintableCharacter:()=>Qn,isUserSuppressingHeaderKeyboardEvent:()=>es,isUserSuppressingKeyboardEvent:()=>Jn,normaliseQwertyAzerty:()=>ts});var Zn=class{};function Qn(e){return!(e.altKey||e.ctrlKey||e.metaKey)&&1===e.key.length}function Jn(e,t,i,n,s){const r=n?n.getColDef().suppressKeyboardEvent:void 0;if(!r)return!1;const o=e.addGridCommonParams({event:t,editing:s,column:n,node:i,data:i.data,colDef:n.getColDef()});return!(!r||!r(o))}function es(e,t,i,n){const s=n.getDefinition(),r=s&&s.suppressHeaderKeyboardEvent;return!!b(r)&&!!r(e.addGridCommonParams({colDef:s,column:n,headerRowIndex:i,event:t}))}function ts(e){const{keyCode:t}=e;let i;switch(t){case 65:i=Zn.A;break;case 67:i=Zn.C;break;case 86:i=Zn.V;break;case 68:i=Zn.D;break;case 90:i=Zn.Z;break;case 89:i=Zn.Y;break;default:i=e.code}return i}function is(e,t=!1){return e===Zn.DELETE||!t&&e===Zn.BACKSPACE&&ki()}Zn.BACKSPACE="Backspace",Zn.TAB="Tab",Zn.ENTER="Enter",Zn.ESCAPE="Escape",Zn.SPACE=" ",Zn.LEFT="ArrowLeft",Zn.UP="ArrowUp",Zn.RIGHT="ArrowRight",Zn.DOWN="ArrowDown",Zn.DELETE="Delete",Zn.F2="F2",Zn.PAGE_UP="PageUp",Zn.PAGE_DOWN="PageDown",Zn.PAGE_HOME="Home",Zn.PAGE_END="End",Zn.A="KeyA",Zn.C="KeyC",Zn.D="KeyD",Zn.V="KeyV",Zn.X="KeyX",Zn.Y="KeyY",Zn.Z="KeyZ";var ns={};function ss(e,t,i){if(0===i)return!1;const n=Math.abs(e.clientX-t.clientX),s=Math.abs(e.clientY-t.clientY);return Math.max(n,s)<=i}p(ns,{areEventsNear:()=>ss});var rs={};function os(e,t){if(!e)return!1;const i=(e,i)=>{const n=t[e.id],s=t[i.id],r=void 0!==n,o=void 0!==s;return r&&o?n-s:r||o?r?1:-1:e.__objectId-i.__objectId};let n,s,r=!1;for(let t=0;t<e.length-1;t++)if(n=e[t],s=e[t+1],i(n,s)>0){r=!0;break}return!!r&&(e.sort(i),!0)}p(rs,{sortRowNodesByOrder:()=>os});var as={};function ls(e){const t=new Set;return e.forEach(e=>t.add(e)),t}p(as,{convertToSet:()=>ls});var cs=u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u({},Ot),Te),Mi),Hi),tn),Me),V),Un),y),$n),Xn),St),ns),Ui),R),rs),as),gt),hs=class{constructor(e=0,t=1){this.nextValue=e,this.step=t}next(){const e=this.nextValue;return this.nextValue+=this.step,e}peek(){return this.nextValue}skip(e){this.nextValue+=e}},us=(e=>(e[e.IN_PROGRESS=0]="IN_PROGRESS",e[e.RESOLVED=1]="RESOLVED",e))(us||{}),ds=class e{constructor(e){this.status=0,this.resolution=null,this.waiters=[],e(e=>this.onDone(e),e=>this.onReject(e))}static all(t){return new e(e=>{let i=t.length;const n=new Array(i);t.forEach((t,s)=>{t.then(t=>{n[s]=t,i--,0===i&&e(n)})})})}static resolve(t=null){return new e(e=>e(t))}then(t){return new e(e=>{1===this.status?e(t(this.resolution)):this.waiters.push(i=>e(t(i)))})}resolveNow(e,t){return 1===this.status?t(this.resolution):e}onDone(e){this.status=1,this.resolution=e,this.waiters.forEach(t=>t(e))}onReject(e){console.warn("TBI")}},ps=class{constructor(){this.timestamp=(new Date).getTime()}print(e){const t=(new Date).getTime()-this.timestamp;console.info(`${e} = ${t}`),this.timestamp=(new Date).getTime()}},gs=class{constructor(e){this.cssClassStates={},this.getGui=e}addCssClass(e){const t=(e||"").split(" ");if(t.length>1)t.forEach(e=>this.addCssClass(e));else if(!0!==this.cssClassStates[e]&&e.length){const t=this.getGui();t&&t.classList.add(e),this.cssClassStates[e]=!0}}removeCssClass(e){const t=(e||"").split(" ");if(t.length>1)t.forEach(e=>this.removeCssClass(e));else if(!1!==this.cssClassStates[e]&&e.length){const t=this.getGui();t&&t.classList.remove(e),this.cssClassStates[e]=!1}}containsCssClass(e){const t=this.getGui();return!!t&&t.classList.contains(e)}addOrRemoveCssClass(e,t){if(e){if(e.indexOf(" ")>=0){const i=(e||"").split(" ");if(i.length>1)return void i.forEach(e=>this.addOrRemoveCssClass(e,t))}if(this.cssClassStates[e]!==t&&e.length){const i=this.getGui();i&&i.classList.toggle(e,t),this.cssClassStates[e]=t}}}},fs=class e extends st{constructor(e,t,i,n){super(),this.parentComp=e,this.tooltipShowDelayOverride=t,this.tooltipHideDelayOverride=i,this.shouldDisplayTooltip=n,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();0===this.tooltipTrigger&&(this.addManagedListener(e,"mouseenter",this.onMouseEnter.bind(this)),this.addManagedListener(e,"mouseleave",this.onMouseLeave.bind(this))),1===this.tooltipTrigger&&(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&&z(`${e} should not be lower than 0`),Math.max(200,t)}getTooltipDelay(e){var t,i;return"show"===e?null!=(t=this.tooltipShowDelayOverride)?t:this.getGridOptionsTooltipDelay("tooltipShowDelay"):null!=(i=this.tooltipHideDelayOverride)?i:this.getGridOptionsTooltipDelay("tooltipHideDelay")}destroy(){this.setToDoNothing(),super.destroy()}getTooltipTrigger(){const e=this.gos.get("tooltipTrigger");return e&&"hover"!==e?1:0}onMouseEnter(t){this.interactionEnabled&&this.interactiveTooltipTimeoutId&&(this.unlockService(),this.startHideTimeout()),Pi()||(e.isLocked?this.showTooltipTimeoutId=window.setTimeout(()=>{this.prepareToShowTooltip(t)},this.INTERACTIVE_HIDE_DELAY):this.prepareToShowTooltip(t))}onMouseMove(e){this.lastMouseEvent&&(this.lastMouseEvent=e),this.tooltipMouseTrack&&2===this.state&&this.tooltipComp&&this.positionTooltip()}onMouseDown(){this.setToDoNothing()}onMouseLeave(){this.interactionEnabled?this.lockService():this.setToDoNothing()}onFocusIn(){this.prepareToShowTooltip()}onFocusOut(e){var t;const i=e.relatedTarget,n=this.parentComp.getGui(),s=null==(t=this.tooltipComp)?void 0:t.getGui();this.isInteractingWithTooltip||n.contains(i)||this.interactionEnabled&&(null==s?void 0:s.contains(i))||this.setToDoNothing()}onKeyDown(){this.setToDoNothing()}prepareToShowTooltip(t){if(0!=this.state||e.isLocked)return;let i=0;t&&(i=this.isLastTooltipHiddenRecently()?200:this.getTooltipDelay("show")),this.lastMouseEvent=t||null,this.showTooltipTimeoutId=window.setTimeout(this.showTooltip.bind(this),i),this.state=1}isLastTooltipHiddenRecently(){return(new Date).getTime()-e.lastTooltipHideTime<this.SHOW_QUICK_TOOLTIP_DIFF}setToDoNothing(){2===this.state&&this.hideTooltip(),this.onBodyScrollEventCallback&&(this.onBodyScrollEventCallback(),this.onBodyScrollEventCallback=void 0),this.onColumnMovedEventCallback&&(this.onColumnMovedEventCallback(),this.onColumnMovedEventCallback=void 0),this.clearTimeouts(),this.state=0,this.lastMouseEvent=null}showTooltip(){const e=u({},this.parentComp.getTooltipParams());if(!b(e.value)||this.shouldDisplayTooltip&&!this.shouldDisplayTooltip())return void this.setToDoNothing();this.state=2,this.tooltipInstanceCount++;const t=this.newTooltipComponentCallback.bind(this,this.tooltipInstanceCount);this.userComponentFactory.getTooltipCompDetails(e).newAgStackInstance().then(t)}hideTooltip(t){if(!t&&this.isInteractingWithTooltip)return;this.tooltipComp&&(this.destroyTooltipComp(),e.lastTooltipHideTime=(new Date).getTime());const i={type:ct.EVENT_TOOLTIP_HIDE,parentGui:this.parentComp.getGui()};this.eventService.dispatchEvent(i),this.state=0}newTooltipComponentCallback(e,t){if(2!==this.state||this.tooltipInstanceCount!==e)return void this.getContext().destroyBean(t);const i=t.getGui();this.tooltipComp=t,i.classList.contains("ag-tooltip")||i.classList.add("ag-tooltip-custom"),0===this.tooltipTrigger&&i.classList.add("ag-tooltip-animate"),this.interactionEnabled&&i.classList.add("ag-tooltip-interactive");const n=this.localeService.getLocaleTextFunc(),s=this.popupService.addPopup({eChild:i,ariaLabel:n("ariaLabelTooltip","Tooltip")});s&&(this.tooltipPopupDestroyFunc=s.hideFunc),this.positionTooltip(),1===this.tooltipTrigger&&(this.onBodyScrollEventCallback=this.addManagedListener(this.eventService,ct.EVENT_BODY_SCROLL,this.setToDoNothing.bind(this)),this.onColumnMovedEventCallback=this.addManagedListener(this.eventService,ct.EVENT_COLUMN_MOVED,this.setToDoNothing.bind(this))),this.interactionEnabled&&(0===this.tooltipTrigger?(this.tooltipMouseEnterListener=this.addManagedListener(i,"mouseenter",this.onTooltipMouseEnter.bind(this))||null,this.tooltipMouseLeaveListener=this.addManagedListener(i,"mouseleave",this.onTooltipMouseLeave.bind(this))||null):(this.tooltipFocusInListener=this.addManagedListener(i,"focusin",this.onTooltipFocusIn.bind(this))||null,this.tooltipFocusOutListener=this.addManagedListener(i,"focusout",this.onTooltipFocusOut.bind(this))||null));const r={type:ct.EVENT_TOOLTIP_SHOW,tooltipGui:i,parentGui:this.parentComp.getGui()};this.eventService.dispatchEvent(r),this.startHideTimeout()}onTooltipMouseEnter(){this.isInteractingWithTooltip=!0,this.unlockService()}onTooltipMouseLeave(){this.isInteractingWithTooltip=!1,this.lockService()}onTooltipFocusIn(){this.isInteractingWithTooltip=!0}onTooltipFocusOut(e){var t;const i=this.parentComp.getGui(),n=null==(t=this.tooltipComp)?void 0:t.getGui(),s=e.relatedTarget;(null==n?void 0:n.contains(s))||(this.isInteractingWithTooltip=!1,i.contains(s)?this.startHideTimeout():this.hideTooltip())}positionTooltip(){const e={type:"tooltip",ePopup:this.tooltipComp.getGui(),nudgeY:18,skipObserver:this.tooltipMouseTrack};this.lastMouseEvent?this.popupService.positionPopupUnderMouseEvent(d(u({},e),{mouseEvent:this.lastMouseEvent})):this.popupService.positionPopupByComponent(d(u({},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,i=0===this.tooltipTrigger?this.FADE_OUT_TOOLTIP_TIMEOUT:0;window.setTimeout(()=>{e(),this.getContext().destroyBean(t)},i),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(){e.isLocked=!0,this.interactiveTooltipTimeoutId=window.setTimeout(()=>{this.unlockService(),this.setToDoNothing()},this.INTERACTIVE_HIDE_DELAY)}unlockService(){e.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()}};fs.isLocked=!1,g([ue("popupService")],fs.prototype,"popupService",2),g([ue("userComponentFactory")],fs.prototype,"userComponentFactory",2),g([le],fs.prototype,"postConstruct",1);var ms=fs,ys=class extends st{constructor(e,t){super(),this.ctrl=e,t&&(this.beans=t)}postConstruct(){this.refreshToolTip()}setBrowserTooltip(e){const t="title",i=this.ctrl.getGui();i&&(null!=e&&""!=e?i.setAttribute(t,e):i.removeAttribute(t))}updateTooltipText(){this.tooltip=this.ctrl.getTooltipValue()}createTooltipFeatureIfNeeded(){var e,t,i,n;if(null!=this.tooltipManager)return;const s={getTooltipParams:()=>this.getTooltipParams(),getGui:()=>this.ctrl.getGui()};this.tooltipManager=this.createBean(new ms(s,null==(t=(e=this.ctrl).getTooltipShowDelayOverride)?void 0:t.call(e),null==(n=(i=this.ctrl).getTooltipHideDelayOverride)?void 0:n.call(i),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 e=this.ctrl,t=e.getColumn?e.getColumn():void 0,i=e.getColDef?e.getColDef():void 0,n=e.getRowNode?e.getRowNode():void 0;return{location:e.getLocation(),colDef:i,column:t,rowIndex:e.getRowIndex?e.getRowIndex():void 0,node:n,data:n?n.data:void 0,value:this.getTooltipText(),valueFormatted:e.getValueFormatted?e.getValueFormatted():void 0,hideTooltipCallback:()=>{var e;return null==(e=this.tooltipManager)?void 0:e.hideTooltip(!0)}}}getTooltipText(){return this.tooltip}destroy(){this.tooltipManager&&(this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context)),super.destroy()}};g([ue("beans")],ys.prototype,"beans",2),g([le],ys.prototype,"postConstruct",1);var vs=new hs,bs=class e extends st{constructor(e){super(),this.displayed=!0,this.visible=!0,this.compId=vs.next(),this.cssClassManager=new gs(()=>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:i,hideDelayOverride:n,location:s,shouldDisplayTooltip:r}=e||{};this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),this.tooltipText!==t&&(this.tooltipText=t);null!=t&&(this.tooltipFeature=this.createBean(new ys({getTooltipValue:()=>this.tooltipText,getGui:()=>this.getGui(),getLocation:()=>null!=s?s:"UNKNOWN",getColDef:null==e?void 0:e.getColDef,getColumn:null==e?void 0:e.getColumn,getTooltipShowDelayOverride:null!=i?()=>i:void 0,getTooltipHideDelayOverride:null!=n?()=>n:void 0,shouldDisplayTooltip:r})))}createChildComponentsFromTags(e,t){Fn(e.childNodes).forEach(i=>{if(!(i instanceof HTMLElement))return;const n=this.createComponentFromElement(i,e=>{e.getGui()&&this.copyAttributesFromNode(i,e.getGui())},t);if(n){if(n.addItems&&i.children.length){this.createChildComponentsFromTags(i,t);const e=Array.prototype.slice.call(i.children);n.addItems(e)}this.swapComponentForNode(n,e,i)}else i.childNodes&&this.createChildComponentsFromTags(i,t)})}createComponentFromElement(t,i,n){const s=t.nodeName,r=n?n[t.getAttribute("ref")]:void 0,o=this.agStackComponentsRegistry.getComponentClass(s);if(o){e.elementGettingCreated=t;const n=new o(r);return n.setParentComponent(this),this.createBean(n,null,i),n}return null}copyAttributesFromNode(e,t){Gn(e.attributes,(e,i)=>t.setAttribute(e,i))}swapComponentForNode(e,t,i){const n=e.getGui();t.replaceChild(n,i),t.insertBefore(document.createComment(i.nodeName),n),this.addDestroyFunc(this.destroyBean.bind(this,e)),this.swapInComponentForQuerySelectors(e,i)}swapInComponentForQuerySelectors(e,t){const i=this;this.iterateOverQuerySelectors(n=>{i[n.attributeName]===t&&(i[n.attributeName]=e)})}iterateOverQuerySelectors(e){let t=Object.getPrototypeOf(this);for(;null!=t;){const i=t.__agComponentMetaData,n=j(t.constructor);i&&i[n]&&i[n].querySelectors&&i[n].querySelectors.forEach(t=>e(t)),t=Object.getPrototypeOf(t)}}activateTabIndex(e){const t=this.gos.get("tabIndex");e||(e=[]),e.length||e.push(this.getGui()),e.forEach(e=>e.setAttribute("tabindex",t.toString()))}setTemplate(e,t){const i=En(e);this.setTemplateFromElement(i,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 i=i=>e[t.attributeName]=i;if(t.refSelector&&this.getAttribute("ref")===t.refSelector)i(this.eGui);else{const e=this.eGui.querySelector(t.querySelector);e&&i(e.__agComponent||e)}})}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(null!=e)if(t||(t=this.eGui),On(e))t.appendChild(e);else{const i=e;t.appendChild(i.getGui())}}isDisplayed(){return this.displayed}setVisible(e,t={}){if(e!==this.visible){this.visible=e;const{skipAriaHidden:i}=t;ln(this.eGui,e,{skipAriaHidden:i})}}setDisplayed(t,i={}){if(t!==this.displayed){this.displayed=t;const{skipAriaHidden:n}=i;an(this.eGui,t,{skipAriaHidden:n});const s={type:e.EVENT_DISPLAYED_CHANGED,visible:this.displayed};this.dispatchEvent(s)}}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,i){this.eGui.addEventListener(e,t,i),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}"]`)}};bs.EVENT_DISPLAYED_CHANGED="displayedChanged",g([ue("agStackComponentsRegistry")],bs.prototype,"agStackComponentsRegistry",2),g([ae],bs.prototype,"preConstructOnComponent",1),g([ae],bs.prototype,"createChildComponentsPreConstruct",1);var Cs=bs;function ws(e){return xs.bind(this,e,void 0)}function Ss(e){return xs.bind(this,`[ref=${e}]`,e)}function xs(e,t,i,n,s){null!==e?"number"!=typeof s?function(e,t,i){const n=function(e,t){return e.__agComponentMetaData||(e.__agComponentMetaData={}),e.__agComponentMetaData[t]||(e.__agComponentMetaData[t]={}),e.__agComponentMetaData[t]}(e,j(e.constructor));n[t]||(n[t]=[]),n[t].push(i)}(i,"querySelectors",{attributeName:n,querySelector:e,refSelector:t}):console.error("AG Grid: QuerySelector should be on an attribute"):console.error("AG Grid: QuerySelector selector should not be null")}var Es=class extends Cs{constructor(){super('\n            <div class="ag-floating-filter-input" role="presentation">\n                <ag-input-text-field ref="eFloatingFilterText"></ag-input-text-field>\n            </div>')}destroy(){super.destroy()}init(e){this.params=e;const t=this.columnModel.getDisplayNameForColumn(e.column,"header",!0),i=this.localeService.getLocaleTextFunc();this.eFloatingFilterText.setDisabled(!0).setInputAriaLabel(`${t} ${i("ariaFilterInput","Filter Input")}`)}onParentModelChanged(e){null!=e?this.params.parentFilterInstance(t=>{if(t.getModelAsString){const i=t.getModelAsString(e);this.eFloatingFilterText.setValue(i)}}):this.eFloatingFilterText.setValue("")}onParamsUpdated(e){this.refresh(e)}refresh(e){this.init(e)}};g([Ss("eFloatingFilterText")],Es.prototype,"eFloatingFilterText",2),g([ue("columnModel")],Es.prototype,"columnModel",2);var As=class{constructor(e,t,i,n,s){this.alive=!0,this.context=e,this.eParent=n,t.getDateCompDetails(i).newAgStackInstance().then(t=>{this.alive?(this.dateComp=t,t&&(n.appendChild(t.getGui()),t.afterGuiAttached&&t.afterGuiAttached(),this.tempValue&&t.setDate(this.tempValue),null!=this.disabled&&this.setDateCompDisabled(this.disabled),null==s||s(this))):e.destroyBean(t)})}destroy(){this.alive=!1,this.dateComp=this.context.destroyBean(this.dateComp)}getDate(){return this.dateComp?this.dateComp.getDate():this.tempValue}setDate(e){this.dateComp?this.dateComp.setDate(e):this.tempValue=e}setDisabled(e){this.dateComp?this.setDateCompDisabled(e):this.disabled=e}setDisplayed(e){an(this.eParent,e)}setInputPlaceholder(e){this.dateComp&&this.dateComp.setInputPlaceholder&&this.dateComp.setInputPlaceholder(e)}setInputAriaLabel(e){this.dateComp&&this.dateComp.setInputAriaLabel&&this.dateComp.setInputAriaLabel(e)}afterGuiAttached(e){this.dateComp&&"function"==typeof this.dateComp.afterGuiAttached&&this.dateComp.afterGuiAttached(e)}updateParams(e){var t,i;let n=!1;(null==(t=this.dateComp)?void 0:t.refresh)&&"function"==typeof this.dateComp.refresh&&null!==this.dateComp.refresh(e)&&(n=!0),!n&&(null==(i=this.dateComp)?void 0:i.onParamsUpdated)&&"function"==typeof this.dateComp.onParamsUpdated&&null!==this.dateComp.onParamsUpdated(e)&&z("Custom date component method 'onParamsUpdated' is deprecated. Use 'refresh' instead.")}setDateCompDisabled(e){null!=this.dateComp&&null!=this.dateComp.setDisabled&&this.dateComp.setDisabled(e)}},Ms=class{constructor(){this.customFilterOptions={}}init(e,t){this.filterOptions=e.filterOptions||t,this.mapCustomOptions(),this.selectDefaultItem(e)}getFilterOptions(){return this.filterOptions}mapCustomOptions(){this.filterOptions&&this.filterOptions.forEach(e=>{"string"!=typeof e&&([["displayKey"],["displayName"],["predicate","test"]].every(t=>!!t.some(t=>null!=e[t])||(console.warn(`AG Grid: ignoring FilterOptionDef as it doesn't contain one of '${t}'`),!1))?this.customFilterOptions[e.displayKey]=e:this.filterOptions=this.filterOptions.filter(t=>t===e)||[])})}selectDefaultItem(e){if(e.defaultOption)this.defaultOption=e.defaultOption;else if(this.filterOptions.length>=1){const e=this.filterOptions[0];"string"==typeof e?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(e){return this.customFilterOptions[e]}},Ts={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"},Ds=class e extends st{constructor(e,t={}){super(),this.eFocusableElement=e,this.callbacks=t,this.callbacks=u({shouldStopEventPropagation:()=>!1,onTabKeyDown:e=>{if(e.defaultPrevented)return;const t=this.focusService.findNextFocusableElement(this.eFocusableElement,!1,e.shiftKey);t&&(t.focus(),e.preventDefault())}},t)}postConstruct(){this.eFocusableElement.classList.add(e.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",e=>{e.defaultPrevented||Xe(e)||(this.callbacks.shouldStopEventPropagation(e)?qe(e):e.key===Zn.TAB?this.callbacks.onTabKeyDown(e):this.callbacks.handleKeyDown&&this.callbacks.handleKeyDown(e))})}};Ds.FOCUS_MANAGED_CLASS="ag-focus-managed",g([ue("focusService")],Ds.prototype,"focusService",2),g([le],Ds.prototype,"postConstruct",1);var Is=Ds,Rs="ag-resizer-wrapper",ks=`<div class="${Rs}">\n        <div ref="eTopLeftResizer" class="ag-resizer ag-resizer-topLeft"></div>\n        <div ref="eTopResizer" class="ag-resizer ag-resizer-top"></div>\n        <div ref="eTopRightResizer" class="ag-resizer ag-resizer-topRight"></div>\n        <div ref="eRightResizer" class="ag-resizer ag-resizer-right"></div>\n        <div ref="eBottomRightResizer" class="ag-resizer ag-resizer-bottomRight"></div>\n        <div ref="eBottomResizer" class="ag-resizer ag-resizer-bottom"></div>\n        <div ref="eBottomLeftResizer" class="ag-resizer ag-resizer-bottomLeft"></div>\n        <div ref="eLeftResizer" class="ag-resizer ag-resizer-left"></div>\n    </div>`,Ps=class extends st{constructor(e,t){super(),this.element=e,this.dragStartPosition={x:0,y:0},this.position={x:0,y:0},this.lastSize={width:-1,height:-1},this.positioned=!1,this.resizersAdded=!1,this.resizeListeners=[],this.boundaryEl=null,this.isResizing=!1,this.isMoving=!1,this.resizable={},this.movable=!1,this.currentResizer=null,this.config=Object.assign({},{popup:!1},t)}center(){const{clientHeight:e,clientWidth:t}=this.offsetParent,i=t/2-this.getWidth()/2,n=e/2-this.getHeight()/2;this.offsetElement(i,n)}initialisePosition(){if(this.positioned)return;const{centered:e,forcePopupParentAsOffsetParent:t,minWidth:i,width:n,minHeight:s,height:r,x:o,y:a}=this.config;this.offsetParent||this.setOffsetParent();let l=0,c=0;const h=xn(this.element);if(h){const e=this.findBoundaryElement(),t=window.getComputedStyle(e);if(null!=t.minWidth){const i=e.offsetWidth-this.element.offsetWidth;c=parseInt(t.minWidth,10)-i}if(null!=t.minHeight){const i=e.offsetHeight-this.element.offsetHeight;l=parseInt(t.minHeight,10)-i}}if(this.minHeight=s||l,this.minWidth=i||c,n&&this.setWidth(n),r&&this.setHeight(r),n&&r||this.refreshSize(),e)this.center();else if(o||a)this.offsetElement(o,a);else if(h&&t){let e=this.boundaryEl,t=!0;if(e||(e=this.findBoundaryElement(),t=!1),e){const i=parseFloat(e.style.top),n=parseFloat(e.style.left);t?this.offsetElement(isNaN(n)?0:n,isNaN(i)?0:i):this.setPosition(n,i)}}this.positioned=!!this.offsetParent}isPositioned(){return this.positioned}getPosition(){return this.position}setMovable(e,t){if(!this.config.popup||e===this.movable)return;this.movable=e;const i=this.moveElementDragListener||{eElement:t,onDragStart:this.onMoveStart.bind(this),onDragging:this.onMove.bind(this),onDragStop:this.onMoveEnd.bind(this)};e?(this.dragService.addDragSource(i),this.moveElementDragListener=i):(this.dragService.removeDragSource(i),this.moveElementDragListener=void 0)}setResizable(e){if(this.clearResizeListeners(),e?this.addResizers():this.removeResizers(),"boolean"==typeof e){if(!1===e)return;e={topLeft:e,top:e,topRight:e,right:e,bottomRight:e,bottom:e,bottomLeft:e,left:e}}Object.keys(e).forEach(t=>{const i=!!e[t],n=this.getResizerElement(t),s={dragStartPixels:0,eElement:n,onDragStart:e=>this.onResizeStart(e,t),onDragging:this.onResize.bind(this),onDragStop:e=>this.onResizeEnd(e,t)};(i||!this.isAlive()&&!i)&&(i?(this.dragService.addDragSource(s),this.resizeListeners.push(s),n.style.pointerEvents="all"):n.style.pointerEvents="none",this.resizable[t]=i)})}removeSizeFromEl(){this.element.style.removeProperty("height"),this.element.style.removeProperty("width"),this.element.style.removeProperty("flex")}restoreLastSize(){this.element.style.flex="0 0 auto";const{height:e,width:t}=this.lastSize;-1!==t&&(this.element.style.width=`${t}px`),-1!==e&&(this.element.style.height=`${e}px`)}getHeight(){return this.element.offsetHeight}setHeight(e){const{popup:t}=this.config,i=this.element;let n=!1;if("string"==typeof e&&-1!==e.indexOf("%"))Ln(i,e),e=gn(i),n=!0;else if(e=Math.max(this.minHeight,e),this.positioned){const t=this.getAvailableHeight();t&&e>t&&(e=t)}this.getHeight()!==e&&(n?(i.style.maxHeight="unset",i.style.minHeight="unset"):t?Ln(i,e):(i.style.height=`${e}px`,i.style.flex="0 0 auto",this.lastSize.height="number"==typeof e?e:parseFloat(e)))}getAvailableHeight(){const{popup:e,forcePopupParentAsOffsetParent:t}=this.config;this.positioned||this.initialisePosition();const{clientHeight:i}=this.offsetParent;if(!i)return null;const n=this.element.getBoundingClientRect(),s=this.offsetParent.getBoundingClientRect(),r=e?this.position.y:n.top,o=e?0:s.top;let a=0;if(t){const e=this.element.parentElement;if(e){const{bottom:t}=e.getBoundingClientRect();a=t-n.bottom}}return i+o-r-a}getWidth(){return this.element.offsetWidth}setWidth(e){const t=this.element,{popup:i}=this.config;let n=!1;if("string"==typeof e&&-1!==e.indexOf("%"))Pn(t,e),e=fn(t),n=!0;else if(this.positioned){e=Math.max(this.minWidth,e);const{clientWidth:t}=this.offsetParent,n=i?this.position.x:this.element.getBoundingClientRect().left;t&&e+n>t&&(e=t-n)}this.getWidth()!==e&&(n?(t.style.maxWidth="unset",t.style.minWidth="unset"):this.config.popup?Pn(t,e):(t.style.width=`${e}px`,t.style.flex=" unset",this.lastSize.width="number"==typeof e?e:parseFloat(e)))}offsetElement(e=0,t=0){const{forcePopupParentAsOffsetParent:i}=this.config,n=i?this.boundaryEl:this.element;n&&(this.popupService.positionPopup({ePopup:n,keepWithinBounds:!0,skipObserver:this.movable||this.isResizable(),updatePosition:()=>({x:e,y:t})}),this.setPosition(parseFloat(n.style.left),parseFloat(n.style.top)))}constrainSizeToAvailableHeight(e){if(!this.config.forcePopupParentAsOffsetParent)return;e?this.resizeObserverSubscriber=this.resizeObserverService.observeResize(this.popupService.getPopupParent(),()=>{const e=this.getAvailableHeight();this.element.style.setProperty("max-height",`${e}px`)}):(this.element.style.removeProperty("max-height"),this.resizeObserverSubscriber&&(this.resizeObserverSubscriber(),this.resizeObserverSubscriber=void 0))}setPosition(e,t){this.position.x=e,this.position.y=t}updateDragStartPosition(e,t){this.dragStartPosition={x:e,y:t}}calculateMouseMovement(e){const{e:t,isLeft:i,isTop:n,anywhereWithin:s,topBuffer:r}=e,o=t.clientX-this.dragStartPosition.x,a=t.clientY-this.dragStartPosition.y;return{movementX:this.shouldSkipX(t,!!i,!!s,o)?0:o,movementY:this.shouldSkipY(t,!!n,r,a)?0:a}}shouldSkipX(e,t,i,n){const s=this.element.getBoundingClientRect(),r=this.offsetParent.getBoundingClientRect(),o=this.boundaryEl.getBoundingClientRect(),a=this.config.popup?this.position.x:s.left;let l=a<=0&&r.left>=e.clientX||r.right<=e.clientX&&r.right<=o.right;return!!l||(l=t?n<0&&e.clientX>a+r.left||n>0&&e.clientX<a+r.left:i?n<0&&e.clientX>o.right||n>0&&e.clientX<a+r.left:n<0&&e.clientX>o.right||n>0&&e.clientX<o.right,l)}shouldSkipY(e,t,i=0,n){const s=this.element.getBoundingClientRect(),r=this.offsetParent.getBoundingClientRect(),o=this.boundaryEl.getBoundingClientRect(),a=this.config.popup?this.position.y:s.top;let l=a<=0&&r.top>=e.clientY||r.bottom<=e.clientY&&r.bottom<=o.bottom;return!!l||(l=t?n<0&&e.clientY>a+r.top+i||n>0&&e.clientY<a+r.top:n<0&&e.clientY>o.bottom||n>0&&e.clientY<o.bottom,l)}createResizeMap(){const e=this.element;this.resizerMap={topLeft:{element:e.querySelector("[ref=eTopLeftResizer]")},top:{element:e.querySelector("[ref=eTopResizer]")},topRight:{element:e.querySelector("[ref=eTopRightResizer]")},right:{element:e.querySelector("[ref=eRightResizer]")},bottomRight:{element:e.querySelector("[ref=eBottomRightResizer]")},bottom:{element:e.querySelector("[ref=eBottomResizer]")},bottomLeft:{element:e.querySelector("[ref=eBottomLeftResizer]")},left:{element:e.querySelector("[ref=eLeftResizer]")}}}addResizers(){if(this.resizersAdded)return;const e=this.element;if(!e)return;const t=(new DOMParser).parseFromString(ks,"text/html").body;e.appendChild(t.firstChild),this.createResizeMap(),this.resizersAdded=!0}removeResizers(){this.resizerMap=void 0;const e=this.element.querySelector(`.${Rs}`);e&&this.element.removeChild(e),this.resizersAdded=!1}getResizerElement(e){return this.resizerMap[e].element}onResizeStart(e,t){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.currentResizer={isTop:!!t.match(/top/i),isRight:!!t.match(/right/i),isBottom:!!t.match(/bottom/i),isLeft:!!t.match(/left/i)},this.element.classList.add("ag-resizing"),this.resizerMap[t].element.classList.add("ag-active");const{popup:i,forcePopupParentAsOffsetParent:n}=this.config;i||n||this.applySizeToSiblings(this.currentResizer.isBottom||this.currentResizer.isTop),this.isResizing=!0,this.updateDragStartPosition(e.clientX,e.clientY)}getSiblings(){const e=this.element.parentElement;return e?Array.prototype.slice.call(e.children).filter(e=>!e.classList.contains("ag-hidden")):null}getMinSizeOfSiblings(){const e=this.getSiblings()||[];let t=0,i=0;for(let n=0;n<e.length;n++){const s=e[n],r=!!s.style.flex&&"0 0 auto"!==s.style.flex;if(s===this.element)continue;let o=this.minHeight||0,a=this.minWidth||0;if(r){const e=window.getComputedStyle(s);e.minHeight&&(o=parseInt(e.minHeight,10)),e.minWidth&&(a=parseInt(e.minWidth,10))}else o=s.offsetHeight,a=s.offsetWidth;t+=o,i+=a}return{height:t,width:i}}applySizeToSiblings(e){let t=null;const i=this.getSiblings();if(i){for(let n=0;n<i.length;n++){const s=i[n];s!==t&&(e?s.style.height=`${s.offsetHeight}px`:s.style.width=`${s.offsetWidth}px`,s.style.flex="0 0 auto",s===this.element&&(t=i[n+1]))}t&&(t.style.removeProperty("height"),t.style.removeProperty("min-height"),t.style.removeProperty("max-height"),t.style.flex="1 1 auto")}}isResizable(){return Object.values(this.resizable).some(e=>e)}onResize(e){if(!this.isResizing||!this.currentResizer)return;const{popup:t,forcePopupParentAsOffsetParent:i}=this.config,{isTop:n,isRight:s,isBottom:r,isLeft:o}=this.currentResizer,a=s||o,l=r||n,{movementX:c,movementY:h}=this.calculateMouseMovement({e,isLeft:o,isTop:n}),u=this.position.x,d=this.position.y;let p=0,g=0;if(a&&c){const e=o?-1:1,t=this.getWidth(),i=t+c*e;let n=!1;o&&(p=t-i,(u+p<=0||i<=this.minWidth)&&(n=!0,p=0)),n||this.setWidth(i)}if(l&&h){const e=n?-1:1,t=this.getHeight(),i=t+h*e;let s=!1;n?(g=t-i,(d+g<=0||i<=this.minHeight)&&(s=!0,g=0)):!this.config.popup&&!this.config.forcePopupParentAsOffsetParent&&t<i&&this.getMinSizeOfSiblings().height+i>this.element.parentElement.offsetHeight&&(s=!0),s||this.setHeight(i)}this.updateDragStartPosition(e.clientX,e.clientY),((t||i)&&p||g)&&this.offsetElement(u+p,d+g)}onResizeEnd(e,t){this.isResizing=!1,this.currentResizer=null,this.boundaryEl=null,this.element.classList.remove("ag-resizing"),this.resizerMap[t].element.classList.remove("ag-active"),this.dispatchEvent({type:"resize"})}refreshSize(){const e=this.element;this.config.popup&&(this.config.width||this.setWidth(e.offsetWidth),this.config.height||this.setHeight(e.offsetHeight))}onMoveStart(e){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.isMoving=!0,this.element.classList.add("ag-moving"),this.updateDragStartPosition(e.clientX,e.clientY)}onMove(e){if(!this.isMoving)return;const{x:t,y:i}=this.position;let n;this.config.calculateTopBuffer&&(n=this.config.calculateTopBuffer());const{movementX:s,movementY:r}=this.calculateMouseMovement({e,isTop:!0,anywhereWithin:!0,topBuffer:n});this.offsetElement(t+s,i+r),this.updateDragStartPosition(e.clientX,e.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 e=this.element;for(;e;){if("static"!==window.getComputedStyle(e).position)return e;e=e.parentElement}return this.element}clearResizeListeners(){for(;this.resizeListeners.length;){const e=this.resizeListeners.pop();this.dragService.removeDragSource(e)}}destroy(){super.destroy(),this.moveElementDragListener&&this.dragService.removeDragSource(this.moveElementDragListener),this.constrainSizeToAvailableHeight(!1),this.clearResizeListeners(),this.removeResizers()}};g([ue("popupService")],Ps.prototype,"popupService",2),g([ue("resizeObserverService")],Ps.prototype,"resizeObserverService",2),g([ue("dragService")],Ps.prototype,"dragService",2);var _s=class e extends Cs{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 Is(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.positionableFeature=new Ps(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 i=`\n            <form class="ag-filter-wrapper">\n                <div class="ag-filter-body-wrapper ag-${this.getCssIdentifier()}-body-wrapper" ref="eFilterBody">\n                    ${this.createBodyTemplate()}\n                </div>\n            </form>`;this.setTemplate(i,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(t){this.providedFilterParams=t,this.applyActive=e.isUseApplyButton(t),this.resetButtonsPanel()}updateParams(t){this.providedFilterParams=t,this.applyActive=e.isUseApplyButton(t),this.resetUiToActiveModel(this.getModel(),()=>{this.updateUiVisibility(),this.setupOnBtApplyDebounce()})}resetButtonsPanel(){const{buttons:e}=this.providedFilterParams,t=e&&e.length>0&&!this.isReadOnly();if(this.eButtonsPanel?(Cn(this.eButtonsPanel),this.buttonListeners.forEach(e=>null==e?void 0:e()),this.buttonListeners=[]):t&&(this.eButtonsPanel=document.createElement("div"),this.eButtonsPanel.classList.add("ag-filter-apply-panel")),!t)return void(this.eButtonsPanel&&wn(this.eButtonsPanel));const i=document.createDocumentFragment(),n=e=>{let t,n;switch(e){case"apply":t=this.translate("applyFilter"),n=e=>this.onBtApply(!1,!1,e);break;case"clear":t=this.translate("clearFilter"),n=()=>this.onBtClear();break;case"reset":t=this.translate("resetFilter"),n=()=>this.onBtReset();break;case"cancel":t=this.translate("cancelFilter"),n=e=>{this.onBtCancel(e)};break;default:return void console.warn("AG Grid: Unknown button type specified")}const s=En(`<button\n                    type="${"apply"===e?"submit":"button"}"\n                    ref="${e}FilterButton"\n                    class="ag-button ag-standard-button ag-filter-apply-panel-button"\n                >${t}\n                </button>`);this.buttonListeners.push(this.addManagedListener(s,"click",n)),i.append(s)};ls(e).forEach(e=>n(e)),this.eButtonsPanel.append(i),this.getGui().appendChild(this.eButtonsPanel)}getDefaultDebounceMs(){return 0}setupOnBtApplyDebounce(){const t=e.getDebounceMs(this.providedFilterParams,this.getDefaultDebounceMs()),i=Q(this.checkApplyDebounce.bind(this),t);this.onBtApplyDebounce=()=>{this.debouncePending=!0,i()}}checkApplyDebounce(){this.debouncePending&&(this.debouncePending=!1,this.onBtApply())}getModel(){return this.appliedModel?this.appliedModel:null}setModel(e){return(null!=e?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 i=()=>{this.onUiChanged(!1,"prevent"),null==t||t()};null!=e?this.setModelIntoUi(e).then(i):this.resetUiToDefaults().then(i)}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 i=this.appliedModel;return this.appliedModel=t,!this.areModelsEqual(i,t)}isModelValid(e){return!0}onFormSubmit(e){e.preventDefault()}onBtApply(e=!1,t=!1,i){if(i&&i.preventDefault(),this.applyModel(t?"rowDataUpdated":"ui")){const i="columnFilter";this.providedFilterParams.filterChangedCallback({afterFloatingFilter:e,afterDataChange:t,source:i})}const{closeOnApply:n}=this.providedFilterParams;n&&this.applyActive&&!e&&!t&&this.close(i)}onNewRowsLoaded(){}close(e){if(!this.hidePopup)return;const t=e,i=t&&t.key;let n;"Enter"!==i&&"Space"!==i||(n={keyboardEvent:t}),this.hidePopup(n),this.hidePopup=null}onUiChanged(e=!1,t){if(this.updateUiVisibility(),this.providedFilterParams.filterModifiedCallback(),this.applyActive&&!this.isReadOnly()){const e=this.isModelValid(this.getModelFromUi()),t=this.getRefElement("applyFilterButton");t&&cn(t,!e)}e&&!t||"immediately"===t?this.onBtApply(e):(this.applyActive||t)&&"debounce"!==t||this.onBtApplyDebounce()}afterGuiAttached(e){e&&(this.hidePopup=e.hidePopup),this.refreshFilterResizer(null==e?void 0:e.container)}refreshFilterResizer(e){if(!this.positionableFeature||"toolPanel"===e)return;const t="floatingFilter"===e||"columnFilter"===e,{positionableFeature:i,gos:n}=this;t?(i.restoreLastSize(),i.setResizable(n.get("enableRtl")?{bottom:!0,bottomLeft:!0,left:!0}:{bottom:!0,bottomRight:!0,right:!0})):(this.positionableFeature.removeSizeFromEl(),this.positionableFeature.setResizable(!1)),this.positionableFeature.constrainSizeToAvailableHeight(!0)}afterGuiDetached(){this.checkApplyDebounce(),this.positionableFeature&&this.positionableFeature.constrainSizeToAvailableHeight(!1)}static getDebounceMs(t,i){return e.isUseApplyButton(t)?(null!=t.debounceMs&&console.warn("AG Grid: debounceMs is ignored when apply button is present"),0):null!=t.debounceMs?t.debounceMs:i}static isUseApplyButton(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,Ts[e])}getCellValue(e){return this.providedFilterParams.getValue(e)}getPositionableElement(){return this.eFilterBody}};g([ue("rowModel")],_s.prototype,"rowModel",2),g([Ss("eFilterBody")],_s.prototype,"eFilterBody",2),g([le],_s.prototype,"postConstruct",1);var Ls=_s,Ns=class extends Cs{constructor(e,t){super(t),this.labelSeparator="",this.labelAlignment="left",this.disabled=!1,this.label="",this.config=e||{}}postConstruct(){this.addCssClass("ag-labeled"),this.eLabel.classList.add("ag-label");const{labelSeparator:e,label:t,labelWidth:i,labelAlignment:n,disabled:s}=this.config;null!=s&&this.setDisabled(s),null!=e&&this.setLabelSeparator(e),null!=t&&this.setLabel(t),null!=i&&this.setLabelWidth(i),this.setLabelAlignment(n||this.labelAlignment),this.refreshLabel()}refreshLabel(){Cn(this.eLabel),"string"==typeof this.label?this.eLabel.innerText=this.label+this.labelSeparator:this.label&&this.eLabel.appendChild(this.label),""===this.label?(an(this.eLabel,!1),Ht(this.eLabel,"presentation")):(an(this.eLabel,!0),Ht(this.eLabel,null))}setLabelSeparator(e){return this.labelSeparator===e||(this.labelSeparator=e,null!=this.label&&this.refreshLabel()),this}getLabelId(){return this.eLabel.id=this.eLabel.id||`ag-${this.getCompId()}-label`,this.eLabel.id}getLabel(){return this.label}setLabel(e){return this.label===e||(this.label=e,this.refreshLabel()),this}setLabelAlignment(e){const t=this.getGui().classList;return t.toggle("ag-label-align-left","left"===e),t.toggle("ag-label-align-right","right"===e),t.toggle("ag-label-align-top","top"===e),this}setLabelEllipsis(e){return this.eLabel.classList.toggle("ag-label-ellipsis",e),this}setLabelWidth(e){return null==this.label||kn(this.eLabel,e),this}setDisabled(e){e=!!e;const t=this.getGui();return cn(t,e),t.classList.toggle("ag-disabled",e),this.disabled=e,this}isDisabled(){return!!this.disabled}};g([le],Ns.prototype,"postConstruct",1);var Os=class extends Ns{constructor(e,t,i){super(e,t),this.className=i}postConstruct(){super.postConstruct();const{width:e,value:t,onValueChange:i}=this.config;null!=e&&this.setWidth(e),null!=t&&this.setValue(t),null!=i&&this.onValueChange(i),this.className&&this.addCssClass(this.className),this.refreshAriaLabelledBy()}refreshAriaLabelledBy(){const e=this.getAriaElement(),t=this.getLabelId();null!==jt(e)?Kt(e,""):Kt(e,null!=t?t:"")}setAriaLabel(e){return $t(this.getAriaElement(),e),this.refreshAriaLabelledBy(),this}onValueChange(e){return this.addManagedListener(this,ct.EVENT_FIELD_VALUE_CHANGED,()=>e(this.getValue())),this}getWidth(){return this.getGui().clientWidth}setWidth(e){return Pn(this.getGui(),e),this}getPreviousValue(){return this.previousValue}getValue(){return this.value}setValue(e,t){return this.value===e||(this.previousValue=this.value,this.value=e,t||this.dispatchEvent({type:ct.EVENT_FIELD_VALUE_CHANGED})),this}},Fs=class extends Os{constructor(e){if(super(e,(null==e?void 0:e.template)||'\n    <div class="ag-picker-field" role="presentation">\n        <div ref="eLabel"></div>\n            <div ref="eWrapper" class="ag-wrapper ag-picker-field-wrapper ag-picker-collapsed">\n            <div ref="eDisplayField" class="ag-picker-field-display"></div>\n            <div ref="eIcon" class="ag-picker-field-icon" aria-hidden="true"></div>\n        </div>\n    </div>',null==e?void 0:e.className),this.isPickerDisplayed=!1,this.skipClick=!1,this.pickerGap=4,this.hideCurrentPicker=null,this.ariaRole=null==e?void 0:e.ariaRole,this.onPickerFocusIn=this.onPickerFocusIn.bind(this),this.onPickerFocusOut=this.onPickerFocusOut.bind(this),!e)return;const{pickerGap:t,maxPickerHeight:i,variableWidth:n,minPickerWidth:s,maxPickerWidth:r}=e;null!=t&&(this.pickerGap=t),this.variableWidth=!!n,null!=i&&this.setPickerMaxHeight(i),null!=s&&this.setPickerMinWidth(s),null!=r&&this.setPickerMaxWidth(r)}postConstruct(){super.postConstruct(),this.setupAria();const e=`ag-${this.getCompId()}-display`;this.eDisplayField.setAttribute("id",e);const t=this.getAriaElement();this.addManagedListener(t,"keydown",this.onKeyDown.bind(this)),this.addManagedListener(this.eLabel,"mousedown",this.onLabelOrWrapperMouseDown.bind(this)),this.addManagedListener(this.eWrapper,"mousedown",this.onLabelOrWrapperMouseDown.bind(this));const{pickerIcon:i,inputWidth:n}=this.config;if(i){const e=qn(i,this.gos);e&&this.eIcon.appendChild(e)}null!=n&&this.setInputWidth(n)}setupAria(){const e=this.getAriaElement();e.setAttribute("tabindex",this.gos.get("tabIndex").toString()),ii(e,!1),this.ariaRole&&Ht(e,this.ariaRole)}onLabelOrWrapperMouseDown(e){if(e){const t=this.getFocusableElement();if(t!==this.eWrapper&&(null==e?void 0:e.target)===t)return;e.preventDefault(),this.getFocusableElement().focus()}this.skipClick?this.skipClick=!1:this.isDisabled()||(this.isPickerDisplayed?this.hidePicker():this.showPicker())}onKeyDown(e){switch(e.key){case Zn.UP:case Zn.DOWN:case Zn.ENTER:case Zn.SPACE:e.preventDefault(),this.onLabelOrWrapperMouseDown();break;case Zn.ESCAPE:this.isPickerDisplayed&&(e.preventDefault(),e.stopPropagation(),this.hideCurrentPicker&&this.hideCurrentPicker())}}showPicker(){this.isPickerDisplayed=!0,this.pickerComponent||(this.pickerComponent=this.createPickerComponent());const e=this.pickerComponent.getGui();e.addEventListener("focusin",this.onPickerFocusIn),e.addEventListener("focusout",this.onPickerFocusOut),this.hideCurrentPicker=this.renderAndPositionPicker(),this.toggleExpandedStyles(!0)}renderAndPositionPicker(){const e=this.gos.getDocument(),t=this.pickerComponent.getGui();this.gos.get("suppressScrollWhenPopupsAreOpen")||(this.destroyMouseWheelFunc=this.addManagedListener(this.eventService,ct.EVENT_BODY_SCROLL,()=>{this.hidePicker()}));const i=this.localeService.getLocaleTextFunc(),{pickerAriaLabelKey:n,pickerAriaLabelValue:s,modalPicker:r=!0}=this.config,o={modal:r,eChild:t,closeOnEsc:!0,closedCallback:()=>{const t=this.gos.getActiveDomElement(),i=!t||t===e.body;this.beforeHidePicker(),i&&this.isAlive()&&this.getFocusableElement().focus()},ariaLabel:i(n,s)},a=this.popupService.addPopup(o),{maxPickerHeight:l,minPickerWidth:c,maxPickerWidth:h,variableWidth:u}=this;u?(c&&(t.style.minWidth=c),t.style.width=Nn(fn(this.eWrapper)),h&&(t.style.maxWidth=h)):kn(t,null!=h?h:fn(this.eWrapper));const d=null!=l?l:`${dn(this.popupService.getPopupParent())}px`;return t.style.setProperty("max-height",d),t.style.position="absolute",this.alignPickerToComponent(),a.hideFunc}alignPickerToComponent(){if(!this.pickerComponent)return;const{pickerType:e}=this.config,{pickerGap:t}=this,i=this.gos.get("enableRtl")?"right":"left";this.popupService.positionPopupByComponent({type:e,eventSource:this.eWrapper,ePopup:this.pickerComponent.getGui(),position:"under",alignSide:i,keepWithinBounds:!0,nudgeY:t})}beforeHidePicker(){this.destroyMouseWheelFunc&&(this.destroyMouseWheelFunc(),this.destroyMouseWheelFunc=void 0),this.toggleExpandedStyles(!1);const e=this.pickerComponent.getGui();e.removeEventListener("focusin",this.onPickerFocusIn),e.removeEventListener("focusout",this.onPickerFocusOut),this.isPickerDisplayed=!1,this.pickerComponent=void 0,this.hideCurrentPicker=null}toggleExpandedStyles(e){this.isAlive()&&(ii(this.getAriaElement(),e),this.eWrapper.classList.toggle("ag-picker-expanded",e),this.eWrapper.classList.toggle("ag-picker-collapsed",!e))}onPickerFocusIn(){this.togglePickerHasFocus(!0)}onPickerFocusOut(e){var t;(null==(t=this.pickerComponent)?void 0:t.getGui().contains(e.relatedTarget))||this.togglePickerHasFocus(!1)}togglePickerHasFocus(e){this.pickerComponent&&this.eWrapper.classList.toggle("ag-picker-has-focus",e)}hidePicker(){this.hideCurrentPicker&&this.hideCurrentPicker()}setInputWidth(e){return kn(this.eWrapper,e),this}getFocusableElement(){return this.eWrapper}setPickerGap(e){return this.pickerGap=e,this}setPickerMinWidth(e){return"number"==typeof e&&(e=`${e}px`),this.minPickerWidth=null==e?void 0:e,this}setPickerMaxWidth(e){return"number"==typeof e&&(e=`${e}px`),this.maxPickerWidth=null==e?void 0:e,this}setPickerMaxHeight(e){return"number"==typeof e&&(e=`${e}px`),this.maxPickerHeight=null==e?void 0:e,this}destroy(){this.hidePicker(),super.destroy()}};g([ue("popupService")],Fs.prototype,"popupService",2),g([Ss("eLabel")],Fs.prototype,"eLabel",2),g([Ss("eWrapper")],Fs.prototype,"eWrapper",2),g([Ss("eDisplayField")],Fs.prototype,"eDisplayField",2),g([Ss("eIcon")],Fs.prototype,"eIcon",2);var Gs=class e extends Cs{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 Zn.ENTER:if(this.highlightedEl){const e=this.itemEls.indexOf(this.highlightedEl);this.setValueByIndex(e)}else this.setValue(this.getValue());break;case Zn.DOWN:case Zn.UP:e.preventDefault(),this.navigate(t);break;case Zn.PAGE_DOWN:case Zn.PAGE_UP:case Zn.PAGE_HOME:case Zn.PAGE_END:e.preventDefault(),this.navigateToPage(t)}}navigate(e){const t=e===Zn.DOWN;let i;if(this.highlightedEl){let e=this.itemEls.indexOf(this.highlightedEl)+(t?1:-1);e=Math.min(Math.max(e,0),this.itemEls.length-1),i=this.itemEls[e]}else i=this.itemEls[t?0:this.itemEls.length-1];this.highlightItem(i)}navigateToPage(e){if(!this.highlightedEl||0===this.itemEls.length)return;const t=this.itemEls.indexOf(this.highlightedEl),i=this.options.length-1,n=this.itemEls[0].clientHeight,s=Math.floor(this.getGui().clientHeight/n);let r=-1;e===Zn.PAGE_HOME?r=0:e===Zn.PAGE_END?r=i:e===Zn.PAGE_DOWN?r=Math.min(t+s,i):e===Zn.PAGE_UP&&(r=Math.max(t-s,0)),-1!==r&&this.highlightItem(this.itemEls[r])}addOptions(e){return e.forEach(e=>this.addOption(e)),this}addOption(e){const{value:t,text:i}=e,n=i||t;return this.options.push({value:t,text:n}),this.renderOption(t,n),this.updateIndices(),this}clearOptions(){this.options=[],this.reset(!0),this.itemEls.forEach(e=>{wn(e)}),this.itemEls=[]}updateIndices(){const e=this.getGui().querySelectorAll(".ag-list-item");e.forEach((t,i)=>{ri(t,i+1),si(t,e.length)})}renderOption(e,t){const i=this.gos.getDocument(),n=i.createElement("div");Ht(n,"option"),n.classList.add("ag-list-item",`ag-${this.cssIdentifier}-list-item`);const s=i.createElement("span");n.appendChild(s),s.textContent=t,this.unFocusable||(n.tabIndex=-1),this.itemEls.push(n),this.addManagedListener(n,"mousemove",()=>this.highlightItem(n)),this.addManagedListener(n,"mousedown",t=>{t.preventDefault(),this.setValue(e)}),this.createManagedBean(new ys({getTooltipValue:()=>t,getGui:()=>n,getLocation:()=>"UNKNOWN",shouldDisplayTooltip:()=>s.scrollWidth>s.clientWidth})),this.getGui().appendChild(n)}setValue(e,t){if(this.value===e)return this.fireItemSelected(),this;if(null==e)return this.reset(t),this;const i=this.options.findIndex(t=>t.value===e);if(-1!==i){const e=this.options[i];this.value=e.value,this.displayValue=e.text,this.highlightItem(this.itemEls[i]),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(e=>e.value===this.value);-1!==e&&this.highlightItem(this.itemEls[e])}reset(e){this.value=null,this.displayValue=null,this.clearHighlighted(),e||this.fireChangeEvent()}highlightItem(t){if(!xn(t))return;this.clearHighlighted(),this.highlightedEl=t,this.highlightedEl.classList.add(e.ACTIVE_CLASS),gi(this.highlightedEl,!0);const i=this.getGui(),{scrollTop:n,clientHeight:s}=i,{offsetTop:r,offsetHeight:o}=t;(r+o>n+s||r<n)&&this.highlightedEl.scrollIntoView({block:"nearest"}),this.unFocusable||this.highlightedEl.focus()}clearHighlighted(){this.highlightedEl&&xn(this.highlightedEl)&&(this.highlightedEl.classList.remove(e.ACTIVE_CLASS),gi(this.highlightedEl,!1),this.highlightedEl=null)}fireChangeEvent(){this.dispatchEvent({type:ct.EVENT_FIELD_VALUE_CHANGED}),this.fireItemSelected()}fireItemSelected(){this.dispatchEvent({type:e.EVENT_ITEM_SELECTED})}};Gs.EVENT_ITEM_SELECTED="selectedItem",Gs.ACTIVE_CLASS="ag-active-item",g([le],Gs.prototype,"init",1);var Bs=Gs,Vs=class e extends Fs{constructor(e){super(u({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:i}=this.config;null!=e&&this.addOptions(e),null!=t&&this.setValue(t,!0),i&&null==t&&(this.eDisplayField.textContent=i),this.addManagedListener(this.eWrapper,"focusout",this.onWrapperFocusOut.bind(this))}onWrapperFocusOut(e){this.eWrapper.contains(e.relatedTarget)||this.hidePicker()}createListComponent(){this.listComponent=this.createBean(new Bs("select",!0)),this.listComponent.setParentComponent(this);const t=this.listComponent.getAriaElement(),i=`ag-select-list-${this.listComponent.getCompId()}`;t.setAttribute("id",i),mi(this.getAriaElement(),t),this.listComponent.addManagedListener(this.listComponent,Bs.EVENT_ITEM_SELECTED,()=>{this.hidePicker(),this.dispatchEvent({type:e.EVENT_ITEM_SELECTED})}),this.listComponent.addManagedListener(this.listComponent,ct.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:i}=e;switch(i===Zn.TAB&&this.hidePicker(),i){case Zn.ENTER:case Zn.UP:case Zn.DOWN:case Zn.PAGE_UP:case Zn.PAGE_DOWN:case Zn.PAGE_HOME:case Zn.PAGE_END:e.preventDefault(),this.isPickerDisplayed?null==(t=this.listComponent)||t.handleKeyDown(e):super.onKeyDown(e);break;case Zn.ESCAPE:super.onKeyDown(e)}}showPicker(){this.listComponent&&(super.showPicker(),this.listComponent.refreshHighlighted())}addOptions(e){return e.forEach(e=>this.addOption(e)),this}addOption(e){return this.listComponent.addOption(e),this}clearOptions(){var e;return null==(e=this.listComponent)||e.clearOptions(),this}setValue(e,t,i){if(this.value===e||!this.listComponent)return this;if(i||this.listComponent.setValue(e,!0),this.listComponent.getValue()===this.getValue())return this;let n=this.listComponent.getDisplayValue();return null==n&&this.config.placeholder&&(n=this.config.placeholder),this.eDisplayField.textContent=n,this.setTooltip({newTooltipText:null!=n?n: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()}};Vs.EVENT_ITEM_SELECTED="selectedItem";var Hs=Vs,Us=class extends Os{constructor(e,t,i="text",n="input"){super(e,`\n            <div role="presentation">\n                <div ref="eLabel" class="ag-input-field-label"></div>\n                <div ref="eWrapper" class="ag-wrapper ag-input-wrapper" role="presentation">\n                    <${n} ref="eInput" class="ag-input-field-input"></${n}>\n                </div>\n            </div>`,t),this.inputType=i,this.displayFieldTag=n}postConstruct(){super.postConstruct(),this.setInputType(),this.eLabel.classList.add(`${this.className}-label`),this.eWrapper.classList.add(`${this.className}-input-wrapper`),this.eInput.classList.add(`${this.className}-input`),this.addCssClass("ag-input-field"),this.eInput.id=this.eInput.id||`ag-${this.getCompId()}-input`;const{inputName:e,inputWidth:t}=this.config;null!=e&&this.setInputName(e),null!=t&&this.setInputWidth(t),this.addInputListeners(),this.activateTabIndex([this.eInput])}addInputListeners(){this.addManagedListener(this.eInput,"input",e=>this.setValue(e.target.value))}setInputType(){"input"===this.displayFieldTag&&this.eInput.setAttribute("type",this.inputType)}getInputElement(){return this.eInput}setInputWidth(e){return kn(this.eWrapper,e),this}setInputName(e){return this.getInputElement().setAttribute("name",e),this}getFocusableElement(){return this.eInput}setMaxLength(e){return this.eInput.maxLength=e,this}setInputPlaceholder(e){return Bn(this.eInput,"placeholder",e),this}setInputAriaLabel(e){return $t(this.eInput,e),this.refreshAriaLabelledBy(),this}setDisabled(e){return cn(this.eInput,e),super.setDisabled(e)}setAutoComplete(e){if(!0===e)Bn(this.eInput,"autocomplete",null);else{const t="string"==typeof e?e:"off";Bn(this.eInput,"autocomplete",t)}return this}};g([Ss("eLabel")],Us.prototype,"eLabel",2),g([Ss("eWrapper")],Us.prototype,"eWrapper",2),g([Ss("eInput")],Us.prototype,"eInput",2);var zs=class extends Us{constructor(e,t="ag-checkbox",i="checkbox"){super(e,t,i),this.labelAlignment="right",this.selected=!1,this.readOnly=!1,this.passive=!1}postConstruct(){super.postConstruct();const{readOnly:e,passive:t}=this.config;"boolean"==typeof e&&this.setReadOnly(e),"boolean"==typeof t&&this.setPassive(t)}addInputListeners(){this.addManagedListener(this.eInput,"click",this.onCheckboxClick.bind(this)),this.addManagedListener(this.eLabel,"click",this.toggle.bind(this))}getNextValue(){return void 0===this.selected||!this.selected}setPassive(e){this.passive=e}isReadOnly(){return this.readOnly}setReadOnly(e){this.eWrapper.classList.toggle("ag-disabled",e),this.eInput.disabled=e,this.readOnly=e}setDisabled(e){return this.eWrapper.classList.toggle("ag-disabled",e),super.setDisabled(e)}toggle(){if(this.eInput.disabled)return;const e=this.isSelected(),t=this.getNextValue();this.passive?this.dispatchChange(t,e):this.setValue(t)}getValue(){return this.isSelected()}setValue(e,t){return this.refreshSelectedClass(e),this.setSelected(e,t),this}setName(e){return this.getInputElement().name=e,this}isSelected(){return this.selected}setSelected(e,t){this.isSelected()!==e&&(this.previousValue=this.isSelected(),e=this.selected="boolean"==typeof e?e:void 0,this.eInput.checked=e,this.eInput.indeterminate=void 0===e,t||this.dispatchChange(this.selected,this.previousValue))}dispatchChange(e,t,i){this.dispatchEvent({type:ct.EVENT_FIELD_VALUE_CHANGED,selected:e,previousValue:t,event:i});const n=this.getInputElement(),s={type:ct.EVENT_CHECKBOX_CHANGED,id:n.id,name:n.name,selected:e,previousValue:t};this.eventService.dispatchEvent(s)}onCheckboxClick(e){if(this.passive||this.eInput.disabled)return;const t=this.isSelected(),i=this.selected=e.target.checked;this.refreshSelectedClass(i),this.dispatchChange(i,t,e)}refreshSelectedClass(e){this.eWrapper.classList.toggle("ag-checked",!0===e),this.eWrapper.classList.toggle("ag-indeterminate",null==e)}},Ws=class extends zs{constructor(e){super(e,"ag-radio-button","radio")}isSelected(){return this.eInput.checked}toggle(){this.eInput.disabled||this.isSelected()||this.setValue(!0)}addInputListeners(){super.addInputListeners(),this.addManagedListener(this.eventService,ct.EVENT_CHECKBOX_CHANGED,this.onChange.bind(this))}onChange(e){e.selected&&e.name&&this.eInput.name&&this.eInput.name===e.name&&e.id&&this.eInput.id!==e.id&&this.setValue(!1,!0)}},js=class{constructor(e,t,i){this.localeService=e,this.optionsFactory=t,this.valueFormatter=i}getModelAsString(e){if(!e)return null;const t=null!=e.operator,i=this.localeService.getLocaleTextFunc();if(t){const t=e;let{conditions:n}=t;if(!n){const{condition1:e,condition2:i}=t;n=[e,i]}const s=n.map(e=>this.getModelAsString(e)),r="AND"===t.operator?"andCondition":"orCondition";return s.join(` ${i(r,Ts[r])} `)}if(e.type===Ks.BLANK||e.type===Ks.NOT_BLANK)return i(e.type,e.type);{const t=e,n=this.optionsFactory.getCustomOption(t.type),{displayKey:s,displayName:r,numberOfInputs:o}=n||{};return s&&r&&0===o?(i(s,r),r):this.conditionToString(t,n)}}updateParams(e){this.optionsFactory=e.optionsFactory}formatValue(e){var t;return this.valueFormatter?null!=(t=this.valueFormatter(null!=e?e:null))?t:"":String(e)}},$s=class e extends Ls{constructor(){super(...arguments),this.eTypes=[],this.eJoinOperatorPanels=[],this.eJoinOperatorsAnd=[],this.eJoinOperatorsOr=[],this.eConditionBodies=[],this.listener=()=>this.onUiChanged(),this.lastUiCompletePosition=null,this.joinOperatorId=0}getNumberOfInputs(t){const i=this.optionsFactory.getCustomOption(t);if(i){const{numberOfInputs:e}=i;return null!=e?e:1}const n=[e.EMPTY,e.NOT_BLANK,e.BLANK];return t&&n.indexOf(t)>=0?0:t===e.IN_RANGE?2:1}onFloatingFilterChanged(e,t){this.setTypeFromFloatingFilter(e),this.setValueFromFloatingFilter(t),this.onUiChanged(!0)}setTypeFromFloatingFilter(e){this.eTypes.forEach((t,i)=>{0===i?t.setValue(e,!0):t.setValue(this.optionsFactory.getDefaultOption(),!0)})}getModelFromUi(){const e=this.getUiCompleteConditions();return 0===e.length?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 0===this.eJoinOperatorsOr.length?this.defaultJoinOperator:!0===this.eJoinOperatorsOr[0].getValue()?"OR":"AND"}areModelsEqual(e,t){if(!e&&!t)return!0;if(!e&&t||e&&!t)return!1;const i=!e.operator,n=!t.operator;if(!i&&n||i&&!n)return!1;let s;if(i){const i=e,n=t;s=this.areSimpleModelsEqual(i,n)}else{const i=e,n=t;s=i.operator===n.operator&&Re(i.conditions,n.conditions,(e,t)=>this.areSimpleModelsEqual(e,t))}return s}shouldRefresh(e){var t,i,n;const s=this.getModel(),r=s?null!=(t=s.conditions)?t:[s]:null,o=null!=(n=null==(i=e.filterOptions)?void 0:i.map(e=>"string"==typeof e?e:e.displayKey))?n:this.getDefaultFilterOptions();return!(r&&!r.every(e=>void 0!==o.find(t=>t===e.type))||"number"==typeof e.maxNumConditions&&r&&r.length>e.maxNumConditions)}refresh(e){return!!this.shouldRefresh(e)&&(!!super.refresh(e)&&(this.setParams(e),this.removeConditionsAndOperators(0),this.createOption(),this.setModel(this.getModel()),!0))}setModelIntoUi(e){if(e.operator){let t=e;t.conditions||(t.conditions=[t.condition1,t.condition2]);const i=this.validateAndUpdateConditions(t.conditions),n=this.getNumConditions();if(i<n)this.removeConditionsAndOperators(i);else if(i>n)for(let e=n;e<i;e++)this.createJoinOperatorPanel(),this.createOption();const s="OR"===t.operator;this.eJoinOperatorsAnd.forEach(e=>e.setValue(!s,!0)),this.eJoinOperatorsOr.forEach(e=>e.setValue(s,!0)),t.conditions.forEach((e,t)=>{this.eTypes[t].setValue(e.type,!0),this.setConditionIntoUi(e,t)})}else{const t=e;this.getNumConditions()>1&&this.removeConditionsAndOperators(1),this.eTypes[0].setValue(t.type,!0),this.setConditionIntoUi(t,0)}return this.lastUiCompletePosition=this.getNumConditions()-1,this.createMissingConditionsAndOperators(),this.onUiChanged(),ds.resolve()}validateAndUpdateConditions(e){let t=e.length;return t>this.maxNumConditions&&(e.splice(this.maxNumConditions),z('Filter Model contains more conditions than "filterParams.maxNumConditions". Additional conditions have been ignored.'),t=this.maxNumConditions),t}doesFilterPass(e){var t;const i=this.getModel();if(null==i)return!0;const{operator:n}=i,s=[];if(n){const e=i;s.push(...null!=(t=e.conditions)?t:[])}else s.push(i);return s[n&&"OR"===n?"some":"every"](t=>this.individualConditionPasses(e,t))}setParams(e){super.setParams(e),this.setNumConditions(e),this.defaultJoinOperator=this.getDefaultJoinOperator(e.defaultJoinOperator),this.filterPlaceholder=e.filterPlaceholder,this.optionsFactory=new Ms,this.optionsFactory.init(e,this.getDefaultFilterOptions()),this.createFilterListOptions(),this.createOption(),this.createMissingConditionsAndOperators(),this.isReadOnly()&&this.eFilterBody.setAttribute("tabindex","-1")}setNumConditions(e){var t,i;null!=e.suppressAndOrCondition&&z('Since v29.2 "filterParams.suppressAndOrCondition" is deprecated. Use "filterParams.maxNumConditions = 1" instead.'),null!=e.alwaysShowBothConditions&&z('Since v29.2 "filterParams.alwaysShowBothConditions" is deprecated. Use "filterParams.numAlwaysVisibleConditions = 2" instead.'),this.maxNumConditions=null!=(t=e.maxNumConditions)?t:e.suppressAndOrCondition?1:2,this.maxNumConditions<1&&(z('"filterParams.maxNumConditions" must be greater than or equal to zero.'),this.maxNumConditions=1),this.numAlwaysVisibleConditions=null!=(i=e.numAlwaysVisibleConditions)?i:e.alwaysShowBothConditions?2:1,this.numAlwaysVisibleConditions<1&&(z('"filterParams.numAlwaysVisibleConditions" must be greater than or equal to zero.'),this.numAlwaysVisibleConditions=1),this.numAlwaysVisibleConditions>this.maxNumConditions&&(z('"filterParams.numAlwaysVisibleConditions" cannot be greater than "filterParams.maxNumConditions".'),this.numAlwaysVisibleConditions=this.maxNumConditions)}createOption(){const e=this.createManagedBean(new Hs);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 i=this.getNumConditions()-1;this.forEachPositionInput(i,e=>this.resetInput(e)),this.addChangedListeners(e,i)}createJoinOperatorPanel(){const e=document.createElement("div");this.eJoinOperatorPanels.push(e),e.classList.add("ag-filter-condition");const t=this.createJoinOperator(this.eJoinOperatorsAnd,e,"and"),i=this.createJoinOperator(this.eJoinOperatorsOr,e,"or");this.eFilterBody.appendChild(e);const n=this.eJoinOperatorPanels.length-1,s=this.joinOperatorId++;this.resetJoinOperatorAnd(t,n,s),this.resetJoinOperatorOr(i,n,s),this.isReadOnly()||(t.onValueChange(this.listener),i.onValueChange(this.listener))}createJoinOperator(e,t,i){const n=this.createManagedBean(new Ws);return e.push(n),n.addCssClass("ag-filter-condition-operator"),n.addCssClass(`ag-filter-condition-operator-${i}`),t.appendChild(n.getGui()),n}getDefaultJoinOperator(e){return"AND"===e||"OR"===e?e:"AND"}createFilterListOptions(){const e=this.optionsFactory.getFilterOptions();this.filterListOptions=e.map(e=>"string"==typeof e?this.createBoilerplateListOption(e):this.createCustomListOption(e))}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,i=this.optionsFactory.getCustomOption(e.displayKey);return{value:t,text:i?this.localeService.getLocaleTextFunc()(i.displayKey,i.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,i=!0;for(let e=0;e<this.getNumConditions();e++)this.isConditionUiComplete(e)?t=e:i=!1;if(this.shouldAddNewConditionAtEnd(i))this.createJoinOperatorPanel(),this.createOption();else{const i=null!=(e=this.lastUiCompletePosition)?e:this.getNumConditions()-2;if(t<i){this.removeConditionsAndOperators(i+1);const e=t+1,n=i-e;n>0&&this.removeConditionsAndOperators(e,n),this.createMissingConditionsAndOperators()}}this.lastUiCompletePosition=t}updateConditionStatusesAndValues(e,t){this.eTypes.forEach((t,i)=>{const n=this.isConditionDisabled(i,e);t.setDisabled(n||this.filterListOptions.length<=1),1===i&&(cn(this.eJoinOperatorPanels[0],n),this.eJoinOperatorsAnd[0].setDisabled(n),this.eJoinOperatorsOr[0].setDisabled(n))}),this.eConditionBodies.forEach((e,t)=>{an(e,this.isConditionBodyVisible(t))});const i="OR"===(null!=t?t:this.getJoinOperator());this.eJoinOperatorsAnd.forEach((e,t)=>{e.setValue(!i,!0)}),this.eJoinOperatorsOr.forEach((e,t)=>{e.setValue(i,!0)}),this.forEachInput((t,i,n,s)=>{this.setElementDisplayed(t,i<s),this.setElementDisabled(t,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 i=Math.max(e-1,0);this.removeElements(this.eJoinOperatorPanels,i,t),this.removeComponents(this.eJoinOperatorsAnd,i,t),this.removeComponents(this.eJoinOperatorsOr,i,t)}removeElements(e,t,i){this.removeItems(e,t,i).forEach(e=>wn(e))}removeComponents(e,t,i){this.removeItems(e,t,i).forEach(e=>{wn(e.getGui()),this.destroyBean(e)})}removeItems(e,t,i){return null==i?e.splice(t):e.splice(t,i)}afterGuiAttached(e){if(super.afterGuiAttached(e),this.resetPlaceholder(),!(null==e?void 0:e.suppressFocus))if(this.isReadOnly())this.eFilterBody.focus();else{const e=this.getInputs(0)[0];if(!e)return;e instanceof Us&&e.getInputElement().focus()}}afterGuiDetached(){super.afterGuiDetached();const e=this.getModel();this.resetUiToActiveModel(e);let t=-1,i=-1,n=!1;const s=this.getJoinOperator();for(let e=this.getNumConditions()-1;e>=0;e--)if(this.isConditionUiComplete(e))-1===t&&(t=e,i=e);else{const s=e<t;(e>=this.numAlwaysVisibleConditions&&!this.isConditionUiComplete(e-1)||s)&&(this.removeConditionsAndOperators(e,1),n=!0,s&&i--)}let r=!1;this.getNumConditions()<this.numAlwaysVisibleConditions&&(this.createMissingConditionsAndOperators(),r=!0),this.shouldAddNewConditionAtEnd(i===this.getNumConditions()-1)&&(this.createJoinOperatorPanel(),this.createOption(),r=!0),r&&this.updateConditionStatusesAndValues(i,s),n&&this.updateJoinOperatorsDisabled(),this.lastUiCompletePosition=i}getPlaceholderText(e,t){let i=this.translate(e);if($(this.filterPlaceholder)){const e=this.filterPlaceholder,n=this.eTypes[t].getValue();i=e({filterOptionKey:n,filterOption:this.translate(n),placeholder:i})}else"string"==typeof this.filterPlaceholder&&(i=this.filterPlaceholder);return i}resetPlaceholder(){const e=this.localeService.getLocaleTextFunc();this.forEachInput((t,i,n,s)=>{if(!(t instanceof Us))return;const r=0===i&&s>1?"inRangeStart":0===i?"filterOoo":"inRangeEnd",o=0===i&&s>1?e("ariaFilterFromValue","Filter from value"):0===i?e("ariaFilterValue","Filter Value"):e("ariaFilterToValue","Filter to Value");t.setInputPlaceholder(this.getPlaceholderText(r,n)),t.setInputAriaLabel(o)})}setElementValue(e,t,i){e instanceof Us&&e.setValue(null!=t?String(t):null,!0)}setElementDisplayed(e,t){e instanceof Cs&&an(e.getGui(),t)}setElementDisabled(e,t){e instanceof Cs&&cn(e.getGui(),t)}attachElementOnChange(e,t){e instanceof Us&&e.onValueChange(t)}forEachInput(e){this.getConditionTypes().forEach((t,i)=>{this.forEachPositionTypeInput(i,t,e)})}forEachPositionInput(e,t){const i=this.getConditionType(e);this.forEachPositionTypeInput(e,i,t)}forEachPositionTypeInput(e,t,i){const n=this.getNumberOfInputs(t),s=this.getInputs(e);for(let t=0;t<s.length;t++){const r=s[t];null!=r&&i(r,t,e,n)}}isConditionDisabled(e,t){return!!this.isReadOnly()||0!==e&&e>t+1}isConditionBodyVisible(e){const t=this.getConditionType(e);return this.getNumberOfInputs(t)>0}isConditionUiComplete(t){return!(t>=this.getNumConditions())&&(this.getConditionType(t)!==e.EMPTY&&!this.getValues(t).some(e=>null==e))}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(e=>this.resetType(e)),this.eJoinOperatorsAnd.forEach((e,t)=>this.resetJoinOperatorAnd(e,t,this.joinOperatorId+t)),this.eJoinOperatorsOr.forEach((e,t)=>this.resetJoinOperatorOr(e,t,this.joinOperatorId+t)),this.joinOperatorId++,this.forEachInput(e=>this.resetInput(e)),this.resetPlaceholder(),this.createMissingConditionsAndOperators(),this.lastUiCompletePosition=null,e||this.onUiChanged(),ds.resolve()}resetType(e){const t=this.localeService.getLocaleTextFunc()("ariaFilteringOperator","Filtering operator");e.setValue(this.optionsFactory.getDefaultOption(),!0).setAriaLabel(t).setDisabled(this.isReadOnly()||this.filterListOptions.length<=1)}resetJoinOperatorAnd(e,t,i){this.resetJoinOperator(e,t,this.isDefaultOperator("AND"),this.translate("andCondition"),i)}resetJoinOperatorOr(e,t,i){this.resetJoinOperator(e,t,this.isDefaultOperator("OR"),this.translate("orCondition"),i)}resetJoinOperator(e,t,i,n,s){this.updateJoinOperatorDisabled(e.setValue(i,!0).setName(`ag-simple-filter-and-or-${this.getCompId()}-${s}`).setLabel(n),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 i=this.mapValuesFromModel(e);this.forEachInput((e,n,s,r)=>{s===t&&this.setElementValue(e,null!=i[n]?i[n]:null)})}setValueFromFloatingFilter(e){this.forEachInput((t,i,n,s)=>{this.setElementValue(t,0===i&&0===n?e:null,!0)})}isDefaultOperator(e){return e===this.defaultJoinOperator}addChangedListeners(e,t){this.isReadOnly()||(e.onValueChange(this.listener),this.forEachPositionInput(t,e=>{this.attachElementOnChange(e,this.listener)}))}individualConditionPasses(e,t){const i=this.getCellValue(e.node),n=this.mapValuesFromModel(t),s=this.optionsFactory.getCustomOption(t.type),r=this.evaluateCustomFilter(s,n,i);return null!=r?r:null==i?this.evaluateNullValue(t.type):this.evaluateNonNullValue(n,i,t,e)}evaluateCustomFilter(e,t,i){if(null==e)return;const{predicate:n}=e;return null==n||t.some(e=>null==e)?void 0:n(t,i)}isBlank(e){return null==e||"string"==typeof e&&0===e.trim().length}hasInvalidInputs(){return!1}};$s.EMPTY="empty",$s.BLANK="blank",$s.NOT_BLANK="notBlank",$s.EQUALS="equals",$s.NOT_EQUAL="notEqual",$s.LESS_THAN="lessThan",$s.LESS_THAN_OR_EQUAL="lessThanOrEqual",$s.GREATER_THAN="greaterThan",$s.GREATER_THAN_OR_EQUAL="greaterThanOrEqual",$s.IN_RANGE="inRange",$s.CONTAINS="contains",$s.NOT_CONTAINS="notContains",$s.STARTS_WITH="startsWith",$s.ENDS_WITH="endsWith";var Ks=$s,Ys=class e extends Ks{setParams(e){super.setParams(e),this.scalarFilterParams=e}evaluateNullValue(t){switch(t){case e.EQUALS:case e.NOT_EQUAL:if(this.scalarFilterParams.includeBlanksInEquals)return!0;break;case e.GREATER_THAN:case e.GREATER_THAN_OR_EQUAL:if(this.scalarFilterParams.includeBlanksInGreaterThan)return!0;break;case e.LESS_THAN:case e.LESS_THAN_OR_EQUAL:if(this.scalarFilterParams.includeBlanksInLessThan)return!0;break;case e.IN_RANGE:if(this.scalarFilterParams.includeBlanksInRange)return!0;break;case e.BLANK:return!0;case e.NOT_BLANK:return!1}return!1}evaluateNonNullValue(t,i,n){const s=this.comparator(),r=null!=t[0]?s(t[0],i):0;switch(n.type){case e.EQUALS:return 0===r;case e.NOT_EQUAL:return 0!==r;case e.GREATER_THAN:return r>0;case e.GREATER_THAN_OR_EQUAL:return r>=0;case e.LESS_THAN:return r<0;case e.LESS_THAN_OR_EQUAL:return r<=0;case e.IN_RANGE:{const e=s(t[1],i);return this.scalarFilterParams.inRangeInclusive?r>=0&&e<=0:r>0&&e<0}case e.BLANK:return this.isBlank(i);case e.NOT_BLANK:return!this.isBlank(i);default:return console.warn('AG Grid: Unexpected type of filter "'+n.type+'", it looks like the filter was configured with incorrect Filter Options'),!0}}},qs=1/0,Xs=class extends js{constructor(e,t,i){super(t,i),this.dateFilterParams=e}conditionToString(e,t){const{type:i}=e,{numberOfInputs:n}=t||{},s=i==Ks.IN_RANGE||2===n,r=Ji(e.dateFrom),o=Ji(e.dateTo),a=this.dateFilterParams.inRangeFloatingFilterDateFormat;return s?`${null!==r?Qi(r,a):"null"}-${null!==o?Qi(o,a):"null"}`:null!=r?Qi(r,a):`${i}`}updateParams(e){super.updateParams(e),this.dateFilterParams=e.dateFilterParams}},Zs=class e extends Ys{constructor(){super("dateFilter"),this.eConditionPanelsFrom=[],this.eConditionPanelsTo=[],this.dateConditionFromComps=[],this.dateConditionToComps=[],this.minValidYear=1e3,this.maxValidYear=qs,this.minValidDate=null,this.maxValidDate=null}afterGuiAttached(e){super.afterGuiAttached(e),this.dateConditionFromComps[0].afterGuiAttached(e)}mapValuesFromModel(e){const{dateFrom:t,dateTo:i,type:n}=e||{};return[t&&Ji(t)||null,i&&Ji(i)||null].slice(0,this.getNumberOfInputs(n))}comparator(){return this.dateFilterParams.comparator?this.dateFilterParams.comparator:this.defaultComparator.bind(this)}defaultComparator(e,t){return null==t||t<e?-1:t>e?1:0}setParams(e){this.dateFilterParams=e,super.setParams(e);const t=(t,i)=>{if(null!=e[t]){if(!isNaN(e[t]))return null==e[t]?i:Number(e[t]);console.warn(`AG Grid: DateFilter ${t} is not a number`)}return i};this.minValidYear=t("minValidYear",1e3),this.maxValidYear=t("maxValidYear",qs),this.minValidYear>this.maxValidYear&&console.warn("AG Grid: DateFilter minValidYear should be <= maxValidYear"),e.minValidDate?this.minValidDate=e.minValidDate instanceof Date?e.minValidDate:Ji(e.minValidDate):this.minValidDate=null,e.maxValidDate?this.maxValidDate=e.maxValidDate instanceof Date?e.maxValidDate:Ji(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 Xs(this.dateFilterParams,this.localeService,this.optionsFactory)}createDateCompWrapper(e){const t=new As(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 e.DEFAULT_FILTER_OPTIONS}createValueElement(){const e=this.gos.getDocument().createElement("div");return e.classList.add("ag-filter-body"),this.createFromToElement(e,this.eConditionPanelsFrom,this.dateConditionFromComps,"from"),this.createFromToElement(e,this.eConditionPanelsTo,this.dateConditionToComps,"to"),e}createFromToElement(e,t,i,n){const s=this.gos.getDocument().createElement("div");s.classList.add(`ag-filter-${n}`),s.classList.add(`ag-filter-date-${n}`),t.push(s),e.appendChild(s),i.push(this.createDateCompWrapper(s))}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,i){this.removeItems(e,t,i).forEach(e=>e.destroy())}isValidDateValue(e){if(null===e)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((i,n,s,r)=>{s!==e||!t||n>=r||(t=t&&this.isValidDateValue(i.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),i={},n=this.getValues(e);return n.length>0&&(i.dateFrom=Xi(n[0])),n.length>1&&(i.dateTo=Xi(n[1])),u({dateFrom:null,dateTo:null,filterType:this.getFilterType(),type:t},i)}resetPlaceholder(){const e=this.localeService.getLocaleTextFunc(),t=this.translate("dateFormatOoo"),i=e("ariaFilterValue","Filter Value");this.forEachInput(e=>{e.setInputPlaceholder(t),e.setInputAriaLabel(i)})}getInputs(e){return e>=this.dateConditionFromComps.length?[null,null]:[this.dateConditionFromComps[e],this.dateConditionToComps[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(e,i,n,s)=>{i<s&&t.push(e.getDate())}),t}translate(e){return e===Ys.LESS_THAN?super.translate("before"):e===Ys.GREATER_THAN?super.translate("after"):super.translate(e)}getModelAsString(e){var t;return null!=(t=this.filterModelFormatter.getModelAsString(e))?t:""}};Zs.DEFAULT_FILTER_OPTIONS=[Ys.EQUALS,Ys.NOT_EQUAL,Ys.LESS_THAN,Ys.GREATER_THAN,Ys.IN_RANGE,Ys.BLANK,Ys.NOT_BLANK],g([ue("userComponentFactory")],Zs.prototype,"userComponentFactory",2);var Qs=Zs,Js=class extends Cs{getDefaultDebounceMs(){return 0}destroy(){super.destroy()}isEventFromFloatingFilter(e){return e&&e.afterFloatingFilter}isEventFromDataChange(e){return null==e?void 0:e.afterDataChange}getLastType(){return this.lastType}isReadOnly(){return this.readOnly}setLastTypeFromModel(e){if(!e)return void(this.lastType=this.optionsFactory.getDefaultOption());let t;t=e.operator?e.conditions[0]:e,this.lastType=t.type}canWeEditAfterModelFromParentFilter(e){if(!e)return this.isTypeEditable(this.lastType);if(e.operator)return!1;const t=e;return this.isTypeEditable(t.type)}init(e){this.setSimpleParams(e,!1)}setSimpleParams(e,t=!0){this.optionsFactory=new Ms,this.optionsFactory.init(e.filterParams,this.getDefaultFilterOptions()),t||(this.lastType=this.optionsFactory.getDefaultOption()),this.readOnly=!!e.filterParams.readOnly;const i=this.isTypeEditable(this.optionsFactory.getDefaultOption());this.setEditable(i)}onParamsUpdated(e){this.refresh(e)}refresh(e){this.setSimpleParams(e)}doesFilterHaveSingleInput(e){const t=this.optionsFactory.getCustomOption(e),{numberOfInputs:i}=t||{};return null==i||1==i}isTypeEditable(e){const t=[Ks.IN_RANGE,Ks.EMPTY,Ks.BLANK,Ks.NOT_BLANK];return!!e&&!this.isReadOnly()&&this.doesFilterHaveSingleInput(e)&&t.indexOf(e)<0}getAriaLabel(e){return`${this.columnModel.getDisplayNameForColumn(e.column,"header",!0)} ${this.localeService.getLocaleTextFunc()("ariaFilterInput","Filter Input")}`}};g([ue("columnModel")],Js.prototype,"columnModel",2);var er=class extends Js{constructor(){super('\n            <div class="ag-floating-filter-input" role="presentation">\n                <ag-input-text-field ref="eReadOnlyText"></ag-input-text-field>\n                <div ref="eDateWrapper" style="display: flex;"></div>\n            </div>')}getDefaultFilterOptions(){return Qs.DEFAULT_FILTER_OPTIONS}init(e){super.init(e),this.params=e,this.filterParams=e.filterParams,this.createDateComponent(),this.filterModelFormatter=new Xs(this.filterParams,this.localeService,this.optionsFactory);const t=this.localeService.getLocaleTextFunc();this.eReadOnlyText.setDisabled(!0).setInputAriaLabel(t("ariaDateFilterInput","Date Filter Input"))}onParamsUpdated(e){this.refresh(e)}refresh(e){super.refresh(e),this.params=e,this.filterParams=e.filterParams,this.updateDateComponent(),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory,dateFilterParams:this.filterParams}),this.updateCompOnModelChange(e.currentParentModel())}updateCompOnModelChange(e){const t=!this.isReadOnly()&&this.canWeEditAfterModelFromParentFilter(e);if(this.setEditable(t),t){if(e){const t=e;this.dateComp.setDate(Ji(t.dateFrom))}else this.dateComp.setDate(null);this.eReadOnlyText.setValue("")}else this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(e)),this.dateComp.setDate(null)}setEditable(e){an(this.eDateWrapper,e),an(this.eReadOnlyText.getGui(),!e)}onParentModelChanged(e,t){this.isEventFromFloatingFilter(t)||this.isEventFromDataChange(t)||(super.setLastTypeFromModel(e),this.updateCompOnModelChange(e))}onDateChanged(){const e=Xi(this.dateComp.getDate());this.params.parentFilterInstance(t=>{if(t){const i=Ji(e);t.onFloatingFilterChanged(this.getLastType()||null,i)}})}getDateComponentParams(){const e=Ls.getDebounceMs(this.params.filterParams,this.getDefaultDebounceMs());return{onDateChanged:Q(this.onDateChanged.bind(this),e),filterParams:this.params.column.getColDef().filterParams}}createDateComponent(){this.dateComp=new As(this.getContext(),this.userComponentFactory,this.getDateComponentParams(),this.eDateWrapper,e=>{e.setInputAriaLabel(this.getAriaLabel(this.params))}),this.addDestroyFunc(()=>this.dateComp.destroy())}updateDateComponent(){const e=this.gos.addGridCommonParams(this.getDateComponentParams());this.dateComp.updateParams(e)}getFilterModelFormatter(){return this.filterModelFormatter}};g([ue("userComponentFactory")],er.prototype,"userComponentFactory",2),g([Ss("eReadOnlyText")],er.prototype,"eReadOnlyText",2),g([Ss("eDateWrapper")],er.prototype,"eDateWrapper",2);var tr=class extends Cs{constructor(){super('\n            <div class="ag-filter-filter">\n                <ag-input-text-field class="ag-date-filter" ref="eDateInput"></ag-input-text-field>\n            </div>')}destroy(){super.destroy()}init(e){this.params=e,this.setParams(e);const t=this.eDateInput.getInputElement();this.addManagedListener(t,"mousedown",()=>{this.eDateInput.isDisabled()||this.usingSafariDatePicker||t.focus()}),this.addManagedListener(t,"input",e=>{e.target===this.gos.getActiveDomElement()&&(this.eDateInput.isDisabled()||this.params.onDateChanged())})}setParams(e){const t=this.eDateInput.getInputElement(),i=this.shouldUseBrowserDatePicker(e);this.usingSafariDatePicker=i&&Ti(),t.type=i?"date":"text";const{minValidYear:n,maxValidYear:s,minValidDate:r,maxValidDate:o}=e.filterParams||{};if(r&&n&&z("DateFilter should not have both minValidDate and minValidYear parameters set at the same time! minValidYear will be ignored."),o&&s&&z("DateFilter should not have both maxValidDate and maxValidYear parameters set at the same time! maxValidYear will be ignored."),r&&o){const[e,t]=[r,o].map(e=>e instanceof Date?e:Ji(e));e&&t&&e.getTime()>t.getTime()&&z("DateFilter parameter minValidDate should always be lower than or equal to parameter maxValidDate.")}r?r instanceof Date?t.min=Qi(r):t.min=r:n&&(t.min=`${n}-01-01`),o?o instanceof Date?t.max=Qi(o):t.max=o:s&&(t.max=`${s}-12-31`)}onParamsUpdated(e){this.refresh(e)}refresh(e){this.params=e,this.setParams(e)}getDate(){return Ji(this.eDateInput.getValue())}setDate(e){this.eDateInput.setValue(Xi(e,!1))}setInputPlaceholder(e){this.eDateInput.setInputPlaceholder(e)}setInputAriaLabel(e){this.eDateInput.setAriaLabel(e)}setDisabled(e){this.eDateInput.setDisabled(e)}afterGuiAttached(e){e&&e.suppressFocus||this.eDateInput.getInputElement().focus()}shouldUseBrowserDatePicker(e){return e.filterParams&&null!=e.filterParams.browserDatePicker?e.filterParams.browserDatePicker:Ii()||Ri()||Ti()&&Di()>=14.1}};g([Ss("eDateInput")],tr.prototype,"eDateInput",2);var ir=class extends Us{constructor(e,t="ag-text-field",i="text"){super(e,t,i)}postConstruct(){super.postConstruct(),this.config.allowedCharPattern&&this.preventDisallowedCharacters()}setValue(e,t){return this.eInput.value!==e&&(this.eInput.value=b(e)?e:""),super.setValue(e,t)}setStartValue(e){this.setValue(e,!0)}preventDisallowedCharacters(){const e=new RegExp(`[${this.config.allowedCharPattern}]`);this.addManagedListener(this.eInput,"keydown",t=>{Qn(t)&&t.key&&!e.test(t.key)&&t.preventDefault()}),this.addManagedListener(this.eInput,"paste",t=>{var i;const n=null==(i=t.clipboardData)?void 0:i.getData("text");n&&n.split("").some(t=>!e.test(t))&&t.preventDefault()})}},nr=class extends ir{constructor(e){super(e,"ag-number-field","number")}postConstruct(){super.postConstruct(),this.addManagedListener(this.eInput,"blur",()=>{const e=parseFloat(this.eInput.value),t=isNaN(e)?"":this.normalizeValue(e.toString());this.value!==t&&this.setValue(t)}),this.addManagedListener(this.eInput,"wheel",this.onWheel.bind(this)),this.eInput.step="any";const{precision:e,min:t,max:i,step:n}=this.config;"number"==typeof e&&this.setPrecision(e),"number"==typeof t&&this.setMin(t),"number"==typeof i&&this.setMax(i),"number"==typeof n&&this.setStep(n)}onWheel(e){this.gos.getActiveDomElement()===this.eInput&&e.preventDefault()}normalizeValue(e){if(""===e)return"";null!=this.precision&&(e=this.adjustPrecision(e));const t=parseFloat(e);return null!=this.min&&t<this.min?e=this.min.toString():null!=this.max&&t>this.max&&(e=this.max.toString()),e}adjustPrecision(e,t){if(null==this.precision)return e;if(t){const t=parseFloat(e).toFixed(this.precision);return parseFloat(t).toString()}const i=String(e).split(".");if(i.length>1){if(i[1].length<=this.precision)return e;if(this.precision>0)return`${i[0]}.${i[1].slice(0,this.precision)}`}return i[0]}setMin(e){return this.min===e||(this.min=e,Bn(this.eInput,"min",e)),this}setMax(e){return this.max===e||(this.max=e,Bn(this.eInput,"max",e)),this}setPrecision(e){return this.precision=e,this}setStep(e){return this.step===e||(this.step=e,Bn(this.eInput,"step",e)),this}setValue(e,t){return this.setValueOrInputValue(e=>super.setValue(e,t),()=>this,e)}setStartValue(e){return this.setValueOrInputValue(e=>super.setValue(e,!0),e=>{this.eInput.value=e},e)}setValueOrInputValue(e,t,i){if(b(i)){let n=this.isScientificNotation(i);if(n&&this.eInput.validity.valid)return e(i);if(n||(n=(i=this.adjustPrecision(i))!=this.normalizeValue(i)),n)return t(i)}return e(i)}getValue(){if(!this.eInput.validity.valid)return;const e=this.eInput.value;return this.isScientificNotation(e)?this.adjustPrecision(e,!0):super.getValue()}isScientificNotation(e){return"string"==typeof e&&e.includes("e")}},sr=class extends js{conditionToString(e,t){const{numberOfInputs:i}=t||{};return e.type==Ks.IN_RANGE||2===i?`${this.formatValue(e.filter)}-${this.formatValue(e.filterTo)}`:null!=e.filter?this.formatValue(e.filter):`${e.type}`}};function rr(e){const{allowedCharPattern:t}=null!=e?e:{};return null!=t?t:null}var or=class e extends Ys{constructor(){super("numberFilter"),this.eValuesFrom=[],this.eValuesTo=[]}refresh(e){return this.numberFilterParams.allowedCharPattern===e.allowedCharPattern&&super.refresh(e)}mapValuesFromModel(e){const{filter:t,filterTo:i,type:n}=e||{};return[this.processValue(t),this.processValue(i)].slice(0,this.getNumberOfInputs(n))}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 sr(this.localeService,this.optionsFactory,this.numberFilterParams.numberFormatter)}getDefaultFilterOptions(){return e.DEFAULT_FILTER_OPTIONS}setElementValue(e,t,i){const n=!i&&this.numberFilterParams.numberFormatter?this.numberFilterParams.numberFormatter(null!=t?t:null):t;super.setElementValue(e,n)}createValueElement(){const e=rr(this.numberFilterParams),t=document.createElement("div");return t.classList.add("ag-filter-body"),Ht(t,"presentation"),this.createFromToElement(t,this.eValuesFrom,"from",e),this.createFromToElement(t,this.eValuesTo,"to",e),t}createFromToElement(e,t,i,n){const s=this.createManagedBean(n?new ir({allowedCharPattern:n}):new nr);s.addCssClass(`ag-filter-${i}`),s.addCssClass("ag-filter-filter"),t.push(s),e.appendChild(s.getGui())}removeValueElements(e,t){this.removeComponents(this.eValuesFrom,e,t),this.removeComponents(this.eValuesTo,e,t)}getValues(e){const t=[];return this.forEachPositionInput(e,(e,i,n,s)=>{i<s&&t.push(this.processValue(this.stringToFloat(e.getValue())))}),t}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getFilterType(){return"number"}processValue(e){return null==e||isNaN(e)?null:e}stringToFloat(e){if("number"==typeof e)return e;let t=v(e);return null!=t&&""===t.trim()&&(t=null),this.numberFilterParams.numberParser?this.numberFilterParams.numberParser(t):null==t||"-"===t.trim()?null:parseFloat(t)}createCondition(e){const t=this.getConditionType(e),i={filterType:this.getFilterType(),type:t},n=this.getValues(e);return n.length>0&&(i.filter=n[0]),n.length>1&&(i.filterTo=n[1]),i}getInputs(e){return e>=this.eValuesFrom.length?[null,null]:[this.eValuesFrom[e],this.eValuesTo[e]]}getModelAsString(e){var t;return null!=(t=this.filterModelFormatter.getModelAsString(e))?t:""}hasInvalidInputs(){let e=!1;return this.forEachInput(t=>{t.getInputElement().validity.valid||(e=!0)}),e}};or.DEFAULT_FILTER_OPTIONS=[Ys.EQUALS,Ys.NOT_EQUAL,Ys.GREATER_THAN,Ys.GREATER_THAN_OR_EQUAL,Ys.LESS_THAN,Ys.LESS_THAN_OR_EQUAL,Ys.IN_RANGE,Ys.BLANK,Ys.NOT_BLANK];var ar=or,lr=class extends js{conditionToString(e,t){const{numberOfInputs:i}=t||{};return e.type==Ks.IN_RANGE||2===i?`${e.filter}-${e.filterTo}`:null!=e.filter?`${e.filter}`:`${e.type}`}},cr=class e extends Ks{constructor(){super("textFilter"),this.eValuesFrom=[],this.eValuesTo=[]}static trimInput(e){const t=e&&e.trim();return""===t?e:t}getDefaultDebounceMs(){return 500}setParams(t){this.textFilterParams=t,super.setParams(t),this.matcher=this.getTextMatcher(),this.formatter=this.textFilterParams.textFormatter||(this.textFilterParams.caseSensitive?e.DEFAULT_FORMATTER:e.DEFAULT_LOWERCASE_FORMATTER),this.filterModelFormatter=new lr(this.localeService,this.optionsFactory)}getTextMatcher(){const t=this.textFilterParams.textCustomComparator;return t?(cs.warnOnce("textCustomComparator is deprecated, use textMatcher instead."),({filterOption:e,value:i,filterText:n})=>t(e,i,n)):this.textFilterParams.textMatcher||e.DEFAULT_MATCHER}createCondition(e){const t=this.getConditionType(e),i={filterType:this.getFilterType(),type:t},n=this.getValuesWithSideEffects(e,!0);return n.length>0&&(i.filter=n[0]),n.length>1&&(i.filterTo=n[1]),i}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(t,i){const n=[];return this.forEachPositionInput(t,(t,s,r,o)=>{var a;if(s<o){let s=v(t.getValue());i&&this.textFilterParams.trimInput&&(s=null!=(a=e.trimInput(s))?a:null,t.setValue(s,!0)),n.push(s)}}),n}getDefaultFilterOptions(){return e.DEFAULT_FILTER_OPTIONS}createValueElement(){const e=document.createElement("div");return e.classList.add("ag-filter-body"),Ht(e,"presentation"),this.createFromToElement(e,this.eValuesFrom,"from"),this.createFromToElement(e,this.eValuesTo,"to"),e}createFromToElement(e,t,i){const n=this.createManagedBean(new ir);n.addCssClass(`ag-filter-${i}`),n.addCssClass("ag-filter-filter"),t.push(n),e.appendChild(n.getGui())}removeValueElements(e,t){this.removeComponents(this.eValuesFrom,e,t),this.removeComponents(this.eValuesTo,e,t)}mapValuesFromModel(e){const{filter:t,filterTo:i,type:n}=e||{};return[t||null,i||null].slice(0,this.getNumberOfInputs(n))}evaluateNullValue(e){const t=[Ks.NOT_EQUAL,Ks.NOT_CONTAINS,Ks.BLANK];return!!e&&t.indexOf(e)>=0}evaluateNonNullValue(e,t,i,n){const s=e.map(e=>this.formatter(e))||[],r=this.formatter(t),{api:o,colDef:a,column:l,columnApi:c,context:h,textFormatter:p}=this.textFilterParams;if(i.type===Ks.BLANK)return this.isBlank(t);if(i.type===Ks.NOT_BLANK)return!this.isBlank(t);const g={api:o,colDef:a,column:l,columnApi:c,context:h,node:n.node,data:n.data,filterOption:i.type,value:r,textFormatter:p};return s.some(e=>this.matcher(d(u({},g),{filterText:e})))}getModelAsString(e){var t;return null!=(t=this.filterModelFormatter.getModelAsString(e))?t:""}};cr.DEFAULT_FILTER_OPTIONS=[Ks.CONTAINS,Ks.NOT_CONTAINS,Ks.EQUALS,Ks.NOT_EQUAL,Ks.STARTS_WITH,Ks.ENDS_WITH,Ks.BLANK,Ks.NOT_BLANK],cr.DEFAULT_FORMATTER=e=>e,cr.DEFAULT_LOWERCASE_FORMATTER=e=>null==e?null:e.toString().toLowerCase(),cr.DEFAULT_MATCHER=({filterOption:e,value:t,filterText:i})=>{if(null==i)return!1;switch(e){case cr.CONTAINS:return t.indexOf(i)>=0;case cr.NOT_CONTAINS:return t.indexOf(i)<0;case cr.EQUALS:return t===i;case cr.NOT_EQUAL:return t!=i;case cr.STARTS_WITH:return 0===t.indexOf(i);case cr.ENDS_WITH:const e=t.lastIndexOf(i);return e>=0&&e===t.length-i.length;default:return!1}};var hr=cr,ur=class extends st{constructor(e){super(),this.params=e,this.valueChangedListener=()=>{}}setupGui(e){var t;this.eFloatingFilterTextInput=this.createManagedBean(new ir(null==(t=this.params)?void 0:t.config));const i=this.eFloatingFilterTextInput.getGui();e.appendChild(i),this.addManagedListener(i,"input",e=>this.valueChangedListener(e)),this.addManagedListener(i,"keydown",e=>this.valueChangedListener(e))}setEditable(e){this.eFloatingFilterTextInput.setDisabled(!e)}setAutoComplete(e){this.eFloatingFilterTextInput.setAutoComplete(e)}getValue(){return this.eFloatingFilterTextInput.getValue()}setValue(e,t){this.eFloatingFilterTextInput.setValue(e,t)}setValueChangedListener(e){this.valueChangedListener=e}setParams(e){this.setAriaLabel(e.ariaLabel),void 0!==e.autoComplete&&this.setAutoComplete(e.autoComplete)}setAriaLabel(e){this.eFloatingFilterTextInput.setInputAriaLabel(e)}},dr=class extends Js{postConstruct(){this.setTemplate('\n            <div class="ag-floating-filter-input" role="presentation" ref="eFloatingFilterInputContainer"></div>\n        ')}getDefaultDebounceMs(){return 500}onParentModelChanged(e,t){this.isEventFromFloatingFilter(t)||this.isEventFromDataChange(t)||(this.setLastTypeFromModel(e),this.setEditable(this.canWeEditAfterModelFromParentFilter(e)),this.floatingFilterInputService.setValue(this.getFilterModelFormatter().getModelAsString(e)))}init(e){this.setupFloatingFilterInputService(e),super.init(e),this.setTextInputParams(e)}setupFloatingFilterInputService(e){this.floatingFilterInputService=this.createFloatingFilterInputService(e),this.floatingFilterInputService.setupGui(this.eFloatingFilterInputContainer)}setTextInputParams(e){var t;this.params=e;const i=null!=(t=e.browserAutoComplete)&&t;if(this.floatingFilterInputService.setParams({ariaLabel:this.getAriaLabel(e),autoComplete:i}),this.applyActive=Ls.isUseApplyButton(this.params.filterParams),!this.isReadOnly()){const e=Ls.getDebounceMs(this.params.filterParams,this.getDefaultDebounceMs()),t=Q(this.syncUpWithParentFilter.bind(this),e);this.floatingFilterInputService.setValueChangedListener(t)}}onParamsUpdated(e){this.refresh(e)}refresh(e){super.refresh(e),this.setTextInputParams(e)}recreateFloatingFilterInputService(e){const t=this.floatingFilterInputService.getValue();Cn(this.eFloatingFilterInputContainer),this.destroyBean(this.floatingFilterInputService),this.setupFloatingFilterInputService(e),this.floatingFilterInputService.setValue(t,!0)}syncUpWithParentFilter(e){const t=e.key===Zn.ENTER;if(this.applyActive&&!t)return;let i=this.floatingFilterInputService.getValue();this.params.filterParams.trimInput&&(i=hr.trimInput(i),this.floatingFilterInputService.setValue(i,!0)),this.params.parentFilterInstance(e=>{e&&e.onFloatingFilterChanged(this.getLastType()||null,i||null)})}setEditable(e){this.floatingFilterInputService.setEditable(e)}};g([Ss("eFloatingFilterInputContainer")],dr.prototype,"eFloatingFilterInputContainer",2),g([le],dr.prototype,"postConstruct",1);var pr=class extends st{constructor(){super(...arguments),this.valueChangedListener=()=>{},this.numberInputActive=!0}setupGui(e){this.eFloatingFilterNumberInput=this.createManagedBean(new nr),this.eFloatingFilterTextInput=this.createManagedBean(new ir),this.eFloatingFilterTextInput.setDisabled(!0);const t=this.eFloatingFilterNumberInput.getGui(),i=this.eFloatingFilterTextInput.getGui();e.appendChild(t),e.appendChild(i),this.setupListeners(t,e=>this.valueChangedListener(e)),this.setupListeners(i,e=>this.valueChangedListener(e))}setEditable(e){this.numberInputActive=e,this.eFloatingFilterNumberInput.setDisplayed(this.numberInputActive),this.eFloatingFilterTextInput.setDisplayed(!this.numberInputActive)}setAutoComplete(e){this.eFloatingFilterNumberInput.setAutoComplete(e),this.eFloatingFilterTextInput.setAutoComplete(e)}getValue(){return this.getActiveInputElement().getValue()}setValue(e,t){this.getActiveInputElement().setValue(e,t)}getActiveInputElement(){return this.numberInputActive?this.eFloatingFilterNumberInput:this.eFloatingFilterTextInput}setValueChangedListener(e){this.valueChangedListener=e}setupListeners(e,t){this.addManagedListener(e,"input",t),this.addManagedListener(e,"keydown",t)}setParams(e){this.setAriaLabel(e.ariaLabel),void 0!==e.autoComplete&&this.setAutoComplete(e.autoComplete)}setAriaLabel(e){this.eFloatingFilterNumberInput.setInputAriaLabel(e),this.eFloatingFilterTextInput.setInputAriaLabel(e)}},gr=class extends dr{init(e){var t;super.init(e),this.filterModelFormatter=new sr(this.localeService,this.optionsFactory,null==(t=e.filterParams)?void 0:t.numberFormatter)}onParamsUpdated(e){this.refresh(e)}refresh(e){rr(e.filterParams)!==this.allowedCharPattern&&this.recreateFloatingFilterInputService(e),super.refresh(e),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory})}getDefaultFilterOptions(){return ar.DEFAULT_FILTER_OPTIONS}getFilterModelFormatter(){return this.filterModelFormatter}createFloatingFilterInputService(e){return this.allowedCharPattern=rr(e.filterParams),this.allowedCharPattern?this.createManagedBean(new ur({config:{allowedCharPattern:this.allowedCharPattern}})):this.createManagedBean(new pr)}},fr=class extends dr{init(e){super.init(e),this.filterModelFormatter=new lr(this.localeService,this.optionsFactory)}onParamsUpdated(e){this.refresh(e)}refresh(e){super.refresh(e),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory})}getDefaultFilterOptions(){return hr.DEFAULT_FILTER_OPTIONS}getFilterModelFormatter(){return this.filterModelFormatter}createFloatingFilterInputService(){return this.createManagedBean(new ur)}},mr=class e{constructor(e,t=!1){this.destroyFuncs=[],this.touching=!1,this.eventService=new me,this.eElement=e,this.preventMouseClick=t;const i=this.onTouchStart.bind(this),n=this.onTouchMove.bind(this),s=this.onTouchEnd.bind(this);this.eElement.addEventListener("touchstart",i,{passive:!0}),this.eElement.addEventListener("touchmove",n,{passive:!0}),this.eElement.addEventListener("touchend",s,{passive:!1}),this.destroyFuncs.push(()=>{this.eElement.removeEventListener("touchstart",i,{passive:!0}),this.eElement.removeEventListener("touchmove",n,{passive:!0}),this.eElement.removeEventListener("touchend",s,{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(t){if(this.touching)return;this.touchStart=t.touches[0],this.touching=!0,this.moved=!1;const i=this.touchStart;window.setTimeout(()=>{const n=this.touchStart===i;if(this.touching&&n&&!this.moved){this.moved=!0;const i={type:e.EVENT_LONG_TAP,touchStart:this.touchStart,touchEvent:t};this.eventService.dispatchEvent(i)}},500)}onTouchMove(e){if(!this.touching)return;const t=this.getActiveTouch(e.touches);t&&!ss(t,this.touchStart,4)&&(this.moved=!0)}onTouchEnd(t){if(this.touching){if(!this.moved){const t={type:e.EVENT_TAP,touchStart:this.touchStart};this.eventService.dispatchEvent(t),this.checkForDoubleTap()}this.preventMouseClick&&t.cancelable&&t.preventDefault(),this.touching=!1}}checkForDoubleTap(){const t=(new Date).getTime();if(this.lastTapTime&&this.lastTapTime>0)if(t-this.lastTapTime>e.DOUBLE_TAP_MILLIS){const t={type:e.EVENT_DOUBLE_TAP,touchStart:this.touchStart};this.eventService.dispatchEvent(t),this.lastTapTime=null}else this.lastTapTime=t;else this.lastTapTime=t}destroy(){this.destroyFuncs.forEach(e=>e())}};mr.EVENT_TAP="tap",mr.EVENT_DOUBLE_TAP="doubleTap",mr.EVENT_LONG_TAP="longTap",mr.DOUBLE_TAP_MILLIS=500;var yr=mr,vr=class e extends Cs{constructor(t){super(),t||this.setTemplate(e.TEMPLATE)}attachCustomElements(e,t,i,n,s){this.eSortOrder=e,this.eSortAsc=t,this.eSortDesc=i,this.eSortMixed=n,this.eSortNone=s}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,ct.EVENT_NEW_COLUMNS_LOADED,()=>this.updateIcons()),this.addManagedListener(this.eventService,ct.EVENT_SORT_CHANGED,()=>this.onSortChanged()),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.onSortChanged()),this.onSortChanged())}addInIcon(e,t,i){if(null==t)return;const n=qn(e,this.gos,i);n&&t.appendChild(n)}onSortChanged(){this.updateIcons(),this.suppressOrder||this.updateSortOrder()}updateIcons(){const e=this.sortController.getDisplaySortForColumn(this.column);if(this.eSortAsc){const t="asc"===e;an(this.eSortAsc,t,{skipAriaHidden:!0})}if(this.eSortDesc){const t="desc"===e;an(this.eSortDesc,t,{skipAriaHidden:!0})}if(this.eSortNone){const t=!this.column.getColDef().unSortIcon&&!this.gos.get("unSortIcon"),i=null==e;an(this.eSortNone,!t&&i,{skipAriaHidden:!0})}}setupMultiSortIndicator(){this.addInIcon("sortUnSort",this.eSortMixed,this.column);const e=this.column.getColDef().showRowGroup;this.gos.isColumnsSortingCoupledToGroup()&&e&&(this.addManagedListener(this.eventService,ct.EVENT_SORT_CHANGED,()=>this.updateMultiSortIndicator()),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.updateMultiSortIndicator()),this.updateMultiSortIndicator())}updateMultiSortIndicator(){if(this.eSortMixed){const e="mixed"===this.sortController.getDisplaySortForColumn(this.column);an(this.eSortMixed,e,{skipAriaHidden:!0})}}updateSortOrder(){var e;if(!this.eSortOrder)return;const t=this.sortController.getColumnsWithSortingOrdered(),i=null!=(e=this.sortController.getDisplaySortIndexForColumn(this.column))?e:-1,n=t.some(e=>{var t;return null!=(t=this.sortController.getDisplaySortIndexForColumn(e))&&t}),s=i>=0&&n;an(this.eSortOrder,s,{skipAriaHidden:!0}),i>=0?this.eSortOrder.textContent=(i+1).toString():Cn(this.eSortOrder)}};vr.TEMPLATE='<span class="ag-sort-indicator-container">\n            <span ref="eSortOrder" class="ag-sort-indicator-icon ag-sort-order ag-hidden" aria-hidden="true"></span>\n            <span ref="eSortAsc" class="ag-sort-indicator-icon ag-sort-ascending-icon ag-hidden" aria-hidden="true"></span>\n            <span ref="eSortDesc" class="ag-sort-indicator-icon ag-sort-descending-icon ag-hidden" aria-hidden="true"></span>\n            <span ref="eSortMixed" class="ag-sort-indicator-icon ag-sort-mixed-icon ag-hidden" aria-hidden="true"></span>\n            <span ref="eSortNone" class="ag-sort-indicator-icon ag-sort-none-icon ag-hidden" aria-hidden="true"></span>\n        </span>',g([Ss("eSortOrder")],vr.prototype,"eSortOrder",2),g([Ss("eSortAsc")],vr.prototype,"eSortAsc",2),g([Ss("eSortDesc")],vr.prototype,"eSortDesc",2),g([Ss("eSortMixed")],vr.prototype,"eSortMixed",2),g([Ss("eSortNone")],vr.prototype,"eSortNone",2),g([ue("columnModel")],vr.prototype,"columnModel",2),g([ue("sortController")],vr.prototype,"sortController",2);var br=vr,Cr=class e extends Cs{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&&(this.setDisplayName(e),!0)}workOutTemplate(){var t;let i=null!=(t=this.params.template)?t:e.TEMPLATE;return i=i&&i.trim?i.trim():i,i}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=bt(this.currentDisplayName,!0);this.eText&&(this.eText.textContent=t)}}addInIcon(e,t,i){if(null==t)return;const n=qn(e,this.gos,i);n&&t.appendChild(n)}setupTap(){const{gos:e}=this;if(e.get("suppressTouch"))return;const t=new yr(this.getGui(),!0),i=this.shouldSuppressMenuHide(),n=i&&b(this.eMenu),s=n?new yr(this.eMenu,!0):t;if(this.params.enableMenu){const e=n?"EVENT_TAP":"EVENT_LONG_TAP",t=e=>this.params.showColumnMenuAfterMouseClick(e.touchStart);this.addManagedListener(s,yr[e],t)}if(this.params.enableSorting){const e=e=>{var t,n;const s=e.touchStart.target;i&&((null==(t=this.eMenu)?void 0:t.contains(s))||(null==(n=this.eFilterButton)?void 0:n.contains(s)))||this.sortController.progressSort(this.params.column,!1,"uiColumnSorted")};this.addManagedListener(t,yr.EVENT_TAP,e)}if(this.params.enableFilterButton){const e=new yr(this.eFilterButton,!0);this.addManagedListener(e,"tap",()=>this.params.showFilter(this.eFilterButton)),this.addDestroyFunc(()=>e.destroy())}this.addDestroyFunc(()=>t.destroy()),n&&this.addDestroyFunc(()=>s.destroy())}workOutShowMenu(){return this.params.enableMenu&&this.menuService.isHeaderMenuButtonEnabled()}shouldSuppressMenuHide(){return this.menuService.isHeaderMenuButtonAlwaysShowEnabled()}setMenu(){if(!this.eMenu)return;if(this.currentShowMenu=this.workOutShowMenu(),!this.currentShowMenu)return wn(this.eMenu),void(this.eMenu=void 0);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,i,n,s;const{column:r}=this.params,o=this.menuService.isLegacyMenuEnabled();if(e&&!o){if(this.menuService.isFilterMenuInHeaderEnabled(r))return this.params.showFilter(null!=(i=null!=(t=this.eFilterButton)?t:this.eMenu)?i:this.getGui()),!0}else if(this.params.enableMenu)return this.params.showColumnMenu(null!=(s=null!=(n=this.eMenu)?n:this.eFilterButton)?s: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 br(!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,Se.EVENT_MOVING_CHANGED,()=>{this.lastMovingChanged=(new Date).getTime()}),this.eLabel&&this.addManagedListener(this.eLabel,"click",e=>{const t=this.params.column.isMoving(),i=(new Date).getTime()-this.lastMovingChanged<50;if(!t&&!i){const t="ctrl"===this.gos.get("multiSortKey")?e.ctrlKey||e.metaKey:e.shiftKey;this.params.progressSort(t)}});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 e=this.columnModel.getSourceColumnsForGroupColumn(this.params.column),t=!(null==e?void 0:e.every(e=>this.params.column.getSort()==e.getSort()));this.addOrRemoveCssClass("ag-header-cell-sorted-mixed",t)}};this.addManagedListener(this.eventService,ct.EVENT_SORT_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_ROW_GROUP_CHANGED,e)}setupFilterIcon(){this.eFilter&&this.configureFilter(this.params.enableFilterIcon,this.eFilter,this.onFilterChangedIcon.bind(this))}setupFilterButton(){this.eFilterButton&&(this.configureFilter(this.params.enableFilterButton,this.eFilterButton,this.onFilterChangedButton.bind(this))?this.addManagedListener(this.eFilterButton,"click",()=>this.params.showFilter(this.eFilterButton)):this.eFilterButton=void 0)}configureFilter(e,t,i){if(!e)return wn(t),!1;const{column:n}=this.params;return this.addInIcon("filter",t,n),this.addManagedListener(n,Se.EVENT_FILTER_CHANGED,i),i(),!0}onFilterChangedIcon(){const e=this.params.column.isFilterActive();an(this.eFilter,e,{skipAriaHidden:!0})}onFilterChangedButton(){const e=this.params.column.isFilterActive();this.eFilterButton.classList.toggle("ag-filter-active",e)}getAnchorElementForMenu(e){var t,i,n,s;return e?null!=(i=null!=(t=this.eFilterButton)?t:this.eMenu)?i:this.getGui():null!=(s=null!=(n=this.eMenu)?n:this.eFilterButton)?s:this.getGui()}};Cr.TEMPLATE='<div class="ag-cell-label-container" role="presentation">\n            <span ref="eMenu" class="ag-header-icon ag-header-cell-menu-button" aria-hidden="true"></span>\n            <span ref="eFilterButton" class="ag-header-icon ag-header-cell-filter-button" aria-hidden="true"></span>\n            <div ref="eLabel" class="ag-header-cell-label" role="presentation">\n                <span ref="eText" class="ag-header-cell-text"></span>\n                <span ref="eFilter" class="ag-header-icon ag-header-label-icon ag-filter-icon" aria-hidden="true"></span>\n                <ag-sort-indicator ref="eSortIndicator"></ag-sort-indicator>\n            </div>\n        </div>',g([ue("sortController")],Cr.prototype,"sortController",2),g([ue("menuService")],Cr.prototype,"menuService",2),g([ue("columnModel")],Cr.prototype,"columnModel",2),g([Ss("eFilter")],Cr.prototype,"eFilter",2),g([Ss("eFilterButton")],Cr.prototype,"eFilterButton",2),g([Ss("eSortIndicator")],Cr.prototype,"eSortIndicator",2),g([Ss("eMenu")],Cr.prototype,"eMenu",2),g([Ss("eLabel")],Cr.prototype,"eLabel",2),g([Ss("eText")],Cr.prototype,"eText",2),g([Ss("eSortOrder")],Cr.prototype,"eSortOrder",2),g([Ss("eSortAsc")],Cr.prototype,"eSortAsc",2),g([Ss("eSortDesc")],Cr.prototype,"eSortDesc",2),g([Ss("eSortMixed")],Cr.prototype,"eSortMixed",2),g([Ss("eSortNone")],Cr.prototype,"eSortNone",2);var wr=Cr,Sr=class e extends Cs{constructor(){super(e.TEMPLATE)}destroy(){super.destroy()}init(e){this.params=e,this.checkWarnings(),this.setupLabel(),this.addGroupExpandIcon(),this.setupExpandIcons()}checkWarnings(){this.params.template&&z("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=e=>{if(Xe(e))return;const t=!this.params.columnGroup.isExpanded();this.columnModel.setColumnGroupOpened(this.params.columnGroup.getProvidedColumnGroup(),t,"uiColumnExpanded")};this.addTouchAndClickListeners(this.eCloseIcon,e),this.addTouchAndClickListeners(this.eOpenIcon,e);const t=e=>{qe(e)};this.addManagedListener(this.eCloseIcon,"dblclick",t),this.addManagedListener(this.eOpenIcon,"dblclick",t),this.addManagedListener(this.getGui(),"dblclick",e),this.updateIconVisibility();const i=this.params.columnGroup.getProvidedColumnGroup();this.addManagedListener(i,Ee.EVENT_EXPANDED_CHANGED,this.updateIconVisibility.bind(this)),this.addManagedListener(i,Ee.EVENT_EXPANDABLE_CHANGED,this.updateIconVisibility.bind(this))}addTouchAndClickListeners(e,t){const i=new yr(e,!0);this.addManagedListener(i,yr.EVENT_TAP,t),this.addDestroyFunc(()=>i.destroy()),this.addManagedListener(e,"click",t)}updateIconVisibility(){if(this.params.columnGroup.isExpandable()){const e=this.params.columnGroup.isExpanded();an(this.eOpenIcon,e),an(this.eCloseIcon,!e)}else an(this.eOpenIcon,!1),an(this.eCloseIcon,!1)}addInIcon(e,t){const i=qn(e,this.gos,null);i&&this.getRefElement(t).appendChild(i)}addGroupExpandIcon(){if(!this.params.columnGroup.isExpandable())return an(this.eOpenIcon,!1),void an(this.eCloseIcon,!1)}setupLabel(){var e;const{displayName:t,columnGroup:i}=this.params;if(b(t)){const e=bt(t,!0);this.getRefElement("agLabel").textContent=e}this.addOrRemoveCssClass("ag-sticky-label",!(null==(e=i.getColGroupDef())?void 0:e.suppressStickyLabel))}};Sr.TEMPLATE='<div class="ag-header-group-cell-label" ref="agContainer" role="presentation">\n            <span ref="agLabel" class="ag-header-group-text" role="presentation"></span>\n            <span ref="agOpened" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-expanded"></span>\n            <span ref="agClosed" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-collapsed"></span>\n        </div>',g([ue("columnModel")],Sr.prototype,"columnModel",2),g([Ss("agOpened")],Sr.prototype,"eOpenIcon",2),g([Ss("agClosed")],Sr.prototype,"eCloseIcon",2);var xr=Sr,Er=class extends Cs{isPopup(){return!0}setParentComponent(e){e.addCssClass("ag-has-popup"),super.setParentComponent(e)}destroy(){const e=this.parentComponent;e&&e.isAlive()&&e.getGui().classList.remove("ag-has-popup"),super.destroy()}},Ar=class e extends Er{constructor(){super(e.TEMPLATE)}init(e){this.params=e,this.focusAfterAttached=e.cellStartedEdit,this.eTextArea.setMaxLength(e.maxLength||200).setCols(e.cols||60).setRows(e.rows||10),b(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===Zn.LEFT||t===Zn.UP||t===Zn.RIGHT||t===Zn.DOWN||e.shiftKey&&t===Zn.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 b(e)||b(this.params.value)?this.params.parseValue(e):this.params.value}};Ar.TEMPLATE='<div class="ag-large-text">\n            <ag-input-text-area ref="eTextArea" class="ag-large-text-input"></ag-input-text-area>\n        </div>',g([Ss("eTextArea")],Ar.prototype,"eTextArea",2);var Mr=Ar,Tr=class extends Er{constructor(){super('<div class="ag-cell-edit-wrapper">\n                <ag-select class="ag-cell-editor" ref="eSelect"></ag-select>\n            </div>'),this.startedByEnter=!1}init(e){this.focusAfterAttached=e.cellStartedEdit;const{eSelect:t,valueService:i,gos:n}=this,{values:s,value:r,eventKey:o}=e;if(C(s))return void console.warn("AG Grid: no values found for select cellEditor");this.startedByEnter=null!=o&&o===Zn.ENTER;let a=!1;s.forEach(n=>{const s={value:n},o=i.formatValue(e.column,null,n),l=null!=o;s.text=l?o:n,t.addOption(s),a=a||r===n}),a?t.setValue(e.value,!0):e.values.length&&t.setValue(e.values[0],!0);const{valueListGap:l,valueListMaxWidth:c,valueListMaxHeight:h}=e;null!=l&&t.setPickerGap(l),null!=h&&t.setPickerMaxHeight(h),null!=c&&t.setPickerMaxWidth(c),"fullRow"!==n.get("editType")&&this.addManagedListener(this.eSelect,Hs.EVENT_ITEM_SELECTED,()=>e.stopEditing())}afterGuiAttached(){this.focusAfterAttached&&this.eSelect.getFocusableElement().focus(),this.startedByEnter&&setTimeout(()=>{this.isAlive()&&this.eSelect.showPicker()})}focusIn(){this.eSelect.getFocusableElement().focus()}getValue(){return this.eSelect.getValue()}isPopup(){return!1}};g([ue("valueService")],Tr.prototype,"valueService",2),g([Ss("eSelect")],Tr.prototype,"eSelect",2);var Dr=class extends Er{constructor(e){super(`\n            <div class="ag-cell-edit-wrapper">\n                ${e.getTemplate()}\n            </div>`),this.cellEditorInput=e}init(e){this.params=e;const t=this.eInput;let i;if(this.cellEditorInput.init(t,e),e.cellStartedEdit){this.focusAfterAttached=!0;const t=e.eventKey;t===Zn.BACKSPACE||e.eventKey===Zn.DELETE?i="":t&&1===t.length?i=t:(i=this.cellEditorInput.getStartValue(),t!==Zn.F2&&(this.highlightAllOnFocus=!0))}else this.focusAfterAttached=!1,i=this.cellEditorInput.getStartValue();null!=i&&t.setStartValue(i),this.addManagedListener(t.getGui(),"keydown",e=>{const{key:t}=e;t!==Zn.PAGE_UP&&t!==Zn.PAGE_DOWN||e.preventDefault()})}afterGuiAttached(){var e,t;const i=this.localeService.getLocaleTextFunc(),n=this.eInput;if(n.setInputAriaLabel(i("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;Ti()||n.getFocusableElement().focus();const s=n.getInputElement();this.highlightAllOnFocus?s.select():null==(t=(e=this.cellEditorInput).setCaret)||t.call(e)}focusIn(){const e=this.eInput,t=e.getFocusableElement(),i=e.getInputElement();t.focus(),i.select()}getValue(){return this.cellEditorInput.getValue()}isPopup(){return!1}};g([Ss("eInput")],Dr.prototype,"eInput",2);var Ir=class{getTemplate(){return'<ag-input-text-field class="ag-cell-editor" ref="eInput"></ag-input-text-field>'}init(e,t){this.eInput=e,this.params=t,null!=t.maxLength&&e.setMaxLength(t.maxLength)}getValue(){const e=this.eInput.getValue();return b(e)||b(this.params.value)?this.params.parseValue(e):this.params.value}getStartValue(){return this.params.useFormatter||this.params.column.getColDef().refData?this.params.formatValue(this.params.value):this.params.value}setCaret(){const e=this.eInput.getValue(),t=b(e)&&e.length||0;t&&this.eInput.getInputElement().setSelectionRange(t,t)}},Rr=class extends Dr{constructor(){super(new Ir)}},kr=class extends Cs{constructor(){super(),this.refreshCount=0;const e=document.createElement("span"),t=document.createElement("span");t.setAttribute("class","ag-value-change-delta");const i=document.createElement("span");i.setAttribute("class","ag-value-change-value"),e.appendChild(t),e.appendChild(i),this.setTemplateFromElement(e)}init(e){this.eValue=this.queryForHtmlElement(".ag-value-change-value"),this.eDelta=this.queryForHtmlElement(".ag-value-change-delta"),this.refresh(e,!0)}showDelta(e,t){const i=Math.abs(t),n=e.formatValue(i),s=b(n)?n:i,r=t>=0;this.eDelta.textContent=r?"↑"+s:"↓"+s,this.eDelta.classList.toggle("ag-value-change-delta-up",r),this.eDelta.classList.toggle("ag-value-change-delta-down",!r)}setTimerToRemoveDelta(){this.refreshCount++;const e=this.refreshCount;this.getFrameworkOverrides().wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.hideDeltaValue()},2e3)})}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),Cn(this.eDelta)}refresh(e,t=!1){const i=e.value;if(i===this.lastValue)return!1;if(b(e.valueFormatted)?this.eValue.textContent=e.valueFormatted:b(e.value)?this.eValue.textContent=i:Cn(this.eValue),this.filterManager.isSuppressFlashingCellsBecauseFiltering())return!1;if("number"==typeof i&&"number"==typeof this.lastValue){const t=i-this.lastValue;this.showDelta(e,t)}return this.lastValue&&this.eValue.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=i,!0}};g([ue("filterManager")],kr.prototype,"filterManager",2);var Pr=class extends Cs{constructor(){super(),this.refreshCount=0;const e=document.createElement("span"),t=document.createElement("span");t.setAttribute("class","ag-value-slide-current"),e.appendChild(t),this.setTemplateFromElement(e),this.eCurrent=this.queryForHtmlElement(".ag-value-slide-current")}init(e){this.refresh(e,!0)}addSlideAnimation(){this.refreshCount++;const e=this.refreshCount;this.ePrevious&&this.getGui().removeChild(this.ePrevious);const t=document.createElement("span");t.setAttribute("class","ag-value-slide-previous ag-value-slide-out"),this.ePrevious=t,this.ePrevious.textContent=this.eCurrent.textContent,this.getGui().insertBefore(this.ePrevious,this.eCurrent),this.getFrameworkOverrides().wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{e===this.refreshCount&&(this.getGui().removeChild(this.ePrevious),this.ePrevious=null)},3e3)})}refresh(e,t=!1){let i=e.value;return C(i)&&(i=""),i!==this.lastValue&&!this.filterManager.isSuppressFlashingCellsBecauseFiltering()&&(t||this.addSlideAnimation(),this.lastValue=i,b(e.valueFormatted)?this.eCurrent.textContent=e.valueFormatted:b(e.value)?this.eCurrent.textContent=i:Cn(this.eCurrent),!0)}};g([ue("filterManager")],Pr.prototype,"filterManager",2);var _r=class e{constructor(t){this.rowIndex=null,this.key=null,this.childrenMapped={},this.displayed=!1,this.rowTop=null,this.oldRowTop=null,this.selectable=!0,this.__objectId=e.OBJECT_ID_SEQUENCE++,this.__autoHeights={},this.alreadyRendered=!1,this.highlighted=null,this.hovered=!1,this.selected=!1,this.beans=t}setData(e){this.setDataCommon(e,!1)}updateData(e){this.setDataCommon(e,!0)}setDataCommon(e,t){const i=this.data;this.data=e,this.beans.valueCache.onDataChanged(),this.updateDataOnDetailNode(),this.checkRowSelectable(),this.resetQuickFilterAggregateText();const n=this.createDataChangedEvent(e,i,t);this.dispatchLocalEvent(n)}updateDataOnDetailNode(){this.detailNode&&(this.detailNode.data=this.data)}createDataChangedEvent(t,i,n){return{type:e.EVENT_DATA_CHANGED,node:this,oldData:i,newData:t,update:n}}createLocalRowEvent(e){return{type:e,node:this}}getRowIndexString(){return"top"===this.rowPinned?"t-"+this.rowIndex:"bottom"===this.rowPinned?"b-"+this.rowIndex:this.rowIndex.toString()}createDaemonNode(){const t=new e(this.beans);return t.id=this.id,t.data=this.data,t.__daemon=!0,t.selected=this.selected,t.level=this.level,t}setDataAndId(e,t){const i=b(this.id)?this.createDaemonNode():null,n=this.data;this.data=e,this.updateDataOnDetailNode(),this.setId(t),this.checkRowSelectable(),this.beans.selectionService.syncInRowNode(this,i);const s=this.createDataChangedEvent(e,n,!1);this.dispatchLocalEvent(s)}checkRowSelectable(){const e=this.beans.gos.get("isRowSelectable");this.setRowSelectable(!e||e(this))}setRowSelectable(t,i){if(this.selectable!==t){if(this.selectable=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_SELECTABLE_CHANGED)),i)return;if(this.beans.gos.get("groupSelectsChildren")){const e=this.calculateSelectedFromChildren();return void this.setSelectedParams({newValue:null!=e&&e,source:"selectableChanged"})}this.isSelected()&&!this.selectable&&this.setSelectedParams({newValue:!1,source:"selectableChanged"})}}setId(t){const i=this.beans.gos.getCallback("getRowId");if(i)if(this.data){const t=this.getGroupKeys(!0);this.id=i({data:this.data,parentKeys:t.length>0?t:void 0,level:this.level}),null!==this.id&&"string"==typeof this.id&&this.id.startsWith(e.ID_PREFIX_ROW_GROUP)&&console.error(`AG Grid: Row IDs cannot start with ${e.ID_PREFIX_ROW_GROUP}, this is a reserved prefix for AG Grid's row grouping feature.`),null!==this.id&&"string"!=typeof this.id&&(this.id=""+this.id)}else this.id=void 0;else this.id=t}getGroupKeys(e=!1){const t=[];let i=this;for(e&&(i=i.parent);i&&i.level>=0;)t.push(i.key),i=i.parent;return t.reverse(),t}isPixelInRange(e){return!(!b(this.rowTop)||!b(this.rowHeight))&&e>=this.rowTop&&e<this.rowTop+this.rowHeight}setFirstChild(t){this.firstChild!==t&&(this.firstChild=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_FIRST_CHILD_CHANGED)))}setLastChild(t){this.lastChild!==t&&(this.lastChild=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_LAST_CHILD_CHANGED)))}setChildIndex(t){this.childIndex!==t&&(this.childIndex=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_CHILD_INDEX_CHANGED)))}setRowTop(t){this.oldRowTop=this.rowTop,this.rowTop!==t&&(this.rowTop=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_TOP_CHANGED)),this.setDisplayed(null!==t))}clearRowTopAndRowIndex(){this.oldRowTop=null,this.setRowTop(null),this.setRowIndex(null)}setDisplayed(t){this.displayed!==t&&(this.displayed=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_DISPLAYED_CHANGED)))}setDragging(t){this.dragging!==t&&(this.dragging=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_DRAGGING_CHANGED)))}setHighlighted(t){t!==this.highlighted&&(this.highlighted=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_HIGHLIGHT_CHANGED)))}setHovered(e){this.hovered!==e&&(this.hovered=e)}isHovered(){return this.hovered}setAllChildrenCount(t){this.allChildrenCount!==t&&(this.allChildrenCount=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_ALL_CHILDREN_COUNT_CHANGED)))}setMaster(t){this.master!==t&&(this.master&&!t&&(this.expanded=!1),this.master=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_MASTER_CHANGED)))}setGroup(t){this.group!==t&&(this.group&&!t&&(this.expanded=!1),this.group=t,this.updateHasChildren(),this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_GROUP_CHANGED)))}setRowHeight(t,i=!1){this.rowHeight=t,this.rowHeightEstimated=i,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_HEIGHT_CHANGED))}setRowAutoHeight(e,t){this.__autoHeights||(this.__autoHeights={}),this.__autoHeights[t.getId()]=e,null!=e&&(null==this.checkAutoHeightsDebounced&&(this.checkAutoHeightsDebounced=Q(this.checkAutoHeights.bind(this),1)),this.checkAutoHeightsDebounced())}checkAutoHeights(){let e=!1,t=!0,i=0;const n=this.__autoHeights;if(null==n)return;if(this.beans.columnModel.getAllDisplayedAutoHeightCols().forEach(s=>{let r=n[s.getId()];if(null==r){if(!this.beans.columnModel.isColSpanActive())return void(e=!0);{let t=[];switch(s.getPinned()){case"left":t=this.beans.columnModel.getDisplayedLeftColumnsForRow(this);break;case"right":t=this.beans.columnModel.getDisplayedRightColumnsForRow(this);break;case null:t=this.beans.columnModel.getViewportCenterColumnsForRow(this)}if(t.includes(s))return void(e=!0);r=-1}}else t=!1;r>i&&(i=r)}),e)return;if((t||i<10)&&(i=this.beans.gos.getRowHeightForNode(this).height),i==this.rowHeight)return;this.setRowHeight(i);const s=this.beans.rowModel;s.onRowHeightChangedDebounced&&s.onRowHeightChangedDebounced()}setRowIndex(t){this.rowIndex!==t&&(this.rowIndex=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_ROW_INDEX_CHANGED)))}setUiLevel(t){this.uiLevel!==t&&(this.uiLevel=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_UI_LEVEL_CHANGED)))}setExpanded(t,i,n){if(this.expanded===t)return;this.expanded=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_EXPANDED_CHANGED));const s=Object.assign({},this.createGlobalRowEvent(ct.EVENT_ROW_GROUP_OPENED),{expanded:t,event:i||null});this.beans.rowNodeEventThrottle.dispatchExpanded(s,n),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,i){const n=(()=>{var t;return"string"!=typeof e?e:null!=(t=this.beans.columnModel.getGridColumn(e))?t:this.beans.columnModel.getPrimaryColumn(e)})(),s=this.getValueFromValueService(n);if(this.beans.gos.get("readOnlyEdit"))return this.dispatchEventForSaveValueReadOnly(n,s,t,i),!1;const r=this.beans.valueService.setValue(this,n,t,i);return this.dispatchCellChangedEvent(n,t,s),this.checkRowSelectable(),r}getValueFromValueService(e){var t,i;const n=this.leafGroup&&this.beans.columnModel.isPivotMode(),s=this.group&&this.expanded&&!this.footer&&!n;let r=!1;const o=null!=(t=this.beans.gos.get("groupTotalRow"))?t:this.beans.gos.get("groupIncludeFooter");r="function"!=typeof o?!!o:!!(null!=(i=this.beans.gos.getCallback("groupTotalRow"))?i:this.beans.gos.getCallback("groupIncludeFooter"))({node:this});const a=this.beans.gos.get("groupSuppressBlankHeader"),l=s&&r&&!a;return this.beans.valueService.getValue(e,this,!1,l)}dispatchEventForSaveValueReadOnly(e,t,i,n){const s=this.beans.gos.addGridCommonParams({type:ct.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:i,value:i,source:n});this.beans.eventService.dispatchEvent(s)}setGroupValue(e,t){const i=this.beans.columnModel.getGridColumn(e);C(this.groupData)&&(this.groupData={});const n=i.getColId(),s=this.groupData[n];s!==t&&(this.groupData[n]=t,this.dispatchCellChangedEvent(i,t,s))}setAggData(e){const t=this.aggData;if(this.aggData=e,this.eventService){const i=e=>{const i=this.aggData?this.aggData[e]:void 0,n=t?t[e]:void 0;if(i===n)return;const s=this.beans.columnModel.lookupGridColumn(e);s&&this.dispatchCellChangedEvent(s,i,n)};for(const e in this.aggData)i(e);for(const t in e)t in this.aggData||i(t)}}updateHasChildren(){let t=this.group&&!this.footer||this.childrenAfterGroup&&this.childrenAfterGroup.length>0;if(this.beans.gos.isRowModelType("serverSide")){const e=this.beans.gos.get("treeData"),i=this.beans.gos.get("isServerSideGroup");t=!this.stub&&!this.footer&&(e?!!i&&i(this.data):!!this.group)}t!==this.__hasChildren&&(this.__hasChildren=!!t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_HAS_CHILDREN_CHANGED)))}hasChildren(){return null==this.__hasChildren&&this.updateHasChildren(),this.__hasChildren}isEmptyRowGroupNode(){return this.group&&w(this.childrenAfterGroup)}dispatchCellChangedEvent(t,i,n){const s={type:e.EVENT_CELL_CHANGED,node:this,column:t,newValue:i,oldValue:n};this.dispatchLocalEvent(s)}resetQuickFilterAggregateText(){this.quickFilterAggregateText=null}isExpandable(){return!this.footer&&(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,i=!1,n=!1;if(!(null==(e=this.childrenAfterGroup)?void 0:e.length))return this.selectable?this.selected:null;for(let e=0;e<this.childrenAfterGroup.length;e++){const s=this.childrenAfterGroup[e];let r=s.isSelected();if(!s.selectable){const e=s.calculateSelectedFromChildren();if(null===e)continue;r=e}switch(r){case!0:t=!0;break;case!1:i=!0;break;default:n=!0}}return n||t&&i?void 0:!!t||!i&&(this.selectable?this.selected:null)}setSelectedInitialValue(e){this.selected=e}selectThisNode(t,i,n="api"){const s=!this.selectable&&t,r=this.selected===t;if(s||r)return!1;this.selected=t,this.eventService&&this.dispatchLocalEvent(this.createLocalRowEvent(e.EVENT_ROW_SELECTED));const o=this.sibling;o&&o.footer&&o.eventService&&o.dispatchLocalEvent(o.createLocalRowEvent(e.EVENT_ROW_SELECTED));const a=d(u({},this.createGlobalRowEvent(ct.EVENT_ROW_SELECTED)),{event:i||null,source:n});return this.beans.eventService.dispatchEvent(a),!0}setSelected(e,t=!1,i="api"){"boolean"!=typeof i?this.setSelectedParams({newValue:e,clearSelection:t,rangeSelect:!1,source:i}):console.warn("AG Grid: since version v30, rowNode.setSelected() property `suppressFinishActions` has been removed, please use `gridApi.setNodesSelected()` for bulk actions, and the event `source` property for ignoring events instead.")}setSelectedParams(e){return this.rowPinned?(console.warn("AG Grid: cannot select pinned rows"),0):void 0===this.id?(console.warn("AG Grid: cannot select node until id for node is known"),0):this.beans.selectionService.setNodesSelected(d(u({},e),{nodes:[this.footer?this.sibling:this]}))}isRowPinned(){return"top"===this.rowPinned||"bottom"===this.rowPinned}isParentOfNode(e){let t=this.parent;for(;t;){if(t===e)return!0;t=t.parent}return!1}addEventListener(e,t){var i,n;this.eventService||(this.eventService=new me),this.beans.frameworkOverrides.shouldWrapOutgoing&&!this.frameworkEventListenerService&&(this.eventService.setFrameworkOverrides(this.beans.frameworkOverrides),this.frameworkEventListenerService=new ye(this.beans.frameworkOverrides));const s=null!=(n=null==(i=this.frameworkEventListenerService)?void 0:i.wrap(t))?n:t;this.eventService.addEventListener(e,s)}removeEventListener(e,t){var i,n;if(!this.eventService)return;const s=null!=(n=null==(i=this.frameworkEventListenerService)?void 0:i.unwrap(t))?n:t;this.eventService.removeEventListener(e,s),this.eventService.noRegisteredListenersExist()&&(this.eventService=null)}onMouseEnter(){this.dispatchLocalEvent(this.createLocalRowEvent(e.EVENT_MOUSE_ENTER))}onMouseLeave(){this.dispatchLocalEvent(this.createLocalRowEvent(e.EVENT_MOUSE_LEAVE))}getFirstChildOfFirstChild(e){let t=this,i=!0,n=!1,s=null;for(;i&&!n;){const r=t.parent;b(r)&&t.firstChild?r.rowGroupColumn===e&&(n=!0,s=r):i=!1,t=r}return n?s:null}isFullWidthCell(){if(this.detail)return!0;const e=this.beans.gos.getCallback("isFullWidthRow");return!!e&&e({rowNode:this})}getRoute(){if(null==this.key)return;const e=[];let t=this;for(;null!=t.key;)e.push(t.key),t=t.parent;return e.reverse()}createFooter(){if(this.sibling)return;const t=new Set(["eventService","__objectId","sticky"]),i=new e(this.beans);Object.keys(this).forEach(e=>{t.has(e)||(i[e]=this[e])}),i.footer=!0,i.setRowTop(null),i.setRowIndex(null),i.oldRowTop=null,i.id="rowGroupFooter_"+this.id,i.sibling=this,this.sibling=i}destroyFooter(){this.sibling&&(this.sibling.setRowTop(null),this.sibling.setRowIndex(null),this.sibling=void 0)}};_r.ID_PREFIX_ROW_GROUP="row-group-",_r.ID_PREFIX_TOP_PINNED="t-",_r.ID_PREFIX_BOTTOM_PINNED="b-",_r.OBJECT_ID_SEQUENCE=0,_r.EVENT_ROW_SELECTED="rowSelected",_r.EVENT_DATA_CHANGED="dataChanged",_r.EVENT_CELL_CHANGED="cellChanged",_r.EVENT_ALL_CHILDREN_COUNT_CHANGED="allChildrenCountChanged",_r.EVENT_MASTER_CHANGED="masterChanged",_r.EVENT_GROUP_CHANGED="groupChanged",_r.EVENT_MOUSE_ENTER="mouseEnter",_r.EVENT_MOUSE_LEAVE="mouseLeave",_r.EVENT_HEIGHT_CHANGED="heightChanged",_r.EVENT_TOP_CHANGED="topChanged",_r.EVENT_DISPLAYED_CHANGED="displayedChanged",_r.EVENT_FIRST_CHILD_CHANGED="firstChildChanged",_r.EVENT_LAST_CHILD_CHANGED="lastChildChanged",_r.EVENT_CHILD_INDEX_CHANGED="childIndexChanged",_r.EVENT_ROW_INDEX_CHANGED="rowIndexChanged",_r.EVENT_EXPANDED_CHANGED="expandedChanged",_r.EVENT_HAS_CHILDREN_CHANGED="hasChildrenChanged",_r.EVENT_SELECTABLE_CHANGED="selectableChanged",_r.EVENT_UI_LEVEL_CHANGED="uiLevelChanged",_r.EVENT_HIGHLIGHT_CHANGED="rowHighlightChanged",_r.EVENT_DRAGGING_CHANGED="draggingChanged";var Lr=_r,Nr=class extends Cs{constructor(){super('\n            <div class="ag-selection-checkbox" role="presentation">\n                <ag-checkbox role="presentation" ref="eCheckbox"></ag-checkbox>\n            </div>')}postConstruct(){this.eCheckbox.setPassive(!0)}getCheckboxId(){return this.eCheckbox.getInputElement().id}onDataChanged(){this.onSelectionChanged()}onSelectableChanged(){this.showOrHideSelect()}onSelectionChanged(){const e=this.localeService.getLocaleTextFunc(),t=this.rowNode.isSelected(),i=yi(e,t),[n,s]=this.rowNode.selectable?["ariaRowToggleSelection","Press Space to toggle row selection"]:["ariaRowSelectionDisabled","Row Selection is disabled for this row"],r=e(n,s);this.eCheckbox.setValue(t,!0),this.eCheckbox.setInputAriaLabel(`${r} (${i})`)}onClicked(e,t,i){return this.rowNode.setSelectedParams({newValue:e,rangeSelect:i.shiftKey,groupSelectsFiltered:t,event:i,source:"checkboxSelected"})}init(e){if(this.rowNode=e.rowNode,this.column=e.column,this.overrides=e.overrides,this.onSelectionChanged(),this.addManagedListener(this.eCheckbox.getInputElement(),"dblclick",e=>{qe(e)}),this.addManagedListener(this.eCheckbox.getInputElement(),"click",e=>{qe(e);const t=this.gos.get("groupSelectsFiltered"),i=this.eCheckbox.getValue();this.shouldHandleIndeterminateState(i,t)?0===this.onClicked(!0,t,e||{})&&this.onClicked(!1,t,e):i?this.onClicked(!1,t,e):this.onClicked(!0,t,e||{})}),this.addManagedListener(this.rowNode,Lr.EVENT_ROW_SELECTED,this.onSelectionChanged.bind(this)),this.addManagedListener(this.rowNode,Lr.EVENT_DATA_CHANGED,this.onDataChanged.bind(this)),this.addManagedListener(this.rowNode,Lr.EVENT_SELECTABLE_CHANGED,this.onSelectableChanged.bind(this)),this.gos.get("isRowSelectable")||"function"==typeof this.getIsVisible()){const e=this.showOrHideSelect.bind(this);this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.rowNode,Lr.EVENT_DATA_CHANGED,e),this.addManagedListener(this.rowNode,Lr.EVENT_CELL_CHANGED,e),this.showOrHideSelect()}this.eCheckbox.getInputElement().setAttribute("tabindex","-1")}shouldHandleIndeterminateState(e,t){return t&&(void 0===this.eCheckbox.getPreviousValue()||void 0===e)&&this.gos.isRowModelType("clientSide")}showOrHideSelect(){var e,t,i;let n=this.rowNode.selectable;const s=this.getIsVisible();if(n)if("function"==typeof s){const t=null==(e=this.overrides)?void 0:e.callbackParams;if(this.column){const e=this.column.createColumnFunctionCallbackParams(this.rowNode);n=s(u(u({},t),e))}else n=s(d(u({},t),{node:this.rowNode,data:this.rowNode.data}))}else n=null!=s&&s;if(null==(t=this.column)?void 0:t.getColDef().showDisabledCheckboxes)return this.eCheckbox.setDisabled(!n),this.setVisible(!0),void this.setDisplayed(!0);(null==(i=this.overrides)?void 0:i.removeHidden)?this.setDisplayed(n):this.setVisible(n)}getIsVisible(){var e,t;return this.overrides?this.overrides.isVisible:null==(t=null==(e=this.column)?void 0:e.getColDef())?void 0:t.checkboxSelection}};g([Ss("eCheckbox")],Nr.prototype,"eCheckbox",2),g([le],Nr.prototype,"postConstruct",1);var Or=(e=>(e[e.Up=0]="Up",e[e.Down=1]="Down",e))(Or||{}),Fr=(e=>(e[e.Left=0]="Left",e[e.Right=1]="Right",e))(Fr||{}),Gr=(e=>(e[e.ToolPanel=0]="ToolPanel",e[e.HeaderCell=1]="HeaderCell",e[e.RowDrag=2]="RowDrag",e[e.ChartPanel=3]="ChartPanel",e[e.AdvancedFilterBuilder=4]="AdvancedFilterBuilder",e))(Gr||{}),Br=class extends st{constructor(){super(...arguments),this.dragSourceAndParamsList=[],this.dropTargets=[]}init(){this.ePinnedIcon=Yn("columnMovePin",this.gos,null),this.eHideIcon=Yn("columnMoveHide",this.gos,null),this.eMoveIcon=Yn("columnMoveMove",this.gos,null),this.eLeftIcon=Yn("columnMoveLeft",this.gos,null),this.eRightIcon=Yn("columnMoveRight",this.gos,null),this.eGroupIcon=Yn("columnMoveGroup",this.gos,null),this.eAggregateIcon=Yn("columnMoveValue",this.gos,null),this.ePivotIcon=Yn("columnMovePivot",this.gos,null),this.eDropNotAllowedIcon=Yn("dropNotAllowed",this.gos,null)}addDragSource(e,t=!1){const i={eElement:e.eElement,dragStartPixels:e.dragStartPixels,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this),onDragging:this.onDragging.bind(this),includeTouch:t};this.dragSourceAndParamsList.push({params:i,dragSource:e}),this.dragService.addDragSource(i)}removeDragSource(e){const t=this.dragSourceAndParamsList.find(t=>t.dragSource===e);t&&(this.dragService.removeDragSource(t.params),Ne(this.dragSourceAndParamsList,t))}clearDragSourceParamsList(){this.dragSourceAndParamsList.forEach(e=>this.dragService.removeDragSource(e.params)),this.dragSourceAndParamsList.length=0,this.dropTargets.length=0}nudge(){this.dragging&&this.onDragging(this.eventLastTime,!0)}onDragStart(e,t){this.dragging=!0,this.dragSource=e,this.eventLastTime=t,this.dragItem=this.dragSource.getDragItem(),this.lastDropTarget=void 0,this.dragSource.onDragStarted&&this.dragSource.onDragStarted(),this.createGhost()}onDragStop(e){if(this.eventLastTime=null,this.dragging=!1,this.dragSource.onDragStopped&&this.dragSource.onDragStopped(),this.lastDropTarget&&this.lastDropTarget.onDragStop){const t=this.createDropTargetEvent(this.lastDropTarget,e,null,null,!1);this.lastDropTarget.onDragStop(t)}this.lastDropTarget=null,this.dragItem=null,this.removeGhost()}onDragging(e,t){var i,n,s,r;const o=this.getHorizontalDirection(e),a=this.getVerticalDirection(e);this.eventLastTime=e,this.positionGhost(e);const l=this.dropTargets.filter(t=>this.isMouseOnDropTarget(e,t)),c=this.findCurrentDropTarget(e,l);if(c!==this.lastDropTarget)this.leaveLastTargetIfExists(e,o,a,t),null!==this.lastDropTarget&&null===c&&(null==(n=(i=this.dragSource).onGridExit)||n.call(i,this.dragItem)),null===this.lastDropTarget&&null!==c&&(null==(r=(s=this.dragSource).onGridEnter)||r.call(s,this.dragItem)),this.enterDragTargetIfExists(c,e,o,a,t),this.lastDropTarget=c;else if(c&&c.onDragging){const i=this.createDropTargetEvent(c,e,o,a,t);c.onDragging(i)}}getAllContainersFromDropTarget(e){const t=e.getSecondaryContainers?e.getSecondaryContainers():null,i=[[e.getContainer()]];return t?i.concat(t):i}allContainersIntersect(e,t){for(const i of t){const t=i.getBoundingClientRect();if(0===t.width||0===t.height)return!1;const n=e.clientX>=t.left&&e.clientX<t.right,s=e.clientY>=t.top&&e.clientY<t.bottom;if(!n||!s)return!1}return!0}isMouseOnDropTarget(e,t){const i=this.getAllContainersFromDropTarget(t);let n=!1;for(const t of i)if(this.allContainersIntersect(e,t)){n=!0;break}return!(t.targetContainsSource&&!t.getContainer().contains(this.dragSource.eElement))&&n&&t.isInterestedIn(this.dragSource.type,this.dragSource.eElement)}findCurrentDropTarget(e,t){const i=t.length;if(0===i)return null;if(1===i)return t[0];const n=this.gos.getRootNode().elementsFromPoint(e.clientX,e.clientY);for(const e of n)for(const i of t)if(-1!==Ue(this.getAllContainersFromDropTarget(i)).indexOf(e))return i;return null}enterDragTargetIfExists(e,t,i,n,s){if(e){if(e.onDragEnter){const r=this.createDropTargetEvent(e,t,i,n,s);e.onDragEnter(r)}this.setGhostIcon(e.getIconName?e.getIconName():null)}}leaveLastTargetIfExists(e,t,i,n){if(this.lastDropTarget){if(this.lastDropTarget.onDragLeave){const s=this.createDropTargetEvent(this.lastDropTarget,e,t,i,n);this.lastDropTarget.onDragLeave(s)}this.setGhostIcon(null)}}addDropTarget(e){this.dropTargets.push(e)}removeDropTarget(e){this.dropTargets=this.dropTargets.filter(t=>t.getContainer()!==e.getContainer())}hasExternalDropZones(){return this.dropTargets.some(e=>e.external)}findExternalZone(e){return this.dropTargets.filter(e=>e.external).find(t=>t.getContainer()===e.getContainer())||null}getHorizontalDirection(e){const t=this.eventLastTime&&this.eventLastTime.clientX,i=e.clientX;return t===i?null:t>i?0:1}getVerticalDirection(e){const t=this.eventLastTime&&this.eventLastTime.clientY,i=e.clientY;return t===i?null:t>i?0:1}createDropTargetEvent(e,t,i,n,s){const r=e.getContainer(),o=r.getBoundingClientRect(),{gridApi:a,columnApi:l,dragItem:c,dragSource:h}=this;return{event:t,x:t.clientX-o.left,y:t.clientY-o.top,vDirection:n,hDirection:i,dragSource:h,fromNudge:s,dragItem:c,api:a,columnApi:l,dropZoneTarget:r}}positionGhost(e){const t=this.eGhost;if(!t)return;const i=t.getBoundingClientRect().height,n=Oi()-2,s=Fi()-2,r=mn(t.offsetParent),{clientY:o,clientX:a}=e;let l=o-r.top-i/2,c=a-r.left-10;const h=this.gos.getDocument(),u=h.defaultView||window,d=u.pageYOffset||h.documentElement.scrollTop,p=u.pageXOffset||h.documentElement.scrollLeft;n>0&&c+t.clientWidth>n+p&&(c=n+p-t.clientWidth),c<0&&(c=0),s>0&&l+t.clientHeight>s+d&&(l=s+d-t.clientHeight),l<0&&(l=0),t.style.left=`${c}px`,t.style.top=`${l}px`}removeGhost(){this.eGhost&&this.eGhostParent&&this.eGhostParent.removeChild(this.eGhost),this.eGhost=null}createGhost(){this.eGhost=En(Br.GHOST_TEMPLATE),this.mouseEventService.stampTopLevelGridCompWithGridInstance(this.eGhost);const{theme:e}=this.environment.getTheme();e&&this.eGhost.classList.add(e),this.eGhostIcon=this.eGhost.querySelector(".ag-dnd-ghost-icon"),this.setGhostIcon(null);const t=this.eGhost.querySelector(".ag-dnd-ghost-label");let i=this.dragSource.dragItemName;$(i)&&(i=i()),t.innerHTML=bt(i)||"",this.eGhost.style.height="25px",this.eGhost.style.top="20px",this.eGhost.style.left="20px";const n=this.gos.getDocument();let s=null,r=null;try{s=n.fullscreenElement}catch(e){}finally{s||(s=this.gos.getRootNode());r=s.querySelector("body")||(s instanceof ShadowRoot?s:s instanceof Document?null==s?void 0:s.documentElement:s)}this.eGhostParent=r,this.eGhostParent?this.eGhostParent.appendChild(this.eGhost):console.warn("AG Grid: could not find document body, it is needed for dragging columns")}setGhostIcon(e,t=!1){Cn(this.eGhostIcon);let i=null;switch(e||(e=this.dragSource.getDefaultIconName?this.dragSource.getDefaultIconName():Br.ICON_NOT_ALLOWED),e){case Br.ICON_PINNED:i=this.ePinnedIcon;break;case Br.ICON_MOVE:i=this.eMoveIcon;break;case Br.ICON_LEFT:i=this.eLeftIcon;break;case Br.ICON_RIGHT:i=this.eRightIcon;break;case Br.ICON_GROUP:i=this.eGroupIcon;break;case Br.ICON_AGGREGATE:i=this.eAggregateIcon;break;case Br.ICON_PIVOT:i=this.ePivotIcon;break;case Br.ICON_NOT_ALLOWED:i=this.eDropNotAllowedIcon;break;case Br.ICON_HIDE:i=this.eHideIcon}this.eGhostIcon.classList.toggle("ag-shake-left-to-right",t),i===this.eHideIcon&&this.gos.get("suppressDragLeaveHidesColumns")||i&&this.eGhostIcon.appendChild(i)}};Br.ICON_PINNED="pinned",Br.ICON_MOVE="move",Br.ICON_LEFT="left",Br.ICON_RIGHT="right",Br.ICON_GROUP="group",Br.ICON_AGGREGATE="aggregate",Br.ICON_PIVOT="pivot",Br.ICON_NOT_ALLOWED="notAllowed",Br.ICON_HIDE="hide",Br.GHOST_TEMPLATE='<div class="ag-dnd-ghost ag-unselectable">\n            <span class="ag-dnd-ghost-icon ag-shake-left-to-right"></span>\n            <div class="ag-dnd-ghost-label"></div>\n        </div>',g([ue("dragService")],Br.prototype,"dragService",2),g([ue("mouseEventService")],Br.prototype,"mouseEventService",2),g([ue("columnApi")],Br.prototype,"columnApi",2),g([ue("gridApi")],Br.prototype,"gridApi",2),g([le],Br.prototype,"init",1),g([ce],Br.prototype,"clearDragSourceParamsList",1),Br=g([he("dragAndDropService")],Br);var Vr=class extends Cs{constructor(e,t,i,n,s,r){super(),this.cellValueFn=e,this.rowNode=t,this.column=i,this.customGui=n,this.dragStartPixels=s,this.suppressVisibilityChange=r,this.dragSource=null}isCustomGui(){return null!=this.customGui}postConstruct(){if(this.customGui?this.setDragElement(this.customGui,this.dragStartPixels):(this.setTemplate('<div class="ag-drag-handle ag-row-drag" aria-hidden="true"></div>'),this.getGui().appendChild(qn("rowDrag",this.gos,null)),this.addDragSource()),this.checkCompatibility(),!this.suppressVisibilityChange){const e=this.gos.get("rowDragManaged")?new zr(this,this.beans,this.rowNode,this.column):new Ur(this,this.beans,this.rowNode,this.column);this.createManagedBean(e,this.beans.context)}}setDragElement(e,t){this.setTemplateFromElement(e),this.addDragSource(t)}getSelectedNodes(){if(!this.gos.get("rowDragMultiRow"))return[this.rowNode];const e=this.beans.selectionService.getSelectedNodes();return-1!==e.indexOf(this.rowNode)?e:[this.rowNode]}checkCompatibility(){const e=this.gos.get("rowDragManaged");this.gos.get("treeData")&&e&&z("If using row drag with tree data, you cannot have rowDragManaged=true")}getDragItem(){return{rowNode:this.rowNode,rowNodes:this.getSelectedNodes(),columns:this.column?[this.column]:void 0,defaultTextValue:this.cellValueFn()}}getRowDragText(e){if(e){const t=e.getColDef();if(t.rowDragText)return t.rowDragText}return this.gos.get("rowDragText")}addDragSource(e=4){this.dragSource&&this.removeDragSource();const t=this.localeService.getLocaleTextFunc();this.dragSource={type:2,eElement:this.getGui(),dragItemName:()=>{var e;const i=this.getDragItem(),n=(null==(e=i.rowNodes)?void 0:e.length)||1,s=this.getRowDragText(this.column);return s?s(i,n):1===n?this.cellValueFn():`${n} ${t("rowDragRows","rows")}`},getDragItem:()=>this.getDragItem(),dragStartPixels:e,dragSourceDomDataKey:this.gos.getDomDataKey()},this.beans.dragAndDropService.addDragSource(this.dragSource,!0)}removeDragSource(){this.dragSource&&this.beans.dragAndDropService.removeDragSource(this.dragSource),this.dragSource=null}};g([ue("beans")],Vr.prototype,"beans",2),g([le],Vr.prototype,"postConstruct",1),g([ce],Vr.prototype,"removeDragSource",1);var Hr=class extends st{constructor(e,t,i){super(),this.parent=e,this.rowNode=t,this.column=i}setDisplayedOrVisible(e){const t={skipAriaHidden:!0};if(e)this.parent.setDisplayed(!1,t);else{let e=!0,i=!1;this.column&&(e=this.column.isRowDrag(this.rowNode)||this.parent.isCustomGui(),i=$(this.column.getColDef().rowDrag)),i?(this.parent.setDisplayed(!0,t),this.parent.setVisible(e,t)):(this.parent.setDisplayed(e,t),this.parent.setVisible(!0,t))}}},Ur=class extends Hr{constructor(e,t,i,n){super(e,i,n),this.beans=t}postConstruct(){this.addManagedPropertyListener("suppressRowDrag",this.onSuppressRowDrag.bind(this)),this.addManagedListener(this.rowNode,Lr.EVENT_DATA_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,Lr.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,Lr.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,ct.EVENT_NEW_COLUMNS_LOADED,this.workOutVisibility.bind(this)),this.workOutVisibility()}onSuppressRowDrag(){this.workOutVisibility()}workOutVisibility(){const e=this.gos.get("suppressRowDrag");this.setDisplayedOrVisible(e)}};g([le],Ur.prototype,"postConstruct",1);var zr=class extends Hr{constructor(e,t,i,n){super(e,i,n),this.beans=t}postConstruct(){this.addManagedListener(this.beans.eventService,ct.EVENT_SORT_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,ct.EVENT_FILTER_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,ct.EVENT_COLUMN_ROW_GROUP_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,ct.EVENT_NEW_COLUMNS_LOADED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,Lr.EVENT_DATA_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,Lr.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(),i=this.gos.get("suppressRowDrag"),n=this.beans.dragAndDropService.hasExternalDropZones(),s=t&&!n||i;this.setDisplayedOrVisible(s)}};g([le],zr.prototype,"postConstruct",1);var Wr=class extends st{init(e,t,i,n,s,r,o){var a,l,c,h;this.params=o,this.eGui=t,this.eCheckbox=i,this.eExpanded=n,this.eContracted=s,this.comp=e,this.compClass=r;const{node:u,value:d,colDef:p}=o,g=this.isTopLevelFooter();if(!g){if(this.isEmbeddedRowMismatch())return;if(u.footer&&this.gos.get("groupHideOpenParents")&&(p&&p.showRowGroup)!==(u.rowGroupColumn&&u.rowGroupColumn.getColId()))return}if(this.setupShowingValueForOpenedParent(),this.findDisplayedGroupNode(),!g){const e=o.node.footer&&o.node.rowGroupIndex===this.columnModel.getRowGroupColumns().findIndex(e=>{var t;return e.getColId()===(null==(t=o.colDef)?void 0:t.showRowGroup)}),t="multipleColumns"!=this.gos.get("groupDisplayType")||this.gos.get("treeData")||this.gos.get("showOpenedGroup")&&!o.node.footer&&(!o.node.group||null!=o.node.rowGroupIndex&&o.node.rowGroupIndex>this.columnModel.getRowGroupColumns().findIndex(e=>{var t;return e.getColId()===(null==(t=o.colDef)?void 0:t.showRowGroup)})),i=!u.group&&((null==(a=this.params.colDef)?void 0:a.field)||(null==(l=this.params.colDef)?void 0:l.valueGetter)),n=this.isExpandable(),s=this.columnModel.isPivotMode()&&u.leafGroup&&(null==(c=u.rowGroupColumn)?void 0:c.getColId())===(null==(h=o.column)?void 0:h.getColDef().showRowGroup);if(!(this.showingValueForOpenedParent||n||i||t||e||s))return}this.addExpandAndContract(),this.addFullWidthRowDraggerIfNeeded(),this.addCheckboxIfNeeded(),this.addValueElement(),this.setupIndent(),this.refreshAriaExpanded()}getCellAriaRole(){var e,t;const i=null==(e=this.params.colDef)?void 0:e.cellAriaRole,n=null==(t=this.params.column)?void 0:t.getColDef().cellAriaRole;return i||n||"gridcell"}destroy(){super.destroy(),this.expandListener=null}refreshAriaExpanded(){const{node:e,eGridCell:t}=this.params;if(this.expandListener&&(this.expandListener=this.expandListener()),!this.isExpandable())return void ni(t);const i=()=>{ii(t,!!e.expanded)};this.expandListener=this.addManagedListener(e,Lr.EVENT_EXPANDED_CHANGED,i)||null,i()}isTopLevelFooter(){if(!this.gos.getGrandTotalRow())return!1;if(null!=this.params.value||-1!=this.params.node.level)return!1;const e=this.params.colDef;if(null==e)return!0;if(!0===e.showRowGroup)return!0;const t=this.columnModel.getRowGroupColumns();return!t||0===t.length||t[0].getId()===e.showRowGroup}isEmbeddedRowMismatch(){if(!this.params.fullWidth||!this.gos.get("embedFullWidthRows"))return!1;const e="left"===this.params.pinned,t="right"===this.params.pinned,i=!e&&!t;return this.gos.get("enableRtl")?this.columnModel.isPinningLeft()?!t:!i:this.columnModel.isPinningLeft()?!e:!i}findDisplayedGroupNode(){const e=this.params.column,t=this.params.node;if(this.showingValueForOpenedParent){let i=t.parent;for(;null!=i;){if(i.rowGroupColumn&&e.isRowGroupDisplayed(i.rowGroupColumn.getId())){this.displayedGroupNode=i;break}i=i.parent}}C(this.displayedGroupNode)&&(this.displayedGroupNode=t)}setupShowingValueForOpenedParent(){const e=this.params.node,t=this.params.column;if(!this.gos.get("groupHideOpenParents"))return void(this.showingValueForOpenedParent=!1);if(!e.groupData)return void(this.showingValueForOpenedParent=!1);if(null!=e.rowGroupColumn){const i=e.rowGroupColumn.getId();if(t.isRowGroupDisplayed(i))return void(this.showingValueForOpenedParent=!1)}const i=null!=e.groupData[t.getId()];this.showingValueForOpenedParent=i}addValueElement(){this.displayedGroupNode.footer?this.addFooterValue():(this.addGroupValue(),this.addChildCount())}addGroupValue(){var e;const t=this.adjustParamsWithDetailsFromRelatedColumn(),i=this.getInnerCompDetails(t),{valueFormatted:n,value:s}=t;let r=n;if(null==r){const t=this.displayedGroupNode.rowGroupColumn&&(null==(e=this.params.column)?void 0:e.isRowGroupDisplayed(this.displayedGroupNode.rowGroupColumn.getId()));r=""===this.displayedGroupNode.key&&this.displayedGroupNode.group&&t?this.localeService.getLocaleTextFunc()("blanks","(Blanks)"):null!=s?s:null}this.comp.setInnerRenderer(i,r)}adjustParamsWithDetailsFromRelatedColumn(){const e=this.displayedGroupNode.rowGroupColumn,t=this.params.column;if(!e)return this.params;if(null!=t&&!t.isRowGroupDisplayed(e.getId()))return this.params;const i=this.params,{value:n,node:s}=this.params,r=this.valueService.formatValue(e,s,n);return d(u({},i),{valueFormatted:r})}addFooterValue(){let e=this.params.totalValueGetter;if(!e){const t=this.params.footerValueGetter;t&&(e=t,z("As of v31.3, footerValueGetter is deprecated. Use `totalValueGetter` instead."))}let t="";if(e){const i=_(this.params);i.value=this.params.value,"function"==typeof e?t=e(i):"string"==typeof e?t=this.expressionService.evaluate(e,i):console.warn("AG Grid: footerValueGetter should be either a function or a string (expression)")}else t=this.localeService.getLocaleTextFunc()("footerTotal","Total")+" "+(null!=this.params.value?this.params.value:"");const i=this.getInnerCompDetails(this.params);this.comp.setInnerRenderer(i,t)}getInnerCompDetails(e){if(e.fullWidth)return this.userComponentFactory.getFullWidthGroupRowInnerCellRenderer(this.gos.get("groupRowRendererParams"),e);const t=this.userComponentFactory.getInnerRendererDetails(e,e),i=e=>e&&e.componentClass==this.compClass;if(t&&!i(t))return t;const n=this.displayedGroupNode.rowGroupColumn,s=n?n.getColDef():void 0;if(!s)return;const r=this.userComponentFactory.getCellRendererDetails(s,e);return r&&!i(r)?r:i(r)&&s.cellRendererParams&&s.cellRendererParams.innerRenderer?this.userComponentFactory.getInnerRendererDetails(s.cellRendererParams,e):void 0}addChildCount(){this.params.suppressCount||(this.addManagedListener(this.displayedGroupNode,Lr.EVENT_ALL_CHILDREN_COUNT_CHANGED,this.updateChildCount.bind(this)),this.updateChildCount())}updateChildCount(){const e=this.displayedGroupNode.allChildrenCount,t=this.isShowRowGroupForThisRow()&&null!=e&&e>=0?`(${e})`:"";this.comp.setChildCount(t)}isShowRowGroupForThisRow(){if(this.gos.get("treeData"))return!0;const e=this.displayedGroupNode.rowGroupColumn;if(!e)return!1;const t=this.params.column;return null==t||t.isRowGroupDisplayed(e.getId())}addExpandAndContract(){var e;const t=this.params,i=qn("groupExpanded",this.gos,null),n=qn("groupContracted",this.gos,null);i&&this.eExpanded.appendChild(i),n&&this.eContracted.appendChild(n);const s=t.eGridCell;(null==(e=this.params.column)?void 0:e.isCellEditable(t.node))&&this.gos.get("enableGroupEdit")||!this.isExpandable()||t.suppressDoubleClickExpand||this.addManagedListener(s,"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(s,"keydown",this.onKeyDown.bind(this)),this.addManagedListener(t.node,Lr.EVENT_EXPANDED_CHANGED,this.showExpandAndContractIcons.bind(this)),this.showExpandAndContractIcons();const r=this.onRowNodeIsExpandableChanged.bind(this);this.addManagedListener(this.displayedGroupNode,Lr.EVENT_ALL_CHILDREN_COUNT_CHANGED,r),this.addManagedListener(this.displayedGroupNode,Lr.EVENT_MASTER_CHANGED,r),this.addManagedListener(this.displayedGroupNode,Lr.EVENT_GROUP_CHANGED,r),this.addManagedListener(this.displayedGroupNode,Lr.EVENT_HAS_CHILDREN_CHANGED,r)}onExpandClicked(e){Xe(e)||(qe(e),this.onExpandOrContract(e))}onExpandOrContract(e){const t=this.displayedGroupNode,i=!t.expanded;!i&&t.sticky&&this.scrollToStickyNode(t),t.setExpanded(i,e)}scrollToStickyNode(e){this.ctrlsService.getGridBodyCtrl().getScrollFeature().setVerticalScrollPosition(e.rowTop-e.stickyRowTop)}isExpandable(){if(this.showingValueForOpenedParent)return!0;const e=this.displayedGroupNode,t=this.columnModel.isPivotMode()&&e.leafGroup;if(!e.isExpandable()||e.footer||t)return!1;const i=this.params.column;return null==i||"string"!=typeof i.getColDef().showRowGroup||this.isShowRowGroupForThisRow()}showExpandAndContractIcons(){const{params:e,displayedGroupNode:t,columnModel:i}=this,{node:n}=e,s=this.isExpandable();if(s){const e=!!this.showingValueForOpenedParent||n.expanded;this.comp.setExpandedDisplayed(e),this.comp.setContractedDisplayed(!e)}else this.comp.setExpandedDisplayed(!1),this.comp.setContractedDisplayed(!1);const r=i.isPivotMode(),o=r&&t.leafGroup,a=s&&!o,l=n.footer&&-1===n.level;this.comp.addOrRemoveCssClass("ag-cell-expandable",a),this.comp.addOrRemoveCssClass("ag-row-group",a),r?this.comp.addOrRemoveCssClass("ag-pivot-leaf-group",o):l||this.comp.addOrRemoveCssClass("ag-row-group-leaf-indent",!a)}onRowNodeIsExpandableChanged(){this.showExpandAndContractIcons(),this.setIndent(),this.refreshAriaExpanded()}setupIndent(){const e=this.params.node;this.params.suppressPadding||(this.addManagedListener(e,Lr.EVENT_UI_LEVEL_CHANGED,this.setIndent.bind(this)),this.setIndent())}setIndent(){if(this.gos.get("groupHideOpenParents"))return;const e=this.params,t=e.node,i=!!e.colDef,n=this.gos.get("treeData"),s=!i||n||!0===e.colDef.showRowGroup?t.uiLevel:0;this.indentClass&&this.comp.addOrRemoveCssClass(this.indentClass,!1),this.indentClass="ag-row-group-indent-"+s,this.comp.addOrRemoveCssClass(this.indentClass,!0)}addFullWidthRowDraggerIfNeeded(){if(!this.params.fullWidth||!this.params.rowDrag)return;const e=new Vr(()=>this.params.value,this.params.node);this.createManagedBean(e,this.context),this.eGui.insertAdjacentElement("afterbegin",e.getGui())}isUserWantsSelected(){const e=this.params.checkbox;return"function"==typeof e||!0===e}addCheckboxIfNeeded(){const e=this.displayedGroupNode,t=this.isUserWantsSelected()&&!e.footer&&!e.rowPinned&&!e.detail;if(t){const e=new Nr;this.getContext().createBean(e),e.init({rowNode:this.params.node,column:this.params.column,overrides:{isVisible:this.params.checkbox,callbackParams:this.params,removeHidden:!0}}),this.eCheckbox.appendChild(e.getGui()),this.addDestroyFunc(()=>this.getContext().destroyBean(e))}this.comp.setCheckboxVisible(t)}onKeyDown(e){e.key!==Zn.ENTER||this.params.suppressEnterExpand||this.params.column&&this.params.column.isCellEditable(this.params.node)||this.onExpandOrContract(e)}onCellDblClicked(e){Xe(e)||Je(this.eExpanded,e)||Je(this.eContracted,e)||this.onExpandOrContract(e)}};g([ue("expressionService")],Wr.prototype,"expressionService",2),g([ue("valueService")],Wr.prototype,"valueService",2),g([ue("columnModel")],Wr.prototype,"columnModel",2),g([ue("userComponentFactory")],Wr.prototype,"userComponentFactory",2),g([ue("ctrlsService")],Wr.prototype,"ctrlsService",2);var jr=class e extends Cs{constructor(){super(e.TEMPLATE)}init(e){const t={setInnerRenderer:(e,t)=>this.setRenderDetails(e,t),setChildCount:e=>this.eChildCount.textContent=e,addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setContractedDisplayed:e=>an(this.eContracted,e),setExpandedDisplayed:e=>an(this.eExpanded,e),setCheckboxVisible:e=>this.eCheckbox.classList.toggle("ag-invisible",!e)},i=this.createManagedBean(new Wr),n=!e.colDef,s=this.getGui();i.init(t,s,this.eCheckbox,this.eExpanded,this.eContracted,this.constructor,e),n&&Ht(s,i.getCellAriaRole())}setRenderDetails(e,t){if(e){const t=e.newAgStackInstance();if(!t)return;t.then(e=>{if(!e)return;const t=()=>this.context.destroyBean(e);this.isAlive()?(this.eValue.appendChild(e.getGui()),this.addDestroyFunc(t)):t()})}else this.eValue.innerText=t}destroy(){this.getContext().destroyBean(this.innerCellRenderer),super.destroy()}refresh(){return!1}};jr.TEMPLATE='<span class="ag-cell-wrapper">\n            <span class="ag-group-expanded" ref="eExpanded"></span>\n            <span class="ag-group-contracted" ref="eContracted"></span>\n            <span class="ag-group-checkbox ag-invisible" ref="eCheckbox"></span>\n            <span class="ag-group-value" ref="eValue"></span>\n            <span class="ag-group-child-count" ref="eChildCount"></span>\n        </span>',g([Ss("eExpanded")],jr.prototype,"eExpanded",2),g([Ss("eContracted")],jr.prototype,"eContracted",2),g([Ss("eCheckbox")],jr.prototype,"eCheckbox",2),g([Ss("eValue")],jr.prototype,"eValue",2),g([Ss("eChildCount")],jr.prototype,"eChildCount",2);var $r=jr,Kr=class e extends Cs{constructor(){super(e.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=qn("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()}};Kr.TEMPLATE='<div class="ag-loading">\n            <span class="ag-loading-icon" ref="eLoadingIcon"></span>\n            <span class="ag-loading-text" ref="eLoadingText"></span>\n        </div>',g([Ss("eLoadingIcon")],Kr.prototype,"eLoadingIcon",2),g([Ss("eLoadingText")],Kr.prototype,"eLoadingText",2);var Yr=Kr,qr=class e extends Cs{constructor(){super(e.TEMPLATE)}init(e){const t=`ag-cell-skeleton-renderer-${this.getCompId()}`;this.getGui().setAttribute("id",t),this.addDestroyFunc(()=>Kt(e.eParentOfValue)),Kt(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");$t(this.getGui(),t)}setupLoading(){const e=this.gos.getDocument().createElement("div");e.classList.add("ag-skeleton-effect"),this.getGui().appendChild(e);const t=this.localeService.getLocaleTextFunc()("ariaSkeletonCellLoading","Row data is loading");$t(this.getGui(),t)}refresh(e){return!1}destroy(){super.destroy()}};qr.TEMPLATE='<div class="ag-skeleton-container"></div>';var Xr=qr,Zr=class e extends Cs{constructor(){super()}destroy(){super.destroy()}init(t){const i=this.gos.get("overlayLoadingTemplate");if(this.setTemplate(null!=i?i:e.DEFAULT_LOADING_OVERLAY_TEMPLATE),!i){const e=this.localeService.getLocaleTextFunc();setTimeout(()=>{this.getGui().textContent=e("loadingOoo","Loading...")})}}};Zr.DEFAULT_LOADING_OVERLAY_TEMPLATE='<span aria-live="polite" aria-atomic="true" class="ag-overlay-loading-center"></span>';var Qr=Zr,Jr=class e extends Cs{constructor(){super()}destroy(){super.destroy()}init(t){const i=this.gos.get("overlayNoRowsTemplate");if(this.setTemplate(null!=i?i:e.DEFAULT_NO_ROWS_TEMPLATE),!i){const e=this.localeService.getLocaleTextFunc();setTimeout(()=>{this.getGui().textContent=e("noRowsToShow","No Rows To Show")})}}};Jr.DEFAULT_NO_ROWS_TEMPLATE='<span class="ag-overlay-no-rows-center"></span>';var eo=Jr,to=class extends Er{constructor(){super('<div class="ag-tooltip"></div>')}init(e){const{value:t}=e;this.getGui().textContent=bt(t,!0)}},io=class{getTemplate(){return'<ag-input-number-field class="ag-cell-editor" ref="eInput"></ag-input-number-field>'}init(e,t){this.eInput=e,this.params=t,null!=t.max&&e.setMax(t.max),null!=t.min&&e.setMin(t.min),null!=t.precision&&e.setPrecision(t.precision),null!=t.step&&e.setStep(t.step);const i=e.getInputElement();t.preventStepping?e.addManagedListener(i,"keydown",this.preventStepping):t.showStepperButtons&&i.classList.add("ag-number-field-input-stepper")}preventStepping(e){e.key!==Zn.UP&&e.key!==Zn.DOWN||e.preventDefault()}getValue(){const e=this.eInput.getValue();if(!b(e)&&!b(this.params.value))return this.params.value;let t=this.params.parseValue(e);if(null==t)return t;if("string"==typeof t){if(""===t)return null;t=Number(t)}return isNaN(t)?null:t}getStartValue(){return this.params.value}},no=class extends Dr{constructor(){super(new io)}},so=class{getTemplate(){return'<ag-input-date-field class="ag-cell-editor" ref="eInput"></ag-input-date-field>'}init(e,t){this.eInput=e,this.params=t,null!=t.min&&e.setMin(t.min),null!=t.max&&e.setMax(t.max),null!=t.step&&e.setStep(t.step)}getValue(){const e=this.eInput.getDate();return b(e)||b(this.params.value)?null!=e?e:null:this.params.value}getStartValue(){const{value:e}=this.params;if(e instanceof Date)return Xi(e,!1)}},ro=class extends Dr{constructor(){super(new so)}},oo=class{constructor(e){this.getDataTypeService=e}getTemplate(){return'<ag-input-date-field class="ag-cell-editor" ref="eInput"></ag-input-date-field>'}init(e,t){this.eInput=e,this.params=t,null!=t.min&&e.setMin(t.min),null!=t.max&&e.setMax(t.max),null!=t.step&&e.setStep(t.step)}getValue(){const e=this.formatDate(this.eInput.getDate());return b(e)||b(this.params.value)?this.params.parseValue(null!=e?e:""):this.params.value}getStartValue(){var e,t;return Xi(null!=(t=this.parseDate(null!=(e=this.params.value)?e:void 0))?t:null,!1)}parseDate(e){return this.getDataTypeService().getDateParserFunction(this.params.column)(e)}formatDate(e){return this.getDataTypeService().getDateFormatterFunction(this.params.column)(e)}},ao=class extends Dr{constructor(){super(new oo(()=>this.dataTypeService))}};g([ue("dataTypeService")],ao.prototype,"dataTypeService",2);var lo=class e extends Cs{constructor(){super(e.TEMPLATE)}init(e){this.params=e,this.updateCheckbox(e);const t=this.eCheckbox.getInputElement();t.setAttribute("tabindex","-1"),qt(t,"polite"),this.addManagedListener(t,"click",e=>{if(qe(e),this.eCheckbox.isDisabled())return;const t=this.eCheckbox.getValue();this.onCheckboxChanged(t)}),this.addManagedListener(t,"dblclick",e=>{qe(e)}),this.addManagedListener(this.params.eGridCell,"keydown",e=>{if(e.key===Zn.SPACE&&!this.eCheckbox.isDisabled()){this.params.eGridCell===this.gos.getActiveDomElement()&&this.eCheckbox.toggle();const t=this.eCheckbox.getValue();this.onCheckboxChanged(t),e.preventDefault()}})}refresh(e){return this.params=e,this.updateCheckbox(e),!0}updateCheckbox(e){var t,i,n;let s,r=!0;if(e.node.group&&e.column){const i=e.column.getColId();i.startsWith(dt)?s=null==e.value||""===e.value?void 0:"true"===e.value:e.node.aggData&&void 0!==e.node.aggData[i]?s=null!=(t=e.value)?t:void 0:r=!1}else s=null!=(i=e.value)?i:void 0;if(!r)return void this.eCheckbox.setDisplayed(!1);this.eCheckbox.setValue(s);const o=null!=e.disabled?e.disabled:!(null==(n=e.column)?void 0:n.isCellEditable(e.node));this.eCheckbox.setDisabled(o);const a=this.localeService.getLocaleTextFunc(),l=yi(a,s),c=o?l:`${a("ariaToggleCellValue","Press SPACE to toggle cell value")} (${l})`;this.eCheckbox.setInputAriaLabel(c)}onCheckboxChanged(e){const{column:t,node:i,rowIndex:n,value:s}=this.params,r={type:ct.EVENT_CELL_EDITING_STARTED,column:t,colDef:null==t?void 0:t.getColDef(),data:i.data,node:i,rowIndex:n,rowPinned:i.rowPinned,value:s};this.eventService.dispatchEvent(r);const o=this.params.node.setDataValue(this.params.column,e,"edit"),a={type:ct.EVENT_CELL_EDITING_STOPPED,column:t,colDef:null==t?void 0:t.getColDef(),data:i.data,node:i,rowIndex:n,rowPinned:i.rowPinned,value:s,oldValue:s,newValue:e,valueChanged:o};this.eventService.dispatchEvent(a)}};lo.TEMPLATE='\n        <div class="ag-cell-wrapper ag-checkbox-cell" role="presentation">\n            <ag-checkbox role="presentation" ref="eCheckbox"></ag-checkbox>\n        </div>',g([Ss("eCheckbox")],lo.prototype,"eCheckbox",2);var co=lo,ho=class extends Er{constructor(){super('\n            <div class="ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit">\n                <ag-checkbox role="presentation" ref="eCheckbox"></ag-checkbox>\n            </div>')}init(e){var t;this.params=e;const i=null!=(t=e.value)?t:void 0;this.eCheckbox.setValue(i),this.eCheckbox.getInputElement().setAttribute("tabindex","-1"),this.setAriaLabel(i),this.addManagedListener(this.eCheckbox,ct.EVENT_FIELD_VALUE_CHANGED,e=>this.setAriaLabel(e.selected))}getValue(){return this.eCheckbox.getValue()}focusIn(){this.eCheckbox.getFocusableElement().focus()}afterGuiAttached(){this.params.cellStartedEdit&&this.focusIn()}isPopup(){return!1}setAriaLabel(e){const t=this.localeService.getLocaleTextFunc(),i=yi(t,e),n=t("ariaToggleCellValue","Press SPACE to toggle cell value");this.eCheckbox.setInputAriaLabel(`${n} (${i})`)}};g([Ss("eCheckbox")],ho.prototype,"eCheckbox",2);var uo=class extends Cs{constructor(){super(),this.setTemplate("<div></div>")}init(e){var t;this.params=e,this.cssClassPrefix=null!=(t=this.params.cssClassPrefix)?t:"ag-menu-option",this.addIcon(),this.addName(),this.addShortcut(),this.addSubMenu()}configureDefaults(){return!0}addIcon(){if(this.params.isCompact)return;const e=En(`<span ref="eIcon" class="${this.getClassName("part")} ${this.getClassName("icon")}" role="presentation"></span>`);this.params.checked?e.appendChild(qn("check",this.gos)):this.params.icon&&(On(this.params.icon)?e.appendChild(this.params.icon):"string"==typeof this.params.icon?e.innerHTML=this.params.icon:console.warn("AG Grid: menu item icon must be DOM node or string")),this.getGui().appendChild(e)}addName(){const e=En(`<span ref="eName" class="${this.getClassName("part")} ${this.getClassName("text")}">${this.params.name||""}</span>`);this.getGui().appendChild(e)}addShortcut(){if(this.params.isCompact)return;const e=En(`<span ref="eShortcut" class="${this.getClassName("part")} ${this.getClassName("shortcut")}">${this.params.shortcut||""}</span>`);this.getGui().appendChild(e)}addSubMenu(){const e=En(`<span ref="ePopupPointer" class="${this.getClassName("part")} ${this.getClassName("popup-pointer")}"></span>`),t=this.getGui();if(this.params.subMenu){const i=this.gos.get("enableRtl")?"smallLeft":"smallRight";ii(t,!1),e.appendChild(qn(i,this.gos))}t.appendChild(e)}getClassName(e){return`${this.cssClassPrefix}-${e}`}destroy(){super.destroy()}},po=class extends st{constructor(){super(...arguments),this.agGridDefaults={agDateInput:tr,agColumnHeader:wr,agColumnGroupHeader:xr,agSortIndicator:br,agTextColumnFloatingFilter:fr,agNumberColumnFloatingFilter:gr,agDateColumnFloatingFilter:er,agReadOnlyFloatingFilter:Es,agAnimateShowChangeCellRenderer:kr,agAnimateSlideCellRenderer:Pr,agGroupCellRenderer:$r,agGroupRowRenderer:$r,agLoadingCellRenderer:Yr,agSkeletonCellRenderer:Xr,agCheckboxCellRenderer:co,agCellEditor:Rr,agTextCellEditor:Rr,agNumberCellEditor:no,agDateCellEditor:ro,agDateStringCellEditor:ao,agSelectCellEditor:Tr,agLargeTextCellEditor:Mr,agCheckboxCellEditor:ho,agTextColumnFilter:hr,agNumberColumnFilter:ar,agDateColumnFilter:Qs,agLoadingOverlay:Qr,agNoRowsOverlay:eo,agTooltipComponent:to,agMenuItem:uo},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 e=this.gos.get("components");null!=e&&P(e,(e,t)=>this.registerJsComponent(e,t))}registerDefaultComponent(e,t){this.agGridDefaults[e]?console.error("Trying to overwrite a default component. You should call registerComponent"):this.agGridDefaults[e]=t}registerJsComponent(e,t){this.jsComps[e]=t}retrieve(e,t){const i=(e,t)=>({componentFromFramework:t,component:e}),n=this.getFrameworkOverrides().frameworkComponent(t,this.gos.get("components"));if(null!=n)return i(n,!0);const s=this.jsComps[t];if(s)return i(s,this.getFrameworkOverrides().isFrameworkComponent(s));const r=this.agGridDefaults[t];if(r)return i(r,!1);const o=this.enterpriseAgDefaultCompsModule[t];return o?re.__assertRegistered(o,`AG Grid '${e}' component: ${t}`,this.context.getGridId()):U(()=>{this.warnAboutMissingComponent(e,t)},"MissingComp"+t),null}warnAboutMissingComponent(e,t){const i=Wn(t,[...Object.keys(this.agGridDefaults).filter(e=>!["agCellEditor","agGroupRowRenderer","agSortIndicator"].includes(e)),...Object.keys(this.jsComps)],!0,.8).values;console.warn(`AG Grid: Could not find '${t}' component. It was configured as "${e}: '${t}'" but it wasn't found in the list of registered components.`),i.length>0&&console.warn(`         Did you mean: [${i.slice(0,3)}]?`),console.warn(`If using a custom component check it has been registered as described in: ${this.getFrameworkOverrides().getDocLink("components/")}`)}};g([le],po.prototype,"init",1),po=g([he("userComponentRegistry")],po);var go={propertyName:"dateComponent",cellRenderer:!1},fo={propertyName:"headerComponent",cellRenderer:!1},mo={propertyName:"headerGroupComponent",cellRenderer:!1},yo={propertyName:"cellRenderer",cellRenderer:!0},vo={propertyName:"loadingCellRenderer",cellRenderer:!0},bo={propertyName:"cellEditor",cellRenderer:!1},Co={propertyName:"innerRenderer",cellRenderer:!0},wo={propertyName:"loadingOverlayComponent",cellRenderer:!1},So={propertyName:"noRowsOverlayComponent",cellRenderer:!1},xo={propertyName:"tooltipComponent",cellRenderer:!1},Eo={propertyName:"filter",cellRenderer:!1},Ao={propertyName:"floatingFilterComponent",cellRenderer:!1},Mo={propertyName:"toolPanel",cellRenderer:!1},To={propertyName:"statusPanel",cellRenderer:!1},Do={propertyName:"fullWidthCellRenderer",cellRenderer:!0},Io={propertyName:"loadingCellRenderer",cellRenderer:!0},Ro={propertyName:"groupRowRenderer",cellRenderer:!0},ko={propertyName:"detailCellRenderer",cellRenderer:!0},Po={propertyName:"menuItem",cellRenderer:!1},_o=class{static getFloatingFilterType(e){return this.filterToFloatingFilterMapping[e]}};_o.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 Lo=class extends st{getHeaderCompDetails(e,t){return this.getCompDetails(e,fo,"agColumnHeader",t)}getHeaderGroupCompDetails(e){const t=e.columnGroup.getColGroupDef();return this.getCompDetails(t,mo,"agColumnGroupHeader",e)}getFullWidthCellRendererDetails(e){return this.getCompDetails(this.gridOptions,Do,null,e,!0)}getFullWidthLoadingCellRendererDetails(e){return this.getCompDetails(this.gridOptions,Io,"agLoadingCellRenderer",e,!0)}getFullWidthGroupCellRendererDetails(e){return this.getCompDetails(this.gridOptions,Ro,"agGroupRowRenderer",e,!0)}getFullWidthDetailCellRendererDetails(e){return this.getCompDetails(this.gridOptions,ko,"agDetailCellRenderer",e,!0)}getInnerRendererDetails(e,t){return this.getCompDetails(e,Co,null,t)}getFullWidthGroupRowInnerCellRenderer(e,t){return this.getCompDetails(e,Co,null,t)}getCellRendererDetails(e,t){return this.getCompDetails(e,yo,null,t)}getLoadingCellRendererDetails(e,t){return this.getCompDetails(e,vo,"agSkeletonCellRenderer",t,!0)}getCellEditorDetails(e,t){return this.getCompDetails(e,bo,"agCellEditor",t,!0)}getFilterDetails(e,t,i){return this.getCompDetails(e,Eo,i,t,!0)}getDateCompDetails(e){return this.getCompDetails(this.gridOptions,go,"agDateInput",e,!0)}getLoadingOverlayCompDetails(e){return this.getCompDetails(this.gridOptions,wo,"agLoadingOverlay",e,!0)}getNoRowsOverlayCompDetails(e){return this.getCompDetails(this.gridOptions,So,"agNoRowsOverlay",e,!0)}getTooltipCompDetails(e){return this.getCompDetails(e.colDef,xo,"agTooltipComponent",e,!0)}getSetFilterCellRendererDetails(e,t){return this.getCompDetails(e,yo,null,t)}getFloatingFilterCompDetails(e,t,i){return this.getCompDetails(e,Ao,i,t)}getToolPanelCompDetails(e,t){return this.getCompDetails(e,Mo,null,t,!0)}getStatusPanelCompDetails(e,t){return this.getCompDetails(e,To,null,t,!0)}getMenuItemCompDetails(e,t){return this.getCompDetails(e,Po,"agMenuItem",t,!0)}getCompDetails(e,t,i,n,s=!1){const{propertyName:r,cellRenderer:o}=t;let{compName:a,jsComp:l,fwComp:c,paramsFromSelector:h,popupFromSelector:u,popupPositionFromSelector:d}=this.getCompKeys(e,t,n);const p=e=>{const t=this.userComponentRegistry.retrieve(r,e);t&&(l=t.componentFromFramework?void 0:t.component,c=t.componentFromFramework?t.component:void 0)};if(null!=a&&p(a),null==l&&null==c&&null!=i&&p(i),l&&o&&!this.agComponentUtils.doesImplementIComponent(l)&&(l=this.agComponentUtils.adaptFunction(r,l)),!l&&!c)return void(s&&console.error(`AG Grid: Could not find component ${a}, did you forget to configure this component?`));const g=this.mergeParamsWithApplicationProvidedParams(e,t,n,h),f=null==l,m=l||c;return{componentFromFramework:f,componentClass:m,params:g,type:t,popupFromSelector:u,popupPositionFromSelector:d,newAgStackInstance:()=>this.newAgStackInstance(m,f,g,t)}}getCompKeys(e,t,i){const{propertyName:n}=t;let s,r,o,a,l,c;if(e){const t=e,h=t[n+"Selector"],u=h?h(i):null,d=e=>{"string"==typeof e?s=e:null!=e&&!0!==e&&(this.getFrameworkOverrides().isFrameworkComponent(e)?o=e:r=e)};u?(d(u.component),a=u.params,l=u.popup,c=u.popupPosition):d(t[n])}return{compName:s,jsComp:r,fwComp:o,paramsFromSelector:a,popupFromSelector:l,popupPositionFromSelector:c}}newAgStackInstance(e,t,i,n){const s=n.propertyName;let r;if(t){const t=this.componentMetadataProvider.retrieve(s);r=this.frameworkComponentWrapper.wrap(e,t.mandatoryMethodList,t.optionalMethodList,n)}else r=new e;const o=this.initComponent(r,i);return null==o?ds.resolve(r):o.then(()=>r)}mergeParamsWithApplicationProvidedParams(e,t,i,n=null){const s=this.gos.getGridCommonParams();O(s,i);const r=e&&e[t.propertyName+"Params"];return"function"==typeof r?O(s,r(i)):"object"==typeof r&&O(s,r),O(s,n),s}initComponent(e,t){if(this.context.createBean(e),null!=e.init)return e.init(t)}getDefaultFloatingFilterType(e,t){if(null==e)return null;let i=null,{compName:n,jsComp:s,fwComp:r}=this.getCompKeys(e,Eo);return n?i=_o.getFloatingFilterType(n):null==s&&null==r&&!0===e.filter&&(i=t()),i}};g([ue("gridOptions")],Lo.prototype,"gridOptions",2),g([ue("agComponentUtils")],Lo.prototype,"agComponentUtils",2),g([ue("componentMetadataProvider")],Lo.prototype,"componentMetadataProvider",2),g([ue("userComponentRegistry")],Lo.prototype,"userComponentRegistry",2),g([de("frameworkComponentWrapper")],Lo.prototype,"frameworkComponentWrapper",2),Lo=g([he("userComponentFactory")],Lo);var No=(e=>(e[e.SINGLE_SHEET=0]="SINGLE_SHEET",e[e.MULTI_SHEET=1]="MULTI_SHEET",e))(No||{}),Oo=(e=>(e[e.Above=0]="Above",e[e.Below=1]="Below",e))(Oo||{}),Fo=class{constructor(e){this.tickingInterval=null,this.onScrollCallback=null,this.scrollContainer=e.scrollContainer,this.scrollHorizontally=-1!==e.scrollAxis.indexOf("x"),this.scrollVertically=-1!==e.scrollAxis.indexOf("y"),this.scrollByTick=null!=e.scrollByTick?e.scrollByTick:20,e.onScrollCallback&&(this.onScrollCallback=e.onScrollCallback),this.scrollVertically&&(this.getVerticalPosition=e.getVerticalPosition,this.setVerticalPosition=e.setVerticalPosition),this.scrollHorizontally&&(this.getHorizontalPosition=e.getHorizontalPosition,this.setHorizontalPosition=e.setHorizontalPosition),this.shouldSkipVerticalScroll=e.shouldSkipVerticalScroll||(()=>!1),this.shouldSkipHorizontalScroll=e.shouldSkipHorizontalScroll||(()=>!1)}check(e,t=!1){const i=t||this.shouldSkipVerticalScroll();if(i&&this.shouldSkipHorizontalScroll())return;const n=this.scrollContainer.getBoundingClientRect(),s=this.scrollByTick;this.tickLeft=e.clientX<n.left+s,this.tickRight=e.clientX>n.right-s,this.tickUp=e.clientY<n.top+s&&!i,this.tickDown=e.clientY>n.bottom-s&&!i,this.tickLeft||this.tickRight||this.tickUp||this.tickDown?this.ensureTickingStarted():this.ensureCleared()}ensureTickingStarted(){null===this.tickingInterval&&(this.tickingInterval=window.setInterval(this.doTick.bind(this),100),this.tickCount=0)}doTick(){let e;if(this.tickCount++,e=this.tickCount>20?200:this.tickCount>10?80:40,this.scrollVertically){const t=this.getVerticalPosition();this.tickUp&&this.setVerticalPosition(t-e),this.tickDown&&this.setVerticalPosition(t+e)}if(this.scrollHorizontally){const t=this.getHorizontalPosition();this.tickLeft&&this.setHorizontalPosition(t-e),this.tickRight&&this.setHorizontalPosition(t+e)}this.onScrollCallback&&this.onScrollCallback()}ensureCleared(){this.tickingInterval&&(window.clearInterval(this.tickingInterval),this.tickingInterval=null)}},Go=class extends st{constructor(e){super(),this.eContainer=e}postConstruct(){this.gos.isRowModelType("clientSide")&&(this.clientSideRowModel=this.rowModel),this.ctrlsService.whenReady(e=>{const t=e.gridBodyCtrl;this.autoScrollService=new Fo({scrollContainer:t.getBodyViewportElement(),scrollAxis:"y",getVerticalPosition:()=>t.getScrollFeature().getVScrollPosition().top,setVerticalPosition:e=>t.getScrollFeature().setVerticalScrollPosition(e),onScrollCallback:()=>{this.onDragging(this.lastDraggingEvent)}})})}getContainer(){return this.eContainer}isInterestedIn(e){return 2===e}getIconName(){return this.gos.get("rowDragManaged")&&this.shouldPreventRowMove()?Br.ICON_NOT_ALLOWED:Br.ICON_MOVE}shouldPreventRowMove(){return!!this.columnModel.getRowGroupColumns().length||(!!this.filterManager.isAnyFilterPresent()||!!this.sortController.isSortActive())}getRowNodes(e){if(!this.isFromThisGrid(e))return e.dragItem.rowNodes||[];const t=e.dragItem.rowNode;if(this.gos.get("rowDragMultiRow")){const e=[...this.selectionService.getSelectedNodes()].sort((e,t)=>null==e.rowIndex||null==t.rowIndex?0:this.getRowIndexNumber(e)-this.getRowIndexNumber(t));if(-1!==e.indexOf(t))return e}return[t]}onDragEnter(e){e.dragItem.rowNodes=this.getRowNodes(e),this.dispatchGridEvent(ct.EVENT_ROW_DRAG_ENTER,e),this.getRowNodes(e).forEach(e=>{e.setDragging(!0)}),this.onEnterOrDragging(e)}onDragging(e){this.onEnterOrDragging(e)}isFromThisGrid(e){const{dragSourceDomDataKey:t}=e.dragSource;return t===this.gos.getDomDataKey()}isDropZoneWithinThisGrid(e){const t=this.ctrlsService.getGridBodyCtrl().getGui(),{dropZoneTarget:i}=e;return!t.contains(i)}onEnterOrDragging(e){this.dispatchGridEvent(ct.EVENT_ROW_DRAG_MOVE,e),this.lastDraggingEvent=e;const t=this.mouseEventService.getNormalisedPosition(e).y;this.gos.get("rowDragManaged")&&this.doManagedDrag(e,t),this.autoScrollService.check(e.event)}doManagedDrag(e,t){const i=this.isFromThisGrid(e),n=this.gos.get("rowDragManaged"),s=e.dragItem.rowNodes;n&&this.shouldPreventRowMove()||(this.gos.get("suppressMoveWhenRowDragging")||!i?this.isDropZoneWithinThisGrid(e)||this.clientSideRowModel.highlightRowAtPixel(s[0],t):this.moveRows(s,t))}getRowIndexNumber(e){return parseInt(Ie(e.getRowIndexString().split("-")),10)}moveRowAndClearHighlight(e){const t=this.clientSideRowModel.getLastHighlightedRowNode(),i=t&&1===t.highlighted,n=this.mouseEventService.getNormalisedPosition(e).y,s=e.dragItem.rowNodes;let r=i?1:0;if(this.isFromThisGrid(e))s.forEach(e=>{e.rowTop<n&&(r-=1)}),this.moveRows(s,n,r);else{const e=this.gos.getCallback("getRowId");let t=this.clientSideRowModel.getRowIndexAtPixel(n)+1;0===this.clientSideRowModel.getHighlightPosition(n)&&t--,this.clientSideRowModel.updateRowData({add:s.map(e=>e.data).filter(t=>!this.clientSideRowModel.getRowNode(e?e({data:t,level:0}):t.id)),addIndex:t})}this.clearRowHighlight()}clearRowHighlight(){this.clientSideRowModel.highlightRowAtPixel(null)}moveRows(e,t,i=0){var n;this.clientSideRowModel.ensureRowsAtPixel(e,t,i)&&(this.focusService.clearFocusedCell(),null==(n=this.rangeService)||n.removeAllCellRanges())}addRowDropZone(e){if(!e.getContainer())return void z("addRowDropZone - A container target needs to be provided");if(this.dragAndDropService.findExternalZone(e))return void console.warn("AG Grid: addRowDropZone - target already exists in the list of DropZones. Use `removeRowDropZone` before adding it again.");let t={getContainer:e.getContainer};e.fromGrid?t=e:(e.onDragEnter&&(t.onDragEnter=t=>{e.onDragEnter(this.draggingToRowDragEvent(ct.EVENT_ROW_DRAG_ENTER,t))}),e.onDragLeave&&(t.onDragLeave=t=>{e.onDragLeave(this.draggingToRowDragEvent(ct.EVENT_ROW_DRAG_LEAVE,t))}),e.onDragging&&(t.onDragging=t=>{e.onDragging(this.draggingToRowDragEvent(ct.EVENT_ROW_DRAG_MOVE,t))}),e.onDragStop&&(t.onDragStop=t=>{e.onDragStop(this.draggingToRowDragEvent(ct.EVENT_ROW_DRAG_END,t))})),this.dragAndDropService.addDropTarget(u({isInterestedIn:e=>2===e,getIconName:()=>Br.ICON_MOVE,external:!0},t))}getRowDropZone(e){const t=this.getContainer.bind(this),i=this.onDragEnter.bind(this),n=this.onDragLeave.bind(this),s=this.onDragging.bind(this),r=this.onDragStop.bind(this);return e?{getContainer:t,onDragEnter:e.onDragEnter?t=>{i(t),e.onDragEnter(this.draggingToRowDragEvent(ct.EVENT_ROW_DRAG_ENTER,t))}:i,onDragLeave:e.onDragLeave?t=>{n(t),e.onDragLeave(this.draggingToRowDragEvent(ct.EVENT_ROW_DRAG_LEAVE,t))}:n,onDragging:e.onDragging?t=>{s(t),e.onDragging(this.draggingToRowDragEvent(ct.EVENT_ROW_DRAG_MOVE,t))}:s,onDragStop:e.onDragStop?t=>{r(t),e.onDragStop(this.draggingToRowDragEvent(ct.EVENT_ROW_DRAG_END,t))}:r,fromGrid:!0}:{getContainer:t,onDragEnter:i,onDragLeave:n,onDragging:s,onDragStop:r,fromGrid:!0}}draggingToRowDragEvent(e,t){const i=this.mouseEventService.getNormalisedPosition(t).y;let n,s,r=-1;switch(i>this.paginationProxy.getCurrentPageHeight()||(r=this.rowModel.getRowIndexAtPixel(i),n=this.rowModel.getRow(r)),t.vDirection){case 1:s="down";break;case 0:s="up";break;default:s=null}return this.gos.addGridCommonParams({type:e,event:t.event,node:t.dragItem.rowNode,nodes:t.dragItem.rowNodes,overIndex:r,overNode:n,y:i,vDirection:s})}dispatchGridEvent(e,t){const i=this.draggingToRowDragEvent(e,t);this.eventService.dispatchEvent(i)}onDragLeave(e){this.dispatchGridEvent(ct.EVENT_ROW_DRAG_LEAVE,e),this.stopDragging(e),this.gos.get("rowDragManaged")&&this.clearRowHighlight()}onDragStop(e){this.dispatchGridEvent(ct.EVENT_ROW_DRAG_END,e),this.stopDragging(e),!this.gos.get("rowDragManaged")||!this.gos.get("suppressMoveWhenRowDragging")&&this.isFromThisGrid(e)||this.isDropZoneWithinThisGrid(e)||this.moveRowAndClearHighlight(e)}stopDragging(e){this.autoScrollService.ensureCleared(),this.getRowNodes(e).forEach(e=>{e.setDragging(!1)})}};g([ue("dragAndDropService")],Go.prototype,"dragAndDropService",2),g([ue("rowModel")],Go.prototype,"rowModel",2),g([ue("paginationProxy")],Go.prototype,"paginationProxy",2),g([ue("columnModel")],Go.prototype,"columnModel",2),g([ue("focusService")],Go.prototype,"focusService",2),g([ue("sortController")],Go.prototype,"sortController",2),g([ue("filterManager")],Go.prototype,"filterManager",2),g([ue("selectionService")],Go.prototype,"selectionService",2),g([ue("mouseEventService")],Go.prototype,"mouseEventService",2),g([ue("ctrlsService")],Go.prototype,"ctrlsService",2),g([de("rangeService")],Go.prototype,"rangeService",2),g([le],Go.prototype,"postConstruct",1);var Bo=class extends st{constructor(){super(...arguments),this.dragEndFunctions=[],this.dragSources=[]}removeAllListeners(){this.dragSources.forEach(this.removeListener.bind(this)),this.dragSources.length=0}removeListener(e){const t=e.dragSource.eElement,i=e.mouseDownListener;if(t.removeEventListener("mousedown",i),e.touchEnabled){const i=e.touchStartListener;t.removeEventListener("touchstart",i,{passive:!0})}}removeDragSource(e){const t=this.dragSources.find(t=>t.dragSource===e);t&&(this.removeListener(t),Ne(this.dragSources,t))}isDragging(){return this.dragging}addDragSource(e){const t=this.onMouseDown.bind(this,e),{eElement:i,includeTouch:n,stopPropagationForTouch:s}=e;i.addEventListener("mousedown",t);let r=null;const o=this.gos.get("suppressTouch");n&&!o&&(r=t=>{on(t.target)||(t.cancelable&&(t.preventDefault(),s&&t.stopPropagation()),this.onTouchStart(e,t))},i.addEventListener("touchstart",r,{passive:!1})),this.dragSources.push({dragSource:e,mouseDownListener:t,touchStartListener:r,touchEnabled:!!n})}getStartTarget(){return this.startTarget}onTouchStart(e,t){this.currentDragParams=e,this.dragging=!1;const i=t.touches[0];this.touchLastTime=i,this.touchStart=i;const n=t=>this.onTouchUp(t,e.eElement),s=t.target,r=[{target:this.gos.getRootNode(),type:"touchmove",listener:e=>{e.cancelable&&e.preventDefault()},options:{passive:!1}},{target:s,type:"touchmove",listener:t=>this.onTouchMove(t,e.eElement),options:{passive:!0}},{target:s,type:"touchend",listener:n,options:{passive:!0}},{target:s,type:"touchcancel",listener:n,options:{passive:!0}}];this.addTemporaryEvents(r),0===e.dragStartPixels&&this.onCommonMove(i,this.touchStart,e.eElement)}onMouseDown(e,t){const i=t;if(e.skipMouseEvent&&e.skipMouseEvent(t))return;if(i._alreadyProcessedByDragService)return;if(i._alreadyProcessedByDragService=!0,0!==t.button)return;this.shouldPreventMouseEvent(t)&&t.preventDefault(),this.currentDragParams=e,this.dragging=!1,this.mouseStartEvent=t,this.startTarget=t.target;const n=this.gos.getRootNode(),s=[{target:n,type:"mousemove",listener:t=>this.onMouseMove(t,e.eElement)},{target:n,type:"mouseup",listener:t=>this.onMouseUp(t,e.eElement)},{target:n,type:"contextmenu",listener:e=>e.preventDefault()}];this.addTemporaryEvents(s),0===e.dragStartPixels&&this.onMouseMove(t,e.eElement)}addTemporaryEvents(e){e.forEach(e=>{const{target:t,type:i,listener:n,options:s}=e;t.addEventListener(i,n,s)}),this.dragEndFunctions.push(()=>{e.forEach(e=>{const{target:t,type:i,listener:n,options:s}=e;t.removeEventListener(i,n,s)})})}isEventNearStartEvent(e,t){const{dragStartPixels:i}=this.currentDragParams;return ss(e,t,b(i)?i:4)}getFirstActiveTouch(e){for(let t=0;t<e.length;t++)if(e[t].identifier===this.touchStart.identifier)return e[t];return null}onCommonMove(e,t,i){if(!this.dragging){if(!this.dragging&&this.isEventNearStartEvent(e,t))return;this.dragging=!0;const n={type:ct.EVENT_DRAG_STARTED,target:i};this.eventService.dispatchEvent(n),this.currentDragParams.onDragStart(t),this.currentDragParams.onDragging(t)}this.currentDragParams.onDragging(e)}onTouchMove(e,t){const i=this.getFirstActiveTouch(e.touches);i&&this.onCommonMove(i,this.touchStart,t)}onMouseMove(e,t){var i;Ti()&&(null==(i=this.gos.getDocument().getSelection())||i.removeAllRanges()),this.shouldPreventMouseEvent(e)&&e.preventDefault(),this.onCommonMove(e,this.mouseStartEvent,t)}shouldPreventMouseEvent(e){const t=this.gos.get("enableCellTextSelection"),i="mousemove"===e.type;return t&&i&&e.cancelable&&this.mouseEventService.isEventFromThisGrid(e)&&!this.isOverFormFieldElement(e)}isOverFormFieldElement(e){const t=e.target,i=null==t?void 0:t.tagName.toLocaleLowerCase();return!!(null==i?void 0:i.match("^a$|textarea|input|select|button"))}onTouchUp(e,t){let i=this.getFirstActiveTouch(e.changedTouches);i||(i=this.touchLastTime),this.onUpCommon(i,t)}onMouseUp(e,t){this.onUpCommon(e,t)}onUpCommon(e,t){if(this.dragging){this.dragging=!1,this.currentDragParams.onDragStop(e);const i={type:ct.EVENT_DRAG_STOPPED,target:t};this.eventService.dispatchEvent(i)}this.mouseStartEvent=null,this.startTarget=null,this.touchStart=null,this.touchLastTime=null,this.currentDragParams=null,this.dragEndFunctions.forEach(e=>e()),this.dragEndFunctions.length=0}};g([ue("mouseEventService")],Bo.prototype,"mouseEventService",2),g([ce],Bo.prototype,"removeAllListeners",1),Bo=g([he("dragService")],Bo);var Vo="ag-list-item-hovered",Ho=class extends st{constructor(e,t,i){super(),this.comp=e,this.virtualList=t,this.params=i,this.currentDragValue=null,this.lastHoveredListItem=null}postConstruct(){this.addManagedListener(this.params.eventSource,this.params.listItemDragStartEvent,this.listItemDragStart.bind(this)),this.addManagedListener(this.params.eventSource,this.params.listItemDragEndEvent,this.listItemDragEnd.bind(this)),this.createDropTarget(),this.createAutoScrollService()}listItemDragStart(e){this.currentDragValue=this.params.getCurrentDragValue(e),this.moveBlocked=this.params.isMoveBlocked(this.currentDragValue)}listItemDragEnd(){window.setTimeout(()=>{this.currentDragValue=null,this.moveBlocked=!1},10)}createDropTarget(){const e={isInterestedIn:e=>e===this.params.dragSourceType,getIconName:()=>this.moveBlocked?Br.ICON_PINNED:Br.ICON_MOVE,getContainer:()=>this.comp.getGui(),onDragging:e=>this.onDragging(e),onDragStop:()=>this.onDragStop(),onDragLeave:()=>this.onDragLeave()};this.dragAndDropService.addDropTarget(e)}createAutoScrollService(){const e=this.virtualList.getGui();this.autoScrollService=new Fo({scrollContainer:e,scrollAxis:"y",getVerticalPosition:()=>e.scrollTop,setVerticalPosition:t=>e.scrollTop=t})}onDragging(e){if(!this.currentDragValue||this.moveBlocked)return;const t=this.getListDragItem(e),i=this.virtualList.getComponentAt(t.rowIndex);if(!i)return;const n=i.getGui().parentElement;this.lastHoveredListItem&&this.lastHoveredListItem.rowIndex===t.rowIndex&&this.lastHoveredListItem.position===t.position||(this.autoScrollService.check(e.event),this.clearHoveredItems(),this.lastHoveredListItem=t,nn(n,Vo),nn(n,`ag-item-highlight-${t.position}`))}getListDragItem(e){const t=this.virtualList.getGui(),i=parseFloat(window.getComputedStyle(t).paddingTop),n=this.virtualList.getRowHeight(),s=this.virtualList.getScrollTop(),r=Math.max(0,(e.y-i+s)/n),o=this.params.getNumRows(this.comp)-1,a=0|Math.min(o,r);return{rowIndex:a,position:Math.round(r)>r||r>o?"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(`.${Vo}`).forEach(e=>{[Vo,"ag-item-highlight-top","ag-item-highlight-bottom"].forEach(t=>{e.classList.remove(t)})}),this.lastHoveredListItem=null}};function Uo(e){const t=e;return null!=t&&null!=t.getFrameworkComponentInstance?t.getFrameworkComponentInstance():e}g([ue("dragAndDropService")],Ho.prototype,"dragAndDropService",2),g([le],Ho.prototype,"postConstruct",1);var zo=class{constructor(){this.detailGridInfoMap={},this.destroyCalled=!1}init(){switch(this.rowModel.getType()){case"clientSide":this.clientSideRowModel=this.rowModel;break;case"infinite":this.infiniteRowModel=this.rowModel;break;case"serverSide":this.serverSideRowModel=this.rowModel}this.ctrlsService.whenReady(e=>{this.gridBodyCtrl=e.gridBodyCtrl})}__getAlignedGridService(){return this.alignedGridsService}getGridId(){return this.context.getGridId()}addDetailGridInfo(e,t){this.detailGridInfoMap[e]=t}removeDetailGridInfo(e){delete this.detailGridInfoMap[e]}getDetailGridInfo(e){return this.detailGridInfoMap[e]}forEachDetailGridInfo(e){let t=0;P(this.detailGridInfoMap,(i,n)=>{b(n)&&(e(n,t),t++)})}getDataAsCsv(e){if(re.__assertRegistered("@ag-grid-community/csv-export","api.getDataAsCsv",this.context.getGridId()))return this.csvCreator.getDataAsCsv(e)}exportDataAsCsv(e){re.__assertRegistered("@ag-grid-community/csv-export","api.exportDataAsCsv",this.context.getGridId())&&this.csvCreator.exportDataAsCsv(e)}assertNotExcelMultiSheet(e,t){return!(!re.__assertRegistered("@ag-grid-enterprise/excel-export","api."+e,this.context.getGridId())||1===this.excelCreator.getFactoryMode()&&(console.warn("AG Grid: The Excel Exporter is currently on Multi Sheet mode. End that operation by calling 'api.getMultipleSheetAsExcel()' or 'api.exportMultipleSheetsAsExcel()'"),1))}getDataAsExcel(e){if(this.assertNotExcelMultiSheet("getDataAsExcel",e))return this.excelCreator.getDataAsExcel(e)}exportDataAsExcel(e){this.assertNotExcelMultiSheet("exportDataAsExcel",e)&&this.excelCreator.exportDataAsExcel(e)}getSheetDataForExcel(e){if(re.__assertRegistered("@ag-grid-enterprise/excel-export","api.getSheetDataForExcel",this.context.getGridId()))return this.excelCreator.setFactoryMode(1),this.excelCreator.getSheetDataForExcel(e)}getMultipleSheetsAsExcel(e){if(re.__assertRegistered("@ag-grid-enterprise/excel-export","api.getMultipleSheetsAsExcel",this.context.getGridId()))return this.excelCreator.getMultipleSheetsAsExcel(e)}exportMultipleSheetsAsExcel(e){re.__assertRegistered("@ag-grid-enterprise/excel-export","api.exportMultipleSheetsAsExcel",this.context.getGridId())&&this.excelCreator.exportMultipleSheetsAsExcel(e)}setGridAriaProperty(e,t){if(!e)return;const i=this.ctrlsService.getGridBodyCtrl().getGui(),n=`aria-${e}`;null===t?i.removeAttribute(n):i.setAttribute(n,t)}logMissingRowModel(e,...t){console.error(`AG Grid: api.${e} can only be called when gridOptions.rowModelType is ${t.join(" or ")}`)}logDeprecation(e,t,i,n){z(`Since ${e} api.${t} is deprecated. Please use ${i} instead. ${null!=n?n:""}`)}getPinnedTopRowCount(){return this.pinnedRowModel.getPinnedTopRowCount()}getPinnedBottomRowCount(){return this.pinnedRowModel.getPinnedBottomRowCount()}getPinnedTopRow(e){return this.pinnedRowModel.getPinnedTopRow(e)}getPinnedBottomRow(e){return this.pinnedRowModel.getPinnedBottomRow(e)}expireValueCache(){this.valueCache.expire()}getVerticalPixelRange(){return this.gridBodyCtrl.getScrollFeature().getVScrollPosition()}getHorizontalPixelRange(){return this.gridBodyCtrl.getScrollFeature().getHScrollPosition()}refreshCells(e={}){this.frameworkOverrides.wrapIncoming(()=>this.rowRenderer.refreshCells(e))}flashCells(e={}){const t=e=>z(`Since v31.1 api.flashCells parameter '${e}Delay' is deprecated. Please use '${e}Duration' instead.`);b(e.fadeDelay)&&t("fade"),b(e.flashDelay)&&t("flash"),this.frameworkOverrides.wrapIncoming(()=>this.rowRenderer.flashCells(e))}redrawRows(e={}){const t=e?e.rowNodes:void 0;this.frameworkOverrides.wrapIncoming(()=>this.rowRenderer.redrawRows(t))}refreshHeader(){this.frameworkOverrides.wrapIncoming(()=>this.ctrlsService.getHeaderRowContainerCtrls().forEach(e=>e.refresh()))}isAnyFilterPresent(){return this.filterManager.isAnyFilterPresent()}isColumnFilterPresent(){return this.filterManager.isColumnFilterPresent()||this.filterManager.isAggregateFilterPresent()}isQuickFilterPresent(){return this.filterManager.isQuickFilterPresent()}getModel(){return z("Since v31.1 getModel() is deprecated. Please use the appropriate grid API methods instead."),this.rowModel}setRowNodeExpanded(e,t,i,n){this.expansionService.setRowNodeExpanded(e,t,i,n)}onGroupExpandedOrCollapsed(){C(this.clientSideRowModel)?this.logMissingRowModel("onGroupExpandedOrCollapsed","clientSide"):this.expansionService.onGroupExpandedOrCollapsed()}refreshClientSideRowModel(e){C(this.clientSideRowModel)?this.logMissingRowModel("refreshClientSideRowModel","clientSide"):this.clientSideRowModel.refreshModel(e)}isAnimationFrameQueueEmpty(){return this.animationFrameService.isQueueEmpty()}flushAllAnimationFrames(){this.animationFrameService.flushAllFrames()}getRowNode(e){return this.rowModel.getRowNode(e)}getSizesForCurrentTheme(){return{rowHeight:this.gos.getRowHeightAsNumber(),headerHeight:this.columnModel.getHeaderHeight()}}expandAll(){this.clientSideRowModel||this.serverSideRowModel?this.expansionService.expandAll(!0):this.logMissingRowModel("expandAll","clientSide","serverSide")}collapseAll(){this.clientSideRowModel||this.serverSideRowModel?this.expansionService.expandAll(!1):this.logMissingRowModel("collapseAll","clientSide","serverSide")}addRenderedRowListener(e,t,i){this.rowRenderer.addRenderedRowListener(e,t,i)}getQuickFilter(){return this.gos.get("quickFilterText")}getAdvancedFilterModel(){return re.__assertRegistered("@ag-grid-enterprise/advanced-filter","api.getAdvancedFilterModel",this.context.getGridId())?this.filterManager.getAdvancedFilterModel():null}setAdvancedFilterModel(e){this.filterManager.setAdvancedFilterModel(e)}showAdvancedFilterBuilder(){re.__assertRegistered("@ag-grid-enterprise/advanced-filter","api.setAdvancedFilterModel",this.context.getGridId())&&this.filterManager.showAdvancedFilterBuilder("api")}setNodesSelected(e){if(!e.nodes.every(e=>e.rowPinned?(console.warn("AG Grid: cannot select pinned rows"),!1):void 0!==e.id||(console.warn("AG Grid: cannot select node until id for node is known"),!1)))return;const{nodes:t,source:i,newValue:n}=e,s=t;this.selectionService.setNodesSelected({nodes:s,source:null!=i?i:"api",newValue:n})}selectAll(e="apiSelectAll"){this.selectionService.selectAllRowNodes({source:e})}deselectAll(e="apiSelectAll"){this.selectionService.deselectAllRowNodes({source:e})}selectAllFiltered(e="apiSelectAllFiltered"){this.selectionService.selectAllRowNodes({source:e,justFiltered:!0})}deselectAllFiltered(e="apiSelectAllFiltered"){this.selectionService.deselectAllRowNodes({source:e,justFiltered:!0})}getServerSideSelectionState(){return C(this.serverSideRowModel)?(this.logMissingRowModel("getServerSideSelectionState","serverSide"),null):this.selectionService.getSelectionState()}setServerSideSelectionState(e){C(this.serverSideRowModel)?this.logMissingRowModel("setServerSideSelectionState","serverSide"):this.selectionService.setSelectionState(e,"api")}selectAllOnCurrentPage(e="apiSelectAllCurrentPage"){this.selectionService.selectAllRowNodes({source:e,justCurrentPage:!0})}deselectAllOnCurrentPage(e="apiSelectAllCurrentPage"){this.selectionService.deselectAllRowNodes({source:e,justCurrentPage:!0})}showLoadingOverlay(){this.overlayService.showLoadingOverlay()}showNoRowsOverlay(){this.overlayService.showNoRowsOverlay()}hideOverlay(){this.overlayService.hideOverlay()}getSelectedNodes(){return this.selectionService.getSelectedNodes()}getSelectedRows(){return this.selectionService.getSelectedRows()}getBestCostNodeSelection(){if(!C(this.clientSideRowModel))return this.selectionService.getBestCostNodeSelection();this.logMissingRowModel("getBestCostNodeSelection","clientSide")}getRenderedNodes(){return this.rowRenderer.getRenderedNodes()}ensureColumnVisible(e,t="auto"){this.frameworkOverrides.wrapIncoming(()=>this.gridBodyCtrl.getScrollFeature().ensureColumnVisible(e,t),"ensureVisible")}ensureIndexVisible(e,t){this.frameworkOverrides.wrapIncoming(()=>this.gridBodyCtrl.getScrollFeature().ensureIndexVisible(e,t),"ensureVisible")}ensureNodeVisible(e,t=null){this.frameworkOverrides.wrapIncoming(()=>this.gridBodyCtrl.getScrollFeature().ensureNodeVisible(e,t),"ensureVisible")}forEachLeafNode(e){C(this.clientSideRowModel)?this.logMissingRowModel("forEachLeafNode","clientSide"):this.clientSideRowModel.forEachLeafNode(e)}forEachNode(e,t){this.rowModel.forEachNode(e,t)}forEachNodeAfterFilter(e){C(this.clientSideRowModel)?this.logMissingRowModel("forEachNodeAfterFilter","clientSide"):this.clientSideRowModel.forEachNodeAfterFilter(e)}forEachNodeAfterFilterAndSort(e){C(this.clientSideRowModel)?this.logMissingRowModel("forEachNodeAfterFilterAndSort","clientSide"):this.clientSideRowModel.forEachNodeAfterFilterAndSort(e)}getFilterInstance(e,t){return z("'getFilterInstance' is deprecated. To get/set individual filter models, use 'getColumnFilterModel' or 'setColumnFilterModel' instead. To get hold of the filter instance, use 'getColumnFilterInstance' which returns the instance asynchronously."),this.filterManager.getFilterInstance(e,t)}getColumnFilterInstance(e){return this.filterManager.getColumnFilterInstance(e)}destroyFilter(e){const t=this.columnModel.getPrimaryColumn(e);if(t)return this.filterManager.destroyFilter(t,"api")}getStatusPanel(e){if(re.__assertRegistered("@ag-grid-enterprise/status-bar","api.getStatusPanel",this.context.getGridId()))return Uo(this.statusBarService.getStatusPanel(e))}getColumnDef(e){const t=this.columnModel.getPrimaryColumn(e);return t?t.getColDef():null}getColumnDefs(){return this.columnModel.getColumnDefs()}onFilterChanged(e="api"){this.filterManager.onFilterChanged({source:e})}onSortChanged(){this.sortController.onSortChanged("api")}setFilterModel(e){this.frameworkOverrides.wrapIncoming(()=>this.filterManager.setFilterModel(e))}getFilterModel(){return this.filterManager.getFilterModel()}getColumnFilterModel(e){return this.filterManager.getColumnFilterModel(e)}setColumnFilterModel(e,t){return this.filterManager.setColumnFilterModel(e,t)}getFocusedCell(){return this.focusService.getFocusedCell()}clearFocusedCell(){return this.focusService.clearFocusedCell()}setFocusedCell(e,t,i){this.focusService.setFocusedCell({rowIndex:e,column:t,rowPinned:i,forceBrowserFocus:!0})}addRowDropZone(e){this.gridBodyCtrl.getRowDragFeature().addRowDropZone(e)}removeRowDropZone(e){const t=this.dragAndDropService.findExternalZone(e);t&&this.dragAndDropService.removeDropTarget(t)}getRowDropZoneParams(e){return this.gridBodyCtrl.getRowDragFeature().getRowDropZone(e)}assertSideBarLoaded(e){return re.__assertRegistered("@ag-grid-enterprise/side-bar","api."+e,this.context.getGridId())}isSideBarVisible(){return this.assertSideBarLoaded("isSideBarVisible")&&this.sideBarService.getSideBarComp().isDisplayed()}setSideBarVisible(e){this.assertSideBarLoaded("setSideBarVisible")&&this.sideBarService.getSideBarComp().setDisplayed(e)}setSideBarPosition(e){this.assertSideBarLoaded("setSideBarPosition")&&this.sideBarService.getSideBarComp().setSideBarPosition(e)}openToolPanel(e){this.assertSideBarLoaded("openToolPanel")&&this.sideBarService.getSideBarComp().openToolPanel(e,"api")}closeToolPanel(){this.assertSideBarLoaded("closeToolPanel")&&this.sideBarService.getSideBarComp().close("api")}getOpenedToolPanel(){return this.assertSideBarLoaded("getOpenedToolPanel")?this.sideBarService.getSideBarComp().openedItem():null}refreshToolPanel(){this.assertSideBarLoaded("refreshToolPanel")&&this.sideBarService.getSideBarComp().refresh()}isToolPanelShowing(){return this.assertSideBarLoaded("isToolPanelShowing")&&this.sideBarService.getSideBarComp().isToolPanelShowing()}getToolPanelInstance(e){if(this.assertSideBarLoaded("getToolPanelInstance"))return Uo(this.sideBarService.getSideBarComp().getToolPanelInstance(e))}getSideBar(){if(this.assertSideBarLoaded("getSideBar"))return this.sideBarService.getSideBarComp().getDef()}resetRowHeights(){if(b(this.clientSideRowModel)){if(this.columnModel.isAutoRowHeightActive())return void console.warn("AG Grid: calling gridApi.resetRowHeights() makes no sense when using Auto Row Height.");this.clientSideRowModel.resetRowHeights()}}setRowCount(e,t){if(this.serverSideRowModel)return this.columnModel.isRowGroupEmpty()?void this.serverSideRowModel.setRowCount(e,t):void console.error("AG Grid: setRowCount cannot be used while using row grouping.");this.infiniteRowModel?this.infiniteRowModel.setRowCount(e,t):this.logMissingRowModel("setRowCount","infinite","serverSide")}onRowHeightChanged(){this.clientSideRowModel?this.clientSideRowModel.onRowHeightChanged():this.serverSideRowModel&&this.serverSideRowModel.onRowHeightChanged()}getValue(e,t){return this.logDeprecation("31.3","getValue","getCellValue"),this.getCellValue({colKey:e,rowNode:t})}getCellValue(e){var t;const{colKey:i,rowNode:n,useFormatter:s}=e;let r=null!=(t=this.columnModel.getPrimaryColumn(i))?t:this.columnModel.getGridColumn(i);if(C(r))return null;const o=this.valueService.getValue(r,n);if(s){const e=this.valueService.formatValue(r,n,o);return null!=e?e:bt(o,!0)}return o}addEventListener(e,t){this.apiEventService.addEventListener(e,t)}addGlobalListener(e){this.apiEventService.addGlobalListener(e)}removeEventListener(e,t){this.apiEventService.removeEventListener(e,t)}removeGlobalListener(e){this.apiEventService.removeGlobalListener(e)}dispatchEvent(e){this.eventService.dispatchEvent(e)}destroy(){var e;const t=`See ${this.frameworkOverrides.getDocLink("grid-lifecycle/#grid-pre-destroyed")}`;if(this.destroyCalled)return;const i={type:ct.EVENT_GRID_PRE_DESTROYED,state:this.getState()};this.dispatchEvent(i),this.destroyCalled=!0,null==(e=this.ctrlsService.get("gridCtrl"))||e.destroyGridUi(),this.context.destroy(),this.detailGridInfoMap={},G(this,["isDestroyed"],t)}isDestroyed(){return this.destroyCalled}resetQuickFilter(){this.filterManager.resetQuickFilterCache()}getCellRanges(){return this.rangeService?this.rangeService.getCellRanges():(re.__assertRegistered("@ag-grid-enterprise/range-selection","api.getCellRanges",this.context.getGridId()),null)}addCellRange(e){this.rangeService?this.rangeService.addCellRange(e):re.__assertRegistered("@ag-grid-enterprise/range-selection","api.addCellRange",this.context.getGridId())}clearRangeSelection(){this.rangeService&&this.rangeService.removeAllCellRanges(),re.__assertRegistered("@ag-grid-enterprise/range-selection","gridApi.clearRangeSelection",this.context.getGridId())}undoCellEditing(){this.undoRedoService.undo("api")}redoCellEditing(){this.undoRedoService.redo("api")}getCurrentUndoSize(){return this.undoRedoService.getCurrentUndoStackSize()}getCurrentRedoSize(){return this.undoRedoService.getCurrentRedoStackSize()}assertChart(e,t){if(re.__assertRegistered("@ag-grid-enterprise/charts","api."+e,this.context.getGridId()))return this.frameworkOverrides.wrapIncoming(()=>t())}getChartModels(){return this.assertChart("getChartModels",()=>this.chartService.getChartModels())}getChartRef(e){return this.assertChart("getChartRef",()=>this.chartService.getChartRef(e))}getChartImageDataURL(e){return this.assertChart("getChartImageDataURL",()=>this.chartService.getChartImageDataURL(e))}downloadChart(e){return this.assertChart("downloadChart",()=>this.chartService.downloadChart(e))}openChartToolPanel(e){return this.assertChart("openChartToolPanel",()=>this.chartService.openChartToolPanel(e))}closeChartToolPanel(e){return this.assertChart("closeChartToolPanel",()=>this.chartService.closeChartToolPanel(e.chartId))}createRangeChart(e){return this.assertChart("createRangeChart",()=>this.chartService.createRangeChart(e))}createPivotChart(e){return this.assertChart("createPivotChart",()=>this.chartService.createPivotChart(e))}createCrossFilterChart(e){return this.assertChart("createCrossFilterChart",()=>this.chartService.createCrossFilterChart(e))}updateChart(e){return this.assertChart("updateChart",()=>this.chartService.updateChart(e))}restoreChart(e,t){return this.assertChart("restoreChart",()=>this.chartService.restoreChart(e,t))}assertClipboard(e,t){re.__assertRegistered("@ag-grid-enterprise/clipboard","api"+e,this.context.getGridId())&&t()}copyToClipboard(e){this.assertClipboard("copyToClipboard",()=>this.clipboardService.copyToClipboard(e))}cutToClipboard(e){this.assertClipboard("cutToClipboard",()=>this.clipboardService.cutToClipboard(e))}copySelectedRowsToClipboard(e){this.assertClipboard("copySelectedRowsToClipboard",()=>this.clipboardService.copySelectedRowsToClipboard(e))}copySelectedRangeToClipboard(e){this.assertClipboard("copySelectedRangeToClipboard",()=>this.clipboardService.copySelectedRangeToClipboard(e))}copySelectedRangeDown(){this.assertClipboard("copySelectedRangeDown",()=>this.clipboardService.copyRangeDown())}pasteFromClipboard(){this.assertClipboard("pasteFromClipboard",()=>this.clipboardService.pasteFromClipboard())}showColumnMenuAfterButtonClick(e,t){z("'showColumnMenuAfterButtonClick' is deprecated. Use 'IHeaderParams.showColumnMenu' within a header component, or 'api.showColumnMenu' elsewhere.");const i=this.columnModel.getGridColumn(e);this.menuService.showColumnMenu({column:i,buttonElement:t,positionBy:"button"})}showColumnMenuAfterMouseClick(e,t){z("'showColumnMenuAfterMouseClick' is deprecated. Use 'IHeaderParams.showColumnMenuAfterMouseClick' within a header component, or 'api.showColumnMenu' elsewhere.");let i=this.columnModel.getGridColumn(e);i||(i=this.columnModel.getPrimaryColumn(e)),i?this.menuService.showColumnMenu({column:i,mouseEvent:t,positionBy:"mouse"}):console.error(`AG Grid: column '${e}' not found`)}showContextMenu(e){const{rowNode:t,column:i,value:n,x:s,y:r}=e||{};let{x:o,y:a}=this.menuService.getContextMenuPosition(t,i);null!=s&&(o=s),null!=r&&(a=r),this.menuService.showContextMenu({mouseEvent:new MouseEvent("mousedown",{clientX:o,clientY:a}),rowNode:t,column:i,value:n})}showColumnChooser(e){this.menuService.showColumnChooser({chooserParams:e})}showColumnFilter(e){const t=this.columnModel.getGridColumn(e);t?this.menuService.showFilterMenu({column:t,containerType:"columnFilter",positionBy:"auto"}):console.error(`AG Grid: column '${e}' not found`)}showColumnMenu(e){const t=this.columnModel.getGridColumn(e);t?this.menuService.showColumnMenu({column:t,positionBy:"auto"}):console.error(`AG Grid: column '${e}' not found`)}hidePopupMenu(){this.menuService.hidePopupMenu()}hideColumnChooser(){this.menuService.hideColumnChooser()}tabToNextCell(e){return this.navigationService.tabToNextCell(!1,e)}tabToPreviousCell(e){return this.navigationService.tabToNextCell(!0,e)}getCellRendererInstances(e={}){return this.rowRenderer.getCellRendererInstances(e).map(Uo)}getCellEditorInstances(e={}){return this.rowRenderer.getCellEditorInstances(e).map(Uo)}getEditingCells(){return this.rowRenderer.getEditingCells()}stopEditing(e=!1){this.rowRenderer.stopEditing(e)}startEditingCell(e){const t=this.columnModel.getGridColumn(e.colKey);if(!t)return void console.warn(`AG Grid: no column found for ${e.colKey}`);const i={rowIndex:e.rowIndex,rowPinned:e.rowPinned||null,column:t};null==e.rowPinned&&this.ensureIndexVisible(e.rowIndex),this.ensureColumnVisible(e.colKey);const n=this.navigationService.getCellByPosition(i);n&&(this.focusService.isCellFocused(i)||this.focusService.setFocusedCell(i),n.startRowOrCellEdit(e.key))}addAggFunc(e,t){this.logDeprecation("v31.1","addAggFunc(key, func)","addAggFuncs({ key: func })"),this.aggFuncService&&this.aggFuncService.addAggFuncs({key:t})}addAggFuncs(e){this.aggFuncService&&this.aggFuncService.addAggFuncs(e)}clearAggFuncs(){this.aggFuncService&&this.aggFuncService.clear()}applyServerSideTransaction(e){if(this.serverSideTransactionManager)return this.serverSideTransactionManager.applyTransaction(e);this.logMissingRowModel("applyServerSideTransaction","serverSide")}applyServerSideTransactionAsync(e,t){if(this.serverSideTransactionManager)return this.serverSideTransactionManager.applyTransactionAsync(e,t);this.logMissingRowModel("applyServerSideTransactionAsync","serverSide")}applyServerSideRowData(e){var t,i;const n=null!=(t=e.startRow)?t:0,s=null!=(i=e.route)?i:[];n<0?console.warn(`AG Grid: invalid value ${e.startRow} for startRow, the value should be >= 0`):this.serverSideRowModel?this.serverSideRowModel.applyRowData(e.successParams,n,s):this.logMissingRowModel("setServerSideDatasource","serverSide")}retryServerSideLoads(){this.serverSideRowModel?this.serverSideRowModel.retryLoads():this.logMissingRowModel("retryServerSideLoads","serverSide")}flushServerSideAsyncTransactions(){if(this.serverSideTransactionManager)return this.serverSideTransactionManager.flushAsyncTransactions();this.logMissingRowModel("flushServerSideAsyncTransactions","serverSide")}applyTransaction(e){if(this.clientSideRowModel)return this.frameworkOverrides.wrapIncoming(()=>this.clientSideRowModel.updateRowData(e));this.logMissingRowModel("applyTransaction","clientSide")}applyTransactionAsync(e,t){this.clientSideRowModel?this.frameworkOverrides.wrapIncoming(()=>this.clientSideRowModel.batchUpdateRowData(e,t)):this.logMissingRowModel("applyTransactionAsync","clientSide")}flushAsyncTransactions(){this.clientSideRowModel?this.frameworkOverrides.wrapIncoming(()=>this.clientSideRowModel.flushAsyncTransactions()):this.logMissingRowModel("flushAsyncTransactions","clientSide")}refreshInfiniteCache(){this.infiniteRowModel?this.infiniteRowModel.refreshCache():this.logMissingRowModel("refreshInfiniteCache","infinite")}purgeInfiniteCache(){this.infiniteRowModel?this.infiniteRowModel.purgeCache():this.logMissingRowModel("purgeInfiniteCache","infinite")}refreshServerSide(e){this.serverSideRowModel?this.serverSideRowModel.refreshStore(e):this.logMissingRowModel("refreshServerSide","serverSide")}getServerSideGroupLevelState(){return this.serverSideRowModel?this.serverSideRowModel.getStoreState():(this.logMissingRowModel("getServerSideGroupLevelState","serverSide"),[])}getInfiniteRowCount(){if(this.infiniteRowModel)return this.infiniteRowModel.getRowCount();this.logMissingRowModel("getInfiniteRowCount","infinite")}isLastRowIndexKnown(){if(this.infiniteRowModel)return this.infiniteRowModel.isLastRowIndexKnown();this.logMissingRowModel("isLastRowIndexKnown","infinite")}getCacheBlockState(){return this.rowNodeBlockLoader.getBlockState()}getFirstDisplayedRow(){return this.logDeprecation("v31.1","getFirstDisplayedRow","getFirstDisplayedRowIndex"),this.getFirstDisplayedRowIndex()}getFirstDisplayedRowIndex(){return this.rowRenderer.getFirstVirtualRenderedRow()}getLastDisplayedRow(){return this.logDeprecation("v31.1","getLastDisplayedRow","getLastDisplayedRowIndex"),this.getLastDisplayedRowIndex()}getLastDisplayedRowIndex(){return this.rowRenderer.getLastVirtualRenderedRow()}getDisplayedRowAtIndex(e){return this.rowModel.getRow(e)}getDisplayedRowCount(){return this.rowModel.getRowCount()}paginationIsLastPageFound(){return this.paginationProxy.isLastPageFound()}paginationGetPageSize(){return this.paginationProxy.getPageSize()}paginationGetCurrentPage(){return this.paginationProxy.getCurrentPage()}paginationGetTotalPages(){return this.paginationProxy.getTotalPages()}paginationGetRowCount(){return this.paginationProxy.getMasterRowCount()}paginationGoToNextPage(){this.paginationProxy.goToNextPage()}paginationGoToPreviousPage(){this.paginationProxy.goToPreviousPage()}paginationGoToFirstPage(){this.paginationProxy.goToFirstPage()}paginationGoToLastPage(){this.paginationProxy.goToLastPage()}paginationGoToPage(e){this.paginationProxy.goToPage(e)}sizeColumnsToFit(e){"number"==typeof e?this.columnModel.sizeColumnsToFit(e,"api"):this.gridBodyCtrl.sizeColumnsToFit(e)}setColumnGroupOpened(e,t){this.columnModel.setColumnGroupOpened(e,t,"api")}getColumnGroup(e,t){return this.columnModel.getColumnGroup(e,t)}getProvidedColumnGroup(e){return this.columnModel.getProvidedColumnGroup(e)}getDisplayNameForColumn(e,t){return this.columnModel.getDisplayNameForColumn(e,t)||""}getDisplayNameForColumnGroup(e,t){return this.columnModel.getDisplayNameForColumnGroup(e,t)||""}getColumn(e){return this.columnModel.getPrimaryColumn(e)}getColumns(){return this.columnModel.getAllPrimaryColumns()}applyColumnState(e){return this.columnModel.applyColumnState(e,"api")}getColumnState(){return this.columnModel.getColumnState()}resetColumnState(){this.columnModel.resetColumnState("api")}getColumnGroupState(){return this.columnModel.getColumnGroupState()}setColumnGroupState(e){this.columnModel.setColumnGroupState(e,"api")}resetColumnGroupState(){this.columnModel.resetColumnGroupState("api")}isPinning(){return this.columnModel.isPinningLeft()||this.columnModel.isPinningRight()}isPinningLeft(){return this.columnModel.isPinningLeft()}isPinningRight(){return this.columnModel.isPinningRight()}getDisplayedColAfter(e){return this.columnModel.getDisplayedColAfter(e)}getDisplayedColBefore(e){return this.columnModel.getDisplayedColBefore(e)}setColumnVisible(e,t){this.logDeprecation("v31.1","setColumnVisible(key,visible)","setColumnsVisible([key],visible)"),this.columnModel.setColumnsVisible([e],t,"api")}setColumnsVisible(e,t){this.columnModel.setColumnsVisible(e,t,"api")}setColumnPinned(e,t){this.logDeprecation("v31.1","setColumnPinned(key,pinned)","setColumnsPinned([key],pinned)"),this.columnModel.setColumnsPinned([e],t,"api")}setColumnsPinned(e,t){this.columnModel.setColumnsPinned(e,t,"api")}getAllGridColumns(){return this.columnModel.getAllGridColumns()}getDisplayedLeftColumns(){return this.columnModel.getDisplayedLeftColumns()}getDisplayedCenterColumns(){return this.columnModel.getDisplayedCenterColumns()}getDisplayedRightColumns(){return this.columnModel.getDisplayedRightColumns()}getAllDisplayedColumns(){return this.columnModel.getAllDisplayedColumns()}getAllDisplayedVirtualColumns(){return this.columnModel.getViewportColumns()}moveColumn(e,t){this.logDeprecation("v31.1","moveColumn(key, toIndex)","moveColumns([key], toIndex)"),this.columnModel.moveColumns([e],t,"api")}moveColumnByIndex(e,t){this.columnModel.moveColumnByIndex(e,t,"api")}moveColumns(e,t){this.columnModel.moveColumns(e,t,"api")}moveRowGroupColumn(e,t){this.columnModel.moveRowGroupColumn(e,t,"api")}setColumnAggFunc(e,t){this.columnModel.setColumnAggFunc(e,t,"api")}setColumnWidth(e,t,i=!0,n="api"){this.logDeprecation("v31.1","setColumnWidth(col, width)","setColumnWidths([{key: col, newWidth: width}])"),this.columnModel.setColumnWidths([{key:e,newWidth:t}],!1,i,n)}setColumnWidths(e,t=!0,i="api"){this.columnModel.setColumnWidths(e,!1,t,i)}isPivotMode(){return this.columnModel.isPivotMode()}getPivotResultColumn(e,t){return this.columnModel.getSecondaryPivotColumn(e,t)}setValueColumns(e){this.columnModel.setValueColumns(e,"api")}getValueColumns(){return this.columnModel.getValueColumns()}removeValueColumn(e){this.logDeprecation("v31.1","removeValueColumn(colKey)","removeValueColumns([colKey])"),this.columnModel.removeValueColumns([e],"api")}removeValueColumns(e){this.columnModel.removeValueColumns(e,"api")}addValueColumn(e){this.logDeprecation("v31.1","addValueColumn(colKey)","addValueColumns([colKey])"),this.columnModel.addValueColumns([e],"api")}addValueColumns(e){this.columnModel.addValueColumns(e,"api")}setRowGroupColumns(e){this.columnModel.setRowGroupColumns(e,"api")}removeRowGroupColumn(e){this.logDeprecation("v31.1","removeRowGroupColumn(colKey)","removeRowGroupColumns([colKey])"),this.columnModel.removeRowGroupColumns([e],"api")}removeRowGroupColumns(e){this.columnModel.removeRowGroupColumns(e,"api")}addRowGroupColumn(e){this.logDeprecation("v31.1","addRowGroupColumn(colKey)","addRowGroupColumns([colKey])"),this.columnModel.addRowGroupColumns([e],"api")}addRowGroupColumns(e){this.columnModel.addRowGroupColumns(e,"api")}getRowGroupColumns(){return this.columnModel.getRowGroupColumns()}setPivotColumns(e){this.columnModel.setPivotColumns(e,"api")}removePivotColumn(e){this.logDeprecation("v31.1","removePivotColumn(colKey)","removePivotColumns([colKey])"),this.columnModel.removePivotColumns([e],"api")}removePivotColumns(e){this.columnModel.removePivotColumns(e,"api")}addPivotColumn(e){this.logDeprecation("v31.1","addPivotColumn(colKey)","addPivotColumns([colKey])"),this.columnModel.addPivotColumns([e],"api")}addPivotColumns(e){this.columnModel.addPivotColumns(e,"api")}getPivotColumns(){return this.columnModel.getPivotColumns()}getLeftDisplayedColumnGroups(){return this.columnModel.getDisplayedTreeLeft()}getCenterDisplayedColumnGroups(){return this.columnModel.getDisplayedTreeCentre()}getRightDisplayedColumnGroups(){return this.columnModel.getDisplayedTreeRight()}getAllDisplayedColumnGroups(){return this.columnModel.getAllDisplayedTrees()}autoSizeColumn(e,t){return this.logDeprecation("v31.1","autoSizeColumn(key, skipHeader)","autoSizeColumns([key], skipHeader)"),this.columnModel.autoSizeColumns({columns:[e],skipHeader:t,source:"api"})}autoSizeColumns(e,t){this.columnModel.autoSizeColumns({columns:e,skipHeader:t,source:"api"})}autoSizeAllColumns(e){this.columnModel.autoSizeAllColumns("api",e)}setPivotResultColumns(e){this.columnModel.setSecondaryColumns(e,"api")}getPivotResultColumns(){return this.columnModel.getSecondaryColumns()}getState(){return this.stateService.getState()}getGridOption(e){return this.gos.get(e)}setGridOption(e,t){this.updateGridOptions({[e]:t})}updateGridOptions(e){this.gos.updateGridOptions({options:e})}__internalUpdateGridOptions(e,t){this.gos.updateGridOptions({options:e,force:t,source:"gridOptionsUpdated"})}deprecatedUpdateGridOption(e,t){z(`set${e.charAt(0).toUpperCase()}${e.slice(1,e.length)} is deprecated. Please use 'api.setGridOption('${e}', newValue)' or 'api.updateGridOptions({ ${e}: newValue })' instead.`),this.setGridOption(e,t)}setPivotMode(e){this.deprecatedUpdateGridOption("pivotMode",e)}setPinnedTopRowData(e){this.deprecatedUpdateGridOption("pinnedTopRowData",e)}setPinnedBottomRowData(e){this.deprecatedUpdateGridOption("pinnedBottomRowData",e)}setPopupParent(e){this.deprecatedUpdateGridOption("popupParent",e)}setSuppressModelUpdateAfterUpdateTransaction(e){this.deprecatedUpdateGridOption("suppressModelUpdateAfterUpdateTransaction",e)}setDataTypeDefinitions(e){this.deprecatedUpdateGridOption("dataTypeDefinitions",e)}setPagination(e){this.deprecatedUpdateGridOption("pagination",e)}paginationSetPageSize(e){this.deprecatedUpdateGridOption("paginationPageSize",e)}setSideBar(e){this.deprecatedUpdateGridOption("sideBar",e)}setSuppressClipboardPaste(e){this.deprecatedUpdateGridOption("suppressClipboardPaste",e)}setGroupRemoveSingleChildren(e){this.deprecatedUpdateGridOption("groupRemoveSingleChildren",e)}setGroupRemoveLowestSingleChildren(e){this.deprecatedUpdateGridOption("groupRemoveLowestSingleChildren",e)}setGroupDisplayType(e){this.deprecatedUpdateGridOption("groupDisplayType",e)}setGroupIncludeFooter(e){this.deprecatedUpdateGridOption("groupIncludeFooter",e)}setGroupIncludeTotalFooter(e){this.deprecatedUpdateGridOption("groupIncludeTotalFooter",e)}setRowClass(e){this.deprecatedUpdateGridOption("rowClass",e)}setDeltaSort(e){this.deprecatedUpdateGridOption("deltaSort",e)}setSuppressRowDrag(e){this.deprecatedUpdateGridOption("suppressRowDrag",e)}setSuppressMoveWhenRowDragging(e){this.deprecatedUpdateGridOption("suppressMoveWhenRowDragging",e)}setSuppressRowClickSelection(e){this.deprecatedUpdateGridOption("suppressRowClickSelection",e)}setEnableAdvancedFilter(e){this.deprecatedUpdateGridOption("enableAdvancedFilter",e)}setIncludeHiddenColumnsInAdvancedFilter(e){this.deprecatedUpdateGridOption("includeHiddenColumnsInAdvancedFilter",e)}setAdvancedFilterParent(e){this.deprecatedUpdateGridOption("advancedFilterParent",e)}setAdvancedFilterBuilderParams(e){this.deprecatedUpdateGridOption("advancedFilterBuilderParams",e)}setQuickFilter(e){z("setQuickFilter is deprecated. Please use 'api.setGridOption('quickFilterText', newValue)' or 'api.updateGridOptions({ quickFilterText: newValue })' instead."),this.gos.updateGridOptions({options:{quickFilterText:e}})}setExcludeHiddenColumnsFromQuickFilter(e){this.deprecatedUpdateGridOption("includeHiddenColumnsInQuickFilter",!e)}setIncludeHiddenColumnsInQuickFilter(e){this.deprecatedUpdateGridOption("includeHiddenColumnsInQuickFilter",e)}setQuickFilterParser(e){this.deprecatedUpdateGridOption("quickFilterParser",e)}setQuickFilterMatcher(e){this.deprecatedUpdateGridOption("quickFilterMatcher",e)}setAlwaysShowHorizontalScroll(e){this.deprecatedUpdateGridOption("alwaysShowHorizontalScroll",e)}setAlwaysShowVerticalScroll(e){this.deprecatedUpdateGridOption("alwaysShowVerticalScroll",e)}setFunctionsReadOnly(e){this.deprecatedUpdateGridOption("functionsReadOnly",e)}setColumnDefs(e,t="api"){z("setColumnDefs is deprecated. Please use 'api.setGridOption('columnDefs', newValue)' or 'api.updateGridOptions({ columnDefs: newValue })' instead."),this.gos.updateGridOptions({options:{columnDefs:e},source:t})}setAutoGroupColumnDef(e,t="api"){z("setAutoGroupColumnDef is deprecated. Please use 'api.setGridOption('autoGroupColumnDef', newValue)' or 'api.updateGridOptions({ autoGroupColumnDef: newValue })' instead."),this.gos.updateGridOptions({options:{autoGroupColumnDef:e},source:t})}setDefaultColDef(e,t="api"){z("setDefaultColDef is deprecated. Please use 'api.setGridOption('defaultColDef', newValue)' or 'api.updateGridOptions({ defaultColDef: newValue })' instead."),this.gos.updateGridOptions({options:{defaultColDef:e},source:t})}setColumnTypes(e,t="api"){z("setColumnTypes is deprecated. Please use 'api.setGridOption('columnTypes', newValue)' or 'api.updateGridOptions({ columnTypes: newValue })' instead."),this.gos.updateGridOptions({options:{columnTypes:e},source:t})}setTreeData(e){this.deprecatedUpdateGridOption("treeData",e)}setServerSideDatasource(e){this.deprecatedUpdateGridOption("serverSideDatasource",e)}setCacheBlockSize(e){this.deprecatedUpdateGridOption("cacheBlockSize",e)}setDatasource(e){this.deprecatedUpdateGridOption("datasource",e)}setViewportDatasource(e){this.deprecatedUpdateGridOption("viewportDatasource",e)}setRowData(e){this.deprecatedUpdateGridOption("rowData",e)}setEnableCellTextSelection(e){this.deprecatedUpdateGridOption("enableCellTextSelection",e)}setHeaderHeight(e){this.deprecatedUpdateGridOption("headerHeight",e)}setDomLayout(e){this.deprecatedUpdateGridOption("domLayout",e)}setFillHandleDirection(e){this.deprecatedUpdateGridOption("fillHandleDirection",e)}setGroupHeaderHeight(e){this.deprecatedUpdateGridOption("groupHeaderHeight",e)}setFloatingFiltersHeight(e){this.deprecatedUpdateGridOption("floatingFiltersHeight",e)}setPivotHeaderHeight(e){this.deprecatedUpdateGridOption("pivotHeaderHeight",e)}setPivotGroupHeaderHeight(e){this.deprecatedUpdateGridOption("pivotGroupHeaderHeight",e)}setAnimateRows(e){this.deprecatedUpdateGridOption("animateRows",e)}setIsExternalFilterPresent(e){this.deprecatedUpdateGridOption("isExternalFilterPresent",e)}setDoesExternalFilterPass(e){this.deprecatedUpdateGridOption("doesExternalFilterPass",e)}setNavigateToNextCell(e){this.deprecatedUpdateGridOption("navigateToNextCell",e)}setTabToNextCell(e){this.deprecatedUpdateGridOption("tabToNextCell",e)}setTabToNextHeader(e){this.deprecatedUpdateGridOption("tabToNextHeader",e)}setNavigateToNextHeader(e){this.deprecatedUpdateGridOption("navigateToNextHeader",e)}setRowGroupPanelShow(e){this.deprecatedUpdateGridOption("rowGroupPanelShow",e)}setGetGroupRowAgg(e){this.deprecatedUpdateGridOption("getGroupRowAgg",e)}setGetBusinessKeyForNode(e){this.deprecatedUpdateGridOption("getBusinessKeyForNode",e)}setGetChildCount(e){this.deprecatedUpdateGridOption("getChildCount",e)}setProcessRowPostCreate(e){this.deprecatedUpdateGridOption("processRowPostCreate",e)}setGetRowId(e){z("getRowId is a static property and can no longer be updated.")}setGetRowClass(e){this.deprecatedUpdateGridOption("getRowClass",e)}setIsFullWidthRow(e){this.deprecatedUpdateGridOption("isFullWidthRow",e)}setIsRowSelectable(e){this.deprecatedUpdateGridOption("isRowSelectable",e)}setIsRowMaster(e){this.deprecatedUpdateGridOption("isRowMaster",e)}setPostSortRows(e){this.deprecatedUpdateGridOption("postSortRows",e)}setGetDocument(e){this.deprecatedUpdateGridOption("getDocument",e)}setGetContextMenuItems(e){this.deprecatedUpdateGridOption("getContextMenuItems",e)}setGetMainMenuItems(e){this.deprecatedUpdateGridOption("getMainMenuItems",e)}setProcessCellForClipboard(e){this.deprecatedUpdateGridOption("processCellForClipboard",e)}setSendToClipboard(e){this.deprecatedUpdateGridOption("sendToClipboard",e)}setProcessCellFromClipboard(e){this.deprecatedUpdateGridOption("processCellFromClipboard",e)}setProcessPivotResultColDef(e){this.deprecatedUpdateGridOption("processPivotResultColDef",e)}setProcessPivotResultColGroupDef(e){this.deprecatedUpdateGridOption("processPivotResultColGroupDef",e)}setPostProcessPopup(e){this.deprecatedUpdateGridOption("postProcessPopup",e)}setInitialGroupOrderComparator(e){this.deprecatedUpdateGridOption("initialGroupOrderComparator",e)}setGetChartToolbarItems(e){this.deprecatedUpdateGridOption("getChartToolbarItems",e)}setPaginationNumberFormatter(e){this.deprecatedUpdateGridOption("paginationNumberFormatter",e)}setGetServerSideGroupLevelParams(e){this.deprecatedUpdateGridOption("getServerSideGroupLevelParams",e)}setIsServerSideGroupOpenByDefault(e){this.deprecatedUpdateGridOption("isServerSideGroupOpenByDefault",e)}setIsApplyServerSideTransaction(e){this.deprecatedUpdateGridOption("isApplyServerSideTransaction",e)}setIsServerSideGroup(e){this.deprecatedUpdateGridOption("isServerSideGroup",e)}setGetServerSideGroupKey(e){this.deprecatedUpdateGridOption("getServerSideGroupKey",e)}setGetRowStyle(e){this.deprecatedUpdateGridOption("getRowStyle",e)}setGetRowHeight(e){this.deprecatedUpdateGridOption("getRowHeight",e)}};g([ue("rowRenderer")],zo.prototype,"rowRenderer",2),g([ue("navigationService")],zo.prototype,"navigationService",2),g([ue("filterManager")],zo.prototype,"filterManager",2),g([ue("columnModel")],zo.prototype,"columnModel",2),g([ue("selectionService")],zo.prototype,"selectionService",2),g([ue("gridOptionsService")],zo.prototype,"gos",2),g([ue("valueService")],zo.prototype,"valueService",2),g([ue("alignedGridsService")],zo.prototype,"alignedGridsService",2),g([ue("eventService")],zo.prototype,"eventService",2),g([ue("pinnedRowModel")],zo.prototype,"pinnedRowModel",2),g([ue("context")],zo.prototype,"context",2),g([ue("rowModel")],zo.prototype,"rowModel",2),g([ue("sortController")],zo.prototype,"sortController",2),g([ue("paginationProxy")],zo.prototype,"paginationProxy",2),g([ue("focusService")],zo.prototype,"focusService",2),g([ue("dragAndDropService")],zo.prototype,"dragAndDropService",2),g([ue("menuService")],zo.prototype,"menuService",2),g([ue("valueCache")],zo.prototype,"valueCache",2),g([ue("animationFrameService")],zo.prototype,"animationFrameService",2),g([ue("ctrlsService")],zo.prototype,"ctrlsService",2),g([ue("overlayService")],zo.prototype,"overlayService",2),g([ue("stateService")],zo.prototype,"stateService",2),g([ue("expansionService")],zo.prototype,"expansionService",2),g([ue("apiEventService")],zo.prototype,"apiEventService",2),g([ue("frameworkOverrides")],zo.prototype,"frameworkOverrides",2),g([ue("undoRedoService")],zo.prototype,"undoRedoService",2),g([ue("rowNodeBlockLoader")],zo.prototype,"rowNodeBlockLoader",2),g([de("csvCreator")],zo.prototype,"csvCreator",2),g([de("excelCreator")],zo.prototype,"excelCreator",2),g([de("rangeService")],zo.prototype,"rangeService",2),g([de("clipboardService")],zo.prototype,"clipboardService",2),g([de("aggFuncService")],zo.prototype,"aggFuncService",2),g([de("statusBarService")],zo.prototype,"statusBarService",2),g([de("chartService")],zo.prototype,"chartService",2),g([de("ssrmTransactionManager")],zo.prototype,"serverSideTransactionManager",2),g([de("sideBarService")],zo.prototype,"sideBarService",2),g([le],zo.prototype,"init",1),zo=g([he("gridApi")],zo);var Wo=class extends st{constructor(){super(...arguments),this.quickFilter=null,this.quickFilterParts=null}postConstruct(){this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PIVOT_MODE_CHANGED,()=>this.resetQuickFilterCache()),this.addManagedListener(this.eventService,ct.EVENT_NEW_COLUMNS_LOADED,()=>this.resetQuickFilterCache()),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.resetQuickFilterCache()),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_VISIBLE,()=>{this.gos.get("includeHiddenColumnsInQuickFilter")||this.resetQuickFilterCache()}),this.addManagedPropertyListener("quickFilterText",e=>this.setQuickFilter(e.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 null!==this.quickFilter}doesRowPassQuickFilter(e){const t=this.gos.get("cacheQuickFilter");return this.matcher?this.doesRowPassQuickFilterMatcher(t,e):this.quickFilterParts.every(i=>t?this.doesRowPassQuickFilterCache(e,i):this.doesRowPassQuickFilterNoCache(e,i))}resetQuickFilterCache(){this.rowModel.forEachNode(e=>e.quickFilterAggregateText=null)}setQuickFilterParts(){const{quickFilter:e,parser:t}=this;this.quickFilterParts=e?t?t(e):e.split(" "):null}parseQuickFilter(e){return b(e)?this.gos.isRowModelType("clientSide")?e.toUpperCase():(console.warn("AG Grid - Quick filtering only works with the Client-Side Row Model"),null):null}setQuickFilter(e){if(null!=e&&"string"!=typeof e)return void console.warn("AG Grid - Grid option quickFilterText only supports string inputs, received: "+typeof e);const t=this.parseQuickFilter(e);this.quickFilter!==t&&(this.quickFilter=t,this.setQuickFilterParts(),this.dispatchEvent({type:Wo.EVENT_QUICK_FILTER_CHANGED}))}setQuickFilterParserAndMatcher(){const e=this.gos.get("quickFilterParser"),t=this.gos.get("quickFilterMatcher"),i=e!==this.parser||t!==this.matcher;this.parser=e,this.matcher=t,i&&(this.setQuickFilterParts(),this.dispatchEvent({type:Wo.EVENT_QUICK_FILTER_CHANGED}))}onQuickFilterColumnConfigChanged(){this.columnModel.refreshQuickFilterColumns(),this.resetQuickFilterCache(),this.isQuickFilterPresent()&&this.dispatchEvent({type:Wo.EVENT_QUICK_FILTER_CHANGED})}doesRowPassQuickFilterNoCache(e,t){return this.columnModel.getAllColumnsForQuickFilter().some(i=>{const n=this.getQuickFilterTextForColumn(i,e);return b(n)&&n.indexOf(t)>=0})}doesRowPassQuickFilterCache(e,t){return this.checkGenerateQuickFilterAggregateText(e),e.quickFilterAggregateText.indexOf(t)>=0}doesRowPassQuickFilterMatcher(e,t){let i;e?(this.checkGenerateQuickFilterAggregateText(t),i=t.quickFilterAggregateText):i=this.getQuickFilterAggregateText(t);const{quickFilterParts:n,matcher:s}=this;return s(n,i)}checkGenerateQuickFilterAggregateText(e){e.quickFilterAggregateText||(e.quickFilterAggregateText=this.getQuickFilterAggregateText(e))}getQuickFilterTextForColumn(e,t){let i=this.valueService.getValue(e,t,!0);const n=e.getColDef();if(n.getQuickFilterText){const s=this.gos.addGridCommonParams({value:i,node:t,data:t.data,column:e,colDef:n});i=n.getQuickFilterText(s)}return b(i)?i.toString().toUpperCase():null}getQuickFilterAggregateText(e){const t=[];return this.columnModel.getAllColumnsForQuickFilter().forEach(i=>{const n=this.getQuickFilterTextForColumn(i,e);b(n)&&t.push(n)}),t.join(Wo.QUICK_FILTER_SEPARATOR)}};Wo.EVENT_QUICK_FILTER_CHANGED="quickFilterChanged",Wo.QUICK_FILTER_SEPARATOR="\n",g([ue("valueService")],Wo.prototype,"valueService",2),g([ue("columnModel")],Wo.prototype,"columnModel",2),g([ue("rowModel")],Wo.prototype,"rowModel",2),g([le],Wo.prototype,"postConstruct",1),Wo=g([he("quickFilterService")],Wo);var jo=class extends st{constructor(){super(...arguments),this.allColumnFilters=new Map,this.allColumnListeners=new Map,this.activeAggregateFilters=[],this.activeColumnFilters=[],this.processingFilterChange=!1,this.filterModelUpdateQueue=[],this.columnFilterModelUpdateQueue=[],this.advancedFilterModelUpdateQueue=[]}init(){var e,t,i;this.addManagedListener(this.eventService,ct.EVENT_GRID_COLUMNS_CHANGED,()=>this.onColumnsChanged()),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_VALUE_CHANGED,()=>this.refreshFiltersForAggregations()),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PIVOT_CHANGED,()=>this.refreshFiltersForAggregations()),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PIVOT_MODE_CHANGED,()=>this.refreshFiltersForAggregations()),this.addManagedListener(this.eventService,ct.EVENT_NEW_COLUMNS_LOADED,()=>this.updateAdvancedFilterColumns()),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_VISIBLE,()=>this.updateAdvancedFilterColumns()),this.addManagedListener(this.eventService,ct.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",e=>this.setAdvancedFilterModel(e.currentValue)),this.addManagedListener(this.eventService,ct.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,({enabled:e})=>this.onAdvancedFilterEnabledChanged(e)),this.addManagedListener(this.eventService,ct.EVENT_DATA_TYPES_INFERRED,()=>this.processFilterModelUpdateQueue()),this.addManagedListener(this.quickFilterService,Wo.EVENT_QUICK_FILTER_CHANGED,()=>this.onFilterChanged({source:"quickFilter"})),this.initialFilterModel=u({},null!=(i=null==(t=null==(e=this.gos.get("initialState"))?void 0:e.filter)?void 0:t.filterModel)?i:{})}isExternalFilterPresentCallback(){const e=this.gos.getCallback("isExternalFilterPresent");return"function"==typeof e&&e({})}doesExternalFilterPass(e){const t=this.gos.get("doesExternalFilterPass");return"function"==typeof t&&t(e)}setFilterModel(e,t="api"){if(this.isAdvancedFilterEnabled())return void this.warnAdvancedFilters();if(this.dataTypeService.isPendingInference())return void this.filterModelUpdateQueue.push({model:e,source:t});const i=[],n=this.getFilterModel();if(e){const t=ls(Object.keys(e));this.allColumnFilters.forEach((n,s)=>{const r=e[s];i.push(this.setModelOnFilterWrapper(n.filterPromise,r)),t.delete(s)}),t.forEach(t=>{const n=this.columnModel.getPrimaryColumn(t)||this.columnModel.getGridColumn(t);if(!n)return void console.warn("AG Grid: setFilterModel() - no column found for colId: "+t);if(!n.isFilterAllowed())return void console.warn("AG Grid: setFilterModel() - unable to fully apply model, filtering disabled for colId: "+t);const s=this.getOrCreateFilterWrapper(n,"NO_UI");s?i.push(this.setModelOnFilterWrapper(s.filterPromise,e[t])):console.warn("AG-Grid: setFilterModel() - unable to fully apply model, unable to create filter for colId: "+t)})}else this.allColumnFilters.forEach(e=>{i.push(this.setModelOnFilterWrapper(e.filterPromise,null))});ds.all(i).then(()=>{const e=this.getFilterModel(),i=[];this.allColumnFilters.forEach((t,s)=>{const r=n?n[s]:null,o=e?e[s]:null;cs.jsonEquals(r,o)||i.push(t.column)}),i.length>0&&this.onFilterChanged({columns:i,source:t})})}setModelOnFilterWrapper(e,t){return new ds(i=>{e.then(e=>{"function"!=typeof e.setModel&&(console.warn("AG Grid: filter missing setModel method, which is needed for setFilterModel"),i()),(e.setModel(t)||ds.resolve()).then(()=>i())})})}getFilterModel(){const e={};return this.allColumnFilters.forEach((t,i)=>{const n=this.getModelFromFilterWrapper(t);b(n)&&(e[i]=n)}),e}getModelFromFilterWrapper(e){var t;const i=e.filterPromise.resolveNow(null,e=>e);return null==i?null!=(t=this.initialFilterModel[e.column.getColId()])?t:null:"function"!=typeof i.getModel?(console.warn("AG Grid: filter API missing getModel method, which is needed for getFilterModel"),null):i.getModel()}isColumnFilterPresent(){return this.activeColumnFilters.length>0}isAggregateFilterPresent(){return!!this.activeAggregateFilters.length}isExternalFilterPresent(){return this.externalFilterPresent}isChildFilterPresent(){return this.isColumnFilterPresent()||this.isQuickFilterPresent()||this.isExternalFilterPresent()||this.isAdvancedFilterPresent()}isAdvancedFilterPresent(){return this.isAdvancedFilterEnabled()&&this.advancedFilterService.isFilterPresent()}onAdvancedFilterEnabledChanged(e){var t;e?this.allColumnFilters.size&&(this.allColumnFilters.forEach(e=>this.disposeFilterWrapper(e,"advancedFilterEnabled")),this.onFilterChanged({source:"advancedFilter"})):(null==(t=this.advancedFilterService)?void 0:t.isFilterPresent())&&(this.advancedFilterService.setModel(null),this.onFilterChanged({source:"advancedFilter"}))}isAdvancedFilterEnabled(){var e;return!!(null==(e=this.advancedFilterService)?void 0:e.isEnabled())}isAdvancedFilterHeaderActive(){return this.isAdvancedFilterEnabled()&&this.advancedFilterService.isHeaderActive()}doAggregateFiltersPass(e,t){return this.doColumnFiltersPass(e,t,!0)}updateActiveFilters(){this.activeColumnFilters.length=0,this.activeAggregateFilters.length=0;const e=e=>!!e&&(e.isFilterActive?e.isFilterActive():(console.warn("AG Grid: Filter is missing isFilterActive() method"),!1)),t=!!this.gos.getGroupAggFiltering(),i=e=>{if(!e.isPrimary())return!0;const i=!this.columnModel.isPivotActive();return!(!e.isValueActive()||!i)&&(!!this.columnModel.isPivotMode()||t)};this.allColumnFilters.forEach(t=>{if(t.filterPromise.resolveNow(!1,e)){const e=t.filterPromise.resolveNow(null,e=>e);i(t.column)?this.activeAggregateFilters.push(e):this.activeColumnFilters.push(e)}})}updateFilterFlagInColumns(e,t){this.allColumnFilters.forEach(i=>{const n=i.filterPromise.resolveNow(!1,e=>e.isFilterActive());i.column.setFilterActive(n,e,t)})}isAnyFilterPresent(){return this.isQuickFilterPresent()||this.isColumnFilterPresent()||this.isAggregateFilterPresent()||this.isExternalFilterPresent()||this.isAdvancedFilterPresent()}doColumnFiltersPass(e,t,i){const{data:n,aggData:s}=e,r=i?this.activeAggregateFilters:this.activeColumnFilters,o=i?s:n;for(let i=0;i<r.length;i++){const n=r[i];if(null!=n&&n!==t){if("function"!=typeof n.doesFilterPass)throw new Error("Filter is missing method doesFilterPass");if(!n.doesFilterPass({node:e,data:o}))return!1}}return!0}resetQuickFilterCache(){this.quickFilterService.resetQuickFilterCache()}refreshFiltersForAggregations(){this.gos.getGroupAggFiltering()&&this.onFilterChanged()}callOnFilterChangedOutsideRenderCycle(e){const t=()=>this.onFilterChanged(e);this.rowRenderer.isRefreshInProgress()?setTimeout(t,0):t()}onFilterChanged(e={}){const{source:t,filterInstance:i,additionalEventAttributes:n,columns:s}=e;this.updateDependantFilters(),this.updateActiveFilters(),this.updateFilterFlagInColumns("filterChanged",n),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.allColumnFilters.forEach(e=>{e.filterPromise&&e.filterPromise.then(e=>{e&&e!==i&&e.onAnyFilterChanged&&e.onAnyFilterChanged()})});const r={source:t,type:ct.EVENT_FILTER_CHANGED,columns:s||[]};n&&O(r,n),this.processingFilterChange=!0,this.eventService.dispatchEvent(r),this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){var e;return!(null!=(e=this.gos.get("allowShowChangeAfterFilter"))&&e)&&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(e,t){return this.doesRowPassFilter({rowNode:t,filterInstanceToSkip:e})}doesRowPassAggregateFilters(e){return!(this.isAggregateQuickFilterPresent()&&!this.quickFilterService.doesRowPassQuickFilter(e.rowNode)||this.isAggregateFilterPresent()&&!this.doAggregateFiltersPass(e.rowNode,e.filterInstanceToSkip))}doesRowPassFilter(e){return!(this.isNonAggregateQuickFilterPresent()&&!this.quickFilterService.doesRowPassQuickFilter(e.rowNode)||this.isExternalFilterPresent()&&!this.doesExternalFilterPass(e.rowNode)||this.isColumnFilterPresent()&&!this.doColumnFiltersPass(e.rowNode,e.filterInstanceToSkip)||this.isAdvancedFilterPresent()&&!this.advancedFilterService.doesFilterPass(e.rowNode))}onNewRowsLoaded(e){this.allColumnFilters.forEach(e=>{e.filterPromise.then(e=>{e.onNewRowsLoaded&&e.onNewRowsLoaded()})}),this.updateFilterFlagInColumns(e,{afterDataChange:!0}),this.updateActiveFilters()}createValueGetter(e){return({node:t})=>this.valueService.getValue(e,t,!0)}createGetValue(e){return(t,i)=>{const n=i?this.columnModel.getGridColumn(i):e;return n?this.valueService.getValue(n,t,!0):void 0}}getFilterComponent(e,t,i=!0){var n;if(i)return(null==(n=this.getOrCreateFilterWrapper(e,t))?void 0:n.filterPromise)||null;const s=this.cachedFilter(e);return s?s.filterPromise:null}isFilterActive(e){const t=this.cachedFilter(e);return!!t&&t.filterPromise.resolveNow(!1,e=>e.isFilterActive())}getOrCreateFilterWrapper(e,t){if(!e.isFilterAllowed())return null;let i=this.cachedFilter(e);return i||(i=this.createFilterWrapper(e,t),this.setColumnFilterWrapper(e,i)),i}cachedFilter(e){return this.allColumnFilters.get(e.getColId())}getDefaultFilter(e){let t;if(re.__isRegistered("@ag-grid-enterprise/set-filter",this.context.getGridId()))t="agSetColumnFilter";else{const i=this.dataTypeService.getBaseDataType(e);t="number"===i?"agNumberColumnFilter":"date"===i||"dateString"===i?"agDateColumnFilter":"agTextColumnFilter"}return t}getDefaultFloatingFilter(e){let t;if(re.__isRegistered("@ag-grid-enterprise/set-filter",this.context.getGridId()))t="agSetColumnFloatingFilter";else{const i=this.dataTypeService.getBaseDataType(e);t="number"===i?"agNumberColumnFloatingFilter":"date"===i||"dateString"===i?"agDateColumnFloatingFilter":"agTextColumnFloatingFilter"}return t}createFilterInstance(e){const t=this.getDefaultFilter(e),i=e.getColDef();let n;const s=d(u({},this.createFilterParams(e,i)),{filterModifiedCallback:()=>this.filterModifiedCallbackFactory(n,e)(),filterChangedCallback:t=>this.filterChangedCallbackFactory(n,e)(t),doesRowPassOtherFilter:e=>this.doesRowPassOtherFilters(n,e)}),r=this.userComponentFactory.getFilterDetails(i,s,t);return r?{filterPromise:()=>{const e=r.newAgStackInstance();return e&&e.then(e=>n=e),e},compDetails:r}:{filterPromise:null,compDetails:null}}createFilterParams(e,t){return this.gos.addGridCommonParams({column:e,colDef:_(t),rowModel:this.rowModel,filterChangedCallback:()=>{},filterModifiedCallback:()=>{},valueGetter:this.createValueGetter(e),getValue:this.createGetValue(e),doesRowPassOtherFilter:()=>!0})}createFilterWrapper(e,t){var i;const n={column:e,filterPromise:null,compiledElement:null,compDetails:null},{filterPromise:s,compDetails:r}=this.createFilterInstance(e);return n.filterPromise=null!=(i=null==s?void 0:s())?i:null,n.compDetails=r,n}onColumnsChanged(){const e=[];this.allColumnFilters.forEach((t,i)=>{let n;n=t.column.isPrimary()?this.columnModel.getPrimaryColumn(i):this.columnModel.getGridColumn(i),n&&n===t.column||(e.push(t.column),this.disposeFilterWrapper(t,"columnChanged"),this.disposeColumnListener(i))}),e.length>0?this.onFilterChanged({columns:e,source:"api"}):this.updateDependantFilters()}updateDependantFilters(){const e=this.columnModel.getGroupAutoColumns();null==e||e.forEach(e=>{"agGroupColumnFilter"===e.getColDef().filter&&this.getOrCreateFilterWrapper(e,"NO_UI")})}isFilterAllowed(e){var t,i;if(this.isAdvancedFilterEnabled())return!1;if(!e.isFilterAllowed())return!1;const n=this.allColumnFilters.get(e.getColId());return null==(i=null==(t=null==n?void 0:n.filterPromise)?void 0:t.resolveNow(!0,e=>"function"!=typeof(null==e?void 0:e.isFilterAllowed)||(null==e?void 0:e.isFilterAllowed())))||i}getFloatingFilterCompDetails(e,t){const i=t=>{const i=this.getFilterComponent(e,"NO_UI");null!=i&&i.then(e=>{t(Uo(e))})},n=e.getColDef(),s=d(u({},this.createFilterParams(e,n)),{filterChangedCallback:()=>i(t=>this.filterChangedCallbackFactory(t,e)())}),r=this.userComponentFactory.mergeParamsWithApplicationProvidedParams(n,Eo,s);let o=this.userComponentFactory.getDefaultFloatingFilterType(n,()=>this.getDefaultFloatingFilter(e));null==o&&(o="agReadOnlyFloatingFilter");const a={column:e,filterParams:r,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(e),parentFilterInstance:i,showParentFilter:t,suppressFilterButton:!1};return this.userComponentFactory.getFloatingFilterCompDetails(n,a,o)}getCurrentFloatingFilterParentModel(e){const t=this.getFilterComponent(e,"NO_UI",!1);return t?t.resolveNow(null,e=>e&&e.getModel()):null}destroyFilter(e,t="api"){const i=e.getColId(),n=this.allColumnFilters.get(i);this.disposeColumnListener(i),delete this.initialFilterModel[i],n&&(this.disposeFilterWrapper(n,t),this.onFilterChanged({columns:[e],source:"api"}))}disposeColumnListener(e){const t=this.allColumnListeners.get(e);t&&(this.allColumnListeners.delete(e),t())}disposeFilterWrapper(e,t){e.filterPromise.then(i=>{this.getContext().destroyBean(i),e.column.setFilterActive(!1,"filterDestroyed"),this.allColumnFilters.delete(e.column.getColId());const n={type:ct.EVENT_FILTER_DESTROYED,source:t,column:e.column};this.eventService.dispatchEvent(n)})}filterModifiedCallbackFactory(e,t){return()=>{const i={type:ct.EVENT_FILTER_MODIFIED,column:t,filterInstance:e};this.eventService.dispatchEvent(i)}}filterChangedCallbackFactory(e,t){return i=>{var n;const s=null!=(n=null==i?void 0:i.source)?n:"api",r={filter:e,additionalEventAttributes:i,columns:[t],source:s};this.callOnFilterChangedOutsideRenderCycle(r)}}checkDestroyFilter(e){const t=this.allColumnFilters.get(e);if(!t)return;const i=t.column,{compDetails:n}=i.isFilterAllowed()?this.createFilterInstance(i):{compDetails:null};if(this.areFilterCompsDifferent(t.compDetails,n))return void this.destroyFilter(i,"paramsUpdated");const s=i.getColDef().filterParams;t.filterPromise?t.filterPromise.then(e=>{!1===(!(null==e?void 0:e.refresh)||e.refresh(u(d(u({},this.createFilterParams(i,i.getColDef())),{filterModifiedCallback:this.filterModifiedCallbackFactory(e,i),filterChangedCallback:this.filterChangedCallbackFactory(e,i),doesRowPassOtherFilter:t=>this.doesRowPassOtherFilters(e,t)}),s)))&&this.destroyFilter(i,"paramsUpdated")}):this.destroyFilter(i,"paramsUpdated")}setColumnFilterWrapper(e,t){const i=e.getColId();this.allColumnFilters.set(i,t),this.allColumnListeners.set(i,this.addManagedListener(e,Se.EVENT_COL_DEF_CHANGED,()=>this.checkDestroyFilter(i)))}areFilterCompsDifferent(e,t){if(!t||!e)return!0;const{componentClass:i}=e,{componentClass:n}=t;return!(i===n||(null==i?void 0:i.render)&&(null==n?void 0:n.render)&&i.render===n.render)}getAdvancedFilterModel(){return this.isAdvancedFilterEnabled()?this.advancedFilterService.getModel():null}setAdvancedFilterModel(e){this.isAdvancedFilterEnabled()&&(this.dataTypeService.isPendingInference()?this.advancedFilterModelUpdateQueue.push(e):(this.advancedFilterService.setModel(null!=e?e:null),this.onFilterChanged({source:"advancedFilter"})))}showAdvancedFilterBuilder(e){this.isAdvancedFilterEnabled()&&this.advancedFilterService.getCtrl().toggleFilterBuilder(e,!0)}updateAdvancedFilterColumns(){this.isAdvancedFilterEnabled()&&this.advancedFilterService.updateValidity()&&this.onFilterChanged({source:"advancedFilter"})}hasFloatingFilters(){return!this.isAdvancedFilterEnabled()&&this.columnModel.getAllGridColumns().some(e=>e.getColDef().floatingFilter)}getFilterInstance(e,t){if(this.isAdvancedFilterEnabled())return void this.warnAdvancedFilters();const i=this.getFilterInstanceImpl(e,e=>{if(!t)return;const i=Uo(e);t(i)});return Uo(i)}getColumnFilterInstance(e){return new Promise(t=>{this.getFilterInstance(e,e=>{t(e)})})}getFilterInstanceImpl(e,t){const i=this.columnModel.getPrimaryColumn(e);if(!i)return;const n=this.getFilterComponent(i,"NO_UI"),s=n&&n.resolveNow(null,e=>e);return s?setTimeout(t,0,s):n&&n.then(e=>{t(e)}),s}warnAdvancedFilters(){z("Column Filter API methods have been disabled as Advanced Filters are enabled.")}setupAdvancedFilterHeaderComp(e){var t;null==(t=this.advancedFilterService)||t.getCtrl().setupHeaderComp(e)}getHeaderRowCount(){return this.isAdvancedFilterHeaderActive()?1:0}getHeaderHeight(){return this.isAdvancedFilterHeaderActive()?this.advancedFilterService.getCtrl().getHeaderHeight():0}processFilterModelUpdateQueue(){this.filterModelUpdateQueue.forEach(({model:e,source:t})=>this.setFilterModel(e,t)),this.filterModelUpdateQueue=[],this.columnFilterModelUpdateQueue.forEach(({key:e,model:t,resolve:i})=>{this.setColumnFilterModel(e,t).then(()=>i())}),this.columnFilterModelUpdateQueue=[],this.advancedFilterModelUpdateQueue.forEach(e=>this.setAdvancedFilterModel(e)),this.advancedFilterModelUpdateQueue=[]}getColumnFilterModel(e){const t=this.getFilterWrapper(e);return t?this.getModelFromFilterWrapper(t):null}setColumnFilterModel(e,t){if(this.isAdvancedFilterEnabled())return this.warnAdvancedFilters(),Promise.resolve();if(this.dataTypeService.isPendingInference()){let i=()=>{};const n=new Promise(e=>{i=e});return this.columnFilterModelUpdateQueue.push({key:e,model:t,resolve:i}),n}const i=this.columnModel.getPrimaryColumn(e),n=i?this.getOrCreateFilterWrapper(i,"NO_UI"):null;return n?(s=this.setModelOnFilterWrapper(n.filterPromise,t),new Promise(e=>{s.then(t=>e(t))})):Promise.resolve();var s}getFilterWrapper(e){var t;const i=this.columnModel.getPrimaryColumn(e);return i&&null!=(t=this.cachedFilter(i))?t:null}destroy(){super.destroy(),this.allColumnFilters.forEach(e=>this.disposeFilterWrapper(e,"gridDestroyed")),this.allColumnListeners.clear()}};g([ue("valueService")],jo.prototype,"valueService",2),g([ue("columnModel")],jo.prototype,"columnModel",2),g([ue("rowModel")],jo.prototype,"rowModel",2),g([ue("userComponentFactory")],jo.prototype,"userComponentFactory",2),g([ue("rowRenderer")],jo.prototype,"rowRenderer",2),g([ue("dataTypeService")],jo.prototype,"dataTypeService",2),g([ue("quickFilterService")],jo.prototype,"quickFilterService",2),g([de("advancedFilterService")],jo.prototype,"advancedFilterService",2),g([le],jo.prototype,"init",1),jo=g([he("filterManager")],jo);var $o=class extends Cs{constructor(e,t){super('<div class="ag-filter"></div>'),this.column=e,this.source=t,this.filterWrapper=null}postConstruct(){this.createFilter(!0),this.addManagedListener(this.eventService,ct.EVENT_FILTER_DESTROYED,this.onFilterDestroyed.bind(this))}hasFilter(){return!!this.filterWrapper}getFilter(){var e,t;return null!=(t=null==(e=this.filterWrapper)?void 0:e.filterPromise)?t:null}afterInit(){var e,t,i;return null!=(i=null==(t=null==(e=this.filterWrapper)?void 0:e.filterPromise)?void 0:t.then(()=>{}))?i:ds.resolve()}afterGuiAttached(e){var t,i;null==(i=null==(t=this.filterWrapper)?void 0:t.filterPromise)||i.then(t=>{var i;null==(i=null==t?void 0:t.afterGuiAttached)||i.call(t,e)})}afterGuiDetached(){var e,t;null==(t=null==(e=this.filterWrapper)?void 0:e.filterPromise)||t.then(e=>{var t;null==(t=null==e?void 0:e.afterGuiDetached)||t.call(e)})}createFilter(e){var t;const{column:i,source:n}=this;this.filterWrapper=this.filterManager.getOrCreateFilterWrapper(i,n),(null==(t=this.filterWrapper)?void 0:t.filterPromise)&&this.filterWrapper.filterPromise.then(t=>{let s=t.getGui();if(b(s)||console.warn(`AG Grid: getGui method from filter returned ${s}, it should be a DOM element or an HTML template string.`),"string"==typeof s&&(s=En(s)),this.appendChild(s),e){const e={type:ct.EVENT_FILTER_OPENED,column:i,source:n,eGui:this.getGui()};this.eventService.dispatchEvent(e)}})}onFilterDestroyed(e){"api"!==e.source&&"paramsUpdated"!==e.source||e.column.getId()!==this.column.getId()||!this.columnModel.getPrimaryColumn(this.column)||(Cn(this.getGui()),this.createFilter())}destroy(){this.filterWrapper=null,super.destroy()}};g([ue("filterManager")],$o.prototype,"filterManager",2),g([ue("columnModel")],$o.prototype,"columnModel",2),g([le],$o.prototype,"postConstruct",1);var Ko=class extends Cs{constructor(e,t){super(e),this.ctrl=t}getCtrl(){return this.ctrl}},Yo=class e extends Ko{constructor(t){super(e.TEMPLATE,t)}postConstruct(){const e=this.getGui(),t={addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),addOrRemoveBodyCssClass:(e,t)=>this.eFloatingFilterBody.classList.toggle(e,t),setButtonWrapperDisplayed:e=>an(this.eButtonWrapper,e),setCompDetails:e=>this.setCompDetails(e),getFloatingFilterComp:()=>this.compPromise,setWidth:t=>e.style.width=t,setMenuIcon:e=>this.eButtonShowMainFilter.appendChild(e)};this.ctrl.setComp(t,e,this.eButtonShowMainFilter,this.eFloatingFilterBody)}setCompDetails(e){if(!e)return this.destroyFloatingFilterComp(),void(this.compPromise=null);this.compPromise=e.newAgStackInstance(),this.compPromise.then(e=>this.afterCompCreated(e))}destroyFloatingFilterComp(){this.floatingFilterComp&&(this.eFloatingFilterBody.removeChild(this.floatingFilterComp.getGui()),this.floatingFilterComp=this.destroyBean(this.floatingFilterComp))}afterCompCreated(e){e&&(this.isAlive()?(this.destroyFloatingFilterComp(),this.floatingFilterComp=e,this.eFloatingFilterBody.appendChild(e.getGui()),e.afterGuiAttached&&e.afterGuiAttached()):this.destroyBean(e))}};Yo.TEMPLATE='<div class="ag-header-cell ag-floating-filter" role="gridcell">\n            <div ref="eFloatingFilterBody" role="presentation"></div>\n            <div class="ag-floating-filter-button ag-hidden" ref="eButtonWrapper" role="presentation">\n                <button type="button" class="ag-button ag-floating-filter-button-button" ref="eButtonShowMainFilter" tabindex="-1"></button>\n            </div>\n        </div>',g([Ss("eFloatingFilterBody")],Yo.prototype,"eFloatingFilterBody",2),g([Ss("eButtonWrapper")],Yo.prototype,"eButtonWrapper",2),g([Ss("eButtonShowMainFilter")],Yo.prototype,"eButtonShowMainFilter",2),g([le],Yo.prototype,"postConstruct",1),g([ce],Yo.prototype,"destroyFloatingFilterComp",1);var qo=Yo,Xo=(e=>(e.AUTO_HEIGHT="ag-layout-auto-height",e.NORMAL="ag-layout-normal",e.PRINT="ag-layout-print",e))(Xo||{}),Zo=class extends st{constructor(e){super(),this.view=e}postConstruct(){this.addManagedPropertyListener("domLayout",this.updateLayoutClasses.bind(this)),this.updateLayoutClasses()}updateLayoutClasses(){const e=this.getDomLayout(),t={autoHeight:"autoHeight"===e,normal:"normal"===e,print:"print"===e},i=t.autoHeight?"ag-layout-auto-height":t.print?"ag-layout-print":"ag-layout-normal";this.view.updateLayoutClasses(i,t)}getDomLayout(){var e;const t=null!=(e=this.gos.get("domLayout"))?e:"normal";return-1===["normal","print","autoHeight"].indexOf(t)?(z(`${t} is not valid for DOM Layout, valid values are 'normal', 'autoHeight', 'print'.`),"normal"):t}};g([le],Zo.prototype,"postConstruct",1);var Qo=class extends st{constructor(e){super(),this.lastScrollSource=[null,null],this.scrollLeft=-1,this.nextScrollTop=-1,this.scrollTop=-1,this.lastOffsetHeight=-1,this.lastScrollTop=-1,this.eBodyViewport=e,this.resetLastHScrollDebounced=Q(()=>this.lastScrollSource[1]=null,500),this.resetLastVScrollDebounced=Q(()=>this.lastScrollSource[0]=null,500)}postConstruct(){this.enableRtl=this.gos.get("enableRtl"),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onDisplayedColumnsWidthChanged.bind(this)),this.ctrlsService.whenReady(e=>{this.centerRowsCtrl=e.center,this.onDisplayedColumnsWidthChanged(),this.addScrollListener()})}addScrollListener(){const{fakeHScrollComp:e,fakeVScrollComp:t}=this.ctrlsService.getParams();this.addManagedListener(this.centerRowsCtrl.getViewportElement(),"scroll",this.onHScroll.bind(this)),e.onScrollCallback(this.onFakeHScroll.bind(this));const i=this.gos.get("debounceVerticalScrollbar"),n=i?Q(this.onVScroll.bind(this),100):this.onVScroll.bind(this),s=i?Q(this.onFakeVScroll.bind(this),100):this.onFakeVScroll.bind(this);this.addManagedListener(this.eBodyViewport,"scroll",n),t.onScrollCallback(s)}onDisplayedColumnsWidthChanged(){this.enableRtl&&this.horizontallyScrollHeaderCenterAndFloatingCenter()}horizontallyScrollHeaderCenterAndFloatingCenter(e){if(null==this.centerRowsCtrl)return;void 0===e&&(e=this.centerRowsCtrl.getCenterViewportScrollLeft());const t=this.enableRtl?e:-e,{topCenter:i,stickyTopCenter:n,stickyBottomCenter:s,centerHeader:r,bottomCenter:o,fakeHScrollComp:a}=this.ctrlsService.getParams();r.setHorizontalScroll(-t),o.setContainerTranslateX(t),i.setContainerTranslateX(t),n.setContainerTranslateX(t),s.setContainerTranslateX(t);const l=this.centerRowsCtrl.getViewportElement(),c=0===this.lastScrollSource[1];e=Math.abs(e),c?a.setScrollPosition(e):bn(l,e,this.enableRtl)}isControllingScroll(e,t){return null==this.lastScrollSource[t]?(this.lastScrollSource[t]=e,!0):this.lastScrollSource[t]===e}onFakeHScroll(){this.isControllingScroll(1,1)&&this.onHScrollCommon(1)}onHScroll(){this.isControllingScroll(0,1)&&this.onHScrollCommon(0)}onHScrollCommon(e){const t=this.centerRowsCtrl.getViewportElement(),{scrollLeft:i}=t;if(this.shouldBlockScrollUpdate(1,i,!0))return;let n;n=0===e?vn(t,this.enableRtl):this.ctrlsService.get("fakeHScrollComp").getScrollPosition(),this.doHorizontalScroll(Math.round(n)),this.resetLastHScrollDebounced()}onFakeVScroll(){this.isControllingScroll(1,0)&&this.onVScrollCommon(1)}onVScroll(){this.isControllingScroll(0,0)&&this.onVScrollCommon(0)}onVScrollCommon(e){let t;t=0===e?this.eBodyViewport.scrollTop:this.ctrlsService.get("fakeVScrollComp").getScrollPosition(),this.shouldBlockScrollUpdate(0,t,!0)||(this.animationFrameService.setScrollTop(t),this.nextScrollTop=t,0===e?this.ctrlsService.get("fakeVScrollComp").setScrollPosition(t):this.eBodyViewport.scrollTop=t,this.gos.get("suppressAnimationFrame")?this.scrollGridIfNeeded():this.animationFrameService.schedule(),this.resetLastVScrollDebounced())}doHorizontalScroll(e){const t=this.ctrlsService.get("fakeHScrollComp").getScrollPosition();this.scrollLeft===e&&e===t||(this.scrollLeft=e,this.fireScrollEvent(1),this.horizontallyScrollHeaderCenterAndFloatingCenter(e),this.centerRowsCtrl.onHorizontalViewportChanged(!0))}fireScrollEvent(e){const t={type:ct.EVENT_BODY_SCROLL,direction:1===e?"horizontal":"vertical",left:this.scrollLeft,top:this.scrollTop};this.eventService.dispatchEvent(t),window.clearTimeout(this.scrollTimer),this.scrollTimer=void 0,this.scrollTimer=window.setTimeout(()=>{const e=d(u({},t),{type:ct.EVENT_BODY_SCROLL_END});this.eventService.dispatchEvent(e)},100)}shouldBlockScrollUpdate(e,t,i=!1){return!(i&&!Pi())&&(0===e?this.shouldBlockVerticalScroll(t):this.shouldBlockHorizontalScroll(t))}shouldBlockVerticalScroll(e){const t=dn(this.eBodyViewport),{scrollHeight:i}=this.eBodyViewport;return e<0||e+t>i}shouldBlockHorizontalScroll(e){const t=this.centerRowsCtrl.getCenterWidth(),{scrollWidth:i}=this.centerRowsCtrl.getViewportElement();if(this.enableRtl&&yn()){if(e>0)return!0}else if(e<0)return!0;return Math.abs(e)+t>i}redrawRowsAfterScroll(){this.fireScrollEvent(0)}checkScrollLeft(){this.scrollLeft!==this.centerRowsCtrl.getCenterViewportScrollLeft()&&this.onHScrollCommon(0)}scrollGridIfNeeded(){const e=this.scrollTop!=this.nextScrollTop;return e&&(this.scrollTop=this.nextScrollTop,this.redrawRowsAfterScroll()),e}setHorizontalScrollPosition(e,t=!1){const i=this.centerRowsCtrl.getViewportElement().scrollWidth-this.centerRowsCtrl.getCenterWidth();!t&&this.shouldBlockScrollUpdate(1,e)&&(e=this.enableRtl&&yn()?e>0?0:i:Math.min(Math.max(e,0),i)),bn(this.centerRowsCtrl.getViewportElement(),Math.abs(e),this.enableRtl),this.doHorizontalScroll(e)}setVerticalScrollPosition(e){this.eBodyViewport.scrollTop=e}getVScrollPosition(){return this.lastScrollTop=this.eBodyViewport.scrollTop,this.lastOffsetHeight=this.eBodyViewport.offsetHeight,{top:this.lastScrollTop,bottom:this.lastScrollTop+this.lastOffsetHeight}}getApproximateVScollPosition(){return this.lastScrollTop>=0&&this.lastOffsetHeight>=0?{top:this.scrollTop,bottom:this.scrollTop+this.lastOffsetHeight}:this.getVScrollPosition()}getHScrollPosition(){return this.centerRowsCtrl.getHScrollPosition()}isHorizontalScrollShowing(){return this.centerRowsCtrl.isHorizontalScrollShowing()}scrollHorizontally(e){const t=this.centerRowsCtrl.getViewportElement().scrollLeft;return this.setHorizontalScrollPosition(t+e),this.centerRowsCtrl.getViewportElement().scrollLeft-t}scrollToTop(){this.eBodyViewport.scrollTop=0}ensureNodeVisible(e,t=null){const i=this.rowModel.getRowCount();let n=-1;for(let t=0;t<i;t++){const i=this.rowModel.getRow(t);if("function"==typeof e){if(i&&e(i)){n=t;break}}else if(e===i||e===i.data){n=t;break}}n>=0&&this.ensureIndexVisible(n,t)}ensureIndexVisible(e,t){if(this.gos.isDomLayout("print"))return;const i=this.paginationProxy.getRowCount();if("number"!=typeof e||e<0||e>=i)return void console.warn("AG Grid: Invalid row index for ensureIndexVisible: "+e);const n=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.getFrameworkOverrides().wrapIncoming(()=>{n||this.paginationProxy.goToPageWithIndex(e);const i=this.ctrlsService.getGridBodyCtrl(),s=i.getStickyTopHeight(),r=i.getStickyBottomHeight(),o=this.paginationProxy.getRow(e);let a;do{const e=o.rowTop,i=o.rowHeight,n=this.paginationProxy.getPixelOffset(),l=o.rowTop-n,c=l+o.rowHeight,h=this.getVScrollPosition(),u=this.heightScaler.getDivStretchOffset(),d=h.top+u,p=h.bottom+u,g=p-d,f=this.heightScaler.getScrollPositionForPixel(l),m=this.heightScaler.getScrollPositionForPixel(c-g),y=Math.min((f+m)/2,l);let v=null;"top"===t?v=f:"bottom"===t?v=m:"middle"===t?v=y:d+s>l?v=f-s:p-r<c&&(v=m+r),null!==v&&(this.setVerticalScrollPosition(v),this.rowRenderer.redraw({afterScroll:!0})),a=e!==o.rowTop||i!==o.rowHeight}while(a);this.animationFrameService.flushAllFrames()})}ensureColumnVisible(e,t="auto"){const i=this.columnModel.getGridColumn(e);if(!i)return;if(i.isPinned())return;if(!this.columnModel.isColumnDisplayed(i))return;const n=this.getPositionedHorizontalScroll(i,t);this.getFrameworkOverrides().wrapIncoming(()=>{null!==n&&this.centerRowsCtrl.setCenterViewportScrollLeft(n),this.centerRowsCtrl.onHorizontalViewportChanged(),this.animationFrameService.flushAllFrames()})}setScrollPosition(e,t){this.getFrameworkOverrides().wrapIncoming(()=>{this.centerRowsCtrl.setCenterViewportScrollLeft(t),this.setVerticalScrollPosition(e),this.rowRenderer.redraw({afterScroll:!0}),this.animationFrameService.flushAllFrames()})}getPositionedHorizontalScroll(e,t){const{columnBeforeStart:i,columnAfterEnd:n}=this.isColumnOutsideViewport(e),s=this.centerRowsCtrl.getCenterWidth()<e.getActualWidth(),r=this.centerRowsCtrl.getCenterWidth(),o=this.enableRtl;let a=(o?i:n)||s,l=o?n:i;"auto"!==t&&(a="start"===t,l="end"===t);const c="middle"===t;if(a||l||c){const{colLeft:t,colMiddle:i,colRight:n}=this.getColumnBounds(e);return c?i-r/2:a?o?n:t:o?t-r:n-r}return null}isColumnOutsideViewport(e){const{start:t,end:i}=this.getViewportBounds(),{colLeft:n,colRight:s}=this.getColumnBounds(e),r=this.enableRtl;return{columnBeforeStart:r?t>s:i<s,columnAfterEnd:r?i<n:t>n}}getColumnBounds(e){const t=this.enableRtl,i=this.columnModel.getBodyContainerWidth(),n=e.getActualWidth(),s=e.getLeft(),r=t?-1:1,o=t?i-s:s;return{colLeft:o,colMiddle:o+n/2*r,colRight:o+n*r}}getViewportBounds(){const e=this.centerRowsCtrl.getCenterWidth(),t=this.centerRowsCtrl.getCenterViewportScrollLeft();return{start:t,end:e+t,width:e}}};g([ue("ctrlsService")],Qo.prototype,"ctrlsService",2),g([ue("animationFrameService")],Qo.prototype,"animationFrameService",2),g([ue("paginationProxy")],Qo.prototype,"paginationProxy",2),g([ue("rowModel")],Qo.prototype,"rowModel",2),g([ue("rowContainerHeightService")],Qo.prototype,"heightScaler",2),g([ue("rowRenderer")],Qo.prototype,"rowRenderer",2),g([ue("columnModel")],Qo.prototype,"columnModel",2),g([le],Qo.prototype,"postConstruct",1);var Jo=(e=>(e.ANIMATION_ON="ag-row-animation",e.ANIMATION_OFF="ag-row-no-animation",e))(Jo||{}),ea="ag-force-vertical-scroll",ta=class extends st{constructor(){super(...arguments),this.stickyTopHeight=0,this.stickyBottomHeight=0}getScrollFeature(){return this.bodyScrollFeature}getBodyViewportElement(){return this.eBodyViewport}setComp(e,t,i,n,s,r,o){this.comp=e,this.eGridBody=t,this.eBodyViewport=i,this.eTop=n,this.eBottom=s,this.eStickyTop=r,this.eStickyBottom=o,this.setCellTextSelection(this.gos.get("enableCellTextSelection")),this.addManagedPropertyListener("enableCellTextSelection",e=>this.setCellTextSelection(e.currentValue)),this.createManagedBean(new Zo(this.comp)),this.bodyScrollFeature=this.createManagedBean(new Qo(this.eBodyViewport)),this.addRowDragListener(),this.setupRowAnimationCssClass(),this.addEventListeners(),this.addFocusListeners([n,i,s,r,o]),this.onGridColumnsChanged(),this.addBodyViewportListener(),this.setFloatingHeights(),this.disableBrowserDragging(),this.addStopEditingWhenGridLosesFocus(),this.filterManager.setupAdvancedFilterHeaderComp(n),this.ctrlsService.register("gridBodyCtrl",this)}getComp(){return this.comp}addEventListeners(){this.addManagedListener(this.eventService,ct.EVENT_GRID_COLUMNS_CHANGED,this.onGridColumnsChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_SCROLL_VISIBILITY_CHANGED,this.onScrollVisibilityChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_PINNED_ROW_DATA_CHANGED,this.onPinnedRowDataChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_HEADER_HEIGHT_CHANGED,this.onHeaderHeightChanged.bind(this))}addFocusListeners(e){e.forEach(e=>{this.addManagedListener(e,"focusin",t=>{const{target:i}=t,n=hn(i,"ag-root",e);e.classList.toggle("ag-has-focus",!n)}),this.addManagedListener(e,"focusout",t=>{const{target:i,relatedTarget:n}=t,s=e.contains(n),r=hn(n,"ag-root",e);hn(i,"ag-root",e)||s&&!r||e.classList.remove("ag-has-focus")})})}setColumnMovingCss(e){this.comp.setColumnMovingCss("ag-column-moving",e)}setCellTextSelection(e=!1){this.comp.setCellSelectableCss("ag-selectable",e)}onScrollVisibilityChanged(){const e=this.scrollVisibleService.isVerticalScrollShowing();this.setVerticalScrollPaddingVisible(e),this.setStickyWidth(e),this.setStickyBottomOffsetBottom();const t=`calc(100% + ${(e&&this.gos.getScrollbarWidth()||0)+(Vi()?16:0)}px)`;this.animationFrameService.requestAnimationFrame(()=>this.comp.setBodyViewportWidth(t))}onGridColumnsChanged(){const e=this.columnModel.getAllGridColumns();this.comp.setColumnCount(e.length)}disableBrowserDragging(){this.addManagedListener(this.eGridBody,"dragstart",e=>{if(e.target instanceof HTMLImageElement)return e.preventDefault(),!1})}addStopEditingWhenGridLosesFocus(){if(!this.gos.get("stopEditingWhenCellsLoseFocus"))return;const e=e=>{const i=e.relatedTarget;if(null===Li(i))return void this.rowRenderer.stopEditing();let n=t.some(e=>e.contains(i))&&this.mouseEventService.isElementInThisGrid(i);if(!n){const e=this.popupService;n=e.getActivePopups().some(e=>e.contains(i))||e.isElementWithinCustomPopup(i)}n||this.rowRenderer.stopEditing()},t=[this.eBodyViewport,this.eBottom,this.eTop,this.eStickyTop,this.eStickyBottom];t.forEach(t=>this.addManagedListener(t,"focusout",e))}updateRowCount(){const e=this.headerNavigationService.getHeaderRowCount()+this.filterManager.getHeaderRowCount(),t=this.rowModel.isLastRowIndexKnown()?this.rowModel.getRowCount():-1,i=-1===t?-1:e+t;this.comp.setRowCount(i)}registerBodyViewportResizeListener(e){this.comp.registerBodyViewportResizeListener(e)}setVerticalScrollPaddingVisible(e){const t=e?"scroll":"hidden";this.comp.setPinnedTopBottomOverflowY(t)}isVerticalScrollShowing(){const e=this.gos.get("alwaysShowVerticalScroll"),t=e?ea:null,i=this.gos.isDomLayout("normal");return this.comp.setAlwaysVerticalScrollClass(t,e),e||i&&Rn(this.eBodyViewport)}setupRowAnimationCssClass(){const e=()=>{const e=this.gos.isAnimateRows()&&!this.rowContainerHeightService.isStretching(),t=e?"ag-row-animation":"ag-row-no-animation";this.comp.setRowAnimationCssOnBodyViewport(t,e)};e(),this.addManagedListener(this.eventService,ct.EVENT_HEIGHT_SCALE_CHANGED,e),this.addManagedPropertyListener("animateRows",e)}getGridBodyElement(){return this.eGridBody}addBodyViewportListener(){const e=this.onBodyViewportContextMenu.bind(this);this.addManagedListener(this.eBodyViewport,"contextmenu",e),this.mockContextMenuForIPad(e),this.addManagedListener(this.eBodyViewport,"wheel",this.onBodyViewportWheel.bind(this)),this.addManagedListener(this.eStickyTop,"wheel",this.onStickyWheel.bind(this)),this.addManagedListener(this.eStickyBottom,"wheel",this.onStickyWheel.bind(this)),this.addFullWidthContainerWheelListener()}addFullWidthContainerWheelListener(){const e=this.eBodyViewport.querySelector(".ag-full-width-container"),t=this.eBodyViewport.querySelector(".ag-center-cols-viewport");e&&t&&this.addManagedListener(e,"wheel",e=>this.onFullWidthContainerWheel(e,t))}onFullWidthContainerWheel(e,t){!e.deltaX||Math.abs(e.deltaY)>Math.abs(e.deltaX)||!this.mouseEventService.isEventFromThisGrid(e)||(e.preventDefault(),t.scrollBy({left:e.deltaX}))}onBodyViewportContextMenu(e,t,i){if(!e&&!i)return;this.gos.get("preventDefaultOnContextMenu")&&(e||i).preventDefault();const{target:n}=e||t;n!==this.eBodyViewport&&n!==this.ctrlsService.get("center").getViewportElement()||this.menuService.showContextMenu({mouseEvent:e,touchEvent:i,value:null,anchorToElement:this.eGridBody})}mockContextMenuForIPad(e){if(!Pi())return;const t=new yr(this.eBodyViewport);this.addManagedListener(t,yr.EVENT_LONG_TAP,t=>{e(void 0,t.touchStart,t.touchEvent)}),this.addDestroyFunc(()=>t.destroy())}onBodyViewportWheel(e){this.gos.get("suppressScrollWhenPopupsAreOpen")&&this.popupService.hasAnchoredPopup()&&e.preventDefault()}onStickyWheel(e){e.preventDefault(),e.offsetY&&this.scrollVertically(e.deltaY)}getGui(){return this.eGridBody}scrollVertically(e){const t=this.eBodyViewport.scrollTop;return this.bodyScrollFeature.setVerticalScrollPosition(t+e),this.eBodyViewport.scrollTop-t}addRowDragListener(){this.rowDragFeature=this.createManagedBean(new Go(this.eBodyViewport)),this.dragAndDropService.addDropTarget(this.rowDragFeature)}getRowDragFeature(){return this.rowDragFeature}onPinnedRowDataChanged(){this.setFloatingHeights()}setFloatingHeights(){const{pinnedRowModel:e}=this;let t=e.getPinnedTopTotalHeight(),i=e.getPinnedBottomTotalHeight();this.comp.setTopHeight(t),this.comp.setBottomHeight(i),this.comp.setTopDisplay(t?"inherit":"none"),this.comp.setBottomDisplay(i?"inherit":"none"),this.setStickyTopOffsetTop(),this.setStickyBottomOffsetBottom()}setStickyTopHeight(e=0){this.comp.setStickyTopHeight(`${e}px`),this.stickyTopHeight=e}getStickyTopHeight(){return this.stickyTopHeight}setStickyBottomHeight(e=0){this.comp.setStickyBottomHeight(`${e}px`),this.stickyBottomHeight=e}getStickyBottomHeight(){return this.stickyBottomHeight}setStickyWidth(e){if(e){const e=this.gos.getScrollbarWidth();this.comp.setStickyTopWidth(`calc(100% - ${e}px)`),this.comp.setStickyBottomWidth(`calc(100% - ${e}px)`)}else this.comp.setStickyTopWidth("100%"),this.comp.setStickyBottomWidth("100%")}onHeaderHeightChanged(){this.setStickyTopOffsetTop()}setStickyTopOffsetTop(){const e=this.ctrlsService.get("gridHeaderCtrl").getHeaderHeight()+this.filterManager.getHeaderHeight(),t=this.pinnedRowModel.getPinnedTopTotalHeight();let i=0;e>0&&(i+=e),t>0&&(i+=t),i>0&&(i+=1),this.comp.setStickyTopTop(`${i}px`)}setStickyBottomOffsetBottom(){const e=this.pinnedRowModel.getPinnedBottomTotalHeight()+(this.scrollVisibleService.isHorizontalScrollShowing()&&this.gos.getScrollbarWidth()||0);this.comp.setStickyBottomBottom(`${e}px`)}sizeColumnsToFit(e,t){const i=this.isVerticalScrollShowing()?this.gos.getScrollbarWidth():0,n=pn(this.eGridBody)-i;n>0?this.columnModel.sizeColumnsToFit(n,"sizeColumnsToFit",!1,e):void 0===t?window.setTimeout(()=>{this.sizeColumnsToFit(e,100)},0):100===t?window.setTimeout(()=>{this.sizeColumnsToFit(e,500)},100):500===t?window.setTimeout(()=>{this.sizeColumnsToFit(e,-1)},500):console.warn("AG Grid: tried to call sizeColumnsToFit() but the grid is coming back with zero width, maybe the grid is not visible yet on the screen?")}addScrollEventListener(e){this.eBodyViewport.addEventListener("scroll",e,{passive:!0})}removeScrollEventListener(e){this.eBodyViewport.removeEventListener("scroll",e)}};g([ue("animationFrameService")],ta.prototype,"animationFrameService",2),g([ue("rowContainerHeightService")],ta.prototype,"rowContainerHeightService",2),g([ue("ctrlsService")],ta.prototype,"ctrlsService",2),g([ue("columnModel")],ta.prototype,"columnModel",2),g([ue("scrollVisibleService")],ta.prototype,"scrollVisibleService",2),g([ue("menuService")],ta.prototype,"menuService",2),g([ue("headerNavigationService")],ta.prototype,"headerNavigationService",2),g([ue("dragAndDropService")],ta.prototype,"dragAndDropService",2),g([ue("pinnedRowModel")],ta.prototype,"pinnedRowModel",2),g([ue("rowRenderer")],ta.prototype,"rowRenderer",2),g([ue("popupService")],ta.prototype,"popupService",2),g([ue("mouseEventService")],ta.prototype,"mouseEventService",2),g([ue("rowModel")],ta.prototype,"rowModel",2),g([ue("filterManager")],ta.prototype,"filterManager",2);var ia=(e=>(e[e.FILL=0]="FILL",e[e.RANGE=1]="RANGE",e))(ia||{}),na=(e=>(e[e.VALUE=0]="VALUE",e[e.DIMENSION=1]="DIMENSION",e))(na||{}),sa="ag-cell-range-selected",ra=class{constructor(e,t){this.beans=e,this.rangeService=e.rangeService,this.selectionHandleFactory=e.selectionHandleFactory,this.cellCtrl=t}setComp(e,t){this.cellComp=e,this.eGui=t,this.onRangeSelectionChanged()}onRangeSelectionChanged(){this.cellComp&&(this.rangeCount=this.rangeService.getCellRangeCount(this.cellCtrl.getCellPosition()),this.hasChartRange=this.getHasChartRange(),this.cellComp.addOrRemoveCssClass(sa,0!==this.rangeCount),this.cellComp.addOrRemoveCssClass(`${sa}-1`,1===this.rangeCount),this.cellComp.addOrRemoveCssClass(`${sa}-2`,2===this.rangeCount),this.cellComp.addOrRemoveCssClass(`${sa}-3`,3===this.rangeCount),this.cellComp.addOrRemoveCssClass(`${sa}-4`,this.rangeCount>=4),this.cellComp.addOrRemoveCssClass("ag-cell-range-chart",this.hasChartRange),gi(this.eGui,this.rangeCount>0||void 0),this.cellComp.addOrRemoveCssClass("ag-cell-range-single-cell",this.isSingleCell()),this.updateRangeBorders(),this.refreshHandle())}updateRangeBorders(){const e=this.getRangeBorders(),t=this.isSingleCell(),i=!t&&e.top,n=!t&&e.right,s=!t&&e.bottom,r=!t&&e.left;this.cellComp.addOrRemoveCssClass("ag-cell-range-top",i),this.cellComp.addOrRemoveCssClass("ag-cell-range-right",n),this.cellComp.addOrRemoveCssClass("ag-cell-range-bottom",s),this.cellComp.addOrRemoveCssClass("ag-cell-range-left",r)}isSingleCell(){const{rangeService:e}=this.beans;return 1===this.rangeCount&&!!e&&!e.isMoreThanOneCell()}getHasChartRange(){const{rangeService:e}=this.beans;if(!this.rangeCount||!e)return!1;const t=e.getCellRanges();return t.length>0&&t.every(e=>He([1,0],e.type))}updateRangeBordersIfRangeCount(){this.rangeCount>0&&(this.updateRangeBorders(),this.refreshHandle())}getRangeBorders(){const e=this.beans.gos.get("enableRtl");let t=!1,i=!1,n=!1,s=!1;const r=this.cellCtrl.getCellPosition().column,o=this.beans.columnModel;let a,l;e?(a=o.getDisplayedColAfter(r),l=o.getDisplayedColBefore(r)):(a=o.getDisplayedColBefore(r),l=o.getDisplayedColAfter(r));const c=this.rangeService.getCellRanges().filter(e=>this.rangeService.isCellInSpecificRange(this.cellCtrl.getCellPosition(),e));a||(s=!0),l||(i=!0);for(let e=0;e<c.length&&!(t&&i&&n&&s);e++){const r=c[e],o=this.rangeService.getRangeStartRow(r),h=this.rangeService.getRangeEndRow(r);!t&&this.beans.rowPositionUtils.sameRow(o,this.cellCtrl.getCellPosition())&&(t=!0),!n&&this.beans.rowPositionUtils.sameRow(h,this.cellCtrl.getCellPosition())&&(n=!0),!s&&a&&r.columns.indexOf(a)<0&&(s=!0),!i&&l&&r.columns.indexOf(l)<0&&(i=!0)}return{top:t,right:i,bottom:n,left:s}}refreshHandle(){if(this.beans.context.isDestroyed())return;const e=this.shouldHaveSelectionHandle();this.selectionHandle&&!e&&(this.selectionHandle=this.beans.context.destroyBean(this.selectionHandle)),e&&this.addSelectionHandle(),this.cellComp.addOrRemoveCssClass("ag-cell-range-handle",!!this.selectionHandle)}shouldHaveSelectionHandle(){const e=this.beans.gos,t=this.rangeService.getCellRanges(),i=t.length;if(this.rangeCount<1||i<1)return!1;const n=Ie(t),s=this.cellCtrl.getCellPosition(),r=e.get("enableFillHandle")&&!this.cellCtrl.isSuppressFillHandle(),o=e.get("enableRangeHandle");let a=1===i&&!this.cellCtrl.isEditing()&&(r||o);if(this.hasChartRange){const e=1===t[0].type&&this.rangeService.isCellInSpecificRange(s,t[0]);this.cellComp.addOrRemoveCssClass("ag-cell-range-chart-category",e),a=0===n.type}return a&&null!=n.endRow&&this.rangeService.isContiguousRange(n)&&this.rangeService.isBottomRightCell(n,s)}addSelectionHandle(){const e=this.beans.gos,t=Ie(this.rangeService.getCellRanges()).type,i=e.get("enableFillHandle")&&C(t)?0:1;this.selectionHandle&&this.selectionHandle.getType()!==i&&(this.selectionHandle=this.beans.context.destroyBean(this.selectionHandle)),this.selectionHandle||(this.selectionHandle=this.selectionHandleFactory.createSelectionHandle(i)),this.selectionHandle.refresh(this.cellCtrl)}destroy(){this.beans.context.destroyBean(this.selectionHandle)}},oa=class extends st{constructor(e,t){super(),this.cellCtrl=e,this.beans=t,this.column=e.getColumn(),this.rowNode=e.getRowNode()}setupRowSpan(){this.rowSpan=this.column.getRowSpan(this.rowNode),this.addManagedListener(this.beans.eventService,ct.EVENT_NEW_COLUMNS_LOADED,()=>this.onNewColumnsLoaded())}setComp(e){this.eGui=e,this.setupColSpan(),this.setupRowSpan(),this.onLeftChanged(),this.onWidthChanged(),this.applyRowSpan()}onNewColumnsLoaded(){const e=this.column.getRowSpan(this.rowNode);this.rowSpan!==e&&(this.rowSpan=e,this.applyRowSpan(!0))}onDisplayColumnsChanged(){const e=this.getColSpanningList();Re(this.colsSpanning,e)||(this.colsSpanning=e,this.onWidthChanged(),this.onLeftChanged())}setupColSpan(){null!=this.column.getColDef().colSpan&&(this.colsSpanning=this.getColSpanningList(),this.addManagedListener(this.beans.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayColumnsChanged.bind(this)),this.addManagedListener(this.beans.eventService,ct.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onWidthChanged.bind(this)))}onWidthChanged(){if(!this.eGui)return;const e=this.getCellWidth();this.eGui.style.width=`${e}px`}getCellWidth(){return this.colsSpanning?this.colsSpanning.reduce((e,t)=>e+t.getActualWidth(),0):this.column.getActualWidth()}getColSpanningList(){const e=this.column.getColSpan(this.rowNode),t=[];if(1===e)t.push(this.column);else{let i=this.column;const n=this.column.getPinned();for(let s=0;i&&s<e&&(t.push(i),i=this.beans.columnModel.getDisplayedColAfter(i),i&&!C(i))&&n===i.getPinned();s++);}return t}onLeftChanged(){if(!this.eGui)return;const e=this.modifyLeftForPrintLayout(this.getCellLeft());this.eGui.style.left=e+"px"}getCellLeft(){let e;return e=this.beans.gos.get("enableRtl")&&this.colsSpanning?Ie(this.colsSpanning):this.column,e.getLeft()}modifyLeftForPrintLayout(e){if(!this.cellCtrl.isPrintLayout()||"left"===this.column.getPinned())return e;const t=this.beans.columnModel.getDisplayedColumnsLeftWidth();return"right"===this.column.getPinned()?t+this.beans.columnModel.getBodyContainerWidth()+(e||0):t+(e||0)}applyRowSpan(e){if(1===this.rowSpan&&!e)return;const t=this.beans.gos.getRowHeightAsNumber()*this.rowSpan;this.eGui.style.height=`${t}px`,this.eGui.style.zIndex="1"}destroy(){super.destroy()}},aa=class extends st{constructor(e,t){super(),this.staticClasses=[],this.cellCtrl=e,this.beans=t,this.column=e.getColumn(),this.rowNode=e.getRowNode()}setComp(e){this.cellComp=e,this.applyUserStyles(),this.applyCellClassRules(),this.applyClassesFromColDef()}applyCellClassRules(){const e=this.column.getColDef(),{cellClassRules:t}=e,i=this.beans.gos.addGridCommonParams({value:this.cellCtrl.getValue(),data:this.rowNode.data,node:this.rowNode,colDef:e,column:this.column,rowIndex:this.rowNode.rowIndex});this.beans.stylingService.processClassRules(t===this.cellClassRules?void 0:this.cellClassRules,t,i,e=>this.cellComp.addOrRemoveCssClass(e,!0),e=>this.cellComp.addOrRemoveCssClass(e,!1)),this.cellClassRules=t}applyUserStyles(){const e=this.column.getColDef();if(!e.cellStyle)return;let t;if("function"==typeof e.cellStyle){const i=this.beans.gos.addGridCommonParams({column:this.column,value:this.cellCtrl.getValue(),colDef:e,data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex});t=(0,e.cellStyle)(i)}else t=e.cellStyle;t&&this.cellComp.setUserStyles(t)}applyClassesFromColDef(){const e=this.column.getColDef(),t=this.beans.gos.addGridCommonParams({value:this.cellCtrl.getValue(),data:this.rowNode.data,node:this.rowNode,column:this.column,colDef:e,rowIndex:this.rowNode.rowIndex});this.staticClasses.length&&this.staticClasses.forEach(e=>this.cellComp.addOrRemoveCssClass(e,!1)),this.staticClasses=this.beans.stylingService.getStaticCellClasses(e,t),this.staticClasses.length&&this.staticClasses.forEach(e=>this.cellComp.addOrRemoveCssClass(e,!0))}destroy(){super.destroy()}},la=class{postConstruct(){this.gos.isRowModelType("clientSide")&&(this.clientSideRowModel=this.rowModel),this.gos.isRowModelType("serverSide")&&(this.serverSideRowModel=this.rowModel)}};g([ue("resizeObserverService")],la.prototype,"resizeObserverService",2),g([ue("paginationProxy")],la.prototype,"paginationProxy",2),g([ue("context")],la.prototype,"context",2),g([ue("gridOptionsService")],la.prototype,"gos",2),g([ue("environment")],la.prototype,"environment",2),g([ue("rowRenderer")],la.prototype,"rowRenderer",2),g([ue("valueService")],la.prototype,"valueService",2),g([ue("eventService")],la.prototype,"eventService",2),g([ue("columnModel")],la.prototype,"columnModel",2),g([ue("headerNavigationService")],la.prototype,"headerNavigationService",2),g([ue("navigationService")],la.prototype,"navigationService",2),g([ue("columnAnimationService")],la.prototype,"columnAnimationService",2),g([ue("focusService")],la.prototype,"focusService",2),g([ue("popupService")],la.prototype,"popupService",2),g([ue("stylingService")],la.prototype,"stylingService",2),g([ue("columnHoverService")],la.prototype,"columnHoverService",2),g([ue("userComponentFactory")],la.prototype,"userComponentFactory",2),g([ue("userComponentRegistry")],la.prototype,"userComponentRegistry",2),g([ue("animationFrameService")],la.prototype,"animationFrameService",2),g([ue("dragService")],la.prototype,"dragService",2),g([ue("dragAndDropService")],la.prototype,"dragAndDropService",2),g([ue("sortController")],la.prototype,"sortController",2),g([ue("filterManager")],la.prototype,"filterManager",2),g([ue("rowContainerHeightService")],la.prototype,"rowContainerHeightService",2),g([ue("frameworkOverrides")],la.prototype,"frameworkOverrides",2),g([ue("cellPositionUtils")],la.prototype,"cellPositionUtils",2),g([ue("rowPositionUtils")],la.prototype,"rowPositionUtils",2),g([ue("selectionService")],la.prototype,"selectionService",2),g([ue("rowCssClassCalculator")],la.prototype,"rowCssClassCalculator",2),g([ue("rowModel")],la.prototype,"rowModel",2),g([ue("ctrlsService")],la.prototype,"ctrlsService",2),g([ue("ctrlsFactory")],la.prototype,"ctrlsFactory",2),g([ue("agStackComponentsRegistry")],la.prototype,"agStackComponentsRegistry",2),g([ue("valueCache")],la.prototype,"valueCache",2),g([ue("rowNodeEventThrottle")],la.prototype,"rowNodeEventThrottle",2),g([ue("localeService")],la.prototype,"localeService",2),g([ue("syncService")],la.prototype,"syncService",2),g([ue("ariaAnnouncementService")],la.prototype,"ariaAnnouncementService",2),g([de("rangeService")],la.prototype,"rangeService",2),g([de("selectionHandleFactory")],la.prototype,"selectionHandleFactory",2),g([le],la.prototype,"postConstruct",1),la=g([he("beans")],la);var ca=class extends la{constructor(e,t,i){super(),this.cellCtrl=e,this.beans=t,this.column=i}onMouseEvent(e,t){if(!Xe(t))switch(e){case"click":this.onCellClicked(t);break;case"mousedown":case"touchstart":this.onMouseDown(t);break;case"dblclick":this.onCellDoubleClicked(t);break;case"mouseout":this.onMouseOut(t);break;case"mouseover":this.onMouseOver(t)}}onCellClicked(e){if(this.isDoubleClickOnIPad())return this.onCellDoubleClicked(e),void e.preventDefault();const{eventService:t,rangeService:i,gos:n}=this.beans,s=e.ctrlKey||e.metaKey;i&&s&&i.getCellRangeCount(this.cellCtrl.getCellPosition())>1&&i.intersectLastRange(!0);const r=this.cellCtrl.createEvent(e,ct.EVENT_CELL_CLICKED);t.dispatchEvent(r);const o=this.column.getColDef();o.onCellClicked&&window.setTimeout(()=>{this.beans.frameworkOverrides.wrapOutgoing(()=>{o.onCellClicked(r)})},0),!n.get("singleClickEdit")&&!o.singleClickEdit||n.get("suppressClickEdit")||e.shiftKey&&0!=(null==i?void 0:i.getCellRanges().length)||this.cellCtrl.startRowOrCellEdit()}isDoubleClickOnIPad(){if(!Pi()||Ze("dblclick"))return!1;const e=(new Date).getTime(),t=e-this.lastIPadMouseClickEvent<200;return this.lastIPadMouseClickEvent=e,t}onCellDoubleClicked(e){const t=this.column.getColDef(),i=this.cellCtrl.createEvent(e,ct.EVENT_CELL_DOUBLE_CLICKED);this.beans.eventService.dispatchEvent(i),"function"==typeof t.onCellDoubleClicked&&window.setTimeout(()=>{this.beans.frameworkOverrides.wrapOutgoing(()=>{t.onCellDoubleClicked(i)})},0),!this.beans.gos.get("singleClickEdit")&&!this.beans.gos.get("suppressClickEdit")&&this.cellCtrl.startRowOrCellEdit(null,e)}onMouseDown(e){const{ctrlKey:t,metaKey:i,shiftKey:n}=e,s=e.target,{cellCtrl:r,beans:o}=this,{eventService:a,rangeService:l,focusService:c}=o;if(this.isRightClickInExistingRange(e))return;const h=l&&0!=l.getCellRanges().length;if(!n||!h){const e=Ti()&&!r.isEditing()&&!on(s);r.focusCell(e)}if(n&&h&&!c.isCellFocused(r.getCellPosition())){e.preventDefault();const t=c.getFocusedCell();if(t){const{column:e,rowIndex:i,rowPinned:n}=t,s=o.rowRenderer.getRowByPosition({rowIndex:i,rowPinned:n}),r=null==s?void 0:s.getCellCtrl(e);(null==r?void 0:r.isEditing())&&r.stopEditing(),c.setFocusedCell({column:e,rowIndex:i,rowPinned:n,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}}if(!this.containsWidget(s)){if(l){const e=this.cellCtrl.getCellPosition();if(n)l.extendLatestRangeToCell(e);else{const n=t||i;l.setRangeToCell(e,n)}}a.dispatchEvent(this.cellCtrl.createEvent(e,ct.EVENT_CELL_MOUSE_DOWN))}}isRightClickInExistingRange(e){const{rangeService:t}=this.beans;if(t){const i=t.isCellInAnyRange(this.cellCtrl.getCellPosition()),n=2===e.button||e.ctrlKey&&this.beans.gos.get("allowContextMenuWithControlKey");if(i&&n)return!0}return!1}containsWidget(e){return hn(e,"ag-selection-checkbox",3)}onMouseOut(e){if(this.mouseStayingInsideCell(e))return;const t=this.cellCtrl.createEvent(e,ct.EVENT_CELL_MOUSE_OUT);this.beans.eventService.dispatchEvent(t),this.beans.columnHoverService.clearMouseOver()}onMouseOver(e){if(this.mouseStayingInsideCell(e))return;const t=this.cellCtrl.createEvent(e,ct.EVENT_CELL_MOUSE_OVER);this.beans.eventService.dispatchEvent(t),this.beans.columnHoverService.setMouseOver([this.column])}mouseStayingInsideCell(e){if(!e.target||!e.relatedTarget)return!1;const t=this.cellCtrl.getGui(),i=t.contains(e.target),n=t.contains(e.relatedTarget);return i&&n}destroy(){}},ha=class extends st{constructor(e,t,i,n,s){super(),this.cellCtrl=e,this.beans=t,this.rowNode=n,this.rowCtrl=s}setComp(e){this.eGui=e}onKeyDown(e){const t=e.key;switch(t){case Zn.ENTER:this.onEnterKeyDown(e);break;case Zn.F2:this.onF2KeyDown(e);break;case Zn.ESCAPE:this.onEscapeKeyDown(e);break;case Zn.TAB:this.onTabKeyDown(e);break;case Zn.BACKSPACE:case Zn.DELETE:this.onBackspaceOrDeleteKeyDown(t,e);break;case Zn.DOWN:case Zn.UP:case Zn.RIGHT:case Zn.LEFT:this.onNavigationKeyDown(e,t)}}onNavigationKeyDown(e,t){this.cellCtrl.isEditing()||(e.shiftKey&&this.cellCtrl.isRangeSelectionEnabled()?this.onShiftRangeSelect(e):this.beans.navigationService.navigateToNextCell(e,t,this.cellCtrl.getCellPosition(),!0),e.preventDefault())}onShiftRangeSelect(e){if(!this.beans.rangeService)return;const t=this.beans.rangeService.extendLatestRangeInDirection(e);t&&this.beans.navigationService.ensureCellVisible(t)}onTabKeyDown(e){this.beans.navigationService.onTabKeyDown(this.cellCtrl,e)}onBackspaceOrDeleteKeyDown(e,t){var i;const{cellCtrl:n,beans:s,rowNode:r}=this,{gos:o,rangeService:a,eventService:l}=s;if(!n.isEditing()){if(l.dispatchEvent({type:ct.EVENT_KEY_SHORTCUT_CHANGED_CELL_START}),is(e,o.get("enableCellEditingOnBackspace"))){if(a&&o.get("enableRangeSelection"))a.clearCellRangeCellValues({dispatchWrapperEvents:!0,wrapperEventSource:"deleteKey"});else if(n.isCellEditable()){const e=n.getColumn(),t=null!=(i=this.beans.valueService.parseValue(e,r,"",r.getValueFromValueService(e)))?i:null;r.setDataValue(e,t,"cellClear")}}else n.startRowOrCellEdit(e,t);l.dispatchEvent({type:ct.EVENT_KEY_SHORTCUT_CHANGED_CELL_END})}}onEnterKeyDown(e){if(this.cellCtrl.isEditing()||this.rowCtrl.isEditing())this.cellCtrl.stopEditingAndFocus(!1,e.shiftKey);else if(this.beans.gos.get("enterNavigatesVertically")){const t=e.shiftKey?Zn.UP:Zn.DOWN;this.beans.navigationService.navigateToNextCell(null,t,this.cellCtrl.getCellPosition(),!1)}else this.cellCtrl.startRowOrCellEdit(Zn.ENTER,e),this.cellCtrl.isEditing()&&e.preventDefault()}onF2KeyDown(e){this.cellCtrl.isEditing()||this.cellCtrl.startRowOrCellEdit(Zn.F2,e)}onEscapeKeyDown(e){this.cellCtrl.isEditing()&&(this.cellCtrl.stopRowOrCellEdit(!0),this.cellCtrl.focusCell(!0))}processCharacter(e){if(e.target!==this.eGui||this.cellCtrl.isEditing())return;const t=e.key;" "===t?this.onSpaceKeyDown(e):(this.cellCtrl.startRowOrCellEdit(t,e),e.preventDefault())}onSpaceKeyDown(e){const{gos:t}=this.beans;if(!this.cellCtrl.isEditing()&&t.isRowSelection()){const i=this.rowNode.isSelected(),n=!i;if(n||!t.get("suppressRowDeselection")){const t=this.beans.gos.get("groupSelectsFiltered"),s=this.rowNode.setSelectedParams({newValue:n,rangeSelect:e.shiftKey,groupSelectsFiltered:t,event:e,source:"spaceKey"});void 0===i&&0===s&&this.rowNode.setSelectedParams({newValue:!1,rangeSelect:e.shiftKey,groupSelectsFiltered:t,event:e,source:"spaceKey"})}}e.preventDefault()}destroy(){super.destroy()}},ua=class extends Cs{constructor(e,t,i){super('<div class="ag-drag-handle ag-row-drag" draggable="true"></div>'),this.rowNode=e,this.column=t,this.eCell=i}postConstruct(){this.getGui().appendChild(qn("rowDrag",this.gos,null)),this.addGuiEventListener("mousedown",e=>{e.stopPropagation()}),this.addDragSource(),this.checkVisibility()}addDragSource(){this.addGuiEventListener("dragstart",this.onDragStart.bind(this))}onDragStart(e){const t=this.column.getColDef().dndSourceOnRowDrag;e.dataTransfer.setDragImage(this.eCell,0,0);t?t(this.gos.addGridCommonParams({rowNode:this.rowNode,dragEvent:e})):(()=>{try{const t=JSON.stringify(this.rowNode.data);e.dataTransfer.setData("application/json",t),e.dataTransfer.setData("text/plain",t)}catch(e){}})()}checkVisibility(){const e=this.column.isDndSource(this.rowNode);this.setDisplayed(e)}};g([le],ua.prototype,"postConstruct",1);var da=class{static getHeaderClassesFromColDef(e,t,i,n){return C(e)?[]:this.getColumnClassesFromCollDef(e.headerClass,e,t,i,n)}static getToolPanelClassesFromColDef(e,t,i,n){return C(e)?[]:this.getColumnClassesFromCollDef(e.toolPanelClass,e,t,i,n)}static refreshFirstAndLastStyles(e,t,i){e.addOrRemoveCssClass("ag-column-first",i.isColumnAtEdge(t,"first")),e.addOrRemoveCssClass("ag-column-last",i.isColumnAtEdge(t,"last"))}static getClassParams(e,t,i,n){return t.addGridCommonParams({colDef:e,column:i,columnGroup:n})}static getColumnClassesFromCollDef(e,t,i,n,s){if(C(e))return[];let r;return r="function"==typeof e?e(this.getClassParams(t,i,n,s)):e,"string"==typeof r?[r]:Array.isArray(r)?[...r]:[]}},pa=0,ga=class e extends st{constructor(e,t,i,n){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=i,this.rowCtrl=n,this.instanceId=e.getId()+"-"+pa++,this.colIdSanitised=bt(this.column.getId()),i.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 oa(this,this.beans),this.addDestroyFunc(()=>{var e;null==(e=this.cellPositionFeature)||e.destroy(),this.cellPositionFeature=null}),this.cellCustomStyleFeature=new aa(this,this.beans),this.addDestroyFunc(()=>{var e;null==(e=this.cellCustomStyleFeature)||e.destroy(),this.cellCustomStyleFeature=null}),this.cellMouseListenerFeature=new ca(this,this.beans,this.column),this.addDestroyFunc(()=>{var e;null==(e=this.cellMouseListenerFeature)||e.destroy(),this.cellMouseListenerFeature=null}),this.cellKeyboardListenerFeature=new ha(this,this.beans,this.column,this.rowNode,this.rowCtrl),this.addDestroyFunc(()=>{var e;null==(e=this.cellKeyboardListenerFeature)||e.destroy(),this.cellKeyboardListenerFeature=null}),this.column.isTooltipEnabled()&&(this.enableTooltipFeature(),this.addDestroyFunc(()=>{this.disableTooltipFeature()})),this.beans.rangeService&&this.beans.gos.get("enableRangeSelection")&&(this.cellRangeFeature=new ra(this.beans,this),this.addDestroyFunc(()=>{var e;null==(e=this.cellRangeFeature)||e.destroy(),this.cellRangeFeature=null}))}enableTooltipFeature(e,t){const i="whenTruncated"===this.beans.gos.get("tooltipShowMode");t||!i||this.isCellRenderer()||(t=()=>{const e=this.getGui(),t=0===e.children.length?e:e.querySelector(".ag-cell-value");return!t||t.scrollWidth>t.clientWidth});const n={getColumn:()=>this.column,getColDef:()=>this.column.getColDef(),getRowIndex:()=>this.cellPosition.rowIndex,getRowNode:()=>this.rowNode,getGui:()=>this.getGui(),getLocation:()=>"cell",getTooltipValue:null!=e?()=>e:()=>{const e=this.column.getColDef(),t=this.rowNode.data;if(e.tooltipField&&b(t))return F(t,e.tooltipField,this.column.isTooltipFieldContainsDots());const i=e.tooltipValueGetter;return i?i(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},getValueFormatted:()=>this.valueFormatted,shouldDisplayTooltip:t};this.tooltipFeature=new ys(n,this.beans)}disableTooltipFeature(){this.tooltipFeature&&(this.tooltipFeature.destroy(),this.tooltipFeature=null)}setComp(e,t,i,n,s){var r,o,a,l;this.cellComp=e,this.eGui=t,this.printLayout=n,this.addDomData(),this.onCellFocused(this.focusEventToRestore),this.applyStaticCssClasses(),this.setWrapText(),this.onFirstRightPinnedChanged(),this.onLastLeftPinnedChanged(),this.onColumnHover(),this.setupControlComps(),this.setupAutoHeight(i),this.refreshFirstAndLastStyles(),this.refreshAriaColIndex(),null==(r=this.cellPositionFeature)||r.setComp(t),null==(o=this.cellCustomStyleFeature)||o.setComp(e),null==(a=this.tooltipFeature)||a.refreshToolTip(),null==(l=this.cellKeyboardListenerFeature)||l.setComp(this.eGui),this.cellRangeFeature&&this.cellRangeFeature.setComp(e,t),s&&this.isCellEditable()?this.startEditing():this.showValue(),this.onCellCompAttachedFuncs.length&&(this.onCellCompAttachedFuncs.forEach(e=>e()),this.onCellCompAttachedFuncs=[])}setupAutoHeight(e){if(this.isAutoHeight=this.column.isAutoHeight(),!this.isAutoHeight||!e)return;const t=e.parentElement,i=this.beans.gos.getRowHeightForNode(this.rowNode).height,n=s=>{if(this.editing)return;if(!this.isAlive())return;const{paddingTop:r,paddingBottom:o,borderBottomWidth:a,borderTopWidth:l}=un(t),c=r+o+a+l,h=e.offsetHeight+c;if(s<5){const t=this.beans.gos.getDocument();if(!t||!t.contains(e)||0==h)return void window.setTimeout(()=>n(s+1),0)}const u=Math.max(h,i);this.rowNode.setRowAutoHeight(u,this.column)},s=()=>n(0);s();const r=this.beans.resizeObserverService.observeResize(e,s);this.addDestroyFunc(()=>{r(),this.rowNode.setRowAutoHeight(void 0,this.column)})}getCellAriaRole(){var e;return null!=(e=this.column.getColDef().cellAriaRole)?e:"gridcell"}getInstanceId(){return this.instanceId}getColumnIdSanitised(){return this.colIdSanitised}getTabIndex(){return this.tabIndex}isCellRenderer(){const e=this.column.getColDef();return null!=e.cellRenderer||null!=e.cellRendererSelector}getValueToDisplay(){var e;return null!=(e=this.valueFormatted)?e:this.value}showValue(e=!1){var t;const i=this.getValueToDisplay();let n;if(this.rowNode.stub){const e=this.createCellRendererParams();n=this.beans.userComponentFactory.getLoadingCellRendererDetails(this.column.getColDef(),e)}else if(this.isCellRenderer()){const e=this.createCellRendererParams();n=this.beans.userComponentFactory.getCellRendererDetails(this.column.getColDef(),e)}this.cellComp.setRenderDetails(n,i,e),null==(t=this.cellRangeFeature)||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!(null!=this.rowNode.rowPinned||"function"!=typeof e&&!0!==e)}refreshShouldDestroy(){const e=this.column.getColDef(),t=this.includeSelection!=this.isIncludeControl(e.checkboxSelection),i=this.includeRowDrag!=this.isIncludeControl(e.rowDrag),n=this.includeDndSource!=this.isIncludeControl(e.dndSource),s=this.isAutoHeight!=this.column.isAutoHeight();return t||i||n||s}startEditing(e=null,t=!1,i=null){if(!this.isCellEditable()||this.editing)return;if(!this.cellComp)return void this.onCellCompAttachedFuncs.push(()=>{this.startEditing(e,t,i)});const n=this.createCellEditorParams(e,t),s=this.column.getColDef(),r=this.beans.userComponentFactory.getCellEditorDetails(s,n);this.editCompDetails=r;const o=null!=(null==r?void 0:r.popupFromSelector)?r.popupFromSelector:!!s.cellEditorPopup,a=null!=(null==r?void 0:r.popupPositionFromSelector)?r.popupPositionFromSelector:s.cellEditorPopupPosition;this.setEditing(!0),this.cellComp.setEditDetails(r,o,a,this.beans.gos.get("reactiveCustomComponents"));const l=this.createEvent(i,ct.EVENT_CELL_EDITING_STARTED);this.beans.eventService.dispatchEvent(l)}setEditing(e){var t;this.editing!==e&&(this.editing=e,null==(t=this.cellRangeFeature)||t.refreshHandle())}stopRowOrCellEdit(e=!1){"fullRow"===this.beans.gos.get("editType")?this.rowCtrl.stopEditing(e):this.stopEditing(e)}onPopupEditorClosed(){this.isEditing()&&this.stopEditingAndFocus()}takeValueFromCellEditor(e){const t={newValueExists:!1};if(e)return t;const i=this.cellComp.getCellEditor();return i?i.isCancelAfterEnd&&i.isCancelAfterEnd()?t:{newValue:i.getValue(),newValueExists:!0}:t}saveNewValue(e,t){if(t===e)return!1;this.suppressRefreshCell=!0;const i=this.rowNode.setDataValue(this.column,t,"edit");return this.suppressRefreshCell=!1,i}stopEditing(e=!1){if(!this.editing)return!1;const{newValue:t,newValueExists:i}=this.takeValueFromCellEditor(e),n=this.rowNode.getValueFromValueService(this.column);let s=!1;return i&&(s=this.saveNewValue(n,t)),this.setEditing(!1),this.cellComp.setEditDetails(),this.editCompDetails=void 0,this.updateAndFormatValue(!1),this.refreshCell({forceRefresh:!0,suppressFlash:!0}),this.dispatchEditingStoppedEvent(n,t,!e&&!!s),s}dispatchEditingStoppedEvent(e,t,i){const n=d(u({},this.createEvent(null,ct.EVENT_CELL_EDITING_STOPPED)),{oldValue:e,newValue:t,valueChanged:i});this.beans.eventService.dispatchEvent(n)}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:e=>this.beans.valueService.setValue(this.rowNode,this.column,e),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:(e,t,i,n)=>this.registerRowDragger(e,t,n),setTooltip:(e,t)=>{var i;this.tooltipFeature&&this.disableTooltipFeature(),this.enableTooltipFeature(e,t),null==(i=this.tooltipFeature)||i.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()?null==(t=this.rowCtrl)||t.recreateCell(this):this.refreshCell(e)}refreshCell(e){var t,i,n,s;if(this.suppressRefreshCell||this.editing)return;const r=this.column.getColDef(),o=null!=e&&!!e.newData,a=null!=e&&!!e.suppressFlash||!!r.suppressCellFlash,l=null==r.field&&null==r.valueGetter&&null==r.showRowGroup,c=e&&e.forceRefresh||l||o,h=!!this.cellComp,u=this.updateAndFormatValue(h);if(h){if(c||u){this.showValue(o);const e=this.beans.filterManager.isSuppressFlashingCellsBecauseFiltering();!a&&!e&&(this.beans.gos.get("enableCellChangeFlash")||r.enableCellChangeFlash)&&this.flashCell(),null==(t=this.cellCustomStyleFeature)||t.applyUserStyles(),null==(i=this.cellCustomStyleFeature)||i.applyClassesFromColDef()}null==(n=this.tooltipFeature)||n.refreshToolTip(),null==(s=this.cellCustomStyleFeature)||s.applyCellClassRules()}}stopEditingAndFocus(e=!1,t=!1){this.stopRowOrCellEdit(),this.focusCell(!0),e||this.navigateAfterEdit(t)}navigateAfterEdit(e){if(this.beans.gos.get("enterNavigatesVerticallyAfterEdit")){const t=e?Zn.UP:Zn.DOWN;this.beans.navigationService.navigateToNextCell(null,t,this.getCellPosition(),!1)}}flashCell(e){var t,i;const n=null!=(t=null==e?void 0:e.flashDuration)?t:null==e?void 0:e.flashDelay,s=null!=(i=null==e?void 0:e.fadeDuration)?i:null==e?void 0:e.fadeDelay;this.animateCell("data-changed",n,s)}animateCell(e,t,i){if(!this.cellComp)return;const n=`ag-cell-${e}`,s=`ag-cell-${e}-animation`,{gos:r}=this.beans;t||(t=r.get("cellFlashDuration")),b(i)||(i=r.get("cellFadeDuration")),this.cellComp.addOrRemoveCssClass(n,!0),this.cellComp.addOrRemoveCssClass(s,!1),this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{this.isAlive()&&(this.cellComp.addOrRemoveCssClass(n,!1),this.cellComp.addOrRemoveCssClass(s,!0),this.eGui.style.transition=`background-color ${i}ms`,window.setTimeout(()=>{this.isAlive()&&(this.cellComp.addOrRemoveCssClass(s,!1),this.eGui.style.transition="")},i))},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 null!=(t=this.callValueFormatter(e))?t:e}callValueFormatter(e){return this.beans.valueService.formatValue(this.column,this.rowNode,e)}updateAndFormatValue(e){const t=this.value,i=this.valueFormatted;return this.value=this.rowNode.getValueFromValueService(this.column),this.valueFormatted=this.callValueFormatter(this.value),!e||!this.valuesAreEqual(t,this.value)||this.valueFormatted!=i}valuesAreEqual(e,t){const i=this.column.getColDef();return i.equals?i.equals(e,t):e===t}getComp(){return this.cellComp}getValue(){return this.value}addDomData(){const t=this.getGui();this.beans.gos.setDomData(t,e.DOM_DATA_KEY_CELL_CTRL,this),this.addDestroyFunc(()=>this.beans.gos.setDomData(t,e.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;null==(t=this.cellKeyboardListenerFeature)||t.processCharacter(e)}onKeyDown(e){var t;null==(t=this.cellKeyboardListenerFeature)||t.onKeyDown(e)}onMouseEvent(e,t){var i;null==(i=this.cellMouseListenerFeature)||i.onMouseEvent(e,t)}getGui(){return this.eGui}getColSpanningList(){return this.cellPositionFeature.getColSpanningList()}onLeftChanged(){var e;this.cellComp&&(null==(e=this.cellPositionFeature)||e.onLeftChanged())}onDisplayedColumnsChanged(){this.eGui&&(this.refreshAriaColIndex(),this.refreshFirstAndLastStyles())}refreshFirstAndLastStyles(){const{cellComp:e,column:t,beans:i}=this;da.refreshFirstAndLastStyles(e,t,i.columnModel)}refreshAriaColIndex(){const e=this.beans.columnModel.getAriaColumnIndex(this.column);hi(this.getGui(),e)}isSuppressNavigable(){return this.column.isSuppressNavigable(this.rowNode)}onWidthChanged(){var e;return null==(e=this.cellPositionFeature)?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){this.cellComp?"fullRow"===this.beans.gos.get("editType")?this.rowCtrl.startRowEditing(e,this):this.startEditing(e,!0,t):this.onCellCompAttachedFuncs.push(()=>{this.startRowOrCellEdit(e,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 null!=this.cellRangeFeature}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("ag-cell-first-right-pinned",e)}onLastLeftPinnedChanged(){if(!this.cellComp)return;const e=this.column.isLastLeftPinned();this.cellComp.addOrRemoveCssClass("ag-cell-last-left-pinned",e)}onCellFocused(e){if(this.beans.gos.get("suppressCellFocus"))return;const t=this.beans.focusService.isCellFocused(this.cellPosition);if(!this.cellComp)return void(t&&(null==e?void 0:e.forceBrowserFocus)&&(this.focusEventToRestore=e));this.focusEventToRestore=void 0,this.cellComp.addOrRemoveCssClass("ag-cell-focus",t),t&&e&&e.forceBrowserFocus&&this.cellComp.getFocusableElement().focus({preventScroll:!!e.preventScrollOnBrowserFocus});const i="fullRow"===this.beans.gos.get("editType");t||i||!this.editing||this.stopRowOrCellEdit(),t&&this.rowCtrl.announceDescription()}createCellPosition(){this.cellPosition={rowIndex:this.rowNode.rowIndex,rowPinned:v(this.rowNode.rowPinned),column:this.column}}applyStaticCssClasses(){this.cellComp.addOrRemoveCssClass("ag-cell",!0),this.cellComp.addOrRemoveCssClass("ag-cell-not-inline-editing",!0);const e=1==this.column.isAutoHeight();this.cellComp.addOrRemoveCssClass("ag-cell-auto-height",e),this.cellComp.addOrRemoveCssClass("ag-cell-normal-height",!e)}onColumnHover(){if(!this.cellComp)return;if(!this.beans.gos.get("columnHoverHighlight"))return;const e=this.beans.columnHoverService.isHovered(this.column);this.cellComp.addOrRemoveCssClass("ag-column-hover",e)}onColDefChanged(){if(this.cellComp)if(this.column.isTooltipEnabled()?(this.disableTooltipFeature(),this.enableTooltipFeature()):this.disableTooltipFeature(),this.setWrapText(),this.editing){const e=this.getCellEditor();if(null==e?void 0:e.refresh){const{eventKey:t,cellStartedEdit:i}=this.editCompDetails.params,n=this.createCellEditorParams(t,i),s=this.column.getColDef(),r=this.beans.userComponentFactory.getCellEditorDetails(s,n);e.refresh(r.params)}}else this.refreshOrDestroyCell({forceRefresh:!0,suppressFlash:!0})}setWrapText(){const e=1==this.column.getColDef().wrapText;this.cellComp.addOrRemoveCssClass("ag-cell-wrap-text",e)}dispatchCellContextMenuEvent(e){const t=this.column.getColDef(),i=this.createEvent(e,ct.EVENT_CELL_CONTEXT_MENU);this.beans.eventService.dispatchEvent(i),t.onCellContextMenu&&window.setTimeout(()=>{this.beans.frameworkOverrides.wrapOutgoing(()=>{t.onCellContextMenu(i)})},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 Nr;return this.beans.context.createBean(e),e.init({rowNode:this.rowNode,column:this.column}),e}createDndSource(){const e=new ua(this.rowNode,this.column,this.eGui);return this.beans.context.createBean(e),e}registerRowDragger(e,t,i){if(this.customRowDragComp)return void this.customRowDragComp.setDragElement(e,t);const n=this.createRowDragComp(e,t,i);n&&(this.customRowDragComp=n,this.addDestroyFunc(()=>{this.beans.context.destroyBean(n),this.customRowDragComp=null}))}createRowDragComp(e,t,i){const n=this.beans.gos.get("pagination"),s=this.beans.gos.get("rowDragManaged"),r=this.beans.gos.isRowModelType("clientSide");if(s){if(!r)return void z("managed row dragging is only allowed in the Client Side Row Model");if(n)return void z("managed row dragging is not possible when doing pagination")}const o=new Vr(()=>this.value,this.rowNode,this.column,e,t,i);return this.beans.context.createBean(o),o}};ga.DOM_DATA_KEY_CELL_CTRL="cellCtrl";var fa=ga,ma=0,ya=class e extends st{constructor(e,t,i,n,s){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=n,this.printLayout=s,this.suppressRowTransform=this.gos.get("suppressRowTransform"),this.instanceId=e.id+"-"+ma++,this.rowId=bt(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(i),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("function"!=typeof this.businessKeyForNodeFunc)return;const e=this.businessKeyForNodeFunc(this.rowNode);this.businessKeySanitised=bt(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,i){const n={rowComp:e,element:t,containerType:i};this.allRowGuis.push(n),"left"===i?this.leftGui=n:"right"===i?this.rightGui=n:"fullWidth"===i?this.fullWidthGui=n:this.centerGui=n,this.initialiseRowComp(n),"FullWidthLoading"===this.rowType||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}}isCacheable(){return"FullWidthDetail"===this.rowType&&this.gos.get("keepDetailRows")}setCached(e){const t=e?"none":"";this.allRowGuis.forEach(e=>e.element.style.display=t)}initialiseRowComp(t){const i=this.gos;this.listenOnDomOrder(t),this.beans.columnModel.wasAutoRowHeightEverActive()&&this.rowNode.checkAutoHeights(),this.onRowHeightChanged(t),this.updateRowIndexes(t),this.setFocusedClasses(t),this.setStylesFromGridOptions(!1,t),i.isRowSelection()&&this.rowNode.selectable&&this.onRowSelected(t),this.updateColumnLists(!this.useAnimationFrameForCreate);const n=t.rowComp;this.getInitialRowClasses(t.containerType).forEach(e=>n.addOrRemoveCssClass(e,!0)),this.executeSlideAndFadeAnimations(t),this.rowNode.group&&ii(t.element,1==this.rowNode.expanded),this.setRowCompRowId(n),this.setRowCompRowBusinessKey(n),i.setDomData(t.element,e.DOM_DATA_KEY_ROW_CTRL,this),this.addDestroyFunc(()=>i.setDomData(t.element,e.DOM_DATA_KEY_ROW_CTRL,null)),this.useAnimationFrameForCreate?this.beans.animationFrameService.createTask(this.addHoverFunctionality.bind(this,t.element),this.rowNode.rowIndex,"createTasksP2"):this.addHoverFunctionality(t.element),this.isFullWidth()&&this.setupFullWidth(t),i.get("rowDragEntireRow")&&this.addRowDraggerToRow(t),this.useAnimationFrameForCreate&&this.beans.animationFrameService.addDestroyTask(()=>{this.isAlive()&&t.rowComp.addOrRemoveCssClass("ag-after-created",!0)}),this.executeProcessRowPostCreateFunc()}setRowCompRowBusinessKey(e){null!=this.businessKeySanitised&&e.setRowBusinessKey(this.businessKeySanitised)}getBusinessKey(){return this.businessKeySanitised}setRowCompRowId(e){this.rowId=bt(this.rowNode.id),null!=this.rowId&&e.setRowId(this.rowId)}executeSlideAndFadeAnimations(e){const{containerType:t}=e;this.slideInAnimation[t]&&(X(()=>{this.onTopChanged()}),this.slideInAnimation[t]=!1),this.fadeInAnimation[t]&&(X(()=>{e.rowComp.addOrRemoveCssClass("ag-opacity-zero",!1)}),this.fadeInAnimation[t]=!1)}addRowDraggerToRow(e){if(this.gos.get("enableRangeSelection"))return void z("Setting `rowDragEntireRow: true` in the gridOptions doesn't work with `enableRangeSelection: true`");const t=this.beans.localeService.getLocaleTextFunc(),i=new Vr(()=>`1 ${t("rowDragRow","row")}`,this.rowNode,void 0,e.element,void 0,!0),n=this.createBean(i,this.beans.context);this.rowDragComps.push(n)}setupFullWidth(e){const t=this.getPinnedForContainer(e.containerType);if("FullWidthDetail"==this.rowType&&!re.__assertRegistered("@ag-grid-enterprise/master-detail","cell renderer 'agDetailCellRenderer' (for master detail)",this.beans.context.getGridId()))return;const i=this.createFullWidthCompDetails(e.element,t);e.rowComp.showFullWidth(i)}isPrintLayout(){return this.printLayout}getFullWidthCellRenderers(){var e,t;return this.gos.get("embedFullWidthRows")?this.allRowGuis.map(e=>{var t;return null==(t=null==e?void 0:e.rowComp)?void 0:t.getFullWidthCellRenderer()}):[null==(t=null==(e=this.fullWidthGui)?void 0:e.rowComp)?void 0:t.getFullWidthCellRenderer()]}getCellElement(e){const t=this.getCellCtrl(e);return t?t.getGui():null}executeProcessRowPostCreateFunc(){const e=this.gos.getCallback("processRowPostCreate");e&&this.areAllContainersReady()&&e({eRow:this.centerGui.element,ePinnedLeftRow:this.leftGui?this.leftGui.element:void 0,ePinnedRightRow:this.rightGui?this.rightGui.element:void 0,node:this.rowNode,rowIndex:this.rowNode.rowIndex,addRenderedRowListener:this.addEventListener.bind(this)})}areAllContainersReady(){const e=!!this.leftGui||!this.beans.columnModel.isPinningLeft(),t=!!this.centerGui,i=!!this.rightGui||!this.beans.columnModel.isPinningRight();return e&&t&&i}setRowType(){const e=this.rowNode.stub&&!this.gos.get("suppressServerSideFullWidthLoadingRow"),t=this.rowNode.isFullWidthCell(),i=this.gos.get("masterDetail")&&this.rowNode.detail,n=this.beans.columnModel.isPivotMode(),s=!!this.rowNode.group&&!this.rowNode.footer&&this.gos.isGroupUseEntireRow(n);this.rowType=e?"FullWidthLoading":i?"FullWidthDetail":t?"FullWidth":s?"FullWidthGroup":"Normal"}updateColumnLists(e=!1,t=!1){this.isFullWidth()||(e||this.gos.get("suppressAnimationFrame")||this.printLayout?this.updateColumnListsImpl(t):this.updateColumnListsPending||(this.beans.animationFrameService.createTask(()=>{this.active&&this.updateColumnListsImpl(!0)},this.rowNode.rowIndex,"createTasksP1"),this.updateColumnListsPending=!0))}createCellCtrls(e,t,i=null){const n={list:[],map:{}},s=(e,t)=>{n.list.push(t),n.map[e]=t};return t.forEach(t=>{const i=t.getInstanceId();let n=e.map[i];n||(n=new fa(t,this.rowNode,this.beans,this)),s(i,n)}),e.list.forEach(e=>{null==n.map[e.getColumn().getInstanceId()]&&(this.isCellEligibleToBeRemoved(e,i)?e.destroy():s(e.getColumn().getInstanceId(),e))}),n}updateColumnListsImpl(e){this.updateColumnListsPending=!1,this.createAllCellCtrls(),this.setCellCtrls(e)}setCellCtrls(e){this.allRowGuis.forEach(t=>{const i=this.getCellCtrlsForContainer(t.containerType);t.rowComp.setCellCtrls(i,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:throw new Error(`Unhandled case: ${e}`)}}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 i=e.getDisplayedLeftColumnsForRow(this.rowNode);this.leftCellCtrls=this.createCellCtrls(this.leftCellCtrls,i,"left");const n=e.getDisplayedRightColumnsForRow(this.rowNode);this.rightCellCtrls=this.createCellCtrls(this.rightCellCtrls,n,"right")}}isCellEligibleToBeRemoved(e,t){const i=!0;if(e.getColumn().getPinned()!=t)return i;const n=e.isEditing(),s=this.beans.focusService.isCellFocused(e.getCellPosition());if(n||s){const t=e.getColumn();return!(this.beans.columnModel.getAllDisplayedColumns().indexOf(t)>=0)&&i}return i}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=b(this.rowNode.oldRowTop),i=this.beans.columnModel.isPinningLeft(),n=this.beans.columnModel.isPinningRight();if(t){if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows"))return void(this.slideInAnimation.fullWidth=!0);this.slideInAnimation.center=!0,this.slideInAnimation.left=i,this.slideInAnimation.right=n}else{if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows"))return void(this.fadeInAnimation.fullWidth=!0);this.fadeInAnimation.center=!0,this.fadeInAnimation.left=i,this.fadeInAnimation.right=n}}isEditing(){return this.editingRow}isFullWidth(){return"Normal"!==this.rowType}refreshFullWidth(){const e=(e,t)=>!e||e.rowComp.refreshFullWidth(()=>this.createFullWidthCompDetails(e.element,t).params),t=e(this.fullWidthGui,null),i=e(this.centerGui,null),n=e(this.leftGui,"left"),s=e(this.rightGui,"right");return t&&i&&n&&s}addListeners(){this.addManagedListener(this.rowNode,Lr.EVENT_HEIGHT_CHANGED,()=>this.onRowHeightChanged()),this.addManagedListener(this.rowNode,Lr.EVENT_ROW_SELECTED,()=>this.onRowSelected()),this.addManagedListener(this.rowNode,Lr.EVENT_ROW_INDEX_CHANGED,this.onRowIndexChanged.bind(this)),this.addManagedListener(this.rowNode,Lr.EVENT_TOP_CHANGED,this.onTopChanged.bind(this)),this.addManagedListener(this.rowNode,Lr.EVENT_EXPANDED_CHANGED,this.updateExpandedCss.bind(this)),this.addManagedListener(this.rowNode,Lr.EVENT_HAS_CHILDREN_CHANGED,this.updateExpandedCss.bind(this)),this.rowNode.detail&&this.addManagedListener(this.rowNode.parent,Lr.EVENT_DATA_CHANGED,this.onRowNodeDataChanged.bind(this)),this.addManagedListener(this.rowNode,Lr.EVENT_DATA_CHANGED,this.onRowNodeDataChanged.bind(this)),this.addManagedListener(this.rowNode,Lr.EVENT_CELL_CHANGED,this.postProcessCss.bind(this)),this.addManagedListener(this.rowNode,Lr.EVENT_HIGHLIGHT_CHANGED,this.onRowNodeHighlightChanged.bind(this)),this.addManagedListener(this.rowNode,Lr.EVENT_DRAGGING_CHANGED,this.postProcessRowDragging.bind(this)),this.addManagedListener(this.rowNode,Lr.EVENT_UI_LEVEL_CHANGED,this.onUiLevelChanged.bind(this));const e=this.beans.eventService;this.addManagedListener(e,ct.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED,this.onPaginationPixelOffsetChanged.bind(this)),this.addManagedListener(e,ct.EVENT_HEIGHT_SCALE_CHANGED,this.onTopChanged.bind(this)),this.addManagedListener(e,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(e,ct.EVENT_VIRTUAL_COLUMNS_CHANGED,this.onVirtualColumnsChanged.bind(this)),this.addManagedListener(e,ct.EVENT_CELL_FOCUSED,this.onCellFocusChanged.bind(this)),this.addManagedListener(e,ct.EVENT_CELL_FOCUS_CLEARED,this.onCellFocusChanged.bind(this)),this.addManagedListener(e,ct.EVENT_PAGINATION_CHANGED,this.onPaginationChanged.bind(this)),this.addManagedListener(e,ct.EVENT_MODEL_UPDATED,this.refreshFirstAndLastRowStyles.bind(this)),this.addManagedListener(e,ct.EVENT_COLUMN_MOVED,this.updateColumnLists.bind(this)),this.addDestroyFunc(()=>{this.destroyBeans(this.rowDragComps,this.beans.context),this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature,this.beans.context))}),this.addManagedPropertyListeners(["rowDragEntireRow"],()=>{this.gos.get("rowDragEntireRow")?this.allRowGuis.forEach(e=>{this.addRowDraggerToRow(e)}):(this.destroyBeans(this.rowDragComps,this.beans.context),this.rowDragComps=[])}),this.addListenersForCellComps()}addListenersForCellComps(){this.addManagedListener(this.rowNode,Lr.EVENT_ROW_INDEX_CHANGED,()=>{this.getAllCellCtrls().forEach(e=>e.onRowIndexChanged())}),this.addManagedListener(this.rowNode,Lr.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);else{if(this.isFullWidth())return void(this.refreshFullWidth()||this.beans.rowRenderer.redrawRow(this.rowNode));this.getAllCellCtrls().forEach(t=>t.refreshCell({suppressFlash:!e.update,newData:!e.update})),this.allRowGuis.forEach(e=>{this.setRowCompRowId(e.rowComp),this.updateRowBusinessKey(),this.setRowCompRowBusinessKey(e.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 i=0===e,n=1===e;t.rowComp.addOrRemoveCssClass("ag-row-highlight-above",i),t.rowComp.addOrRemoveCssClass("ag-row-highlight-below",n)})}postProcessRowDragging(){const e=this.rowNode.dragging;this.allRowGuis.forEach(t=>t.rowComp.addOrRemoveCssClass("ag-row-dragging",e))}updateExpandedCss(){const e=this.rowNode.isExpandable(),t=1==this.rowNode.expanded;this.allRowGuis.forEach(i=>{i.rowComp.addOrRemoveCssClass("ag-row-group",e),i.rowComp.addOrRemoveCssClass("ag-row-group-expanded",e&&t),i.rowComp.addOrRemoveCssClass("ag-row-group-contracted",e&&!t),ii(i.element,e&&t)})}onDisplayedColumnsChanged(){this.updateColumnLists(!0),this.beans.columnModel.wasAutoRowHeightEverActive()&&this.rowNode.checkAutoHeights()}onVirtualColumnsChanged(){this.updateColumnLists(!1,!0)}getRowPosition(){return{rowPinned:v(this.rowNode.rowPinned),rowIndex:this.rowNode.rowIndex}}onKeyboardNavigate(e){const t=this.allRowGuis.find(t=>t.element.contains(e.target));if((t?t.element:null)!==e.target)return;const i=this.rowNode,n=this.beans.focusService.getFocusedCell(),s={rowIndex:i.rowIndex,rowPinned:i.rowPinned,column:n&&n.column};this.beans.navigationService.navigateToNextCell(e,e.key,s,!0),e.preventDefault()}onTabKeyDown(e){if(e.defaultPrevented||Xe(e))return;const t=this.allRowGuis.find(t=>t.element.contains(e.target)),i=t?t.element:null,n=i===e.target;let s=null;n||(s=this.beans.focusService.findNextFocusableElement(i,!1,e.shiftKey)),(this.isFullWidth()&&n||!s)&&this.beans.navigationService.onTabKeyDown(this,e)}getFullWidthElement(){return this.fullWidthGui?this.fullWidthGui.element:null}getRowYPosition(){var e;const t=null==(e=this.allRowGuis.find(e=>xn(e.element)))?void 0:e.element;return t?t.getBoundingClientRect().top:0}onFullWidthRowFocused(e){var t;const i=this.rowNode,n=!!e&&this.isFullWidth()&&e.rowIndex===i.rowIndex&&e.rowPinned==i.rowPinned,s=this.fullWidthGui?this.fullWidthGui.element:null==(t=this.centerGui)?void 0:t.element;s&&(s.classList.toggle("ag-full-width-focus",n),n&&s.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 i={list:[],map:{}};return e.list.forEach(e=>{e!==t&&(i.list.push(e),i.map[e.getColumn().getInstanceId()]=e)}),i}onMouseEvent(e,t){switch(e){case"dblclick":this.onRowDblClick(t);break;case"click":this.onRowClick(t);break;case"touchstart":case"mousedown":this.onRowMouseDown(t)}}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 i=this.createRowEvent(e,t);return i.source=this,i}onRowDblClick(e){if(Xe(e))return;const t=this.createRowEventWithSource(ct.EVENT_ROW_DOUBLE_CLICKED,e);this.beans.eventService.dispatchEvent(t)}onRowMouseDown(e){if(this.lastMouseDownOnDragger=hn(e.target,"ag-row-drag",3),!this.isFullWidth())return;const t=this.rowNode,i=this.beans.columnModel;this.beans.rangeService&&this.beans.rangeService.removeAllCellRanges(),this.beans.focusService.setFocusedCell({rowIndex:t.rowIndex,column:i.getAllDisplayedColumns()[0],rowPinned:t.rowPinned,forceBrowserFocus:!0})}onRowClick(e){if(Xe(e)||this.lastMouseDownOnDragger)return;const t=this.createRowEventWithSource(ct.EVENT_ROW_CLICKED,e);this.beans.eventService.dispatchEvent(t);const i=e.ctrlKey||e.metaKey,n=e.shiftKey;if(this.gos.get("groupSelectsChildren")&&this.rowNode.group||this.isRowSelectionBlocked()||this.gos.get("suppressRowClickSelection"))return;const s=this.gos.get("rowMultiSelectWithClick"),r=!this.gos.get("suppressRowDeselection"),o="rowClicked";if(this.rowNode.isSelected())s?this.rowNode.setSelectedParams({newValue:!1,event:e,source:o}):i?r&&this.rowNode.setSelectedParams({newValue:!1,event:e,source:o}):this.rowNode.setSelectedParams({newValue:!0,clearSelection:!n,rangeSelect:n,event:e,source:o});else{const t=!s&&!i;this.rowNode.setSelectedParams({newValue:!0,clearSelection:t,rangeSelect:n,event:e,source:o})}}isRowSelectionBlocked(){return!this.rowNode.selectable||!!this.rowNode.rowPinned||!this.gos.isRowSelection()}setupDetailRowAutoHeight(e){if("FullWidthDetail"!==this.rowType)return;if(!this.gos.get("detailRowAutoHeight"))return;const t=()=>{const t=e.clientHeight;if(null!=t&&t>0){const e=()=>{this.rowNode.setRowHeight(t),this.beans.clientSideRowModel?this.beans.clientSideRowModel.onRowHeightChanged():this.beans.serverSideRowModel&&this.beans.serverSideRowModel.onRowHeightChanged()};window.setTimeout(e,0)}},i=this.beans.resizeObserverService.observeResize(e,t);this.addDestroyFunc(i),t()}createFullWidthCompDetails(e,t){const i=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:(e,t,i,n)=>this.addFullWidthRowDragging(e,t,i,n),setTooltip:(e,t)=>this.refreshRowTooltip(e,t)});switch(this.rowType){case"FullWidthDetail":return this.beans.userComponentFactory.getFullWidthDetailCellRendererDetails(i);case"FullWidthGroup":return this.beans.userComponentFactory.getFullWidthGroupCellRendererDetails(i);case"FullWidthLoading":return this.beans.userComponentFactory.getFullWidthLoadingCellRendererDetails(i);default:return this.beans.userComponentFactory.getFullWidthCellRendererDetails(i)}}refreshRowTooltip(e,t){if(!this.fullWidthGui)return;const i={getGui:()=>this.fullWidthGui.element,getTooltipValue:()=>e,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:t};this.tooltipFeature&&this.destroyBean(this.tooltipFeature,this.beans.context),this.tooltipFeature=this.createBean(new ys(i,this.beans))}addFullWidthRowDragging(e,t,i="",n){if(!this.isFullWidth())return;const s=new Vr(()=>i,this.rowNode,void 0,e,t,n);this.createBean(s,this.beans.context),this.addDestroyFunc(()=>{this.destroyBean(s,this.beans.context)})}onUiLevelChanged(){const e=this.beans.rowCssClassCalculator.calculateRowLevel(this.rowNode);if(this.rowLevel!=e){const t="ag-row-level-"+e,i="ag-row-level-"+this.rowLevel;this.allRowGuis.forEach(e=>{e.rowComp.addOrRemoveCssClass(t,!0),e.rowComp.addOrRemoveCssClass(i,!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(t=>t.rowComp.addOrRemoveCssClass("ag-row-first",e))),this.lastRowOnPage!==t&&(this.lastRowOnPage=t,this.allRowGuis.forEach(e=>e.rowComp.addOrRemoveCssClass("ag-row-last",t)))}stopEditing(e=!1){if(this.stoppingRowEdit)return;const t=this.getAllCellCtrls(),i=this.editingRow;this.stoppingRowEdit=!0;let n=!1;for(const s of t){const t=s.stopEditing(e);i&&!e&&!n&&t&&(n=!0)}if(n){const e=this.createRowEvent(ct.EVENT_ROW_VALUE_CHANGED);this.beans.eventService.dispatchEvent(e)}i&&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(t=>t.rowComp.addOrRemoveCssClass("ag-row-editing",e));const t=e?this.createRowEvent(ct.EVENT_ROW_EDITING_STARTED):this.createRowEvent(ct.EVENT_ROW_EDITING_STOPPED);this.beans.eventService.dispatchEvent(t)}startRowEditing(e=null,t=null,i=null){this.editingRow||this.getAllCellCtrls().reduce((n,s)=>{const r=s===t;return r?s.startEditing(e,r,i):s.startEditing(null,r,i),!!n||s.isEditing()},!1)&&this.setEditingRow(!0)}getAllCellCtrls(){return 0===this.leftCellCtrls.list.length&&0===this.rightCellCtrls.list.length?this.centerCellCtrls.list:[...this.centerCellCtrls.list,...this.leftCellCtrls.list,...this.rightCellCtrls.list]}postProcessClassesFromGridOptions(){const e=this.beans.rowCssClassCalculator.processClassesFromGridOptions(this.rowNode);e&&e.length&&e.forEach(e=>{this.allRowGuis.forEach(t=>t.rowComp.addOrRemoveCssClass(e,!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,e=>e.rowComp.setUserStyles(this.rowStyles))}getPinnedForContainer(e){return"left"===e?"left":"right"===e?"right":null}getInitialRowClasses(e){const t=this.getPinnedForContainer(e),i={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(i)}processStylesFromGridOptions(){const e=this.gos.get("rowStyle");if(e&&"function"==typeof e)return void console.warn("AG Grid: rowStyle should be an object of key/value styles, not be a function, use getRowStyle() instead");const t=this.gos.getCallback("getRowStyle");let i;return t&&(i=t({data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex})),i||e?Object.assign({},e,i):this.emptyStyle}onRowSelected(e){const t=!!this.rowNode.isSelected();this.forEachGui(e,e=>{e.rowComp.addOrRemoveCssClass("ag-row-selected",t),gi(e.element,t),!e.element.contains(this.beans.gos.getActiveDomElement())||e!==this.centerGui&&e!==this.fullWidthGui||this.announceDescription()})}announceDescription(){if(this.isRowSelectionBlocked())return;const e=this.rowNode.isSelected();if(e&&this.beans.gos.get("suppressRowDeselection"))return;const t=this.beans.localeService.getLocaleTextFunc()(e?"ariaRowDeselect":"ariaRowSelect",`Press SPACE to ${e?"deselect":"select"} this row.`);this.beans.ariaAnnouncementService.announceValue(t)}addHoverFunctionality(e){this.active&&(this.addManagedListener(e,"mouseenter",()=>this.rowNode.onMouseEnter()),this.addManagedListener(e,"mouseleave",()=>this.rowNode.onMouseLeave()),this.addManagedListener(this.rowNode,Lr.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,Lr.EVENT_MOUSE_LEAVE,()=>{e.classList.remove("ag-row-hover"),this.rowNode.setHovered(!1)}))}roundRowTopToBounds(e){const t=this.beans.ctrlsService.getGridBodyCtrl().getScrollFeature().getApproximateVScollPosition(),i=this.applyPaginationOffset(t.top,!0)-100,n=this.applyPaginationOffset(t.bottom,!0)+100;return Math.min(Math.max(i,e),n)}getFrameworkOverrides(){return this.beans.frameworkOverrides}forEachGui(e,t){e?t(e):this.allRowGuis.forEach(t)}onRowHeightChanged(e){if(null==this.rowNode.rowHeight)return;const t=this.rowNode.rowHeight,i=this.beans.environment.getDefaultRowHeight(),n=this.gos.isGetRowHeightFunction()?this.gos.getRowHeightForNode(this.rowNode).height:void 0,s=n?Math.min(i,n)-2+"px":void 0;this.forEachGui(e,e=>{e.element.style.height=`${t}px`,s&&e.element.style.setProperty("--ag-line-height",s)})}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(null!=this.rowNode.rowTop){const e=this.roundRowTopToBounds(this.rowNode.rowTop);this.setRowTop(e)}else this.allRowGuis.forEach(e=>e.rowComp.addOrRemoveCssClass("ag-opacity-zero",!0));this.rowNode.setHovered(!1);const t=this.createRowEvent(ct.EVENT_VIRTUAL_ROW_REMOVED);this.dispatchEvent(t),this.beans.eventService.dispatchEvent(t),super.destroy()}destroySecondPass(){this.allRowGuis.length=0,this.stopEditing();const e=e=>(e.list.forEach(e=>e.destroy()),{list:[],map:{}});this.centerCellCtrls=e(this.centerCellCtrls),this.leftCellCtrls=e(this.leftCellCtrls),this.rightCellCtrls=e(this.rightCellCtrls)}setFocusedClasses(e){this.forEachGui(e,e=>{e.rowComp.addOrRemoveCssClass("ag-row-focus",this.rowFocused),e.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){return this.rowNode.isRowPinned()||this.rowNode.sticky?e:e+this.beans.paginationProxy.getPixelOffset()*(t?1:-1)}setRowTop(e){if(!this.printLayout&&b(e)){const t=this.applyPaginationOffset(e),i=`${this.rowNode.isRowPinned()||this.rowNode.sticky?t:this.beans.rowContainerHeightService.getRealPixelPosition(t)}px`;this.setRowTopStyle(i)}}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 i=this.slideInAnimation[e]?this.roundRowTopToBounds(this.rowNode.oldRowTop):this.rowNode.rowTop,n=this.applyPaginationOffset(i);t=this.rowNode.isRowPinned()?n:this.beans.rowContainerHeightService.getRealPixelPosition(n)}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(i=>{i.getColumn()==e&&(t=i)}),null!=t||this.getAllCellCtrls().forEach(i=>{i.getColSpanningList().indexOf(e)>=0&&(t=i)}),t}onRowIndexChanged(){null!=this.rowNode.rowIndex&&(this.onCellFocusChanged(),this.updateRowIndexes(),this.postProcessCss())}getRowIndex(){return this.rowNode.getRowIndexString()}updateRowIndexes(e){const t=this.rowNode.getRowIndexString(),i=this.beans.headerNavigationService.getHeaderRowCount()+this.beans.filterManager.getHeaderRowCount(),n=this.rowNode.rowIndex%2==0,s=i+this.rowNode.rowIndex+1;this.forEachGui(e,e=>{e.rowComp.setRowIndex(t),e.rowComp.addOrRemoveCssClass("ag-row-even",n),e.rowComp.addOrRemoveCssClass("ag-row-odd",!n),li(e.element,s)})}};ya.DOM_DATA_KEY_ROW_CTRL="renderedRow";var va=ya,ba=class extends st{constructor(e){super(),this.element=e}postConstruct(){this.addKeyboardListeners(),this.addMouseListeners(),this.mockContextMenuForIPad()}addKeyboardListeners(){const e="keydown",t=this.processKeyboardEvent.bind(this,e);this.addManagedListener(this.element,e,t)}addMouseListeners(){["dblclick","contextmenu","mouseover","mouseout","click",Ze("touchstart")?"touchstart":"mousedown"].forEach(e=>{const t=this.processMouseEvent.bind(this,e);this.addManagedListener(this.element,e,t)})}processMouseEvent(e,t){if(!this.mouseEventService.isEventFromThisGrid(t)||Xe(t))return;const i=this.getRowForEvent(t),n=this.mouseEventService.getRenderedCellForEvent(t);"contextmenu"===e?this.handleContextMenuMouseEvent(t,void 0,i,n):(n&&n.onMouseEvent(e,t),i&&i.onMouseEvent(e,t))}mockContextMenuForIPad(){if(!Pi())return;const e=new yr(this.element);this.addManagedListener(e,yr.EVENT_LONG_TAP,e=>{const t=this.getRowForEvent(e.touchEvent),i=this.mouseEventService.getRenderedCellForEvent(e.touchEvent);this.handleContextMenuMouseEvent(void 0,e.touchEvent,t,i)}),this.addDestroyFunc(()=>e.destroy())}getRowForEvent(e){let t=e.target;for(;t;){const e=this.gos.getDomData(t,va.DOM_DATA_KEY_ROW_CTRL);if(e)return e;t=t.parentElement}return null}handleContextMenuMouseEvent(e,t,i,n){const s=i?i.getRowNode():null,r=n?n.getColumn():null;let o=null;if(r){const i=e||t;n.dispatchCellContextMenuEvent(null!=i?i:null),o=this.valueService.getValue(r,s)}const a=this.ctrlsService.getGridBodyCtrl(),l=n?n.getGui():a.getGridBodyElement();this.menuService.showContextMenu({mouseEvent:e,touchEvent:t,rowNode:s,column:r,value:o,anchorToElement:l})}getControlsForEventTarget(e){return{cellCtrl:Qe(this.gos,e,fa.DOM_DATA_KEY_CELL_CTRL),rowCtrl:Qe(this.gos,e,va.DOM_DATA_KEY_ROW_CTRL)}}processKeyboardEvent(e,t){const{cellCtrl:i,rowCtrl:n}=this.getControlsForEventTarget(t.target);t.defaultPrevented||(i?this.processCellKeyboardEvent(i,e,t):n&&n.isFullWidth()&&this.processFullWidthRowKeyboardEvent(n,e,t))}processCellKeyboardEvent(e,t,i){const n=e.getRowNode(),s=e.getColumn(),r=e.isEditing();if(Jn(this.gos,i,n,s,r)||"keydown"!==t||(!r&&this.navigationService.handlePageScrollingKey(i)||e.onKeyDown(i),this.doGridOperations(i,e.isEditing()),Qn(i)&&e.processCharacter(i)),"keydown"===t){const t=e.createEvent(i,ct.EVENT_CELL_KEY_DOWN);this.eventService.dispatchEvent(t)}}processFullWidthRowKeyboardEvent(e,t,i){const n=e.getRowNode(),s=this.focusService.getFocusedCell(),r=s&&s.column;if(!Jn(this.gos,i,n,r,!1)){const n=i.key;if("keydown"===t)switch(n){case Zn.PAGE_HOME:case Zn.PAGE_END:case Zn.PAGE_UP:case Zn.PAGE_DOWN:this.navigationService.handlePageScrollingKey(i,!0);break;case Zn.UP:case Zn.DOWN:e.onKeyboardNavigate(i);break;case Zn.TAB:e.onTabKeyDown(i)}}if("keydown"===t){const t=e.createRowEvent(ct.EVENT_CELL_KEY_DOWN,i);this.eventService.dispatchEvent(t)}}doGridOperations(e,t){if(!e.ctrlKey&&!e.metaKey)return;if(t)return;if(!this.mouseEventService.isEventFromThisGrid(e))return;const i=ts(e);return i===Zn.A?this.onCtrlAndA(e):i===Zn.C?this.onCtrlAndC(e):i===Zn.D?this.onCtrlAndD(e):i===Zn.V?this.onCtrlAndV(e):i===Zn.X?this.onCtrlAndX(e):i===Zn.Y?this.onCtrlAndY():i===Zn.Z?this.onCtrlAndZ(e):void 0}onCtrlAndA(e){const{pinnedRowModel:t,paginationProxy:i,rangeService:n}=this;if(n&&i.isRowsToRender()){const[e,i]=[t.isEmpty("top"),t.isEmpty("bottom")],s=e?null:"top";let r,o;i?(r=null,o=this.paginationProxy.getRowCount()-1):(r="bottom",o=t.getPinnedBottomRowData().length-1);const a=this.columnModel.getAllDisplayedColumns();if(w(a))return;n.setCellRange({rowStartIndex:0,rowStartPinned:s,rowEndIndex:o,rowEndPinned:r,columnStart:a[0],columnEnd:Ie(a)})}e.preventDefault()}onCtrlAndC(e){if(!this.clipboardService||this.gos.get("enableCellTextSelection"))return;const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);(null==t?void 0:t.isEditing())||(null==i?void 0:i.isEditing())||(e.preventDefault(),this.clipboardService.copyToClipboard())}onCtrlAndX(e){if(!this.clipboardService||this.gos.get("enableCellTextSelection")||this.gos.get("suppressCutToClipboard"))return;const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);(null==t?void 0:t.isEditing())||(null==i?void 0:i.isEditing())||(e.preventDefault(),this.clipboardService.cutToClipboard(void 0,"ui"))}onCtrlAndV(e){const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);(null==t?void 0:t.isEditing())||(null==i?void 0:i.isEditing())||this.clipboardService&&!this.gos.get("suppressClipboardPaste")&&this.clipboardService.pasteFromClipboard()}onCtrlAndD(e){this.clipboardService&&!this.gos.get("suppressClipboardPaste")&&this.clipboardService.copyRangeDown(),e.preventDefault()}onCtrlAndZ(e){this.gos.get("undoRedoCellEditing")&&(e.preventDefault(),e.shiftKey?this.undoRedoService.redo("ui"):this.undoRedoService.undo("ui"))}onCtrlAndY(){this.undoRedoService.redo("ui")}};g([ue("mouseEventService")],ba.prototype,"mouseEventService",2),g([ue("valueService")],ba.prototype,"valueService",2),g([ue("menuService")],ba.prototype,"menuService",2),g([ue("ctrlsService")],ba.prototype,"ctrlsService",2),g([ue("navigationService")],ba.prototype,"navigationService",2),g([ue("focusService")],ba.prototype,"focusService",2),g([ue("undoRedoService")],ba.prototype,"undoRedoService",2),g([ue("columnModel")],ba.prototype,"columnModel",2),g([ue("paginationProxy")],ba.prototype,"paginationProxy",2),g([ue("pinnedRowModel")],ba.prototype,"pinnedRowModel",2),g([de("rangeService")],ba.prototype,"rangeService",2),g([de("clipboardService")],ba.prototype,"clipboardService",2),g([le],ba.prototype,"postConstruct",1);var Ca=class extends st{constructor(e){super(),this.centerContainerCtrl=e}postConstruct(){this.ctrlsService.whenReady(e=>{this.gridBodyCtrl=e.gridBodyCtrl,this.listenForResize()}),this.addManagedListener(this.eventService,ct.EVENT_SCROLLBAR_WIDTH_CHANGED,this.onScrollbarWidthChanged.bind(this)),this.addManagedPropertyListeners(["alwaysShowHorizontalScroll","alwaysShowVerticalScroll"],()=>{this.checkViewportAndScrolls()})}listenForResize(){const e=()=>this.onCenterViewportResized();this.centerContainerCtrl.registerViewportResizeListener(e),this.gridBodyCtrl.registerBodyViewportResizeListener(e)}onScrollbarWidthChanged(){this.checkViewportAndScrolls()}onCenterViewportResized(){if(this.centerContainerCtrl.isViewportInTheDOMTree()){this.keepPinnedColumnsNarrowerThanViewport(),this.checkViewportAndScrolls();const e=this.centerContainerCtrl.getCenterWidth();e!==this.centerWidth&&(this.centerWidth=e,this.columnModel.refreshFlexedColumns({viewportWidth:this.centerWidth,updateBodyWidths:!0,fireResizedEvent:!0}))}else this.bodyHeight=0}keepPinnedColumnsNarrowerThanViewport(){const e=pn(this.gridBodyCtrl.getBodyViewportElement());if(e<=50)return;let t=this.getPinnedColumnsOverflowingViewport(e-50);const i=this.gos.getCallback("processUnpinnedColumns");t.length&&(i&&(t=i({columns:t,viewportWidth:e})),this.columnModel.setColumnsPinned(t,null,"viewportSizeFeature"))}getPinnedColumnsOverflowingViewport(e){const t=this.pinnedWidthService.getPinnedRightWidth()+this.pinnedWidthService.getPinnedLeftWidth();if(t<e)return[];const i=[...this.columnModel.getDisplayedLeftColumns()],n=[...this.columnModel.getDisplayedRightColumns()];let s=0,r=0;const o=[];let a=t-0-e;for(;(r<i.length||s<n.length)&&a>0;){if(s<n.length){const e=n[s++];a-=e.getActualWidth(),o.push(e)}if(r<i.length&&a>0){const e=i[r++];a-=e.getActualWidth(),o.push(e)}}return o}checkViewportAndScrolls(){this.updateScrollVisibleService(),this.checkBodyHeight(),this.onHorizontalViewportChanged(),this.gridBodyCtrl.getScrollFeature().checkScrollLeft()}getBodyHeight(){return this.bodyHeight}checkBodyHeight(){const e=dn(this.gridBodyCtrl.getBodyViewportElement());if(this.bodyHeight!==e){this.bodyHeight=e;const t={type:ct.EVENT_BODY_HEIGHT_CHANGED};this.eventService.dispatchEvent(t)}}updateScrollVisibleService(){this.updateScrollVisibleServiceImpl(),setTimeout(this.updateScrollVisibleServiceImpl.bind(this),500)}updateScrollVisibleServiceImpl(){const e={horizontalScrollShowing:this.isHorizontalScrollShowing(),verticalScrollShowing:this.gridBodyCtrl.isVerticalScrollShowing()};this.scrollVisibleService.setScrollsVisible(e)}isHorizontalScrollShowing(){return this.centerContainerCtrl.isHorizontalScrollShowing()}onHorizontalViewportChanged(){const e=this.centerContainerCtrl.getCenterWidth(),t=this.centerContainerCtrl.getViewportScrollLeft();this.columnModel.setViewportPosition(e,t)}};g([ue("ctrlsService")],Ca.prototype,"ctrlsService",2),g([ue("pinnedWidthService")],Ca.prototype,"pinnedWidthService",2),g([ue("columnModel")],Ca.prototype,"columnModel",2),g([ue("scrollVisibleService")],Ca.prototype,"scrollVisibleService",2),g([le],Ca.prototype,"postConstruct",1);var wa=class extends st{constructor(e){super(),this.element=e}postConstruct(){this.addManagedListener(this.eventService,ct.EVENT_LEFT_PINNED_WIDTH_CHANGED,this.onPinnedLeftWidthChanged.bind(this))}onPinnedLeftWidthChanged(){const e=this.pinnedWidthService.getPinnedLeftWidth(),t=e>0;an(this.element,t),Pn(this.element,e)}getWidth(){return this.pinnedWidthService.getPinnedLeftWidth()}};g([ue("pinnedWidthService")],wa.prototype,"pinnedWidthService",2),g([le],wa.prototype,"postConstruct",1);var Sa=class extends st{constructor(e){super(),this.element=e}postConstruct(){this.addManagedListener(this.eventService,ct.EVENT_RIGHT_PINNED_WIDTH_CHANGED,this.onPinnedRightWidthChanged.bind(this))}onPinnedRightWidthChanged(){const e=this.pinnedWidthService.getPinnedRightWidth(),t=e>0;an(this.element,t),Pn(this.element,e)}getWidth(){return this.pinnedWidthService.getPinnedRightWidth()}};g([ue("pinnedWidthService")],Sa.prototype,"pinnedWidthService",2),g([le],Sa.prototype,"postConstruct",1);var xa=class extends st{constructor(e,t){super(),this.eContainer=e,this.eViewport=t}postConstruct(){this.addManagedListener(this.eventService,ct.EVENT_ROW_CONTAINER_HEIGHT_CHANGED,this.onHeightChanged.bind(this))}onHeightChanged(){const e=this.maxDivHeightScaler.getUiContainerHeight(),t=null!=e?`${e}px`:"";this.eContainer.style.height=t,this.eViewport&&(this.eViewport.style.height=t)}};g([ue("rowContainerHeightService")],xa.prototype,"maxDivHeightScaler",2),g([le],xa.prototype,"postConstruct",1);var Ea=class extends st{constructor(e){super(),this.eContainer=e}postConstruct(){this.rangeService&&(this.params={eElement:this.eContainer,onDragStart:this.rangeService.onDragStart.bind(this.rangeService),onDragStop:this.rangeService.onDragStop.bind(this.rangeService),onDragging:this.rangeService.onDragging.bind(this.rangeService)},this.addManagedPropertyListener("enableRangeSelection",e=>{e.currentValue?this.enableFeature():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([ue("dragService")],Ea.prototype,"dragService",2),g([de("rangeService")],Ea.prototype,"rangeService",2),g([le],Ea.prototype,"postConstruct",1);var Aa=class extends st{constructor(e,t=!1){super(),this.callback=e,this.addSpacer=t}postConstruct(){const e=this.setWidth.bind(this);this.addManagedPropertyListener("domLayout",e),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_CONTAINER_WIDTH_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_LEFT_PINNED_WIDTH_CHANGED,e),this.addSpacer&&(this.addManagedListener(this.eventService,ct.EVENT_RIGHT_PINNED_WIDTH_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_SCROLL_VISIBILITY_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_SCROLLBAR_WIDTH_CHANGED,e)),this.setWidth()}setWidth(){const{columnModel:e}=this,t=this.gos.isDomLayout("print"),i=e.getBodyContainerWidth(),n=e.getDisplayedColumnsLeftWidth(),s=e.getDisplayedColumnsRightWidth();let r;t?r=i+n+s:(r=i,this.addSpacer&&0===(this.gos.get("enableRtl")?n:s)&&this.scrollVisibleService.isVerticalScrollShowing()&&(r+=this.gos.getScrollbarWidth())),this.callback(r)}};g([ue("columnModel")],Aa.prototype,"columnModel",2),g([ue("scrollVisibleService")],Aa.prototype,"scrollVisibleService",2),g([le],Aa.prototype,"postConstruct",1);var Ma=(e=>(e.LEFT="left",e.RIGHT="right",e.CENTER="center",e.FULL_WIDTH="fullWidth",e.TOP_LEFT="topLeft",e.TOP_RIGHT="topRight",e.TOP_CENTER="topCenter",e.TOP_FULL_WIDTH="topFullWidth",e.STICKY_TOP_LEFT="stickyTopLeft",e.STICKY_TOP_RIGHT="stickyTopRight",e.STICKY_TOP_CENTER="stickyTopCenter",e.STICKY_TOP_FULL_WIDTH="stickyTopFullWidth",e.STICKY_BOTTOM_LEFT="stickyBottomLeft",e.STICKY_BOTTOM_RIGHT="stickyBottomRight",e.STICKY_BOTTOM_CENTER="stickyBottomCenter",e.STICKY_BOTTOM_FULL_WIDTH="stickyBottomFullWidth",e.BOTTOM_LEFT="bottomLeft",e.BOTTOM_RIGHT="bottomRight",e.BOTTOM_CENTER="bottomCenter",e.BOTTOM_FULL_WIDTH="bottomFullWidth",e))(Ma||{}),Ta=(e=>(e.LEFT="left",e.RIGHT="right",e.CENTER="center",e.FULL_WIDTH="fullWidth",e))(Ta||{});function Da(e){switch(e){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 Ia=xt([["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"]]),Ra=xt([["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"]]),ka=class e extends st{constructor(e){super(),this.visible=!0,this.EMPTY_CTRLS=[],this.name=e,this.isFullWithContainer="topFullWidth"===this.name||"stickyTopFullWidth"===this.name||"stickyBottomFullWidth"===this.name||"bottomFullWidth"===this.name||"fullWidth"===this.name}static getRowContainerCssClasses(e){return{container:Ia.get(e),viewport:Ra.get(e)}}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 Ca(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,i){this.comp=e,this.eContainer=t,this.eViewport=i,this.createManagedBean(new ba(this.eContainer)),this.addPreventScrollWhileDragging(),this.listenOnDomOrder(),this.stopHScrollOnPinnedRows();this.forContainers(["left","bottomLeft","topLeft","stickyTopLeft","stickyBottomLeft"],()=>{this.pinnedWidthFeature=this.createManagedBean(new wa(this.eContainer)),this.addManagedListener(this.eventService,ct.EVENT_LEFT_PINNED_WIDTH_CHANGED,()=>this.onPinnedWidthChanged())}),this.forContainers(["right","bottomRight","topRight","stickyTopRight","stickyBottomRight"],()=>{this.pinnedWidthFeature=this.createManagedBean(new Sa(this.eContainer)),this.addManagedListener(this.eventService,ct.EVENT_RIGHT_PINNED_WIDTH_CHANGED,()=>this.onPinnedWidthChanged())}),this.forContainers(["center","left","right","fullWidth"],()=>this.createManagedBean(new xa(this.eContainer,"center"===this.name?i:void 0))),this.forContainers(["topCenter","topLeft","topRight","bottomCenter","bottomLeft","bottomRight","center","left","right","stickyTopCenter","stickyTopLeft","stickyTopRight","stickyBottomCenter","stickyBottomLeft","stickyBottomRight"],()=>this.createManagedBean(new Ea(this.eContainer))),this.forContainers(["center","topCenter","stickyTopCenter","bottomCenter","stickyBottomCenter"],()=>this.createManagedBean(new Aa(e=>this.comp.setContainerWidth(`${e}px`)))),this.addListeners(),this.registerWithCtrlsService()}addListeners(){this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,()=>this.onDisplayedColumnsChanged()),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,()=>this.onDisplayedColumnsWidthChanged()),this.addManagedListener(this.eventService,ct.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)return void this.comp.setDomOrder(!0);const e=()=>{const e=this.gos.get("ensureDomOrder"),t=this.gos.isDomLayout("print");this.comp.setDomOrder(e||t)};this.addManagedPropertyListener("domLayout",e),e()}stopHScrollOnPinnedRows(){this.forContainers(["topCenter","stickyTopCenter","bottomCenter","stickyBottomCenter"],()=>{this.addManagedListener(this.eViewport,"scroll",()=>this.eViewport.scrollLeft=0)})}onDisplayedColumnsChanged(){this.forContainers(["center"],()=>this.onHorizontalViewportChanged())}onDisplayedColumnsWidthChanged(){this.forContainers(["center"],()=>this.onHorizontalViewportChanged())}addPreventScrollWhileDragging(){const e=e=>{this.dragService.isDragging()&&e.cancelable&&e.preventDefault()};this.eContainer.addEventListener("touchmove",e,{passive:!1}),this.addDestroyFunc(()=>this.eContainer.removeEventListener("touchmove",e))}onHorizontalViewportChanged(e=!1){const t=this.getCenterWidth(),i=this.getCenterViewportScrollLeft();this.columnModel.setViewportPosition(t,i,e)}getCenterWidth(){return pn(this.eViewport)}getCenterViewportScrollLeft(){return vn(this.eViewport,this.enableRtl)}registerViewportResizeListener(e){const t=this.resizeObserverService.observeResize(this.eViewport,e);this.addDestroyFunc(()=>t())}isViewportInTheDOMTree(){return Sn(this.eViewport)}getViewportScrollLeft(){return vn(this.eViewport,this.enableRtl)}isHorizontalScrollShowing(){return this.gos.get("alwaysShowHorizontalScroll")||In(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){bn(this.eViewport,e,this.enableRtl)}isContainerVisible(){return!e.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||0===t.length)return void this.comp.setRowCtrls({rowCtrls:this.EMPTY_CTRLS});const i=this.gos.isDomLayout("print"),n=this.gos.get("embedFullWidthRows")||i,s=t.filter(e=>{const t=e.isFullWidth();return this.isFullWithContainer?!n&&t:n||!t});this.comp.setRowCtrls({rowCtrls:s,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([ue("dragService")],ka.prototype,"dragService",2),g([ue("ctrlsService")],ka.prototype,"ctrlsService",2),g([ue("columnModel")],ka.prototype,"columnModel",2),g([ue("resizeObserverService")],ka.prototype,"resizeObserverService",2),g([ue("rowRenderer")],ka.prototype,"rowRenderer",2),g([le],ka.prototype,"postConstruct",1);var Pa=ka,_a=class extends Cs{constructor(){super('<div class="ag-root ag-unselectable" role="treegrid">\n        <ag-header-root ref="gridHeader"></ag-header-root>\n        <div class="ag-floating-top" ref="eTop" role="presentation">\n            <ag-row-container ref="topLeftContainer" name="topLeft"></ag-row-container>\n            <ag-row-container ref="topCenterContainer" name="topCenter"></ag-row-container>\n            <ag-row-container ref="topRightContainer" name="topRight"></ag-row-container>\n            <ag-row-container ref="topFullWidthContainer" name="topFullWidth"></ag-row-container>\n        </div>\n        <div class="ag-body" ref="eBody" role="presentation">\n            <div class="ag-body-viewport" ref="eBodyViewport" role="presentation">\n                <ag-row-container ref="leftContainer" name="left"></ag-row-container>\n                <ag-row-container ref="centerContainer" name="center"></ag-row-container>\n                <ag-row-container ref="rightContainer" name="right"></ag-row-container>\n                <ag-row-container ref="fullWidthContainer" name="fullWidth"></ag-row-container>\n            </div>\n            <ag-fake-vertical-scroll></ag-fake-vertical-scroll>\n        </div>\n        <div class="ag-sticky-top" ref="eStickyTop" role="presentation">\n            <ag-row-container ref="stickyTopLeftContainer" name="stickyTopLeft"></ag-row-container>\n            <ag-row-container ref="stickyTopCenterContainer" name="stickyTopCenter"></ag-row-container>\n            <ag-row-container ref="stickyTopRightContainer" name="stickyTopRight"></ag-row-container>\n            <ag-row-container ref="stickyTopFullWidthContainer" name="stickyTopFullWidth"></ag-row-container>\n        </div>\n        <div class="ag-sticky-bottom" ref="eStickyBottom" role="presentation">\n            <ag-row-container ref="stickyBottomLeftContainer" name="stickyBottomLeft"></ag-row-container>\n            <ag-row-container ref="stickyBottomCenterContainer" name="stickyBottomCenter"></ag-row-container>\n            <ag-row-container ref="stickyBottomRightContainer" name="stickyBottomRight"></ag-row-container>\n            <ag-row-container ref="stickyBottomFullWidthContainer" name="stickyBottomFullWidth"></ag-row-container>\n        </div>\n        <div class="ag-floating-bottom" ref="eBottom" role="presentation">\n            <ag-row-container ref="bottomLeftContainer" name="bottomLeft"></ag-row-container>\n            <ag-row-container ref="bottomCenterContainer" name="bottomCenter"></ag-row-container>\n            <ag-row-container ref="bottomRightContainer" name="bottomRight"></ag-row-container>\n            <ag-row-container ref="bottomFullWidthContainer" name="bottomFullWidth"></ag-row-container>\n        </div>\n        <ag-fake-horizontal-scroll></ag-fake-horizontal-scroll>\n        <ag-overlay-wrapper></ag-overlay-wrapper>\n    </div>')}init(){const e=(e,t)=>{const i=`${e}px`;t.style.minHeight=i,t.style.height=i},t={setRowAnimationCssOnBodyViewport:(e,t)=>this.setRowAnimationCssOnBodyViewport(e,t),setColumnCount:e=>ci(this.getGui(),e),setRowCount:e=>ai(this.getGui(),e),setTopHeight:t=>e(t,this.eTop),setBottomHeight:t=>e(t,this.eBottom),setTopDisplay:e=>this.eTop.style.display=e,setBottomDisplay:e=>this.eBottom.style.display=e,setStickyTopHeight:e=>this.eStickyTop.style.height=e,setStickyTopTop:e=>this.eStickyTop.style.top=e,setStickyTopWidth:e=>this.eStickyTop.style.width=e,setStickyBottomHeight:e=>this.eStickyBottom.style.height=e,setStickyBottomBottom:e=>this.eStickyBottom.style.bottom=e,setStickyBottomWidth:e=>this.eStickyBottom.style.width=e,setColumnMovingCss:(e,t)=>this.addOrRemoveCssClass(e,t),updateLayoutClasses:(e,t)=>{[this.eBodyViewport.classList,this.eBody.classList].forEach(e=>{e.toggle("ag-layout-auto-height",t.autoHeight),e.toggle("ag-layout-normal",t.normal),e.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)},setAlwaysVerticalScrollClass:(e,t)=>this.eBodyViewport.classList.toggle(ea,t),registerBodyViewportResizeListener:e=>{const t=this.resizeObserverService.observeResize(this.eBodyViewport,e);this.addDestroyFunc(()=>t())},setPinnedTopBottomOverflowY:e=>this.eTop.style.overflowY=this.eBottom.style.overflowY=e,setCellSelectableCss:(e,t)=>{[this.eTop,this.eBodyViewport,this.eBottom].forEach(i=>i.classList.toggle(e,t))},setBodyViewportWidth:e=>this.eBodyViewport.style.width=e};this.ctrl=this.createManagedBean(new ta),this.ctrl.setComp(t,this.getGui(),this.eBodyViewport,this.eTop,this.eBottom,this.eStickyTop,this.eStickyBottom),(this.rangeService&&this.gos.get("enableRangeSelection")||"multiple"===this.gos.get("rowSelection"))&&oi(this.getGui(),!0)}setRowAnimationCssOnBodyViewport(e,t){const i=this.eBodyViewport.classList;i.toggle("ag-row-animation",t),i.toggle("ag-row-no-animation",!t)}getFloatingTopBottom(){return[this.eTop,this.eBottom]}};g([ue("resizeObserverService")],_a.prototype,"resizeObserverService",2),g([de("rangeService")],_a.prototype,"rangeService",2),g([Ss("eBodyViewport")],_a.prototype,"eBodyViewport",2),g([Ss("eStickyTop")],_a.prototype,"eStickyTop",2),g([Ss("eStickyBottom")],_a.prototype,"eStickyBottom",2),g([Ss("eTop")],_a.prototype,"eTop",2),g([Ss("eBottom")],_a.prototype,"eBottom",2),g([Ss("gridHeader")],_a.prototype,"headerRootComp",2),g([Ss("eBody")],_a.prototype,"eBody",2),g([le],_a.prototype,"init",1);var La=class extends st{postConstruct(){this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onDisplayedColumnsWidthChanged.bind(this))}onDisplayedColumnsChanged(){this.update()}onDisplayedColumnsWidthChanged(){this.update()}update(){this.columnAnimationService.isActive()?this.columnAnimationService.executeLaterVMTurn(()=>{this.columnAnimationService.executeLaterVMTurn(()=>this.updateImpl())}):this.updateImpl()}updateImpl(){const e=this.ctrlsService.get("center");if(!e||this.columnAnimationService.isActive())return;const t={horizontalScrollShowing:e.isHorizontalScrollShowing(),verticalScrollShowing:this.isVerticalScrollShowing()};this.setScrollsVisible(t)}setScrollsVisible(e){if(this.horizontalScrollShowing!==e.horizontalScrollShowing||this.verticalScrollShowing!==e.verticalScrollShowing){this.horizontalScrollShowing=e.horizontalScrollShowing,this.verticalScrollShowing=e.verticalScrollShowing;const t={type:ct.EVENT_SCROLL_VISIBILITY_CHANGED};this.eventService.dispatchEvent(t)}}isHorizontalScrollShowing(){return this.horizontalScrollShowing}isVerticalScrollShowing(){return this.verticalScrollShowing}};g([ue("ctrlsService")],La.prototype,"ctrlsService",2),g([ue("columnAnimationService")],La.prototype,"columnAnimationService",2),g([le],La.prototype,"postConstruct",1),La=g([he("scrollVisibleService")],La);var Na=class extends st{constructor(){super(...arguments),this.gridInstanceId=Na.gridInstanceSequence.next()}stampTopLevelGridCompWithGridInstance(e){e[Na.GRID_DOM_KEY]=this.gridInstanceId}getRenderedCellForEvent(e){return Qe(this.gos,e.target,fa.DOM_DATA_KEY_CELL_CTRL)}isEventFromThisGrid(e){return this.isElementInThisGrid(e.target)}isElementInThisGrid(e){let t=e;for(;t;){const e=t[Na.GRID_DOM_KEY];if(b(e))return e===this.gridInstanceId;t=t.parentElement}return!1}getCellPositionForEvent(e){const t=this.getRenderedCellForEvent(e);return t?t.getCellPosition():null}getNormalisedPosition(e){const t=this.gos.isDomLayout("normal"),i=e;let n,s;if(null!=i.clientX||null!=i.clientY?(n=i.clientX,s=i.clientY):(n=i.x,s=i.y),t){const e=this.ctrlsService.getGridBodyCtrl(),t=e.getScrollFeature().getVScrollPosition();n+=e.getScrollFeature().getHScrollPosition().left,s+=t.top}return{x:n,y:s}}};Na.gridInstanceSequence=new hs,Na.GRID_DOM_KEY="__ag_grid_instance",g([ue("ctrlsService")],Na.prototype,"ctrlsService",2),Na=g([he("mouseEventService")],Na);var Oa=class extends st{constructor(){super(),this.onPageDown=J(this.onPageDown,100),this.onPageUp=J(this.onPageUp,100)}postConstruct(){this.ctrlsService.whenReady(e=>{this.gridBodyCon=e.gridBodyCtrl})}handlePageScrollingKey(e,t=!1){const i=e.key,n=e.altKey,s=e.ctrlKey||e.metaKey,r=!!this.rangeService&&e.shiftKey,o=this.mouseEventService.getCellPositionForEvent(e);let a=!1;switch(i){case Zn.PAGE_HOME:case Zn.PAGE_END:s||n||(this.onHomeOrEndKey(i),a=!0);break;case Zn.LEFT:case Zn.RIGHT:case Zn.UP:case Zn.DOWN:if(!o)return!1;!s||n||r||(this.onCtrlUpDownLeftRight(i,o),a=!0);break;case Zn.PAGE_DOWN:case Zn.PAGE_UP:s||n||(a=this.handlePageUpDown(i,o,t))}return a&&e.preventDefault(),a}handlePageUpDown(e,t,i){return i&&(t=this.focusService.getFocusedCell()),!!t&&(e===Zn.PAGE_UP?this.onPageUp(t):this.onPageDown(t),!0)}navigateTo(e){var t;const{scrollIndex:i,scrollType:n,scrollColumn:s,focusIndex:r,focusColumn:o}=e;b(s)&&!s.isPinned()&&this.gridBodyCon.getScrollFeature().ensureColumnVisible(s),b(i)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(i,n),e.isAsync||this.gridBodyCon.getScrollFeature().ensureIndexVisible(r),this.focusService.setFocusedCell({rowIndex:r,column:o,rowPinned:null,forceBrowserFocus:!0}),null==(t=this.rangeService)||t.setRangeToCell({rowIndex:r,rowPinned:null,column:o})}onPageDown(e){const t=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),i=this.getViewportHeight(),n=this.paginationProxy.getPixelOffset(),s=t.top+i,r=this.paginationProxy.getRowIndexAtPixel(s+n);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(e,r):this.navigateToNextPage(e,r)}onPageUp(e){const t=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),i=this.paginationProxy.getPixelOffset(),n=t.top,s=this.paginationProxy.getRowIndexAtPixel(n+i);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(e,s,!0):this.navigateToNextPage(e,s,!0)}navigateToNextPage(e,t,i=!1){const n=this.getViewportHeight(),s=this.paginationProxy.getPageFirstRow(),r=this.paginationProxy.getPageLastRow(),o=this.paginationProxy.getPixelOffset(),a=this.paginationProxy.getRow(e.rowIndex),l=i?(null==a?void 0:a.rowHeight)-n-o:n-o,c=(null==a?void 0:a.rowTop)+l;let h,u=this.paginationProxy.getRowIndexAtPixel(c+o);if(u===e.rowIndex){const n=i?-1:1;t=u=e.rowIndex+n}i?(h="bottom",u<s&&(u=s),t<s&&(t=s)):(h="top",u>r&&(u=r),t>r&&(t=r)),this.isRowTallerThanView(u)&&(t=u,h="top"),this.navigateTo({scrollIndex:t,scrollType:h,scrollColumn:null,focusIndex:u,focusColumn:e.column})}navigateToNextPageWithAutoHeight(e,t,i=!1){this.navigateTo({scrollIndex:t,scrollType:i?"bottom":"top",scrollColumn:null,focusIndex:t,focusColumn:e.column}),setTimeout(()=>{const n=this.getNextFocusIndexForAutoHeight(e,i);this.navigateTo({scrollIndex:t,scrollType:i?"bottom":"top",scrollColumn:null,focusIndex:n,focusColumn:e.column,isAsync:!0})},50)}getNextFocusIndexForAutoHeight(e,t=!1){var i;const n=t?-1:1,s=this.getViewportHeight(),r=this.paginationProxy.getPageLastRow();let o=0,a=e.rowIndex;for(;a>=0&&a<=r;){const e=this.paginationProxy.getRow(a);if(e){const t=null!=(i=e.rowHeight)?i:0;if(o+t>s)break;o+=t}a+=n}return Math.max(0,Math.min(a,r))}getViewportHeight(){const{gridBodyCtrl:e,center:t}=this.ctrlsService.getParams(),i=e.getScrollFeature().getVScrollPosition(),n=this.gos.getScrollbarWidth();let s=i.bottom-i.top;return t.isHorizontalScrollShowing()&&(s-=n),s}isRowTallerThanView(e){const t=this.paginationProxy.getRow(e);if(!t)return!1;const i=t.rowHeight;return"number"==typeof i&&i>this.getViewportHeight()}onCtrlUpDownLeftRight(e,t){const i=this.cellNavigationService.getNextCellToFocus(e,t,!0),{rowIndex:n,column:s}=i;this.navigateTo({scrollIndex:n,scrollType:null,scrollColumn:s,focusIndex:n,focusColumn:s})}onHomeOrEndKey(e){const t=e===Zn.PAGE_HOME,i=this.columnModel.getAllDisplayedColumns(),n=t?i[0]:Ie(i),s=t?this.paginationProxy.getPageFirstRow():this.paginationProxy.getPageLastRow();this.navigateTo({scrollIndex:s,scrollType:null,scrollColumn:n,focusIndex:s,focusColumn:n})}onTabKeyDown(e,t){const i=t.shiftKey,n=this.tabToNextCellCommon(e,i,t);if(!1===n)if(i){const{rowIndex:i,rowPinned:n}=e.getRowPosition();(n?0===i:i===this.paginationProxy.getPageFirstRow())&&(0===this.gos.get("headerHeight")||this.gos.get("suppressHeaderFocus")?this.focusService.focusNextGridCoreContainer(!0,!0):(t.preventDefault(),this.focusService.focusPreviousFromFirstCell(t)))}else e instanceof fa&&e.focusCell(!0),this.focusService.focusNextGridCoreContainer(i)&&t.preventDefault();else n&&t.preventDefault()}tabToNextCell(e,t){const i=this.focusService.getFocusedCell();if(!i)return!1;let n=this.getCellByPosition(i);return!!(n||(n=this.rowRenderer.getRowByPosition(i),n&&n.isFullWidth()))&&!!this.tabToNextCellCommon(n,e,t)}tabToNextCellCommon(e,t,i){let n,s=e.isEditing();if(!s&&e instanceof fa){const t=e.getRowCtrl();t&&(s=t.isEditing())}return n=s?"fullRow"===this.gos.get("editType")?this.moveToNextEditingRow(e,t,i):this.moveToNextEditingCell(e,t,i):this.moveToNextCellNotEditing(e,t),null===n?n:n||!!this.focusService.getFocusedHeader()}moveToNextEditingCell(e,t,i=null){const n=e.getCellPosition();e.getGui().focus(),e.stopEditing();const s=this.findNextCellToFocusOn(n,t,!0);return!1===s?null:null!=s&&(s.startEditing(null,!0,i),s.focusCell(!1),!0)}moveToNextEditingRow(e,t,i=null){const n=e.getCellPosition(),s=this.findNextCellToFocusOn(n,t,!0);if(!1===s)return null;if(null==s)return!1;const r=s.getCellPosition(),o=this.isCellEditable(n),a=this.isCellEditable(r),l=r&&n.rowIndex===r.rowIndex&&n.rowPinned===r.rowPinned;return o&&e.setFocusOutOnEditor(),l||(e.getRowCtrl().stopEditing(),s.getRowCtrl().startRowEditing(void 0,void 0,i)),a?(s.setFocusInOnEditor(),s.focusCell()):s.focusCell(!0),!0}moveToNextCellNotEditing(e,t){const i=this.columnModel.getAllDisplayedColumns();let n;n=e instanceof va?d(u({},e.getRowPosition()),{column:t?i[0]:Ie(i)}):e.getCellPosition();const s=this.findNextCellToFocusOn(n,t,!1);if(!1===s)return null;if(s instanceof fa)s.focusCell(!0);else if(s)return this.tryToFocusFullWidthRow(s.getRowPosition(),t);return b(s)}findNextCellToFocusOn(e,t,i){var n;let s=e;for(;;){e!==s&&(e=s),t||(s=this.getLastCellOfColSpan(s)),s=this.cellNavigationService.getNextTabbedCell(s,t);const r=this.gos.getCallback("tabToNextCell");if(b(r)){const n=r({backwards:t,editing:i,previousCellPosition:e,nextCellPosition:s||null});if(!0===n||null===n)null===n&&z("Returning `null` from tabToNextCell is deprecated. Return `true` to stay on the current cell, or `false` to let the browser handle the tab behaviour."),s=e;else{if(!1===n)return!1;n.floating&&(z("tabToNextCellFunc return type should have attributes: rowIndex, rowPinned, column. However you had 'floating', maybe you meant 'rowPinned'?"),n.rowPinned=n.floating),s={rowIndex:n.rowIndex,column:n.column,rowPinned:n.rowPinned}}}if(!s)return null;if(s.rowIndex<0){const e=this.headerNavigationService.getHeaderRowCount();return this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:e+s.rowIndex,column:s.column},fromCell:!0}),null}const o="fullRow"===this.gos.get("editType");if(i&&!o&&!this.isCellEditable(s))continue;this.ensureCellVisible(s);const a=this.getCellByPosition(s);if(!a){const e=this.rowRenderer.getRowByPosition(s);if(!e||!e.isFullWidth()||i)continue;return e}if(!a.isSuppressNavigable())return null==(n=this.rangeService)||n.setRangeToCell(s),a}}isCellEditable(e){const t=this.lookupRowNodeForCell(e);return!!t&&e.column.isCellEditable(t)}getCellByPosition(e){const t=this.rowRenderer.getRowByPosition(e);return t?t.getCellCtrl(e.column):null}lookupRowNodeForCell(e){return"top"===e.rowPinned?this.pinnedRowModel.getPinnedTopRow(e.rowIndex):"bottom"===e.rowPinned?this.pinnedRowModel.getPinnedBottomRow(e.rowIndex):this.paginationProxy.getRow(e.rowIndex)}navigateToNextCell(e,t,i,n){let s=i,r=!1;for(;s&&(s===i||!this.isValidNavigateCell(s));)this.gos.get("enableRtl")?t===Zn.LEFT&&(s=this.getLastCellOfColSpan(s)):t===Zn.RIGHT&&(s=this.getLastCellOfColSpan(s)),s=this.cellNavigationService.getNextCellToFocus(t,s),r=C(s);if(r&&e&&e.key===Zn.UP&&(s={rowIndex:-1,rowPinned:null,column:i.column}),n){const n=this.gos.getCallback("navigateToNextCell");if(b(n)){const r=n({key:t,previousCellPosition:i,nextCellPosition:s||null,event:e});b(r)?(r.floating&&(z("tabToNextCellFunc return type should have attributes: rowIndex, rowPinned, column. However you had 'floating', maybe you meant 'rowPinned'?"),r.rowPinned=r.floating),s={rowPinned:r.rowPinned,rowIndex:r.rowIndex,column:r.column}):s=null}}if(!s)return;if(s.rowIndex<0){const t=this.headerNavigationService.getHeaderRowCount();return void this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:t+s.rowIndex,column:i.column},event:e||void 0,fromCell:!0})}const o=this.getNormalisedPosition(s);o?this.focusPosition(o):this.tryToFocusFullWidthRow(s)}getNormalisedPosition(e){this.ensureCellVisible(e);const t=this.getCellByPosition(e);return t?(e=t.getCellPosition(),this.ensureCellVisible(e),e):null}tryToFocusFullWidthRow(e,t=!1){const i=this.columnModel.getAllDisplayedColumns(),n=this.rowRenderer.getRowByPosition(e);if(!n||!n.isFullWidth())return!1;const s=this.focusService.getFocusedCell(),r={rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:e.column||(t?Ie(i):i[0])};this.focusPosition(r);const o=null!=s&&this.rowPositionUtils.before(r,s),a={type:ct.EVENT_FULL_WIDTH_ROW_FOCUSED,rowIndex:r.rowIndex,rowPinned:r.rowPinned,column:r.column,isFullWidthCell:!0,floating:r.rowPinned,fromBelow:o};return this.eventService.dispatchEvent(a),!0}focusPosition(e){var t;this.focusService.setFocusedCell({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0}),null==(t=this.rangeService)||t.setRangeToCell(e)}isValidNavigateCell(e){return!!this.rowPositionUtils.getRowNode(e)}getLastCellOfColSpan(e){const t=this.getCellByPosition(e);if(!t)return e;const i=t.getColSpanningList();return 1===i.length?e:{rowIndex:e.rowIndex,column:Ie(i),rowPinned:e.rowPinned}}ensureCellVisible(e){const t=this.gos.isGroupRowsSticky(),i=this.rowModel.getRow(e.rowIndex);!(t&&(null==i?void 0:i.sticky))&&C(e.rowPinned)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(e.rowIndex),e.column.isPinned()||this.gridBodyCon.getScrollFeature().ensureColumnVisible(e.column)}};g([ue("mouseEventService")],Oa.prototype,"mouseEventService",2),g([ue("paginationProxy")],Oa.prototype,"paginationProxy",2),g([ue("focusService")],Oa.prototype,"focusService",2),g([ue("columnModel")],Oa.prototype,"columnModel",2),g([ue("rowModel")],Oa.prototype,"rowModel",2),g([ue("ctrlsService")],Oa.prototype,"ctrlsService",2),g([ue("rowRenderer")],Oa.prototype,"rowRenderer",2),g([ue("headerNavigationService")],Oa.prototype,"headerNavigationService",2),g([ue("rowPositionUtils")],Oa.prototype,"rowPositionUtils",2),g([ue("cellNavigationService")],Oa.prototype,"cellNavigationService",2),g([ue("pinnedRowModel")],Oa.prototype,"pinnedRowModel",2),g([de("rangeService")],Oa.prototype,"rangeService",2),g([le],Oa.prototype,"postConstruct",1),Oa=g([he("navigationService")],Oa);var Fa=class e extends Er{constructor(e){super('<div class="ag-popup-editor" tabindex="-1"/>'),this.params=e}postConstruct(){this.gos.setDomData(this.getGui(),e.DOM_KEY_POPUP_EDITOR_WRAPPER,!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),t=this.params;this.addManagedListener(e,"keydown",e=>{Jn(this.gos,e,t.node,t.column,!0)||t.onKeyDown(e)})}};Fa.DOM_KEY_POPUP_EDITOR_WRAPPER="popupEditorWrapper",g([le],Fa.prototype,"postConstruct",1);var Ga=Fa,Ba=class extends Cs{constructor(e,t,i,n,s){super(),this.rendererVersion=0,this.editorVersion=0,this.beans=e,this.column=t.getColumn(),this.rowNode=t.getRowNode(),this.rowCtrl=t.getRowCtrl(),this.eRow=n,this.cellCtrl=t;const r=document.createElement("div");r.setAttribute("comp-id",`${this.getCompId()}`),this.setTemplateFromElement(r);const o=this.getGui();this.forceWrapper=t.isForceWrapper(),this.refreshWrapper(!1);const a=(e,t)=>{null!=t&&""!=t?o.setAttribute(e,t):o.removeAttribute(e)};Ht(o,t.getCellAriaRole()),a("col-id",t.getColumnIdSanitised());const l=t.getTabIndex();void 0!==l&&a("tabindex",l.toString());const c={addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setUserStyles:e=>Dn(o,e),getFocusableElement:()=>this.getFocusableElement(),setIncludeSelection:e=>this.includeSelection=e,setIncludeRowDrag:e=>this.includeRowDrag=e,setIncludeDndSource:e=>this.includeDndSource=e,setRenderDetails:(e,t,i)=>this.setRenderDetails(e,t,i),setEditDetails:(e,t,i)=>this.setEditDetails(e,t,i),getCellEditor:()=>this.cellEditor||null,getCellRenderer:()=>this.cellRenderer||null,getParentOfValue:()=>this.getParentOfValue()};t.setComp(c,this.getGui(),this.eCellWrapper,i,s)}getParentOfValue(){return this.eCellValue?this.eCellValue:this.eCellWrapper?this.eCellWrapper:this.getGui()}setRenderDetails(e,t,i){if(this.cellEditor&&!this.cellEditorPopupWrapper)return;this.firstRender=null==this.firstRender;const n=this.refreshWrapper(!1);this.refreshEditStyles(!1),e?!i&&!n&&this.refreshCellRenderer(e)||(this.destroyRenderer(),this.createCellRendererInstance(e)):(this.destroyRenderer(),this.insertValueWithoutCellRenderer(t))}setEditDetails(e,t,i){e?this.createCellEditorInstance(e,t,i):this.destroyEditor()}removeControls(){this.checkboxSelectionComp=this.beans.context.destroyBean(this.checkboxSelectionComp),this.dndSourceComp=this.beans.context.destroyBean(this.dndSourceComp),this.rowDraggingComp=this.beans.context.destroyBean(this.rowDraggingComp)}refreshWrapper(e){const t=this.includeRowDrag||this.includeDndSource||this.includeSelection,i=t||this.forceWrapper,n=i&&null==this.eCellWrapper;if(n){const e=document.createElement("div");e.setAttribute("role","presentation"),e.setAttribute("class","ag-cell-wrapper"),this.eCellWrapper=e,this.getGui().appendChild(this.eCellWrapper)}const s=!i&&null!=this.eCellWrapper;s&&(wn(this.eCellWrapper),this.eCellWrapper=void 0),this.addOrRemoveCssClass("ag-cell-value",!i);const r=!e&&i,o=r&&null==this.eCellValue;if(o){const e=document.createElement("span");e.setAttribute("role","presentation"),e.setAttribute("class","ag-cell-value"),this.eCellValue=e,this.eCellWrapper.appendChild(this.eCellValue)}const a=!r&&null!=this.eCellValue;a&&(wn(this.eCellValue),this.eCellValue=void 0);const l=n||s||o||a;return l&&this.removeControls(),e||t&&this.addControls(),l}addControls(){this.includeRowDrag&&null==this.rowDraggingComp&&(this.rowDraggingComp=this.cellCtrl.createRowDragComp(),this.rowDraggingComp&&this.eCellWrapper.insertBefore(this.rowDraggingComp.getGui(),this.eCellValue)),this.includeDndSource&&null==this.dndSourceComp&&(this.dndSourceComp=this.cellCtrl.createDndSource(),this.eCellWrapper.insertBefore(this.dndSourceComp.getGui(),this.eCellValue)),this.includeSelection&&null==this.checkboxSelectionComp&&(this.checkboxSelectionComp=this.cellCtrl.createSelectionCheckbox(),this.eCellWrapper.insertBefore(this.checkboxSelectionComp.getGui(),this.eCellValue))}createCellEditorInstance(e,t,i){const n=this.editorVersion,s=e.newAgStackInstance();if(!s)return;const{params:r}=e;s.then(e=>this.afterCellEditorCreated(n,e,r,t,i)),C(this.cellEditor)&&r.cellStartedEdit&&this.cellCtrl.focusCell(!0)}insertValueWithoutCellRenderer(e){const t=this.getParentOfValue();Cn(t);const i=null!=e?bt(e,!0):null;null!=i&&(t.textContent=i)}destroyEditorAndRenderer(){this.destroyRenderer(),this.destroyEditor()}destroyRenderer(){const{context:e}=this.beans;this.cellRenderer=e.destroyBean(this.cellRenderer),wn(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),wn(this.cellEditorGui),this.cellEditorGui=null,this.editorVersion++}refreshCellRenderer(e){if(null==this.cellRenderer||null==this.cellRenderer.refresh)return!1;if(this.cellRendererClass!==e.componentClass)return!1;const t=this.cellRenderer.refresh(e.params);return!0===t||void 0===t}createCellRendererInstance(e){const t=!this.beans.gos.get("suppressAnimationFrame"),i=this.rendererVersion,{componentClass:n}=e,s=()=>{if(this.rendererVersion!==i||!this.isAlive())return;const t=e.newAgStackInstance(),s=this.afterCellRendererCreated.bind(this,i,n);t&&t.then(s)};t&&this.firstRender?this.beans.animationFrameService.createTask(s,this.rowNode.rowIndex,"createTasksP2"):s()}getCtrl(){return this.cellCtrl}getRowCtrl(){return this.rowCtrl}getCellRenderer(){return this.cellRenderer}getCellEditor(){return this.cellEditor}afterCellRendererCreated(e,t,i){if(this.isAlive()&&e===this.rendererVersion){if(this.cellRenderer=i,this.cellRendererClass=t,this.cellRendererGui=this.cellRenderer.getGui(),null!=this.cellRendererGui){const e=this.getParentOfValue();Cn(e),e.appendChild(this.cellRendererGui)}}else this.beans.context.destroyBean(i)}afterCellEditorCreated(e,t,i,n,s){if(e!==this.editorVersion)return void this.beans.context.destroyBean(t);if(t.isCancelBeforeStart&&t.isCancelBeforeStart())return this.beans.context.destroyBean(t),void this.cellCtrl.stopEditing(!0);if(!t.getGui)return console.warn(`AG Grid: cellEditor for column ${this.column.getId()} is missing getGui() method`),void this.beans.context.destroyBean(t);this.cellEditor=t,this.cellEditorGui=t.getGui();const r=n||void 0!==t.isPopup&&t.isPopup();r?this.addPopupCellEditor(i,s):this.addInCellEditor(),this.refreshEditStyles(!0,r),t.afterGuiAttached&&t.afterGuiAttached()}refreshEditStyles(e,t){var i;this.addOrRemoveCssClass("ag-cell-inline-editing",e&&!t),this.addOrRemoveCssClass("ag-cell-popup-editing",e&&!!t),this.addOrRemoveCssClass("ag-cell-not-inline-editing",!e||!!t),null==(i=this.rowCtrl)||i.setInlineEditingCss(e)}addInCellEditor(){const e=this.getGui();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){"fullRow"===this.beans.gos.get("editType")&&console.warn("AG Grid: popup cellEditor does not work with fullRowEdit - you cannot use them both - either turn off fullRowEdit, or stop using popup editors.");const i=this.cellEditor;this.cellEditorPopupWrapper=this.beans.context.createBean(new Ga(e));const n=this.cellEditorPopupWrapper.getGui();this.cellEditorGui&&n.appendChild(this.cellEditorGui);const s=this.beans.popupService,r=this.beans.gos.get("stopEditingWhenCellsLoseFocus"),o=null!=t?t:i.getPopupPosition?i.getPopupPosition():"over",a=this.beans.gos.get("enableRtl"),l={ePopup:n,column:this.column,rowNode:this.rowNode,type:"popupCellEditor",eventSource:this.getGui(),position:o,alignSide:a?"right":"left",keepWithinBounds:!0},c=s.positionPopupByComponent.bind(s,l),h=this.beans.localeService.getLocaleTextFunc(),u=s.addPopup({modal:r,eChild:n,closeOnEsc:!0,closedCallback:()=>{this.cellCtrl.onPopupEditorClosed()},anchorToElement:this.getGui(),positionCallback:c,ariaLabel:h("ariaLabelCellEditor","Cell Editor")});u&&(this.hideEditorPopup=u.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())&&_i()&&e.focus({preventScroll:!0}),Cn(this.getParentOfValue())}},Va=class extends Cs{constructor(e,t,i){super(),this.cellComps={},this.beans=t,this.rowCtrl=e;const n=document.createElement("div");n.setAttribute("comp-id",`${this.getCompId()}`),n.setAttribute("style",this.getInitialStyle(i)),this.setTemplateFromElement(n);const s=this.getGui(),r=s.style;this.domOrder=this.rowCtrl.getDomOrder(),Ht(s,"row");const o=this.rowCtrl.getTabIndex();null!=o&&s.setAttribute("tabindex",o.toString());const a={setDomOrder:e=>this.domOrder=e,setCellCtrls:e=>this.setCellCtrls(e),showFullWidth:e=>this.showFullWidth(e),getFullWidthCellRenderer:()=>this.getFullWidthCellRenderer(),addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setUserStyles:e=>Dn(s,e),setTop:e=>r.top=e,setTransform:e=>r.transform=e,setRowIndex:e=>s.setAttribute("row-index",e),setRowId:e=>s.setAttribute("row-id",e),setRowBusinessKey:e=>s.setAttribute("row-business-key",e),refreshFullWidth:e=>this.refreshFullWidth(e)};e.setComp(a,this.getGui(),i),this.addDestroyFunc(()=>{e.unsetComp(i)})}getInitialStyle(e){const t=this.rowCtrl.getInitialTransform(e);return t?`transform: ${t}`:`top: ${this.rowCtrl.getInitialRowTop(e)}`}showFullWidth(e){const t=e.newAgStackInstance();t&&t.then(e=>{if(this.isAlive()){const t=e.getGui();this.getGui().appendChild(t),this.rowCtrl.setupDetailRowAutoHeight(t),this.setFullWidthRowComp(e)}else this.beans.context.destroyBean(e)})}setCellCtrls(e){const t=Object.assign({},this.cellComps);e.forEach(e=>{const i=e.getInstanceId();null==this.cellComps[i]?this.newCellComp(e):t[i]=null});const i=N(t).filter(e=>null!=e);this.destroyCells(i),this.ensureDomOrder(e)}ensureDomOrder(e){if(!this.domOrder)return;const t=[];e.forEach(e=>{const i=this.cellComps[e.getInstanceId()];i&&t.push(i.getGui())}),Mn(this.getGui(),t)}newCellComp(e){const t=new Ba(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=N(this.cellComps).filter(e=>null!=e);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(e=>{if(!e)return;const t=e.getCtrl().getInstanceId();this.cellComps[t]===e&&(e.detach(),e.destroy(),this.cellComps[t]=null)})}refreshFullWidth(e){const{fullWidthCellRenderer:t}=this;if(!t||!t.refresh)return!1;const i=e();return t.refresh(i)}},Ha=class extends Cs{constructor(){super(function(){const e=Cs.elementGettingCreated.getAttribute("name"),t=Pa.getRowContainerCssClasses(e);let i;return i="center"===e||"topCenter"===e||"stickyTopCenter"===e||"bottomCenter"===e||"stickyBottomCenter"===e?`<div class="${t.viewport}" ref="eViewport" role="presentation">\n                <div class="${t.container}" ref="eContainer"></div>\n            </div>`:`<div class="${t.container}" ref="eContainer"></div>`,i}()),this.rowComps={},this.name=Cs.elementGettingCreated.getAttribute("name"),this.type=Da(this.name)}postConstruct(){const e={setViewportHeight:e=>this.eViewport.style.height=e,setRowCtrls:({rowCtrls:e})=>this.setRowCtrls(e),setDomOrder:e=>{this.domOrder=e},setContainerWidth:e=>this.eContainer.style.width=e};this.createManagedBean(new Pa(this.name)).setComp(e,this.eContainer,this.eViewport)}preDestroy(){this.setRowCtrls([])}setRowCtrls(e){const t=u({},this.rowComps);this.rowComps={},this.lastPlacedElement=null,e.forEach(e=>{const i=e.getInstanceId(),n=t[i];if(n)this.rowComps[i]=n,delete t[i],this.ensureDomOrder(n.getGui());else{if(!e.getRowNode().displayed)return;const t=new Va(e,this.beans,this.type);this.rowComps[i]=t,this.appendRow(t.getGui())}}),N(t).forEach(e=>{this.eContainer.removeChild(e.getGui()),e.destroy()}),Ht(this.eContainer,"rowgroup")}appendRow(e){this.domOrder?Tn(this.eContainer,e,this.lastPlacedElement):this.eContainer.appendChild(e),this.lastPlacedElement=e}ensureDomOrder(e){this.domOrder&&(An(this.eContainer,e,this.lastPlacedElement),this.lastPlacedElement=e)}};g([ue("beans")],Ha.prototype,"beans",2),g([Ss("eViewport")],Ha.prototype,"eViewport",2),g([Ss("eContainer")],Ha.prototype,"eContainer",2),g([le],Ha.prototype,"postConstruct",1),g([ce],Ha.prototype,"preDestroy",1);var Ua=class{constructor(e){this.columnsToAggregate=[],this.columnsToGroup=[],this.columnsToPivot=[],this.pinned=e}onDragEnter(e){if(this.clearColumnsList(),this.gos.get("functionsReadOnly"))return;const t=e.dragItem.columns;t&&t.forEach(e=>{e.isPrimary()&&(e.isAnyFunctionActive()||(e.isAllowValue()?this.columnsToAggregate.push(e):e.isAllowRowGroup()?this.columnsToGroup.push(e):e.isAllowPivot()&&this.columnsToPivot.push(e)))})}getIconName(){return this.columnsToAggregate.length+this.columnsToGroup.length+this.columnsToPivot.length>0?this.pinned?Br.ICON_PINNED:Br.ICON_MOVE:null}onDragLeave(e){this.clearColumnsList()}clearColumnsList(){this.columnsToAggregate.length=0,this.columnsToGroup.length=0,this.columnsToPivot.length=0}onDragging(e){}onDragStop(e){this.columnsToAggregate.length>0&&this.columnModel.addValueColumns(this.columnsToAggregate,"toolPanelDragAndDrop"),this.columnsToGroup.length>0&&this.columnModel.addRowGroupColumns(this.columnsToGroup,"toolPanelDragAndDrop"),this.columnsToPivot.length>0&&this.columnModel.addPivotColumns(this.columnsToPivot,"toolPanelDragAndDrop")}};g([ue("columnModel")],Ua.prototype,"columnModel",2),g([ue("gridOptionsService")],Ua.prototype,"gos",2);var za=class{static attemptMoveColumns(e){const{isFromHeader:t,hDirection:i,xPosition:n,fromEnter:s,fakeEvent:r,pinned:o,gos:a,columnModel:l}=e,c=0===i,h=1===i;let{allMovingColumns:u}=e;if(t){let e=[];u.forEach(t=>{var i;let n=null,s=t.getParent();for(;null!=s&&1===s.getDisplayedLeafColumns().length;)n=s,s=s.getParent();null!=n?((null==(i=n.getColGroupDef())?void 0:i.marryChildren)?n.getProvidedColumnGroup().getLeafColumns():n.getLeafColumns()).forEach(t=>{e.includes(t)||e.push(t)}):e.includes(t)||e.push(t)}),u=e}const d=u.slice();l.sortColumnsLikeGridColumns(d);const p=this.calculateValidMoves({movingCols:d,draggingRight:h,xPosition:n,pinned:o,gos:a,columnModel:l}),g=this.calculateOldIndex(d,l);if(0===p.length)return;const f=p[0];let m=null!==g&&!s;if(t&&(m=null!==g),m&&!r){if(c&&f>=g)return;if(h&&f<=g)return}const y=l.getAllDisplayedColumns();let v=[],b=null;for(let e=0;e<p.length;e++){const t=p[e],i=l.getProposedColumnOrder(d,t);if(!l.doesOrderPassRules(i))continue;const n=i.filter(e=>y.includes(e));if(null===b)b=n;else if(!Re(n,b))break;const s=this.groupFragCount(i);v.push({move:t,fragCount:s})}return 0!==v.length?(v.sort((e,t)=>e.fragCount-t.fragCount),this.moveColumns(u,v[0].move,"uiColumnMoved",!1,l)):void 0}static moveColumns(e,t,i,n,s){return s.moveColumns(e,t,i,n),n?null:{columns:e,toIndex:t}}static calculateOldIndex(e,t){const i=t.getAllGridColumns(),n=Pe(e.map(e=>i.indexOf(e))),s=n[0];return Ie(n)-s!==n.length-1?null:s}static groupFragCount(e){function t(e){let t=[],i=e.getOriginalParent();for(;null!=i;)t.push(i),i=i.getOriginalParent();return t}let i=0;for(let n=0;n<e.length-1;n++){let s=t(e[n]),r=t(e[n+1]);[s,r]=s.length>r.length?[s,r]:[r,s],s.forEach(e=>{-1===r.indexOf(e)&&i++})}return i}static getDisplayedColumns(e,t){switch(t){case"left":return e.getDisplayedLeftColumns();case"right":return e.getDisplayedRightColumns();default:return e.getDisplayedCenterColumns()}}static calculateValidMoves(e){const{movingCols:t,draggingRight:i,xPosition:n,pinned:s,gos:r,columnModel:o}=e;if(r.get("suppressMovableColumns")||t.some(e=>e.getColDef().suppressMovable))return[];const a=this.getDisplayedColumns(o,s),l=o.getAllGridColumns(),c=a.filter(e=>He(t,e)),h=a.filter(e=>!He(t,e)),u=l.filter(e=>!He(t,e));let d,p=0,g=n;if(i){let e=0;c.forEach(t=>e+=t.getActualWidth()),g-=e}if(g>0){for(let e=0;e<h.length&&(g-=h[e].getActualWidth(),!(g<0));e++)p++;i&&p++}if(p>0){const e=h[p-1];d=u.indexOf(e)+1}else d=u.indexOf(h[0]),-1===d&&(d=0);const f=[d],m=(e,t)=>e-t;if(i){let e=d+1;const t=l.length-1;for(;e<=t;)f.push(e),e++;f.sort(m)}else{let e=d;const t=l.length-1;let i=l[e];for(;e<=t&&a.indexOf(i)<0;)e++,f.push(e),i=l[e];e=d-1;const n=0;for(;e>=n;)f.push(e),e--;f.sort(m).reverse()}return f}static normaliseX(e,t,i,n,s){const r=s.getHeaderRowContainerCtrl(t).getViewport();return i&&(e-=r.getBoundingClientRect().left),n.get("enableRtl")&&(e=r.clientWidth-e),null==t&&(e+=s.get("center").getCenterViewportScrollLeft()),e}},Wa=class{constructor(e){this.needToMoveLeft=!1,this.needToMoveRight=!1,this.lastMovedInfo=null,this.pinned=e,this.isCenterContainer=!b(e)}init(){this.ctrlsService.whenReady(e=>{this.gridBodyCon=e.gridBodyCtrl})}getIconName(){return this.pinned?Br.ICON_PINNED:Br.ICON_MOVE}onDragEnter(e){const t=e.dragItem.columns;if(0===e.dragSource.type)this.setColumnsVisible(t,!0,"uiColumnDragged");else{const i=e.dragItem.visibleState,n=(t||[]).filter(e=>i[e.getId()]);this.setColumnsVisible(n,!0,"uiColumnDragged")}this.setColumnsPinned(t,this.pinned,"uiColumnDragged"),this.onDragging(e,!0,!0)}onDragLeave(){this.ensureIntervalCleared(),this.lastMovedInfo=null}setColumnsVisible(e,t,i){if(e){const n=e.filter(e=>!e.getColDef().lockVisible);this.columnModel.setColumnsVisible(n,t,i)}}setColumnsPinned(e,t,i){if(e){const n=e.filter(e=>!e.getColDef().lockPinned);this.columnModel.setColumnsPinned(n,t,i)}}onDragStop(){this.onDragging(this.lastDraggingEvent,!1,!0,!0),this.ensureIntervalCleared(),this.lastMovedInfo=null}checkCenterForScrolling(e){if(this.isCenterContainer){const t=this.ctrlsService.get("center"),i=t.getCenterViewportScrollLeft(),n=i+t.getCenterWidth();this.gos.get("enableRtl")?(this.needToMoveRight=e<i+50,this.needToMoveLeft=e>n-50):(this.needToMoveLeft=e<i+50,this.needToMoveRight=e>n-50),this.needToMoveLeft||this.needToMoveRight?this.ensureIntervalStarted():this.ensureIntervalCleared()}}onDragging(e=this.lastDraggingEvent,t=!1,i=!1,n=!1){var s;if(n){if(this.lastMovedInfo){const{columns:e,toIndex:t}=this.lastMovedInfo;za.moveColumns(e,t,"uiColumnMoved",!0,this.columnModel)}return}if(this.lastDraggingEvent=e,C(e.hDirection))return;const r=za.normaliseX(e.x,this.pinned,!1,this.gos,this.ctrlsService);t||this.checkCenterForScrolling(r);const o=this.normaliseDirection(e.hDirection),a=e.dragSource.type,l=(null==(s=e.dragSource.getDragItem().columns)?void 0:s.filter(e=>!e.getColDef().lockPinned||e.getPinned()==this.pinned))||[],c=za.attemptMoveColumns({allMovingColumns:l,isFromHeader:1===a,hDirection:o,xPosition:r,pinned:this.pinned,fromEnter:t,fakeEvent:i,gos:this.gos,columnModel:this.columnModel});c&&(this.lastMovedInfo=c)}normaliseDirection(e){if(!this.gos.get("enableRtl"))return e;switch(e){case 0:return 1;case 1:return 0;default:console.error(`AG Grid: Unknown direction ${e}`)}}ensureIntervalStarted(){this.movingIntervalId||(this.intervalCount=0,this.failedMoveAttempts=0,this.movingIntervalId=window.setInterval(this.moveInterval.bind(this),100),this.needToMoveLeft?this.dragAndDropService.setGhostIcon(Br.ICON_LEFT,!0):this.dragAndDropService.setGhostIcon(Br.ICON_RIGHT,!0))}ensureIntervalCleared(){this.movingIntervalId&&(window.clearInterval(this.movingIntervalId),this.movingIntervalId=null,this.dragAndDropService.setGhostIcon(Br.ICON_MOVE))}moveInterval(){let e;this.intervalCount++,e=10+5*this.intervalCount,e>100&&(e=100);let t=null;const i=this.gridBodyCon.getScrollFeature();if(this.needToMoveLeft?t=i.scrollHorizontally(-e):this.needToMoveRight&&(t=i.scrollHorizontally(e)),0!==t)this.onDragging(this.lastDraggingEvent),this.failedMoveAttempts=0;else{this.failedMoveAttempts++;const e=this.lastDraggingEvent.dragItem.columns.filter(e=>!e.getColDef().lockPinned);if(e.length>0&&(this.dragAndDropService.setGhostIcon(Br.ICON_PINNED),this.failedMoveAttempts>7)){const t=this.needToMoveLeft?"left":"right";this.setColumnsPinned(e,t,"uiColumnDragged"),this.dragAndDropService.nudge()}}}};g([ue("columnModel")],Wa.prototype,"columnModel",2),g([ue("dragAndDropService")],Wa.prototype,"dragAndDropService",2),g([ue("gridOptionsService")],Wa.prototype,"gos",2),g([ue("ctrlsService")],Wa.prototype,"ctrlsService",2),g([le],Wa.prototype,"init",1);var ja=class extends st{constructor(e,t){super(),this.pinned=e,this.eContainer=t}postConstruct(){this.ctrlsService.whenReady(e=>{switch(this.pinned){case"left":this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.left.getContainerElement()],[e.bottomLeft.getContainerElement()],[e.topLeft.getContainerElement()]];break;case"right":this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.right.getContainerElement()],[e.bottomRight.getContainerElement()],[e.topRight.getContainerElement()]];break;default:this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.center.getViewportElement()],[e.bottomCenter.getViewportElement()],[e.topCenter.getViewportElement()]]}})}isInterestedIn(e){return 1===e||0===e&&this.gos.get("allowDragFromColumnsToolPanel")}getSecondaryContainers(){return this.eSecondaryContainers}getContainer(){return this.eContainer}init(){this.moveColumnFeature=this.createManagedBean(new Wa(this.pinned)),this.bodyDropPivotTarget=this.createManagedBean(new Ua(this.pinned)),this.dragAndDropService.addDropTarget(this)}getIconName(){return this.currentDropListener.getIconName()}isDropColumnInPivotMode(e){return this.columnModel.isPivotMode()&&0===e.dragSource.type}onDragEnter(e){this.currentDropListener=this.isDropColumnInPivotMode(e)?this.bodyDropPivotTarget:this.moveColumnFeature,this.currentDropListener.onDragEnter(e)}onDragLeave(e){this.currentDropListener.onDragLeave(e)}onDragging(e){this.currentDropListener.onDragging(e)}onDragStop(e){this.currentDropListener.onDragStop(e)}};g([ue("dragAndDropService")],ja.prototype,"dragAndDropService",2),g([ue("columnModel")],ja.prototype,"columnModel",2),g([ue("ctrlsService")],ja.prototype,"ctrlsService",2),g([le],ja.prototype,"postConstruct",1),g([le],ja.prototype,"init",1);var $a=class e extends Ko{constructor(t){super(e.TEMPLATE,t),this.headerCompVersion=0,this.column=t.getColumnGroupChild(),this.pinned=t.getPinned()}postConstruct(){const e=this.getGui();var t,i;t="col-id",null!=(i=this.column.getColId())&&""!=i?e.setAttribute(t,i):e.removeAttribute(t);const n={setWidth:t=>e.style.width=t,addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setAriaSort:t=>t?di(e,t):pi(e),setUserCompDetails:e=>this.setUserCompDetails(e),getUserCompInstance:()=>this.headerComp};this.ctrl.setComp(n,this.getGui(),this.eResize,this.eHeaderCompWrapper);const s=this.ctrl.getSelectAllGui();this.eResize.insertAdjacentElement("afterend",s)}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(e=>this.afterCompCreated(t,e))}afterCompCreated(e,t){e==this.headerCompVersion&&this.isAlive()?(this.destroyHeaderComp(),this.headerComp=t,this.headerCompGui=t.getGui(),this.eHeaderCompWrapper.appendChild(this.headerCompGui),this.ctrl.setDragSource(this.getGui())):this.destroyBean(t)}};$a.TEMPLATE='<div class="ag-header-cell" role="columnheader">\n            <div ref="eResize" class="ag-header-cell-resize" role="presentation"></div>\n            <div ref="eHeaderCompWrapper" class="ag-header-cell-comp-wrapper" role="presentation"></div>\n        </div>',g([Ss("eResize")],$a.prototype,"eResize",2),g([Ss("eHeaderCompWrapper")],$a.prototype,"eHeaderCompWrapper",2),g([le],$a.prototype,"postConstruct",1),g([ce],$a.prototype,"destroyHeaderComp",1);var Ka=$a,Ya=class e extends Ko{constructor(t){super(e.TEMPLATE,t)}postConstruct(){const e=this.getGui();e.setAttribute("col-id",this.ctrl.getColId());const t={addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setResizableDisplayed:e=>an(this.eResize,e),setWidth:t=>e.style.width=t,setAriaExpanded:t=>{return i="aria-expanded",null!=(n=t)?e.setAttribute(i,n):e.removeAttribute(i);var i,n},setUserCompDetails:e=>this.setUserCompDetails(e),getUserCompInstance:()=>this.headerGroupComp};this.ctrl.setComp(t,e,this.eResize)}setUserCompDetails(e){e.newAgStackInstance().then(e=>this.afterHeaderCompCreated(e))}afterHeaderCompCreated(e){const t=()=>this.destroyBean(e);if(!this.isAlive())return void t();const i=this.getGui(),n=e.getGui();i.appendChild(n),this.addDestroyFunc(t),this.headerGroupComp=e,this.ctrl.setDragSource(i)}};Ya.TEMPLATE='<div class="ag-header-group-cell" role="columnheader">\n            <div ref="eResize" class="ag-header-cell-resize" role="presentation"></div>\n        </div>',g([Ss("eResize")],Ya.prototype,"eResize",2),g([le],Ya.prototype,"postConstruct",1);var qa=Ya,Xa=(e=>(e.COLUMN_GROUP="group",e.COLUMN="column",e.FLOATING_FILTER="filter",e))(Xa||{}),Za=class extends Cs{constructor(e){super(),this.headerComps={},this.ctrl=e,this.setTemplate(`<div class="${this.ctrl.getHeaderRowClass()}" role="row"></div>`)}init(){li(this.getGui(),this.ctrl.getAriaRowIndex());const e={setHeight:e=>this.getGui().style.height=e,setTop:e=>this.getGui().style.top=e,setHeaderCtrls:(e,t)=>this.setHeaderCtrls(e,t),setWidth:e=>this.getGui().style.width=e};this.ctrl.setComp(e)}destroyHeaderCtrls(){this.setHeaderCtrls([],!1)}setHeaderCtrls(e,t){if(!this.isAlive())return;const i=this.headerComps;if(this.headerComps={},e.forEach(e=>{const t=e.getInstanceId();let n=i[t];delete i[t],null==n&&(n=this.createHeaderComp(e),this.getGui().appendChild(n.getGui())),this.headerComps[t]=n}),P(i,(e,t)=>{this.getGui().removeChild(t.getGui()),this.destroyBean(t)}),t){const e=N(this.headerComps);e.sort((e,t)=>e.getCtrl().getColumnGroupChild().getLeft()-t.getCtrl().getColumnGroupChild().getLeft());const t=e.map(e=>e.getGui());Mn(this.getGui(),t)}}createHeaderComp(e){let t;switch(this.ctrl.getType()){case"group":t=new qa(e);break;case"filter":t=new qo(e);break;default:t=new Ka(e)}return this.createBean(t),t.setParentComponent(this),t}};g([le],Za.prototype,"init",1),g([ce],Za.prototype,"destroyHeaderCtrls",1);var Qa=0,Ja=class e extends st{constructor(e,t,i){super(),this.resizeToggleTimeout=0,this.resizeMultiplier=1,this.resizeFeature=null,this.lastFocusEvent=null,this.dragSource=null,this.columnGroupChild=e,this.parentRowCtrl=i,this.beans=t,this.instanceId=e.getUniqueId()+"-"+Qa++}postConstruct(){this.addManagedPropertyListeners(["suppressHeaderFocus"],()=>this.refreshTabIndex())}shouldStopEventPropagation(e){const{headerRowIndex:t,column:i}=this.focusService.getFocusedHeader();return es(this.gos,e,t,i)}getWrapperHasFocus(){return this.gos.getActiveDomElement()===this.eGui}setGui(e){this.eGui=e,this.addDomData(),this.addManagedListener(this.beans.eventService,ct.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:i}=this;da.refreshFirstAndLastStyles(e,t,i.columnModel)}refreshAriaColIndex(){const{beans:e,column:t}=this,i=e.columnModel.getAriaColumnIndex(t);hi(this.eGui,i)}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 i=this.gos.getActiveDomElement(),n=e.key===Zn.LEFT||e.key===Zn.RIGHT;if(this.isResizing&&(e.preventDefault(),e.stopImmediatePropagation()),i!==this.eGui||!e.shiftKey&&!e.altKey)return;if((this.isResizing||n)&&(e.preventDefault(),e.stopImmediatePropagation()),!n)return;const s=e.key===Zn.LEFT!==this.gos.get("enableRtl"),r=Fr[s?"Left":"Right"];if(e.altKey){this.isResizing=!0,this.resizeMultiplier+=1;const i=this.getViewportAdjustedResizeDiff(e);this.resizeHeader(i,e.shiftKey),null==(t=this.resizeFeature)||t.toggleColumnResizing(!0)}else this.moveHeader(r)}getViewportAdjustedResizeDiff(e){let t=this.getResizeDiff(e);if(this.column.getPinned()){const e=this.pinnedWidthService.getPinnedLeftWidth(),i=this.pinnedWidthService.getPinnedRightWidth(),n=pn(this.ctrlsService.getGridBodyCtrl().getBodyViewportElement())-50;if(e+i+t>n){if(!(n>e+i))return 0;t=n-e-i}}return t}getResizeDiff(e){let t=e.key===Zn.LEFT!==this.gos.get("enableRtl");const i=this.column.getPinned(),n=this.gos.get("enableRtl");return i&&n!==("right"===i)&&(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;null==(e=this.resizeFeature)||e.toggleColumnResizing(!1)},150))}handleKeyDown(e){const t=this.getWrapperHasFocus();switch(e.key){case Zn.PAGE_DOWN:case Zn.PAGE_UP:case Zn.PAGE_HOME:case Zn.PAGE_END:t&&e.preventDefault()}}addDomData(){const t=e.DOM_DATA_KEY_HEADER_CTRL;this.gos.setDomData(this.eGui,t,this),this.addDestroyFunc(()=>this.gos.setDomData(this.eGui,t,null))}getGui(){return this.eGui}focus(e){return!!this.eGui&&(this.lastFocusEvent=e||null,this.eGui.focus(),!0)}getRowIndex(){return this.parentRowCtrl.getRowIndex()}getParentRowCtrl(){return this.parentRowCtrl}getPinned(){return this.parentRowCtrl.getPinned()}getInstanceId(){return this.instanceId}getColumnGroupChild(){return this.columnGroupChild}removeDragSource(){this.dragSource&&(this.dragAndDropService.removeDragSource(this.dragSource),this.dragSource=null)}handleContextMenuMouseEvent(e,t,i){const n=null!=e?e:t;this.gos.get("preventDefaultOnContextMenu")&&n.preventDefault();const s=i instanceof Se?i:void 0;this.menuService.isHeaderContextMenuEnabled(s)&&this.menuService.showHeaderContextMenu(s,e,t),this.dispatchColumnMouseEvent(ct.EVENT_COLUMN_HEADER_CONTEXT_MENU,i)}dispatchColumnMouseEvent(e,t){const i={type:e,column:t};this.eventService.dispatchEvent(i)}destroy(){super.destroy(),this.removeDragSource(),this.comp=null,this.column=null,this.resizeFeature=null,this.lastFocusEvent=null,this.columnGroupChild=null,this.parentRowCtrl=null,this.eGui=null}};Ja.DOM_DATA_KEY_HEADER_CTRL="headerCtrl",g([ue("pinnedWidthService")],Ja.prototype,"pinnedWidthService",2),g([ue("focusService")],Ja.prototype,"focusService",2),g([ue("userComponentFactory")],Ja.prototype,"userComponentFactory",2),g([ue("ctrlsService")],Ja.prototype,"ctrlsService",2),g([ue("dragAndDropService")],Ja.prototype,"dragAndDropService",2),g([ue("menuService")],Ja.prototype,"menuService",2),g([le],Ja.prototype,"postConstruct",1);var el=Ja,tl=class extends st{constructor(e,t,i,n){super(),this.columnOrGroup=e,this.eCell=t,this.ariaEl=this.eCell.querySelector("[role=columnheader]")||this.eCell,this.colsSpanning=n,this.beans=i}setColsSpanning(e){this.colsSpanning=e,this.onLeftChanged()}getColumnOrGroup(){return this.beans.gos.get("enableRtl")&&this.colsSpanning?Ie(this.colsSpanning):this.columnOrGroup}postConstruct(){this.addManagedListener(this.columnOrGroup,Se.EVENT_LEFT_CHANGED,this.onLeftChanged.bind(this)),this.setLeftFirstTime(),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onLeftChanged.bind(this)),this.addManagedPropertyListener("domLayout",this.onLeftChanged.bind(this))}setLeftFirstTime(){const e=this.beans.gos.get("suppressColumnMoveAnimation"),t=b(this.columnOrGroup.getOldLeft());this.beans.columnAnimationService.isActive()&&t&&!e?this.animateInLeft():this.onLeftChanged()}animateInLeft(){const e=this.getColumnOrGroup(),t=e.getLeft(),i=e.getOldLeft(),n=this.modifyLeftForPrintLayout(e,i),s=this.modifyLeftForPrintLayout(e,t);this.setLeft(n),this.actualLeft=s,this.beans.columnAnimationService.executeNextVMTurn(()=>{this.actualLeft===s&&this.setLeft(s)})}onLeftChanged(){const e=this.getColumnOrGroup(),t=e.getLeft();this.actualLeft=this.modifyLeftForPrintLayout(e,t),this.setLeft(this.actualLeft)}modifyLeftForPrintLayout(e,t){if(!this.beans.gos.isDomLayout("print"))return t;if("left"===e.getPinned())return t;const i=this.beans.columnModel.getDisplayedColumnsLeftWidth();return"right"===e.getPinned()?i+this.beans.columnModel.getBodyContainerWidth()+t:i+t}setLeft(e){let t;if(b(e)&&(this.eCell.style.left=`${e}px`),this.columnOrGroup instanceof Se)t=this.columnOrGroup;else{const e=this.columnOrGroup.getLeafColumns();if(!e.length)return;e.length>1&&ui(this.ariaEl,e.length),t=e[0]}}};g([le],tl.prototype,"postConstruct",1);var il=class extends st{constructor(e,t){super(),this.columns=e,this.element=t}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([ue("columnHoverService")],il.prototype,"columnHoverService",2),g([le],il.prototype,"postConstruct",1);var nl=class extends el{constructor(e,t,i){super(e,t,i),this.iconCreated=!1,this.column=e}setComp(e,t,i,n){this.comp=e,this.eButtonShowMainFilter=i,this.eFloatingFilterBody=n,this.setGui(t),this.setupActive(),this.setupWidth(),this.setupLeft(),this.setupHover(),this.setupFocus(),this.setupAria(),this.setupFilterButton(),this.setupUserComp(),this.setupSyncWithFilter(),this.setupUi(),this.addManagedListener(this.eButtonShowMainFilter,"click",this.showParentFilter.bind(this)),this.setupFilterChangedListener(),this.addManagedListener(this.column,Se.EVENT_COL_DEF_CHANGED,this.onColDefChanged.bind(this))}resizeHeader(){}moveHeader(){}setupActive(){const e=this.column.getColDef(),t=!!e.filter,i=!!e.floatingFilter;this.active=t&&i}setupUi(){if(this.comp.setButtonWrapperDisplayed(!this.suppressFilterButton&&this.active),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-full-body",this.suppressFilterButton),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-body",!this.suppressFilterButton),!this.active||this.iconCreated)return;const e=qn("filter",this.gos,this.column);e&&(this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(e))}setupFocus(){this.createManagedBean(new Is(this.eGui,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)}))}setupAria(){const e=this.localeService.getLocaleTextFunc();$t(this.eButtonShowMainFilter,e("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(e){if(this.gos.getActiveDomElement()===this.eGui)return;const t=this.focusService.findNextFocusableElement(this.eGui,null,e.shiftKey);if(t)return this.beans.headerNavigationService.scrollToColumn(this.column),e.preventDefault(),void t.focus();const i=this.findNextColumnWithFloatingFilter(e.shiftKey);i&&this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:this.getParentRowCtrl().getRowIndex(),column:i},event:e})&&e.preventDefault()}findNextColumnWithFloatingFilter(e){const t=this.beans.columnModel;let i=this.column;do{if(i=e?t.getDisplayedColBefore(i):t.getDisplayedColAfter(i),!i)break}while(!i.getColDef().filter||!i.getColDef().floatingFilter);return i}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();switch(e.key){case Zn.UP:case Zn.DOWN:t||e.preventDefault();case Zn.LEFT:case Zn.RIGHT:if(t)return;e.stopPropagation();case Zn.ENTER:t&&this.focusService.focusInto(this.eGui)&&e.preventDefault();break;case Zn.ESCAPE:t||this.eGui.focus()}}onFocusIn(e){if(this.eGui.contains(e.relatedTarget))return;const t=!!e.relatedTarget&&!e.relatedTarget.classList.contains("ag-floating-filter"),i=!!e.relatedTarget&&hn(e.relatedTarget,"ag-floating-filter");if(t&&i&&e.target===this.eGui){const e=this.lastFocusEvent,t=!(!e||e.key!==Zn.TAB);if(e&&t){const t=e.shiftKey;this.focusService.focusInto(this.eGui,t)}}const n=this.getRowIndex();this.beans.focusService.setFocusedHeader(n,this.column)}setupHover(){this.createManagedBean(new il([this.column],this.eGui));const e=()=>{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,ct.EVENT_COLUMN_HOVER_CHANGED,e),e()}setupLeft(){const e=new tl(this.column,this.eGui,this.beans);this.createManagedBean(e)}setupFilterButton(){this.suppressFilterButton=!this.menuService.isFloatingFilterButtonEnabled(this.column),this.highlightFilterButtonWhenActive=!this.menuService.isLegacyMenuEnabled()}setupUserComp(){if(!this.active)return;const e=this.beans.filterManager.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter());e&&this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setCompDetails(e)}showParentFilter(){const e=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;this.menuService.showFilterMenu({column:this.column,buttonElement:e,containerType:"floatingFilter",positionBy:"button"})}setupSyncWithFilter(){if(!this.active)return;const{filterManager:e}=this.beans,t=t=>{if("filterDestroyed"===(null==t?void 0:t.source)&&this.context.isDestroyed())return;const i=this.comp.getFloatingFilterComp();i&&i.then(i=>{var n;if(i){const s=e.getCurrentFloatingFilterParentModel(this.column);i.onParentModelChanged(s,t?this.gos.addGridCommonParams({columns:null!=(n=t.columns)?n:[],type:ct.EVENT_FILTER_CHANGED,source:"api"===t.source?"api":"columnFilter"}):null)}})};this.destroySyncListener=this.addManagedListener(this.column,Se.EVENT_FILTER_CHANGED,t),e.isFilterActive(this.column)&&t(null)}setupWidth(){const e=()=>{const e=`${this.column.getActualWidth()}px`;this.comp.setWidth(e)};this.addManagedListener(this.column,Se.EVENT_WIDTH_CHANGED,e),e()}setupFilterChangedListener(){this.active&&(this.destroyFilterChangedListener=this.addManagedListener(this.column,Se.EVENT_FILTER_CHANGED,this.updateFilterButton.bind(this)),this.updateFilterButton())}updateFilterButton(){if(!this.suppressFilterButton&&this.comp){const e=this.beans.filterManager.isFilterAllowed(this.column);this.comp.setButtonWrapperDisplayed(e),this.highlightFilterButtonWhenActive&&e&&this.eButtonShowMainFilter.classList.toggle("ag-filter-active",this.column.isFilterActive())}}onColDefChanged(){var e,t;const i=this.active;this.setupActive();const n=!i&&this.active;i&&!this.active&&(null==(e=this.destroySyncListener)||e.call(this),null==(t=this.destroyFilterChangedListener)||t.call(this));const s=this.active?this.beans.filterManager.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter()):null,r=this.comp.getFloatingFilterComp();r&&s?r.then(e=>{var t;!e||this.beans.filterManager.areFilterCompsDifferent(null!=(t=this.userCompDetails)?t:null,s)?this.updateCompDetails(s,n):this.updateFloatingFilterParams(s)}):this.updateCompDetails(s,n)}updateCompDetails(e,t){this.isAlive()&&(this.setCompDetails(e),this.setupFilterButton(),this.setupUi(),t&&(this.setupSyncWithFilter(),this.setupFilterChangedListener()))}updateFloatingFilterParams(e){var t;if(!e)return;const i=e.params;null==(t=this.comp.getFloatingFilterComp())||t.then(e=>{let t=!1;(null==e?void 0:e.refresh)&&"function"==typeof e.refresh&&null!==e.refresh(i)&&(t=!0),!t&&(null==e?void 0:e.onParamsUpdated)&&"function"==typeof e.onParamsUpdated&&null!==e.onParamsUpdated(i)&&z("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}},sl=class extends st{constructor(e,t,i,n,s){super(),this.pinned=e,this.column=t,this.eResize=i,this.comp=n,this.ctrl=s}postConstruct(){const e=[];let t,i;const n=()=>{if(an(this.eResize,t),!t)return;const n=this.horizontalResizeService.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(e.push(n),i){const t=this.gos.get("skipHeaderOnAutoSize"),i=()=>{this.columnModel.autoSizeColumn(this.column,"uiColumnResized",t)};this.eResize.addEventListener("dblclick",i);const n=new yr(this.eResize);n.addEventListener(yr.EVENT_DOUBLE_TAP,i),e.push(()=>{this.eResize.removeEventListener("dblclick",i),n.removeEventListener(yr.EVENT_DOUBLE_TAP,i),n.destroy()})}},s=()=>{e.forEach(e=>e()),e.length=0},r=()=>{const e=this.column.isResizable(),r=!this.gos.get("suppressAutoSize")&&!this.column.getColDef().suppressAutoSize;(e!==t||r!==i)&&(t=e,i=r,s(),n())};r(),this.addDestroyFunc(s),this.ctrl.addRefreshFunction(r)}onResizing(e,t){const{column:i,lastResizeAmount:n,resizeStartWidth:s}=this,r=this.normaliseResizeAmount(t),o=[{key:i,newWidth:s+r}];this.column.getPinned()&&this.pinnedWidthService.getPinnedLeftWidth()+this.pinnedWidthService.getPinnedRightWidth()+(r-n)>pn(this.ctrlsService.getGridBodyCtrl().getBodyViewportElement())-50||(this.lastResizeAmount=r,this.columnModel.setColumnWidths(o,this.resizeWithShiftKey,e,"uiColumnResized"),e&&this.toggleColumnResizing(!1))}onResizeStart(e){this.resizeStartWidth=this.column.getActualWidth(),this.lastResizeAmount=0,this.resizeWithShiftKey=e,this.toggleColumnResizing(!0)}toggleColumnResizing(e){this.comp.addOrRemoveCssClass("ag-column-resizing",e)}normaliseResizeAmount(e){let t=e;const i="left"!==this.pinned,n="right"===this.pinned;return this.gos.get("enableRtl")?i&&(t*=-1):n&&(t*=-1),t}};g([ue("horizontalResizeService")],sl.prototype,"horizontalResizeService",2),g([ue("pinnedWidthService")],sl.prototype,"pinnedWidthService",2),g([ue("ctrlsService")],sl.prototype,"ctrlsService",2),g([ue("columnModel")],sl.prototype,"columnModel",2),g([le],sl.prototype,"postConstruct",1);var rl=class extends st{constructor(e){super(),this.cbSelectAllVisible=!1,this.processingEventFromCheckbox=!1,this.column=e}onSpaceKeyDown(e){const t=this.cbSelectAll;t.isDisplayed()&&!t.getGui().contains(this.gos.getActiveDomElement())&&(e.preventDefault(),t.setValue(!t.getValue()))}getCheckboxGui(){return this.cbSelectAll.getGui()}setComp(e){this.headerCellCtrl=e,this.cbSelectAll=this.createManagedBean(new zs),this.cbSelectAll.addCssClass("ag-header-select-all"),Ht(this.cbSelectAll.getGui(),"presentation"),this.showOrHideSelectAll(),this.addManagedListener(this.eventService,ct.EVENT_NEW_COLUMNS_LOADED,this.onNewColumnsLoaded.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_SELECTION_CHANGED,this.onSelectionChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_PAGINATION_CHANGED,this.onSelectionChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_MODEL_UPDATED,this.onModelChanged.bind(this)),this.addManagedListener(this.cbSelectAll,ct.EVENT_FIELD_VALUE_CHANGED,this.onCbSelectAll.bind(this)),ei(this.cbSelectAll.getGui(),!0),this.cbSelectAll.getInputElement().setAttribute("tabindex","-1"),this.refreshSelectAllLabel()}onNewColumnsLoaded(){this.showOrHideSelectAll()}onDisplayedColumnsChanged(){this.isAlive()&&this.showOrHideSelectAll()}showOrHideSelectAll(){this.cbSelectAllVisible=this.isCheckboxSelection(),this.cbSelectAll.setDisplayed(this.cbSelectAllVisible,{skipAriaHidden:!0}),this.cbSelectAllVisible&&(this.checkRightRowModelType("selectAllCheckbox"),this.checkSelectionType("selectAllCheckbox"),this.updateStateOfCheckbox()),this.refreshSelectAllLabel()}onModelChanged(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()}onSelectionChanged(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()}updateStateOfCheckbox(){if(this.processingEventFromCheckbox)return;this.processingEventFromCheckbox=!0;const e=this.selectionService.getSelectAllState(this.isFilteredOnly(),this.isCurrentPageOnly());this.cbSelectAll.setValue(e);const t=this.selectionService.hasNodesToSelect(this.isFilteredOnly(),this.isCurrentPageOnly());this.cbSelectAll.setDisabled(!t),this.refreshSelectAllLabel(),this.processingEventFromCheckbox=!1}refreshSelectAllLabel(){const e=this.localeService.getLocaleTextFunc(),t=this.cbSelectAll.getValue()?e("ariaChecked","checked"):e("ariaUnchecked","unchecked"),i=e("ariaRowSelectAll","Press Space to toggle all rows selection");this.cbSelectAllVisible?this.headerCellCtrl.setAriaDescriptionProperty("selectAll",`${i} (${t})`):this.headerCellCtrl.setAriaDescriptionProperty("selectAll",null),this.cbSelectAll.setInputAriaLabel(`${i} (${t})`),this.headerCellCtrl.announceAriaDescription()}checkSelectionType(e){return!("multiple"!==this.gos.get("rowSelection")&&(console.warn(`AG Grid: ${e} is only available if using 'multiple' rowSelection.`),1))}checkRightRowModelType(e){const t=this.rowModel.getType();return!("clientSide"!==t&&"serverSide"!==t&&(console.warn(`AG Grid: ${e} is only available if using 'clientSide' or 'serverSide' rowModelType, you are using ${t}.`),1))}onCbSelectAll(){if(this.processingEventFromCheckbox)return;if(!this.cbSelectAllVisible)return;const e=this.cbSelectAll.getValue(),t=this.isFilteredOnly(),i=this.isCurrentPageOnly();let n="uiSelectAll";i?n="uiSelectAllCurrentPage":t&&(n="uiSelectAllFiltered");const s={source:n,justFiltered:t,justCurrentPage:i};e?this.selectionService.selectAllRowNodes(s):this.selectionService.deselectAllRowNodes(s)}isCheckboxSelection(){let e=this.column.getColDef().headerCheckboxSelection;return"function"==typeof e&&(e=e(this.gos.addGridCommonParams({column:this.column,colDef:this.column.getColDef()}))),!!e&&this.checkRightRowModelType("headerCheckboxSelection")&&this.checkSelectionType("headerCheckboxSelection")}isFilteredOnly(){return!!this.column.getColDef().headerCheckboxSelectionFilteredOnly}isCurrentPageOnly(){return!!this.column.getColDef().headerCheckboxSelectionCurrentPageOnly}};g([ue("rowModel")],rl.prototype,"rowModel",2),g([ue("selectionService")],rl.prototype,"selectionService",2);var ol=class extends el{constructor(e,t,i){super(e,t,i),this.refreshFunctions=[],this.userHeaderClasses=new Set,this.ariaDescriptionProperties=new Map,this.column=e}setComp(e,t,i,n){this.comp=e,this.setGui(t),this.updateState(),this.setupWidth(),this.setupMovingCss(),this.setupMenuClass(),this.setupSortableClass(),this.setupWrapTextClass(),this.refreshSpanHeaderHeight(),this.setupAutoHeight(n),this.addColumnHoverListener(),this.setupFilterClass(),this.setupClassesFromColDef(),this.setupTooltip(),this.addActiveHeaderMouseListeners(),this.setupSelectAll(),this.setupUserComp(),this.refreshAria(),this.resizeFeature=this.createManagedBean(new sl(this.getPinned(),this.column,i,e,this)),this.createManagedBean(new il([this.column],t)),this.createManagedBean(new tl(this.column,t,this.beans)),this.createManagedBean(new Is(t,{shouldStopEventPropagation:e=>this.shouldStopEventPropagation(e),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,Se.EVENT_COL_DEF_CHANGED,this.refresh.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_VALUE_CHANGED,this.onColumnValueChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_ROW_GROUP_CHANGED,this.onColumnRowGroupChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PIVOT_CHANGED,this.onColumnPivotChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_HEADER_HEIGHT_CHANGED,this.onHeaderHeightChanged.bind(this))}resizeHeader(e,t){var i,n;if(!this.column.isResizable())return;const s=this.column.getActualWidth(),r=null!=(i=this.column.getMinWidth())?i:0,o=null!=(n=this.column.getMaxWidth())?n:Number.MAX_SAFE_INTEGER,a=Math.min(Math.max(s+e,r),o);this.beans.columnModel.setColumnWidths([{key:this.column,newWidth:a}],t,!0,"uiColumnResized")}moveHeader(e){const{eGui:t,column:i,gos:n,ctrlsService:s}=this,r=this.getPinned(),o=t.getBoundingClientRect().left,a=i.getActualWidth(),l=0===e!==n.get("enableRtl"),c=za.normaliseX(l?o-20:o+a+20,r,!0,n,s);za.attemptMoveColumns({allMovingColumns:[i],isFromHeader:!0,hDirection:e,xPosition:c,pinned:r,fromEnter:!1,fakeEvent:!1,gos:n,columnModel:this.beans.columnModel}),s.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(i,"auto")}setupUserComp(){const e=this.lookupUserCompDetails();this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setUserCompDetails(e)}lookupUserCompDetails(){const e=this.createParams(),t=this.column.getColDef();return this.userComponentFactory.getHeaderCompDetails(t,e)}createParams(){return this.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 rl(this.column)),this.selectAllFeature.setComp(this)}getSelectAllGui(){return this.selectAllFeature.getCheckboxGui()}handleKeyDown(e){super.handleKeyDown(e),e.key===Zn.SPACE&&this.selectAllFeature.onSpaceKeyDown(e),e.key===Zn.ENTER&&this.onEnterKeyDown(e),e.key===Zn.DOWN&&e.altKey&&this.showMenuOnKeyPress(e,!1)}onEnterKeyDown(e){if(e.ctrlKey||e.metaKey)this.showMenuOnKeyPress(e,!0);else if(this.sortable){const t=e.shiftKey;this.beans.sortController.progressSort(this.column,t,"uiColumnSorted")}}showMenuOnKeyPress(e,t){const i=this.comp.getUserCompInstance();i&&i instanceof wr&&i.onMenuKeyboardShortcut(t)&&e.preventDefault()}onFocusIn(e){if(!this.getGui().contains(e.relatedTarget)){const e=this.getRowIndex();this.focusService.setFocusedHeader(e,this.column),this.announceAriaDescription()}this.focusService.isKeyboardMode()&&this.setActiveHeader(!0)}onFocusOut(e){this.getGui().contains(e.relatedTarget)||this.setActiveHeader(!1)}setupTooltip(e,t){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature));const i="whenTruncated"===this.gos.get("tooltipShowMode"),n=this.eGui,s=this.column.getColDef();t||!i||s.headerComponent||(t=()=>{const e=n.querySelector(".ag-header-cell-text");return!e||e.scrollWidth>e.clientWidth});const r={getColumn:()=>this.column,getColDef:()=>this.column.getColDef(),getGui:()=>n,getLocation:()=>"header",getTooltipValue:()=>null!=e?e:this.column.getColDef().headerTooltip,shouldDisplayTooltip:t},o=this.createManagedBean(new ys(r));this.refreshFunctions.push(()=>o.refreshToolTip())}setupClassesFromColDef(){const e=()=>{const e=this.column.getColDef(),t=da.getHeaderClassesFromColDef(e,this.gos,this.column,null),i=this.userHeaderClasses;this.userHeaderClasses=new Set(t),t.forEach(e=>{i.has(e)?i.delete(e):this.comp.addOrRemoveCssClass(e,!0)}),i.forEach(e=>this.comp.addOrRemoveCssClass(e,!1))};this.refreshFunctions.push(e),e()}setDragSource(e){if(this.dragSourceElement=e,this.removeDragSource(),!e||!this.draggable)return;const{column:t,beans:i,displayName:n,dragAndDropService:s,gos:r}=this,{columnModel:o}=i;let a=!this.gos.get("suppressDragLeaveHidesColumns");const l=this.dragSource={type:1,eElement:e,getDefaultIconName:()=>a?Br.ICON_HIDE:Br.ICON_NOT_ALLOWED,getDragItem:()=>this.createDragItem(t),dragItemName:n,onDragStarted:()=>{a=!r.get("suppressDragLeaveHidesColumns"),t.setMoving(!0,"uiColumnMoved")},onDragStopped:()=>t.setMoving(!1,"uiColumnMoved"),onGridEnter:e=>{var t;if(a){const i=(null==(t=null==e?void 0:e.columns)?void 0:t.filter(e=>!e.getColDef().lockVisible))||[];o.setColumnsVisible(i,!0,"uiColumnMoved")}},onGridExit:e=>{var t;if(a){const i=(null==(t=null==e?void 0:e.columns)?void 0:t.filter(e=>!e.getColDef().lockVisible))||[];o.setColumnsVisible(i,!1,"uiColumnMoved")}}};s.addDragSource(l,!0)}createDragItem(e){const t={};return t[e.getId()]=e.isVisible(),{columns:[e],visibleState:t}}updateState(){this.menuEnabled=this.menuService.isColumnMenuInHeaderEnabled(this.column),this.openFilterEnabled=this.menuService.isFilterMenuInHeaderEnabled(this.column),this.sortable=this.column.isSortable(),this.displayName=this.calculateDisplayName(),this.draggable=this.workOutDraggable()}addRefreshFunction(e){this.refreshFunctions.push(e)}refresh(){this.updateState(),this.refreshHeaderComp(),this.refreshAria(),this.refreshFunctions.forEach(e=>e())}refreshHeaderComp(){const e=this.lookupUserCompDetails();null!=this.comp.getUserCompInstance()&&this.userCompDetails.componentClass==e.componentClass&&this.attemptHeaderCompRefresh(e.params)?this.setDragSource(this.dragSourceElement):this.setCompDetails(e)}attemptHeaderCompRefresh(e){const t=this.comp.getUserCompInstance();return!!t&&(!!t.refresh&&t.refresh(e))}calculateDisplayName(){return this.beans.columnModel.getDisplayNameForColumn(this.column,"header",!0)}checkDisplayName(){this.displayName!==this.calculateDisplayName()&&this.refresh()}workOutDraggable(){const e=this.column.getColDef();return!(this.gos.get("suppressMovableColumns")||e.suppressMovable||e.lockPosition)||!!e.enableRowGroup||!!e.enablePivot}onColumnRowGroupChanged(){this.checkDisplayName()}onColumnPivotChanged(){this.checkDisplayName()}onColumnValueChanged(){this.checkDisplayName()}setupWidth(){const e=()=>{const e=this.column.getActualWidth();this.comp.setWidth(`${e}px`)};this.addManagedListener(this.column,Se.EVENT_WIDTH_CHANGED,e),e()}setupMovingCss(){const e=()=>{this.comp.addOrRemoveCssClass("ag-header-cell-moving",this.column.isMoving())};this.addManagedListener(this.column,Se.EVENT_MOVING_CHANGED,e),e()}setupMenuClass(){const e=()=>{this.comp.addOrRemoveCssClass("ag-column-menu-visible",this.column.isMenuVisible())};this.addManagedListener(this.column,Se.EVENT_MENU_VISIBLE_CHANGED,e),e()}setupSortableClass(){const e=()=>{this.comp.addOrRemoveCssClass("ag-header-cell-sortable",!!this.sortable)};e(),this.addRefreshFunction(e),this.addManagedListener(this.eventService,Se.EVENT_SORT_CHANGED,this.refreshAriaSort.bind(this))}setupFilterClass(){const e=()=>{const e=this.column.isFilterActive();this.comp.addOrRemoveCssClass("ag-header-cell-filtered",e),this.refreshAria()};this.addManagedListener(this.column,Se.EVENT_FILTER_ACTIVE_CHANGED,e),e()}setupWrapTextClass(){const e=()=>{const e=!!this.column.getColDef().wrapHeaderText;this.comp.addOrRemoveCssClass("ag-header-cell-wrap-text",e)};e(),this.addRefreshFunction(e)}onDisplayedColumnsChanged(){super.onDisplayedColumnsChanged(),this.isAlive()&&this.onHeaderHeightChanged()}onHeaderHeightChanged(){this.refreshSpanHeaderHeight()}refreshSpanHeaderHeight(){const{eGui:e,column:t,comp:i,beans:n}=this;if(!t.isSpanHeaderHeight())return e.style.removeProperty("top"),e.style.removeProperty("height"),i.addOrRemoveCssClass("ag-header-span-height",!1),void i.addOrRemoveCssClass("ag-header-span-total",!1);const{numberOfParents:s,isSpanningTotal:r}=this.column.getColumnGroupPaddingInfo();i.addOrRemoveCssClass("ag-header-span-height",s>0);const{columnModel:o}=n,a=o.getColumnHeaderRowHeight();if(0===s)return i.addOrRemoveCssClass("ag-header-span-total",!1),e.style.setProperty("top","0px"),void e.style.setProperty("height",`${a}px`);i.addOrRemoveCssClass("ag-header-span-total",r);const l=s*(o.isPivotMode()?o.getPivotGroupHeaderHeight():o.getGroupHeaderHeight());e.style.setProperty("top",-l+"px"),e.style.setProperty("height",`${a+l}px`)}setupAutoHeight(e){const{columnModel:t,resizeObserverService:i}=this.beans,n=i=>{if(!this.isAlive())return;const{paddingTop:s,paddingBottom:r,borderBottomWidth:o,borderTopWidth:a}=un(this.getGui()),l=s+r+o+a,c=e.offsetHeight+l;if(i<5){const t=this.beans.gos.getDocument();if(!t||!t.contains(e)||0==c)return void window.setTimeout(()=>n(i+1),0)}t.setColumnHeaderHeight(this.column,c)};let s,r=!1;const o=()=>{const e=this.column.isAutoHeaderHeight();e&&!r&&a(),!e&&r&&l()},a=()=>{r=!0,n(0),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!0),s=i.observeResize(e,()=>n(0))},l=()=>{r=!1,s&&s(),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!1),s=void 0};o(),this.addDestroyFunc(()=>l()),this.addManagedListener(this.column,Se.EVENT_WIDTH_CHANGED,()=>r&&n(0)),this.addManagedListener(this.eventService,Se.EVENT_SORT_CHANGED,()=>{r&&window.setTimeout(()=>n(0))}),this.addRefreshFunction(o)}refreshAriaSort(){if(this.sortable){const e=this.localeService.getLocaleTextFunc(),t=this.beans.sortController.getDisplaySortForColumn(this.column)||null;this.comp.setAriaSort(Ut(t)),this.setAriaDescriptionProperty("sort",e("ariaSortableColumn","Press ENTER to sort"))}else this.comp.setAriaSort(),this.setAriaDescriptionProperty("sort",null)}refreshAriaMenu(){if(this.menuEnabled){const e=this.localeService.getLocaleTextFunc();this.setAriaDescriptionProperty("menu",e("ariaMenuColumn","Press ALT DOWN to open column menu"))}else this.setAriaDescriptionProperty("menu",null)}refreshAriaFilterButton(){if(this.openFilterEnabled&&!this.menuService.isLegacyMenuEnabled()){const e=this.localeService.getLocaleTextFunc();this.setAriaDescriptionProperty("filterButton",e("ariaFilterColumn","Press CTRL ENTER to open filter"))}else this.setAriaDescriptionProperty("filterButton",null)}refreshAriaFiltered(){const e=this.localeService.getLocaleTextFunc();this.column.isFilterActive()?this.setAriaDescriptionProperty("filter",e("ariaColumnFiltered","Column Filtered")):this.setAriaDescriptionProperty("filter",null)}setAriaDescriptionProperty(e,t){null!=t?this.ariaDescriptionProperties.set(e,t):this.ariaDescriptionProperties.delete(e)}announceAriaDescription(){if(!this.eGui.contains(this.beans.gos.getActiveDomElement()))return;const e=Array.from(this.ariaDescriptionProperties.keys()).sort((e,t)=>"filter"===e?-1:t.charCodeAt(0)-e.charCodeAt(0)).map(e=>this.ariaDescriptionProperties.get(e)).join(". ");this.beans.ariaAnnouncementService.announceValue(e)}refreshAria(){this.refreshAriaSort(),this.refreshAriaMenu(),this.refreshAriaFilterButton(),this.refreshAriaFiltered()}addColumnHoverListener(){const e=()=>{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,ct.EVENT_COLUMN_HOVER_CHANGED,e),e()}getColId(){return this.column.getColId()}addActiveHeaderMouseListeners(){const e=e=>this.handleMouseOverChange("mouseenter"===e.type);this.addManagedListener(this.getGui(),"mouseenter",e),this.addManagedListener(this.getGui(),"mouseleave",e),this.addManagedListener(this.getGui(),"click",()=>this.dispatchColumnMouseEvent(ct.EVENT_COLUMN_HEADER_CLICKED,this.column)),this.addManagedListener(this.getGui(),"contextmenu",e=>this.handleContextMenuMouseEvent(e,void 0,this.column))}handleMouseOverChange(e){this.setActiveHeader(e);const t={type:e?ct.EVENT_COLUMN_HEADER_MOUSE_OVER:ct.EVENT_COLUMN_HEADER_MOUSE_LEAVE,column:this.column};this.eventService.dispatchEvent(t)}setActiveHeader(e){this.comp.addOrRemoveCssClass("ag-header-active",e)}getAnchorElementForMenu(e){const t=this.comp.getUserCompInstance();return t instanceof wr?t.getAnchorElementForMenu(e):this.getGui()}destroy(){super.destroy(),this.refreshFunctions=null,this.selectAllFeature=null,this.dragSourceElement=null,this.userCompDetails=null,this.userHeaderClasses=null,this.ariaDescriptionProperties=null}},al=class extends st{constructor(e,t,i,n){super(),this.eResize=t,this.comp=e,this.pinned=i,this.columnGroup=n}postConstruct(){if(!this.columnGroup.isResizable())return void this.comp.setResizableDisplayed(!1);const e=this.horizontalResizeService.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(this.addDestroyFunc(e),!this.gos.get("suppressAutoSize")){const e=this.gos.get("skipHeaderOnAutoSize");this.eResize.addEventListener("dblclick",()=>{const t=[];this.columnGroup.getDisplayedLeafColumns().forEach(e=>{e.getColDef().suppressAutoSize||t.push(e.getColId())}),t.length>0&&this.columnModel.autoSizeColumns({columns:t,skipHeader:e,stopAtGroup:this.columnGroup,source:"uiColumnResized"}),this.resizeLeafColumnsToFit("uiColumnResized")})}}onResizeStart(e){const t=this.getInitialValues(e);this.storeLocalValues(t),this.toggleColumnResizing(!0)}onResizing(e,t,i="uiColumnResized"){const n=this.normaliseDragChange(t),s=this.resizeStartWidth+n;this.resizeColumnsFromLocalValues(s,i,e)}getInitialValues(e){const t=this.getColumnsToResize(),i=this.getInitialSizeOfColumns(t),n={columnsToResize:t,resizeStartWidth:i,resizeRatios:this.getSizeRatiosOfColumns(t,i)};let s=null;if(e&&(s=this.columnModel.getDisplayedGroupAtDirection(this.columnGroup,"After")),s){const e=s.getDisplayedLeafColumns(),t=n.groupAfterColumns=e.filter(e=>e.isResizable()),i=n.groupAfterStartWidth=this.getInitialSizeOfColumns(t);n.groupAfterRatios=this.getSizeRatiosOfColumns(t,i)}else n.groupAfterColumns=void 0,n.groupAfterStartWidth=void 0,n.groupAfterRatios=void 0;return n}storeLocalValues(e){const{columnsToResize:t,resizeStartWidth:i,resizeRatios:n,groupAfterColumns:s,groupAfterStartWidth:r,groupAfterRatios:o}=e;this.resizeCols=t,this.resizeStartWidth=i,this.resizeRatios=n,this.resizeTakeFromCols=s,this.resizeTakeFromStartWidth=r,this.resizeTakeFromRatios=o}clearLocalValues(){this.resizeCols=void 0,this.resizeRatios=void 0,this.resizeTakeFromCols=void 0,this.resizeTakeFromRatios=void 0}resizeLeafColumnsToFit(e){const t=this.autoWidthCalculator.getPreferredWidthForColumnGroup(this.columnGroup),i=this.getInitialValues();t>i.resizeStartWidth&&this.resizeColumns(i,t,e,!0)}resizeColumnsFromLocalValues(e,t,i=!0){var n,s,r;if(!this.resizeCols||!this.resizeRatios)return;const o={columnsToResize:this.resizeCols,resizeStartWidth:this.resizeStartWidth,resizeRatios:this.resizeRatios,groupAfterColumns:null!=(n=this.resizeTakeFromCols)?n:void 0,groupAfterStartWidth:null!=(s=this.resizeTakeFromStartWidth)?s:void 0,groupAfterRatios:null!=(r=this.resizeTakeFromRatios)?r:void 0};this.resizeColumns(o,e,t,i)}resizeColumns(e,t,i,n=!0){const{columnsToResize:s,resizeStartWidth:r,resizeRatios:o,groupAfterColumns:a,groupAfterStartWidth:l,groupAfterRatios:c}=e,h=[];if(h.push({columns:s,ratios:o,width:t}),a){const e=t-r;h.push({columns:a,ratios:c,width:l-e})}this.columnModel.resizeColumnSets({resizeSets:h,finished:n,source:i}),n&&this.toggleColumnResizing(!1)}toggleColumnResizing(e){this.comp.addOrRemoveCssClass("ag-column-resizing",e)}getColumnsToResize(){return this.columnGroup.getDisplayedLeafColumns().filter(e=>e.isResizable())}getInitialSizeOfColumns(e){return e.reduce((e,t)=>e+t.getActualWidth(),0)}getSizeRatiosOfColumns(e,t){return e.map(e=>e.getActualWidth()/t)}normaliseDragChange(e){let t=e;return this.gos.get("enableRtl")?"left"!==this.pinned&&(t*=-1):"right"===this.pinned&&(t*=-1),t}destroy(){super.destroy(),this.clearLocalValues()}};g([ue("horizontalResizeService")],al.prototype,"horizontalResizeService",2),g([ue("autoWidthCalculator")],al.prototype,"autoWidthCalculator",2),g([ue("columnModel")],al.prototype,"columnModel",2),g([le],al.prototype,"postConstruct",1);var ll=class extends st{constructor(e,t){super(),this.removeChildListenersFuncs=[],this.columnGroup=t,this.comp=e}postConstruct(){this.addListenersToChildrenColumns(),this.addManagedListener(this.columnGroup,lt.EVENT_DISPLAYED_CHILDREN_CHANGED,this.onDisplayedChildrenChanged.bind(this)),this.onWidthChanged(),this.addDestroyFunc(this.removeListenersOnChildrenColumns.bind(this))}addListenersToChildrenColumns(){this.removeListenersOnChildrenColumns();const e=this.onWidthChanged.bind(this);this.columnGroup.getLeafColumns().forEach(t=>{t.addEventListener("widthChanged",e),t.addEventListener("visibleChanged",e),this.removeChildListenersFuncs.push(()=>{t.removeEventListener("widthChanged",e),t.removeEventListener("visibleChanged",e)})})}removeListenersOnChildrenColumns(){this.removeChildListenersFuncs.forEach(e=>e()),this.removeChildListenersFuncs=[]}onDisplayedChildrenChanged(){this.addListenersToChildrenColumns(),this.onWidthChanged()}onWidthChanged(){const e=this.columnGroup.getActualWidth();this.comp.setWidth(`${e}px`),this.comp.addOrRemoveCssClass("ag-hidden",0===e)}};g([le],ll.prototype,"postConstruct",1);var cl=class extends el{constructor(e,t,i){super(e,t,i),this.onSuppressColMoveChange=()=>{if(!this.isAlive()||this.isSuppressMoving())this.removeDragSource();else if(!this.dragSource){const e=this.getGui();this.setDragSource(e)}},this.column=e}setComp(e,t,i){this.comp=e,this.setGui(t),this.displayName=this.beans.columnModel.getDisplayNameForColumnGroup(this.column,"header"),this.addClasses(),this.setupMovingCss(),this.setupExpandable(),this.setupTooltip(),this.addDestroyFunc(()=>{this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature))}),this.setupUserComp(),this.addHeaderMouseListeners();const n=this.getParentRowCtrl().getPinned(),s=this.column.getProvidedColumnGroup().getLeafColumns();this.createManagedBean(new il(s,t)),this.createManagedBean(new tl(this.column,t,this.beans)),this.createManagedBean(new ll(e,this.column)),this.resizeFeature=this.createManagedBean(new al(e,i,n,this.column)),this.createManagedBean(new Is(t,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:()=>{},handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)})),this.addManagedPropertyListener(ct.EVENT_SUPPRESS_COLUMN_MOVE_CHANGED,this.onSuppressColMoveChange),this.addResizeAndMoveKeyboardListeners()}resizeHeader(e,t){if(!this.resizeFeature)return;const i=this.resizeFeature.getInitialValues(t);this.resizeFeature.resizeColumns(i,i.resizeStartWidth+e,"uiColumnResized",!0)}moveHeader(e){const{beans:t,eGui:i,column:n,gos:s,ctrlsService:r}=this,o=s.get("enableRtl"),a=0===e,l=this.getPinned(),c=i.getBoundingClientRect(),h=c.left,u=c.width,d=za.normaliseX(a!==o?h-20:h+u+20,l,!0,s,r),p=n.getGroupId(),g=this.focusService.getFocusedHeader();za.attemptMoveColumns({allMovingColumns:this.column.getLeafColumns(),isFromHeader:!0,hDirection:e,xPosition:d,pinned:l,fromEnter:!1,fakeEvent:!1,gos:s,columnModel:t.columnModel});const f=n.getDisplayedLeafColumns(),m=a?f[0]:Ie(f);this.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(m,"auto"),!this.isAlive()&&g&&this.restoreFocus(p,n,g)}restoreFocus(e,t,i){const n=t.getLeafColumns();if(!n.length)return;const s=n[0].getParent();if(!s)return;const r=this.findGroupWidthId(s,e);r&&this.focusService.focusHeaderPosition({headerPosition:d(u({},i),{column:r})})}findGroupWidthId(e,t){for(;e;){if(e.getGroupId()===t)return e;e=e.getParent()}return null}resizeLeafColumnsToFit(e){this.resizeFeature&&this.resizeFeature.resizeLeafColumnsToFit(e)}setupUserComp(){const e=this.gos.addGridCommonParams({displayName:this.displayName,columnGroup:this.column,setExpanded:e=>{this.beans.columnModel.setColumnGroupOpened(this.column.getProvidedColumnGroup(),e,"gridInitializing")},setTooltip:(e,t)=>{this.setupTooltip(e,t)}}),t=this.userComponentFactory.getHeaderGroupCompDetails(e);this.comp.setUserCompDetails(t)}addHeaderMouseListeners(){const e=e=>this.handleMouseOverChange("mouseenter"===e.type);this.addManagedListener(this.getGui(),"mouseenter",e),this.addManagedListener(this.getGui(),"mouseleave",e),this.addManagedListener(this.getGui(),"click",()=>this.dispatchColumnMouseEvent(ct.EVENT_COLUMN_HEADER_CLICKED,this.column.getProvidedColumnGroup())),this.addManagedListener(this.getGui(),"contextmenu",e=>this.handleContextMenuMouseEvent(e,void 0,this.column.getProvidedColumnGroup()))}handleMouseOverChange(e){const t={type:e?ct.EVENT_COLUMN_HEADER_MOUSE_OVER:ct.EVENT_COLUMN_HEADER_MOUSE_LEAVE,column:this.column.getProvidedColumnGroup()};this.eventService.dispatchEvent(t)}setupTooltip(e,t){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature));const i=this.column.getColGroupDef(),n="whenTruncated"===this.gos.get("tooltipShowMode"),s=this.eGui;t||!n||(null==i?void 0:i.headerGroupComponent)||(t=()=>{const e=s.querySelector(".ag-header-group-text");return!e||e.scrollWidth>e.clientWidth});const r={getColumn:()=>this.column,getGui:()=>s,getLocation:()=>"headerGroup",getTooltipValue:()=>null!=e?e:i&&i.headerTooltip,shouldDisplayTooltip:t};i&&(r.getColDef=()=>i),this.createBean(new ys(r))}setupExpandable(){const e=this.column.getProvidedColumnGroup();this.refreshExpanded(),this.addManagedListener(e,Ee.EVENT_EXPANDABLE_CHANGED,this.refreshExpanded.bind(this)),this.addManagedListener(e,Ee.EVENT_EXPANDED_CHANGED,this.refreshExpanded.bind(this))}refreshExpanded(){const e=this.column;this.expandable=e.isExpandable();const t=e.isExpanded();this.expandable?this.comp.setAriaExpanded(t?"true":"false"):this.comp.setAriaExpanded(void 0)}getColId(){return this.column.getUniqueId()}addClasses(){const e=this.column.getColGroupDef(),t=da.getHeaderClassesFromColDef(e,this.gos,null,this.column);this.column.isPadding()?(t.push("ag-header-group-cell-no-group"),this.column.getLeafColumns().every(e=>e.isSpanHeaderHeight())&&t.push("ag-header-span-height")):t.push("ag-header-group-cell-with-group"),t.forEach(e=>this.comp.addOrRemoveCssClass(e,!0))}setupMovingCss(){const e=this.column.getProvidedColumnGroup().getLeafColumns(),t=()=>this.comp.addOrRemoveCssClass("ag-header-cell-moving",this.column.isMoving());e.forEach(e=>{this.addManagedListener(e,Se.EVENT_MOVING_CHANGED,t)}),t()}onFocusIn(e){if(!this.eGui.contains(e.relatedTarget)){const e=this.getRowIndex();this.beans.focusService.setFocusedHeader(e,this.column)}}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();if(this.expandable&&t&&e.key===Zn.ENTER){const e=this.column,t=!e.isExpanded();this.beans.columnModel.setColumnGroupOpened(e.getProvidedColumnGroup(),t,"uiColumnExpanded")}}setDragSource(e){if(!this.isAlive()||this.isSuppressMoving())return;if(this.removeDragSource(),!e)return;const{beans:t,column:i,displayName:n,gos:s,dragAndDropService:r}=this,{columnModel:o}=t,a=i.getProvidedColumnGroup().getLeafColumns();let l=!s.get("suppressDragLeaveHidesColumns");const c=this.dragSource={type:1,eElement:e,getDefaultIconName:()=>l?Br.ICON_HIDE:Br.ICON_NOT_ALLOWED,dragItemName:n,getDragItem:()=>this.getDragItemForGroup(i),onDragStarted:()=>{l=!s.get("suppressDragLeaveHidesColumns"),a.forEach(e=>e.setMoving(!0,"uiColumnDragged"))},onDragStopped:()=>a.forEach(e=>e.setMoving(!1,"uiColumnDragged")),onGridEnter:e=>{var t;if(l){const i=(null==(t=null==e?void 0:e.columns)?void 0:t.filter(e=>!e.getColDef().lockVisible))||[];o.setColumnsVisible(i,!0,"uiColumnMoved")}},onGridExit:e=>{var t;if(l){const i=(null==(t=null==e?void 0:e.columns)?void 0:t.filter(e=>!e.getColDef().lockVisible))||[];o.setColumnsVisible(i,!1,"uiColumnMoved")}}};r.addDragSource(c,!0)}getDragItemForGroup(e){const t=e.getProvidedColumnGroup().getLeafColumns(),i={};t.forEach(e=>i[e.getId()]=e.isVisible());const n=[];return this.beans.columnModel.getAllDisplayedColumns().forEach(e=>{t.indexOf(e)>=0&&(n.push(e),Ne(t,e))}),t.forEach(e=>n.push(e)),{columns:n,visibleState:i}}isSuppressMoving(){let e=!1;return this.column.getLeafColumns().forEach(t=>{(t.getColDef().suppressMovable||t.getColDef().lockPosition)&&(e=!0)}),e||this.gos.get("suppressMovableColumns")}},hl=0,ul=class extends st{constructor(e,t,i){super(),this.instanceId=hl++,this.rowIndex=e,this.pinned=t,this.type=i;const n="group"==i?"ag-header-row-column-group":"filter"==i?"ag-header-row-column-filter":"ag-header-row-column";this.headerRowClass=`ag-header-row ${n}`}postConstruct(){this.isPrintLayout=this.gos.isDomLayout("print"),this.isEnsureDomOrder=this.gos.get("ensureDomOrder")}getInstanceId(){return this.instanceId}setComp(e,t=!0){this.comp=e,t&&(this.onRowHeightChanged(),this.onVirtualColumnsChanged()),this.setWidth(),this.addEventListeners()}getHeaderRowClass(){return this.headerRowClass}getAriaRowIndex(){return this.rowIndex+1}addEventListeners(){this.addManagedListener(this.eventService,ct.EVENT_COLUMN_RESIZED,this.onColumnResized.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_VIRTUAL_COLUMNS_CHANGED,e=>this.onVirtualColumnsChanged(e.afterScroll)),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,this.onRowHeightChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_GRID_STYLES_CHANGED,this.onRowHeightChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("domLayout",this.onDisplayedColumnsChanged.bind(this)),this.addManagedPropertyListener("ensureDomOrder",e=>this.isEnsureDomOrder=e.currentValue),this.addManagedPropertyListener("headerHeight",this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("pivotHeaderHeight",this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("groupHeaderHeight",this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("pivotGroupHeaderHeight",this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("floatingFiltersHeight",this.onRowHeightChanged.bind(this))}getHeaderCellCtrl(e){if(this.headerCellCtrls)return D(this.headerCellCtrls).find(t=>t.getColumnGroupChild()===e)}onDisplayedColumnsChanged(){this.isPrintLayout=this.gos.isDomLayout("print"),this.onVirtualColumnsChanged(),this.setWidth(),this.onRowHeightChanged()}getType(){return this.type}onColumnResized(){this.setWidth()}setWidth(){const e=this.getWidthForRow();this.comp.setWidth(`${e}px`)}getWidthForRow(){const{columnModel:e}=this.beans;return this.isPrintLayout?null!=this.pinned?0:e.getContainerWidth("right")+e.getContainerWidth("left")+e.getContainerWidth(null):e.getContainerWidth(this.pinned)}onRowHeightChanged(){var{topOffset:e,rowHeight:t}=this.getTopAndHeight();this.comp.setTop(e+"px"),this.comp.setHeight(t+"px")}getTopAndHeight(){const{columnModel:e,filterManager:t}=this.beans;let i=e.getHeaderRowCount();const n=[];let s=0;t.hasFloatingFilters()&&(i++,s=1);const r=e.getColumnGroupHeaderRowHeight(),o=e.getColumnHeaderRowHeight(),a=i-(1+s);for(let e=0;e<a;e++)n.push(r);n.push(o);for(let t=0;t<s;t++)n.push(e.getFloatingFiltersHeight());let l=0;for(let e=0;e<this.rowIndex;e++)l+=n[e];return{topOffset:l,rowHeight:n[this.rowIndex]}}getPinned(){return this.pinned}getRowIndex(){return this.rowIndex}onVirtualColumnsChanged(e=!1){const t=this.getHeaderCtrls(),i=this.isEnsureDomOrder||this.isPrintLayout;this.comp.setHeaderCtrls(t,i,e)}getHeaderCtrls(){const e=this.headerCellCtrls;this.headerCellCtrls=new Map;const t=this.getColumnsInViewport();for(const i of t)this.recycleAndCreateHeaderCtrls(i,e);const i=e=>{const{focusService:t,columnModel:i}=this.beans;return!!t.isHeaderWrapperFocused(e)&&i.isDisplayed(e.getColumnGroupChild())};if(e)for(const[t,n]of e)i(n)?this.headerCellCtrls.set(t,n):this.destroyBean(n);return Array.from(this.headerCellCtrls.values())}recycleAndCreateHeaderCtrls(e,t){if(!this.headerCellCtrls)return;if(e.isEmptyGroup())return;const i=e.getUniqueId();let n;if(t&&(n=t.get(i),t.delete(i)),n&&n.getColumnGroupChild()!=e&&(this.destroyBean(n),n=void 0),null==n)switch(this.type){case"filter":n=this.createBean(new nl(e,this.beans,this));break;case"group":n=this.createBean(new cl(e,this.beans,this));break;default:n=this.createBean(new ol(e,this.beans,this))}this.headerCellCtrls.set(i,n)}getColumnsInViewport(){return this.isPrintLayout?this.getColumnsInViewportPrintLayout():this.getColumnsInViewportNormalLayout()}getColumnsInViewportPrintLayout(){if(null!=this.pinned)return[];let e=[];const t=this.getActualDepth(),{columnModel:i}=this.beans;return["left",null,"right"].forEach(n=>{const s=i.getVirtualHeaderGroupRow(n,t);e=e.concat(s)}),e}getActualDepth(){return"filter"==this.type?this.rowIndex-1:this.rowIndex}getColumnsInViewportNormalLayout(){return this.beans.columnModel.getVirtualHeaderGroupRow(this.pinned,this.getActualDepth())}focusHeader(e,t){if(!this.headerCellCtrls)return!1;const i=Array.from(this.headerCellCtrls.values()).find(t=>t.getColumnGroupChild()==e);return!!i&&i.focus(t)}destroy(){this.headerCellCtrls&&this.headerCellCtrls.forEach(e=>{this.destroyBean(e)}),this.headerCellCtrls=void 0,super.destroy()}};g([ue("beans")],ul.prototype,"beans",2),g([le],ul.prototype,"postConstruct",1);var dl=class extends st{constructor(e){super(),this.hidden=!1,this.includeFloatingFilter=!1,this.groupsRowCtrls=[],this.pinned=e}setComp(e,t){this.comp=e,this.eViewport=t,this.setupCenterWidth(),this.setupPinnedWidth(),this.setupDragAndDrop(this.eViewport),this.addManagedListener(this.eventService,ct.EVENT_GRID_COLUMNS_CHANGED,this.onGridColumnsChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.ctrlsService.registerHeaderContainer(this,this.pinned),this.columnModel.isReady()&&this.refresh()}setupDragAndDrop(e){const t=new ja(this.pinned,e);this.createManagedBean(t)}refresh(e=!1){const t=new hs,i=this.focusService.getFocusHeaderToUseAfterRefresh();(()=>{const e=this.columnModel.getHeaderRowCount()-1;this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls);for(let i=0;i<e;i++){const e=this.createBean(new ul(t.next(),this.pinned,"group"));this.groupsRowCtrls.push(e)}})(),(()=>{const i=t.next(),n=!(this.hidden||null!=this.columnsRowCtrl&&e&&this.columnsRowCtrl.getRowIndex()===i);(n||this.hidden)&&(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl)),n&&(this.columnsRowCtrl=this.createBean(new ul(i,this.pinned,"column")))})(),(()=>{this.includeFloatingFilter=this.filterManager.hasFloatingFilters()&&!this.hidden;const i=()=>{this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)};if(!this.includeFloatingFilter)return void i();const n=t.next();if(this.filtersRowCtrl){const t=this.filtersRowCtrl.getRowIndex()!==n;e&&!t||i()}this.filtersRowCtrl||(this.filtersRowCtrl=this.createBean(new ul(n,this.pinned,"filter")))})();const n=this.getAllCtrls();this.comp.setCtrls(n),this.restoreFocusOnHeader(i)}restoreFocusOnHeader(e){null!=e&&e.column.getPinned()==this.pinned&&this.focusService.focusHeaderPosition({headerPosition:e})}getAllCtrls(){const e=[...this.groupsRowCtrls];return this.columnsRowCtrl&&e.push(this.columnsRowCtrl),this.filtersRowCtrl&&e.push(this.filtersRowCtrl),e}onGridColumnsChanged(){this.refresh(!0)}onDisplayedColumnsChanged(){const e=this.filterManager.hasFloatingFilters()&&!this.hidden;this.includeFloatingFilter!==e&&this.refresh(!0)}setupCenterWidth(){null==this.pinned&&this.createManagedBean(new Aa(e=>this.comp.setCenterWidth(`${e}px`),!0))}setHorizontalScroll(e){this.comp.setViewportScrollLeft(e)}setupPinnedWidth(){if(null==this.pinned)return;const e="left"===this.pinned,t="right"===this.pinned;this.hidden=!0;const i=()=>{const i=e?this.pinnedWidthService.getPinnedLeftWidth():this.pinnedWidthService.getPinnedRightWidth();if(null==i)return;const n=0==i,s=this.hidden!==n,r=this.gos.get("enableRtl"),o=this.gos.getScrollbarWidth(),a=this.scrollVisibleService.isVerticalScrollShowing()&&(r&&e||!r&&t)?i+o:i;this.comp.setPinnedContainerWidth(`${a}px`),this.comp.setDisplayed(!n),s&&(this.hidden=n,this.refresh())};this.addManagedListener(this.eventService,ct.EVENT_LEFT_PINNED_WIDTH_CHANGED,i),this.addManagedListener(this.eventService,ct.EVENT_RIGHT_PINNED_WIDTH_CHANGED,i),this.addManagedListener(this.eventService,ct.EVENT_SCROLL_VISIBILITY_CHANGED,i),this.addManagedListener(this.eventService,ct.EVENT_SCROLLBAR_WIDTH_CHANGED,i)}getHeaderCtrlForColumn(e){if(e instanceof Se){if(!this.columnsRowCtrl)return;return this.columnsRowCtrl.getHeaderCellCtrl(e)}if(0!==this.groupsRowCtrls.length)for(let t=0;t<this.groupsRowCtrls.length;t++){const i=this.groupsRowCtrls[t].getHeaderCellCtrl(e);if(i)return i}}getHtmlElementForColumnHeader(e){const t=this.getHeaderCtrlForColumn(e);return t?t.getGui():null}getRowType(e){const t=this.getAllCtrls()[e];return t?t.getType():void 0}focusHeader(e,t,i){const n=this.getAllCtrls()[e];return!!n&&n.focusHeader(t,i)}getViewport(){return this.eViewport}getRowCount(){return this.groupsRowCtrls.length+(this.columnsRowCtrl?1:0)+(this.filtersRowCtrl?1:0)}destroy(){this.filtersRowCtrl&&(this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)),this.columnsRowCtrl&&(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl)),this.groupsRowCtrls&&this.groupsRowCtrls.length&&(this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls)),super.destroy()}};g([ue("ctrlsService")],dl.prototype,"ctrlsService",2),g([ue("scrollVisibleService")],dl.prototype,"scrollVisibleService",2),g([ue("pinnedWidthService")],dl.prototype,"pinnedWidthService",2),g([ue("columnModel")],dl.prototype,"columnModel",2),g([ue("focusService")],dl.prototype,"focusService",2),g([ue("filterManager")],dl.prototype,"filterManager",2);var pl=class e extends Cs{constructor(e){super(),this.headerRowComps={},this.rowCompsList=[],this.pinned=e}init(){this.selectAndSetTemplate();const e={setDisplayed:e=>this.setDisplayed(e),setCtrls:e=>this.setCtrls(e),setCenterWidth:e=>this.eCenterContainer.style.width=e,setViewportScrollLeft:e=>this.getGui().scrollLeft=e,setPinnedContainerWidth:e=>{const t=this.getGui();t.style.width=e,t.style.maxWidth=e,t.style.minWidth=e}};this.createManagedBean(new dl(this.pinned)).setComp(e,this.getGui())}selectAndSetTemplate(){const t="left"==this.pinned,i="right"==this.pinned,n=t?e.PINNED_LEFT_TEMPLATE:i?e.PINNED_RIGHT_TEMPLATE:e.CENTER_TEMPLATE;this.setTemplate(n),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;let i;this.headerRowComps={},this.rowCompsList=[];const n=e=>{const t=e.getGui();t.parentElement!=this.eRowContainer&&this.eRowContainer.appendChild(t),i&&An(this.eRowContainer,t,i),i=t};e.forEach(e=>{const i=e.getInstanceId(),s=t[i];delete t[i];const r=s||this.createBean(new Za(e));this.headerRowComps[i]=r,this.rowCompsList.push(r),n(r)}),N(t).forEach(e=>this.destroyRowComp(e))}};pl.PINNED_LEFT_TEMPLATE='<div class="ag-pinned-left-header" role="rowgroup"></div>',pl.PINNED_RIGHT_TEMPLATE='<div class="ag-pinned-right-header" role="rowgroup"></div>',pl.CENTER_TEMPLATE='<div class="ag-header-viewport" role="presentation">\n            <div class="ag-header-container" ref="eCenterContainer" role="rowgroup"></div>\n        </div>',g([Ss("eCenterContainer")],pl.prototype,"eCenterContainer",2),g([le],pl.prototype,"init",1),g([ce],pl.prototype,"destroyRowComps",1);var gl=pl,fl=(e=>(e[e.UP=0]="UP",e[e.DOWN=1]="DOWN",e[e.LEFT=2]="LEFT",e[e.RIGHT=3]="RIGHT",e))(fl||{}),ml=class extends st{constructor(){super(...arguments),this.currentHeaderRowWithoutSpan=-1}postConstruct(){this.ctrlsService.whenReady(e=>{this.gridBodyCon=e.gridBodyCtrl});const e=this.gos.getDocument();this.addManagedListener(e,"mousedown",()=>this.setCurrentHeaderRowWithoutSpan(-1))}getHeaderRowCount(){const e=this.ctrlsService.getHeaderRowContainerCtrl();return e?e.getRowCount():0}navigateVertically(e,t,i){if(t||(t=this.focusService.getFocusedHeader()),!t)return!1;const{headerRowIndex:n,column:s}=t,r=this.getHeaderRowCount(),o=0===e;let{headerRowIndex:a,column:l,headerRowIndexWithoutSpan:c}=o?this.headerPositionUtils.getColumnVisibleParent(s,n):this.headerPositionUtils.getColumnVisibleChild(s,n),h=!1;return a<0&&(a=0,l=s,h=!0),a>=r?(a=-1,this.setCurrentHeaderRowWithoutSpan(-1)):void 0!==c&&(this.currentHeaderRowWithoutSpan=c),!(!h&&!l)&&this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:a,column:l},allowUserOverride:!0,event:i})}setCurrentHeaderRowWithoutSpan(e){this.currentHeaderRowWithoutSpan=e}navigateHorizontally(e,t=!1,i){const n=this.focusService.getFocusedHeader(),s=2===e,r=this.gos.get("enableRtl");let o,a;if(-1!==this.currentHeaderRowWithoutSpan?n.headerRowIndex=this.currentHeaderRowWithoutSpan:this.currentHeaderRowWithoutSpan=n.headerRowIndex,s!==r?(a="Before",o=this.headerPositionUtils.findHeader(n,a)):(a="After",o=this.headerPositionUtils.findHeader(n,a)),o||!t)return this.focusService.focusHeaderPosition({headerPosition:o,direction:a,fromTab:t,allowUserOverride:!0,event:i});if(t){const e=this.gos.getCallback("tabToNextHeader");if(e)return this.focusService.focusHeaderPositionFromUserFunc({userFunc:e,headerPosition:o,direction:a})}return this.focusNextHeaderRow(n,a,i)}focusNextHeaderRow(e,t,i){const n=e.headerRowIndex;let s,r=null;if("Before"===t?n>0&&(s=n-1,this.currentHeaderRowWithoutSpan-=1,r=this.headerPositionUtils.findColAtEdgeForHeaderRow(s,"end")):(s=n+1,this.currentHeaderRowWithoutSpan<this.getHeaderRowCount()?this.currentHeaderRowWithoutSpan+=1:this.setCurrentHeaderRowWithoutSpan(-1),r=this.headerPositionUtils.findColAtEdgeForHeaderRow(s,"start")),!r)return!1;const{column:o,headerRowIndex:a}=this.headerPositionUtils.getHeaderIndexToFocus(r.column,null==r?void 0:r.headerRowIndex);return this.focusService.focusHeaderPosition({headerPosition:{column:o,headerRowIndex:a},direction:t,fromTab:!0,allowUserOverride:!0,event:i})}scrollToColumn(e,t="After"){if(e.getPinned())return;let i;if(e instanceof lt){const n=e.getDisplayedLeafColumns();i="Before"===t?Ie(n):n[0]}else i=e;this.gridBodyCon.getScrollFeature().ensureColumnVisible(i)}};g([ue("focusService")],ml.prototype,"focusService",2),g([ue("headerPositionUtils")],ml.prototype,"headerPositionUtils",2),g([ue("ctrlsService")],ml.prototype,"ctrlsService",2),g([le],ml.prototype,"postConstruct",1),ml=g([he("headerNavigationService")],ml);var yl=class extends st{setComp(e,t,i){this.comp=e,this.eGui=t,this.createManagedBean(new Is(i,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.onPivotModeChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.onPivotModeChanged(),this.setupHeaderHeight();const n=this.onHeaderContextMenu.bind(this);this.addManagedListener(this.eGui,"contextmenu",n),this.mockContextMenuForIPad(n),this.ctrlsService.register("gridHeaderCtrl",this)}setupHeaderHeight(){const e=this.setHeaderHeight.bind(this);e(),this.addManagedPropertyListener("headerHeight",e),this.addManagedPropertyListener("pivotHeaderHeight",e),this.addManagedPropertyListener("groupHeaderHeight",e),this.addManagedPropertyListener("pivotGroupHeaderHeight",e),this.addManagedPropertyListener("floatingFiltersHeight",e),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_GRID_STYLES_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,e)}getHeaderHeight(){return this.headerHeight}setHeaderHeight(){const{columnModel:e}=this;let t,i=0,n=e.getHeaderRowCount();this.filterManager.hasFloatingFilters()&&(n++,i=1);const s=this.columnModel.getColumnGroupHeaderRowHeight(),r=this.columnModel.getColumnHeaderRowHeight(),o=n-(1+i);if(t=i*e.getFloatingFiltersHeight(),t+=o*s,t+=r,this.headerHeight===t)return;this.headerHeight=t;const a=`${t+1}px`;this.comp.setHeightAndMinHeight(a),this.eventService.dispatchEvent({type:ct.EVENT_HEADER_HEIGHT_CHANGED})}onPivotModeChanged(){const e=this.columnModel.isPivotMode();this.comp.addOrRemoveCssClass("ag-pivot-on",e),this.comp.addOrRemoveCssClass("ag-pivot-off",!e)}onDisplayedColumnsChanged(){const e=this.columnModel.getAllDisplayedColumns().some(e=>e.isSpanHeaderHeight());this.comp.addOrRemoveCssClass("ag-header-allow-overflow",e)}onTabKeyDown(e){const t=this.gos.get("enableRtl"),i=e.shiftKey!==t?2:3;(this.headerNavigationService.navigateHorizontally(i,!0,e)||this.focusService.focusNextGridCoreContainer(e.shiftKey))&&e.preventDefault()}handleKeyDown(e){let t=null;switch(e.key){case Zn.LEFT:t=2;case Zn.RIGHT:b(t)||(t=3),this.headerNavigationService.navigateHorizontally(t,!1,e);break;case Zn.UP:t=0;case Zn.DOWN:b(t)||(t=1),this.headerNavigationService.navigateVertically(t,null,e)&&e.preventDefault();break;default:return}}onFocusOut(e){const{relatedTarget:t}=e;!t&&this.eGui.contains(this.gos.getActiveDomElement())||this.eGui.contains(t)||this.focusService.clearFocusedHeader()}onHeaderContextMenu(e,t,i){if(!e&&!i||!this.menuService.isHeaderContextMenuEnabled())return;const{target:n}=null!=e?e:t;n!==this.eGui&&n!==this.ctrlsService.getHeaderRowContainerCtrl().getViewport()||this.menuService.showHeaderContextMenu(void 0,e,i)}mockContextMenuForIPad(e){if(!Pi())return;const t=new yr(this.eGui);this.addManagedListener(t,yr.EVENT_LONG_TAP,t=>{e(void 0,t.touchStart,t.touchEvent)}),this.addDestroyFunc(()=>t.destroy())}};g([ue("headerNavigationService")],yl.prototype,"headerNavigationService",2),g([ue("focusService")],yl.prototype,"focusService",2),g([ue("columnModel")],yl.prototype,"columnModel",2),g([ue("ctrlsService")],yl.prototype,"ctrlsService",2),g([ue("filterManager")],yl.prototype,"filterManager",2),g([ue("menuService")],yl.prototype,"menuService",2);var vl=class e extends Cs{constructor(){super(e.TEMPLATE)}postConstruct(){const e={addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setHeightAndMinHeight:e=>{this.getGui().style.height=e,this.getGui().style.minHeight=e}};this.createManagedBean(new yl).setComp(e,this.getGui(),this.getFocusableElement());const t=e=>{this.createManagedBean(e),this.appendChild(e)};t(new gl("left")),t(new gl(null)),t(new gl("right"))}};vl.TEMPLATE='<div class="ag-header" role="presentation"/>',g([le],vl.prototype,"postConstruct",1);var bl=vl,Cl=class extends st{addResizeBar(e){const t={dragStartPixels:e.dragStartPixels||0,eElement:e.eResizeBar,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this,e),onDragging:this.onDragging.bind(this,e),includeTouch:!0,stopPropagationForTouch:!0};return this.dragService.addDragSource(t),()=>this.dragService.removeDragSource(t)}onDragStart(e,t){this.dragStartX=t.clientX,this.setResizeIcons();const i=t instanceof MouseEvent&&!0===t.shiftKey;e.onResizeStart(i)}setResizeIcons(){const e=this.ctrlsService.get("gridCtrl");e.setResizeCursor(!0),e.disableUserSelect(!0)}onDragStop(e,t){e.onResizeEnd(this.resizeAmount),this.resetIcons()}resetIcons(){const e=this.ctrlsService.get("gridCtrl");e.setResizeCursor(!1),e.disableUserSelect(!1)}onDragging(e,t){this.resizeAmount=t.clientX-this.dragStartX,e.onResizing(this.resizeAmount)}};g([ue("dragService")],Cl.prototype,"dragService",2),g([ue("ctrlsService")],Cl.prototype,"ctrlsService",2),Cl=g([he("horizontalResizeService")],Cl);var wl=class extends st{hideActiveMenu(){this.hidePopup&&this.hidePopup()}showMenuAfterMouseEvent(e,t,i){this.showPopup(e,n=>{this.popupService.positionPopupUnderMouseEvent({column:e,type:i,mouseEvent:t,ePopup:n})},i,t.target,this.menuService.isLegacyMenuEnabled())}showMenuAfterButtonClick(e,t,i){let n=-1,s="left";const r=this.menuService.isLegacyMenuEnabled();!r&&this.gos.get("enableRtl")&&(n=1,s="right");let o=r?void 0:4*n,a=r?void 0:4;this.showPopup(e,n=>{this.popupService.positionPopupByComponent({type:i,eventSource:t,ePopup:n,nudgeX:o,nudgeY:a,alignSide:s,keepWithinBounds:!0,position:"under",column:e})},i,t,r)}showPopup(e,t,i,n,s){const r=e?this.createBean(new $o(e,"COLUMN_MENU")):void 0;if(this.activeMenu=r,!(null==r?void 0:r.hasFilter())||!e)throw new Error("AG Grid - unable to show popup filter, filter instantiation failed");const o=document.createElement("div");let a;Ht(o,"presentation"),o.classList.add("ag-menu"),s||o.classList.add("ag-filter-menu"),this.tabListener=this.addManagedListener(o,"keydown",e=>this.trapFocusWithin(e,o)),o.appendChild(null==r?void 0:r.getGui());const l=this.menuService.isColumnMenuAnchoringEnabled()?null!=n?n:this.ctrlsService.getGridBodyCtrl().getGui():void 0,c=this.localeService.getLocaleTextFunc(),h=s&&"columnFilter"!==i?c("ariaLabelColumnMenu","Column Menu"):c("ariaLabelColumnFilter","Column Filter"),u=this.popupService.addPopup({modal:!0,eChild:o,closeOnEsc:!0,closedCallback:t=>{e.setMenuVisible(!1,"contextMenu");const s=t instanceof KeyboardEvent;if(this.tabListener&&(this.tabListener=this.tabListener()),s&&n&&xn(n)){const e=this.focusService.findTabbableParent(n);e&&e.focus()}null==r||r.afterGuiDetached(),this.destroyBean(this.activeMenu),this.dispatchVisibleChangedEvent(!1,i,e)},positionCallback:()=>t(o),anchorToElement:l,ariaLabel:h});u&&(this.hidePopup=a=u.hideFunc),r.afterInit().then(()=>{t(o),r.afterGuiAttached({container:i,hidePopup:a})}),e.setMenuVisible(!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,i,e)}trapFocusWithin(e,t){e.key!==Zn.TAB||e.defaultPrevented||this.focusService.findNextFocusableElement(t,!1,e.shiftKey)||(e.preventDefault(),this.focusService.focusInto(t,e.shiftKey))}dispatchVisibleChangedEvent(e,t,i){const n={type:ct.EVENT_COLUMN_MENU_VISIBLE_CHANGED,visible:e,switchingTab:!1,key:t,column:null!=i?i:null};this.eventService.dispatchEvent(n)}isMenuEnabled(e){var t;return e.isFilterAllowed()&&(null!=(t=e.getColDef().menuTabs)?t:["filterMenuTab"]).includes("filterMenuTab")}showMenuAfterContextMenuEvent(){}destroy(){this.destroyBean(this.activeMenu),super.destroy()}};g([ue("filterManager")],wl.prototype,"filterManager",2),g([ue("popupService")],wl.prototype,"popupService",2),g([ue("focusService")],wl.prototype,"focusService",2),g([ue("ctrlsService")],wl.prototype,"ctrlsService",2),g([ue("menuService")],wl.prototype,"menuService",2),wl=g([he("filterMenuFactory")],wl);var Sl=(e=>(e.TAB_GUARD="ag-tab-guard",e.TAB_GUARD_TOP="ag-tab-guard-top",e.TAB_GUARD_BOTTOM="ag-tab-guard-bottom",e))(Sl||{}),xl=class extends st{constructor(e){super(),this.skipTabGuardFocus=!1,this.forcingFocusOut=!1;const{comp:t,eTopGuard:i,eBottomGuard:n,focusTrapActive:s,forceFocusOutWhenTabGuardsAreEmpty:r,focusInnerElement:o,onFocusIn:a,onFocusOut:l,shouldStopEventPropagation:c,onTabKeyDown:h,handleKeyDown:u,eFocusableElement:d}=e;this.comp=t,this.eTopGuard=i,this.eBottomGuard=n,this.providedFocusInnerElement=o,this.eFocusableElement=d,this.focusTrapActive=!!s,this.forceFocusOutWhenTabGuardsAreEmpty=!!r,this.providedFocusIn=a,this.providedFocusOut=l,this.providedShouldStopEventPropagation=c,this.providedOnTabKeyDown=h,this.providedHandleKeyDown=u}postConstruct(){this.createManagedBean(new Is(this.eFocusableElement,{shouldStopEventPropagation:()=>this.shouldStopEventPropagation(),onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e),onFocusIn:e=>this.onFocusIn(e),onFocusOut:e=>this.onFocusOut(e)})),this.activateTabGuards(),[this.eTopGuard,this.eBottomGuard].forEach(e=>this.addManagedListener(e,"focus",this.onFocus.bind(this)))}handleKeyDown(e){this.providedHandleKeyDown&&this.providedHandleKeyDown(e)}tabGuardsAreActive(){return!!this.eTopGuard&&this.eTopGuard.hasAttribute("tabIndex")}shouldStopEventPropagation(){return!!this.providedShouldStopEventPropagation&&this.providedShouldStopEventPropagation()}activateTabGuards(){if(this.forcingFocusOut)return;const e=this.gos.get("tabIndex");this.comp.setTabIndex(e.toString())}deactivateTabGuards(){this.comp.setTabIndex()}onFocus(e){if(this.skipTabGuardFocus)return void(this.skipTabGuardFocus=!1);if(this.forceFocusOutWhenTabGuardsAreEmpty&&0===this.focusService.findFocusableElements(this.eFocusableElement,".ag-tab-guard").length)return void this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard);const t=e.target===this.eBottomGuard;this.providedFocusInnerElement?this.providedFocusInnerElement(t):this.focusInnerElement(t)}findNextElementOutsideAndFocus(e){const t=this.gos.getDocument(),i=this.focusService.findFocusableElements(t.body,null,!0),n=i.indexOf(e?this.eTopGuard:this.eBottomGuard);if(-1===n)return;let s,r;e?(s=0,r=n):(s=n+1,r=i.length);const o=i.slice(s,r),a=this.gos.get("tabIndex");o.sort((e,t)=>{const i=parseInt(e.getAttribute("tabindex")||"0"),n=parseInt(t.getAttribute("tabindex")||"0");return n===a?1:i===a?-1:0===i?1:0===n?-1:i-n}),o[e?o.length-1:0].focus()}onFocusIn(e){this.focusTrapActive||(this.providedFocusIn&&this.providedFocusIn(e),this.deactivateTabGuards())}onFocusOut(e){this.focusTrapActive||(this.providedFocusOut&&this.providedFocusOut(e),this.eFocusableElement.contains(e.relatedTarget)||this.activateTabGuards())}onTabKeyDown(e){if(this.providedOnTabKeyDown)return void this.providedOnTabKeyDown(e);if(this.focusTrapActive)return;if(e.defaultPrevented)return;const t=this.tabGuardsAreActive();t&&this.deactivateTabGuards();const i=this.getNextFocusableElement(e.shiftKey);t&&setTimeout(()=>this.activateTabGuards(),0),i&&(i.focus(),e.preventDefault())}focusInnerElement(e=!1){const t=this.focusService.findFocusableElements(this.eFocusableElement);this.tabGuardsAreActive()&&(t.splice(0,1),t.splice(t.length-1,1)),t.length&&t[e?t.length-1:0].focus({preventScroll:!0})}getNextFocusableElement(e){return this.focusService.findNextFocusableElement(this.eFocusableElement,!1,e)}forceFocusOutOfContainer(e=!1){if(this.forcingFocusOut)return;const t=e?this.eTopGuard:this.eBottomGuard;this.activateTabGuards(),this.skipTabGuardFocus=!0,this.forcingFocusOut=!0,t.focus(),window.setTimeout(()=>{this.forcingFocusOut=!1,this.activateTabGuards()})}isTabGuard(e){return e===this.eTopGuard||e===this.eBottomGuard}};g([ue("focusService")],xl.prototype,"focusService",2),g([le],xl.prototype,"postConstruct",1);var El=class extends Cs{initialiseTabGuard(e){this.eTopGuard=this.createTabGuard("top"),this.eBottomGuard=this.createTabGuard("bottom"),this.eFocusableElement=this.getFocusableElement();const t=[this.eTopGuard,this.eBottomGuard],i={setTabIndex:e=>{t.forEach(t=>null!=e?t.setAttribute("tabindex",e):t.removeAttribute("tabindex"))}};this.addTabGuards(this.eTopGuard,this.eBottomGuard),this.tabGuardCtrl=this.createManagedBean(new xl({comp:i,focusTrapActive:!!e.focusTrapActive,eTopGuard:this.eTopGuard,eBottomGuard:this.eBottomGuard,eFocusableElement:this.eFocusableElement,onFocusIn:e.onFocusIn,onFocusOut:e.onFocusOut,focusInnerElement:e.focusInnerElement,handleKeyDown:e.handleKeyDown,onTabKeyDown:e.onTabKeyDown,shouldStopEventPropagation:e.shouldStopEventPropagation,forceFocusOutWhenTabGuardsAreEmpty:e.forceFocusOutWhenTabGuardsAreEmpty}))}createTabGuard(e){const t=document.createElement("div"),i="top"===e?"ag-tab-guard-top":"ag-tab-guard-bottom";return t.classList.add("ag-tab-guard",i),Ht(t,"presentation"),t}addTabGuards(e,t){this.eFocusableElement.insertAdjacentElement("afterbegin",e),this.eFocusableElement.insertAdjacentElement("beforeend",t)}removeAllChildrenExceptTabGuards(){const e=[this.eTopGuard,this.eBottomGuard];Cn(this.getFocusableElement()),this.addTabGuards(...e)}forceFocusOutOfContainer(e=!1){this.tabGuardCtrl.forceFocusOutOfContainer(e)}appendChild(e,t){On(e)||(e=e.getGui());const{eBottomGuard:i}=this;i?i.insertAdjacentElement("beforebegin",e):super.appendChild(e,t)}},Al=class e extends El{constructor(t){super(e.getTemplate(t.cssClass)),this.items=[],this.tabbedItemScrollMap=new Map,this.params=t}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,i;return null==(i=null==(t=null==(e=this.activeItem)?void 0:e.tabbedItem)?void 0:t.afterDetachedCallback)?void 0:i.call(t)})}static getTemplate(e){return`<div class="ag-tabs ${e}">\n            <div ref="eHeader"></div>\n            <div ref="eBody" role="presentation" class="ag-tabs-body ${e?`${e}-body`:""}"></div>\n        </div>`}setupHeader(){const{enableCloseButton:e,cssClass:t}=this.params,i=(e,i)=>{e.classList.add(`ag-tabs-${i}`),t&&e.classList.add(`${t}-${i}`)};e?(this.setupCloseButton(i),this.eTabHeader=this.gos.getDocument().createElement("div"),i(this.eHeader,"header-wrapper"),Ht(this.eHeader,"presentation"),this.eHeader.appendChild(this.eTabHeader)):this.eTabHeader=this.eHeader,Ht(this.eTabHeader,"tablist"),i(this.eTabHeader,"header")}setupCloseButton(e){const t=this.gos.getDocument(),i=t.createElement("button");e(i,"close-button");const n=qn("close",this.gos,void 0,!0);$t(i,this.params.closeButtonAriaLabel),i.appendChild(n),this.addManagedListener(i,"click",()=>{var e,t;return null==(t=(e=this.params).onCloseClicked)?void 0:t.call(e)});const s=t.createElement("div");e(s,"close-button-wrapper"),Ht(s,"presentation"),s.appendChild(i),this.eHeader.appendChild(s),this.eCloseButton=i}handleKeyDown(e){switch(e.key){case Zn.RIGHT:case Zn.LEFT:if(!this.eTabHeader.contains(this.gos.getActiveDomElement()))return;const t=e.key===Zn.RIGHT,i=this.gos.get("enableRtl"),n=this.items.indexOf(this.activeItem),s=t!==i?Math.min(n+1,this.items.length-1):Math.max(n-1,0);if(n===s)return;e.preventDefault();const r=this.items[s];this.showItemWrapper(r),r.eHeaderButton.focus();break;case Zn.UP:case Zn.DOWN:e.stopPropagation()}}onTabKeyDown(e){var t,i,n,s;if(e.defaultPrevented)return;const{focusService:r,eHeader:o,eBody:a,activeItem:l,params:c}=this,{suppressTrapFocus:h,enableCloseButton:u}=c,d=this.gos.getActiveDomElement(),p=e.target,g=e.shiftKey;if(o.contains(d))return e.preventDefault(),void(u&&g&&!(null==(t=this.eCloseButton)?void 0:t.contains(d))?null==(i=this.eCloseButton)||i.focus():h&&g?null==(n=this.focusService.findFocusableElementBeforeTabGuard(this.gos.getDocument().body,p))||n.focus():this.focusBody(e.shiftKey));let f=null;if(r.isTargetUnderManagedComponent(a,p)&&(g&&(f=this.focusService.findFocusableElementBeforeTabGuard(a,p)),f||h||(f=l.eHeaderButton)),!f&&a.contains(d)&&(f=r.findNextFocusableElement(a,!1,g),!f))return e.preventDefault(),void(h&&!g?this.forceFocusOutOfContainer(g):u&&!g?null==(s=this.eCloseButton)||s.focus():this.focusHeader());f&&(e.preventDefault(),f.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");Ht(t,"tab"),t.setAttribute("tabindex","-1"),t.appendChild(e.title),t.classList.add("ag-tab"),this.eTabHeader.appendChild(t),$t(t,e.titleLabel);const i={tabbedItem:e,eHeaderButton:t};this.items.push(i),t.addEventListener("click",this.showItemWrapper.bind(this,i))}showItem(e){const t=this.items.find(t=>t.tabbedItem===e);t&&this.showItemWrapper(t)}showItemWrapper(e){var t,i,n,s,r,o;const{tabbedItem:a,eHeaderButton:l}=e;null==(i=(t=this.params).onItemClicked)||i.call(t,{item:a}),this.activeItem!==e?(this.lastScrollListener&&(this.lastScrollListener=this.lastScrollListener()),Cn(this.eBody),a.bodyPromise.then(e=>{this.eBody.appendChild(e);const t=!this.focusService.isKeyboardMode();if(this.params.suppressFocusBodyOnOpen||this.focusService.focusInto(this.eBody,!1,t),a.afterAttachedCallback&&a.afterAttachedCallback(this.afterAttachedParams),this.params.keepScrollPosition){const t=a.getScrollableContainer&&a.getScrollableContainer()||e;this.lastScrollListener=this.addManagedListener(t,"scroll",()=>{this.tabbedItemScrollMap.set(a.name,t.scrollTop)});const i=this.tabbedItemScrollMap.get(a.name);void 0!==i&&setTimeout(()=>{t.scrollTop=i},0)}}),this.activeItem&&(this.activeItem.eHeaderButton.classList.remove("ag-tab-selected"),null==(o=(r=this.activeItem.tabbedItem).afterDetachedCallback)||o.call(r)),l.classList.add("ag-tab-selected"),this.activeItem=e):null==(s=(n=this.params).onActiveItemClicked)||s.call(n)}};g([ue("focusService")],Al.prototype,"focusService",2),g([Ss("eHeader")],Al.prototype,"eHeader",2),g([Ss("eBody")],Al.prototype,"eBody",2),g([le],Al.prototype,"postConstruct",1);var Ml=Al,Tl=class extends st{constructor(){super(...arguments),this.polyfillFunctions=[]}observeResize(e,t){const i=this.gos.getWindow(),n=()=>{var i,n;let s=null!=(i=null==e?void 0:e.clientWidth)?i:0,r=null!=(n=null==e?void 0:e.clientHeight)?n:0,o=!0;const a=()=>{var i,n;if(o){const o=null!=(i=null==e?void 0:e.clientWidth)?i:0,l=null!=(n=null==e?void 0:e.clientHeight)?n:0;(o!==s||l!==r)&&(s=o,r=l,t()),this.doNextPolyfillTurn(a)}};return a(),()=>o=!1},s=this.gos.get("suppressBrowserResizeObserver");return i.ResizeObserver&&!s?(()=>{const n=new i.ResizeObserver(t);return n.observe(e),()=>n.disconnect()})():this.getFrameworkOverrides().wrapIncoming(()=>n(),"resize-observer")}doNextPolyfillTurn(e){this.polyfillFunctions.push(e),this.schedulePolyfill()}schedulePolyfill(){this.polyfillScheduled||(this.polyfillScheduled=!0,window.setTimeout(()=>{const e=this.polyfillFunctions;this.polyfillScheduled=!1,this.polyfillFunctions=[],e.forEach(e=>e())},50))}};Tl=g([he("resizeObserverService")],Tl);var Dl=class extends st{constructor(){super(...arguments),this.createTasksP1={list:[],sorted:!1},this.createTasksP2={list:[],sorted:!1},this.destroyTasks=[],this.ticking=!1,this.scrollGoingDown=!0,this.lastPage=0,this.lastScrollTop=0,this.taskCount=0,this.cancelledTasks=new Set}setScrollTop(e){const t=this.gos.get("pagination");if(this.scrollGoingDown=e>=this.lastScrollTop,t&&0===e){const e=this.paginationProxy.getCurrentPage();e!==this.lastPage&&(this.lastPage=e,this.scrollGoingDown=!0)}this.lastScrollTop=e}init(){this.useAnimationFrame=!this.gos.get("suppressAnimationFrame")}isOn(){return this.useAnimationFrame}verifyAnimationFrameOn(e){!1===this.useAnimationFrame&&console.warn(`AG Grid: AnimationFrameService.${e} called but animation frames are off`)}createTask(e,t,i){this.verifyAnimationFrameOn(i);const n={task:e,index:t,createOrder:++this.taskCount};this.addTaskToList(this[i],n),this.schedule()}cancelTask(e){this.cancelledTasks.add(e)}addTaskToList(e,t){e.list.push(t),e.sorted=!1}sortTaskList(e){if(e.sorted)return;const t=this.scrollGoingDown?1:-1;e.list.sort((e,i)=>e.index!==i.index?t*(i.index-e.index):i.createOrder-e.createOrder),e.sorted=!0}addDestroyTask(e){this.verifyAnimationFrameOn("createTasksP3"),this.destroyTasks.push(e),this.schedule()}executeFrame(e){this.verifyAnimationFrameOn("executeFrame");const t=this.createTasksP1,i=t.list,n=this.createTasksP2,s=n.list,r=this.destroyTasks,o=(new Date).getTime();let a=(new Date).getTime()-o;const l=e<=0,c=this.ctrlsService.getGridBodyCtrl();for(;l||a<e;){if(!c.getScrollFeature().scrollGridIfNeeded()){let e;if(i.length)this.sortTaskList(t),e=i.pop().task;else if(s.length)this.sortTaskList(n),e=s.pop().task;else{if(!r.length){this.cancelledTasks.clear();break}e=r.pop()}this.cancelledTasks.has(e)||e()}a=(new Date).getTime()-o}i.length||s.length||r.length?this.requestFrame():this.stopTicking()}stopTicking(){this.ticking=!1}flushAllFrames(){this.useAnimationFrame&&this.executeFrame(-1)}schedule(){this.useAnimationFrame&&(this.ticking||(this.ticking=!0,this.requestFrame()))}requestFrame(){const e=this.executeFrame.bind(this,60);this.requestAnimationFrame(e)}requestAnimationFrame(e){const t=this.gos.getWindow();t.requestAnimationFrame?t.requestAnimationFrame(e):t.webkitRequestAnimationFrame?t.webkitRequestAnimationFrame(e):t.setTimeout(e,0)}isQueueEmpty(){return!this.ticking}debounce(e){let t=!1;return()=>{this.isOn()?t||(t=!0,this.addDestroyTask(()=>{t=!1,e()})):window.setTimeout(e,0)}}};g([ue("ctrlsService")],Dl.prototype,"ctrlsService",2),g([ue("paginationProxy")],Dl.prototype,"paginationProxy",2),g([le],Dl.prototype,"init",1),Dl=g([he("animationFrameService")],Dl);var Il=(e=>(e.EVERYTHING="group",e.FILTER="filter",e.SORT="sort",e.MAP="map",e.AGGREGATE="aggregate",e.FILTER_AGGREGATES="filter_aggregates",e.PIVOT="pivot",e.NOTHING="nothing",e))(Il||{}),Rl=class extends st{postConstruct(){this.isClientSideRowModel="clientSide"===this.rowModel.getType()}expandRows(e){if(!this.isClientSideRowModel)return;const t=new Set(e);this.rowModel.forEachNode(e=>{e.id&&t.has(e.id)&&(e.expanded=!0)}),this.onGroupExpandedOrCollapsed()}getExpandedRows(){const e=[];return this.rowModel.forEachNode(({expanded:t,id:i})=>{t&&i&&e.push(i)}),e}expandAll(e){this.isClientSideRowModel&&this.rowModel.expandOrCollapseAll(e)}setRowNodeExpanded(e,t,i,n){e&&(i&&e.parent&&-1!==e.parent.level&&this.setRowNodeExpanded(e.parent,t,i,n),e.setExpanded(t,void 0,n))}onGroupExpandedOrCollapsed(){this.isClientSideRowModel&&this.rowModel.refreshModel({step:"map"})}};g([ue("rowModel")],Rl.prototype,"rowModel",2),g([le],Rl.prototype,"postConstruct",1),Rl=g([he("expansionService")],Rl);var kl=class extends st{postConstruct(){var e;this.activeMenuFactory=null!=(e=this.enterpriseMenuFactory)?e:this.filterMenuFactory}showColumnMenu(e){this.showColumnMenuCommon(this.activeMenuFactory,e,"columnMenu")}showFilterMenu(e){const t=this.enterpriseMenuFactory&&this.isLegacyMenuEnabled()?this.enterpriseMenuFactory:this.filterMenuFactory;this.showColumnMenuCommon(t,e,e.containerType,!0)}showHeaderContextMenu(e,t,i){this.activeMenuFactory.showMenuAfterContextMenuEvent(e,t,i)}getContextMenuPosition(e,t){const i=this.getRowCtrl(e),n=this.getCellGui(i,t);if(!n)return i?{x:0,y:i.getRowYPosition()}:{x:0,y:0};const s=n.getBoundingClientRect();return{x:s.x+s.width/2,y:s.y+s.height/2}}showContextMenu(e){var t,i,n;const{column:s,rowNode:r}=e;let{anchorToElement:o,value:a}=e;r&&s&&null==a&&(a=r.getValueFromValueService(s)),null==o&&(o=this.getContextMenuAnchorElement(r,s)),null==(n=this.contextMenuFactory)||n.onContextMenu(null!=(t=e.mouseEvent)?t:null,null!=(i=e.touchEvent)?i:null,null!=r?r:null,null!=s?s:null,a,o)}showColumnChooser(e){var t;null==(t=this.columnChooserFactory)||t.showColumnChooser(e)}hidePopupMenu(){var e;null==(e=this.contextMenuFactory)||e.hideActiveMenu(),this.activeMenuFactory.hideActiveMenu()}hideColumnChooser(){var e;null==(e=this.columnChooserFactory)||e.hideActiveColumnChooser()}isColumnMenuInHeaderEnabled(e){const{suppressMenu:t,suppressHeaderMenuButton:i}=e.getColDef();return!(null!=i?i:t)&&this.activeMenuFactory.isMenuEnabled(e)&&(this.isLegacyMenuEnabled()||!!this.enterpriseMenuFactory)}isFilterMenuInHeaderEnabled(e){return!e.getColDef().suppressHeaderFilterButton&&this.filterManager.isFilterAllowed(e)}isHeaderContextMenuEnabled(e){return!(null==e?void 0:e.getColDef().suppressHeaderContextMenu)&&"new"===this.getColumnMenuType()}isHeaderMenuButtonAlwaysShowEnabled(){return this.isSuppressMenuHide()}isHeaderMenuButtonEnabled(){const e=!this.isSuppressMenuHide();return!(Pi()&&e)}isHeaderFilterButtonEnabled(e){return this.isFilterMenuInHeaderEnabled(e)&&!this.isLegacyMenuEnabled()&&!this.isFloatingFilterButtonDisplayed(e)}isFilterMenuItemEnabled(e){return this.filterManager.isFilterAllowed(e)&&!this.isLegacyMenuEnabled()&&!this.isFilterMenuInHeaderEnabled(e)&&!this.isFloatingFilterButtonDisplayed(e)}isColumnMenuAnchoringEnabled(){return!this.isLegacyMenuEnabled()}areAdditionalColumnMenuItemsEnabled(){return"new"===this.getColumnMenuType()}isLegacyMenuEnabled(){return"legacy"===this.getColumnMenuType()}isFloatingFilterButtonEnabled(e){var t;const i=e.getColDef(),n=null==(t=i.floatingFilterComponentParams)?void 0:t.suppressFilterButton;return null!=n&&z("As of v31.1, 'colDef.floatingFilterComponentParams.suppressFilterButton' is deprecated. Use 'colDef.suppressFloatingFilterButton' instead."),null==i.suppressFloatingFilterButton?!n:!i.suppressFloatingFilterButton}getColumnMenuType(){var e;return null!=(e=this.gos.get("columnMenu"))?e:"legacy"}isFloatingFilterButtonDisplayed(e){return!!e.getColDef().floatingFilter&&this.isFloatingFilterButtonEnabled(e)}isSuppressMenuHide(){const e=this.gos.get("suppressMenuHide");return this.isLegacyMenuEnabled()?e:!this.gos.exists("suppressMenuHide")||e}showColumnMenuCommon(e,t,i,n){const{column:s,positionBy:r}=t;if("button"===r){const{buttonElement:r}=t;e.showMenuAfterButtonClick(s,r,i,n)}else if("mouse"===r){const{mouseEvent:r}=t;e.showMenuAfterMouseEvent(s,r,i,n)}else s&&(this.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(s,"auto"),this.animationFrameService.requestAnimationFrame(()=>{const t=this.ctrlsService.getHeaderRowContainerCtrl(s.getPinned()).getHeaderCtrlForColumn(s);e.showMenuAfterButtonClick(s,t.getAnchorElementForMenu(n),i,!0)}))}getRowCtrl(e){const{rowIndex:t,rowPinned:i}=e||{};if(null!=t)return this.rowRenderer.getRowByPosition({rowIndex:t,rowPinned:i})||void 0}getCellGui(e,t){if(!e||!t)return;const i=e.getCellCtrl(t);return(null==i?void 0:i.getGui())||void 0}getContextMenuAnchorElement(e,t){const i=this.ctrlsService.getGridBodyCtrl().getGridBodyElement(),n=this.getRowCtrl(e);if(!n)return i;return this.getCellGui(n,t)||(n.isFullWidth()?n.getFullWidthElement():i)}};g([ue("filterMenuFactory")],kl.prototype,"filterMenuFactory",2),g([ue("ctrlsService")],kl.prototype,"ctrlsService",2),g([ue("animationFrameService")],kl.prototype,"animationFrameService",2),g([ue("filterManager")],kl.prototype,"filterManager",2),g([ue("rowRenderer")],kl.prototype,"rowRenderer",2),g([de("columnChooserFactory")],kl.prototype,"columnChooserFactory",2),g([de("contextMenuFactory")],kl.prototype,"contextMenuFactory",2),g([de("enterpriseMenuFactory")],kl.prototype,"enterpriseMenuFactory",2),g([le],kl.prototype,"postConstruct",1),kl=g([he("menuService")],kl);var Pl=class extends st{postConstruct(){this.ctrlsService.whenReady(e=>{this.centerRowContainerCtrl=e.center})}getPreferredWidthForColumn(e,t){const i=this.getHeaderCellForColumn(e);if(!i)return-1;const n=this.rowRenderer.getAllCellsForColumn(e);return t||n.push(i),this.addElementsToContainerAndGetWidth(n)}getPreferredWidthForColumnGroup(e){const t=this.getHeaderCellForColumn(e);return t?this.addElementsToContainerAndGetWidth([t]):-1}addElementsToContainerAndGetWidth(e){const t=document.createElement("form");t.style.position="fixed";const i=this.centerRowContainerCtrl.getContainerElement();e.forEach(e=>this.cloneItemIntoDummy(e,t)),i.appendChild(t);const n=t.offsetWidth;return i.removeChild(t),n+this.getAutoSizePadding()}getAutoSizePadding(){return this.gos.get("autoSizePadding")}getHeaderCellForColumn(e){let t=null;return this.ctrlsService.getHeaderRowContainerCtrls().forEach(i=>{const n=i.getHtmlElementForColumnHeader(e);null!=n&&(t=n)}),t}cloneItemIntoDummy(e,t){const i=e.cloneNode(!0);i.style.width="",i.style.position="static",i.style.left="";const n=document.createElement("div"),s=n.classList;["ag-header-cell","ag-header-group-cell"].some(e=>i.classList.contains(e))?(s.add("ag-header","ag-header-row"),n.style.position="static"):s.add("ag-row");let r=e.parentElement;for(;r;){if(["ag-header-row","ag-row"].some(e=>r.classList.contains(e))){for(let e=0;e<r.classList.length;e++){const t=r.classList[e];"ag-row-position-absolute"!=t&&s.add(t)}break}r=r.parentElement}n.appendChild(i),t.appendChild(n)}};g([ue("rowRenderer")],Pl.prototype,"rowRenderer",2),g([ue("ctrlsService")],Pl.prototype,"ctrlsService",2),g([ue("rowCssClassCalculator")],Pl.prototype,"rowCssClassCalculator",2),g([le],Pl.prototype,"postConstruct",1),Pl=g([he("autoWidthCalculator")],Pl);var _l=class extends st{constructor(e,t){super(),this.createRowCon=e,this.destroyRowCtrls=t,this.stickyTopRowCtrls=[],this.stickyBottomRowCtrls=[],this.topContainerHeight=0,this.bottomContainerHeight=0}postConstruct(){this.isClientSide="clientSide"===this.rowModel.getType(),this.ctrlsService.whenReady(e=>{this.gridBodyCtrl=e.gridBodyCtrl})}getStickyTopRowCtrls(){return this.stickyTopRowCtrls}getStickyBottomRowCtrls(){return this.stickyBottomRowCtrls}getLastPixelOfGroup(e){return this.isClientSide?this.getClientSideLastPixelOfGroup(e):this.getServerSideLastPixelOfGroup(e)}getFirstPixelOfGroup(e){return e.footer?e.sibling.rowTop+e.sibling.rowHeight-1:e.hasChildren()?e.rowTop-1:0}getServerSideLastPixelOfGroup(e){var t,i,n,s;if(this.isClientSide)throw new Error("This func should only be called in server side row model.");if(e.isExpandable()||e.footer){if(e.master)return e.detailNode.rowTop+e.detailNode.rowHeight;if(!e.sibling||1===Math.abs(e.sibling.rowIndex-e.rowIndex)){let r=null==(t=e.childStore)?void 0:t.getStoreBounds();return e.footer&&(r=null==(i=e.sibling.childStore)?void 0:i.getStoreBounds()),(null!=(n=null==r?void 0:r.heightPx)?n:0)+(null!=(s=null==r?void 0:r.topPx)?s:0)}return e.footer?e.rowTop+e.rowHeight:e.sibling.rowTop+e.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}getClientSideLastPixelOfGroup(e){if(!this.isClientSide)throw new Error("This func should only be called in client side row model.");if(e.isExpandable()||e.footer){const t=e.footer&&0===e.rowIndex,i=!e.sibling||1===Math.abs(e.sibling.rowIndex-e.rowIndex);if(t||i){let t=e.footer?e.sibling:e;for(;t.isExpandable()&&t.expanded;)if(t.master)t=t.detailNode;else if(t.childrenAfterSort){if(0===t.childrenAfterSort.length)break;t=Ie(t.childrenAfterSort)}return t.rowTop+t.rowHeight}return e.footer?e.rowTop+e.rowHeight:e.sibling.rowTop+e.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}updateStickyRows(e){const t="top"===e;let i=0;if(!this.canRowsBeSticky())return this.refreshNodesAndContainerHeight(e,new Set,i);const n=t?this.rowRenderer.getFirstVisibleVerticalPixel():this.rowRenderer.getLastVisibleVerticalPixel(),s=new Set,r=e=>{if(s.add(e),t){const t=this.getLastPixelOfGroup(e),s=n+i+e.rowHeight;e.stickyRowTop=t<s?i+(t-s):i}else{const t=this.getFirstPixelOfGroup(e),s=n-(i+e.rowHeight);e.stickyRowTop=t>s?i-(t-s):i}i=0,s.forEach(e=>{const t=e.stickyRowTop+e.rowHeight;i<t&&(i=t)})},o=this.areFooterRowsStickySuppressed(),a=this.gos.get("suppressGroupRowsSticky"),l=e=>!!e.displayed&&(e.footer?!0!==o&&(("grand"!==o||-1!==e.level)&&(!("group"===o&&e.level>-1)&&!s.has(e))):!!e.isExpandable()&&(!0!==a&&(!s.has(e)&&e.expanded)));for(let e=0;e<100;e++){let e=n+i;t||(e=n-i);const s=this.rowModel.getRowIndexAtPixel(e),o=this.rowModel.getRow(s);if(null==o)break;const a=this.getStickyAncestors(o).find(e=>(t?e.rowIndex<s:e.rowIndex>s)&&l(e));if(a)r(a);else{if(!(t?o.rowTop<e:o.rowTop+o.rowHeight>e)||!l(o))break;r(o)}}return t||s.forEach(e=>{e.stickyRowTop=i-(e.stickyRowTop+e.rowHeight)}),this.refreshNodesAndContainerHeight(e,s,i)}areFooterRowsStickySuppressed(){const e=this.gos.get("suppressStickyTotalRow");if(!0===e)return!0;const t=!!this.gos.get("groupIncludeFooter")||"group"===e,i=!!this.gos.get("groupIncludeTotalFooter")||"grand"===e;return!(!t||!i)||(i?"grand":!!t&&"group")}canRowsBeSticky(){const e=this.gos.isGroupRowsSticky(),t=this.areFooterRowsStickySuppressed(),i=this.gos.get("suppressGroupRowsSticky");return e&&(!t||!i)}getStickyAncestors(e){const t=[];let i=e.footer?e.sibling:e.parent;for(;i;)i.sibling&&t.push(i.sibling),t.push(i),i=i.parent;return t.reverse()}checkStickyRows(){const e=this.updateStickyRows("top"),t=this.updateStickyRows("bottom");return e||t}destroyStickyCtrls(){this.refreshNodesAndContainerHeight("top",new Set,0),this.refreshNodesAndContainerHeight("bottom",new Set,0)}refreshStickyNode(e){const t=new Set;if(this.stickyTopRowCtrls.some(t=>t.getRowNode()===e)){for(let i=0;i<this.stickyTopRowCtrls.length;i++){const n=this.stickyTopRowCtrls[i].getRowNode();n!==e&&t.add(n)}this.refreshNodesAndContainerHeight("top",t,this.topContainerHeight)&&this.checkStickyRows()}else{for(let i=0;i<this.stickyBottomRowCtrls.length;i++){const n=this.stickyBottomRowCtrls[i].getRowNode();n!==e&&t.add(n)}this.refreshNodesAndContainerHeight("bottom",t,this.bottomContainerHeight)&&this.checkStickyRows()}}refreshNodesAndContainerHeight(e,t,i){const n="top"===e,s=n?this.stickyTopRowCtrls:this.stickyBottomRowCtrls,r={},o=[];for(let e=0;e<s.length;e++){const i=s[e].getRowNode();t.has(i)?o.push(s[e]):(r[i.id]=s[e],i.sticky=!1)}const a=new Set;for(let e=0;e<o.length;e++)a.add(o[e].getRowNode());const l=[];t.forEach(e=>{a.has(e)||(e.sticky=!0,l.push(this.createRowCon(e,!1,!1)))});let c=!!l.length||o.length!==s.length;n?this.topContainerHeight!==i&&(this.topContainerHeight=i,this.gridBodyCtrl.setStickyTopHeight(i),c=!0):this.bottomContainerHeight!==i&&(this.bottomContainerHeight=i,this.gridBodyCtrl.setStickyBottomHeight(i),c=!0),this.destroyRowCtrls(r,!1);const h=[...o,...l];return h.sort((e,t)=>t.getRowNode().rowIndex-e.getRowNode().rowIndex),n||h.reverse(),h.forEach(e=>e.setRowTop(e.getRowNode().stickyRowTop)),!!c&&(n?this.stickyTopRowCtrls=h:this.stickyBottomRowCtrls=h,!0)}};g([ue("rowModel")],_l.prototype,"rowModel",2),g([ue("rowRenderer")],_l.prototype,"rowRenderer",2),g([ue("ctrlsService")],_l.prototype,"ctrlsService",2),g([le],_l.prototype,"postConstruct",1);var Ll=class extends st{constructor(){super(...arguments),this.destroyFuncsForColumnListeners=[],this.rowCtrlsByRowIndex={},this.zombieRowCtrls={},this.allRowCtrls=[],this.topRowCtrls=[],this.bottomRowCtrls=[],this.refreshInProgress=!1,this.dataFirstRenderedFired=!1,this.setupRangeSelectionListeners=()=>{const e=()=>{this.getAllCellCtrls().forEach(e=>e.onRangeSelectionChanged())},t=()=>{this.getAllCellCtrls().forEach(e=>e.updateRangeBordersIfRangeCount())},i=()=>{this.eventService.addEventListener(ct.EVENT_RANGE_SELECTION_CHANGED,e),this.eventService.addEventListener(ct.EVENT_COLUMN_MOVED,t),this.eventService.addEventListener(ct.EVENT_COLUMN_PINNED,t),this.eventService.addEventListener(ct.EVENT_COLUMN_VISIBLE,t)},n=()=>{this.eventService.removeEventListener(ct.EVENT_RANGE_SELECTION_CHANGED,e),this.eventService.removeEventListener(ct.EVENT_COLUMN_MOVED,t),this.eventService.removeEventListener(ct.EVENT_COLUMN_PINNED,t),this.eventService.removeEventListener(ct.EVENT_COLUMN_VISIBLE,t)};this.addDestroyFunc(()=>n()),this.addManagedPropertyListener("enableRangeSelection",e=>{e.currentValue?i():n()}),this.gos.get("enableRangeSelection")&&i()}}postConstruct(){this.ctrlsService.whenReady(e=>{this.gridBodyCtrl=e.gridBodyCtrl,this.initialise()})}initialise(){if(this.addManagedListener(this.eventService,ct.EVENT_PAGINATION_CHANGED,this.onPageLoaded.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_PINNED_ROW_DATA_CHANGED,this.onPinnedRowDataChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_BODY_SCROLL,this.onBodyScroll.bind(this)),this.addManagedListener(this.eventService,ct.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 e=this.rowModel.getType();"clientSide"!==e&&"serverSide"!==e||(this.stickyRowFeature=this.createManagedBean(new _l(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 e=this.getKeepDetailRowsCount(),t=null!=e?e:3;this.cachedRowCtrls=new Nl(t)}}getKeepDetailRowsCount(){return this.gos.get("keepDetailRowsCount")}getStickyTopRowCtrls(){return this.stickyRowFeature?this.stickyRowFeature.getStickyTopRowCtrls():[]}getStickyBottomRowCtrls(){return this.stickyRowFeature?this.stickyRowFeature.getStickyBottomRowCtrls():[]}updateAllRowCtrls(){const e=N(this.rowCtrlsByRowIndex),t=N(this.zombieRowCtrls),i=this.cachedRowCtrls?this.cachedRowCtrls.getEntries():[];t.length>0||i.length>0?this.allRowCtrls=[...e,...t,...i]:this.allRowCtrls=e}onCellFocusChanged(e){this.getAllCellCtrls().forEach(t=>t.onCellFocused(e)),this.getFullWidthRowCtrls().forEach(t=>t.onFullWidthRowFocused(e))}registerCellEventListeners(){this.addManagedListener(this.eventService,ct.EVENT_CELL_FOCUSED,e=>{this.onCellFocusChanged(e)}),this.addManagedListener(this.eventService,ct.EVENT_CELL_FOCUS_CLEARED,()=>{this.onCellFocusChanged()}),this.addManagedListener(this.eventService,ct.EVENT_FLASH_CELLS,e=>{this.getAllCellCtrls().forEach(t=>t.onFlashCells(e))}),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_HOVER_CHANGED,()=>{this.getAllCellCtrls().forEach(e=>e.onColumnHover())}),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,()=>{this.getAllCellCtrls().forEach(e=>e.onDisplayedColumnsChanged())}),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,()=>{this.printLayout&&this.getAllCellCtrls().forEach(e=>e.onLeftChanged())}),this.setupRangeSelectionListeners(),this.refreshListenersToColumnsForCellComps(),this.addManagedListener(this.eventService,ct.EVENT_GRID_COLUMNS_CHANGED,this.refreshListenersToColumnsForCellComps.bind(this)),this.addDestroyFunc(this.removeGridColumnListeners.bind(this))}removeGridColumnListeners(){this.destroyFuncsForColumnListeners.forEach(e=>e()),this.destroyFuncsForColumnListeners.length=0}refreshListenersToColumnsForCellComps(){this.removeGridColumnListeners(),this.columnModel.getAllGridColumns().forEach(e=>{const t=t=>{this.getAllCellCtrls().forEach(i=>{i.getColumn()===e&&t(i)})},i=()=>{t(e=>e.onLeftChanged())},n=()=>{t(e=>e.onWidthChanged())},s=()=>{t(e=>e.onFirstRightPinnedChanged())},r=()=>{t(e=>e.onLastLeftPinnedChanged())},o=()=>{t(e=>e.onColDefChanged())};e.addEventListener("leftChanged",i),e.addEventListener("widthChanged",n),e.addEventListener("firstRightPinnedChanged",s),e.addEventListener("lastLeftPinnedChanged",r),e.addEventListener("colDefChanged",o),this.destroyFuncsForColumnListeners.push(()=>{e.removeEventListener("leftChanged",i),e.removeEventListener("widthChanged",n),e.removeEventListener("firstRightPinnedChanged",s),e.removeEventListener("lastLeftPinnedChanged",r),e.removeEventListener("colDefChanged",o)})})}onDomLayoutChanged(){const e=this.gos.isDomLayout("print"),t=e||this.gos.get("embedFullWidthRows"),i=t!==this.embedFullWidthRows||this.printLayout!==e;this.printLayout=e,this.embedFullWidthRows=t,i&&this.redrawAfterModelUpdate({domLayoutChanged:!0})}datasourceChanged(){this.firstRenderedRow=0,this.lastRenderedRow=-1;const e=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(e)}onPageLoaded(e){const t={recycleRows:e.keepRenderedRows,animate:e.animate,newData:e.newData,newPage:e.newPage,onlyBody:!0};this.redrawAfterModelUpdate(t)}getAllCellsForColumn(e){const t=[];return this.getAllRowCtrls().forEach(i=>{const n=i.getCellElement(e);n&&t.push(n)}),t}refreshFloatingRowComps(){this.refreshFloatingRows(this.topRowCtrls,this.pinnedRowModel.getPinnedTopRowData()),this.refreshFloatingRows(this.bottomRowCtrls,this.pinnedRowModel.getPinnedBottomRowData())}getTopRowCtrls(){return this.topRowCtrls}getCentreRowCtrls(){return this.allRowCtrls}getBottomRowCtrls(){return this.bottomRowCtrls}refreshFloatingRows(e,t){e.forEach(e=>{e.destroyFirstPass(),e.destroySecondPass()}),e.length=0,t&&t.forEach(t=>{const i=new va(t,this.beans,!1,!1,this.printLayout);e.push(i)})}onPinnedRowDataChanged(){this.redrawAfterModelUpdate({recycleRows:!0})}redrawRow(e,t=!1){var i;if(e.sticky)this.stickyRowFeature.refreshStickyNode(e);else{if(null==(i=this.cachedRowCtrls)?void 0:i.has(e))return void this.cachedRowCtrls.removeRow(e);{const t=t=>{const i=t[e.rowIndex];i&&i.getRowNode()===e&&(i.destroyFirstPass(),i.destroySecondPass(),t[e.rowIndex]=this.createRowCon(e,!1,!1))};switch(e.rowPinned){case"top":t(this.topRowCtrls);break;case"bottom":t(this.bottomRowCtrls);break;default:t(this.rowCtrlsByRowIndex),this.updateAllRowCtrls()}}}t||this.dispatchDisplayedRowsChanged(!1)}redrawRows(e){if(null!=e)return null==e||e.forEach(e=>this.redrawRow(e,!0)),void this.dispatchDisplayedRowsChanged(!1);this.redrawAfterModelUpdate()}getCellToRestoreFocusToAfterRefresh(e){const t=(null==e?void 0:e.suppressKeepFocus)?null:this.focusService.getFocusCellToUseAfterRefresh();if(null==t)return null;const i=this.gos.getActiveDomElement(),n=this.gos.getDomData(i,fa.DOM_DATA_KEY_CELL_CTRL),s=this.gos.getDomData(i,va.DOM_DATA_KEY_ROW_CTRL);return n||s?t:null}redrawAfterModelUpdate(e={}){this.getLockOnRefresh();const t=this.getCellToRestoreFocusToAfterRefresh(e);this.updateContainerHeights(),this.scrollToTopIfNewData(e);const i=!e.domLayoutChanged&&!!e.recycleRows,n=e.animate&&this.gos.isAnimateRows(),s=i?this.getRowsToRecycle():null;i||this.removeAllRowComps(),this.workOutFirstAndLastRowsToRender(),this.stickyRowFeature&&this.stickyRowFeature.checkStickyRows(),this.recycleRows(s,n),this.gridBodyCtrl.updateRowCount(),e.onlyBody||this.refreshFloatingRowComps(),this.dispatchDisplayedRowsChanged(),null!=t&&this.restoreFocusedCell(t),this.releaseLockOnRefresh()}scrollToTopIfNewData(e){const t=e.newData||e.newPage,i=this.gos.get("suppressScrollOnNewData");t&&!i&&this.gridBodyCtrl.getScrollFeature().scrollToTop()}updateContainerHeights(){if(this.printLayout)return void this.rowContainerHeightService.setModelHeight(null);let e=this.paginationProxy.getCurrentPageHeight();0===e&&(e=1),this.rowContainerHeightService.setModelHeight(e)}getLockOnRefresh(){if(this.refreshInProgress)throw new Error("AG Grid: cannot get grid to draw rows when it is in the middle of drawing rows. Your code probably called a grid API method while the grid was in the render stage. To overcome this, put the API call into a timeout, e.g. instead of api.redrawRows(), call setTimeout(function() { api.redrawRows(); }, 0). To see what part of your code that caused the refresh check this stacktrace.");this.refreshInProgress=!0}releaseLockOnRefresh(){this.refreshInProgress=!1}isRefreshInProgress(){return this.refreshInProgress}restoreFocusedCell(e){e&&(this.focusService.setRestoreFocusedCell(e),this.onCellFocusChanged(this.beans.gos.addGridCommonParams({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0,type:"mock"})))}stopEditing(e=!1){this.getAllRowCtrls().forEach(t=>{t.stopEditing(e)})}getAllCellCtrls(){const e=[],t=this.getAllRowCtrls(),i=t.length;for(let n=0;n<i;n++){const i=t[n].getAllCellCtrls(),s=i.length;for(let t=0;t<s;t++)e.push(i[t])}return e}getAllRowCtrls(){const e=this.stickyRowFeature&&this.stickyRowFeature.getStickyTopRowCtrls()||[],t=this.stickyRowFeature&&this.stickyRowFeature.getStickyBottomRowCtrls()||[],i=[...this.topRowCtrls,...this.bottomRowCtrls,...e,...t];for(const e in this.rowCtrlsByRowIndex)i.push(this.rowCtrlsByRowIndex[e]);return i}addRenderedRowListener(e,t,i){const n=this.rowCtrlsByRowIndex[t];n&&n.addEventListener(e,i)}flashCells(e={}){this.getCellCtrls(e.rowNodes,e.columns).forEach(t=>t.flashCell(e))}refreshCells(e={}){const t={forceRefresh:e.force,newData:!1,suppressFlash:e.suppressFlash};this.getCellCtrls(e.rowNodes,e.columns).forEach(e=>e.refreshOrDestroyCell(t)),e.rowNodes&&(this.getRowCtrls(e.rowNodes).forEach(e=>{e.isFullWidth()&&(e.refreshFullWidth()||this.redrawRow(e.getRowNode(),!0))}),this.dispatchDisplayedRowsChanged(!1))}getCellRendererInstances(e){var t;const i=this.getCellCtrls(e.rowNodes,e.columns).map(e=>e.getCellRenderer()).filter(e=>null!=e);if(null==(t=e.columns)?void 0:t.length)return i;const n=[],s=this.mapRowNodes(e.rowNodes);return this.getAllRowCtrls().forEach(e=>{if(s&&!this.isRowInMap(e.getRowNode(),s))return;if(!e.isFullWidth())return;const t=e.getFullWidthCellRenderers();for(let e=0;e<t.length;e++){const i=t[e];null!=i&&n.push(i)}}),[...n,...i]}getCellEditorInstances(e){const t=[];return this.getCellCtrls(e.rowNodes,e.columns).forEach(e=>{const i=e.getCellEditor();i&&t.push(i)}),t}getEditingCells(){const e=[];return this.getAllCellCtrls().forEach(t=>{if(t.isEditing()){const i=t.getCellPosition();e.push(i)}}),e}mapRowNodes(e){if(!e)return;const t={top:{},bottom:{},normal:{}};return e.forEach(e=>{const i=e.id;switch(e.rowPinned){case"top":t.top[i]=e;break;case"bottom":t.bottom[i]=e;break;default:t.normal[i]=e}}),t}isRowInMap(e,t){const i=e.id;switch(e.rowPinned){case"top":return null!=t.top[i];case"bottom":return null!=t.bottom[i];default:return null!=t.normal[i]}}getRowCtrls(e){const t=this.mapRowNodes(e),i=this.getAllRowCtrls();return e&&t?i.filter(e=>{const i=e.getRowNode();return this.isRowInMap(i,t)}):i}getCellCtrls(e,t){let i;b(t)&&(i={},t.forEach(e=>{const t=this.columnModel.getGridColumn(e);b(t)&&(i[t.getId()]=!0)}));const n=[];return this.getRowCtrls(e).forEach(e=>{e.getAllCellCtrls().forEach(e=>{const t=e.getColumn().getId();i&&!i[t]||n.push(e)})}),n}destroy(){this.removeAllRowComps(),super.destroy()}removeAllRowComps(){const e=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(e),this.stickyRowFeature&&this.stickyRowFeature.destroyStickyCtrls()}getRowsToRecycle(){const e=[];P(this.rowCtrlsByRowIndex,(t,i)=>{null==i.getRowNode().id&&e.push(t)}),this.removeRowCtrls(e);const t={};return P(this.rowCtrlsByRowIndex,(e,i)=>{const n=i.getRowNode();t[n.id]=i}),this.rowCtrlsByRowIndex={},t}removeRowCtrls(e,t=!1){e.forEach(e=>{const i=this.rowCtrlsByRowIndex[e];i&&(i.destroyFirstPass(t),i.destroySecondPass()),delete this.rowCtrlsByRowIndex[e]})}onBodyScroll(e){"vertical"===e.direction&&this.redraw({afterScroll:!0})}redraw(e={}){const{afterScroll:t}=e;let i;this.stickyRowFeature&&_i()&&(i=this.getCellToRestoreFocusToAfterRefresh()||void 0);const n=this.firstRenderedRow,s=this.lastRenderedRow;this.workOutFirstAndLastRowsToRender();let r=!1;this.stickyRowFeature&&(r=this.stickyRowFeature.checkStickyRows());const o=this.firstRenderedRow!==n||this.lastRenderedRow!==s;if((!t||r||o)&&(this.getLockOnRefresh(),this.recycleRows(null,!1,t),this.releaseLockOnRefresh(),this.dispatchDisplayedRowsChanged(t&&!r),null!=i)){const e=this.getCellToRestoreFocusToAfterRefresh();null!=i&&null==e&&(this.animationFrameService.flushAllFrames(),this.restoreFocusedCell(i))}}removeRowCompsNotToDraw(e,t){const i={};e.forEach(e=>i[e]=!0);const n=Object.keys(this.rowCtrlsByRowIndex).filter(e=>!i[e]);this.removeRowCtrls(n,t)}calculateIndexesToDraw(e){let t=Wi(this.firstRenderedRow,this.lastRenderedRow);const i=(e,i)=>{const n=i.getRowNode().rowIndex;null!=n&&(n<this.firstRenderedRow||n>this.lastRenderedRow)&&this.doNotUnVirtualiseRow(i)&&t.push(n)};P(this.rowCtrlsByRowIndex,i),P(e,i),t.sort((e,t)=>e-t);const n=[];for(let e=0;e<t.length;e++){const i=t[e],s=this.paginationProxy.getRow(i);s&&!s.sticky&&n.push(i)}return n}recycleRows(e,t=!1,i=!1){const n=this.calculateIndexesToDraw(e);(this.printLayout||i)&&(t=!1),this.removeRowCompsNotToDraw(n,!t);const s=[];n.forEach(n=>{const r=this.createOrUpdateRowCtrl(n,e,t,i);b(r)&&s.push(r)}),e&&(!i||this.gos.get("suppressAnimationFrame")||this.printLayout?this.destroyRowCtrls(e,t):this.beans.animationFrameService.addDestroyTask(()=>{this.destroyRowCtrls(e,t),this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()})),this.updateAllRowCtrls()}dispatchDisplayedRowsChanged(e=!1){const t={type:ct.EVENT_DISPLAYED_ROWS_CHANGED,afterScroll:e};this.eventService.dispatchEvent(t)}onDisplayedColumnsChanged(){const e=this.columnModel.isPinningLeft(),t=this.columnModel.isPinningRight();(this.pinningLeft!==e||t!==this.pinningRight)&&(this.pinningLeft=e,this.pinningRight=t,this.embedFullWidthRows&&this.redrawFullWidthEmbeddedRows())}redrawFullWidthEmbeddedRows(){const e=[];this.getFullWidthRowCtrls().forEach(t=>{const i=t.getRowNode().rowIndex;e.push(i.toString())}),this.refreshFloatingRowComps(),this.removeRowCtrls(e),this.redraw({afterScroll:!0})}getFullWidthRowCtrls(e){const t=this.mapRowNodes(e);return this.getAllRowCtrls().filter(e=>{if(!e.isFullWidth())return!1;const i=e.getRowNode();return!(null!=t&&!this.isRowInMap(i,t))})}createOrUpdateRowCtrl(e,t,i,n){let s,r=this.rowCtrlsByRowIndex[e];if(r||(s=this.paginationProxy.getRow(e),b(s)&&b(t)&&t[s.id]&&s.alreadyRendered&&(r=t[s.id],t[s.id]=null)),!r){if(s||(s=this.paginationProxy.getRow(e)),!b(s))return;r=this.createRowCon(s,i,n)}return s&&(s.alreadyRendered=!0),this.rowCtrlsByRowIndex[e]=r,r}destroyRowCtrls(e,t){const i=[];P(e,(e,n)=>{n&&(this.cachedRowCtrls&&n.isCacheable()?this.cachedRowCtrls.addRow(n):(n.destroyFirstPass(!t),t?(this.zombieRowCtrls[n.getInstanceId()]=n,i.push(()=>{n.destroySecondPass(),delete this.zombieRowCtrls[n.getInstanceId()]})):n.destroySecondPass()))}),t&&(i.push(()=>{this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()}),K(i))}getRowBuffer(){return this.gos.get("rowBuffer")}getRowBufferInPixels(){return this.getRowBuffer()*this.gos.getRowHeightAsNumber()}workOutFirstAndLastRowsToRender(){let e,t;if(this.rowContainerHeightService.updateOffset(),this.paginationProxy.isRowsToRender())if(this.printLayout)this.environment.refreshRowHeightVariable(),e=this.paginationProxy.getPageFirstRow(),t=this.paginationProxy.getPageLastRow();else{const i=this.getRowBufferInPixels(),n=this.ctrlsService.getGridBodyCtrl(),s=this.gos.get("suppressRowVirtualisation");let r,o,a=!1;do{const e=this.paginationProxy.getPixelOffset(),{pageFirstPixel:t,pageLastPixel:l}=this.paginationProxy.getCurrentPagePixelRange(),c=this.rowContainerHeightService.getDivStretchOffset(),h=n.getScrollFeature().getVScrollPosition(),u=h.top,d=h.bottom;s?(r=t+c,o=l+c):(r=Math.max(u+e-i,t)+c,o=Math.min(d+e+i,l)+c),this.firstVisibleVPixel=Math.max(u+e,t)+c,this.lastVisibleVPixel=Math.min(d+e,l)+c,a=this.ensureAllRowsInRangeHaveHeightsCalculated(r,o)}while(a);let l=this.paginationProxy.getRowIndexAtPixel(r),c=this.paginationProxy.getRowIndexAtPixel(o);const h=this.paginationProxy.getPageFirstRow(),u=this.paginationProxy.getPageLastRow();l<h&&(l=h),c>u&&(c=u),e=l,t=c}else e=0,t=-1;const i=this.gos.isDomLayout("normal"),n=this.gos.get("suppressMaxRenderedRowRestriction"),s=Math.max(this.getRowBuffer(),500);i&&!n&&t-e>s&&(t=e+s);const r=e!==this.firstRenderedRow,o=t!==this.lastRenderedRow;if(r||o){this.firstRenderedRow=e,this.lastRenderedRow=t;const i={type:ct.EVENT_VIEWPORT_CHANGED,firstRow:e,lastRow:t};this.eventService.dispatchEvent(i)}}dispatchFirstDataRenderedEvent(){if(this.dataFirstRenderedFired)return;this.dataFirstRenderedFired=!0;const e={type:ct.EVENT_FIRST_DATA_RENDERED,firstRow:this.firstRenderedRow,lastRow:this.lastRenderedRow};window.requestAnimationFrame(()=>{this.beans.eventService.dispatchEvent(e)})}ensureAllRowsInRangeHaveHeightsCalculated(e,t){const i=this.paginationProxy.ensureRowHeightsValid(e,t,-1,-1);return i&&this.updateContainerHeights(),i}getFirstVisibleVerticalPixel(){return this.firstVisibleVPixel}getLastVisibleVerticalPixel(){return this.lastVisibleVPixel}getFirstVirtualRenderedRow(){return this.firstRenderedRow}getLastVirtualRenderedRow(){return this.lastRenderedRow}doNotUnVirtualiseRow(e){const t=!1,i=e.getRowNode(),n=this.focusService.isRowNodeFocused(i),s=e.isEditing(),r=i.detail;return(n||s||r)&&!!this.paginationProxy.isRowPresent(i)||t}createRowCon(e,t,i){const n=this.cachedRowCtrls?this.cachedRowCtrls.getRow(e):null;if(n)return n;const s=this.gos.get("suppressAnimationFrame"),r=i&&!s&&!this.printLayout;return new va(e,this.beans,t,r,this.printLayout)}getRenderedNodes(){const e=this.rowCtrlsByRowIndex;return Object.values(e).map(e=>e.getRowNode())}getRowByPosition(e){let t;const{rowIndex:i}=e;switch(e.rowPinned){case"top":t=this.topRowCtrls[i];break;case"bottom":t=this.bottomRowCtrls[i];break;default:t=this.rowCtrlsByRowIndex[i],t||(t=this.getStickyTopRowCtrls().find(e=>e.getRowNode().rowIndex===i)||null,t||(t=this.getStickyBottomRowCtrls().find(e=>e.getRowNode().rowIndex===i)||null))}return t}isRangeInRenderedViewport(e,t){if(null==e||null==t)return!1;const i=e>this.lastRenderedRow;return!(t<this.firstRenderedRow||i)}};g([ue("animationFrameService")],Ll.prototype,"animationFrameService",2),g([ue("paginationProxy")],Ll.prototype,"paginationProxy",2),g([ue("columnModel")],Ll.prototype,"columnModel",2),g([ue("pinnedRowModel")],Ll.prototype,"pinnedRowModel",2),g([ue("rowModel")],Ll.prototype,"rowModel",2),g([ue("focusService")],Ll.prototype,"focusService",2),g([ue("beans")],Ll.prototype,"beans",2),g([ue("rowContainerHeightService")],Ll.prototype,"rowContainerHeightService",2),g([ue("ctrlsService")],Ll.prototype,"ctrlsService",2),g([le],Ll.prototype,"postConstruct",1),Ll=g([he("rowRenderer")],Ll);var Nl=class{constructor(e){this.entriesMap={},this.entriesList=[],this.maxCount=e}addRow(e){if(this.entriesMap[e.getRowNode().id]=e,this.entriesList.push(e),e.setCached(!0),this.entriesList.length>this.maxCount){const e=this.entriesList[0];e.destroyFirstPass(),e.destroySecondPass(),this.removeFromCache(e)}}getRow(e){if(null==e||null==e.id)return null;const t=this.entriesMap[e.id];return t?(this.removeFromCache(t),t.setCached(!1),t.getRowNode()!=e?null:t):null}has(e){return null!=this.entriesMap[e.id]}removeRow(e){const t=e.id,i=this.entriesMap[t];delete this.entriesMap[t],Ne(this.entriesList,i)}removeFromCache(e){const t=e.getRowNode().id;delete this.entriesMap[t],Ne(this.entriesList,e)}getEntries(){return this.entriesList}},Ol=class extends st{init(){this.setPinnedTopRowData(),this.setPinnedBottomRowData(),this.addManagedPropertyListener("pinnedTopRowData",()=>this.setPinnedTopRowData()),this.addManagedPropertyListener("pinnedBottomRowData",()=>this.setPinnedBottomRowData())}isEmpty(e){return w("top"===e?this.pinnedTopRows:this.pinnedBottomRows)}isRowsToRender(e){return!this.isEmpty(e)}getRowAtPixel(e,t){const i="top"===t?this.pinnedTopRows:this.pinnedBottomRows;if(w(i))return 0;for(let t=0;t<i.length;t++){const n=i[t];if(n.rowTop+n.rowHeight-1>=e)return t}return i.length-1}setPinnedTopRowData(){const e=this.gos.get("pinnedTopRowData");this.pinnedTopRows=this.createNodesFromData(e,!0);const t={type:ct.EVENT_PINNED_ROW_DATA_CHANGED};this.eventService.dispatchEvent(t)}setPinnedBottomRowData(){const e=this.gos.get("pinnedBottomRowData");this.pinnedBottomRows=this.createNodesFromData(e,!1);const t={type:ct.EVENT_PINNED_ROW_DATA_CHANGED};this.eventService.dispatchEvent(t)}createNodesFromData(e,t){const i=[];if(e){let n=0;e.forEach((e,s)=>{const r=new Lr(this.beans);r.data=e;const o=t?Lr.ID_PREFIX_TOP_PINNED:Lr.ID_PREFIX_BOTTOM_PINNED;r.id=o+s,r.rowPinned=t?"top":"bottom",r.setRowTop(n),r.setRowHeight(this.gos.getRowHeightForNode(r).height),r.setRowIndex(s),n+=r.rowHeight,i.push(r)})}return i}getPinnedTopRowData(){return this.pinnedTopRows}getPinnedBottomRowData(){return this.pinnedBottomRows}getPinnedTopTotalHeight(){return this.getTotalHeight(this.pinnedTopRows)}getPinnedTopRowCount(){return this.pinnedTopRows?this.pinnedTopRows.length:0}getPinnedBottomRowCount(){return this.pinnedBottomRows?this.pinnedBottomRows.length:0}getPinnedTopRow(e){return this.pinnedTopRows[e]}getPinnedBottomRow(e){return this.pinnedBottomRows[e]}forEachPinnedTopRow(e){w(this.pinnedTopRows)||this.pinnedTopRows.forEach(e)}forEachPinnedBottomRow(e){w(this.pinnedBottomRows)||this.pinnedBottomRows.forEach(e)}getPinnedBottomTotalHeight(){return this.getTotalHeight(this.pinnedBottomRows)}getTotalHeight(e){if(!e||0===e.length)return 0;const t=Ie(e);return t.rowTop+t.rowHeight}};g([ue("beans")],Ol.prototype,"beans",2),g([le],Ol.prototype,"init",1),Ol=g([he("pinnedRowModel")],Ol);var Fl=(e=>(e.Applied="Applied",e.StoreNotFound="StoreNotFound",e.StoreLoading="StoreLoading",e.StoreWaitingToLoad="StoreWaitingToLoad",e.StoreLoadingFailed="StoreLoadingFailed",e.StoreWrongType="StoreWrongType",e.Cancelled="Cancelled",e.StoreNotStarted="StoreNotStarted",e))(Fl||{}),Gl=class{constructor(e,t){this.active=!0,this.nodeIdsToColumns={},this.mapToItems={},this.keepingColumns=e,this.pathRoot={rowNode:t,children:null},this.mapToItems[t.id]=this.pathRoot}setInactive(){this.active=!1}isActive(){return this.active}depthFirstSearchChangedPath(e,t){if(e.children)for(let i=0;i<e.children.length;i++)this.depthFirstSearchChangedPath(e.children[i],t);t(e.rowNode)}depthFirstSearchEverything(e,t,i){if(e.childrenAfterGroup)for(let n=0;n<e.childrenAfterGroup.length;n++){const s=e.childrenAfterGroup[n];s.childrenAfterGroup?this.depthFirstSearchEverything(e.childrenAfterGroup[n],t,i):i&&t(s)}t(e)}forEachChangedNodeDepthFirst(e,t=!1,i=!1){this.active&&!i?this.depthFirstSearchChangedPath(this.pathRoot,e):this.depthFirstSearchEverything(this.pathRoot.rowNode,e,t)}executeFromRootNode(e){e(this.pathRoot.rowNode)}createPathItems(e){let t=e,i=0;for(;!this.mapToItems[t.id];){const e={rowNode:t,children:null};this.mapToItems[t.id]=e,i++,t=t.parent}return i}populateColumnsMap(e,t){if(!this.keepingColumns||!t)return;let i=e;for(;i;)this.nodeIdsToColumns[i.id]||(this.nodeIdsToColumns[i.id]={}),t.forEach(e=>this.nodeIdsToColumns[i.id][e.getId()]=!0),i=i.parent}linkPathItems(e,t){let i=e;for(let e=0;e<t;e++){const e=this.mapToItems[i.id],t=this.mapToItems[i.parent.id];t.children||(t.children=[]),t.children.push(e),i=i.parent}}addParentNode(e,t){if(!e||e.isRowPinned())return;const i=this.createPathItems(e);this.linkPathItems(e,i),this.populateColumnsMap(e,t)}canSkip(e){return this.active&&!this.mapToItems[e.id]}getValueColumnsForNode(e,t){if(!this.keepingColumns)return t;const i=this.nodeIdsToColumns[e.id];return t.filter(e=>i[e.getId()])}getNotValueColumnsForNode(e,t){if(!this.keepingColumns)return null;const i=this.nodeIdsToColumns[e.id];return t.filter(e=>!i[e.getId()])}},Bl=class e extends st{constructor(t){super(),this.state=e.STATE_WAITING_TO_LOAD,this.version=0,this.id=t}getId(){return this.id}load(){this.state=e.STATE_LOADING,this.loadFromDatasource()}getVersion(){return this.version}setStateWaitingToLoad(){this.version++,this.state=e.STATE_WAITING_TO_LOAD}getState(){return this.state}pageLoadFailed(t){this.isRequestMostRecentAndLive(t)&&(this.state=e.STATE_FAILED,this.processServerFail()),this.dispatchLoadCompleted(!1)}success(e,t){this.successCommon(e,t)}pageLoaded(e,t,i){this.successCommon(e,{rowData:t,rowCount:i})}isRequestMostRecentAndLive(e){const t=e===this.version,i=this.isAlive();return t&&i}successCommon(t,i){this.dispatchLoadCompleted(),this.isRequestMostRecentAndLive(t)&&(this.state=e.STATE_LOADED,this.processServerResult(i))}dispatchLoadCompleted(t=!0){const i={type:e.EVENT_LOAD_COMPLETE,success:t,block:this};this.dispatchEvent(i)}};Bl.EVENT_LOAD_COMPLETE="loadComplete",Bl.STATE_WAITING_TO_LOAD="needsLoading",Bl.STATE_LOADING="loading",Bl.STATE_LOADED="loaded",Bl.STATE_FAILED="failed";var Vl=Bl,Hl=class extends st{constructor(){super(...arguments),this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=this.getMaxConcurrentDatasourceRequests();const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=cs.debounce(this.performCheckBlocksToLoad.bind(this),e))}setBeans(e){this.logger=e.create("RowNodeBlockLoader")}getMaxConcurrentDatasourceRequests(){const e=this.gos.get("maxConcurrentDatasourceRequests");return null==e?2:e<=0?void 0:e}addBlock(e){this.blocks.push(e),e.addEventListener(Vl.EVENT_LOAD_COMPLETE,this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){cs.removeFromArray(this.blocks,e)}destroy(){super.destroy(),this.active=!1}loadComplete(){this.activeBlockLoadsCount--,this.checkBlockToLoad(),this.dispatchEvent({type:Hl.BLOCK_LOADED_EVENT}),0==this.activeBlockLoadsCount&&this.dispatchEvent({type:Hl.BLOCK_LOADER_FINISHED_EVENT})}checkBlockToLoad(){this.checkBlockToLoadDebounce?this.checkBlockToLoadDebounce():this.performCheckBlocksToLoad()}performCheckBlocksToLoad(){if(!this.active)return;if(this.printCacheStatus(),null!=this.maxConcurrentRequests&&this.activeBlockLoadsCount>=this.maxConcurrentRequests)return void this.logger.log("checkBlockToLoad: max loads exceeded");const e=this.getAvailableLoadingCount(),t=this.blocks.filter(e=>e.getState()===Vl.STATE_WAITING_TO_LOAD).slice(0,e);this.registerLoads(t.length),t.forEach(e=>e.load()),this.printCacheStatus()}getBlockState(){if(this.gos.isRowModelType("serverSide"))return this.rowModel.getBlockStates();const e={};return this.blocks.forEach(t=>{const{id:i,state:n}=t.getBlockStateJson();e[i]=n}),e}printCacheStatus(){this.logger.isLogging()&&this.logger.log(`printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}isLoading(){return this.activeBlockLoadsCount>0}registerLoads(e){this.activeBlockLoadsCount+=e}getAvailableLoadingCount(){return void 0!==this.maxConcurrentRequests?this.maxConcurrentRequests-this.activeBlockLoadsCount:void 0}};Hl.BLOCK_LOADED_EVENT="blockLoaded",Hl.BLOCK_LOADER_FINISHED_EVENT="blockLoaderFinished",g([ue("rowModel")],Hl.prototype,"rowModel",2),g([le],Hl.prototype,"postConstruct",1),g([f(0,ge("loggerFactory"))],Hl.prototype,"setBeans",1),Hl=g([he("rowNodeBlockLoader")],Hl);var Ul=class extends st{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,ct.EVENT_MODEL_UPDATED,this.onModelUpdated.bind(this)),this.addManagedPropertyListener("pagination",this.onPaginationGridOptionChanged.bind(this)),this.addManagedPropertyListener("paginationPageSize",this.onPageSizeGridOptionChanged.bind(this)),this.onModelUpdated()}ensureRowHeightsValid(e,t,i,n){const s=this.rowModel.ensureRowHeightsValid(e,t,this.getPageFirstRow(),this.getPageLastRow());return s&&this.calculatePages(),s}isPaginateChildRows(){return!(!this.gos.get("groupRemoveSingleChildren")&&!this.gos.get("groupRemoveLowestSingleChildren"))||this.gos.get("paginateChildRows")}onModelUpdated(e){this.calculatePages();const t={type:ct.EVENT_PAGINATION_CHANGED,animate:!!e&&e.animate,newData:!!e&&e.newData,newPage:!!e&&e.newPage,newPageSize:!!e&&e.newPageSize,keepRenderedRows:!!e&&e.keepRenderedRows};this.eventService.dispatchEvent(t)}onPaginationGridOptionChanged(){this.active=this.gos.get("pagination"),this.calculatePages();const e={type:ct.EVENT_PAGINATION_CHANGED,animate:!1,newData:!1,newPage:!1,newPageSize:!1,keepRenderedRows:!0};this.eventService.dispatchEvent(e)}onPageSizeGridOptionChanged(){this.setPageSize(this.gos.get("paginationPageSize"),"gridOptions")}goToPage(e){if(!this.active||this.currentPage===e||"number"!=typeof this.currentPage)return;this.currentPage=e,this.calculatePages();const t={type:ct.EVENT_PAGINATION_CHANGED,animate:!1,newData:!1,newPage:!0,newPageSize:!1,keepRenderedRows:!1};this.eventService.dispatchEvent(t)}getPixelOffset(){return this.pixelOffset}getRow(e){return this.rowModel.getRow(e)}getRowNode(e){return this.rowModel.getRowNode(e)}getRowIndexAtPixel(e){return this.rowModel.getRowIndexAtPixel(e)}getCurrentPageHeight(){return C(this.topRowBounds)||C(this.bottomRowBounds)?0:Math.max(this.bottomRowBounds.rowTop+this.bottomRowBounds.rowHeight-this.topRowBounds.rowTop,0)}getCurrentPagePixelRange(){return{pageFirstPixel:this.topRowBounds?this.topRowBounds.rowTop:0,pageLastPixel:this.bottomRowBounds?this.bottomRowBounds.rowTop+this.bottomRowBounds.rowHeight:0}}isRowPresent(e){return!!this.rowModel.isRowPresent(e)&&(e.rowIndex>=this.topDisplayedRowIndex&&e.rowIndex<=this.bottomDisplayedRowIndex)}isEmpty(){return this.rowModel.isEmpty()}isRowsToRender(){return this.rowModel.isRowsToRender()}forEachNode(e){return this.rowModel.forEachNode(e)}forEachNodeOnPage(e){const t=this.getPageFirstRow(),i=this.getPageLastRow();for(let n=t;n<=i;n++){const t=this.getRow(n);t&&e(t)}}getType(){return this.rowModel.getType()}getRowBounds(e){const t=this.rowModel.getRowBounds(e);return t.rowIndex=e,t}getPageFirstRow(){return this.topRowBounds?this.topRowBounds.rowIndex:-1}getPageLastRow(){return this.bottomRowBounds?this.bottomRowBounds.rowIndex:-1}getRowCount(){return this.rowModel.getRowCount()}getPageForIndex(e){return Math.floor(e/this.pageSize)}goToPageWithIndex(e){if(!this.active)return;const t=this.getPageForIndex(e);this.goToPage(t)}isRowInPage(e){return!this.active||this.getPageForIndex(e.rowIndex)===this.currentPage}isLastPageFound(){return this.rowModel.isLastRowIndexKnown()}getCurrentPage(){return this.currentPage}goToNextPage(){this.goToPage(this.currentPage+1)}goToPreviousPage(){this.goToPage(this.currentPage-1)}goToFirstPage(){this.goToPage(0)}goToLastPage(){const e=this.rowModel.getRowCount(),t=Math.floor(e/this.pageSize);this.goToPage(t)}getPageSize(){return this.pageSize}getTotalPages(){return this.totalPages}setPage(e){this.currentPage=e}get pageSize(){return b(this.pageSizeAutoCalculated)?this.pageSizeAutoCalculated:b(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:b(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:b(this.pageSizeFromGridOptions)?this.pageSizeFromGridOptions:this.defaultPageSize}unsetAutoCalculatedPageSize(){if(void 0===this.pageSizeAutoCalculated)return;const e=this.pageSizeAutoCalculated;if(this.pageSizeAutoCalculated=void 0,this.pageSize===e)return;this.calculatePages();const t={type:ct.EVENT_PAGINATION_CHANGED,animate:!1,newData:!1,newPage:!1,newPageSize:!0,keepRenderedRows:!1};this.eventService.dispatchEvent(t)}setPageSize(e,t){const i=this.pageSize;switch(t){case"autoCalculated":this.pageSizeAutoCalculated=e;break;case"pageSizeSelector":this.pageSizeFromPageSizeSelector=e,0!==this.currentPage&&this.goToFirstPage();break;case"initialState":this.pageSizeFromInitialState=e;break;case"gridOptions":this.pageSizeFromGridOptions=e,this.pageSizeFromInitialState=void 0,this.pageSizeFromPageSizeSelector=void 0,0!==this.currentPage&&this.goToFirstPage()}if(i!==this.pageSize){this.calculatePages();const e={type:ct.EVENT_PAGINATION_CHANGED,animate:!1,newData:!1,newPage:!1,newPageSize:!0,keepRenderedRows:!0};this.eventService.dispatchEvent(e)}}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(b(this.topRowBounds)?this.topRowBounds.rowTop:0)}setPixelOffset(e){this.pixelOffset!==e&&(this.pixelOffset=e,this.eventService.dispatchEvent({type:ct.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED}))}setZeroRows(){this.masterRowCount=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=-1,this.currentPage=0,this.totalPages=0}adjustCurrentPageIfInvalid(){this.currentPage>=this.totalPages&&(this.currentPage=this.totalPages-1),(!isFinite(this.currentPage)||isNaN(this.currentPage)||this.currentPage<0)&&(this.currentPage=0)}calculatePagesMasterRowsOnly(){if(this.masterRowCount=this.rowModel.getTopLevelRowCount(),this.masterRowCount<=0)return void this.setZeroRows();const e=this.masterRowCount-1;this.totalPages=Math.floor(e/this.pageSize)+1,this.adjustCurrentPageIfInvalid();const t=this.pageSize*this.currentPage;let i=this.pageSize*(this.currentPage+1)-1;if(i>e&&(i=e),this.topDisplayedRowIndex=this.rowModel.getTopLevelRowDisplayedIndex(t),i===e)this.bottomDisplayedRowIndex=this.rowModel.getRowCount()-1;else{const e=this.rowModel.getTopLevelRowDisplayedIndex(i+1);this.bottomDisplayedRowIndex=e-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){if(this.masterRowCount=this.rowModel.getRowCount(),0===this.masterRowCount)return void this.setZeroRows();const e=this.masterRowCount-1;this.totalPages=Math.floor(e/this.pageSize)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=this.pageSize*this.currentPage,this.bottomDisplayedRowIndex=this.pageSize*(this.currentPage+1)-1,this.bottomDisplayedRowIndex>e&&(this.bottomDisplayedRowIndex=e)}calculatedPagesNotActive(){this.setPageSize(void 0,"autoCalculated"),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.rowModel.getRowCount()-1}};g([ue("rowModel")],Ul.prototype,"rowModel",2),g([le],Ul.prototype,"postConstruct",1),Ul=g([he("paginationProxy")],Ul);var zl=class extends st{processAllCellClasses(e,t,i,n){this.processClassRules(void 0,e.cellClassRules,t,i,n),this.processStaticCellClasses(e,t,i)}processClassRules(e,t,i,n,s){if(null==t&&null==e)return;const r={},o={},a=(e,t)=>{e.split(" ").forEach(e=>{""!=e.trim()&&t(e)})};if(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const s=e[n],l=t[s];let c;"string"==typeof l?c=this.expressionService.evaluate(l,i):"function"==typeof l&&(c=l(i)),a(s,e=>{c?r[e]=!0:o[e]=!0})}}e&&s&&Object.keys(e).forEach(e=>a(e,e=>{r[e]||(o[e]=!0)})),s&&Object.keys(o).forEach(s),Object.keys(r).forEach(n)}getStaticCellClasses(e,t){const{cellClass:i}=e;if(!i)return[];let n;return n="function"==typeof i?i(t):i,"string"==typeof n&&(n=[n]),n||[]}processStaticCellClasses(e,t,i){this.getStaticCellClasses(e,t).forEach(e=>{i(e)})}};g([ue("expressionService")],zl.prototype,"expressionService",2),zl=g([he("stylingService")],zl);var Wl=class extends zs{constructor(e){super(e,"ag-toggle-button")}setValue(e,t){return super.setValue(e,t),this.addOrRemoveCssClass("ag-selected",this.getValue()),this}},jl=class extends Us{constructor(e){super(e,"ag-text-area",null,"textarea")}setValue(e,t){const i=super.setValue(e,t);return this.eInput.value=e,i}setCols(e){return this.eInput.cols=e,this}setRows(e){return this.eInput.rows=e,this}},$l=class extends ir{constructor(e){super(e,"ag-date-field","date")}postConstruct(){super.postConstruct(),this.addManagedListener(this.eInput,"wheel",this.onWheel.bind(this));const e=Ti();this.addManagedListener(this.eInput,"mousedown",()=>{this.isDisabled()||e||this.eInput.focus()}),this.eInput.step="any"}onWheel(e){this.gos.getActiveDomElement()===this.eInput&&e.preventDefault()}setMin(e){var t;const i=e instanceof Date?null!=(t=Xi(null!=e?e:null,!1))?t:void 0:e;return this.min===i||(this.min=i,Bn(this.eInput,"min",i)),this}setMax(e){var t;const i=e instanceof Date?null!=(t=Xi(null!=e?e:null,!1))?t:void 0:e;return this.max===i||(this.max=i,Bn(this.eInput,"max",i)),this}setStep(e){return this.step===e||(this.step=e,Bn(this.eInput,"step",e)),this}getDate(){var e;if(this.eInput.validity.valid)return null!=(e=Ji(this.getValue()))?e:void 0}setDate(e,t){this.setValue(Xi(null!=e?e:null,!1),t)}},Kl=class extends Us{constructor(e){super(e,"ag-range-field","range")}postConstruct(){super.postConstruct();const{min:e,max:t,step:i}=this.config;null!=e&&this.setMinValue(e),null!=t&&this.setMaxValue(t),this.setStep(i||1)}addInputListeners(){this.addManagedListener(this.eInput,"input",e=>{const t=e.target.value;this.setValue(t)})}setMinValue(e){return this.min=e,this.eInput.setAttribute("min",e.toString()),this}setMaxValue(e){return this.max=e,this.eInput.setAttribute("max",e.toString()),this}setStep(e){return this.eInput.setAttribute("step",e.toString()),this}setValue(e,t){null!=this.min&&(e=Math.max(parseFloat(e),this.min).toString()),null!=this.max&&(e=Math.min(parseFloat(e),this.max).toString());const i=super.setValue(e,t);return this.eInput.value=e,i}},Yl=class extends Cs{constructor(e,t){super('<div class="ag-rich-select-row" role="presentation"></div>'),this.params=e,this.wrapperEl=t}postConstruct(){this.addManagedListener(this.getGui(),"click",this.onClick.bind(this))}setState(e){let t="";this.params.valueFormatter&&(t=this.params.valueFormatter(e)),this.populateWithRenderer(e,t)||this.populateWithoutRenderer(e,t),this.value=e}highlightString(e){const{parsedValue:t}=this;if(this.params.cellRenderer||!b(t))return;let i=b(e);if(i){const n=null==t?void 0:t.toLocaleLowerCase().indexOf(e.toLocaleLowerCase());if(n>=0){const i=n+e.length,s=bt(t.slice(0,n),!0),r=bt(t.slice(n,i),!0),o=bt(t.slice(i));this.renderValueWithoutRenderer(`${s}<span class="ag-rich-select-row-text-highlight">${r}</span>${o}`)}else i=!1}i||this.renderValueWithoutRenderer(t)}updateHighlighted(e){var t;const i=this.getGui(),n=`ag-rich-select-row-${this.getCompId()}`;null==(t=i.parentElement)||t.setAttribute("id",n),e&&(ti(this.getParentComponent().getAriaElement(),n),this.wrapperEl.setAttribute("data-active-option",n)),gi(i.parentElement,e),this.addOrRemoveCssClass("ag-rich-select-row-selected",e)}populateWithoutRenderer(e,t){const i=this.gos.getDocument(),n=this.getGui(),s=i.createElement("span");s.style.overflow="hidden",s.style.textOverflow="ellipsis";const r=bt(b(t)?t:e,!0);this.parsedValue=b(r)?r:null,n.appendChild(s),this.renderValueWithoutRenderer(r),this.setTooltip({newTooltipText:this.parsedValue,shouldDisplayTooltip:()=>s.scrollWidth>s.clientWidth})}renderValueWithoutRenderer(e){const t=this.getGui().querySelector("span");t&&(t.innerHTML=b(e)?e:"&nbsp;")}populateWithRenderer(e,t){let i,n;return this.params.cellRenderer&&(n=this.userComponentFactory.getCellRendererDetails(this.params,{value:e,valueFormatted:t,setTooltip:(e,t)=>{this.setTooltip({newTooltipText:e,shouldDisplayTooltip:t})}})),n&&(i=n.newAgStackInstance()),i&&Hn(i,this.getGui()),!!i&&(i.then(e=>{this.addDestroyFunc(()=>{this.getContext().destroyBean(e)})}),!0)}onClick(){const e=this.getParentComponent(),t={type:ct.EVENT_FIELD_PICKER_VALUE_SELECTED,fromEnterKey:!1,value:this.value};null==e||e.dispatchEvent(t)}};g([ue("userComponentFactory")],Yl.prototype,"userComponentFactory",2),g([le],Yl.prototype,"postConstruct",1);var ql=class e extends El{constructor(t){super(e.getTemplate((null==t?void 0:t.cssIdentifier)||"default")),this.renderedRows=new Map,this.rowHeight=20,this.pageSize=-1,this.isScrolling=!1,this.isHeightFromTheme=!0;const{cssIdentifier:i="default",ariaRole:n="listbox",listName:s}=t||{};this.cssIdentifier=i,this.ariaRole=n,this.listName=s}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,ct.EVENT_GRID_STYLES_CHANGED,this.onGridStylesChanged.bind(this))}onGridStylesChanged(){this.rowHeight=this.getItemHeight(),this.refresh()}setAriaProperties(){const e=this.localeService.getLocaleTextFunc()("ariaDefaultListName",this.listName||"List"),t=this.eContainer;Ht(t,this.ariaRole),$t(t,e)}addResizeObserver(){const e=this.resizeObserverService.observeResize(this.getGui(),()=>this.animationFrameService.requestAnimationFrame(()=>this.drawVirtualRows()));this.addDestroyFunc(e)}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=Wt(t)-1)}onFocusOut(e){this.getFocusableElement().contains(e.relatedTarget)||(this.lastFocusedRowIndex=null)}handleKeyDown(e){switch(e.key){case Zn.UP:case Zn.DOWN:this.navigate(e.key===Zn.UP)&&e.preventDefault();break;case Zn.PAGE_HOME:case Zn.PAGE_END:case Zn.PAGE_UP:case Zn.PAGE_DOWN:null!==this.navigateToPage(e.key)&&e.preventDefault()}}onTabKeyDown(e){this.navigate(e.shiftKey)?e.preventDefault():(qe(e),this.forceFocusOutOfContainer(e.shiftKey))}navigate(e){if(null==this.lastFocusedRowIndex)return!1;const t=this.lastFocusedRowIndex+(e?-1:1);return!(t<0||t>=this.model.getRowCount()||(this.focusRow(t),0))}navigateToPage(e,t="focused"){let i=!1;"focused"===t&&(t=this.getLastFocusedRow(),i=!0);const n=this.model.getRowCount()-1;let s=-1;return e===Zn.PAGE_HOME?s=0:e===Zn.PAGE_END?s=n:e===Zn.PAGE_DOWN?s=Math.min(t+this.pageSize,n):e===Zn.PAGE_UP&&(s=Math.max(t-this.pageSize,0)),-1===s?null:(i?this.focusRow(s):this.ensureIndexVisible(s),s)}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,i)=>e(t.rowComponent,i))}static getTemplate(e){return`<div class="ag-virtual-list-viewport ag-${e}-virtual-list-viewport" role="presentation">\n                <div class="ag-virtual-list-container ag-${e}-virtual-list-container" ref="eContainer"></div>\n            </div>`}getItemHeight(){return this.isHeightFromTheme?this.environment.getListItemHeight():this.rowHeight}ensureIndexVisible(e,t=!0){const i=this.model.getRowCount();if("number"!=typeof e||e<0||e>=i)return console.warn("AG Grid: invalid row index for ensureIndexVisible: "+e),!1;const n=e*this.rowHeight,s=n+this.rowHeight,r=this.getGui(),o=r.scrollTop,a=r.offsetHeight,l=o+a,c=t?0:this.rowHeight,h=l<s-c;if(o>n+c)return r.scrollTop=n,!0;if(h){const e=s-a;return r.scrollTop=e,!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(null==this.model||!this.isAlive())return;const t=this.model.getRowCount();this.eContainer.style.height=t*this.rowHeight+"px",ee(()=>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&&"function"==typeof this.model.areRowsEqual&&this.componentUpdater)}clearVirtualRows(){this.renderedRows.forEach((e,t)=>this.removeRow(t))}drawVirtualRows(e){if(!this.isAlive()||!this.model)return;const t=this.getGui(),i=t.scrollTop,n=i+t.offsetHeight,s=Math.floor(i/this.rowHeight),r=Math.floor(n/this.rowHeight);this.pageSize=Math.floor((n-i)/this.rowHeight),this.ensureRowsRendered(s,r,e)}ensureRowsRendered(e,t,i){this.renderedRows.forEach((i,n)=>{(n<e||n>t)&&n!==this.lastFocusedRowIndex&&this.removeRow(n)}),i&&this.refreshRows();for(let i=e;i<=t;i++)this.renderedRows.has(i)||i<this.model.getRowCount()&&this.insertRow(i)}insertRow(e){const t=this.model.getRow(e),i=document.createElement("div");i.classList.add("ag-virtual-list-item",`ag-${this.cssIdentifier}-virtual-list-item`),Ht(i,"tree"===this.ariaRole?"treeitem":"option"),si(i,this.model.getRowCount()),ri(i,e+1),i.setAttribute("tabindex","-1"),i.style.height=`${this.rowHeight}px`,i.style.top=this.rowHeight*e+"px";const n=this.componentCreator(t,i);n.addGuiEventListener("focusin",()=>this.lastFocusedRowIndex=e),i.appendChild(n.getGui()),this.renderedRows.has(e-1)?this.renderedRows.get(e-1).eDiv.insertAdjacentElement("afterend",i):this.renderedRows.has(e+1)?this.renderedRows.get(e+1).eDiv.insertAdjacentElement("beforebegin",i):this.eContainer.appendChild(i),this.renderedRows.set(e,{rowComponent:n,eDiv:i,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,i)=>{var n,s;if(i>=e)this.removeRow(i);else{const e=this.model.getRow(i);(null==(s=(n=this.model).areRowsEqual)?void 0:s.call(n,t.value,e))?this.componentUpdater(e,t.rowComponent):this.removeRow(i)}})}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([ue("resizeObserverService")],ql.prototype,"resizeObserverService",2),g([ue("animationFrameService")],ql.prototype,"animationFrameService",2),g([Ss("eContainer")],ql.prototype,"eContainer",2),g([le],ql.prototype,"postConstruct",1);var Xl=ql,Zl=class extends Fs{constructor(e){var t,i;super(d(u({pickerAriaLabelKey:"ariaLabelRichSelectField",pickerAriaLabelValue:"Rich Select Field",pickerType:"ag-list",className:"ag-rich-select",pickerIcon:"smallDown",ariaRole:"combobox",template:null!=(t=null==e?void 0:e.template)?t:'\n    <div class="ag-picker-field" role="presentation">\n        <div ref="eLabel"></div>\n            <div ref="eWrapper" class="ag-wrapper ag-picker-field-wrapper ag-rich-select-value ag-picker-collapsed">\n            <div ref="eDisplayField" class="ag-picker-field-display"></div>\n            <ag-input-text-field ref="eInput" class="ag-rich-select-field-input"></ag-input-text-field>\n            <div ref="eIcon" class="ag-picker-field-icon" aria-hidden="true"></div>\n        </div>\n    </div>',modalPicker:!1},e),{maxPickerHeight:null!=(i=null==e?void 0:e.maxPickerHeight)?i:"calc(var(--ag-row-height) * 6.5)"})),this.searchString="",this.highlightedItem=-1,this.lastRowHovered=-1,this.searchStringCreator=null;const{cellRowHeight:n,value:s,valueList:r,searchStringCreator:o}=e||{};null!=n&&(this.cellRowHeight=n),void 0!==s&&(this.value=s),null!=r&&(this.values=r),o&&(this.searchStringCreator=o)}postConstruct(){super.postConstruct(),this.createLoadingElement(),this.createListComponent();const{allowTyping:e,placeholder:t}=this.config;e?(this.eInput.setAutoComplete(!1).setInputPlaceholder(t),this.eDisplayField.classList.add("ag-hidden")):this.eInput.setDisplayed(!1),this.eWrapper.tabIndex=this.gos.get("tabIndex");const{searchDebounceDelay:i=300}=this.config;this.clearSearchString=Q(this.clearSearchString,i),this.renderSelectedValue(),e&&(this.eInput.onValueChange(e=>this.searchTextFromString(e)),this.addManagedListener(this.eWrapper,"focus",this.onWrapperFocus.bind(this))),this.addManagedListener(this.eWrapper,"focusout",this.onWrapperFocusOut.bind(this))}createLoadingElement(){const e=this.gos.getDocument(),t=this.localeService.getLocaleTextFunc(),i=e.createElement("div");i.classList.add("ag-loading-text"),i.innerText=t("loadingOoo","Loading..."),this.eLoading=i}createListComponent(){this.listComponent=this.createBean(new Xl({cssIdentifier:"rich-select"})),this.listComponent.setComponentCreator(this.createRowComponent.bind(this)),this.listComponent.setComponentUpdater((e,t)=>{}),this.listComponent.setParentComponent(this),this.addManagedListener(this.listComponent,ct.EVENT_FIELD_PICKER_VALUE_SELECTED,e=>{this.onListValueSelected(e.value,e.fromEnterKey)});const{cellRowHeight:e}=this;e&&this.listComponent.setRowHeight(e);const t=this.listComponent.getGui(),i=this.listComponent.getAriaElement();this.addManagedListener(t,"mousemove",this.onPickerMouseMove.bind(this)),this.addManagedListener(t,"mousedown",e=>e.preventDefault()),t.classList.add("ag-rich-select-list");const n=`ag-rich-select-list-${this.listComponent.getCompId()}`;i.setAttribute("id",n),$t(i,this.localeService.getLocaleTextFunc()(this.config.pickerAriaLabelKey,this.config.pickerAriaLabelValue)),mi(this.eWrapper,i)}renderSelectedValue(){const{value:e,eDisplayField:t,config:i}=this,{allowTyping:n,initialInputValue:s}=this.config,r=this.config.valueFormatter?this.config.valueFormatter(e):e;if(n)return void this.eInput.setValue(null!=s?s:r);let o,a;if(i.cellRenderer&&(o=this.userComponentFactory.getCellRendererDetails(this.config,{value:e,valueFormatted:r})),o&&(a=o.newAgStackInstance()),a)Cn(t),Hn(a,t),a.then(e=>{this.addDestroyFunc(()=>this.getContext().destroyBean(e))});else{if(b(this.value))t.innerText=r,t.classList.remove("ag-display-as-placeholder");else{const{placeholder:e}=i;b(e)?(t.innerHTML=`${bt(e)}`,t.classList.add("ag-display-as-placeholder")):Cn(t)}this.setTooltip({newTooltipText:null!=r?r:null,shouldDisplayTooltip:()=>this.eDisplayField.scrollWidth>this.eDisplayField.clientWidth})}}getCurrentValueIndex(){const{currentList:e,value:t}=this;if(null==t||!e)return-1;for(let i=0;i<e.length;i++)if(e[i]===t)return i;return-1}highlightFilterMatch(){var e;null==(e=this.listComponent)||e.forEachRenderedRow((e,t)=>{e.highlightString(this.searchString)})}highlightSelectedValue(e){var t;null==e&&(e=this.getCurrentValueIndex()),this.highlightedItem=e,null==(t=this.listComponent)||t.forEachRenderedRow((t,i)=>{const n=-1!==e&&this.highlightedItem===i;t.updateHighlighted(n)})}setRowHeight(e){e!==this.cellRowHeight&&(this.cellRowHeight=e),this.listComponent&&this.listComponent.setRowHeight(e)}createPickerComponent(){const{values:e}=this;return e&&this.setValueList({valueList:e}),this.listComponent}setSearchStringCreator(e){this.searchStringCreator=e}setValueList(e){const{valueList:t,refresh:i}=e;this.listComponent&&this.currentList!==t&&(this.currentList=t,this.listComponent.setModel({getRowCount:()=>t.length,getRow:e=>t[e],areRowsEqual:(e,t)=>e===t}),i&&(this.values?this.listComponent.refresh(!0):(this.values=t,this.isPickerDisplayed&&this.showCurrentValueInPicker())))}showPicker(){super.showPicker(),this.showCurrentValueInPicker(),this.displayOrHidePicker()}showCurrentValueInPicker(){var e,t;if(!this.listComponent)return;if(!this.currentList)return void(this.isPickerDisplayed&&this.eLoading&&this.listComponent.appendChild(this.eLoading));(null==(e=this.eLoading)?void 0:e.offsetParent)&&(null==(t=this.eLoading.parentElement)||t.removeChild(this.eLoading));const i=this.getCurrentValueIndex();-1!==i?(this.listComponent.refresh(),this.listComponent.ensureIndexVisible(i),this.listComponent.refresh(!0),this.highlightSelectedValue(i)):this.listComponent.refresh()}beforeHidePicker(){this.highlightedItem=-1,super.beforeHidePicker()}onWrapperFocus(){if(!this.eInput)return;const e=this.eInput.getFocusableElement();e.focus(),e.select()}onWrapperFocusOut(e){this.eWrapper.contains(e.relatedTarget)||this.hidePicker()}buildSearchStringFromKeyboardEvent(e){let{key:t}=e;if(t===Zn.BACKSPACE)this.searchString=this.searchString.slice(0,-1),t="";else if(!Qn(e))return;e.preventDefault(),this.searchTextFromCharacter(t)}searchTextFromCharacter(e){this.searchString+=e,this.runSearch(),this.clearSearchString()}searchTextFromString(e){null==e&&(e=""),this.searchString=e,this.runSearch()}buildSearchStrings(e){const{valueFormatter:t=e=>e}=this.config;let i;return"number"==typeof e[0]||"string"==typeof e[0]?i=e.map(e=>t(e)):"object"==typeof e[0]&&this.searchStringCreator&&(i=this.searchStringCreator(e)),i}getSuggestionsAndFilteredValues(e,t){let i=[],n=[];if(!e.length)return{suggestions:i,filteredValues:n};const{searchType:s="fuzzy",filterList:r}=this.config;if("fuzzy"===s){const e=Wn(this.searchString,t,!0);i=e.values;const s=e.indices;if(r&&s.length)for(let e=0;e<s.length;e++)n.push(this.values[s[e]])}else i=t.filter((e,t)=>{const i=e.toLocaleLowerCase(),o=this.searchString.toLocaleLowerCase(),a="match"===s?i.startsWith(o):-1!==i.indexOf(o);return r&&a&&n.push(this.values[t]),a});return{suggestions:i,filteredValues:n}}filterListModel(e){const{filterList:t}=this.config;t&&(this.setValueList({valueList:e,refresh:!0}),this.alignPickerToComponent())}runSearch(){var e,t;const{values:i}=this,n=this.buildSearchStrings(i);if(!n)return void this.highlightSelectedValue(-1);const{suggestions:s,filteredValues:r}=this.getSuggestionsAndFilteredValues(this.searchString,n),{filterList:o,highlightMatch:a,searchType:l="fuzzy"}=this.config,c=r.length,h=!(!o||""===this.searchString);if(this.filterListModel(h?r:i),s.length){const e=h?0:n.indexOf(s[0]);this.selectListItem(e)}else if(this.highlightSelectedValue(-1),!h||c)null==(e=this.listComponent)||e.ensureIndexVisible(0);else if(h){this.getAriaElement().removeAttribute("data-active-option");const e=null==(t=this.listComponent)?void 0:t.getAriaElement();e&&ti(e,null)}a&&"fuzzy"!==l&&this.highlightFilterMatch(),this.displayOrHidePicker()}displayOrHidePicker(){var e;const t=null==(e=this.listComponent)?void 0:e.getGui(),i=!!this.currentList&&0===this.currentList.length;null==t||t.classList.toggle("ag-hidden",i)}clearSearchString(){this.searchString=""}selectListItem(e,t){!this.isPickerDisplayed||!this.currentList||!this.listComponent||e<0||e>=this.currentList.length||(this.listComponent.ensureIndexVisible(e,!t)&&!t&&this.listComponent.refresh(!0),this.highlightSelectedValue(e))}setValue(e,t,i){const n=this.currentList?this.currentList.indexOf(e):-1;return-1===n?this:(this.value=e,i||this.selectListItem(n),this.renderSelectedValue(),super.setValue(e,t))}createRowComponent(e){const t=new Yl(this.config,this.eWrapper);t.setParentComponent(this.listComponent),this.getContext().createBean(t),t.setState(e);const{highlightMatch:i,searchType:n="fuzzy"}=this.config;return i&&"fuzzy"!==n&&t.highlightString(this.searchString),t}getRowForMouseEvent(e){const{listComponent:t}=this;if(!t)return-1;const i=(null==t?void 0:t.getGui()).getBoundingClientRect(),n=t.getScrollTop(),s=e.clientY-i.top+n;return Math.floor(s/t.getRowHeight())}onPickerMouseMove(e){if(!this.listComponent)return;const t=this.getRowForMouseEvent(e);-1!==t&&t!=this.lastRowHovered&&(this.lastRowHovered=t,this.selectListItem(t,!0))}onNavigationKeyDown(e,t){e.preventDefault();const i=t===Zn.DOWN;if(!this.isPickerDisplayed&&i)return void this.showPicker();const n=this.highlightedItem,s=-1===n?0:n+(i?1:-1);this.selectListItem(s)}onPageNavigation(e){var t;if(!this.isPickerDisplayed)return;const i=null==(t=this.listComponent)?void 0:t.navigateToPage(e,this.highlightedItem);null!=i&&this.animationFrameService.requestAnimationFrame(()=>{if(!this.isAlive())return null;this.highlightSelectedValue(i)})}onEnterKeyDown(e){this.isPickerDisplayed&&(e.preventDefault(),this.currentList&&this.onListValueSelected(this.currentList[this.highlightedItem],!0))}onTabKeyDown(){this.isPickerDisplayed&&this.currentList&&this.setValue(this.currentList[this.highlightedItem],!1,!0)}onListValueSelected(e,t){this.setValue(e,!1,!0),this.dispatchPickerEvent(e,t),this.hidePicker()}dispatchPickerEvent(e,t){const i={type:ct.EVENT_FIELD_PICKER_VALUE_SELECTED,fromEnterKey:t,value:e};this.dispatchEvent(i)}getFocusableElement(){const{allowTyping:e}=this.config;return e?this.eInput.getFocusableElement():super.getFocusableElement()}onKeyDown(e){const t=e.key,{allowTyping:i}=this.config;switch(t){case Zn.LEFT:case Zn.RIGHT:i||e.preventDefault();break;case Zn.PAGE_HOME:case Zn.PAGE_END:if(i){e.preventDefault();const i=this.eInput.getInputElement(),n=t===Zn.PAGE_HOME?0:i.value.length;i.setSelectionRange(n,n);break}case Zn.PAGE_UP:case Zn.PAGE_DOWN:e.preventDefault(),this.onPageNavigation(t);break;case Zn.DOWN:case Zn.UP:this.onNavigationKeyDown(e,t);break;case Zn.ESCAPE:this.isPickerDisplayed&&(xn(this.listComponent.getGui())&&(e.preventDefault(),qe(e)),this.hidePicker());break;case Zn.ENTER:this.onEnterKeyDown(e);break;case Zn.TAB:this.onTabKeyDown();break;default:i||this.buildSearchStringFromKeyboardEvent(e)}}destroy(){this.listComponent&&(this.destroyBean(this.listComponent),this.listComponent=void 0),this.eLoading=void 0,super.destroy()}};g([ue("userComponentFactory")],Zl.prototype,"userComponentFactory",2),g([ue("animationFrameService")],Zl.prototype,"animationFrameService",2),g([Ss("eInput")],Zl.prototype,"eInput",2);var Ql=class e extends Ns{constructor(t){super(t,e.TEMPLATE),this.labelAlignment="top"}init(){this.eSlider.addCssClass("ag-slider-field");const{minValue:e,maxValue:t,textFieldWidth:i,step:n,value:s,onValueChange:r}=this.config;null!=e&&this.setMinValue(e),null!=t&&this.setMaxValue(t),null!=i&&this.setTextFieldWidth(i),null!=n&&this.setStep(n),null!=s&&this.setValue(s),null!=r&&this.onValueChange(r)}onValueChange(e){const t=ct.EVENT_FIELD_VALUE_CHANGED;return this.addManagedListener(this.eText,t,()=>{const t=parseFloat(this.eText.getValue());this.eSlider.setValue(t.toString(),!0),e(t||0)}),this.addManagedListener(this.eSlider,t,()=>{const t=this.eSlider.getValue();this.eText.setValue(t,!0),e(parseFloat(t))}),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.eText.setValue(e,!0),this.eSlider.setValue(e,!0),t||this.dispatchEvent({type:ct.EVENT_FIELD_VALUE_CHANGED})),this}setStep(e){return this.eSlider.setStep(e),this.eText.setStep(e),this}};Ql.TEMPLATE='<div class="ag-slider">\n            <label ref="eLabel"></label>\n            <div class="ag-wrapper ag-slider-wrapper">\n                <ag-input-range ref="eSlider"></ag-input-range>\n                <ag-input-number-field ref="eText"></ag-input-number-field>\n            </div>\n        </div>',g([Ss("eLabel")],Ql.prototype,"eLabel",2),g([Ss("eSlider")],Ql.prototype,"eSlider",2),g([Ss("eText")],Ql.prototype,"eText",2),g([le],Ql.prototype,"init",1);var Jl=Ql,ec=class e extends Cs{constructor(t={}){super(e.getTemplate(t)),this.params=t,this.suppressEnabledCheckbox=!0,this.suppressToggleExpandOnEnableChange=!1;const{enabled:i,items:n,suppressEnabledCheckbox:s,expanded:r,suppressToggleExpandOnEnableChange:o,useToggle:a}=t;this.cssIdentifier=t.cssIdentifier||"default",this.enabled=null==i||i,this.items=n||[],this.useToggle=null!=a&&a,this.alignItems=t.alignItems||"center",this.expanded=null==r||r,null!=s&&(this.suppressEnabledCheckbox=s),null!=o&&(this.suppressToggleExpandOnEnableChange=o)}static getTemplate(e){const t=e.cssIdentifier||"default";return`\n            <div class="ag-group ag-${t}-group" role="presentation">\n                <div ref="eToolbar" class="ag-group-toolbar ag-${t}-group-toolbar">\n                    <ag-checkbox ref="cbGroupEnabled"></ag-checkbox>\n                </div>\n                <div ref="eContainer" class="ag-group-container ag-group-container-${e.direction||"vertical"} ag-${t}-group-container"></div>\n            </div>\n        `}postConstruct(){if(this.setupTitleBar(),this.items.length){const e=this.items;this.items=[],this.addItems(e)}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:i}=this.params;this.hideEnabledCheckbox(this.suppressEnabledCheckbox),this.hideOpenCloseIcons(null!=i&&i),this.refreshChildDisplay(),an(this.eContainer,this.expanded),this.cbGroupEnabled.onValueChange(e=>{this.setEnabled(e,!0,this.suppressToggleExpandOnEnableChange),this.dispatchEnableChangeEvent(e)}),null!=t&&this.onEnableChange(t)}refreshChildDisplay(){var e;an(this.eToolbar,this.expanded&&!this.suppressEnabledCheckbox),null==(e=this.eTitleBar)||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(t){var i;let n=!1;if((null==(i=this.eTitleBar)?void 0:i.isSuppressCollapse())&&!this.useToggle)t=!0,n=!0;else if(t=null!=t?t:!this.expanded,this.expanded===t)return this;return this.expanded=t,this.refreshChildDisplay(),an(this.eContainer,t),n||this.dispatchEvent({type:t?e.EVENT_EXPANDED:e.EVENT_COLLAPSED}),this}addItems(e){e.forEach(e=>this.addItem(e))}prependItem(e){this.insertItem(e,!0)}addItem(e){this.insertItem(e,!1)}insertItem(e,t){const i=this.eContainer,n=e instanceof Cs?e.getGui():e;n.classList.add("ag-group-item",`ag-${this.cssIdentifier}-group-item`),t?(i.insertAdjacentElement("afterbegin",n),this.items.unshift(n)):(i.appendChild(n),this.items.push(n))}hideItem(e,t){an(this.items[t],!e)}getItemIndex(e){const t=e instanceof Cs?e.getGui():e;return this.items.indexOf(t)}setTitle(e){var t;return null==(t=this.eTitleBar)||t.setTitle(e),this}addTitleBarWidget(e){var t;return null==(t=this.eTitleBar)||t.addWidget(e),this}addCssClassToTitleBar(e){var t;null==(t=this.eTitleBar)||t.addCssClass(e)}dispatchEnableChangeEvent(t){const i={type:e.EVENT_ENABLE_CHANGE,enabled:t};this.dispatchEvent(i)}setEnabled(e,t,i){var n;return this.enabled=e,this.refreshDisabledStyles(),i||this.toggleGroupExpand(e),t||(this.cbGroupEnabled.setValue(e),null==(n=this.eToggle)||n.setValue(e)),this}isEnabled(){return this.enabled}onEnableChange(t){return this.addManagedListener(this,e.EVENT_ENABLE_CHANGE,e=>t(e.enabled)),this}hideEnabledCheckbox(e){return this.suppressEnabledCheckbox=e,this.refreshChildDisplay(),this.refreshDisabledStyles(),this}hideOpenCloseIcons(e){var t;return null==(t=this.eTitleBar)||t.hideOpenCloseIcons(e),this}refreshDisabledStyles(){var e;const t=!this.enabled;this.eContainer.classList.toggle("ag-disabled",t),null==(e=this.eTitleBar)||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 sc(this.params));return this.eTitleBar=e,e.refreshOnExpand(this.expanded),this.addManagedListener(e,sc.EVENT_EXPAND_CHANGED,e=>this.toggleGroupExpand(e.expanded)),e}createToggleTitleBar(){var e;const t=this.createManagedBean(new Wl({value:this.enabled,label:this.params.title,labelAlignment:"left",labelWidth:"flex",onValueChange:e=>{this.setEnabled(e,!0),this.dispatchEnableChangeEvent(e)}}));return t.addCssClass("ag-group-title-bar"),t.addCssClass(`ag-${null!=(e=this.params.cssIdentifier)?e:"default"}-group-title-bar ag-unselectable`),this.eToggle=t,this.toggleGroupExpand(this.enabled),t}};ec.EVENT_EXPANDED="expanded",ec.EVENT_COLLAPSED="collapsed",ec.EVENT_ENABLE_CHANGE="enableChange",g([Ss("eToolbar")],ec.prototype,"eToolbar",2),g([Ss("cbGroupEnabled")],ec.prototype,"cbGroupEnabled",2),g([Ss("eContainer")],ec.prototype,"eContainer",2),g([le],ec.prototype,"postConstruct",1);var tc=ec,ic="ag-disabled-group-title-bar",nc=class e extends Cs{constructor(t={}){super(e.getTemplate(t)),this.suppressOpenCloseIcons=!1;const{title:i,suppressOpenCloseIcons:n}=t;i&&i.length>0&&(this.title=i),null!=n&&(this.suppressOpenCloseIcons=n)}static getTemplate(e){var t;const i=null!=(t=e.cssIdentifier)?t:"default";return`\n            <div class="ag-group-title-bar ag-${i}-group-title-bar ag-unselectable" role="button">\n                <span class="ag-group-title-bar-icon ag-${i}-group-title-bar-icon" ref="eGroupOpenedIcon" role="presentation"></span>\n                <span class="ag-group-title-bar-icon ag-${i}-group-title-bar-icon" ref="eGroupClosedIcon" role="presentation"></span>\n                <span ref="eTitle" class="ag-group-title ag-${i}-group-title"></span>\n            </div>\n        `}postConstruct(){this.setTitle(this.title),this.hideOpenCloseIcons(this.suppressOpenCloseIcons),this.setupExpandContract()}setupExpandContract(){this.eGroupClosedIcon.appendChild(Yn("columnSelectClosed",this.gos,null)),this.eGroupOpenedIcon.appendChild(Yn("columnSelectOpen",this.gos,null)),this.addManagedListener(this.getGui(),"click",()=>this.dispatchExpandChanged()),this.addManagedListener(this.getGui(),"keydown",e=>{switch(e.key){case Zn.ENTER:case Zn.SPACE:e.preventDefault(),this.dispatchExpandChanged();break;case Zn.RIGHT:case Zn.LEFT:e.preventDefault(),this.dispatchExpandChanged(e.key===Zn.RIGHT)}})}refreshOnExpand(e){this.refreshAriaStatus(e),this.refreshOpenCloseIcons(e)}refreshAriaStatus(e){this.suppressOpenCloseIcons||ii(this.getGui(),e)}refreshOpenCloseIcons(e){const t=!this.suppressOpenCloseIcons;an(this.eGroupOpenedIcon,t&&e),an(this.eGroupClosedIcon,t&&!e)}isSuppressCollapse(){return this.suppressOpenCloseIcons}dispatchExpandChanged(t){const i={type:e.EVENT_EXPAND_CHANGED,expanded:t};this.dispatchEvent(i)}setTitle(e){const t=this.getGui(),i=!!e&&e.length>0;e=i?e:void 0,this.eTitle.textContent=null!=e?e:"",an(t,i),e!==this.title&&(this.title=e);const n=t.classList.contains(ic);return this.refreshDisabledStyles(n),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(ic),t.removeAttribute("tabindex")):(t.classList.remove(ic),"string"==typeof this.title?t.setAttribute("tabindex","0"):t.removeAttribute("tabindex"))}};nc.EVENT_EXPAND_CHANGED="expandedChanged",g([Ss("eGroupOpenedIcon")],nc.prototype,"eGroupOpenedIcon",2),g([Ss("eGroupClosedIcon")],nc.prototype,"eGroupClosedIcon",2),g([Ss("eTitle")],nc.prototype,"eTitle",2),g([le],nc.prototype,"postConstruct",1);var sc=nc,rc=class extends El{constructor(e=0,t){super('<div class="ag-menu-list" role="tree"></div>'),this.level=e,this.menuItems=[],this.params=null!=t?t:{column:null,node:null,value:null}}postConstruct(){this.initialiseTabGuard({onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e),onFocusIn:e=>this.handleFocusIn(e),onFocusOut:e=>this.handleFocusOut(e)})}onTabKeyDown(e){const t=this.getParentComponent(),i=t&&t.getGui();i&&i.classList.contains("ag-focus-managed")||e.preventDefault(),e.shiftKey&&this.closeIfIsChild(e)}handleKeyDown(e){switch(e.key){case Zn.UP:case Zn.RIGHT:case Zn.DOWN:case Zn.LEFT:e.preventDefault(),this.handleNavKey(e.key);break;case Zn.ESCAPE:this.closeIfIsChild()&&qe(e)}}handleFocusIn(e){var t,i;const n=e.relatedTarget;(this.tabGuardCtrl.isTabGuard(n)||!this.getGui().contains(n)&&!(null==(i=null==(t=this.activeMenuItem)?void 0:t.getSubMenuGui())?void 0:i.contains(n)))&&(this.activeMenuItem?this.activeMenuItem.activate():this.activateFirstItem())}handleFocusOut(e){var t;const i=e.relatedTarget;!this.activeMenuItem||this.getGui().contains(i)||(null==(t=this.activeMenuItem.getSubMenuGui())?void 0:t.contains(i))||this.activeMenuItem.isSubMenuOpening()||this.activeMenuItem.deactivate()}clearActiveItem(){this.activeMenuItem&&(this.activeMenuItem.deactivate(),this.activeMenuItem=null)}addMenuItems(e){null!=e&&ds.all(e.map(e=>"separator"===e?ds.resolve({eGui:this.createSeparator()}):"string"==typeof e?(console.warn(`AG Grid: unrecognised menu item ${e}`),ds.resolve({eGui:null})):this.addItem(e))).then(e=>{e.forEach(e=>{(null==e?void 0:e.eGui)&&(this.appendChild(e.eGui),e.comp&&this.menuItems.push(e.comp))})})}addItem(e){const t=this.createManagedBean(new lc);return t.init({menuItemDef:e,isAnotherSubMenuOpen:()=>this.menuItems.some(e=>e.isSubMenuOpen()),level:this.level,contextParams:this.params}).then(()=>(t.setParentComponent(this),this.addManagedListener(t,lc.EVENT_CLOSE_MENU,e=>{this.dispatchEvent(e)}),this.addManagedListener(t,lc.EVENT_MENU_ITEM_ACTIVATED,e=>{this.activeMenuItem&&this.activeMenuItem!==e.menuItem&&this.activeMenuItem.deactivate(),this.activeMenuItem=e.menuItem}),{comp:t,eGui:t.getGui()}))}activateFirstItem(){const e=this.menuItems.filter(e=>!e.isDisabled())[0];e&&e.activate()}createSeparator(){return En('\n            <div class="ag-menu-separator" aria-hidden="true">\n                <div class="ag-menu-separator-part"></div>\n                <div class="ag-menu-separator-part"></div>\n                <div class="ag-menu-separator-part"></div>\n                <div class="ag-menu-separator-part"></div>\n            </div>')}handleNavKey(e){switch(e){case Zn.UP:case Zn.DOWN:const t=this.findNextItem(e===Zn.UP);return void(t&&t!==this.activeMenuItem&&t.activate())}e===(this.gos.get("enableRtl")?Zn.RIGHT:Zn.LEFT)?this.closeIfIsChild():this.openChild()}closeIfIsChild(e){const t=this.getParentComponent();return!!(t&&t instanceof lc)&&(e&&e.preventDefault(),t.closeSubMenu(),t.getGui().focus(),!0)}openChild(){this.activeMenuItem&&this.activeMenuItem.openSubMenu(!0)}findNextItem(e){const t=this.menuItems.filter(e=>!e.isDisabled());if(!t.length)return;if(!this.activeMenuItem)return e?Ie(t):t[0];let i;e&&t.reverse();let n=!1;for(let e=0;e<t.length;e++){const s=t[e];if(n){i=s;break}s===this.activeMenuItem&&(n=!0)}return n&&!i?t[0]:i||this.activeMenuItem}destroy(){this.clearActiveItem(),super.destroy()}};g([ue("focusService")],rc.prototype,"focusService",2),g([le],rc.prototype,"postConstruct",1);var oc=class extends El{constructor(e){super(),this.wrappedComponent=e,this.setTemplateFromElement(e.getGui())}postConstruct(){this.initialiseTabGuard({onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e)})}handleKeyDown(e){e.key===Zn.ESCAPE&&this.closePanel()}onTabKeyDown(e){e.defaultPrevented||(this.closePanel(),e.preventDefault())}closePanel(){const e=this.parentComponent;e.closeSubMenu(),setTimeout(()=>e.getGui().focus(),0)}};g([le],oc.prototype,"postConstruct",1);var ac=class e extends st{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,i;const{menuItemDef:n,isAnotherSubMenuOpen:s,level:r,childComponent:o,contextParams:a}=e;return this.params=e.menuItemDef,this.level=r,this.isAnotherSubMenuOpen=s,this.childComponent=o,this.contextParams=a,this.cssClassPrefix=null!=(i=null==(t=this.params.menuItemParams)?void 0:t.cssClassPrefix)?i:"ag-menu-option",this.userComponentFactory.getMenuItemCompDetails(this.params,d(u({},n),{level:r,isAnotherSubMenuOpen:s,openSubMenu:e=>this.openSubMenu(e),closeSubMenu:()=>this.closeSubMenu(),closeMenu:e=>this.closeMenu(e),updateTooltip:(e,t)=>this.refreshTooltip(e,t),onItemActivated:()=>this.onItemActivated()})).newAgStackInstance().then(e=>{var t;this.menuItemComp=e;const i=null==(t=e.configureDefaults)?void 0:t.call(e);i&&this.configureDefaults(!0===i?void 0:i)})}addListeners(e,t){(null==t?void 0:t.suppressClick)||this.addManagedListener(e,"click",e=>this.onItemSelected(e)),(null==t?void 0:t.suppressKeyboardSelect)||this.addManagedListener(e,"keydown",e=>{e.key!==Zn.ENTER&&e.key!==Zn.SPACE||(e.preventDefault(),this.onItemSelected(e))}),(null==t?void 0:t.suppressMouseDown)||this.addManagedListener(e,"mousedown",e=>{e.stopPropagation(),e.preventDefault()}),(null==t?void 0:t.suppressMouseOver)||(this.addManagedListener(e,"mouseenter",()=>this.onMouseEnter()),this.addManagedListener(e,"mouseleave",()=>this.onMouseLeave()))}isDisabled(){return!!this.params.disabled}openSubMenu(t=!1){var i,n;if(this.closeSubMenu(),!this.params.subMenu)return;this.subMenuIsOpening=!0;const s=En('<div class="ag-menu" role="presentation"></div>');let r;this.eSubMenuGui=s;let o=()=>{this.subMenuIsOpening=!1};if(this.childComponent){const e=this.createBean(new oc(this.childComponent));e.setParentComponent(this);const t=e.getGui(),i="mouseenter",n=()=>this.cancelDeactivate();t.addEventListener(i,n),r=()=>t.removeEventListener(i,n),s.appendChild(t),this.childComponent.afterGuiAttached&&(o=()=>{this.childComponent.afterGuiAttached(),this.subMenuIsOpening=!1})}else if(this.params.subMenu){const i=this.createBean(new rc(this.level+1,this.contextParams));i.setParentComponent(this),i.addMenuItems(this.params.subMenu),s.appendChild(i.getGui()),this.addManagedListener(i,e.EVENT_CLOSE_MENU,e=>this.dispatchEvent(e)),i.addGuiEventListener("mouseenter",()=>this.cancelDeactivate()),r=()=>this.destroyBean(i),t&&(o=()=>{i.activateFirstItem(),this.subMenuIsOpening=!1})}const a=this.popupService.positionPopupForMenu.bind(this.popupService,{eventSource:this.eGui,ePopup:s}),l=this.localeService.getLocaleTextFunc(),c=this.popupService.addPopup({modal:!0,eChild:s,positionCallback:a,anchorToElement:this.eGui,ariaLabel:l("ariaLabelSubMenu","SubMenu"),afterGuiAttached:o});this.subMenuIsOpen=!0,this.setAriaExpanded(!0),this.hideSubMenu=()=>{var e,t;c&&c.hideFunc(),this.subMenuIsOpen=!1,this.setAriaExpanded(!1),r(),null==(t=(e=this.menuItemComp).setExpanded)||t.call(e,!1),this.eSubMenuGui=void 0},null==(n=(i=this.menuItemComp).setExpanded)||n.call(i,!0)}setAriaExpanded(e){this.suppressAria||ii(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,i;this.cancelActivate(),this.params.disabled||(this.isActive=!0,this.suppressRootStyles||this.eGui.classList.add(`${this.cssClassPrefix}-active`),null==(i=(t=this.menuItemComp).setActive)||i.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`),null==(t=(e=this.menuItemComp).setActive)||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,i;null==(i=(t=this.menuItemComp).select)||i.call(t),this.params.action?this.getFrameworkOverrides().wrapOutgoing(()=>this.params.action(this.gos.addGridCommonParams(u({},this.contextParams)))):this.openSubMenu(e&&"keydown"===e.type),this.params.subMenu&&!this.params.action||this.params.suppressCloseOnSelect||this.closeMenu(e)}closeMenu(t){const i={type:e.EVENT_CLOSE_MENU};t&&(t instanceof MouseEvent?i.mouseEvent=t:i.keyboardEvent=t),this.dispatchEvent(i)}onItemActivated(){const t={type:e.EVENT_MENU_ITEM_ACTIVATED,menuItem:this};this.dispatchEvent(t)}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),e.ACTIVATION_DELAY):this.activate(!0)}onMouseLeave(){this.cancelActivate(),this.isSubMenuOpen()?this.deactivateTimeoutId=window.setTimeout(()=>this.deactivate(),e.ACTIVATION_DELAY):this.deactivate()}configureDefaults(e){var t,i,n;if(!this.menuItemComp)return void setTimeout(()=>this.configureDefaults(e));let s=this.menuItemComp.getGui();const r=null==(i=(t=this.menuItemComp).getRootElement)?void 0:i.call(t);r&&((null==e?void 0:e.suppressRootStyles)||s.classList.add("ag-menu-option-custom"),s=r),this.eGui=s,this.suppressRootStyles=!!(null==e?void 0:e.suppressRootStyles),this.suppressRootStyles||(s.classList.add(this.cssClassPrefix),null==(n=this.params.cssClasses)||n.forEach(e=>s.classList.add(e)),this.params.disabled&&s.classList.add(`${this.cssClassPrefix}-disabled`)),(null==e?void 0:e.suppressTooltip)||this.refreshTooltip(this.params.tooltip),this.suppressAria=!!(null==e?void 0:e.suppressAria),this.suppressAria||(Ht(s,"treeitem"),Qt(s,this.level+1),this.params.disabled&&Jt(s,!0)),(null==e?void 0:e.suppressTabIndex)||s.setAttribute("tabindex","-1"),this.params.disabled||this.addListeners(s,e),this.suppressFocus=!!(null==e?void 0:e.suppressFocus)}refreshTooltip(e,t){this.tooltip=e,this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),e&&this.menuItemComp&&(this.tooltipFeature=this.createBean(new ys({getGui:()=>this.getGui(),getTooltipValue:()=>this.tooltip,getLocation:()=>"menu",shouldDisplayTooltip:t})))}destroy(){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),super.destroy()}};ac.EVENT_CLOSE_MENU="closeMenu",ac.EVENT_MENU_ITEM_ACTIVATED="menuItemActivated",ac.ACTIVATION_DELAY=80,g([ue("popupService")],ac.prototype,"popupService",2),g([ue("userComponentFactory")],ac.prototype,"userComponentFactory",2);var lc=ac,cc=class e extends Cs{constructor(t){super(e.getTemplate(t)),this.config=t,this.closable=!0}static getTemplate(e){const t=e.cssIdentifier||"default";return`<div class="ag-panel ag-${t}-panel" tabindex="-1">\n            <div ref="eTitleBar" class="ag-panel-title-bar ag-${t}-panel-title-bar ag-unselectable">\n                <span ref="eTitle" class="ag-panel-title-bar-title ag-${t}-panel-title-bar-title"></span>\n                <div ref="eTitleBarButtons" class="ag-panel-title-bar-buttons ag-${t}-panel-title-bar-buttons"></div>\n            </div>\n            <div ref="eContentWrapper" class="ag-panel-content-wrapper ag-${t}-panel-content-wrapper"></div>\n        </div>`}postConstruct(){const{component:e,closable:t,hideTitleBar:i,title:n,minWidth:s=250,width:r,minHeight:o=250,height:a,centered:l,popup:c,x:h,y:u}=this.config;this.positionableFeature=new Ps(this.getGui(),{minWidth:s,width:r,minHeight:o,height:a,centered:l,x:h,y:u,popup:c,calculateTopBuffer:()=>this.positionableFeature.getHeight()-this.getBodyHeight()}),this.createManagedBean(this.positionableFeature);const d=this.getGui();e&&this.setBodyComponent(e),i?an(this.eTitleBar,!1):(n&&this.setTitle(n),this.setClosable(null!=t?t:this.closable)),this.addManagedListener(this.eTitleBar,"mousedown",e=>{if(d.contains(e.relatedTarget)||d.contains(this.gos.getActiveDomElement())||this.eTitleBarButtons.contains(e.target))return void e.preventDefault();const t=this.eContentWrapper.querySelector("button, [href], input, select, textarea, [tabindex]");t&&t.focus()}),c&&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(t){if(t!==this.closable&&(this.closable=t),t){const t=this.closeButtonComp=new Cs(e.CLOSE_BTN_TEMPLATE);this.getContext().createBean(t);const i=t.getGui(),n=qn("close",this.gos);n.classList.add("ag-panel-title-bar-button-icon"),i.appendChild(n),this.addTitleBarButton(t),t.addManagedListener(i,"click",this.onBtClose.bind(this))}else if(this.closeButtonComp){const e=this.closeButtonComp.getGui();e.parentElement.removeChild(e),this.closeButtonComp=this.destroyBean(this.closeButtonComp)}}setBodyComponent(e){e.setParentComponent(this),this.eContentWrapper.appendChild(e.getGui())}addTitleBarButton(e,t){const i=this.eTitleBarButtons,n=i.children,s=n.length;null==t&&(t=s),t=Math.max(0,Math.min(t,s)),e.addCssClass("ag-panel-title-bar-button");const r=e.getGui();0===t?i.insertAdjacentElement("afterbegin",r):t===s?i.insertAdjacentElement("beforeend",r):n[t-1].insertAdjacentElement("afterend",r),e.setParentComponent(this)}getBodyHeight(){return dn(this.eContentWrapper)}getBodyWidth(){return pn(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&&xn(e)&&this.close(),super.destroy()}};cc.CLOSE_BTN_TEMPLATE='<div class="ag-button"></div>',g([Ss("eContentWrapper")],cc.prototype,"eContentWrapper",2),g([Ss("eTitleBar")],cc.prototype,"eTitleBar",2),g([Ss("eTitleBarButtons")],cc.prototype,"eTitleBarButtons",2),g([Ss("eTitle")],cc.prototype,"eTitle",2),g([le],cc.prototype,"postConstruct",1);var hc=cc,uc=class extends hc{constructor(e){super(d(u({},e),{popup:!0})),this.isMaximizable=!1,this.isMaximized=!1,this.maximizeListeners=[],this.resizeListenerDestroy=null,this.lastPosition={x:0,y:0,width:0,height:0}}postConstruct(){const e=this.getGui(),{movable:t,resizable:i,maximizable:n}=this.config;this.addCssClass("ag-dialog"),super.postConstruct(),this.addManagedListener(e,"focusin",t=>{this.popupService.bringPopupToFront(e)}),t&&this.setMovable(t),n&&this.setMaximizable(n),i&&this.setResizable(i)}renderComponent(){const e=this.getGui(),{alwaysOnTop:t,modal:i,title:n,afterGuiAttached:s}=this.config,r=this.localeService.getLocaleTextFunc(),o=this.popupService.addPopup({modal:i,eChild:e,closeOnEsc:!0,closedCallback:this.onClosed.bind(this),alwaysOnTop:t,ariaLabel:n||r("ariaLabelDialog","Dialog"),afterGuiAttached:s});o&&(this.close=o.hideFunc)}onClosed(e){var t,i;this.destroy(),null==(i=(t=this.config).closedCallback)||i.call(t,e)}toggleMaximize(){const e=this.positionableFeature.getPosition();if(this.isMaximized){const{x:e,y:t,width:i,height:n}=this.lastPosition;this.setWidth(i),this.setHeight(n),this.positionableFeature.offsetElement(e,t)}else this.lastPosition.width=this.getWidth(),this.lastPosition.height=this.getHeight(),this.lastPosition.x=e.x,this.lastPosition.y=e.y,this.positionableFeature.offsetElement(0,0),this.setHeight("100%"),this.setWidth("100%");this.isMaximized=!this.isMaximized,this.refreshMaximizeIcon()}refreshMaximizeIcon(){an(this.maximizeIcon,!this.isMaximized),an(this.minimizeIcon,this.isMaximized)}clearMaximizebleListeners(){this.maximizeListeners.length&&(this.maximizeListeners.forEach(e=>e()),this.maximizeListeners.length=0),this.resizeListenerDestroy&&(this.resizeListenerDestroy(),this.resizeListenerDestroy=null)}destroy(){this.maximizeButtonComp=this.destroyBean(this.maximizeButtonComp),this.clearMaximizebleListeners(),super.destroy()}setResizable(e){this.positionableFeature.setResizable(e)}setMovable(e){this.positionableFeature.setMovable(e,this.eTitleBar)}setMaximizable(e){if(!e)return this.clearMaximizebleListeners(),void(this.maximizeButtonComp&&(this.destroyBean(this.maximizeButtonComp),this.maximizeButtonComp=this.maximizeIcon=this.minimizeIcon=void 0));const t=this.eTitleBar;if(!t||e===this.isMaximizable)return;const i=this.buildMaximizeAndMinimizeElements();this.refreshMaximizeIcon(),i.addManagedListener(i.getGui(),"click",this.toggleMaximize.bind(this)),this.addTitleBarButton(i,0),this.maximizeListeners.push(this.addManagedListener(t,"dblclick",this.toggleMaximize.bind(this))),this.resizeListenerDestroy=this.addManagedListener(this,"resize",()=>{this.isMaximized=!1,this.refreshMaximizeIcon()})}buildMaximizeAndMinimizeElements(){const e=this.maximizeButtonComp=this.createBean(new Cs('<div class="ag-dialog-button"></span>')),t=e.getGui();return this.maximizeIcon=qn("maximize",this.gos),t.appendChild(this.maximizeIcon),this.maximizeIcon.classList.add("ag-panel-title-bar-button-icon"),this.minimizeIcon=qn("minimize",this.gos),t.appendChild(this.minimizeIcon),this.minimizeIcon.classList.add("ag-panel-title-bar-button-icon"),e}};g([ue("popupService")],uc.prototype,"popupService",2);var dc=0,pc=class extends st{constructor(){super(...arguments),this.popupList=[]}postConstruct(){this.ctrlsService.whenReady(e=>{this.gridCtrl=e.gridCtrl}),this.addManagedListener(this.eventService,ct.EVENT_GRID_STYLES_CHANGED,this.handleThemeChange.bind(this))}getPopupParent(){return this.gos.get("popupParent")||this.gridCtrl.getGui()}positionPopupForMenu(e){const{eventSource:t,ePopup:i}=e,n=this.getPopupIndex(i);-1!==n&&(this.popupList[n].alignedToElement=t);const s=t.getBoundingClientRect(),r=this.getParentRect(),o=this.keepXYWithinBounds(i,s.top-r.top,0),a=i.clientWidth>0?i.clientWidth:200;i.style.minWidth=`${a}px`;const l=r.right-r.left-a;let c;function h(){return s.right-r.left-2}function u(){return s.left-r.left-a}this.gos.get("enableRtl")?(c=u(),c<0&&(c=h(),this.setAlignedStyles(i,"left")),c>l&&(c=0,this.setAlignedStyles(i,"right"))):(c=h(),c>l&&(c=u(),this.setAlignedStyles(i,"right")),c<0&&(c=0,this.setAlignedStyles(i,"left"))),i.style.left=`${c}px`,i.style.top=`${o}px`}positionPopupUnderMouseEvent(e){const{ePopup:t,nudgeX:i,nudgeY:n,skipObserver:s}=e;this.positionPopup({ePopup:t,nudgeX:i,nudgeY:n,keepWithinBounds:!0,skipObserver:s,updatePosition:()=>this.calculatePointerAlign(e.mouseEvent),postProcessCallback:()=>this.callPostProcessPopup(e.type,e.ePopup,null,e.mouseEvent,e.column,e.rowNode)})}calculatePointerAlign(e){const t=this.getParentRect();return{x:e.clientX-t.left,y:e.clientY-t.top}}positionPopupByComponent(e){const{ePopup:t,nudgeX:i,nudgeY:n,keepWithinBounds:s,eventSource:r,alignSide:o="left",position:a="over",column:l,rowNode:c,type:h}=e,u=r.getBoundingClientRect(),d=this.getParentRect(),p=this.getPopupIndex(t);-1!==p&&(this.popupList[p].alignedToElement=r),this.positionPopup({ePopup:t,nudgeX:i,nudgeY:n,keepWithinBounds:s,updatePosition:()=>{let i,s=u.left-d.left;return"right"===o&&(s-=t.offsetWidth-u.width),"over"===a?(i=u.top-d.top,this.setAlignedStyles(t,"over")):(this.setAlignedStyles(t,"under"),i="under"===this.shouldRenderUnderOrAbove(t,u,d,e.nudgeY||0)?u.top-d.top+u.height:u.top-t.offsetHeight-2*(n||0)-d.top),{x:s,y:i}},postProcessCallback:()=>this.callPostProcessPopup(h,t,r,null,l,c)})}shouldRenderUnderOrAbove(e,t,i,n){const s=i.bottom-t.bottom,r=t.top-i.top,o=e.offsetHeight+n;return s>o?"under":r>o||r>s?"above":"under"}setAlignedStyles(e,t){const i=this.getPopupIndex(e);if(-1===i)return;const n=this.popupList[i],{alignedToElement:s}=n;s&&(["right","left","over","above","under"].forEach(t=>{s.classList.remove(`ag-has-popup-positioned-${t}`),e.classList.remove(`ag-popup-positioned-${t}`)}),t&&(s.classList.add(`ag-has-popup-positioned-${t}`),e.classList.add(`ag-popup-positioned-${t}`)))}callPostProcessPopup(e,t,i,n,s,r){const o=this.gos.getCallback("postProcessPopup");o&&o({column:s,rowNode:r,ePopup:t,type:e,eventSource:i,mouseEvent:n})}positionPopup(e){const{ePopup:t,keepWithinBounds:i,nudgeX:n,nudgeY:s,skipObserver:r,updatePosition:o}=e,a={width:0,height:0},l=(r=!1)=>{let{x:l,y:c}=o();r&&t.clientWidth===a.width&&t.clientHeight===a.height||(a.width=t.clientWidth,a.height=t.clientHeight,n&&(l+=n),s&&(c+=s),i&&(l=this.keepXYWithinBounds(t,l,1),c=this.keepXYWithinBounds(t,c,0)),t.style.left=`${l}px`,t.style.top=`${c}px`,e.postProcessCallback&&e.postProcessCallback())};if(l(),!r){const e=this.resizeObserverService.observeResize(t,()=>l(!0));setTimeout(()=>e(),pc.WAIT_FOR_POPUP_CONTENT_RESIZE)}}getActivePopups(){return this.popupList.map(e=>e.element)}getPopupList(){return this.popupList}getParentRect(){const e=this.gos.getDocument();let t=this.getPopupParent();return t===e.body?t=e.documentElement:"static"===getComputedStyle(t).position&&(t=t.offsetParent),mn(t)}keepXYWithinBounds(e,t,i){const n=0===i,s=n?"clientHeight":"clientWidth",r=n?"top":"left",o=n?"offsetHeight":"offsetWidth",a=n?"scrollTop":"scrollLeft",l=this.gos.getDocument(),c=l.documentElement,h=this.getPopupParent(),u=h.getBoundingClientRect(),d=l.documentElement.getBoundingClientRect(),p=h===l.body,g=e[o];let f=p?(n?gn:fn)(c)+c[a]:h[s];p&&(f-=Math.abs(d[r]-u[r]));const m=f-g;return Math.min(Math.max(t,0),Math.abs(m))}addPopup(e){const t=this.gos.getDocument(),{eChild:i,ariaLabel:n,alwaysOnTop:s,positionCallback:r,anchorToElement:o}=e;if(!t)return console.warn("AG Grid: could not find the document, document is empty"),{hideFunc:()=>{}};const a=this.getPopupIndex(i);if(-1!==a)return{hideFunc:this.popupList[a].hideFunc};this.initialisePopupPosition(i);const l=this.createPopupWrapper(i,n,!!s),c=this.addEventListenersToPopup(d(u({},e),{wrapperEl:l}));return r&&r(),this.addPopupToPopupList(i,l,c,o),{hideFunc:c}}initialisePopupPosition(e){const t=this.getPopupParent().getBoundingClientRect();b(e.style.top)||(e.style.top=-1*t.top+"px"),b(e.style.left)||(e.style.left=-1*t.left+"px")}createPopupWrapper(e,t,i){const n=this.getPopupParent(),s=document.createElement("div"),{allThemes:r}=this.environment.getTheme();return r.length&&s.classList.add(...r),s.classList.add("ag-popup"),e.classList.add(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr","ag-popup-child"),e.hasAttribute("role")||Ht(e,"dialog"),$t(e,t),s.appendChild(e),n.appendChild(s),i?this.setAlwaysOnTop(e,!0):this.bringPopupToFront(e),s}handleThemeChange(){const{allThemes:e}=this.environment.getTheme();for(const t of this.popupList){for(const e of Array.from(t.wrapper.classList))e.startsWith("ag-theme-")&&t.wrapper.classList.remove(e);e.length&&t.wrapper.classList.add(...e)}}addEventListenersToPopup(e){const t=this.gos.getDocument(),i=this.getPopupParent(),{wrapperEl:n,eChild:s,closedCallback:r,afterGuiAttached:o,closeOnEsc:a,modal:l}=e;let c=!1;const h=e=>{n.contains(this.gos.getActiveDomElement())&&(e.key!==Zn.ESCAPE||Xe(e)||p({keyboardEvent:e}))},u=e=>p({mouseEvent:e}),d=e=>p({touchEvent:e}),p=(e={})=>{const{mouseEvent:o,touchEvent:a,keyboardEvent:l,forceHide:p}=e;(p||!this.isEventFromCurrentPopup({mouseEvent:o,touchEvent:a},s)&&!c)&&(c=!0,i.removeChild(n),t.removeEventListener("keydown",h),t.removeEventListener("mousedown",u),t.removeEventListener("touchstart",d),t.removeEventListener("contextmenu",u),this.eventService.removeEventListener(ct.EVENT_DRAG_STARTED,u),r&&r(o||a||l),this.removePopupFromPopupList(s))};return o&&o({hidePopup:p}),window.setTimeout(()=>{a&&t.addEventListener("keydown",h),l&&(t.addEventListener("mousedown",u),this.eventService.addEventListener(ct.EVENT_DRAG_STARTED,u),t.addEventListener("touchstart",d),t.addEventListener("contextmenu",u))},0),p}addPopupToPopupList(e,t,i,n){this.popupList.push({element:e,wrapper:t,hideFunc:i,instanceId:dc++,isAnchored:!!n}),n&&this.setPopupPositionRelatedToElement(e,n)}getPopupIndex(e){return this.popupList.findIndex(t=>t.element===e)}setPopupPositionRelatedToElement(e,t){const i=this.getPopupIndex(e);if(-1===i)return;const n=this.popupList[i];if(n.stopAnchoringPromise&&n.stopAnchoringPromise.then(e=>e&&e()),n.stopAnchoringPromise=void 0,n.isAnchored=!1,!t)return;const s=this.keepPopupPositionedRelativeTo({element:t,ePopup:e,hidePopup:n.hideFunc});return n.stopAnchoringPromise=s,n.isAnchored=!0,s}removePopupFromPopupList(e){this.setAlignedStyles(e,null),this.setPopupPositionRelatedToElement(e,null),this.popupList=this.popupList.filter(t=>t.element!==e)}keepPopupPositionedRelativeTo(e){const t=this.getPopupParent(),i=t.getBoundingClientRect(),{element:n,ePopup:s}=e,r=n.getBoundingClientRect(),o=i.top-r.top,a=i.left-r.left;let l=o,c=a;const h=s.style.top,u=parseInt(h.substring(0,h.length-1),10),d=s.style.left,p=parseInt(d.substring(0,d.length-1),10);return new ds(i=>{this.getFrameworkOverrides().setInterval(()=>{const i=t.getBoundingClientRect(),r=n.getBoundingClientRect();if(0==r.top&&0==r.left&&0==r.height&&0==r.width)return void e.hidePopup();const h=i.top-r.top;if(h!=l){const e=this.keepXYWithinBounds(s,u+o-h,0);s.style.top=`${e}px`}l=h;const d=i.left-r.left;if(d!=c){const e=this.keepXYWithinBounds(s,p+a-d,1);s.style.left=`${e}px`}c=d},200).then(e=>{i(()=>{null!=e&&window.clearInterval(e)})})})}hasAnchoredPopup(){return this.popupList.some(e=>e.isAnchored)}isEventFromCurrentPopup(e,t){const{mouseEvent:i,touchEvent:n}=e,s=i||n;if(!s)return!1;const r=this.getPopupIndex(t);if(-1===r)return!1;for(let e=r;e<this.popupList.length;e++)if(Je(this.popupList[e].element,s))return!0;return this.isElementWithinCustomPopup(s.target)}isElementWithinCustomPopup(e){const t=this.gos.getDocument();for(;e&&e!==t.body;){if(e.classList.contains("ag-custom-component-popup")||null===e.parentElement)return!0;e=e.parentElement}return!1}getWrapper(e){for(;!e.classList.contains("ag-popup")&&e.parentElement;)e=e.parentElement;return e.classList.contains("ag-popup")?e:null}setAlwaysOnTop(e,t){const i=this.getWrapper(e);i&&(i.classList.toggle("ag-always-on-top",!!t),t&&this.bringPopupToFront(i))}bringPopupToFront(e){const t=this.getPopupParent(),i=Array.prototype.slice.call(t.querySelectorAll(".ag-popup")),n=i.length,s=Array.prototype.slice.call(t.querySelectorAll(".ag-popup.ag-always-on-top")),r=s.length,o=this.getWrapper(e);if(!o||n<=1||!t.contains(e))return;const a=i.indexOf(o),l=o.querySelectorAll("div"),c=[];for(l.forEach(e=>{0!==e.scrollTop&&c.push([e,e.scrollTop])}),r?o.classList.contains("ag-always-on-top")?a!==n-1&&Ie(s).insertAdjacentElement("afterend",o):a!==n-r-1&&s[0].insertAdjacentElement("beforebegin",o):a!==n-1&&Ie(i).insertAdjacentElement("afterend",o);c.length;){const e=c.pop();e[0].scrollTop=e[1]}}};pc.WAIT_FOR_POPUP_CONTENT_RESIZE=200,g([ue("focusService")],pc.prototype,"focusService",2),g([ue("ctrlsService")],pc.prototype,"ctrlsService",2),g([ue("resizeObserverService")],pc.prototype,"resizeObserverService",2),g([le],pc.prototype,"postConstruct",1),pc=g([he("popupService")],pc);var gc=class extends Cs{constructor(){super('\n        <div class="ag-autocomplete-row" role="presentation">\n            <div class="ag-autocomplete-row-label"></div>\n        </div>'),this.hasHighlighting=!1}setState(e,t){this.value=e,this.render(),this.updateSelected(t)}updateSelected(e){this.addOrRemoveCssClass("ag-autocomplete-row-selected",e)}setSearchString(e){var t;let i=!1;if(b(e)){const n=null==(t=this.value)?void 0:t.toLocaleLowerCase().indexOf(e.toLocaleLowerCase());if(n>=0){i=!0,this.hasHighlighting=!0;const t=n+e.length,s=bt(this.value.slice(0,n)),r=bt(this.value.slice(n,t)),o=bt(this.value.slice(t));this.getGui().lastElementChild.innerHTML=`${s}<b>${r}</b>${o}`}}!i&&this.hasHighlighting&&(this.hasHighlighting=!1,this.render())}render(){var e;this.getGui().lastElementChild.innerHTML=null!=(e=bt(this.value))?e:"&nbsp;"}},fc=class e extends Er{constructor(t){super(e.TEMPLATE),this.params=t,this.searchString=""}destroy(){super.destroy()}init(){this.autocompleteEntries=this.params.autocompleteEntries,this.virtualList=this.createManagedBean(new Xl({cssIdentifier:"autocomplete"})),this.virtualList.setComponentCreator(this.createRowComponent.bind(this)),this.eList.appendChild(this.virtualList.getGui()),this.virtualList.setModel({getRowCount:()=>this.autocompleteEntries.length,getRow:e=>this.autocompleteEntries[e]});const e=this.virtualList.getGui();this.addManagedListener(e,"click",()=>this.params.onConfirmed()),this.addManagedListener(e,"mousemove",this.onMouseMove.bind(this)),this.addManagedListener(e,"mousedown",e=>e.preventDefault()),this.setSelectedValue(0)}onNavigationKeyDown(e,t){e.preventDefault();const i=this.autocompleteEntries.indexOf(this.selectedValue),n=t===Zn.UP?i-1:i+1;this.checkSetSelectedValue(n)}setSearch(e){this.searchString=e,b(e)?this.runSearch():(this.autocompleteEntries=this.params.autocompleteEntries,this.virtualList.refresh(),this.checkSetSelectedValue(0)),this.updateSearchInList()}runContainsSearch(e,t){let i,n=!1;const s=e.toLocaleLowerCase(),r=t.filter(e=>{const t=e.toLocaleLowerCase().indexOf(s),r=0===t,o=t>=0;return o&&(!i||!n&&r||n===r&&e.length<i.length)&&(i=e,n=r),o});return!i&&r.length&&(i=r[0]),{topMatch:i,allMatches:r}}runSearch(){var e,t;const{autocompleteEntries:i}=this.params,n=i.map(e=>{var t;return null!=(t=e.displayValue)?t:e.key});let s,r;if(this.params.useFuzzySearch)s=Wn(this.searchString,n,!0).values,r=s.length?s[0]:void 0;else{const e=this.runContainsSearch(this.searchString,n);s=e.allMatches,r=e.topMatch}let o=i.filter(({key:e,displayValue:t})=>s.includes(null!=t?t:e));if(!o.length&&this.selectedValue&&(null==(t=null==(e=this.params)?void 0:e.forceLastSelection)?void 0:t.call(e,this.selectedValue,this.searchString))&&(o=[this.selectedValue]),this.autocompleteEntries=o,this.virtualList.refresh(),!r)return;const a=s.indexOf(r);this.checkSetSelectedValue(a)}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((t,i)=>{t.updateSelected(e===i)}))}createRowComponent(e){var t;const i=new gc;return this.getContext().createBean(i),i.setState(null!=(t=e.displayValue)?t:e.key,e===this.selectedValue),i}onMouseMove(e){const t=this.virtualList.getGui().getBoundingClientRect(),i=this.virtualList.getScrollTop(),n=e.clientY-t.top+i,s=Math.floor(n/this.virtualList.getRowHeight());this.checkSetSelectedValue(s)}afterGuiAttached(){this.virtualList.refresh()}getSelectedValue(){var e;return this.autocompleteEntries.length&&null!=(e=this.selectedValue)?e:null}};fc.TEMPLATE='<div class="ag-autocomplete-list-popup">\n            <div ref="eList" class="ag-autocomplete-list"></div>\n        <div>',g([Ss("eList")],fc.prototype,"eList",2),g([le],fc.prototype,"init",1);var mc=fc,yc=class e extends Cs{constructor(){super('\n            <div class="ag-autocomplete" role="presentation">\n                <ag-input-text-field ref="eAutocompleteInput"></ag-input-text-field>\n            </div>'),this.isListOpen=!1,this.lastPosition=0,this.valid=!0}postConstruct(){this.eAutocompleteInput.onValueChange(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=v(e);this.updateValue(t),this.updateAutocompleteList(t)}updateValue(t){this.updateLastPosition(),this.dispatchEvent({type:e.EVENT_VALUE_CHANGED,value:t}),this.validate(t)}updateAutocompleteList(e){var t,i,n,s;const r=null!=(i=null==(t=this.listGenerator)?void 0:t.call(this,e,this.lastPosition))?i:{enabled:!1};if(r.type&&r.type===(null==(n=this.autocompleteListParams)?void 0:n.type)||this.isListOpen&&this.closeList(),this.autocompleteListParams=r,null==(s=this.autocompleteListParams)?void 0:s.enabled){this.isListOpen||this.openList();const{searchString:e}=this.autocompleteListParams;this.autocompleteList.setSearch(null!=e?e:"")}else this.isListOpen&&this.closeList()}onKeyDown(e){const t=e.key;switch(this.updateLastPosition(),t){case Zn.ENTER:this.onEnterKeyDown(e);break;case Zn.TAB:this.onTabKeyDown(e);break;case Zn.DOWN:case Zn.UP:this.onUpDownKeyDown(e,t);break;case Zn.LEFT:case Zn.RIGHT:case Zn.PAGE_HOME:case Zn.PAGE_END:setTimeout(()=>{this.updatePositionAndList()});break;case Zn.ESCAPE:this.onEscapeKeyDown(e);break;case Zn.SPACE:e.ctrlKey&&!this.isListOpen&&(e.preventDefault(),this.forceOpenList())}}confirmSelection(){var t;const i=null==(t=this.autocompleteList)?void 0:t.getSelectedValue();i&&(this.closeList(),this.dispatchEvent({type:e.EVENT_OPTION_SELECTED,value:this.getValue(),position:this.lastPosition,updateEntry:i,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 i;e.preventDefault(),this.isListOpen?null==(i=this.autocompleteList)||i.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(null!=(e=this.eAutocompleteInput.getValue())?e:null)}setCaret(e,t){const i=this.gos.getDocument(),n=this.gos.getActiveDomElement();!t||n&&n!==i.body||this.eAutocompleteInput.getFocusableElement().focus();const s=this.eAutocompleteInput.getInputElement();s.setSelectionRange(e,e),e===s.value.length&&(s.scrollLeft=s.scrollWidth)}forceOpenList(){this.onValueChanged(this.eAutocompleteInput.getValue())}updateLastPosition(){var e;this.lastPosition=null!=(e=this.eAutocompleteInput.getInputElement().selectionStart)?e:0}validate(t){var i;this.validator&&(this.validationMessage=this.validator(t),this.eAutocompleteInput.getInputElement().setCustomValidity(null!=(i=this.validationMessage)?i:""),this.valid=!this.validationMessage,this.dispatchEvent({type:e.EVENT_VALID_CHANGED,isValid:this.valid,validationMessage:this.validationMessage}))}openList(){this.isListOpen=!0,this.autocompleteList=this.createBean(new mc({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},i=this.popupService.addPopup({eChild:e,anchorToElement:this.getGui(),positionCallback:()=>this.popupService.positionPopupByComponent(t),ariaLabel:this.listAriaLabel});this.hidePopup=i.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:e.EVENT_VALUE_CONFIRMED,value:this.getValue(),isValid:this.isValid()})}getValue(){return v(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:i,silent:n,updateListOnlyIfOpen:s,restoreFocus:r}=e;this.eAutocompleteInput.setValue(t,!0),this.setCaret(null!=i?i:this.lastPosition,r),n||this.updateValue(t),s&&!this.isListOpen||this.updateAutocompleteList(t)}setForceLastSelection(e){return this.forceLastSelection=e,this}setInputDisabled(e){return this.eAutocompleteInput.setDisabled(e),this}};yc.EVENT_VALUE_CHANGED="eventValueChanged",yc.EVENT_VALUE_CONFIRMED="eventValueConfirmed",yc.EVENT_OPTION_SELECTED="eventOptionSelected",yc.EVENT_VALID_CHANGED="eventValidChanged",g([ue("popupService")],yc.prototype,"popupService",2),g([Ss("eAutocompleteInput")],yc.prototype,"eAutocompleteInput",2),g([le],yc.prototype,"postConstruct",1);var vc=yc,bc=class e extends Cs{constructor(e,t,i,n){super(),this.dragSourceDropTarget=e,this.ghost=t,this.horizontal=i,this.template=n}init(){var t;this.setTemplate(null!=(t=this.template)?t:e.TEMPLATE);const i=this.getGui();this.addElementClasses(i),this.addElementClasses(this.eDragHandle,"drag-handle"),this.addElementClasses(this.eText,"text"),this.addElementClasses(this.eButton,"button"),this.eDragHandle.appendChild(qn("columnDrag",this.gos)),this.eButton.appendChild(qn("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),$t(this.getGui(),t.join(". "))}addAdditionalAriaInstructions(e,t){if(this.isRemovable()){const i=t("ariaDropZoneColumnComponentDescription","Press DELETE to remove");e.push(i)}}setupTooltip(){const e=()=>{const e=this.getTooltip();this.setTooltip({newTooltipText:e})};e(),this.addManagedListener(this.eventService,ct.EVENT_NEW_COLUMNS_LOADED,e)}getDragSourceId(){}getDefaultIconName(){return Br.ICON_NOT_ALLOWED}addDragSource(){const{dragAndDropService:e,eDragHandle:t}=this,i=this.createGetDragItem(),n=this.getDefaultIconName(),s={type:this.getDragSourceType(),sourceId:this.getDragSourceId(),eElement:t,getDefaultIconName:()=>n,getDragItem:i,dragItemName:this.getDisplayName()};e.addDragSource(s,!0),this.addDestroyFunc(()=>e.removeDragSource(s))}setupComponents(){this.setTextValue(),this.setupRemove(),this.ghost&&this.addCssClass("ag-column-drop-cell-ghost")}isRemovable(){return!0}refreshRemove(){an(this.eButton,this.isRemovable())}setupRemove(){this.refreshRemove();const t={type:e.EVENT_COLUMN_REMOVE};this.addGuiEventListener("keydown",e=>this.onKeyDown(e)),this.addManagedListener(this.eButton,"click",e=>{this.dispatchEvent(t),e.stopPropagation()});const i=new yr(this.eButton);this.addManagedListener(i,yr.EVENT_TAP,()=>{this.dispatchEvent(t)}),this.addDestroyFunc(i.destroy.bind(i))}onKeyDown(t){t.key===Zn.DELETE&&this.isRemovable()&&(t.preventDefault(),this.dispatchEvent({type:e.EVENT_COLUMN_REMOVE}))}getDisplayValue(){return this.getDisplayName()}setTextValue(){const e=bt(this.getDisplayValue());this.eText.innerHTML=e}addElementClasses(e,t){t=t?`-${t}`:"";const i=this.horizontal?"horizontal":"vertical";e.classList.add(`ag-column-drop-cell${t}`,`ag-column-drop-${i}-cell${t}`)}destroy(){super.destroy(),this.dragSourceDropTarget=null}};bc.EVENT_COLUMN_REMOVE="columnRemove",bc.TEMPLATE='<span role="option">\n          <span ref="eDragHandle" class="ag-drag-handle ag-column-drop-cell-drag-handle" role="presentation"></span>\n          <span ref="eText" class="ag-column-drop-cell-text" aria-hidden="true"></span>\n          <span ref="eButton" class="ag-column-drop-cell-button" role="presentation"></span>\n        </span>',g([ue("dragAndDropService")],bc.prototype,"dragAndDropService",2),g([Ss("eText")],bc.prototype,"eText",2),g([Ss("eDragHandle")],bc.prototype,"eDragHandle",2),g([Ss("eButton")],bc.prototype,"eButton",2),g([le],bc.prototype,"init",1);var Cc=bc,wc=class e extends Cs{constructor(t){super('<div class="ag-unselectable" role="presentation"></div>'),this.horizontal=t,this.state=e.STATE_NOT_DRAGGING,this.guiDestroyFunctions=[],this.childPillComponents=[],this.resizeEnabled=!1,this.addElementClasses(this.getGui()),this.ePillDropList=document.createElement("div"),this.addElementClasses(this.ePillDropList,"list"),Ht(this.ePillDropList,"listbox")}isHorizontal(){return this.horizontal}toggleResizable(e){this.positionableFeature.setResizable(!!e&&{bottom:!0}),this.resizeEnabled=e}isSourceEventFromTarget(e){const{dropZoneTarget:t,dragSource:i}=e;return t.contains(i.eElement)}destroy(){this.destroyGui(),super.destroy()}destroyGui(){this.guiDestroyFunctions.forEach(e=>e()),this.guiDestroyFunctions.length=0,this.childPillComponents.length=0,Cn(this.getGui()),Cn(this.ePillDropList)}init(e){this.params=null!=e?e:{},this.createManagedBean(new Is(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.setupDropTarget(),this.positionableFeature=new Ps(this.getGui(),{minHeight:100}),this.createManagedBean(this.positionableFeature),this.refreshGui(),$t(this.ePillDropList,this.getAriaLabel())}handleKeyDown(e){const t=!this.horizontal;let i=e.key===Zn.DOWN,n=e.key===Zn.UP;if(!t){const t=this.gos.get("enableRtl");i=!t&&e.key===Zn.RIGHT||t&&e.key===Zn.LEFT,n=!t&&e.key===Zn.LEFT||t&&e.key===Zn.RIGHT}if(!i&&!n)return;const s=this.focusService.findNextFocusableElement(this.getFocusableElement(),!1,n);s&&(e.preventDefault(),s.focus())}addElementClasses(e,t){t=t?`-${t}`:"";const i=this.horizontal?"horizontal":"vertical";e.classList.add(`ag-column-drop${t}`,`ag-column-drop-${i}${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 i=this.minimumAllowedNewInsertIndex(),n=Math.max(i,t),s=n!==this.insertIndex;return s&&(this.insertIndex=n),s}getNewInsertIndex(e){const t=e.event,i=this.horizontal?t.clientX:t.clientY,n=this.childPillComponents.map(e=>e.getGui().getBoundingClientRect()),s=n.findIndex(e=>this.horizontal?e.right>i&&e.left<i:e.top<i&&e.bottom>i);if(-1===s){const e=this.gos.get("enableRtl");return n.every(e=>i>(this.horizontal?e.right:e.bottom))?e&&this.horizontal?0:this.childPillComponents.length:n.every(e=>i<(this.horizontal?e.left:e.top))?e&&this.horizontal?this.childPillComponents.length:0:this.insertIndex}return this.insertIndex<=s?s+1:s}checkDragStartedBySelf(t){this.state===e.STATE_NOT_DRAGGING&&(this.state=e.STATE_REARRANGE_ITEMS,this.potentialDndItems=this.getItems(t.dragSource.getDragItem()),this.refreshGui(),this.checkInsertIndex(t),this.refreshGui())}onDragging(e){this.checkDragStartedBySelf(e),this.checkInsertIndex(e)&&this.refreshGui()}handleDragEnterEnd(e){}onDragEnter(t){const i=this.getItems(t.dragSource.getDragItem());this.state=e.STATE_NEW_ITEMS_IN;const n=i.filter(e=>this.isItemDroppable(e,t)),s=n.every(e=>-1!==this.childPillComponents.map(e=>e.getItem()).indexOf(e));0!==n.length&&(this.potentialDndItems=n,s?this.state=e.STATE_NOT_DRAGGING:(this.handleDragEnterEnd(t),this.checkInsertIndex(t),this.refreshGui()))}isPotentialDndItems(){return De(this.potentialDndItems)}handleDragLeaveEnd(e){}onDragLeave(t){if(this.state===e.STATE_REARRANGE_ITEMS){const e=this.getItems(t.dragSource.getDragItem());this.removeItems(e)}this.isPotentialDndItems()&&(this.handleDragLeaveEnd(t),this.potentialDndItems=[],this.refreshGui()),this.state=e.STATE_NOT_DRAGGING}refreshOnDragStop(){return!0}onDragStop(){if(this.isPotentialDndItems()){let t=!1;this.state===e.STATE_NEW_ITEMS_IN?(this.addItems(this.potentialDndItems),t=!0):t=this.rearrangeItems(this.potentialDndItems),this.potentialDndItems=[],!this.refreshOnDragStop()&&t||this.refreshGui()}this.state=e.STATE_NOT_DRAGGING}removeItems(e){const t=this.getExistingItems().filter(t=>!He(e,t));this.updateItems(t)}addItems(e){if(!e)return;const t=this.getExistingItems().slice(),i=e.filter(e=>t.indexOf(e)<0);Be(t,i,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 Be(t,e,this.insertIndex),!Re(t,this.getExistingItems())&&(this.updateItems(t),!0)}refreshGui(){const e=this.ePillDropList.scrollTop,t=this.resizeEnabled,i=this.getFocusedItem();let n=this.focusService.findNextFocusableElement();n||(n=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(i,n)}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 i=this.getGui(),n=Array.from(i.querySelectorAll(".ag-column-drop-cell"));if(-1===e)return;0===n.length&&t.focus();const s=n[Math.min(n.length-1,e)];s&&s.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(e=>!He(this.potentialDndItems,e)):e}addItemsToGui(){const e=this.getNonGhostItems().map(e=>this.createItemComponent(e,!1));if(this.isPotentialDndItems()){const t=this.potentialDndItems.map(e=>this.createItemComponent(e,!0));this.insertIndex>=e.length?e.push(...t):e.splice(this.insertIndex,0,...t)}this.appendChild(this.ePillDropList),e.forEach((e,t)=>{t>0&&this.addArrow(this.ePillDropList),this.ePillDropList.appendChild(e.getGui())}),this.addAriaLabelsToComponents()}addAriaLabelsToComponents(){this.childPillComponents.forEach((e,t)=>{const i=e.getGui();ri(i,t+1),si(i,this.childPillComponents.length)})}createItemComponent(e,t){const i=this.createPillComponent(e,this.dropTarget,t,this.horizontal);return i.addEventListener(Cc.EVENT_COLUMN_REMOVE,this.removeItems.bind(this,[e])),this.context.createBean(i),this.guiDestroyFunctions.push(()=>this.destroyBean(i)),t||this.childPillComponents.push(i),i}addIconAndTitleToGui(){const{title:e,icon:t}=this.params;if(!e||!t)return;const i=document.createElement("div");if(ei(i,!0),this.addElementClasses(i,"title-bar"),this.addElementClasses(t,"icon"),this.addOrRemoveCssClass("ag-column-drop-empty",this.isExistingItemsEmpty()),i.appendChild(t),!this.horizontal){const t=document.createElement("span");this.addElementClasses(t,"title"),t.innerHTML=e,i.appendChild(t)}this.appendChild(i)}isExistingItemsEmpty(){return 0===this.getExistingItems().length}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=qn(this.gos.get("enableRtl")?"smallLeft":"smallRight",this.gos);this.addElementClasses(t,"cell-separator"),e.appendChild(t)}}};wc.STATE_NOT_DRAGGING="notDragging",wc.STATE_NEW_ITEMS_IN="newItemsIn",wc.STATE_REARRANGE_ITEMS="rearrangeItems",g([ue("focusService")],wc.prototype,"focusService",2),g([ue("dragAndDropService")],wc.prototype,"dragAndDropService",2);var Sc=wc,xc=["touchstart","touchend","touchmove","touchcancel"],Ec=class{constructor(e="javascript"){this.frameworkName=e,this.renderingEngine="vanilla",this.wrapIncoming=e=>e(),this.wrapOutgoing=e=>e()}setInterval(e,t){return new ds(i=>{i(window.setInterval(e,t))})}addEventListener(e,t,i,n){const s=He(xc,t);e.addEventListener(t,i,{capture:!!n,passive:s})}get shouldWrapOutgoing(){return!1}frameworkComponent(e){return null}isFrameworkComponent(e){return!1}getDocLink(e){return`https://www.ag-grid.com/${"solid"===this.frameworkName?"react":this.frameworkName}-data-grid${e?`/${e}`:""}`}},Ac=class extends st{getNextCellToFocus(e,t,i=!1){return i?this.getNextCellToFocusWithCtrlPressed(e,t):this.getNextCellToFocusWithoutCtrlPressed(e,t)}getNextCellToFocusWithCtrlPressed(e,t){const i=e===Zn.UP,n=e===Zn.DOWN,s=e===Zn.LEFT;let r,o;if(i||n)o=i?this.paginationProxy.getPageFirstRow():this.paginationProxy.getPageLastRow(),r=t.column;else{const e=this.columnModel.getAllDisplayedColumns(),i=this.gos.get("enableRtl");o=t.rowIndex,r=s!==i?e[0]:Ie(e)}return{rowIndex:o,rowPinned:null,column:r}}getNextCellToFocusWithoutCtrlPressed(e,t){let i=t,n=!1;for(;!n;){switch(e){case Zn.UP:i=this.getCellAbove(i);break;case Zn.DOWN:i=this.getCellBelow(i);break;case Zn.RIGHT:i=this.gos.get("enableRtl")?this.getCellToLeft(i):this.getCellToRight(i);break;case Zn.LEFT:i=this.gos.get("enableRtl")?this.getCellToRight(i):this.getCellToLeft(i);break;default:i=null,console.warn("AG Grid: unknown key for navigation "+e)}n=!i||this.isCellGoodToFocusOn(i)}return i}isCellGoodToFocusOn(e){const t=e.column;let i;switch(e.rowPinned){case"top":i=this.pinnedRowModel.getPinnedTopRow(e.rowIndex);break;case"bottom":i=this.pinnedRowModel.getPinnedBottomRow(e.rowIndex);break;default:i=this.rowModel.getRow(e.rowIndex)}return!!i&&!t.isSuppressNavigable(i)}getCellToLeft(e){if(!e)return null;const t=this.columnModel.getDisplayedColBefore(e.column);return t?{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}:null}getCellToRight(e){if(!e)return null;const t=this.columnModel.getDisplayedColAfter(e.column);return t?{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}:null}getRowBelow(e){const t=e.rowIndex,i=e.rowPinned;if(this.isLastRowInContainer(e))switch(i){case"bottom":return null;case"top":return this.rowModel.isRowsToRender()?{rowIndex:this.paginationProxy.getPageFirstRow(),rowPinned:null}:this.pinnedRowModel.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null;default:return this.pinnedRowModel.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null}const n=this.rowModel.getRow(e.rowIndex);return this.getNextStickyPosition(n)||{rowIndex:t+1,rowPinned:i}}getNextStickyPosition(e,t){if(!this.gos.isGroupRowsSticky()||!e||!e.sticky)return;let i=[];i=this.rowRenderer.getStickyTopRowCtrls().some(t=>t.getRowNode().rowIndex===e.rowIndex)?[...this.rowRenderer.getStickyTopRowCtrls()].sort((e,t)=>e.getRowNode().rowIndex-t.getRowNode().rowIndex):[...this.rowRenderer.getStickyBottomRowCtrls()].sort((e,t)=>t.getRowNode().rowIndex-e.getRowNode().rowIndex);const n=t?-1:1,s=i.findIndex(t=>t.getRowNode().rowIndex===e.rowIndex),r=i[s+n];return r?{rowIndex:r.getRowNode().rowIndex,rowPinned:null}:void 0}getCellBelow(e){if(!e)return null;const t=this.getRowBelow(e);return t?{rowIndex:t.rowIndex,column:e.column,rowPinned:t.rowPinned}:null}isLastRowInContainer(e){const t=e.rowPinned,i=e.rowIndex;return"top"===t?this.pinnedRowModel.getPinnedTopRowData().length-1<=i:"bottom"===t?this.pinnedRowModel.getPinnedBottomRowData().length-1<=i:this.paginationProxy.getPageLastRow()<=i}getRowAbove(e){const t=e.rowIndex,i=e.rowPinned;if(i?0===t:t===this.paginationProxy.getPageFirstRow())return"top"===i?null:i&&this.rowModel.isRowsToRender()?this.getLastBodyCell():this.pinnedRowModel.isRowsToRender("top")?this.getLastFloatingTopRow():null;const n=this.rowModel.getRow(e.rowIndex);return this.getNextStickyPosition(n,!0)||{rowIndex:t-1,rowPinned:i}}getCellAbove(e){if(!e)return null;const t=this.getRowAbove({rowIndex:e.rowIndex,rowPinned:e.rowPinned});return t?{rowIndex:t.rowIndex,column:e.column,rowPinned:t.rowPinned}:null}getLastBodyCell(){return{rowIndex:this.paginationProxy.getPageLastRow(),rowPinned:null}}getLastFloatingTopRow(){return{rowIndex:this.pinnedRowModel.getPinnedTopRowData().length-1,rowPinned:"top"}}getNextTabbedCell(e,t){return t?this.getNextTabbedCellBackwards(e):this.getNextTabbedCellForwards(e)}getNextTabbedCellForwards(e){const t=this.columnModel.getAllDisplayedColumns();let i=e.rowIndex,n=e.rowPinned,s=this.columnModel.getDisplayedColAfter(e.column);if(!s){s=t[0];const r=this.getRowBelow(e);if(C(r))return null;if(!r.rowPinned&&!this.paginationProxy.isRowInPage(r))return null;i=r?r.rowIndex:null,n=r?r.rowPinned:null}return{rowIndex:i,column:s,rowPinned:n}}getNextTabbedCellBackwards(e){const t=this.columnModel.getAllDisplayedColumns();let i=e.rowIndex,n=e.rowPinned,s=this.columnModel.getDisplayedColBefore(e.column);if(!s){s=Ie(t);const r=this.getRowAbove({rowIndex:e.rowIndex,rowPinned:e.rowPinned});if(C(r))return null;if(!r.rowPinned&&!this.paginationProxy.isRowInPage(r))return null;i=r?r.rowIndex:null,n=r?r.rowPinned:null}return{rowIndex:i,column:s,rowPinned:n}}};g([ue("columnModel")],Ac.prototype,"columnModel",2),g([ue("rowModel")],Ac.prototype,"rowModel",2),g([ue("rowRenderer")],Ac.prototype,"rowRenderer",2),g([ue("pinnedRowModel")],Ac.prototype,"pinnedRowModel",2),g([ue("paginationProxy")],Ac.prototype,"paginationProxy",2),Ac=g([he("cellNavigationService")],Ac);var Mc=class extends st{constructor(){super(...arguments),this.consuming=!1}setBeans(e){this.logger=e.create("AlignedGridsService")}getAlignedGridApis(){var e;let t=null!=(e=this.gos.get("alignedGrids"))?e:[];const i="function"==typeof t;"function"==typeof t&&(t=t());const n=()=>`See ${this.getFrameworkOverrides().getDocLink("aligned-grids")}`;return t.map(e=>{var t;if(!e)return W("alignedGrids contains an undefined option."),i||W('You may want to configure via a callback to avoid setup race conditions:\n                     "alignedGrids: () => [linkedGrid]"'),void W(n());if(e instanceof zo)return e;const s=e;return"current"in s?null==(t=s.current)?void 0:t.api:(s.api||W(`alignedGrids - No api found on the linked grid. If you are passing gridOptions to alignedGrids since v31 this is no longer valid. ${n()}`),s.api)}).filter(e=>!!e&&!e.isDestroyed())}init(){this.addManagedListener(this.eventService,ct.EVENT_COLUMN_MOVED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_VISIBLE,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PINNED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_GROUP_OPENED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_RESIZED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_BODY_SCROLL,this.fireScrollEvent.bind(this))}fireEvent(e){this.consuming||this.getAlignedGridApis().forEach(t=>{if(t.isDestroyed())return;const i=t.__getAlignedGridService();e(i)})}onEvent(e){this.consuming=!0,e(),this.consuming=!1}fireColumnEvent(e){this.fireEvent(t=>{t.onColumnEvent(e)})}fireScrollEvent(e){"horizontal"===e.direction&&this.fireEvent(t=>{t.onScrollEvent(e)})}onScrollEvent(e){this.onEvent(()=>{this.ctrlsService.getGridBodyCtrl().getScrollFeature().setHorizontalScrollPosition(e.left,!0)})}getMasterColumns(e){const t=[];return e.columns?e.columns.forEach(e=>{t.push(e)}):e.column&&t.push(e.column),t}getColumnIds(e){const t=[];return e.columns?e.columns.forEach(e=>{t.push(e.getColId())}):e.column&&t.push(e.column.getColId()),t}onColumnEvent(e){this.onEvent(()=>{switch(e.type){case ct.EVENT_COLUMN_MOVED:case ct.EVENT_COLUMN_VISIBLE:case ct.EVENT_COLUMN_PINNED:case ct.EVENT_COLUMN_RESIZED:const t=e;this.processColumnEvent(t);break;case ct.EVENT_COLUMN_GROUP_OPENED:const i=e;this.processGroupOpenedEvent(i);break;case ct.EVENT_COLUMN_PIVOT_CHANGED:console.warn("AG Grid: pivoting is not supported with aligned grids. You can only use one of these features at a time in a grid.")}})}processGroupOpenedEvent(e){e.columnGroups.forEach(t=>{let i=null;if(t){const e=t.getGroupId();i=this.columnModel.getProvidedColumnGroup(e)}t&&!i||(this.logger.log("onColumnEvent-> processing "+e+" expanded = "+t.isExpanded()),this.columnModel.setColumnGroupOpened(i,t.isExpanded(),"alignedGridChanged"))})}processColumnEvent(e){var t;const i=e.column;let n=null;if(i&&(n=this.columnModel.getPrimaryColumn(i.getColId())),i&&!n)return;const s=this.getMasterColumns(e);switch(e.type){case ct.EVENT_COLUMN_MOVED:{const t=e,i=e.api.getColumnState().map(e=>({colId:e.colId}));this.columnModel.applyColumnState({state:i,applyOrder:!0},"alignedGridChanged"),this.logger.log(`onColumnEvent-> processing ${e.type} toIndex = ${t.toIndex}`)}break;case ct.EVENT_COLUMN_VISIBLE:{const t=e,i=e.api.getColumnState().map(e=>({colId:e.colId,hide:e.hide}));this.columnModel.applyColumnState({state:i},"alignedGridChanged"),this.logger.log(`onColumnEvent-> processing ${e.type} visible = ${t.visible}`)}break;case ct.EVENT_COLUMN_PINNED:{const t=e,i=e.api.getColumnState().map(e=>({colId:e.colId,pinned:e.pinned}));this.columnModel.applyColumnState({state:i},"alignedGridChanged"),this.logger.log(`onColumnEvent-> processing ${e.type} pinned = ${t.pinned}`)}break;case ct.EVENT_COLUMN_RESIZED:const i=e,n={};s.forEach(t=>{this.logger.log(`onColumnEvent-> processing ${e.type} actualWidth = ${t.getActualWidth()}`),n[t.getId()]={key:t.getColId(),newWidth:t.getActualWidth()}}),null==(t=i.flexColumns)||t.forEach(e=>{n[e.getId()]&&delete n[e.getId()]}),this.columnModel.setColumnWidths(Object.values(n),!1,i.finished,"alignedGridChanged")}const r=this.ctrlsService.getGridBodyCtrl().isVerticalScrollShowing();this.getAlignedGridApis().forEach(e=>{e.setGridOption("alwaysShowVerticalScroll",r)})}};g([ue("columnModel")],Mc.prototype,"columnModel",2),g([ue("ctrlsService")],Mc.prototype,"ctrlsService",2),g([f(0,ge("loggerFactory"))],Mc.prototype,"setBeans",1),g([le],Mc.prototype,"init",1),Mc=g([he("alignedGridsService")],Mc);var Tc=class extends st{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,ct.EVENT_ROW_SELECTED,this.onRowSelected.bind(this))}destroy(){super.destroy(),this.resetNodes(),this.lastRowNode=null}isMultiselect(){return"multiple"===this.rowSelection}setNodesSelected(e){var t;const{newValue:i,clearSelection:n,suppressFinishActions:s,rangeSelect:r,nodes:o,event:a,source:l="api"}=e;if(0===o.length)return 0;if(o.length>1&&!this.isMultiselect())return console.warn("AG Grid: cannot multi select while rowSelection='single'"),0;const c=this.groupSelectsChildren&&!0===e.groupSelectsFiltered,h=o.map(e=>e.footer?e.sibling:e);if(r){if(o.length>1)return console.warn("AG Grid: cannot range select while selecting multiple rows"),0;let e=null;if("checkboxSelected"===l&&!1===i&&this.lastRowNode&&(this.lastRowNode.id?e=this.lastRowNode:this.lastRowNode=null),null==e&&(e=this.getLastSelectedNode()),e){const t=h[0];if(t!==e&&this.isMultiselect())return this.selectRange(t,e,i,l)}}this.lastRowNode=i?null:h[0];let u=0;for(let e=0;e<h.length;e++){const n=h[e];c&&n.group||n.selectThisNode(i,a,l)&&u++,this.groupSelectsChildren&&(null==(t=n.childrenAfterGroup)?void 0:t.length)&&(u+=this.selectChildren(n,i,c,l))}if(!s&&(i&&(n||!this.isMultiselect())&&(u+=this.clearOtherNodes(h[0],l)),u>0)){this.updateGroupsFromChildrenSelections(l);const e={type:ct.EVENT_SELECTION_CHANGED,source:l};this.eventService.dispatchEvent(e)}return u}selectRange(e,t,i=!0,n){const s=this.rowModel.getNodesInRangeForSelection(e,t);let r=0;s.forEach(e=>{e.group&&this.groupSelectsChildren||e.selectThisNode(i,void 0,n)&&r++}),this.updateGroupsFromChildrenSelections(n);const o={type:ct.EVENT_SELECTION_CHANGED,source:n};return this.eventService.dispatchEvent(o),r}selectChildren(e,t,i,n){const s=i?e.childrenAfterAggFilter:e.childrenAfterGroup;return C(s)?0:this.setNodesSelected({newValue:t,clearSelection:!1,suppressFinishActions:!0,groupSelectsFiltered:i,source:n,nodes:s})}getLastSelectedNode(){const e=Array.from(this.selectedNodes.keys());if(0==e.length)return null;return this.selectedNodes.get(Ie(e))||null}getSelectedNodes(){const e=[];return this.selectedNodes.forEach(t=>{t&&e.push(t)}),e}getSelectedRows(){const e=[];return this.selectedNodes.forEach(t=>{t&&t.data&&e.push(t.data)}),e}getSelectionCount(){return this.selectedNodes.size}filterFromSelection(e){const t=new Map;this.selectedNodes.forEach((i,n)=>{i&&e(i)&&t.set(n,i)}),this.selectedNodes=t}updateGroupsFromChildrenSelections(e,t){if(!this.groupSelectsChildren)return!1;if("clientSide"!==this.rowModel.getType())return!1;const i=this.rowModel.getRootNode();t||(t=new Gl(!0,i)).setInactive();let n=!1;return t.forEachChangedNodeDepthFirst(t=>{if(t!==i){const i=t.calculateSelectedFromChildren();n=t.selectThisNode(null!==i&&i,void 0,e)||n}}),n}clearOtherNodes(e,t){const i=new Map;let n=0;return this.selectedNodes.forEach(s=>{if(s&&s.id!==e.id){const e=this.selectedNodes.get(s.id);n+=e.setSelectedParams({newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:t}),this.groupSelectsChildren&&s.parent&&i.set(s.parent.id,s.parent)}}),i.forEach(e=>{const i=e.calculateSelectedFromChildren();e.selectThisNode(null!==i&&i,void 0,t)}),n}onRowSelected(e){const t=e.node;this.groupSelectsChildren&&t.group||(t.isSelected()?this.selectedNodes.set(t.id,t):this.selectedNodes.delete(t.id))}syncInRowNode(e,t){this.syncInOldRowNode(e,t),this.syncInNewRowNode(e)}syncInOldRowNode(e,t){if(b(t)&&e.id!==t.id&&t){const i=t.id;this.selectedNodes.get(i)==e&&this.selectedNodes.set(t.id,t)}}syncInNewRowNode(e){this.selectedNodes.has(e.id)?(e.setSelectedInitialValue(!0),this.selectedNodes.set(e.id,e)):e.setSelectedInitialValue(!1)}reset(e){const t=this.getSelectionCount();if(this.resetNodes(),t){const t={type:ct.EVENT_SELECTION_CHANGED,source:e};this.eventService.dispatchEvent(t)}}resetNodes(){var e;null==(e=this.selectedNodes)||e.clear()}getBestCostNodeSelection(){if("clientSide"!==this.rowModel.getType())return;const e=this.rowModel.getTopLevelNodes();if(null===e)return;const t=[];return function e(i){for(let n=0,s=i.length;n<s;n++){const s=i[n];if(s.isSelected())t.push(s);else{const t=s;t.group&&t.children&&e(t.children)}}}(e),t}isEmpty(){let e=0;return this.selectedNodes.forEach(t=>{t&&e++}),0===e}deselectAllRowNodes(e){const t=e=>e.selectThisNode(!1,void 0,n),i="clientSide"===this.rowModel.getType(),{source:n,justFiltered:s,justCurrentPage:r}=e;if(r||s){if(!i)return void console.error("AG Grid: selecting just filtered only works when gridOptions.rowModelType='clientSide'");this.getNodesToSelect(s,r).forEach(t)}else this.selectedNodes.forEach(e=>{e&&t(e)}),this.reset(n);i&&this.groupSelectsChildren&&this.updateGroupsFromChildrenSelections(n);const o={type:ct.EVENT_SELECTION_CHANGED,source:n};this.eventService.dispatchEvent(o)}getSelectedCounts(e,t){let i=0,n=0;return this.getNodesToSelect(e,t).forEach(e=>{this.groupSelectsChildren&&e.group||(e.isSelected()?i++:e.selectable&&n++)}),{selectedCount:i,notSelectedCount:n}}getSelectAllState(e,t){const{selectedCount:i,notSelectedCount:n}=this.getSelectedCounts(e,t);return(0!==i||0!==n)&&(i>0&&n>0?null:i>0)}hasNodesToSelect(e=!1,t=!1){return this.getNodesToSelect(e,t).filter(e=>e.selectable).length>0}getNodesToSelect(e=!1,t=!1){if("clientSide"!==this.rowModel.getType())throw new Error(`selectAll only available when rowModelType='clientSide', ie not ${this.rowModel.getType()}`);const i=[];if(t)return this.paginationProxy.forEachNodeOnPage(e=>{if(e.group){if(!e.expanded){const t=e=>{var n;i.push(e),(null==(n=e.childrenAfterFilter)?void 0:n.length)&&e.childrenAfterFilter.forEach(t)};return void t(e)}this.groupSelectsChildren||i.push(e)}else i.push(e)}),i;const n=this.rowModel;return e?(n.forEachNodeAfterFilter(e=>{i.push(e)}),i):(n.forEachNode(e=>{i.push(e)}),i)}selectAllRowNodes(e){if("clientSide"!==this.rowModel.getType())throw new Error(`selectAll only available when rowModelType='clientSide', ie not ${this.rowModel.getType()}`);const{source:t,justFiltered:i,justCurrentPage:n}=e;this.getNodesToSelect(i,n).forEach(e=>e.selectThisNode(!0,void 0,t)),"clientSide"===this.rowModel.getType()&&this.groupSelectsChildren&&this.updateGroupsFromChildrenSelections(t);const s={type:ct.EVENT_SELECTION_CHANGED,source:t};this.eventService.dispatchEvent(s)}getSelectionState(){const e=[];return this.selectedNodes.forEach(t=>{(null==t?void 0:t.id)&&e.push(t.id)}),e.length?e:null}setSelectionState(e,t){if(!Array.isArray(e))return;const i=new Set(e),n=[];this.rowModel.forEachNode(e=>{i.has(e.id)&&n.push(e)}),this.setNodesSelected({newValue:!0,nodes:n,source:t})}};g([ue("rowModel")],Tc.prototype,"rowModel",2),g([ue("paginationProxy")],Tc.prototype,"paginationProxy",2),g([le],Tc.prototype,"init",1),Tc=g([he("selectionService")],Tc);var Dc=class{constructor(e){this.viaApi=(e,...t)=>(z(`Since v31, 'columnApi.${e}' is deprecated and moved to 'api.${e}'.`),this.api[e](...t)),this.api=e}sizeColumnsToFit(e){this.viaApi("sizeColumnsToFit",e)}setColumnGroupOpened(e,t){this.viaApi("setColumnGroupOpened",e,t)}getColumnGroup(e,t){return this.viaApi("getColumnGroup",e,t)}getProvidedColumnGroup(e){return this.viaApi("getProvidedColumnGroup",e)}getDisplayNameForColumn(e,t){return this.viaApi("getDisplayNameForColumn",e,t)}getDisplayNameForColumnGroup(e,t){return this.viaApi("getDisplayNameForColumnGroup",e,t)}getColumn(e){return this.viaApi("getColumn",e)}getColumns(){return this.viaApi("getColumns")}applyColumnState(e){return this.viaApi("applyColumnState",e)}getColumnState(){return this.viaApi("getColumnState")}resetColumnState(){this.viaApi("resetColumnState")}getColumnGroupState(){return this.viaApi("getColumnGroupState")}setColumnGroupState(e){this.viaApi("setColumnGroupState",e)}resetColumnGroupState(){this.viaApi("resetColumnGroupState")}isPinning(){return this.viaApi("isPinning")}isPinningLeft(){return this.viaApi("isPinningLeft")}isPinningRight(){return this.viaApi("isPinningRight")}getDisplayedColAfter(e){return this.viaApi("getDisplayedColAfter",e)}getDisplayedColBefore(e){return this.viaApi("getDisplayedColBefore",e)}setColumnVisible(e,t){this.viaApi("setColumnVisible",e,t)}setColumnsVisible(e,t){this.viaApi("setColumnsVisible",e,t)}setColumnPinned(e,t){this.viaApi("setColumnPinned",e,t)}setColumnsPinned(e,t){this.viaApi("setColumnsPinned",e,t)}getAllGridColumns(){return this.viaApi("getAllGridColumns")}getDisplayedLeftColumns(){return this.viaApi("getDisplayedLeftColumns")}getDisplayedCenterColumns(){return this.viaApi("getDisplayedCenterColumns")}getDisplayedRightColumns(){return this.viaApi("getDisplayedRightColumns")}getAllDisplayedColumns(){return this.viaApi("getAllDisplayedColumns")}getAllDisplayedVirtualColumns(){return this.viaApi("getAllDisplayedVirtualColumns")}moveColumn(e,t){this.viaApi("moveColumn",e,t)}moveColumnByIndex(e,t){this.viaApi("moveColumnByIndex",e,t)}moveColumns(e,t){this.viaApi("moveColumns",e,t)}moveRowGroupColumn(e,t){this.viaApi("moveRowGroupColumn",e,t)}setColumnAggFunc(e,t){this.viaApi("setColumnAggFunc",e,t)}setColumnWidth(e,t,i=!0,n){this.viaApi("setColumnWidth",e,t,i,n)}setColumnWidths(e,t=!0,i){this.viaApi("setColumnWidths",e,t,i)}setPivotMode(e){this.viaApi("setPivotMode",e)}isPivotMode(){return this.viaApi("isPivotMode")}getPivotResultColumn(e,t){return this.viaApi("getPivotResultColumn",e,t)}setValueColumns(e){this.viaApi("setValueColumns",e)}getValueColumns(){return this.viaApi("getValueColumns")}removeValueColumn(e){this.viaApi("removeValueColumn",e)}removeValueColumns(e){this.viaApi("removeValueColumns",e)}addValueColumn(e){this.viaApi("addValueColumn",e)}addValueColumns(e){this.viaApi("addValueColumns",e)}setRowGroupColumns(e){this.viaApi("setRowGroupColumns",e)}removeRowGroupColumn(e){this.viaApi("removeRowGroupColumn",e)}removeRowGroupColumns(e){this.viaApi("removeRowGroupColumns",e)}addRowGroupColumn(e){this.viaApi("addRowGroupColumn",e)}addRowGroupColumns(e){this.viaApi("addRowGroupColumns",e)}getRowGroupColumns(){return this.viaApi("getRowGroupColumns")}setPivotColumns(e){this.viaApi("setPivotColumns",e)}removePivotColumn(e){this.viaApi("removePivotColumn",e)}removePivotColumns(e){this.viaApi("removePivotColumns",e)}addPivotColumn(e){this.viaApi("addPivotColumn",e)}addPivotColumns(e){this.viaApi("addPivotColumns",e)}getPivotColumns(){return this.viaApi("getPivotColumns")}getLeftDisplayedColumnGroups(){return this.viaApi("getLeftDisplayedColumnGroups")}getCenterDisplayedColumnGroups(){return this.viaApi("getCenterDisplayedColumnGroups")}getRightDisplayedColumnGroups(){return this.viaApi("getRightDisplayedColumnGroups")}getAllDisplayedColumnGroups(){return this.viaApi("getAllDisplayedColumnGroups")}autoSizeColumn(e,t){return this.viaApi("autoSizeColumn",e,t)}autoSizeColumns(e,t){this.viaApi("autoSizeColumns",e,t)}autoSizeAllColumns(e){this.viaApi("autoSizeAllColumns",e)}setPivotResultColumns(e){this.viaApi("setPivotResultColumns",e)}getPivotResultColumns(){return this.viaApi("getPivotResultColumns")}};g([ue("gridApi")],Dc.prototype,"api",2),Dc=g([he("columnApi")],Dc);var Ic=class extends st{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 e=e=>this.callColumnCellValueChangedHandler(e),t=this.gos.useAsyncEvents();this.eventService.addEventListener(ct.EVENT_CELL_VALUE_CHANGED,e,t),this.addDestroyFunc(()=>this.eventService.removeEventListener(ct.EVENT_CELL_VALUE_CHANGED,e,t)),this.addManagedPropertyListener("treeData",e=>this.isTreeData=e.currentValue)}getValue(e,t,i=!1,n=!1){if(this.initialised||this.init(),!t)return;const s=e.getColDef(),r=s.field,o=e.getColId(),a=t.data;let l;const c=t.groupData&&void 0!==t.groupData[o],h=!n&&t.aggData&&void 0!==t.aggData[o],u=this.isSsrm&&n&&!!e.getColDef().aggFunc,d=this.isSsrm&&t.footer&&t.field&&(!0===e.getColDef().showRowGroup||e.getColDef().showRowGroup===t.field);if(i&&s.filterValueGetter?l=this.executeFilterValueGetter(s.filterValueGetter,a,e,t):this.isTreeData&&h?l=t.aggData[o]:this.isTreeData&&s.valueGetter?l=this.executeValueGetter(s.valueGetter,a,e,t):this.isTreeData&&r&&a?l=F(a,r,e.isFieldContainsDots()):c?l=t.groupData[o]:h?l=t.aggData[o]:s.valueGetter?l=this.executeValueGetter(s.valueGetter,a,e,t):d?l=F(a,t.field,e.isFieldContainsDots()):r&&a&&!u&&(l=F(a,r,e.isFieldContainsDots())),this.cellExpressions&&"string"==typeof l&&0===l.indexOf("=")){const i=l.substring(1);l=this.executeValueGetter(i,a,e,t)}if(null==l){const i=this.getOpenedGroup(t,e);if(null!=i)return i}return l}parseValue(e,t,i,n){const s=e.getColDef(),r=this.gos.addGridCommonParams({node:t,data:null==t?void 0:t.data,oldValue:n,newValue:i,colDef:s,column:e}),o=s.valueParser;return b(o)?"function"==typeof o?o(r):this.expressionService.evaluate(o,r):i}formatValue(e,t,i,n,s=!0){let r,o=null;const a=e.getColDef();if(n?r=n:s&&(r=a.valueFormatter),r){const n=this.gos.addGridCommonParams({value:i,node:t,data:t?t.data:null,colDef:a,column:e});o="function"==typeof r?r(n):this.expressionService.evaluate(r,n)}else if(a.refData)return a.refData[i]||"";return null==o&&Array.isArray(i)&&(o=i.join(", ")),o}getOpenedGroup(e,t){if(!this.gos.get("showOpenedGroup"))return;if(!t.getColDef().showRowGroup)return;const i=t.getColDef().showRowGroup;let n=e.parent;for(;null!=n;){if(n.rowGroupColumn&&(!0===i||i===n.rowGroupColumn.getColId()))return n.key;n=n.parent}}setValue(e,t,i,n){const s=this.columnModel.getPrimaryColumn(t);if(!e||!s)return!1;C(e.data)&&(e.data={});const{field:r,valueSetter:o}=s.getColDef();if(C(r)&&C(o))return console.warn("AG Grid: you need either field or valueSetter set on colDef for editing to work"),!1;if(!this.dataTypeService.checkType(s,i))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:e,data:e.data,oldValue:this.getValue(s,e),newValue:i,colDef:s.getColDef(),column:s});let l;if(a.newValue=i,l=b(o)?"function"==typeof o?o(a):this.expressionService.evaluate(o,a):this.setValueUsingField(e.data,r,i,s.isFieldContainsDots()),void 0===l&&(l=!0),!l)return!1;e.resetQuickFilterAggregateText(),this.valueCache.onDataChanged(),a.newValue=this.getValue(s,e);const c={type:ct.EVENT_CELL_VALUE_CHANGED,event:null,rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:a.column,api:a.api,columnApi:a.columnApi,colDef:a.colDef,context:a.context,data:e.data,node:e,oldValue:a.oldValue,newValue:a.newValue,value:a.newValue,source:n};return this.eventService.dispatchEvent(c),!0}callColumnCellValueChangedHandler(e){const t=e.colDef.onCellValueChanged;"function"==typeof t&&this.getFrameworkOverrides().wrapOutgoing(()=>{t({node:e.node,data:e.data,oldValue:e.oldValue,newValue:e.newValue,colDef:e.colDef,column:e.column,api:e.api,columnApi:e.columnApi,context:e.context})})}setValueUsingField(e,t,i,n){if(!t)return!1;let s=!1;if(n){const n=t.split(".");let r=e;for(;n.length>0&&r;){const e=n.shift();0===n.length?(s=r[e]===i,s||(r[e]=i)):r=r[e]}}else s=e[t]===i,s||(e[t]=i);return!s}executeFilterValueGetter(e,t,i,n){const s=this.gos.addGridCommonParams({data:t,node:n,column:i,colDef:i.getColDef(),getValue:this.getValueCallback.bind(this,n)});return"function"==typeof e?e(s):this.expressionService.evaluate(e,s)}executeValueGetter(e,t,i,n){const s=i.getColId(),r=this.valueCache.getValue(n,s);if(void 0!==r)return r;const o=this.gos.addGridCommonParams({data:t,node:n,column:i,colDef:i.getColDef(),getValue:this.getValueCallback.bind(this,n)});let a;return a="function"==typeof e?e(o):this.expressionService.evaluate(e,o),this.valueCache.setValue(n,s,a),a}getValueCallback(e,t){const i=this.columnModel.getPrimaryColumn(t);return i?this.getValue(i,e):null}getKeyForNode(e,t){const i=this.getValue(e,t),n=e.getColDef().keyCreator;let s=i;return n&&(s=n(this.gos.addGridCommonParams({value:i,colDef:e.getColDef(),column:e,node:t,data:t.data}))),"string"==typeof s||null==s||(s=String(s),"[object Object]"===s&&z("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")),s}};g([ue("expressionService")],Ic.prototype,"expressionService",2),g([ue("columnModel")],Ic.prototype,"columnModel",2),g([ue("valueCache")],Ic.prototype,"valueCache",2),g([ue("dataTypeService")],Ic.prototype,"dataTypeService",2),g([le],Ic.prototype,"init",1),Ic=g([he("valueService")],Ic);var Rc=class extends st{constructor(){super(...arguments),this.expressionToFunctionCache={}}setBeans(e){this.logger=e.create("ExpressionService")}evaluate(e,t){if("string"==typeof e)return this.evaluateExpression(e,t);console.error("AG Grid: value should be either a string or a function",e)}evaluateExpression(e,t){try{return this.createExpressionFunction(e)(t.value,t.context,t.oldValue,t.newValue,t.value,t.node,t.data,t.colDef,t.rowIndex,t.api,t.columnApi,t.getValue,t.column,t.columnGroup)}catch(i){return console.log("Processing of the expression failed"),console.log("Expression = "+e),console.log("Params =",t),console.log("Exception = "+i),null}}createExpressionFunction(e){if(this.expressionToFunctionCache[e])return this.expressionToFunctionCache[e];const t=this.createFunctionBody(e),i=new Function("x, ctx, oldValue, newValue, value, node, data, colDef, rowIndex, api, columnApi, getValue, column, columnGroup",t);return this.expressionToFunctionCache[e]=i,i}createFunctionBody(e){return e.indexOf("return")>=0?e:"return "+e+";"}};g([f(0,ge("loggerFactory"))],Rc.prototype,"setBeans",1),Rc=g([he("expressionService")],Rc);var kc=class extends st{setBeans(e){this.logging=e.get("debug")}create(e){return new Pc(e,this.isLogging.bind(this))}isLogging(){return this.logging}};g([f(0,ge("gridOptionsService"))],kc.prototype,"setBeans",1),kc=g([he("loggerFactory")],kc);var Pc=class{constructor(e,t){this.name=e,this.isLoggingFunc=t}isLogging(){return this.isLoggingFunc()}log(e){this.isLoggingFunc()&&console.log("AG Grid."+this.name+": "+e)}},_c=class extends st{setComp(e,t,i){this.view=e,this.eGridHostDiv=t,this.eGui=i,this.eGui.setAttribute("grid-id",this.context.getGridId()),this.dragAndDropService.addDropTarget({getContainer:()=>this.eGui,isInterestedIn:e=>1===e||0===e,getIconName:()=>Br.ICON_NOT_ALLOWED}),this.mouseEventService.stampTopLevelGridCompWithGridInstance(t),this.createManagedBean(new Zo(this.view)),this.addRtlSupport();const n=this.resizeObserverService.observeResize(this.eGridHostDiv,this.onGridSizeChanged.bind(this));this.addDestroyFunc(()=>n()),this.ctrlsService.register("gridCtrl",this)}isDetailGrid(){var e;const t=this.focusService.findTabbableParent(this.getGui());return(null==(e=null==t?void 0:t.getAttribute("row-id"))?void 0:e.startsWith("detail"))||!1}showDropZones(){return re.__isRegistered("@ag-grid-enterprise/row-grouping",this.context.getGridId())}showSideBar(){return re.__isRegistered("@ag-grid-enterprise/side-bar",this.context.getGridId())}showStatusBar(){return re.__isRegistered("@ag-grid-enterprise/status-bar",this.context.getGridId())}showWatermark(){return re.__isRegistered("@ag-grid-enterprise/core",this.context.getGridId())}onGridSizeChanged(){const e={type:ct.EVENT_GRID_SIZE_CHANGED,clientWidth:this.eGridHostDiv.clientWidth,clientHeight:this.eGridHostDiv.clientHeight};this.eventService.dispatchEvent(e)}addRtlSupport(){const e=this.gos.get("enableRtl")?"ag-rtl":"ag-ltr";this.view.setRtlClass(e)}destroyGridUi(){this.view.destroyGridUi()}getGui(){return this.eGui}setResizeCursor(e){this.view.setCursor(e?"ew-resize":null)}disableUserSelect(e){this.view.setUserSelect(e?"none":null)}focusNextInnerContainer(e){const t=this.view.getFocusableContainers(),i=this.gos.getActiveDomElement(),n=t.findIndex(e=>e.contains(i))+(e?-1:1);return!(n<=0||n>=t.length)&&this.focusService.focusInto(t[n])}focusInnerElement(e){const t=this.view.getFocusableContainers(),i=this.columnModel.getAllDisplayedColumns();if(e){if(t.length>1)return this.focusService.focusInto(Ie(t),!0);const e=Ie(i);if(this.focusService.focusGridView(e,!0))return!0}if(0===this.gos.get("headerHeight")||this.gos.get("suppressHeaderFocus")){if(this.focusService.focusGridView(i[0]))return!0;for(let e=1;e<t.length;e++)if(this.focusService.focusInto(t[e]))return!0;return!1}return this.focusService.focusFirstHeader()}forceFocusOutOfContainer(e=!1){this.view.forceFocusOutOfContainer(e)}};g([ue("focusService")],_c.prototype,"focusService",2),g([ue("resizeObserverService")],_c.prototype,"resizeObserverService",2),g([ue("columnModel")],_c.prototype,"columnModel",2),g([ue("ctrlsService")],_c.prototype,"ctrlsService",2),g([ue("mouseEventService")],_c.prototype,"mouseEventService",2),g([ue("dragAndDropService")],_c.prototype,"dragAndDropService",2);var Lc=class extends El{constructor(e){super(),this.eGridDiv=e}postConstruct(){this.logger=this.loggerFactory.create("GridComp");const e={destroyGridUi:()=>this.destroyBean(this),setRtlClass:e=>this.addCssClass(e),forceFocusOutOfContainer:this.forceFocusOutOfContainer.bind(this),updateLayoutClasses:this.updateLayoutClasses.bind(this),getFocusableContainers:this.getFocusableContainers.bind(this),setUserSelect:e=>{this.getGui().style.userSelect=null!=e?e:"",this.getGui().style.webkitUserSelect=null!=e?e:""},setCursor:e=>{this.getGui().style.cursor=null!=e?e:""}};this.ctrl=this.createManagedBean(new _c);const t=this.createTemplate();this.setTemplate(t),this.ctrl.setComp(e,this.eGridDiv,this.getGui()),this.insertGridIntoDom(),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:e=>this.ctrl.focusInnerElement(e),forceFocusOutWhenTabGuardsAreEmpty:!0})}insertGridIntoDom(){const e=this.getGui();this.eGridDiv.appendChild(e),this.addDestroyFunc(()=>{this.eGridDiv.removeChild(e),this.logger.log("Grid removed from DOM")})}updateLayoutClasses(e,t){const i=this.eRootWrapperBody.classList;i.toggle("ag-layout-auto-height",t.autoHeight),i.toggle("ag-layout-normal",t.normal),i.toggle("ag-layout-print",t.print),this.addOrRemoveCssClass("ag-layout-auto-height",t.autoHeight),this.addOrRemoveCssClass("ag-layout-normal",t.normal),this.addOrRemoveCssClass("ag-layout-print",t.print)}createTemplate(){return`<div class="ag-root-wrapper" role="presentation">\n                ${this.ctrl.showDropZones()?"<ag-grid-header-drop-zones></ag-grid-header-drop-zones>":""}\n                <div class="ag-root-wrapper-body" ref="rootWrapperBody" role="presentation">\n                    <ag-grid-body ref="gridBody"></ag-grid-body>\n                    ${this.ctrl.showSideBar()?'<ag-side-bar ref="sideBar"></ag-side-bar>':""}\n                </div>\n                ${this.ctrl.showStatusBar()?'<ag-status-bar ref="statusBar"></ag-status-bar>':""}\n                <ag-pagination></ag-pagination>\n                ${this.ctrl.showWatermark()?"<ag-watermark></ag-watermark>":""}\n            </div>`}getFocusableElement(){return this.eRootWrapperBody}getFocusableContainers(){const e=[this.gridBodyComp.getGui()];return this.sideBarComp&&e.push(this.sideBarComp.getGui()),e.filter(e=>xn(e))}};g([ue("loggerFactory")],Lc.prototype,"loggerFactory",2),g([Ss("gridBody")],Lc.prototype,"gridBodyComp",2),g([Ss("sideBar")],Lc.prototype,"sideBarComp",2),g([Ss("rootWrapperBody")],Lc.prototype,"eRootWrapperBody",2),g([le],Lc.prototype,"postConstruct",1);var Nc=class extends st{progressSort(e,t,i){const n=this.getNextSortDirection(e);this.setSortForColumn(e,n,t,i)}setSortForColumn(e,t,i,n){"asc"!==t&&"desc"!==t&&(t=null);let s=[e];if(this.gos.isColumnsSortingCoupledToGroup()&&e.getColDef().showRowGroup){const t=this.columnModel.getSourceColumnsForGroupColumn(e),i=null==t?void 0:t.filter(e=>e.isSortable());i&&(s=[e,...i])}s.forEach(e=>e.setSort(t,n));const r=[];if(!i&&!this.gos.get("alwaysMultiSort")||this.gos.get("suppressMultiSort")){const e=this.clearSortBarTheseColumns(s,n);r.push(...e)}this.updateSortIndex(e),r.push(...s),this.dispatchSortChangedEvents(n,r)}updateSortIndex(e){const t=this.gos.isColumnsSortingCoupledToGroup(),i=this.columnModel.getGroupDisplayColumnForGroup(e.getId()),n=t&&i||e,s=this.getColumnsWithSortingOrdered();this.columnModel.getPrimaryAndSecondaryAndAutoColumns().forEach(e=>e.setSortIndex(null));const r=s.filter(e=>!(t&&e.getColDef().showRowGroup||e===n));(n.getSort()?[...r,n]:r).forEach((e,t)=>{e.setSortIndex(t)})}onSortChanged(e,t){this.dispatchSortChangedEvents(e,t)}isSortActive(){const e=this.columnModel.getPrimaryAndSecondaryAndAutoColumns().filter(e=>!!e.getSort());return e&&e.length>0}dispatchSortChangedEvents(e,t){const i={type:ct.EVENT_SORT_CHANGED,source:e};t&&(i.columns=t),this.eventService.dispatchEvent(i)}clearSortBarTheseColumns(e,t){const i=[];return this.columnModel.getPrimaryAndSecondaryAndAutoColumns().forEach(n=>{e.includes(n)||(n.getSort()&&i.push(n),n.setSort(void 0,t))}),i}getNextSortDirection(e){let t;if(t=e.getColDef().sortingOrder?e.getColDef().sortingOrder:this.gos.get("sortingOrder")?this.gos.get("sortingOrder"):Nc.DEFAULT_SORTING_ORDER,!Array.isArray(t)||t.length<=0)return console.warn(`AG Grid: sortingOrder must be an array with at least one element, currently it's ${t}`),null;const i=t.indexOf(e.getSort()),n=i<0,s=i==t.length-1;let r;return r=n||s?t[0]:t[i+1],Nc.DEFAULT_SORTING_ORDER.indexOf(r)<0?(console.warn("AG Grid: invalid sort type "+r),null):r}getIndexedSortMap(){let e=this.columnModel.getPrimaryAndSecondaryAndAutoColumns().filter(e=>!!e.getSort());if(this.columnModel.isPivotMode()){const t=this.gos.isColumnsSortingCoupledToGroup();e=e.filter(e=>{const i=!!e.getAggFunc(),n=!e.isPrimary(),s=t?this.columnModel.getGroupDisplayColumnForGroup(e.getId()):e.getColDef().showRowGroup;return i||n||s})}const t=this.columnModel.getRowGroupColumns().filter(e=>!!e.getSort()),i={};e.forEach((e,t)=>i[e.getId()]=t),e.sort((e,t)=>{const n=e.getSortIndex(),s=t.getSortIndex();return null!=n&&null!=s?n-s:null==n&&null==s?i[e.getId()]>i[t.getId()]?1:-1:null==s?-1:1});const n=this.gos.isColumnsSortingCoupledToGroup()&&!!t.length;n&&(e=[...new Set(e.map(e=>{var t;return null!=(t=this.columnModel.getGroupDisplayColumnForGroup(e.getId()))?t:e}))]);const s=new Map;return e.forEach((e,t)=>s.set(e,t)),n&&t.forEach(e=>{const t=this.columnModel.getGroupDisplayColumnForGroup(e.getId());s.set(e,s.get(t))}),s}getColumnsWithSortingOrdered(){return[...this.getIndexedSortMap().entries()].sort(([e,t],[i,n])=>t-n).map(([e])=>e)}getSortModel(){return this.getColumnsWithSortingOrdered().filter(e=>e.getSort()).map(e=>({sort:e.getSort(),colId:e.getId()}))}getSortOptions(){return this.getColumnsWithSortingOrdered().filter(e=>e.getSort()).map(e=>({sort:e.getSort(),column:e}))}canColumnDisplayMixedSort(e){const t=this.gos.isColumnsSortingCoupledToGroup(),i=!!e.getColDef().showRowGroup;return t&&i}getDisplaySortForColumn(e){const t=this.columnModel.getSourceColumnsForGroupColumn(e);if(!this.canColumnDisplayMixedSort(e)||!(null==t?void 0:t.length))return e.getSort();const i=null!=e.getColDef().field||e.getColDef().valueGetter?[e,...t]:t,n=i[0].getSort();return i.every(e=>e.getSort()==n)?n:"mixed"}getDisplaySortIndexForColumn(e){return this.getIndexedSortMap().get(e)}};Nc.DEFAULT_SORTING_ORDER=["asc","desc",null],g([ue("columnModel")],Nc.prototype,"columnModel",2),Nc=g([he("sortController")],Nc);var Oc=class extends st{static addKeyboardModeEvents(e){this.instanceCount>0||(e.addEventListener("keydown",Oc.toggleKeyboardMode),e.addEventListener("mousedown",Oc.toggleKeyboardMode))}static removeKeyboardModeEvents(e){this.instanceCount>0||(e.addEventListener("keydown",Oc.toggleKeyboardMode),e.addEventListener("mousedown",Oc.toggleKeyboardMode))}static toggleKeyboardMode(e){const t=Oc.keyboardModeActive,i="keydown"===e.type;i&&(e.ctrlKey||e.metaKey||e.altKey)||t!==i&&(Oc.keyboardModeActive=i)}static unregisterGridCompController(e){Oc.removeKeyboardModeEvents(e)}init(){const e=this.clearFocusedCell.bind(this);this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PIVOT_MODE_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_NEW_COLUMNS_LOADED,this.onColumnEverythingChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_GROUP_OPENED,e),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_ROW_GROUP_CHANGED,e),this.registerKeyboardFocusEvents(),this.ctrlsService.whenReady(e=>{this.gridCtrl=e.gridCtrl})}registerKeyboardFocusEvents(){const e=this.gos.getDocument();Oc.addKeyboardModeEvents(e),Oc.instanceCount++,this.addDestroyFunc(()=>{Oc.instanceCount--,Oc.unregisterGridCompController(e)})}onColumnEverythingChanged(){if(!this.focusedCellPosition)return;const e=this.focusedCellPosition.column,t=this.columnModel.getGridColumn(e.getId());e!==t&&this.clearFocusedCell()}isKeyboardMode(){return Oc.keyboardModeActive}getFocusCellToUseAfterRefresh(){return this.gos.get("suppressFocusAfterRefresh")||!this.focusedCellPosition||this.isDomDataMissingInHierarchy(this.gos.getActiveDomElement(),va.DOM_DATA_KEY_ROW_CTRL)?null:this.focusedCellPosition}getFocusHeaderToUseAfterRefresh(){return this.gos.get("suppressFocusAfterRefresh")||!this.focusedHeaderPosition||this.isDomDataMissingInHierarchy(this.gos.getActiveDomElement(),el.DOM_DATA_KEY_HEADER_CTRL)?null:this.focusedHeaderPosition}isDomDataMissingInHierarchy(e,t){let i=e;for(;i;){if(this.gos.getDomData(i,t))return!1;i=i.parentNode}return!0}getFocusedCell(){return this.focusedCellPosition}shouldRestoreFocus(e){return!!this.isCellRestoreFocused(e)&&(setTimeout(()=>{this.restoredFocusedCellPosition=null},0),!0)}isCellRestoreFocused(e){return null!=this.restoredFocusedCellPosition&&this.cellPositionUtils.equals(e,this.restoredFocusedCellPosition)}setRestoreFocusedCell(e){"react"===this.getFrameworkOverrides().renderingEngine&&(this.restoredFocusedCellPosition=e)}getFocusEventParams(){const{rowIndex:e,rowPinned:t,column:i}=this.focusedCellPosition,n={rowIndex:e,rowPinned:t,column:i,isFullWidthCell:!1},s=this.rowRenderer.getRowByPosition({rowIndex:e,rowPinned:t});return s&&(n.isFullWidthCell=s.isFullWidth()),n}clearFocusedCell(){if(this.restoredFocusedCellPosition=null,null==this.focusedCellPosition)return;const e=u({type:ct.EVENT_CELL_FOCUS_CLEARED},this.getFocusEventParams());this.focusedCellPosition=null,this.eventService.dispatchEvent(e)}setFocusedCell(e){const{column:t,rowIndex:i,rowPinned:n,forceBrowserFocus:s=!1,preventScrollOnBrowserFocus:r=!1}=e,o=this.columnModel.getGridColumn(t);if(!o)return void(this.focusedCellPosition=null);this.focusedCellPosition=o?{rowIndex:i,rowPinned:v(n),column:o}:null;const a=d(u({type:ct.EVENT_CELL_FOCUSED},this.getFocusEventParams()),{forceBrowserFocus:s,preventScrollOnBrowserFocus:r,floating:null});this.eventService.dispatchEvent(a)}isCellFocused(e){return null!=this.focusedCellPosition&&this.cellPositionUtils.equals(e,this.focusedCellPosition)}isRowNodeFocused(e){return this.isRowFocused(e.rowIndex,e.rowPinned)}isHeaderWrapperFocused(e){if(null==this.focusedHeaderPosition)return!1;const t=e.getColumnGroupChild(),i=e.getRowIndex(),n=e.getPinned(),{column:s,headerRowIndex:r}=this.focusedHeaderPosition;return t===s&&i===r&&n==s.getPinned()}clearFocusedHeader(){this.focusedHeaderPosition=null}getFocusedHeader(){return this.focusedHeaderPosition}setFocusedHeader(e,t){this.focusedHeaderPosition={headerRowIndex:e,column:t}}focusHeaderPosition(e){if(this.gos.get("suppressHeaderFocus"))return!1;const{direction:t,fromTab:i,allowUserOverride:n,event:s,fromCell:r,rowWithoutSpanValue:o}=e;let{headerPosition:a}=e;if(r&&this.filterManager.isAdvancedFilterHeaderActive())return this.focusAdvancedFilter(a);if(n){const e=this.getFocusedHeader(),n=this.headerNavigationService.getHeaderRowCount();if(i){const i=this.gos.getCallback("tabToNextHeader");i&&(a=this.getHeaderPositionFromUserFunc({userFunc:i,direction:t,currentPosition:e,headerPosition:a,headerRowCount:n}))}else{const t=this.gos.getCallback("navigateToNextHeader");t&&s&&(a=t({key:s.key,previousHeaderPosition:e,nextHeaderPosition:a,headerRowCount:n,event:s}))}}return!!a&&this.focusProvidedHeaderPosition({headerPosition:a,direction:t,event:s,fromCell:r,rowWithoutSpanValue:o})}focusHeaderPositionFromUserFunc(e){if(this.gos.get("suppressHeaderFocus"))return!1;const{userFunc:t,headerPosition:i,direction:n,event:s}=e,r=this.getFocusedHeader(),o=this.headerNavigationService.getHeaderRowCount(),a=this.getHeaderPositionFromUserFunc({userFunc:t,direction:n,currentPosition:r,headerPosition:i,headerRowCount:o});return!!a&&this.focusProvidedHeaderPosition({headerPosition:a,direction:n,event:s})}getHeaderPositionFromUserFunc(e){const{userFunc:t,direction:i,currentPosition:n,headerPosition:s,headerRowCount:r}=e,o=t({backwards:"Before"===i,previousHeaderPosition:n,nextHeaderPosition:s,headerRowCount:r});return!0===o||null===o?(null===o&&z("Returning `null` from tabToNextHeader is deprecated. Return `true` to stay on the current header, or `false` to let the browser handle the tab behaviour."),n):!1===o?null:o}focusProvidedHeaderPosition(e){const{headerPosition:t,direction:i,fromCell:n,rowWithoutSpanValue:s,event:r}=e;if(-1===t.headerRowIndex)return this.filterManager.isAdvancedFilterHeaderActive()?this.focusAdvancedFilter(t):this.focusGridView(t.column);this.headerNavigationService.scrollToColumn(t.column,i);const o=this.ctrlsService.getHeaderRowContainerCtrl(t.column.getPinned()).focusHeader(t.headerRowIndex,t.column,r);return o&&(null!=s||n)&&this.headerNavigationService.setCurrentHeaderRowWithoutSpan(null!=s?s:-1),o}focusFirstHeader(){let e=this.columnModel.getAllDisplayedColumns()[0];if(!e)return!1;e.getParent()&&(e=this.columnModel.getColumnGroupAtLevel(e,0));const t=this.headerPositionUtils.getHeaderIndexToFocus(e,0);return this.focusHeaderPosition({headerPosition:t,rowWithoutSpanValue:0})}focusLastHeader(e){const t=this.headerNavigationService.getHeaderRowCount()-1,i=Ie(this.columnModel.getAllDisplayedColumns());return this.focusHeaderPosition({headerPosition:{headerRowIndex:t,column:i},rowWithoutSpanValue:-1,event:e})}focusPreviousFromFirstCell(e){return this.filterManager.isAdvancedFilterHeaderActive()?this.focusAdvancedFilter(null):this.focusLastHeader(e)}isAnyCellFocused(){return!!this.focusedCellPosition}isRowFocused(e,t){return null!=this.focusedCellPosition&&this.focusedCellPosition.rowIndex===e&&this.focusedCellPosition.rowPinned===v(t)}findFocusableElements(e,t,i=!1){const n=sn;let s=rn;t&&(s+=", "+t),i&&(s+=', [tabindex="-1"]');const r=Array.prototype.slice.apply(e.querySelectorAll(n)).filter(e=>xn(e)),o=Array.prototype.slice.apply(e.querySelectorAll(s));return o.length?(a=o,r.filter(e=>-1===a.indexOf(e))):r;var a}focusInto(e,t=!1,i=!1){const n=this.findFocusableElements(e,null,i),s=t?Ie(n):n[0];return!!s&&(s.focus({preventScroll:!0}),!0)}findFocusableElementBeforeTabGuard(e,t){if(!t)return null;const i=this.findFocusableElements(e),n=i.indexOf(t);if(-1===n)return null;let s=-1;for(let e=n-1;e>=0;e--)if(i[e].classList.contains("ag-tab-guard-top")){s=e;break}return s<=0?null:i[s-1]}findNextFocusableElement(e=this.eGridDiv,t,i){const n=this.findFocusableElements(e,t?':not([tabindex="-1"])':null),s=this.gos.getActiveDomElement();let r;r=t?n.findIndex(e=>e.contains(s)):n.indexOf(s);const o=r+(i?-1:1);return o<0||o>=n.length?null:n[o]}isTargetUnderManagedComponent(e,t){if(!t)return!1;const i=e.querySelectorAll(`.${Is.FOCUS_MANAGED_CLASS}`);if(!i.length)return!1;for(let e=0;e<i.length;e++)if(i[e].contains(t))return!0;return!1}findTabbableParent(e,t=5){let i=0;for(;e&&null===Li(e)&&++i<=t;)e=e.parentElement;return null===Li(e)?null:e}focusGridView(e,t){var i;if(this.gos.get("suppressCellFocus"))return t?this.gos.get("suppressHeaderFocus")?this.focusNextGridCoreContainer(!0,!0):this.focusLastHeader():this.focusNextGridCoreContainer(!1);const n=t?this.rowPositionUtils.getLastRow():this.rowPositionUtils.getFirstRow();if(!n)return!1;const{rowIndex:s,rowPinned:r}=n,o=this.getFocusedHeader();return!e&&o&&(e=o.column),!(null==s||!e||(this.navigationService.ensureCellVisible({rowIndex:s,column:e,rowPinned:r}),this.setFocusedCell({rowIndex:s,column:e,rowPinned:v(r),forceBrowserFocus:!0}),null==(i=this.rangeService)||i.setRangeToCell({rowIndex:s,rowPinned:r,column:e}),0))}focusNextGridCoreContainer(e,t=!1){return!(t||!this.gridCtrl.focusNextInnerContainer(e))||((t||!e&&!this.gridCtrl.isDetailGrid())&&this.gridCtrl.forceFocusOutOfContainer(e),!1)}focusAdvancedFilter(e){var t,i;return this.advancedFilterFocusColumn=null==e?void 0:e.column,null!=(i=null==(t=this.advancedFilterService)?void 0:t.getCtrl().focusHeaderComp())&&i}focusNextFromAdvancedFilter(e,t){var i,n;const s=null!=(n=t?void 0:this.advancedFilterFocusColumn)?n:null==(i=this.columnModel.getAllDisplayedColumns())?void 0:i[0];return e?this.focusHeaderPosition({headerPosition:{column:s,headerRowIndex:this.headerNavigationService.getHeaderRowCount()-1}}):this.focusGridView(s)}clearAdvancedFilterColumn(){this.advancedFilterFocusColumn=void 0}};Oc.keyboardModeActive=!1,Oc.instanceCount=0,g([ue("eGridDiv")],Oc.prototype,"eGridDiv",2),g([ue("columnModel")],Oc.prototype,"columnModel",2),g([ue("headerNavigationService")],Oc.prototype,"headerNavigationService",2),g([ue("headerPositionUtils")],Oc.prototype,"headerPositionUtils",2),g([ue("rowRenderer")],Oc.prototype,"rowRenderer",2),g([ue("rowPositionUtils")],Oc.prototype,"rowPositionUtils",2),g([ue("cellPositionUtils")],Oc.prototype,"cellPositionUtils",2),g([ue("navigationService")],Oc.prototype,"navigationService",2),g([ue("ctrlsService")],Oc.prototype,"ctrlsService",2),g([ue("filterManager")],Oc.prototype,"filterManager",2),g([de("rangeService")],Oc.prototype,"rangeService",2),g([de("advancedFilterService")],Oc.prototype,"advancedFilterService",2),g([le],Oc.prototype,"init",1),Oc=g([he("focusService")],Oc);var Fc=class extends st{setMouseOver(e){this.selectedColumns=e;const t={type:ct.EVENT_COLUMN_HOVER_CHANGED};this.eventService.dispatchEvent(t)}clearMouseOver(){this.selectedColumns=null;const e={type:ct.EVENT_COLUMN_HOVER_CHANGED};this.eventService.dispatchEvent(e)}isHovered(e){return!!this.selectedColumns&&this.selectedColumns.indexOf(e)>=0}};Fc=g([he("columnHoverService")],Fc);var Gc=class extends st{constructor(){super(...arguments),this.executeNextFuncs=[],this.executeLaterFuncs=[],this.active=!1,this.suppressAnimation=!1,this.animationThreadCount=0}postConstruct(){this.ctrlsService.whenReady(e=>this.gridBodyCtrl=e.gridBodyCtrl)}isActive(){return this.active&&!this.suppressAnimation}setSuppressAnimation(e){this.suppressAnimation=e}start(){this.active||this.gos.get("suppressColumnMoveAnimation")||this.gos.get("enableRtl")||(this.ensureAnimationCssClassPresent(),this.active=!0)}finish(){this.active&&this.flush(()=>{this.active=!1})}executeNextVMTurn(e){this.active?this.executeNextFuncs.push(e):e()}executeLaterVMTurn(e){this.active?this.executeLaterFuncs.push(e):e()}ensureAnimationCssClassPresent(){this.animationThreadCount++;const e=this.animationThreadCount;this.gridBodyCtrl.setColumnMovingCss(!0),this.executeLaterFuncs.push(()=>{this.animationThreadCount===e&&this.gridBodyCtrl.setColumnMovingCss(!1)})}flush(e){if(0===this.executeNextFuncs.length&&0===this.executeLaterFuncs.length)return void e();const t=e=>{for(;e.length;){const t=e.pop();t&&t()}};this.getFrameworkOverrides().wrapIncoming(()=>{window.setTimeout(()=>t(this.executeNextFuncs),0),window.setTimeout(()=>{e(),t(this.executeLaterFuncs)},200)})}};g([ue("ctrlsService")],Gc.prototype,"ctrlsService",2),g([le],Gc.prototype,"postConstruct",1),Gc=g([he("columnAnimationService")],Gc);var Bc=class extends st{postConstruct(){this.ctrlsService.whenReady(e=>{this.centerRowsCtrl=e.center,this.addManagedListener(this.eventService,ct.EVENT_BODY_HEIGHT_CHANGED,this.checkPageSize.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_SCROLL_VISIBILITY_CHANGED,this.checkPageSize.bind(this)),this.addManagedPropertyListener("paginationAutoPageSize",this.onPaginationAutoSizeChanged.bind(this)),this.checkPageSize()})}notActive(){return!this.gos.get("paginationAutoPageSize")||null==this.centerRowsCtrl}onPaginationAutoSizeChanged(){this.notActive()?this.paginationProxy.unsetAutoCalculatedPageSize():this.checkPageSize()}checkPageSize(){if(this.notActive())return;const e=this.centerRowsCtrl.getViewportSizeFeature().getBodyHeight();if(e>0){const t=()=>{const t=this.gos.getRowHeightAsNumber(),i=Math.floor(e/t);this.paginationProxy.setPageSize(i,"autoCalculated")};this.isBodyRendered?Q(()=>t(),50)():(t(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}};g([ue("ctrlsService")],Bc.prototype,"ctrlsService",2),g([ue("paginationProxy")],Bc.prototype,"paginationProxy",2),g([le],Bc.prototype,"postConstruct",1),Bc=g([he("paginationAutoPageSizeService")],Bc);var Vc=class extends st{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(e,t,i){this.active&&(e.__cacheVersion!==this.cacheVersion&&(e.__cacheVersion=this.cacheVersion,e.__cacheData={}),e.__cacheData[t]=i)}getValue(e,t){if(this.active&&e.__cacheVersion===this.cacheVersion)return e.__cacheData[t]}};g([le],Vc.prototype,"init",1),Vc=g([he("valueCache")],Vc);var Hc=class extends st{init(){"clientSide"===this.rowModel.getType()&&(this.clientSideRowModel=this.rowModel),this.addManagedListener(this.eventService,ct.EVENT_CELL_VALUE_CHANGED,this.onCellValueChanged.bind(this))}onCellValueChanged(e){"paste"!==e.source&&this.doChangeDetection(e.node,e.column)}doChangeDetection(e,t){if(this.gos.get("suppressChangeDetection"))return;const i=[e];if(this.clientSideRowModel&&!e.isRowPinned()){const n=this.gos.get("aggregateOnlyChangedColumns"),s=new Gl(n,this.clientSideRowModel.getRootNode());s.addParentNode(e.parent,[t]),this.clientSideRowModel.doAggregate(s),s.forEachChangedNodeDepthFirst(e=>{i.push(e)})}this.rowRenderer.refreshCells({rowNodes:i})}};g([ue("rowModel")],Hc.prototype,"rowModel",2),g([ue("rowRenderer")],Hc.prototype,"rowRenderer",2),g([le],Hc.prototype,"init",1),Hc=g([he("changeDetectionService")],Hc);var Uc=class extends st{adaptFunction(e,t){const i=this.componentMetadataProvider.retrieve(e);return i&&i.functionAdapter?i.functionAdapter(t):null}adaptCellRendererFunction(e){return class{refresh(e){return!1}getGui(){return this.eGui}init(t){const i=e(t),n=typeof i;this.eGui="string"!==n&&"number"!==n&&"boolean"!==n?null!=i?i:En("<span></span>"):En("<span>"+i+"</span>")}}}doesImplementIComponent(e){return!!e&&e.prototype&&"getGui"in e.prototype}};g([ue("componentMetadataProvider")],Uc.prototype,"componentMetadataProvider",2),Uc=g([he("agComponentUtils")],Uc);var zc=class extends st{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(e){return this.componentMetaData[e]}};g([ue("agComponentUtils")],zc.prototype,"agComponentUtils",2),g([le],zc.prototype,"postConstruct",1),zc=g([he("componentMetadataProvider")],zc);var Wc={"ag-theme-custom":{headerHeight:25,headerCellMinWidth:24,listItemHeight:20,rowHeight:25,chartMenuPanelWidth:220},"ag-theme-material":{headerHeight:56,headerCellMinWidth:48,listItemHeight:32,rowHeight:48,chartMenuPanelWidth:240},"ag-theme-balham":{headerHeight:32,headerCellMinWidth:24,listItemHeight:24,rowHeight:28,chartMenuPanelWidth:220},"ag-theme-alpine":{headerHeight:48,headerCellMinWidth:36,listItemHeight:24,rowHeight:42,chartMenuPanelWidth:240},"ag-theme-quartz":{headerHeight:48,headerCellMinWidth:36,listItemHeight:24,rowHeight:42,chartMenuPanelWidth:260}},jc={headerHeight:["ag-header-row"],headerCellMinWidth:["ag-header-cell"],listItemHeight:["ag-virtual-list-item"],rowHeight:["ag-row"],chartMenuPanelWidth:["ag-chart-docked-container"]},$c=class extends st{constructor(){super(...arguments),this.calculatedSizes={},this.calculatedTheme=null}postConstruct(){var e;const t=null!=(e=this.getTheme().el)?e:this.eGridDiv;this.addManagedPropertyListener("rowHeight",()=>this.refreshRowHeightVariable()),this.mutationObserver=new MutationObserver(()=>{this.calculatedSizes={},this.calculatedTheme=null,this.calculatedTheme=this.getTheme(),this.fireGridStylesChangedEvent()}),this.mutationObserver.observe(t||this.eGridDiv,{attributes:!0,attributeFilter:["class"]})}fireGridStylesChangedEvent(){const e={type:ct.EVENT_GRID_STYLES_CHANGED};this.eventService.dispatchEvent(e)}getSassVariable(e){const{themeFamily:t,el:i}=this.getTheme();if(!t||0!==t.indexOf("ag-theme"))return;this.calculatedSizes||(this.calculatedSizes={}),this.calculatedSizes[t]||(this.calculatedSizes[t]={});const n=this.calculatedSizes[t][e];return null!=n?n:(this.calculatedSizes[t][e]=this.calculateValueForSassProperty(e,t,i),this.calculatedSizes[t][e])}calculateValueForSassProperty(e,t,i){const n="ag-theme-"+(t.match("material")?"material":t.match("balham")?"balham":t.match("alpine")?"alpine":"custom"),s=Wc[n][e],r=this.gos.getDocument();if(i||(i=this.eGridDiv),!jc[e])return s;const o=jc[e],a=r.createElement("div"),l=Array.from(i.classList);a.classList.add(t,...l),a.style.position="absolute";const c=o.reduce((e,t)=>{const i=r.createElement("div");return i.style.position="static",i.classList.add(t),e.appendChild(i),i},a);let h=0;if(r.body){r.body.appendChild(a);const t=-1!==e.toLowerCase().indexOf("height")?"height":"width";h=parseInt(window.getComputedStyle(c)[t],10),r.body.removeChild(a)}return h||s}isThemeDark(){const{theme:e}=this.getTheme();return!!e&&e.indexOf("dark")>=0}chartMenuPanelWidth(){return this.getSassVariable("chartMenuPanelWidth")}getTheme(){if(this.calculatedTheme)return this.calculatedTheme;const e=/\bag-(material|(?:theme-([\w\-]*)))\b/g;let t=this.eGridDiv,i=null,n=[];for(;t;){if(i=e.exec(t.className),i){const i=t.className.match(e);i&&(n=i);break}t=t.parentElement||void 0}if(!i)return{allThemes:n};const s=i[0];return this.calculatedTheme={theme:s,el:t,themeFamily:s.replace(/-dark$/,""),allThemes:n},this.calculatedTheme}getFromTheme(e,t){var i;return null!=(i=this.getSassVariable(t))?i:e}getDefaultRowHeight(){return this.getFromTheme(25,"rowHeight")}getListItemHeight(){return this.getFromTheme(20,"listItemHeight")}refreshRowHeightVariable(){const e=this.eGridDiv.style.getPropertyValue("--ag-line-height").trim(),t=this.gos.get("rowHeight");if(null==t||isNaN(t)||!isFinite(t))return null!==e&&this.eGridDiv.style.setProperty("--ag-line-height",null),-1;const i=`${t}px`;return e!=i?(this.eGridDiv.style.setProperty("--ag-line-height",i),t):""!=e?parseFloat(e):-1}getMinColWidth(){const e=this.getFromTheme(null,"headerCellMinWidth");return b(e)?Math.max(e,10):10}destroy(){this.calculatedSizes=null,this.mutationObserver&&this.mutationObserver.disconnect(),super.destroy()}};g([ue("eGridDiv")],$c.prototype,"eGridDiv",2),g([le],$c.prototype,"postConstruct",1),$c=g([he("environment")],$c);var Kc=class extends st{constructor(){super(...arguments),this.scrollY=0,this.uiBodyHeight=0}agWire(e){this.logger=e.create("RowContainerHeightService")}postConstruct(){this.addManagedListener(this.eventService,ct.EVENT_BODY_HEIGHT_CHANGED,this.updateOffset.bind(this)),this.maxDivHeight=Ni(),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 e=this.scrollY/this.maxScrollY,t=e*this.pixelsToShave;this.logger.log(`Div Stretch Offset = ${t} (${this.pixelsToShave} * ${e})`),this.setDivStretchOffset(t)}setUiContainerHeight(e){e!==this.uiContainerHeight&&(this.uiContainerHeight=e,this.eventService.dispatchEvent({type:ct.EVENT_ROW_CONTAINER_HEIGHT_CHANGED}))}clearOffset(){this.setUiContainerHeight(this.modelHeight),this.pixelsToShave=0,this.setDivStretchOffset(0)}setDivStretchOffset(e){const t="number"==typeof e?Math.floor(e):null;this.divStretchOffset!==t&&(this.divStretchOffset=t,this.eventService.dispatchEvent({type:ct.EVENT_HEIGHT_SCALE_CHANGED}))}setModelHeight(e){this.modelHeight=e,this.stretching=null!=e&&this.maxDivHeight>0&&e>this.maxDivHeight,this.stretching?this.calculateOffset():this.clearOffset()}getUiContainerHeight(){return this.uiContainerHeight}getRealPixelPosition(e){return e-this.divStretchOffset}getUiBodyHeight(){const e=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition();return e.bottom-e.top}getScrollPositionForPixel(e){if(this.pixelsToShave<=0)return e;const t=e/(this.modelHeight-this.getUiBodyHeight());return this.maxScrollY*t}};g([ue("ctrlsService")],Kc.prototype,"ctrlsService",2),g([f(0,ge("loggerFactory"))],Kc.prototype,"agWire",1),g([le],Kc.prototype,"postConstruct",1),Kc=g([he("rowContainerHeightService")],Kc);var Yc=class extends st{init(){this.addManagedPropertyListener("isRowSelectable",()=>this.updateSelectable())}updateSelectableAfterGrouping(){this.updateSelectable(!0)}updateSelectable(e=!1){const t=!!this.gos.get("rowSelection"),i=this.gos.get("isRowSelectable");if(!t||!i)return;const n=this.gos.get("groupSelectsChildren"),s="clientSide"===this.rowModel.getType()&&n,r=[],o=t=>{if(e&&!t.group)return;if(s&&t.group){const e=t.childrenAfterGroup.some(e=>!0===e.selectable);return void t.setRowSelectable(e,!0)}const n=!i||i(t);t.setRowSelectable(n,!0),!n&&t.isSelected()&&r.push(t)};if(s){const e=this.rowModel;new Gl(!1,e.getRootNode()).forEachChangedNodeDepthFirst(o,!0,!0)}else this.rowModel.forEachNode(o);r.length&&this.selectionService.setNodesSelected({nodes:r,newValue:!1,source:"selectableChanged"}),s&&this.selectionService instanceof Tc&&this.selectionService.updateGroupsFromChildrenSelections("selectableChanged")}};g([ue("rowModel")],Yc.prototype,"rowModel",2),g([ue("selectionService")],Yc.prototype,"selectionService",2),g([le],Yc.prototype,"init",1),Yc=g([he("selectableService")],Yc);var qc=class extends Cs{constructor(){super(),this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1}postConstruct(){const e=this.gos.get("enableRtl");this.setTemplate(this.getTemplate());const{btFirst:t,btPrevious:i,btNext:n,btLast:s,pageSizeComp:r}=this;this.activateTabIndex([t,i,n,s]),t.insertAdjacentElement("afterbegin",qn(e?"last":"first",this.gos)),i.insertAdjacentElement("afterbegin",qn(e?"next":"previous",this.gos)),n.insertAdjacentElement("afterbegin",qn(e?"previous":"next",this.gos)),s.insertAdjacentElement("afterbegin",qn(e?"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,ct.EVENT_PAGINATION_CHANGED,this.onPaginationChanged.bind(this)),[{el:this.btFirst,fn:this.onBtFirst.bind(this)},{el:this.btPrevious,fn:this.onBtPrevious.bind(this)},{el:this.btNext,fn:this.onBtNext.bind(this)},{el:this.btLast,fn:this.onBtLast.bind(this)}].forEach(e=>{const{el:t,fn:i}=e;this.addManagedListener(t,"click",i),this.addManagedListener(t,"keydown",e=>{e.key!==Zn.ENTER&&e.key!==Zn.SPACE||(e.preventDefault(),i())})}),this.areListenersSetup=!0)}onBtFirst(){this.previousAndFirstButtonsDisabled||this.paginationProxy.goToFirstPage()}setCurrentPageLabel(){const e=this.paginationProxy.getTotalPages()>0,t=this.paginationProxy.getCurrentPage(),i=e?t+1:0;this.lbCurrent.textContent=this.formatNumber(i)}formatNumber(e){const t=this.gos.getCallback("paginationNumberFormatter");if(t)return t({value:e});const i=this.localeService.getLocaleTextFunc();return Yi(e,i("thousandSeparator",","),i("decimalSeparator","."))}getTemplate(){const e=this.localeService.getLocaleTextFunc(),t=e("page","Page"),i=e("to","to"),n=e("of","of"),s=e("firstPage","First Page"),r=e("previousPage","Previous Page"),o=e("nextPage","Next Page"),a=e("lastPage","Last Page"),l=this.getCompId();return`<div class="ag-paging-panel ag-unselectable" id="ag-${l}">\n                <ag-page-size-selector ref="pageSizeComp"></ag-page-size-selector>\n                <span class="ag-paging-row-summary-panel" role="status">\n                    <span id="ag-${l}-first-row" ref="lbFirstRowOnPage" class="ag-paging-row-summary-panel-number"></span>\n                    <span id="ag-${l}-to">${i}</span>\n                    <span id="ag-${l}-last-row" ref="lbLastRowOnPage" class="ag-paging-row-summary-panel-number"></span>\n                    <span id="ag-${l}-of">${n}</span>\n                    <span id="ag-${l}-row-count" ref="lbRecordCount" class="ag-paging-row-summary-panel-number"></span>\n                </span>\n                <span class="ag-paging-page-summary-panel" role="presentation">\n                    <div ref="btFirst" class="ag-button ag-paging-button" role="button" aria-label="${s}"></div>\n                    <div ref="btPrevious" class="ag-button ag-paging-button" role="button" aria-label="${r}"></div>\n                    <span class="ag-paging-description" role="status">\n                        <span id="ag-${l}-start-page">${t}</span>\n                        <span id="ag-${l}-start-page-number" ref="lbCurrent" class="ag-paging-number"></span>\n                        <span id="ag-${l}-of-page">${n}</span>\n                        <span id="ag-${l}-of-page-number" ref="lbTotal" class="ag-paging-number"></span>\n                    </span>\n                    <div ref="btNext" class="ag-button ag-paging-button" role="button" aria-label="${o}"></div>\n                    <div ref="btLast" class="ag-button ag-paging-button" role="button" aria-label="${a}"></div>\n                </span>\n            </div>`}onBtNext(){this.nextButtonDisabled||this.paginationProxy.goToNextPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.paginationProxy.goToPreviousPage()}onBtLast(){this.lastButtonDisabled||this.paginationProxy.goToLastPage()}enableOrDisableButtons(){const e=this.paginationProxy.getCurrentPage(),t=this.paginationProxy.isLastPageFound(),i=this.paginationProxy.getTotalPages();this.previousAndFirstButtonsDisabled=0===e,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const n=this.isZeroPagesToDisplay(),s=e===i-1;this.nextButtonDisabled=s||n,this.lastButtonDisabled=!t||n||e===i-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){Jt(e,t),e.classList.toggle("ag-disabled",t)}updateRowLabels(){const e=this.paginationProxy.getCurrentPage(),t=this.paginationProxy.getPageSize(),i=this.paginationProxy.isLastPageFound(),n=this.paginationProxy.isLastPageFound()?this.paginationProxy.getMasterRowCount():null;let s,r;if(this.isZeroPagesToDisplay()?s=r=0:(s=t*e+1,r=s+t-1,i&&r>n&&(r=n)),this.lbFirstRowOnPage.textContent=this.formatNumber(s),this.rowNodeBlockLoader.isLoading()){const e=this.localeService.getLocaleTextFunc();this.lbLastRowOnPage.innerHTML=e("pageLastRowUnknown","?")}else this.lbLastRowOnPage.textContent=this.formatNumber(r)}isZeroPagesToDisplay(){const e=this.paginationProxy.isLastPageFound(),t=this.paginationProxy.getTotalPages();return e&&0===t}setTotalLabels(){const e=this.paginationProxy.isLastPageFound(),t=this.paginationProxy.getTotalPages(),i=e?this.paginationProxy.getMasterRowCount():null;if(1===i){const e=this.paginationProxy.getRow(0);if(e&&e.group&&!e.groupData&&!e.aggData)return void this.setTotalLabelsToZero()}if(e)this.lbTotal.textContent=this.formatNumber(t),this.lbRecordCount.textContent=this.formatNumber(i);else{const e=this.localeService.getLocaleTextFunc()("more","more");this.lbTotal.innerHTML=e,this.lbRecordCount.innerHTML=e}}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([ue("paginationProxy")],qc.prototype,"paginationProxy",2),g([ue("rowNodeBlockLoader")],qc.prototype,"rowNodeBlockLoader",2),g([Ss("btFirst")],qc.prototype,"btFirst",2),g([Ss("btPrevious")],qc.prototype,"btPrevious",2),g([Ss("btNext")],qc.prototype,"btNext",2),g([Ss("btLast")],qc.prototype,"btLast",2),g([Ss("lbRecordCount")],qc.prototype,"lbRecordCount",2),g([Ss("lbFirstRowOnPage")],qc.prototype,"lbFirstRowOnPage",2),g([Ss("lbLastRowOnPage")],qc.prototype,"lbLastRowOnPage",2),g([Ss("lbCurrent")],qc.prototype,"lbCurrent",2),g([Ss("lbTotal")],qc.prototype,"lbTotal",2),g([Ss("pageSizeComp")],qc.prototype,"pageSizeComp",2),g([le],qc.prototype,"postConstruct",1);var Xc=class e extends Cs{constructor(){super(e.TEMPLATE),this.inProgress=!1,this.destroyRequested=!1}updateLayoutClasses(e,t){const i=this.eOverlayWrapper.classList;i.toggle("ag-layout-auto-height",t.autoHeight),i.toggle("ag-layout-normal",t.normal),i.toggle("ag-layout-print",t.print)}postConstruct(){this.createManagedBean(new Zo(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,i){this.inProgress||(this.setWrapperTypeClass(t),this.destroyActiveOverlay(),this.inProgress=!0,e&&e.then(e=>{this.inProgress=!1,this.eOverlayWrapper.appendChild(e.getGui()),this.activeOverlay=e,this.updateListenerDestroyFunc=i,this.destroyRequested&&(this.destroyRequested=!1,this.destroyActiveOverlay())}),this.setDisplayed(!0,{skipAriaHidden:!0}))}destroyActiveOverlay(){var e;this.inProgress?this.destroyRequested=!0:this.activeOverlay&&(this.activeOverlay=this.getContext().destroyBean(this.activeOverlay),null==(e=this.updateListenerDestroyFunc)||e.call(this),Cn(this.eOverlayWrapper))}hideOverlay(){this.destroyActiveOverlay(),this.setDisplayed(!1,{skipAriaHidden:!0})}destroy(){this.destroyActiveOverlay(),super.destroy()}};Xc.TEMPLATE='\n        <div class="ag-overlay" role="presentation">\n            <div class="ag-overlay-panel" role="presentation">\n                <div class="ag-overlay-wrapper" ref="eOverlayWrapper" role="presentation"></div>\n            </div>\n        </div>',g([ue("overlayService")],Xc.prototype,"overlayService",2),g([Ss("eOverlayWrapper")],Xc.prototype,"eOverlayWrapper",2),g([le],Xc.prototype,"postConstruct",1);var Zc=Xc,Qc=class extends st{getFirstRow(){let e,t=0;return this.pinnedRowModel.getPinnedTopRowCount()?e="top":this.rowModel.getRowCount()?(e=null,t=this.paginationProxy.getPageFirstRow()):this.pinnedRowModel.getPinnedBottomRowCount()&&(e="bottom"),void 0===e?null:{rowIndex:t,rowPinned:e}}getLastRow(){let e,t=null;const i=this.pinnedRowModel.getPinnedBottomRowCount(),n=this.pinnedRowModel.getPinnedTopRowCount();return i?(t="bottom",e=i-1):this.rowModel.getRowCount()?(t=null,e=this.paginationProxy.getPageLastRow()):n&&(t="top",e=n-1),void 0===e?null:{rowIndex:e,rowPinned:t}}getRowNode(e){switch(e.rowPinned){case"top":return this.pinnedRowModel.getPinnedTopRowData()[e.rowIndex];case"bottom":return this.pinnedRowModel.getPinnedBottomRowData()[e.rowIndex];default:return this.rowModel.getRow(e.rowIndex)}}sameRow(e,t){return!e&&!t||!(e&&!t||!e&&t)&&e.rowIndex===t.rowIndex&&e.rowPinned==t.rowPinned}before(e,t){switch(e.rowPinned){case"top":if("top"!==t.rowPinned)return!0;break;case"bottom":if("bottom"!==t.rowPinned)return!1;break;default:if(b(t.rowPinned))return"top"!==t.rowPinned}return e.rowIndex<t.rowIndex}};g([ue("rowModel")],Qc.prototype,"rowModel",2),g([ue("pinnedRowModel")],Qc.prototype,"pinnedRowModel",2),g([ue("paginationProxy")],Qc.prototype,"paginationProxy",2),Qc=g([he("rowPositionUtils")],Qc);var Jc=class extends st{createId(e){const{rowIndex:t,rowPinned:i,column:n}=e;return this.createIdFromValues({rowIndex:t,column:n,rowPinned:i})}createIdFromValues(e){const{rowIndex:t,rowPinned:i,column:n}=e;return`${t}.${null==i?"null":i}.${n.getId()}`}equals(e,t){const i=e.column===t.column,n=e.rowPinned===t.rowPinned,s=e.rowIndex===t.rowIndex;return i&&n&&s}};Jc=g([he("cellPositionUtils")],Jc);var eh=class{constructor(e){this.cellValueChanges=e}},th=class extends eh{constructor(e,t,i,n){super(e),this.initialRange=t,this.finalRange=i,this.ranges=n}},ih=class e{constructor(t){this.actionStack=[],this.maxStackSize=t||e.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}};ih.DEFAULT_STACK_SIZE=10;var nh=ih,sh=class extends st{constructor(){super(...arguments),this.cellValueChanges=[],this.activeCellEdit=null,this.activeRowEdit=null,this.isPasting=!1,this.isRangeInAction=!1,this.onCellValueChanged=e=>{const t={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned},i=null!==this.activeCellEdit&&this.cellPositionUtils.equals(this.activeCellEdit,t),n=null!==this.activeRowEdit&&this.rowPositionUtils.sameRow(this.activeRowEdit,t);if(!(i||n||this.isPasting||this.isRangeInAction))return;const{rowPinned:s,rowIndex:r,column:o,oldValue:a,value:l}=e,c={rowPinned:s,rowIndex:r,columnId:o.getColId(),newValue:l,oldValue:a};this.cellValueChanges.push(c)},this.clearStacks=()=>{this.undoStack.clear(),this.redoStack.clear()}}init(){if(!this.gos.get("undoRedoCellEditing"))return;const e=this.gos.get("undoRedoCellEditingLimit");e<=0||(this.undoStack=new nh(e),this.redoStack=new nh(e),this.addRowEditingListeners(),this.addCellEditingListeners(),this.addPasteListeners(),this.addFillListeners(),this.addCellKeyListeners(),this.addManagedListener(this.eventService,ct.EVENT_CELL_VALUE_CHANGED,this.onCellValueChanged),this.addManagedListener(this.eventService,ct.EVENT_MODEL_UPDATED,e=>{e.keepUndoRedoStack||this.clearStacks()}),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.clearStacks),this.addManagedListener(this.eventService,ct.EVENT_NEW_COLUMNS_LOADED,this.clearStacks),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_GROUP_OPENED,this.clearStacks),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_ROW_GROUP_CHANGED,this.clearStacks),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_MOVED,this.clearStacks),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PINNED,this.clearStacks),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_VISIBLE,this.clearStacks),this.addManagedListener(this.eventService,ct.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(e){const t={type:ct.EVENT_UNDO_STARTED,source:e};this.eventService.dispatchEvent(t);const i=this.undoRedo(this.undoStack,this.redoStack,"initialRange","oldValue","undo"),n={type:ct.EVENT_UNDO_ENDED,source:e,operationPerformed:i};this.eventService.dispatchEvent(n)}redo(e){const t={type:ct.EVENT_REDO_STARTED,source:e};this.eventService.dispatchEvent(t);const i=this.undoRedo(this.redoStack,this.undoStack,"finalRange","newValue","redo"),n={type:ct.EVENT_REDO_ENDED,source:e,operationPerformed:i};this.eventService.dispatchEvent(n)}undoRedo(e,t,i,n,s){if(!e)return!1;const r=e.pop();return!(!r||!r.cellValueChanges||(this.processAction(r,e=>e[n],s),r instanceof th?this.processRange(this.rangeService,r.ranges||[r[i]]):this.processCell(r.cellValueChanges),t.push(r),0))}processAction(e,t,i){e.cellValueChanges.forEach(e=>{const{rowIndex:n,rowPinned:s,columnId:r}=e,o={rowIndex:n,rowPinned:s},a=this.rowPositionUtils.getRowNode(o);a.displayed&&a.setDataValue(r,t(e),i)})}processRange(e,t){let i;e.removeAllCellRanges(!0),t.forEach((n,s)=>{if(!n)return;const r=n.startRow,o=n.endRow;s===t.length-1&&(i={rowPinned:r.rowPinned,rowIndex:r.rowIndex,columnId:n.startColumn.getColId()},this.setLastFocusedCell(i));const a={rowStartIndex:r.rowIndex,rowStartPinned:r.rowPinned,rowEndIndex:o.rowIndex,rowEndPinned:o.rowPinned,columnStart:n.startColumn,columns:n.columns};e.addCellRange(a)})}processCell(e){const t=e[0],{rowIndex:i,rowPinned:n}=t,s={rowIndex:i,rowPinned:n},r=this.rowPositionUtils.getRowNode(s),o={rowPinned:t.rowPinned,rowIndex:r.rowIndex,columnId:t.columnId};this.setLastFocusedCell(o,this.rangeService)}setLastFocusedCell(e,t){const{rowIndex:i,columnId:n,rowPinned:s}=e,r=this.gridBodyCtrl.getScrollFeature(),o=this.columnModel.getGridColumn(n);if(!o)return;r.ensureIndexVisible(i),r.ensureColumnVisible(o);const a={rowIndex:i,column:o,rowPinned:s};this.focusService.setFocusedCell(d(u({},a),{forceBrowserFocus:!0})),null==t||t.setRangeToCell(a)}addRowEditingListeners(){this.addManagedListener(this.eventService,ct.EVENT_ROW_EDITING_STARTED,e=>{this.activeRowEdit={rowIndex:e.rowIndex,rowPinned:e.rowPinned}}),this.addManagedListener(this.eventService,ct.EVENT_ROW_EDITING_STOPPED,()=>{const e=new eh(this.cellValueChanges);this.pushActionsToUndoStack(e),this.activeRowEdit=null})}addCellEditingListeners(){this.addManagedListener(this.eventService,ct.EVENT_CELL_EDITING_STARTED,e=>{this.activeCellEdit={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned}}),this.addManagedListener(this.eventService,ct.EVENT_CELL_EDITING_STOPPED,e=>{if(this.activeCellEdit=null,e.valueChanged&&!this.activeRowEdit&&!this.isPasting&&!this.isRangeInAction){const e=new eh(this.cellValueChanges);this.pushActionsToUndoStack(e)}})}addPasteListeners(){this.addManagedListener(this.eventService,ct.EVENT_PASTE_START,()=>{this.isPasting=!0}),this.addManagedListener(this.eventService,ct.EVENT_PASTE_END,()=>{const e=new eh(this.cellValueChanges);this.pushActionsToUndoStack(e),this.isPasting=!1})}addFillListeners(){this.addManagedListener(this.eventService,ct.EVENT_FILL_START,()=>{this.isRangeInAction=!0}),this.addManagedListener(this.eventService,ct.EVENT_FILL_END,e=>{const t=new th(this.cellValueChanges,e.initialRange,e.finalRange);this.pushActionsToUndoStack(t),this.isRangeInAction=!1})}addCellKeyListeners(){this.addManagedListener(this.eventService,ct.EVENT_KEY_SHORTCUT_CHANGED_CELL_START,()=>{this.isRangeInAction=!0}),this.addManagedListener(this.eventService,ct.EVENT_KEY_SHORTCUT_CHANGED_CELL_END,()=>{let e;e=this.rangeService&&this.gos.get("enableRangeSelection")?new th(this.cellValueChanges,void 0,void 0,[...this.rangeService.getCellRanges()]):new eh(this.cellValueChanges),this.pushActionsToUndoStack(e),this.isRangeInAction=!1})}pushActionsToUndoStack(e){this.undoStack.push(e),this.cellValueChanges=[],this.redoStack.clear()}};g([ue("focusService")],sh.prototype,"focusService",2),g([ue("ctrlsService")],sh.prototype,"ctrlsService",2),g([ue("cellPositionUtils")],sh.prototype,"cellPositionUtils",2),g([ue("rowPositionUtils")],sh.prototype,"rowPositionUtils",2),g([ue("columnModel")],sh.prototype,"columnModel",2),g([de("rangeService")],sh.prototype,"rangeService",2),g([le],sh.prototype,"init",1),sh=g([he("undoRedoService")],sh);var rh=class extends st{findHeader(e,t){let i,n;if(e.column instanceof lt?i=this.columnModel.getDisplayedGroupAtDirection(e.column,t):(n=`getDisplayedCol${t}`,i=this.columnModel[n](e.column)),!i)return;let{headerRowIndex:s}=e;if("filter"!==this.getHeaderRowType(s)){const e=[i];for(;i.getParent();)i=i.getParent(),e.push(i);i=e[e.length-1-s]}const{column:r,headerRowIndex:o}=this.getHeaderIndexToFocus(i,s);return{column:r,headerRowIndex:o}}getHeaderIndexToFocus(e,t){let i;if(e instanceof lt&&this.isAnyChildSpanningHeaderHeight(e)&&e.isPadding()){const n=e;i=n.getLeafColumns()[0];let s=i;for(;s!==n;)t++,s=s.getParent()}return{column:i||e,headerRowIndex:t}}isAnyChildSpanningHeaderHeight(e){return!!e&&e.getLeafColumns().some(e=>e.isSpanHeaderHeight())}getColumnVisibleParent(e,t){const i=this.getHeaderRowType(t),n="column"===i;let s="filter"===i?e:e.getParent(),r=t-1,o=r;if(n&&this.isAnyChildSpanningHeaderHeight(e.getParent())){for(;s&&s.isPadding();)s=s.getParent(),r--;o=r,r<0&&(s=e,r=t,o=void 0)}return{column:s,headerRowIndex:r,headerRowIndexWithoutSpan:o}}getColumnVisibleChild(e,t,i="After"){let n=e,s=t+1,r=s;if("group"===this.getHeaderRowType(t)){const t=e.getDisplayedLeafColumns(),r="After"===i?t[0]:Ie(t),o=[];let a=r;for(;a.getParent()!==e;)a=a.getParent(),o.push(a);if(n=r,r.isSpanHeaderHeight())for(let e=o.length-1;e>=0;e--){const t=o[e];if(!t.isPadding()){n=t;break}s++}else n=Ie(o),n||(n=r)}return{column:n,headerRowIndex:s,headerRowIndexWithoutSpan:r}}getHeaderRowType(e){const t=this.ctrlsService.getHeaderRowContainerCtrl();if(t)return t.getRowType(e)}findColAtEdgeForHeaderRow(e,t){const i=this.columnModel.getAllDisplayedColumns(),n=i["start"===t?0:i.length-1];if(!n)return;const s=this.ctrlsService.getHeaderRowContainerCtrl(n.getPinned()).getRowType(e);return"group"==s?{headerRowIndex:e,column:this.columnModel.getColumnGroupAtLevel(n,e)}:{headerRowIndex:null==s?-1:e,column:n}}};g([ue("columnModel")],rh.prototype,"columnModel",2),g([ue("ctrlsService")],rh.prototype,"ctrlsService",2),rh=g([he("headerPositionUtils")],rh);var oh=class{buildColumnDefs(e,t,i){const n=[],s={};return e.forEach(e=>{let r=!0,o=this.createDefFromColumn(e,t,i),a=e.getOriginalParent(),l=null;for(;a;){let e=null;if(a.isPadding()){a=a.getOriginalParent();continue}const t=s[a.getGroupId()];if(t){t.children.push(o),r=!1;break}if(e=this.createDefFromGroup(a),e&&(e.children=[o],s[e.groupId]=e,o=e,a=a.getOriginalParent()),null!=a&&l===a){r=!1;break}l=a}r&&n.push(o)}),n}createDefFromGroup(e){const t=L(e.getColGroupDef(),["children"]);return t&&(t.groupId=e.getGroupId()),t}createDefFromColumn(e,t,i){const n=L(e.getColDef());return n.colId=e.getColId(),n.width=e.getActualWidth(),n.rowGroup=e.isRowGroupActive(),n.rowGroupIndex=e.isRowGroupActive()?t.indexOf(e):null,n.pivot=e.isPivotActive(),n.pivotIndex=e.isPivotActive()?i.indexOf(e):null,n.aggFunc=e.isValueActive()?e.getAggFunc():null,n.hide=!e.isVisible()||void 0,n.pinned=e.isPinned()?e.getPinned():null,n.sort=e.getSort()?e.getSort():null,n.sortIndex=null!=e.getSortIndex()?e.getSortIndex():null,n}};oh=g([he("columnDefFactory")],oh);var ah=class{getInitialRowClasses(e){const t=[];return b(e.extraCssClass)&&t.push(e.extraCssClass),t.push("ag-row"),t.push(e.rowFocused?"ag-row-focus":"ag-row-no-focus"),e.fadeRowIn&&t.push("ag-opacity-zero"),t.push(e.rowIsEven?"ag-row-even":"ag-row-odd"),e.rowNode.isRowPinned()&&t.push("ag-row-pinned"),e.rowNode.isSelected()&&t.push("ag-row-selected"),e.rowNode.footer&&t.push("ag-row-footer"),t.push("ag-row-level-"+e.rowLevel),e.rowNode.stub&&t.push("ag-row-loading"),e.fullWidthRow&&t.push("ag-full-width-row"),e.expandable&&(t.push("ag-row-group"),t.push(e.rowNode.expanded?"ag-row-group-expanded":"ag-row-group-contracted")),e.rowNode.dragging&&t.push("ag-row-dragging"),ze(t,this.processClassesFromGridOptions(e.rowNode)),ze(t,this.preProcessRowClassRules(e.rowNode)),t.push(e.printLayout?"ag-row-position-relative":"ag-row-position-absolute"),e.firstRowOnPage&&t.push("ag-row-first"),e.lastRowOnPage&&t.push("ag-row-last"),e.fullWidthRow&&("left"===e.pinned&&t.push("ag-cell-last-left-pinned"),"right"===e.pinned&&t.push("ag-cell-first-right-pinned")),t}processClassesFromGridOptions(e){const t=[],i=e=>{"string"==typeof e?t.push(e):Array.isArray(e)&&e.forEach(e=>t.push(e))},n=this.gos.get("rowClass");if(n){if("function"==typeof n)return console.warn("AG Grid: rowClass should not be a function, please use getRowClass instead"),[];i(n)}const s=this.gos.getCallback("getRowClass");return s&&i(s({data:e.data,node:e,rowIndex:e.rowIndex})),t}preProcessRowClassRules(e){const t=[];return this.processRowClassRules(e,e=>{t.push(e)},e=>{}),t}processRowClassRules(e,t,i){const n=this.gos.addGridCommonParams({data:e.data,node:e,rowIndex:e.rowIndex});this.stylingService.processClassRules(void 0,this.gos.get("rowClassRules"),n,t,i)}calculateRowLevel(e){return e.group?e.level:e.parent?e.parent.level+1:0}};g([ue("stylingService")],ah.prototype,"stylingService",2),g([ue("gridOptionsService")],ah.prototype,"gos",2),ah=g([he("rowCssClassCalculator")],ah);var lh=class extends st{init(){this.isAccentedSort=this.gos.get("accentedSort"),this.primaryColumnsSortGroups=this.gos.isColumnsSortingCoupledToGroup(),this.addManagedPropertyListener("accentedSort",e=>this.isAccentedSort=e.currentValue),this.addManagedPropertyListener("autoGroupColumnDef",()=>this.primaryColumnsSortGroups=this.gos.isColumnsSortingCoupledToGroup())}doFullSort(e,t){const i=e.map((e,t)=>({currentPos:t,rowNode:e}));return i.sort(this.compareRowNodes.bind(this,t)),i.map(e=>e.rowNode)}compareRowNodes(e,t,i){const n=t.rowNode,s=i.rowNode;for(let t=0,i=e.length;t<i;t++){const i=e[t],r="desc"===i.sort,o=this.getValue(n,i.column),a=this.getValue(s,i.column);let l;const c=this.getComparator(i,n);if(l=c?c(o,a,n,s,r):cs.defaultComparator(o,a,this.isAccentedSort),!isNaN(l)&&0!==l)return"asc"===i.sort?l:-1*l}return t.currentPos-i.currentPos}getComparator(e,t){const i=e.column,n=i.getColDef().comparator;if(null!=n)return n;if(!i.getColDef().showRowGroup)return;const s=!t.group&&i.getColDef().field;if(!s)return;const r=this.columnModel.getPrimaryColumn(s);return r?r.getColDef().comparator:void 0}getValue(e,t){var i,n;if(!this.primaryColumnsSortGroups)return this.valueService.getValue(t,e,!1,!1);if(e.rowGroupColumn===t){if(this.gos.isGroupUseEntireRow(this.columnModel.isPivotActive())){const n=null==(i=e.allLeafChildren)?void 0:i[0];return n?this.valueService.getValue(t,n,!1,!1):void 0}const s=this.columnModel.getGroupDisplayColumnForGroup(t.getId());if(!s)return;return null==(n=e.groupData)?void 0:n[s.getId()]}return e.group&&t.getColDef().showRowGroup?void 0:this.valueService.getValue(t,e,!1,!1)}};g([ue("valueService")],lh.prototype,"valueService",2),g([ue("columnModel")],lh.prototype,"columnModel",2),g([le],lh.prototype,"init",1),lh=g([he("rowNodeSorter")],lh);var ch=class extends st{constructor(){super(...arguments),this.params={},this.ready=!1,this.readyCallbacks=[]}checkReady(){const e=this.params;this.ready=null!=e.gridCtrl&&null!=e.gridBodyCtrl&&null!=e.center&&null!=e.left&&null!=e.right&&null!=e.bottomCenter&&null!=e.bottomLeft&&null!=e.bottomRight&&null!=e.topCenter&&null!=e.topLeft&&null!=e.topRight&&null!=e.stickyTopCenter&&null!=e.stickyTopLeft&&null!=e.stickyTopRight&&null!=e.stickyBottomCenter&&null!=e.stickyBottomLeft&&null!=e.stickyBottomRight&&null!=e.centerHeader&&null!=e.leftHeader&&null!=e.rightHeader&&null!=e.fakeHScrollComp&&null!=e.fakeVScrollComp&&null!=e.gridHeaderCtrl,this.ready&&(this.readyCallbacks.forEach(t=>t(e)),this.readyCallbacks.length=0)}whenReady(e){this.ready?e(this.params):this.readyCallbacks.push(e)}register(e,t){this.params[e]=t,this.checkReady()}registerHeaderContainer(e,t){switch(t){case"left":this.params.leftHeader=e;break;case"right":this.params.rightHeader=e;break;default:this.params.centerHeader=e}this.checkReady()}get(e){return this.params[e]}getParams(){return this.params}getGridBodyCtrl(){return this.params.gridBodyCtrl}getHeaderRowContainerCtrls(){return[this.params.leftHeader,this.params.rightHeader,this.params.centerHeader]}getHeaderRowContainerCtrl(e){switch(e){case"left":return this.params.leftHeader;case"right":return this.params.rightHeader;default:return this.params.centerHeader}}};ch.NAME="ctrlsService",ch=g([he(ch.NAME)],ch);var hh=class extends st{constructor(){super(...arguments),this.registry={}}register(e){this.registry[e.controllerName]=e.controllerClass}getInstance(e){const t=this.registry[e];if(null!=t)return new t}};hh=g([he("ctrlsFactory")],hh);var uh=class extends Cs{constructor(e,t){super(e),this.direction=t,this.hideTimeout=null}postConstruct(){this.addManagedListener(this.eventService,ct.EVENT_SCROLL_VISIBILITY_CHANGED,this.onScrollVisibilityChanged.bind(this)),this.onScrollVisibilityChanged(),this.addOrRemoveCssClass("ag-apple-scrollbar",ki()||Pi())}initialiseInvisibleScrollbar(){void 0===this.invisibleScrollbar&&(this.invisibleScrollbar=Vi(),this.invisibleScrollbar&&(this.hideAndShowInvisibleScrollAsNeeded(),this.addActiveListenerToggles()))}addActiveListenerToggles(){const e=this.getGui();["mouseenter","mousedown","touchstart"].forEach(t=>this.addManagedListener(e,t,()=>this.addOrRemoveCssClass("ag-scrollbar-active",!0))),["mouseleave","touchend"].forEach(t=>this.addManagedListener(e,t,()=>this.addOrRemoveCssClass("ag-scrollbar-active",!1)))}onScrollVisibilityChanged(){void 0===this.invisibleScrollbar&&this.initialiseInvisibleScrollbar(),this.animationFrameService.requestAnimationFrame(()=>this.setScrollVisible())}hideAndShowInvisibleScrollAsNeeded(){this.addManagedListener(this.eventService,ct.EVENT_BODY_SCROLL,e=>{e.direction===this.direction&&(null!==this.hideTimeout&&(window.clearTimeout(this.hideTimeout),this.hideTimeout=null),this.addOrRemoveCssClass("ag-scrollbar-scrolling",!0))}),this.addManagedListener(this.eventService,ct.EVENT_BODY_SCROLL_END,()=>{this.hideTimeout=window.setTimeout(()=>{this.addOrRemoveCssClass("ag-scrollbar-scrolling",!1),this.hideTimeout=null},400)})}attemptSettingScrollPosition(e){const t=this.getViewport();ee(()=>xn(t),()=>this.setScrollPosition(e),100)}getViewport(){return this.eViewport}getContainer(){return this.eContainer}onScrollCallback(e){this.addManagedListener(this.getViewport(),"scroll",e)}};g([Ss("eViewport")],uh.prototype,"eViewport",2),g([Ss("eContainer")],uh.prototype,"eContainer",2),g([ue("scrollVisibleService")],uh.prototype,"scrollVisibleService",2),g([ue("ctrlsService")],uh.prototype,"ctrlsService",2),g([ue("animationFrameService")],uh.prototype,"animationFrameService",2);var dh=class e extends uh{constructor(){super(e.TEMPLATE,"horizontal")}postConstruct(){super.postConstruct();const e=this.setFakeHScrollSpacerWidths.bind(this);this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_PINNED_ROW_DATA_CHANGED,this.onPinnedRowDataChanged.bind(this)),this.addManagedPropertyListener("domLayout",e),this.ctrlsService.register("fakeHScrollComp",this),this.createManagedBean(new Aa(e=>this.eContainer.style.width=`${e}px`)),this.addManagedPropertyListeners(["suppressHorizontalScroll"],this.onScrollVisibilityChanged.bind(this))}initialiseInvisibleScrollbar(){void 0===this.invisibleScrollbar&&(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 i=!this.enableRtl&&e,n=this.gos.getScrollbarWidth();i&&(t+=n),Pn(this.eRightSpacer,t),this.eRightSpacer.classList.toggle("ag-scroller-corner",t<=n);let s=this.columnModel.getDisplayedColumnsLeftWidth();this.enableRtl&&e&&(s+=n),Pn(this.eLeftSpacer,s),this.eLeftSpacer.classList.toggle("ag-scroller-corner",s<=n)}setScrollVisible(){const e=this.scrollVisibleService.isHorizontalScrollShowing(),t=this.invisibleScrollbar,i=this.gos.get("suppressHorizontalScroll"),n=e&&this.gos.getScrollbarWidth()||0,s=i?0:0===n&&t?16:n;this.addOrRemoveCssClass("ag-scrollbar-invisible",t),Ln(this.getGui(),s),Ln(this.eViewport,s),Ln(this.eContainer,s),this.setDisplayed(e,{skipAriaHidden:!0})}getScrollPosition(){return vn(this.getViewport(),this.enableRtl)}setScrollPosition(e){xn(this.getViewport())||this.attemptSettingScrollPosition(e),bn(this.getViewport(),e,this.enableRtl)}};dh.TEMPLATE='<div class="ag-body-horizontal-scroll" aria-hidden="true">\n            <div class="ag-horizontal-left-spacer" ref="eLeftSpacer"></div>\n            <div class="ag-body-horizontal-scroll-viewport" ref="eViewport">\n                <div class="ag-body-horizontal-scroll-container" ref="eContainer"></div>\n            </div>\n            <div class="ag-horizontal-right-spacer" ref="eRightSpacer"></div>\n        </div>',g([Ss("eLeftSpacer")],dh.prototype,"eLeftSpacer",2),g([Ss("eRightSpacer")],dh.prototype,"eRightSpacer",2),g([ue("columnModel")],dh.prototype,"columnModel",2),g([ue("pinnedRowModel")],dh.prototype,"pinnedRowModel",2),g([le],dh.prototype,"postConstruct",1);var ph=dh,gh=class extends st{postConstruct(){const e=this.checkContainerWidths.bind(this);this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,e),this.addManagedPropertyListener("domLayout",e)}checkContainerWidths(){const e=this.gos.isDomLayout("print"),t=e?0:this.columnModel.getDisplayedColumnsLeftWidth(),i=e?0:this.columnModel.getDisplayedColumnsRightWidth();t!=this.leftWidth&&(this.leftWidth=t,this.eventService.dispatchEvent({type:ct.EVENT_LEFT_PINNED_WIDTH_CHANGED})),i!=this.rightWidth&&(this.rightWidth=i,this.eventService.dispatchEvent({type:ct.EVENT_RIGHT_PINNED_WIDTH_CHANGED}))}getPinnedRightWidth(){return this.rightWidth}getPinnedLeftWidth(){return this.leftWidth}};g([ue("columnModel")],gh.prototype,"columnModel",2),g([le],gh.prototype,"postConstruct",1),gh=g([he("pinnedWidthService")],gh);var fh=class extends st{constructor(){super(...arguments),this.events=[]}postConstruct(){"clientSide"==this.rowModel.getType()&&(this.clientSideRowModel=this.rowModel)}dispatchExpanded(e,t){if(null==this.clientSideRowModel)return void this.eventService.dispatchEvent(e);this.events.push(e);const i=()=>{this.clientSideRowModel&&this.clientSideRowModel.onRowGroupOpened(),this.events.forEach(e=>this.eventService.dispatchEvent(e)),this.events=[]};t?i():(null==this.dispatchExpandedDebounced&&(this.dispatchExpandedDebounced=this.animationFrameService.debounce(i)),this.dispatchExpandedDebounced())}};g([ue("animationFrameService")],fh.prototype,"animationFrameService",2),g([ue("rowModel")],fh.prototype,"rowModel",2),g([le],fh.prototype,"postConstruct",1),fh=g([he("rowNodeEventThrottle")],fh);var mh=(e,t)=>{var i;return"clientSide"===(null!=(i=t.rowModelType)?i:"clientSide")?{module:"@ag-grid-enterprise/row-grouping"}:null},yh={enableRowGroup:mh,rowGroup:mh,rowGroupIndex:mh,enablePivot:mh,enableValue:mh,pivot:mh,pivotIndex:mh,aggFunc:mh,cellEditor:e=>"agRichSelect"===e.cellEditor||"agRichSelectCellEditor"===e.cellEditor?{module:"@ag-grid-enterprise/rich-select"}:null,menuTabs:e=>{var t;const i=["columnsMenuTab","generalMenuTab"];return(null==(t=e.menuTabs)?void 0:t.some(e=>i.includes(e)))?{module:"@ag-grid-enterprise/menu"}:null},columnsMenuParams:{module:["@ag-grid-enterprise/menu","@ag-grid-enterprise/column-tool-panel"]},columnChooserParams:{module:["@ag-grid-enterprise/menu","@ag-grid-enterprise/column-tool-panel"]},headerCheckboxSelection:{supportedRowModels:["clientSide","serverSide"],dependencies:(e,{rowSelection:t})=>"multiple"===t?null:"headerCheckboxSelection is only supported with rowSelection=multiple"},headerCheckboxSelectionFilteredOnly:{supportedRowModels:["clientSide"],dependencies:(e,{rowSelection:t})=>"multiple"===t?null:"headerCheckboxSelectionFilteredOnly is only supported with rowSelection=multiple"},headerCheckboxSelectionCurrentPageOnly:{supportedRowModels:["clientSide"],dependencies:(e,{rowSelection:t})=>"multiple"===t?null:"headerCheckboxSelectionCurrentPageOnly is only supported with rowSelection=multiple"},children:()=>vh},vh={objectName:"colDef",allProperties:Object.keys({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}),docsUrl:"column-properties/",deprecations:{columnsMenuParams:{version:"31.1",message:"Use `columnChooserParams` instead."},suppressMenu:{version:"31.1",message:"Use `suppressHeaderMenuButton` instead."},suppressCellFlash:{version:"31.2",message:"Use `enableCellChangeFlash={false}` in the ColDef"},dndSource:{version:"31.2",message:"This feature has been replaced by `Row Dragging to an External DropZone`."},dndSourceOnRowDrag:{version:"31.2",message:"This feature has been replaced by `Row Dragging to an External DropZone`."}},validations:yh},bh={suppressContextMenu:!1,preventDefaultOnContextMenu:!1,allowContextMenuWithControlKey:!1,suppressMenuHide:!1,enableBrowserTooltips:!1,tooltipTrigger:"hover",tooltipShowDelay:2e3,tooltipHideDelay:1e4,tooltipMouseTrack:!1,tooltipShowMode:"standard",tooltipInteraction:!1,copyHeadersToClipboard:!1,copyGroupHeadersToClipboard:!1,clipboardDelimiter:"\t",suppressCopyRowsToClipboard:!1,suppressCopySingleCellRanges:!1,suppressLastEmptyLineOnPaste:!1,suppressClipboardPaste:!1,suppressClipboardApi:!1,suppressCutToClipboard:!1,maintainColumnOrder:!1,suppressFieldDotNotation:!1,allowDragFromColumnsToolPanel:!1,suppressMovableColumns:!1,suppressColumnMoveAnimation:!1,suppressDragLeaveHidesColumns:!1,suppressRowGroupHidesColumns:!1,suppressAutoSize:!1,autoSizePadding:20,skipHeaderOnAutoSize:!1,singleClickEdit:!1,suppressClickEdit:!1,readOnlyEdit:!1,stopEditingWhenCellsLoseFocus:!1,enterNavigatesVertically:!1,enterNavigatesVerticallyAfterEdit:!1,enableCellEditingOnBackspace:!1,undoRedoCellEditing:!1,undoRedoCellEditingLimit:10,suppressCsvExport:!1,suppressExcelExport:!1,cacheQuickFilter:!1,includeHiddenColumnsInQuickFilter:!1,excludeChildrenWhenTreeDataFiltering:!1,enableAdvancedFilter:!1,includeHiddenColumnsInAdvancedFilter:!1,enableCharts:!1,suppressChartToolPanelsButton:!1,masterDetail:!1,keepDetailRows:!1,keepDetailRowsCount:10,detailRowAutoHeight:!1,tabIndex:0,rowBuffer:10,valueCache:!1,valueCacheNeverExpires:!1,enableCellExpressions:!1,suppressTouch:!1,suppressFocusAfterRefresh:!1,suppressAsyncEvents:!1,suppressBrowserResizeObserver:!1,suppressPropertyNamesCheck:!1,suppressChangeDetection:!1,debug:!1,suppressLoadingOverlay:!1,suppressNoRowsOverlay:!1,pagination:!1,paginationPageSize:100,paginationPageSizeSelector:!0,paginationAutoPageSize:!1,paginateChildRows:!1,suppressPaginationPanel:!1,pivotMode:!1,pivotPanelShow:"never",pivotDefaultExpanded:0,pivotSuppressAutoColumn:!1,suppressExpandablePivotGroups:!1,functionsReadOnly:!1,suppressAggFuncInHeader:!1,alwaysAggregateAtRootLevel:!1,aggregateOnlyChangedColumns:!1,suppressAggFilteredOnly:!1,removePivotHeaderRowWhenSingleValueColumn:!1,animateRows:!0,enableCellChangeFlash:!1,cellFlashDelay:500,cellFlashDuration:500,cellFadeDelay:1e3,cellFadeDuration:1e3,allowShowChangeAfterFilter:!1,domLayout:"normal",ensureDomOrder:!1,enableRtl:!1,suppressColumnVirtualisation:!1,suppressMaxRenderedRowRestriction:!1,suppressRowVirtualisation:!1,rowDragManaged:!1,suppressRowDrag:!1,suppressMoveWhenRowDragging:!1,rowDragEntireRow:!1,rowDragMultiRow:!1,embedFullWidthRows:!1,groupDisplayType:"singleColumn",groupDefaultExpanded:0,groupMaintainOrder:!1,groupSelectsChildren:!1,groupIncludeTotalFooter:!1,groupSuppressBlankHeader:!1,groupSelectsFiltered:!1,showOpenedGroup:!1,groupRemoveSingleChildren:!1,groupRemoveLowestSingleChildren:!1,groupHideOpenParents:!1,groupAllowUnbalanced:!1,rowGroupPanelShow:"never",suppressMakeColumnVisibleAfterUnGroup:!1,treeData:!1,rowGroupPanelSuppressSort:!1,suppressGroupRowsSticky:!1,rowModelType:"clientSide",asyncTransactionWaitMillis:50,suppressModelUpdateAfterUpdateTransaction:!1,cacheOverflowSize:1,infiniteInitialRowCount:1,serverSideInitialRowCount:1,suppressServerSideInfiniteScroll:!1,cacheBlockSize:100,maxBlocksInCache:-1,maxConcurrentDatasourceRequests:2,blockLoadDebounceMillis:0,purgeClosedRowNodes:!1,serverSideSortAllLevels:!1,serverSideOnlyRefreshFilteredGroups:!1,serverSideSortOnServer:!1,serverSideFilterOnServer:!1,serverSidePivotResultFieldSeparator:"_",viewportRowModelPageSize:5,viewportRowModelBufferSize:5,alwaysShowHorizontalScroll:!1,alwaysShowVerticalScroll:!1,debounceVerticalScrollbar:!1,suppressHorizontalScroll:!1,suppressScrollOnNewData:!1,suppressScrollWhenPopupsAreOpen:!1,suppressAnimationFrame:!1,suppressMiddleClickScrolls:!1,suppressPreventDefaultOnMouseWheel:!1,rowMultiSelectWithClick:!1,suppressRowDeselection:!1,suppressRowClickSelection:!1,suppressCellFocus:!1,suppressHeaderFocus:!1,suppressMultiRangeSelection:!1,enableCellTextSelection:!1,enableRangeSelection:!1,enableRangeHandle:!1,enableFillHandle:!1,fillHandleDirection:"xy",suppressClearOnFillReduction:!1,accentedSort:!1,unSortIcon:!1,suppressMultiSort:!1,alwaysMultiSort:!1,suppressMaintainUnsortedOrder:!1,suppressRowHoverHighlight:!1,suppressRowTransform:!1,columnHoverHighlight:!1,deltaSort:!1,enableGroupEdit:!1,suppressGroupMaintainValueType:!1,functionsPassive:!1,groupLockGroupColumns:0,serverSideEnableClientSideSort:!1,suppressServerSideFullWidthLoadingRow:!1,pivotMaxGeneratedColumns:-1},Ch={sideBar:{module:"@ag-grid-enterprise/side-bar"},statusBar:{module:"@ag-grid-enterprise/status-bar"},enableCharts:{module:"@ag-grid-enterprise/charts"},getMainMenuItems:{module:"@ag-grid-enterprise/menu"},getContextMenuItems:{module:"@ag-grid-enterprise/menu"},allowContextMenuWithControlKey:{module:"@ag-grid-enterprise/menu"},enableAdvancedFilter:{module:"@ag-grid-enterprise/advanced-filter"},treeData:{supportedRowModels:["clientSide","serverSide"],module:"@ag-grid-enterprise/row-grouping",dependencies:e=>{var t;const i=null!=(t=e.rowModelType)?t:"clientSide";switch(i){case"clientSide":const t=`treeData requires 'getDataPath' in the ${i} row model.`;return e.getDataPath?null:t;case"serverSide":const n=`treeData requires 'isServerSideGroup' and 'getServerSideGroupKey' in the ${i} row model.`;return e.isServerSideGroup&&e.getServerSideGroupKey?null:n}return null}},masterDetail:{module:"@ag-grid-enterprise/master-detail"},enableRangeSelection:{module:"@ag-grid-enterprise/range-selection"},enableRangeHandle:{dependencies:{enableRangeSelection:[!0]}},enableFillHandle:{dependencies:{enableRangeSelection:[!0]}},groupDefaultExpanded:{supportedRowModels:["clientSide"]},groupIncludeFooter:{supportedRowModels:["clientSide","serverSide"],dependencies:e=>{var t;switch(null!=(t=e.rowModelType)?t:"clientSide"){case"clientSide":return null;case"serverSide":const t="groupIncludeFooter is not supported alongside suppressServerSideInfiniteScroll";return e.suppressServerSideInfiniteScroll?t: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:()=>vh,defaultColDef:()=>vh,defaultColGroupDef:()=>vh,autoGroupColumnDef:()=>vh},wh={objectName:"gridOptions",allProperties:[...Pt.ALL_PROPERTIES,...Lt.EVENT_CALLBACKS],propertyExceptions:["api","columnApi"],docsUrl:"grid-options/",deprecations:{enableChartToolPanelsButton:{version:"29"},functionsPassive:{version:"29.2"},onColumnRowGroupChangeRequest:{version:"29.2"},onColumnPivotChangeRequest:{version:"29.2"},onColumnValueChangeRequest:{version:"29.2"},onColumnAggFuncChangeRequest:{version:"29.2"},serverSideFilterAllLevels:{version:"30",message:"All server-side group levels are now filtered by default. This can be toggled using `serverSideOnlyRefreshFilteredGroups`."},suppressAggAtRootLevel:{version:"30",message:"The root level aggregation is now suppressed by default. This can be toggled using  `alwaysAggregateAtRootLevel`."},excludeHiddenColumnsFromQuickFilter:{version:"30",message:"Hidden columns are now excluded from the Quick Filter by default. This can be toggled using `includeHiddenColumnsInQuickFilter`."},enterMovesDown:{version:"30",renamed:"enterNavigatesVertically"},enterMovesDownAfterEdit:{version:"30",renamed:"enterNavigatesVerticallyAfterEdit"},suppressParentsInRowNodes:{version:"30.2",message:"Using suppressParentsInRowNodes is no longer recommended. To serialize nodes it is now recommended to instead remove the parent node reference before serialization."},advancedFilterModel:{version:"31",message:"Use `initialState.filter.advancedFilterModel` instead."},suppressAsyncEvents:{version:"31",message:"Events should be handled asynchronously."},cellFadeDelay:{version:"31.1",renamed:"cellFadeDuration"},cellFlashDelay:{version:"31.1",renamed:"cellFlashDuration"},suppressServerSideInfiniteScroll:{version:"31.1"},serverSideSortOnServer:{version:"31.1"},serverSideFilterOnServer:{version:"31.1"},enableCellChangeFlash:{version:"31.2",message:"Use `enableCellChangeFlash` in the `ColDef` or `defaultColDef` for all columns."},groupIncludeFooter:{version:"31.3",message:"Use `groupTotalRow` instead."},groupIncludeTotalFooter:{version:"31.3",message:"Use `grandTotalRow` instead."}},validations:Ch},Sh=class{constructor(){this.destroyed=!1,this.domDataKey="__AG_"+Math.random().toString(),this.propertyEventService=new me,this.globalEventHandlerFactory=e=>(t,i)=>{if(this.destroyed)return;const n=ht.has(t);if(n&&!e||!n&&e)return;const s=Lt.getCallbackForEvent(t),r=this.gridOptions[s];"function"==typeof r&&this.frameworkOverrides.wrapOutgoing(()=>{r(i)})}}get context(){return this.gridOptions.context}init(){this.columnApi=new Dc(this.api);const e=!this.get("suppressAsyncEvents");this.eventService.addGlobalListener(this.globalEventHandlerFactory().bind(this),e),this.eventService.addGlobalListener(this.globalEventHandlerFactory(!0).bind(this),!1),this.propertyEventService.setFrameworkOverrides(this.frameworkOverrides),this.getScrollbarWidth()}destroy(){this.destroyed=!0,this.columnApi=void 0}get(e){var t;return null!=(t=this.gridOptions[e])?t:bh[e]}getCallback(e){return this.mergeGridCommonParams(this.gridOptions[e])}exists(e){return b(this.gridOptions[e])}mergeGridCommonParams(e){return e?t=>{const i=t;return i.api=this.api,i.columnApi=this.columnApi,i.context=this.context,e(i)}:e}static toBoolean(e){return"boolean"==typeof e?e:"string"==typeof e&&("TRUE"===e.toUpperCase()||""==e)}static toNumber(e){if("number"==typeof e)return e;if("string"==typeof e){const t=parseInt(e);if(isNaN(t))return;return t}}static toConstrainedNum(e,t){return i=>{const n=Sh.toNumber(i);if(!(null==n||n<e||n>t))return n}}static getCoercedValue(e,t){const i=Sh.PROPERTY_COERCIONS.get(e);return i?i(t):t}static getCoercedGridOptions(e){const t={};return Object.entries(e).forEach(([e,i])=>{const n=Sh.getCoercedValue(e,i);t[e]=n}),t}updateGridOptions({options:e,force:t,source:i="api"}){const n={id:Sh.changeSetId++,properties:[]},s=[];Object.entries(e).forEach(([e,r])=>{"api"===i&&Rt[e]&&z(`${e} is an initial property and cannot be updated.`);const o=Sh.getCoercedValue(e,r),a=t||"object"==typeof o&&"api"===i,l=this.gridOptions[e];if(a||l!==o){this.gridOptions[e]=o;const t={type:e,currentValue:o,previousValue:l,changeSet:n,source:i};s.push(t)}}),this.validationService.processGridOptions(this.gridOptions),n.properties=s.map(e=>e.type),s.forEach(e=>{this.gridOptions.debug&&console.log(`AG Grid: Updated property ${e.type} from `,e.previousValue," to  ",e.currentValue),this.propertyEventService.dispatchEvent(e)})}addEventListener(e,t){this.propertyEventService.addEventListener(e,t)}removeEventListener(e,t){this.propertyEventService.removeEventListener(e,t)}getScrollbarWidth(){if(null==this.scrollbarWidth){const e="number"==typeof this.gridOptions.scrollbarWidth&&this.gridOptions.scrollbarWidth>=0?this.gridOptions.scrollbarWidth:Gi();null!=e&&(this.scrollbarWidth=e,this.eventService.dispatchEvent({type:ct.EVENT_SCROLLBAR_WIDTH_CHANGED}))}return this.scrollbarWidth}isRowModelType(e){return this.gridOptions.rowModelType===e||"clientSide"===e&&C(this.gridOptions.rowModelType)}isDomLayout(e){var t;return(null!=(t=this.gridOptions.domLayout)?t:"normal")===e}isRowSelection(){return"single"===this.gridOptions.rowSelection||"multiple"===this.gridOptions.rowSelection}useAsyncEvents(){return!this.get("suppressAsyncEvents")}isGetRowHeightFunction(){return"function"==typeof this.gridOptions.getRowHeight}getRowHeightForNode(e,t=!1,i){if(null==i&&(i=this.environment.getDefaultRowHeight()),this.isGetRowHeightFunction()){if(t)return{height:i,estimated:!0};const n={node:e,data:e.data},s=this.getCallback("getRowHeight")(n);if(this.isNumeric(s))return 0===s&&z("The return of `getRowHeight` cannot be zero. If the intention is to hide rows, use a filter instead."),{height:Math.max(1,s),estimated:!1}}return e.detail&&this.get("masterDetail")?this.getMasterDetailRowHeight():{height:this.gridOptions.rowHeight&&this.isNumeric(this.gridOptions.rowHeight)?this.gridOptions.rowHeight:i,estimated:!1}}getMasterDetailRowHeight(){return this.get("detailRowAutoHeight")?{height:1,estimated:!1}:this.isNumeric(this.gridOptions.detailRowHeight)?{height:this.gridOptions.detailRowHeight,estimated:!1}:{height:300,estimated:!1}}getRowHeightAsNumber(){if(!this.gridOptions.rowHeight||C(this.gridOptions.rowHeight))return this.environment.getDefaultRowHeight();const e=this.environment.refreshRowHeightVariable();return-1!==e?e:(console.warn("AG Grid row height must be a number if not using standard row model"),this.environment.getDefaultRowHeight())}isNumeric(e){return!isNaN(e)&&"number"==typeof e&&isFinite(e)}getDomDataKey(){return this.domDataKey}getDomData(e,t){const i=e[this.getDomDataKey()];return i?i[t]:void 0}setDomData(e,t,i){const n=this.getDomDataKey();let s=e[n];C(s)&&(s={},e[n]=s),s[t]=i}getDocument(){let e=null;return this.gridOptions.getDocument&&b(this.gridOptions.getDocument)?e=this.gridOptions.getDocument():this.eGridDiv&&(e=this.eGridDiv.ownerDocument),e&&b(e)?e:document}getWindow(){return this.getDocument().defaultView||window}getRootNode(){return this.eGridDiv.getRootNode()}getActiveDomElement(){return this.getRootNode().activeElement}getAsyncTransactionWaitMillis(){return b(this.gridOptions.asyncTransactionWaitMillis)?this.gridOptions.asyncTransactionWaitMillis:50}isAnimateRows(){return!this.get("ensureDomOrder")&&this.get("animateRows")}isGroupRowsSticky(){return!(this.get("paginateChildRows")||this.get("groupHideOpenParents")||this.isDomLayout("print"))}isColumnsSortingCoupledToGroup(){const e=this.gridOptions.autoGroupColumnDef;return!(null==e?void 0:e.comparator)&&!this.get("treeData")}getGroupAggFiltering(){const e=this.gridOptions.groupAggFiltering;return"function"==typeof e?this.getCallback("groupAggFiltering"):!0===e?()=>!0:void 0}getGrandTotalRow(){const e=this.gridOptions.grandTotalRow;return e||(this.gridOptions.groupIncludeTotalFooter?"bottom":void 0)}getGroupTotalRowCallback(){const e=this.get("groupTotalRow");if("function"==typeof e)return this.getCallback("groupTotalRow");if(e)return()=>e;const t=this.get("groupIncludeFooter");if("function"==typeof t){const e=this.getCallback("groupIncludeFooter");return t=>e(t)?"bottom":void 0}return()=>t?"bottom":void 0}isGroupMultiAutoColumn(){return this.gridOptions.groupDisplayType?"multipleColumns"===this.gridOptions.groupDisplayType:this.get("groupHideOpenParents")}isGroupUseEntireRow(e){return!e&&"groupRows"===this.gridOptions.groupDisplayType}getGridCommonParams(){return{api:this.api,columnApi:this.columnApi,context:this.context}}addGridCommonParams(e){const t=e;return t.api=this.api,t.columnApi=this.columnApi,t.context=this.context,t}};Sh.PROPERTY_COERCIONS=new Map([...Pt.BOOLEAN_PROPERTIES.map(e=>[e,Sh.toBoolean]),...Pt.NUMBER_PROPERTIES.map(e=>[e,Sh.toNumber]),["groupAggFiltering",e=>"function"==typeof e?e:Sh.toBoolean(e)],["pageSize",Sh.toConstrainedNum(1,Number.MAX_VALUE)],["autoSizePadding",Sh.toConstrainedNum(0,Number.MAX_VALUE)],["keepDetailRowsCount",Sh.toConstrainedNum(1,Number.MAX_VALUE)],["rowBuffer",Sh.toConstrainedNum(0,Number.MAX_VALUE)],["infiniteInitialRowCount",Sh.toConstrainedNum(1,Number.MAX_VALUE)],["cacheOverflowSize",Sh.toConstrainedNum(1,Number.MAX_VALUE)],["cacheBlockSize",Sh.toConstrainedNum(1,Number.MAX_VALUE)],["serverSideInitialRowCount",Sh.toConstrainedNum(1,Number.MAX_VALUE)],["viewportRowModelPageSize",Sh.toConstrainedNum(1,Number.MAX_VALUE)],["viewportRowModelBufferSize",Sh.toConstrainedNum(0,Number.MAX_VALUE)]]),Sh.changeSetId=0,g([ue("gridOptions")],Sh.prototype,"gridOptions",2),g([ue("eventService")],Sh.prototype,"eventService",2),g([ue("environment")],Sh.prototype,"environment",2),g([ue("frameworkOverrides")],Sh.prototype,"frameworkOverrides",2),g([ue("eGridDiv")],Sh.prototype,"eGridDiv",2),g([ue("validationService")],Sh.prototype,"validationService",2),g([ue("gridApi")],Sh.prototype,"api",2),g([le],Sh.prototype,"init",1),g([ce],Sh.prototype,"destroy",1),Sh=g([he("gridOptionsService")],Sh);var xh=class extends st{getLocaleTextFunc(){const e=this.gos.getCallback("getLocaleText");if(e)return(t,i,n)=>e({key:t,defaultValue:i,variableValues:n});const t=this.gos.get("localeText");return(e,i,n)=>{let s=t&&t[e];if(s&&n&&n.length){let e=0;for(;!(e>=n.length)&&-1!==s.indexOf("${variable}");)s=s.replace("${variable}",n[e++])}return null!=s?s:i}}};xh=g([he("localeService")],xh);var Eh=class e extends uh{constructor(){super(e.TEMPLATE,"vertical")}postConstruct(){super.postConstruct(),this.createManagedBean(new xa(this.eContainer)),this.ctrlsService.register("fakeVScrollComp",this),this.addManagedListener(this.eventService,ct.EVENT_ROW_CONTAINER_HEIGHT_CHANGED,this.onRowContainerHeightChanged.bind(this))}setScrollVisible(){const e=this.scrollVisibleService.isVerticalScrollShowing(),t=this.invisibleScrollbar,i=e&&this.gos.getScrollbarWidth()||0,n=0===i&&t?16:i;this.addOrRemoveCssClass("ag-scrollbar-invisible",t),Pn(this.getGui(),n),Pn(this.eViewport,n),Pn(this.eContainer,n),this.setDisplayed(e,{skipAriaHidden:!0})}onRowContainerHeightChanged(){const{ctrlsService:e}=this,t=e.getGridBodyCtrl().getBodyViewportElement(),i=this.getScrollPosition(),n=t.scrollTop;i!=n&&this.setScrollPosition(n,!0)}getScrollPosition(){return this.getViewport().scrollTop}setScrollPosition(e,t){t||xn(this.getViewport())||this.attemptSettingScrollPosition(e),this.getViewport().scrollTop=e}};Eh.TEMPLATE='<div class="ag-body-vertical-scroll" aria-hidden="true">\n            <div class="ag-body-vertical-scroll-viewport" ref="eViewport">\n                <div class="ag-body-vertical-scroll-container" ref="eContainer"></div>\n            </div>\n        </div>',g([le],Eh.prototype,"postConstruct",1);var Ah=Eh,Mh={january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},Th=["january","february","march","april","may","june","july","august","september","october","november","december"],Dh=class extends st{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",e=>{this.processDataTypeDefinitions(),this.columnModel.recreateColumnDefs(Tt(e.source))})}processDataTypeDefinitions(){var e;const t=this.getDefaultDataTypes();this.dataTypeDefinitions={},Object.entries(t).forEach(([e,t])=>{this.dataTypeDefinitions[e]=d(u({},t),{groupSafeValueFormatter:this.createGroupSafeValueFormatter(t)})});const i=null!=(e=this.gos.get("dataTypeDefinitions"))?e:{};this.dataTypeMatchers={},Object.entries(i).forEach(([e,n])=>{const s=this.processDataTypeDefinition(n,i,[e],t);s&&(this.dataTypeDefinitions[e]=s,n.dataTypeMatcher&&(this.dataTypeMatchers[e]=n.dataTypeMatcher))}),this.checkObjectValueHandlers(t),["dateString","text","number","boolean","date"].forEach(e=>{const i=this.dataTypeMatchers[e];i&&delete this.dataTypeMatchers[e],this.dataTypeMatchers[e]=null!=i?i:t[e].dataTypeMatcher})}mergeDataTypeDefinitions(e,t){const i=u(u({},e),t);return e.columnTypes&&t.columnTypes&&t.appendColumnTypes&&(i.columnTypes=[...this.convertColumnTypes(e.columnTypes),...this.convertColumnTypes(t.columnTypes)]),i}processDataTypeDefinition(e,t,i,n){let s;const r=e.extendsDataType;if(e.columnTypes&&(this.isColumnTypeOverrideInDataTypeDefinitions=!0),e.extendsDataType===e.baseDataType){let i=n[r];const o=t[r];if(i&&o&&(i=o),!this.validateDataTypeDefinition(e,i,r))return;s=this.mergeDataTypeDefinitions(i,e)}else{if(i.includes(r))return void z('Data type definition hierarchies (via the "extendsDataType" property) cannot contain circular references.');const o=t[r];if(!this.validateDataTypeDefinition(e,o,r))return;const a=this.processDataTypeDefinition(o,t,[...i,r],n);if(!a)return;s=this.mergeDataTypeDefinitions(a,e)}return d(u({},s),{groupSafeValueFormatter:this.createGroupSafeValueFormatter(s)})}validateDataTypeDefinition(e,t,i){return t?t.baseDataType===e.baseDataType||(z('The "baseDataType" property of a data type definition must match that of its parent.'),!1):(z(`The data type definition ${i} does not exist.`),!1)}createGroupSafeValueFormatter(e){if(e.valueFormatter)return t=>{var i,n;if(null==(i=t.node)?void 0:i.group){const i=t.column.getAggFunc();if(i){if("first"===i||"last"===i)return e.valueFormatter(t);if("number"===e.baseDataType&&"count"!==i){if("number"==typeof t.value)return e.valueFormatter(t);if("object"==typeof t.value){if(!t.value)return;if("toNumber"in t.value)return e.valueFormatter(d(u({},t),{value:t.value.toNumber()}));if("value"in t.value)return e.valueFormatter(d(u({},t),{value:t.value.value}))}}}if(!this.gos.get("suppressGroupMaintainValueType"))return}else if(this.groupHideOpenParents&&t.column.isRowGroupActive()){if("string"!=typeof t.value||(null==(n=e.dataTypeMatcher)?void 0:n.call(e,t.value)))return e.valueFormatter(t);if(!this.gos.get("suppressGroupMaintainValueType"))return}return e.valueFormatter(t)}}updateColDefAndGetDataTypeDefinitionColumnType(e,t,i){let{cellDataType:n}=t;const{field:s}=t;if(void 0===n&&(n=e.cellDataType),null!=n&&!0!==n||(n=!!this.canInferCellDataType(e,t)&&this.inferCellDataType(s,i)),!n)return void(e.cellDataType=!1);const r=this.dataTypeDefinitions[n];if(r)return e.cellDataType=n,r.groupSafeValueFormatter&&(e.valueFormatter=r.groupSafeValueFormatter),r.valueParser&&(e.valueParser=r.valueParser),r.suppressDefaultProperties||this.setColDefPropertiesForBaseDataType(e,r,i),r.columnTypes;z(`Missing data type definition - "${n}"`)}updateColDefAndGetColumnType(e,t,i){var n,s;const r=this.updateColDefAndGetDataTypeDefinitionColumnType(e,t,i),o=null!=(s=null!=(n=t.type)?n:r)?s:e.type;return e.type=o,o?this.convertColumnTypes(o):void 0}addColumnListeners(e){if(!this.isWaitingForRowData)return;const t=this.columnStateUpdatesPendingInference[e.getColId()];if(!t)return;const i=e=>{t.add(e.key)};e.addEventListener(Se.EVENT_STATE_UPDATED,i),this.columnStateUpdateListenerDestroyFuncs.push(()=>e.removeEventListener(Se.EVENT_STATE_UPDATED,i))}canInferCellDataType(e,t){var i;if("clientSide"!==this.rowModel.getType())return!1;const n={cellRenderer:!0,valueGetter:!0,valueParser:!0,refData:!0};if(this.doColDefPropsPreventInference(t,n))return!1;const s=null===t.type?e.type:t.type;if(s){const e=null!=(i=this.gos.get("columnTypes"))?i:{};if(this.convertColumnTypes(s).some(t=>{const i=e[t.trim()];return i&&this.doColDefPropsPreventInference(i,n)}))return!1}return!this.doColDefPropsPreventInference(e,n)}doColDefPropsPreventInference(e,t){return[["cellRenderer","agSparklineCellRenderer"],["valueGetter",void 0],["valueParser",void 0],["refData",void 0]].some(([i,n])=>this.doesColDefPropPreventInference(e,t,i,n))}doesColDefPropPreventInference(e,t,i,n){if(!t[i])return!1;const s=e[i];return null===s?(t[i]=!1,!1):void 0===n?!!s:s===n}inferCellDataType(e,t){var i;if(!e)return;let n;const s=this.getInitialData();if(s){const t=e.indexOf(".")>=0&&!this.gos.get("suppressFieldDotNotation");n=F(s,e,t)}else this.initWaitForRowData(t);if(null==n)return;const[r]=null!=(i=Object.entries(this.dataTypeMatchers).find(([e,t])=>t(n)))?i:["object"];return r}getInitialData(){const e=this.gos.get("rowData");if(null==e?void 0:e.length)return e[0];if(this.initialData)return this.initialData;{const e=this.rowModel.getRootNode().allLeafChildren;if(null==e?void 0:e.length)return e[0].data}return null}initWaitForRowData(e){if(this.columnStateUpdatesPendingInference[e]=new Set,this.isWaitingForRowData)return;this.isWaitingForRowData=!0;const t=this.isColumnTypeOverrideInDataTypeDefinitions;t&&this.columnModel.queueResizeOperations();const i=this.addManagedListener(this.eventService,ct.EVENT_ROW_DATA_UPDATE_STARTED,e=>{const{firstRowData:n}=e;if(!n)return;null==i||i(),this.isWaitingForRowData=!1,this.processColumnsPendingInference(n,t),this.columnStateUpdatesPendingInference={},t&&this.columnModel.processResizeOperations();const s={type:ct.EVENT_DATA_TYPES_INFERRED};this.eventService.dispatchEvent(s)})}isPendingInference(){return this.isWaitingForRowData}processColumnsPendingInference(e,t){this.initialData=e;const i=[];this.columnStateUpdateListenerDestroyFuncs.forEach(e=>e()),this.columnStateUpdateListenerDestroyFuncs=[];const n={},s={};Object.entries(this.columnStateUpdatesPendingInference).forEach(([e,r])=>{const o=this.columnModel.getGridColumn(e);if(!o)return;const a=o.getColDef();if(!this.columnModel.resetColumnDefIntoColumn(o,"cellDataTypeInferred"))return;const l=o.getColDef();if(t&&l.type&&l.type!==a.type){const t=this.getUpdatedColumnState(o,r);t.rowGroup&&null==t.rowGroupIndex&&(n[e]=t),t.pivot&&null==t.pivotIndex&&(s[e]=t),i.push(t)}}),t&&i.push(...this.columnModel.generateColumnStateForRowGroupAndPivotIndexes(n,s)),i.length&&this.columnModel.applyColumnState({state:i},"cellDataTypeInferred"),this.initialData=null}getUpdatedColumnState(e,t){const i=this.columnModel.getColumnStateFromColDef(e);return t.forEach(e=>{delete i[e],"rowGroup"===e?delete i.rowGroupIndex:"pivot"===e&&delete i.pivotIndex}),i}checkObjectValueHandlers(e){const t=this.dataTypeDefinitions.object,i=e.object;this.hasObjectValueParser=t.valueParser!==i.valueParser,this.hasObjectValueFormatter=t.valueFormatter!==i.valueFormatter}convertColumnTypes(e){let t=[];return e instanceof Array?e.some(e=>"string"!=typeof e)?console.warn("if colDef.type is supplied an array it should be of type 'string[]'"):t=e:"string"==typeof e?t=e.split(","):console.warn("colDef.type should be of type 'string' | 'string[]'"),t}getDateStringTypeDefinition(e){var t;return e&&null!=(t=this.getDataTypeDefinition(e))?t:this.dataTypeDefinitions.dateString}getDateParserFunction(e){return this.getDateStringTypeDefinition(e).dateParser}getDateFormatterFunction(e){return this.getDateStringTypeDefinition(e).dateFormatter}getDataTypeDefinition(e){const t=e.getColDef();if(t.cellDataType)return this.dataTypeDefinitions[t.cellDataType]}getBaseDataType(e){var t;return null==(t=this.getDataTypeDefinition(e))?void 0:t.baseDataType}checkType(e,t){var i;if(null==t)return!0;const n=null==(i=this.getDataTypeDefinition(e))?void 0:i.dataTypeMatcher;return!n||n(t)}validateColDef(e){"object"===e.cellDataType&&(e.valueFormatter!==this.dataTypeDefinitions.object.groupSafeValueFormatter||this.hasObjectValueFormatter||z('Cell data type is "object" but no value formatter has been provided. Please either provide an object data type definition with a value formatter, or set "colDef.valueFormatter"'),e.editable&&e.valueParser===this.dataTypeDefinitions.object.valueParser&&!this.hasObjectValueParser&&z('Cell data type is "object" but no value parser has been provided. Please either provide an object data type definition with a value parser, or set "colDef.valueParser"'))}setColDefPropertiesForBaseDataType(e,t,i){const n=(e,i,n)=>{let s=e.getColDef().valueFormatter;return s===t.groupSafeValueFormatter&&(s=t.valueFormatter),this.valueService.formatValue(e,i,n,s)},s=re.__isRegistered("@ag-grid-enterprise/set-filter",this.context.getGridId()),r=this.localeService.getLocaleTextFunc(),o=t=>{const{filterParams:i}=e;e.filterParams="object"==typeof i?u(u({},i),t):t};switch(t.baseDataType){case"number":e.cellEditor="agNumberCellEditor",s&&o({comparator:(e,t)=>{const i=null==e?0:parseInt(e),n=null==t?0:parseInt(t);return i===n?0:i>n?1:-1}});break;case"boolean":e.cellEditor="agCheckboxCellEditor",e.cellRenderer="agCheckboxCellRenderer",e.suppressKeyboardEvent=e=>!!e.colDef.editable&&e.event.key===Zn.SPACE,o(s?{valueFormatter:e=>b(e.value)?r(String(e.value),e.value?"True":"False"):r("blanks","(Blanks)")}:{maxNumConditions:1,debounceMs:0,filterOptions:["empty",{displayKey:"true",displayName:"True",predicate:(e,t)=>t,numberOfInputs:0},{displayKey:"false",displayName:"False",predicate:(e,t)=>!1===t,numberOfInputs:0}]});break;case"date":e.cellEditor="agDateCellEditor",e.keyCreator=e=>n(e.column,e.node,e.value),s&&o({valueFormatter:e=>{const t=n(e.column,e.node,e.value);return b(t)?t:r("blanks","(Blanks)")},treeList:!0,treeListFormatter:(e,t)=>{if(1===t&&null!=e){const t=Th[Number(e)-1];return r(t,Mh[t])}return null!=e?e:r("blanks","(Blanks)")}});break;case"dateString":{e.cellEditor="agDateStringCellEditor",e.keyCreator=e=>n(e.column,e.node,e.value);const i=t.dateParser;o(s?{valueFormatter:e=>{const t=n(e.column,e.node,e.value);return b(t)?t:r("blanks","(Blanks)")},treeList:!0,treeListPathGetter:e=>{const t=i(null!=e?e:void 0);return t?[String(t.getFullYear()),String(t.getMonth()+1),String(t.getDate())]:null},treeListFormatter:(e,t)=>{if(1===t&&null!=e){const t=Th[Number(e)-1];return r(t,Mh[t])}return null!=e?e:r("blanks","(Blanks)")}}:{comparator:(e,t)=>{const n=i(t);return null==t||n<e?-1:n>e?1:0}});break}case"object":e.cellEditorParams={useFormatter:!0},e.comparator=(e,t)=>{const s=this.columnModel.getPrimaryColumn(i),r=null==s?void 0:s.getColDef();if(!s||!r)return 0;const o=null==e?"":n(s,null,e),a=null==t?"":n(s,null,t);return o===a?0:o>a?1:-1},e.keyCreator=e=>n(e.column,e.node,e.value),s?o({valueFormatter:e=>{const t=n(e.column,e.node,e.value);return b(t)?t:r("blanks","(Blanks)")}}):e.filterValueGetter=e=>n(e.column,e.node,this.valueService.getValue(e.column,e.node))}}getDefaultDataTypes(){const e=e=>!!e.match("^\\d{4}-\\d{2}-\\d{2}$"),t=this.localeService.getLocaleTextFunc();return{number:{baseDataType:"number",valueParser:e=>{var t,i;return""===(null==(i=null==(t=e.newValue)?void 0:t.trim)?void 0:i.call(t))?null:Number(e.newValue)},valueFormatter:e=>null==e.value?"":"number"!=typeof e.value||isNaN(e.value)?t("invalidNumber","Invalid Number"):String(e.value),dataTypeMatcher:e=>"number"==typeof e},text:{baseDataType:"text",valueParser:e=>""===e.newValue?null:S(e.newValue),dataTypeMatcher:e=>"string"==typeof e},boolean:{baseDataType:"boolean",valueParser:e=>{var t,i;return null==e.newValue?e.newValue:""===(null==(i=null==(t=e.newValue)?void 0:t.trim)?void 0:i.call(t))?null:"true"===String(e.newValue).toLowerCase()},valueFormatter:e=>null==e.value?"":String(e.value),dataTypeMatcher:e=>"boolean"==typeof e},date:{baseDataType:"date",valueParser:e=>Ji(null==e.newValue?null:String(e.newValue)),valueFormatter:e=>{var i;return null==e.value?"":e.value instanceof Date&&!isNaN(e.value.getTime())?null!=(i=Xi(e.value,!1))?i:"":t("invalidDate","Invalid Date")},dataTypeMatcher:e=>e instanceof Date},dateString:{baseDataType:"dateString",dateParser:e=>{var t;return null!=(t=Ji(e))?t:void 0},dateFormatter:e=>{var t;return null!=(t=Xi(null!=e?e:null,!1))?t:void 0},valueParser:t=>e(String(t.newValue))?t.newValue:null,valueFormatter:t=>e(String(t.value))?t.value:"",dataTypeMatcher:t=>"string"==typeof t&&e(t)},object:{baseDataType:"object",valueParser:()=>null,valueFormatter:e=>{var t;return null!=(t=S(e.value))?t:""}}}}};g([ue("rowModel")],Dh.prototype,"rowModel",2),g([ue("columnModel")],Dh.prototype,"columnModel",2),g([ue("valueService")],Dh.prototype,"valueService",2),g([le],Dh.prototype,"init",1),Dh=g([he("dataTypeService")],Dh);var Ih=class extends st{constructor(){super(...arguments),this.waitingForColumns=!1}postConstruct(){this.addManagedPropertyListener("columnDefs",e=>this.setColumnDefs(e))}start(){this.ctrlsService.whenReady(()=>{const e=this.gos.get("columnDefs");e?this.setColumnsAndData(e):this.waitingForColumns=!0,this.gridReady()})}setColumnsAndData(e){this.columnModel.setColumnDefs(null!=e?e:[],"gridInitializing"),this.rowModel.start()}gridReady(){this.dispatchGridReadyEvent();const e=re.__isRegistered("@ag-grid-enterprise/core",this.context.getGridId());new Pc("AG Grid",()=>this.gos.get("debug")).log(`initialised successfully, enterprise = ${e}`)}dispatchGridReadyEvent(){const e={type:ct.EVENT_GRID_READY};this.eventService.dispatchEvent(e)}setColumnDefs(e){const t=this.gos.get("columnDefs");if(t)return this.waitingForColumns?(this.waitingForColumns=!1,void this.setColumnsAndData(t)):void this.columnModel.setColumnDefs(t,Tt(e.source))}};g([ue("ctrlsService")],Ih.prototype,"ctrlsService",2),g([ue("columnModel")],Ih.prototype,"columnModel",2),g([ue("rowModel")],Ih.prototype,"rowModel",2),g([le],Ih.prototype,"postConstruct",1),Ih=g([he("syncService")],Ih);var Rh=class extends st{constructor(){super(...arguments),this.manuallyDisplayed=!1}postConstruct(){this.addManagedListener(this.eventService,ct.EVENT_ROW_DATA_UPDATED,()=>this.onRowDataUpdated()),this.addManagedListener(this.eventService,ct.EVENT_NEW_COLUMNS_LOADED,()=>this.onNewColumnsLoaded())}registerOverlayWrapperComp(e){this.overlayWrapperComp=e,(!this.gos.get("columnDefs")||this.gos.isRowModelType("clientSide")&&!this.gos.get("rowData"))&&this.showLoadingOverlay()}showLoadingOverlay(){if(this.gos.get("suppressLoadingOverlay"))return;const e=this.userComponentFactory.getLoadingOverlayCompDetails({});this.showOverlay(e,"ag-overlay-loading-wrapper","loadingOverlayComponentParams")}showNoRowsOverlay(){if(this.gos.get("suppressNoRowsOverlay"))return;const e=this.userComponentFactory.getNoRowsOverlayCompDetails({});this.showOverlay(e,"ag-overlay-no-rows-wrapper","noRowsOverlayComponentParams")}showOverlay(e,t,i){const n=e.newAgStackInstance(),s=this.addManagedPropertyListener(i,({currentValue:e})=>{n.then(t=>{t.refresh&&t.refresh(this.gos.addGridCommonParams(u({},null!=e?e:{})))})});this.manuallyDisplayed=this.columnModel.isReady()&&!this.paginationProxy.isEmpty(),this.overlayWrapperComp.showOverlay(n,t,s)}hideOverlay(){this.manuallyDisplayed=!1,this.overlayWrapperComp.hideOverlay()}showOrHideOverlay(){const e=this.paginationProxy.isEmpty(),t=this.gos.get("suppressNoRowsOverlay");e&&!t?this.showNoRowsOverlay():this.hideOverlay()}onRowDataUpdated(){this.showOrHideOverlay()}onNewColumnsLoaded(){!this.columnModel.isReady()||this.paginationProxy.isEmpty()||this.manuallyDisplayed||this.hideOverlay()}};g([ue("userComponentFactory")],Rh.prototype,"userComponentFactory",2),g([ue("paginationProxy")],Rh.prototype,"paginationProxy",2),g([ue("columnModel")],Rh.prototype,"columnModel",2),g([le],Rh.prototype,"postConstruct",1),Rh=g([he("overlayService")],Rh);var kh=class extends st{constructor(){super(...arguments),this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=Q(()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=Q(()=>this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),0),this.onRowSelectedDebounced=Q(()=>{this.staleStateKeys.delete("rowSelection"),this.updateCachedState("rowSelection",this.getRowSelectionState())},0),this.staleStateKeys=new Set}postConstruct(){var e;this.isClientSideRowModel="clientSide"===this.rowModel.getType(),this.cachedState=null!=(e=this.gos.get("initialState"))?e:{},this.ctrlsService.whenReady(()=>this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnGridReady()));const t=this.addManagedListener(this.eventService,ct.EVENT_NEW_COLUMNS_LOADED,({source:e})=>{"gridInitializing"===e&&(null==t||t(),this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnColumnsInitialised()))}),i=this.addManagedListener(this.eventService,ct.EVENT_ROW_COUNT_READY,()=>{null==i||i(),this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnRowCountReady())}),n=this.addManagedListener(this.eventService,ct.EVENT_FIRST_DATA_RENDERED,()=>{null==n||n(),this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnFirstDataRendered())})}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setupStateOnGridReady(){this.updateCachedState("sideBar",this.getSideBarState()),this.addManagedListener(this.eventService,ct.EVENT_TOOL_PANEL_VISIBLE_CHANGED,()=>this.updateCachedState("sideBar",this.getSideBarState())),this.addManagedListener(this.eventService,ct.EVENT_SIDE_BAR_UPDATED,()=>this.updateCachedState("sideBar",this.getSideBarState()))}setupStateOnColumnsInitialised(){var e;const t=null!=(e=this.gos.get("initialState"))?e:{};this.setColumnState(t),this.setColumnGroupState(t),this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","pivot","rowGroup","sort"]),this.updateCachedState("columnGroup",this.getColumnGroupState()),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_VALUE_CHANGED,()=>this.updateColumnState(["aggregation"])),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_MOVED,()=>this.updateColumnState(["columnOrder"])),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PINNED,()=>this.updateColumnState(["columnPinning"])),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_RESIZED,()=>this.updateColumnState(["columnSizing"])),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_VISIBLE,()=>this.updateColumnState(["columnVisibility"])),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PIVOT_CHANGED,()=>this.updateColumnState(["pivot"])),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PIVOT_MODE_CHANGED,()=>this.updateColumnState(["pivot"])),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.updateColumnState(["rowGroup"])),this.addManagedListener(this.eventService,ct.EVENT_SORT_CHANGED,()=>this.updateColumnState(["sort"])),this.addManagedListener(this.eventService,ct.EVENT_NEW_COLUMNS_LOADED,()=>this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","pivot","rowGroup","sort"])),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_GROUP_OPENED,()=>this.updateCachedState("columnGroup",this.getColumnGroupState()))}setupStateOnRowCountReady(){var e;const{filter:t,rowGroupExpansion:i,rowSelection:n,pagination:s}=null!=(e=this.gos.get("initialState"))?e:{},r=this.gos.get("advancedFilterModel");(t||r)&&this.setFilterState(t,r),i&&this.setRowGroupExpansionState(i),n&&this.setRowSelectionState(n),s&&this.setPaginationState(s),this.updateCachedState("filter",this.getFilterState()),this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("rowSelection",this.getRowSelectionState()),this.updateCachedState("pagination",this.getPaginationState()),this.addManagedListener(this.eventService,ct.EVENT_FILTER_CHANGED,()=>this.updateCachedState("filter",this.getFilterState())),this.addManagedListener(this.eventService,ct.EVENT_ROW_GROUP_OPENED,()=>this.onRowGroupOpenedDebounced()),this.addManagedListener(this.eventService,ct.EVENT_EXPAND_COLLAPSE_ALL,()=>this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState())),this.addManagedListener(this.eventService,ct.EVENT_SELECTION_CHANGED,()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()}),this.addManagedListener(this.eventService,ct.EVENT_PAGINATION_CHANGED,e=>{(e.newPage||e.newPageSize)&&this.updateCachedState("pagination",this.getPaginationState())})}setupStateOnFirstDataRendered(){var e;const{scroll:t,rangeSelection:i,focusedCell:n,columnOrder:s}=null!=(e=this.gos.get("initialState"))?e:{};n&&this.setFocusedCellState(n),i&&this.setRangeSelectionState(i),t&&this.setScrollState(t),this.setColumnPivotState(!!(null==s?void 0:s.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,ct.EVENT_CELL_FOCUSED,()=>this.updateCachedState("focusedCell",this.getFocusedCellState())),this.addManagedListener(this.eventService,ct.EVENT_RANGE_SELECTION_CHANGED,e=>{e.finished&&this.updateCachedState("rangeSelection",this.getRangeSelectionState())}),this.addManagedListener(this.eventService,ct.EVENT_BODY_SCROLL_END,()=>this.updateCachedState("scroll",this.getScrollState()))}getColumnState(){const e=this.columnModel.isPivotMode(),t=[],i=[],n=[],s=[],r=[],o=[],a=[],l=[],c=[],h=this.columnModel.getColumnState();for(let e=0;e<h.length;e++){const{colId:u,sort:d,sortIndex:p,rowGroup:g,rowGroupIndex:f,aggFunc:m,pivot:y,pivotIndex:v,pinned:b,hide:C,width:w,flex:S}=h[e];c.push(u),d&&(t[null!=p?p:0]={colId:u,sort:d}),g&&(i[null!=f?f:0]=u),"string"==typeof m&&n.push({colId:u,aggFunc:m}),y&&(s[null!=v?v:0]=u),b&&("right"===b?o:r).push(u),C&&a.push(u),(S||w)&&l.push({colId:u,flex:null!=S?S:void 0,width:w})}return{sort:t.length?{sortModel:t}:void 0,rowGroup:i.length?{groupColIds:i}:void 0,aggregation:n.length?{aggregationModel:n}:void 0,pivot:s.length||e?{pivotMode:e,pivotColIds:s}:void 0,columnPinning:r.length||o.length?{leftColIds:r,rightColIds:o}:void 0,columnVisibility:a.length?{hiddenColIds:a}:void 0,columnSizing:l.length?{columnSizingModel:l}:void 0,columnOrder:c.length?{orderedColIds:c}:void 0}}setColumnState(e){const{sort:t,rowGroup:i,aggregation:n,pivot:s,columnPinning:r,columnVisibility:o,columnSizing:a,columnOrder:l}=e,c={},h=e=>{let t=c[e];return t||(t={colId:e},c[e]=t,t)};t&&t.sortModel.forEach(({colId:e,sort:t},i)=>{const n=h(e);n.sort=t,n.sortIndex=i}),i&&i.groupColIds.forEach((e,t)=>{const i=h(e);i.rowGroup=!0,i.rowGroupIndex=t}),n&&n.aggregationModel.forEach(({colId:e,aggFunc:t})=>{h(e).aggFunc=t}),s&&(s.pivotColIds.forEach((e,t)=>{const i=h(e);i.pivot=!0,i.pivotIndex=t}),this.gos.updateGridOptions({options:{pivotMode:s.pivotMode},source:"gridInitializing"})),r&&(r.leftColIds.forEach(e=>{h(e).pinned="left"}),r.rightColIds.forEach(e=>{h(e).pinned="right"})),o&&o.hiddenColIds.forEach(e=>{h(e).hide=!0}),a&&a.columnSizingModel.forEach(({colId:e,flex:t,width:i})=>{const n=h(e);n.flex=null!=t?t:null,n.width=i});const u=null==l?void 0:l.orderedColIds,d=!!(null==u?void 0:u.length),p=d?u.map(e=>h(e)):Object.values(c);if(p.length){this.columnStates=p;const e={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:d,defaultState:e},"gridInitializing")}}setColumnPivotState(e){const t=this.columnStates;this.columnStates=void 0;const i=this.columnGroupStates;if(this.columnGroupStates=void 0,this.columnModel.isSecondaryColumnsPresent()){if(t){let i=[];for(const e of t)this.columnModel.getSecondaryColumn(e.colId)&&i.push(e);this.columnModel.applyColumnState({state:i,applyOrder:e},"gridInitializing")}i&&this.columnModel.setColumnGroupState(i,"gridInitializing")}}getColumnGroupState(){const e=this.columnModel.getColumnGroupState(),t=[];return e.forEach(({groupId:e,open:i})=>{i&&t.push(e)}),t.length?{openColumnGroupIds:t}:void 0}setColumnGroupState(e){var t;if(!e.hasOwnProperty("columnGroup"))return;const i=new Set(null==(t=e.columnGroup)?void 0:t.openColumnGroupIds),n=this.columnModel.getColumnGroupState().map(({groupId:e})=>{const t=i.has(e);return t&&i.delete(e),{groupId:e,open:t}});i.forEach(e=>{n.push({groupId:e,open:!0})}),n.length&&(this.columnGroupStates=n),this.columnModel.setColumnGroupState(n,"gridInitializing")}getFilterState(){var e;let t=this.filterManager.getFilterModel();t&&0===Object.keys(t).length&&(t=void 0);const i=null!=(e=this.filterManager.getAdvancedFilterModel())?e:void 0;return t||i?{filterModel:t,advancedFilterModel:i}:void 0}setFilterState(e,t){const{filterModel:i,advancedFilterModel:n}=null!=e?e:{advancedFilterModel:t};i&&this.filterManager.setFilterModel(i,"columnFilter"),n&&this.filterManager.setAdvancedFilterModel(n)}getRangeSelectionState(){var e;const t=null==(e=this.rangeService)?void 0:e.getCellRanges().map(e=>{const{id:t,type:i,startRow:n,endRow:s,columns:r,startColumn:o}=e;return{id:t,type:i,startRow:n,endRow:s,colIds:r.map(e=>e.getColId()),startColId:o.getColId()}});return(null==t?void 0:t.length)?{cellRanges:t}:void 0}setRangeSelectionState(e){if(!this.gos.get("enableRangeSelection")||!this.rangeService)return;const t=[];e.cellRanges.forEach(e=>{const i=[];if(e.colIds.forEach(e=>{const t=this.columnModel.getGridColumn(e);t&&i.push(t)}),!i.length)return;let n=this.columnModel.getGridColumn(e.startColId);if(!n){const e=this.columnModel.getAllDisplayedColumns(),t=new Set(i);n=e.find(e=>t.has(e))}t.push(d(u({},e),{columns:i,startColumn:n}))}),this.rangeService.setCellRanges(t)}getScrollState(){var e,t,i;if(!this.isClientSideRowModel)return;const n=null==(e=this.ctrlsService.getGridBodyCtrl())?void 0:e.getScrollFeature(),{left:s}=null!=(t=null==n?void 0:n.getHScrollPosition())?t:{left:0},{top:r}=null!=(i=null==n?void 0:n.getVScrollPosition())?i:{top:0};return r||s?{top:r,left:s}:void 0}setScrollState(e){var t;if(!this.isClientSideRowModel)return;const{top:i,left:n}=e;null==(t=this.ctrlsService.getGridBodyCtrl())||t.getScrollFeature().setScrollPosition(i,n)}getSideBarState(){var e,t;return null==(t=null==(e=this.sideBarService)?void 0:e.getSideBarComp())?void 0:t.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.focusService.getFocusedCell();if(e){const{column:t,rowIndex:i,rowPinned:n}=e;return{colId:t.getColId(),rowIndex:i,rowPinned:n}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{colId:t,rowIndex:i,rowPinned:n}=e;this.focusService.setFocusedCell({column:this.columnModel.getGridColumn(t),rowIndex:i,rowPinned:n,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const e=this.paginationProxy.getCurrentPage(),t=this.gos.get("paginationAutoPageSize")?void 0:this.paginationProxy.getPageSize();if(e||t)return{page:e,pageSize:t}}setPaginationState(e){e.pageSize&&!this.gos.get("paginationAutoPageSize")&&this.paginationProxy.setPageSize(e.pageSize,"initialState"),"number"==typeof e.page&&this.paginationProxy.setPage(e.page)}getRowSelectionState(){var e;const t=this.selectionService.getSelectionState();return t&&(Array.isArray(t)||!1!==t.selectAll&&!1!==t.selectAllChildren||(null==(e=null==t?void 0:t.toggledNodes)?void 0:e.length))?t:void 0}setRowSelectionState(e){this.selectionService.setSelectionState(e,"gridInitializing")}getRowGroupExpansionState(){const e=this.expansionService.getExpandedRows();return e.length?{expandedRowGroupIds:e}:void 0}setRowGroupExpansionState(e){this.expansionService.expandRows(e.expandedRowGroupIds)}updateColumnState(e){const t=this.getColumnState();let i=!1;Object.entries(t).forEach(([e,t])=>{M(t,this.cachedState[e])||(i=!0)}),this.cachedState=u(u({},this.cachedState),t),i&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const i=this.cachedState[e];this.setCachedStateValue(e,t),M(t,i)||this.dispatchStateUpdateEvent([e])}setCachedStateValue(e,t){this.cachedState=d(u({},this.cachedState),{[e]:t})}refreshStaleState(){this.staleStateKeys.forEach(e=>{"rowSelection"===e&&this.setCachedStateValue(e,this.getRowSelectionState())}),this.staleStateKeys.clear()}dispatchStateUpdateEvent(e){this.suppressEvents||(e.forEach(e=>this.queuedUpdateSources.add(e)),this.dispatchStateUpdateEventDebounced())}dispatchQueuedStateUpdateEvents(){const e=Array.from(this.queuedUpdateSources);this.queuedUpdateSources.clear();const t={type:ct.EVENT_STATE_UPDATED,sources:e,state:this.cachedState};this.eventService.dispatchEvent(t)}suppressEventsAndDispatchInitEvent(e){this.suppressEvents=!0,this.columnAnimationService.setSuppressAnimation(!0),e(),setTimeout(()=>{this.suppressEvents=!1,this.queuedUpdateSources.clear(),this.isAlive()&&(this.columnAnimationService.setSuppressAnimation(!1),this.dispatchStateUpdateEvent(["gridInitializing"]))})}};g([ue("filterManager")],kh.prototype,"filterManager",2),g([ue("ctrlsService")],kh.prototype,"ctrlsService",2),g([ue("focusService")],kh.prototype,"focusService",2),g([ue("columnModel")],kh.prototype,"columnModel",2),g([ue("paginationProxy")],kh.prototype,"paginationProxy",2),g([ue("rowModel")],kh.prototype,"rowModel",2),g([ue("selectionService")],kh.prototype,"selectionService",2),g([ue("expansionService")],kh.prototype,"expansionService",2),g([ue("columnAnimationService")],kh.prototype,"columnAnimationService",2),g([de("sideBarService")],kh.prototype,"sideBarService",2),g([de("rangeService")],kh.prototype,"rangeService",2),g([le],kh.prototype,"postConstruct",1),kh=g([he("stateService")],kh);var Ph=class extends st{init(){this.processGridOptions(this.gridOptions)}processGridOptions(e){this.processOptions(e,wh)}processColumnDefs(e){this.processOptions(e,vh)}processOptions(e,t){const{validations:i,deprecations:n,allProperties:s,propertyExceptions:r,objectName:o,docsUrl:a}=t;s&&!0!==this.gridOptions.suppressPropertyNamesCheck&&this.checkProperties(e,[...null!=r?r:[],...Object.keys(n)],s,o,a);const l=new Set;Object.keys(e).forEach(t=>{var s;const r=n[t];if(r)if("renamed"in r){const{renamed:i,version:n}=r;l.add(`As of v${n}, ${String(t)} is deprecated. Please use ${String(i)} instead.`),e[i]=e[t]}else{const{message:e,version:i}=r;l.add(`As of v${i}, ${String(t)} is deprecated. ${null!=e?e:""}`)}const o=e[t];if(null==o||!1===o)return;const a=i[t];let c;if(!a)return;if("function"==typeof a){const i=a(e,this.gridOptions);if(!i)return;if("objectName"in i){const n=e[t];return Array.isArray(n)?void n.forEach(e=>{this.processOptions(e,i)}):void this.processOptions(e[t],i)}c=i}else c=a;const{module:h,dependencies:u,supportedRowModels:d}=c;if(d){const e=null!=(s=this.gridOptions.rowModelType)?s:"clientSide";if(!d.includes(e))return void l.add(`${String(t)} is not supported with the '${e}' row model.`)}if(h){const e=Array.isArray(h)?h:[h];let i=!0;if(e.forEach(e=>{re.__assertRegistered(e,String(t),this.context.getGridId())||(i=!1,l.add(`${String(t)} is only available when ${e} is loaded.`))}),!i)return}if(u){const i=this.checkForWarning(t,u,e);if(i)return void l.add(i)}}),l.size>0&&l.forEach(e=>{z(e)})}checkForWarning(e,t,i){if("function"==typeof t)return t(i,this.gridOptions);const n=Object.entries(t).find(([e,t])=>{const n=i[e];return!t.includes(n)});if(!n)return null;const[s,r]=n;return r.length>1?`'${String(e)}' requires '${s}' to be one of [${r.join(", ")}].`:`'${String(e)}' requires '${s}' to be ${r[0]}.`}checkProperties(e,t,i,n,s){const r=zn(Object.getOwnPropertyNames(e),["__ob__","__v_skip","__metadata__",...t,...i],i);if(P(r,(e,t)=>{z(`invalid ${n} property '${e}' did you mean any of these: ${t.slice(0,8).join(", ")}`)}),Object.keys(r).length>0&&s){const e=this.getFrameworkOverrides().getDocLink(s);z(`to see all the valid ${n} properties please check: ${e}`)}}};g([ue("gridOptions")],Ph.prototype,"gridOptions",2),g([le],Ph.prototype,"init",1),Ph=g([he("validationService")],Ph);var _h=class extends st{constructor(){super(...arguments),this.syncEventListeners=new Map,this.asyncEventListeners=new Map,this.syncGlobalEventListeners=new Set,this.globalEventListenerPairs=new Map}postConstruct(){this.frameworkEventWrappingService=new ye(this.getFrameworkOverrides())}addEventListener(e,t){const i=this.frameworkEventWrappingService.wrap(t),n=this.gos.useAsyncEvents()&&!ht.has(e),s=n?this.asyncEventListeners:this.syncEventListeners;s.has(e)||s.set(e,new Set),s.get(e).add(i),this.eventService.addEventListener(e,i,n)}removeEventListener(e,t){var i;const n=this.frameworkEventWrappingService.unwrap(t),s=this.asyncEventListeners.get(e),r=!!(null==s?void 0:s.delete(n));r||null==(i=this.syncEventListeners.get(e))||i.delete(n),this.eventService.removeEventListener(e,n,r)}addGlobalListener(e){const t=this.frameworkEventWrappingService.wrapGlobal(e);if(this.gos.useAsyncEvents()){const i=(e,i)=>{ht.has(e)&&t(e,i)},n=(e,i)=>{ht.has(e)||t(e,i)};this.globalEventListenerPairs.set(e,{syncListener:i,asyncListener:n}),this.eventService.addGlobalListener(i,!1),this.eventService.addGlobalListener(n,!0)}else this.syncGlobalEventListeners.add(t),this.eventService.addGlobalListener(t,!1)}removeGlobalListener(e){const t=this.frameworkEventWrappingService.unwrapGlobal(e);if(this.globalEventListenerPairs.has(t)){const{syncListener:i,asyncListener:n}=this.globalEventListenerPairs.get(t);this.eventService.removeGlobalListener(i,!1),this.eventService.removeGlobalListener(n,!0),this.globalEventListenerPairs.delete(e)}else this.syncGlobalEventListeners.delete(t),this.eventService.removeGlobalListener(t,!1)}destroyEventListeners(e,t){e.forEach((e,i)=>{e.forEach(e=>this.eventService.removeEventListener(i,e,t)),e.clear()}),e.clear()}destroyGlobalListeners(e,t){e.forEach(e=>this.eventService.removeGlobalListener(e,t)),e.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncEventListeners,!1),this.destroyEventListeners(this.asyncEventListeners,!0),this.destroyGlobalListeners(this.syncGlobalEventListeners,!1),this.globalEventListenerPairs.forEach(({syncListener:e,asyncListener:t})=>{this.eventService.removeGlobalListener(e,!1),this.eventService.removeGlobalListener(t,!0)}),this.globalEventListenerPairs.clear()}};g([le],_h.prototype,"postConstruct",1),_h=g([he("apiEventService")],_h);var Lh=class extends Cs{constructor(){super('<span class="ag-paging-page-size"></span>'),this.hasEmptyOption=!1,this.handlePageSizeItemSelected=()=>{if(!this.selectPageSizeComp)return;const e=this.selectPageSizeComp.getValue();if(!e)return;const t=Number(e);isNaN(t)||t<1||t===this.paginationProxy.getPageSize()||(this.paginationProxy.setPageSize(t,"pageSizeSelector"),this.hasEmptyOption&&this.toggleSelectDisplay(!0),this.selectPageSizeComp.getFocusableElement().focus())}}init(){this.addManagedPropertyListener("paginationPageSizeSelector",()=>{this.onPageSizeSelectorValuesChange()}),this.addManagedListener(this.eventService,ct.EVENT_PAGINATION_CHANGED,e=>this.handlePaginationChanged(e))}handlePaginationChanged(e){if(!this.selectPageSizeComp||!(null==e?void 0:e.newPageSize))return;const t=this.paginationProxy.getPageSize();this.getPageSizeSelectorValues().includes(t)?this.selectPageSizeComp.setValue(t.toString()):this.hasEmptyOption?this.selectPageSizeComp.setValue(""):this.toggleSelectDisplay(!0)}toggleSelectDisplay(e){this.selectPageSizeComp&&this.reset(),e&&(this.reloadPageSizesSelector(),this.selectPageSizeComp&&this.appendChild(this.selectPageSizeComp))}reset(){Cn(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")&&!1!==this.gos.get("paginationPageSizeSelector")}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.paginationProxy.getPageSize(),i=!t||!e.includes(t);i&&(e.unshift(""),z("The paginationPageSize grid option is set to a value that is not in the list of page size options.\n                Please make sure that the paginationPageSize grid option is set to one of the values in the \n                paginationPageSizeSelector array, or set the paginationPageSizeSelector to false to hide the page size selector.")),this.selectPageSizeComp&&(this.destroyBean(this.selectPageSizeComp),this.selectPageSizeComp=void 0);const n=this.localeService.getLocaleTextFunc(),s=n("pageSizeSelectorLabel","Page Size:"),r=e.map(e=>({value:String(e),text:String(e)})),o=n("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new Hs).addOptions(r).setValue(String(i?"":t)).setAriaLabel(o).setLabel(s).onValueChange(()=>this.handlePageSizeItemSelected()),this.hasEmptyOption=i}getPageSizeSelectorValues(){const e=this.gos.get("paginationPageSizeSelector");return Array.isArray(e)&&this.validateValues(e)?[...e].sort((e,t)=>e-t):[20,50,100]}validateValues(e){if(!e.length)return z("The paginationPageSizeSelector grid option is an empty array. This is most likely a mistake.\n                If you want to hide the page size selector, please set the paginationPageSizeSelector to false."),!1;for(let t=0;t<e.length;t++){const i=e[t],n=i>0;if("number"!=typeof i)return z("The paginationPageSizeSelector grid option contains a non-numeric value.\n                    Please make sure that all values in the paginationPageSizeSelector array are numbers."),!1;if(!n)return z("The paginationPageSizeSelector grid option contains a negative number or zero.\n                    Please make sure that all values in the paginationPageSizeSelector array are positive."),!1}return!0}destroy(){this.toggleSelectDisplay(!1),super.destroy()}};g([ue("paginationProxy")],Lh.prototype,"paginationProxy",2),g([le],Lh.prototype,"init",1);var Nh=class extends st{constructor(){super(),this.descriptionContainer=null,this.announceValue=Q(this.announceValue.bind(this),200)}postConstruct(){const e=this.gos.getDocument(),t=this.descriptionContainer=e.createElement("div");t.classList.add("ag-aria-description-container"),qt(t,"polite"),Zt(t,"additions text"),Xt(t,!0),this.eGridDiv.appendChild(t)}announceValue(e){this.descriptionContainer&&(this.descriptionContainer.textContent="",setTimeout(()=>{this.isAlive()&&this.descriptionContainer&&(this.descriptionContainer.textContent=e)},50))}destroy(){super.destroy();const{descriptionContainer:e}=this;e&&(Cn(e),e.parentElement&&e.parentElement.removeChild(e)),this.descriptionContainer=null,this.eGridDiv=null}};g([ue("eGridDiv")],Nh.prototype,"eGridDiv",2),g([le],Nh.prototype,"postConstruct",1),Nh=g([he("ariaAnnouncementService")],Nh);var Oh=class{};function Fh(e){Oh.gridOptions=e}function Gh(e,t,i){if(!t)return W("No gridOptions provided to createGrid"),{};const n=(new Hh).create(e,t,t=>{const i=new Lc(e);t.createBean(i)},void 0,i);if(!Object.isFrozen(t)&&!(null==i?void 0:i.frameworkOverrides)){const e="https://ag-grid.com/javascript-data-grid/grid-interface/#grid-api";Object.defineProperty(t,"api",{get:()=>{W(`gridOptions.api is no longer supported. See ${e}.`)},configurable:!0}),Object.defineProperty(t,"columnApi",{get:()=>{W(`gridOptions.columnApi is no longer supported and all methods moved to the grid api. See ${e}.`)},configurable:!0})}return n}Oh.gridOptions=void 0;var Bh=class{constructor(e,t,i){if(z("Since v31 new Grid(...) is deprecated. Use createGrid instead: `const gridApi = createGrid(...)`. The grid api is returned from createGrid and will not be available on gridOptions."),!t)return void W("No gridOptions provided to the grid");this.gridOptions=t;const n=(new Hh).create(e,t,t=>{const i=new Lc(e);t.createBean(i).addDestroyFunc(()=>{this.destroy()})},void 0,i);this.gridOptions.api=n,this.gridOptions.columnApi=new Dc(n)}destroy(){var e;this.gridOptions&&(null==(e=this.gridOptions.api)||e.destroy(),delete this.gridOptions.api,delete this.gridOptions.columnApi)}},Vh=1,Hh=class{create(e,t,i,n,s){var r;let o={};Oh.gridOptions?(O(o,Oh.gridOptions,!0,!0),o=u(u({},o),t)):o=t;const a=Sh.getCoercedGridOptions(o),l=!!a.debug,c=null!=(r=a.gridId)?r:String(Vh++),h=this.getRegisteredModules(s,c),d=this.createBeansList(a.rowModelType,h,c),p=this.createProvidedBeans(e,a,s);if(!d)return void W("Failed to create grid.");const g={providedBeanInstances:p,beanClasses:d,debug:l,gridId:c},f=new Pc("Context",()=>g.debug),m=new oe(g,f),y=m.getBean("beans");return this.registerModuleUserComponents(y,h),this.registerStackComponents(y,h),this.registerControllers(y,h),i(m),y.syncService.start(),n&&n(m),m.getBean("gridApi")}registerControllers(e,t){t.forEach(t=>{t.controllers&&t.controllers.forEach(t=>e.ctrlsFactory.register(t))})}registerStackComponents(e,t){const i=this.createAgStackComponentsList(t);e.agStackComponentsRegistry.setupComponents(i)}getRegisteredModules(e,t){const i=e?e.modules:null,n=re.__getRegisteredModules(t),s=[],r={},o=(e,t,i)=>{var n;r[(n=t).moduleName]||(r[n.moduleName]=!0,s.push(n),re.__register(n,e,i)),t.dependantModules&&t.dependantModules.forEach(t=>o(e,t,i))};return i&&i.forEach(e=>o(!0,e,t)),n&&n.forEach(e=>o(!re.__isPackageBased(),e,void 0)),s}registerModuleUserComponents(e,t){this.extractModuleEntity(t,e=>e.userComponents?e.userComponents:[]).forEach(t=>{e.userComponentRegistry.registerDefaultComponent(t.componentName,t.componentClass)})}createProvidedBeans(e,t,i){let n=i?i.frameworkOverrides:null;C(n)&&(n=new Ec);const s={gridOptions:t,eGridDiv:e,globalEventListener:i?i.globalEventListener:null,globalSyncEventListener:i?i.globalSyncEventListener:null,frameworkOverrides:n};return i&&i.providedBeanInstances&&Object.assign(s,i.providedBeanInstances),s}createAgStackComponentsList(e){let t=[{componentName:"AgCheckbox",componentClass:zs},{componentName:"AgRadioButton",componentClass:Ws},{componentName:"AgToggleButton",componentClass:Wl},{componentName:"AgInputTextField",componentClass:ir},{componentName:"AgInputTextArea",componentClass:jl},{componentName:"AgInputNumberField",componentClass:nr},{componentName:"AgInputDateField",componentClass:$l},{componentName:"AgInputRange",componentClass:Kl},{componentName:"AgRichSelect",componentClass:Zl},{componentName:"AgSelect",componentClass:Hs},{componentName:"AgSlider",componentClass:Jl},{componentName:"AgGridBody",componentClass:_a},{componentName:"AgHeaderRoot",componentClass:bl},{componentName:"AgSortIndicator",componentClass:br},{componentName:"AgPagination",componentClass:qc},{componentName:"AgPageSizeSelector",componentClass:Lh},{componentName:"AgOverlayWrapper",componentClass:Zc},{componentName:"AgGroupComponent",componentClass:tc},{componentName:"AgRowContainer",componentClass:Ha},{componentName:"AgFakeHorizontalScroll",componentClass:ph},{componentName:"AgFakeVerticalScroll",componentClass:Ah},{componentName:"AgAutocomplete",componentClass:vc}];const i=this.extractModuleEntity(e,e=>e.agStackComponents?e.agStackComponents:[]);return t=t.concat(i),t}createBeansList(e="clientSide",t,i){const n=t.filter(t=>!t.rowModel||t.rowModel===e),s={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(!s[e])return void W("Could not find row model for rowModelType = "+e);if(!re.__assertRegistered(s[e],`rowModelType = '${e}'`,i))return;const r=[la,Qc,Jc,rh,Bc,zo,po,Uc,zc,Tl,Lo,Kc,Cl,xh,Ph,Ol,Bo,It,me,Sh,pc,Tc,jo,Mt,ml,Ul,Ll,Rc,rt,Mc,Oa,Vc,Ic,kc,Pl,wl,Br,Dc,Oc,Na,$c,Ac,zl,La,Nc,Fc,Gc,Yc,pt,Hc,Dl,sh,Nt,oh,ah,Hl,lh,ch,gh,fh,hh,Dh,Wo,Ih,Rh,kh,Rl,_h,Nh,kl],o=this.extractModuleEntity(n,e=>e.beans?e.beans:[]);r.push(...o);const a=[];return r.forEach(e=>{a.indexOf(e)<0&&a.push(e)}),a}extractModuleEntity(e,t){return[].concat(...e.map(t))}},Uh=class{wrap(e,t,i=[],n){const s=this.createWrapper(e,n);return t.forEach(e=>{this.createMethod(s,e,!0)}),i.forEach(e=>{this.createMethod(s,e,!1)}),s}unwrap(e){return e}createMethod(e,t,i){e.addMethod(t,this.createMethodProxy(e,t,i))}createMethodProxy(e,t,i){return function(){return e.hasMethod(t)?e.callMethod(t,arguments):(i&&console.warn("AG Grid: Framework component is missing the method "+t+"()"),null)}}},zh=class{};zh.CHART_TYPE_TO_SERIES_TYPE={column:"bar",groupedColumn:"bar",stackedColumn:"bar",normalizedColumn:"bar",bar:"bar",groupedBar:"bar",stackedBar:"bar",normalizedBar:"bar",line:"line",scatter:"scatter",bubble:"bubble",pie:"pie",donut:"donut",doughnut:"donut",area:"area",stackedArea:"area",normalizedArea:"area",histogram:"histogram",radarLine:"radar-line",radarArea:"radar-area",nightingale:"nightingale",radialColumn:"radial-column",radialBar:"radial-bar",sunburst:"sunburst",rangeBar:"range-bar",rangeArea:"range-area",boxPlot:"box-plot",treemap:"treemap",heatmap:"heatmap",waterfall:"waterfall"},zh.COMBO_CHART_TYPES=["columnLineCombo","areaColumnCombo","customCombo"],zh.SERIES_GROUP_TYPES=["grouped","stacked","normalized"];var Wh=(e=>(e.InsideBase="insideBase",e.InsideEnd="insideEnd",e.Center="center",e.OutsideEnd="outsideEnd",e))(Wh||{}),jh="undefined"==typeof globalThis?{}:globalThis;jh.HTMLElement="undefined"==typeof HTMLElement?{}:HTMLElement,jh.HTMLButtonElement="undefined"==typeof HTMLButtonElement?{}:HTMLButtonElement,jh.HTMLSelectElement="undefined"==typeof HTMLSelectElement?{}:HTMLSelectElement,jh.HTMLInputElement="undefined"==typeof HTMLInputElement?{}:HTMLInputElement,jh.Node="undefined"==typeof Node?{}:Node,jh.MouseEvent="undefined"==typeof MouseEvent?{}:MouseEvent;var $h=class e{constructor(t,i,n,s,r,o){this.nextId=0,this.rowCountReady=!1,this.allNodesMap={},this.rootNode=t,this.gos=i,this.eventService=n,this.columnModel=s,this.beans=o,this.selectionService=r,this.rootNode.group=!0,this.rootNode.level=-1,this.rootNode.id=e.ROOT_NODE_ID,this.rootNode.allLeafChildren=[],this.rootNode.childrenAfterGroup=[],this.rootNode.childrenAfterSort=[],this.rootNode.childrenAfterAggFilter=[],this.rootNode.childrenAfterFilter=[]}getCopyOfNodesMap(){return cs.cloneObject(this.allNodesMap)}getRowNode(e){return this.allNodesMap[e]}setRowData(t){if("string"==typeof t)return void console.warn("AG Grid: rowData must be an array.");this.rowCountReady=!0,this.dispatchRowDataUpdateStartedEvent(t);const i=this.rootNode,n=this.rootNode.sibling;i.childrenAfterFilter=null,i.childrenAfterGroup=null,i.childrenAfterAggFilter=null,i.childrenAfterSort=null,i.childrenMapped=null,i.updateHasChildren(),this.nextId=0,this.allNodesMap={},t?i.allLeafChildren=t.map(t=>this.createNode(t,this.rootNode,e.TOP_LEVEL)):(i.allLeafChildren=[],i.childrenAfterGroup=[]),n&&(n.childrenAfterFilter=i.childrenAfterFilter,n.childrenAfterGroup=i.childrenAfterGroup,n.childrenAfterAggFilter=i.childrenAfterAggFilter,n.childrenAfterSort=i.childrenAfterSort,n.childrenMapped=i.childrenMapped,n.allLeafChildren=i.allLeafChildren)}updateRowData(e,t){this.rowCountReady=!0,this.dispatchRowDataUpdateStartedEvent(e.add);const i={remove:[],update:[],add:[]},n=[];return this.executeRemove(e,i,n),this.executeUpdate(e,i,n),this.executeAdd(e,i),this.updateSelection(n,"rowDataChanged"),t&&cs.sortRowNodesByOrder(this.rootNode.allLeafChildren,t),i}isRowCountReady(){return this.rowCountReady}dispatchRowDataUpdateStartedEvent(e){const t={type:ct.EVENT_ROW_DATA_UPDATE_STARTED,firstRowData:(null==e?void 0:e.length)?e[0]:null};this.eventService.dispatchEvent(t)}updateSelection(e,t){const i=e.length>0;if(i&&this.selectionService.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,source:t}),this.selectionService.updateGroupsFromChildrenSelections(t),i){const e={type:ct.EVENT_SELECTION_CHANGED,source:t};this.eventService.dispatchEvent(e)}}executeAdd(t,i){var n;const{add:s,addIndex:r}=t;if(cs.missingOrEmpty(s))return;const o=s.map(t=>this.createNode(t,this.rootNode,e.TOP_LEVEL));if("number"==typeof r&&r>=0){const{allLeafChildren:e}=this.rootNode,t=e.length;let i=r;if(this.gos.get("treeData")&&r>0&&t>0)for(let s=0;s<t;s++)if((null==(n=e[s])?void 0:n.rowIndex)==r-1){i=s+1;break}const s=e.slice(0,i),a=e.slice(i,e.length);this.rootNode.allLeafChildren=[...s,...o,...a]}else this.rootNode.allLeafChildren=[...this.rootNode.allLeafChildren,...o];this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren),i.add=o}executeRemove(e,t,i){const{remove:n}=e;if(cs.missingOrEmpty(n))return;const s={};n.forEach(e=>{const n=this.lookupRowNode(e);n&&(n.isSelected()&&i.push(n),n.clearRowTopAndRowIndex(),s[n.id]=!0,delete this.allNodesMap[n.id],t.remove.push(n))}),this.rootNode.allLeafChildren=this.rootNode.allLeafChildren.filter(e=>!s[e.id]),this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren)}executeUpdate(t,i,n){const{update:s}=t;cs.missingOrEmpty(s)||s.forEach(t=>{const s=this.lookupRowNode(t);s&&(s.updateData(t),!s.selectable&&s.isSelected()&&n.push(s),this.setMasterForRow(s,t,e.TOP_LEVEL,!1),i.update.push(s))})}lookupRowNode(e){const t=this.gos.getCallback("getRowId");let i;if(t){const n=t({data:e,level:0});if(i=this.allNodesMap[n],!i)return console.error(`AG Grid: could not find row id=${n}, data item was not found for this id`),null}else if(i=this.rootNode.allLeafChildren.find(t=>t.data===e),!i)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 i||null}createNode(e,t,i){const n=new Lr(this.beans);n.group=!1,this.setMasterForRow(n,e,i,!0);const s=this.gos.get("suppressParentsInRowNodes");return t&&!s&&(n.parent=t),n.level=i,n.setDataAndId(e,this.nextId.toString()),this.allNodesMap[n.id]&&console.warn(`AG Grid: duplicate node id '${n.id}' detected from getRowId callback, this could cause issues in your grid.`),this.allNodesMap[n.id]=n,this.nextId++,n}setMasterForRow(e,t,i,n){if(this.gos.get("treeData"))e.setMaster(!1),n&&(e.expanded=!1);else{if(this.gos.get("masterDetail")){const i=this.gos.get("isRowMaster");i?e.setMaster(i(t)):e.setMaster(!0)}else e.setMaster(!1);if(n){const t=this.columnModel.getRowGroupColumns(),n=i+(t?t.length:0);e.expanded=!!e.master&&this.isExpanded(n)}}}isExpanded(e){const t=this.gos.get("groupDefaultExpanded");return-1===t||e<t}};$h.TOP_LEVEL=0,$h.ROOT_NODE_ID="ROOT_NODE_ID";var Kh=$h,Yh=class extends st{constructor(){super(...arguments),this.onRowHeightChanged_debounced=cs.debounce(this.onRowHeightChanged.bind(this),100),this.rowsToDisplay=[],this.hasStarted=!1,this.shouldSkipSettingDataOnStart=!1,this.isRefreshingModel=!1,this.rowCountReady=!1}init(){const e=this.refreshModel.bind(this,{step:"group"}),t=!this.gos.get("suppressAnimationFrame"),i=this.refreshModel.bind(this,{step:"group",afterColumnsChanged:!0,keepRenderedRows:!0,animate:t});this.addManagedListener(this.eventService,ct.EVENT_NEW_COLUMNS_LOADED,i),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_ROW_GROUP_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_VALUE_CHANGED,this.onValueChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PIVOT_CHANGED,this.refreshModel.bind(this,{step:"pivot"})),this.addManagedListener(this.eventService,ct.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_SORT_CHANGED,this.onSortChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PIVOT_MODE_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_GRID_STYLES_CHANGED,this.onGridStylesChanges.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_GRID_READY,()=>this.onGridReady()),this.addPropertyListeners(),this.rootNode=new Lr(this.beans),this.nodeManager=new Kh(this.rootNode,this.gos,this.eventService,this.columnModel,this.selectionService,this.beans)}addPropertyListeners(){const e=new Set(["treeData","masterDetail"]),t=new Set(["suppressParentsInRowNodes","groupDefaultExpanded","groupAllowUnbalanced","initialGroupOrderComparator","groupHideOpenParents","groupDisplayType"]),i=new Set(["excludeChildrenWhenTreeDataFiltering"]),n=new Set(["removePivotHeaderRowWhenSingleValueColumn","pivotRowTotals","pivotColumnGroupTotals","suppressExpandablePivotGroups"]),s=new Set(["getGroupRowAgg","alwaysAggregateAtRootLevel","groupIncludeTotalFooter","suppressAggFilteredOnly","grandTotalRow"]),r=new Set(["postSortRows","groupDisplayType","accentedSort"]),o=new Set([]),a=new Set(["groupRemoveSingleChildren","groupRemoveLowestSingleChildren","groupIncludeFooter","groupTotalRow"]),l=[...e,...t,...i,...n,...n,...s,...r,...o,...a];this.addManagedPropertyListeners(l,l=>{var c;const h=null==(c=l.changeSet)?void 0:c.properties;if(!h)return;const u=e=>h.some(t=>e.has(t));u(e)?this.setRowData(this.rootNode.allLeafChildren.map(e=>e.data)):u(t)?this.refreshModel({step:"group"}):u(i)?this.refreshModel({step:"filter"}):u(n)?this.refreshModel({step:"pivot"}):u(s)?this.refreshModel({step:"aggregate"}):u(r)?this.refreshModel({step:"sort"}):u(o)?this.refreshModel({step:"filter_aggregates"}):u(a)&&this.refreshModel({step:"map"})}),this.addManagedPropertyListener("rowHeight",()=>this.resetRowHeights())}start(){this.hasStarted=!0,this.shouldSkipSettingDataOnStart?this.dispatchUpdateEventsAndRefresh():this.setInitialData()}setInitialData(){const e=this.gos.get("rowData");e&&(this.shouldSkipSettingDataOnStart=!0,this.setRowData(e))}ensureRowHeightsValid(e,t,i,n){let s,r=!1;do{s=!1;const o=this.getRowIndexAtPixel(e),a=this.getRowIndexAtPixel(t),l=Math.max(o,i),c=Math.min(a,n);for(let e=l;e<=c;e++){const t=this.getRow(e);if(t.rowHeightEstimated){const e=this.gos.getRowHeightForNode(t);t.setRowHeight(e.height),s=!0,r=!0}}s&&this.setRowTopAndRowIndex()}while(s);return r}setRowTopAndRowIndex(){const e=this.environment.getDefaultRowHeight();let t=0;const i=new Set,n=this.gos.isDomLayout("normal");for(let s=0;s<this.rowsToDisplay.length;s++){const r=this.rowsToDisplay[s];if(null!=r.id&&i.add(r.id),null==r.rowHeight){const t=this.gos.getRowHeightForNode(r,n,e);r.setRowHeight(t.height,t.estimated)}r.setRowTop(t),r.setRowIndex(s),t+=r.rowHeight}return i}clearRowTopAndRowIndex(e,t){const i=e.isActive(),n=e=>{e&&null!=e.id&&!t.has(e.id)&&e.clearRowTopAndRowIndex()},s=e=>{if(n(e),n(e.detailNode),n(e.sibling),e.hasChildren()&&e.childrenAfterGroup){const t=-1==e.level;i&&!t&&!e.expanded||e.childrenAfterGroup.forEach(s)}};s(this.rootNode)}ensureRowsAtPixel(e,t,i=0){const n=this.getRowIndexAtPixel(t),s=this.getRow(n),r=!this.gos.get("suppressAnimationFrame");return s!==e[0]&&(e.forEach(e=>{cs.removeFromArray(this.rootNode.allLeafChildren,e)}),e.forEach((e,t)=>{cs.insertIntoArray(this.rootNode.allLeafChildren,e,Math.max(n+i,0)+t)}),this.refreshModel({step:"group",keepRenderedRows:!0,keepEditingRows:!0,animate:r}),!0)}highlightRowAtPixel(e,t){const i=null!=t?this.getRowIndexAtPixel(t):null,n=null!=i?this.getRow(i):null;if(!n||!e||n===e||null==t)return void(this.lastHighlightedRow&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null));const s=this.getHighlightPosition(t,n);this.lastHighlightedRow&&this.lastHighlightedRow!==n&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null),n.setHighlighted(s),this.lastHighlightedRow=n}getHighlightPosition(e,t){if(!t){const i=this.getRowIndexAtPixel(e);if(!(t=this.getRow(i||0)))return 1}const{rowTop:i,rowHeight:n}=t;return e-i<n/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(e){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return e;let t=this.rootNode.childrenAfterSort[e];if(this.gos.get("groupHideOpenParents"))for(;t.expanded&&t.childrenAfterSort&&t.childrenAfterSort.length>0;)t=t.childrenAfterSort[0];return t.rowIndex}getRowBounds(e){if(cs.missing(this.rowsToDisplay))return null;const t=this.rowsToDisplay[e];return t?{rowTop:t.rowTop,rowHeight:t.rowHeight}:null}onRowGroupOpened(){const e=this.gos.isAnimateRows();this.refreshModel({step:"map",keepRenderedRows:!0,animate:e})}onFilterChanged(e){if(e.afterDataChange)return;const t=this.gos.isAnimateRows(),i=0===e.columns.length||e.columns.some(e=>e.isPrimary())?"filter":"filter_aggregates";this.refreshModel({step:i,keepRenderedRows:!0,animate:t})}onSortChanged(){const e=this.gos.isAnimateRows();this.refreshModel({step:"sort",keepRenderedRows:!0,animate:e,keepEditingRows:!0})}getType(){return"clientSide"}onValueChanged(){this.columnModel.isPivotActive()?this.refreshModel({step:"pivot"}):this.refreshModel({step:"aggregate"})}createChangePath(e){const t=cs.missingOrEmpty(e),i=new Gl(!1,this.rootNode);return(t||this.gos.get("treeData"))&&i.setInactive(),i}isSuppressModelUpdateAfterUpdateTransaction(e){if(!this.gos.get("suppressModelUpdateAfterUpdateTransaction"))return!1;if(null==e.rowNodeTransactions)return!1;const t=e.rowNodeTransactions.filter(e=>null!=e.add&&e.add.length>0||null!=e.remove&&e.remove.length>0);return null==t||0==t.length}buildRefreshModelParams(e){let t="group";const i={everything:"group",group:"group",filter:"filter",map:"map",aggregate:"aggregate",sort:"sort",pivot:"pivot"};if(cs.exists(e)&&(t=i[e]),!cs.missing(t))return{step:t,keepRenderedRows:!0,keepEditingRows:!0,animate:!this.gos.get("suppressAnimationFrame")};console.error(`AG Grid: invalid step ${e}, available steps are ${Object.keys(i).join(", ")}`)}refreshModel(e){if(!this.hasStarted||this.isRefreshingModel||this.columnModel.shouldRowModelIgnoreRefresh())return;let t="object"==typeof e&&"step"in e?e:this.buildRefreshModelParams(e);if(!t)return;if(this.isSuppressModelUpdateAfterUpdateTransaction(t))return;const i=this.createChangePath(t.rowNodeTransactions);switch(this.isRefreshingModel=!0,t.step){case"group":this.doRowGrouping(t.rowNodeTransactions,t.rowNodeOrder,i,!!t.afterColumnsChanged);case"filter":this.doFilter(i);case"pivot":this.doPivot(i);case"aggregate":this.doAggregate(i);case"filter_aggregates":this.doFilterAggregates(i);case"sort":this.doSort(t.rowNodeTransactions,i);case"map":this.doRowsToDisplay()}const n=this.setRowTopAndRowIndex();this.clearRowTopAndRowIndex(i,n),this.isRefreshingModel=!1;const s={type:ct.EVENT_MODEL_UPDATED,animate:t.animate,keepRenderedRows:t.keepRenderedRows,newData:t.newData,newPage:!1,keepUndoRedoStack:t.keepUndoRedoStack};this.eventService.dispatchEvent(s)}isEmpty(){const e=cs.missing(this.rootNode.allLeafChildren)||0===this.rootNode.allLeafChildren.length;return cs.missing(this.rootNode)||e||!this.columnModel.isReady()}isRowsToRender(){return cs.exists(this.rowsToDisplay)&&this.rowsToDisplay.length>0}getNodesInRangeForSelection(e,t){let i=!t,n=!1;const s=[],r=this.gos.get("groupSelectsChildren");return this.forEachNodeAfterFilterAndSort(o=>{if(!n)if(i&&(o===t||o===e)&&(n=!0,o.group&&r))s.push(...o.allLeafChildren);else{if(!i){if(o!==t&&o!==e)return;i=!0}(!o.group||!r)&&s.push(o)}}),s}setDatasource(e){console.error("AG Grid: should never call setDatasource on clientSideRowController")}getTopLevelNodes(){return this.rootNode?this.rootNode.childrenAfterGroup:null}getRootNode(){return this.rootNode}getRow(e){return this.rowsToDisplay[e]}isRowPresent(e){return this.rowsToDisplay.indexOf(e)>=0}getRowIndexAtPixel(e){if(this.isEmpty()||0===this.rowsToDisplay.length)return-1;let t=0,i=this.rowsToDisplay.length-1;if(e<=0)return 0;if(cs.last(this.rowsToDisplay).rowTop<=e)return this.rowsToDisplay.length-1;let n=-1,s=-1;for(;;){const r=Math.floor((t+i)/2),o=this.rowsToDisplay[r];if(this.isRowInPixel(o,e))return r;if(o.rowTop<e?t=r+1:o.rowTop>e&&(i=r-1),n===t&&s===i)return r;n=t,s=i}}isRowInPixel(e,t){const i=e.rowTop,n=e.rowTop+e.rowHeight;return i<=t&&n>t}forEachLeafNode(e){this.rootNode.allLeafChildren&&this.rootNode.allLeafChildren.forEach((t,i)=>e(t,i))}forEachNode(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterGroup||[]],callback:e,recursionType:0,index:0,includeFooterNodes:t})}forEachNodeAfterFilter(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterAggFilter||[]],callback:e,recursionType:1,index:0,includeFooterNodes:t})}forEachNodeAfterFilterAndSort(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterSort||[]],callback:e,recursionType:2,index:0,includeFooterNodes:t})}forEachPivotNode(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[this.rootNode],callback:e,recursionType:3,index:0,includeFooterNodes:t})}recursivelyWalkNodesAndCallback(e){const{nodes:t,callback:i,recursionType:n,includeFooterNodes:s}=e;let{index:r}=e;const o=e=>{var n;const o=null==(n=t[0])?void 0:n.parent;if(!o)return;const a=s&&this.gos.getGrandTotalRow(),l=this.gos.getGroupTotalRowCallback(),c=s&&l({node:o});o===this.rootNode?a===e&&(o.createFooter(),i(o.sibling,r++)):c===e&&(o.createFooter(),i(o.sibling,r++))};o("top");for(let e=0;e<t.length;e++){const o=t[e];if(i(o,r++),o.hasChildren()&&!o.footer){let e=null;switch(n){case 0:e=o.childrenAfterGroup;break;case 1:e=o.childrenAfterAggFilter;break;case 2:e=o.childrenAfterSort;break;case 3:e=o.leafGroup?null:o.childrenAfterSort}e&&(r=this.recursivelyWalkNodesAndCallback({nodes:[...e],callback:i,recursionType:n,index:r,includeFooterNodes:s}))}}return o("bottom"),r}doAggregate(e){var t;null==(t=this.aggregationStage)||t.execute({rowNode:this.rootNode,changedPath:e})}doFilterAggregates(e){this.filterAggregatesStage?this.filterAggregatesStage.execute({rowNode:this.rootNode,changedPath:e}):this.rootNode.childrenAfterAggFilter=this.rootNode.childrenAfterFilter}expandOrCollapseAll(e){const t=this.gos.get("treeData"),i=this.columnModel.isPivotActive(),n=s=>{s&&s.forEach(s=>{const r=()=>{s.expanded=e,n(s.childrenAfterGroup)};t?cs.exists(s.childrenAfterGroup)&&r():i?!s.leafGroup&&r():s.group&&r()})};this.rootNode&&n(this.rootNode.childrenAfterGroup),this.refreshModel({step:"map"});const s=e?"expandAll":"collapseAll",r={type:ct.EVENT_EXPAND_COLLAPSE_ALL,source:s};this.eventService.dispatchEvent(r)}doSort(e,t){this.sortStage.execute({rowNode:this.rootNode,rowNodeTransactions:e,changedPath:t})}doRowGrouping(e,t,i,n){if(this.groupStage){if(e?this.groupStage.execute({rowNode:this.rootNode,rowNodeTransactions:e,rowNodeOrder:t,changedPath:i}):this.groupStage.execute({rowNode:this.rootNode,changedPath:i,afterColumnsChanged:n}),this.gos.get("groupSelectsChildren")&&this.selectionService.updateGroupsFromChildrenSelections("rowGroupChanged",i)){const e={type:ct.EVENT_SELECTION_CHANGED,source:"rowGroupChanged"};this.eventService.dispatchEvent(e)}}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:ct.EVENT_ROW_COUNT_READY}))}doFilter(e){this.filterStage.execute({rowNode:this.rootNode,changedPath:e})}doPivot(e){var t;null==(t=this.pivotStage)||t.execute({rowNode:this.rootNode,changedPath:e})}getCopyOfNodesMap(){return this.nodeManager.getCopyOfNodesMap()}getRowNode(e){if("string"==typeof e&&0==e.indexOf(Lr.ID_PREFIX_ROW_GROUP)){let t;return this.forEachNode(i=>{i.id===e&&(t=i)}),t}return this.nodeManager.getRowNode(e)}setRowData(e){this.selectionService.reset("rowDataChanged"),this.nodeManager.setRowData(e),this.hasStarted&&this.dispatchUpdateEventsAndRefresh()}dispatchUpdateEventsAndRefresh(){const e={type:ct.EVENT_ROW_DATA_UPDATED};this.eventService.dispatchEvent(e),this.refreshModel({step:"group",newData:!0})}batchUpdateRowData(e,t){if(null==this.applyAsyncTransactionsTimeout){this.rowDataTransactionBatch=[];const e=this.gos.getAsyncTransactionWaitMillis();this.applyAsyncTransactionsTimeout=window.setTimeout(()=>{this.executeBatchUpdateRowData()},e)}this.rowDataTransactionBatch.push({rowDataTransaction:e,callback:t})}flushAsyncTransactions(){null!=this.applyAsyncTransactionsTimeout&&(clearTimeout(this.applyAsyncTransactionsTimeout),this.executeBatchUpdateRowData())}executeBatchUpdateRowData(){this.valueCache.onDataChanged();const e=[],t=[];let i=!1;if(this.rowDataTransactionBatch&&this.rowDataTransactionBatch.forEach(n=>{const s=this.nodeManager.updateRowData(n.rowDataTransaction,void 0);t.push(s),n.callback&&e.push(n.callback.bind(null,s)),"number"==typeof n.rowDataTransaction.addIndex&&(i=!0)}),this.commonUpdateRowData(t,void 0,i),e.length>0&&window.setTimeout(()=>{e.forEach(e=>e())},0),t.length>0){const e={type:ct.EVENT_ASYNC_TRANSACTIONS_FLUSHED,results:t};this.eventService.dispatchEvent(e)}this.rowDataTransactionBatch=null,this.applyAsyncTransactionsTimeout=void 0}updateRowData(e,t){this.valueCache.onDataChanged();const i=this.nodeManager.updateRowData(e,t),n="number"==typeof e.addIndex;return this.commonUpdateRowData([i],t,n),i}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++)e[this.rootNode.allLeafChildren[t].id]=t;return e}commonUpdateRowData(e,t,i){if(!this.hasStarted)return;const n=!this.gos.get("suppressAnimationFrame");i&&(t=this.createRowNodeOrder());const s={type:ct.EVENT_ROW_DATA_UPDATED};this.eventService.dispatchEvent(s),this.refreshModel({step:"group",rowNodeTransactions:e,rowNodeOrder:t,keepRenderedRows:!0,keepEditingRows:!0,animate:n})}doRowsToDisplay(){this.rowsToDisplay=this.flattenStage.execute({rowNode:this.rootNode})}onRowHeightChanged(){this.refreshModel({step:"map",keepRenderedRows:!0,keepEditingRows:!0,keepUndoRedoStack:!0})}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}resetRowHeights(){const e=this.resetRowHeightsForAllRowNodes();this.rootNode.setRowHeight(this.rootNode.rowHeight,!0),this.rootNode.sibling&&this.rootNode.sibling.setRowHeight(this.rootNode.sibling.rowHeight,!0),e&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let e=!1;return this.forEachNode(t=>{t.setRowHeight(t.rowHeight,!0);const i=t.detailNode;i&&i.setRowHeight(i.rowHeight,!0),t.sibling&&t.sibling.setRowHeight(t.sibling.rowHeight,!0),e=!0}),e}onGridStylesChanges(){this.columnModel.isAutoRowHeightActive()||this.resetRowHeights()}onGridReady(){this.hasStarted||this.setInitialData()}isRowDataLoaded(){return this.rowCountReady}};g([ue("columnModel")],Yh.prototype,"columnModel",2),g([ue("selectionService")],Yh.prototype,"selectionService",2),g([ue("valueCache")],Yh.prototype,"valueCache",2),g([ue("beans")],Yh.prototype,"beans",2),g([ue("filterStage")],Yh.prototype,"filterStage",2),g([ue("sortStage")],Yh.prototype,"sortStage",2),g([ue("flattenStage")],Yh.prototype,"flattenStage",2),g([de("groupStage")],Yh.prototype,"groupStage",2),g([de("aggregationStage")],Yh.prototype,"aggregationStage",2),g([de("pivotStage")],Yh.prototype,"pivotStage",2),g([de("filterAggregatesStage")],Yh.prototype,"filterAggregatesStage",2),g([le],Yh.prototype,"init",1),Yh=g([he("rowModel")],Yh);var qh=class extends st{execute(e){const{changedPath:t}=e;this.filterService.filter(t)}};g([ue("filterService")],qh.prototype,"filterService",2),qh=g([he("filterStage")],qh);var Xh=class extends st{execute(e){const t=this.sortController.getSortOptions(),i=cs.exists(t)&&t.length>0,n=i&&cs.exists(e.rowNodeTransactions)&&this.gos.get("deltaSort"),s=t.some(e=>this.gos.isColumnsSortingCoupledToGroup()?e.column.isPrimary()&&e.column.isRowGroupActive():!!e.column.getColDef().showRowGroup);this.sortService.sort(t,i,n,e.rowNodeTransactions,e.changedPath,s)}};g([ue("sortService")],Xh.prototype,"sortService",2),g([ue("sortController")],Xh.prototype,"sortController",2),Xh=g([he("sortStage")],Xh);var Zh=class extends st{execute(e){const t=e.rowNode,i=[],n=this.beans.columnModel.isPivotMode(),s=n&&t.leafGroup,r=s?[t]:t.childrenAfterSort,o=this.getFlattenDetails();if(this.recursivelyAddToRowsToDisplay(o,r,i,n,0),!s&&i.length>0&&o.grandTotalRow){t.createFooter();const e="top"===o.grandTotalRow;this.addRowNodeToRowsToDisplay(o,t.sibling,i,0,e)}return i}getFlattenDetails(){const e=this.gos.get("groupRemoveSingleChildren");return{groupRemoveLowestSingleChildren:!e&&this.gos.get("groupRemoveLowestSingleChildren"),groupRemoveSingleChildren:e,isGroupMultiAutoColumn:this.gos.isGroupMultiAutoColumn(),hideOpenParents:this.gos.get("groupHideOpenParents"),grandTotalRow:this.gos.getGrandTotalRow(),groupTotalRow:this.gos.getGroupTotalRowCallback()}}recursivelyAddToRowsToDisplay(e,t,i,n,s){if(!cs.missingOrEmpty(t))for(let r=0;r<t.length;r++){const o=t[r],a=o.hasChildren(),l=n&&!a,c=e.groupRemoveSingleChildren&&a&&1===o.childrenAfterGroup.length,h=e.groupRemoveLowestSingleChildren&&a&&o.leafGroup&&1===o.childrenAfterGroup.length,u=n&&o.leafGroup,d=e.hideOpenParents&&o.expanded&&!o.master&&!u;if(!(l||d||c||h)&&this.addRowNodeToRowsToDisplay(e,o,i,s),!n||!o.leafGroup)if(a){const t=c||h;if(o.expanded||t){const r=e.groupTotalRow({node:o});r||o.destroyFooter();const a=t?s:s+1;"top"===r&&(o.createFooter(),this.addRowNodeToRowsToDisplay(e,o.sibling,i,a)),this.recursivelyAddToRowsToDisplay(e,o.childrenAfterSort,i,n,a),"bottom"===r&&(o.createFooter(),this.addRowNodeToRowsToDisplay(e,o.sibling,i,a))}}else if(o.master&&o.expanded){const t=this.createDetailNode(o);this.addRowNodeToRowsToDisplay(e,t,i,s)}}}addRowNodeToRowsToDisplay(e,t,i,n,s){s?i.unshift(t):i.push(t),t.setUiLevel(e.isGroupMultiAutoColumn?0:n)}createDetailNode(e){if(cs.exists(e.detailNode))return e.detailNode;const t=new Lr(this.beans);return t.detail=!0,t.selectable=!1,t.parent=e,cs.exists(e.id)&&(t.id="detail_"+e.id),t.data=e.data,t.level=e.level+1,e.detailNode=t,t}};g([ue("beans")],Zh.prototype,"beans",2),Zh=g([he("flattenStage")],Zh);var Qh=class extends st{sort(e,t,i,n,s,r){const o=this.gos.get("groupMaintainOrder"),a=this.columnModel.getAllGridColumns().some(e=>e.isRowGroupActive());let l={};i&&n&&(l=this.calculateDirtyNodes(n));const c=this.columnModel.isPivotMode(),h=this.gos.getCallback("postSortRows");s&&s.forEachChangedNodeDepthFirst(n=>{var u;this.pullDownGroupDataForHideOpenParents(n.childrenAfterAggFilter,!0);const d=c&&n.leafGroup;if(o&&a&&!n.leafGroup&&!r){const e=null==(u=this.columnModel.getRowGroupColumns())?void 0:u[n.level+1],t=null===(null==e?void 0:e.getSort()),i=n.childrenAfterAggFilter.slice(0);if(n.childrenAfterSort&&!t){const e={};n.childrenAfterSort.forEach((t,i)=>{e[t.id]=i}),i.sort((t,i)=>{var n,s;return(null!=(n=e[t.id])?n:0)-(null!=(s=e[i.id])?s:0)})}n.childrenAfterSort=i}else n.childrenAfterSort=!t||d?n.childrenAfterAggFilter.slice(0):i?this.doDeltaSort(n,l,s,e):this.rowNodeSorter.doFullSort(n.childrenAfterAggFilter,e);if(n.sibling&&(n.sibling.childrenAfterSort=n.childrenAfterSort),this.updateChildIndexes(n),h){const e={nodes:n.childrenAfterSort};h(e)}}),this.updateGroupDataForHideOpenParents(s)}calculateDirtyNodes(e){const t={},i=e=>{e&&e.forEach(e=>t[e.id]=!0)};return e&&e.forEach(e=>{i(e.add),i(e.update),i(e.remove)}),t}doDeltaSort(e,t,i,n){const s=e.childrenAfterAggFilter,r=e.childrenAfterSort;if(!r)return this.rowNodeSorter.doFullSort(s,n);const o={},a=[];s.forEach(e=>{t[e.id]||!i.canSkip(e)?a.push(e):o[e.id]=!0});const l=r.filter(e=>o[e.id]),c=(e,t)=>({currentPos:t,rowNode:e}),h=a.map(c).sort((e,t)=>this.rowNodeSorter.compareRowNodes(n,e,t));return this.mergeSortedArrays(n,h,l.map(c)).map(({rowNode:e})=>e)}mergeSortedArrays(e,t,i){const n=[];let s=0,r=0;for(;s<t.length&&r<i.length;)this.rowNodeSorter.compareRowNodes(e,t[s],i[r])<0?n.push(t[s++]):n.push(i[r++]);for(;s<t.length;)n.push(t[s++]);for(;r<i.length;)n.push(i[r++]);return n}updateChildIndexes(e){if(cs.missing(e.childrenAfterSort))return;const t=e.childrenAfterSort;for(let i=0;i<t.length;i++){const n=t[i],s=0===i,r=i===e.childrenAfterSort.length-1;n.setFirstChild(s),n.setLastChild(r),n.setChildIndex(i)}}updateGroupDataForHideOpenParents(e){if(!this.gos.get("groupHideOpenParents"))return;if(this.gos.get("treeData"))return cs.warnOnce("The property hideOpenParents dose not work with Tree Data. This is because Tree Data has values at the group level, it doesn't make sense to hide them."),!1;const t=e=>{this.pullDownGroupDataForHideOpenParents(e.childrenAfterSort,!1),e.childrenAfterSort.forEach(e=>{e.hasChildren()&&t(e)})};e&&e.executeFromRootNode(e=>t(e))}pullDownGroupDataForHideOpenParents(e,t){this.gos.get("groupHideOpenParents")&&!cs.missing(e)&&e.forEach(e=>{this.columnModel.getGroupDisplayColumns().forEach(i=>{const n=i.getColDef().showRowGroup;if("string"!=typeof n)return void console.error("AG Grid: groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup");const s=n,r=this.columnModel.getPrimaryColumn(s);if(r!==e.rowGroupColumn)if(t)e.setGroupValue(i.getId(),void 0);else{const t=e.getFirstChildOfFirstChild(r);t&&e.setGroupValue(i.getId(),t.key)}})})}};g([ue("columnModel")],Qh.prototype,"columnModel",2),g([ue("rowNodeSorter")],Qh.prototype,"rowNodeSorter",2),Qh=g([he("sortService")],Qh);var Jh=class extends st{filter(e){const t=this.filterManager.isChildFilterPresent();this.filterNodes(t,e)}filterNodes(e,t){const i=(t,i)=>{t.hasChildren()?t.childrenAfterFilter=e&&!i?t.childrenAfterGroup.filter(e=>{const t=e.childrenAfterFilter&&e.childrenAfterFilter.length>0,i=e.data&&this.filterManager.doesRowPassFilter({rowNode:e});return t||i}):t.childrenAfterGroup:t.childrenAfterFilter=t.childrenAfterGroup,t.sibling&&(t.sibling.childrenAfterFilter=t.childrenAfterFilter)};if(this.doingTreeDataFiltering()){const e=(t,n)=>{if(t.childrenAfterGroup)for(let s=0;s<t.childrenAfterGroup.length;s++){const r=t.childrenAfterGroup[s],o=n||this.filterManager.doesRowPassFilter({rowNode:r});r.childrenAfterGroup?e(t.childrenAfterGroup[s],o):i(r,o)}i(t,n)},n=t=>e(t,!1);t.executeFromRootNode(n)}else{const e=e=>i(e,!1);t.forEachChangedNodeDepthFirst(e,!0)}}doingTreeDataFiltering(){return this.gos.get("treeData")&&!this.gos.get("excludeChildrenWhenTreeDataFiltering")}};g([ue("filterManager")],Jh.prototype,"filterManager",2),Jh=g([he("filterService")],Jh);var eu=class extends st{postConstruct(){"clientSide"===this.rowModel.getType()&&(this.clientSideRowModel=this.rowModel,this.addManagedPropertyListener("rowData",()=>this.onRowDataUpdated()))}isActive(){const e=this.gos.exists("getRowId");return!this.gos.get("resetRowDataOnUpdate")&&e}setRowData(e){const t=this.createTransactionForRowData(e);if(!t)return;const[i,n]=t;this.clientSideRowModel.updateRowData(i,n)}createTransactionForRowData(e){if(cs.missing(this.clientSideRowModel))return void console.error("AG Grid: ImmutableService only works with ClientSideRowModel");const t=this.gos.getCallback("getRowId");if(null==t)return void console.error("AG Grid: ImmutableService requires getRowId() callback to be implemented, your row data needs IDs!");const i={remove:[],update:[],add:[]},n=this.clientSideRowModel.getCopyOfNodesMap(),s=this.gos.get("suppressMaintainUnsortedOrder")?void 0:{};return cs.exists(e)&&e.forEach((e,r)=>{const o=t({data:e,level:0}),a=n[o];s&&(s[o]=r),a?(a.data!==e&&i.update.push(e),n[o]=void 0):i.add.push(e)}),cs.iterateObject(n,(e,t)=>{t&&i.remove.push(t.data)}),[i,s]}onRowDataUpdated(){const e=this.gos.get("rowData");e&&(this.isActive()?this.setRowData(e):(this.selectionService.reset("rowDataChanged"),this.clientSideRowModel.setRowData(e)))}};g([ue("rowModel")],eu.prototype,"rowModel",2),g([ue("rowRenderer")],eu.prototype,"rowRenderer",2),g([ue("selectionService")],eu.prototype,"selectionService",2),g([le],eu.prototype,"postConstruct",1);var tu={version:"31.3.4",moduleName:"@ag-grid-community/client-side-row-model",rowModel:"clientSide",beans:[Yh,qh,Xh,Zh,Qh,Jh,eu=g([he("immutableService")],eu)]},iu=Object.defineProperty,nu=Object.getOwnPropertyDescriptor,su=(e,t,i,n)=>{for(var s,r=n>1?void 0:n?nu(t,i):t,o=e.length-1;o>=0;o--)(s=e[o])&&(r=(n?s(t,i,r):s(r))||r);return n&&r&&iu(t,i,r),r},ru=class extends Vl{constructor(e,t,i){super(e),this.parentCache=t,this.params=i,this.startRow=e*i.blockSize,this.endRow=this.startRow+i.blockSize}postConstruct(){this.createRowNodes()}getBlockStateJson(){return{id:""+this.getId(),state:{blockNumber:this.getId(),startRow:this.getStartRow(),endRow:this.getEndRow(),pageStatus:this.getState()}}}setDataAndId(e,t,i){cs.exists(t)?e.setDataAndId(t,i.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();cs.missing(this.params.datasource.getRows)?console.warn("AG Grid: datasource is missing getRows method"):window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}processServerFail(){}createLoadParams(){return{startRow:this.getStartRow(),endRow:this.getEndRow(),successCallback:this.pageLoaded.bind(this,this.getVersion()),failCallback:this.pageLoadFailed.bind(this,this.getVersion()),sortModel:this.params.sortModel,filterModel:this.params.filterModel,context:this.gos.getGridCommonParams().context}}forEachNode(e,t,i){this.rowNodes.forEach((n,s)=>{this.startRow+s<i&&e(n,t.next())})}getLastAccessed(){return this.lastAccessed}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.next());const i=e-this.startRow;return this.rowNodes[i]}getStartRow(){return this.startRow}getEndRow(){return this.endRow}createRowNodes(){this.rowNodes=[];for(let e=0;e<this.params.blockSize;e++){const t=this.startRow+e,i=new Lr(this.beans);i.setRowHeight(this.params.rowHeight),i.uiLevel=0,i.setRowIndex(t),i.setRowTop(this.params.rowHeight*t),this.rowNodes.push(i)}}processServerResult(e){this.rowNodes.forEach((t,i)=>{const n=e.rowData?e.rowData[i]:void 0;!t.id&&t.alreadyRendered&&n&&(this.rowNodes[i]=new Lr(this.beans),this.rowNodes[i].setRowIndex(t.rowIndex),this.rowNodes[i].setRowTop(t.rowTop),this.rowNodes[i].setRowHeight(t.rowHeight),t.clearRowTopAndRowIndex()),this.setDataAndId(this.rowNodes[i],n,this.startRow+i)});const t=null!=e.rowCount&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,t)}destroyRowNodes(){this.rowNodes.forEach(e=>{e.clearRowTopAndRowIndex()})}};su([ue("beans")],ru.prototype,"beans",2),su([le],ru.prototype,"postConstruct",1),su([ce],ru.prototype,"destroyRowNodes",1);var ou,au=class e extends st{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 i=Math.floor(e/this.params.blockSize);let n=this.blocks[i];if(!n){if(t)return;n=this.createBlock(i)}return n.getRow(e)}createBlock(e){const t=this.createBean(new ru(e,this,this.params));return this.blocks[t.getId()]=t,this.blockCount++,this.purgeBlocksIfNeeded(t),this.params.rowNodeBlockLoader.addBlock(t),t}refreshCache(){0==this.blockCount?this.purgeCache():(this.getBlocksInOrder().forEach(e=>e.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(t){const i=this.getBlocksInOrder().filter(e=>e!=t);i.sort((e,t)=>t.getLastAccessed()-e.getLastAccessed());const n=this.params.maxBlocksInCache>0,s=n?this.params.maxBlocksInCache-1:null,r=e.MAX_EMPTY_BLOCKS_TO_KEEP-1;i.forEach((e,t)=>{if(e.getState()===ru.STATE_WAITING_TO_LOAD&&t>=r||n&&t>=s){if(this.isBlockCurrentlyDisplayed(e))return;if(this.isBlockFocused(e))return;this.removeBlockFromCache(e)}})}isBlockFocused(e){const t=this.focusService.getFocusCellToUseAfterRefresh();if(!t)return!1;if(null!=t.rowPinned)return!1;const i=e.getStartRow(),n=e.getEndRow();return t.rowIndex>=i&&t.rowIndex<n}isBlockCurrentlyDisplayed(e){const t=e.getStartRow(),i=e.getEndRow()-1;return this.rowRenderer.isRangeInRenderedViewport(t,i)}removeBlockFromCache(e){e&&this.destroyBlock(e)}checkRowCount(e,t){if("number"==typeof t&&t>=0)this.rowCount=t,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){const t=(e.getId()+1)*this.params.blockSize+this.params.overflowSize;this.rowCount<t&&(this.rowCount=t)}}setRowCount(e,t){this.rowCount=e,cs.exists(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize===0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t=new hs;this.getBlocksInOrder().forEach(i=>i.forEachNode(e,t,this.rowCount))}getBlocksInOrder(){return cs.getAllValuesInObject(this.blocks).sort((e,t)=>e.getId()-t.getId())}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:ct.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(e=>this.destroyBlock(e))}purgeCache(){this.getBlocksInOrder().forEach(e=>this.removeBlockFromCache(e)),this.lastRowIndexKnown=!1,0===this.rowCount&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()}getRowNodesInRange(e,t){const i=[];let n=-1,s=!1;const r=new hs;cs.missing(e)&&(s=!0);let o=!1;return this.getBlocksInOrder().forEach(a=>{o||(s&&n+1!==a.getId()?o=!0:(n=a.getId(),a.forEachNode(n=>{const r=n===e||n===t;(s||r)&&i.push(n),r&&(s=!s)},r,this.rowCount)))}),o||s?[]:i}};au.MAX_EMPTY_BLOCKS_TO_KEEP=2,su([ue("rowRenderer")],au.prototype,"rowRenderer",2),su([ue("focusService")],au.prototype,"focusService",2),su([(ou=ge("loggerFactory"),(e,t)=>ou(e,t,0))],au.prototype,"setBeans",1),su([ce],au.prototype,"destroyAllBlocks",1);var lu=au,cu=class extends st{getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}ensureRowHeightsValid(e,t,i,n){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")&&cs.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,ct.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_SORT_CHANGED,this.onSortChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_NEW_COLUMNS_LOADED,this.onColumnEverything.bind(this)),this.addManagedListener(this.eventService,ct.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 e;e=!this.cacheParams||this.isSortModelDifferent(),e&&this.reset()}isSortModelDifferent(){return!cs.jsonEquals(this.cacheParams.sortModel,this.sortController.getSortModel())}getType(){return"infinite"}setDatasource(e){this.destroyDatasource(),this.datasource=e,e&&this.reset()}isEmpty(){return!this.infiniteCache}isRowsToRender(){return!!this.infiniteCache}getNodesInRangeForSelection(e,t){return this.infiniteCache?this.infiniteCache.getRowNodesInRange(e,t):[]}reset(){this.datasource&&(null!=this.gos.getCallback("getRowId")||this.selectionService.reset("rowDataChanged"),this.resetCache())}createModelUpdatedEvent(){return{type:ct.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 hs},this.infiniteCache=this.createBean(new lu(this.cacheParams)),this.eventService.dispatchEventOnce({type:ct.EVENT_ROW_COUNT_READY});const e=this.createModelUpdatedEvent();this.eventService.dispatchEvent(e)}updateRowHeights(){this.forEachNode(e=>{e.setRowHeight(this.rowHeight),e.setRowTop(this.rowHeight*e.rowIndex)});const e=this.createModelUpdatedEvent();this.eventService.dispatchEvent(e)}destroyCache(){this.infiniteCache&&(this.infiniteCache=this.destroyBean(this.infiniteCache))}onCacheUpdated(){const e=this.createModelUpdatedEvent();this.eventService.dispatchEvent(e)}getRow(e){if(this.infiniteCache&&!(e>=this.infiniteCache.getRowCount()))return this.infiniteCache.getRow(e)}getRowNode(e){let t;return this.forEachNode(i=>{i.id===e&&(t=i)}),t}forEachNode(e){this.infiniteCache&&this.infiniteCache.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(0!==this.rowHeight){const t=Math.floor(e/this.rowHeight),i=this.getRowCount()-1;return t>i?i:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){this.infiniteCache&&this.infiniteCache.refreshCache()}purgeCache(){this.infiniteCache&&this.infiniteCache.purgeCache()}isLastRowIndexKnown(){return!!this.infiniteCache&&this.infiniteCache.isLastRowIndexKnown()}setRowCount(e,t){this.infiniteCache&&this.infiniteCache.setRowCount(e,t)}};su([ue("filterManager")],cu.prototype,"filterManager",2),su([ue("sortController")],cu.prototype,"sortController",2),su([ue("selectionService")],cu.prototype,"selectionService",2),su([ue("rowRenderer")],cu.prototype,"rowRenderer",2),su([ue("rowNodeBlockLoader")],cu.prototype,"rowNodeBlockLoader",2),su([le],cu.prototype,"init",1),su([ce],cu.prototype,"destroyDatasource",1);var hu={version:"31.3.4",moduleName:"@ag-grid-community/infinite-row-model",rowModel:"infinite",beans:[cu=su([he("rowModel")],cu)]},uu=Object.defineProperty,du=Object.defineProperties,pu=Object.getOwnPropertyDescriptor,gu=Object.getOwnPropertyDescriptors,fu=Object.getOwnPropertySymbols,mu=Object.prototype.hasOwnProperty,yu=Object.prototype.propertyIsEnumerable,vu=(e,t,i)=>t in e?uu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,bu=(e,t)=>{for(var i in t||(t={}))mu.call(t,i)&&vu(e,i,t[i]);if(fu)for(var i of fu(t))yu.call(t,i)&&vu(e,i,t[i]);return e},Cu=(e,t)=>du(e,gu(t)),wu=(e,t,i,n)=>{for(var s,r=n>1?void 0:n?pu(t,i):t,o=e.length-1;o>=0;o--)(s=e[o])&&(r=(n?s(t,i,r):s(r))||r);return n&&r&&uu(t,i,r),r},Su=(e,t,i)=>new Promise((n,s)=>{var r=e=>{try{a(i.next(e))}catch(e){s(e)}},o=e=>{try{a(i.throw(e))}catch(e){s(e)}},a=e=>e.done?n(e.value):Promise.resolve(e.value).then(r,o);a((i=i.apply(e,t)).next())}),xu=class{setBeans(e){this.beans=e}getFileName(e){const t=this.getDefaultFileExtension();return null!=e&&e.length||(e=this.getDefaultFileName()),-1===e.indexOf(".")?`${e}.${t}`:e}getData(e){const t=this.createSerializingSession(e);return this.beans.gridSerializer.serialize(t,e)}getDefaultFileName(){return`export.${this.getDefaultFileExtension()}`}},Eu=class{constructor(e){this.groupColumns=[];const{columnModel:t,valueService:i,gos:n,processCellCallback:s,processHeaderCallback:r,processGroupHeaderCallback:o,processRowGroupCallback:a}=e;this.columnModel=t,this.valueService=i,this.gos=n,this.processCellCallback=s,this.processHeaderCallback=r,this.processGroupHeaderCallback=o,this.processRowGroupCallback=a}prepare(e){this.groupColumns=e.filter(e=>!!e.getColDef().showRowGroup)}extractHeaderValue(e){const t=this.getHeaderName(this.processHeaderCallback,e);return null!=t?t:""}extractRowCellValue(e,t,i,n,s){const r=this.gos.get("groupHideOpenParents")&&!s.footer||!this.shouldRenderGroupSummaryCell(s,e,t)?this.valueService.getValue(e,s):this.createValueForGroupNode(e,s);return this.processCell({accumulatedRowIndex:i,rowNode:s,column:e,value:r,processCellCallback:this.processCellCallback,type:n})}shouldRenderGroupSummaryCell(e,t,i){var n;if(!e||!e.group)return!1;if(-1!==this.groupColumns.indexOf(t)){if(null!=(null==(n=e.groupData)?void 0:n[t.getId()]))return!0;if(this.gos.isRowModelType("serverSide")&&e.group)return!0;if(e.footer&&-1===e.level){const e=t.getColDef();return null==e||!0===e.showRowGroup||e.showRowGroup===this.columnModel.getRowGroupColumns()[0].getId()}}const s=this.gos.isGroupUseEntireRow(this.columnModel.isPivotMode());return 0===i&&s}getHeaderName(e,t){return e?e(this.gos.addGridCommonParams({column:t})):this.columnModel.getDisplayNameForColumn(t,"csv",!0)}createValueForGroupNode(e,t){if(this.processRowGroupCallback)return this.processRowGroupCallback(this.gos.addGridCommonParams({column:e,node:t}));const i=this.gos.get("treeData"),n=this.gos.get("suppressGroupMaintainValueType"),s=t=>{var s,r;if(i||n)return t.key;const o=null==(s=t.groupData)?void 0:s[e.getId()];return o&&t.rowGroupColumn&&!1!==t.rowGroupColumn.getColDef().useValueFormatterForExport&&null!=(r=this.valueService.formatValue(t.rowGroupColumn,t,o))?r:o},r=t.footer,o=[s(t)];if(!this.gos.isGroupMultiAutoColumn())for(;t.parent;)t=t.parent,o.push(s(t));const a=o.reverse().join(" -> ");return r?`Total ${a}`:a}processCell(e){var t;const{accumulatedRowIndex:i,rowNode:n,column:s,value:r,processCellCallback:o,type:a}=e;return o?{value:null!=(t=o(this.gos.addGridCommonParams({accumulatedRowIndex:i,column:s,node:n,value:r,type:a,parseValue:e=>this.valueService.parseValue(s,n,e,this.valueService.getValue(s,n)),formatValue:e=>{var t;return null!=(t=this.valueService.formatValue(s,n,e))?t:e}})))?t:""}:!1!==s.getColDef().useValueFormatterForExport?{value:null!=r?r:"",valueFormatted:this.valueService.formatValue(s,n,r)}:{value:null!=r?r:""}}},Au=class{static download(e,t){const i=document.defaultView||window;if(!i)return void console.warn("AG Grid: There is no `window` associated with the current `document`");const n=document.createElement("a"),s=i.URL.createObjectURL(t);n.setAttribute("href",s),n.setAttribute("download",e),n.style.display="none",document.body.appendChild(n),n.dispatchEvent(new MouseEvent("click",{bubbles:!1,cancelable:!0,view:i})),document.body.removeChild(n),i.setTimeout(()=>{i.URL.revokeObjectURL(s)},0)}},Mu=class extends Eu{constructor(e){super(e),this.isFirstLine=!0,this.result="";const{suppressQuotes:t,columnSeparator:i}=e;this.suppressQuotes=t,this.columnSeparator=i}addCustomContent(e){e&&("string"==typeof e?(/^\s*\n/.test(e)||this.beginNewLine(),e=e.replace(/\r?\n/g,"\r\n"),this.result+=e):e.forEach(e=>{this.beginNewLine(),e.forEach((e,t)=>{0!==t&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(e.data.value||""),e.mergeAcross&&this.appendEmptyCells(e.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,i,n){0!=i&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(n)}appendEmptyCells(e){for(let t=1;t<=e;t++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(e,t){0!=t&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(e))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(e,t,i){var n;0!=t&&(this.result+=this.columnSeparator);const s=this.extractRowCellValue(e,t,t,"csv",i);this.result+=this.putInQuotes(null!=(n=s.valueFormatted)?n:s.value)}putInQuotes(e){if(this.suppressQuotes)return e;if(null==e)return'""';let t;return"string"==typeof e?t=e:"function"==typeof e.toString?t=e.toString():(console.warn("AG Grid: unknown value type during csv conversion"),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+="\r\n"),this.isFirstLine=!1}},Tu=class extends xu{postConstruct(){this.setBeans({gridSerializer:this.gridSerializer,gos:this.gos})}getMergedParams(e){const t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed())return void console.warn("AG Grid: Export cancelled. Export is not allowed as per your configuration.");const t=this.getMergedParams(e),i=this.getData(t),n=new Blob(["\ufeff",i],{type:"text/plain"}),s="function"==typeof t.fileName?t.fileName(this.gos.getGridCommonParams()):t.fileName;Au.download(this.getFileName(s),n)}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const i=t?Object.assign({},e):this.getMergedParams(e);return this.getData(i)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{columnModel:t,valueService:i,gos:n}=this,{processCellCallback:s,processHeaderCallback:r,processGroupHeaderCallback:o,processRowGroupCallback:a,suppressQuotes:l,columnSeparator:c}=e;return new Mu({columnModel:t,valueService:i,gos:n,processCellCallback:s||void 0,processHeaderCallback:r||void 0,processGroupHeaderCallback:o||void 0,processRowGroupCallback:a||void 0,suppressQuotes:l||!1,columnSeparator:c||","})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};wu([ue("columnModel")],Tu.prototype,"columnModel",2),wu([ue("valueService")],Tu.prototype,"valueService",2),wu([ue("gridSerializer")],Tu.prototype,"gridSerializer",2),wu([ue("gridOptionsService")],Tu.prototype,"gos",2),wu([le],Tu.prototype,"postConstruct",1),Tu=wu([he("csvCreator")],Tu);var Du=(e=>(e[e.HEADER_GROUPING=0]="HEADER_GROUPING",e[e.HEADER=1]="HEADER",e[e.BODY=2]="BODY",e))(Du||{}),Iu=class extends st{serialize(e,t={}){const{allColumns:i,columnKeys:n,skipRowGroups:s}=t,r=this.getColumnsToExport(i,s,n);return cs.compose(this.prepareSession(r),this.prependContent(t),this.exportColumnGroups(t,r),this.exportHeaders(t,r),this.processPinnedTopRows(t,r),this.processRows(t,r),this.processPinnedBottomRows(t,r),this.appendContent(t))(e).parse()}processRow(e,t,i,n){const s=t.shouldRowBeSkipped||(()=>!1),r=this.gos.get("groupRemoveSingleChildren"),o=this.gos.get("groupRemoveLowestSingleChildren"),a=null!=t.rowPositions||!!t.onlySelected,l=this.gos.get("groupHideOpenParents")&&!a,c=this.columnModel.isPivotMode()?n.leafGroup:!n.group,h=!!n.footer,u=(t.skipRowGroups,o&&n.leafGroup),d=1===n.allChildrenCount&&(r||u);if(!c&&!h&&(t.skipRowGroups||d||l)||t.onlySelected&&!n.isSelected()||t.skipPinnedTop&&"top"===n.rowPinned||t.skipPinnedBottom&&"bottom"===n.rowPinned)return;if(-1===n.level&&!c&&!h)return;if(s(this.gos.addGridCommonParams({node:n})))return;const p=e.onNewBodyRow(n);if(i.forEach((e,t)=>{p.onColumn(e,t,n)}),t.getCustomContentBelowRow){const i=t.getCustomContentBelowRow(this.gos.addGridCommonParams({node:n}));i&&e.addCustomContent(i)}}appendContent(e){return t=>{const i=e.appendContent;return i&&t.addCustomContent(i),t}}prependContent(e){return t=>{const i=e.prependContent;return i&&t.addCustomContent(i),t}}prepareSession(e){return t=>(t.prepare(e),t)}exportColumnGroups(e,t){return i=>{if(!e.skipColumnGroupHeaders){const n=new ut,s=this.displayedGroupCreator.createDisplayedGroups(t,n,null);this.recursivelyAddHeaderGroups(s,i,e.processGroupHeaderCallback)}return i}}exportHeaders(e,t){return i=>{if(!e.skipColumnHeaders){const e=i.onNewHeaderRow();t.forEach((t,i)=>{e.onColumn(t,i,void 0)})}return i}}processPinnedTopRows(e,t){return i=>{const n=this.processRow.bind(this,i,e,t);return e.rowPositions?e.rowPositions.filter(e=>"top"===e.rowPinned).sort((e,t)=>e.rowIndex-t.rowIndex).map(e=>this.pinnedRowModel.getPinnedTopRow(e.rowIndex)).forEach(n):this.pinnedRowModel.forEachPinnedTopRow(n),i}}processRows(e,t){return i=>{const n=this.rowModel,s=n.getType(),r="clientSide"===s,o="serverSide"===s,a=!r&&e.onlySelected,l=this.processRow.bind(this,i,e,t),{exportedRows:c="filteredAndSorted"}=e;if(e.rowPositions)e.rowPositions.filter(e=>null==e.rowPinned).sort((e,t)=>e.rowIndex-t.rowIndex).map(e=>n.getRow(e.rowIndex)).forEach(l);else if(this.columnModel.isPivotMode())r?n.forEachPivotNode(l,!0):o?n.forEachNodeAfterFilterAndSort(l,!0):n.forEachNode(l);else if(e.onlySelectedAllPages||a){const e=this.selectionService.getSelectedNodes();this.replicateSortedOrder(e),e.forEach(l)}else"all"===c?n.forEachNode(l):r||o?n.forEachNodeAfterFilterAndSort(l,!0):n.forEachNode(l);return i}}replicateSortedOrder(e){const t=this.sortController.getSortOptions(),i=(e,n)=>{var s,r,o,a;return null!=e.rowIndex&&null!=n.rowIndex?e.rowIndex-n.rowIndex:e.level===n.level?(null==(s=e.parent)?void 0:s.id)===(null==(r=n.parent)?void 0:r.id)?this.rowNodeSorter.compareRowNodes(t,{rowNode:e,currentPos:null!=(o=e.rowIndex)?o:-1},{rowNode:n,currentPos:null!=(a=n.rowIndex)?a:-1}):i(e.parent,n.parent):e.level>n.level?i(e.parent,n):i(e,n.parent)};e.sort(i)}processPinnedBottomRows(e,t){return i=>{const n=this.processRow.bind(this,i,e,t);return e.rowPositions?e.rowPositions.filter(e=>"bottom"===e.rowPinned).sort((e,t)=>e.rowIndex-t.rowIndex).map(e=>this.pinnedRowModel.getPinnedBottomRow(e.rowIndex)).forEach(n):this.pinnedRowModel.forEachPinnedBottomRow(n),i}}getColumnsToExport(e=!1,t=!1,i){const n=this.columnModel.isPivotMode();if(i&&i.length)return this.columnModel.getGridColumns(i);const s=this.gos.get("treeData");let r=[];return r=e&&!n?this.columnModel.getAllGridColumns():this.columnModel.getAllDisplayedColumns(),t&&!s&&(r=r.filter(e=>e.getColId()!==dt)),r}recursivelyAddHeaderGroups(e,t,i){const n=[];e.forEach(e=>{const t=e;t.getChildren&&t.getChildren().forEach(e=>n.push(e))}),e.length>0&&e[0]instanceof lt&&this.doAddHeaderHeader(t,e,i),n&&n.length>0&&this.recursivelyAddHeaderGroups(n,t,i)}doAddHeaderHeader(e,t,i){const n=e.onNewHeaderGroupingRow();let s=0;t.forEach(e=>{const t=e;let r;r=i?i(this.gos.addGridCommonParams({columnGroup:t})):this.columnModel.getDisplayNameForColumnGroup(t,"header");const o=t.getLeafColumns().reduce((e,t,i,n)=>{let s=cs.last(e);return"open"===t.getColumnGroupShow()?s&&null==s[1]||(s=[i],e.push(s)):s&&null==s[1]&&(s[1]=i-1),i===n.length-1&&s&&null==s[1]&&(s[1]=i),e},[]);n.onColumn(t,r||"",s++,t.getLeafColumns().length-1,o)})}};wu([ue("displayedGroupCreator")],Iu.prototype,"displayedGroupCreator",2),wu([ue("columnModel")],Iu.prototype,"columnModel",2),wu([ue("rowModel")],Iu.prototype,"rowModel",2),wu([ue("pinnedRowModel")],Iu.prototype,"pinnedRowModel",2),wu([ue("selectionService")],Iu.prototype,"selectionService",2),wu([ue("rowNodeSorter")],Iu.prototype,"rowNodeSorter",2),wu([ue("sortController")],Iu.prototype,"sortController",2),Iu=wu([he("gridSerializer")],Iu);var Ru={version:"31.3.4",moduleName:"@ag-grid-community/csv-export",beans:[Tu,Iu]},ku="\r\n",Pu=class{static createHeader(e={}){const t=["version"];return e.version||(e.version="1.0"),e.encoding&&t.push("encoding"),e.standalone&&t.push("standalone"),`<?xml ${t.map(t=>`${t}="${e[t]}"`).join(" ")} ?>`}static createXml(e,t){let i="";e.properties&&(e.properties.prefixedAttributes&&e.properties.prefixedAttributes.forEach(e=>{Object.keys(e.map).forEach(n=>{i+=this.returnAttributeIfPopulated(e.prefix+n,e.map[n],t)})}),e.properties.rawMap&&Object.keys(e.properties.rawMap).forEach(n=>{i+=this.returnAttributeIfPopulated(n,e.properties.rawMap[n],t)}));let n="<"+e.name+i;return e.children||null!=e.textNode?null!=e.textNode?n+">"+e.textNode+"</"+e.name+">"+ku:(n+=">\r\n",e.children&&e.children.forEach(e=>{n+=this.createXml(e,t)}),n+"</"+e.name+">"+ku):n+"/>"+ku}static returnAttributeIfPopulated(e,t,i){if(!t&&""!==t&&0!==t)return"";let n=t;return"boolean"==typeof t&&i&&(n=i(t)),` ${e}="${n}"`}};function _u(e,t){let i="";for(let n=0;n<t;n++)i+=String.fromCharCode(255&e),e>>>=8;return i}var Lu=e=>e.length?(e=>{if(!e.length)return 0;let t=-1,i=0,n=0,s=0;for(let r=0;r<e.length;r++)i=e[r],n=255&(t^i),s=Nu[n],t=t>>>8^s;return-1^t})("string"==typeof e?(new TextEncoder).encode(e):e):0,Nu=new Uint32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]),{utf8_encode:Ou}=cs,Fu=(e,t)=>Su(void 0,null,function*(){const{content:i}=e,{size:n,content:s}=i?Vu(i):{size:0,content:Uint8Array.from([])};let r,o,a=!1;if("file"===e.type&&s&&n>0){const e=yield(e=>Su(void 0,null,function*(){const t=new Blob([e]),{size:i,content:n}=yield(s=t,Su(void 0,null,function*(){let e=0;const t=[],i=new WritableStream({write:i=>{t.push(i),e+=i.length}}),n=new ReadableStream({start:e=>{const t=new FileReader;t.onload=t=>{var i;(null==(i=t.target)?void 0:i.result)&&e.enqueue(t.target.result),e.close()},t.readAsArrayBuffer(s)}}),r=new window.CompressionStream("deflate-raw");return yield n.pipeThrough(r).pipeTo(i),{size:e,content:new Blob(t)}}));var s;return{size:i,content:new Uint8Array(yield n.arrayBuffer())}}))(s);r=e.content,o=e.size,a=!0}const l=Bu(e,a,t,n,s,o);return Cu(bu({},l),{content:r||s,isCompressed:a})}),Gu=(e,t)=>{const{content:i}=e,{content:n}=i?Vu(i):{content:Uint8Array.from([])},s=Bu(e,!1,t,n.length,n,void 0);return Cu(bu({},s),{content:n,isCompressed:!1})},Bu=(e,t,i,n,s,r)=>{const{content:o,path:a,created:l}=e,c=(e=>{let t=e.getHours();return t<<=6,t|=e.getMinutes(),t<<=5,t|=e.getSeconds()/2,t})(l),h=(e=>{let t=e.getFullYear()-1980;return t<<=4,t|=e.getMonth()+1,t<<=5,t|=e.getDate(),t})(l),u=Lu(s),d=void 0!==r?r:n,p=Ou(a),g=p!==a;let f="";if(g){const e=_u(1,1)+_u(Lu(p),4)+p;f="up"+_u(e.length,2)+e}const m="\0"+(g?"\0\b":"\0\0")+_u(t?8:0,2)+_u(c,2)+_u(h,2)+_u(d?u:0,4)+_u(null!=r?r:n,4)+_u(n,4)+_u(p.length,2)+_u(f.length,2),y="PK"+m+p+f,v="PK\0"+m+"\0\0\0\0\0\0"+(o?"\0\0\0\0":"\0\0\0")+_u(i,4)+p+f;return{localFileHeader:Uint8Array.from(y,e=>e.charCodeAt(0)),centralDirectoryHeader:Uint8Array.from(v,e=>e.charCodeAt(0))}},Vu=e=>{let t;return t="string"==typeof e?(e=>{const t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t})(atob(e.split(";base64,")[1])):e,{size:t.length,content:t}},Hu=class{static addFolders(e){e.forEach(this.addFolder.bind(this))}static addFolder(e){this.folders.push({path:e,created:new Date,isBase64:!1,type:"folder"})}static addFile(e,t,i=!1){this.files.push({path:e,created:new Date,content:i?t:(new TextEncoder).encode(t),isBase64:i,type:"file"})}static getZipFile(e="application/zip"){return Su(this,null,function*(){const t=yield this.buildCompressedFileStream();return this.clearStream(),new Blob([t],{type:e})})}static getUncompressedZipFile(e="application/zip"){const t=this.buildFileStream();return this.clearStream(),new Blob([t],{type:e})}static clearStream(){this.folders=[],this.files=[]}static packageFiles(e){let t=new Uint8Array(0),i=new Uint8Array(0),n=0,s=0;for(const r of e){const{localFileHeader:e,centralDirectoryHeader:o,content:a}=r,l=new Uint8Array(t.length+e.length);l.set(t),l.set(e,t.length),t=l;const c=new Uint8Array(t.length+a.length);c.set(t),c.set(a,t.length),t=c;const h=new Uint8Array(i.length+o.length);h.set(i),h.set(o,i.length),i=h,n+=e.length+a.length,s+=o.length}const r=((e,t,i)=>{const n="PK\0\0\0\0"+_u(e,2)+_u(e,2)+_u(t,4)+_u(i,4)+"\0\0";return Uint8Array.from(n,e=>e.charCodeAt(0))})(e.length,s,n),o=new Uint8Array(t.length+i.length+r.length);return o.set(t),o.set(i,t.length),o.set(r,t.length+i.length),o}static buildCompressedFileStream(){return Su(this,null,function*(){const e=[...this.folders,...this.files],t=[];let i=0;for(const n of e){const e=yield Fu(n,i),{localFileHeader:s,content:r}=e;t.push(e),i+=s.length+r.length}return this.packageFiles(t)})}static buildFileStream(){const e=[...this.folders,...this.files],t=[];let i=0;for(const n of e){const e=Gu(n,i),{localFileHeader:s,content:r}=e;t.push(e),i+=s.length+r.length}return this.packageFiles(t)}};Hu.folders=[],Hu.files=[],re.__registerModules([tu,hu,Ru],!1,void 0)},67748(e,t,i){var n,s=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l=(e,t)=>{for(var i in t)s(e,i,{get:t[i],enumerable:!0})},c=(e,t,i,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===i||s(e,l,{get:()=>t[l],enumerable:!(n=r(t,l))||n.enumerable});return e},h=(e,t,i)=>(c(e,t,"default"),i&&c(i,t,"default")),u=(e,t,i,n)=>{for(var o,a=n>1?void 0:n?r(t,i):t,l=e.length-1;l>=0;l--)(o=e[l])&&(a=(n?o(t,i,a):o(a))||a);return n&&a&&s(t,i,a),a},d={};l(d,{ALWAYS_SYNC_GLOBAL_EVENTS:()=>qy.ALWAYS_SYNC_GLOBAL_EVENTS,AbstractHeaderCellCtrl:()=>Xy.AbstractHeaderCellCtrl,AdvancedFilterModule:()=>Fe,AgAbstractField:()=>Zy.AgAbstractField,AgAbstractLabel:()=>Qy.AgAbstractLabel,AgAutocomplete:()=>Jy.AgAutocomplete,AgCheckbox:()=>ev.AgCheckbox,AgDialog:()=>tv.AgDialog,AgGroupComponent:()=>iv.AgGroupComponent,AgInputDateField:()=>nv.AgInputDateField,AgInputNumberField:()=>sv.AgInputNumberField,AgInputRange:()=>rv.AgInputRange,AgInputTextArea:()=>ov.AgInputTextArea,AgInputTextField:()=>av.AgInputTextField,AgMenuItemComponent:()=>lv.AgMenuItemComponent,AgMenuItemRenderer:()=>cv.AgMenuItemRenderer,AgMenuList:()=>hv.AgMenuList,AgMenuPanel:()=>uv.AgMenuPanel,AgPanel:()=>dv.AgPanel,AgPickerField:()=>pv.AgPickerField,AgPromise:()=>gv.AgPromise,AgPromiseStatus:()=>fv.AgPromiseStatus,AgRadioButton:()=>mv.AgRadioButton,AgRichSelect:()=>yv.AgRichSelect,AgSelect:()=>vv.AgSelect,AgSlider:()=>bv.AgSlider,AgStackComponentsRegistry:()=>Cv.AgStackComponentsRegistry,AgToggleButton:()=>wv.AgToggleButton,AlignedGridsService:()=>Sv.AlignedGridsService,AnimateShowChangeCellRenderer:()=>xv.AnimateShowChangeCellRenderer,AnimateSlideCellRenderer:()=>Ev.AnimateSlideCellRenderer,AnimationFrameService:()=>Av.AnimationFrameService,AutoScrollService:()=>Mv.AutoScrollService,AutoWidthCalculator:()=>Tv.AutoWidthCalculator,Autowired:()=>Dv.Autowired,BarColumnLabelPlacement:()=>Iv.BarColumnLabelPlacement,BaseComponentWrapper:()=>Rv.BaseComponentWrapper,Bean:()=>kv.Bean,BeanStub:()=>Pv.BeanStub,Beans:()=>_v.Beans,BodyDropPivotTarget:()=>Lv.BodyDropPivotTarget,BodyDropTarget:()=>Nv.BodyDropTarget,CellComp:()=>Ov.CellComp,CellCtrl:()=>Fv.CellCtrl,CellNavigationService:()=>Gv.CellNavigationService,CellPositionUtils:()=>Bv.CellPositionUtils,CellRangeType:()=>Vv.CellRangeType,ChangedPath:()=>Hv.ChangedPath,ChartMappings:()=>Uv.ChartMappings,CheckboxCellEditor:()=>zv.CheckboxCellEditor,CheckboxCellRenderer:()=>Wv.CheckboxCellRenderer,CheckboxSelectionComponent:()=>jv.CheckboxSelectionComponent,ClientSideRowModelSteps:()=>$v.ClientSideRowModelSteps,ClipboardModule:()=>pl,Column:()=>Kv.Column,ColumnApi:()=>Yv.ColumnApi,ColumnFactory:()=>qv.ColumnFactory,ColumnGroup:()=>Xv.ColumnGroup,ColumnKeyCreator:()=>Zv.ColumnKeyCreator,ColumnModel:()=>Qv.ColumnModel,ColumnsToolPanelModule:()=>Nh,Component:()=>Jv.Component,ComponentUtil:()=>eb.ComponentUtil,Context:()=>tb.Context,CssClassApplier:()=>ib.CssClassApplier,CssClassManager:()=>nb.CssClassManager,CtrlsService:()=>sb.CtrlsService,DataTypeService:()=>rb.DataTypeService,DateCellEditor:()=>ob.DateCellEditor,DateFilter:()=>ab.DateFilter,DateStringCellEditor:()=>lb.DateStringCellEditor,DisplayedGroupCreator:()=>cb.DisplayedGroupCreator,DragAndDropService:()=>hb.DragAndDropService,DragService:()=>ub.DragService,DragSourceType:()=>db.DragSourceType,EnterpriseCoreModule:()=>D,Environment:()=>pb.Environment,EventService:()=>gb.EventService,Events:()=>fb.Events,ExcelExportModule:()=>jd,ExcelFactoryMode:()=>mb.ExcelFactoryMode,ExpansionService:()=>yb.ExpansionService,ExpressionService:()=>vb.ExpressionService,FilterManager:()=>bb.FilterManager,FilterWrapperComp:()=>Cb.FilterWrapperComp,FiltersToolPanelModule:()=>fp,FloatingFilterMapper:()=>wb.FloatingFilterMapper,FocusService:()=>Sb.FocusService,GROUP_AUTO_COLUMN_ID:()=>xb.GROUP_AUTO_COLUMN_ID,Grid:()=>Eb.Grid,GridApi:()=>Ab.GridApi,GridBodyComp:()=>Mb.GridBodyComp,GridBodyCtrl:()=>Tb.GridBodyCtrl,GridChartsModule:()=>Ja,GridComp:()=>Db.GridComp,GridCoreCreator:()=>Ib.GridCoreCreator,GridCtrl:()=>Rb.GridCtrl,GridHeaderComp:()=>kb.GridHeaderComp,GridHeaderCtrl:()=>Pb.GridHeaderCtrl,GridOptionsService:()=>_b.GridOptionsService,GroupCellRenderer:()=>Lb.GroupCellRenderer,GroupCellRendererCtrl:()=>Nb.GroupCellRendererCtrl,GroupInstanceIdCreator:()=>Ob.GroupInstanceIdCreator,HeaderCellCtrl:()=>Fb.HeaderCellCtrl,HeaderFilterCellComp:()=>Gb.HeaderFilterCellComp,HeaderFilterCellCtrl:()=>Bb.HeaderFilterCellCtrl,HeaderGroupCellCtrl:()=>Vb.HeaderGroupCellCtrl,HeaderNavigationDirection:()=>Hb.HeaderNavigationDirection,HeaderNavigationService:()=>Ub.HeaderNavigationService,HeaderPositionUtils:()=>zb.HeaderPositionUtils,HeaderRowComp:()=>Wb.HeaderRowComp,HeaderRowContainerComp:()=>jb.HeaderRowContainerComp,HeaderRowContainerCtrl:()=>$b.HeaderRowContainerCtrl,HeaderRowCtrl:()=>Kb.HeaderRowCtrl,HeaderRowType:()=>Yb.HeaderRowType,HorizontalDirection:()=>qb.HorizontalDirection,HorizontalResizeService:()=>Xb.HorizontalResizeService,KeyCode:()=>Zb.KeyCode,LargeTextCellEditor:()=>Qb.LargeTextCellEditor,LayoutCssClasses:()=>Jb.LayoutCssClasses,LicenseManager:()=>A,LocaleService:()=>eC.LocaleService,Logger:()=>tC.Logger,LoggerFactory:()=>iC.LoggerFactory,ManagedFocusFeature:()=>nC.ManagedFocusFeature,MasterDetailModule:()=>Ip,MenuModule:()=>cg,MenuService:()=>sC.MenuService,ModuleNames:()=>rC.ModuleNames,ModuleRegistry:()=>oC.ModuleRegistry,MouseEventService:()=>aC.MouseEventService,MoveColumnFeature:()=>lC.MoveColumnFeature,MultiFilter:()=>Ag,MultiFilterModule:()=>Tg,NavigationService:()=>cC.NavigationService,NumberCellEditor:()=>hC.NumberCellEditor,NumberFilter:()=>uC.NumberFilter,NumberSequence:()=>dC.NumberSequence,Optional:()=>pC.Optional,PaginationProxy:()=>gC.PaginationProxy,PillDragComp:()=>fC.PillDragComp,PillDropZonePanel:()=>mC.PillDropZonePanel,PinnedRowModel:()=>yC.PinnedRowModel,PivotDropZonePanel:()=>dc,PopupComponent:()=>vC.PopupComponent,PopupEditorWrapper:()=>bC.PopupEditorWrapper,PopupService:()=>CC.PopupService,PositionableFeature:()=>wC.PositionableFeature,PostConstruct:()=>SC.PostConstruct,PreConstruct:()=>xC.PreConstruct,PreDestroy:()=>EC.PreDestroy,PrimaryColsPanel:()=>Sh,PropertyKeys:()=>AC.PropertyKeys,ProvidedColumnGroup:()=>MC.ProvidedColumnGroup,ProvidedFilter:()=>TC.ProvidedFilter,Qualifier:()=>DC.Qualifier,QuerySelector:()=>IC.QuerySelector,RangeSelectionModule:()=>ut,RefSelector:()=>RC.RefSelector,ResizeObserverService:()=>kC.ResizeObserverService,RichSelectModule:()=>kg,RowAnimationCssClasses:()=>PC.RowAnimationCssClasses,RowContainerComp:()=>_C.RowContainerComp,RowContainerCtrl:()=>LC.RowContainerCtrl,RowContainerName:()=>NC.RowContainerName,RowContainerType:()=>OC.RowContainerType,RowCtrl:()=>FC.RowCtrl,RowGroupDropZonePanel:()=>uc,RowGroupingModule:()=>vc,RowHighlightPosition:()=>GC.RowHighlightPosition,RowNode:()=>BC.RowNode,RowNodeBlock:()=>VC.RowNodeBlock,RowNodeBlockLoader:()=>HC.RowNodeBlockLoader,RowNodeSorter:()=>UC.RowNodeSorter,RowPositionUtils:()=>zC.RowPositionUtils,RowRenderer:()=>WC.RowRenderer,ScalarFilter:()=>jC.ScalarFilter,ScrollVisibleService:()=>$C.ScrollVisibleService,SelectCellEditor:()=>KC.SelectCellEditor,SelectableService:()=>YC.SelectableService,SelectionHandleType:()=>qC.SelectionHandleType,ServerSideRowModelModule:()=>Df,ServerSideTransactionResultStatus:()=>XC.ServerSideTransactionResultStatus,SetFilter:()=>Zf,SetFilterModule:()=>im,SetLeftFeature:()=>ZC.SetLeftFeature,SideBarModule:()=>Zc,SimpleFilter:()=>QC.SimpleFilter,SortController:()=>JC.SortController,SortIndicatorComp:()=>ew.SortIndicatorComp,SparklinesModule:()=>Cy,StandardMenuFactory:()=>tw.StandardMenuFactory,StatusBarModule:()=>Hy,StylingService:()=>iw.StylingService,TabGuardClassNames:()=>nw.TabGuardClassNames,TabGuardComp:()=>sw.TabGuardComp,TabGuardCtrl:()=>rw.TabGuardCtrl,TabbedLayout:()=>ow.TabbedLayout,TextCellEditor:()=>aw.TextCellEditor,TextFilter:()=>lw.TextFilter,TextFloatingFilter:()=>cw.TextFloatingFilter,Timer:()=>hw.Timer,ToolPanelColDefService:()=>qc,TooltipFeature:()=>uw.TooltipFeature,TooltipStateManager:()=>dw.TooltipStateManager,TouchListener:()=>pw.TouchListener,UserComponentFactory:()=>gw.UserComponentFactory,UserComponentRegistry:()=>fw.UserComponentRegistry,ValueCache:()=>mw.ValueCache,ValueService:()=>yw.ValueService,ValuesDropZonePanel:()=>bc,VanillaFrameworkOverrides:()=>vw.VanillaFrameworkOverrides,VerticalDirection:()=>bw.VerticalDirection,ViewportRowModelModule:()=>Yy,VirtualList:()=>Cw.VirtualList,VirtualListDragFeature:()=>ww.VirtualListDragFeature,_:()=>Sw._,__FORCE_MODULE_DETECTION_AG_GRID_CORE_EXT:()=>el,agCharts:()=>tl,createGrid:()=>xw.createGrid,exportMultipleSheetsAsExcel:()=>zd,getMultipleSheetsAsExcel:()=>Ud,getRowContainerTypeForName:()=>Ew.getRowContainerTypeForName,provideGlobalGridOptions:()=>Aw.provideGlobalGridOptions}),e.exports=(n=d,c(s({},"__esModule",{value:!0}),n));var p=i(98092),g=i(98092),f=i(98092),m=i(98092),y=i(98092),v=i(98092),b=i(98092),C=class{constructor(){this.ieCompatibility=!1}init(){this.ieCompatibility="5d41402abc4b2a76b9719d911017c592"!=this.md5("hello")}md5cycle(e,t){let i=e[0],n=e[1],s=e[2],r=e[3];i=this.ff(i,n,s,r,t[0],7,-680876936),r=this.ff(r,i,n,s,t[1],12,-389564586),s=this.ff(s,r,i,n,t[2],17,606105819),n=this.ff(n,s,r,i,t[3],22,-1044525330),i=this.ff(i,n,s,r,t[4],7,-176418897),r=this.ff(r,i,n,s,t[5],12,1200080426),s=this.ff(s,r,i,n,t[6],17,-1473231341),n=this.ff(n,s,r,i,t[7],22,-45705983),i=this.ff(i,n,s,r,t[8],7,1770035416),r=this.ff(r,i,n,s,t[9],12,-1958414417),s=this.ff(s,r,i,n,t[10],17,-42063),n=this.ff(n,s,r,i,t[11],22,-1990404162),i=this.ff(i,n,s,r,t[12],7,1804603682),r=this.ff(r,i,n,s,t[13],12,-40341101),s=this.ff(s,r,i,n,t[14],17,-1502002290),n=this.ff(n,s,r,i,t[15],22,1236535329),i=this.gg(i,n,s,r,t[1],5,-165796510),r=this.gg(r,i,n,s,t[6],9,-1069501632),s=this.gg(s,r,i,n,t[11],14,643717713),n=this.gg(n,s,r,i,t[0],20,-373897302),i=this.gg(i,n,s,r,t[5],5,-701558691),r=this.gg(r,i,n,s,t[10],9,38016083),s=this.gg(s,r,i,n,t[15],14,-660478335),n=this.gg(n,s,r,i,t[4],20,-405537848),i=this.gg(i,n,s,r,t[9],5,568446438),r=this.gg(r,i,n,s,t[14],9,-1019803690),s=this.gg(s,r,i,n,t[3],14,-187363961),n=this.gg(n,s,r,i,t[8],20,1163531501),i=this.gg(i,n,s,r,t[13],5,-1444681467),r=this.gg(r,i,n,s,t[2],9,-51403784),s=this.gg(s,r,i,n,t[7],14,1735328473),n=this.gg(n,s,r,i,t[12],20,-1926607734),i=this.hh(i,n,s,r,t[5],4,-378558),r=this.hh(r,i,n,s,t[8],11,-2022574463),s=this.hh(s,r,i,n,t[11],16,1839030562),n=this.hh(n,s,r,i,t[14],23,-35309556),i=this.hh(i,n,s,r,t[1],4,-1530992060),r=this.hh(r,i,n,s,t[4],11,1272893353),s=this.hh(s,r,i,n,t[7],16,-155497632),n=this.hh(n,s,r,i,t[10],23,-1094730640),i=this.hh(i,n,s,r,t[13],4,681279174),r=this.hh(r,i,n,s,t[0],11,-358537222),s=this.hh(s,r,i,n,t[3],16,-722521979),n=this.hh(n,s,r,i,t[6],23,76029189),i=this.hh(i,n,s,r,t[9],4,-640364487),r=this.hh(r,i,n,s,t[12],11,-421815835),s=this.hh(s,r,i,n,t[15],16,530742520),n=this.hh(n,s,r,i,t[2],23,-995338651),i=this.ii(i,n,s,r,t[0],6,-198630844),r=this.ii(r,i,n,s,t[7],10,1126891415),s=this.ii(s,r,i,n,t[14],15,-1416354905),n=this.ii(n,s,r,i,t[5],21,-57434055),i=this.ii(i,n,s,r,t[12],6,1700485571),r=this.ii(r,i,n,s,t[3],10,-1894986606),s=this.ii(s,r,i,n,t[10],15,-1051523),n=this.ii(n,s,r,i,t[1],21,-2054922799),i=this.ii(i,n,s,r,t[8],6,1873313359),r=this.ii(r,i,n,s,t[15],10,-30611744),s=this.ii(s,r,i,n,t[6],15,-1560198380),n=this.ii(n,s,r,i,t[13],21,1309151649),i=this.ii(i,n,s,r,t[4],6,-145523070),r=this.ii(r,i,n,s,t[11],10,-1120210379),s=this.ii(s,r,i,n,t[2],15,718787259),n=this.ii(n,s,r,i,t[9],21,-343485551),e[0]=this.add32(i,e[0]),e[1]=this.add32(n,e[1]),e[2]=this.add32(s,e[2]),e[3]=this.add32(r,e[3])}cmn(e,t,i,n,s,r){return t=this.add32(this.add32(t,e),this.add32(n,r)),this.add32(t<<s|t>>>32-s,i)}ff(e,t,i,n,s,r,o){return this.cmn(t&i|~t&n,e,t,s,r,o)}gg(e,t,i,n,s,r,o){return this.cmn(t&n|i&~n,e,t,s,r,o)}hh(e,t,i,n,s,r,o){return this.cmn(t^i^n,e,t,s,r,o)}ii(e,t,i,n,s,r,o){return this.cmn(i^(t|~n),e,t,s,r,o)}md51(e){const t=e.length,i=[1732584193,-271733879,-1732584194,271733878];let n;for(n=64;n<=e.length;n+=64)this.md5cycle(i,this.md5blk(e.substring(n-64,n)));e=e.substring(n-64);const s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(n=0;n<e.length;n++)s[n>>2]|=e.charCodeAt(n)<<(n%4<<3);if(s[n>>2]|=128<<(n%4<<3),n>55)for(this.md5cycle(i,s),n=0;n<16;n++)s[n]=0;return s[14]=8*t,this.md5cycle(i,s),i}md5blk(e){const t=[];for(let i=0;i<64;i+=4)t[i>>2]=e.charCodeAt(i)+(e.charCodeAt(i+1)<<8)+(e.charCodeAt(i+2)<<16)+(e.charCodeAt(i+3)<<24);return t}rhex(e){const t="0123456789abcdef".split("");let i="",n=0;for(;n<4;n++)i+=t[e>>8*n+4&15]+t[e>>8*n&15];return i}hex(e){for(let t=0;t<e.length;t++)e[t]=this.rhex(e[t]);return e.join("")}md5(e){return this.hex(this.md51(e))}add32(e,t){return this.ieCompatibility?this.add32Compat(e,t):this.add32Std(e,t)}add32Std(e,t){return e+t&4294967295}add32Compat(e,t){const i=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(i>>16)<<16|65535&i}};function w(e){return null==e||0===e.length}var S={"01":"GRID","02":"CHARTS","0102":"BOTH"},x=class e{constructor(e){this.watermarkMessage=void 0,this.totalMessageLength=124,this.document=e,this.md5=new C,this.md5.init()}validateLicense(){const t=this.getLicenseDetails(e.licenseKey),i=`AG Grid ${"BOTH"===t.currentLicenseType?"and AG Charts ":""}Enterprise`,n=void 0===t.suppliedLicenseType?"":`AG ${"BOTH"===t.suppliedLicenseType?"Grid and AG Charts":"GRID"===t.suppliedLicenseType?"Grid":"Charts"} Enterprise`;if(t.missing)this.isWebsiteUrl()&&!this.isForceWatermark()||this.outputMissingLicenseKey(i);else if(t.expired){const s=e.getGridReleaseDate(),r=e.formatDate(s);this.outputExpiredKey(t.expiry,r,i,n)}else t.valid?t.isTrial&&t.trialExpired&&this.outputExpiredTrialKey(t.expiry,i,n):this.outputInvalidLicenseKey(!!t.incorrectLicenseType,i,n)}static extractExpiry(t){const i=t.substring(t.lastIndexOf("_")+1,t.length);return new Date(parseInt(e.decode(i),10))}static extractLicenseComponents(t){let i=t.replace(/[\u200B-\u200D\uFEFF]/g,"");if(i=i.replace(/\r?\n|\r/g,""),t.length<=32)return{md5:null,license:t,version:null,isTrial:null};const n=i.length-32,s=i.substring(n),r=i.substring(0,n),[o,a,l]=e.extractBracketedInformation(i);return{md5:s,license:r,version:o,isTrial:a,type:l}}getLicenseDetails(t){const i=e.chartsLicenseManager?"BOTH":"GRID";if(w(t))return{licenseKey:t,valid:!1,missing:!0,currentLicenseType:i};const n=e.getGridReleaseDate(),{md5:s,license:r,version:o,isTrial:a,type:l}=e.extractLicenseComponents(t);let c,h,u,d=s===this.md5.md5(r)&&-1===t.indexOf("For_Trialing_ag-Grid_Only"),p=null,g=!1;function f(){c=p<new Date,h=void 0}if(d&&(p=e.extractExpiry(r),d=!isNaN(p.getTime()),d))switch(h=n>p,o){case"legacy":case"2":a&&f();break;case"3":w(l)?d=!1:(u=l,l!==S["01"]&&l!==S["0102"]||"BOTH"===i&&"BOTH"!==u?(d=!1,g=!0):a&&f())}return d?{licenseKey:t,valid:d,expiry:e.formatDate(p),expired:h,version:o,isTrial:a,trialExpired:c,incorrectLicenseType:g,currentLicenseType:i,suppliedLicenseType:u}:{licenseKey:t,valid:d,incorrectLicenseType:g,currentLicenseType:i,suppliedLicenseType:u}}isDisplayWatermark(){return this.isForceWatermark()||!this.isLocalhost()&&!this.isWebsiteUrl()&&!w(this.watermarkMessage)}getWatermarkMessage(){return this.watermarkMessage||""}getHostname(){const e=(this.document.defaultView||window).location,{hostname:t=""}=e;return t}isForceWatermark(){const e=(this.document.defaultView||window).location,{pathname:t}=e;return!!t&&-1!==t.indexOf("forceWatermark")}isWebsiteUrl(){return null!==this.getHostname().match(/^((?:[\w-]+\.)?ag-grid\.com)$/)}isLocalhost(){return null!==this.getHostname().match(/^(?:127\.0\.0\.1|localhost)$/)}static formatDate(e){const t=e.getDate(),i=e.getMonth(),n=e.getFullYear();return t+" "+["January","February","March","April","May","June","July","August","September","October","November","December"][i]+" "+n}static getGridReleaseDate(){return new Date(parseInt(e.decode(e.RELEASE_INFORMATION),10))}static decode(t){const i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let n,s,r,o,a,l,c,h="",u=0;const d=t.replace(/[^A-Za-z0-9+/=]/g,"");for(;u<d.length;)o=i.indexOf(d.charAt(u++)),a=i.indexOf(d.charAt(u++)),l=i.indexOf(d.charAt(u++)),c=i.indexOf(d.charAt(u++)),n=o<<2|a>>4,s=(15&a)<<4|l>>2,r=(3&l)<<6|c,h+=String.fromCharCode(n),64!=l&&(h+=String.fromCharCode(s)),64!=c&&(h+=String.fromCharCode(r));return h=e.utf8_decode(h),h}static utf8_decode(e){e=e.replace(/rn/g,"n");let t="";for(let i=0;i<e.length;i++){const n=e.charCodeAt(i);n<128?t+=String.fromCharCode(n):n>127&&n<2048?(t+=String.fromCharCode(n>>6|192),t+=String.fromCharCode(63&n|128)):(t+=String.fromCharCode(n>>12|224),t+=String.fromCharCode(n>>6&63|128),t+=String.fromCharCode(63&n|128))}return t}static setChartsLicenseManager(e){this.chartsLicenseManager=e}static setLicenseKey(e){this.licenseKey=e,this.chartsLicenseManager&&this.chartsLicenseManager.setLicenseKey(e,!0)}static extractBracketedInformation(e){if(!e.includes("["))return["legacy",!1,void 0];const t=e.match(/\[(.*?)\]/g).map(e=>e.replace("[","").replace("]",""));if(!t||0===t.length)return["legacy",!1,void 0];const i=1===t.filter(e=>"TRIAL"===e).length,n=t.filter(e=>0===e.indexOf("v"))[0];return[n?n.replace("v",""):"legacy",i,S[t.filter(e=>S[e])[0]]]}centerPadAndOutput(e){const t=this.totalMessageLength-e.length;console.error(e.padStart(t/2+e.length,"*").padEnd(this.totalMessageLength,"*"))}padAndOutput(e,t="*",i=""){console.error(e.padEnd(this.totalMessageLength-i.length,t)+i)}outputInvalidLicenseKey(e,t,i){e?(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${t} License `),this.centerPadAndOutput(" Incompatible License Key "),this.padAndOutput(`* Your license key is for ${i} only and does not cover you for ${t}.`," ","*"),this.padAndOutput("* Please contact info@ag-grid.com to obtain a combined license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")):(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${t} License `),this.centerPadAndOutput(" Invalid License Key "),this.padAndOutput("* Your license key is not valid - please contact info@ag-grid.com to obtain a valid license."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="Invalid License"}outputExpiredTrialKey(e,t,i){this.centerPadAndOutput(""),this.centerPadAndOutput(` ${t} License `),this.centerPadAndOutput(" Trial Period Expired. "),this.padAndOutput(`* Your trial only license for ${i} expired on ${e}.`," ","*"),this.padAndOutput("* Please email info@ag-grid.com to purchase a license."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""),this.watermarkMessage="Trial Period Expired"}outputMissingLicenseKey(e){this.centerPadAndOutput(""),this.centerPadAndOutput(` ${e} License `),this.centerPadAndOutput(" License Key Not Found "),this.padAndOutput(`* All ${e} features are unlocked for trial.`," ","*"),this.padAndOutput("* If you want to hide the watermark please email info@ag-grid.com for a trial license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""),this.watermarkMessage="For Trial Use Only"}outputExpiredKey(e,t,i,n){this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Incompatible Software Version "),this.padAndOutput(`* Your license key works with versions of ${n} released before ${e}.`," ","*"),this.padAndOutput(`* The version you are trying to use was released on ${t}.`," ","*"),this.padAndOutput("* Please contact info@ag-grid.com to renew your license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""),this.watermarkMessage="License Expired"}};x.RELEASE_INFORMATION="MTcxNTc3NTcyODYxNg==";var E=x,A=class extends b.BeanStub{validateLicense(){this.licenseManager=new E(this.gos.getDocument()),this.licenseManager.validateLicense()}static getLicenseDetails(e){return new E(null).getLicenseDetails(e)}isDisplayWatermark(){return this.licenseManager.isDisplayWatermark()}getWatermarkMessage(){return this.licenseManager.getWatermarkMessage()}static setLicenseKey(e){E.setLicenseKey(e)}static setChartsLicenseManager(e){E.setChartsLicenseManager(e)}};u([b.PreConstruct],A.prototype,"validateLicense",1),A=u([(0,b.Bean)("licenseManager")],A);var M=i(98092),T=class extends M.Component{constructor(){super('<div class="ag-watermark">\n                <div ref="eLicenseTextRef" class="ag-watermark-text"></div>\n            </div>')}postConstruct(){const e=this.shouldDisplayWatermark();this.setDisplayed(e),e&&(this.eLicenseTextRef.innerText=this.licenseManager.getWatermarkMessage(),window.setTimeout(()=>this.addCssClass("ag-opacity-zero"),0),window.setTimeout(()=>this.setDisplayed(!1),5e3))}shouldDisplayWatermark(){return this.licenseManager.isDisplayWatermark()}};u([(0,M.Autowired)("licenseManager")],T.prototype,"licenseManager",2),u([(0,M.RefSelector)("eLicenseTextRef")],T.prototype,"eLicenseTextRef",2),u([M.PostConstruct],T.prototype,"postConstruct",1);var D={version:"31.3.4",moduleName:v.ModuleNames.EnterpriseCoreModule,beans:[A],agStackComponents:[{componentName:"AgWatermark",componentClass:T}]},I=i(98092),R=i(98092),k=i(98092),P=i(98092),_=i(98092),L=i(98092),N=i(98092),O=i(98092),F=i(98092),G=i(98092),B=i(98092),V=i(98092),H=i(98092),U=i(98092),z=i(98092),W=Object.defineProperty,j=Object.defineProperties,$=Object.getOwnPropertyDescriptor,K=Object.getOwnPropertyDescriptors,Y=Object.getOwnPropertySymbols,q=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable,Z=(e,t,i)=>t in e?W(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Q=(e,t)=>{for(var i in t||(t={}))q.call(t,i)&&Z(e,i,t[i]);if(Y)for(var i of Y(t))X.call(t,i)&&Z(e,i,t[i]);return e},J=(e,t)=>j(e,K(t)),ee=(e,t,i,n)=>{for(var s,r=n>1?void 0:n?$(t,i):t,o=e.length-1;o>=0;o--)(s=e[o])&&(r=(n?s(t,i,r):s(r))||r);return n&&r&&W(t,i,r),r},te=class extends k.Component{constructor(e){super('\n            <div class="ag-advanced-filter-header" role="row">\n            </div>'),this.enabled=e}postConstruct(){this.setupAdvancedFilter(this.enabled),this.addDestroyFunc(()=>this.destroyBean(this.eAdvancedFilter)),this.addManagedListener(this.eventService,k.Events.EVENT_GRID_COLUMNS_CHANGED,()=>this.onGridColumnsChanged()),this.addGuiEventListener("keydown",e=>this.onKeyDown(e)),this.addGuiEventListener("focusout",e=>{this.getFocusableElement().contains(e.relatedTarget)||this.focusService.clearAdvancedFilterColumn()})}getFocusableElement(){var e,t;return null!=(t=null==(e=this.eAdvancedFilter)?void 0:e.getGui())?t:this.getGui()}setEnabled(e){e!==this.enabled&&this.setupAdvancedFilter(e)}refresh(){var e;null==(e=this.eAdvancedFilter)||e.refresh()}getHeight(){return this.height}setInputDisabled(e){var t;null==(t=this.eAdvancedFilter)||t.setInputDisabled(e)}setupAdvancedFilter(e){const t=this.getGui();if(e){this.eAdvancedFilter=this.createBean(new ye);const e=this.eAdvancedFilter.getGui();this.eAdvancedFilter.addCssClass("ag-advanced-filter-header-cell"),this.height=this.columnModel.getFloatingFiltersHeight();const i=`${this.height}px`;t.style.height=i,t.style.minHeight=i,this.setAriaRowIndex(),k._.setAriaRole(e,"gridcell"),k._.setAriaColIndex(e,1),this.setAriaColumnCount(e),t.appendChild(e)}else k._.clearElement(t),this.destroyBean(this.eAdvancedFilter),this.height=0;k._.setDisplayed(t,e),this.enabled=e}setAriaColumnCount(e){k._.setAriaColSpan(e,this.columnModel.getAllGridColumns().length)}setAriaRowIndex(){k._.setAriaRowIndex(this.getGui(),this.headerNavigationService.getHeaderRowCount())}onGridColumnsChanged(){this.eAdvancedFilter&&(this.setAriaColumnCount(this.eAdvancedFilter.getGui()),this.setAriaRowIndex())}onKeyDown(e){switch(e.key){case k.KeyCode.ENTER:this.hasFocus()&&this.focusService.focusInto(this.getFocusableElement())&&e.preventDefault();break;case k.KeyCode.ESCAPE:this.hasFocus()||this.getFocusableElement().focus();break;case k.KeyCode.UP:this.navigateUpDown(!0,e);break;case k.KeyCode.DOWN:this.navigateUpDown(!1,e);break;case k.KeyCode.TAB:if(this.hasFocus())this.navigateLeftRight(e);else{const t=this.focusService.findNextFocusableElement(this.getFocusableElement(),null,e.shiftKey);t?(e.preventDefault(),t.focus()):this.navigateLeftRight(e)}}}navigateUpDown(e,t){this.hasFocus()&&this.focusService.focusNextFromAdvancedFilter(e)&&t.preventDefault()}navigateLeftRight(e){(e.shiftKey?this.focusService.focusLastHeader():this.focusService.focusNextFromAdvancedFilter(!1,!0))&&e.preventDefault()}hasFocus(){return this.gos.getActiveDomElement()===this.getFocusableElement()}};ee([(0,k.Autowired)("columnModel")],te.prototype,"columnModel",2),ee([(0,k.Autowired)("focusService")],te.prototype,"focusService",2),ee([(0,k.Autowired)("headerNavigationService")],te.prototype,"headerNavigationService",2),ee([k.PostConstruct],te.prototype,"postConstruct",1);var ie=class extends L.AgRichSelect{constructor(e){super(J(Q({},e),{template:'\n                <div class="ag-picker-field" role="presentation">\n                    <div ref="eLabel"></div>\n                    <div ref="eWrapper" class="ag-wrapper ag-picker-collapsed">\n                        <div ref="eDisplayField" class="ag-picker-field-display"></div>\n                        <ag-input-text-field ref="eInput" class="ag-rich-select-field-input"></ag-input-text-field>\n                        <div ref="eIcon" class="ag-picker-field-icon" aria-hidden="true"></div>\n                    </div>\n                </div>'})),this.params=e}showPicker(){setTimeout(()=>super.showPicker())}hidePicker(){setTimeout(()=>super.hidePicker())}postConstruct(){super.postConstruct();const{wrapperClassName:e,ariaLabel:t}=this.params;L._.setDisplayed(this.eDisplayField,!1),e&&this.eWrapper.classList.add(e),L._.setAriaLabelledBy(this.eWrapper,""),L._.setAriaLabel(this.eWrapper,t)}onEnterKeyDown(e){L._.stopPropagationForAgGrid(e),this.isPickerDisplayed?super.onEnterKeyDown(e):(e.preventDefault(),this.showPicker())}},ne=class e extends N.BeanStub{constructor(e,t){super(),this.comp=e,this.virtualList=t}postConstruct(){this.createManagedBean(new N.VirtualListDragFeature(this.comp,this.virtualList,{dragSourceType:N.DragSourceType.AdvancedFilterBuilder,listItemDragStartEvent:e.EVENT_DRAG_STARTED,listItemDragEndEvent:e.EVENT_DRAG_ENDED,eventSource:this,getCurrentDragValue:e=>this.getCurrentDragValue(e),isMoveBlocked:()=>!1,getNumRows:e=>e.getNumItems(),moveItem:(e,t)=>this.moveItem(e,t)}))}getCurrentDragValue(e){return e.item}moveItem(e,t){this.comp.moveItem(e,t)}};ne.EVENT_DRAG_STARTED="advancedFilterBuilderDragStarted",ne.EVENT_DRAG_ENDED="advancedFilterBuilderDragEnded",ee([N.PostConstruct],ne.prototype,"postConstruct",1);var se=ne,re=class extends O.BeanStub{constructor(e,t,i){super(),this.eGui=e,this.focusWrapper=t,this.eFocusableComp=i}postConstruct(){this.addManagedListener(this.eGui,"keydown",e=>{switch(e.key){case O.KeyCode.TAB:e.defaultPrevented||O._.stopPropagationForAgGrid(e);break;case O.KeyCode.UP:case O.KeyCode.DOWN:O._.stopPropagationForAgGrid(e);break;case O.KeyCode.ESCAPE:if(O._.isStopPropagationForAgGrid(e))return;this.eGui.contains(this.gos.getActiveDomElement())&&(e.preventDefault(),O._.stopPropagationForAgGrid(e),this.focusWrapper.focus())}}),this.addManagedListener(this.focusWrapper,"keydown",e=>{if(e.key===O.KeyCode.ENTER){if(O._.isStopPropagationForAgGrid(e))return;this.gos.getActiveDomElement()===this.focusWrapper&&(e.preventDefault(),O._.stopPropagationForAgGrid(e),this.eFocusableComp.getFocusableElement().focus())}}),this.addManagedListener(this.focusWrapper,"focusin",()=>{this.focusWrapper.classList.add("ag-advanced-filter-builder-virtual-list-item-highlight")}),this.addManagedListener(this.focusWrapper,"focusout",e=>{this.focusWrapper.contains(e.relatedTarget)||this.focusWrapper.classList.remove("ag-advanced-filter-builder-virtual-list-item-highlight")})}};function oe(e,t){return{pickerAriaLabelKey:"ariaLabelAdvancedFilterBuilderAddField",pickerAriaLabelValue:"Advanced Filter Builder Add Field",pickerType:"ag-list",valueList:[{key:"condition",displayValue:e("advancedFilterBuilderAddCondition")},{key:"join",displayValue:e("advancedFilterBuilderAddJoin")}],valueFormatter:e=>{var t;return null==e?null:null!=(t=e.displayValue)?t:e.key},pickerIcon:"advancedFilterBuilderAdd",maxPickerWidth:`${null!=t?t:120}px`,wrapperClassName:"ag-advanced-filter-builder-item-button",ariaLabel:e("advancedFilterBuilderAddButtonTooltip")}}ee([O.PostConstruct],re.prototype,"postConstruct",1);var ae=class{};ae.EVENT_ADDED="advancedFilterBuilderAdded",ae.EVENT_MOVED="advancedFilterBuilderMoved",ae.EVENT_REMOVED="advancedFilterBuilderRemoved",ae.EVENT_VALUE_CHANGED="advancedFilterBuilderValueChanged",ae.EVENT_VALID_CHANGED="advancedFilterBuilderValidChanged";var le=class extends F.Component{constructor(){super('\n            <div class="ag-advanced-filter-builder-item-condition" role="presentation"></div>\n        '),this.validationMessage=null}init(e){const{item:t,createPill:i}=e;this.item=t,this.createPill=i,this.filterModel=t.filterModel,this.setupColumnCondition(this.filterModel),this.validate(),this.addDestroyFunc(()=>this.destroyBeans([this.eColumnPill,this.eOperatorPill,this.eOperandPill]))}getDragName(){return this.filterModel.colId?this.advancedFilterExpressionService.parseColumnFilterModel(this.filterModel):this.getDefaultColumnDisplayValue()}getAriaLabel(){return`${this.advancedFilterExpressionService.translate("ariaAdvancedFilterBuilderFilterItem")} ${this.getDragName()}`}getValidationMessage(){return this.validationMessage}getFocusableElement(){return this.eColumnPill.getFocusableElement()}setupColumnCondition(e){var t;const i=this.advancedFilterExpressionService.getColumnDetails(e.colId);this.baseCellDataType=i.baseCellDataType,this.column=i.column,this.numOperands=this.getNumOperands(this.getOperatorKey()),this.eColumnPill=this.createPill({key:this.getColumnKey(),displayValue:null!=(t=this.getColumnDisplayValue())?t:this.getDefaultColumnDisplayValue(),cssClass:"ag-advanced-filter-builder-column-pill",isSelect:!0,getEditorParams:()=>({values:this.advancedFilterExpressionService.getColumnAutocompleteEntries()}),update:e=>this.setColumnKey(e),pickerAriaLabelKey:"ariaLabelAdvancedFilterBuilderColumnSelectField",pickerAriaLabelValue:"Advanced Filter Builder Column Select Field",ariaLabel:this.advancedFilterExpressionService.translate("ariaAdvancedFilterBuilderColumn")}),this.getGui().appendChild(this.eColumnPill.getGui()),F._.exists(this.getColumnKey())&&(this.createOperatorPill(),this.hasOperand()&&this.createOperandPill())}createOperatorPill(){var e;this.eOperatorPill=this.createPill({key:this.getOperatorKey(),displayValue:null!=(e=this.getOperatorDisplayValue())?e:this.getDefaultOptionSelectValue(),cssClass:"ag-advanced-filter-builder-option-pill",isSelect:!0,getEditorParams:()=>({values:this.getOperatorAutocompleteEntries()}),update:e=>this.setOperatorKey(e),pickerAriaLabelKey:"ariaLabelAdvancedFilterBuilderOptionSelectField",pickerAriaLabelValue:"Advanced Filter Builder Option Select Field",ariaLabel:this.advancedFilterExpressionService.translate("ariaAdvancedFilterBuilderOption")}),this.eColumnPill.getGui().insertAdjacentElement("afterend",this.eOperatorPill.getGui())}createOperandPill(){var e;const t=null!=(e=this.getOperandDisplayValue())?e:"";this.eOperandPill=this.createPill({key:t,displayValue:t,baseCellDataType:this.baseCellDataType,cssClass:"ag-advanced-filter-builder-value-pill",isSelect:!1,update:e=>this.setOperand(e),ariaLabel:this.advancedFilterExpressionService.translate("ariaAdvancedFilterBuilderValue")}),this.getGui().appendChild(this.eOperandPill.getGui())}getColumnKey(){return this.filterModel.colId}getColumnDisplayValue(){return this.advancedFilterExpressionService.getColumnDisplayValue(this.filterModel)}getOperatorKey(){return this.filterModel.type}getOperatorDisplayValue(){return this.advancedFilterExpressionService.getOperatorDisplayValue(this.filterModel)}getOperandDisplayValue(){return this.advancedFilterExpressionService.getOperandDisplayValue(this.filterModel,!0)}hasOperand(){return this.numOperands>0}getOperatorAutocompleteEntries(){return this.column?this.advancedFilterExpressionService.getOperatorAutocompleteEntries(this.column,this.baseCellDataType):[]}setColumnKey(e){this.eOperatorPill||this.createOperatorPill();const t=this.advancedFilterExpressionService.getColumnDetails(e);this.column=t.column;const i=t.baseCellDataType;this.baseCellDataType!==i&&(this.baseCellDataType=i,this.setOperatorKey(void 0),this.eOperatorPill&&(F._.removeFromParent(this.eOperatorPill.getGui()),this.destroyBean(this.eOperatorPill),this.createOperatorPill()),this.validate()),this.filterModel.colId=e,this.filterModel.filterType=this.baseCellDataType}setOperatorKey(e){const t=this.getNumOperands(e);t!==this.numOperands&&(this.numOperands=t,0===t?this.destroyOperandPill():(this.createOperandPill(),"number"!==this.baseCellDataType&&this.setOperand(""))),this.filterModel.type=e,this.validate()}setOperand(e){var t;let i=e;this.column&&(i=null!=(t=this.advancedFilterExpressionService.getOperandModelValue(e,this.baseCellDataType,this.column))?t:""),this.filterModel.filter=i,this.validate()}getNumOperands(e){var t,i;return null!=(i=null==(t=this.advancedFilterExpressionService.getExpressionOperator(this.baseCellDataType,e))?void 0:t.numOperands)?i:0}destroyOperandPill(){delete this.filterModel.filter,this.getGui().removeChild(this.eOperandPill.getGui()),this.destroyBean(this.eOperandPill),this.eOperandPill=void 0}validate(){let e=null;F._.exists(this.getColumnKey())?F._.exists(this.getOperatorKey())?this.numOperands>0&&!F._.exists(this.getOperandDisplayValue())&&(e=this.advancedFilterExpressionService.translate("advancedFilterBuilderValidationEnterValue")):e=this.advancedFilterExpressionService.translate("advancedFilterBuilderValidationSelectOption"):e=this.advancedFilterExpressionService.translate("advancedFilterBuilderValidationSelectColumn"),this.item.valid=!e,e!==this.validationMessage&&(this.validationMessage=e,this.dispatchEvent({type:ae.EVENT_VALID_CHANGED}))}getDefaultColumnDisplayValue(){return this.advancedFilterExpressionService.translate("advancedFilterBuilderSelectColumn")}getDefaultOptionSelectValue(){return this.advancedFilterExpressionService.translate("advancedFilterBuilderSelectOption")}};ee([(0,F.Autowired)("advancedFilterExpressionService")],le.prototype,"advancedFilterExpressionService",2),ee([(0,F.Autowired)("valueService")],le.prototype,"valueService",2);var ce=class extends G.Component{constructor(e){super('\n            <div class="ag-advanced-filter-builder-pill-wrapper" role="presentation">\n                <div ref="ePill" class="ag-advanced-filter-builder-pill" role="button">\n                    <span ref="eLabel" class="ag-advanced-filter-builder-pill-display"></span>\n                </div>\n            </div>\n        '),this.params=e,this.value=e.value}postConstruct(){const{cssClass:e,ariaLabel:t}=this.params;this.ePill.classList.add(e),this.activateTabIndex([this.ePill]),this.eLabel.id=`${this.getCompId()}`,G._.setAriaDescribedBy(this.ePill,this.eLabel.id),G._.setAriaLabel(this.ePill,t),this.renderValue(),this.addManagedListener(this.ePill,"click",e=>{e.preventDefault(),this.showEditor()}),this.addManagedListener(this.ePill,"keydown",e=>{e.key===G.KeyCode.ENTER&&(e.preventDefault(),G._.stopPropagationForAgGrid(e),this.showEditor())}),this.addDestroyFunc(()=>this.destroyBean(this.eEditor))}getFocusableElement(){return this.ePill}showEditor(){if(this.eEditor)return;G._.setDisplayed(this.ePill,!1),this.eEditor=this.createEditorComp(this.params.type),this.eEditor.setValue(this.value);const e=this.eEditor.getGui();this.eEditor.addManagedListener(e,"keydown",e=>{switch(e.key){case G.KeyCode.ENTER:e.preventDefault(),G._.stopPropagationForAgGrid(e),this.updateValue(!0);break;case G.KeyCode.ESCAPE:e.preventDefault(),G._.stopPropagationForAgGrid(e),this.hideEditor(!0)}}),this.eEditor.addManagedListener(e,"focusout",()=>{this.updateValue(!1)}),this.getGui().appendChild(e),this.eEditor.getFocusableElement().focus()}createEditorComp(e){let t;switch(e){case"text":t=new G.AgInputTextField;break;case"number":t=new G.AgInputNumberField;break;case"date":t=new G.AgInputDateField}return this.createBean(t)}hideEditor(e){const{eEditor:t}=this;t&&(this.eEditor=void 0,this.getGui().removeChild(t.getGui()),this.destroyBean(t),G._.setDisplayed(this.ePill,!0),e&&this.ePill.focus())}renderValue(){let e;this.eLabel.classList.remove("ag-advanced-filter-builder-value-empty","ag-advanced-filter-builder-value-number","ag-advanced-filter-builder-value-text"),G._.exists(this.value)?"number"===this.params.type?(e=this.value,this.eLabel.classList.add("ag-advanced-filter-builder-value-number")):(e=`"${this.value}"`,this.eLabel.classList.add("ag-advanced-filter-builder-value-text")):(e=this.advancedFilterExpressionService.translate("advancedFilterBuilderEnterValue"),this.eLabel.classList.add("ag-advanced-filter-builder-value-empty")),this.eLabel.innerText=e}updateValue(e){var t;if(!this.eEditor)return;const i=null!=(t=this.eEditor.getValue())?t:"";this.dispatchEvent({type:G.Events.EVENT_FIELD_VALUE_CHANGED,value:i}),this.value=i,this.renderValue(),this.hideEditor(e)}};ee([(0,G.RefSelector)("ePill")],ce.prototype,"ePill",2),ee([(0,G.RefSelector)("eLabel")],ce.prototype,"eLabel",2),ee([(0,G.Autowired)("advancedFilterExpressionService")],ce.prototype,"advancedFilterExpressionService",2),ee([G.PostConstruct],ce.prototype,"postConstruct",1);var he=class extends B.Component{constructor(){super('\n            <div class="ag-advanced-filter-builder-item-condition" role="presentation"></div>\n        ')}init(e){const{item:t,createPill:i}=e,n=t.filterModel;this.filterModel=n,this.ePill=i({key:n.type,displayValue:this.advancedFilterExpressionService.parseJoinOperator(n),cssClass:"ag-advanced-filter-builder-join-pill",isSelect:!0,getEditorParams:()=>({values:this.advancedFilterExpressionService.getJoinOperatorAutocompleteEntries()}),update:e=>n.type=e,pickerAriaLabelKey:"ariaLabelAdvancedFilterBuilderJoinSelectField",pickerAriaLabelValue:"Advanced Filter Builder Join Operator Select Field",ariaLabel:this.advancedFilterExpressionService.translate("ariaAdvancedFilterBuilderJoinOperator")}),this.getGui().appendChild(this.ePill.getGui()),this.addDestroyFunc(()=>this.destroyBean(this.ePill))}getDragName(){return this.advancedFilterExpressionService.parseJoinOperator(this.filterModel)}getAriaLabel(){return`${this.advancedFilterExpressionService.translate("ariaAdvancedFilterBuilderGroupItem")} ${this.getDragName()}`}getValidationMessage(){return null}getFocusableElement(){return this.ePill.getFocusableElement()}};ee([(0,B.Autowired)("advancedFilterExpressionService")],he.prototype,"advancedFilterExpressionService",2);var ue=class extends V.AgRichSelect{constructor(e){super(J(Q({},e),{template:'\n                <div class="ag-picker-field ag-advanced-filter-builder-pill-wrapper" role="presentation">\n                    <div ref="eLabel"></div>\n                    <div ref="eWrapper" class="ag-wrapper ag-advanced-filter-builder-pill ag-picker-collapsed">\n                        <div ref="eDisplayField" class="ag-picker-field-display ag-advanced-filter-builder-pill-display"></div>\n                        <ag-input-text-field ref="eInput" class="ag-rich-select-field-input"></ag-input-text-field>\n                        <div ref="eIcon" class="ag-picker-field-icon" aria-hidden="true"></div>\n                    </div>\n                </div>'})),this.params=e}getFocusableElement(){return this.eWrapper}showPicker(){setTimeout(()=>super.showPicker())}hidePicker(){setTimeout(()=>super.hidePicker())}postConstruct(){super.postConstruct();const{wrapperClassName:e,ariaLabel:t}=this.params;this.eWrapper.classList.add(e),V._.setAriaLabelledBy(this.eWrapper,""),V._.setAriaLabel(this.eWrapper,t)}createPickerComponent(){var e;if(!this.values){const{values:t}=this.params.getEditorParams();this.values=t;const i=this.value.key,n=null!=(e=t.find(e=>e.key===i))?e:{key:i,displayValue:this.value.displayValue};this.value=n}return super.createPickerComponent()}onEnterKeyDown(e){V._.stopPropagationForAgGrid(e),this.isPickerDisplayed?super.onEnterKeyDown(e):(e.preventDefault(),this.showPicker())}},de=class extends _.TabGuardComp{constructor(e,t,i){super('\n            <div class="ag-advanced-filter-builder-item-wrapper" role="presentation">\n                <div ref="eItem" class="ag-advanced-filter-builder-item" role="presentation">\n                    <div ref="eTreeLines" class="ag-advanced-filter-builder-item-tree-lines" aria-hidden="true"></div>\n                    <span ref="eDragHandle" class="ag-drag-handle" aria-hidden="true"></span>\n                    <span ref="eValidation" class="ag-advanced-filter-builder-item-button ag-advanced-filter-builder-invalid" aria-hidden="true"></span>\n                </div>\n                <div ref="eButtons" class="ag-advanced-filter-builder-item-buttons">\n                    <span ref="eMoveUpButton" class="ag-advanced-filter-builder-item-button" role="button"></span>\n                    <span ref="eMoveDownButton" class="ag-advanced-filter-builder-item-button" role="button"></span>\n                    <div ref="eAddButton" role="presentation"></div>\n                    <span ref="eRemoveButton" class="ag-advanced-filter-builder-item-button" role="button"></span>\n                </div>\n            </div>\n        '),this.item=e,this.dragFeature=t,this.focusWrapper=i,this.moveUpDisabled=!1,this.moveDownDisabled=!1}postConstruct(){const{filterModel:e,level:t,showMove:i}=this.item,n="join"===e.filterType;if(this.ePillWrapper=this.createManagedBean(n?new he:new le),this.ePillWrapper.init({item:this.item,createPill:e=>this.createPill(e)}),this.eDragHandle.insertAdjacentElement("afterend",this.ePillWrapper.getGui()),0===t){const e=document.createElement("div");e.classList.add("ag-advanced-filter-builder-item-tree-line-vertical-bottom"),e.classList.add("ag-advanced-filter-builder-item-tree-line-root"),this.eTreeLines.appendChild(e),_._.setDisplayed(this.eDragHandle,!1),_._.setDisplayed(this.eButtons,!1),_._.setAriaExpanded(this.focusWrapper,!0)}else this.setupTreeLines(t),this.eDragHandle.appendChild(_._.createIconNoSpan("advancedFilterBuilderDrag",this.gos)),this.setupValidation(),this.setupMoveButtons(i),this.setupAddButton(),this.setupRemoveButton(),this.setupDragging(),this.updateAriaExpanded();_._.setAriaLevel(this.focusWrapper,t+1),this.initialiseTabGuard({}),this.createManagedBean(new re(this.getGui(),this.focusWrapper,this.ePillWrapper)),this.updateAriaLabel(),this.addManagedListener(this.ePillWrapper,ae.EVENT_VALUE_CHANGED,()=>this.dispatchEvent({type:ae.EVENT_VALUE_CHANGED})),this.addManagedListener(this.ePillWrapper,ae.EVENT_VALID_CHANGED,()=>this.updateValidity())}setState(e){const{level:t}=this.item;if(0===t)return;const{showMove:i}=this.item,{disableMoveUp:n,disableMoveDown:s,treeLines:r,showStartTreeLine:o}=e;this.updateTreeLines(r,o),this.updateAriaExpanded(),i&&(this.moveUpDisabled=!!n,this.moveDownDisabled=!!s,this.eMoveUpButton.classList.toggle("ag-advanced-filter-builder-item-button-disabled",n),this.eMoveDownButton.classList.toggle("ag-advanced-filter-builder-item-button-disabled",s),_._.setAriaDisabled(this.eMoveUpButton,!!n),_._.setAriaDisabled(this.eMoveDownButton,!!s),this.moveUpTooltipFeature.refreshToolTip(),this.moveDownTooltipFeature.refreshToolTip())}focusMoveButton(e){(e?this.eMoveUpButton:this.eMoveDownButton).focus()}afterAdd(){this.ePillWrapper.getFocusableElement().focus()}setupTreeLines(e){for(let t=0;t<e;t++){const e=document.createElement("div");this.eTreeLines.appendChild(e)}}updateTreeLines(e,t){const i=e.length-1,{children:n}=this.eTreeLines;for(let t=0;t<i;t++){const i=n.item(t);i&&i.classList.toggle("ag-advanced-filter-builder-item-tree-line-vertical",!e[t])}const s=n.item(i);if(s){s.classList.add("ag-advanced-filter-builder-item-tree-line-horizontal");const t=e[i];s.classList.toggle("ag-advanced-filter-builder-item-tree-line-vertical-top",t),s.classList.toggle("ag-advanced-filter-builder-item-tree-line-vertical",!t)}this.eDragHandle.classList.toggle("ag-advanced-filter-builder-item-tree-line-vertical-bottom",t)}setupValidation(){this.eValidation.appendChild(_._.createIconNoSpan("advancedFilterBuilderInvalid",this.gos)),this.validationTooltipFeature=this.createManagedBean(new _.TooltipFeature({getGui:()=>this.eValidation,getLocation:()=>"advancedFilter",getTooltipValue:()=>this.ePillWrapper.getValidationMessage(),getTooltipShowDelayOverride:()=>1e3})),this.updateValidity()}setupAddButton(){var e;const t=oe(e=>this.advancedFilterExpressionService.translate(e),null==(e=this.gos.get("advancedFilterBuilderParams"))?void 0:e.addSelectWidth),i=this.createManagedBean(new ie(t));this.addManagedListener(i,_.Events.EVENT_FIELD_PICKER_VALUE_SELECTED,({value:e})=>this.dispatchEvent({type:ae.EVENT_ADDED,item:this.item,isJoin:"join"===e.key})),this.eAddButton.appendChild(i.getGui()),this.createManagedBean(new _.TooltipFeature({getGui:()=>this.eAddButton,getLocation:()=>"advancedFilter",getTooltipValue:()=>this.advancedFilterExpressionService.translate("advancedFilterBuilderAddButtonTooltip")}))}setupRemoveButton(){this.eRemoveButton.appendChild(_._.createIconNoSpan("advancedFilterBuilderRemove",this.gos)),this.addManagedListener(this.eRemoveButton,"click",()=>this.removeItem()),this.addManagedListener(this.eRemoveButton,"keydown",e=>{e.key===_.KeyCode.ENTER&&(e.preventDefault(),_._.stopPropagationForAgGrid(e),this.removeItem())}),this.createManagedBean(new _.TooltipFeature({getGui:()=>this.eRemoveButton,getLocation:()=>"advancedFilter",getTooltipValue:()=>this.advancedFilterExpressionService.translate("advancedFilterBuilderRemoveButtonTooltip")})),_._.setAriaLabel(this.eRemoveButton,this.advancedFilterExpressionService.translate("advancedFilterBuilderRemoveButtonTooltip")),this.activateTabIndex([this.eRemoveButton])}setupMoveButtons(e){e?(this.eMoveUpButton.appendChild(_._.createIconNoSpan("advancedFilterBuilderMoveUp",this.gos)),this.addManagedListener(this.eMoveUpButton,"click",()=>this.moveItem(!0)),this.addManagedListener(this.eMoveUpButton,"keydown",e=>{e.key===_.KeyCode.ENTER&&(e.preventDefault(),_._.stopPropagationForAgGrid(e),this.moveItem(!0))}),this.moveUpTooltipFeature=this.createManagedBean(new _.TooltipFeature({getGui:()=>this.eMoveUpButton,getLocation:()=>"advancedFilter",getTooltipValue:()=>this.moveUpDisabled?null:this.advancedFilterExpressionService.translate("advancedFilterBuilderMoveUpButtonTooltip")})),_._.setAriaLabel(this.eMoveUpButton,this.advancedFilterExpressionService.translate("advancedFilterBuilderMoveUpButtonTooltip")),this.eMoveDownButton.appendChild(_._.createIconNoSpan("advancedFilterBuilderMoveDown",this.gos)),this.addManagedListener(this.eMoveDownButton,"click",()=>this.moveItem(!1)),this.addManagedListener(this.eMoveDownButton,"keydown",e=>{e.key===_.KeyCode.ENTER&&(e.preventDefault(),_._.stopPropagationForAgGrid(e),this.moveItem(!1))}),this.moveDownTooltipFeature=this.createManagedBean(new _.TooltipFeature({getGui:()=>this.eMoveDownButton,getLocation:()=>"advancedFilter",getTooltipValue:()=>this.moveDownDisabled?null:this.advancedFilterExpressionService.translate("advancedFilterBuilderMoveDownButtonTooltip")})),_._.setAriaLabel(this.eMoveDownButton,this.advancedFilterExpressionService.translate("advancedFilterBuilderMoveDownButtonTooltip")),this.activateTabIndex([this.eMoveUpButton,this.eMoveDownButton])):(_._.setDisplayed(this.eMoveUpButton,!1),_._.setDisplayed(this.eMoveDownButton,!1))}updateValidity(){_._.setVisible(this.eValidation,!this.item.valid),this.validationTooltipFeature.refreshToolTip(),this.updateAriaLabel()}createPill(e){var t,i;const{key:n,displayValue:s,cssClass:r,update:o,ariaLabel:a}=e,l=e=>{null!=e&&(o(e),this.dispatchEvent({type:ae.EVENT_VALUE_CHANGED}))};if(e.isSelect){const{getEditorParams:o,pickerAriaLabelKey:c,pickerAriaLabelValue:h}=e,u=this.gos.get("advancedFilterBuilderParams"),d=`${null!=(t=null==u?void 0:u.pillSelectMinWidth)?t:140}px`,p=`${null!=(i=null==u?void 0:u.pillSelectMaxWidth)?i:200}px`,g=this.createBean(new ue({pickerAriaLabelKey:c,pickerAriaLabelValue:h,pickerType:"ag-list",value:{key:n,displayValue:s},valueFormatter:e=>{var t;return null==e?null:null!=(t=e.displayValue)?t:e.key},variableWidth:!0,minPickerWidth:d,maxPickerWidth:p,getEditorParams:o,wrapperClassName:r,ariaLabel:a}));return this.addManagedListener(g,_.Events.EVENT_FIELD_PICKER_VALUE_SELECTED,({value:e})=>l(null==e?void 0:e.key)),g}{const t=this.createBean(new ce({value:s,cssClass:r,type:this.getInputType(e.baseCellDataType),ariaLabel:a}));return this.addManagedListener(t,_.Events.EVENT_FIELD_VALUE_CHANGED,({value:e})=>l(e)),t}}getInputType(e){switch(e){case"text":case"object":case"boolean":return"text";case"number":return"number";case"date":case"dateString":return"date"}}setupDragging(){const e={type:_.DragSourceType.AdvancedFilterBuilder,eElement:this.eDragHandle,dragItemName:()=>this.ePillWrapper.getDragName(),getDefaultIconName:()=>_.DragAndDropService.ICON_NOT_ALLOWED,getDragItem:()=>({}),onDragStarted:()=>this.dragFeature.dispatchEvent({type:se.EVENT_DRAG_STARTED,item:this.item}),onDragStopped:()=>this.dragFeature.dispatchEvent({type:se.EVENT_DRAG_ENDED})};this.dragAndDropService.addDragSource(e,!0),this.addDestroyFunc(()=>this.dragAndDropService.removeDragSource(e))}updateAriaLabel(){const e=this.ePillWrapper.getAriaLabel(),t=`${this.item.level+1}`,i=this.ePillWrapper.getValidationMessage();let n;n=i?this.advancedFilterExpressionService.translate("ariaAdvancedFilterBuilderItemValidation",[e,t,i]):this.advancedFilterExpressionService.translate("ariaAdvancedFilterBuilderItem",[e,t]),_._.setAriaLabel(this.focusWrapper,n)}updateAriaExpanded(){_._.removeAriaExpanded(this.focusWrapper);const{filterModel:e}=this.item;"join"===(null==e?void 0:e.filterType)&&e.conditions.length&&_._.setAriaExpanded(this.focusWrapper,!0)}removeItem(){this.dispatchEvent({type:ae.EVENT_REMOVED,item:this.item})}moveItem(e){this.dispatchEvent({type:ae.EVENT_MOVED,item:this.item,backwards:e})}};ee([(0,_.RefSelector)("eTreeLines")],de.prototype,"eTreeLines",2),ee([(0,_.RefSelector)("eDragHandle")],de.prototype,"eDragHandle",2),ee([(0,_.RefSelector)("eItem")],de.prototype,"eItem",2),ee([(0,_.RefSelector)("eButtons")],de.prototype,"eButtons",2),ee([(0,_.RefSelector)("eValidation")],de.prototype,"eValidation",2),ee([(0,_.RefSelector)("eMoveUpButton")],de.prototype,"eMoveUpButton",2),ee([(0,_.RefSelector)("eMoveDownButton")],de.prototype,"eMoveDownButton",2),ee([(0,_.RefSelector)("eAddButton")],de.prototype,"eAddButton",2),ee([(0,_.RefSelector)("eRemoveButton")],de.prototype,"eRemoveButton",2),ee([(0,_.Autowired)("beans")],de.prototype,"beans",2),ee([(0,_.Autowired)("dragAndDropService")],de.prototype,"dragAndDropService",2),ee([(0,_.Autowired)("advancedFilterExpressionService")],de.prototype,"advancedFilterExpressionService",2),ee([_.PostConstruct],de.prototype,"postConstruct",1);var pe=class extends H.Component{constructor(e,t){super('\n            <div class="ag-advanced-filter-builder-item-wrapper" role="presentation">\n                <div ref="eItem" class="ag-advanced-filter-builder-item" role="presentation">\n                    <div class="ag-advanced-filter-builder-item-tree-lines" aria-hidden="true">\n                        <div class="ag-advanced-filter-builder-item-tree-line-vertical-top ag-advanced-filter-builder-item-tree-line-horizontal"></div>\n                    </div>\n                </div>\n            </div>\n        '),this.item=e,this.focusWrapper=t}postConstruct(){var e;H._.setAriaLevel(this.focusWrapper,2);const t=oe(e=>this.advancedFilterExpressionService.translate(e),null==(e=this.gos.get("advancedFilterBuilderParams"))?void 0:e.addSelectWidth),i=this.createManagedBean(new ie(t));this.addManagedListener(i,H.Events.EVENT_FIELD_PICKER_VALUE_SELECTED,({value:e})=>{this.dispatchEvent({type:ae.EVENT_ADDED,item:this.item,isJoin:"join"===e.key})}),this.eItem.appendChild(i.getGui()),this.createManagedBean(new H.TooltipFeature({getGui:()=>i.getGui(),getLocation:()=>"advancedFilter",getTooltipValue:()=>this.advancedFilterExpressionService.translate("advancedFilterBuilderAddButtonTooltip")})),this.createManagedBean(new re(this.getGui(),this.focusWrapper,i)),H._.setAriaLabel(this.focusWrapper,this.advancedFilterExpressionService.translate("ariaAdvancedFilterBuilderItem",[this.advancedFilterExpressionService.translate("advancedFilterBuilderAddButtonTooltip"),`${this.item.level+1}`]))}afterAdd(){}};ee([(0,H.Autowired)("beans")],pe.prototype,"beans",2),ee([(0,H.Autowired)("advancedFilterExpressionService")],pe.prototype,"advancedFilterExpressionService",2),ee([(0,H.RefSelector)("eItem")],pe.prototype,"eItem",2),ee([H.PostConstruct],pe.prototype,"postConstruct",1);var ge=class extends P.Component{constructor(){super('\n            <div role="presentation" class="ag-advanced-filter-builder" tabindex="-1">\n                <div role="presentation" class="ag-advanced-filter-builder-list" ref="eList"></div>\n                <div role="presentation" class="ag-advanced-filter-builder-button-panel">\n                    <button class="ag-button ag-standard-button ag-advanced-filter-builder-apply-button" ref="eApplyFilterButton"></button>\n                    <button class="ag-button ag-standard-button ag-advanced-filter-builder-cancel-button" ref="eCancelFilterButton"></button>\n                </div>\n            </div>'),this.validationMessage=null}postConstruct(){var e;const{showMoveButtons:t}=null!=(e=this.gos.get("advancedFilterBuilderParams"))?e:{};this.showMove=!!t,this.addManagedPropertyListener("advancedFilterBuilderParams",({currentValue:e})=>{this.showMove=!!(null==e?void 0:e.showMoveButtons),this.refreshList(!1)}),this.filterModel=this.setupFilterModel(),this.setupVirtualList(),this.dragFeature=this.createManagedBean(new se(this,this.virtualList)),this.setupButtons()}refresh(){let e=this.virtualList.getLastFocusedRow();this.setupFilterModel(),this.validateItems(),this.refreshList(!1),null!=e&&(this.virtualList.getComponentAt(e)||(e=0),this.virtualList.focusRow(e))}getNumItems(){return this.items.length}moveItem(e,t){t&&e&&this.moveItemToIndex(e,t.rowIndex,t.position)}afterGuiAttached(){this.virtualList.focusRow(0)}setupVirtualList(){this.virtualList=this.createManagedBean(new P.VirtualList({cssIdentifier:"advanced-filter-builder",ariaRole:"tree",listName:this.advancedFilterExpressionService.translate("ariaAdvancedFilterBuilderList")})),this.virtualList.setComponentCreator(this.createItemComponent.bind(this)),this.virtualList.setComponentUpdater(this.updateItemComponent.bind(this)),this.virtualList.setRowHeight(40),this.eList.appendChild(this.virtualList.getGui()),this.virtualList.setModel({getRowCount:()=>this.items.length,getRow:e=>this.items[e],areRowsEqual:(e,t)=>e===t}),this.buildList(),this.virtualList.refresh()}setupButtons(){this.eApplyFilterButton.innerText=this.advancedFilterExpressionService.translate("advancedFilterBuilderApply"),this.activateTabIndex([this.eApplyFilterButton]),this.addManagedListener(this.eApplyFilterButton,"click",()=>{this.advancedFilterService.setModel(this.filterModel),this.filterManager.onFilterChanged({source:"advancedFilter"}),this.close()}),this.validationTooltipFeature=this.createManagedBean(new P.TooltipFeature({getGui:()=>this.eApplyFilterButton,getLocation:()=>"advancedFilter",getTooltipValue:()=>this.validationMessage,getTooltipShowDelayOverride:()=>1e3})),this.validate(),this.addManagedListener(this.eApplyFilterButton,"mouseenter",()=>this.addOrRemoveCssClass("ag-advanced-filter-builder-validation",!0)),this.addManagedListener(this.eApplyFilterButton,"mouseleave",()=>this.addOrRemoveCssClass("ag-advanced-filter-builder-validation",!1)),this.eCancelFilterButton.innerText=this.advancedFilterExpressionService.translate("advancedFilterBuilderCancel"),this.activateTabIndex([this.eCancelFilterButton]),this.addManagedListener(this.eCancelFilterButton,"click",()=>this.close())}removeItemFromParent(e){const t=e.parent.conditions.indexOf(e.filterModel);return e.parent.conditions.splice(t,1),t}moveItemToIndex(e,t,i){var n;const s=this.items[t],r="join"===(null==(n=s.filterModel)?void 0:n.filterType)&&"bottom"===i,o=r?s.filterModel:s.parent;if(!o)return;if(this.isChildOrSelf(o,e.filterModel)||s===e)return;let a;this.removeItemFromParent(e),r?a=0:(a=o.conditions.indexOf(s.filterModel),-1===a?a=o.conditions.length:"bottom"===i&&(a+=1)),o.conditions.splice(a,0,e.filterModel),this.refreshList(!1)}isChildOrSelf(e,t){return e===t||"join"===t.filterType&&t.conditions.some(t=>this.isChildOrSelf(e,t))}setupFilterModel(){const e=this.formatFilterModel(this.advancedFilterService.getModel());return this.stringifiedModel=JSON.stringify(e),e}formatFilterModel(e){return"join"!==(e=null!=e?e:{filterType:"join",type:"AND",conditions:[]}).filterType&&(e={filterType:"join",type:"AND",conditions:[e]}),e}buildList(){const e=(t,i,n,s)=>{i.push({filterModel:t,level:n,parent:s,valid:!0,showMove:this.showMove}),"join"===t.filterType&&(t.conditions.forEach(s=>e(s,i,n+1,t)),0===n&&i.push({filterModel:null,level:n+1,parent:t,valid:!0}))};this.items=[],e(this.filterModel,this.items,0)}refreshList(e){if(!e){const e=[];this.items.forEach(t=>{t.valid||e.push(t.filterModel)}),this.buildList(),e.length&&this.items.forEach(t=>{t.filterModel&&e.includes(t.filterModel)&&(t.valid=!1)})}this.virtualList.refresh(e),this.validate()}updateItemComponent(e,t){const i=this.items.indexOf(e),n=(e,t)=>{const i=this.items.find(t=>t.filterModel===e),s=null==i?void 0:i.parent;if(s){const{conditions:i}=s;n(s,t),t.push(i[i.length-1]===e)}},s=[],{filterModel:r}=e;r&&(n(r,s),s[0]=!1);const o="join"===(null==r?void 0:r.filterType)&&!!r.conditions.length;t.setState({disableMoveUp:1===i,disableMoveDown:!this.canMoveDown(e,i),treeLines:s,showStartTreeLine:o})}createItemComponent(e,t){const i=this.createBean(e.filterModel?new de(e,this.dragFeature,t):new pe(e,t));return i.addManagedListener(i,ae.EVENT_REMOVED,({item:e})=>this.removeItem(e)),i.addManagedListener(i,ae.EVENT_VALUE_CHANGED,()=>this.validate()),i.addManagedListener(i,ae.EVENT_ADDED,({item:e,isJoin:t})=>this.addItem(e,t)),i.addManagedListener(i,ae.EVENT_MOVED,({item:e,backwards:t})=>this.moveItemUpDown(e,t)),i instanceof de&&this.updateItemComponent(e,i),i}addItem(e,t){var i;const{parent:n,level:s,filterModel:r}=e,o="join"===(null==r?void 0:r.filterType),a=t?{filterType:"join",type:"AND",conditions:[]}:{},l=o?r:n;let c=o?0:l.conditions.indexOf(r);c>=0?(o||(c+=1),l.conditions.splice(c,0,a)):l.conditions.push(a);let h=this.items.indexOf(e);const u=h>=0;if(u){e.filterModel&&h++;const i=[{filterModel:a,level:o?s+1:s,parent:l,valid:t,showMove:this.showMove}];this.items.splice(h,0,...i)}this.refreshList(u),u&&(null==(i=this.virtualList.getComponentAt(h))||i.afterAdd())}removeItem(e){var t;const i=e.parent,{filterModel:n}=e,s=i.conditions.indexOf(n);i.conditions.splice(s,1);const r="join"===(null==(t=e.filterModel)?void 0:t.filterType),o=this.items.indexOf(e),a=!r&&o>=0;a&&this.items.splice(o,1),this.refreshList(a),o>=0&&this.virtualList.focusRow(o)}moveItemUpDown(e,t){const i=this.items.indexOf(e),n=t?i-1:i+1;if(0===n||!t&&!this.canMoveDown(e,i))return;const s=this.items[n],r=this.removeItemFromParent(e),{level:o,filterModel:a,parent:l}=e,{level:c,filterModel:h,parent:u}=s;if(t)if(c===o&&"join"===h.filterType)h.conditions.push(a);else if(c<=o){const e=u.conditions.indexOf(h);u.conditions.splice(e,0,a)}else l.conditions[r-1].conditions.push(a);else if(c===o)if("join"===h.filterType)h.conditions.splice(0,0,a);else{const e=u.conditions.indexOf(h);u.conditions.splice(e+1,0,a)}else if(r<l.conditions.length)l.conditions.splice(r+1,0,a);else{const e=this.items.find(e=>e.filterModel===l),t=e.parent.conditions.indexOf(e.filterModel)+1;e.parent.conditions.splice(t,0,a)}this.refreshList(!1);const d=this.items.findIndex(({filterModel:e})=>e===a);if(d>=0){const e=this.virtualList.getComponentAt(d);e instanceof de&&e.focusMoveButton(t)}}canMoveDown(e,t){return!(1===e.level&&t===this.items.length-2||1===e.level&&e.parent.conditions[e.parent.conditions.length-1]===e.filterModel)}close(){this.advancedFilterService.getCtrl().toggleFilterBuilder("ui")}validate(){let e=!this.items.every(({valid:e})=>e);e?this.validationMessage=this.advancedFilterExpressionService.translate("advancedFilterBuilderValidationIncomplete"):(e=JSON.stringify(this.filterModel)===this.stringifiedModel,this.validationMessage=e?this.advancedFilterExpressionService.translate("advancedFilterBuilderValidationAlreadyApplied"):null),P._.setDisabled(this.eApplyFilterButton,e),this.validationTooltipFeature.refreshToolTip()}validateItems(){const e=e=>{e.type=void 0},t=e=>{delete e.filter};this.items.forEach(i=>{if(!i.valid||!i.filterModel||"join"===i.filterModel.filterType)return;const{filterModel:n}=i,{colId:s}=n,r=this.advancedFilterExpressionService.getColumnAutocompleteEntries().find(({key:e})=>e===s),o=this.advancedFilterExpressionService.getColumnDetails(n.colId);if(!r||!o.column)return i.valid=!1,n.colId=void 0,e(n),void t(n);const a=this.advancedFilterExpressionService.getDataTypeExpressionOperator(o.baseCellDataType).operators[n.type];if(!a)return i.valid=!1,e(n),void t(n);a.numOperands>0&&!P._.exists(n.filter)&&(i.valid=!1)})}};ee([(0,P.RefSelector)("eList")],ge.prototype,"eList",2),ee([(0,P.RefSelector)("eApplyFilterButton")],ge.prototype,"eApplyFilterButton",2),ee([(0,P.RefSelector)("eCancelFilterButton")],ge.prototype,"eCancelFilterButton",2),ee([(0,P.Autowired)("filterManager")],ge.prototype,"filterManager",2),ee([(0,P.Autowired)("advancedFilterService")],ge.prototype,"advancedFilterService",2),ee([(0,P.Autowired)("advancedFilterExpressionService")],ge.prototype,"advancedFilterExpressionService",2),ee([(0,P.Autowired)("beans")],ge.prototype,"beans",2),ee([P.PostConstruct],ge.prototype,"postConstruct",1);var fe=class e extends R.BeanStub{constructor(e){super(),this.enabled=e}postConstruct(){this.hasAdvancedFilterParent=!!this.gos.get("advancedFilterParent"),this.ctrlsService.whenReady(()=>this.setAdvancedFilterComp()),this.addManagedListener(this.eventService,R.Events.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,({enabled:e})=>this.onEnabledChanged(e)),this.addManagedPropertyListener("advancedFilterParent",()=>this.updateComps()),this.addDestroyFunc(()=>{this.destroyAdvancedFilterComp(),this.destroyBean(this.eBuilderComp),this.eBuilderDialog&&this.eBuilderDialog.isAlive()&&this.destroyBean(this.eBuilderDialog)})}setupHeaderComp(e){this.eHeaderComp=this.createManagedBean(new te(this.enabled&&!this.hasAdvancedFilterParent)),e.insertAdjacentElement("beforebegin",this.eHeaderComp.getGui())}focusHeaderComp(){return!!this.eHeaderComp&&(this.eHeaderComp.getFocusableElement().focus(),!0)}refreshComp(){var e,t;null==(e=this.eFilterComp)||e.refresh(),null==(t=this.eHeaderComp)||t.refresh()}refreshBuilderComp(){var e;null==(e=this.eBuilderComp)||e.refresh()}getHeaderHeight(){var e,t;return null!=(t=null==(e=this.eHeaderComp)?void 0:e.getHeight())?t:0}setInputDisabled(e){var t,i;null==(t=this.eFilterComp)||t.setInputDisabled(e),null==(i=this.eHeaderComp)||i.setInputDisabled(e)}toggleFilterBuilder(t,i){if(i&&this.eBuilderDialog||!1===i&&!this.eBuilderDialog)return;if(this.eBuilderDialog)return this.builderDestroySource=t,void this.destroyBean(this.eBuilderDialog);this.setInputDisabled(!0);const{width:n,height:s,minWidth:r}=this.getBuilderDialogSize();this.eBuilderComp=this.createBean(new ge),this.eBuilderDialog=this.createBean(new R.AgDialog({title:this.advancedFilterExpressionService.translate("advancedFilterBuilderTitle"),component:this.eBuilderComp,width:n,height:s,resizable:!0,movable:!0,maximizable:!0,centered:!0,closable:!0,minWidth:r,afterGuiAttached:()=>{var e;return null==(e=this.eBuilderComp)?void 0:e.afterGuiAttached()}})),this.dispatchFilterBuilderVisibleChangedEvent(t,!0),this.eBuilderDialog.addEventListener(R.AgDialog.EVENT_DESTROYED,()=>{var t;this.destroyBean(this.eBuilderComp),this.eBuilderComp=void 0,this.eBuilderDialog=void 0,this.setInputDisabled(!1),this.dispatchEvent({type:e.EVENT_BUILDER_CLOSED}),this.dispatchFilterBuilderVisibleChangedEvent(null!=(t=this.builderDestroySource)?t:"ui",!1),this.builderDestroySource=void 0})}dispatchFilterBuilderVisibleChangedEvent(e,t){const i={type:R.Events.EVENT_ADVANCED_FILTER_BUILDER_VISIBLE_CHANGED,source:e,visible:t};this.eventService.dispatchEvent(i)}getBuilderDialogSize(){var e,t;const i=null!=(t=null==(e=this.gos.get("advancedFilterBuilderParams"))?void 0:e.minWidth)?t:500,n=this.popupService.getPopupParent(),s=Math.round(R._.getAbsoluteWidth(n))-2,r=Math.round(.75*R._.getAbsoluteHeight(n))-2;return{width:Math.min(Math.max(600,i),s),height:Math.min(600,r),minWidth:i}}onEnabledChanged(e){this.enabled=e,this.updateComps()}updateComps(){this.setAdvancedFilterComp(),this.setHeaderCompEnabled(),this.eventService.dispatchEvent({type:R.Events.EVENT_HEADER_HEIGHT_CHANGED})}setAdvancedFilterComp(){if(this.destroyAdvancedFilterComp(),!this.enabled)return;const e=this.gos.get("advancedFilterParent");if(this.hasAdvancedFilterParent=!!e,e){const t=this.createBean(new ye),i=t.getGui(),{allThemes:n}=this.environment.getTheme();n.length&&i.classList.add(...n),i.classList.add(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr"),e.appendChild(i),this.eFilterComp=t}}setHeaderCompEnabled(){var e;null==(e=this.eHeaderComp)||e.setEnabled(this.enabled&&!this.hasAdvancedFilterParent)}destroyAdvancedFilterComp(){this.eFilterComp&&(R._.removeFromParent(this.eFilterComp.getGui()),this.destroyBean(this.eFilterComp))}};fe.EVENT_BUILDER_CLOSED="advancedFilterBuilderClosed",ee([(0,R.Autowired)("focusService")],fe.prototype,"focusService",2),ee([(0,R.Autowired)("ctrlsService")],fe.prototype,"ctrlsService",2),ee([(0,R.Autowired)("popupService")],fe.prototype,"popupService",2),ee([(0,R.Autowired)("advancedFilterExpressionService")],fe.prototype,"advancedFilterExpressionService",2),ee([R.PostConstruct],fe.prototype,"postConstruct",1);var me=fe,ye=class extends I.Component{constructor(){super('\n            <div class="ag-advanced-filter" role="presentation" tabindex="-1">\n                <ag-autocomplete ref="eAutocomplete"></ag-autocomplete>\n                <button class="ag-button ag-standard-button ag-advanced-filter-apply-button" ref="eApplyFilterButton"></button>\n                <button class="ag-advanced-filter-builder-button" ref="eBuilderFilterButton">\n                    <span ref="eBuilderFilterButtonIcon" aria-hidden="true"></span>\n                    <span class="ag-advanced-filter-builder-button-label" ref="eBuilderFilterButtonLabel"></span>\n                </button>\n            </div>'),this.expressionParser=null,this.isApplyDisabled=!0,this.builderOpen=!1}postConstruct(){this.eAutocomplete.setListGenerator((e,t)=>this.generateAutocompleteListParams(t)).setValidator(()=>this.validateValue()).setForceLastSelection((e,t)=>this.forceLastSelection(e,t)).setInputAriaLabel(this.advancedFilterExpressionService.translate("ariaAdvancedFilterInput")).setListAriaLabel(this.advancedFilterExpressionService.translate("ariaLabelAdvancedFilterAutocomplete")),this.refresh(),this.addManagedListener(this.eAutocomplete,I.AgAutocomplete.EVENT_VALUE_CHANGED,({value:e})=>this.onValueChanged(e)),this.addManagedListener(this.eAutocomplete,I.AgAutocomplete.EVENT_VALUE_CONFIRMED,({isValid:e})=>this.onValueConfirmed(e)),this.addManagedListener(this.eAutocomplete,I.AgAutocomplete.EVENT_OPTION_SELECTED,({position:e,updateEntry:t,autocompleteType:i})=>this.onOptionSelected(e,t,i)),this.addManagedListener(this.eAutocomplete,I.AgAutocomplete.EVENT_VALID_CHANGED,({isValid:e,validationMessage:t})=>this.onValidChanged(e,t)),this.setupApplyButton(),this.setupBuilderButton()}refresh(){const e=this.advancedFilterService.getExpressionDisplayValue();this.eAutocomplete.setValue({value:null!=e?e:"",position:null==e?void 0:e.length,updateListOnlyIfOpen:!0})}setInputDisabled(e){this.eAutocomplete.setInputDisabled(e),I._.setDisabled(this.eApplyFilterButton,e||this.isApplyDisabled)}getTooltipParams(){const e=super.getTooltipParams();return e.location="advancedFilter",e}setupApplyButton(){this.eApplyFilterButton.innerText=this.advancedFilterExpressionService.translate("advancedFilterApply"),this.activateTabIndex([this.eApplyFilterButton]),this.addManagedListener(this.eApplyFilterButton,"click",()=>this.onValueConfirmed(this.eAutocomplete.isValid())),I._.setDisabled(this.eApplyFilterButton,this.isApplyDisabled)}setupBuilderButton(){this.eBuilderFilterButtonIcon.appendChild(I._.createIconNoSpan("advancedFilterBuilder",this.gos)),this.eBuilderFilterButtonLabel.innerText=this.advancedFilterExpressionService.translate("advancedFilterBuilder"),this.activateTabIndex([this.eBuilderFilterButton]),this.addManagedListener(this.eBuilderFilterButton,"click",()=>this.openBuilder()),this.addManagedListener(this.advancedFilterService.getCtrl(),me.EVENT_BUILDER_CLOSED,()=>this.closeBuilder())}onValueChanged(e){var t;e=I._.makeNull(e),this.advancedFilterService.setExpressionDisplayValue(e),this.expressionParser=this.advancedFilterService.createExpressionParser(e);const i=null==(t=this.expressionParser)?void 0:t.parseExpression();i&&i!==e&&this.eAutocomplete.setValue({value:i,silent:!0,restoreFocus:!0})}onValueConfirmed(e){e&&!this.isApplyDisabled&&(I._.setDisabled(this.eApplyFilterButton,!0),this.advancedFilterService.applyExpression(),this.filterManager.onFilterChanged({source:"advancedFilter"}))}onOptionSelected(e,t,i){const{updatedValue:n,updatedPosition:s,hideAutocomplete:r}=this.updateExpression(e,t,i);this.eAutocomplete.setValue({value:n,position:s,updateListOnlyIfOpen:r,restoreFocus:!0})}validateValue(){var e,t,i;return(null==(e=this.expressionParser)?void 0:e.isValid())?null:null!=(i=null==(t=this.expressionParser)?void 0:t.getValidationMessage())?i:null}onValidChanged(e,t){this.isApplyDisabled=!e||this.advancedFilterService.isCurrentExpressionApplied(),I._.setDisabled(this.eApplyFilterButton,this.isApplyDisabled),this.setTooltip({newTooltipText:t,showDelayOverride:1e3})}generateAutocompleteListParams(e){return this.expressionParser?this.expressionParser.getAutocompleteListParams(e):this.advancedFilterExpressionService.getDefaultAutocompleteListParams("")}updateExpression(e,t,i){var n,s;return this.advancedFilterExpressionService.updateAutocompleteCache(t,i),null!=(s=null==(n=this.expressionParser)?void 0:n.updateExpression(e,t,i))?s:this.advancedFilterService.getDefaultExpression(t)}forceLastSelection({key:e,displayValue:t},i){return!!i.toLocaleLowerCase().match(`^${(null!=t?t:e).toLocaleLowerCase()}\\s*$`)}openBuilder(){this.builderOpen||(this.builderOpen=!0,I._.setDisabled(this.eBuilderFilterButton,!0),this.advancedFilterService.getCtrl().toggleFilterBuilder("ui"))}closeBuilder(){this.builderOpen&&(this.builderOpen=!1,I._.setDisabled(this.eBuilderFilterButton,!1),this.eBuilderFilterButton.focus())}};ee([(0,I.RefSelector)("eAutocomplete")],ye.prototype,"eAutocomplete",2),ee([(0,I.RefSelector)("eApplyFilterButton")],ye.prototype,"eApplyFilterButton",2),ee([(0,I.RefSelector)("eBuilderFilterButton")],ye.prototype,"eBuilderFilterButton",2),ee([(0,I.RefSelector)("eBuilderFilterButtonIcon")],ye.prototype,"eBuilderFilterButtonIcon",2),ee([(0,I.RefSelector)("eBuilderFilterButtonLabel")],ye.prototype,"eBuilderFilterButtonLabel",2),ee([(0,I.Autowired)("advancedFilterService")],ye.prototype,"advancedFilterService",2),ee([(0,I.Autowired)("advancedFilterExpressionService")],ye.prototype,"advancedFilterExpressionService",2),ee([(0,I.Autowired)("filterManager")],ye.prototype,"filterManager",2),ee([I.PostConstruct],ye.prototype,"postConstruct",1);var ve={ariaAdvancedFilterBuilderItem:e=>`${e[0]}. Level ${e[1]}. Press ENTER to edit.`,ariaAdvancedFilterBuilderItemValidation:e=>`${e[0]}. Level ${e[1]}. ${e[2]} Press ENTER to edit.`,ariaAdvancedFilterBuilderList:"Advanced Filter Builder List",ariaAdvancedFilterBuilderFilterItem:"Filter Condition",ariaAdvancedFilterBuilderGroupItem:"Filter Group",ariaAdvancedFilterBuilderColumn:"Column",ariaAdvancedFilterBuilderOption:"Option",ariaAdvancedFilterBuilderValue:"Value",ariaAdvancedFilterBuilderJoinOperator:"Join Operator",ariaAdvancedFilterInput:"Advanced Filter Input",ariaLabelAdvancedFilterAutocomplete:"Advanced Filter Autocomplete",advancedFilterContains:"contains",advancedFilterNotContains:"does not contain",advancedFilterTextEquals:"equals",advancedFilterTextNotEqual:"does not equal",advancedFilterStartsWith:"begins with",advancedFilterEndsWith:"ends with",advancedFilterBlank:"is blank",advancedFilterNotBlank:"is not blank",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"is true",advancedFilterFalse:"is false",advancedFilterAnd:"AND",advancedFilterOr:"OR",advancedFilterApply:"Apply",advancedFilterBuilder:"Builder",advancedFilterValidationMissingColumn:"Column is missing",advancedFilterValidationMissingOption:"Option is missing",advancedFilterValidationMissingValue:"Value is missing",advancedFilterValidationInvalidColumn:"Column not found",advancedFilterValidationInvalidOption:"Option not found",advancedFilterValidationMissingQuote:"Value is missing an end quote",advancedFilterValidationNotANumber:"Value is not a number",advancedFilterValidationInvalidDate:"Value is not a valid date",advancedFilterValidationMissingCondition:"Condition is missing",advancedFilterValidationJoinOperatorMismatch:"Join operators within a condition must be the same",advancedFilterValidationInvalidJoinOperator:"Join operator not found",advancedFilterValidationMissingEndBracket:"Missing end bracket",advancedFilterValidationExtraEndBracket:"Too many end brackets",advancedFilterValidationMessage:e=>`Expression has an error. ${e[0]} - ${e[1]}.`,advancedFilterValidationMessageAtEnd:e=>`Expression has an error. ${e[0]} at end of expression.`,advancedFilterBuilderTitle:"Advanced Filter",advancedFilterBuilderApply:"Apply",advancedFilterBuilderCancel:"Cancel",advancedFilterBuilderAddButtonTooltip:"Add Filter or Group",advancedFilterBuilderRemoveButtonTooltip:"Remove",advancedFilterBuilderMoveUpButtonTooltip:"Move Up",advancedFilterBuilderMoveDownButtonTooltip:"Move Down",advancedFilterBuilderAddJoin:"Add Group",advancedFilterBuilderAddCondition:"Add Filter",advancedFilterBuilderSelectColumn:"Select a column",advancedFilterBuilderSelectOption:"Select an option",advancedFilterBuilderEnterValue:"Enter a value...",advancedFilterBuilderValidationAlreadyApplied:"Current filter already applied.",advancedFilterBuilderValidationIncomplete:"Not all conditions are complete.",advancedFilterBuilderValidationSelectColumn:"Must select a column.",advancedFilterBuilderValidationSelectOption:"Must select an option.",advancedFilterBuilderValidationEnterValue:"Must enter a value."};function be(e,t,i){if(!e)return"";const n=i-t;return n?e.slice(0,e.length-n):e}function Ce(e,t,i,n,s,r,o){const a=i+(!e.length||o?0:1);let l=0;return s&&(" "===e[a]?l=1:(n+=" ",r&&(n+='"'))),{updatedValue:e.slice(0,t)+n+e.slice(a),updatedPosition:t+n.length+l}}function we(e,t,i,n){let s=t,r=!1;for(;s<e.length;){const t=e[s];if("("===t){n&&" "===e[s-1]?r=!0:s-=1;break}if(" "===t||i&&")"===t){s-=1;break}s++}return{endPosition:s,isEmpty:r}}function Se(e,t,i,n){i!==t&&(e.expression=Ce(e.expression,n-t.length+1,n,i).updatedValue)}var xe=class{constructor(e,t){this.params=e,this.startPosition=t,this.type="column",this.valid=!0,this.hasStartChar=!1,this.hasEndChar=!1,this.colName=""}parse(e,t){if(e!==Me.COL_START_CHAR||this.colName)if(e===Me.COL_END_CHAR&&this.hasStartChar){if(this.parseColumn(!1,t))return this.hasEndChar=!0,!1;this.colName+=e}else this.colName+=e;else this.hasStartChar=!0}getDisplayValue(){return(this.hasStartChar?Me.COL_START_CHAR:"")+this.colName+(this.hasEndChar?Me.COL_END_CHAR:"")}getColId(){return this.colId}complete(e){this.parseColumn(!0,e)}getValidationError(){var e;return this.valid?null:{message:this.params.advancedFilterExpressionService.translate("advancedFilterValidationInvalidColumn"),startPosition:this.startPosition,endPosition:null!=(e=this.endPosition)?e:this.params.expression.length-1}}parseColumn(e,t){var i;this.endPosition=t;const n=this.params.advancedFilterExpressionService.getColId(this.colName);return n&&this.hasStartChar&&(this.colId=n.colId,Se(this.params,this.colName,n.columnName,t-1),this.colName=n.columnName,this.column=this.params.columnModel.getPrimaryColumn(this.colId),this.column)?(this.baseCellDataType=null!=(i=this.params.dataTypeService.getBaseDataType(this.column))?i:"text",!0):(e&&(this.valid=!1),this.baseCellDataType="text",!1)}},Ee=class{constructor(e,t,i){this.params=e,this.startPosition=t,this.baseCellDataType=i,this.type="operator",this.valid=!0,this.expectedNumOperands=0,this.operator=""}parse(e,t){if(" "===e||")"===e){if(this.parseOperator(!1,t-1))return!0;this.operator+=e}else this.operator+=e}complete(e){this.parseOperator(!0,e)}getValidationError(){var e;return this.valid?null:{message:this.params.advancedFilterExpressionService.translate("advancedFilterValidationInvalidOption"),startPosition:this.startPosition,endPosition:null!=(e=this.endPosition)?e:this.params.expression.length-1}}getDisplayValue(){return this.operator}getOperatorKey(){return this.parsedOperator}parseOperator(e,t){const i=this.params.advancedFilterExpressionService.getDataTypeExpressionOperator(this.baseCellDataType),n=i.findOperator(this.operator);if(this.endPosition=t,n){this.parsedOperator=n;const e=i.operators[n];this.expectedNumOperands=e.numOperands;const s=e.displayValue;return Se(this.params,this.operator,s,t),this.operator=s,!0}return!e&&null===n||(this.valid=!1),!1}},Ae=class{constructor(e,t,i,n){this.params=e,this.startPosition=t,this.baseCellDataType=i,this.column=n,this.type="operand",this.valid=!0,this.operand="",this.validationMessage=null}parse(e,t){if(" "===e){if(!this.quotes)return this.parseOperand(!1,t),!0;this.operand+=e}else if(")"===e){if("number"===this.baseCellDataType||!this.quotes)return this.parseOperand(!1,t-1),!0;this.operand+=e}else if(this.operand||this.quotes||"'"!==e&&'"'!==e){if(this.quotes&&e===this.quotes)return this.parseOperand(!1,t),!1;this.operand+=e}else this.quotes=e}complete(e){this.parseOperand(!0,e)}getValidationError(){var e;return this.validationMessage?{message:this.validationMessage,startPosition:this.startPosition,endPosition:null!=(e=this.endPosition)?e:this.params.expression.length-1}:null}getRawValue(){return this.operand}getModelValue(){return this.modelValue}parseOperand(e,t){const{advancedFilterExpressionService:i}=this.params;if(this.endPosition=t,this.modelValue=this.operand,e&&this.quotes)this.valid=!1,this.validationMessage=i.translate("advancedFilterValidationMissingQuote");else if(""===this.modelValue)this.valid=!1,this.validationMessage=i.translate("advancedFilterValidationMissingValue");else{const e=i.getOperandModelValue(this.operand,this.baseCellDataType,this.column);switch(null!=e&&(this.modelValue=e),this.baseCellDataType){case"number":(this.quotes||isNaN(this.modelValue))&&(this.valid=!1,this.validationMessage=i.translate("advancedFilterValidationNotANumber"));break;case"date":case"dateString":null==e&&(this.valid=!1,this.validationMessage=i.translate("advancedFilterValidationInvalidDate"))}}}},Me=class{constructor(e,t){this.params=e,this.startPosition=t,this.isAwaiting=!0}parseExpression(){var e,t;let i=this.startPosition;const{expression:n}=this.params;for(;i<n.length;){const e=n[i];if(" "===e&&this.isAwaiting);else{if(this.isAwaiting=!1,!this.parser){let e;this.columnParser?this.operatorParser?(this.operandParser=new Ae(this.params,i,this.columnParser.baseCellDataType,this.columnParser.column),e=this.operandParser):(this.operatorParser=new Ee(this.params,i,this.columnParser.baseCellDataType),e=this.operatorParser):(this.columnParser=new xe(this.params,i),e=this.columnParser),this.parser=e}const t=this.parser.parse(e,i);if(null!=t){if(this.isComplete())return this.returnEndPosition(t?i-1:i,!0);this.parser=void 0,this.isAwaiting=!0}}i++}return null==(t=null==(e=this.parser)?void 0:e.complete)||t.call(e,i-1),this.returnEndPosition(i)}isValid(){return this.isComplete()&&this.columnParser.valid&&this.operatorParser.valid&&(!this.operandParser||this.operandParser.valid)}getValidationError(){var e,t,i,n,s;const r=null!=(s=null!=(i=null==(e=this.columnParser)?void 0:e.getValidationError())?i:null==(t=this.operatorParser)?void 0:t.getValidationError())?s:null==(n=this.operandParser)?void 0:n.getValidationError();if(r)return r;const o=this.params.expression.length;let a;return this.columnParser?this.operatorParser?this.operatorParser.expectedNumOperands&&!this.operandParser&&(a="advancedFilterValidationMissingValue"):a="advancedFilterValidationMissingOption":a="advancedFilterValidationMissingColumn",a?{message:this.params.advancedFilterExpressionService.translate(a),startPosition:o,endPosition:o}:null}getFunctionString(e){return this.getFunctionCommon(e,(e,t,i,n)=>`params.operators[${t}].evaluator(expressionProxy.getValue('${i.replace(/(['"])/,"\\$1")}', node), node, params.evaluatorParams[${n}]${null==e?"":`, params.operands[${e}]`})`)}getFunctionParsed(e){return this.getFunctionCommon(e,(e,t,i,n)=>(s,r,o)=>o.operators[t].evaluator(s.getValue(i,r),r,o.evaluatorParams[n],null==e?void 0:o.operands[e]))}getAutocompleteListParams(e){return this.isColumnPosition(e)?this.getColumnAutocompleteListParams(e):this.isOperatorPosition(e)?this.getOperatorAutocompleteListParams(e):this.isBeyondEndPosition(e)?void 0:{enabled:!1}}updateExpression(e,t,i){var n,s,r,o,a;const{expression:l}=this.params;if(this.isColumnPosition(e))return Ce(this.params.expression,this.startPosition,(null==(n=this.columnParser)?void 0:n.getColId())?this.columnParser.endPosition:we(l,e).endPosition,this.params.advancedFilterExpressionService.getColumnValue(t),!0);if(this.isOperatorPosition(e)){const n=this.getBaseCellDataTypeFromOperatorAutocompleteType(i),c=this.hasOperand(n,t.key),h=c&&this.doesOperandNeedQuotes(n);let u;if(null!=(null==(s=this.operatorParser)?void 0:s.startPosition)&&e<this.operatorParser.startPosition)u=Ce(l,e,e,null!=(r=t.displayValue)?r:t.key,c,h);else{let i,n=!1;if(null==(o=this.operatorParser)?void 0:o.getOperatorKey())i=this.operatorParser.endPosition;else{const{endPosition:t,isEmpty:s}=we(l,e,!0,!0);i=t,n=s}u=Ce(l,function(e,t,i){let n=t;for(;n<i&&" "===e[n];)n++;return n}(l,this.columnParser.endPosition+1,i),i,null!=(a=t.displayValue)?a:t.key,c,h,n)}return J(Q({},u),{hideAutocomplete:!c})}return null}getModel(){const e=this.columnParser.getColId(),t={filterType:this.columnParser.baseCellDataType,colId:e,type:this.operatorParser.getOperatorKey()};return this.operatorParser.expectedNumOperands&&(t.filter=this.operandParser.getModelValue()),t}getFunctionCommon(e,t){var i,n;const s=this.columnParser.getColId(),r=null==(i=this.operatorParser)?void 0:i.getOperatorKey(),{operators:o,evaluatorParams:a,operands:l}=e,c=this.params.advancedFilterExpressionService.getExpressionOperator(this.columnParser.baseCellDataType,r),h=this.addToListAndGetIndex(o,c),u=this.params.advancedFilterExpressionService.getExpressionEvaluatorParams(s),d=this.addToListAndGetIndex(a,u);return t(0===(null==(n=this.operatorParser)?void 0:n.expectedNumOperands)?void 0:this.addToListAndGetIndex(l,this.getOperandValue()),h,s,d)}getOperandValue(){let e=this.operandParser.getRawValue();const{baseCellDataType:t,column:i}=this.columnParser;switch(t){case"number":e=Number(e);break;case"date":case"dateString":e=this.params.valueService.parseValue(i,null,e,void 0)}return"dateString"===t?this.params.dataTypeService.getDateParserFunction(i)(e):e}isComplete(){return!(!this.operatorParser||!(!this.operatorParser.expectedNumOperands||this.operatorParser.expectedNumOperands&&this.operandParser))}isColumnPosition(e){return!this.columnParser||null==this.columnParser.endPosition||e<=this.columnParser.endPosition+1}isOperatorPosition(e){return!this.operatorParser||null==this.operatorParser.endPosition||e<=this.operatorParser.endPosition+1}isBeyondEndPosition(e){return this.isComplete()&&null!=this.endPosition&&e>this.endPosition+1&&this.endPosition+1<this.params.expression.length}returnEndPosition(e,t){return this.endPosition=t?e:e-1,e}getColumnAutocompleteListParams(e){return this.params.advancedFilterExpressionService.generateAutocompleteListParams(this.params.advancedFilterExpressionService.getColumnAutocompleteEntries(),"column",this.getColumnSearchString(e))}getColumnSearchString(e){var t,i,n,s,r;const o=null!=(i=null==(t=this.columnParser)?void 0:t.getDisplayValue())?i:"",a=be(o,e,null==(null==(n=this.columnParser)?void 0:n.endPosition)?this.params.expression.length:this.columnParser.endPosition+1),l=(null==(s=this.columnParser)?void 0:s.hasStartChar)&&a.length>0,c=(null==(r=this.columnParser)?void 0:r.hasEndChar)&&a.length===o.length+2;return l?a.slice(1,c?-1:void 0):a}getOperatorAutocompleteListParams(e){var t,i,n,s,r;const o=null==(t=this.columnParser)?void 0:t.column;if(!o)return{enabled:!1};const a=this.columnParser.baseCellDataType,l=null!=(null==(i=this.operatorParser)?void 0:i.startPosition)&&e<this.operatorParser.startPosition?"":be(null!=(s=null==(n=this.operatorParser)?void 0:n.getDisplayValue())?s:"",e,null==(null==(r=this.operatorParser)?void 0:r.endPosition)?this.params.expression.length:this.operatorParser.endPosition+1);return this.params.advancedFilterExpressionService.generateAutocompleteListParams(this.params.advancedFilterExpressionService.getOperatorAutocompleteEntries(o,a),`operator-${a}`,l)}getBaseCellDataTypeFromOperatorAutocompleteType(e){return null==e?void 0:e.replace("operator-","")}hasOperand(e,t){var i,n;return!e||!t||(null!=(n=null==(i=this.params.advancedFilterExpressionService.getExpressionOperator(e,t))?void 0:i.numOperands)?n:0)>0}doesOperandNeedQuotes(e){return"number"!==e}addToListAndGetIndex(e,t){const i=e.length;return e.push(t),i}};function Te(e,t,i){let n=!1;const s=e.toLocaleLowerCase(),r=s+" ",o=Object.entries(t).find(([e,t])=>{const o=i(t).toLocaleLowerCase();return o.startsWith(r)&&(n=!0),o===s});return o?o[0]:n?null:void 0}function De(e,t){return(null!=t?t:Object.keys(e)).map(t=>({key:t,displayValue:e[t].displayValue}))}Me.COL_START_CHAR="[",Me.COL_END_CHAR="]";var Ie=class{constructor(e){this.params=e,this.initOperators()}getEntries(e){return De(this.operators,e)}findOperator(e){return Te(e,this.operators,({displayValue:e})=>e)}initOperators(){const{translate:e}=this.params;this.operators={contains:{displayValue:e("advancedFilterContains"),evaluator:(e,t,i,n)=>this.evaluateExpression(e,t,i,n,!1,(e,t)=>e.includes(t)),numOperands:1},notContains:{displayValue:e("advancedFilterNotContains"),evaluator:(e,t,i,n)=>this.evaluateExpression(e,t,i,n,!0,(e,t)=>!e.includes(t)),numOperands:1},equals:{displayValue:e("advancedFilterTextEquals"),evaluator:(e,t,i,n)=>this.evaluateExpression(e,t,i,n,!1,(e,t)=>e===t),numOperands:1},notEqual:{displayValue:e("advancedFilterTextNotEqual"),evaluator:(e,t,i,n)=>this.evaluateExpression(e,t,i,n,!0,(e,t)=>e!=t),numOperands:1},startsWith:{displayValue:e("advancedFilterStartsWith"),evaluator:(e,t,i,n)=>this.evaluateExpression(e,t,i,n,!1,(e,t)=>e.startsWith(t)),numOperands:1},endsWith:{displayValue:e("advancedFilterEndsWith"),evaluator:(e,t,i,n)=>this.evaluateExpression(e,t,i,n,!1,(e,t)=>e.endsWith(t)),numOperands:1},blank:{displayValue:e("advancedFilterBlank"),evaluator:e=>null==e||"string"==typeof e&&0===e.trim().length,numOperands:0},notBlank:{displayValue:e("advancedFilterNotBlank"),evaluator:e=>null!=e&&("string"!=typeof e||e.trim().length>0),numOperands:0}}}evaluateExpression(e,t,i,n,s,r){return null==e?s:i.caseSensitive?r(i.valueConverter(e,t),n):r(i.valueConverter(e,t).toLocaleLowerCase(),n.toLocaleLowerCase())}},Re=class{constructor(e){this.params=e,this.initOperators()}getEntries(e){return De(this.operators,e)}findOperator(e){return Te(e,this.operators,({displayValue:e})=>e)}initOperators(){const{translate:e,equals:t}=this.params;this.operators={equals:{displayValue:e("advancedFilterEquals"),evaluator:(e,i,n,s)=>this.evaluateSingleOperandExpression(e,i,n,s,!!n.includeBlanksInEquals,t),numOperands:1},notEqual:{displayValue:e("advancedFilterNotEqual"),evaluator:(e,i,n,s)=>this.evaluateSingleOperandExpression(e,i,n,s,!!n.includeBlanksInEquals,(e,i)=>!t(e,i)),numOperands:1},greaterThan:{displayValue:e("advancedFilterGreaterThan"),evaluator:(e,t,i,n)=>this.evaluateSingleOperandExpression(e,t,i,n,!!i.includeBlanksInGreaterThan,(e,t)=>e>t),numOperands:1},greaterThanOrEqual:{displayValue:e("advancedFilterGreaterThanOrEqual"),evaluator:(e,t,i,n)=>this.evaluateSingleOperandExpression(e,t,i,n,!!i.includeBlanksInGreaterThan,(e,t)=>e>=t),numOperands:1},lessThan:{displayValue:e("advancedFilterLessThan"),evaluator:(e,t,i,n)=>this.evaluateSingleOperandExpression(e,t,i,n,!!i.includeBlanksInLessThan,(e,t)=>e<t),numOperands:1},lessThanOrEqual:{displayValue:e("advancedFilterLessThanOrEqual"),evaluator:(e,t,i,n)=>this.evaluateSingleOperandExpression(e,t,i,n,!!i.includeBlanksInLessThan,(e,t)=>e<=t),numOperands:1},blank:{displayValue:e("advancedFilterBlank"),evaluator:e=>null==e,numOperands:0},notBlank:{displayValue:e("advancedFilterNotBlank"),evaluator:e=>null!=e,numOperands:0}}}evaluateSingleOperandExpression(e,t,i,n,s,r){return null==e?s:r(i.valueConverter(e,t),n)}},ke=class{constructor(e){this.params=e,this.initOperators()}getEntries(e){return De(this.operators,e)}findOperator(e){return Te(e,this.operators,({displayValue:e})=>e)}initOperators(){const{translate:e}=this.params;this.operators={true:{displayValue:e("advancedFilterTrue"),evaluator:e=>!!e,numOperands:0},false:{displayValue:e("advancedFilterFalse"),evaluator:e=>!1===e,numOperands:0},blank:{displayValue:e("advancedFilterBlank"),evaluator:e=>null==e,numOperands:0},notBlank:{displayValue:e("advancedFilterNotBlank"),evaluator:e=>null!=e,numOperands:0}}}},Pe=class extends U.BeanStub{constructor(){super(...arguments),this.columnNameToIdMap={},this.columnAutocompleteEntries=null,this.expressionEvaluatorParams={}}postConstruct(){this.expressionJoinOperators=this.generateExpressionJoinOperators(),this.expressionOperators=this.generateExpressionOperators()}parseJoinOperator(e){var t;const{type:i}=e;return null!=(t=this.expressionJoinOperators[i])?t:i}getColumnDisplayValue(e){const{colId:t}=e,i=this.getColumnAutocompleteEntries().find(({key:e})=>e===t);let n;return i?(n=i.displayValue,this.columnNameToIdMap[n.toLocaleUpperCase()]={colId:t,columnName:n}):n=t,n}getOperatorDisplayValue(e){var t,i;return null!=(i=null==(t=this.getExpressionOperator(e.filterType,e.type))?void 0:t.displayValue)?i:e.type}getOperandModelValue(e,t,i){var n;switch(t){case"number":return U._.exists(e)?Number(e):null;case"date":return U._.serialiseDate(this.valueService.parseValue(i,null,e,void 0),!1);case"dateString":const t=this.valueService.parseValue(i,null,e,void 0);return U._.serialiseDate(null!=(n=this.dataTypeService.getDateParserFunction(i)(t))?n:null,!1)}return e}getOperandDisplayValue(e,t){var i,n;const{colId:s,filter:r}=e,o=this.columnModel.getPrimaryColumn(s);let a="";if(null!=r){let s;switch(e.filterType){case"number":s=null!=(i=U._.toStringOrNull(r))?i:"";break;case"date":const e=U._.parseDateTimeFromString(r);s=o?this.valueService.formatValue(o,null,e):null;break;case"dateString":const t=U._.parseDateTimeFromString(r),n=o?this.dataTypeService.getDateFormatterFunction(o)(null!=t?t:void 0):null;s=o?this.valueService.formatValue(o,null,n):null}"number"!==e.filterType&&(s=null!=(n=null!=s?s:U._.toStringOrNull(r))?n:"",t||(s=`"${s}"`)),a=t?s:` ${s}`}return a}parseColumnFilterModel(e){var t,i;return`[${null!=(t=this.getColumnDisplayValue(e))?t:""}] ${null!=(i=this.getOperatorDisplayValue(e))?i:""}${this.getOperandDisplayValue(e)}`}updateAutocompleteCache(e,t){if("column"===t){const{key:t,displayValue:i}=e;this.columnNameToIdMap[e.displayValue.toLocaleUpperCase()]={colId:t,columnName:i}}}translate(e,t){let i=ve[e];return"function"==typeof i&&(i=i(t)),this.localeService.getLocaleTextFunc()(e,i,t)}generateAutocompleteListParams(e,t,i){return{enabled:!0,type:t,searchString:i,entries:e}}getColumnAutocompleteEntries(){var e;if(this.columnAutocompleteEntries)return this.columnAutocompleteEntries;const t=null!=(e=this.columnModel.getAllPrimaryColumns())?e:[],i=[],n=this.gos.get("includeHiddenColumnsInAdvancedFilter");return t.forEach(e=>{e.getColDef().filter&&(n||e.isVisible()||e.isRowGroupActive())&&i.push({key:e.getColId(),displayValue:this.columnModel.getDisplayNameForColumn(e,"advancedFilter")})}),i.sort((e,t)=>{var i,n;const s=null!=(i=e.displayValue)?i:"",r=null!=(n=t.displayValue)?n:"";return s<r?-1:r>s?1:0}),i}getOperatorAutocompleteEntries(e,t){const i=this.getActiveOperators(e);return this.getDataTypeExpressionOperator(t).getEntries(i)}getJoinOperatorAutocompleteEntries(){return Object.entries(this.expressionJoinOperators).map(([e,t])=>({key:e,displayValue:t}))}getDefaultAutocompleteListParams(e){return this.generateAutocompleteListParams(this.getColumnAutocompleteEntries(),"column",e)}getDataTypeExpressionOperator(e){return this.expressionOperators[e]}getExpressionOperator(e,t){var i,n;return null==(n=null==(i=this.getDataTypeExpressionOperator(e))?void 0:i.operators)?void 0:n[t]}getExpressionJoinOperators(){return this.expressionJoinOperators}getColId(e){const t=e.toLocaleUpperCase(),i=this.columnNameToIdMap[t];if(i)return i;const n=this.getColumnAutocompleteEntries().find(({displayValue:e})=>e.toLocaleUpperCase()===t);if(n){const{key:e,displayValue:i}=n,s={colId:e,columnName:i};return this.columnNameToIdMap[t]=s,s}return null}getExpressionEvaluatorParams(e){let t=this.expressionEvaluatorParams[e];if(t)return t;const i=this.columnModel.getPrimaryColumn(e);if(!i)return{valueConverter:e=>e};switch(this.dataTypeService.getBaseDataType(i)){case"dateString":t={valueConverter:this.dataTypeService.getDateParserFunction(i)};break;case"object":t=i.getColDef().filterValueGetter?{valueConverter:e=>e}:{valueConverter:(e,t)=>{var n;return null!=(n=this.valueService.formatValue(i,t,e))?n:"function"==typeof e.toString?e.toString():""}};break;case"text":case void 0:t={valueConverter:e=>U._.toStringOrNull(e)};break;default:t={valueConverter:e=>e}}const{filterParams:n}=i.getColDef();return n&&["caseSensitive","includeBlanksInEquals","includeBlanksInLessThan","includeBlanksInGreaterThan"].forEach(e=>{const i=n[e];i&&(t[e]=i)}),this.expressionEvaluatorParams[e]=t,t}getColumnDetails(e){var t,i;const n=null!=(t=this.columnModel.getPrimaryColumn(e))?t:void 0;return{column:n,baseCellDataType:null!=(i=n?this.dataTypeService.getBaseDataType(n):void 0)?i:"text"}}generateExpressionOperators(){const e=(e,t)=>this.translate(e,t);return{text:new Ie({translate:e}),boolean:new ke({translate:e}),object:new Ie({translate:e}),number:new Re({translate:e,equals:(e,t)=>e===t}),date:new Re({translate:e,equals:(e,t)=>e.getTime()===t.getTime()}),dateString:new Re({translate:e,equals:(e,t)=>e.getTime()===t.getTime()})}}getColumnValue({displayValue:e}){return`${Me.COL_START_CHAR}${e}${Me.COL_END_CHAR}`}generateExpressionJoinOperators(){return{AND:this.translate("advancedFilterAnd"),OR:this.translate("advancedFilterOr")}}getActiveOperators(e){var t;const i=null==(t=e.getColDef().filterParams)?void 0:t.filterOptions;if(i)return i.every(e=>"string"==typeof e)?i:void 0}resetColumnCaches(){this.columnAutocompleteEntries=null,this.columnNameToIdMap={},this.expressionEvaluatorParams={}}};ee([(0,U.Autowired)("valueService")],Pe.prototype,"valueService",2),ee([(0,U.Autowired)("columnModel")],Pe.prototype,"columnModel",2),ee([(0,U.Autowired)("dataTypeService")],Pe.prototype,"dataTypeService",2),ee([U.PostConstruct],Pe.prototype,"postConstruct",1),Pe=ee([(0,U.Bean)("advancedFilterExpressionService")],Pe);var _e=class{constructor(e){this.params=e,this.operators=[],this.operatorStartPositions=[],this.operatorEndPositions=[],this.activeOperator=0,this.validationError=null}parseExpression(e){this.operators.push(""),this.operatorStartPositions.push(e),this.operatorEndPositions.push(void 0);const{expression:t}=this.params;for(;e<t.length;){const i=t[e];if(" "===i){if(this.parseOperator(e-1))return this.activeOperator++,e-1;this.operators[this.activeOperator]+=i}else this.operators[this.activeOperator]+=i;e++}return this.parseOperator(e-1),e}isValid(){return!(this.validationError||this.operators.length&&!this.parsedOperator)}getValidationError(){return this.validationError}getFunction(){return"OR"===this.parsedOperator?"||":"&&"}getModel(){return"OR"===this.parsedOperator?"OR":"AND"}getAutocompleteListParams(e,t){let i;if(null==t)i="";else{const n=this.operators[t],s=this.operatorEndPositions[t];i=be(n,e,null==s?this.params.expression.length:s+1)}let n=this.params.advancedFilterExpressionService.getJoinOperatorAutocompleteEntries();return(t||null==t&&this.activeOperator)&&(n=n.filter(({key:e})=>e===this.parsedOperator)),this.params.advancedFilterExpressionService.generateAutocompleteListParams(n,"join",i)}updateExpression(e,t,i){var n,s;let{expression:r}=this.params;const o=null!=(n=t.displayValue)?n:t.key;if(0===i)for(let e=this.operatorEndPositions.length-1;e>0;e--){const t=this.operatorEndPositions[e];null!=t&&(r=Ce(r,this.operatorStartPositions[e],t,o).updatedValue)}return Ce(r,this.operatorStartPositions.length>i?this.operatorStartPositions[i]:e,null!=(s=this.operatorEndPositions.length>i?this.operatorEndPositions[i]:void 0)?s:we(r,e,!0).endPosition,o,!0)}getNumOperators(){return this.operators.length}getLastOperatorEndPosition(){return this.operatorEndPositions[this.operatorEndPositions.length-1]}parseOperator(e){const t=this.operators.length>this.activeOperator?this.operators[this.activeOperator]:"",i=this.params.advancedFilterExpressionService.getExpressionJoinOperators(),n=Te(t,i,e=>e);if(n){this.operatorEndPositions[this.activeOperator]=e;const s=i[n];if(this.activeOperator){if(n!==this.parsedOperator)return this.validationError||(this.validationError={message:this.params.advancedFilterExpressionService.translate("advancedFilterValidationJoinOperatorMismatch"),startPosition:e-t.length+1,endPosition:e}),!1}else this.parsedOperator=n;return t!==s&&(Se(this.params,t,s,e),this.operators[this.activeOperator]=s),!0}return null!==n&&(this.validationError||(this.validationError={message:this.params.advancedFilterExpressionService.translate("advancedFilterValidationInvalidJoinOperator"),startPosition:e-t.length+1,endPosition:e}),!0)}},Le=class e{constructor(e,t){this.params=e,this.startPosition=t,this.expectingExpression=!0,this.expectingOperator=!1,this.expressionParsers=[],this.operatorParser=new _e(this.params),this.missingEndBracket=!1,this.extraEndBracket=!1}parseExpression(){let t=this.startPosition;const{expression:i}=this.params;for(;t<i.length;){const n=i[t];if("("!==n||this.expectingOperator){if(")"===n)return this.endPosition=t-1,0===this.startPosition&&(this.extraEndBracket=!0),t;if(" "===n);else if(this.expectingExpression){const e=new Me(this.params,t);t=e.parseExpression(),this.expressionParsers.push(e),this.expectingExpression=!1,this.expectingOperator=!0}else this.expectingOperator&&(t=this.operatorParser.parseExpression(t),this.expectingOperator=!1,this.expectingExpression=!0)}else{const i=new e(this.params,t+1);t=i.parseExpression(),this.expressionParsers.push(i),this.expectingExpression=!1,this.expectingOperator=!0}t++}return this.startPosition>0&&(this.missingEndBracket=!0),t}isValid(){return!this.missingEndBracket&&!this.extraEndBracket&&this.expressionParsers.length===this.operatorParser.getNumOperators()+1&&this.operatorParser.isValid()&&this.expressionParsers.every(e=>e.isValid())}getValidationError(){const e=this.operatorParser.getValidationError();for(let t=0;t<this.expressionParsers.length;t++){const i=this.expressionParsers[t].getValidationError();if(i)return e&&e.startPosition<i.startPosition?e:i}if(e)return e;if(this.extraEndBracket)return{message:this.params.advancedFilterExpressionService.translate("advancedFilterValidationExtraEndBracket"),startPosition:this.endPosition+1,endPosition:this.endPosition+1};let t;return this.expressionParsers.length===this.operatorParser.getNumOperators()?t="advancedFilterValidationMissingCondition":this.missingEndBracket&&(t="advancedFilterValidationMissingEndBracket"),t?{message:this.params.advancedFilterExpressionService.translate(t),startPosition:this.params.expression.length,endPosition:this.params.expression.length}:null}getFunctionString(e){const t=this.expressionParsers.length>1,i=this.expressionParsers.map(t=>t.getFunctionString(e)).join(` ${this.operatorParser.getFunction()} `);return t?`(${i})`:i}getFunctionParsed(e){const t=this.operatorParser.getFunction(),i=this.expressionParsers.map(t=>t.getFunctionParsed(e)),n="&&"===t?"every":"some";return(e,t,s)=>i[n](i=>i(e,t,s))}getAutocompleteListParams(e){if(null!=this.endPosition&&e>this.endPosition+1)return;if(!this.expressionParsers.length)return this.getColumnAutocompleteListParams();const t=this.getExpressionParserIndex(e);if(null==t)return"("===this.params.expression[e]?{enabled:!1}:this.getColumnAutocompleteListParams();const i=this.expressionParsers[t].getAutocompleteListParams(e);if(!i){if(t<this.expressionParsers.length-1)return this.operatorParser.getAutocompleteListParams(e,t);if(this.expressionParsers.length===this.operatorParser.getNumOperators()){const t=this.operatorParser.getLastOperatorEndPosition();return null==t||e<=t+1?this.operatorParser.getAutocompleteListParams(e,this.operatorParser.getNumOperators()-1):this.getColumnAutocompleteListParams()}return")"===this.params.expression[e-1]?{enabled:!1}:this.operatorParser.getAutocompleteListParams(e)}return i}updateExpression(e,t,i){var n;const s=this.params.expression,r=this.getExpressionParserIndex(e);if(null==r){const e="column"===i?this.params.advancedFilterExpressionService.getColumnValue(t):null!=(n=t.displayValue)?n:t.key;return Ce(s,this.startPosition,this.startPosition,e,!0)}const o=this.expressionParsers[r].updateExpression(e,t,i);return null==o?"column"===i?Ce(s,e,s.length-1,this.params.advancedFilterExpressionService.getColumnValue(t),!0):null!=this.endPosition&&e>this.endPosition+1?null:this.operatorParser.updateExpression(e,t,r):o}getModel(){return this.expressionParsers.length>1?{filterType:"join",type:this.operatorParser.getModel(),conditions:this.expressionParsers.map(e=>e.getModel())}:this.expressionParsers[0].getModel()}getColumnAutocompleteListParams(){return this.params.advancedFilterExpressionService.generateAutocompleteListParams(this.params.advancedFilterExpressionService.getColumnAutocompleteEntries(),"column","")}getExpressionParserIndex(e){let t;for(let i=0;i<this.expressionParsers.length&&!(this.expressionParsers[i].startPosition>e);i++)t=i;return t}},Ne=class{constructor(e){this.params=e,this.valid=!1}parseExpression(){this.joinExpressionParser=new Le(this.params,0);const e=this.joinExpressionParser.parseExpression();return this.valid=e>=this.params.expression.length-1&&this.joinExpressionParser.isValid(),this.params.expression}isValid(){return this.valid}getValidationMessage(){const e=this.joinExpressionParser.getValidationError();if(!e)return null;const{message:t,startPosition:i,endPosition:n}=e;return i<this.params.expression.length?this.params.advancedFilterExpressionService.translate("advancedFilterValidationMessage",[t,this.params.expression.slice(i,n+1).trim()]):this.params.advancedFilterExpressionService.translate("advancedFilterValidationMessageAtEnd",[t])}getFunctionString(){const e=this.createFunctionParams();return{functionString:`return ${this.joinExpressionParser.getFunctionString(e)};`,params:e}}getFunctionParsed(){const e=this.createFunctionParams();return{expressionFunction:this.joinExpressionParser.getFunctionParsed(e),params:e}}getAutocompleteListParams(e){var t;return null!=(t=this.joinExpressionParser.getAutocompleteListParams(e))?t:{enabled:!1}}updateExpression(e,t,i){return this.joinExpressionParser.updateExpression(e,t,i)}getModel(){return this.isValid()?this.joinExpressionParser.getModel():null}createFunctionParams(){return{operands:[],operators:[],evaluatorParams:[]}}},Oe=class extends z.BeanStub{constructor(){super(...arguments),this.appliedExpression=null,this.expression=null,this.isValid=!0}postConstruct(){this.setEnabled(this.gos.get("enableAdvancedFilter"),!0),this.ctrl=this.createManagedBean(new me(this.enabled)),this.expressionProxy={getValue:(e,t)=>{const i=this.columnModel.getPrimaryColumn(e);return i?this.valueService.getValue(i,t,!0):void 0}},this.addManagedPropertyListener("enableAdvancedFilter",e=>this.setEnabled(!!e.currentValue)),this.addManagedListener(this.eventService,z.Events.EVENT_NEW_COLUMNS_LOADED,e=>this.onNewColumnsLoaded(e)),this.addManagedPropertyListener("includeHiddenColumnsInAdvancedFilter",()=>this.updateValidity())}isEnabled(){return this.enabled}isFilterPresent(){return!!this.expressionFunction}doesFilterPass(e){return this.expressionFunction(this.expressionProxy,e,this.expressionParams)}getModel(){var e;const t=this.createExpressionParser(this.appliedExpression);return null==t||t.parseExpression(),null!=(e=null==t?void 0:t.getModel())?e:null}setModel(e){const t=(e,i)=>{if("join"===e.filterType){const n=this.advancedFilterExpressionService.parseJoinOperator(e),s=e.conditions.map(e=>t(e)).filter(e=>z._.exists(e)).join(` ${n} `);return i||e.conditions.length<=1?s:`(${s})`}return this.advancedFilterExpressionService.parseColumnFilterModel(e)},i=e?t(e,!0):null;this.setExpressionDisplayValue(i),this.applyExpression(),this.ctrl.refreshComp(),this.ctrl.refreshBuilderComp()}getExpressionDisplayValue(){return this.expression}setExpressionDisplayValue(e){this.expression=e}isCurrentExpressionApplied(){return this.appliedExpression===this.expression}createExpressionParser(e){return e?new Ne({expression:e,columnModel:this.columnModel,dataTypeService:this.dataTypeService,valueService:this.valueService,advancedFilterExpressionService:this.advancedFilterExpressionService}):null}getDefaultExpression(e){const t=this.advancedFilterExpressionService.getColumnValue(e)+" ";return{updatedValue:t,updatedPosition:t.length}}isHeaderActive(){return!this.gos.get("advancedFilterParent")}getCtrl(){return this.ctrl}setEnabled(e,t){const i=this.enabled,n=this.rowModel.getType(),s="clientSide"===n||"serverSide"===n;if(e&&!n&&z._.warnOnce("Advanced Filter is only supported with the Client-Side Row Model or Server-Side Row Model."),this.enabled=e&&s,!t&&this.enabled!==i){const e={type:z.Events.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,enabled:this.enabled};this.eventService.dispatchEvent(e)}}applyExpression(){const e=this.createExpressionParser(this.expression);null==e||e.parseExpression(),this.applyExpressionFromParser(e)}applyExpressionFromParser(e){if(this.isValid=!e||e.isValid(),!e||!this.isValid)return this.expressionFunction=null,this.expressionParams=null,void(this.appliedExpression=null);const{expressionFunction:t,params:i}=this.getFunction(e);this.expressionFunction=t,this.expressionParams=i,this.appliedExpression=this.expression}getFunction(e){if(this.gos.get("suppressAdvancedFilterEval"))return e.getFunctionParsed();{const{functionString:t,params:i}=e.getFunctionString();return{expressionFunction:new Function("expressionProxy","node","params",t),params:i}}}updateValidity(){this.advancedFilterExpressionService.resetColumnCaches();const e=this.createExpressionParser(this.expression);null==e||e.parseExpression();const t=(!e||e.isValid())!==this.isValid;return this.applyExpressionFromParser(e),this.ctrl.refreshComp(),this.ctrl.refreshBuilderComp(),t}onNewColumnsLoaded(e){if("gridInitializing"!==e.source||!this.dataTypeService.isPendingInference())return;this.ctrl.setInputDisabled(!0);const t=this.addManagedListener(this.eventService,z.Events.EVENT_DATA_TYPES_INFERRED,()=>{null==t||t(),this.ctrl.setInputDisabled(!1)})}};ee([(0,z.Autowired)("valueService")],Oe.prototype,"valueService",2),ee([(0,z.Autowired)("columnModel")],Oe.prototype,"columnModel",2),ee([(0,z.Autowired)("dataTypeService")],Oe.prototype,"dataTypeService",2),ee([(0,z.Autowired)("rowModel")],Oe.prototype,"rowModel",2),ee([(0,z.Autowired)("advancedFilterExpressionService")],Oe.prototype,"advancedFilterExpressionService",2),ee([z.PostConstruct],Oe.prototype,"postConstruct",1),Oe=ee([(0,z.Bean)("advancedFilterService")],Oe);var Fe={version:"31.3.4",moduleName:y.ModuleNames.AdvancedFilterModule,beans:[Oe,Pe],agStackComponents:[{componentName:"agAdvancedFilter",componentClass:ye}],dependantModules:[D]},Ge={};l(Ge,{GridChartsModule:()=>Ja,__FORCE_MODULE_DETECTION_AG_GRID_CORE_EXT:()=>el,agCharts:()=>tl});var Be=i(98092),Ve=i(98092),He=i(98092),Ue=i(98092),ze=i(98092),We=i(98092),je=i(98092),$e=Object.defineProperty,Ke=Object.defineProperties,Ye=Object.getOwnPropertyDescriptor,qe=Object.getOwnPropertyDescriptors,Xe=Object.getOwnPropertySymbols,Ze=Object.prototype.hasOwnProperty,Qe=Object.prototype.propertyIsEnumerable,Je=(e,t,i)=>t in e?$e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,et=(e,t)=>{for(var i in t||(t={}))Ze.call(t,i)&&Je(e,i,t[i]);if(Xe)for(var i of Xe(t))Qe.call(t,i)&&Je(e,i,t[i]);return e},tt=(e,t)=>Ke(e,qe(t)),it=(e,t,i,n)=>{for(var s,r=n>1?void 0:n?Ye(t,i):t,o=e.length-1;o>=0;o--)(s=e[o])&&(r=(n?s(t,i,r):s(r))||r);return n&&r&&$e(t,i,r),r},nt=class extends He.BeanStub{constructor(){super(...arguments),this.cellRanges=[],this.bodyScrollListener=this.onBodyScroll.bind(this),this.dragging=!1,this.intersectionRange=!1}init(){this.addManagedListener(this.eventService,He.Events.EVENT_NEW_COLUMNS_LOADED,()=>this.onColumnsChanged()),this.addManagedListener(this.eventService,He.Events.EVENT_COLUMN_VISIBLE,this.onColumnsChanged.bind(this)),this.addManagedListener(this.eventService,He.Events.EVENT_COLUMN_VALUE_CHANGED,this.onColumnsChanged.bind(this)),this.addManagedListener(this.eventService,He.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,()=>this.removeAllCellRanges()),this.addManagedListener(this.eventService,He.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.removeAllCellRanges()),this.addManagedListener(this.eventService,He.Events.EVENT_COLUMN_PIVOT_CHANGED,()=>this.removeAllCellRanges()),this.addManagedListener(this.eventService,He.Events.EVENT_COLUMN_GROUP_OPENED,this.refreshLastRangeStart.bind(this)),this.addManagedListener(this.eventService,He.Events.EVENT_COLUMN_MOVED,this.refreshLastRangeStart.bind(this)),this.addManagedListener(this.eventService,He.Events.EVENT_COLUMN_PINNED,this.refreshLastRangeStart.bind(this)),this.ctrlsService.whenReady(e=>{const t=e.gridBodyCtrl;this.autoScrollService=new He.AutoScrollService({scrollContainer:t.getBodyViewportElement(),scrollAxis:"xy",getVerticalPosition:()=>t.getScrollFeature().getVScrollPosition().top,setVerticalPosition:e=>t.getScrollFeature().setVerticalScrollPosition(e),getHorizontalPosition:()=>t.getScrollFeature().getHScrollPosition().left,setHorizontalPosition:e=>t.getScrollFeature().setHorizontalScrollPosition(e),shouldSkipVerticalScroll:()=>!this.gos.isDomLayout("normal"),shouldSkipHorizontalScroll:()=>!t.getScrollFeature().isHorizontalScrollShowing()})})}onColumnsChanged(){this.refreshLastRangeStart();const e=this.columnModel.getAllDisplayedColumns();this.cellRanges.forEach(t=>{const i=t.columns;t.columns=t.columns.filter(t=>t.isVisible()&&-1!==e.indexOf(t)),!He._.areEqual(i,t.columns)&&this.dispatchChangedEvent(!1,!0,t.id)});const t=this.cellRanges.length;this.cellRanges=this.cellRanges.filter(e=>e.columns.length>0),t>this.cellRanges.length&&this.dispatchChangedEvent(!1,!0)}refreshLastRangeStart(){const e=He._.last(this.cellRanges);e&&this.refreshRangeStart(e)}isContiguousRange(e){const t=e.columns;if(!t.length)return!1;const i=this.columnModel.getAllDisplayedColumns(),n=t.map(e=>i.indexOf(e)).sort((e,t)=>e-t);return He._.last(n)-n[0]+1===t.length}getRangeStartRow(e){return e.startRow&&e.endRow?this.rowPositionUtils.before(e.startRow,e.endRow)?e.startRow:e.endRow:{rowIndex:0,rowPinned:this.pinnedRowModel.getPinnedTopRowCount()>0?"top":null}}getRangeEndRow(e){if(e.startRow&&e.endRow)return this.rowPositionUtils.before(e.startRow,e.endRow)?e.endRow:e.startRow;const t=this.pinnedRowModel.getPinnedBottomRowCount();return t>0?{rowIndex:t-1,rowPinned:"bottom"}:{rowIndex:this.rowModel.getRowCount()-1,rowPinned:null}}setRangeToCell(e,t=!1){if(!this.gos.get("enableRangeSelection"))return;const i=this.calculateColumnsBetween(e.column,e.column);if(!i)return;(this.gos.get("suppressMultiRangeSelection")||!t||He._.missing(this.cellRanges))&&this.removeAllCellRanges(!0);const n={rowIndex:e.rowIndex,rowPinned:e.rowPinned},s={startRow:n,endRow:n,columns:i,startColumn:e.column};this.cellRanges.push(s),this.setNewestRangeStartCell(e),this.onDragStop(),this.dispatchChangedEvent(!0,!0)}extendLatestRangeToCell(e){if(this.isEmpty()||!this.newestRangeStartCell)return;const t=He._.last(this.cellRanges);this.updateRangeEnd(t,e)}updateRangeEnd(e,t,i=!1){const n=t.column,s=this.calculateColumnsBetween(e.startColumn,n);s&&!this.isLastCellOfRange(e,t)&&(e.columns=s,e.endRow={rowIndex:t.rowIndex,rowPinned:t.rowPinned},i||this.dispatchChangedEvent(!0,!0,e.id))}refreshRangeStart(e){const{startColumn:t,columns:i}=e,n=(t,i)=>{const n=e.columns.filter(e=>e!==t);t?(e.startColumn=t,e.columns=i?[t,...n]:[...n,t]):e.columns=n},{left:s,right:r}=this.getRangeEdgeColumns(e);t!==i[0]||t===s?t===He._.last(i)&&t===r&&n(r,!1):n(s,!0)}getRangeEdgeColumns(e){const t=this.columnModel.getAllDisplayedColumns(),i=e.columns.map(e=>t.indexOf(e)).filter(e=>e>-1).sort((e,t)=>e-t);return{left:t[i[0]],right:t[He._.last(i)]}}extendLatestRangeInDirection(e){if(this.isEmpty()||!this.newestRangeStartCell)return;const t=e.key,i=e.ctrlKey||e.metaKey,n=He._.last(this.cellRanges),s=this.newestRangeStartCell,r=n.columns[0],o=He._.last(n.columns),a=n.endRow.rowIndex,l=n.endRow.rowPinned,c={column:s.column===r?o:r,rowIndex:a,rowPinned:l},h=this.cellNavigationService.getNextCellToFocus(t,c,i);return h?(this.setCellRange({rowStartIndex:s.rowIndex,rowStartPinned:s.rowPinned,rowEndIndex:h.rowIndex,rowEndPinned:h.rowPinned,columnStart:s.column,columnEnd:h.column}),h):void 0}setCellRange(e){this.gos.get("enableRangeSelection")&&(this.removeAllCellRanges(!0),this.addCellRange(e))}setCellRanges(e){He._.shallowCompare(this.cellRanges,e)||(this.removeAllCellRanges(!0),e.forEach(e=>{e.columns&&e.startRow&&this.setNewestRangeStartCell({rowIndex:e.startRow.rowIndex,rowPinned:e.startRow.rowPinned,column:e.columns[0]}),this.cellRanges.push(e)}),this.dispatchChangedEvent(!1,!0))}setNewestRangeStartCell(e){this.newestRangeStartCell=e}clearCellRangeCellValues(e){let{cellRanges:t}=e;const{cellEventSource:i="rangeService",dispatchWrapperEvents:n,wrapperEventSource:s="deleteKey"}=e;if(n){const e={type:He.Events.EVENT_RANGE_DELETE_START,source:s};this.eventService.dispatchEvent(e)}if(t||(t=this.cellRanges),t.forEach(e=>{this.forEachRowInRange(e,t=>{var n;const s=this.rowPositionUtils.getRowNode(t);if(s)for(let t=0;t<e.columns.length;t++){const r=this.columnModel.getGridColumn(e.columns[t]);if(!r||!r.isCellEditable(s))continue;const o=null!=(n=this.valueService.parseValue(r,s,"",s.getValueFromValueService(r)))?n:null;s.setDataValue(r,o,i)}})}),n){const e={type:He.Events.EVENT_RANGE_DELETE_END,source:s};this.eventService.dispatchEvent(e)}}createCellRangeFromCellRangeParams(e){return this.createPartialCellRangeFromRangeParams(e,!1)}createPartialCellRangeFromRangeParams(e,t){let i,n=!1;if(e.columns)i=e.columns.map(e=>this.columnModel.getColumnWithValidation(e)).filter(e=>e);else{const t=this.columnModel.getColumnWithValidation(e.columnStart),s=this.columnModel.getColumnWithValidation(e.columnEnd);if(!t||!s)return;i=this.calculateColumnsBetween(t,s),i&&i.length&&(n=i[0]!==t)}if(i&&(t||0!==i.length))return{startRow:null!=e.rowStartIndex?{rowIndex:e.rowStartIndex,rowPinned:e.rowStartPinned||null}:void 0,endRow:null!=e.rowEndIndex?{rowIndex:e.rowEndIndex,rowPinned:e.rowEndPinned||null}:void 0,columns:i,startColumn:n?He._.last(i):i[0]}}addCellRange(e){if(!this.gos.get("enableRangeSelection"))return;const t=this.createCellRangeFromCellRangeParams(e);t&&(t.startRow&&this.setNewestRangeStartCell({rowIndex:t.startRow.rowIndex,rowPinned:t.startRow.rowPinned,column:t.startColumn}),this.cellRanges.push(t),this.dispatchChangedEvent(!1,!0,t.id))}getCellRanges(){return this.cellRanges}isEmpty(){return 0===this.cellRanges.length}isMoreThanOneCell(){const e=this.cellRanges.length;if(0===e)return!1;if(e>1)return!0;const t=this.cellRanges[0],i=this.getRangeStartRow(t),n=this.getRangeEndRow(t);return i.rowPinned!==n.rowPinned||i.rowIndex!==n.rowIndex||1!==t.columns.length}areAllRangesAbleToMerge(){const e=new Map;if(this.cellRanges.length<=1)return!0;let t;this.cellRanges.forEach(t=>{this.forEachRowInRange(t,i=>{const n=`${i.rowPinned||"normal"}_${i.rowIndex}`,s=e.get(n),r=t.columns.map(e=>e.getId());if(s){const e=r.filter(e=>-1===s.indexOf(e));s.push(...e)}else e.set(n,r)})});for(const i of e.values()){const e=i.sort().join();if(void 0!==t){if(t!==e)return!1}else t=e}return!0}forEachRowInRange(e,t){const i=this.getRangeStartRow(e),n=this.getRangeEndRow(e);let s=i;for(;s&&(t(s),!this.rowPositionUtils.sameRow(s,n));)s=this.cellNavigationService.getRowBelow(s)}removeAllCellRanges(e){this.isEmpty()||(this.onDragStop(),this.cellRanges.length=0,e||this.dispatchChangedEvent(!1,!0))}onBodyScroll(){this.dragging&&this.lastMouseEvent&&this.onDragging(this.lastMouseEvent)}isCellInAnyRange(e){return this.getCellRangeCount(e)>0}isCellInSpecificRange(e,t){const i=null!==t.columns&&He._.includes(t.columns,e.column),n=this.isRowInRange(e.rowIndex,e.rowPinned,t);return i&&n}isLastCellOfRange(e,t){const{startRow:i,endRow:n}=e,s=this.rowPositionUtils.before(i,n)?n:i,r=t.rowIndex===s.rowIndex&&t.rowPinned===s.rowPinned,o=e.columns[0],a=He._.last(e.columns),l=e.startColumn===o?a:o;return t.column===l&&r}isBottomRightCell(e,t){const i=this.columnModel.getAllDisplayedColumns(),n=e.columns.map(e=>i.indexOf(e)).sort((e,t)=>e-t),{startRow:s,endRow:r}=e,o=this.rowPositionUtils.before(s,r)?r:s,a=i.indexOf(t.column)===He._.last(n),l=t.rowIndex===o.rowIndex&&He._.makeNull(t.rowPinned)===He._.makeNull(o.rowPinned);return a&&l}getCellRangeCount(e){return this.isEmpty()?0:this.cellRanges.filter(t=>this.isCellInSpecificRange(e,t)).length}isRowInRange(e,t,i){const n=this.getRangeStartRow(i),s=this.getRangeEndRow(i),r={rowIndex:e,rowPinned:t||null},o=r.rowIndex===n.rowIndex&&r.rowPinned==n.rowPinned,a=r.rowIndex===s.rowIndex&&r.rowPinned==s.rowPinned;if(o||a)return!0;const l=!this.rowPositionUtils.before(r,n),c=this.rowPositionUtils.before(r,s);return l&&c}getDraggingRange(){return this.draggingRange}onDragStart(e){if(!this.gos.get("enableRangeSelection"))return;const{ctrlKey:t,metaKey:i,shiftKey:n}=e,s=t||i,r=!this.gos.get("suppressMultiRangeSelection")&&s,o=n&&He._.existsAndNotEmpty(this.cellRanges);r||o&&!He._.exists(He._.last(this.cellRanges).type)||this.removeAllCellRanges(!0);const a=this.dragService.getStartTarget();if(a&&this.updateValuesOnMove(a),this.lastCellHovered){if(this.dragging=!0,this.lastMouseEvent=e,this.intersectionRange=r&&this.getCellRangeCount(this.lastCellHovered)>1,o||this.setNewestRangeStartCell(this.lastCellHovered),this.cellRanges.length>0)this.draggingRange=He._.last(this.cellRanges);else{const e={rowIndex:this.lastCellHovered.rowIndex,rowPinned:this.lastCellHovered.rowPinned};this.draggingRange={startRow:e,endRow:e,columns:[this.lastCellHovered.column],startColumn:this.newestRangeStartCell.column},this.cellRanges.push(this.draggingRange)}this.ctrlsService.getGridBodyCtrl().addScrollEventListener(this.bodyScrollListener),this.dispatchChangedEvent(!0,!1,this.draggingRange.id)}}intersectLastRange(e){if(e&&this.dragging)return;if(this.gos.get("suppressMultiRangeSelection"))return;if(this.isEmpty())return;const t=this.rowPositionUtils,i=He._.last(this.cellRanges),n=this.getRangeStartRow(i),s=this.getRangeEndRow(i),r=[];this.cellRanges.slice(0,-1).forEach(e=>{const o=this.getRangeStartRow(e),a=this.getRangeEndRow(e),l=e.columns,c=l.filter(e=>-1===i.columns.indexOf(e));if(c.length===l.length)return void r.push(e);if(t.before(s,o)||t.before(a,n))return void r.push(e);const h=r.length;if(t.before(o,n)){const e={columns:[...l],startColumn:i.startColumn,startRow:et({},o),endRow:this.cellNavigationService.getRowAbove(n)};r.push(e)}if(c.length>0){const e={columns:c,startColumn:He._.includes(c,i.startColumn)?i.startColumn:c[0],startRow:this.rowMax([et({},n),et({},o)]),endRow:this.rowMin([et({},s),et({},a)])};r.push(e)}t.before(s,a)&&r.push({columns:[...l],startColumn:i.startColumn,startRow:this.cellNavigationService.getRowBelow(s),endRow:et({},a)}),r.length-h===1&&(r[r.length-1].id=e.id)}),this.cellRanges=r,e&&this.dispatchChangedEvent(!1,!0)}rowMax(e){let t;return e.forEach(e=>{(void 0===t||this.rowPositionUtils.before(t,e))&&(t=e)}),t}rowMin(e){let t;return e.forEach(e=>{(void 0===t||this.rowPositionUtils.before(e,t))&&(t=e)}),t}updateValuesOnMove(e){const t=He._.getCtrlForEventTarget(this.gos,e,He.CellCtrl.DOM_DATA_KEY_CELL_CTRL),i=null==t?void 0:t.getCellPosition();this.cellHasChanged=!1,!i||this.lastCellHovered&&this.cellPositionUtils.equals(i,this.lastCellHovered)||(this.lastCellHovered&&(this.cellHasChanged=!0),this.lastCellHovered=i)}onDragging(e){if(!this.dragging||!e)return;this.updateValuesOnMove(e.target),this.lastMouseEvent=e;const t=this.lastCellHovered,i=e=>t&&t.rowPinned===e&&this.newestRangeStartCell.rowPinned===e,n=i("top")||i("bottom");if(this.autoScrollService.check(e,n),!this.cellHasChanged)return;const s=this.calculateColumnsBetween(this.newestRangeStartCell.column,t.column);s&&(this.draggingRange.endRow={rowIndex:t.rowIndex,rowPinned:t.rowPinned},this.draggingRange.columns=s,this.dispatchChangedEvent(!1,!1,this.draggingRange.id))}onDragStop(){if(!this.dragging)return;const{id:e}=this.draggingRange;this.autoScrollService.ensureCleared(),this.ctrlsService.getGridBodyCtrl().removeScrollEventListener(this.bodyScrollListener),this.lastMouseEvent=null,this.dragging=!1,this.draggingRange=void 0,this.lastCellHovered=void 0,this.intersectionRange&&(this.intersectionRange=!1,this.intersectLastRange()),this.dispatchChangedEvent(!1,!0,e)}dispatchChangedEvent(e,t,i){const n={type:He.Events.EVENT_RANGE_SELECTION_CHANGED,started:e,finished:t,id:i};this.eventService.dispatchEvent(n)}calculateColumnsBetween(e,t){const i=this.columnModel.getAllDisplayedColumns(),n=e===t,s=i.indexOf(e);if(s<0)return void console.warn(`AG Grid: column ${e.getId()} is not visible`);const r=n?s:i.indexOf(t);if(r<0)return void console.warn(`AG Grid: column ${t.getId()} is not visible`);if(n)return[e];const o=Math.min(s,r),a=o===s?r:s,l=[];for(let e=o;e<=a;e++)l.push(i[e]);return l}};it([(0,He.Autowired)("rowModel")],nt.prototype,"rowModel",2),it([(0,He.Autowired)("dragService")],nt.prototype,"dragService",2),it([(0,He.Autowired)("columnModel")],nt.prototype,"columnModel",2),it([(0,He.Autowired)("cellNavigationService")],nt.prototype,"cellNavigationService",2),it([(0,He.Autowired)("pinnedRowModel")],nt.prototype,"pinnedRowModel",2),it([(0,He.Autowired)("rowPositionUtils")],nt.prototype,"rowPositionUtils",2),it([(0,He.Autowired)("cellPositionUtils")],nt.prototype,"cellPositionUtils",2),it([(0,He.Autowired)("ctrlsService")],nt.prototype,"ctrlsService",2),it([(0,He.Autowired)("valueService")],nt.prototype,"valueService",2),it([He.PostConstruct],nt.prototype,"init",1),nt=it([(0,He.Bean)("rangeService")],nt);var st=class extends ze.Component{constructor(){super(...arguments),this.changedCalculatedValues=!1,this.dragging=!1,this.shouldDestroyOnEndDragging=!1}init(){this.dragService.addDragSource({dragStartPixels:0,eElement:this.getGui(),onDragStart:this.onDragStart.bind(this),onDragging:e=>{this.dragging=!0,this.rangeService.autoScrollService.check(e),this.changedCalculatedValues&&(this.onDrag(e),this.changedCalculatedValues=!1)},onDragStop:e=>{this.dragging=!1,this.onDragEnd(e),this.clearValues(),this.rangeService.autoScrollService.ensureCleared(),document.body.classList.remove(this.getDraggingCssClass()),this.shouldDestroyOnEndDragging&&this.destroy()}}),this.addManagedListener(this.getGui(),"mousedown",this.preventRangeExtension.bind(this))}isDragging(){return this.dragging}getCellCtrl(){return this.cellCtrl}setCellCtrl(e){this.cellCtrl=e}getCellRange(){return this.cellRange}setCellRange(e){this.cellRange=e}getRangeStartRow(){return this.rangeStartRow}setRangeStartRow(e){this.rangeStartRow=e}getRangeEndRow(){return this.rangeEndRow}setRangeEndRow(e){this.rangeEndRow=e}getLastCellHovered(){return this.lastCellHovered}preventRangeExtension(e){e.stopPropagation()}onDragStart(e){this.cellHoverListener=this.addManagedListener(this.ctrlsService.get("gridCtrl").getGui(),"mousemove",this.updateValuesOnMove.bind(this)),document.body.classList.add(this.getDraggingCssClass())}getDraggingCssClass(){return`ag-dragging-${this.type===ze.SelectionHandleType.FILL?"fill":"range"}-handle`}updateValuesOnMove(e){const t=this.mouseEventService.getCellPositionForEvent(e);!t||this.lastCellHovered&&this.cellPositionUtils.equals(t,this.lastCellHovered)||(this.lastCellHovered=t,this.changedCalculatedValues=!0)}getType(){return this.type}refresh(e){const t=this.getCellCtrl(),i=this.getGui(),n=ze._.last(this.rangeService.getCellRanges()),s=n.startRow,r=n.endRow;if(s&&r&&(this.rowPositionUtils.before(r,s)?(this.setRangeStartRow(r),this.setRangeEndRow(s)):(this.setRangeStartRow(s),this.setRangeEndRow(r))),t!==e||!ze._.isVisible(i)){this.setCellCtrl(e);const t=e.getComp().getParentOfValue();t&&t.appendChild(i)}this.setCellRange(n)}clearValues(){this.lastCellHovered=void 0,this.removeListeners()}removeListeners(){this.cellHoverListener&&(this.cellHoverListener(),this.cellHoverListener=void 0)}destroy(){if(!this.shouldDestroyOnEndDragging&&this.isDragging())return ze._.setDisplayed(this.getGui(),!1),void(this.shouldDestroyOnEndDragging=!0);this.shouldDestroyOnEndDragging=!1,super.destroy(),this.removeListeners();const e=this.getGui();e.parentElement&&e.parentElement.removeChild(e)}};function rt(e){const t=e.length;let i=0;if(t<=1)return e;for(let t=0;t<e.length;t++){const n=e[t],s=n.toString().split("e-");s.length>1?i=Math.max(i,parseInt(s[1],10)):Math.floor(n)!==n&&(i=Math.max(i,n.toString().split(".")[1].length))}let n=0,s=0,r=0,o=0,a=0;for(let i=0;i<t;i++)a=e[i],n+=i,s+=a,o+=i*i,r+=i*a;const l=(t*r-n*s)/(t*o-n*n),c=s/t-l*n/t,h=[];for(let e=0;e<=t;e++)h.push(parseFloat((e*l+c).toFixed(i)));return h}it([(0,ze.Autowired)("rowRenderer")],st.prototype,"rowRenderer",2),it([(0,ze.Autowired)("dragService")],st.prototype,"dragService",2),it([(0,ze.Autowired)("rangeService")],st.prototype,"rangeService",2),it([(0,ze.Autowired)("mouseEventService")],st.prototype,"mouseEventService",2),it([(0,ze.Autowired)("columnModel")],st.prototype,"columnModel",2),it([(0,ze.Autowired)("cellNavigationService")],st.prototype,"cellNavigationService",2),it([(0,ze.Autowired)("navigationService")],st.prototype,"navigationService",2),it([(0,ze.Autowired)("rowPositionUtils")],st.prototype,"rowPositionUtils",2),it([(0,ze.Autowired)("cellPositionUtils")],st.prototype,"cellPositionUtils",2),it([(0,ze.Autowired)("ctrlsService")],st.prototype,"ctrlsService",2),it([ze.PostConstruct],st.prototype,"init",1);var ot=class e extends st{constructor(){super(e.TEMPLATE),this.markedCells=[],this.cellValues=[],this.isUp=!1,this.isLeft=!1,this.isReduce=!1,this.type=Ue.SelectionHandleType.FILL}updateValuesOnMove(e){super.updateValuesOnMove(e),this.initialXY||(this.initialXY=this.mouseEventService.getNormalisedPosition(e));const{x:t,y:i}=this.initialXY,{x:n,y:s}=this.mouseEventService.getNormalisedPosition(e),r=Math.abs(t-n),o=Math.abs(i-s),a=this.getFillHandleDirection();let l;l="xy"===a?r>o?"x":"y":a,l!==this.dragAxis&&(this.dragAxis=l,this.changedCalculatedValues=!0)}onDrag(e){if(!this.initialPosition){const e=this.getCellCtrl();if(!e)return;this.initialPosition=e.getCellPosition()}const t=this.getLastCellHovered();t&&this.markPathFrom(this.initialPosition,t)}onDragEnd(e){if(this.initialXY=null,!this.markedCells.length)return;const t="x"===this.dragAxis,i=this.getCellRange(),n=i.columns.length,s=this.getRangeStartRow(),r=this.getRangeEndRow();let o;if(this.isUp||this.isLeft){const e=t?s:this.lastCellMarked;o=this.rangeService.createCellRangeFromCellRangeParams({rowStartIndex:e.rowIndex,rowStartPinned:e.rowPinned,columnStart:t?this.lastCellMarked.column:i.columns[0],rowEndIndex:r.rowIndex,rowEndPinned:r.rowPinned,columnEnd:i.columns[n-1]})}else o=this.rangeService.createCellRangeFromCellRangeParams({rowStartIndex:s.rowIndex,rowStartPinned:s.rowPinned,columnStart:i.columns[0],rowEndIndex:t?r.rowIndex:this.lastCellMarked.rowIndex,rowEndPinned:t?r.rowPinned:this.lastCellMarked.rowPinned,columnEnd:t?this.lastCellMarked.column:i.columns[n-1]});o&&(this.raiseFillStartEvent(),this.handleValueChanged(i,o,e),this.rangeService.setCellRanges([o]),this.raiseFillEndEvent(i,o))}getFillHandleDirection(){const e=this.gos.get("fillHandleDirection");return e?"x"!==e&&"y"!==e&&"xy"!==e?(Ue._.warnOnce("valid values for fillHandleDirection are 'x', 'y' and 'xy'. Default to 'xy'."),"xy"):e:"xy"}raiseFillStartEvent(){const e={type:Ue.Events.EVENT_FILL_START};this.eventService.dispatchEvent(e)}raiseFillEndEvent(e,t){const i={type:Ue.Events.EVENT_FILL_END,initialRange:e,finalRange:t};this.eventService.dispatchEvent(i)}handleValueChanged(e,t,i){const n=this.rangeService.getRangeEndRow(e),s=this.rangeService.getRangeStartRow(e),r=this.rangeService.getRangeEndRow(t),o=this.rangeService.getRangeStartRow(t),a="y"===this.dragAxis;if(this.isReduce&&!this.gos.get("suppressClearOnFillReduction")){const i=a?e.columns:e.columns.filter(e=>t.columns.indexOf(e)<0),s=a?this.cellNavigationService.getRowBelow(r):o;return void(s&&this.clearCellsInRange(s,n,i))}const l=[],c=[],h=[],u=[];let d=!0,p=0;const g=()=>{l.length=0,c.length=0,h.length=0,u.length=0,p=0},f=(t,i)=>{let c=this.isUp?n:s,h=!1;for(a&&(d=!0,g());!h&&c;){const u=this.rowPositionUtils.getRowNode(c);if(!u)break;a&&t?m(l,t,u,()=>!this.rowPositionUtils.sameRow(c,this.isUp?s:n)):i&&(d=!0,g(),i.forEach(t=>m(l,t,u,()=>t!==(this.isLeft?e.columns[0]:Ue._.last(e.columns))))),h=this.rowPositionUtils.sameRow(c,this.isUp?o:r),c=this.isUp?this.cellNavigationService.getRowAbove(c):this.cellNavigationService.getRowBelow(c)}},m=(e,t,n,s)=>{var r,o;let a,l=!1;if(d)a=this.valueService.getValue(t,n),c.push(a),h.push(this.valueService.getValue(t,n,void 0,!0)),u.push(this.valueService.formatValue(t,n,a)),d=s();else{const{value:s,fromUserFunction:d,sourceCol:g,sourceRowNode:f}=this.processValues({event:i,values:e,initialValues:c,initialNonAggregatedValues:h,initialFormattedValues:u,col:t,rowNode:n,idx:p++});if(a=s,t.isCellEditable(n)){const e=this.valueService.getValue(t,n);d||(g&&!1!==(null==(r=g.getColDef())?void 0:r.useValueFormatterForExport)&&(a=null!=(o=this.valueService.formatValue(g,f,a))?o:a),!1!==t.getColDef().useValueParserForImport&&(a=this.valueService.parseValue(t,n,g?a:Ue._.toStringOrNull(a),e))),d&&e===a?l=!0:n.setDataValue(t,a,"rangeService")}}l||e.push({value:a,column:t,rowNode:n})};if(a)e.columns.forEach(e=>{f(e)});else{const e=this.isLeft?[...t.columns].reverse():t.columns;f(void 0,e)}}clearCellsInRange(e,t,i){const n={startRow:e,endRow:t,columns:i,startColumn:i[0]};this.rangeService.clearCellRangeCellValues({cellRanges:[n]})}processValues(e){const{event:t,values:i,initialValues:n,initialNonAggregatedValues:s,initialFormattedValues:r,col:o,rowNode:a,idx:l}=e,c=this.gos.getCallback("fillOperation");let h;if(h="y"===this.dragAxis?this.isUp?"up":"down":this.isLeft?"left":"right",c){const e=c({event:t,values:i.map(({value:e})=>e),initialValues:n,initialNonAggregatedValues:s,initialFormattedValues:r,currentIndex:l,currentCellValue:this.valueService.getValue(o,a),direction:h,column:o,rowNode:a});if(!1!==e)return{value:e,fromUserFunction:!0}}const u=!i.some(({value:e})=>{const t=parseFloat(e);return isNaN(t)||t.toString()!==e.toString()});if(t.altKey||!u){if(u&&1===n.length){const e=this.isUp||this.isLeft?-1:1;return{value:parseFloat(Ue._.last(i).value)+1*e,fromUserFunction:!1}}const{value:e,column:t,rowNode:s}=i[l%i.length];return{value:e,fromUserFunction:!1,sourceCol:t,sourceRowNode:s}}return{value:Ue._.last(rt(i.map(({value:e})=>Number(e)))),fromUserFunction:!1}}clearValues(){this.clearMarkedPath(),this.clearCellValues(),this.lastCellMarked=void 0,super.clearValues()}clearMarkedPath(){this.markedCells.forEach(e=>{if(!e.isAlive())return;const t=e.getComp();t.addOrRemoveCssClass("ag-selection-fill-top",!1),t.addOrRemoveCssClass("ag-selection-fill-right",!1),t.addOrRemoveCssClass("ag-selection-fill-bottom",!1),t.addOrRemoveCssClass("ag-selection-fill-left",!1)}),this.markedCells.length=0,this.isUp=!1,this.isLeft=!1,this.isReduce=!1}clearCellValues(){this.cellValues.length=0}markPathFrom(e,t){if(this.clearMarkedPath(),this.clearCellValues(),"y"===this.dragAxis){if(this.rowPositionUtils.sameRow(t,e))return;const i=this.rowPositionUtils.before(t,e),n=this.getRangeStartRow(),s=this.getRangeEndRow();i&&(t.rowPinned==n.rowPinned&&t.rowIndex>=n.rowIndex||n.rowPinned!=s.rowPinned&&t.rowPinned==s.rowPinned&&t.rowIndex<=s.rowIndex)?(this.reduceVertical(e,t),this.isReduce=!0):(this.extendVertical(e,t,i),this.isReduce=!1)}else{const i=e.column,n=t.column;if(i===n)return;const s=this.columnModel.getAllDisplayedColumns(),r=s.indexOf(i),o=s.indexOf(n);o<=r&&o>=s.indexOf(this.getCellRange().columns[0])?(this.reduceHorizontal(e,t),this.isReduce=!0):(this.extendHorizontal(e,t,o<r),this.isReduce=!1)}this.lastCellMarked=t}extendVertical(e,t,i){const{navigationService:n,rangeService:s}=this;let r=e;do{const o=this.getCellRange(),a=o.columns.length;for(let l=0;l<a;l++){const c=o.columns[l],h={rowIndex:r.rowIndex,rowPinned:r.rowPinned},u=tt(et({},h),{column:c}),d=s.isCellInSpecificRange(u,o),p=this.rowPositionUtils.sameRow(r,e);if(i&&(this.isUp=!0),!p){const e=n.getCellByPosition(u);if(e){this.markedCells.push(e);const n=e.getComp();d||(n.addOrRemoveCssClass("ag-selection-fill-left",0===l),n.addOrRemoveCssClass("ag-selection-fill-right",l===a-1)),n.addOrRemoveCssClass(i?"ag-selection-fill-top":"ag-selection-fill-bottom",this.rowPositionUtils.sameRow(r,t))}}}if(this.rowPositionUtils.sameRow(r,t))break}while(r=i?this.cellNavigationService.getRowAbove(r):this.cellNavigationService.getRowBelow(r))}reduceVertical(e,t){let i=e;do{const e=this.getCellRange(),n=e.columns.length,s=this.rowPositionUtils.sameRow(i,t);for(let s=0;s<n;s++){const n={rowIndex:i.rowIndex,rowPinned:i.rowPinned},r=tt(et({},n),{column:e.columns[s]}),o=this.navigationService.getCellByPosition(r);o&&(this.markedCells.push(o),o.getComp().addOrRemoveCssClass("ag-selection-fill-bottom",this.rowPositionUtils.sameRow(i,t)))}if(s)break}while(i=this.cellNavigationService.getRowAbove(i))}extendHorizontal(e,t,i){const n=this.columnModel.getAllDisplayedColumns(),s=n.indexOf(i?t.column:e.column),r=n.indexOf(i?this.getCellRange().columns[0]:t.column),o=i?0:1,a=n.slice(s+o,r+o),l=this.getRangeStartRow(),c=this.getRangeEndRow();a.forEach(e=>{let t=l,n=!1;do{n=this.rowPositionUtils.sameRow(t,c);const s=this.navigationService.getCellByPosition({rowIndex:t.rowIndex,rowPinned:t.rowPinned,column:e});if(s){this.markedCells.push(s);const n=s.getComp();n.addOrRemoveCssClass("ag-selection-fill-top",this.rowPositionUtils.sameRow(t,l)),n.addOrRemoveCssClass("ag-selection-fill-bottom",this.rowPositionUtils.sameRow(t,c)),i?(this.isLeft=!0,n.addOrRemoveCssClass("ag-selection-fill-left",e===a[0])):n.addOrRemoveCssClass("ag-selection-fill-right",e===Ue._.last(a))}t=this.cellNavigationService.getRowBelow(t)}while(!n)})}reduceHorizontal(e,t){const i=this.columnModel.getAllDisplayedColumns(),n=i.indexOf(t.column),s=i.indexOf(e.column),r=i.slice(n,s),o=this.getRangeStartRow(),a=this.getRangeEndRow();r.forEach(e=>{let t=o,i=!1;do{i=this.rowPositionUtils.sameRow(t,a);const n=this.navigationService.getCellByPosition({rowIndex:t.rowIndex,rowPinned:t.rowPinned,column:e});n&&(this.markedCells.push(n),n.getComp().addOrRemoveCssClass("ag-selection-fill-right",e===r[0])),t=this.cellNavigationService.getRowBelow(t)}while(!i)})}refresh(e){const t=this.rangeService.getCellRanges()[0];t.startRow&&t.endRow?super.refresh(e):this.destroy()}};ot.TEMPLATE='<div class="ag-fill-handle"></div>',it([(0,Ue.Autowired)("valueService")],ot.prototype,"valueService",2);var at=ot,lt=class e extends st{constructor(){super(e.TEMPLATE),this.type=We.SelectionHandleType.RANGE,this.rangeFixed=!1}onDrag(e){const t=this.getLastCellHovered();if(!t)return;const i=this.rangeService.getCellRanges(),n=We._.last(i);this.rangeFixed||(this.fixRangeStartEnd(n),this.rangeFixed=!0),this.endPosition={rowIndex:t.rowIndex,rowPinned:t.rowPinned,column:t.column},2===i.length&&i[0].type===We.CellRangeType.DIMENSION&&n.type===We.CellRangeType.VALUE&&!this.rowPositionUtils.sameRow(this.endPosition,this.rangeService.getRangeEndRow(n))&&this.rangeService.updateRangeEnd(i[0],tt(et({},this.endPosition),{column:i[0].columns[0]}),!0),this.rangeService.extendLatestRangeToCell(this.endPosition)}onDragEnd(e){const t=We._.last(this.rangeService.getCellRanges());this.fixRangeStartEnd(t),this.rangeFixed=!1}fixRangeStartEnd(e){const t=this.rangeService.getRangeStartRow(e),i=this.rangeService.getRangeEndRow(e),n=e.columns[0];e.startRow=t,e.endRow=i,e.startColumn=n}};lt.TEMPLATE='<div class="ag-range-handle"></div>';var ct=lt,ht=class extends je.BeanStub{createSelectionHandle(e){return this.createBean(e===je.SelectionHandleType.RANGE?new ct:new at)}};ht=it([(0,je.Bean)("selectionHandleFactory")],ht);var ut={version:"31.3.4",moduleName:Ve.ModuleNames.RangeSelectionModule,beans:[nt,ht],agStackComponents:[{componentName:"AgFillHandle",componentClass:at},{componentName:"AgRangeHandle",componentClass:ct}],dependantModules:[D]},dt=i(98092),pt=i(21371),gt=i(98092),ft=i(98092),mt=i(98092),yt=i(98092),vt=i(98092),bt=i(98092),Ct=i(98092),wt=i(98092),St=i(98092),xt=i(98092),Et=i(21371),At=i(98092),Mt=i(21371),Tt=i(98092),Dt=i(21371),It=i(98092),Rt=i(98092),kt=i(98092),Pt=i(98092),_t=i(98092),Lt=i(98092),Nt=i(98092),Ot=i(98092),Ft=i(98092),Gt=i(98092),Bt=i(98092),Vt=i(98092),Ht=i(98092),Ut=i(98092),zt=i(98092),Wt=i(98092),jt=i(98092),$t=i(98092),Kt=i(98092),Yt=i(98092),qt=i(98092),Xt=i(98092),Zt=i(98092),Qt=i(21371),Jt=i(98092),ei=i(98092),ti=i(98092),ii=i(98092),ni=i(98092),si=i(98092),ri=i(98092),oi=i(98092),ai=i(98092),li=i(98092),ci=i(98092),hi=i(98092),ui=i(98092),di=i(98092),pi=i(21371),gi=i(21371),fi=i(21371),mi=i(21371),yi=i(21371),vi=i(21371),bi=i(21371),Ci=i(21371),wi=i(21371),Si=i(21371),xi=i(21371),Ei=i(21371),Ai=i(98092),Mi=i(21371),Ti=i(21371),Di=i(21371),Ii=i(21371),Ri=i(21371),ki=i(21371),Pi=i(21371),_i=i(21371),Li=i(21371),Ni=i(21371),Oi=i(21371),Fi=i(21371),Gi=i(98092),Bi=i(98092),Vi=i(98092),Hi=i(21371),Ui=i(21371),zi=i(98092),Wi=i(21371),ji=i(98092),$i=i(98092),Ki=i(98092),Yi=i(98092),qi=i(98092),Xi=i(98092),Zi=i(98092),Qi=i(98092),Ji=i(98092),en=i(98092),tn=i(98092),nn=i(21371);h(Ge,i(21371));var sn=Object.defineProperty,rn=Object.defineProperties,on=Object.getOwnPropertyDescriptor,an=Object.getOwnPropertyDescriptors,ln=Object.getOwnPropertySymbols,cn=Object.prototype.hasOwnProperty,hn=Object.prototype.propertyIsEnumerable,un=(e,t,i)=>t in e?sn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,dn=(e,t)=>{for(var i in t||(t={}))cn.call(t,i)&&un(e,i,t[i]);if(ln)for(var i of ln(t))hn.call(t,i)&&un(e,i,t[i]);return e},pn=(e,t)=>rn(e,an(t)),gn=(e,t)=>{var i={};for(var n in e)cn.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&ln)for(var n of ln(e))t.indexOf(n)<0&&hn.call(e,n)&&(i[n]=e[n]);return i},fn=(e,t,i,n)=>{for(var s,r=n>1?void 0:n?on(t,i):t,o=e.length-1;o>=0;o--)(s=e[o])&&(r=(n?s(t,i,r):s(r))||r);return n&&r&&sn(t,i,r),r},mn=class e extends Ct.BeanStub{getData(e){if(e.crossFiltering){if(e.grouping)return console.warn("AG Grid: crossing filtering with row grouping is not supported."),{chartData:[],columnNames:{}};if(!this.gos.isRowModelType("clientSide"))return console.warn("AG Grid: crossing filtering is only supported in the client side row model."),{chartData:[],columnNames:{}}}this.gos.isRowModelType("serverSide")&&e.pivoting&&this.updatePivotKeysForSSRM();const t=this.extractRowsFromGridRowModel(e);return t.chartData=this.aggregateRowsByDimension(e,t.chartData),t}extractRowsFromGridRowModel(t){const{crossFiltering:i,startRow:n,endRow:s,valueCols:r,dimensionCols:o,grouping:a}=t;let l=[];const c={},h={},u={};let d,p={},g=[];if(i)p=this.getFilteredRowNodes(),g=this.getAllRowNodes(),d=g.length;else{const e=this.gridRowModel.getRowCount()-1;d=n===s&&0===n&&0===o.length&&0===r.length?0:(s>=0?Math.min(s,e):e)-n+1}d>0&&r.forEach(e=>{let t=[];const i=e.getColDef().pivotKeys;i&&(t=i.slice());const n=e.getColDef().headerName;n&&t.push(n),t.length>0&&(c[e.getId()]=t)});let f,m=0;for(let s=0;s<d;s++){const c=i?g[s]:this.gridRowModel.getRow(s+n);if(c.footer){m++;continue}const d={};o.forEach(t=>{const i=t.colId,n=this.columnModel.getGridColumn(i);if(n){const t=this.valueService.getValue(n,c);if(a){const n=t&&t.toString?String(t.toString()):"",r=e.getGroupLabels(c,n);d[i]={labels:r,toString:function(){return this.labels.filter(e=>!!e).reverse().join(" - ")}},c.group&&(h[r.toString()]=s-m);const o=r.slice(1,r.length).toString();o&&(u[o]=h[o])}else d[i]=t}else d[On.DEFAULT_CATEGORY]=s+1}),r.forEach(e=>{const n=e.getColId();if(i){const i=n+"-filtered-out",s=this.valueService.getValue(e,c),r=null!=s&&"function"==typeof s.toNumber?s.toNumber():s;p[c.id]?(d[n]=r,d[i]=t.aggFunc||t.isScatter?void 0:0):(d[n]=t.aggFunc||t.isScatter?void 0:0,d[i]=r)}else{let t=this.valueService.getValue(e,c);t&&t.hasOwnProperty("toString")&&(t=parseFloat(t.toString())),d[n]=null!=t&&"function"==typeof t.toNumber?t.toNumber():t}}),l.push(d)}if(a){const e=Ct._.values(u),t=l;l=[],f=[];for(let i=0;i<t.length;i++)(Ct._.includes(e,i)?f:l).push(t[i])}return{chartData:l,columnNames:c,groupChartData:f}}aggregateRowsByDimension(e,t){const i=e.dimensionCols;if(!e.aggFunc||0===i.length)return t;const n=Ct._.last(i),s=n&&n.colId,r={},o=[];if(t.forEach(e=>{let t=r;i.forEach(n=>{const r=n.colId,a=e[r];if(r===s){let n=t[a];n||(n={__children:[]},i.forEach(t=>{const i=t.colId;n[i]=e[i]}),t[a]=n,o.push(n)),n.__children.push(e)}else t[a]||(t[a]={}),t=t[a]})}),Ct.ModuleRegistry.__assertRegistered(Ct.ModuleNames.RowGroupingModule,"Charting Aggregation",this.context.getGridId())){const t=this.aggregationStage;o.forEach(i=>e.valueCols.forEach(n=>{if(e.crossFiltering)e.valueCols.forEach(n=>{const s=n.getColId(),r=i.__children.filter(e=>void 0!==e[s]).map(e=>e[s]);let o=t.aggregateValues(r,e.aggFunc);i[n.getId()]=o&&void 0!==o.value?o.value:o;const a=`${s}-filtered-out`,l=i.__children.filter(e=>void 0!==e[a]).map(e=>e[a]);let c=t.aggregateValues(l,e.aggFunc);i[a]=c&&void 0!==c.value?c.value:c});else{const s=i.__children.map(e=>e[n.getId()]);let r=t.aggregateValues(s,e.aggFunc);i[n.getId()]=r&&void 0!==r.value?r.value:r}}))}return o}updatePivotKeysForSSRM(){const e=this.columnModel.getSecondaryColumns();if(!e)return;const t=this.extractPivotKeySeparator(e);e.forEach(e=>{if(""===t)e.getColDef().pivotKeys=[];else{const i=e.getColId().split(t);e.getColDef().pivotKeys=i.slice(0,i.length-1)}})}extractPivotKeySeparator(e){if(0===e.length)return"";const t=(e,i)=>{const n=e.getGroupId();return e.getParent()?t(e.getParent(),n):i.split(n)[1][0]},i=e[0];return null==i.getParent()?"":t(i.getParent(),i.getColId())}static getGroupLabels(e,t){const i=[t];for(;e&&0!==e.level;)(e=e.parent)&&i.push(e.key);return i}getFilteredRowNodes(){const e={};return this.gridRowModel.forEachNodeAfterFilterAndSort(t=>{e[t.id]=t}),e}getAllRowNodes(){let e=[];return this.gridRowModel.forEachNode(t=>{e.push(t)}),this.sortRowNodes(e)}sortRowNodes(e){const t=this.sortController.getSortOptions();return t&&0!=t.length?this.rowNodeSorter.doFullSort(e,t):e}};fn([(0,Ct.Autowired)("rowModel")],mn.prototype,"gridRowModel",2),fn([(0,Ct.Autowired)("valueService")],mn.prototype,"valueService",2),fn([(0,Ct.Autowired)("columnModel")],mn.prototype,"columnModel",2),fn([(0,Ct.Autowired)("rowNodeSorter")],mn.prototype,"rowNodeSorter",2),fn([(0,Ct.Autowired)("sortController")],mn.prototype,"sortController",2),fn([(0,Ct.Optional)("aggregationStage")],mn.prototype,"aggregationStage",2);var yn=mn,vn=class extends wt.BeanStub{constructor(){super(...arguments),this.valueColsWithoutSeriesType=new Set}postConstruct(){const e=()=>this.valueColsWithoutSeriesType.clear();this.addManagedListener(this.eventService,wt.Events.EVENT_NEW_COLUMNS_LOADED,e),this.addManagedListener(this.eventService,wt.Events.EVENT_ROW_DATA_UPDATED,e)}getColumn(e){return this.columnModel.getPrimaryColumn(e)}getAllDisplayedColumns(){return this.columnModel.getAllDisplayedColumns()}getColDisplayName(e){return this.columnModel.getDisplayNameForColumn(e,"chart")}getRowGroupColumns(){return this.columnModel.getRowGroupColumns()}getGroupDisplayColumns(){return this.columnModel.getGroupDisplayColumns()}isPivotMode(){return this.columnModel.isPivotMode()}isPivotActive(){return this.columnModel.isPivotActive()}getChartColumns(){const e=this.columnModel.getAllGridColumns(),t=new Set,i=new Set;return e.forEach(e=>{const n=e.getColDef(),s=n.chartDataType;if(s)switch(s){case"category":case"time":return void t.add(e);case"series":return void i.add(e);case"excluded":return;default:console.warn(`AG Grid: unexpected chartDataType value '${s}' supplied, instead use 'category', 'series' or 'excluded'`)}"ag-Grid-AutoColumn"!==n.colId?e.isPrimary()?(this.isInferredValueCol(e)?i:t).add(e):i.add(e):t.add(e)}),{dimensionCols:t,valueCols:i}}isInferredValueCol(e){const t=e.getColId();if("ag-Grid-AutoColumn"===t)return!1;const i=this.rowPositionUtils.getRowNode({rowIndex:0,rowPinned:null});if(!i)return this.valueColsWithoutSeriesType.has(t);let n=this.valueService.getValue(e,i);null==n&&(n=this.extractLeafData(i,e)),null!=n&&"function"==typeof n.toNumber&&(n=n.toNumber());const s="number"==typeof n;return s&&this.valueColsWithoutSeriesType.add(t),s}extractLeafData(e,t){if(!e.allLeafChildren)return null;for(let i=0;i<e.allLeafChildren.length;i++){const n=e.allLeafChildren[i],s=this.valueService.getValue(t,n);if(null!=s)return s}return null}destroy(){this.valueColsWithoutSeriesType.clear(),super.destroy()}};fn([(0,wt.Autowired)("columnModel")],vn.prototype,"columnModel",2),fn([(0,wt.Autowired)("valueService")],vn.prototype,"valueService",2),fn([(0,wt.Autowired)("rowPositionUtils")],vn.prototype,"rowPositionUtils",2),fn([wt.PostConstruct],vn.prototype,"postConstruct",1),vn=fn([(0,wt.Bean)("chartColumnService")],vn);var bn=class e extends St.BeanStub{constructor(e){var t;super(),this.suppressComboChartWarnings=!1,this.chartDataModel=e,this.seriesChartTypes=null!=(t=e.params.seriesChartTypes)?t:[]}init(){this.initComboCharts()}update(e){this.seriesChartTypes=null!=e?e:this.seriesChartTypes,this.initComboCharts(),this.updateSeriesChartTypes()}initComboCharts(){const e=this.seriesChartTypes&&this.seriesChartTypes.length>0;("customCombo"===this.chartDataModel.chartType||e)&&(this.chartDataModel.chartType="customCombo",this.savedCustomSeriesChartTypes=this.seriesChartTypes||[])}updateSeriesChartTypes(){this.chartDataModel.isComboChart()&&(this.seriesChartTypes=this.seriesChartTypes.map(e=>{const t=["groupedColumn","stackedColumn","stackedArea"].includes(e.chartType);return e.secondaryAxis=!t&&e.secondaryAxis,e}),"customCombo"!==this.chartDataModel.chartType?this.updateChartSeriesTypesForBuiltInCombos():this.updateSeriesChartTypesForCustomCombo())}updateSeriesChartTypesForCustomCombo(){this.seriesChartTypes&&this.seriesChartTypes.length>0||this.suppressComboChartWarnings||console.warn("AG Grid: 'seriesChartTypes' are required when the 'customCombo' chart type is specified."),this.seriesChartTypes=this.seriesChartTypes.map(t=>(e.SUPPORTED_COMBO_CHART_TYPES.includes(t.chartType)||(console.warn(`AG Grid: invalid chartType '${t.chartType}' supplied in 'seriesChartTypes', converting to 'line' instead.`),t.chartType="line"),t));const t=this.chartDataModel.valueColState.map(e=>{this.savedCustomSeriesChartTypes&&0!==this.savedCustomSeriesChartTypes.length||(this.savedCustomSeriesChartTypes=this.seriesChartTypes);return this.savedCustomSeriesChartTypes.find(t=>t.colId===e.colId)||(e.selected&&!this.suppressComboChartWarnings&&console.warn(`AG Grid: no 'seriesChartType' found for colId = '${e.colId}', defaulting to 'line'.`),{colId:e.colId,chartType:"line",secondaryAxis:!1})});this.seriesChartTypes=t,this.savedCustomSeriesChartTypes=t,this.suppressComboChartWarnings=!0}updateChartSeriesTypesForBuiltInCombos(){const{chartType:e,valueColState:t}=this.chartDataModel;let i="columnLineCombo"===e?"groupedColumn":"stackedArea",n="columnLineCombo"===e?"line":"groupedColumn";const s=t.filter(e=>e.selected),r=Math.ceil(s.length/2);this.seriesChartTypes=s.map((e,t)=>{const s=t>=r?n:i;return{colId:e.colId,chartType:s,secondaryAxis:!1}})}};bn.SUPPORTED_COMBO_CHART_TYPES=["line","groupedColumn","stackedColumn","area","stackedArea"],fn([St.PostConstruct],bn.prototype,"init",1);var Cn=bn,wn={area:{isCartesian:!0,canInvert:!0},bar:{isCartesian:!0,canInvert:!0},histogram:{isCartesian:!0},line:{isCartesian:!0,canInvert:!0},pie:{isPie:!0},donut:{isPie:!0,canInvert:!0},scatter:{isCartesian:!0},bubble:{isCartesian:!0},"radial-column":{isPolar:!0,isEnterprise:!0,isRadial:!0,canInvert:!0},"radial-bar":{isPolar:!0,isEnterprise:!0,isRadial:!0,canInvert:!0},"radar-line":{isPolar:!0,isEnterprise:!0,canInvert:!0},"radar-area":{isPolar:!0,isEnterprise:!0,canInvert:!0},nightingale:{isPolar:!0,isEnterprise:!0,canInvert:!0},"range-bar":{isCartesian:!0,isEnterprise:!0,canSwitchDirection:!0},"range-area":{isCartesian:!0,isEnterprise:!0},"box-plot":{isCartesian:!0,isEnterprise:!0,canSwitchDirection:!0},treemap:{isEnterprise:!0,isHierarchical:!0},sunburst:{isEnterprise:!0,isHierarchical:!0},heatmap:{isCartesian:!0,isEnterprise:!0},waterfall:{isCartesian:!0,isEnterprise:!0,canSwitchDirection:!0}};function Sn(e){return xt.ChartMappings.COMBO_CHART_TYPES.includes(e)}function xn(e,t){var i;return!!(null==(i=wn[e])?void 0:i[t])}var En=new Set(["stackedColumn","normalizedColumn","stackedBar","normalizedBar"]);function An(e){return xn(e,"isCartesian")}function Mn(e){return xn(e,"isPolar")}function Tn(e){return xn(e,"isHierarchical")}function Dn(e){return"doughnut"===e?"donut":e}function In(e){return xt.ChartMappings.CHART_TYPE_TO_SERIES_TYPE[e]}function Rn(e){var t;return null!=(t=In(e))?t:"line"}function kn(e){return xn(e,"isPie")}function Pn(e){return Tn(Rn(e))?void 0:1}function _n(e){return Tn(Rn(e))?2:function(e){return"pie"===e||"waterfall"===e||"histogram"===e}(e)?1:void 0}function Ln(e){return xn(Rn(e),"canInvert")}var Nn=class e extends bt.BeanStub{constructor(e){super(),this.unlinked=!1,this.chartData=[],this.valueColState=[],this.dimensionColState=[],this.columnNames={},this.crossFiltering=!1,this.grouping=!1,this.params=e,this.chartId=e.chartId,this.setParams(e)}setParams(e){const{chartType:t,pivotChart:i,chartThemeName:n,switchCategorySeries:s,aggFunc:r,cellRange:o,suppressChartRanges:a,unlinkChart:l,crossFiltering:c,seriesGroupType:h}=e;this.chartType=t,this.pivotChart=null!=i&&i,this.chartThemeName=n,this.switchCategorySeries=!!s,this.aggFunc=r,this.referenceCellRange=o,this.suppliedCellRange=o,this.suppressChartRanges=null!=a&&a,this.unlinked=!!l,this.crossFiltering=!!c,this.seriesGroupType=h}init(){this.datasource=this.createManagedBean(new yn),this.chartColumnService=this.createManagedBean(new vn),this.comboChartModel=this.createManagedBean(new Cn(this)),this.updateCellRanges({setColsFromRange:!0}),this.updateData()}updateModel(e){const{cellRange:t,seriesChartTypes:i}=e;t!==this.suppliedCellRange&&(this.dimensionCellRange=void 0,this.valueCellRange=void 0),this.setParams(e),this.updateSelectedDimensions(null==t?void 0:t.columns),this.updateCellRanges({setColsFromRange:!0}),(this.isComboChart()||i)&&this.comboChartModel.update(i),this.unlinked||this.updateData()}updateCellRanges(e){const{updatedColState:t,resetOrder:i,maintainColState:n,setColsFromRange:s}=null!=e?e:{};this.valueCellRange&&(this.referenceCellRange=this.valueCellRange);const{dimensionCols:r,valueCols:o}=this.chartColumnService.getChartColumns(),a=this.getAllColumnsFromRanges();t&&this.updateColumnState(t,i),this.setDimensionCellRange(r,a,t),this.setValueCellRange(o,a,s),t||n||(this.resetColumnState(),this.syncDimensionCellRange()),this.comboChartModel.updateSeriesChartTypes()}updateData(){const{startRow:e,endRow:t}=this.getRowIndexes();this.pivotChart&&this.resetColumnState(),this.grouping=this.isGrouping();const i={aggFunc:this.aggFunc,dimensionCols:this.getSelectedDimensions(),grouping:this.grouping,pivoting:this.isPivotActive(),crossFiltering:this.crossFiltering,valueCols:this.getSelectedValueCols(),startRow:e,endRow:t,isScatter:bt._.includes(["scatter","bubble"],this.chartType)},{chartData:n,columnNames:s,groupChartData:r}=this.datasource.getData(i);this.chartData=n,this.groupChartData=r,this.columnNames=s,this.categoryAxisType=void 0}isGrouping(){const e=this.gos.get("treeData"),t=e?null:this.chartColumnService.getRowGroupColumns(),i=e||t&&t.length>0,n=this.getSelectedDimensions().map(({colId:e})=>e),s=this.chartColumnService.getGroupDisplayColumns().map(e=>e.getColId()).some(e=>n.includes(e));return!!i&&s}getSelectedValueCols(){return this.valueColState.filter(e=>e.selected).map(e=>e.column)}getSelectedDimensions(){return this.dimensionColState.filter(e=>e.selected)}getColDisplayName(e){return this.chartColumnService.getColDisplayName(e)}isPivotMode(){return this.chartColumnService.isPivotMode()}getChartDataType(e){const t=this.chartColumnService.getColumn(e);return t?t.getColDef().chartDataType:void 0}isPivotActive(){return this.chartColumnService.isPivotActive()}createCellRange(e,...t){return{id:this.chartId,startRow:this.referenceCellRange.startRow,endRow:this.referenceCellRange.endRow,columns:t,startColumn:e===bt.CellRangeType.DIMENSION||null==this.referenceCellRange.startColumn?t[0]:this.referenceCellRange.startColumn,type:e}}getAllColumnsFromRanges(){if(this.pivotChart)return bt._.convertToSet(this.chartColumnService.getAllDisplayedColumns());const e=this.dimensionCellRange||this.valueCellRange?[]:this.referenceCellRange.columns;return this.dimensionCellRange&&e.push(...this.dimensionCellRange.columns),this.valueCellRange&&e.push(...this.valueCellRange.columns),bt._.convertToSet(e)}getRowIndexes(){let e=0,t=0;const{rangeService:i,valueCellRange:n,dimensionCellRange:s}=this,r=n||s;if(i&&r){e=i.getRangeStartRow(r).rowIndex;const n=i.getRangeEndRow(r);t="bottom"===n.rowPinned?-1:n.rowIndex}return{startRow:e,endRow:t}}resetColumnState(){const{dimensionCols:t,valueCols:i}=this.chartColumnService.getChartColumns(),n=this.getAllColumnsFromRanges(),s=this.valueColState.length<1;this.dimensionColState=[],this.valueColState=[];const r=Tn(Rn(this.chartType));let o=!1,a=1;const l=this.suppliedCellRange.columns[0];t.forEach(e=>{const t="ag-Grid-AutoColumn"===e.getColId();let i=!1;this.crossFiltering&&this.aggFunc?l.getColId()===e.getColId()&&(i=!0):i=!!t||(!o||r)&&n.has(e),this.dimensionColState.push({column:e,colId:e.getColId(),displayName:this.getColDisplayName(e),selected:i,order:a++}),i&&(o=!0)});const c={colId:e.DEFAULT_CATEGORY,displayName:this.chartTranslationService.translate("defaultCategory"),selected:!o,order:0};this.dimensionColState.unshift(c);const h=this.referenceCellRange.columns.filter(e=>i.has(e));i.forEach(e=>{s&&bt._.includes(this.referenceCellRange.columns,e)&&(e=h.shift()),this.valueColState.push({column:e,colId:e.getColId(),displayName:this.getColDisplayName(e),selected:n.has(e),order:a++})})}updateColumnState(e,t){const i=t=>t.colId===e.colId,{dimensionColState:n,valueColState:s}=this,r=n.find(i),o=s.find(i);if(r)if(Tn(Rn(this.chartType)))r.selected=e.selected;else{const t=e.selected?r:n.filter(e=>e!==r).find(({selected:e})=>e);n.forEach(e=>e.selected=e===t)}else o&&(o.selected=e.selected);const a=[...n,...s],l=[];t||(a.forEach((t,i)=>{i===e.order&&l.push(e.colId),t.colId!==e.colId&&l.push(t.colId)}),a.forEach(e=>{const t=l.indexOf(e.colId);e.order=t>=0?l.indexOf(e.colId):a.length-1})),this.reorderColState()}reorderColState(){const e=(e,t)=>e.order-t.order;this.dimensionColState.sort(e),this.valueColState.sort(e)}setDimensionCellRange(t,i,n){this.dimensionCellRange=void 0;const s=Tn(Rn(this.chartType));if(!n&&!this.dimensionColState.length){const e=new Array;return t.forEach(t=>{e.length>0&&!s||!i.has(t)||e.push(t)}),void(e.length>0&&(this.dimensionCellRange=this.createCellRange(bt.CellRangeType.DIMENSION,...e)))}let r=n?[n]:[];if(this.crossFiltering&&this.aggFunc){const e=this.suppliedCellRange.columns[0];r=this.dimensionColState.filter(t=>t.colId===e.getColId())}else(s||0===r.length||r.some(({column:e})=>!e||!t.has(e)))&&(r=this.dimensionColState.filter(e=>e.selected));const o=1===r.length&&r[0].colId===e.DEFAULT_CATEGORY,a=r.map(({column:e})=>e).filter(e=>null!=e);a.length>0&&!o&&(this.dimensionCellRange=this.createCellRange(bt.CellRangeType.DIMENSION,...a))}setValueCellRange(e,t,i){this.valueCellRange=void 0;const n=[],s=_n(this.chartType);let r=0;if(e.forEach(e=>{i?(null==s||r<s)&&t.has(e)&&(n.push(e),r++):this.valueColState.some(t=>t.selected&&t.colId===e.getColId())&&n.push(e)}),n.length>0){let e=[];this.valueColState.length>0?e=this.valueColState.map(e=>e.colId):t.forEach(t=>e.push(t.getColId())),n.sort((t,i)=>e.indexOf(t.getColId())-e.indexOf(i.getColId())),this.valueCellRange=this.createCellRange(bt.CellRangeType.VALUE,...n)}}resetCellRanges(e,t){if(!e&&!t)return;const{dimensionCols:i,valueCols:n}=this.chartColumnService.getChartColumns(),s=this.getAllColumnsFromRanges();e&&this.setDimensionCellRange(i,s),t&&this.setValueCellRange(n,s)}updateSelectedDimensions(e){const t=new Set(e.map(e=>e.getColId()));if(Tn(Rn(this.chartType))){const e=this.dimensionColState.filter(e=>t.has(e.colId)),i=new Set(e.map(e=>e.colId));this.dimensionColState=this.dimensionColState.map(e=>pn(dn({},e),{selected:i.has(e.colId)}))}else{const e=(this.dimensionColState.find(e=>t.has(e.colId))||this.dimensionColState[0]).colId;this.dimensionColState=this.dimensionColState.map(t=>pn(dn({},t),{selected:t.colId===e}))}}syncDimensionCellRange(){const e=this.getSelectedDimensions();if(0===e.length)return;const t=e.map(({column:e})=>e).filter(e=>null!=e);t.length>0&&(this.dimensionCellRange=this.createCellRange(bt.CellRangeType.DIMENSION,...t))}isComboChart(e){return Sn(null!=e?e:this.chartType)}};Nn.DEFAULT_CATEGORY="AG-GRID-DEFAULT-CATEGORY",fn([(0,bt.Autowired)("rangeService")],Nn.prototype,"rangeService",2),fn([(0,bt.Autowired)("chartTranslationService")],Nn.prototype,"chartTranslationService",2),fn([bt.PostConstruct],Nn.prototype,"init",1);var On=Nn,Fn=["number","category","grouped-category","log","time"];function Gn(e,t){return!1!==t.clone&&t.isMergeableObject(e)?zn(function(e){return Array.isArray(e)?[]:{}}(e),e,t):e}function Bn(e,t,i){return e.concat(t).map(function(e){return Gn(e,i)})}function Vn(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return e.propertyIsEnumerable(t)}):[]}(e))}function Hn(e,t){try{return t in e}catch(e){return!1}}function Un(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){const t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t}(e)}function zn(e,t,i){(i=i||{}).arrayMerge=i.arrayMerge||Bn,i.isMergeableObject=i.isMergeableObject||Un,i.cloneUnlessOtherwiseSpecified=Gn;const n=Array.isArray(t);return n===Array.isArray(e)?n?i.arrayMerge(e,t,i):function(e={},t={},i){const n={};return i.isMergeableObject(e)&&Vn(e).forEach(function(t){n[t]=Gn(e[t],i)}),Vn(t).forEach(function(s){(function(e,t){return Hn(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,s)||(Hn(e,s)&&i.isMergeableObject(t[s])?n[s]=function(e,t){if(!t.customMerge)return zn;const i=t.customMerge(e);return"function"==typeof i?i:zn}(s,i)(e[s],t[s],i):n[s]=Gn(t[s],i))}),n}(e,t,i):Gn(t,i)}function Wn(e,t,i){if(null==e)return i;const n=t.split(".");let s=e;for(;n.length>1;)if(s=s[n.shift()],null==s)return i;const r=s[n[0]];return null!=r?r:i}function jn(e){return At._.includes(Object.keys(Mt._Theme.themes),e)}var $n=Fn.reduce((e,t)=>pn(dn({},e),{[t]:{title:{_enabledFromTheme:!0}}}),{});function Kn(e,t,i){const n=e.getExtraPaddingDirections();return{common:pn(dn({},t?{animation:{duration:500}}:void 0),{axes:$n,padding:{top:!i&&n.includes("top")?40:20,right:n.includes("right")?30:20,bottom:n.includes("bottom")?40:20,left:n.includes("left")?30:20}}),pie:{series:{title:{_enabledFromTheme:!0},calloutLabel:{_enabledFromTheme:!0},sectorLabel:{enabled:!1,_enabledFromTheme:!0}}},donut:{series:{title:{_enabledFromTheme:!0},calloutLabel:{_enabledFromTheme:!0},sectorLabel:{enabled:!1,_enabledFromTheme:!0}}}}}function Yn(e,t){const{customChartThemes:i}=e,n=i&&i[t];return n||console.warn(`AG Grid: no stock theme exists with the name '${t}' and no custom chart theme with that name was supplied to 'customChartThemes'`),n}var qn=e=>t=>null==t||e(t),Xn=e=>"string"==typeof e,Zn=e=>"boolean"==typeof e,Qn=e=>"object"==typeof e,Jn=(e,t)=>i=>`AG Grid - unable to update chart as invalid params supplied:  \`${e}: ${i}\`, expected ${t}.`,es=e=>`${e} is not supported in AG Charts Community (either 'ag-grid-charts-enterprise' or '@ag-grid-enterprise/charts-enterprise' hasn't been loaded). See https://www.ag-grid.com/javascript-data-grid/integrated-charts-installation/ for more details.`,ts=class e{static isEnterprise(){return Dt._ModuleSupport.enterpriseModule.isEnterprise}static isValidChartType(e){return!!In(e)||Sn(e)}static isLegacyChartType(t){return e.legacyChartTypes.includes(t)}static validateUpdateParams(t){switch(t.type){case"rangeChartUpdate":return e.validateUpdateRangeChartParams(t);case"pivotChartUpdate":return e.validateUpdatePivotChartParams(t);case"crossFilterChartUpdate":return e.validateUpdateCrossFilterChartParams(t);default:return console.warn(`AG Grid - Invalid value supplied for 'type': ${t.type}. It must be either 'rangeChartUpdate', 'pivotChartUpdate', or 'crossFilterChartUpdate'.`),!1}}static validateCreateParams(t){return e.validateProperties(t,[e.enterpriseChartTypeValidation,e.switchCategorySeriesValidation])}static validateUpdateRangeChartParams(t){const i=[...e.commonUpdateValidations,e.enterpriseChartTypeValidation,...e.cellRangeValidations,{property:"seriesChartTypes",validationFn:e=>void 0===e||Array.isArray(e)&&e.every(Qn),warnMessage:Jn("seriesChartTypes","Array of SeriesChartType")}];return e.validateProperties(t,i,[...e.baseUpdateChartParams,"cellRange","suppressChartRanges","switchCategorySeries","aggFunc","seriesChartTypes","seriesGroupType"],"UpdateRangeChartParams")}static validateUpdatePivotChartParams(t){const i=[...e.commonUpdateValidations];return e.validateProperties(t,i,[...e.baseUpdateChartParams],"UpdatePivotChartParams")}static validateUpdateCrossFilterChartParams(t){const i=[...e.commonUpdateValidations,...e.cellRangeValidations];return e.validateProperties(t,i,[...e.baseUpdateChartParams,"cellRange","suppressChartRanges","aggFunc"],"UpdateCrossFilterChartParams")}static validateProperties(e,t,i,n){let s;for(const i of t){const{property:t,validationFn:n,warnMessage:r,warnIfFixed:o}=i;if(t in e){const i=e[t],a=n(i);if(!0===a)continue;if(!1===a)return console.warn(r(i)),!1;s=s||dn({},e),s[t]=a,o&&console.warn(r(i))}}if(i)for(const t in e)if(!i.includes(t))return console.warn(`AG Grid - Unexpected property supplied. ${n} does not contain: \`${t}\`.`),!1;return s||!0}};ts.legacyChartTypes=["doughnut"],ts.baseUpdateChartParams=["type","chartId","chartType","chartThemeName","chartThemeOverrides","unlinkChart"],ts.validateChartType=qn(e=>{if(ts.isValidChartType(e))return!0;if(ts.isLegacyChartType(e)){const t=Dn(e);return Tt._.warnOnce(`The chart type '${e}' has been deprecated. Please use '${t}' instead.`),t}return!1}),ts.validateAgChartThemeOverrides=qn(e=>"object"==typeof e),ts.validateChartParamsCellRange=qn(e=>"object"==typeof e),ts.validateAggFunc=qn(e=>"string"==typeof e||"function"==typeof e),ts.enterpriseChartTypeValidation={property:"chartType",validationFn:qn(e=>ts.isEnterprise()||!e||!function(e){return xn(Rn(e),"isEnterprise")}(e)),warnMessage:e=>es(`The '${e}' chart type`)},ts.switchCategorySeriesValidation={property:"switchCategorySeries",validationFn:qn(e=>{if(!e||ts.isEnterprise())return!0}),warnMessage:()=>es("'switchCategorySeries' has been ignored as it"),warnIfFixed:!0},ts.commonUpdateValidations=[{property:"chartId",validationFn:Xn,warnMessage:Jn("chartId","string")},{property:"chartType",validationFn:ts.validateChartType,warnMessage:Jn("chartType","ChartType")},{property:"chartThemeName",validationFn:Xn,warnMessage:Jn("chartThemeName","string")},{property:"chartThemeOverrides",validationFn:ts.validateAgChartThemeOverrides,warnMessage:Jn("chartThemeOverrides","AgChartThemeOverrides")},{property:"unlinkChart",validationFn:Zn,warnMessage:Jn("unlinkChart","boolean")}],ts.cellRangeValidations=[{property:"cellRange",validationFn:ts.validateChartParamsCellRange,warnMessage:Jn("cellRange","ChartParamsCellRange")},{property:"suppressChartRanges",validationFn:Zn,warnMessage:Jn("suppressChartRanges","boolean")},{property:"aggFunc",validationFn:ts.validateAggFunc,warnMessage:Jn("aggFunc","string or IAggFunc")},ts.switchCategorySeriesValidation];var is=ts,ns=["ag-default","ag-material","ag-sheets","ag-polychroma","ag-vivid"],ss=class e extends vt.BeanStub{constructor(e){super(),this.model=e,this.isEnterprise=()=>Et._ModuleSupport.enterpriseModule.isEnterprise}init(){this.setChartRange(),this.addManagedListener(this.eventService,vt.Events.EVENT_RANGE_SELECTION_CHANGED,e=>{e.id&&e.id===this.model.chartId&&this.updateForRangeChange()}),this.model.unlinked&&this.rangeService&&this.rangeService.setCellRanges([]),this.addManagedListener(this.eventService,vt.Events.EVENT_COLUMN_MOVED,this.updateForGridChange.bind(this)),this.addManagedListener(this.eventService,vt.Events.EVENT_COLUMN_PINNED,this.updateForGridChange.bind(this)),this.addManagedListener(this.eventService,vt.Events.EVENT_COLUMN_VISIBLE,this.updateForGridChange.bind(this)),this.addManagedListener(this.eventService,vt.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,this.updateForGridChange.bind(this)),this.addManagedListener(this.eventService,vt.Events.EVENT_MODEL_UPDATED,this.updateForGridChange.bind(this)),this.addManagedListener(this.eventService,vt.Events.EVENT_CELL_VALUE_CHANGED,this.updateForDataChange.bind(this))}update(e){if(!this.validUpdateType(e))return!1;const t=is.validateUpdateParams(e);if(!t)return!1;const i=!0===t?e:t;return this.applyValidatedChartParams(i),!0}applyValidatedChartParams(e){var t,i,n,s,r,o,a,l,c;const{chartId:h,chartType:u,chartThemeName:d,unlinkChart:p}=e,g={chartId:h,pivotChart:this.model.pivotChart,chartType:null!=u?u:this.model.chartType,chartThemeName:null!=d?d:this.model.chartThemeName,unlinkChart:null!=p?p:this.model.unlinked,cellRange:this.model.suppliedCellRange,switchCategorySeries:this.model.switchCategorySeries,aggFunc:this.model.aggFunc,seriesChartTypes:void 0,suppressChartRanges:!1,crossFiltering:!1};let f=dn({},g);switch(e.type){case"rangeChartUpdate":f.cellRange=null!=(t=this.createCellRange(e))?t:this.model.suppliedCellRange,f.switchCategorySeries=null!=(i=e.switchCategorySeries)?i:this.model.switchCategorySeries,f.aggFunc=null!=(n=e.aggFunc)?n:this.model.aggFunc,f.seriesChartTypes=e.seriesChartTypes,f.suppressChartRanges=null!=(s=e.suppressChartRanges)?s:this.model.suppressChartRanges,f.seriesGroupType=null!=(r=e.seriesGroupType)?r:this.model.seriesGroupType;break;case"crossFilterChartUpdate":f.cellRange=null!=(o=this.createCellRange(e))?o:this.model.suppliedCellRange,f.switchCategorySeries=!1,f.aggFunc=null!=(a=e.aggFunc)?a:this.model.aggFunc,f.crossFiltering=!0,f.suppressChartRanges=null!=(l=e.suppressChartRanges)?l:this.model.suppressChartRanges;break;case"pivotChartUpdate":f.switchCategorySeries=!1}this.model.updateModel(f),f.unlinkChart||f.suppressChartRanges?null==(c=this.rangeService)||c.setCellRanges([]):this.setChartRange()}updateForGridChange(e){if(this.model.unlinked)return;const{maintainColState:t,setColsFromRange:i}=null!=e?e:{};this.model.updateCellRanges({maintainColState:t,setColsFromRange:i}),this.model.updateData(),this.setChartRange()}updateForDataChange(){this.model.unlinked||(this.model.updateData(),this.raiseChartModelUpdateEvent())}updateForRangeChange(){this.updateForGridChange({setColsFromRange:!0}),this.raiseChartRangeSelectionChangedEvent()}updateForPanelChange(e){this.model.updateCellRanges(e),this.model.updateData(),e.skipAnimation&&this.getChartProxy().getChartRef().skipAnimations(),this.setChartRange(),this.raiseChartRangeSelectionChangedEvent()}updateThemeOverrides(e){this.chartProxy.updateThemeOverrides(e)}getChartUpdateParams(e){const t=this.getSelectedValueColState().map(e=>({colId:e.colId,displayName:e.displayName})),i=this.getChartData(),n=this.getSelectedDimensions(),s={data:i,groupData:this.model.groupChartData,grouping:this.isGrouping(),categories:n.map(e=>{var t;return{id:e.colId,name:e.displayName,chartDataType:null!=(t=this.model.categoryAxisType)?t:this.model.getChartDataType(e.colId)}}),fields:t,chartId:this.getChartId(),getCrossFilteringContext:()=>({lastSelectedChartId:"xxx"}),seriesChartTypes:this.getSeriesChartTypes(),updatedOverrides:e,seriesGroupType:this.model.seriesGroupType};return this.isCategorySeriesSwitched()?this.invertCategorySeriesParams(s):s}invertCategorySeriesParams(e){const[t]=e.categories,i=[{id:On.DEFAULT_CATEGORY,name:""}],n=e.data.map((e,i)=>{const n=`${t.id}:${i}`,s=e[t.id];return{colId:n,displayName:null==s?"":String(s)}}),s=e.fields.map(i=>{const n={[On.DEFAULT_CATEGORY]:i.displayName};for(const[s,r]of e.data.entries()){const e=`${t.id}:${s}`,o=r[i.colId];n[e]=o}return n});return pn(dn({},e),{categories:i,fields:n,data:s})}getChartModel(){const e=this.model.pivotChart?"pivot":"range",t=this.isComboChart()?this.model.comboChartModel.seriesChartTypes:void 0;return{modelType:e,chartId:this.model.chartId,chartType:this.model.chartType,chartThemeName:this.getChartThemeName(),chartOptions:this.chartProxy.getChartThemeOverrides(),chartPalette:this.chartProxy.getChartPalette(),cellRange:this.getCellRangeParams(),switchCategorySeries:this.model.switchCategorySeries,suppressChartRanges:this.model.suppressChartRanges,aggFunc:this.model.aggFunc,unlinkChart:this.model.unlinked,seriesChartTypes:t,seriesGroupType:this.model.seriesGroupType}}getChartId(){return this.model.chartId}getChartData(){return this.model.chartData}getChartType(){return this.model.chartType}setChartType(e){this.updateMultiSeriesAndCategory(this.model.chartType,e),this.model.chartType=e,this.model.comboChartModel.updateSeriesChartTypes(),this.model.switchCategorySeries=!1,this.model.categoryAxisType=void 0,this.model.seriesGroupType=void 0,this.raiseChartModelUpdateEvent(),this.raiseChartOptionsChangedEvent()}isCategorySeriesSwitched(){return this.model.switchCategorySeries&&!this.model.isGrouping()}switchCategorySeries(e){Ln(this.getChartType())&&(this.model.switchCategorySeries=e,this.raiseChartModelUpdateEvent())}getAggFunc(){return this.model.aggFunc}setAggFunc(e,t){this.model.aggFunc!==e&&(this.model.aggFunc=e,t||(this.model.updateData(),this.raiseChartModelUpdateEvent()))}updateMultiSeriesAndCategory(e,t){var i,n;const s=(e,t)=>{let i=0;for(const n of e)n.selected&&(i>=t?n.selected=!1:i++);0===i&&(e[0].selected=!0)},r=Pn(t),o=_n(t),a=null!=r&&(null!=(i=Pn(e))?i:100)>(null!=r?r:100),l=null!=o&&(null!=(n=_n(e))?n:100)>(null!=o?o:100);a&&s(this.model.dimensionColState,r),l&&s(this.model.valueColState,o),(a||l)&&(this.model.resetCellRanges(a,l),this.setChartRange(!0))}setChartThemeName(e,t){this.model.chartThemeName=e,t||(this.raiseChartModelUpdateEvent(),this.raiseChartOptionsChangedEvent())}getChartThemeName(){return this.model.chartThemeName}isPivotChart(){return this.model.pivotChart}isPivotMode(){return this.model.isPivotMode()}isGrouping(){return this.model.isGrouping()}isCrossFilterChart(){return this.model.crossFiltering}getThemeNames(){return this.gos.get("chartThemes")||ns}getThemes(){return this.getThemeNames().map(e=>{const t=jn(e)?e:this.chartProxy.lookupCustomChartTheme(e);return Et._Theme.getChartTheme(t)})}getPalettes(){return this.getThemes().map(e=>e.palette)}getThemeTemplateParameters(){return this.getThemes().map(e=>e.getTemplateParameters())}getValueColState(){return this.model.valueColState.map(this.displayNameMapper.bind(this))}getSelectedValueColState(){return this.getValueColState().filter(e=>e.selected)}getSelectedDimensions(){return this.model.getSelectedDimensions()}displayNameMapper(e){const t=this.model.columnNames[e.colId];return e.displayName=t?t.join(" - "):this.model.getColDisplayName(e.column),e}getColStateForMenu(){return{dimensionCols:this.model.dimensionColState,valueCols:this.getValueColState()}}setChartRange(e=!1){!this.rangeService||this.model.suppressChartRanges||this.model.unlinked||this.rangeService.setCellRanges(this.getCellRanges()),e||this.raiseChartModelUpdateEvent()}detachChartRange(){this.model.unlinked=!this.model.unlinked,this.model.unlinked?this.rangeService&&this.rangeService.setCellRanges([]):this.updateForGridChange(),this.dispatchEvent({type:e.EVENT_CHART_LINKED_CHANGED})}setChartProxy(e){this.chartProxy=e}getChartProxy(){return this.chartProxy}isActiveXYChart(){return vt._.includes(["scatter","bubble"],this.getChartType())}isChartLinked(){return!this.model.unlinked}customComboExists(){const e=this.model.comboChartModel.savedCustomSeriesChartTypes;return e&&e.length>0}getSeriesChartTypes(){return this.model.comboChartModel.seriesChartTypes}isComboChart(e){return this.model.isComboChart(e)}updateSeriesChartType(t,i,n){const s=this.model.comboChartModel.seriesChartTypes.find(e=>e.colId===t);if(s){const t="customCombo"!==this.model.chartType;t&&(this.model.chartType="customCombo");const r=s.chartType;null!=i&&(s.chartType=i),null!=n&&(s.secondaryAxis=n),this.model.comboChartModel.savedCustomSeriesChartTypes=this.model.comboChartModel.seriesChartTypes,this.model.comboChartModel.updateSeriesChartTypes(),this.updateForDataChange(),t&&this.dispatchEvent({type:e.EVENT_CHART_TYPE_CHANGED}),r!==i&&this.dispatchEvent({type:e.EVENT_CHART_SERIES_CHART_TYPE_CHANGED}),this.raiseChartOptionsChangedEvent()}}getActiveSeriesChartTypes(){const e=this.getSelectedValueColState().map(e=>e.colId);return this.getSeriesChartTypes().filter(t=>e.includes(t.colId))}getChartSeriesTypes(e){const t=null!=e?e:this.getChartType();return this.isComboChart(t)?["line","bar","area"]:[Rn(t)]}getChartSeriesType(){const e=this.getSeriesChartTypes();if(0===e.length)return"bar";const t=e[0].chartType;return"columnLineCombo"===t?"bar":"areaColumnCombo"===t?"area":Rn(t)}getCellRanges(){return[this.model.dimensionCellRange,this.model.valueCellRange].filter(e=>e)}createCellRange(e){var t;return e.cellRange&&(null==(t=this.rangeService)?void 0:t.createPartialCellRangeFromRangeParams(e.cellRange,!0))}validUpdateType(e){var t;if(!e.type)return console.warn("AG Grid - Unable to update chart as the 'type' is missing. It must be either 'rangeChartUpdate', 'pivotChartUpdate', or 'crossFilterChartUpdate'."),!1;const i={"Range Chart":()=>!this.isPivotChart()&&!this.isCrossFilterChart(),"Pivot Chart":()=>this.isPivotChart(),"Cross Filter Chart":()=>this.isCrossFilterChart()},n=null!=(t=Object.keys(i).find(e=>i[e]()))?t:"Range Chart",s=e.type===`${n[0].toLowerCase()}${n.slice(1).replace(/ /g,"")}Update`;return s||console.warn(`AG Grid - Unable to update chart as a '${e.type}' update type is not permitted on a ${n}.`),s}getCellRangeParams(){const e=this.getCellRanges(),t=e[0],i=t&&t.startRow||null,n=t&&t.endRow||null;return{rowStartIndex:i&&i.rowIndex,rowStartPinned:i&&i.rowPinned,rowEndIndex:n&&n.rowIndex,rowEndPinned:n&&n.rowPinned,columns:e.reduce((e,t)=>e.concat(t.columns.map(e=>e.getId())),[])}}setCategoryAxisType(e){this.model.categoryAxisType=e,this.raiseChartModelUpdateEvent()}getSeriesGroupType(){var e;return null!=(e=this.model.seriesGroupType)?e:this.chartProxy.getSeriesGroupType()}setSeriesGroupType(e){this.model.seriesGroupType=e,this.raiseChartModelUpdateEvent()}raiseChartModelUpdateEvent(){const t={type:e.EVENT_CHART_MODEL_UPDATE};this.dispatchEvent(t)}raiseChartUpdatedEvent(){const t={type:e.EVENT_CHART_UPDATED};this.dispatchEvent(t)}raiseChartApiUpdateEvent(){const t={type:e.EVENT_CHART_API_UPDATE};this.dispatchEvent(t)}raiseChartOptionsChangedEvent(){const{chartId:e,chartType:t}=this.getChartModel(),i={type:vt.Events.EVENT_CHART_OPTIONS_CHANGED,chartId:e,chartType:t,chartThemeName:this.getChartThemeName(),chartOptions:this.chartProxy.getChartThemeOverrides()};this.eventService.dispatchEvent(i)}raiseChartRangeSelectionChangedEvent(){const e={type:vt.Events.EVENT_CHART_RANGE_SELECTION_CHANGED,id:this.model.chartId,chartId:this.model.chartId,cellRange:this.getCellRangeParams()};this.eventService.dispatchEvent(e)}destroy(){super.destroy(),this.rangeService&&this.rangeService.setCellRanges([])}};ss.EVENT_CHART_UPDATED="chartUpdated",ss.EVENT_CHART_API_UPDATE="chartApiUpdate",ss.EVENT_CHART_MODEL_UPDATE="chartModelUpdate",ss.EVENT_CHART_TYPE_CHANGED="chartTypeChanged",ss.EVENT_CHART_SERIES_CHART_TYPE_CHANGED="chartSeriesChartTypeChanged",ss.EVENT_CHART_LINKED_CHANGED="chartLinkedChanged",fn([(0,vt.Autowired)("rangeService")],ss.prototype,"rangeService",2),fn([vt.PostConstruct],ss.prototype,"init",1);var rs=ss,os=class e extends kt.Component{constructor(t){super(e.TEMPLATE),this.config=null!=t?t:{};const{selectedValueList:i,valueFormatter:n,valueList:s}=this.config;this.selectedValues=null!=i?i:[],this.valueList=null!=s?s:[],this.valueFormatter=null!=n?n:e=>kt._.escapeString(e)}init(){const{ariaLabel:e,onValuesChange:t,dragSourceId:i}=this.config;this.dropZonePanel=this.createManagedBean(new cs({getValues:()=>this.selectedValues,setValues:e=>this.updateValues(e),isDraggable:()=>this.selectedValues.length>1},e=>this.valueFormatter(e),e,i)),this.getGui().appendChild(this.dropZonePanel.getGui()),this.initSelect(),null!=t&&(this.onValuesChange=t)}setValues(e,t){const{added:i,removed:n,updated:s}=this.getChanges(this.valueList,e);let r=!1;return(i.length||n.length||s.length)&&(r=!0),this.valueList=e,this.updateValues(t,r,!0),this}setValueFormatter(e){return this.valueFormatter=e,this}initSelect(){const e=this.createSelectOptions();if(!e.length)return!1;const{selectPlaceholder:t}=this.config;return this.eSelect=this.createBean(new kt.AgSelect({options:e,placeholder:t,onValueChange:e=>this.addValue(e),pickerIcon:"chartsMenuAdd"})),this.getGui().appendChild(this.eSelect.getGui()),!0}createSelectOptions(){let e=[];const{maxSelection:t}=this.config;return t&&this.selectedValues.length>=t||this.valueList.forEach(t=>{this.selectedValues.includes(t)||e.push({value:t,text:this.valueFormatter(t)})}),e}addValue(e){this.dropZonePanel.addItem(e)}updateValues(e,t,i){var n,s,r,o,a;const l=this.selectedValues;this.selectedValues=e;const c=this.getChanges(l,e),h=t||c.added.length||c.removed.length,u=this.gos.getActiveDomElement(),d=null==(n=this.eSelect)?void 0:n.getGui().contains(u),p=null==(s=this.dropZonePanel)?void 0:s.getGui().contains(u);i||null==(r=this.onValuesChange)||r.call(this,c);const g=!!h&&!this.refreshSelect();this.dropZonePanel.refreshGui(),h&&d&&(g?this.dropZonePanel.focusList(!0):null==(o=this.eSelect)||o.getFocusableElement().focus()),p&&!e.length&&(null==(a=this.eSelect)||a.getFocusableElement().focus())}getChanges(e,t){return{added:t.filter(t=>!e.includes(t)),removed:e.filter(e=>!t.includes(e)),updated:t.filter((t,i)=>e[i]!==t),selected:t}}refreshSelect(){if(!this.eSelect)return this.initSelect();const e=this.createSelectOptions();return e.length?(this.eSelect.clearOptions().addOptions(e).setValue(void 0,!0),!0):(kt._.removeFromParent(this.eSelect.getGui()),this.eSelect=this.destroyBean(this.eSelect),!1)}destroy(){this.destroyBean(this.eSelect),super.destroy()}};os.TEMPLATE='<div class="ag-pill-select" role="presentation"></div>',fn([kt.PostConstruct],os.prototype,"init",1);var as=os,ls=class extends kt.PillDragComp{constructor(e,t,i,n,s,r){super(t,i,!1),this.value=e,this.valueFormatter=n,this.draggable=s,this.sourceId=r}getItem(){return this.value}getDisplayName(){return this.valueFormatter(this.value)}getAriaDisplayName(){return this.getDisplayName()}getTooltip(){}createGetDragItem(){return()=>({value:this.value})}getDragSourceType(){return kt.DragSourceType.ChartPanel}getDragSourceId(){return this.sourceId}isDraggable(){return this.draggable}},cs=class extends kt.PillDropZonePanel{constructor(e,t,i,n){super(!1),this.model=e,this.valueFormatter=t,this.ariaLabel=i,this.sourceId=n}postConstruct(){super.init()}isItemDroppable(e,t){return this.isSourceEventFromTarget(t)||null!=this.sourceId&&this.sourceId===t.dragSource.sourceId}updateItems(e){this.model.setValues(e)}getExistingItems(){return this.model.getValues()}getIconName(){return this.isPotentialDndItems()?kt.DragAndDropService.ICON_MOVE:kt.DragAndDropService.ICON_NOT_ALLOWED}getAriaLabel(){return this.ariaLabel}createPillComponent(e,t,i){return new ls(e,t,i,this.valueFormatter,this.model.isDraggable(),this.sourceId)}getItems(e){return[e.value]}isInterestedIn(e){return e===kt.DragSourceType.ChartPanel}};fn([kt.PostConstruct],cs.prototype,"postConstruct",1);var hs=class extends Rt.Component{constructor(e,t,i,n,s){super(s),this.chartController=e,this.autoScrollService=t,this.allowMultipleSelection=i,this.maxSelection=n,this.columnComps=new Map}refreshColumnComps(e){return!!Rt._.areEqual(Rt._.keys(this.columnComps),e.map(({colId:e})=>e))&&(e.forEach(e=>{this.columnComps.get(e.colId).setValue(e.selected,!0)}),!0)}createGroup(e,t,i,n,s){if(this.allowMultipleSelection){const s=e.filter(e=>e.selected);this.valuePillSelect=this.groupComp.createManagedBean(new as({valueList:e,selectedValueList:s,valueFormatter:t,selectPlaceholder:this.chartTranslationService.translate(i),dragSourceId:n,onValuesChange:e=>this.onValueChange(e),maxSelection:this.maxSelection})),this.groupComp.addItem(this.valuePillSelect)}else{const t=this.createValueSelectParams(e);t.onValueChange=t=>{e.forEach(e=>{e.selected=!1}),t.selected=!0,t.colId===On.DEFAULT_CATEGORY&&this.chartController.setAggFunc(void 0,!0),this.chartController.updateForPanelChange({updatedColState:t,skipAnimation:null==s?void 0:s()})},this.valueSelect=this.groupComp.createManagedBean(new Rt.AgSelect(t)),this.groupComp.addItem(this.valueSelect)}}refreshValueSelect(e){if(!this.valueSelect)return;const{options:t,value:i}=this.createValueSelectParams(e);this.valueSelect.clearOptions().addOptions(t).setValue(i,!0)}createValueSelectParams(e){let t;return{options:e.map(e=>{var i;const n=null!=(i=e.displayName)?i:"";return e.selected&&(t=e),{value:e,text:n}}),value:t}}onDragging(e){const t=this.checkHoveredItem(e);if(!t)return;this.lastDraggedColumn=e.dragItem.columns[0];const{comp:i,position:n}=t,{comp:s,position:r}=this.lastHoveredItem||{};i===s&&n===r||(this.autoScrollService.check(e.event),this.clearHoveredItems(),this.lastHoveredItem={comp:i,position:n},i.getGui().classList.add("ag-list-item-hovered",`ag-item-highlight-${n}`))}checkHoveredItem(e){if(Rt._.missing(e.vDirection))return null;const t=e.event;for(const e of this.columnComps.values()){const i=e.getGui();if(!i.querySelector(".ag-chart-data-column-drag-handle"))continue;const n=i.getBoundingClientRect();if(t.clientY>=n.top&&t.clientY<=n.bottom){const s=i.clientHeight;return{comp:e,position:t.clientY>n.top+s/2?"bottom":"top"}}}return null}onDragLeave(){this.clearHoveredItems()}onDragStop(){if(this.lastHoveredItem){const{dimensionCols:e,valueCols:t}=this.chartController.getColStateForMenu(),i=[...e,...t].find(e=>e.column===this.lastDraggedColumn);if(i){let e=Array.from(this.columnComps.values()).indexOf(this.lastHoveredItem.comp);"bottom"===this.lastHoveredItem.position&&e++,i.order=e,this.chartController.updateForPanelChange({updatedColState:i})}}this.clearHoveredItems(),this.lastDraggedColumn=void 0,this.autoScrollService.ensureCleared()}clearHoveredItems(){this.columnComps.forEach(e=>{e.getGui().classList.remove("ag-list-item-hovered","ag-item-highlight-top","ag-item-highlight-bottom")}),this.lastHoveredItem=void 0}addDragHandle(e,t){const i=Rt._.createIconNoSpan("columnDrag",this.gos);i.classList.add("ag-drag-handle","ag-chart-data-column-drag-handle"),e.getGui().insertAdjacentElement("beforeend",i);const n={type:Rt.DragSourceType.ChartPanel,eElement:i,dragItemName:t.displayName,getDragItem:()=>({columns:[t.column]}),onDragStopped:()=>this.onDragStop()};this.dragAndDropService.addDragSource(n,!0),this.addDestroyFunc(()=>this.dragAndDropService.removeDragSource(n))}addChangeListener(e,t){this.addManagedListener(e,Rt.Events.EVENT_FIELD_VALUE_CHANGED,()=>{t.selected=e.getValue(),this.chartController.updateForPanelChange({updatedColState:t})})}isInterestedIn(e){return e===Rt.DragSourceType.ChartPanel}onValueChange({added:e,updated:t,removed:i,selected:n}){let s,r;const o=()=>{n.forEach((e,t)=>{e.order=t}),r=!0};e.length?(s=e[0],s.selected=!0,o()):i.length?(s=i[0],s.selected=!1):t.length&&(o(),s=t[0]),s&&this.chartController.updateForPanelChange({updatedColState:s,resetOrder:r})}destroy(){this.valuePillSelect=void 0,this.valueSelect=void 0,super.destroy()}};fn([(0,Rt.Autowired)("dragAndDropService")],hs.prototype,"dragAndDropService",2),fn([(0,Rt.Autowired)("chartTranslationService")],hs.prototype,"chartTranslationService",2);var us=class e extends hs{constructor(t,i,n,s,r,o){super(t,i,s,void 0,e.TEMPLATE),this.title=n,this.dimensionCols=r,this.isOpen=o}init(){this.groupComp=this.createBean(new It.AgGroupComponent({title:this.title,enabled:!0,suppressEnabledCheckbox:!0,suppressOpenCloseIcons:!1,cssIdentifier:"charts-data",expanded:this.isOpen})),this.chartMenuService.isLegacyFormat()?(this.createLegacyCategoriesGroup(this.dimensionCols),this.clearAggFuncControls()):(this.createCategoriesGroup(this.dimensionCols),this.createAggFuncControls(this.dimensionCols)),this.getGui().appendChild(this.groupComp.getGui())}refresh(e){var t;this.chartMenuService.isLegacyFormat()?this.refreshColumnComps(e)||this.recreate(e):(null==(t=this.valuePillSelect)||t.setValues(e,e.filter(e=>e.selected)),this.refreshValueSelect(e),this.refreshAggFuncControls(e,this.chartController.getAggFunc()))}recreate(e){this.isOpen=this.groupComp.isExpanded(),It._.clearElement(this.getGui()),this.destroyBean(this.groupComp),this.dimensionCols=e,this.init()}createCategoriesGroup(e){this.createGroup(e,e=>{var t;return null!=(t=e.displayName)?t:""},"categoryAdd","categorySelect",()=>!this.chartController.getAggFunc())}createLegacyCategoriesGroup(e){const t=`chartDimension${this.groupComp.getCompId()}`,i=this.allowMultipleSelection;if(e.forEach(e=>{var n;const s={label:null!=(n=e.displayName)?n:"",value:e.selected,inputName:t},r=this.groupComp.createManagedBean(i?(()=>{const e=new It.AgCheckbox(s);return e.addCssClass("ag-data-select-checkbox"),e})():new It.AgRadioButton(s));this.addChangeListener(r,e),this.groupComp.addItem(r),this.columnComps.set(e.colId,r),i&&this.addDragHandle(r,e)}),i){const e=this.groupComp.getGui(),t={getIconName:()=>It.DragAndDropService.ICON_MOVE,getContainer:()=>e,onDragging:e=>this.onDragging(e),onDragLeave:()=>this.onDragLeave(),isInterestedIn:this.isInterestedIn.bind(this),targetContainsSource:!0};this.dragAndDropService.addDropTarget(t),this.addDestroyFunc(()=>this.dragAndDropService.removeDropTarget(t))}}createAggFuncControls(e){const t=this.chartController.getAggFunc();this.groupComp.addItem(this.aggFuncToggle=this.createBean(new It.AgToggleButton({label:this.chartTranslationService.translate("aggregate"),labelAlignment:"left",labelWidth:"flex",inputWidth:"flex",value:null!=t,onValueChange:e=>{var t,i;const n=e?"sum":void 0;this.chartController.setAggFunc(n),null==(t=this.aggFuncSelect)||t.setValue(n,!0),null==(i=this.aggFuncSelect)||i.setDisplayed(null!=n)}}))),this.groupComp.addItem(this.aggFuncSelect=this.createBean(new It.AgSelect({options:[{value:"sum",text:this.chartTranslationService.translate("sum")},{value:"first",text:this.chartTranslationService.translate("first")},{value:"last",text:this.chartTranslationService.translate("last")},{value:"min",text:this.chartTranslationService.translate("min")},{value:"max",text:this.chartTranslationService.translate("max")},{value:"count",text:this.chartTranslationService.translate("count")},{value:"avg",text:this.chartTranslationService.translate("avg")}],value:"string"==typeof t?t:void 0,onValueChange:e=>{this.chartController.setAggFunc(e)}}))),this.refreshAggFuncControls(e,t)}refreshAggFuncControls(e,t){var i,n,s,r;const o=e.filter(e=>e.selected).some(e=>e.colId!==On.DEFAULT_CATEGORY);null==(i=this.aggFuncToggle)||i.setValue(null!=t),null==(n=this.aggFuncSelect)||n.setValue("string"==typeof t?t:void 0,!0),null==(s=this.aggFuncToggle)||s.setDisplayed(o),null==(r=this.aggFuncSelect)||r.setDisplayed(o&&null!=t)}clearAggFuncControls(){this.aggFuncToggle=this.aggFuncToggle&&this.destroyBean(this.aggFuncToggle),this.aggFuncSelect=this.aggFuncSelect&&this.destroyBean(this.aggFuncSelect)}destroy(){this.clearAggFuncControls(),this.groupComp=this.destroyBean(this.groupComp),super.destroy()}};us.TEMPLATE='<div id="categoriesGroup"></div>',fn([(0,It.Autowired)("chartMenuService")],us.prototype,"chartMenuService",2),fn([It.PostConstruct],us.prototype,"init",1);var ds=us,ps=class e extends hs{constructor(t,i,n,s,r,o,a,l){super(t,i,r,o,e.TEMPLATE),this.chartOptionsService=n,this.title=s,this.valueCols=a,this.isOpen=l}init(){if(this.groupComp=this.createBean(new Pt.AgGroupComponent({title:this.title,enabled:!0,suppressEnabledCheckbox:!0,suppressOpenCloseIcons:!1,cssIdentifier:"charts-data",expanded:this.isOpen})),this.chartController.isActiveXYChart()){const e=this.groupComp.createManagedBean(new Pt.AgToggleButton({label:this.chartTranslationService.translate("paired"),labelAlignment:"left",labelWidth:"flex",inputWidth:"flex",value:this.chartOptionsService.getPairedMode(),onValueChange:e=>{this.chartOptionsService.setPairedMode(!!e),this.chartController.updateForGridChange({maintainColState:!0})}}));this.groupComp.addItem(e)}this.chartMenuService.isLegacyFormat()?this.createLegacySeriesGroup(this.valueCols):this.createSeriesGroup(this.valueCols),this.getGui().appendChild(this.groupComp.getGui())}refresh(e){var t,i;if(this.chartMenuService.isLegacyFormat())if(this.refreshColumnComps(e)){if(this.chartController.isActiveXYChart()){const t=this.generateGetSeriesLabel(e);e.forEach(e=>{this.columnComps.get(e.colId).setLabel(t(e))})}}else this.recreate(e);else null==(t=this.valuePillSelect)||t.setValueFormatter(this.generateGetSeriesLabel(e)),null==(i=this.valuePillSelect)||i.setValues(e,e.filter(e=>e.selected)),this.refreshValueSelect(e)}recreate(e){this.isOpen=this.groupComp.isExpanded(),Pt._.clearElement(this.getGui()),this.destroyBean(this.groupComp),this.valueCols=e,this.init()}createSeriesGroup(e){this.createGroup(e,this.generateGetSeriesLabel(e),"seriesAdd","seriesSelect")}createLegacySeriesGroup(e){const t=this.generateGetSeriesLabel(e);e.forEach(e=>{const i=t(e),n=this.groupComp.createManagedBean(new Pt.AgCheckbox({label:i,value:e.selected}));n.addCssClass("ag-data-select-checkbox"),this.addChangeListener(n,e),this.groupComp.addItem(n),this.columnComps.set(e.colId,n),this.addDragHandle(n,e)});const i=this.groupComp.getGui(),n={getIconName:()=>Pt.DragAndDropService.ICON_MOVE,getContainer:()=>i,onDragging:e=>this.onDragging(e),onDragLeave:()=>this.onDragLeave(),isInterestedIn:this.isInterestedIn.bind(this),targetContainsSource:!0};this.dragAndDropService.addDropTarget(n),this.addDestroyFunc(()=>this.dragAndDropService.removeDropTarget(n))}generateGetSeriesLabel(e){if(!this.chartController.isActiveXYChart())return e=>{var t;return null!=(t=e.displayName)?t:""};const t=e.filter(e=>e.selected),i="bubble"===this.chartController.getChartType(),n=this.chartOptionsService.getPairedMode(),s=new Map;return s.set(0,"X"),s.set(1,"Y"),s.set(2,"size"),e=>{var r;const o=null!=(r=e.displayName)?r:"";if(!e.selected)return o;const a=t.indexOf(e);if(-1===a)return o;let l;return l=n?s.get(a%(i?3:2)):0===a?"X":i&&a%2==0?"size":"Y",`${o} (${l})`}}destroy(){this.groupComp=this.destroyBean(this.groupComp),super.destroy()}};ps.TEMPLATE='<div id="seriesGroup"></div>',fn([(0,Pt.Autowired)("chartMenuService")],ps.prototype,"chartMenuService",2),fn([Pt.PostConstruct],ps.prototype,"init",1);var gs=ps,fs=class e extends _t.Component{constructor(t,i,n){super(e.TEMPLATE),this.chartController=t,this.columns=i,this.isOpen=n,this.selectedColIds=[],this.chartTypeComps=new Map,this.secondaryAxisComps=new Map}init(){this.createSeriesChartTypeGroup(this.columns)}refresh(e){_t._.areEqual(this.getValidColIds(e),this.selectedColIds)?this.refreshComps():this.recreate(e)}recreate(e){this.isOpen=this.seriesChartTypeGroupComp.isExpanded(),_t._.clearElement(this.getGui()),this.destroyBean(this.seriesChartTypeGroupComp),this.columns=e,this.selectedColIds=[],this.clearComps(),this.init()}getValidColIds(e){const t=this.chartController.getSeriesChartTypes();return e.filter(e=>e.selected&&!!t.filter(t=>t.colId===e.colId)[0]).map(({colId:e})=>e)}createSeriesChartTypeGroup(e){this.seriesChartTypeGroupComp=this.createBean(new _t.AgGroupComponent({title:this.chartTranslationService.translate("seriesChartType"),enabled:!0,suppressEnabledCheckbox:!0,suppressOpenCloseIcons:!1,cssIdentifier:"charts-data",expanded:this.isOpen}));const t=this.chartController.getSeriesChartTypes();e.forEach(e=>{if(!e.selected)return;const i=t.filter(t=>t.colId===e.colId)[0];if(!i)return;this.selectedColIds.push(e.colId);const n=this.seriesChartTypeGroupComp.createManagedBean(new _t.AgGroupComponent({title:e.displayName,enabled:!0,suppressEnabledCheckbox:!0,suppressOpenCloseIcons:!0,cssIdentifier:"charts-format-sub-level"})),s=this.seriesChartTypeGroupComp.createManagedBean(new _t.AgCheckbox({label:this.chartTranslationService.translate("secondaryAxis"),labelWidth:"flex",disabled:(r=i.chartType,["groupedColumn","stackedColumn","stackedArea"].includes(r)),value:!!i.secondaryAxis,onValueChange:t=>this.chartController.updateSeriesChartType(e.colId,void 0,t)}));var r;n.addItem(s);const o=e=>this.chartTranslationService.translate(e),a=[{value:"line",text:o("line")},{value:"area",text:o("area")},{value:"stackedArea",text:o("stackedArea")},{value:"groupedColumn",text:o("groupedColumn")},{value:"stackedColumn",text:o("stackedColumn")}],l=n.createManagedBean(new _t.AgSelect({labelAlignment:"left",labelWidth:"flex",options:a,value:i.chartType,onValueChange:t=>this.chartController.updateSeriesChartType(e.colId,t)}));n.addItem(l),this.seriesChartTypeGroupComp.addItem(n),this.chartTypeComps.set(e.colId,l),this.secondaryAxisComps.set(e.colId,s)}),this.getGui().appendChild(this.seriesChartTypeGroupComp.getGui())}refreshComps(){const e=this.chartController.getSeriesChartTypes();this.selectedColIds.forEach(t=>{const i=e.find(e=>e.colId===t);if(!i)return;const n=this.chartTypeComps.get(t),s=this.secondaryAxisComps.get(t);null==n||n.setValue(i.chartType),null==s||s.setValue(!!i.secondaryAxis),null==s||s.setDisabled(this.isSecondaryAxisDisabled(i.chartType))})}clearComps(){this.chartTypeComps.clear(),this.secondaryAxisComps.clear()}isSecondaryAxisDisabled(e){return["groupedColumn","stackedColumn","stackedArea"].includes(e)}destroy(){this.clearComps(),this.seriesChartTypeGroupComp=this.destroyBean(this.seriesChartTypeGroupComp),super.destroy()}};fs.TEMPLATE='<div id="seriesChartTypeGroup"></div>',fn([(0,_t.Autowired)("chartTranslationService")],fs.prototype,"chartTranslationService",2),fn([_t.PostConstruct],fs.prototype,"init",1);var ms=fs,ys=class e extends Lt.Component{constructor(e,t){super(),this.getValue=e,this.setValue=t}init(){this.switchCategorySeriesToggleButton=this.createManagedBean(new Lt.AgToggleButton({label:this.chartTranslationService.translate("switchCategorySeries"),labelAlignment:"left",labelWidth:"flex",inputWidth:"flex",value:this.getValue(),onValueChange:e=>{this.setValue(e)}}));const t={title:void 0,suppressEnabledCheckbox:!0,suppressOpenCloseIcons:!0,cssIdentifier:"charts-data",expanded:!0,items:[this.switchCategorySeriesToggleButton]};this.setTemplate(e.TEMPLATE,{switchCategorySeriesGroup:t})}refresh(){var e;null==(e=this.switchCategorySeriesToggleButton)||e.setValue(this.getValue(),!0)}};ys.TEMPLATE='<div>\n        <ag-group-component ref="switchCategorySeriesGroup"></ag-group-component>\n    </div>',fn([(0,Lt.Autowired)("chartTranslationService")],ys.prototype,"chartTranslationService",2),fn([Lt.PostConstruct],ys.prototype,"init",1);var vs=ys,bs={groups:[{type:"categories",isOpen:!0},{type:"series",isOpen:!0},{type:"seriesChartType",isOpen:!0}]},Cs=class e extends yt.Component{constructor(t,i){super(e.TEMPLATE),this.chartController=t,this.chartOptionsService=i,this.isSwitchCategorySeriesToggled=!1}init(){this.switchCategorySeriesPanel=this.addComponent(this.createManagedBean(new vs(()=>this.chartController.isCategorySeriesSwitched(),e=>this.chartController.switchCategorySeries(e)))),this.isSwitchCategorySeriesToggled=this.chartController.isCategorySeriesSwitched(),this.createAutoScrollService(),this.updatePanels(),this.addManagedListener(this.chartController,rs.EVENT_CHART_MODEL_UPDATE,this.updatePanels.bind(this)),this.addManagedListener(this.chartController,rs.EVENT_CHART_API_UPDATE,this.updatePanels.bind(this))}destroy(){this.clearPanelComponents(),super.destroy()}updatePanels(){var e,t,i,n,s;const r=this.chartType,o=this.isSwitchCategorySeriesToggled,{dimensionCols:a,valueCols:l}=this.chartController.getColStateForMenu();this.chartType=this.chartController.getChartType(),this.isSwitchCategorySeriesToggled=this.chartController.isCategorySeriesSwitched();const c=this.isSwitchCategorySeriesToggled!==o;this.canRefresh(r,this.chartType)&&!c?(null==(e=this.categoriesDataPanel)||e.refresh(a),null==(t=this.seriesDataPanel)||t.refresh(l),null==(i=this.seriesChartTypePanel)||i.refresh(l)):this.recreatePanels(a,l),null==(n=this.switchCategorySeriesPanel)||n.setDisplayed(Ln(this.chartType)&&!this.chartMenuService.isLegacyFormat()&&!this.chartController.isGrouping()),c&&(null==(s=this.switchCategorySeriesPanel)||s.refresh())}canRefresh(e,t){if(void 0===e)return!1;if(e===t)return!0;const i=e=>["columnLineCombo","areaColumnCombo","customCombo"].includes(e);return!(!i(e)||!i(t))}recreatePanels(e,t){var i;this.clearPanelComponents();const{chartType:n}=this;if(!n)return;const s=this.chartController.isCategorySeriesSwitched(),r=null==(i=this.getDataPanelDef().groups)?void 0:i.map(({type:i,isOpen:r})=>i===(s?"series":"categories")?this.categoriesDataPanel=this.createBean(new ds(this.chartController,this.autoScrollService,this.getCategoryGroupTitle(s),this.getCategoryGroupMultipleSelect(n,s),e,r)):i===(s?"categories":"series")?this.seriesDataPanel=this.createBean(new gs(this.chartController,this.autoScrollService,this.chartOptionsService,this.getSeriesGroupTitle(s),this.getSeriesGroupMultipleSelect(n,s),this.getSeriesGroupMaxSelection(n,s),t,r)):"seriesChartType"===i?this.chartController.isComboChart()?this.seriesChartTypePanel=this.createBean(new ms(this.chartController,t,r)):null:(yt._.warnOnce(`Invalid charts data panel group name supplied: '${i}'`),null)).filter(e=>null!=e);r&&this.addPanelComponents(r)}addPanelComponents(e){var t;const i=document.createDocumentFragment();for(const t of e)this.registerComponent(t),i.appendChild(t.getGui());const n=null==(t=this.switchCategorySeriesPanel)?void 0:t.getGui();return this.getGui().insertBefore(i,null!=n?n:null),e}clearPanelComponents(){const e=this.getGui();this.categoriesDataPanel&&e.removeChild(this.categoriesDataPanel.getGui()),this.seriesDataPanel&&e.removeChild(this.seriesDataPanel.getGui()),this.seriesChartTypePanel&&e.removeChild(this.seriesChartTypePanel.getGui()),this.categoriesDataPanel=this.destroyBean(this.categoriesDataPanel),this.seriesDataPanel=this.destroyBean(this.seriesDataPanel),this.seriesChartTypePanel=this.destroyBean(this.seriesChartTypePanel)}createAutoScrollService(){const e=this.getGui();this.autoScrollService=new yt.AutoScrollService({scrollContainer:e,scrollAxis:"y",getVerticalPosition:()=>e.scrollTop,setVerticalPosition:t=>e.scrollTop=t})}addComponent(e){return this.registerComponent(e),this.getGui().appendChild(e.getGui()),e}registerComponent(e){e.addCssClass("ag-chart-data-section")}getDataPanelDef(){var e,t;return null!=(t=null==(e=this.gos.get("chartToolPanelsDef"))?void 0:e.dataPanel)?t:bs}getCategoryGroupTitle(e){return e?this.chartTranslationService.translate("seriesLabels"):this.chartTranslationService.translate(this.chartController.isActiveXYChart()?"labels":"categories")}getCategoryGroupMultipleSelect(e,t){return!t&&1!==Pn(e)}getSeriesGroupTitle(e){return e?this.chartTranslationService.translate("categoryValues"):this.chartTranslationService.translate(this.chartController.isActiveXYChart()?"xyValues":"series")}getSeriesGroupMultipleSelect(e,t){return 1!==this.getSeriesGroupMaxSelection(e,t)}getSeriesGroupMaxSelection(e,t){if(!t)return _n(e)}};Cs.TEMPLATE='<div class="ag-chart-data-wrapper ag-scrollable-container"></div>',fn([(0,yt.Autowired)("chartTranslationService")],Cs.prototype,"chartTranslationService",2),fn([(0,yt.Autowired)("chartMenuService")],Cs.prototype,"chartMenuService",2),fn([yt.PostConstruct],Cs.prototype,"init",1);var ws=Cs,Ss=class e extends Ft.Component{constructor(e){super(),this.activeComps=[],this.params=e,this.chartOptions=e.chartMenuUtils.getChartOptions()}init(){const t={cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.params.name||this.chartTranslationService.translate("font"),enabled:this.params.enabled,suppressEnabledCheckbox:!!this.params.suppressEnabledCheckbox,onEnableChange:e=>{this.params.onEnableChange&&this.params.onEnableChange(e)}};this.setTemplate(e.TEMPLATE,{fontGroup:t,familySelect:this.getFamilySelectParams(),weightStyleSelect:this.getWeightStyleSelectParams(),sizeSelect:this.getSizeSelectParams(),colorPicker:this.params.chartMenuUtils.getDefaultColorPickerParams(this.params.keyMapper("color"))})}addCompToPanel(e){this.fontGroup.addItem(e),this.activeComps.push(e)}setEnabled(e){this.fontGroup.setEnabled(e)}getFamilySelectParams(){const e=["Arial, sans-serif","Aria Black, sans-serif","Book Antiqua,  serif","Charcoal, sans-serif","Comic Sans MS, cursive","Courier, monospace","Courier New, monospace","Gadget, sans-serif","Geneva, sans-serif","Helvetica, sans-serif","Impact, sans-serif","Lucida Console, monospace","Lucida Grande, sans-serif","Lucida Sans Unicode,  sans-serif","Monaco, monospace","Palatino Linotype, serif","Palatino, serif","Times New Roman, serif","Times, serif","Verdana, sans-serif"],t=this.getInitialFontValue("fontFamily");let i=e[0];if(t){const n=e.map(e=>e.toLowerCase()).indexOf(t.toLowerCase());if(n>=0)i=e[n];else{const n=Ft._.capitalise(t);e.push(n),i=n}}return{options:e.sort().map(e=>({value:e,text:e})),inputWidth:"flex",value:`${i}`,onValueChange:e=>this.setFont({fontFamily:e})}}getSizeSelectParams(){const e=[8,10,12,14,16,18,20,22,24,26,28,30,32,34,36],t=this.getInitialFontValue("fontSize");return Ft._.includes(e,t)||e.push(t),{options:e.sort((e,t)=>e-t).map(e=>({value:`${e}`,text:`${e}`})),inputWidth:"flex",value:`${t}`,onValueChange:e=>this.setFont({fontSize:parseInt(e,10)}),label:this.chartTranslationService.translate("size")}}getWeightStyleSelectParams(){var e,t;const i=null!=(e=this.getInitialFontValue("fontWeight"))?e:"normal",n=null!=(t=this.getInitialFontValue("fontStyle"))?t:"normal",s=[{name:"normal",weight:"normal",style:"normal"},{name:"bold",weight:"bold",style:"normal"},{name:"italic",weight:"normal",style:"italic"},{name:"boldItalic",weight:"bold",style:"italic"}];let r=s.find(e=>e.weight===i&&e.style===n);return r||(r={name:"predefined",weight:i,style:n},s.unshift(r)),{options:s.map(e=>({value:e.name,text:this.chartTranslationService.translate(e.name)})),inputWidth:"flex",value:r.name,onValueChange:e=>{const t=s.find(t=>t.name===e);this.setFont({fontWeight:t.weight,fontStyle:t.style})}}}addItemToPanel(e){this.fontGroup.addItem(e),this.activeComps.push(e)}destroyActiveComps(){this.activeComps.forEach(e=>{Ft._.removeFromParent(e.getGui()),this.destroyBean(e)})}destroy(){this.destroyActiveComps(),super.destroy()}setFont(e){const{keyMapper:t}=this.params;Object.entries(e).forEach(([e,i])=>{i&&this.chartOptions.setValue(t(e),i)})}getInitialFontValue(e){const{keyMapper:t}=this.params;return this.chartOptions.getValue(t(e))}};Ss.TEMPLATE='<div class="ag-font-panel">\n            <ag-group-component ref="fontGroup">\n                <ag-select ref="familySelect"></ag-select>\n                <ag-select ref="weightStyleSelect"></ag-select>\n                <div class="ag-charts-font-size-color">\n                    <ag-select ref="sizeSelect"></ag-select>\n                    <ag-color-picker ref="colorPicker"></ag-color-picker>\n                </div>\n            </ag-group-component>\n        </div>',fn([(0,Ft.RefSelector)("fontGroup")],Ss.prototype,"fontGroup",2),fn([(0,Ft.Autowired)("chartTranslationService")],Ss.prototype,"chartTranslationService",2),fn([Ft.PostConstruct],Ss.prototype,"init",1);var xs=Ss,Es=class e extends Ot.Component{constructor({chartMenuParamsFactory:e,isExpandedOnInit:t=!1}){super(),this.chartMenuUtils=e,this.isExpandedOnInit=t}init(){const t=this.chartMenuUtils.addEnableParams("legend.enabled",{cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.chartTranslationService.translate("legend"),suppressEnabledCheckbox:!1,suppressToggleExpandOnEnableChange:!0,expanded:this.isExpandedOnInit,items:[this.createLabelPanel()]});this.setTemplate(e.TEMPLATE,{legendGroup:t,legendPositionSelect:this.chartMenuUtils.getDefaultLegendParams("legend.position"),legendPaddingSlider:this.getSliderParams("spacing","spacing",200),markerSizeSlider:this.getSliderParams("item.marker.size","markerSize",40),markerStrokeSlider:this.getSliderParams("item.marker.strokeWidth","markerStroke",10),markerPaddingSlider:this.getSliderParams("item.marker.padding","itemSpacing",20),itemPaddingXSlider:this.getSliderParams("item.paddingX","layoutHorizontalSpacing",50),itemPaddingYSlider:this.getSliderParams("item.paddingY","layoutVerticalSpacing",50)})}getSliderParams(e,t,i){return this.chartMenuUtils.getDefaultSliderParams(`legend.${e}`,t,i)}createLabelPanel(){const e={enabled:!0,suppressEnabledCheckbox:!0,chartMenuUtils:this.chartMenuUtils,keyMapper:e=>`legend.item.label.${e}`};return this.createManagedBean(new xs(e))}};Es.TEMPLATE='<div>\n            <ag-group-component ref="legendGroup">\n                <ag-select ref="legendPositionSelect"></ag-select>\n                <ag-slider ref="legendPaddingSlider"></ag-slider>\n                <ag-slider ref="markerSizeSlider"></ag-slider>\n                <ag-slider ref="markerStrokeSlider"></ag-slider>\n                <ag-slider ref="markerPaddingSlider"></ag-slider>\n                <ag-slider ref="itemPaddingXSlider"></ag-slider>\n                <ag-slider ref="itemPaddingYSlider"></ag-slider>\n            </ag-group-component>\n        </div>',fn([(0,Ot.Autowired)("chartTranslationService")],Es.prototype,"chartTranslationService",2),fn([Ot.PostConstruct],Es.prototype,"init",1);var As=Es,Ms=class e extends Bt.Component{constructor(e){super(),this.chartMenuUtils=e}init(){const t=this.chartMenuUtils.addEnableParams("tick.enabled",{cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslationService.translate("ticks"),suppressEnabledCheckbox:!1}),i=this.chartMenuUtils.getDefaultColorPickerParams("tick.color"),n=this.chartMenuUtils.getDefaultSliderParams("tick.width","width",10),s=this.chartMenuUtils.getDefaultSliderParams("tick.size","length",30);this.setTemplate(e.TEMPLATE,{axisTicksGroup:t,axisTicksColorPicker:i,axisTicksWidthSlider:n,axisTicksSizeSlider:s})}};Ms.TEMPLATE='<div>\n            <ag-group-component ref="axisTicksGroup">\n                <ag-color-picker ref="axisTicksColorPicker"></ag-color-picker>\n                <ag-slider ref="axisTicksWidthSlider"></ag-slider>\n                <ag-slider ref="axisTicksSizeSlider"></ag-slider>\n            </ag-group-component>\n        </div>',fn([(0,Bt.Autowired)("chartTranslationService")],Ms.prototype,"chartTranslationService",2),fn([Bt.PostConstruct],Ms.prototype,"init",1);var Ts=Ms,Ds=class e extends Vt.Component{constructor(e){super(),this.chartMenuUtils=e,this.chartOptions=e.getChartOptions()}init(){const t=this.chartMenuUtils.addEnableParams("gridLine.enabled",{cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslationService.translate("gridLines"),suppressEnabledCheckbox:!1}),i=this.getGridLineColorPickerParams("color"),n=this.getGridLineWidthSliderParams("thickness"),s=this.getGridLineDashSliderParams("lineDash");this.setTemplate(e.TEMPLATE,{gridLineGroup:t,gridLineColorPicker:i,gridLineWidthSlider:n,gridLineLineDashSlider:s})}getGridLineColorPickerParams(e){return this.chartMenuUtils.getDefaultColorPickerParams("gridLine.style",e,{formatInputValue:e=>{var t;return null==(t=null==e?void 0:e[0])?void 0:t.stroke},parseInputValue:e=>{var t;const i=null!=(t=this.chartOptions.getValue("gridLine.style"))?t:[];return 0===i.length?[{stroke:e,lineDash:[]}]:[pn(dn({},i[0]),{stroke:e})]}})}getGridLineWidthSliderParams(e){return this.chartMenuUtils.getDefaultSliderParams("gridLine.width",e,10)}getGridLineDashSliderParams(e){var t,i;const n=this.chartOptions.getValue("gridLine.style"),s=null==(i=null==(t=null==n?void 0:n[0])?void 0:t.lineDash)?void 0:i[0],r=this.chartMenuUtils.getDefaultSliderParamsWithoutValueParams(null!=s?s:0,e,30);return r.onValueChange=e=>{const t=this.chartOptions.getValue("gridLine.style.0.stroke");this.chartOptions.setValue("gridLine.style",[{lineDash:[e],stroke:t}])},r}};Ds.TEMPLATE='<div>\n            <ag-group-component ref="gridLineGroup">\n                <ag-color-picker ref="gridLineColorPicker"></ag-color-picker>\n                <ag-slider ref="gridLineWidthSlider"></ag-slider>\n                <ag-slider ref="gridLineLineDashSlider"></ag-slider>\n            </ag-group-component>\n        </div>',fn([(0,Vt.Autowired)("chartTranslationService")],Ds.prototype,"chartTranslationService",2),fn([Vt.PostConstruct],Ds.prototype,"init",1);var Is=Ds,Rs=class e extends Ht.AgAbstractLabel{constructor(t){super(t,e.TEMPLATE),this.radius=0,this.offsetX=0,this.offsetY=0}postConstruct(){super.postConstruct();const{value:e,onValueChange:t}=this.config;null!=e&&this.setValue(e,void 0,!0),null!=t&&this.onValueChange(t),this.dragListener={eElement:this.eParentCircle,dragStartPixels:0,onDragStart:e=>{this.parentCircleRect=this.eParentCircle.getBoundingClientRect()},onDragging:e=>this.calculateAngleDrag(e),onDragStop:()=>{}},this.dragService.addDragSource(this.dragListener),this.eAngleValue.setLabel("").setLabelWidth(5).setInputWidth(45).setMin(0).setMax(360).setValue(`${this.degrees}`).onValueChange(e=>{null!=e&&""!==e||(e="0"),e=this.eAngleValue.normalizeValue(e);let t=parseFloat(e);t>180&&(t-=360),this.setValue(t)}),this.updateNumberInput(),Ht._.exists(this.getValue())&&this.eAngleValue.setValue(this.normalizeNegativeValue(this.getValue()).toString()),this.addManagedListener(this,Ht.Events.EVENT_FIELD_VALUE_CHANGED,()=>{this.eAngleValue.getInputElement().contains(this.gos.getActiveDomElement())||this.updateNumberInput()})}updateNumberInput(){const e=this.normalizeNegativeValue(this.getValue());this.eAngleValue.setValue(e.toString())}positionChildCircle(e){const t=this.parentCircleRect||{width:24,height:24},i=this.eChildCircle,n=t.width/2,s=t.height/2;i.style.left=`${n+8*Math.cos(e)}px`,i.style.top=`${s+8*Math.sin(e)}px`}calculatePolar(){const e=this.offsetX,t=this.offsetY,i=Math.atan2(t,e);this.degrees=this.toDegrees(i),this.radius=Math.sqrt(e*e+t*t),this.positionChildCircle(i)}calculateCartesian(){const e=this.toRadians(this.getValue()),t=this.getRadius();this.setOffsetX(Math.cos(e)*t).setOffsetY(Math.sin(e)*t)}setOffsetX(e){return this.offsetX!==e&&(this.offsetX=e,this.calculatePolar()),this}setOffsetY(e){return this.offsetY!==e&&(this.offsetY=e,this.calculatePolar()),this}calculateAngleDrag(e){const t=this.parentCircleRect,i=t.width/2,n=t.height/2,s=e.clientX-t.left-i,r=e.clientY-t.top-n,o=Math.atan2(r,s);this.setValue(o,!0)}toDegrees(e){return e/Math.PI*180}toRadians(e){return e/180*Math.PI}normalizeNegativeValue(e){return e<0?360+e:e}normalizeAngle180(e){return(e%=2*Math.PI)<-Math.PI?e+=2*Math.PI:e>=Math.PI&&(e-=2*Math.PI),e}getRadius(){return this.radius}setRadius(e){return this.radius===e||(this.radius=e,this.calculateCartesian()),this}onValueChange(e){return this.addManagedListener(this,Ht.Events.EVENT_FIELD_VALUE_CHANGED,()=>{e(this.degrees)}),this}getValue(e){return e?this.toRadians(this.degrees):this.degrees}setValue(e,t,i){let n;return n=t?e:this.normalizeAngle180(this.toRadians(e)),e=this.toDegrees(n),this.degrees!==e&&(this.degrees=Math.floor(e),this.calculateCartesian(),this.positionChildCircle(n),i||this.dispatchEvent({type:Ht.Events.EVENT_FIELD_VALUE_CHANGED})),this}setWidth(e){return Ht._.setFixedWidth(this.getGui(),e),this}setDisabled(e){return super.setDisabled(e),this.eAngleValue.setDisabled(e),this}destroy(){this.dragService.removeDragSource(this.dragListener),super.destroy()}};Rs.TEMPLATE='<div class="ag-angle-select">\n            <div ref="eLabel"></div>\n            <div class="ag-wrapper ag-angle-select-wrapper">\n                <div ref="eAngleSelectField" class="ag-angle-select-field">\n                    <div ref="eParentCircle" class="ag-angle-select-parent-circle">\n                        <div ref="eChildCircle" class="ag-angle-select-child-circle"></div>\n                    </div>\n                </div>\n                <ag-input-number-field ref="eAngleValue"></ag-input-number-field>\n            </div>\n        </div>',fn([(0,Ht.RefSelector)("eLabel")],Rs.prototype,"eLabel",2),fn([(0,Ht.RefSelector)("eParentCircle")],Rs.prototype,"eParentCircle",2),fn([(0,Ht.RefSelector)("eChildCircle")],Rs.prototype,"eChildCircle",2),fn([(0,Ht.RefSelector)("eAngleValue")],Rs.prototype,"eAngleValue",2),fn([(0,Ht.Autowired)("dragService")],Rs.prototype,"dragService",2);var ks=Rs,Ps=class extends Ut.BeanStub{constructor(e){super(),this.chartOptionsProxy=e}getDefaultColorPickerParams(e,t,i){return this.addValueParams(e,{label:this.chartTranslationService.translate(null!=t?t:"color"),labelWidth:"flex",inputWidth:"flex"},i)}getDefaultNumberInputParams(e,t,i){return this.addValueParams(e,{label:this.chartTranslationService.translate(t),labelWidth:"flex",inputWidth:"flex",precision:null==i?void 0:i.precision,step:null==i?void 0:i.step,min:null==i?void 0:i.min,max:null==i?void 0:i.max},{parseInputValue:e=>{const t=Number(e);return isNaN(t)?void 0:t},formatInputValue:e=>null==e?"":`${e}`})}getDefaultSliderParams(e,t,i,n){var s;let r=null!=(s=this.chartOptionsProxy.getValue(e))?s:0;n&&Array.isArray(r)&&(r=r[0]);const o=this.getDefaultSliderParamsWithoutValueParams(r,t,i);return o.onValueChange=t=>this.chartOptionsProxy.setValue(e,n?[t]:t),o}getDefaultSliderParamsWithoutValueParams(e,t,i){return{label:this.chartTranslationService.translate(t),minValue:0,maxValue:Math.max(e,i),textFieldWidth:45,value:`${e}`}}getDefaultCheckboxParams(e,t,i){const n=this.chartOptionsProxy.getValue(e),s={label:this.chartTranslationService.translate(t),value:n,readOnly:null==i?void 0:i.readOnly,passive:null==i?void 0:i.passive};return s.onValueChange=t=>{this.chartOptionsProxy.setValue(e,"boolean"==typeof t?t:void 0)},s}getDefaultSelectParams(e,t,i,n){const s=this.chartOptionsProxy.getValue(e),r={label:this.chartTranslationService.translate(t),value:s,options:i,pickerType:null==n?void 0:n.pickerType,pickerAriaLabelKey:null==n?void 0:n.pickerAriaLabelKey,pickerAriaLabelValue:null==n?void 0:n.pickerAriaLabelValue};return r.onValueChange=t=>{this.chartOptionsProxy.setValue(e,t)},r}getDefaultLegendParams(e){return this.addValueParams(e,{label:this.chartTranslationService.translate("position"),labelWidth:"flex",inputWidth:"flex",options:["top","right","bottom","left"].map(e=>({value:e,text:this.chartTranslationService.translate(e)}))})}getDefaultFontPanelParams(e,t){const i=t=>`${e}.${t}`;return this.addEnableParams(i("enabled"),{name:this.chartTranslationService.translate(t),suppressEnabledCheckbox:!1,chartMenuUtils:this,keyMapper:i})}addValueParams(e,t,i){const n=this.chartOptionsProxy.getValue(e);return t.value=(null==i?void 0:i.formatInputValue)?i.formatInputValue(n):n,t.onValueChange=t=>{const n=(null==i?void 0:i.parseInputValue)?i.parseInputValue(t):t;this.chartOptionsProxy.setValue(e,n)},t}addEnableParams(e,t){var i;return t.enabled=null!=(i=this.chartOptionsProxy.getValue(e))&&i,t.onEnableChange=t=>this.chartOptionsProxy.setValue(e,t),t}getChartOptions(){return this.chartOptionsProxy}};fn([(0,Ut.Autowired)("chartTranslationService")],Ps.prototype,"chartTranslationService",2);var _s=class e extends Gt.Component{constructor(e,{chartController:t,chartOptionsService:i,isExpandedOnInit:n=!1,seriesType:s}){super(),this.activePanels=[],this.axisLabelUpdateFuncs=[],this.axisType=e,this.chartController=t,this.chartAxisOptionsProxy=i.getCartesianAxisOptionsProxy(e),this.chartAxisThemeOverridesProxy=i.getCartesianAxisThemeOverridesProxy(e),this.chartAxisAppliedThemeOverridesProxy=i.getCartesianAxisAppliedThemeOverridesProxy(e),this.chartOptionsSeriesProxy=i.getSeriesOptionsProxy(()=>null!=s?s:this.chartController.getChartSeriesType()),this.chartOptionsService=i,this.isExpandedOnInit=n}init(){var t;const i=this.axisType,n={cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.translate(i),expanded:this.isExpandedOnInit,suppressEnabledCheckbox:!0},s=this.createManagedBean(new Ps(this.chartAxisOptionsProxy)),r=this.createManagedBean(new Ps(this.chartAxisThemeOverridesProxy)),o=this.getAxisTypeSelectParams(s,this.chartAxisAppliedThemeOverridesProxy),a=this.getAxisPositionSelectParams(s),l=this.getAxisTimeFormatSelectParams(s),c=this.getAxisColorInputParams(r),h=this.getAxisLineWidthSliderParams(r);this.setTemplate(e.TEMPLATE,{axisGroup:n,axisTypeSelect:null!=o?o:void 0,axisPositionSelect:null!=a?a:void 0,axisTimeFormatSelect:null!=l?l:void 0,axisColorInput:c,axisLineWidthSlider:h}),this.axisTypeSelect.setDisplayed(!!(null==(t=o.options)?void 0:t.length)),a||this.removeTemplateComponent(this.axisPositionSelect);const u=()=>{const e="time"===this.chartAxisOptionsProxy.getValue("type");Gt._.setDisplayed(this.axisTimeFormatSelect.getGui(),e)};l?(u(),this.addManagedListener(this.eventService,Gt.Events.EVENT_CHART_OPTIONS_CHANGED,e=>{u()})):this.removeTemplateComponent(this.axisTimeFormatSelect),this.initGridLines(r),this.initAxisTicks(r),this.initAxisLabels(r),this.addManagedListener(this.chartController,rs.EVENT_CHART_UPDATED,()=>this.axisLabelUpdateFuncs.forEach(e=>e())),this.addManagedListener(this.chartController,rs.EVENT_CHART_MODEL_UPDATE,()=>setTimeout(()=>{this.refreshAxisTypeSelect(s),u()}))}getAxisTypeSelectParams(e,t){const i=e.getChartOptions(),n=this.getAxisTypeSelectOptions(),s=e.getDefaultSelectParams("type","axisType",n);return s.onValueChange=e=>{var n;const s=i.getValue("type");if(e===s)return;const r=t.getValue("*"),o="time"===e,a="time"===s!==o?o?"%d %B %Y":void 0:null;if(this.chartOptionsService.setCartesianCategoryAxisType(this.axisType,e),null!==a){const e=null!=(n=i.getValue("label"))?n:{};i.setValue("label",pn(dn({},e),{format:a}))}t.setValue("*",r)},s}refreshAxisTypeSelect(e){const t=this.getAxisTypeSelectOptions(),i=!!t.length;this.axisTypeSelect.setDisplayed(i),i&&this.axisTypeSelect.clearOptions().addOptions(t).setValue(e.getChartOptions().getValue("type"))}getAxisTypeSelectOptions(){const e=this.chartController.getChartType();return["heatmap","histogram","boxPlot","rangeBar","scatter","bubble"].includes(e)||this.chartController.isGrouping()||!this.isCategoryAxis()||this.chartController.isCategorySeriesSwitched()||!(()=>{const e=this.chartController.getChartData()[0];return!!e&&this.chartController.getSelectedDimensions().every(t=>!isNaN(parseFloat(e[t.colId])))})()?[]:["category","number","time"].map(e=>({value:e,text:this.translate(e)}))}isCategoryAxis(){const e="horizontal"===this.chartOptionsSeriesProxy.getValue("direction");return e&&"yAxis"===this.axisType||!e&&"xAxis"===this.axisType}getAxisPositionSelectParams(e){const t=((e,t)=>{if("heatmap"===e)return null;switch(t){case"xAxis":return[{value:"top",text:this.translate("top")},{value:"bottom",text:this.translate("bottom")}];case"yAxis":return[{value:"left",text:this.translate("left")},{value:"right",text:this.translate("right")}]}})(this.chartController.getChartType(),this.axisType);return t?e.getDefaultSelectParams("position","position",t):null}getAxisTimeFormatSelectParams(e){if(!this.isCategoryAxis())return null;const t=[{value:"%d/%m/%Y",text:this.translate("timeFormatSlashesDDMMYYYY")},{value:"%m/%d/%Y",text:this.translate("timeFormatSlashesMMDDYYYY")},{value:"%d/%m/%y",text:this.translate("timeFormatSlashesDDMMYY")},{value:"%m/%d/%y",text:this.translate("timeFormatSlashesMMDDYY")},{value:"%d.%e.%y",text:this.translate("timeFormatDotsDDMYY")},{value:"%e.%d.%y",text:this.translate("timeFormatDotsMDDYY")},{value:"%Y-%m-%d",text:this.translate("timeFormatDashesYYYYMMDD")},{value:"%d %B %Y",text:this.translate("timeFormatSpacesDDMMMMYYYY")},{value:"%H:%M:%S",text:this.translate("timeFormatHHMMSS")},{value:"%I:%M:%S %p",text:this.translate("timeFormatHHMMSSAmPm")}];return e.getDefaultSelectParams("label.format","timeFormat",t)}getAxisColorInputParams(e){return e.getDefaultColorPickerParams("line.color")}getAxisLineWidthSliderParams(e){var t;const i=e.getChartOptions(),n=e.getDefaultSliderParamsWithoutValueParams(null!=(t=i.getValue("line.enabled")?i.getValue("line.width"):null)?t:0,"thickness",10);return n.onValueChange=e=>{var t;t=0===e?null:e,i.setValues([{expression:"line.enabled",value:null!=t},{expression:"line.width",value:null!=t?t:0}])},n}initGridLines(e){if("heatmap"!==this.chartController.getChartType()){const t=this.createBean(new Is(e));this.axisGroup.addItem(t),this.activePanels.push(t)}}initAxisTicks(e){if(!this.hasConfigurableAxisTicks())return;const t=this.createBean(new Ts(e));this.axisGroup.addItem(t),this.activePanels.push(t)}hasConfigurableAxisTicks(){switch(this.chartController.getChartType()){case"radarLine":case"radarArea":case"rangeBar":case"boxPlot":case"waterfall":return!1;default:return!0}}initAxisLabels(e){const t={name:this.translate("labels"),enabled:!0,suppressEnabledCheckbox:!0,chartMenuUtils:e,keyMapper:e=>`label.${e}`},i=this.createBean(new xs(t));this.axisGroup.addItem(i),this.activePanels.push(i),this.addAdditionalLabelComps(i,e)}addAdditionalLabelComps(e,t){this.addLabelPadding(e,t);const i=this.createRotationWidget("labelRotation",t),n=this.initLabelRotation(i,t);e.addCompToPanel(n),e.addCompToPanel(i)}initLabelRotation(e,t){const i=t.getChartOptions(),n=()=>i.getValue("label.rotation"),s="number"!=typeof n()&&i.getValue("label.autoRotate"),r=this.createBean(new Gt.AgCheckbox({label:this.translate("autoRotate"),value:s,onValueChange:t=>{t&&(this.prevRotation=n()),i.setValues([{expression:"label.autoRotate",value:t},{expression:"label.rotation",value:t?void 0:this.prevRotation}]),e.setDisabled(t)}}));return e.setDisabled(s),r}createRotationWidget(e,t){var i;const n=t.getChartOptions(),s=()=>n.getValue("label.rotation"),r=String.fromCharCode(176),o=`${this.chartTranslationService.translate(e)} ${r}`,a=new ks({label:o,labelWidth:"flex",value:null!=(i=s())?i:0,onValueChange:e=>n.setValue("label.rotation",e)});return this.axisLabelUpdateFuncs.push(()=>{var e;a.setValue(null!=(e=s())?e:0)}),this.createBean(a)}addLabelPadding(e,t){const i=this.createBean(new Gt.AgSlider(t.getDefaultSliderParams("label.padding","padding",30)));e.addCompToPanel(i)}translate(e){return this.chartTranslationService.translate(e)}removeTemplateComponent(e){Gt._.removeFromParent(e.getGui()),this.destroyBean(e)}destroyActivePanels(){this.activePanels.forEach(e=>{Gt._.removeFromParent(e.getGui()),this.destroyBean(e)})}destroy(){this.destroyActivePanels(),super.destroy()}};_s.TEMPLATE='<div>\n            <ag-group-component ref="axisGroup">\n                <ag-select ref="axisTypeSelect"></ag-select>\n                <ag-select ref="axisTimeFormatSelect"></ag-select>\n                <ag-select ref="axisPositionSelect"></ag-select>\n                <ag-color-picker ref="axisColorInput"></ag-color-picker>\n                <ag-slider ref="axisLineWidthSlider"></ag-slider>\n            </ag-group-component>\n        </div>',fn([(0,Gt.RefSelector)("axisGroup")],_s.prototype,"axisGroup",2),fn([(0,Gt.RefSelector)("axisTypeSelect")],_s.prototype,"axisTypeSelect",2),fn([(0,Gt.RefSelector)("axisPositionSelect")],_s.prototype,"axisPositionSelect",2),fn([(0,Gt.RefSelector)("axisTimeFormatSelect")],_s.prototype,"axisTimeFormatSelect",2),fn([(0,Gt.Autowired)("chartTranslationService")],_s.prototype,"chartTranslationService",2),fn([Gt.PostConstruct],_s.prototype,"init",1);var Ls=_s,Ns=class e extends zt.Component{constructor({chartController:e,chartAxisMenuParamsFactory:t,isExpandedOnInit:i=!1}){super(),this.chartController=e,this.chartMenuUtils=t,this.isExpandedOnInit=i}init(){const t={cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.translate("polarAxis"),expanded:this.isExpandedOnInit,suppressEnabledCheckbox:!0},i=this.chartMenuUtils.getDefaultColorPickerParams("line.color"),n=this.chartMenuUtils.getDefaultSliderParams("line.width","thickness",10);this.setTemplate(e.TEMPLATE,{axisGroup:t,axisColorInput:i,axisLineWidthSlider:n}),this.initAxis(),this.initAxisLabels(),this.initRadiusAxis()}initAxis(){const e=this.chartController.getChartType();if(["radarLine","radarArea"].includes(e)){const e=[{value:"circle",text:this.translate("circle")},{value:"polygon",text:this.translate("polygon")}];this.axisGroup.addItem(this.createSelect({labelKey:"shape",options:e,property:"shape"}))}"pie"!==e&&this.axisGroup.addItem(this.createSlider({labelKey:"innerRadius",defaultMaxValue:1,property:"innerRadiusRatio"}))}initAxisLabels(){const e={name:this.translate("labels"),enabled:!0,suppressEnabledCheckbox:!0,chartMenuUtils:this.chartMenuUtils,keyMapper:e=>`label.${e}`},t=this.createManagedBean(new xs(e)),i=this.createOrientationWidget();t.addItemToPanel(i),this.axisGroup.addItem(t)}createOrientationWidget(){const e=[{value:"fixed",text:this.translate("fixed")},{value:"parallel",text:this.translate("parallel")},{value:"perpendicular",text:this.translate("perpendicular")}];return this.createSelect({labelKey:"orientation",options:e,property:"label.orientation"})}initRadiusAxis(){if(!xn(Rn(this.chartController.getChartType()),"isRadial"))return;const e=[this.createSlider({labelKey:"groupPadding",defaultMaxValue:1,property:"paddingInner"}),this.createSlider({labelKey:"seriesPadding",defaultMaxValue:1,property:"groupPaddingInner"})],t=this.createManagedBean(new zt.AgGroupComponent({cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,enabled:!0,suppressEnabledCheckbox:!0,title:this.translate("padding"),items:e})).hideEnabledCheckbox(!0).hideOpenCloseIcons(!0);this.axisGroup.addItem(t)}createSlider(e){const{labelKey:t,defaultMaxValue:i,step:n=.05,property:s}=e,r=this.chartMenuUtils.getDefaultSliderParams(s,t,i);return r.step=n,this.createManagedBean(new zt.AgSlider(r))}createSelect(e){const{labelKey:t,options:i,property:n}=e;return this.createManagedBean(new zt.AgSelect(this.chartMenuUtils.addValueParams(n,{label:this.chartTranslationService.translate(t),labelAlignment:"left",labelWidth:"flex",inputWidth:"flex",options:i})))}translate(e){return this.chartTranslationService.translate(e)}};Ns.TEMPLATE='<div>\n            <ag-group-component ref="axisGroup">\n                <ag-color-picker ref="axisColorInput"></ag-color-picker>\n                <ag-slider ref="axisLineWidthSlider"></ag-slider>\n            </ag-group-component>\n        </div>',fn([(0,zt.RefSelector)("axisGroup")],Ns.prototype,"axisGroup",2),fn([(0,zt.Autowired)("chartTranslationService")],Ns.prototype,"chartTranslationService",2),fn([zt.PostConstruct],Ns.prototype,"init",1);var Os=Ns,Fs=class e extends jt.Component{constructor(e,t){super(),this.chartMenuUtils=e,this.chartController=t}init(){const t={cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslationService.translate("padding"),suppressEnabledCheckbox:!0},i=e=>this.chartMenuUtils.getDefaultSliderParams("padding."+e,e,200);this.setTemplate(e.TEMPLATE,{chartPaddingGroup:t,paddingTopSlider:i("top"),paddingRightSlider:i("right"),paddingBottomSlider:i("bottom"),paddingLeftSlider:i("left")}),this.addManagedListener(this.eventService,jt.Events.EVENT_CHART_OPTIONS_CHANGED,e=>{this.updateTopPadding(e.chartOptions)})}updateTopPadding(e){const t=[...this.chartController.getChartSeriesTypes(),"common"].map(t=>{var i,n;return null==(n=null==(i=e[t])?void 0:i.padding)?void 0:n.top}).find(e=>null!=e);null!=t&&this.paddingTopSlider.setValue(`${t}`)}};Fs.TEMPLATE='<div>\n            <ag-group-component ref="chartPaddingGroup">\n                <ag-slider ref="paddingTopSlider"></ag-slider>\n                <ag-slider ref="paddingRightSlider"></ag-slider>\n                <ag-slider ref="paddingBottomSlider"></ag-slider>\n                <ag-slider ref="paddingLeftSlider"></ag-slider>\n            </ag-group-component>\n        <div>',fn([(0,jt.RefSelector)("paddingTopSlider")],Fs.prototype,"paddingTopSlider",2),fn([(0,jt.Autowired)("chartTranslationService")],Fs.prototype,"chartTranslationService",2),fn([jt.PostConstruct],Fs.prototype,"init",1);var Gs=Fs,Bs=class e extends $t.Component{constructor(e){super(),this.chartMenuUtils=e}init(){const t=this.chartMenuUtils.addEnableParams("background.visible",{cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslationService.translate("background"),suppressEnabledCheckbox:!1}),i=this.chartMenuUtils.getDefaultColorPickerParams("background.fill");this.setTemplate(e.TEMPLATE,{chartBackgroundGroup:t,colorPicker:i})}};Bs.TEMPLATE='<div>\n            <ag-group-component ref="chartBackgroundGroup">\n                <ag-color-picker ref="colorPicker"></ag-color-picker>\n            </ag-group-component>\n        <div>',fn([(0,$t.Autowired)("chartTranslationService")],Bs.prototype,"chartTranslationService",2),fn([$t.PostConstruct],Bs.prototype,"init",1);var Vs=Bs,Hs=class e extends Kt.Component{constructor(t,i){super(e.TEMPLATE),this.chartMenuUtils=t,this.chartController=i,this.activePanels=[],this.chartOptions=t.getChartOptions()}init(){this.initFontPanel(),this.titlePlaceholder=this.chartTranslationService.translate("titlePlaceholder")}hasTitle(){const e=this.chartOptions.getValue("title");return e&&e.enabled&&e.text&&e.text.length>0}initFontPanel(){const e=this.hasTitle(),t={name:this.chartTranslationService.translate("title"),enabled:e,suppressEnabledCheckbox:!1,chartMenuUtils:this.chartMenuUtils,keyMapper:e=>`title.${e}`,onEnableChange:e=>{if(this.chartMenuService.doesChartToolbarExist(this.chartController)){const t=this.chartOptions.getValue("padding.top");this.chartOptions.setValue("padding.top",e?t-20:t+20)}this.chartOptions.setValue("title.enabled",e);const t=this.chartOptions.getValue("title.text"),i="Title"===t||0===(null==t?void 0:t.trim().length);e&&i&&this.chartOptions.setValue("title.text",this.titlePlaceholder)}},i=this.createBean(new xs(t));i.addItemToPanel(this.createSpacingSlicer()),this.getGui().appendChild(i.getGui()),this.activePanels.push(i),this.addManagedListener(this.eventService,"chartTitleEdit",()=>{i.setEnabled(this.hasTitle())})}createSpacingSlicer(){const e=this.chartMenuUtils.getDefaultSliderParams("title.spacing","spacing",100);return e.value="10",this.createBean(new Kt.AgSlider(e))}destroyActivePanels(){this.activePanels.forEach(e=>{Kt._.removeFromParent(e.getGui()),this.destroyBean(e)})}destroy(){this.destroyActivePanels(),super.destroy()}};Hs.TEMPLATE="<div></div>",fn([(0,Kt.Autowired)("chartTranslationService")],Hs.prototype,"chartTranslationService",2),fn([(0,Kt.Autowired)("chartMenuService")],Hs.prototype,"chartMenuService",2),fn([Kt.PostConstruct],Hs.prototype,"init",1);var Us=Hs,zs=class e extends Wt.Component{constructor({chartController:e,chartMenuParamsFactory:t,isExpandedOnInit:i=!1,chartOptionsService:n,seriesType:s}){super(),this.chartController=e,this.chartMenuParamsFactory=t,this.chartOptionsSeriesProxy=n.getSeriesOptionsProxy(()=>null!=s?s:this.chartController.getChartSeriesType()),this.isExpandedOnInit=i}init(){this.chartSeriesMenuParamsFactory=this.createManagedBean(new Ps(this.chartOptionsSeriesProxy));const t={cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.chartTranslationService.translate("chart"),expanded:this.isExpandedOnInit,suppressEnabledCheckbox:!0,items:[this.createManagedBean(new Us(this.chartMenuParamsFactory,this.chartController)),this.createManagedBean(new Gs(this.chartMenuParamsFactory,this.chartController)),this.createManagedBean(new Vs(this.chartMenuParamsFactory)),...this.createDirectionSelect()]};this.setTemplate(e.TEMPLATE,{chartGroup:t}),this.addManagedListener(this.eventService,Wt.Events.EVENT_CHART_OPTIONS_CHANGED,()=>this.refresh())}refresh(){this.updateDirectionSelect()}createDirectionSelect(){if(this.chartMenuService.isLegacyFormat())return[];const e=["horizontal","vertical"].map(e=>({value:e,text:this.chartTranslationService.translate(e)})),t=this.chartSeriesMenuParamsFactory.getDefaultSelectParams("direction","direction",e);t.labelWidth="flex",t.inputWidth="flex";const i=t.onValueChange;return t.onValueChange=e=>{i(e),this.chartController.raiseChartModelUpdateEvent()},this.directionSelect=this.createManagedBean(new Wt.AgSelect(t)),this.updateDirectionSelect(),[this.directionSelect]}updateDirectionSelect(){var e;null==(e=this.directionSelect)||e.setDisplayed(xn(Rn(this.chartController.getChartType()),"canSwitchDirection"))}};zs.TEMPLATE='<div>\n            <ag-group-component ref="chartGroup"></ag-group-component>\n        </div>',fn([(0,Wt.Autowired)("chartTranslationService")],zs.prototype,"chartTranslationService",2),fn([(0,Wt.Autowired)("chartMenuService")],zs.prototype,"chartMenuService",2),fn([Wt.PostConstruct],zs.prototype,"init",1);var Ws=zs,js=class e extends qt.Component{constructor(e,t="shadow"){super(),this.chartMenuUtils=e,this.propertyKey=t}init(){const t=this.propertyKey,i=this.chartMenuUtils.addEnableParams(`${t}.enabled`,{cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslationService.translate("shadow"),suppressEnabledCheckbox:!1}),n=this.chartMenuUtils.getDefaultColorPickerParams(`${t}.color`);this.setTemplate(e.TEMPLATE,{shadowGroup:i,shadowColorPicker:n,shadowBlurSlider:this.getSliderParams("blur",0,20),shadowXOffsetSlider:this.getSliderParams("xOffset",-10,10),shadowYOffsetSlider:this.getSliderParams("yOffset",-10,10)})}getSliderParams(e,t,i){const n=`${this.propertyKey}.${e}`,s=this.chartMenuUtils.getDefaultSliderParams(n,e,i);return s.minValue=t,s}};js.TEMPLATE='<div>\n            <ag-group-component ref="shadowGroup">\n                <ag-color-picker ref="shadowColorPicker"></ag-color-picker>\n                <ag-slider ref="shadowBlurSlider"></ag-slider>\n                <ag-slider ref="shadowXOffsetSlider"></ag-slider>\n                <ag-slider ref="shadowYOffsetSlider"></ag-slider>\n            </ag-group-component>\n        </div>',fn([(0,qt.Autowired)("chartTranslationService")],js.prototype,"chartTranslationService",2),fn([qt.PostConstruct],js.prototype,"init",1);var $s=js,Ks=class e extends Xt.Component{constructor(e,t){super(),this.chartOptionsService=e,this.chartMenuUtils=t}init(){const t=this.chartOptionsService.getChartType(),i=Xt._.includes(["scatter","bubble"],t),n=this.chartMenuUtils.addEnableParams("marker.enabled",{cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslationService.translate("markers"),suppressEnabledCheckbox:i,suppressOpenCloseIcons:!0}),s="bubble"===t;let r,o;s?(r=this.getSliderParams("marker.maxSize","maxSize",60),o=this.getSliderParams("marker.size","minSize",60)):(r={},o=this.getSliderParams("marker.size","size",60)),this.setTemplate(e.TEMPLATE,{seriesMarkersGroup:n,seriesMarkerShapeSelect:this.getMarkerShapeSelectParams(),seriesMarkerMinSizeSlider:r,seriesMarkerSizeSlider:o,seriesMarkerStrokeWidthSlider:this.getSliderParams("marker.strokeWidth","strokeWidth",10)}),s||this.seriesMarkerMinSizeSlider.setDisplayed(!1)}getMarkerShapeSelectParams(){return this.chartMenuUtils.addValueParams("marker.shape",{options:[{value:"square",text:"Square"},{value:"circle",text:"Circle"},{value:"cross",text:"Cross"},{value:"diamond",text:"Diamond"},{value:"plus",text:"Plus"},{value:"triangle",text:"Triangle"},{value:"heart",text:"Heart"}],label:this.chartTranslationService.translate("shape")})}getSliderParams(e,t,i){return this.chartMenuUtils.getDefaultSliderParams(e,t,i)}};Ks.TEMPLATE='<div>\n            <ag-group-component ref="seriesMarkersGroup">\n                <ag-select ref="seriesMarkerShapeSelect"></ag-select>\n                <ag-slider ref="seriesMarkerMinSizeSlider"></ag-slider>\n                <ag-slider ref="seriesMarkerSizeSlider"></ag-slider>\n                <ag-slider ref="seriesMarkerStrokeWidthSlider"></ag-slider>\n            </ag-group-component>\n        </div>',fn([(0,Xt.RefSelector)("seriesMarkerMinSizeSlider")],Ks.prototype,"seriesMarkerMinSizeSlider",2),fn([(0,Xt.Autowired)("chartTranslationService")],Ks.prototype,"chartTranslationService",2),fn([Xt.PostConstruct],Ks.prototype,"init",1);var Ys=Ks,qs=class e extends Zt.Component{constructor(t){super(e.TEMPLATE),this.H=1,this.S=1,this.B=1,this.A=1,this.isSpectrumDragging=!1,this.isSpectrumHueDragging=!1,this.isSpectrumAlphaDragging=!1,this.colorChanged=!1,this.picker=t.picker}postConstruct(){this.initTabIndex(),this.initRecentColors(),this.addGuiEventListener("focus",()=>this.spectrumColor.focus()),this.addGuiEventListener("keydown",e=>{e.key!==Jt.KeyCode.ENTER||e.defaultPrevented||this.destroy()}),this.addManagedListener(this.spectrumColor,"keydown",e=>this.moveDragger(e)),this.addManagedListener(this.spectrumAlphaSlider,"keydown",e=>this.moveAlphaSlider(e)),this.addManagedListener(this.spectrumHueSlider,"keydown",e=>this.moveHueSlider(e)),this.addManagedListener(this.spectrumVal,"mousedown",this.onSpectrumDraggerDown.bind(this)),this.addManagedListener(this.spectrumHue,"mousedown",this.onSpectrumHueDown.bind(this)),this.addManagedListener(this.spectrumAlpha,"mousedown",this.onSpectrumAlphaDown.bind(this)),this.addGuiEventListener("mousemove",e=>{this.onSpectrumDraggerMove(e),this.onSpectrumHueMove(e),this.onSpectrumAlphaMove(e)}),this.addManagedListener(document,"mouseup",this.onMouseUp.bind(this)),this.addManagedListener(this.recentColors,"click",this.onRecentColorClick.bind(this)),this.addManagedListener(this.recentColors,"keydown",e=>{e.key!==Jt.KeyCode.ENTER&&e.key!==Jt.KeyCode.SPACE||(e.preventDefault(),this.onRecentColorClick(e))})}initTabIndex(){const e=this.tabIndex=this.gos.get("tabIndex").toString();this.spectrumColor.setAttribute("tabindex",e),this.spectrumHueSlider.setAttribute("tabindex",e),this.spectrumAlphaSlider.setAttribute("tabindex",e)}refreshSpectrumRect(){return this.spectrumValRect=this.spectrumVal.getBoundingClientRect()}refreshHueRect(){return this.spectrumHueRect=this.spectrumHue.getBoundingClientRect()}refreshAlphaRect(){return this.spectrumAlphaRect=this.spectrumAlpha.getBoundingClientRect()}onSpectrumDraggerDown(e){this.refreshSpectrumRect(),this.isSpectrumDragging=!0,this.moveDragger(e)}onSpectrumDraggerMove(e){this.isSpectrumDragging&&this.moveDragger(e)}onSpectrumHueDown(e){this.refreshHueRect(),this.isSpectrumHueDragging=!0,this.moveHueSlider(e)}onSpectrumHueMove(e){this.isSpectrumHueDragging&&this.moveHueSlider(e)}onSpectrumAlphaDown(e){this.refreshAlphaRect(),this.isSpectrumAlphaDragging=!0,this.moveAlphaSlider(e)}onSpectrumAlphaMove(e){this.isSpectrumAlphaDragging&&this.moveAlphaSlider(e)}onMouseUp(){this.isSpectrumDragging=!1,this.isSpectrumHueDragging=!1,this.isSpectrumAlphaDragging=!1}moveDragger(e){const t=this.spectrumValRect;if(!t)return;let i,n;if(e instanceof MouseEvent)i=e.clientX-t.left,n=e.clientY-t.top;else{const t=e.key===Jt.KeyCode.LEFT,s=e.key===Jt.KeyCode.RIGHT,r=e.key===Jt.KeyCode.UP,o=e.key===Jt.KeyCode.DOWN,a=r||o,l=t||s;if(!a&&!l)return;e.preventDefault();const{x:c,y:h}=this.getSpectrumValue();i=c+(l?t?-5:5:0),n=h+(a?r?-5:5:0)}i=Math.max(i,0),i=Math.min(i,t.width),n=Math.max(n,0),n=Math.min(n,t.height),this.setSpectrumValue(i/t.width,1-n/t.height)}moveHueSlider(e){const t=this.spectrumHueRect;if(!t)return;const i=this.moveSlider(this.spectrumHueSlider,e);null!=i&&(this.H=1-i/t.width,this.update())}moveAlphaSlider(e){const t=this.spectrumAlphaRect;if(!t)return;const i=this.moveSlider(this.spectrumAlphaSlider,e);null!=i&&(this.A=i/t.width,this.update())}moveSlider(e,t){var i;const n=e.getBoundingClientRect(),s=null==(i=e.parentElement)?void 0:i.getBoundingClientRect();if(!e||!s)return null;let r;if(t instanceof MouseEvent)r=t.clientX-s.left;else{const i=t.key===Jt.KeyCode.LEFT,s=t.key===Jt.KeyCode.RIGHT;if(!i&&!s)return null;t.preventDefault();const o=i?-5:5;r=parseFloat(e.style.left)-n.width/2+o}return r=Math.max(r,0),r=Math.min(r,s.width),e.style.left=r+n.width/2+"px",r}update(){const e=Qt._Util.Color.fromHSB(360*this.H,this.S,this.B,this.A),t=Qt._Util.Color.fromHSB(360*this.H,1,1),i=e.toRgbaString(),n=this.picker;Qt._Util.Color.fromString(n.getValue()).toRgbaString()!==i&&(this.colorChanged=!0),n.setValue(i),this.spectrumColor.style.backgroundColor=t.toRgbaString(),this.spectrumDragger.style.backgroundColor=i}setSpectrumValue(e,t){const i=this.spectrumValRect||this.refreshSpectrumRect();if(null==i)return;const n=this.spectrumDragger,s=n.getBoundingClientRect();e=Math.max(0,e),e=Math.min(1,e),t=Math.max(0,t),t=Math.min(1,t),this.S=e,this.B=t,n.style.left=e*i.width-s.width/2+"px",n.style.top=(1-t)*i.height-s.height/2+"px",this.update()}getSpectrumValue(){const e=this.spectrumDragger,t=e.getBoundingClientRect();return{x:parseFloat(e.style.left)+t.width/2,y:parseFloat(e.style.top)+t.height/2}}initRecentColors(){const t=e.recentColors.map((e,t)=>`<div class="ag-recent-color" id=${t} style="background-color: ${e}; width: 15px; height: 15px;" recent-color="${e}" tabIndex="${this.tabIndex}"></div>`);this.recentColors.innerHTML=t.join("")}setValue(e){const t=Qt._Util.Color.fromString(e),[i,n,s]=t.toHSB();this.H=(isNaN(i)?0:i)/360,this.A=t.a;const r=this.spectrumHueRect||this.refreshHueRect(),o=this.spectrumAlphaRect||this.refreshAlphaRect();this.spectrumHueSlider.style.left=(this.H-1)*-r.width+"px",this.spectrumAlphaSlider.style.left=this.A*o.width+"px",this.setSpectrumValue(n,s)}onRecentColorClick(t){const i=t.target;if(!Zt._.exists(i.id))return;const n=parseInt(i.id,10);this.setValue(e.recentColors[n]),this.destroy()}addRecentColor(){const t=Qt._Util.Color.fromHSB(360*this.H,this.S,this.B,this.A).toRgbaString();let i=e.recentColors;this.colorChanged&&i[0]!==t&&(i=i.filter(e=>e!=t),i=[t].concat(i),i.length>e.maxRecentColors&&(i=i.slice(0,e.maxRecentColors)),e.recentColors=i)}destroy(){this.addRecentColor(),super.destroy()}};qs.maxRecentColors=8,qs.recentColors=[],qs.TEMPLATE='<div class="ag-color-panel" tabindex="-1">\n            <div ref="spectrumColor" class="ag-spectrum-color">\n                <div class="ag-spectrum-sat ag-spectrum-fill">\n                    <div ref="spectrumVal" class="ag-spectrum-val ag-spectrum-fill">\n                        <div ref="spectrumDragger" class="ag-spectrum-dragger"></div>\n                    </div>\n                </div>\n            </div>\n            <div class="ag-spectrum-tools">\n                <div ref="spectrumHue" class="ag-spectrum-hue ag-spectrum-tool">\n                    <div class="ag-spectrum-hue-background"></div>\n                    <div ref="spectrumHueSlider" class="ag-spectrum-slider"></div>\n                </div>\n                <div ref="spectrumAlpha" class="ag-spectrum-alpha ag-spectrum-tool">\n                    <div class="ag-spectrum-alpha-background"></div>\n                    <div ref="spectrumAlphaSlider" class="ag-spectrum-slider"></div>\n                </div>\n                <div ref="recentColors" class="ag-recent-colors"></div>\n            </div>\n        </div>',fn([(0,Zt.RefSelector)("spectrumColor")],qs.prototype,"spectrumColor",2),fn([(0,Zt.RefSelector)("spectrumVal")],qs.prototype,"spectrumVal",2),fn([(0,Zt.RefSelector)("spectrumDragger")],qs.prototype,"spectrumDragger",2),fn([(0,Zt.RefSelector)("spectrumHue")],qs.prototype,"spectrumHue",2),fn([(0,Zt.RefSelector)("spectrumHueSlider")],qs.prototype,"spectrumHueSlider",2),fn([(0,Zt.RefSelector)("spectrumAlpha")],qs.prototype,"spectrumAlpha",2),fn([(0,Zt.RefSelector)("spectrumAlphaSlider")],qs.prototype,"spectrumAlphaSlider",2),fn([(0,Zt.RefSelector)("recentColors")],qs.prototype,"recentColors",2),fn([Zt.PostConstruct],qs.prototype,"postConstruct",1);var Xs=qs,Zs=class extends ei.AgPickerField{constructor(e){super(dn({pickerAriaLabelKey:"ariaLabelColorPicker",pickerAriaLabelValue:"Color Picker",pickerType:"ag-list",className:"ag-color-picker",pickerIcon:"colorPicker"},e))}postConstruct(){super.postConstruct(),this.value&&this.setValue(this.value)}createPickerComponent(){const e=this.getGui().getBoundingClientRect();return this.createBean(new ei.AgDialog({closable:!1,modal:!0,hideTitleBar:!0,minWidth:190,width:190,height:250,x:e.right-190,y:e.top-250}))}renderAndPositionPicker(){const e=this.pickerComponent,t=this.createBean(new Xs({picker:this}));return e.addCssClass("ag-color-dialog"),t.addDestroyFunc(()=>{e.isAlive()&&this.destroyBean(e)}),e.setParentComponent(this),e.setBodyComponent(t),t.setValue(this.getValue()),t.getGui().focus(),e.addDestroyFunc(()=>{this.isDestroyingPicker?this.isDestroyingPicker=!1:(this.beforeHidePicker(),this.isDestroyingPicker=!0,t.isAlive()&&this.destroyBean(t),this.isAlive()&&this.getFocusableElement().focus())}),()=>{var e;return null==(e=this.pickerComponent)?void 0:e.close()}}setValue(e){return this.value===e?this:(this.eDisplayField.style.backgroundColor=e,super.setValue(e))}getValue(){return this.value}},Qs=class e extends ti.Component{constructor(e){super(),this.chartMenuUtils=e}init(){const t={cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslationService.translate("callout"),enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0};this.setTemplate(e.TEMPLATE,{calloutGroup:t,calloutLengthSlider:this.chartMenuUtils.getDefaultSliderParams("calloutLine.length","length",40),calloutStrokeWidthSlider:this.chartMenuUtils.getDefaultSliderParams("calloutLine.strokeWidth","strokeWidth",10),labelOffsetSlider:this.chartMenuUtils.getDefaultSliderParams("calloutLabel.offset","offset",30)})}};Qs.TEMPLATE='<div>\n            <ag-group-component ref="calloutGroup">\n                <ag-slider ref="calloutLengthSlider"></ag-slider>\n                <ag-slider ref="calloutStrokeWidthSlider"></ag-slider>\n                <ag-slider ref="labelOffsetSlider"></ag-slider>\n            </ag-group-component>\n        </div>',fn([(0,ti.Autowired)("chartTranslationService")],Qs.prototype,"chartTranslationService",2),fn([ti.PostConstruct],Qs.prototype,"init",1);var Js=Qs,er=class e extends ii.Component{constructor(e){super(),this.chartMenuUtils=e}init(){const t={cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslationService.translate("cap"),enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0},i=this.chartMenuUtils.getDefaultSliderParams("cap.lengthRatio","capLengthRatio",1);i.step=.05,this.setTemplate(e.TEMPLATE,{capsGroup:t,capLengthRatioSlider:i})}};er.TEMPLATE='<div>\n            <ag-group-component ref="capsGroup">\n                <ag-slider ref="capLengthRatioSlider"></ag-slider>\n            </ag-group-component>\n        </div>',fn([(0,ii.Autowired)("chartTranslationService")],er.prototype,"chartTranslationService",2),fn([ii.PostConstruct],er.prototype,"init",1);var tr=er,ir=class e extends ni.Component{constructor(e){super(),this.chartMenuUtils=e}init(){const t={cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslationService.translate("connectorLine"),enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0};this.setTemplate(e.TEMPLATE,{lineGroup:t,lineColorPicker:this.chartMenuUtils.getDefaultColorPickerParams("line.stroke"),lineStrokeWidthSlider:this.getSliderParams("strokeWidth",10,"line.strokeWidth"),lineDashSlider:this.getSliderParams("lineDash",30,"line.lineDash",1,!0),lineOpacitySlider:this.getSliderParams("strokeOpacity",1,"line.strokeOpacity",.05)})}getSliderParams(e,t,i,n=1,s=!1){const r=this.chartMenuUtils.getDefaultSliderParams(i,e,t,s);return r.step=n,r}};ir.TEMPLATE='<div>\n            <ag-group-component ref="lineGroup">\n                <ag-color-picker ref="lineColorPicker"></ag-color-picker>\n                <ag-slider ref="lineStrokeWidthSlider"></ag-slider>\n                <ag-slider ref="lineOpacitySlider"></ag-slider>\n                <ag-slider ref="lineDashSlider"></ag-slider>                \n            </ag-group-component>\n        </div>',fn([(0,ni.Autowired)("chartTranslationService")],ir.prototype,"chartTranslationService",2),fn([ni.PostConstruct],ir.prototype,"init",1);var nr=ir,sr=class e extends si.Component{constructor(e){super(),this.chartMenuUtils=e}init(){const t={cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslationService.translate("whisker"),enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0};this.setTemplate(e.TEMPLATE,{whiskersGroup:t,whiskerColorPicker:this.chartMenuUtils.getDefaultColorPickerParams("whisker.stroke"),whiskerThicknessSlider:this.chartMenuUtils.getDefaultSliderParams("whisker.strokeWidth","strokeWidth",10),whiskerOpacitySlider:this.chartMenuUtils.getDefaultSliderParams("whisker.strokeOpacity","strokeOpacity",1),whiskerLineDashSlider:this.chartMenuUtils.getDefaultSliderParams("whisker.lineDash","lineDash",30,!0),whiskerLineDashOffsetSlider:this.chartMenuUtils.getDefaultSliderParams("whisker.lineDashOffset","lineDashOffset",30)})}};sr.TEMPLATE='<div>\n            <ag-group-component ref="whiskersGroup">\n                <ag-color-picker ref="whiskerColorPicker"></ag-color-picker>\n                <ag-slider ref="whiskerThicknessSlider"></ag-slider>\n                <ag-slider ref="whiskerOpacitySlider"></ag-slider>\n                <ag-slider ref="whiskerLineDashSlider"></ag-slider>\n                <ag-slider ref="whiskerLineDashOffsetSlider"></ag-slider>\n            </ag-group-component>\n        </div>',fn([(0,si.Autowired)("chartTranslationService")],sr.prototype,"chartTranslationService",2),fn([si.PostConstruct],sr.prototype,"init",1);var rr=sr,or=class e extends ri.Component{constructor(e){super(),this.chartMenuUtils=e,this.activePanels=[]}init(){const t={cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslationService.translate("seriesItems"),enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0};this.setTemplate(e.TEMPLATE,{seriesItemsGroup:t,seriesItemSelect:this.getSeriesItemsParams()}),this.initSeriesControls()}getSeriesItemsParams(){const e=[{value:"positive",text:this.chartTranslationService.translate("seriesItemPositive")},{value:"negative",text:this.chartTranslationService.translate("seriesItemNegative")}];return{label:this.chartTranslationService.translate("seriesItemType"),labelAlignment:"left",labelWidth:"flex",inputWidth:"flex",options:e,value:"positive",onValueChange:e=>{this.destroyActivePanels(),this.initSeriesControls(e)}}}initSeriesControls(e="positive"){this.initSlider("strokeWidth",10,`item.${e}.strokeWidth`),this.initSlider("lineDash",30,`item.${e}.lineDash`,1,!0),this.initSlider("strokeOpacity",1,`item.${e}.strokeOpacity`,.05,!1),this.initSlider("fillOpacity",1,`item.${e}.fillOpacity`,.05,!1),this.initItemLabels(e)}initSlider(e,t,i,n=1,s=!1){const r=this.chartMenuUtils.getDefaultSliderParams(i,e,t,s);r.step=n;const o=this.seriesItemsGroup.createManagedBean(new ri.AgSlider(r));this.seriesItemsGroup.addItem(o),this.activePanels.push(o)}initItemLabels(e){const t=this.chartMenuUtils.getDefaultFontPanelParams(`item.${e}.label`,"seriesItemLabels"),i=this.createBean(new xs(t));this.seriesItemsGroup.addItem(i),this.activePanels.push(i)}destroyActivePanels(){this.activePanels.forEach(e=>{ri._.removeFromParent(e.getGui()),this.destroyBean(e)})}destroy(){this.destroyActivePanels(),super.destroy()}};or.TEMPLATE='<div>\n            <ag-group-component ref="seriesItemsGroup">\n                <ag-select ref="seriesItemSelect"></ag-select>\n            </ag-group-component>\n        </div>',fn([(0,ri.RefSelector)("seriesItemsGroup")],or.prototype,"seriesItemsGroup",2),fn([(0,ri.Autowired)("chartTranslationService")],or.prototype,"chartTranslationService",2),fn([ri.PostConstruct],or.prototype,"init",1);var ar=or,lr=class e extends oi.Component{constructor(e){super(),this.chartMenuUtils=e}init(){const t={cssIdentifier:"charts-format-sub-level",direction:"vertical",enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0};this.setTemplate(e.TEMPLATE,{groupSpacing:pn(dn({},t),{title:this.chartTranslationService.translate("group")}),tileSpacing:pn(dn({},t),{title:this.chartTranslationService.translate("tile")}),groupPaddingSlider:this.getSliderParams("padding","group.padding"),groupSpacingSlider:this.getSliderParams("spacing","group.gap"),tilePaddingSlider:this.getSliderParams("padding","tile.padding"),tileSpacingSlider:this.getSliderParams("spacing","tile.gap")})}getSliderParams(e,t){return this.chartMenuUtils.getDefaultSliderParams(t,e,10)}};lr.TEMPLATE='<div>\n            <ag-group-component ref="groupSpacing">\n                <ag-slider ref="groupPaddingSlider"></ag-slider>\n                <ag-slider ref="groupSpacingSlider"></ag-slider>\n            </ag-group-component>\n            <ag-group-component ref="tileSpacing">\n                <ag-slider ref="tilePaddingSlider"></ag-slider>\n                <ag-slider ref="tileSpacingSlider"></ag-slider>\n            </ag-group-component>\n        </div>',fn([(0,oi.Autowired)("chartTranslationService")],lr.prototype,"chartTranslationService",2),fn([oi.PostConstruct],lr.prototype,"init",1);var cr=lr,hr=class e extends Yt.Component{constructor({chartController:e,chartOptionsService:t,seriesType:i,isExpandedOnInit:n=!1}){super(),this.activePanels=[],this.widgetFuncs={lineWidth:()=>this.initStrokeWidth("lineWidth"),strokeWidth:()=>this.initStrokeWidth("strokeWidth"),lineColor:()=>this.initLineColor(),lineDash:()=>this.initLineDash(),lineOpacity:()=>this.initLineOpacity(),fillOpacity:()=>this.initFillOpacity(),markers:()=>this.initMarkers(),labels:()=>this.initLabels(),shadow:()=>this.initShadow(),tooltips:()=>this.initTooltips(),bins:()=>this.initBins(),whiskers:()=>this.initWhiskers(),caps:()=>this.initCaps(),connectorLine:()=>this.initConnectorLine(),seriesItems:()=>this.initSeriesItemsPanel(),tileSpacing:()=>this.initTileSpacingPanel(),groupType:()=>this.initGroupType()},this.seriesWidgetMappings={bar:["tooltips","strokeWidth","lineDash","lineOpacity","fillOpacity","labels","shadow"],pie:["tooltips","strokeWidth","lineOpacity","fillOpacity","labels","shadow"],donut:["tooltips","strokeWidth","lineOpacity","fillOpacity","labels","shadow"],line:["tooltips","lineWidth","lineDash","lineOpacity","markers","labels"],scatter:["tooltips","markers","labels"],bubble:["tooltips","markers","labels"],area:["tooltips","lineWidth","lineDash","lineOpacity","fillOpacity","markers","labels","shadow"],histogram:["tooltips","bins","strokeWidth","lineDash","lineOpacity","fillOpacity","labels","shadow"],"radial-column":["tooltips","strokeWidth","lineDash","lineOpacity","fillOpacity","labels","groupType"],"radial-bar":["tooltips","strokeWidth","lineDash","lineOpacity","fillOpacity","labels","groupType"],"radar-line":["tooltips","strokeWidth","lineDash","lineOpacity","markers","labels"],"radar-area":["tooltips","strokeWidth","lineDash","lineOpacity","fillOpacity","markers","labels"],nightingale:["tooltips","strokeWidth","lineDash","lineOpacity","fillOpacity","labels","groupType"],"box-plot":["tooltips","strokeWidth","lineDash","lineOpacity","fillOpacity","whiskers","caps"],"range-bar":["tooltips","strokeWidth","lineDash","lineOpacity","fillOpacity","labels"],"range-area":["tooltips","lineWidth","lineDash","lineOpacity","fillOpacity","markers","labels","shadow"],treemap:["tooltips","tileSpacing"],sunburst:["tooltips"],heatmap:["tooltips","labels","lineColor","lineWidth","lineOpacity"],waterfall:["tooltips","connectorLine","seriesItems"]},this.chartController=e,this.chartOptionsService=t,this.seriesType=i||this.chartController.getChartSeriesType(),this.isExpandedOnInit=n}init(){const t={cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.translate("series"),expanded:this.isExpandedOnInit,suppressEnabledCheckbox:!0};this.setTemplate(e.TEMPLATE,{seriesGroup:t}),this.chartMenuUtils=this.createManagedBean(new Ps(this.chartOptionsService.getSeriesOptionsProxy(()=>this.seriesType))),this.chartOptions=this.chartMenuUtils.getChartOptions(),this.addManagedListener(this.chartController,rs.EVENT_CHART_SERIES_CHART_TYPE_CHANGED,this.refreshWidgets.bind(this)),this.refreshWidgets()}refreshWidgets(){this.destroyActivePanels(),this.chartController.getChartProxy().getChart().waitForUpdate().then(()=>{var e;!this.isAlive()||(this.chartController.isComboChart()&&(this.updateSeriesType(),this.initSeriesSelect()),(null!=(e=this.seriesWidgetMappings[this.seriesType])?e:[]).forEach(e=>this.widgetFuncs[e]()))}).catch(e=>console.error("AG Grid - chart rendering failed",e))}initSeriesSelect(){const e=this.seriesGroup.createManagedBean(new Yt.AgSelect({label:this.translate("seriesType"),labelAlignment:"left",labelWidth:"flex",inputWidth:"flex",options:this.getSeriesSelectOptions(),value:`${this.seriesType}`,onValueChange:e=>{this.seriesType=e,this.refreshWidgets()}}));this.seriesGroup.addItem(e),this.activePanels.push(e)}initTooltips(){const e=this.createBean(new Yt.AgToggleButton(this.chartMenuUtils.addValueParams("tooltip.enabled",{label:this.translate("tooltips"),labelAlignment:"left",labelWidth:"flex",inputWidth:"flex"})));this.addWidget(e)}initLineColor(){const e=this.createBean(new Zs(this.chartMenuUtils.getDefaultColorPickerParams("stroke","strokeColor")));this.addWidget(e)}initStrokeWidth(e){const t=this.createBean(new Yt.AgSlider(this.chartMenuUtils.getDefaultSliderParams("strokeWidth",e,10)));this.addWidget(t)}initLineDash(){const e=this.createBean(new Yt.AgSlider(this.chartMenuUtils.getDefaultSliderParams("lineDash","lineDash",30,!0)));this.addWidget(e)}initLineOpacity(){const e=this.chartMenuUtils.getDefaultSliderParams("strokeOpacity","strokeOpacity",1);e.step=.05;const t=this.createBean(new Yt.AgSlider(e));this.addWidget(t)}initFillOpacity(){const e=this.chartMenuUtils.getDefaultSliderParams("fillOpacity","fillOpacity",1);e.step=.05;const t=this.createBean(new Yt.AgSlider(e));this.addWidget(t)}initLabels(){const e=kn(this.seriesType),t=e?"calloutLabel":"label",i=e?"calloutLabels":"labels",n=this.chartMenuUtils.getDefaultFontPanelParams(t,i),s=this.createBean(new xs(n));if(e){const e=this.createBean(new Js(this.chartMenuUtils));s.addCompToPanel(e),this.activePanels.push(e)}if(this.addWidget(s),e){const e=this.chartMenuUtils.getDefaultFontPanelParams("sectorLabel","sectorLabels"),t=this.createBean(new xs(e)),i=this.getSectorLabelPositionRatio();t.addCompToPanel(i),this.addWidget(t)}if("range-bar"===this.seriesType){const e=[{value:"inside",text:this.translate("inside")},{value:"outside",text:this.translate("outside")}],t=s.createManagedBean(new Yt.AgSelect(this.chartMenuUtils.addValueParams("label.placement",{label:this.translate("labelPlacement"),labelAlignment:"left",labelWidth:"flex",inputWidth:"flex",options:e})));s.addCompToPanel(t),this.activePanels.push(t);const i=s.createManagedBean(new Yt.AgSlider(this.chartMenuUtils.getDefaultSliderParams("label.padding","padding",200)));s.addCompToPanel(i),this.activePanels.push(i)}}getSectorLabelPositionRatio(){const e=this.chartMenuUtils.getDefaultSliderParams("sectorLabel.positionRatio","positionRatio",1);return e.step=.05,this.createBean(new Yt.AgSlider(e))}initShadow(){const e=this.createBean(new $s(this.chartMenuUtils));this.addWidget(e)}initMarkers(){const e=this.createBean(new Ys(this.chartOptionsService,this.chartMenuUtils));this.addWidget(e)}initBins(){var e;const t=this.chartMenuUtils.getDefaultSliderParams("binCount","histogramBinCount",20),i=(null!=(e=this.chartOptions.getValue("bins"))?e:this.chartOptions.getValue("calculatedBins",!0)).length;t.value=`${i}`,t.maxValue=Math.max(i,20);const n=this.createBean(new Yt.AgSlider(t));this.addWidget(n)}initWhiskers(){const e=this.createBean(new rr(this.chartMenuUtils));this.addWidget(e)}initCaps(){const e=this.createBean(new tr(this.chartMenuUtils));this.addWidget(e)}initConnectorLine(){const e=this.createBean(new nr(this.chartMenuUtils));this.addWidget(e)}initSeriesItemsPanel(){const e=this.createBean(new ar(this.chartMenuUtils));this.addWidget(e)}initTileSpacingPanel(){const e=this.createBean(new cr(this.chartMenuUtils));this.addWidget(e)}initGroupType(){const e=this.createBean(new Yt.AgSelect({label:this.chartTranslationService.translate("seriesGroupType"),options:Yt.ChartMappings.SERIES_GROUP_TYPES.map(e=>({value:e,text:this.chartTranslationService.translate(`${e}SeriesGroupType`)})),value:this.chartController.getSeriesGroupType(),onValueChange:e=>this.chartController.setSeriesGroupType(e)}));this.addWidget(e)}addWidget(e){this.seriesGroup.addItem(e),this.activePanels.push(e)}getSeriesSelectOptions(){const e=this.getActiveSeriesTypes();return["area","bar","line"].filter(t=>e.includes(t)).map(e=>({value:e,text:this.translate(e)}))}updateSeriesType(){const e=this.getActiveSeriesTypes();!e.includes(this.seriesType)&&e.length>0&&(this.seriesType=e[0])}getActiveSeriesTypes(){return this.chartController.getActiveSeriesChartTypes().map(e=>Rn(e.chartType))}translate(e){return this.chartTranslationService.translate(e)}destroyActivePanels(){this.activePanels.forEach(e=>{Yt._.removeFromParent(e.getGui()),this.destroyBean(e)})}destroy(){this.destroyActivePanels(),super.destroy()}};hr.TEMPLATE='<div>\n            <ag-group-component ref="seriesGroup">\n            </ag-group-component>\n        </div>',fn([(0,Yt.RefSelector)("seriesGroup")],hr.prototype,"seriesGroup",2),fn([(0,Yt.Autowired)("chartTranslationService")],hr.prototype,"chartTranslationService",2),fn([Yt.PostConstruct],hr.prototype,"init",1);var ur=hr,dr=class e extends ai.Component{constructor({chartMenuParamsFactory:e,isExpandedOnInit:t=!1}){super(),this.chartMenuUtils=e,this.isExpandedOnInit=t}init(){const t=this.chartMenuUtils.addEnableParams("gradientLegend.enabled",{cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.chartTranslationService.translate("legend"),suppressEnabledCheckbox:!1,suppressToggleExpandOnEnableChange:!0,expanded:this.isExpandedOnInit,items:[this.createLabelPanel()]});this.setTemplate(e.TEMPLATE,{legendGroup:t,legendPositionSelect:this.chartMenuUtils.getDefaultLegendParams("gradientLegend.position"),gradientReverseCheckbox:this.getGradientReverseCheckboxParams(),gradientThicknessSlider:this.chartMenuUtils.getDefaultSliderParams("gradientLegend.gradient.thickness","thickness",40),gradientPreferredLengthSlider:this.chartMenuUtils.getDefaultSliderParams("gradientLegend.gradient.preferredLength","preferredLength",300),legendSpacingSlider:this.chartMenuUtils.getDefaultSliderParams("gradientLegend.spacing","spacing",200)})}getGradientReverseCheckboxParams(){return this.chartMenuUtils.addValueParams("gradientLegend.reverseOrder",{label:this.chartTranslationService.translate("reverseDirection"),labelWidth:"flex"})}createLabelPanel(){const e={enabled:!0,suppressEnabledCheckbox:!0,chartMenuUtils:this.chartMenuUtils,keyMapper:e=>`gradientLegend.scale.label.${e}`};return this.createManagedBean(new xs(e))}};dr.TEMPLATE='<div>\n            <ag-group-component ref="legendGroup">\n                <ag-select ref="legendPositionSelect"></ag-select>\n                <ag-checkbox ref="gradientReverseCheckbox"></ag-checkbox>\n                <ag-slider ref="gradientThicknessSlider"></ag-slider>\n                <ag-slider ref="gradientPreferredLengthSlider"></ag-slider>\n                <ag-slider ref="legendSpacingSlider"></ag-slider>\n            </ag-group-component>\n        </div>',fn([(0,ai.Autowired)("chartTranslationService")],dr.prototype,"chartTranslationService",2),fn([ai.PostConstruct],dr.prototype,"init",1);var pr=dr,gr=class extends li.BeanStub{constructor(e,t,i,n){super(),this.chartController=e,this.eGui=t,this.cssClass=i,this.createPanels=n,this.panels=[]}postConstruct(){this.addManagedListener(this.chartController,rs.EVENT_CHART_UPDATED,()=>this.refreshPanels(!0)),this.addManagedListener(this.chartController,rs.EVENT_CHART_API_UPDATE,()=>this.refreshPanels(!1))}addComponent(e){this.createBean(e),this.panels.push(e),e.addCssClass(this.cssClass),this.eGui.appendChild(e.getGui())}refreshPanels(e){const t=this.chartController.getChartType(),i=this.chartController.isGrouping(),n=Rn(t);e&&t===this.chartType&&i===this.isGrouping||(this.destroyPanels(),this.createPanels(t,n),this.chartType=t,this.isGrouping=i)}destroyPanels(){this.panels.forEach(e=>{li._.removeFromParent(e.getGui()),this.destroyBean(e)}),this.panels=[]}destroy(){this.destroyPanels(),super.destroy()}};fn([li.PostConstruct],gr.prototype,"postConstruct",1);var fr={groups:[{type:"chart"},{type:"legend"},{type:"series"},{type:"axis"}]},mr=class e extends Nt.Component{constructor(t){super(e.TEMPLATE),this.chartMenuContext=t}init(){this.chartPanelFeature=this.createManagedBean(new gr(this.chartMenuContext.chartController,this.getGui(),"ag-chart-format-section",(e,t)=>this.createPanels(e,t))),this.chartPanelFeature.refreshPanels()}createPanels(e,t){var i;null==(i=this.getFormatPanelDef().groups)||i.forEach(i=>{const n=i.type;if(!this.isGroupPanelShownInSeries(n,t))return;const s=pn(dn({},this.chartMenuContext),{isExpandedOnInit:i.isOpen,seriesType:t});switch(n){case"chart":this.chartPanelFeature.addComponent(new Ws(s));break;case"legend":const n=["treemap","sunburst","heatmap"].includes(e)?new pr(s):new As(s);this.chartPanelFeature.addComponent(n);break;case"axis":Mn(t)?this.chartPanelFeature.addComponent(new Os(s)):An(t)&&(this.chartPanelFeature.addComponent(new Ls("xAxis",s)),this.chartPanelFeature.addComponent(new Ls("yAxis",s)));break;case"horizontalAxis":this.chartPanelFeature.addComponent(new Ls("xAxis",s));break;case"verticalAxis":this.chartPanelFeature.addComponent(new Ls("yAxis",s));break;case"series":this.chartPanelFeature.addComponent(new ur(s));break;case"navigator":Nt._.warnOnce("'navigator' is now displayed in the charts advanced settings instead of the format panel, and this setting will be ignored.");default:Nt._.warnOnce(`Invalid charts format panel group name supplied: '${i.type}'`)}})}getFormatPanelDef(){var e;return(null==(e=this.gos.get("chartToolPanelsDef"))?void 0:e.formatPanel)||fr}isGroupPanelShownInSeries(e,t){return["chart","legend","series"].includes(e)||An(t)&&["axis","horizontalAxis","verticalAxis"].includes(e)||Mn(t)&&"axis"===e}};mr.TEMPLATE='<div class="ag-chart-format-wrapper"></div>',fn([Nt.PostConstruct],mr.prototype,"init",1);var yr=mr,vr=class extends di.Component{constructor(e,t){super(),this.tooltipName=t,this.size=58,this.padding=5,this.root=new pi._Scene.Group;const i=new pi._Scene.Scene({width:this.size,height:this.size});i.canvas.element.classList.add("ag-chart-mini-thumbnail-canvas"),i.setRoot(this.root),i.setContainer(e),this.scene=i}init(){this.scene.canvas.element.title=this.chartTranslationService.translate(this.tooltipName),this.scene.render().catch(e=>{console.error("AG Grid - chart update failed",e)})}};fn([(0,di.Autowired)("chartTranslationService")],vr.prototype,"chartTranslationService",2),fn([di.PostConstruct],vr.prototype,"init",1);var br=class extends vr{constructor(e,t){super(e,t),this.stroke="gray",this.axisOvershoot=3}addAxes(){const e=this.size,t=this.padding,i=new gi._Scene.Line;i.x1=t,i.y1=t,i.x2=t,i.y2=e-t+this.axisOvershoot,i.stroke=this.stroke;const n=new gi._Scene.Line;n.x1=t-this.axisOvershoot+1,n.y1=e-t,n.x2=e-t+1,n.y2=e-t,n.stroke=this.stroke;const s=this.root;s.append(i),s.append(n)}};function Cr(e){const{stacked:t,size:i,padding:n,xScalePadding:s,xScaleDomain:r,yScaleDomain:o}=e,a=new fi._Scene.BandScale;a.domain=r,a.range=[n,i-n],a.paddingInner=s,a.paddingOuter=s;const l=new fi._Scene.LinearScale;l.domain=o,l.range=[i-n,n];const c=(e,t,i)=>e.map((e,n)=>{const s=i.convert(e),r=new fi._Scene.Rect;return r.x=t.convert(n),r.y=s,r.width=t.bandwidth,r.height=i.convert(0)-s,r.strokeWidth=0,r.crisp=!0,r});return t?e.data.map(e=>c(e,a,l)):c(e.data,a,l)}function wr(e,t,i,n){const s=new fi._Scene.LinearScale;s.domain=[0,4],s.range=[n,i-n];const r=new fi._Scene.LinearScale;r.domain=[0,10],r.range=[i-n,n];const o=t.map(e=>{const t=new fi._Scene.Path;return t.strokeWidth=3,t.lineCap="round",t.fill=void 0,e.forEach((e,i)=>{t.path[i>0?"lineTo":"moveTo"](s.convert(i),r.convert(e))}),t}),a=new fi._Scene.Group;return a.setClipRectInGroupCoordinateSpace(new fi._Scene.BBox(n,n,i-2*n,i-2*n)),a.append(o),e.append(a),o}function Sr(e,t,i,n,s,r=0){const o=new fi._Scene.LinearScale;o.domain=[0,7],o.range=[-Math.PI,Math.PI].map(e=>e+Math.PI/2);const a=new fi._Scene.LinearScale;a.domain=[0,10],a.range=[n,s];const l=[],c=t.map(e=>{const t=new fi._Scene.Path;return t.strokeWidth=1,t.strokeOpacity=.5,t.lineCap="round",t.fill=void 0,t.fillOpacity=.8,e.forEach((e,i)=>{const c=o.convert(i),h=n+s-a.convert(e),u=h*Math.cos(c),d=h*Math.sin(c);if(t.path[i>0?"lineTo":"moveTo"](u,d),r>0){const e=new fi._Scene.Circle;e.x=u,e.y=d,e.size=r,l.push(e)}}),t.path.closePath(),t}),h=new fi._Scene.Group,u=i/2;return h.translationX=u,h.translationY=u,h.append([...c,...l]),e.append(h),{paths:c,markers:l}}function xr(e){let[t,i]=[1/0,-1/0];return{processedData:e.reduce((e,n,s)=>{const r=s>0?e[s-1]:void 0;null!=e[s]||(e[s]=[]);const o=e[s];return n.forEach((e,n)=>{r&&(e+=r[n]),o[n]=e,o[n]<t&&(t=o[n]),o[n]>i&&(i=o[n])}),e},[]),min:t,max:i}}fn([ui.PostConstruct],br.prototype,"addAxes",1);var Er=class extends br{constructor(e,t,i){super(e,"groupedColumnTooltip"),this.columnData=[2,3,4];const{root:n,columnData:s,size:r,padding:o}=this;this.columns=Cr({stacked:!1,root:n,data:s,size:r,padding:o,xScaleDomain:[0,1,2],yScaleDomain:[0,4],xScalePadding:.3}),n.append(this.columns),this.updateColors(t,i)}updateColors(e,t){this.columns.forEach((i,n)=>{i.fill=e[n],i.stroke=t[n]})}};Er.chartType="groupedColumn";var Ar=class e extends br{constructor(t,i,n,s,r,o=e.data,a=[0,16],l="stackedColumnTooltip"){super(t,l);const{root:c,size:h,padding:u}=this;this.stackedColumns=Cr({stacked:!0,root:c,data:o,size:h,padding:u,xScaleDomain:[0,1,2],yScaleDomain:a,xScalePadding:.3}),c.append([].concat.apply([],this.stackedColumns)),this.updateColors(i,n)}updateColors(e,t){this.stackedColumns.forEach((i,n)=>i.forEach(i=>{i.fill=e[n],i.stroke=t[n]}))}};Ar.chartType="stackedColumn",Ar.data=[[8,12,16],[6,9,12],[2,3,4]];var Mr=Ar,Tr=class e extends Mr{constructor(t,i,n,s,r){super(t,i,n,s,r,e.data,[0,10],"normalizedColumnTooltip")}};Tr.chartType="normalizedColumn",Tr.data=[[10,10,10],[6,7,8],[2,4,6]];var Dr=Tr,Ir=class extends br{constructor(e,t,i){super(e,"groupedBarTooltip");const n=this.padding,s=this.size,r=new mi._Scene.BandScale;r.domain=[0,1,2],r.range=[n,s-n],r.paddingInner=.3,r.paddingOuter=.3;const o=new mi._Scene.LinearScale;o.domain=[0,4],o.range=[s-n,n];const a=o.convert(0),l=r.bandwidth;this.bars=[2,3,4].map((e,t)=>{const i=new mi._Scene.Rect;return i.x=n,i.y=r.convert(t),i.width=a-o.convert(e),i.height=l,i.strokeWidth=0,i.crisp=!0,i}),this.updateColors(t,i),this.root.append(this.bars)}updateColors(e,t){this.bars.forEach((i,n)=>{i.fill=e[n],i.stroke=t[n]})}};Ir.chartType="groupedBar";var Rr=class e extends br{constructor(t,i,n,s,r,o=e.data,a=[0,16],l="stackedBarTooltip"){super(t,l);const c=this.size,h=this.padding,u=new yi._Scene.BandScale;u.domain=[0,1,2],u.range=[h,c-h],u.paddingInner=.3,u.paddingOuter=.3;const d=new yi._Scene.LinearScale;d.domain=a,d.range=[c-h,h];const p=d.convert(0),g=u.bandwidth;this.bars=o.map(e=>e.map((e,t)=>{const i=new yi._Scene.Rect;return i.x=h,i.y=u.convert(t),i.width=p-d.convert(e),i.height=g,i.strokeWidth=0,i.crisp=!0,i})),this.updateColors(i,n),this.root.append([].concat.apply([],this.bars))}updateColors(e,t){this.bars.forEach((i,n)=>i.forEach(i=>{i.fill=e[n],i.stroke=t[n]}))}};Rr.chartType="stackedBar",Rr.data=[[8,12,16],[6,9,12],[2,3,4]];var kr=Rr,Pr=class e extends kr{constructor(t,i,n,s,r){super(t,i,n,s,r,e.data,[0,10],"normalizedBarTooltip")}};Pr.chartType="normalizedBar",Pr.data=[[10,10,10],[6,7,8],[2,4,6]];var _r=Pr,Lr=vi._Scene.toRadians,Nr=class extends vr{constructor(e,t,i,n,s,r=.6,o="donutTooltip"){super(e,o);const a=(this.size-2*this.padding)/2,l=a+this.padding,c=[[Lr(-90),Lr(30)],[Lr(30),Lr(120)],[Lr(120),Lr(180)],[Lr(180),Lr(210)],[Lr(210),Lr(240)],[Lr(240),Lr(270)]];this.sectors=c.map(([e,t])=>{const i=new vi._Scene.Sector;return i.centerX=l,i.centerY=l,i.innerRadius=a*r,i.outerRadius=a,i.startAngle=e,i.endAngle=t,i.stroke=void 0,i.strokeWidth=0,i.inset=.75,i}),this.updateColors(t,i),this.root.append(this.sectors)}updateColors(e,t){this.sectors.forEach((i,n)=>{i.fill=e[n%e.length],i.stroke=t[n%t.length]})}};Nr.chartType="donut";var Or=class extends Nr{constructor(e,t,i,n,s){super(e,t,i,n,s,0,"pieTooltip")}};Or.chartType="pie";var Fr=class extends br{constructor(e,t,i){super(e,"lineTooltip"),this.data=[[9,7,8,5,6],[5,6,3,4,1],[1,3,4,8,7]],this.lines=wr(this.root,this.data,this.size,this.padding),this.updateColors(t,i)}updateColors(e,t){this.lines.forEach((t,i)=>{t.stroke=e[i]})}};Fr.chartType="line";var Gr=class extends br{constructor(e,t,i){super(e,"scatterTooltip");const n=this.size,s=this.padding,r=new bi._Scene.LinearScale;r.domain=[-.5,4],r.range=[2*s,n-s];const o=new bi._Scene.LinearScale;o.domain=[-.5,3.5],o.range=[n-s,s];const a=[];[[[.3,3],[1.1,.9],[2,.4],[3.4,2.4]],[[0,.3],[1,2],[2.4,1.4],[3,0]]].forEach(e=>{e.forEach(([e,t])=>{const i=new bi._Scene.Arc;i.strokeWidth=0,i.centerX=r.convert(e),i.centerY=o.convert(t),i.radius=2.5,a.push(i)})}),this.points=a,this.updateColors(t,i);const l=new bi._Scene.Group;l.setClipRectInGroupCoordinateSpace(new bi._Scene.BBox(s,s,n-2*s,n-2*s)),l.append(this.points),this.root.append(l)}updateColors(e,t){this.points.forEach((i,n)=>{i.stroke=t[n%t.length],i.fill=e[n%e.length]})}};Gr.chartType="scatter";var Br=class extends br{constructor(e,t,i){super(e,"bubbleTooltip");const n=this.size,s=this.padding,r=new Ci._Scene.LinearScale;r.domain=[0,1],r.range=[2*s,n-s];const o=new Ci._Scene.LinearScale;o.domain=[0,1],o.range=[n-s,s];const a=[];[[[.1,.3,5],[.5,.4,7],[.2,.8,7]],[[.8,.7,5],[.7,.3,9]]].forEach(e=>{e.forEach(([e,t,i])=>{const n=new Ci._Scene.Arc;n.strokeWidth=0,n.centerX=r.convert(e),n.centerY=o.convert(t),n.radius=i,n.fillOpacity=.7,a.push(n)})}),this.points=a,this.updateColors(t,i);const l=new Ci._Scene.Group;l.setClipRectInGroupCoordinateSpace(new Ci._Scene.BBox(s,s,n-2*s,n-2*s)),l.append(this.points),this.root.append(l)}updateColors(e,t){this.points.forEach((i,n)=>{i.stroke=t[n%t.length],i.fill=e[n%e.length]})}};Br.chartType="bubble";var Vr=class e extends br{constructor(t,i,n,s,r,o=e.data){super(t,"groupedAreaTooltip");const a=this.size,l=this.padding,c=new wi._Scene.BandScale;c.domain=[0,1,2],c.paddingInner=1,c.paddingOuter=0,c.range=[l+.5,a-l-.5];const h=new wi._Scene.LinearScale;h.domain=[0,6],h.range=[a-l+.5,l];const u=2*o.length-1,d=[],p=h.convert(0);o.forEach((e,t)=>{const i=c.convert(t);e.forEach((e,n)=>{const s=h.convert(e),r=d[n]||(d[n]=[]);r[t]={x:i,y:s},r[u-t]={x:i,y:p}})}),this.areas=d.reverse().map(e=>{const t=new wi._Scene.Path;t.strokeWidth=1,t.strokeOpacity=.75,t.fillOpacity=.7;const i=t.path;return i.clear(),e.forEach((e,t)=>i[t>0?"lineTo":"moveTo"](e.x,e.y)),i.closePath(),t}),this.updateColors(i,n),this.root.append(this.areas)}updateColors(e,t){this.areas.forEach((i,n)=>{i.fill=e[n],i.stroke=t[n]})}};Vr.chartType="area",Vr.data=[[1,3,5],[2,6,4],[5,3,1]];var Hr=Vr,Ur=class e extends br{constructor(t,i,n,s,r,o=e.data,a="stackedAreaTooltip"){super(t,a);const l=this.size,c=this.padding,h=new Si._Scene.BandScale;h.domain=[0,1,2],h.paddingInner=1,h.paddingOuter=0,h.range=[c+.5,l-c-.5];const u=new Si._Scene.LinearScale;u.domain=[0,16],u.range=[l-c+.5,c+.5];const d=2*o.length-1,p=[];o.forEach((e,t)=>{const i=h.convert(t);let n=0;e.forEach((e,s)=>{const r=u.convert(n+e),o=p[s]||(p[s]=[]);o[t]={x:i,y:r},o[d-t]={x:i,y:u.convert(n)},n+=e})}),this.areas=p.map(e=>{const t=new Si._Scene.Path;t.strokeWidth=0;const i=t.path;return i.clear(),e.forEach((e,t)=>i[t>0?"lineTo":"moveTo"](e.x,e.y)),i.closePath(),t}),this.updateColors(i,n),this.root.append(this.areas)}updateColors(e,t){this.areas.forEach((i,n)=>{i.fill=e[n],i.stroke=t[n]})}};Ur.chartType="stackedArea",Ur.data=[[2,3,2],[3,6,5],[6,2,2]];var zr=Ur,Wr=class e extends zr{constructor(t,i,n,s,r,o=e.data){super(t,i,n,s,r,o,"normalizedAreaTooltip")}};Wr.chartType="normalizedArea",Wr.data=zr.data.map(e=>{const t=e.reduce((e,t)=>e+t,0);return e.map(e=>e/t*16)});var jr=Wr,$r=class extends br{constructor(e,t,i){super(e,"histogramTooltip");const n=this.padding,s=this.size,r=[2,5,11,13,10,6,1],o=new xi._Scene.LinearScale;o.domain=[0,r.length],o.range=[n,s-n];const a=new xi._Scene.LinearScale;a.domain=[0,r.reduce((e,t)=>Math.max(e,t),0)],a.range=[s-n,n];const l=a.convert(0);this.bars=r.map((e,t)=>{const i=a.convert(e),n=o.convert(t),s=o.convert(t+1),r=new xi._Scene.Rect;return r.x=n,r.y=i,r.width=s-n,r.height=l-i,r.strokeWidth=1,r.strokeOpacity=.75,r.crisp=!0,r}),this.updateColors(t,i),this.root.append(this.bars)}updateColors([e],[t]){this.bars.forEach(i=>{i.fill=e,i.stroke=t})}};$r.chartType="histogram";var Kr=class extends vr{constructor(e,t){super(e,t),this.stroke="gray",this.showRadiusAxisLine=!0,this.showAngleAxisLines=!0}addAxes(){const e=this.size,t=this.padding,i=(e-2*t)/2,n=this.showAngleAxisLines?[i,.8*i,.6*i,.4*i]:[],s=new Mi._Scene.Line;s.x1=e/2,s.y1=t,s.x2=e/2,s.y2=e-t-i-n[n.length-1],s.stroke=this.stroke,s.strokeOpacity=.5,s.fill=void 0,s.visible=this.showRadiusAxisLine;const r=t+i;this.gridLines=n.map((e,t)=>{const i=new Mi._Scene.Path;return i.path.arc(r,r,e,0,2*Math.PI),i.strokeWidth=1,i.stroke=this.stroke,i.strokeOpacity=0===t?.5:.2,i.fill=void 0,i});const o=this.root;o.append(s),this.gridLines.length>0&&o.append(this.gridLines)}};fn([Ai.PostConstruct],Kr.prototype,"addAxes",1);var Yr=class extends Kr{constructor(e,t,i){super(e,"radialColumnTooltip"),this.data=[[6,8,10,2,6,5],[4,4,3,6,4,4],[5,4,2,9,8,9]],this.showRadiusAxisLine=!1;const{padding:n,size:s,data:r}=this,o=(s-2*n)/2,a=.4*o,l=new Ei._Scene.BandScale;l.domain=r[0].map((e,t)=>t),l.range=[0,2*Math.PI],l.paddingInner=0,l.paddingOuter=0;const c=.7*l.bandwidth,{processedData:h,max:u}=xr(r),d=new Ei._Scene.LinearScale;d.domain=[0,u],d.range=[a,o];const p=this.size/2;this.series=h.map((e,t)=>{const i=0===t?void 0:h[t-1],n=new Ei._Scene.Group({zIndex:1e6}),s=e.map((e,t)=>{const n=null==i?void 0:i[t],s=d.convert(e),r=d.convert(null!=n?n:0),h=l.convert(t),u=h+c,g=Ei._Scene.getRadialColumnWidth(h,u,o,.5,.5),f=new Ei._Scene.RadialColumnShape;return f.scalingCenterX=p,f.scalingCenterY=p,f.columnWidth=g,f.innerRadius=r,f.outerRadius=s,f.startAngle=h,f.endAngle=u,f.isBeveled=!0,f.axisInnerRadius=a,f.axisOuterRadius=o,f.stroke=void 0,f.strokeWidth=0,f});return n.append(s),n.translationX=p,n.translationY=p,n}),this.root.append(this.series),this.updateColors(t,i)}updateColors(e,t){this.series.forEach((i,n)=>{var s;null==(s=i.children)||s.forEach(i=>{i.fill=e[n%e.length],i.stroke=t[n%t.length]})})}};Yr.chartType="radialColumn";var qr=class extends Kr{constructor(e,t,i){super(e,"radialBarTooltip"),this.data=[[6,8,10],[4,4,3],[5,4,2]],this.showRadiusAxisLine=!1;const n=(this.size-this.padding)/2,s=.4*n,r=n+s,o=new Ti._Scene.BandScale;o.domain=this.data[0].map((e,t)=>t),o.range=[n,s],o.paddingInner=.5,o.paddingOuter=0;const a=o.bandwidth,{processedData:l,max:c}=xr(this.data),h=new Ti._Scene.LinearScale;h.domain=[0,Math.ceil(1.5*c)];const u=1.5*Math.PI,d=u+2*Math.PI;h.range=[u,d];const p=this.size/2;this.series=l.map((e,t)=>{const i=t<0?void 0:l[t-1],n=new Ti._Scene.Group({zIndex:1e6}),s=e.map((e,t)=>{var n;const s=null!=(n=null==i?void 0:i[t])?n:0,l=r-o.convert(t),c=l+a,u=h.convert(s),d=h.convert(e),g=new Ti._Scene.Sector;return g.centerX=p,g.centerY=p,g.innerRadius=l,g.outerRadius=c,g.startAngle=u,g.endAngle=d,g.stroke=void 0,g.strokeWidth=0,g});return n.append(s),n}),this.root.append(this.series),this.updateColors(t,i)}updateColors(e,t){this.series.forEach((i,n)=>{var s;null==(s=i.children)||s.forEach(i=>{i.fill=e[n%e.length],i.stroke=t[n%t.length]})})}};qr.chartType="radialBar";var Xr=class extends Kr{constructor(e,t,i){super(e,"radarLineTooltip"),this.markerSize=4,this.data=[[8,7,8,7,8,8,7,8],[6,8,5,10,6,7,4,6],[0,3,3,5,4,4,2,0]],this.showRadiusAxisLine=!1;const n=(this.size-2*this.padding)/2,{paths:s,markers:r}=Sr(this.root,this.data,this.size,n,0,this.markerSize);this.lines=s,this.markers=r,this.updateColors(t,i)}updateColors(e,t){this.lines.forEach((i,n)=>{const s=this.data[n].length;i.stroke=e[n];const r=n*s,o=r+s;this.markers.slice(r,o).forEach(i=>{i.stroke=t[n],i.fill=e[n]})})}};Xr.chartType="radarLine";var Zr=class extends Kr{constructor(e,t,i){super(e,"radarAreaTooltip"),this.data=[[8,10,5,7,4,1,5,8],[1,1,2,7,7,8,10,1],[4,5,9,9,4,2,3,4]],this.showRadiusAxisLine=!1;const n=(this.size-2*this.padding)/2,s=n-.3*this.size;this.areas=Sr(this.root,this.data,this.size,n,s).paths,this.updateColors(t,i)}updateColors(e,t){this.areas.forEach((i,n)=>{i.fill=e[n],i.stroke=t[n]})}};Zr.chartType="radarArea";var Qr=class extends Kr{constructor(e,t,i){super(e,"nightingaleTooltip"),this.data=[[6,10,9,8,7,8],[4,6,5,4,5,5],[3,5,4,3,4,7]],this.showRadiusAxisLine=!1;const n=(this.size-2*this.padding)/2,s=new Di._Scene.BandScale;s.domain=this.data[0].map((e,t)=>t),s.range=[-Math.PI,Math.PI],s.paddingInner=0,s.paddingOuter=0;const r=.7*s.bandwidth,{processedData:o,max:a}=xr(this.data),l=new Di._Scene.LinearScale;l.domain=[0,a],l.range=[0,n];const c=this.size/2;this.series=o.map((e,t)=>{const i=t<0?void 0:o[t-1],n=new Di._Scene.Group({zIndex:1e6}),a=e.map((e,t)=>{const n=null==i?void 0:i[t],o=l.convert(e),a=l.convert(null!=n?n:0),h=s.convert(t),u=h+r,d=new Di._Scene.Sector;return d.centerX=c,d.centerY=c,d.innerRadius=a,d.outerRadius=o,d.startAngle=h,d.endAngle=u,d.stroke=void 0,d.strokeWidth=0,d});return n.append(a),n}),this.root.append(this.series),this.updateColors(t,i)}updateColors(e,t){this.series.forEach((i,n)=>{var s;null==(s=i.children)||s.forEach(i=>{i.fill=e[n%e.length],i.stroke=t[n%t.length]})})}};Qr.chartType="nightingale";var Jr=class extends br{constructor(e,t,i){super(e,"rangeBarTooltip"),this.bars=this.createRangeBar(this.root,[3,3.5,3],this.size,this.padding,"vertical"),this.updateColors(t,i)}updateColors(e,t){this.bars.forEach((i,n)=>{i.fill=e[n],i.stroke=t[n]})}createRangeBar(e,t,i,n,s){const r="horizontal"===s,o=2*n,a=new Ii._Scene.BandScale;a.domain=t.map((e,t)=>t),a.range=[n,i-n],a.paddingInner=.3,a.paddingOuter=.3;const l=new Ii._Scene.LinearScale;l.domain=[.7*t.reduce((e,t)=>Math.min(e,t),1/0),1.3*t.reduce((e,t)=>Math.max(e,t),0)],l.range=[o,i-o];const c=a.bandwidth,h=t.map((e,t)=>{const[i,n]=[.7*e,1.3*e],s=a.convert(t),o=l.convert(i),h=l.convert(n)-o,u=new Ii._Scene.Rect;return u.x=r?o:s,u.y=r?s:o,u.width=r?h:c,u.height=r?c:h,u.strokeWidth=0,u.crisp=!0,u});return e.append(h),h}};Jr.chartType="rangeBar";var eo=class extends br{constructor(e,t,i){super(e,"rangeAreaTooltip");const n=[to({offset:1.5,length:4,pattern:{low:3,high:5,period:4}}),to({offset:1.5,length:4,pattern:{low:2.25,high:4.25,period:4}}),to({offset:3,length:4,pattern:{low:2.5,high:4.5,period:4}})].map(e=>e.map(([e,t])=>({x:e,low:t-.875,high:t+.875}))),{lines:s,areas:r}=this.createRangeArea(this.root,n,this.size,this.padding);this.lines=s,this.areas=r,this.updateColors(t,i)}updateColors(e,t){e=no(e,1,2),t=no(t,1,2),this.lines.forEach(([e,i],n)=>{e.fill=void 0,e.stroke=t[n],i.fill=void 0,i.stroke=t[n]}),this.areas.forEach((t,i)=>{t.fill=e[i]})}createRangeArea(e,t,i,n){const s=t.reduce((e,t)=>t.reduce((e,{x:t})=>Math.min(e,t),e),1/0),r=t.reduce((e,t)=>t.reduce((e,{x:t})=>Math.max(e,t),e),-1/0),o=t.reduce((e,t)=>t.reduce((e,{low:t})=>Math.min(e,t),e),1/0),a=t.reduce((e,t)=>t.reduce((e,{high:t})=>Math.max(e,t),e),-1/0),l=new Ri._Scene.LinearScale;l.domain=[s,r],l.range=[n,i-n];const c=2*n,h=new Ri._Scene.LinearScale;h.domain=[o,a],h.range=[i-c,c];const u=[],d=[];return t.map(e=>{const t=new Ri._Scene.Path,i=new Ri._Scene.Path,n=new Ri._Scene.Path;return u.push([t,i]),d.push(n),t.strokeWidth=0,i.strokeWidth=0,n.strokeWidth=0,n.fillOpacity=.8,t.path.clear(),i.path.clear(),n.path.clear(),e.map((e,s)=>{const{x:r,low:o,high:a}=e,c=l.convert(r),u=h.convert(o),d=h.convert(a),p=s>0?"lineTo":"moveTo";return t.path[p](c,d),i.path[p](c,u),n.path[p](c,d),[c,u]})}).forEach((e,t)=>{const i=e.length-1,n=d[t];for(let t=i;t>=0;t--){const[i,s]=e[t];n.path.lineTo(i,s)}}),e.append(d.concat(...u)),{lines:u,areas:d}}};function to(e){const{offset:t,length:i,pattern:n}=e,s=function(e,t,i){const{period:n}=i,s=e/n,r=[0,.5].map(e=>e-s).map(io).sort((e,t)=>e-t);return Array.from({length:Math.floor(r.length*(n/t))},(e,t)=>r[t%r.length]+Math.floor(t/r.length)).map(e=>e*n).map(t=>o(t,e,i))}(t,i,n),r=i;return 0!==s.length&&0===s[0][0]||s.unshift(o(0,t,n)),s[s.length-1][0]!==r&&s.push(o(r,t,n)),s;function o(e,t,i){return[e,a(t+e,i)]}function a(e,t){const{low:i,high:n,period:s}=t,r=io(e/s);return i+(n-i)*(r>.5?1-2*(r-.5):2*r)}}function io(e){const t=e%1;return t<0?t+1:t}function no(e,t,i){const n=[...e],s=n[t];return n[t]=n[i],n[i]=s,n}eo.chartType="rangeArea";var so=class extends br{constructor(e,t,i,n,s){super(e,"boxPlotTooltip");const r=this.padding,o=this.size,a=[11,11.5,10.5],l=new ki._Scene.LinearScale;l.domain=[.8*a.reduce((e,t)=>Math.min(e,t),1/0),1.2*a.reduce((e,t)=>Math.max(e,t),0)],l.range=[o-1.5*r,r];const c=new ki._Scene.BandScale;c.domain=a.map((e,t)=>t),c.range=[r,o-r],c.paddingInner=.4,c.paddingOuter=.2;const h=Math.round(c.bandwidth),u=Math.round(c.bandwidth/2);this.boxPlotGroups=a.map((e,t)=>{let[i,n,s,r]=[.8*e,.9*e,1.1*e,1.2*e];const o=Math.round(l.convert(s)),a=Math.round(c.convert(t)),d=Math.round(a+h),p=Math.round(l.convert(n)),g=Math.round(l.convert(i)),f=Math.round(l.convert(e)),m=Math.round(l.convert(r)),y=a+u,v=new ki._Scene.Group,b=new ki._Scene.Rect,C=new ki._Scene.Line,w=new ki._Scene.Line,S=new ki._Scene.Line,x=new ki._Scene.Line,E=new ki._Scene.Line;return b.x=a,b.y=o,b.width=h,b.height=p-o,b.strokeWidth=1,b.strokeOpacity=.75,b.crisp=!0,this.setLineProperties(C,a,d,f,f),this.setLineProperties(w,y,y,m,o),this.setLineProperties(S,y,y,g,p),this.setLineProperties(x,a,d,m,m),this.setLineProperties(E,a,d,g,g),v.append([b,C,w,S,x,E]),v}),this.updateColors(t,i,n,s),this.root.append(this.boxPlotGroups)}updateColors(e,t,i,n){var s;const r=null==i?void 0:i.properties.get(ki._Theme.DEFAULT_BACKGROUND_COLOUR),o=null!=(s=Array.isArray(r)?r[0]:r)?s:"white";this.boxPlotGroups.forEach((i,s)=>{var r;null==(r=i.children)||r.forEach(i=>{const r=e[s%e.length];i.fill=n?r:ki._Util.Color.interpolate(r,o)(.7),i.stroke=t[s%t.length]})})}setLineProperties(e,t,i,n,s){e.x1=t,e.x2=i,e.y1=n,e.y2=s,e.strokeOpacity=.75}};so.chartType="boxPlot";var ro=class extends vr{constructor(e,t,i,n,s){super(e,"treemapTooltip");const{size:r,padding:o}=this,a=[[1,1],[3,2,1]],l=a.length%2==0?.3:.2,c=[o,r-o],h=a.length,u=h*(h+1)/2,d=l/(h-1),p=c[1]-c[0],g=p-l;let f=c[0];this.rects=a.reduce((e,t,i)=>{null!=e||(e=[]);const n=g*((h-i)/u),s=t.length,r=t.reduce((e,t)=>e+t,0),o=l/(s-1||1),a=s>1?p-l:p;let m=c[0];const y=t.map(e=>{const t=new Pi._Scene.Rect,i=a*e/r;return t.x=f,t.y=m,t.width=n,t.height=i,t.strokeWidth=.75,t.crisp=!0,m+=i+o,t});return f+=n+d,e.push(...y),e},[]),this.updateColors(t,i,n,s);const m=new Pi._Scene.Group;m.setClipRectInGroupCoordinateSpace(new Pi._Scene.BBox(o,o,r-o,r-o)),m.append(this.rects),this.root.append(m)}updateColors(e,t,i,n){var s;const{properties:r}=null!=i?i:{},o=null==r?void 0:r.get(Pi._Theme.DEFAULT_BACKGROUND_COLOUR),a=null!=(s=Array.isArray(o)?o[0]:o)?s:"white";this.rects.forEach((i,s)=>{i.fill=e[s%t.length],i.stroke=n?t[s%t.length]:a})}};ro.chartType="treemap";var oo=class extends Kr{constructor(e,t,i){super(e,"sunburstTooltip"),this.data=[[[],[]],[[],[]],[[],[]]],this.angleOffset=-Math.PI/2,this.innerRadiusRatio=0,this.showRadiusAxisLine=!1,this.showAngleAxisLines=!1;const{data:n,size:s,padding:r,angleOffset:o,innerRadiusRatio:a}=this,l=(s-2*r)/2,c=[o+0,o+2*Math.PI],h=Math.abs(c[1]-c[0]),u=[l*a,l],d=Math.abs(u[1]-u[0]);let p=0;const g=(e,t)=>{e.forEach(e=>{const i=t+1;p=Math.max(p,i),g(e,i)})};g(n,0);const f=d/p,m=this.size/2,y=c[0];this.series=[];const v=(e,t,i,n,s)=>{if(!Array.isArray(e))return;const r=t+1;let o=i;e.forEach((e,i,a)=>{let l=s;l||(l=new _i._Scene.Group,this.series.push(l));const c=u[0]+t*f,h=u[0]+r*f,d=1/a.length,p=o,g=p+n*d,y=new _i._Scene.Sector;y.centerX=m,y.centerY=m,y.innerRadius=c,y.outerRadius=h,y.startAngle=p,y.endAngle=g,y.stroke=void 0,y.strokeWidth=0,y.inset=.75,o=g,l.append(y),v(e,r,p,Math.abs(g-p),l)})};v(n,0,y,h),this.root.append(this.series),this.updateColors(t,i)}updateColors(e,t){this.series.forEach((i,n)=>{var s;null==(s=i.children)||s.forEach(i=>{i.fill=e[n%e.length],i.stroke=t[n%t.length]})})}};oo.chartType="sunburst";var ao=class extends vr{constructor(e,t,i,n,s){var r,o;super(e,"heatmapTooltip");const{size:a,padding:l}=this,c=Array.from({length:3},(e,t)=>Array.from({length:3},(e,t)=>t)),h=c.map((e,t)=>t),u=new Li._Scene.BandScale;u.domain=h,u.range=[l,a-l],u.paddingInner=.01,u.paddingOuter=.1;const d=new Li._Scene.BandScale;d.domain=h,d.range=[l,a-l],d.paddingInner=.01,d.paddingOuter=.1;const p=null!=(r=u.bandwidth)?r:0,g=null!=(o=d.bandwidth)?o:0;this.rects=c.reduce((e,t,i)=>{null!=e||(e=[]);const n=t.map((e,t)=>{const n=new Li._Scene.Rect;return n.x=u.convert(i),n.y=d.convert(t),n.width=p,n.height=g,n.strokeWidth=0,n.crisp=!0,n});return e.push(...n),e},[]),this.updateColors(t,i,n,s);const f=new Li._Scene.Group;f.setClipRectInGroupCoordinateSpace(new Li._Scene.BBox(l,l,a-l,a-l)),f.append(this.rects),this.root.append(f)}updateColors(e,t,i,n){var s;const{properties:r}=null!=i?i:{},o=null==r?void 0:r.get(Li._Theme.DEFAULT_DIVERGING_SERIES_COLOUR_RANGE),a=null==r?void 0:r.get(Li._Theme.DEFAULT_BACKGROUND_COLOUR),l=null!=(s=Array.isArray(a)?a[0]:a)?s:"white",c=n?[e[0],e[1]]:o,h=n?t[0]:l;this.rects.forEach((e,t)=>{e.fill=Li._Util.Color.interpolate(c[0],c[1])(.2*t),e.stroke=h})}};ao.chartType="heatmap";var lo=class extends br{constructor(e,t,i,n,s){super(e,"waterfallTooltip"),this.data=[4,3,-3,6,-3],this.bars=this.createWaterfall(this.root,this.data,this.size,this.padding,"vertical").bars,this.updateColors(t,i,n,s)}updateColors(e,t,i,n){var s,r;const{data:o}=this,{properties:a}=null!=i?i:{},l={fill:e[0],stroke:t[0]},c={fill:e[1],stroke:t[1]},h=n?l:null!=(s=null==a?void 0:a.get(Ni._Theme.DEFAULT_WATERFALL_SERIES_POSITIVE_COLOURS))?s:l,u=n?c:null!=(r=null==a?void 0:a.get(Ni._Theme.DEFAULT_WATERFALL_SERIES_NEGATIVE_COLOURS))?r:c;this.bars.forEach((e,t)=>{const i=o[t]>=0;e.fill=i?h.fill:u.fill,e.stroke=i?h.stroke:u.stroke})}createWaterfall(e,t,i,n,s){const r=2*n,{processedData:o,min:a,max:l}=xr(t.map(e=>[e])),c=o.reduce((e,t)=>e.concat(t),[]),h=new Ni._Scene.LinearScale;h.domain=[Math.min(a,0),l],h.range=[i-r,r];const u=new Ni._Scene.BandScale;u.domain=t.map((e,t)=>t),u.range=[n,i-n],u.paddingInner=.2,u.paddingOuter=.3;const d=u.bandwidth,p=new Ni._Scene.Path;p.stroke="#575757",p.strokeWidth=0;const g=Math.floor(p.strokeWidth)%2/2,f=p.path;f.clear();const m="horizontal"===s,y=c.map((e,i)=>{const n=i>0?c[i-1]:0,s=t[i]>0,r=Math.round(h.convert(e)),o=Math.round(h.convert(n)),a=(s?r:o)-g,l=(s?o:r)+g,p=Math.abs(l-a),y=u.convert(i),v=new Ni._Scene.Rect;v.x=m?a:y,v.y=m?y:a,v.width=m?p:d,v.height=m?d:p,v.strokeWidth=0,v.crisp=!0;const b=r+g,C=o+g;if(i>0){const e=m?C:v.x,t=m?v.y:C;f.lineTo(e,t)}const w=m?b:v.x,S=m?v.y:b;return f.moveTo(w,S),v});return e.append([p,...y]),{bars:y}}};lo.chartType="waterfall";var co=class extends br{constructor(e,t,i){super(e,"columnLineComboTooltip"),this.columnData=[3,4],this.lineData=[[5,4,6,5,4]];const{root:n,columnData:s,lineData:r,size:o,padding:a}=this;this.columns=Cr({stacked:!1,root:n,data:s,size:o,padding:a,xScaleDomain:[0,1],yScaleDomain:[0,4],xScalePadding:.5}),n.append(this.columns),this.lines=wr(n,r,o,a),this.updateColors(t,i)}updateColors(e,t){this.columns.forEach((i,n)=>{i.fill=e[n],i.stroke=t[n]}),this.lines.forEach((t,i)=>{t.stroke=e[i+2]})}};co.chartType="columnLineCombo";var ho=class extends br{constructor(e,t,i){super(e,"areaColumnComboTooltip"),this.columnData=[3,4.5],this.areaData=[[5,4,6,5,4]];const{root:n,columnData:s,areaData:r,size:o,padding:a}=this;this.columns=Cr({stacked:!1,root:n,data:s,size:o,padding:a,xScaleDomain:[0,1],yScaleDomain:[0,6],xScalePadding:.5});const l=new Oi._Scene.BandScale;l.range=[a,o-a],l.domain=[0,1,2,3,4],l.paddingInner=1,l.paddingOuter=0;const c=new Oi._Scene.LinearScale;c.range=[o-a,a],c.domain=[0,6];const h=[],u=c.convert(0),d=l.convert(0);r.forEach((e,t)=>{const i=h[t]||(h[t]=[]);e.forEach((e,t)=>{const n=e,s=t,r=l.convert(s),o=c.convert(n);i[t]={x:r,y:o}});const n=l.convert(e.length-1);h[t].push({x:n,y:u},{x:d,y:u})}),this.areas=h.map(e=>{const t=new Oi._Scene.Path;t.strokeWidth=0,t.fillOpacity=.8;const i=t.path;return e.forEach((e,t)=>i[t>0?"lineTo":"moveTo"](e.x,e.y)),t}),n.append(this.areas),n.append([].concat.apply([],this.columns)),this.updateColors(t,i)}updateColors(e,t){this.areas.forEach((i,n)=>{i.fill=e[n],i.stroke=t[n]}),this.columns.forEach((i,n)=>{i.fill=e[n+1],i.stroke=t[n+1]})}};ho.chartType="areaColumnCombo";var uo=class extends vr{constructor(e,t,i){super(e,"customComboTooltip"),this.columnData=[3,4],this.lineData=[[5,4,6,5,4]];const{root:n,columnData:s,lineData:r,size:o,padding:a}=this;this.columns=Cr({stacked:!1,root:n,data:s,size:o,padding:a,xScaleDomain:[0,1],yScaleDomain:[0,4],xScalePadding:.5}),n.append(this.columns),this.lines=wr(n,r,o,a);const l="grey",c=new Fi._Scene.Line;c.x1=a,c.y1=a,c.x2=a,c.y2=o-a+3,c.stroke=l;const h=new Fi._Scene.Line;h.x1=a-3+1,h.y1=o-a,h.x2=o-a+1,h.y2=o-a,h.stroke=l;const u=new Fi._Scene.Path;this.buildPenIconPath(u),u.fill="whitesmoke",u.stroke="darkslategrey",u.strokeWidth=1,n.append([h,c,u]),this.updateColors(t,i)}updateColors(e,t){this.columns.forEach((i,n)=>{i.fill=e[n],i.stroke=t[n]}),this.lines.forEach((t,i)=>{t.stroke=e[i+2]})}buildPenIconPath(e){const{path:t}=e;t.moveTo(25.76,43.46),t.lineTo(31.27,48.53),t.moveTo(49.86,22),t.lineTo(49.86,22),t.cubicCurveTo(49.01994659053345,21.317514933510974,47.89593834348529,21.09645997825817,46.86,21.41),t.lineTo(46.86,21.41),t.cubicCurveTo(45.55460035985361,21.77260167850787,44.38777081121966,22.517979360321792,43.51,23.55),t.lineTo(25.51,43.8),t.lineTo(25.43,43.89),t.lineTo(23.01,51.89),t.lineTo(22.83,52.46),t.lineTo(31.02,48.86),t.lineTo(49.02,28.52),t.lineTo(49.02,28.52),t.cubicCurveTo(49.940716461596224,27.521914221246085,50.54302631059587,26.2720342455763,50.75,24.93),t.lineTo(50.75,24.93),t.cubicCurveTo(50.95363374988308,23.866379846512814,50.62080640232334,22.77066734274871,49.86,22),t.closePath(),t.moveTo(41.76,25.5),t.lineTo(47.34,30.5),t.moveTo(40.74,26.65),t.lineTo(46.25,31.71)}};uo.chartType="customCombo";var po={columnGroup:{column:{range:!0,pivot:!0,enterprise:!1,icon:Er},stackedColumn:{range:!0,pivot:!0,enterprise:!1,icon:Mr},normalizedColumn:{range:!0,pivot:!0,enterprise:!1,icon:Dr}},barGroup:{bar:{range:!0,pivot:!0,enterprise:!1,icon:Ir},stackedBar:{range:!0,pivot:!0,enterprise:!1,icon:kr},normalizedBar:{range:!0,pivot:!0,enterprise:!1,icon:_r}},pieGroup:{pie:{range:!0,pivot:!0,enterprise:!1,icon:Or},donut:{range:!0,pivot:!0,enterprise:!1,icon:Nr},doughnut:{range:!0,pivot:!0,enterprise:!1,icon:Nr}},lineGroup:{line:{range:!0,pivot:!0,enterprise:!1,icon:Fr}},scatterGroup:{scatter:{range:!0,pivot:!0,enterprise:!1,icon:Gr},bubble:{range:!0,pivot:!0,enterprise:!1,icon:Br}},areaGroup:{area:{range:!0,pivot:!0,enterprise:!1,icon:Hr},stackedArea:{range:!0,pivot:!0,enterprise:!1,icon:zr},normalizedArea:{range:!0,pivot:!0,enterprise:!1,icon:jr}},polarGroup:{radarLine:{range:!0,pivot:!1,enterprise:!0,icon:Xr},radarArea:{range:!0,pivot:!1,enterprise:!0,icon:Zr},nightingale:{range:!0,pivot:!1,enterprise:!0,icon:Qr},radialColumn:{range:!0,pivot:!1,enterprise:!0,icon:Yr},radialBar:{range:!0,pivot:!1,enterprise:!0,icon:qr}},statisticalGroup:{boxPlot:{range:!0,pivot:!1,enterprise:!0,icon:so},histogram:{range:!0,pivot:!1,enterprise:!1,icon:$r},rangeBar:{range:!0,pivot:!1,enterprise:!0,icon:Jr},rangeArea:{range:!0,pivot:!1,enterprise:!0,icon:eo}},hierarchicalGroup:{treemap:{range:!0,pivot:!0,enterprise:!0,icon:ro},sunburst:{range:!0,pivot:!0,enterprise:!0,icon:oo}},specializedGroup:{heatmap:{range:!0,pivot:!1,enterprise:!0,icon:ao},waterfall:{range:!0,pivot:!1,enterprise:!0,icon:lo}},combinationGroup:{columnLineCombo:{range:!0,pivot:!0,enterprise:!1,icon:co},areaColumnCombo:{range:!0,pivot:!0,enterprise:!1,icon:ho},customCombo:{range:!0,pivot:!0,enterprise:!1,icon:uo}}},go={columnGroup:["column","stackedColumn","normalizedColumn"],barGroup:["bar","stackedBar","normalizedBar"],pieGroup:["pie","donut"],lineGroup:["line"],scatterGroup:["scatter","bubble"],areaGroup:["area","stackedArea","normalizedArea"],polarGroup:["radarLine","radarArea","nightingale","radialColumn","radialBar"],statisticalGroup:["boxPlot","histogram","rangeBar","rangeArea"],hierarchicalGroup:["treemap","sunburst"],specializedGroup:["heatmap","waterfall"],combinationGroup:["columnLineCombo","areaColumnCombo","customCombo"]},fo=class e extends hi.Component{constructor(t,i,n,s,r,o=go){super(e.TEMPLATE),this.wrappers={},this.chartController=t,this.fills=i,this.strokes=n,this.themeTemplateParameters=s,this.isCustomTheme=r,this.chartGroups=dn({},o)}init(){!this.chartController.customComboExists()&&this.chartGroups.combinationGroup&&(this.chartGroups.combinationGroup=this.chartGroups.combinationGroup.filter(e=>"customCombo"!==e));const e=this.getGui(),t=this.chartController.isEnterprise(),i=this.chartController.isPivotChart(),n=!i,s=Object.keys(this.chartGroups).map(e=>{var s;const r=e in po?po[e]:void 0;if(!r)return hi._.warnOnce(`invalid chartGroupsDef config '${e}'`),null;const o=(null!=(s=this.chartGroups[e])?s:[]).map(s=>{const o=s in r?r[s]:void 0;return o?!t&&o.enterprise?null:n&&o.range||i&&o.pivot?o:null:(hi._.warnOnce(`invalid chartGroupsDef config '${e}.${s}'`),null)}).filter(e=>null!=e);return 0===o.length?null:{label:this.chartTranslationService.translate(e),items:o}}).filter(e=>null!=e);for(const{label:t,items:i}of s){const n=this.createBean(new hi.AgGroupComponent({title:t,suppressEnabledCheckbox:!0,enabled:!0,suppressOpenCloseIcons:!0,cssIdentifier:"charts-settings",direction:"horizontal"}));for(const e of i){const t=e.icon,i=document.createElement("div");i.classList.add("ag-chart-mini-thumbnail");const s=t.chartType;this.addManagedListener(i,"click",()=>{this.chartController.setChartType(s),this.updateSelectedMiniChart()}),this.wrappers[s]=i,this.createBean(new t(i,this.fills,this.strokes,this.themeTemplateParameters,this.isCustomTheme)),n.addItem(i)}e.appendChild(n.getGui())}this.updateSelectedMiniChart()}updateSelectedMiniChart(){const e=this.chartController.getChartType();for(const t in this.wrappers){const i=t===e;this.wrappers[t].classList.toggle("ag-selected",i)}}};fo.TEMPLATE='<div class="ag-chart-settings-mini-wrapper"></div>',fn([(0,hi.Autowired)("chartTranslationService")],fo.prototype,"chartTranslationService",2),fn([hi.PostConstruct],fo.prototype,"init",1);var mo=fo,yo=class e extends ci.Component{constructor(t){super(e.TEMPLATE),this.chartController=t,this.miniChartsContainers=[],this.cardItems=[],this.activePaletteIndex=0,this.palettes=[],this.themes=[]}postConstruct(){this.resetPalettes(),this.ePrevBtn.insertAdjacentElement("afterbegin",ci._.createIconNoSpan("previous",this.gos)),this.eNextBtn.insertAdjacentElement("afterbegin",ci._.createIconNoSpan("next",this.gos)),this.addManagedListener(this.ePrevBtn,"click",()=>this.setActivePalette(this.getPrev(),"left")),this.addManagedListener(this.eNextBtn,"click",()=>this.setActivePalette(this.getNext(),"right")),this.addManagedListener(this.chartController,rs.EVENT_CHART_TYPE_CHANGED,()=>this.resetPalettes(!0)),this.addManagedListener(this.chartController,rs.EVENT_CHART_API_UPDATE,()=>this.resetPalettes(!0)),this.scrollSelectedIntoView()}scrollSelectedIntoView(){setTimeout(()=>{const e=this.miniChartsContainers.find(e=>!e.getGui().classList.contains("ag-hidden")).getGui().querySelector(".ag-selected");if(e){const t=e.offsetParent;t&&this.eMiniChartsContainer.scrollTo(0,t.offsetTop)}},250)}resetPalettes(e){var t,i;const n=this.chartController.getPalettes(),s=this.chartController.getThemeTemplateParameters(),r=null==(i=null==(t=this.gos.get("chartToolPanelsDef"))?void 0:t.settingsPanel)?void 0:i.chartGroupsDef;if(ci._.shallowCompare(n,this.palettes)&&!e||this.isAnimating)return;this.palettes=n,this.themes=this.chartController.getThemeNames(),this.activePaletteIndex=this.themes.findIndex(e=>e===this.chartController.getChartThemeName()),this.cardItems=[],ci._.clearElement(this.eCardSelector),this.destroyMiniCharts();const{themes:o}=this;this.palettes.forEach((e,t)=>{const i=this.activePaletteIndex===t,{fills:n,strokes:a}=e,l=!jn(o[t]),c=this.createBean(new mo(this.chartController,n,a,s[t],l,r));this.miniChartsContainers.push(c),this.eMiniChartsContainer.appendChild(c.getGui()),this.addCardLink(t),i?c.updateSelectedMiniChart():c.setDisplayed(!1)}),ci._.setDisplayed(this.eNavBar,this.palettes.length>1),ci._.radioCssClass(this.cardItems[this.activePaletteIndex],"ag-selected","ag-not-selected")}addCardLink(e){const t=document.createElement("div");t.classList.add("ag-chart-settings-card-item"),this.addManagedListener(t,"click",()=>{this.setActivePalette(e,e<this.activePaletteIndex?"left":"right")}),this.eCardSelector.appendChild(t),this.cardItems.push(t)}getPrev(){let e=this.activePaletteIndex-1;return e<0&&(e=this.palettes.length-1),e}getNext(){let e=this.activePaletteIndex+1;return e>=this.palettes.length&&(e=0),e}setActivePalette(e,t){if(this.isAnimating||this.activePaletteIndex===e)return;ci._.radioCssClass(this.cardItems[e],"ag-selected","ag-not-selected");const i=this.miniChartsContainers[this.activePaletteIndex],n=i.getGui(),s=this.miniChartsContainers[e],r=s.getGui();i.updateSelectedMiniChart(),s.updateSelectedMiniChart();const o="left"===t?-1:1,a=r.style.left=ci._.getAbsoluteWidth(this.getGui())*o+"px";this.activePaletteIndex=e,this.isAnimating=!0;const l="ag-animating";s.setDisplayed(!0),i.addCssClass(l),s.addCssClass(l),this.chartController.setChartThemeName(this.themes[e]),window.setTimeout(()=>{n.style.left=-parseFloat(a)+"px",r.style.left="0px"},0),window.setTimeout(()=>{this.isAnimating=!1,i.removeCssClass(l),s.removeCssClass(l),i.setDisplayed(!1)},300)}destroyMiniCharts(){ci._.clearElement(this.eMiniChartsContainer),this.miniChartsContainers=this.destroyBeans(this.miniChartsContainers)}destroy(){this.destroyMiniCharts(),super.destroy()}};yo.TEMPLATE='<div class="ag-chart-settings-wrapper">\n            <div ref="eMiniChartsContainer" class="ag-chart-settings-mini-charts-container ag-scrollable-container"></div>\n            <div ref="eNavBar" class="ag-chart-settings-nav-bar">\n                <div ref="ePrevBtn" class="ag-chart-settings-prev">\n                    <button type="button" class="ag-button ag-chart-settings-prev-button"></button>\n                </div>\n                <div ref="eCardSelector" class="ag-chart-settings-card-selector"></div>\n                <div ref="eNextBtn" class="ag-chart-settings-next">\n                    <button type="button" class="ag-button ag-chart-settings-next-button"></button>\n                </div>\n            </div>\n        </div>',fn([(0,ci.RefSelector)("eMiniChartsContainer")],yo.prototype,"eMiniChartsContainer",2),fn([(0,ci.RefSelector)("eNavBar")],yo.prototype,"eNavBar",2),fn([(0,ci.RefSelector)("eCardSelector")],yo.prototype,"eCardSelector",2),fn([(0,ci.RefSelector)("ePrevBtn")],yo.prototype,"ePrevBtn",2),fn([(0,ci.RefSelector)("eNextBtn")],yo.prototype,"eNextBtn",2),fn([ci.PostConstruct],yo.prototype,"postConstruct",1);var vo=yo,bo=class e extends mt.Component{constructor(e,t){super(),this.panels=e,this.chartMenuContext=t,this.tabs=[]}init(){this.panels.forEach(e=>{const t=e.replace("chart","").toLowerCase(),i=this.createPanel(t),n=this.createTab(e,t,i);this.tabs.push(n),this.addDestroyFunc(()=>this.destroyBean(i))}),this.tabbedLayout=new mt.TabbedLayout({items:this.tabs,cssClass:"ag-chart-tabbed-menu",keepScrollPosition:!0,suppressFocusBodyOnOpen:!0,suppressTrapFocus:!0,enableCloseButton:!this.chartMenuService.isLegacyFormat(),closeButtonAriaLabel:this.chartTranslationService.translate("ariaChartMenuClose"),onCloseClicked:()=>{var t;null==(t=this.eventSource)||t.focus({preventScroll:!0}),this.dispatchEvent({type:e.EVENT_CLOSED})}}),this.getContext().createBean(this.tabbedLayout)}createTab(e,t,i){const n=document.createElement("div");n.classList.add("ag-chart-tab",`ag-chart-${t}`),this.getContext().createBean(i),n.appendChild(i.getGui());const s=document.createElement("div"),r=this.chartTranslationService.translate(t);return s.innerText=r,{title:s,titleLabel:r,bodyPromise:mt.AgPromise.resolve(n),getScrollableContainer:()=>n.querySelector(".ag-scrollable-container")||n,name:e}}showTab(e){const t=this.tabs[e];this.tabbedLayout.showItem(t)}getGui(){return this.tabbedLayout&&this.tabbedLayout.getGui()}showMenu(e,t){var i;this.eventSource=e,t||null==(i=this.tabbedLayout)||i.focusHeader(!0)}destroy(){this.parentComponent&&this.parentComponent.isAlive()&&this.destroyBean(this.parentComponent),super.destroy()}createPanel(t){const{chartController:i,chartOptionsService:n}=this.chartMenuContext;switch(t){case e.TAB_DATA:return new ws(i,n);case e.TAB_FORMAT:return new yr(this.chartMenuContext);default:return new vo(i)}}};bo.EVENT_CLOSED="closed",bo.TAB_DATA="data",bo.TAB_FORMAT="format",fn([(0,mt.Autowired)("chartTranslationService")],bo.prototype,"chartTranslationService",2),fn([(0,mt.Autowired)("chartMenuService")],bo.prototype,"chartMenuService",2),fn([mt.PostConstruct],bo.prototype,"init",1);var Co=bo,wo=class extends Gi.Component{constructor(){super('<div class="ag-chart-menu" ref="eMenu"></div>'),this.buttonListenersDestroyFuncs=[]}updateParams(e){const{buttons:t}=e;this.createButtons(t)}createButtons(e){this.buttonListenersDestroyFuncs.forEach(e=>null==e?void 0:e()),this.buttonListenersDestroyFuncs=[];const t=this.eMenu;Gi._.clearElement(t),e.forEach(e=>{const{buttonName:i,iconName:n,callback:s}=e,r=this.createButton(n),o=this.chartTranslationService.translate(i+"ToolbarTooltip");o&&r instanceof HTMLElement&&(r.title=o),this.buttonListenersDestroyFuncs.push(this.addManagedListener(r,"click",e=>s(e.target))),t.appendChild(r)})}createButton(e){let t=Gi._.createIconNoSpan(e,this.gos,void 0,!0);return t.classList.add("ag-chart-menu-icon"),this.chartMenuService.isLegacyFormat()||(t=this.wrapButton(t)),t}wrapButton(e){const t=this.gos.getDocument().createElement("button");return t.appendChild(e),t.classList.add("ag-chart-menu-toolbar-button"),t}destroy(){this.buttonListenersDestroyFuncs=[],super.destroy()}};fn([(0,Gi.Autowired)("chartTranslationService")],wo.prototype,"chartTranslationService",2),fn([(0,Gi.Autowired)("chartMenuService")],wo.prototype,"chartMenuService",2),fn([(0,Gi.RefSelector)("eMenu")],wo.prototype,"eMenu",2);var So=class e extends ft.Component{constructor(t,i,n){super(e.TEMPLATE),this.eChartContainer=t,this.eMenuPanelContainer=i,this.chartMenuContext=n,this.buttons={chartSettings:{iconName:"menu",callback:()=>this.showMenu({panel:this.defaultPanel})},chartData:{iconName:"menu",callback:()=>this.showMenu({panel:"chartData"})},chartFormat:{iconName:"menu",callback:()=>this.showMenu({panel:"chartFormat"})},chartLink:{iconName:"linked",callback:()=>this.chartMenuService.toggleLinked(this.chartMenuContext)},chartUnlink:{iconName:"unlinked",callback:()=>this.chartMenuService.toggleLinked(this.chartMenuContext)},chartDownload:{iconName:"save",callback:()=>this.chartMenuService.downloadChart(this.chartMenuContext)},chartMenu:{iconName:"menuAlt",callback:e=>this.showMenuList(e)}},this.panels=[],this.menuVisible=!1,this.chartController=n.chartController}postConstruct(){this.legacyFormat=this.chartMenuService.isLegacyFormat(),this.chartToolbar=this.createManagedBean(new wo),this.getGui().appendChild(this.chartToolbar.getGui()),this.legacyFormat&&this.createLegacyToggleButton(),this.refreshToolbarAndPanels(),this.addManagedListener(this.eventService,ft.Events.EVENT_CHART_CREATED,e=>{var t;e.chartId===this.chartController.getChartId()&&Boolean(null==(t=this.gos.get("chartToolPanelsDef"))?void 0:t.defaultToolPanel)&&this.showMenu({panel:this.defaultPanel,animate:!1,suppressFocus:!0})}),this.addManagedListener(this.chartController,rs.EVENT_CHART_LINKED_CHANGED,this.refreshToolbarAndPanels.bind(this)),this.refreshMenuClasses(),this.legacyFormat&&!this.gos.get("suppressChartToolPanelsButton")&&this.panels.length>0&&(this.getGui().classList.add("ag-chart-tool-panel-button-enable"),this.eHideButton&&this.addManagedListener(this.eHideButton,"click",this.toggleMenu.bind(this))),this.legacyFormat||this.getGui().classList.add("ag-chart-menu-wrapper"),this.addManagedListener(this.chartController,rs.EVENT_CHART_API_UPDATE,this.refreshToolbarAndPanels.bind(this))}isVisible(){return this.menuVisible}getExtraPaddingDirections(){const e=[];return["chartMenu","chartLink","chartUnlink","chartDownload"].some(e=>this.chartToolbarOptions.includes(e))&&e.push("top"),["chartSettings","chartData","chartFormat"].some(e=>this.chartToolbarOptions.includes(e))&&e.push(this.gos.get("enableRtl")?"left":"right"),e}createLegacyToggleButton(){const e=this.gos.getDocument();this.eHideButton=e.createElement("button"),this.eHideButton.classList.add("ag-button","ag-chart-menu-close"),this.eHideButtonIcon=e.createElement("span"),this.eHideButtonIcon.classList.add("ag-icon","ag-icon-contracted"),this.eHideButton.appendChild(this.eHideButtonIcon),this.getGui().appendChild(this.eHideButton)}refreshToolbarAndPanels(){this.initToolbarOptionsAndPanels(),this.updateToolbar()}initToolbarOptionsAndPanels(){const{panels:e,defaultPanel:t,chartToolbarOptions:i}=this.chartMenuService.getToolbarOptionsAndPanels(this.chartController);this.panels=e,this.defaultPanel=t,this.chartToolbarOptions=i}updateToolbar(){const e=this.chartToolbarOptions.map(e=>{const{iconName:t,callback:i}=this.buttons[e];return{buttonName:e,iconName:t,callback:i}});this.chartToolbar.updateParams({buttons:e})}createMenuPanel(e){const t=this.environment.chartMenuPanelWidth(),i=this.menuPanel=this.createBean(new ft.AgPanel({minWidth:t,width:t,height:"100%",closable:!0,hideTitleBar:!0,cssIdentifier:"chart-menu"}));return i.setParentComponent(this),this.eMenuPanelContainer.appendChild(i.getGui()),this.tabbedMenu=this.createBean(new Co(this.panels,this.chartMenuContext)),this.addManagedListener(this.tabbedMenu,Co.EVENT_CLOSED,()=>{this.hideMenu(!1)}),this.addManagedListener(i,ft.Component.EVENT_DESTROYED,()=>this.destroyBean(this.tabbedMenu)),new ft.AgPromise(t=>{window.setTimeout(()=>{i.setBodyComponent(this.tabbedMenu),this.tabbedMenu.showTab(e),t(i),this.legacyFormat&&this.addManagedListener(this.eChartContainer,"click",e=>{this.getGui().contains(e.target)||this.menuVisible&&this.hideMenu()})},100)})}showContainer(e,t){this.menuPanel&&(this.menuVisible=!0,this.showParent(this.menuPanel.getWidth()),this.refreshMenuClasses(),this.tabbedMenu.showMenu(e,t))}toggleMenu(){this.menuVisible?this.hideMenu(this.legacyFormat):this.showMenu({animate:this.legacyFormat})}showMenu(e){const{panel:t,animate:i=!0,eventSource:n,suppressFocus:s}=e;if(i||this.eMenuPanelContainer.classList.add("ag-no-transition"),this.menuPanel&&!t)this.showContainer(n,s);else{const e=t||this.defaultPanel;let i=this.panels.indexOf(e);i<0&&(console.warn(`AG Grid: '${t}' is not a valid Chart Tool Panel name`),i=this.panels.indexOf(this.defaultPanel)),this.menuPanel?(this.tabbedMenu.showTab(i),this.showContainer(n,s)):this.createMenuPanel(i).then(()=>this.showContainer(n,s))}i||setTimeout(()=>{this.isAlive()&&this.eMenuPanelContainer.classList.remove("ag-no-transition")},500)}hideMenu(e=!0){e||this.eMenuPanelContainer.classList.add("ag-no-transition"),this.hideParent(),window.setTimeout(()=>{this.menuVisible=!1,this.refreshMenuClasses(),e||this.eMenuPanelContainer.classList.remove("ag-no-transition")},500)}refreshMenuClasses(){this.eChartContainer.classList.toggle("ag-chart-menu-visible",this.menuVisible),this.eChartContainer.classList.toggle("ag-chart-menu-hidden",!this.menuVisible),this.legacyFormat&&!this.gos.get("suppressChartToolPanelsButton")&&(this.eHideButtonIcon.classList.toggle("ag-icon-contracted",this.menuVisible),this.eHideButtonIcon.classList.toggle("ag-icon-expanded",!this.menuVisible))}showParent(e){this.eMenuPanelContainer.style.minWidth=`${e}px`}hideParent(){this.eMenuPanelContainer.style.minWidth="0"}showMenuList(e){this.chartMenuListFactory.showMenuList({eventSource:e,showMenu:()=>this.showMenu({animate:!1,eventSource:e}),chartMenuContext:this.chartMenuContext})}destroy(){super.destroy(),this.menuPanel&&this.menuPanel.isAlive()&&this.destroyBean(this.menuPanel),this.tabbedMenu&&this.tabbedMenu.isAlive()&&this.destroyBean(this.tabbedMenu)}};So.TEMPLATE="<div></div>",fn([(0,ft.Autowired)("chartMenuService")],So.prototype,"chartMenuService",2),fn([(0,ft.Autowired)("chartMenuListFactory")],So.prototype,"chartMenuListFactory",2),fn([ft.PostConstruct],So.prototype,"postConstruct",1);var xo=So,Eo=class e extends Bi.Component{constructor(t){super(e.TEMPLATE),this.chartMenu=t,this.destroyableChartListeners=[],this.editing=!1}init(){this.addManagedListener(this.getGui(),"keydown",e=>{this.editing&&"Enter"===e.key&&!e.shiftKey&&(this.handleEndEditing(),e.preventDefault())}),this.addManagedListener(this.getGui(),"input",()=>{this.editing&&this.updateHeight()}),this.addManagedListener(this.getGui(),"blur",()=>this.endEditing())}refreshTitle(e){this.chartController=e.chartController,this.chartOptionsService=e.chartOptionsService,this.chartMenuUtils=e.chartMenuParamsFactory.getChartOptions();for(const e of this.destroyableChartListeners)e();this.destroyableChartListeners=[];const t=this.chartController.getChartProxy().getChart(),i=t.canvasElement,n=this.addManagedListener(i,"dblclick",e=>{const{title:n}=t;if(n&&n.node.containsPoint(e.offsetX,e.offsetY)){const e=n.node.computeBBox(),t=n.node.inverseTransformPoint(e.x,e.y);this.startEditing(dn(dn({},e),t),i.width)}});let s=!1;const r=this.addManagedListener(i,"mousemove",e=>{const{title:n}=t,r=!!(n&&n.enabled&&n.node.containsPoint(e.offsetX,e.offsetY));s!==r&&(i.style.cursor=r?"pointer":""),s=r});this.destroyableChartListeners=[n,r]}startEditing(e,t){if(this.chartMenuService.isLegacyFormat()&&this.chartMenu&&this.chartMenu.isVisible())return;if(this.editing)return;this.editing=!0;const i=Math.max(Math.min(e.width+20,t),300),n=this.getGui();n.classList.add("currently-editing");const s=n.style;s.fontFamily=this.chartMenuUtils.getValue("title.fontFamily"),s.fontWeight=this.chartMenuUtils.getValue("title.fontWeight"),s.fontStyle=this.chartMenuUtils.getValue("title.fontStyle"),s.fontSize=this.chartMenuUtils.getValue("title.fontSize")+"px",s.color=this.chartMenuUtils.getValue("title.color");const r=this.chartMenuUtils.getValue("title.text"),o=r===this.chartTranslationService.translate("titlePlaceholder");n.value=o?"":r;const a=r.split(/\r?\n/g).length;s.left=Math.round(e.x+e.width/2-i/2-1)+"px",s.top=Math.round(e.y+e.height/2-a*this.getLineHeight()/2-2)+"px",s.width=Math.round(i)+"px",s.lineHeight=this.getLineHeight()+"px",this.updateHeight(),n.focus()}updateHeight(){const e=this.getGui(),t=this.chartMenuUtils.getValue("title.text").split(/\r?\n/g).length,i=e.value.split(/\r?\n/g).length;e.style.height=Math.round(Math.max(t,i)*this.getLineHeight())+4+"px"}getLineHeight(){const e=this.chartMenuUtils.getValue("title.lineHeight");return e?parseInt(e):Math.round(1.2*parseInt(this.chartMenuUtils.getValue("title.fontSize")))}handleEndEditing(){const e=this.chartMenuUtils.getValue("title.color");this.chartMenuUtils.setValue("title.color","rgba(0, 0, 0, 0)"),this.chartOptionsService.awaitChartOptionUpdate(()=>this.endEditing()),this.chartOptionsService.awaitChartOptionUpdate(()=>{this.chartMenuUtils.setValue("title.color",e)})}endEditing(){if(!this.editing)return;this.editing=!1;const e=this.getGui().value;e&&""!==e.trim()?(this.chartMenuUtils.setValue("title.text",e),this.chartMenuUtils.setValue("title.enabled",!0)):(this.chartMenuUtils.setValue("title.text",""),this.chartMenuUtils.setValue("title.enabled",!1)),this.getGui().classList.remove("currently-editing"),this.chartOptionsService.awaitChartOptionUpdate(()=>{this.eventService.dispatchEvent({type:"chartTitleEdit"})})}};Eo.TEMPLATE='<textarea\n             class="ag-chart-title-edit"\n             style="padding:0; border:none; border-radius: 0; min-height: 0; text-align: center; resize: none;" />\n        ',fn([(0,Bi.Autowired)("chartTranslationService")],Eo.prototype,"chartTranslationService",2),fn([(0,Bi.Autowired)("chartMenuService")],Eo.prototype,"chartMenuService",2),fn([Bi.PostConstruct],Eo.prototype,"init",1);var Ao=Eo;function Mo(e){return null!=e.chart?e.chart:e}var To=class{constructor(e){this.chartProxyParams=e,this.clearThemeOverrides=!1,this.isEnterpriseCharts=Hi._ModuleSupport.enterpriseModule.isEnterprise,this.chart=e.chartInstance,this.chartType=e.chartType,this.crossFiltering=e.crossFiltering,this.crossFilterCallback=e.crossFilterCallback,this.standaloneChartType=Rn(this.chartType),null==this.chart?this.chart=Hi.AgCharts.create(this.getCommonChartOptions()):this.clearThemeOverrides=!0}crossFilteringReset(){}update(e){Hi.AgCharts.update(this.getChartRef(),this.getUpdateOptions(e,this.getCommonChartOptions(e.updatedOverrides)))}updateThemeOverrides(e){Hi.AgCharts.updateDelta(this.getChartRef(),{theme:{overrides:e}})}getChart(){return Mo(this.chart)}getChartRef(){return this.chart}downloadChart(e,t,i){const{chart:n}=this,s=Mo(n),r=t||(s.title?s.title.text:"chart"),{width:o,height:a}=e||{};Hi.AgCharts.download(n,{width:o,height:a,fileName:r,fileFormat:i})}getChartImageDataURL(e){return this.getChart().getCanvasDataURL(e)}getChartOptions(){return this.chart.getOptions()}getChartThemeOverrides(){var e;return null!=(e=this.getChartOptions().theme.overrides)?e:{}}getChartPalette(){return Hi._Theme.getChartTheme(this.getChartOptions().theme).palette}setPaired(e){const t=Rn(this.chartProxyParams.chartType);Hi.AgCharts.updateDelta(this.chart,{theme:{overrides:{[t]:{paired:e}}}})}isPaired(){const e=Rn(this.chartProxyParams.chartType);return Wn(this.getChartThemeOverrides(),`${e}.paired`,!0)}lookupCustomChartTheme(e){return Yn(this.chartProxyParams,e)}getSeriesGroupType(){}transformCategoryData(e,t){return e.map((e,i)=>{const n=e[t],s=n&&n.toString?n.toString():"",r=dn({},e);return r[t]={id:i,value:n,toString:()=>s},r})}getCommonChartOptions(e){var t,i;const n=this.clearThemeOverrides?{}:null!=(i=null==(t=this.chart)?void 0:t.getOptions())?i:{},s=null!=this.chart?this.getActiveFormattingPanelOverrides():void 0;this.clearThemeOverrides=!1;const r=function(e,t,i,n,s){var r;const{chartOptionsToRestore:o,chartPaletteToRestore:a,chartThemeToRestore:l}=e,c=function(e){let t=e.getChartThemeName();const i=e.getChartThemes();return At._.includes(i,t)||(t=i[0]),t}(e),h=jn(c),u=h?{baseTheme:c}:null!=(r=Yn(e,c))?r:{},d=e.getGridOptionsChartThemeOverrides(),p=e.apiChartThemeOverrides,g=Rn(e.chartType),f=e.crossFiltering?function(e,t,i){const n={listeners:{legendItemClick:t=>{e.getChart().series.forEach(e=>{e.toggleSeriesItem(t.itemId,t.enabled),e.toggleSeriesItem(`${t.itemId}-filtered-out`,t.enabled)})}}};return{[i]:{tooltip:{delay:500},legend:n,listeners:{click:e=>t.crossFilterCallback(e,!0)}}}}(t,e,g):void 0,m=[h?Kn(e,i,(()=>{const e=e=>!!e&&Object.keys(e).some(t=>Wn(e[t],"title.enabled",!1));return e(d)||e(p)})()):void 0,n,f,d,p,dn({},null!=o?o:{}),s].filter(e=>!!e).reduce((e,t)=>({baseTheme:e,overrides:t}),u);return a&&c===l&&(function(e,t){const i=(e,t)=>e.length===t.length&&e.every((e,i)=>e===t[i]);return i(e.fills,t.fills)&&i(e.strokes,t.strokes)}(a,Mt._Theme.getChartTheme(u).palette)||(m.palette=a)),m}(this.chartProxyParams,this,this.isEnterpriseCharts,this.getChartThemeDefaults(),null!=e?e:s),o=pn(dn({},n),{mode:"integrated"});return o.theme=r,o.container=this.chartProxyParams.parentElement,o}getChartThemeDefaults(){const e=this.getSeriesChartThemeDefaults(),t=e?{[this.standaloneChartType]:e}:{},i={enabled:!0,snap:!0,label:{enabled:!1}};return dn({common:{navigator:{enabled:!1},zoom:{enabled:!0},animation:{enabled:!0,duration:500},axes:{number:{crosshair:i},category:{crosshair:i},log:{crosshair:i},time:{crosshair:i}}}},t)}getSeriesChartThemeDefaults(){}getActiveFormattingPanelOverrides(){var e,t;if(this.clearThemeOverrides)return{};const i=null==(e=this.chart)?void 0:e.getOptions().theme;return null!=(t=null==i?void 0:i.overrides)?t:{}}destroy({keepChartInstance:e=!1}={}){if(e)return this.chart.resetAnimations(),this.chart;this.destroyChart()}destroyChart(){this.chart&&(this.chart.destroy(),this.chart=void 0)}},Do=class extends To{constructor(e){super(e),this.crossFilteringAllPoints=new Set,this.crossFilteringSelectedPoints=[]}getUpdateOptions(e,t){const i=this.getAxes(e,t);return pn(dn({},t),{data:this.getData(e,i),axes:i,series:this.getSeries(e)})}getData(e,t){const i=["area","line"].includes(this.standaloneChartType);return this.crossFiltering&&i?this.getCrossFilterData(e):this.getDataTransformedData(e,t)}getDataTransformedData(e,t){const i=t[0].type,{categories:n,data:s}=e,[r]=n;switch(i){case"category":return this.transformCategoryData(s,r.id);case"time":return this.transformTimeData(s,r.id);default:return s}}getXAxisType(e){return e.grouping?"grouped-category":this.isXAxisOfType(e,"time",e=>e instanceof Date)?"time":this.isXAxisOfType(e,"number")?"number":"category"}isXAxisOfType(e,t,i){const[n]=e.categories;if(null==n?void 0:n.chartDataType)return n.chartDataType===t;if(!i)return!1;const s=e.data[0];return!!s&&i(s[n.id])}transformTimeData(e,t){var i;return(null==(i=e[0])?void 0:i[t])instanceof Date?e:e.map(e=>{const i=e[t];return"string"==typeof i?pn(dn({},e),{[t]:new Date(i)}):e})}crossFilteringReset(){this.crossFilteringSelectedPoints=[],this.crossFilteringAllPoints.clear()}crossFilteringPointSelected(e){return 0==this.crossFilteringSelectedPoints.length||this.crossFilteringSelectedPoints.includes(e)}crossFilteringDeselectedPoints(){return this.crossFilteringSelectedPoints.length>0&&this.crossFilteringAllPoints.size!==this.crossFilteringSelectedPoints.length}extractLineAreaCrossFilterSeries(e,t){const[i]=t.categories,n=e=>"area"===this.standaloneChartType?t.getCrossFilteringContext().lastSelectedChartId===t.chartId?e+"-total":e:e+"-total";return e.map(e=>(e.yKey=n(e.yKey),e.listeners={nodeClick:t=>{const i=t.datum[e.xKey],n=t.event.metaKey||t.event.ctrlKey;this.crossFilteringAddSelectedPoint(n,i),this.crossFilterCallback(t)}},e.marker={formatter:e=>{const t=e.datum[i.id];return{fill:e.highlighted?"yellow":e.fill,size:e.highlighted?14:this.crossFilteringPointSelected(t)?8:0}}},"area"===this.standaloneChartType&&(e.fillOpacity=this.crossFilteringDeselectedPoints()?.3:1),"line"===this.standaloneChartType&&(e.strokeOpacity=this.crossFilteringDeselectedPoints()?.3:1),e))}getCrossFilterData(e){this.crossFilteringAllPoints.clear();const[t]=e.categories,i=e.fields[0].colId,n=`${i}-filtered-out`,s=e.getCrossFilteringContext().lastSelectedChartId;return e.data.map(r=>{const o=r[t.id];this.crossFilteringAllPoints.add(o);const a=this.crossFilteringPointSelected(o);return"area"===this.standaloneChartType&&s===e.chartId&&(r[`${i}-total`]=a?r[i]:r[i]+r[n]),"line"===this.standaloneChartType&&(r[`${i}-total`]=a?r[i]:r[i]+r[n]),r})}crossFilteringAddSelectedPoint(e,t){e?this.crossFilteringSelectedPoints.push(t):this.crossFilteringSelectedPoints=[t]}isHorizontal(e){const t=this.standaloneChartType;if("waterfall"!==t&&"box-plot"!==t&&"range-bar"!==t)return!1;const i=e.theme,n=e=>{var i,s,r;const o=null==(r=null==(s=null==(i=null==e?void 0:e.overrides)?void 0:i[t])?void 0:s.series)?void 0:r.direction;return null!=o?"horizontal"===o:"object"==typeof(null==e?void 0:e.baseTheme)&&n(e.baseTheme)};return n(i)}};function Io(e,t){const i=parseInt(e.slice(1,3),16),n=parseInt(e.slice(3,5),16),s=parseInt(e.slice(5,7),16);return t?`rgba(${i}, ${n}, ${s}, ${t})`:`rgba(${i}, ${n}, ${s})`}function Ro(e,t){return e.map(e=>{const i=Ui._Util.Color.fromString(e);return new Ui._Util.Color(i.r,i.g,i.b,t).toHexString()})}var ko=new Set(["bar","groupedBar","stackedBar","normalizedBar"]),Po=class extends Do{constructor(e){super(e)}getAxes(e){const t=[{type:this.getXAxisType(e),position:this.isHorizontal()?"left":"bottom"},{type:"number",position:this.isHorizontal()?"bottom":"left"}];if(this.isNormalised()){const e=t[1];e.label=pn(dn({},e.label),{formatter:e=>Math.round(e.value)+"%"})}return t}getSeries(e){const[t]=e.categories,i=e.fields.map(e=>{return{type:this.standaloneChartType,direction:this.isHorizontal()?"horizontal":"vertical",stacked:this.crossFiltering||(i=this.chartType,En.has(i)),normalizedTo:this.isNormalised()?100:void 0,xKey:t.id,xName:t.name,yKey:e.colId,yName:e.displayName};var i});return this.crossFiltering?this.extractCrossFilterSeries(i):i}extractCrossFilterSeries(e){const t=this.getChartPalette(),i=(e,i)=>pn(dn({},e),{highlightStyle:{item:{fill:void 0}},fill:null==t?void 0:t.fills[i],stroke:null==t?void 0:t.strokes[i],listeners:{nodeClick:this.crossFilterCallback}}),n=e=>{const t=e.yKey+"-filtered-out";return pn(dn({},zn({},e)),{yKey:t,fill:Io(e.fill,"0.3"),stroke:Io(e.stroke,"0.3"),showInLegend:!1})},s=[];for(let t=0;t<e.length;t++){const r=i(e[t],t);s.push(r),s.push(n(r))}return s}isNormalised(){return!this.crossFiltering&&Vi._.includes(["normalizedColumn","normalizedBar"],this.chartType)}isHorizontal(){return ko.has(this.chartType)}},_o=class extends Do{constructor(e){super(e)}getAxes(e){const t=[{type:this.getXAxisType(e),position:"bottom"},{type:"number",position:"left"}];if(this.isNormalised()){const e=t[1];e.label=pn(dn({},e.label),{formatter:e=>Math.round(e.value)+"%"})}return t}getSeries(e){const[t]=e.categories,i=e.fields.map(e=>({type:this.standaloneChartType,xKey:t.id,xName:t.name,yKey:e.colId,yName:e.displayName,normalizedTo:"normalizedArea"===this.chartType?100:void 0,stacked:["normalizedArea","stackedArea"].includes(this.chartType)}));return this.crossFiltering?this.extractLineAreaCrossFilterSeries(i,e):i}isNormalised(){return!this.crossFiltering&&"normalizedArea"===this.chartType}},Lo=class extends Do{constructor(e){super(e)}getAxes(e){return[{type:this.getXAxisType(e),position:"bottom"},{type:"number",position:"left"}]}getSeries(e){const[t]=e.categories,i=e.fields.map(e=>({type:this.standaloneChartType,xKey:t.id,xName:t.name,yKey:e.colId,yName:e.displayName}));return this.crossFiltering?this.extractLineAreaCrossFilterSeries(i,e):i}},No=class extends To{constructor(e){super(e)}getAxes(e){const t="radial-bar"===this.standaloneChartType;return[{type:t?"angle-number":"angle-category"},{type:t?"radius-category":"radius-number"}]}getSeries(e){const{fields:t,categories:i,seriesGroupType:n}=e,[s]=i,r="radial-bar"===this.standaloneChartType,o=this.getSeriesGroupTypeOptions(n);return t.map(e=>{var t,i;return dn({type:this.standaloneChartType,angleKey:r?e.colId:s.id,angleName:r?null!=(t=e.displayName)?t:void 0:s.name,radiusKey:r?s.id:e.colId,radiusName:r?s.name:null!=(i=e.displayName)?i:void 0},o)})}getSeriesGroupType(){var e,t;const i=this.standaloneChartType;if(!["nightingale","radial-bar","radial-column"].includes(i))return;const n=null==(t=null==(e=this.getChart().series)?void 0:e[0])?void 0:t.properties.toJson(),s=()=>n.normalizedTo?"normalized":"stacked";return"nightingale"===i?n.grouped?"grouped":s():n.stacked?s():"grouped"}getUpdateOptions(e,t){const i=this.getAxes(e);return pn(dn({},t),{data:this.getData(e,i),axes:i,series:this.getSeries(e)})}getData(e,t){if(t.some(e=>"angle-category"===e.type||"radius-category"===e.type)){const[t]=e.categories;return this.transformCategoryData(e.data,t.id)}return e.data}getSeriesGroupTypeOptions(e){return e?{grouped:"grouped"===e||void 0,stacked:"grouped"!==e||void 0,normalizedTo:"normalized"===e?100:void 0}:{}}},Oo=class e extends To{constructor(e){super(e)}getUpdateOptions(e,t){return pn(dn({},t),{data:this.crossFiltering?this.getCrossFilterData(e):e.data,series:this.getSeries(e)})}getSeries(t){const[i]=t.categories,n=t.fields.length,s={currentOffset:0,offsetAmount:n>1?20:40},r=this.getFields(t).map(t=>{var r;const o={type:this.standaloneChartType,angleKey:t.colId,angleName:t.displayName,sectorLabelKey:t.colId,calloutLabelName:i.name,calloutLabelKey:i.id};if("donut"===this.chartType||"doughnut"===this.chartType){const{outerRadiusOffset:i,innerRadiusOffset:a}=e.calculateOffsets(s),l=t.displayName?{title:{text:t.displayName,showInLegend:n>1}}:void 0;return pn(dn(pn(dn({},o),{type:"donut",outerRadiusOffset:i,innerRadiusOffset:a}),l),{calloutLine:{colors:null==(r=this.getChartPalette())?void 0:r.strokes}})}return o});return this.crossFiltering?this.extractCrossFilterSeries(r):r}getCrossFilterData(e){const t=e.fields[0].colId,i=`${t}-filtered-out`;return e.data.map(e=>{const n=e[t]+e[i];return e[`${t}-total`]=n,e[i]=1,e[t]=e[t]/n,e})}extractCrossFilterSeries(e){const t=this.getChartPalette(),i=e[0],n=i.angleKey,s=(e=>pn(dn({},e),{legendItemKey:e.calloutLabelKey,calloutLabel:{enabled:!1},highlightStyle:{item:{fill:void 0}},radiusKey:e.angleKey,angleKey:e.angleKey+"-total",radiusMin:0,radiusMax:1,listeners:{nodeClick:this.crossFilterCallback}}))(i);return[(r=i,o=n,pn(dn({},zn({},s)),{radiusKey:o+"-filtered-out",fills:Ro(null!=(a=r.fills)?a:t.fills,.3),strokes:Ro(null!=(l=r.strokes)?l:t.strokes,.3),showInLegend:!1})),s];var r,o,a,l}static calculateOffsets(e){const t=e.currentOffset;e.currentOffset-=e.offsetAmount;const i=e.currentOffset;return e.currentOffset-=e.offsetAmount,{outerRadiusOffset:t,innerRadiusOffset:i}}getFields(e){return"pie"===this.chartType?e.fields.slice(0,1):e.fields}},Fo=class extends Do{constructor(e){super(e)}getAxes(e){return[{type:"number",position:"bottom"},{type:"number",position:"left"}]}getSeries(e){const[t]=e.categories,i=this.isPaired(),n=this.getSeriesDefinitions(e.fields,i),s=t.id===On.DEFAULT_CATEGORY?void 0:t,r=n.map(e=>{var t,i,n,r,o;return(null==e?void 0:e.sizeField)?{type:"bubble",xKey:e.xField.colId,xName:null!=(t=e.xField.displayName)?t:void 0,yKey:e.yField.colId,yName:null!=(i=e.yField.displayName)?i:void 0,title:`${e.yField.displayName} vs ${e.xField.displayName}`,sizeKey:e.sizeField.colId,sizeName:null!=(n=e.sizeField.displayName)?n:"",labelKey:s?s.id:e.yField.colId,labelName:s?s.name:void 0}:{type:"scatter",xKey:e.xField.colId,xName:null!=(r=e.xField.displayName)?r:void 0,yKey:e.yField.colId,yName:null!=(o=e.yField.displayName)?o:void 0,title:`${e.yField.displayName} vs ${e.xField.displayName}`,labelKey:s?s.id:e.yField.colId,labelName:s?s.name:void 0}});return this.crossFiltering?this.extractCrossFilterSeries(r,e):r}extractCrossFilterSeries(e,t){const{data:i}=t,n=this.getChartPalette(),s=e=>`${e}-filtered-out`,r=e.map((e,t)=>{const r=null==n?void 0:n.fills[t],o=null==n?void 0:n.strokes[t];let a;if("bubble"===e.type){const{sizeKey:t}=e;a=((e,t)=>{var i;const n=[1/0,-1/0];if(null!=t)for(const r of e){const e=null!=(i=r[t])?i:r[s(t)];e<n[0]&&(n[0]=e),e>n[1]&&(n[1]=e)}if(n[0]<=n[1])return n})(i,t)}const l=pn(dn({},e.marker),{fill:r,stroke:o,domain:a});return pn(dn({},e),{marker:l,highlightStyle:{item:{fill:"yellow"}},listeners:pn(dn({},e.listeners),{nodeClick:this.crossFilterCallback})})});return[...r,...r.map(e=>{let{yKey:t,xKey:i}=e,n={};return"bubble"===e.type&&(n={sizeKey:s(e.sizeKey)}),pn(dn(dn({},e),n),{yKey:s(t),xKey:s(i),marker:pn(dn({},e.marker),{fillOpacity:.3,strokeOpacity:.3}),showInLegend:!1,listeners:pn(dn({},e.listeners),{nodeClick:e=>{const t=e.datum[s(i)],n=pn(dn({},e),{xKey:i,datum:pn(dn({},e.datum),{[i]:t})});this.crossFilterCallback(n)}})})})]}getSeriesDefinitions(e,t){if(e.length<2)return[];const i="bubble"===this.chartType;if(t)return i?e.map((t,i)=>i%3==0?{xField:t,yField:e[i+1],sizeField:e[i+2]}:null).filter(e=>e&&e.yField&&e.sizeField):e.map((t,i)=>i%2==0?{xField:t,yField:e[i+1]}:null).filter(e=>e&&e.yField);const n=e[0];return i?e.map((t,i)=>i%2==1?{xField:n,yField:t,sizeField:e[i+1]}:null).filter(e=>e&&e.sizeField):e.filter((e,t)=>t>0).map(e=>({xField:n,yField:e}))}},Go=class extends Do{constructor(e){super(e)}getAxes(e,t){return[{type:this.getXAxisType(e),position:this.isHorizontal(t)?"left":"bottom"},{type:"number",position:this.isHorizontal(t)?"bottom":"left"}]}computeSeriesStatistics(e,t){const{data:i,fields:n}=e,[s]=e.categories,r=s.id||On.DEFAULT_CATEGORY,o=this.groupDataByCategory(r,i);return Array.from(o).map(([e,i])=>{const r={[s.id]:e};return n.forEach((e,n)=>{const s=i.map(t=>t[e.colId]).filter(e=>"number"==typeof e&&!isNaN(e));Object.entries(t(s)).forEach(([e,t])=>{r[`${e}:${n}`]=s.length>0?t:null})}),r})}groupDataByCategory(e,t){return t.reduce((t,i)=>{let n=(t=>{if(e===On.DEFAULT_CATEGORY)return 1;const i=t[e];return null==i?"":i instanceof Date?i.getTime():i})(i);const s=t.get(n);return s?s.push(i):t.set(n,[i]),t},new Map)}},Bo=class extends Go{constructor(e){super(e)}getSeries(e){const[t]=e.categories;return e.fields.map((e,i)=>{var n;return{type:this.standaloneChartType,xKey:t.id,xName:t.name,yName:null!=(n=e.displayName)?n:void 0,yLowName:"Min",yHighName:"Max",yLowKey:`min:${i}`,yHighKey:`max:${i}`}})}getData(e){return this.computeSeriesStatistics(e,e=>({min:Math.min(...e),max:Math.max(...e)}))}},Vo=class extends Do{constructor(e){super(e)}getSeries(e){const t=e.fields[0];return[{type:this.standaloneChartType,xKey:t.colId,xName:t.displayName,yName:this.chartProxyParams.translate("histogramFrequency"),areaPlot:!1}]}getAxes(e){return[{type:"number",position:"bottom"},{type:"number",position:"left"}]}},Ho=class extends Go{constructor(e){super(e)}getSeries(e){const[t]=e.categories;return e.fields.map((e,i)=>{var n;return{type:this.standaloneChartType,xKey:t.id,xName:t.name,yName:null!=(n=e.displayName)?n:void 0,minName:"Min",q1Name:"Q1",medianName:"Median",q3Name:"Q3",maxName:"Max",minKey:`min:${i}`,q1Key:`q1:${i}`,medianKey:`median:${i}`,q3Key:`q3:${i}`,maxKey:`max:${i}`}})}getData(e){return this.computeSeriesStatistics(e,e=>{const t=e.sort((e,t)=>e-t);return{min:t[0],q1:this.quantile(t,.25),median:this.quantile(t,.5),q3:this.quantile(t,.75),max:t[t.length-1]}})}quantile(e,t){const i=(e.length-1)*t,n=Math.floor(i),s=i-n;return void 0!==e[n+1]?e[n]+s*(e[n+1]-e[n]):e[n]}},Uo=class extends To{constructor(e){super(e)}getUpdateOptions(e,t){const i="AG-GRID-DEFAULT-HEATMAP-SERIES-KEY",n="AG-GRID-DEFAULT-HEATMAP-VALUE-KEY",s="AG-GRID-DEFAULT-HEATMAP-CATEGORY-KEY";return pn(dn({},t),{series:this.getSeries(e,i,n,s),data:this.getData(e,i,n,s)})}getSeries(e,t,i,n){const[s]=e.categories;return[{type:this.standaloneChartType,yKey:n,xKey:t,colorKey:i,yName:s.name,xName:void 0,colorName:void 0}]}getData(e,t,i,n){const[s]=e.categories;return r=e.data,o=(r,o)=>{const a=r[s.id],l=null==a?"":String(a),c={id:o,value:a,toString:()=>l};return e.fields.map(({colId:e,displayName:s})=>pn(dn({},r),{[t]:s,[i]:r[e],[n]:c}))},r.reduce((e,t,i,n)=>e.concat(o(t,i)),new Array);var r,o}getSeriesChartThemeDefaults(){return{gradientLegend:{gradient:{preferredLength:200}},series:{tooltip:{renderer:zo}}}}};function zo(e){const{xKey:t,yKey:i,colorKey:n,yName:s,datum:r}=e;return{title:"",content:[{label:s,value:r[i]},{label:r[t],value:n&&r[n]}].map(({label:e,value:t})=>`<b>${Wo(String(e))}:</b> ${Wo(String(t))}`).join("<br>")}}function Wo(e){const t={"&":"&amp;","<":"&lt;",">":"&gt;"},i=`[${Object.keys(t).join("")}]`,n=new RegExp(i,"g");return e.replace(n,e=>t[e])}var jo=class extends Do{constructor(e){super(e)}getAxes(e,t){return[{type:this.getXAxisType(e),position:this.isHorizontal(t)?"left":"bottom"},{type:"number",position:this.isHorizontal(t)?"bottom":"left"}]}getSeries(e){var t;const[i]=e.categories,[n]=e.fields;return[{type:this.standaloneChartType,xKey:i.id,xName:i.name,yKey:n.colId,yName:null!=(t=n.displayName)?t:void 0}]}},$o=["number","category","time","grouped-category"],Ko=[...$o,"angle-category","angle-number","radius-category","radius-number"],Yo=class e extends zi.BeanStub{constructor(e){super(),this.chartController=e}getChartThemeOverridesProxy(){return{getValue:e=>this.getChartOption(e),setValue:(e,t)=>this.setChartThemeOverrides([{expression:e,value:t}]),setValues:e=>this.setChartThemeOverrides(e)}}getAxisThemeOverridesProxy(){return{getValue:e=>this.getAxisProperty(e),setValue:(e,t)=>this.setAxisThemeOverrides([{expression:e,value:t}]),setValues:e=>this.setAxisThemeOverrides(e)}}getCartesianAxisOptionsProxy(e){return{getValue:t=>this.getCartesianAxisProperty(e,t),setValue:(t,i)=>this.setCartesianAxisOptions(e,[{expression:t,value:i}]),setValues:t=>this.setCartesianAxisOptions(e,t)}}getCartesianAxisThemeOverridesProxy(e){return{getValue:t=>this.getCartesianAxisProperty(e,t),setValue:(t,i)=>this.setCartesianAxisThemeOverrides(e,[{expression:t,value:i}]),setValues:t=>this.setCartesianAxisThemeOverrides(e,t)}}getCartesianAxisAppliedThemeOverridesProxy(e){return{getValue:t=>this.getCartesianAxisThemeOverride(e,"*"===t?null:t),setValue:(t,i)=>this.setCartesianAxisThemeOverrides(e,[{expression:"*"===t?null:t,value:i}]),setValues:t=>this.setCartesianAxisThemeOverrides(e,t)}}getSeriesOptionsProxy(e){return{getValue:(t,i)=>this.getSeriesOption(e(),t,i),setValue:(t,i)=>this.setSeriesOptions(e(),[{expression:t,value:i}]),setValues:t=>this.setSeriesOptions(e(),t)}}getPersistedChartThemeOverrides(e,t,i,n){const s=this.getRetainedChartThemeOverrideKeys(i,n),r=this.getRetainedChartAxisThemeOverrideKeys(null,i,n),o=this.createChartOptions();for(const t of s){const s=this.retrieveChartOptionsThemeOverride(e,i,t);void 0!==s&&this.assignChartOptionsThemeOverride(o,n,t,s)}return t&&this.assignPersistedAxisOverrides({existingAxes:t,retainedChartAxisThemeOverrideKeys:r,existingChartOptions:e,targetChartOptions:o,existingChartType:i,targetChartType:n}),o.theme.overrides}assignPersistedAxisOverrides(e){const{existingAxes:t,retainedChartAxisThemeOverrideKeys:i,existingChartOptions:n,targetChartOptions:s,existingChartType:r,targetChartType:o}=e;for(const{expression:e,targetAxisTypes:a}of i)for(const i of t.map(e=>e.type)){const t=this.retrieveChartOptionsThemeOverride(n,r,["axes",i,e].join("."));if(void 0!==t)for(const i of a)this.assignChartOptionsThemeOverride(s,o,["axes",i,e].join("."),t)}}getRetainedChartThemeOverrideKeys(e,t){const i=["zoom","navigator"];return["animation",...((e,t)=>{const n=new Array;return An(Rn(e))&&An(Rn(t))&&n.push(...i),n})(e,t)]}getRetainedChartAxisThemeOverrideKeys(e,t,i){return An(Rn(t))&&An(Rn(i))?this.getRetainedCartesianAxisThemeOverrideKeys(e).map(e=>({expression:e,targetAxisTypes:$o})):[]}getRetainedCartesianAxisThemeOverrideKeys(e){const t="xAxis"===e?["",".top",".bottom"]:"yAxis"===e?["",".left",".right"]:["",".left",".right",".top",".bottom"],i=["crosshair"],n=new Array;for(const e of i)for(const i of t)n.push(`${e}${i}`);return n}getChartOption(e){return Wn(this.getChart(),e,void 0)}setChartThemeOverrides(e){const t=this.getChartType(),i=this.createChartOptions();for(const{expression:n,value:s}of e)this.assignChartOptionsThemeOverride(i,t,n,s);this.applyChartOptions(i)}applyChartOptions(e,t){0!==Object.keys(e).length&&(this.updateChart(e),!(null==t?void 0:t.silent)&&this.raiseChartOptionsChangedEvent())}awaitChartOptionUpdate(e){this.chartController.getChartProxy().getChart().waitForUpdate().then(()=>e()).catch(e=>console.error("AG Grid - chart update failed",e))}getAxisProperty(e){var t;return Wn(null==(t=this.getChart().axes)?void 0:t[0],e,void 0)}setAxisThemeOverrides(e){var t;const i=this.getChart(),n=this.getChartType();let s=this.createChartOptions();for(const{expression:r,value:o}of e){const e=null==(t=i.axes)?void 0:t.filter(e=>{const t=r.split(".");let i=e;for(const e of t){if(!(e in i))return!1;i=i[e]}return!0});if(e)for(const t of e)this.isValidAxisType(t)&&this.assignChartAxisThemeOverride(s,n,t.type,null,r,o)}this.applyChartOptions(s)}getCartesianAxisProperty(e,t){const i=this.getChartAxes();return Wn(this.getCartesianAxis(i,e),t,void 0)}getCartesianAxisThemeOverride(e,t){const i=this.getChartAxes(),n=this.getCartesianAxis(i,e);if(!n||!this.isValidAxisType(n))return;const s=this.getChartType(),r=this.getChart().getOptions();return this.retrieveChartAxisThemeOverride(r,s,n.type,"yAxis"===e?["left","right"]:["bottom","top"],t)}setCartesianAxisThemeOverrides(e,t){const i=this.getChartAxes(),n=this.getCartesianAxis(i,e);if(!n||!this.isValidAxisType(n))return;const s=this.getChartType();let r=this.createChartOptions();for(const{expression:i,value:o}of t)this.assignChartAxisThemeOverride(r,s,n.type,"yAxis"===e?["left","right"]:["bottom","top"],i,o);this.applyChartOptions(r)}setCartesianAxisOptions(e,t){this.updateCartesianAxisOptions(e,(e,i,n)=>{const s=i.indexOf(n);for(const{expression:i,value:n}of t)this.assignChartOption(e,`axes.${s}.${i}`,n)})}updateCartesianAxisOptions(e,t){const i=this.getChart().getOptions(),n="axes"in i?i.axes:void 0;if(!i||!n)return;const s=this.getChartAxes(),r=this.getCartesianAxis(s,e);if(!r)return;let o=this.createChartOptions();o.axes=n,t(o,s,r,i),this.applyChartOptions(o)}setCartesianCategoryAxisType(e,t){this.updateCartesianAxisOptions(e,(i,n,s,r)=>{const o=this.getChartType();this.assignPersistedAxisOverrides({existingAxes:[s],retainedChartAxisThemeOverrideKeys:this.getRetainedChartAxisThemeOverrideKeys(e,o,o),existingChartOptions:r,targetChartOptions:i,existingChartType:o,targetChartType:o}),this.assignChartOption(i,"axes.0.type",t),this.chartController.setCategoryAxisType(t)})}getCartesianAxis(e,t){if(!(e.length<2))switch(t){case"xAxis":return"x"===e[0].direction?e[0]:e[1];case"yAxis":return"y"===e[1].direction?e[1]:e[0]}}getSeriesOption(t,i,n){const s=this.getChart().series.find(i=>e.isMatchingSeries(t,i));return Wn(n?s:null==s?void 0:s.properties.toJson(),i,void 0)}setSeriesOptions(e,t){let i=this.createChartOptions();for(const{expression:n,value:s}of t)this.assignChartOptionsSeriesThemeOverride(i,e,`series.${n}`,s);this.applyChartOptions(i)}getPairedMode(){return this.chartController.getChartProxy().isPaired()}setPairedMode(e){this.chartController.getChartProxy().setPaired(e)}getChartAxes(){var e;return null!=(e=this.getChart().axes)?e:[]}retrieveChartAxisThemeOverride(e,t,i,n,s){if(!n)return this.retrieveChartOptionsThemeOverride(e,t,["axes",i,...s?[s]:[]].join("."));for(const r of n){const n=this.retrieveChartOptionsThemeOverride(e,t,["axes",i,r,...s?[s]:[]].join("."));if(void 0!==n)return n}}assignChartAxisThemeOverride(e,t,i,n,s,r){if(n)for(const o of n)this.assignChartOptionsThemeOverride(e,t,["axes",i,o,...s?[s]:[]].join("."),r);else this.assignChartOptionsThemeOverride(e,t,["axes",i,...s?[s]:[]].join("."),r)}isValidAxisType(e){return Ko.includes(e.type)}getChartType(){return this.chartController.getChartType()}getChart(){return this.chartController.getChartProxy().getChart()}updateChart(e){const t=this.chartController.getChartProxy().getChartRef();t.skipAnimations(),Wi.AgCharts.updateDelta(t,e)}createChartOptions(){return{theme:{overrides:{}}}}retrieveChartOptionsThemeOverride(e,t,i){const n=this.getChartThemeOverridesSeriesTypeKeys(t);for(const t of n){const n=this.retrieveChartOptionsSeriesThemeOverride(e,t,i);if(void 0!==n)return n}}assignChartOptionsThemeOverride(e,t,i,n){const s=this.getChartThemeOverridesSeriesTypeKeys(t);for(const t of s)this.assignChartOptionsSeriesThemeOverride(e,t,i,n)}retrieveChartOptionsSeriesThemeOverride(e,t,i){return this.retrieveChartOption(e,["theme","overrides",t,...i?[i]:[]].join("."))}assignChartOptionsSeriesThemeOverride(e,t,i,n){this.assignChartOption(e,["theme","overrides",t,...i?[i]:[]].join("."),n)}getChartThemeOverridesSeriesTypeKeys(e){const t=this.chartController.getChartSeriesTypes(e);return this.chartController.isComboChart()&&t.push("common"),t}retrieveChartOption(e,t){return Wn(e,t,void 0)}assignChartOption(e,t,i){!function(e,t,i){if(null==e)return;const n=t.split(".");let s=e;n.forEach((e,t)=>{s[e]||(s[e]={}),t<n.length-1&&(s=s[e])}),s[n[n.length-1]]=i}(e,t,i)}raiseChartOptionsChangedEvent(){const e=this.chartController.getChartModel(),t={type:zi.Events.EVENT_CHART_OPTIONS_CHANGED,chartId:e.chartId,chartType:e.chartType,chartThemeName:this.chartController.getChartThemeName(),chartOptions:e.chartOptions};this.eventService.dispatchEvent(t)}static isMatchingSeries(e,t){return function(e){return!!wn[e]}(e)&&t.type===e}destroy(){super.destroy()}},qo=class extends Do{constructor(e){super(e)}getAxes(e){const t=e?e.fields:[],i=new Map(t.map(e=>[e.colId,e])),{primaryYKeys:n,secondaryYKeys:s}=this.getYKeys(t,e.seriesChartTypes),r=[{type:this.getXAxisType(e),position:"bottom"}];return n.length>0&&r.push({type:"number",keys:n,position:"left"}),s.length>0&&s.forEach(e=>{const t=i.get(e);if(!t||t.colId!==e)return;const n={type:"number",keys:[e],position:"right"};r.push(n)}),r}getSeries(e){const{fields:t,seriesChartTypes:i}=e,[n]=e.categories;return t.map(e=>{const t=i.find(t=>t.colId===e.colId);if(t){const i=t.chartType,s=["groupedColumn","groupedBar"].includes(i)?{grouped:!0}:{};return dn({type:Rn(i),xKey:n.id,yKey:e.colId,yName:e.displayName,stacked:["stackedArea","stackedColumn"].includes(i)},s)}})}getYKeys(e,t){const i=[],n=[];return e.forEach(e=>{const s=e.colId,r=t.find(e=>e.colId===s);r&&(r.secondaryAxis?n.push(s):i.push(s))}),{primaryYKeys:i,secondaryYKeys:n}}},Xo=["chartSettings","chartData","chartFormat"],Zo=["chartUnlink","chartLink","chartDownload"],Qo={settings:"chartSettings",data:"chartData",format:"chartFormat"},Jo=class extends ji.BeanStub{isLegacyFormat(){return!this.chartService.isEnterprise()}downloadChart(e,t,i,n){e.chartController.getChartProxy().downloadChart(t,i,n)}toggleLinked(e){e.chartController.detachChartRange()}openAdvancedSettings(e,t){this.advancedSettingsMenuFactory.showMenu(e,t)}hideAdvancedSettings(){this.advancedSettingsMenuFactory.hideMenu()}getToolbarOptionsAndPanels(e){var t,i,n;const s=this.isLegacyFormat();let r,o,a;if(Boolean(this.gos.get("chartToolPanelsDef"))||!s){const l=s?[e.isChartLinked()?"chartLink":"chartUnlink","chartDownload"]:["chartMenu"],c=this.gos.getCallback("getChartToolbarItems");a=c?c({defaultItems:l}).filter(e=>{if(!(s?Zo:[...Zo,"chartMenu"]).includes(e)){let t;return t=Xo.includes(e)?`'${e}' is a Chart Tool Panel option and will be ignored since 'chartToolPanelsDef' is used. Please use 'chartToolPanelsDef.panels' grid option instead`:"chartMenu"===e?"'chartMenu' is only allowed as a Chart Toolbar Option when using AG Charts Enterprise":`'${e}' is not a valid Chart Toolbar Option`,ji._.warnOnce(t),!1}return!0}):l;const h=null==(i=null==(t=this.gos.get("chartToolPanelsDef"))?void 0:t.panels)?void 0:i.map(e=>{const t=Qo[e];return t||ji._.warnOnce(`Invalid panel in chartToolPanelsDef.panels: '${e}'`),t}).filter(e=>Boolean(e));r=h||Object.values(Qo),e.isPivotChart()&&(r=r.filter(e=>"chartData"!==e));const u=null==(n=this.gos.get("chartToolPanelsDef"))?void 0:n.defaultToolPanel;o=u&&Qo[u]||r[0],s&&(a=r.length>0?[r[0],...a]:a)}else{let t=["chartSettings","chartData","chartFormat",e.isChartLinked()?"chartLink":"chartUnlink","chartDownload"];const i=this.gos.getCallback("getChartToolbarItems");if(i){const e=this.gos.get("suppressChartToolPanelsButton");t=i({defaultItems:e?t:Zo}).filter(t=>{if(!Xo.includes(t)&&!Zo.includes(t))return ji._.warnOnce(`'${t}' is not a valid Chart Toolbar Option`),!1;if(!e&&Xo.includes(t)){const e=`'${t}' is a Chart Tool Panel option and will be ignored. Please use 'chartToolPanelsDef.panels' grid option instead`;return ji._.warnOnce(e),!1}return!0}),e||(t=t.concat(Xo))}e.isPivotChart()&&(t=t.filter(e=>"chartData"!==e));const n=["chartUnlink","chartLink","chartDownload"];r=t.filter(e=>-1===n.indexOf(e)),o=r[0],a=t.filter(e=>-1!==n.indexOf(e)||r.length&&e===r[0])}return{panels:r,defaultPanel:o,chartToolbarOptions:a}}doesChartToolbarExist(e){const{chartToolbarOptions:t}=this.getToolbarOptionsAndPanels(e);return["chartMenu",...Zo].some(e=>t.includes(e))}doChartToolPanelsExist(e){const{panels:t}=this.getToolbarOptionsAndPanels(e);return t.length>0}};fn([(0,ji.Autowired)("chartService")],Jo.prototype,"chartService",2),fn([(0,ji.Autowired)("advancedSettingsMenuFactory")],Jo.prototype,"advancedSettingsMenuFactory",2),Jo=fn([(0,ji.Bean)("chartMenuService")],Jo);var ea="AG-GRID-DEFAULT-LABEL-KEY";function ta(e,t=null,i){const{depth:n,rootValues:s,value:r,children:o}=e;if(s)return s.map(e=>dn({[ea]:t},e));if(0===n)return[dn({[ea]:t},r)];const a=[];for(const[e,t]of o.entries())a.push(...ta(t,e,!0));return i?[dn({[ea]:t,children:a},null!=r?r:{})]:a}function ia(e,t,i){const n={depth:0,children:new Map};return e.forEach(e=>{s(e,t(e),i,0,n)}),n;function s(e,t,i,n,r){if(n===t)return 0===n?(r.rootValues||(r.rootValues=[]),r.rootValues.push(e)):r.value=e,r;{const o=i(e,n),a=s(e,t,i,n+1,r.children.get(o)||{depth:0,children:new Map});return r.children.set(o,a),r.depth=Math.max(1+a.depth,r.depth),r}}}var na=class extends To{constructor(e){super(e)}getUpdateOptions(e,t){const{fields:i}=e,[n,s]=i;return pn(dn({},t),{series:this.getSeries(n,s),data:this.getData(e,n,s)})}getSeriesChartThemeDefaults(){return{gradientLegend:{gradient:{preferredLength:200}}}}getSeries(e,t){var i,n;return[{type:this.standaloneChartType,labelKey:ea,sizeKey:null==e?void 0:e.colId,sizeName:null!=(i=null==e?void 0:e.displayName)?i:void 0,colorKey:null==t?void 0:t.colId,colorName:null!=(n=null==t?void 0:t.displayName)?n:void 0}]}getData(e,t,i){var n;const{categories:s,data:r,groupData:o,grouping:a}=e;return a?function(e,t){return ta(ia(e,function(e){var i,n;return null!=(n=null==(i=t(e))?void 0:i.length)?n:0},function(e,i){const n=t(e);return n?n[n.length-1-i]:null}))}(i?r.concat(null!=(n=null==o?void 0:o.map(e=>{const i=dn({},e);return delete i[t.colId],i}))?n:[]):r,e=>{var t,i;return null!=(i=null==(t=e[$i.GROUP_AUTO_COLUMN_ID])?void 0:t.labels)?i:null}):function(e,t){return ta(ia(e,function(e){return t.length},function(e,i){return null==(n=e[t[i]])?null:String(n);var n}))}(r,s.map(({id:e})=>e))}},sa=class e extends gt.Component{constructor(t){super(e.TEMPLATE),this.params=t}init(){const e=pn(dn({},this.params),{chartType:Dn(this.params.chartType),chartThemeName:this.getThemeName()}),t=this.gos.get("enableRtl");this.addCssClass(t?"ag-rtl":"ag-ltr");const i=this.createBean(new On(e));this.chartController=this.createManagedBean(new rs(i)),this.chartOptionsService=this.createManagedBean(new Yo(this.chartController)),this.validateCustomThemes(),this.createChart(),this.params.insideDialog&&this.addDialog(),this.addMenu(),this.addTitleEditComp(),this.addManagedListener(this.getGui(),"focusin",this.setActiveChartCellRange.bind(this)),this.addManagedListener(this.chartController,rs.EVENT_CHART_MODEL_UPDATE,this.update.bind(this)),this.addManagedPropertyListeners(["chartThemeOverrides","chartThemes"],this.reactivePropertyUpdate.bind(this)),this.update(),this.raiseChartCreatedEvent()}createChart(){var t;let i;this.chartProxy&&(i=this.chartProxy.destroy({keepChartInstance:!0}));const n=this.chartController.getChartType(),s={chartType:n,chartInstance:i,getChartThemeName:this.getChartThemeName.bind(this),getChartThemes:this.getChartThemes.bind(this),customChartThemes:this.gos.get("customChartThemes"),getGridOptionsChartThemeOverrides:()=>this.getGridOptionsChartThemeOverrides(),getExtraPaddingDirections:()=>{var e,t;return null!=(t=null==(e=this.chartMenu)?void 0:e.getExtraPaddingDirections())?t:[]},apiChartThemeOverrides:this.params.chartThemeOverrides,crossFiltering:null!=(t=this.params.crossFiltering)&&t,crossFilterCallback:(e,t)=>{this.params.crossFilteringContext.lastSelectedChartId=t?"":this.chartController.getChartId(),t&&this.params.crossFilteringResetCallback(),this.crossFilterService.filter(e,t)},parentElement:this.eChart,grouping:this.chartController.isGrouping(),chartThemeToRestore:this.params.chartThemeName,chartOptionsToRestore:this.params.chartOptionsToRestore,chartPaletteToRestore:this.params.chartPaletteToRestore,seriesChartTypes:this.chartController.getSeriesChartTypes(),translate:e=>this.chartTranslationService.translate(e)};if(this.params.chartOptionsToRestore=void 0,this.chartType=n,this.chartProxy=e.createChartProxy(s),!this.chartProxy)return void console.warn("AG Grid: invalid chart type supplied: ",s.chartType);const r=this.eChart.querySelector("canvas");r&&r.classList.add("ag-charts-canvas"),this.chartController.setChartProxy(this.chartProxy),this.createMenuContext(),this.titleEdit&&this.titleEdit.refreshTitle(this.chartMenuContext)}createMenuContext(){if(this.chartMenuContext)return;const e=this.createManagedBean(new Ps(this.chartOptionsService.getChartThemeOverridesProxy())),t=this.createManagedBean(new Ps(this.chartOptionsService.getAxisThemeOverridesProxy()));this.chartMenuContext={chartController:this.chartController,chartOptionsService:this.chartOptionsService,chartMenuParamsFactory:e,chartAxisMenuParamsFactory:t}}getChartThemeName(){return this.chartController.getChartThemeName()}getChartThemes(){return this.chartController.getThemeNames()}getGridOptionsChartThemeOverrides(){return this.gos.get("chartThemeOverrides")}static createChartProxy(e){switch(e.chartType){case"column":case"bar":case"groupedColumn":case"stackedColumn":case"normalizedColumn":case"groupedBar":case"stackedBar":case"normalizedBar":return new Po(e);case"pie":case"donut":case"doughnut":return new Oo(e);case"area":case"stackedArea":case"normalizedArea":return new _o(e);case"line":return new Lo(e);case"scatter":case"bubble":return new Fo(e);case"histogram":return new Vo(e);case"radarLine":case"radarArea":case"nightingale":case"radialColumn":case"radialBar":return new No(e);case"rangeBar":case"rangeArea":return new Bo(e);case"boxPlot":return new Ho(e);case"treemap":case"sunburst":return new na(e);case"heatmap":return new Uo(e);case"waterfall":return new jo(e);case"columnLineCombo":case"areaColumnCombo":case"customCombo":return new qo(e);default:throw`AG Grid: Unable to create chart as an invalid chartType = '${e.chartType}' was supplied.`}}addDialog(){const e=this.chartTranslationService.translate(this.params.pivotChart?"pivotChartTitle":"rangeChartTitle"),{width:t,height:i}=this.getBestDialogSize();this.chartDialog=new gt.AgDialog({resizable:!0,movable:!0,maximizable:!0,title:e,width:t,height:i,component:this,centered:!0,closable:!0}),this.getContext().createBean(this.chartDialog),this.chartDialog.addEventListener(gt.AgDialog.EVENT_DESTROYED,()=>{this.destroy(),this.chartMenuService.hideAdvancedSettings()})}getBestDialogSize(){const e=this.popupService.getPopupParent(),t=.75*gt._.getAbsoluteWidth(e),i=.75*gt._.getAbsoluteHeight(e),n=this.chartProxy.getChart();let s=this.params.insideDialog?850:n.width,r=this.params.insideDialog?470:n.height;return(s>t||r>i)&&(s=Math.min(s,t),r=Math.round(.553*s),r>i&&(r=i,s=Math.min(s,Math.round(r/.553)))),{width:s,height:r}}addMenu(){this.params.crossFiltering||(this.chartMenu=this.createBean(new xo(this.eChartContainer,this.eMenuContainer,this.chartMenuContext)),this.eChartContainer.appendChild(this.chartMenu.getGui()))}addTitleEditComp(){this.titleEdit=this.createBean(new Ao(this.chartMenu)),this.eTitleEditContainer.appendChild(this.titleEdit.getGui()),this.chartProxy&&this.titleEdit.refreshTitle(this.chartMenuContext)}update(e){if((null==e?void 0:e.chartId)&&!this.chartController.update(e))return;const t=this.chartTypeChanged(e),i=t||this.chartEmpty?(e=>{const t=this.chartType,i=e,n=this.chartProxy.getChart(),s=null==n?void 0:n.getOptions(),r=null==n?void 0:n.axes;return this.chartOptionsService.getPersistedChartThemeOverrides(s,r,t,null!=i?i:t)})(t):void 0;t&&this.createChart();const n=i&&(null==e?void 0:e.chartThemeOverrides)?zn(i,e.chartThemeOverrides):i||(null==e?void 0:e.chartThemeOverrides);this.updateChart(n),(null==e?void 0:e.chartId)&&this.chartProxy.getChart().waitForUpdate().then(()=>{this.chartController.raiseChartApiUpdateEvent()})}updateChart(e){const{chartProxy:t}=this,i=this.chartController.getSelectedValueColState(),n=this.chartController.getChartData(),s=this.handleEmptyChart(n,i.length);if(this.chartEmpty=s,s)return void(e&&this.chartController.updateThemeOverrides(e));let r=this.chartController.getChartUpdateParams(e);t.update(r),this.chartProxy.getChart().waitForUpdate().then(()=>{this.chartController.raiseChartUpdatedEvent()}),this.titleEdit.refreshTitle(this.chartMenuContext)}chartTypeChanged(e){const[t,i]=[this.chartController.getChartType(),null==e?void 0:e.chartType],n=i?Dn(i):void 0;return this.chartType!==t?null!=n?n:t:n&&t!==n?n:null}getChartModel(){return this.chartController.getChartModel()}getChartImageDataURL(e){return this.chartProxy.getChartImageDataURL(e)}handleEmptyChart(e,t){const i=this.chartController.isPivotChart()&&!this.chartController.isPivotMode(),n=this.chartController.getChartType();let s=1;this.chartController.isActiveXYChart()?s="bubble"===n?3:2:Tn(Rn(n))&&(s=0);const r=t<s||0===e.length;if(this.eChart){const e=i||r;gt._.setDisplayed(this.eChart,!e),gt._.setDisplayed(this.eEmpty,e)}return i?(this.eEmpty.innerText=this.chartTranslationService.translate("pivotChartRequiresPivotMode"),!0):!!r&&(this.eEmpty.innerText=this.chartTranslationService.translate("noDataToChart"),!0)}downloadChart(e,t,i){this.chartProxy.downloadChart(e,t,i)}openChartToolPanel(e){const t=e?Qo[e]:e;this.chartMenu.showMenu({panel:t})}closeChartToolPanel(){this.chartMenu.hideMenu()}getChartId(){return this.chartController.getChartId()}getUnderlyingChart(){return this.chartProxy.getChartRef()}crossFilteringReset(){this.chartProxy.crossFilteringReset()}setActiveChartCellRange(e){this.getGui().contains(e.relatedTarget)||(this.chartController.setChartRange(!0),this.focusService.clearFocusedCell())}getThemeName(){const e=this.gos.get("chartThemes")||ns;if(0===e.length)throw new Error("Cannot create chart: no chart themes available.");const{chartThemeName:t}=this.params;return gt._.includes(e,t)?t:e[0]}getAllKeysInObjects(e){const t={};return e.filter(e=>null!=e).forEach(e=>{Object.keys(e).forEach(e=>t[e]=null)}),Object.keys(t)}validateCustomThemes(){const e=this.getChartThemes(),t=this.gos.get("customChartThemes");t&&this.getAllKeysInObjects([t]).forEach(t=>{gt._.includes(e,t)||console.warn("AG Grid: a custom chart theme with the name '"+t+"' has been supplied but not added to the 'chartThemes' list")})}reactivePropertyUpdate(){this.chartController.setChartThemeName(this.getThemeName(),!0);const e=this.getChartId(),t=this.chartController.isCrossFilterChart()?"crossFilter":this.getChartModel().modelType,i=this.gos.get("chartThemeOverrides")||{};this.update({type:`${t}ChartUpdate`,chartId:e,chartThemeOverrides:i})}raiseChartCreatedEvent(){const e={type:gt.Events.EVENT_CHART_CREATED,chartId:this.chartController.getChartId()};this.chartProxy.getChart().waitForUpdate().then(()=>{this.eventService.dispatchEvent(e)})}raiseChartDestroyedEvent(){const e={type:gt.Events.EVENT_CHART_DESTROYED,chartId:this.chartController.getChartId()};this.eventService.dispatchEvent(e)}destroy(){var e;super.destroy(),this.chartProxy&&this.chartProxy.destroy(),this.destroyBean(this.chartMenu),this.destroyBean(this.titleEdit),this.chartDialog&&this.chartDialog.isAlive()&&this.destroyBean(this.chartDialog),null==(e=this.onDestroyColorSchemeChangeListener)||e.call(this);const t=this.getGui();gt._.clearElement(t),gt._.removeFromParent(t),this.raiseChartDestroyedEvent()}};sa.TEMPLATE='<div class="ag-chart" tabindex="-1">\n            <div ref="eChartContainer" tabindex="-1" class="ag-chart-components-wrapper">\n                <div ref="eChart" class="ag-chart-canvas-wrapper"></div>\n                <div ref="eEmpty" class="ag-chart-empty-text ag-unselectable"></div>\n            </div>\n            <div ref="eTitleEditContainer"></div>\n            <div ref="eMenuContainer" class="ag-chart-docked-container" style="min-width: 0px;"></div>\n        </div>',fn([(0,gt.RefSelector)("eChart")],sa.prototype,"eChart",2),fn([(0,gt.RefSelector)("eChartContainer")],sa.prototype,"eChartContainer",2),fn([(0,gt.RefSelector)("eMenuContainer")],sa.prototype,"eMenuContainer",2),fn([(0,gt.RefSelector)("eEmpty")],sa.prototype,"eEmpty",2),fn([(0,gt.RefSelector)("eTitleEditContainer")],sa.prototype,"eTitleEditContainer",2),fn([(0,gt.Autowired)("chartCrossFilterService")],sa.prototype,"crossFilterService",2),fn([(0,gt.Autowired)("chartTranslationService")],sa.prototype,"chartTranslationService",2),fn([(0,gt.Autowired)("chartMenuService")],sa.prototype,"chartMenuService",2),fn([(0,gt.Autowired)("focusService")],sa.prototype,"focusService",2),fn([(0,gt.Autowired)("popupService")],sa.prototype,"popupService",2),fn([gt.PostConstruct],sa.prototype,"init",1);var ra=sa,oa="31.3.4";function aa(e){return e=Ta("chartOptions.legend.item.marker.type","shape",e),e=Ta("chartOptions.seriesDefaults.marker.type","shape",e),Ta("chartOptions.legend.padding","spacing",e)}function la(e){var t;const i=e=Da("chartOptions.seriesDefaults.marker.minSize",e),{chartType:n,chartPalette:s,chartOptions:r}=i,o=r,{xAxis:a,yAxis:l}=o,c=gn(o,["xAxis","yAxis"]),h=gn(i,["chartType","chartPalette","chartOptions"]),u=function(e){switch(e){case"bar":case"stackedBar":case"normalizedBar":return["number","category"];case"groupedBar":return["number","grouped-category"];case"column":case"stackedColumn":case"normalizedColumn":case"line":case"area":case"stackedArea":case"normalizedArea":case"histogram":return["category","number"];case"groupedColumn":return["grouped-category","number"];case"scatter":case"bubble":return["number","number"];default:return}}(n),d=null==u?void 0:u.map((e,t)=>dn({type:e},0===t?a:l));return dn({chartType:n,chartThemeName:null!=(t={borneo:"ag-default",material:"ag-material",bright:"ag-vivid"}[s])?t:"ag-default",chartOptions:pn(dn({},c),{axes:d,xAxis:a,yAxis:l})},h)}function ca(e){return Ta("chartOptions.seriesDefaults.label.minRequiredAngle","minAngle",e)}function ha(e){return e=Da("chart",e=Ra("chartOptions.seriesDefaults.highlightStyle",e,e=>{var t=e,{dimOpacity:i}=t,n=gn(t,["dimOpacity"]);return dn(dn({},n),null!=i?{series:{dimOpacity:i}}:{})})),e=Da("chartOptions.seriesDefaults.tooltipClass",e),e=Sa("chartOptions.axes[].label.rotation",0,e=Da("chartOptions.seriesDefaults.tooltipTracking",e)),Sa("chartOptions.axes[].label.rotation",335,e)}function ua(e){const t=e=>{var t=e,{item:i,series:n}=t,s=gn(t,["item","series"]);return dn({item:dn(dn({},s),i)},n?{series:n}:{})};return e=Ra("chartOptions.seriesDefaults.highlightStyle",e,t),Ra("chartOptions.series[].highlightStyle",e,t)}function da(e){e=Aa("chartOptions.seriesDefaults.fill.opacity","chartOptions.seriesDefaults.fillOpacity",e),e=Aa("chartOptions.seriesDefaults.stroke.opacity","chartOptions.seriesDefaults.strokeOpacity",e),e=Da("chartOptions.seriesDefaults.fill",e=Aa("chartOptions.seriesDefaults.stroke.width","chartOptions.seriesDefaults.strokeWidth",e)),e=Da("chartOptions.seriesDefaults.stroke",e),e=Da("chartOptions.seriesDefaults.callout.colors",e),e=Da("chartOptions.xAxis",e);const t=e=Da("chartOptions.yAxis",e),{chartType:i,chartOptions:n}=t,s=n,{axes:r,series:o,seriesDefaults:a}=s,l=gn(s,["axes","series","seriesDefaults"]),c=gn(t,["chartType","chartOptions"]),h=Dn(i),u=Rn(h),d=[u],p={};if(!kn(u)){const e={top:{},bottom:{},left:{},right:{}},t=r.map(t=>{var i=t,{type:n}=i,s=gn(i,["type"]);return{[n]:dn(dn({},e),s)}}).reduce(ka,{});Fn.filter(e=>null==t[e]).forEach(i=>{t[i]=dn({},e)}),p.axes=t}const g=d.map(e=>({[e]:dn(pn(dn({},p),{series:a}),l)})).reduce(ka,{});return pn(dn({},c),{chartType:h,chartOptions:g})}function pa(e){return e=Da("chartOptions.*.title.padding",e),e=Da("chartOptions.*.subtitle.padding",e),xa("chartOptions.*.axes.*.title.enabled",!1,e=Da("chartOptions.*.axes.*.title.padding",e))}function ga(e){return e=Ta("chartOptions.pie.series.callout","calloutLine",e),e=Ta("chartOptions.pie.series.label","calloutLabel",e),e=Ta("chartOptions.pie.series.labelKey","sectorLabelKey",e),e=Ta("chartOptions.pie.series.labelName","sectorLabelName",e),e=Ta("chartOptions.donut.series.callout","calloutLine",e),e=Ta("chartOptions.donut.series.label","calloutLabel",e),e=Ta("chartOptions.donut.series.labelKey","sectorLabelKey",e),Ta("chartOptions.donut.series.labelName","sectorLabelName",e)}function fa(e){return e=Ma("chartOptions.scatter.series.fill","chartOptions.scatter.series.marker.fill",e),e=Ma("chartOptions.scatter.series.fillOpacity","chartOptions.scatter.series.marker.fillOpacity",e),e=Ma("chartOptions.scatter.series.stroke","chartOptions.scatter.series.marker.stroke",e),e=Ma("chartOptions.scatter.series.strokeOpacity","chartOptions.scatter.series.marker.strokeOpacity",e),Aa("chartOptions.scatter.series.paired","chartOptions.scatter.paired",e=Ma("chartOptions.scatter.series.strokeWidth","chartOptions.scatter.series.marker.strokeWidth",e))}function ma(e){return Da("chartOptions.axes[].tick.count",e)}function ya(e){return Ra("chartOptions.*.tooltip",e,e=>{var t=e,{tracking:i}=t,n=gn(t,["tracking"]);const s=dn({},n);return!1===i?(null!=s.position||(s.position={type:"pointer"}),null!=s.range||(s.range="nearest")):!0===i&&(null!=s.position||(s.position={type:"node"}),null!=s.range||(s.range="nearest")),s})}function va(e){return e=Ta("chartOptions.pie.series.labelKey","sectorLabelKey",e),xa("chartOptions.common.legend.position","right",e=Ea("chartOptions.common.legend.enabled",!0,e=Da("chartOptions.*.series.flipXY",e=ya(e=ma(e=Ta("chartOptions.pie.series.labelName","sectorLabelName",e))))))}function ba(e){const t=Ta("chartOptions.column","bar",e),i={"ag-pastel":"ag-sheets","ag-solar":"ag-polychroma"}[t.chartThemeName]||t.chartThemeName;return pn(dn({},t),{chartThemeName:i})}function Ca(e,t,i){if(wa(e)>wa(t.version)){const n=i(t);return n.version=e,n}return t}function wa(e){const{major:t,minor:i,patch:n}=function(e){const t="string"==typeof e?e.split(".").map(e=>Number(e)):[];if(3!==t.length||t.some(e=>isNaN(e)))throw new Error("AG Grid - Illegal version string: "+e);return{major:t[0],minor:t[1],patch:t[2]}}(e);return 1e4*t+100*i+n}function Sa(e,t,i){return Ia(e,!0,i,(e,i)=>{e[i]===t&&delete e[i]})}function xa(e,t,i){return Ia(e,!1,i,(e,i)=>{null==e[i]&&(e[i]=t)})}function Ea(e,t,i){var n;"string"==typeof e&&(e=e.split("."));const s=e[0];return e.length>1&&(i[s]=Ea(e.slice(1),t,null!=(n=i[s])?n:{})),Object.keys(i).includes(s)||(i[s]=t),i}function Aa(e,t,i){let n,s=!1;return i=Ia(e,!0,i,(e,t)=>{s=!0,n=e[t],delete e[t]}),s?Ia(t,!1,i,(e,t)=>{e[t]=n}):i}function Ma(e,t,i){let n,s=!1;return i=Ia(e,!0,i,(e,t)=>{s=!0,n=e[t],delete e[t]}),s?Ia(t,!1,i,(e,t)=>{void 0===e[t]&&(e[t]=n)}):i}function Ta(e,t,i){return Ia(e,!0,i,(e,i)=>{e[t]=e[i],delete e[i]})}function Da(e,t){return Ia(e,!0,t,(e,t)=>delete e[t])}function Ia(e,t,i,n){const s=e instanceof Array?e:e.split("."),r=s.slice(0,s.length-1),o=s[s.length-1];return Ra(r,i,e=>{const i=Object.keys(e).includes(o);if(t&&!i)return e;const s=dn({},e);return n(s,o),s})}function Ra(e,t,i){const n=e instanceof Array?e:e.split(".");if(t=dn({},t),0===n.length)return i(t);if(n[0].startsWith("{")){const e=n[0].substring(1,n[0].lastIndexOf("}")).split(",");for(const s of e)null!=t[s]&&(t[s]=Ra(n.slice(1),t[s],i))}else if(n[0].endsWith("[]")){const s=n[0].substring(0,e[0].indexOf("["));t[s]instanceof Array&&(t[s]=t[s].map(e=>Ra(n.slice(1),e,i)))}else if("*"===n[0])for(const e in t)t[e]=Ra(n.slice(1),t[e],i);else null!=t[n[0]]&&(t[n[0]]=Ra(n.slice(1),t[n[0]],i));return t}var ka=(e,t)=>dn(dn({},e),t),Pa=class extends dt.BeanStub{constructor(){super(...arguments),this.activeCharts=new Set,this.activeChartComps=new Set,this.crossFilteringContext={lastSelectedChartId:""},this.isEnterprise=()=>pt._ModuleSupport.enterpriseModule.isEnterprise}updateChart(e){if(0===this.activeChartComps.size)return void console.warn("AG Grid - No active charts to update.");const t=[...this.activeChartComps].find(t=>t.getChartId()===e.chartId);t?t.update(e):console.warn(`AG Grid - Unable to update chart. No active chart found with ID: ${e.chartId}.`)}getChartModels(){const e=[];return this.activeChartComps.forEach(t=>e.push((e=>pn(dn({},e),{version:oa}))(t.getChartModel()))),e}getChartRef(e){let t;return this.activeCharts.forEach(i=>{i.chartId===e&&(t=i)}),t}getChartComp(e){let t;return this.activeChartComps.forEach(i=>{i.getChartId()===e&&(t=i)}),t}getChartImageDataURL(e){let t;return this.activeChartComps.forEach(i=>{i.getChartId()===e.chartId&&(t=i.getChartImageDataURL(e.fileFormat))}),t}downloadChart(e){const t=Array.from(this.activeChartComps).find(t=>t.getChartId()===e.chartId);null==t||t.downloadChart(e.dimensions,e.fileName,e.fileFormat)}openChartToolPanel(e){const t=Array.from(this.activeChartComps).find(t=>t.getChartId()===e.chartId);null==t||t.openChartToolPanel(e.panel)}closeChartToolPanel(e){const t=Array.from(this.activeChartComps).find(t=>t.getChartId()===e);null==t||t.closeChartToolPanel()}createChartFromCurrentRange(e="groupedColumn"){const t=this.getSelectedRange();return this.createChart({cellRange:t,chartType:e})}restoreChart(e,t){if(!e)return void console.warn("AG Grid - unable to restore chart as no chart model is provided");let i,n,s,r;return e.version!==oa&&(e=function(e){return e.version,null==e.version&&(e.version=function(e){var t,i;const n=e;if(null!=e.version)return e.version;const s=(e,...t)=>Object.keys(e||{}).some(e=>t.includes(e)),r=n.chartOptions,o=s(r,"seriesDefaults")?null==r?void 0:r.seriesDefaults:null==r?void 0:r[Object.keys(r)[0]],a={"27.0.0":s(n,"seriesChartTypes"),"26.2.0":!s(r,"seriesDefaults"),"26.1.0":s(null==o?void 0:o.highlightStyle,"item"),"26.0.0":s(null==o?void 0:o.highlightStyle,"series"),"25.1.0":s(null==o?void 0:o.label,"minAngle"),"25.0.0":s(n,"modelType","aggFunc","unlinkChart","suppressChartRanges")||s(o,"lineDash","lineDashOffset"),"24.0.0":s(n,"chartThemeName","chart")||s(r,"series"),"23.2.0":s(r,"navigator"),"23.0.0":s(null==(i=null==(t=null==r?void 0:r.legend)?void 0:t.item)?void 0:i.marker,"shape"),"22.1.0":s(n,"chartPalette","chartType")},l="27.1.0",c=Object.entries(a).filter(([e,t])=>t),[h=l]=c[0];return h}(e)),e=Ca("23.0.0",e,aa),e=Ca("24.0.0",e,la),e=Ca("25.1.0",e,ca),e=Ca("26.0.0",e,ha),e=Ca("26.1.0",e,ua),e=Ca("26.2.0",e,da),e=Ca("28.0.0",e,pa),e=Ca("28.2.0",e,ga),e=Ca("29.0.0",e,fa),e=Ca("29.1.0",e,ma),e=Ca("29.2.0",e,ya),e=Ca("30.0.0",e,va),e=function(e){return e=Da("chartOptions.*.width",e),xa("chartOptions.*.axes.category.label.autoRotate",!0,e=Da("chartOptions.*.height",e))}(e=Ca("31.0.0",e,ba)),Ca(oa,e,e=>e)}(e)),"pivot"===e.modelType?(this.gos.updateGridOptions({options:{pivotMode:!0},source:"pivotChart"}),i=this.createCellRange(void 0,!0),n=!0,s=!0):(i=this.createCellRange(e.cellRange),r=e.chartPalette),i?this.createChart(pn(dn({},e),{cellRange:i,pivotChart:n,suppressChartRanges:s,chartContainer:t,chartOptionsToRestore:e.chartOptions,chartPaletteToRestore:r})):void 0}createRangeChart(e){const t=this.createCellRange(e.cellRange);if(t)return this.createChart(pn(dn({},e),{cellRange:t}))}createPivotChart(e){this.gos.updateGridOptions({options:{pivotMode:!0},source:"pivotChart"});const t=this.createCellRange(void 0,!0);if(t)return this.createChart(pn(dn({},e),{cellRange:t,pivotChart:!0,suppressChartRanges:!0}))}createCrossFilterChart(e){const t=this.createCellRange(e.cellRange);if(!t)return;const i=!(void 0!==e.suppressChartRanges&&null!==e.suppressChartRanges)||e.suppressChartRanges;return this.createChart(pn(dn({},e),{cellRange:t,suppressChartRanges:i,crossFiltering:!0}))}createChart(e){const t=is.validateCreateParams(e);if(!t)return;e=!0===t?e:t;const{chartType:i,chartContainer:n}=e,s=this.gos.getCallback("createChartContainer"),r=pn(dn({},e),{chartId:this.generateId(),chartType:Dn(i),insideDialog:!(n||s),crossFilteringContext:this.crossFilteringContext,crossFilteringResetCallback:()=>this.activeChartComps.forEach(e=>e.crossFilteringReset())}),o=new ra(r);this.context.createBean(o);const a=this.createChartRef(o);if(n){n.appendChild(o.getGui());const e=this.environment.getTheme();e.el&&!e.el.contains(n)&&n.classList.add(e.theme)}else s?s(a):o.addEventListener(ra.EVENT_DESTROYED,()=>{this.activeChartComps.delete(o),this.activeCharts.delete(a)});return a}createChartRef(e){const t={destroyChart:()=>{this.activeCharts.has(t)&&(this.context.destroyBean(e),this.activeChartComps.delete(e),this.activeCharts.delete(t))},chartElement:e.getGui(),chart:e.getUnderlyingChart(),chartId:e.getChartModel().chartId};return this.activeCharts.add(t),this.activeChartComps.add(e),t}getSelectedRange(){var e,t;const i=null!=(t=null==(e=this.rangeService)?void 0:e.getCellRanges())?t:[];return i.length>0?i[0]:{columns:[]}}generateId(){return`id-${Math.random().toString(36).substring(2,18)}`}createCellRange(e,t){var i;const n=t?{rowStartIndex:null,rowStartPinned:void 0,rowEndIndex:null,rowEndPinned:void 0,columns:this.columnModel.getAllDisplayedColumns().map(e=>e.getColId())}:e,s=n&&(null==(i=this.rangeService)?void 0:i.createPartialCellRangeFromRangeParams(n,!0));return s||console.warn(`AG Grid - unable to create chart as ${t?"there are no columns in the grid":"no range is selected"}.`),s}destroyAllActiveCharts(){this.activeCharts.forEach(e=>e.destroyChart())}};Pa.CHARTS_VERSION=pt.VERSION,fn([(0,dt.Autowired)("columnModel")],Pa.prototype,"columnModel",2),fn([(0,dt.Optional)("rangeService")],Pa.prototype,"rangeService",2),fn([dt.PreDestroy],Pa.prototype,"destroyAllActiveCharts",1),Pa=fn([(0,dt.Bean)("chartService")],Pa);var _a=class extends Ki.BeanStub{translate(e){return this.localeService.getLocaleTextFunc()(e,_a.DEFAULT_TRANSLATIONS[e])}};_a.DEFAULT_TRANSLATIONS={pivotChartTitle:"Pivot Chart",rangeChartTitle:"Range Chart",settings:"Chart",data:"Data",format:"Format",categories:"Categories",defaultCategory:"(None)",series:"Series",switchCategorySeries:"Switch Category / Series",categoryValues:"Category Values",seriesLabels:"Series Labels",aggregate:"Aggregate",xyValues:"X Y Values",paired:"Paired Mode",axis:"Axis",xAxis:"Horizontal Axis",yAxis:"Vertical Axis",polarAxis:"Polar Axis",radiusAxis:"Radius Axis",navigator:"Navigator",zoom:"Zoom",animation:"Animation",crosshair:"Crosshair",color:"Color",thickness:"Thickness",preferredLength:"Preferred Length",xType:"X Type",axisType:"Axis Type",automatic:"Automatic",category:"Category",number:"Number",time:"Time",timeFormat:"Time Format",autoRotate:"Auto Rotate",labelRotation:"Rotation",circle:"Circle",orientation:"Orientation",polygon:"Polygon",fixed:"Fixed",parallel:"Parallel",perpendicular:"Perpendicular",radiusAxisPosition:"Position",ticks:"Ticks",gridLines:"Grid Lines",width:"Width",height:"Height",length:"Length",padding:"Padding",spacing:"Spacing",chart:"Chart",title:"Title",titlePlaceholder:"Chart title - double click to edit",background:"Background",font:"Font",top:"Top",right:"Right",bottom:"Bottom",left:"Left",labels:"Labels",calloutLabels:"Callout Labels",sectorLabels:"Sector Labels",positionRatio:"Position Ratio",size:"Size",shape:"Shape",minSize:"Minimum Size",maxSize:"Maximum Size",legend:"Legend",position:"Position",markerSize:"Marker Size",markerStroke:"Marker Stroke",markerPadding:"Marker Padding",itemSpacing:"Item Spacing",itemPaddingX:"Item Padding X",itemPaddingY:"Item Padding Y",layoutHorizontalSpacing:"Horizontal Spacing",layoutVerticalSpacing:"Vertical Spacing",strokeWidth:"Stroke Width",offset:"Offset",offsets:"Offsets",tooltips:"Tooltips",callout:"Callout",markers:"Markers",shadow:"Shadow",blur:"Blur",xOffset:"X Offset",yOffset:"Y Offset",lineWidth:"Line Width",lineDash:"Line Dash",lineDashOffset:"Dash Offset",scrollingZoom:"Scrolling",scrollingStep:"Scrolling Step",selectingZoom:"Selecting",durationMillis:"Duration (ms)",crosshairLabel:"Label",crosshairSnap:"Snap to Node",normal:"Normal",bold:"Bold",italic:"Italic",boldItalic:"Bold Italic",predefined:"Predefined",fillOpacity:"Fill Opacity",strokeColor:"Line Color",strokeOpacity:"Line Opacity",miniChart:"Mini-Chart",histogramBinCount:"Bin count",connectorLine:"Connector Line",seriesItems:"Series Items",seriesItemType:"Item Type",seriesItemPositive:"Positive",seriesItemNegative:"Negative",seriesItemLabels:"Item Labels",columnGroup:"Column",barGroup:"Bar",pieGroup:"Pie",lineGroup:"Line",scatterGroup:"X Y (Scatter)",areaGroup:"Area",polarGroup:"Polar",statisticalGroup:"Statistical",hierarchicalGroup:"Hierarchical",specializedGroup:"Specialized",combinationGroup:"Combination",groupedColumnTooltip:"Grouped",stackedColumnTooltip:"Stacked",normalizedColumnTooltip:"100% Stacked",groupedBarTooltip:"Grouped",stackedBarTooltip:"Stacked",normalizedBarTooltip:"100% Stacked",pieTooltip:"Pie",donutTooltip:"Donut",lineTooltip:"Line",groupedAreaTooltip:"Area",stackedAreaTooltip:"Stacked",normalizedAreaTooltip:"100% Stacked",scatterTooltip:"Scatter",bubbleTooltip:"Bubble",histogramTooltip:"Histogram",radialColumnTooltip:"Radial Column",radialBarTooltip:"Radial Bar",radarLineTooltip:"Radar Line",radarAreaTooltip:"Radar Area",nightingaleTooltip:"Nightingale",rangeBarTooltip:"Range Bar",rangeAreaTooltip:"Range Area",boxPlotTooltip:"Box Plot",treemapTooltip:"Treemap",sunburstTooltip:"Sunburst",heatmapTooltip:"Heatmap",waterfallTooltip:"Waterfall",columnLineComboTooltip:"Column & Line",areaColumnComboTooltip:"Area & Column",customComboTooltip:"Custom Combination",innerRadius:"Inner Radius",startAngle:"Start Angle",endAngle:"End Angle",reverseDirection:"Reverse Direction",groupPadding:"Group Padding",seriesPadding:"Series Padding",group:"Group",tile:"Tile",whisker:"Whisker",cap:"Cap",capLengthRatio:"Length Ratio",labelPlacement:"Placement",inside:"Inside",outside:"Outside",noDataToChart:"No data available to be charted.",pivotChartRequiresPivotMode:"Pivot Chart requires Pivot Mode enabled.",chartSettingsToolbarTooltip:"Menu",chartLinkToolbarTooltip:"Linked to Grid",chartUnlinkToolbarTooltip:"Unlinked from Grid",chartDownloadToolbarTooltip:"Download Chart",chartMenuToolbarTooltip:"Menu",chartEdit:"Edit Chart",chartAdvancedSettings:"Advanced Settings",chartLink:"Link to Grid",chartUnlink:"Unlink from Grid",chartDownload:"Download Chart",histogramFrequency:"Frequency",seriesChartType:"Series Chart Type",seriesType:"Series Type",secondaryAxis:"Secondary Axis",seriesAdd:"Add a series",categoryAdd:"Add a category",area:"Area",bar:"Bar",column:"Column",line:"Line",scatter:"Scatter",histogram:"Histogram",radialColumn:"Radial Column",radialBar:"Radial Bar",radarLine:"Radar Line",radarArea:"Radar Area",nightingale:"Nightingale",rangeBar:"Range Bar",rangeArea:"Range Area",treemap:"Treemap",sunburst:"Sunburst",waterfall:"Waterfall",boxPlot:"Box Plot",pie:"Pie",donut:"Donut",stackedArea:"StackedArea",groupedColumn:"Grouped Column",stackedColumn:"Stacked Column",advancedSettings:"Advanced Settings",ariaChartMenuClose:"Close Chart Edit Menu",timeFormatSlashesDDMMYYYY:"DD/MM/YYYY",timeFormatSlashesMMDDYYYY:"MM/DD/YYYY",timeFormatSlashesDDMMYY:"DD/MM/YY",timeFormatSlashesMMDDYY:"MM/DD/YY",timeFormatDotsDDMYY:"DD.M.YY",timeFormatDotsMDDYY:"M.DD.YY",timeFormatDashesYYYYMMDD:"YYYY-MM-DD",timeFormatSpacesDDMMMMYYYY:"DD MMMM YYYY",timeFormatHHMMSS:"HH:MM:SS",timeFormatHHMMSSAmPm:"HH:MM:SS AM/PM",sum:"Sum",first:"First",last:"Last",min:"Min",max:"Max",count:"Count",avg:"Average",direction:"Direction",horizontal:"Horizontal",vertical:"Vertical",seriesGroupType:"Group Type",groupedSeriesGroupType:"Grouped",stackedSeriesGroupType:"Stacked",normalizedSeriesGroupType:"100% Stacked"},_a=fn([(0,Ki.Bean)("chartTranslationService")],_a);var La=class extends Yi.BeanStub{filter(e,t=!1){const i=this.gridApi.getFilterModel();if(t)return void this.resetFilters(i);let n=La.extractFilterColId(e);this.isValidColumnFilter(n)?this.updateFilters(i,e,n):console.warn("AG Grid: cross filtering requires a 'agSetColumnFilter' or 'agMultiColumnFilter' to be defined on the column with id: '"+n+"'")}resetFilters(e){Object.keys(e).length>0&&(this.gridApi.setFilterModel(null),this.gridApi.onFilterChanged())}updateFilters(e,t,i){let n=La.extractFilterColId(t),s=t.datum[n];if(void 0===s)return;let r=s.toString();if(t.event.metaKey||t.event.ctrlKey){const t=this.getCurrentGridValuesForCategory(i);let n;Yi._.includes(t,r)?n=t.filter(e=>e!==r):(n=t,n.push(r)),e[i]=this.getUpdatedFilterModel(i,n)}else{const t=[r];e={[i]:this.getUpdatedFilterModel(i,t)}}this.gridApi.setFilterModel(e)}getUpdatedFilterModel(e,t){return"agMultiColumnFilter"===this.getColumnFilterType(e)?{filterType:"multi",filterModels:[null,{filterType:"set",values:t}]}:{filterType:"set",values:t}}getCurrentGridValuesForCategory(e){let t=[];const i=this.getColumnById(e);return this.gridApi.forEachNodeAfterFilter(e=>{if(i&&!e.group){const n=this.valueService.getValue(i,e)+"";t.includes(n)||t.push(n)}}),t}static extractFilterColId(e){return e.xKey||e.calloutLabelKey}isValidColumnFilter(e){e.indexOf("-filtered-out")&&(e=e.replace("-filtered-out",""));let t=this.getColumnFilterType(e);return"boolean"==typeof t?t:Yi._.includes(["agSetColumnFilter","agMultiColumnFilter"],t)}getColumnFilterType(e){let t=this.getColumnById(e);if(t)return t.getColDef().filter}getColumnById(e){return this.columnModel.getGridColumn(e)}};function Na(e){return e&&e.match(/\d+\.\d+\.\d+/)}function Oa({type:e,gridVersion:t,chartsVersion:i}){const n="AG Grid: AG Grid version is incompatible. Please see https://www.ag-grid.com/javascript-data-grid/modules/ for more information.";if(!t)return n;const s=function(e){if(!e||!Na(e))return;const[t,i]=e.split(".")||[],n=`${t}.${i}.x`,s=parseInt(t,10)-28+6;return s<0?void 0:{gridMajorMinor:n,chartsMajorMinor:`${s}.${i}.x`}}(t);if(!s)return n;const{gridMajorMinor:r,chartsMajorMinor:o}=s;return"incompatible"===e?`AG Grid version ${t} and AG Charts version ${i} is not supported. AG Grid version ${r} should be used with AG Chart ${o}. Please see https://www.ag-grid.com/javascript-data-grid/modules/ for more information.`:"invalidCharts"===e?`AG Grid version ${r} should be used with AG Chart ${o}. Please see https://www.ag-grid.com/javascript-data-grid/modules/ for more information.`:n}fn([(0,Yi.Autowired)("gridApi")],La.prototype,"gridApi",2),fn([(0,Yi.Autowired)("columnModel")],La.prototype,"columnModel",2),fn([(0,Yi.Autowired)("valueService")],La.prototype,"valueService",2),La=fn([(0,Yi.Bean)("chartCrossFilterService")],La);var Fa=class extends qi.BeanStub{showMenuList(e){const{eventSource:t,showMenu:i,chartMenuContext:n}=e,s=this.chartMenuService.doChartToolPanelsExist(n.chartController),r=this.mapWithStockItems(this.getMenuItems(n.chartController,s),n,i,t,s);if(!r.length)return;const o=this.createBean(new Ga(r));this.activeChartMenuList=o;let a=-1,l="left";this.gos.get("enableRtl")&&(a=1,l="right");const c=o.getGui();this.popupService.addPopup({modal:!0,eChild:c,closeOnEsc:!0,closedCallback:()=>{this.destroyBean(o),this.activeChartMenuList=void 0;const e=this.gos.getDocument(),i=this.gos.getActiveDomElement();i&&i!==e.body||t.focus({preventScroll:!0})},afterGuiAttached:e=>o.afterGuiAttached(e),positionCallback:()=>{this.popupService.positionPopupByComponent({type:"chartMenu",eventSource:t,ePopup:c,alignSide:l,nudgeX:4*a,nudgeY:4,position:"under",keepWithinBounds:!0})},ariaLabel:"Chart Menu"})}getMenuItems(e,t){const i=[...t?["chartEdit"]:[],...e.isEnterprise()?["chartAdvancedSettings"]:[],e.isChartLinked()?"chartUnlink":"chartLink","chartDownload"],n=this.gos.get("chartMenuItems");return n?Array.isArray(n)?n:n(this.gos.addGridCommonParams({defaultItems:i})):i}mapWithStockItems(e,t,i,n,s){if(!e)return[];const r=[];return e.forEach(e=>{let o;if(o="string"==typeof e?this.getStockMenuItem(e,t,i,n,s):dn({},e),!o)return;const{subMenu:a}=o;Array.isArray(a)&&(o.subMenu=this.mapWithStockItems(a,t,i,n,s)),r.push(o)}),r}getStockMenuItem(e,t,i,n,s){switch(e){case"chartEdit":return s?this.createMenuItem(this.chartTranslationService.translate("chartEdit"),"chartsMenuEdit",i):null;case"chartAdvancedSettings":return this.createMenuItem(this.chartTranslationService.translate("chartAdvancedSettings"),"chartsMenuAdvancedSettings",()=>this.chartMenuService.openAdvancedSettings(t,n));case"chartUnlink":return t.chartController.isChartLinked()?this.createMenuItem(this.chartTranslationService.translate("chartUnlink"),"unlinked",()=>this.chartMenuService.toggleLinked(t)):null;case"chartLink":return t.chartController.isChartLinked()?null:this.createMenuItem(this.chartTranslationService.translate("chartLink"),"linked",()=>this.chartMenuService.toggleLinked(t));case"chartDownload":return this.createMenuItem(this.chartTranslationService.translate("chartDownload"),"save",()=>this.chartMenuService.downloadChart(t))}return null}createMenuItem(e,t,i){return{name:e,icon:qi._.createIconNoSpan(t,this.gos,null),action:i}}destroy(){this.destroyBean(this.activeChartMenuList),super.destroy()}};fn([(0,qi.Autowired)("popupService")],Fa.prototype,"popupService",2),fn([(0,qi.Autowired)("chartMenuService")],Fa.prototype,"chartMenuService",2),fn([(0,qi.Autowired)("chartTranslationService")],Fa.prototype,"chartTranslationService",2),Fa=fn([(0,qi.Bean)("chartMenuListFactory")],Fa);var Ga=class extends qi.Component{constructor(e){super('\n            <div ref="eChartsMenu" role="presentation" class="ag-menu ag-chart-menu-popup"></div>\n        '),this.menuItems=e}init(){this.mainMenuList=this.createManagedBean(new qi.AgMenuList(0)),this.mainMenuList.addMenuItems(this.menuItems),this.mainMenuList.addEventListener(qi.AgMenuItemComponent.EVENT_CLOSE_MENU,this.onHidePopup.bind(this)),this.eChartsMenu.appendChild(this.mainMenuList.getGui())}onHidePopup(){var e;null==(e=this.hidePopupFunc)||e.call(this)}afterGuiAttached({hidePopup:e}){e&&(this.hidePopupFunc=e,this.addDestroyFunc(e)),this.focusService.focusInto(this.mainMenuList.getGui())}};fn([(0,qi.Autowired)("focusService")],Ga.prototype,"focusService",2),fn([(0,qi.RefSelector)("eChartsMenu")],Ga.prototype,"eChartsMenu",2),fn([qi.PostConstruct],Ga.prototype,"init",1);var Ba=class e extends Qi.Component{constructor(e){super(),this.chartMenuParamsFactory=e}init(){const t=this.chartMenuParamsFactory.addEnableParams("animation.enabled",{cssIdentifier:"charts-advanced-settings-top-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslationService.translate("animation"),suppressEnabledCheckbox:!0,useToggle:!0}),i=this.chartMenuParamsFactory.getDefaultNumberInputParams("animation.duration","durationMillis",{min:0});this.setTemplate(e.TEMPLATE,{animationGroup:t,animationHeightInput:i})}};Ba.TEMPLATE='<div>\n            <ag-group-component ref="animationGroup">\n                <ag-input-number-field ref="animationHeightInput"></ag-input>\n            </ag-group-component>\n        </div>',fn([(0,Qi.Autowired)("chartTranslationService")],Ba.prototype,"chartTranslationService",2),fn([Qi.PostConstruct],Ba.prototype,"init",1);var Va=Ba,Ha=class e extends Ji.Component{constructor(e){super(),this.chartMenuParamsFactory=e}init(){const t=this.chartMenuParamsFactory.addEnableParams("crosshair.enabled",{cssIdentifier:"charts-advanced-settings-top-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslationService.translate("crosshair"),suppressEnabledCheckbox:!0,useToggle:!0}),i=this.chartMenuParamsFactory.getDefaultCheckboxParams("crosshair.label.enabled","crosshairLabel"),n=this.chartMenuParamsFactory.getDefaultCheckboxParams("crosshair.snap","crosshairSnap"),s=this.chartMenuParamsFactory.getDefaultColorPickerParams("crosshair.stroke","color");this.setTemplate(e.TEMPLATE,{crosshairGroup:t,crosshairLabelCheckbox:i,crosshairSnapCheckbox:n,crosshairStrokeColorPicker:s})}};Ha.TEMPLATE='<div>\n            <ag-group-component ref="crosshairGroup">\n                <ag-checkbox ref="crosshairLabelCheckbox"></ag-checkbox>\n                <ag-checkbox ref="crosshairSnapCheckbox"></ag-checkbox>\n                <ag-color-picker ref="crosshairStrokeColorPicker"></ag-color-picker>\n            </ag-group-component>\n        </div>',fn([(0,Ji.Autowired)("chartTranslationService")],Ha.prototype,"chartTranslationService",2),fn([Ji.PostConstruct],Ha.prototype,"init",1);var Ua=Ha,za=class e extends en.Component{constructor(e){super(),this.chartMenuParamsFactory=e}init(){const t=this.chartMenuParamsFactory.addEnableParams("navigator.enabled",{cssIdentifier:"charts-advanced-settings-top-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslationService.translate("navigator"),suppressEnabledCheckbox:!0,useToggle:!0}),i=this.chartMenuParamsFactory.getDefaultSliderParams("navigator.height","height",60);i.minValue=10;const n=this.chartMenuParamsFactory.getDefaultCheckboxParams("navigator.miniChart.enabled","miniChart");this.setTemplate(e.TEMPLATE,{navigatorGroup:t,navigatorHeightSlider:i,navigatorMiniChartCheckbox:n})}};za.TEMPLATE='<div>\n            <ag-group-component ref="navigatorGroup">\n                <ag-slider ref="navigatorHeightSlider"></ag-slider>\n                <ag-checkbox ref="navigatorMiniChartCheckbox"></ag-checkbox>\n            </ag-group-component>\n        </div>',fn([(0,en.Autowired)("chartTranslationService")],za.prototype,"chartTranslationService",2),fn([en.PostConstruct],za.prototype,"init",1);var Wa=za,ja=class e extends tn.Component{constructor(e){super(),this.chartMenuParamsFactory=e}init(){const t=this.chartMenuParamsFactory.addEnableParams("zoom.enabled",{cssIdentifier:"charts-advanced-settings-top-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslationService.translate("zoom"),suppressEnabledCheckbox:!0,useToggle:!0}),i=this.chartMenuParamsFactory.getDefaultCheckboxParams("zoom.enableScrolling","scrollingZoom"),n=this.chartMenuParamsFactory.getDefaultSliderParams("zoom.scrollingStep","scrollingStep",1);n.step=.01,n.minValue=n.step;const s=this.chartMenuParamsFactory.getDefaultCheckboxParams("zoom.enableSelecting","selectingZoom");i.onValueChange=(e=>t=>{e&&(e(t),this.zoomScrollingStepInput.setDisabled(!t))})(i.onValueChange),this.setTemplate(e.TEMPLATE,{zoomGroup:t,zoomScrollingCheckbox:i,zoomScrollingStepInput:n,zoomSelectingCheckbox:s}),this.zoomScrollingStepInput.setDisabled(!i.value)}};ja.TEMPLATE='<div>\n            <ag-group-component ref="zoomGroup">\n                <ag-checkbox ref="zoomSelectingCheckbox"></ag-checkbox>\n                <ag-checkbox ref="zoomScrollingCheckbox"></ag-checkbox>\n                <ag-slider ref="zoomScrollingStepInput"></ag-slider>\n            </ag-group-component>\n        </div>',fn([(0,tn.Autowired)("chartTranslationService")],ja.prototype,"chartTranslationService",2),fn([(0,tn.RefSelector)("zoomScrollingStepInput")],ja.prototype,"zoomScrollingStepInput",2),fn([tn.PostConstruct],ja.prototype,"init",1);var $a=ja,Ka=["navigator","zoom","animation","crosshair"],Ya=class e extends Zi.Component{constructor(t){super(e.TEMPLATE),this.chartMenuContext=t}postConstruct(){this.chartPanelFeature=this.createManagedBean(new gr(this.chartMenuContext.chartController,this.getGui(),"ag-chart-advanced-settings-section",(e,t)=>this.createPanels(e,t))),this.chartPanelFeature.refreshPanels()}createPanels(e,t){Ka.forEach(e=>{if(!this.isGroupPanelShownForSeries(e,t))return;const i=this.createPanel(e);this.chartPanelFeature.addComponent(i)})}isGroupPanelShownForSeries(e,t){return"animation"===e||An(t)}createPanel(e){const{chartMenuParamsFactory:t,chartAxisMenuParamsFactory:i}=this.chartMenuContext;switch(e){case"navigator":return new Wa(t);case"zoom":return new $a(t);case"animation":return new Va(t);case"crosshair":return new Ua(i)}}};Ya.TEMPLATE='<div class="ag-chart-advanced-settings-wrapper"></div>',fn([Zi.PostConstruct],Ya.prototype,"postConstruct",1);var qa=Ya,Xa=class extends Xi.BeanStub{showMenu(e,t){this.hideMenu();const i=this.createBean(new Qa(e));this.activeDialog=this.createBean(new Xi.AgDialog({title:this.chartTranslationService.translate("advancedSettings"),component:i,width:300,height:400,resizable:!0,movable:!0,centered:!0,closable:!0,afterGuiAttached:()=>{var e;null==(e=this.focusService.findFocusableElements(i.getGui())[0])||e.focus()},closedCallback:()=>{this.activeMenu=this.destroyBean(this.activeMenu),this.activeDialog=void 0,null==t||t.focus({preventScroll:!0})}})),this.activeMenu=i}hideMenu(){this.activeDialog&&this.destroyBean(this.activeDialog)}destroy(){this.activeMenu=this.destroyBean(this.activeMenu),this.activeDialog=this.destroyBean(this.activeDialog),super.destroy()}};fn([(0,Xi.Autowired)("focusService")],Xa.prototype,"focusService",2),fn([(0,Xi.Autowired)("chartTranslationService")],Xa.prototype,"chartTranslationService",2),Xa=fn([(0,Xi.Bean)("advancedSettingsMenuFactory")],Xa);var Za=class e extends Xi.TabGuardComp{constructor(t){super(e.TEMPLATE),this.chartMenuContext=t}postConstruct(){this.advancedSettingsPanel=this.createManagedBean(new qa(this.chartMenuContext)),this.getGui().appendChild(this.advancedSettingsPanel.getGui()),this.initialiseTabGuard({onTabKeyDown:this.onTabKeyDown.bind(this),focusTrapActive:!0})}onTabKeyDown(e){if(e.defaultPrevented)return;e.preventDefault();const t=e.shiftKey,i=this.advancedSettingsPanel.getGui(),n=this.focusService.findNextFocusableElement(i,!1,t);if(n)n.focus();else{const e=this.focusService.findFocusableElements(i);e.length&&e[t?e.length-1:0].focus()}}};Za.TEMPLATE='<div class="ag-chart-advanced-settings"></div>',fn([(0,Xi.Autowired)("focusService")],Za.prototype,"focusService",2),fn([Xi.PostConstruct],Za.prototype,"postConstruct",1);var Qa=Za,Ja={version:oa,validate:()=>function({gridVersion:e,chartsVersion:t}){if(!Na(t))return{isValid:!1,message:Oa({type:"invalidCharts",gridVersion:e,chartsVersion:t})};if(!Na(e))return{isValid:!1,message:Oa({type:"invalidGrid",gridVersion:e,chartsVersion:t})};const[i,n]=e.split(".")||[],[s,r,o]=t.split(".")||[],a=function({gridMajorVersion:e,chartsMajorVersion:t}){const i=parseInt(e,10)-28;return i===parseInt(t,10)-6&&i>=0}({gridMajorVersion:i,chartsMajorVersion:s});return a&&n===r||o.includes("beta")?{isValid:!0}:a&&n===r?{isValid:!1,message:Oa({type:"invalid",gridVersion:e,chartsVersion:t})}:{isValid:!1,message:Oa({type:"incompatible",gridVersion:e,chartsVersion:t})}}({gridVersion:oa,chartsVersion:Pa.CHARTS_VERSION}),moduleName:Be.ModuleNames.GridChartsModule,beans:[Pa,_a,La,Fa,Jo,Xa],agStackComponents:[{componentName:"AgColorPicker",componentClass:Zs},{componentName:"AgAngleSelect",componentClass:ks},{componentName:"AgPillSelect",componentClass:as}],dependantModules:[ut,D]},el=0,tl={time:nn.time,AgChart:nn.AgChart},il=i(98092),nl=i(98092),sl=i(98092),rl=Object.defineProperty,ol=Object.getOwnPropertyDescriptor,al=(e,t,i,n)=>{for(var s,r=n>1?void 0:n?ol(t,i):t,o=e.length-1;o>=0;o--)(s=e[o])&&(r=(n?s(t,i,r):s(r))||r);return n&&r&&rl(t,i,r),r},ll="paste",cl="dragCopy",hl="clipboard",ul=e=>`AG Grid: Unable to use the Clipboard API (navigator.clipboard.${e}()). The reason why it could not be used has been logged in the previous line. For this reason the grid has defaulted to using a workaround which doesn't perform as well. Either fix why Clipboard API is blocked, OR stop this message from appearing by setting grid property suppressClipboardApi=true (which will default the grid to using the workaround rather than the API.`,dl=class extends sl.BeanStub{constructor(){super(...arguments),this.lastPasteOperationTime=0,this.navigatorApiFailed=!1}init(){this.logger=this.loggerFactory.create("ClipboardService"),"clientSide"===this.rowModel.getType()&&(this.clientSideRowModel=this.rowModel),this.ctrlsService.whenReady(e=>{this.gridCtrl=e.gridCtrl})}pasteFromClipboard(){this.logger.log("pasteFromClipboard"),!this.gos.get("suppressClipboardApi")&&!this.navigatorApiFailed&&navigator.clipboard&&navigator.clipboard.readText?navigator.clipboard.readText().then(this.processClipboardData.bind(this)).catch(e=>{sl._.doOnce(()=>{console.warn(e),console.warn(ul("readText"))},"clipboardApiError"),this.navigatorApiFailed=!0,this.pasteFromClipboardLegacy()}):this.pasteFromClipboardLegacy()}pasteFromClipboardLegacy(){let e=!1;const t=t=>{const i=(new Date).getTime();i-this.lastPasteOperationTime<50&&(e=!0,t.preventDefault()),this.lastPasteOperationTime=i};this.executeOnTempElement(e=>{e.addEventListener("paste",t),e.focus({preventScroll:!0})},i=>{const n=i.value;e?this.refocusLastFocusedCell():this.processClipboardData(n),i.removeEventListener("paste",t)})}refocusLastFocusedCell(){const e=this.focusService.getFocusedCell();e&&this.focusService.setFocusedCell({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0})}getClipboardDelimiter(){const e=this.gos.get("clipboardDelimiter");return sl._.exists(e)?e:"\t"}processClipboardData(e){if(null==e)return;let t=dl.stringToArray(e,this.getClipboardDelimiter());const i=this.gos.getCallback("processDataFromClipboard");i&&(t=i({data:t})),null!=t&&(this.gos.get("suppressLastEmptyLineOnPaste")&&this.removeLastLineIfBlank(t),this.doPasteOperation((e,i,n,s)=>{var r;(null==(r=this.rangeService)?void 0:r.isMoreThanOneCell())&&!this.hasOnlyOneValueToPaste(t)?this.pasteIntoActiveRange(this.rangeService,t,e,i,s):this.pasteStartingFromFocusedCell(t,e,i,n,s)}))}static stringToArray(e,t=","){const i=[],n=e=>"\r"===e||"\n"===e;let s=!1;if(""===e)return[[""]];for(let r=0,o=0,a=0;a<e.length;a++){const l=e[a-1],c=e[a],h=e[a+1],u=()=>{i[r]||(i[r]=[]),i[r][o]||(i[r][o]="")};if(u(),'"'===c&&(s?'"'===h?(i[r][o]+='"',a++):s=!1:(void 0===l||l===t||n(l))&&(s=!0)),!s&&'"'!==c){if(c===t){o++,u();continue}if(n(c)){o=0,r++,u(),"\r"===c&&"\n"===h&&a++;continue}}i[r][o]+=c}return i}doPasteOperation(e){const t="clipboard";let i;if(this.eventService.dispatchEvent({type:sl.Events.EVENT_PASTE_START,source:t}),this.clientSideRowModel){const e=this.gos.get("aggregateOnlyChangedColumns");i=new sl.ChangedPath(e,this.clientSideRowModel.getRootNode())}const n={},s=[];e(n,s,this.focusService.getFocusedCell(),i);const r=[...s];i&&(this.clientSideRowModel.doAggregate(i),i.forEachChangedNodeDepthFirst(e=>{r.push(e)})),this.rowRenderer.refreshCells({rowNodes:r}),this.dispatchFlashCells(n),this.fireRowChanged(s),this.refocusLastFocusedCell();const o={type:sl.Events.EVENT_PASTE_END,source:t};this.eventService.dispatchEvent(o)}pasteIntoActiveRange(e,t,i,n,s){const r=this.getRangeSize(e)%t.length!=0;let o=0,a=0;this.iterateActiveRanges(!1,(e,l,c,h)=>{if(h-o>=t.length){if(r)return;o+=a,a=0}const u=t[h-o];n.push(l);const d=this.gos.getCallback("processCellFromClipboard");c.forEach((t,n)=>{if(!t.isCellEditable(l)||t.isSuppressPaste(l))return;n>=u.length&&(n%=u.length);const r=this.processCell(l,t,u[n],cl,d,!0);l.setDataValue(t,r,ll),s&&s.addParentNode(l.parent,[t]);const{rowIndex:o,rowPinned:a}=e,c=this.cellPositionUtils.createIdFromValues({rowIndex:o,column:t,rowPinned:a});i[c]=!0}),a++})}getDisplayedColumnsStartingAt(e){let t=e;const i=[];for(;null!=t;)i.push(t),t=this.columnModel.getDisplayedColAfter(t);return i}pasteStartingFromFocusedCell(e,t,i,n,s){if(!n)return;const r={rowIndex:n.rowIndex,rowPinned:n.rowPinned},o=this.getDisplayedColumnsStartingAt(n.column);this.isPasteSingleValueIntoRange(e)?this.pasteSingleValueIntoRange(e,i,t,s):this.pasteMultipleValues(e,r,i,o,t,hl,s)}isPasteSingleValueIntoRange(e){return this.hasOnlyOneValueToPaste(e)&&null!=this.rangeService&&!this.rangeService.isEmpty()}pasteSingleValueIntoRange(e,t,i,n){const s=e[0][0];this.iterateActiveRanges(!1,(e,r,o)=>{t.push(r),o.forEach(e=>this.updateCellValue(r,e,s,i,hl,n))})}hasOnlyOneValueToPaste(e){return 1===e.length&&1===e[0].length}copyRangeDown(){if(!this.rangeService||this.rangeService.isEmpty())return;const e=[];this.doPasteOperation((t,i,n,s)=>{const r=this.gos.getCallback("processCellForClipboard"),o=this.gos.getCallback("processCellFromClipboard");this.iterateActiveRanges(!0,(n,a,l)=>{e.length?(i.push(a),l.forEach((i,r)=>{if(!i.isCellEditable(a)||i.isSuppressPaste(a))return;const l=this.processCell(a,i,e[r],cl,o,!0);a.setDataValue(i,l,ll),s&&s.addParentNode(a.parent,[i]);const{rowIndex:c,rowPinned:h}=n,u=this.cellPositionUtils.createIdFromValues({rowIndex:c,column:i,rowPinned:h});t[u]=!0})):l.forEach(t=>{const i=this.processCell(a,t,this.valueService.getValue(t,a),cl,r,!1,!0);e.push(i)})})})}removeLastLineIfBlank(e){const t=sl._.last(e);if(t&&1===t.length&&""===t[0]){if(1===e.length)return;sl._.removeFromArray(e,t)}}fireRowChanged(e){"fullRow"===this.gos.get("editType")&&e.forEach(e=>{const t={type:sl.Events.EVENT_ROW_VALUE_CHANGED,node:e,data:e.data,rowIndex:e.rowIndex,rowPinned:e.rowPinned};this.eventService.dispatchEvent(t)})}pasteMultipleValues(e,t,i,n,s,r,o){let a=t;const l=null!=this.clientSideRowModel&&!this.gos.get("enableGroupEdit")&&!this.gos.get("treeData"),c=()=>{for(;;){if(!a)return null;const e=this.rowPositionUtils.getRowNode(a);if(a=this.cellNavigationService.getRowBelow({rowPinned:a.rowPinned,rowIndex:a.rowIndex}),null==e)return null;if(!(e.detail||e.footer||l&&e.group))return e}};e.forEach(e=>{const t=c();t&&(e.forEach((e,i)=>this.updateCellValue(t,n[i],e,s,r,o)),i.push(t))})}updateCellValue(e,t,i,n,s,r){if(!e||!t||!t.isCellEditable(e)||t.isSuppressPaste(e))return;if(e.group&&t.isValueActive())return;const o=this.processCell(e,t,i,s,this.gos.getCallback("processCellFromClipboard"),!0);e.setDataValue(t,o,ll);const{rowIndex:a,rowPinned:l}=e;n[this.cellPositionUtils.createIdFromValues({rowIndex:a,column:t,rowPinned:l})]=!0,r&&r.addParentNode(e.parent,[t])}copyToClipboard(e={}){this.copyOrCutToClipboard(e)}cutToClipboard(e={},t="api"){if(this.gos.get("suppressCutToClipboard"))return;const i={type:sl.Events.EVENT_CUT_START,source:t};this.eventService.dispatchEvent(i),this.copyOrCutToClipboard(e,!0);const n={type:sl.Events.EVENT_CUT_END,source:t};this.eventService.dispatchEvent(n)}copyOrCutToClipboard(e,t){let{includeHeaders:i,includeGroupHeaders:n}=e;this.logger.log(`copyToClipboard: includeHeaders = ${i}`),null==i&&(i=this.gos.get("copyHeadersToClipboard")),null==n&&(n=this.gos.get("copyGroupHeadersToClipboard"));const s={includeHeaders:i,includeGroupHeaders:n},r=!this.gos.get("suppressCopyRowsToClipboard");let o=null;!this.rangeService||this.rangeService.isEmpty()||this.shouldSkipSingleCellRange(this.rangeService)?r&&!this.selectionService.isEmpty()?(this.copySelectedRowsToClipboard(s),o=1):this.focusService.isAnyCellFocused()&&(this.copyFocusedCellToClipboard(s),o=2):(this.copySelectedRangeToClipboard(s),o=0),t&&null!==o&&this.clearCellsAfterCopy(o)}clearCellsAfterCopy(e){if(this.eventService.dispatchEvent({type:sl.Events.EVENT_KEY_SHORTCUT_CHANGED_CELL_START}),0===e)this.rangeService.clearCellRangeCellValues({cellEventSource:"clipboardService"});else if(1===e)this.clearSelectedRows();else{const e=this.focusService.getFocusedCell();if(null==e)return;const t=this.rowPositionUtils.getRowNode(e);t&&this.clearCellValue(t,e.column)}this.eventService.dispatchEvent({type:sl.Events.EVENT_KEY_SHORTCUT_CHANGED_CELL_END})}clearSelectedRows(){const e=this.selectionService.getSelectedNodes(),t=this.columnModel.getAllDisplayedColumns();for(const i of e)for(const e of t)this.clearCellValue(i,e)}clearCellValue(e,t){var i;if(!t.isCellEditable(e))return;const n=null!=(i=this.valueService.parseValue(t,e,"",e.getValueFromValueService(t)))?i:null;e.setDataValue(t,n,"clipboardService")}shouldSkipSingleCellRange(e){return this.gos.get("suppressCopySingleCellRanges")&&!e.isMoreThanOneCell()}iterateActiveRanges(e,t,i){if(!this.rangeService||this.rangeService.isEmpty())return;const n=this.rangeService.getCellRanges();e?this.iterateActiveRange(n[0],t,i,!0):n.forEach((e,s)=>this.iterateActiveRange(e,t,i,s===n.length-1))}iterateActiveRange(e,t,i,n){if(!this.rangeService)return;let s=this.rangeService.getRangeStartRow(e);const r=this.rangeService.getRangeEndRow(e);i&&e.columns&&i(e.columns);let o=0,a=!1;for(;!a&&null!=s;){const i=this.rowPositionUtils.getRowNode(s);a=this.rowPositionUtils.sameRow(s,r),t(s,i,e.columns,o++,a&&n),s=this.cellNavigationService.getRowBelow(s)}}copySelectedRangeToClipboard(e={}){if(!this.rangeService||this.rangeService.isEmpty())return;const t=this.rangeService.areAllRangesAbleToMerge(),{data:i,cellsToFlash:n}=t?this.buildDataFromMergedRanges(this.rangeService,e):this.buildDataFromRanges(this.rangeService,e);this.copyDataToClipboard(i),this.dispatchFlashCells(n)}buildDataFromMergedRanges(e,t){const i=new Set,n=e.getCellRanges(),s=new Map,r=[],o={};n.forEach(t=>{t.columns.forEach(e=>i.add(e));const{rowPositions:n,cellsToFlash:a}=this.getRangeRowPositionsAndCellsToFlash(e,t);n.forEach(e=>{const t=`${e.rowIndex}-${e.rowPinned||"null"}`;s.get(t)||(s.set(t,!0),r.push(e))}),Object.assign(o,a)});const a=this.columnModel.getAllDisplayedColumns(),l=Array.from(i);return l.sort((e,t)=>a.indexOf(e)-a.indexOf(t)),{data:this.buildExportParams({columns:l,rowPositions:r,includeHeaders:t.includeHeaders,includeGroupHeaders:t.includeGroupHeaders}),cellsToFlash:o}}buildDataFromRanges(e,t){const i=e.getCellRanges(),n=[],s={};return i.forEach(i=>{const{rowPositions:r,cellsToFlash:o}=this.getRangeRowPositionsAndCellsToFlash(e,i);Object.assign(s,o),n.push(this.buildExportParams({columns:i.columns,rowPositions:r,includeHeaders:t.includeHeaders,includeGroupHeaders:t.includeGroupHeaders}))}),{data:n.join("\n"),cellsToFlash:s}}getRangeRowPositionsAndCellsToFlash(e,t){const i=[],n={},s=e.getRangeStartRow(t),r=e.getRangeEndRow(t);let o=s;for(;o&&(i.push(o),t.columns.forEach(e=>{const{rowIndex:t,rowPinned:i}=o,s=this.cellPositionUtils.createIdFromValues({rowIndex:t,column:e,rowPinned:i});n[s]=!0}),!this.rowPositionUtils.sameRow(o,r));)o=this.cellNavigationService.getRowBelow(o);return{rowPositions:i,cellsToFlash:n}}getCellsToFlashFromRowNodes(e){const t=this.columnModel.getAllDisplayedColumns(),i={};for(let n=0;n<e.length;n++){const{rowIndex:s,rowPinned:r}=e[n];if(null!=s)for(let e=0;e<t.length;e++){const n=t[e];i[this.cellPositionUtils.createIdFromValues({rowIndex:s,column:n,rowPinned:r})]=!0}}return i}copyFocusedCellToClipboard(e={}){const t=this.focusService.getFocusedCell();if(null==t)return;const i=this.cellPositionUtils.createId(t),n={rowPinned:t.rowPinned,rowIndex:t.rowIndex},s=t.column,r=this.buildExportParams({columns:[s],rowPositions:[n],includeHeaders:e.includeHeaders,includeGroupHeaders:e.includeGroupHeaders});this.copyDataToClipboard(r),this.dispatchFlashCells({[i]:!0})}copySelectedRowsToClipboard(e={}){const{columnKeys:t,includeHeaders:i,includeGroupHeaders:n}=e,s=this.buildExportParams({columns:t,includeHeaders:i,includeGroupHeaders:n});this.copyDataToClipboard(s);const r=this.selectionService.getSelectedNodes()||[];this.dispatchFlashCells(this.getCellsToFlashFromRowNodes(r))}buildExportParams(e){const{columns:t,rowPositions:i,includeHeaders:n=!1,includeGroupHeaders:s=!1}=e,r={columnKeys:t,rowPositions:i,skipColumnHeaders:!n,skipColumnGroupHeaders:!s,suppressQuotes:!0,columnSeparator:this.getClipboardDelimiter(),onlySelected:!i,processCellCallback:this.gos.getCallback("processCellForClipboard"),processRowGroupCallback:e=>this.processRowGroupCallback(e),processHeaderCallback:this.gos.getCallback("processHeaderForClipboard"),processGroupHeaderCallback:this.gos.getCallback("processGroupHeaderForClipboard")};return this.csvCreator.getDataAsCsv(r,!0)}processRowGroupCallback(e){const{node:t,column:i}=e,n=this.gos.get("treeData"),s=this.gos.get("suppressGroupMaintainValueType");let r=(()=>{var e,r;if(n||s||!i)return t.key;const o=null==(e=t.groupData)?void 0:e[i.getId()];return o&&t.rowGroupColumn&&!1!==t.rowGroupColumn.getColDef().useValueFormatterForExport&&null!=(r=this.valueService.formatValue(t.rowGroupColumn,t,o))?r:o})();if(e.node.footer){let e="";r&&r.length&&(e=` ${r}`),r=`Total${e}`}const o=this.gos.getCallback("processCellForClipboard");if(o){let e=t.rowGroupColumn;return!e&&t.footer&&-1===t.level&&(e=this.columnModel.getRowGroupColumns()[0]),o({value:r,node:t,column:e,type:"clipboard",formatValue:i=>{var n;return null!=(n=this.valueService.formatValue(e,t,i))?n:i},parseValue:i=>this.valueService.parseValue(e,t,i,this.valueService.getValue(e,t))})}return r}dispatchFlashCells(e){window.setTimeout(()=>{const t={type:sl.Events.EVENT_FLASH_CELLS,cells:e};this.eventService.dispatchEvent(t)},0)}processCell(e,t,i,n,s,r,o){var a;return s?s({column:t,node:e,value:i,type:n,formatValue:i=>{var n;return null!=(n=this.valueService.formatValue(t,null!=e?e:null,i))?n:i},parseValue:i=>this.valueService.parseValue(t,null!=e?e:null,i,this.valueService.getValue(t,e))}):r&&!1!==t.getColDef().useValueParserForImport?this.valueService.parseValue(t,null!=e?e:null,i,this.valueService.getValue(t,e)):o&&!1!==t.getColDef().useValueFormatterForExport&&null!=(a=this.valueService.formatValue(t,null!=e?e:null,i))?a:i}copyDataToClipboard(e){const t=this.gos.getCallback("sendToClipboard");t?t({data:e}):!this.gos.get("suppressClipboardApi")&&navigator.clipboard?navigator.clipboard.writeText(e).catch(t=>{sl._.doOnce(()=>{console.warn(t),console.warn(ul("writeText"))},"clipboardApiError"),this.copyDataToClipboardLegacy(e)}):this.copyDataToClipboardLegacy(e)}copyDataToClipboardLegacy(e){this.executeOnTempElement(t=>{const i=this.gos.getDocument(),n=this.gos.getActiveDomElement();t.value=e||" ",t.select(),t.focus({preventScroll:!0}),i.execCommand("copy")||console.warn("AG Grid: Browser did not allow document.execCommand('copy'). Ensure api.copySelectedRowsToClipboard() is invoked via a user event, i.e. button click, otherwise the browser will prevent it for security reasons."),null!=n&&null!=n.focus&&n.focus({preventScroll:!0})})}executeOnTempElement(e,t){const i=this.gos.getDocument(),n=i.createElement("textarea");n.style.width="1px",n.style.height="1px",n.style.top=i.documentElement.scrollTop+"px",n.style.left=i.documentElement.scrollLeft+"px",n.style.position="absolute",n.style.opacity="0";const s=this.gridCtrl.getGui();s.appendChild(n);try{e(n)}catch(e){console.warn("AG Grid: Browser does not support document.execCommand('copy') for clipboard operations")}t?window.setTimeout(()=>{t(n),s.removeChild(n)},100):s.removeChild(n)}getRangeSize(e){const t=e.getCellRanges();let i=0,n=0;return t.length>0&&(i=e.getRangeStartRow(t[0]).rowIndex,n=e.getRangeEndRow(t[0]).rowIndex),i-n+1}};al([(0,sl.Autowired)("csvCreator")],dl.prototype,"csvCreator",2),al([(0,sl.Autowired)("loggerFactory")],dl.prototype,"loggerFactory",2),al([(0,sl.Autowired)("selectionService")],dl.prototype,"selectionService",2),al([(0,sl.Autowired)("rowModel")],dl.prototype,"rowModel",2),al([(0,sl.Autowired)("ctrlsService")],dl.prototype,"ctrlsService",2),al([(0,sl.Autowired)("valueService")],dl.prototype,"valueService",2),al([(0,sl.Autowired)("focusService")],dl.prototype,"focusService",2),al([(0,sl.Autowired)("rowRenderer")],dl.prototype,"rowRenderer",2),al([(0,sl.Autowired)("columnModel")],dl.prototype,"columnModel",2),al([(0,sl.Autowired)("cellNavigationService")],dl.prototype,"cellNavigationService",2),al([(0,sl.Autowired)("cellPositionUtils")],dl.prototype,"cellPositionUtils",2),al([(0,sl.Autowired)("rowPositionUtils")],dl.prototype,"rowPositionUtils",2),al([(0,sl.Optional)("rangeService")],dl.prototype,"rangeService",2),al([sl.PostConstruct],dl.prototype,"init",1),dl=al([(0,sl.Bean)("clipboardService")],dl);var pl={version:"31.3.4",moduleName:il.ModuleNames.ClipboardModule,beans:[dl],dependantModules:[D,nl.CsvExportModule]},gl=i(98092),fl=i(98092),ml=i(98092),yl=i(98092),vl=i(98092),bl=i(98092),Cl=i(98092),wl=i(98092),Sl=i(98092),xl=i(98092),El=i(98092),Al=i(98092),Ml=i(98092),Tl=i(98092),Dl=i(98092),Il=i(98092),Rl=i(98092),kl=i(98092),Pl=i(98092),_l=i(98092),Ll=i(98092),Nl=i(98092),Ol=i(98092),Fl=i(98092),Gl=i(98092),Bl=Object.defineProperty,Vl=Object.defineProperties,Hl=Object.getOwnPropertyDescriptor,Ul=Object.getOwnPropertyDescriptors,zl=Object.getOwnPropertySymbols,Wl=Object.prototype.hasOwnProperty,jl=Object.prototype.propertyIsEnumerable,$l=(e,t,i)=>t in e?Bl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Kl=(e,t,i,n)=>{for(var s,r=n>1?void 0:n?Hl(t,i):t,o=e.length-1;o>=0;o--)(s=e[o])&&(r=(n?s(t,i,r):s(r))||r);return n&&r&&Bl(t,i,r),r},Yl=class extends Al.BeanStub{execute(e){const t=Al._.missingOrEmpty(this.columnModel.getValueColumns()),i=!this.gos.getCallback("getGroupRowAgg"),n=e.changedPath&&e.changedPath.isActive();if(t&&i&&n)return;const s=this.createAggDetails(e);this.recursivelyCreateAggData(s)}createAggDetails(e){const t=this.columnModel.isPivotActive(),i=this.columnModel.getValueColumns(),n=t?this.columnModel.getPivotColumns():[];return{alwaysAggregateAtRootLevel:this.gos.get("alwaysAggregateAtRootLevel"),groupIncludeTotalFooter:!!this.gos.getGrandTotalRow(),changedPath:e.changedPath,valueColumns:i,pivotColumns:n,filteredOnly:!this.isSuppressAggFilteredOnly(),userAggFunc:this.gos.getCallback("getGroupRowAgg")}}isSuppressAggFilteredOnly(){return void 0!==this.gos.getGroupAggFiltering()||this.gos.get("suppressAggFilteredOnly")}recursivelyCreateAggData(e){e.changedPath.forEachChangedNodeDepthFirst(t=>{if(t.hasChildren()){if(-1===t.level&&!e.groupIncludeTotalFooter){const i=!this.columnModel.isPivotMode();if(!e.alwaysAggregateAtRootLevel&&i)return void t.setAggData(null)}this.aggregateRowNode(t,e)}else t.aggData&&t.setAggData(null)},!0)}aggregateRowNode(e,t){const i=0===t.valueColumns.length,n=0===t.pivotColumns.length;let s;s=t.userAggFunc?t.userAggFunc({nodes:e.childrenAfterFilter}):i?null:n?this.aggregateRowNodeUsingValuesOnly(e,t):this.aggregateRowNodeUsingValuesAndPivot(e),e.setAggData(s),e.sibling&&e.sibling.setAggData(s)}aggregateRowNodeUsingValuesAndPivot(e){var t,i;const n={},s=null!=(t=this.columnModel.getSecondaryColumns())?t:[];let r=!0;for(let t=0;t<s.length;t++){const o=s[t],a=o.getColDef();if(null!=a.pivotTotalColumnIds){r=!1;continue}const l=null!=(i=a.pivotKeys)?i:[];let c;c=e.leafGroup?this.getValuesFromMappedSet(e.childrenMapped,l,a.pivotValueColumn):this.getValuesPivotNonLeaf(e,a.colId),n[a.colId]=this.aggregateValues(c,a.pivotValueColumn.getAggFunc(),a.pivotValueColumn,e,o)}if(!r)for(let t=0;t<s.length;t++){const i=s[t],r=i.getColDef();if(null==r.pivotTotalColumnIds||!r.pivotTotalColumnIds.length)continue;const o=r.pivotTotalColumnIds.map(e=>n[e]);n[r.colId]=this.aggregateValues(o,r.pivotValueColumn.getAggFunc(),r.pivotValueColumn,e,i)}return n}aggregateRowNodeUsingValuesOnly(e,t){const i={},n=t.changedPath.isActive()?t.changedPath.getValueColumnsForNode(e,t.valueColumns):t.valueColumns,s=t.changedPath.isActive()?t.changedPath.getNotValueColumnsForNode(e,t.valueColumns):null,r=this.getValuesNormal(e,n,t.filteredOnly),o=e.aggData;return n.forEach((t,n)=>{i[t.getId()]=this.aggregateValues(r[n],t.getAggFunc(),t,e)}),s&&o&&s.forEach(e=>{i[e.getId()]=o[e.getId()]}),i}getValuesPivotNonLeaf(e,t){return e.childrenAfterFilter.map(e=>e.aggData[t])}getValuesFromMappedSet(e,t,i){let n=e;for(let e=0;e<t.length;e++){const i=t[e];n=n?n[i]:null}return n?n.map(e=>this.valueService.getValue(i,e)):[]}getValuesNormal(e,t,i){const n=[];t.forEach(()=>n.push([]));const s=t.length,r=i?e.childrenAfterFilter:e.childrenAfterGroup,o=r.length;for(let e=0;e<o;e++){const i=r[e];for(let e=0;e<s;e++){const s=t[e],r=this.valueService.getValue(s,i);n[e].push(r)}}return n}aggregateValues(e,t,i,n,s){const r="string"==typeof t?this.aggFuncService.getAggFunc(t):t;return"function"!=typeof r?(console.error(`AG Grid: unrecognised aggregation function ${t}`),null):r(this.gos.addGridCommonParams({values:e,column:i,colDef:i?i.getColDef():void 0,pivotResultColumn:s,rowNode:n,data:n?n.data:void 0}))}};Kl([(0,Al.Autowired)("columnModel")],Yl.prototype,"columnModel",2),Kl([(0,Al.Autowired)("valueService")],Yl.prototype,"valueService",2),Kl([(0,Al.Autowired)("aggFuncService")],Yl.prototype,"aggFuncService",2),Yl=Kl([(0,Al.Bean)("aggregationStage")],Yl);var ql=class{constructor(){this.allSets={},this.allParents=[]}removeFromChildrenAfterGroup(e,t){this.getSet(e).removeFromChildrenAfterGroup[t.id]=!0}isRemoveFromAllLeafChildren(e,t){return!!this.getSet(e).removeFromAllLeafChildren[t.id]}preventRemoveFromAllLeafChildren(e,t){delete this.getSet(e).removeFromAllLeafChildren[t.id]}removeFromAllLeafChildren(e,t){this.getSet(e).removeFromAllLeafChildren[t.id]=!0}getSet(e){return this.allSets[e.id]||(this.allSets[e.id]={removeFromAllLeafChildren:{},removeFromChildrenAfterGroup:{}},this.allParents.push(e)),this.allSets[e.id]}getAllParents(){return this.allParents}flush(){this.allParents.forEach(e=>{const t=this.allSets[e.id];e.childrenAfterGroup=e.childrenAfterGroup.filter(e=>!t.removeFromChildrenAfterGroup[e.id]),e.allLeafChildren=e.allLeafChildren.filter(e=>!t.removeFromAllLeafChildren[e.id]),e.updateHasChildren(),e.sibling&&(e.sibling.childrenAfterGroup=e.childrenAfterGroup,e.sibling.allLeafChildren=e.allLeafChildren)}),this.allSets={},this.allParents.length=0}},Xl=class extends Ml.BeanStub{execute(e){const t=this.createGroupingDetails(e);if(t.transactions)this.handleTransaction(t);else{const i=!0===e.afterColumnsChanged;this.shotgunResetEverything(t,i)}t.usingTreeData||(this.positionLeafsAndGroups(e.changedPath),this.orderGroups(t)),this.selectableService.updateSelectableAfterGrouping()}positionLeafsAndGroups(e){e.forEachChangedNodeDepthFirst(e=>{if(e.childrenAfterGroup){const t=[],i=[];let n;e.childrenAfterGroup.forEach(e=>{var s;(null==(s=e.childrenAfterGroup)?void 0:s.length)?""!==e.key||n?i.push(e):n=e:t.push(e)}),n&&i.push(n),e.childrenAfterGroup=[...t,...i]}},!1)}createGroupingDetails(e){var t;const{rowNode:i,changedPath:n,rowNodeTransactions:s,rowNodeOrder:r}=e,o=this.gos.get("treeData"),a=o?null:this.columnModel.getRowGroupColumns();return{includeParents:!this.gos.get("suppressParentsInRowNodes"),expandByDefault:this.gos.get("groupDefaultExpanded"),groupedCols:a,rootNode:i,pivotMode:this.columnModel.isPivotMode(),groupedColCount:o||!a?0:a.length,rowNodeOrder:r,transactions:s,changedPath:n,groupAllowUnbalanced:this.gos.get("groupAllowUnbalanced"),isGroupOpenByDefault:this.gos.getCallback("isGroupOpenByDefault"),initialGroupOrderComparator:this.gos.getCallback("initialGroupOrderComparator"),usingTreeData:o,suppressGroupMaintainValueType:this.gos.get("suppressGroupMaintainValueType"),getDataPath:o?this.gos.get("getDataPath"):void 0,keyCreators:null!=(t=null==a?void 0:a.map(e=>e.getColDef().keyCreator))?t:[]}}handleTransaction(e){e.transactions.forEach(t=>{const i=e.usingTreeData?void 0:new ql;if(Ml._.existsAndNotEmpty(t.remove)&&this.removeNodes(t.remove,e,i),Ml._.existsAndNotEmpty(t.update)&&this.moveNodesInWrongPath(t.update,e,i),Ml._.existsAndNotEmpty(t.add)&&this.insertNodes(t.add,e,!1),i){const t=i.getAllParents().slice();i.flush(),this.removeEmptyGroups(t,e)}}),e.rowNodeOrder&&this.sortChildren(e)}sortChildren(e){e.changedPath.forEachChangedNodeDepthFirst(t=>{t.childrenAfterGroup&&Ml._.sortRowNodesByOrder(t.childrenAfterGroup,e.rowNodeOrder)&&e.changedPath.addParentNode(t)},!1,!0)}orderGroups(e){const t=e.initialGroupOrderComparator;Ml._.exists(t)&&function e(i){Ml._.exists(i.childrenAfterGroup)&&!i.leafGroup&&(i.childrenAfterGroup.sort((e,i)=>t({nodeA:e,nodeB:i})),i.childrenAfterGroup.forEach(t=>e(t)))}(e.rootNode)}getExistingPathForNode(e,t){const i=[];let n=t.usingTreeData?e:e.parent;for(;n&&n!==t.rootNode;)i.push({key:n.key,rowGroupColumn:n.rowGroupColumn,field:n.field}),n=n.parent;return i.reverse(),i}moveNodesInWrongPath(e,t,i){e.forEach(e=>{t.changedPath.isActive()&&t.changedPath.addParentNode(e.parent);const n=e=>e.key,s=this.getExistingPathForNode(e,t).map(n),r=this.getGroupInfo(e,t).map(n);Ml._.areEqual(s,r)||this.moveNode(e,t,i)})}moveNode(e,t,i){if(this.removeNodesInStages([e],t,i),this.insertOneNode(e,t,!0,i),e.setData(e.data),t.changedPath.isActive()){const i=e.parent;t.changedPath.addParentNode(i)}}removeNodes(e,t,i){this.removeNodesInStages(e,t,i),t.changedPath.isActive()&&e.forEach(e=>t.changedPath.addParentNode(e.parent))}removeNodesInStages(e,t,i){if(this.removeNodesFromParents(e,t,i),t.usingTreeData){this.postRemoveCreateFillerNodes(e,t);const i=e.map(e=>e.parent);this.removeEmptyGroups(i,t)}}forEachParentGroup(e,t,i){let n=t;for(;n&&n!==e.rootNode;)i(n),n=n.parent}removeNodesFromParents(e,t,i){const n=null==i,s=i||new ql;e.forEach(e=>{this.removeFromParent(e,s),this.forEachParentGroup(t,e.parent,t=>{s.removeFromAllLeafChildren(t,e)})}),n&&s.flush()}postRemoveCreateFillerNodes(e,t){e.forEach(e=>{if(e.hasChildren()){const i=this.getExistingPathForNode(e,t),n=this.findParentForNode(e,i,t);n.expanded=e.expanded,n.allLeafChildren=e.allLeafChildren,n.childrenAfterGroup=e.childrenAfterGroup,n.childrenMapped=e.childrenMapped,n.updateHasChildren(),n.childrenAfterGroup.forEach(e=>e.parent=n)}})}removeEmptyGroups(e,t){let i=!0;const n=e=>{const t=this.getChildrenMappedKey(e.key,e.rowGroupColumn),i=e.parent;return!!(i&&i.childrenMapped&&i.childrenMapped[t]&&e.isEmptyRowGroupNode())};for(;i;){i=!1;const s=new ql;e.forEach(e=>{this.forEachParentGroup(t,e,e=>{n(e)&&(i=!0,this.removeFromParent(e,s),e.setSelectedParams({newValue:!1,source:"rowGroupChanged"}))})}),s.flush()}}removeFromParent(e,t){e.parent&&(t?t.removeFromChildrenAfterGroup(e.parent,e):(Ml._.removeFromArray(e.parent.childrenAfterGroup,e),e.parent.updateHasChildren()));const i=this.getChildrenMappedKey(e.key,e.rowGroupColumn);e.parent&&e.parent.childrenMapped&&(e.parent.childrenMapped[i]=void 0),e.setRowTop(null),e.setRowIndex(null)}addToParent(e,t){const i=this.getChildrenMappedKey(e.key,e.rowGroupColumn);t&&(null!=t.childrenMapped&&(t.childrenMapped[i]=e),t.childrenAfterGroup.push(e),t.updateHasChildren())}areGroupColsEqual(e,t){return null!=e&&null!=t&&e.pivotMode===t.pivotMode&&Ml._.areEqual(e.groupedCols,t.groupedCols)&&Ml._.areEqual(e.keyCreators,t.keyCreators)}checkAllGroupDataAfterColsChanged(e){const t=i=>{i&&i.forEach(i=>{if(!e.usingTreeData&&!i.group)return;const n={field:i.field,key:i.key,rowGroupColumn:i.rowGroupColumn,leafNode:i.allLeafChildren[0]};this.setGroupData(i,n,e),t(i.childrenAfterGroup)})};t(e.rootNode.childrenAfterGroup)}shotgunResetEverything(e,t){if(this.noChangeInGroupingColumns(e,t))return;this.selectionService.filterFromSelection(e=>e&&!e.group);const{rootNode:i,groupedCols:n}=e;i.leafGroup=!e.usingTreeData&&0===n.length,i.childrenAfterGroup=[],i.childrenMapped={},i.updateHasChildren();const s=i.sibling;s&&(s.childrenAfterGroup=i.childrenAfterGroup,s.childrenMapped=i.childrenMapped),this.insertNodes(i.allLeafChildren,e,!1)}noChangeInGroupingColumns(e,t){let i=!1;const n=this.columnModel.getGroupDisplayColumns(),s=n?n.map(e=>e.getId()).join("-"):"";return t&&(i=e.usingTreeData||this.areGroupColsEqual(e,this.oldGroupingDetails),this.oldGroupDisplayColIds!==s&&this.checkAllGroupDataAfterColsChanged(e)),this.oldGroupingDetails=e,this.oldGroupDisplayColIds=s,i}insertNodes(e,t,i){e.forEach(e=>{this.insertOneNode(e,t,i),t.changedPath.isActive()&&t.changedPath.addParentNode(e.parent)})}insertOneNode(e,t,i,n){const s=this.getGroupInfo(e,t),r=this.findParentForNode(e,s,t,n);r.group||console.warn("AG Grid: duplicate group keys for row data, keys should be unique",[r.data,e.data]),t.usingTreeData?this.swapGroupWithUserNode(r,e,i):(e.parent=r,e.level=s.length,r.childrenAfterGroup.push(e),r.updateHasChildren())}findParentForNode(e,t,i,n){let s=i.rootNode;return t.forEach((t,r)=>{s=this.getOrCreateNextNode(s,t,r,i),(null==n?void 0:n.isRemoveFromAllLeafChildren(s,e))?null==n||n.preventRemoveFromAllLeafChildren(s,e):s.allLeafChildren.push(e)}),s}swapGroupWithUserNode(e,t,i){t.parent=e.parent,t.key=e.key,t.field=e.field,t.groupData=e.groupData,t.level=e.level,i||(t.expanded=e.expanded),t.leafGroup=e.leafGroup,t.rowGroupIndex=e.rowGroupIndex,t.allLeafChildren=e.allLeafChildren,t.childrenAfterGroup=e.childrenAfterGroup,t.childrenMapped=e.childrenMapped,t.sibling=e.sibling,t.updateHasChildren(),this.removeFromParent(e),t.childrenAfterGroup.forEach(e=>e.parent=t),this.addToParent(t,e.parent)}getOrCreateNextNode(e,t,i,n){const s=this.getChildrenMappedKey(t.key,t.rowGroupColumn);let r=e.childrenMapped?e.childrenMapped[s]:void 0;return r||(r=this.createGroup(t,e,i,n),this.addToParent(r,e)),r}createGroup(e,t,i,n){const s=new Ml.RowNode(this.beans);return s.group=!0,s.field=e.field,s.rowGroupColumn=e.rowGroupColumn,this.setGroupData(s,e,n),s.key=e.key,s.id=this.createGroupId(s,t,n.usingTreeData,i),s.level=i,s.leafGroup=!n.usingTreeData&&i===n.groupedColCount-1,s.allLeafChildren=[],s.setAllChildrenCount(0),s.rowGroupIndex=n.usingTreeData?null:i,s.childrenAfterGroup=[],s.childrenMapped={},s.updateHasChildren(),s.parent=n.includeParents?t:null,this.setExpandedInitialValue(n,s),s}createGroupId(e,t,i,n){let s;return s=i?(e,t,i)=>{if(i<0)return null;const n=t?s(t,t.parent,i-1):null;return`${null==n?"":n+"-"}${i}-${e.key}`}:(e,t)=>{if(!e.rowGroupColumn)return null;const i=t?s(t,t.parent,0):null;return`${null==i?"":i+"-"}${e.rowGroupColumn.getColId()}-${e.key}`},Ml.RowNode.ID_PREFIX_ROW_GROUP+s(e,t,n)}setGroupData(e,t,i){e.groupData={},this.columnModel.getGroupDisplayColumns().forEach(n=>{if(i.usingTreeData)return void(e.groupData[n.getColId()]=t.key);const s=e.rowGroupColumn;null!==s&&n.isRowGroupDisplayed(s.getId())&&(i.suppressGroupMaintainValueType?e.groupData[n.getColId()]=t.key:e.groupData[n.getColId()]=this.valueService.getValue(s,t.leafNode))})}getChildrenMappedKey(e,t){return t?t.getId()+"-"+e:e}setExpandedInitialValue(e,t){if(e.pivotMode&&t.leafGroup)return void(t.expanded=!1);const i=e.isGroupOpenByDefault;if(i){const e={rowNode:t,field:t.field,key:t.key,level:t.level,rowGroupColumn:t.rowGroupColumn};return void(t.expanded=1==i(e))}const{expandByDefault:n}=e;-1!==e.expandByDefault?t.expanded=t.level<n:t.expanded=!0}getGroupInfo(e,t){return t.usingTreeData?this.getGroupInfoFromCallback(e,t):this.getGroupInfoFromGroupColumns(e,t)}getGroupInfoFromCallback(e,t){const i=t.getDataPath?t.getDataPath(e.data):null;return null!=i&&0!==i.length||Ml._.warnOnce(`getDataPath() should not return an empty path for data ${e.data}`),i?i.map(e=>({key:e,field:null,rowGroupColumn:null})):[]}getGroupInfoFromGroupColumns(e,t){const i=[];return t.groupedCols.forEach(n=>{let s=this.valueService.getKeyForNode(n,e),r=null!=s&&""!==s;if((t.pivotMode||!t.groupAllowUnbalanced)&&!r&&(s="",r=!0),r){const t={key:s,field:n.getColDef().field,rowGroupColumn:n,leafNode:e};i.push(t)}}),i}};Kl([(0,Ml.Autowired)("columnModel")],Xl.prototype,"columnModel",2),Kl([(0,Ml.Autowired)("selectableService")],Xl.prototype,"selectableService",2),Kl([(0,Ml.Autowired)("valueService")],Xl.prototype,"valueService",2),Kl([(0,Ml.Autowired)("beans")],Xl.prototype,"beans",2),Kl([(0,Ml.Autowired)("selectionService")],Xl.prototype,"selectionService",2),Xl=Kl([(0,Ml.Bean)("groupStage")],Xl);var Zl=class extends Tl.BeanStub{init(){const e=()=>{var e;return null!=(e=this.gos.get("serverSidePivotResultFieldSeparator"))?e:"_"};this.fieldSeparator=e(),this.addManagedPropertyListener("serverSidePivotResultFieldSeparator",()=>{this.fieldSeparator=e()});const t=()=>this.gos.get("pivotDefaultExpanded");this.pivotDefaultExpanded=t(),this.addManagedPropertyListener("pivotDefaultExpanded",()=>{this.pivotDefaultExpanded=t()})}createPivotColumnDefs(e){const t=this.createPivotColumnsFromUniqueValues(e),i=function e(t,i=[]){return t.forEach(t=>{void 0!==t.children?e(t.children,i):i.push(t)}),i}(t);return this.addRowGroupTotals(t,i),this.addExpandablePivotGroups(t,i),this.addPivotTotalsToGroups(t,i),{pivotColumnGroupDefs:t,pivotColumnDefs:i.map(e=>Tl._.cloneObject(e))}}createPivotColumnsFromUniqueValues(e){const t=this.columnModel.getPivotColumns(),i=t.length;return this.recursivelyBuildGroup(0,e,[],i,t)}recursivelyBuildGroup(e,t,i,n,s){const r=this.columnModel.getValueColumns();if(e>=n)return this.buildMeasureCols(i);const o=s[e].getColDef(),a=this.headerNameComparator.bind(this,o.pivotComparator);if(1===r.length&&this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&e===n-1){const e=[];return Tl._.iterateObject(t,t=>{const n=[...i,t],s=this.createColDef(r[0],t,n);s.columnGroupShow="open",e.push(s)}),e.sort(a),e}const l=[];return Tl._.iterateObject(t,(t,r)=>{const o=-1===this.pivotDefaultExpanded||e<this.pivotDefaultExpanded,a=[...i,t];l.push({children:this.recursivelyBuildGroup(e+1,r,a,n,s),headerName:t,pivotKeys:a,columnGroupShow:"open",openByDefault:o,groupId:this.generateColumnGroupId(a)})}),l.sort(a),l}buildMeasureCols(e){const t=this.columnModel.getValueColumns();return 0===t.length?[this.createColDef(null,"-",e)]:t.map(t=>{const i=this.columnModel.getDisplayNameForColumn(t,"header");return n=((e,t)=>{for(var i in t||(t={}))Wl.call(t,i)&&$l(e,i,t[i]);if(zl)for(var i of zl(t))jl.call(t,i)&&$l(e,i,t[i]);return e})({},this.createColDef(t,i,e)),Vl(n,Ul({columnGroupShow:"open"}));var n})}addExpandablePivotGroups(e,t){if(this.gos.get("suppressExpandablePivotGroups")||this.gos.get("pivotColumnGroupTotals"))return;const i=(e,t,n)=>{const s=e;if(s.children){const r=new Map;s.children.forEach(e=>{i(e,t,r)});const o=!s.children.some(e=>e.children);this.columnModel.getValueColumns().forEach(i=>{const n=this.columnModel.getDisplayNameForColumn(i,"header"),s=this.createColDef(i,n,e.pivotKeys);s.pivotTotalColumnIds=r.get(i.getColId()),s.columnGroupShow="closed",s.aggFunc=i.getAggFunc(),o||(e.children.push(s),t.push(s))}),this.merge(n,r)}else{const t=e;if(!t.pivotValueColumn)return;const i=t.pivotValueColumn.getColId(),s=n.has(i)?n.get(i):[];s.push(t.colId),n.set(i,s)}};e.forEach(e=>{i(e,t,new Map)})}addPivotTotalsToGroups(e,t){if(!this.gos.get("pivotColumnGroupTotals"))return;const i="after"===this.gos.get("pivotColumnGroupTotals"),n=this.columnModel.getValueColumns(),s=n.map(e=>e.getAggFunc());if(!s||s.length<1||!this.sameAggFuncs(s))return;const r=n[0];e.forEach(e=>{this.recursivelyAddPivotTotal(e,t,r,i)})}recursivelyAddPivotTotal(e,t,i,n){const s=e;if(!s.children){const t=e;return t.colId?[t.colId]:null}let r=[];if(s.children.forEach(e=>{const s=this.recursivelyAddPivotTotal(e,t,i,n);s&&(r=r.concat(s))}),s.children.length>1){const s=this.localeService.getLocaleTextFunc()("pivotColumnGroupTotals","Total"),o=this.createColDef(i,s,e.pivotKeys,!0);o.pivotTotalColumnIds=r,o.aggFunc=i.getAggFunc();const a=e.children;n?a.push(o):a.unshift(o),t.push(o)}return r}addRowGroupTotals(e,t){if(!this.gos.get("pivotRowTotals"))return;const i="after"===this.gos.get("pivotRowTotals"),n=this.columnModel.getValueColumns(),s=i?n.slice():n.slice().reverse();for(let n=0;n<s.length;n++){const r=s[n];let o=[];e.forEach(e=>{o=o.concat(this.extractColIdsForValueColumn(e,r))});const a=s.length>1||!this.gos.get("removePivotHeaderRowWhenSingleValueColumn");this.createRowGroupTotal(e,t,r,o,i,a)}}extractColIdsForValueColumn(e,t){const i=e;if(!i.children){const e=i;return e.pivotValueColumn===t&&e.colId?[e.colId]:[]}let n=[];return i.children.forEach(e=>{this.extractColIdsForValueColumn(e,t);const i=this.extractColIdsForValueColumn(e,t);n=n.concat(i)}),n}createRowGroupTotal(e,t,i,n,s,r){let o;if(0===this.columnModel.getValueColumns().length)o=this.createColDef(null,"-",[]);else{const e=this.columnModel.getDisplayNameForColumn(i,"header");o=this.createColDef(i,e,[]),o.pivotTotalColumnIds=n}o.colId=Zl.PIVOT_ROW_TOTAL_PREFIX+o.colId,t.push(o);const a=r?{children:[o],pivotKeys:[],groupId:`${Zl.PIVOT_ROW_TOTAL_PREFIX}_pivotGroup_${i.getColId()}`}:o;s?e.push(a):e.unshift(a)}createColDef(e,t,i,n=!1){const s={};if(e){const t=e.getColDef();Object.assign(s,t),s.hide=!1}return s.headerName=t,s.colId=this.generateColumnId(i||[],e&&!n?e.getColId():""),s.field=s.colId,s.valueGetter=e=>{var t;return null==(t=e.data)?void 0:t[e.colDef.field]},s.pivotKeys=i,s.pivotValueColumn=e,!0===s.filter&&(s.filter="agNumberColumnFilter"),s}sameAggFuncs(e){if(1==e.length)return!0;for(let t=1;t<e.length;t++)if(e[t]!==e[0])return!1;return!0}headerNameComparator(e,t,i){return e?e(t.headerName,i.headerName):t.headerName&&!i.headerName?1:!t.headerName&&i.headerName?-1:t.headerName&&i.headerName?t.headerName<i.headerName?-1:t.headerName>i.headerName?1:0:0}merge(e,t){t.forEach((t,i,n)=>{const s=[...e.has(i)?e.get(i):[],...t];e.set(i,s)})}generateColumnGroupId(e){return`pivotGroup_${this.columnModel.getPivotColumns().map(e=>e.getColId()).join("-")}_${e.join("-")}`}generateColumnId(e,t){return`pivot_${this.columnModel.getPivotColumns().map(e=>e.getColId()).join("-")}_${e.join("-")}_${t}`}createColDefsFromFields(e){const t={};for(let i=0;i<e.length;i++){const n=e[i].split(this.fieldSeparator);let s=t;for(let e=0;e<n.length;e++){const t=n[e];null==s[t]&&(s[t]={}),s=s[t]}}const i=(e,t,n,s)=>{var r;const o=[];for(let t in n){const r=n[t],a=i(`${e}${this.fieldSeparator}${t}`,t,r,s+1);o.push(a)}if(0===o.length){const i=this.columnModel.getPrimaryColumn(t);if(i){const n=null!=(r=this.columnModel.getDisplayNameForColumn(i,"header"))?r:t,s=this.createColDef(i,n,void 0,!1);return s.colId=e,s.aggFunc=i.getAggFunc(),s.valueGetter=t=>{var i;return null==(i=t.data)?void 0:i[e]},s}return{colId:e,headerName:t,valueGetter:t=>{var i;return null==(i=t.data)?void 0:i[e]}}}return this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&1===o.length&&"colId"in o[0]?(o[0].headerName=t,o[0]):{openByDefault:-1===this.pivotDefaultExpanded||s<this.pivotDefaultExpanded,groupId:e,headerName:t,children:o}},n=[];for(let e in t){const s=i(e,e,t[e],0);n.push(s)}return n}};Zl.PIVOT_ROW_TOTAL_PREFIX="PivotRowTotal_",Kl([(0,Tl.Autowired)("columnModel")],Zl.prototype,"columnModel",2),Kl([Tl.PostConstruct],Zl.prototype,"init",1),Zl=Kl([(0,Tl.Bean)("pivotColDefService")],Zl);var Ql=class extends Dl.BeanStub{constructor(){super(...arguments),this.uniqueValues={},this.lastTimeFailed=!1,this.maxUniqueValues=-1,this.currentUniqueCount=0}execute(e){const t=e.changedPath;this.columnModel.isPivotActive()?this.executePivotOn(t):this.executePivotOff(t)}executePivotOff(e){this.aggregationColumnsHashLastTime=null,this.uniqueValues={},this.columnModel.isSecondaryColumnsPresent()&&(this.columnModel.setSecondaryColumns(null,"rowModelUpdated"),e&&e.setInactive())}executePivotOn(e){var t;const i=null!=(t=this.columnModel.getValueColumns().length)?t:1,n=this.gos.get("pivotMaxGeneratedColumns");let s;this.maxUniqueValues=-1===n?-1:n/i;try{s=this.bucketUpRowNodes(e)}catch(e){if(e.message===Ql.EXCEEDED_MAX_UNIQUE_VALUES){this.columnModel.setSecondaryColumns([],"rowModelUpdated");const t={type:Dl.Events.EVENT_PIVOT_MAX_COLUMNS_EXCEEDED,message:e.message};return this.eventService.dispatchEvent(t),void(this.lastTimeFailed=!0)}throw e}const r=this.setUniqueValues(s),o=this.columnModel.getValueColumns(),a=o.map(e=>`${e.getId()}-${e.getColDef().headerName}`).join("#"),l=o.map(e=>e.getAggFunc().toString()).join("#"),c=this.aggregationColumnsHashLastTime!==a,h=this.aggregationFuncsHashLastTime!==l;this.aggregationColumnsHashLastTime=a,this.aggregationFuncsHashLastTime=l;const u=this.columnModel.getRowGroupColumns().map(e=>e.getId()).join("#"),d=u!==this.groupColumnsHashLastTime;this.groupColumnsHashLastTime=u;const p=this.gos.get("pivotRowTotals"),g=this.gos.get("pivotColumnGroupTotals"),f=this.gos.get("suppressExpandablePivotGroups"),m=this.gos.get("removePivotHeaderRowWhenSingleValueColumn"),y=p!==this.pivotRowTotalsLastTime||g!==this.pivotColumnGroupTotalsLastTime||f!==this.suppressExpandablePivotGroupsLastTime||m!==this.removePivotHeaderRowWhenSingleValueColumnLastTime;if(this.pivotRowTotalsLastTime=p,this.pivotColumnGroupTotalsLastTime=g,this.suppressExpandablePivotGroupsLastTime=f,this.removePivotHeaderRowWhenSingleValueColumnLastTime=m,this.lastTimeFailed||r||c||d||h||y){const{pivotColumnGroupDefs:t,pivotColumnDefs:i}=this.pivotColDefService.createPivotColumnDefs(this.uniqueValues);this.pivotColumnDefs=i,this.columnModel.setSecondaryColumns(t,"rowModelUpdated"),e&&e.setInactive()}this.lastTimeFailed=!1}setUniqueValues(e){return!(JSON.stringify(e)===JSON.stringify(this.uniqueValues)||(this.uniqueValues=e,0))}bucketUpRowNodes(e){this.currentUniqueCount=0;const t={};e.forEachChangedNodeDepthFirst(e=>{e.leafGroup&&(e.childrenMapped=null)});const i=e=>{var n;e.leafGroup?this.bucketRowNode(e,t):null==(n=e.childrenAfterFilter)||n.forEach(i)};return e.executeFromRootNode(i),t}bucketRowNode(e,t){const i=this.columnModel.getPivotColumns();0===i.length?e.childrenMapped=null:e.childrenMapped=this.bucketChildren(e.childrenAfterFilter,i,0,t),e.sibling&&(e.sibling.childrenMapped=e.childrenMapped)}bucketChildren(e,t,i,n){const s={},r=t[i];if(e.forEach(e=>{let t=this.valueService.getKeyForNode(r,e);if(Dl._.missing(t)&&(t=""),!n[t]){this.currentUniqueCount+=1,n[t]={};const e=-1!==this.maxUniqueValues,i=this.currentUniqueCount>this.maxUniqueValues;if(e&&i)throw Error(Ql.EXCEEDED_MAX_UNIQUE_VALUES)}s[t]||(s[t]=[]),s[t].push(e)}),i===t.length-1)return s;{const e={};return Dl._.iterateObject(s,(s,r)=>{e[s]=this.bucketChildren(r,t,i+1,n[s])}),e}}getPivotColumnDefs(){return this.pivotColumnDefs}};Ql.EXCEEDED_MAX_UNIQUE_VALUES="Exceeded maximum allowed pivot column count.",Kl([(0,Dl.Autowired)("valueService")],Ql.prototype,"valueService",2),Kl([(0,Dl.Autowired)("columnModel")],Ql.prototype,"columnModel",2),Kl([(0,Dl.Autowired)("pivotColDefService")],Ql.prototype,"pivotColDefService",2),Ql=Kl([(0,Dl.Bean)("pivotStage")],Ql);var Jl={sum:"Sum",first:"First",last:"Last",min:"Min",max:"Max",count:"Count",avg:"Average"},ec=class extends Il.BeanStub{constructor(){super(...arguments),this.aggFuncsMap={},this.initialised=!1}init(){this.initialised||(this.initialiseWithDefaultAggregations(),this.addAggFuncs(this.gos.get("aggFuncs")))}initialiseWithDefaultAggregations(){this.aggFuncsMap[ec.AGG_SUM]=tc,this.aggFuncsMap[ec.AGG_FIRST]=ic,this.aggFuncsMap[ec.AGG_LAST]=nc,this.aggFuncsMap[ec.AGG_MIN]=sc,this.aggFuncsMap[ec.AGG_MAX]=rc,this.aggFuncsMap[ec.AGG_COUNT]=oc,this.aggFuncsMap[ec.AGG_AVG]=ac,this.initialised=!0}isAggFuncPossible(e,t){const i=this.getFuncNames(e),n=Il._.includes(i,t),s=Il._.exists(this.aggFuncsMap[t]);return n&&s}getDefaultFuncLabel(e){var t;return null!=(t=Jl[e])?t:e}getDefaultAggFunc(e){const t=e.getColDef().defaultAggFunc;if(Il._.exists(t)&&this.isAggFuncPossible(e,t))return t;if(this.isAggFuncPossible(e,ec.AGG_SUM))return ec.AGG_SUM;const i=this.getFuncNames(e);return Il._.existsAndNotEmpty(i)?i[0]:null}addAggFuncs(e){this.init(),Il._.iterateObject(e,(e,t)=>{this.aggFuncsMap[e]=t})}getAggFunc(e){return this.init(),this.aggFuncsMap[e]}getFuncNames(e){const t=e.getColDef().allowedAggFuncs;return null==t?Object.keys(this.aggFuncsMap).sort():t}clear(){this.aggFuncsMap={}}};function tc(e){const{values:t}=e;let i=null;for(let e=0;e<t.length;e++){const n=t[e];"number"==typeof n?null===i?i=n:i+="number"==typeof i?n:BigInt(n):"bigint"==typeof n&&(i=null===i?n:("bigint"==typeof i?i:BigInt(i))+n)}return i}function ic(e){return e.values.length>0?e.values[0]:null}function nc(e){return e.values.length>0?Il._.last(e.values):null}function sc(e){const{values:t}=e;let i=null;for(let e=0;e<t.length;e++){const n=t[e];"number"!=typeof n&&"bigint"!=typeof n||!(null===i||i>n)||(i=n)}return i}function rc(e){const{values:t}=e;let i=null;for(let e=0;e<t.length;e++){const n=t[e];"number"!=typeof n&&"bigint"!=typeof n||!(null===i||i<n)||(i=n)}return i}function oc(e){var t,i;const{values:n}=e;let s=0;for(let e=0;e<n.length;e++){const t=n[e];s+=null!=t&&"number"==typeof t.value?t.value:1}const r=null==(i=null==(t=e.rowNode)?void 0:t.aggData)?void 0:i[e.column.getColId()];return r&&r.value===s?r:{value:s,toString:function(){return this.value.toString()},toNumber:function(){return this.value}}}function ac(e){var t,i,n;const{values:s}=e;let r=0,o=0;for(let e=0;e<s.length;e++){const t=s[e];let i=null;"number"==typeof t||"bigint"==typeof t?(i=t,o++):null==t||"number"!=typeof t.value&&"bigint"!=typeof t.value||"number"!=typeof t.count||(i=t.value*("number"==typeof t.value?t.count:BigInt(t.count)),o+=t.count),"number"==typeof i?r+="number"==typeof r?i:BigInt(i):"bigint"==typeof i&&(r=("bigint"==typeof r?r:BigInt(r))+i)}let a=null;o>0&&(a=r/("number"==typeof r?o:BigInt(o)));const l=null==(n=null==(t=e.rowNode)?void 0:t.aggData)?void 0:n[null==(i=e.column)?void 0:i.getColId()];return l&&l.count===o&&l.value===a?l:{count:o,value:a,toString:function(){return"number"==typeof this.value||"bigint"==typeof this.value?this.value.toString():""},toNumber:function(){return this.value}}}ec.AGG_SUM="sum",ec.AGG_FIRST="first",ec.AGG_LAST="last",ec.AGG_MIN="min",ec.AGG_MAX="max",ec.AGG_COUNT="count",ec.AGG_AVG="avg",Kl([Il.PostConstruct],ec.prototype,"init",1),ec=Kl([(0,Il.Bean)("aggFuncService")],ec);var lc=class extends _l.PillDragComp{constructor(e,t,i,n,s){super(t,i,s,'\n                <span role="option">\n                    <span ref="eDragHandle" class="ag-drag-handle ag-column-drop-cell-drag-handle" role="presentation"></span>\n                    <span ref="eText" class="ag-column-drop-cell-text" aria-hidden="true"></span>\n                    <ag-sort-indicator ref="eSortIndicator"></ag-sort-indicator>\n                    <span ref="eButton" class="ag-column-drop-cell-button" role="presentation"></span>\n                </span>\n            '),this.column=e,this.dropZonePurpose=n,this.popupShowing=!1}init(){this.displayName=this.columnModel.getDisplayNameForColumn(this.column,"columnDrop"),super.init(),this.setupSort(),this.addManagedListener(this.eventService,_l.Column.EVENT_SORT_CHANGED,()=>{this.setupAria()}),this.isGroupingZone()&&this.addManagedPropertyListener("groupLockGroupColumns",()=>{this.refreshRemove(),this.refreshDraggable(),this.setupAria()})}getItem(){return this.column}getDisplayName(){return this.displayName}getTooltip(){return this.column.getColDef().headerTooltip}addAdditionalAriaInstructions(e,t){const i=this.gos.get("rowGroupPanelSuppressSort"),n=this.gos.get("functionsReadOnly");if(this.isAggregationZone()&&!n){const i=t("ariaDropZoneColumnValueItemDescription","Press ENTER to change the aggregation type");e.push(i)}if(this.isGroupingZone()&&this.column.isSortable()&&!i){const i=t("ariaDropZoneColumnGroupItemDescription","Press ENTER to sort");e.push(i)}super.addAdditionalAriaInstructions(e,t)}isDraggable(){return this.isReadOnly()}isRemovable(){return this.isReadOnly()}isReadOnly(){return!this.isGroupingAndLocked()&&!this.gos.get("functionsReadOnly")}getAriaDisplayName(){const e=this.localeService.getLocaleTextFunc(),{name:t,aggFuncName:i}=this.getColumnAndAggFuncName(),n=e("ariaDropZoneColumnComponentAggFuncSeparator"," of "),s={asc:e("ariaDropZoneColumnComponentSortAscending","ascending"),desc:e("ariaDropZoneColumnComponentSortDescending","descending")},r=this.column.getSort(),o=this.gos.get("rowGroupPanelSuppressSort");return[i&&`${i}${n}`,t,this.isGroupingZone()&&!o&&r&&`, ${s[r]}`].filter(e=>!!e).join("")}getColumnAndAggFuncName(){const e=this.displayName;let t="";if(this.isAggregationZone()){const e=this.column.getAggFunc(),i="string"==typeof e?e:"agg";t=this.localeService.getLocaleTextFunc()(i,i)}return{name:e,aggFuncName:t}}setupSort(){const e=this.column.isSortable(),t=this.isGroupingZone();if(e&&t&&!this.gos.get("rowGroupPanelSuppressSort")){this.eSortIndicator.setupSort(this.column,!0);const e=e=>{e.preventDefault();const t="ctrl"===this.gos.get("multiSortKey")?e.ctrlKey||e.metaKey:e.shiftKey;this.sortController.progressSort(this.column,t,"uiColumnSorted")};this.addGuiEventListener("click",e),this.addGuiEventListener("keydown",t=>{t.key===_l.KeyCode.ENTER&&this.isGroupingZone()&&e(t)})}}getDefaultIconName(){return _l.DragAndDropService.ICON_HIDE}createGetDragItem(){const{column:e}=this;return()=>{const t={};return t[e.getId()]=e.isVisible(),{columns:[e],visibleState:t}}}setupComponents(){super.setupComponents(),this.isAggregationZone()&&!this.gos.get("functionsReadOnly")&&this.addGuiEventListener("click",this.onShowAggFuncSelection.bind(this))}onKeyDown(e){super.onKeyDown(e),e.key===_l.KeyCode.ENTER&&this.isAggregationZone()&&!this.gos.get("functionsReadOnly")&&(e.preventDefault(),this.onShowAggFuncSelection())}getDisplayValue(){const{name:e,aggFuncName:t}=this.getColumnAndAggFuncName();return this.isAggregationZone()?`${t}(${e})`:e}onShowAggFuncSelection(){if(this.popupShowing)return;this.popupShowing=!0;const e=new _l.VirtualList({cssIdentifier:"select-agg-func"}),t=this.aggFuncService.getFuncNames(this.column),i=this.getGui(),n=e.getGui();e.setModel({getRow:function(e){return t[e]},getRowCount:function(){return t.length}}),this.getContext().createBean(e);const s=_l._.loadTemplate('<div class="ag-select-agg-func-popup"></div>');s.style.top="0px",s.style.left="0px",s.appendChild(n),s.style.width=`${i.clientWidth}px`;const r=this.addManagedListener(s,"focusout",e=>{!s.contains(e.relatedTarget)&&a&&a.hideFunc()}),o=this.localeService.getLocaleTextFunc(),a=this.popupService.addPopup({modal:!0,eChild:s,closeOnEsc:!0,closedCallback:t=>{this.destroyBean(e),this.popupShowing=!1,"Escape"===(null==t?void 0:t.key)&&i.focus(),r&&r()},ariaLabel:o("ariaLabelAggregationFunction","Aggregation Function")});a&&e.setComponentCreator(this.createAggSelect.bind(this,a.hideFunc)),e.addGuiEventListener("keydown",t=>{if(t.key===_l.KeyCode.ENTER||t.key===_l.KeyCode.SPACE){const t=e.getLastFocusedRow();if(null==t)return;const i=e.getComponentAt(t);i&&i.selectItem()}}),this.popupService.positionPopupByComponent({type:"aggFuncSelect",eventSource:i,ePopup:s,keepWithinBounds:!0,column:this.column,position:"under"}),e.refresh();let l=t.findIndex(e=>e===this.column.getAggFunc());-1===l&&(l=0),e.focusRow(l)}createAggSelect(e,t){const i=this.localeService.getLocaleTextFunc(),n=t.toString(),s=i(n,n);return new cc(()=>{if(e(),this.gos.get("functionsPassive")){const e={type:_l.Events.EVENT_COLUMN_AGG_FUNC_CHANGE_REQUEST,columns:[this.column],aggFunc:t};this.eventService.dispatchEvent(e)}else this.columnModel.setColumnAggFunc(this.column,t,"toolPanelDragAndDrop")},s)}isGroupingAndLocked(){return this.isGroupingZone()&&this.columnModel.isColumnGroupingLocked(this.column)}isAggregationZone(){return"aggregation"===this.dropZonePurpose}isGroupingZone(){return"rowGroup"===this.dropZonePurpose}getDragSourceType(){return _l.DragSourceType.ToolPanel}destroy(){super.destroy(),this.column=null}};Kl([(0,_l.Autowired)("popupService")],lc.prototype,"popupService",2),Kl([(0,_l.Autowired)("sortController")],lc.prototype,"sortController",2),Kl([(0,_l.Autowired)("columnModel")],lc.prototype,"columnModel",2),Kl([(0,_l.Optional)("aggFuncService")],lc.prototype,"aggFuncService",2),Kl([(0,_l.RefSelector)("eSortIndicator")],lc.prototype,"eSortIndicator",2);var cc=class extends _l.Component{constructor(e,t){super('<div class="ag-select-agg-func-item"/>'),this.selectItem=e,this.getGui().innerText=t,this.addGuiEventListener("click",this.selectItem)}},hc=class extends Pl.PillDropZonePanel{constructor(e,t){super(e),this.dropZonePurpose=t}init(e){super.init(e),this.addManagedListener(this.eventService,Pl.Events.EVENT_NEW_COLUMNS_LOADED,this.refreshGui.bind(this)),this.addManagedPropertyListeners(["functionsReadOnly","rowGroupPanelSuppressSort","groupLockGroupColumns"],this.refreshGui.bind(this))}getItems(e){var t;return null!=(t=e.columns)?t:[]}isInterestedIn(e){return e===Pl.DragSourceType.HeaderCell||e===Pl.DragSourceType.ToolPanel}minimumAllowedNewInsertIndex(){const e=this.gos.get("groupLockGroupColumns"),t=this.columnModel.getRowGroupColumns().length;return-1===e?t:Math.min(e,t)}showOrHideColumnOnExit(e){return this.isRowGroupPanel()&&!this.gos.get("suppressRowGroupHidesColumns")&&!e.fromNudge}handleDragEnterEnd(e){if(this.showOrHideColumnOnExit(e)){const t=e.dragSource.getDragItem().columns;this.setColumnsVisible(t,!1,"uiColumnDragged")}}handleDragLeaveEnd(e){if(this.showOrHideColumnOnExit(e)){const t=e.dragSource.getDragItem();this.setColumnsVisible(t.columns,!0,"uiColumnDragged")}}setColumnsVisible(e,t,i){if(e){const n=e.filter(e=>!e.getColDef().lockVisible);this.columnModel.setColumnsVisible(n,t,i)}}isRowGroupPanel(){return"rowGroup"===this.dropZonePurpose}refreshOnDragStop(){return!this.gos.get("functionsPassive")}createPillComponent(e,t,i,n){return new lc(e,t,i,this.dropZonePurpose,n)}};Kl([(0,Pl.Autowired)("columnModel")],hc.prototype,"columnModel",2);var uc=class extends hc{constructor(e){super(e,"rowGroup")}passBeansUp(){const e=this.localeService.getLocaleTextFunc(),t=e("rowGroupColumnsEmptyMessage","Drag here to set row groups"),i=e("groups","Row Groups");super.init({icon:kl._.createIconNoSpan("rowGroupPanel",this.gos,null),emptyMessage:t,title:i}),this.addManagedListener(this.eventService,kl.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,this.refreshGui.bind(this))}getAriaLabel(){return this.localeService.getLocaleTextFunc()("ariaRowGroupDropZonePanelLabel","Row Groups")}getTooltipParams(){const e=super.getTooltipParams();return e.location="rowGroupColumnsList",e}isItemDroppable(e,t){return!(this.gos.get("functionsReadOnly")||!e.isPrimary())&&e.isAllowRowGroup()&&(!e.isRowGroupActive()||this.isSourceEventFromTarget(t))}updateItems(e){if(this.gos.get("functionsPassive")){const t={type:kl.Events.EVENT_COLUMN_ROW_GROUP_CHANGE_REQUEST,columns:e};this.eventService.dispatchEvent(t)}else this.columnModel.setRowGroupColumns(e,"toolPanelUi")}getIconName(){return this.isPotentialDndItems()?kl.DragAndDropService.ICON_GROUP:kl.DragAndDropService.ICON_NOT_ALLOWED}getExistingItems(){return this.columnModel.getRowGroupColumns()}};Kl([kl.PostConstruct],uc.prototype,"passBeansUp",1);var dc=class extends hc{constructor(e){super(e,"pivot")}passBeansUp(){const e=this.localeService.getLocaleTextFunc(),t=e("pivotColumnsEmptyMessage","Drag here to set column labels"),i=e("pivots","Column Labels");super.init({icon:Ll._.createIconNoSpan("pivotPanel",this.gos,null),emptyMessage:t,title:i}),this.addManagedListener(this.eventService,Ll.Events.EVENT_NEW_COLUMNS_LOADED,this.refresh.bind(this)),this.addManagedListener(this.eventService,Ll.Events.EVENT_COLUMN_PIVOT_CHANGED,this.refresh.bind(this)),this.addManagedListener(this.eventService,Ll.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.checkVisibility.bind(this)),this.refresh()}getAriaLabel(){return this.localeService.getLocaleTextFunc()("ariaPivotDropZonePanelLabel","Column Labels")}getTooltipParams(){const e=super.getTooltipParams();return e.location="pivotColumnsList",e}refresh(){this.checkVisibility(),this.refreshGui()}checkVisibility(){const e=this.columnModel.isPivotMode();if(this.isHorizontal())switch(this.gos.get("pivotPanelShow")){case"always":this.setDisplayed(e);break;case"onlyWhenPivoting":const t=this.columnModel.isPivotActive();this.setDisplayed(e&&t);break;default:this.setDisplayed(!1)}else this.setDisplayed(e)}isItemDroppable(e,t){return!(this.gos.get("functionsReadOnly")||!e.isPrimary())&&e.isAllowPivot()&&(!e.isPivotActive()||this.isSourceEventFromTarget(t))}updateItems(e){if(this.gos.get("functionsPassive")){const t={type:Ll.Events.EVENT_COLUMN_PIVOT_CHANGE_REQUEST,columns:e};this.eventService.dispatchEvent(t)}else this.columnModel.setPivotColumns(e,"toolPanelUi")}getIconName(){return this.isPotentialDndItems()?Ll.DragAndDropService.ICON_PIVOT:Ll.DragAndDropService.ICON_NOT_ALLOWED}getExistingItems(){return this.columnModel.getPivotColumns()}};Kl([Ll.PostConstruct],dc.prototype,"passBeansUp",1);var pc=class extends Rl.Component{constructor(){super()}postConstruct(){this.setGui(this.createNorthPanel()),this.addManagedListener(this.eventService,Rl.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.onRowGroupChanged()),this.addManagedListener(this.eventService,Rl.Events.EVENT_NEW_COLUMNS_LOADED,()=>this.onRowGroupChanged()),this.addManagedPropertyListener("rowGroupPanelShow",()=>this.onRowGroupChanged()),this.addManagedPropertyListener("pivotPanelShow",()=>this.onPivotPanelShow()),this.onRowGroupChanged()}createNorthPanel(){const e=document.createElement("div");return e.classList.add("ag-column-drop-wrapper"),Rl._.setAriaRole(e,"presentation"),this.rowGroupComp=new uc(!0),this.createManagedBean(this.rowGroupComp),this.pivotComp=new dc(!0),this.createManagedBean(this.pivotComp),e.appendChild(this.rowGroupComp.getGui()),e.appendChild(this.pivotComp.getGui()),this.addManagedListener(this.rowGroupComp,Rl.Component.EVENT_DISPLAYED_CHANGED,()=>this.onDropPanelVisible()),this.addManagedListener(this.pivotComp,Rl.Component.EVENT_DISPLAYED_CHANGED,()=>this.onDropPanelVisible()),this.onDropPanelVisible(),e}onDropPanelVisible(){const e=this.rowGroupComp.isDisplayed()&&this.pivotComp.isDisplayed();this.rowGroupComp.addOrRemoveCssClass("ag-column-drop-horizontal-half-width",e),this.pivotComp.addOrRemoveCssClass("ag-column-drop-horizontal-half-width",e)}onRowGroupChanged(){if(!this.rowGroupComp)return;const e=this.gos.get("rowGroupPanelShow");if("always"===e)this.rowGroupComp.setDisplayed(!0);else if("onlyWhenGrouping"===e){const e=!this.columnModel.isRowGroupEmpty();this.rowGroupComp.setDisplayed(e)}else this.rowGroupComp.setDisplayed(!1)}onPivotPanelShow(){if(!this.pivotComp)return;const e=this.gos.get("pivotPanelShow");if("always"===e)this.pivotComp.setDisplayed(!0);else if("onlyWhenPivoting"===e){const e=this.columnModel.isPivotActive();this.pivotComp.setDisplayed(e)}else this.pivotComp.setDisplayed(!1)}};Kl([(0,Rl.Autowired)("columnModel")],pc.prototype,"columnModel",2),Kl([Rl.PostConstruct],pc.prototype,"postConstruct",1);var gc=class extends Nl.BeanStub{execute(e){const t=this.columnModel.isPivotMode(),i=this.filterManager.isAggregateFilterPresent()||this.filterManager.isAggregateQuickFilterPresent(),n=this.gos.getGroupAggFiltering()||(t?e=>e.node.leafGroup:e=>!e.node.group),{changedPath:s}=e,r=(e,t=!1)=>{e.childrenAfterFilter&&(e.childrenAfterAggFilter=e.childrenAfterFilter,t&&e.childrenAfterAggFilter.forEach(e=>r(e,t)),this.setAllChildrenCount(e)),e.sibling&&(e.sibling.childrenAfterAggFilter=e.childrenAfterAggFilter)};s.forEachChangedNodeDepthFirst(i?e=>{var t;e.childrenAfterAggFilter=(null==(t=e.childrenAfterFilter)?void 0:t.filter(e=>{var t;return n({node:e})&&this.filterManager.doesRowPassAggregateFilters({rowNode:e})?(r(e,!0),!0):null==(t=e.childrenAfterAggFilter)?void 0:t.length}))||null,this.setAllChildrenCount(e),e.sibling&&(e.sibling.childrenAfterAggFilter=e.childrenAfterAggFilter)}:r,!0)}setAllChildrenCountTreeData(e){let t=0;e.childrenAfterAggFilter.forEach(e=>{t++,t+=e.allChildrenCount}),e.setAllChildrenCount(t)}setAllChildrenCountGridGrouping(e){let t=0;e.childrenAfterAggFilter.forEach(e=>{e.group?t+=e.allChildrenCount:t++}),e.setAllChildrenCount(t)}setAllChildrenCount(e){e.hasChildren()?this.gos.get("treeData")?this.setAllChildrenCountTreeData(e):this.setAllChildrenCountGridGrouping(e):e.setAllChildrenCount(null)}};Kl([(0,Nl.Autowired)("filterManager")],gc.prototype,"filterManager",2),Kl([(0,Nl.Autowired)("columnModel")],gc.prototype,"columnModel",2),gc=Kl([(0,Nl.Bean)("filterAggregatesStage")],gc);var fc=class e extends Ol.TabGuardComp{constructor(){super('\n            <div class="ag-group-filter">\n                <div ref="eGroupField"></div>\n                <div ref="eUnderlyingFilter"></div>\n            </div>\n        ')}postConstruct(){this.initialiseTabGuard({})}init(e){return this.params=e,this.validateParams(),this.updateGroups().then(()=>{this.addManagedListener(this.eventService,Ol.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.onColumnRowGroupChanged())})}validateParams(){const{colDef:e}=this.params;e.field&&Ol._.warnOnce('Group Column Filter does not work with the colDef property "field". This property will be ignored.'),e.filterValueGetter&&Ol._.warnOnce('Group Column Filter does not work with the colDef property "filterValueGetter". This property will be ignored.'),e.filterParams&&Ol._.warnOnce('Group Column Filter does not work with the colDef property "filterParams". This property will be ignored.')}updateGroups(){const e=this.updateGroupField();return this.getUnderlyingFilters(e)}getSourceColumns(){if(this.groupColumn=this.params.column,this.gos.get("treeData"))return Ol._.warnOnce("Group Column Filter does not work with Tree Data enabled. Please disable Tree Data, or use a different filter."),[];return this.columnModel.getSourceColumnsForGroupColumn(this.groupColumn)||(Ol._.warnOnce("Group Column Filter only works on group columns. Please use a different filter."),[])}updateGroupField(){Ol._.clearElement(this.eGroupField),this.eGroupFieldSelect&&this.destroyBean(this.eGroupFieldSelect);const e=this.getSourceColumns(),t=e.filter(e=>e.isFilterAllowed());return t.length?(1===e.length?(this.selectedColumn=t[0],Ol._.setDisplayed(this.eGroupField,!1)):(this.selectedColumn&&t.some(e=>e.getId()===this.selectedColumn.getId())||(this.selectedColumn=t[0]),this.createGroupFieldSelectElement(t),this.eGroupField.appendChild(this.eGroupFieldSelect.getGui()),this.eGroupField.appendChild(Ol._.loadTemplate('<div class="ag-filter-separator"></div>')),Ol._.setDisplayed(this.eGroupField,!0)),t):(this.selectedColumn=void 0,Ol._.setDisplayed(this.eGroupField,!1),null)}createGroupFieldSelectElement(e){this.eGroupFieldSelect=this.createManagedBean(new Ol.AgSelect);const t=this.localeService.getLocaleTextFunc();this.eGroupFieldSelect.setLabel(t("groupFilterSelect","Select field:")),this.eGroupFieldSelect.setLabelAlignment("top"),this.eGroupFieldSelect.addOptions(e.map(e=>{var t;return{value:e.getId(),text:null!=(t=this.columnModel.getDisplayNameForColumn(e,"groupFilter",!1))?t:void 0}})),this.eGroupFieldSelect.setValue(this.selectedColumn.getId()),this.eGroupFieldSelect.onValueChange(e=>this.updateSelectedColumn(e)),this.eGroupFieldSelect.addCssClass("ag-group-filter-field-select-wrapper"),1===e.length&&this.eGroupFieldSelect.setDisabled(!0)}getUnderlyingFilters(e){if(!e)return this.filterColumnPairs=void 0,this.selectedFilter=void 0,this.groupColumn.setFilterActive(!1,"columnRowGroupChanged"),Ol.AgPromise.resolve();const t=[],i=[];return e.forEach(e=>{const n=this.filterManager.getOrCreateFilterWrapper(e,"COLUMN_MENU");(null==n?void 0:n.filterPromise)&&t.push(n.filterPromise.then(t=>(t&&i.push({filter:t,column:e}),e.getId()===this.selectedColumn.getId()&&(this.selectedFilter=null!=t?t:void 0),t)))}),Ol.AgPromise.all(t).then(()=>{this.filterColumnPairs=i,this.groupColumn.setFilterActive(this.isFilterActive(),"columnRowGroupChanged")})}addUnderlyingFilterElement(){var e,t;if(Ol._.clearElement(this.eUnderlyingFilter),!this.selectedColumn)return Ol.AgPromise.resolve();const i=this.createManagedBean(new Ol.FilterWrapperComp(this.selectedColumn,"COLUMN_MENU"));return this.filterWrapperComp=i,i.hasFilter()?(this.eUnderlyingFilter.appendChild(i.getGui()),null!=(t=null==(e=i.getFilter())?void 0:e.then(()=>{var e,t;null==(e=i.afterGuiAttached)||e.call(i,this.afterGuiAttachedParams),(null==(t=this.afterGuiAttachedParams)?void 0:t.suppressFocus)||!this.eGroupFieldSelect||this.eGroupFieldSelect.isDisabled()||this.eGroupFieldSelect.getFocusableElement().focus()}))?t:Ol.AgPromise.resolve()):Ol.AgPromise.resolve()}updateSelectedColumn(t){var i;if(!t)return;null==(i=this.filterWrapperComp)||i.afterGuiDetached(),this.destroyBean(this.filterWrapperComp);const n=this.getFilterColumnPair(t);this.selectedColumn=null==n?void 0:n.column,this.selectedFilter=null==n?void 0:n.filter,this.dispatchEvent({type:e.EVENT_SELECTED_COLUMN_CHANGED}),this.addUnderlyingFilterElement()}isFilterActive(){var e;return!!(null==(e=this.filterColumnPairs)?void 0:e.some(({filter:e})=>e.isFilterActive()))}doesFilterPass(){return!0}getModel(){return null}setModel(){return Ol.AgPromise.resolve()}afterGuiAttached(e){this.afterGuiAttachedParams=e,this.addUnderlyingFilterElement()}afterGuiDetached(){var e,t;Ol._.clearElement(this.eUnderlyingFilter),null==(t=null==(e=this.selectedFilter)?void 0:e.afterGuiDetached)||t.call(e)}onColumnRowGroupChanged(){this.updateGroups().then(()=>{this.dispatchEvent({type:e.EVENT_COLUMN_ROW_GROUP_CHANGED}),this.eventService.dispatchEvent({type:"filterAllowedUpdated"})})}getFilterColumnPair(e){var t;if(e)return null==(t=this.filterColumnPairs)?void 0:t.find(({column:t})=>t.getId()===e)}getSelectedFilter(){return this.selectedFilter}getSelectedColumn(){return this.selectedColumn}isFilterAllowed(){return!!this.selectedColumn}destroy(){super.destroy()}};fc.EVENT_COLUMN_ROW_GROUP_CHANGED="columnRowGroupChanged",fc.EVENT_SELECTED_COLUMN_CHANGED="selectedColumnChanged",Kl([(0,Ol.Autowired)("filterManager")],fc.prototype,"filterManager",2),Kl([(0,Ol.Autowired)("columnModel")],fc.prototype,"columnModel",2),Kl([(0,Ol.RefSelector)("eGroupField")],fc.prototype,"eGroupField",2),Kl([(0,Ol.RefSelector)("eUnderlyingFilter")],fc.prototype,"eUnderlyingFilter",2),Kl([Ol.PostConstruct],fc.prototype,"postConstruct",1);var mc=fc,yc=class extends Fl.Component{constructor(){super('\n            <div ref="eFloatingFilter" class="ag-group-floating-filter ag-floating-filter-input" role="presentation"></div>\n        '),this.haveAddedColumnListeners=!1}init(e){this.params=e;const t="multipleColumns"===this.gos.get("groupDisplayType");return new Fl.AgPromise(e=>{this.params.parentFilterInstance(i=>{this.parentFilterInstance=i,t?this.setupUnderlyingFloatingFilterElement().then(()=>e()):(this.setupReadOnlyFloatingFilterElement(),e())})}).then(()=>{this.addManagedListener(this.parentFilterInstance,mc.EVENT_SELECTED_COLUMN_CHANGED,()=>this.onSelectedColumnChanged()),this.addManagedListener(this.parentFilterInstance,mc.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.onColumnRowGroupChanged())})}onParamsUpdated(e){this.refresh(e)}refresh(e){this.params=e,this.setParams()}setParams(){var e;const t=this.columnModel.getDisplayNameForColumn(this.params.column,"header",!0),i=this.localeService.getLocaleTextFunc();null==(e=this.eFloatingFilterText)||e.setInputAriaLabel(`${t} ${i("ariaFilterInput","Filter Input")}`)}setupReadOnlyFloatingFilterElement(){this.eFloatingFilterText||(this.eFloatingFilterText=this.createManagedBean(new Fl.AgInputTextField),this.eFloatingFilterText.setDisabled(!0).addGuiEventListener("click",()=>this.params.showParentFilter()),this.setParams()),this.updateDisplayedValue(),this.eFloatingFilter.appendChild(this.eFloatingFilterText.getGui())}setupUnderlyingFloatingFilterElement(){this.showingUnderlyingFloatingFilter=!1,this.underlyingFloatingFilter=void 0,Fl._.clearElement(this.eFloatingFilter);const e=this.parentFilterInstance.getSelectedColumn();if(e&&!e.isVisible()){const t=this.filterManager.getFloatingFilterCompDetails(e,this.params.showParentFilter);if(t)return this.compDetails=t,this.haveAddedColumnListeners||(this.haveAddedColumnListeners=!0,this.addManagedListener(e,Fl.Column.EVENT_VISIBLE_CHANGED,this.onColumnVisibleChanged.bind(this)),this.addManagedListener(e,Fl.Column.EVENT_COL_DEF_CHANGED,this.onColDefChanged.bind(this))),t.newAgStackInstance().then(e=>{var t,i;this.underlyingFloatingFilter=e,null==(i=this.underlyingFloatingFilter)||i.onParentModelChanged(null==(t=this.parentFilterInstance.getSelectedFilter())?void 0:t.getModel()),this.appendChild(e.getGui()),this.showingUnderlyingFloatingFilter=!0})}return this.setupReadOnlyFloatingFilterElement(),Fl.AgPromise.resolve()}onColumnVisibleChanged(){this.setupUnderlyingFloatingFilterElement()}onColDefChanged(e){var t,i,n;if(!e.column)return;const s=this.filterManager.getFloatingFilterCompDetails(e.column,this.params.showParentFilter);s&&((null==(t=this.underlyingFloatingFilter)?void 0:t.refresh)?this.underlyingFloatingFilter.refresh(s.params):null==(n=null==(i=this.underlyingFloatingFilter)?void 0:i.onParamsUpdated)||n.call(i,s.params))}onParentModelChanged(e,t){var i,n;this.showingUnderlyingFloatingFilter?null==(n=this.underlyingFloatingFilter)||n.onParentModelChanged(null==(i=this.parentFilterInstance.getSelectedFilter())?void 0:i.getModel(),t):this.updateDisplayedValue()}updateDisplayedValue(){if(!this.parentFilterInstance||!this.eFloatingFilterText)return;const e=this.parentFilterInstance.getSelectedFilter();if(!e)return this.eFloatingFilterText.setValue(""),void this.eFloatingFilterText.setDisplayed(!1);if(this.eFloatingFilterText.setDisplayed(!0),e.getModelAsString){const t=e.getModel();this.eFloatingFilterText.setValue(null==t?"":e.getModelAsString(t))}else this.eFloatingFilterText.setValue("")}onSelectedColumnChanged(){this.showingUnderlyingFloatingFilter||this.updateDisplayedValue()}onColumnRowGroupChanged(){this.showingUnderlyingFloatingFilter||this.updateDisplayedValue()}destroy(){super.destroy()}};Kl([(0,Fl.Autowired)("columnModel")],yc.prototype,"columnModel",2),Kl([(0,Fl.Autowired)("filterManager")],yc.prototype,"filterManager",2),Kl([(0,Fl.RefSelector)("eFloatingFilter")],yc.prototype,"eFloatingFilter",2);var vc={version:"31.3.4",moduleName:El.ModuleNames.RowGroupingModule,beans:[Yl,gc,Xl,Zl,Ql,ec],agStackComponents:[{componentName:"AgGridHeaderDropZones",componentClass:pc}],userComponents:[{componentName:"agGroupColumnFilter",componentClass:mc},{componentName:"agGroupColumnFloatingFilter",componentClass:yc}],dependantModules:[D]},bc=class extends hc{constructor(e){super(e,"aggregation")}passBeansUp(){const e=this.localeService.getLocaleTextFunc(),t=e("valueColumnsEmptyMessage","Drag here to aggregate"),i=e("values","Values");super.init({icon:Gl._.createIconNoSpan("valuePanel",this.gos,null),emptyMessage:t,title:i}),this.addManagedListener(this.eventService,Gl.Events.EVENT_COLUMN_VALUE_CHANGED,this.refreshGui.bind(this))}getAriaLabel(){return this.localeService.getLocaleTextFunc()("ariaValuesDropZonePanelLabel","Values")}getTooltipParams(){const e=super.getTooltipParams();return e.location="valueColumnsList",e}getIconName(){return this.isPotentialDndItems()?Gl.DragAndDropService.ICON_AGGREGATE:Gl.DragAndDropService.ICON_NOT_ALLOWED}isItemDroppable(e,t){return!(this.gos.get("functionsReadOnly")||!e.isPrimary())&&e.isAllowValue()&&(!e.isValueActive()||this.isSourceEventFromTarget(t))}updateItems(e){if(this.gos.get("functionsPassive")){const t={type:Gl.Events.EVENT_COLUMN_VALUE_CHANGE_REQUEST,columns:e};this.eventService.dispatchEvent(t)}else this.columnModel.setValueColumns(e,"toolPanelUi")}getExistingItems(){return this.columnModel.getValueColumns()}};Kl([Gl.PostConstruct],bc.prototype,"passBeansUp",1);var Cc=i(98092),wc=i(98092),Sc=i(98092),xc=i(98092),Ec=i(98092),Ac=i(98092),Mc=i(98092),Tc=i(98092),Dc=i(98092),Ic=Object.defineProperty,Rc=Object.defineProperties,kc=Object.getOwnPropertyDescriptor,Pc=Object.getOwnPropertyDescriptors,_c=Object.getOwnPropertySymbols,Lc=Object.prototype.hasOwnProperty,Nc=Object.prototype.propertyIsEnumerable,Oc=(e,t,i)=>t in e?Ic(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Fc=(e,t,i,n)=>{for(var s,r=n>1?void 0:n?kc(t,i):t,o=e.length-1;o>=0;o--)(s=e[o])&&(r=(n?s(t,i,r):s(r))||r);return n&&r&&Ic(t,i,r),r},Gc=class extends Sc.Component{constructor(){super('<div class="ag-tool-panel-horizontal-resize"></div>'),this.minWidth=100,this.maxWidth=null}setElementToResize(e){this.elementToResize=e}postConstruct(){const e=this.horizontalResizeService.addResizeBar({eResizeBar:this.getGui(),dragStartPixels:1,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this),onResizeEnd:this.onResizeEnd.bind(this)});this.addDestroyFunc(e),this.setInverted(this.gos.get("enableRtl"))}dispatchResizeEvent(e,t,i){const n={type:Sc.Events.EVENT_TOOL_PANEL_SIZE_CHANGED,width:i,started:e,ended:t};this.eventService.dispatchEvent(n)}onResizeStart(){this.startingWidth=this.elementToResize.offsetWidth,this.dispatchResizeEvent(!0,!1,this.startingWidth)}onResizeEnd(e){return this.onResizing(e,!0)}onResizing(e,t=!1){const i=this.inverted?-1:1;let n=Math.max(this.minWidth,Math.floor(this.startingWidth-e*i));null!=this.maxWidth&&(n=Math.min(this.maxWidth,n)),this.elementToResize.style.width=`${n}px`,this.dispatchResizeEvent(!1,t,n)}setInverted(e){this.inverted=e}setMaxWidth(e){this.maxWidth=e}setMinWidth(e){this.minWidth=null!=e?e:100}};Fc([(0,Sc.Autowired)("horizontalResizeService")],Gc.prototype,"horizontalResizeService",2),Fc([Sc.PostConstruct],Gc.prototype,"postConstruct",1);var Bc=class e extends Ac.Component{constructor(e){super(),this.toolPanelDef=e}getToolPanelId(){return this.toolPanelDef.id}postConstruct(){const e=this.createTemplate();this.setTemplate(e),this.setLabel(),this.setIcon(),this.addManagedListener(this.eToggleButton,"click",this.onButtonPressed.bind(this)),this.eToggleButton.setAttribute("id",`ag-${this.getCompId()}-button`)}createTemplate(){return'<div class="ag-side-button" role="presentation">\n                <button type="button" ref="eToggleButton" tabindex="-1" role="tab" aria-expanded="false" class="ag-button ag-side-button-button">\n                    <div ref="eIconWrapper" class="ag-side-button-icon-wrapper" aria-hidden="true"></div>\n                    <span ref ="eLabel" class="ag-side-button-label"></span>\n                </button>\n            </div>'}setLabel(){const e=this.localeService.getLocaleTextFunc(),t=this.toolPanelDef,i=e(t.labelKey,t.labelDefault);this.eLabel.innerText=i}setIcon(){this.eIconWrapper.insertAdjacentElement("afterbegin",Ac._.createIconNoSpan(this.toolPanelDef.iconKey,this.gos))}onButtonPressed(){this.dispatchEvent({type:e.EVENT_TOGGLE_BUTTON_CLICKED})}setSelected(e){this.addOrRemoveCssClass("ag-selected",e),Ac._.setAriaExpanded(this.eToggleButton,e)}getButtonElement(){return this.eToggleButton}};Bc.EVENT_TOGGLE_BUTTON_CLICKED="toggleButtonClicked",Fc([(0,Ac.RefSelector)("eToggleButton")],Bc.prototype,"eToggleButton",2),Fc([(0,Ac.RefSelector)("eIconWrapper")],Bc.prototype,"eIconWrapper",2),Fc([(0,Ac.RefSelector)("eLabel")],Bc.prototype,"eLabel",2),Fc([Ac.PostConstruct],Bc.prototype,"postConstruct",1);var Vc=Bc,Hc=class e extends Ec.Component{constructor(){super(e.TEMPLATE),this.buttonComps=[]}postConstruct(){this.addManagedListener(this.getFocusableElement(),"keydown",this.handleKeyDown.bind(this))}handleKeyDown(e){if(e.key!==Ec.KeyCode.TAB||!e.shiftKey)return;const t=Ec._.last(this.columnModel.getAllDisplayedColumns());this.focusService.focusGridView(t,!0)&&e.preventDefault()}setActiveButton(e){this.buttonComps.forEach(t=>{t.setSelected(e===t.getToolPanelId())})}addButtonComp(t){const i=this.createBean(new Vc(t));return this.buttonComps.push(i),this.appendChild(i),i.addEventListener(Vc.EVENT_TOGGLE_BUTTON_CLICKED,()=>{this.dispatchEvent({type:e.EVENT_SIDE_BAR_BUTTON_CLICKED,toolPanelId:t.id})}),i}clearButtons(){this.buttonComps=this.destroyBeans(this.buttonComps),Ec._.clearElement(this.getGui())}};Hc.EVENT_SIDE_BAR_BUTTON_CLICKED="sideBarButtonClicked",Hc.TEMPLATE='<div class="ag-side-buttons" role="tablist"></div>',Fc([(0,Ec.Autowired)("focusService")],Hc.prototype,"focusService",2),Fc([(0,Ec.Autowired)("columnModel")],Hc.prototype,"columnModel",2),Fc([Ec.PostConstruct],Hc.prototype,"postConstruct",1),Fc([Ec.PreDestroy],Hc.prototype,"clearButtons",1);var Uc=Hc,zc=class e{static parse(t){if(t){if(!0===t)return{toolPanels:[e.DEFAULT_COLUMN_COMP,e.DEFAULT_FILTER_COMP],defaultToolPanel:"columns"};if("string"==typeof t)return e.parse([t]);if(Array.isArray(t)){const i=[];if(t.forEach(t=>{const n=e.DEFAULT_BY_KEY[t];n?i.push(n):console.warn(`AG Grid: the key ${t} is not a valid key for specifying a tool panel, valid keys are: ${Object.keys(e.DEFAULT_BY_KEY).join(",")}`)}),0===i.length)return;return{toolPanels:i,defaultToolPanel:i[0].id}}return{toolPanels:e.parseComponents(t.toolPanels),defaultToolPanel:t.defaultToolPanel,hiddenByDefault:t.hiddenByDefault,position:t.position}}}static parseComponents(t){const i=[];return t?(t.forEach(t=>{let n=null;if("string"==typeof t){const i=e.DEFAULT_BY_KEY[t];if(!i)return void console.warn(`AG Grid: the key ${t} is not a valid key for specifying a tool panel, valid keys are: ${Object.keys(e.DEFAULT_BY_KEY).join(",")}`);n=i}else n=t;i.push(n)}),i):i}};zc.DEFAULT_COLUMN_COMP={id:"columns",labelDefault:"Columns",labelKey:"columns",iconKey:"columns",toolPanel:"agColumnsToolPanel"},zc.DEFAULT_FILTER_COMP={id:"filters",labelDefault:"Filters",labelKey:"filters",iconKey:"filter",toolPanel:"agFiltersToolPanel"},zc.DEFAULT_BY_KEY={columns:zc.DEFAULT_COLUMN_COMP,filters:zc.DEFAULT_FILTER_COMP};var Wc=zc,jc=class e extends Mc.Component{constructor(){super(e.TEMPLATE)}setupResize(){const e=this.getGui(),t=this.resizeBar=this.createManagedBean(new Gc);e.setAttribute("id",`ag-${this.getCompId()}`),t.setElementToResize(e),this.appendChild(t)}getToolPanelId(){return this.toolPanelId}setToolPanelDef(e,t){const{id:i,minWidth:n,maxWidth:s,width:r}=e;this.toolPanelId=i,this.width=r;const o=this.userComponentFactory.getToolPanelCompDetails(e,t),a=o.newAgStackInstance();this.params=o.params,null!=a?(a.then(this.setToolPanelComponent.bind(this)),null!=n&&this.resizeBar.setMinWidth(n),null!=s&&this.resizeBar.setMaxWidth(s)):console.warn(`AG Grid: error processing tool panel component ${i}. You need to specify 'toolPanel'`)}setToolPanelComponent(e){this.toolPanelCompInstance=e,this.appendChild(e.getGui()),this.addDestroyFunc(()=>{this.destroyBean(e)}),this.width&&(this.getGui().style.width=`${this.width}px`)}getToolPanelInstance(){return this.toolPanelCompInstance}setResizerSizerSide(e){const t="left"===e,i=this.gos.get("enableRtl")?t:!t;this.resizeBar.setInverted(i)}refresh(){this.toolPanelCompInstance.refresh(this.params)}};jc.TEMPLATE='<div class="ag-tool-panel-wrapper" role="tabpanel"/>',Fc([(0,Mc.Autowired)("userComponentFactory")],jc.prototype,"userComponentFactory",2),Fc([Mc.PostConstruct],jc.prototype,"setupResize",1);var $c=jc,Kc=class e extends xc.Component{constructor(){super(e.TEMPLATE),this.toolPanelWrappers=[]}postConstruct(){var e;this.sideBarButtonsComp.addEventListener(Uc.EVENT_SIDE_BAR_BUTTON_CLICKED,this.onToolPanelButtonClicked.bind(this));const{sideBar:t}=null!=(e=this.gos.get("initialState"))?e:{};this.setSideBarDef({sideBarDef:Wc.parse(this.gos.get("sideBar")),sideBarState:t}),this.addManagedPropertyListener("sideBar",this.onSideBarUpdated.bind(this)),this.sideBarService.registerSideBarComp(this),this.createManagedBean(new xc.ManagedFocusFeature(this.getFocusableElement(),{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this)}))}onTabKeyDown(e){if(e.defaultPrevented)return;const{focusService:t,sideBarButtonsComp:i}=this,n=this.getGui(),s=i.getGui(),r=this.gos.getActiveDomElement(),o=n.querySelector(".ag-tool-panel-wrapper:not(.ag-hidden)"),a=e.target;if(!o)return;if(s.contains(r))return void(t.focusInto(o,e.shiftKey)&&e.preventDefault());if(!e.shiftKey)return;let l=null;o.contains(r)?l=this.focusService.findNextFocusableElement(o,void 0,!0):t.isTargetUnderManagedComponent(o,a)&&e.shiftKey&&(l=this.focusService.findFocusableElementBeforeTabGuard(o,a)),l||(l=s.querySelector(".ag-selected button")),l&&l!==e.target&&(e.preventDefault(),l.focus())}handleKeyDown(e){const t=this.gos.getActiveDomElement();if(!this.sideBarButtonsComp.getGui().contains(t))return;const i=this.sideBarButtonsComp.getGui(),n=Array.prototype.slice.call(i.querySelectorAll(".ag-side-button")),s=n.findIndex(e=>e.contains(t));let r=null;switch(e.key){case xc.KeyCode.LEFT:case xc.KeyCode.UP:r=Math.max(0,s-1);break;case xc.KeyCode.RIGHT:case xc.KeyCode.DOWN:r=Math.min(s+1,n.length-1)}if(null===r)return;const o=n[r].querySelector("button");o&&(o.focus(),e.preventDefault())}onToolPanelButtonClicked(e){const t=e.toolPanelId;this.openedItem()===t?this.openToolPanel(void 0,"sideBarButtonClicked"):this.openToolPanel(t,"sideBarButtonClicked")}clearDownUi(){this.sideBarButtonsComp.clearButtons(),this.destroyToolPanelWrappers()}setSideBarDef({sideBarDef:e,sideBarState:t,existingToolPanelWrappers:i}){if(this.setDisplayed(!1),this.sideBar=e,this.sideBar&&this.sideBar.toolPanels){const e=this.sideBar.toolPanels;if(this.createToolPanelsAndSideButtons(e,t,i),!this.toolPanelWrappers.length)return;const n=t?t.visible:!this.sideBar.hiddenByDefault;if(this.setDisplayed(n),this.setSideBarPosition(t?t.position:this.sideBar.position),n)if(t){const{openToolPanel:e}=t;e&&this.openToolPanel(e,"sideBarInitializing")}else this.openToolPanel(this.sideBar.defaultToolPanel,"sideBarInitializing")}}getDef(){return this.sideBar}setSideBarPosition(e){e||(e="right"),this.position=e;const t="left"===e,i=t?"right":"left";return this.addOrRemoveCssClass("ag-side-bar-left",t),this.addOrRemoveCssClass("ag-side-bar-right",!t),this.toolPanelWrappers.forEach(e=>{e.setResizerSizerSide(i)}),this.eventService.dispatchEvent({type:xc.Events.EVENT_SIDE_BAR_UPDATED}),this}setDisplayed(e,t){super.setDisplayed(e,t),this.eventService.dispatchEvent({type:xc.Events.EVENT_SIDE_BAR_UPDATED})}getState(){const e={};return this.toolPanelWrappers.forEach(t=>{var i,n;e[t.getToolPanelId()]=null==(n=null==(i=t.getToolPanelInstance())?void 0:i.getState)?void 0:n.call(i)}),{visible:this.isDisplayed(),position:this.position,openToolPanel:this.openedItem(),toolPanels:e}}createToolPanelsAndSideButtons(e,t,i){var n;for(const s of e)this.createToolPanelAndSideButton(s,null==(n=null==t?void 0:t.toolPanels)?void 0:n[s.id],null==i?void 0:i[s.id])}validateDef(e){if(null==e.id)return console.warn("AG Grid: please review all your toolPanel components, it seems like at least one of them doesn't have an id"),!1;if("agColumnsToolPanel"===e.toolPanel&&!xc.ModuleRegistry.__assertRegistered(xc.ModuleNames.ColumnsToolPanelModule,"Column Tool Panel",this.context.getGridId()))return!1;if("agFiltersToolPanel"===e.toolPanel){if(!xc.ModuleRegistry.__assertRegistered(xc.ModuleNames.FiltersToolPanelModule,"Filters Tool Panel",this.context.getGridId()))return!1;if(this.filterManager.isAdvancedFilterEnabled())return xc._.warnOnce("Advanced Filter does not work with Filters Tool Panel. Filters Tool Panel has been disabled."),!1}return!0}createToolPanelAndSideButton(e,t,i){if(!this.validateDef(e))return;const n=this.sideBarButtonsComp.addButtonComp(e);let s;i?s=i:(s=this.getContext().createBean(new $c),s.setToolPanelDef(e,{initialState:t,onStateUpdated:()=>this.eventService.dispatchEvent({type:xc.Events.EVENT_SIDE_BAR_UPDATED})})),s.setDisplayed(!1);const r=s.getGui();this.appendChild(r),this.toolPanelWrappers.push(s),xc._.setAriaControls(n.getButtonElement(),r)}refresh(){this.toolPanelWrappers.forEach(e=>e.refresh())}openToolPanel(e,t="api"){const i=this.openedItem();i!==e&&(this.toolPanelWrappers.forEach(t=>{const i=e===t.getToolPanelId();t.setDisplayed(i)}),i!==this.openedItem()&&(this.sideBarButtonsComp.setActiveButton(e),this.raiseToolPanelVisibleEvent(e,null!=i?i:void 0,t)))}getToolPanelInstance(e){const t=this.toolPanelWrappers.filter(t=>t.getToolPanelId()===e)[0];if(t)return t.getToolPanelInstance();console.warn(`AG Grid: unable to lookup Tool Panel as invalid key supplied: ${e}`)}raiseToolPanelVisibleEvent(e,t,i){const n=!!e&&!!t;if(t){const e={type:xc.Events.EVENT_TOOL_PANEL_VISIBLE_CHANGED,source:i,key:t,visible:!1,switchingToolPanel:n};this.eventService.dispatchEvent(e)}if(e){const t={type:xc.Events.EVENT_TOOL_PANEL_VISIBLE_CHANGED,source:i,key:e,visible:!0,switchingToolPanel:n};this.eventService.dispatchEvent(t)}}close(e="api"){this.openToolPanel(void 0,e)}isToolPanelShowing(){return!!this.openedItem()}openedItem(){let e=null;return this.toolPanelWrappers.forEach(t=>{t.isDisplayed()&&(e=t.getToolPanelId())}),e}onSideBarUpdated(){var e;const t=Wc.parse(this.gos.get("sideBar"));let i={};t&&this.sideBar&&(null==(e=t.toolPanels)||e.forEach(e=>{var t,n;const{id:s}=e;if(!s)return;const r=null==(t=this.sideBar.toolPanels)?void 0:t.find(e=>e.id===s);if(!r||e.toolPanel!==r.toolPanel)return;const o=this.toolPanelWrappers.find(e=>e.getToolPanelId()===s);if(!o)return;const a=this.gos.addGridCommonParams((l=((e,t)=>{for(var i in t||(t={}))Lc.call(t,i)&&Oc(e,i,t[i]);if(_c)for(var i of _c(t))Nc.call(t,i)&&Oc(e,i,t[i]);return e})({},null!=(n=e.toolPanelParams)?n:{}),Rc(l,Pc({onStateUpdated:()=>this.eventService.dispatchEvent({type:xc.Events.EVENT_SIDE_BAR_UPDATED})}))));var l;!0===o.getToolPanelInstance().refresh(a)&&(this.toolPanelWrappers=this.toolPanelWrappers.filter(e=>e!==o),xc._.removeFromParent(o.getGui()),i[s]=o)})),this.clearDownUi(),this.setSideBarDef({sideBarDef:t,existingToolPanelWrappers:i})}destroyToolPanelWrappers(){this.toolPanelWrappers.forEach(e=>{xc._.removeFromParent(e.getGui()),this.destroyBean(e)}),this.toolPanelWrappers.length=0}destroy(){this.destroyToolPanelWrappers(),super.destroy()}};Kc.TEMPLATE='<div class="ag-side-bar ag-unselectable">\n            <ag-side-bar-buttons ref="sideBarButtons"></ag-side-bar-buttons>\n        </div>',Fc([(0,xc.Autowired)("focusService")],Kc.prototype,"focusService",2),Fc([(0,xc.Autowired)("filterManager")],Kc.prototype,"filterManager",2),Fc([(0,xc.Autowired)("sideBarService")],Kc.prototype,"sideBarService",2),Fc([(0,xc.RefSelector)("sideBarButtons")],Kc.prototype,"sideBarButtonsComp",2),Fc([xc.PostConstruct],Kc.prototype,"postConstruct",1);var Yc=Kc,qc=class extends Tc.BeanStub{constructor(){super(...arguments),this.isColGroupDef=e=>e&&void 0!==e.children,this.getId=e=>this.isColGroupDef(e)?e.groupId:e.colId}createColumnTree(e){const t=[],i=(e,n)=>{if(this.isColGroupDef(e)){const t=e,s=void 0!==t.groupId?t.groupId:t.headerName,r=new Tc.ProvidedColumnGroup(t,s,!1,n),o=[];return t.children.forEach(e=>{const t=i(e,n+1);t&&o.push(t)}),r.setChildren(o),r}{const i=e,n=i.colId?i.colId:i.field,s=this.columnModel.getPrimaryColumn(n);return s||t.push(i),s}},n=[];return e.forEach(e=>{const t=i(e,0);t&&n.push(t)}),t.length>0&&console.warn("AG Grid: unable to find grid columns for the supplied colDef(s):",t),n}syncLayoutWithGrid(e){const t=this.getLeafPathTrees();e(this.mergeLeafPathTrees(t))}getLeafPathTrees(){const e=(t,i)=>{let n;if(t instanceof Tc.ProvidedColumnGroup)if(t.isPadding())n=i;else{const e=Object.assign({},t.getColGroupDef());e.groupId=t.getGroupId(),e.children=[i],n=e}else{const e=Object.assign({},t.getColDef());e.colId=t.getColId(),n=e}const s=t.getOriginalParent();return s?e(s,n):n};return this.columnModel.getAllGridColumns().filter(e=>{const t=e.getColDef();return e.isPrimary()&&!t.showRowGroup}).map(t=>e(t,t.getColDef()))}mergeLeafPathTrees(e){const t=(e,t)=>this.isColGroupDef(e)&&this.isColGroupDef(t)&&this.getId(e)===this.getId(t),i=(e,t)=>{if(!this.isColGroupDef(t))return e;const n=e,s=t;return s.children&&s.groupId&&this.addChildrenToGroup(n,s.groupId,s.children[0])||s.children.forEach(e=>i(n,e)),n},n=[];for(let s=1;s<=e.length;s++){const r=e[s-1],o=e[s];t(r,o)?e[s]=i(r,o):n.push(r)}return n}addChildrenToGroup(e,t,i){if(!this.isColGroupDef(e))return!0;const n=e,s=i;if(((e,t)=>{const i=e.children.map(this.getId),n=Tc._.includes(i,this.getId(t)),s=Tc._.last(e.children),r=s&&this.getId(s)!==this.getId(t);return n&&r})(n,s))return n.children.push(s),!0;if(n.groupId===t){const e=n.children.map(this.getId);if(!Tc._.includes(e,this.getId(s)))return n.children.push(s),!0}return n.children.forEach(e=>this.addChildrenToGroup(e,t,i)),!1}};Fc([(0,Tc.Autowired)("columnModel")],qc.prototype,"columnModel",2),qc=Fc([(0,Tc.Bean)("toolPanelColDefService")],qc);var Xc=class extends Dc.BeanStub{registerSideBarComp(e){this.sideBarComp=e}getSideBarComp(){return this.sideBarComp}};Xc=Fc([(0,Dc.Bean)("sideBarService")],Xc);var Zc={version:"31.3.4",moduleName:wc.ModuleNames.SideBarModule,beans:[qc,Xc],agStackComponents:[{componentName:"AgHorizontalResize",componentClass:Gc},{componentName:"AgSideBar",componentClass:Yc},{componentName:"AgSideBarButtons",componentClass:Uc}],dependantModules:[D]},Qc=i(98092),Jc=Object.defineProperty,eh=Object.getOwnPropertyDescriptor,th=Object.getOwnPropertySymbols,ih=Object.prototype.hasOwnProperty,nh=Object.prototype.propertyIsEnumerable,sh=(e,t,i)=>t in e?Jc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,rh=(e,t)=>{for(var i in t||(t={}))ih.call(t,i)&&sh(e,i,t[i]);if(th)for(var i of th(t))nh.call(t,i)&&sh(e,i,t[i]);return e},oh=(e,t,i,n)=>{for(var s,r=n>1?void 0:n?eh(t,i):t,o=e.length-1;o>=0;o--)(s=e[o])&&(r=(n?s(t,i,r):s(r))||r);return n&&r&&Jc(t,i,r),r},ah=class e extends fl.Component{constructor(){super(e.TEMPLATE)}postConstruct(){this.createExpandIcons(),this.addManagedListener(this.eExpand,"click",this.onExpandClicked.bind(this)),this.addManagedListener(this.eExpand,"keydown",e=>{e.key===fl.KeyCode.SPACE&&(e.preventDefault(),this.onExpandClicked())}),this.addManagedListener(this.eSelect.getInputElement(),"click",this.onSelectClicked.bind(this)),this.addManagedPropertyListener("functionsReadOnly",()=>this.onFunctionsReadOnlyPropChanged()),this.eFilterTextField.setAutoComplete(!1).onValueChange(()=>this.onFilterTextChanged()),this.addManagedListener(this.eFilterTextField.getInputElement(),"keydown",this.onMiniFilterKeyDown.bind(this)),this.addManagedListener(this.eventService,fl.Events.EVENT_NEW_COLUMNS_LOADED,this.showOrHideOptions.bind(this));const e=this.localeService.getLocaleTextFunc();this.eSelect.setInputAriaLabel(e("ariaColumnSelectAll","Toggle Select All Columns")),this.eFilterTextField.setInputAriaLabel(e("ariaFilterColumnsInput","Filter Columns Input")),this.activateTabIndex([this.eExpand])}onFunctionsReadOnlyPropChanged(){const e=this.gos.get("functionsReadOnly");this.eSelect.setReadOnly(e),this.eSelect.addOrRemoveCssClass("ag-column-select-column-readonly",e)}init(e){this.params=e;const t=this.gos.get("functionsReadOnly");this.eSelect.setReadOnly(t),this.eSelect.addOrRemoveCssClass("ag-column-select-column-readonly",t),this.columnModel.isReady()&&this.showOrHideOptions()}createExpandIcons(){this.eExpand.appendChild(this.eExpandChecked=fl._.createIconNoSpan("columnSelectOpen",this.gos)),this.eExpand.appendChild(this.eExpandUnchecked=fl._.createIconNoSpan("columnSelectClosed",this.gos)),this.eExpand.appendChild(this.eExpandIndeterminate=fl._.createIconNoSpan("columnSelectIndeterminate",this.gos)),this.setExpandState(0)}showOrHideOptions(){const e=!this.params.suppressColumnFilter,t=!this.params.suppressColumnSelectAll,i=!this.params.suppressColumnExpandAll,n=this.columnModel.isPrimaryColumnGroupsPresent(),s=this.localeService.getLocaleTextFunc();this.eFilterTextField.setInputPlaceholder(s("searchOoo","Search...")),fl._.setDisplayed(this.eFilterTextField.getGui(),e),fl._.setDisplayed(this.eSelect.getGui(),t),fl._.setDisplayed(this.eExpand,i&&n)}onFilterTextChanged(){this.onFilterTextChangedDebounced||(this.onFilterTextChangedDebounced=fl._.debounce(()=>{const e=this.eFilterTextField.getValue();this.dispatchEvent({type:"filterChanged",filterText:e})},e.DEBOUNCE_DELAY)),this.onFilterTextChangedDebounced()}onMiniFilterKeyDown(t){t.key===fl.KeyCode.ENTER&&setTimeout(()=>this.onSelectClicked(),e.DEBOUNCE_DELAY)}onSelectClicked(){this.dispatchEvent({type:this.selectState?"unselectAll":"selectAll"})}onExpandClicked(){this.dispatchEvent({type:0===this.expandState?"collapseAll":"expandAll"})}setExpandState(e){this.expandState=e,fl._.setDisplayed(this.eExpandChecked,0===this.expandState),fl._.setDisplayed(this.eExpandUnchecked,1===this.expandState),fl._.setDisplayed(this.eExpandIndeterminate,2===this.expandState)}setSelectionState(e){this.selectState=e,this.eSelect.setValue(this.selectState)}};ah.DEBOUNCE_DELAY=300,ah.TEMPLATE='<div class="ag-column-select-header" role="presentation">\n            <div ref="eExpand" class="ag-column-select-header-icon"></div>\n            <ag-checkbox ref="eSelect" class="ag-column-select-header-checkbox"></ag-checkbox>\n            <ag-input-text-field class="ag-column-select-header-filter-wrapper" ref="eFilterTextField"></ag-input-text-field>\n        </div>',oh([(0,fl.Autowired)("columnModel")],ah.prototype,"columnModel",2),oh([(0,fl.RefSelector)("eExpand")],ah.prototype,"eExpand",2),oh([(0,fl.RefSelector)("eSelect")],ah.prototype,"eSelect",2),oh([(0,fl.RefSelector)("eFilterTextField")],ah.prototype,"eFilterTextField",2),oh([fl.PostConstruct],ah.prototype,"postConstruct",1);var lh=ah,ch=class e{constructor(e,t,i,n=!1,s){this.eventService=new bl.EventService,this.displayName=e,this.dept=i,this.group=n,n?(this.columnGroup=t,this.expanded=s,this.children=[]):this.column=t}isGroup(){return this.group}getDisplayName(){return this.displayName}getColumnGroup(){return this.columnGroup}getColumn(){return this.column}getDept(){return this.dept}isExpanded(){return!!this.expanded}getChildren(){return this.children}isPassesFilter(){return this.passesFilter}setExpanded(t){t!==this.expanded&&(this.expanded=t,this.eventService.dispatchEvent({type:e.EVENT_EXPANDED_CHANGED}))}setPassesFilter(e){this.passesFilter=e}addEventListener(e,t){this.eventService.addEventListener(e,t)}removeEventListener(e,t){this.eventService.removeEventListener(e,t)}};ch.EVENT_EXPANDED_CHANGED="expandedChanged";var hh=ch,uh=class extends Cl.Component{constructor(e,t,i){super('<div class="ag-menu"></div>'),this.column=e,this.mouseEvent=t,this.parentEl=i,this.displayName=null}postConstruct(){if(this.initializeProperties(this.column),this.buildMenuItemMap(),this.column instanceof Cl.Column?this.displayName=this.columnModel.getDisplayNameForColumn(this.column,"columnToolPanel"):this.displayName=this.columnModel.getDisplayNameForProvidedColumnGroup(null,this.column,"columnToolPanel"),this.isActive()){this.mouseEvent.preventDefault();const e=this.getMappedMenuItems();if(0===e.length)return;this.displayContextMenu(e)}}initializeProperties(e){e instanceof Cl.ProvidedColumnGroup?this.columns=e.getLeafColumns():this.columns=[e],this.allowGrouping=this.columns.some(e=>e.isPrimary()&&e.isAllowRowGroup()),this.allowValues=this.columns.some(e=>e.isPrimary()&&e.isAllowValue()),this.allowPivoting=this.columnModel.isPivotMode()&&this.columns.some(e=>e.isPrimary()&&e.isAllowPivot())}buildMenuItemMap(){const e=this.localeService.getLocaleTextFunc();this.menuItemMap=new Map,this.menuItemMap.set("rowGroup",{allowedFunction:e=>e.isPrimary()&&e.isAllowRowGroup()&&!this.columnModel.isColumnGroupingLocked(e),activeFunction:e=>e.isRowGroupActive(),activateLabel:()=>`${e("groupBy","Group by")} ${this.displayName}`,deactivateLabel:()=>`${e("ungroupBy","Un-Group by")} ${this.displayName}`,activateFunction:()=>{const e=this.columnModel.getRowGroupColumns();this.columnModel.setRowGroupColumns(this.addColumnsToList(e),"toolPanelUi")},deActivateFunction:()=>{const e=this.columnModel.getRowGroupColumns();this.columnModel.setRowGroupColumns(this.removeColumnsFromList(e),"toolPanelUi")},addIcon:"menuAddRowGroup",removeIcon:"menuRemoveRowGroup"}),this.menuItemMap.set("value",{allowedFunction:e=>e.isPrimary()&&e.isAllowValue(),activeFunction:e=>e.isValueActive(),activateLabel:()=>e("addToValues",`Add ${this.displayName} to values`,[this.displayName]),deactivateLabel:()=>e("removeFromValues",`Remove ${this.displayName} from values`,[this.displayName]),activateFunction:()=>{const e=this.columnModel.getValueColumns();this.columnModel.setValueColumns(this.addColumnsToList(e),"toolPanelUi")},deActivateFunction:()=>{const e=this.columnModel.getValueColumns();this.columnModel.setValueColumns(this.removeColumnsFromList(e),"toolPanelUi")},addIcon:"valuePanel",removeIcon:"valuePanel"}),this.menuItemMap.set("pivot",{allowedFunction:e=>this.columnModel.isPivotMode()&&e.isPrimary()&&e.isAllowPivot(),activeFunction:e=>e.isPivotActive(),activateLabel:()=>e("addToLabels",`Add ${this.displayName} to labels`,[this.displayName]),deactivateLabel:()=>e("removeFromLabels",`Remove ${this.displayName} from labels`,[this.displayName]),activateFunction:()=>{const e=this.columnModel.getPivotColumns();this.columnModel.setPivotColumns(this.addColumnsToList(e),"toolPanelUi")},deActivateFunction:()=>{const e=this.columnModel.getPivotColumns();this.columnModel.setPivotColumns(this.removeColumnsFromList(e),"toolPanelUi")},addIcon:"pivotPanel",removeIcon:"pivotPanel"})}addColumnsToList(e){return[...e].concat(this.columns.filter(t=>-1===e.indexOf(t)))}removeColumnsFromList(e){return e.filter(e=>-1===this.columns.indexOf(e))}displayContextMenu(e){const t=this.getGui(),i=this.createBean(new Cl.AgMenuList),n=this.localeService.getLocaleTextFunc();let s=()=>{};t.appendChild(i.getGui()),i.addMenuItems(e),i.addManagedListener(i,Cl.AgMenuItemComponent.EVENT_CLOSE_MENU,()=>{this.parentEl.focus(),s()});const r=this.popupService.addPopup({modal:!0,eChild:t,closeOnEsc:!0,afterGuiAttached:()=>this.focusService.focusInto(i.getGui()),ariaLabel:n("ariaLabelContextMenu","Context Menu"),closedCallback:e=>{e instanceof KeyboardEvent&&this.parentEl.focus(),this.destroyBean(i)}});r&&(s=r.hideFunc),this.popupService.positionPopupUnderMouseEvent({type:"columnContextMenu",mouseEvent:this.mouseEvent,ePopup:t})}isActive(){return this.allowGrouping||this.allowValues||this.allowPivoting}getMappedMenuItems(){const e=[];for(const t of this.menuItemMap.values()){const i=this.columns.some(e=>t.allowedFunction(e)&&!t.activeFunction(e)),n=this.columns.some(e=>t.allowedFunction(e)&&t.activeFunction(e));i&&e.push({name:t.activateLabel(this.displayName),icon:Cl._.createIconNoSpan(t.addIcon,this.gos,null),action:()=>t.activateFunction()}),n&&e.push({name:t.deactivateLabel(this.displayName),icon:Cl._.createIconNoSpan(t.removeIcon,this.gos,null),action:()=>t.deActivateFunction()})}return e}};oh([(0,Cl.Autowired)("columnModel")],uh.prototype,"columnModel",2),oh([(0,Cl.Autowired)("popupService")],uh.prototype,"popupService",2),oh([(0,Cl.Autowired)("focusService")],uh.prototype,"focusService",2),oh([Cl.PostConstruct],uh.prototype,"postConstruct",1);var dh=class e extends vl.Component{constructor(e,t,i,n){super(),this.modelItem=e,this.allowDragging=t,this.eventType=i,this.focusWrapper=n,this.processingColumnStateChange=!1,this.modelItem=e,this.columnGroup=e.getColumnGroup(),this.columnDept=e.getDept(),this.displayName=e.getDisplayName(),this.allowDragging=t}init(){this.setTemplate(e.TEMPLATE),this.eDragHandle=vl._.createIconNoSpan("columnDrag",this.gos),this.eDragHandle.classList.add("ag-drag-handle","ag-column-select-column-group-drag-handle");const t=this.cbSelect.getGui(),i=this.cbSelect.getInputElement();t.insertAdjacentElement("afterend",this.eDragHandle),i.setAttribute("tabindex","-1"),this.eLabel.innerHTML=this.displayName?this.displayName:"",this.setupExpandContract(),this.addCssClass("ag-column-select-indent-"+this.columnDept),this.addManagedListener(this.eventService,vl.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.eLabel,"click",this.onLabelClicked.bind(this)),this.addManagedListener(this.cbSelect,vl.Events.EVENT_FIELD_VALUE_CHANGED,this.onCheckboxChanged.bind(this)),this.addManagedListener(this.modelItem,hh.EVENT_EXPANDED_CHANGED,this.onExpandChanged.bind(this)),this.addManagedListener(this.focusWrapper,"keydown",this.handleKeyDown.bind(this)),this.addManagedListener(this.focusWrapper,"contextmenu",this.onContextMenu.bind(this)),this.setOpenClosedIcons(),this.setupDragging(),this.onColumnStateChanged(),this.addVisibilityListenersToAllChildren(),this.refreshAriaExpanded(),this.refreshAriaLabel(),this.setupTooltip(),vl.CssClassApplier.getToolPanelClassesFromColDef(this.columnGroup.getColGroupDef(),this.gos,null,this.columnGroup).forEach(e=>this.addOrRemoveCssClass(e,!0))}getColumns(){return this.columnGroup.getLeafColumns()}setupTooltip(){const e=this.columnGroup.getColGroupDef();if(!e)return;let t;"whenTruncated"===this.gos.get("tooltipShowMode")&&(t=()=>this.eLabel.scrollWidth>this.eLabel.clientWidth);const i=()=>{const i=e.headerTooltip;this.setTooltip({newTooltipText:i,location:"columnToolPanelColumnGroup",shouldDisplayTooltip:t})};i(),this.addManagedListener(this.eventService,vl.Events.EVENT_NEW_COLUMNS_LOADED,i)}getTooltipParams(){const e=super.getTooltipParams();return e.location="columnToolPanelColumnGroup",e}handleKeyDown(e){switch(e.key){case vl.KeyCode.LEFT:e.preventDefault(),this.modelItem.setExpanded(!1);break;case vl.KeyCode.RIGHT:e.preventDefault(),this.modelItem.setExpanded(!0);break;case vl.KeyCode.SPACE:e.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected())}}onContextMenu(e){const{columnGroup:t,gos:i}=this;if(i.get("functionsReadOnly"))return;const n=this.createBean(new uh(t,e,this.focusWrapper));this.addDestroyFunc(()=>{n.isAlive()&&this.destroyBean(n)})}addVisibilityListenersToAllChildren(){this.columnGroup.getLeafColumns().forEach(e=>{this.addManagedListener(e,vl.Column.EVENT_VISIBLE_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(e,vl.Column.EVENT_VALUE_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(e,vl.Column.EVENT_PIVOT_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(e,vl.Column.EVENT_ROW_GROUP_CHANGED,this.onColumnStateChanged.bind(this))})}setupDragging(){if(!this.allowDragging)return void vl._.setDisplayed(this.eDragHandle,!1);let e=!this.gos.get("suppressDragLeaveHidesColumns");const t={type:vl.DragSourceType.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,getDefaultIconName:()=>e?vl.DragAndDropService.ICON_HIDE:vl.DragAndDropService.ICON_NOT_ALLOWED,getDragItem:()=>this.createDragItem(),onDragStarted:()=>{e=!this.gos.get("suppressDragLeaveHidesColumns");const t={type:vl.Events.EVENT_COLUMN_PANEL_ITEM_DRAG_START,column:this.columnGroup};this.eventService.dispatchEvent(t)},onDragStopped:()=>{const e={type:vl.Events.EVENT_COLUMN_PANEL_ITEM_DRAG_END};this.eventService.dispatchEvent(e)},onGridEnter:t=>{e&&this.modelItemUtils.updateColumns({columns:this.columnGroup.getLeafColumns(),visibleState:null==t?void 0:t.visibleState,pivotState:null==t?void 0:t.pivotState,eventType:this.eventType})},onGridExit:()=>{e&&this.onChangeCommon(!1)}};this.dragAndDropService.addDragSource(t,!0),this.addDestroyFunc(()=>this.dragAndDropService.removeDragSource(t))}createDragItem(){const e=this.columnGroup.getLeafColumns(),t={},i={};return e.forEach(e=>{const n=e.getId();t[n]=e.isVisible(),i[n]=this.modelItemUtils.createPivotState(e)}),{columns:e,visibleState:t,pivotState:i}}setupExpandContract(){this.eGroupClosedIcon.appendChild(vl._.createIcon("columnSelectClosed",this.gos,null)),this.eGroupOpenedIcon.appendChild(vl._.createIcon("columnSelectOpen",this.gos,null)),this.addManagedListener(this.eGroupClosedIcon,"click",this.onExpandOrContractClicked.bind(this)),this.addManagedListener(this.eGroupOpenedIcon,"click",this.onExpandOrContractClicked.bind(this));const e=new vl.TouchListener(this.eColumnGroupIcons,!0);this.addManagedListener(e,vl.TouchListener.EVENT_TAP,this.onExpandOrContractClicked.bind(this)),this.addDestroyFunc(e.destroy.bind(e))}onLabelClicked(){const e=!this.cbSelect.getValue();this.onChangeCommon(e)}onCheckboxChanged(e){this.onChangeCommon(e.selected)}getVisibleLeafColumns(){const e=[],t=i=>{i.forEach(i=>{i.isPassesFilter()&&(i.isGroup()?t(i.getChildren()):e.push(i.getColumn()))})};return t(this.modelItem.getChildren()),e}onChangeCommon(e){this.refreshAriaLabel(),this.processingColumnStateChange||this.modelItemUtils.selectAllChildren(this.modelItem.getChildren(),e,this.eventType)}refreshAriaLabel(){const e=this.localeService.getLocaleTextFunc(),t=e("ariaColumnGroup","Column Group"),i=this.cbSelect.getValue(),n=void 0===i?e("ariaIndeterminate","indeterminate"):i?e("ariaVisible","visible"):e("ariaHidden","hidden"),s=e("ariaToggleVisibility","Press SPACE to toggle visibility");vl._.setAriaLabel(this.focusWrapper,`${this.displayName} ${t}`),this.cbSelect.setInputAriaLabel(`${s} (${n})`),vl._.setAriaDescribedBy(this.focusWrapper,this.cbSelect.getInputElement().id)}onColumnStateChanged(){const e=this.workOutSelectedValue(),t=this.workOutReadOnlyValue();this.processingColumnStateChange=!0,this.cbSelect.setValue(e),this.cbSelect.setReadOnly(t),this.addOrRemoveCssClass("ag-column-select-column-group-readonly",t),this.processingColumnStateChange=!1}workOutSelectedValue(){const e=this.columnModel.isPivotMode(),t=this.getVisibleLeafColumns();let i=0,n=0;if(t.forEach(t=>{!e&&t.getColDef().lockVisible||(this.isColumnChecked(t,e)?i++:n++)}),!(i>0&&n>0))return i>0}workOutReadOnlyValue(){const e=this.columnModel.isPivotMode();let t=0;return this.columnGroup.getLeafColumns().forEach(i=>{e?i.isAnyFunctionAllowed()&&t++:i.getColDef().lockVisible||t++}),0===t}isColumnChecked(e,t){if(t){const t=e.isPivotActive(),i=e.isRowGroupActive(),n=e.isValueActive();return t||i||n}return e.isVisible()}onExpandOrContractClicked(){const e=this.modelItem.isExpanded();this.modelItem.setExpanded(!e)}onExpandChanged(){this.setOpenClosedIcons(),this.refreshAriaExpanded()}setOpenClosedIcons(){const e=this.modelItem.isExpanded();vl._.setDisplayed(this.eGroupClosedIcon,!e),vl._.setDisplayed(this.eGroupOpenedIcon,e)}refreshAriaExpanded(){vl._.setAriaExpanded(this.focusWrapper,this.modelItem.isExpanded())}getDisplayName(){return this.displayName}onSelectAllChanged(e){const t=this.cbSelect.getValue();!this.cbSelect.isReadOnly()&&(e&&!t||!e&&t)&&this.cbSelect.toggle()}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}setSelected(e){this.cbSelect.setValue(e,!0)}};dh.TEMPLATE='<div class="ag-column-select-column-group" aria-hidden="true">\n            <span class="ag-column-group-icons" ref="eColumnGroupIcons" >\n                <span class="ag-column-group-closed-icon" ref="eGroupClosedIcon"></span>\n                <span class="ag-column-group-opened-icon" ref="eGroupOpenedIcon"></span>\n            </span>\n            <ag-checkbox ref="cbSelect" class="ag-column-select-checkbox"></ag-checkbox>\n            <span class="ag-column-select-column-label" ref="eLabel"></span>\n        </div>',oh([(0,vl.Autowired)("columnModel")],dh.prototype,"columnModel",2),oh([(0,vl.Autowired)("dragAndDropService")],dh.prototype,"dragAndDropService",2),oh([(0,vl.Autowired)("modelItemUtils")],dh.prototype,"modelItemUtils",2),oh([(0,vl.RefSelector)("cbSelect")],dh.prototype,"cbSelect",2),oh([(0,vl.RefSelector)("eLabel")],dh.prototype,"eLabel",2),oh([(0,vl.RefSelector)("eGroupOpenedIcon")],dh.prototype,"eGroupOpenedIcon",2),oh([(0,vl.RefSelector)("eGroupClosedIcon")],dh.prototype,"eGroupClosedIcon",2),oh([(0,vl.RefSelector)("eColumnGroupIcons")],dh.prototype,"eColumnGroupIcons",2),oh([vl.PostConstruct],dh.prototype,"init",1);var ph=dh,gh=class extends yl.BeanStub{constructor(e,t){super(),this.comp=e,this.virtualList=t}postConstruct(){this.createManagedBean(new yl.VirtualListDragFeature(this.comp,this.virtualList,{dragSourceType:yl.DragSourceType.ToolPanel,listItemDragStartEvent:yl.Events.EVENT_COLUMN_PANEL_ITEM_DRAG_START,listItemDragEndEvent:yl.Events.EVENT_COLUMN_PANEL_ITEM_DRAG_END,eventSource:this.eventService,getCurrentDragValue:e=>this.getCurrentDragValue(e),isMoveBlocked:e=>this.isMoveBlocked(e),getNumRows:e=>e.getDisplayedColsList().length,moveItem:(e,t)=>this.moveItem(e,t)}))}getCurrentDragValue(e){return e.column}isMoveBlocked(e){return!!this.gos.get("suppressMovableColumns")||!!this.getCurrentColumns(e).find(e=>{const t=e.getColDef();return!!t.suppressMovable||!!t.lockPosition})}moveItem(e,t){const i=this.getTargetIndex(e,t),n=this.getCurrentColumns(e);null!=i&&this.columnModel.moveColumns(n,i,"toolPanelUi")}getMoveDiff(e,t){const i=this.columnModel.getAllGridColumns(),n=this.getCurrentColumns(e),s=n[0],r=n.length;return i.indexOf(s)<t?r:0}getCurrentColumns(e){return e instanceof yl.ProvidedColumnGroup?e.getLeafColumns():[e]}getTargetIndex(e,t){if(!t)return null;const i=t.component;let n,s="top"===t.position;if(i instanceof ph?(n=i.getColumns()[0],s=!0):n=i.getColumn(),-1!==this.getCurrentColumns(e).indexOf(n))return null;const r=this.columnModel.getAllGridColumns().indexOf(n),o=s?r:r+1;return o-this.getMoveDiff(e,o)}};oh([(0,yl.Autowired)("columnModel")],gh.prototype,"columnModel",2),oh([yl.PostConstruct],gh.prototype,"postConstruct",1);var fh=class e extends wl.Component{constructor(e,t,i,n){super(),this.allowDragging=t,this.groupsExist=i,this.focusWrapper=n,this.processingColumnStateChange=!1,this.column=e.getColumn(),this.columnDept=e.getDept(),this.displayName=e.getDisplayName()}init(){this.setTemplate(e.TEMPLATE),this.eDragHandle=wl._.createIconNoSpan("columnDrag",this.gos),this.eDragHandle.classList.add("ag-drag-handle","ag-column-select-column-drag-handle");const t=this.cbSelect.getGui(),i=this.cbSelect.getInputElement();t.insertAdjacentElement("afterend",this.eDragHandle),i.setAttribute("tabindex","-1");const n=wl._.escapeString(this.displayName);this.eLabel.innerHTML=n;const s=this.columnDept;this.groupsExist&&this.addCssClass("ag-column-select-add-group-indent"),this.addCssClass(`ag-column-select-indent-${s}`),this.setupDragging(),this.addManagedListener(this.eventService,wl.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.column,wl.Column.EVENT_VALUE_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.column,wl.Column.EVENT_PIVOT_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.column,wl.Column.EVENT_ROW_GROUP_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.column,wl.Column.EVENT_VISIBLE_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.focusWrapper,"keydown",this.handleKeyDown.bind(this)),this.addManagedListener(this.focusWrapper,"contextmenu",this.onContextMenu.bind(this)),this.addManagedPropertyListener("functionsReadOnly",this.onColumnStateChanged.bind(this)),this.addManagedListener(this.cbSelect,wl.Events.EVENT_FIELD_VALUE_CHANGED,this.onCheckboxChanged.bind(this)),this.addManagedListener(this.eLabel,"click",this.onLabelClicked.bind(this)),this.onColumnStateChanged(),this.refreshAriaLabel(),this.setupTooltip(),wl.CssClassApplier.getToolPanelClassesFromColDef(this.column.getColDef(),this.gos,this.column,null).forEach(e=>this.addOrRemoveCssClass(e,!0))}getColumn(){return this.column}setupTooltip(){let e;"whenTruncated"===this.gos.get("tooltipShowMode")&&(e=()=>this.eLabel.scrollWidth>this.eLabel.clientWidth);const t=()=>{const t=this.column.getColDef().headerTooltip;this.setTooltip({newTooltipText:t,location:"columnToolPanelColumn",shouldDisplayTooltip:e})};t(),this.addManagedListener(this.eventService,wl.Events.EVENT_NEW_COLUMNS_LOADED,t)}getTooltipParams(){const e=super.getTooltipParams();return e.location="columnToolPanelColumn",e.colDef=this.column.getColDef(),e}onContextMenu(e){const{column:t,gos:i}=this;if(i.get("functionsReadOnly"))return;const n=this.createBean(new uh(t,e,this.focusWrapper));this.addDestroyFunc(()=>{n.isAlive()&&this.destroyBean(n)})}handleKeyDown(e){e.key===wl.KeyCode.SPACE&&(e.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected()))}onLabelClicked(){if(this.gos.get("functionsReadOnly"))return;const e=!this.cbSelect.getValue();this.onChangeCommon(e)}onCheckboxChanged(e){this.onChangeCommon(e.selected)}onChangeCommon(e){this.cbSelect.isReadOnly()||(this.refreshAriaLabel(),this.processingColumnStateChange||this.modelItemUtils.setColumn(this.column,e,"toolPanelUi"))}refreshAriaLabel(){const e=this.localeService.getLocaleTextFunc(),t=e("ariaColumn","Column"),i=this.cbSelect.getValue()?e("ariaVisible","visible"):e("ariaHidden","hidden"),n=e("ariaToggleVisibility","Press SPACE to toggle visibility");wl._.setAriaLabel(this.focusWrapper,`${this.displayName} ${t}`),this.cbSelect.setInputAriaLabel(`${n} (${i})`),wl._.setAriaDescribedBy(this.focusWrapper,this.cbSelect.getInputElement().id)}setupDragging(){if(!this.allowDragging)return void wl._.setDisplayed(this.eDragHandle,!1);let e=!this.gos.get("suppressDragLeaveHidesColumns");const t={type:wl.DragSourceType.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,getDefaultIconName:()=>e?wl.DragAndDropService.ICON_HIDE:wl.DragAndDropService.ICON_NOT_ALLOWED,getDragItem:()=>this.createDragItem(),onDragStarted:()=>{e=!this.gos.get("suppressDragLeaveHidesColumns");const t={type:wl.Events.EVENT_COLUMN_PANEL_ITEM_DRAG_START,column:this.column};this.eventService.dispatchEvent(t)},onDragStopped:()=>{const e={type:wl.Events.EVENT_COLUMN_PANEL_ITEM_DRAG_END};this.eventService.dispatchEvent(e)},onGridEnter:t=>{e&&this.modelItemUtils.updateColumns({columns:[this.column],visibleState:null==t?void 0:t.visibleState,pivotState:null==t?void 0:t.pivotState,eventType:"toolPanelUi"})},onGridExit:()=>{e&&this.onChangeCommon(!1)}};this.dragAndDropService.addDragSource(t,!0),this.addDestroyFunc(()=>this.dragAndDropService.removeDragSource(t))}createDragItem(){const e=this.column.getColId(),t={[e]:this.column.isVisible()},i={[e]:this.modelItemUtils.createPivotState(this.column)};return{columns:[this.column],visibleState:t,pivotState:i}}onColumnStateChanged(){this.processingColumnStateChange=!0;const e=this.columnModel.isPivotMode();if(e){const e=this.column.isAnyFunctionActive();this.cbSelect.setValue(e)}else this.cbSelect.setValue(this.column.isVisible());let t=!0,i=!0;if(e){const e=this.gos.get("functionsReadOnly"),n=!this.column.isAnyFunctionAllowed();t=!e&&!n,i=t}else{const{enableRowGroup:e,enableValue:n,lockPosition:s,suppressMovable:r,lockVisible:o}=this.column.getColDef();t=!o,i=!!e||!!n||!(s||r)}this.cbSelect.setReadOnly(!t),this.eDragHandle.classList.toggle("ag-column-select-column-readonly",!i),this.addOrRemoveCssClass("ag-column-select-column-readonly",!i&&!t);const n=e&&this.gos.get("functionsPassive");this.cbSelect.setPassive(n),this.processingColumnStateChange=!1}getDisplayName(){return this.displayName}onSelectAllChanged(e){e!==this.cbSelect.getValue()&&(this.cbSelect.isReadOnly()||this.cbSelect.toggle())}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}isExpandable(){return!1}setExpanded(e){console.warn("AG Grid: can not expand a column item that does not represent a column group header")}};fh.TEMPLATE='<div class="ag-column-select-column" aria-hidden="true">\n            <ag-checkbox ref="cbSelect" class="ag-column-select-checkbox"></ag-checkbox>\n            <span class="ag-column-select-column-label" ref="eLabel"></span>\n        </div>',oh([(0,wl.Autowired)("columnModel")],fh.prototype,"columnModel",2),oh([(0,wl.Autowired)("dragAndDropService")],fh.prototype,"dragAndDropService",2),oh([(0,wl.Autowired)("modelItemUtils")],fh.prototype,"modelItemUtils",2),oh([(0,wl.RefSelector)("eLabel")],fh.prototype,"eLabel",2),oh([(0,wl.RefSelector)("cbSelect")],fh.prototype,"cbSelect",2),oh([wl.PostConstruct],fh.prototype,"init",1);var mh=fh,yh=class{constructor(e){this.items=e}getRowCount(){return this.items.length}getRow(e){return this.items[e]}},vh=class e extends ml.Component{constructor(){super(e.TEMPLATE),this.destroyColumnItemFuncs=[],this.hasLoadedInitialState=!1,this.isInitialState=!1}destroyColumnTree(){this.allColsTree=[],this.destroyColumnItemFuncs.forEach(e=>e()),this.destroyColumnItemFuncs=[]}init(e,t,i){this.params=e,this.allowDragging=t,this.eventType=i,this.params.suppressSyncLayoutWithGrid||this.addManagedListener(this.eventService,ml.Events.EVENT_COLUMN_MOVED,this.onColumnsChanged.bind(this)),this.addManagedListener(this.eventService,ml.Events.EVENT_NEW_COLUMNS_LOADED,this.onColumnsChanged.bind(this)),[ml.Events.EVENT_COLUMN_PIVOT_CHANGED,ml.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,ml.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,ml.Events.EVENT_COLUMN_VALUE_CHANGED,ml.Events.EVENT_COLUMN_VISIBLE,ml.Events.EVENT_NEW_COLUMNS_LOADED].forEach(e=>{this.addManagedListener(this.eventService,e,this.fireSelectionChangedEvent.bind(this))}),this.expandGroupsByDefault=!this.params.contractColumnSelection,this.virtualList=this.createManagedBean(new ml.VirtualList({cssIdentifier:"column-select",ariaRole:"tree"})),this.appendChild(this.virtualList.getGui()),this.virtualList.setComponentCreator((e,t)=>(ml._.setAriaLevel(t,e.getDept()+1),this.createComponentFromItem(e,t))),this.columnModel.isReady()&&this.onColumnsChanged(),this.params.suppressColumnMove||this.createManagedBean(new gh(this,this.virtualList))}createComponentFromItem(e,t){if(e.isGroup()){const i=new ph(e,this.allowDragging,this.eventType,t);return this.getContext().createBean(i),i}const i=new mh(e,this.allowDragging,this.groupsExist,t);return this.getContext().createBean(i),i}onColumnsChanged(){this.hasLoadedInitialState||(this.hasLoadedInitialState=!0,this.isInitialState=!!this.params.initialState);const e=this.getExpandedStates(),t=this.columnModel.isPivotMode();this.params.suppressSyncLayoutWithGrid||t?this.buildTreeFromProvidedColumnDefs():this.buildTreeFromWhatGridIsDisplaying(),this.setExpandedStates(e),this.markFilteredColumns(),this.flattenAndFilterModel(),this.isInitialState=!1}getDisplayedColsList(){return this.displayedColsList}getExpandedStates(){const e={};if(this.isInitialState){const{expandedGroupIds:t}=this.params.initialState;return t.forEach(t=>{e[t]=!0}),e}return this.allColsTree?(this.forEachItem(t=>{if(!t.isGroup())return;const i=t.getColumnGroup();i&&(e[i.getId()]=t.isExpanded())}),e):{}}setExpandedStates(e){if(!this.allColsTree)return;const{isInitialState:t}=this;this.forEachItem(i=>{if(!i.isGroup())return;const n=i.getColumnGroup();if(n){const s=e[n.getId()];(null!=s||t)&&i.setExpanded(!!s)}})}buildTreeFromWhatGridIsDisplaying(){this.colDefService.syncLayoutWithGrid(this.setColumnLayout.bind(this))}setColumnLayout(e){const t=this.colDefService.createColumnTree(e);this.buildListModel(t),this.groupsExist=e.some(e=>e&&void 0!==e.children),this.markFilteredColumns(),this.flattenAndFilterModel()}buildTreeFromProvidedColumnDefs(){this.buildListModel(this.columnModel.getPrimaryColumnTree()),this.groupsExist=this.columnModel.isPrimaryColumnGroupsPresent()}buildListModel(e){const t=this.onColumnExpanded.bind(this),i=e=>{e.addEventListener(hh.EVENT_EXPANDED_CHANGED,t);const i=e.removeEventListener.bind(e,hh.EVENT_EXPANDED_CHANGED,t);this.destroyColumnItemFuncs.push(i)},n=(e,t,i)=>{e.forEach(e=>{e instanceof ml.ProvidedColumnGroup?s(e,t,i):r(e,t,i)})},s=(e,t,s)=>{const r=e.getColGroupDef();if(r&&r.suppressColumnsToolPanel)return;if(e.isPadding())return void n(e.getChildren(),t,s);const o=this.columnModel.getDisplayNameForProvidedColumnGroup(null,e,"columnToolPanel"),a=new hh(o,e,t,!0,this.expandGroupsByDefault);s.push(a),i(a),n(e.getChildren(),t+1,a.getChildren())},r=(e,t,i)=>{if(e.getColDef()&&e.getColDef().suppressColumnsToolPanel)return;const n=this.columnModel.getDisplayNameForColumn(e,"columnToolPanel");i.push(new hh(n,e,t))};this.destroyColumnTree(),n(e,0,this.allColsTree)}onColumnExpanded(){this.flattenAndFilterModel()}flattenAndFilterModel(){this.displayedColsList=[];const e=t=>{t.isPassesFilter()&&(this.displayedColsList.push(t),t.isGroup()&&t.isExpanded()&&t.getChildren().forEach(e))};this.allColsTree.forEach(e),this.virtualList.setModel(new yh(this.displayedColsList));const t=this.virtualList.getLastFocusedRow();this.virtualList.refresh(),null!=t&&this.focusRowIfAlive(t),this.notifyListeners(),this.refreshAriaLabel()}refreshAriaLabel(){const e=this.localeService.getLocaleTextFunc(),t=e("ariaColumnPanelList","Column List"),i=e("columns","Columns"),n=this.displayedColsList.length;ml._.setAriaLabel(this.virtualList.getAriaElement(),`${t} ${n} ${i}`)}focusRowIfAlive(e){window.setTimeout(()=>{this.isAlive()&&this.virtualList.focusRow(e)},0)}forEachItem(e){const t=i=>{i.forEach(i=>{e(i),i.isGroup()&&t(i.getChildren())})};this.allColsTree&&t(this.allColsTree)}doSetExpandedAll(e){this.forEachItem(t=>{t.isGroup()&&t.setExpanded(e)})}setGroupsExpanded(e,t){if(!t)return void this.doSetExpandedAll(e);const i=[];this.forEachItem(n=>{if(!n.isGroup())return;const s=n.getColumnGroup().getId();t.indexOf(s)>=0&&(n.setExpanded(e),i.push(s))});const n=t.filter(e=>!ml._.includes(i,e));n.length>0&&console.warn("AG Grid: unable to find group(s) for supplied groupIds:",n)}getExpandState(){let e=0,t=0;return this.forEachItem(i=>{i.isGroup()&&(i.isExpanded()?e++:t++)}),e>0&&t>0?2:t>0?1:0}doSetSelectedAll(e){this.modelItemUtils.selectAllChildren(this.allColsTree,e,this.eventType)}getSelectionState(){let e=0,t=0;const i=this.columnModel.isPivotMode();if(this.forEachItem(n=>{if(n.isGroup())return;if(!n.isPassesFilter())return;const s=n.getColumn(),r=s.getColDef();let o;if(i){if(!s.isAllowPivot()&&!s.isAllowRowGroup()&&!s.isAllowValue())return;o=s.isValueActive()||s.isPivotActive()||s.isRowGroupActive()}else{if(r.lockVisible)return;o=s.isVisible()}o?e++:t++}),!(e>0&&t>0))return!(0===e||t>0)}setFilterText(e){this.filterText=ml._.exists(e)?e.toLowerCase():null,this.markFilteredColumns(),this.flattenAndFilterModel()}markFilteredColumns(){const e=e=>{if(!ml._.exists(this.filterText))return!0;const t=e.getDisplayName();return null==t||-1!==t.toLowerCase().indexOf(this.filterText)},t=(i,n)=>{let s=!1;if(i.isGroup()){const r=e(i);i.getChildren().forEach(e=>{const i=t(e,r||n);i&&(s=i)})}const r=!(!n&&!s)||e(i);return i.setPassesFilter(r),r};this.allColsTree.forEach(e=>t(e,!1))}notifyListeners(){this.fireGroupExpandedEvent(),this.fireSelectionChangedEvent()}fireGroupExpandedEvent(){const e=this.getExpandState();this.dispatchEvent({type:"groupExpanded",state:e})}fireSelectionChangedEvent(){if(!this.allColsTree)return;const e=this.getSelectionState();this.dispatchEvent({type:"selectionChanged",state:e})}getExpandedGroups(){const e=[];return this.allColsTree?(this.forEachItem(t=>{t.isGroup()&&t.isExpanded()&&e.push(t.getColumnGroup().getId())}),e):e}};vh.TEMPLATE='<div class="ag-column-select-list" role="presentation"></div>',oh([(0,ml.Autowired)("columnModel")],vh.prototype,"columnModel",2),oh([(0,ml.Autowired)("toolPanelColDefService")],vh.prototype,"colDefService",2),oh([(0,ml.Autowired)("modelItemUtils")],vh.prototype,"modelItemUtils",2),oh([ml.PreDestroy],vh.prototype,"destroyColumnTree",1);var bh=vh,Ch=class extends xl.Component{createTemplate(){return'<div class="ag-pivot-mode-panel">\n                <ag-toggle-button ref="cbPivotMode" class="ag-pivot-mode-select"></ag-toggle-button>\n            </div>'}init(){this.setTemplate(this.createTemplate()),this.cbPivotMode.setValue(this.columnModel.isPivotMode());const e=this.localeService.getLocaleTextFunc();this.cbPivotMode.setLabel(e("pivotMode","Pivot Mode")),this.addManagedListener(this.cbPivotMode,xl.Events.EVENT_FIELD_VALUE_CHANGED,this.onBtPivotMode.bind(this)),this.addManagedListener(this.eventService,xl.Events.EVENT_NEW_COLUMNS_LOADED,this.onPivotModeChanged.bind(this)),this.addManagedListener(this.eventService,xl.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.onPivotModeChanged.bind(this))}onBtPivotMode(){const e=!!this.cbPivotMode.getValue();if(e!==this.columnModel.isPivotMode()){this.gos.updateGridOptions({options:{pivotMode:e},source:"toolPanelUi"});const{api:t}=this;t&&t.refreshHeader()}}onPivotModeChanged(){const e=this.columnModel.isPivotMode();this.cbPivotMode.setValue(e)}};oh([(0,xl.Autowired)("columnModel")],Ch.prototype,"columnModel",2),oh([(0,xl.Autowired)("gridApi")],Ch.prototype,"api",2),oh([(0,xl.RefSelector)("cbPivotMode")],Ch.prototype,"cbPivotMode",2),oh([xl.PreConstruct],Ch.prototype,"init",1);var wh=class e extends Cc.Component{constructor(){super(e.TEMPLATE)}init(e,t,i){this.allowDragging=e,this.params=t,this.eventType=i,this.primaryColsHeaderPanel.init(this.params);const n=this.params.suppressColumnFilter,s=this.params.suppressColumnSelectAll;this.params.suppressColumnExpandAll&&n&&s&&this.primaryColsHeaderPanel.setDisplayed(!1),this.addManagedListener(this.primaryColsListPanel,"groupExpanded",this.onGroupExpanded.bind(this)),this.addManagedListener(this.primaryColsListPanel,"selectionChanged",this.onSelectionChange.bind(this)),this.primaryColsListPanel.init(this.params,this.allowDragging,this.eventType),this.addManagedListener(this.primaryColsHeaderPanel,"expandAll",this.onExpandAll.bind(this)),this.addManagedListener(this.primaryColsHeaderPanel,"collapseAll",this.onCollapseAll.bind(this)),this.addManagedListener(this.primaryColsHeaderPanel,"selectAll",this.onSelectAll.bind(this)),this.addManagedListener(this.primaryColsHeaderPanel,"unselectAll",this.onUnselectAll.bind(this)),this.addManagedListener(this.primaryColsHeaderPanel,"filterChanged",this.onFilterChanged.bind(this)),this.positionableFeature=new Cc.PositionableFeature(this.getGui(),{minHeight:100}),this.createManagedBean(this.positionableFeature)}toggleResizable(e){this.positionableFeature.setResizable(!!e&&{bottom:!0})}onExpandAll(){this.primaryColsListPanel.doSetExpandedAll(!0)}onCollapseAll(){this.primaryColsListPanel.doSetExpandedAll(!1)}expandGroups(e){this.primaryColsListPanel.setGroupsExpanded(!0,e)}collapseGroups(e){this.primaryColsListPanel.setGroupsExpanded(!1,e)}setColumnLayout(e){this.primaryColsListPanel.setColumnLayout(e)}onFilterChanged(e){this.primaryColsListPanel.setFilterText(e.filterText)}syncLayoutWithGrid(){this.primaryColsListPanel.onColumnsChanged()}onSelectAll(){this.primaryColsListPanel.doSetSelectedAll(!0)}onUnselectAll(){this.primaryColsListPanel.doSetSelectedAll(!1)}onGroupExpanded(e){this.primaryColsHeaderPanel.setExpandState(e.state),this.params.onStateUpdated()}onSelectionChange(e){this.primaryColsHeaderPanel.setSelectionState(e.state)}getExpandedGroups(){return this.primaryColsListPanel.getExpandedGroups()}};wh.TEMPLATE='<div class="ag-column-select">\n            <ag-primary-cols-header ref="primaryColsHeaderPanel"></ag-primary-cols-header>\n            <ag-primary-cols-list ref="primaryColsListPanel"></ag-primary-cols-list>\n        </div>',oh([(0,Cc.RefSelector)("primaryColsHeaderPanel")],wh.prototype,"primaryColsHeaderPanel",2),oh([(0,Cc.RefSelector)("primaryColsListPanel")],wh.prototype,"primaryColsListPanel",2);var Sh=wh,xh=class e extends Sl.Component{constructor(){super(e.TEMPLATE),this.initialised=!1,this.childDestroyFuncs=[]}setVisible(e){super.setDisplayed(e),e&&!this.initialised&&this.init(this.params)}init(e){const t=this.gos.addGridCommonParams({suppressColumnMove:!1,suppressColumnSelectAll:!1,suppressColumnFilter:!1,suppressColumnExpandAll:!1,contractColumnSelection:!1,suppressPivotMode:!1,suppressRowGroups:!1,suppressValues:!1,suppressPivots:!1,suppressSyncLayoutWithGrid:!1});if(this.params=rh(rh({},t),e),this.isRowGroupingModuleLoaded()&&!this.params.suppressPivotMode&&(this.pivotModePanel=this.createBean(new Ch),this.childDestroyFuncs.push(()=>this.destroyBean(this.pivotModePanel)),this.appendChild(this.pivotModePanel)),this.primaryColsPanel=this.createBean(new Sh),this.childDestroyFuncs.push(()=>this.destroyBean(this.primaryColsPanel)),this.primaryColsPanel.init(!0,this.params,"toolPanelUi"),this.primaryColsPanel.addCssClass("ag-column-panel-column-select"),this.appendChild(this.primaryColsPanel),this.isRowGroupingModuleLoaded()){this.params.suppressRowGroups||(this.rowGroupDropZonePanel=this.createBean(new uc(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.rowGroupDropZonePanel)),this.appendChild(this.rowGroupDropZonePanel)),this.params.suppressValues||(this.valuesDropZonePanel=this.createBean(new bc(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.valuesDropZonePanel)),this.appendChild(this.valuesDropZonePanel)),this.params.suppressPivots||(this.pivotDropZonePanel=this.createBean(new dc(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.pivotDropZonePanel)),this.appendChild(this.pivotDropZonePanel)),this.setLastVisible();const e=this.addManagedListener(this.eventService,Sl.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,()=>{this.resetChildrenHeight(),this.setLastVisible()});this.childDestroyFuncs.push(()=>e())}this.initialised=!0}setPivotModeSectionVisible(e){this.isRowGroupingModuleLoaded()&&(this.pivotModePanel?this.pivotModePanel.setDisplayed(e):e&&(this.pivotModePanel=this.createBean(new Ch),this.getGui().insertBefore(this.pivotModePanel.getGui(),this.getGui().firstChild),this.childDestroyFuncs.push(()=>this.destroyBean(this.pivotModePanel))),this.setLastVisible())}setRowGroupsSectionVisible(e){this.isRowGroupingModuleLoaded()&&(this.rowGroupDropZonePanel?this.rowGroupDropZonePanel.setDisplayed(e):e&&(this.rowGroupDropZonePanel=this.createManagedBean(new uc(!1)),this.appendChild(this.rowGroupDropZonePanel)),this.setLastVisible())}setValuesSectionVisible(e){this.isRowGroupingModuleLoaded()&&(this.valuesDropZonePanel?this.valuesDropZonePanel.setDisplayed(e):e&&(this.valuesDropZonePanel=this.createManagedBean(new bc(!1)),this.appendChild(this.valuesDropZonePanel)),this.setLastVisible())}setPivotSectionVisible(e){this.isRowGroupingModuleLoaded()&&(this.pivotDropZonePanel?this.pivotDropZonePanel.setDisplayed(e):e&&(this.pivotDropZonePanel=this.createManagedBean(new dc(!1)),this.appendChild(this.pivotDropZonePanel),this.pivotDropZonePanel.setDisplayed(e)),this.setLastVisible())}setResizers(){[this.primaryColsPanel,this.rowGroupDropZonePanel,this.valuesDropZonePanel,this.pivotDropZonePanel].forEach(e=>{if(!e)return;const t=e.getGui();e.toggleResizable(!t.classList.contains("ag-last-column-drop")&&!t.classList.contains("ag-hidden"))})}setLastVisible(){const e=this.getGui();Array.prototype.slice.call(e.querySelectorAll(".ag-column-drop")).forEach(e=>e.classList.remove("ag-last-column-drop"));const t=e.querySelectorAll(".ag-column-drop:not(.ag-hidden)"),i=Sl._.last(t);i&&i.classList.add("ag-last-column-drop"),this.setResizers()}resetChildrenHeight(){const e=this.getGui().children;for(let t=0;t<e.length;t++){const i=e[t];i.style.removeProperty("height"),i.style.removeProperty("flex")}}isRowGroupingModuleLoaded(){return Sl.ModuleRegistry.__assertRegistered(Sl.ModuleNames.RowGroupingModule,"Row Grouping",this.context.getGridId())}expandColumnGroups(e){this.primaryColsPanel.expandGroups(e)}collapseColumnGroups(e){this.primaryColsPanel.collapseGroups(e)}setColumnLayout(e){this.primaryColsPanel.setColumnLayout(e)}syncLayoutWithGrid(){this.primaryColsPanel.syncLayoutWithGrid()}destroyChildren(){this.childDestroyFuncs.forEach(e=>e()),this.childDestroyFuncs.length=0,Sl._.clearElement(this.getGui())}refresh(e){return this.destroyChildren(),this.init(e),!0}getState(){return{expandedGroupIds:this.primaryColsPanel.getExpandedGroups()}}destroy(){this.destroyChildren(),super.destroy()}};xh.TEMPLATE='<div class="ag-column-panel"></div>';var Eh=xh,Ah=class{selectAllChildren(e,t,i){const n=this.extractAllLeafColumns(e);this.setAllColumns(n,t,i)}setColumn(e,t,i){this.setAllColumns([e],t,i)}setAllColumns(e,t,i){this.columnModel.isPivotMode()?this.setAllPivot(e,t,i):this.setAllVisible(e,t,i)}extractAllLeafColumns(e){const t=[],i=e=>{e.forEach(e=>{e.isPassesFilter()&&(e.isGroup()?i(e.getChildren()):t.push(e.getColumn()))})};return i(e),t}setAllVisible(e,t,i){const n=[];e.forEach(e=>{e.getColDef().lockVisible||e.isVisible()!=t&&n.push({colId:e.getId(),hide:!t})}),n.length>0&&this.columnModel.applyColumnState({state:n},i)}setAllPivot(e,t,i){this.gos.get("functionsPassive")?this.setAllPivotPassive(e,t):this.setAllPivotActive(e,t,i)}setAllPivotPassive(e,t){const i=this.columnModel.getPivotColumns().slice(),n=this.columnModel.getValueColumns().slice(),s=this.columnModel.getRowGroupColumns().slice();let r=!1,o=!1,a=!1;const l=t?e=>{e.isAnyFunctionActive()||(e.isAllowValue()?(n.push(e),o=!0):e.isAllowRowGroup()?(s.push(e),r=!0):e.isAllowPivot()&&(i.push(e),a=!0))}:e=>{e.isAnyFunctionActive()&&(i.indexOf(e)>=0&&(Qc._.removeFromArray(i,e),r=!0),n.indexOf(e)>=0&&(Qc._.removeFromArray(n,e),o=!0),s.indexOf(e)>=0&&(Qc._.removeFromArray(s,e),a=!0))};if(e.forEach(l),r){const e={type:Qc.Events.EVENT_COLUMN_PIVOT_CHANGE_REQUEST,columns:i};this.eventService.dispatchEvent(e)}if(a){const e={type:Qc.Events.EVENT_COLUMN_ROW_GROUP_CHANGE_REQUEST,columns:s};this.eventService.dispatchEvent(e)}if(o){const e={type:Qc.Events.EVENT_COLUMN_VALUE_CHANGE_REQUEST,columns:s};this.eventService.dispatchEvent(e)}}setAllPivotActive(e,t,i){const n=[],s=t?e=>{if(!e.isAnyFunctionActive())if(e.isAllowValue()){const t="string"==typeof e.getAggFunc()?e.getAggFunc():this.aggFuncService.getDefaultAggFunc(e);n.push({colId:e.getId(),aggFunc:t})}else e.isAllowRowGroup()?n.push({colId:e.getId(),rowGroup:!0}):e.isAllowPivot()&&n.push({colId:e.getId(),pivot:!0})}:e=>{(e.isPivotActive()||e.isRowGroupActive()||e.isValueActive())&&n.push({colId:e.getId(),pivot:!1,rowGroup:!1,aggFunc:null})};e.forEach(s),n.length>0&&this.columnModel.applyColumnState({state:n},i)}updateColumns(e){const{columns:t,visibleState:i,pivotState:n,eventType:s}=e,r=t.map(e=>{const t=e.getColId();if(this.columnModel.isPivotMode()){const e=null==n?void 0:n[t];return{colId:t,pivot:null==e?void 0:e.pivot,rowGroup:null==e?void 0:e.rowGroup,aggFunc:null==e?void 0:e.aggFunc}}return{colId:t,hide:!(null==i?void 0:i[t])}});this.columnModel.applyColumnState({state:r},s)}createPivotState(e){return{pivot:e.isPivotActive(),rowGroup:e.isRowGroupActive(),aggFunc:e.isValueActive()?e.getAggFunc():void 0}}};oh([(0,Qc.Autowired)("aggFuncService")],Ah.prototype,"aggFuncService",2),oh([(0,Qc.Autowired)("columnModel")],Ah.prototype,"columnModel",2),oh([(0,Qc.Autowired)("gridOptionsService")],Ah.prototype,"gos",2),oh([(0,Qc.Autowired)("eventService")],Ah.prototype,"eventService",2),Ah=oh([(0,Qc.Bean)("modelItemUtils")],Ah);var Mh,Th,Dh,Ih,Rh,kh,Ph,_h,Lh,Nh={version:"31.3.4",moduleName:gl.ModuleNames.ColumnsToolPanelModule,beans:[Ah],agStackComponents:[{componentName:"AgPrimaryColsHeader",componentClass:lh},{componentName:"AgPrimaryColsList",componentClass:bh},{componentName:"AgPrimaryCols",componentClass:Sh}],userComponents:[{componentName:"agColumnsToolPanel",componentClass:Eh}],dependantModules:[D,vc,Zc]},Oh=i(98092),Fh=i(98092),Gh=i(98092),Bh=i(98092),Vh=i(98092),Hh=i(98092),Uh=i(98092),zh=i(98092),Wh=i(98092),jh=i(98092),$h=i(98092),Kh=i(98092),Yh=i(98092),qh=Object.defineProperty,Xh=Object.defineProperties,Zh=Object.getOwnPropertyDescriptor,Qh=Object.getOwnPropertyDescriptors,Jh=Object.getOwnPropertySymbols,eu=Object.prototype.hasOwnProperty,tu=Object.prototype.propertyIsEnumerable,iu=(e,t,i)=>t in e?qh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,nu=(e,t)=>{for(var i in t||(t={}))eu.call(t,i)&&iu(e,i,t[i]);if(Jh)for(var i of Jh(t))tu.call(t,i)&&iu(e,i,t[i]);return e},su=(e,t)=>Xh(e,Qh(t)),ru=(e,t,i,n)=>{for(var s,r=n>1?void 0:n?Zh(t,i):t,o=e.length-1;o>=0;o--)(s=e[o])&&(r=(n?s(t,i,r):s(r))||r);return n&&r&&qh(t,i,r),r},ou={getTemplate(e){const t=(new Date).toJSON();return{name:"cp:coreProperties",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{cp:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",dc:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",dcmitype:"http://purl.org/dc/dcmitype/",xsi:"http://www.w3.org/2001/XMLSchema-instance"}}]},children:[{name:"dc:creator",textNode:e},{name:"dc:title",textNode:"Workbook"},{name:"dcterms:created",properties:{rawMap:{"xsi:type":"dcterms:W3CDTF"}},textNode:t},{name:"dcterms:modified",properties:{rawMap:{"xsi:type":"dcterms:W3CDTF"}},textNode:t}]}}},au={getTemplate(e){const{name:t,ContentType:i,Extension:n,PartName:s}=e;return{name:t,properties:{rawMap:{Extension:n,PartName:s,ContentType:i}}}}},lu={getTemplate(e){const t=new Array(e).fill(void 0).map((e,t)=>({name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",PartName:`/xl/worksheets/sheet${t+1}.xml`})),i=Od.worksheetImages.size,n=Od.worksheetHeaderFooterImages.size,s=Od.worksheetDataTables.size,r={};Od.workbookImageIds.forEach(e=>{const t="jpg"===e.type?"jpeg":e.type;r[t]=!0});const o=new Array(i).fill(void 0).map((e,t)=>({name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.drawing+xml",PartName:`/xl/drawings/drawing${t+1}.xml`})),a=new Array(s).fill(void 0).map((e,t)=>({name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml",PartName:`/xl/tables/${Od.getTableNameFromIndex(t)}.xml`})),l=Object.keys(r).map(e=>({name:"Default",ContentType:`image/${e}`,Extension:e}));return n&&l.push({name:"Default",Extension:"vml",ContentType:"application/vnd.openxmlformats-officedocument.vmlDrawing"}),{name:"Types",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"}},children:[...l,{name:"Default",Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"},{name:"Default",ContentType:"application/xml",Extension:"xml"},{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",PartName:"/xl/workbook.xml"},...t,{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.theme+xml",PartName:"/xl/theme/theme1.xml"},{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",PartName:"/xl/styles.xml"},{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",PartName:"/xl/sharedStrings.xml"},...o,...a,{name:"Override",ContentType:"application/vnd.openxmlformats-package.core-properties+xml",PartName:"/docProps/core.xml"}].map(e=>au.getTemplate(e))}}},cu={0:1,"0.00":2,"#,##0":3,"#,##0.00":4,"0%":9,"0.00%":10,"0.00E+00":11,"# ?/?":12,"# ??/??":13,"mm-dd-yy":14,"d-mmm-yy":15,"d-mmm":16,"mmm-yy":17,"h:mm AM/PM":18,"h:mm:ss AM/PM":19,"h:mm":20,"h:mm:ss":21,"m/d/yy h:mm":22,"#,##0 ;(#,##0)":37,"#,##0 ;[Red](#,##0)":38,"#,##0.00;(#,##0.00)":39,"#,##0.00;[Red](#,##0.00)":40,"mm:ss":45,"[h]:mm:ss":46,"mmss.0":47,"##0.0E+0":48,"@":49},hu=e=>Math.round(96*e/72),uu=e=>Math.ceil(9525*e),du=(e,t)=>{if(!t)return;let i;return i="number"==typeof t?t:t({rowIndex:e}),n=i,Math.round(72*n/96);var n},pu=(e,t)=>{const i=Bh.XmlFactory.createHeader({encoding:"UTF-8",standalone:"yes"}),n=Bh.XmlFactory.createXml(e);return t?n:`${i}${n}`},gu=e=>{const t=String.fromCharCode,i=Math.floor(e/26),n=e%26;return i&&26!==e?n?i<26?t(65+i-1)+t(65+n-1):gu(i)+t(65+n-1):gu(i-1)+"Z":t(65+e-1)},fu=(e,t)=>({name:`xdr:${e}`,children:[{name:"xdr:col",textNode:t.col.toString()},{name:"xdr:colOff",textNode:t.offsetX.toString()},{name:"xdr:row",textNode:t.row.toString()},{name:"xdr:rowOff",textNode:t.offsetY.toString()}]}),mu=e=>{const t=[{name:"a:ext",properties:{rawMap:{uri:"{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}"}},children:[{name:"a16:creationId",properties:{rawMap:{id:"{822E6D20-D7BC-2841-A643-D49A6EF008A2}","xmlns:a16":"http://schemas.microsoft.com/office/drawing/2014/main"}}}]}];switch(e.recolor&&e.recolor.toLowerCase()){case"grayscale":case"sepia":case"washout":t.push({name:"a:ext",properties:{rawMap:{uri:"{C183D7F6-B498-43B3-948B-1728B52AA6E4}"}},children:[{name:"adec:decorative",properties:{rawMap:{val:"0","xmlns:adec":"http://schemas.microsoft.com/office/drawing/2017/decorative"}}}]})}return{name:"a:extLst",children:t}},yu=(e,t)=>({name:"xdr:nvPicPr",children:[{name:"xdr:cNvPr",properties:{rawMap:{id:t,name:e.id,descr:null!=e.altText?e.altText:void 0}},children:[mu(e)]},{name:"xdr:cNvPicPr",properties:{rawMap:{preferRelativeResize:"0"}},children:[{name:"a:picLocks"}]}]}),vu=e=>{if(!e.saturation&&!e.tint)return;const t=[];return e.saturation&&t.push({name:"a:satMod",properties:{rawMap:{val:1e3*e.saturation}}}),e.tint&&t.push({name:"a:tint",properties:{rawMap:{val:1e3*e.tint}}}),t},bu=(e,t)=>{let i;if(e.transparency){const t=Math.min(Math.max(e.transparency,0),100);i=[{name:"a:alphaModFix",properties:{rawMap:{amt:1e5-Math.round(1e3*t)}}}]}if(e.recolor)switch(i||(i=[]),e.recolor.toLocaleLowerCase()){case"grayscale":i.push({name:"a:grayscl"});break;case"sepia":i.push((s={color:"D9C3A5",tint:50,saturation:180},{name:"a:duotone",children:[{name:"a:prstClr",properties:{rawMap:{val:(n={color:"black"}).color}},children:vu(n)},{name:"a:srgbClr",properties:{rawMap:{val:s.color}},children:vu(s)}]}));break;case"washout":i.push({name:"a:lum",properties:{rawMap:{bright:"70000",contrast:"-70000"}}})}var n,s;return{name:"xdr:blipFill",children:[{name:"a:blip",properties:{rawMap:{cstate:"print","r:embed":`rId${t}`,"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships"}},children:i},{name:"a:stretch",children:[{name:"a:fillRect"}]}]}},Cu=(e,t)=>{const i={name:"a:xfrm",children:[{name:"a:off",properties:{rawMap:{x:0,y:0}}},{name:"a:ext",properties:{rawMap:{cx:t.width,cy:t.height}}}]};if(e.rotation){const t=e.rotation;i.properties={rawMap:{rot:6e4*Math.min(Math.max(t,0),360)}}}return{name:"xdr:spPr",children:[i,{name:"a:prstGeom",properties:{rawMap:{prst:"rect"}},children:[{name:"a:avLst"}]}]}},wu=(e,t,i,n)=>({name:"xdr:pic",children:[yu(e,t+1),bu(e,i+1),Cu(e,n)]}),Su={getTemplate(e){const{sheetIndex:t}=e,i=Od.worksheetImages.get(t),n=Od.worksheetImageIds.get(t);return{name:"xdr:wsDr",properties:{rawMap:{"xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main","xmlns:xdr":"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"}},children:i.map((e,t)=>{const i=(e=>{e.fitCell=!!e.fitCell||!e.width||!e.height;const{position:t={},fitCell:i,width:n=0,height:s=0,totalHeight:r,totalWidth:o}=e,{offsetX:a=0,offsetY:l=0,row:c=1,rowSpan:h=1,column:u=1,colSpan:d=1}=t;return{from:{row:c-1,col:u-1,offsetX:uu(a),offsetY:uu(l)},to:{row:c-1+(i?1:h-1),col:u-1+(i?1:d-1),offsetX:uu(n+a),offsetY:uu(s+l)},height:uu(r||s),width:uu(o||n)}})(e);return{name:"xdr:twoCellAnchor",properties:{rawMap:{editAs:"absolute"}},children:[fu("from",i.from),fu("to",i.to),wu(e,t,n.get(e.id).index,i),{name:"xdr:clientData"}]}})}}},xu={getTemplate(e,t){const{name:i,columns:n,rowCount:s,displayName:r,headerRowIndex:o,showRowStripes:a,showColumnStripes:l,showFilterButtons:c,highlightFirstColumn:h,highlightLastColumn:u}=e||{};if(!(e&&i&&Array.isArray(n)&&n.length&&s))return{name:"table"};const d=n.map((e,t)=>({name:"filterColumn",properties:{rawMap:{colId:t.toString(),hiddenButton:c[t]?0:1}}})),p=o+1,g=(t+1).toString(),f=`A${p}:${String.fromCharCode(64+n.length)}${p+s}`;return{name:"table",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"xr xr3","xmlns:xr":"http://schemas.microsoft.com/office/spreadsheetml/2014/revision","xmlns:xr3":"http://schemas.microsoft.com/office/spreadsheetml/2016/revision3",name:i,displayName:t?`${r}_${t+1}`:r,ref:f,totalsRowShown:0,id:g}},children:[{name:"autoFilter",properties:{rawMap:{ref:f}},children:d},{name:"tableColumns",properties:{rawMap:{count:n.length}},children:n.map((e,t)=>({name:"tableColumn",properties:{rawMap:{id:(t+1).toString(),name:e,dataCellStyle:"Normal"}}}))},{name:"tableStyleInfo",properties:{rawMap:{name:"TableStyleLight1",showFirstColumn:h?1:0,showLastColumn:u?1:0,showRowStripes:a?1:0,showColumnStripes:l?1:0}}}]}}},Eu=e=>{const[t,i,n,s]=e;return{name:`a:${t}`,children:[{name:`a:${i}`,properties:{rawMap:{val:n,lastClr:s}}}]}},Au=()=>({name:"a:clrScheme",properties:{rawMap:{name:"Office"}},children:[Eu(["dk1","sysClr","windowText","000000"]),Eu(["lt1","sysClr","window","FFFFFF"]),Eu(["dk2","srgbClr","44546A"]),Eu(["lt2","srgbClr","E7E6E6"]),Eu(["accent1","srgbClr","4472C4"]),Eu(["accent2","srgbClr","ED7D31"]),Eu(["accent3","srgbClr","A5A5A5"]),Eu(["accent4","srgbClr","FFC000"]),Eu(["accent5","srgbClr","5B9BD5"]),Eu(["accent6","srgbClr","70AD47"]),Eu(["hlink","srgbClr","0563C1"]),Eu(["folHlink","srgbClr","954F72"])]}),Mu=e=>{const[t,i,n,s]=e;return{name:`a:${t}`,properties:{rawMap:{script:n,typeface:i,panose:s}}}},Tu=()=>({name:"a:fontScheme",properties:{rawMap:{name:"Office"}},children:[{name:"a:majorFont",children:[Mu(["latin","Calibri Light",void 0,"020F0302020204030204"]),Mu(["ea",""]),Mu(["cs",""]),Mu(["font","游ゴシック Light","Jpan"]),Mu(["font","맑은 고딕","Hang"]),Mu(["font","等线 Light","Hans"]),Mu(["font","新細明體","Hant"]),Mu(["font","Times New Roman","Arab"]),Mu(["font","Times New Roman","Hebr"]),Mu(["font","Tahoma","Thai"]),Mu(["font","Nyala","Ethi"]),Mu(["font","Vrinda","Beng"]),Mu(["font","Shruti","Gujr"]),Mu(["font","MoolBoran","Khmr"]),Mu(["font","Tunga","Knda"]),Mu(["font","Raavi","Guru"]),Mu(["font","Euphemia","Cans"]),Mu(["font","Plantagenet Cherokee","Cher"]),Mu(["font","Microsoft Yi Baiti","Yiii"]),Mu(["font","Microsoft Himalaya","Tibt"]),Mu(["font","MV Boli","Thaa"]),Mu(["font","Mangal","Deva"]),Mu(["font","Gautami","Telu"]),Mu(["font","Latha","Taml"]),Mu(["font","Estrangelo Edessa","Syrc"]),Mu(["font","Kalinga","Orya"]),Mu(["font","Kartika","Mlym"]),Mu(["font","DokChampa","Laoo"]),Mu(["font","Iskoola Pota","Sinh"]),Mu(["font","Mongolian Baiti","Mong"]),Mu(["font","Times New Roman","Viet"]),Mu(["font","Microsoft Uighur","Uigh"]),Mu(["font","Sylfaen","Geor"]),Mu(["font","Arial","Armn"]),Mu(["font","Leelawadee UI","Bugi"]),Mu(["font","Microsoft JhengHei","Bopo"]),Mu(["font","Javanese Text","Java"]),Mu(["font","Segoe UI","Lisu"]),Mu(["font","Myanmar Text","Mymr"]),Mu(["font","Ebrima","Nkoo"]),Mu(["font","Nirmala UI","Olck"]),Mu(["font","Ebrima","Osma"]),Mu(["font","Phagspa","Phag"]),Mu(["font","Estrangelo Edessa","Syrn"]),Mu(["font","Estrangelo Edessa","Syrj"]),Mu(["font","Estrangelo Edessa","Syre"]),Mu(["font","Nirmala UI","Sora"]),Mu(["font","Microsoft Tai Le","Tale"]),Mu(["font","Microsoft New Tai Lue","Talu"]),Mu(["font","Ebrima","Tfng"])]},{name:"a:minorFont",children:[Mu(["latin","Calibri",void 0,"020F0502020204030204"]),Mu(["ea",""]),Mu(["cs",""]),Mu(["font","游ゴシック","Jpan"]),Mu(["font","맑은 고딕","Hang"]),Mu(["font","等线","Hans"]),Mu(["font","新細明體","Hant"]),Mu(["font","Arial","Arab"]),Mu(["font","Arial","Hebr"]),Mu(["font","Tahoma","Thai"]),Mu(["font","Nyala","Ethi"]),Mu(["font","Vrinda","Beng"]),Mu(["font","Shruti","Gujr"]),Mu(["font","DaunPenh","Khmr"]),Mu(["font","Tunga","Knda"]),Mu(["font","Raavi","Guru"]),Mu(["font","Euphemia","Cans"]),Mu(["font","Plantagenet Cherokee","Cher"]),Mu(["font","Microsoft Yi Baiti","Yiii"]),Mu(["font","Microsoft Himalaya","Tibt"]),Mu(["font","MV Boli","Thaa"]),Mu(["font","Mangal","Deva"]),Mu(["font","Gautami","Telu"]),Mu(["font","Latha","Taml"]),Mu(["font","Estrangelo Edessa","Syrc"]),Mu(["font","Kalinga","Orya"]),Mu(["font","Kartika","Mlym"]),Mu(["font","DokChampa","Laoo"]),Mu(["font","Iskoola Pota","Sinh"]),Mu(["font","Mongolian Baiti","Mong"]),Mu(["font","Arial","Viet"]),Mu(["font","Microsoft Uighur","Uigh"]),Mu(["font","Sylfaen","Geor"]),Mu(["font","Arial","Armn"]),Mu(["font","Leelawadee UI","Bugi"]),Mu(["font","Microsoft JhengHei","Bopo"]),Mu(["font","Javanese Text","Java"]),Mu(["font","Segoe UI","Lisu"]),Mu(["font","Myanmar Text","Mymr"]),Mu(["font","Ebrima","Nkoo"]),Mu(["font","Nirmala UI","Olck"]),Mu(["font","Ebrima","Osma"]),Mu(["font","Phagspa","Phag"]),Mu(["font","Estrangelo Edessa","Syrn"]),Mu(["font","Estrangelo Edessa","Syrj"]),Mu(["font","Estrangelo Edessa","Syre"]),Mu(["font","Nirmala UI","Sora"]),Mu(["font","Microsoft Tai Le","Tale"]),Mu(["font","Microsoft New Tai Lue","Talu"]),Mu(["font","Ebrima","Tfng"])]}]}),Du=(e,t,i)=>({name:`a:${e}`,properties:{rawMap:{val:t}},children:i}),Iu=e=>{const[t,i,n,s,r,o]=e,a=[];return a.push(Du("satMod",n)),s&&a.push(Du("lumMod",s)),r&&a.push(Du("tint",r)),o&&a.push(Du("shade",o)),{name:"a:gs",properties:{rawMap:{pos:t}},children:[{name:"a:schemeClr",properties:{rawMap:{val:i}},children:a}]}},Ru=(e,t)=>({name:"a:solidFill",children:[Du("schemeClr",e,t)]}),ku=e=>{const[t,i,n,s,r]=e,[o,a]=r;return{name:"a:gradFill",properties:{rawMap:{rotWithShape:t}},children:[{name:"a:gsLst",children:[Iu(i),Iu(n),Iu(s)]},{name:"a:lin",properties:{rawMap:{ang:o,scaled:a}}}]}},Pu=e=>{const[t,i,n,s]=e;return{name:"a:ln",properties:{rawMap:{w:t,cap:i,cmpd:n,algn:s}},children:[Ru("phClr"),Du("prstDash","solid"),{name:"a:miter",properties:{rawMap:{lim:"800000"}}}]}},_u=e=>{const t=[];if(e){const[i,n,s,r,o]=e;t.push({name:"a:outerShdw",properties:{rawMap:{blurRad:i,dist:n,dir:s,algn:r,rotWithShape:o}},children:[Du("srgbClr","000000",[Du("alpha","63000")])]})}return{name:"a:effectStyle",children:[Object.assign({},{name:"a:effectLst"},t.length?{children:t}:{})]}},Lu=()=>({name:"a:fmtScheme",properties:{rawMap:{name:"Office"}},children:[{name:"a:fillStyleLst",children:[Ru("phClr"),ku(["1",["0","phClr","105000","110000","67000"],["50000","phClr","103000","105000","73000"],["100000","phClr","109000","105000","81000"],["5400000","0"]]),ku(["1",["0","phClr","103000","102000","94000"],["50000","phClr","110000","100000",void 0,"100000"],["100000","phClr","120000","99000",void 0,"78000"],["5400000","0"]])]},{name:"a:lnStyleLst",children:[Pu(["6350","flat","sng","ctr"]),Pu(["12700","flat","sng","ctr"]),Pu(["19050","flat","sng","ctr"])]},{name:"a:effectStyleLst",children:[_u(),_u(),_u(["57150","19050","5400000","ctr","0"])]},{name:"a:bgFillStyleLst",children:[Ru("phClr"),Ru("phClr",[Du("tint","95000"),Du("satMod","170000")]),ku(["1",["0","phClr","150000","102000","93000","98000"],["50000","phClr","130000","103000","98000","90000"],["100000","phClr","120000",void 0,void 0,"63000"],["5400000","0"]])]}]}),Nu=()=>({name:"a:themeElements",children:[Au(),Tu(),Lu()]}),Ou=()=>({name:"a:theme",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{a:"http://schemas.openxmlformats.org/drawingml/2006/main"}}],rawMap:{name:"Office Theme"}},children:[Nu(),{name:"a:objectDefaults"},{name:"a:extraClrSchemeLst"}]}),Fu=e=>{const t=[];for(const i of e.keys()){const e=i.toString(),n={name:"t",textNode:Vh._.escapeString(e)};e.trim().length!==e.length&&(n.properties={rawMap:{"xml:space":"preserve"}}),t.push({name:"si",children:[n]})}return t},Gu=e=>({name:"sst",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main",count:e.size,uniqueCount:e.size}},children:Fu(e)}),Bu={getTemplate(e){let{formatCode:t,numFmtId:i}=e;return t.length&&(t=function(e){const t=e.split(/(\[[^\]]*\])/);for(let e=0;e<t.length;e++){let i=t[e];i.length&&(i.startsWith("[")||(i=i.replace(/\$/g,'"$"')),t[e]=Hh._.escapeString(i))}return t.join("")}(t)),{name:"numFmt",properties:{rawMap:{formatCode:t,numFmtId:i}}}}},Vu=e=>({name:"numFmts",properties:{rawMap:{count:e.length}},children:e.map(e=>Bu.getTemplate(e))}),Hu={getTemplate(e){const{size:t,colorTheme:i,color:n="FF000000",fontName:s="Calibri",family:r,scheme:o,italic:a,bold:l,strikeThrough:c,outline:h,shadow:u,underline:d,verticalAlign:p}=e,g=[{name:"sz",properties:{rawMap:{val:t}}},{name:"color",properties:{rawMap:{theme:i,rgb:n}}},{name:"name",properties:{rawMap:{val:s}}}];return r&&g.push({name:"family",properties:{rawMap:{val:r}}}),o&&g.push({name:"scheme",properties:{rawMap:{val:o}}}),a&&g.push({name:"i"}),l&&g.push({name:"b"}),c&&g.push({name:"strike"}),h&&g.push({name:"outline"}),u&&g.push({name:"shadow"}),d&&g.push({name:"u",properties:{rawMap:{val:d}}}),p&&g.push({name:"vertAlign",properties:{rawMap:{val:p}}}),{name:"font",children:g}}},Uu=e=>({name:"fonts",properties:{rawMap:{count:e.length}},children:e.map(e=>Hu.getTemplate(e))}),zu={getTemplate(e){const{patternType:t,fgTheme:i,fgTint:n,fgRgb:s,bgRgb:r,bgIndexed:o}=e,a={name:"patternFill",properties:{rawMap:{patternType:t}}};return(i||n||s)&&(a.children=[{name:"fgColor",properties:{rawMap:{theme:i,tint:n,rgb:s}}}]),(o||r)&&(a.children||(a.children=[]),a.children.push({name:"bgColor",properties:{rawMap:{indexed:o,rgb:r}}})),{name:"fill",children:[a]}}},Wu=e=>({name:"fills",properties:{rawMap:{count:e.length}},children:e.map(e=>zu.getTemplate(e))}),ju={None:"None",Dot:"Dotted",Dash:"Dashed",Double:"Double",DashDot:"DashDot",DashDotDot:"DashDotDot",SlantDashDot:"SlantDashDot"},$u=["Dashed","DashDot","DashDotDot"],Ku={None:"none",Solid:"solid",Gray50:"mediumGray",Gray75:"darkGray",Gray25:"lightGray",HorzStripe:"darkHorizontal",VertStripe:"darkVertical",ReverseDiagStripe:"darkDown",DiagStripe:"darkUp",DiagCross:"darkGrid",ThickDiagCross:"darkTrellis",ThinHorzStripe:"lightHorizontal",ThinVertStripe:"lightVertical",ThinReverseDiagStripe:"lightDown",ThinDiagStripe:"lightUp",ThinHorzCross:"lightGrid",ThinDiagCross:"lightTrellis",Gray125:"gray125",Gray0625:"gray0625"},Yu={Automatic:"general",Left:"left",Center:"center",Right:"right",Fill:"fill",Justify:"justify",CenterAcrossSelection:"centerContinuous",Distributed:"distributed",JustifyDistributed:"justify"},qu={Automatic:void 0,Top:"top",Bottom:"bottom",Center:"center",Justify:"justify",Distributed:"distributed",JustifyDistributed:"justify"},Xu=e=>null==e?e:("#"===e.charAt(0)&&(e=e.substring(1)),6===e.length?"FF"+e:e),Zu=(e,t)=>{if(!e)return"thin";const i=(e=>{switch(e){case 1:return"thin";case 2:return"medium";case 3:return"thick";default:return"hair"}})(t),n=ju[e];return"Continuous"===e?i:"medium"===i&&-1!==$u.indexOf(n)?`medium${n}`:n.charAt(0).toLowerCase()+n.substring(1)},Qu=e=>Yu[e]||"general",Ju=e=>qu[e]||void 0,ed=e=>({name:"color",properties:{rawMap:{rgb:Xu(e||"#000000")}}}),td={getTemplate(e){const{left:t,right:i,top:n,bottom:s,diagonal:r}=e,o=t?[ed(t.color)]:void 0,a=i?[ed(i.color)]:void 0,l=n?[ed(n.color)]:void 0,c=s?[ed(s.color)]:void 0,h=r?[ed(r.color)]:void 0;return{name:"border",children:[{name:"left",properties:{rawMap:{style:t&&t.style}},children:o},{name:"right",properties:{rawMap:{style:i&&i.style}},children:a},{name:"top",properties:{rawMap:{style:n&&n.style}},children:l},{name:"bottom",properties:{rawMap:{style:s&&s.style}},children:c},{name:"diagonal",properties:{rawMap:{style:r&&r.style}},children:h}]}}},id=e=>({name:"borders",properties:{rawMap:{count:e.length}},children:e.map(e=>td.getTemplate(e))}),nd=e=>{const t=["Context","LeftToRight","RightToLeft"].indexOf(e);return Math.max(t,0)},sd={getTemplate(e){const{horizontal:t,indent:i,readingOrder:n,rotate:s,shrinkToFit:r,vertical:o,wrapText:a}=e;return{name:"alignment",properties:{rawMap:{horizontal:t&&Qu(t),indent:i,readingOrder:n&&nd(n),textRotation:s,shrinkToFit:r,vertical:o&&Ju(o),wrapText:a}}}}},rd={getTemplate(e){const t=!1===e.protected?0:1;return{name:"protection",properties:{rawMap:{hidden:!0===e.hideFormula?1:0,locked:t}}}}},od={getTemplate(e){const{alignment:t,borderId:i,fillId:n,fontId:s,numFmtId:r,protection:o,quotePrefix:a,xfId:l}=e,c=[];return t&&c.push(sd.getTemplate(t)),o&&c.push(rd.getTemplate(o)),{name:"xf",properties:{rawMap:{applyAlignment:t?1:void 0,applyProtection:o?1:void 0,applyBorder:i?1:void 0,applyFill:n?1:void 0,borderId:i,fillId:n,applyFont:s?1:void 0,fontId:s,applyNumberFormat:r?1:void 0,numFmtId:r,quotePrefix:a?1:void 0,xfId:l}},children:c.length?c:void 0}}},ad=e=>({name:"cellStyleXfs",properties:{rawMap:{count:e.length}},children:e.map(e=>od.getTemplate(e))}),ld=e=>({name:"cellXfs",properties:{rawMap:{count:e.length}},children:e.map(e=>od.getTemplate(e))}),cd={getTemplate(e){const{builtinId:t,name:i,xfId:n}=e;return{name:"cellStyle",properties:{rawMap:{builtinId:t,name:i,xfId:n}}}}},hd=e=>({name:"cellStyles",properties:{rawMap:{count:e.length}},children:e.map(e=>cd.getTemplate(e))}),ud=(e,t)=>(-1!==e.indexOf("mixedStyle")&&t>1&&(e+=`_${t}`),e),dd=()=>{Mh={base:0},Th=[],Dh=[{fontName:"Calibri",colorTheme:"1",family:"2",scheme:"minor"}],Ih=[{patternType:"none"},{patternType:"gray125"}],Rh=[{left:void 0,right:void 0,top:void 0,bottom:void 0,diagonal:void 0}],kh=[{borderId:0,fillId:0,fontId:0,numFmtId:0}],Ph=[{borderId:0,fillId:0,fontId:0,numFmtId:0,xfId:0}],_h=[{builtinId:0,name:"Normal",xfId:0}]},pd=e=>{const{alignment:t,borders:i,font:n,interior:s,numberFormat:r,protection:o,quotePrefix:a}=e;let{id:l}=e,c=0,h=0,u=0,d=0;l&&(l=ud(l,Lh),null==Mh[l]&&(s&&(c=(e=>{const t=(i=e.pattern)?Ku[i]||i:"none";var i;const n=Xu(e.color),s=Xu(e.patternColor);let r=Ih.findIndex(e=>{const{patternType:i,fgRgb:r,bgRgb:o}=e;return i==t&&r==n&&o==s});return-1===r&&(r=Ih.length,Ih.push({patternType:t,fgRgb:n,bgRgb:s})),r})(s)),i&&(h=(e=>{const{borderBottom:t,borderTop:i,borderLeft:n,borderRight:s}=e;let r,o,a,l,c,h,u,d;n&&(a=Zu(n.lineStyle,n.weight),u=Xu(n.color)),s&&(l=Zu(s.lineStyle,s.weight),d=Xu(s.color)),t&&(r=Zu(t.lineStyle,t.weight),c=Xu(t.color)),i&&(o=Zu(i.lineStyle,i.weight),h=Xu(i.color));let p=Rh.findIndex(e=>{const{left:t,right:i,top:n,bottom:s}=e;if(!t&&(a||u))return!1;if(!i&&(l||d))return!1;if(!n&&(o||h))return!1;if(!s&&(r||c))return!1;const{style:p,color:g}=t||{},{style:f,color:m}=i||{},{style:y,color:v}=n||{},{style:b,color:C}=s||{};return p==a&&g==u&&f==l&&m==d&&y==o&&v==h&&b==r&&C==c});return-1===p&&(p=Rh.length,Rh.push({left:{style:a,color:u},right:{style:l,color:d},top:{style:o,color:h},bottom:{style:r,color:c},diagonal:{style:void 0,color:void 0}})),p})(i)),n&&(u=(e=>{const{fontName:t="Calibri",color:i,size:n,bold:s,italic:r,outline:o,shadow:a,strikeThrough:l,underline:c,family:h,verticalAlign:u}=e,d=Xu(i),p=(e=>{if(void 0===e)return;const t=["Automatic","Roman","Swiss","Modern","Script","Decorative"].indexOf(e||"Automatic");return Math.max(t,0)})(h),g=c?c.toLocaleLowerCase():void 0,f=u?u.toLocaleLowerCase():void 0;let m=Dh.findIndex(e=>e.fontName==t&&e.color==d&&e.size==n&&e.bold==s&&e.italic==r&&e.outline==o&&e.shadow==a&&e.strikeThrough==l&&e.underline==g&&e.verticalAlign==f&&e.family==p);return-1===m&&(m=Dh.length,Dh.push({fontName:t,color:d,size:n,bold:s,italic:r,outline:o,shadow:a,strikeThrough:l,underline:g,verticalAlign:f,family:null!=p?p.toString():void 0})),m})(n)),r&&(d=(e=>{if(cu[e])return cu[e];let t=Th.findIndex(t=>t.formatCode===e);return-1===t?(t=Th.length+164,Th.push({formatCode:e,numFmtId:t})):t=Th[t].numFmtId,t})(r.format)),Mh[l]=Ph.length,Ph.push({alignment:t,borderId:h||0,fillId:c||0,fontId:u||0,numFmtId:d||0,protection:o,quotePrefix:a,xfId:0})))},gd=(e,t)=>Mh[ud(e,t)]||0,fd={getTemplate(e){const t=Vu(Th),i=Uu(Dh.map(t=>su(nu({},t),{size:null!=t.size?t.size:e}))),n=Wu(Ih),s=id(Rh),r=ad(kh),o=ld(Ph),a=hd(_h);return dd(),{name:"styleSheet",properties:{rawMap:{"mc:Ignorable":"x14ac x16r2 xr",xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","xmlns:x14ac":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac","xmlns:x16r2":"http://schemas.microsoft.com/office/spreadsheetml/2015/02/main","xmlns:xr":"http://schemas.microsoft.com/office/spreadsheetml/2014/revision"}},children:[t,i,n,s,r,o,a,{name:"tableStyles",properties:{rawMap:{count:0,defaultPivotStyle:"PivotStyleLight16",defaultTableStyle:"TableStyleMedium2"}}}]}}},md={getTemplate(e,t){const i=(t+1).toString();return{name:"sheet",properties:{rawMap:{name:e,sheetId:i,"r:id":`rId${i}`}}}}},yd=e=>({name:"sheets",children:e.map((e,t)=>md.getTemplate(e,t))}),vd=e=>({name:"workbook",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships"}}],rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"}},children:[yd(e)]}),bd={getTemplate(e){const{min:t,max:i,outlineLevel:n,s,width:r,hidden:o,bestFit:a}=e;let l=1,c="0";return r>1&&(l=(e=>Math.ceil((e-12)/7+1))(r),c="1"),{name:"col",properties:{rawMap:{min:t,max:i,outlineLevel:null!=n?n:void 0,width:l,style:s,hidden:o?"1":"0",bestFit:a?"1":"0",customWidth:c}}}}},Cd={getTemplate(e,t,i){const{ref:n,data:s,styleId:r}=e,{type:o,value:a}=s||{type:"empty",value:null};let l=o;"f"===o?l="str":o.charAt(0)===o.charAt(0).toUpperCase()&&(l=(e=>{const t=e.charAt(0).toLowerCase();return"s"===t?"inlineStr":t})(o));const c={name:"c",properties:{rawMap:{r:n,t:"empty"===l?void 0:l,s:r?gd(r,i):void 0}}};if("empty"===l)return c;let h;return h="str"===l&&"f"===o?[{name:"f",textNode:zh._.escapeString(a)}]:"inlineStr"===l?[{name:"is",children:[{name:"t",textNode:zh._.escapeString(a)}]}]:[{name:"v",textNode:a}],Object.assign({},c,{children:h})}},wd=e=>{var t;return""!==(null==(t=e.data)?void 0:t.value)||void 0!==e.styleId},Sd={getTemplate(e,t,i){const{collapsed:n,hidden:s,height:r,outlineLevel:o,cells:a=[]}=e;return((e,t)=>{const i=[];let n=0;for(let t=0;t<e.length;t++){const s=e[t];s.mergeAcross&&(i.push({pos:t,excelPos:n}),n+=s.mergeAcross),n++}if(i.length)for(let n=i.length-1;n>=0;n--){const s=[],r=e[i[n].pos];for(let e=1;e<=r.mergeAcross;e++)s.push({ref:`${gu(i[n].excelPos+1+e)}${t+1}`,styleId:r.styleId,data:{type:"empty",value:null}});s.length&&e.splice(i[n].pos+1,0,...s)}})(a,t),{name:"row",properties:{rawMap:{r:t+1,collapsed:n?"1":"0",hidden:s?"1":"0",ht:r,customHeight:null!=r?"1":"0",spans:"1:1",outlineLevel:o||void 0}},children:a.filter(wd).map((e,t)=>Cd.getTemplate(e,t,i))}}},xd=e=>({name:"mergeCell",properties:{rawMap:{ref:e}}}),Ed=e=>{if(null==e)return 1;const t=["Letter","Letter Small","Tabloid","Ledger","Legal","Statement","Executive","A3","A4","A4 Small","A5","A6","B4","B5","Folio","Envelope","Envelope DL","Envelope C5","Envelope B5","Envelope C3","Envelope C4","Envelope C6","Envelope Monarch","Japanese Postcard","Japanese Double Postcard"].indexOf(e);return-1===t?1:t+1},Ad=(e,t,i)=>e.reduce((e,n,s)=>{const r="Center"===(o=n.position)?"C":"Right"===o?"R":"L";var o;const a=(l=`${e}&amp;${r}`,(c=n.font)?(l+="&amp;&quot;",l+=c.fontName||"Calibri",c.bold!==c.italic?l+=c.bold?",Bold":",Italic":c.bold?l+=",Bold Italic":l+=",Regular",l+="&quot;",c.size&&(l+=`&amp;${c.size}`),c.strikeThrough&&(l+="&amp;S"),c.underline&&(l+="&amp;"+("Double"===c.underline?"E":"U")),c.color&&(l+=`&amp;K${c.color.replace("#","").toUpperCase()}`),l):l);var l,c;n.position||(n.position=["Left","Center","Right"][s]);const{image:h}=n;if("&[Picture]"===n.value&&h){const e=`${r}${t}${i}`;Od.addHeaderFooterImageToMap(h,e)}return`${a}${Uh._.escapeString((u=n.value,Uh._.iterateObject({"&[Page]":"&P","&[Pages]":"&N","&[Date]":"&D","&[Time]":"&T","&[Tab]":"&A","&[Path]":"&Z","&[File]":"&F","&[Picture]":"&G"},(e,t)=>{u=u.replace(e,t)}),u))}`;var u},""),Md=e=>{const t=[];return["all","first","even"].forEach(i=>{const n=e[i],s="all"===i?"odd":i;if(n)for(const[e,r]of Object.entries(n)){const n=`${e.charAt(0).toUpperCase()}${e.slice(1)}`,o=e[0].toUpperCase();if(r){const e="all"===i?"":i.toUpperCase();t.push({name:`${s}${n}`,properties:{rawMap:{"xml:space":"preserve"}},textNode:Ad(r,o,e)})}}}),t},Td={getTemplate(e){const{worksheet:t,currentSheet:i,config:n}=e,{margins:s={},pageSetup:r,headerFooterConfig:o,suppressColumnOutline:a}=n,{table:l}=t,{rows:c,columns:h}=l,u=h&&h.length?((e,t,i)=>{const n=[],s=[];e.forEach((e,i)=>{const r=e.cells;let o,a=0;r.forEach((e,r)=>{const l=r+a+1,c=gu(l),h=i+1;if(e.mergeAcross){a+=e.mergeAcross;const t=gu(r+a+1);n.push(`${c}${h}:${t}${h}`)}t[l-1]||(t[l-1]={});const{collapsibleRanges:u}=e;u&&u.forEach(e=>{s.push([l+e[0],l+e[1]])}),o=t[l-1],o.min=l,o.max=l,e.ref=`${c}${h}`})}),s.sort((e,t)=>e[0]!==t[0]?e[0]-t[0]:t[1]-e[1]);const r=new Map,o=new Map;return s.filter(e=>{const t=e.toString();return!r.get(t)&&(r.set(t,!0),!0)}).forEach(e=>{const n=t.find(t=>t.min==e[0]&&t.max==e[1]),s=o.get(e[0]);t.push({min:e[0],max:e[1],outlineLevel:i?void 0:s||1,width:(n||{width:100}).width}),o.set(e[0],(s||0)+1)}),n})(c,h,!!a):[],{worksheetDataTables:d}=Od,p=d.get(i),g=Uh._.compose(e=>(e.children.push({name:"sheetPr",children:[{name:"outlinePr",properties:{rawMap:{summaryBelow:0}}}]}),e),(e=>t=>{const i=e.reduce((e,t)=>t.outlineLevel&&t.outlineLevel>e?t.outlineLevel:e,0);return t.children.push({name:"sheetFormatPr",properties:{rawMap:{baseColWidth:10,defaultRowHeight:16,outlineLevelRow:i||void 0}}}),t})(c),(e=>t=>(e.length&&t.children.push({name:"cols",children:e.map(e=>bd.getTemplate(e))}),t))(h),((e,t)=>i=>(e.length&&i.children.push({name:"sheetData",children:e.map((e,i)=>Sd.getTemplate(e,i,t))}),i))(c,i+1),(m=u,e=>(m.length&&e.children.push({name:"mergeCells",properties:{rawMap:{count:m.length}},children:m.map(e=>xd(e))}),e)),(e=>t=>{const{top:i=.75,right:n=.7,bottom:s=.75,left:r=.7,header:o=.3,footer:a=.3}=e;return t.children.push({name:"pageMargins",properties:{rawMap:{bottom:s,footer:a,header:o,left:r,right:n,top:i}}}),t})(s),(e=>t=>{var i;return e&&t.children.push({name:"pageSetup",properties:{rawMap:{horizontalDpi:0,verticalDpi:0,orientation:(i=e.orientation,!i||"Portrait"!==i&&"Landscape"!==i?"portrait":i.toLocaleLowerCase()),paperSize:Ed(e.pageSize)}}}),t})(r),(e=>t=>{if(!e)return t;const i=null!=e.first?1:0,n=null!=e.even?1:0;return t.children.push({name:"headerFooter",properties:{rawMap:{differentFirst:i,differentOddEven:n}},children:Md(e)}),t})(o),(e=>t=>{const i=Od.worksheetImages.get(e);return(null==i?void 0:i.length)&&t.children.push({name:"drawing",properties:{rawMap:{"r:id":"rId"+ ++t.rIdCounter}}}),t})(i),(e=>t=>(Od.worksheetHeaderFooterImages.get(e)&&t.children.push({name:"legacyDrawingHF",properties:{rawMap:{"r:id":"rId"+ ++t.rIdCounter}}}),t))(i),(f=p,e=>(f&&e.children.push({name:"tableParts",properties:{rawMap:{count:"1"}},children:[{name:"tablePart",properties:{rawMap:{"r:id":"rId"+ ++e.rIdCounter}}}]}),e)));var f,m;const{children:y}=g({children:[],rIdCounter:0});return{name:"worksheet",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships"}}],rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"}},children:y}}},Dd={getTemplate(e){const{Id:t,Type:i,Target:n}=e;return{name:"Relationship",properties:{rawMap:{Id:t,Type:i,Target:n}}}}},Id=e=>({name:"Relationships",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"}},children:e.map(e=>Dd.getTemplate(e))}),Rd=e=>{const{aspectratio:t,rotation:i}=e||{},n={};return t&&(n.aspectratio="t"),i&&(n.rotation="t"),{name:"o:lock",properties:{prefixedAttributes:[{prefix:"v:",map:{ext:"edit"}}],rawMap:n}}},kd={0:"0",5:"6554f",10:"13107f",15:"19661f",20:"26214f",25:".5",30:"39322f",35:"45875f",40:"52429f",45:"58982f",50:"1",55:"72818f",60:"1.25",65:"93623f",70:"109227f",75:"2",80:"2.5",85:"3.4",90:"5",95:"10",96:"12.5",97:"1092267f",98:"25",99:"50",100:"2147483647f"},Pd=(e,t)=>{var i;let n;const{recolor:s,brightness:r,contrast:o,id:a}=e;var l;return s&&(n={},"Washout"!==s&&"Grayscale"!==s||(n.gain="19661f",n.blacklevel="22938f"),"Black & White"!==s&&"Grayscale"!==s||(n.grayscale="t","Black & White"===s&&(n.bilevel="t"))),s&&"Grayscale"!==s||(n||(n={}),null!=o&&50!==o&&(n.gain=null!=(i=kd[o])?i:"1"),null!=r&&50!==r&&(n.blacklevel=(l=r,(l-0)/100*1-.5).toString())),{name:"v:imagedata",properties:{prefixedAttributes:[{prefix:"o:",map:{relid:`rId${t}`,title:a}}],rawMap:n}}},_d=e=>Math.floor(.74999943307122*(null!=e?e:0)),Ld={getTemplate(e){const t=Od.worksheetHeaderFooterImages.get(e.sheetIndex)||[];var i;return{name:"xml",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{v:"urn:schemas-microsoft-com:vml",o:"urn:schemas-microsoft-com:office:office",x:"urn:schemas-microsoft-com:office:excel"}}]},children:[{name:"o:shapelayout",properties:{prefixedAttributes:[{prefix:"v:",map:{ext:"edit"}}]},children:[{name:"o:idmap",properties:{prefixedAttributes:[{prefix:"v:",map:{ext:"edit"}}],rawMap:{data:"1"}}}]},{name:"v:shapetype",properties:{prefixedAttributes:[{prefix:"o:",map:{spt:"75",preferrelative:"t"}}],rawMap:{coordsize:"21600,21600",filled:"f",id:"_x0000_t75",path:"m@4@5l@4@11@9@11@9@5xe",stroked:"f"}},children:[{name:"v:stroke",properties:{rawMap:{joinstyle:"miter"}}},(i=["if lineDrawn pixelLineWidth 0","sum @0 1 0","sum 0 0 @1","prod @2 1 2","prod @3 21600 pixelWidth","prod @3 21600 pixelHeight","sum @0 0 1","prod @6 1 2","prod @7 21600 pixelWidth","sum @8 21600 0","prod @7 21600 pixelHeight","sum @10 21600 0"],{name:"v:formulas",children:i.map(e=>({name:"v:f",properties:{rawMap:{eqn:e}}}))}),{name:"v:path",properties:{prefixedAttributes:[{prefix:"o:",map:{connecttype:"rect",extrusionok:"f"}}],rawMap:{gradientshapeok:"t"}}},Rd({aspectratio:!0})]},...t.map((e,t)=>((e,t)=>{const{width:i=0,height:n=0,altText:s}=e,r=_d(i),o=_d(n);return{name:"v:shape",properties:{rawMap:{id:e.headerFooterPosition,"o:spid":"_x0000_s1025",style:`position: absolute; margin-left: 0; margin-top: 10in; margin-bottom: 0; margin-right: 0; width: ${r}pt; height: ${o}pt; z-index: ${t+1}`,type:"#_x0000_t75",alt:s}},children:[Pd(e,t+1),Rd({rotation:!0})]}})(e,t))]}}},Nd=class e{static createExcel(e,t,i){this.addSheetName(t),((e,t)=>{1===(Lh=t)&&dd(),e.forEach(pd)})(e,this.sheetNames.length);let n=Object.assign({},i);return i.exportAsExcelTable&&(i.columnModel.isPivotActive()&&(this.showExcelTableNonCompatibleFeaturesWarning("pivot mode"),n.exportAsExcelTable=!1),i.gos.get("masterDetail")&&(this.showExcelTableNonCompatibleFeaturesWarning("master/detail"),n.exportAsExcelTable=!1)),this.processTableConfig(t,n),this.createWorksheet(t,n)}static showExcelTableNonCompatibleFeaturesWarning(e){console.warn(`AG Grid: Excel table export does not work with ${e}. The exported Excel file will not contain any Excel tables.\nPlease turn off ${e} to enable Excel table exports.`)}static getTableNameFromIndex(e){return`table${e+1}`}static getSanitizedTableName(e){return e.replace(/^[^a-zA-Z_]+/,"_").replace(/\s/g,"_").replace(/[^a-zA-Z0-9_]/g,"_")}static addTableToSheet(e,t){this.worksheetDataTables.has(e)?console.warn("Unable to add data table to Excel sheet: A table already exists."):this.worksheetDataTables.set(e,t)}static processTableConfig(t,i){var n;if(!i.exportAsExcelTable)return;const s="boolean"==typeof i.exportAsExcelTable?{}:i.exportAsExcelTable,{name:r,showColumnStripes:o,showRowStripes:a,showFilterButton:l,highlightFirstColumn:c,highlightLastColumn:h}=s,u=this.getSanitizedTableName(r||e.defaultTableDisplayName),d=this.sheetNames.length-1,{table:p}=t,{rows:g,columns:f}=p,m=i.columnModel.getHeaderRowCount(),y=m-1,v=g.length,b=f.length,C=[],w=[];for(let e=0;e<b;e++){const t=f[e];C.push(t.displayName||""),w.push("match"===l||void 0===l?null!=(n=t.filterAllowed)&&n:l)}C&&C.length&&v&&u?this.addTableToSheet(d,{name:this.getTableNameFromIndex(d),displayName:u,columns:C,showFilterButtons:w,headerRowIndex:y,rowCount:v-m,showRowStripes:null==a||a,showColumnStripes:null!=o&&o,highlightFirstColumn:null!=c&&c,highlightLastColumn:null!=h&&h}):console.warn("Unable to add data table to Excel sheet: Missing required parameters.")}static addHeaderFooterImageToMap(e,t){const i=this.sheetNames.length-1,n=e;n.headerFooterPosition=t,this.buildImageMap({imageToAdd:n,idx:i});let s=this.worksheetHeaderFooterImages.get(i);s||(s=[],this.worksheetHeaderFooterImages.set(i,s)),s.find(t=>t.id===e.id)||s.push(e)}static addBodyImageToMap(e,t,i,n,s){let r=this.sheetNames.length;const{row:o,column:a}=e.position||{},l=e;n&&(null==t||null==i||o&&a||(e.position||(e.position={}),e.position=Object.assign({},e.position,{row:t,column:n.indexOf(i)+1})),((e,t)=>{const{colSpan:i,column:n}=e.position;if(e.width)if(i){const s=t.slice(n-1,n+i-1);let r=0;for(let t=0;t<s.length;t++){const i=s[t].getActualWidth();if(e.width<r+i){e.position.colSpan=t+1,e.totalWidth=e.width,e.width=e.totalWidth-r;break}r+=i}}else e.totalWidth=e.width})(l,n),((e,t)=>{const{rowSpan:i,row:n}=e.position;if(e.height)if(i){let s=0,r=0;for(let o=n;o<n+i;o++){const i=hu(du(o,t)||20);if(e.height<s+i){e.position.rowSpan=r+1,e.totalHeight=e.height,e.height=e.totalHeight-s;break}s+=i,r++}}else e.totalHeight=e.height})(l,s)),this.buildImageMap({imageToAdd:l,idx:r});let c=this.worksheetImageIds.get(r);c||(c=new Map,this.worksheetImageIds.set(r,c));const h=this.worksheetImages.get(r);h?h.push(l):this.worksheetImages.set(r,[l]),c.get(e.id)||c.set(e.id,{index:c.size,type:e.imageType})}static buildImageMap(e){const{imageToAdd:t,idx:i}=e,n=this.images.get(t.id);if(n){const e=n.find(e=>e.sheetId===i);e?e.image.push(t):n.push({sheetId:i,image:[t]})}else this.images.set(t.id,[{sheetId:i,image:[t]}]),this.workbookImageIds.set(t.id,{type:t.imageType,index:this.workbookImageIds.size})}static addSheetName(e){const t=Gh._.escapeString(e.name)||"";let i="";for(;-1!==this.sheetNames.indexOf(`${t}${i}`);)if(""===i)i="_1";else{const e=parseInt(i.slice(1),10);i=`_${e+1}`}e.name=`${t}${i}`,this.sheetNames.push(e.name)}static getStringPosition(e){return this.sharedStrings.has(e)?this.sharedStrings.get(e):(this.sharedStrings.set(e,this.sharedStrings.size),this.sharedStrings.size-1)}static resetFactory(){this.sharedStrings=new Map,this.images=new Map,this.worksheetImages=new Map,this.worksheetHeaderFooterImages=new Map,this.workbookImageIds=new Map,this.worksheetImageIds=new Map,this.worksheetDataTables=new Map,this.sheetNames=[],this.factoryMode=Gh.ExcelFactoryMode.SINGLE_SHEET}static createWorkbook(){return pu(vd(this.sheetNames))}static createStylesheet(e){return pu(fd.getTemplate(e))}static createSharedStrings(){return pu(Gu(this.sharedStrings))}static createCore(e){return pu(ou.getTemplate(e))}static createContentTypes(e){return pu(lu.getTemplate(e))}static createRels(){const e=Id([{Id:"rId1",Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",Target:"xl/workbook.xml"},{Id:"rId2",Type:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",Target:"docProps/core.xml"}]);return pu(e)}static createTheme(){return pu(Ou())}static createTable(e,t){return pu(xu.getTemplate(e,t))}static createWorkbookRels(e){const t=new Array(e).fill(void 0).map((e,t)=>({Id:`rId${t+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",Target:`worksheets/sheet${t+1}.xml`})),i=Id([...t,{Id:`rId${e+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",Target:"theme/theme1.xml"},{Id:`rId${e+2}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",Target:"styles.xml"},{Id:`rId${e+3}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",Target:"sharedStrings.xml"}]);return pu(i)}static createDrawing(e){return pu(Su.getTemplate({sheetIndex:e}))}static createDrawingRel(e){const t=this.worksheetImageIds.get(e)||[],i=[];for(const[e,n]of t)i.push({Id:`rId${n.index+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Target:`../media/image${this.workbookImageIds.get(e).index+1}.${n.type}`});return pu(Id(i))}static createVmlDrawing(e){return pu(Ld.getTemplate({sheetIndex:e}),!0)}static createVmlDrawingRel(e){const t=this.worksheetHeaderFooterImages.get(e)||[],i=[];for(let e=0;e<t.length;e++){const n=t[e],s=this.workbookImageIds.get(n.id);if(!s)continue;const{index:r,type:o}=s,a="jpg"===o?"jpeg":o;i.push({Id:`rId${e+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Target:`../media/image${r+1}.${a}`})}return pu(Id(i))}static createRelationships({drawingIndex:e,vmlDrawingIndex:t,tableIndex:i}={}){if(void 0===e&&void 0===t&&void 0===i)return"";const n=[];null!=e&&n.push({Id:`rId${n.length+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",Target:`../drawings/drawing${e+1}.xml`}),null!=t&&n.push({Id:`rId${n.length+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",Target:`../drawings/vmlDrawing${t+1}.vml`}),null!=i&&n.push({Id:`rId${n.length+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/table",Target:`../tables/${this.getTableNameFromIndex(i)}.xml`});const s=Id(n);return pu(s)}static createWorksheet(e,t){return pu(Td.getTemplate({worksheet:e,currentSheet:this.sheetNames.length-1,config:t}))}};Nd.sharedStrings=new Map,Nd.sheetNames=[],Nd.images=new Map,Nd.worksheetImages=new Map,Nd.worksheetHeaderFooterImages=new Map,Nd.workbookImageIds=new Map,Nd.worksheetImageIds=new Map,Nd.worksheetDataTables=new Map,Nd.defaultTableDisplayName="AG-GRID-TABLE",Nd.factoryMode=Gh.ExcelFactoryMode.SINGLE_SHEET;var Od=Nd,Fd=class extends $h.BaseGridSerializingSession{constructor(e){super(e),this.mixedStyles={},this.mixedStyleCounter=0,this.rows=[],this.config=Object.assign({},e),this.stylesByIds={},this.config.baseExcelStyles.forEach(e=>{this.stylesByIds[e.id]=e}),this.excelStyles=[...this.config.baseExcelStyles,{id:"_quotePrefix",quotePrefix:1}]}addCustomContent(e){e.forEach(e=>{const t=this.rows.length+1;let i;this.config.suppressRowOutline||null==e.outlineLevel||(i=e.outlineLevel);const n={height:du(t,e.height||this.config.rowHeight),cells:(e.cells||[]).map((e,i)=>{var n,s,r;const o=this.addImage(t,this.columnsToExport[i],null==(n=e.data)?void 0:n.value);let a=null;e.styleId&&(a="string"==typeof e.styleId?[e.styleId]:e.styleId);const l=this.getStyleId(a);if(o)return this.createCell(l,this.getDataTypeForValue(o.value),null==o.value?"":o.value);const c=null!=(r=null==(s=e.data)?void 0:s.value)?r:"",h=this.getDataTypeForValue(c);return e.mergeAcross?this.createMergedCell(l,h,c,e.mergeAcross):this.createCell(l,h,c)}),outlineLevel:i};null!=e.collapsed&&(n.collapsed=e.collapsed),null!=e.hidden&&(n.hidden=e.hidden),this.rows.push(n)})}onNewHeaderGroupingRow(){const e=[];return this.rows.push({cells:e,height:du(this.rows.length+1,this.config.headerRowHeight)}),{onColumn:(t,i,n,s,r)=>{const o=this.config.styleLinker({rowType:$h.RowType.HEADER_GROUPING,rowIndex:1,value:`grouping-${i}`,columnGroup:t});e.push(su(nu({},this.createMergedCell(this.getStyleId(o),this.getDataTypeForValue("string"),i,s)),{collapsibleRanges:r}))}}}onNewHeaderRow(){return this.onNewRow(this.onNewHeaderColumn,this.config.headerRowHeight)}onNewBodyRow(e){const t=this.onNewRow(this.onNewBodyColumn,this.config.rowHeight);return e&&this.addRowOutlineIfNecessary(e),t}prepare(e){super.prepare(e),this.columnsToExport=[...e],this.cols=e.map((e,t)=>this.convertColumnToExcel(e,t))}parse(){const e=this.rows.reduce((e,t)=>Math.max(e,t.cells.length),0);for(;this.cols.length<e;)this.cols.push(this.convertColumnToExcel(null,this.cols.length+1));const t={name:this.config.sheetName,table:{columns:this.cols,rows:this.rows}};return this.createExcel(t)}addRowOutlineIfNecessary(e){const{gos:t,suppressRowOutline:i,rowGroupExpandState:n="expanded"}=this.config;if(t.get("groupHideOpenParents")||i||null==e.level)return;const s=e.footer?1:0,r=jh._.last(this.rows);if(r.outlineLevel=e.level+s,"expanded"===n)return;const o="collapsed"===n;if(e.isExpandable()){const t=!o&&e.expanded;r.collapsed=!t}r.hidden=!!e.parent&&-1!==e.parent.level&&(o||this.isAnyParentCollapsed(e.parent))}isAnyParentCollapsed(e){for(;e&&-1!==e.level;){if(!e.expanded)return!0;e=e.parent}return!1}convertColumnToExcel(e,t){const i=this.config.columnWidth,n=e?this.extractHeaderValue(e):void 0,s=null!=n?n:"",r=!!e&&e.isFilterAllowed();if(i)return"number"==typeof i?{width:i,displayName:s,filterAllowed:r}:{width:i({column:e,index:t}),displayName:s,filterAllowed:r};if(e){const t=75;return{width:Math.max(e.getActualWidth(),t),displayName:s,filterAllowed:r}}return{displayName:s,filterAllowed:r}}onNewHeaderColumn(e,t){return i=>{const n=this.extractHeaderValue(i),s=this.config.styleLinker({rowType:$h.RowType.HEADER,rowIndex:e,value:n,column:i});t.push(this.createCell(this.getStyleId(s),this.getDataTypeForValue("string"),n))}}onNewBodyColumn(e,t){let i=0;return(n,s,r)=>{if(i>0)return void(i-=1);const{value:o,valueFormatted:a}=this.extractRowCellValue(n,s,e,"excel",r),l=this.config.styleLinker({rowType:$h.RowType.BODY,rowIndex:e,value:o,column:n,node:r}),c=this.getStyleId(l),h=n.getColSpan(r),u=this.addImage(e,n,o);u?t.push(this.createCell(c,this.getDataTypeForValue(u.value),null==u.value?"":u.value)):h>1?(i=h-1,t.push(this.createMergedCell(c,this.getDataTypeForValue(o),o,h-1))):t.push(this.createCell(c,this.getDataTypeForValue(o),o,a))}}onNewRow(e,t){const i=[];return this.rows.push({cells:i,height:du(this.rows.length+1,t)}),{onColumn:e.bind(this,this.rows.length,i)()}}createExcel(e){const{excelStyles:t,config:i}=this;return Od.createExcel(t,e,i)}getDataTypeForValue(e){return void 0===e?"empty":this.isNumerical(e)?"n":"s"}getTypeFromStyle(e,t){if(this.isFormula(t))return"f";if(e&&e.dataType)switch(e.dataType.toLocaleLowerCase()){case"formula":return"f";case"string":return"s";case"number":return"n";case"datetime":return"d";case"error":return"e";case"boolean":return"b";default:console.warn(`AG Grid: Unrecognized data type for excel export [${e.id}.dataType=${e.dataType}]`)}return null}addImage(e,t,i){if(!this.config.addImageToCell)return;const n=this.config.addImageToCell(e,t,i);return n?(Od.addBodyImageToMap(n.image,e,t,this.columnsToExport,this.config.rowHeight),n):void 0}createCell(e,t,i,n){const s=this.getStyleById(e);!(null==s?void 0:s.dataType)&&"s"===t&&n&&(i=n);const r=this.getTypeFromStyle(s,i)||t,{value:o,escaped:a}=this.getCellValue(r,i),l=[];return s&&l.push(e),a&&l.push("_quotePrefix"),{styleId:e=this.getStyleId(l)||void 0,data:{type:r,value:o}}}createMergedCell(e,t,i,n){const s=null==i?"":i;return{styleId:this.getStyleById(e)?e:void 0,data:{type:t,value:"s"===t?Od.getStringPosition(s).toString():i},mergeAcross:n}}getCellValue(e,t){let i=!1;if(null==t&&(e="s",t=""),"s"===e)t&&"'"===t[0]&&(i=!0,t=t.slice(1)),t=Od.getStringPosition(t).toString();else if("f"===e)t=t.slice(1);else if("n"===e){const e=Number(t);isNaN(e)?t="":""!==t&&(t=e.toString())}return{value:t,escaped:i}}getStyleId(e){if(!e||!e.length)return null;if(1===e.length)return e[0];const t=e.join("-");return this.mixedStyles[t]||this.addNewMixedStyle(e),this.mixedStyles[t].excelID}deepCloneObject(e){return JSON.parse(JSON.stringify(e))}addNewMixedStyle(e){this.mixedStyleCounter+=1;const t=`mixedStyle${this.mixedStyleCounter}`,i={};for(const t of e)for(const e of this.excelStyles)e.id===t&&jh._.mergeDeep(i,this.deepCloneObject(e));i.id=t,i.name=t;const n=e.join("-");this.mixedStyles[n]={excelID:t,key:n,result:i},this.excelStyles.push(i),this.stylesByIds[t]=i}isFormula(e){return null!=e&&this.config.autoConvertFormulas&&e.toString().startsWith("=")}isNumerical(e){return"bigint"==typeof e||isFinite(e)&&""!==e&&!isNaN(parseFloat(e))}getStyleById(e){return null==e?null:this.stylesByIds[e]||null}},Gd=(e,t)=>{const i="xl/drawings",n=`${i}/drawing${t+1}.xml`,s=`${i}/_rels/drawing${t+1}.xml.rels`;Wh.ZipContainer.addFile(s,Od.createDrawingRel(e)),Wh.ZipContainer.addFile(n,Od.createDrawing(e))},Bd=(e,t)=>{const i="xl/drawings",n=`${i}/vmlDrawing${t+1}.vml`,s=`${i}/_rels/vmlDrawing${t+1}.vml.rels`;Wh.ZipContainer.addFile(n,Od.createVmlDrawing(e)),Wh.ZipContainer.addFile(s,Od.createVmlDrawingRel(e))},Vd=(e,t={})=>{if(!e||0===e.length)return console.warn("AG Grid: Invalid params supplied to createExcelFileForExcel() - `ExcelExportParams.data` is empty."),Od.resetFactory(),!1;const{fontSize:i=11,author:n="AG Grid"}=t;return(()=>{Wh.ZipContainer.addFolders(["_rels/","docProps/","xl/","xl/theme/","xl/_rels/","xl/worksheets/"]);const{images:e}=Od;if(!e.size)return;Wh.ZipContainer.addFolders(["xl/worksheets/_rels","xl/drawings/","xl/drawings/_rels","xl/media/"]);let t=0;e.forEach(e=>{const i=e[0].image[0],{base64:n,imageType:s}=i,r="jpg"===s?"jpeg":s;Wh.ZipContainer.addFile(`xl/media/image${++t}.${r}`,n,!0)})})(),(()=>{const{worksheetDataTables:e}=Od,t=e,i=Array.from(t.keys());for(let e=0;e<i.length;e++){const n=i[e],s=t.get(n);s&&Wh.ZipContainer.addFile(`xl/tables/${s.name}.xml`,Od.createTable(s,e))}})(),(e=>{let t=0,i=0,n=0;const{images:s,worksheetDataTables:r,worksheetImages:o,worksheetHeaderFooterImages:a}=Od;for(let l=0;l<e.length;l++){const c=e[l];Wh.ZipContainer.addFile(`xl/worksheets/sheet${l+1}.xml`,c,!1);const h=s.size>0&&o.has(l),u=r.size>0&&r.has(l),d=s.size&&a.has(l);if(!h&&!u&&!d)continue;let p,g,f;h&&(Gd(l,t),g=t,t++),d&&(Bd(l,i),f=i,i++),u&&(p=n++);const m=`xl/worksheets/_rels/sheet${l+1}.xml.rels`;Wh.ZipContainer.addFile(m,Od.createRelationships({tableIndex:p,drawingIndex:g,vmlDrawingIndex:f}))}})(e),((e,t,i)=>{Wh.ZipContainer.addFile("xl/workbook.xml",Od.createWorkbook()),Wh.ZipContainer.addFile("xl/styles.xml",Od.createStylesheet(e)),Wh.ZipContainer.addFile("xl/sharedStrings.xml",Od.createSharedStrings()),Wh.ZipContainer.addFile("xl/theme/theme1.xml",Od.createTheme()),Wh.ZipContainer.addFile("xl/_rels/workbook.xml.rels",Od.createWorkbookRels(i)),Wh.ZipContainer.addFile("docProps/core.xml",Od.createCore(t)),Wh.ZipContainer.addFile("[Content_Types].xml",Od.createContentTypes(i)),Wh.ZipContainer.addFile("_rels/.rels",Od.createRels())})(i,n,e.length),Od.resetFactory(),!0},Hd=e=>{const{data:t,fontSize:i,author:n}=e,s=e.mimeType||"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";return Vd(t,{author:n,fontSize:i})?Wh.ZipContainer.getZipFile(s):Promise.resolve(void 0)},Ud=e=>{const{data:t,fontSize:i,author:n}=e,s=e.mimeType||"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";if(Vd(t,{author:n,fontSize:i}))return Wh.ZipContainer.getUncompressedZipFile(s)},zd=e=>{const{fileName:t="export.xlsx"}=e;Hd(e).then(e=>{if(e){const i="function"==typeof t?t():t;Wh.Downloader.download(i,e)}})},Wd=class extends Wh.BaseCreator{postConstruct(){this.setBeans({gridSerializer:this.gridSerializer,gos:this.gos})}getMergedParams(e){const t=this.gos.get("defaultExcelExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed())return void console.warn("AG Grid: Export cancelled. Export is not allowed as per your configuration.");const t=this.getMergedParams(e),i={data:[this.getData(t)],fontSize:t.fontSize,author:t.author,mimeType:t.mimeType};this.packageCompressedFile(i).then(e=>{if(e){const{fileName:i}=t,n="function"==typeof i?i(this.gos.getGridCommonParams()):i;Wh.Downloader.download(this.getFileName(n),e)}})}exportDataAsExcel(e){this.export(e)}getDataAsExcel(e){const t=this.getMergedParams(e),i={data:[this.getData(t)],fontSize:t.fontSize,author:t.author,mimeType:t.mimeType};return this.packageFile(i)}setFactoryMode(e){Od.factoryMode=e}getFactoryMode(){return Od.factoryMode}getSheetDataForExcel(e){const t=this.getMergedParams(e);return this.getData(t)}getMultipleSheetsAsExcel(e){return Ud(e)}exportMultipleSheetsAsExcel(e){zd(e)}getDefaultFileExtension(){return"xlsx"}createSerializingSession(e){const{columnModel:t,valueService:i,gos:n}=this;let s;if(null!=e.sheetName){const{sheetName:t}=e,i="function"==typeof t?t(this.gos.getGridCommonParams()):t;s=String(i).substring(0,31)}else s="ag-grid";const r=su(nu({},e),{sheetName:s,columnModel:t,valueService:i,gos:n,suppressRowOutline:e.suppressRowOutline||e.skipRowGroups,headerRowHeight:e.headerRowHeight||e.rowHeight,baseExcelStyles:this.gos.get("excelStyles")||[],styleLinker:this.styleLinker.bind(this)});return new Fd(r)}styleLinker(e){const{rowType:t,rowIndex:i,value:n,column:s,columnGroup:r,node:o}=e,a=t===Wh.RowType.HEADER,l=t===Wh.RowType.HEADER_GROUPING,c=a?s:r;let h=[];if(a||l)return h.push("header"),l&&h.push("headerGroup"),c&&(h=h.concat(Fh.CssClassApplier.getHeaderClassesFromColDef(c.getDefinition(),this.gos,s||null,r||null))),h;const u=this.gos.get("excelStyles"),d=["cell"];if(!u||!u.length)return d;const p=u.map(e=>e.id);return this.stylingService.processAllCellClasses(s.getDefinition(),this.gos.addGridCommonParams({value:n,data:o.data,node:o,colDef:s.getDefinition(),column:s,rowIndex:i}),e=>{p.indexOf(e)>-1&&d.push(e)}),d.sort((e,t)=>p.indexOf(e)<p.indexOf(t)?-1:1)}isExportSuppressed(){return this.gos.get("suppressExcelExport")}packageCompressedFile(e){return Hd(e)}packageFile(e){return Ud(e)}};ru([(0,Fh.Autowired)("columnModel")],Wd.prototype,"columnModel",2),ru([(0,Fh.Autowired)("valueService")],Wd.prototype,"valueService",2),ru([(0,Fh.Autowired)("stylingService")],Wd.prototype,"stylingService",2),ru([(0,Fh.Autowired)("gridSerializer")],Wd.prototype,"gridSerializer",2),ru([(0,Fh.Autowired)("gridOptionsService")],Wd.prototype,"gos",2),ru([Fh.PostConstruct],Wd.prototype,"postConstruct",1),Wd=ru([(0,Fh.Bean)("excelCreator")],Wd);var jd={version:"31.3.4",moduleName:Oh.ModuleNames.ExcelExportModule,beans:[Wd,Kh.GridSerializer,Kh.CsvCreator],dependantModules:[Yh.CsvExportModule,D]},$d=i(98092),Kd=i(98092),Yd=i(98092),qd=i(98092),Xd=i(98092),Zd=i(98092),Qd=Object.defineProperty,Jd=Object.getOwnPropertyDescriptor,ep=Object.getOwnPropertySymbols,tp=Object.prototype.hasOwnProperty,ip=Object.prototype.propertyIsEnumerable,np=(e,t,i)=>t in e?Qd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,sp=(e,t)=>{for(var i in t||(t={}))tp.call(t,i)&&np(e,i,t[i]);if(ep)for(var i of ep(t))ip.call(t,i)&&np(e,i,t[i]);return e},rp=(e,t,i,n)=>{for(var s,r=n>1?void 0:n?Jd(t,i):t,o=e.length-1;o>=0;o--)(s=e[o])&&(r=(n?s(t,i,r):s(r))||r);return n&&r&&Qd(t,i,r),r},op=class extends Kd.Component{preConstruct(){this.setTemplate('<div class="ag-filter-toolpanel-search" role="presentation">\n                <div ref="eExpand" class="ag-filter-toolpanel-expand"></div>\n                <ag-input-text-field ref="eFilterTextField" class="ag-filter-toolpanel-search-input"></ag-input-text-field>\n            </div>')}postConstruct(){const e=this.localeService.getLocaleTextFunc();this.eFilterTextField.setAutoComplete(!1).setInputAriaLabel(e("ariaFilterColumnsInput","Filter Columns Input")).onValueChange(this.onSearchTextChanged.bind(this)),this.createExpandIcons(),this.setExpandState(0),this.addManagedListener(this.eExpand,"click",this.onExpandClicked.bind(this)),this.addManagedListener(this.eventService,Kd.Events.EVENT_NEW_COLUMNS_LOADED,this.showOrHideOptions.bind(this))}init(e){this.params=e,this.columnModel.isReady()&&this.showOrHideOptions()}createExpandIcons(){this.eExpand.appendChild(this.eExpandChecked=Kd._.createIconNoSpan("columnSelectOpen",this.gos)),this.eExpand.appendChild(this.eExpandUnchecked=Kd._.createIconNoSpan("columnSelectClosed",this.gos)),this.eExpand.appendChild(this.eExpandIndeterminate=Kd._.createIconNoSpan("columnSelectIndeterminate",this.gos))}showOrHideOptions(){const e=!this.params.suppressFilterSearch,t=!this.params.suppressExpandAll,i=this.localeService.getLocaleTextFunc();this.eFilterTextField.setInputPlaceholder(i("searchOoo","Search..."));const n=this.columnModel.getAllGridColumns().some(e=>e.getOriginalParent()&&e.isFilterAllowed());Kd._.setDisplayed(this.eFilterTextField.getGui(),e),Kd._.setDisplayed(this.eExpand,t&&n)}onSearchTextChanged(){this.onSearchTextChangedDebounced||(this.onSearchTextChangedDebounced=Kd._.debounce(()=>{this.dispatchEvent({type:"searchChanged",searchText:this.eFilterTextField.getValue()})},300)),this.onSearchTextChangedDebounced()}onExpandClicked(){const e=0===this.currentExpandState?{type:"collapseAll"}:{type:"expandAll"};this.dispatchEvent(e)}setExpandState(e){this.currentExpandState=e,Kd._.setDisplayed(this.eExpandChecked,0===this.currentExpandState),Kd._.setDisplayed(this.eExpandUnchecked,1===this.currentExpandState),Kd._.setDisplayed(this.eExpandIndeterminate,2===this.currentExpandState)}};rp([(0,Kd.Autowired)("columnModel")],op.prototype,"columnModel",2),rp([(0,Kd.RefSelector)("eExpand")],op.prototype,"eExpand",2),rp([(0,Kd.RefSelector)("eFilterTextField")],op.prototype,"eFilterTextField",2),rp([Kd.PreConstruct],op.prototype,"preConstruct",1),rp([Kd.PostConstruct],op.prototype,"postConstruct",1);var ap=class e extends qd.Component{constructor(t,i){super(e.TEMPLATE),this.expandedCallback=i,this.expanded=!1,this.hideHeader=t}postConstruct(){this.eExpandChecked=qd._.createIconNoSpan("columnSelectOpen",this.gos),this.eExpandUnchecked=qd._.createIconNoSpan("columnSelectClosed",this.gos),this.eExpand.appendChild(this.eExpandChecked),this.eExpand.appendChild(this.eExpandUnchecked)}setColumn(e){this.column=e,this.eFilterName.innerText=this.columnModel.getDisplayNameForColumn(this.column,"filterToolPanel",!1)||"",this.addManagedListener(this.eFilterToolPanelHeader,"click",this.toggleExpanded.bind(this)),this.addManagedListener(this.eFilterToolPanelHeader,"keydown",this.onKeyDown.bind(this)),this.addManagedListener(this.eventService,qd.Events.EVENT_FILTER_OPENED,this.onFilterOpened.bind(this)),this.addInIcon("filter",this.eFilterIcon,this.column),qd._.setDisplayed(this.eFilterIcon,this.isFilterActive(),{skipAriaHidden:!0}),qd._.setDisplayed(this.eExpandChecked,!1),this.hideHeader?(qd._.setDisplayed(this.eFilterToolPanelHeader,!1),this.eFilterToolPanelHeader.removeAttribute("tabindex")):this.eFilterToolPanelHeader.setAttribute("tabindex","0"),this.addManagedListener(this.column,qd.Column.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this))}onKeyDown(e){const{key:t}=e,{ENTER:i,SPACE:n,LEFT:s,RIGHT:r}=qd.KeyCode;t!==i&&t!==n&&t!==s&&t!==r||(e.preventDefault(),t===i||t===n?this.toggleExpanded():t===qd.KeyCode.LEFT?this.collapse():this.expand())}getColumn(){return this.column}getColumnFilterName(){return this.columnModel.getDisplayNameForColumn(this.column,"filterToolPanel",!1)}addCssClassToTitleBar(e){this.eFilterToolPanelHeader.classList.add(e)}addInIcon(e,t,i){if(null==t)return;const n=qd._.createIconNoSpan(e,this.gos,i);t.appendChild(n)}isFilterActive(){return this.filterManager.isFilterActive(this.column)}onFilterChanged(){qd._.setDisplayed(this.eFilterIcon,this.isFilterActive(),{skipAriaHidden:!0}),this.dispatchEvent({type:qd.Column.EVENT_FILTER_CHANGED})}toggleExpanded(){this.expanded?this.collapse():this.expand()}expand(){this.expanded||(this.expanded=!0,qd._.setAriaExpanded(this.eFilterToolPanelHeader,!0),qd._.setDisplayed(this.eExpandChecked,!0),qd._.setDisplayed(this.eExpandUnchecked,!1),this.addFilterElement(),this.expandedCallback())}addFilterElement(e){var t;const i=qd._.loadTemplate('<div class="ag-filter-toolpanel-instance-filter"></div>'),n=this.createManagedBean(new qd.FilterWrapperComp(this.column,"TOOLBAR"));this.filterWrapperComp=n,n.hasFilter()&&(null==(t=n.getFilter())||t.then(t=>{this.underlyingFilter=t,t&&(i.appendChild(n.getGui()),this.agFilterToolPanelBody.appendChild(i),n.afterGuiAttached({container:"toolPanel",suppressFocus:e}))}))}collapse(){var e;this.expanded&&(this.expanded=!1,qd._.setAriaExpanded(this.eFilterToolPanelHeader,!1),this.removeFilterElement(),qd._.setDisplayed(this.eExpandChecked,!1),qd._.setDisplayed(this.eExpandUnchecked,!0),null==(e=this.filterWrapperComp)||e.afterGuiDetached(),this.destroyBean(this.filterWrapperComp),this.expandedCallback())}removeFilterElement(){qd._.clearElement(this.agFilterToolPanelBody)}isExpanded(){return this.expanded}refreshFilter(e){var t;if(!this.expanded)return;const i=this.underlyingFilter;i&&(e?"function"==typeof i.refreshVirtualList&&i.refreshVirtualList():null==(t=i.afterGuiDetached)||t.call(i))}onFilterOpened(e){"COLUMN_MENU"===e.source&&e.column===this.column&&this.expanded&&this.collapse()}};ap.TEMPLATE='\n        <div class="ag-filter-toolpanel-instance">\n            <div class="ag-filter-toolpanel-header ag-filter-toolpanel-instance-header" ref="eFilterToolPanelHeader" role="button" aria-expanded="false">\n                <div ref="eExpand" class="ag-filter-toolpanel-expand"></div>\n                <span ref="eFilterName" class="ag-header-cell-text"></span>\n                <span ref="eFilterIcon" class="ag-header-icon ag-filter-icon ag-filter-toolpanel-instance-header-icon" aria-hidden="true"></span>\n            </div>\n            <div class="ag-filter-toolpanel-instance-body ag-filter" ref="agFilterToolPanelBody"></div>\n        </div>',rp([(0,qd.RefSelector)("eFilterToolPanelHeader")],ap.prototype,"eFilterToolPanelHeader",2),rp([(0,qd.RefSelector)("eFilterName")],ap.prototype,"eFilterName",2),rp([(0,qd.RefSelector)("agFilterToolPanelBody")],ap.prototype,"agFilterToolPanelBody",2),rp([(0,qd.RefSelector)("eFilterIcon")],ap.prototype,"eFilterIcon",2),rp([(0,qd.RefSelector)("eExpand")],ap.prototype,"eExpand",2),rp([(0,qd.Autowired)("filterManager")],ap.prototype,"filterManager",2),rp([(0,qd.Autowired)("columnModel")],ap.prototype,"columnModel",2),rp([qd.PostConstruct],ap.prototype,"postConstruct",1);var lp=ap,cp=class e extends Xd.Component{constructor(e,t,i,n,s){super(),this.columnGroup=e,this.childFilterComps=t,this.depth=n,this.expandedCallback=i,this.showingColumn=s}preConstruct(){this.setTemplate(e.TEMPLATE,{filterGroupComp:{cssIdentifier:"filter-toolpanel",direction:"vertical"}})}init(){this.setGroupTitle(),this.filterGroupComp.setAlignItems("stretch"),this.filterGroupComp.addCssClass(`ag-filter-toolpanel-group-level-${this.depth}`),this.filterGroupComp.addCssClassToTitleBar(`ag-filter-toolpanel-group-level-${this.depth}-header`),this.childFilterComps.forEach(e=>{this.filterGroupComp.addItem(e),e.addCssClassToTitleBar(`ag-filter-toolpanel-group-level-${this.depth+1}-header`)}),this.refreshFilterClass(),this.addExpandCollapseListeners(),this.addFilterChangedListeners(),this.setupTooltip(),this.addInIcon("filter")}setupTooltip(){if(!this.showingColumn)return;let e;"whenTruncated"===this.gos.get("tooltipShowMode")&&(e=()=>{const e=this.filterGroupComp.getGui().querySelector(".ag-group-title");return!e||e.scrollWidth>e.clientWidth});const t=()=>{const t=this.columnGroup.getColDef().headerTooltip;this.setTooltip({newTooltipText:t,location:"filterToolPanelColumnGroup",shouldDisplayTooltip:e})};t(),this.addManagedListener(this.eventService,Xd.Events.EVENT_NEW_COLUMNS_LOADED,t)}getTooltipParams(){const e=super.getTooltipParams();return e.location="filterToolPanelColumnGroup",e}addCssClassToTitleBar(e){this.filterGroupComp.addCssClassToTitleBar(e)}refreshFilters(t){this.childFilterComps.forEach(i=>{i instanceof e?i.refreshFilters(t):i.refreshFilter(t)})}isColumnGroup(){return this.columnGroup instanceof Xd.ProvidedColumnGroup}isExpanded(){return this.filterGroupComp.isExpanded()}getChildren(){return this.childFilterComps}getFilterGroupName(){return this.filterGroupName?this.filterGroupName:""}getFilterGroupId(){return this.columnGroup.getId()}hideGroupItem(e,t){this.filterGroupComp.hideItem(e,t)}hideGroup(e){this.setDisplayed(!e)}addInIcon(e){const t=Xd._.createIconNoSpan(e,this.gos);t&&t.classList.add("ag-filter-toolpanel-group-instance-header-icon"),this.filterGroupComp.addTitleBarWidget(t)}forEachToolPanelFilterChild(e){this.childFilterComps.forEach(t=>{t instanceof lp&&e(t)})}addExpandCollapseListeners(){const e=this.isColumnGroup()?()=>this.expandedCallback():()=>this.forEachToolPanelFilterChild(e=>e.expand()),t=this.isColumnGroup()?()=>this.expandedCallback():()=>this.forEachToolPanelFilterChild(e=>e.collapse());this.addManagedListener(this.filterGroupComp,Xd.AgGroupComponent.EVENT_EXPANDED,e),this.addManagedListener(this.filterGroupComp,Xd.AgGroupComponent.EVENT_COLLAPSED,t)}getColumns(){return this.columnGroup instanceof Xd.ProvidedColumnGroup?this.columnGroup.getLeafColumns():[this.columnGroup]}addFilterChangedListeners(){this.getColumns().forEach(e=>{this.addManagedListener(e,Xd.Column.EVENT_FILTER_CHANGED,()=>this.refreshFilterClass())}),this.columnGroup instanceof Xd.ProvidedColumnGroup||this.addManagedListener(this.eventService,Xd.Events.EVENT_FILTER_OPENED,this.onFilterOpened.bind(this))}refreshFilterClass(){const e=this.getColumns();this.filterGroupComp.addOrRemoveCssClass("ag-has-filter",e.some(e=>e.isFilterActive()))}onFilterOpened(e){"COLUMN_MENU"===e.source&&e.column===this.columnGroup&&this.isExpanded()&&this.collapse()}expand(){this.filterGroupComp.toggleGroupExpand(!0)}collapse(){this.filterGroupComp.toggleGroupExpand(!1)}setGroupTitle(){this.filterGroupName=this.columnGroup instanceof Xd.ProvidedColumnGroup?this.getColumnGroupName(this.columnGroup):this.getColumnName(this.columnGroup),this.filterGroupComp.setTitle(this.filterGroupName||"")}getColumnGroupName(e){return this.columnModel.getDisplayNameForProvidedColumnGroup(null,e,"filterToolPanel")}getColumnName(e){return this.columnModel.getDisplayNameForColumn(e,"filterToolPanel",!1)}destroyFilters(){this.childFilterComps=this.destroyBeans(this.childFilterComps),Xd._.clearElement(this.getGui())}destroy(){this.destroyFilters(),super.destroy()}};cp.TEMPLATE='<div class="ag-filter-toolpanel-group-wrapper">\n            <ag-group-component ref="filterGroupComp"></ag-group-component>\n        </div>',rp([(0,Xd.RefSelector)("filterGroupComp")],cp.prototype,"filterGroupComp",2),rp([(0,Xd.Autowired)("columnModel")],cp.prototype,"columnModel",2),rp([Xd.PreConstruct],cp.prototype,"preConstruct",1),rp([Xd.PostConstruct],cp.prototype,"init",1);var hp=cp,up=class e extends Yd.Component{constructor(){super(e.TEMPLATE),this.initialised=!1,this.hasLoadedInitialState=!1,this.isInitialState=!1,this.filterGroupComps=[],this.suppressOnColumnsChanged=!1,this.onColumnsChangedPending=!1}init(e){this.initialised=!0;const t=this.gos.addGridCommonParams({suppressExpandAll:!1,suppressFilterSearch:!1,suppressSyncLayoutWithGrid:!1});Yd._.mergeDeep(t,e),this.params=t,this.params.suppressSyncLayoutWithGrid||this.addManagedListener(this.eventService,Yd.Events.EVENT_COLUMN_MOVED,()=>this.onColumnsChanged()),this.addManagedListener(this.eventService,Yd.Events.EVENT_NEW_COLUMNS_LOADED,()=>this.onColumnsChanged()),this.addManagedListener(this.eventService,Yd.Events.EVENT_TOOL_PANEL_VISIBLE_CHANGED,e=>{"filters"===e.key&&this.refreshFilters(e.visible)}),this.addManagedListener(this.eventService,Yd.Events.EVENT_DRAG_STARTED,()=>{this.suppressOnColumnsChanged=!0}),this.addManagedListener(this.eventService,Yd.Events.EVENT_DRAG_STOPPED,()=>{this.suppressOnColumnsChanged=!1,this.onColumnsChangedPending&&(this.onColumnsChangedPending=!1,this.onColumnsChanged())}),this.columnModel.isReady()&&this.onColumnsChanged()}onColumnsChanged(){if(this.suppressOnColumnsChanged)return void(this.onColumnsChangedPending=!0);const e=this.columnModel.isPivotMode();this.params.suppressSyncLayoutWithGrid||e?this.buildTreeFromProvidedColumnDefs():this.syncFilterLayout(),this.refreshAriaLabel()}syncFilterLayout(){this.toolPanelColDefService.syncLayoutWithGrid(this.setFiltersLayout.bind(this)),this.refreshAriaLabel()}buildTreeFromProvidedColumnDefs(){const e=this.columnModel.getPrimaryColumnTree();this.recreateFilters(e)}setFiltersLayout(e){const t=this.toolPanelColDefService.createColumnTree(e);this.recreateFilters(t)}recreateFilters(e){const t=this.gos.getActiveDomElement();this.hasLoadedInitialState||(this.hasLoadedInitialState=!0,this.isInitialState=!!this.params.initialState);const i=this.getExpansionState();this.destroyFilters(),this.filterGroupComps=this.recursivelyAddComps(e,0,i);const n=this.filterGroupComps.length;n&&(this.filterGroupComps.forEach(e=>this.appendChild(e)),this.setFirstAndLastVisible(0,n-1)),Yd._.exists(this.searchFilterText)&&this.searchFilters(this.searchFilterText),this.fireExpandedEvent(),this.getGui().contains(t)&&t.focus(),this.isInitialState=!1,this.refreshAriaLabel()}recursivelyAddComps(e,t,i){return Yd._.flatten(e.map(e=>{if(e instanceof Yd.ProvidedColumnGroup)return Yd._.flatten(this.recursivelyAddFilterGroupComps(e,t,i));const n=e;if(!this.shouldDisplayFilter(n))return[];const s=new lp(0===t,()=>this.onFilterExpanded());if(this.createBean(s),s.setColumn(n),i.get(n.getId())&&s.expand(),t>0)return s;const r=this.createBean(new hp(n,[s],this.onGroupExpanded.bind(this),t,!0));return r.addCssClassToTitleBar("ag-filter-toolpanel-header"),i.get(r.getFilterGroupId())||r.collapse(),r}))}refreshAriaLabel(){const e=this.localeService.getLocaleTextFunc(),t=e("ariaFilterPanelList","Filter List"),i=e("filters","Filters"),n=this.getGui().querySelectorAll(".ag-filter-toolpanel-group-item:not(.ag-filter-toolpanel-group-wrapper, .ag-hidden)").length;Yd._.setAriaLabel(this.getAriaElement(),`${t} ${n} ${i}`)}recursivelyAddFilterGroupComps(e,t,i){if(!this.filtersExistInChildren(e.getChildren()))return;const n=e.getColGroupDef();if(n&&n.suppressFiltersToolPanel)return[];const s=e.isPadding()?t:t+1,r=Yd._.flatten(this.recursivelyAddComps(e.getChildren(),s,i));if(e.isPadding())return r;const o=new hp(e,r,this.onGroupExpanded.bind(this),t,!1);this.createBean(o),o.addCssClassToTitleBar("ag-filter-toolpanel-header");const a=i.get(o.getFilterGroupId());return(this.isInitialState&&!a||!1===a)&&o.collapse(),[o]}filtersExistInChildren(e){return e.some(e=>e instanceof Yd.ProvidedColumnGroup?this.filtersExistInChildren(e.getChildren()):this.shouldDisplayFilter(e))}shouldDisplayFilter(e){const t=e.getColDef()&&e.getColDef().suppressFiltersToolPanel;return e.isFilterAllowed()&&!t}getExpansionState(){const e=new Map;if(this.isInitialState){const{expandedColIds:t,expandedGroupIds:i}=this.params.initialState;return t.forEach(t=>e.set(t,!0)),i.forEach(t=>e.set(t,!0)),e}const t=i=>{e.set(i.getFilterGroupId(),i.isExpanded()),i.getChildren().forEach(i=>{i instanceof hp?t(i):e.set(i.getColumn().getId(),i.isExpanded())})};return this.filterGroupComps.forEach(t),e}refresh(){}setVisible(e){super.setDisplayed(e),e&&!this.initialised&&this.init(this.params)}expandFilterGroups(e,t){const i=[],n=s=>{const r=s.getFilterGroupId();(!t||Yd._.includes(t,r))&&(e&&s.isColumnGroup()?s.expand():s.collapse(),i.push(r)),s.getChildren().forEach(e=>{e instanceof hp&&n(e)})};if(this.filterGroupComps.forEach(n),this.onGroupExpanded(),t){const e=t.filter(e=>i.indexOf(e)<0);e.length>0&&console.warn("AG Grid: unable to find groups for these supplied groupIds:",e)}}expandFilters(e,t){const i=[],n=s=>{if(s instanceof hp){let t=!1;return s.getChildren().forEach(i=>{n(i)&&(e?(s.expand(),t=!0):s.isColumnGroup()||s.collapse())}),t}const r=s.getColumn().getColId(),o=!t||Yd._.includes(t,r);return o&&(e?s.expand():s.collapse(),i.push(r)),o};if(this.filterGroupComps.forEach(n),this.onGroupExpanded(),t){const e=t.filter(e=>i.indexOf(e)<0);e.length>0&&console.warn("AG Grid: unable to find columns for these supplied colIds:",e)}}onGroupExpanded(){this.fireExpandedEvent()}onFilterExpanded(){this.dispatchEvent({type:"filterExpanded"})}fireExpandedEvent(){let e=0,t=0;const i=n=>{n.isColumnGroup()&&(n.isExpanded()?e++:t++,n.getChildren().forEach(e=>{e instanceof hp&&i(e)}))};let n;this.filterGroupComps.forEach(i),n=e>0&&t>0?2:t>0?1:0,this.dispatchEvent({type:"groupExpanded",state:n})}performFilterSearch(e){this.searchFilterText=Yd._.exists(e)?e.toLowerCase():null,this.searchFilters(this.searchFilterText)}searchFilters(e){const t=t=>!Yd._.exists(e)||-1!==t.toLowerCase().indexOf(e),i=(e,n)=>{if(!(e instanceof hp))return t(e.getColumnFilterName()||"");const s=e.getChildren(),r=t(e.getFilterGroupName()),o=n||r;if(o){e.hideGroup(!1);for(let t=0;t<s.length;t++)i(s[t],o),e.hideGroupItem(!1,t);return!0}let a=!1;return s.forEach((t,s)=>{const r=i(t,n);e.hideGroupItem(!r,s),r&&(a=!0)}),e.hideGroup(!a),a};let n,s;this.filterGroupComps.forEach((e,t)=>{i(e,!1),void 0===n?e.containsCssClass("ag-hidden")||(n=t,s=t):e.containsCssClass("ag-hidden")||s===t||(s=t)}),this.setFirstAndLastVisible(n,s),this.refreshAriaLabel()}setFirstAndLastVisible(e,t){this.filterGroupComps.forEach((i,n)=>{i.removeCssClass("ag-first-group-visible"),i.removeCssClass("ag-last-group-visible"),n===e&&i.addCssClass("ag-first-group-visible"),n===t&&i.addCssClass("ag-last-group-visible")})}refreshFilters(e){this.filterGroupComps.forEach(t=>t.refreshFilters(e))}getExpandedFiltersAndGroups(){const e=[],t=new Set,i=n=>{if(n instanceof hp){n.getChildren().forEach(e=>i(e));const s=n.getFilterGroupId();n.isExpanded()&&!t.has(s)&&e.push(s)}else n.isExpanded()&&t.add(n.getColumn().getColId())};return this.filterGroupComps.forEach(i),{expandedGroupIds:e,expandedColIds:Array.from(t)}}destroyFilters(){this.filterGroupComps=this.destroyBeans(this.filterGroupComps),Yd._.clearElement(this.getGui())}destroy(){this.destroyFilters(),super.destroy()}};up.TEMPLATE='<div class="ag-filter-list-panel"></div>',rp([(0,Yd.Autowired)("toolPanelColDefService")],up.prototype,"toolPanelColDefService",2),rp([(0,Yd.Autowired)("columnModel")],up.prototype,"columnModel",2);var dp=up,pp=class e extends Zd.Component{constructor(){super(e.TEMPLATE),this.initialised=!1,this.listenerDestroyFuncs=[]}init(e){this.initialised&&(this.listenerDestroyFuncs.forEach(e=>e()),this.listenerDestroyFuncs=[]),this.initialised=!0;const t=this.gos.addGridCommonParams({suppressExpandAll:!1,suppressFilterSearch:!1,suppressSyncLayoutWithGrid:!1});this.params=sp(sp({},t),e),this.filtersToolPanelHeaderPanel.init(this.params),this.filtersToolPanelListPanel.init(this.params);const i=this.params.suppressExpandAll,n=this.params.suppressFilterSearch;i&&n&&this.filtersToolPanelHeaderPanel.setDisplayed(!1),this.listenerDestroyFuncs.push(this.addManagedListener(this.filtersToolPanelHeaderPanel,"expandAll",this.onExpandAll.bind(this)),this.addManagedListener(this.filtersToolPanelHeaderPanel,"collapseAll",this.onCollapseAll.bind(this)),this.addManagedListener(this.filtersToolPanelHeaderPanel,"searchChanged",this.onSearchChanged.bind(this)),this.addManagedListener(this.filtersToolPanelListPanel,"filterExpanded",this.onFilterExpanded.bind(this)),this.addManagedListener(this.filtersToolPanelListPanel,"groupExpanded",this.onGroupExpanded.bind(this)))}setVisible(e){super.setDisplayed(e),e&&!this.initialised&&this.init(this.params)}onExpandAll(){this.filtersToolPanelListPanel.expandFilterGroups(!0)}onCollapseAll(){this.filtersToolPanelListPanel.expandFilterGroups(!1)}onSearchChanged(e){this.filtersToolPanelListPanel.performFilterSearch(e.searchText)}setFilterLayout(e){this.filtersToolPanelListPanel.setFiltersLayout(e)}onFilterExpanded(){this.params.onStateUpdated()}onGroupExpanded(e){this.filtersToolPanelHeaderPanel.setExpandState(e.state),this.params.onStateUpdated()}expandFilterGroups(e){this.filtersToolPanelListPanel.expandFilterGroups(!0,e)}collapseFilterGroups(e){this.filtersToolPanelListPanel.expandFilterGroups(!1,e)}expandFilters(e){this.filtersToolPanelListPanel.expandFilters(!0,e)}collapseFilters(e){this.filtersToolPanelListPanel.expandFilters(!1,e)}syncLayoutWithGrid(){this.filtersToolPanelListPanel.syncFilterLayout()}refresh(e){return this.init(e),!0}getState(){return this.filtersToolPanelListPanel.getExpandedFiltersAndGroups()}destroy(){super.destroy()}};pp.TEMPLATE='<div class="ag-filter-toolpanel">\n            <ag-filters-tool-panel-header ref="filtersToolPanelHeaderPanel"></ag-filters-tool-panel-header>\n            <ag-filters-tool-panel-list ref="filtersToolPanelListPanel"></ag-filters-tool-panel-list>\n         </div>',rp([(0,Zd.RefSelector)("filtersToolPanelHeaderPanel")],pp.prototype,"filtersToolPanelHeaderPanel",2),rp([(0,Zd.RefSelector)("filtersToolPanelListPanel")],pp.prototype,"filtersToolPanelListPanel",2);var gp=pp,fp={version:"31.3.4",moduleName:$d.ModuleNames.FiltersToolPanelModule,beans:[],agStackComponents:[{componentName:"AgFiltersToolPanelHeader",componentClass:op},{componentName:"AgFiltersToolPanelList",componentClass:dp}],userComponents:[{componentName:"agFiltersToolPanel",componentClass:gp}],dependantModules:[Zc,D]},mp=i(98092),yp=i(98092),vp=i(98092),bp=Object.defineProperty,Cp=Object.getOwnPropertyDescriptor,wp=Object.getOwnPropertySymbols,Sp=Object.prototype.hasOwnProperty,xp=Object.prototype.propertyIsEnumerable,Ep=(e,t,i)=>t in e?bp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Ap=(e,t,i,n)=>{for(var s,r=n>1?void 0:n?Cp(t,i):t,o=e.length-1;o>=0;o--)(s=e[o])&&(r=(n?s(t,i,r):s(r))||r);return n&&r&&bp(t,i,r),r},Mp=class extends vp.BeanStub{constructor(){super(...arguments),this.loadRowDataVersion=0}init(e,t){this.params=t,this.comp=e,null!=t.pinned||(this.setAutoHeightClasses(),this.setupRefreshStrategy(),this.addThemeToDetailGrid(),this.createDetailGrid(),this.loadRowData(),this.addManagedListener(this.eventService,vp.Events.EVENT_FULL_WIDTH_ROW_FOCUSED,this.onFullWidthRowFocused.bind(this)))}onFullWidthRowFocused(e){const t=this.params,i={rowIndex:t.node.rowIndex,rowPinned:t.node.rowPinned},n={rowIndex:e.rowIndex,rowPinned:e.rowPinned};this.rowPositionUtils.sameRow(i,n)&&this.focusService.focusInto(this.comp.getGui(),e.fromBelow)}setAutoHeightClasses(){const e=this.gos.get("detailRowAutoHeight"),t=e?"ag-details-row-auto-height":"ag-details-row-fixed-height",i=e?"ag-details-grid-auto-height":"ag-details-grid-fixed-height";this.comp.addOrRemoveCssClass(t,!0),this.comp.addOrRemoveDetailGridCssClass(i,!0)}setupRefreshStrategy(){const e=this.params.refreshStrategy;"everything"==e||"nothing"==e||"rows"==e?this.refreshStrategy=e:(null!=e&&console.warn("AG Grid: invalid cellRendererParams.refreshStrategy = '"+e+"' supplied, defaulting to refreshStrategy = 'rows'."),this.refreshStrategy="rows")}addThemeToDetailGrid(){const{theme:e}=this.environment.getTheme();e&&this.comp.addOrRemoveDetailGridCssClass(e,!0)}createDetailGrid(){if(vp._.missing(this.params.detailGridOptions))return void console.warn("AG Grid: could not find detail grid options for master detail, please set gridOptions.detailCellRendererParams.detailGridOptions");const e=this.gos.get("detailRowAutoHeight"),t=((e,t)=>{for(var i in t||(t={}))Sp.call(t,i)&&Ep(e,i,t[i]);if(wp)for(var i of wp(t))xp.call(t,i)&&Ep(e,i,t[i]);return e})({},this.params.detailGridOptions);e&&(t.domLayout="autoHeight"),this.comp.setDetailGrid(t)}registerDetailWithMaster(e,t){const i=this.params.node.id,n=this.params.api,s={id:i,api:e,columnApi:t},r=this.params.node;n.isDestroyed()||(n.addDetailGridInfo(i,s),r.detailGridInfo=s,this.addDestroyFunc(()=>{r.detailGridInfo===s&&(n.isDestroyed()||n.removeDetailGridInfo(i),r.detailGridInfo=null)}))}loadRowData(){var e,t,i;this.loadRowDataVersion++;const n=this.loadRowDataVersion;if("serverSide"===(null==(e=this.params.detailGridOptions)?void 0:e.rowModelType))return void(null==(i=null==(t=this.params.node.detailGridInfo)?void 0:t.api)||i.refreshServerSide({purge:!0}));const s=this.params.getDetailRowData;s?s({node:this.params.node,data:this.params.node.data,successCallback:e=>{this.loadRowDataVersion===n&&this.comp.setRowData(e)},context:this.gos.getGridCommonParams().context}):console.warn("AG Grid: could not find getDetailRowData for master / detail, please set gridOptions.detailCellRendererParams.getDetailRowData")}refresh(){const e=!0;switch(this.refreshStrategy){case"nothing":return e;case"everything":return!1}return this.loadRowData(),e}};Ap([(0,vp.Autowired)("rowPositionUtils")],Mp.prototype,"rowPositionUtils",2),Ap([(0,vp.Autowired)("focusService")],Mp.prototype,"focusService",2);var Tp=class e extends yp.Component{init(e){this.params=e,this.selectAndSetTemplate();const t={addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),addOrRemoveDetailGridCssClass:(e,t)=>this.eDetailGrid.classList.toggle(e,t),setDetailGrid:e=>this.setDetailGrid(e),setRowData:e=>this.setRowData(e),getGui:()=>this.eDetailGrid};this.ctrl=this.createManagedBean(new Mp),this.ctrl.init(t,e)}refresh(){return this.ctrl&&this.ctrl.refresh()}destroy(){super.destroy()}selectAndSetTemplate(){if(this.params.pinned)return void this.setTemplate('<div class="ag-details-row"></div>');const t=()=>{this.setTemplate(e.TEMPLATE)};if(yp._.missing(this.params.template))t();else if("string"==typeof this.params.template)this.setTemplate(this.params.template);else if("function"==typeof this.params.template){const e=(0,this.params.template)(this.params);this.setTemplate(e)}else console.warn("AG Grid: detailCellRendererParams.template should be function or string"),t();null==this.eDetailGrid&&console.warn('AG Grid: reference to eDetailGrid was missing from the details template. Please add ref="eDetailGrid" to the template.')}setDetailGrid(e){if(!this.eDetailGrid)return;const t=this.context.getBean("agGridReact"),i=t?yp._.cloneObject(t):void 0,n=this.context.getBean("frameworkComponentWrapper"),s=this.getFrameworkOverrides(),r=(0,yp.createGrid)(this.eDetailGrid,e,{frameworkOverrides:s,providedBeanInstances:{agGridReact:i,frameworkComponentWrapper:n},modules:yp.ModuleRegistry.__getGridRegisteredModules(this.params.api.getGridId())});this.detailApi=r,this.ctrl.registerDetailWithMaster(r,new yp.ColumnApi(r)),this.addDestroyFunc(()=>{null==r||r.destroy()})}setRowData(e){this.detailApi&&this.detailApi.setGridOption("rowData",e)}};Tp.TEMPLATE='<div class="ag-details-row" role="gridcell">\n            <div ref="eDetailGrid" class="ag-details-grid" role="presentation"></div>\n        </div>',Ap([(0,yp.RefSelector)("eDetailGrid")],Tp.prototype,"eDetailGrid",2);var Dp=Tp,Ip={version:"31.3.4",moduleName:mp.ModuleNames.MasterDetailModule,beans:[],userComponents:[{componentName:"agDetailCellRenderer",componentClass:Dp}],controllers:[{controllerName:"detailCellRenderer",controllerClass:Mp}],dependantModules:[D]},Rp=i(98092),kp=i(98092),Pp=i(98092),_p=i(98092),Lp=i(98092),Np=i(98092),Op=i(98092),Fp=i(98092),Gp=Object.defineProperty,Bp=Object.defineProperties,Vp=Object.getOwnPropertyDescriptor,Hp=Object.getOwnPropertyDescriptors,Up=Object.getOwnPropertySymbols,zp=Object.prototype.hasOwnProperty,Wp=Object.prototype.propertyIsEnumerable,jp=(e,t,i)=>t in e?Gp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,$p=(e,t)=>{for(var i in t||(t={}))zp.call(t,i)&&jp(e,i,t[i]);if(Up)for(var i of Up(t))Wp.call(t,i)&&jp(e,i,t[i]);return e},Kp=(e,t)=>Bp(e,Hp(t)),Yp=(e,t,i,n)=>{for(var s,r=n>1?void 0:n?Vp(t,i):t,o=e.length-1;o>=0;o--)(s=e[o])&&(r=(n?s(t,i,r):s(r))||r);return n&&r&&Gp(t,i,r),r},qp=class extends kp.BeanStub{hideActiveMenu(){this.destroyBean(this.activeMenu)}showMenuAfterMouseEvent(e,t,i,n){const s=n?"filterMenuTab":void 0;this.showMenu(e,n=>{var r;const o=n.getGui();this.popupService.positionPopupUnderMouseEvent({type:i,column:e,mouseEvent:t,ePopup:o}),s&&(null==(r=n.showTab)||r.call(n,s)),this.dispatchVisibleChangedEvent(!0,!1,e,s)},i,s,void 0,t.target)}showMenuAfterButtonClick(e,t,i,n){let s=-1,r="left";this.gos.get("enableRtl")&&(s=1,r="right");const o=n?"filterMenuTab":void 0,a=o?[o]:void 0,l=this.menuService.isLegacyMenuEnabled();let c=(l?9:4)*s,h=l?-23:4;this.showMenu(e,n=>{var s;const a=n.getGui();this.popupService.positionPopupByComponent({type:i,column:e,eventSource:t,ePopup:a,alignSide:r,nudgeX:c,nudgeY:h,position:"under",keepWithinBounds:!0}),o&&(null==(s=n.showTab)||s.call(n,o)),this.dispatchVisibleChangedEvent(!0,!1,e,o)},i,o,a,t)}showMenu(e,t,i,n,s,r){var o;const{menu:a,eMenuGui:l,anchorToElement:c,restoreFocusParams:h}=this.getMenuParams(e,s,r),u=[];u.push(t=>{const i=a.getGui();this.destroyBean(a),e&&(e.setMenuVisible(!1,"contextMenu"),this.menuUtils.restoreFocusOnClose(h,i,t))});const d=this.localeService.getLocaleTextFunc();if(this.popupService.addPopup({modal:!0,eChild:l,closeOnEsc:!0,closedCallback:t=>{u.forEach(e=>e(t)),this.dispatchVisibleChangedEvent(!1,!1,e,n)},afterGuiAttached:e=>a.afterGuiAttached(Object.assign({},{container:i},e)),positionCallback:n?()=>t(a):void 0,ariaLabel:d("ariaLabelColumnMenu","Column Menu")}),n||(null==(o=a.showTabBasedOnPreviousSelection)||o.call(a),t(a)),this.menuService.isColumnMenuAnchoringEnabled()){const t=this.popupService.setPopupPositionRelatedToElement(l,c);t&&e&&this.addStopAnchoring(t,e,u)}a.addEventListener(Zp.EVENT_TAB_SELECTED,t=>{this.dispatchVisibleChangedEvent(!1,!0,e),this.lastSelectedTab=t.key,this.dispatchVisibleChangedEvent(!0,!0,e)}),null==e||e.setMenuVisible(!0,"contextMenu"),this.activeMenu=a,a.addEventListener(kp.BeanStub.EVENT_DESTROYED,()=>{this.activeMenu===a&&(this.activeMenu=null)})}addStopAnchoring(e,t,i){e.then(e=>{t.addEventListener("leftChanged",e),t.addEventListener("visibleChanged",e),i.push(()=>{t.removeEventListener("leftChanged",e),t.removeEventListener("visibleChanged",e)})})}getMenuParams(e,t,i){const n={column:e,headerPosition:this.focusService.getFocusedHeader(),columnIndex:this.columnModel.getAllDisplayedColumns().indexOf(e),eventSource:i},s=this.createMenu(e,n,t,i);return{menu:s,eMenuGui:s.getGui(),anchorToElement:i||this.ctrlsService.getGridBodyCtrl().getGui(),restoreFocusParams:n}}createMenu(e,t,i,n){return this.menuService.isLegacyMenuEnabled()?this.createBean(new Zp(e,t,this.lastSelectedTab,i,n)):this.createBean(new Qp(e,t,n))}dispatchVisibleChangedEvent(e,t,i,n){var s,r;const o={type:kp.Events.EVENT_COLUMN_MENU_VISIBLE_CHANGED,visible:e,switchingTab:t,key:null!=(r=null!=(s=this.lastSelectedTab)?s:n)?r:this.menuService.isLegacyMenuEnabled()?Zp.TAB_GENERAL:"columnMenu",column:null!=i?i:null};this.eventService.dispatchEvent(o)}isMenuEnabled(e){var t;if(!this.menuService.isLegacyMenuEnabled())return!0;const i=!this.filterManager.isFilterAllowed(e),n=null!=(t=e.getColDef().menuTabs)?t:Zp.TABS_DEFAULT;return(i&&n.includes(Zp.TAB_FILTER)?n.length-1:n.length)>0}showMenuAfterContextMenuEvent(e,t,i){this.menuUtils.onContextMenu(t,i,t=>(this.showMenuAfterMouseEvent(e,t,"columnMenu"),!0))}};Yp([(0,kp.Autowired)("popupService")],qp.prototype,"popupService",2),Yp([(0,kp.Autowired)("focusService")],qp.prototype,"focusService",2),Yp([(0,kp.Autowired)("ctrlsService")],qp.prototype,"ctrlsService",2),Yp([(0,kp.Autowired)("columnModel")],qp.prototype,"columnModel",2),Yp([(0,kp.Autowired)("filterManager")],qp.prototype,"filterManager",2),Yp([(0,kp.Autowired)("menuUtils")],qp.prototype,"menuUtils",2),Yp([(0,kp.Autowired)("menuService")],qp.prototype,"menuService",2),qp=Yp([(0,kp.Bean)("enterpriseMenuFactory")],qp);var Xp=class e extends kp.BeanStub{constructor(t,i,n,s,r){super(),this.column=t,this.restoreFocusParams=i,this.initialSelection=n,this.restrictTo=s,this.sourceElement=r,this.tabFactories={},this.includeChecks={},this.tabFactories[e.TAB_GENERAL]=this.createMainPanel.bind(this),this.tabFactories[e.TAB_FILTER]=this.createFilterPanel.bind(this),this.tabFactories[e.TAB_COLUMNS]=this.createColumnsPanel.bind(this),this.includeChecks[e.TAB_GENERAL]=()=>!0,this.includeChecks[e.TAB_FILTER]=()=>!!t&&this.filterManager.isFilterAllowed(t),this.includeChecks[e.TAB_COLUMNS]=()=>!0}init(){const e=this.getTabsToCreate().map(e=>this.createTab(e));this.tabbedLayout=new kp.TabbedLayout({items:e,cssClass:"ag-menu",onActiveItemClicked:this.onHidePopup.bind(this),onItemClicked:this.onTabItemClicked.bind(this)}),this.createBean(this.tabbedLayout),this.mainMenuList&&this.mainMenuList.setParentComponent(this.tabbedLayout),this.addDestroyFunc(()=>this.destroyBean(this.tabbedLayout))}getTabsToCreate(){var t,i;return this.restrictTo?this.restrictTo:(null!=(i=null==(t=this.column)?void 0:t.getColDef().menuTabs)?i:e.TABS_DEFAULT).filter(e=>this.isValidMenuTabItem(e)).filter(e=>this.isNotSuppressed(e)).filter(e=>this.isModuleLoaded(e))}isModuleLoaded(t){return t!==e.TAB_COLUMNS||kp.ModuleRegistry.__isRegistered(kp.ModuleNames.ColumnsToolPanelModule,this.context.getGridId())}isValidMenuTabItem(t){let i=!0,n=e.TABS_DEFAULT;return null!=this.restrictTo&&(i=this.restrictTo.indexOf(t)>-1,n=this.restrictTo),i=i&&e.TABS_DEFAULT.indexOf(t)>-1,i||console.warn(`AG Grid: Trying to render an invalid menu item '${t}'. Check that your 'menuTabs' contains one of [${n}]`),i}isNotSuppressed(e){return this.includeChecks[e]()}createTab(e){return this.tabFactories[e]()}showTabBasedOnPreviousSelection(){this.showTab(this.initialSelection)}showTab(t){this.tabItemColumns&&t===e.TAB_COLUMNS?this.tabbedLayout.showItem(this.tabItemColumns):this.tabItemFilter&&t===e.TAB_FILTER?this.tabbedLayout.showItem(this.tabItemFilter):this.tabItemGeneral&&t===e.TAB_GENERAL?this.tabbedLayout.showItem(this.tabItemGeneral):this.tabbedLayout.showFirstItem()}onTabItemClicked(t){let i=null;switch(t.item){case this.tabItemColumns:i=e.TAB_COLUMNS;break;case this.tabItemFilter:i=e.TAB_FILTER;break;case this.tabItemGeneral:i=e.TAB_GENERAL}i&&this.activateTab(i)}activateTab(t){const i={type:e.EVENT_TAB_SELECTED,key:t};this.dispatchEvent(i)}createMainPanel(){return this.mainMenuList=this.columnMenuFactory.createMenu(this,this.column,()=>{var e;return null!=(e=this.sourceElement)?e:this.getGui()}),this.mainMenuList.addEventListener(kp.AgMenuItemComponent.EVENT_CLOSE_MENU,this.onHidePopup.bind(this)),this.tabItemGeneral={title:kp._.createIconNoSpan("menu",this.gos,this.column),titleLabel:e.TAB_GENERAL.replace("MenuTab",""),bodyPromise:kp.AgPromise.resolve(this.mainMenuList.getGui()),name:e.TAB_GENERAL},this.tabItemGeneral}onHidePopup(e){this.menuUtils.closePopupAndRestoreFocusOnSelect(this.hidePopupFunc,this.restoreFocusParams,e)}createFilterPanel(){const t=this.column?this.createManagedBean(new kp.FilterWrapperComp(this.column,"COLUMN_MENU")):null;if(!(null==t?void 0:t.hasFilter()))throw new Error("AG Grid - Unable to instantiate filter");return this.tabItemFilter={title:kp._.createIconNoSpan("filter",this.gos,this.column),titleLabel:e.TAB_FILTER.replace("MenuTab",""),bodyPromise:kp.AgPromise.resolve(null==t?void 0:t.getGui()),afterAttachedCallback:e=>t.afterGuiAttached(e),afterDetachedCallback:()=>t.afterGuiDetached(),name:e.TAB_FILTER},this.tabItemFilter}createColumnsPanel(){const t=document.createElement("div");t.classList.add("ag-menu-column-select-wrapper");const i=this.columnChooserFactory.createColumnSelectPanel(this,this.column).getGui();return i.classList.add("ag-menu-column-select"),t.appendChild(i),this.tabItemColumns={title:kp._.createIconNoSpan("columns",this.gos,this.column),titleLabel:e.TAB_COLUMNS.replace("MenuTab",""),bodyPromise:kp.AgPromise.resolve(t),name:e.TAB_COLUMNS},this.tabItemColumns}afterGuiAttached(e){const{container:t,hidePopup:i}=e;this.tabbedLayout.setAfterAttachedParams({container:t,hidePopup:i}),i&&(this.hidePopupFunc=i,this.addDestroyFunc(i))}getGui(){return this.tabbedLayout.getGui()}};Xp.EVENT_TAB_SELECTED="tabSelected",Xp.TAB_FILTER="filterMenuTab",Xp.TAB_GENERAL="generalMenuTab",Xp.TAB_COLUMNS="columnsMenuTab",Xp.TABS_DEFAULT=[Xp.TAB_GENERAL,Xp.TAB_FILTER,Xp.TAB_COLUMNS],Yp([(0,kp.Autowired)("filterManager")],Xp.prototype,"filterManager",2),Yp([(0,kp.Autowired)("columnChooserFactory")],Xp.prototype,"columnChooserFactory",2),Yp([(0,kp.Autowired)("columnMenuFactory")],Xp.prototype,"columnMenuFactory",2),Yp([(0,kp.Autowired)("menuUtils")],Xp.prototype,"menuUtils",2),Yp([kp.PostConstruct],Xp.prototype,"init",1);var Zp=Xp,Qp=class extends kp.Component{constructor(e,t,i){super('\n            <div ref="eColumnMenu" role="presentation" class="ag-menu ag-column-menu"></div>\n        '),this.column=e,this.restoreFocusParams=t,this.sourceElement=i}init(){this.mainMenuList=this.columnMenuFactory.createMenu(this,this.column,()=>{var e;return null!=(e=this.sourceElement)?e:this.getGui()}),this.mainMenuList.addEventListener(kp.AgMenuItemComponent.EVENT_CLOSE_MENU,this.onHidePopup.bind(this)),this.eColumnMenu.appendChild(this.mainMenuList.getGui())}onHidePopup(e){this.menuUtils.closePopupAndRestoreFocusOnSelect(this.hidePopupFunc,this.restoreFocusParams,e)}afterGuiAttached({hidePopup:e}){e&&(this.hidePopupFunc=e,this.addDestroyFunc(e)),this.focusService.focusInto(this.mainMenuList.getGui())}};Yp([(0,kp.Autowired)("columnMenuFactory")],Qp.prototype,"columnMenuFactory",2),Yp([(0,kp.Autowired)("menuUtils")],Qp.prototype,"menuUtils",2),Yp([(0,kp.Autowired)("focusService")],Qp.prototype,"focusService",2),Yp([(0,kp.RefSelector)("eColumnMenu")],Qp.prototype,"eColumnMenu",2),Yp([kp.PostConstruct],Qp.prototype,"init",1);var Jp="ag-context-menu-open",eg=class extends Pp.BeanStub{hideActiveMenu(){this.destroyBean(this.activeMenu)}getMenuItems(e,t,i){const n=[];if(Pp._.exists(e)&&Pp.ModuleRegistry.__isRegistered(Pp.ModuleNames.ClipboardModule,this.context.getGridId())&&t&&(this.gos.get("suppressCutToClipboard")||n.push("cut"),n.push("copy","copyWithHeaders","copyWithGroupHeaders","paste","separator")),this.gos.get("enableCharts")&&Pp.ModuleRegistry.__isRegistered(Pp.ModuleNames.GridChartsModule,this.context.getGridId())&&(this.columnModel.isPivotMode()&&n.push("pivotChart"),this.rangeService&&!this.rangeService.isEmpty()&&n.push("chartRange")),Pp._.exists(e)){const e=!Pp.ModuleRegistry.__isRegistered(Pp.ModuleNames.CsvExportModule,this.context.getGridId()),t=!Pp.ModuleRegistry.__isRegistered(Pp.ModuleNames.ExcelExportModule,this.context.getGridId()),i=this.gos.get("suppressExcelExport")||t,s=this.gos.get("suppressCsvExport")||e;!(Pp._.isIOSUserAgent()||i&&s)&&n.push("export")}const s=n.length?n:void 0,r=null==t?void 0:t.getColDef().contextMenuItems;if(Array.isArray(r))return r;if("function"==typeof r)return r(this.gos.addGridCommonParams({column:t,node:e,value:i,defaultItems:s}));const o=this.gos.getCallback("getContextMenuItems");return o?o({column:t,node:e,value:i,defaultItems:s}):n}onContextMenu(e,t,i,n,s,r){this.menuUtils.onContextMenu(e,t,e=>this.showMenu(i,n,s,e,r))}showMenu(e,t,i,n,s){const r=this.getMenuItems(e,t,i),o=this.ctrlsService.getGridBodyCtrl().getGui();if(void 0===r||Pp._.missingOrEmpty(r))return!1;const a=new tg(r,t,e,i);this.createBean(a);const l=a.getGui(),c={column:t,rowNode:e,type:"contextMenu",mouseEvent:n,ePopup:l,nudgeY:1},h=this.localeService.getLocaleTextFunc(),u=this.popupService.addPopup({modal:!0,eChild:l,closeOnEsc:!0,closedCallback:e=>{o.classList.remove(Jp),this.destroyBean(a),this.dispatchVisibleChangedEvent(!1,void 0===e?"api":"ui")},click:n,positionCallback:()=>{const e=this.gos.get("enableRtl");this.popupService.positionPopupUnderMouseEvent(Kp($p({},c),{nudgeX:e?-1*(l.offsetWidth+1):1}))},anchorToElement:s,ariaLabel:h("ariaLabelContextMenu","Context Menu")});u&&(o.classList.add(Jp),a.afterGuiAttached({container:"contextMenu",hidePopup:u.hideFunc})),this.activeMenu&&this.hideActiveMenu(),this.activeMenu=a,a.addEventListener(Pp.BeanStub.EVENT_DESTROYED,()=>{this.activeMenu===a&&(this.activeMenu=null)}),u&&a.addEventListener(Pp.AgMenuItemComponent.EVENT_CLOSE_MENU,e=>{var t,i;return u.hideFunc({mouseEvent:null!=(t=e.mouseEvent)?t:void 0,keyboardEvent:null!=(i=e.keyboardEvent)?i:void 0,forceHide:!0})});const d=n&&n instanceof MouseEvent&&"mousedown"===n.type;return this.dispatchVisibleChangedEvent(!0,d?"api":"ui"),!0}dispatchVisibleChangedEvent(e,t="ui"){const i={type:Pp.Events.EVENT_CONTEXT_MENU_VISIBLE_CHANGED,visible:e,source:t};this.eventService.dispatchEvent(i)}};Yp([(0,Pp.Autowired)("popupService")],eg.prototype,"popupService",2),Yp([(0,Pp.Autowired)("ctrlsService")],eg.prototype,"ctrlsService",2),Yp([(0,Pp.Autowired)("columnModel")],eg.prototype,"columnModel",2),Yp([(0,Pp.Autowired)("menuUtils")],eg.prototype,"menuUtils",2),Yp([(0,Pp.Optional)("rangeService")],eg.prototype,"rangeService",2),eg=Yp([(0,Pp.Bean)("contextMenuFactory")],eg);var tg=class extends Pp.Component{constructor(e,t,i,n){super('<div class="ag-menu" role="presentation"></div>'),this.menuItems=e,this.column=t,this.node=i,this.value=n,this.menuList=null,this.focusedCell=null}addMenuItems(){const e=this.createManagedBean(new Pp.AgMenuList(0,{column:this.column,node:this.node,value:this.value})),t=this.menuItemMapper.mapWithStockItems(this.menuItems,null,()=>this.getGui());e.addMenuItems(t),this.appendChild(e),this.menuList=e,e.addEventListener(Pp.AgMenuItemComponent.EVENT_CLOSE_MENU,e=>this.dispatchEvent(e))}afterGuiAttached(e){e.hidePopup&&this.addDestroyFunc(e.hidePopup),this.focusedCell=this.focusService.getFocusedCell(),this.menuList&&this.focusService.focusInto(this.menuList.getGui())}restoreFocusedCell(){const e=this.focusService.getFocusedCell();if(e&&this.focusedCell&&this.cellPositionUtils.equals(e,this.focusedCell)){const{rowIndex:e,rowPinned:t,column:i}=this.focusedCell,n=this.gos.getDocument(),s=this.gos.getActiveDomElement();s&&s!==n.body||this.focusService.setFocusedCell({rowIndex:e,column:i,rowPinned:t,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!this.focusService.isKeyboardMode()})}}destroy(){this.restoreFocusedCell(),super.destroy()}};Yp([(0,Pp.Autowired)("menuItemMapper")],tg.prototype,"menuItemMapper",2),Yp([(0,Pp.Autowired)("focusService")],tg.prototype,"focusService",2),Yp([(0,Pp.Autowired)("cellPositionUtils")],tg.prototype,"cellPositionUtils",2),Yp([Pp.PostConstruct],tg.prototype,"addMenuItems",1);var ig=class extends _p.BeanStub{mapWithStockItems(e,t,i){if(!e)return[];const n=[];return e.forEach(e=>{let s;if(s="string"==typeof e?this.getStockMenuItem(e,t,i):$p({},e),!s)return;const r=s,{subMenu:o}=r;o&&o instanceof Array&&(r.subMenu=this.mapWithStockItems(o,t,i)),null!=s&&n.push(s)}),n}getStockMenuItem(e,t,i){var n;const s=this.localeService.getLocaleTextFunc(),r=this.gos.get("skipHeaderOnAutoSize");switch(e){case"pinSubMenu":return{name:s("pinColumn","Pin Column"),icon:_p._.createIconNoSpan("menuPin",this.gos,null),subMenu:["clearPinned","pinLeft","pinRight"]};case"pinLeft":return{name:s("pinLeft","Pin Left"),action:()=>this.columnModel.setColumnsPinned([t],"left","contextMenu"),checked:!!t&&t.isPinnedLeft()};case"pinRight":return{name:s("pinRight","Pin Right"),action:()=>this.columnModel.setColumnsPinned([t],"right","contextMenu"),checked:!!t&&t.isPinnedRight()};case"clearPinned":return{name:s("noPin","No Pin"),action:()=>this.columnModel.setColumnsPinned([t],null,"contextMenu"),checked:!!t&&!t.isPinned()};case"valueAggSubMenu":return _p.ModuleRegistry.__assertRegistered(_p.ModuleNames.RowGroupingModule,"Aggregation from Menu",this.context.getGridId())&&((null==t?void 0:t.isPrimary())||(null==t?void 0:t.getColDef().pivotValueColumn))?{name:s("valueAggregation","Value Aggregation"),icon:_p._.createIconNoSpan("menuValue",this.gos,null),subMenu:this.createAggregationSubMenu(t,this.aggFuncService)}:null;case"autoSizeThis":return{name:s("autosizeThiscolumn","Autosize This Column"),action:()=>this.columnModel.autoSizeColumn(t,"contextMenu",r)};case"autoSizeAll":return{name:s("autosizeAllColumns","Autosize All Columns"),action:()=>this.columnModel.autoSizeAllColumns("contextMenu",r)};case"rowGroup":return{name:s("groupBy","Group by")+" "+_p._.escapeString(this.columnModel.getDisplayNameForColumn(t,"header")),disabled:(null==t?void 0:t.isRowGroupActive())||!(null==t?void 0:t.getColDef().enableRowGroup),action:()=>this.columnModel.addRowGroupColumns([t],"contextMenu"),icon:_p._.createIconNoSpan("menuAddRowGroup",this.gos,null)};case"rowUnGroup":const o=_p._.createIconNoSpan("menuRemoveRowGroup",this.gos,null),a=null==t?void 0:t.getColDef().showRowGroup,l=this.gos.get("groupLockGroupColumns");if(!0===a)return{name:s("ungroupAll","Un-Group All"),disabled:-1===l||l>=this.columnModel.getRowGroupColumns().length,action:()=>this.columnModel.setRowGroupColumns(this.columnModel.getRowGroupColumns().slice(0,l),"contextMenu"),icon:o};if("string"==typeof a){const e=this.columnModel.getPrimaryColumn(a),t=null!=e?_p._.escapeString(this.columnModel.getDisplayNameForColumn(e,"header")):a;return{name:s("ungroupBy","Un-Group by")+" "+t,disabled:null!=e&&this.columnModel.isColumnGroupingLocked(e),action:()=>this.columnModel.removeRowGroupColumns([a],"contextMenu"),icon:o}}return{name:s("ungroupBy","Un-Group by")+" "+_p._.escapeString(this.columnModel.getDisplayNameForColumn(t,"header")),disabled:!(null==t?void 0:t.isRowGroupActive())||!(null==t?void 0:t.getColDef().enableRowGroup)||this.columnModel.isColumnGroupingLocked(t),action:()=>this.columnModel.removeRowGroupColumns([t],"contextMenu"),icon:o};case"resetColumns":return{name:s("resetColumns","Reset Columns"),action:()=>this.columnModel.resetColumnState("contextMenu")};case"expandAll":return{name:s("expandAll","Expand All Row Groups"),action:()=>this.gridApi.expandAll()};case"contractAll":return{name:s("collapseAll","Collapse All Row Groups"),action:()=>this.gridApi.collapseAll()};case"copy":return _p.ModuleRegistry.__assertRegistered(_p.ModuleNames.ClipboardModule,"Copy from Menu",this.context.getGridId())?{name:s("copy","Copy"),shortcut:s("ctrlC","Ctrl+C"),icon:_p._.createIconNoSpan("clipboardCopy",this.gos,null),action:()=>this.clipboardService.copyToClipboard()}:null;case"copyWithHeaders":return _p.ModuleRegistry.__assertRegistered(_p.ModuleNames.ClipboardModule,"Copy with Headers from Menu",this.context.getGridId())?{name:s("copyWithHeaders","Copy with Headers"),icon:_p._.createIconNoSpan("clipboardCopy",this.gos,null),action:()=>this.clipboardService.copyToClipboard({includeHeaders:!0})}:null;case"copyWithGroupHeaders":return _p.ModuleRegistry.__assertRegistered(_p.ModuleNames.ClipboardModule,"Copy with Group Headers from Menu",this.context.getGridId())?{name:s("copyWithGroupHeaders","Copy with Group Headers"),icon:_p._.createIconNoSpan("clipboardCopy",this.gos,null),action:()=>this.clipboardService.copyToClipboard({includeHeaders:!0,includeGroupHeaders:!0})}:null;case"cut":if(_p.ModuleRegistry.__assertRegistered(_p.ModuleNames.ClipboardModule,"Cut from Menu",this.context.getGridId())){const e=this.focusService.getFocusedCell(),t=e?this.rowPositionUtils.getRowNode(e):null,i=!!t&&(null==e?void 0:e.column.isCellEditable(t));return{name:s("cut","Cut"),shortcut:s("ctrlX","Ctrl+X"),icon:_p._.createIconNoSpan("clipboardCut",this.gos,null),disabled:!i||this.gos.get("suppressCutToClipboard"),action:()=>this.clipboardService.cutToClipboard(void 0,"contextMenu")}}return null;case"paste":return _p.ModuleRegistry.__assertRegistered(_p.ModuleNames.ClipboardModule,"Paste from Clipboard",this.context.getGridId())?{name:s("paste","Paste"),shortcut:s("ctrlV","Ctrl+V"),disabled:!0,icon:_p._.createIconNoSpan("clipboardPaste",this.gos,null),action:()=>this.clipboardService.pasteFromClipboard()}:null;case"export":const c=[],h=_p.ModuleRegistry.__isRegistered(_p.ModuleNames.CsvExportModule,this.context.getGridId()),u=_p.ModuleRegistry.__isRegistered(_p.ModuleNames.ExcelExportModule,this.context.getGridId());return!this.gos.get("suppressCsvExport")&&h&&c.push("csvExport"),!this.gos.get("suppressExcelExport")&&u&&c.push("excelExport"),{name:s("export","Export"),subMenu:c,icon:_p._.createIconNoSpan("save",this.gos,null)};case"csvExport":return{name:s("csvExport","CSV Export"),icon:_p._.createIconNoSpan("csvExport",this.gos,null),action:()=>this.gridApi.exportDataAsCsv({})};case"excelExport":return{name:s("excelExport","Excel Export"),icon:_p._.createIconNoSpan("excelExport",this.gos,null),action:()=>this.gridApi.exportDataAsExcel()};case"separator":return"separator";case"pivotChart":case"chartRange":return null!=(n=this.chartMenuItemMapper.getChartItems(e))?n:null;case"columnFilter":return t?{name:s("columnFilter","Column Filter"),icon:_p._.createIconNoSpan("filter",this.gos,null),action:()=>this.menuService.showFilterMenu({column:t,buttonElement:i(),containerType:"columnFilter",positionBy:"button"})}:null;case"columnChooser":return _p.ModuleRegistry.__isRegistered(_p.ModuleNames.ColumnsToolPanelModule,this.context.getGridId())?{name:s("columnChooser","Choose Columns"),icon:_p._.createIconNoSpan("columns",this.gos,null),action:()=>this.menuService.showColumnChooser({column:t,eventSource:i()})}:null;case"sortAscending":return{name:s("sortAscending","Sort Ascending"),icon:_p._.createIconNoSpan("sortAscending",this.gos,null),action:()=>this.sortController.setSortForColumn(t,"asc",!1,"columnMenu")};case"sortDescending":return{name:s("sortDescending","Sort Descending"),icon:_p._.createIconNoSpan("sortDescending",this.gos,null),action:()=>this.sortController.setSortForColumn(t,"desc",!1,"columnMenu")};case"sortUnSort":return{name:s("sortUnSort","Clear Sort"),icon:_p._.createIconNoSpan("sortUnSort",this.gos,null),action:()=>this.sortController.setSortForColumn(t,null,!1,"columnMenu")};default:return console.warn(`AG Grid: unknown menu item type ${e}`),null}}createAggregationSubMenu(e,t){const i=this.localeService.getLocaleTextFunc();let n;if(e.isPrimary())n=e;else{const t=e.getColDef().pivotValueColumn;n=_p._.exists(t)?t:void 0}const s=[];if(n){const e=n.isValueActive(),r=t.getFuncNames(n);s.push({name:i("noAggregation","None"),action:()=>{this.columnModel.removeValueColumns([n],"contextMenu"),this.columnModel.setColumnAggFunc(n,void 0,"contextMenu")},checked:!e}),r.forEach(r=>{s.push({name:i(r,t.getDefaultFuncLabel(r)),action:()=>{this.columnModel.setColumnAggFunc(n,r,"contextMenu"),this.columnModel.addValueColumns([n],"contextMenu")},checked:e&&n.getAggFunc()===r})})}return s}};Yp([(0,_p.Autowired)("columnModel")],ig.prototype,"columnModel",2),Yp([(0,_p.Autowired)("gridApi")],ig.prototype,"gridApi",2),Yp([(0,_p.Autowired)("focusService")],ig.prototype,"focusService",2),Yp([(0,_p.Autowired)("rowPositionUtils")],ig.prototype,"rowPositionUtils",2),Yp([(0,_p.Autowired)("chartMenuItemMapper")],ig.prototype,"chartMenuItemMapper",2),Yp([(0,_p.Autowired)("menuService")],ig.prototype,"menuService",2),Yp([(0,_p.Autowired)("sortController")],ig.prototype,"sortController",2),Yp([(0,_p.Optional)("clipboardService")],ig.prototype,"clipboardService",2),Yp([(0,_p.Optional)("aggFuncService")],ig.prototype,"aggFuncService",2),ig=Yp([(0,_p.Bean)("menuItemMapper")],ig);var ng=class extends Lp.BeanStub{getChartItems(e){var t,i;if(!this.chartService)return void Lp.ModuleRegistry.__assertRegistered(Lp.ModuleNames.GridChartsModule,`the Context Menu key "${e}"`,this.context.getGridId());const n="pivotChart"===e?new sg(this.gos,this.chartService,this.localeService):new rg(this.gos,this.chartService,this.localeService),s=this.chartService.isEnterprise();let r=n.getMenuItem();if(r&&r.subMenu&&!s){const e=t=>{var i;return Kp($p({},t),{subMenu:null==(i=t.subMenu)?void 0:i.filter(e=>!e._enterprise).map(t=>e(t))})};r=e(r)}const o=null==(i=null==(t=this.gos.get("chartToolPanelsDef"))?void 0:t.settingsPanel)?void 0:i.chartGroupsDef;return o&&(r=ng.filterAndOrderChartMenu(r,o,n.getConfigLookup())),this.cleanInternals(r)}cleanInternals(e){if(!e)return e;const t=e=>{var i;return null==e||delete e._key,null==e||delete e._enterprise,null==(i=null==e?void 0:e.subMenu)||i.forEach(e=>t(e)),e};return t(e)}static buildLookup(e){let t={};const i=e=>{t[e._key]=e,e.subMenu&&e.subMenu.forEach(e=>i(e))};return i(e),t}static filterAndOrderChartMenu(e,t,i){var n;const s=this.buildLookup(e);let r=Kp($p({},e),{subMenu:[]});if(Object.entries(t).forEach(([e,t])=>{var n,o;const a=i[e];if(null===a)return;if(null==a)return void Lp._.warnOnce(`invalid chartGroupsDef config '${e}'`);const l=s[a._key];if(l)if(l.subMenu){const i=t.map(t=>{const i=a[t];if(null!=i)return s[i];Lp._.warnOnce(`invalid chartGroupsDef config '${e}.${t}'`)}).filter(e=>void 0!==e);i.length>0&&(l.subMenu=i,null==(n=r.subMenu)||n.push(l))}else null==(o=r.subMenu)||o.push(l)}),0!=(null==(n=r.subMenu)?void 0:n.length))return r}};Yp([(0,Lp.Optional)("chartService")],ng.prototype,"chartService",2),ng=Yp([(0,Lp.Bean)("chartMenuItemMapper")],ng);var sg=class{constructor(e,t,i){this.gos=e,this.chartService=t,this.localeService=i}getMenuItem(){const e=this.localeService.getLocaleTextFunc(),t=(t,i,n,s,r=!1)=>({name:e(t,i),action:()=>this.chartService.createPivotChart({chartType:n}),_key:s,_enterprise:r});return{name:e("pivotChart","Pivot Chart"),_key:"pivotChart",subMenu:[{_key:"pivotColumnChart",name:e("columnChart","Column"),subMenu:[t("groupedColumn","Grouped&lrm;","groupedColumn","pivotGroupedColumn"),t("stackedColumn","Stacked&lrm;","stackedColumn","pivotStackedColumn"),t("normalizedColumn","100% Stacked&lrm;","normalizedColumn","pivotNormalizedColumn")]},{_key:"pivotBarChart",name:e("barChart","Bar"),subMenu:[t("groupedBar","Grouped&lrm;","groupedBar","pivotGroupedBar"),t("stackedBar","Stacked&lrm;","stackedBar","pivotStackedBar"),t("normalizedBar","100% Stacked&lrm;","normalizedBar","pivotNormalizedBar")]},{_key:"pivotPieChart",name:e("pieChart","Pie"),subMenu:[t("pie","Pie&lrm;","pie","pivotPie"),t("donut","Donut&lrm;","donut","pivotDonut")]},t("line","Line&lrm;","line","pivotLineChart"),{_key:"pivotXYChart",name:e("xyChart","X Y (Scatter)"),subMenu:[t("scatter","Scatter&lrm;","scatter","pivotScatter"),t("bubble","Bubble&lrm;","bubble","pivotBubble")]},{_key:"pivotAreaChart",name:e("areaChart","Area"),subMenu:[t("area","Area&lrm;","area","pivotArea"),t("stackedArea","Stacked&lrm;","stackedArea","pivotStackedArea"),t("normalizedArea","100% Stacked&lrm;","normalizedArea","pivotNormalizedArea")]},{_key:"pivotStatisticalChart",_enterprise:!1,name:e("statisticalChart","Statistical"),subMenu:[t("histogramChart","Histogram&lrm;","histogram","pivotHistogram",!1)]},{_key:"pivotHierarchicalChart",_enterprise:!0,name:e("hierarchicalChart","Hierarchical"),subMenu:[t("treemapChart","Treemap&lrm;","treemap","pivotTreemap",!0),t("sunburstChart","Sunburst&lrm;","sunburst","pivotSunburst",!0)]},{_key:"pivotCombinationChart",name:e("combinationChart","Combination"),subMenu:[t("columnLineCombo","Column & Line&lrm;","columnLineCombo","pivotColumnLineCombo"),t("AreaColumnCombo","Area & Column&lrm;","areaColumnCombo","pivotAreaColumnCombo")]}],icon:Lp._.createIconNoSpan("chart",this.gos,void 0)}}getConfigLookup(){return{columnGroup:{_key:"pivotColumnChart",column:"pivotGroupedColumn",stackedColumn:"pivotStackedColumn",normalizedColumn:"pivotNormalizedColumn"},barGroup:{_key:"pivotBarChart",bar:"pivotGroupedBar",stackedBar:"pivotStackedBar",normalizedBar:"pivotNormalizedBar"},pieGroup:{_key:"pivotPieChart",pie:"pivotPie",donut:"pivotDonut",doughnut:"pivotDonut"},lineGroup:{_key:"pivotLineChart",line:"pivotLineChart"},scatterGroup:{_key:"pivotXYChart",bubble:"pivotBubble",scatter:"pivotScatter"},areaGroup:{_key:"pivotAreaChart",area:"pivotArea",stackedArea:"pivotStackedArea",normalizedArea:"pivotNormalizedArea"},combinationGroup:{_key:"pivotCombinationChart",columnLineCombo:"pivotColumnLineCombo",areaColumnCombo:"pivotAreaColumnCombo",customCombo:null},hierarchicalGroup:{_key:"pivotHierarchicalChart",treemap:"pivotTreemap",sunburst:"pivotSunburst"},statisticalGroup:{_key:"pivotStatisticalChart",histogram:"pivotHistogram",rangeBar:null,rangeArea:null,boxPlot:null},polarGroup:null,specializedGroup:null}}},rg=class{constructor(e,t,i){this.gos=e,this.chartService=t,this.localeService=i}getMenuItem(){const e=this.localeService.getLocaleTextFunc(),t=(t,i,n,s,r=!1)=>({name:e(t,i),action:()=>this.chartService.createChartFromCurrentRange(n),_key:s,_enterprise:r});return{name:e("chartRange","Chart Range"),_key:"chartRange",subMenu:[{name:e("columnChart","Column"),subMenu:[t("groupedColumn","Grouped&lrm;","groupedColumn","rangeGroupedColumn"),t("stackedColumn","Stacked&lrm;","stackedColumn","rangeStackedColumn"),t("normalizedColumn","100% Stacked&lrm;","normalizedColumn","rangeNormalizedColumn")],_key:"rangeColumnChart"},{name:e("barChart","Bar"),subMenu:[t("groupedBar","Grouped&lrm;","groupedBar","rangeGroupedBar"),t("stackedBar","Stacked&lrm;","stackedBar","rangeStackedBar"),t("normalizedBar","100% Stacked&lrm;","normalizedBar","rangeNormalizedBar")],_key:"rangeBarChart"},{name:e("pieChart","Pie"),subMenu:[t("pie","Pie&lrm;","pie","rangePie"),t("donut","Donut&lrm;","donut","rangeDonut")],_key:"rangePieChart"},t("line","Line&lrm;","line","rangeLineChart"),{name:e("xyChart","X Y (Scatter)"),subMenu:[t("scatter","Scatter&lrm;","scatter","rangeScatter"),t("bubble","Bubble&lrm;","bubble","rangeBubble")],_key:"rangeXYChart"},{name:e("areaChart","Area"),subMenu:[t("area","Area&lrm;","area","rangeArea"),t("stackedArea","Stacked&lrm;","stackedArea","rangeStackedArea"),t("normalizedArea","100% Stacked&lrm;","normalizedArea","rangeNormalizedArea")],_key:"rangeAreaChart"},{name:e("polarChart","Polar"),subMenu:[t("radarLine","Radar Line&lrm;","radarLine","rangeRadarLine"),t("radarArea","Radar Area&lrm;","radarArea","rangeRadarArea"),t("nightingale","Nightingale&lrm;","nightingale","rangeNightingale"),t("radialColumn","Radial Column&lrm;","radialColumn","rangeRadialColumn"),t("radialBar","Radial Bar&lrm;","radialBar","rangeRadialBar")],_key:"rangePolarChart",_enterprise:!0},{name:e("statisticalChart","Statistical"),subMenu:[t("boxPlot","Box Plot&lrm;","boxPlot","rangeBoxPlot",!0),t("histogramChart","Histogram&lrm;","histogram","rangeHistogram",!1),t("rangeBar","Range Bar&lrm;","rangeBar","rangeRangeBar",!0),t("rangeArea","Range Area&lrm;","rangeArea","rangeRangeArea",!0)],_key:"rangeStatisticalChart",_enterprise:!1},{name:e("hierarchicalChart","Hierarchical"),subMenu:[t("treemap","Treemap&lrm;","treemap","rangeTreemap"),t("sunburst","Sunburst&lrm;","sunburst","rangeSunburst")],_key:"rangeHierarchicalChart",_enterprise:!0},{name:e("specializedChart","Specialized"),subMenu:[t("heatmap","Heatmap&lrm;","heatmap","rangeHeatmap"),t("waterfall","Waterfall&lrm;","waterfall","rangeWaterfall")],_key:"rangeSpecializedChart",_enterprise:!0},{name:e("combinationChart","Combination"),subMenu:[t("columnLineCombo","Column & Line&lrm;","columnLineCombo","rangeColumnLineCombo"),t("AreaColumnCombo","Area & Column&lrm;","areaColumnCombo","rangeAreaColumnCombo")],_key:"rangeCombinationChart"}],icon:Lp._.createIconNoSpan("chart",this.gos,void 0)}}getConfigLookup(){return{columnGroup:{_key:"rangeColumnChart",column:"rangeGroupedColumn",stackedColumn:"rangeStackedColumn",normalizedColumn:"rangeNormalizedColumn"},barGroup:{_key:"rangeBarChart",bar:"rangeGroupedBar",stackedBar:"rangeStackedBar",normalizedBar:"rangeNormalizedBar"},pieGroup:{_key:"rangePieChart",pie:"rangePie",donut:"rangeDonut",doughnut:"rangeDonut"},lineGroup:{_key:"rangeLineChart",line:"rangeLineChart"},scatterGroup:{_key:"rangeXYChart",bubble:"rangeBubble",scatter:"rangeScatter"},areaGroup:{_key:"rangeAreaChart",area:"rangeArea",stackedArea:"rangeStackedArea",normalizedArea:"rangeNormalizedArea"},polarGroup:{_key:"rangePolarChart",radarLine:"rangeRadarLine",radarArea:"rangeRadarArea",nightingale:"rangeNightingale",radialColumn:"rangeRadialColumn",radialBar:"rangeRadialBar"},statisticalGroup:{_key:"rangeStatisticalChart",boxPlot:"rangeBoxPlot",histogram:"rangeHistogram",rangeBar:"rangeRangeBar",rangeArea:"rangeRangeArea"},hierarchicalGroup:{_key:"rangeHierarchicalChart",treemap:"rangeTreemap",sunburst:"rangeSunburst"},specializedGroup:{_key:"rangeSpecializedChart",heatmap:"rangeHeatmap",waterfall:"rangeWaterfall"},combinationGroup:{_key:"rangeCombinationChart",columnLineCombo:"rangeColumnLineCombo",areaColumnCombo:"rangeAreaColumnCombo",customCombo:null}}}},og=class extends Np.BeanStub{createColumnSelectPanel(e,t,i,n){var s,r;const o=e.createManagedBean(new Sh),a=null!=(r=null!=(s=null!=n?n:null==t?void 0:t.getColDef().columnChooserParams)?s:null==t?void 0:t.getColDef().columnsMenuParams)?r:{},{contractColumnSelection:l,suppressColumnExpandAll:c,suppressColumnFilter:h,suppressColumnSelectAll:u,suppressSyncLayoutWithGrid:d,columnLayout:p}=a;return o.init(!!i,this.gos.addGridCommonParams({suppressColumnMove:!1,suppressValues:!1,suppressPivots:!1,suppressRowGroups:!1,suppressPivotMode:!1,contractColumnSelection:!!l,suppressColumnExpandAll:!!c,suppressColumnFilter:!!h,suppressColumnSelectAll:!!u,suppressSyncLayoutWithGrid:!!p||!!d,onStateUpdated:()=>{}}),"columnMenu"),p&&o.setColumnLayout(p),o}showColumnChooser({column:e,chooserParams:t,eventSource:i}){this.hideActiveColumnChooser();const n=this.createColumnSelectPanel(this,e,!0,t),s=this.localeService.getLocaleTextFunc(),r=this.columnModel.getAllDisplayedColumns().indexOf(e),o=e?this.focusService.getFocusedHeader():null;this.activeColumnChooserDialog=this.createBean(new Np.AgDialog({title:s("chooseColumns","Choose Columns"),component:n,width:300,height:300,resizable:!0,movable:!0,centered:!0,closable:!0,afterGuiAttached:()=>{var t;null==(t=this.focusService.findNextFocusableElement(n.getGui()))||t.focus(),this.dispatchVisibleChangedEvent(!0,e)},closedCallback:t=>{const n=this.activeColumnChooser.getGui();this.destroyBean(this.activeColumnChooser),this.activeColumnChooser=void 0,this.activeColumnChooserDialog=void 0,this.dispatchVisibleChangedEvent(!1,e),e&&this.menuUtils.restoreFocusOnClose({column:e,headerPosition:o,columnIndex:r,eventSource:i},n,t,!0)}})),this.activeColumnChooser=n}hideActiveColumnChooser(){this.activeColumnChooserDialog&&this.destroyBean(this.activeColumnChooserDialog)}dispatchVisibleChangedEvent(e,t){const i={type:Np.Events.EVENT_COLUMN_MENU_VISIBLE_CHANGED,visible:e,switchingTab:!1,key:"columnChooser",column:null!=t?t:null};this.eventService.dispatchEvent(i)}};Yp([(0,Np.Autowired)("focusService")],og.prototype,"focusService",2),Yp([(0,Np.Autowired)("menuUtils")],og.prototype,"menuUtils",2),Yp([(0,Np.Autowired)("columnModel")],og.prototype,"columnModel",2),og=Yp([(0,Np.Bean)("columnChooserFactory")],og);var ag=class extends Op.BeanStub{createMenu(e,t,i){const n=e.createManagedBean(new Op.AgMenuList(0,{column:null!=t?t:null,node:null,value:null})),s=this.getMenuItems(t),r=this.menuItemMapper.mapWithStockItems(s,null!=t?t:null,i);return n.addMenuItems(r),n}getMenuItems(e){const t=this.getDefaultMenuOptions(e);let i;const n=null==e?void 0:e.getColDef().mainMenuItems;if(Array.isArray(n))i=n;else if("function"==typeof n)i=n(this.gos.addGridCommonParams({column:e,defaultItems:t}));else{const n=this.gos.getCallback("getMainMenuItems");i=n&&e?n({column:e,defaultItems:t}):t}return Op._.removeRepeatsFromArray(i,ag.MENU_ITEM_SEPARATOR),i}getDefaultMenuOptions(e){const t=[],i=this.menuService.isLegacyMenuEnabled();if(!e)return i||t.push("columnChooser"),t.push("resetColumns"),t;const n=!e.getColDef().lockPinned,s=this.columnModel.getRowGroupColumns().length,r=s>0,o=e.isAllowValue(),a=e.isAllowRowGroup(),l=e.isPrimary(),c=this.columnModel.isPivotMode(),h="clientSide"===this.rowModel.getType(),u=this.gos.get("treeData"),d=l&&r&&o||!l;if(!i&&e.isSortable()){const i=e.getSort();"asc"!==i&&t.push("sortAscending"),"desc"!==i&&t.push("sortDescending"),i&&t.push("sortUnSort"),t.push(ag.MENU_ITEM_SEPARATOR)}return this.menuService.isFilterMenuItemEnabled(e)&&(t.push("columnFilter"),t.push(ag.MENU_ITEM_SEPARATOR)),n&&t.push("pinSubMenu"),d&&t.push("valueAggSubMenu"),(n||d)&&t.push(ag.MENU_ITEM_SEPARATOR),t.push("autoSizeThis"),t.push("autoSizeAll"),t.push(ag.MENU_ITEM_SEPARATOR),e.getColDef().showRowGroup?t.push("rowUnGroup"):a&&e.isPrimary()&&(e.isRowGroupActive()?this.columnModel.isColumnGroupingLocked(e)||t.push("rowUnGroup"):t.push("rowGroup")),t.push(ag.MENU_ITEM_SEPARATOR),i||t.push("columnChooser"),t.push("resetColumns"),h&&(u||s>(c?1:0))&&(t.push("expandAll"),t.push("contractAll")),t}};ag.MENU_ITEM_SEPARATOR="separator",Yp([(0,Op.Autowired)("menuItemMapper")],ag.prototype,"menuItemMapper",2),Yp([(0,Op.Autowired)("columnModel")],ag.prototype,"columnModel",2),Yp([(0,Op.Autowired)("rowModel")],ag.prototype,"rowModel",2),Yp([(0,Op.Autowired)("filterManager")],ag.prototype,"filterManager",2),Yp([(0,Op.Autowired)("menuService")],ag.prototype,"menuService",2),ag=Yp([(0,Op.Bean)("columnMenuFactory")],ag);var lg=class extends Fp.BeanStub{restoreFocusOnClose(e,t,i,n){const{eventSource:s}=e,r=i instanceof KeyboardEvent;if(!n&&!r||!s)return;const o=this.gos.getDocument(),a=this.gos.getActiveDomElement();(t.contains(a)||a===o.body)&&this.focusHeaderCell(e)}closePopupAndRestoreFocusOnSelect(e,t,i){let n;i&&i.keyboardEvent&&(n=i.keyboardEvent),e(n&&{keyboardEvent:n});const s=this.focusService.getFocusedCell(),r=this.gos.getDocument(),o=this.gos.getActiveDomElement();if(!o||o===r.body)if(s){const{rowIndex:e,rowPinned:t,column:i}=s;this.focusService.setFocusedCell({rowIndex:e,column:i,rowPinned:t,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}else this.focusHeaderCell(t)}onContextMenu(e,t,i){if((this.gos.get("allowContextMenuWithControlKey")||!e||!e.ctrlKey&&!e.metaKey)&&(e&&this.blockMiddleClickScrollsIfNeeded(e),!this.gos.get("suppressContextMenu")&&i(null!=e?e:t.touches[0]))){const i=null!=e?e:t;i&&i.cancelable&&i.preventDefault()}}focusHeaderCell(e){const{column:t,columnIndex:i,headerPosition:n,eventSource:s}=e;if(this.columnModel.getAllDisplayedColumns().some(e=>e===t)&&s&&Fp._.isVisible(s)){const e=this.focusService.findTabbableParent(s);e&&(t&&this.headerNavigationService.scrollToColumn(t),e.focus())}else if(n&&-1!==i){const e=this.columnModel.getAllDisplayedColumns(),t=e[i]||Fp._.last(e);t&&this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:n.headerRowIndex,column:t}})}}blockMiddleClickScrollsIfNeeded(e){this.gos.get("suppressMiddleClickScrolls")&&2===e.which&&e.preventDefault()}};Yp([(0,Fp.Autowired)("focusService")],lg.prototype,"focusService",2),Yp([(0,Fp.Autowired)("headerNavigationService")],lg.prototype,"headerNavigationService",2),Yp([(0,Fp.Autowired)("columnModel")],lg.prototype,"columnModel",2),lg=Yp([(0,Fp.Bean)("menuUtils")],lg);var cg={version:"31.3.4",moduleName:Rp.ModuleNames.MenuModule,beans:[qp,eg,ig,ng,og,ag,lg],dependantModules:[D]},hg=i(98092),ug=i(98092),dg=i(98092),pg=Object.defineProperty,gg=Object.defineProperties,fg=Object.getOwnPropertyDescriptor,mg=Object.getOwnPropertyDescriptors,yg=Object.getOwnPropertySymbols,vg=Object.prototype.hasOwnProperty,bg=Object.prototype.propertyIsEnumerable,Cg=(e,t,i)=>t in e?pg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,wg=(e,t)=>{for(var i in t||(t={}))vg.call(t,i)&&Cg(e,i,t[i]);if(yg)for(var i of yg(t))bg.call(t,i)&&Cg(e,i,t[i]);return e},Sg=(e,t)=>gg(e,mg(t)),xg=(e,t,i,n)=>{for(var s,r=n>1?void 0:n?fg(t,i):t,o=e.length-1;o>=0;o--)(s=e[o])&&(r=(n?s(t,i,r):s(r))||r);return n&&r&&pg(t,i,r),r},Eg=class e extends ug.TabGuardComp{constructor(){super('<div class="ag-multi-filter ag-menu-list-compact"></div>'),this.filterDefs=[],this.filters=[],this.guiDestroyFuncs=[],this.filterGuis=[],this.activeFilterIndices=[],this.lastActivatedMenuItem=null,this.afterFiltersReadyFuncs=[]}postConstruct(){this.initialiseTabGuard({onFocusIn:e=>this.onFocusIn(e)})}static getFilterDefs(e){const{filters:t}=e;return t&&t.length>0?t:[{filter:"agTextColumnFilter"},{filter:"agSetColumnFilter"}]}init(t){this.params=t,this.filterDefs=e.getFilterDefs(t);const{column:i,filterChangedCallback:n}=t;this.column=i,this.filterChangedCallback=n;const s=[];return this.filterDefs.forEach((e,t)=>{const i=this.createFilter(e,t);null!=i&&s.push(i)}),new ug.AgPromise(e=>{ug.AgPromise.all(s).then(t=>{this.filters=t,this.refreshGui("columnMenu").then(()=>{e()})})}).then(()=>{this.afterFiltersReadyFuncs.forEach(e=>e()),this.afterFiltersReadyFuncs.length=0})}refreshGui(e){return e===this.lastOpenedInContainer?ug.AgPromise.resolve():(this.removeAllChildrenExceptTabGuards(),this.destroyChildren(),ug.AgPromise.all(this.filters.map((t,i)=>{const n=this.filterDefs[i],s=this.getFilterTitle(t,n);let r;if("subMenu"===n.display&&"toolPanel"!==e)r=this.insertFilterMenu(t,s).then(e=>e.getGui());else if("subMenu"===n.display||"accordion"===n.display){const e=this.insertFilterGroup(t,s);r=ug.AgPromise.resolve(e.getGui())}else r=ug.AgPromise.resolve(t.getGui());return r})).then(t=>{t.forEach((e,t)=>{t>0&&this.appendChild(ug._.loadTemplate('<div class="ag-filter-separator"></div>')),this.appendChild(e)}),this.filterGuis=t,this.lastOpenedInContainer=e}))}getFilterTitle(e,t){return null!=t.title?t.title:e instanceof ug.ProvidedFilter?e.getFilterTitle():"Filter"}destroyChildren(){this.guiDestroyFuncs.forEach(e=>e()),this.guiDestroyFuncs.length=0,this.filterGuis.length=0}insertFilterMenu(e,t){const i=this.createBean(new ug.AgMenuItemComponent);return i.init({menuItemDef:{name:t,subMenu:[],cssClasses:["ag-multi-filter-menu-item"],menuItem:ug.AgMenuItemRenderer,menuItemParams:{cssClassPrefix:"ag-compact-menu-option",isCompact:!0}},level:0,isAnotherSubMenuOpen:()=>!1,childComponent:e,contextParams:{column:null,node:null,value:null}}).then(()=>{i.setParentComponent(this),this.guiDestroyFuncs.push(()=>this.destroyBean(i)),this.addManagedListener(i,ug.AgMenuItemComponent.EVENT_MENU_ITEM_ACTIVATED,e=>{this.lastActivatedMenuItem&&this.lastActivatedMenuItem!==e.menuItem&&this.lastActivatedMenuItem.deactivate(),this.lastActivatedMenuItem=e.menuItem});const e=i.getGui();return i.addManagedListener(e,"keydown",e=>{const{key:t}=e;switch(t){case ug.KeyCode.UP:case ug.KeyCode.RIGHT:case ug.KeyCode.DOWN:case ug.KeyCode.LEFT:e.preventDefault(),t===ug.KeyCode.RIGHT&&i.openSubMenu(!0)}}),i.addManagedListener(e,"focusin",()=>i.activate()),i.addManagedListener(e,"focusout",()=>{i.isSubMenuOpen()||i.isSubMenuOpening()||i.deactivate()}),i})}insertFilterGroup(e,t){const i=this.createBean(new ug.AgGroupComponent({title:t,cssIdentifier:"multi-filter"}));return this.guiDestroyFuncs.push(()=>this.destroyBean(i)),i.addItem(e.getGui()),i.toggleGroupExpand(!1),e.afterGuiAttached&&i.addManagedListener(i,ug.AgGroupComponent.EVENT_EXPANDED,()=>e.afterGuiAttached({container:this.lastOpenedInContainer,suppressFocus:!0,hidePopup:this.hidePopup})),i}isFilterActive(){return this.filters.some(e=>e.isFilterActive())}getLastActiveFilterIndex(){return this.activeFilterIndices.length>0?this.activeFilterIndices[this.activeFilterIndices.length-1]:null}doesFilterPass(e,t){let i=!0;return this.filters.forEach(n=>{i&&n!==t&&n.isFilterActive()&&(i=n.doesFilterPass(e))}),i}getFilterType(){return"multi"}getModelFromUi(){return{filterType:this.getFilterType(),filterModels:this.filters.map(e=>{const t=e;return"function"==typeof t.getModelFromUi?t.getModelFromUi():null})}}getModel(){return this.isFilterActive()?{filterType:this.getFilterType(),filterModels:this.filters.map(e=>e.isFilterActive()?e.getModel():null)}:null}setModel(e){const t=(e,t)=>new ug.AgPromise(i=>{const n=e.setModel(t);n?n.then(()=>i()):i()});let i=[];return null==e?i=this.filters.map((e,i)=>t(e,null).then(()=>{this.updateActiveList(i)})):this.filters.forEach((n,s)=>{const r=e.filterModels.length>s?e.filterModels[s]:null,o=t(n,r).then(()=>{this.updateActiveList(s)});i.push(o)}),ug.AgPromise.all(i).then(()=>{})}applyModel(e="api"){let t=!1;return this.filters.forEach(i=>{i instanceof ug.ProvidedFilter&&(t=i.applyModel(e)||t)}),t}getChildFilterInstance(e){return this.filters[e]}afterGuiAttached(e){let t;e?(this.hidePopup=e.hidePopup,t=this.refreshGui(e.container)):(this.hidePopup=void 0,t=ug.AgPromise.resolve()),t.then(()=>{const{filterDefs:t}=this;let i=!1;t&&ug._.forEachReverse(t,(t,n)=>{var s;const r=0===n,o=!r||"inline"!==t.display,a=Sg(wg({},null!=e?e:{}),{suppressFocus:o}),l=null==(s=this.filters)?void 0:s[n];if(l&&(this.executeFunctionIfExistsOnFilter(l,"afterGuiAttached",a),r&&(i=!0)),r&&o){const e=this.filterGuis[n];e&&(e.focus(),i=!0)}});const n=this.gos.getDocument(),s=this.gos.getActiveDomElement();i||s&&s!==n.body&&!this.getGui().contains(s)||this.forceFocusOutOfContainer(!0)})}afterGuiDetached(){this.executeFunctionIfExists("afterGuiDetached")}onAnyFilterChanged(){this.executeFunctionIfExists("onAnyFilterChanged")}onNewRowsLoaded(){this.executeFunctionIfExists("onNewRowsLoaded")}destroy(){this.filters.forEach(e=>this.destroyBean(e)),this.filters.length=0,this.destroyChildren(),this.hidePopup=void 0,super.destroy()}executeFunctionIfExists(e,...t){ug._.forEachReverse(this.filters,i=>{this.executeFunctionIfExistsOnFilter(i,e,t)})}executeFunctionIfExistsOnFilter(e,t,...i){const n=e[t];"function"==typeof n&&n.apply(e,i)}createFilter(e,t){const{filterModifiedCallback:i,doesRowPassOtherFilter:n}=this.params;let s;const r=Sg(wg({},this.filterManager.createFilterParams(this.column,this.column.getColDef())),{filterModifiedCallback:i,filterChangedCallback:e=>{this.executeWhenAllFiltersReady(()=>this.filterChanged(t,e))},doesRowPassOtherFilter:e=>n(e)&&this.doesFilterPass({node:e,data:e.data},s)}),o=this.userComponentFactory.getFilterDetails(e,r,"agTextColumnFilter");if(!o)return null;const a=o.newAgStackInstance();return a&&a.then(e=>s=e),a}executeWhenAllFiltersReady(e){this.filters&&this.filters.length>0?e():this.afterFiltersReadyFuncs.push(e)}updateActiveList(e){const t=this.filters[e];ug._.removeFromArray(this.activeFilterIndices,e),t.isFilterActive()&&this.activeFilterIndices.push(e)}filterChanged(e,t){this.updateActiveList(e),this.filterChangedCallback(t);const i=this.filters[e];this.filters.forEach(e=>{e!==i&&"function"==typeof e.onAnyFilterChanged&&e.onAnyFilterChanged()})}onFocusIn(e){null==this.lastActivatedMenuItem||this.lastActivatedMenuItem.getGui().contains(e.target)||(this.lastActivatedMenuItem.deactivate(),this.lastActivatedMenuItem=null)}getModelAsString(e){var t,i,n,s;if(!this.filters||!(null==(t=null==e?void 0:e.filterModels)?void 0:t.length))return"";const r=null!=(i=this.getLastActiveFilterIndex())?i:0,o=this.filters[r];return null!=(s=null==(n=o.getModelAsString)?void 0:n.call(o,e.filterModels[r]))?s:""}};xg([(0,ug.Autowired)("filterManager")],Eg.prototype,"filterManager",2),xg([(0,ug.Autowired)("userComponentFactory")],Eg.prototype,"userComponentFactory",2),xg([ug.PostConstruct],Eg.prototype,"postConstruct",1);var Ag=Eg,Mg=class extends dg.Component{constructor(){super('<div class="ag-multi-floating-filter ag-floating-filter-input"></div>'),this.floatingFilters=[],this.compDetailsList=[]}init(e){this.params=e;const{compDetailsList:t}=this.getCompDetailsList(e);return this.setParams(t)}setParams(e){const t=[];return e.forEach(e=>{const i=null==e?void 0:e.newAgStackInstance();null!=i&&(this.compDetailsList.push(e),t.push(i))}),dg.AgPromise.all(t).then(e=>{e.forEach((e,t)=>{this.floatingFilters.push(e);const i=e.getGui();this.appendChild(i),t>0&&dg._.setDisplayed(i,!1)})})}onParamsUpdated(e){this.refresh(e)}refresh(e){this.params=e;const{compDetailsList:t,floatingFilterParamsList:i}=this.getCompDetailsList(e);t.length===this.compDetailsList.length&&t.every((e,t)=>!this.filterManager.areFilterCompsDifferent(this.compDetailsList[t],e))?i.forEach((e,t)=>{var i;const n=this.floatingFilters[t];let s=!1;n.refresh&&null!==n.refresh(e)&&(s=!0),s||null==(i=n.onParamsUpdated)||i.call(n,e)}):(dg._.clearElement(this.getGui()),this.destroyBeans(this.floatingFilters),this.floatingFilters=[],this.compDetailsList=[],this.setParams(t))}getCompDetailsList(e){const t=[],i=[],n=e.filterParams;return Ag.getFilterDefs(n).forEach((n,s)=>{const r=Sg(wg({},e),{parentFilterInstance:e=>{this.parentMultiFilterInstance(t=>{const i=t.getChildFilterInstance(s);null!=i&&e(i)})}});dg._.mergeDeep(r.filterParams,n.filterParams);const o=this.getCompDetails(n,r);o&&(t.push(o),i.push(r))}),{compDetailsList:t,floatingFilterParamsList:i}}onParentModelChanged(e,t){t&&t.afterFloatingFilter||this.parentMultiFilterInstance(i=>{if(null==e)this.floatingFilters.forEach((e,i)=>{e.onParentModelChanged(null,t),dg._.setDisplayed(e.getGui(),0===i)});else{const n=i.getLastActiveFilterIndex();this.floatingFilters.forEach((i,s)=>{const r=e.filterModels.length>s?e.filterModels[s]:null;i.onParentModelChanged(r,t);const o=null==n?0===s:s===n;dg._.setDisplayed(i.getGui(),o)})}})}destroy(){this.destroyBeans(this.floatingFilters),this.floatingFilters.length=0,super.destroy()}getCompDetails(e,t){var i;let n=null!=(i=this.userComponentFactory.getDefaultFloatingFilterType(e,()=>this.filterManager.getDefaultFloatingFilter(this.params.column)))?i:"agReadOnlyFloatingFilter";return this.userComponentFactory.getFloatingFilterCompDetails(e,t,n)}parentMultiFilterInstance(e){this.params.parentFilterInstance(t=>{if(!(t instanceof Ag))throw new Error("AG Grid - MultiFloatingFilterComp expects MultiFilter as its parent");e(t)})}};xg([(0,dg.Autowired)("userComponentFactory")],Mg.prototype,"userComponentFactory",2),xg([(0,dg.Autowired)("filterManager")],Mg.prototype,"filterManager",2);var Tg={version:"31.3.4",moduleName:hg.ModuleNames.MultiFilterModule,beans:[],userComponents:[{componentName:"agMultiColumnFilter",componentClass:Ag},{componentName:"agMultiColumnFloatingFilter",componentClass:Mg}],dependantModules:[D]},Dg=i(98092),Ig=i(98092),Rg=class extends Ig.PopupComponent{constructor(){super('<div class="ag-cell-edit-wrapper"></div>')}init(e){this.params=e;const{cellStartedEdit:t,cellHeight:i,values:n}=e;Ig._.missing(n)&&console.warn("AG Grid: agRichSelectCellEditor requires cellEditorParams.values to be set");const{params:s,valuesPromise:r}=this.buildRichSelectParams();this.richSelect=this.createManagedBean(new Ig.AgRichSelect(s)),this.richSelect.addCssClass("ag-cell-editor"),this.appendChild(this.richSelect),r&&r.then(e=>{this.richSelect.setValueList({valueList:e,refresh:!0});const t=this.getSearchStringCallback(e);t&&this.richSelect.setSearchStringCreator(t)}),this.addManagedListener(this.richSelect,Ig.Events.EVENT_FIELD_PICKER_VALUE_SELECTED,this.onEditorPickerValueSelected.bind(this)),this.addManagedListener(this.richSelect.getGui(),"focusout",this.onEditorFocusOut.bind(this)),this.focusAfterAttached=t,Ig._.exists(i)&&this.richSelect.setRowHeight(i)}onEditorPickerValueSelected(e){this.params.stopEditing(!e.fromEnterKey)}onEditorFocusOut(e){this.richSelect.getGui().contains(e.relatedTarget)||this.params.stopEditing(!0)}buildRichSelectParams(){const{cellRenderer:e,value:t,values:i,formatValue:n,searchDebounceDelay:s,valueListGap:r,valueListMaxHeight:o,valueListMaxWidth:a,allowTyping:l,filterList:c,searchType:h,highlightMatch:u,valuePlaceholder:d,eventKey:p}=this.params,g={value:t,cellRenderer:e,searchDebounceDelay:s,valueFormatter:n,pickerAriaLabelKey:"ariaLabelRichSelectField",pickerAriaLabelValue:"Rich Select Field",pickerType:"virtual-list",pickerGap:r,allowTyping:l,filterList:c,searchType:h,highlightMatch:u,maxPickerHeight:o,maxPickerWidth:a,placeholder:d,initialInputValue:1===(null==p?void 0:p.length)?p:void 0};let f,m;return f="function"==typeof i?i(this.params):null!=i?i:[],Array.isArray(f)?(g.valueList=f,g.searchStringCreator=this.getSearchStringCallback(f)):m=f,{params:g,valuesPromise:m}}getSearchStringCallback(e){const{colDef:t}=this.params;if("object"==typeof e[0]&&t.keyCreator)return e=>e.map(e=>{const i=this.gos.addGridCommonParams({value:e,colDef:this.params.colDef,column:this.params.column,node:this.params.node,data:this.params.data});return t.keyCreator(i)})}afterGuiAttached(){const{focusAfterAttached:e,params:t}=this;setTimeout(()=>{if(!this.isAlive())return;if(e){const e=this.richSelect.getFocusableElement();e.focus();const{allowTyping:t,eventKey:i}=this.params;!t||i&&1===i.length||e.select()}this.richSelect.showPicker();const{eventKey:i}=t;i&&1===(null==i?void 0:i.length)&&this.richSelect.searchTextFromString(i)})}getValue(){return this.richSelect.getValue()}isPopup(){return!1}},kg={version:"31.3.4",moduleName:Dg.ModuleNames.RichSelectModule,beans:[],userComponents:[{componentName:"agRichSelect",componentClass:Rg},{componentName:"agRichSelectCellEditor",componentClass:Rg}],dependantModules:[D]},Pg=i(98092),_g=i(98092),Lg=i(98092),Ng=i(98092),Og=i(98092),Fg=i(98092),Gg=i(98092),Bg=i(98092),Vg=i(98092),Hg=i(98092),Ug=i(98092),zg=i(98092),Wg=i(98092),jg=i(98092),$g=i(98092),Kg=i(98092),Yg=i(98092),qg=i(98092),Xg=i(98092),Zg=Object.defineProperty,Qg=Object.defineProperties,Jg=Object.getOwnPropertyDescriptor,ef=Object.getOwnPropertyDescriptors,tf=Object.getOwnPropertySymbols,nf=Object.prototype.hasOwnProperty,sf=Object.prototype.propertyIsEnumerable,rf=(e,t,i)=>t in e?Zg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,of=(e,t)=>{for(var i in t||(t={}))nf.call(t,i)&&rf(e,i,t[i]);if(tf)for(var i of tf(t))sf.call(t,i)&&rf(e,i,t[i]);return e},af=(e,t)=>{var i={};for(var n in e)nf.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&tf)for(var n of tf(e))t.indexOf(n)<0&&sf.call(e,n)&&(i[n]=e[n]);return i},lf=(e,t,i,n)=>{for(var s,r=n>1?void 0:n?Jg(t,i):t,o=e.length-1;o>=0;o--)(s=e[o])&&(r=(n?s(t,i,r):s(r))||r);return n&&r&&Zg(t,i,r),r},cf=class extends Lg.RowNodeBlock{constructor(e,t,i){super(0),this.nodeIdSequence=new Lg.NumberSequence,this.info={},this.ssrmParams=e,this.parentRowNode=i,this.level=i.level+1,this.groupLevel=e.rowGroupCols?this.level<e.rowGroupCols.length:void 0,this.leafGroup=!!e.rowGroupCols&&this.level===e.rowGroupCols.length-1}postConstruct(){if(this.usingTreeData=this.gos.get("treeData"),this.nodeIdPrefix=this.blockUtils.createNodeIdPrefix(this.parentRowNode),!this.usingTreeData&&this.groupLevel){const e=this.ssrmParams.rowGroupCols[this.level];this.groupField=e.field,this.rowGroupColumn=this.columnModel.getRowGroupColumns()[this.level]}let e=1;const t=-1===this.parentRowNode.level,i=this.storeUtils.getServerSideInitialRowCount();t&&null!=i&&(e=i),this.initialiseRowNodes(e),this.rowNodeBlockLoader.addBlock(this),this.addDestroyFunc(()=>this.rowNodeBlockLoader.removeBlock(this)),this.postSortFunc=this.gos.getCallback("postSortRows"),null!=i&&this.eventService.dispatchEventOnce({type:Lg.Events.EVENT_ROW_COUNT_READY})}destroyRowNodes(){this.blockUtils.destroyRowNodes(this.allRowNodes),this.allRowNodes=[],this.nodesAfterSort=[],this.nodesAfterFilter=[],this.allNodesMap={}}initialiseRowNodes(e,t=!1){this.destroyRowNodes();for(let i=0;i<e;i++){const e=this.blockUtils.createRowNode({field:this.groupField,group:this.groupLevel,leafGroup:this.leafGroup,level:this.level,parent:this.parentRowNode,rowGroupColumn:this.rowGroupColumn});t&&(e.failedLoad=!0),this.allRowNodes.push(e),this.nodesAfterFilter.push(e),this.nodesAfterSort.push(e)}}getBlockStateJson(){return{id:this.nodeIdPrefix?this.nodeIdPrefix:"",state:this.getState()}}loadFromDatasource(){this.storeUtils.loadFromDatasource({startRow:void 0,endRow:void 0,parentBlock:this,parentNode:this.parentRowNode,storeParams:this.ssrmParams,success:this.success.bind(this,this.getVersion()),fail:this.pageLoadFailed.bind(this,this.getVersion())})}getStartRow(){return 0}getEndRow(){return this.nodesAfterSort.length}createDataNode(e,t){const i=this.blockUtils.createRowNode({field:this.groupField,group:this.groupLevel,leafGroup:this.leafGroup,level:this.level,parent:this.parentRowNode,rowGroupColumn:this.rowGroupColumn});null!=t?Lg._.insertIntoArray(this.allRowNodes,i,t):this.allRowNodes.push(i);const n=this.prefixId(this.nodeIdSequence.next());return this.blockUtils.setDataIntoRowNode(i,e,n,void 0),this.nodeManager.addRowNode(i),this.blockUtils.checkOpenByDefault(i),this.allNodesMap[i.id]=i,i}prefixId(e){return this.nodeIdPrefix?this.nodeIdPrefix+"-"+e:e.toString()}processServerFail(){this.initialiseRowNodes(1,!0),this.fireStoreUpdatedEvent(),this.flushAsyncTransactions()}processServerResult(e){if(!this.isAlive())return;const t=e.groupLevelInfo;t&&Object.assign(this.info,t),e.pivotResultFields&&this.serverSideRowModel.generateSecondaryColumns(e.pivotResultFields);const i=this.allRowNodes.length>0?this.allNodesMap:void 0;this.allRowNodes=[],this.nodesAfterSort=[],this.nodesAfterFilter=[],this.allNodesMap={},e.rowData||Lg._.warnOnce('"params.data" is missing from Server-Side Row Model success() callback. Please use the "data" attribute. If no data is returned, set an empty list.'),this.createOrRecycleNodes(i,e.rowData),i&&this.blockUtils.destroyRowNodes(Lg._.getAllValuesInObject(i)),0===this.level&&this.eventService.dispatchEventOnce({type:Lg.Events.EVENT_ROW_COUNT_READY}),this.filterAndSortNodes(),this.fireStoreUpdatedEvent(),this.flushAsyncTransactions()}createOrRecycleNodes(e,t){if(!t)return;const i=t=>{if(!e)return;const i=this.gos.getCallback("getRowId");if(!i)return;const n=this.parentRowNode.getGroupKeys(),s=this.level,r=i({data:t,parentKeys:n.length>0?n:void 0,level:s}),o=e[r];return o?(delete e[r],o):void 0},n=(e,t)=>{this.allNodesMap[e.id]=e,this.blockUtils.updateDataIntoRowNode(e,t),this.allRowNodes.push(e)};t.forEach(e=>{const t=i(e);t?n(t,e):this.createDataNode(e)})}flushAsyncTransactions(){window.setTimeout(()=>this.transactionManager.flushAsyncTransactions(),0)}filterAndSortNodes(){this.filterRowNodes(),this.sortRowNodes()}sortRowNodes(){const e=this.storeUtils.isServerSideSortAllLevels()||this.storeUtils.isServerSideSortOnServer(),t=this.sortController.getSortOptions(),i=!t||0==t.length;if(e||i)this.nodesAfterSort=this.nodesAfterFilter;else if(this.nodesAfterSort=this.rowNodeSorter.doFullSort(this.nodesAfterFilter,t),this.postSortFunc){const e={nodes:this.nodesAfterSort};this.postSortFunc(e)}}filterRowNodes(){const e=!this.storeUtils.isServerSideOnlyRefreshFilteredGroups()||this.storeUtils.isServerSideFilterOnServer(),t=this.groupLevel;this.nodesAfterFilter=e||t?this.allRowNodes:this.allRowNodes.filter(e=>this.filterManager.doesRowPassFilter({rowNode:e}))}clearDisplayIndexes(){this.displayIndexStart=void 0,this.displayIndexEnd=void 0,this.allRowNodes.forEach(e=>this.blockUtils.clearDisplayIndex(e))}getDisplayIndexEnd(){return this.displayIndexEnd}isDisplayIndexInStore(e){return 0!==this.getRowCount()&&e>=this.displayIndexStart&&e<this.displayIndexEnd}setDisplayIndexes(e,t){this.displayIndexStart=e.peek(),this.topPx=t.value;const i={};this.nodesAfterSort.forEach(n=>{this.blockUtils.setDisplayIndex(n,e,t),i[n.id]=!0}),this.allRowNodes.forEach(e=>{i[e.id]||this.blockUtils.clearDisplayIndex(e)}),this.displayIndexEnd=e.peek(),this.heightPx=t.value-this.topPx}forEachStoreDeep(e,t=new Lg.NumberSequence){e(this,t.next()),this.allRowNodes.forEach(i=>{const n=i.childStore;n&&n.forEachStoreDeep(e,t)})}forEachNodeDeep(e,t=new Lg.NumberSequence){this.allRowNodes.forEach(i=>{e(i,t.next());const n=i.childStore;n&&n.forEachNodeDeep(e,t)})}forEachNodeDeepAfterFilterAndSort(e,t=new Lg.NumberSequence,i=!1){this.nodesAfterSort.forEach(n=>{e(n,t.next());const s=n.childStore;s&&s.forEachNodeDeepAfterFilterAndSort(e,t,i)}),i&&this.parentRowNode.sibling&&e(this.parentRowNode.sibling,t.next())}getRowUsingDisplayIndex(e){if(this.isDisplayIndexInStore(e))return this.blockUtils.binarySearchForDisplayIndex(e,this.nodesAfterSort)}getRowBounds(e){for(let t=0;t<this.nodesAfterSort.length;t++){const i=this.nodesAfterSort[t],n=this.blockUtils.extractRowBounds(i,e);if(n)return n}return null}isPixelInRange(e){return e>=this.topPx&&e<this.topPx+this.heightPx}getRowIndexAtPixel(e){if(e<=this.topPx)return this.nodesAfterSort[0].rowIndex;if(e>=this.topPx+this.heightPx){const t=this.nodesAfterSort[this.nodesAfterSort.length-1],i=t.rowTop+t.rowHeight;if(e>=i&&t.expanded){if(t.childStore&&t.childStore.getRowCount()>0)return t.childStore.getRowIndexAtPixel(e);if(t.detailNode)return t.detailNode.rowIndex}return t.rowIndex}let t=null;return this.nodesAfterSort.forEach(i=>{const n=this.blockUtils.getIndexAtPixel(i,e);null!=n&&(t=n)}),null==t?this.displayIndexEnd-1:t}getChildStore(e){return this.storeUtils.getChildStore(e,this,e=>this.allRowNodes.find(t=>t.key==e))}forEachChildStoreShallow(e){this.allRowNodes.forEach(t=>{const i=t.childStore;i&&e(i)})}refreshAfterFilter(e){const t=this.storeUtils.isServerSideFilterOnServer(),i=this.storeUtils.isServerRefreshNeeded(this.parentRowNode,this.ssrmParams.rowGroupCols,e);if(!this.storeUtils.isServerSideOnlyRefreshFilteredGroups()||t&&i)return this.refreshStore(!0),void this.sortRowNodes();this.filterRowNodes(),this.sortRowNodes(),this.forEachChildStoreShallow(t=>t.refreshAfterFilter(e))}refreshAfterSort(e){const t=this.storeUtils.isServerSideSortOnServer(),i=this.storeUtils.isServerRefreshNeeded(this.parentRowNode,this.ssrmParams.rowGroupCols,e);if(this.storeUtils.isServerSideSortAllLevels()||t&&i)return this.refreshStore(!0),void this.filterRowNodes();this.filterRowNodes(),this.sortRowNodes(),this.forEachChildStoreShallow(t=>t.refreshAfterSort(e))}applyTransaction(e){switch(this.getState()){case Lg.RowNodeBlock.STATE_FAILED:return{status:Lg.ServerSideTransactionResultStatus.StoreLoadingFailed};case Lg.RowNodeBlock.STATE_LOADING:return{status:Lg.ServerSideTransactionResultStatus.StoreLoading};case Lg.RowNodeBlock.STATE_WAITING_TO_LOAD:return{status:Lg.ServerSideTransactionResultStatus.StoreWaitingToLoad}}const t=this.gos.getCallback("isApplyServerSideTransaction");if(t&&!t({transaction:e,parentNode:this.parentRowNode,groupLevelInfo:this.info}))return{status:Lg.ServerSideTransactionResultStatus.Cancelled};const i={status:Lg.ServerSideTransactionResultStatus.Applied,remove:[],update:[],add:[]},n=[];return this.executeAdd(e,i),this.executeRemove(e,i,n),this.executeUpdate(e,i,n),this.filterAndSortNodes(),this.updateSelection(n),i}updateSelection(e){if(e.length>0){this.selectionService.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,clearSelection:!1,source:"rowDataChanged"});const t={type:Lg.Events.EVENT_SELECTION_CHANGED,source:"rowDataChanged"};this.eventService.dispatchEvent(t)}}executeAdd(e,t){const{add:i,addIndex:n}=e;Lg._.missingOrEmpty(i)||("number"==typeof n&&n>=0?i.reverse().forEach(e=>{const i=this.createDataNode(e,n);t.add.push(i)}):i.forEach(e=>{const i=this.createDataNode(e);t.add.push(i)}))}executeRemove(e,t,i){const{remove:n}=e;if(null==n)return;const s={};n.forEach(e=>{const n=this.lookupRowNode(e);n&&(n.isSelected()&&i.push(n),n.clearRowTopAndRowIndex(),s[n.id]=!0,delete this.allNodesMap[n.id],t.remove.push(n),this.nodeManager.removeNode(n))}),this.allRowNodes=this.allRowNodes.filter(e=>!s[e.id])}executeUpdate(e,t,i){const{update:n}=e;null!=n&&n.forEach(e=>{const n=this.lookupRowNode(e);n&&(this.blockUtils.updateDataIntoRowNode(n,e),!n.selectable&&n.isSelected()&&i.push(n),t.update.push(n))})}lookupRowNode(e){const t=this.gos.getCallback("getRowId");let i;if(null!=t){const n=this.level,s=this.parentRowNode.getGroupKeys(),r=t({data:e,parentKeys:s.length>0?s:void 0,level:n});if(i=this.allNodesMap[r],!i)return console.error(`AG Grid: could not find row id=${r}, data item was not found for this id`),null}else if(i=this.allRowNodes.find(t=>t.data===e),!i)return console.error("AG Grid: could not find data item as object was not found",e),null;return i}addStoreStates(e){e.push({suppressInfiniteScroll:!0,route:this.parentRowNode.getGroupKeys(),rowCount:this.allRowNodes.length,info:this.info}),this.forEachChildStoreShallow(t=>t.addStoreStates(e))}refreshStore(e){if(e){const e=this.nodesAfterSort?this.nodesAfterSort.length:1;this.initialiseRowNodes(e)}this.scheduleLoad(),this.fireStoreUpdatedEvent()}retryLoads(){this.getState()===Lg.RowNodeBlock.STATE_FAILED&&(this.initialiseRowNodes(1),this.scheduleLoad()),this.forEachChildStoreShallow(e=>e.retryLoads())}scheduleLoad(){this.setStateWaitingToLoad(),this.rowNodeBlockLoader.checkBlockToLoad()}fireStoreUpdatedEvent(){const e={type:Lg.Events.EVENT_STORE_UPDATED};this.eventService.dispatchEvent(e)}getRowCount(){return this.nodesAfterSort.length}getTopLevelRowDisplayedIndex(e){return this.nodesAfterSort[e].rowIndex}isLastRowIndexKnown(){return this.getState()==Lg.RowNodeBlock.STATE_LOADED}getRowNodesInRange(e,t){const i=[];let n=!1;return Lg._.missing(e)&&(n=!0),this.nodesAfterSort.forEach(s=>{const r=s===e||s===t;(n||r)&&i.push(s),r&&(n=!n)}),n?[]:i}getStoreBounds(){return{topPx:this.topPx,heightPx:this.heightPx}}};lf([(0,Lg.Autowired)("ssrmStoreUtils")],cf.prototype,"storeUtils",2),lf([(0,Lg.Autowired)("ssrmBlockUtils")],cf.prototype,"blockUtils",2),lf([(0,Lg.Autowired)("columnModel")],cf.prototype,"columnModel",2),lf([(0,Lg.Autowired)("rowNodeBlockLoader")],cf.prototype,"rowNodeBlockLoader",2),lf([(0,Lg.Autowired)("rowNodeSorter")],cf.prototype,"rowNodeSorter",2),lf([(0,Lg.Autowired)("sortController")],cf.prototype,"sortController",2),lf([(0,Lg.Autowired)("selectionService")],cf.prototype,"selectionService",2),lf([(0,Lg.Autowired)("ssrmNodeManager")],cf.prototype,"nodeManager",2),lf([(0,Lg.Autowired)("filterManager")],cf.prototype,"filterManager",2),lf([(0,Lg.Autowired)("ssrmTransactionManager")],cf.prototype,"transactionManager",2),lf([(0,Lg.Autowired)("rowModel")],cf.prototype,"serverSideRowModel",2),lf([Lg.PostConstruct],cf.prototype,"postConstruct",1),lf([Lg.PreDestroy],cf.prototype,"destroyRowNodes",1);var hf=class{constructor(...e){if(e.length<1)throw new Error("AG Grid: At least one index must be provided.");this.indexes=e,this.maps=new Map(this.indexes.map(e=>[e,new Map]))}getSize(){return this.maps.get(this.indexes[0]).size}getBy(e,t){const i=this.maps.get(e);if(!i)throw new Error(`AG Grid: ${String(e)} not found`);return i.get(t)}set(e){this.indexes.forEach(t=>{const i=this.maps.get(t);if(!i)throw new Error(`AG Grid: ${String(t)} not found`);i.set(e[t],e)})}delete(e){this.indexes.forEach(t=>{const i=this.maps.get(t);if(!i)throw new Error(`AG Grid: ${String(t)} not found`);i.delete(e[t])})}clear(){this.maps.forEach(e=>e.clear())}getIterator(e){const t=this.maps.get(e);if(!t)throw new Error(`AG Grid: ${String(e)} not found`);return t.values()}forEach(e){const t=this.getIterator(this.indexes[0]);let i;for(;(i=t.next())&&!i.done;)e(i.value)}find(e){const t=this.getIterator(this.indexes[0]);let i;for(;(i=t.next())&&!i.done;)if(e(i.value))return i.value}filter(e){const t=this.getIterator(this.indexes[0]);let i;const n=[];for(;(i=t.next())&&!i.done;)e(i.value)&&n.push(i.value);return n}},uf=class extends Fg.BeanStub{constructor(){super(...arguments),this.cacheLoadingNodesMap=new Map,this.isCheckQueued=!1,this.nextBlockToLoad=void 0}init(){this.addManagedListener(this.rowNodeBlockLoader,Fg.RowNodeBlockLoader.BLOCK_LOADED_EVENT,()=>this.queueLoadCheck())}subscribe(e){this.cacheLoadingNodesMap.set(e,new Set)}unsubscribe(e){this.cacheLoadingNodesMap.delete(e)}queueLoadCheck(){this.isCheckQueued||(this.isCheckQueued=!0,window.queueMicrotask(()=>{this.queueLoadAction(),this.isCheckQueued=!1}))}queueLoadAction(){const e=this.getBlockToLoad();if(!e)return;const t=this.nextBlockToLoad&&this.nextBlockToLoad.cache===e.cache&&this.nextBlockToLoad.index===e.index;if(!(t||this.nextBlockToLoad&&t)){this.nextBlockToLoad=e,window.clearTimeout(this.loaderTimeout);const t=Number(this.nextBlockToLoad.index),i=this.nextBlockToLoad.cache,n=e.index+e.cache.getBlockSize();this.loaderTimeout=window.setTimeout(()=>{i.isAlive()&&(this.loaderTimeout=void 0,this.attemptLoad(i,t,n),this.nextBlockToLoad=void 0)},this.gos.get("blockLoadDebounceMillis"))}}attemptLoad(e,t,i){const n=this.rowNodeBlockLoader.getAvailableLoadingCount();null!=n&&0===n||(this.rowNodeBlockLoader.registerLoads(1),this.executeLoad(e,t,i),this.queueLoadCheck())}executeLoad(e,t,i){var n;const s=e.getSsrmParams(),r={startRow:t,endRow:i,rowGroupCols:s.rowGroupCols,valueCols:s.valueCols,pivotCols:s.pivotCols,pivotMode:s.pivotMode,groupKeys:e.store.getParentNode().getGroupKeys(),filterModel:s.filterModel,sortModel:s.sortModel},o=this.cacheLoadingNodesMap.get(e),a=()=>{for(let e=0;e<i-t;e++)o.delete(t+e)},l=this.gos.addGridCommonParams({request:r,success:n=>{this.rowNodeBlockLoader.loadComplete(),e.onLoadSuccess(t,i-t,n),a()},fail:()=>{this.rowNodeBlockLoader.loadComplete(),e.onLoadFailed(t,i-t),a()},parentNode:e.store.getParentNode()});(()=>{for(let e=0;e<i-t;e++)o.add(t+e)})(),null==(n=e.getSsrmParams().datasource)||n.getRows(l)}getBlockToLoad(){var e;const t=this.rowRenderer.getFirstVirtualRenderedRow(),i=this.rowRenderer.getLastVirtualRenderedRow();for(let e=t;e<=i;e++){const t=this.rowModel.getRow(e);if(!t)continue;const i=t.parent&&t.parent.childStore;if(!(i&&i instanceof pf))continue;const n=i.getCache(),s=n.getNodes().getBy("node",t);if(!s)continue;const r=this.cacheLoadingNodesMap.get(n);if(!(null==r?void 0:r.has(s.index))&&(t.__needsRefreshWhenVisible||t.stub&&!t.failedLoad))return{cache:n,index:n.getBlockStartIndex(s.index)}}let n=null,s=null,r=Number.MAX_SAFE_INTEGER;for(const e of this.cacheLoadingNodesMap.keys())e.getNodesToRefresh().forEach(o=>{if(null==o.rowIndex)return s=o,void(n=e);const a=e.getNodes().getBy("node",o);if(!a)return;const l=this.cacheLoadingNodesMap.get(e);if(null==l?void 0:l.has(a.index))return;const c=Math.abs(t-o.rowIndex),h=Math.abs(o.rowIndex-i);c<r&&(s=o,r=c,n=e),h<r&&(s=o,r=h,n=e)});if(!n)return;const o=n,a=null==(e=o.getNodes().getBy("node",s))?void 0:e.index;return null==a?void 0:{cache:o,index:o.getBlockStartIndex(a)}}isRowLoading(e,t){var i,n;return null!=(n=null==(i=this.cacheLoadingNodesMap.get(e))?void 0:i.has(t))&&n}};uf.DEFAULT_BLOCK_SIZE=100,lf([(0,Fg.Autowired)("rowNodeBlockLoader")],uf.prototype,"rowNodeBlockLoader",2),lf([(0,Fg.Autowired)("rowRenderer")],uf.prototype,"rowRenderer",2),lf([(0,Fg.Autowired)("rowModel")],uf.prototype,"rowModel",2),lf([Fg.PostConstruct],uf.prototype,"init",1),uf=lf([(0,Fg.Bean)("lazyBlockLoadingService")],uf);var df=class extends Og.BeanStub{constructor(e,t,i){super(),this.live=!0,this.removedNodeCache=new Map,this.store=e,this.numberOfRows=t,this.isLastRowKnown=!1,this.storeParams=i}init(){this.lazyBlockLoadingService.subscribe(this),this.nodeMap=new hf("index","id","node"),this.nodeDisplayIndexMap=new Map,this.nodesToRefresh=new Set,this.defaultNodeIdPrefix=this.blockUtils.createNodeIdPrefix(this.store.getParentNode()),this.getRowIdFunc=this.gos.getCallback("getRowId"),this.isMasterDetail=this.gos.get("masterDetail")}destroyRowNodes(){this.lazyBlockLoadingService.unsubscribe(this),this.numberOfRows=0,this.nodeMap.forEach(e=>this.blockUtils.destroyRowNode(e.node)),this.nodeMap.clear(),this.nodeDisplayIndexMap.clear(),this.nodesToRefresh.clear(),this.live=!1}getRowByDisplayIndex(e){var t,i,n,s;if(!this.store.isDisplayIndexInStore(e))return;const r=this.nodeDisplayIndexMap.get(e);if(r)return(r.stub||r.__needsRefreshWhenVisible)&&this.lazyBlockLoadingService.queueLoadCheck(),r;if(e===this.store.getDisplayIndexStart())return this.createStubNode(0,e);const o=this.nodeDisplayIndexMap.get(e-1);if(o){if(this.isMasterDetail&&o.master&&o.expanded)return o.detailNode;if(o.expanded&&(null==(t=o.childStore)?void 0:t.isDisplayIndexInStore(e)))return null==(i=o.childStore)?void 0:i.getRowUsingDisplayIndex(e);const n=this.nodeMap.getBy("node",o);return this.createStubNode(n.index+1,e)}const a=this.getSurroundingNodesByDisplayIndex(e);if(null==a){const t=this.store.getRowCount()-(this.store.getDisplayIndexEnd()-e);return this.createStubNode(t,e)}const{previousNode:l,nextNode:c}=a;if(l&&l.node.expanded&&(null==(n=l.node.childStore)?void 0:n.isDisplayIndexInStore(e)))return null==(s=l.node.childStore)?void 0:s.getRowUsingDisplayIndex(e);if(c){const t=c.node.rowIndex-e,i=c.index-t;return this.createStubNode(i,e)}const h=this.store.getRowCount()-(this.store.getDisplayIndexEnd()-e);return this.createStubNode(h,e)}createStubNode(e,t){const i=this.store.getRowBounds(t),n=this.createRowAtIndex(e,null,e=>{e.setRowIndex(t),e.setRowTop(i.rowTop),this.nodeDisplayIndexMap.set(t,e)});return this.lazyBlockLoadingService.queueLoadCheck(),n}getRowByStoreIndex(e){var t;return null==(t=this.nodeMap.getBy("index",e))?void 0:t.node}skipDisplayIndexes(e,t,i){if(0===e)return;const n=this.gos.getRowHeightAsNumber();t.skip(e),i.value+=e*n}setDisplayIndexes(e,t){this.nodeDisplayIndexMap.clear();const i={};this.nodeMap.forEach(e=>{i[e.index]=e.node});let n=-1;for(const s in i){const r=i[s],o=Number(s),a=o-1-n;this.skipDisplayIndexes(a,e,t),this.blockUtils.setDisplayIndex(r,e,t),this.nodeDisplayIndexMap.set(r.rowIndex,r),n=o}const s=this.numberOfRows-1-n;this.skipDisplayIndexes(s,e,t),this.purgeExcessRows()}getRowCount(){return this.numberOfRows}setRowCount(e,t){if(e<0)throw new Error("AG Grid: setRowCount can only accept a positive row count.");this.numberOfRows=e,null!=t&&(this.isLastRowKnown=t,!1===t&&(this.numberOfRows+=1)),this.fireStoreUpdatedEvent()}getNodes(){return this.nodeMap}getNodeCachedByDisplayIndex(e){var t;return null!=(t=this.nodeDisplayIndexMap.get(e))?t:null}getNodesToRefresh(){return this.nodesToRefresh}getSurroundingNodesByDisplayIndex(e){let t,i;return this.nodeMap.forEach(n=>{e>n.node.rowIndex?(null==i||i.node.rowIndex<n.node.rowIndex)&&(i=n):(null==t||t.node.rowIndex>n.node.rowIndex)&&(t=n)}),i||t?{previousNode:i,nextNode:t}:null}getDisplayIndexFromStoreIndex(e){var t,i;const n=this.nodeMap.getBy("index",e);if(n)return n.node.rowIndex;let s,r;if(this.nodeMap.forEach(t=>{e>t.index?(null==r||r.index<t.index)&&(r=t):(null==s||s.index>t.index)&&(s=t)}),!s)return this.store.getDisplayIndexEnd()-(this.numberOfRows-e);if(!r)return this.store.getDisplayIndexStart()+e;const o=e-r.index;return(null!=(i=null==(t=r.node.childStore)?void 0:t.getDisplayIndexEnd())?i:r.node.rowIndex)+o}createRowAtIndex(e,t,i){var n,s;const r=this.nodeMap.getBy("index",e);if(r){const{node:i}=r;if(i.__needsRefreshWhenVisible=!1,this.doesNodeMatch(t,i))return this.blockUtils.updateDataIntoRowNode(i,t),this.nodesToRefresh.delete(i),i;if(null==this.getRowIdFunc&&i.hasChildren()&&i.expanded)return this.nodesToRefresh.delete(i),i;this.destroyRowAtIndex(e)}if(t&&null!=this.getRowIdFunc){const i=this.getRowId(t),r=i&&(null==(n=this.removedNodeCache)?void 0:n.get(i));if(r)return null==(s=this.removedNodeCache)||s.delete(i),this.blockUtils.updateDataIntoRowNode(r,t),this.nodeMap.set({id:r.id,node:r,index:e}),r;const o=this.nodeMap.getBy("id",i);if(o){this.nodeMap.delete(o);const{node:i,index:n}=o;return this.blockUtils.updateDataIntoRowNode(i,t),this.nodeMap.set({id:i.id,node:i,index:e}),this.nodesToRefresh.delete(i),this.getBlockStartIndex(n)===this.getBlockStartIndex(e)||this.markBlockForVerify(n),i}}const o=this.blockUtils.createRowNode(this.store.getRowDetails());if(null!=t){const e=this.getPrefixedId(this.store.getIdSequence().next());this.blockUtils.setDataIntoRowNode(o,t,e,void 0),this.serverSideRowModel.setPaused(!0),this.blockUtils.checkOpenByDefault(o),this.serverSideRowModel.setPaused(!1),this.nodeManager.addRowNode(o)}return this.nodeMap.set({id:o.id,node:o,index:e}),i&&i(o),o}getBlockStates(){const e={},t={};this.nodeMap.forEach(({node:i,index:n})=>{var s;const r=this.getBlockStartIndex(n);i.stub||i.failedLoad||(e[r]=(null!=(s=e[r])?s:0)+1);let o="loaded";i.failedLoad?o="failed":this.lazyBlockLoadingService.isRowLoading(this,r)?o="loading":(this.nodesToRefresh.has(i)||i.stub)&&(o="needsLoading"),t[r]||(t[r]=new Set),t[r].add(o)});const i={loading:4,failed:3,needsLoading:2,loaded:1},n=this.blockUtils.createNodeIdPrefix(this.store.getParentNode()),s={};return Object.entries(t).forEach(([t,r])=>{var o;const a=[...r].sort((e,t)=>{var n,s;return(null!=(n=i[e])?n:0)-(null!=(s=i[t])?s:0)})[0],l=Number(t)/this.getBlockSize(),c=n?`${n}-${l}`:String(l);s[c]={blockNumber:l,startRow:Number(t),endRow:Number(t)+this.getBlockSize(),pageStatus:a,loadedRowCount:null!=(o=e[t])?o:0}}),s}destroyRowAtIndex(e){const t=this.nodeMap.getBy("index",e);t&&(this.nodeMap.delete(t),this.nodeDisplayIndexMap.delete(t.node.rowIndex),this.nodesToRefresh.size>0?this.removedNodeCache.set(t.node.id,t.node):this.blockUtils.destroyRowNode(t.node),this.nodesToRefresh.delete(t.node))}getSsrmParams(){return this.store.getSsrmParams()}getPrefixedId(e){return this.defaultNodeIdPrefix?this.defaultNodeIdPrefix+"-"+e:e.toString()}markBlockForVerify(e){const[t,i]=this.getBlockBounds(e);this.nodeMap.filter(e=>e.index>=t&&e.index<i).forEach(({node:e})=>{e.__needsRefreshWhenVisible=!0})}doesNodeMatch(e,t){if(t.stub)return!1;if(null!=this.getRowIdFunc){const i=this.getRowId(e);return t.id===i}return t.data===e}purgeStubsOutsideOfViewport(){const e=this.api.getFirstDisplayedRowIndex(),t=this.api.getLastDisplayedRowIndex(),i=this.getBlockStartIndex(e),[n,s]=this.getBlockBounds(t);this.nodeMap.forEach(e=>{this.lazyBlockLoadingService.isRowLoading(this,e.index)||e.node.failedLoad||e.node.stub&&(e.index<i||e.index>s)&&this.destroyRowAtIndex(e.index)})}getBlocksDistanceFromRow(e,t){const i={};return e.forEach(({node:e,index:n})=>{const[s,r]=this.getBlockBounds(n);if(s in i)return;const o=Math.abs(e.rowIndex-t);let a;const l=this.nodeMap.getBy("index",[r-1]);l&&(a=Math.abs(l.node.rowIndex-t));const c=null==a||o<a?o:a;i[s]=c}),Object.entries(i)}purgeExcessRows(){var e;if(this.purgeStubsOutsideOfViewport(),null==this.store.getDisplayIndexEnd()||null==this.storeParams.maxBlocksInCache)return;const t=this.api.getFirstDisplayedRowIndex(),i=this.api.getLastDisplayedRowIndex(),n=new Set,s=new Set;this.nodeMap.forEach(({index:e,node:r})=>{const o=this.getBlockStartIndex(e);n.add(o),r.rowIndex>=t&&r.rowIndex<=i&&s.add(o)});const r=Math.max(s.size,null!=(e=this.storeParams.maxBlocksInCache)?e:0),o=n.size-r;if(o<=0)return;let a=Number.MAX_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER;s.forEach(e=>{a>e&&(a=e),l<e&&(l=e)});const c=this.nodeMap.filter(({node:e,index:t})=>{const i=this.getBlockStartIndex(t);return!(i>=a&&i<=l||this.isNodeCached(e))});if(0===c.length)return;const h=t+(i-t)/2,u=this.getBlocksDistanceFromRow(c,h),d=this.getBlockSize();u.sort((e,t)=>Math.sign(t[1]-e[1]));for(let e=0;e<Math.min(o,u.length);e++){const t=Number(u[e][0]);for(let e=t;e<t+d;e++){const t=this.nodeMap.getBy("index",e);t&&!this.isNodeCached(t.node)&&this.destroyRowAtIndex(e)}}}isNodeFocused(e){const t=this.focusService.getFocusCellToUseAfterRefresh();return!!t&&(null==t.rowPinned&&t.rowIndex===e.rowIndex)}isNodeCached(e){return e.isExpandable()&&e.expanded||this.isNodeFocused(e)}extractDuplicateIds(e){if(null==this.getRowIdFunc)return[];const t=new Set,i=new Set;return e.forEach(e=>{const n=this.getRowId(e);t.has(n)?i.add(n):t.add(n)}),[...i]}onLoadSuccess(e,t,i){if(!this.live)return;const n=i.groupLevelInfo;if(this.store.setStoreInfo(n),null!=this.getRowIdFunc){const n=this.extractDuplicateIds(i.rowData);if(n.length>0){const i=n.join(", ");return console.warn(`AG Grid: Unable to display rows as duplicate row ids (${i}) were returned by the getRowId callback. Please modify the getRowId callback to provide unique ids.`),void this.onLoadFailed(e,t)}}i.pivotResultFields&&this.serverSideRowModel.generateSecondaryColumns(i.pivotResultFields);const s=this.nodesToRefresh.size>0;if(i.rowData.forEach((t,i)=>{var n;const s=e+i,r=this.nodeMap.getBy("index",s);if(!(null==(n=null==r?void 0:r.node)?void 0:n.stub))return r&&this.doesNodeMatch(t,r.node)?(this.blockUtils.updateDataIntoRowNode(r.node,t),this.nodesToRefresh.delete(r.node),void(r.node.__needsRefreshWhenVisible=!1)):void this.createRowAtIndex(s,t);this.createRowAtIndex(s,t)}),null!=i.rowCount&&-1!==i.rowCount)this.numberOfRows=i.rowCount,this.isLastRowKnown=!0;else if(t>i.rowData.length)this.numberOfRows=e+i.rowData.length,this.isLastRowKnown=!0;else if(!this.isLastRowKnown){const t=e+i.rowData.length+1;t>this.numberOfRows&&(this.numberOfRows=t)}this.isLastRowKnown&&this.nodeMap.filter(e=>e.index>=this.numberOfRows).forEach(e=>this.destroyRowAtIndex(e.index)),this.fireStoreUpdatedEvent();const r=0===this.nodesToRefresh.size;s&&r&&this.fireRefreshFinishedEvent()}fireRefreshFinishedEvent(){0===this.nodesToRefresh.size&&(this.removedNodeCache.forEach(e=>{this.blockUtils.destroyRowNode(e)}),this.removedNodeCache=new Map,this.store.fireRefreshFinishedEvent())}isStoreFullyLoaded(){const e=this.isLastRowKnown,t=this.nodeMap.getSize()===this.numberOfRows;if(!e||!t)return;if(this.nodesToRefresh.size>0)return;let i=-1;return null==this.nodeMap.find(e=>(i+=1,e.index!==i||!!e.node.__needsRefreshWhenVisible||!!e.node.stub))}isLastRowIndexKnown(){return this.isLastRowKnown}onLoadFailed(e,t){var i;if(!this.live)return;const n=this.nodesToRefresh.size>0;for(let n=e;n<e+t&&n<this.getRowCount();n++){let{node:e}=null!=(i=this.nodeMap.getBy("index",n))?i:{};e&&this.nodesToRefresh.delete(e),e&&e.stub||(e&&!e.stub&&this.destroyRowAtIndex(n),e=this.createRowAtIndex(n)),e.__needsRefreshWhenVisible=!1,e.failedLoad=!0}const s=0===this.nodesToRefresh.size;n&&s&&this.fireRefreshFinishedEvent(),this.fireStoreUpdatedEvent()}markNodesForRefresh(){this.nodeMap.forEach(e=>{e.node.stub&&!e.node.failedLoad||this.nodesToRefresh.add(e.node)}),this.lazyBlockLoadingService.queueLoadCheck(),this.isLastRowKnown&&0===this.numberOfRows&&(this.numberOfRows=1,this.isLastRowKnown=!1,this.fireStoreUpdatedEvent())}isNodeInCache(e){return!!this.nodeMap.getBy("id",e)}fireStoreUpdatedEvent(){this.live&&this.store.fireStoreUpdatedEvent()}getRowId(e){if(null==this.getRowIdFunc)return null;const{level:t}=this.store.getRowDetails(),i=this.store.getParentNode().getGroupKeys(),n=this.getRowIdFunc({data:e,parentKeys:i.length>0?i:void 0,level:t});return String(n)}getOrderedNodeMap(){const e={};return this.nodeMap.forEach(t=>e[t.index]=t),e}clearDisplayIndexes(){this.nodeDisplayIndexMap.clear()}clientSideSortRows(){const e=this.sortController.getSortOptions();if(!e.some(e=>null!=e.sort))return;const t=new Array(this.nodeMap.getSize());this.nodeMap.forEach(e=>t[e.index]=e.node),this.nodeMap.clear(),this.rowNodeSorter.doFullSort(t,e).forEach((e,t)=>{this.nodeMap.set({id:e.id,node:e,index:t})})}updateRowNodes(e){if(null==this.getRowIdFunc)throw new Error("AG Grid: Transactions can only be applied when row ids are supplied.");const t=[];return e.forEach(e=>{const i=this.getRowId(e),n=this.nodeMap.getBy("id",i);n&&(this.blockUtils.updateDataIntoRowNode(n.node,e),t.push(n.node))}),t}insertRowNodes(e,t){const i=this.store.getRowCount()-(this.store.getParentNode().sibling?1:0),n=null==t&&this.isLastRowKnown?i:t;if(null==n||i<n)return[];if(null==this.getRowIdFunc)throw new Error("AG Grid: Transactions can only be applied when row ids are supplied.");const s={};e.forEach(e=>{const t=this.getRowId(e);t&&this.isNodeInCache(t)||(s[t]=e)});const r=Object.values(s);let o=r.length;if(0===o)return[];const a=this.nodeMap.filter(e=>e.index>=n);return a.forEach(e=>this.nodeMap.delete(e)),a.forEach(e=>{this.nodeMap.set({node:e.node,index:e.index+o,id:e.id})}),this.numberOfRows+=o,r.map((e,t)=>this.createRowAtIndex(n+t,e))}removeRowNodes(e){if(null==this.getRowIdFunc)throw new Error("AG Grid: Transactions can only be applied when row ids are supplied.");const t=[],i=[];let n=0;const s=[...e],r=this.getOrderedNodeMap();let o=-1;for(let e in r){o+=1;const a=r[e],l=s.findIndex(e=>e===a.id);if(-1!==l){s.splice(l,1),this.destroyRowAtIndex(Number(e)),t.push(a.node),n+=1;continue}if(0===n)continue;const c=Number(e);o!==c&&i.push(a.node),this.nodeMap.delete(r[e]),this.nodeMap.set({id:a.id,node:a.node,index:c-n})}return this.numberOfRows-=this.isLastRowIndexKnown()?e.length:n,s.length>0&&i.length>0&&(i.forEach(e=>e.__needsRefreshWhenVisible=!0),this.lazyBlockLoadingService.queueLoadCheck()),t}getBlockSize(){return this.storeParams.cacheBlockSize||uf.DEFAULT_BLOCK_SIZE}getBlockStartIndex(e){return e-e%this.getBlockSize()}getBlockBounds(e){const t=this.getBlockStartIndex(e);return[t,t+this.getBlockSize()]}};lf([(0,Og.Autowired)("gridApi")],df.prototype,"api",2),lf([(0,Og.Autowired)("ssrmBlockUtils")],df.prototype,"blockUtils",2),lf([(0,Og.Autowired)("focusService")],df.prototype,"focusService",2),lf([(0,Og.Autowired)("ssrmNodeManager")],df.prototype,"nodeManager",2),lf([(0,Og.Autowired)("rowModel")],df.prototype,"serverSideRowModel",2),lf([(0,Og.Autowired)("rowNodeSorter")],df.prototype,"rowNodeSorter",2),lf([(0,Og.Autowired)("sortController")],df.prototype,"sortController",2),lf([(0,Og.Autowired)("lazyBlockLoadingService")],df.prototype,"lazyBlockLoadingService",2),lf([Og.PostConstruct],df.prototype,"init",1),lf([Og.PreDestroy],df.prototype,"destroyRowNodes",1);var pf=class extends Ng.BeanStub{constructor(e,t,i){super(),this.idSequence=new Ng.NumberSequence,this.ssrmParams=e,this.parentRowNode=i,this.storeParams=t,this.level=i.level+1,this.group=!!e.rowGroupCols&&this.level<e.rowGroupCols.length,this.leafGroup=!!e.rowGroupCols&&this.level===e.rowGroupCols.length-1,this.info={}}init(){var e;let t=1;if(0===this.level&&(t=null!=(e=this.storeUtils.getServerSideInitialRowCount())?e:1,this.eventService.dispatchEventOnce({type:Ng.Events.EVENT_ROW_COUNT_READY})),this.cache=this.createManagedBean(new df(this,t,this.storeParams)),!this.gos.get("treeData")&&this.group){const e=this.ssrmParams.rowGroupCols[this.level];this.groupField=e.field,this.rowGroupColumn=this.columnModel.getRowGroupColumns()[this.level]}}destroyRowNodes(){this.displayIndexStart=void 0,this.displayIndexEnd=void 0,this.destroyBean(this.cache)}applyRowData(e,t,i){this.cache.onLoadSuccess(t,i,e)}applyTransaction(e){var t,i,n;const s=this.gos.getCallback("getRowId");if(!s)return console.warn("AG Grid: getRowId callback must be implemented for transactions to work. Transaction was ignored."),{status:Ng.ServerSideTransactionResultStatus.Cancelled};const r=this.gos.getCallback("isApplyServerSideTransaction");if(r&&!r({transaction:e,parentNode:this.parentRowNode,groupLevelInfo:this.info}))return{status:Ng.ServerSideTransactionResultStatus.Cancelled};const o=this.cache.isStoreFullyLoaded();let a,l,c;if((null==(t=e.update)?void 0:t.length)&&(a=this.cache.updateRowNodes(e.update)),null==(i=e.add)?void 0:i.length){let t=e.addIndex;null!=t&&t<0&&(t=void 0),l=this.cache.insertRowNodes(e.add,t)}if(null==(n=e.remove)?void 0:n.length){const t=e.remove.map(e=>s({level:this.level,parentKeys:this.parentRowNode.getGroupKeys(),data:e})),i=[...new Set(t)];c=this.cache.removeRowNodes(i)}const h=this.gos.get("serverSideEnableClientSideSort"),u=(null==a?void 0:a.length)||(null==l?void 0:l.length);return o&&h&&u&&this.cache.clientSideSortRows(),this.updateSelectionAfterTransaction(a,c),{status:Ng.ServerSideTransactionResultStatus.Applied,update:a,add:l,remove:c}}updateSelectionAfterTransaction(e,t){const i=[];null==e||e.forEach(e=>{e.isSelected()&&!e.selectable&&i.push(e)}),null==t||t.forEach(e=>{e.isSelected()&&i.push(e)}),i.length&&this.selectionService.setNodesSelected({newValue:!1,clearSelection:!1,nodes:i,source:"rowDataChanged"})}clearDisplayIndexes(){this.displayIndexStart=void 0,this.displayIndexEnd=void 0,this.cache.getNodes().forEach(e=>this.blockUtils.clearDisplayIndex(e.node)),this.parentRowNode.sibling&&this.blockUtils.clearDisplayIndex(this.parentRowNode.sibling),this.cache.clearDisplayIndexes()}getDisplayIndexStart(){return this.displayIndexStart}getDisplayIndexEnd(){return this.displayIndexEnd}getRowCount(){return this.parentRowNode.sibling?this.cache.getRowCount()+1:this.cache.getRowCount()}setRowCount(e,t){this.cache.setRowCount(e,t)}isDisplayIndexInStore(e){return 0!==this.cache.getRowCount()&&this.displayIndexStart<=e&&e<this.getDisplayIndexEnd()}setDisplayIndexes(e,t){this.displayIndexStart=e.peek(),this.topPx=t.value;const i=this.parentRowNode.level>-1&&this.gos.getGroupTotalRowCallback()({node:this.parentRowNode});i||this.parentRowNode.destroyFooter(),"top"===i&&(this.parentRowNode.createFooter(),this.blockUtils.setDisplayIndex(this.parentRowNode.sibling,e,t)),this.cache.setDisplayIndexes(e,t),"bottom"===i&&(this.parentRowNode.createFooter(),this.blockUtils.setDisplayIndex(this.parentRowNode.sibling,e,t)),this.displayIndexEnd=e.peek(),this.heightPx=t.value-this.topPx}forEachStoreDeep(e,t=new Ng.NumberSequence){e(this,t.next()),this.cache.getNodes().forEach(i=>{const n=i.node.childStore;n&&n.forEachStoreDeep(e,t)})}forEachNodeDeep(e,t=new Ng.NumberSequence){this.cache.getNodes().forEach(i=>{e(i.node,t.next());const n=i.node.childStore;n&&n.forEachNodeDeep(e,t)})}forEachNodeDeepAfterFilterAndSort(e,t=new Ng.NumberSequence,i=!1){const n=this.parentRowNode.level>-1&&this.gos.getGroupTotalRowCallback()({node:this.parentRowNode});"top"===n&&e(this.parentRowNode.sibling,t.next());const s=this.cache.getOrderedNodeMap();for(let n in s){const r=s[n];e(r.node,t.next());const o=r.node.childStore;o&&o.forEachNodeDeepAfterFilterAndSort(e,t,i)}"bottom"===n&&e(this.parentRowNode.sibling,t.next())}retryLoads(){this.cache.getNodes().forEach(({node:e})=>{e.failedLoad&&(e.failedLoad=!1,e.__needsRefreshWhenVisible=!0,e.stub=!0)}),this.forEachChildStoreShallow(e=>e.retryLoads()),this.fireStoreUpdatedEvent()}getRowUsingDisplayIndex(e){return this.parentRowNode.sibling&&e===this.parentRowNode.sibling.rowIndex?this.parentRowNode.sibling:this.cache.getRowByDisplayIndex(e)}getRowBounds(e){var t;if(!this.isDisplayIndexInStore(e))return null;const i=this.cache.getNodeCachedByDisplayIndex(e);if(i){const t=this.blockUtils.extractRowBounds(i,e);if(t)return t}const{previousNode:n,nextNode:s}=null!=(t=this.cache.getSurroundingNodesByDisplayIndex(e))?t:{};if(n){const t=this.blockUtils.extractRowBounds(n.node,e);if(null!=t)return t}const r=this.gos.getRowHeightAsNumber();if(s){const t=(s.node.rowIndex-e)*r;return{rowTop:s.node.rowTop-t,rowHeight:r}}return{rowTop:this.topPx+this.heightPx-(this.getDisplayIndexEnd()-e)*r,rowHeight:r}}isPixelInRange(e){return e>=this.topPx&&e<this.topPx+this.heightPx}getRowIndexAtPixel(e){if(e<this.topPx)return this.getDisplayIndexStart();if(e>=this.topPx+this.heightPx)return this.getDisplayIndexEnd()-1;if(this.parentRowNode.sibling&&e>this.parentRowNode.sibling.rowTop&&e<this.parentRowNode.sibling.rowTop+this.parentRowNode.sibling.rowHeight)return this.parentRowNode.sibling.rowIndex;let t=Number.MAX_SAFE_INTEGER,i=null,n=Number.MAX_SAFE_INTEGER,s=null;if(this.cache.getNodes().forEach(({node:r})=>{const o=Math.abs(e-r.rowTop);r.rowTop<e?o<t&&(t=o,i=r):o<n&&(n=o,s=r)}),i){const t=this.blockUtils.getIndexAtPixel(i,e);if(null!=t)return t}const r=this.gos.getRowHeightAsNumber();if(s){const t=s.rowTop,i=Math.ceil((t-e)/r);return s.rowIndex-i}const o=this.topPx+this.heightPx,a=Math.floor((o-e)/r);return this.getDisplayIndexEnd()-a}getChildStore(e){return this.storeUtils.getChildStore(e,this,e=>{const t=this.cache.getNodes().find(t=>t.node.key==e);return t?t.node:null})}forEachChildStoreShallow(e){this.cache.getNodes().forEach(({node:t})=>{t.childStore&&e(t.childStore)})}refreshAfterSort(e){if(this.storeUtils.isServerSideSortAllLevels()||this.storeUtils.isServerRefreshNeeded(this.parentRowNode,this.ssrmParams.rowGroupCols,e)){const e=this.cache.isStoreFullyLoaded(),t=this.gos.get("serverSideEnableClientSideSort");if(!e||!t){const e=this.cache.getRowCount();return this.destroyBean(this.cache),void(this.cache=this.createManagedBean(new df(this,e,this.storeParams)))}this.cache.clientSideSortRows()}this.forEachChildStoreShallow(t=>t.refreshAfterSort(e))}refreshAfterFilter(e){!this.storeUtils.isServerSideOnlyRefreshFilteredGroups()||this.storeUtils.isServerRefreshNeeded(this.parentRowNode,this.ssrmParams.rowGroupCols,e)?this.refreshStore(!0):this.forEachChildStoreShallow(t=>t.refreshAfterFilter(e))}refreshStore(e){if(e)return this.destroyBean(this.cache),this.cache=this.createManagedBean(new df(this,1,this.storeParams)),void this.fireStoreUpdatedEvent();this.cache.markNodesForRefresh()}getTopLevelRowDisplayedIndex(e){const t=this.cache.getDisplayIndexFromStoreIndex(e);return null!=t?t:e}isLastRowIndexKnown(){return this.cache.isLastRowIndexKnown()}getRowNodesInRange(e,t){let i=!1;return Ng._.missing(e)&&!0,this.cache.getNodes().filter(({node:i})=>i.rowIndex>=e.rowIndex&&i.rowIndex<=t.rowIndex).map(({node:e})=>e)}addStoreStates(e){e.push({suppressInfiniteScroll:!1,route:this.parentRowNode.getGroupKeys(),rowCount:this.getRowCount(),lastRowIndexKnown:this.isLastRowIndexKnown(),info:this.info,maxBlocksInCache:this.storeParams.maxBlocksInCache,cacheBlockSize:this.storeParams.cacheBlockSize}),this.forEachChildStoreShallow(t=>t.addStoreStates(e))}getIdSequence(){return this.idSequence}getParentNode(){return this.parentRowNode}getRowDetails(){return{field:this.groupField,group:this.group,leafGroup:this.leafGroup,level:this.level,parent:this.parentRowNode,rowGroupColumn:this.rowGroupColumn}}getSsrmParams(){return this.ssrmParams}setStoreInfo(e){e&&Object.assign(this.info,e)}fireStoreUpdatedEvent(){const e={type:Ng.Events.EVENT_STORE_UPDATED};this.eventService.dispatchEvent(e)}fireRefreshFinishedEvent(){const e={type:Ng.Events.EVENT_STORE_REFRESHED,route:this.parentRowNode.getRoute()};this.eventService.dispatchEvent(e)}getBlockStates(){return this.cache.getBlockStates()}getStoreBounds(){return{topPx:this.topPx,heightPx:this.heightPx}}getCache(){return this.cache}};lf([(0,Ng.Autowired)("ssrmBlockUtils")],pf.prototype,"blockUtils",2),lf([(0,Ng.Autowired)("ssrmStoreUtils")],pf.prototype,"storeUtils",2),lf([(0,Ng.Autowired)("columnModel")],pf.prototype,"columnModel",2),lf([(0,Ng.Autowired)("selectionService")],pf.prototype,"selectionService",2),lf([Ng.PostConstruct],pf.prototype,"init",1),lf([Ng.PreDestroy],pf.prototype,"destroyRowNodes",1);var gf=class extends _g.BeanStub{constructor(){super(...arguments),this.onRowHeightChanged_debounced=_g._.debounce(this.onRowHeightChanged.bind(this),100),this.pauseStoreUpdateListening=!1,this.started=!1,this.managingPivotResultColumns=!1}ensureRowHeightsValid(){return!1}start(){this.started=!0,this.updateDatasource()}destroyDatasource(){this.datasource&&(this.datasource.destroy&&this.datasource.destroy(),this.rowRenderer.datasourceChanged(),this.datasource=void 0)}addEventListeners(){this.addManagedListener(this.eventService,_g.Events.EVENT_NEW_COLUMNS_LOADED,this.onColumnEverything.bind(this)),this.addManagedListener(this.eventService,_g.Events.EVENT_STORE_UPDATED,this.onStoreUpdated.bind(this));const e=this.resetRootStore.bind(this);this.addManagedListener(this.eventService,_g.Events.EVENT_COLUMN_VALUE_CHANGED,e),this.addManagedListener(this.eventService,_g.Events.EVENT_COLUMN_PIVOT_CHANGED,e),this.addManagedListener(this.eventService,_g.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,e),this.addManagedListener(this.eventService,_g.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,e),this.addManagedPropertyListeners(["masterDetail","treeData","removePivotHeaderRowWhenSingleValueColumn","suppressServerSideInfiniteScroll","cacheBlockSize"],e),this.addManagedPropertyListener("rowHeight",()=>this.resetRowHeights()),this.verifyProps(),this.addManagedPropertyListener("serverSideDatasource",()=>this.updateDatasource())}updateDatasource(){const e=this.gos.get("serverSideDatasource");e&&this.setDatasource(e)}verifyProps(){this.gos.exists("initialGroupOrderComparator")&&_g._.warnOnce("initialGroupOrderComparator cannot be used with Server Side Row Model."),this.gos.isRowSelection()&&!this.gos.exists("getRowId")&&_g._.warnOnce("getRowId callback must be provided for Server Side Row Model selection to work correctly.")}setDatasource(e){this.started&&(this.destroyDatasource(),this.datasource=e,this.resetRootStore())}applyRowData(e,t,i){const n=this.getRootStore();if(!n)return;const s=n.getChildStore(i);s&&(s instanceof pf?s.applyRowData(e,t,e.rowData.length):s instanceof cf&&s.processServerResult(e))}isLastRowIndexKnown(){const e=this.getRootStore();return!!e&&e.isLastRowIndexKnown()}onColumnEverything(){if(!this.storeParams)return void this.resetRootStore();const e=this.columnsToValueObjects(this.columnModel.getRowGroupColumns()),t=this.columnsToValueObjects(this.columnModel.getValueColumns()),i=this.columnsToValueObjects(this.columnModel.getPivotColumns()),n=e=>{const t={};e.oldCols.forEach(e=>t[e.id]=e);const i=e.newCols.every(e=>{const i=t[e.id];return i&&delete t[e.id],i&&i.field===e.field&&i.aggFunc===e.aggFunc}),n=!e.allowRemovedColumns&&!!Object.values(t).length;return i&&!n},s=!_g._.jsonEquals(this.storeParams.sortModel,this.sortController.getSortModel()),r=!n({oldCols:this.storeParams.rowGroupCols,newCols:e}),o=!n({oldCols:this.storeParams.pivotCols,newCols:i}),a=!!(null==e?void 0:e.length)&&!n({oldCols:this.storeParams.valueCols,newCols:t,allowRemovedColumns:!0});if(s||r||o||a)this.resetRootStore();else{const e=this.createStoreParams();this.storeParams.rowGroupCols=e.rowGroupCols,this.storeParams.pivotCols=e.pivotCols,this.storeParams.valueCols=e.valueCols}}destroyRootStore(){this.rootNode&&this.rootNode.childStore&&(this.rootNode.childStore=this.destroyBean(this.rootNode.childStore),this.nodeManager.clear())}refreshAfterSort(e,t){this.storeParams&&(this.storeParams.sortModel=e);const i=this.getRootStore();i&&(i.refreshAfterSort(t),this.onStoreUpdated())}generateSecondaryColumns(e){if(!this.pivotColDefService)return void _g.ModuleRegistry.__assertRegistered(_g.ModuleNames.RowGroupingModule,"pivotResultFields",this.context.getGridId());const t=this.pivotColDefService.createColDefsFromFields(e);this.managingPivotResultColumns=!0,this.columnModel.setSecondaryColumns(t,"rowModelUpdated")}resetRowHeights(){const e=this.resetRowHeightsForAllRowNodes(),t=this.gos.getRowHeightForNode(this.rootNode);if(this.rootNode.setRowHeight(t.height,t.estimated),this.rootNode.sibling){const e=this.gos.getRowHeightForNode(this.rootNode.sibling);this.rootNode.sibling.setRowHeight(e.height,e.estimated)}e&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let e=!1;return this.forEachNode(t=>{const i=this.gos.getRowHeightForNode(t);t.setRowHeight(i.height,i.estimated);const n=t.detailNode;if(n){const e=this.gos.getRowHeightForNode(n);n.setRowHeight(e.height,e.estimated)}if(t.sibling){const e=this.gos.getRowHeightForNode(t.sibling);n.setRowHeight(e.height,e.estimated)}e=!0}),e}resetRootStore(){this.destroyRootStore(),this.rootNode=new _g.RowNode(this.beans),this.rootNode.group=!0,this.rootNode.level=-1,this.datasource&&(this.storeParams=this.createStoreParams(),this.rootNode.childStore=this.createBean(this.storeFactory.createStore(this.storeParams,this.rootNode)),this.updateRowIndexesAndBounds()),this.managingPivotResultColumns&&(this.columnModel.setSecondaryColumns(null,"api"),this.managingPivotResultColumns=!1),this.dispatchModelUpdated(!0)}columnsToValueObjects(e){return e.map(e=>({id:e.getId(),aggFunc:e.getAggFunc(),displayName:this.columnModel.getDisplayNameForColumn(e,"model"),field:e.getColDef().field}))}createStoreParams(){const e=this.columnsToValueObjects(this.columnModel.getRowGroupColumns()),t=this.columnsToValueObjects(this.columnModel.getValueColumns()),i=this.columnsToValueObjects(this.columnModel.getPivotColumns()),n=this.gos.isGetRowHeightFunction();return{valueCols:t,rowGroupCols:e,pivotCols:i,pivotMode:this.columnModel.isPivotMode(),filterModel:this.filterManager.isAdvancedFilterEnabled()?this.filterManager.getAdvancedFilterModel():this.filterManager.getFilterModel(),sortModel:this.sortController.getSortModel(),datasource:this.datasource,lastAccessedSequence:new _g.NumberSequence,dynamicRowHeight:n}}getParams(){return this.storeParams}dispatchModelUpdated(e=!1){const t={type:_g.Events.EVENT_MODEL_UPDATED,animate:!e,keepRenderedRows:!e,newPage:!1,newData:!1};this.eventService.dispatchEvent(t)}onStoreUpdated(){this.pauseStoreUpdateListening||(this.updateRowIndexesAndBounds(),this.dispatchModelUpdated())}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}onRowHeightChanged(){this.updateRowIndexesAndBounds(),this.dispatchModelUpdated()}updateRowIndexesAndBounds(){const e=this.getRootStore();e&&e.setDisplayIndexes(new _g.NumberSequence,{value:0})}retryLoads(){const e=this.getRootStore();e&&(e.retryLoads(),this.onStoreUpdated())}getRow(e){const t=this.getRootStore();if(t)return t.getRowUsingDisplayIndex(e)}setPaused(e){this.pauseStoreUpdateListening=e}expandAll(e){this.pauseStoreUpdateListening=!0,this.forEachNode(t=>{t.stub||t.hasChildren()&&t.setExpanded(e)}),this.pauseStoreUpdateListening=!1,this.onStoreUpdated()}refreshAfterFilter(e,t){this.storeParams&&(this.storeParams.filterModel=e);const i=this.getRootStore();i&&(i.refreshAfterFilter(t),this.onStoreUpdated())}getRootStore(){if(this.rootNode&&this.rootNode.childStore)return this.rootNode.childStore}getRowCount(){const e=this.getRootStore();return e?e.getDisplayIndexEnd():0}getTopLevelRowCount(){const e=this.getRootStore();return e?e.getRowCount():1}getTopLevelRowDisplayedIndex(e){const t=this.getRootStore();return t?t.getTopLevelRowDisplayedIndex(e):e}getRowBounds(e){const t=this.getRootStore();return t?t.getRowBounds(e):{rowTop:0,rowHeight:this.gos.getRowHeightAsNumber()}}getBlockStates(){const e=this.getRootStore();if(!e)return;const t={};return e.forEachStoreDeep(e=>{if(e instanceof cf){const{id:i,state:n}=e.getBlockStateJson();t[i]=n}else{if(!(e instanceof pf))throw new Error("AG Grid: Unsupported store type");Object.entries(e.getBlockStates()).forEach(([e,i])=>{t[e]=i})}}),t}getRowIndexAtPixel(e){const t=this.getRootStore();return e<=0||!t?0:t.getRowIndexAtPixel(e)}isEmpty(){return!1}isRowsToRender(){return null!=this.getRootStore()&&this.getRowCount()>0}getType(){return"serverSide"}forEachNode(e){const t=this.getRootStore();t&&t.forEachNodeDeep(e)}forEachNodeAfterFilterAndSort(e,t=!1){const i=this.getRootStore();i&&i.forEachNodeDeepAfterFilterAndSort(e,void 0,t)}executeOnStore(e,t){if(!this.started)return!1;const i=this.getRootStore();if(!i)return!0;const n=i.getChildStore(e);return n&&t(n),!0}refreshStore(e={}){const t=e.route?e.route:[];this.executeOnStore(t,t=>t.refreshStore(1==e.purge))}getStoreState(){const e=[],t=this.getRootStore();return t&&t.addStoreStates(e),e}getNodesInRangeForSelection(e,t){if(!_g._.exists(e))return[];if(!t)return[e];const i=e.rowIndex,n=t.rowIndex;if(null===i||null===n)return[e];const s=[],[r,o]=[i,n].sort((e,t)=>e-t);return this.forEachNode(e=>{const t=e.rowIndex;null==t||e.stub||t>=r&&t<=o&&s.push(e)}),s.length!==o-r+1?[e]:s}getRowNode(e){let t;return this.forEachNode(i=>{i.id===e&&(t=i),i.detailNode&&i.detailNode.id===e&&(t=i.detailNode)}),t}isRowPresent(e){return!!this.getRowNode(e.id)}setRowCount(e,t){const i=this.getRootStore();if(i){if(i instanceof pf)return void i.setRowCount(e,t);console.error("AG Grid: Infinite scrolling must be enabled in order to set the row count.")}}};lf([(0,_g.Autowired)("columnModel")],gf.prototype,"columnModel",2),lf([(0,_g.Autowired)("filterManager")],gf.prototype,"filterManager",2),lf([(0,_g.Autowired)("sortController")],gf.prototype,"sortController",2),lf([(0,_g.Autowired)("rowRenderer")],gf.prototype,"rowRenderer",2),lf([(0,_g.Autowired)("ssrmNodeManager")],gf.prototype,"nodeManager",2),lf([(0,_g.Autowired)("ssrmStoreFactory")],gf.prototype,"storeFactory",2),lf([(0,_g.Autowired)("beans")],gf.prototype,"beans",2),lf([(0,_g.Optional)("pivotColDefService")],gf.prototype,"pivotColDefService",2),lf([_g.PreDestroy],gf.prototype,"destroyDatasource",1),lf([_g.PostConstruct],gf.prototype,"addEventListeners",1),lf([_g.PreDestroy],gf.prototype,"destroyRootStore",1),gf=lf([(0,_g.Bean)("rowModel")],gf);var ff=class extends Gg.BeanStub{loadFromDatasource(e){const{storeParams:t,parentBlock:i,parentNode:n}=e,s=n.getGroupKeys();if(!t.datasource)return;const r={startRow:e.startRow,endRow:e.endRow,rowGroupCols:t.rowGroupCols,valueCols:t.valueCols,pivotCols:t.pivotCols,pivotMode:t.pivotMode,groupKeys:s,filterModel:t.filterModel,sortModel:t.sortModel},o=this.gos.addGridCommonParams({success:e.success,fail:e.fail,request:r,parentNode:e.parentNode});window.setTimeout(()=>{t.datasource&&i.isAlive()?t.datasource.getRows(o):e.fail()},0)}getChildStore(e,t,i){if(Gg._.missingOrEmpty(e))return t;const n=i(e[0]);if(n){if(1===e.length&&!n.childStore){const e=this.serverSideRowModel.getParams();n.childStore=this.createBean(this.storeFactory.createStore(e,n))}const t=e.slice(1,e.length),i=n.childStore;return i?i.getChildStore(t):null}return null}isServerRefreshNeeded(e,t,i){if(i.valueColChanged||i.secondaryColChanged)return!0;const n=e.level+1;if(!(n<t.length))return!0;const s=t[n].id;return i.changedColumns.indexOf(s)>-1||this.columnModel.getAllGridColumns().filter(e=>e.getColDef().showRowGroup&&i.changedColumns.includes(e.getId())).map(e=>e.getColDef().showRowGroup).some(e=>!0===e||e===s)}getServerSideInitialRowCount(){return this.gos.get("serverSideInitialRowCount")}assertRowModelIsServerSide(e){return!!this.gos.isRowModelType("serverSide")||(Gg._.warnOnce(`The '${e}' property can only be used with the Server Side Row Model.`),!1)}assertNotTreeData(e){return!this.gos.get("treeData")||(Gg._.warnOnce(`The '${e}' property cannot be used while using tree data.`),!1)}isServerSideSortAllLevels(){return this.gos.get("serverSideSortAllLevels")&&this.assertRowModelIsServerSide("serverSideSortAllLevels")}isServerSideOnlyRefreshFilteredGroups(){return this.gos.get("serverSideOnlyRefreshFilteredGroups")&&this.assertRowModelIsServerSide("serverSideOnlyRefreshFilteredGroups")}isServerSideSortOnServer(){return this.gos.get("serverSideSortOnServer")&&this.assertRowModelIsServerSide("serverSideSortOnServer")&&this.assertNotTreeData("serverSideSortOnServer")}isServerSideFilterOnServer(){return this.gos.get("serverSideFilterOnServer")&&this.assertRowModelIsServerSide("serverSideFilterOnServer")&&this.assertNotTreeData("serverSideFilterOnServer")}};lf([(0,Gg.Autowired)("columnModel")],ff.prototype,"columnModel",2),lf([(0,Gg.Autowired)("rowModel")],ff.prototype,"serverSideRowModel",2),lf([(0,Gg.Autowired)("ssrmStoreFactory")],ff.prototype,"storeFactory",2),ff=lf([(0,Gg.Bean)("ssrmStoreUtils")],ff);var mf=class extends Bg.BeanStub{createRowNode(e){const t=new Bg.RowNode(this.beans),i=null!=e.rowHeight?e.rowHeight:this.gos.getRowHeightAsNumber();return t.setRowHeight(i),t.group=e.group,t.leafGroup=e.leafGroup,t.level=e.level,t.uiLevel=e.level,t.parent=e.parent,t.stub=!0,t.__needsRefreshWhenVisible=!1,t.group&&(t.expanded=!1,t.field=e.field,t.rowGroupColumn=e.rowGroupColumn),t}destroyRowNodes(e){e&&e.forEach(e=>this.destroyRowNode(e))}destroyRowNode(e,t=!1){e.childStore&&!t&&(this.destroyBean(e.childStore),e.childStore=null),e.sibling&&!e.footer&&this.destroyRowNode(e.sibling,!1),e.clearRowTopAndRowIndex(),null!=e.id&&this.nodeManager.removeNode(e)}setTreeGroupInfo(e){e.updateHasChildren();const t=this.gos.get("getServerSideGroupKey");e.hasChildren()&&null!=t&&(e.key=t(e.data)),e.hasChildren()||null==e.childStore||(this.destroyBean(e.childStore),e.childStore=null,e.expanded=!1)}setRowGroupInfo(e){e.key=this.valueService.getValue(e.rowGroupColumn,e),null!==e.key&&void 0!==e.key||Bg._.doOnce(()=>{console.warn("AG Grid: null and undefined values are not allowed for server side row model keys"),e.rowGroupColumn&&console.warn(`column = ${e.rowGroupColumn.getId()}`),console.warn("data is ",e.data)},"ServerSideBlock-CannotHaveNullOrUndefinedForKey"),this.beans.gos.getGroupTotalRowCallback()({node:e})&&(e.createFooter(),e.sibling&&(e.sibling.uiLevel=e.uiLevel+1))}setMasterDetailInfo(e){const t=this.gos.get("isRowMaster");e.master=null==t||t(e.data)}updateDataIntoRowNode(e,t){e.updateData(t),this.gos.get("treeData")?(this.setTreeGroupInfo(e),this.setChildCountIntoRowNode(e)):e.group?(this.setChildCountIntoRowNode(e),e.footer||(this.beans.gos.getGroupTotalRowCallback()({node:e})?e.sibling?e.sibling.updateData(t):e.createFooter():e.sibling&&e.destroyFooter())):this.gos.get("masterDetail")}setDataIntoRowNode(e,t,i,n){var s;e.stub=!1;const r=this.gos.get("treeData");Bg._.exists(t)?(e.setDataAndId(t,i),r?this.setTreeGroupInfo(e):e.group?this.setRowGroupInfo(e):this.gos.get("masterDetail")&&this.setMasterDetailInfo(e)):(e.setDataAndId(void 0,void 0),e.key=null),(r||e.group)&&(this.setGroupDataIntoRowNode(e),this.setChildCountIntoRowNode(e)),Bg._.exists(t)&&(e.setRowHeight(this.gos.getRowHeightForNode(e,!1,n).height),null==(s=e.sibling)||s.setRowHeight(this.gos.getRowHeightForNode(e.sibling,!1,n).height))}setChildCountIntoRowNode(e){const t=this.gos.get("getChildCount");t&&e.setAllChildrenCount(t(e.data))}setGroupDataIntoRowNode(e){const t=this.columnModel.getGroupDisplayColumns(),i=this.gos.get("treeData");t.forEach(t=>{if(null==e.groupData&&(e.groupData={}),i)e.groupData[t.getColId()]=e.key;else if(t.isRowGroupDisplayed(e.rowGroupColumn.getId())){const i=this.valueService.getValue(e.rowGroupColumn,e);e.groupData[t.getColId()]=i}})}clearDisplayIndex(e){e.clearRowTopAndRowIndex(),e.hasChildren()&&Bg._.exists(e.childStore)&&e.childStore.clearDisplayIndexes(),e.master&&e.detailNode&&e.detailNode.clearRowTopAndRowIndex()}setDisplayIndex(e,t,i){if(e.setRowIndex(t.next()),e.setRowTop(i.value),i.value+=e.rowHeight,!e.footer&&(e.master&&(e.expanded&&e.detailNode?(e.detailNode.setRowIndex(t.next()),e.detailNode.setRowTop(i.value),i.value+=e.detailNode.rowHeight):e.detailNode&&e.detailNode.clearRowTopAndRowIndex()),e.hasChildren()&&Bg._.exists(e.childStore))){const n=e.childStore;e.expanded?n.setDisplayIndexes(t,i):n.clearDisplayIndexes()}}binarySearchForDisplayIndex(e,t){let i=0,n=t.length-1;if(Bg._.missing(n)||Bg._.missing(i))console.warn(`AG Grid: error: topPointer = ${n}, bottomPointer = ${i}`);else for(;;){const s=Math.floor((i+n)/2),r=t[s];if(r.rowIndex===e)return r;const o=r.master&&r.expanded,a=r.detailNode;if(o&&a&&a.rowIndex===e)return r.detailNode;const l=r.childStore;if(r.expanded&&l&&l.isDisplayIndexInStore(e))return l.getRowUsingDisplayIndex(e);if(r.rowIndex<e)i=s+1;else{if(!(r.rowIndex>e))return void console.warn(`AG Grid: error: unable to locate rowIndex = ${e} in cache`);n=s-1}}}extractRowBounds(e,t){const i=e=>({rowHeight:e.rowHeight,rowTop:e.rowTop});if(e.rowIndex===t)return i(e);if(e.hasChildren()&&e.expanded&&Bg._.exists(e.childStore)){const i=e.childStore;if(i.isDisplayIndexInStore(t))return i.getRowBounds(t)}else if(e.master&&e.expanded&&Bg._.exists(e.detailNode)&&e.detailNode.rowIndex===t)return i(e.detailNode)}getIndexAtPixel(e,t){if(e.isPixelInRange(t))return e.rowIndex;const i=e.master&&e.expanded,n=e.detailNode;if(i&&n&&n.isPixelInRange(t))return e.detailNode.rowIndex;if(e.hasChildren()&&e.expanded&&Bg._.exists(e.childStore)){const i=e.childStore;if(i.isPixelInRange(t))return i.getRowIndexAtPixel(t)}return null}createNodeIdPrefix(e){const t=[];let i=e;for(;i&&i.level>=0;)""===i.key?t.push("ag-Grid-MissingKey"):t.push(i.key),i=i.parent;if(t.length>0)return t.reverse().join("-")}checkOpenByDefault(e){return this.expansionService.checkOpenByDefault(e)}};lf([(0,Bg.Autowired)("valueService")],mf.prototype,"valueService",2),lf([(0,Bg.Autowired)("columnModel")],mf.prototype,"columnModel",2),lf([(0,Bg.Autowired)("ssrmNodeManager")],mf.prototype,"nodeManager",2),lf([(0,Bg.Autowired)("beans")],mf.prototype,"beans",2),lf([(0,Bg.Autowired)("expansionService")],mf.prototype,"expansionService",2),mf=lf([(0,Bg.Bean)("ssrmBlockUtils")],mf);var yf=class{constructor(){this.rowNodes={}}addRowNode(e){const t=e.id;this.rowNodes[t]&&(console.warn(`AG Grid: Duplicate node id ${e.id}. Row ID's are provided via the getRowId() callback. Please modify the getRowId() callback code to provide unique row id values.`),console.warn("first instance",this.rowNodes[t].data),console.warn("second instance",e.data)),this.rowNodes[t]=e}removeNode(e){const t=e.id;this.rowNodes[t]&&(this.rowNodes[t]=void 0)}clear(){this.rowNodes={}}};lf([Vg.PreDestroy],yf.prototype,"clear",1),yf=lf([(0,Vg.Bean)("ssrmNodeManager")],yf);var vf=class extends Hg.BeanStub{constructor(){super(...arguments),this.asyncTransactions=[]}postConstruct(){this.gos.isRowModelType("serverSide")}applyTransactionAsync(e,t){null==this.asyncTransactionsTimeout&&this.scheduleExecuteAsync(),this.asyncTransactions.push({transaction:e,callback:t})}scheduleExecuteAsync(){const e=this.gos.getAsyncTransactionWaitMillis();this.asyncTransactionsTimeout=window.setTimeout(()=>{this.executeAsyncTransactions()},e)}executeAsyncTransactions(){if(!this.asyncTransactions)return;const e=[],t=[],i=[];let n=!1;if(this.asyncTransactions.forEach(s=>{let r;this.serverSideRowModel.executeOnStore(s.transaction.route,e=>{r=e.applyTransaction(s.transaction)})?null==r&&(r={status:Hg.ServerSideTransactionResultStatus.StoreNotFound}):r={status:Hg.ServerSideTransactionResultStatus.StoreNotStarted},t.push(r),r.status==Hg.ServerSideTransactionResultStatus.StoreLoading?i.push(s):(s.callback&&e.push(()=>s.callback(r)),r.status===Hg.ServerSideTransactionResultStatus.Applied&&(n=!0))}),e.length>0&&window.setTimeout(()=>{e.forEach(e=>e())},0),this.asyncTransactionsTimeout=void 0,this.asyncTransactions=i,n&&(this.valueCache.onDataChanged(),this.eventService.dispatchEvent({type:Hg.Events.EVENT_STORE_UPDATED})),t.length>0){const e={type:Hg.Events.EVENT_ASYNC_TRANSACTIONS_FLUSHED,results:t};this.eventService.dispatchEvent(e)}}flushAsyncTransactions(){null!=this.asyncTransactionsTimeout&&clearTimeout(this.asyncTransactionsTimeout),this.executeAsyncTransactions()}applyTransaction(e){let t;if(this.serverSideRowModel.executeOnStore(e.route,i=>{t=i.applyTransaction(e)})){if(t){if(this.valueCache.onDataChanged(),t.remove){const i=t.remove.map(e=>e.id);this.selectionService.deleteSelectionStateFromParent(e.route||[],i)}return this.eventService.dispatchEvent({type:Hg.Events.EVENT_STORE_UPDATED}),t}return{status:Hg.ServerSideTransactionResultStatus.StoreNotFound}}return{status:Hg.ServerSideTransactionResultStatus.StoreNotStarted}}};lf([(0,Hg.Autowired)("rowNodeBlockLoader")],vf.prototype,"rowNodeBlockLoader",2),lf([(0,Hg.Autowired)("valueCache")],vf.prototype,"valueCache",2),lf([(0,Hg.Autowired)("rowModel")],vf.prototype,"serverSideRowModel",2),lf([(0,Hg.Autowired)("rowRenderer")],vf.prototype,"rowRenderer",2),lf([(0,Hg.Autowired)("selectionService")],vf.prototype,"selectionService",2),lf([Hg.PostConstruct],vf.prototype,"postConstruct",1),vf=lf([(0,Hg.Bean)("ssrmTransactionManager")],vf);var bf=class extends Ug.BeanStub{postConstruct(){this.gos.isRowModelType("serverSide")&&this.addManagedListener(this.eventService,Ug.Events.EVENT_ROW_GROUP_OPENED,this.onRowGroupOpened.bind(this))}onRowGroupOpened(e){const t=e.node;if(t.expanded){if(t.master)this.createDetailNode(t);else if(Ug._.missing(t.childStore)){const e=this.serverSideRowModel.getParams();t.childStore=this.createBean(this.storeFactory.createStore(e,t))}}else this.gos.get("purgeClosedRowNodes")&&Ug._.exists(t.childStore)&&(t.childStore=this.destroyBean(t.childStore));const i={type:Ug.Events.EVENT_STORE_UPDATED};this.eventService.dispatchEvent(i)}createDetailNode(e){if(Ug._.exists(e.detailNode))return e.detailNode;const t=new Ug.RowNode(this.beans);t.detail=!0,t.selectable=!1,t.parent=e,Ug._.exists(e.id)&&(t.id="detail_"+e.id),t.data=e.data,t.level=e.level+1;const i=this.gos.getRowHeightForNode(t).height;return t.rowHeight=i||200,e.detailNode=t,t}};lf([(0,Ug.Autowired)("rowModel")],bf.prototype,"serverSideRowModel",2),lf([(0,Ug.Autowired)("ssrmStoreFactory")],bf.prototype,"storeFactory",2),lf([(0,Ug.Autowired)("beans")],bf.prototype,"beans",2),lf([Ug.PostConstruct],bf.prototype,"postConstruct",1),bf=lf([(0,Ug.Bean)("ssrmExpandListener")],bf);var Cf=class extends zg.BeanStub{postConstruct(){this.gos.isRowModelType("serverSide")&&this.addManagedListener(this.eventService,zg.Events.EVENT_SORT_CHANGED,this.onSortChanged.bind(this))}onSortChanged(){const e=this.serverSideRowModel.getParams();if(!e)return;const t=this.sortController.getSortModel(),i=e.sortModel,n=this.findChangedColumnsInSort(t,i),s={valueColChanged:this.listenerUtils.isSortingWithValueColumn(n),secondaryColChanged:this.listenerUtils.isSortingWithSecondaryColumn(n),changedColumns:n};this.serverSideRowModel.refreshAfterSort(t,s)}findChangedColumnsInSort(e,t){let i=[];return[e,t].forEach(e=>{if(e){const t=e.map(e=>e.colId);i=i.concat(t)}}),i.filter(i=>{const n=t.find(e=>e.colId===i),s=e.find(e=>e.colId===i);return((e,t)=>(e?e.sort:null)!==(t?t.sort:null))(n,s)||((i,n)=>(i?t.indexOf(i):-1)!==(n?e.indexOf(n):-1))(n,s)})}};lf([(0,zg.Autowired)("sortController")],Cf.prototype,"sortController",2),lf([(0,zg.Autowired)("rowModel")],Cf.prototype,"serverSideRowModel",2),lf([(0,zg.Autowired)("ssrmListenerUtils")],Cf.prototype,"listenerUtils",2),lf([zg.PostConstruct],Cf.prototype,"postConstruct",1),Cf=lf([(0,zg.Bean)("ssrmSortService")],Cf);var wf=class extends Wg.BeanStub{postConstruct(){this.gos.isRowModelType("serverSide")&&(this.addManagedListener(this.eventService,Wg.Events.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,()=>this.onFilterChanged(!0)),this.addManagedListener(this.eventService,Wg.Events.EVENT_FILTER_CHANGED,()=>this.onFilterChanged()))}onFilterChanged(e){const t=this.serverSideRowModel.getParams();if(!t)return;const i=t.filterModel;let n,s;if(this.filterManager.isAdvancedFilterEnabled()){n=this.filterManager.getAdvancedFilterModel();const t=e?Object.keys(null!=i?i:{}):this.getAdvancedFilterColumns(i),r=this.getAdvancedFilterColumns(n);t.forEach(e=>r.add(e)),s=Array.from(r)}else if(n=this.filterManager.getFilterModel(),e){const e=this.getAdvancedFilterColumns(i);Object.keys(n).forEach(t=>e.add(t)),s=Array.from(e)}else s=this.findChangedColumns(i,n);const r={valueColChanged:this.listenerUtils.isSortingWithValueColumn(s),secondaryColChanged:this.listenerUtils.isSortingWithSecondaryColumn(s),changedColumns:s};this.serverSideRowModel.refreshAfterFilter(n,r)}findChangedColumns(e,t){const i={};Object.keys(e).forEach(e=>i[e]=!0),Object.keys(t).forEach(e=>i[e]=!0);const n=[];return Object.keys(i).forEach(i=>{JSON.stringify(e[i])!=JSON.stringify(t[i])&&n.push(i)}),n}getAdvancedFilterColumns(e){const t=new Set;if(!e)return t;const i=e=>{"join"===e.filterType?e.conditions.forEach(e=>i(e)):t.add(e.colId)};return i(e),t}};lf([(0,Wg.Autowired)("rowModel")],wf.prototype,"serverSideRowModel",2),lf([(0,Wg.Autowired)("filterManager")],wf.prototype,"filterManager",2),lf([(0,Wg.Autowired)("ssrmListenerUtils")],wf.prototype,"listenerUtils",2),lf([Wg.PostConstruct],wf.prototype,"postConstruct",1),wf=lf([(0,Wg.Bean)("ssrmFilterListener")],wf);var Sf=class{createStore(e,t){const i=this.getStoreParams(e,t);return new(i.suppressInfiniteScroll?cf:pf)(e,i,t)}getStoreParams(e,t){const i=this.getLevelSpecificParams(t),n=this.isInfiniteScroll(i);return{suppressInfiniteScroll:!n,cacheBlockSize:this.getBlockSize(n,i),maxBlocksInCache:this.getMaxBlocksInCache(n,e,i)}}getMaxBlocksInCache(e,t,i){if(!e)return;const n=i&&null!=i.maxBlocksInCache?i.maxBlocksInCache:this.gos.get("maxBlocksInCache");if(null!=n&&n>=0){if(t.dynamicRowHeight){const e="Server Side Row Model does not support Dynamic Row Height and Cache Purging. Either a) remove getRowHeight() callback or b) remove maxBlocksInCache property. Purging has been disabled.";return void jg._.warnOnce(e)}if(this.columnModel.isAutoRowHeightActive()){const e="Server Side Row Model does not support Auto Row Height and Cache Purging. Either a) remove colDef.autoHeight or b) remove maxBlocksInCache property. Purging has been disabled.";return void jg._.warnOnce(e)}return n}}getBlockSize(e,t){if(!e)return;const i=t&&null!=t.cacheBlockSize?t.cacheBlockSize:this.gos.get("cacheBlockSize");return null!=i&&i>0?i:100}getLevelSpecificParams(e){const t=this.gos.getCallback("getServerSideGroupLevelParams");if(t)return t({level:e.level+1,parentRowNode:e.level>=0?e:void 0,rowGroupColumns:this.columnModel.getRowGroupColumns(),pivotColumns:this.columnModel.getPivotColumns(),pivotMode:this.columnModel.isPivotMode()})}isInfiniteScroll(e){return!(e&&null!=e.suppressInfiniteScroll?e.suppressInfiniteScroll:this.isSuppressServerSideInfiniteScroll())}isSuppressServerSideInfiniteScroll(){return this.gos.get("suppressServerSideInfiniteScroll")}};lf([(0,jg.Autowired)("gridOptionsService")],Sf.prototype,"gos",2),lf([(0,jg.Autowired)("columnModel")],Sf.prototype,"columnModel",2),Sf=lf([(0,jg.Bean)("ssrmStoreFactory")],Sf);var xf=class{isSortingWithValueColumn(e){const t=this.columnModel.getValueColumns().map(e=>e.getColId());for(let i=0;i<e.length;i++)if(t.indexOf(e[i])>-1)return!0;return!1}isSortingWithSecondaryColumn(e){if(!this.columnModel.getSecondaryColumns())return!1;const t=this.columnModel.getSecondaryColumns().map(e=>e.getColId());for(let i=0;i<e.length;i++)if(t.indexOf(e[i])>-1)return!0;return!1}};lf([(0,$g.Autowired)("columnModel")],xf.prototype,"columnModel",2),xf=lf([(0,$g.Bean)("ssrmListenerUtils")],xf);var Ef=class extends Yg.BeanStub{constructor(){super(...arguments),this.selectedState={selectAll:!1,toggledNodes:new Set},this.lastSelected=null,this.selectAllUsed=!1,this.selectedNodes={}}init(){this.rowSelection=this.gos.get("rowSelection"),this.addManagedPropertyListener("rowSelection",e=>{this.rowSelection=e.currentValue})}getSelectedState(){return{selectAll:this.selectedState.selectAll,toggledNodes:[...this.selectedState.toggledNodes]}}setSelectedState(e){const t={selectAll:!1,toggledNodes:new Set};"object"==typeof e?"selectAll"in e&&"boolean"==typeof e.selectAll?(t.selectAll=e.selectAll,"toggledNodes"in e&&Array.isArray(e.toggledNodes)?(e.toggledNodes.forEach(e=>{"string"==typeof e?t.toggledNodes.add(e):console.warn(`AG Grid: Provided ids must be of string type. Invalid id provided: ${e}`)}),this.selectedState=t):console.error("AG Grid: `toggledNodes` must be an array of string ids.")):console.error("AG Grid: Select all status should be of boolean type."):console.error("AG Grid: The provided selection state should be an object.")}deleteSelectionStateFromParent(e,t){if(0===this.selectedState.toggledNodes.size)return!1;let i=!1;return t.forEach(e=>{this.selectedState.toggledNodes.delete(e)&&(i=!0)}),i}setNodesSelected(e){if(0===e.nodes.length)return 0;const t=e.clearSelection&&e.newValue&&!e.rangeSelect;if("multiple"!==this.rowSelection||t){if(e.nodes.length>1)throw new Error("AG Grid: cannot select multiple rows when rowSelection is set to 'single'");const t=e.nodes[0];return e.newValue?(this.selectedNodes={[t.id]:t},this.selectedState={selectAll:!1,toggledNodes:new Set([t.id])}):(this.selectedNodes={},this.selectedState={selectAll:!1,toggledNodes:new Set}),this.lastSelected=t.id,1}const i=t=>{e.newValue?this.selectedNodes[t.id]=t:delete this.selectedNodes[t.id];const i=t.selectable;e.newValue!==this.selectedState.selectAll&&i?this.selectedState.toggledNodes.add(t.id):this.selectedState.toggledNodes.delete(t.id)};if(e.rangeSelect&&this.lastSelected){if(e.nodes.length>1)throw new Error("AG Grid: cannot select multiple rows when using rangeSelect");const t=e.nodes[0],n=this.rowModel.getRowNode(this.lastSelected);return this.rowModel.getNodesInRangeForSelection(t,null!=n?n:null).forEach(i),this.lastSelected=t.id,1}return e.nodes.forEach(i),this.lastSelected=e.nodes[e.nodes.length-1].id,1}processNewRow(e){this.selectedNodes[e.id]&&(this.selectedNodes[e.id]=e)}isNodeSelected(e){const t=this.selectedState.toggledNodes.has(e.id);return this.selectedState.selectAll?!t:t}getSelectedNodes(){return this.selectAllUsed&&console.warn("AG Grid: getSelectedNodes and getSelectedRows functions cannot be used with select all functionality with the server-side row model.\n                Use `api.getServerSideSelectionState()` instead."),Object.values(this.selectedNodes)}getSelectedRows(){return this.getSelectedNodes().map(e=>e.data)}getSelectionCount(){return this.selectedState.selectAll?-1:this.selectedState.toggledNodes.size}clearOtherNodes(e,t){const i=this.selectedState.selectAll?1:this.selectedState.toggledNodes.size-1;this.selectedState={selectAll:!1,toggledNodes:new Set([e.id])},this.rowModel.forEachNode(i=>{i!==e&&i.selectThisNode(!1,void 0,t)});const n={type:Yg.Events.EVENT_SELECTION_CHANGED,source:t};return this.eventService.dispatchEvent(n),i}isEmpty(){var e;return!this.selectedState.selectAll&&!(null==(e=this.selectedState.toggledNodes)?void 0:e.size)}selectAllRowNodes(e){this.selectedState={selectAll:!0,toggledNodes:new Set},this.selectedNodes={},this.selectAllUsed=!0}deselectAllRowNodes(e){this.selectedState={selectAll:!1,toggledNodes:new Set},this.selectedNodes={}}getSelectAllState(e,t){return this.selectedState.selectAll?!(this.selectedState.toggledNodes.size>0)||null:this.selectedState.toggledNodes.size>0&&null}};lf([(0,Yg.Autowired)("rowModel")],Ef.prototype,"rowModel",2),lf([Yg.PostConstruct],Ef.prototype,"init",1);var Af=class extends qg.BeanStub{constructor(){super(...arguments),this.selectedState={selectAllChildren:!1,toggledNodes:new Map},this.lastSelected=null}init(){this.addManagedListener(this.eventService,qg.Events.EVENT_MODEL_UPDATED,()=>this.removeRedundantState()),this.addManagedListener(this.eventService,qg.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.selectionService.reset("rowGroupChanged"))}getSelectedState(){const e=this.gos.get("treeData"),t=(i,n,s)=>{const r={nodeId:s};if((e||n<=this.columnModel.getRowGroupColumns().length)&&(r.selectAllChildren=i.selectAllChildren),i.toggledNodes.size){const e=[];i.toggledNodes.forEach((i,s)=>{const r=t(i,n+1,s);e.push(r)}),r.toggledNodes=e}return r};return t(this.selectedState,0)}setSelectedState(e){const t=(e,i)=>{var n,s;if("object"!=typeof e)throw new Error("AG Grid: Each provided state object must be an object.");if("selectAllChildren"in e&&"boolean"!=typeof e.selectAllChildren)throw new Error("AG Grid: `selectAllChildren` must be a boolean value or undefined.");if("toggledNodes"in e){if(!Array.isArray(e.toggledNodes))throw new Error("AG Grid: `toggledNodes` must be an array.");if(!e.toggledNodes.every(e=>"object"==typeof e&&"nodeId"in e&&"string"==typeof e.nodeId))throw new Error("AG Grid: Every `toggledNode` requires an associated string id.")}const r=null!=(n=e.selectAllChildren)?n:!i,o=null==(s=e.toggledNodes)?void 0:s.map(e=>[e.nodeId,t(e,r)]);if(null==o?void 0:o.some(([e,t])=>r===t.selectAllChildren&&0===t.toggledNodes.size))throw new Error("\n                    AG Grid: AG Grid: Row selection state could not be parsed due to invalid data. Ensure all child state has toggledNodes or does not conform with the parent rule.\n                    Please rebuild the selection state and reapply it.\n                ");return{selectAllChildren:r,toggledNodes:new Map(o)}};try{this.selectedState=t(e,!!e.selectAllChildren)}catch(e){console.error(e.message)}}deleteSelectionStateFromParent(e,t){let i=this.selectedState;const n=[...e];for(;i&&n.length;)i=i.toggledNodes.get(n.pop());if(!i)return!1;let s=!1;return t.forEach(e=>{(null==i?void 0:i.toggledNodes.delete(e))&&(s=!0)}),s&&this.removeRedundantState(),s}setNodesSelected(e){const t=e,{nodes:i}=t,n=af(t,["nodes"]);if(0===i.length)return 0;if(e.rangeSelect){if(i.length>1)throw new Error("AG Grid: cannot select multiple rows when using rangeSelect");const e=i[0],t=this.rowModel.getNodesInRangeForSelection(e,this.lastSelected).map(this.getRouteToNode).sort((e,t)=>t.length-e.length),s=new Set;return t.forEach(t=>{s.has(t[t.length-1])||(t.forEach(e=>s.add(e)),this.recursivelySelectNode(t,this.selectedState,of({node:e},n)))}),this.removeRedundantState(),this.lastSelected=e,1}return e.nodes.forEach(e=>{const t=this.getRouteToNode(e);var i;this.recursivelySelectNode(t,this.selectedState,(i=of({},n),Qg(i,ef({node:e}))))}),this.removeRedundantState(),this.lastSelected=e.nodes[e.nodes.length-1],1}isNodeSelected(e){const t=this.getRouteToNode(e);return this.isNodePathSelected(t,this.selectedState)}isNodePathSelected([e,...t],i){if(0===t.length){const t=i.toggledNodes.has(e.id);if(e.hasChildren()){const t=i.toggledNodes.get(e.id);if(t&&t.toggledNodes.size)return}return i.selectAllChildren?!t:t}if(i.toggledNodes.has(e.id)){const n=i.toggledNodes.get(e.id);if(n)return this.isNodePathSelected(t,n)}return!!i.selectAllChildren}getRouteToNode(e){const t=[];let i=e;for(;i.parent;)t.push(i),i=i.parent;return t.reverse()}removeRedundantState(){if(this.filterManager.isAnyFilterPresent())return;const e=(t=this.selectedState,i,n)=>{if(t.toggledNodes.forEach((i,n)=>{e(i,n,t)}),i){const e=this.rowModel.getRowNode(i),n=null==e?void 0:e.childStore;if((null==n?void 0:n.isLastRowIndexKnown())&&t.toggledNodes.size>=n.getRowCount()){for(const e of t.toggledNodes.entries()){const[t,i]=e;if(i.toggledNodes.size>0)return;if(!this.rowModel.getRowNode(t))return}t.selectAllChildren=!t.selectAllChildren,t.toggledNodes.clear()}}const s=0===t.toggledNodes.size,r=(null==n?void 0:n.selectAllChildren)===t.selectAllChildren;s&&r&&(null==n||n.toggledNodes.delete(i))};e()}recursivelySelectNode([e,...t],i,n){if(!e)return;if(!t.length){const t=e.selectable;if(i.selectAllChildren===n.newValue||!t)return void i.toggledNodes.delete(e.id);const s={selectAllChildren:n.newValue,toggledNodes:new Map};return void i.toggledNodes.set(e.id,s)}const s=i.toggledNodes.has(e.id),r=s?i.toggledNodes.get(e.id):{selectAllChildren:i.selectAllChildren,toggledNodes:new Map};s||i.toggledNodes.set(e.id,r),this.recursivelySelectNode(t,r,n),i.selectAllChildren===r.selectAllChildren&&0===r.toggledNodes.size&&i.toggledNodes.delete(e.id)}getSelectedNodes(){console.warn("AG Grid: `getSelectedNodes` and `getSelectedRows` functions cannot be used with `groupSelectsChildren` and the server-side row model.\n            Use `api.getServerSideSelectionState()` instead.");const e=[];return this.rowModel.forEachNode(t=>{t.isSelected()&&e.push(t)}),e}processNewRow(e){}getSelectedRows(){return this.getSelectedNodes().map(e=>e.data)}getSelectionCount(){return-1}isEmpty(){var e;return!this.selectedState.selectAllChildren&&!(null==(e=this.selectedState.toggledNodes)?void 0:e.size)}selectAllRowNodes(e){this.selectedState={selectAllChildren:!0,toggledNodes:new Map}}deselectAllRowNodes(e){this.selectedState={selectAllChildren:!1,toggledNodes:new Map}}getSelectAllState(e,t){return this.selectedState.selectAllChildren?!(this.selectedState.toggledNodes.size>0)||null:this.selectedState.toggledNodes.size>0&&null}};lf([(0,qg.Autowired)("rowModel")],Af.prototype,"rowModel",2),lf([(0,qg.Autowired)("columnModel")],Af.prototype,"columnModel",2),lf([(0,qg.Autowired)("filterManager")],Af.prototype,"filterManager",2),lf([(0,qg.Autowired)("rowModel")],Af.prototype,"serverSideRowModel",2),lf([(0,qg.Autowired)("selectionService")],Af.prototype,"selectionService",2),lf([qg.PostConstruct],Af.prototype,"init",1);var Mf=class extends Kg.BeanStub{init(){const e=this.gos.get("groupSelectsChildren");this.addManagedPropertyListener("groupSelectsChildren",e=>{this.destroyBean(this.selectionStrategy);const t=e.currentValue?Af:Ef;this.selectionStrategy=this.createManagedBean(new t),this.shotgunResetNodeSelectionState();const i={type:Kg.Events.EVENT_SELECTION_CHANGED,source:"api"};this.eventService.dispatchEvent(i)}),this.addManagedPropertyListener("rowSelection",()=>this.deselectAllRowNodes({source:"api"}));const t=e?Af:Ef;this.selectionStrategy=this.createManagedBean(new t)}getSelectionState(){return this.selectionStrategy.getSelectedState()}setSelectionState(e,t){if(Array.isArray(e))return;this.selectionStrategy.setSelectedState(e),this.shotgunResetNodeSelectionState();const i={type:Kg.Events.EVENT_SELECTION_CHANGED,source:t};this.eventService.dispatchEvent(i)}setNodesSelected(e){const t=e,{nodes:i}=t,n=af(t,["nodes"]),s=this.gos.get("rowSelection");if(i.length>1&&"multiple"!==s)return console.warn("AG Grid: cannot multi select while rowSelection='single'"),0;if(i.length>1&&e.rangeSelect)return console.warn("AG Grid: cannot use range selection when multi selecting rows"),0;const r=of({nodes:i.filter(e=>e.selectable)},n);if(!r.nodes.length)return 0;const o=this.selectionStrategy.setNodesSelected(r);this.shotgunResetNodeSelectionState(r.source);const a={type:Kg.Events.EVENT_SELECTION_CHANGED,source:r.source};return this.eventService.dispatchEvent(a),o}deleteSelectionStateFromParent(e,t){if(!this.selectionStrategy.deleteSelectionStateFromParent(e,t))return;this.shotgunResetNodeSelectionState();const i={type:Kg.Events.EVENT_SELECTION_CHANGED,source:"api"};this.eventService.dispatchEvent(i)}shotgunResetNodeSelectionState(e){this.rowModel.forEachNode(t=>{if(t.stub)return;const i=this.selectionStrategy.isNodeSelected(t);i!==t.isSelected()&&t.selectThisNode(i,void 0,e)})}getSelectedNodes(){return this.selectionStrategy.getSelectedNodes()}getSelectedRows(){return this.selectionStrategy.getSelectedRows()}getSelectionCount(){return this.selectionStrategy.getSelectionCount()}syncInRowNode(e,t){this.selectionStrategy.processNewRow(e);const i=this.selectionStrategy.isNodeSelected(e);if(0!=i&&!e.selectable){this.selectionStrategy.setNodesSelected({nodes:[e],newValue:!1,source:"api"}),this.shotgunResetNodeSelectionState();const t={type:Kg.Events.EVENT_SELECTION_CHANGED,source:"api"};return void this.eventService.dispatchEvent(t)}e.setSelectedInitialValue(i)}reset(){this.selectionStrategy.deselectAllRowNodes({source:"api"})}isEmpty(){return this.selectionStrategy.isEmpty()}hasNodesToSelect(e=!1,t=!1){return!0}selectAllRowNodes(e){(e.justCurrentPage||e.justFiltered)&&console.warn("AG Grid: selecting just filtered only works when gridOptions.rowModelType='clientSide'"),this.selectionStrategy.selectAllRowNodes(e),this.rowModel.forEachNode(t=>{t.stub||t.selectThisNode(!0,void 0,e.source)});const t={type:Kg.Events.EVENT_SELECTION_CHANGED,source:e.source};this.eventService.dispatchEvent(t)}deselectAllRowNodes(e){(e.justCurrentPage||e.justFiltered)&&console.warn("AG Grid: selecting just filtered only works when gridOptions.rowModelType='clientSide'"),this.selectionStrategy.deselectAllRowNodes(e),this.rowModel.forEachNode(t=>{t.stub||t.selectThisNode(!1,void 0,e.source)});const t={type:Kg.Events.EVENT_SELECTION_CHANGED,source:e.source};this.eventService.dispatchEvent(t)}getSelectAllState(e,t){return this.selectionStrategy.getSelectAllState(e,t)}updateGroupsFromChildrenSelections(e,t){return!1}getBestCostNodeSelection(){console.warn("AG Grid: calling gridApi.getBestCostNodeSelection() is only possible when using rowModelType=`clientSide`.")}filterFromSelection(){}};lf([(0,Kg.Autowired)("rowModel")],Mf.prototype,"rowModel",2),lf([Kg.PostConstruct],Mf.prototype,"init",1),Mf=lf([(0,Kg.Bean)("selectionService")],Mf);var Tf=class extends Xg.ExpansionService{constructor(){super(...arguments),this.queuedRowIds=new Set}postConstruct(){super.postConstruct(),this.addManagedListener(this.eventService,Xg.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>{this.queuedRowIds.clear()})}checkOpenByDefault(e){if(!e.isExpandable())return;if(this.queuedRowIds.has(e.id))return this.queuedRowIds.delete(e.id),void e.setExpanded(!0);const t=this.gos.getCallback("isServerSideGroupOpenByDefault");t&&t({data:e.data,rowNode:e})&&e.setExpanded(!0)}expandRows(e){e.forEach(e=>{const t=this.serverSideRowModel.getRowNode(e);t?t.setExpanded(!0):this.queuedRowIds.add(e)})}expandAll(e){this.serverSideRowModel.expandAll(e)}onGroupExpandedOrCollapsed(){}};lf([(0,Xg.Autowired)("rowModel")],Tf.prototype,"serverSideRowModel",2),Tf=lf([(0,Xg.Bean)("expansionService")],Tf);var Df={version:"31.3.4",moduleName:Pg.ModuleNames.ServerSideRowModelModule,rowModel:"serverSide",beans:[gf,bf,Cf,ff,mf,yf,vf,wf,Sf,xf,Mf,Tf,uf],dependantModules:[D]},If=i(98092),Rf=i(98092),kf=i(98092),Pf=i(98092),_f=i(98092),Lf=i(98092),Nf=i(98092),Of=Object.defineProperty,Ff=Object.getOwnPropertyDescriptor,Gf=(e,t,i,n)=>{for(var s,r=n>1?void 0:n?Ff(t,i):t,o=e.length-1;o>=0;o--)(s=e[o])&&(r=(n?s(t,i,r):s(r))||r);return n&&r&&Of(t,i,r),r},Bf=class{constructor(e,t,i,n,s,r,o,a,l,c,h){this.rowModel=e,this.filterParams=t,this.createKey=i,this.caseFormat=n,this.columnModel=s,this.valueService=r,this.treeDataOrGrouping=o,this.treeData=a,this.getDataPath=l,this.groupAllowUnbalanced=c,this.addManagedListener=h}extractUniqueValuesAsync(e,t){return new Pf.AgPromise(i=>{if(this.rowModel.isRowDataLoaded())i(this.extractUniqueValues(e,t));else{const n=this.addManagedListener(Pf.Events.EVENT_ROW_COUNT_READY,()=>{null==n||n(),i(this.extractUniqueValues(e,t))})}})}extractUniqueValues(e,t){const i=new Map,n=this.extractExistingFormattedKeys(t),s=new Set,r=this.treeData&&!!this.getDataPath,o=this.columnModel.getRowGroupColumns(),a=(e,r)=>{const o=this.caseFormat(e);if(!s.has(o)){s.add(o);let a=e,l=Pf._.makeNull(r);const c=null==n?void 0:n.get(o);null!=c&&(a=c,l=t.get(c)),i.set(a,l)}};return this.rowModel.forEachLeafNode(t=>{if(!t.data||!e(t))return;if(this.treeDataOrGrouping)return void this.addValueForTreeDataOrGrouping(t,r,o,a);let i=this.getValue(t);this.filterParams.convertValuesToStrings?this.addValueForConvertValuesToString(t,i,a):null!=i&&Array.isArray(i)?(i.forEach(e=>{a(this.createKey(e,t),e)}),0===i.length&&a(null,null)):a(this.createKey(i,t),i)}),i}addValueForConvertValuesToString(e,t,i){const n=this.createKey(t,e);null!=n&&Array.isArray(n)?(n.forEach(e=>{const t=Pf._.toStringOrNull(Pf._.makeNull(e));i(t,t)}),0===n.length&&i(null,null)):i(n,n)}addValueForTreeDataOrGrouping(e,t,i,n){var s;let r;if(t){if(null==(s=e.childrenAfterGroup)?void 0:s.length)return;r=this.getDataPath(e.data)}else r=i.map(t=>this.valueService.getKeyForNode(t,e)),r.push(this.getValue(e));r&&(r=r.map(e=>Pf._.toStringOrNull(Pf._.makeNull(e)))),!t&&this.groupAllowUnbalanced&&(null==r?void 0:r.some(e=>null==e))&&(r=r.filter(e=>null!=e)),n(this.createKey(r),r)}getValue(e){return this.filterParams.getValue(e)}extractExistingFormattedKeys(e){if(!e)return null;const t=new Map;return e.forEach((e,i)=>{t.set(this.caseFormat(i),i)}),t}},Vf=class{};Vf.SELECT_ALL="__AG_SELECT_ALL__",Vf.ADD_SELECTION_TO_FILTER="__AG_ADD_SELECTION_TO_FILTER__";var Hf=class{constructor(e,t,i,n){this.valueService=e,this.valueFormatter=t,this.formatter=i,this.column=n,this.displayedKeys=[]}updateDisplayedValuesToAllAvailable(e,t,i){this.displayedKeys=Array.from(i)}updateDisplayedValuesToMatchMiniFilter(e,t,i,n,s){this.displayedKeys=[];for(let t of i)if(null==t)s&&this.displayedKeys.push(t);else{const i=e(t),s=this.valueService.formatValue(this.column,null,i,this.valueFormatter,!1);n(this.formatter(s))&&this.displayedKeys.push(t)}}getDisplayedValueCount(){return this.displayedKeys.length}getDisplayedItem(e){return this.displayedKeys[e]}getSelectAllItem(){return Vf.SELECT_ALL}getAddSelectionToFilterItem(){return Vf.ADD_SELECTION_TO_FILTER}getDisplayedKeys(){return this.displayedKeys}forEachDisplayedKey(e){this.displayedKeys.forEach(e)}someDisplayedKey(e){return this.displayedKeys.some(e)}hasGroups(){return!1}refresh(){}},Uf=class e{constructor(e,t,i,n){this.formatter=e,this.treeListPathGetter=t,this.treeListFormatter=i,this.treeDataOrGrouping=n,this.allDisplayedItemsTree=[],this.activeDisplayedItemsFlat=[],this.selectAllItem={depth:0,filterPasses:!0,available:!0,treeKey:Vf.SELECT_ALL,children:this.allDisplayedItemsTree,expanded:!0,key:Vf.SELECT_ALL,parentTreeKeys:[]},this.addSelectionToFilterItem={depth:0,filterPasses:!0,available:!0,treeKey:Vf.ADD_SELECTION_TO_FILTER,expanded:!0,key:Vf.ADD_SELECTION_TO_FILTER,parentTreeKeys:[]}}updateDisplayedValuesToAllAvailable(e,t,i,n){"reload"===n?this.generateItemTree(e,t,i):"otherFilter"===n?(this.updateAvailable(i),this.updateExpandAll()):"miniFilter"===n&&(this.resetFilter(),this.updateExpandAll()),this.flattenItems()}updateDisplayedValuesToMatchMiniFilter(e,t,i,n,s,r){"reload"===r?this.generateItemTree(e,t,i):"otherFilter"===r&&this.updateAvailable(i),this.updateFilter(n,s),this.updateExpandAll(),this.flattenItems()}generateItemTree(e,t,i){var n;this.allDisplayedItemsTree=[],this.groupsExist=!1;const s=this.getTreeListPathGetter(e,i);for(let r of t){const t=null!=(n=s(e(r)))?n:[null];t.length>1&&(this.groupsExist=!0);const o=i.has(r);let a,l=this.allDisplayedItemsTree,c=[];t.forEach((e,i)=>{l||(l=[],a.children=l),a=l.find(t=>{var i;return(null==(i=t.treeKey)?void 0:i.toUpperCase())===(null==e?void 0:e.toUpperCase())}),a||(a={treeKey:e,depth:i,filterPasses:!0,expanded:!1,available:o,parentTreeKeys:c},i===t.length-1&&(a.key=r),l.push(a)),l=a.children,c=[...c,e]})}this.updateAvailable(i),this.selectAllItem.children=this.allDisplayedItemsTree,this.selectAllItem.expanded=!1}getTreeListPathGetter(t,i){if(this.treeListPathGetter)return this.treeListPathGetter;if(this.treeDataOrGrouping)return e=>e;let n=!1;for(const e of i){const i=t(e);if(i instanceof Date){n=!0;break}if(null!=i)break}return n?e.DATE_TREE_LIST_PATH_GETTER:(_f._.warnOnce("property treeList=true for Set Filter params, but you did not provide a treeListPathGetter or values of type Date."),e=>[String(e)])}flattenItems(){this.activeDisplayedItemsFlat=[];const e=t=>{t.forEach(t=>{t.filterPasses&&t.available&&(this.activeDisplayedItemsFlat.push(t),t.children&&t.expanded&&e(t.children))})};e(this.allDisplayedItemsTree)}resetFilter(){const e=t=>{t.children&&t.children.forEach(t=>{e(t)}),t.filterPasses=!0};this.allDisplayedItemsTree.forEach(t=>e(t))}updateFilter(e,t){const i=i=>!!i.available&&(null==i.treeKey?t:e(this.formatter(this.treeListFormatter?this.treeListFormatter(i.treeKey,i.depth,i.parentTreeKeys):i.treeKey)));this.allDisplayedItemsTree.forEach(e=>this.recursiveItemCheck(e,!1,i,"filterPasses"))}getDisplayedValueCount(){return this.activeDisplayedItemsFlat.length}getDisplayedItem(e){return this.activeDisplayedItemsFlat[e]}getSelectAllItem(){return this.selectAllItem}getAddSelectionToFilterItem(){return this.addSelectionToFilterItem}getDisplayedKeys(){const e=[];return this.forEachDisplayedKey(t=>e.push(t)),e}forEachDisplayedKey(e){const t=(i,n)=>{i.children?i.expanded&&n||i.children.forEach(e=>{e.filterPasses&&t(e,!1)}):e(i.key)};this.activeDisplayedItemsFlat.forEach(e=>t(e,!0))}someDisplayedKey(e){const t=(i,n)=>i.children?(!i.expanded||!n)&&i.children.some(e=>!!e.filterPasses&&t(e,!1)):e(i.key);return this.activeDisplayedItemsFlat.some(e=>t(e,!0))}hasGroups(){return this.groupsExist}refresh(){this.updateExpandAll(),this.flattenItems()}updateExpandAll(){const e=(t,i,n)=>{for(const s of t){if(!s.filterPasses||!s.available||!s.children)continue;if(i=i||!!s.expanded,n=n||!s.expanded,i&&n)return;const t=e(s.children,i,n);if(void 0===t)return;t?i=!0:n=!0}return i&&n?void 0:i},t=this.getSelectAllItem();t.expanded=e(t.children,!1,!1)}recursiveItemCheck(e,t,i,n){let s=!1;e.children&&e.children.forEach(r=>{const o=this.recursiveItemCheck(r,t||i(e),i,n);s=s||o});const r=t||s||i(e);return e[n]=r,r}updateAvailable(e){const t=t=>e.has(t.key);this.allDisplayedItemsTree.forEach(e=>this.recursiveItemCheck(e,!1,t,"available"))}};Uf.DATE_TREE_LIST_PATH_GETTER=e=>e?[String(e.getFullYear()),String(e.getMonth()+1),String(e.getDate())]:null;var zf=Uf,Wf=class{constructor({caseFormat:e}){this.filteringKeys=null,this.filteringKeysCaseFormatted=null,this.hasNoAppliedFilteringKeys=!1,this.caseFormat=e}allFilteringKeys(){return this.filteringKeys}allFilteringKeysCaseFormatted(){return this.filteringKeysCaseFormatted}noAppliedFilteringKeys(){return this.hasNoAppliedFilteringKeys}setFilteringKeys(e){this.filteringKeys=new Set(e),this.hasNoAppliedFilteringKeys=!this.filteringKeys||0===this.filteringKeys.size,this.filteringKeysCaseFormatted=new Set,this.filteringKeys.forEach(e=>this.filteringKeysCaseFormatted.add(this.caseFormat(e)))}addFilteringKey(e){null==this.filteringKeys&&(this.filteringKeys=new Set,this.filteringKeysCaseFormatted=new Set),this.filteringKeys.add(e),this.filteringKeysCaseFormatted.add(this.caseFormat(e)),this.hasNoAppliedFilteringKeys&&(this.hasNoAppliedFilteringKeys=!1)}hasCaseFormattedFilteringKey(e){return this.filteringKeysCaseFormatted.has(this.caseFormat(e))}hasFilteringKey(e){return this.filteringKeys.has(e)}reset(){this.filteringKeys=null,this.filteringKeysCaseFormatted=null,this.hasNoAppliedFilteringKeys=!1}},jf=class e{constructor(e){this.localEventService=new kf.EventService,this.miniFilterText=null,this.addCurrentSelectionToFilter=!1,this.providedValues=null,this.allValues=new Map,this.availableKeys=new Set,this.selectedKeys=new Set,this.initialised=!1;const{usingComplexObjects:t,columnModel:i,valueService:n,treeDataTreeList:s,groupingTreeList:r,filterParams:o,gos:a,valueFormatter:l,addManagedListener:c}=e,{column:h,colDef:u,textFormatter:d,doesRowPassOtherFilter:p,suppressSorting:g,comparator:f,rowModel:m,values:y,caseSensitive:v,convertValuesToStrings:b,treeList:C,treeListPathGetter:w,treeListFormatter:S}=o;this.filterParams=o,this.gos=a,this.setIsLoading=e.setIsLoading,this.translate=e.translate,this.caseFormat=e.caseFormat,this.createKey=e.createKey,this.usingComplexObjects=!!e.usingComplexObjects,this.formatter=d||kf.TextFilter.DEFAULT_FORMATTER,this.doesRowPassOtherFilters=p,this.suppressSorting=g||!1,this.convertValuesToStrings=!!b,this.filteringKeys=new Wf({caseFormat:this.caseFormat});const x=null!=f?f:u.comparator,E=!!s||!!r;this.compareByValue=!!(t&&x||E||C&&!w),this.entryComparator=E&&!x?this.createTreeDataOrGroupingComparator():!C||w||x?([e,t],[i,n])=>x(t,n):([e,t],[i,n])=>kf._.defaultComparator(t,n),this.keyComparator=null!=x?x:kf._.defaultComparator,this.caseSensitive=!!v;const A=a.get("getDataPath"),M=a.get("groupAllowUnbalanced");"clientSide"===m.getType()&&(this.clientSideValuesExtractor=new Bf(m,this.filterParams,this.createKey,this.caseFormat,i,n,E,!!s,A,M,c)),null==y?this.valuesType=2:(this.valuesType=Array.isArray(y)?0:1,this.providedValues=y),this.displayValueModel=C?new zf(this.formatter,w,S,s||r):new Hf(n,l,this.formatter,h),this.updateAllValues().then(e=>this.resetSelectionState(e||[]))}addEventListener(e,t,i){this.localEventService.addEventListener(e,t,i)}removeEventListener(e,t,i){this.localEventService.removeEventListener(e,t,i)}updateOnParamsChange(e){return new kf.AgPromise(t=>{const{values:i,textFormatter:n,suppressSorting:s}=e,r=this.providedValues,o=this.suppressSorting;if(this.filterParams=e,this.formatter=n||kf.TextFilter.DEFAULT_FORMATTER,this.suppressSorting=s||!1,this.providedValues=null!=i?i:null,this.providedValues!==r||this.suppressSorting!==o){i&&0!==i.length?this.valuesType=Array.isArray(i)?0:1:(this.valuesType=2,this.providedValues=null);const e=this.getModel();this.updateAllValues().then(i=>{this.setModel(e).then(()=>t())})}else t()})}refreshValues(){return new kf.AgPromise(e=>{this.allValuesPromise.then(()=>{const t=this.getModel();this.updateAllValues(),this.setModel(t).then(()=>e())})})}overrideValues(e){return new kf.AgPromise(t=>{this.allValuesPromise.then(()=>{this.valuesType=0,this.providedValues=e,this.refreshValues().then(()=>t())})})}refreshAfterAnyFilterChanged(){return this.showAvailableOnly()?this.allValuesPromise.then(e=>(this.updateAvailableKeys(null!=e?e:[],"otherFilter"),!0)):kf.AgPromise.resolve(!1)}isInitialised(){return this.initialised}updateAllValues(){return this.allValuesPromise=new kf.AgPromise(e=>{switch(this.valuesType){case 2:this.getValuesFromRowsAsync(!1).then(t=>e(this.processAllValues(t)));break;case 0:e(this.processAllValues(this.uniqueValues(this.validateProvidedValues(this.providedValues))));break;case 1:{this.setIsLoading(!0);const t=this.providedValues,{column:i,colDef:n}=this.filterParams,s=this.gos.addGridCommonParams({success:t=>{this.setIsLoading(!1),e(this.processAllValues(this.uniqueValues(this.validateProvidedValues(t))))},colDef:n,column:i});window.setTimeout(()=>t(s),0);break}default:throw new Error("Unrecognised valuesType")}}),this.allValuesPromise.then(e=>this.updateAvailableKeys(e||[],"reload")).then(()=>this.initialised=!0),this.allValuesPromise}processAllValues(e){const t=this.sortKeys(e);return this.allValues=null!=e?e:new Map,t}validateProvidedValues(e){if(this.usingComplexObjects&&(null==e?void 0:e.length)){const t=e[0];t&&"object"!=typeof t&&"function"!=typeof t&&(null==this.createKey(t)?kf._.warnOnce("Set Filter Key Creator is returning null for provided values and provided values are primitives. Please provide complex objects or set convertValuesToStrings=true in the filterParams. See https://www.ag-grid.com/javascript-data-grid/filter-set-filter-list/#filter-value-types"):kf._.warnOnce("Set Filter has a Key Creator, but provided values are primitives. Did you mean to provide complex objects or enable convertValuesToStrings?"))}return e}setValuesType(e){this.valuesType=e}getValuesType(){return this.valuesType}isKeyAvailable(e){return this.availableKeys.has(e)}showAvailableOnly(){return 2===this.valuesType}updateAvailableKeys(t,i){const n=this.showAvailableOnly()?this.sortKeys(this.getValuesFromRows(!0)):t;this.availableKeys=new Set(n),this.localEventService.dispatchEvent({type:e.EVENT_AVAILABLE_VALUES_CHANGED}),this.updateDisplayedValues(i,t)}sortKeys(e){const t=null!=e?e:new Map;if(this.suppressSorting)return Array.from(t.keys());let i;return i=this.compareByValue?Array.from(t.entries()).sort(this.entryComparator).map(([e])=>e):Array.from(t.keys()).sort(this.keyComparator),this.filterParams.excelMode&&t.has(null)&&(i=i.filter(e=>null!=e),i.push(null)),i}getParamsForValuesFromRows(e=!1){return this.clientSideValuesExtractor?{predicate:t=>!e||this.doesRowPassOtherFilters(t),existingValues:e&&!this.caseSensitive?this.allValues:void 0}:(kf._.doOnce(()=>{console.error("AG Grid: Set Filter cannot initialise because you are using a row model that does not contain all rows in the browser. Either use a different filter type, or configure Set Filter such that you provide it with values")},"setFilterValueNotCSRM"),null)}getValuesFromRows(e=!1){const t=this.getParamsForValuesFromRows(e);return t?this.clientSideValuesExtractor.extractUniqueValues(t.predicate,t.existingValues):null}getValuesFromRowsAsync(e=!1){const t=this.getParamsForValuesFromRows(e);return t?this.clientSideValuesExtractor.extractUniqueValuesAsync(t.predicate,t.existingValues):kf.AgPromise.resolve(null)}setMiniFilter(e){return e=kf._.makeNull(e),this.miniFilterText!==e&&(null===e&&this.setAddCurrentSelectionToFilter(!1),this.miniFilterText=e,this.updateDisplayedValues("miniFilter"),!0)}getMiniFilter(){return this.miniFilterText}updateDisplayedValues(e,t){if("expansion"===e)return void this.displayValueModel.refresh();if(null==this.miniFilterText)return void this.displayValueModel.updateDisplayedValuesToAllAvailable(e=>this.getValue(e),t,this.availableKeys,e);const i=this.caseFormat(this.formatter(this.miniFilterText)||""),n=e=>null!=e&&this.caseFormat(e).indexOf(i)>=0,s=!!this.filterParams.excelMode&&n(this.translate("blanks"));this.displayValueModel.updateDisplayedValuesToMatchMiniFilter(e=>this.getValue(e),t,this.availableKeys,n,s,e)}getDisplayedValueCount(){return this.displayValueModel.getDisplayedValueCount()}getDisplayedItem(e){return this.displayValueModel.getDisplayedItem(e)}getSelectAllItem(){return this.displayValueModel.getSelectAllItem()}getAddSelectionToFilterItem(){return this.displayValueModel.getAddSelectionToFilterItem()}hasSelections(){return this.filterParams.defaultToNothingSelected?this.selectedKeys.size>0:this.allValues.size!==this.selectedKeys.size}getKeys(){return Array.from(this.allValues.keys())}getValues(){return Array.from(this.allValues.values())}getValue(e){return this.allValues.get(e)}setAddCurrentSelectionToFilter(e){this.addCurrentSelectionToFilter=e}isInWindowsExcelMode(){return"windows"===this.filterParams.excelMode}isAddCurrentSelectionToFilterChecked(){return this.isInWindowsExcelMode()&&this.addCurrentSelectionToFilter}showAddCurrentSelectionToFilter(){return this.isInWindowsExcelMode()&&kf._.exists(this.miniFilterText)&&this.miniFilterText.length>0}selectAllMatchingMiniFilter(e=!1){null==this.miniFilterText?this.selectedKeys=new Set(this.allValues.keys()):(e&&this.selectedKeys.clear(),this.displayValueModel.forEachDisplayedKey(e=>this.selectedKeys.add(e)))}deselectAllMatchingMiniFilter(){null==this.miniFilterText?this.selectedKeys.clear():this.displayValueModel.forEachDisplayedKey(e=>this.selectedKeys.delete(e))}selectKey(e){this.selectedKeys.add(e)}deselectKey(e){this.filterParams.excelMode&&this.isEverythingVisibleSelected()&&this.resetSelectionState(this.displayValueModel.getDisplayedKeys()),this.selectedKeys.delete(e)}isKeySelected(e){return this.selectedKeys.has(e)}isEverythingVisibleSelected(){return!this.displayValueModel.someDisplayedKey(e=>!this.isKeySelected(e))}isNothingVisibleSelected(){return!this.displayValueModel.someDisplayedKey(e=>this.isKeySelected(e))}getModel(){if(!this.hasSelections())return null;const e=this.isAddCurrentSelectionToFilterChecked()?this.filteringKeys.allFilteringKeys():null;if(e&&e.size>0){if(this.selectedKeys){const t=new Set([...Array.from(e),...Array.from(this.selectedKeys).filter(t=>!e.has(t))]);return Array.from(t)}return Array.from(e)}return Array.from(this.selectedKeys)}setModel(e){return this.allValuesPromise.then(t=>{if(null==e)this.resetSelectionState(null!=t?t:[]);else{this.selectedKeys.clear();const t=new Map;this.allValues.forEach((e,i)=>{t.set(this.caseFormat(i),i)}),e.forEach(e=>{const i=this.caseFormat(kf._.makeNull(e)),n=t.get(i);void 0!==n&&this.selectKey(n)})}})}uniqueValues(e){const t=new Map,i=new Set;return(null!=e?e:[]).forEach(e=>{const n=kf._.makeNull(e),s=this.convertAndGetKey(n),r=this.caseFormat(s);i.has(r)||(i.add(r),t.set(s,n))}),t}convertAndGetKey(e){return this.convertValuesToStrings?e:this.createKey(e)}resetSelectionState(e){this.filterParams.defaultToNothingSelected?this.selectedKeys.clear():this.selectedKeys=new Set(e)}hasGroups(){return this.displayValueModel.hasGroups()}createTreeDataOrGroupingComparator(){return([e,t],[i,n])=>{if(null==t)return null==n?0:-1;if(null==n)return 1;for(let e=0;e<t.length;e++){if(e>=n.length)return 1;const i=kf._.defaultComparator(t[e],n[e]);if(0!==i)return i}return 0}}setAppliedModelKeys(e){this.filteringKeys.setFilteringKeys(e)}addToAppliedModelKeys(e){this.filteringKeys.addFilteringKey(e)}getAppliedModelKeys(){return this.filteringKeys.allFilteringKeys()}getCaseFormattedAppliedModelKeys(){return this.filteringKeys.allFilteringKeysCaseFormatted()}hasAppliedModelKey(e){return this.filteringKeys.hasCaseFormattedFilteringKey(e)}hasAnyAppliedModelKey(){return!this.filteringKeys.noAppliedFilteringKeys()}};jf.EVENT_AVAILABLE_VALUES_CHANGED="availableValuesChanged";var $f=jf,Kf=class e extends Lf.Component{constructor(t){var i;super(t.isGroup?e.GROUP_TEMPLATE:e.TEMPLATE),this.focusWrapper=t.focusWrapper,this.value=t.value,this.params=t.params,this.translate=t.translate,this.valueFormatter=t.valueFormatter,this.item=t.item,this.isSelected=t.isSelected,this.isTree=t.isTree,this.depth=null!=(i=t.depth)?i:0,this.isGroup=t.isGroup,this.groupsExist=t.groupsExist,this.isExpanded=t.isExpanded,this.hasIndeterminateExpandState=t.hasIndeterminateExpandState}init(){this.addDestroyFunc(()=>{var e;return null==(e=this.destroyCellRendererComponent)?void 0:e.call(this)}),this.render(),this.eCheckbox.setLabelEllipsis(!0).setValue(this.isSelected,!0).setDisabled(!!this.params.readOnly).getInputElement().setAttribute("tabindex","-1"),this.refreshVariableAriaLabels(),this.isTree&&(this.depth>0&&this.addCssClass("ag-set-filter-indent-"+this.depth),this.isGroup?this.setupExpansion():this.groupsExist&&this.addCssClass("ag-set-filter-add-group-indent"),Lf._.setAriaLevel(this.getAriaElement(),this.depth+1)),this.refreshAriaChecked(),this.params.readOnly||this.eCheckbox.onValueChange(e=>this.onCheckboxChanged(!!e))}getFocusableElement(){return this.focusWrapper}setupExpansion(){this.eGroupClosedIcon.appendChild(Lf._.createIcon("setFilterGroupClosed",this.gos,null)),this.eGroupOpenedIcon.appendChild(Lf._.createIcon("setFilterGroupOpen",this.gos,null)),this.addManagedListener(this.eGroupClosedIcon,"click",this.onExpandOrContractClicked.bind(this)),this.addManagedListener(this.eGroupOpenedIcon,"click",this.onExpandOrContractClicked.bind(this)),this.hasIndeterminateExpandState&&(this.eGroupIndeterminateIcon.appendChild(Lf._.createIcon("setFilterGroupIndeterminate",this.gos,null)),this.addManagedListener(this.eGroupIndeterminateIcon,"click",this.onExpandOrContractClicked.bind(this))),this.setExpandedIcons(),this.refreshAriaExpanded()}onExpandOrContractClicked(){this.setExpanded(!this.isExpanded)}setExpanded(t,i){if(this.isGroup&&t!==this.isExpanded){this.isExpanded=t;const n={type:e.EVENT_EXPANDED_CHANGED,isExpanded:!!t,item:this.item};i||this.dispatchEvent(n),this.setExpandedIcons(),this.refreshAriaExpanded()}}setExpandedIcons(){Lf._.setDisplayed(this.eGroupClosedIcon,this.hasIndeterminateExpandState?!1===this.isExpanded:!this.isExpanded),Lf._.setDisplayed(this.eGroupOpenedIcon,!0===this.isExpanded),this.hasIndeterminateExpandState&&Lf._.setDisplayed(this.eGroupIndeterminateIcon,void 0===this.isExpanded)}onCheckboxChanged(t){this.isSelected=t;const i={type:e.EVENT_SELECTION_CHANGED,isSelected:t,item:this.item};this.dispatchEvent(i),this.refreshVariableAriaLabels(),this.refreshAriaChecked()}toggleSelected(){this.params.readOnly||this.setSelected(!this.isSelected)}setSelected(e,t){this.isSelected=e,this.eCheckbox.setValue(e,t),this.refreshAriaChecked()}refreshVariableAriaLabels(){if(!this.isTree)return;const e=this.localeService.getLocaleTextFunc(),t=this.eCheckbox.getValue(),i=void 0===t?e("ariaIndeterminate","indeterminate"):t?e("ariaVisible","visible"):e("ariaHidden","hidden"),n=e("ariaToggleVisibility","Press SPACE to toggle visibility");Lf._.setAriaLabelledBy(this.eCheckbox.getInputElement(),void 0),this.eCheckbox.setInputAriaLabel(`${n} (${i})`)}setupFixedAriaLabels(e){if(!this.isTree)return;const t=this.localeService.getLocaleTextFunc()("ariaFilterValue","Filter Value"),i=this.getAriaElement();Lf._.setAriaLabel(i,`${e} ${t}`),Lf._.setAriaDescribedBy(i,this.eCheckbox.getInputElement().id)}refreshAriaChecked(){const e=this.getAriaElement();Lf._.setAriaChecked(e,this.eCheckbox.getValue())}refreshAriaExpanded(){Lf._.setAriaExpanded(this.getAriaElement(),!!this.isExpanded)}refresh(e,t,i){var n,s;if(this.item=e,t!==this.isSelected&&this.setSelected(t,!0),this.setExpanded(i,!0),this.valueFunction){const e=this.valueFunction();this.setTooltipAndCellRendererParams(e,e),this.cellRendererComponent||this.renderCellWithoutCellRenderer()}if(this.cellRendererComponent&&!(null==(s=(n=this.cellRendererComponent).refresh)?void 0:s.call(n,this.cellRendererParams))){const e=this.cellRendererComponent;this.renderCell(),this.destroyBean(e)}}render(){const{params:{column:e}}=this;let{value:t}=this,i=null;"function"==typeof t?(this.valueFunction=t,i=this.valueFunction(),t=i):i=this.isTree?Lf._.toStringOrNull(t):this.getFormattedValue(e,t),this.setTooltipAndCellRendererParams(t,i),this.renderCell()}setTooltipAndCellRendererParams(e,t){const i="whenTruncated"===this.gos.get("tooltipShowMode");if(this.params.showTooltips&&(!i||!this.params.cellRenderer)){const n=null!=t?t:Lf._.toStringOrNull(e);let s;i&&(s=()=>{const e=this.eCheckbox.getGui().querySelector(".ag-label");return!e||e.scrollWidth>e.clientWidth}),this.setTooltip({newTooltipText:n,location:"setFilterValue",getColDef:()=>this.params.colDef,getColumn:()=>this.params.column,shouldDisplayTooltip:s})}this.cellRendererParams=this.gos.addGridCommonParams({value:e,valueFormatted:t,colDef:this.params.colDef,column:this.params.column,setTooltip:(e,t)=>{this.setTooltip({newTooltipText:e,getColDef:()=>this.params.colDef,getColumn:()=>this.params.column,location:"setFilterValue",shouldDisplayTooltip:t})}})}getTooltipParams(){const e=super.getTooltipParams();return e.location="setFilterValue",e.colDef=this.getComponentHolder(),this.isTree&&(e.level=this.depth),e}getFormattedValue(e,t){return this.valueService.formatValue(e,null,t,this.valueFormatter,!1)}renderCell(){const e=this.userComponentFactory.getSetFilterCellRendererDetails(this.params,this.cellRendererParams),t=e?e.newAgStackInstance():void 0;null!=t?t.then(e=>{e&&(this.cellRendererComponent=e,this.eCheckbox.setLabel(e.getGui()),this.destroyCellRendererComponent=()=>this.destroyBean(e))}):this.renderCellWithoutCellRenderer()}renderCellWithoutCellRenderer(){var e;let t=null!=(e=null==this.cellRendererParams.valueFormatted?this.cellRendererParams.value:this.cellRendererParams.valueFormatted)?e:this.translate("blanks");"string"!=typeof t&&(Lf._.warnOnce(`Set Filter Value Formatter must return string values. Please ensure the Set Filter Value Formatter returns string values for complex objects, or set convertValuesToStrings=true in the filterParams. See ${this.getFrameworkOverrides().getDocLink("filter-set-filter-list/#filter-value-types")}`),t=""),this.eCheckbox.setLabel(t),this.setupFixedAriaLabels(t)}getComponentHolder(){return this.params.column.getColDef()}};Kf.EVENT_SELECTION_CHANGED="selectionChanged",Kf.EVENT_EXPANDED_CHANGED="expandedChanged",Kf.GROUP_TEMPLATE='\n        <div class="ag-set-filter-item" aria-hidden="true">\n            <span class="ag-set-filter-group-icons">\n                <span class="ag-set-filter-group-closed-icon" ref="eGroupClosedIcon"></span>\n                <span class="ag-set-filter-group-opened-icon" ref="eGroupOpenedIcon"></span>\n                <span class="ag-set-filter-group-indeterminate-icon" ref="eGroupIndeterminateIcon"></span>\n            </span>\n            <ag-checkbox ref="eCheckbox" class="ag-set-filter-item-checkbox"></ag-checkbox>\n        </div>',Kf.TEMPLATE='\n        <div class="ag-set-filter-item">\n            <ag-checkbox ref="eCheckbox" class="ag-set-filter-item-checkbox"></ag-checkbox>\n        </div>',Gf([(0,Lf.Autowired)("valueService")],Kf.prototype,"valueService",2),Gf([(0,Lf.Autowired)("userComponentFactory")],Kf.prototype,"userComponentFactory",2),Gf([(0,Lf.RefSelector)("eCheckbox")],Kf.prototype,"eCheckbox",2),Gf([(0,Lf.RefSelector)("eGroupOpenedIcon")],Kf.prototype,"eGroupOpenedIcon",2),Gf([(0,Lf.RefSelector)("eGroupClosedIcon")],Kf.prototype,"eGroupClosedIcon",2),Gf([(0,Lf.RefSelector)("eGroupIndeterminateIcon")],Kf.prototype,"eGroupIndeterminateIcon",2),Gf([Lf.PostConstruct],Kf.prototype,"init",1);var Yf=Kf,qf={loadingOoo:"Loading...",blanks:"(Blanks)",searchOoo:"Search...",selectAll:"(Select All)",selectAllSearchResults:"(Select All Search Results)",addCurrentSelectionToFilter:"Add current selection to filter",noMatches:"No matches."},Xf=class{getModelAsString(e,t){const{values:i}=e||t.getModel()||{},n=t.getValueModel();if(null==i||null==n)return"";const s=i.filter(e=>n.isKeyAvailable(e)),r=s.length;return`(${r}) ${s.slice(0,10).map(e=>t.getFormattedValue(e)).join(",")}${r>10?",...":""}`}},Zf=class extends Rf.ProvidedFilter{constructor(){super("setFilter"),this.valueModel=null,this.setFilterParams=null,this.virtualList=null,this.caseSensitive=!1,this.convertValuesToStrings=!1,this.treeDataTreeList=!1,this.groupingTreeList=!1,this.hardRefreshVirtualList=!1,this.noValueFormatterSupplied=!1,this.filterModelFormatter=new Xf,this.updateSetFilterOnParamsChange=e=>{var t;this.setFilterParams=e,this.convertValuesToStrings=!!e.convertValuesToStrings,this.caseSensitive=!!e.caseSensitive;const i=null!=(t=e.keyCreator)?t:e.colDef.keyCreator;this.setValueFormatter(e.valueFormatter,i,this.convertValuesToStrings,!!e.treeList,!!e.colDef.refData);const n=e.column.getId().startsWith(Rf.GROUP_AUTO_COLUMN_ID);this.treeDataTreeList=this.gos.get("treeData")&&!!e.treeList&&n,this.getDataPath=this.gos.get("getDataPath"),this.groupingTreeList=!!this.columnModel.getRowGroupColumns().length&&!!e.treeList&&n,this.createKey=this.generateCreateKey(i,this.convertValuesToStrings,this.treeDataTreeList||this.groupingTreeList)}}postConstruct(){super.postConstruct()}updateUiVisibility(){}createBodyTemplate(){return`\n            <div class="ag-set-filter">\n                <div ref="eFilterLoading" class="ag-filter-loading ag-hidden">${this.translateForSetFilter("loadingOoo")}</div>\n                <ag-input-text-field class="ag-mini-filter" ref="eMiniFilter"></ag-input-text-field>\n                <div ref="eFilterNoMatches" class="ag-filter-no-matches ag-hidden">${this.translateForSetFilter("noMatches")}</div>\n                <div ref="eSetFilterList" class="ag-set-filter-list" role="presentation"></div>\n            </div>`}handleKeyDown(e){if(super.handleKeyDown(e),!e.defaultPrevented)switch(e.key){case Rf.KeyCode.SPACE:this.handleKeySpace(e);break;case Rf.KeyCode.ENTER:this.handleKeyEnter(e);break;case Rf.KeyCode.LEFT:this.handleKeyLeft(e);break;case Rf.KeyCode.RIGHT:this.handleKeyRight(e)}}handleKeySpace(e){var t;null==(t=this.getComponentForKeyEvent(e))||t.toggleSelected()}handleKeyEnter(e){if(!this.setFilterParams)return;const{excelMode:t,readOnly:i}=this.setFilterParams||{};t&&!i&&(e.preventDefault(),this.onBtApply(!1,!1,e),"mac"===this.setFilterParams.excelMode&&this.eMiniFilter.getInputElement().select())}handleKeyLeft(e){var t;null==(t=this.getComponentForKeyEvent(e))||t.setExpanded(!1)}handleKeyRight(e){var t;null==(t=this.getComponentForKeyEvent(e))||t.setExpanded(!0)}getComponentForKeyEvent(e){var t;if(!this.eSetFilterList.contains(this.gos.getActiveDomElement())||!this.virtualList)return;const i=this.virtualList.getLastFocusedRow();if(null==i)return;const n=this.virtualList.getComponentAt(i);if(null==n)return;e.preventDefault();const{readOnly:s}=null!=(t=this.setFilterParams)?t:{};return s?void 0:n}getCssIdentifier(){return"set-filter"}setModel(e){var t;return null==e&&null==(null==(t=this.valueModel)?void 0:t.getModel())?(this.setMiniFilter(null),Rf.AgPromise.resolve()):super.setModel(e)}refresh(e){var t,i,n;return!!super.refresh(e)&&(!["treeList","treeListFormatter","treeListPathGetter","keyCreator","convertValuesToStrings","caseSensitive","comparator","suppressSelectAll","excelMode"].some(t=>{var i;return e[t]!==(null==(i=this.setFilterParams)?void 0:i[t])})&&!this.haveColDefParamsChanged(e.colDef)&&(super.updateParams(e),this.updateSetFilterOnParamsChange(e),this.updateMiniFilter(),e.cellRenderer===(null==(t=this.setFilterParams)?void 0:t.cellRenderer)&&e.valueFormatter===(null==(i=this.setFilterParams)?void 0:i.valueFormatter)||this.checkAndRefreshVirtualList(),null==(n=this.valueModel)||n.updateOnParamsChange(e).then(()=>{var e;(null==(e=this.valueModel)?void 0:e.hasSelections())&&this.refreshFilterValues()}),!0))}haveColDefParamsChanged(e){var t;const i=null==(t=this.setFilterParams)?void 0:t.colDef;return["keyCreator","filterValueGetter"].some(t=>e[t]!==(null==i?void 0:i[t]))}setModelAndRefresh(e){return this.valueModel?this.valueModel.setModel(e).then(()=>this.checkAndRefreshVirtualList()):Rf.AgPromise.resolve()}resetUiToDefaults(){return this.setMiniFilter(null),this.setModelAndRefresh(null)}setModelIntoUi(e){this.setMiniFilter(null);const t=null==e?null:e.values;return this.setModelAndRefresh(t)}getModelFromUi(){if(!this.valueModel)throw new Error("Value model has not been created.");const e=this.valueModel.getModel();return e?{values:e,filterType:this.getFilterType()}:null}getFilterType(){return"set"}getValueModel(){return this.valueModel}areModelsEqual(e,t){return null==e&&null==t||null!=e&&null!=t&&Rf._.areEqual(e.values,t.values)}setParams(e){var t;this.applyExcelModeOptions(e),super.setParams(e),this.updateSetFilterOnParamsChange(e);const i=null!=(t=e.keyCreator)?t:e.colDef.keyCreator;this.valueModel=new $f({filterParams:e,setIsLoading:e=>this.setIsLoading(e),translate:e=>this.translateForSetFilter(e),caseFormat:e=>this.caseFormat(e),createKey:this.createKey,valueFormatter:this.valueFormatter,usingComplexObjects:!!i,gos:this.gos,columnModel:this.columnModel,valueService:this.valueService,treeDataTreeList:this.treeDataTreeList,groupingTreeList:this.groupingTreeList,addManagedListener:(e,t)=>this.addManagedListener(this.eventService,e,t)}),this.initialiseFilterBodyUi(),this.addEventListenersForDataChanges()}onAddCurrentSelectionToFilterChange(e){if(!this.valueModel)throw new Error("Value model has not been created.");this.valueModel.setAddCurrentSelectionToFilter(e)}setValueFormatter(e,t,i,n,s){let r=e;if(!r){if(t&&!i&&!n)throw new Error("AG Grid: Must supply a Value Formatter in Set Filter params when using a Key Creator unless convertValuesToStrings is enabled");this.noValueFormatterSupplied=!0,s||(r=e=>Rf._.toStringOrNull(e.value))}this.valueFormatter=r}generateCreateKey(e,t,i){if(i&&!e)throw new Error("AG Grid: Must supply a Key Creator in Set Filter params when `treeList = true` on a group column, and Tree Data or Row Grouping is enabled.");return e?(t,i=null)=>{const n=this.getKeyCreatorParams(t,i);return Rf._.makeNull(e(n))}:t?e=>Array.isArray(e)?e:Rf._.makeNull(Rf._.toStringOrNull(e)):e=>Rf._.makeNull(Rf._.toStringOrNull(e))}getFormattedValue(e){var t;let i=this.valueModel.getValue(e);this.noValueFormatterSupplied&&(this.treeDataTreeList||this.groupingTreeList)&&Array.isArray(i)&&(i=Rf._.last(i));const n=this.valueService.formatValue(this.setFilterParams.column,null,i,this.valueFormatter,!1);return null!=(t=null==n?Rf._.toStringOrNull(i):n)?t:this.translateForSetFilter("blanks")}applyExcelModeOptions(e){"windows"===e.excelMode?(e.buttons||(e.buttons=["apply","cancel"]),null==e.closeOnApply&&(e.closeOnApply=!0)):"mac"===e.excelMode&&(e.buttons||(e.buttons=["reset"]),null==e.applyMiniFilterWhileTyping&&(e.applyMiniFilterWhileTyping=!0),null==e.debounceMs&&(e.debounceMs=500)),e.excelMode&&e.defaultToNothingSelected&&(e.defaultToNothingSelected=!1,Rf._.warnOnce('The Set Filter Parameter "defaultToNothingSelected" value was ignored because it does not work when "excelMode" is used.'))}addEventListenersForDataChanges(){this.isValuesTakenFromGrid()&&(this.addManagedListener(this.eventService,Rf.Events.EVENT_CELL_VALUE_CHANGED,e=>{this.setFilterParams&&e.column===this.setFilterParams.column&&this.syncAfterDataChange()}),this.addManagedPropertyListeners(["treeData","getDataPath","groupAllowUnbalanced"],()=>{this.syncAfterDataChange()}))}syncAfterDataChange(){if(!this.valueModel)throw new Error("Value model has not been created.");return this.valueModel.refreshValues().then(()=>{this.checkAndRefreshVirtualList(),this.onBtApply(!1,!0)})}setIsLoading(e){Rf._.setDisplayed(this.eFilterLoading,e),e||(this.hardRefreshVirtualList=!0)}initialiseFilterBodyUi(){this.initVirtualList(),this.initMiniFilter()}initVirtualList(){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");const e=this.localeService.getLocaleTextFunc()("ariaFilterList","Filter List"),t=!!this.setFilterParams.treeList,i=this.virtualList=this.createBean(new Rf.VirtualList({cssIdentifier:"filter",ariaRole:t?"tree":"listbox",listName:e})),n=this.getRefElement("eSetFilterList");t&&n.classList.add("ag-set-filter-tree-list"),n&&n.appendChild(i.getGui());const{cellHeight:s}=this.setFilterParams;let r;null!=s&&i.setRowHeight(s),i.setComponentCreator((e,i)=>this.createSetListItem(e,t,i)),i.setComponentUpdater((e,t)=>this.updateSetListItem(e,t)),r=this.setFilterParams.suppressSelectAll?new Qf(this.valueModel):new Jf(this.valueModel,()=>this.isSelectAllSelected()),t&&(r=new em(r)),i.setModel(r)}getSelectAllLabel(){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");const e=null!=this.valueModel.getMiniFilter()&&this.setFilterParams.excelMode?"selectAllSearchResults":"selectAll";return this.translateForSetFilter(e)}getAddSelectionToFilterLabel(){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");return this.translateForSetFilter("addCurrentSelectionToFilter")}createSetListItem(e,t,i){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");const n=this.valueModel.hasGroups(),{isSelected:s,isExpanded:r}=this.isSelectedExpanded(e),{value:o,depth:a,isGroup:l,hasIndeterminateExpandState:c,selectedListener:h,expandedListener:u}=this.newSetListItemAttributes(e,t),d={focusWrapper:i,value:o,params:this.setFilterParams,translate:e=>this.translateForSetFilter(e),valueFormatter:this.valueFormatter,item:e,isSelected:s,isTree:t,depth:a,groupsExist:n,isGroup:l,isExpanded:r,hasIndeterminateExpandState:c},p=this.createBean(new Yf(d));return p.addEventListener(Yf.EVENT_SELECTION_CHANGED,h),u&&p.addEventListener(Yf.EVENT_EXPANDED_CHANGED,u),p}newSetTreeItemAttributes(e,t){var i,n,s,r,o,a;if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");const l=this.valueModel.hasGroups();return e.key===Vf.SELECT_ALL?{value:()=>this.getSelectAllLabel(),isGroup:l,depth:e.depth,hasIndeterminateExpandState:!0,selectedListener:e=>this.onSelectAll(e.isSelected),expandedListener:e=>this.onExpandAll(e.item,e.isExpanded)}:e.key===Vf.ADD_SELECTION_TO_FILTER?{value:()=>this.getAddSelectionToFilterLabel(),depth:e.depth,isGroup:!1,hasIndeterminateExpandState:!1,selectedListener:e=>{this.onAddCurrentSelectionToFilterChange(e.isSelected)}}:e.children?{value:null!=(s=null==(n=(i=this.setFilterParams).treeListFormatter)?void 0:n.call(i,e.treeKey,e.depth,e.parentTreeKeys))?s:e.treeKey,depth:e.depth,isGroup:!0,selectedListener:e=>this.onGroupItemSelected(e.item,e.isSelected),expandedListener:e=>this.onExpandedChanged(e.item,e.isExpanded)}:{value:null!=(a=null==(o=(r=this.setFilterParams).treeListFormatter)?void 0:o.call(r,e.treeKey,e.depth,e.parentTreeKeys))?a:e.treeKey,depth:e.depth,selectedListener:e=>this.onItemSelected(e.item.key,e.isSelected)}}newSetListItemAttributes(e,t){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");return this.isSetFilterModelTreeItem(e)?this.newSetTreeItemAttributes(e,t):e===Vf.SELECT_ALL?{value:()=>this.getSelectAllLabel(),selectedListener:e=>this.onSelectAll(e.isSelected)}:e===Vf.ADD_SELECTION_TO_FILTER?{value:()=>this.getAddSelectionToFilterLabel(),selectedListener:e=>{this.onAddCurrentSelectionToFilterChange(e.isSelected)}}:{value:this.valueModel.getValue(e),selectedListener:e=>this.onItemSelected(e.item,e.isSelected)}}updateSetListItem(e,t){const{isSelected:i,isExpanded:n}=this.isSelectedExpanded(e);t.refresh(e,i,n)}isSelectedExpanded(e){let t,i;return this.isSetFilterModelTreeItem(e)?(i=e.expanded,t=e.key===Vf.SELECT_ALL?this.isSelectAllSelected():e.key===Vf.ADD_SELECTION_TO_FILTER?this.valueModel.isAddCurrentSelectionToFilterChecked():e.children?this.areAllChildrenSelected(e):this.valueModel.isKeySelected(e.key)):t=e===Vf.SELECT_ALL?this.isSelectAllSelected():e===Vf.ADD_SELECTION_TO_FILTER?this.valueModel.isAddCurrentSelectionToFilterChecked():this.valueModel.isKeySelected(e),{isSelected:t,isExpanded:i}}isSetFilterModelTreeItem(e){return void 0!==(null==e?void 0:e.treeKey)}initMiniFilter(){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");const{eMiniFilter:e,localeService:t}=this,i=t.getLocaleTextFunc();e.setDisplayed(!this.setFilterParams.suppressMiniFilter),e.setValue(this.valueModel.getMiniFilter()),e.onValueChange(()=>this.onMiniFilterInput()),e.setInputAriaLabel(i("ariaSearchFilterValues","Search filter values")),this.addManagedListener(e.getInputElement(),"keydown",e=>this.onMiniFilterKeyDown(e))}updateMiniFilter(){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");const{eMiniFilter:e}=this;e.isDisplayed()!==!this.setFilterParams.suppressMiniFilter&&e.setDisplayed(!this.setFilterParams.suppressMiniFilter);const t=this.valueModel.getMiniFilter();e.getValue()!==t&&e.setValue(t)}afterGuiAttached(e){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");super.afterGuiAttached(e),this.resetExpansion(),this.refreshVirtualList();const{eMiniFilter:t}=this;t.setInputPlaceholder(this.translateForSetFilter("searchOoo")),e&&e.suppressFocus||t.getFocusableElement().focus()}afterGuiDetached(){var e,t;super.afterGuiDetached(),(null==(e=this.setFilterParams)?void 0:e.excelMode)&&this.resetMiniFilter();const i=this.getModel();!(null==(t=this.setFilterParams)?void 0:t.excelMode)&&this.areModelsEqual(i,this.getModelFromUi())||(this.resetUiToActiveModel(i),this.showOrHideResults())}applyModel(e="api"){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");this.setFilterParams.excelMode&&"rowDataUpdated"!==e&&this.valueModel.isEverythingVisibleSelected()&&this.valueModel.selectAllMatchingMiniFilter();const t=this.valueModel.showAddCurrentSelectionToFilter()&&this.valueModel.isAddCurrentSelectionToFilterChecked();if(t&&!this.getModel())return!1;const i=super.applyModel(e),n=this.getModel();return n?(t||this.valueModel.setAppliedModelKeys(new Set),n.values.forEach(e=>{this.valueModel.addToAppliedModelKeys(e)})):t||this.valueModel.setAppliedModelKeys(null),i}isModelValid(e){return!this.setFilterParams||!this.setFilterParams.excelMode||null==e||e.values.length>0}doesFilterPass(e){if(!this.setFilterParams||!this.valueModel||!this.valueModel.getCaseFormattedAppliedModelKeys())return!0;if(!this.valueModel.hasAnyAppliedModelKey())return!1;const{node:t,data:i}=e;if(this.treeDataTreeList)return this.doesFilterPassForTreeData(t,i);if(this.groupingTreeList)return this.doesFilterPassForGrouping(t);let n=this.getValueFromNode(t);return this.convertValuesToStrings?this.doesFilterPassForConvertValuesToString(t,n):null!=n&&Array.isArray(n)?0===n.length?this.valueModel.hasAppliedModelKey(null):n.some(e=>this.isInAppliedModel(this.createKey(e,t))):this.isInAppliedModel(this.createKey(n,t))}doesFilterPassForConvertValuesToString(e,t){const i=this.createKey(t,e);return null!=i&&Array.isArray(i)?0===i.length?this.valueModel.hasAppliedModelKey(null):i.some(e=>this.isInAppliedModel(e)):this.isInAppliedModel(i)}doesFilterPassForTreeData(e,t){var i;return!(null==(i=e.childrenAfterGroup)?void 0:i.length)&&this.isInAppliedModel(this.createKey(this.checkMakeNullDataPath(this.getDataPath(t))))}doesFilterPassForGrouping(e){const t=this.columnModel.getRowGroupColumns().map(t=>this.valueService.getKeyForNode(t,e));return t.push(this.getValueFromNode(e)),this.isInAppliedModel(this.createKey(this.checkMakeNullDataPath(t)))}checkMakeNullDataPath(e){return e&&(e=e.map(e=>Rf._.toStringOrNull(Rf._.makeNull(e)))),(null==e?void 0:e.some(e=>null==e))?null:e}isInAppliedModel(e){return this.valueModel.hasAppliedModelKey(e)}getValueFromNode(e){return this.setFilterParams.getValue(e)}getKeyCreatorParams(e,t=null){return{value:e,colDef:this.setFilterParams.colDef,column:this.setFilterParams.column,node:t,data:null==t?void 0:t.data,api:this.setFilterParams.api,columnApi:this.setFilterParams.columnApi,context:this.setFilterParams.context}}onNewRowsLoaded(){this.isValuesTakenFromGrid()&&this.syncAfterDataChange()}isValuesTakenFromGrid(){return!!this.valueModel&&2===this.valueModel.getValuesType()}setFilterValues(e){if(!this.valueModel)throw new Error("Value model has not been created.");this.valueModel.overrideValues(e).then(()=>{this.checkAndRefreshVirtualList(),this.onUiChanged()})}resetFilterValues(){if(!this.valueModel)throw new Error("Value model has not been created.");this.valueModel.setValuesType(2),this.syncAfterDataChange()}refreshFilterValues(){if(!this.valueModel)throw new Error("Value model has not been created.");this.valueModel.isInitialised()&&this.valueModel.refreshValues().then(()=>{this.checkAndRefreshVirtualList(),this.onUiChanged()})}onAnyFilterChanged(){setTimeout(()=>{if(this.isAlive()){if(!this.valueModel)throw new Error("Value model has not been created.");this.valueModel.refreshAfterAnyFilterChanged().then(e=>{e&&(this.checkAndRefreshVirtualList(),this.showOrHideResults())})}},0)}onMiniFilterInput(){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");if(!this.valueModel.setMiniFilter(this.eMiniFilter.getValue()))return;const{applyMiniFilterWhileTyping:e,readOnly:t}=this.setFilterParams||{};!t&&e?this.filterOnAllVisibleValues(!1):this.updateUiAfterMiniFilterChange()}updateUiAfterMiniFilterChange(){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");const{excelMode:e,readOnly:t}=this.setFilterParams||{};null==e||t?this.checkAndRefreshVirtualList():null==this.valueModel.getMiniFilter()?this.resetUiToActiveModel(this.getModel()):(this.valueModel.selectAllMatchingMiniFilter(!0),this.checkAndRefreshVirtualList(),this.onUiChanged()),this.showOrHideResults()}showOrHideResults(){if(!this.valueModel)throw new Error("Value model has not been created.");const e=null!=this.valueModel.getMiniFilter()&&this.valueModel.getDisplayedValueCount()<1;Rf._.setDisplayed(this.eNoMatches,e),Rf._.setDisplayed(this.eSetFilterList,!e)}resetMiniFilter(){var e;this.eMiniFilter.setValue(null,!0),null==(e=this.valueModel)||e.setMiniFilter(null)}resetUiToActiveModel(e,t){this.setModelAndRefresh(null==e?null:e.values).then(()=>{this.onUiChanged(!1,"prevent"),null==t||t()})}handleCancelEnd(e){this.setMiniFilter(null),super.handleCancelEnd(e)}onMiniFilterKeyDown(e){const{excelMode:t,readOnly:i}=this.setFilterParams||{};e.key!==Rf.KeyCode.ENTER||t||i||this.filterOnAllVisibleValues()}filterOnAllVisibleValues(e=!0){const{readOnly:t}=this.setFilterParams||{};if(!this.valueModel)throw new Error("Value model has not been created.");if(t)throw new Error("Unable to filter in readOnly mode.");this.valueModel.selectAllMatchingMiniFilter(!0),this.checkAndRefreshVirtualList(),this.onUiChanged(!1,e?"immediately":"debounce"),this.showOrHideResults()}focusRowIfAlive(e){null!=e&&window.setTimeout(()=>{if(!this.virtualList)throw new Error("Virtual list has not been created.");this.isAlive()&&this.virtualList.focusRow(e)},0)}onSelectAll(e){if(!this.valueModel)throw new Error("Value model has not been created.");if(!this.virtualList)throw new Error("Virtual list has not been created.");e?this.valueModel.selectAllMatchingMiniFilter():this.valueModel.deselectAllMatchingMiniFilter(),this.refreshAfterSelection()}onGroupItemSelected(e,t){const i=e=>{e.children?e.children.forEach(e=>i(e)):this.selectItem(e.key,t)};i(e),this.refreshAfterSelection()}onItemSelected(e,t){if(!this.valueModel)throw new Error("Value model has not been created.");if(!this.virtualList)throw new Error("Virtual list has not been created.");this.selectItem(e,t),this.refreshAfterSelection()}selectItem(e,t){t?this.valueModel.selectKey(e):this.valueModel.deselectKey(e)}onExpandAll(e,t){const i=e=>{e.filterPasses&&e.available&&e.children&&(e.children.forEach(e=>i(e)),e.expanded=t)};i(e),this.refreshAfterExpansion()}onExpandedChanged(e,t){e.expanded=t,this.refreshAfterExpansion()}refreshAfterExpansion(){const e=this.virtualList.getLastFocusedRow();this.valueModel.updateDisplayedValues("expansion"),this.checkAndRefreshVirtualList(),this.focusRowIfAlive(e)}refreshAfterSelection(){const e=this.virtualList.getLastFocusedRow();this.checkAndRefreshVirtualList(),this.onUiChanged(),this.focusRowIfAlive(e)}setMiniFilter(e){this.eMiniFilter.setValue(e),this.onMiniFilterInput()}getMiniFilter(){return this.valueModel?this.valueModel.getMiniFilter():null}checkAndRefreshVirtualList(){if(!this.virtualList)throw new Error("Virtual list has not been created.");this.virtualList.refresh(!this.hardRefreshVirtualList),this.hardRefreshVirtualList&&(this.hardRefreshVirtualList=!1)}getFilterKeys(){return this.valueModel?this.valueModel.getKeys():[]}getFilterValues(){return this.valueModel?this.valueModel.getValues():[]}getValues(){return this.getFilterKeys()}refreshVirtualList(){this.setFilterParams&&this.setFilterParams.refreshValuesOnOpen?this.refreshFilterValues():this.checkAndRefreshVirtualList()}translateForSetFilter(e){return this.localeService.getLocaleTextFunc()(e,qf[e])}isSelectAllSelected(){if(!this.setFilterParams||!this.valueModel)return!1;if(this.setFilterParams.defaultToNothingSelected){if(this.valueModel.hasSelections()&&this.valueModel.isEverythingVisibleSelected())return!0;if(this.valueModel.isNothingVisibleSelected())return!1}else{if(this.valueModel.hasSelections()&&this.valueModel.isNothingVisibleSelected())return!1;if(this.valueModel.isEverythingVisibleSelected())return!0}}areAllChildrenSelected(e){const t=e=>{if(e.children){let i=!1,n=!1;return e.children.some(e=>{if(!e.filterPasses||!e.available)return!1;const s=t(e);return void 0===s||(s?i=!0:n=!0,i&&n)})?void 0:i}return this.valueModel.isKeySelected(e.key)};return this.setFilterParams.defaultToNothingSelected?this.valueModel.hasSelections()&&t(e):t(e)}destroy(){null!=this.virtualList&&(this.virtualList.destroy(),this.virtualList=null),super.destroy()}caseFormat(e){return null==e||"string"!=typeof e||this.caseSensitive?e:e.toUpperCase()}resetExpansion(){var e,t;if(!(null==(e=this.setFilterParams)?void 0:e.treeList))return;const i=null==(t=this.valueModel)?void 0:t.getSelectAllItem();if(this.isSetFilterModelTreeItem(i)){const e=t=>{t.children&&(t.children.forEach(t=>e(t)),t.expanded=!1)};e(i),this.valueModel.updateDisplayedValues("expansion")}}getModelAsString(e){return this.filterModelFormatter.getModelAsString(e,this)}getPositionableElement(){return this.eSetFilterList}};Gf([(0,Rf.RefSelector)("eMiniFilter")],Zf.prototype,"eMiniFilter",2),Gf([(0,Rf.RefSelector)("eFilterLoading")],Zf.prototype,"eFilterLoading",2),Gf([(0,Rf.RefSelector)("eSetFilterList")],Zf.prototype,"eSetFilterList",2),Gf([(0,Rf.RefSelector)("eFilterNoMatches")],Zf.prototype,"eNoMatches",2),Gf([(0,Rf.Autowired)("columnModel")],Zf.prototype,"columnModel",2),Gf([(0,Rf.Autowired)("valueService")],Zf.prototype,"valueService",2);var Qf=class{constructor(e){this.model=e}getRowCount(){return this.model.getDisplayedValueCount()}getRow(e){return this.model.getDisplayedItem(e)}areRowsEqual(e,t){return e===t}},Jf=class{constructor(e,t){this.model=e,this.isSelectAllSelected=t}getRowCount(){const e=this.model.showAddCurrentSelectionToFilter()?2:1;return this.model.getDisplayedValueCount()+e}getRow(e){if(0===e)return this.model.getSelectAllItem();const t=this.model.showAddCurrentSelectionToFilter(),i=t?2:1;return 1===e&&t?this.model.getAddSelectionToFilterItem():this.model.getDisplayedItem(e-i)}areRowsEqual(e,t){return e===t}},em=class{constructor(e){this.model=e}getRowCount(){return this.model.getRowCount()}getRow(e){return this.model.getRow(e)}areRowsEqual(e,t){return null==e&&null==t||null!=e&&null!=t&&e.treeKey===t.treeKey&&e.depth===t.depth}},tm=class extends Nf.Component{constructor(){super('\n            <div class="ag-floating-filter-input ag-set-floating-filter-input" role="presentation">\n                <ag-input-text-field ref="eFloatingFilterText"></ag-input-text-field>\n            </div>'),this.availableValuesListenerAdded=!1,this.filterModelFormatter=new Xf}destroy(){super.destroy()}init(e){this.params=e,this.eFloatingFilterText.setDisabled(!0).addGuiEventListener("click",()=>this.params.showParentFilter()),this.setParams(e)}setParams(e){const t=this.columnModel.getDisplayNameForColumn(e.column,"header",!0),i=this.localeService.getLocaleTextFunc();this.eFloatingFilterText.setInputAriaLabel(`${t} ${i("ariaFilterInput","Filter Input")}`)}onParamsUpdated(e){this.refresh(e)}refresh(e){this.params=e,this.setParams(e)}onParentModelChanged(e){this.updateFloatingFilterText(e)}parentSetFilterInstance(e){this.params.parentFilterInstance(t=>{if(!(t instanceof Zf))throw new Error("AG Grid - SetFloatingFilter expects SetFilter as its parent");e(t)})}addAvailableValuesListener(){this.parentSetFilterInstance(e=>{const t=e.getValueModel();t&&this.addManagedListener(t,$f.EVENT_AVAILABLE_VALUES_CHANGED,()=>this.updateFloatingFilterText())}),this.availableValuesListenerAdded=!0}updateFloatingFilterText(e){this.availableValuesListenerAdded||this.addAvailableValuesListener(),this.parentSetFilterInstance(t=>{this.eFloatingFilterText.setValue(this.filterModelFormatter.getModelAsString(e,t))})}};Gf([(0,Nf.RefSelector)("eFloatingFilterText")],tm.prototype,"eFloatingFilterText",2),Gf([(0,Nf.Autowired)("columnModel")],tm.prototype,"columnModel",2);var im={version:"31.3.4",moduleName:If.ModuleNames.SetFilterModule,beans:[],userComponents:[{componentName:"agSetColumnFilter",componentClass:Zf},{componentName:"agSetColumnFloatingFilter",componentClass:tm}],dependantModules:[D]},nm=i(98092),sm=i(98092),rm=i(21371),om=i(21371),am=i(21371),lm=i(21371),cm=i(21371),hm=i(21371),um=i(21371),dm=i(21371),pm=i(98092),gm=Object.defineProperty,fm=Object.getOwnPropertyDescriptor,mm=Object.getOwnPropertySymbols,ym=Object.prototype.hasOwnProperty,vm=Object.prototype.propertyIsEnumerable,bm=(e,t,i)=>t in e?gm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Cm=(e,t,i,n)=>{for(var s,r=n>1?void 0:n?fm(t,i):t,o=e.length-1;o>=0;o--)(s=e[o])&&(r=(n?s(t,i,r):s(r))||r);return n&&r&&gm(t,i,r),r},{extent:wm,isNumber:Sm,isString:xm,isStringObject:Em,isDate:Am,createId:Mm,Padding:Tm}=om._Util,{LinearScale:Dm,BandScale:Im,TimeScale:Rm}=om._Scale,km=class{constructor(){this.type="category",this.stroke="rgb(204, 214, 235)",this.strokeWidth=1}},Pm=class e{constructor(){this.id=Mm(this),this.seriesRect={x:0,y:0,width:0,height:0},this._context=void 0,this._container=void 0,this._data=void 0,this.padding=new Tm(3),this.xKey="x",this.yKey="y",this.dataType=void 0,this.xData=[],this.yData=[],this.min=void 0,this.max=void 0,this.yScale=new Dm,this.axis=new km,this.highlightStyle={size:6,fill:"yellow",stroke:"silver",strokeWidth:1},this._width=100,this._height=100,this.smallestInterval=void 0,this.layoutId=0,this.defaultDateFormatter=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),this._onMouseMove=this.onMouseMove.bind(this),this._onMouseOut=this.onMouseOut.bind(this);const t=new om._Scene.Group;this.rootGroup=t;const i=document.createElement("div");i.setAttribute("class","ag-sparkline-wrapper");const n=new om._Scene.Scene({});this.scene=n,this.canvasElement=n.canvas.element,n.setRoot(t),n.setContainer(i),this.resizeAndSetDimensions(this.width,this.height),e.tooltipDocuments.includes(document)||this.initialiseTooltipStyles(),this.setupDomEventListeners(this.canvasElement)}set context(e){this._context!==e&&(this._context=e)}get context(){return this._context}set container(e){if(this._container!==e){const{parentNode:t}=this.canvasElement;null!=t&&t.removeChild(this.canvasElement),e&&e.appendChild(this.canvasElement),this._container=e}}get container(){return this._container}set data(e){this._data!==e&&(this._data=e,this.processData(),this.mouseMoveEvent&&this.highlightedDatum&&this.updateHitPoint(this.mouseMoveEvent))}get data(){return this._data}resizeAndSetDimensions(e,t){this.scene.resize(e,t),this.seriesRect.width=e,this.seriesRect.height=t}initialiseTooltipStyles(){const t=document.createElement("style");t.innerHTML="\n.ag-sparkline-tooltip-wrapper {\n    position: absolute;\n    user-select: none;\n    pointer-events: none;\n}\n\n.ag-sparkline-tooltip {\n    position: relative;\n    font: 12px arial,sans-serif;\n    border-radius: 2px;\n    box-shadow: 0 1px 3px rgb(0 0 0 / 20%), 0 1px 1px rgb(0 0 0 / 14%);\n    line-height: 1.7em;\n    overflow: hidden;\n    white-space: nowrap;\n    z-index: 99999;\n    background-color: rgb(255, 255, 255);\n    color: rgba(0,0,0, 0.67);\n}\n\n.ag-sparkline-tooltip-content {\n    padding: 0 7px;\n    opacity: 1;\n}\n\n.ag-sparkline-tooltip-title {\n    padding-left: 7px;\n    opacity: 1;\n}\n\n.ag-sparkline-tooltip-wrapper-hidden {\n    top: -10000px !important;\n}\n\n.ag-sparkline-wrapper {\n    box-sizing: border-box;\n    overflow: hidden;\n}\n",document.head.insertBefore(t,document.head.querySelector("style")),e.tooltipDocuments.push(document)}set width(e){this._width!==e&&(this._width=e,this.scene.resize(e,this.height),this.scheduleLayout())}get width(){return this._width}set height(e){this._height!==e&&(this._height=e,this.scene.resize(this.width,e),this.scheduleLayout())}get height(){return this._height}update(){}updateYScale(){this.updateYScaleRange(),this.updateYScaleDomain()}updateYScaleDomain(){}updateYScaleRange(){const{yScale:e,seriesRect:t}=this;e.range=[t.height,0]}updateXScale(){const{type:e}=this.axis;this.xScale=this.getXScale(e),this.updateXScaleRange(),this.updateXScaleDomain()}updateXScaleRange(){this.xScale.range=[0,this.seriesRect.width]}updateXScaleDomain(){const{xData:e,xScale:t}=this;let i;(t instanceof Dm||t instanceof Rm)&&(i=wm(e)),this.xScale.domain=i?i.slice():e}getXScale(e="category"){switch(e){case"number":return new Dm;case"time":return new Rm;default:return new Im}}updateAxisLine(){}updateAxes(){this.updateYScale(),this.updateXScale(),this.updateAxisLine()}updateCrosshairs(){this.updateXCrosshairLine(),this.updateYCrosshairLine()}generateNodeData(){return[]}getNodeData(){return[]}updateNodes(){}updateXCrosshairLine(){}updateYCrosshairLine(){}highlightDatum(e){this.updateNodes()}dehighlightDatum(){this.highlightedDatum=void 0,this.updateNodes(),this.updateCrosshairs()}onMouseMove(e){this.mouseMoveEvent=e,this.updateHitPoint(e)}updateHitPoint(e){var t,i,n;const s=this.pickClosestSeriesNodeDatum(e.offsetX,e.offsetY);if(!s)return;const r=this.highlightedDatum;this.highlightedDatum=s,(this.highlightedDatum&&!r||this.highlightedDatum&&r&&this.highlightedDatum!==r)&&(this.highlightDatum(s),this.updateCrosshairs(),this.scene.render().catch(e=>console.error("AG Grid - chart rendering failed",e))),(null==(n=null==(i=null==(t=this.processedOptions)?void 0:t.tooltip)?void 0:i.enabled)||n)&&this.handleTooltip(e,s)}onMouseOut(e){this.dehighlightDatum(),this.tooltip.toggle(!1),this.scene.render().catch(e=>console.error("AG Grid - chart rendering failed",e))}processData(){const{data:e,yData:t,xData:i}=this;if(!e||this.invalidData(this.data))return;t.length=0,i.length=0;const n=e.length,s=this.getDataType(e);this.dataType=s;const{type:r}=this.axis,o="number"!==r&&"time"!==r?"category":r,a="number"===o||"time"===o,l=(e,t)=>{null==this.smallestInterval&&(this.smallestInterval={x:1/0,y:1/0});const{x:i}=this.smallestInterval,n=Math.abs(e-t);n>0&&n<i&&(this.smallestInterval.x=n)};let c;if("number"===s)for(let s=0;s<n;s++){const n=s,r=e[s],h=this.getDatum(n,o),u=this.getDatum(r,"number");a&&l(h,c),i.push(h),t.push(u),c=h}else if("array"===s)for(let s=0;s<n;s++){const n=e[s];if(Array.isArray(n)){const e=n[0],s=n[1],r=this.getDatum(e,o),h=this.getDatum(s,"number");if(null==r)continue;a&&l(r,c),i.push(r),t.push(h),c=r}}else if("object"===s){const{yKey:s,xKey:r}=this;for(let h=0;h<n;h++){const n=e[h];if("object"==typeof n&&!Array.isArray(n)){const e=n[r],h=n[s],u=this.getDatum(e,o),d=this.getDatum(h,"number");if(null==u)continue;a&&l(u,c),i.push(u),t.push(d),c=u}}}this.updateAxes(),this.immediateLayout()}getDataType(e){for(const t of e)if(null!=t){if(Sm(t))return"number";if(Array.isArray(t))return"array";if("object"==typeof t)return"object"}}getDatum(e,t){if("number"===t&&Sm(e)||"time"===t&&(Sm(e)||Am(e)))return e;if("category"===t){if(xm(e)||Am(e)||Sm(e))return{toString:()=>String(e)};if(Em(e))return e}}get layoutScheduled(){return!!this.layoutId}scheduleLayout(){this.layoutId&&cancelAnimationFrame(this.layoutId),this.layoutId=requestAnimationFrame(()=>{this.immediateLayout(),this.layoutId=0})}immediateLayout(){this.setSparklineDimensions(),this.invalidData(this.data)||(this.updateXScaleRange(),this.updateYScaleRange(),this.updateAxisLine(),this.update(),this.scene.render().catch(e=>console.error("AG Grid - chart rendering failed",e)))}setSparklineDimensions(){const{width:e,height:t,padding:i,seriesRect:n,rootGroup:s}=this,r=e-i.left-i.right,o=t-i.top-i.bottom;n.width=r,n.height=o,n.x=i.left,n.y=i.top,s.translationX=n.x,s.translationY=n.y}pickClosestSeriesNodeDatum(e,t){let i,n=1/0;const s=this.rootGroup.transformPoint(e,t),r=this.getNodeData();for(let e=0;e<r.length;e++){const t=r[e];if(!t.point)return;const o=this.getDistance(s,t.point);o<=n&&(n=o,i=t)}return i}getDistance(e,t){return Math.abs(e.x-t.x)}handleTooltip(e,t){var i,n;const{seriesDatum:s}=t,{canvasElement:r}=this,{clientX:o,clientY:a}=e,l=null==(i=this.processedOptions)?void 0:i.tooltip,c={pageX:o,pageY:a,position:{xOffset:null==l?void 0:l.xOffset,yOffset:null==l?void 0:l.yOffset},container:null==l?void 0:l.container};null==c.container&&(c.container=r);const h=s.y,u=s.x;let d=null==(n=null==l?void 0:l.enabled)||n;const p=null==l?void 0:l.renderer;if(p){const e=p({context:this.context,datum:s,yValue:h,xValue:u});d="string"!=typeof e&&void 0!==e.enabled?e.enabled:d}const g=d&&void 0!==s.y&&this.getTooltipHtml(t);g&&this.tooltip.show(c,g)}formatNumericDatum(e){return String(Math.round(10*e)/10)}formatDatum(e){const t=this.axis.type||"category";return"number"===t&&"number"==typeof e?this.formatNumericDatum(e):"time"===t&&(e instanceof Date||Sm(e))?this.defaultDateFormatter.format(e):String(e)}setupDomEventListeners(e){e.addEventListener("mousemove",this._onMouseMove),e.addEventListener("mouseout",this._onMouseOut)}cleanupDomEventListeners(e){e.removeEventListener("mousemove",this._onMouseMove),e.removeEventListener("mouseout",this._onMouseOut)}invalidData(e){return!e||!Array.isArray(e)}destroy(){this.cleanupDomEventListeners(this.canvasElement),this.scene.destroy(),this.container=void 0}};Pm.tooltipDocuments=[];var _m=Pm;function Lm(e,t){var i,n,s;if("string"==typeof e)return e;t=null!=t?t:{};const{content:r=(null!=(i=t.content)?i:""),title:o=(null!=(n=t.title)?n:void 0),color:a=t.color,backgroundColor:l=t.backgroundColor,opacity:c=(null!=(s=t.opacity)?s:1)}=e;let h,u;a?(h=o?`<span class="${Om.class}-title"; style="color: ${a}">${o}</span>`:"",u=`<span class="${Om.class}-content" style="color: ${a}">${r}</span>`):(h=o?`<span class="${Om.class}-title">${o}</span>`:"",u=`<span class="${Om.class}-content">${r}</span>`);let d=`opacity: ${c}`;return l&&(d+=`; background-color: ${l.toLowerCase()}`),`<div class="${Om.class}" style="${d}">\n                ${h}\n                ${u}\n            </div>`}var Nm=class e{constructor(){this.element=document.createElement("div"),document.body.appendChild(this.element)}isVisible(){const{element:t}=this;if(t.classList)return!t.classList.contains(`${e.class}-wrapper-hidden`);const i=t.getAttribute("class");return!!i&&i.split(" ").indexOf(`${e.class}-wrapper-hidden`)<0}updateClass(t){const i=[`${e.class}-wrapper`];!0!==t&&i.push(`${e.class}-wrapper-hidden`),this.element.setAttribute("class",i.join(" "))}show(e,t){var i,n,s,r;this.toggle(!1);const{element:o}=this;if(void 0!==t)o.innerHTML=t;else if(!o.innerHTML)return;const a=null!=(n=null==(i=e.position)?void 0:i.xOffset)?n:10,l=null!=(r=null==(s=e.position)?void 0:s.yOffset)?r:0;let c=e.pageX+a,h=e.pageY+l;const u=o.getBoundingClientRect();let d=window.innerWidth-u.width;if(e.container){const t=e.container.getBoundingClientRect();d=t.left+(t.width-u.width)}c>d&&(c=e.pageX-o.clientWidth-a),"undefined"!=typeof scrollX&&(c+=scrollX),"undefined"!=typeof scrollY&&(h+=scrollY),o.style.left=`${Math.round(c)}px`,o.style.top=`${Math.round(h)}px`,this.toggle(!0)}toggle(e){this.updateClass(e)}destroy(){const{parentNode:e}=this.element;e&&e.removeChild(this.element)}};Nm.class="ag-sparkline-tooltip";var Om=Nm;function Fm(e){switch(e){case"circle":default:return am._Scene.Circle;case"square":return am._Scene.Square;case"diamond":return am._Scene.Diamond}}function Gm(e,t="solid"){const i={solid:[],dash:[4,3],dot:[1,3],dashDot:[4,3,1,3],dashDotDot:[4,3,1,3,1,3],shortDot:[1,1],shortDash:[3,1],shortDashDot:[3,1,1,1],shortDashDotDot:[3,1,1,1,1,1],longDash:[8,3],longDashDot:[8,3,1,3],longDashDotDot:[8,3,1,3,1,3]},n={solid:[],dash:[3,3],dot:[0,3],dashDot:[3,3,0,3],dashDotDot:[3,3,0,3,0,3],shortDot:[0,2],shortDash:[2,2],shortDashDot:[2,2,0,2],shortDashDotDot:[2,2,0,2,0,2],longDash:[7,3],longDashDot:[7,3,0,3],longDashDotDot:[7,3,0,3,0,3]};return"round"===e||"square"===e?null==n[t]?(console.warn(`'${t}' is not a valid 'lineDash' option.`),n.solid):n[t]:null==i[t]?(console.warn(`'${t}' is not a valid 'lineDash' option.`),i.solid):i[t]}var{extent:Bm}=rm._Util,{BandScale:Vm}=rm._Scale,Hm=class{constructor(){this.enabled=!0,this.shape="circle",this.size=0,this.fill="rgb(124, 181, 236)",this.stroke="rgb(124, 181, 236)",this.strokeWidth=1,this.formatter=void 0}},Um=class{constructor(){this.stroke="rgb(124, 181, 236)",this.strokeWidth=1}},zm=class{constructor(){this.xLine={enabled:!0,stroke:"rgba(0,0,0, 0.54)",strokeWidth:1,lineDash:"solid",lineCap:void 0},this.yLine={enabled:!1,stroke:"rgba(0,0,0, 0.54)",strokeWidth:1,lineDash:"solid",lineCap:void 0}}},Wm=class extends _m{constructor(){super(),this.fill="rgba(124, 181, 236, 0.25)",this.strokePath=new rm._Scene.Path,this.fillPath=new rm._Scene.Path,this.xCrosshairLine=new rm._Scene.Line,this.yCrosshairLine=new rm._Scene.Line,this.areaSparklineGroup=new rm._Scene.Group,this.xAxisLine=new rm._Scene.Line,this.markers=new rm._Scene.Group,this.markerSelection=rm._Scene.Selection.select(this.markers,()=>this.markerFactory()),this.markerSelectionData=[],this.marker=new Hm,this.line=new Um,this.crosshairs=new zm,this.rootGroup.append(this.areaSparklineGroup),this.xAxisLine.zIndex=500,this.fillPath.zIndex=50,this.strokePath.zIndex=1e3,this.xCrosshairLine.zIndex=2e3,this.yCrosshairLine.zIndex=2e3,this.markers.zIndex=2500,this.areaSparklineGroup.append([this.fillPath,this.xAxisLine,this.strokePath,this.xCrosshairLine,this.yCrosshairLine,this.markers])}markerFactory(){const{shape:e}=this.marker;return new(Fm(e))}getNodeData(){return this.markerSelectionData}update(){const e=this.generateNodeData();if(!e)return;const{nodeData:t,fillData:i,strokeData:n}=e;this.markerSelectionData=t,this.updateSelection(t),this.updateNodes(),this.updateStroke(n),this.updateFill(i)}updateYScaleDomain(){const{yData:e,yScale:t}=this,i=Bm(e);let n=0,s=1;void 0!==i&&(n=this.min=i[0],s=this.max=i[1]),n=n<0?n:0,s=s<0?0:s,t.domain=[n,s]}generateNodeData(){const{data:e,yData:t,xData:i,xScale:n,yScale:s}=this;if(!e)return;const r=!(n instanceof Vm),o=r?0:n.bandwidth/2,a=t.length,l=[],c=[],h=[];let u,d,p,g;const f=s.convert(0);for(let e=0;e<a;e++){const m=t[e],y=i[e],v=n.convert(r?n.toDomain(y):y)+o,b=void 0===m?NaN:s.convert(m);e+1<a&&(g=n.convert(r?n.toDomain(i[e+1]):i[e+1])+o),h.push({seriesDatum:{x:y,y:m},point:{x:v,y:b}}),void 0===m&&void 0!==p?(c.push({seriesDatum:void 0,point:{x:p,y:f}}),void 0!==g&&c.push({seriesDatum:void 0,point:{x:g,y:f}})):void 0!==m&&(c.push({seriesDatum:{x:y,y:m},point:{x:v,y:b}}),l.push({seriesDatum:{x:y,y:m},point:{x:v,y:b}}),u=void 0!==u?u:v,d=v),p=v}return c.push({seriesDatum:void 0,point:{x:d,y:f}},{seriesDatum:void 0,point:{x:u,y:f}}),{nodeData:l,fillData:c,strokeData:h}}updateAxisLine(){const{xScale:e,yScale:t,axis:i,xAxisLine:n}=this;n.x1=e.range[0],n.x2=e.range[1],n.y1=n.y2=0,n.stroke=i.stroke,n.strokeWidth=i.strokeWidth;const s=t.convert(0);n.translationY=s}updateSelection(e){this.markerSelection.update(e)}updateNodes(){const{highlightedDatum:e,highlightStyle:t,marker:i}=this,{size:n,fill:s,stroke:r,strokeWidth:o}=t,a=i.formatter;this.markerSelection.each((t,l,c)=>{const{point:h,seriesDatum:u}=l;if(!h)return;const d=l===e,p=d&&void 0!==s?s:i.fill,g=d&&void 0!==r?r:i.stroke,f=d&&void 0!==o?o:i.strokeWidth,m=d&&void 0!==n?n:i.size;let y;if(a){const e=0===c,t=c===this.markerSelectionData.length-1,i=u.y===this.min,n=u.y===this.max;y=a({datum:l,xValue:u.x,yValue:u.y,min:i,max:n,first:e,last:t,fill:p,stroke:g,strokeWidth:f,size:m,highlighted:d})}t.size=y&&null!=y.size?y.size:m,t.fill=y&&null!=y.fill?y.fill:p,t.stroke=y&&null!=y.stroke?y.stroke:g,t.strokeWidth=y&&null!=y.strokeWidth?y.strokeWidth:f,t.translationX=h.x,t.translationY=h.y,t.visible=y&&null!=y.enabled?y.enabled:i.enabled&&t.size>0})}updateStroke(e){const{strokePath:t,yData:i,line:n}=this,s=t.path;if(s.clear(),i.length<2)return;const r=e.length;let o=!0;for(let t=0;t<r;t++){const{point:i,seriesDatum:n}=e[t],r=i.x,a=i.y;null==n.y?o=!0:o?(s.moveTo(r,a),o=!1):s.lineTo(r,a)}t.lineJoin=t.lineCap="round",t.fill=void 0,t.stroke=n.stroke,t.strokeWidth=n.strokeWidth}updateFill(e){const{fillPath:t,yData:i,fill:n}=this,s=t.path,r=e.length;if(s.clear(),!(i.length<2)){for(let t=0;t<r;t++){const{point:i}=e[t],n=i.x,r=i.y;t>0?s.lineTo(n,r):s.moveTo(n,r)}s.closePath(),t.lineJoin="round",t.stroke=void 0,t.fill=n}}updateXCrosshairLine(){var e;const{yScale:t,xCrosshairLine:i,highlightedDatum:n,crosshairs:{xLine:s}}=this;if(!s.enabled||null==n)return void(i.strokeWidth=0);i.y1=t.range[0],i.y2=t.range[1],i.x1=i.x2=0,i.stroke=s.stroke,i.strokeWidth=null!=(e=s.strokeWidth)?e:1,i.lineCap="round"===s.lineCap||"square"===s.lineCap?s.lineCap:void 0;const{lineDash:r}=s;i.lineDash=Array.isArray(r)?r:Gm(i.lineCap,s.lineDash),i.translationX=n.point.x}updateYCrosshairLine(){var e;const{xScale:t,yCrosshairLine:i,highlightedDatum:n,crosshairs:{yLine:s}}=this;if(!s.enabled||null==n)return void(i.strokeWidth=0);i.x1=t.range[0],i.x2=t.range[1],i.y1=i.y2=0,i.stroke=s.stroke,i.strokeWidth=null!=(e=s.strokeWidth)?e:1,i.lineCap="round"===s.lineCap||"square"===s.lineCap?s.lineCap:void 0;const{lineDash:r}=s;i.lineDash=Array.isArray(r)?r:Gm(i.lineCap,s.lineDash),i.translationY=n.point.y}getTooltipHtml(e){var t,i;const{dataType:n}=this,{seriesDatum:s}=e,r=s.y,o=s.x,a={content:this.formatNumericDatum(r),title:"array"===n||"object"===n?this.formatDatum(o):void 0},l=null==(i=null==(t=this.processedOptions)?void 0:t.tooltip)?void 0:i.renderer;return l?Lm(l({context:this.context,datum:s,yValue:r,xValue:o}),a):Lm(a)}};Wm.className="AreaSparkline";var{extent:jm}=lm._Util,{BandScale:$m}=lm._Scale,Km=class{constructor(){this.enabled=!0,this.shape="circle",this.size=0,this.fill="rgb(124, 181, 236)",this.stroke="rgb(124, 181, 236)",this.strokeWidth=1,this.formatter=void 0}},Ym=class{constructor(){this.stroke="rgb(124, 181, 236)",this.strokeWidth=1}},qm=class{constructor(){this.xLine={enabled:!0,stroke:"rgba(0,0,0, 0.54)",strokeWidth:1,lineDash:"solid",lineCap:void 0},this.yLine={enabled:!1,stroke:"rgba(0,0,0, 0.54)",strokeWidth:1,lineDash:"solid",lineCap:void 0}}},Xm=class extends _m{constructor(){super(),this.linePath=new lm._Scene.Path,this.xCrosshairLine=new lm._Scene.Line,this.yCrosshairLine=new lm._Scene.Line,this.lineSparklineGroup=new lm._Scene.Group,this.markers=new lm._Scene.Group,this.markerSelection=lm._Scene.Selection.select(this.markers,()=>this.markerFactory()),this.markerSelectionData=[],this.marker=new Km,this.line=new Ym,this.crosshairs=new qm,this.rootGroup.append(this.lineSparklineGroup),this.linePath.zIndex=1e3,this.xCrosshairLine.zIndex=2e3,this.yCrosshairLine.zIndex=2e3,this.markers.zIndex=2500,this.lineSparklineGroup.append([this.linePath,this.xCrosshairLine,this.yCrosshairLine,this.markers])}getNodeData(){return this.markerSelectionData}markerFactory(){const{shape:e}=this.marker;return new(Fm(e))}onMarkerShapeChange(){this.markerSelection=this.markerSelection.clear(),this.scheduleLayout()}update(){const e=this.generateNodeData();e&&(this.markerSelectionData=e,this.updateSelection(e),this.updateNodes(),this.updateLine())}updateYScaleDomain(){const{yData:e,yScale:t}=this,i=jm(e);let n=0,s=1;if(void 0!==i&&(n=this.min=i[0],s=this.max=i[1]),n===s){const e=Math.abs(.01*n);n-=e,s+=e}t.domain=[n,s]}generateNodeData(){const{data:e,yData:t,xData:i,xScale:n,yScale:s}=this;if(!e)return;const r=!(n instanceof $m),o=r?0:n.bandwidth/2,a=[];for(let e=0;e<t.length;e++){const l=t[e],c=i[e];if(null==l)continue;const h=n.convert(r?n.toDomain(c):c)+o,u=void 0===l?NaN:s.convert(l);a.push({seriesDatum:{x:c,y:l},point:{x:h,y:u}})}return a}updateSelection(e){this.markerSelection.update(e)}updateNodes(){const{highlightedDatum:e,highlightStyle:t,marker:i}=this,{size:n,fill:s,stroke:r,strokeWidth:o}=t,a=i.formatter;this.markerSelection.each((t,l,c)=>{const h=l===e,u=h&&void 0!==s?s:i.fill,d=h&&void 0!==r?r:i.stroke,p=h&&void 0!==o?o:i.strokeWidth,g=h&&void 0!==n?n:i.size;let f;const{seriesDatum:m,point:y}=l;if(a){const e=0===c,t=c===this.markerSelectionData.length-1,i=m.y===this.min,n=m.y===this.max;f=a({datum:l,xValue:m.x,yValue:m.y,min:i,max:n,first:e,last:t,fill:u,stroke:d,strokeWidth:p,size:g,highlighted:h})}t.size=f&&null!=f.size?f.size:g,t.fill=f&&null!=f.fill?f.fill:u,t.stroke=f&&null!=f.stroke?f.stroke:d,t.strokeWidth=f&&null!=f.strokeWidth?f.strokeWidth:p,t.translationX=y.x,t.translationY=y.y,t.visible=f&&null!=f.enabled?f.enabled:i.enabled&&t.size>0})}updateLine(){const{linePath:e,yData:t,xData:i,xScale:n,yScale:s,line:r}=this,o=e.path;if(o.clear(),t.length<2)return;const a=!(n instanceof $m),l=t.length,c=a?0:n.bandwidth/2;let h=!0;for(let e=0;e<l;e++){const r=i[e],l=t[e],u=n.convert(a?n.toDomain(r):r)+c,d=void 0===l?NaN:s.convert(l);null==l?h=!0:h?(o.moveTo(u,d),h=!1):o.lineTo(u,d)}e.fill=void 0,e.stroke=r.stroke,e.strokeWidth=r.strokeWidth}updateXCrosshairLine(){var e;const{yScale:t,xCrosshairLine:i,highlightedDatum:n,crosshairs:{xLine:s}}=this;if(!s.enabled||null==n)return void(i.strokeWidth=0);i.y1=t.range[0],i.y2=t.range[1],i.x1=i.x2=0,i.stroke=s.stroke,i.strokeWidth=null!=(e=s.strokeWidth)?e:1,i.lineCap="round"===s.lineCap||"square"===s.lineCap?s.lineCap:void 0;const{lineDash:r}=s;i.lineDash=Array.isArray(r)?r:Gm(i.lineCap,s.lineDash),i.translationX=n.point.x}updateYCrosshairLine(){var e;const{xScale:t,yCrosshairLine:i,highlightedDatum:n,crosshairs:{yLine:s}}=this;if(!s.enabled||null==n)return void(i.strokeWidth=0);i.x1=t.range[0],i.x2=t.range[1],i.y1=i.y2=0,i.stroke=s.stroke,i.strokeWidth=null!=(e=s.strokeWidth)?e:1,i.lineCap="round"===s.lineCap||"square"===s.lineCap?s.lineCap:void 0;const{lineDash:r}=s;i.lineDash=Array.isArray(r)?r:Gm(i.lineCap,s.lineDash),i.translationY=n.point.y}getTooltipHtml(e){var t,i;const{dataType:n}=this,{seriesDatum:s}=e,r=s.y,o=s.x,a={content:this.formatNumericDatum(r),title:"array"===n||"object"===n?this.formatDatum(o):void 0},l=null==(i=null==(t=this.processedOptions)?void 0:t.tooltip)?void 0:i.renderer;return l?Lm(l({context:this.context,datum:s,yValue:r,xValue:o}),a):Lm(a)}};Xm.className="LineSparkline";var Zm=class{constructor(){this.enabled=!0,this.fontSize=8,this.fontFamily="Verdana, sans-serif",this.fontStyle=void 0,this.fontWeight=void 0,this.color="rgba(70, 70, 70, 1)"}},{extent:Qm}=hm._Util,Jm=class extends Zm{constructor(){super(...arguments),this.formatter=void 0,this.placement="insideEnd"}},ey=class extends _m{constructor(){super(),this.fill="rgb(124, 181, 236)",this.stroke="silver",this.strokeWidth=0,this.paddingInner=.1,this.paddingOuter=.2,this.valueAxisDomain=void 0,this.formatter=void 0,this.axisLine=new hm._Scene.Line,this.bandWidth=0,this.sparklineGroup=new hm._Scene.Group,this.rectGroup=new hm._Scene.Group,this.labelGroup=new hm._Scene.Group,this.rectSelection=hm._Scene.Selection.select(this.rectGroup,hm._Scene.Rect),this.labelSelection=hm._Scene.Selection.select(this.labelGroup,hm._Scene.Text),this.nodeSelectionData=[],this.label=new Jm,this.rootGroup.append(this.sparklineGroup),this.rectGroup.zIndex=50,this.axisLine.zIndex=500,this.labelGroup.zIndex=1500,this.sparklineGroup.append([this.rectGroup,this.axisLine,this.labelGroup]),this.axisLine.lineCap="round",this.label.enabled=!1}getNodeData(){return this.nodeSelectionData}update(){this.updateSelections(),this.updateNodes()}updateSelections(){const e=this.generateNodeData();e&&(this.nodeSelectionData=e,this.updateRectSelection(e),this.updateLabelSelection(e))}updateNodes(){this.updateRectNodes(),this.updateLabelNodes()}calculateStep(e){var t;const{xScale:i,paddingInner:n,paddingOuter:s,smallestInterval:r}=this;let o=(i.domain[1]-i.domain[0])/(null!=(t=null==r?void 0:r.x)?t:1)+1;const a=Math.min(o,50),l=a-1;return e/Math.max(1,2*s+l*n+a)}updateYScaleDomain(){const{yScale:e,yData:t,valueAxisDomain:i}=this,n=Qm(t);let s=0,r=1;void 0!==n&&(s=this.min=n[0],r=this.max=n[1]),s=s<0?s:0,r=r<0?0:r,i&&(i[1]<r&&(i[1]=r),i[0]>s&&(i[0]=s)),e.domain=i||[s,r]}updateRectSelection(e){this.rectSelection.update(e)}updateRectNodes(){const{highlightedDatum:e,formatter:t,fill:i,stroke:n,strokeWidth:s}=this,{fill:r,stroke:o,strokeWidth:a}=this.highlightStyle;this.rectSelection.each((l,c,h)=>{const u=c===e,d=u&&void 0!==r?r:i,p=u&&void 0!==o?o:n,g=u&&void 0!==a?a:s;let f;const{x:m,y,width:v,height:b,seriesDatum:C}=c;if(t){const e=0===h,i=h===this.nodeSelectionData.length-1,n=C.y===this.min,s=C.y===this.max;f=t({datum:c,xValue:C.x,yValue:C.y,width:v,height:b,min:n,max:s,first:e,last:i,fill:d,stroke:p,strokeWidth:g,highlighted:u})}l.fill=f&&f.fill||d,l.stroke=f&&f.stroke||p,l.strokeWidth=f&&f.strokeWidth||g,l.x=l.y=0,l.width=v,l.height=b,l.visible=l.height>0,l.translationX=m,l.translationY=y})}updateLabelSelection(e){this.labelSelection.update(e,e=>{e.tag=1,e.pointerEvents=hm._Scene.PointerEvents.None})}updateLabelNodes(){const{label:{enabled:e,fontStyle:t,fontWeight:i,fontSize:n,fontFamily:s,color:r}}=this;this.labelSelection.each((o,a)=>{const l=a.label;l&&e?(o.fontStyle=t,o.fontWeight=i,o.fontSize=n,o.fontFamily=s,o.textAlign=l.textAlign,o.textBaseline=l.textBaseline,o.text=l.text,o.x=l.x,o.y=l.y,o.fill=r,o.visible=!0):o.visible=!1})}getTooltipHtml(e){var t,i;const{dataType:n}=this,{seriesDatum:s}=e,r=s.y,o=s.x,a={content:this.formatNumericDatum(r),title:"array"===n||"object"===n?this.formatDatum(o):void 0},l=null==(i=null==(t=this.processedOptions)?void 0:t.tooltip)?void 0:i.renderer;return l?Lm(l({context:this.context,datum:s,yValue:r,xValue:o}),a):Lm(a)}formatLabelValue(e){return e%1!=0?e.toFixed(1):e.toFixed(0)}},{isNumber:ty}=cm._Util,{BandScale:iy}=cm._Scale,ny=class extends ey{updateYScaleRange(){const{seriesRect:e,yScale:t}=this;t.range=[0,e.width]}updateXScaleRange(){const{xScale:e,seriesRect:t,paddingOuter:i,paddingInner:n}=this;if(e instanceof iy)e.range=[0,t.height],e.paddingInner=n,e.paddingOuter=i;else{const s=this.calculateStep(t.height),r=s*i;this.bandWidth=s*(1-n),e.range=[r,t.height-r-this.bandWidth]}}updateAxisLine(){const{yScale:e,axis:t,axisLine:i,seriesRect:n}=this,{strokeWidth:s}=t;i.x1=0,i.x2=0,i.y1=0,i.y2=n.height,i.stroke=t.stroke,i.strokeWidth=s+(s%2==1?1:0);const r=e.convert(0);i.translationX=r}generateNodeData(){const{data:e,yData:t,xData:i,xScale:n,yScale:s,fill:r,stroke:o,strokeWidth:a,label:l}=this;if(!e)return;const{fontStyle:c,fontWeight:h,fontSize:u,fontFamily:d,color:p,formatter:g,placement:f}=l,m=[],y=s.convert(0),v=!(n instanceof iy);for(let e=0,l=t.length;e<l;e++){let l=t[e];const b=i[e],C=void 0===l;C&&(l=0);const w=n.convert(v?n.toDomain(b):b),S=Math.min(void 0===l?NaN:s.convert(l),y),x=Math.max(void 0===l?NaN:s.convert(l),y),E=v?this.bandWidth:n.bandwidth,A=x-S,M={x:y,y:w};let T;T=g?g({value:l}):void 0!==l&&ty(l)?this.formatLabelValue(l):"";const D=w+E/2;let I;const R="middle";let k;const P=void 0!==l&&l>=0,_=4;if("center"===f)I=S+A/2,k="center";else if("outsideEnd"===f)I=S+(P?A+_:-_),k=P?"start":"end";else if("insideEnd"===f){I=S+(P?A-_:_),k=P?"end":"start";const e=cm._Scene.Text.getTextSize(T,d).width||20;(P&&I<y+e||!P&&I>y-e)&&(I=y+_*(P?1:-1),k=P?"start":"end")}else I=y+_*(P?1:-1),k=P?"start":"end";m.push({x:S,y:w,width:A,height:E,fill:r,stroke:o,strokeWidth:a,seriesDatum:{x:b,y:C?void 0:l},point:M,label:{x:I,y:D,text:T,fontStyle:c,fontWeight:h,fontSize:u,fontFamily:d,textAlign:k,textBaseline:R,fill:p}})}return m}getDistance(e,t){return Math.abs(e.y-t.y)}};ny.className="BarSparkline";var{isNumber:sy}=um._Util,{BandScale:ry}=um._Scale,oy=class extends ey{updateYScaleRange(){const{seriesRect:e,yScale:t}=this;t.range=[e.height,0]}updateXScaleRange(){const{xScale:e,seriesRect:t,paddingOuter:i,paddingInner:n}=this;if(e instanceof ry)e.range=[0,t.width],e.paddingInner=n,e.paddingOuter=i;else{const s=this.calculateStep(t.width),r=s*i;this.bandWidth=s*(1-n),e.range=[r,t.width-r-this.bandWidth]}}updateAxisLine(){const{yScale:e,axis:t,axisLine:i,seriesRect:n}=this,{strokeWidth:s}=t;i.x1=0,i.x2=n.width,i.y1=0,i.y2=0,i.stroke=t.stroke,i.strokeWidth=s+(s%2==1?1:0);const r=e.convert(0);i.translationY=r}generateNodeData(){const{data:e,yData:t,xData:i,xScale:n,yScale:s,fill:r,stroke:o,strokeWidth:a,label:l}=this;if(!e)return;const{fontStyle:c,fontWeight:h,fontSize:u,fontFamily:d,color:p,formatter:g,placement:f}=l,m=[],y=s.convert(0),v=!(n instanceof ry);for(let e=0,l=t.length;e<l;e++){let l=t[e];const b=i[e],C=void 0===l;C&&(l=0);const w=Math.min(void 0===l?NaN:s.convert(l),y),S=n.convert(v?n.toDomain(b):b),x=Math.max(void 0===l?NaN:s.convert(l),y),E=v?this.bandWidth:n.bandwidth,A=x-w,M={x:S+E/2,y};let T;T=g?g({value:l}):void 0!==l&&sy(l)?this.formatLabelValue(l):"";const D=S+E/2;let I;const R="center";let k;const P=void 0!==l&&l>=0,_=2;if("center"===f)I=w+A/2,k="middle";else if("outsideEnd"===f)I=w+(P?-_:A+_),k=P?"bottom":"top";else if("insideEnd"===f){I=w+(P?_:A-_),k=P?"top":"bottom";const e=um._Scene.Text.getTextSize(T,d).height||10;(P&&I>y-e||!P&&I<y+e)&&(I=y+_*(P?-1:1),k=P?"bottom":"top")}else I=y+_*(P?-1:1),k=P?"bottom":"top";m.push({x:S,y:w,width:E,height:A,fill:r,stroke:o,strokeWidth:a,seriesDatum:{x:b,y:C?void 0:l},point:M,label:{x:D,y:I,text:T,fontStyle:c,fontWeight:h,fontSize:u,fontFamily:d,textAlign:R,textBaseline:k,fill:p}})}return m}};oy.className="ColumnSparkline";var{isNumber:ay}=dm._Util,ly=class{static create(e,t){const i=function(e="line"){switch(e){case"column":return new oy;case"bar":return new ny;case"area":return new Wm;default:return new Xm}}((e=dm._Util.deepClone(e)).type);return t&&(i.tooltip=t),function(e,t){my(e,"context",t.context,t),my(e,"width",t.width,t),my(e,"height",t.height,t),my(e,"container",t.container,t),my(e,"xKey",t.xKey,t),my(e,"yKey",t.yKey,t),t.padding&&function(e,t){my(e,"top",t.top,t),my(e,"right",t.right,t),my(e,"bottom",t.bottom,t),my(e,"left",t.left,t)}(e.padding,t.padding),t.axis&&function(e,t){my(e,"type",t.type,t),my(e,"stroke",t.stroke,t),my(e,"strokeWidth",t.strokeWidth,t)}(e.axis,t.axis),t.highlightStyle&&function(e,t){my(e,"fill",t.fill,t),my(e,"size",t.size,t),my(e,"stroke",t.stroke,t),my(e,"strokeWidth",t.strokeWidth,t)}(e.highlightStyle,t.highlightStyle)}(i,e),function(e,t){switch(t.type){case"bar":case"column":!function(e,t){my(e,"valueAxisDomain",t.valueAxisDomain,t),my(e,"fill",t.fill,t),my(e,"stroke",t.stroke,t),my(e,"strokeWidth",t.strokeWidth,t),my(e,"paddingInner",t.paddingInner,t),my(e,"paddingOuter",t.paddingOuter,t),my(e,"formatter",t.formatter,t),t.label&&function(e,t){my(e,"enabled",t.enabled,t),my(e,"fontStyle",t.fontStyle,t),my(e,"fontWeight",t.fontWeight,t),my(e,"fontSize",t.fontSize,t),my(e,"fontFamily",t.fontFamily,t),my(e,"textAlign",t.textAlign,t),my(e,"textBaseline",t.textBaseline,t),my(e,"color",t.color,t),my(e,"formatter",t.formatter,t),my(e,"placement",t.placement,t)}(e.label,t.label)}(e,t);break;case"area":!function(e,t){my(e,"fill",t.fill,t),t.marker&&cy(e.marker,t.marker),t.line&&hy(e.line,t.line),t.crosshairs&&uy(e.crosshairs,t.crosshairs)}(e,t);break;default:!function(e,t){t.marker&&cy(e.marker,t.marker),t.line&&hy(e.line,t.line),t.crosshairs&&uy(e.crosshairs,t.crosshairs)}(e,t)}}(i,e),e.data&&(i.data=e.data),i.processedOptions=e,i}};function cy(e,t){my(e,"enabled",t.enabled,t),my(e,"size",t.size,t),my(e,"shape",t.shape,t),my(e,"fill",t.fill,t),my(e,"stroke",t.stroke,t),my(e,"strokeWidth",t.strokeWidth,t),my(e,"formatter",t.formatter,t)}function hy(e,t){my(e,"stroke",t.stroke,t),my(e,"strokeWidth",t.strokeWidth,t)}function uy(e,t){e.xLine&&t.xLine&&dy(e.xLine,t.xLine),e.yLine&&t.yLine&&dy(e.yLine,t.yLine)}function dy(e,t){my(e,"enabled",t.enabled,t),my(e,"stroke",t.stroke,t),my(e,"strokeWidth",t.strokeWidth,t),my(e,"lineDash",t.lineDash,t),my(e,"lineCap",t.lineCap,t)}var py={},gy=(e,t,i)=>{if(ay(t))return!0;const n=`AG Charts: ${e} must be a number, the value you provided is not a valid number. Using the default of ${i}px.`;var s,r;return s=()=>console.warn(n),py[r=`${e} not a number`]||(s(),py[r]=!0),!1},fy={xOffset:gy,yOffset:gy};function my(e,t,i,n){if(t in n)if(t in e){const n=fy[t];(!n||n(t,i,e[t]))&&e[t]!==i&&(e[t]=i)}else console.warn(`Property ${t} does not exist on the target object.`)}var yy=class e extends sm.Component{constructor(){super(e.TEMPLATE)}init(e){let t=!0;const i=this.resizeObserverService.observeResize(this.getGui(),()=>{const{clientWidth:i,clientHeight:n}=this.getGui();if(0!==i&&0!==n)if(t){const s=((e,t)=>{for(var i in t||(t={}))ym.call(t,i)&&bm(e,i,t[i]);if(mm)for(var i of mm(t))vm.call(t,i)&&bm(e,i,t[i]);return e})({data:e.value,width:i,height:n,context:{data:e.data}},e.sparklineOptions);this.sparkline=ly.create(s,this.sparklineTooltipSingleton.getSparklineTooltip()),this.eSparkline.appendChild(this.sparkline.canvasElement),t=!1}else this.sparkline.width=i,this.sparkline.height=n});this.addDestroyFunc(()=>i())}refresh(e){return!!this.sparkline&&(this.sparkline.data=e.value,!0)}destroy(){this.sparkline&&this.sparkline.destroy(),super.destroy()}};yy.TEMPLATE='<div class="ag-sparkline-wrapper">\n            <span ref="eSparkline"></span>\n        </div>',Cm([(0,sm.RefSelector)("eSparkline")],yy.prototype,"eSparkline",2),Cm([(0,sm.Autowired)("resizeObserverService")],yy.prototype,"resizeObserverService",2),Cm([(0,sm.Autowired)("sparklineTooltipSingleton")],yy.prototype,"sparklineTooltipSingleton",2);var vy=yy,by=class extends pm.BeanStub{postConstruct(){this.tooltip=new Om}getSparklineTooltip(){return this.tooltip}destroyTooltip(){this.tooltip&&this.tooltip.destroy()}};Cm([pm.PostConstruct],by.prototype,"postConstruct",1),Cm([pm.PreDestroy],by.prototype,"destroyTooltip",1),by=Cm([(0,pm.Bean)("sparklineTooltipSingleton")],by);var Cy={version:"31.3.4",moduleName:nm.ModuleNames.SparklinesModule,beans:[by],userComponents:[{componentName:"agSparklineCellRenderer",componentClass:vy}],dependantModules:[D]},wy=i(98092),Sy=i(98092),xy=class extends Sy.BeanStub{constructor(){super(),this.allComponents=new Map}registerStatusPanel(e,t){this.allComponents.set(e,t)}unregisterStatusPanel(e){this.allComponents.delete(e)}unregisterAllComponents(){this.allComponents.clear()}getStatusPanel(e){return this.allComponents.get(e)}destroy(){this.unregisterAllComponents(),super.destroy()}};xy=u([(0,Sy.Bean)("statusBarService")],xy);var Ey=i(98092),Ay=class e extends Ey.Component{constructor(){super(e.TEMPLATE),this.compDestroyFunctions={}}postConstruct(){this.processStatusPanels(new Map),this.addManagedPropertyListeners(["statusBar"],this.handleStatusBarChanged.bind(this))}processStatusPanels(e){var t;const i=null==(t=this.gos.get("statusBar"))?void 0:t.statusPanels;if(i){const t=i.filter(e=>"left"===e.align);this.createAndRenderComponents(t,this.eStatusBarLeft,e);const n=i.filter(e=>"center"===e.align);this.createAndRenderComponents(n,this.eStatusBarCenter,e);const s=i.filter(e=>!e.align||"right"===e.align);this.createAndRenderComponents(s,this.eStatusBarRight,e)}else this.setDisplayed(!1)}handleStatusBarChanged(){var e;const t=null==(e=this.gos.get("statusBar"))?void 0:e.statusPanels,i=Array.isArray(t)&&t.length>0;this.setDisplayed(i);const n=new Map;i&&t.forEach(e=>{var t,i;const s=null!=(t=e.key)?t:e.statusPanel,r=this.statusBarService.getStatusPanel(s);if(null==r?void 0:r.refresh){const t=this.gos.addGridCommonParams(null!=(i=e.statusPanelParams)?i:{});r.refresh(t)&&(n.set(s,r),delete this.compDestroyFunctions[s],Ey._.removeFromParent(r.getGui()))}}),this.resetStatusBar(),i&&this.processStatusPanels(n)}resetStatusBar(){this.eStatusBarLeft.innerHTML="",this.eStatusBarCenter.innerHTML="",this.eStatusBarRight.innerHTML="",this.destroyComponents(),this.statusBarService.unregisterAllComponents()}destroyComponents(){Object.values(this.compDestroyFunctions).forEach(e=>e()),this.compDestroyFunctions={}}createAndRenderComponents(e,t,i){const n=[];e.forEach(e=>{const t=e.key||e.statusPanel,s=i.get(t);let r;if(s)r=Ey.AgPromise.resolve(s);else{const t={};if(r=this.userComponentFactory.getStatusPanelCompDetails(e,t).newAgStackInstance(),!r)return}n.push({key:t,promise:r})}),Ey.AgPromise.all(n.map(e=>e.promise)).then(()=>{n.forEach(e=>{e.promise.then(i=>{const n=()=>{this.getContext().destroyBean(i)};this.isAlive()?(this.statusBarService.registerStatusPanel(e.key,i),t.appendChild(i.getGui()),this.compDestroyFunctions[e.key]=n):n()})})})}};Ay.TEMPLATE='<div class="ag-status-bar">\n            <div ref="eStatusBarLeft" class="ag-status-bar-left" role="status"></div>\n            <div ref="eStatusBarCenter" class="ag-status-bar-center" role="status"></div>\n            <div ref="eStatusBarRight" class="ag-status-bar-right" role="status"></div>\n        </div>',u([(0,Ey.Autowired)("userComponentFactory")],Ay.prototype,"userComponentFactory",2),u([(0,Ey.Autowired)("statusBarService")],Ay.prototype,"statusBarService",2),u([(0,Ey.RefSelector)("eStatusBarLeft")],Ay.prototype,"eStatusBarLeft",2),u([(0,Ey.RefSelector)("eStatusBarCenter")],Ay.prototype,"eStatusBarCenter",2),u([(0,Ey.RefSelector)("eStatusBarRight")],Ay.prototype,"eStatusBarRight",2),u([Ey.PostConstruct],Ay.prototype,"postConstruct",1),u([Ey.PreDestroy],Ay.prototype,"destroyComponents",1);var My=Ay,Ty=i(98092),Dy=class e extends Ty.Component{constructor(){super(e.TEMPLATE)}setLabel(e,t){this.setDisplayed(!1);const i=this.localeService.getLocaleTextFunc();this.eLabel.innerHTML=i(e,t)}setValue(e){this.eValue.innerHTML=e}};Dy.TEMPLATE='<div class="ag-status-name-value">\n            <span ref="eLabel"></span>:&nbsp;\n            <span ref="eValue" class="ag-status-name-value-value"></span>\n        </div>',u([(0,Ty.RefSelector)("eLabel")],Dy.prototype,"eLabel",2),u([(0,Ty.RefSelector)("eValue")],Dy.prototype,"eValue",2);var Iy=Dy,Ry=i(98092),ky=class extends Iy{postConstruct(){"clientSide"===this.rowModel.getType()?(this.setLabel("totalAndFilteredRows","Rows"),this.addCssClass("ag-status-panel"),this.addCssClass("ag-status-panel-total-and-filtered-row-count"),this.setDisplayed(!0),this.addManagedListener(this.eventService,Ry.Events.EVENT_MODEL_UPDATED,this.onDataChanged.bind(this)),this.onDataChanged()):Ry._.warnOnce("agTotalAndFilteredRowCountComponent should only be used with the client side row model.")}onDataChanged(){const e=this.localeService.getLocaleTextFunc(),t=e("thousandSeparator",","),i=e("decimalSeparator","."),n=Ry._.formatNumberCommas(this.getFilteredRowCountValue(),t,i),s=Ry._.formatNumberCommas(this.getTotalRowCount(),t,i);if(n===s)this.setValue(n);else{const e=this.localeService.getLocaleTextFunc();this.setValue(`${n} ${e("of","of")} ${s}`)}}getFilteredRowCountValue(){let e=0;return this.rowModel.forEachNodeAfterFilter(t=>{t.group||e++}),e}getTotalRowCount(){let e=0;return this.rowModel.forEachNode(t=>{t.group||e++}),e}init(){}refresh(){return!0}destroy(){super.destroy()}};u([(0,Ry.Autowired)("rowModel")],ky.prototype,"rowModel",2),u([Ry.PostConstruct],ky.prototype,"postConstruct",1);var Py=i(98092),_y=class extends Iy{postConstruct(){if(this.setLabel("filteredRows","Filtered"),"clientSide"!==this.rowModel.getType())return void Py._.warnOnce("agFilteredRowCountComponent should only be used with the client side row model.");this.addCssClass("ag-status-panel"),this.addCssClass("ag-status-panel-filtered-row-count"),this.setDisplayed(!0);const e=this.onDataChanged.bind(this);this.addManagedListener(this.eventService,Py.Events.EVENT_MODEL_UPDATED,e),e()}onDataChanged(){const e=this.getTotalRowCountValue(),t=this.getFilteredRowCountValue(),i=this.localeService.getLocaleTextFunc(),n=i("thousandSeparator",","),s=i("decimalSeparator",".");this.setValue(Py._.formatNumberCommas(t,n,s)),this.setDisplayed(e!==t)}getTotalRowCountValue(){let e=0;return this.rowModel.forEachNode(t=>e+=1),e}getFilteredRowCountValue(){let e=0;return this.rowModel.forEachNodeAfterFilter(t=>{t.group||(e+=1)}),e}init(){}refresh(){return!0}destroy(){super.destroy()}};u([(0,Py.Autowired)("rowModel")],_y.prototype,"rowModel",2),u([Py.PostConstruct],_y.prototype,"postConstruct",1);var Ly=i(98092),Ny=class extends Iy{postConstruct(){this.setLabel("totalRows","Total Rows"),"clientSide"===this.rowModel.getType()?(this.addCssClass("ag-status-panel"),this.addCssClass("ag-status-panel-total-row-count"),this.setDisplayed(!0),this.addManagedListener(this.eventService,Ly.Events.EVENT_MODEL_UPDATED,this.onDataChanged.bind(this)),this.onDataChanged()):Ly._.warnOnce("agTotalRowCountComponent should only be used with the client side row model.")}onDataChanged(){const e=this.localeService.getLocaleTextFunc(),t=e("thousandSeparator",","),i=e("decimalSeparator",".");this.setValue(Ly._.formatNumberCommas(this.getRowCountValue(),t,i))}getRowCountValue(){let e=0;return this.rowModel.forEachLeafNode(t=>e+=1),e}init(){}refresh(){return!0}destroy(){super.destroy()}};u([(0,Ly.Autowired)("rowModel")],Ny.prototype,"rowModel",2),u([Ly.PostConstruct],Ny.prototype,"postConstruct",1);var Oy=i(98092),Fy=class extends Iy{postConstruct(){if(!this.isValidRowModel())return void console.warn("AG Grid: agSelectedRowCountComponent should only be used with the client and server side row model.");this.setLabel("selectedRows","Selected"),this.addCssClass("ag-status-panel"),this.addCssClass("ag-status-panel-selected-row-count"),this.onRowSelectionChanged();const e=this.onRowSelectionChanged.bind(this);this.addManagedListener(this.eventService,Oy.Events.EVENT_MODEL_UPDATED,e),this.addManagedListener(this.eventService,Oy.Events.EVENT_SELECTION_CHANGED,e)}isValidRowModel(){const e=this.rowModel.getType();return"clientSide"===e||"serverSide"===e}onRowSelectionChanged(){const e=this.selectionService.getSelectionCount();if(e<0)return this.setValue("?"),void this.setDisplayed(!0);const t=this.localeService.getLocaleTextFunc(),i=t("thousandSeparator",","),n=t("decimalSeparator",".");this.setValue(Oy._.formatNumberCommas(e,i,n)),this.setDisplayed(e>0)}init(){}refresh(){return!0}destroy(){super.destroy()}};u([(0,Oy.Autowired)("rowModel")],Fy.prototype,"rowModel",2),u([(0,Oy.Autowired)("selectionService")],Fy.prototype,"selectionService",2),u([Oy.PostConstruct],Fy.prototype,"postConstruct",1);var Gy=i(98092),By=class e extends Gy.Component{constructor(){super(e.TEMPLATE)}destroy(){super.destroy()}postConstruct(){this.isValidRowModel()?(this.avgAggregationComp.setLabel("avg","Average"),this.countAggregationComp.setLabel("count","Count"),this.minAggregationComp.setLabel("min","Min"),this.maxAggregationComp.setLabel("max","Max"),this.sumAggregationComp.setLabel("sum","Sum"),this.addManagedListener(this.eventService,Gy.Events.EVENT_RANGE_SELECTION_CHANGED,this.onRangeSelectionChanged.bind(this)),this.addManagedListener(this.eventService,Gy.Events.EVENT_MODEL_UPDATED,this.onRangeSelectionChanged.bind(this))):console.warn("AG Grid: agAggregationComponent should only be used with the client and server side row model.")}isValidRowModel(){const e=this.rowModel.getType();return"clientSide"===e||"serverSide"===e}init(e){this.params=e}refresh(e){return this.params=e,this.onRangeSelectionChanged(),!0}setAggregationComponentValue(e,t,i){var n;const s=this.getAllowedAggregationValueComponent(e);if(Gy._.exists(s)&&s){const e=this.localeService.getLocaleTextFunc(),n=e("thousandSeparator",","),r=e("decimalSeparator",".");s.setValue(Gy._.formatNumberTwoDecimalPlacesAndCommas(t,n,r)),s.setDisplayed(i)}else null==(n=this.getAggregationValueComponent(e))||n.setDisplayed(!1)}getAllowedAggregationValueComponent(e){const{aggFuncs:t}=this.params;return!t||t.includes(e)?this.getAggregationValueComponent(e):null}getAggregationValueComponent(e){return this[`${e}AggregationComp`]}onRangeSelectionChanged(){var e;const t=null==(e=this.rangeService)?void 0:e.getCellRanges();let i=0,n=0,s=0,r=null,o=null;const a={};if(t&&!Gy._.missingOrEmpty(t)&&this.rangeService)for(let e=0;e<t.length;e++){const l=t[e];let c=this.rangeService.getRangeStartRow(l);const h=this.rangeService.getRangeEndRow(l);for(;!Gy._.missing(c)&&c&&!this.rowPositionUtils.before(h,c)&&c&&l.columns;)l.columns.forEach(e=>{if(null===c)return;const t=this.cellPositionUtils.createId({rowPinned:c.rowPinned,column:e,rowIndex:c.rowIndex});if(a[t])return;a[t]=!0;const l=this.rowPositionUtils.getRowNode(c);if(Gy._.missing(l))return;let h=this.valueService.getValue(e,l);Gy._.missing(h)||""===h||(n++,"object"==typeof h&&"value"in h&&(h=h.value,""===h)||("string"==typeof h&&(h=Number(h)),"number"!=typeof h||isNaN(h)||(i+=h,(null===o||h>o)&&(o=h),(null===r||h<r)&&(r=h),s++)))}),c=this.cellNavigationService.getRowBelow(c)}const l=n>1,c=s>1;this.setAggregationComponentValue("count",n,l),this.setAggregationComponentValue("sum",i,c),this.setAggregationComponentValue("min",r,c),this.setAggregationComponentValue("max",o,c),this.setAggregationComponentValue("avg",i/s,c)}};By.TEMPLATE='<div class="ag-status-panel ag-status-panel-aggregations">\n            <ag-name-value ref="avgAggregationComp"></ag-name-value>\n            <ag-name-value ref="countAggregationComp"></ag-name-value>\n            <ag-name-value ref="minAggregationComp"></ag-name-value>\n            <ag-name-value ref="maxAggregationComp"></ag-name-value>\n            <ag-name-value ref="sumAggregationComp"></ag-name-value>\n        </div>',u([(0,Gy.Optional)("rangeService")],By.prototype,"rangeService",2),u([(0,Gy.Autowired)("valueService")],By.prototype,"valueService",2),u([(0,Gy.Autowired)("cellNavigationService")],By.prototype,"cellNavigationService",2),u([(0,Gy.Autowired)("rowModel")],By.prototype,"rowModel",2),u([(0,Gy.Autowired)("cellPositionUtils")],By.prototype,"cellPositionUtils",2),u([(0,Gy.Autowired)("rowPositionUtils")],By.prototype,"rowPositionUtils",2),u([(0,Gy.RefSelector)("sumAggregationComp")],By.prototype,"sumAggregationComp",2),u([(0,Gy.RefSelector)("countAggregationComp")],By.prototype,"countAggregationComp",2),u([(0,Gy.RefSelector)("minAggregationComp")],By.prototype,"minAggregationComp",2),u([(0,Gy.RefSelector)("maxAggregationComp")],By.prototype,"maxAggregationComp",2),u([(0,Gy.RefSelector)("avgAggregationComp")],By.prototype,"avgAggregationComp",2),u([Gy.PostConstruct],By.prototype,"postConstruct",1);var Vy=By,Hy={version:"31.3.4",moduleName:wy.ModuleNames.StatusBarModule,beans:[xy],agStackComponents:[{componentName:"AgStatusBar",componentClass:My},{componentName:"AgNameValue",componentClass:Iy}],userComponents:[{componentName:"agAggregationComponent",componentClass:Vy},{componentName:"agSelectedRowCountComponent",componentClass:Fy},{componentName:"agTotalRowCountComponent",componentClass:Ny},{componentName:"agFilteredRowCountComponent",componentClass:_y},{componentName:"agTotalAndFilteredRowCountComponent",componentClass:ky}],dependantModules:[D]},Uy=i(98092),zy=i(98092),Wy=Object.defineProperty,jy=Object.getOwnPropertyDescriptor,$y=(e,t,i,n)=>{for(var s,r=n>1?void 0:n?jy(t,i):t,o=e.length-1;o>=0;o--)(s=e[o])&&(r=(n?s(t,i,r):s(r))||r);return n&&r&&Wy(t,i,r),r},Ky=class extends zy.BeanStub{constructor(){super(...arguments),this.firstRow=-1,this.lastRow=-1,this.rowCount=-1,this.rowNodesByIndex={}}ensureRowHeightsValid(e,t,i,n){return!1}init(){this.rowHeight=this.gos.getRowHeightAsNumber(),this.addManagedListener(this.eventService,zy.Events.EVENT_VIEWPORT_CHANGED,this.onViewportChanged.bind(this)),this.addManagedPropertyListener("viewportDatasource",()=>this.updateDatasource()),this.addManagedPropertyListener("rowHeight",()=>{this.rowHeight=this.gos.getRowHeightAsNumber(),this.updateRowHeights()})}start(){this.updateDatasource()}isLastRowIndexKnown(){return!0}destroyDatasource(){this.viewportDatasource&&(this.viewportDatasource.destroy&&this.viewportDatasource.destroy(),this.rowRenderer.datasourceChanged(),this.firstRow=-1,this.lastRow=-1)}updateDatasource(){const e=this.gos.get("viewportDatasource");e&&this.setViewportDatasource(e)}getViewportRowModelPageSize(){return this.gos.get("viewportRowModelPageSize")}getViewportRowModelBufferSize(){return this.gos.get("viewportRowModelBufferSize")}calculateFirstRow(e){const t=this.getViewportRowModelBufferSize(),i=this.getViewportRowModelPageSize(),n=e-t;return n<0?0:Math.floor(n/i)*i}calculateLastRow(e){if(-1===e)return e;const t=this.getViewportRowModelBufferSize(),i=this.getViewportRowModelPageSize(),n=e+t,s=Math.ceil(n/i)*i,r=this.rowCount-1;return Math.min(s,r)}onViewportChanged(e){const t=this.calculateFirstRow(e.firstRow),i=this.calculateLastRow(e.lastRow);this.firstRow===t&&this.lastRow===i||(this.firstRow=t,this.lastRow=i,this.purgeRowsNotInViewport(),this.viewportDatasource&&this.viewportDatasource.setViewportRange(this.firstRow,this.lastRow))}purgeRowsNotInViewport(){Object.keys(this.rowNodesByIndex).forEach(e=>{const t=parseInt(e,10);if(t<this.firstRow||t>this.lastRow){if(this.isRowFocused(t))return;delete this.rowNodesByIndex[t]}})}isRowFocused(e){const t=this.focusService.getFocusCellToUseAfterRefresh();return!!t&&(null==t.rowPinned&&t.rowIndex===e)}setViewportDatasource(e){this.destroyDatasource(),this.viewportDatasource=e,this.rowCount=-1,e.init?e.init({setRowCount:this.setRowCount.bind(this),setRowData:this.setRowData.bind(this),getRow:this.getRow.bind(this)}):console.warn("AG Grid: viewport is missing init method.")}getType(){return"viewport"}getRow(e){return this.rowNodesByIndex[e]||(this.rowNodesByIndex[e]=this.createBlankRowNode(e)),this.rowNodesByIndex[e]}getRowNode(e){let t;return this.forEachNode(i=>{i.id===e&&(t=i)}),t}getRowCount(){return-1===this.rowCount?0:this.rowCount}getRowIndexAtPixel(e){return 0!==this.rowHeight?Math.floor(e/this.rowHeight):0}getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}updateRowHeights(){this.forEachNode(e=>{e.setRowHeight(this.rowHeight),e.setRowTop(this.rowHeight*e.rowIndex)});const e={type:zy.Events.EVENT_MODEL_UPDATED,newData:!1,newPage:!1,keepRenderedRows:!0,animate:!1};this.eventService.dispatchEvent(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}isEmpty(){return this.rowCount>0}isRowsToRender(){return this.rowCount>0}getNodesInRangeForSelection(e,t){const i=zy._.missing(e)?0:e.rowIndex,n=t.rowIndex,s=i<this.firstRow||i>this.lastRow,r=n<this.firstRow||n>this.lastRow;if(s||r)return[];const o=[],a=i<=n?n:i;for(let e=i<=n?i:n;e<=a;e++)o.push(this.rowNodesByIndex[e]);return o}forEachNode(e){let t=0;Object.keys(this.rowNodesByIndex).forEach(i=>{const n=parseInt(i,10),s=this.rowNodesByIndex[n];e(s,t),t++})}setRowData(e){zy._.iterateObject(e,(e,t)=>{const i=parseInt(e,10);if(i>=this.firstRow&&i<=this.lastRow){let e=this.rowNodesByIndex[i];zy._.missing(e)&&(e=this.createBlankRowNode(i),this.rowNodesByIndex[i]=e),e.setDataAndId(t,i.toString())}})}createBlankRowNode(e){const t=new zy.RowNode(this.beans);return t.setRowHeight(this.rowHeight),t.setRowTop(this.rowHeight*e),t.setRowIndex(e),t}setRowCount(e,t=!1){if(e===this.rowCount)return;this.rowCount=e,this.eventService.dispatchEventOnce({type:zy.Events.EVENT_ROW_COUNT_READY});const i={type:zy.Events.EVENT_MODEL_UPDATED,newData:!1,newPage:!1,keepRenderedRows:t,animate:!1};this.eventService.dispatchEvent(i)}isRowPresent(e){return!!this.getRowNode(e.id)}};$y([(0,zy.Autowired)("rowRenderer")],Ky.prototype,"rowRenderer",2),$y([(0,zy.Autowired)("focusService")],Ky.prototype,"focusService",2),$y([(0,zy.Autowired)("beans")],Ky.prototype,"beans",2),$y([zy.PostConstruct],Ky.prototype,"init",1),$y([zy.PreDestroy],Ky.prototype,"destroyDatasource",1),Ky=$y([(0,zy.Bean)("rowModel")],Ky);var Yy={version:"31.3.4",moduleName:Uy.ModuleNames.ViewportRowModelModule,rowModel:"viewport",beans:[Ky],dependantModules:[D]},qy=i(98092),Xy=i(98092),Zy=i(98092),Qy=i(98092),Jy=i(98092),ev=i(98092),tv=i(98092),iv=i(98092),nv=i(98092),sv=i(98092),rv=i(98092),ov=i(98092),av=i(98092),lv=i(98092),cv=i(98092),hv=i(98092),uv=i(98092),dv=i(98092),pv=i(98092),gv=i(98092),fv=i(98092),mv=i(98092),yv=i(98092),vv=i(98092),bv=i(98092),Cv=i(98092),wv=i(98092),Sv=i(98092),xv=i(98092),Ev=i(98092),Av=i(98092),Mv=i(98092),Tv=i(98092),Dv=i(98092),Iv=i(98092),Rv=i(98092),kv=i(98092),Pv=i(98092),_v=i(98092),Lv=i(98092),Nv=i(98092),Ov=i(98092),Fv=i(98092),Gv=i(98092),Bv=i(98092),Vv=i(98092),Hv=i(98092),Uv=i(98092),zv=i(98092),Wv=i(98092),jv=i(98092),$v=i(98092),Kv=i(98092),Yv=i(98092),qv=i(98092),Xv=i(98092),Zv=i(98092),Qv=i(98092),Jv=i(98092),eb=i(98092),tb=i(98092),ib=i(98092),nb=i(98092),sb=i(98092),rb=i(98092),ob=i(98092),ab=i(98092),lb=i(98092),cb=i(98092),hb=i(98092),ub=i(98092),db=i(98092),pb=i(98092),gb=i(98092),fb=i(98092),mb=i(98092),yb=i(98092),vb=i(98092),bb=i(98092),Cb=i(98092),wb=i(98092),Sb=i(98092),xb=i(98092),Eb=i(98092),Ab=i(98092),Mb=i(98092),Tb=i(98092),Db=i(98092),Ib=i(98092),Rb=i(98092),kb=i(98092),Pb=i(98092),_b=i(98092),Lb=i(98092),Nb=i(98092),Ob=i(98092),Fb=i(98092),Gb=i(98092),Bb=i(98092),Vb=i(98092),Hb=i(98092),Ub=i(98092),zb=i(98092),Wb=i(98092),jb=i(98092),$b=i(98092),Kb=i(98092),Yb=i(98092),qb=i(98092),Xb=i(98092),Zb=i(98092),Qb=i(98092),Jb=i(98092),eC=i(98092),tC=i(98092),iC=i(98092),nC=i(98092),sC=i(98092),rC=i(98092),oC=i(98092),aC=i(98092),lC=i(98092),cC=i(98092),hC=i(98092),uC=i(98092),dC=i(98092),pC=i(98092),gC=i(98092),fC=i(98092),mC=i(98092),yC=i(98092),vC=i(98092),bC=i(98092),CC=i(98092),wC=i(98092),SC=i(98092),xC=i(98092),EC=i(98092),AC=i(98092),MC=i(98092),TC=i(98092),DC=i(98092),IC=i(98092),RC=i(98092),kC=i(98092),PC=i(98092),_C=i(98092),LC=i(98092),NC=i(98092),OC=i(98092),FC=i(98092),GC=i(98092),BC=i(98092),VC=i(98092),HC=i(98092),UC=i(98092),zC=i(98092),WC=i(98092),jC=i(98092),$C=i(98092),KC=i(98092),YC=i(98092),qC=i(98092),XC=i(98092),ZC=i(98092),QC=i(98092),JC=i(98092),ew=i(98092),tw=i(98092),iw=i(98092),nw=i(98092),sw=i(98092),rw=i(98092),ow=i(98092),aw=i(98092),lw=i(98092),cw=i(98092),hw=i(98092),uw=i(98092),dw=i(98092),pw=i(98092),gw=i(98092),fw=i(98092),mw=i(98092),yw=i(98092),vw=i(98092),bw=i(98092),Cw=i(98092),ww=i(98092),Sw=i(98092),xw=i(98092),Ew=i(98092),Aw=i(98092);h(d,Ge,e.exports),p.ModuleRegistry.__registerModules([g.ClientSideRowModelModule,f.InfiniteRowModelModule,m.CsvExportModule,Fe,Ja,pl,Nh,jd,fp,Ip,cg,Tg,ut,kg,vc,Df,im,Zc,Cy,Hy,Yy],!1,void 0)},19270(e,t,i){"use strict";var n,s=Object.create,r=Object.defineProperty,o=Object.defineProperties,a=Object.getOwnPropertyDescriptor,l=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertyNames,h=Object.getOwnPropertySymbols,u=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,g=(e,t,i)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,f=(e,t)=>{for(var i in t||(t={}))d.call(t,i)&&g(e,i,t[i]);if(h)for(var i of h(t))p.call(t,i)&&g(e,i,t[i]);return e},m=(e,t)=>o(e,l(t)),y=(e,t,i,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let s of c(t))d.call(e,s)||s===i||r(e,s,{get:()=>t[s],enumerable:!(n=a(t,s))||n.enumerable});return e},v=(e,t,i)=>(i=null!=e?s(u(e)):{},y(!t&&e&&e.__esModule?i:r(i,"default",{value:e,enumerable:!0}),e)),b={};((e,t)=>{for(var i in t)r(e,i,{get:t[i],enumerable:!0})})(b,{AgGridReact:()=>ht,ChangeDetectionStrategyType:()=>ut,getInstance:()=>De,useGridCellEditor:()=>gt,useGridDate:()=>ft,useGridFilter:()=>mt,useGridFloatingFilter:()=>yt,useGridMenuItem:()=>vt,warnReactiveCustomComponents:()=>Ie}),e.exports=(n=b,y(r({},"__esModule",{value:!0}),n));var C=v(i(22155)),w=i(98092),S=v(i(22155)),x=i(98092),E=v(i(22155)),A=(0,i(22155).createContext)({setMethods:()=>{}}),M=(0,E.memo)(e=>{const{initialProps:t,addUpdateCallback:i,CustomComponentClass:n,setMethods:s}=e,[r,o]=(0,E.useState)(t);return(0,E.useEffect)(()=>{i(e=>o(e))},[]),E.default.createElement(A.Provider,{value:{setMethods:s}},E.default.createElement(n,f({},r)))}),T=i(22155),D=i(98092),I=0;function R(){return"agPortalKey_"+ ++I}var k=i(70316),P=i(32431),_=class{constructor(e,t,i,n){this.portal=null,this.oldPortal=null,this.reactComponent=e,this.portalManager=t,this.componentType=i,this.suppressFallbackMethods=!!n,this.statelessComponent=this.isStateless(this.reactComponent),this.key=R(),this.portalKey=R(),this.instanceCreated=this.isStatelessComponent()?D.AgPromise.resolve(!1):new D.AgPromise(e=>{this.resolveInstanceCreated=e})}getGui(){return this.eParentElement}getRootElement(){return this.eParentElement.firstChild}destroy(){return this.componentInstance&&"function"==typeof this.componentInstance.destroy&&this.componentInstance.destroy(),this.portalManager.destroyPortal(this.portal)}createParentElement(e){const t=this.portalManager.getComponentWrappingElement(),i=document.createElement(t||"div");return i.classList.add("ag-react-container"),e.reactContainer=i,i}addParentContainerStyleAndClasses(){this.componentInstance&&(this.componentInstance.getReactContainerStyle&&this.componentInstance.getReactContainerStyle()&&(D._.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())&&(D._.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"function"==typeof Symbol&&Symbol.for}isStateless(e){return"function"==typeof e&&!(e.prototype&&e.prototype.isReactComponent)||"object"==typeof e&&e.$$typeof===this.getMemoType()}hasMethod(e){const t=this.getFrameworkComponentInstance();return!!t&&null!=t[e]||this.fallbackMethodAvailable(e)}callMethod(e,t){const i=this.getFrameworkComponentInstance();if(this.isStatelessComponent())return this.fallbackMethod(e,t&&t[0]?t[0]:{});if(!i)return void setTimeout(()=>this.callMethod(e,t));const n=i[e];return n?n.apply(i,t):this.fallbackMethodAvailable(e)?this.fallbackMethod(e,t&&t[0]?t[0]:{}):void 0}addMethod(e,t){this[e]=t}init(e){return this.eParentElement=this.createParentElement(e),this.params=e,this.createOrUpdatePortal(e),new D.AgPromise(e=>this.createReactComponent(e))}createOrUpdatePortal(e){this.isStatelessComponent()||(this.ref=e=>{var t;this.componentInstance=e,this.addParentContainerStyleAndClasses(),null==(t=this.resolveInstanceCreated)||t.call(this,!0),this.resolveInstanceCreated=void 0},e.ref=this.ref),this.reactElement=this.createElement(this.reactComponent,m(f({},e),{key:this.key})),this.portal=(0,k.createPortal)(this.reactElement,this.eParentElement,this.portalKey)}createElement(e,t){return(0,T.createElement)(e,t)}createReactComponent(e){this.portalManager.mountReactPortal(this.portal,this,t=>{e(t)})}isNullValue(){return this.valueRenderedIsNull(this.params)}rendered(){return this.isStatelessComponent()&&this.statelessComponentRendered()||!(this.isStatelessComponent()||!this.getFrameworkComponentInstance())}valueRenderedIsNull(e){if(!this.componentType.cellRenderer)return!1;const t=console.error;try{return console.error=()=>{},""===(0,P.renderToStaticMarkup)((0,T.createElement)(this.reactComponent,e))}catch(e){}finally{console.error=t}return!1}refreshComponent(e){this.oldPortal=this.portal,this.createOrUpdatePortal(e),this.portalManager.updateReactPortal(this.oldPortal,this.portal)}fallbackMethod(e,t){const i=this[`${e}Component`];if(!this.suppressFallbackMethods&&i)return i.bind(this)(t)}fallbackMethodAvailable(e){return!this.suppressFallbackMethods&&!!this[`${e}Component`]}};function L(e,t,i){e.forEach(e=>{const n=t[e];n&&(i[e]=n)})}var N=class extends _{constructor(){super(...arguments),this.awaitUpdateCallback=new x.AgPromise(e=>{this.resolveUpdateCallback=e}),this.wrapperComponent=M}init(e){return this.sourceParams=e,super.init(this.getProps())}addMethod(){}getInstance(){return this.instanceCreated.then(()=>this.componentInstance)}getFrameworkComponentInstance(){return this}createElement(e,t){return super.createElement(this.wrapperComponent,{initialProps:t,CustomComponentClass:e,setMethods:e=>this.setMethods(e),addUpdateCallback:e=>{this.updateCallback=()=>(e(this.getProps()),new x.AgPromise(e=>{setTimeout(()=>{e()})})),this.resolveUpdateCallback()}})}setMethods(e){this.providedMethods=e,L(this.getOptionalMethods(),this.providedMethods,this)}getOptionalMethods(){return[]}getProps(){return m(f({},this.sourceParams),{key:this.key,ref:this.ref})}refreshProps(){return this.updateCallback?this.updateCallback():new x.AgPromise(e=>this.awaitUpdateCallback.then(()=>{this.updateCallback().then(()=>e())}))}},O=class extends N{constructor(){super(...arguments),this.date=null,this.onDateChange=e=>this.updateDate(e)}getDate(){return this.date}setDate(e){this.date=e,this.refreshProps()}refresh(e){this.sourceParams=e,this.refreshProps()}getOptionalMethods(){return["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled"]}updateDate(e){this.setDate(e),this.sourceParams.onDateChanged()}getProps(){const e=super.getProps();return e.date=this.date,e.onDateChange=this.onDateChange,delete e.onDateChanged,e}},F=class extends N{constructor(){super(...arguments),this.model=null,this.onModelChange=e=>this.updateModel(e),this.onUiChange=()=>this.sourceParams.filterChangedCallback()}isFilterActive(){return null!=this.model}doesFilterPass(e){return this.providedMethods.doesFilterPass(e)}getModel(){return this.model}setModel(e){return this.model=e,this.refreshProps()}refresh(e){return this.sourceParams=e,this.refreshProps(),!0}getOptionalMethods(){return["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onAnyFilterChanged"]}updateModel(e){this.setModel(e).then(()=>this.sourceParams.filterChangedCallback())}getProps(){const e=super.getProps();return e.model=this.model,e.onModelChange=this.onModelChange,e.onUiChange=this.onUiChange,delete e.filterChangedCallback,delete e.filterModifiedCallback,delete e.valueGetter,e}},G=i(98092);function B(e,t){e.parentFilterInstance(i=>{(i.setModel(t)||G.AgPromise.resolve()).then(()=>{e.filterParams.filterChangedCallback()})})}var V=class{constructor(e,t){this.floatingFilterParams=e,this.refreshProps=t,this.model=null,this.onModelChange=e=>this.updateModel(e)}getProps(){return m(f({},this.floatingFilterParams),{model:this.model,onModelChange:this.onModelChange})}onParentModelChanged(e){this.model=e,this.refreshProps()}refresh(e){this.floatingFilterParams=e,this.refreshProps()}setMethods(e){L(this.getOptionalMethods(),e,this)}getOptionalMethods(){return["afterGuiAttached"]}updateModel(e){this.model=e,this.refreshProps(),B(this.floatingFilterParams,e)}},H=class extends N{constructor(){super(...arguments),this.model=null,this.onModelChange=e=>this.updateModel(e)}onParentModelChanged(e){this.model=e,this.refreshProps()}refresh(e){this.sourceParams=e,this.refreshProps()}getOptionalMethods(){return["afterGuiAttached"]}updateModel(e){this.model=e,this.refreshProps(),B(this.sourceParams,e)}getProps(){const e=super.getProps();return e.model=this.model,e.onModelChange=this.onModelChange,e}},U=class extends N{refresh(e){this.sourceParams=e,this.refreshProps()}},z=class extends N{constructor(){super(...arguments),this.active=!1,this.expanded=!1,this.onActiveChange=e=>this.updateActive(e)}setActive(e){this.awaitSetActive(e)}setExpanded(e){this.expanded=e,this.refreshProps()}getOptionalMethods(){return["select","configureDefaults"]}awaitSetActive(e){return this.active=e,this.refreshProps()}updateActive(e){const t=this.awaitSetActive(e);e&&t.then(()=>this.sourceParams.onItemActivated())}getProps(){const e=super.getProps();return e.active=this.active,e.expanded=this.expanded,e.onActiveChange=this.onActiveChange,delete e.onItemActivated,e}},W=class extends N{refresh(e){this.sourceParams=e,this.refreshProps()}},j=class extends N{refresh(e){return this.sourceParams=e,this.refreshProps(),!0}},$=class extends N{constructor(){super(...arguments),this.onStateChange=e=>this.updateState(e)}refresh(e){return this.sourceParams=e,this.refreshProps(),!0}getState(){return this.state}updateState(e){this.state=e,this.refreshProps(),this.sourceParams.onStateUpdated()}getProps(){const e=super.getProps();return e.state=this.state,e.onStateChange=this.onStateChange,e}},K=class e{constructor(t,i,n){this.destroyed=!1,this.portals=[],this.hasPendingPortalUpdate=!1,this.wrappingElement=i||"div",this.refresher=t,this.maxComponentCreationTimeMs=n||e.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,i){this.portals=[...this.portals,e],this.waitForInstance(t,i),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,i=Date.now()){if(this.destroyed)t(null);else if(e.rendered())t(e);else{if(Date.now()-i>=this.maxComponentCreationTimeMs&&!this.hasPendingPortalUpdate)return e.isNullValue()?void t(e):(console.error(`AG Grid: React Component '${e.getReactComponentName()}' not created within ${this.maxComponentCreationTimeMs}ms.`),void console.error("    If the component is using `forwardRef` but not `useImperativeHandle`, add the following: `useImperativeHandle(ref, () => ({}));`"));window.setTimeout(()=>{this.waitForInstance(e,t,i)})}}};K.MAX_COMPONENT_CREATION_TIME_IN_MS=1e3;var Y=K,q=v(i(22155)).default.createContext({}),X=v(i(70316)),Z=(...e)=>e.filter(e=>null!=e&&""!==e).join(" "),Q=class e{constructor(...e){this.classesMap={},e.forEach(e=>{this.classesMap[e]=!0})}setClass(t,i){if(!!this.classesMap[t]==i)return this;const n=new e;return n.classesMap=f({},this.classesMap),n.classesMap[t]=i,n}toString(){return Object.keys(this.classesMap).filter(e=>this.classesMap[e]).join(" ")}},J=e=>"function"==typeof e&&!(e.prototype&&e.prototype.isReactComponent)||"object"==typeof e&&e.$$typeof===("function"==typeof Symbol&&Symbol.for?Symbol.for("react.memo"):60115),ee=null!=X.default.createRoot&&null!=X.default.flushSync,te=!1,ie=(e,t)=>{ee&&e&&!te?X.default.flushSync(t):t()};function ne(e,t,i){if(null==t||null==e)return t;if(e===t||0===t.length&&0===e.length)return e;if(i||0===e.length&&t.length>0||e.length>0&&0===t.length)return t;const n=[],s=[],r=new Map,o=new Map;for(let e=0;e<t.length;e++){const i=t[e];o.set(i.getInstanceId(),i)}for(let t=0;t<e.length;t++){const i=e[t];r.set(i.getInstanceId(),i),o.has(i.getInstanceId())&&n.push(i)}for(let e=0;e<t.length;e++){const i=t[e],n=i.getInstanceId();r.has(n)||s.push(i)}return n.length===e.length&&0===s.length?e:0===n.length&&s.length===t.length?t:0===n.length?s:0===s.length?n:[...n,...s]}var se=i(98092),re=v(i(22155)),oe=(e,t,i,n)=>{if(!e||e.componentFromFramework||t.isDestroyed())return;const s=e.newAgStackInstance();if(!s)return;let r,o,a=!1;return s.then(e=>{a?t.destroyBean(e):(r=e,o=r.getGui(),i.appendChild(o),ae(n,r))}),()=>{a=!0,r&&(o&&o.parentElement&&o.parentElement.removeChild(o),t.destroyBean(r),n&&ae(n,void 0))}},ae=(e,t)=>{e&&(e instanceof Function?e(t):e.current=t)},le=(0,re.forwardRef)((e,t)=>{var i;const n=(0,re.useContext)(q).context,s=(0,re.useRef)(null),r=(0,re.useRef)(null),o=(0,re.useRef)(null),a=(0,re.useRef)(null),l=(0,re.useRef)(null),c=(0,re.useRef)(),[h,u]=(0,re.useState)(),[d,p]=(0,re.useState)(),[g,m]=(0,re.useState)(),[y,v]=(0,re.useState)(()=>new Q),[b,C]=(0,re.useState)(()=>new Q("ag-hidden")),[w,S]=(0,re.useState)(()=>new Q("ag-hidden")),[x,E]=(0,re.useState)(()=>new Q("ag-invisible"));(0,re.useImperativeHandle)(t,()=>({refresh:()=>!1})),(0,re.useLayoutEffect)(()=>oe(h,n,r.current),[h]);const A=(0,re.useCallback)(t=>{if(s.current=t,!s.current)return n.destroyBean(c.current),void(c.current=null);const i={setInnerRenderer:(e,t)=>{u(e),m(t)},setChildCount:e=>p(e),addOrRemoveCssClass:(e,t)=>v(i=>i.setClass(e,t)),setContractedDisplayed:e=>S(t=>t.setClass("ag-hidden",!e)),setExpandedDisplayed:e=>C(t=>t.setClass("ag-hidden",!e)),setCheckboxVisible:e=>E(t=>t.setClass("ag-invisible",!e))};c.current=n.createBean(new se.GroupCellRendererCtrl),c.current.init(i,s.current,o.current,a.current,l.current,le,e)},[]),M=(0,re.useMemo)(()=>`ag-cell-wrapper ${y.toString()}`,[y]),T=(0,re.useMemo)(()=>`ag-group-expanded ${b.toString()}`,[b]),D=(0,re.useMemo)(()=>`ag-group-contracted ${w.toString()}`,[w]),I=(0,re.useMemo)(()=>`ag-group-checkbox ${x.toString()}`,[x]),R=h&&h.componentFromFramework,k=R?h.componentClass:void 0,P=null==h&&null!=g,_=se._.escapeString(g,!0);return re.default.createElement("span",f({className:M,ref:A},e.colDef?{}:{role:null==(i=c.current)?void 0:i.getCellAriaRole()}),re.default.createElement("span",{className:T,ref:a}),re.default.createElement("span",{className:D,ref:l}),re.default.createElement("span",{className:I,ref:o}),re.default.createElement("span",{className:"ag-group-value",ref:r},P&&re.default.createElement(re.default.Fragment,null,_),R&&re.default.createElement(k,f({},h.params))),re.default.createElement("span",{className:"ag-group-child-count"},d))}),ce=le,he=i(98092),ue=v(i(22155)),de=i(98092),pe=v(i(22155)),ge=v(i(22155)),fe=i(98092),me=v(i(22155)),ye=i(98092),ve=i(98092),be=v(i(22155)),Ce=v(i(22155)),we=i(98092),Se=(0,Ce.memo)(e=>{const{ctrl:t}=e,i=t.isAlive(),{context:n}=(0,Ce.useContext)(q),s=i?t.getColId():void 0,[r,o]=(0,Ce.useState)(),a=(0,Ce.useRef)(null),l=(0,Ce.useRef)(null),c=(0,Ce.useRef)(null),h=(0,Ce.useRef)();let u=(0,Ce.useRef)();i&&!u.current&&(u.current=new we.CssClassManager(()=>a.current));const d=(0,Ce.useCallback)(e=>{var n;if(a.current=e,!a.current||!i)return;const s={setWidth:e=>{a.current&&(a.current.style.width=e)},addOrRemoveCssClass:(e,t)=>u.current.addOrRemoveCssClass(e,t),setAriaSort:e=>{a.current&&(e?we._.setAriaSort(a.current,e):we._.removeAriaSort(a.current))},setUserCompDetails:e=>o(e),getUserCompInstance:()=>h.current||void 0};t.setComp(s,a.current,l.current,c.current);const r=t.getSelectAllGui();null==(n=l.current)||n.insertAdjacentElement("afterend",r)},[]);(0,Ce.useLayoutEffect)(()=>oe(r,n,c.current,h),[r]),(0,Ce.useEffect)(()=>{t.setDragSource(a.current)},[r]);const p=(0,Ce.useMemo)(()=>!(!(null==r?void 0:r.componentFromFramework)||!J(r.componentClass)),[r]),g=r&&r.componentFromFramework,y=r&&r.componentClass;return Ce.default.createElement("div",{ref:d,className:"ag-header-cell","col-id":s,role:"columnheader"},Ce.default.createElement("div",{ref:l,className:"ag-header-cell-resize",role:"presentation"}),Ce.default.createElement("div",{ref:c,className:"ag-header-cell-comp-wrapper",role:"presentation"},g&&p&&Ce.default.createElement(y,f({},r.params)),g&&!p&&Ce.default.createElement(y,m(f({},r.params),{ref:h}))))}),xe=v(i(22155)),Ee=(0,xe.memo)(e=>{const{context:t}=(0,xe.useContext)(q),{ctrl:i}=e,[n,s]=(0,xe.useState)(()=>new Q),[r,o]=(0,xe.useState)(()=>new Q),[a,l]=(0,xe.useState)("false"),[c,h]=(0,xe.useState)(),[u,d]=(0,xe.useState)(),p=(0,xe.useMemo)(()=>i.getColId(),[]),g=(0,xe.useRef)(null),y=(0,xe.useRef)(null),v=(0,xe.useRef)(),b=(0,xe.useCallback)(e=>{if(g.current=e,!g.current)return;const t={setWidth:e=>{g.current&&(g.current.style.width=e)},addOrRemoveCssClass:(e,t)=>s(i=>i.setClass(e,t)),setUserCompDetails:e=>d(e),setResizableDisplayed:e=>{o(t=>t.setClass("ag-hidden",!e)),l(e?"false":"true")},setAriaExpanded:e=>h(e),getUserCompInstance:()=>v.current||void 0};i.setComp(t,g.current,y.current)},[]);(0,xe.useLayoutEffect)(()=>oe(u,t,g.current),[u]),(0,xe.useEffect)(()=>{g.current&&i.setDragSource(g.current)},[u]);const C=(0,xe.useMemo)(()=>!(!(null==u?void 0:u.componentFromFramework)||!J(u.componentClass)),[u]),w=(0,xe.useMemo)(()=>"ag-header-group-cell "+n.toString(),[n]),S=(0,xe.useMemo)(()=>"ag-header-cell-resize "+r.toString(),[r]),x=u&&u.componentFromFramework,E=u&&u.componentClass;return xe.default.createElement("div",{ref:b,className:w,"col-id":p,role:"columnheader","aria-expanded":c},x&&C&&xe.default.createElement(E,f({},u.params)),x&&!C&&xe.default.createElement(E,m(f({},u.params),{ref:v})),xe.default.createElement("div",{ref:y,"aria-hidden":a,className:S}))}),Ae=v(i(22155)),Me=i(98092),Te=i(98092);function De(e,t){var i,n;(null!=(n=null==(i=null==e?void 0:e.getInstance)?void 0:i.call(e))?n:Te.AgPromise.resolve(void 0)).then(e=>t(e))}function Ie(){Te._.warnOnce("Using custom components without `reactiveCustomComponents = true` is deprecated.")}var Re=(0,Ae.memo)(e=>{const{context:t,gos:i}=(0,Ae.useContext)(q),[n,s]=(0,Ae.useState)(()=>new Q("ag-header-cell","ag-floating-filter")),[r,o]=(0,Ae.useState)(()=>new Q),[a,l]=(0,Ae.useState)(()=>new Q("ag-floating-filter-button","ag-hidden")),[c,h]=(0,Ae.useState)("false"),[u,d]=(0,Ae.useState)(),[p,g]=(0,Ae.useState)(1),y=(0,Ae.useRef)(null),v=(0,Ae.useRef)(null),b=(0,Ae.useRef)(null),C=(0,Ae.useRef)(null),w=(0,Ae.useRef)(),S=(0,Ae.useRef)(),x=e=>{null!=e&&w.current&&w.current(e)},{ctrl:E}=e,M=(0,Ae.useCallback)(e=>{if(y.current=e,!y.current)return;S.current=new Me.AgPromise(e=>{w.current=e});const t={addOrRemoveCssClass:(e,t)=>s(i=>i.setClass(e,t)),addOrRemoveBodyCssClass:(e,t)=>o(i=>i.setClass(e,t)),setButtonWrapperDisplayed:e=>{l(t=>t.setClass("ag-hidden",!e)),h(e?"false":"true")},setWidth:e=>{y.current&&(y.current.style.width=e)},setCompDetails:e=>d(e),getFloatingFilterComp:()=>S.current?S.current:null,setMenuIcon:e=>{var t;return null==(t=C.current)?void 0:t.appendChild(e)}};E.setComp(t,y.current,C.current,v.current)},[]);(0,Ae.useLayoutEffect)(()=>oe(u,t,v.current,x),[u]);const T=(0,Ae.useMemo)(()=>n.toString(),[n]),D=(0,Ae.useMemo)(()=>r.toString(),[r]),I=(0,Ae.useMemo)(()=>a.toString(),[a]),R=(0,Ae.useMemo)(()=>!!(u&&u.componentFromFramework&&J(u.componentClass)),[u]),k=(0,Ae.useMemo)(()=>i.get("reactiveCustomComponents"),[]),P=(0,Ae.useMemo)(()=>{if(u){if(k){const e=new V(u.params,()=>g(e=>e+1));return x(e),e}u.componentFromFramework&&Ie()}},[u]),_=null==P?void 0:P.getProps(),L=u&&u.componentFromFramework,N=u&&u.componentClass;return Ae.default.createElement("div",{ref:M,className:T,role:"gridcell"},Ae.default.createElement("div",{ref:v,className:D,role:"presentation"},L&&!k&&Ae.default.createElement(N,m(f({},u.params),{ref:R?()=>{}:x})),L&&k&&Ae.default.createElement(A.Provider,{value:{setMethods:e=>P.setMethods(e)}},Ae.default.createElement(N,f({},_)))),Ae.default.createElement("div",{ref:b,"aria-hidden":c,className:I,role:"presentation"},Ae.default.createElement("button",{ref:C,type:"button",className:"ag-button ag-floating-filter-button-button",tabIndex:-1})))}),ke=(0,be.memo)(e=>{const{ctrl:t}=e,{topOffset:i,rowHeight:n}=(0,be.useMemo)(()=>t.getTopAndHeight(),[]),s=t.getAriaRowIndex(),r=t.getHeaderRowClass(),[o,a]=(0,be.useState)(()=>n+"px"),[l,c]=(0,be.useState)(()=>i+"px"),h=(0,be.useRef)(null),u=(0,be.useRef)(null),[d,p]=(0,be.useState)(()=>t.getHeaderCtrls()),g=(0,be.useRef)(null),f=(0,be.useCallback)(e=>{if(g.current=e,!e)return;const i={setHeight:e=>a(e),setTop:e=>c(e),setHeaderCtrls:(e,t,i)=>{u.current=h.current,h.current=e;const n=ne(u.current,e,t);n!==u.current&&ie(i,()=>p(n))},setWidth:e=>{g.current&&(g.current.style.width=e)}};t.setComp(i,!1)},[]),m=(0,be.useMemo)(()=>({height:o,top:l}),[o,l]),y=(0,be.useCallback)(e=>{switch(t.getType()){case ve.HeaderRowType.COLUMN_GROUP:return be.default.createElement(Ee,{ctrl:e,key:e.getInstanceId()});case ve.HeaderRowType.FLOATING_FILTER:return be.default.createElement(Re,{ctrl:e,key:e.getInstanceId()});default:return be.default.createElement(Se,{ctrl:e,key:e.getInstanceId()})}},[]);return be.default.createElement("div",{ref:f,className:r,role:"row",style:m,"aria-rowindex":s},d.map(y))}),Pe=(0,me.memo)(e=>{const[t,i]=(0,me.useState)(!0),[n,s]=(0,me.useState)([]),{context:r}=(0,me.useContext)(q),o=(0,me.useRef)(null),a=(0,me.useRef)(null),l=(0,me.useRef)(null),c="left"===e.pinned,h="right"===e.pinned,u=!c&&!h,d=(0,me.useCallback)(t=>{if(o.current=t,!o.current)return r.destroyBean(l.current),void(l.current=null);const n={setDisplayed:i,setCtrls:e=>s(e),setCenterWidth:e=>{a.current&&(a.current.style.width=e)},setViewportScrollLeft:e=>{o.current&&(o.current.scrollLeft=e)},setPinnedContainerWidth:e=>{o.current&&(o.current.style.width=e,o.current.style.minWidth=e,o.current.style.maxWidth=e)}};l.current=r.createBean(new ye.HeaderRowContainerCtrl(e.pinned)),l.current.setComp(n,o.current)},[]),p=t?"":"ag-hidden",g=()=>n.map(e=>me.default.createElement(ke,{ctrl:e,key:e.getInstanceId()}));return me.default.createElement(me.default.Fragment,null,c&&me.default.createElement("div",{ref:d,className:"ag-pinned-left-header "+p,"aria-hidden":!t,role:"rowgroup"},g()),h&&me.default.createElement("div",{ref:d,className:"ag-pinned-right-header "+p,"aria-hidden":!t,role:"rowgroup"},g()),u&&me.default.createElement("div",{ref:d,className:"ag-header-viewport "+p,role:"presentation"},me.default.createElement("div",{ref:a,className:"ag-header-container",role:"rowgroup"},g())))}),_e=(0,ge.memo)(()=>{const[e,t]=(0,ge.useState)(()=>new Q),[i,n]=(0,ge.useState)(),{context:s}=(0,ge.useContext)(q),r=(0,ge.useRef)(null),o=(0,ge.useRef)(null),a=(0,ge.useCallback)(e=>{if(r.current=e,!e)return s.destroyBean(o.current),void(o.current=null);const i={addOrRemoveCssClass:(e,i)=>t(t=>t.setClass(e,i)),setHeightAndMinHeight:e=>n(e)};o.current=s.createBean(new fe.GridHeaderCtrl),o.current.setComp(i,r.current,r.current)},[]),l=(0,ge.useMemo)(()=>"ag-header "+e.toString(),[e]),c=(0,ge.useMemo)(()=>({height:i,minHeight:i}),[i]);return ge.default.createElement("div",{ref:a,className:l,style:c,role:"presentation"},ge.default.createElement(Pe,{pinned:"left"}),ge.default.createElement(Pe,{pinned:null}),ge.default.createElement(Pe,{pinned:"right"}))}),Le=i(22155),Ne=(e,t)=>{(0,Le.useEffect)(()=>{const i=t.current;if(i){const t=i.parentElement;if(t){const n=document.createComment(e);return t.insertBefore(n,i),()=>{t.removeChild(n)}}}},[e])},Oe=i(98092),Fe=v(i(22155)),Ge=v(i(22155)),Be=i(98092),Ve=i(98092),He=v(i(22155)),Ue=i(98092),ze=v(i(22155)),We=i(70316),je=i(22155),$e=(0,ze.memo)(e=>{const[t,i]=(0,ze.useState)(),{context:n,popupService:s,localeService:r,gos:o}=(0,ze.useContext)(q);return(()=>{const t=(0,je.useRef)(()=>{const{editDetails:t,cellCtrl:a,eParentCell:l}=e,{compDetails:c}=t,h=o.get("stopEditingWhenCellsLoseFocus"),u=n.createBean(new Ue.PopupEditorWrapper(c.params)),d=u.getGui();if(e.jsChildComp){const t=e.jsChildComp.getGui();t&&d.appendChild(t)}const p={column:a.getColumn(),rowNode:a.getRowNode(),type:"popupCellEditor",eventSource:l,ePopup:d,position:t.popupPosition,keepWithinBounds:!0},g=s.positionPopupByComponent.bind(s,p),f=r.getLocaleTextFunc(),m=s.addPopup({modal:h,eChild:d,closeOnEsc:!0,closedCallback:()=>{a.onPopupEditorClosed()},anchorToElement:l,positionCallback:g,ariaLabel:f("ariaLabelCellEditor","Cell Editor")}),y=m?m.hideFunc:void 0;return i(u),e.jsChildComp&&e.jsChildComp.afterGuiAttached&&e.jsChildComp.afterGuiAttached(),()=>{null!=y&&y(),n.destroyBean(u)}}),a=(0,je.useRef)(),l=(0,je.useRef)(!1),c=(0,je.useRef)(!1),[,h]=(0,je.useState)(0);l.current&&(c.current=!0),(0,je.useEffect)(()=>(l.current||(a.current=t.current(),l.current=!0),h(e=>e+1),()=>{c.current&&a.current&&a.current()}),[])})(),ze.default.createElement(ze.default.Fragment,null,t&&e.wrappedContent&&(0,We.createPortal)(e.wrappedContent,t.getGui()))}),Ke=i(22155),Ye=i(98092),qe=class{constructor(e,t){this.cellEditorParams=e,this.refreshProps=t,this.instanceCreated=new Ye.AgPromise(e=>{this.resolveInstanceCreated=e}),this.onValueChange=e=>this.updateValue(e),this.value=e.value}getProps(){return m(f({},this.cellEditorParams),{initialValue:this.cellEditorParams.value,value:this.value,onValueChange:this.onValueChange})}getValue(){return this.value}refresh(e){this.cellEditorParams=e,this.refreshProps()}setMethods(e){L(this.getOptionalMethods(),e,this)}getInstance(){return this.instanceCreated.then(()=>this.componentInstance)}setRef(e){var t;this.componentInstance=e,null==(t=this.resolveInstanceCreated)||t.call(this),this.resolveInstanceCreated=void 0}getOptionalMethods(){return["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached"]}updateValue(e){this.value=e,this.refreshProps()}},Xe=(e,t,i)=>{const n=e.compProxy;return He.default.createElement(He.default.Fragment,null,!n&&He.default.createElement(t,m(f({},e.compDetails.params),{ref:i})),n&&((e,t,i)=>{const{compProxy:n}=e;i(n);const s=n.getProps(),r=J(t);return He.default.createElement(A.Provider,{value:{setMethods:e=>n.setMethods(e)}},r&&He.default.createElement(t,f({},s)),!r&&He.default.createElement(t,m(f({},s),{ref:e=>n.setRef(e)})))})(e,t,i))},Ze=(0,He.memo)(e=>{const{context:t}=(0,He.useContext)(q),{cellCtrl:i,printLayout:n,editingRow:s}=e,r=i.getTabIndex(),o=i.getColumnIdSanitised(),a=i.getInstanceId(),[l,c]=(0,He.useState)(()=>i.isCellRenderer()?void 0:{compDetails:void 0,value:i.getValueToDisplay(),force:!1}),[h,u]=(0,He.useState)(),[d,p]=(0,He.useState)(1),[g,y]=(0,He.useState)(),[v,b]=(0,He.useState)(!1),[C,w]=(0,He.useState)(!1),[S,x]=(0,He.useState)(!1),[E,A]=(0,He.useState)(),M=(0,He.useMemo)(()=>i.isForceWrapper(),[i]),T=(0,He.useMemo)(()=>i.getCellAriaRole(),[i]),D=(0,He.useRef)(null),I=(0,He.useRef)(null),R=(0,He.useRef)(),k=(0,He.useRef)(),P=(0,He.useRef)(),_=(0,He.useRef)([]),L=(0,He.useRef)(),[N,O]=(0,He.useState)(0),F=(0,He.useCallback)(e=>{L.current=e,O(e=>e+1)},[]),G=M||null!=l&&(v||S||C),B=(0,He.useCallback)((e,t)=>{k.current=t,t&&(((e,t,i)=>{const n=i.getColumn();if(!e&&t.isPopup&&t.isPopup()){const e=`AG Grid: Found an issue in column ${n.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.`;Ve._.doOnce(()=>console.warn(e),"jsEditorComp-isPopup-"+i.getColumn().getColId())}if(e&&t.getPopupPosition&&null!=t.getPopupPosition()){const e=`AG Grid: Found an issue in column ${n.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.`;Ve._.doOnce(()=>console.warn(e),"jsEditorComp-getPopupPosition-"+i.getColumn().getColId())}})(e,t,i),t.isCancelBeforeStart&&t.isCancelBeforeStart()&&setTimeout(()=>{i.stopEditing(!0),i.focusCell(!0)}))},[i]),V=(0,He.useCallback)(e=>B(!0,e),[B]),H=(0,He.useCallback)(e=>B(!1,e),[B]);let U=(0,He.useRef)();U.current||(U.current=new Ve.CssClassManager(()=>D.current)),((e,t,i,n,s,r)=>{const{context:o}=(0,Ke.useContext)(q),a=(0,Ke.useCallback)(()=>{const e=s.current;if(!e)return;const t=e.getGui();t&&t.parentElement&&t.parentElement.removeChild(t),o.destroyBean(e),s.current=void 0},[]);(0,Ke.useEffect)(()=>{const n=null!=e,o=e&&e.compDetails&&!e.compDetails.componentFromFramework;if(!n||!o||t&&null==i)return void a();const l=e.compDetails;if(s.current){const t=s.current,i=!(null==t.refresh||0!=e.force)&&t.refresh(l.params);if(!0===i||void 0===i)return;a()}const c=l.newAgStackInstance();if(!c)return;const h=c.resolveNow(null,e=>e);if(!h)return;const u=h.getGui();u&&((t?i:r.current).appendChild(u),s.current=h)},[e,t,n]),(0,Ke.useEffect)(()=>a,[])})(l,G,L.current,N,R,D);const z=(0,He.useRef)();(0,He.useLayoutEffect)(()=>{const e=z.current,t=l;if(z.current=l,null==e||null==e.compDetails||null==t||null==t.compDetails)return;const i=e.compDetails,n=t.compDetails;i.componentClass==n.componentClass&&null!=I.current&&null!=I.current.refresh&&1!=I.current.refresh(n.params)&&p(e=>e+1)},[l]),(0,He.useLayoutEffect)(()=>{if(!h||h.compDetails.componentFromFramework)return;const e=h.compDetails,i=!0===h.popup,n=(e=>{const t=e.newAgStackInstance();if(t)return t.resolveNow(null,e=>e)})(e);if(!n)return;const s=n.getGui();if(B(i,n),!i){const e=(M?P:D).current;null==e||e.appendChild(s),n.afterGuiAttached&&n.afterGuiAttached()}return A(n),()=>{t.destroyBean(n),B(i,void 0),A(void 0),s&&s.parentElement&&s.parentElement.removeChild(s)}},[h]);const W=(0,He.useCallback)(e=>{if(P.current=e,!P.current)return _.current.forEach(e=>e()),void(_.current=[]);const n=e=>{var i;if(e){const n=e.getGui();null==(i=P.current)||i.insertAdjacentElement("afterbegin",n),_.current.push(()=>{t.destroyBean(e),Ve._.removeFromParent(n)})}return e};v&&n(i.createSelectionCheckbox()),S&&n(i.createDndSource()),C&&n(i.createRowDragComp())},[i,t,S,C,v]),j=(0,He.useCallback)(e=>{if(D.current=e,!D.current)return;if(!i)return;const t={addOrRemoveCssClass:(e,t)=>U.current.addOrRemoveCssClass(e,t),setUserStyles:e=>y(e),getFocusableElement:()=>D.current,setIncludeSelection:e=>b(e),setIncludeRowDrag:e=>w(e),setIncludeDndSource:e=>x(e),getCellEditor:()=>k.current||null,getCellRenderer:()=>I.current?I.current:R.current,getParentOfValue:()=>L.current?L.current:P.current?P.current:D.current,setRenderDetails:(e,t,i)=>{c(n=>(null==n?void 0:n.compDetails)!==e||(null==n?void 0:n.value)!==t||(null==n?void 0:n.force)!==i?{value:t,compDetails:e,force:i}:n)},setEditDetails:(e,t,i,n)=>{if(e){let s;n?s=new qe(e.params,()=>p(e=>e+1)):e.componentFromFramework&&Ie(),u({compDetails:e,popup:t,popupPosition:i,compProxy:s}),t||c(void 0)}else u(e=>{(null==e?void 0:e.compProxy)&&(k.current=void 0)})}},r=P.current||void 0;i.setComp(t,D.current,r,n,s)},[]),$=(0,He.useMemo)(()=>!!(l&&l.compDetails&&l.compDetails.componentFromFramework&&J(l.compDetails.componentClass)),[l]);(0,He.useLayoutEffect)(()=>{var e;D.current&&(U.current.addOrRemoveCssClass("ag-cell-value",!G),U.current.addOrRemoveCssClass("ag-cell-inline-editing",!!h&&!h.popup),U.current.addOrRemoveCssClass("ag-cell-popup-editing",!!h&&!!h.popup),U.current.addOrRemoveCssClass("ag-cell-not-inline-editing",!h||!!h.popup),null==(e=i.getRowCtrl())||e.setInlineEditingCss(!!h),i.shouldRestoreFocus()&&!i.isEditing()&&D.current.focus({preventScroll:!0}))});const K=()=>He.default.createElement(He.default.Fragment,null,null!=l&&((e,t,i,n,s,r,o)=>{const{compDetails:a,value:l}=e,c=!a,h=a&&a.componentFromFramework,u=a&&a.componentClass,d=(null==l?void 0:l.toString)?l.toString():l,p=()=>He.default.createElement(He.default.Fragment,null,c&&He.default.createElement(He.default.Fragment,null,d),h&&!r&&He.default.createElement(u,m(f({},a.params),{key:t,ref:n})),h&&r&&He.default.createElement(u,m(f({},a.params),{key:t})));return He.default.createElement(He.default.Fragment,null,s?He.default.createElement("span",{role:"presentation",id:`cell-${i}`,className:"ag-cell-value",ref:o},p()):p())})(l,d,a,I,G,$,F),null!=h&&((e,t,i,n,s,r)=>{const o=e.compDetails,a=o.componentClass,l=o.componentFromFramework&&!e.popup,c=o.componentFromFramework&&e.popup,h=!o.componentFromFramework&&e.popup;return He.default.createElement(He.default.Fragment,null,l&&Xe(e,a,t),c&&He.default.createElement($e,{editDetails:e,cellCtrl:s,eParentCell:n,wrappedContent:Xe(e,a,i)}),h&&r&&He.default.createElement($e,{editDetails:e,cellCtrl:s,eParentCell:n,jsChildComp:r}))})(h,H,V,D.current,i,E));return He.default.createElement("div",{ref:j,style:g,tabIndex:r,role:T,"col-id":o},G?He.default.createElement("div",{className:"ag-cell-wrapper",role:"presentation",ref:W},K()):K())}),Qe=(0,Ge.memo)(e=>{const{context:t,gos:i}=(0,Ge.useContext)(q),{rowCtrl:n,containerType:s}=e,r=n.getTabIndex(),o=(0,Ge.useRef)(n.getDomOrder()),a=n.isFullWidth(),l=n.getRowNode().displayed,[c,h]=(0,Ge.useState)(()=>l?n.getRowIndex():null),[u,d]=(0,Ge.useState)(()=>n.getRowId()),[p,g]=(0,Ge.useState)(()=>n.getBusinessKey()),[y,v]=(0,Ge.useState)(()=>n.getRowStyles()),b=(0,Ge.useRef)(null),C=(0,Ge.useRef)(null),[w,S]=(0,Ge.useState)(()=>null),[x,E]=(0,Ge.useState)(),[A,M]=(0,Ge.useState)(()=>l?n.getInitialRowTop(s):void 0),[T,D]=(0,Ge.useState)(()=>l?n.getInitialTransform(s):void 0),I=(0,Ge.useRef)(null),R=(0,Ge.useRef)(),k=(0,Ge.useRef)(!1),[P,_]=(0,Ge.useState)(0);(0,Ge.useEffect)(()=>{var e;if(k.current)return;if(!x)return;if(P>10)return;const t=null==(e=I.current)?void 0:e.firstChild;t?(n.setupDetailRowAutoHeight(t),k.current=!0):_(e=>e+1)},[x,P]);let L=(0,Ge.useRef)();L.current||(L.current=new Be.CssClassManager(()=>I.current));const N=(0,Ge.useCallback)(e=>{if(I.current=e,!I.current)return void n.unsetComp(s);if(!n.isAlive())return;const t={setTop:M,setTransform:D,addOrRemoveCssClass:(e,t)=>L.current.addOrRemoveCssClass(e,t),setDomOrder:e=>o.current=e,setRowIndex:h,setRowId:d,setRowBusinessKey:g,setUserStyles:v,setCellCtrls:(e,t)=>{C.current=b.current,b.current=e;const i=ne(C.current,e,o.current);i!==C.current&&ie(t,()=>S(i))},showFullWidth:e=>E(e),getFullWidthCellRenderer:()=>R.current,refreshFullWidth:e=>V.current?(E(t=>m(f({},t),{params:e()})),!0):!(!R.current||!R.current.refresh)&&R.current.refresh(e())};n.setComp(t,I.current,s)},[]);(0,Ge.useLayoutEffect)(()=>oe(x,t,I.current,R),[x]);const O=(0,Ge.useMemo)(()=>{const e={top:A,transform:T};return Object.assign(e,y),e},[A,T,y]),F=a&&x&&x.componentFromFramework,G=!a&&null!=w,B=(0,Ge.useMemo)(()=>!(!(null==x?void 0:x.componentFromFramework)||!J(x.componentClass)),[x]),V=(0,Ge.useRef)(!1);return(0,Ge.useEffect)(()=>{V.current=B&&!!x&&!!i.get("reactiveCustomComponents")},[B,x]),Ge.default.createElement("div",{ref:N,role:"row",style:O,"row-index":c,"row-id":u,"row-business-key":p,tabIndex:r},G&&(null==w?void 0:w.map(e=>Ge.default.createElement(Ze,{cellCtrl:e,editingRow:n.isEditing(),printLayout:n.isPrintLayout(),key:e.getInstanceId()}))),F&&(()=>{const e=x.componentClass;return Ge.default.createElement(Ge.default.Fragment,null,B&&Ge.default.createElement(e,f({},x.params)),!B&&Ge.default.createElement(e,m(f({},x.params),{ref:R})))})())}),Je=(0,Fe.memo)(e=>{const{context:t}=(0,Fe.useContext)(q),{name:i}=e,n=(0,Fe.useMemo)(()=>(0,Oe.getRowContainerTypeForName)(i),[i]),s=(0,Fe.useRef)(null),r=(0,Fe.useRef)(null),o=(0,Fe.useRef)([]),a=(0,Fe.useRef)([]),[l,c]=(0,Fe.useState)(()=>[]),h=(0,Fe.useRef)(!1),u=(0,Fe.useRef)(),d=(0,Fe.useMemo)(()=>Oe.RowContainerCtrl.getRowContainerCssClasses(i),[i]),p=(0,Fe.useMemo)(()=>Z(d.viewport),[d]),g=(0,Fe.useMemo)(()=>Z(d.container),[d]),f=i===Oe.RowContainerName.CENTER||i===Oe.RowContainerName.TOP_CENTER||i===Oe.RowContainerName.BOTTOM_CENTER||i===Oe.RowContainerName.STICKY_TOP_CENTER||i===Oe.RowContainerName.STICKY_BOTTOM_CENTER;Ne(" AG Row Container "+i+" ",f?s:r);const m=(0,Fe.useCallback)(()=>f?null!=s.current&&null!=r.current:null!=r.current,[]),y=(0,Fe.useCallback)(()=>f?null==s.current&&null==r.current:null==r.current,[]),v=(0,Fe.useCallback)(()=>{if(y()&&(t.destroyBean(u.current),u.current=null),m()){const e=e=>{const t=ne(a.current,o.current,h.current);t!==a.current&&(a.current=t,ie(e,()=>c(t)))},n={setViewportHeight:e=>{s.current&&(s.current.style.height=e)},setRowCtrls:({rowCtrls:t,useFlushSync:i})=>{const n=!!i&&o.current.length>0&&t.length>0;o.current=t,e(n)},setDomOrder:t=>{h.current!=t&&(h.current=t,e(!1))},setContainerWidth:e=>{r.current&&(r.current.style.width=e)}};u.current=t.createBean(new Oe.RowContainerCtrl(i)),u.current.setComp(n,r.current,s.current)}},[m,y]),b=(0,Fe.useCallback)(e=>{r.current=e,v()},[v]),C=(0,Fe.useCallback)(e=>{s.current=e,v()},[v]),w=()=>Fe.default.createElement("div",{className:g,ref:b,role:"rowgroup"},l.map(e=>Fe.default.createElement(Qe,{rowCtrl:e,containerType:n,key:e.getInstanceId()})));return Fe.default.createElement(Fe.default.Fragment,null,f?Fe.default.createElement("div",{className:p,ref:C,role:"presentation"},w()):w())}),et=(0,pe.memo)(()=>{const{context:e,agStackComponentsRegistry:t,resizeObserverService:i}=(0,pe.useContext)(q),[n,s]=(0,pe.useState)(""),[r,o]=(0,pe.useState)(0),[a,l]=(0,pe.useState)(0),[c,h]=(0,pe.useState)("0px"),[u,d]=(0,pe.useState)("0px"),[p,g]=(0,pe.useState)("100%"),[f,m]=(0,pe.useState)("0px"),[y,v]=(0,pe.useState)("0px"),[b,C]=(0,pe.useState)("100%"),[w,S]=(0,pe.useState)(""),[x,E]=(0,pe.useState)(""),[A,M]=(0,pe.useState)(null),[T,D]=(0,pe.useState)(""),[I,R]=(0,pe.useState)(null),[k,P]=(0,pe.useState)("ag-layout-normal");let _=(0,pe.useRef)();_.current||(_.current=new de.CssClassManager(()=>L.current));const L=(0,pe.useRef)(null),N=(0,pe.useRef)(null),O=(0,pe.useRef)(null),F=(0,pe.useRef)(null),G=(0,pe.useRef)(null),B=(0,pe.useRef)(null),V=(0,pe.useRef)(null),H=(0,pe.useRef)([]),U=(0,pe.useRef)([]);Ne(" AG Grid Body ",L),Ne(" AG Pinned Top ",N),Ne(" AG Sticky Top ",O),Ne(" AG Middle ",B),Ne(" AG Pinned Bottom ",V);const z=(0,pe.useCallback)(n=>{if(L.current=n,!L.current)return e.destroyBeans(H.current),U.current.forEach(e=>e()),H.current=[],void(U.current=[]);if(!e)return;const r=i=>{const n=t.getComponentClass(i),s=e.createBean(new n);return H.current.push(s),s},a=(e,t)=>{e.appendChild(t),U.current.push(()=>e.removeChild(t))};a(L.current,document.createComment(" AG Fake Horizontal Scroll ")),a(L.current,r("AG-FAKE-HORIZONTAL-SCROLL").getGui()),a(L.current,document.createComment(" AG Overlay Wrapper ")),a(L.current,r("AG-OVERLAY-WRAPPER").getGui()),G.current&&(a(G.current,document.createComment(" AG Fake Vertical Scroll ")),a(G.current,r("AG-FAKE-VERTICAL-SCROLL").getGui()));const c={setRowAnimationCssOnBodyViewport:s,setColumnCount:e=>{L.current&&de._.setAriaColCount(L.current,e)},setRowCount:e=>{L.current&&de._.setAriaRowCount(L.current,e)},setTopHeight:o,setBottomHeight:l,setStickyTopHeight:h,setStickyTopTop:d,setStickyTopWidth:g,setTopDisplay:S,setBottomDisplay:E,setColumnMovingCss:(e,t)=>_.current.addOrRemoveCssClass(e,t),updateLayoutClasses:P,setAlwaysVerticalScrollClass:M,setPinnedTopBottomOverflowY:D,setCellSelectableCss:(e,t)=>R(t?e:null),setBodyViewportWidth:e=>{B.current&&(B.current.style.width=e)},registerBodyViewportResizeListener:e=>{if(B.current){const t=i.observeResize(B.current,e);U.current.push(()=>t())}},setStickyBottomHeight:m,setStickyBottomBottom:v,setStickyBottomWidth:C},u=e.createBean(new de.GridBodyCtrl);H.current.push(u),u.setComp(c,L.current,B.current,N.current,V.current,O.current,F.current)},[]),W=(0,pe.useMemo)(()=>Z("ag-root","ag-unselectable",k),[k]),j=(0,pe.useMemo)(()=>Z("ag-body-viewport",n,k,A,I),[n,k,A,I]),$=(0,pe.useMemo)(()=>Z("ag-body",k),[k]),K=(0,pe.useMemo)(()=>Z("ag-floating-top",I),[I]),Y=(0,pe.useMemo)(()=>Z("ag-sticky-top",I),[I]),X=(0,pe.useMemo)(()=>Z("ag-sticky-bottom",I),[I]),Q=(0,pe.useMemo)(()=>Z("ag-floating-bottom",I),[I]),J=(0,pe.useMemo)(()=>({height:r,minHeight:r,display:w,overflowY:T}),[r,w,T]),ee=(0,pe.useMemo)(()=>({height:c,top:u,width:p}),[c,u,p]),te=(0,pe.useMemo)(()=>({height:f,bottom:y,width:b}),[f,y,b]),ie=(0,pe.useMemo)(()=>({height:a,minHeight:a,display:x,overflowY:T}),[a,x,T]),ne=e=>pe.default.createElement(Je,{name:e,key:`${e}-container`}),se=({section:e,children:t,className:i,style:n})=>pe.default.createElement("div",{ref:e,className:i,role:"presentation",style:n},t.map(ne));return pe.default.createElement("div",{ref:z,className:W,role:"treegrid"},pe.default.createElement(_e,null),se({section:N,className:K,style:J,children:[de.RowContainerName.TOP_LEFT,de.RowContainerName.TOP_CENTER,de.RowContainerName.TOP_RIGHT,de.RowContainerName.TOP_FULL_WIDTH]}),pe.default.createElement("div",{className:$,ref:G,role:"presentation"},se({section:B,className:j,children:[de.RowContainerName.LEFT,de.RowContainerName.CENTER,de.RowContainerName.RIGHT,de.RowContainerName.FULL_WIDTH]})),se({section:O,className:Y,style:ee,children:[de.RowContainerName.STICKY_TOP_LEFT,de.RowContainerName.STICKY_TOP_CENTER,de.RowContainerName.STICKY_TOP_RIGHT,de.RowContainerName.STICKY_TOP_FULL_WIDTH]}),se({section:F,className:X,style:te,children:[de.RowContainerName.STICKY_BOTTOM_LEFT,de.RowContainerName.STICKY_BOTTOM_CENTER,de.RowContainerName.STICKY_BOTTOM_RIGHT,de.RowContainerName.STICKY_BOTTOM_FULL_WIDTH]}),se({section:V,className:Q,style:ie,children:[de.RowContainerName.BOTTOM_LEFT,de.RowContainerName.BOTTOM_CENTER,de.RowContainerName.BOTTOM_RIGHT,de.RowContainerName.BOTTOM_FULL_WIDTH]}))}),tt=v(i(22155)),it=i(98092),nt=(0,tt.forwardRef)((e,t)=>{const{children:i,eFocusableElement:n,onTabKeyDown:s,gridCtrl:r,forceFocusOutWhenTabGuardsAreEmpty:o}=e,{context:a}=(0,tt.useContext)(q),l=(0,tt.useRef)(null),c=(0,tt.useRef)(null),h=(0,tt.useRef)(),u=e=>{const t=null==e?void 0:parseInt(e,10).toString();[l,c].forEach(e=>{var i,n;void 0===t?null==(i=e.current)||i.removeAttribute("tabindex"):null==(n=e.current)||n.setAttribute("tabindex",t)})};(0,tt.useImperativeHandle)(t,()=>({forceFocusOutOfContainer(e){var t;null==(t=h.current)||t.forceFocusOutOfContainer(e)}}));const d=(0,tt.useCallback)(()=>{if(!l.current&&!c.current)return a.destroyBean(h.current),void(h.current=null);if(l.current&&c.current){const e={setTabIndex:u};h.current=a.createBean(new it.TabGuardCtrl({comp:e,eTopGuard:l.current,eBottomGuard:c.current,eFocusableElement:n,onTabKeyDown:s,forceFocusOutWhenTabGuardsAreEmpty:o,focusInnerElement:e=>r.focusInnerElement(e)}))}},[]),p=(0,tt.useCallback)(e=>{l.current=e,d()},[d]),g=(0,tt.useCallback)(e=>{c.current=e,d()},[d]),f=e=>{const t="top"===e?it.TabGuardClassNames.TAB_GUARD_TOP:it.TabGuardClassNames.TAB_GUARD_BOTTOM;return tt.default.createElement("div",{className:`${it.TabGuardClassNames.TAB_GUARD} ${t}`,role:"presentation",ref:"top"===e?p:g})};return tt.default.createElement(tt.default.Fragment,null,f("top"),i,f("bottom"))}),st=(0,tt.memo)(nt),rt=(0,ue.memo)(({context:e})=>{const[t,i]=(0,ue.useState)(""),[n,s]=(0,ue.useState)(""),[r,o]=(0,ue.useState)(""),[a,l]=(0,ue.useState)(null),[c,h]=(0,ue.useState)(null),[u,d]=(0,ue.useState)(!1),[p,g]=(0,ue.useState)(),f=(0,ue.useRef)(null),m=(0,ue.useRef)(null),y=(0,ue.useRef)(),[v,b]=(0,ue.useState)(null),C=(0,ue.useRef)(()=>{}),w=(0,ue.useCallback)(()=>{},[]),S=(0,ue.useMemo)(()=>e.isDestroyed()?null:e.getBean("beans"),[e]);Ne(" AG Grid ",m);const x=(0,ue.useCallback)(t=>{if(m.current=t,!m.current)return e.destroyBean(f.current),void(f.current=null);if(e.isDestroyed())return;f.current=e.createBean(new he.GridCtrl);const n=f.current;C.current=n.focusInnerElement.bind(n);const s={destroyGridUi:()=>{},setRtlClass:i,forceFocusOutOfContainer:e=>{var t;null==(t=y.current)||t.forceFocusOutOfContainer(e)},updateLayoutClasses:o,getFocusableContainers:()=>{var e,t;const i=[],n=null==(e=m.current)?void 0:e.querySelector(".ag-root"),s=null==(t=m.current)?void 0:t.querySelector(".ag-side-bar:not(.ag-hidden)");return n&&i.push(n),s&&i.push(s),i},setCursor:l,setUserSelect:h};n.setComp(s,m.current,m.current),d(!0)},[]);(0,ue.useEffect)(()=>{if(!(p&&S&&f.current&&v&&m.current))return;const t=f.current,i=[],{agStackComponentsRegistry:n}=S,s=n.getComponentClass("AG-GRID-HEADER-DROP-ZONES"),r=n.getComponentClass("AG-SIDE-BAR"),o=n.getComponentClass("AG-STATUS-BAR"),a=n.getComponentClass("AG-WATERMARK"),l=n.getComponentClass("AG-PAGINATION"),c=[],h=m.current;if(t.showDropZones()&&s){const t=e.createBean(new s),n=t.getGui();h.insertAdjacentElement("afterbegin",n),c.push(n),i.push(t)}if(t.showSideBar()&&r){const t=e.createBean(new r),n=t.getGui(),s=v.querySelector(".ag-tab-guard-bottom");s&&(s.insertAdjacentElement("beforebegin",n),c.push(n)),i.push(t)}if(t.showStatusBar()&&o){const t=e.createBean(new o),n=t.getGui();h.insertAdjacentElement("beforeend",n),c.push(n),i.push(t)}if(l){const t=e.createBean(new l),n=t.getGui();h.insertAdjacentElement("beforeend",n),c.push(n),i.push(t)}if(t.showWatermark()&&a){const t=e.createBean(new a),n=t.getGui();h.insertAdjacentElement("beforeend",n),c.push(n),i.push(t)}return()=>{e.destroyBeans(i),c.forEach(e=>{e.parentElement&&e.parentElement.removeChild(e)})}},[p,v,S]);const E=(0,ue.useMemo)(()=>Z("ag-root-wrapper",t,n,r),[t,n,r]),A=(0,ue.useMemo)(()=>Z("ag-root-wrapper-body","ag-focus-managed",r),[r]),M=(0,ue.useMemo)(()=>({userSelect:null!=c?c:"",WebkitUserSelect:null!=c?c:"",cursor:null!=a?a:""}),[c,a]),T=(0,ue.useCallback)(e=>{y.current=e,g(null!==e)},[]);return ue.default.createElement("div",{ref:x,className:E,style:M,role:"presentation"},ue.default.createElement("div",{className:A,ref:b,role:"presentation"},u&&v&&S&&ue.default.createElement(q.Provider,{value:S},ue.default.createElement(st,{ref:T,eFocusableElement:v,onTabKeyDown:w,gridCtrl:f.current,forceFocusOutWhenTabGuardsAreEmpty:!0},ue.default.createElement(et,null)))))}),ot=e=>{var t,i;const n=(0,S.useRef)(),s=(0,S.useRef)(null),r=(0,S.useRef)(null),o=(0,S.useRef)([]),a=(0,S.useRef)([]),l=(0,S.useRef)(e),c=(0,S.useRef)(!1),[h,u]=(0,S.useState)(void 0),[,d]=(0,S.useState)(0),p=(0,S.useCallback)(t=>{if(s.current=t,!s.current)return o.current.forEach(e=>e()),void(o.current.length=0);const i=e.modules||[];r.current||(r.current=new Y(()=>d(e=>e+1),e.componentWrappingElement,e.maxComponentCreationTimeMs),o.current.push(()=>{var e;null==(e=r.current)||e.destroy(),r.current=null}));const l=w.ComponentUtil.combineAttributesAndGridOptions(e.gridOptions,e),h={providedBeanInstances:{frameworkComponentWrapper:new at(r.current,!!l.reactiveCustomComponents)},modules:i,frameworkOverrides:new ct},p=new w.GridCoreCreator;n.current=p.create(s.current,l,t=>{u(t),o.current.push(()=>{t.destroy()}),t.getBean(w.CtrlsService.NAME).whenReady(()=>{if(t.isDestroyed())return;const i=n.current;i&&e.setGridApi&&e.setGridApi(i,new w.ColumnApi(i))})},e=>{e.getBean(w.CtrlsService.NAME).whenReady(()=>{a.current.forEach(e=>e()),a.current.length=0,c.current=!0})},h)},[]),g=(0,S.useMemo)(()=>f({height:"100%"},e.containerStyle||{}),[e.containerStyle]),m=(0,S.useCallback)(e=>{c.current?e():a.current.push(e)},[]);return(0,S.useEffect)(()=>{const t=function(e,t){const i={};return Object.keys(t).forEach(n=>{const s=t[n];e[n]!==s&&(i[n]=s)}),i}(l.current,e);l.current=e,m(()=>{n.current&&w.ComponentUtil.processOnChange(t,n.current)})},[e]),S.default.createElement("div",{style:g,className:e.className,ref:p},h&&!h.isDestroyed()?S.default.createElement(rt,{context:h}):null,null!=(i=null==(t=r.current)?void 0:t.getPortals())?i:null)},at=class extends w.BaseComponentWrapper{constructor(e,t){super(),this.parent=e,this.reactiveCustomComponents=t}createWrapper(e,t){if(this.reactiveCustomComponents){const i=(e=>{switch(e){case"filter":return F;case"floatingFilterComponent":return H;case"dateComponent":return O;case"loadingOverlayComponent":return U;case"noRowsOverlayComponent":return W;case"statusPanel":return j;case"toolPanel":return $;case"menuItem":return z}})(t.propertyName);if(i)return new i(e,this.parent,t)}else switch(t.propertyName){case"filter":case"floatingFilterComponent":case"dateComponent":case"loadingOverlayComponent":case"noRowsOverlayComponent":case"statusPanel":case"toolPanel":case"menuItem":Ie()}const i=!t.cellRenderer&&"toolPanel"!==t.propertyName;return new _(e,this.parent,t,i)}},lt=(0,S.forwardRef)((e,t)=>{const{ctrlsFactory:i,context:n,gos:s,resizeObserverService:r,clientSideRowModel:o,serverSideRowModel:a}=(0,S.useContext)(q),[l,c]=(0,S.useState)(()=>new Q),[h,u]=(0,S.useState)(()=>new Q),[d,p]=(0,S.useState)(),[g,y]=(0,S.useState)(),v=(0,S.useRef)(),b=(0,S.useRef)(null),C=(0,S.useRef)(),x=(0,S.useMemo)(()=>w.ModuleRegistry.__getGridRegisteredModules(e.api.getGridId()),[e]),E=(0,S.useMemo)(()=>l.toString()+" ag-details-row",[l]),A=(0,S.useMemo)(()=>h.toString()+" ag-details-grid",[h]);t&&(0,S.useImperativeHandle)(t,()=>({refresh(){var e,t;return null!=(t=null==(e=v.current)?void 0:e.refresh())&&t}})),e.template&&w._.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 M=(0,S.useCallback)(t=>{if(b.current=t,!b.current)return n.destroyBean(v.current),void(C.current&&C.current());const l={addOrRemoveCssClass:(e,t)=>c(i=>i.setClass(e,t)),addOrRemoveDetailGridCssClass:(e,t)=>u(i=>i.setClass(e,t)),setDetailGrid:e=>p(e),setRowData:e=>y(e),getGui:()=>b.current},h=i.getInstance("detailCellRenderer");if(h&&(n.createBean(h),h.init(l,e),v.current=h,s.get("detailRowAutoHeight"))){const t=()=>{if(null==b.current)return;const t=b.current.clientHeight;null!=t&&t>0&&setTimeout(()=>{e.node.setRowHeight(t),o?o.onRowHeightChanged():a&&a.onRowHeightChanged()},0)};C.current=r.observeResize(b.current,t),t()}},[]),T=(0,S.useCallback)((e,t)=>{var i;null==(i=v.current)||i.registerDetailWithMaster(e,t)},[]);return S.default.createElement("div",{className:E,ref:M},d&&S.default.createElement(ot,m(f({className:A},d),{modules:x,rowData:g,setGridApi:T})))}),ct=class extends w.VanillaFrameworkOverrides{constructor(){super("react"),this.frameworkComponents={agGroupCellRenderer:ce,agGroupRowRenderer:ce,agDetailCellRenderer:lt},this.wrapIncoming=(e,t)=>{return"ensureVisible"===t?(i=e,te||setTimeout(()=>te=!1,0),te=!0,i()):e();var i},this.renderingEngine="react"}frameworkComponent(e){return this.frameworkComponents[e]}isFrameworkComponent(e){if(!e)return!1;const t=e.prototype;return!(t&&"getGui"in t)}},ht=class extends C.Component{constructor(){super(...arguments),this.apiListeners=[],this.setGridApi=(e,t)=>{this.api=e,this.columnApi=t,this.apiListeners.forEach(t=>t(e))}}registerApiListener(e){this.apiListeners.push(e)}componentWillUnmount(){this.apiListeners.length=0}render(){return C.default.createElement(ot,m(f({},this.props),{setGridApi:this.setGridApi}))}},ut=(e=>(e.IdentityCheck="IdentityCheck",e.DeepValueCheck="DeepValueCheck",e.NoCheck="NoCheck",e))(ut||{}),dt=i(22155);function pt(e){const{setMethods:t}=(0,dt.useContext)(A);t(e)}function gt(e){pt(e)}function ft(e){return pt(e)}function mt(e){return pt(e)}function yt(e){pt(e)}function vt(e){pt(e)}},32535(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(28825),s=i(38994),r=i(28261),o=i(36023),a=i(28425),l=i(86660),c="errorMessage",h=new n.Name("emUsed"),u={required:"missingProperty",dependencies:"property",dependentRequired:"property"},d=/\$\{[^}]+\}/,p=/\$\{([^}]+)\}/g,g=/^""\s*\+\s*|\s*\+\s*""$/g;const f=(e,t={})=>{if(!e.opts.allErrors)throw new Error("ajv-errors: Ajv option allErrors must be true");if(e.opts.jsPropertySyntax)throw new Error("ajv-errors: ajv option jsPropertySyntax is not supported");return e.addKeyword(function(e){return{keyword:c,schemaType:["string","object"],post:!0,code(t){const{gen:i,data:f,schema:m,schemaValue:y,it:v}=t;if(!1===v.createErrors)return;const b=m,C=s.strConcat(l.default.instancePath,v.errorPath);function w(e,t){return s.and(n._`${e}.keyword !== ${c}`,n._`!${e}.${h}`,n._`${e}.instancePath === ${C}`,n._`${e}.keyword in ${t}`,n._`${e}.schemaPath.indexOf(${v.errSchemaPath}) === 0`,n._`/^\\/[^\\/]*$/.test(${e}.schemaPath.slice(${v.errSchemaPath.length}))`)}function S(e,t){const n=[];for(const i in e){const e=t[i];d.test(e)&&n.push([i,E(e)])}return i.object(...n)}function x(e){return d.test(e)?new r._Code(r.safeStringify(e).replace(p,(e,t)=>`" + JSON.stringify(${o.getData(t,v)}) + "`).replace(g,"")):n.stringify(e)}function E(e){return n._`function(){return ${x(e)}}`}i.if(n._`${l.default.errors} > 0`,()=>{if("object"==typeof b){const[r,o]=function(e){let t,i;for(const n in e){if("properties"===n||"items"===n)continue;const s=e[n];if("object"==typeof s){t||(t={});const e=t[n]={};for(const t in s)e[t]=[]}else i||(i={}),i[n]=[]}return[t,i]}(b);o&&function(s){const r=i.const("emErrors",n.stringify(s)),o=i.const("templates",S(s,m));i.forOf("err",l.default.vErrors,e=>i.if(w(e,r),()=>i.code(n._`${r}[${e}.keyword].push(${e})`).assign(n._`${e}.${h}`,!0)));const{singleError:c}=e;if(c){const e=i.let("message",n._`""`),s=i.let("paramsErrors",n._`[]`);u(t=>{i.if(e,()=>i.code(n._`${e} += ${"string"==typeof c?c:";"}`)),i.code(n._`${e} += ${d(t)}`),i.assign(s,n._`${s}.concat(${r}[${t}])`)}),a.reportError(t,{message:e,params:n._`{errors: ${s}}`})}else u(e=>a.reportError(t,{message:d(e),params:n._`{errors: ${r}[${e}]}`}));function u(e){i.forIn("key",r,t=>i.if(n._`${r}[${t}].length`,()=>e(t)))}function d(e){return n._`${e} in ${o} ? ${o}[${e}]() : ${y}[${e}]`}}(o),r&&function(e){const s=i.const("emErrors",n.stringify(e)),r=[];for(const t in e)r.push([t,S(e[t],m[t])]);const o=i.const("templates",i.object(...r)),c=i.scopeValue("obj",{ref:u,code:n.stringify(u)}),d=i.let("emPropParams"),p=i.let("emParamsErrors");i.forOf("err",l.default.vErrors,e=>i.if(w(e,s),()=>{i.assign(d,n._`${c}[${e}.keyword]`),i.assign(p,n._`${s}[${e}.keyword][${e}.params[${d}]]`),i.if(p,()=>i.code(n._`${p}.push(${e})`).assign(n._`${e}.${h}`,!0))})),i.forIn("key",s,e=>i.forIn("keyProp",n._`${s}[${e}]`,r=>{i.assign(p,n._`${s}[${e}][${r}]`),i.if(n._`${p}.length`,()=>{const s=i.const("tmpl",n._`${o}[${e}] && ${o}[${e}][${r}]`);a.reportError(t,{message:n._`${s} ? ${s}() : ${y}[${e}][${r}]`,params:n._`{errors: ${p}}`})})}))}(r),function(e){const{props:r,items:o}=e;if(!r&&!o)return;const u=n._`typeof ${f} == "object"`,d=n._`Array.isArray(${f})`,p=i.let("emErrors");let g,v;const b=i.let("templates");function w(e,t){i.assign(p,n.stringify(e)),i.assign(b,S(e,t))}r&&o?(g=i.let("emChildKwd"),i.if(u),i.if(d,()=>{w(o,m.items),i.assign(g,n.str`items`)},()=>{w(r,m.properties),i.assign(g,n.str`properties`)}),v=n._`[${g}]`):o?(i.if(d),w(o,m.items),v=n._`.items`):r&&(i.if(s.and(u,s.not(d))),w(r,m.properties),v=n._`.properties`),i.forOf("err",l.default.vErrors,e=>function(e,t,r){i.if(s.and(n._`${e}.keyword !== ${c}`,n._`!${e}.${h}`,n._`${e}.instancePath.indexOf(${C}) === 0`),()=>{const s=i.scopeValue("pattern",{ref:/^\/([^/]*)(?:\/|$)/,code:n._`new RegExp("^\\\/([^/]*)(?:\\\/|$)")`}),o=i.const("emMatches",n._`${s}.exec(${e}.instancePath.slice(${C}.length))`),a=i.const("emChild",n._`${o} && ${o}[1].replace(/~1/g, "/").replace(/~0/g, "~")`);i.if(n._`${a} !== undefined && ${a} in ${t}`,()=>r(a))})}(e,p,t=>i.code(n._`${p}[${t}].push(${e})`).assign(n._`${e}.${h}`,!0))),i.forIn("key",p,e=>i.if(n._`${p}[${e}].length`,()=>{a.reportError(t,{message:n._`${e} in ${b} ? ${b}[${e}]() : ${y}${v}[${e}]`,params:n._`{errors: ${p}[${e}]}`}),i.assign(n._`${l.default.vErrors}[${l.default.errors}-1].instancePath`,n._`${C} + "/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`)})),i.endIf()}(function({properties:e,items:t}){const i={};if(e){i.props={};for(const t in e)i.props[t]=[]}if(t){i.items={};for(let e=0;e<t.length;e++)i.items[e]=[]}return i}(b))}const r="string"==typeof b?b:b._;r&&function(e){const r=i.const("emErrs",n._`[]`);i.forOf("err",l.default.vErrors,e=>i.if(function(e){return s.and(n._`${e}.keyword !== ${c}`,n._`!${e}.${h}`,s.or(n._`${e}.instancePath === ${C}`,s.and(n._`${e}.instancePath.indexOf(${C}) === 0`,n._`${e}.instancePath[${C}.length] === "/"`)),n._`${e}.schemaPath.indexOf(${v.errSchemaPath}) === 0`,n._`${e}.schemaPath[${v.errSchemaPath}.length] === "/"`)}(e),()=>i.code(n._`${r}.push(${e})`).assign(n._`${e}.${h}`,!0))),i.if(n._`${r}.length`,()=>a.reportError(t,{message:x(e),params:n._`{errors: ${r}}`}))}(r),e.keepErrors||function(){const e=i.const("emErrs",n._`[]`);i.forOf("err",l.default.vErrors,t=>i.if(n._`!${t}.${h}`,()=>i.code(n._`${e}.push(${t})`))),i.assign(l.default.vErrors,e).assign(l.default.errors,n._`${e}.length`)}()})},metaSchema:{anyOf:[{type:"string"},{type:"object",properties:{properties:{$ref:"#/$defs/stringMap"},items:{$ref:"#/$defs/stringList"},required:{$ref:"#/$defs/stringOrMap"},dependencies:{$ref:"#/$defs/stringOrMap"}},additionalProperties:{type:"string"}}],$defs:{stringMap:{type:"object",additionalProperties:{type:"string"}},stringOrMap:{anyOf:[{type:"string"},{$ref:"#/$defs/stringMap"}]},stringList:{type:"array",items:{type:"string"}}}}}}(t))};t.default=f,e.exports=f,e.exports.default=f},5888(e,t){"use strict";function i(e,t){return{validate:e,compare:t}}Object.defineProperty(t,"__esModule",{value:!0}),t.formatNames=t.fastFormats=t.fullFormats=void 0,t.fullFormats={date:i(r,o),time:i(l(!0),c),"date-time":i(d(!0),p),"iso-time":i(l(),h),"iso-date-time":i(d(),g),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function(e){return f.test(e)&&m.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:function(e){if(b.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}},uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:function(e){return y.lastIndex=0,y.test(e)},int32:{type:"number",validate:function(e){return Number.isInteger(e)&&e<=2147483647&&e>=-2147483648}},int64:{type:"number",validate:function(e){return Number.isInteger(e)}},float:{type:"number",validate:v},double:{type:"number",validate:v},password:!0,binary:!0},t.fastFormats={...t.fullFormats,date:i(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,o),time:i(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,c),"date-time":i(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,p),"iso-time":i(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,h),"iso-date-time":i(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,g),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},t.formatNames=Object.keys(t.fullFormats);const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,s=[0,31,28,31,30,31,30,31,31,30,31,30,31];function r(e){const t=n.exec(e);if(!t)return!1;const i=+t[1],r=+t[2],o=+t[3];return r>=1&&r<=12&&o>=1&&o<=(2===r&&function(e){return e%4==0&&(e%100!=0||e%400==0)}(i)?29:s[r])}function o(e,t){if(e&&t)return e>t?1:e<t?-1:0}const a=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function l(e){return function(t){const i=a.exec(t);if(!i)return!1;const n=+i[1],s=+i[2],r=+i[3],o=i[4],l="-"===i[5]?-1:1,c=+(i[6]||0),h=+(i[7]||0);if(c>23||h>59||e&&!o)return!1;if(n<=23&&s<=59&&r<60)return!0;const u=s-h*l,d=n-c*l-(u<0?1:0);return(23===d||-1===d)&&(59===u||-1===u)&&r<61}}function c(e,t){if(!e||!t)return;const i=new Date("2020-01-01T"+e).valueOf(),n=new Date("2020-01-01T"+t).valueOf();return i&&n?i-n:void 0}function h(e,t){if(!e||!t)return;const i=a.exec(e),n=a.exec(t);return i&&n?(e=i[1]+i[2]+i[3])>(t=n[1]+n[2]+n[3])?1:e<t?-1:0:void 0}const u=/t|\s/i;function d(e){const t=l(e);return function(e){const i=e.split(u);return 2===i.length&&r(i[0])&&t(i[1])}}function p(e,t){if(!e||!t)return;const i=new Date(e).valueOf(),n=new Date(t).valueOf();return i&&n?i-n:void 0}function g(e,t){if(!e||!t)return;const[i,n]=e.split(u),[s,r]=t.split(u),a=o(i,s);return void 0!==a?a||c(n,r):void 0}const f=/\/|:/,m=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,y=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function v(){return!0}const b=/[^\\]\\Z/},91712(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(5888),s=i(59035),r=i(38994),o=new r.Name("fullFormats"),a=new r.Name("fastFormats"),l=(e,t={keywords:!0})=>{if(Array.isArray(t))return c(e,t,n.fullFormats,o),e;const[i,r]="fast"===t.mode?[n.fastFormats,a]:[n.fullFormats,o];return c(e,t.formats||n.formatNames,i,r),t.keywords&&(0,s.default)(e),e};function c(e,t,i,n){var s,o;null!==(s=(o=e.opts.code).formats)&&void 0!==s||(o.formats=r._`require("ajv-formats/dist/formats").${n}`);for(const n of t)e.addFormat(n,i[n])}l.get=(e,t="full")=>{const i=("fast"===t?n.fastFormats:n.fullFormats)[e];if(!i)throw new Error(`Unknown format "${e}"`);return i},e.exports=t=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l},59035(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;const n=i(28825),s=i(38994),r=s.operators,o={formatMaximum:{okStr:"<=",ok:r.LTE,fail:r.GT},formatMinimum:{okStr:">=",ok:r.GTE,fail:r.LT},formatExclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},formatExclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},a={message:({keyword:e,schemaCode:t})=>s.str`should be ${o[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>s._`{comparison: ${o[e].okStr}, limit: ${t}}`};t.formatLimitDefinition={keyword:Object.keys(o),type:"string",schemaType:"string",$data:!0,error:a,code(e){const{gen:t,data:i,schemaCode:r,keyword:a,it:l}=e,{opts:c,self:h}=l;if(!c.validateFormats)return;const u=new n.KeywordCxt(l,h.RULES.all.format.definition,"format");function d(e){return s._`${e}.compare(${i}, ${r}) ${o[a].fail} 0`}u.$data?function(){const i=t.scopeValue("formats",{ref:h.formats,code:c.code.formats}),n=t.const("fmt",s._`${i}[${u.schemaCode}]`);e.fail$data((0,s.or)(s._`typeof ${n} != "object"`,s._`${n} instanceof RegExp`,s._`typeof ${n}.compare != "function"`,d(n)))}():function(){const i=u.schema,n=h.formats[i];if(!n||!0===n)return;if("object"!=typeof n||n instanceof RegExp||"function"!=typeof n.compare)throw new Error(`"${a}": format "${i}" does not define "compare" function`);const r=t.scopeValue("formats",{key:i,ref:n,code:c.code.formats?s._`${c.code.formats}${(0,s.getProperty)(i)}`:void 0});e.fail$data(d(r))}()},dependencies:["format"]},t.default=e=>(e.addKeyword(t.formatLimitDefinition),e)},28825(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const n=i(51967),s=i(83959),r=i(29376),o=i(85075),a=["/properties"],l="http://json-schema.org/draft-07/schema";class c extends n.default{_addVocabularies(){super._addVocabularies(),s.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(r.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(o,a):o;this.addMetaSchema(e,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}}t.Ajv=c,e.exports=t=c,e.exports.Ajv=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var h=i(36023);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return h.KeywordCxt}});var u=i(38994);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var d=i(74383);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return d.default}});var p=i(4220);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return p.default}})},28261(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class i{}t._CodeOrName=i,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends i{constructor(e){if(super(),!t.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=n;class s extends i{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce((e,t)=>`${e}${t}`,"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce((e,t)=>(t instanceof n&&(e[t.str]=(e[t.str]||0)+1),e),{})}}function r(e,...t){const i=[e[0]];let n=0;for(;n<t.length;)l(i,t[n]),i.push(e[++n]);return new s(i)}t._Code=s,t.nil=new s(""),t._=r;const o=new s("+");function a(e,...t){const i=[h(e[0])];let n=0;for(;n<t.length;)i.push(o),l(i,t[n]),i.push(o,h(e[++n]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===o){const i=c(e[t-1],e[t+1]);if(void 0!==i){e.splice(t-1,3,i);continue}e[t++]="+"}t++}}(i),new s(i)}function l(e,t){var i;t instanceof s?e.push(...t._items):t instanceof n?e.push(t):e.push("number"==typeof(i=t)||"boolean"==typeof i||null===i?i:h(Array.isArray(i)?i.join(","):i))}function c(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof n||'"'!==e[e.length-1])return;return"string"!=typeof t?`${e.slice(0,-1)}${t}"`:'"'===t[0]?e.slice(0,-1)+t.slice(1):void 0}return"string"!=typeof t||'"'!==t[0]||e instanceof n?void 0:`"${e}${t.slice(1)}`}function h(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.str=a,t.addCodeArg=l,t.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:a`${e}${t}`},t.stringify=function(e){return new s(h(e))},t.safeStringify=h,t.getProperty=function(e){return"string"==typeof e&&t.IDENTIFIER.test(e)?new s(`.${e}`):r`[${e}]`},t.getEsmExportName=function(e){if("string"==typeof e&&t.IDENTIFIER.test(e))return new s(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)},t.regexpCode=function(e){return new s(e.toString())}},38994(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const n=i(28261),s=i(44490);var r=i(28261);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return r.Name}});var o=i(44490);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return o.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return o.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return o.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return o.varKinds}}),t.operators={GT:new n._Code(">"),GTE:new n._Code(">="),LT:new n._Code("<"),LTE:new n._Code("<="),EQ:new n._Code("==="),NEQ:new n._Code("!=="),NOT:new n._Code("!"),OR:new n._Code("||"),AND:new n._Code("&&"),ADD:new n._Code("+")};class a{optimizeNodes(){return this}optimizeNames(e,t){return this}}class l extends a{constructor(e,t,i){super(),this.varKind=e,this.name=t,this.rhs=i}render({es5:e,_n:t}){const i=e?s.varKinds.var:this.varKind,n=void 0===this.rhs?"":` = ${this.rhs}`;return`${i} ${this.name}${n};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=k(this.rhs,e,t)),this}get names(){return this.rhs instanceof n._CodeOrName?this.rhs.names:{}}}class c extends a{constructor(e,t,i){super(),this.lhs=e,this.rhs=t,this.sideEffects=i}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof n.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=k(this.rhs,e,t),this}get names(){return R(this.lhs instanceof n.Name?{}:{...this.lhs.names},this.rhs)}}class h extends c{constructor(e,t,i,n){super(e,i,n),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class u extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class d extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class p extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class g extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=k(this.code,e,t),this}get names(){return this.code instanceof n._CodeOrName?this.code.names:{}}}class f extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,i)=>t+i.render(e),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const i=e[t].optimizeNodes();Array.isArray(i)?e.splice(t,1,...i):i?e[t]=i:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:i}=this;let n=i.length;for(;n--;){const s=i[n];s.optimizeNames(e,t)||(P(e,s.names),i.splice(n,1))}return i.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>I(e,t.names),{})}}class m extends f{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class y extends f{}class v extends m{}v.kind="else";class b extends m{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new v(e):e}return t?!1===e?t instanceof b?t:t.nodes:this.nodes.length?this:new b(_(e),t instanceof b?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var i;if(this.else=null===(i=this.else)||void 0===i?void 0:i.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=k(this.condition,e,t),this}get names(){const e=super.names;return R(e,this.condition),this.else&&I(e,this.else.names),e}}b.kind="if";class C extends m{}C.kind="for";class w extends C{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=k(this.iteration,e,t),this}get names(){return I(super.names,this.iteration.names)}}class S extends C{constructor(e,t,i,n){super(),this.varKind=e,this.name=t,this.from=i,this.to=n}render(e){const t=e.es5?s.varKinds.var:this.varKind,{name:i,from:n,to:r}=this;return`for(${t} ${i}=${n}; ${i}<${r}; ${i}++)`+super.render(e)}get names(){const e=R(super.names,this.from);return R(e,this.to)}}class x extends C{constructor(e,t,i,n){super(),this.loop=e,this.varKind=t,this.name=i,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=k(this.iterable,e,t),this}get names(){return I(super.names,this.iterable.names)}}class E extends m{constructor(e,t,i){super(),this.name=e,this.args=t,this.async=i}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}E.kind="func";class A extends f{render(e){return"return "+super.render(e)}}A.kind="return";class M extends m{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var i,n;return super.optimizeNames(e,t),null===(i=this.catch)||void 0===i||i.optimizeNames(e,t),null===(n=this.finally)||void 0===n||n.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&I(e,this.catch.names),this.finally&&I(e,this.finally.names),e}}class T extends m{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}T.kind="catch";class D extends m{render(e){return"finally"+super.render(e)}}function I(e,t){for(const i in t)e[i]=(e[i]||0)+(t[i]||0);return e}function R(e,t){return t instanceof n._CodeOrName?I(e,t.names):e}function k(e,t,i){return e instanceof n.Name?r(e):(s=e)instanceof n._Code&&s._items.some(e=>e instanceof n.Name&&1===t[e.str]&&void 0!==i[e.str])?new n._Code(e._items.reduce((e,t)=>(t instanceof n.Name&&(t=r(t)),t instanceof n._Code?e.push(...t._items):e.push(t),e),[])):e;var s;function r(e){const n=i[e.str];return void 0===n||1!==t[e.str]?e:(delete t[e.str],n)}}function P(e,t){for(const i in t)e[i]=(e[i]||0)-(t[i]||0)}function _(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:n._`!${F(e)}`}D.kind="finally",t.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new s.Scope({parent:e}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const i=this._extScope.value(e,t);return(this._values[i.prefix]||(this._values[i.prefix]=new Set)).add(i),i}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,i,n){const s=this._scope.toName(t);return void 0!==i&&n&&(this._constants[s.str]=i),this._leafNode(new l(e,s,i)),s}const(e,t,i){return this._def(s.varKinds.const,e,t,i)}let(e,t,i){return this._def(s.varKinds.let,e,t,i)}var(e,t,i){return this._def(s.varKinds.var,e,t,i)}assign(e,t,i){return this._leafNode(new c(e,t,i))}add(e,i){return this._leafNode(new h(e,t.operators.ADD,i))}code(e){return"function"==typeof e?e():e!==n.nil&&this._leafNode(new g(e)),this}object(...e){const t=["{"];for(const[i,s]of e)t.length>1&&t.push(","),t.push(i),(i!==s||this.opts.es5)&&(t.push(":"),(0,n.addCodeArg)(t,s));return t.push("}"),new n._Code(t)}if(e,t,i){if(this._blockNode(new b(e)),t&&i)this.code(t).else().code(i).endIf();else if(t)this.code(t).endIf();else if(i)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new b(e))}else(){return this._elseNode(new v)}endIf(){return this._endBlockNode(b,v)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new w(e),t)}forRange(e,t,i,n,r=(this.opts.es5?s.varKinds.var:s.varKinds.let)){const o=this._scope.toName(e);return this._for(new S(r,o,t,i),()=>n(o))}forOf(e,t,i,r=s.varKinds.const){const o=this._scope.toName(e);if(this.opts.es5){const e=t instanceof n.Name?t:this.var("_arr",t);return this.forRange("_i",0,n._`${e}.length`,t=>{this.var(o,n._`${e}[${t}]`),i(o)})}return this._for(new x("of",r,o,t),()=>i(o))}forIn(e,t,i,r=(this.opts.es5?s.varKinds.var:s.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,n._`Object.keys(${t})`,i);const o=this._scope.toName(e);return this._for(new x("in",r,o,t),()=>i(o))}endFor(){return this._endBlockNode(C)}label(e){return this._leafNode(new u(e))}break(e){return this._leafNode(new d(e))}return(e){const t=new A;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(A)}try(e,t,i){if(!t&&!i)throw new Error('CodeGen: "try" without "catch" and "finally"');const n=new M;if(this._blockNode(n),this.code(e),t){const e=this.name("e");this._currNode=n.catch=new T(e),t(e)}return i&&(this._currNode=n.finally=new D,this.code(i)),this._endBlockNode(T,D)}throw(e){return this._leafNode(new p(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const i=this._nodes.length-t;if(i<0||void 0!==e&&i!==e)throw new Error(`CodeGen: wrong number of nodes: ${i} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=n.nil,i,s){return this._blockNode(new E(e,t,i)),s&&this.code(s).endFunc(),this}endFunc(){return this._endBlockNode(E)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){const i=this._currNode;if(i instanceof e||t&&i instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof b))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},t.not=_;const L=O(t.operators.AND);t.and=function(...e){return e.reduce(L)};const N=O(t.operators.OR);function O(e){return(t,i)=>t===n.nil?i:i===n.nil?t:n._`${F(t)} ${e} ${F(i)}`}function F(e){return e instanceof n.Name?e:n._`(${e})`}t.or=function(...e){return e.reduce(N)}},44490(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const n=i(28261);class s extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var r;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(r||(t.UsedValueState=r={})),t.varKinds={const:new n.Name("const"),let:new n.Name("let"),var:new n.Name("var")};class o{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof n.Name?e:this.name(e)}name(e){return new n.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,i;if((null===(i=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===i?void 0:i.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}t.Scope=o;class a extends n.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:i}){this.value=e,this.scopePath=n._`.${new n.Name(t)}[${i}]`}}t.ValueScopeName=a;const l=n._`\n`;t.ValueScope=class extends o{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?l:n.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){var i;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const n=this.toName(e),{prefix:s}=n,r=null!==(i=t.key)&&void 0!==i?i:t.ref;let o=this._values[s];if(o){const e=o.get(r);if(e)return e}else o=this._values[s]=new Map;o.set(r,n);const a=this._scope[s]||(this._scope[s]=[]),l=a.length;return a[l]=t.ref,n.setValue(t,{property:s,itemIndex:l}),n}getValue(e,t){const i=this._values[e];if(i)return i.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,t=>{if(void 0===t.scopePath)throw new Error(`CodeGen: name "${t}" has no value`);return n._`${e}${t.scopePath}`})}scopeCode(e=this._values,t,i){return this._reduceValues(e,e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,i)}_reduceValues(e,i,o={},a){let l=n.nil;for(const c in e){const h=e[c];if(!h)continue;const u=o[c]=o[c]||new Map;h.forEach(e=>{if(u.has(e))return;u.set(e,r.Started);let o=i(e);if(o){const i=this.opts.es5?t.varKinds.var:t.varKinds.const;l=n._`${l}${i} ${e} = ${o};${this.opts._n}`}else{if(!(o=null==a?void 0:a(e)))throw new s(e);l=n._`${l}${o}${this.opts._n}`}u.set(e,r.Completed)})}return l}}},28425(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const n=i(38994),s=i(67218),r=i(86660);function o(e,t){const i=e.const("err",t);e.if(n._`${r.default.vErrors} === null`,()=>e.assign(r.default.vErrors,n._`[${i}]`),n._`${r.default.vErrors}.push(${i})`),e.code(n._`${r.default.errors}++`)}function a(e,t){const{gen:i,validateName:s,schemaEnv:r}=e;r.$async?i.throw(n._`new ${e.ValidationError}(${t})`):(i.assign(n._`${s}.errors`,t),i.return(!1))}t.keywordError={message:({keyword:e})=>n.str`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?n.str`"${e}" keyword must be ${t} ($data)`:n.str`"${e}" keyword is invalid ($data)`},t.reportError=function(e,i=t.keywordError,s,r){const{it:l}=e,{gen:h,compositeRule:u,allErrors:d}=l,p=c(e,i,s);(null!=r?r:u||d)?o(h,p):a(l,n._`[${p}]`)},t.reportExtraError=function(e,i=t.keywordError,n){const{it:s}=e,{gen:l,compositeRule:h,allErrors:u}=s;o(l,c(e,i,n)),h||u||a(s,r.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(r.default.errors,t),e.if(n._`${r.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(n._`${r.default.vErrors}.length`,t),()=>e.assign(r.default.vErrors,null)))},t.extendErrors=function({gen:e,keyword:t,schemaValue:i,data:s,errsCount:o,it:a}){if(void 0===o)throw new Error("ajv implementation error");const l=e.name("err");e.forRange("i",o,r.default.errors,o=>{e.const(l,n._`${r.default.vErrors}[${o}]`),e.if(n._`${l}.instancePath === undefined`,()=>e.assign(n._`${l}.instancePath`,(0,n.strConcat)(r.default.instancePath,a.errorPath))),e.assign(n._`${l}.schemaPath`,n.str`${a.errSchemaPath}/${t}`),a.opts.verbose&&(e.assign(n._`${l}.schema`,i),e.assign(n._`${l}.data`,s))})};const l={keyword:new n.Name("keyword"),schemaPath:new n.Name("schemaPath"),params:new n.Name("params"),propertyName:new n.Name("propertyName"),message:new n.Name("message"),schema:new n.Name("schema"),parentSchema:new n.Name("parentSchema")};function c(e,t,i){const{createErrors:s}=e.it;return!1===s?n._`{}`:function(e,t,i={}){const{gen:s,it:o}=e,a=[h(o,i),u(e,i)];return function(e,{params:t,message:i},s){const{keyword:o,data:a,schemaValue:c,it:h}=e,{opts:u,propertyName:d,topSchemaRef:p,schemaPath:g}=h;s.push([l.keyword,o],[l.params,"function"==typeof t?t(e):t||n._`{}`]),u.messages&&s.push([l.message,"function"==typeof i?i(e):i]),u.verbose&&s.push([l.schema,c],[l.parentSchema,n._`${p}${g}`],[r.default.data,a]),d&&s.push([l.propertyName,d])}(e,t,a),s.object(...a)}(e,t,i)}function h({errorPath:e},{instancePath:t}){const i=t?n.str`${e}${(0,s.getErrorPath)(t,s.Type.Str)}`:e;return[r.default.instancePath,(0,n.strConcat)(r.default.instancePath,i)]}function u({keyword:e,it:{errSchemaPath:t}},{schemaPath:i,parentSchema:r}){let o=r?t:n.str`${t}/${e}`;return i&&(o=n.str`${o}${(0,s.getErrorPath)(i,s.Type.Str)}`),[l.schemaPath,o]}},91688(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;const n=i(38994),s=i(74383),r=i(86660),o=i(89008),a=i(67218),l=i(36023);class c{constructor(e){var t;let i;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(i=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,o.normalizeId)(null==i?void 0:i[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==i?void 0:i.$async,this.refs={}}}function h(e){const t=d.call(this,e);if(t)return t;const i=(0,o.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:a,lines:c}=this.opts.code,{ownProperties:h}=this.opts,u=new n.CodeGen(this.scope,{es5:a,lines:c,ownProperties:h});let p;e.$async&&(p=u.scopeValue("Error",{ref:s.default,code:n._`require("ajv/dist/runtime/validation_error").default`}));const g=u.scopeName("validate");e.validateName=g;const f={gen:u,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[n.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:u.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,n.stringify)(e.schema)}:{ref:e.schema}),validateName:g,ValidationError:p,schema:e.schema,schemaEnv:e,rootId:i,baseId:e.baseId||i,schemaPath:n.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:n._`""`,opts:this.opts,self:this};let m;try{this._compilations.add(e),(0,l.validateFunctionCode)(f),u.optimize(this.opts.code.optimize);const t=u.toString();m=`${u.scopeRefs(r.default.scope)}return ${t}`,this.opts.code.process&&(m=this.opts.code.process(m,e));const i=new Function(`${r.default.self}`,`${r.default.scope}`,m)(this,this.scope.get());if(this.scope.value(g,{ref:i}),i.errors=null,i.schema=e.schema,i.schemaEnv=e,e.$async&&(i.$async=!0),!0===this.opts.code.source&&(i.source={validateName:g,validateCode:t,scopeValues:u._values}),this.opts.unevaluated){const{props:e,items:t}=f;i.evaluated={props:e instanceof n.Name?void 0:e,items:t instanceof n.Name?void 0:t,dynamicProps:e instanceof n.Name,dynamicItems:t instanceof n.Name},i.source&&(i.source.evaluated=(0,n.stringify)(i.evaluated))}return e.validate=i,e}catch(t){throw delete e.validate,delete e.validateName,m&&this.logger.error("Error compiling schema, function code:",m),t}finally{this._compilations.delete(e)}}function u(e){return(0,o.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:h.call(this,e)}function d(e){for(const t of this._compilations)if(p(t,e))return t}function p(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function g(e,t){let i;for(;"string"==typeof(i=this.refs[t]);)t=i;return i||this.schemas[t]||f.call(this,e,t)}function f(e,t){const i=this.opts.uriResolver.parse(t),n=(0,o._getFullPath)(this.opts.uriResolver,i);let s=(0,o.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===s)return y.call(this,i,e);const r=(0,o.normalizeId)(n),a=this.refs[r]||this.schemas[r];if("string"==typeof a){const t=f.call(this,e,a);if("object"!=typeof(null==t?void 0:t.schema))return;return y.call(this,i,t)}if("object"==typeof(null==a?void 0:a.schema)){if(a.validate||h.call(this,a),r===(0,o.normalizeId)(t)){const{schema:t}=a,{schemaId:i}=this.opts,n=t[i];return n&&(s=(0,o.resolveUrl)(this.opts.uriResolver,s,n)),new c({schema:t,schemaId:i,root:e,baseId:s})}return y.call(this,i,a)}}t.SchemaEnv=c,t.compileSchema=h,t.resolveRef=function(e,t,i){var n;i=(0,o.resolveUrl)(this.opts.uriResolver,t,i);const s=e.refs[i];if(s)return s;let r=g.call(this,e,i);if(void 0===r){const s=null===(n=e.localRefs)||void 0===n?void 0:n[i],{schemaId:o}=this.opts;s&&(r=new c({schema:s,schemaId:o,root:e,baseId:t}))}return void 0!==r?e.refs[i]=u.call(this,r):void 0},t.getCompilingSchema=d,t.resolveSchema=f;const m=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function y(e,{baseId:t,schema:i,root:n}){var s;if("/"!==(null===(s=e.fragment)||void 0===s?void 0:s[0]))return;for(const n of e.fragment.slice(1).split("/")){if("boolean"==typeof i)return;const e=i[(0,a.unescapeFragment)(n)];if(void 0===e)return;const s="object"==typeof(i=e)&&i[this.opts.schemaId];!m.has(n)&&s&&(t=(0,o.resolveUrl)(this.opts.uriResolver,t,s))}let r;if("boolean"!=typeof i&&i.$ref&&!(0,a.schemaHasRulesButRef)(i,this.RULES)){const e=(0,o.resolveUrl)(this.opts.uriResolver,t,i.$ref);r=f.call(this,n,e)}const{schemaId:l}=this.opts;return r=r||new c({schema:i,schemaId:l,root:n,baseId:t}),r.schema!==r.root.schema?r:void 0}},86660(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(38994),s={data:new n.Name("data"),valCxt:new n.Name("valCxt"),instancePath:new n.Name("instancePath"),parentData:new n.Name("parentData"),parentDataProperty:new n.Name("parentDataProperty"),rootData:new n.Name("rootData"),dynamicAnchors:new n.Name("dynamicAnchors"),vErrors:new n.Name("vErrors"),errors:new n.Name("errors"),this:new n.Name("this"),self:new n.Name("self"),scope:new n.Name("scope"),json:new n.Name("json"),jsonPos:new n.Name("jsonPos"),jsonLen:new n.Name("jsonLen"),jsonPart:new n.Name("jsonPart")};t.default=s},4220(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(89008);class s extends Error{constructor(e,t,i,s){super(s||`can't resolve reference ${i} from id ${t}`),this.missingRef=(0,n.resolveUrl)(e,t,i),this.missingSchema=(0,n.normalizeId)((0,n.getFullPath)(e,this.missingRef))}}t.default=s},89008(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;const n=i(67218),s=i(67371),r=i(50205),o=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);t.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!l(e):!!t&&c(e)<=t)};const a=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function l(e){for(const t in e){if(a.has(t))return!0;const i=e[t];if(Array.isArray(i)&&i.some(l))return!0;if("object"==typeof i&&l(i))return!0}return!1}function c(e){let t=0;for(const i in e){if("$ref"===i)return 1/0;if(t++,!o.has(i)&&("object"==typeof e[i]&&(0,n.eachItem)(e[i],e=>t+=c(e)),t===1/0))return 1/0}return t}function h(e,t="",i){!1!==i&&(t=p(t));const n=e.parse(t);return u(e,n)}function u(e,t){return e.serialize(t).split("#")[0]+"#"}t.getFullPath=h,t._getFullPath=u;const d=/#\/?$/;function p(e){return e?e.replace(d,""):""}t.normalizeId=p,t.resolveUrl=function(e,t,i){return i=p(i),e.resolve(t,i)};const g=/^[a-z_][-a-z0-9._]*$/i;t.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:i,uriResolver:n}=this.opts,o=p(e[i]||t),a={"":o},l=h(n,o,!1),c={},u=new Set;return r(e,{allKeys:!0},(e,t,n,s)=>{if(void 0===s)return;const r=l+t;let o=a[s];function h(t){const i=this.opts.uriResolver.resolve;if(t=p(o?i(o,t):t),u.has(t))throw f(t);u.add(t);let n=this.refs[t];return"string"==typeof n&&(n=this.refs[n]),"object"==typeof n?d(e,n.schema,t):t!==p(r)&&("#"===t[0]?(d(e,c[t],t),c[t]=e):this.refs[t]=r),t}function m(e){if("string"==typeof e){if(!g.test(e))throw new Error(`invalid anchor "${e}"`);h.call(this,`#${e}`)}}"string"==typeof e[i]&&(o=h.call(this,e[i])),m.call(this,e.$anchor),m.call(this,e.$dynamicAnchor),a[t]=o}),c;function d(e,t,i){if(void 0!==t&&!s(e,t))throw f(i)}function f(e){return new Error(`reference "${e}" resolves to more than one schema`)}}},6247(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;const i=new Set(["string","number","integer","boolean","null","object","array"]);t.isJSONType=function(e){return"string"==typeof e&&i.has(e)},t.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}},67218(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const n=i(38994),s=i(28261);function r(e,t=e.schema){const{opts:i,self:n}=e;if(!i.strictSchema)return;if("boolean"==typeof t)return;const s=n.RULES.keywords;for(const i in t)s[i]||g(e,`unknown keyword: "${i}"`)}function o(e,t){if("boolean"==typeof e)return!e;for(const i in e)if(t[i])return!0;return!1}function a(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function l(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function c({mergeNames:e,mergeToName:t,mergeValues:i,resultToName:s}){return(r,o,a,l)=>{const c=void 0===a?o:a instanceof n.Name?(o instanceof n.Name?e(r,o,a):t(r,o,a),a):o instanceof n.Name?(t(r,a,o),o):i(o,a);return l!==n.Name||c instanceof n.Name?c:s(r,c)}}function h(e,t){if(!0===t)return e.var("props",!0);const i=e.var("props",n._`{}`);return void 0!==t&&u(e,i,t),i}function u(e,t,i){Object.keys(i).forEach(i=>e.assign(n._`${t}${(0,n.getProperty)(i)}`,!0))}t.toHash=function(e){const t={};for(const i of e)t[i]=!0;return t},t.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(r(e,t),!o(t,e.self.RULES.all))},t.checkUnknownRules=r,t.schemaHasRules=o,t.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const i in e)if("$ref"!==i&&t.all[i])return!0;return!1},t.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},i,s,r){if(!r){if("number"==typeof i||"boolean"==typeof i)return i;if("string"==typeof i)return n._`${i}`}return n._`${e}${t}${(0,n.getProperty)(s)}`},t.unescapeFragment=function(e){return l(decodeURIComponent(e))},t.escapeFragment=function(e){return encodeURIComponent(a(e))},t.escapeJsonPointer=a,t.unescapeJsonPointer=l,t.eachItem=function(e,t){if(Array.isArray(e))for(const i of e)t(i);else t(e)},t.mergeEvaluated={props:c({mergeNames:(e,t,i)=>e.if(n._`${i} !== true && ${t} !== undefined`,()=>{e.if(n._`${t} === true`,()=>e.assign(i,!0),()=>e.assign(i,n._`${i} || {}`).code(n._`Object.assign(${i}, ${t})`))}),mergeToName:(e,t,i)=>e.if(n._`${i} !== true`,()=>{!0===t?e.assign(i,!0):(e.assign(i,n._`${i} || {}`),u(e,i,t))}),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:h}),items:c({mergeNames:(e,t,i)=>e.if(n._`${i} !== true && ${t} !== undefined`,()=>e.assign(i,n._`${t} === true ? true : ${i} > ${t} ? ${i} : ${t}`)),mergeToName:(e,t,i)=>e.if(n._`${i} !== true`,()=>e.assign(i,!0===t||n._`${i} > ${t} ? ${i} : ${t}`)),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=h,t.setEvaluated=u;const d={};var p;function g(e,t,i=e.opts.strictSchema){if(i){if(t=`strict mode: ${t}`,!0===i)throw new Error(t);e.self.logger.warn(t)}}t.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:d[t.code]||(d[t.code]=new s._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(p||(t.Type=p={})),t.getErrorPath=function(e,t,i){if(e instanceof n.Name){const s=t===p.Num;return i?s?n._`"[" + ${e} + "]"`:n._`"['" + ${e} + "']"`:s?n._`"/" + ${e}`:n._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return i?(0,n.getProperty)(e).toString():"/"+a(e)},t.checkStrictMode=g},238(e,t){"use strict";function i(e,t){return t.rules.some(t=>n(e,t))}function n(e,t){var i;return void 0!==e[t.keyword]||(null===(i=t.definition.implements)||void 0===i?void 0:i.some(t=>void 0!==e[t]))}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=function({schema:e,self:t},n){const s=t.RULES.types[n];return s&&!0!==s&&i(e,s)},t.shouldUseGroup=i,t.shouldUseRule=n},40564(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const n=i(28425),s=i(38994),r=i(86660),o={message:"boolean schema is false"};function a(e,t){const{gen:i,data:s}=e,r={gen:i,keyword:"false schema",data:s,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,n.reportError)(r,o,void 0,t)}t.topBoolOrEmptySchema=function(e){const{gen:t,schema:i,validateName:n}=e;!1===i?a(e,!1):"object"==typeof i&&!0===i.$async?t.return(r.default.data):(t.assign(s._`${n}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){const{gen:i,schema:n}=e;!1===n?(i.var(t,!1),a(e)):i.var(t,!0)}},26419(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;const n=i(6247),s=i(238),r=i(28425),o=i(38994),a=i(67218);var l;function c(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(n.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(l||(t.DataType=l={})),t.getSchemaTypes=function(e){const t=c(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},t.getJSONTypes=c,t.coerceAndCheckDataType=function(e,t){const{gen:i,data:n,opts:r}=e,a=function(e,t){return t?e.filter(e=>h.has(e)||"array"===t&&"array"===e):[]}(t,r.coerceTypes),c=t.length>0&&!(0===a.length&&1===t.length&&(0,s.schemaHasRulesForType)(e,t[0]));if(c){const s=d(t,n,r.strictNumbers,l.Wrong);i.if(s,()=>{a.length?function(e,t,i){const{gen:n,data:s,opts:r}=e,a=n.let("dataType",o._`typeof ${s}`),l=n.let("coerced",o._`undefined`);"array"===r.coerceTypes&&n.if(o._`${a} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,o._`${s}[0]`).assign(a,o._`typeof ${s}`).if(d(t,s,r.strictNumbers),()=>n.assign(l,s))),n.if(o._`${l} !== undefined`);for(const e of i)(h.has(e)||"array"===e&&"array"===r.coerceTypes)&&c(e);function c(e){switch(e){case"string":return void n.elseIf(o._`${a} == "number" || ${a} == "boolean"`).assign(l,o._`"" + ${s}`).elseIf(o._`${s} === null`).assign(l,o._`""`);case"number":return void n.elseIf(o._`${a} == "boolean" || ${s} === null
              || (${a} == "string" && ${s} && ${s} == +${s})`).assign(l,o._`+${s}`);case"integer":return void n.elseIf(o._`${a} === "boolean" || ${s} === null
              || (${a} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(l,o._`+${s}`);case"boolean":return void n.elseIf(o._`${s} === "false" || ${s} === 0 || ${s} === null`).assign(l,!1).elseIf(o._`${s} === "true" || ${s} === 1`).assign(l,!0);case"null":return n.elseIf(o._`${s} === "" || ${s} === 0 || ${s} === false`),void n.assign(l,null);case"array":n.elseIf(o._`${a} === "string" || ${a} === "number"
              || ${a} === "boolean" || ${s} === null`).assign(l,o._`[${s}]`)}}n.else(),g(e),n.endIf(),n.if(o._`${l} !== undefined`,()=>{n.assign(s,l),function({gen:e,parentData:t,parentDataProperty:i},n){e.if(o._`${t} !== undefined`,()=>e.assign(o._`${t}[${i}]`,n))}(e,l)})}(e,t,a):g(e)})}return c};const h=new Set(["string","number","integer","boolean","null"]);function u(e,t,i,n=l.Correct){const s=n===l.Correct?o.operators.EQ:o.operators.NEQ;let r;switch(e){case"null":return o._`${t} ${s} null`;case"array":r=o._`Array.isArray(${t})`;break;case"object":r=o._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":r=a(o._`!(${t} % 1) && !isNaN(${t})`);break;case"number":r=a();break;default:return o._`typeof ${t} ${s} ${e}`}return n===l.Correct?r:(0,o.not)(r);function a(e=o.nil){return(0,o.and)(o._`typeof ${t} == "number"`,e,i?o._`isFinite(${t})`:o.nil)}}function d(e,t,i,n){if(1===e.length)return u(e[0],t,i,n);let s;const r=(0,a.toHash)(e);if(r.array&&r.object){const e=o._`typeof ${t} != "object"`;s=r.null?e:o._`!${t} || ${e}`,delete r.null,delete r.array,delete r.object}else s=o.nil;r.number&&delete r.integer;for(const e in r)s=(0,o.and)(s,u(e,t,i,n));return s}t.checkDataType=u,t.checkDataTypes=d;const p={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?o._`{type: ${e}}`:o._`{type: ${t}}`};function g(e){const t=function(e){const{gen:t,data:i,schema:n}=e,s=(0,a.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:i,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:e}}(e);(0,r.reportError)(t,p)}t.reportTypeError=g},76593(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;const n=i(38994),s=i(67218);function r(e,t,i){const{gen:r,compositeRule:o,data:a,opts:l}=e;if(void 0===i)return;const c=n._`${a}${(0,n.getProperty)(t)}`;if(o)return void(0,s.checkStrictMode)(e,`default is ignored for: ${c}`);let h=n._`${c} === undefined`;"empty"===l.useDefaults&&(h=n._`${h} || ${c} === null || ${c} === ""`),r.if(h,n._`${c} = ${(0,n.stringify)(i)}`)}t.assignDefaults=function(e,t){const{properties:i,items:n}=e.schema;if("object"===t&&i)for(const t in i)r(e,t,i[t].default);else"array"===t&&Array.isArray(n)&&n.forEach((t,i)=>r(e,i,t.default))}},36023(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;const n=i(40564),s=i(26419),r=i(238),o=i(26419),a=i(76593),l=i(29820),c=i(3826),h=i(38994),u=i(86660),d=i(89008),p=i(67218),g=i(28425);function f({gen:e,validateName:t,schema:i,schemaEnv:n,opts:s},r){s.code.es5?e.func(t,h._`${u.default.data}, ${u.default.valCxt}`,n.$async,()=>{e.code(h._`"use strict"; ${m(i,s)}`),function(e,t){e.if(u.default.valCxt,()=>{e.var(u.default.instancePath,h._`${u.default.valCxt}.${u.default.instancePath}`),e.var(u.default.parentData,h._`${u.default.valCxt}.${u.default.parentData}`),e.var(u.default.parentDataProperty,h._`${u.default.valCxt}.${u.default.parentDataProperty}`),e.var(u.default.rootData,h._`${u.default.valCxt}.${u.default.rootData}`),t.dynamicRef&&e.var(u.default.dynamicAnchors,h._`${u.default.valCxt}.${u.default.dynamicAnchors}`)},()=>{e.var(u.default.instancePath,h._`""`),e.var(u.default.parentData,h._`undefined`),e.var(u.default.parentDataProperty,h._`undefined`),e.var(u.default.rootData,u.default.data),t.dynamicRef&&e.var(u.default.dynamicAnchors,h._`{}`)})}(e,s),e.code(r)}):e.func(t,h._`${u.default.data}, ${function(e){return h._`{${u.default.instancePath}="", ${u.default.parentData}, ${u.default.parentDataProperty}, ${u.default.rootData}=${u.default.data}${e.dynamicRef?h._`, ${u.default.dynamicAnchors}={}`:h.nil}}={}`}(s)}`,n.$async,()=>e.code(m(i,s)).code(r))}function m(e,t){const i="object"==typeof e&&e[t.schemaId];return i&&(t.code.source||t.code.process)?h._`/*# sourceURL=${i} */`:h.nil}function y({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const i in e)if(t.RULES.all[i])return!0;return!1}function v(e){return"boolean"!=typeof e.schema}function b(e){(0,p.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:i,opts:n,self:s}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,p.schemaHasRulesButRef)(t,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${i}"`)}(e)}function C(e,t){if(e.opts.jtd)return S(e,[],!1,t);const i=(0,s.getSchemaTypes)(e.schema);S(e,i,!(0,s.coerceAndCheckDataType)(e,i),t)}function w({gen:e,schemaEnv:t,schema:i,errSchemaPath:n,opts:s}){const r=i.$comment;if(!0===s.$comment)e.code(h._`${u.default.self}.logger.log(${r})`);else if("function"==typeof s.$comment){const i=h.str`${n}/$comment`,s=e.scopeValue("root",{ref:t.root});e.code(h._`${u.default.self}.opts.$comment(${r}, ${i}, ${s}.schema)`)}}function S(e,t,i,n){const{gen:s,schema:a,data:l,allErrors:c,opts:d,self:g}=e,{RULES:f}=g;function m(p){(0,r.shouldUseGroup)(a,p)&&(p.type?(s.if((0,o.checkDataType)(p.type,l,d.strictNumbers)),x(e,p),1===t.length&&t[0]===p.type&&i&&(s.else(),(0,o.reportTypeError)(e)),s.endIf()):x(e,p),c||s.if(h._`${u.default.errors} === ${n||0}`))}!a.$ref||!d.ignoreKeywordsWithRef&&(0,p.schemaHasRulesButRef)(a,f)?(d.jtd||function(e,t){!e.schemaEnv.meta&&e.opts.strictTypes&&(function(e,t){t.length&&(e.dataTypes.length?(t.forEach(t=>{E(e.dataTypes,t)||A(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)}),function(e,t){const i=[];for(const n of e.dataTypes)E(t,n)?i.push(n):t.includes("integer")&&"number"===n&&i.push("integer");e.dataTypes=i}(e,t)):e.dataTypes=t)}(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&A(e,"use allowUnionTypes to allow union type keyword")}(e,t),function(e,t){const i=e.self.RULES.all;for(const n in i){const s=i[n];if("object"==typeof s&&(0,r.shouldUseRule)(e.schema,s)){const{type:i}=s.definition;i.length&&!i.some(e=>{return n=e,(i=t).includes(n)||"number"===n&&i.includes("integer");var i,n})&&A(e,`missing type "${i.join(",")}" for keyword "${n}"`)}}}(e,e.dataTypes))}(e,t),s.block(()=>{for(const e of f.rules)m(e);m(f.post)})):s.block(()=>T(e,"$ref",f.all.$ref.definition))}function x(e,t){const{gen:i,schema:n,opts:{useDefaults:s}}=e;s&&(0,a.assignDefaults)(e,t.type),i.block(()=>{for(const i of t.rules)(0,r.shouldUseRule)(n,i)&&T(e,i.keyword,i.definition,t.type)})}function E(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function A(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,p.checkStrictMode)(e,t,e.opts.strictTypes)}t.validateFunctionCode=function(e){v(e)&&(b(e),y(e))?function(e){const{schema:t,opts:i,gen:n}=e;f(e,()=>{i.$comment&&t.$comment&&w(e),function(e){const{schema:t,opts:i}=e;void 0!==t.default&&i.useDefaults&&i.strictSchema&&(0,p.checkStrictMode)(e,"default is ignored in the schema root")}(e),n.let(u.default.vErrors,null),n.let(u.default.errors,0),i.unevaluated&&function(e){const{gen:t,validateName:i}=e;e.evaluated=t.const("evaluated",h._`${i}.evaluated`),t.if(h._`${e.evaluated}.dynamicProps`,()=>t.assign(h._`${e.evaluated}.props`,h._`undefined`)),t.if(h._`${e.evaluated}.dynamicItems`,()=>t.assign(h._`${e.evaluated}.items`,h._`undefined`))}(e),C(e),function(e){const{gen:t,schemaEnv:i,validateName:n,ValidationError:s,opts:r}=e;i.$async?t.if(h._`${u.default.errors} === 0`,()=>t.return(u.default.data),()=>t.throw(h._`new ${s}(${u.default.vErrors})`)):(t.assign(h._`${n}.errors`,u.default.vErrors),r.unevaluated&&function({gen:e,evaluated:t,props:i,items:n}){i instanceof h.Name&&e.assign(h._`${t}.props`,i),n instanceof h.Name&&e.assign(h._`${t}.items`,n)}(e),t.return(h._`${u.default.errors} === 0`))}(e)})}(e):f(e,()=>(0,n.topBoolOrEmptySchema)(e))};class M{constructor(e,t,i){if((0,l.validateKeywordUsage)(e,t,i),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=i,this.data=e.data,this.schema=e.schema[i],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,p.schemaRefOrVal)(e,this.schema,i,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",R(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,l.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${i} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",u.default.errors))}result(e,t,i){this.failResult((0,h.not)(e),t,i)}failResult(e,t,i){this.gen.if(e),i?i():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,h.not)(e),void 0,t)}fail(e){if(void 0===e)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:t}=this;this.fail(h._`${t} !== undefined && (${(0,h.or)(this.invalid$data(),e)})`)}error(e,t,i){if(t)return this.setParams(t),this._error(e,i),void this.setParams({});this._error(e,i)}_error(e,t){(e?g.reportExtraError:g.reportError)(this,this.def.error,t)}$dataError(){(0,g.reportError)(this,this.def.$dataError||g.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,g.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,i=h.nil){this.gen.block(()=>{this.check$data(e,i),t()})}check$data(e=h.nil,t=h.nil){if(!this.$data)return;const{gen:i,schemaCode:n,schemaType:s,def:r}=this;i.if((0,h.or)(h._`${n} === undefined`,t)),e!==h.nil&&i.assign(e,!0),(s.length||r.validateSchema)&&(i.elseIf(this.invalid$data()),this.$dataError(),e!==h.nil&&i.assign(e,!1)),i.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:i,def:n,it:s}=this;return(0,h.or)(function(){if(i.length){if(!(t instanceof h.Name))throw new Error("ajv implementation error");const e=Array.isArray(i)?i:[i];return h._`${(0,o.checkDataTypes)(e,t,s.opts.strictNumbers,o.DataType.Wrong)}`}return h.nil}(),function(){if(n.validateSchema){const i=e.scopeValue("validate$data",{ref:n.validateSchema});return h._`!${i}(${t})`}return h.nil}())}subschema(e,t){const i=(0,c.getSubschema)(this.it,e);(0,c.extendSubschemaData)(i,this.it,e),(0,c.extendSubschemaMode)(i,e);const s={...this.it,...i,items:void 0,props:void 0};return function(e,t){v(e)&&(b(e),y(e))?function(e,t){const{schema:i,gen:n,opts:s}=e;s.$comment&&i.$comment&&w(e),function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,d.resolveUrl)(e.opts.uriResolver,e.baseId,t))}(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const r=n.const("_errs",u.default.errors);C(e,r),n.var(t,h._`${r} === ${u.default.errors}`)}(e,t):(0,n.boolOrEmptySchema)(e,t)}(s,t),s}mergeEvaluated(e,t){const{it:i,gen:n}=this;i.opts.unevaluated&&(!0!==i.props&&void 0!==e.props&&(i.props=p.mergeEvaluated.props(n,e.props,i.props,t)),!0!==i.items&&void 0!==e.items&&(i.items=p.mergeEvaluated.items(n,e.items,i.items,t)))}mergeValidEvaluated(e,t){const{it:i,gen:n}=this;if(i.opts.unevaluated&&(!0!==i.props||!0!==i.items))return n.if(t,()=>this.mergeEvaluated(e,h.Name)),!0}}function T(e,t,i,n){const s=new M(e,i,t);"code"in i?i.code(s,n):s.$data&&i.validate?(0,l.funcKeywordCode)(s,i):"macro"in i?(0,l.macroKeywordCode)(s,i):(i.compile||i.validate)&&(0,l.funcKeywordCode)(s,i)}t.KeywordCxt=M;const D=/^\/(?:[^~]|~0|~1)*$/,I=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function R(e,{dataLevel:t,dataNames:i,dataPathArr:n}){let s,r;if(""===e)return u.default.rootData;if("/"===e[0]){if(!D.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);s=e,r=u.default.rootData}else{const o=I.exec(e);if(!o)throw new Error(`Invalid JSON-pointer: ${e}`);const a=+o[1];if(s=o[2],"#"===s){if(a>=t)throw new Error(l("property/index",a));return n[t-a]}if(a>t)throw new Error(l("data",a));if(r=i[t-a],!s)return r}let o=r;const a=s.split("/");for(const e of a)e&&(r=h._`${r}${(0,h.getProperty)((0,p.unescapeJsonPointer)(e))}`,o=h._`${o} && ${r}`);return o;function l(e,i){return`Cannot access ${e} ${i} levels up, current level is ${t}`}}t.getData=R},29820(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;const n=i(38994),s=i(86660),r=i(24954),o=i(28425);function a(e){const{gen:t,data:i,it:s}=e;t.if(s.parentData,()=>t.assign(i,n._`${s.parentData}[${s.parentDataProperty}]`))}function l(e,t,i){if(void 0===i)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof i?{ref:i}:{ref:i,code:(0,n.stringify)(i)})}t.macroKeywordCode=function(e,t){const{gen:i,keyword:s,schema:r,parentSchema:o,it:a}=e,c=t.macro.call(a.self,r,o,a),h=l(i,s,c);!1!==a.opts.validateSchema&&a.self.validateSchema(c,!0);const u=i.name("valid");e.subschema({schema:c,schemaPath:n.nil,errSchemaPath:`${a.errSchemaPath}/${s}`,topSchemaRef:h,compositeRule:!0},u),e.pass(u,()=>e.error(!0))},t.funcKeywordCode=function(e,t){var i;const{gen:c,keyword:h,schema:u,parentSchema:d,$data:p,it:g}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(g,t);const f=!p&&t.compile?t.compile.call(g.self,u,d,g):t.validate,m=l(c,h,f),y=c.let("valid");function v(i=(t.async?n._`await `:n.nil)){const o=g.opts.passContext?s.default.this:s.default.self,a=!("compile"in t&&!p||!1===t.schema);c.assign(y,n._`${i}${(0,r.callValidateCode)(e,m,o,a)}`,t.modifying)}function b(e){var i;c.if((0,n.not)(null!==(i=t.valid)&&void 0!==i?i:y),e)}e.block$data(y,function(){if(!1===t.errors)v(),t.modifying&&a(e),b(()=>e.error());else{const i=t.async?function(){const e=c.let("ruleErrs",null);return c.try(()=>v(n._`await `),t=>c.assign(y,!1).if(n._`${t} instanceof ${g.ValidationError}`,()=>c.assign(e,n._`${t}.errors`),()=>c.throw(t))),e}():function(){const e=n._`${m}.errors`;return c.assign(e,null),v(n.nil),e}();t.modifying&&a(e),b(()=>function(e,t){const{gen:i}=e;i.if(n._`Array.isArray(${t})`,()=>{i.assign(s.default.vErrors,n._`${s.default.vErrors} === null ? ${t} : ${s.default.vErrors}.concat(${t})`).assign(s.default.errors,n._`${s.default.vErrors}.length`),(0,o.extendErrors)(e)},()=>e.error())}(e,i))}}),e.ok(null!==(i=t.valid)&&void 0!==i?i:y)},t.validSchemaType=function(e,t,i=!1){return!t.length||t.some(t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||i&&void 0===e)},t.validateKeywordUsage=function({schema:e,opts:t,self:i,errSchemaPath:n},s,r){if(Array.isArray(s.keyword)?!s.keyword.includes(r):s.keyword!==r)throw new Error("ajv implementation error");const o=s.dependencies;if(null==o?void 0:o.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))throw new Error(`parent schema must have dependencies of ${r}: ${o.join(",")}`);if(s.validateSchema&&!s.validateSchema(e[r])){const e=`keyword "${r}" value is invalid at path "${n}": `+i.errorsText(s.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);i.logger.error(e)}}},3826(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;const n=i(38994),s=i(67218);t.getSubschema=function(e,{keyword:t,schemaProp:i,schema:r,schemaPath:o,errSchemaPath:a,topSchemaRef:l}){if(void 0!==t&&void 0!==r)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const r=e.schema[t];return void 0===i?{schema:r,schemaPath:n._`${e.schemaPath}${(0,n.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:r[i],schemaPath:n._`${e.schemaPath}${(0,n.getProperty)(t)}${(0,n.getProperty)(i)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,s.escapeFragment)(i)}`}}if(void 0!==r){if(void 0===o||void 0===a||void 0===l)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:r,schemaPath:o,topSchemaRef:l,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')},t.extendSubschemaData=function(e,t,{dataProp:i,dataPropType:r,data:o,dataTypes:a,propertyName:l}){if(void 0!==o&&void 0!==i)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:c}=t;if(void 0!==i){const{errorPath:o,dataPathArr:a,opts:l}=t;h(c.let("data",n._`${t.data}${(0,n.getProperty)(i)}`,!0)),e.errorPath=n.str`${o}${(0,s.getErrorPath)(i,r,l.jsPropertySyntax)}`,e.parentDataProperty=n._`${i}`,e.dataPathArr=[...a,e.parentDataProperty]}function h(i){e.data=i,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,i]}void 0!==o&&(h(o instanceof n.Name?o:c.let("data",o,!0)),void 0!==l&&(e.propertyName=l)),a&&(e.dataTypes=a)},t.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:i,compositeRule:n,createErrors:s,allErrors:r}){void 0!==n&&(e.compositeRule=n),void 0!==s&&(e.createErrors=s),void 0!==r&&(e.allErrors=r),e.jtdDiscriminator=t,e.jtdMetadata=i}},51967(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var n=i(36023);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return n.KeywordCxt}});var s=i(38994);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return s._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return s.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return s.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return s.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return s.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return s.CodeGen}});const r=i(74383),o=i(4220),a=i(6247),l=i(91688),c=i(38994),h=i(89008),u=i(26419),d=i(67218),p=i(10114),g=i(18951),f=(e,t)=>new RegExp(e,t);f.code="new RegExp";const m=["removeAdditional","useDefaults","coerceTypes"],y=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),v={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},b={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function C(e){var t,i,n,s,r,o,a,l,c,h,u,d,p,m,y,v,b,C,w,S,x,E,A,M,T;const D=e.strict,I=null===(t=e.code)||void 0===t?void 0:t.optimize,R=!0===I||void 0===I?1:I||0,k=null!==(n=null===(i=e.code)||void 0===i?void 0:i.regExp)&&void 0!==n?n:f,P=null!==(s=e.uriResolver)&&void 0!==s?s:g.default;return{strictSchema:null===(o=null!==(r=e.strictSchema)&&void 0!==r?r:D)||void 0===o||o,strictNumbers:null===(l=null!==(a=e.strictNumbers)&&void 0!==a?a:D)||void 0===l||l,strictTypes:null!==(h=null!==(c=e.strictTypes)&&void 0!==c?c:D)&&void 0!==h?h:"log",strictTuples:null!==(d=null!==(u=e.strictTuples)&&void 0!==u?u:D)&&void 0!==d?d:"log",strictRequired:null!==(m=null!==(p=e.strictRequired)&&void 0!==p?p:D)&&void 0!==m&&m,code:e.code?{...e.code,optimize:R,regExp:k}:{optimize:R,regExp:k},loopRequired:null!==(y=e.loopRequired)&&void 0!==y?y:200,loopEnum:null!==(v=e.loopEnum)&&void 0!==v?v:200,meta:null===(b=e.meta)||void 0===b||b,messages:null===(C=e.messages)||void 0===C||C,inlineRefs:null===(w=e.inlineRefs)||void 0===w||w,schemaId:null!==(S=e.schemaId)&&void 0!==S?S:"$id",addUsedSchema:null===(x=e.addUsedSchema)||void 0===x||x,validateSchema:null===(E=e.validateSchema)||void 0===E||E,validateFormats:null===(A=e.validateFormats)||void 0===A||A,unicodeRegExp:null===(M=e.unicodeRegExp)||void 0===M||M,int32range:null===(T=e.int32range)||void 0===T||T,uriResolver:P}}class w{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...C(e)};const{es5:t,lines:i}=this.opts.code;this.scope=new c.ValueScope({scope:{},prefixes:y,es5:t,lines:i}),this.logger=function(e){if(!1===e)return D;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}(e.logger);const n=e.validateFormats;e.validateFormats=!1,this.RULES=(0,a.getRules)(),S.call(this,v,e,"NOT SUPPORTED"),S.call(this,b,e,"DEPRECATED","warn"),this._metaOpts=T.call(this),e.formats&&A.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&M.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),E.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:i}=this.opts;let n=p;"id"===i&&(n={...p},n.id=n.$id,delete n.$id),t&&e&&this.addMetaSchema(n,n[i],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let i;if("string"==typeof e){if(i=this.getSchema(e),!i)throw new Error(`no schema with key or ref "${e}"`)}else i=this.compile(e);const n=i(t);return"$async"in i||(this.errors=i.errors),n}compile(e,t){const i=this._addSchema(e,t);return i.validate||this._compileSchemaEnv(i)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:i}=this.opts;return n.call(this,e,t);async function n(e,t){await s.call(this,e.$schema);const i=this._addSchema(e,t);return i.validate||r.call(this,i)}async function s(e){e&&!this.getSchema(e)&&await n.call(this,{$ref:e},!0)}async function r(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof o.default))throw t;return a.call(this,t),await l.call(this,t.missingSchema),r.call(this,e)}}function a({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function l(e){const i=await c.call(this,e);this.refs[e]||await s.call(this,i.$schema),this.refs[e]||this.addSchema(i,e,t)}async function c(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=i(e))}finally{delete this._loading[e]}}}addSchema(e,t,i,n=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,i,n);return this}let s;if("object"==typeof e){const{schemaId:t}=this.opts;if(s=e[t],void 0!==s&&"string"!=typeof s)throw new Error(`schema ${t} must be string`)}return t=(0,h.normalizeId)(t||s),this._checkUnique(t),this.schemas[t]=this._addSchema(e,i,t,n,!0),this}addMetaSchema(e,t,i=this.opts.validateSchema){return this.addSchema(e,t,!0,i),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let i;if(i=e.$schema,void 0!==i&&"string"!=typeof i)throw new Error("$schema must be a string");if(i=i||this.opts.defaultMeta||this.defaultMeta(),!i)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const n=this.validate(i,e);if(!n&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return n}getSchema(e){let t;for(;"string"==typeof(t=x.call(this,e));)e=t;if(void 0===t){const{schemaId:i}=this.opts,n=new l.SchemaEnv({schema:{},schemaId:i});if(t=l.resolveSchema.call(this,n,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const t=x.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let i=e[this.opts.schemaId];return i&&(i=(0,h.normalizeId)(i),delete this.schemas[i],delete this.refs[i]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let i;if("string"==typeof e)i=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=i);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(i=(t=e).keyword,Array.isArray(i)&&!i.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(R.call(this,i,t),!t)return(0,d.eachItem)(i,e=>k.call(this,e)),this;_.call(this,t);const n={...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)};return(0,d.eachItem)(i,0===n.type.length?e=>k.call(this,e,n):e=>n.type.forEach(t=>k.call(this,e,n,t))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const i of t.rules){const t=i.rules.findIndex(t=>t.keyword===e);t>=0&&i.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:i="data"}={}){return e&&0!==e.length?e.map(e=>`${i}${e.instancePath} ${e.message}`).reduce((e,i)=>e+t+i):"No errors"}$dataMetaSchema(e,t){const i=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const n of t){const t=n.split("/").slice(1);let s=e;for(const e of t)s=s[e];for(const e in i){const t=i[e];if("object"!=typeof t)continue;const{$data:n}=t.definition,r=s[e];n&&r&&(s[e]=N(r))}}return e}_removeAllSchemas(e,t){for(const i in e){const n=e[i];t&&!t.test(i)||("string"==typeof n?delete e[i]:n&&!n.meta&&(this._cache.delete(n.schema),delete e[i]))}}_addSchema(e,t,i,n=this.opts.validateSchema,s=this.opts.addUsedSchema){let r;const{schemaId:o}=this.opts;if("object"==typeof e)r=e[o];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}let a=this._cache.get(e);if(void 0!==a)return a;i=(0,h.normalizeId)(r||i);const c=h.getSchemaRefs.call(this,e,i);return a=new l.SchemaEnv({schema:e,schemaId:o,meta:t,baseId:i,localRefs:c}),this._cache.set(a.schema,a),s&&!i.startsWith("#")&&(i&&this._checkUnique(i),this.refs[i]=a),n&&this.validateSchema(e,!0),a}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):l.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{l.compileSchema.call(this,e)}finally{this.opts=t}}}function S(e,t,i,n="error"){for(const s in e){const r=s;r in t&&this.logger[n](`${i}: option ${s}. ${e[r]}`)}}function x(e){return e=(0,h.normalizeId)(e),this.schemas[e]||this.refs[e]}function E(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function A(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function M(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const i=e[t];i.keyword||(i.keyword=t),this.addKeyword(i)}}}function T(){const e={...this.opts};for(const t of m)delete e[t];return e}w.ValidationError=r.default,w.MissingRefError=o.default,t.default=w;const D={log(){},warn(){},error(){}},I=/^[a-z_$][a-z0-9_$:-]*$/i;function R(e,t){const{RULES:i}=this;if((0,d.eachItem)(e,e=>{if(i.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!I.test(e))throw new Error(`Keyword ${e} has invalid name`)}),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function k(e,t,i){var n;const s=null==t?void 0:t.post;if(i&&s)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:r}=this;let o=s?r.post:r.rules.find(({type:e})=>e===i);if(o||(o={type:i,rules:[]},r.rules.push(o)),r.keywords[e]=!0,!t)return;const a={keyword:e,definition:{...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)}};t.before?P.call(this,o,a,t.before):o.rules.push(a),r.all[e]=a,null===(n=t.implements)||void 0===n||n.forEach(e=>this.addKeyword(e))}function P(e,t,i){const n=e.rules.findIndex(e=>e.keyword===i);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${i} is not defined`))}function _(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=N(t)),e.validateSchema=this.compile(t,!0))}const L={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function N(e){return{anyOf:[e,L]}}},6013(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(67371);n.code='require("ajv/dist/runtime/equal").default',t.default=n},25532(e,t){"use strict";function i(e){const t=e.length;let i,n=0,s=0;for(;s<t;)n++,i=e.charCodeAt(s++),i>=55296&&i<=56319&&s<t&&(i=e.charCodeAt(s),56320==(64512&i)&&s++);return n}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i,i.code='require("ajv/dist/runtime/ucs2length").default'},18951(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(58041);n.code='require("ajv/dist/runtime/uri").default',t.default=n},74383(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class i extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}t.default=i},8333(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;const n=i(38994),s=i(67218),r={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>n.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>n._`{limit: ${e}}`},code(e){const{parentSchema:t,it:i}=e,{items:n}=t;Array.isArray(n)?o(e,n):(0,s.checkStrictMode)(i,'"additionalItems" is ignored when "items" is not an array of schemas')}};function o(e,t){const{gen:i,schema:r,data:o,keyword:a,it:l}=e;l.items=!0;const c=i.const("len",n._`${o}.length`);if(!1===r)e.setParams({len:t.length}),e.pass(n._`${c} <= ${t.length}`);else if("object"==typeof r&&!(0,s.alwaysValidSchema)(l,r)){const r=i.var("valid",n._`${c} <= ${t.length}`);i.if((0,n.not)(r),()=>function(r){i.forRange("i",t.length,c,t=>{e.subschema({keyword:a,dataProp:t,dataPropType:s.Type.Num},r),l.allErrors||i.if((0,n.not)(r),()=>i.break())})}(r)),e.ok(r)}}t.validateAdditionalItems=o,t.default=r},88401(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(24954),s=i(38994),r=i(86660),o=i(67218),a={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>s._`{additionalProperty: ${e.additionalProperty}}`},code(e){const{gen:t,schema:i,parentSchema:a,data:l,errsCount:c,it:h}=e;if(!c)throw new Error("ajv implementation error");const{allErrors:u,opts:d}=h;if(h.props=!0,"all"!==d.removeAdditional&&(0,o.alwaysValidSchema)(h,i))return;const p=(0,n.allSchemaProperties)(a.properties),g=(0,n.allSchemaProperties)(a.patternProperties);function f(e){t.code(s._`delete ${l}[${e}]`)}function m(n){if("all"===d.removeAdditional||d.removeAdditional&&!1===i)f(n);else{if(!1===i)return e.setParams({additionalProperty:n}),e.error(),void(u||t.break());if("object"==typeof i&&!(0,o.alwaysValidSchema)(h,i)){const i=t.name("valid");"failing"===d.removeAdditional?(y(n,i,!1),t.if((0,s.not)(i),()=>{e.reset(),f(n)})):(y(n,i),u||t.if((0,s.not)(i),()=>t.break()))}}}function y(t,i,n){const s={keyword:"additionalProperties",dataProp:t,dataPropType:o.Type.Str};!1===n&&Object.assign(s,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(s,i)}t.forIn("key",l,i=>{p.length||g.length?t.if(function(i){let r;if(p.length>8){const e=(0,o.schemaRefOrVal)(h,a.properties,"properties");r=(0,n.isOwnProperty)(t,e,i)}else r=p.length?(0,s.or)(...p.map(e=>s._`${i} === ${e}`)):s.nil;return g.length&&(r=(0,s.or)(r,...g.map(t=>s._`${(0,n.usePattern)(e,t)}.test(${i})`))),(0,s.not)(r)}(i),()=>m(i)):m(i)}),e.ok(s._`${c} === ${r.default.errors}`)}};t.default=a},12003(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(67218),s={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:i,it:s}=e;if(!Array.isArray(i))throw new Error("ajv implementation error");const r=t.name("valid");i.forEach((t,i)=>{if((0,n.alwaysValidSchema)(s,t))return;const o=e.subschema({keyword:"allOf",schemaProp:i},r);e.ok(r),e.mergeEvaluated(o)})}};t.default=s},21070(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:i(24954).validateUnion,error:{message:"must match a schema in anyOf"}};t.default=n},32692(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(38994),s=i(67218),r={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?n.str`must contain at least ${e} valid item(s)`:n.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?n._`{minContains: ${e}}`:n._`{minContains: ${e}, maxContains: ${t}}`},code(e){const{gen:t,schema:i,parentSchema:r,data:o,it:a}=e;let l,c;const{minContains:h,maxContains:u}=r;a.opts.next?(l=void 0===h?1:h,c=u):l=1;const d=t.const("len",n._`${o}.length`);if(e.setParams({min:l,max:c}),void 0===c&&0===l)return void(0,s.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==c&&l>c)return(0,s.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,s.alwaysValidSchema)(a,i)){let t=n._`${d} >= ${l}`;return void 0!==c&&(t=n._`${t} && ${d} <= ${c}`),void e.pass(t)}a.items=!0;const p=t.name("valid");function g(){const e=t.name("_valid"),i=t.let("count",0);f(e,()=>t.if(e,()=>function(e){t.code(n._`${e}++`),void 0===c?t.if(n._`${e} >= ${l}`,()=>t.assign(p,!0).break()):(t.if(n._`${e} > ${c}`,()=>t.assign(p,!1).break()),1===l?t.assign(p,!0):t.if(n._`${e} >= ${l}`,()=>t.assign(p,!0)))}(i)))}function f(i,n){t.forRange("i",0,d,t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:s.Type.Num,compositeRule:!0},i),n()})}void 0===c&&1===l?f(p,()=>t.if(p,()=>t.break())):0===l?(t.let(p,!0),void 0!==c&&t.if(n._`${o}.length > 0`,g)):(t.let(p,!1),g()),e.result(p,()=>e.reset())}};t.default=r},15860(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const n=i(38994),s=i(67218),r=i(24954);t.error={message:({params:{property:e,depsCount:t,deps:i}})=>{const s=1===t?"property":"properties";return n.str`must have ${s} ${i} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:i,missingProperty:s}})=>n._`{property: ${e},
    missingProperty: ${s},
    depsCount: ${t},
    deps: ${i}}`};const o={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(e){const[t,i]=function({schema:e}){const t={},i={};for(const n in e)"__proto__"!==n&&((Array.isArray(e[n])?t:i)[n]=e[n]);return[t,i]}(e);a(e,t),l(e,i)}};function a(e,t=e.schema){const{gen:i,data:s,it:o}=e;if(0===Object.keys(t).length)return;const a=i.let("missing");for(const l in t){const c=t[l];if(0===c.length)continue;const h=(0,r.propertyInData)(i,s,l,o.opts.ownProperties);e.setParams({property:l,depsCount:c.length,deps:c.join(", ")}),o.allErrors?i.if(h,()=>{for(const t of c)(0,r.checkReportMissingProp)(e,t)}):(i.if(n._`${h} && (${(0,r.checkMissingProp)(e,c,a)})`),(0,r.reportMissingProp)(e,a),i.else())}}function l(e,t=e.schema){const{gen:i,data:n,keyword:o,it:a}=e,l=i.name("valid");for(const c in t)(0,s.alwaysValidSchema)(a,t[c])||(i.if((0,r.propertyInData)(i,n,c,a.opts.ownProperties),()=>{const t=e.subschema({keyword:o,schemaProp:c},l);e.mergeValidEvaluated(t,l)},()=>i.var(l,!0)),e.ok(l))}t.validatePropertyDeps=a,t.validateSchemaDeps=l,t.default=o},8102(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(38994),s=i(67218),r={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>n.str`must match "${e.ifClause}" schema`,params:({params:e})=>n._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:t,parentSchema:i,it:r}=e;void 0===i.then&&void 0===i.else&&(0,s.checkStrictMode)(r,'"if" without "then" and "else" is ignored');const a=o(r,"then"),l=o(r,"else");if(!a&&!l)return;const c=t.let("valid",!0),h=t.name("_valid");if(function(){const t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},h);e.mergeEvaluated(t)}(),e.reset(),a&&l){const i=t.let("ifClause");e.setParams({ifClause:i}),t.if(h,u("then",i),u("else",i))}else a?t.if(h,u("then")):t.if((0,n.not)(h),u("else"));function u(i,s){return()=>{const r=e.subschema({keyword:i},h);t.assign(c,h),e.mergeValidEvaluated(r,c),s?t.assign(s,n._`${i}`):e.setParams({ifClause:i})}}e.pass(c,()=>e.error(!0))}};function o(e,t){const i=e.schema[t];return void 0!==i&&!(0,s.alwaysValidSchema)(e,i)}t.default=r},88313(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(8333),s=i(51997),r=i(23665),o=i(5153),a=i(32692),l=i(15860),c=i(80374),h=i(88401),u=i(23252),d=i(46398),p=i(84948),g=i(21070),f=i(5368),m=i(12003),y=i(8102),v=i(71871);t.default=function(e=!1){const t=[p.default,g.default,f.default,m.default,y.default,v.default,c.default,h.default,l.default,u.default,d.default];return e?t.push(s.default,o.default):t.push(n.default,r.default),t.push(a.default),t}},23665(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;const n=i(38994),s=i(67218),r=i(24954),o={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:i}=e;if(Array.isArray(t))return a(e,"additionalItems",t);i.items=!0,(0,s.alwaysValidSchema)(i,t)||e.ok((0,r.validateArray)(e))}};function a(e,t,i=e.schema){const{gen:r,parentSchema:o,data:a,keyword:l,it:c}=e;!function(e){const{opts:n,errSchemaPath:r}=c,o=i.length,a=o===e.minItems&&(o===e.maxItems||!1===e[t]);if(n.strictTuples&&!a){const e=`"${l}" is ${o}-tuple, but minItems or maxItems/${t} are not specified or different at path "${r}"`;(0,s.checkStrictMode)(c,e,n.strictTuples)}}(o),c.opts.unevaluated&&i.length&&!0!==c.items&&(c.items=s.mergeEvaluated.items(r,i.length,c.items));const h=r.name("valid"),u=r.const("len",n._`${a}.length`);i.forEach((t,i)=>{(0,s.alwaysValidSchema)(c,t)||(r.if(n._`${u} > ${i}`,()=>e.subschema({keyword:l,schemaProp:i,dataProp:i},h)),e.ok(h))})}t.validateTuple=a,t.default=o},5153(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(38994),s=i(67218),r=i(24954),o=i(8333),a={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>n.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>n._`{limit: ${e}}`},code(e){const{schema:t,parentSchema:i,it:n}=e,{prefixItems:a}=i;n.items=!0,(0,s.alwaysValidSchema)(n,t)||(a?(0,o.validateAdditionalItems)(e,a):e.ok((0,r.validateArray)(e)))}};t.default=a},84948(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(67218),s={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:i,it:s}=e;if((0,n.alwaysValidSchema)(s,i))return void e.fail();const r=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},r),e.failResult(r,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};t.default=s},5368(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(38994),s=i(67218),r={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>n._`{passingSchemas: ${e.passing}}`},code(e){const{gen:t,schema:i,parentSchema:r,it:o}=e;if(!Array.isArray(i))throw new Error("ajv implementation error");if(o.opts.discriminator&&r.discriminator)return;const a=i,l=t.let("valid",!1),c=t.let("passing",null),h=t.name("_valid");e.setParams({passing:c}),t.block(function(){a.forEach((i,r)=>{let a;(0,s.alwaysValidSchema)(o,i)?t.var(h,!0):a=e.subschema({keyword:"oneOf",schemaProp:r,compositeRule:!0},h),r>0&&t.if(n._`${h} && ${l}`).assign(l,!1).assign(c,n._`[${c}, ${r}]`).else(),t.if(h,()=>{t.assign(l,!0),t.assign(c,r),a&&e.mergeEvaluated(a,n.Name)})})}),e.result(l,()=>e.reset(),()=>e.error(!0))}};t.default=r},46398(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(24954),s=i(38994),r=i(67218),o=i(67218),a={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:i,data:a,parentSchema:l,it:c}=e,{opts:h}=c,u=(0,n.allSchemaProperties)(i),d=u.filter(e=>(0,r.alwaysValidSchema)(c,i[e]));if(0===u.length||d.length===u.length&&(!c.opts.unevaluated||!0===c.props))return;const p=h.strictSchema&&!h.allowMatchingProperties&&l.properties,g=t.name("valid");!0===c.props||c.props instanceof s.Name||(c.props=(0,o.evaluatedPropsToName)(t,c.props));const{props:f}=c;function m(e){for(const t in p)new RegExp(e).test(t)&&(0,r.checkStrictMode)(c,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function y(i){t.forIn("key",a,r=>{t.if(s._`${(0,n.usePattern)(e,i)}.test(${r})`,()=>{const n=d.includes(i);n||e.subschema({keyword:"patternProperties",schemaProp:i,dataProp:r,dataPropType:o.Type.Str},g),c.opts.unevaluated&&!0!==f?t.assign(s._`${f}[${r}]`,!0):n||c.allErrors||t.if((0,s.not)(g),()=>t.break())})})}!function(){for(const e of u)p&&m(e),c.allErrors?y(e):(t.var(g,!0),y(e),t.if(g))}()}};t.default=a},51997(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(23665),s={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,n.validateTuple)(e,"items")};t.default=s},23252(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(36023),s=i(24954),r=i(67218),o=i(88401),a={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:i,parentSchema:a,data:l,it:c}=e;"all"===c.opts.removeAdditional&&void 0===a.additionalProperties&&o.default.code(new n.KeywordCxt(c,o.default,"additionalProperties"));const h=(0,s.allSchemaProperties)(i);for(const e of h)c.definedProperties.add(e);c.opts.unevaluated&&h.length&&!0!==c.props&&(c.props=r.mergeEvaluated.props(t,(0,r.toHash)(h),c.props));const u=h.filter(e=>!(0,r.alwaysValidSchema)(c,i[e]));if(0===u.length)return;const d=t.name("valid");for(const i of u)p(i)?g(i):(t.if((0,s.propertyInData)(t,l,i,c.opts.ownProperties)),g(i),c.allErrors||t.else().var(d,!0),t.endIf()),e.it.definedProperties.add(i),e.ok(d);function p(e){return c.opts.useDefaults&&!c.compositeRule&&void 0!==i[e].default}function g(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},d)}}};t.default=a},80374(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(38994),s=i(67218),r={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>n._`{propertyName: ${e.propertyName}}`},code(e){const{gen:t,schema:i,data:r,it:o}=e;if((0,s.alwaysValidSchema)(o,i))return;const a=t.name("valid");t.forIn("key",r,i=>{e.setParams({propertyName:i}),e.subschema({keyword:"propertyNames",data:i,dataTypes:["string"],propertyName:i,compositeRule:!0},a),t.if((0,n.not)(a),()=>{e.error(!0),o.allErrors||t.break()})}),e.ok(a)}};t.default=r},71871(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(67218),s={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:i}){void 0===t.if&&(0,n.checkStrictMode)(i,`"${e}" without "if" is ignored`)}};t.default=s},24954(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;const n=i(38994),s=i(67218),r=i(86660),o=i(67218);function a(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:n._`Object.prototype.hasOwnProperty`})}function l(e,t,i){return n._`${a(e)}.call(${t}, ${i})`}function c(e,t,i,s){const r=n._`${t}${(0,n.getProperty)(i)} === undefined`;return s?(0,n.or)(r,(0,n.not)(l(e,t,i))):r}function h(e){return e?Object.keys(e).filter(e=>"__proto__"!==e):[]}t.checkReportMissingProp=function(e,t){const{gen:i,data:s,it:r}=e;i.if(c(i,s,t,r.opts.ownProperties),()=>{e.setParams({missingProperty:n._`${t}`},!0),e.error()})},t.checkMissingProp=function({gen:e,data:t,it:{opts:i}},s,r){return(0,n.or)(...s.map(s=>(0,n.and)(c(e,t,s,i.ownProperties),n._`${r} = ${s}`)))},t.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},t.hasPropFunc=a,t.isOwnProperty=l,t.propertyInData=function(e,t,i,s){const r=n._`${t}${(0,n.getProperty)(i)} !== undefined`;return s?n._`${r} && ${l(e,t,i)}`:r},t.noPropertyInData=c,t.allSchemaProperties=h,t.schemaProperties=function(e,t){return h(t).filter(i=>!(0,s.alwaysValidSchema)(e,t[i]))},t.callValidateCode=function({schemaCode:e,data:t,it:{gen:i,topSchemaRef:s,schemaPath:o,errorPath:a},it:l},c,h,u){const d=u?n._`${e}, ${t}, ${s}${o}`:t,p=[[r.default.instancePath,(0,n.strConcat)(r.default.instancePath,a)],[r.default.parentData,l.parentData],[r.default.parentDataProperty,l.parentDataProperty],[r.default.rootData,r.default.rootData]];l.opts.dynamicRef&&p.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const g=n._`${d}, ${i.object(...p)}`;return h!==n.nil?n._`${c}.call(${h}, ${g})`:n._`${c}(${g})`};const u=n._`new RegExp`;t.usePattern=function({gen:e,it:{opts:t}},i){const s=t.unicodeRegExp?"u":"",{regExp:r}=t.code,a=r(i,s);return e.scopeValue("pattern",{key:a.toString(),ref:a,code:n._`${"new RegExp"===r.code?u:(0,o.useFunc)(e,r)}(${i}, ${s})`})},t.validateArray=function(e){const{gen:t,data:i,keyword:r,it:o}=e,a=t.name("valid");if(o.allErrors){const e=t.let("valid",!0);return l(()=>t.assign(e,!1)),e}return t.var(a,!0),l(()=>t.break()),a;function l(o){const l=t.const("len",n._`${i}.length`);t.forRange("i",0,l,i=>{e.subschema({keyword:r,dataProp:i,dataPropType:s.Type.Num},a),t.if((0,n.not)(a),o)})}},t.validateUnion=function(e){const{gen:t,schema:i,keyword:r,it:o}=e;if(!Array.isArray(i))throw new Error("ajv implementation error");if(i.some(e=>(0,s.alwaysValidSchema)(o,e))&&!o.opts.unevaluated)return;const a=t.let("valid",!1),l=t.name("_valid");t.block(()=>i.forEach((i,s)=>{const o=e.subschema({keyword:r,schemaProp:s,compositeRule:!0},l);t.assign(a,n._`${a} || ${l}`),e.mergeValidEvaluated(o,l)||t.if((0,n.not)(a))})),e.result(a,()=>e.reset(),()=>e.error(!0))}},33330(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};t.default=i},20500(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(33330),s=i(30930),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",n.default,s.default];t.default=r},30930(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;const n=i(4220),s=i(24954),r=i(38994),o=i(86660),a=i(91688),l=i(67218),c={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:i,it:s}=e,{baseId:o,schemaEnv:l,validateName:c,opts:d,self:p}=s,{root:g}=l;if(("#"===i||"#/"===i)&&o===g.baseId)return function(){if(l===g)return u(e,c,l,l.$async);const i=t.scopeValue("root",{ref:g});return u(e,r._`${i}.validate`,g,g.$async)}();const f=a.resolveRef.call(p,g,o,i);if(void 0===f)throw new n.default(s.opts.uriResolver,o,i);return f instanceof a.SchemaEnv?function(t){const i=h(e,t);u(e,i,t,t.$async)}(f):function(n){const s=t.scopeValue("schema",!0===d.code.source?{ref:n,code:(0,r.stringify)(n)}:{ref:n}),o=t.name("valid"),a=e.subschema({schema:n,dataTypes:[],schemaPath:r.nil,topSchemaRef:s,errSchemaPath:i},o);e.mergeEvaluated(a),e.ok(o)}(f)}};function h(e,t){const{gen:i}=e;return t.validate?i.scopeValue("validate",{ref:t.validate}):r._`${i.scopeValue("wrapper",{ref:t})}.validate`}function u(e,t,i,n){const{gen:a,it:c}=e,{allErrors:h,schemaEnv:u,opts:d}=c,p=d.passContext?o.default.this:r.nil;function g(e){const t=r._`${e}.errors`;a.assign(o.default.vErrors,r._`${o.default.vErrors} === null ? ${t} : ${o.default.vErrors}.concat(${t})`),a.assign(o.default.errors,r._`${o.default.vErrors}.length`)}function f(e){var t;if(!c.opts.unevaluated)return;const n=null===(t=null==i?void 0:i.validate)||void 0===t?void 0:t.evaluated;if(!0!==c.props)if(n&&!n.dynamicProps)void 0!==n.props&&(c.props=l.mergeEvaluated.props(a,n.props,c.props));else{const t=a.var("props",r._`${e}.evaluated.props`);c.props=l.mergeEvaluated.props(a,t,c.props,r.Name)}if(!0!==c.items)if(n&&!n.dynamicItems)void 0!==n.items&&(c.items=l.mergeEvaluated.items(a,n.items,c.items));else{const t=a.var("items",r._`${e}.evaluated.items`);c.items=l.mergeEvaluated.items(a,t,c.items,r.Name)}}n?function(){if(!u.$async)throw new Error("async schema referenced by sync schema");const i=a.let("valid");a.try(()=>{a.code(r._`await ${(0,s.callValidateCode)(e,t,p)}`),f(t),h||a.assign(i,!0)},e=>{a.if(r._`!(${e} instanceof ${c.ValidationError})`,()=>a.throw(e)),g(e),h||a.assign(i,!1)}),e.ok(i)}():e.result((0,s.callValidateCode)(e,t,p),()=>f(t),()=>g(t))}t.getValidate=h,t.callRef=u,t.default=c},29376(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(38994),s=i(15141),r=i(91688),o=i(4220),a=i(67218),l={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===s.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:i}})=>n._`{error: ${e}, tag: ${i}, tagValue: ${t}}`},code(e){const{gen:t,data:i,schema:l,parentSchema:c,it:h}=e,{oneOf:u}=c;if(!h.opts.discriminator)throw new Error("discriminator: requires discriminator option");const d=l.propertyName;if("string"!=typeof d)throw new Error("discriminator: requires propertyName");if(l.mapping)throw new Error("discriminator: mapping is not supported");if(!u)throw new Error("discriminator: requires oneOf keyword");const p=t.let("valid",!1),g=t.const("tag",n._`${i}${(0,n.getProperty)(d)}`);function f(i){const s=t.name("valid"),r=e.subschema({keyword:"oneOf",schemaProp:i},s);return e.mergeEvaluated(r,n.Name),s}t.if(n._`typeof ${g} == "string"`,()=>function(){const i=function(){var e;const t={},i=s(c);let n=!0;for(let t=0;t<u.length;t++){let c=u[t];if((null==c?void 0:c.$ref)&&!(0,a.schemaHasRulesButRef)(c,h.self.RULES)){const e=c.$ref;if(c=r.resolveRef.call(h.self,h.schemaEnv.root,h.baseId,e),c instanceof r.SchemaEnv&&(c=c.schema),void 0===c)throw new o.default(h.opts.uriResolver,h.baseId,e)}const p=null===(e=null==c?void 0:c.properties)||void 0===e?void 0:e[d];if("object"!=typeof p)throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${d}"`);n=n&&(i||s(c)),l(p,t)}if(!n)throw new Error(`discriminator: "${d}" must be required`);return t;function s({required:e}){return Array.isArray(e)&&e.includes(d)}function l(e,t){if(e.const)p(e.const,t);else{if(!e.enum)throw new Error(`discriminator: "properties/${d}" must have "const" or "enum"`);for(const i of e.enum)p(i,t)}}function p(e,i){if("string"!=typeof e||e in t)throw new Error(`discriminator: "${d}" values must be unique strings`);t[e]=i}}();t.if(!1);for(const e in i)t.elseIf(n._`${g} === ${e}`),t.assign(p,f(i[e]));t.else(),e.error(!1,{discrError:s.DiscrError.Mapping,tag:g,tagName:d}),t.endIf()}(),()=>e.error(!1,{discrError:s.DiscrError.Tag,tag:g,tagName:d})),e.ok(p)}};t.default=l},15141(e,t){"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,function(e){e.Tag="tag",e.Mapping="mapping"}(i||(t.DiscrError=i={}))},83959(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(20500),s=i(30659),r=i(88313),o=i(38563),a=i(44618),l=[n.default,s.default,(0,r.default)(),o.default,a.metadataVocabulary,a.contentVocabulary];t.default=l},40424(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(38994),s={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>n.str`must match format "${e}"`,params:({schemaCode:e})=>n._`{format: ${e}}`},code(e,t){const{gen:i,data:s,$data:r,schema:o,schemaCode:a,it:l}=e,{opts:c,errSchemaPath:h,schemaEnv:u,self:d}=l;c.validateFormats&&(r?function(){const r=i.scopeValue("formats",{ref:d.formats,code:c.code.formats}),o=i.const("fDef",n._`${r}[${a}]`),l=i.let("fType"),h=i.let("format");i.if(n._`typeof ${o} == "object" && !(${o} instanceof RegExp)`,()=>i.assign(l,n._`${o}.type || "string"`).assign(h,n._`${o}.validate`),()=>i.assign(l,n._`"string"`).assign(h,o)),e.fail$data((0,n.or)(!1===c.strictSchema?n.nil:n._`${a} && !${h}`,function(){const e=u.$async?n._`(${o}.async ? await ${h}(${s}) : ${h}(${s}))`:n._`${h}(${s})`,i=n._`(typeof ${h} == "function" ? ${e} : ${h}.test(${s}))`;return n._`${h} && ${h} !== true && ${l} === ${t} && !${i}`}()))}():function(){const r=d.formats[o];if(!r)return void function(){if(!1!==c.strictSchema)throw new Error(e());function e(){return`unknown format "${o}" ignored in schema at path "${h}"`}d.logger.warn(e())}();if(!0===r)return;const[a,l,p]=function(e){const t=e instanceof RegExp?(0,n.regexpCode)(e):c.code.formats?n._`${c.code.formats}${(0,n.getProperty)(o)}`:void 0,s=i.scopeValue("formats",{key:o,ref:e,code:t});return"object"!=typeof e||e instanceof RegExp?["string",e,s]:[e.type||"string",e.validate,n._`${s}.validate`]}(r);a===t&&e.pass(function(){if("object"==typeof r&&!(r instanceof RegExp)&&r.async){if(!u.$async)throw new Error("async format in sync schema");return n._`await ${p}(${s})`}return"function"==typeof l?n._`${p}(${s})`:n._`${p}.test(${s})`}())}())}};t.default=s},38563(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=[i(40424).default];t.default=n},44618(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},17080(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(38994),s=i(67218),r=i(6013),o={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>n._`{allowedValue: ${e}}`},code(e){const{gen:t,data:i,$data:o,schemaCode:a,schema:l}=e;o||l&&"object"==typeof l?e.fail$data(n._`!${(0,s.useFunc)(t,r.default)}(${i}, ${a})`):e.fail(n._`${l} !== ${i}`)}};t.default=o},65358(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(38994),s=i(67218),r=i(6013),o={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>n._`{allowedValues: ${e}}`},code(e){const{gen:t,data:i,$data:o,schema:a,schemaCode:l,it:c}=e;if(!o&&0===a.length)throw new Error("enum must have non-empty array");const h=a.length>=c.opts.loopEnum;let u;const d=()=>null!=u?u:u=(0,s.useFunc)(t,r.default);let p;if(h||o)p=t.let("valid"),e.block$data(p,function(){t.assign(p,!1),t.forOf("v",l,e=>t.if(n._`${d()}(${i}, ${e})`,()=>t.assign(p,!0).break()))});else{if(!Array.isArray(a))throw new Error("ajv implementation error");const e=t.const("vSchema",l);p=(0,n.or)(...a.map((t,s)=>function(e,t){const s=a[t];return"object"==typeof s&&null!==s?n._`${d()}(${i}, ${e}[${t}])`:n._`${i} === ${s}`}(e,s)))}e.pass(p)}};t.default=o},30659(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(68997),s=i(89190),r=i(94280),o=i(78805),a=i(12189),l=i(33138),c=i(48870),h=i(11858),u=i(17080),d=i(65358),p=[n.default,s.default,r.default,o.default,a.default,l.default,c.default,h.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},u.default,d.default];t.default=p},48870(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(38994),s={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const i="maxItems"===e?"more":"fewer";return n.str`must NOT have ${i} than ${t} items`},params:({schemaCode:e})=>n._`{limit: ${e}}`},code(e){const{keyword:t,data:i,schemaCode:s}=e,r="maxItems"===t?n.operators.GT:n.operators.LT;e.fail$data(n._`${i}.length ${r} ${s}`)}};t.default=s},94280(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(38994),s=i(67218),r=i(25532),o={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const i="maxLength"===e?"more":"fewer";return n.str`must NOT have ${i} than ${t} characters`},params:({schemaCode:e})=>n._`{limit: ${e}}`},code(e){const{keyword:t,data:i,schemaCode:o,it:a}=e,l="maxLength"===t?n.operators.GT:n.operators.LT,c=!1===a.opts.unicode?n._`${i}.length`:n._`${(0,s.useFunc)(e.gen,r.default)}(${i})`;e.fail$data(n._`${c} ${l} ${o}`)}};t.default=o},68997(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(38994),s=n.operators,r={maximum:{okStr:"<=",ok:s.LTE,fail:s.GT},minimum:{okStr:">=",ok:s.GTE,fail:s.LT},exclusiveMaximum:{okStr:"<",ok:s.LT,fail:s.GTE},exclusiveMinimum:{okStr:">",ok:s.GT,fail:s.LTE}},o={message:({keyword:e,schemaCode:t})=>n.str`must be ${r[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>n._`{comparison: ${r[e].okStr}, limit: ${t}}`},a={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:o,code(e){const{keyword:t,data:i,schemaCode:s}=e;e.fail$data(n._`${i} ${r[t].fail} ${s} || isNaN(${i})`)}};t.default=a},12189(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(38994),s={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const i="maxProperties"===e?"more":"fewer";return n.str`must NOT have ${i} than ${t} properties`},params:({schemaCode:e})=>n._`{limit: ${e}}`},code(e){const{keyword:t,data:i,schemaCode:s}=e,r="maxProperties"===t?n.operators.GT:n.operators.LT;e.fail$data(n._`Object.keys(${i}).length ${r} ${s}`)}};t.default=s},89190(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(38994),s={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>n.str`must be multiple of ${e}`,params:({schemaCode:e})=>n._`{multipleOf: ${e}}`},code(e){const{gen:t,data:i,schemaCode:s,it:r}=e,o=r.opts.multipleOfPrecision,a=t.let("res"),l=o?n._`Math.abs(Math.round(${a}) - ${a}) > 1e-${o}`:n._`${a} !== parseInt(${a})`;e.fail$data(n._`(${s} === 0 || (${a} = ${i}/${s}, ${l}))`)}};t.default=s},78805(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(24954),s=i(67218),r=i(38994),o={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>r.str`must match pattern "${e}"`,params:({schemaCode:e})=>r._`{pattern: ${e}}`},code(e){const{gen:t,data:i,$data:o,schema:a,schemaCode:l,it:c}=e,h=c.opts.unicodeRegExp?"u":"";if(o){const{regExp:n}=c.opts.code,o="new RegExp"===n.code?r._`new RegExp`:(0,s.useFunc)(t,n),a=t.let("valid");t.try(()=>t.assign(a,r._`${o}(${l}, ${h}).test(${i})`),()=>t.assign(a,!1)),e.fail$data(r._`!${a}`)}else{const t=(0,n.usePattern)(e,a);e.fail$data(r._`!${t}.test(${i})`)}}};t.default=o},33138(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(24954),s=i(38994),r=i(67218),o={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>s.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>s._`{missingProperty: ${e}}`},code(e){const{gen:t,schema:i,schemaCode:o,data:a,$data:l,it:c}=e,{opts:h}=c;if(!l&&0===i.length)return;const u=i.length>=h.loopRequired;if(c.allErrors?function(){if(u||l)e.block$data(s.nil,d);else for(const t of i)(0,n.checkReportMissingProp)(e,t)}():function(){const r=t.let("missing");if(u||l){const i=t.let("valid",!0);e.block$data(i,()=>function(i,r){e.setParams({missingProperty:i}),t.forOf(i,o,()=>{t.assign(r,(0,n.propertyInData)(t,a,i,h.ownProperties)),t.if((0,s.not)(r),()=>{e.error(),t.break()})},s.nil)}(r,i)),e.ok(i)}else t.if((0,n.checkMissingProp)(e,i,r)),(0,n.reportMissingProp)(e,r),t.else()}(),h.strictRequired){const t=e.parentSchema.properties,{definedProperties:n}=e.it;for(const e of i)if(void 0===(null==t?void 0:t[e])&&!n.has(e)){const t=`required property "${e}" is not defined at "${c.schemaEnv.baseId+c.errSchemaPath}" (strictRequired)`;(0,r.checkStrictMode)(c,t,c.opts.strictRequired)}}function d(){t.forOf("prop",o,i=>{e.setParams({missingProperty:i}),t.if((0,n.noPropertyInData)(t,a,i,h.ownProperties),()=>e.error())})}}};t.default=o},11858(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(26419),s=i(38994),r=i(67218),o=i(6013),a={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>s.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>s._`{i: ${e}, j: ${t}}`},code(e){const{gen:t,data:i,$data:a,schema:l,parentSchema:c,schemaCode:h,it:u}=e;if(!a&&!l)return;const d=t.let("valid"),p=c.items?(0,n.getSchemaTypes)(c.items):[];function g(r,o){const a=t.name("item"),l=(0,n.checkDataTypes)(p,a,u.opts.strictNumbers,n.DataType.Wrong),c=t.const("indices",s._`{}`);t.for(s._`;${r}--;`,()=>{t.let(a,s._`${i}[${r}]`),t.if(l,s._`continue`),p.length>1&&t.if(s._`typeof ${a} == "string"`,s._`${a} += "_"`),t.if(s._`typeof ${c}[${a}] == "number"`,()=>{t.assign(o,s._`${c}[${a}]`),e.error(),t.assign(d,!1).break()}).code(s._`${c}[${a}] = ${r}`)})}function f(n,a){const l=(0,r.useFunc)(t,o.default),c=t.name("outer");t.label(c).for(s._`;${n}--;`,()=>t.for(s._`${a} = ${n}; ${a}--;`,()=>t.if(s._`${l}(${i}[${n}], ${i}[${a}])`,()=>{e.error(),t.assign(d,!1).break(c)})))}e.block$data(d,function(){const n=t.let("i",s._`${i}.length`),r=t.let("j");e.setParams({i:n,j:r}),t.assign(d,!0),t.if(s._`${n} > 1`,()=>(p.length>0&&!p.some(e=>"object"===e||"array"===e)?g:f)(n,r))},s._`${h} === false`),e.ok(d)}};t.default=a},14538(e,t){!function(e){"use strict";function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i<t;i++)n[i]=e[i];return n}function i(e,t,i,n,s,r,o){try{var a=e[r](o),l=a.value}catch(e){return void i(e)}a.done?t(l):Promise.resolve(l).then(n,s)}function n(e){return function(){var t=this,n=arguments;return new Promise(function(s,r){var o=e.apply(t,n);function a(e){i(o,s,r,a,l,"next",e)}function l(e){i(o,s,r,a,l,"throw",e)}a(void 0)})}}function s(e,t,i){return t=l(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,h()?Reflect.construct(t,i||[],l(e).constructor):t.apply(e,i))}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t,i){return Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e,t,i){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&m(e,t)}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(h=function(){return!!e})()}function u(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function d(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?u(Object(i),!0).forEach(function(t){a(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):u(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function p(e,t){if(null==e)return{};var i,n,s=function(e,t){if(null==e)return{};var i={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;i[n]=e[n]}return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)i=r[n],-1===t.indexOf(i)&&{}.propertyIsEnumerable.call(e,i)&&(s[i]=e[i])}return s}function g(){var e,t,i="function"==typeof Symbol?Symbol:{},n=i.iterator||"@@iterator",s=i.toStringTag||"@@toStringTag";function r(i,n,s,r){var l=n&&n.prototype instanceof a?n:a,c=Object.create(l.prototype);return f(c,"_invoke",function(i,n,s){var r,a,l,c=0,h=s||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,i){return r=t,a=0,l=e,d.n=i,o}};function p(i,n){for(a=i,l=n,t=0;!u&&c&&!s&&t<h.length;t++){var s,r=h[t],p=d.p,g=r[2];i>3?(s=g===n)&&(l=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((s=i<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(s=i<3||r[0]>n||n>g)&&(r[4]=i,r[5]=n,d.n=g,a=0))}if(s||i>1)return o;throw u=!0,n}return function(s,h,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===h&&p(h,g),a=h,l=g;(t=a<2?e:l)||!u;){r||(a?a<3?(a>1&&(d.n=-1),p(a,l)):d.n=l:d.v=l);try{if(c=2,r){if(a||(s="next"),t=r[s]){if(!(t=t.call(r,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(l=TypeError("The iterator does not provide a '"+s+"' method"),a=1);r=e}else if((t=(u=d.n<0)?l:i.call(n,d))!==o)break}catch(t){r=e,a=1,l=t}finally{c=1}}return{value:t,done:u}}}(i,s,r),!0),c}var o={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var h=[][n]?t(t([][n]())):(f(t={},n,function(){return this}),t),u=c.prototype=a.prototype=Object.create(h);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,f(e,s,"GeneratorFunction")),e.prototype=Object.create(u),e}return l.prototype=c,f(u,"constructor",c),f(c,"constructor",l),l.displayName="GeneratorFunction",f(c,s,"GeneratorFunction"),f(u),f(u,s,"Generator"),f(u,n,function(){return this}),f(u,"toString",function(){return"[object Generator]"}),(g=function(){return{w:r,m:d}})()}function f(e,t,i,n){var s=Object.defineProperty;try{s({},"",{})}catch(e){s=0}f=function(e,t,i,n){function r(t,i){f(e,t,function(e){return this._invoke(t,i,e)})}t?s?s(e,t,{value:i,enumerable:!n,configurable:!n,writable:!n}):e[t]=i:(r("next",0),r("throw",1),r("return",2))},f(e,t,i,n)}function m(e,t){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},m(e,t)}function y(e,i){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,s,r,o,a=[],l=!0,c=!1;try{if(r=(i=i.call(e)).next,0===t);else for(;!(l=(n=r.call(i)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){c=!0,s=e}finally{try{if(!l&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(c)throw s}}return a}}(e,i)||function(e,i){if(e){if("string"==typeof e)return t(e,i);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(e,i):void 0}}(e,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v(e)}var b={CALLBACK_OPERATION_INVOKED:"CALLBACK_OPERATION_INVOKED",CONTENT_LOADED:"CONTENT_LOADED",EXPERIENCE_INITIALIZED:"EXPERIENCE_INITIALIZED",ERROR_OCCURRED:"ERROR_OCCURRED",SIZE_CHANGED:"SIZE_CHANGED",PARAMETERS_CHANGED:"PARAMETERS_CHANGED",SELECTED_SHEET_CHANGED:"SELECTED_SHEET_CHANGED",MODAL_OPENED:"MODAL_OPENED",Q_SEARCH_CLOSED:"Q_SEARCH_CLOSED",Q_SEARCH_OPENED:"Q_SEARCH_OPENED",Q_SEARCH_FOCUSED:"Q_SEARCH_FOCUSED",Q_SEARCH_SIZE_CHANGED:"Q_SEARCH_SIZE_CHANGED",Q_SEARCH_ENTERED_FULLSCREEN:"Q_SEARCH_ENTERED_FULLSCREEN",Q_SEARCH_EXITED_FULLSCREEN:"Q_SEARCH_EXITED_FULLSCREEN",Q_PANEL_ENTERED_FULLSCREEN:"Q_PANEL_ENTERED_FULLSCREEN",Q_PANEL_EXITED_FULLSCREEN:"Q_PANEL_EXITED_FULLSCREEN",PAGE_NAVIGATION:"PAGE_NAVIGATION",PARAMETERS_LOADED:"PARAMETERS_LOADED"},C={FRAME_STARTED:"FRAME_STARTED",FRAME_MOUNTED:"FRAME_MOUNTED",FRAME_LOADED:"FRAME_LOADED",FRAME_REMOVED:"FRAME_REMOVED"},w={FRAME_NOT_CREATED:"FRAME_NOT_CREATED",NO_BODY:"NO_BODY",NO_CONTAINER:"NO_CONTAINER",INVALID_CONTAINER:"INVALID_CONTAINER",NO_URL:"NO_URL",INVALID_URL:"INVALID_URL",NO_FRAME_OPTIONS:"NO_FRAME_OPTIONS",INVALID_FRAME_OPTIONS:"INVALID_FRAME_OPTIONS"},S={UNRECOGNIZED_CONTENT_OPTIONS:"UNRECOGNIZED_CONTENT_OPTIONS",UNRECOGNIZED_FRAME_OPTIONS:"UNRECOGNIZED_FRAME_OPTIONS",UNRECOGNIZED_EVENT_TARGET:"UNRECOGNIZED_EVENT_TARGET"},x={SET_PARAMETERS:"SET_PARAMETERS",SET_SELECTED_SHEET_ID:"SET_SELECTED_SHEET_ID",SET_Q_SEARCH_QUESTION:"SET_Q_SEARCH_QUESTION",SET_VISUAL_ACTIONS:"SET_VISUAL_ACTIONS",SET_THEME:"SET_THEME",ADD_FILTER_GROUPS:"ADD_FILTER_GROUPS",UPDATE_FILTER_GROUPS:"UPDATE_FILTER_GROUPS",REMOVE_FILTER_GROUPS:"REMOVE_FILTER_GROUPS",ADD_VISUAL_ACTIONS:"ADD_VISUAL_ACTIONS",REMOVE_VISUAL_ACTIONS:"REMOVE_VISUAL_ACTIONS",SET_THEME_OVERRIDE:"SET_THEME_OVERRIDE",PRELOAD_THEMES:"PRELOAD_THEMES",CREATE_SHARED_VIEW:"CREATE_SHARED_VIEW"},E={GET_PARAMETERS:"GET_PARAMETERS",GET_SHEETS:"GET_SHEETS",GET_SHEET_VISUALS:"GET_SHEET_VISUALS",GET_VISUAL_ACTIONS:"GET_VISUAL_ACTIONS",GET_SELECTED_SHEET_ID:"GET_SELECTED_SHEET_ID",GET_FILTER_GROUPS_FOR_SHEET:"GET_FILTER_GROUPS_FOR_SHEET",GET_FILTER_GROUPS_FOR_VISUAL:"GET_FILTER_GROUPS_FOR_VISUAL"},A={ACKNOWLEDGE:"ACKNOWLEDGE",INITIATE_PRINT:"INITIATE_PRINT",NAVIGATE_TO_DASHBOARD:"NAVIGATE_TO_DASHBOARD",CLOSE_Q_SEARCH:"CLOSE_Q_SEARCH",UNDO:"UNDO",REDO:"REDO",RESET:"RESET",TOGGLE_EXECUTIVE_SUMMARY_PANE:"TOGGLE_EXECUTIVE_SUMMARY_PANE",OPEN_BUILD_VISUAL_PANE:"OPEN_BUILD_VISUAL_PANE",OPEN_DATA_QNA_PANE:"OPEN_DATA_QNA_PANE",TOGGLE_BOOKMARKS_PANE:"TOGGLE_BOOKMARKS_PANE",TOGGLE_THRESHOLD_ALERTS_PANE:"TOGGLE_THRESHOLD_ALERTS_PANE",TOGGLE_SCHEDULING_PANE:"TOGGLE_SCHEDULING_PANE",TOGGLE_RECENT_SNAPSHOTS_PANE:"TOGGLE_RECENT_SNAPSHOTS_PANE",IMPORT_OBJECTS:"IMPORT_OBJECTS",OPEN_BUILD_STORY_PANE:"OPEN_BUILD_STORY_PANE",SEND_PROMPT:"SEND_PROMPT"},M=Object.freeze({__proto__:null,ErrorChangeEventName:w,GetterMessageEventName:E,InfoChangeEventName:C,InfoMessageEventName:b,InvokerMessageEventName:A,SetterMessageEventName:x,WarnChangeEventName:S}),T=d(d(d({},C),w),S),D=d(d(d(d({},b),x),E),A),I={ERROR:"ERROR",INFO:"INFO",WARN:"WARN"},R=Object.freeze({__proto__:null,ChangeEventLevel:I,ChangeEventName:T,MessageEventName:D}),k=Object.freeze({__proto__:null}),P=Object.freeze({__proto__:null}),_=Object.freeze({__proto__:null}),L=Object.freeze({__proto__:null}),N={CONSOLE:"CONSOLE",CONTEXT:"CONTEXT",CONTROL:"CONTROL",VISUAL:"VISUAL",DASHBOARD:"DASHBOARD",QSEARCH:"QSEARCH",GENERATIVEQNA:"QSEARCH",QUICKCHAT:"QUICKCHAT"},O=Object.freeze({__proto__:null,ExperienceType:N}),F=Object.freeze({__proto__:null}),G={NULL:null,OTHER_BUCKET:null},B={INTEGER:null,STRING:null,DECIMAL:null,DATETIME:null},V=Object.freeze({__proto__:null,CALCULATED_METRIC_COLUMN_TYPE:B,SPECIAL_DATAPOINT_VALUE_TYPES:G}),H=Object.freeze({__proto__:null}),U=Object.freeze({__proto__:null}),z=Object.freeze({__proto__:null}),W={FULL:"FULL",SEARCH_BAR:"SEARCH_BAR"},j=Object.freeze({__proto__:null,GenerativeQnAPanelType:W}),$=Object.freeze({__proto__:null}),K=Object.freeze({__proto__:null}),Y=o(function e(t,i,n){r(this,e),this.eventName=t,this.message=i,this.data=n}),q=function(e){function t(e,i,n,o){var a;return r(this,t),(a=s(this,t,[e,n,o])).eventLevel=i,a}return c(t,e),o(t)}(Y),X=function(e){function t(e,i,n){var o;return r(this,t),(o=s(this,t,[e,i,n])).eventName=e,o}return c(t,e),o(t)}(Y),Z=function(e){function t(e,i,n,o){var a;return r(this,t),(a=s(this,t,[e,n,o])).eventTarget=i,a}return c(t,e),o(t)}(X),Q=function(e){function t(e,i,n,o,a,l,c){var h;return r(this,t),(h=s(this,t,[e,i,l,c])).timestamp=o,h.version=a,h.eventId=n,h}return c(t,e),o(t)}(Z),J=o(function e(){r(this,e)}),ee=o(function e(){r(this,e),a(this,"success",!0)}),te=o(function e(t){r(this,e),a(this,"success",!1),this.errorCode=t.errorCode,this.error=t.error,this.message=t.message}),ie=o(function e(t){r(this,e),a(this,"success",!0),this.message=t});let ne;const se=new Uint8Array(16);function re(){if(!ne&&(ne="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ne))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ne(se)}const oe=[];for(let e=0;e<256;++e)oe.push((e+256).toString(16).slice(1));var ae={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function le(e,t,i){if(ae.randomUUID&&!e)return ae.randomUUID();const n=(e=e||{}).random||(e.rng||re)();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,function(e,t=0){return oe[e[t+0]]+oe[e[t+1]]+oe[e[t+2]]+oe[e[t+3]]+"-"+oe[e[t+4]]+oe[e[t+5]]+"-"+oe[e[t+6]]+oe[e[t+7]]+"-"+oe[e[t+8]]+oe[e[t+9]]+"-"+oe[e[t+10]]+oe[e[t+11]]+oe[e[t+12]]+oe[e[t+13]]+oe[e[t+14]]+oe[e[t+15]]}(n)}var ce=o(function e(t,i,s,o){var l=this;r(this,e),a(this,"send",function(){var e=n(g().m(function e(t){var i;return g().w(function(e){for(;;)switch(e.n){case 0:if(l.experienceFrame&&l.internalExperience){e.n=1;break}throw new Error("Experience has not been initialized");case 1:return i=new Z(t.eventName,l.internalExperience,t.message,t.data),e.a(2,l.experienceFrame.send(i))}},e)}));return function(t){return e.apply(this,arguments)}}()),a(this,"addEventListener",function(e,t){return l.experienceFrame.addInternalEventListener(e,t)}),a(this,"setLogProvider",function(e){return l.logger=e,l}),a(this,"getInternalExperienceInfo",function(t){var i,n,s=-1;do{s++,i=d(d({},t),{},{contextId:l.controlOptions.contextId,discriminator:s}),n=e.getExperienceIdentifier(i)}while(l.experienceIdentifiers.has(n));return l.experienceIdentifiers.add(n),{experienceIdentifier:n,internalExperience:i}}),a(this,"transformContentOptions",function(e,t){return l.warnUnrecognizedContentOptions(Object.keys(t)),e}),a(this,"warnUnrecognizedContentOptions",function(e){var t,i,n;e.length>0&&(null===(t=(i=l.frameOptions).onChange)||void 0===t||t.call(i,new q(T.UNRECOGNIZED_CONTENT_OPTIONS,I.WARN,"Experience content options contain unrecognized properties",{unrecognizedContentOptions:e}),{frame:null}),null===(n=l.logger)||void 0===n||n.warn("Experience content options contain unrecognized properties"))}),a(this,"validateFrameOptions",function(){if(!l.frameOptions.url){var e,t,i="Url is required for the experience";throw null===(e=(t=l.frameOptions).onChange)||void 0===e||e.call(t,new q(T.NO_URL,I.ERROR,i),{frame:null}),new Error(i)}}),this.frameOptions=t,this.contentOptions=i,this.controlOptions=s,this.experienceIdentifiers=o,this.validateFrameOptions()});a(ce,"getExperienceIdentifier",function(e){if(e.experienceType===N.DASHBOARD)return[e.contextId,e.experienceType,e.dashboardId,e.discriminator].filter(Boolean).join("-");if(e.experienceType===N.VISUAL)return[e.contextId,e.experienceType,e.dashboardId,e.sheetId,e.visualId,e.discriminator].filter(Boolean).join("-");if([N.CONSOLE,N.CONTROL,N.CONTEXT,N.QSEARCH,N.GENERATIVEQNA,N.QUICKCHAT].includes(e.experienceType))return[e.contextId,e.experienceType,e.discriminator].filter(Boolean).join("-");throw new Error("Invalid experience unable to build experience identifier")});const he=2147483647,ue={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},de=Math.floor,pe=String.fromCharCode;function ge(e){throw new RangeError(ue[e])}const fe=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},me=function(e,t,i){let n=0;for(e=i?de(e/700):e>>1,e+=de(e/t);e>455;n+=36)e=de(e/35);return de(n+36*e/(e+38))},ye=function(e){const t=[];e=function(e){const t=[];let i=0;const n=e.length;for(;i<n;){const s=e.charCodeAt(i++);if(s>=55296&&s<=56319&&i<n){const n=e.charCodeAt(i++);56320==(64512&n)?t.push(((1023&s)<<10)+(1023&n)+65536):(t.push(s),i--)}else t.push(s)}return t}(e);const i=e.length;let n=128,s=0,r=72;for(const i of e)i<128&&t.push(pe(i));const o=t.length;let a=o;for(o&&t.push("-");a<i;){let i=he;for(const t of e)t>=n&&t<i&&(i=t);const l=a+1;i-n>de((he-s)/l)&&ge("overflow"),s+=(i-n)*l,n=i;for(const i of e)if(i<n&&++s>he&&ge("overflow"),i===n){let e=s;for(let i=36;;i+=36){const n=i<=r?1:i>=r+26?26:i-r;if(e<n)break;const s=e-n,o=36-n;t.push(pe(fe(n+s%o,0))),e=de(s/o)}t.push(pe(fe(e,0))),r=me(s,l,a===o),s=0,++a}++s,++n}return t.join("")};var ve=o(function e(t){var i=this;r(this,e),a(this,"classNames",[e.IFRAME_CLASS_NAME]),a(this,"getIframe",function(){return i.iframe}),a(this,"createIframePlaceholder",function(t){if(i.iframePlaceholder=document.createElement("div"),i.iframePlaceholder.id="".concat(i.iframeName,"-placeholder"),i.iframePlaceholder.style.width=i.width,i.iframePlaceholder.style.backgroundColor="rgba(0,0,0,.01)",i.iframePlaceholder.style.display="flex",i.iframePlaceholder.style.justifyContent="center",i.iframePlaceholder.style.alignItems="center",i.iframePlaceholder.className="".concat(e.IFRAME_CLASS_NAME,"-placeholder"),i.height.endsWith("px")&&(i.iframePlaceholder.style.height=i.height),t&&"boolean"!=typeof t)i.iframePlaceholder.appendChild(t);else{var n=i.createLoaderSVG();i.iframePlaceholder.appendChild(n)}i.container.appendChild(i.iframePlaceholder)}),a(this,"createIframe",function(){var e,t,n=document.createElement("iframe");n.className=i.classNames.join(" ").trim(),n.id=i.iframeName,n.name=i.iframeName,n.width=i.width,n.height=i.height,i.loading&&(n.loading=i.loading),n.style.border="0px",n.style.padding="0px",i.iframePlaceholder&&(n.style.opacity="0",n.style.position="absolute"),"0px"===i.width&&"0px"===i.height&&(n.style.position="absolute");var s=[];return null!==(e=i.framePermissions)&&void 0!==e&&e.clipboardRead&&s.push("clipboard-read ".concat(new URL(i.src).origin)),null!==(t=i.framePermissions)&&void 0!==t&&t.clipboardWrite&&s.push("clipboard-write ".concat(new URL(i.src).origin)),s.length&&(n.allow=s.join("; ")),i.container.appendChild(n),i.payload?i.postRequest=i.createPostRequest({src:i.src,target:n.name,container:i.container,payload:i.payload}):n.src=i.src,n}),a(this,"onLoadLocal",function(e){var t,n;i.iframePlaceholder&&(i.iframePlaceholder.remove(),i.iframe.style.position="",i.iframe.style.opacity="1",i.iframe.style.transition="opacity .5s ease-in-out"),null===(t=i.onLoad)||void 0===t||t.call(i,e),null===(n=i.postRequest)||void 0===n||n.remove()}),a(this,"createPostRequest",function(e){var t=e.src,i=e.container,n=e.target,s=e.payload;if(!t)throw new Error("No source has been provided.");var r=document.createElement("form");return r.style.visibility="hidden",r.method="POST",r.action=t,r.target=n,r.name="".concat(n,"-form"),Object.keys(s).forEach(function(e){var t=document.createElement("input");t.type="hidden",t.name=e,t.value=s[e],r.appendChild(t)}),i.appendChild(r),null==r||r.submit(),{remove:function(){r.remove()}}}),a(this,"createSvgElement",function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],s=document.createElementNS("http://www.w3.org/2000/svg",e);return Object.entries(t).forEach(function(e){var t=y(e,2),i=t[0],n=t[1];return s.setAttribute(i,n)}),Object.entries(i).forEach(function(e){var t=y(e,2),i=t[0],n=t[1];return s.style.setProperty(i,n)}),n.forEach(function(e){return s.appendChild(e)}),s}),a(this,"createLoaderSVG",function(){var e=[1,2,3].map(function(e){var t=i.createSvgElement("animate",{attributeName:"opacity",dur:"1s",values:"0;1;0",repeatCount:"indefinite",begin:"".concat(e/10)});return i.createSvgElement("circle",{fill:"#ccc",stroke:"none",cx:"".concat(20*e-14),cy:"50",r:"6"},void 0,[t])});return i.createSvgElement("svg",{version:"1.1",x:"0px",y:"0px",viewBox:"0 0 100 100","enable-background":"new 0 0 0 0"},{width:"100px",height:"100px"},e)});var n=t.id,s=t.src,o=t.width,l=void 0===o?"100%":o,c=t.height,h=void 0===c?"100%":c,u=t.container,d=t.onLoad,p=t.loading,g=t.withIframePlaceholder,f=t.payload,m=t.className,v=t.framePermissions;this.width=l,this.height=h,this.onLoad=d,this.iframeName=n,this.framePermissions=v,this.loading=p,m&&this.classNames.push(m),this.container=u,this.payload=f,this.src=s,g&&this.createIframePlaceholder(g),this.iframe=this.createIframe(),this.iframe.addEventListener("load",this.onLoadLocal)});a(ve,"IFRAME_CLASS_NAME","quicksight-embedding-iframe");var be="2.11.2",Ce=o(function e(t,i,s,o,l,c,h){var u=this;r(this,e),a(this,"MESSAGE_RESPONSE_TIMEOUT",5e3),a(this,"iframe",null),a(this,"send",function(){var e=n(g().m(function e(t){var i,n,s;return g().w(function(e){for(;;)switch(e.n){case 0:if(!u.controlOptions.sendToControlFrame){e.n=1;break}return e.a(2,u.controlOptions.sendToControlFrame(t));case 1:if(u.iframe){e.n=2;break}throw new Error("Cannot send ".concat(t.eventName,": No experience frame found"));case 2:if(n=le(),s=new Q(t.eventName,t.eventTarget,n,Date.now(),be,t.message,t.data),null===(i=u.iframe)||void 0===i||null===(i=i.contentWindow)||void 0===i||i.postMessage(s,u.url),t.eventName!==D.ACKNOWLEDGE){e.n=3;break}return e.a(2,Promise.resolve(new ee));case 3:return e.a(2,new Promise(function(e,i){var s=function(t){var i,r,o=t.data;(null==o?void 0:o.eventId)===n&&(window.removeEventListener("message",s),!0===(null===(i=o.message)||void 0===i?void 0:i.success)?e(new ee):!1===(null===(r=o.message)||void 0===r?void 0:r.success)?e(new te(o.message)):e(new ie(o.message)))};window.addEventListener("message",s),setTimeout(function(){window.removeEventListener("message",s),i("".concat(t.eventName," timed out"))},u.MESSAGE_RESPONSE_TIMEOUT)}))}},e)}));return function(t){return e.apply(this,arguments)}}()),a(this,"buildParameterString",function(e){return e&&"object"===v(e)?Object.entries(e).map(function(e){var t=y(e,2),i=t[0],n=t[1],s=Array.isArray(n)?n:[n],r=encodeURIComponent(i);return s.map(encodeURIComponent).map(function(e){return"p.".concat(r,"=").concat(e)}).join("&")}).join("&"):""}),a(this,"buildQueryString",function(e){var t=Object.entries(e).reduce(function(e,t){var i=y(t,2),n=i[0],s=i[1];return null!=s?d(d({},e),{},a({},n,"".concat(s))):e},{punyCodeEmbedOrigin:ye("".concat(window.location.origin,"/")),sdkVersion:be});return new URLSearchParams(t).toString()}),a(this,"createExperienceIframe",function(){u.onChange(new q(T.FRAME_STARTED,I.INFO,"Creating the frame",{experience:u.internalExperience}));try{u.setTimeoutInstance(),u.iframe=new ve({id:u.experienceId,src:u.url,width:u.frameOptions.width,height:u.frameOptions.height,container:u.container,onLoad:u.onLoadHandler,withIframePlaceholder:u.frameOptions.withIframePlaceholder,className:u.frameOptions.className,framePermissions:u.frameOptions.framePermissions}).getIframe()}catch(e){throw u.onChange(new q(T.FRAME_NOT_CREATED,I.ERROR,"Failed to create the frame",{experience:u.internalExperience})),e}u.onChange(new q(T.FRAME_MOUNTED,I.INFO,"The frame mounted",{experience:u.internalExperience,frame:u.iframe}))}),a(this,"addInternalEventListener",function(e,t){var i=function(i,n){i.eventName===e&&t(i,n)};return u.controlOptions.eventManager.addEventListener(u.experienceId,i,!0),{remove:function(){return u.controlOptions.eventManager.removeEventListener(u.experienceId,i)}}}),a(this,"validateBaseUrl",function(e){if(!e)throw u.onChange(new q(T.NO_URL,I.ERROR,"Url is required for the experience",{experience:u.internalExperience})),new Error("Url is required for the experience");try{new URL(e)}catch(e){throw u.onChange(new q(T.INVALID_URL,I.ERROR,"Invalid experience url",{experience:u.internalExperience})),new Error("Invalid experience url")}return e}),a(this,"setTimeoutInstance",function(){u.timeoutInstance=setTimeout(function(){throw u.onChange(new q(T.FRAME_NOT_CREATED,I.ERROR,"Creating the frame timed out",{experience:u.internalExperience})),new Error("Creating the frame timed out")},u.controlOptions.timeout)}),a(this,"onLoadHandler",n(g().m(function e(){return g().w(function(e){for(;;)switch(e.n){case 0:u.timeoutInstance&&clearTimeout(u.timeoutInstance),u.onChange(new q(T.FRAME_LOADED,I.INFO,"The experience iframe loaded",{experience:u.internalExperience}));case 1:return e.a(2)}},e)}))),a(this,"getContainer",function(e){if(!e){var t="Container is required for the experience";throw u.onChange(new q(T.NO_CONTAINER,I.ERROR,t,{experience:u.internalExperience})),new Error(t)}var i=null;if("string"==typeof e)try{i=document.querySelector(e)}catch(e){throw e instanceof Error&&u.onChange(new q(T.INVALID_CONTAINER,I.ERROR,e.message,{experience:u.internalExperience})),e}else"object"===v(e)&&e.nodeName&&(i=e);if(!i){var n="Invalid container '".concat(e,"' for the experience");throw u.onChange(new q(T.INVALID_CONTAINER,I.ERROR,n,{experience:u.internalExperience})),new Error(n)}return i}),a(this,"decorateOnChange",function(e){return function(t){if(e){var i={frame:u.iframe};e(t,i)}}}),a(this,"decorateOnMessage",function(e,t){return function(i){t&&u.iframe&&t(i,{frame:u.iframe}),e&&e(i,{frame:u.iframe})}}),a(this,"initializeMutationObserver",function(){var e=new MutationObserver(function(t){t.some(function(e){return Array.from(e.removedNodes).some(function(e){return e===u.iframe||e===u.container})})&&(u.controlOptions.eventManager.cleanUpCallbacksForExperience(u.experienceId),e.disconnect(),u.iframe=null,u.onChange(new q(T.FRAME_REMOVED,I.INFO,"Frame removed from the DOM",{experience:u.internalExperience})))});e.observe(document.body,{childList:!0,subtree:!0})}),this.frameOptions=t,this.contentOptions=s,this.onChange=this.decorateOnChange(t.onChange),this.onMessage=this.decorateOnMessage(s.onMessage,h),this.container=this.getContainer(t.container),this.internalExperience=l,this.controlOptions=i,this.transformedContentOptions=o,this.experienceId=c,this.url=this.validateBaseUrl(t.url),this.controlOptions.eventManager.addEventListener(this.experienceId,this.onMessage,!0),this.initializeMutationObserver()}),we=["parameters"],Se=function(e){function t(e,i,n,o,l,c,h){var u;return r(this,t),a(u=s(this,t,[e,i,n,o,l,c,h]),"buildExperienceUrl",function(e){var t=u.transformedContentOptions,i=t.parameters,n=p(t,we),s=u.internalExperience,r=s.contextId,o=s.discriminator;return[e,[u.buildQueryString(d(d({},n),{},{contextId:r,discriminator:o})),u.buildParameterString(i)].join("#")].join(e.includes("?")?"&":"?")}),u.url=u.buildExperienceUrl(e.url),u.createExperienceIframe(),u}return c(t,e),o(t)}(Ce),xe=["scaleToContainer","fitToIframeWidth","locale","parameters","themeOptions","onMessage"],Ee=function(e){function t(e,i,o,l){var c;r(this,t),a(c=s(this,t,[e,i,o,l]),"setParameters",function(){var e=n(g().m(function e(t){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.SET_PARAMETERS,t)))},e)}));return function(t){return e.apply(this,arguments)}}()),a(c,"reset",n(g().m(function e(){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.RESET)))},e)}))),a(c,"addFilterGroups",function(){var e=n(g().m(function e(t){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.ADD_FILTER_GROUPS,t)))},e)}));return function(t){return e.apply(this,arguments)}}()),a(c,"updateFilterGroups",function(){var e=n(g().m(function e(t){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.UPDATE_FILTER_GROUPS,t)))},e)}));return function(t){return e.apply(this,arguments)}}()),a(c,"removeFilterGroups",function(){var e=n(g().m(function e(t){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.REMOVE_FILTER_GROUPS,t)))},e)}));return function(t){return e.apply(this,arguments)}}()),a(c,"getFilterGroups",n(g().m(function e(){var t;return g().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,c.send(new X(D.GET_FILTER_GROUPS_FOR_VISUAL));case 1:if(t=e.v,Array.isArray(null==t?void 0:t.message)){e.n=2;break}throw new Error("Failed to retrieve filter groups for the visual");case 2:return e.a(2,t.message)}},e)}))),a(c,"getActions",n(g().m(function e(){var t;return g().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,c.send(new X(D.GET_VISUAL_ACTIONS));case 1:if(t=e.v,Array.isArray(null==t?void 0:t.message)){e.n=2;break}throw new Error("Failed to retrieve the actions");case 2:return e.a(2,t.message)}},e)}))),a(c,"addActions",function(){var e=n(g().m(function e(t){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.ADD_VISUAL_ACTIONS,{Actions:t})))},e)}));return function(t){return e.apply(this,arguments)}}()),a(c,"setActions",function(){var e=n(g().m(function e(t){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.SET_VISUAL_ACTIONS,{Actions:t})))},e)}));return function(t){return e.apply(this,arguments)}}()),a(c,"removeActions",function(){var e=n(g().m(function e(t){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.REMOVE_VISUAL_ACTIONS,{Actions:t})))},e)}));return function(t){return e.apply(this,arguments)}}()),a(c,"setTheme",function(){var e=n(g().m(function e(t){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.SET_THEME,{ThemeArn:t})))},e)}));return function(t){return e.apply(this,arguments)}}()),a(c,"setThemeOverride",function(){var e=n(g().m(function e(t){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.SET_THEME_OVERRIDE,{ThemeOverride:t})))},e)}));return function(t){return e.apply(this,arguments)}}()),a(c,"setPreloadThemes",function(){var e=n(g().m(function e(t){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.PRELOAD_THEMES,{PreloadThemes:t})))},e)}));return function(t){return e.apply(this,arguments)}}()),a(c,"extractExperienceFromUrl",function(e){var t,i,n=/^https:\/\/[^/]+\/embed\/[^/]+\/dashboards\/([\w-]+)\/sheets\/([\w-]+)\/visuals\/([\w-]+)(\?|$)/i.exec(e)||[];if(n.length<5)throw null===(t=(i=c.frameOptions).onChange)||void 0===t||t.call(i,new q(T.INVALID_URL,I.ERROR,"Invalid visual experience url",{url:e}),{frame:c.experienceFrame.iframe}),new Error("Invalid visual experience URL");return{experienceType:N.VISUAL,dashboardId:n[1],sheetId:n[2],visualId:n[3]}}),a(c,"interceptMessage",function(e,t){var i,n,s,r,o;"SIZE_CHANGED"===e.eventName&&c.frameOptions.resizeHeightOnSizeChangedEvent&&!c.contentOptions.scaleToContainer&&(null==t||null===(s=t.frame)||void 0===s||null===(r=s.setAttribute)||void 0===r||r.call(s,"height","".concat(null===(o=e.message)||void 0===o?void 0:o.height,"px"))),"EXPERIENCE_INITIALIZED"===e.eventName&&null!==(i=c.contentOptions)&&void 0!==i&&null!==(i=i.themeOptions)&&void 0!==i&&i.themeOverride&&c.setThemeOverride(c.contentOptions.themeOptions.themeOverride),"EXPERIENCE_INITIALIZED"===e.eventName&&null!==(n=c.contentOptions)&&void 0!==n&&null!==(n=n.themeOptions)&&void 0!==n&&n.preloadThemes&&c.setPreloadThemes(c.contentOptions.themeOptions.preloadThemes)}),a(c,"transformVisualContentOptions",function(e){var t=e.scaleToContainer,i=e.fitToIframeWidth,n=e.locale,s=e.parameters,r=e.themeOptions;e.onMessage;var o=p(e,xe),l=c.transformContentOptions({scaleToContainer:null!=t&&t,fitToIframeWidth:null==i||i,locale:n},o);return Array.isArray(s)&&(l.parameters=s.reduce(function(e,t){return d(d({},e),{},a({},t.Name,t.Values))},{})),null!=r&&r.themeArn&&(l.themeArn=r.themeArn),l}),c.experience=c.extractExperienceFromUrl(e.url);var h=c.getInternalExperienceInfo(c.experience),u=h.experienceIdentifier,f=h.internalExperience;return c.internalExperience=f,c.experienceId=u,c.experienceFrame=new Se(e,o,i,c.transformVisualContentOptions(i),f,u,c.interceptMessage),c}return c(t,e),o(t)}(ce),Ae=function(e){function t(e,i,n,o,l,c,h){var u;return r(this,t),a(u=s(this,t,[e,i,n,o,l,c,h]),"buildExperienceUrl",function(e){var t=u.internalExperience,i=t.contextId,n=t.discriminator;return[e,u.buildQueryString(d(d({},u.transformedContentOptions),{},{contextId:i,discriminator:n}))].join(e.includes("?")?"&":"?")}),u.url=u.buildExperienceUrl(e.url),u.createExperienceIframe(),u}return c(t,e),o(t)}(Ce),Me=["locale","toolbarOptions","onMessage"],Te=function(e){function t(e,i,o,l){var c;r(this,t),a(c=s(this,t,[e,i,o,l]),"createSharedView",n(g().m(function e(){var t;return g().w(function(e){for(;;)switch(e.n){case 0:if("DASHBOARD"===c.currentPage||"DASHBOARD_SHEET"===c.currentPage||"DASHBOARD_VIEW"===c.currentPage){e.n=1;break}throw new Error("Cannot call createSharedView from this page");case 1:return e.n=2,c.send(new X(D.CREATE_SHARED_VIEW));case 2:if(null!=(t=e.v)&&t.message){e.n=3;break}throw new Error("Failed to create shared view");case 3:return e.a(2,t)}},e)}))),a(c,"toggleExecutiveSummaryPane",n(g().m(function e(){return g().w(function(e){for(;;)switch(e.n){case 0:if("DASHBOARD"===c.currentPage){e.n=1;break}throw new Error("Cannot call toggleExecutiveSummaryPane from this page");case 1:return e.a(2,c.send(new X(D.TOGGLE_EXECUTIVE_SUMMARY_PANE)))}},e)}))),a(c,"openDataQnAPane",n(g().m(function e(){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.OPEN_DATA_QNA_PANE)))},e)}))),a(c,"openBuildVisualPane",n(g().m(function e(){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.OPEN_BUILD_VISUAL_PANE)))},e)}))),a(c,"buildStoryFromDashboard",n(g().m(function e(){return g().w(function(e){for(;;)switch(e.n){case 0:if("DASHBOARD"===c.currentPage){e.n=1;break}throw new Error('Cannot call buildStoryFromDashboard from "'.concat(c.currentPage,'" page'));case 1:return e.a(2,c.send(new X(D.OPEN_BUILD_STORY_PANE)))}},e)}))),a(c,"interceptMessage",function(e,t){var i;e.eventName===D.PAGE_NAVIGATION&&(c.currentPage=null==e||null===(i=e.message)||void 0===i?void 0:i.pageType)}),a(c,"extractExperienceFromUrl",function(e){var t,i;if((/^https:\/\/[^/]+\/embedding\/[^/]+\/(start(\/(favorites|dashboards|analyses))?|dashboards\/[\w-]+(\/views\/[\w-]+)?|analyses\/[\w-]+)(\?|$)/i.exec(e)||[]).length<5)throw null===(t=(i=c.frameOptions).onChange)||void 0===t||t.call(i,new q(T.INVALID_URL,I.ERROR,"Invalid console experience url",{url:e}),{frame:c.experienceFrame.iframe}),new Error("Invalid console experience URL");return{experienceType:N.CONSOLE}}),a(c,"transformConsoleContentOptions",function(e){var t=e.locale,i=e.toolbarOptions;e.onMessage;var n=p(e,Me),s=c.transformContentOptions({locale:t},n);return!0===(null==i?void 0:i.executiveSummary)&&(s.showExecutiveSummaryIcon=!0),!0===(null==i?void 0:i.dataQnA)&&(s.showDataQnAIcon=!0),!0===(null==i?void 0:i.buildVisual)&&(s.showBuildVisualIcon=!0),!0===(null==i?void 0:i.buildStory)&&(s.showBuildStoryIcon=!0),s}),c.experience=c.extractExperienceFromUrl(e.url);var h=c.getInternalExperienceInfo(c.experience),u=h.experienceIdentifier,d=h.internalExperience;c.internalExperience=d,c.experienceId=u,i.locale,i.onMessage;var f=c.transformConsoleContentOptions(i);return c.experienceFrame=new Ae(e,o,i,f,d,u,c.interceptMessage),c.currentPage="START",c}return c(t,e),o(t)}(ce),De=["parameters"],Ie=function(e){function t(e,i,n,o,l,c,h){var u;return r(this,t),a(u=s(this,t,[e,i,n,o,l,c,h]),"buildExperienceUrl",function(e){var t=u.transformedContentOptions,i=t.parameters,n=p(t,De),s=u.internalExperience,r=s.contextId,o=s.discriminator,a=u.contentOptions.viewId;if(a){var l=new URL(e);l.pathname=l.pathname.concat("/views/"+a),e=l.href}return[e,[u.buildQueryString(d(d({},n),{},{contextId:r,discriminator:o})),u.buildParameterString(i)].join("#")].join(e.includes("?")?"&":"?")}),u.url=u.buildExperienceUrl(e.url),u.createExperienceIframe(),u}return c(t,e),o(t)}(Ce),Re=["parameters","locale","attributionOptions","sheetOptions","toolbarOptions","themeOptions","onMessage"],ke=function(e){function t(e,i,o,l){var c;r(this,t),a(c=s(this,t,[e,i,o,l]),"initiatePrint",n(g().m(function e(){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.INITIATE_PRINT)))},e)}))),a(c,"undo",n(g().m(function e(){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.UNDO)))},e)}))),a(c,"redo",n(g().m(function e(){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.REDO)))},e)}))),a(c,"toggleExecutiveSummaryPane",n(g().m(function e(){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.TOGGLE_EXECUTIVE_SUMMARY_PANE)))},e)}))),a(c,"toggleBookmarksPane",n(g().m(function e(){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.TOGGLE_BOOKMARKS_PANE)))},e)}))),a(c,"toggleThresholdAlertsPane",n(g().m(function e(){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.TOGGLE_THRESHOLD_ALERTS_PANE)))},e)}))),a(c,"toggleSchedulingPane",n(g().m(function e(){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.TOGGLE_SCHEDULING_PANE)))},e)}))),a(c,"toggleRecentSnapshotsPane",n(g().m(function e(){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.TOGGLE_RECENT_SNAPSHOTS_PANE)))},e)}))),a(c,"getParameters",n(g().m(function e(){var t;return g().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,c.send(new X(D.GET_PARAMETERS));case 1:if(t=e.v,Array.isArray(null==t?void 0:t.message)){e.n=2;break}throw new Error("Failed to retrieve the parameters");case 2:return e.a(2,t.message)}},e)}))),a(c,"getSheets",n(g().m(function e(){var t;return g().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,c.send(new X(D.GET_SHEETS));case 1:if(t=e.v,Array.isArray(null==t?void 0:t.message)){e.n=2;break}throw new Error("Failed to retrieve the sheets");case 2:return e.a(2,t.message)}},e)}))),a(c,"addFilterGroups",function(){var e=n(g().m(function e(t){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.ADD_FILTER_GROUPS,t)))},e)}));return function(t){return e.apply(this,arguments)}}()),a(c,"updateFilterGroups",function(){var e=n(g().m(function e(t){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.UPDATE_FILTER_GROUPS,t)))},e)}));return function(t){return e.apply(this,arguments)}}()),a(c,"removeFilterGroups",function(){var e=n(g().m(function e(t){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.REMOVE_FILTER_GROUPS,t)))},e)}));return function(t){return e.apply(this,arguments)}}()),a(c,"getFilterGroupsForSheet",function(){var e=n(g().m(function e(t){var i;return g().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,c.send(new X(D.GET_FILTER_GROUPS_FOR_SHEET,{SheetId:t}));case 1:if(i=e.v,Array.isArray(null==i?void 0:i.message)){e.n=2;break}throw new Error("Failed to retrieve filter groups for the sheet");case 2:return e.a(2,i.message)}},e)}));return function(t){return e.apply(this,arguments)}}()),a(c,"getFilterGroupsForVisual",function(){var e=n(g().m(function e(t,i){var n;return g().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,c.send(new X(D.GET_FILTER_GROUPS_FOR_VISUAL,{SheetId:t,VisualId:i}));case 1:if(n=e.v,Array.isArray(null==n?void 0:n.message)){e.n=2;break}throw new Error("Failed to retrieve filter groups for the visual");case 2:return e.a(2,n.message)}},e)}));return function(t,i){return e.apply(this,arguments)}}()),a(c,"getVisualActions",function(){var e=n(g().m(function e(t,i){var n;return g().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,c.send(new X(D.GET_VISUAL_ACTIONS,{SheetId:t,VisualId:i}));case 1:if(n=e.v,Array.isArray(null==n?void 0:n.message)){e.n=2;break}throw new Error("Failed to retrieve the visual actions");case 2:return e.a(2,n.message)}},e)}));return function(t,i){return e.apply(this,arguments)}}()),a(c,"addVisualActions",function(){var e=n(g().m(function e(t,i,n){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.ADD_VISUAL_ACTIONS,{SheetId:t,VisualId:i,Actions:n})))},e)}));return function(t,i,n){return e.apply(this,arguments)}}()),a(c,"setVisualActions",function(){var e=n(g().m(function e(t,i,n){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.SET_VISUAL_ACTIONS,{SheetId:t,VisualId:i,Actions:n})))},e)}));return function(t,i,n){return e.apply(this,arguments)}}()),a(c,"getSelectedSheetId",n(g().m(function e(){var t;return g().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,c.send(new X(D.GET_SELECTED_SHEET_ID));case 1:if(null!=(t=e.v)&&t.message){e.n=2;break}throw new Error("Failed to retrieve the selected sheet id");case 2:return e.a(2,t.message)}},e)}))),a(c,"setSelectedSheetId",function(){var e=n(g().m(function e(t){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.SET_SELECTED_SHEET_ID,{SheetId:t})))},e)}));return function(t){return e.apply(this,arguments)}}()),a(c,"setTheme",function(){var e=n(g().m(function e(t){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.SET_THEME,{ThemeArn:t})))},e)}));return function(t){return e.apply(this,arguments)}}()),a(c,"navigateToDashboard",function(){var e=n(g().m(function e(t,i){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.NAVIGATE_TO_DASHBOARD,{DashboardId:t,Parameters:null==i?void 0:i.parameters})))},e)}));return function(t,i){return e.apply(this,arguments)}}()),a(c,"removeVisualActions",function(){var e=n(g().m(function e(t,i,n){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.REMOVE_VISUAL_ACTIONS,{SheetId:t,VisualId:i,Actions:n})))},e)}));return function(t,i,n){return e.apply(this,arguments)}}()),a(c,"getSheetVisuals",function(){var e=n(g().m(function e(t){var i;return g().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,c.send(new X(D.GET_SHEET_VISUALS,{SheetId:t}));case 1:if(i=e.v,Array.isArray(null==i?void 0:i.message)){e.n=2;break}throw new Error("Failed to retrieve the sheet visuals");case 2:return e.a(2,i.message)}},e)}));return function(t){return e.apply(this,arguments)}}()),a(c,"setParameters",function(){var e=n(g().m(function e(t){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.SET_PARAMETERS,t)))},e)}));return function(t){return e.apply(this,arguments)}}()),a(c,"reset",n(g().m(function e(){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.RESET)))},e)}))),a(c,"setThemeOverride",function(){var e=n(g().m(function e(t){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.SET_THEME_OVERRIDE,{ThemeOverride:t})))},e)}));return function(t){return e.apply(this,arguments)}}()),a(c,"setPreloadThemes",function(){var e=n(g().m(function e(t){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,c.send(new X(D.PRELOAD_THEMES,{PreloadThemes:t})))},e)}));return function(t){return e.apply(this,arguments)}}()),a(c,"createSharedView",n(g().m(function e(){var t;return g().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,c.send(new X(D.CREATE_SHARED_VIEW));case 1:if(null!=(t=e.v)&&t.message){e.n=2;break}throw new Error("Failed to create shared view");case 2:return e.a(2,t)}},e)}))),a(c,"extractExperienceFromUrl",function(e){var t,i,n=/^https:\/\/[^/]+\/embed\/[^/]+\/dashboards\/([\w-]+)(\?|$)/i.exec(e)||[];if(n.length<3)throw null===(t=(i=c.frameOptions).onChange)||void 0===t||t.call(i,new q(T.INVALID_URL,I.ERROR,"Invalid dashboard experience url",{url:e}),{frame:null}),new Error("Invalid dashboard experience URL");return{experienceType:N.DASHBOARD,dashboardId:n[1]}}),a(c,"interceptMessage",function(e,t){var i,n,s,r,o;"SIZE_CHANGED"===e.eventName&&c.frameOptions.resizeHeightOnSizeChangedEvent&&(null==t||null===(s=t.frame)||void 0===s||null===(r=s.setAttribute)||void 0===r||r.call(s,"height","".concat(null==e||null===(o=e.message)||void 0===o?void 0:o.height,"px"))),"EXPERIENCE_INITIALIZED"===e.eventName&&null!==(i=c.contentOptions)&&void 0!==i&&null!==(i=i.themeOptions)&&void 0!==i&&i.themeOverride&&c.setThemeOverride(c.contentOptions.themeOptions.themeOverride),"EXPERIENCE_INITIALIZED"===e.eventName&&null!==(n=c.contentOptions)&&void 0!==n&&null!==(n=n.themeOptions)&&void 0!==n&&n.preloadThemes&&c.setPreloadThemes(c.contentOptions.themeOptions.preloadThemes)}),a(c,"transformDashboardContentOptions",function(e){var t,i,n=e.parameters,s=e.locale,r=e.attributionOptions,o=e.sheetOptions,l=e.toolbarOptions,h=e.themeOptions;e.onMessage;var u=p(e,Re),g=c.transformContentOptions({locale:s,fitSheetToWidth:null===(t=null==o?void 0:o.fitSheetToWidth)||void 0===t||t},u);return Array.isArray(n)&&(g.parameters=n.reduce(function(e,t){return d(d({},e),{},a({},t.Name,t.Values))},{})),!0!==(null==r?void 0:r.overlayContent)&&(g.footerPaddingEnabled=!0),(null!=l&&l.export||null!=l&&null!==(i=l.export)&&void 0!==i&&i.print)&&(g.printEnabled=!0),!0!==(null==l?void 0:l.undoRedo)&&(g.undoRedoDisabled=!0),!0!==(null==l?void 0:l.reset)&&(g.resetDisabled=!0),!0===(null==l?void 0:l.bookmarks)&&(g.showBookmarksIcon=!0),!0===(null==l?void 0:l.thresholdAlerts)&&(g.showThresholdAlertsIcon=!0),!0===(null==l?void 0:l.scheduling)&&(g.showSchedulingIcon=!0),!0===(null==l?void 0:l.executiveSummary)&&(g.showExecutiveSummaryIcon=!0),!0===(null==l?void 0:l.recentSnapshots)&&(g.showRecentSnapshotsIcon=!0),null!=o&&o.initialSheetId&&(g.sheetId=o.initialSheetId),"boolean"==typeof(null==o?void 0:o.singleSheet)&&(g.sheetTabsDisabled=o.singleSheet),null!=o&&o.emitSizeChangedEventOnSheetChange&&(g.resizeOnSheetChange=!0),null!=h&&h.themeArn&&(g.themeArn=h.themeArn),g}),c.experience=c.extractExperienceFromUrl(e.url);var h=c.getInternalExperienceInfo(c.experience),u=h.experienceIdentifier,f=h.internalExperience;return c.internalExperience=f,c.experienceId=u,c.experienceFrame=new Ie(e,o,i,c.transformDashboardContentOptions(i),f,u,c.interceptMessage),c}return c(t,e),o(t)}(ce),Pe=function(e){function t(e,i,n,o,l,c,h){var u;return r(this,t),a(u=s(this,t,[e,i,n,o,l,c,h]),"buildExperienceUrl",function(e){var t=u.internalExperience,i=t.contextId,n=t.discriminator;return[e,u.buildQueryString(d(d({},u.transformedContentOptions),{},{contextId:i,discriminator:n}))].join(e.includes("?")?"&":"?")}),u.url=u.buildExperienceUrl(e.url),u.createExperienceIframe(),u}return c(t,e),o(t)}(Ce),_e=function(e){function t(){var e;r(this,t);for(var i=arguments.length,o=new Array(i),l=0;l<i;l++)o[l]=arguments[l];return a(e=s(this,t,[].concat(o)),"close",function(){return e.send(new X(D.CLOSE_Q_SEARCH))}),a(e,"setQuestion",function(t){return e.send(new X(D.SET_Q_SEARCH_QUESTION,{question:t}))}),a(e,"trackOutsideClicks",function(){var t=function(){var t=n(g().m(function t(i){var n,s;return g().w(function(t){for(;;)switch(t.p=t.n){case 0:if(null!==(n=e.experienceFrame.iframe)&&void 0!==n&&n.contains(i.target)){t.n=5;break}return t.p=1,t.n=2,e.close();case 2:t.n=5;break;case 3:if(t.p=3,s=t.v,e.experienceFrame.iframe){t.n=4;break}return t.a(2);case 4:throw s;case 5:return t.a(2)}},t,null,[[1,3]])}));return function(e){return t.apply(this,arguments)}}();window.addEventListener("click",t),e.controlOptions.eventManager.addEventListenerForCleanup(e.experienceId,function(){return window.removeEventListener("click",t)})}),a(e,"enterFullScreen",function(i){var n,s;!e.frameStyles&&null!=i&&i.frame&&(e.frameStyles={position:null===(n=i.frame)||void 0===n?void 0:n.style.position,top:null===(s=i.frame)||void 0===s?void 0:s.style.top,left:i.frame.style.left,zIndex:i.frame.style.zIndex,width:i.frame.style.width,height:i.frame.style.height},i.frame.style.position="fixed",i.frame.style.top="0px",i.frame.style.left="0px",i.frame.style.zIndex=t.MAX_Z_INDEX,i.frame.style.width="100vw",i.frame.style.height="100vh")}),a(e,"exitFullScreen",function(t){e.frameStyles&&null!=t&&t.frame&&(t.frame.style.position=e.frameStyles.position,t.frame.style.top=e.frameStyles.top,t.frame.style.left=e.frameStyles.left,t.frame.style.zIndex=e.frameStyles.zIndex,t.frame.style.width=e.frameStyles.width,t.frame.style.height=e.frameStyles.height,e.frameStyles=void 0)}),e}return c(t,e),o(t)}(ce);a(_e,"MAX_Z_INDEX","2147483647");var Le=["hideIcon","hideTopicName","theme","allowTopicSelection","onMessage"],Ne=function(e){function t(e,i,n,o){var l;r(this,t),a(l=s(this,t,[e,i,n,o]),"extractExperienceFromUrl",function(e){var t,i;if((/^https:\/\/[^/]+\/embedding\/[^/]+\/q\/search(\/|\?|$)/i.exec(e)||[]).length<2)throw null===(t=(i=l.frameOptions).onChange)||void 0===t||t.call(i,new q(T.INVALID_URL,I.ERROR,"Invalid q-search experience URL",{url:e}),{frame:l.experienceFrame.iframe}),new Error("Invalid q-search experience URL");return{experienceType:N.QSEARCH}}),a(l,"interceptMessage",function(e,t){switch(e.eventName){case D.Q_SEARCH_OPENED:case D.Q_SEARCH_CLOSED:var i,n;"object"===v(e.message)&&(null==t||null===(i=t.frame)||void 0===i||i.style.setProperty("height","".concat(null==e||null===(n=e.message)||void 0===n?void 0:n.height,"px")));break;case D.CONTENT_LOADED:l.trackOutsideClicks();break;case D.Q_SEARCH_ENTERED_FULLSCREEN:l.enterFullScreen(t);break;case D.Q_SEARCH_EXITED_FULLSCREEN:l.exitFullScreen(t)}}),a(l,"transformQSearchContentOptions",function(e){var t=e.hideIcon,i=e.hideTopicName,n=e.theme,s=e.allowTopicSelection;e.onMessage;var r=p(e,Le),o=l.transformContentOptions({allowTopicSelection:s},r);return void 0!==t&&(o.qBarIconDisabled=t),void 0!==i&&(o.qBarTopicNameDisabled=i),void 0!==n&&(o.themeId=n),o}),l.experience=l.extractExperienceFromUrl(e.url);var c=l.getInternalExperienceInfo(l.experience),h=c.experienceIdentifier,u=c.internalExperience;return l.internalExperience=u,l.experienceId=h,l.experienceFrame=new Pe(e,n,i,l.transformQSearchContentOptions(i),u,h,l.interceptMessage),l}return c(t,e),o(t)}(_e),Oe=function(e){function t(e,i,n,o,l,c,h){var u;return r(this,t),a(u=s(this,t,[e,i,n,o,l,c,h]),"buildExperienceUrl",function(e){var t=u.internalExperience,i=t.contextId,n=t.discriminator;return[e,u.buildQueryString(d(d({},u.transformedContentOptions),{},{contextId:i,discriminator:n}))].join(e.includes("?")?"&":"?")}),u.url=u.buildExperienceUrl(e.url),u.createExperienceIframe(),u}return c(t,e),o(t)}(Ce),Fe=["onMessage","showTopicName","showPinboard","showSearchBar","showInterpretedAs","showFeedback","showGeneratedNarrative","showDidYouMean","showComplementaryVisuals","showQBusinessInsights","showSeeWhy","allowTopicSelection","allowFullscreen","allowReturn","searchPlaceholderText","panelOptions","themeOptions","initialQuestionId","initialAnswerId"],Ge=["panelType","title","showQIcon"],Be=["panelType","focusedHeight","expandedHeight"],Ve=function(e){function t(e,i,n,o){var l;r(this,t),a(l=s(this,t,[e,i,n,o]),"extractExperienceFromUrl",function(e){var t,i;if((/^https:\/\/[^/]+\/embedding\/[^/]+\/q\/search(\/|\?|$)/i.exec(e)||[]).length<2)throw null===(t=(i=l.frameOptions).onChange)||void 0===t||t.call(i,new q(T.INVALID_URL,I.ERROR,"Invalid generative-qna experience URL",{url:e}),{frame:l.experienceFrame.iframe}),new Error("Invalid generative-qna experience URL");return{experienceType:N.GENERATIVEQNA}}),a(l,"interceptMessage",function(e,t){switch(e.eventName){case D.Q_SEARCH_OPENED:case D.Q_SEARCH_CLOSED:case D.Q_SEARCH_FOCUSED:var i,n;"object"===v(e.message)&&(null==t||null===(i=t.frame)||void 0===i||i.style.setProperty("height","".concat(null==e||null===(n=e.message)||void 0===n?void 0:n.height)));break;case D.CONTENT_LOADED:var s;(null===(s=l.contentOptions)||void 0===s||null===(s=s.panelOptions)||void 0===s?void 0:s.panelType)===W.SEARCH_BAR&&l.trackOutsideClicks();break;case D.Q_PANEL_ENTERED_FULLSCREEN:l.enterFullScreen(t);break;case D.Q_PANEL_EXITED_FULLSCREEN:l.exitFullScreen(t)}}),a(l,"transformGenerativeQnAContentOptions",function(e){var t=[],i=function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";Object.keys(e).forEach(function(e){t.push(i+e)})};e.onMessage;var n=e.showTopicName,s=e.showPinboard,r=e.showSearchBar,o=e.showInterpretedAs,a=e.showFeedback,c=e.showGeneratedNarrative,h=e.showDidYouMean,u=e.showComplementaryVisuals,d=e.showQBusinessInsights,g=e.showSeeWhy,f=e.allowTopicSelection,m=e.allowFullscreen,y=e.allowReturn,v=e.searchPlaceholderText,b=e.panelOptions,C=e.themeOptions,w=e.initialQuestionId,S=e.initialAnswerId;i(p(e,Fe));var x={qShowTopicName:n,qShowPinboard:s,qShowSearchBar:r,qShowInterpretedAs:o,qShowFeedback:a,qShowGeneratedNarrative:c,qShowDidYouMean:h,qShowComplementaryVisuals:u,qShowQBusinessInsights:d,qShowSeeWhy:g,qAllowTopicSelection:f,qAllowFullscreen:m,qAllowReturn:y,questionId:w,answerId:S};if("string"==typeof v&&(l.checkMaxLength(v,"searchPlaceholderText"),x.qSearchPlaceholderText=encodeURIComponent(v)),b){var E=b.panelType;if(x.qPanelType=E,E===W.FULL){b.panelType;var A=b.title,M=b.showQIcon,T=p(b,Ge);"string"==typeof A&&(l.checkMaxLength(A,"panelOptions.title"),x.qPanelTitle=encodeURIComponent(A)),x.qShowPanelIcon=M,i(T,"panelOptions.")}else{if(E!==W.SEARCH_BAR)throw new Error("panelOptions.panelType should be one of following: [FULL, SEARCH_BAR]");b.panelType;var D=b.focusedHeight,I=b.expandedHeight,R=p(b,Be);x.qPanelFocusedHeight=D,x.qPanelExpandedHeight=I,i(R,"panelOptions.")}}return null!=C&&C.themeArn&&(x.themeArn=C.themeArn),l.warnUnrecognizedContentOptions(t),x}),a(l,"checkMaxLength",function(e,i){var n=t.TEXT_PROPERTY_MAX_LENGTH;if(e.length>n)throw new Error("".concat(i," should be less than ").concat(n," characters"))}),l.experience=l.extractExperienceFromUrl(e.url);var c=l.getInternalExperienceInfo(l.experience),h=c.experienceIdentifier,u=c.internalExperience;return l.internalExperience=u,l.experienceId=h,l.experienceFrame=new Oe(e,n,i,l.transformGenerativeQnAContentOptions(i),u,h,l.interceptMessage),l}return c(t,e),o(t)}(_e);a(Ve,"TEXT_PROPERTY_MAX_LENGTH",200);var He=function(e){function t(e,i,n,o,l,c,h){var u;return r(this,t),a(u=s(this,t,[e,i,n,o,l,c,h]),"buildExperienceUrl",function(e){var t=u.internalExperience,i=t.contextId,n=t.discriminator;return[e,u.buildQueryString(d(d({},u.transformedContentOptions),{},{contextId:i,discriminator:n}))].join("?")}),u.url=u.buildExperienceUrl(e.url),u.createExperienceIframe(),u}return c(t,e),o(t)}(Ce),Ue=o(function e(t,i,n,s){var o=this;r(this,e),a(this,"experience",{experienceType:N.CONTROL}),a(this,"send",function(e){return o.controlExperienceFrame.send(e)}),a(this,"controlFrameMessageListener",function(e){if(o.isMessageEvent(e.data)){var t=e.data;try{if(t.eventTarget){var i=ce.getExperienceIdentifier(t.eventTarget);o.eventManager.invokeEventListener(i,t)}o.sendAcknowledgment(t)}catch(e){var n,s;null===(n=o.onChange)||void 0===n||n.call(o,new q(T.UNRECOGNIZED_EVENT_TARGET,I.WARN,"Message with unrecognized event target received",{eventTarget:t.eventTarget}),{frame:o.controlExperienceFrame.iframe}),null===(s=o.logger)||void 0===s||s.warn("Message with unrecognized event target received")}}}),a(this,"sendAcknowledgment",function(e){var t,i,n=new Z(D.ACKNOWLEDGE,o.internalExperience,{eventName:e.eventName,eventTarget:e.eventTarget});(null===(t=(i=window).requestIdleCallback)||void 0===t?void 0:t.call(i,function(){return o.send(n)}))||o.send(n)}),a(this,"getControlExperienceId",function(){return[o.internalExperience.contextId,o.internalExperience.experienceType,o.internalExperience.discriminator].filter(Boolean).join("-")}),a(this,"getControlExperienceBaseUrl",function(){var e=o.urlInfo,t=e.host,i=e.sessionId,n="".concat(t,"/embed/").concat(i,"/embedControl");return new URL(n).href}),a(this,"isMessageEvent",function(e){return!!e&&!!e.eventTarget&&!!e.eventName}),this.container=t,this.eventManager=i.eventManager,this.urlInfo=i.urlInfo,this.onChange=n,this.logger=s,this.internalExperience=d(d({},this.experience),{},{contextId:i.contextId,discriminator:0});var l=this.getControlExperienceId();this.controlExperienceFrame=new He({url:this.getControlExperienceBaseUrl(),container:this.container,width:"0px",height:"0px",onChange:this.onChange},{eventManager:this.eventManager,contextId:this.internalExperience.contextId,timeout:e.FRAME_TIMEOUT,urlInfo:this.urlInfo},{},{},this.internalExperience,l),window.addEventListener("message",this.controlFrameMessageListener),this.eventManager.addEventListenerForCleanup(l,function(){return window.removeEventListener("message",o.controlFrameMessageListener)})});a(Ue,"FRAME_TIMEOUT",6e4);var ze=o(function e(){var t=this;r(this,e),a(this,"addEventListener",function(e,i,n){if(!e)throw new Error("Experience identifier is required when calling addEventListener");if("function"!=typeof i)throw new Error("Invalid type provided for event listener");var s=t.eventListeners.get(e);return n&&t.addEventListenerForCleanup(e,function(){return t.removeEventListener(e,i)}),s?(s.push(i),t):(t.eventListeners.set(e,[i]),t)}),a(this,"invokeEventListener",function(e,i){var n=t.eventListeners.get(e);if(!n)throw new Error("Unable to find experience specific event listeners: ".concat(e));return n.forEach(function(e){e(i)}),t}),a(this,"removeEventListener",function(e,i){var n=t.eventListeners.get(e);if(!n)throw new Error("Unable to find experience specific event listeners: ".concat(e));var s=n.filter(function(e){return e!==i});return t.eventListeners.set(e,s),t}),a(this,"addEventListenerForCleanup",function(e,i){var n,s=null!==(n=t.cleanUpCallbacks.get(e))&&void 0!==n?n:[];s.push(i),t.cleanUpCallbacks.set(e,s)}),a(this,"cleanUpCallbacksForExperience",function(e){var i=t.cleanUpCallbacks.get(e);i&&(i.forEach(function(e){return e()}),t.cleanUpCallbacks.delete(e),t.eventListeners.set(e,[]))}),this.eventListeners=new Map,this.cleanUpCallbacks=new Map}),We=o(function e(){r(this,e),a(this,"log",console.log),a(this,"warn",console.warn),a(this,"error",console.error),a(this,"debug",console.debug),a(this,"info",console.info)}),je=function(e){function t(e,i,n,o,l,c,h){var u;return r(this,t),a(u=s(this,t,[e,i,n,o,l,c,h]),"buildExperienceUrl",function(e){var t=u.internalExperience,i=t.contextId,n=t.discriminator;return[e,u.buildQueryString(d({contextId:i,discriminator:n},u.transformedContentOptions))].join(e.includes("?")?"&":"?")}),u.url=u.buildExperienceUrl(e.url),u.createExperienceIframe(),u}return c(t,e),o(t)}(Ce),$e=["fixedAgentArn","agentOptions","promptOptions","footerOptions","onMessage"],Ke=["fixedAgentId"],Ye=["allowFileAttachments","showAgentKnowledgeBoundary","initialPrompt","showWebSearch"],qe=["showBrandAttribution","showUsagePolicy"],Xe=function(e){function t(e,i,n,o){var l;r(this,t);var c=d({framePermissions:d({clipboardRead:!0,clipboardWrite:!0},e.framePermissions)},e);a(l=s(this,t,[c,i,n,o]),"extractExperienceFromUrl",function(e){var t,i;if((/^https:\/\/[^/]+\/embedding\/[^/]+\/quick\/chat(\/|\?|$)/i.exec(e)||[]).length<2)throw null===(t=(i=l.frameOptions).onChange)||void 0===t||t.call(i,new q(T.INVALID_URL,I.ERROR,"Invalid quick chat experience url",{url:e}),{frame:null}),new Error("Invalid quick chat experience url");return{experienceType:N.QUICKCHAT}}),a(l,"interceptMessage",function(e,t){var i;e.eventName===D.EXPERIENCE_INITIALIZED&&null!==(i=l.contentOptions.promptOptions)&&void 0!==i&&i.initialPrompt&&l.sendPrompt(l.contentOptions.promptOptions.initialPrompt)}),a(l,"sendPrompt",function(e){return l.send(new X(D.SEND_PROMPT,{prompt:e}))}),a(l,"transformQuickChatContentOptions",function(e){var t=[],i=function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";Object.keys(e).forEach(function(e){t.push(i+e)})},n=e.fixedAgentArn,s=e.agentOptions,r=void 0===s?{}:s,o=e.promptOptions,a=void 0===o?{}:o,c=e.footerOptions,h=void 0===c?{}:c;e.onMessage,i(p(e,$e));var u=r.fixedAgentId;i(p(r,Ke),"agentOptions.");var d=a.allowFileAttachments,g=a.showAgentKnowledgeBoundary;a.initialPrompt;var f=a.showWebSearch;i(p(a,Ye),"promptOptions.");var m=h.showBrandAttribution,y=h.showUsagePolicy;return i(p(h,qe),"footerOptions."),l.warnUnrecognizedContentOptions(t),{allowFileAttachments:d,showAgentKnowledgeBoundary:g,showBrandAttribution:m,showUsagePolicy:y,showWebSearch:f,fixedAgentId:l.validateFixedAgentId(n,u)}}),a(l,"validateFixedAgentId",function(e,t){if(e&&t)throw new Error("Both fixedAgentArn and agentOptions.fixedAgentId cannot be specified. Use agentOptions.fixedAgentId.");if(t)return t;if(e){var i;null===(i=l.logger)||void 0===i||i.warn("The fixedAgentArn option is deprecated. Use agentOptions.fixedAgentId instead.");var n=e.split("/")[1];if(!n)throw new Error("Invalid fixedAgentArn.");return n}}),l.experience=l.extractExperienceFromUrl(c.url);var h=l.getInternalExperienceInfo(l.experience),u=h.experienceIdentifier,g=h.internalExperience;return l.internalExperience=g,l.experienceId=u,l.experienceFrame=new je(c,n,i,l.transformQuickChatContentOptions(i),g,u,l.interceptMessage),l}return c(t,e),o(t)}(ce),Ze=o(function e(t){var i=this;r(this,e),a(this,"embedVisual",function(){var e=n(g().m(function e(t){var n,s,r=arguments;return g().w(function(e){for(;;)if(0===e.n)return n=r.length>1&&void 0!==r[1]?r[1]:{},i.validateFrameOptions(t,"embedVisual"),s=i.buildControlOptions(t),e.a(2,new Ee(t,n,s,i.experienceIdentifiers).setLogProvider(i.logger))},e)}));return function(t){return e.apply(this,arguments)}}()),a(this,"embedDashboard",function(){var e=n(g().m(function e(t){var n,s,r=arguments;return g().w(function(e){for(;;)if(0===e.n)return n=r.length>1&&void 0!==r[1]?r[1]:{},i.validateFrameOptions(t,"embedDashboard"),s=i.buildControlOptions(t),e.a(2,new ke(t,n,s,i.experienceIdentifiers).setLogProvider(i.logger))},e)}));return function(t){return e.apply(this,arguments)}}()),a(this,"embedConsole",function(){var e=n(g().m(function e(t){var n,s,r=arguments;return g().w(function(e){for(;;)if(0===e.n)return n=r.length>1&&void 0!==r[1]?r[1]:{},i.validateFrameOptions(t,"embedConsole"),s=i.buildControlOptions(t),e.a(2,new Te(t,n,s,i.experienceIdentifiers).setLogProvider(i.logger))},e)}));return function(t){return e.apply(this,arguments)}}()),a(this,"embedQSearchBar",function(){var e=n(g().m(function e(t){var n,s,r=arguments;return g().w(function(e){for(;;)if(0===e.n)return n=r.length>1&&void 0!==r[1]?r[1]:{},i.validateFrameOptions(t,"embedQSearchBar"),s=i.buildControlOptions(t),e.a(2,new Ne(t,n,s,i.experienceIdentifiers).setLogProvider(i.logger))},e)}));return function(t){return e.apply(this,arguments)}}()),a(this,"embedGenerativeQnA",function(){var e=n(g().m(function e(t){var n,s,r=arguments;return g().w(function(e){for(;;)if(0===e.n)return n=r.length>1&&void 0!==r[1]?r[1]:{},i.validateFrameOptions(t,"embedGenerativeQnA"),s=i.buildControlOptions(t),e.a(2,new Ve(t,n,s,i.experienceIdentifiers).setLogProvider(i.logger))},e)}));return function(t){return e.apply(this,arguments)}}()),a(this,"embedQuickChat",function(){var e=n(g().m(function e(t){var n,s,r=arguments;return g().w(function(e){for(;;)if(0===e.n)return n=r.length>1&&void 0!==r[1]?r[1]:{},i.validateFrameOptions(t,"embedQuickChat"),s=i.buildControlOptions(t),e.a(2,new Xe(t,n,s,i.experienceIdentifiers).setLogProvider(i.logger))},e)}));return function(t){return e.apply(this,arguments)}}()),a(this,"validateFrameOptions",function(e,t){if(!e){var n="".concat(t," is called without frameOptions");throw i.onChange(new q(T.NO_FRAME_OPTIONS,I.ERROR,"".concat(t," is called without frameOptions"),{methodName:t}),{frame:null}),new Error(n)}if("object"!==v(e)||Array.isArray(e)){var s="".concat(t," is called with non-object frameOptions");throw i.onChange(new q(T.INVALID_FRAME_OPTIONS,I.ERROR,s,{methodName:t,frameOptionsType:Array.isArray(e)?"array":v(e)}),{frame:null}),new Error(s)}var r=["url","container","width","height","resizeHeightOnSizeChangedEvent","withIframePlaceholder","onChange","className","framePermissions"],o=Object.keys(e).filter(function(e){return!r.includes(e)});if(o.length>0){var a,l,c="".concat(t," is called with unrecognized properties");null===(a=e.onChange)||void 0===a||a.call(e,new q(T.UNRECOGNIZED_FRAME_OPTIONS,I.WARN,c,{unrecognizedFrameOptions:o}),{frame:null}),null===(l=i.logger)||void 0===l||l.warn(c)}}),a(this,"buildControlOptions",function(e){if(!i.controlOptions){if(!e.url)throw new Error("URL is missing in frame options, but is a required field");var t=i.getControlUrlInfo(e.url),n=new Ue(i.getBodyElement(),{eventManager:i.eventManager,urlInfo:t,contextId:i.contextId},i.onChange,i.logger);i.controlOptions={eventManager:i.eventManager,sendToControlFrame:n.send,contextId:i.contextId,timeout:Ue.FRAME_TIMEOUT,urlInfo:t}}return i.controlOptions}),a(this,"onChange",function(e,t){i.contextOnChange&&i.contextOnChange(e,t)}),a(this,"getControlUrlInfo",function(e){var t=/^(https:\/\/[^/]+)\/(embedding|embed)\/([^/]+)\/[^?]+\?(.*)/i.exec(e)||[];if((null==t?void 0:t.length)<4)throw new Error('Invalid embedding url: "'.concat(e,'"'));return{sessionId:t[3],host:t[1],urlSearchParams:new URLSearchParams(t[4])}}),a(this,"getBodyElement",function(){var e,t=null===(e=document.getElementsByTagName("body"))||void 0===e?void 0:e[0];if(!t){var n="could not locate <body> element in the page";throw i.onChange(new q(T.NO_BODY,I.ERROR,n),{frame:null}),new Error(n)}return t}),this.contextId=le(),this.experienceIdentifiers=new Set,this.eventManager=new ze,this.contextOnChange=t.onChange,this.logger=new We}),Qe=function(){var e=n(g().m(function e(){var t,i=arguments;return g().w(function(e){for(;;)if(0===e.n)return t=i.length>0&&void 0!==i[0]?i[0]:{},e.a(2,new Ze(t))},e)}));return function(){return e.apply(this,arguments)}}(),Je=d(d(d(d(d(d(d(d(d(d(d(d(d(d(d({},L),M),R),k),P),_),O),F),V),U),H),z),j),$),K);e.BaseExperience=ce,e.BaseExperienceFrame=Ce,e.CALCULATED_METRIC_COLUMN_TYPE=B,e.ChangeEvent=q,e.ChangeEventLevel=I,e.ChangeEventName=T,e.ConsoleExperience=Te,e.ConsoleExperienceFrame=Ae,e.ControlExperience=Ue,e.ControlExperienceFrame=He,e.DashboardExperience=ke,e.DashboardExperienceFrame=Ie,e.DataResponse=ie,e.DefaultLogger=We,e.EmbeddingContext=Ze,e.EmbeddingEvent=Y,e.EmbeddingMessageEvent=X,e.ErrorChangeEventName=w,e.ErrorResponse=te,e.EventManager=ze,e.ExperienceType=N,e.GenerativeQnAExperience=Ve,e.GenerativeQnAExperienceFrame=Oe,e.GenerativeQnAPanelType=W,e.GetterMessageEventName=E,e.Iframe=ve,e.InfoChangeEventName=C,e.InfoMessageEventName=b,e.InternalQBaseExperience=_e,e.InvokerMessageEventName=A,e.MessageEventName=D,e.PostMessageEvent=Q,e.QSE=Je,e.QSearchExperience=Ne,e.QSearchExperienceFrame=Pe,e.QuickChatExperience=Xe,e.QuickChatExperienceFrame=je,e.ResponseMessage=J,e.SDK_VERSION=be,e.SPECIAL_DATAPOINT_VALUE_TYPES=G,e.SetterMessageEventName=x,e.SuccessResponse=ee,e.TargetedMessageEvent=Z,e.VisualExperience=Ee,e.VisualExperienceFrame=Se,e.WarnChangeEventName=S,e.createEmbeddingContext=Qe}(t)},862(e,t,i){"use strict";i.d(t,{G:()=>y});var n=i(33976),s=i(62199),r=i(74140),o=i(38383),a=i.n(o),l=i(74831);function c(e){return e.query.definitions.find(e=>"OperationDefinition"===e.kind)}var h=i(74579),u=i.n(h);const d={shouldHandleOperation:void 0,uri:void 0,setTransaction:!0,setFingerprint:!0,attachBreadcrumbs:{includeQuery:!1,includeVariables:!1,includeFetchResult:!1,includeError:!1,includeCache:!1,includeContext:!1,transform:void 0}};var p=i(6613),g=i(74765);function f(e){return JSON.stringify(e,null,2)}function m(e,t,i){const n=i.attachBreadcrumbs&&"function"==typeof i.attachBreadcrumbs.transform?i.attachBreadcrumbs.transform(t,e):t;n.data=function(e){const t={};for(const[i,n]of Object.entries(e))t[i]="object"==typeof n?f(n):n;return t}(n.data),(0,g.Z)(n)}class y extends n.C{options;constructor(e={}){super(),this.options=function(e){return u()(d,e)}(e)}request(e,t){const{options:i}=this;if(!(i.shouldHandleOperation?.(e)??1))return t(e);i.setTransaction&&function(e){const t=c(e).name;t&&(0,p.o5)().setTransactionName(t.value)}(e),i.setFingerprint&&function(e){const t=c(e).name;t&&(0,p.o5)().setFingerprint(["{{ default }}",t.value])}(e);const{attachBreadcrumbs:n}=i;if(!n)return t(e);const o=function(e,t){const i=t.attachBreadcrumbs,n=c(e),s={},r=t.uri;r&&(s.url=r);const o=n.name?.value;o&&(s.operationName=o),i.includeQuery&&(s.query=n.loc?.source?.body??(0,l.y)(n)),i.includeVariables&&(s.variables=e.variables),i.includeCache&&(s.cache=e.getContext().cache?.data?.data??void 0);const h=i.includeContext;return h&&(s.context=function(e,t){const i={};return t.forEach(t=>{i[t]=a().get(e,t)}),i}(e.getContext(),h)),{type:"http",category:`graphql.${n.operation}`,data:s}}(e,i);return new r.c(r=>{const a=t(e).subscribe({next:e=>{o.level=function(e){return e.errors&&e.errors.length>0?"error":"info"}(e),n.includeFetchResult&&(o.data.fetchResult=e),n.includeError&&e.errors&&e.errors.length>0&&(o.data.error=new s.K4({graphQLErrors:e.errors})),r.next(e)},complete:()=>{m(e,o,i),r.complete()},error:t=>{let s;if(o.level="error",function(e){return"object"==typeof e&&null!==e&&"response"in e&&"result"in e&&"statusCode"in e}(t)){const{result:e,response:i,...r}=t;s=r,n.includeFetchResult&&(o.data.fetchResult=e)}else s=t;n.includeError&&(o.data.error=s),m(e,o,i),r.error(t)}});return()=>{a.unsubscribe()}})}}},47661(e,t,i){"use strict";i.d(t,{Eq:()=>l});var n=new WeakMap,s=new WeakMap,r={},o=0,a=function(e){return e&&(e.host||a(e.parentNode))},l=function(e,t,i){void 0===i&&(i="data-aria-hidden");var l=Array.from(Array.isArray(e)?e:[e]),c=t||function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return c?(l.push.apply(l,Array.from(c.querySelectorAll("[aria-live], script"))),function(e,t,i,l){var c=function(e,t){return t.map(function(t){if(e.contains(t))return t;var i=a(t);return i&&e.contains(i)?i:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return Boolean(e)})}(t,Array.isArray(e)?e:[e]);r[i]||(r[i]=new WeakMap);var h=r[i],u=[],d=new Set,p=new Set(c),g=function(e){e&&!d.has(e)&&(d.add(e),g(e.parentNode))};c.forEach(g);var f=function(e){e&&!p.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(d.has(e))f(e);else try{var t=e.getAttribute(l),r=null!==t&&"false"!==t,o=(n.get(e)||0)+1,a=(h.get(e)||0)+1;n.set(e,o),h.set(e,a),u.push(e),1===o&&r&&s.set(e,!0),1===a&&e.setAttribute(i,"true"),r||e.setAttribute(l,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return f(t),d.clear(),o++,function(){u.forEach(function(e){var t=n.get(e)-1,r=h.get(e)-1;n.set(e,t),h.set(e,r),t||(s.has(e)||e.removeAttribute(l),s.delete(e)),r||e.removeAttribute(i)}),--o||(n=new WeakMap,n=new WeakMap,s=new WeakMap,r={})}}(l,c,i,"aria-hidden")):function(){return null}}},78071(e,t,i){var n=t;n.bignum=i(5630),n.define=i(92300).define,n.base=i(73160),n.constants=i(14241),n.decoders=i(81300),n.encoders=i(36028)},92300(e,t,i){var n=i(78071),s=i(91193);function r(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}t.define=function(e,t){return new r(e,t)},r.prototype._createNamed=function(e){var t;try{t=i(92785).runInThisContext("(function "+this.name+"(entity) {\n  this._initNamed(entity);\n})")}catch(e){t=function(e){this._initNamed(e)}}return s(t,e),t.prototype._initNamed=function(t){e.call(this,t)},new t(this)},r.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(n.decoders[e])),this.decoders[e]},r.prototype.decode=function(e,t,i){return this._getDecoder(t).decode(e,i)},r.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(n.encoders[e])),this.encoders[e]},r.prototype.encode=function(e,t,i){return this._getEncoder(t).encode(e,i)}},86216(e,t,i){var n=i(91193),s=i(73160).Reporter,r=i(77511).Buffer;function o(e,t){s.call(this,t),r.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function a(e,t){if(Array.isArray(e))this.length=0,this.value=e.map(function(e){return e instanceof a||(e=new a(e,t)),this.length+=e.length,e},this);else if("number"==typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=r.byteLength(e);else{if(!r.isBuffer(e))return t.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}n(o,s),t.t=o,o.prototype.save=function(){return{offset:this.offset,reporter:s.prototype.save.call(this)}},o.prototype.restore=function(e){var t=new o(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,s.prototype.restore.call(this,e.reporter),t},o.prototype.isEmpty=function(){return this.offset===this.length},o.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},o.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");var i=new o(this.base);return i._reporterState=this._reporterState,i.offset=this.offset,i.length=this.offset+e,this.offset+=e,i},o.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},t.d=a,a.prototype.join=function(e,t){return e||(e=new r(this.length)),t||(t=0),0===this.length||(Array.isArray(this.value)?this.value.forEach(function(i){i.join(e,t),t+=i.length}):("number"==typeof this.value?e[t]=this.value:"string"==typeof this.value?e.write(this.value,t):r.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}},73160(e,t,i){var n=t;n.Reporter=i(18031).a,n.DecoderBuffer=i(86216).t,n.EncoderBuffer=i(86216).d,n.Node=i(13558)},13558(e,t,i){var n=i(73160).Reporter,s=i(73160).EncoderBuffer,r=i(73160).DecoderBuffer,o=i(35578),a=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],l=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(a);function c(e,t){var i={};this._baseState=i,i.enc=e,i.parent=t||null,i.children=null,i.tag=null,i.args=null,i.reverseArgs=null,i.choice=null,i.optional=!1,i.any=!1,i.obj=!1,i.use=null,i.useDecoder=null,i.key=null,i.default=null,i.explicit=null,i.implicit=null,i.contains=null,i.parent||(i.children=[],this._wrap())}e.exports=c;var h=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];c.prototype.clone=function(){var e=this._baseState,t={};h.forEach(function(i){t[i]=e[i]});var i=new this.constructor(t.parent);return i._baseState=t,i},c.prototype._wrap=function(){var e=this._baseState;l.forEach(function(t){this[t]=function(){var i=new this.constructor(this);return e.children.push(i),i[t].apply(i,arguments)}},this)},c.prototype._init=function(e){var t=this._baseState;o(null===t.parent),e.call(this),t.children=t.children.filter(function(e){return e._baseState.parent===this},this),o.equal(t.children.length,1,"Root node can have only one child")},c.prototype._useArgs=function(e){var t=this._baseState,i=e.filter(function(e){return e instanceof this.constructor},this);e=e.filter(function(e){return!(e instanceof this.constructor)},this),0!==i.length&&(o(null===t.children),t.children=i,i.forEach(function(e){e._baseState.parent=this},this)),0!==e.length&&(o(null===t.args),t.args=e,t.reverseArgs=e.map(function(e){if("object"!=typeof e||e.constructor!==Object)return e;var t={};return Object.keys(e).forEach(function(i){i==(0|i)&&(i|=0);var n=e[i];t[n]=i}),t}))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach(function(e){c.prototype[e]=function(){var t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}}),a.forEach(function(e){c.prototype[e]=function(){var t=this._baseState,i=Array.prototype.slice.call(arguments);return o(null===t.tag),t.tag=e,this._useArgs(i),this}}),c.prototype.use=function(e){o(e);var t=this._baseState;return o(null===t.use),t.use=e,this},c.prototype.optional=function(){return this._baseState.optional=!0,this},c.prototype.def=function(e){var t=this._baseState;return o(null===t.default),t.default=e,t.optional=!0,this},c.prototype.explicit=function(e){var t=this._baseState;return o(null===t.explicit&&null===t.implicit),t.explicit=e,this},c.prototype.implicit=function(e){var t=this._baseState;return o(null===t.explicit&&null===t.implicit),t.implicit=e,this},c.prototype.obj=function(){var e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},c.prototype.key=function(e){var t=this._baseState;return o(null===t.key),t.key=e,this},c.prototype.any=function(){return this._baseState.any=!0,this},c.prototype.choice=function(e){var t=this._baseState;return o(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map(function(t){return e[t]})),this},c.prototype.contains=function(e){var t=this._baseState;return o(null===t.use),t.contains=e,this},c.prototype._decode=function(e,t){var i=this._baseState;if(null===i.parent)return e.wrapResult(i.children[0]._decode(e,t));var n,s=i.default,o=!0,a=null;if(null!==i.key&&(a=e.enterKey(i.key)),i.optional){var l=null;if(null!==i.explicit?l=i.explicit:null!==i.implicit?l=i.implicit:null!==i.tag&&(l=i.tag),null!==l||i.any){if(o=this._peekTag(e,l,i.any),e.isError(o))return o}else{var c=e.save();try{null===i.choice?this._decodeGeneric(i.tag,e,t):this._decodeChoice(e,t),o=!0}catch(e){o=!1}e.restore(c)}}if(i.obj&&o&&(n=e.enterObject()),o){if(null!==i.explicit){var h=this._decodeTag(e,i.explicit);if(e.isError(h))return h;e=h}var u=e.offset;if(null===i.use&&null===i.choice){i.any&&(c=e.save());var d=this._decodeTag(e,null!==i.implicit?i.implicit:i.tag,i.any);if(e.isError(d))return d;i.any?s=e.raw(c):e=d}if(t&&t.track&&null!==i.tag&&t.track(e.path(),u,e.length,"tagged"),t&&t.track&&null!==i.tag&&t.track(e.path(),e.offset,e.length,"content"),i.any||(s=null===i.choice?this._decodeGeneric(i.tag,e,t):this._decodeChoice(e,t)),e.isError(s))return s;if(i.any||null!==i.choice||null===i.children||i.children.forEach(function(i){i._decode(e,t)}),i.contains&&("octstr"===i.tag||"bitstr"===i.tag)){var p=new r(s);s=this._getUse(i.contains,e._reporterState.obj)._decode(p,t)}}return i.obj&&o&&(s=e.leaveObject(n)),null===i.key||null===s&&!0!==o?null!==a&&e.exitKey(a):e.leaveKey(a,i.key,s),s},c.prototype._decodeGeneric=function(e,t,i){var n=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,n.args[0],i):/str$/.test(e)?this._decodeStr(t,e,i):"objid"===e&&n.args?this._decodeObjid(t,n.args[0],n.args[1],i):"objid"===e?this._decodeObjid(t,null,null,i):"gentime"===e||"utctime"===e?this._decodeTime(t,e,i):"null_"===e?this._decodeNull(t,i):"bool"===e?this._decodeBool(t,i):"objDesc"===e?this._decodeStr(t,e,i):"int"===e||"enum"===e?this._decodeInt(t,n.args&&n.args[0],i):null!==n.use?this._getUse(n.use,t._reporterState.obj)._decode(t,i):t.error("unknown tag: "+e)},c.prototype._getUse=function(e,t){var i=this._baseState;return i.useDecoder=this._use(e,t),o(null===i.useDecoder._baseState.parent),i.useDecoder=i.useDecoder._baseState.children[0],i.implicit!==i.useDecoder._baseState.implicit&&(i.useDecoder=i.useDecoder.clone(),i.useDecoder._baseState.implicit=i.implicit),i.useDecoder},c.prototype._decodeChoice=function(e,t){var i=this._baseState,n=null,s=!1;return Object.keys(i.choice).some(function(r){var o=e.save(),a=i.choice[r];try{var l=a._decode(e,t);if(e.isError(l))return!1;n={type:r,value:l},s=!0}catch(t){return e.restore(o),!1}return!0},this),s?n:e.error("Choice not matched")},c.prototype._createEncoderBuffer=function(e){return new s(e,this.reporter)},c.prototype._encode=function(e,t,i){var n=this._baseState;if(null===n.default||n.default!==e){var s=this._encodeValue(e,t,i);if(void 0!==s&&!this._skipDefault(s,t,i))return s}},c.prototype._encodeValue=function(e,t,i){var s=this._baseState;if(null===s.parent)return s.children[0]._encode(e,t||new n);var r=null;if(this.reporter=t,s.optional&&void 0===e){if(null===s.default)return;e=s.default}var o=null,a=!1;if(s.any)r=this._createEncoderBuffer(e);else if(s.choice)r=this._encodeChoice(e,t);else if(s.contains)o=this._getUse(s.contains,i)._encode(e,t),a=!0;else if(s.children)o=s.children.map(function(i){if("null_"===i._baseState.tag)return i._encode(null,t,e);if(null===i._baseState.key)return t.error("Child should have a key");var n=t.enterKey(i._baseState.key);if("object"!=typeof e)return t.error("Child expected, but input is not object");var s=i._encode(e[i._baseState.key],t,e);return t.leaveKey(n),s},this).filter(function(e){return e}),o=this._createEncoderBuffer(o);else if("seqof"===s.tag||"setof"===s.tag){if(!s.args||1!==s.args.length)return t.error("Too many args for : "+s.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");var l=this.clone();l._baseState.implicit=null,o=this._createEncoderBuffer(e.map(function(i){var n=this._baseState;return this._getUse(n.args[0],e)._encode(i,t)},l))}else null!==s.use?r=this._getUse(s.use,i)._encode(e,t):(o=this._encodePrimitive(s.tag,e),a=!0);if(!s.any&&null===s.choice){var c=null!==s.implicit?s.implicit:s.tag,h=null===s.implicit?"universal":"context";null===c?null===s.use&&t.error("Tag could be omitted only for .use()"):null===s.use&&(r=this._encodeComposite(c,a,h,o))}return null!==s.explicit&&(r=this._encodeComposite(s.explicit,!1,"context",r)),r},c.prototype._encodeChoice=function(e,t){var i=this._baseState,n=i.choice[e.type];return n||o(!1,e.type+" not found in "+JSON.stringify(Object.keys(i.choice))),n._encode(e.value,t)},c.prototype._encodePrimitive=function(e,t){var i=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&i.args)return this._encodeObjid(t,i.reverseArgs[0],i.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,i.args&&i.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},c.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},c.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(e)}},18031(e,t,i){var n=i(91193);function s(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function r(e,t){this.path=e,this.rethrow(t)}t.a=s,s.prototype.isError=function(e){return e instanceof r},s.prototype.save=function(){var e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},s.prototype.restore=function(e){var t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},s.prototype.enterKey=function(e){return this._reporterState.path.push(e)},s.prototype.exitKey=function(e){var t=this._reporterState;t.path=t.path.slice(0,e-1)},s.prototype.leaveKey=function(e,t,i){var n=this._reporterState;this.exitKey(e),null!==n.obj&&(n.obj[t]=i)},s.prototype.path=function(){return this._reporterState.path.join("/")},s.prototype.enterObject=function(){var e=this._reporterState,t=e.obj;return e.obj={},t},s.prototype.leaveObject=function(e){var t=this._reporterState,i=t.obj;return t.obj=e,i},s.prototype.error=function(e){var t,i=this._reporterState,n=e instanceof r;if(t=n?e:new r(i.path.map(function(e){return"["+JSON.stringify(e)+"]"}).join(""),e.message||e,e.stack),!i.options.partial)throw t;return n||i.errors.push(t),t},s.prototype.wrapResult=function(e){var t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},n(r,Error),r.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,r),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},4029(e,t,i){var n=i(14241);t.tagClass={0:"universal",1:"application",2:"context",3:"private"},t.tagClassByName=n._reverse(t.tagClass),t.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},t.tagByName=n._reverse(t.tag)},14241(e,t,i){var n=t;n._reverse=function(e){var t={};return Object.keys(e).forEach(function(i){(0|i)==i&&(i|=0);var n=e[i];t[n]=i}),t},n.der=i(4029)},87779(e,t,i){var n=i(91193),s=i(78071),r=s.base,o=s.bignum,a=s.constants.der;function l(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new c,this.tree._init(e.body)}function c(e){r.Node.call(this,"der",e)}function h(e,t){var i=e.readUInt8(t);if(e.isError(i))return i;var n=a.tagClass[i>>6],s=!(32&i);if(31&~i)i&=31;else{var r=i;for(i=0;!(128&~r);){if(r=e.readUInt8(t),e.isError(r))return r;i<<=7,i|=127&r}}return{cls:n,primitive:s,tag:i,tagStr:a.tag[i]}}function u(e,t,i){var n=e.readUInt8(i);if(e.isError(n))return n;if(!t&&128===n)return null;if(!(128&n))return n;var s=127&n;if(s>4)return e.error("length octect is too long");n=0;for(var r=0;r<s;r++){n<<=8;var o=e.readUInt8(i);if(e.isError(o))return o;n|=o}return n}e.exports=l,l.prototype.decode=function(e,t){return e instanceof r.DecoderBuffer||(e=new r.DecoderBuffer(e,t)),this.tree._decode(e,t)},n(c,r.Node),c.prototype._peekTag=function(e,t,i){if(e.isEmpty())return!1;var n=e.save(),s=h(e,'Failed to peek tag: "'+t+'"');return e.isError(s)?s:(e.restore(n),s.tag===t||s.tagStr===t||s.tagStr+"of"===t||i)},c.prototype._decodeTag=function(e,t,i){var n=h(e,'Failed to decode tag of "'+t+'"');if(e.isError(n))return n;var s=u(e,n.primitive,'Failed to get length of "'+t+'"');if(e.isError(s))return s;if(!i&&n.tag!==t&&n.tagStr!==t&&n.tagStr+"of"!==t)return e.error('Failed to match tag: "'+t+'"');if(n.primitive||null!==s)return e.skip(s,'Failed to match body of: "'+t+'"');var r=e.save(),o=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');return e.isError(o)?o:(s=e.offset-r.offset,e.restore(r),e.skip(s,'Failed to match body of: "'+t+'"'))},c.prototype._skipUntilEnd=function(e,t){for(;;){var i=h(e,t);if(e.isError(i))return i;var n,s=u(e,i.primitive,t);if(e.isError(s))return s;if(n=i.primitive||null!==s?e.skip(s):this._skipUntilEnd(e,t),e.isError(n))return n;if("end"===i.tagStr)break}},c.prototype._decodeList=function(e,t,i,n){for(var s=[];!e.isEmpty();){var r=this._peekTag(e,"end");if(e.isError(r))return r;var o=i.decode(e,"der",n);if(e.isError(o)&&r)break;s.push(o)}return s},c.prototype._decodeStr=function(e,t){if("bitstr"===t){var i=e.readUInt8();return e.isError(i)?i:{unused:i,data:e.raw()}}if("bmpstr"===t){var n=e.raw();if(n.length%2==1)return e.error("Decoding of string type: bmpstr length mismatch");for(var s="",r=0;r<n.length/2;r++)s+=String.fromCharCode(n.readUInt16BE(2*r));return s}if("numstr"===t){var o=e.raw().toString("ascii");return this._isNumstr(o)?o:e.error("Decoding of string type: numstr unsupported characters")}if("octstr"===t)return e.raw();if("objDesc"===t)return e.raw();if("printstr"===t){var a=e.raw().toString("ascii");return this._isPrintstr(a)?a:e.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(t)?e.raw().toString():e.error("Decoding of string type: "+t+" unsupported")},c.prototype._decodeObjid=function(e,t,i){for(var n,s=[],r=0;!e.isEmpty();){var o=e.readUInt8();r<<=7,r|=127&o,128&o||(s.push(r),r=0)}128&o&&s.push(r);var a=s[0]/40|0,l=s[0]%40;if(n=i?s:[a,l].concat(s.slice(1)),t){var c=t[n.join(" ")];void 0===c&&(c=t[n.join(".")]),void 0!==c&&(n=c)}return n},c.prototype._decodeTime=function(e,t){var i=e.raw().toString();if("gentime"===t)var n=0|i.slice(0,4),s=0|i.slice(4,6),r=0|i.slice(6,8),o=0|i.slice(8,10),a=0|i.slice(10,12),l=0|i.slice(12,14);else{if("utctime"!==t)return e.error("Decoding "+t+" time is not supported yet");n=0|i.slice(0,2),s=0|i.slice(2,4),r=0|i.slice(4,6),o=0|i.slice(6,8),a=0|i.slice(8,10),l=0|i.slice(10,12),n=n<70?2e3+n:1900+n}return Date.UTC(n,s-1,r,o,a,l,0)},c.prototype._decodeNull=function(e){return null},c.prototype._decodeBool=function(e){var t=e.readUInt8();return e.isError(t)?t:0!==t},c.prototype._decodeInt=function(e,t){var i=e.raw(),n=new o(i);return t&&(n=t[n.toString(10)]||n),n},c.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getDecoder("der").tree}},81300(e,t,i){var n=t;n.der=i(87779),n.pem=i(71222)},71222(e,t,i){var n=i(91193),s=i(77511).Buffer,r=i(87779);function o(e){r.call(this,e),this.enc="pem"}n(o,r),e.exports=o,o.prototype.decode=function(e,t){for(var i=e.toString().split(/[\r\n]+/g),n=t.label.toUpperCase(),o=/^-----(BEGIN|END) ([^-]+)-----$/,a=-1,l=-1,c=0;c<i.length;c++){var h=i[c].match(o);if(null!==h&&h[2]===n){if(-1!==a){if("END"!==h[1])break;l=c;break}if("BEGIN"!==h[1])break;a=c}}if(-1===a||-1===l)throw new Error("PEM section not found for: "+n);var u=i.slice(a+1,l).join("");u.replace(/[^a-z0-9\+\/=]+/gi,"");var d=new s(u,"base64");return r.prototype.decode.call(this,d,t)}},99291(e,t,i){var n=i(91193),s=i(77511).Buffer,r=i(78071),o=r.base,a=r.constants.der;function l(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new c,this.tree._init(e.body)}function c(e){o.Node.call(this,"der",e)}function h(e){return e<10?"0"+e:e}e.exports=l,l.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},n(c,o.Node),c.prototype._encodeComposite=function(e,t,i,n){var r,o=function(e,t,i,n){var s;if("seqof"===e?e="seq":"setof"===e&&(e="set"),a.tagByName.hasOwnProperty(e))s=a.tagByName[e];else{if("number"!=typeof e||(0|e)!==e)return n.error("Unknown tag: "+e);s=e}return s>=31?n.error("Multi-octet tag encoding unsupported"):(t||(s|=32),s|=a.tagClassByName[i||"universal"]<<6)}(e,t,i,this.reporter);if(n.length<128)return(r=new s(2))[0]=o,r[1]=n.length,this._createEncoderBuffer([r,n]);for(var l=1,c=n.length;c>=256;c>>=8)l++;(r=new s(2+l))[0]=o,r[1]=128|l,c=1+l;for(var h=n.length;h>0;c--,h>>=8)r[c]=255&h;return this._createEncoderBuffer([r,n])},c.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){for(var i=new s(2*e.length),n=0;n<e.length;n++)i.writeUInt16BE(e.charCodeAt(n),2*n);return this._createEncoderBuffer(i)}return"numstr"===t?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===t?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)||"objDesc"===t?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported")},c.prototype._encodeObjid=function(e,t,i){if("string"==typeof e){if(!t)return this.reporter.error("string objid given, but no values map found");if(!t.hasOwnProperty(e))return this.reporter.error("objid not found in values map");e=t[e].split(/[\s\.]+/g);for(var n=0;n<e.length;n++)e[n]|=0}else if(Array.isArray(e))for(e=e.slice(),n=0;n<e.length;n++)e[n]|=0;if(!Array.isArray(e))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(e));if(!i){if(e[1]>=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}var r=0;for(n=0;n<e.length;n++){var o=e[n];for(r++;o>=128;o>>=7)r++}var a=new s(r),l=a.length-1;for(n=e.length-1;n>=0;n--)for(o=e[n],a[l--]=127&o;(o>>=7)>0;)a[l--]=128|127&o;return this._createEncoderBuffer(a)},c.prototype._encodeTime=function(e,t){var i,n=new Date(e);return"gentime"===t?i=[h(n.getFullYear()),h(n.getUTCMonth()+1),h(n.getUTCDate()),h(n.getUTCHours()),h(n.getUTCMinutes()),h(n.getUTCSeconds()),"Z"].join(""):"utctime"===t?i=[h(n.getFullYear()%100),h(n.getUTCMonth()+1),h(n.getUTCDate()),h(n.getUTCHours()),h(n.getUTCMinutes()),h(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(i,"octstr")},c.prototype._encodeNull=function(){return this._createEncoderBuffer("")},c.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!s.isBuffer(e)){var i=e.toArray();!e.sign&&128&i[0]&&i.unshift(0),e=new s(i)}if(s.isBuffer(e)){var n=e.length;0===e.length&&n++;var r=new s(n);return e.copy(r),0===e.length&&(r[0]=0),this._createEncoderBuffer(r)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);n=1;for(var o=e;o>=256;o>>=8)n++;for(o=(r=new Array(n)).length-1;o>=0;o--)r[o]=255&e,e>>=8;return 128&r[0]&&r.unshift(0),this._createEncoderBuffer(new s(r))},c.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},c.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},c.prototype._skipDefault=function(e,t,i){var n,s=this._baseState;if(null===s.default)return!1;var r=e.join();if(void 0===s.defaultBuffer&&(s.defaultBuffer=this._encodeValue(s.default,t,i).join()),r.length!==s.defaultBuffer.length)return!1;for(n=0;n<r.length;n++)if(r[n]!==s.defaultBuffer[n])return!1;return!0}},36028(e,t,i){var n=t;n.der=i(99291),n.pem=i(59678)},59678(e,t,i){var n=i(91193),s=i(99291);function r(e){s.call(this,e),this.enc="pem"}n(r,s),e.exports=r,r.prototype.encode=function(e,t){for(var i=s.prototype.encode.call(this,e).toString("base64"),n=["-----BEGIN "+t.label+"-----"],r=0;r<i.length;r+=64)n.push(i.slice(r,r+64));return n.push("-----END "+t.label+"-----"),n.join("\n")}},88456(e,t,i){"use strict";var n,s=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},n(e,t)},function(e,t){function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var s in t=arguments[i])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))(function(s,r){function o(e){try{l(n.next(e))}catch(e){r(e)}}function a(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){var i,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,n&&(s=2&r[0]?n.return:r[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,r[1])).done)return s;switch(n=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,n=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!((s=(s=o.trys).length>0&&s[s.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){o.label=r[1];break}if(6===r[0]&&o.label<s[1]){o.label=s[1],s=r;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(r);break}s[2]&&o.ops.pop(),o.trys.pop();continue}r=t.call(e,o)}catch(e){r=[6,e],n=0}finally{i=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var l,c=i(96746),h=i(2693),u=i(81516),d=i(71481),p=i(12026),g=i(15926);t.USER_AGENT_HEADER="x-amz-user-agent",t.USER_AGENT="aws-amplify/"+g.version+(p.userAgent&&" ")+p.userAgent,function(e){e.NONE="NONE",e.API_KEY="API_KEY",e.AWS_IAM="AWS_IAM",e.AMAZON_COGNITO_USER_POOLS="AMAZON_COGNITO_USER_POOLS",e.OPENID_CONNECT="OPENID_CONNECT",e.AWS_LAMBDA="AWS_LAMBDA"}(l=t.AUTH_TYPE||(t.AUTH_TYPE={}));var f=function(e){function i(i){var n=e.call(this)||this;return n.link=t.authLink(i),n}return s(i,e),i.prototype.request=function(e,t){return this.link.request(e,t)},i}(c.ApolloLink);t.AuthLink=f;var m=function(e,i,n){var s=void 0===e?{header:"",value:""}:e,l=s.header,c=s.value;return o(void 0,void 0,void 0,function(){var e,s,o,h,u;return a(this,function(a){switch(a.label){case 0:return e=i.getContext(),s=r(r({},e.headers),((h={})[t.USER_AGENT_HEADER]=t.USER_AGENT,h)),l&&c?"function"!=typeof c?[3,2]:[4,c.call(void 0)]:[3,5];case 1:return o=a.sent(),[3,4];case 2:return[4,c];case 3:o=a.sent(),a.label=4;case 4:s=r(((u={})[l]=o,u),s),a.label=5;case 5:return i.setContext(r(r({},e),{headers:s})),[2,n(i)]}})})};t.authLink=function(e){var i=e.url,n=e.region,s=e.auth,h=(void 0===s?{}:s).type,p=e.auth;return new c.ApolloLink(function(e,s){return new c.Observable(function(c){var g,f;switch(h){case l.NONE:f=m(void 0,e,s);break;case l.AWS_IAM:var v=p.credentials;f=function(e,i,n){var s=e.credentials,l=e.region,c=e.url;return o(void 0,void 0,void 0,function(){var e,o,h,p,g,f,m,v,b,C,w,S,x;return a(this,function(a){switch(a.label){case 0:return e="appsync",o=i.getContext(),(h="function"==typeof s?s.call():s||{})&&"function"==typeof h.getPromise?[4,h.getPromise()]:[3,2];case 1:a.sent(),a.label=2;case 2:return[4,h];case 3:return p=a.sent(),g=p.accessKeyId,f=p.secretAccessKey,m=p.sessionToken,v=d.parse(c),b=v.host,C=v.path,w=r(r({},y(i,{})),{service:e,region:l,url:c,host:b,path:C}),S=u.Signer.sign(w,{access_key:g,secret_key:f,session_token:m}).headers,i.setContext(r(r({},o),{headers:r(r(r({},o.headers),S),(x={},x[t.USER_AGENT_HEADER]=t.USER_AGENT,x))})),[2,n(i)]}})})}({credentials:void 0===v?{}:v,region:n,url:i},e,s);break;case l.API_KEY:var b=p.apiKey;f=m({header:"X-Api-Key",value:void 0===b?"":b},e,s);break;case l.AMAZON_COGNITO_USER_POOLS:case l.OPENID_CONNECT:var C=p.jwtToken;f=m({header:"Authorization",value:void 0===C?"":C},e,s);break;case l.AWS_LAMBDA:var w=p.token;f=m({header:"Authorization",value:void 0===w?"":w},e,s);break;default:throw new Error("Invalid AUTH_TYPE: "+p.type)}return f.then(function(e){g=e.subscribe({next:c.next.bind(c),error:c.error.bind(c),complete:c.complete.bind(c)})}),function(){g&&g.unsubscribe()}})})};var y=function(e,t){var i=e.operationName,n=e.variables,s=e.query,o={operationName:i,variables:v(n),query:h.print(s)};return r(r({body:JSON.stringify(o),method:"POST"},t),{headers:r({accept:"*/*","content-type":"application/json; charset=UTF-8"},t.headers)})},v=function(e){return Object.keys(e).filter(function(e){return!e.startsWith("@@")}).reduce(function(t,i){return t[i]=e[i],t},{})}},90385(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(88456);t.AuthLink=n.AuthLink,t.AUTH_TYPE=n.AUTH_TYPE,t.USER_AGENT_HEADER=n.USER_AGENT_HEADER,t.USER_AGENT=n.USER_AGENT,t.createAuthLink=function(e){var t=e.url,i=e.region,s=e.auth;return new n.AuthLink({url:t,region:i,auth:s})};var s=i(81516);t.Signer=s.Signer},12026(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.userAgent=""},81516(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var i in e)t.hasOwnProperty(i)||(t[i]=e[i])}(i(72052))},72052(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),globalThis.Buffer=globalThis.Buffer||i(77511).Buffer;var n=i(71481),s=i(18558).Sha256,r=i(93065).n,o=function(e,t,i){void 0===i&&(i="");var n=new s(e);n.update(t);var o=n.digestSync();return"hex"===i?r(o):o},a=function(e){var t=e||"",i=new s;return i.update(t),r(i.digestSync())},l=function(e){return Object.keys(e).map(function(e){return e.toLowerCase()}).sort().join(";")},c=function(e,t,i){void 0===i&&(i=null),e.headers=e.headers||{};var s=(new Date).toISOString().replace(/[:-]|\.\d{3}/g,""),r=s.substr(0,8),c="AWS4-HMAC-SHA256",h=n.parse(e.url);e.headers.host=h.host,e.headers["x-amz-date"]=s,t.session_token&&(e.headers["X-Amz-Security-Token"]=t.session_token);var u=function(e){var t,i=n.parse(e.url);return[e.method||"/",i.path,i.query,(t=e.headers,t&&0!==Object.keys(t).length?Object.keys(t).map(function(e){return{key:e.toLowerCase(),value:t[e]?t[e].trim().replace(/\s+/g," "):""}}).sort(function(e,t){return e.key<t.key?-1:1}).map(function(e){return e.key+":"+e.value}).join("\n")+"\n":""),l(e.headers),a(e.body)].join("\n")}(e);i=i||function(e){var t=(n.parse(e.url).host.match(/([^.]+)\.(?:([^.]*)\.)?amazonaws\.com$/)||[]).slice(1,3);return"es"===t[1]&&(t=t.reverse()),{service:e.service||t[0],region:e.region||t[1]}}(e);var d=function(e,t,i){return[e,t,i,"aws4_request"].join("/")}(r,i.region,i.service),p=function(e,t,i,n){return[e,i,n,a(t)].join("\n")}(c,u,s,d),g=function(e,t,i){void 0===e&&(e="");var n=o("AWS4"+e,t),s=o(n,i.region),r=o(s,i.service);return o(r,"aws4_request")}(t.secret_key,r,i),f=function(e,t){return o(e,t,"hex")}(g,p),m=function(e,t,i,n,s){return void 0===t&&(t=""),[e+" Credential="+t+"/"+i,"SignedHeaders="+n,"Signature="+s].join(", ")}(c,t.access_key,d,l(e.headers),f);return e.headers.Authorization=m,e},h=function(){function e(){}return e.sign=c,e}();t.Signer=h,t.default=h},693(e,t,i){"use strict";var n=this&&this.__rest||function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(i[n[s]]=e[n[s]])}return i};Object.defineProperty(t,"__esModule",{value:!0});var s=i(6349);t.CONTROL_EVENTS_KEY=s.CONTROL_EVENTS_KEY;var r=i(96746),o=i(5623),a=i(18500),l=i(45679),c=i(1701);t.createSubscriptionHandshakeLink=function(e,t){var i,h;if("string"==typeof e)i=t||o.createHttpLink({uri:e}),h=r.ApolloLink.from([new l.NonTerminatingLink("controlMessages",{link:new r.ApolloLink(function(e,t){return new r.Observable(function(t){var i,r=e.variables,o=s.CONTROL_EVENTS_KEY,a=r[o],l=n(r,["symbol"==typeof o?o:o+""]);return void 0!==a&&(e.variables=l),t.next(((i={})[s.CONTROL_EVENTS_KEY]=a,i)),function(){}})})}),new l.NonTerminatingLink("subsInfo",{link:i}),new s.SubscriptionHandshakeLink("subsInfo")]);else{var u=e.url;i=t||o.createHttpLink({uri:u}),h=new c.AppSyncRealTimeSubscriptionHandshakeLink(e)}return r.ApolloLink.split(function(e){var t=e.query,i=a.getMainDefinition(t),n=i.kind,s=i.operation;return"OperationDefinition"===n&&"subscription"===s},h,i)}},45679(e,t,i){"use strict";var n,s=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},n(e,t)},function(e,t){function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var s in t=arguments[i])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))(function(s,r){function o(e){try{l(n.next(e))}catch(e){r(e)}}function a(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){var i,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,n&&(s=2&r[0]?n.return:r[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,r[1])).done)return s;switch(n=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,n=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!((s=(s=o.trys).length>0&&s[s.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){o.label=r[1];break}if(6===r[0]&&o.label<s[1]){o.label=s[1],s=r;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(r);break}s[2]&&o.ops.pop(),o.trys.pop();continue}r=t.call(e,o)}catch(e){r=[6,e],n=0}finally{i=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var l=i(96746),c=i(40168),h=function(e){function t(t,i){var n=i.link,s=e.call(this)||this;return s.contextKey=t,s.link=n,s}return s(t,e),t.prototype.request=function(e,t){var i=this;return c.setContext(function(t,n){return o(i,void 0,void 0,function(){var t,i,s=this;return a(this,function(o){switch(o.label){case 0:return[4,new Promise(function(t,i){s.link.request(e).subscribe({next:t,error:i})})];case 1:return t=o.sent(),[2,r(r({},n),(i={},i[this.contextKey]=t,i))]}})})}).request(e,t)},t}(l.ApolloLink);t.NonTerminatingLink=h},1701(e,t,i){"use strict";var n,s=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},n(e,t)},function(e,t){function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var s in t=arguments[i])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))(function(s,r){function o(e){try{l(n.next(e))}catch(e){r(e)}}function a(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){var i,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,n&&(s=2&r[0]?n.return:r[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,r[1])).done)return s;switch(n=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,n=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!((s=(s=o.trys).length>0&&s[s.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){o.label=r[1];break}if(6===r[0]&&o.label<s[1]){o.label=s[1],s=r;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(r);break}s[2]&&o.ops.pop(),o.trys.pop();continue}r=t.call(e,o)}catch(e){r=[6,e],n=0}finally{i=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var l=i(96746),c=i(21191),h=i(90385),u=i(61001),d=i(71481),p=i(32486),g=i(8339),f=i(24873),m=c.rootLogger.extend("subscriptions");t.CONTROL_EVENTS_KEY="@@controlEvents";var y=[400,401,403],v={accept:"application/json, text/javascript","content-encoding":"amz-1.0","content-type":"application/json; charset=UTF-8"},b=/^https:\/\/\w{26}\.appsync\-api\.\w{2}(?:(?:\-\w{2,})+)\-\d\.amazonaws.com\/graphql$/i,C=function(e){function i(t){var i=t.url,n=t.region,s=t.auth,r=t.keepAliveTimeoutMs,o=e.call(this)||this;if(o.socketStatus=g.SOCKET_STATUS.CLOSED,o.keepAliveTimeout=void 0,o.subscriptionObserverMap=new Map,o.promiseArray=[],o.url=i,o.region=n,o.auth=s,o.keepAliveTimeout=r,o.keepAliveTimeout<6e4)throw new Error("keepAliveTimeoutMs must be greater than or equal to 60000 ("+o.keepAliveTimeout+" used).");return o}return s(i,e),i.prototype.isCustomDomain=function(e){return null===e.match(b)},i.prototype.request=function(e){var i,n=this,s=e.query,c=e.variables,d=e.getContext(),f=d.controlMessages,m=t.CONTROL_EVENTS_KEY,y=(void 0===f?(i={},i[t.CONTROL_EVENTS_KEY]=void 0,i):f)[m],v=d.headers;return new l.Observable(function(e){if(n.url){var t=p.v4(),i=n.auth.type===h.AUTH_TYPE.AMAZON_COGNITO_USER_POOLS||n.auth.type===h.AUTH_TYPE.OPENID_CONNECT?n.auth.jwtToken:null;i=n.auth.type===h.AUTH_TYPE.AWS_LAMBDA?n.auth.token:i;var l={appSyncGraphqlEndpoint:n.url,authenticationType:n.auth.type,query:u.print(s),region:n.region,graphql_headers:function(){return v},variables:c,apiKey:n.auth.type===h.AUTH_TYPE.API_KEY?n.auth.apiKey:"",credentials:n.auth.type===h.AUTH_TYPE.AWS_IAM?n.auth.credentials:null,token:i};return n._startSubscriptionWithAWSAppSyncRealTime({options:l,observer:e,subscriptionId:t}),function(){return o(n,void 0,void 0,function(){return a(this,function(e){try{if(this._verifySubscriptionAlreadyStarted(t),this.subscriptionObserverMap.get(t).subscriptionState!==g.SUBSCRIPTION_STATUS.CONNECTED)throw new Error("Subscription has failed, starting to remove subscription.");this._sendUnsubscriptionMessage(t)}catch(e){return this._removeSubscriptionObserver(t),[2]}return[2]})})}}e.error({errors:[r({},new u.GraphQLError("Subscribe only available for AWS AppSync endpoint"))]}),e.complete()}).filter(function(e){var t=e.extensions,i=(void 0===t?{}:t).controlMsgType;return!0===y||!(void 0!==(void 0===i?void 0:i))})},i.prototype._verifySubscriptionAlreadyStarted=function(e){return o(this,void 0,void 0,function(){var t=this;return a(this,function(i){return this.subscriptionObserverMap.get(e).subscriptionState===g.SUBSCRIPTION_STATUS.PENDING?[2,new Promise(function(i,n){var s=t.subscriptionObserverMap.get(e),r=s.observer,o=s.subscriptionState,a=s.variables,l=s.query;t.subscriptionObserverMap.set(e,{observer:r,subscriptionState:o,variables:a,query:l,subscriptionReadyCallback:i,subscriptionFailedCallback:n})})]:[2]})})},i.prototype._sendUnsubscriptionMessage=function(e){try{if(this.awsRealTimeSocket&&this.awsRealTimeSocket.readyState===WebSocket.OPEN&&this.socketStatus===g.SOCKET_STATUS.READY){var t={id:e,type:g.MESSAGE_TYPES.GQL_STOP},i=JSON.stringify(t);this.awsRealTimeSocket.send(i),this._removeSubscriptionObserver(e)}}catch(e){m({err:e})}},i.prototype._removeSubscriptionObserver=function(e){this.subscriptionObserverMap.delete(e),setTimeout(this._closeSocketIfRequired.bind(this),1e3)},i.prototype._closeSocketIfRequired=function(){this.subscriptionObserverMap.size>0||(this.awsRealTimeSocket?this.awsRealTimeSocket.bufferedAmount>0?setTimeout(this._closeSocketIfRequired.bind(this),1e3):(m("closing WebSocket..."),clearTimeout(this.keepAliveTimeoutId),this.awsRealTimeSocket.close(1e3),this.awsRealTimeSocket=null,this.socketStatus=g.SOCKET_STATUS.CLOSED):this.socketStatus=g.SOCKET_STATUS.CLOSED)},i.prototype._startSubscriptionWithAWSAppSyncRealTime=function(e){var t=e.options,i=e.observer,n=e.subscriptionId;return o(this,void 0,void 0,function(){var e,s,o,l,c,d,p,f,m,y,v,b,C,w,S,x,E,A,M,T,D,I,R,k,P,_=this;return a(this,function(a){switch(a.label){case 0:return e=t.appSyncGraphqlEndpoint,s=t.authenticationType,o=t.query,l=t.variables,c=t.apiKey,d=t.region,p=t.graphql_headers,f=void 0===p?function(){return{}}:p,m=t.credentials,y=t.token,v=g.SUBSCRIPTION_STATUS.PENDING,b={query:o,variables:l},this.subscriptionObserverMap.set(n,{observer:i,query:o,variables:l,subscriptionState:v,startAckTimeoutId:null}),C=JSON.stringify(b),S=[{}],[4,this._awsRealTimeHeaderBasedAuth({apiKey:c,appSyncGraphqlEndpoint:e,authenticationType:s,payload:C,canonicalUri:"",region:d,credentials:m,token:y,graphql_headers:f})];case 1:w=r.apply(void 0,[r.apply(void 0,S.concat([a.sent()])),(P={},P[h.USER_AGENT_HEADER]=h.USER_AGENT,P)]),x={id:n,payload:{data:C,extensions:{authorization:r({},w)}},type:g.MESSAGE_TYPES.GQL_START},E=JSON.stringify(x),a.label=2;case 2:return a.trys.push([2,4,,5]),[4,this._initializeWebSocketConnection({apiKey:c,appSyncGraphqlEndpoint:e,authenticationType:s,region:d,credentials:m,token:y})];case 3:return a.sent(),[3,5];case 4:return A=a.sent(),M=A.message,T=void 0===M?"":M,i.error({errors:[r({},new u.GraphQLError("Connection failed: "+T))]}),i.complete(),"function"==typeof(D=(this.subscriptionObserverMap.get(n)||{}).subscriptionFailedCallback)&&D(),[2];case 5:return I=this.subscriptionObserverMap.get(n)||{},R=I.subscriptionFailedCallback,k=I.subscriptionReadyCallback,this.subscriptionObserverMap.set(n,{observer:i,subscriptionState:v,variables:l,query:o,subscriptionReadyCallback:k,subscriptionFailedCallback:R,startAckTimeoutId:setTimeout(function(){_._timeoutStartSubscriptionAck.call(_,n)},15e3)}),this.awsRealTimeSocket&&this.awsRealTimeSocket.send(E),[2]}})})},i.prototype._initializeWebSocketConnection=function(e){var t=this,i=e.appSyncGraphqlEndpoint,n=e.authenticationType,s=e.apiKey,r=e.region,l=e.credentials,c=e.token;if(this.socketStatus!==g.SOCKET_STATUS.READY)return new Promise(function(e,h){return o(t,void 0,void 0,function(){var t,o,u,d,p,f,y,v,b;return a(this,function(a){switch(a.label){case 0:if(this.promiseArray.push({res:e,rej:h}),this.socketStatus!==g.SOCKET_STATUS.CLOSED)return[3,5];a.label=1;case 1:return a.trys.push([1,4,,5]),this.socketStatus=g.SOCKET_STATUS.CONNECTING,t="{}",d=(u=JSON).stringify,[4,this._awsRealTimeHeaderBasedAuth({authenticationType:n,payload:t,canonicalUri:"/connect",apiKey:s,appSyncGraphqlEndpoint:i,region:r,credentials:l,token:c,graphql_headers:function(){}})];case 2:return o=d.apply(u,[a.sent()]),p=Buffer.from(o).toString("base64"),f=Buffer.from(t).toString("base64"),y=i,y=(y=this.isCustomDomain(y)?y.concat("/realtime"):y.replace("appsync-api","appsync-realtime-api").replace("gogi-beta","grt-beta")).replace("https://","wss://").replace("http://","ws://"),v=y+"?header="+p+"&payload="+f,[4,this._initializeRetryableHandshake({awsRealTimeUrl:v})];case 3:return a.sent(),this.promiseArray.forEach(function(e){var t=e.res;m("Notifying connection successful"),t()}),this.socketStatus=g.SOCKET_STATUS.READY,this.promiseArray=[],[3,5];case 4:return b=a.sent(),this.promiseArray.forEach(function(e){return(0,e.rej)(b)}),this.promiseArray=[],this.awsRealTimeSocket&&this.awsRealTimeSocket.readyState===WebSocket.OPEN&&this.awsRealTimeSocket.close(3001),this.awsRealTimeSocket=null,this.socketStatus=g.SOCKET_STATUS.CLOSED,[3,5];case 5:return[2]}})})})},i.prototype._awsRealTimeHeaderBasedAuth=function(e){var t=e.authenticationType,i=e.payload,n=e.canonicalUri,s=e.appSyncGraphqlEndpoint,r=e.apiKey,l=e.region,c=e.credentials,h=e.token,u=e.graphql_headers;return o(this,void 0,void 0,function(){var e,o,p;return a(this,function(a){switch(a.label){case 0:return e={API_KEY:this._awsRealTimeApiKeyHeader.bind(this),AWS_IAM:this._awsRealTimeIAMHeader.bind(this),OPENID_CONNECT:this._awsRealTimeAuthorizationHeader.bind(this),AMAZON_COGNITO_USER_POOLS:this._awsRealTimeAuthorizationHeader.bind(this),AWS_LAMBDA:this._awsRealTimeAuthorizationHeader.bind(this)},"function"!=typeof(o=e[t])?(m("Authentication type "+t+" not supported"),[2,{}]):(p=d.parse(s).host,[4,o({payload:i,canonicalUri:n,appSyncGraphqlEndpoint:s,apiKey:r,region:l,host:p,credentials:c,token:h,graphql_headers:u})]);case 1:return[2,a.sent()]}})})},i.prototype._awsRealTimeAuthorizationHeader=function(e){var t=e.host,i=e.token,n=e.graphql_headers;return o(this,void 0,void 0,function(){var e,s,o;return a(this,function(a){switch(a.label){case 0:return e={},"function"!=typeof i?[3,2]:[4,i.call(void 0)];case 1:return s=a.sent(),[3,4];case 2:return[4,i];case 3:s=a.sent(),a.label=4;case 4:return o=[(e.Authorization=s,e.host=t,e)],[4,n()];case 5:return[2,r.apply(void 0,o.concat([a.sent()]))]}})})},i.prototype._awsRealTimeApiKeyHeader=function(e){var t=e.apiKey,i=e.host,n=e.graphql_headers;return o(this,void 0,void 0,function(){var e,s,o;return a(this,function(a){switch(a.label){case 0:return e=new Date,s=e.toISOString().replace(/[:\-]|\.\d{3}/g,""),o=[{host:i,"x-amz-date":s,"x-api-key":t}],[4,n()];case 1:return[2,r.apply(void 0,o.concat([a.sent()]))]}})})},i.prototype._awsRealTimeIAMHeader=function(e){var t=e.payload,i=e.canonicalUri,n=e.appSyncGraphqlEndpoint,s=e.region,l=e.credentials;return o(this,void 0,void 0,function(){var e,o,c,u,d,p,g,f;return a(this,function(a){switch(a.label){case 0:return e={region:s,service:"appsync"},(o="function"==typeof l?l.call():l||{})&&"function"==typeof o.getPromise?[4,o.getPromise()]:[3,2];case 1:a.sent(),a.label=2;case 2:if(!o)throw new Error("No credentials");return[4,o];case 3:return c=a.sent(),u=c.accessKeyId,d=c.secretAccessKey,p=c.sessionToken,g={access_key:u,secret_key:d,session_token:p},f={url:""+n+i,body:t,method:"POST",headers:r({},v)},[2,h.Signer.sign(f,g,e).headers]}})})},i.prototype._initializeRetryableHandshake=function(e){var t=e.awsRealTimeUrl;return o(this,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return m("Initializaling retryable Handshake"),[4,f.jitteredExponentialRetry(this._initializeHandshake.bind(this),[{awsRealTimeUrl:t}])];case 1:return e.sent(),[2]}})})},i.prototype._initializeHandshake=function(e){var t=e.awsRealTimeUrl;return o(this,void 0,void 0,function(){var e,n,s,r=this;return a(this,function(o){switch(o.label){case 0:m("Initializing handshake "+t),o.label=1;case 1:return o.trys.push([1,4,,5]),[4,new Promise(function(e,n){var s=i.createWebSocket(t,"graphql-ws");s.onerror=function(){m("WebSocket connection error")},s.onclose=function(){n(new Error("Connection handshake error"))},s.onopen=function(){return r.awsRealTimeSocket=s,e()}})];case 2:return o.sent(),[4,new Promise(function(e,t){var i=!1;r.awsRealTimeSocket.onerror=function(e){m("WebSocket closed "+JSON.stringify(e))},r.awsRealTimeSocket.onclose=function(e){m("WebSocket closed "+e.reason),t(new Error(JSON.stringify(e)))},r.awsRealTimeSocket.onmessage=function(n){var s;m("subscription message from AWS AppSyncRealTime: "+n.data+" ");var o=JSON.parse(n.data),a=o.type,l=o.payload,c=(void 0===l?{}:l).connectionTimeoutMs,h=void 0===c?3e5:c;if(a===g.MESSAGE_TYPES.GQL_CONNECTION_ACK)return i=!0,r.keepAliveTimeout=null!==(s=r.keepAliveTimeout)&&void 0!==s?s:h,r.awsRealTimeSocket.onmessage=r._handleIncomingSubscriptionMessage.bind(r),r.awsRealTimeSocket.onerror=function(e){m(e),r._errorDisconnect(g.CONTROL_MSG.CONNECTION_CLOSED)},r.awsRealTimeSocket.onclose=function(e){m("WebSocket closed "+e.reason),r._errorDisconnect(g.CONTROL_MSG.CONNECTION_CLOSED)},void e("Cool, connected to AWS AppSyncRealTime");if(a===g.MESSAGE_TYPES.GQL_CONNECTION_ERROR){var u=o.payload,d=(void 0===u?{}:u).errors,p=(void 0===d?[]:d)[0],f=void 0===p?{}:p,y=f.errorType,v=void 0===y?"":y,b=f.errorCode;t({errorType:v,errorCode:void 0===b?0:b})}};var n={type:g.MESSAGE_TYPES.GQL_CONNECTION_INIT};r.awsRealTimeSocket.send(JSON.stringify(n)),setTimeout(function(){i||t(new Error("Connection timeout: ack from AWSRealTime was not received on 15000 ms"))}.bind(r),15e3)})];case 3:return o.sent(),[3,5];case 4:throw e=o.sent(),n=e.errorType,s=e.errorCode,y.indexOf(s)>=0?new f.NonRetryableError(n):n?new Error(n):e;case 5:return[2]}})})},i.prototype._handleIncomingSubscriptionMessage=function(e){m("subscription message from AWS AppSync RealTime: "+e.data);var t=JSON.parse(e.data),i=t.id,n=void 0===i?"":i,s=t.payload,o=t.type,a=this.subscriptionObserverMap.get(n)||{},l=a.observer,c=void 0===l?null:l,h=a.query,d=void 0===h?"":h,p=a.variables,f=void 0===p?{}:p,y=a.startAckTimeoutId,v=void 0===y?0:y,b=a.subscriptionReadyCallback,C=void 0===b?null:b,w=a.subscriptionFailedCallback,S=void 0===w?null:w;if(m({id:n,observer:c,query:d,variables:f}),o===g.MESSAGE_TYPES.GQL_DATA&&s&&s.data)c?c.next(s):m("observer not found for id: "+n);else if(o!==g.MESSAGE_TYPES.GQL_START_ACK){if(o===g.MESSAGE_TYPES.GQL_CONNECTION_KEEP_ALIVE)return clearTimeout(this.keepAliveTimeoutId),void(this.keepAliveTimeoutId=setTimeout(this._errorDisconnect.bind(this,g.CONTROL_MSG.TIMEOUT_DISCONNECT),this.keepAliveTimeout));o===g.MESSAGE_TYPES.GQL_ERROR&&(x=g.SUBSCRIPTION_STATUS.FAILED,this.subscriptionObserverMap.set(n,{observer:c,query:d,variables:f,startAckTimeoutId:v,subscriptionReadyCallback:C,subscriptionFailedCallback:S,subscriptionState:x}),clearTimeout(v),c?(c.error({errors:[r({},new u.GraphQLError("Connection failed: "+JSON.stringify(s)))]}),c.complete()):m("observer not found for id: "+n),"function"==typeof S&&S())}else{m("subscription ready for "+JSON.stringify({query:d,variables:f})),"function"==typeof C&&C(),clearTimeout(v),c?c.next({data:s,extensions:{controlMsgType:"CONNECTED"}}):m("observer not found for id: "+n);var x=g.SUBSCRIPTION_STATUS.CONNECTED;this.subscriptionObserverMap.set(n,{observer:c,query:d,variables:f,startAckTimeoutId:null,subscriptionState:x,subscriptionReadyCallback:C,subscriptionFailedCallback:S})}},i.prototype._errorDisconnect=function(e){m("Disconnect error: "+e),this.subscriptionObserverMap.forEach(function(t){var i=t.observer;i&&!i.closed&&i.error({errors:[r({},new u.GraphQLError(e))]})}),this.subscriptionObserverMap.clear(),this.awsRealTimeSocket&&this.awsRealTimeSocket.close(),this.socketStatus=g.SOCKET_STATUS.CLOSED},i.prototype._timeoutStartSubscriptionAck=function(e){var t=this.subscriptionObserverMap.get(e)||{},i=t.observer,n=t.query,s=t.variables;i&&(this.subscriptionObserverMap.set(e,{observer:i,query:n,variables:s,subscriptionState:g.SUBSCRIPTION_STATUS.FAILED}),i&&!i.closed&&(i.error({errors:[r({},new u.GraphQLError("Subscription timeout "+JSON.stringify({query:n,variables:s})))]}),i.complete()),m("timeoutStartSubscription",JSON.stringify({query:n,variables:s})))},i.createWebSocket=function(e,t){return new WebSocket(e,t)},i}(l.ApolloLink);t.AppSyncRealTimeSubscriptionHandshakeLink=C},6349(e,t,i){"use strict";var n,s=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},n(e,t)},function(e,t){function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var s in t=arguments[i])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))(function(s,r){function o(e){try{l(n.next(e))}catch(e){r(e)}}function a(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){var i,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,n&&(s=2&r[0]?n.return:r[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,r[1])).done)return s;switch(n=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,n=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!((s=(s=o.trys).length>0&&s[s.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){o.label=r[1];break}if(6===r[0]&&o.label<s[1]){o.label=s[1],s=r;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(r);break}s[2]&&o.ops.pop(),o.trys.pop();continue}r=t.call(e,o)}catch(e){r=[6,e],n=0}finally{i=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}},l=this&&this.__rest||function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(i[n[s]]=e[n[s]])}return i};Object.defineProperty(t,"__esModule",{value:!0});var c=i(96746),h=i(21191),u=i(30839),d=i(18500),p=h.rootLogger.extend("subscriptions"),g=p.extend("mqtt");t.CONTROL_EVENTS_KEY="@@controlEvents";var f=function(e){function i(t){var i=e.call(this)||this;return i.topicObservers=new Map,i.clientObservers=new Map,i.onMessage=function(e,t,n){var s=JSON.parse(t),o=i.topicObservers.get(e),a=n.reduce(function(e,t){return e[t]=e[t]||null,e},s.data||{});p("Message received",{data:a,topic:e,observers:o}),o.forEach(function(e){try{e.next(r(r({},s),{data:a}))}catch(e){p(e)}})},i.subsInfoContextKey=t,i}return s(i,e),i.prototype.request=function(e){var i,n=this,s=e.getContext(),o=s[this.subsInfoContextKey],a=s.controlMessages,h=t.CONTROL_EVENTS_KEY,u=(void 0===a?(i={},i[t.CONTROL_EVENTS_KEY]=void 0,i):a)[h],d=o.extensions,p=(void 0===d?{subscription:{newSubscriptions:{},mqttConnections:[]}}:d).subscription,g=p.newSubscriptions,f=p.mqttConnections,m=o.errors,y=void 0===m?[]:m;if(y&&y.length)return new c.Observable(function(e){return e.error(new c.ApolloError({errorMessage:"Error during subscription handshake",extraInfo:{errors:y},graphQLErrors:y})),function(){}});var v=Object.keys(g).map(function(e){return g[e].topic}),b=new Set(v.filter(function(e){return n.topicObservers.has(e)})),C=new Set(v.filter(function(e){return!b.has(e)}));return new c.Observable(function(t){b.forEach(function(e){n.topicObservers.get(e).add(t);var i=Array.from(n.topicObservers.get(e)).find(function(){return!0}),s=Array.from(n.clientObservers).find(function(e){return e[1].observers.has(i)})[0];n.clientObservers.get(s).observers.add(t)});var i=f.filter(function(e){return e.topics.some(function(e){return C.has(e)})}).map(function(e){var t=e.topics,i=l(e,["topics"]);return r(r({},i),{topics:t.filter(function(e){return C.has(e)})})});return n.connectNewClients(i,t,e),function(){var e=Array.from(n.clientObservers).filter(function(e){return e[1].observers.has(t)});e.forEach(function(e){var i=e[0];return n.clientObservers.get(i).observers.delete(t)}),n.clientObservers.forEach(function(e){var t=e.observers,i=e.client;0===t.size&&(i.isConnected()&&i.disconnect(),n.clientObservers.delete(i.clientId))}),n.clientObservers=new Map(Array.from(n.clientObservers).filter(function(e){return e[1].observers.size>0})),n.topicObservers.forEach(function(e){return e.delete(t)}),n.topicObservers=new Map(Array.from(n.topicObservers).filter(function(e){return e[1].size>0}))}}).filter(function(e){var t=e.extensions,i=(void 0===t?{}:t).controlMsgType;return!0===u||!(void 0!==(void 0===i?void 0:i))})},i.prototype.connectNewClients=function(e,t,i){return o(this,void 0,void 0,function(){var n,s,r,o,l=this;return a(this,function(a){return n=i.query,s=d.getMainDefinition(n).selectionSet.selections.map(function(e){return e.name.value}),r=Promise.all(e.map(function(e){return l.connectNewClient(e,t,s)})),o=s.reduce(function(e,t){return e[t]=e[t]||null,e},{}),t.next({data:o,extensions:{controlMsgType:"CONNECTED",controlMsgInfo:{connectionInfo:e}}}),[2,r]})})},i.prototype.connectNewClient=function(e,t,i){return o(this,void 0,void 0,function(){var n,s,o,c,h=this;return a(this,function(a){switch(a.label){case 0:return n=e.client,s=e.url,o=e.topics,(c=new u.Client(s,n)).trace=g.bind(null,n),c.onConnectionLost=function(e){var t=e.errorCode,i=l(e,["errorCode"]);0!==t&&o.forEach(function(e){h.topicObservers.has(e)&&h.topicObservers.get(e).forEach(function(e){return e.error(r(r({},i),{permanent:!0}))})}),o.forEach(function(e){return h.topicObservers.delete(e)})},c.onMessageArrived=function(e){var t=e.destinationName,n=e.payloadString;return h.onMessage(t,n,i)},[4,new Promise(function(e,t){c.connect({useSSL:0===s.indexOf("wss://"),mqttVersion:3,onSuccess:function(){return e(c)},onFailure:t})})];case 1:return a.sent(),[4,this.subscribeToTopics(c,o,t)];case 2:return a.sent(),[2,c]}})})},i.prototype.subscribeToTopics=function(e,t,i){var n=this;return Promise.all(t.map(function(t){return n.subscribeToTopic(e,t,i)}))},i.prototype.subscribeToTopic=function(e,t,i){var n=this;return new Promise(function(s,r){e.subscribe(t,{onSuccess:function(){n.topicObservers.has(t)||n.topicObservers.set(t,new Set),n.clientObservers.has(e.clientId)||n.clientObservers.set(e.clientId,{client:e,observers:new Set}),n.topicObservers.get(t).add(i),n.clientObservers.get(e.clientId).observers.add(i),s(t)},onFailure:r})})},i}(c.ApolloLink);t.SubscriptionHandshakeLink=f},8339(e,t){"use strict";var i,n,s,r;Object.defineProperty(t,"__esModule",{value:!0}),(r=t.SUBSCRIPTION_STATUS||(t.SUBSCRIPTION_STATUS={}))[r.PENDING=0]="PENDING",r[r.CONNECTED=1]="CONNECTED",r[r.FAILED=2]="FAILED",(s=t.SOCKET_STATUS||(t.SOCKET_STATUS={}))[s.CLOSED=0]="CLOSED",s[s.READY=1]="READY",s[s.CONNECTING=2]="CONNECTING",(n=t.MESSAGE_TYPES||(t.MESSAGE_TYPES={})).GQL_CONNECTION_INIT="connection_init",n.GQL_CONNECTION_ERROR="connection_error",n.GQL_CONNECTION_ACK="connection_ack",n.GQL_START="start",n.GQL_START_ACK="start_ack",n.GQL_DATA="data",n.GQL_CONNECTION_KEEP_ALIVE="ka",n.GQL_STOP="stop",n.GQL_COMPLETE="complete",n.GQL_ERROR="error",(i=t.CONTROL_MSG||(t.CONTROL_MSG={})).CONNECTION_CLOSED="Connection closed",i.TIMEOUT_DISCONNECT="Timeout disconnect",i.SUBSCRIPTION_ACK="Subscription ack"},21191(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(48255);t.rootLogger=n.default},48255(e,t,i){"use strict";var n=this&&this.__spreadArrays||function(){for(var e=0,t=0,i=arguments.length;t<i;t++)e+=arguments[t].length;var n=Array(e),s=0;for(t=0;t<i;t++)for(var r=arguments[t],o=0,a=r.length;o<a;o++,s++)n[s]=r[o];return n};Object.defineProperty(t,"__esModule",{value:!0});var s=i(89028),r=s.default("aws-appsync"),o=function(e){void 0===e&&(e="");var t=e?n(this.namespace.split(":"),[e]).join(":"):this.namespace,i=s.default(t);return i.extend=o.bind(i),i};r.extend=o.bind(r),t.default=r},24873(e,t,i){"use strict";var n,s=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},n(e,t)},function(e,t){function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),r=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))(function(s,r){function o(e){try{l(n.next(e))}catch(e){r(e)}}function a(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var i,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,n&&(s=2&r[0]?n.return:r[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,r[1])).done)return s;switch(n=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,n=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!((s=(s=o.trys).length>0&&s[s.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){o.label=r[1];break}if(6===r[0]&&o.label<s[1]){o.label=s[1],s=r;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(r);break}s[2]&&o.ops.pop(),o.trys.pop();continue}r=t.call(e,o)}catch(e){r=[6,e],n=0}finally{i=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var a=i(21191).rootLogger.extend("retry"),l=function(e){function t(t){var i=e.call(this,t)||this;return i.nonRetryable=!0,i}return s(t,e),t}(Error);function c(e,t,i,n){return void 0===n&&(n=1),r(this,void 0,void 0,function(){var s,r;return o(this,function(o){switch(o.label){case 0:a("Attempt #"+n+" for this vars: "+JSON.stringify(t)),o.label=1;case 1:return o.trys.push([1,3,,8]),[4,e.apply(void 0,t)];case 2:return o.sent(),[3,8];case 3:if(s=o.sent(),a("error "+s),(l=s)&&l.nonRetryable)throw a("non retryable error"),s;return r=i(n,t,s),a("retryIn ",r),!1===r?[3,6]:[4,new Promise(function(e){return setTimeout(e,r)})];case 4:return o.sent(),[4,c(e,t,i,n+1)];case 5:return[2,o.sent()];case 6:throw s;case 7:return[3,8];case 8:return[2]}var l})})}t.NonRetryableError=l,t.retry=c,t.jitteredExponentialRetry=function(e,t,i){return void 0===i&&(i=5e3),c(e,t,function(e){return function(t){var i=100*Math.pow(2,t)+100*Math.random();return!(i>e)&&i}}(i))}},30839(e){var t;t=function(){var e=function(t){var i,n=t.localStorage||(i={},{setItem:function(e,t){i[e]=t},getItem:function(e){return i[e]},removeItem:function(e){delete i[e]}}),s=function(e,t){for(var i in e)if(e.hasOwnProperty(i)){if(!t.hasOwnProperty(i)){var n="Unknown property, "+i+". Valid properties are:";for(var s in t)t.hasOwnProperty(s)&&(n=n+" "+s);throw new Error(n)}if(typeof e[i]!==t[i])throw new Error(l(o.INVALID_TYPE,[typeof e[i],i]))}},r=function(e,t){return function(){return e.apply(t,arguments)}},o={OK:{code:0,text:"AMQJSC0000I OK."},CONNECT_TIMEOUT:{code:1,text:"AMQJSC0001E Connect timed out."},SUBSCRIBE_TIMEOUT:{code:2,text:"AMQJS0002E Subscribe timed out."},UNSUBSCRIBE_TIMEOUT:{code:3,text:"AMQJS0003E Unsubscribe timed out."},PING_TIMEOUT:{code:4,text:"AMQJS0004E Ping timed out."},INTERNAL_ERROR:{code:5,text:"AMQJS0005E Internal error. Error Message: {0}, Stack trace: {1}"},CONNACK_RETURNCODE:{code:6,text:"AMQJS0006E Bad Connack return code:{0} {1}."},SOCKET_ERROR:{code:7,text:"AMQJS0007E Socket error:{0}."},SOCKET_CLOSE:{code:8,text:"AMQJS0008I Socket closed."},MALFORMED_UTF:{code:9,text:"AMQJS0009E Malformed UTF data:{0} {1} {2}."},UNSUPPORTED:{code:10,text:"AMQJS0010E {0} is not supported by this browser."},INVALID_STATE:{code:11,text:"AMQJS0011E Invalid state {0}."},INVALID_TYPE:{code:12,text:"AMQJS0012E Invalid type {0} for {1}."},INVALID_ARGUMENT:{code:13,text:"AMQJS0013E Invalid argument {0} for {1}."},UNSUPPORTED_OPERATION:{code:14,text:"AMQJS0014E Unsupported operation."},INVALID_STORED_DATA:{code:15,text:"AMQJS0015E Invalid data in local storage key={0} value={1}."},INVALID_MQTT_MESSAGE_TYPE:{code:16,text:"AMQJS0016E Invalid MQTT message type {0}."},MALFORMED_UNICODE:{code:17,text:"AMQJS0017E Malformed Unicode string:{0} {1}."},BUFFER_FULL:{code:18,text:"AMQJS0018E Message buffer is full, maximum buffer size: {0}."}},a={0:"Connection Accepted",1:"Connection Refused: unacceptable protocol version",2:"Connection Refused: identifier rejected",3:"Connection Refused: server unavailable",4:"Connection Refused: bad user name or password",5:"Connection Refused: not authorized"},l=function(e,t){var i=e.text;if(t)for(var n,s,r=0;r<t.length;r++)if(n="{"+r+"}",(s=i.indexOf(n))>0){var o=i.substring(0,s),a=i.substring(s+n.length);i=o+t[r]+a}return i},c=[0,6,77,81,73,115,100,112,3],h=[0,4,77,81,84,84,4],u=function(e,t){for(var i in this.type=e,t)t.hasOwnProperty(i)&&(this[i]=t[i])};function d(t,i){var n,s=i,r=t[i],o=r>>4,a=r&=15;i+=1;var l=0,c=1;do{if(i==t.length)return[null,s];l+=(127&(n=t[i++]))*c,c*=128}while(128&n);var h=i+l;if(h>t.length)return[null,s];var d=new u(o);switch(o){case 2:1&t[i++]&&(d.sessionPresent=!0),d.returnCode=t[i++];break;case 3:var p=a>>1&3,g=f(t,i),m=v(t,i+=2,g);i+=g,p>0&&(d.messageIdentifier=f(t,i),i+=2);var y=new e.Message(t.subarray(i,h));1&~a||(y.retained=!0),8&~a||(y.duplicate=!0),y.qos=p,y.destinationName=m,d.payloadMessage=y;break;case 4:case 5:case 6:case 7:case 11:d.messageIdentifier=f(t,i);break;case 9:d.messageIdentifier=f(t,i),i+=2,d.returnCode=t.subarray(i,h)}return[d,h]}function p(e,t,i){return t[i++]=e>>8,t[i++]=e%256,i}function g(e,t,i,n){return y(e,i,n=p(t,i,n)),n+t}function f(e,t){return 256*e[t]+e[t+1]}function m(e){for(var t=0,i=0;i<e.length;i++){var n=e.charCodeAt(i);n>2047?(55296<=n&&n<=56319&&(i++,t++),t+=3):n>127?t+=2:t++}return t}function y(e,t,i){for(var n=i,s=0;s<e.length;s++){var r=e.charCodeAt(s);if(55296<=r&&r<=56319){var a=e.charCodeAt(++s);if(isNaN(a))throw new Error(l(o.MALFORMED_UNICODE,[r,a]));r=a-56320+(r-55296<<10)+65536}r<=127?t[n++]=r:r<=2047?(t[n++]=r>>6&31|192,t[n++]=63&r|128):r<=65535?(t[n++]=r>>12&15|224,t[n++]=r>>6&63|128,t[n++]=63&r|128):(t[n++]=r>>18&7|240,t[n++]=r>>12&63|128,t[n++]=r>>6&63|128,t[n++]=63&r|128)}return t}function v(e,t,i){for(var n,s="",r=t;r<t+i;){var a=e[r++];if(a<128)n=a;else{var c=e[r++]-128;if(c<0)throw new Error(l(o.MALFORMED_UTF,[a.toString(16),c.toString(16),""]));if(a<224)n=64*(a-192)+c;else{var h=e[r++]-128;if(h<0)throw new Error(l(o.MALFORMED_UTF,[a.toString(16),c.toString(16),h.toString(16)]));if(a<240)n=4096*(a-224)+64*c+h;else{var u=e[r++]-128;if(u<0)throw new Error(l(o.MALFORMED_UTF,[a.toString(16),c.toString(16),h.toString(16),u.toString(16)]));if(!(a<248))throw new Error(l(o.MALFORMED_UTF,[a.toString(16),c.toString(16),h.toString(16),u.toString(16)]));n=262144*(a-240)+4096*c+64*h+u}}}n>65535&&(n-=65536,s+=String.fromCharCode(55296+(n>>10)),n=56320+(1023&n)),s+=String.fromCharCode(n)}return s}u.prototype.encode=function(){var e,t=(15&this.type)<<4,i=0,n=[],s=0;switch(void 0!==this.messageIdentifier&&(i+=2),this.type){case 1:switch(this.mqttVersion){case 3:i+=c.length+3;break;case 4:i+=h.length+3}i+=m(this.clientId)+2,void 0!==this.willMessage&&(i+=m(this.willMessage.destinationName)+2,(e=this.willMessage.payloadBytes)instanceof Uint8Array||(e=new Uint8Array(o)),i+=e.byteLength+2),void 0!==this.userName&&(i+=m(this.userName)+2),void 0!==this.password&&(i+=m(this.password)+2);break;case 8:t|=2;for(var r=0;r<this.topics.length;r++)n[r]=m(this.topics[r]),i+=n[r]+2;i+=this.requestedQos.length;break;case 10:for(t|=2,r=0;r<this.topics.length;r++)n[r]=m(this.topics[r]),i+=n[r]+2;break;case 6:t|=2;break;case 3:this.payloadMessage.duplicate&&(t|=8),t=t|=this.payloadMessage.qos<<1,this.payloadMessage.retained&&(t|=1),i+=(s=m(this.payloadMessage.destinationName))+2;var o=this.payloadMessage.payloadBytes;i+=o.byteLength,o instanceof ArrayBuffer?o=new Uint8Array(o):o instanceof Uint8Array||(o=new Uint8Array(o.buffer))}var a=function(e){var t=new Array(1),i=0;do{var n=e%128;(e>>=7)>0&&(n|=128),t[i++]=n}while(e>0&&i<4);return t}(i),l=a.length+1,u=new ArrayBuffer(i+l),d=new Uint8Array(u);if(d[0]=t,d.set(a,1),3==this.type)l=g(this.payloadMessage.destinationName,s,d,l);else if(1==this.type){switch(this.mqttVersion){case 3:d.set(c,l),l+=c.length;break;case 4:d.set(h,l),l+=h.length}var f=0;this.cleanSession&&(f=2),void 0!==this.willMessage&&(f|=4,f|=this.willMessage.qos<<3,this.willMessage.retained&&(f|=32)),void 0!==this.userName&&(f|=128),void 0!==this.password&&(f|=64),d[l++]=f,l=p(this.keepAliveInterval,d,l)}switch(void 0!==this.messageIdentifier&&(l=p(this.messageIdentifier,d,l)),this.type){case 1:l=g(this.clientId,m(this.clientId),d,l),void 0!==this.willMessage&&(l=g(this.willMessage.destinationName,m(this.willMessage.destinationName),d,l),l=p(e.byteLength,d,l),d.set(e,l),l+=e.byteLength),void 0!==this.userName&&(l=g(this.userName,m(this.userName),d,l)),void 0!==this.password&&(l=g(this.password,m(this.password),d,l));break;case 3:d.set(o,l);break;case 8:for(r=0;r<this.topics.length;r++)l=g(this.topics[r],n[r],d,l),d[l++]=this.requestedQos[r];break;case 10:for(r=0;r<this.topics.length;r++)l=g(this.topics[r],n[r],d,l)}return u};var b=function(e,t){this._client=e,this._keepAliveInterval=1e3*t,this.isReset=!1;var i=new u(12).encode(),n=function(e){return function(){return s.apply(e)}},s=function(){this.isReset?(this.isReset=!1,this._client._trace("Pinger.doPing","send PINGREQ"),this._client.socket.send(i),this.timeout=setTimeout(n(this),this._keepAliveInterval)):(this._client._trace("Pinger.doPing","Timed out"),this._client._disconnected(o.PING_TIMEOUT.code,l(o.PING_TIMEOUT)))};this.reset=function(){this.isReset=!0,clearTimeout(this.timeout),this._keepAliveInterval>0&&(this.timeout=setTimeout(n(this),this._keepAliveInterval))},this.cancel=function(){clearTimeout(this.timeout)}},C=function(e,t,i,n){t||(t=30),this.timeout=setTimeout(function(e,t,i){return function(){return e.apply(t,i)}}(i,e,n),1e3*t),this.cancel=function(){clearTimeout(this.timeout)}},w=function(e,i,s,r,a){if(!("WebSocket"in t)||null===t.WebSocket)throw new Error(l(o.UNSUPPORTED,["WebSocket"]));if(!("ArrayBuffer"in t)||null===t.ArrayBuffer)throw new Error(l(o.UNSUPPORTED,["ArrayBuffer"]));for(var c in this._trace("Paho.Client",e,i,s,r,a),this.host=i,this.port=s,this.path=r,this.uri=e,this.clientId=a,this._wsuri=null,this._localKey=i+":"+s+("/mqtt"!=r?":"+r:"")+":"+a+":",this._msg_queue=[],this._buffered_msg_queue=[],this._sentMessages={},this._receivedMessages={},this._notify_msg_sent={},this._message_identifier=1,this._sequence=0,n)0!==c.indexOf("Sent:"+this._localKey)&&0!==c.indexOf("Received:"+this._localKey)||this.restore(c)};w.prototype.host=null,w.prototype.port=null,w.prototype.path=null,w.prototype.uri=null,w.prototype.clientId=null,w.prototype.socket=null,w.prototype.connected=!1,w.prototype.maxMessageIdentifier=65536,w.prototype.connectOptions=null,w.prototype.hostIndex=null,w.prototype.onConnected=null,w.prototype.onConnectionLost=null,w.prototype.onMessageDelivered=null,w.prototype.onMessageArrived=null,w.prototype.traceFunction=null,w.prototype._msg_queue=null,w.prototype._buffered_msg_queue=null,w.prototype._connectTimeout=null,w.prototype.sendPinger=null,w.prototype.receivePinger=null,w.prototype._reconnectInterval=1,w.prototype._reconnecting=!1,w.prototype._reconnectTimeout=null,w.prototype.disconnectedPublishing=!1,w.prototype.disconnectedBufferSize=5e3,w.prototype.receiveBuffer=null,w.prototype._traceBuffer=null,w.prototype._MAX_TRACE_ENTRIES=100,w.prototype.connect=function(e){var t=this._traceMask(e,"password");if(this._trace("Client.connect",t,this.socket,this.connected),this.connected)throw new Error(l(o.INVALID_STATE,["already connected"]));if(this.socket)throw new Error(l(o.INVALID_STATE,["already connected"]));this._reconnecting&&(this._reconnectTimeout.cancel(),this._reconnectTimeout=null,this._reconnecting=!1),this.connectOptions=e,this._reconnectInterval=1,this._reconnecting=!1,e.uris?(this.hostIndex=0,this._doConnect(e.uris[0])):this._doConnect(this.uri)},w.prototype.subscribe=function(e,t){if(this._trace("Client.subscribe",e,t),!this.connected)throw new Error(l(o.INVALID_STATE,["not connected"]));var i=new u(8);i.topics=[e],void 0!==t.qos?i.requestedQos=[t.qos]:i.requestedQos=[0],t.onSuccess&&(i.onSuccess=function(e){t.onSuccess({invocationContext:t.invocationContext,grantedQos:e})}),t.onFailure&&(i.onFailure=function(e){t.onFailure({invocationContext:t.invocationContext,errorCode:e,errorMessage:l(e)})}),t.timeout&&(i.timeOut=new C(this,t.timeout,t.onFailure,[{invocationContext:t.invocationContext,errorCode:o.SUBSCRIBE_TIMEOUT.code,errorMessage:l(o.SUBSCRIBE_TIMEOUT)}])),this._requires_ack(i),this._schedule_message(i)},w.prototype.unsubscribe=function(e,t){if(this._trace("Client.unsubscribe",e,t),!this.connected)throw new Error(l(o.INVALID_STATE,["not connected"]));var i=new u(10);i.topics=[e],t.onSuccess&&(i.callback=function(){t.onSuccess({invocationContext:t.invocationContext})}),t.timeout&&(i.timeOut=new C(this,t.timeout,t.onFailure,[{invocationContext:t.invocationContext,errorCode:o.UNSUBSCRIBE_TIMEOUT.code,errorMessage:l(o.UNSUBSCRIBE_TIMEOUT)}])),this._requires_ack(i),this._schedule_message(i)},w.prototype.send=function(e){this._trace("Client.send",e);var t=new u(3);if(t.payloadMessage=e,this.connected)e.qos>0?this._requires_ack(t):this.onMessageDelivered&&(this._notify_msg_sent[t]=this.onMessageDelivered(t.payloadMessage)),this._schedule_message(t);else{if(!this._reconnecting||!this.disconnectedPublishing)throw new Error(l(o.INVALID_STATE,["not connected"]));if(Object.keys(this._sentMessages).length+this._buffered_msg_queue.length>this.disconnectedBufferSize)throw new Error(l(o.BUFFER_FULL,[this.disconnectedBufferSize]));e.qos>0?this._requires_ack(t):(t.sequence=++this._sequence,this._buffered_msg_queue.unshift(t))}},w.prototype.disconnect=function(){if(this._trace("Client.disconnect"),this._reconnecting&&(this._reconnectTimeout.cancel(),this._reconnectTimeout=null,this._reconnecting=!1),!this.socket)throw new Error(l(o.INVALID_STATE,["not connecting or connected"]));var e=new u(14);this._notify_msg_sent[e]=r(this._disconnected,this),this._schedule_message(e)},w.prototype.getTraceLog=function(){if(null!==this._traceBuffer){for(var e in this._trace("Client.getTraceLog",new Date),this._trace("Client.getTraceLog in flight messages",this._sentMessages.length),this._sentMessages)this._trace("_sentMessages ",e,this._sentMessages[e]);for(var e in this._receivedMessages)this._trace("_receivedMessages ",e,this._receivedMessages[e]);return this._traceBuffer}},w.prototype.startTrace=function(){null===this._traceBuffer&&(this._traceBuffer=[]),this._trace("Client.startTrace",new Date,"@VERSION@-@BUILDLEVEL@")},w.prototype.stopTrace=function(){delete this._traceBuffer},w.prototype._doConnect=function(e){if(this.connectOptions.useSSL){var t=e.split(":");t[0]="wss",e=t.join(":")}this._wsuri=e,this.connected=!1,this.connectOptions.mqttVersion<4?this.socket=new WebSocket(e,["mqttv3.1"]):this.socket=new WebSocket(e,["mqtt"]),this.socket.binaryType="arraybuffer",this.socket.onopen=r(this._on_socket_open,this),this.socket.onmessage=r(this._on_socket_message,this),this.socket.onerror=r(this._on_socket_error,this),this.socket.onclose=r(this._on_socket_close,this),this.sendPinger=new b(this,this.connectOptions.keepAliveInterval),this.receivePinger=new b(this,this.connectOptions.keepAliveInterval),this._connectTimeout&&(this._connectTimeout.cancel(),this._connectTimeout=null),this._connectTimeout=new C(this,this.connectOptions.timeout,this._disconnected,[o.CONNECT_TIMEOUT.code,l(o.CONNECT_TIMEOUT)])},w.prototype._schedule_message=function(e){this._msg_queue.unshift(e),this.connected&&this._process_queue()},w.prototype.store=function(e,t){var i={type:t.type,messageIdentifier:t.messageIdentifier,version:1};if(3!==t.type)throw Error(l(o.INVALID_STORED_DATA,[e+this._localKey+t.messageIdentifier,i]));t.pubRecReceived&&(i.pubRecReceived=!0),i.payloadMessage={};for(var s="",r=t.payloadMessage.payloadBytes,a=0;a<r.length;a++)r[a]<=15?s=s+"0"+r[a].toString(16):s+=r[a].toString(16);i.payloadMessage.payloadHex=s,i.payloadMessage.qos=t.payloadMessage.qos,i.payloadMessage.destinationName=t.payloadMessage.destinationName,t.payloadMessage.duplicate&&(i.payloadMessage.duplicate=!0),t.payloadMessage.retained&&(i.payloadMessage.retained=!0),0===e.indexOf("Sent:")&&(void 0===t.sequence&&(t.sequence=++this._sequence),i.sequence=t.sequence),n.setItem(e+this._localKey+t.messageIdentifier,JSON.stringify(i))},w.prototype.restore=function(t){var i=n.getItem(t),s=JSON.parse(i),r=new u(s.type,s);if(3!==s.type)throw Error(l(o.INVALID_STORED_DATA,[t,i]));for(var a=s.payloadMessage.payloadHex,c=new ArrayBuffer(a.length/2),h=new Uint8Array(c),d=0;a.length>=2;){var p=parseInt(a.substring(0,2),16);a=a.substring(2,a.length),h[d++]=p}var g=new e.Message(h);g.qos=s.payloadMessage.qos,g.destinationName=s.payloadMessage.destinationName,s.payloadMessage.duplicate&&(g.duplicate=!0),s.payloadMessage.retained&&(g.retained=!0),r.payloadMessage=g,0===t.indexOf("Sent:"+this._localKey)?(r.payloadMessage.duplicate=!0,this._sentMessages[r.messageIdentifier]=r):0===t.indexOf("Received:"+this._localKey)&&(this._receivedMessages[r.messageIdentifier]=r)},w.prototype._process_queue=function(){for(var e=null;e=this._msg_queue.pop();)this._socket_send(e),this._notify_msg_sent[e]&&(this._notify_msg_sent[e](),delete this._notify_msg_sent[e])},w.prototype._requires_ack=function(e){var t=Object.keys(this._sentMessages).length;if(t>this.maxMessageIdentifier)throw Error("Too many messages:"+t);for(;void 0!==this._sentMessages[this._message_identifier];)this._message_identifier++;e.messageIdentifier=this._message_identifier,this._sentMessages[e.messageIdentifier]=e,3===e.type&&this.store("Sent:",e),this._message_identifier===this.maxMessageIdentifier&&(this._message_identifier=1)},w.prototype._on_socket_open=function(){var e=new u(1,this.connectOptions);e.clientId=this.clientId,this._socket_send(e)},w.prototype._on_socket_message=function(e){this._trace("Client._on_socket_message",e.data);for(var t=this._deframeMessages(e.data),i=0;i<t.length;i+=1)this._handleMessage(t[i])},w.prototype._deframeMessages=function(e){var t=new Uint8Array(e),i=[];if(this.receiveBuffer){var n=new Uint8Array(this.receiveBuffer.length+t.length);n.set(this.receiveBuffer),n.set(t,this.receiveBuffer.length),t=n,delete this.receiveBuffer}try{for(var s=0;s<t.length;){var r=d(t,s),a=r[0];if(s=r[1],null===a)break;i.push(a)}s<t.length&&(this.receiveBuffer=t.subarray(s))}catch(e){var c="undefined"==e.hasOwnProperty("stack")?e.stack.toString():"No Error Stack Available";return void this._disconnected(o.INTERNAL_ERROR.code,l(o.INTERNAL_ERROR,[e.message,c]))}return i},w.prototype._handleMessage=function(e){this._trace("Client._handleMessage",e);try{switch(e.type){case 2:if(this._connectTimeout.cancel(),this._reconnectTimeout&&this._reconnectTimeout.cancel(),this.connectOptions.cleanSession){for(var t in this._sentMessages){var i=this._sentMessages[t];n.removeItem("Sent:"+this._localKey+i.messageIdentifier)}for(var t in this._sentMessages={},this._receivedMessages){var s=this._receivedMessages[t];n.removeItem("Received:"+this._localKey+s.messageIdentifier)}this._receivedMessages={}}if(0!==e.returnCode){this._disconnected(o.CONNACK_RETURNCODE.code,l(o.CONNACK_RETURNCODE,[e.returnCode,a[e.returnCode]]));break}this.connected=!0,this.connectOptions.uris&&(this.hostIndex=this.connectOptions.uris.length);var r=[];for(var c in this._sentMessages)this._sentMessages.hasOwnProperty(c)&&r.push(this._sentMessages[c]);if(this._buffered_msg_queue.length>0)for(var h=null;h=this._buffered_msg_queue.pop();)r.push(h),this.onMessageDelivered&&(this._notify_msg_sent[h]=this.onMessageDelivered(h.payloadMessage));r=r.sort(function(e,t){return e.sequence-t.sequence});for(var d=0,p=r.length;d<p;d++)if(3==(i=r[d]).type&&i.pubRecReceived){var g=new u(6,{messageIdentifier:i.messageIdentifier});this._schedule_message(g)}else this._schedule_message(i);this.connectOptions.onSuccess&&this.connectOptions.onSuccess({invocationContext:this.connectOptions.invocationContext});var f=!1;this._reconnecting&&(f=!0,this._reconnectInterval=1,this._reconnecting=!1),this._connected(f,this._wsuri),this._process_queue();break;case 3:this._receivePublish(e);break;case 4:(i=this._sentMessages[e.messageIdentifier])&&(delete this._sentMessages[e.messageIdentifier],n.removeItem("Sent:"+this._localKey+e.messageIdentifier),this.onMessageDelivered&&this.onMessageDelivered(i.payloadMessage));break;case 5:(i=this._sentMessages[e.messageIdentifier])&&(i.pubRecReceived=!0,g=new u(6,{messageIdentifier:e.messageIdentifier}),this.store("Sent:",i),this._schedule_message(g));break;case 6:s=this._receivedMessages[e.messageIdentifier],n.removeItem("Received:"+this._localKey+e.messageIdentifier),s&&(this._receiveMessage(s),delete this._receivedMessages[e.messageIdentifier]);var m=new u(7,{messageIdentifier:e.messageIdentifier});this._schedule_message(m);break;case 7:i=this._sentMessages[e.messageIdentifier],delete this._sentMessages[e.messageIdentifier],n.removeItem("Sent:"+this._localKey+e.messageIdentifier),this.onMessageDelivered&&this.onMessageDelivered(i.payloadMessage);break;case 9:(i=this._sentMessages[e.messageIdentifier])&&(i.timeOut&&i.timeOut.cancel(),128===e.returnCode[0]?i.onFailure&&i.onFailure(e.returnCode):i.onSuccess&&i.onSuccess(e.returnCode),delete this._sentMessages[e.messageIdentifier]);break;case 11:(i=this._sentMessages[e.messageIdentifier])&&(i.timeOut&&i.timeOut.cancel(),i.callback&&i.callback(),delete this._sentMessages[e.messageIdentifier]);break;case 13:this.sendPinger.reset();break;default:this._disconnected(o.INVALID_MQTT_MESSAGE_TYPE.code,l(o.INVALID_MQTT_MESSAGE_TYPE,[e.type]))}}catch(e){var y="undefined"==e.hasOwnProperty("stack")?e.stack.toString():"No Error Stack Available";return void this._disconnected(o.INTERNAL_ERROR.code,l(o.INTERNAL_ERROR,[e.message,y]))}},w.prototype._on_socket_error=function(e){this._reconnecting||this._disconnected(o.SOCKET_ERROR.code,l(o.SOCKET_ERROR,[e.data]))},w.prototype._on_socket_close=function(){this._reconnecting||this._disconnected(o.SOCKET_CLOSE.code,l(o.SOCKET_CLOSE))},w.prototype._socket_send=function(e){if(1==e.type){var t=this._traceMask(e,"password");this._trace("Client._socket_send",t)}else this._trace("Client._socket_send",e);this.socket.send(e.encode()),this.sendPinger.reset()},w.prototype._receivePublish=function(e){switch(e.payloadMessage.qos){case"undefined":case 0:this._receiveMessage(e);break;case 1:var t=new u(4,{messageIdentifier:e.messageIdentifier});this._schedule_message(t),this._receiveMessage(e);break;case 2:this._receivedMessages[e.messageIdentifier]=e,this.store("Received:",e);var i=new u(5,{messageIdentifier:e.messageIdentifier});this._schedule_message(i);break;default:throw Error("Invaild qos="+e.payloadMessage.qos)}},w.prototype._receiveMessage=function(e){this.onMessageArrived&&this.onMessageArrived(e.payloadMessage)},w.prototype._connected=function(e,t){this.onConnected&&this.onConnected(e,t)},w.prototype._reconnect=function(){this._trace("Client._reconnect"),this.connected||(this._reconnecting=!0,this.sendPinger.cancel(),this.receivePinger.cancel(),this._reconnectInterval<128&&(this._reconnectInterval=2*this._reconnectInterval),this.connectOptions.uris?(this.hostIndex=0,this._doConnect(this.connectOptions.uris[0])):this._doConnect(this.uri))},w.prototype._disconnected=function(e,t){if(this._trace("Client._disconnected",e,t),void 0!==e&&this._reconnecting)this._reconnectTimeout=new C(this,this._reconnectInterval,this._reconnect);else if(this.sendPinger.cancel(),this.receivePinger.cancel(),this._connectTimeout&&(this._connectTimeout.cancel(),this._connectTimeout=null),this._msg_queue=[],this._buffered_msg_queue=[],this._notify_msg_sent={},this.socket&&(this.socket.onopen=null,this.socket.onmessage=null,this.socket.onerror=null,this.socket.onclose=null,1===this.socket.readyState&&this.socket.close(),delete this.socket),this.connectOptions.uris&&this.hostIndex<this.connectOptions.uris.length-1)this.hostIndex++,this._doConnect(this.connectOptions.uris[this.hostIndex]);else if(void 0===e&&(e=o.OK.code,t=l(o.OK)),this.connected){if(this.connected=!1,this.onConnectionLost&&this.onConnectionLost({errorCode:e,errorMessage:t,reconnect:this.connectOptions.reconnect,uri:this._wsuri}),e!==o.OK.code&&this.connectOptions.reconnect)return this._reconnectInterval=1,void this._reconnect()}else 4===this.connectOptions.mqttVersion&&!1===this.connectOptions.mqttVersionExplicit?(this._trace("Failed to connect V4, dropping back to V3"),this.connectOptions.mqttVersion=3,this.connectOptions.uris?(this.hostIndex=0,this._doConnect(this.connectOptions.uris[0])):this._doConnect(this.uri)):this.connectOptions.onFailure&&this.connectOptions.onFailure({invocationContext:this.connectOptions.invocationContext,errorCode:e,errorMessage:t})},w.prototype._trace=function(){if(this.traceFunction){var e=Array.prototype.slice.call(arguments);for(var t in e)void 0!==e[t]&&e.splice(t,1,JSON.stringify(e[t]));var i=e.join("");this.traceFunction({severity:"Debug",message:i})}if(null!==this._traceBuffer){t=0;for(var n=arguments.length;t<n;t++)this._traceBuffer.length==this._MAX_TRACE_ENTRIES&&this._traceBuffer.shift(),0===t||void 0===arguments[t]?this._traceBuffer.push(arguments[t]):this._traceBuffer.push("  "+JSON.stringify(arguments[t]))}},w.prototype._traceMask=function(e,t){var i={};for(var n in e)e.hasOwnProperty(n)&&(i[n]=n==t?"******":e[n]);return i};var S=function(e){var t,i;if(!("string"==typeof e||e instanceof ArrayBuffer||ArrayBuffer.isView(e)&&!(e instanceof DataView)))throw l(o.INVALID_ARGUMENT,[e,"newPayload"]);t=e;var n=0,s=!1,r=!1;Object.defineProperties(this,{payloadString:{enumerable:!0,get:function(){return"string"==typeof t?t:v(t,0,t.length)}},payloadBytes:{enumerable:!0,get:function(){if("string"==typeof t){var e=new ArrayBuffer(m(t)),i=new Uint8Array(e);return y(t,i,0),i}return t}},destinationName:{enumerable:!0,get:function(){return i},set:function(e){if("string"!=typeof e)throw new Error(l(o.INVALID_ARGUMENT,[e,"newDestinationName"]));i=e}},qos:{enumerable:!0,get:function(){return n},set:function(e){if(0!==e&&1!==e&&2!==e)throw new Error("Invalid argument:"+e);n=e}},retained:{enumerable:!0,get:function(){return s},set:function(e){if("boolean"!=typeof e)throw new Error(l(o.INVALID_ARGUMENT,[e,"newRetained"]));s=e}},topic:{enumerable:!0,get:function(){return i},set:function(e){i=e}},duplicate:{enumerable:!0,get:function(){return r},set:function(e){r=e}}})};return{Client:function(e,t,i,n){var r;if("string"!=typeof e)throw new Error(l(o.INVALID_TYPE,[typeof e,"host"]));if(2==arguments.length){n=t;var a=(r=e).match(/^(wss?):\/\/((\[(.+)\])|([^\/]+?))(:(\d+))?(\/.*)$/);if(!a)throw new Error(l(o.INVALID_ARGUMENT,[e,"host"]));e=a[4]||a[2],t=parseInt(a[7]),i=a[8]}else{if(3==arguments.length&&(n=i,i="/mqtt"),"number"!=typeof t||t<0)throw new Error(l(o.INVALID_TYPE,[typeof t,"port"]));if("string"!=typeof i)throw new Error(l(o.INVALID_TYPE,[typeof i,"path"]));var c=-1!==e.indexOf(":")&&"["!==e.slice(0,1)&&"]"!==e.slice(-1);r="ws://"+(c?"["+e+"]":e)+":"+t+i}for(var h=0,u=0;u<n.length;u++){var d=n.charCodeAt(u);55296<=d&&d<=56319&&u++,h++}if("string"!=typeof n||h>65535)throw new Error(l(o.INVALID_ARGUMENT,[n,"clientId"]));var p=new w(r,e,t,i,n);Object.defineProperties(this,{host:{get:function(){return e},set:function(){throw new Error(l(o.UNSUPPORTED_OPERATION))}},port:{get:function(){return t},set:function(){throw new Error(l(o.UNSUPPORTED_OPERATION))}},path:{get:function(){return i},set:function(){throw new Error(l(o.UNSUPPORTED_OPERATION))}},uri:{get:function(){return r},set:function(){throw new Error(l(o.UNSUPPORTED_OPERATION))}},clientId:{get:function(){return p.clientId},set:function(){throw new Error(l(o.UNSUPPORTED_OPERATION))}},onConnected:{get:function(){return p.onConnected},set:function(e){if("function"!=typeof e)throw new Error(l(o.INVALID_TYPE,[typeof e,"onConnected"]));p.onConnected=e}},disconnectedPublishing:{get:function(){return p.disconnectedPublishing},set:function(e){p.disconnectedPublishing=e}},disconnectedBufferSize:{get:function(){return p.disconnectedBufferSize},set:function(e){p.disconnectedBufferSize=e}},onConnectionLost:{get:function(){return p.onConnectionLost},set:function(e){if("function"!=typeof e)throw new Error(l(o.INVALID_TYPE,[typeof e,"onConnectionLost"]));p.onConnectionLost=e}},onMessageDelivered:{get:function(){return p.onMessageDelivered},set:function(e){if("function"!=typeof e)throw new Error(l(o.INVALID_TYPE,[typeof e,"onMessageDelivered"]));p.onMessageDelivered=e}},onMessageArrived:{get:function(){return p.onMessageArrived},set:function(e){if("function"!=typeof e)throw new Error(l(o.INVALID_TYPE,[typeof e,"onMessageArrived"]));p.onMessageArrived=e}},trace:{get:function(){return p.traceFunction},set:function(e){if("function"!=typeof e)throw new Error(l(o.INVALID_TYPE,[typeof e,"onTrace"]));p.traceFunction=e}}}),this.connect=function(e){if(s(e=e||{},{timeout:"number",userName:"string",password:"string",willMessage:"object",keepAliveInterval:"number",cleanSession:"boolean",useSSL:"boolean",invocationContext:"object",onSuccess:"function",onFailure:"function",hosts:"object",ports:"object",reconnect:"boolean",mqttVersion:"number",mqttVersionExplicit:"boolean",uris:"object"}),void 0===e.keepAliveInterval&&(e.keepAliveInterval=60),e.mqttVersion>4||e.mqttVersion<3)throw new Error(l(o.INVALID_ARGUMENT,[e.mqttVersion,"connectOptions.mqttVersion"]));if(void 0===e.mqttVersion?(e.mqttVersionExplicit=!1,e.mqttVersion=4):e.mqttVersionExplicit=!0,void 0!==e.password&&void 0===e.userName)throw new Error(l(o.INVALID_ARGUMENT,[e.password,"connectOptions.password"]));if(e.willMessage){if(!(e.willMessage instanceof S))throw new Error(l(o.INVALID_TYPE,[e.willMessage,"connectOptions.willMessage"]));if(e.willMessage.stringPayload=null,void 0===e.willMessage.destinationName)throw new Error(l(o.INVALID_TYPE,[typeof e.willMessage.destinationName,"connectOptions.willMessage.destinationName"]))}if(void 0===e.cleanSession&&(e.cleanSession=!0),e.hosts){if(!(e.hosts instanceof Array))throw new Error(l(o.INVALID_ARGUMENT,[e.hosts,"connectOptions.hosts"]));if(e.hosts.length<1)throw new Error(l(o.INVALID_ARGUMENT,[e.hosts,"connectOptions.hosts"]));for(var t=!1,n=0;n<e.hosts.length;n++){if("string"!=typeof e.hosts[n])throw new Error(l(o.INVALID_TYPE,[typeof e.hosts[n],"connectOptions.hosts["+n+"]"]));if(/^(wss?):\/\/((\[(.+)\])|([^\/]+?))(:(\d+))?(\/.*)$/.test(e.hosts[n])){if(0===n)t=!0;else if(!t)throw new Error(l(o.INVALID_ARGUMENT,[e.hosts[n],"connectOptions.hosts["+n+"]"]))}else if(t)throw new Error(l(o.INVALID_ARGUMENT,[e.hosts[n],"connectOptions.hosts["+n+"]"]))}if(t)e.uris=e.hosts;else{if(!e.ports)throw new Error(l(o.INVALID_ARGUMENT,[e.ports,"connectOptions.ports"]));if(!(e.ports instanceof Array))throw new Error(l(o.INVALID_ARGUMENT,[e.ports,"connectOptions.ports"]));if(e.hosts.length!==e.ports.length)throw new Error(l(o.INVALID_ARGUMENT,[e.ports,"connectOptions.ports"]));for(e.uris=[],n=0;n<e.hosts.length;n++){if("number"!=typeof e.ports[n]||e.ports[n]<0)throw new Error(l(o.INVALID_TYPE,[typeof e.ports[n],"connectOptions.ports["+n+"]"]));var a=e.hosts[n],c=e.ports[n],h=-1!==a.indexOf(":");r="ws://"+(h?"["+a+"]":a)+":"+c+i,e.uris.push(r)}}}p.connect(e)},this.subscribe=function(e,t){if("string"!=typeof e)throw new Error("Invalid argument:"+e);if(s(t=t||{},{qos:"number",invocationContext:"object",onSuccess:"function",onFailure:"function",timeout:"number"}),t.timeout&&!t.onFailure)throw new Error("subscribeOptions.timeout specified with no onFailure callback.");if(void 0!==t.qos&&0!==t.qos&&1!==t.qos&&2!==t.qos)throw new Error(l(o.INVALID_ARGUMENT,[t.qos,"subscribeOptions.qos"]));p.subscribe(e,t)},this.unsubscribe=function(e,t){if("string"!=typeof e)throw new Error("Invalid argument:"+e);if(s(t=t||{},{invocationContext:"object",onSuccess:"function",onFailure:"function",timeout:"number"}),t.timeout&&!t.onFailure)throw new Error("unsubscribeOptions.timeout specified with no onFailure callback.");p.unsubscribe(e,t)},this.send=function(e,t,i,n){var s;if(0===arguments.length)throw new Error("Invalid argument.length");if(1==arguments.length){if(!(e instanceof S)&&"string"!=typeof e)throw new Error("Invalid argument:"+typeof e);if(void 0===(s=e).destinationName)throw new Error(l(o.INVALID_ARGUMENT,[s.destinationName,"Message.destinationName"]));p.send(s)}else(s=new S(t)).destinationName=e,arguments.length>=3&&(s.qos=i),arguments.length>=4&&(s.retained=n),p.send(s)},this.publish=function(e,t,i,n){var s;if(0===arguments.length)throw new Error("Invalid argument.length");if(1==arguments.length){if(!(e instanceof S)&&"string"!=typeof e)throw new Error("Invalid argument:"+typeof e);if(void 0===(s=e).destinationName)throw new Error(l(o.INVALID_ARGUMENT,[s.destinationName,"Message.destinationName"]));p.send(s)}else(s=new S(t)).destinationName=e,arguments.length>=3&&(s.qos=i),arguments.length>=4&&(s.retained=n),p.send(s)},this.disconnect=function(){p.disconnect()},this.getTraceLog=function(){return p.getTraceLog()},this.startTrace=function(){p.startTrace()},this.stopTrace=function(){p.stopTrace()},this.isConnected=function(){return p.connected}},Message:S}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});return e},e.exports=t()},5611(e,t,i){e.exports={default:i(85877),__esModule:!0}},80238(e,t,i){e.exports={default:i(13112),__esModule:!0}},65191(e,t,i){e.exports={default:i(30481),__esModule:!0}},38841(e,t,i){e.exports={default:i(18307),__esModule:!0}},12581(e,t,i){e.exports={default:i(55111),__esModule:!0}},20144(e,t,i){e.exports={default:i(27773),__esModule:!0}},75697(e,t,i){e.exports={default:i(63315),__esModule:!0}},17380(e,t){"use strict";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},31354(e,t,i){"use strict";t.__esModule=!0;var n,s=(n=i(65191))&&n.__esModule?n:{default:n};t.default=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),(0,s.default)(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}()},84011(e,t,i){"use strict";t.__esModule=!0;var n,s=(n=i(5611))&&n.__esModule?n:{default:n};t.default=s.default||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e}},87724(e,t,i){"use strict";t.__esModule=!0;var n=o(i(12581)),s=o(i(80238)),r=o(i(38829));function o(e){return e&&e.__esModule?e:{default:e}}t.default=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":(0,r.default)(t)));e.prototype=(0,s.default)(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(n.default?(0,n.default)(e,t):e.__proto__=t)}},77857(e,t,i){"use strict";t.__esModule=!0;var n,s=(n=i(38829))&&n.__esModule?n:{default:n};t.default=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":(0,s.default)(t))&&"function"!=typeof t?e:t}},38829(e,t,i){"use strict";t.__esModule=!0;var n=o(i(75697)),s=o(i(20144)),r="function"==typeof s.default&&"symbol"==typeof n.default?function(e){return typeof e}:function(e){return e&&"function"==typeof s.default&&e.constructor===s.default&&e!==s.default.prototype?"symbol":typeof e};function o(e){return e&&e.__esModule?e:{default:e}}t.default="function"==typeof s.default&&"symbol"===r(n.default)?function(e){return void 0===e?"undefined":r(e)}:function(e){return e&&"function"==typeof s.default&&e.constructor===s.default&&e!==s.default.prototype?"symbol":void 0===e?"undefined":r(e)}},84933(e,t){"use strict";t.byteLength=function(e){var t=a(e),i=t[0],n=t[1];return 3*(i+n)/4-n},t.toByteArray=function(e){var t,i,r=a(e),o=r[0],l=r[1],c=new s(function(e,t,i){return 3*(t+i)/4-i}(0,o,l)),h=0,u=l>0?o-4:o;for(i=0;i<u;i+=4)t=n[e.charCodeAt(i)]<<18|n[e.charCodeAt(i+1)]<<12|n[e.charCodeAt(i+2)]<<6|n[e.charCodeAt(i+3)],c[h++]=t>>16&255,c[h++]=t>>8&255,c[h++]=255&t;return 2===l&&(t=n[e.charCodeAt(i)]<<2|n[e.charCodeAt(i+1)]>>4,c[h++]=255&t),1===l&&(t=n[e.charCodeAt(i)]<<10|n[e.charCodeAt(i+1)]<<4|n[e.charCodeAt(i+2)]>>2,c[h++]=t>>8&255,c[h++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,s=n%3,r=[],o=16383,a=0,l=n-s;a<l;a+=o)r.push(c(e,a,a+o>l?l:a+o));return 1===s?(t=e[n-1],r.push(i[t>>2]+i[t<<4&63]+"==")):2===s&&(t=(e[n-2]<<8)+e[n-1],r.push(i[t>>10]+i[t>>4&63]+i[t<<2&63]+"=")),r.join("")};for(var i=[],n=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)i[o]=r[o],n[r.charCodeAt(o)]=o;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=e.indexOf("=");return-1===i&&(i=t),[i,i===t?0:4-i%4]}function l(e){return i[e>>18&63]+i[e>>12&63]+i[e>>6&63]+i[63&e]}function c(e,t,i){for(var n,s=[],r=t;r<i;r+=3)n=(e[r]<<16&16711680)+(e[r+1]<<8&65280)+(255&e[r+2]),s.push(l(n));return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},5630(e,t,i){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function s(e,t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}function r(e,t,i){if(r.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(i=t,t=10),this._init(e||0,t||10,i||"be"))}var o;"object"==typeof e?e.exports=r:t.BN=r,r.BN=r,r.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:i(46216).Buffer}catch(e){}function a(e,t){var i=e.charCodeAt(t);return i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:i-48&15}function l(e,t,i){var n=a(e,i);return i-1>=t&&(n|=a(e,i-1)<<4),n}function c(e,t,i,n){for(var s=0,r=Math.min(e.length,i),o=t;o<r;o++){var a=e.charCodeAt(o)-48;s*=n,s+=a>=49?a-49+10:a>=17?a-17+10:a}return s}r.isBN=function(e){return e instanceof r||null!==e&&"object"==typeof e&&e.constructor.wordSize===r.wordSize&&Array.isArray(e.words)},r.max=function(e,t){return e.cmp(t)>0?e:t},r.min=function(e,t){return e.cmp(t)<0?e:t},r.prototype._init=function(e,t,i){if("number"==typeof e)return this._initNumber(e,t,i);if("object"==typeof e)return this._initArray(e,t,i);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var s=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(s++,this.negative=1),s<e.length&&(16===t?this._parseHex(e,s,i):(this._parseBase(e,t,s),"le"===i&&this._initArray(this.toArray(),t,i)))},r.prototype._initNumber=function(e,t,i){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),t,i)},r.prototype._initArray=function(e,t,i){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var s=0;s<this.length;s++)this.words[s]=0;var r,o,a=0;if("be"===i)for(s=e.length-1,r=0;s>=0;s-=3)o=e[s]|e[s-1]<<8|e[s-2]<<16,this.words[r]|=o<<a&67108863,this.words[r+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,r++);else if("le"===i)for(s=0,r=0;s<e.length;s+=3)o=e[s]|e[s+1]<<8|e[s+2]<<16,this.words[r]|=o<<a&67108863,this.words[r+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,r++);return this.strip()},r.prototype._parseHex=function(e,t,i){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var s,r=0,o=0;if("be"===i)for(n=e.length-1;n>=t;n-=2)s=l(e,t,n)<<r,this.words[o]|=67108863&s,r>=18?(r-=18,o+=1,this.words[o]|=s>>>26):r+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)s=l(e,t,n)<<r,this.words[o]|=67108863&s,r>=18?(r-=18,o+=1,this.words[o]|=s>>>26):r+=8;this.strip()},r.prototype._parseBase=function(e,t,i){this.words=[0],this.length=1;for(var n=0,s=1;s<=67108863;s*=t)n++;n--,s=s/t|0;for(var r=e.length-i,o=r%n,a=Math.min(r,r-o)+i,l=0,h=i;h<a;h+=n)l=c(e,h,h+n,t),this.imuln(s),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(0!==o){var u=1;for(l=c(e,h,e.length,t),h=0;h<o;h++)u*=t;this.imuln(u),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}this.strip()},r.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},r.prototype.clone=function(){var e=new r(null);return this.copy(e),e},r.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},r.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},r.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},r.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],u=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(e,t,i){i.negative=t.negative^e.negative;var n=e.length+t.length|0;i.length=n,n=n-1|0;var s=0|e.words[0],r=0|t.words[0],o=s*r,a=67108863&o,l=o/67108864|0;i.words[0]=a;for(var c=1;c<n;c++){for(var h=l>>>26,u=67108863&l,d=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=d;p++){var g=c-p|0;h+=(o=(s=0|e.words[g])*(r=0|t.words[p])+u)/67108864|0,u=67108863&o}i.words[c]=0|u,l=0|h}return 0!==l?i.words[c]=0|l:i.length--,i.strip()}r.prototype.toString=function(e,t){var i;if(t=0|t||1,16===(e=e||10)||"hex"===e){i="";for(var s=0,r=0,o=0;o<this.length;o++){var a=this.words[o],l=(16777215&(a<<s|r)).toString(16);r=a>>>24-s&16777215,(s+=2)>=26&&(s-=26,o--),i=0!==r||o!==this.length-1?h[6-l.length]+l+i:l+i}for(0!==r&&(i=r.toString(16)+i);i.length%t!==0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(e===(0|e)&&e>=2&&e<=36){var c=u[e],p=d[e];i="";var g=this.clone();for(g.negative=0;!g.isZero();){var f=g.modn(p).toString(e);i=(g=g.idivn(p)).isZero()?f+i:h[c-f.length]+f+i}for(this.isZero()&&(i="0"+i);i.length%t!==0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}n(!1,"Base should be between 2 and 36")},r.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},r.prototype.toJSON=function(){return this.toString(16)},r.prototype.toBuffer=function(e,t){return n(void 0!==o),this.toArrayLike(o,e,t)},r.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},r.prototype.toArrayLike=function(e,t,i){var s=this.byteLength(),r=i||Math.max(1,s);n(s<=r,"byte array longer than desired length"),n(r>0,"Requested array length <= 0"),this.strip();var o,a,l="le"===t,c=new e(r),h=this.clone();if(l){for(a=0;!h.isZero();a++)o=h.andln(255),h.iushrn(8),c[a]=o;for(;a<r;a++)c[a]=0}else{for(a=0;a<r-s;a++)c[a]=0;for(a=0;!h.isZero();a++)o=h.andln(255),h.iushrn(8),c[r-a-1]=o}return c},Math.clz32?r.prototype._countBits=function(e){return 32-Math.clz32(e)}:r.prototype._countBits=function(e){var t=e,i=0;return t>=4096&&(i+=13,t>>>=13),t>=64&&(i+=7,t>>>=7),t>=8&&(i+=4,t>>>=4),t>=2&&(i+=2,t>>>=2),i+t},r.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,i=0;return 8191&t||(i+=13,t>>>=13),127&t||(i+=7,t>>>=7),15&t||(i+=4,t>>>=4),3&t||(i+=2,t>>>=2),1&t||i++,i},r.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},r.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var i=this._zeroBits(this.words[t]);if(e+=i,26!==i)break}return e},r.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},r.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},r.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},r.prototype.isNeg=function(){return 0!==this.negative},r.prototype.neg=function(){return this.clone().ineg()},r.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},r.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},r.prototype.ior=function(e){return n(0===(this.negative|e.negative)),this.iuor(e)},r.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},r.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},r.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var i=0;i<t.length;i++)this.words[i]=this.words[i]&e.words[i];return this.length=t.length,this.strip()},r.prototype.iand=function(e){return n(0===(this.negative|e.negative)),this.iuand(e)},r.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},r.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},r.prototype.iuxor=function(e){var t,i;this.length>e.length?(t=this,i=e):(t=e,i=this);for(var n=0;n<i.length;n++)this.words[n]=t.words[n]^i.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},r.prototype.ixor=function(e){return n(0===(this.negative|e.negative)),this.iuxor(e)},r.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},r.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},r.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),i=e%26;this._expand(t),i>0&&t--;for(var s=0;s<t;s++)this.words[s]=67108863&~this.words[s];return i>0&&(this.words[s]=~this.words[s]&67108863>>26-i),this.strip()},r.prototype.notn=function(e){return this.clone().inotn(e)},r.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var i=e/26|0,s=e%26;return this._expand(i+1),this.words[i]=t?this.words[i]|1<<s:this.words[i]&~(1<<s),this.strip()},r.prototype.iadd=function(e){var t,i,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(i=this,n=e):(i=e,n=this);for(var s=0,r=0;r<n.length;r++)t=(0|i.words[r])+(0|n.words[r])+s,this.words[r]=67108863&t,s=t>>>26;for(;0!==s&&r<i.length;r++)t=(0|i.words[r])+s,this.words[r]=67108863&t,s=t>>>26;if(this.length=i.length,0!==s)this.words[this.length]=s,this.length++;else if(i!==this)for(;r<i.length;r++)this.words[r]=i.words[r];return this},r.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},r.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var i,n,s=this.cmp(e);if(0===s)return this.negative=0,this.length=1,this.words[0]=0,this;s>0?(i=this,n=e):(i=e,n=this);for(var r=0,o=0;o<n.length;o++)r=(t=(0|i.words[o])-(0|n.words[o])+r)>>26,this.words[o]=67108863&t;for(;0!==r&&o<i.length;o++)r=(t=(0|i.words[o])+r)>>26,this.words[o]=67108863&t;if(0===r&&o<i.length&&i!==this)for(;o<i.length;o++)this.words[o]=i.words[o];return this.length=Math.max(this.length,o),i!==this&&(this.negative=1),this.strip()},r.prototype.sub=function(e){return this.clone().isub(e)};var g=function(e,t,i){var n,s,r,o=e.words,a=t.words,l=i.words,c=0,h=0|o[0],u=8191&h,d=h>>>13,p=0|o[1],g=8191&p,f=p>>>13,m=0|o[2],y=8191&m,v=m>>>13,b=0|o[3],C=8191&b,w=b>>>13,S=0|o[4],x=8191&S,E=S>>>13,A=0|o[5],M=8191&A,T=A>>>13,D=0|o[6],I=8191&D,R=D>>>13,k=0|o[7],P=8191&k,_=k>>>13,L=0|o[8],N=8191&L,O=L>>>13,F=0|o[9],G=8191&F,B=F>>>13,V=0|a[0],H=8191&V,U=V>>>13,z=0|a[1],W=8191&z,j=z>>>13,$=0|a[2],K=8191&$,Y=$>>>13,q=0|a[3],X=8191&q,Z=q>>>13,Q=0|a[4],J=8191&Q,ee=Q>>>13,te=0|a[5],ie=8191&te,ne=te>>>13,se=0|a[6],re=8191&se,oe=se>>>13,ae=0|a[7],le=8191&ae,ce=ae>>>13,he=0|a[8],ue=8191&he,de=he>>>13,pe=0|a[9],ge=8191&pe,fe=pe>>>13;i.negative=e.negative^t.negative,i.length=19;var me=(c+(n=Math.imul(u,H))|0)+((8191&(s=(s=Math.imul(u,U))+Math.imul(d,H)|0))<<13)|0;c=((r=Math.imul(d,U))+(s>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(g,H),s=(s=Math.imul(g,U))+Math.imul(f,H)|0,r=Math.imul(f,U);var ye=(c+(n=n+Math.imul(u,W)|0)|0)+((8191&(s=(s=s+Math.imul(u,j)|0)+Math.imul(d,W)|0))<<13)|0;c=((r=r+Math.imul(d,j)|0)+(s>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,H),s=(s=Math.imul(y,U))+Math.imul(v,H)|0,r=Math.imul(v,U),n=n+Math.imul(g,W)|0,s=(s=s+Math.imul(g,j)|0)+Math.imul(f,W)|0,r=r+Math.imul(f,j)|0;var ve=(c+(n=n+Math.imul(u,K)|0)|0)+((8191&(s=(s=s+Math.imul(u,Y)|0)+Math.imul(d,K)|0))<<13)|0;c=((r=r+Math.imul(d,Y)|0)+(s>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(C,H),s=(s=Math.imul(C,U))+Math.imul(w,H)|0,r=Math.imul(w,U),n=n+Math.imul(y,W)|0,s=(s=s+Math.imul(y,j)|0)+Math.imul(v,W)|0,r=r+Math.imul(v,j)|0,n=n+Math.imul(g,K)|0,s=(s=s+Math.imul(g,Y)|0)+Math.imul(f,K)|0,r=r+Math.imul(f,Y)|0;var be=(c+(n=n+Math.imul(u,X)|0)|0)+((8191&(s=(s=s+Math.imul(u,Z)|0)+Math.imul(d,X)|0))<<13)|0;c=((r=r+Math.imul(d,Z)|0)+(s>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(x,H),s=(s=Math.imul(x,U))+Math.imul(E,H)|0,r=Math.imul(E,U),n=n+Math.imul(C,W)|0,s=(s=s+Math.imul(C,j)|0)+Math.imul(w,W)|0,r=r+Math.imul(w,j)|0,n=n+Math.imul(y,K)|0,s=(s=s+Math.imul(y,Y)|0)+Math.imul(v,K)|0,r=r+Math.imul(v,Y)|0,n=n+Math.imul(g,X)|0,s=(s=s+Math.imul(g,Z)|0)+Math.imul(f,X)|0,r=r+Math.imul(f,Z)|0;var Ce=(c+(n=n+Math.imul(u,J)|0)|0)+((8191&(s=(s=s+Math.imul(u,ee)|0)+Math.imul(d,J)|0))<<13)|0;c=((r=r+Math.imul(d,ee)|0)+(s>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(M,H),s=(s=Math.imul(M,U))+Math.imul(T,H)|0,r=Math.imul(T,U),n=n+Math.imul(x,W)|0,s=(s=s+Math.imul(x,j)|0)+Math.imul(E,W)|0,r=r+Math.imul(E,j)|0,n=n+Math.imul(C,K)|0,s=(s=s+Math.imul(C,Y)|0)+Math.imul(w,K)|0,r=r+Math.imul(w,Y)|0,n=n+Math.imul(y,X)|0,s=(s=s+Math.imul(y,Z)|0)+Math.imul(v,X)|0,r=r+Math.imul(v,Z)|0,n=n+Math.imul(g,J)|0,s=(s=s+Math.imul(g,ee)|0)+Math.imul(f,J)|0,r=r+Math.imul(f,ee)|0;var we=(c+(n=n+Math.imul(u,ie)|0)|0)+((8191&(s=(s=s+Math.imul(u,ne)|0)+Math.imul(d,ie)|0))<<13)|0;c=((r=r+Math.imul(d,ne)|0)+(s>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(I,H),s=(s=Math.imul(I,U))+Math.imul(R,H)|0,r=Math.imul(R,U),n=n+Math.imul(M,W)|0,s=(s=s+Math.imul(M,j)|0)+Math.imul(T,W)|0,r=r+Math.imul(T,j)|0,n=n+Math.imul(x,K)|0,s=(s=s+Math.imul(x,Y)|0)+Math.imul(E,K)|0,r=r+Math.imul(E,Y)|0,n=n+Math.imul(C,X)|0,s=(s=s+Math.imul(C,Z)|0)+Math.imul(w,X)|0,r=r+Math.imul(w,Z)|0,n=n+Math.imul(y,J)|0,s=(s=s+Math.imul(y,ee)|0)+Math.imul(v,J)|0,r=r+Math.imul(v,ee)|0,n=n+Math.imul(g,ie)|0,s=(s=s+Math.imul(g,ne)|0)+Math.imul(f,ie)|0,r=r+Math.imul(f,ne)|0;var Se=(c+(n=n+Math.imul(u,re)|0)|0)+((8191&(s=(s=s+Math.imul(u,oe)|0)+Math.imul(d,re)|0))<<13)|0;c=((r=r+Math.imul(d,oe)|0)+(s>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(P,H),s=(s=Math.imul(P,U))+Math.imul(_,H)|0,r=Math.imul(_,U),n=n+Math.imul(I,W)|0,s=(s=s+Math.imul(I,j)|0)+Math.imul(R,W)|0,r=r+Math.imul(R,j)|0,n=n+Math.imul(M,K)|0,s=(s=s+Math.imul(M,Y)|0)+Math.imul(T,K)|0,r=r+Math.imul(T,Y)|0,n=n+Math.imul(x,X)|0,s=(s=s+Math.imul(x,Z)|0)+Math.imul(E,X)|0,r=r+Math.imul(E,Z)|0,n=n+Math.imul(C,J)|0,s=(s=s+Math.imul(C,ee)|0)+Math.imul(w,J)|0,r=r+Math.imul(w,ee)|0,n=n+Math.imul(y,ie)|0,s=(s=s+Math.imul(y,ne)|0)+Math.imul(v,ie)|0,r=r+Math.imul(v,ne)|0,n=n+Math.imul(g,re)|0,s=(s=s+Math.imul(g,oe)|0)+Math.imul(f,re)|0,r=r+Math.imul(f,oe)|0;var xe=(c+(n=n+Math.imul(u,le)|0)|0)+((8191&(s=(s=s+Math.imul(u,ce)|0)+Math.imul(d,le)|0))<<13)|0;c=((r=r+Math.imul(d,ce)|0)+(s>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(N,H),s=(s=Math.imul(N,U))+Math.imul(O,H)|0,r=Math.imul(O,U),n=n+Math.imul(P,W)|0,s=(s=s+Math.imul(P,j)|0)+Math.imul(_,W)|0,r=r+Math.imul(_,j)|0,n=n+Math.imul(I,K)|0,s=(s=s+Math.imul(I,Y)|0)+Math.imul(R,K)|0,r=r+Math.imul(R,Y)|0,n=n+Math.imul(M,X)|0,s=(s=s+Math.imul(M,Z)|0)+Math.imul(T,X)|0,r=r+Math.imul(T,Z)|0,n=n+Math.imul(x,J)|0,s=(s=s+Math.imul(x,ee)|0)+Math.imul(E,J)|0,r=r+Math.imul(E,ee)|0,n=n+Math.imul(C,ie)|0,s=(s=s+Math.imul(C,ne)|0)+Math.imul(w,ie)|0,r=r+Math.imul(w,ne)|0,n=n+Math.imul(y,re)|0,s=(s=s+Math.imul(y,oe)|0)+Math.imul(v,re)|0,r=r+Math.imul(v,oe)|0,n=n+Math.imul(g,le)|0,s=(s=s+Math.imul(g,ce)|0)+Math.imul(f,le)|0,r=r+Math.imul(f,ce)|0;var Ee=(c+(n=n+Math.imul(u,ue)|0)|0)+((8191&(s=(s=s+Math.imul(u,de)|0)+Math.imul(d,ue)|0))<<13)|0;c=((r=r+Math.imul(d,de)|0)+(s>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(G,H),s=(s=Math.imul(G,U))+Math.imul(B,H)|0,r=Math.imul(B,U),n=n+Math.imul(N,W)|0,s=(s=s+Math.imul(N,j)|0)+Math.imul(O,W)|0,r=r+Math.imul(O,j)|0,n=n+Math.imul(P,K)|0,s=(s=s+Math.imul(P,Y)|0)+Math.imul(_,K)|0,r=r+Math.imul(_,Y)|0,n=n+Math.imul(I,X)|0,s=(s=s+Math.imul(I,Z)|0)+Math.imul(R,X)|0,r=r+Math.imul(R,Z)|0,n=n+Math.imul(M,J)|0,s=(s=s+Math.imul(M,ee)|0)+Math.imul(T,J)|0,r=r+Math.imul(T,ee)|0,n=n+Math.imul(x,ie)|0,s=(s=s+Math.imul(x,ne)|0)+Math.imul(E,ie)|0,r=r+Math.imul(E,ne)|0,n=n+Math.imul(C,re)|0,s=(s=s+Math.imul(C,oe)|0)+Math.imul(w,re)|0,r=r+Math.imul(w,oe)|0,n=n+Math.imul(y,le)|0,s=(s=s+Math.imul(y,ce)|0)+Math.imul(v,le)|0,r=r+Math.imul(v,ce)|0,n=n+Math.imul(g,ue)|0,s=(s=s+Math.imul(g,de)|0)+Math.imul(f,ue)|0,r=r+Math.imul(f,de)|0;var Ae=(c+(n=n+Math.imul(u,ge)|0)|0)+((8191&(s=(s=s+Math.imul(u,fe)|0)+Math.imul(d,ge)|0))<<13)|0;c=((r=r+Math.imul(d,fe)|0)+(s>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(G,W),s=(s=Math.imul(G,j))+Math.imul(B,W)|0,r=Math.imul(B,j),n=n+Math.imul(N,K)|0,s=(s=s+Math.imul(N,Y)|0)+Math.imul(O,K)|0,r=r+Math.imul(O,Y)|0,n=n+Math.imul(P,X)|0,s=(s=s+Math.imul(P,Z)|0)+Math.imul(_,X)|0,r=r+Math.imul(_,Z)|0,n=n+Math.imul(I,J)|0,s=(s=s+Math.imul(I,ee)|0)+Math.imul(R,J)|0,r=r+Math.imul(R,ee)|0,n=n+Math.imul(M,ie)|0,s=(s=s+Math.imul(M,ne)|0)+Math.imul(T,ie)|0,r=r+Math.imul(T,ne)|0,n=n+Math.imul(x,re)|0,s=(s=s+Math.imul(x,oe)|0)+Math.imul(E,re)|0,r=r+Math.imul(E,oe)|0,n=n+Math.imul(C,le)|0,s=(s=s+Math.imul(C,ce)|0)+Math.imul(w,le)|0,r=r+Math.imul(w,ce)|0,n=n+Math.imul(y,ue)|0,s=(s=s+Math.imul(y,de)|0)+Math.imul(v,ue)|0,r=r+Math.imul(v,de)|0;var Me=(c+(n=n+Math.imul(g,ge)|0)|0)+((8191&(s=(s=s+Math.imul(g,fe)|0)+Math.imul(f,ge)|0))<<13)|0;c=((r=r+Math.imul(f,fe)|0)+(s>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(G,K),s=(s=Math.imul(G,Y))+Math.imul(B,K)|0,r=Math.imul(B,Y),n=n+Math.imul(N,X)|0,s=(s=s+Math.imul(N,Z)|0)+Math.imul(O,X)|0,r=r+Math.imul(O,Z)|0,n=n+Math.imul(P,J)|0,s=(s=s+Math.imul(P,ee)|0)+Math.imul(_,J)|0,r=r+Math.imul(_,ee)|0,n=n+Math.imul(I,ie)|0,s=(s=s+Math.imul(I,ne)|0)+Math.imul(R,ie)|0,r=r+Math.imul(R,ne)|0,n=n+Math.imul(M,re)|0,s=(s=s+Math.imul(M,oe)|0)+Math.imul(T,re)|0,r=r+Math.imul(T,oe)|0,n=n+Math.imul(x,le)|0,s=(s=s+Math.imul(x,ce)|0)+Math.imul(E,le)|0,r=r+Math.imul(E,ce)|0,n=n+Math.imul(C,ue)|0,s=(s=s+Math.imul(C,de)|0)+Math.imul(w,ue)|0,r=r+Math.imul(w,de)|0;var Te=(c+(n=n+Math.imul(y,ge)|0)|0)+((8191&(s=(s=s+Math.imul(y,fe)|0)+Math.imul(v,ge)|0))<<13)|0;c=((r=r+Math.imul(v,fe)|0)+(s>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(G,X),s=(s=Math.imul(G,Z))+Math.imul(B,X)|0,r=Math.imul(B,Z),n=n+Math.imul(N,J)|0,s=(s=s+Math.imul(N,ee)|0)+Math.imul(O,J)|0,r=r+Math.imul(O,ee)|0,n=n+Math.imul(P,ie)|0,s=(s=s+Math.imul(P,ne)|0)+Math.imul(_,ie)|0,r=r+Math.imul(_,ne)|0,n=n+Math.imul(I,re)|0,s=(s=s+Math.imul(I,oe)|0)+Math.imul(R,re)|0,r=r+Math.imul(R,oe)|0,n=n+Math.imul(M,le)|0,s=(s=s+Math.imul(M,ce)|0)+Math.imul(T,le)|0,r=r+Math.imul(T,ce)|0,n=n+Math.imul(x,ue)|0,s=(s=s+Math.imul(x,de)|0)+Math.imul(E,ue)|0,r=r+Math.imul(E,de)|0;var De=(c+(n=n+Math.imul(C,ge)|0)|0)+((8191&(s=(s=s+Math.imul(C,fe)|0)+Math.imul(w,ge)|0))<<13)|0;c=((r=r+Math.imul(w,fe)|0)+(s>>>13)|0)+(De>>>26)|0,De&=67108863,n=Math.imul(G,J),s=(s=Math.imul(G,ee))+Math.imul(B,J)|0,r=Math.imul(B,ee),n=n+Math.imul(N,ie)|0,s=(s=s+Math.imul(N,ne)|0)+Math.imul(O,ie)|0,r=r+Math.imul(O,ne)|0,n=n+Math.imul(P,re)|0,s=(s=s+Math.imul(P,oe)|0)+Math.imul(_,re)|0,r=r+Math.imul(_,oe)|0,n=n+Math.imul(I,le)|0,s=(s=s+Math.imul(I,ce)|0)+Math.imul(R,le)|0,r=r+Math.imul(R,ce)|0,n=n+Math.imul(M,ue)|0,s=(s=s+Math.imul(M,de)|0)+Math.imul(T,ue)|0,r=r+Math.imul(T,de)|0;var Ie=(c+(n=n+Math.imul(x,ge)|0)|0)+((8191&(s=(s=s+Math.imul(x,fe)|0)+Math.imul(E,ge)|0))<<13)|0;c=((r=r+Math.imul(E,fe)|0)+(s>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(G,ie),s=(s=Math.imul(G,ne))+Math.imul(B,ie)|0,r=Math.imul(B,ne),n=n+Math.imul(N,re)|0,s=(s=s+Math.imul(N,oe)|0)+Math.imul(O,re)|0,r=r+Math.imul(O,oe)|0,n=n+Math.imul(P,le)|0,s=(s=s+Math.imul(P,ce)|0)+Math.imul(_,le)|0,r=r+Math.imul(_,ce)|0,n=n+Math.imul(I,ue)|0,s=(s=s+Math.imul(I,de)|0)+Math.imul(R,ue)|0,r=r+Math.imul(R,de)|0;var Re=(c+(n=n+Math.imul(M,ge)|0)|0)+((8191&(s=(s=s+Math.imul(M,fe)|0)+Math.imul(T,ge)|0))<<13)|0;c=((r=r+Math.imul(T,fe)|0)+(s>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(G,re),s=(s=Math.imul(G,oe))+Math.imul(B,re)|0,r=Math.imul(B,oe),n=n+Math.imul(N,le)|0,s=(s=s+Math.imul(N,ce)|0)+Math.imul(O,le)|0,r=r+Math.imul(O,ce)|0,n=n+Math.imul(P,ue)|0,s=(s=s+Math.imul(P,de)|0)+Math.imul(_,ue)|0,r=r+Math.imul(_,de)|0;var ke=(c+(n=n+Math.imul(I,ge)|0)|0)+((8191&(s=(s=s+Math.imul(I,fe)|0)+Math.imul(R,ge)|0))<<13)|0;c=((r=r+Math.imul(R,fe)|0)+(s>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(G,le),s=(s=Math.imul(G,ce))+Math.imul(B,le)|0,r=Math.imul(B,ce),n=n+Math.imul(N,ue)|0,s=(s=s+Math.imul(N,de)|0)+Math.imul(O,ue)|0,r=r+Math.imul(O,de)|0;var Pe=(c+(n=n+Math.imul(P,ge)|0)|0)+((8191&(s=(s=s+Math.imul(P,fe)|0)+Math.imul(_,ge)|0))<<13)|0;c=((r=r+Math.imul(_,fe)|0)+(s>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(G,ue),s=(s=Math.imul(G,de))+Math.imul(B,ue)|0,r=Math.imul(B,de);var _e=(c+(n=n+Math.imul(N,ge)|0)|0)+((8191&(s=(s=s+Math.imul(N,fe)|0)+Math.imul(O,ge)|0))<<13)|0;c=((r=r+Math.imul(O,fe)|0)+(s>>>13)|0)+(_e>>>26)|0,_e&=67108863;var Le=(c+(n=Math.imul(G,ge))|0)+((8191&(s=(s=Math.imul(G,fe))+Math.imul(B,ge)|0))<<13)|0;return c=((r=Math.imul(B,fe))+(s>>>13)|0)+(Le>>>26)|0,Le&=67108863,l[0]=me,l[1]=ye,l[2]=ve,l[3]=be,l[4]=Ce,l[5]=we,l[6]=Se,l[7]=xe,l[8]=Ee,l[9]=Ae,l[10]=Me,l[11]=Te,l[12]=De,l[13]=Ie,l[14]=Re,l[15]=ke,l[16]=Pe,l[17]=_e,l[18]=Le,0!==c&&(l[19]=c,i.length++),i};function f(e,t,i){return(new m).mulp(e,t,i)}function m(e,t){this.x=e,this.y=t}Math.imul||(g=p),r.prototype.mulTo=function(e,t){var i,n=this.length+e.length;return i=10===this.length&&10===e.length?g(this,e,t):n<63?p(this,e,t):n<1024?function(e,t,i){i.negative=t.negative^e.negative,i.length=e.length+t.length;for(var n=0,s=0,r=0;r<i.length-1;r++){var o=s;s=0;for(var a=67108863&n,l=Math.min(r,t.length-1),c=Math.max(0,r-e.length+1);c<=l;c++){var h=r-c,u=(0|e.words[h])*(0|t.words[c]),d=67108863&u;a=67108863&(d=d+a|0),s+=(o=(o=o+(u/67108864|0)|0)+(d>>>26)|0)>>>26,o&=67108863}i.words[r]=a,n=o,o=s}return 0!==n?i.words[r]=n:i.length--,i.strip()}(this,e,t):f(this,e,t),i},m.prototype.makeRBT=function(e){for(var t=new Array(e),i=r.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,i,e);return t},m.prototype.revBin=function(e,t,i){if(0===e||e===i-1)return e;for(var n=0,s=0;s<t;s++)n|=(1&e)<<t-s-1,e>>=1;return n},m.prototype.permute=function(e,t,i,n,s,r){for(var o=0;o<r;o++)n[o]=t[e[o]],s[o]=i[e[o]]},m.prototype.transform=function(e,t,i,n,s,r){this.permute(r,e,t,i,n,s);for(var o=1;o<s;o<<=1)for(var a=o<<1,l=Math.cos(2*Math.PI/a),c=Math.sin(2*Math.PI/a),h=0;h<s;h+=a)for(var u=l,d=c,p=0;p<o;p++){var g=i[h+p],f=n[h+p],m=i[h+p+o],y=n[h+p+o],v=u*m-d*y;y=u*y+d*m,m=v,i[h+p]=g+m,n[h+p]=f+y,i[h+p+o]=g-m,n[h+p+o]=f-y,p!==a&&(v=l*u-c*d,d=l*d+c*u,u=v)}},m.prototype.guessLen13b=function(e,t){var i=1|Math.max(t,e),n=1&i,s=0;for(i=i/2|0;i;i>>>=1)s++;return 1<<s+1+n},m.prototype.conjugate=function(e,t,i){if(!(i<=1))for(var n=0;n<i/2;n++){var s=e[n];e[n]=e[i-n-1],e[i-n-1]=s,s=t[n],t[n]=-t[i-n-1],t[i-n-1]=-s}},m.prototype.normalize13b=function(e,t){for(var i=0,n=0;n<t/2;n++){var s=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+i;e[n]=67108863&s,i=s<67108864?0:s/67108864|0}return e},m.prototype.convert13b=function(e,t,i,s){for(var r=0,o=0;o<t;o++)r+=0|e[o],i[2*o]=8191&r,r>>>=13,i[2*o+1]=8191&r,r>>>=13;for(o=2*t;o<s;++o)i[o]=0;n(0===r),n(!(-8192&r))},m.prototype.stub=function(e){for(var t=new Array(e),i=0;i<e;i++)t[i]=0;return t},m.prototype.mulp=function(e,t,i){var n=2*this.guessLen13b(e.length,t.length),s=this.makeRBT(n),r=this.stub(n),o=new Array(n),a=new Array(n),l=new Array(n),c=new Array(n),h=new Array(n),u=new Array(n),d=i.words;d.length=n,this.convert13b(e.words,e.length,o,n),this.convert13b(t.words,t.length,c,n),this.transform(o,r,a,l,n,s),this.transform(c,r,h,u,n,s);for(var p=0;p<n;p++){var g=a[p]*h[p]-l[p]*u[p];l[p]=a[p]*u[p]+l[p]*h[p],a[p]=g}return this.conjugate(a,l,n),this.transform(a,l,d,r,n,s),this.conjugate(d,r,n),this.normalize13b(d,n),i.negative=e.negative^t.negative,i.length=e.length+t.length,i.strip()},r.prototype.mul=function(e){var t=new r(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},r.prototype.mulf=function(e){var t=new r(null);return t.words=new Array(this.length+e.length),f(this,e,t)},r.prototype.imul=function(e){return this.clone().mulTo(e,this)},r.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,i=0;i<this.length;i++){var s=(0|this.words[i])*e,r=(67108863&s)+(67108863&t);t>>=26,t+=s/67108864|0,t+=r>>>26,this.words[i]=67108863&r}return 0!==t&&(this.words[i]=t,this.length++),this.length=0===e?1:this.length,this},r.prototype.muln=function(e){return this.clone().imuln(e)},r.prototype.sqr=function(){return this.mul(this)},r.prototype.isqr=function(){return this.imul(this.clone())},r.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),i=0;i<t.length;i++){var n=i/26|0,s=i%26;t[i]=(e.words[n]&1<<s)>>>s}return t}(e);if(0===t.length)return new r(1);for(var i=this,n=0;n<t.length&&0===t[n];n++,i=i.sqr());if(++n<t.length)for(var s=i.sqr();n<t.length;n++,s=s.sqr())0!==t[n]&&(i=i.mul(s));return i},r.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,i=e%26,s=(e-i)/26,r=67108863>>>26-i<<26-i;if(0!==i){var o=0;for(t=0;t<this.length;t++){var a=this.words[t]&r,l=(0|this.words[t])-a<<i;this.words[t]=l|o,o=a>>>26-i}o&&(this.words[t]=o,this.length++)}if(0!==s){for(t=this.length-1;t>=0;t--)this.words[t+s]=this.words[t];for(t=0;t<s;t++)this.words[t]=0;this.length+=s}return this.strip()},r.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},r.prototype.iushrn=function(e,t,i){var s;n("number"==typeof e&&e>=0),s=t?(t-t%26)/26:0;var r=e%26,o=Math.min((e-r)/26,this.length),a=67108863^67108863>>>r<<r,l=i;if(s-=o,s=Math.max(0,s),l){for(var c=0;c<o;c++)l.words[c]=this.words[c];l.length=o}if(0===o);else if(this.length>o)for(this.length-=o,c=0;c<this.length;c++)this.words[c]=this.words[c+o];else this.words[0]=0,this.length=1;var h=0;for(c=this.length-1;c>=0&&(0!==h||c>=s);c--){var u=0|this.words[c];this.words[c]=h<<26-r|u>>>r,h=u&a}return l&&0!==h&&(l.words[l.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},r.prototype.ishrn=function(e,t,i){return n(0===this.negative),this.iushrn(e,t,i)},r.prototype.shln=function(e){return this.clone().ishln(e)},r.prototype.ushln=function(e){return this.clone().iushln(e)},r.prototype.shrn=function(e){return this.clone().ishrn(e)},r.prototype.ushrn=function(e){return this.clone().iushrn(e)},r.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26,s=1<<t;return!(this.length<=i||!(this.words[i]&s))},r.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==t&&i++,this.length=Math.min(i,this.length),0!==t){var s=67108863^67108863>>>t<<t;this.words[this.length-1]&=s}return 0===this.length&&(this.words[0]=0,this.length=1),this.strip()},r.prototype.maskn=function(e){return this.clone().imaskn(e)},r.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},r.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},r.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},r.prototype.addn=function(e){return this.clone().iaddn(e)},r.prototype.subn=function(e){return this.clone().isubn(e)},r.prototype.iabs=function(){return this.negative=0,this},r.prototype.abs=function(){return this.clone().iabs()},r.prototype._ishlnsubmul=function(e,t,i){var s,r,o=e.length+i;this._expand(o);var a=0;for(s=0;s<e.length;s++){r=(0|this.words[s+i])+a;var l=(0|e.words[s])*t;a=((r-=67108863&l)>>26)-(l/67108864|0),this.words[s+i]=67108863&r}for(;s<this.length-i;s++)a=(r=(0|this.words[s+i])+a)>>26,this.words[s+i]=67108863&r;if(0===a)return this.strip();for(n(-1===a),a=0,s=0;s<this.length;s++)a=(r=-(0|this.words[s])+a)>>26,this.words[s]=67108863&r;return this.negative=1,this.strip()},r.prototype._wordDiv=function(e,t){var i=(this.length,e.length),n=this.clone(),s=e,o=0|s.words[s.length-1];0!=(i=26-this._countBits(o))&&(s=s.ushln(i),n.iushln(i),o=0|s.words[s.length-1]);var a,l=n.length-s.length;if("mod"!==t){(a=new r(null)).length=l+1,a.words=new Array(a.length);for(var c=0;c<a.length;c++)a.words[c]=0}var h=n.clone()._ishlnsubmul(s,1,l);0===h.negative&&(n=h,a&&(a.words[l]=1));for(var u=l-1;u>=0;u--){var d=67108864*(0|n.words[s.length+u])+(0|n.words[s.length+u-1]);for(d=Math.min(d/o|0,67108863),n._ishlnsubmul(s,d,u);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(s,1,u),n.isZero()||(n.negative^=1);a&&(a.words[u]=d)}return a&&a.strip(),n.strip(),"div"!==t&&0!==i&&n.iushrn(i),{div:a||null,mod:n}},r.prototype.divmod=function(e,t,i){return n(!e.isZero()),this.isZero()?{div:new r(0),mod:new r(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(s=a.div.neg()),"div"!==t&&(o=a.mod.neg(),i&&0!==o.negative&&o.iadd(e)),{div:s,mod:o}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(s=a.div.neg()),{div:s,mod:a.mod}):0!==(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(o=a.mod.neg(),i&&0!==o.negative&&o.isub(e)),{div:a.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new r(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new r(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new r(this.modn(e.words[0]))}:this._wordDiv(e,t);var s,o,a},r.prototype.div=function(e){return this.divmod(e,"div",!1).div},r.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},r.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},r.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var i=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),s=e.andln(1),r=i.cmp(n);return r<0||1===s&&0===r?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},r.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,i=0,s=this.length-1;s>=0;s--)i=(t*i+(0|this.words[s]))%e;return i},r.prototype.idivn=function(e){n(e<=67108863);for(var t=0,i=this.length-1;i>=0;i--){var s=(0|this.words[i])+67108864*t;this.words[i]=s/e|0,t=s%e}return this.strip()},r.prototype.divn=function(e){return this.clone().idivn(e)},r.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var s=new r(1),o=new r(0),a=new r(0),l=new r(1),c=0;t.isEven()&&i.isEven();)t.iushrn(1),i.iushrn(1),++c;for(var h=i.clone(),u=t.clone();!t.isZero();){for(var d=0,p=1;0===(t.words[0]&p)&&d<26;++d,p<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(s.isOdd()||o.isOdd())&&(s.iadd(h),o.isub(u)),s.iushrn(1),o.iushrn(1);for(var g=0,f=1;0===(i.words[0]&f)&&g<26;++g,f<<=1);if(g>0)for(i.iushrn(g);g-- >0;)(a.isOdd()||l.isOdd())&&(a.iadd(h),l.isub(u)),a.iushrn(1),l.iushrn(1);t.cmp(i)>=0?(t.isub(i),s.isub(a),o.isub(l)):(i.isub(t),a.isub(s),l.isub(o))}return{a,b:l,gcd:i.iushln(c)}},r.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var s,o=new r(1),a=new r(0),l=i.clone();t.cmpn(1)>0&&i.cmpn(1)>0;){for(var c=0,h=1;0===(t.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(t.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var u=0,d=1;0===(i.words[0]&d)&&u<26;++u,d<<=1);if(u>0)for(i.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(l),a.iushrn(1);t.cmp(i)>=0?(t.isub(i),o.isub(a)):(i.isub(t),a.isub(o))}return(s=0===t.cmpn(1)?o:a).cmpn(0)<0&&s.iadd(e),s},r.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),i=e.clone();t.negative=0,i.negative=0;for(var n=0;t.isEven()&&i.isEven();n++)t.iushrn(1),i.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;i.isEven();)i.iushrn(1);var s=t.cmp(i);if(s<0){var r=t;t=i,i=r}else if(0===s||0===i.cmpn(1))break;t.isub(i)}return i.iushln(n)},r.prototype.invm=function(e){return this.egcd(e).a.umod(e)},r.prototype.isEven=function(){return!(1&this.words[0])},r.prototype.isOdd=function(){return!(1&~this.words[0])},r.prototype.andln=function(e){return this.words[0]&e},r.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,i=(e-t)/26,s=1<<t;if(this.length<=i)return this._expand(i+1),this.words[i]|=s,this;for(var r=s,o=i;0!==r&&o<this.length;o++){var a=0|this.words[o];r=(a+=r)>>>26,a&=67108863,this.words[o]=a}return 0!==r&&(this.words[o]=r,this.length++),this},r.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},r.prototype.cmpn=function(e){var t,i=e<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)t=1;else{i&&(e=-e),n(e<=67108863,"Number is too big");var s=0|this.words[0];t=s===e?0:s<e?-1:1}return 0!==this.negative?0|-t:t},r.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},r.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,i=this.length-1;i>=0;i--){var n=0|this.words[i],s=0|e.words[i];if(n!==s){n<s?t=-1:n>s&&(t=1);break}}return t},r.prototype.gtn=function(e){return 1===this.cmpn(e)},r.prototype.gt=function(e){return 1===this.cmp(e)},r.prototype.gten=function(e){return this.cmpn(e)>=0},r.prototype.gte=function(e){return this.cmp(e)>=0},r.prototype.ltn=function(e){return-1===this.cmpn(e)},r.prototype.lt=function(e){return-1===this.cmp(e)},r.prototype.lten=function(e){return this.cmpn(e)<=0},r.prototype.lte=function(e){return this.cmp(e)<=0},r.prototype.eqn=function(e){return 0===this.cmpn(e)},r.prototype.eq=function(e){return 0===this.cmp(e)},r.red=function(e){return new x(e)},r.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},r.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},r.prototype._forceRed=function(e){return this.red=e,this},r.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},r.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},r.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},r.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},r.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},r.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},r.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},r.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},r.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},r.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},r.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},r.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},r.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},r.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new r(t,16),this.n=this.p.bitLength(),this.k=new r(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function C(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(e){if("string"==typeof e){var t=r._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){x.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new r(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new r(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,i=e;do{this.split(i,this.tmp),t=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:i.ucmp(this.p);return 0===n?(i.words[0]=0,i.length=1):n>0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},s(b,v),b.prototype.split=function(e,t){for(var i=4194303,n=Math.min(e.length,9),s=0;s<n;s++)t.words[s]=e.words[s];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var r=e.words[9];for(t.words[t.length++]=r&i,s=10;s<e.length;s++){var o=0|e.words[s];e.words[s-10]=(o&i)<<4|r>>>22,r=o}r>>>=22,e.words[s-10]=r,0===r&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,i=0;i<e.length;i++){var n=0|e.words[i];t+=977*n,e.words[i]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},s(C,v),s(w,v),s(S,v),S.prototype.imulK=function(e){for(var t=0,i=0;i<e.length;i++){var n=19*(0|e.words[i])+t,s=67108863&n;n>>>=26,e.words[i]=s,t=n}return 0!==t&&(e.words[e.length++]=t),e},r._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new C;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new S}return y[e]=t,t},x.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},x.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},x.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},x.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},x.prototype.add=function(e,t){this._verify2(e,t);var i=e.add(t);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},x.prototype.iadd=function(e,t){this._verify2(e,t);var i=e.iadd(t);return i.cmp(this.m)>=0&&i.isub(this.m),i},x.prototype.sub=function(e,t){this._verify2(e,t);var i=e.sub(t);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},x.prototype.isub=function(e,t){this._verify2(e,t);var i=e.isub(t);return i.cmpn(0)<0&&i.iadd(this.m),i},x.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},x.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},x.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},x.prototype.isqr=function(e){return this.imul(e,e.clone())},x.prototype.sqr=function(e){return this.mul(e,e)},x.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var i=this.m.add(new r(1)).iushrn(2);return this.pow(e,i)}for(var s=this.m.subn(1),o=0;!s.isZero()&&0===s.andln(1);)o++,s.iushrn(1);n(!s.isZero());var a=new r(1).toRed(this),l=a.redNeg(),c=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new r(2*h*h).toRed(this);0!==this.pow(h,c).cmp(l);)h.redIAdd(l);for(var u=this.pow(h,s),d=this.pow(e,s.addn(1).iushrn(1)),p=this.pow(e,s),g=o;0!==p.cmp(a);){for(var f=p,m=0;0!==f.cmp(a);m++)f=f.redSqr();n(m<g);var y=this.pow(u,new r(1).iushln(g-m-1));d=d.redMul(y),u=y.redSqr(),p=p.redMul(u),g=m}return d},x.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},x.prototype.pow=function(e,t){if(t.isZero())return new r(1).toRed(this);if(0===t.cmpn(1))return e.clone();var i=new Array(16);i[0]=new r(1).toRed(this),i[1]=e;for(var n=2;n<i.length;n++)i[n]=this.mul(i[n-1],e);var s=i[0],o=0,a=0,l=t.bitLength()%26;for(0===l&&(l=26),n=t.length-1;n>=0;n--){for(var c=t.words[n],h=l-1;h>=0;h--){var u=c>>h&1;s!==i[0]&&(s=this.sqr(s)),0!==u||0!==o?(o<<=1,o|=u,(4===++a||0===n&&0===h)&&(s=this.mul(s,i[o]),a=0,o=0)):a=0}l=26}return s},x.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},x.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},r.mont=function(e){return new E(e)},s(E,x),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var i=e.imul(t),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),s=i.isub(n).iushrn(this.shift),r=s;return s.cmp(this.m)>=0?r=s.isub(this.m):s.cmpn(0)<0&&(r=s.iadd(this.m)),r._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new r(0)._forceRed(this);var i=e.mul(t),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),s=i.isub(n).iushrn(this.shift),o=s;return s.cmp(this.m)>=0?o=s.isub(this.m):s.cmpn(0)<0&&(o=s.iadd(this.m)),o._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=i.nmd(e),this)},39286(e,t,i){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function s(e,t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}function r(e,t,i){if(r.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(i=t,t=10),this._init(e||0,t||10,i||"be"))}var o;"object"==typeof e?e.exports=r:t.BN=r,r.BN=r,r.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:i(3308).Buffer}catch(e){}function a(e,t){var i=e.charCodeAt(t);return i>=48&&i<=57?i-48:i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:void n(!1,"Invalid character in "+e)}function l(e,t,i){var n=a(e,i);return i-1>=t&&(n|=a(e,i-1)<<4),n}function c(e,t,i,s){for(var r=0,o=0,a=Math.min(e.length,i),l=t;l<a;l++){var c=e.charCodeAt(l)-48;r*=s,o=c>=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&o<s,"Invalid character"),r+=o}return r}function h(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(r.isBN=function(e){return e instanceof r||null!==e&&"object"==typeof e&&e.constructor.wordSize===r.wordSize&&Array.isArray(e.words)},r.max=function(e,t){return e.cmp(t)>0?e:t},r.min=function(e,t){return e.cmp(t)<0?e:t},r.prototype._init=function(e,t,i){if("number"==typeof e)return this._initNumber(e,t,i);if("object"==typeof e)return this._initArray(e,t,i);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var s=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(s++,this.negative=1),s<e.length&&(16===t?this._parseHex(e,s,i):(this._parseBase(e,t,s),"le"===i&&this._initArray(this.toArray(),t,i)))},r.prototype._initNumber=function(e,t,i){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),t,i)},r.prototype._initArray=function(e,t,i){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var s=0;s<this.length;s++)this.words[s]=0;var r,o,a=0;if("be"===i)for(s=e.length-1,r=0;s>=0;s-=3)o=e[s]|e[s-1]<<8|e[s-2]<<16,this.words[r]|=o<<a&67108863,this.words[r+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,r++);else if("le"===i)for(s=0,r=0;s<e.length;s+=3)o=e[s]|e[s+1]<<8|e[s+2]<<16,this.words[r]|=o<<a&67108863,this.words[r+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,r++);return this._strip()},r.prototype._parseHex=function(e,t,i){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var s,r=0,o=0;if("be"===i)for(n=e.length-1;n>=t;n-=2)s=l(e,t,n)<<r,this.words[o]|=67108863&s,r>=18?(r-=18,o+=1,this.words[o]|=s>>>26):r+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)s=l(e,t,n)<<r,this.words[o]|=67108863&s,r>=18?(r-=18,o+=1,this.words[o]|=s>>>26):r+=8;this._strip()},r.prototype._parseBase=function(e,t,i){this.words=[0],this.length=1;for(var n=0,s=1;s<=67108863;s*=t)n++;n--,s=s/t|0;for(var r=e.length-i,o=r%n,a=Math.min(r,r-o)+i,l=0,h=i;h<a;h+=n)l=c(e,h,h+n,t),this.imuln(s),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(0!==o){var u=1;for(l=c(e,h,e.length,t),h=0;h<o;h++)u*=t;this.imuln(u),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}this._strip()},r.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},r.prototype._move=function(e){h(e,this)},r.prototype.clone=function(){var e=new r(null);return this.copy(e),e},r.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},r.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},r.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{r.prototype[Symbol.for("nodejs.util.inspect.custom")]=u}catch(e){r.prototype.inspect=u}else r.prototype.inspect=u;function u(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],p=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],g=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(e,t,i){i.negative=t.negative^e.negative;var n=e.length+t.length|0;i.length=n,n=n-1|0;var s=0|e.words[0],r=0|t.words[0],o=s*r,a=67108863&o,l=o/67108864|0;i.words[0]=a;for(var c=1;c<n;c++){for(var h=l>>>26,u=67108863&l,d=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=d;p++){var g=c-p|0;h+=(o=(s=0|e.words[g])*(r=0|t.words[p])+u)/67108864|0,u=67108863&o}i.words[c]=0|u,l=0|h}return 0!==l?i.words[c]=0|l:i.length--,i._strip()}r.prototype.toString=function(e,t){var i;if(t=0|t||1,16===(e=e||10)||"hex"===e){i="";for(var s=0,r=0,o=0;o<this.length;o++){var a=this.words[o],l=(16777215&(a<<s|r)).toString(16);r=a>>>24-s&16777215,(s+=2)>=26&&(s-=26,o--),i=0!==r||o!==this.length-1?d[6-l.length]+l+i:l+i}for(0!==r&&(i=r.toString(16)+i);i.length%t!==0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(e===(0|e)&&e>=2&&e<=36){var c=p[e],h=g[e];i="";var u=this.clone();for(u.negative=0;!u.isZero();){var f=u.modrn(h).toString(e);i=(u=u.idivn(h)).isZero()?f+i:d[c-f.length]+f+i}for(this.isZero()&&(i="0"+i);i.length%t!==0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}n(!1,"Base should be between 2 and 36")},r.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},r.prototype.toJSON=function(){return this.toString(16,2)},o&&(r.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),r.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},r.prototype.toArrayLike=function(e,t,i){this._strip();var s=this.byteLength(),r=i||Math.max(1,s);n(s<=r,"byte array longer than desired length"),n(r>0,"Requested array length <= 0");var o=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,r);return this["_toArrayLike"+("le"===t?"LE":"BE")](o,s),o},r.prototype._toArrayLikeLE=function(e,t){for(var i=0,n=0,s=0,r=0;s<this.length;s++){var o=this.words[s]<<r|n;e[i++]=255&o,i<e.length&&(e[i++]=o>>8&255),i<e.length&&(e[i++]=o>>16&255),6===r?(i<e.length&&(e[i++]=o>>24&255),n=0,r=0):(n=o>>>24,r+=2)}if(i<e.length)for(e[i++]=n;i<e.length;)e[i++]=0},r.prototype._toArrayLikeBE=function(e,t){for(var i=e.length-1,n=0,s=0,r=0;s<this.length;s++){var o=this.words[s]<<r|n;e[i--]=255&o,i>=0&&(e[i--]=o>>8&255),i>=0&&(e[i--]=o>>16&255),6===r?(i>=0&&(e[i--]=o>>24&255),n=0,r=0):(n=o>>>24,r+=2)}if(i>=0)for(e[i--]=n;i>=0;)e[i--]=0},Math.clz32?r.prototype._countBits=function(e){return 32-Math.clz32(e)}:r.prototype._countBits=function(e){var t=e,i=0;return t>=4096&&(i+=13,t>>>=13),t>=64&&(i+=7,t>>>=7),t>=8&&(i+=4,t>>>=4),t>=2&&(i+=2,t>>>=2),i+t},r.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,i=0;return 8191&t||(i+=13,t>>>=13),127&t||(i+=7,t>>>=7),15&t||(i+=4,t>>>=4),3&t||(i+=2,t>>>=2),1&t||i++,i},r.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},r.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var i=this._zeroBits(this.words[t]);if(e+=i,26!==i)break}return e},r.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},r.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},r.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},r.prototype.isNeg=function(){return 0!==this.negative},r.prototype.neg=function(){return this.clone().ineg()},r.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},r.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},r.prototype.ior=function(e){return n(0===(this.negative|e.negative)),this.iuor(e)},r.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},r.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},r.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var i=0;i<t.length;i++)this.words[i]=this.words[i]&e.words[i];return this.length=t.length,this._strip()},r.prototype.iand=function(e){return n(0===(this.negative|e.negative)),this.iuand(e)},r.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},r.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},r.prototype.iuxor=function(e){var t,i;this.length>e.length?(t=this,i=e):(t=e,i=this);for(var n=0;n<i.length;n++)this.words[n]=t.words[n]^i.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this._strip()},r.prototype.ixor=function(e){return n(0===(this.negative|e.negative)),this.iuxor(e)},r.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},r.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},r.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),i=e%26;this._expand(t),i>0&&t--;for(var s=0;s<t;s++)this.words[s]=67108863&~this.words[s];return i>0&&(this.words[s]=~this.words[s]&67108863>>26-i),this._strip()},r.prototype.notn=function(e){return this.clone().inotn(e)},r.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var i=e/26|0,s=e%26;return this._expand(i+1),this.words[i]=t?this.words[i]|1<<s:this.words[i]&~(1<<s),this._strip()},r.prototype.iadd=function(e){var t,i,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(i=this,n=e):(i=e,n=this);for(var s=0,r=0;r<n.length;r++)t=(0|i.words[r])+(0|n.words[r])+s,this.words[r]=67108863&t,s=t>>>26;for(;0!==s&&r<i.length;r++)t=(0|i.words[r])+s,this.words[r]=67108863&t,s=t>>>26;if(this.length=i.length,0!==s)this.words[this.length]=s,this.length++;else if(i!==this)for(;r<i.length;r++)this.words[r]=i.words[r];return this},r.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},r.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var i,n,s=this.cmp(e);if(0===s)return this.negative=0,this.length=1,this.words[0]=0,this;s>0?(i=this,n=e):(i=e,n=this);for(var r=0,o=0;o<n.length;o++)r=(t=(0|i.words[o])-(0|n.words[o])+r)>>26,this.words[o]=67108863&t;for(;0!==r&&o<i.length;o++)r=(t=(0|i.words[o])+r)>>26,this.words[o]=67108863&t;if(0===r&&o<i.length&&i!==this)for(;o<i.length;o++)this.words[o]=i.words[o];return this.length=Math.max(this.length,o),i!==this&&(this.negative=1),this._strip()},r.prototype.sub=function(e){return this.clone().isub(e)};var m=function(e,t,i){var n,s,r,o=e.words,a=t.words,l=i.words,c=0,h=0|o[0],u=8191&h,d=h>>>13,p=0|o[1],g=8191&p,f=p>>>13,m=0|o[2],y=8191&m,v=m>>>13,b=0|o[3],C=8191&b,w=b>>>13,S=0|o[4],x=8191&S,E=S>>>13,A=0|o[5],M=8191&A,T=A>>>13,D=0|o[6],I=8191&D,R=D>>>13,k=0|o[7],P=8191&k,_=k>>>13,L=0|o[8],N=8191&L,O=L>>>13,F=0|o[9],G=8191&F,B=F>>>13,V=0|a[0],H=8191&V,U=V>>>13,z=0|a[1],W=8191&z,j=z>>>13,$=0|a[2],K=8191&$,Y=$>>>13,q=0|a[3],X=8191&q,Z=q>>>13,Q=0|a[4],J=8191&Q,ee=Q>>>13,te=0|a[5],ie=8191&te,ne=te>>>13,se=0|a[6],re=8191&se,oe=se>>>13,ae=0|a[7],le=8191&ae,ce=ae>>>13,he=0|a[8],ue=8191&he,de=he>>>13,pe=0|a[9],ge=8191&pe,fe=pe>>>13;i.negative=e.negative^t.negative,i.length=19;var me=(c+(n=Math.imul(u,H))|0)+((8191&(s=(s=Math.imul(u,U))+Math.imul(d,H)|0))<<13)|0;c=((r=Math.imul(d,U))+(s>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(g,H),s=(s=Math.imul(g,U))+Math.imul(f,H)|0,r=Math.imul(f,U);var ye=(c+(n=n+Math.imul(u,W)|0)|0)+((8191&(s=(s=s+Math.imul(u,j)|0)+Math.imul(d,W)|0))<<13)|0;c=((r=r+Math.imul(d,j)|0)+(s>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,H),s=(s=Math.imul(y,U))+Math.imul(v,H)|0,r=Math.imul(v,U),n=n+Math.imul(g,W)|0,s=(s=s+Math.imul(g,j)|0)+Math.imul(f,W)|0,r=r+Math.imul(f,j)|0;var ve=(c+(n=n+Math.imul(u,K)|0)|0)+((8191&(s=(s=s+Math.imul(u,Y)|0)+Math.imul(d,K)|0))<<13)|0;c=((r=r+Math.imul(d,Y)|0)+(s>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(C,H),s=(s=Math.imul(C,U))+Math.imul(w,H)|0,r=Math.imul(w,U),n=n+Math.imul(y,W)|0,s=(s=s+Math.imul(y,j)|0)+Math.imul(v,W)|0,r=r+Math.imul(v,j)|0,n=n+Math.imul(g,K)|0,s=(s=s+Math.imul(g,Y)|0)+Math.imul(f,K)|0,r=r+Math.imul(f,Y)|0;var be=(c+(n=n+Math.imul(u,X)|0)|0)+((8191&(s=(s=s+Math.imul(u,Z)|0)+Math.imul(d,X)|0))<<13)|0;c=((r=r+Math.imul(d,Z)|0)+(s>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(x,H),s=(s=Math.imul(x,U))+Math.imul(E,H)|0,r=Math.imul(E,U),n=n+Math.imul(C,W)|0,s=(s=s+Math.imul(C,j)|0)+Math.imul(w,W)|0,r=r+Math.imul(w,j)|0,n=n+Math.imul(y,K)|0,s=(s=s+Math.imul(y,Y)|0)+Math.imul(v,K)|0,r=r+Math.imul(v,Y)|0,n=n+Math.imul(g,X)|0,s=(s=s+Math.imul(g,Z)|0)+Math.imul(f,X)|0,r=r+Math.imul(f,Z)|0;var Ce=(c+(n=n+Math.imul(u,J)|0)|0)+((8191&(s=(s=s+Math.imul(u,ee)|0)+Math.imul(d,J)|0))<<13)|0;c=((r=r+Math.imul(d,ee)|0)+(s>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(M,H),s=(s=Math.imul(M,U))+Math.imul(T,H)|0,r=Math.imul(T,U),n=n+Math.imul(x,W)|0,s=(s=s+Math.imul(x,j)|0)+Math.imul(E,W)|0,r=r+Math.imul(E,j)|0,n=n+Math.imul(C,K)|0,s=(s=s+Math.imul(C,Y)|0)+Math.imul(w,K)|0,r=r+Math.imul(w,Y)|0,n=n+Math.imul(y,X)|0,s=(s=s+Math.imul(y,Z)|0)+Math.imul(v,X)|0,r=r+Math.imul(v,Z)|0,n=n+Math.imul(g,J)|0,s=(s=s+Math.imul(g,ee)|0)+Math.imul(f,J)|0,r=r+Math.imul(f,ee)|0;var we=(c+(n=n+Math.imul(u,ie)|0)|0)+((8191&(s=(s=s+Math.imul(u,ne)|0)+Math.imul(d,ie)|0))<<13)|0;c=((r=r+Math.imul(d,ne)|0)+(s>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(I,H),s=(s=Math.imul(I,U))+Math.imul(R,H)|0,r=Math.imul(R,U),n=n+Math.imul(M,W)|0,s=(s=s+Math.imul(M,j)|0)+Math.imul(T,W)|0,r=r+Math.imul(T,j)|0,n=n+Math.imul(x,K)|0,s=(s=s+Math.imul(x,Y)|0)+Math.imul(E,K)|0,r=r+Math.imul(E,Y)|0,n=n+Math.imul(C,X)|0,s=(s=s+Math.imul(C,Z)|0)+Math.imul(w,X)|0,r=r+Math.imul(w,Z)|0,n=n+Math.imul(y,J)|0,s=(s=s+Math.imul(y,ee)|0)+Math.imul(v,J)|0,r=r+Math.imul(v,ee)|0,n=n+Math.imul(g,ie)|0,s=(s=s+Math.imul(g,ne)|0)+Math.imul(f,ie)|0,r=r+Math.imul(f,ne)|0;var Se=(c+(n=n+Math.imul(u,re)|0)|0)+((8191&(s=(s=s+Math.imul(u,oe)|0)+Math.imul(d,re)|0))<<13)|0;c=((r=r+Math.imul(d,oe)|0)+(s>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(P,H),s=(s=Math.imul(P,U))+Math.imul(_,H)|0,r=Math.imul(_,U),n=n+Math.imul(I,W)|0,s=(s=s+Math.imul(I,j)|0)+Math.imul(R,W)|0,r=r+Math.imul(R,j)|0,n=n+Math.imul(M,K)|0,s=(s=s+Math.imul(M,Y)|0)+Math.imul(T,K)|0,r=r+Math.imul(T,Y)|0,n=n+Math.imul(x,X)|0,s=(s=s+Math.imul(x,Z)|0)+Math.imul(E,X)|0,r=r+Math.imul(E,Z)|0,n=n+Math.imul(C,J)|0,s=(s=s+Math.imul(C,ee)|0)+Math.imul(w,J)|0,r=r+Math.imul(w,ee)|0,n=n+Math.imul(y,ie)|0,s=(s=s+Math.imul(y,ne)|0)+Math.imul(v,ie)|0,r=r+Math.imul(v,ne)|0,n=n+Math.imul(g,re)|0,s=(s=s+Math.imul(g,oe)|0)+Math.imul(f,re)|0,r=r+Math.imul(f,oe)|0;var xe=(c+(n=n+Math.imul(u,le)|0)|0)+((8191&(s=(s=s+Math.imul(u,ce)|0)+Math.imul(d,le)|0))<<13)|0;c=((r=r+Math.imul(d,ce)|0)+(s>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(N,H),s=(s=Math.imul(N,U))+Math.imul(O,H)|0,r=Math.imul(O,U),n=n+Math.imul(P,W)|0,s=(s=s+Math.imul(P,j)|0)+Math.imul(_,W)|0,r=r+Math.imul(_,j)|0,n=n+Math.imul(I,K)|0,s=(s=s+Math.imul(I,Y)|0)+Math.imul(R,K)|0,r=r+Math.imul(R,Y)|0,n=n+Math.imul(M,X)|0,s=(s=s+Math.imul(M,Z)|0)+Math.imul(T,X)|0,r=r+Math.imul(T,Z)|0,n=n+Math.imul(x,J)|0,s=(s=s+Math.imul(x,ee)|0)+Math.imul(E,J)|0,r=r+Math.imul(E,ee)|0,n=n+Math.imul(C,ie)|0,s=(s=s+Math.imul(C,ne)|0)+Math.imul(w,ie)|0,r=r+Math.imul(w,ne)|0,n=n+Math.imul(y,re)|0,s=(s=s+Math.imul(y,oe)|0)+Math.imul(v,re)|0,r=r+Math.imul(v,oe)|0,n=n+Math.imul(g,le)|0,s=(s=s+Math.imul(g,ce)|0)+Math.imul(f,le)|0,r=r+Math.imul(f,ce)|0;var Ee=(c+(n=n+Math.imul(u,ue)|0)|0)+((8191&(s=(s=s+Math.imul(u,de)|0)+Math.imul(d,ue)|0))<<13)|0;c=((r=r+Math.imul(d,de)|0)+(s>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(G,H),s=(s=Math.imul(G,U))+Math.imul(B,H)|0,r=Math.imul(B,U),n=n+Math.imul(N,W)|0,s=(s=s+Math.imul(N,j)|0)+Math.imul(O,W)|0,r=r+Math.imul(O,j)|0,n=n+Math.imul(P,K)|0,s=(s=s+Math.imul(P,Y)|0)+Math.imul(_,K)|0,r=r+Math.imul(_,Y)|0,n=n+Math.imul(I,X)|0,s=(s=s+Math.imul(I,Z)|0)+Math.imul(R,X)|0,r=r+Math.imul(R,Z)|0,n=n+Math.imul(M,J)|0,s=(s=s+Math.imul(M,ee)|0)+Math.imul(T,J)|0,r=r+Math.imul(T,ee)|0,n=n+Math.imul(x,ie)|0,s=(s=s+Math.imul(x,ne)|0)+Math.imul(E,ie)|0,r=r+Math.imul(E,ne)|0,n=n+Math.imul(C,re)|0,s=(s=s+Math.imul(C,oe)|0)+Math.imul(w,re)|0,r=r+Math.imul(w,oe)|0,n=n+Math.imul(y,le)|0,s=(s=s+Math.imul(y,ce)|0)+Math.imul(v,le)|0,r=r+Math.imul(v,ce)|0,n=n+Math.imul(g,ue)|0,s=(s=s+Math.imul(g,de)|0)+Math.imul(f,ue)|0,r=r+Math.imul(f,de)|0;var Ae=(c+(n=n+Math.imul(u,ge)|0)|0)+((8191&(s=(s=s+Math.imul(u,fe)|0)+Math.imul(d,ge)|0))<<13)|0;c=((r=r+Math.imul(d,fe)|0)+(s>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(G,W),s=(s=Math.imul(G,j))+Math.imul(B,W)|0,r=Math.imul(B,j),n=n+Math.imul(N,K)|0,s=(s=s+Math.imul(N,Y)|0)+Math.imul(O,K)|0,r=r+Math.imul(O,Y)|0,n=n+Math.imul(P,X)|0,s=(s=s+Math.imul(P,Z)|0)+Math.imul(_,X)|0,r=r+Math.imul(_,Z)|0,n=n+Math.imul(I,J)|0,s=(s=s+Math.imul(I,ee)|0)+Math.imul(R,J)|0,r=r+Math.imul(R,ee)|0,n=n+Math.imul(M,ie)|0,s=(s=s+Math.imul(M,ne)|0)+Math.imul(T,ie)|0,r=r+Math.imul(T,ne)|0,n=n+Math.imul(x,re)|0,s=(s=s+Math.imul(x,oe)|0)+Math.imul(E,re)|0,r=r+Math.imul(E,oe)|0,n=n+Math.imul(C,le)|0,s=(s=s+Math.imul(C,ce)|0)+Math.imul(w,le)|0,r=r+Math.imul(w,ce)|0,n=n+Math.imul(y,ue)|0,s=(s=s+Math.imul(y,de)|0)+Math.imul(v,ue)|0,r=r+Math.imul(v,de)|0;var Me=(c+(n=n+Math.imul(g,ge)|0)|0)+((8191&(s=(s=s+Math.imul(g,fe)|0)+Math.imul(f,ge)|0))<<13)|0;c=((r=r+Math.imul(f,fe)|0)+(s>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(G,K),s=(s=Math.imul(G,Y))+Math.imul(B,K)|0,r=Math.imul(B,Y),n=n+Math.imul(N,X)|0,s=(s=s+Math.imul(N,Z)|0)+Math.imul(O,X)|0,r=r+Math.imul(O,Z)|0,n=n+Math.imul(P,J)|0,s=(s=s+Math.imul(P,ee)|0)+Math.imul(_,J)|0,r=r+Math.imul(_,ee)|0,n=n+Math.imul(I,ie)|0,s=(s=s+Math.imul(I,ne)|0)+Math.imul(R,ie)|0,r=r+Math.imul(R,ne)|0,n=n+Math.imul(M,re)|0,s=(s=s+Math.imul(M,oe)|0)+Math.imul(T,re)|0,r=r+Math.imul(T,oe)|0,n=n+Math.imul(x,le)|0,s=(s=s+Math.imul(x,ce)|0)+Math.imul(E,le)|0,r=r+Math.imul(E,ce)|0,n=n+Math.imul(C,ue)|0,s=(s=s+Math.imul(C,de)|0)+Math.imul(w,ue)|0,r=r+Math.imul(w,de)|0;var Te=(c+(n=n+Math.imul(y,ge)|0)|0)+((8191&(s=(s=s+Math.imul(y,fe)|0)+Math.imul(v,ge)|0))<<13)|0;c=((r=r+Math.imul(v,fe)|0)+(s>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(G,X),s=(s=Math.imul(G,Z))+Math.imul(B,X)|0,r=Math.imul(B,Z),n=n+Math.imul(N,J)|0,s=(s=s+Math.imul(N,ee)|0)+Math.imul(O,J)|0,r=r+Math.imul(O,ee)|0,n=n+Math.imul(P,ie)|0,s=(s=s+Math.imul(P,ne)|0)+Math.imul(_,ie)|0,r=r+Math.imul(_,ne)|0,n=n+Math.imul(I,re)|0,s=(s=s+Math.imul(I,oe)|0)+Math.imul(R,re)|0,r=r+Math.imul(R,oe)|0,n=n+Math.imul(M,le)|0,s=(s=s+Math.imul(M,ce)|0)+Math.imul(T,le)|0,r=r+Math.imul(T,ce)|0,n=n+Math.imul(x,ue)|0,s=(s=s+Math.imul(x,de)|0)+Math.imul(E,ue)|0,r=r+Math.imul(E,de)|0;var De=(c+(n=n+Math.imul(C,ge)|0)|0)+((8191&(s=(s=s+Math.imul(C,fe)|0)+Math.imul(w,ge)|0))<<13)|0;c=((r=r+Math.imul(w,fe)|0)+(s>>>13)|0)+(De>>>26)|0,De&=67108863,n=Math.imul(G,J),s=(s=Math.imul(G,ee))+Math.imul(B,J)|0,r=Math.imul(B,ee),n=n+Math.imul(N,ie)|0,s=(s=s+Math.imul(N,ne)|0)+Math.imul(O,ie)|0,r=r+Math.imul(O,ne)|0,n=n+Math.imul(P,re)|0,s=(s=s+Math.imul(P,oe)|0)+Math.imul(_,re)|0,r=r+Math.imul(_,oe)|0,n=n+Math.imul(I,le)|0,s=(s=s+Math.imul(I,ce)|0)+Math.imul(R,le)|0,r=r+Math.imul(R,ce)|0,n=n+Math.imul(M,ue)|0,s=(s=s+Math.imul(M,de)|0)+Math.imul(T,ue)|0,r=r+Math.imul(T,de)|0;var Ie=(c+(n=n+Math.imul(x,ge)|0)|0)+((8191&(s=(s=s+Math.imul(x,fe)|0)+Math.imul(E,ge)|0))<<13)|0;c=((r=r+Math.imul(E,fe)|0)+(s>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(G,ie),s=(s=Math.imul(G,ne))+Math.imul(B,ie)|0,r=Math.imul(B,ne),n=n+Math.imul(N,re)|0,s=(s=s+Math.imul(N,oe)|0)+Math.imul(O,re)|0,r=r+Math.imul(O,oe)|0,n=n+Math.imul(P,le)|0,s=(s=s+Math.imul(P,ce)|0)+Math.imul(_,le)|0,r=r+Math.imul(_,ce)|0,n=n+Math.imul(I,ue)|0,s=(s=s+Math.imul(I,de)|0)+Math.imul(R,ue)|0,r=r+Math.imul(R,de)|0;var Re=(c+(n=n+Math.imul(M,ge)|0)|0)+((8191&(s=(s=s+Math.imul(M,fe)|0)+Math.imul(T,ge)|0))<<13)|0;c=((r=r+Math.imul(T,fe)|0)+(s>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(G,re),s=(s=Math.imul(G,oe))+Math.imul(B,re)|0,r=Math.imul(B,oe),n=n+Math.imul(N,le)|0,s=(s=s+Math.imul(N,ce)|0)+Math.imul(O,le)|0,r=r+Math.imul(O,ce)|0,n=n+Math.imul(P,ue)|0,s=(s=s+Math.imul(P,de)|0)+Math.imul(_,ue)|0,r=r+Math.imul(_,de)|0;var ke=(c+(n=n+Math.imul(I,ge)|0)|0)+((8191&(s=(s=s+Math.imul(I,fe)|0)+Math.imul(R,ge)|0))<<13)|0;c=((r=r+Math.imul(R,fe)|0)+(s>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(G,le),s=(s=Math.imul(G,ce))+Math.imul(B,le)|0,r=Math.imul(B,ce),n=n+Math.imul(N,ue)|0,s=(s=s+Math.imul(N,de)|0)+Math.imul(O,ue)|0,r=r+Math.imul(O,de)|0;var Pe=(c+(n=n+Math.imul(P,ge)|0)|0)+((8191&(s=(s=s+Math.imul(P,fe)|0)+Math.imul(_,ge)|0))<<13)|0;c=((r=r+Math.imul(_,fe)|0)+(s>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(G,ue),s=(s=Math.imul(G,de))+Math.imul(B,ue)|0,r=Math.imul(B,de);var _e=(c+(n=n+Math.imul(N,ge)|0)|0)+((8191&(s=(s=s+Math.imul(N,fe)|0)+Math.imul(O,ge)|0))<<13)|0;c=((r=r+Math.imul(O,fe)|0)+(s>>>13)|0)+(_e>>>26)|0,_e&=67108863;var Le=(c+(n=Math.imul(G,ge))|0)+((8191&(s=(s=Math.imul(G,fe))+Math.imul(B,ge)|0))<<13)|0;return c=((r=Math.imul(B,fe))+(s>>>13)|0)+(Le>>>26)|0,Le&=67108863,l[0]=me,l[1]=ye,l[2]=ve,l[3]=be,l[4]=Ce,l[5]=we,l[6]=Se,l[7]=xe,l[8]=Ee,l[9]=Ae,l[10]=Me,l[11]=Te,l[12]=De,l[13]=Ie,l[14]=Re,l[15]=ke,l[16]=Pe,l[17]=_e,l[18]=Le,0!==c&&(l[19]=c,i.length++),i};function y(e,t,i){i.negative=t.negative^e.negative,i.length=e.length+t.length;for(var n=0,s=0,r=0;r<i.length-1;r++){var o=s;s=0;for(var a=67108863&n,l=Math.min(r,t.length-1),c=Math.max(0,r-e.length+1);c<=l;c++){var h=r-c,u=(0|e.words[h])*(0|t.words[c]),d=67108863&u;a=67108863&(d=d+a|0),s+=(o=(o=o+(u/67108864|0)|0)+(d>>>26)|0)>>>26,o&=67108863}i.words[r]=a,n=o,o=s}return 0!==n?i.words[r]=n:i.length--,i._strip()}function v(e,t,i){return y(e,t,i)}function b(e,t){this.x=e,this.y=t}Math.imul||(m=f),r.prototype.mulTo=function(e,t){var i=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):i<63?f(this,e,t):i<1024?y(this,e,t):v(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),i=r.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,i,e);return t},b.prototype.revBin=function(e,t,i){if(0===e||e===i-1)return e;for(var n=0,s=0;s<t;s++)n|=(1&e)<<t-s-1,e>>=1;return n},b.prototype.permute=function(e,t,i,n,s,r){for(var o=0;o<r;o++)n[o]=t[e[o]],s[o]=i[e[o]]},b.prototype.transform=function(e,t,i,n,s,r){this.permute(r,e,t,i,n,s);for(var o=1;o<s;o<<=1)for(var a=o<<1,l=Math.cos(2*Math.PI/a),c=Math.sin(2*Math.PI/a),h=0;h<s;h+=a)for(var u=l,d=c,p=0;p<o;p++){var g=i[h+p],f=n[h+p],m=i[h+p+o],y=n[h+p+o],v=u*m-d*y;y=u*y+d*m,m=v,i[h+p]=g+m,n[h+p]=f+y,i[h+p+o]=g-m,n[h+p+o]=f-y,p!==a&&(v=l*u-c*d,d=l*d+c*u,u=v)}},b.prototype.guessLen13b=function(e,t){var i=1|Math.max(t,e),n=1&i,s=0;for(i=i/2|0;i;i>>>=1)s++;return 1<<s+1+n},b.prototype.conjugate=function(e,t,i){if(!(i<=1))for(var n=0;n<i/2;n++){var s=e[n];e[n]=e[i-n-1],e[i-n-1]=s,s=t[n],t[n]=-t[i-n-1],t[i-n-1]=-s}},b.prototype.normalize13b=function(e,t){for(var i=0,n=0;n<t/2;n++){var s=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+i;e[n]=67108863&s,i=s<67108864?0:s/67108864|0}return e},b.prototype.convert13b=function(e,t,i,s){for(var r=0,o=0;o<t;o++)r+=0|e[o],i[2*o]=8191&r,r>>>=13,i[2*o+1]=8191&r,r>>>=13;for(o=2*t;o<s;++o)i[o]=0;n(0===r),n(!(-8192&r))},b.prototype.stub=function(e){for(var t=new Array(e),i=0;i<e;i++)t[i]=0;return t},b.prototype.mulp=function(e,t,i){var n=2*this.guessLen13b(e.length,t.length),s=this.makeRBT(n),r=this.stub(n),o=new Array(n),a=new Array(n),l=new Array(n),c=new Array(n),h=new Array(n),u=new Array(n),d=i.words;d.length=n,this.convert13b(e.words,e.length,o,n),this.convert13b(t.words,t.length,c,n),this.transform(o,r,a,l,n,s),this.transform(c,r,h,u,n,s);for(var p=0;p<n;p++){var g=a[p]*h[p]-l[p]*u[p];l[p]=a[p]*u[p]+l[p]*h[p],a[p]=g}return this.conjugate(a,l,n),this.transform(a,l,d,r,n,s),this.conjugate(d,r,n),this.normalize13b(d,n),i.negative=e.negative^t.negative,i.length=e.length+t.length,i._strip()},r.prototype.mul=function(e){var t=new r(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},r.prototype.mulf=function(e){var t=new r(null);return t.words=new Array(this.length+e.length),v(this,e,t)},r.prototype.imul=function(e){return this.clone().mulTo(e,this)},r.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"==typeof e),n(e<67108864);for(var i=0,s=0;s<this.length;s++){var r=(0|this.words[s])*e,o=(67108863&r)+(67108863&i);i>>=26,i+=r/67108864|0,i+=o>>>26,this.words[s]=67108863&o}return 0!==i&&(this.words[s]=i,this.length++),this.length=0===e?1:this.length,t?this.ineg():this},r.prototype.muln=function(e){return this.clone().imuln(e)},r.prototype.sqr=function(){return this.mul(this)},r.prototype.isqr=function(){return this.imul(this.clone())},r.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),i=0;i<t.length;i++){var n=i/26|0,s=i%26;t[i]=e.words[n]>>>s&1}return t}(e);if(0===t.length)return new r(1);for(var i=this,n=0;n<t.length&&0===t[n];n++,i=i.sqr());if(++n<t.length)for(var s=i.sqr();n<t.length;n++,s=s.sqr())0!==t[n]&&(i=i.mul(s));return i},r.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,i=e%26,s=(e-i)/26,r=67108863>>>26-i<<26-i;if(0!==i){var o=0;for(t=0;t<this.length;t++){var a=this.words[t]&r,l=(0|this.words[t])-a<<i;this.words[t]=l|o,o=a>>>26-i}o&&(this.words[t]=o,this.length++)}if(0!==s){for(t=this.length-1;t>=0;t--)this.words[t+s]=this.words[t];for(t=0;t<s;t++)this.words[t]=0;this.length+=s}return this._strip()},r.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},r.prototype.iushrn=function(e,t,i){var s;n("number"==typeof e&&e>=0),s=t?(t-t%26)/26:0;var r=e%26,o=Math.min((e-r)/26,this.length),a=67108863^67108863>>>r<<r,l=i;if(s-=o,s=Math.max(0,s),l){for(var c=0;c<o;c++)l.words[c]=this.words[c];l.length=o}if(0===o);else if(this.length>o)for(this.length-=o,c=0;c<this.length;c++)this.words[c]=this.words[c+o];else this.words[0]=0,this.length=1;var h=0;for(c=this.length-1;c>=0&&(0!==h||c>=s);c--){var u=0|this.words[c];this.words[c]=h<<26-r|u>>>r,h=u&a}return l&&0!==h&&(l.words[l.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},r.prototype.ishrn=function(e,t,i){return n(0===this.negative),this.iushrn(e,t,i)},r.prototype.shln=function(e){return this.clone().ishln(e)},r.prototype.ushln=function(e){return this.clone().iushln(e)},r.prototype.shrn=function(e){return this.clone().ishrn(e)},r.prototype.ushrn=function(e){return this.clone().iushrn(e)},r.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26,s=1<<t;return!(this.length<=i||!(this.words[i]&s))},r.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==t&&i++,this.length=Math.min(i,this.length),0!==t){var s=67108863^67108863>>>t<<t;this.words[this.length-1]&=s}return 0===this.length&&(this.words[0]=0,this.length=1),this._strip()},r.prototype.maskn=function(e){return this.clone().imaskn(e)},r.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},r.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},r.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},r.prototype.addn=function(e){return this.clone().iaddn(e)},r.prototype.subn=function(e){return this.clone().isubn(e)},r.prototype.iabs=function(){return this.negative=0,this},r.prototype.abs=function(){return this.clone().iabs()},r.prototype._ishlnsubmul=function(e,t,i){var s,r,o=e.length+i;this._expand(o);var a=0;for(s=0;s<e.length;s++){r=(0|this.words[s+i])+a;var l=(0|e.words[s])*t;a=((r-=67108863&l)>>26)-(l/67108864|0),this.words[s+i]=67108863&r}for(;s<this.length-i;s++)a=(r=(0|this.words[s+i])+a)>>26,this.words[s+i]=67108863&r;if(0===a)return this._strip();for(n(-1===a),a=0,s=0;s<this.length;s++)a=(r=-(0|this.words[s])+a)>>26,this.words[s]=67108863&r;return this.negative=1,this._strip()},r.prototype._wordDiv=function(e,t){var i=(this.length,e.length),n=this.clone(),s=e,o=0|s.words[s.length-1];0!=(i=26-this._countBits(o))&&(s=s.ushln(i),n.iushln(i),o=0|s.words[s.length-1]);var a,l=n.length-s.length;if("mod"!==t){(a=new r(null)).length=l+1,a.words=new Array(a.length);for(var c=0;c<a.length;c++)a.words[c]=0}var h=n.clone()._ishlnsubmul(s,1,l);0===h.negative&&(n=h,a&&(a.words[l]=1));for(var u=l-1;u>=0;u--){var d=67108864*(0|n.words[s.length+u])+(0|n.words[s.length+u-1]);for(d=Math.min(d/o|0,67108863),n._ishlnsubmul(s,d,u);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(s,1,u),n.isZero()||(n.negative^=1);a&&(a.words[u]=d)}return a&&a._strip(),n._strip(),"div"!==t&&0!==i&&n.iushrn(i),{div:a||null,mod:n}},r.prototype.divmod=function(e,t,i){return n(!e.isZero()),this.isZero()?{div:new r(0),mod:new r(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(s=a.div.neg()),"div"!==t&&(o=a.mod.neg(),i&&0!==o.negative&&o.iadd(e)),{div:s,mod:o}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(s=a.div.neg()),{div:s,mod:a.mod}):0!==(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(o=a.mod.neg(),i&&0!==o.negative&&o.isub(e)),{div:a.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new r(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new r(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new r(this.modrn(e.words[0]))}:this._wordDiv(e,t);var s,o,a},r.prototype.div=function(e){return this.divmod(e,"div",!1).div},r.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},r.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},r.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var i=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),s=e.andln(1),r=i.cmp(n);return r<0||1===s&&0===r?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},r.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var i=(1<<26)%e,s=0,r=this.length-1;r>=0;r--)s=(i*s+(0|this.words[r]))%e;return t?-s:s},r.prototype.modn=function(e){return this.modrn(e)},r.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var i=0,s=this.length-1;s>=0;s--){var r=(0|this.words[s])+67108864*i;this.words[s]=r/e|0,i=r%e}return this._strip(),t?this.ineg():this},r.prototype.divn=function(e){return this.clone().idivn(e)},r.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var s=new r(1),o=new r(0),a=new r(0),l=new r(1),c=0;t.isEven()&&i.isEven();)t.iushrn(1),i.iushrn(1),++c;for(var h=i.clone(),u=t.clone();!t.isZero();){for(var d=0,p=1;0===(t.words[0]&p)&&d<26;++d,p<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(s.isOdd()||o.isOdd())&&(s.iadd(h),o.isub(u)),s.iushrn(1),o.iushrn(1);for(var g=0,f=1;0===(i.words[0]&f)&&g<26;++g,f<<=1);if(g>0)for(i.iushrn(g);g-- >0;)(a.isOdd()||l.isOdd())&&(a.iadd(h),l.isub(u)),a.iushrn(1),l.iushrn(1);t.cmp(i)>=0?(t.isub(i),s.isub(a),o.isub(l)):(i.isub(t),a.isub(s),l.isub(o))}return{a,b:l,gcd:i.iushln(c)}},r.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var s,o=new r(1),a=new r(0),l=i.clone();t.cmpn(1)>0&&i.cmpn(1)>0;){for(var c=0,h=1;0===(t.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(t.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var u=0,d=1;0===(i.words[0]&d)&&u<26;++u,d<<=1);if(u>0)for(i.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(l),a.iushrn(1);t.cmp(i)>=0?(t.isub(i),o.isub(a)):(i.isub(t),a.isub(o))}return(s=0===t.cmpn(1)?o:a).cmpn(0)<0&&s.iadd(e),s},r.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),i=e.clone();t.negative=0,i.negative=0;for(var n=0;t.isEven()&&i.isEven();n++)t.iushrn(1),i.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;i.isEven();)i.iushrn(1);var s=t.cmp(i);if(s<0){var r=t;t=i,i=r}else if(0===s||0===i.cmpn(1))break;t.isub(i)}return i.iushln(n)},r.prototype.invm=function(e){return this.egcd(e).a.umod(e)},r.prototype.isEven=function(){return!(1&this.words[0])},r.prototype.isOdd=function(){return!(1&~this.words[0])},r.prototype.andln=function(e){return this.words[0]&e},r.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,i=(e-t)/26,s=1<<t;if(this.length<=i)return this._expand(i+1),this.words[i]|=s,this;for(var r=s,o=i;0!==r&&o<this.length;o++){var a=0|this.words[o];r=(a+=r)>>>26,a&=67108863,this.words[o]=a}return 0!==r&&(this.words[o]=r,this.length++),this},r.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},r.prototype.cmpn=function(e){var t,i=e<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this._strip(),this.length>1)t=1;else{i&&(e=-e),n(e<=67108863,"Number is too big");var s=0|this.words[0];t=s===e?0:s<e?-1:1}return 0!==this.negative?0|-t:t},r.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},r.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,i=this.length-1;i>=0;i--){var n=0|this.words[i],s=0|e.words[i];if(n!==s){n<s?t=-1:n>s&&(t=1);break}}return t},r.prototype.gtn=function(e){return 1===this.cmpn(e)},r.prototype.gt=function(e){return 1===this.cmp(e)},r.prototype.gten=function(e){return this.cmpn(e)>=0},r.prototype.gte=function(e){return this.cmp(e)>=0},r.prototype.ltn=function(e){return-1===this.cmpn(e)},r.prototype.lt=function(e){return-1===this.cmp(e)},r.prototype.lten=function(e){return this.cmpn(e)<=0},r.prototype.lte=function(e){return this.cmp(e)<=0},r.prototype.eqn=function(e){return 0===this.cmpn(e)},r.prototype.eq=function(e){return 0===this.cmp(e)},r.red=function(e){return new M(e)},r.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},r.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},r.prototype._forceRed=function(e){return this.red=e,this},r.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},r.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},r.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},r.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},r.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},r.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},r.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},r.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},r.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},r.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},r.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},r.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},r.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},r.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var C={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new r(t,16),this.n=this.p.bitLength(),this.k=new r(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function S(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function x(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var t=r._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function T(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new r(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}w.prototype._tmp=function(){var e=new r(null);return e.words=new Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,i=e;do{this.split(i,this.tmp),t=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:i.ucmp(this.p);return 0===n?(i.words[0]=0,i.length=1):n>0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},s(S,w),S.prototype.split=function(e,t){for(var i=4194303,n=Math.min(e.length,9),s=0;s<n;s++)t.words[s]=e.words[s];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var r=e.words[9];for(t.words[t.length++]=r&i,s=10;s<e.length;s++){var o=0|e.words[s];e.words[s-10]=(o&i)<<4|r>>>22,r=o}r>>>=22,e.words[s-10]=r,0===r&&e.length>10?e.length-=10:e.length-=9},S.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,i=0;i<e.length;i++){var n=0|e.words[i];t+=977*n,e.words[i]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},s(x,w),s(E,w),s(A,w),A.prototype.imulK=function(e){for(var t=0,i=0;i<e.length;i++){var n=19*(0|e.words[i])+t,s=67108863&n;n>>>=26,e.words[i]=s,t=n}return 0!==t&&(e.words[e.length++]=t),e},r._prime=function(e){if(C[e])return C[e];var t;if("k256"===e)t=new S;else if("p224"===e)t=new x;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new A}return C[e]=t,t},M.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(h(e,e.umod(this.m)._forceRed(this)),e)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var i=e.add(t);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var i=e.iadd(t);return i.cmp(this.m)>=0&&i.isub(this.m),i},M.prototype.sub=function(e,t){this._verify2(e,t);var i=e.sub(t);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var i=e.isub(t);return i.cmpn(0)<0&&i.iadd(this.m),i},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var i=this.m.add(new r(1)).iushrn(2);return this.pow(e,i)}for(var s=this.m.subn(1),o=0;!s.isZero()&&0===s.andln(1);)o++,s.iushrn(1);n(!s.isZero());var a=new r(1).toRed(this),l=a.redNeg(),c=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new r(2*h*h).toRed(this);0!==this.pow(h,c).cmp(l);)h.redIAdd(l);for(var u=this.pow(h,s),d=this.pow(e,s.addn(1).iushrn(1)),p=this.pow(e,s),g=o;0!==p.cmp(a);){for(var f=p,m=0;0!==f.cmp(a);m++)f=f.redSqr();n(m<g);var y=this.pow(u,new r(1).iushln(g-m-1));d=d.redMul(y),u=y.redSqr(),p=p.redMul(u),g=m}return d},M.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},M.prototype.pow=function(e,t){if(t.isZero())return new r(1).toRed(this);if(0===t.cmpn(1))return e.clone();var i=new Array(16);i[0]=new r(1).toRed(this),i[1]=e;for(var n=2;n<i.length;n++)i[n]=this.mul(i[n-1],e);var s=i[0],o=0,a=0,l=t.bitLength()%26;for(0===l&&(l=26),n=t.length-1;n>=0;n--){for(var c=t.words[n],h=l-1;h>=0;h--){var u=c>>h&1;s!==i[0]&&(s=this.sqr(s)),0!==u||0!==o?(o<<=1,o|=u,(4===++a||0===n&&0===h)&&(s=this.mul(s,i[o]),a=0,o=0)):a=0}l=26}return s},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},r.mont=function(e){return new T(e)},s(T,M),T.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},T.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},T.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var i=e.imul(t),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),s=i.isub(n).iushrn(this.shift),r=s;return s.cmp(this.m)>=0?r=s.isub(this.m):s.cmpn(0)<0&&(r=s.iadd(this.m)),r._forceRed(this)},T.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new r(0)._forceRed(this);var i=e.mul(t),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),s=i.isub(n).iushrn(this.shift),o=s;return s.cmp(this.m)>=0?o=s.isub(this.m):s.cmpn(0)<0&&(o=s.iadd(this.m)),o._forceRed(this)},T.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=i.nmd(e),this)},36621(e){e.exports=function(e){var t={};function i(n){if(t[n])return t[n].exports;var s=t[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)i.d(n,s,function(t){return e[t]}.bind(null,s));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=90)}({17:function(e,t,i){"use strict";t.__esModule=!0,t.default=void 0;var n=i(18),s=function(){function e(){}return e.getFirstMatch=function(e,t){var i=t.match(e);return i&&i.length>0&&i[1]||""},e.getSecondMatch=function(e,t){var i=t.match(e);return i&&i.length>1&&i[2]||""},e.matchAndReturnConst=function(e,t,i){if(e.test(t))return i},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map(function(e){return parseInt(e,10)||0});t.push(0);var i=t[0],n=t[1];if(10===i)switch(n){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}switch(i){case 11:return"Big Sur";case 12:return"Monterey";case 13:return"Ventura";case 14:return"Sonoma";case 15:return"Sequoia";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map(function(e){return parseInt(e,10)||0});if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,i,n){void 0===n&&(n=!1);var s=e.getVersionPrecision(t),r=e.getVersionPrecision(i),o=Math.max(s,r),a=0,l=e.map([t,i],function(t){var i=o-e.getVersionPrecision(t),n=t+new Array(i+1).join(".0");return e.map(n.split("."),function(e){return new Array(20-e.length).join("0")+e}).reverse()});for(n&&(a=o-Math.min(s,r)),o-=1;o>=a;){if(l[0][o]>l[1][o])return 1;if(l[0][o]===l[1][o]){if(o===a)return 0;o-=1}else if(l[0][o]<l[1][o])return-1}},e.map=function(e,t){var i,n=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(i=0;i<e.length;i+=1)n.push(t(e[i]));return n},e.find=function(e,t){var i,n;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(i=0,n=e.length;i<n;i+=1){var s=e[i];if(t(s,i))return s}},e.assign=function(e){for(var t,i,n=e,s=arguments.length,r=new Array(s>1?s-1:0),o=1;o<s;o++)r[o-1]=arguments[o];if(Object.assign)return Object.assign.apply(Object,[e].concat(r));var a=function(){var e=r[t];"object"==typeof e&&null!==e&&Object.keys(e).forEach(function(t){n[t]=e[t]})};for(t=0,i=r.length;t<i;t+=1)a();return e},e.getBrowserAlias=function(e){return n.BROWSER_ALIASES_MAP[e]},e.getBrowserTypeByAlias=function(e){return n.BROWSER_MAP[e]||""},e}();t.default=s,e.exports=t.default},18:function(e,t,i){"use strict";t.__esModule=!0,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0,t.BROWSER_ALIASES_MAP={AmazonBot:"amazonbot","Amazon Silk":"amazon_silk","Android Browser":"android",BaiduSpider:"baiduspider",Bada:"bada",BingCrawler:"bingcrawler",Brave:"brave",BlackBerry:"blackberry","ChatGPT-User":"chatgpt_user",Chrome:"chrome",ClaudeBot:"claudebot",Chromium:"chromium",Diffbot:"diffbot",DuckDuckBot:"duckduckbot",DuckDuckGo:"duckduckgo",Electron:"electron",Epiphany:"epiphany",FacebookExternalHit:"facebookexternalhit",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot",GPTBot:"gptbot","Internet Explorer":"ie",InternetArchiveCrawler:"internetarchivecrawler","K-Meleon":"k_meleon",LibreWolf:"librewolf",Linespider:"linespider",Maxthon:"maxthon","Meta-ExternalAds":"meta_externalads","Meta-ExternalAgent":"meta_externalagent","Meta-ExternalFetcher":"meta_externalfetcher","Meta-WebIndexer":"meta_webindexer","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver","OAI-SearchBot":"oai_searchbot",Omgilibot:"omgilibot",Opera:"opera","Opera Coast":"opera_coast","Pale Moon":"pale_moon",PerplexityBot:"perplexitybot","Perplexity-User":"perplexity_user",PhantomJS:"phantomjs",PingdomBot:"pingdombot",Puffin:"puffin",QQ:"qq",QQLite:"qqlite",QupZilla:"qupzilla",Roku:"roku",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SlackBot:"slackbot",SeaMonkey:"seamonkey",Sleipnir:"sleipnir","Sogou Browser":"sogou",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat",YahooSlurp:"yahooslurp","Yandex Browser":"yandex",YandexBot:"yandexbot",YouBot:"youbot"},t.BROWSER_MAP={amazonbot:"AmazonBot",amazon_silk:"Amazon Silk",android:"Android Browser",baiduspider:"BaiduSpider",bada:"Bada",bingcrawler:"BingCrawler",blackberry:"BlackBerry",brave:"Brave",chatgpt_user:"ChatGPT-User",chrome:"Chrome",claudebot:"ClaudeBot",chromium:"Chromium",diffbot:"Diffbot",duckduckbot:"DuckDuckBot",duckduckgo:"DuckDuckGo",edge:"Microsoft Edge",electron:"Electron",epiphany:"Epiphany",facebookexternalhit:"FacebookExternalHit",firefox:"Firefox",focus:"Focus",generic:"Generic",google_search:"Google Search",googlebot:"Googlebot",gptbot:"GPTBot",ie:"Internet Explorer",internetarchivecrawler:"InternetArchiveCrawler",k_meleon:"K-Meleon",librewolf:"LibreWolf",linespider:"Linespider",maxthon:"Maxthon",meta_externalads:"Meta-ExternalAds",meta_externalagent:"Meta-ExternalAgent",meta_externalfetcher:"Meta-ExternalFetcher",meta_webindexer:"Meta-WebIndexer",mz:"MZ Browser",naver:"NAVER Whale Browser",oai_searchbot:"OAI-SearchBot",omgilibot:"Omgilibot",opera:"Opera",opera_coast:"Opera Coast",pale_moon:"Pale Moon",perplexitybot:"PerplexityBot",perplexity_user:"Perplexity-User",phantomjs:"PhantomJS",pingdombot:"PingdomBot",puffin:"Puffin",qq:"QQ Browser",qqlite:"QQ Browser Lite",qupzilla:"QupZilla",roku:"Roku",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",slackbot:"SlackBot",sleipnir:"Sleipnir",sogou:"Sogou Browser",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yahooslurp:"YahooSlurp",yandex:"Yandex Browser",yandexbot:"YandexBot",youbot:"YouBot"},t.PLATFORMS_MAP={bot:"bot",desktop:"desktop",mobile:"mobile",tablet:"tablet",tv:"tv"},t.OS_MAP={Android:"Android",Bada:"Bada",BlackBerry:"BlackBerry",ChromeOS:"Chrome OS",HarmonyOS:"HarmonyOS",iOS:"iOS",Linux:"Linux",MacOS:"macOS",PlayStation4:"PlayStation 4",Roku:"Roku",Tizen:"Tizen",WebOS:"WebOS",Windows:"Windows",WindowsPhone:"Windows Phone"},t.ENGINE_MAP={Blink:"Blink",EdgeHTML:"EdgeHTML",Gecko:"Gecko",Presto:"Presto",Trident:"Trident",WebKit:"WebKit"}},90:function(e,t,i){"use strict";t.__esModule=!0,t.default=void 0;var n,s=(n=i(91))&&n.__esModule?n:{default:n},r=i(18);function o(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var a=function(){function e(){}var t,i;return e.getParser=function(e,t,i){if(void 0===t&&(t=!1),void 0===i&&(i=null),"string"!=typeof e)throw new Error("UserAgent should be a string");return new s.default(e,t,i)},e.parse=function(e,t){return void 0===t&&(t=null),new s.default(e,t).getResult()},t=e,i=[{key:"BROWSER_MAP",get:function(){return r.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return r.ENGINE_MAP}},{key:"OS_MAP",get:function(){return r.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return r.PLATFORMS_MAP}}],null&&o(t.prototype,null),i&&o(t,i),e}();t.default=a,e.exports=t.default},91:function(e,t,i){"use strict";t.__esModule=!0,t.default=void 0;var n=l(i(92)),s=l(i(93)),r=l(i(94)),o=l(i(95)),a=l(i(17));function l(e){return e&&e.__esModule?e:{default:e}}var c=function(){function e(e,t,i){if(void 0===t&&(t=!1),void 0===i&&(i=null),null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e;var n=!1;"boolean"==typeof t?(n=t,this._hints=i):this._hints=null!=t&&"object"==typeof t?t:null,this.parsedResult={},!0!==n&&this.parse()}var t=e.prototype;return t.getHints=function(){return this._hints},t.hasBrand=function(e){if(!this._hints||!Array.isArray(this._hints.brands))return!1;var t=e.toLowerCase();return this._hints.brands.some(function(e){return e.brand&&e.brand.toLowerCase()===t})},t.getBrandVersion=function(e){if(this._hints&&Array.isArray(this._hints.brands)){var t=e.toLowerCase(),i=this._hints.brands.find(function(e){return e.brand&&e.brand.toLowerCase()===t});return i?i.version:void 0}},t.getUA=function(){return this._ua},t.test=function(e){return e.test(this._ua)},t.parseBrowser=function(){var e=this;this.parsedResult.browser={};var t=a.default.find(n.default,function(t){if("function"==typeof t.test)return t.test(e);if(Array.isArray(t.test))return t.test.some(function(t){return e.test(t)});throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.browser=t.describe(this.getUA(),this)),this.parsedResult.browser},t.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},t.getBrowserName=function(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},t.getBrowserVersion=function(){return this.getBrowser().version},t.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},t.parseOS=function(){var e=this;this.parsedResult.os={};var t=a.default.find(s.default,function(t){if("function"==typeof t.test)return t.test(e);if(Array.isArray(t.test))return t.test.some(function(t){return e.test(t)});throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os},t.getOSName=function(e){var t=this.getOS().name;return e?String(t).toLowerCase()||"":t||""},t.getOSVersion=function(){return this.getOS().version},t.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},t.getPlatformType=function(e){void 0===e&&(e=!1);var t=this.getPlatform().type;return e?String(t).toLowerCase()||"":t||""},t.parsePlatform=function(){var e=this;this.parsedResult.platform={};var t=a.default.find(r.default,function(t){if("function"==typeof t.test)return t.test(e);if(Array.isArray(t.test))return t.test.some(function(t){return e.test(t)});throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform},t.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},t.getEngineName=function(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},t.parseEngine=function(){var e=this;this.parsedResult.engine={};var t=a.default.find(o.default,function(t){if("function"==typeof t.test)return t.test(e);if(Array.isArray(t.test))return t.test.some(function(t){return e.test(t)});throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine},t.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},t.getResult=function(){return a.default.assign({},this.parsedResult)},t.satisfies=function(e){var t=this,i={},n=0,s={},r=0;if(Object.keys(e).forEach(function(t){var o=e[t];"string"==typeof o?(s[t]=o,r+=1):"object"==typeof o&&(i[t]=o,n+=1)}),n>0){var o=Object.keys(i),l=a.default.find(o,function(e){return t.isOS(e)});if(l){var c=this.satisfies(i[l]);if(void 0!==c)return c}var h=a.default.find(o,function(e){return t.isPlatform(e)});if(h){var u=this.satisfies(i[h]);if(void 0!==u)return u}}if(r>0){var d=Object.keys(s),p=a.default.find(d,function(e){return t.isBrowser(e,!0)});if(void 0!==p)return this.compareVersion(s[p])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var i=this.getBrowserName().toLowerCase(),n=e.toLowerCase(),s=a.default.getBrowserTypeByAlias(n);return t&&s&&(n=s.toLowerCase()),n===i},t.compareVersion=function(e){var t=[0],i=e,n=!1,s=this.getBrowserVersion();if("string"==typeof s)return">"===e[0]||"<"===e[0]?(i=e.substr(1),"="===e[1]?(n=!0,i=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?i=e.substr(1):"~"===e[0]&&(n=!0,i=e.substr(1)),t.indexOf(a.default.compareVersions(s,i,n))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some(function(e){return t.is(e)})},e}();t.default=c,e.exports=t.default},92:function(e,t,i){"use strict";t.__esModule=!0,t.default=void 0;var n,s=(n=i(17))&&n.__esModule?n:{default:n},r=/version\/(\d+(\.?_?\d+)+)/i,o=[{test:[/gptbot/i],describe:function(e){var t={name:"GPTBot"},i=s.default.getFirstMatch(/gptbot\/(\d+(\.\d+)+)/i,e)||s.default.getFirstMatch(r,e);return i&&(t.version=i),t}},{test:[/chatgpt-user/i],describe:function(e){var t={name:"ChatGPT-User"},i=s.default.getFirstMatch(/chatgpt-user\/(\d+(\.\d+)+)/i,e)||s.default.getFirstMatch(r,e);return i&&(t.version=i),t}},{test:[/oai-searchbot/i],describe:function(e){var t={name:"OAI-SearchBot"},i=s.default.getFirstMatch(/oai-searchbot\/(\d+(\.\d+)+)/i,e)||s.default.getFirstMatch(r,e);return i&&(t.version=i),t}},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe:function(e){var t={name:"ClaudeBot"},i=s.default.getFirstMatch(/(?:claudebot|claude-web|claude-user|claude-searchbot)\/(\d+(\.\d+)+)/i,e)||s.default.getFirstMatch(r,e);return i&&(t.version=i),t}},{test:[/omgilibot/i,/webzio-extended/i],describe:function(e){var t={name:"Omgilibot"},i=s.default.getFirstMatch(/(?:omgilibot|webzio-extended)\/(\d+(\.\d+)+)/i,e)||s.default.getFirstMatch(r,e);return i&&(t.version=i),t}},{test:[/diffbot/i],describe:function(e){var t={name:"Diffbot"},i=s.default.getFirstMatch(/diffbot\/(\d+(\.\d+)+)/i,e)||s.default.getFirstMatch(r,e);return i&&(t.version=i),t}},{test:[/perplexitybot/i],describe:function(e){var t={name:"PerplexityBot"},i=s.default.getFirstMatch(/perplexitybot\/(\d+(\.\d+)+)/i,e)||s.default.getFirstMatch(r,e);return i&&(t.version=i),t}},{test:[/perplexity-user/i],describe:function(e){var t={name:"Perplexity-User"},i=s.default.getFirstMatch(/perplexity-user\/(\d+(\.\d+)+)/i,e)||s.default.getFirstMatch(r,e);return i&&(t.version=i),t}},{test:[/youbot/i],describe:function(e){var t={name:"YouBot"},i=s.default.getFirstMatch(/youbot\/(\d+(\.\d+)+)/i,e)||s.default.getFirstMatch(r,e);return i&&(t.version=i),t}},{test:[/meta-webindexer/i],describe:function(e){var t={name:"Meta-WebIndexer"},i=s.default.getFirstMatch(/meta-webindexer\/(\d+(\.\d+)+)/i,e)||s.default.getFirstMatch(r,e);return i&&(t.version=i),t}},{test:[/meta-externalads/i],describe:function(e){var t={name:"Meta-ExternalAds"},i=s.default.getFirstMatch(/meta-externalads\/(\d+(\.\d+)+)/i,e)||s.default.getFirstMatch(r,e);return i&&(t.version=i),t}},{test:[/meta-externalagent/i],describe:function(e){var t={name:"Meta-ExternalAgent"},i=s.default.getFirstMatch(/meta-externalagent\/(\d+(\.\d+)+)/i,e)||s.default.getFirstMatch(r,e);return i&&(t.version=i),t}},{test:[/meta-externalfetcher/i],describe:function(e){var t={name:"Meta-ExternalFetcher"},i=s.default.getFirstMatch(/meta-externalfetcher\/(\d+(\.\d+)+)/i,e)||s.default.getFirstMatch(r,e);return i&&(t.version=i),t}},{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},i=s.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||s.default.getFirstMatch(r,e);return i&&(t.version=i),t}},{test:[/linespider/i],describe:function(e){var t={name:"Linespider"},i=s.default.getFirstMatch(/(?:linespider)(?:-[-\w]+)?[\s/](\d+(\.\d+)+)/i,e)||s.default.getFirstMatch(r,e);return i&&(t.version=i),t}},{test:[/amazonbot/i],describe:function(e){var t={name:"AmazonBot"},i=s.default.getFirstMatch(/amazonbot\/(\d+(\.\d+)+)/i,e)||s.default.getFirstMatch(r,e);return i&&(t.version=i),t}},{test:[/bingbot/i],describe:function(e){var t={name:"BingCrawler"},i=s.default.getFirstMatch(/bingbot\/(\d+(\.\d+)+)/i,e)||s.default.getFirstMatch(r,e);return i&&(t.version=i),t}},{test:[/baiduspider/i],describe:function(e){var t={name:"BaiduSpider"},i=s.default.getFirstMatch(/baiduspider\/(\d+(\.\d+)+)/i,e)||s.default.getFirstMatch(r,e);return i&&(t.version=i),t}},{test:[/duckduckbot/i],describe:function(e){var t={name:"DuckDuckBot"},i=s.default.getFirstMatch(/duckduckbot\/(\d+(\.\d+)+)/i,e)||s.default.getFirstMatch(r,e);return i&&(t.version=i),t}},{test:[/ia_archiver/i],describe:function(e){var t={name:"InternetArchiveCrawler"},i=s.default.getFirstMatch(/ia_archiver\/(\d+(\.\d+)+)/i,e)||s.default.getFirstMatch(r,e);return i&&(t.version=i),t}},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe:function(){return{name:"FacebookExternalHit"}}},{test:[/slackbot/i,/slack-imgProxy/i],describe:function(e){var t={name:"SlackBot"},i=s.default.getFirstMatch(/(?:slackbot|slack-imgproxy)(?:-[-\w]+)?[\s/](\d+(\.\d+)+)/i,e)||s.default.getFirstMatch(r,e);return i&&(t.version=i),t}},{test:[/yahoo!?[\s/]*slurp/i],describe:function(){return{name:"YahooSlurp"}}},{test:[/yandexbot/i,/yandexmobilebot/i],describe:function(){return{name:"YandexBot"}}},{test:[/pingdom/i],describe:function(){return{name:"PingdomBot"}}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},i=s.default.getFirstMatch(r,e)||s.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},i=s.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||s.default.getFirstMatch(r,e);return i&&(t.version=i),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},i=s.default.getFirstMatch(r,e)||s.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},i=s.default.getFirstMatch(r,e)||s.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/PaleMoon/i],describe:function(e){var t={name:"Pale Moon"},i=s.default.getFirstMatch(r,e)||s.default.getFirstMatch(/(?:PaleMoon)[\s/](\d+(?:\.\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},i=s.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||s.default.getFirstMatch(r,e);return i&&(t.version=i),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},i=s.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||s.default.getFirstMatch(r,e);return i&&(t.version=i),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},i=s.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||s.default.getFirstMatch(r,e);return i&&(t.version=i),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},i=s.default.getFirstMatch(r,e)||s.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},i=s.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||s.default.getFirstMatch(r,e);return i&&(t.version=i),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},i=s.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||s.default.getFirstMatch(r,e);return i&&(t.version=i),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},i=s.default.getFirstMatch(r,e)||s.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},i=s.default.getFirstMatch(r,e)||s.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},i=s.default.getFirstMatch(r,e)||s.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},i=s.default.getFirstMatch(r,e)||s.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},i=s.default.getFirstMatch(r,e)||s.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},i=s.default.getFirstMatch(r,e)||s.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},i=s.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||s.default.getFirstMatch(r,e);return i&&(t.version=i),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},i=s.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||s.default.getFirstMatch(r,e);return i&&(t.version=i),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},i=s.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},i=s.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},i=s.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},i=s.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},i=s.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},i=s.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return i&&(t.version=i),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},i=s.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},i=s.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},i=s.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},i=s.default.getFirstMatch(r,e)||s.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},i=s.default.getFirstMatch(r,e)||s.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},i=s.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},i=s.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||s.default.getFirstMatch(r,e);return i&&(t.version=i),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},i=s.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||s.default.getFirstMatch(r,e);return i&&(t.version=i),t}},{test:[/librewolf/i],describe:function(e){var t={name:"LibreWolf"},i=s.default.getFirstMatch(/(?:librewolf)[\s/](\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},i=s.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},i=s.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/sogoumobilebrowser/i,/metasr/i,/se 2\.[x]/i],describe:function(e){var t={name:"Sogou Browser"},i=s.default.getFirstMatch(/(?:sogoumobilebrowser)[\s/](\d+(\.?_?\d+)+)/i,e),n=s.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e),r=s.default.getFirstMatch(/se ([\d.]+)x/i,e),o=i||n||r;return o&&(t.version=o),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},i=s.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:function(e){return!!e.hasBrand("DuckDuckGo")||e.test(/\sDdg\/[\d.]+$/i)},describe:function(e,t){var i={name:"DuckDuckGo"};if(t){var n=t.getBrandVersion("DuckDuckGo");if(n)return i.version=n,i}var r=s.default.getFirstMatch(/\sDdg\/([\d.]+)$/i,e);return r&&(i.version=r),i}},{test:function(e){return e.hasBrand("Brave")},describe:function(e,t){var i={name:"Brave"};if(t){var n=t.getBrandVersion("Brave");if(n)return i.version=n,i}return i}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},i=s.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||s.default.getFirstMatch(r,e);return i&&(t.version=i),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},i=s.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},i=s.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:function(e){var t=!e.test(/like android/i),i=e.test(/android/i);return t&&i},describe:function(e){var t={name:"Android Browser"},i=s.default.getFirstMatch(r,e);return i&&(t.version=i),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},i=s.default.getFirstMatch(r,e);return i&&(t.version=i),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},i=s.default.getFirstMatch(r,e);return i&&(t.version=i),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:s.default.getFirstMatch(t,e),version:s.default.getSecondMatch(t,e)}}}];t.default=o,e.exports=t.default},93:function(e,t,i){"use strict";t.__esModule=!0,t.default=void 0;var n,s=(n=i(17))&&n.__esModule?n:{default:n},r=i(18),o=[{test:[/Roku\/DVP/],describe:function(e){var t=s.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:r.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=s.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:r.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=s.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),i=s.default.getWindowsVersionName(t);return{name:r.OS_MAP.Windows,version:t,versionName:i}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:r.OS_MAP.iOS},i=s.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return i&&(t.version=i),t}},{test:[/macintosh/i],describe:function(e){var t=s.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),i=s.default.getMacOSVersionName(t),n={name:r.OS_MAP.MacOS,version:t};return i&&(n.versionName=i),n}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=s.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:r.OS_MAP.iOS,version:t}}},{test:[/OpenHarmony/i],describe:function(e){var t=s.default.getFirstMatch(/OpenHarmony\s+(\d+(\.\d+)*)/i,e);return{name:r.OS_MAP.HarmonyOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),i=e.test(/android/i);return t&&i},describe:function(e){var t=s.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),i=s.default.getAndroidVersionName(t),n={name:r.OS_MAP.Android,version:t};return i&&(n.versionName=i),n}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=s.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),i={name:r.OS_MAP.WebOS};return t&&t.length&&(i.version=t),i}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=s.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||s.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||s.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:r.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=s.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:r.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=s.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:r.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:r.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:r.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=s.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:r.OS_MAP.PlayStation4,version:t}}}];t.default=o,e.exports=t.default},94:function(e,t,i){"use strict";t.__esModule=!0,t.default=void 0;var n,s=(n=i(17))&&n.__esModule?n:{default:n},r=i(18),o=[{test:[/googlebot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Google"}}},{test:[/linespider/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Line"}}},{test:[/amazonbot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Amazon"}}},{test:[/gptbot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/chatgpt-user/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/oai-searchbot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/baiduspider/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Baidu"}}},{test:[/bingbot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Bing"}}},{test:[/duckduckbot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"DuckDuckGo"}}},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Anthropic"}}},{test:[/omgilibot/i,/webzio-extended/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Webz.io"}}},{test:[/diffbot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Diffbot"}}},{test:[/perplexitybot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Perplexity AI"}}},{test:[/perplexity-user/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Perplexity AI"}}},{test:[/youbot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"You.com"}}},{test:[/ia_archiver/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Internet Archive"}}},{test:[/meta-webindexer/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalads/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalagent/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalfetcher/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/slackbot/i,/slack-imgProxy/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Slack"}}},{test:[/yahoo/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Yahoo"}}},{test:[/yandexbot/i,/yandexmobilebot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Yandex"}}},{test:[/pingdom/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Pingdom"}}},{test:[/huawei/i],describe:function(e){var t=s.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",i={type:r.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(i.model=t),i}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:r.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:r.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:r.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:r.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:r.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:r.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),i=e.test(/like (ipod|iphone)/i);return t&&!i},describe:function(e){var t=s.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:r.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:r.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/Nokia/i],describe:function(e){var t=s.default.getFirstMatch(/Nokia\s+([0-9]+(\.[0-9]+)?)/i,e),i={type:r.PLATFORMS_MAP.mobile,vendor:"Nokia"};return t&&(i.model=t),i}},{test:[/[^-]mobi/i],describe:function(){return{type:r.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:r.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:r.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.mobile}}},{test:[/smart-?tv|smarttv/i],describe:function(){return{type:r.PLATFORMS_MAP.tv}}},{test:[/netcast/i],describe:function(){return{type:r.PLATFORMS_MAP.tv}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.tv}}}];t.default=o,e.exports=t.default},95:function(e,t,i){"use strict";t.__esModule=!0,t.default=void 0;var n,s=(n=i(17))&&n.__esModule?n:{default:n},r=i(18),o=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:r.ENGINE_MAP.Blink};var t=s.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:r.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:r.ENGINE_MAP.Trident},i=s.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:r.ENGINE_MAP.Presto},i=s.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:function(e){var t=e.test(/gecko/i),i=e.test(/like gecko/i);return t&&!i},describe:function(e){var t={name:r.ENGINE_MAP.Gecko},i=s.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:r.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:r.ENGINE_MAP.WebKit},i=s.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}}];t.default=o,e.exports=t.default}})},65442(e,t,i){var n;function s(e){this.rand=e}if(e.exports=function(e){return n||(n=new s(null)),n.generate(e)},e.exports.Rand=s,s.prototype.generate=function(e){return this._rand(e)},s.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),i=0;i<t.length;i++)t[i]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?s.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?s.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(s.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var r=i(44507);if("function"!=typeof r.randomBytes)throw new Error("Not supported");s.prototype._rand=function(e){return r.randomBytes(e)}}catch(e){}},87088(e,t,i){var n=i(56608).Buffer;function s(e){n.isBuffer(e)||(e=n.from(e));for(var t=e.length/4|0,i=new Array(t),s=0;s<t;s++)i[s]=e.readUInt32BE(4*s);return i}function r(e){for(;0<e.length;e++)e[0]=0}function o(e,t,i,n,s){for(var r,o,a,l,c=i[0],h=i[1],u=i[2],d=i[3],p=e[0]^t[0],g=e[1]^t[1],f=e[2]^t[2],m=e[3]^t[3],y=4,v=1;v<s;v++)r=c[p>>>24]^h[g>>>16&255]^u[f>>>8&255]^d[255&m]^t[y++],o=c[g>>>24]^h[f>>>16&255]^u[m>>>8&255]^d[255&p]^t[y++],a=c[f>>>24]^h[m>>>16&255]^u[p>>>8&255]^d[255&g]^t[y++],l=c[m>>>24]^h[p>>>16&255]^u[g>>>8&255]^d[255&f]^t[y++],p=r,g=o,f=a,m=l;return r=(n[p>>>24]<<24|n[g>>>16&255]<<16|n[f>>>8&255]<<8|n[255&m])^t[y++],o=(n[g>>>24]<<24|n[f>>>16&255]<<16|n[m>>>8&255]<<8|n[255&p])^t[y++],a=(n[f>>>24]<<24|n[m>>>16&255]<<16|n[p>>>8&255]<<8|n[255&g])^t[y++],l=(n[m>>>24]<<24|n[p>>>16&255]<<16|n[g>>>8&255]<<8|n[255&f])^t[y++],[r>>>=0,o>>>=0,a>>>=0,l>>>=0]}var a=[0,1,2,4,8,16,32,64,128,27,54],l=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var i=[],n=[],s=[[],[],[],[]],r=[[],[],[],[]],o=0,a=0,l=0;l<256;++l){var c=a^a<<1^a<<2^a<<3^a<<4;c=c>>>8^255&c^99,i[o]=c,n[c]=o;var h=e[o],u=e[h],d=e[u],p=257*e[c]^16843008*c;s[0][o]=p<<24|p>>>8,s[1][o]=p<<16|p>>>16,s[2][o]=p<<8|p>>>24,s[3][o]=p,p=16843009*d^65537*u^257*h^16843008*o,r[0][c]=p<<24|p>>>8,r[1][c]=p<<16|p>>>16,r[2][c]=p<<8|p>>>24,r[3][c]=p,0===o?o=a=1:(o=h^e[e[e[d^h]]],a^=e[e[a]])}return{SBOX:i,INV_SBOX:n,SUB_MIX:s,INV_SUB_MIX:r}}();function c(e){this._key=s(e),this._reset()}c.blockSize=16,c.keySize=32,c.prototype.blockSize=c.blockSize,c.prototype.keySize=c.keySize,c.prototype._reset=function(){for(var e=this._key,t=e.length,i=t+6,n=4*(i+1),s=[],r=0;r<t;r++)s[r]=e[r];for(r=t;r<n;r++){var o=s[r-1];r%t===0?(o=o<<8|o>>>24,o=l.SBOX[o>>>24]<<24|l.SBOX[o>>>16&255]<<16|l.SBOX[o>>>8&255]<<8|l.SBOX[255&o],o^=a[r/t|0]<<24):t>6&&r%t===4&&(o=l.SBOX[o>>>24]<<24|l.SBOX[o>>>16&255]<<16|l.SBOX[o>>>8&255]<<8|l.SBOX[255&o]),s[r]=s[r-t]^o}for(var c=[],h=0;h<n;h++){var u=n-h,d=s[u-(h%4?0:4)];c[h]=h<4||u<=4?d:l.INV_SUB_MIX[0][l.SBOX[d>>>24]]^l.INV_SUB_MIX[1][l.SBOX[d>>>16&255]]^l.INV_SUB_MIX[2][l.SBOX[d>>>8&255]]^l.INV_SUB_MIX[3][l.SBOX[255&d]]}this._nRounds=i,this._keySchedule=s,this._invKeySchedule=c},c.prototype.encryptBlockRaw=function(e){return o(e=s(e),this._keySchedule,l.SUB_MIX,l.SBOX,this._nRounds)},c.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),i=n.allocUnsafe(16);return i.writeUInt32BE(t[0],0),i.writeUInt32BE(t[1],4),i.writeUInt32BE(t[2],8),i.writeUInt32BE(t[3],12),i},c.prototype.decryptBlock=function(e){var t=(e=s(e))[1];e[1]=e[3],e[3]=t;var i=o(e,this._invKeySchedule,l.INV_SUB_MIX,l.INV_SBOX,this._nRounds),r=n.allocUnsafe(16);return r.writeUInt32BE(i[0],0),r.writeUInt32BE(i[3],4),r.writeUInt32BE(i[2],8),r.writeUInt32BE(i[1],12),r},c.prototype.scrub=function(){r(this._keySchedule),r(this._invKeySchedule),r(this._key)},e.exports.AES=c},78182(e,t,i){var n=i(87088),s=i(56608).Buffer,r=i(36334),o=i(91193),a=i(60050),l=i(10460),c=i(56696);function h(e,t,i,o){r.call(this);var l=s.alloc(4,0);this._cipher=new n.AES(t);var h=this._cipher.encryptBlock(l);this._ghash=new a(h),i=function(e,t,i){if(12===t.length)return e._finID=s.concat([t,s.from([0,0,0,1])]),s.concat([t,s.from([0,0,0,2])]);var n=new a(i),r=t.length,o=r%16;n.update(t),o&&(o=16-o,n.update(s.alloc(o,0))),n.update(s.alloc(8,0));var l=8*r,h=s.alloc(8);h.writeUIntBE(l,0,8),n.update(h),e._finID=n.state;var u=s.from(e._finID);return c(u),u}(this,i,h),this._prev=s.from(i),this._cache=s.allocUnsafe(0),this._secCache=s.allocUnsafe(0),this._decrypt=o,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}o(h,r),h.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=s.alloc(t,0),this._ghash.update(t))}this._called=!0;var i=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(i),this._len+=e.length,i},h.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=l(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){var i=0;e.length!==t.length&&i++;for(var n=Math.min(e.length,t.length),s=0;s<n;++s)i+=e[s]^t[s];return i}(e,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=e,this._cipher.scrub()},h.prototype.getAuthTag=function(){if(this._decrypt||!s.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},h.prototype.setAuthTag=function(e){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=e},h.prototype.setAAD=function(e){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(e),this._alen+=e.length},e.exports=h},15007(e,t,i){var n=i(85173),s=i(98733),r=i(25730);t.createCipher=t.Cipher=n.createCipher,t.createCipheriv=t.Cipheriv=n.createCipheriv,t.createDecipher=t.Decipher=s.createDecipher,t.createDecipheriv=t.Decipheriv=s.createDecipheriv,t.listCiphers=t.getCiphers=function(){return Object.keys(r)}},98733(e,t,i){var n=i(78182),s=i(56608).Buffer,r=i(76200),o=i(58116),a=i(36334),l=i(87088),c=i(51804);function h(e,t,i){a.call(this),this._cache=new u,this._last=void 0,this._cipher=new l.AES(t),this._prev=s.from(i),this._mode=e,this._autopadding=!0}function u(){this.cache=s.allocUnsafe(0)}function d(e,t,i){var a=r[e.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"==typeof i&&(i=s.from(i)),"GCM"!==a.mode&&i.length!==a.iv)throw new TypeError("invalid iv length "+i.length);if("string"==typeof t&&(t=s.from(t)),t.length!==a.key/8)throw new TypeError("invalid key length "+t.length);return"stream"===a.type?new o(a.module,t,i,!0):"auth"===a.type?new n(a.module,t,i,!0):new h(a.module,t,i)}i(91193)(h,a),h.prototype._update=function(e){var t,i;this._cache.add(e);for(var n=[];t=this._cache.get(this._autopadding);)i=this._mode.decrypt(this,t),n.push(i);return s.concat(n)},h.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return function(e){var t=e[15];if(t<1||t>16)throw new Error("unable to decrypt data");for(var i=-1;++i<t;)if(e[i+(16-t)]!==t)throw new Error("unable to decrypt data");if(16!==t)return e.slice(0,16-t)}(this._mode.decrypt(this,e));if(e)throw new Error("data not multiple of block length")},h.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},u.prototype.add=function(e){this.cache=s.concat([this.cache,e])},u.prototype.get=function(e){var t;if(e){if(this.cache.length>16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},u.prototype.flush=function(){if(this.cache.length)return this.cache},t.createDecipher=function(e,t){var i=r[e.toLowerCase()];if(!i)throw new TypeError("invalid suite type");var n=c(t,!1,i.key,i.iv);return d(e,n.key,n.iv)},t.createDecipheriv=d},85173(e,t,i){var n=i(76200),s=i(78182),r=i(56608).Buffer,o=i(58116),a=i(36334),l=i(87088),c=i(51804);function h(e,t,i){a.call(this),this._cache=new d,this._cipher=new l.AES(t),this._prev=r.from(i),this._mode=e,this._autopadding=!0}i(91193)(h,a),h.prototype._update=function(e){var t,i;this._cache.add(e);for(var n=[];t=this._cache.get();)i=this._mode.encrypt(this,t),n.push(i);return r.concat(n)};var u=r.alloc(16,16);function d(){this.cache=r.allocUnsafe(0)}function p(e,t,i){var a=n[e.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"==typeof t&&(t=r.from(t)),t.length!==a.key/8)throw new TypeError("invalid key length "+t.length);if("string"==typeof i&&(i=r.from(i)),"GCM"!==a.mode&&i.length!==a.iv)throw new TypeError("invalid iv length "+i.length);return"stream"===a.type?new o(a.module,t,i):"auth"===a.type?new s(a.module,t,i):new h(a.module,t,i)}h.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(u))throw this._cipher.scrub(),new Error("data not multiple of block length")},h.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},d.prototype.add=function(e){this.cache=r.concat([this.cache,e])},d.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},d.prototype.flush=function(){for(var e=16-this.cache.length,t=r.allocUnsafe(e),i=-1;++i<e;)t.writeUInt8(e,i);return r.concat([this.cache,t])},t.createCipheriv=p,t.createCipher=function(e,t){var i=n[e.toLowerCase()];if(!i)throw new TypeError("invalid suite type");var s=c(t,!1,i.key,i.iv);return p(e,s.key,s.iv)}},60050(e,t,i){var n=i(56608).Buffer,s=n.alloc(16,0);function r(e){var t=n.allocUnsafe(16);return t.writeUInt32BE(e[0]>>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function o(e){this.h=e,this.state=n.alloc(16,0),this.cache=n.allocUnsafe(0)}o.prototype.ghash=function(e){for(var t=-1;++t<e.length;)this.state[t]^=e[t];this._multiply()},o.prototype._multiply=function(){for(var e,t,i,n=[(e=this.h).readUInt32BE(0),e.readUInt32BE(4),e.readUInt32BE(8),e.readUInt32BE(12)],s=[0,0,0,0],o=-1;++o<128;){for(!!(this.state[~~(o/8)]&1<<7-o%8)&&(s[0]^=n[0],s[1]^=n[1],s[2]^=n[2],s[3]^=n[3]),i=!!(1&n[3]),t=3;t>0;t--)n[t]=n[t]>>>1|(1&n[t-1])<<31;n[0]=n[0]>>>1,i&&(n[0]=n[0]^225<<24)}this.state=r(s)},o.prototype.update=function(e){var t;for(this.cache=n.concat([this.cache,e]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},o.prototype.final=function(e,t){return this.cache.length&&this.ghash(n.concat([this.cache,s],16)),this.ghash(r([0,e,0,t])),this.state},e.exports=o},56696(e){e.exports=function(e){for(var t,i=e.length;i--;){if(255!==(t=e.readUInt8(i))){t++,e.writeUInt8(t,i);break}e.writeUInt8(0,i)}}},53506(e,t,i){var n=i(10460);t.encrypt=function(e,t){var i=n(t,e._prev);return e._prev=e._cipher.encryptBlock(i),e._prev},t.decrypt=function(e,t){var i=e._prev;e._prev=t;var s=e._cipher.decryptBlock(t);return n(s,i)}},78530(e,t,i){var n=i(56608).Buffer,s=i(10460);function r(e,t,i){var r=t.length,o=s(t,e._cache);return e._cache=e._cache.slice(r),e._prev=n.concat([e._prev,i?t:o]),o}t.encrypt=function(e,t,i){for(var s,o=n.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=n.allocUnsafe(0)),!(e._cache.length<=t.length)){o=n.concat([o,r(e,t,i)]);break}s=e._cache.length,o=n.concat([o,r(e,t.slice(0,s),i)]),t=t.slice(s)}return o}},68394(e,t,i){var n=i(56608).Buffer;function s(e,t,i){for(var n,s,o=-1,a=0;++o<8;)n=t&1<<7-o?128:0,a+=(128&(s=e._cipher.encryptBlock(e._prev)[0]^n))>>o%8,e._prev=r(e._prev,i?n:s);return a}function r(e,t){var i=e.length,s=-1,r=n.allocUnsafe(e.length);for(e=n.concat([e,n.from([t])]);++s<i;)r[s]=e[s]<<1|e[s+1]>>7;return r}t.encrypt=function(e,t,i){for(var r=t.length,o=n.allocUnsafe(r),a=-1;++a<r;)o[a]=s(e,t[a],i);return o}},20193(e,t,i){var n=i(56608).Buffer;function s(e,t,i){var s=e._cipher.encryptBlock(e._prev)[0]^t;return e._prev=n.concat([e._prev.slice(1),n.from([i?t:s])]),s}t.encrypt=function(e,t,i){for(var r=t.length,o=n.allocUnsafe(r),a=-1;++a<r;)o[a]=s(e,t[a],i);return o}},5527(e,t,i){var n=i(10460),s=i(56608).Buffer,r=i(56696);function o(e){var t=e._cipher.encryptBlockRaw(e._prev);return r(e._prev),t}t.encrypt=function(e,t){var i=Math.ceil(t.length/16),r=e._cache.length;e._cache=s.concat([e._cache,s.allocUnsafe(16*i)]);for(var a=0;a<i;a++){var l=o(e),c=r+16*a;e._cache.writeUInt32BE(l[0],c+0),e._cache.writeUInt32BE(l[1],c+4),e._cache.writeUInt32BE(l[2],c+8),e._cache.writeUInt32BE(l[3],c+12)}var h=e._cache.slice(0,t.length);return e._cache=e._cache.slice(t.length),n(t,h)}},60882(e,t){t.encrypt=function(e,t){return e._cipher.encryptBlock(t)},t.decrypt=function(e,t){return e._cipher.decryptBlock(t)}},76200(e,t,i){var n={ECB:i(60882),CBC:i(53506),CFB:i(78530),CFB8:i(20193),CFB1:i(68394),OFB:i(37481),CTR:i(5527),GCM:i(5527)},s=i(25730);for(var r in s)s[r].module=n[s[r].mode];e.exports=s},37481(e,t,i){var n=i(10460);function s(e){return e._prev=e._cipher.encryptBlock(e._prev),e._prev}t.encrypt=function(e,t){for(;e._cache.length<t.length;)e._cache=Buffer.concat([e._cache,s(e)]);var i=e._cache.slice(0,t.length);return e._cache=e._cache.slice(t.length),n(t,i)}},58116(e,t,i){var n=i(87088),s=i(56608).Buffer,r=i(36334);function o(e,t,i,o){r.call(this),this._cipher=new n.AES(t),this._prev=s.from(i),this._cache=s.allocUnsafe(0),this._secCache=s.allocUnsafe(0),this._decrypt=o,this._mode=e}i(91193)(o,r),o.prototype._update=function(e){return this._mode.encrypt(this,e,this._decrypt)},o.prototype._final=function(){this._cipher.scrub()},e.exports=o},18350(e,t,i){var n=i(34487),s=i(15007),r=i(76200),o=i(13811),a=i(51804);function l(e,t,i){if(e=e.toLowerCase(),r[e])return s.createCipheriv(e,t,i);if(o[e])return new n({key:t,iv:i,mode:e});throw new TypeError("invalid suite type")}function c(e,t,i){if(e=e.toLowerCase(),r[e])return s.createDecipheriv(e,t,i);if(o[e])return new n({key:t,iv:i,mode:e,decrypt:!0});throw new TypeError("invalid suite type")}t.createCipher=t.Cipher=function(e,t){var i,n;if(e=e.toLowerCase(),r[e])i=r[e].key,n=r[e].iv;else{if(!o[e])throw new TypeError("invalid suite type");i=8*o[e].key,n=o[e].iv}var s=a(t,!1,i,n);return l(e,s.key,s.iv)},t.createCipheriv=t.Cipheriv=l,t.createDecipher=t.Decipher=function(e,t){var i,n;if(e=e.toLowerCase(),r[e])i=r[e].key,n=r[e].iv;else{if(!o[e])throw new TypeError("invalid suite type");i=8*o[e].key,n=o[e].iv}var s=a(t,!1,i,n);return c(e,s.key,s.iv)},t.createDecipheriv=t.Decipheriv=c,t.listCiphers=t.getCiphers=function(){return Object.keys(o).concat(s.getCiphers())}},34487(e,t,i){var n=i(36334),s=i(88754),r=i(91193),o=i(56608).Buffer,a={"des-ede3-cbc":s.CBC.instantiate(s.EDE),"des-ede3":s.EDE,"des-ede-cbc":s.CBC.instantiate(s.EDE),"des-ede":s.EDE,"des-cbc":s.CBC.instantiate(s.DES),"des-ecb":s.DES};function l(e){n.call(this);var t,i=e.mode.toLowerCase(),s=a[i];t=e.decrypt?"decrypt":"encrypt";var r=e.key;o.isBuffer(r)||(r=o.from(r)),"des-ede"!==i&&"des-ede-cbc"!==i||(r=o.concat([r,r.slice(0,8)]));var l=e.iv;o.isBuffer(l)||(l=o.from(l)),this._des=s.create({key:r,iv:l,type:t})}a.des=a["des-cbc"],a.des3=a["des-ede3-cbc"],e.exports=l,r(l,n),l.prototype._update=function(e){return o.from(this._des.update(e))},l.prototype._final=function(){return o.from(this._des.final())}},13811(e,t){t["des-ecb"]={key:8,iv:0},t["des-cbc"]=t.des={key:8,iv:8},t["des-ede3-cbc"]=t.des3={key:24,iv:8},t["des-ede3"]={key:24,iv:0},t["des-ede-cbc"]={key:16,iv:8},t["des-ede"]={key:16,iv:0}},38538(e,t,i){"use strict";var n=i(39286),s=i(82869),r=i(56608).Buffer;function o(e){var t,i=e.modulus.byteLength();do{t=new n(s(i))}while(t.cmp(e.modulus)>=0||!t.umod(e.prime1)||!t.umod(e.prime2));return t}function a(e,t){var i=function(e){var t=o(e);return{blinder:t.toRed(n.mont(e.modulus)).redPow(new n(e.publicExponent)).fromRed(),unblinder:t.invm(e.modulus)}}(t),s=t.modulus.byteLength(),a=new n(e).mul(i.blinder).umod(t.modulus),l=a.toRed(n.mont(t.prime1)),c=a.toRed(n.mont(t.prime2)),h=t.coefficient,u=t.prime1,d=t.prime2,p=l.redPow(t.exponent1).fromRed(),g=c.redPow(t.exponent2).fromRed(),f=p.isub(g).imul(h).umod(u).imul(d);return g.iadd(f).imul(i.unblinder).umod(t.modulus).toArrayLike(r,"be",s)}a.getr=o,e.exports=a},92761(e,t,i){"use strict";e.exports=i(8049)},80206(e,t,i){"use strict";var n=i(56608).Buffer,s=i(24984),r=i(9464),o=i(91193),a=i(76853),l=i(24757),c=i(8049);function h(e){r.Writable.call(this);var t=c[e];if(!t)throw new Error("Unknown message digest");this._hashType=t.hash,this._hash=s(t.hash),this._tag=t.id,this._signType=t.sign}function u(e){r.Writable.call(this);var t=c[e];if(!t)throw new Error("Unknown message digest");this._hash=s(t.hash),this._tag=t.id,this._signType=t.sign}function d(e){return new h(e)}function p(e){return new u(e)}Object.keys(c).forEach(function(e){c[e].id=n.from(c[e].id,"hex"),c[e.toLowerCase()]=c[e]}),o(h,r.Writable),h.prototype._write=function(e,t,i){this._hash.update(e),i()},h.prototype.update=function(e,t){return this._hash.update("string"==typeof e?n.from(e,t):e),this},h.prototype.sign=function(e,t){this.end();var i=this._hash.digest(),n=a(i,e,this._hashType,this._signType,this._tag);return t?n.toString(t):n},o(u,r.Writable),u.prototype._write=function(e,t,i){this._hash.update(e),i()},u.prototype.update=function(e,t){return this._hash.update("string"==typeof e?n.from(e,t):e),this},u.prototype.verify=function(e,t,i){var s="string"==typeof t?n.from(t,i):t;this.end();var r=this._hash.digest();return l(s,r,e,this._signType,this._tag)},e.exports={Sign:d,Verify:p,createSign:d,createVerify:p}},76853(e,t,i){"use strict";var n=i(56608).Buffer,s=i(33053),r=i(38538),o=i(23071).ec,a=i(39286),l=i(21973),c=i(32279);function h(e,t,i,r){if((e=n.from(e.toArray())).length<t.byteLength()){var o=n.alloc(t.byteLength()-e.length);e=n.concat([o,e])}var a=i.length,l=function(e,t){e=(e=u(e,t)).mod(t);var i=n.from(e.toArray());if(i.length<t.byteLength()){var s=n.alloc(t.byteLength()-i.length);i=n.concat([s,i])}return i}(i,t),c=n.alloc(a);c.fill(1);var h=n.alloc(a);return h=s(r,h).update(c).update(n.from([0])).update(e).update(l).digest(),c=s(r,h).update(c).digest(),{k:h=s(r,h).update(c).update(n.from([1])).update(e).update(l).digest(),v:c=s(r,h).update(c).digest()}}function u(e,t){var i=new a(e),n=(e.length<<3)-t.bitLength();return n>0&&i.ishrn(n),i}function d(e,t,i){var r,o;do{for(r=n.alloc(0);8*r.length<e.bitLength();)t.v=s(i,t.k).update(t.v).digest(),r=n.concat([r,t.v]);o=u(r,e),t.k=s(i,t.k).update(t.v).update(n.from([0])).digest(),t.v=s(i,t.k).update(t.v).digest()}while(-1!==o.cmp(e));return o}function p(e,t,i,n){return e.toRed(a.mont(i)).redPow(t).fromRed().mod(n)}e.exports=function(e,t,i,s,g){var f=l(t);if(f.curve){if("ecdsa"!==s&&"ecdsa/rsa"!==s)throw new Error("wrong private key type");return function(e,t){var i=c[t.curve.join(".")];if(!i)throw new Error("unknown curve "+t.curve.join("."));var s=new o(i).keyFromPrivate(t.privateKey).sign(e);return n.from(s.toDER())}(e,f)}if("dsa"===f.type){if("dsa"!==s)throw new Error("wrong private key type");return function(e,t,i){for(var s,r=t.params.priv_key,o=t.params.p,l=t.params.q,c=t.params.g,g=new a(0),f=u(e,l).mod(l),m=!1,y=h(r,l,e,i);!1===m;)g=p(c,s=d(l,y,i),o,l),0===(m=s.invm(l).imul(f.add(r.mul(g))).mod(l)).cmpn(0)&&(m=!1,g=new a(0));return function(e,t){e=e.toArray(),t=t.toArray(),128&e[0]&&(e=[0].concat(e)),128&t[0]&&(t=[0].concat(t));var i=[48,e.length+t.length+4,2,e.length];return i=i.concat(e,[2,t.length],t),n.from(i)}(g,m)}(e,f,i)}if("rsa"!==s&&"ecdsa/rsa"!==s)throw new Error("wrong private key type");if(void 0!==t.padding&&1!==t.padding)throw new Error("illegal or unsupported padding mode");e=n.concat([g,e]);for(var m=f.modulus.byteLength(),y=[0,1];e.length+y.length+1<m;)y.push(255);y.push(0);for(var v=-1;++v<e.length;)y.push(e[v]);return r(y,f)},e.exports.getKey=h,e.exports.makeKey=d},24757(e,t,i){"use strict";var n=i(56608).Buffer,s=i(39286),r=i(23071).ec,o=i(21973),a=i(32279);function l(e,t){if(e.cmpn(0)<=0)throw new Error("invalid sig");if(e.cmp(t)>=0)throw new Error("invalid sig")}e.exports=function(e,t,i,c,h){var u=o(i);if("ec"===u.type){if("ecdsa"!==c&&"ecdsa/rsa"!==c)throw new Error("wrong public key type");return function(e,t,i){var n=a[i.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+i.data.algorithm.curve.join("."));var s=new r(n),o=i.data.subjectPrivateKey.data;return s.verify(t,e,o)}(e,t,u)}if("dsa"===u.type){if("dsa"!==c)throw new Error("wrong public key type");return function(e,t,i){var n=i.data.p,r=i.data.q,a=i.data.g,c=i.data.pub_key,h=o.signature.decode(e,"der"),u=h.s,d=h.r;l(u,r),l(d,r);var p=s.mont(n),g=u.invm(r);return 0===a.toRed(p).redPow(new s(t).mul(g).mod(r)).fromRed().mul(c.toRed(p).redPow(d.mul(g).mod(r)).fromRed()).mod(n).mod(r).cmp(d)}(e,t,u)}if("rsa"!==c&&"ecdsa/rsa"!==c)throw new Error("wrong public key type");t=n.concat([h,t]);for(var d=u.modulus.byteLength(),p=[1],g=0;t.length+p.length+2<d;)p.push(255),g+=1;p.push(0);for(var f=-1;++f<t.length;)p.push(t[f]);p=n.from(p);var m=s.mont(u.modulus);e=(e=new s(e).toRed(m)).redPow(new s(u.publicExponent)),e=n.from(e.fromRed().toArray());var y=g<8?1:0;for(d=Math.min(e.length,p.length),e.length!==p.length&&(y=1),f=-1;++f<d;)y|=e[f]^p[f];return 0===y}},10460(e){e.exports=function(e,t){for(var i=Math.min(e.length,t.length),n=new Buffer(i),s=0;s<i;++s)n[s]=e[s]^t[s];return n}},74380(e,t,i){"use strict";var n=i(84933),s=i(63328),r=i(85101);function o(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(e,t){if(o()<t)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=l.prototype:(null===e&&(e=new l(t)),e.length=t),e}function l(e,t,i){if(!(l.TYPED_ARRAY_SUPPORT||this instanceof l))return new l(e,t,i);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return u(this,e)}return c(this,e,t,i)}function c(e,t,i,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,i,n){if(t.byteLength,i<0||t.byteLength<i)throw new RangeError("'offset' is out of bounds");if(t.byteLength<i+(n||0))throw new RangeError("'length' is out of bounds");return t=void 0===i&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,i):new Uint8Array(t,i,n),l.TYPED_ARRAY_SUPPORT?(e=t).__proto__=l.prototype:e=d(e,t),e}(e,t,i,n):"string"==typeof t?function(e,t,i){if("string"==typeof i&&""!==i||(i="utf8"),!l.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var n=0|g(t,i),s=(e=a(e,n)).write(t,i);return s!==n&&(e=e.slice(0,s)),e}(e,t,i):function(e,t){if(l.isBuffer(t)){var i=0|p(t.length);return 0===(e=a(e,i)).length||t.copy(e,0,0,i),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?a(e,0):d(e,t);if("Buffer"===t.type&&r(t.data))return d(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function h(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function u(e,t){if(h(t),e=a(e,t<0?0:0|p(t)),!l.TYPED_ARRAY_SUPPORT)for(var i=0;i<t;++i)e[i]=0;return e}function d(e,t){var i=t.length<0?0:0|p(t.length);e=a(e,i);for(var n=0;n<i;n+=1)e[n]=255&t[n];return e}function p(e){if(e>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function g(e,t){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var i=e.length;if(0===i)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return U(e).length;default:if(n)return H(e).length;t=(""+t).toLowerCase(),n=!0}}function f(e,t,i){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,i);case"utf8":case"utf-8":return M(this,t,i);case"ascii":return D(this,t,i);case"latin1":case"binary":return I(this,t,i);case"base64":return A(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,i);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function m(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function y(e,t,i,n,s){if(0===e.length)return-1;if("string"==typeof i?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=s?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(s)return-1;i=e.length-1}else if(i<0){if(!s)return-1;i=0}if("string"==typeof t&&(t=l.from(t,n)),l.isBuffer(t))return 0===t.length?-1:v(e,t,i,n,s);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?s?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):v(e,[t],i,n,s);throw new TypeError("val must be string, number or Buffer")}function v(e,t,i,n,s){var r,o=1,a=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,a/=2,l/=2,i/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(s){var h=-1;for(r=i;r<a;r++)if(c(e,r)===c(t,-1===h?0:r-h)){if(-1===h&&(h=r),r-h+1===l)return h*o}else-1!==h&&(r-=r-h),h=-1}else for(i+l>a&&(i=a-l),r=i;r>=0;r--){for(var u=!0,d=0;d<l;d++)if(c(e,r+d)!==c(t,d)){u=!1;break}if(u)return r}return-1}function b(e,t,i,n){i=Number(i)||0;var s=e.length-i;n?(n=Number(n))>s&&(n=s):n=s;var r=t.length;if(r%2!=0)throw new TypeError("Invalid hex string");n>r/2&&(n=r/2);for(var o=0;o<n;++o){var a=parseInt(t.substr(2*o,2),16);if(isNaN(a))return o;e[i+o]=a}return o}function C(e,t,i,n){return z(H(t,e.length-i),e,i,n)}function w(e,t,i,n){return z(function(e){for(var t=[],i=0;i<e.length;++i)t.push(255&e.charCodeAt(i));return t}(t),e,i,n)}function S(e,t,i,n){return w(e,t,i,n)}function x(e,t,i,n){return z(U(t),e,i,n)}function E(e,t,i,n){return z(function(e,t){for(var i,n,s,r=[],o=0;o<e.length&&!((t-=2)<0);++o)n=(i=e.charCodeAt(o))>>8,s=i%256,r.push(s),r.push(n);return r}(t,e.length-i),e,i,n)}function A(e,t,i){return 0===t&&i===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,i))}function M(e,t,i){i=Math.min(e.length,i);for(var n=[],s=t;s<i;){var r,o,a,l,c=e[s],h=null,u=c>239?4:c>223?3:c>191?2:1;if(s+u<=i)switch(u){case 1:c<128&&(h=c);break;case 2:128==(192&(r=e[s+1]))&&(l=(31&c)<<6|63&r)>127&&(h=l);break;case 3:r=e[s+1],o=e[s+2],128==(192&r)&&128==(192&o)&&(l=(15&c)<<12|(63&r)<<6|63&o)>2047&&(l<55296||l>57343)&&(h=l);break;case 4:r=e[s+1],o=e[s+2],a=e[s+3],128==(192&r)&&128==(192&o)&&128==(192&a)&&(l=(15&c)<<18|(63&r)<<12|(63&o)<<6|63&a)>65535&&l<1114112&&(h=l)}null===h?(h=65533,u=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),s+=u}return function(e){var t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);for(var i="",n=0;n<t;)i+=String.fromCharCode.apply(String,e.slice(n,n+=T));return i}(n)}t.hp=l,t.IS=50,l.TYPED_ARRAY_SUPPORT=void 0!==globalThis.TYPED_ARRAY_SUPPORT?globalThis.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),o(),l.poolSize=8192,l._augment=function(e){return e.__proto__=l.prototype,e},l.from=function(e,t,i){return c(null,e,t,i)},l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0})),l.alloc=function(e,t,i){return function(e,t,i,n){return h(t),t<=0?a(e,t):void 0!==i?"string"==typeof n?a(e,t).fill(i,n):a(e,t).fill(i):a(e,t)}(null,e,t,i)},l.allocUnsafe=function(e){return u(null,e)},l.allocUnsafeSlow=function(e){return u(null,e)},l.isBuffer=function(e){return!(null==e||!e._isBuffer)},l.compare=function(e,t){if(!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var i=e.length,n=t.length,s=0,r=Math.min(i,n);s<r;++s)if(e[s]!==t[s]){i=e[s],n=t[s];break}return i<n?-1:n<i?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!r(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);var i;if(void 0===t)for(t=0,i=0;i<e.length;++i)t+=e[i].length;var n=l.allocUnsafe(t),s=0;for(i=0;i<e.length;++i){var o=e[i];if(!l.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,s),s+=o.length}return n},l.byteLength=g,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},l.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},l.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},l.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?M(this,0,e):f.apply(this,arguments)},l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){var e="",i=t.IS;return this.length>0&&(e=this.toString("hex",0,i).match(/.{2}/g).join(" "),this.length>i&&(e+=" ... ")),"<Buffer "+e+">"},l.prototype.compare=function(e,t,i,n,s){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===i&&(i=e?e.length:0),void 0===n&&(n=0),void 0===s&&(s=this.length),t<0||i>e.length||n<0||s>this.length)throw new RangeError("out of range index");if(n>=s&&t>=i)return 0;if(n>=s)return-1;if(t>=i)return 1;if(this===e)return 0;for(var r=(s>>>=0)-(n>>>=0),o=(i>>>=0)-(t>>>=0),a=Math.min(r,o),c=this.slice(n,s),h=e.slice(t,i),u=0;u<a;++u)if(c[u]!==h[u]){r=c[u],o=h[u];break}return r<o?-1:o<r?1:0},l.prototype.includes=function(e,t,i){return-1!==this.indexOf(e,t,i)},l.prototype.indexOf=function(e,t,i){return y(this,e,t,i,!0)},l.prototype.lastIndexOf=function(e,t,i){return y(this,e,t,i,!1)},l.prototype.write=function(e,t,i,n){if(void 0===t)n="utf8",i=this.length,t=0;else if(void 0===i&&"string"==typeof t)n=t,i=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(i)?(i|=0,void 0===n&&(n="utf8")):(n=i,i=void 0)}var s=this.length-t;if((void 0===i||i>s)&&(i=s),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var r=!1;;)switch(n){case"hex":return b(this,e,t,i);case"utf8":case"utf-8":return C(this,e,t,i);case"ascii":return w(this,e,t,i);case"latin1":case"binary":return S(this,e,t,i);case"base64":return x(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,i);default:if(r)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),r=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var T=4096;function D(e,t,i){var n="";i=Math.min(e.length,i);for(var s=t;s<i;++s)n+=String.fromCharCode(127&e[s]);return n}function I(e,t,i){var n="";i=Math.min(e.length,i);for(var s=t;s<i;++s)n+=String.fromCharCode(e[s]);return n}function R(e,t,i){var n=e.length;(!t||t<0)&&(t=0),(!i||i<0||i>n)&&(i=n);for(var s="",r=t;r<i;++r)s+=V(e[r]);return s}function k(e,t,i){for(var n=e.slice(t,i),s="",r=0;r<n.length;r+=2)s+=String.fromCharCode(n[r]+256*n[r+1]);return s}function P(e,t,i){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>i)throw new RangeError("Trying to access beyond buffer length")}function _(e,t,i,n,s,r){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>s||t<r)throw new RangeError('"value" argument is out of bounds');if(i+n>e.length)throw new RangeError("Index out of range")}function L(e,t,i,n){t<0&&(t=65535+t+1);for(var s=0,r=Math.min(e.length-i,2);s<r;++s)e[i+s]=(t&255<<8*(n?s:1-s))>>>8*(n?s:1-s)}function N(e,t,i,n){t<0&&(t=4294967295+t+1);for(var s=0,r=Math.min(e.length-i,4);s<r;++s)e[i+s]=t>>>8*(n?s:3-s)&255}function O(e,t,i,n,s,r){if(i+n>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function F(e,t,i,n,r){return r||O(e,0,i,4),s.write(e,t,i,n,23,4),i+4}function G(e,t,i,n,r){return r||O(e,0,i,8),s.write(e,t,i,n,52,8),i+8}l.prototype.slice=function(e,t){var i,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),l.TYPED_ARRAY_SUPPORT)(i=this.subarray(e,t)).__proto__=l.prototype;else{var s=t-e;i=new l(s,void 0);for(var r=0;r<s;++r)i[r]=this[r+e]}return i},l.prototype.readUIntLE=function(e,t,i){e|=0,t|=0,i||P(e,t,this.length);for(var n=this[e],s=1,r=0;++r<t&&(s*=256);)n+=this[e+r]*s;return n},l.prototype.readUIntBE=function(e,t,i){e|=0,t|=0,i||P(e,t,this.length);for(var n=this[e+--t],s=1;t>0&&(s*=256);)n+=this[e+--t]*s;return n},l.prototype.readUInt8=function(e,t){return t||P(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||P(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||P(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,i){e|=0,t|=0,i||P(e,t,this.length);for(var n=this[e],s=1,r=0;++r<t&&(s*=256);)n+=this[e+r]*s;return n>=(s*=128)&&(n-=Math.pow(2,8*t)),n},l.prototype.readIntBE=function(e,t,i){e|=0,t|=0,i||P(e,t,this.length);for(var n=t,s=1,r=this[e+--n];n>0&&(s*=256);)r+=this[e+--n]*s;return r>=(s*=128)&&(r-=Math.pow(2,8*t)),r},l.prototype.readInt8=function(e,t){return t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||P(e,2,this.length);var i=this[e]|this[e+1]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt16BE=function(e,t){t||P(e,2,this.length);var i=this[e+1]|this[e]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt32LE=function(e,t){return t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return t||P(e,4,this.length),s.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||P(e,4,this.length),s.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||P(e,8,this.length),s.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||P(e,8,this.length),s.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,i,n){e=+e,t|=0,i|=0,n||_(this,e,t,i,Math.pow(2,8*i)-1,0);var s=1,r=0;for(this[t]=255&e;++r<i&&(s*=256);)this[t+r]=e/s&255;return t+i},l.prototype.writeUIntBE=function(e,t,i,n){e=+e,t|=0,i|=0,n||_(this,e,t,i,Math.pow(2,8*i)-1,0);var s=i-1,r=1;for(this[t+s]=255&e;--s>=0&&(r*=256);)this[t+s]=e/r&255;return t+i},l.prototype.writeUInt8=function(e,t,i){return e=+e,t|=0,i||_(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,i){return e=+e,t|=0,i||_(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):L(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,i){return e=+e,t|=0,i||_(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):L(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,i){return e=+e,t|=0,i||_(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):N(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,i){return e=+e,t|=0,i||_(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,i,n){if(e=+e,t|=0,!n){var s=Math.pow(2,8*i-1);_(this,e,t,i,s-1,-s)}var r=0,o=1,a=0;for(this[t]=255&e;++r<i&&(o*=256);)e<0&&0===a&&0!==this[t+r-1]&&(a=1),this[t+r]=(e/o|0)-a&255;return t+i},l.prototype.writeIntBE=function(e,t,i,n){if(e=+e,t|=0,!n){var s=Math.pow(2,8*i-1);_(this,e,t,i,s-1,-s)}var r=i-1,o=1,a=0;for(this[t+r]=255&e;--r>=0&&(o*=256);)e<0&&0===a&&0!==this[t+r+1]&&(a=1),this[t+r]=(e/o|0)-a&255;return t+i},l.prototype.writeInt8=function(e,t,i){return e=+e,t|=0,i||_(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,i){return e=+e,t|=0,i||_(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):L(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,i){return e=+e,t|=0,i||_(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):L(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,i){return e=+e,t|=0,i||_(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):N(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,i){return e=+e,t|=0,i||_(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,i){return F(this,e,t,!0,i)},l.prototype.writeFloatBE=function(e,t,i){return F(this,e,t,!1,i)},l.prototype.writeDoubleLE=function(e,t,i){return G(this,e,t,!0,i)},l.prototype.writeDoubleBE=function(e,t,i){return G(this,e,t,!1,i)},l.prototype.copy=function(e,t,i,n){if(i||(i=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<i&&(n=i),n===i)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-i&&(n=e.length-t+i);var s,r=n-i;if(this===e&&i<t&&t<n)for(s=r-1;s>=0;--s)e[s+t]=this[s+i];else if(r<1e3||!l.TYPED_ARRAY_SUPPORT)for(s=0;s<r;++s)e[s+t]=this[s+i];else Uint8Array.prototype.set.call(e,this.subarray(i,i+r),t);return r},l.prototype.fill=function(e,t,i,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,i=this.length):"string"==typeof i&&(n=i,i=this.length),1===e.length){var s=e.charCodeAt(0);s<256&&(e=s)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!l.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;var r;if(t>>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"==typeof e)for(r=t;r<i;++r)this[r]=e;else{var o=l.isBuffer(e)?e:H(new l(e,n).toString()),a=o.length;for(r=0;r<i-t;++r)this[r+t]=o[r%a]}return this};var B=/[^+\/0-9A-Za-z-_]/g;function V(e){return e<16?"0"+e.toString(16):e.toString(16)}function H(e,t){var i;t=t||1/0;for(var n=e.length,s=null,r=[],o=0;o<n;++o){if((i=e.charCodeAt(o))>55295&&i<57344){if(!s){if(i>56319){(t-=3)>-1&&r.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&r.push(239,191,189);continue}s=i;continue}if(i<56320){(t-=3)>-1&&r.push(239,191,189),s=i;continue}i=65536+(s-55296<<10|i-56320)}else s&&(t-=3)>-1&&r.push(239,191,189);if(s=null,i<128){if((t-=1)<0)break;r.push(i)}else if(i<2048){if((t-=2)<0)break;r.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;r.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;r.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return r}function U(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(B,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function z(e,t,i,n){for(var s=0;s<n&&!(s+i>=t.length||s>=e.length);++s)t[s+i]=e[s];return s}},77511(e,t,i){"use strict";var n=i(84933),s=i(63328),r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=l,t.SlowBuffer=function(e){return+e!=e&&(e=0),l.alloc(+e)},t.INSPECT_MAX_BYTES=50;var o=2147483647;function a(e){if(e>o)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,i){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return u(e)}return c(e,t,i)}function c(e,t,i){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var i=0|f(e,t),n=a(i),s=n.write(e,t);return s!==i&&(n=n.slice(0,s)),n}(e,t);if(ArrayBuffer.isView(e))return d(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(U(e,ArrayBuffer)||e&&U(e.buffer,ArrayBuffer))return p(e,t,i);if("undefined"!=typeof SharedArrayBuffer&&(U(e,SharedArrayBuffer)||e&&U(e.buffer,SharedArrayBuffer)))return p(e,t,i);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return l.from(n,t,i);var s=function(e){if(l.isBuffer(e)){var t=0|g(e.length),i=a(t);return 0===i.length||e.copy(i,0,0,t),i}return void 0!==e.length?"number"!=typeof e.length||z(e.length)?a(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(s)return s;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function h(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return h(e),a(e<0?0:0|g(e))}function d(e){for(var t=e.length<0?0:0|g(e.length),i=a(t),n=0;n<t;n+=1)i[n]=255&e[n];return i}function p(e,t,i){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(i||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===t&&void 0===i?new Uint8Array(e):void 0===i?new Uint8Array(e,t):new Uint8Array(e,t,i),Object.setPrototypeOf(n,l.prototype),n}function g(e){if(e>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function f(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||U(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var i=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===i)return 0;for(var s=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return B(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return V(e).length;default:if(s)return n?-1:B(e).length;t=(""+t).toLowerCase(),s=!0}}function m(e,t,i){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return k(this,t,i);case"utf8":case"utf-8":return T(this,t,i);case"ascii":return I(this,t,i);case"latin1":case"binary":return R(this,t,i);case"base64":return M(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,i);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function y(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function v(e,t,i,n,s){if(0===e.length)return-1;if("string"==typeof i?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),z(i=+i)&&(i=s?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(s)return-1;i=e.length-1}else if(i<0){if(!s)return-1;i=0}if("string"==typeof t&&(t=l.from(t,n)),l.isBuffer(t))return 0===t.length?-1:b(e,t,i,n,s);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?s?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):b(e,[t],i,n,s);throw new TypeError("val must be string, number or Buffer")}function b(e,t,i,n,s){var r,o=1,a=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,a/=2,l/=2,i/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(s){var h=-1;for(r=i;r<a;r++)if(c(e,r)===c(t,-1===h?0:r-h)){if(-1===h&&(h=r),r-h+1===l)return h*o}else-1!==h&&(r-=r-h),h=-1}else for(i+l>a&&(i=a-l),r=i;r>=0;r--){for(var u=!0,d=0;d<l;d++)if(c(e,r+d)!==c(t,d)){u=!1;break}if(u)return r}return-1}function C(e,t,i,n){i=Number(i)||0;var s=e.length-i;n?(n=Number(n))>s&&(n=s):n=s;var r=t.length;n>r/2&&(n=r/2);for(var o=0;o<n;++o){var a=parseInt(t.substr(2*o,2),16);if(z(a))return o;e[i+o]=a}return o}function w(e,t,i,n){return H(B(t,e.length-i),e,i,n)}function S(e,t,i,n){return H(function(e){for(var t=[],i=0;i<e.length;++i)t.push(255&e.charCodeAt(i));return t}(t),e,i,n)}function x(e,t,i,n){return S(e,t,i,n)}function E(e,t,i,n){return H(V(t),e,i,n)}function A(e,t,i,n){return H(function(e,t){for(var i,n,s,r=[],o=0;o<e.length&&!((t-=2)<0);++o)n=(i=e.charCodeAt(o))>>8,s=i%256,r.push(s),r.push(n);return r}(t,e.length-i),e,i,n)}function M(e,t,i){return 0===t&&i===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,i))}function T(e,t,i){i=Math.min(e.length,i);for(var n=[],s=t;s<i;){var r,o,a,l,c=e[s],h=null,u=c>239?4:c>223?3:c>191?2:1;if(s+u<=i)switch(u){case 1:c<128&&(h=c);break;case 2:128==(192&(r=e[s+1]))&&(l=(31&c)<<6|63&r)>127&&(h=l);break;case 3:r=e[s+1],o=e[s+2],128==(192&r)&&128==(192&o)&&(l=(15&c)<<12|(63&r)<<6|63&o)>2047&&(l<55296||l>57343)&&(h=l);break;case 4:r=e[s+1],o=e[s+2],a=e[s+3],128==(192&r)&&128==(192&o)&&128==(192&a)&&(l=(15&c)<<18|(63&r)<<12|(63&o)<<6|63&a)>65535&&l<1114112&&(h=l)}null===h?(h=65533,u=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),s+=u}return function(e){var t=e.length;if(t<=D)return String.fromCharCode.apply(String,e);for(var i="",n=0;n<t;)i+=String.fromCharCode.apply(String,e.slice(n,n+=D));return i}(n)}t.kMaxLength=o,l.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),l.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(e,t,i){return c(e,t,i)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(e,t,i){return function(e,t,i){return h(e),e<=0?a(e):void 0!==t?"string"==typeof i?a(e).fill(t,i):a(e).fill(t):a(e)}(e,t,i)},l.allocUnsafe=function(e){return u(e)},l.allocUnsafeSlow=function(e){return u(e)},l.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==l.prototype},l.compare=function(e,t){if(U(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),U(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var i=e.length,n=t.length,s=0,r=Math.min(i,n);s<r;++s)if(e[s]!==t[s]){i=e[s],n=t[s];break}return i<n?-1:n<i?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);var i;if(void 0===t)for(t=0,i=0;i<e.length;++i)t+=e[i].length;var n=l.allocUnsafe(t),s=0;for(i=0;i<e.length;++i){var r=e[i];if(U(r,Uint8Array)&&(r=l.from(r)),!l.isBuffer(r))throw new TypeError('"list" argument must be an Array of Buffers');r.copy(n,s),s+=r.length}return n},l.byteLength=f,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)y(this,t,t+1);return this},l.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},l.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},l.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?T(this,0,e):m.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){var e="",i=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(e+=" ... "),"<Buffer "+e+">"},r&&(l.prototype[r]=l.prototype.inspect),l.prototype.compare=function(e,t,i,n,s){if(U(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===i&&(i=e?e.length:0),void 0===n&&(n=0),void 0===s&&(s=this.length),t<0||i>e.length||n<0||s>this.length)throw new RangeError("out of range index");if(n>=s&&t>=i)return 0;if(n>=s)return-1;if(t>=i)return 1;if(this===e)return 0;for(var r=(s>>>=0)-(n>>>=0),o=(i>>>=0)-(t>>>=0),a=Math.min(r,o),c=this.slice(n,s),h=e.slice(t,i),u=0;u<a;++u)if(c[u]!==h[u]){r=c[u],o=h[u];break}return r<o?-1:o<r?1:0},l.prototype.includes=function(e,t,i){return-1!==this.indexOf(e,t,i)},l.prototype.indexOf=function(e,t,i){return v(this,e,t,i,!0)},l.prototype.lastIndexOf=function(e,t,i){return v(this,e,t,i,!1)},l.prototype.write=function(e,t,i,n){if(void 0===t)n="utf8",i=this.length,t=0;else if(void 0===i&&"string"==typeof t)n=t,i=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(i)?(i>>>=0,void 0===n&&(n="utf8")):(n=i,i=void 0)}var s=this.length-t;if((void 0===i||i>s)&&(i=s),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var r=!1;;)switch(n){case"hex":return C(this,e,t,i);case"utf8":case"utf-8":return w(this,e,t,i);case"ascii":return S(this,e,t,i);case"latin1":case"binary":return x(this,e,t,i);case"base64":return E(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,i);default:if(r)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),r=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var D=4096;function I(e,t,i){var n="";i=Math.min(e.length,i);for(var s=t;s<i;++s)n+=String.fromCharCode(127&e[s]);return n}function R(e,t,i){var n="";i=Math.min(e.length,i);for(var s=t;s<i;++s)n+=String.fromCharCode(e[s]);return n}function k(e,t,i){var n=e.length;(!t||t<0)&&(t=0),(!i||i<0||i>n)&&(i=n);for(var s="",r=t;r<i;++r)s+=W[e[r]];return s}function P(e,t,i){for(var n=e.slice(t,i),s="",r=0;r<n.length;r+=2)s+=String.fromCharCode(n[r]+256*n[r+1]);return s}function _(e,t,i){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>i)throw new RangeError("Trying to access beyond buffer length")}function L(e,t,i,n,s,r){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>s||t<r)throw new RangeError('"value" argument is out of bounds');if(i+n>e.length)throw new RangeError("Index out of range")}function N(e,t,i,n,s,r){if(i+n>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function O(e,t,i,n,r){return t=+t,i>>>=0,r||N(e,0,i,4),s.write(e,t,i,n,23,4),i+4}function F(e,t,i,n,r){return t=+t,i>>>=0,r||N(e,0,i,8),s.write(e,t,i,n,52,8),i+8}l.prototype.slice=function(e,t){var i=this.length;(e=~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),(t=void 0===t?i:~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,l.prototype),n},l.prototype.readUIntLE=function(e,t,i){e>>>=0,t>>>=0,i||_(e,t,this.length);for(var n=this[e],s=1,r=0;++r<t&&(s*=256);)n+=this[e+r]*s;return n},l.prototype.readUIntBE=function(e,t,i){e>>>=0,t>>>=0,i||_(e,t,this.length);for(var n=this[e+--t],s=1;t>0&&(s*=256);)n+=this[e+--t]*s;return n},l.prototype.readUInt8=function(e,t){return e>>>=0,t||_(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||_(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||_(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||_(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||_(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,i){e>>>=0,t>>>=0,i||_(e,t,this.length);for(var n=this[e],s=1,r=0;++r<t&&(s*=256);)n+=this[e+r]*s;return n>=(s*=128)&&(n-=Math.pow(2,8*t)),n},l.prototype.readIntBE=function(e,t,i){e>>>=0,t>>>=0,i||_(e,t,this.length);for(var n=t,s=1,r=this[e+--n];n>0&&(s*=256);)r+=this[e+--n]*s;return r>=(s*=128)&&(r-=Math.pow(2,8*t)),r},l.prototype.readInt8=function(e,t){return e>>>=0,t||_(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||_(e,2,this.length);var i=this[e]|this[e+1]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt16BE=function(e,t){e>>>=0,t||_(e,2,this.length);var i=this[e+1]|this[e]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||_(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||_(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return e>>>=0,t||_(e,4,this.length),s.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||_(e,4,this.length),s.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||_(e,8,this.length),s.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||_(e,8,this.length),s.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,i,n){e=+e,t>>>=0,i>>>=0,n||L(this,e,t,i,Math.pow(2,8*i)-1,0);var s=1,r=0;for(this[t]=255&e;++r<i&&(s*=256);)this[t+r]=e/s&255;return t+i},l.prototype.writeUIntBE=function(e,t,i,n){e=+e,t>>>=0,i>>>=0,n||L(this,e,t,i,Math.pow(2,8*i)-1,0);var s=i-1,r=1;for(this[t+s]=255&e;--s>=0&&(r*=256);)this[t+s]=e/r&255;return t+i},l.prototype.writeUInt8=function(e,t,i){return e=+e,t>>>=0,i||L(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,i){return e=+e,t>>>=0,i||L(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUInt16BE=function(e,t,i){return e=+e,t>>>=0,i||L(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUInt32LE=function(e,t,i){return e=+e,t>>>=0,i||L(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUInt32BE=function(e,t,i){return e=+e,t>>>=0,i||L(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeIntLE=function(e,t,i,n){if(e=+e,t>>>=0,!n){var s=Math.pow(2,8*i-1);L(this,e,t,i,s-1,-s)}var r=0,o=1,a=0;for(this[t]=255&e;++r<i&&(o*=256);)e<0&&0===a&&0!==this[t+r-1]&&(a=1),this[t+r]=(e/o|0)-a&255;return t+i},l.prototype.writeIntBE=function(e,t,i,n){if(e=+e,t>>>=0,!n){var s=Math.pow(2,8*i-1);L(this,e,t,i,s-1,-s)}var r=i-1,o=1,a=0;for(this[t+r]=255&e;--r>=0&&(o*=256);)e<0&&0===a&&0!==this[t+r+1]&&(a=1),this[t+r]=(e/o|0)-a&255;return t+i},l.prototype.writeInt8=function(e,t,i){return e=+e,t>>>=0,i||L(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,i){return e=+e,t>>>=0,i||L(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,i){return e=+e,t>>>=0,i||L(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,i){return e=+e,t>>>=0,i||L(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,i){return e=+e,t>>>=0,i||L(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeFloatLE=function(e,t,i){return O(this,e,t,!0,i)},l.prototype.writeFloatBE=function(e,t,i){return O(this,e,t,!1,i)},l.prototype.writeDoubleLE=function(e,t,i){return F(this,e,t,!0,i)},l.prototype.writeDoubleBE=function(e,t,i){return F(this,e,t,!1,i)},l.prototype.copy=function(e,t,i,n){if(!l.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<i&&(n=i),n===i)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-i&&(n=e.length-t+i);var s=n-i;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,i,n);else if(this===e&&i<t&&t<n)for(var r=s-1;r>=0;--r)e[r+t]=this[r+i];else Uint8Array.prototype.set.call(e,this.subarray(i,n),t);return s},l.prototype.fill=function(e,t,i,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,i=this.length):"string"==typeof i&&(n=i,i=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!l.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var s=e.charCodeAt(0);("utf8"===n&&s<128||"latin1"===n)&&(e=s)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;var r;if(t>>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"==typeof e)for(r=t;r<i;++r)this[r]=e;else{var o=l.isBuffer(e)?e:l.from(e,n),a=o.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(r=0;r<i-t;++r)this[r+t]=o[r%a]}return this};var G=/[^+/0-9A-Za-z-_]/g;function B(e,t){var i;t=t||1/0;for(var n=e.length,s=null,r=[],o=0;o<n;++o){if((i=e.charCodeAt(o))>55295&&i<57344){if(!s){if(i>56319){(t-=3)>-1&&r.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&r.push(239,191,189);continue}s=i;continue}if(i<56320){(t-=3)>-1&&r.push(239,191,189),s=i;continue}i=65536+(s-55296<<10|i-56320)}else s&&(t-=3)>-1&&r.push(239,191,189);if(s=null,i<128){if((t-=1)<0)break;r.push(i)}else if(i<2048){if((t-=2)<0)break;r.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;r.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;r.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return r}function V(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(G,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function H(e,t,i,n){for(var s=0;s<n&&!(s+i>=t.length||s>=e.length);++s)t[s+i]=e[s];return s}function U(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function z(e){return e!=e}var W=function(){for(var e="0123456789abcdef",t=new Array(256),i=0;i<16;++i)for(var n=16*i,s=0;s<16;++s)t[n+s]=e[i]+e[s];return t}()},97785(e,t,i){"use strict";var n=i(79524),s=i(64811),r=i(46255),o=i(12728);e.exports=o||n.call(r,s)},96440(e,t,i){"use strict";var n=i(79524),s=i(64811),r=i(97785);e.exports=function(){return r(n,s,arguments)}},64811(e){"use strict";e.exports=Function.prototype.apply},46255(e){"use strict";e.exports=Function.prototype.call},92427(e,t,i){"use strict";var n=i(79524),s=i(71102),r=i(46255),o=i(97785);e.exports=function(e){if(e.length<1||"function"!=typeof e[0])throw new s("a function is required");return o(n,r,e)}},12728(e){"use strict";e.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},6902(e,t,i){"use strict";var n=i(7755),s=i(39886),r=i(92427),o=i(96440);e.exports=function(e){var t=r(arguments),i=1+e.length-(arguments.length-1);return n(t,i>0?i:0,!0)},s?s(e.exports,"apply",{value:o}):e.exports.apply=o},98801(e,t,i){"use strict";var n=i(49336),s=i(92427),r=s([n("%String.prototype.indexOf%")]);e.exports=function(e,t){var i=n(e,!!t);return"function"==typeof i&&r(e,".prototype.")>-1?s([i]):i}},36334(e,t,i){"use strict";var n=i(56608).Buffer,s=i(66096).Transform,r=i(86704).I,o=i(91193),a=i(26919);function l(e){s.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}o(l,s),l.prototype.update=function(e,t,i){var n=a(e,t),s=this._update(n);return this.hashMode?this:(i&&(s=this._toString(s,i)),s)},l.prototype.setAutoPadding=function(){},l.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},l.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},l.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},l.prototype._transform=function(e,t,i){var n;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){n=e}finally{i(n)}},l.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},l.prototype._finalOrDigest=function(e){var t=this.__final()||n.alloc(0);return e&&(t=this._toString(t,e,!0)),t},l.prototype._toString=function(e,t,i){if(this._decoder||(this._decoder=new r(t),this._encoding=t),this._encoding!==t)throw new Error("can’t switch encodings");var n=this._decoder.write(e);return i&&(n+=this._decoder.end()),n},e.exports=l},44477(e){function t(){return new DOMException("The request is not allowed","NotAllowedError")}e.exports=async function(e){try{await async function(e){if(!navigator.clipboard)throw t();return navigator.clipboard.writeText(e)}(e)}catch(i){try{await async function(e){const i=document.createElement("span");i.textContent=e,i.style.whiteSpace="pre",i.style.webkitUserSelect="auto",i.style.userSelect="all",document.body.appendChild(i);const n=window.getSelection(),s=window.document.createRange();n.removeAllRanges(),s.selectNode(i),n.addRange(s);let r=!1;try{r=window.document.execCommand("copy")}finally{n.removeAllRanges(),window.document.body.removeChild(i)}if(!r)throw t()}(e)}catch(e){throw e||i||t()}}}},35284(e,t,i){"use strict";function n(e){var t,i,s="";if("string"==typeof e||"number"==typeof e)s+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(i=n(e[t]))&&(s&&(s+=" "),s+=i);else for(t in e)e[t]&&(s&&(s+=" "),s+=t);return s}i.d(t,{A:()=>s});const s=function(){for(var e,t,i=0,s="";i<arguments.length;)(e=arguments[i++])&&(t=n(e))&&(s&&(s+=" "),s+=t);return s}},89901(e){function t(e){var i,n,s="";if("string"==typeof e||"number"==typeof e)s+=e;else if("object"==typeof e)if(Array.isArray(e)){var r=e.length;for(i=0;i<r;i++)e[i]&&(n=t(e[i]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function i(){for(var e,i,n=0,s="",r=arguments.length;n<r;n++)(e=arguments[n])&&(i=t(e))&&(s&&(s+=" "),s+=i);return s}e.exports=i,e.exports.clsx=i},99448(e,t){"use strict";t.q=function(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");for(var n={},s=t||{},o=e.split(";"),a=s.decode||i,l=0;l<o.length;l++){var c=o[l],h=c.indexOf("=");if(!(h<0)){var u=c.substring(0,h).trim();if(null==n[u]){var d=c.substring(h+1,c.length).trim();'"'===d[0]&&(d=d.slice(1,-1)),n[u]=r(d,a)}}}return n},t.l=function(e,t,i){var r=i||{},o=r.encode||n;if("function"!=typeof o)throw new TypeError("option encode is invalid");if(!s.test(e))throw new TypeError("argument name is invalid");var a=o(t);if(a&&!s.test(a))throw new TypeError("argument val is invalid");var l=e+"="+a;if(null!=r.maxAge){var c=r.maxAge-0;if(isNaN(c)||!isFinite(c))throw new TypeError("option maxAge is invalid");l+="; Max-Age="+Math.floor(c)}if(r.domain){if(!s.test(r.domain))throw new TypeError("option domain is invalid");l+="; Domain="+r.domain}if(r.path){if(!s.test(r.path))throw new TypeError("option path is invalid");l+="; Path="+r.path}if(r.expires){if("function"!=typeof r.expires.toUTCString)throw new TypeError("option expires is invalid");l+="; Expires="+r.expires.toUTCString()}if(r.httpOnly&&(l+="; HttpOnly"),r.secure&&(l+="; Secure"),r.sameSite)switch("string"==typeof r.sameSite?r.sameSite.toLowerCase():r.sameSite){case!0:l+="; SameSite=Strict";break;case"lax":l+="; SameSite=Lax";break;case"strict":l+="; SameSite=Strict";break;case"none":l+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return l};var i=decodeURIComponent,n=encodeURIComponent,s=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function r(e,t){try{return t(e)}catch(t){return e}}},85877(e,t,i){i(2903),e.exports=i(18976).Object.assign},13112(e,t,i){i(81026);var n=i(18976).Object;e.exports=function(e,t){return n.create(e,t)}},30481(e,t,i){i(92611);var n=i(18976).Object;e.exports=function(e,t,i){return n.defineProperty(e,t,i)}},18307(e,t,i){i(95029),e.exports=i(18976).Object.getPrototypeOf},55111(e,t,i){i(74537),e.exports=i(18976).Object.setPrototypeOf},27773(e,t,i){i(63977),i(83149),i(78993),i(50237),e.exports=i(18976).Symbol},63315(e,t,i){i(91210),i(75505),e.exports=i(36063).f("iterator")},30322(e){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},51453(e){e.exports=function(){}},44655(e,t,i){var n=i(17482);e.exports=function(e){if(!n(e))throw TypeError(e+" is not an object!");return e}},2473(e,t,i){var n=i(51552),s=i(14326),r=i(23138);e.exports=function(e){return function(t,i,o){var a,l=n(t),c=s(l.length),h=r(o,c);if(e&&i!=i){for(;c>h;)if((a=l[h++])!=a)return!0}else for(;c>h;h++)if((e||h in l)&&l[h]===i)return e||h||0;return!e&&-1}}},6486(e){var t={}.toString;e.exports=function(e){return t.call(e).slice(8,-1)}},18976(e){var t=e.exports={version:"2.6.12"};"number"==typeof __e&&(__e=t)},64015(e,t,i){var n=i(30322);e.exports=function(e,t,i){if(n(e),void 0===t)return e;switch(i){case 1:return function(i){return e.call(t,i)};case 2:return function(i,n){return e.call(t,i,n)};case 3:return function(i,n,s){return e.call(t,i,n,s)}}return function(){return e.apply(t,arguments)}}},77095(e){e.exports=function(e){if(null==e)throw TypeError("Can't call method on  "+e);return e}},27828(e,t,i){e.exports=!i(58599)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},35299(e,t,i){var n=i(17482),s=i(79747).document,r=n(s)&&n(s.createElement);e.exports=function(e){return r?s.createElement(e):{}}},46527(e){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},94618(e,t,i){var n=i(46936),s=i(62951),r=i(60092);e.exports=function(e){var t=n(e),i=s.f;if(i)for(var o,a=i(e),l=r.f,c=0;a.length>c;)l.call(e,o=a[c++])&&t.push(o);return t}},9102(e,t,i){var n=i(79747),s=i(18976),r=i(64015),o=i(48324),a=i(21998),l="prototype",c=function(e,t,i){var h,u,d,p=e&c.F,g=e&c.G,f=e&c.S,m=e&c.P,y=e&c.B,v=e&c.W,b=g?s:s[t]||(s[t]={}),C=b[l],w=g?n:f?n[t]:(n[t]||{})[l];for(h in g&&(i=t),i)(u=!p&&w&&void 0!==w[h])&&a(b,h)||(d=u?w[h]:i[h],b[h]=g&&"function"!=typeof w[h]?i[h]:y&&u?r(d,n):v&&w[h]==d?function(e){var t=function(t,i,n){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,i)}return new e(t,i,n)}return e.apply(this,arguments)};return t[l]=e[l],t}(d):m&&"function"==typeof d?r(Function.call,d):d,m&&((b.virtual||(b.virtual={}))[h]=d,e&c.R&&C&&!C[h]&&o(C,h,d)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,e.exports=c},58599(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}},79747(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)},21998(e){var t={}.hasOwnProperty;e.exports=function(e,i){return t.call(e,i)}},48324(e,t,i){var n=i(10788),s=i(25995);e.exports=i(27828)?function(e,t,i){return n.f(e,t,s(1,i))}:function(e,t,i){return e[t]=i,e}},31349(e,t,i){var n=i(79747).document;e.exports=n&&n.documentElement},27941(e,t,i){e.exports=!i(27828)&&!i(58599)(function(){return 7!=Object.defineProperty(i(35299)("div"),"a",{get:function(){return 7}}).a})},6234(e,t,i){var n=i(6486);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==n(e)?e.split(""):Object(e)}},39984(e,t,i){var n=i(6486);e.exports=Array.isArray||function(e){return"Array"==n(e)}},17482(e){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},36099(e,t,i){"use strict";var n=i(69840),s=i(25995),r=i(26343),o={};i(48324)(o,i(78161)("iterator"),function(){return this}),e.exports=function(e,t,i){e.prototype=n(o,{next:s(1,i)}),r(e,t+" Iterator")}},14520(e,t,i){"use strict";var n=i(75549),s=i(9102),r=i(10058),o=i(48324),a=i(71813),l=i(36099),c=i(26343),h=i(23218),u=i(78161)("iterator"),d=!([].keys&&"next"in[].keys()),p="keys",g="values",f=function(){return this};e.exports=function(e,t,i,m,y,v,b){l(i,t,m);var C,w,S,x=function(e){if(!d&&e in T)return T[e];switch(e){case p:case g:return function(){return new i(this,e)}}return function(){return new i(this,e)}},E=t+" Iterator",A=y==g,M=!1,T=e.prototype,D=T[u]||T["@@iterator"]||y&&T[y],I=D||x(y),R=y?A?x("entries"):I:void 0,k="Array"==t&&T.entries||D;if(k&&(S=h(k.call(new e)))!==Object.prototype&&S.next&&(c(S,E,!0),n||"function"==typeof S[u]||o(S,u,f)),A&&D&&D.name!==g&&(M=!0,I=function(){return D.call(this)}),n&&!b||!d&&!M&&T[u]||o(T,u,I),a[t]=I,a[E]=f,y)if(C={values:A?I:x(g),keys:v?I:x(p),entries:R},b)for(w in C)w in T||r(T,w,C[w]);else s(s.P+s.F*(d||M),t,C);return C}},17093(e){e.exports=function(e,t){return{value:t,done:!!e}}},71813(e){e.exports={}},75549(e){e.exports=!0},26853(e,t,i){var n=i(14472)("meta"),s=i(17482),r=i(21998),o=i(10788).f,a=0,l=Object.isExtensible||function(){return!0},c=!i(58599)(function(){return l(Object.preventExtensions({}))}),h=function(e){o(e,n,{value:{i:"O"+ ++a,w:{}}})},u=e.exports={KEY:n,NEED:!1,fastKey:function(e,t){if(!s(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!r(e,n)){if(!l(e))return"F";if(!t)return"E";h(e)}return e[n].i},getWeak:function(e,t){if(!r(e,n)){if(!l(e))return!0;if(!t)return!1;h(e)}return e[n].w},onFreeze:function(e){return c&&u.NEED&&l(e)&&!r(e,n)&&h(e),e}}},33677(e,t,i){"use strict";var n=i(27828),s=i(46936),r=i(62951),o=i(60092),a=i(70749),l=i(6234),c=Object.assign;e.exports=!c||i(58599)(function(){var e={},t={},i=Symbol(),n="abcdefghijklmnopqrst";return e[i]=7,n.split("").forEach(function(e){t[e]=e}),7!=c({},e)[i]||Object.keys(c({},t)).join("")!=n})?function(e,t){for(var i=a(e),c=arguments.length,h=1,u=r.f,d=o.f;c>h;)for(var p,g=l(arguments[h++]),f=u?s(g).concat(u(g)):s(g),m=f.length,y=0;m>y;)p=f[y++],n&&!d.call(g,p)||(i[p]=g[p]);return i}:c},69840(e,t,i){var n=i(44655),s=i(50251),r=i(46527),o=i(81119)("IE_PROTO"),a=function(){},l="prototype",c=function(){var e,t=i(35299)("iframe"),n=r.length;for(t.style.display="none",i(31349).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),c=e.F;n--;)delete c[l][r[n]];return c()};e.exports=Object.create||function(e,t){var i;return null!==e?(a[l]=n(e),i=new a,a[l]=null,i[o]=e):i=c(),void 0===t?i:s(i,t)}},10788(e,t,i){var n=i(44655),s=i(27941),r=i(15873),o=Object.defineProperty;t.f=i(27828)?Object.defineProperty:function(e,t,i){if(n(e),t=r(t,!0),n(i),s)try{return o(e,t,i)}catch(e){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(e[t]=i.value),e}},50251(e,t,i){var n=i(10788),s=i(44655),r=i(46936);e.exports=i(27828)?Object.defineProperties:function(e,t){s(e);for(var i,o=r(t),a=o.length,l=0;a>l;)n.f(e,i=o[l++],t[i]);return e}},73686(e,t,i){var n=i(60092),s=i(25995),r=i(51552),o=i(15873),a=i(21998),l=i(27941),c=Object.getOwnPropertyDescriptor;t.f=i(27828)?c:function(e,t){if(e=r(e),t=o(t,!0),l)try{return c(e,t)}catch(e){}if(a(e,t))return s(!n.f.call(e,t),e[t])}},90662(e,t,i){var n=i(51552),s=i(4788).f,r={}.toString,o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return o&&"[object Window]"==r.call(e)?function(e){try{return s(e)}catch(e){return o.slice()}}(e):s(n(e))}},4788(e,t,i){var n=i(18556),s=i(46527).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,s)}},62951(e,t){t.f=Object.getOwnPropertySymbols},23218(e,t,i){var n=i(21998),s=i(70749),r=i(81119)("IE_PROTO"),o=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=s(e),n(e,r)?e[r]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?o:null}},18556(e,t,i){var n=i(21998),s=i(51552),r=i(2473)(!1),o=i(81119)("IE_PROTO");e.exports=function(e,t){var i,a=s(e),l=0,c=[];for(i in a)i!=o&&n(a,i)&&c.push(i);for(;t.length>l;)n(a,i=t[l++])&&(~r(c,i)||c.push(i));return c}},46936(e,t,i){var n=i(18556),s=i(46527);e.exports=Object.keys||function(e){return n(e,s)}},60092(e,t){t.f={}.propertyIsEnumerable},72234(e,t,i){var n=i(9102),s=i(18976),r=i(58599);e.exports=function(e,t){var i=(s.Object||{})[e]||Object[e],o={};o[e]=t(i),n(n.S+n.F*r(function(){i(1)}),"Object",o)}},25995(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},10058(e,t,i){e.exports=i(48324)},9721(e,t,i){var n=i(17482),s=i(44655),r=function(e,t){if(s(e),!n(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,n){try{(n=i(64015)(Function.call,i(73686).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,i){return r(e,i),t?e.__proto__=i:n(e,i),e}}({},!1):void 0),check:r}},26343(e,t,i){var n=i(10788).f,s=i(21998),r=i(78161)("toStringTag");e.exports=function(e,t,i){e&&!s(e=i?e:e.prototype,r)&&n(e,r,{configurable:!0,value:t})}},81119(e,t,i){var n=i(27641)("keys"),s=i(14472);e.exports=function(e){return n[e]||(n[e]=s(e))}},27641(e,t,i){var n=i(18976),s=i(79747),r="__core-js_shared__",o=s[r]||(s[r]={});(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:n.version,mode:i(75549)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},62447(e,t,i){var n=i(29358),s=i(77095);e.exports=function(e){return function(t,i){var r,o,a=String(s(t)),l=n(i),c=a.length;return l<0||l>=c?e?"":void 0:(r=a.charCodeAt(l))<55296||r>56319||l+1===c||(o=a.charCodeAt(l+1))<56320||o>57343?e?a.charAt(l):r:e?a.slice(l,l+2):o-56320+(r-55296<<10)+65536}}},23138(e,t,i){var n=i(29358),s=Math.max,r=Math.min;e.exports=function(e,t){return(e=n(e))<0?s(e+t,0):r(e,t)}},29358(e){var t=Math.ceil,i=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?i:t)(e)}},51552(e,t,i){var n=i(6234),s=i(77095);e.exports=function(e){return n(s(e))}},14326(e,t,i){var n=i(29358),s=Math.min;e.exports=function(e){return e>0?s(n(e),9007199254740991):0}},70749(e,t,i){var n=i(77095);e.exports=function(e){return Object(n(e))}},15873(e,t,i){var n=i(17482);e.exports=function(e,t){if(!n(e))return e;var i,s;if(t&&"function"==typeof(i=e.toString)&&!n(s=i.call(e)))return s;if("function"==typeof(i=e.valueOf)&&!n(s=i.call(e)))return s;if(!t&&"function"==typeof(i=e.toString)&&!n(s=i.call(e)))return s;throw TypeError("Can't convert object to primitive value")}},14472(e){var t=0,i=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++t+i).toString(36))}},99225(e,t,i){var n=i(79747),s=i(18976),r=i(75549),o=i(36063),a=i(10788).f;e.exports=function(e){var t=s.Symbol||(s.Symbol=r?{}:n.Symbol||{});"_"==e.charAt(0)||e in t||a(t,e,{value:o.f(e)})}},36063(e,t,i){t.f=i(78161)},78161(e,t,i){var n=i(27641)("wks"),s=i(14472),r=i(79747).Symbol,o="function"==typeof r;(e.exports=function(e){return n[e]||(n[e]=o&&r[e]||(o?r:s)("Symbol."+e))}).store=n},27698(e,t,i){"use strict";var n=i(51453),s=i(17093),r=i(71813),o=i(51552);e.exports=i(14520)(Array,"Array",function(e,t){this._t=o(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,i=this._i++;return!e||i>=e.length?(this._t=void 0,s(1)):s(0,"keys"==t?i:"values"==t?e[i]:[i,e[i]])},"values"),r.Arguments=r.Array,n("keys"),n("values"),n("entries")},2903(e,t,i){var n=i(9102);n(n.S+n.F,"Object",{assign:i(33677)})},81026(e,t,i){var n=i(9102);n(n.S,"Object",{create:i(69840)})},92611(e,t,i){var n=i(9102);n(n.S+n.F*!i(27828),"Object",{defineProperty:i(10788).f})},95029(e,t,i){var n=i(70749),s=i(23218);i(72234)("getPrototypeOf",function(){return function(e){return s(n(e))}})},74537(e,t,i){var n=i(9102);n(n.S,"Object",{setPrototypeOf:i(9721).set})},83149(){},91210(e,t,i){"use strict";var n=i(62447)(!0);i(14520)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,i=this._i;return i>=t.length?{value:void 0,done:!0}:(e=n(t,i),this._i+=e.length,{value:e,done:!1})})},63977(e,t,i){"use strict";var n=i(79747),s=i(21998),r=i(27828),o=i(9102),a=i(10058),l=i(26853).KEY,c=i(58599),h=i(27641),u=i(26343),d=i(14472),p=i(78161),g=i(36063),f=i(99225),m=i(94618),y=i(39984),v=i(44655),b=i(17482),C=i(70749),w=i(51552),S=i(15873),x=i(25995),E=i(69840),A=i(90662),M=i(73686),T=i(62951),D=i(10788),I=i(46936),R=M.f,k=D.f,P=A.f,_=n.Symbol,L=n.JSON,N=L&&L.stringify,O="prototype",F=p("_hidden"),G=p("toPrimitive"),B={}.propertyIsEnumerable,V=h("symbol-registry"),H=h("symbols"),U=h("op-symbols"),z=Object[O],W="function"==typeof _&&!!T.f,j=n.QObject,$=!j||!j[O]||!j[O].findChild,K=r&&c(function(){return 7!=E(k({},"a",{get:function(){return k(this,"a",{value:7}).a}})).a})?function(e,t,i){var n=R(z,t);n&&delete z[t],k(e,t,i),n&&e!==z&&k(z,t,n)}:k,Y=function(e){var t=H[e]=E(_[O]);return t._k=e,t},q=W&&"symbol"==typeof _.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof _},X=function(e,t,i){return e===z&&X(U,t,i),v(e),t=S(t,!0),v(i),s(H,t)?(i.enumerable?(s(e,F)&&e[F][t]&&(e[F][t]=!1),i=E(i,{enumerable:x(0,!1)})):(s(e,F)||k(e,F,x(1,{})),e[F][t]=!0),K(e,t,i)):k(e,t,i)},Z=function(e,t){v(e);for(var i,n=m(t=w(t)),s=0,r=n.length;r>s;)X(e,i=n[s++],t[i]);return e},Q=function(e){var t=B.call(this,e=S(e,!0));return!(this===z&&s(H,e)&&!s(U,e))&&(!(t||!s(this,e)||!s(H,e)||s(this,F)&&this[F][e])||t)},J=function(e,t){if(e=w(e),t=S(t,!0),e!==z||!s(H,t)||s(U,t)){var i=R(e,t);return!i||!s(H,t)||s(e,F)&&e[F][t]||(i.enumerable=!0),i}},ee=function(e){for(var t,i=P(w(e)),n=[],r=0;i.length>r;)s(H,t=i[r++])||t==F||t==l||n.push(t);return n},te=function(e){for(var t,i=e===z,n=P(i?U:w(e)),r=[],o=0;n.length>o;)!s(H,t=n[o++])||i&&!s(z,t)||r.push(H[t]);return r};W||(_=function(){if(this instanceof _)throw TypeError("Symbol is not a constructor!");var e=d(arguments.length>0?arguments[0]:void 0),t=function(i){this===z&&t.call(U,i),s(this,F)&&s(this[F],e)&&(this[F][e]=!1),K(this,e,x(1,i))};return r&&$&&K(z,e,{configurable:!0,set:t}),Y(e)},a(_[O],"toString",function(){return this._k}),M.f=J,D.f=X,i(4788).f=A.f=ee,i(60092).f=Q,T.f=te,r&&!i(75549)&&a(z,"propertyIsEnumerable",Q,!0),g.f=function(e){return Y(p(e))}),o(o.G+o.W+o.F*!W,{Symbol:_});for(var ie="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ne=0;ie.length>ne;)p(ie[ne++]);for(var se=I(p.store),re=0;se.length>re;)f(se[re++]);o(o.S+o.F*!W,"Symbol",{for:function(e){return s(V,e+="")?V[e]:V[e]=_(e)},keyFor:function(e){if(!q(e))throw TypeError(e+" is not a symbol!");for(var t in V)if(V[t]===e)return t},useSetter:function(){$=!0},useSimple:function(){$=!1}}),o(o.S+o.F*!W,"Object",{create:function(e,t){return void 0===t?E(e):Z(E(e),t)},defineProperty:X,defineProperties:Z,getOwnPropertyDescriptor:J,getOwnPropertyNames:ee,getOwnPropertySymbols:te});var oe=c(function(){T.f(1)});o(o.S+o.F*oe,"Object",{getOwnPropertySymbols:function(e){return T.f(C(e))}}),L&&o(o.S+o.F*(!W||c(function(){var e=_();return"[null]"!=N([e])||"{}"!=N({a:e})||"{}"!=N(Object(e))})),"JSON",{stringify:function(e){for(var t,i,n=[e],s=1;arguments.length>s;)n.push(arguments[s++]);if(i=t=n[1],(b(t)||void 0!==e)&&!q(e))return y(t)||(t=function(e,t){if("function"==typeof i&&(t=i.call(this,e,t)),!q(t))return t}),n[1]=t,N.apply(L,n)}}),_[O][G]||i(48324)(_[O],G,_[O].valueOf),u(_,"Symbol"),u(Math,"Math",!0),u(n.JSON,"JSON",!0)},78993(e,t,i){i(99225)("asyncIterator")},50237(e,t,i){i(99225)("observable")},75505(e,t,i){i(27698);for(var n=i(79747),s=i(48324),r=i(71813),o=i(78161)("toStringTag"),a="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),l=0;l<a.length;l++){var c=a[l],h=n[c],u=h&&h.prototype;u&&!u[o]&&s(u,o,c),r[c]=r.Array}},41166(e,t,i){function n(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===n(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===n(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===n(e)},t.isError=function(e){return"[object Error]"===n(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=i(77511).Buffer.isBuffer},29520(e,t,i){var n=i(23071),s=i(5630);e.exports=function(e){return new o(e)};var r={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function o(e){this.curveType=r[e],this.curveType||(this.curveType={name:e}),this.curve=new n.ec(this.curveType.name),this.keys=void 0}function a(e,t,i){Array.isArray(e)||(e=e.toArray());var n=new Buffer(e);if(i&&n.length<i){var s=new Buffer(i-n.length);s.fill(0),n=Buffer.concat([s,n])}return t?n.toString(t):n}r.p224=r.secp224r1,r.p256=r.secp256r1=r.prime256v1,r.p192=r.secp192r1=r.prime192v1,r.p384=r.secp384r1,r.p521=r.secp521r1,o.prototype.generateKeys=function(e,t){return this.keys=this.curve.genKeyPair(),this.getPublicKey(e,t)},o.prototype.computeSecret=function(e,t,i){return t=t||"utf8",Buffer.isBuffer(e)||(e=new Buffer(e,t)),a(this.curve.keyFromPublic(e).getPublic().mul(this.keys.getPrivate()).getX(),i,this.curveType.byteLength)},o.prototype.getPublicKey=function(e,t){var i=this.keys.getPublic("compressed"===t,!0);return"hybrid"===t&&(i[i.length-1]%2?i[0]=7:i[0]=6),a(i,e)},o.prototype.getPrivateKey=function(e){return a(this.keys.getPrivate(),e)},o.prototype.setPublicKey=function(e,t){return t=t||"utf8",Buffer.isBuffer(e)||(e=new Buffer(e,t)),this.keys._importPublic(e),this},o.prototype.setPrivateKey=function(e,t){t=t||"utf8",Buffer.isBuffer(e)||(e=new Buffer(e,t));var i=new s(e);return i=i.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(i),this}},24984(e,t,i){"use strict";var n=i(91193),s=i(75035),r=i(47795),o=i(99041),a=i(36334);function l(e){a.call(this,"digest"),this._hash=e}n(l,a),l.prototype._update=function(e){this._hash.update(e)},l.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new s:"rmd160"===e||"ripemd160"===e?new r:new l(o(e))}},46159(e,t,i){var n=i(75035);e.exports=function(e){return(new n).update(e).digest()}},33053(e,t,i){"use strict";var n=i(91193),s=i(78289),r=i(36334),o=i(56608).Buffer,a=i(46159),l=i(47795),c=i(99041),h=o.alloc(128);function u(e,t){r.call(this,"digest"),"string"==typeof t&&(t=o.from(t));var i="sha512"===e||"sha384"===e?128:64;this._alg=e,this._key=t,t.length>i?t=("rmd160"===e?new l:c(e)).update(t).digest():t.length<i&&(t=o.concat([t,h],i));for(var n=this._ipad=o.allocUnsafe(i),s=this._opad=o.allocUnsafe(i),a=0;a<i;a++)n[a]=54^t[a],s[a]=92^t[a];this._hash="rmd160"===e?new l:c(e),this._hash.update(n)}n(u,r),u.prototype._update=function(e){this._hash.update(e)},u.prototype._final=function(){var e=this._hash.digest();return("rmd160"===this._alg?new l:c(this._alg)).update(this._opad).update(e).digest()},e.exports=function(e,t){return"rmd160"===(e=e.toLowerCase())||"ripemd160"===e?new u("rmd160",t):"md5"===e?new s(a,t):new u(e,t)}},78289(e,t,i){"use strict";var n=i(91193),s=i(56608).Buffer,r=i(36334),o=s.alloc(128),a=64;function l(e,t){r.call(this,"digest"),"string"==typeof t&&(t=s.from(t)),this._alg=e,this._key=t,t.length>a?t=e(t):t.length<a&&(t=s.concat([t,o],a));for(var i=this._ipad=s.allocUnsafe(a),n=this._opad=s.allocUnsafe(a),l=0;l<a;l++)i[l]=54^t[l],n[l]=92^t[l];this._hash=[i]}n(l,r),l.prototype._update=function(e){this._hash.push(e)},l.prototype._final=function(){var e=this._alg(s.concat(this._hash));return this._alg(s.concat([this._opad,e]))},e.exports=l},24215(e,t,i){"use strict";t.randomBytes=t.rng=t.pseudoRandomBytes=t.prng=i(82869),t.createHash=t.Hash=i(24984),t.createHmac=t.Hmac=i(33053);var n=i(92761),s=Object.keys(n),r=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(s);t.getHashes=function(){return r};var o=i(46375);t.pbkdf2=o.pbkdf2,t.pbkdf2Sync=o.pbkdf2Sync;var a=i(18350);t.Cipher=a.Cipher,t.createCipher=a.createCipher,t.Cipheriv=a.Cipheriv,t.createCipheriv=a.createCipheriv,t.Decipher=a.Decipher,t.createDecipher=a.createDecipher,t.Decipheriv=a.Decipheriv,t.createDecipheriv=a.createDecipheriv,t.getCiphers=a.getCiphers,t.listCiphers=a.listCiphers;var l=i(58216);t.DiffieHellmanGroup=l.DiffieHellmanGroup,t.createDiffieHellmanGroup=l.createDiffieHellmanGroup,t.getDiffieHellman=l.getDiffieHellman,t.createDiffieHellman=l.createDiffieHellman,t.DiffieHellman=l.DiffieHellman;var c=i(80206);t.createSign=c.createSign,t.Sign=c.Sign,t.createVerify=c.createVerify,t.Verify=c.Verify,t.createECDH=i(29520);var h=i(32211);t.publicEncrypt=h.publicEncrypt,t.privateEncrypt=h.privateEncrypt,t.publicDecrypt=h.publicDecrypt,t.privateDecrypt=h.privateDecrypt;var u=i(44925);t.randomFill=u.randomFill,t.randomFillSync=u.randomFillSync,t.createCredentials=function(){throw new Error("sorry, createCredentials is not implemented yet\nwe accept pull requests\nhttps://github.com/browserify/crypto-browserify")},t.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},60095(e,t,i){var n;e.exports=(n=n||function(e){var t;if("undefined"!=typeof window&&window.crypto&&(t=window.crypto),"undefined"!=typeof self&&self.crypto&&(t=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(t=globalThis.crypto),!t&&"undefined"!=typeof window&&window.msCrypto&&(t=window.msCrypto),!t&&"undefined"!=typeof globalThis&&globalThis.crypto&&(t=globalThis.crypto),!t)try{t=i(57167)}catch(e){}var n=function(){if(t){if("function"==typeof t.getRandomValues)try{return t.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof t.randomBytes)try{return t.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},s=Object.create||function(){function e(){}return function(t){var i;return e.prototype=t,i=new e,e.prototype=null,i}}(),r={},o=r.lib={},a=o.Base={extend:function(e){var t=s(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},l=o.WordArray=a.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||h).stringify(this)},concat:function(e){var t=this.words,i=e.words,n=this.sigBytes,s=e.sigBytes;if(this.clamp(),n%4)for(var r=0;r<s;r++){var o=i[r>>>2]>>>24-r%4*8&255;t[n+r>>>2]|=o<<24-(n+r)%4*8}else for(var a=0;a<s;a+=4)t[n+a>>>2]=i[a>>>2];return this.sigBytes+=s,this},clamp:function(){var t=this.words,i=this.sigBytes;t[i>>>2]&=4294967295<<32-i%4*8,t.length=e.ceil(i/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],i=0;i<e;i+=4)t.push(n());return new l.init(t,e)}}),c=r.enc={},h=c.Hex={stringify:function(e){for(var t=e.words,i=e.sigBytes,n=[],s=0;s<i;s++){var r=t[s>>>2]>>>24-s%4*8&255;n.push((r>>>4).toString(16)),n.push((15&r).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,i=[],n=0;n<t;n+=2)i[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new l.init(i,t/2)}},u=c.Latin1={stringify:function(e){for(var t=e.words,i=e.sigBytes,n=[],s=0;s<i;s++){var r=t[s>>>2]>>>24-s%4*8&255;n.push(String.fromCharCode(r))}return n.join("")},parse:function(e){for(var t=e.length,i=[],n=0;n<t;n++)i[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new l.init(i,t)}},d=c.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},p=o.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new l.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=d.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var i,n=this._data,s=n.words,r=n.sigBytes,o=this.blockSize,a=r/(4*o),c=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*o,h=e.min(4*c,r);if(c){for(var u=0;u<c;u+=o)this._doProcessBlock(s,u);i=s.splice(0,c),n.sigBytes-=h}return new l.init(i,h)},clone:function(){var e=a.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),g=(o.Hasher=p.extend({cfg:a.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,i){return new e.init(i).finalize(t)}},_createHmacHelper:function(e){return function(t,i){return new g.HMAC.init(e,i).finalize(t)}}}),r.algo={});return r}(Math),n)},81716(e,t,i){var n,s,r;e.exports=(n=i(60095),r=(s=n).lib.WordArray,s.enc.Base64={stringify:function(e){var t=e.words,i=e.sigBytes,n=this._map;e.clamp();for(var s=[],r=0;r<i;r+=3)for(var o=(t[r>>>2]>>>24-r%4*8&255)<<16|(t[r+1>>>2]>>>24-(r+1)%4*8&255)<<8|t[r+2>>>2]>>>24-(r+2)%4*8&255,a=0;a<4&&r+.75*a<i;a++)s.push(n.charAt(o>>>6*(3-a)&63));var l=n.charAt(64);if(l)for(;s.length%4;)s.push(l);return s.join("")},parse:function(e){var t=e.length,i=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var s=0;s<i.length;s++)n[i.charCodeAt(s)]=s}var o=i.charAt(64);if(o){var a=e.indexOf(o);-1!==a&&(t=a)}return function(e,t,i){for(var n=[],s=0,o=0;o<t;o++)if(o%4){var a=i[e.charCodeAt(o-1)]<<o%4*2|i[e.charCodeAt(o)]>>>6-o%4*2;n[s>>>2]|=a<<24-s%4*8,s++}return r.create(n,s)}(e,t,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},n.enc.Base64)},31939(e,t,i){var n;e.exports=(n=i(60095),i(9331),i(55979),n.HmacSHA256)},55979(e,t,i){var n,s,r;e.exports=(s=(n=i(60095)).lib.Base,r=n.enc.Utf8,void(n.algo.HMAC=s.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=r.parse(t));var i=e.blockSize,n=4*i;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var s=this._oKey=t.clone(),o=this._iKey=t.clone(),a=s.words,l=o.words,c=0;c<i;c++)a[c]^=1549556828,l[c]^=909522486;s.sigBytes=o.sigBytes=n,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,i=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(i))}})))},74842(e,t,i){var n;e.exports=(n=i(60095),function(){if("function"==typeof ArrayBuffer){var e=n.lib.WordArray,t=e.init,i=e.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var i=e.byteLength,n=[],s=0;s<i;s++)n[s>>>2]|=e[s]<<24-s%4*8;t.call(this,n,i)}else t.apply(this,arguments)};i.prototype=e}}(),n.lib.WordArray)},9331(e,t,i){var n;e.exports=(n=i(60095),function(e){var t=n,i=t.lib,s=i.WordArray,r=i.Hasher,o=t.algo,a=[],l=[];!function(){function t(t){for(var i=e.sqrt(t),n=2;n<=i;n++)if(!(t%n))return!1;return!0}function i(e){return 4294967296*(e-(0|e))|0}for(var n=2,s=0;s<64;)t(n)&&(s<8&&(a[s]=i(e.pow(n,.5))),l[s]=i(e.pow(n,1/3)),s++),n++}();var c=[],h=o.SHA256=r.extend({_doReset:function(){this._hash=new s.init(a.slice(0))},_doProcessBlock:function(e,t){for(var i=this._hash.words,n=i[0],s=i[1],r=i[2],o=i[3],a=i[4],h=i[5],u=i[6],d=i[7],p=0;p<64;p++){if(p<16)c[p]=0|e[t+p];else{var g=c[p-15],f=(g<<25|g>>>7)^(g<<14|g>>>18)^g>>>3,m=c[p-2],y=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;c[p]=f+c[p-7]+y+c[p-16]}var v=n&s^n&r^s&r,b=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),C=d+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&h^~a&u)+l[p]+c[p];d=u,u=h,h=a,a=o+C|0,o=r,r=s,s=n,n=C+(b+v)|0}i[0]=i[0]+n|0,i[1]=i[1]+s|0,i[2]=i[2]+r|0,i[3]=i[3]+o|0,i[4]=i[4]+a|0,i[5]=i[5]+h|0,i[6]=i[6]+u|0,i[7]=i[7]+d|0},_doFinalize:function(){var t=this._data,i=t.words,n=8*this._nDataBytes,s=8*t.sigBytes;return i[s>>>5]|=128<<24-s%32,i[14+(s+64>>>9<<4)]=e.floor(n/4294967296),i[15+(s+64>>>9<<4)]=n,t.sigBytes=4*i.length,this._process(),this._hash},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=r._createHelper(h),t.HmacSHA256=r._createHmacHelper(h)}(Math),n.SHA256)},18814(e){e.exports=function(){"use strict";var e=6e4,t=36e5,i="millisecond",n="second",s="minute",r="hour",o="day",a="week",l="month",c="quarter",h="year",u="date",d="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,f={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],i=e%100;return"["+e+(t[(i-20)%10]||t[i]||t[0])+"]"}},m=function(e,t,i){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(i)+e},y={s:m,z:function(e){var t=-e.utcOffset(),i=Math.abs(t),n=Math.floor(i/60),s=i%60;return(t<=0?"+":"-")+m(n,2,"0")+":"+m(s,2,"0")},m:function e(t,i){if(t.date()<i.date())return-e(i,t);var n=12*(i.year()-t.year())+(i.month()-t.month()),s=t.clone().add(n,l),r=i-s<0,o=t.clone().add(n+(r?-1:1),l);return+(-(n+(i-s)/(r?s-o:o-s))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:h,w:a,d:o,D:u,h:r,m:s,s:n,ms:i,Q:c}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},v="en",b={};b[v]=f;var C="$isDayjsObject",w=function(e){return e instanceof A||!(!e||!e[C])},S=function e(t,i,n){var s;if(!t)return v;if("string"==typeof t){var r=t.toLowerCase();b[r]&&(s=r),i&&(b[r]=i,s=r);var o=t.split("-");if(!s&&o.length>1)return e(o[0])}else{var a=t.name;b[a]=t,s=a}return!n&&s&&(v=s),s||!n&&v},x=function(e,t){if(w(e))return e.clone();var i="object"==typeof t?t:{};return i.date=e,i.args=arguments,new A(i)},E=y;E.l=S,E.i=w,E.w=function(e,t){return x(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var A=function(){function f(e){this.$L=S(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[C]=!0}var m=f.prototype;return m.parse=function(e){this.$d=function(e){var t=e.date,i=e.utc;if(null===t)return new Date(NaN);if(E.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(p);if(n){var s=n[2]-1||0,r=(n[7]||"0").substring(0,3);return i?new Date(Date.UTC(n[1],s,n[3]||1,n[4]||0,n[5]||0,n[6]||0,r)):new Date(n[1],s,n[3]||1,n[4]||0,n[5]||0,n[6]||0,r)}}return new Date(t)}(e),this.init()},m.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},m.$utils=function(){return E},m.isValid=function(){return!(this.$d.toString()===d)},m.isSame=function(e,t){var i=x(e);return this.startOf(t)<=i&&i<=this.endOf(t)},m.isAfter=function(e,t){return x(e)<this.startOf(t)},m.isBefore=function(e,t){return this.endOf(t)<x(e)},m.$g=function(e,t,i){return E.u(e)?this[t]:this.set(i,e)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(e,t){var i=this,c=!!E.u(t)||t,d=E.p(e),p=function(e,t){var n=E.w(i.$u?Date.UTC(i.$y,t,e):new Date(i.$y,t,e),i);return c?n:n.endOf(o)},g=function(e,t){return E.w(i.toDate()[e].apply(i.toDate("s"),(c?[0,0,0,0]:[23,59,59,999]).slice(t)),i)},f=this.$W,m=this.$M,y=this.$D,v="set"+(this.$u?"UTC":"");switch(d){case h:return c?p(1,0):p(31,11);case l:return c?p(1,m):p(0,m+1);case a:var b=this.$locale().weekStart||0,C=(f<b?f+7:f)-b;return p(c?y-C:y+(6-C),m);case o:case u:return g(v+"Hours",0);case r:return g(v+"Minutes",1);case s:return g(v+"Seconds",2);case n:return g(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(e){return this.startOf(e,!1)},m.$set=function(e,t){var a,c=E.p(e),d="set"+(this.$u?"UTC":""),p=(a={},a[o]=d+"Date",a[u]=d+"Date",a[l]=d+"Month",a[h]=d+"FullYear",a[r]=d+"Hours",a[s]=d+"Minutes",a[n]=d+"Seconds",a[i]=d+"Milliseconds",a)[c],g=c===o?this.$D+(t-this.$W):t;if(c===l||c===h){var f=this.clone().set(u,1);f.$d[p](g),f.init(),this.$d=f.set(u,Math.min(this.$D,f.daysInMonth())).$d}else p&&this.$d[p](g);return this.init(),this},m.set=function(e,t){return this.clone().$set(e,t)},m.get=function(e){return this[E.p(e)]()},m.add=function(i,c){var u,d=this;i=Number(i);var p=E.p(c),g=function(e){var t=x(d);return E.w(t.date(t.date()+Math.round(e*i)),d)};if(p===l)return this.set(l,this.$M+i);if(p===h)return this.set(h,this.$y+i);if(p===o)return g(1);if(p===a)return g(7);var f=(u={},u[s]=e,u[r]=t,u[n]=1e3,u)[p]||1,m=this.$d.getTime()+i*f;return E.w(m,this)},m.subtract=function(e,t){return this.add(-1*e,t)},m.format=function(e){var t=this,i=this.$locale();if(!this.isValid())return i.invalidDate||d;var n=e||"YYYY-MM-DDTHH:mm:ssZ",s=E.z(this),r=this.$H,o=this.$m,a=this.$M,l=i.weekdays,c=i.months,h=i.meridiem,u=function(e,i,s,r){return e&&(e[i]||e(t,n))||s[i].slice(0,r)},p=function(e){return E.s(r%12||12,e,"0")},f=h||function(e,t,i){var n=e<12?"AM":"PM";return i?n.toLowerCase():n};return n.replace(g,function(e,n){return n||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return E.s(t.$y,4,"0");case"M":return a+1;case"MM":return E.s(a+1,2,"0");case"MMM":return u(i.monthsShort,a,c,3);case"MMMM":return u(c,a);case"D":return t.$D;case"DD":return E.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return u(i.weekdaysMin,t.$W,l,2);case"ddd":return u(i.weekdaysShort,t.$W,l,3);case"dddd":return l[t.$W];case"H":return String(r);case"HH":return E.s(r,2,"0");case"h":return p(1);case"hh":return p(2);case"a":return f(r,o,!0);case"A":return f(r,o,!1);case"m":return String(o);case"mm":return E.s(o,2,"0");case"s":return String(t.$s);case"ss":return E.s(t.$s,2,"0");case"SSS":return E.s(t.$ms,3,"0");case"Z":return s}return null}(e)||s.replace(":","")})},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(i,u,d){var p,g=this,f=E.p(u),m=x(i),y=(m.utcOffset()-this.utcOffset())*e,v=this-m,b=function(){return E.m(g,m)};switch(f){case h:p=b()/12;break;case l:p=b();break;case c:p=b()/3;break;case a:p=(v-y)/6048e5;break;case o:p=(v-y)/864e5;break;case r:p=v/t;break;case s:p=v/e;break;case n:p=v/1e3;break;default:p=v}return d?p:E.a(p)},m.daysInMonth=function(){return this.endOf(l).$D},m.$locale=function(){return b[this.$L]},m.locale=function(e,t){if(!e)return this.$L;var i=this.clone(),n=S(e,t,!0);return n&&(i.$L=n),i},m.clone=function(){return E.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},f}(),M=A.prototype;return x.prototype=M,[["$ms",i],["$s",n],["$m",s],["$H",r],["$W",o],["$M",l],["$y",h],["$D",u]].forEach(function(e){M[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),x.extend=function(e,t){return e.$i||(e(t,A,x),e.$i=!0),x},x.locale=S,x.isDayjs=w,x.unix=function(e){return x(1e3*e)},x.en=b[v],x.Ls=b,x.p={},x}()},73524(e){e.exports=function(){"use strict";return function(e,t){var i=t.prototype,n=i.format;i.format=function(e){var t=this,i=this.$locale();if(!this.isValid())return n.bind(this)(e);var s=this.$utils(),r=(e||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(e){switch(e){case"Q":return Math.ceil((t.$M+1)/3);case"Do":return i.ordinal(t.$D);case"gggg":return t.weekYear();case"GGGG":return t.isoWeekYear();case"wo":return i.ordinal(t.week(),"W");case"w":case"ww":return s.s(t.week(),"w"===e?1:2,"0");case"W":case"WW":return s.s(t.isoWeek(),"W"===e?1:2,"0");case"k":case"kk":return s.s(String(0===t.$H?24:t.$H),"k"===e?1:2,"0");case"X":return Math.floor(t.$d.getTime()/1e3);case"x":return t.$d.getTime();case"z":return"["+t.offsetName()+"]";case"zzz":return"["+t.offsetName("long")+"]";default:return e}});return n.bind(this)(r)}}}()},38588(e){e.exports=function(){"use strict";var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,n=/\d\d/,s=/\d\d?/,r=/\d*[^-_:/,()\s\d]+/,o={},a=function(e){return(e=+e)+(e>68?1900:2e3)},l=function(e){return function(t){this[e]=+t}},c=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),i=60*t[1]+(+t[2]||0);return 0===i?0:"+"===t[0]?-i:i}(e)}],h=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},u=function(e,t){var i,n=o.meridiem;if(n){for(var s=1;s<=24;s+=1)if(e.indexOf(n(s,0,t))>-1){i=s>12;break}}else i=e===(t?"pm":"PM");return i},d={A:[r,function(e){this.afternoon=u(e,!1)}],a:[r,function(e){this.afternoon=u(e,!0)}],Q:[i,function(e){this.month=3*(e-1)+1}],S:[i,function(e){this.milliseconds=100*+e}],SS:[n,function(e){this.milliseconds=10*+e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[s,l("seconds")],ss:[s,l("seconds")],m:[s,l("minutes")],mm:[s,l("minutes")],H:[s,l("hours")],h:[s,l("hours")],HH:[s,l("hours")],hh:[s,l("hours")],D:[s,l("day")],DD:[n,l("day")],Do:[r,function(e){var t=o.ordinal,i=e.match(/\d+/);if(this.day=i[0],t)for(var n=1;n<=31;n+=1)t(n).replace(/\[|\]/g,"")===e&&(this.day=n)}],w:[s,l("week")],ww:[n,l("week")],M:[s,l("month")],MM:[n,l("month")],MMM:[r,function(e){var t=h("months"),i=(h("monthsShort")||t.map(function(e){return e.slice(0,3)})).indexOf(e)+1;if(i<1)throw new Error;this.month=i%12||i}],MMMM:[r,function(e){var t=h("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\d+/,l("year")],YY:[n,function(e){this.year=a(e)}],YYYY:[/\d{4}/,l("year")],Z:c,ZZ:c};function p(i){var n,s;n=i,s=o&&o.formats;for(var r=(i=n.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(t,i,n){var r=n&&n.toUpperCase();return i||s[n]||e[n]||s[r].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(e,t,i){return t||i.slice(1)})})).match(t),a=r.length,l=0;l<a;l+=1){var c=r[l],h=d[c],u=h&&h[0],p=h&&h[1];r[l]=p?{regex:u,parser:p}:c.replace(/^\[|\]$/g,"")}return function(e){for(var t={},i=0,n=0;i<a;i+=1){var s=r[i];if("string"==typeof s)n+=s.length;else{var o=s.regex,l=s.parser,c=e.slice(n),h=o.exec(c)[0];l.call(t,h),e=e.replace(h,"")}}return function(e){var t=e.afternoon;if(void 0!==t){var i=e.hours;t?i<12&&(e.hours+=12):12===i&&(e.hours=0),delete e.afternoon}}(t),t}}return function(e,t,i){i.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(a=e.parseTwoDigitYear);var n=t.prototype,s=n.parse;n.parse=function(e){var t=e.date,n=e.utc,r=e.args;this.$u=n;var a=r[1];if("string"==typeof a){var l=!0===r[2],c=!0===r[3],h=l||c,u=r[2];c&&(u=r[2]),o=this.$locale(),!l&&u&&(o=i.Ls[u]),this.$d=function(e,t,i,n){try{if(["x","X"].indexOf(t)>-1)return new Date(("X"===t?1e3:1)*e);var s=p(t)(e),r=s.year,o=s.month,a=s.day,l=s.hours,c=s.minutes,h=s.seconds,u=s.milliseconds,d=s.zone,g=s.week,f=new Date,m=a||(r||o?1:f.getDate()),y=r||f.getFullYear(),v=0;r&&!o||(v=o>0?o-1:f.getMonth());var b,C=l||0,w=c||0,S=h||0,x=u||0;return d?new Date(Date.UTC(y,v,m,C,w,S,x+60*d.offset*1e3)):i?new Date(Date.UTC(y,v,m,C,w,S,x)):(b=new Date(y,v,m,C,w,S,x),g&&(b=n(b).week(g).toDate()),b)}catch(e){return new Date("")}}(t,a,n,i),this.init(),u&&!0!==u&&(this.$L=this.locale(u).$L),h&&t!=this.format(a)&&(this.$d=new Date("")),o={}}else if(a instanceof Array)for(var d=a.length,g=1;g<=d;g+=1){r[1]=a[g-1];var f=i.apply(this,r);if(f.isValid()){this.$d=f.$d,this.$L=f.$L,this.init();break}g===d&&(this.$d=new Date(""))}else s.call(this,e)}}}()},47045(e){e.exports=function(){"use strict";return function(e,t,i){t.prototype.isBetween=function(e,t,n,s){var r=i(e),o=i(t),a="("===(s=s||"()")[0],l=")"===s[1];return(a?this.isAfter(r,n):!this.isBefore(r,n))&&(l?this.isBefore(o,n):!this.isAfter(o,n))||(a?this.isBefore(r,n):!this.isAfter(r,n))&&(l?this.isAfter(o,n):!this.isBefore(o,n))}}}()},85451(e){e.exports=function(){"use strict";var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(t,i,n){var s=i.prototype,r=s.format;n.en.formats=e,s.format=function(t){void 0===t&&(t="YYYY-MM-DDTHH:mm:ssZ");var i=this.$locale().formats,n=function(t,i){return t.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(t,n,s){var r=s&&s.toUpperCase();return n||i[s]||e[s]||i[r].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(e,t,i){return t||i.slice(1)})})}(t,void 0===i?{}:i);return r.call(this,n)}}}()},6105(e){e.exports=function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(i,n,s){var r,o=function(e,i,n){void 0===n&&(n={});var s=new Date(e),r=function(e,i){void 0===i&&(i={});var n=i.timeZoneName||"short",s=e+"|"+n,r=t[s];return r||(r=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:n}),t[s]=r),r}(i,n);return r.formatToParts(s)},a=function(t,i){for(var n=o(t,i),r=[],a=0;a<n.length;a+=1){var l=n[a],c=l.type,h=l.value,u=e[c];u>=0&&(r[u]=parseInt(h,10))}var d=r[3],p=24===d?0:d,g=r[0]+"-"+r[1]+"-"+r[2]+" "+p+":"+r[4]+":"+r[5]+":000",f=+t;return(s.utc(g).valueOf()-(f-=f%1e3))/6e4},l=n.prototype;l.tz=function(e,t){void 0===e&&(e=r);var i,n=this.utcOffset(),o=this.toDate(),a=o.toLocaleString("en-US",{timeZone:e}),l=Math.round((o-new Date(a))/1e3/60),c=15*-Math.round(o.getTimezoneOffset()/15)-l;if(Number(c)){if(i=s(a,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(c,!0),t){var h=i.utcOffset();i=i.add(n-h,"minute")}}else i=this.utcOffset(0,t);return i.$x.$timezone=e,i},l.offsetName=function(e){var t=this.$x.$timezone||s.tz.guess(),i=o(this.valueOf(),t,{timeZoneName:e}).find(function(e){return"timezonename"===e.type.toLowerCase()});return i&&i.value};var c=l.startOf;l.startOf=function(e,t){if(!this.$x||!this.$x.$timezone)return c.call(this,e,t);var i=s(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return c.call(i,e,t).tz(this.$x.$timezone,!0)},s.tz=function(e,t,i){var n=i&&t,o=i||t||r,l=a(+s(),o);if("string"!=typeof e)return s(e).tz(o);var c=function(e,t,i){var n=e-60*t*1e3,s=a(n,i);if(t===s)return[n,t];var r=a(n-=60*(s-t)*1e3,i);return s===r?[n,s]:[e-60*Math.min(s,r)*1e3,Math.max(s,r)]}(s.utc(e,n).valueOf(),l,o),h=c[0],u=c[1],d=s(h).utcOffset(u);return d.$x.$timezone=o,d},s.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},s.tz.setDefault=function(e){r=e}}}()},61699(e){e.exports=function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,i=/([+-]|\d\d)/g;return function(n,s,r){var o=s.prototype;r.utc=function(e){return new s({date:e,utc:!0,args:arguments})},o.utc=function(t){var i=r(this.toDate(),{locale:this.$L,utc:!0});return t?i.add(this.utcOffset(),e):i},o.local=function(){return r(this.toDate(),{locale:this.$L,utc:!1})};var a=o.parse;o.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),a.call(this,e)};var l=o.init;o.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else l.call(this)};var c=o.utcOffset;o.utcOffset=function(n,s){var r=this.$utils().u;if(r(n))return this.$u?0:r(this.$offset)?c.call(this):this.$offset;if("string"==typeof n&&(n=function(e){void 0===e&&(e="");var n=e.match(t);if(!n)return null;var s=(""+n[0]).match(i)||["-",0,0],r=s[0],o=60*+s[1]+ +s[2];return 0===o?0:"+"===r?o:-o}(n),null===n))return this;var o=Math.abs(n)<=16?60*n:n;if(0===o)return this.utc(s);var a=this.clone();if(s)return a.$offset=o,a.$u=!1,a;var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(a=this.local().add(o+l,e)).$offset=o,a.$x.$localOffset=l,a};var h=o.format;o.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return h.call(this,t)},o.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var u=o.toDate;o.toDate=function(e){return"s"===e&&this.$offset?r(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():u.call(this)};var d=o.diff;o.diff=function(e,t,i){if(e&&this.$u===e.$u)return d.call(this,e,t,i);var n=this.local(),s=r(e).local();return d.call(n,s,t,i)}}}()},64881(e){e.exports=function(){"use strict";var e="week",t="year";return function(i,n,s){var r=n.prototype;r.week=function(i){if(void 0===i&&(i=null),null!==i)return this.add(7*(i-this.week()),"day");var n=this.$locale().yearStart||1;if(11===this.month()&&this.date()>25){var r=s(this).startOf(t).add(1,t).date(n),o=s(this).endOf(e);if(r.isBefore(o))return 1}var a=s(this).startOf(t).date(n).startOf(e).subtract(1,"millisecond"),l=this.diff(a,e,!0);return l<0?s(this).startOf("week").week():Math.ceil(l)},r.weeks=function(e){return void 0===e&&(e=null),this.week(e)}}}()},89028(e,t,i){var n=i(85409);function s(){var e;try{e=t.storage.debug}catch(e){}return!e&&void 0!==n&&"env"in n&&(e={NODE_ENV:"production",REACT_APP_LEARN_THUMBNAIL_UPLOAD:"https://vbmmdf81nl.execute-api.eu-west-2.amazonaws.com/live/learnthumbnailupload",REACT_APP_COGNITO_DOMAIN:"rio.auth.eu-west-2.amazoncognito.com",REACT_APP_RESOLVE_EXTERNAL_USER_URL:"https://zp73c6vc5l.execute-api.eu-west-2.amazonaws.com/current/resolve-external-user",REACT_APP_IDENTITY_POOL_ID:"eu-west-2:2fee832d-d0ba-420c-a056-0ed865cde419",REACT_APP_PROFILE_BUCKET:"https://platform-profilepictures-live.s3.eu-west-2.amazonaws.com",REACT_APP_BANNER_CONTENT:"/VIDEO/LearnBanner.mp4",REACT_APP_AG_GRID_LICENSE_KEY:"Using_this_{AG_Grid}_Enterprise_key_{AG-063287}_in_excess_of_the_licence_granted_is_not_permitted___Please_report_misuse_to_legal@ag-grid.com___For_help_with_changing_this_key_please_contact_info@ag-grid.com___{RIO_ESG_LTD}_is_granted_a_{Single_Application}_Developer_License_for_the_application_{Rio}_only_for_{1}_Front-End_JavaScript_developer___All_Front-End_JavaScript_developers_working_on_{Rio}_need_to_be_licensed___{Rio}_has_been_granted_a_Deployment_License_Add-on_for_{1}_Production_Environment___This_key_works_with_{AG_Grid}_Enterprise_versions_released_before_{30_September_2025}____[v3]_[01]_MTc1OTE4NjgwMDAwMA==8e1b4570338f7c27ca6155479e1e2c14",REACT_APP_DS_URL:"https://rio.ai",REACT_APP_LOCATION_PICTURE_BUCKET:"https://platform-location-pictures-live.s3.eu-west-2.amazonaws.com",REACT_APP_GOOGLE_ANALYTIC_KEY:"UA-74511216-3",REACT_APP_AG_CHARTS_LICENSE_KEY:"Using_this_{AG_Charts}_Enterprise_key_{AG-100671}_in_excess_of_the_licence_granted_is_not_permitted___Please_report_misuse_to_legal@ag-grid.com___For_help_with_changing_this_key_please_contact_info@ag-grid.com___{Rio_AI_Ltd}_is_granted_a_{Single_Application}_Developer_License_for_the_application_{Rio}_only_for_{1}_Front-End_JavaScript_developer___All_Front-End_JavaScript_developers_working_on_{Rio}_need_to_be_licensed___{Rio}_has_been_granted_a_Deployment_License_Add-on_for_{1}_Production_Environment___This_key_works_with_{AG_Charts}_Enterprise_versions_released_before_{28_March_2027}____[v3]_[02]_MTgwNjE5MjAwMDAwMA==388e7d5fd16c7af6f350e7707024b637",REACT_APP_IMPACT_LOCATIONS_MAP_ID:"b3c1bd97c9d0fbf8",REACT_APP_DOCUMENT_UPLOAD:"https://1iyju5wg22.execute-api.eu-west-1.amazonaws.com/dev/documentupload",REACT_APP_INTELLIGENCE_API_STAGE:"live",REACT_APP_CONSULTATIONS_URL:"https://inference-engine.esg-r.io/api",REACT_APP_ENVIRONMENT_NAME:"Live",REACT_APP_USER_POOL_ID:"eu-west-2_CXMj8XQn0",REACT_APP_USER_POOL_WEB_CLIENT_ID:"2a8c10u5721464di89s75deqbr",REACT_APP_ANALYST_AGENT_ENDPOINT:"https://bedrock-agentcore.eu-west-2.amazonaws.com/runtimes/arn%3Aaws%3Abedrock-agentcore%3Aeu-west-2%3A523523762637%3Aruntime%2Fdata_analysis_agent_prod-FHjO5N5Zv7/invocations?qualifier=DEFAULT",REACT_APP_SENTRY_ENV:"LIVE",REACT_APP_BASE_URL:"https://sustainability.rio.ai",REACT_APP_DROMO_LICENSE_KEY:"a1fc32a8-fb02-4546-ad17-74254111f991",REACT_APP_HUBSPOT_TRACKER:"3847934",REACT_APP_GOOGLE_MAP_API_KEY:"AIzaSyD0bNhOInxPo2plOg1oxsYHeOsIXdefauE",REACT_APP_DASHBOARD_DATA_API_URL:"",REACT_APP_AZURE_SSO_APP_ID:"f7c97800-e70d-43a3-800e-64b6ba778a31",REACT_APP_SENTRY_RELEASE:"85df3110fa7a2b8304fe361da0b891146f871ce2",REACT_APP_AWS_REGION:"eu-west-2",REACT_APP_PINPOINT_REGION:"us-east-1",REACT_APP_GRAPHQL_URI:"https://kmkdrdo3dzcvnkzqzfnmfuwt4m.appsync-api.eu-west-2.amazonaws.com/graphql",REACT_APP_PINPOINT_APP_CLIENT_ID:"1b81e38efb7546329dd7eb32e0088b29"}.DEBUG),e}(t=e.exports=i(41111)).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var i=this.useColors;if(e[0]=(i?"%c":"")+this.namespace+(i?" %c":" ")+e[0]+(i?"%c ":" ")+"+"+t.humanize(this.diff),i){var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var s=0,r=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(s++,"%c"===e&&(r=s))}),e.splice(r,0,n)}},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=s,t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(s())},41111(e,t,i){var n;function s(e){function i(){if(i.enabled){var e=i,s=+new Date,r=s-(n||s);e.diff=r,e.prev=n,e.curr=s,n=s;for(var o=new Array(arguments.length),a=0;a<o.length;a++)o[a]=arguments[a];o[0]=t.coerce(o[0]),"string"!=typeof o[0]&&o.unshift("%O");var l=0;o[0]=o[0].replace(/%([a-zA-Z%])/g,function(i,n){if("%%"===i)return i;l++;var s=t.formatters[n];if("function"==typeof s){var r=o[l];i=s.call(e,r),o.splice(l,1),l--}return i}),t.formatArgs.call(e,o),(i.log||t.log||console.log.bind(console)).apply(e,o)}}return i.namespace=e,i.enabled=t.enabled(e),i.useColors=t.useColors(),i.color=function(e){var i,n=0;for(i in e)n=(n<<5)-n+e.charCodeAt(i),n|=0;return t.colors[Math.abs(n)%t.colors.length]}(e),"function"==typeof t.init&&t.init(i),i}(t=e.exports=s.debug=s.default=s).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){t.save(e),t.names=[],t.skips=[];for(var i=("string"==typeof e?e:"").split(/[\s,]+/),n=i.length,s=0;s<n;s++)i[s]&&("-"===(e=i[s].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){var i,n;for(i=0,n=t.skips.length;i<n;i++)if(t.skips[i].test(e))return!1;for(i=0,n=t.names.length;i<n;i++)if(t.names[i].test(e))return!0;return!1},t.humanize=i(36644),t.names=[],t.skips=[],t.formatters={}},2858(e){"use strict";var t="%[a-f0-9]{2}",i=new RegExp("("+t+")|([^%]+?)","gi"),n=new RegExp("("+t+")+","gi");function s(e,t){try{return[decodeURIComponent(e.join(""))]}catch(e){}if(1===e.length)return e;t=t||1;var i=e.slice(0,t),n=e.slice(t);return Array.prototype.concat.call([],s(i),s(n))}function r(e){try{return decodeURIComponent(e)}catch(r){for(var t=e.match(i)||[],n=1;n<t.length;n++)t=(e=s(t,n).join("")).match(i)||[];return e}}e.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return function(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},i=n.exec(e);i;){try{t[i[0]]=decodeURIComponent(i[0])}catch(e){var s=r(i[0]);s!==i[0]&&(t[i[0]]=s)}i=n.exec(e)}t["%C2"]="�";for(var o=Object.keys(t),a=0;a<o.length;a++){var l=o[a];e=e.replace(new RegExp(l,"g"),t[l])}return e}(e)}}},74579(e){"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===i}(e)}(e)},i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(e,t){return!1!==t.clone&&t.isMergeableObject(e)?a((i=e,Array.isArray(i)?[]:{}),e,t):e;var i}function s(e,t,i){return e.concat(t).map(function(e){return n(e,i)})}function r(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}(e))}function o(e,t){try{return t in e}catch(e){return!1}}function a(e,i,l){(l=l||{}).arrayMerge=l.arrayMerge||s,l.isMergeableObject=l.isMergeableObject||t,l.cloneUnlessOtherwiseSpecified=n;var c=Array.isArray(i);return c===Array.isArray(e)?c?l.arrayMerge(e,i,l):function(e,t,i){var s={};return i.isMergeableObject(e)&&r(e).forEach(function(t){s[t]=n(e[t],i)}),r(t).forEach(function(r){(function(e,t){return o(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,r)||(o(e,r)&&i.isMergeableObject(t[r])?s[r]=function(e,t){if(!t.customMerge)return a;var i=t.customMerge(e);return"function"==typeof i?i:a}(r,i)(e[r],t[r],i):s[r]=n(t[r],i))}),s}(e,i,l):n(i,l)}a.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,i){return a(e,i,t)},{})};var l=a;e.exports=l},20022(e,t,i){"use strict";var n=i(39886),s=i(63429),r=i(71102),o=i(25667);e.exports=function(e,t,i){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new r("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new r("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new r("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new r("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new r("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new r("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,h=arguments.length>6&&arguments[6],u=!!o&&o(e,t);if(n)n(e,t,{configurable:null===c&&u?u.configurable:!c,enumerable:null===a&&u?u.enumerable:!a,value:i,writable:null===l&&u?u.writable:!l});else{if(!h&&(a||l||c))throw new s("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=i}}},88754(e,t,i){"use strict";t.utils=i(26012),t.Cipher=i(96242),t.DES=i(7325),t.CBC=i(39015),t.EDE=i(62597)},39015(e,t,i){"use strict";var n=i(35578),s=i(91193),r={};function o(e){n.equal(e.length,8,"Invalid IV length"),this.iv=new Array(8);for(var t=0;t<this.iv.length;t++)this.iv[t]=e[t]}t.instantiate=function(e){function t(t){e.call(this,t),this._cbcInit()}s(t,e);for(var i=Object.keys(r),n=0;n<i.length;n++){var o=i[n];t.prototype[o]=r[o]}return t.create=function(e){return new t(e)},t},r._cbcInit=function(){var e=new o(this.options.iv);this._cbcState=e},r._update=function(e,t,i,n){var s=this._cbcState,r=this.constructor.super_.prototype,o=s.iv;if("encrypt"===this.type){for(var a=0;a<this.blockSize;a++)o[a]^=e[t+a];for(r._update.call(this,o,0,i,n),a=0;a<this.blockSize;a++)o[a]=i[n+a]}else{for(r._update.call(this,e,t,i,n),a=0;a<this.blockSize;a++)i[n+a]^=o[a];for(a=0;a<this.blockSize;a++)o[a]=e[t+a]}}},96242(e,t,i){"use strict";var n=i(35578);function s(e){this.options=e,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=!1!==e.padding}e.exports=s,s.prototype._init=function(){},s.prototype.update=function(e){return 0===e.length?[]:"decrypt"===this.type?this._updateDecrypt(e):this._updateEncrypt(e)},s.prototype._buffer=function(e,t){for(var i=Math.min(this.buffer.length-this.bufferOff,e.length-t),n=0;n<i;n++)this.buffer[this.bufferOff+n]=e[t+n];return this.bufferOff+=i,i},s.prototype._flushBuffer=function(e,t){return this._update(this.buffer,0,e,t),this.bufferOff=0,this.blockSize},s.prototype._updateEncrypt=function(e){var t=0,i=0,n=(this.bufferOff+e.length)/this.blockSize|0,s=new Array(n*this.blockSize);0!==this.bufferOff&&(t+=this._buffer(e,t),this.bufferOff===this.buffer.length&&(i+=this._flushBuffer(s,i)));for(var r=e.length-(e.length-t)%this.blockSize;t<r;t+=this.blockSize)this._update(e,t,s,i),i+=this.blockSize;for(;t<e.length;t++,this.bufferOff++)this.buffer[this.bufferOff]=e[t];return s},s.prototype._updateDecrypt=function(e){for(var t=0,i=0,n=Math.ceil((this.bufferOff+e.length)/this.blockSize)-1,s=new Array(n*this.blockSize);n>0;n--)t+=this._buffer(e,t),i+=this._flushBuffer(s,i);return t+=this._buffer(e,t),s},s.prototype.final=function(e){var t,i;return e&&(t=this.update(e)),i="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(i):i},s.prototype._pad=function(e,t){if(0===t)return!1;for(;t<e.length;)e[t++]=0;return!0},s.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var e=new Array(this.blockSize);return this._update(this.buffer,0,e,0),e},s.prototype._unpad=function(e){return e},s.prototype._finalDecrypt=function(){n.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var e=new Array(this.blockSize);return this._flushBuffer(e,0),this._unpad(e)}},7325(e,t,i){"use strict";var n=i(35578),s=i(91193),r=i(26012),o=i(96242);function a(){this.tmp=new Array(2),this.keys=null}function l(e){o.call(this,e);var t=new a;this._desState=t,this.deriveKeys(t,e.key)}s(l,o),e.exports=l,l.create=function(e){return new l(e)};var c=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];l.prototype.deriveKeys=function(e,t){e.keys=new Array(32),n.equal(t.length,this.blockSize,"Invalid key length");var i=r.readUInt32BE(t,0),s=r.readUInt32BE(t,4);r.pc1(i,s,e.tmp,0),i=e.tmp[0],s=e.tmp[1];for(var o=0;o<e.keys.length;o+=2){var a=c[o>>>1];i=r.r28shl(i,a),s=r.r28shl(s,a),r.pc2(i,s,e.keys,o)}},l.prototype._update=function(e,t,i,n){var s=this._desState,o=r.readUInt32BE(e,t),a=r.readUInt32BE(e,t+4);r.ip(o,a,s.tmp,0),o=s.tmp[0],a=s.tmp[1],"encrypt"===this.type?this._encrypt(s,o,a,s.tmp,0):this._decrypt(s,o,a,s.tmp,0),o=s.tmp[0],a=s.tmp[1],r.writeUInt32BE(i,o,n),r.writeUInt32BE(i,a,n+4)},l.prototype._pad=function(e,t){if(!1===this.padding)return!1;for(var i=e.length-t,n=t;n<e.length;n++)e[n]=i;return!0},l.prototype._unpad=function(e){if(!1===this.padding)return e;for(var t=e[e.length-1],i=e.length-t;i<e.length;i++)n.equal(e[i],t);return e.slice(0,e.length-t)},l.prototype._encrypt=function(e,t,i,n,s){for(var o=t,a=i,l=0;l<e.keys.length;l+=2){var c=e.keys[l],h=e.keys[l+1];r.expand(a,e.tmp,0),c^=e.tmp[0],h^=e.tmp[1];var u=r.substitute(c,h),d=a;a=(o^r.permute(u))>>>0,o=d}r.rip(a,o,n,s)},l.prototype._decrypt=function(e,t,i,n,s){for(var o=i,a=t,l=e.keys.length-2;l>=0;l-=2){var c=e.keys[l],h=e.keys[l+1];r.expand(o,e.tmp,0),c^=e.tmp[0],h^=e.tmp[1];var u=r.substitute(c,h),d=o;o=(a^r.permute(u))>>>0,a=d}r.rip(o,a,n,s)}},62597(e,t,i){"use strict";var n=i(35578),s=i(91193),r=i(96242),o=i(7325);function a(e,t){n.equal(t.length,24,"Invalid key length");var i=t.slice(0,8),s=t.slice(8,16),r=t.slice(16,24);this.ciphers="encrypt"===e?[o.create({type:"encrypt",key:i}),o.create({type:"decrypt",key:s}),o.create({type:"encrypt",key:r})]:[o.create({type:"decrypt",key:r}),o.create({type:"encrypt",key:s}),o.create({type:"decrypt",key:i})]}function l(e){r.call(this,e);var t=new a(this.type,this.options.key);this._edeState=t}s(l,r),e.exports=l,l.create=function(e){return new l(e)},l.prototype._update=function(e,t,i,n){var s=this._edeState;s.ciphers[0]._update(e,t,i,n),s.ciphers[1]._update(i,n,i,n),s.ciphers[2]._update(i,n,i,n)},l.prototype._pad=o.prototype._pad,l.prototype._unpad=o.prototype._unpad},26012(e,t){"use strict";t.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},t.writeUInt32BE=function(e,t,i){e[0+i]=t>>>24,e[1+i]=t>>>16&255,e[2+i]=t>>>8&255,e[3+i]=255&t},t.ip=function(e,t,i,n){for(var s=0,r=0,o=6;o>=0;o-=2){for(var a=0;a<=24;a+=8)s<<=1,s|=t>>>a+o&1;for(a=0;a<=24;a+=8)s<<=1,s|=e>>>a+o&1}for(o=6;o>=0;o-=2){for(a=1;a<=25;a+=8)r<<=1,r|=t>>>a+o&1;for(a=1;a<=25;a+=8)r<<=1,r|=e>>>a+o&1}i[n+0]=s>>>0,i[n+1]=r>>>0},t.rip=function(e,t,i,n){for(var s=0,r=0,o=0;o<4;o++)for(var a=24;a>=0;a-=8)s<<=1,s|=t>>>a+o&1,s<<=1,s|=e>>>a+o&1;for(o=4;o<8;o++)for(a=24;a>=0;a-=8)r<<=1,r|=t>>>a+o&1,r<<=1,r|=e>>>a+o&1;i[n+0]=s>>>0,i[n+1]=r>>>0},t.pc1=function(e,t,i,n){for(var s=0,r=0,o=7;o>=5;o--){for(var a=0;a<=24;a+=8)s<<=1,s|=t>>a+o&1;for(a=0;a<=24;a+=8)s<<=1,s|=e>>a+o&1}for(a=0;a<=24;a+=8)s<<=1,s|=t>>a+o&1;for(o=1;o<=3;o++){for(a=0;a<=24;a+=8)r<<=1,r|=t>>a+o&1;for(a=0;a<=24;a+=8)r<<=1,r|=e>>a+o&1}for(a=0;a<=24;a+=8)r<<=1,r|=e>>a+o&1;i[n+0]=s>>>0,i[n+1]=r>>>0},t.r28shl=function(e,t){return e<<t&268435455|e>>>28-t};var i=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];t.pc2=function(e,t,n,s){for(var r=0,o=0,a=i.length>>>1,l=0;l<a;l++)r<<=1,r|=e>>>i[l]&1;for(l=a;l<i.length;l++)o<<=1,o|=t>>>i[l]&1;n[s+0]=r>>>0,n[s+1]=o>>>0},t.expand=function(e,t,i){var n=0,s=0;n=(1&e)<<5|e>>>27;for(var r=23;r>=15;r-=4)n<<=6,n|=e>>>r&63;for(r=11;r>=3;r-=4)s|=e>>>r&63,s<<=6;s|=(31&e)<<1|e>>>31,t[i+0]=n>>>0,t[i+1]=s>>>0};var n=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];t.substitute=function(e,t){for(var i=0,s=0;s<4;s++)i<<=4,i|=n[64*s+(e>>>18-6*s&63)];for(s=0;s<4;s++)i<<=4,i|=n[256+64*s+(t>>>18-6*s&63)];return i>>>0};var s=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];t.permute=function(e){for(var t=0,i=0;i<s.length;i++)t<<=1,t|=e>>>s[i]&1;return t>>>0},t.padSplit=function(e,t,i){for(var n=e.toString(2);n.length<t;)n="0"+n;for(var s=[],r=0;r<t;r+=i)s.push(n.slice(r,r+i));return s.join(" ")}},58216(e,t,i){var n=i(25122),s=i(37821),r=i(29242),o={binary:!0,hex:!0,base64:!0};t.DiffieHellmanGroup=t.createDiffieHellmanGroup=t.getDiffieHellman=function(e){var t=new Buffer(s[e].prime,"hex"),i=new Buffer(s[e].gen,"hex");return new r(t,i)},t.createDiffieHellman=t.DiffieHellman=function e(t,i,s,a){return Buffer.isBuffer(i)||void 0===o[i]?e(t,"binary",i,s):(i=i||"binary",a=a||"binary",s=s||new Buffer([2]),Buffer.isBuffer(s)||(s=new Buffer(s,a)),"number"==typeof t?new r(n(t,s),s,!0):(Buffer.isBuffer(t)||(t=new Buffer(t,i)),new r(t,s,!0)))}},29242(e,t,i){var n=i(5630),s=new(i(74442)),r=new n(24),o=new n(11),a=new n(10),l=new n(3),c=new n(7),h=i(25122),u=i(82869);function d(e,t){return t=t||"utf8",Buffer.isBuffer(e)||(e=new Buffer(e,t)),this._pub=new n(e),this}function p(e,t){return t=t||"utf8",Buffer.isBuffer(e)||(e=new Buffer(e,t)),this._priv=new n(e),this}e.exports=f;var g={};function f(e,t,i){this.setGenerator(t),this.__prime=new n(e),this._prime=n.mont(this.__prime),this._primeLen=e.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,i?(this.setPublicKey=d,this.setPrivateKey=p):this._primeCode=8}function m(e,t){var i=new Buffer(e.toArray());return t?i.toString(t):i}Object.defineProperty(f.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(e,t){var i=t.toString("hex"),n=[i,e.toString(16)].join("_");if(n in g)return g[n];var u,d=0;if(e.isEven()||!h.simpleSieve||!h.fermatTest(e)||!s.test(e))return d+=1,d+="02"===i||"05"===i?8:4,g[n]=d,d;switch(s.test(e.shrn(1))||(d+=2),i){case"02":e.mod(r).cmp(o)&&(d+=8);break;case"05":(u=e.mod(a)).cmp(l)&&u.cmp(c)&&(d+=8);break;default:d+=4}return g[n]=d,d}(this.__prime,this.__gen)),this._primeCode}}),f.prototype.generateKeys=function(){return this._priv||(this._priv=new n(u(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},f.prototype.computeSecret=function(e){var t=(e=(e=new n(e)).toRed(this._prime)).redPow(this._priv).fromRed(),i=new Buffer(t.toArray()),s=this.getPrime();if(i.length<s.length){var r=new Buffer(s.length-i.length);r.fill(0),i=Buffer.concat([r,i])}return i},f.prototype.getPublicKey=function(e){return m(this._pub,e)},f.prototype.getPrivateKey=function(e){return m(this._priv,e)},f.prototype.getPrime=function(e){return m(this.__prime,e)},f.prototype.getGenerator=function(e){return m(this._gen,e)},f.prototype.setGenerator=function(e,t){return t=t||"utf8",Buffer.isBuffer(e)||(e=new Buffer(e,t)),this.__gen=e,this._gen=new n(e),this}},25122(e,t,i){var n=i(82869);e.exports=v,v.simpleSieve=m,v.fermatTest=y;var s=i(5630),r=new s(24),o=new(i(74442)),a=new s(1),l=new s(2),c=new s(5),h=(new s(16),new s(8),new s(10)),u=new s(3),d=(new s(7),new s(11)),p=new s(4),g=(new s(12),null);function f(){if(null!==g)return g;var e=[];e[0]=2;for(var t=1,i=3;i<1048576;i+=2){for(var n=Math.ceil(Math.sqrt(i)),s=0;s<t&&e[s]<=n&&i%e[s]!==0;s++);t!==s&&e[s]<=n||(e[t++]=i)}return g=e,e}function m(e){for(var t=f(),i=0;i<t.length;i++)if(0===e.modn(t[i]))return 0===e.cmpn(t[i]);return!0}function y(e){var t=s.mont(e);return 0===l.toRed(t).redPow(e.subn(1)).fromRed().cmpn(1)}function v(e,t){if(e<16)return new s(2===t||5===t?[140,123]:[140,39]);var i,g;for(t=new s(t);;){for(i=new s(n(Math.ceil(e/8)));i.bitLength()>e;)i.ishrn(1);if(i.isEven()&&i.iadd(a),i.testn(1)||i.iadd(l),t.cmp(l)){if(!t.cmp(c))for(;i.mod(h).cmp(u);)i.iadd(p)}else for(;i.mod(r).cmp(d);)i.iadd(p);if(m(g=i.shrn(1))&&m(i)&&y(g)&&y(i)&&o.test(g)&&o.test(i))return i}}},24310(e,t,i){"use strict";function n(e,t){e.classList?e.classList.add(t):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(e,t)||("string"==typeof e.className?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}i.d(t,{A:()=>n})},48532(e,t,i){"use strict";function n(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function s(e,t){e.classList?e.classList.remove(t):"string"==typeof e.className?e.className=n(e.className,t):e.setAttribute("class",n(e.className&&e.className.baseVal||"",t))}i.d(t,{A:()=>s})},38383(e,t,i){"use strict";const n=i(72856),s=new Set(["__proto__","prototype","constructor"]);function r(e){const t=e.split("."),i=[];for(let e=0;e<t.length;e++){let n=t[e];for(;"\\"===n[n.length-1]&&void 0!==t[e+1];)n=n.slice(0,-1)+".",n+=t[++e];i.push(n)}return i.some(e=>s.has(e))?[]:i}e.exports={get(e,t,i){if(!n(e)||"string"!=typeof t)return void 0===i?e:i;const s=r(t);if(0!==s.length){for(let t=0;t<s.length;t++)if(null==(e=e[s[t]])){if(t!==s.length-1)return i;break}return void 0===e?i:e}},set(e,t,i){if(!n(e)||"string"!=typeof t)return e;const s=e,o=r(t);for(let t=0;t<o.length;t++){const s=o[t];n(e[s])||(e[s]={}),t===o.length-1&&(e[s]=i),e=e[s]}return s},delete(e,t){if(!n(e)||"string"!=typeof t)return!1;const i=r(t);for(let t=0;t<i.length;t++){const s=i[t];if(t===i.length-1)return delete e[s],!0;if(e=e[s],!n(e))return!1}},has(e,t){if(!n(e)||"string"!=typeof t)return!1;const i=r(t);if(0===i.length)return!1;for(let t=0;t<i.length;t++){if(!n(e))return!1;if(!(i[t]in e))return!1;e=e[i[t]]}return!0}}},59629(e,t,i){"use strict";i.d(t,{Bp:()=>X});var n=i(12975),s=i(69932),r=i(5821),o=i.n(r),a=i(22155);i(77880);let l=e=>"object"==typeof e&&null!=e&&1===e.nodeType,c=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,h=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let i=getComputedStyle(e,null);return c(i.overflowY,t)||c(i.overflowX,t)||(e=>{let t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},u=(e,t,i,n,s,r,o,a)=>r<e&&o>t||r>e&&o<t?0:r<=e&&a<=i||o>=t&&a>=i?r-e-n:o>t&&a<i||r<e&&a>i?o-t+s:0,d=e=>{let t=e.parentElement;return null==t?e.getRootNode().host||null:t};var p=i(65959),g=0;function f(){}function m(e,t,i){return e===t||t instanceof i.Node&&e.contains&&e.contains(t)}function y(e,t){var i;function n(){i&&clearTimeout(i)}function s(){for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];n(),i=setTimeout(function(){i=null,e.apply(void 0,r)},t)}return s.cancel=n,s}function v(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return function(e){for(var i=arguments.length,n=new Array(i>1?i-1:0),s=1;s<i;s++)n[s-1]=arguments[s];return t.some(function(t){return t&&t.apply(void 0,[e].concat(n)),e.preventDownshiftDefault||e.hasOwnProperty("nativeEvent")&&e.nativeEvent.preventDownshiftDefault})}}function b(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return function(e){t.forEach(function(t){"function"==typeof t?t(e):t&&(t.current=e)})}}function C(e,t){return Object.keys(e).reduce(function(i,n){return i[n]=w(t,n)?t[n]:e[n],i},{})}function w(e,t){return void 0!==e[t]}function S(e,t,i,n,s){if(void 0===s&&(s=!0),0===i)return-1;var r=i-1;("number"!=typeof t||t<0||t>=i)&&(t=e>0?-1:r+1);var o=t+e;o<0?o=s?r:0:o>r&&(o=s?0:r);var a=x(e,o,i,n,s);return-1===a?t>=i?-1:t:a}function x(e,t,i,n,s){var r=n(t);if(!r||!r.hasAttribute("disabled"))return t;if(e>0){for(var o=t+1;o<i;o++)if(!n(o).hasAttribute("disabled"))return o}else for(var a=t-1;a>=0;a--)if(!n(a).hasAttribute("disabled"))return a;return s?e>0?x(1,0,i,n,!1):x(-1,i-1,i,n,!1):-1}function E(e,t,i,n){return void 0===n&&(n=!0),t.some(function(t){return t&&(m(t,e,i)||n&&m(t,i.document.activeElement,i))})}var A=y(function(e){M(e).textContent=""},500);function M(e){void 0===e&&(e=document);var t=e.getElementById("a11y-status-message");return t||((t=e.createElement("div")).setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}var T=["isInitialMount","highlightedIndex","items","environment"],D={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};var I=y(function(e,t){var i,n,s;i=e(),s=M(n=t),i&&(s.textContent=i,A(n))},200),R="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?a.useLayoutEffect:a.useEffect;function k(e){var t=e.id,i=void 0===t?"downshift-"+String(g++):t,n=e.labelId,s=e.menuId,r=e.getItemId,o=e.toggleButtonId,l=e.inputId;return(0,a.useRef)({labelId:n||i+"-label",menuId:s||i+"-menu",getItemId:r||function(e){return i+"-item-"+e},toggleButtonId:o||i+"-toggle-button",inputId:l||i+"-input"}).current}function P(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function _(e){var t=(0,a.useRef)(e);return t.current=e,t}function L(e,t,i){var n=(0,a.useRef)(),r=(0,a.useRef)(),o=(0,a.useCallback)(function(t,i){r.current=i,t=C(t,i.props);var n=e(t,i);return i.props.stateReducer(t,(0,s.A)({},i,{changes:n}))},[e]),l=(0,a.useReducer)(o,t),c=l[0],h=l[1],u=_(i),d=(0,a.useCallback)(function(e){return h((0,s.A)({props:u.current},e))},[u]),p=r.current;return(0,a.useEffect)(function(){p&&n.current&&n.current!==c&&function(e,t,i){var n=e.props,r=e.type,o={};Object.keys(t).forEach(function(n){!function(e,t,i,n){var r=t.props,o=t.type,a="on"+P(e)+"Change";r[a]&&void 0!==n[e]&&n[e]!==i[e]&&r[a]((0,s.A)({type:o},n))}(n,e,t,i),i[n]!==t[n]&&(o[n]=i[n])}),n.onStateChange&&Object.keys(o).length&&n.onStateChange((0,s.A)({type:r},o))}(p,C(n.current,p.props),c),n.current=c},[c,i,p]),[c,d]}var N={itemToString:function(e){return e?String(e):""},stateReducer:function(e,t){return t.changes},getA11ySelectionMessage:function(e){var t=e.selectedItem,i=e.itemToString;return t?i(t)+" has been selected.":""},scrollIntoView:function(e,t){if(e){var i=((e,t)=>{var i,n,s,r,o,a;if("undefined"==typeof document)return[];let{scrollMode:c,block:p,inline:g,boundary:f,skipOverflowHiddenElements:m}=t,y="function"==typeof f?f:e=>e!==f;if(!l(e))throw new TypeError("Invalid target");let v=document.scrollingElement||document.documentElement,b=[],C=e;for(;l(C)&&y(C);){if(C=d(C),C===v){b.push(C);break}null!=C&&C===document.body&&h(C)&&!h(document.documentElement)||null!=C&&h(C,m)&&b.push(C)}let w=null!=(n=null==(i=window.visualViewport)?void 0:i.width)?n:innerWidth,S=null!=(r=null==(s=window.visualViewport)?void 0:s.height)?r:innerHeight,x=null!=(o=window.scrollX)?o:pageXOffset,E=null!=(a=window.scrollY)?a:pageYOffset,{height:A,width:M,top:T,right:D,bottom:I,left:R}=e.getBoundingClientRect(),k="start"===p||"nearest"===p?T:"end"===p?I:T+A/2,P="center"===g?R+M/2:"end"===g?D:R,_=[];for(let e=0;e<b.length;e++){let t=b[e],{height:i,width:n,top:s,right:r,bottom:o,left:a}=t.getBoundingClientRect();if("if-needed"===c&&T>=0&&R>=0&&I<=S&&D<=w&&T>=s&&I<=o&&R>=a&&D<=r)return _;let l=getComputedStyle(t),h=parseInt(l.borderLeftWidth,10),d=parseInt(l.borderTopWidth,10),f=parseInt(l.borderRightWidth,10),m=parseInt(l.borderBottomWidth,10),y=0,C=0,L="offsetWidth"in t?t.offsetWidth-t.clientWidth-h-f:0,N="offsetHeight"in t?t.offsetHeight-t.clientHeight-d-m:0,O="offsetWidth"in t?0===t.offsetWidth?0:n/t.offsetWidth:0,F="offsetHeight"in t?0===t.offsetHeight?0:i/t.offsetHeight:0;if(v===t)y="start"===p?k:"end"===p?k-S:"nearest"===p?u(E,E+S,S,d,m,E+k,E+k+A,A):k-S/2,C="start"===g?P:"center"===g?P-w/2:"end"===g?P-w:u(x,x+w,w,h,f,x+P,x+P+M,M),y=Math.max(0,y+E),C=Math.max(0,C+x);else{y="start"===p?k-s-d:"end"===p?k-o+m+N:"nearest"===p?u(s,o,i,d,m+N,k,k+A,A):k-(s+i/2)+N/2,C="start"===g?P-a-h:"center"===g?P-(a+n/2)+L/2:"end"===g?P-r+f+L:u(a,r,n,h,f+L,P,P+M,M);let{scrollLeft:e,scrollTop:l}=t;y=Math.max(0,Math.min(l+y/F,t.scrollHeight-i/F+N)),C=Math.max(0,Math.min(e+C/O,t.scrollWidth-n/O+L)),k+=l-y,P+=e-C}_.push({el:t,top:y,left:C})}return _})(e,{boundary:t,block:"nearest",scrollMode:"if-needed"});i.forEach(function(e){var t=e.el,i=e.top,n=e.left;t.scrollTop=i,t.scrollLeft=n})}},environment:"undefined"==typeof window?{}:window};function O(e,t,i){void 0===i&&(i=D);var n=e["default"+P(t)];return void 0!==n?n:i[t]}function F(e,t,i){void 0===i&&(i=D);var n=e[t];if(void 0!==n)return n;var s=e["initial"+P(t)];return void 0!==s?s:O(e,t,i)}function G(e,t,i){var n=e.items,s=e.initialHighlightedIndex,r=e.defaultHighlightedIndex,o=t.selectedItem,a=t.highlightedIndex;return 0===n.length?-1:void 0!==s&&a===s?s:void 0!==r?r:o?n.indexOf(o):0===i?-1:i<0?n.length-1:0}function B(e,t,i){var r=i.isInitialMount,o=i.highlightedIndex,l=i.items,c=i.environment,h=(0,n.A)(i,T);(0,a.useEffect)(function(){r||I(function(){return e((0,s.A)({highlightedIndex:o,highlightedItem:l[o],resultCount:l.length},h))},c.document)},t)}var V=f;function H(e,t,i){var n;void 0===i&&(i=!0);var r=(null==(n=e.items)?void 0:n.length)&&t>=0;return(0,s.A)({isOpen:!1,highlightedIndex:-1},r&&(0,s.A)({selectedItem:e.items[t],isOpen:O(e,"isOpen"),highlightedIndex:O(e,"highlightedIndex")},i&&{inputValue:e.itemToString(e.items[t])}))}o().array.isRequired,o().func,o().func,o().func,o().number,o().number,o().number,o().bool,o().bool,o().bool,o().any,o().any,o().any,o().string,o().string,o().string,o().func,o().string,o().func,o().func,o().func,o().func,o().func,o().shape({addEventListener:o().func,removeEventListener:o().func,document:o().shape({getElementById:o().func,activeElement:o().any,body:o().any})}),(0,p.__assign)((0,p.__assign)({},N),{getA11yStatusMessage:function(e){var t=e.isOpen,i=e.resultCount,n=e.previousResultCount;return t?i?i!==n?"".concat(i," result").concat(1===i?" is":"s are"," available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select."):"":"No results are available.":""}});var U=Object.freeze({__proto__:null,InputKeyDownArrowDown:0,InputKeyDownArrowUp:1,InputKeyDownEscape:2,InputKeyDownHome:3,InputKeyDownEnd:4,InputKeyDownPageUp:5,InputKeyDownPageDown:6,InputKeyDownEnter:7,InputChange:8,InputBlur:9,InputFocus:10,MenuMouseLeave:11,ItemMouseMove:12,ItemClick:13,ToggleButtonClick:14,FunctionToggleMenu:15,FunctionOpenMenu:16,FunctionCloseMenu:17,FunctionSetHighlightedIndex:18,FunctionSelectItem:19,FunctionSetInputValue:20,FunctionReset:21,ControlledPropUpdatedSelectedItem:22});o().array.isRequired,o().func,o().func,o().func,o().func,o().number,o().number,o().number,o().bool,o().bool,o().bool,o().any,o().any,o().any,o().string,o().string,o().string,o().string,o().string,o().string,o().func,o().string,o().string,o().func,o().func,o().func,o().func,o().func,o().func,o().shape({addEventListener:o().func,removeEventListener:o().func,document:o().shape({getElementById:o().func,activeElement:o().any,body:o().any})});var z=f,W=(0,s.A)({},N,{selectedItemChanged:function(e,t){return e!==t},getA11yStatusMessage:function(e){var t=e.isOpen,i=e.resultCount,n=e.previousResultCount;return t?i?i!==n?i+" result"+(1===i?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}});function j(e,t){var i,n,r=t.type,o=t.props,a=t.altKey;switch(r){case 13:n={isOpen:O(o,"isOpen"),highlightedIndex:O(o,"highlightedIndex"),selectedItem:o.items[t.index],inputValue:o.itemToString(o.items[t.index])};break;case 0:n=e.isOpen?{highlightedIndex:S(1,e.highlightedIndex,o.items.length,t.getItemNodeFromIndex,!0)}:{highlightedIndex:a&&null==e.selectedItem?-1:G(o,e,1,t.getItemNodeFromIndex),isOpen:o.items.length>=0};break;case 1:n=e.isOpen?a?H(o,e.highlightedIndex):{highlightedIndex:S(-1,e.highlightedIndex,o.items.length,t.getItemNodeFromIndex,!0)}:{highlightedIndex:G(o,e,-1,t.getItemNodeFromIndex),isOpen:o.items.length>=0};break;case 7:n=H(o,e.highlightedIndex);break;case 2:n=(0,s.A)({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case 5:n={highlightedIndex:S(-10,e.highlightedIndex,o.items.length,t.getItemNodeFromIndex,!1)};break;case 6:n={highlightedIndex:S(10,e.highlightedIndex,o.items.length,t.getItemNodeFromIndex,!1)};break;case 3:n={highlightedIndex:x(1,0,o.items.length,t.getItemNodeFromIndex,!1)};break;case 4:n={highlightedIndex:x(-1,o.items.length-1,o.items.length,t.getItemNodeFromIndex,!1)};break;case 9:n=(0,s.A)({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&(null==(i=o.items)?void 0:i.length)&&t.selectItem&&{selectedItem:o.items[e.highlightedIndex],inputValue:o.itemToString(o.items[e.highlightedIndex])});break;case 8:n={isOpen:!0,highlightedIndex:O(o,"highlightedIndex"),inputValue:t.inputValue};break;case 10:n={isOpen:!0,highlightedIndex:G(o,e,0)};break;case 19:n={selectedItem:t.selectedItem,inputValue:o.itemToString(t.selectedItem)};break;case 22:n={inputValue:t.inputValue};break;default:return function(e,t,i){var n,r=t.type,o=t.props;switch(r){case i.ItemMouseMove:n={highlightedIndex:t.disabled?-1:t.index};break;case i.MenuMouseLeave:n={highlightedIndex:-1};break;case i.ToggleButtonClick:case i.FunctionToggleMenu:n={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:G(o,e,0)};break;case i.FunctionOpenMenu:n={isOpen:!0,highlightedIndex:G(o,e,0)};break;case i.FunctionCloseMenu:n={isOpen:!1};break;case i.FunctionSetHighlightedIndex:n={highlightedIndex:t.highlightedIndex};break;case i.FunctionSetInputValue:n={inputValue:t.inputValue};break;case i.FunctionReset:n={highlightedIndex:O(o,"highlightedIndex"),isOpen:O(o,"isOpen"),selectedItem:O(o,"selectedItem"),inputValue:O(o,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return(0,s.A)({},e,n)}(e,t,U)}return(0,s.A)({},e,n)}var $=["onMouseLeave","refKey","ref"],K=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],Y=["onClick","onPress","refKey","ref"],q=["onKeyDown","onChange","onInput","onFocus","onBlur","onChangeText","refKey","ref"];function X(e){void 0===e&&(e={}),z(e,X);var t=(0,s.A)({},W,e),i=t.initialIsOpen,r=t.defaultIsOpen,o=t.items,l=t.scrollIntoView,c=t.environment,h=t.getA11yStatusMessage,u=t.getA11ySelectionMessage,d=t.itemToString,p=function(e){var t=function(e){var t=F(e,"selectedItem"),i=F(e,"isOpen"),n=F(e,"highlightedIndex"),s=F(e,"inputValue");return{highlightedIndex:n<0&&t&&i?e.items.indexOf(t):n,isOpen:i,selectedItem:t,inputValue:s}}(e),i=t.selectedItem,n=t.inputValue;return""===n&&i&&void 0===e.defaultInputValue&&void 0===e.initialInputValue&&void 0===e.inputValue&&(n=e.itemToString(i)),(0,s.A)({},t,{inputValue:n})}(t),g=function(e,t,i){var n=(0,a.useRef)(),s=L(e,t,i),r=s[0],o=s[1];return(0,a.useEffect)(function(){w(i,"selectedItem")&&(i.selectedItemChanged(n.current,i.selectedItem)&&o({type:22,inputValue:i.itemToString(i.selectedItem)}),n.current=r.selectedItem===n.current?i.selectedItem:r.selectedItem)},[r.selectedItem,i.selectedItem]),[C(r,i),o]}(j,p,t),m=g[0],y=g[1],S=m.isOpen,x=m.highlightedIndex,A=m.selectedItem,M=m.inputValue,T=(0,a.useRef)(null),D=(0,a.useRef)({}),I=(0,a.useRef)(null),P=(0,a.useRef)(null),N=(0,a.useRef)(!0),O=k(t),G=(0,a.useRef)(),H=_({state:m,props:t}),U=(0,a.useCallback)(function(e){return D.current[O.getItemId(e)]},[O]);B(h,[S,x,M,o],(0,s.A)({isInitialMount:N.current,previousResultCount:G.current,items:o,environment:c,itemToString:d},m)),B(u,[A],(0,s.A)({isInitialMount:N.current,previousResultCount:G.current,items:o,environment:c,itemToString:d},m));var Z=function(e){var t=e.highlightedIndex,i=e.isOpen,n=e.itemRefs,s=e.getItemNodeFromIndex,r=e.menuElement,o=e.scrollIntoView,l=(0,a.useRef)(!0);return R(function(){t<0||!i||!Object.keys(n.current).length||(!1===l.current?l.current=!0:o(s(t),r))},[t]),l}({menuElement:T.current,highlightedIndex:x,isOpen:S,itemRefs:D,scrollIntoView:l,getItemNodeFromIndex:U});V({isInitialMount:N.current,props:t,state:m}),(0,a.useEffect)(function(){(i||r||S)&&I.current&&I.current.focus()},[]),(0,a.useEffect)(function(){N.current||(G.current=o.length)});var Q=function(e,t,i,n){var s=(0,a.useRef)({isMouseDown:!1,isTouchMove:!1});return(0,a.useEffect)(function(){if(null!=(null==i?void 0:i.addEventListener)){var r=function(){s.current.isMouseDown=!0},o=function(r){s.current.isMouseDown=!1,e&&!E(r.target,t.map(function(e){return e.current}),i)&&n()},a=function(){s.current.isTouchMove=!1},l=function(){s.current.isTouchMove=!0},c=function(r){!e||s.current.isTouchMove||E(r.target,t.map(function(e){return e.current}),i,!1)||n()};return i.addEventListener("mousedown",r),i.addEventListener("mouseup",o),i.addEventListener("touchstart",a),i.addEventListener("touchmove",l),i.addEventListener("touchend",c),function(){i.removeEventListener("mousedown",r),i.removeEventListener("mouseup",o),i.removeEventListener("touchstart",a),i.removeEventListener("touchmove",l),i.removeEventListener("touchend",c)}}},[e,i]),s}(S,[I,T,P],c,function(){y({type:9,selectItem:!1})}),J=f;(0,a.useEffect)(function(){return N.current=!1,function(){N.current=!0}},[]),(0,a.useEffect)(function(){var e;if(S){if((null==(e=c.document)?void 0:e.activeElement)!==I.current){var t;null==I||null==(t=I.current)||t.focus()}}else D.current={}},[S,c]);var ee=(0,a.useMemo)(function(){return{ArrowDown:function(e){e.preventDefault(),y({type:0,altKey:e.altKey,getItemNodeFromIndex:U})},ArrowUp:function(e){e.preventDefault(),y({type:1,altKey:e.altKey,getItemNodeFromIndex:U})},Home:function(e){H.current.state.isOpen&&(e.preventDefault(),y({type:3,getItemNodeFromIndex:U}))},End:function(e){H.current.state.isOpen&&(e.preventDefault(),y({type:4,getItemNodeFromIndex:U}))},Escape:function(e){var t=H.current.state;(t.isOpen||t.inputValue||t.selectedItem||t.highlightedIndex>-1)&&(e.preventDefault(),y({type:2}))},Enter:function(e){H.current.state.isOpen&&229!==e.which&&(e.preventDefault(),y({type:7,getItemNodeFromIndex:U}))},PageUp:function(e){H.current.state.isOpen&&(e.preventDefault(),y({type:5,getItemNodeFromIndex:U}))},PageDown:function(e){H.current.state.isOpen&&(e.preventDefault(),y({type:6,getItemNodeFromIndex:U}))}}},[y,H,U]),te=(0,a.useCallback)(function(e){return(0,s.A)({id:O.labelId,htmlFor:O.inputId},e)},[O]),ie=(0,a.useCallback)(function(e,t){var i,r=void 0===e?{}:e,o=r.onMouseLeave,a=r.refKey,l=void 0===a?"ref":a,c=r.ref,h=(0,n.A)(r,$),u=(void 0===t?{}:t).suppressRefError;return J("getMenuProps",void 0!==u&&u,l,T),(0,s.A)(((i={})[l]=b(c,function(e){T.current=e}),i.id=O.menuId,i.role="listbox",i["aria-labelledby"]=h&&h["aria-label"]?void 0:""+O.labelId,i.onMouseLeave=v(o,function(){y({type:11})}),i),h)},[y,J,O]),ne=(0,a.useCallback)(function(e){var t,i,r=void 0===e?{}:e,o=r.item,a=r.index,l=r.refKey,c=void 0===l?"ref":l,h=r.ref,u=r.onMouseMove,d=r.onMouseDown,p=r.onClick;r.onPress;var g=r.disabled,f=(0,n.A)(r,K),m=H.current,C=m.props,w=m.state,S=function(e,t,i,n){var s,r;if(void 0===e){if(void 0===t)throw new Error(n);s=i[t],r=t}else r=void 0===t?i.indexOf(e):t,s=e;return[s,r]}(o,a,C.items,"Pass either item or index to getItemProps!")[1],x=p;return(0,s.A)(((t={})[c]=b(h,function(e){e&&(D.current[O.getItemId(S)]=e)}),t.disabled=g,t.role="option",t["aria-selected"]=""+(S===w.highlightedIndex),t.id=O.getItemId(S),t),!g&&((i={}).onClick=v(x,function(){y({type:13,index:S})}),i),{onMouseMove:v(u,function(){S!==w.highlightedIndex&&(Z.current=!1,y({type:12,index:S,disabled:g}))}),onMouseDown:v(d,function(e){return e.preventDefault()})},f)},[y,H,Z,O]),se=(0,a.useCallback)(function(e){var t,i=void 0===e?{}:e,r=i.onClick;i.onPress;var o=i.refKey,a=void 0===o?"ref":o,l=i.ref,c=(0,n.A)(i,Y),h=H.current.state;return(0,s.A)(((t={})[a]=b(l,function(e){P.current=e}),t["aria-controls"]=O.menuId,t["aria-expanded"]=h.isOpen,t.id=O.toggleButtonId,t.tabIndex=-1,t),!c.disabled&&(0,s.A)({},{onClick:v(r,function(){y({type:14})})}),c)},[y,H,O]),re=(0,a.useCallback)(function(e,t){var i,r=void 0===e?{}:e,o=r.onKeyDown,a=r.onChange,l=r.onInput,h=r.onFocus,u=r.onBlur;r.onChangeText;var d=r.refKey,p=void 0===d?"ref":d,g=r.ref,f=(0,n.A)(r,q),m=(void 0===t?{}:t).suppressRefError;J("getInputProps",void 0!==m&&m,p,I);var C,w=H.current.state,S={};return f.disabled||((C={}).onChange=v(a,l,function(e){y({type:8,inputValue:e.target.value})}),C.onKeyDown=v(o,function(e){var t=function(e){var t=e.key,i=e.keyCode;return i>=37&&i<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}(e);t&&ee[t]&&ee[t](e)}),C.onBlur=v(u,function(e){if(w.isOpen&&!Q.current.isMouseDown){var t=null===e.relatedTarget&&c.document.activeElement!==c.document.body;y({type:9,selectItem:!t})}}),C.onFocus=v(h,function(){w.isOpen||y({type:10})}),S=C),(0,s.A)(((i={})[p]=b(g,function(e){I.current=e}),i["aria-activedescendant"]=w.isOpen&&w.highlightedIndex>-1?O.getItemId(w.highlightedIndex):"",i["aria-autocomplete"]="list",i["aria-controls"]=O.menuId,i["aria-expanded"]=w.isOpen,i["aria-labelledby"]=f&&f["aria-label"]?void 0:""+O.labelId,i.autoComplete="off",i.id=O.inputId,i.role="combobox",i.value=w.inputValue,i),S,f)},[J,H,O,ee,y,Q,c]),oe=(0,a.useCallback)(function(){y({type:15})},[y]),ae=(0,a.useCallback)(function(){y({type:17})},[y]),le=(0,a.useCallback)(function(){y({type:16})},[y]),ce=(0,a.useCallback)(function(e){y({type:18,highlightedIndex:e})},[y]),he=(0,a.useCallback)(function(e){y({type:19,selectedItem:e})},[y]);return{getItemProps:ne,getLabelProps:te,getMenuProps:ie,getInputProps:re,getToggleButtonProps:se,toggleMenu:oe,openMenu:le,closeMenu:ae,setHighlightedIndex:ce,setInputValue:(0,a.useCallback)(function(e){y({type:20,inputValue:e})},[y]),selectItem:he,reset:(0,a.useCallback)(function(){y({type:21})},[y]),highlightedIndex:x,isOpen:S,selectedItem:A,inputValue:M}}X.stateChangeTypes=U,o().array,o().array,o().array,o().func,o().func,o().func,o().number,o().number,o().number,o().func,o().func,o().string,o().string,o().shape({addEventListener:o().func,removeEventListener:o().func,document:o().shape({getElementById:o().func,activeElement:o().any,body:o().any})})},53692(e){e.exports=function(){"use strict";var e=function(){return e=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var s in t=arguments[i])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},e.apply(this,arguments)};function t(e,t,i,n){return new(i||(i=Promise))(function(s,r){function o(e){try{l(n.next(e))}catch(e){r(e)}}function a(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})}function i(e,t){var i,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,n&&(s=2&r[0]?n.return:r[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,r[1])).done)return s;switch(n=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,n=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!((s=(s=o.trys).length>0&&s[s.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){o.label=r[1];break}if(6===r[0]&&o.label<s[1]){o.label=s[1],s=r;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(r);break}s[2]&&o.ops.pop(),o.trys.pop();continue}r=t.call(e,o)}catch(e){r=[6,e],n=0}finally{i=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}}var n,s,r,o,a,l;!function(e){e.INIT_IFRAME="INIT_IFRAME"}(n||(n={})),function(e){e.Call="call",e.Reply="reply",e.Syn="syn",e.SynAck="synAck",e.Ack="ack"}(s||(s={})),function(e){e.Fulfilled="fulfilled",e.Rejected="rejected"}(r||(r={})),function(e){e.ConnectionDestroyed="ConnectionDestroyed",e.ConnectionTimeout="ConnectionTimeout",e.NotInIframe="NotInIframe",e.NoIframeSrc="NoIframeSrc"}(o||(o={})),function(e){e.DataCloneError="DataCloneError"}(a||(a={})),function(e){e.Message="message"}(l||(l={}));const c={"http:":"80","https:":"443"},h=/^(https?:)?\/\/([^/:]+)?(:(\d+))?/,u=["file:","data:"],d=({name:e,message:t,stack:i})=>({name:e,message:t,stack:i});let p=0;var g=()=>++p,f=(e,t,i,n,a)=>{const{localName:c,local:h,remote:u,originForSending:d,originForReceiving:p}=t;let f=!1;a(`${c}: Connecting call sender`);return i.reduce((e,t)=>(e[t]=(e=>(...t)=>{let i;a(`${c}: Sending ${e}() call`);try{u.closed&&(i=!0)}catch(e){i=!0}if(i&&n(),f){const t=new Error(`Unable to send ${e}() call due to destroyed connection`);throw t.code=o.ConnectionDestroyed,t}return new Promise((i,n)=>{const o=g(),f=t=>{if(t.source!==u||t.data.penpal!==s.Reply||t.data.id!==o)return;if(t.origin!==p)return void a(`${c} received message from origin ${t.origin} which did not match expected origin ${p}`);const d=t.data;a(`${c}: Received ${e}() reply`),h.removeEventListener(l.Message,f);let g=d.returnValue;d.returnValueIsError&&(g=(e=>{const t=new Error;return Object.keys(e).forEach(i=>t[i]=e[i]),t})(g)),(d.resolution===r.Fulfilled?i:n)(g)};h.addEventListener(l.Message,f);const m={penpal:s.Call,id:o,methodName:e,args:t};u.postMessage(m,d)})})(t),e),e),()=>{f=!0}},m=(e,t,i,n,o)=>{const{destroy:c,onDestroy:h}=n;let u,p;const g={};return n=>{if(n.origin!==t)return void o(`Parent: Handshake - Received ACK message from origin ${n.origin} which did not match expected origin ${t}`);o("Parent: Handshake - Received ACK");const m={localName:"Parent",local:window,remote:n.source,originForSending:i,originForReceiving:t};u&&u(),u=((e,t,i)=>{const{localName:n,local:o,remote:c,originForSending:h,originForReceiving:u}=e;let p=!1;const g=e=>{if(e.source!==c||e.data.penpal!==s.Call)return;if(e.origin!==u)return void i(`${n} received message from origin ${e.origin} which did not match expected origin ${u}`);const o=e.data,{methodName:l,args:g,id:f}=o;i(`${n}: Received ${l}() call`);const m=e=>t=>{if(i(`${n}: Sending ${l}() reply`),p)return void i(`${n}: Unable to send ${l}() reply due to destroyed connection`);const o={penpal:s.Reply,id:f,resolution:e,returnValue:t};e===r.Rejected&&t instanceof Error&&(o.returnValue=d(t),o.returnValueIsError=!0);try{c.postMessage(o,h)}catch(e){if(e.name===a.DataCloneError){const t={penpal:s.Reply,id:f,resolution:r.Rejected,returnValue:d(e),returnValueIsError:!0};c.postMessage(t,h)}throw e}};new Promise(e=>e(t[l].apply(t,g))).then(m(r.Fulfilled),m(r.Rejected))};return o.addEventListener(l.Message,g),()=>{p=!0,o.removeEventListener(l.Message,g)}})(m,e,o),h(u),p&&p.forEach(e=>{delete g[e]}),p=n.data.methodNames;const y=f(g,m,p,c,o);return h(y),g}},y=e=>{let{iframe:t,methods:i={},childOrigin:n,timeout:r,debug:a=!1}=e;const d=(e=>(...t)=>{e&&console.log("[Penpal]",...t)})(a),p=(()=>{const e=[];let t=!1;return{destroy(i){t=!0,e.forEach(e=>{e(i)})},onDestroy(i){t?i():e.push(i)}}})(),{onDestroy:g,destroy:f}=p;n||((e=>{if(!e.src&&!e.srcdoc){const e=new Error("Iframe must have src or srcdoc property defined.");throw e.code=o.NoIframeSrc,e}})(t),n=(e=>{if(e&&u.find(t=>e.startsWith(t)))return"null";const t=document.location,i=h.exec(e);let n,s,r;return i?(n=i[1]?i[1]:t.protocol,s=i[2],r=i[4]):(n=t.protocol,s=t.hostname,r=t.port),`${n}//${s}${r&&r!==c[n]?`:${r}`:""}`})(t.src));const y="null"===n?"*":n,v=((e,t,i,n)=>r=>{if(r.origin!==i)return void e(`Parent: Handshake - Received SYN message from origin ${r.origin} which did not match expected origin ${i}`);e("Parent: Handshake - Received SYN, responding with SYN-ACK");const o={penpal:s.SynAck,methodNames:Object.keys(t)};r.source.postMessage(o,n)})(d,i,n,y),b=m(i,n,y,p,d),C=new Promise((e,i)=>{const n=((e,t)=>{let i;return void 0!==e&&(i=window.setTimeout(()=>{const i=new Error(`Connection timed out after ${e}ms`);i.code=o.ConnectionTimeout,t(i)},e)),()=>{clearTimeout(i)}})(r,f),a=i=>{if(i.source===t.contentWindow&&i.data)if(i.data.penpal!==s.Syn){if(i.data.penpal===s.Ack){const t=b(i);return void(t&&(n(),e(t)))}}else v(i)};window.addEventListener(l.Message,a),d("Parent: Awaiting handshake"),((e,t)=>{const{destroy:i,onDestroy:n}=t,s=setInterval(()=>{e.isConnected||(clearInterval(s),i())},6e4);n(()=>{clearInterval(s)})})(t,p),g(e=>{window.removeEventListener(l.Message,a),e||((e=new Error("Connection destroyed")).code=o.ConnectionDestroyed),i(e)})});return{promise:C,destroy(){f()}}},v=function(e,t){return console.error("[Dromo-External-Error] There was an error running your ".concat(t,"."),e)},b=function(e){return setTimeout(function(){console.warn("[Dromo Error] Slow ".concat(e," detected (>10s). Long running hooks can degrade user experience and importer performance."))},1e4)},C=function(e){clearTimeout(e)},w=function(n,s,r){return t(void 0,void 0,void 0,function(){var o,a,l;return i(this,function(c){switch(c.label){case 0:return o=new Map,a=s.map(function(t){return e({},t)}),[4,n.reduce(function(e,n){return t(void 0,void 0,void 0,function(){return i(this,function(s){switch(s.label){case 0:return[4,e.then(function(){return t(void 0,void 0,void 0,function(){var e,t,s;return i(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),e=b("column hook"),[4,n.callback(a)];case 1:return t=i.sent(),C(e),t.forEach(function(e){if(void 0!==e.value||void 0!==e.info){var t={};void 0!==e.value&&(t.value=e.value,a[e.index].value=e.value),void 0!==e.info&&(t.info=e.info),o.set(e.index,t)}}),[3,3];case 2:return s=i.sent(),r(s,"column hooks"),[3,3];case 3:return[2]}})})})];case 1:return s.sent(),[2]}})})},Promise.resolve())];case 1:return c.sent(),l=[],o.forEach(function(t,i){return l.push(e(e({},t),{index:i}))}),[2,l]}})})},S=function(e){return void 0===e.value&&void 0===e.info&&void 0===e.selectOptions&&void 0===e.manyToOne},x=function(e,n,s,r,o){return t(void 0,void 0,void 0,function(){var a,l,c,h,u,d,p,g,f,m,y,v,w;return i(this,function(x){switch(x.label){case 0:a=new Map,l=new Map(e.map(function(e){return[e.index,e]})),c=function(e,t){for(var i,n=l.get(e),s=function(t,s){if(S(s))return"continue";var r=n.row[t],o=Array.isArray(r.manyToOne),l="manyToOne"in s&&Array.isArray(s.manyToOne);if(o&&!l)throw new Error("".concat(t," should have manyToOne defined as an array."));if(o&&l&&r.manyToOne.length!==s.manyToOne.length)throw new Error("".concat(t," should be array of length ").concat(r.manyToOne.length));var c=a.get(e)||{},h=null!==(i=c[t])&&void 0!==i?i:{},u=[];l?(h.manyToOne=[],s.manyToOne.forEach(function(e,t){if(!S(e)){var i={};h.manyToOne.push(i),u.push({fieldOutput:e,rowDataField:r.manyToOne[t],cellChange:i})}})):u.push({fieldOutput:s,rowDataField:r,cellChange:h}),u.forEach(function(e){var t=e.fieldOutput,i=e.rowDataField,n=e.cellChange;void 0!==t.value&&(n.value=t.value,i.value=t.value),void 0!==t.info&&(n.info=t.info,i.info=t.info),void 0!==t.selectOptions&&(n.selectOptions=t.selectOptions,i.selectOptions=t.selectOptions)}),c[t]=h,a.set(e,c)},r=0,o=Object.entries(null!=t?t:{});r<o.length;r++){var c=o[r];s(c[0],c[1])}},h=0,u=r,x.label=1;case 1:if(!(h<u.length))return[3,6];d=u[h],x.label=2;case 2:return x.trys.push([2,4,,5]),p=b("bulk row hook"),[4,d(e,n)];case 3:for(g=x.sent(),C(p),f=0,m=g;f<m.length;f++)y=m[f],c(y.index,y.row);return[3,5];case 4:return v=x.sent(),o(v,"bulk row hooks"),[3,5];case 5:return h++,[3,1];case 6:return[4,Promise.all(e.map(function(e){return t(void 0,void 0,void 0,function(){var t,r,a,l,h,u;return i(this,function(i){switch(i.label){case 0:t=0,r=s,i.label=1;case 1:if(!(t<r.length))return[3,6];a=r[t],i.label=2;case 2:return i.trys.push([2,4,,5]),l=b("row hook"),[4,a(e,n)];case 3:return h=i.sent(),C(l),c(e.index,h.row),[3,5];case 4:return u=i.sent(),o(u,"row hooks"),[3,5];case 5:return t++,[3,1];case 6:return[2]}})})}))];case 7:return x.sent(),w=[],a.forEach(function(e,t){w.push({index:t,row:e})}),[2,w]}})})},E=function(e,n,s){return t(void 0,void 0,void 0,function(){return i(this,function(r){return[2,Promise.all(e.map(function(e){return t(void 0,void 0,void 0,function(){return i(this,function(r){return n.forEach(function(n){return t(void 0,void 0,void 0,function(){var t,r;return i(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),t=b("row delete hook"),[4,n(e)];case 1:return i.sent(),C(t),[3,3];case 2:return r=i.sent(),s(r,"row delete hooks"),[3,3];case 3:return[2]}})})}),[2]})})}))]})})},A=function(e,n,s,r,o){return t(void 0,void 0,void 0,function(){return i(this,function(a){switch(a.label){case 0:return[4,Promise.all(s.map(function(s){return t(void 0,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:if(e!==s.type)return[2,Promise.resolve()];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,s.callback(r,n)];case 2:return[2,i.sent()];case 3:return t=i.sent(),o(t,"step hook ".concat(e)),[2,Promise.resolve()];case 4:return[2]}})})}))];case 1:return a.sent(),[2]}})})},M=function(e,n,s,r,o){return t(void 0,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,s(e,n,r)];case 1:return[2,i.sent()];case 2:return t=i.sent(),o(t,"before finish callback"),[3,3];case 3:return[2]}})})},T=function(e,n,s,r){return t(void 0,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,r(e,n)];case 1:return[2,i.sent()];case 2:return t=i.sent(),s(t,"custom file parser callback"),[3,3];case 3:return[2]}})})},D="dromo-container",I=function(t){var i=e({},t);return i.validators&&(i.validators=i.validators.map(function(t){return("regex_match"===t.validate||"regex_exclude"===t.validate)&&t.regex instanceof RegExp?e(e({},t),{regex:t.regex.source,regexOptions:{ignoreCase:t.regex.flags.includes("i"),dotAll:t.regex.flags.includes("s"),multiline:t.regex.flags.includes("m"),unicode:t.regex.flags.includes("u")}}):t})),i};return function(){function n(n,s,r,o){var a=this;this.embedInline=!1,this.columnHooks=[],this.bulkRowHooks=[],this.rowHooks=[],this.stepHooks=[],this.rowDeleteHooks=[],this.fileParsers=[],this.initChild=function(){return t(a,void 0,void 0,function(){var t,n,s,r,o;return i(this,function(i){switch(i.label){case 0:return this.connection?[4,this.connection.promise]:(console.error("shim cannot connect with Dromo service."),alert("There was en error opening the importer. Please contact support if this issue persists."),[2]);case 1:return t=i.sent(),n=Array.from(document.getElementsByTagName("script")).some(function(e){return"https://unpkg.com/dromo-uploader-js/dist/DromoUploader.js"===e.src||"https://cdn.jsdelivr.net/npm/dromo-uploader-js@latest/dist/DromoUploader.js"===e.src}),[4,t.setNumRegisteredRowHooks(this.totalNumRowHooks())];case 2:return i.sent(),[4,t.setNumRegisteredColHooks(this.columnHooks.length)];case 3:return i.sent(),[4,t.setNumRegisteredRowDeleteHooks(this.rowDeleteHooks.length)];case 4:return i.sent(),[4,t.setCustomParserFileExtensions(this.fileParsers.flatMap(function(e){return e.extensions.map(function(e){return e.toLowerCase()})}))];case 5:return i.sent(),[4,t.setEmbedInline(this.embedInline)];case 6:return i.sent(),this.fields&&this.settings&&this.user?(s=e({},this.settings),n||(s.version=null!==(r=s.version)&&void 0!==r?r:"v2"),s.browserExcelParsing=null===(o=s.browserExcelParsing)||void 0===o||o,[4,t.init(this.licenseKey,this.fields,s,this.user,this.appHost)]):[3,8];case 7:return i.sent(),[3,11];case 8:return this.schemaId?[4,t.initFromSavedSchema(this.licenseKey,this.schemaId,this.appHost,{user:this.user,developmentMode:this.developmentMode,headerRowOverride:this.headerRowOverride})]:[3,10];case 9:return i.sent(),[3,11];case 10:console.error("Invalid Dromo configuration"),i.label=11;case 11:return[2]}})})},this.initIFrame=function(){var e,t,i,n,s;if(window.DROMO_WIDGET_OVERRIDE)s=window.DROMO_WIDGET_OVERRIDE;else if(null===(e=a.settings)||void 0===e?void 0:e.alternateDomain){var r=new URL(a.settings.alternateDomain);s=r.protocol+"//widget."+r.host}else s="v1"===(null===(t=a.settings)||void 0===t?void 0:t.version)?"https://widget-v1.dromo.io/":"https://widget.dromo.io/";if(!document.getElementById(a.iframeId)){var o=document.createElement("iframe"),l=null!==(n=null===(i=a.settings)||void 0===i?void 0:i.importIdentifier)&&void 0!==n?n:a.schemaId;o.title=l?"Dromo Importer: ".concat(l):"Dromo Importer",o.src=s,o.id=a.iframeId,o.style.height="100%",o.style.width="100%",o.style.border="0",o.crossorigin="anonymous",a.iframe=o}},this.createConnection=function(){var e=a,n=a.iframe;n?a.connection=y({iframe:n,methods:{handleColumnHooks:function(n,s){return t(this,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:return t=e.columnHooks.filter(function(e){return e.fieldName===n}),[4,w(t,s,v)];case 1:return[2,i.sent()]}})})},handleRowHooks:function(n,s){return t(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,x(n,s,e.rowHooks.map(function(e){return e.callback}),e.bulkRowHooks,v)];case 1:return[2,t.sent()]}})})},handleStepHook:function(n,s){return t(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,A(n,s,e.stepHooks,e,v)];case 1:return[2,t.sent()]}})})},handleParseFileCallback:function(n,s){return t(this,void 0,void 0,function(){var t,r;return i(this,function(i){switch(i.label){case 0:return t=s.split(".").pop(),r=e.fileParsers.find(function(e){return-1!==e.extensions.map(function(e){return e.toLowerCase()}).indexOf(t.toLowerCase())}),[4,T(n,s,v,r.parseFile)];case 1:return[2,i.sent()]}})})},handleRowDeleteHooks:function(n){return t(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,E(n,e.rowDeleteHooks,v)];case 1:return t.sent(),[2]}})})},handleBeforeFinishCallback:function(n,s){return t(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return e.beforeFinishCallback?[4,M(n,s,e.beforeFinishCallback,e,v)]:[3,2];case 1:return[2,t.sent()];case 2:return[2]}})})},handleResults:function(n,s){return t(this,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:if(!e.resultsCallback)return[3,4];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,e.resultsCallback(n,s)];case 2:return i.sent(),[3,4];case 3:return t=i.sent(),console.error("[Dromo-External-Error] There was an error in your onResult callback.",t),[3,4];case 4:return e.close(),[2]}})})},handleCloseModal:function(){e.close()},handleCancel:function(){if(e.cancelCallback)try{e.cancelCallback()}catch(e){console.error("[Dromo-External-Error] There was an error in your cancel callback.",e)}e.close()}}}):console.error("shim cannot connect to Dromo.")},this.mountIFrame=function(){if(!document.getElementById(a.iframeId)){var e=document.createElement("div");e.id=a.wrapperId,e.style.zIndex=Number.MAX_SAFE_INTEGER.toString(),e.style.visibility="hidden",e.style.width="0px",e.style.height="0px",e.style.position="fixed",e.style.top="0px",e.style.left="0px",e.style.right="0px",e.style.bottom="0px",e.appendChild(a.iframe),document.body.appendChild(e),a.wrapper=e}},this.addIFrameToWrapper=function(){a.wrapper&&a.iframe&&(a.iframe.style.visibility="hidden",a.wrapper.appendChild(a.iframe))},this.showIframe=function(){a.iframe&&(a.iframe.style.visibility="visible")},this.showWrapper=function(){a.wrapper&&(a.wrapper.style.visibility="visible",a.wrapper.style.width="100%",a.wrapper.style.height="100%",document.body.style.overflow="hidden")},this.registerColumnHook=function(e,t){a.columnHooks.push({fieldName:e,callback:t}),a.connection&&a.connection.promise.then(function(e){e.setNumRegisteredColHooks(a.columnHooks.length)})},this.totalNumRowHooks=function(){return a.rowHooks.length+a.bulkRowHooks.length},this.registerBulkRowHook=function(e){a.bulkRowHooks.push(e),a.connection&&a.connection.promise.then(function(e){e.setNumRegisteredRowHooks(a.totalNumRowHooks())})},this.registerRowHook=function(e){a.rowHooks.push({callback:e}),a.connection&&a.connection.promise.then(function(e){e.setNumRegisteredRowHooks(a.totalNumRowHooks())})},this.registerStepHook=function(e,t){a.stepHooks.push({type:e,callback:t})},this.registerRowDeleteHook=function(e){a.rowDeleteHooks.push(e),a.connection&&a.connection.promise.then(function(e){e.setNumRegisteredRowDeleteHooks(a.rowDeleteHooks.length)})},this.beforeFinish=function(e){a.beforeFinishCallback=e},this.registerFileParser=function(e){a.fileParsers.push(e),a.connection&&a.connection.promise.then(function(e){e.setCustomParserFileExtensions(a.fileParsers.flatMap(function(e){return e.extensions.map(function(e){return e.toLowerCase()})}))})},this.registerAllHooks=function(e){if(e.columnHooks)for(var t=0,i=e.columnHooks;t<i.length;t++){var n=i[t],s=n.fieldName,r=n.callback;a.registerColumnHook(s,r)}if(e.rowHooks)for(var o=0,l=e.rowHooks;o<l.length;o++){var c=l[o];a.registerRowHook(c)}if(e.bulkRowHooks)for(var h=0,u=e.bulkRowHooks;h<u.length;h++){var d=u[h];a.registerBulkRowHook(d)}if(e.rowDeleteHooks)for(var p=0,g=e.rowDeleteHooks;p<g.length;p++){var f=g[p];a.registerRowDeleteHook(f)}if(e.stepHooks)for(var m=0,y=e.stepHooks;m<y.length;m++){var v=y[m],b=v.type;r=v.callback,a.registerStepHook(b,r)}if(e.beforeFinishCallback&&a.beforeFinish(e.beforeFinishCallback),e.fileParsers)for(var C=0,w=e.fileParsers;C<w.length;C++){var S=w[C];a.registerFileParser(S)}},this.onResults=function(e){a.resultsCallback=e},this.onCancel=function(e){a.cancelCallback=e},this.setUser=function(e){return t(a,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return this.user=e,this.connection?[4,this.connection.promise]:[3,3];case 1:return[4,t.sent().setUser(this.user)];case 2:t.sent(),t.label=3;case 3:return[2]}})})},this.addField=function(e,n){return t(a,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return this.connection?[4,this.connection.promise]:[3,3];case 1:return[4,t.sent().addField(I(e),n)];case 2:return t.sent(),[3,4];case 3:console.error("[Dromo-Error] Invalid connection to Dromo Uploader."),t.label=4;case 4:return[2]}})})},this.removeField=function(e){return t(a,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return this.connection?[4,this.connection.promise]:[3,3];case 1:return[4,t.sent().removeField(e)];case 2:return t.sent(),[3,4];case 3:console.error("[Dromo-Error] Invalid connection to Dromo Uploader."),t.label=4;case 4:return[2]}})})},this.updateInfoMessages=function(e){return t(a,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return this.connection?[4,this.connection.promise]:[3,3];case 1:return[4,t.sent().updateInfoMessages(e)];case 2:return t.sent(),[3,4];case 3:console.error("[Dromo-Error] Invalid connection to Dromo Uploader."),t.label=4;case 4:return[2]}})})},this.setHeaderRowOverride=function(e){return t(a,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return this.headerRowOverride=e,this.connection?[4,this.connection.promise]:[3,3];case 1:return[4,t.sent().setHeaderRowOverride(e)];case 2:t.sent(),t.label=3;case 3:return[2]}})})},this.setConfirmationMessage=function(e,n){return t(a,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return this.connection?[4,this.connection.promise]:[3,3];case 1:return[4,t.sent().setConfirmationMessage(e,n)];case 2:return t.sent(),[3,4];case 3:console.error("[Dromo-Error] Invalid connection to Dromo Uploader."),t.label=4;case 4:return[2]}})})},this.open=function(){return t(a,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return this.wrapper||(this.initIFrame(),this.createConnection(),this.mountIFrame()),[4,this.initChild()];case 1:return e.sent(),this.showWrapper(),[2]}})})},this.initInline=function(e){return t(a,void 0,void 0,function(){var t,n;return i(this,function(i){switch(i.label){case 0:this.embedInline=!0,i.label=1;case 1:if(i.trys.push([1,3,,4]),e instanceof HTMLElement&&(this.wrapper=e,this.wrapperId=e.id,""!==this.wrapperId&&void 0!==this.wrapperId||(this.wrapperId=Math.random().toString(36).substring(7)+"-"+D)),"string"==typeof e){if(null===(t=document.getElementById(e)))throw new Error("WRAPPER_NOT_FOUND");this.wrapper=t,this.wrapperId=e}return this.iframe||(this.initIFrame(),this.createConnection(),this.addIFrameToWrapper()),[4,this.initChild()];case 2:return i.sent(),this.showIframe(),[3,4];case 3:throw"WRAPPER_NOT_FOUND"===(n=i.sent()).message&&console.error("[Dromo-Error] Could not find wrapper using provided ID."),n;case 4:return[2]}})})},this.addRows=function(e){return t(a,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return this.connection?[4,this.connection.promise]:[3,3];case 1:return[4,t.sent().addRows(e)];case 2:return[2,t.sent()];case 3:return console.error("[Dromo-Error] Invalid connection to Dromo Uploader."),[2,[]]}})})},this.removeRows=function(e){return t(a,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return this.connection?[4,this.connection.promise]:[3,3];case 1:return[4,t.sent().removeRows(e)];case 2:return t.sent(),[3,4];case 3:console.error("[Dromo-Error] Invalid connection to Dromo Uploader."),t.label=4;case 4:return[2]}})})},this.close=function(){a.wrapper&&(a.wrapper.style.visibility="hidden",a.wrapper.style.width="0px",a.wrapper.style.height="0px",document.body.style.overflow="inherit")},this.setDevelopmentMode=function(e){return t(a,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return this.developmentMode=e,this.connection?[4,this.connection.promise]:[3,3];case 1:return[4,t.sent().setDevelopmentMode(this.developmentMode)];case 2:t.sent(),t.label=3;case 3:return[2]}})})},this.rehydrate=function(e,n){return t(a,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return this.wrapper||(this.initIFrame(),this.createConnection(),this.mountIFrame()),[4,this.initChild()];case 1:return t.sent(),[4,this.connection.promise];case 2:return[4,t.sent().rehydrate(e,n)];case 3:return t.sent(),this.showWrapper(),[2]}})})},this.iframeId=Math.random().toString(36).substring(7)+"-dromo-iframe-element",this.wrapperId=Math.random().toString(36).substring(7)+"-"+D,this.appHost=document.location.hostname,void 0!==r&&void 0!==o?(this.licenseKey=n,this.fields=s.map(I),this.settings=r,this.user=o,this.checkCloneable({licenseKey:this.licenseKey,fields:this.fields,settings:this.settings,user:this.user})):(this.licenseKey=n,this.schemaId=s,this.checkCloneable({licenseKey:this.licenseKey,schemaId:this.schemaId}))}var s;return n.prototype.checkCloneable=function(e){if("function"==typeof structuredClone){var t=Object.entries(e).filter(function(e){e[0];var t=e[1];try{return structuredClone(t),!1}catch(e){return!0}}).map(function(e){return e[0]});if(t.length>0){var i=t.join(", ");throw new Error("[Dromo-External-Error] The Dromo importer received non-cloneable parameters: ".concat(i,". See https://dromo.dev/err/clone"))}}},s=n,n.rehydrateHeadless=function(e){var r=e.licenseKey,o=e.headlessImportId,a=e.fields,l=e.settings,c=e.hooks,h=e.rehydrateState;return t(void 0,void 0,void 0,function(){var e;return i(s,function(t){switch(t.label){case 0:return(e=new n(r,a,l,{id:"headless-review"})).registerAllHooks(c),[4,e.rehydrate(h,o)];case 1:return t.sent(),e.open(),[2,e]}})})},n}()}()},73964(e,t,i){"use strict";i.d(t,{A:()=>o});var n=i(22155),s=i(53692),r=i.n(s);const o=function(e){var t,i;function s(t){var i;return(i=e.call(this,t)||this).inlineRef=null,i.init=function(){if("fields"in i.props&&"settings"in i.props)i.dromo=new(r())(i.props.licenseKey,i.props.fields,i.props.settings,i.props.user);else if("schemaId"in i.props||"schemaName"in i.props){var e="schemaId"in i.props?i.props.schemaId:i.props.schemaName;i.dromo=new(r())(i.props.licenseKey,e),"developmentMode"in i.props&&i.dromo.setDevelopmentMode(i.props.developmentMode),"user"in i.props&&i.dromo.setUser(i.props.user),"headerRowOverride"in i.props&&i.dromo.setHeaderRowOverride(i.props.headerRowOverride)}i.props.rowHooks&&i.props.rowHooks.forEach(function(e){return i.dromo.registerRowHook(e)}),i.props.bulkRowHooks&&i.props.bulkRowHooks.forEach(function(e){return i.dromo.registerBulkRowHook(e)}),i.props.columnHooks&&i.props.columnHooks.forEach(function(e){i.dromo.registerColumnHook(e.fieldName,e.callback)}),i.props.rowDeleteHooks&&i.props.rowDeleteHooks.forEach(function(e){return i.dromo.registerRowDeleteHook(e)}),i.props.beforeFinish&&i.dromo.beforeFinish(i.props.beforeFinish),i.props.onResults&&i.dromo.onResults(i.props.onResults),i.props.onCancel&&i.dromo.onCancel(i.props.onCancel),i.props.stepHooks&&i.props.stepHooks.forEach(function(e){i.dromo.registerStepHook(e.type,e.callback)}),i.props.fileParsers&&i.props.fileParsers.forEach(function(e){i.dromo.registerFileParser(e)})},i.open=function(){i.init(),i.dromo.open()},i.initInline=function(){i.inlineRef&&(i.init(),i.dromo.initInline(i.inlineRef.current))},t.inline&&(i.inlineRef=(0,n.createRef)()),i}i=e,(t=s).prototype=Object.create(i.prototype),t.prototype.constructor=t,t.__proto__=i;var o=s.prototype;return o.componentDidMount=function(){this.props.inline&&this.inlineRef?this.initInline():this.props.open&&this.open()},o.componentDidUpdate=function(e){this.props.inline?this.initInline():(!e.open&&this.props.open&&this.open(),e.open&&!this.props.open&&this.dromo.close())},o.componentWillUnmount=function(){this.props.open&&!this.props.inline&&this.dromo.close()},o.render=function(){return this.props.inline?(0,n.createElement)("div",{ref:this.inlineRef,className:this.props.className,style:this.props.style}):void 0===this.props.children?(0,n.createElement)(n.Fragment,null):(0,n.createElement)("button",{style:this.props.style,className:this.props.className,onClick:this.open},this.props.children)},s}(n.Component)},57678(e,t,i){"use strict";var n,s=i(92427),r=i(25667);try{n=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var o=!!n&&r&&r(Object.prototype,"__proto__"),a=Object,l=a.getPrototypeOf;e.exports=o&&"function"==typeof o.get?s([o.get]):"function"==typeof l&&function(e){return l(null==e?e:a(e))}},23071(e,t,i){"use strict";var n=t;n.version=i(23718).rE,n.utils=i(9185),n.rand=i(65442),n.curve=i(95228),n.curves=i(25366),n.ec=i(72961),n.eddsa=i(87808)},94499(e,t,i){"use strict";var n=i(5630),s=i(9185),r=s.getNAF,o=s.getJSF,a=s.assert;function l(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=t.n&&new n(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var i=this.n&&this.p.div(this.n);!i||i.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function c(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=l,l.prototype.point=function(){throw new Error("Not implemented")},l.prototype.validate=function(){throw new Error("Not implemented")},l.prototype._fixedNafMul=function(e,t){a(e.precomputed);var i=e._getDoubles(),n=r(t,1,this._bitLength),s=(1<<i.step+1)-(i.step%2==0?2:1);s/=3;var o,l,c=[];for(o=0;o<n.length;o+=i.step){l=0;for(var h=o+i.step-1;h>=o;h--)l=(l<<1)+n[h];c.push(l)}for(var u=this.jpoint(null,null,null),d=this.jpoint(null,null,null),p=s;p>0;p--){for(o=0;o<c.length;o++)(l=c[o])===p?d=d.mixedAdd(i.points[o]):l===-p&&(d=d.mixedAdd(i.points[o].neg()));u=u.add(d)}return u.toP()},l.prototype._wnafMul=function(e,t){var i=4,n=e._getNAFPoints(i);i=n.wnd;for(var s=n.points,o=r(t,i,this._bitLength),l=this.jpoint(null,null,null),c=o.length-1;c>=0;c--){for(var h=0;c>=0&&0===o[c];c--)h++;if(c>=0&&h++,l=l.dblp(h),c<0)break;var u=o[c];a(0!==u),l="affine"===e.type?u>0?l.mixedAdd(s[u-1>>1]):l.mixedAdd(s[-u-1>>1].neg()):u>0?l.add(s[u-1>>1]):l.add(s[-u-1>>1].neg())}return"affine"===e.type?l.toP():l},l.prototype._wnafMulAdd=function(e,t,i,n,s){var a,l,c,h=this._wnafT1,u=this._wnafT2,d=this._wnafT3,p=0;for(a=0;a<n;a++){var g=(c=t[a])._getNAFPoints(e);h[a]=g.wnd,u[a]=g.points}for(a=n-1;a>=1;a-=2){var f=a-1,m=a;if(1===h[f]&&1===h[m]){var y=[t[f],null,null,t[m]];0===t[f].y.cmp(t[m].y)?(y[1]=t[f].add(t[m]),y[2]=t[f].toJ().mixedAdd(t[m].neg())):0===t[f].y.cmp(t[m].y.redNeg())?(y[1]=t[f].toJ().mixedAdd(t[m]),y[2]=t[f].add(t[m].neg())):(y[1]=t[f].toJ().mixedAdd(t[m]),y[2]=t[f].toJ().mixedAdd(t[m].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],b=o(i[f],i[m]);for(p=Math.max(b[0].length,p),d[f]=new Array(p),d[m]=new Array(p),l=0;l<p;l++){var C=0|b[0][l],w=0|b[1][l];d[f][l]=v[3*(C+1)+(w+1)],d[m][l]=0,u[f]=y}}else d[f]=r(i[f],h[f],this._bitLength),d[m]=r(i[m],h[m],this._bitLength),p=Math.max(d[f].length,p),p=Math.max(d[m].length,p)}var S=this.jpoint(null,null,null),x=this._wnafT4;for(a=p;a>=0;a--){for(var E=0;a>=0;){var A=!0;for(l=0;l<n;l++)x[l]=0|d[l][a],0!==x[l]&&(A=!1);if(!A)break;E++,a--}if(a>=0&&E++,S=S.dblp(E),a<0)break;for(l=0;l<n;l++){var M=x[l];0!==M&&(M>0?c=u[l][M-1>>1]:M<0&&(c=u[l][-M-1>>1].neg()),S="affine"===c.type?S.mixedAdd(c):S.add(c))}}for(a=0;a<n;a++)u[a]=null;return s?S:S.toP()},l.BasePoint=c,c.prototype.eq=function(){throw new Error("Not implemented")},c.prototype.validate=function(){return this.curve.validate(this)},l.prototype.decodePoint=function(e,t){e=s.toArray(e,t);var i=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*i)return 6===e[0]?a(e[e.length-1]%2==0):7===e[0]&&a(e[e.length-1]%2==1),this.point(e.slice(1,1+i),e.slice(1+i,1+2*i));if((2===e[0]||3===e[0])&&e.length-1===i)return this.pointFromX(e.slice(1,1+i),3===e[0]);throw new Error("Unknown point format")},c.prototype.encodeCompressed=function(e){return this.encode(e,!0)},c.prototype._encode=function(e){var t=this.curve.p.byteLength(),i=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(i):[4].concat(i,this.getY().toArray("be",t))},c.prototype.encode=function(e,t){return s.encode(this._encode(t),e)},c.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},c.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},c.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var i=[this],n=this,s=0;s<t;s+=e){for(var r=0;r<e;r++)n=n.dbl();i.push(n)}return{step:e,points:i}},c.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],i=(1<<e)-1,n=1===i?null:this.dbl(),s=1;s<i;s++)t[s]=t[s-1].add(n);return{wnd:e,points:t}},c.prototype._getBeta=function(){return null},c.prototype.dblp=function(e){for(var t=this,i=0;i<e;i++)t=t.dbl();return t}},83544(e,t,i){"use strict";var n=i(9185),s=i(5630),r=i(91193),o=i(94499),a=n.assert;function l(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,o.call(this,"edwards",e),this.a=new s(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new s(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new s(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function c(e,t,i,n,r){o.BasePoint.call(this,e,"projective"),null===t&&null===i&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new s(t,16),this.y=new s(i,16),this.z=n?new s(n,16):this.curve.one,this.t=r&&new s(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}r(l,o),e.exports=l,l.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},l.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},l.prototype.jpoint=function(e,t,i,n){return this.point(e,t,i,n)},l.prototype.pointFromX=function(e,t){(e=new s(e,16)).red||(e=e.toRed(this.red));var i=e.redSqr(),n=this.c2.redSub(this.a.redMul(i)),r=this.one.redSub(this.c2.redMul(this.d).redMul(i)),o=n.redMul(r.redInvm()),a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var l=a.fromRed().isOdd();return(t&&!l||!t&&l)&&(a=a.redNeg()),this.point(e,a)},l.prototype.pointFromY=function(e,t){(e=new s(e,16)).red||(e=e.toRed(this.red));var i=e.redSqr(),n=i.redSub(this.c2),r=i.redMul(this.d).redMul(this.c2).redSub(this.a),o=n.redMul(r.redInvm());if(0===o.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==t&&(a=a.redNeg()),this.point(a,e)},l.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),i=e.y.redSqr(),n=t.redMul(this.a).redAdd(i),s=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(i)));return 0===n.cmp(s)},r(c,o.BasePoint),l.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},l.prototype.point=function(e,t,i,n){return new c(this,e,t,i,n)},c.fromJSON=function(e,t){return new c(e,t[0],t[1],t[2])},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},c.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),i=this.z.redSqr();i=i.redIAdd(i);var n=this.curve._mulA(e),s=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),r=n.redAdd(t),o=r.redSub(i),a=n.redSub(t),l=s.redMul(o),c=r.redMul(a),h=s.redMul(a),u=o.redMul(r);return this.curve.point(l,c,u,h)},c.prototype._projDbl=function(){var e,t,i,n,s,r,o=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),l=this.y.redSqr();if(this.curve.twisted){var c=(n=this.curve._mulA(a)).redAdd(l);this.zOne?(e=o.redSub(a).redSub(l).redMul(c.redSub(this.curve.two)),t=c.redMul(n.redSub(l)),i=c.redSqr().redSub(c).redSub(c)):(s=this.z.redSqr(),r=c.redSub(s).redISub(s),e=o.redSub(a).redISub(l).redMul(r),t=c.redMul(n.redSub(l)),i=c.redMul(r))}else n=a.redAdd(l),s=this.curve._mulC(this.z).redSqr(),r=n.redSub(s).redSub(s),e=this.curve._mulC(o.redISub(n)).redMul(r),t=this.curve._mulC(n).redMul(a.redISub(l)),i=n.redMul(r);return this.curve.point(e,t,i)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},c.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),i=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),s=this.z.redMul(e.z.redAdd(e.z)),r=i.redSub(t),o=s.redSub(n),a=s.redAdd(n),l=i.redAdd(t),c=r.redMul(o),h=a.redMul(l),u=r.redMul(l),d=o.redMul(a);return this.curve.point(c,h,d,u)},c.prototype._projAdd=function(e){var t,i,n=this.z.redMul(e.z),s=n.redSqr(),r=this.x.redMul(e.x),o=this.y.redMul(e.y),a=this.curve.d.redMul(r).redMul(o),l=s.redSub(a),c=s.redAdd(a),h=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(r).redISub(o),u=n.redMul(l).redMul(h);return this.curve.twisted?(t=n.redMul(c).redMul(o.redSub(this.curve._mulA(r))),i=l.redMul(c)):(t=n.redMul(c).redMul(o.redSub(r)),i=this.curve._mulC(l).redMul(c)),this.curve.point(u,t,i)},c.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},c.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,i){return this.curve._wnafMulAdd(1,[this,t],[e,i],2,!1)},c.prototype.jmulAdd=function(e,t,i){return this.curve._wnafMulAdd(1,[this,t],[e,i],2,!0)},c.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},c.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()},c.prototype.getY=function(){return this.normalize(),this.y.fromRed()},c.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},c.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var i=e.clone(),n=this.curve.redN.redMul(this.z);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},95228(e,t,i){"use strict";var n=t;n.base=i(94499),n.short=i(53970),n.mont=i(50536),n.edwards=i(83544)},50536(e,t,i){"use strict";var n=i(5630),s=i(91193),r=i(94499),o=i(9185);function a(e){r.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function l(e,t,i){r.BasePoint.call(this,e,"projective"),null===t&&null===i?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}s(a,r),e.exports=a,a.prototype.validate=function(e){var t=e.normalize().x,i=t.redSqr(),n=i.redMul(t).redAdd(i.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},s(l,r.BasePoint),a.prototype.decodePoint=function(e,t){return this.point(o.toArray(e,t),1)},a.prototype.point=function(e,t){return new l(this,e,t)},a.prototype.pointFromJSON=function(e){return l.fromJSON(this,e)},l.prototype.precompute=function(){},l.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},l.fromJSON=function(e,t){return new l(e,t[0],t[1]||e.one)},l.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},l.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},l.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),i=e.redSub(t),n=e.redMul(t),s=i.redMul(t.redAdd(this.curve.a24.redMul(i)));return this.curve.point(n,s)},l.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},l.prototype.diffAdd=function(e,t){var i=this.x.redAdd(this.z),n=this.x.redSub(this.z),s=e.x.redAdd(e.z),r=e.x.redSub(e.z).redMul(i),o=s.redMul(n),a=t.z.redMul(r.redAdd(o).redSqr()),l=t.x.redMul(r.redISub(o).redSqr());return this.curve.point(a,l)},l.prototype.mul=function(e){for(var t=e.clone(),i=this,n=this.curve.point(null,null),s=[];0!==t.cmpn(0);t.iushrn(1))s.push(t.andln(1));for(var r=s.length-1;r>=0;r--)0===s[r]?(i=i.diffAdd(n,this),n=n.dbl()):(n=i.diffAdd(n,this),i=i.dbl());return n},l.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},l.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},l.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},l.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},l.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},53970(e,t,i){"use strict";var n=i(9185),s=i(5630),r=i(91193),o=i(94499),a=n.assert;function l(e){o.call(this,"short",e),this.a=new s(e.a,16).toRed(this.red),this.b=new s(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function c(e,t,i,n){o.BasePoint.call(this,e,"affine"),null===t&&null===i?(this.x=null,this.y=null,this.inf=!0):(this.x=new s(t,16),this.y=new s(i,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function h(e,t,i,n){o.BasePoint.call(this,e,"jacobian"),null===t&&null===i&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new s(0)):(this.x=new s(t,16),this.y=new s(i,16),this.z=new s(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}r(l,o),e.exports=l,l.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,i;if(e.beta)t=new s(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)i=new s(e.lambda,16);else{var r=this._getEndoRoots(this.n);0===this.g.mul(r[0]).x.cmp(this.g.x.redMul(t))?i=r[0]:(i=r[1],a(0===this.g.mul(i).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:i,basis:e.basis?e.basis.map(function(e){return{a:new s(e.a,16),b:new s(e.b,16)}}):this._getEndoBasis(i)}}},l.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:s.mont(e),i=new s(2).toRed(t).redInvm(),n=i.redNeg(),r=new s(3).toRed(t).redNeg().redSqrt().redMul(i);return[n.redAdd(r).fromRed(),n.redSub(r).fromRed()]},l.prototype._getEndoBasis=function(e){for(var t,i,n,r,o,a,l,c,h,u=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=e,p=this.n.clone(),g=new s(1),f=new s(0),m=new s(0),y=new s(1),v=0;0!==d.cmpn(0);){var b=p.div(d);c=p.sub(b.mul(d)),h=m.sub(b.mul(g));var C=y.sub(b.mul(f));if(!n&&c.cmp(u)<0)t=l.neg(),i=g,n=c.neg(),r=h;else if(n&&2===++v)break;l=c,p=d,d=c,m=g,g=h,y=f,f=C}o=c.neg(),a=h;var w=n.sqr().add(r.sqr());return o.sqr().add(a.sqr()).cmp(w)>=0&&(o=t,a=i),n.negative&&(n=n.neg(),r=r.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:n,b:r},{a:o,b:a}]},l.prototype._endoSplit=function(e){var t=this.endo.basis,i=t[0],n=t[1],s=n.b.mul(e).divRound(this.n),r=i.b.neg().mul(e).divRound(this.n),o=s.mul(i.a),a=r.mul(n.a),l=s.mul(i.b),c=r.mul(n.b);return{k1:e.sub(o).sub(a),k2:l.add(c).neg()}},l.prototype.pointFromX=function(e,t){(e=new s(e,16)).red||(e=e.toRed(this.red));var i=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=i.redSqrt();if(0!==n.redSqr().redSub(i).cmp(this.zero))throw new Error("invalid point");var r=n.fromRed().isOdd();return(t&&!r||!t&&r)&&(n=n.redNeg()),this.point(e,n)},l.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,i=e.y,n=this.a.redMul(t),s=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===i.redSqr().redISub(s).cmpn(0)},l.prototype._endoWnafMulAdd=function(e,t,i){for(var n=this._endoWnafT1,s=this._endoWnafT2,r=0;r<e.length;r++){var o=this._endoSplit(t[r]),a=e[r],l=a._getBeta();o.k1.negative&&(o.k1.ineg(),a=a.neg(!0)),o.k2.negative&&(o.k2.ineg(),l=l.neg(!0)),n[2*r]=a,n[2*r+1]=l,s[2*r]=o.k1,s[2*r+1]=o.k2}for(var c=this._wnafMulAdd(1,n,s,2*r,i),h=0;h<2*r;h++)n[h]=null,s[h]=null;return c},r(c,o.BasePoint),l.prototype.point=function(e,t,i){return new c(this,e,t,i)},l.prototype.pointFromJSON=function(e,t){return c.fromJSON(this,e,t)},c.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var i=this.curve,n=function(e){return i.point(e.x.redMul(i.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},c.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},c.fromJSON=function(e,t,i){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],i);if(!t[2])return n;function s(t){return e.point(t[0],t[1],i)}var r=t[2];return n.precomputed={beta:null,doubles:r.doubles&&{step:r.doubles.step,points:[n].concat(r.doubles.points.map(s))},naf:r.naf&&{wnd:r.naf.wnd,points:[n].concat(r.naf.points.map(s))}},n},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var i=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,n)},c.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,i=this.x.redSqr(),n=e.redInvm(),s=i.redAdd(i).redIAdd(i).redIAdd(t).redMul(n),r=s.redSqr().redISub(this.x.redAdd(this.x)),o=s.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,o)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(e){return e=new s(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,i){var n=[this,t],s=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(n,s):this.curve._wnafMulAdd(1,n,s,2)},c.prototype.jmulAdd=function(e,t,i){var n=[this,t],s=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(n,s,!0):this.curve._wnafMulAdd(1,n,s,2,!0)},c.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},c.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var i=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:i.naf&&{wnd:i.naf.wnd,points:i.naf.points.map(n)},doubles:i.doubles&&{step:i.doubles.step,points:i.doubles.points.map(n)}}}return t},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},r(h,o.BasePoint),l.prototype.jpoint=function(e,t,i){return new h(this,e,t,i)},h.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),i=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(i,n)},h.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},h.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),i=this.z.redSqr(),n=this.x.redMul(t),s=e.x.redMul(i),r=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(i.redMul(this.z)),a=n.redSub(s),l=r.redSub(o);if(0===a.cmpn(0))return 0!==l.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),h=c.redMul(a),u=n.redMul(c),d=l.redSqr().redIAdd(h).redISub(u).redISub(u),p=l.redMul(u.redISub(d)).redISub(r.redMul(h)),g=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(d,p,g)},h.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),i=this.x,n=e.x.redMul(t),s=this.y,r=e.y.redMul(t).redMul(this.z),o=i.redSub(n),a=s.redSub(r);if(0===o.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var l=o.redSqr(),c=l.redMul(o),h=i.redMul(l),u=a.redSqr().redIAdd(c).redISub(h).redISub(h),d=a.redMul(h.redISub(u)).redISub(s.redMul(c)),p=this.z.redMul(o);return this.curve.jpoint(u,d,p)},h.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var i=this;for(t=0;t<e;t++)i=i.dbl();return i}var n=this.curve.a,s=this.curve.tinv,r=this.x,o=this.y,a=this.z,l=a.redSqr().redSqr(),c=o.redAdd(o);for(t=0;t<e;t++){var h=r.redSqr(),u=c.redSqr(),d=u.redSqr(),p=h.redAdd(h).redIAdd(h).redIAdd(n.redMul(l)),g=r.redMul(u),f=p.redSqr().redISub(g.redAdd(g)),m=g.redISub(f),y=p.redMul(m);y=y.redIAdd(y).redISub(d);var v=c.redMul(a);t+1<e&&(l=l.redMul(d)),r=f,a=v,c=y}return this.curve.jpoint(r,c.redMul(s),a)},h.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},h.prototype._zeroDbl=function(){var e,t,i;if(this.zOne){var n=this.x.redSqr(),s=this.y.redSqr(),r=s.redSqr(),o=this.x.redAdd(s).redSqr().redISub(n).redISub(r);o=o.redIAdd(o);var a=n.redAdd(n).redIAdd(n),l=a.redSqr().redISub(o).redISub(o),c=r.redIAdd(r);c=(c=c.redIAdd(c)).redIAdd(c),e=l,t=a.redMul(o.redISub(l)).redISub(c),i=this.y.redAdd(this.y)}else{var h=this.x.redSqr(),u=this.y.redSqr(),d=u.redSqr(),p=this.x.redAdd(u).redSqr().redISub(h).redISub(d);p=p.redIAdd(p);var g=h.redAdd(h).redIAdd(h),f=g.redSqr(),m=d.redIAdd(d);m=(m=m.redIAdd(m)).redIAdd(m),e=f.redISub(p).redISub(p),t=g.redMul(p.redISub(e)).redISub(m),i=(i=this.y.redMul(this.z)).redIAdd(i)}return this.curve.jpoint(e,t,i)},h.prototype._threeDbl=function(){var e,t,i;if(this.zOne){var n=this.x.redSqr(),s=this.y.redSqr(),r=s.redSqr(),o=this.x.redAdd(s).redSqr().redISub(n).redISub(r);o=o.redIAdd(o);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),l=a.redSqr().redISub(o).redISub(o);e=l;var c=r.redIAdd(r);c=(c=c.redIAdd(c)).redIAdd(c),t=a.redMul(o.redISub(l)).redISub(c),i=this.y.redAdd(this.y)}else{var h=this.z.redSqr(),u=this.y.redSqr(),d=this.x.redMul(u),p=this.x.redSub(h).redMul(this.x.redAdd(h));p=p.redAdd(p).redIAdd(p);var g=d.redIAdd(d),f=(g=g.redIAdd(g)).redAdd(g);e=p.redSqr().redISub(f),i=this.y.redAdd(this.z).redSqr().redISub(u).redISub(h);var m=u.redSqr();m=(m=(m=m.redIAdd(m)).redIAdd(m)).redIAdd(m),t=p.redMul(g.redISub(e)).redISub(m)}return this.curve.jpoint(e,t,i)},h.prototype._dbl=function(){var e=this.curve.a,t=this.x,i=this.y,n=this.z,s=n.redSqr().redSqr(),r=t.redSqr(),o=i.redSqr(),a=r.redAdd(r).redIAdd(r).redIAdd(e.redMul(s)),l=t.redAdd(t),c=(l=l.redIAdd(l)).redMul(o),h=a.redSqr().redISub(c.redAdd(c)),u=c.redISub(h),d=o.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var p=a.redMul(u).redISub(d),g=i.redAdd(i).redMul(n);return this.curve.jpoint(h,p,g)},h.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),i=this.z.redSqr(),n=t.redSqr(),s=e.redAdd(e).redIAdd(e),r=s.redSqr(),o=this.x.redAdd(t).redSqr().redISub(e).redISub(n),a=(o=(o=(o=o.redIAdd(o)).redAdd(o).redIAdd(o)).redISub(r)).redSqr(),l=n.redIAdd(n);l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var c=s.redIAdd(o).redSqr().redISub(r).redISub(a).redISub(l),h=t.redMul(c);h=(h=h.redIAdd(h)).redIAdd(h);var u=this.x.redMul(a).redISub(h);u=(u=u.redIAdd(u)).redIAdd(u);var d=this.y.redMul(c.redMul(l.redISub(c)).redISub(o.redMul(a)));d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var p=this.z.redAdd(o).redSqr().redISub(i).redISub(a);return this.curve.jpoint(u,d,p)},h.prototype.mul=function(e,t){return e=new s(e,t),this.curve._wnafMul(this,e)},h.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),i=e.z.redSqr();if(0!==this.x.redMul(i).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),s=i.redMul(e.z);return 0===this.y.redMul(s).redISub(e.y.redMul(n)).cmpn(0)},h.prototype.eqXToP=function(e){var t=this.z.redSqr(),i=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(i))return!0;for(var n=e.clone(),s=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(i.redIAdd(s),0===this.x.cmp(i))return!0}},h.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},h.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},25366(e,t,i){"use strict";var n,s=t,r=i(61631),o=i(95228),a=i(9185).assert;function l(e){"short"===e.type?this.curve=new o.short(e):"edwards"===e.type?this.curve=new o.edwards(e):this.curve=new o.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(e,t){Object.defineProperty(s,e,{configurable:!0,enumerable:!0,get:function(){var i=new l(t);return Object.defineProperty(s,e,{configurable:!0,enumerable:!0,value:i}),i}})}s.PresetCurve=l,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:r.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:r.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:r.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:r.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:r.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=i(67153)}catch(e){n=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:r.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},72961(e,t,i){"use strict";var n=i(5630),s=i(52519),r=i(9185),o=i(25366),a=i(65442),l=r.assert,c=i(5666),h=i(44375);function u(e){if(!(this instanceof u))return new u(e);"string"==typeof e&&(l(Object.prototype.hasOwnProperty.call(o,e),"Unknown curve "+e),e=o[e]),e instanceof o.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=u,u.prototype.keyPair=function(e){return new c(this,e)},u.prototype.keyFromPrivate=function(e,t){return c.fromPrivate(this,e,t)},u.prototype.keyFromPublic=function(e,t){return c.fromPublic(this,e,t)},u.prototype.genKeyPair=function(e){e||(e={});for(var t=new s({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||a(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),i=this.n.byteLength(),r=this.n.sub(new n(2));;){var o=new n(t.generate(i));if(!(o.cmp(r)>0))return o.iaddn(1),this.keyFromPrivate(o)}},u.prototype._truncateToN=function(e,t,i){var s;if(n.isBN(e)||"number"==typeof e)s=(e=new n(e,16)).byteLength();else if("object"==typeof e)s=e.length,e=new n(e,16);else{var r=e.toString();s=r.length+1>>>1,e=new n(r,16)}"number"!=typeof i&&(i=8*s);var o=i-this.n.bitLength();return o>0&&(e=e.ushrn(o)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},u.prototype.sign=function(e,t,i,r){if("object"==typeof i&&(r=i,i=null),r||(r={}),"string"!=typeof e&&"number"!=typeof e&&!n.isBN(e)){l("object"==typeof e&&e&&"number"==typeof e.length,"Expected message to be an array-like, a hex string, or a BN instance"),l(e.length>>>0===e.length);for(var o=0;o<e.length;o++)l((255&e[o])===e[o])}t=this.keyFromPrivate(t,i),e=this._truncateToN(e,!1,r.msgBitLength),l(!e.isNeg(),"Can not sign a negative message");var a=this.n.byteLength(),c=t.getPrivate().toArray("be",a),u=e.toArray("be",a);l(new n(u).eq(e),"Can not sign message");for(var d=new s({hash:this.hash,entropy:c,nonce:u,pers:r.pers,persEnc:r.persEnc||"utf8"}),p=this.n.sub(new n(1)),g=0;;g++){var f=r.k?r.k(g):new n(d.generate(this.n.byteLength()));if(!((f=this._truncateToN(f,!0)).cmpn(1)<=0||f.cmp(p)>=0)){var m=this.g.mul(f);if(!m.isInfinity()){var y=m.getX(),v=y.umod(this.n);if(0!==v.cmpn(0)){var b=f.invm(this.n).mul(v.mul(t.getPrivate()).iadd(e));if(0!==(b=b.umod(this.n)).cmpn(0)){var C=(m.getY().isOdd()?1:0)|(0!==y.cmp(v)?2:0);return r.canonical&&b.cmp(this.nh)>0&&(b=this.n.sub(b),C^=1),new h({r:v,s:b,recoveryParam:C})}}}}}},u.prototype.verify=function(e,t,i,n,s){s||(s={}),e=this._truncateToN(e,!1,s.msgBitLength),i=this.keyFromPublic(i,n);var r=(t=new h(t,"hex")).r,o=t.s;if(r.cmpn(1)<0||r.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,l=o.invm(this.n),c=l.mul(e).umod(this.n),u=l.mul(r).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(c,i.getPublic(),u)).isInfinity()&&a.eqXToP(r):!(a=this.g.mulAdd(c,i.getPublic(),u)).isInfinity()&&0===a.getX().umod(this.n).cmp(r)},u.prototype.recoverPubKey=function(e,t,i,s){l((3&i)===i,"The recovery param is more than two bits"),t=new h(t,s);var r=this.n,o=new n(e),a=t.r,c=t.s,u=1&i,d=i>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");a=d?this.curve.pointFromX(a.add(this.curve.n),u):this.curve.pointFromX(a,u);var p=t.r.invm(r),g=r.sub(o).mul(p).umod(r),f=c.mul(p).umod(r);return this.g.mulAdd(g,a,f)},u.prototype.getKeyRecoveryParam=function(e,t,i,n){if(null!==(t=new h(t,n)).recoveryParam)return t.recoveryParam;for(var s=0;s<4;s++){var r;try{r=this.recoverPubKey(e,t,s)}catch(e){continue}if(r.eq(i))return s}throw new Error("Unable to find valid recovery factor")}},5666(e,t,i){"use strict";var n=i(5630),s=i(9185).assert;function r(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=r,r.fromPublic=function(e,t,i){return t instanceof r?t:new r(e,{pub:t,pubEnc:i})},r.fromPrivate=function(e,t,i){return t instanceof r?t:new r(e,{priv:t,privEnc:i})},r.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},r.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},r.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},r.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},r.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?s(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||s(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},r.prototype.derive=function(e){return e.validate()||s(e.validate(),"public point not validated"),e.mul(this.priv).getX()},r.prototype.sign=function(e,t,i){return this.ec.sign(e,this,t,i)},r.prototype.verify=function(e,t,i){return this.ec.verify(e,t,this,void 0,i)},r.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},44375(e,t,i){"use strict";var n=i(5630),s=i(9185),r=s.assert;function o(e,t){if(e instanceof o)return e;this._importDER(e,t)||(r(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function a(){this.place=0}function l(e,t){var i=e[t.place++];if(!(128&i))return i;var n=15&i;if(0===n||n>4)return!1;if(0===e[t.place])return!1;for(var s=0,r=0,o=t.place;r<n;r++,o++)s<<=8,s|=e[o],s>>>=0;return!(s<=127)&&(t.place=o,s)}function c(e){for(var t=0,i=e.length-1;!e[t]&&!(128&e[t+1])&&t<i;)t++;return 0===t?e:e.slice(t)}function h(e,t){if(t<128)e.push(t);else{var i=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|i);--i;)e.push(t>>>(i<<3)&255);e.push(t)}}e.exports=o,o.prototype._importDER=function(e,t){e=s.toArray(e,t);var i=new a;if(48!==e[i.place++])return!1;var r=l(e,i);if(!1===r)return!1;if(r+i.place!==e.length)return!1;if(2!==e[i.place++])return!1;var o=l(e,i);if(!1===o)return!1;if(128&e[i.place])return!1;var c=e.slice(i.place,o+i.place);if(i.place+=o,2!==e[i.place++])return!1;var h=l(e,i);if(!1===h)return!1;if(e.length!==h+i.place)return!1;if(128&e[i.place])return!1;var u=e.slice(i.place,h+i.place);if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}return this.r=new n(c),this.s=new n(u),this.recoveryParam=null,!0},o.prototype.toDER=function(e){var t=this.r.toArray(),i=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&i[0]&&(i=[0].concat(i)),t=c(t),i=c(i);!(i[0]||128&i[1]);)i=i.slice(1);var n=[2];h(n,t.length),(n=n.concat(t)).push(2),h(n,i.length);var r=n.concat(i),o=[48];return h(o,r.length),o=o.concat(r),s.encode(o,e)}},87808(e,t,i){"use strict";var n=i(61631),s=i(25366),r=i(9185),o=r.assert,a=r.parseBytes,l=i(36419),c=i(95406);function h(e){if(o("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof h))return new h(e);e=s[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}e.exports=h,h.prototype.sign=function(e,t){e=a(e);var i=this.keyFromSecret(t),n=this.hashInt(i.messagePrefix(),e),s=this.g.mul(n),r=this.encodePoint(s),o=this.hashInt(r,i.pubBytes(),e).mul(i.priv()),l=n.add(o).umod(this.curve.n);return this.makeSignature({R:s,S:l,Rencoded:r})},h.prototype.verify=function(e,t,i){if(e=a(e),(t=this.makeSignature(t)).S().gte(t.eddsa.curve.n)||t.S().isNeg())return!1;var n=this.keyFromPublic(i),s=this.hashInt(t.Rencoded(),n.pubBytes(),e),r=this.g.mul(t.S());return t.R().add(n.pub().mul(s)).eq(r)},h.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return r.intFromLE(e.digest()).umod(this.curve.n)},h.prototype.keyFromPublic=function(e){return l.fromPublic(this,e)},h.prototype.keyFromSecret=function(e){return l.fromSecret(this,e)},h.prototype.makeSignature=function(e){return e instanceof c?e:new c(this,e)},h.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},h.prototype.decodePoint=function(e){var t=(e=r.parseBytes(e)).length-1,i=e.slice(0,t).concat(-129&e[t]),n=!!(128&e[t]),s=r.intFromLE(i);return this.curve.pointFromY(s,n)},h.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},h.prototype.decodeInt=function(e){return r.intFromLE(e)},h.prototype.isPoint=function(e){return e instanceof this.pointClass}},36419(e,t,i){"use strict";var n=i(9185),s=n.assert,r=n.parseBytes,o=n.cachedProperty;function a(e,t){this.eddsa=e,this._secret=r(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=r(t.pub)}a.fromPublic=function(e,t){return t instanceof a?t:new a(e,{pub:t})},a.fromSecret=function(e,t){return t instanceof a?t:new a(e,{secret:t})},a.prototype.secret=function(){return this._secret},o(a,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),o(a,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),o(a,"privBytes",function(){var e=this.eddsa,t=this.hash(),i=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[i]&=127,n[i]|=64,n}),o(a,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),o(a,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),o(a,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),a.prototype.sign=function(e){return s(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},a.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},a.prototype.getSecret=function(e){return s(this._secret,"KeyPair is public only"),n.encode(this.secret(),e)},a.prototype.getPublic=function(e){return n.encode(this.pubBytes(),e)},e.exports=a},95406(e,t,i){"use strict";var n=i(5630),s=i(9185),r=s.assert,o=s.cachedProperty,a=s.parseBytes;function l(e,t){this.eddsa=e,"object"!=typeof t&&(t=a(t)),Array.isArray(t)&&(r(t.length===2*e.encodingLength,"Signature has invalid size"),t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),r(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof n&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}o(l,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),o(l,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),o(l,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),o(l,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),l.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},l.prototype.toHex=function(){return s.encode(this.toBytes(),"hex").toUpperCase()},e.exports=l},67153(e){e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},9185(e,t,i){"use strict";var n=t,s=i(5630),r=i(35578),o=i(94209);n.assert=r,n.toArray=o.toArray,n.zero2=o.zero2,n.toHex=o.toHex,n.encode=o.encode,n.getNAF=function(e,t,i){var n,s=new Array(Math.max(e.bitLength(),i)+1);for(n=0;n<s.length;n+=1)s[n]=0;var r=1<<t+1,o=e.clone();for(n=0;n<s.length;n++){var a,l=o.andln(r-1);o.isOdd()?(a=l>(r>>1)-1?(r>>1)-l:l,o.isubn(a)):a=0,s[n]=a,o.iushrn(1)}return s},n.getJSF=function(e,t){var i=[[],[]];e=e.clone(),t=t.clone();for(var n,s=0,r=0;e.cmpn(-s)>0||t.cmpn(-r)>0;){var o,a,l=e.andln(3)+s&3,c=t.andln(3)+r&3;3===l&&(l=-1),3===c&&(c=-1),o=1&l?3!=(n=e.andln(7)+s&7)&&5!==n||2!==c?l:-l:0,i[0].push(o),a=1&c?3!=(n=t.andln(7)+r&7)&&5!==n||2!==l?c:-c:0,i[1].push(a),2*s===o+1&&(s=1-s),2*r===a+1&&(r=1-r),e.iushrn(1),t.iushrn(1)}return i},n.cachedProperty=function(e,t,i){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=i.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new s(e,"hex","le")}},15120(e){function t(e){if(e)return function(e){for(var i in t.prototype)e[i]=t.prototype[i];return e}(e)}e.exports=t,t.prototype.on=t.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[e]=this._callbacks[e]||[]).push(t),this},t.prototype.once=function(e,t){var i=this;function n(){i.off(e,n),t.apply(this,arguments)}return this._callbacks=this._callbacks||{},n.fn=t,this.on(e,n),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var i,n=this._callbacks[e];if(!n)return this;if(1==arguments.length)return delete this._callbacks[e],this;for(var s=0;s<n.length;s++)if((i=n[s])===t||i.fn===t){n.splice(s,1);break}return this},t.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),i=this._callbacks[e];if(i)for(var n=0,s=(i=i.slice(0)).length;n<s;++n)i[n].apply(this,t);return this},t.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[e]||[]},t.prototype.hasListeners=function(e){return!!this.listeners(e).length}},15726(e,t,i){var n=i(69866),s=i(24758).each;function r(e,t){this.query=e,this.isUnconditional=t,this.handlers=[],this.mql=window.matchMedia(e);var i=this;this.listener=function(e){i.mql=e.currentTarget||e,i.assess()},this.mql.addListener(this.listener)}r.prototype={constuctor:r,addHandler:function(e){var t=new n(e);this.handlers.push(t),this.matches()&&t.on()},removeHandler:function(e){var t=this.handlers;s(t,function(i,n){if(i.equals(e))return i.destroy(),!t.splice(n,1)})},matches:function(){return this.mql.matches||this.isUnconditional},clear:function(){s(this.handlers,function(e){e.destroy()}),this.mql.removeListener(this.listener),this.handlers.length=0},assess:function(){var e=this.matches()?"on":"off";s(this.handlers,function(t){t[e]()})}},e.exports=r},68456(e,t,i){var n=i(15726),s=i(24758),r=s.each,o=s.isFunction,a=s.isArray;function l(){if(!window.matchMedia)throw new Error("matchMedia not present, legacy browsers require a polyfill");this.queries={},this.browserIsIncapable=!window.matchMedia("only all").matches}l.prototype={constructor:l,register:function(e,t,i){var s=this.queries,l=i&&this.browserIsIncapable;return s[e]||(s[e]=new n(e,l)),o(t)&&(t={match:t}),a(t)||(t=[t]),r(t,function(t){o(t)&&(t={match:t}),s[e].addHandler(t)}),this},unregister:function(e,t){var i=this.queries[e];return i&&(t?i.removeHandler(t):(i.clear(),delete this.queries[e])),this}},e.exports=l},69866(e){function t(e){this.options=e,!e.deferSetup&&this.setup()}t.prototype={constructor:t,setup:function(){this.options.setup&&this.options.setup(),this.initialised=!0},on:function(){!this.initialised&&this.setup(),this.options.match&&this.options.match()},off:function(){this.options.unmatch&&this.options.unmatch()},destroy:function(){this.options.destroy?this.options.destroy():this.off()},equals:function(e){return this.options===e||this.options.match===e}},e.exports=t},24758(e){e.exports={isFunction:function(e){return"function"==typeof e},isArray:function(e){return"[object Array]"===Object.prototype.toString.apply(e)},each:function(e,t){for(var i=0,n=e.length;i<n&&!1!==t(e[i],i);i++);}}},78708(e,t,i){var n=i(68456);e.exports=new n},39886(e){"use strict";var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch(e){t=!1}e.exports=t},38004(e){"use strict";e.exports=EvalError},41488(e){"use strict";e.exports=Error},96469(e){"use strict";e.exports=RangeError},12557(e){"use strict";e.exports=ReferenceError},63429(e){"use strict";e.exports=SyntaxError},71102(e){"use strict";e.exports=TypeError},85966(e){"use strict";e.exports=URIError},25153(e){"use strict";e.exports=Object},80381(e){"use strict";var t,i="object"==typeof Reflect?Reflect:null,n=i&&"function"==typeof i.apply?i.apply:function(e,t,i){return Function.prototype.apply.call(e,t,i)};t=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function r(){r.init.call(this)}e.exports=r,e.exports.once=function(e,t){return new Promise(function(i,n){function s(i){e.removeListener(t,r),n(i)}function r(){"function"==typeof e.removeListener&&e.removeListener("error",s),i([].slice.call(arguments))}f(e,t,r,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&f(e,"error",t,{once:!0})}(e,s)})},r.EventEmitter=r,r.prototype._events=void 0,r.prototype._eventsCount=0,r.prototype._maxListeners=void 0;var o=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?r.defaultMaxListeners:e._maxListeners}function c(e,t,i,n){var s,r,o,c;if(a(i),void 0===(r=e._events)?(r=e._events=Object.create(null),e._eventsCount=0):(void 0!==r.newListener&&(e.emit("newListener",t,i.listener?i.listener:i),r=e._events),o=r[t]),void 0===o)o=r[t]=i,++e._eventsCount;else if("function"==typeof o?o=r[t]=n?[i,o]:[o,i]:n?o.unshift(i):o.push(i),(s=l(e))>0&&o.length>s&&!o.warned){o.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=e,h.type=t,h.count=o.length,c=h,console&&console.warn&&console.warn(c)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function u(e,t,i){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:i},s=h.bind(n);return s.listener=i,n.wrapFn=s,s}function d(e,t,i){var n=e._events;if(void 0===n)return[];var s=n[t];return void 0===s?[]:"function"==typeof s?i?[s.listener||s]:[s]:i?function(e){for(var t=new Array(e.length),i=0;i<t.length;++i)t[i]=e[i].listener||e[i];return t}(s):g(s,s.length)}function p(e){var t=this._events;if(void 0!==t){var i=t[e];if("function"==typeof i)return 1;if(void 0!==i)return i.length}return 0}function g(e,t){for(var i=new Array(t),n=0;n<t;++n)i[n]=e[n];return i}function f(e,t,i,n){if("function"==typeof e.on)n.once?e.once(t,i):e.on(t,i);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function s(r){n.once&&e.removeEventListener(t,s),i(r)})}}Object.defineProperty(r,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");o=e}}),r.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},r.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},r.prototype.getMaxListeners=function(){return l(this)},r.prototype.emit=function(e){for(var t=[],i=1;i<arguments.length;i++)t.push(arguments[i]);var s="error"===e,r=this._events;if(void 0!==r)s=s&&void 0===r.error;else if(!s)return!1;if(s){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var l=r[e];if(void 0===l)return!1;if("function"==typeof l)n(l,this,t);else{var c=l.length,h=g(l,c);for(i=0;i<c;++i)n(h[i],this,t)}return!0},r.prototype.addListener=function(e,t){return c(this,e,t,!1)},r.prototype.on=r.prototype.addListener,r.prototype.prependListener=function(e,t){return c(this,e,t,!0)},r.prototype.once=function(e,t){return a(t),this.on(e,u(this,e,t)),this},r.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,u(this,e,t)),this},r.prototype.removeListener=function(e,t){var i,n,s,r,o;if(a(t),void 0===(n=this._events))return this;if(void 0===(i=n[e]))return this;if(i===t||i.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,i.listener||t));else if("function"!=typeof i){for(s=-1,r=i.length-1;r>=0;r--)if(i[r]===t||i[r].listener===t){o=i[r].listener,s=r;break}if(s<0)return this;0===s?i.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(i,s),1===i.length&&(n[e]=i[0]),void 0!==n.removeListener&&this.emit("removeListener",e,o||t)}return this},r.prototype.off=r.prototype.removeListener,r.prototype.removeAllListeners=function(e){var t,i,n;if(void 0===(i=this._events))return this;if(void 0===i.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==i[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete i[e]),this;if(0===arguments.length){var s,r=Object.keys(i);for(n=0;n<r.length;++n)"removeListener"!==(s=r[n])&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=i[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},r.prototype.listeners=function(e){return d(this,e,!0)},r.prototype.rawListeners=function(e){return d(this,e,!1)},r.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},r.prototype.listenerCount=p,r.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},51804(e,t,i){var n=i(56608).Buffer,s=i(75035);e.exports=function(e,t,i,r){if(n.isBuffer(e)||(e=n.from(e,"binary")),t&&(n.isBuffer(t)||(t=n.from(t,"binary")),8!==t.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var o=i/8,a=n.alloc(o),l=n.alloc(r||0),c=n.alloc(0);o>0||r>0;){var h=new s;h.update(c),h.update(e),t&&h.update(t),c=h.digest();var u=0;if(o>0){var d=a.length-o;u=Math.min(o,c.length),c.copy(a,d,0,u),o-=u}if(u<c.length&&r>0){var p=l.length-r,g=Math.min(r,c.length-u);c.copy(l,p,u,u+g),r-=g}}return c.fill(0),{key:a,iv:l}}},49461(e){"use strict";var t=Object.prototype.hasOwnProperty,i=Object.prototype.toString,n=Object.defineProperty,s=Object.getOwnPropertyDescriptor,r=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===i.call(e)},o=function(e){if(!e||"[object Object]"!==i.call(e))return!1;var n,s=t.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!s&&!r)return!1;for(n in e);return void 0===n||t.call(e,n)},a=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,i){if("__proto__"===i){if(!t.call(e,i))return;if(s)return s(e,i).value}return e[i]};e.exports=function e(){var t,i,n,s,c,h,u=arguments[0],d=1,p=arguments.length,g=!1;for("boolean"==typeof u&&(g=u,u=arguments[1]||{},d=2),(null==u||"object"!=typeof u&&"function"!=typeof u)&&(u={});d<p;++d)if(null!=(t=arguments[d]))for(i in t)n=l(u,i),u!==(s=l(t,i))&&(g&&s&&(o(s)||(c=r(s)))?(c?(c=!1,h=n&&r(n)?n:[]):h=n&&o(n)?n:{},a(u,{name:i,newValue:e(g,h,s)})):void 0!==s&&a(u,{name:i,newValue:s}));return u}},67371(e){"use strict";e.exports=function e(t,i){if(t===i)return!0;if(t&&i&&"object"==typeof t&&"object"==typeof i){if(t.constructor!==i.constructor)return!1;var n,s,r;if(Array.isArray(t)){if((n=t.length)!=i.length)return!1;for(s=n;0!==s--;)if(!e(t[s],i[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===i.source&&t.flags===i.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===i.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===i.toString();if((n=(r=Object.keys(t)).length)!==Object.keys(i).length)return!1;for(s=n;0!==s--;)if(!Object.prototype.hasOwnProperty.call(i,r[s]))return!1;for(s=n;0!==s--;){var o=r[s];if(!e(t[o],i[o]))return!1}return!0}return t!=t&&i!=i}},53039(e,t,i){"use strict";i.d(t,{D4:()=>k});var n=i(84708),s=i(35310);const r=[];for(let e=0;e<256;e++){let t=e;for(let e=0;e<8;e++)1&t?t=3988292384^t>>>1:t>>>=1;r[e]=t}const o=4294967295;function a(e,t,i){const n=e.readUint32(),s=(a=new Uint8Array(e.buffer,e.byteOffset+e.offset-t-4,t),(function(e,t,i){let n=e;for(let e=0;e<i;e++)n=r[255&(n^t[e])]^n>>>8;return n}(o,a,t)^o)>>>0);var a;if(s!==n)throw new Error(`CRC mismatch for chunk ${i}. Expected ${n}, found ${s}`)}function l(e,t,i){for(let n=0;n<i;n++)t[n]=e[n]}function c(e,t,i,n){let s=0;for(;s<n;s++)t[s]=e[s];for(;s<i;s++)t[s]=e[s]+t[s-n]&255}function h(e,t,i,n){let s=0;if(0===i.length)for(;s<n;s++)t[s]=e[s];else for(;s<n;s++)t[s]=e[s]+i[s]&255}function u(e,t,i,n,s){let r=0;if(0===i.length){for(;r<s;r++)t[r]=e[r];for(;r<n;r++)t[r]=e[r]+(t[r-s]>>1)&255}else{for(;r<s;r++)t[r]=e[r]+(i[r]>>1)&255;for(;r<n;r++)t[r]=e[r]+(t[r-s]+i[r]>>1)&255}}function d(e,t,i,n,s){let r=0;if(0===i.length){for(;r<s;r++)t[r]=e[r];for(;r<n;r++)t[r]=e[r]+t[r-s]&255}else{for(;r<s;r++)t[r]=e[r]+i[r]&255;for(;r<n;r++)t[r]=e[r]+p(t[r-s],i[r],i[r-s])&255}}function p(e,t,i){const n=e+t-i,s=Math.abs(n-e),r=Math.abs(n-t),o=Math.abs(n-i);return s<=r&&s<=o?e:r<=o?t:i}function g(e,t,i,n,s,r){switch(e){case 0:l(t,i,s);break;case 1:c(t,i,s,r);break;case 2:h(t,i,n,s);break;case 3:u(t,i,n,s,r);break;case 4:d(t,i,n,s,r);break;default:throw new Error(`Unsupported filter: ${e}`)}}const f=new Uint16Array([255]),m=255===new Uint8Array(f.buffer)[0];function y(e){return(255&e)<<8|e>>8&255}const v=new Uint16Array([255]),b=255===new Uint8Array(v.buffer)[0],C=new Uint8Array(0);function w(e){const{data:t,width:i,height:n,channels:s,depth:r}=e,o=Math.ceil(r/8)*s,a=Math.ceil(r/8*s*i),p=new Uint8Array(n*a);let g,f,m=C,y=0;for(let e=0;e<n;e++){switch(g=t.subarray(y+1,y+1+a),f=p.subarray(e*a,(e+1)*a),t[y]){case 0:l(g,f,a);break;case 1:c(g,f,a,o);break;case 2:h(g,f,m,a);break;case 3:u(g,f,m,a,o);break;case 4:d(g,f,m,a,o);break;default:throw new Error(`Unsupported filter: ${t[y]}`)}m=f,y+=a+1}if(16===r){const e=new Uint16Array(p.buffer);if(b)for(let t=0;t<e.length;t++)e[t]=S(e[t]);return e}return p}function S(e){return(255&e)<<8|e>>8&255}const x=Uint8Array.of(137,80,78,71,13,10,26,10);function E(e){if(!function(e){if(e.length<x.length)return!1;for(let t=0;t<x.length;t++)if(e[t]!==x[t])return!1;return!0}(e.readBytes(x.length)))throw new Error("wrong PNG signature")}const A=new TextDecoder("latin1");function M(e){if(function(e){if(!T.test(e))throw new Error("invalid latin1 text")}(e),0===e.length||e.length>79)throw new Error("keyword length must be between 1 and 79")}const T=/^[\u0000-\u00FF]*$/;function D(e){for(e.mark();0!==e.readByte(););const t=e.offset;e.reset();const i=A.decode(e.readBytes(t-e.offset-1));return e.skip(1),M(i),i}class I extends n.H{_checkCrc;_inflator;_png;_apng;_end;_hasPalette;_palette;_hasTransparency;_transparency;_compressionMethod;_filterMethod;_interlaceMethod;_colorType;_isAnimated;_numberOfFrames;_numberOfPlays;_frames;_writingDataChunks;constructor(e,t={}){super(e);const{checkCrc:i=!1}=t;this._checkCrc=i,this._inflator=new s.EL,this._png={width:-1,height:-1,channels:-1,data:new Uint8Array(0),depth:1,text:{}},this._apng={width:-1,height:-1,channels:-1,depth:1,numberOfFrames:1,numberOfPlays:0,text:{},frames:[]},this._end=!1,this._hasPalette=!1,this._palette=[],this._hasTransparency=!1,this._transparency=new Uint16Array(0),this._compressionMethod=-1,this._filterMethod=-1,this._interlaceMethod=-1,this._colorType=-1,this._isAnimated=!1,this._numberOfFrames=1,this._numberOfPlays=0,this._frames=[],this._writingDataChunks=!1,this.setBigEndian()}decode(){for(E(this);!this._end;){const e=this.readUint32(),t=this.readChars(4);this.decodeChunk(e,t)}return this.decodeImage(),this._png}decodeApng(){for(E(this);!this._end;){const e=this.readUint32(),t=this.readChars(4);this.decodeApngChunk(e,t)}return this.decodeApngImage(),this._apng}decodeChunk(e,t){const i=this.offset;switch(t){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(e);break;case"IDAT":this.decodeIDAT(e);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(e);break;case"iCCP":this.decodeiCCP(e);break;case"tEXt":!function(e,t,i){const n=D(t);e[n]=function(e,t){return A.decode(e.readBytes(t))}(t,i-n.length-1)}(this._png.text,this,e);break;case"pHYs":this.decodepHYs();break;default:this.skip(e)}if(this.offset-i!==e)throw new Error(`Length mismatch while decoding chunk ${t}`);this._checkCrc?a(this,e+4,t):this.skip(4)}decodeApngChunk(e,t){const i=this.offset;switch("fdAT"!==t&&"IDAT"!==t&&this._writingDataChunks&&this.pushDataToFrame(),t){case"acTL":this.decodeACTL();break;case"fcTL":this.decodeFCTL();break;case"fdAT":this.decodeFDAT(e);break;default:this.decodeChunk(e,t),this.offset=i+e}if(this.offset-i!==e)throw new Error(`Length mismatch while decoding chunk ${t}`);this._checkCrc?a(this,e+4,t):this.skip(4)}decodeIHDR(){const e=this._png;e.width=this.readUint32(),e.height=this.readUint32(),e.depth=function(e){if(1!==e&&2!==e&&4!==e&&8!==e&&16!==e)throw new Error(`invalid bit depth: ${e}`);return e}(this.readUint8());const t=this.readUint8();let i;switch(this._colorType=t,t){case 0:case 3:i=1;break;case 2:i=3;break;case 4:i=2;break;case 6:i=4;break;default:throw new Error(`Unknown color type: ${t}`)}if(this._png.channels=i,this._compressionMethod=this.readUint8(),0!==this._compressionMethod)throw new Error(`Unsupported compression method: ${this._compressionMethod}`);this._filterMethod=this.readUint8(),this._interlaceMethod=this.readUint8()}decodeACTL(){this._numberOfFrames=this.readUint32(),this._numberOfPlays=this.readUint32(),this._isAnimated=!0}decodeFCTL(){const e={sequenceNumber:this.readUint32(),width:this.readUint32(),height:this.readUint32(),xOffset:this.readUint32(),yOffset:this.readUint32(),delayNumber:this.readUint16(),delayDenominator:this.readUint16(),disposeOp:this.readUint8(),blendOp:this.readUint8(),data:new Uint8Array(0)};this._frames.push(e)}decodePLTE(e){if(e%3!=0)throw new RangeError(`PLTE field length must be a multiple of 3. Got ${e}`);const t=e/3;this._hasPalette=!0;const i=[];this._palette=i;for(let e=0;e<t;e++)i.push([this.readUint8(),this.readUint8(),this.readUint8()])}decodeIDAT(e){this._writingDataChunks=!0;const t=e,i=this.offset+this.byteOffset;if(this._inflator.push(new Uint8Array(this.buffer,i,t)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(e)}decodeFDAT(e){this._writingDataChunks=!0;let t=e,i=this.offset+this.byteOffset;if(i+=4,t-=4,this._inflator.push(new Uint8Array(this.buffer,i,t)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(e)}decodetRNS(e){switch(this._colorType){case 0:case 2:if(e%2!=0)throw new RangeError(`tRNS chunk length must be a multiple of 2. Got ${e}`);if(e/2>this._png.width*this._png.height)throw new Error(`tRNS chunk contains more alpha values than there are pixels (${e/2} vs ${this._png.width*this._png.height})`);this._hasTransparency=!0,this._transparency=new Uint16Array(e/2);for(let t=0;t<e/2;t++)this._transparency[t]=this.readUint16();break;case 3:{if(e>this._palette.length)throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${e} vs ${this._palette.length})`);let t=0;for(;t<e;t++){const e=this.readByte();this._palette[t].push(e)}for(;t<this._palette.length;t++)this._palette[t].push(255);break}default:throw new Error(`tRNS chunk is not supported for color type ${this._colorType}`)}}decodeiCCP(e){const t=D(this),i=this.readUint8();if(0!==i)throw new Error(`Unsupported iCCP compression method: ${i}`);const n=this.readBytes(e-t.length-2);this._png.iccEmbeddedProfile={name:t,profile:(0,s.UD)(n)}}decodepHYs(){const e=this.readUint32(),t=this.readUint32(),i=this.readByte();this._png.resolution={x:e,y:t,unit:i}}decodeApngImage(){this._apng.width=this._png.width,this._apng.height=this._png.height,this._apng.channels=this._png.channels,this._apng.depth=this._png.depth,this._apng.numberOfFrames=this._numberOfFrames,this._apng.numberOfPlays=this._numberOfPlays,this._apng.text=this._png.text,this._apng.resolution=this._png.resolution;for(let e=0;e<this._numberOfFrames;e++){const t={sequenceNumber:this._frames[e].sequenceNumber,delayNumber:this._frames[e].delayNumber,delayDenominator:this._frames[e].delayDenominator,data:8===this._apng.depth?new Uint8Array(this._apng.width*this._apng.height*this._apng.channels):new Uint16Array(this._apng.width*this._apng.height*this._apng.channels)},i=this._frames.at(e);if(i){if(i.data=w({data:i.data,width:i.width,height:i.height,channels:this._apng.channels,depth:this._apng.depth}),this._hasPalette&&(this._apng.palette=this._palette),this._hasTransparency&&(this._apng.transparency=this._transparency),0===e||0===i.xOffset&&0===i.yOffset&&i.width===this._png.width&&i.height===this._png.height)t.data=i.data;else{const n=this._apng.frames.at(e-1);this.disposeFrame(i,n,t),this.addFrameDataToCanvas(t,i)}this._apng.frames.push(t)}}return this._apng}disposeFrame(e,t,i){switch(e.disposeOp){case 0:break;case 1:for(let t=0;t<this._png.height;t++)for(let n=0;n<this._png.width;n++){const s=(t*e.width+n)*this._png.channels;for(let e=0;e<this._png.channels;e++)i.data[s+e]=0}break;case 2:i.data.set(t.data);break;default:throw new Error("Unknown disposeOp")}}addFrameDataToCanvas(e,t){const i=1<<this._png.depth,n=(e,i)=>({index:((e+t.yOffset)*this._png.width+t.xOffset+i)*this._png.channels,frameIndex:(e*t.width+i)*this._png.channels});switch(t.blendOp){case 0:for(let i=0;i<t.height;i++)for(let s=0;s<t.width;s++){const{index:r,frameIndex:o}=n(i,s);for(let i=0;i<this._png.channels;i++)e.data[r+i]=t.data[o+i]}break;case 1:for(let s=0;s<t.height;s++)for(let r=0;r<t.width;r++){const{index:o,frameIndex:a}=n(s,r);for(let n=0;n<this._png.channels;n++){const s=t.data[a+this._png.channels-1]/i,r=n%(this._png.channels-1)==0?1:t.data[a+n],l=Math.floor(s*r+(1-s)*e.data[o+n]);e.data[o+n]+=l}}break;default:throw new Error("Unknown blendOp")}}decodeImage(){if(this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);const e=this._isAnimated?(this._frames?.at(0)).data:this._inflator.result;if(0!==this._filterMethod)throw new Error(`Filter method ${this._filterMethod} not supported`);if(0===this._interlaceMethod)this._png.data=w({data:e,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else{if(1!==this._interlaceMethod)throw new Error(`Interlace method ${this._interlaceMethod} not supported`);this._png.data=function(e){const{data:t,width:i,height:n,channels:s,depth:r}=e,o=[{x:0,y:0,xStep:8,yStep:8},{x:4,y:0,xStep:8,yStep:8},{x:0,y:4,xStep:4,yStep:8},{x:2,y:0,xStep:4,yStep:4},{x:0,y:2,xStep:2,yStep:4},{x:1,y:0,xStep:2,yStep:2},{x:0,y:1,xStep:1,yStep:2}],a=Math.ceil(r/8)*s,l=new Uint8Array(n*i*a);let c=0;for(let e=0;e<7;e++){const s=o[e],r=Math.ceil((i-s.x)/s.xStep),h=Math.ceil((n-s.y)/s.yStep);if(r<=0||h<=0)continue;const u=r*a,d=new Uint8Array(u);for(let e=0;e<h;e++){const o=t[c++],h=t.subarray(c,c+u);c+=u;const p=new Uint8Array(u);g(o,h,p,d,u,a),d.set(p);for(let t=0;t<r;t++){const r=s.x+t*s.xStep,o=s.y+e*s.yStep;if(!(r>=i||o>=n))for(let e=0;e<a;e++)l[(o*i+r)*a+e]=p[t*a+e]}}}if(16===r){const e=new Uint16Array(l.buffer);if(m)for(let t=0;t<e.length;t++)e[t]=y(e[t]);return e}return l}({data:e,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth})}this._hasPalette&&(this._png.palette=this._palette),this._hasTransparency&&(this._png.transparency=this._transparency)}pushDataToFrame(){const e=this._inflator.result,t=this._frames.at(-1);t?t.data=e:this._frames.push({sequenceNumber:0,width:this._png.width,height:this._png.height,xOffset:0,yOffset:0,delayNumber:0,delayDenominator:0,disposeOp:0,blendOp:0,data:e}),this._inflator=new s.EL,this._writingDataChunks=!1}}var R;function k(e,t){return new I(e,t).decode()}n.H,function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.METRE=1]="METRE"}(R||(R={}))},32016(e,t,i){"use strict";i.d(t,{$:()=>W,L:()=>Z,_u:()=>Y});var n=Uint8Array,s=Uint16Array,r=Int32Array,o=new n([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a=new n([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),l=new n([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),c=function(e,t){for(var i=new s(31),n=0;n<31;++n)i[n]=t+=1<<e[n-1];var o=new r(i[30]);for(n=1;n<30;++n)for(var a=i[n];a<i[n+1];++a)o[a]=a-i[n]<<5|n;return{b:i,r:o}},h=c(o,2),u=h.b,d=h.r;u[28]=258,d[258]=28;for(var p=c(a,0),g=(p.b,p.r),f=new s(32768),m=0;m<32768;++m){var y=(43690&m)>>1|(21845&m)<<1;y=(61680&(y=(52428&y)>>2|(13107&y)<<2))>>4|(3855&y)<<4,f[m]=((65280&y)>>8|(255&y)<<8)>>1}var v=function(e,t,i){for(var n=e.length,r=0,o=new s(t);r<n;++r)e[r]&&++o[e[r]-1];var a,l=new s(t);for(r=1;r<t;++r)l[r]=l[r-1]+o[r-1]<<1;if(i){a=new s(1<<t);var c=15-t;for(r=0;r<n;++r)if(e[r])for(var h=r<<4|e[r],u=t-e[r],d=l[e[r]-1]++<<u,p=d|(1<<u)-1;d<=p;++d)a[f[d]>>c]=h}else for(a=new s(n),r=0;r<n;++r)e[r]&&(a[r]=f[l[e[r]-1]++]>>15-e[r]);return a},b=new n(288);for(m=0;m<144;++m)b[m]=8;for(m=144;m<256;++m)b[m]=9;for(m=256;m<280;++m)b[m]=7;for(m=280;m<288;++m)b[m]=8;var C=new n(32);for(m=0;m<32;++m)C[m]=5;var w=v(b,9,0),S=v(C,5,0),x=function(e){return(e+7)/8|0},E=function(e,t,i){return(null==t||t<0)&&(t=0),(null==i||i>e.length)&&(i=e.length),new n(e.subarray(t,i))},A=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],M=function(e,t,i){var n=new Error(t||A[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,M),!i)throw n;return n},T=function(e,t,i){i<<=7&t;var n=t/8|0;e[n]|=i,e[n+1]|=i>>8},D=function(e,t,i){i<<=7&t;var n=t/8|0;e[n]|=i,e[n+1]|=i>>8,e[n+2]|=i>>16},I=function(e,t){for(var i=[],r=0;r<e.length;++r)e[r]&&i.push({s:r,f:e[r]});var o=i.length,a=i.slice();if(!o)return{t:O,l:0};if(1==o){var l=new n(i[0].s+1);return l[i[0].s]=1,{t:l,l:1}}i.sort(function(e,t){return e.f-t.f}),i.push({s:-1,f:25001});var c=i[0],h=i[1],u=0,d=1,p=2;for(i[0]={s:-1,f:c.f+h.f,l:c,r:h};d!=o-1;)c=i[i[u].f<i[p].f?u++:p++],h=i[u!=d&&i[u].f<i[p].f?u++:p++],i[d++]={s:-1,f:c.f+h.f,l:c,r:h};var g=a[0].s;for(r=1;r<o;++r)a[r].s>g&&(g=a[r].s);var f=new s(g+1),m=R(i[d-1],f,0);if(m>t){r=0;var y=0,v=m-t,b=1<<v;for(a.sort(function(e,t){return f[t.s]-f[e.s]||e.f-t.f});r<o;++r){var C=a[r].s;if(!(f[C]>t))break;y+=b-(1<<m-f[C]),f[C]=t}for(y>>=v;y>0;){var w=a[r].s;f[w]<t?y-=1<<t-f[w]++-1:++r}for(;r>=0&&y;--r){var S=a[r].s;f[S]==t&&(--f[S],++y)}m=t}return{t:new n(f),l:m}},R=function(e,t,i){return-1==e.s?Math.max(R(e.l,t,i+1),R(e.r,t,i+1)):t[e.s]=i},k=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new s(++t),n=0,r=e[0],o=1,a=function(e){i[n++]=e},l=1;l<=t;++l)if(e[l]==r&&l!=t)++o;else{if(!r&&o>2){for(;o>138;o-=138)a(32754);o>2&&(a(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(a(r),--o;o>6;o-=6)a(8304);o>2&&(a(o-3<<5|8208),o=0)}for(;o--;)a(r);o=1,r=e[l]}return{c:i.subarray(0,n),n:t}},P=function(e,t){for(var i=0,n=0;n<t.length;++n)i+=e[n]*t[n];return i},_=function(e,t,i){var n=i.length,s=x(t+2);e[s]=255&n,e[s+1]=n>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var r=0;r<n;++r)e[s+r+4]=i[r];return 8*(s+4+n)},L=function(e,t,i,n,r,c,h,u,d,p,g){T(t,g++,i),++r[256];for(var f=I(r,15),m=f.t,y=f.l,x=I(c,15),E=x.t,A=x.l,M=k(m),R=M.c,L=M.n,N=k(E),O=N.c,F=N.n,G=new s(19),B=0;B<R.length;++B)++G[31&R[B]];for(B=0;B<O.length;++B)++G[31&O[B]];for(var V=I(G,7),H=V.t,U=V.l,z=19;z>4&&!H[l[z-1]];--z);var W,j,$,K,Y=p+5<<3,q=P(r,b)+P(c,C)+h,X=P(r,m)+P(c,E)+h+14+3*z+P(G,H)+2*G[16]+3*G[17]+7*G[18];if(d>=0&&Y<=q&&Y<=X)return _(t,g,e.subarray(d,d+p));if(T(t,g,1+(X<q)),g+=2,X<q){W=v(m,y,0),j=m,$=v(E,A,0),K=E;var Z=v(H,U,0);for(T(t,g,L-257),T(t,g+5,F-1),T(t,g+10,z-4),g+=14,B=0;B<z;++B)T(t,g+3*B,H[l[B]]);g+=3*z;for(var Q=[R,O],J=0;J<2;++J){var ee=Q[J];for(B=0;B<ee.length;++B){var te=31&ee[B];T(t,g,Z[te]),g+=H[te],te>15&&(T(t,g,ee[B]>>5&127),g+=ee[B]>>12)}}}else W=w,j=b,$=S,K=C;for(B=0;B<u;++B){var ie=n[B];if(ie>255){D(t,g,W[257+(te=ie>>18&31)]),g+=j[te+257],te>7&&(T(t,g,ie>>23&31),g+=o[te]);var ne=31&ie;D(t,g,$[ne]),g+=K[ne],ne>3&&(D(t,g,ie>>5&8191),g+=a[ne])}else D(t,g,W[ie]),g+=j[ie]}return D(t,g,W[256]),g+j[256]},N=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),O=new n(0),F=function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var i=t,n=9;--n;)i=(1&i&&-306674912)^i>>>1;e[t]=i}return e}(),G=function(){var e=-1;return{p:function(t){for(var i=e,n=0;n<t.length;++n)i=F[255&i^t[n]]^i>>>8;e=i},d:function(){return~e}}},B=function(){var e=1,t=0;return{p:function(i){for(var n=e,s=t,r=0|i.length,o=0;o!=r;){for(var a=Math.min(o+2655,r);o<a;++o)s+=n+=i[o];n=(65535&n)+15*(n>>16),s=(65535&s)+15*(s>>16)}e=n,t=s},d:function(){return(255&(e%=65521))<<24|(65280&e)<<8|(255&(t%=65521))<<8|t>>8}}},V=function(e,t,i,l,c){if(!c&&(c={l:1},t.dictionary)){var h=t.dictionary.subarray(-32768),u=new n(h.length+e.length);u.set(h),u.set(e,h.length),e=u,c.w=h.length}return function(e,t,i,l,c,h){var u=h.z||e.length,p=new n(l+u+5*(1+Math.ceil(u/7e3))+c),f=p.subarray(l,p.length-c),m=h.l,y=7&(h.r||0);if(t){y&&(f[0]=h.r>>3);for(var v=N[t-1],b=v>>13,C=8191&v,w=(1<<i)-1,S=h.p||new s(32768),A=h.h||new s(w+1),M=Math.ceil(i/3),T=2*M,D=function(t){return(e[t]^e[t+1]<<M^e[t+2]<<T)&w},I=new r(25e3),R=new s(288),k=new s(32),P=0,O=0,F=h.i||0,G=0,B=h.w||0,V=0;F+2<u;++F){var H=D(F),U=32767&F,z=A[H];if(S[U]=z,A[H]=U,B<=F){var W=u-F;if((P>7e3||G>24576)&&(W>423||!m)){y=L(e,f,0,I,R,k,O,G,V,F-V,y),G=P=O=0,V=F;for(var j=0;j<286;++j)R[j]=0;for(j=0;j<30;++j)k[j]=0}var $=2,K=0,Y=C,q=U-z&32767;if(W>2&&H==D(F-q))for(var X=Math.min(b,W)-1,Z=Math.min(32767,F),Q=Math.min(258,W);q<=Z&&--Y&&U!=z;){if(e[F+$]==e[F+$-q]){for(var J=0;J<Q&&e[F+J]==e[F+J-q];++J);if(J>$){if($=J,K=q,J>X)break;var ee=Math.min(q,J-2),te=0;for(j=0;j<ee;++j){var ie=F-q+j&32767,ne=ie-S[ie]&32767;ne>te&&(te=ne,z=ie)}}}q+=(U=z)-(z=S[U])&32767}if(K){I[G++]=268435456|d[$]<<18|g[K];var se=31&d[$],re=31&g[K];O+=o[se]+a[re],++R[257+se],++k[re],B=F+$,++P}else I[G++]=e[F],++R[e[F]]}}for(F=Math.max(F,B);F<u;++F)I[G++]=e[F],++R[e[F]];y=L(e,f,m,I,R,k,O,G,V,F-V,y),m||(h.r=7&y|f[y/8|0]<<3,y-=7,h.h=A,h.p=S,h.i=F,h.w=B)}else{for(F=h.w||0;F<u+m;F+=65535){var oe=F+65535;oe>=u&&(f[y/8|0]=m,oe=u),y=_(f,y+1,e.subarray(F,oe))}h.i=u}return E(p,0,l+x(y)+c)}(e,null==t.level?6:t.level,null==t.mem?c.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):20:12+t.mem,i,l,c)},H=function(e,t){var i={};for(var n in e)i[n]=e[n];for(var n in t)i[n]=t[n];return i},U=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8};function z(e,t){return V(e,t||{},0,0)}function W(e,t){t||(t={});var i=B();i.p(e);var n=V(e,t,t.dictionary?6:2,4);return function(e,t){var i=t.level,n=0==i?0:i<6?1:9==i?3:2;if(e[0]=120,e[1]=n<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){var s=B();s.p(t.dictionary),U(e,2,s.d())}}(n,t),U(n,n.length-4,i.d()),n}var j=function(e,t,i,s){for(var r in e){var o=e[r],a=t+r,l=s;Array.isArray(o)&&(l=H(s,o[1]),o=o[0]),o instanceof n?i[a]=[o,l]:(i[a+="/"]=[new n(0),l],j(o,a,i,s))}},$="undefined"!=typeof TextEncoder&&new TextEncoder,K="undefined"!=typeof TextDecoder&&new TextDecoder;try{K.decode(O,{stream:!0})}catch(e){}function Y(e,t){if(t){for(var i=new n(e.length),s=0;s<e.length;++s)i[s]=e.charCodeAt(s);return i}if($)return $.encode(e);var r=e.length,o=new n(e.length+(e.length>>1)),a=0,l=function(e){o[a++]=e};for(s=0;s<r;++s){if(a+5>o.length){var c=new n(a+8+(r-s<<1));c.set(o),o=c}var h=e.charCodeAt(s);h<128||t?l(h):h<2048?(l(192|h>>6),l(128|63&h)):h>55295&&h<57344?(l(240|(h=65536+(1047552&h)|1023&e.charCodeAt(++s))>>18),l(128|h>>12&63),l(128|h>>6&63),l(128|63&h)):(l(224|h>>12),l(128|h>>6&63),l(128|63&h))}return E(o,0,a)}var q=function(e){var t=0;if(e)for(var i in e){var n=e[i].length;n>65535&&M(9),t+=n+4}return t},X=function(e,t,i,n,s,r,o,a){var l=n.length,c=i.extra,h=a&&a.length,u=q(c);U(e,t,null!=o?33639248:67324752),t+=4,null!=o&&(e[t++]=20,e[t++]=i.os),e[t]=20,t+=2,e[t++]=i.flag<<1|(r<0&&8),e[t++]=s&&8,e[t++]=255&i.compression,e[t++]=i.compression>>8;var d=new Date(null==i.mtime?Date.now():i.mtime),p=d.getFullYear()-1980;if((p<0||p>119)&&M(10),U(e,t,p<<25|d.getMonth()+1<<21|d.getDate()<<16|d.getHours()<<11|d.getMinutes()<<5|d.getSeconds()>>1),t+=4,-1!=r&&(U(e,t,i.crc),U(e,t+4,r<0?-r-2:r),U(e,t+8,i.size)),U(e,t+12,l),U(e,t+14,u),t+=16,null!=o&&(U(e,t,h),U(e,t+6,i.attrs),U(e,t+10,o),t+=14),e.set(n,t),t+=l,u)for(var g in c){var f=c[g],m=f.length;U(e,t,+g),U(e,t+2,m),e.set(f,t+4),t+=4+m}return h&&(e.set(a,t),t+=h),t};function Z(e,t){t||(t={});var i={},s=[];j(e,"",i,t);var r=0,o=0;for(var a in i){var l=i[a],c=l[0],h=l[1],u=0==h.level?0:8,d=(E=Y(a)).length,p=h.comment,g=p&&Y(p),f=g&&g.length,m=q(h.extra);d>65535&&M(11);var y=u?z(c,h):c,v=y.length,b=G();b.p(c),s.push(H(h,{size:c.length,crc:b.d(),c:y,f:E,m:g,u:d!=a.length||g&&p.length!=f,o:r,compression:u})),r+=30+d+m+v,o+=76+2*(d+m)+(f||0)+v}for(var C=new n(o+22),w=r,S=o-r,x=0;x<s.length;++x){var E=s[x];X(C,E.o,E,E.f,E.u,E.c.length);var A=30+E.f.length+q(E.extra);C.set(E.c,E.o+A),X(C,r,E,E.f,E.u,E.c.length,E.o,E.m),r+=16+A+(E.m?E.m.length:0)}return function(e,t,i,n,s){U(e,t,101010256),U(e,t+8,i),U(e,t+10,i),U(e,t+12,n),U(e,t+16,s)}(C,r,s.length,S,w),C}"function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout&&setTimeout},21702(e){"use strict";e.exports=function(e,t){for(var i={},n=Object.keys(e),s=Array.isArray(t),r=0;r<n.length;r++){var o=n[r],a=e[o];(s?-1!==t.indexOf(o):t(o,a,e))&&(i[o]=a)}return i}},87196(e,t,i){"use strict";var n=i(22956),s=Object.prototype.toString,r=Object.prototype.hasOwnProperty;e.exports=function(e,t,i){if(!n(t))throw new TypeError("iterator must be a function");var o,a;arguments.length>=3&&(o=i),a=e,"[object Array]"===s.call(a)?function(e,t,i){for(var n=0,s=e.length;n<s;n++)r.call(e,n)&&(null==i?t(e[n],n,e):t.call(i,e[n],n,e))}(e,t,o):"string"==typeof e?function(e,t,i){for(var n=0,s=e.length;n<s;n++)null==i?t(e.charAt(n),n,e):t.call(i,e.charAt(n),n,e)}(e,t,o):function(e,t,i){for(var n in e)r.call(e,n)&&(null==i?t(e[n],n,e):t.call(i,e[n],n,e))}(e,t,o)}},1987(e){!function(){var t;function i(e){for(var t,i,n,s,r=1,o=[].slice.call(arguments),a=0,l=e.length,c="",h=!1,u=!1,d=function(){return o[r++]},p=function(){for(var i="";/\d/.test(e[a]);)i+=e[a++],t=e[a];return i.length>0?parseInt(i):null};a<l;++a)if(t=e[a],h)switch(h=!1,"."==t?(u=!1,t=e[++a]):"0"==t&&"."==e[a+1]?(u=!0,t=e[a+=2]):u=!0,s=p(),t){case"b":c+=parseInt(d(),10).toString(2);break;case"c":c+="string"==typeof(i=d())||i instanceof String?i:String.fromCharCode(parseInt(i,10));break;case"d":c+=parseInt(d(),10);break;case"f":n=String(parseFloat(d()).toFixed(s||6)),c+=u?n:n.replace(/^0/,"");break;case"j":c+=JSON.stringify(d());break;case"o":c+="0"+parseInt(d(),10).toString(8);break;case"s":c+=d();break;case"x":c+="0x"+parseInt(d(),10).toString(16);break;case"X":c+="0x"+parseInt(d(),10).toString(16).toUpperCase();break;default:c+=t}else"%"===t?h=!0:c+=t;return c}(t=e.exports=i).format=i,t.vsprintf=function(e,t){return i.apply(null,[e].concat(t))},"undefined"!=typeof console&&"function"==typeof console.log&&(t.printf=function(){console.log(i.apply(null,arguments))})}()},69992(e){"use strict";var t=Object.prototype.toString,i=Math.max,n=function(e,t){for(var i=[],n=0;n<e.length;n+=1)i[n]=e[n];for(var s=0;s<t.length;s+=1)i[s+e.length]=t[s];return i};e.exports=function(e){var s=this;if("function"!=typeof s||"[object Function]"!==t.apply(s))throw new TypeError("Function.prototype.bind called on incompatible "+s);for(var r,o=function(e){for(var t=[],i=1,n=0;i<e.length;i+=1,n+=1)t[n]=e[i];return t}(arguments),a=i(0,s.length-o.length),l=[],c=0;c<a;c++)l[c]="$"+c;if(r=Function("binder","return function ("+function(e){for(var t="",i=0;i<e.length;i+=1)t+=e[i],i+1<e.length&&(t+=",");return t}(l)+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof r){var t=s.apply(this,n(o,arguments));return Object(t)===t?t:this}return s.apply(e,n(o,arguments))}),s.prototype){var h=function(){};h.prototype=s.prototype,r.prototype=new h,h.prototype=null}return r}},79524(e,t,i){"use strict";var n=i(69992);e.exports=Function.prototype.bind||n},18910(e,t,i){e.exports=i(21923)},21923(e,t,i){var n,s,r=i(24215),o=function(){(void 0===n||n>=s.length)&&(n=0,s=r.randomBytes(256));var e=s[n];return n+=1,e},a=function(e){for(var t=o();t>=256-256%e;)t=o();return t%e},l=/[ilLI|`oO0]/g,c=[{name:"lowercase",rule:/[a-z]/},{name:"uppercase",rule:/[A-Z]/},{name:"numbers",rule:/[0-9]/},{name:"symbols",rule:/[!@#$%^&*()+_\-=}{[\]|:;"/?.><,`~]/}],h=function(e,t){for(var i="",n=e.length,s=t.length,r=0;r<n;r++)i+=t[a(s)];return e.strict&&!c.every(function(t){return 0==e[t.name]||("symbols"===t.name&&"string"==typeof e[t.name]?new RegExp("["+e[t.name]+"]").test(i):t.rule.test(i))})?h(e,t):i};e.exports.generate=function(e){if(e=e||{},Object.prototype.hasOwnProperty.call(e,"length")||(e.length=10),Object.prototype.hasOwnProperty.call(e,"numbers")||(e.numbers=!1),Object.prototype.hasOwnProperty.call(e,"symbols")||(e.symbols=!1),Object.prototype.hasOwnProperty.call(e,"exclude")||(e.exclude=""),Object.prototype.hasOwnProperty.call(e,"uppercase")||(e.uppercase=!0),Object.prototype.hasOwnProperty.call(e,"lowercase")||(e.lowercase=!0),Object.prototype.hasOwnProperty.call(e,"excludeSimilarCharacters")||(e.excludeSimilarCharacters=!1),Object.prototype.hasOwnProperty.call(e,"strict")||(e.strict=!1),e.strict&&1+(e.numbers?1:0)+(e.symbols?1:0)+(e.uppercase?1:0)>e.length)throw new TypeError("Length must correlate with strict guidelines");var t="";if(e.lowercase&&(t+="abcdefghijklmnopqrstuvwxyz"),e.uppercase&&(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),e.numbers&&(t+="0123456789"),e.symbols&&("string"==typeof e.symbols?t+=e.symbols:t+='!@#$%^&*()+_-=}{[]|:;"/?.><,`~'),!t)throw new TypeError("At least one rule for pools must be true");e.excludeSimilarCharacters&&(t=t.replace(l,""));for(var i=e.exclude.length;i--;)t=t.replace(e.exclude[i],"");return h(e,t)},e.exports.generateMultiple=function(t,i){for(var n=[],s=0;s<t;s++)n[s]=e.exports.generate(i);return n}},49336(e,t,i){"use strict";var n,s=i(25153),r=i(41488),o=i(38004),a=i(96469),l=i(12557),c=i(63429),h=i(71102),u=i(85966),d=i(77412),p=i(52418),g=i(57958),f=i(47384),m=i(250),y=i(51844),v=i(47279),b=Function,C=function(e){try{return b('"use strict"; return ('+e+").constructor;")()}catch(e){}},w=i(25667),S=i(39886),x=function(){throw new h},E=w?function(){try{return x}catch(e){try{return w(arguments,"callee").get}catch(e){return x}}}():x,A=i(21514)(),M=i(14252),T=i(23752),D=i(60248),I=i(64811),R=i(46255),k={},P="undefined"!=typeof Uint8Array&&M?M(Uint8Array):n,_={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":A&&M?M([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":k,"%AsyncGenerator%":k,"%AsyncGeneratorFunction%":k,"%AsyncIteratorPrototype%":k,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":r,"%eval%":eval,"%EvalError%":o,"%Float16Array%":"undefined"==typeof Float16Array?n:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":b,"%GeneratorFunction%":k,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":A&&M?M(M([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&A&&M?M((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":s,"%Object.getOwnPropertyDescriptor%":w,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":a,"%ReferenceError%":l,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&A&&M?M((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":A&&M?M(""[Symbol.iterator]()):n,"%Symbol%":A?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":E,"%TypedArray%":P,"%TypeError%":h,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":u,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet,"%Function.prototype.call%":R,"%Function.prototype.apply%":I,"%Object.defineProperty%":S,"%Object.getPrototypeOf%":T,"%Math.abs%":d,"%Math.floor%":p,"%Math.max%":g,"%Math.min%":f,"%Math.pow%":m,"%Math.round%":y,"%Math.sign%":v,"%Reflect.getPrototypeOf%":D};if(M)try{null.error}catch(e){var L=M(M(e));_["%Error.prototype%"]=L}var N=function e(t){var i;if("%AsyncFunction%"===t)i=C("async function () {}");else if("%GeneratorFunction%"===t)i=C("function* () {}");else if("%AsyncGeneratorFunction%"===t)i=C("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(i=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var s=e("%AsyncGenerator%");s&&M&&(i=M(s.prototype))}return _[t]=i,i},O={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},F=i(79524),G=i(75630),B=F.call(R,Array.prototype.concat),V=F.call(I,Array.prototype.splice),H=F.call(R,String.prototype.replace),U=F.call(R,String.prototype.slice),z=F.call(R,RegExp.prototype.exec),W=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,j=/\\(\\)?/g,$=function(e,t){var i,n=e;if(G(O,n)&&(n="%"+(i=O[n])[0]+"%"),G(_,n)){var s=_[n];if(s===k&&(s=N(n)),void 0===s&&!t)throw new h("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new c("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new h("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new h('"allowMissing" argument must be a boolean');if(null===z(/^%?[^%]*%?$/,e))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=function(e){var t=U(e,0,1),i=U(e,-1);if("%"===t&&"%"!==i)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===i&&"%"!==t)throw new c("invalid intrinsic syntax, expected opening `%`");var n=[];return H(e,W,function(e,t,i,s){n[n.length]=i?H(s,j,"$1"):t||e}),n}(e),n=i.length>0?i[0]:"",s=$("%"+n+"%",t),r=s.name,o=s.value,a=!1,l=s.alias;l&&(n=l[0],V(i,B([0,1],l)));for(var u=1,d=!0;u<i.length;u+=1){var p=i[u],g=U(p,0,1),f=U(p,-1);if(('"'===g||"'"===g||"`"===g||'"'===f||"'"===f||"`"===f)&&g!==f)throw new c("property names with quotes must have matching quotes");if("constructor"!==p&&d||(a=!0),G(_,r="%"+(n+="."+p)+"%"))o=_[r];else if(null!=o){if(!(p in o)){if(!t)throw new h("base intrinsic for "+e+" exists, but the property is not available.");return}if(w&&u+1>=i.length){var m=w(o,p);o=(d=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:o[p]}else d=G(o,p),o=o[p];d&&!a&&(_[r]=o)}}return o}},13e3(e,t,i){"use strict";i.d(t,{m:()=>n});var n=function(){return i.nc}},23752(e,t,i){"use strict";var n=i(25153);e.exports=n.getPrototypeOf||null},60248(e){"use strict";e.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},14252(e,t,i){"use strict";var n=i(60248),s=i(23752),r=i(57678);e.exports=n?function(e){return n(e)}:s?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("getProto: not an object");return s(e)}:r?function(e){return r(e)}:null},51333(e){"use strict";e.exports=Object.getOwnPropertyDescriptor},25667(e,t,i){"use strict";var n=i(51333);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},66105(e,t,i){"use strict";i.r(t)},12628(e,t,i){"use strict";i.r(t)},91037(e,t,i){"use strict";i.r(t)},44898(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},24737(e,t,i){var n=i(41930).default;function s(t,i){if("function"==typeof WeakMap)var r=new WeakMap,o=new WeakMap;return(e.exports=s=function(e,t){if(!t&&e&&e.__esModule)return e;var i,s,a={__proto__:null,default:e};if(null===e||"object"!=n(e)&&"function"!=typeof e)return a;if(i=t?o:r){if(i.has(e))return i.get(e);i.set(e,a)}for(var l in e)"default"!==l&&{}.hasOwnProperty.call(e,l)&&((s=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,l))&&(s.get||s.set)?i(a,l,s):a[l]=e[l]);return a},e.exports.__esModule=!0,e.exports.default=e.exports)(t,i)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports},41930(e){function t(i){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(i)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},57506(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CompositeRootContext=void 0,t.useCompositeRootContext=function(e=!1){const t=n.useContext(r);if(void 0===t&&!e)throw new Error("Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.");return t};var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=s(t);if(i&&i.has(e))return i.get(e);var n={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=r?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,i&&i.set(e,n),n}(i(22155));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(s=function(e){return e?i:t})(e)}const r=t.CompositeRootContext=n.createContext(void 0)},53079(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DirectionContext=void 0,t.useDirection=function(e=!0){const t=n.useContext(r);if(void 0===t&&!e)throw new Error("Base UI: DirectionContext is missing.");return t?.direction??"ltr"};var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=s(t);if(i&&i.has(e))return i.get(e);var n={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=r?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,i&&i.set(e,n),n}(i(22155));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(s=function(e){return e?i:t})(e)}const r=t.DirectionContext=n.createContext(void 0)},80725(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(19571);Object.keys(n).forEach(function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===n[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return n[e]}}))})},19571(e,t){"use strict";function i(e,t){return s(e)?e(t):e??{}}function n(e,t){return t?e?Object.entries(t).reduce((t,[i,n])=>{var s,o,a,l;return function(e,t){const i=e.charCodeAt(2);return"o"===e[0]&&"n"===e[1]&&i>=65&&i<=90&&"function"==typeof t}(i,n)?t[i]=(s=e[i],o=n,e=>{if(function(e){return null!=e&&"object"==typeof e&&"nativeEvent"in e}(e)){const t=e;r(t);const i=o(t);return t.baseUIHandlerPrevented||s?.(t),i}const t=o(e);return s?.(e),t}):t[i]="style"===i?function(e,t){if(t||e)return{...e,...t}}(e.style,n):"className"===i?(a=e.className,(l=n)?a?l+" "+a:l:a):n,t},{...e}):t:e||{}}function s(e){return"function"==typeof e}function r(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}Object.defineProperty(t,"__esModule",{value:!0}),t.makeEventPreventable=r,t.mergeProps=function(...e){if(0===e.length)return{};if(1===e.length)return i(e[0],{});let t=i(e[0],{});for(let i=1;i<e.length;i+=1){const r=e[i];r&&(t=s(r)?r(t):n(t,r))}return t??{}}},85607(e,t,i){"use strict";var n=i(44898);Object.defineProperty(t,"__esModule",{value:!0}),t.PopoverArrow=void 0;var s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=c(t);if(i&&i.has(e))return i.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var o=s?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}return n.default=e,i&&i.set(e,n),n}(i(22155)),r=(n(i(5821)),i(14434)),o=i(4706),a=i(72204),l=i(13214);function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(c=function(e){return e?i:t})(e)}t.PopoverArrow=s.forwardRef(function(e,t){const{className:i,render:n,...c}=e,{open:h}=(0,o.usePopoverRootContext)(),{arrowRef:u,side:d,align:p,arrowUncentered:g,arrowStyles:f}=(0,r.usePopoverPositionerContext)(),m=s.useMemo(()=>({open:h,side:d,align:p,uncentered:g}),[h,d,p,g]);return(0,l.useRenderElement)("div",e,{state:m,ref:[t,u],props:[{style:f,"aria-hidden":!0},c],customStyleHookMapping:a.popupStateMapping})()})},30509(e,t,i){"use strict";var n=i(44898);Object.defineProperty(t,"__esModule",{value:!0}),t.PopoverBackdrop=void 0;var s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=c(t);if(i&&i.has(e))return i.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var o=s?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}return n.default=e,i&&i.set(e,n),n}(i(22155)),r=(n(i(5821)),i(4706)),o=i(72204),a=i(60687),l=i(13214);function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(c=function(e){return e?i:t})(e)}const h={...o.popupStateMapping,...a.transitionStatusMapping};t.PopoverBackdrop=s.forwardRef(function(e,t){const{className:i,render:n,...o}=e,{open:a,mounted:c,transitionStatus:u,openReason:d}=(0,r.usePopoverRootContext)(),p=s.useMemo(()=>({open:a,transitionStatus:u}),[a,u]);return(0,l.useRenderElement)("div",e,{state:p,ref:t,props:[{role:"presentation",hidden:!c,style:{pointerEvents:"hover"===d?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},o],customStyleHookMapping:h})()})},89101(e,t,i){"use strict";var n=i(44898);Object.defineProperty(t,"__esModule",{value:!0}),t.PopoverClose=void 0;var s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=a(t);if(i&&i.has(e))return i.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var o=s?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}return n.default=e,i&&i.set(e,n),n}(i(22155)),r=(n(i(5821)),i(4706)),o=i(13214);function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(a=function(e){return e?i:t})(e)}t.PopoverClose=s.forwardRef(function(e,t){const{render:i,className:n,...s}=e,{setOpen:a}=(0,r.usePopoverRootContext)();return(0,o.useRenderElement)("button",e,{ref:t,props:[{onClick(){a(!1,void 0,void 0)}},s]})()})},36253(e,t,i){"use strict";var n=i(44898);Object.defineProperty(t,"__esModule",{value:!0}),t.PopoverDescription=void 0;var s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=c(t);if(i&&i.has(e))return i.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var o=s?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}return n.default=e,i&&i.set(e,n),n}(i(22155)),r=(n(i(5821)),i(4706)),o=i(26111),a=i(322),l=i(13214);function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(c=function(e){return e?i:t})(e)}t.PopoverDescription=s.forwardRef(function(e,t){const{render:i,className:n,...s}=e,{setDescriptionId:c}=(0,r.usePopoverRootContext)(),h=(0,a.useBaseUiId)(s.id);return(0,o.useEnhancedEffect)(()=>(c(h),()=>{c(void 0)}),[c,h]),(0,l.useRenderElement)("p",e,{ref:t,props:[{id:h},s]})()})},17051(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Popover=void 0;var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=s(t);if(i&&i.has(e))return i.get(e);var n={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=r?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,i&&i.set(e,n),n}(i(41507));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(s=function(e){return e?i:t})(e)}t.Popover=n},41507(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Arrow",{enumerable:!0,get:function(){return l.PopoverArrow}}),Object.defineProperty(t,"Backdrop",{enumerable:!0,get:function(){return c.PopoverBackdrop}}),Object.defineProperty(t,"Close",{enumerable:!0,get:function(){return d.PopoverClose}}),Object.defineProperty(t,"Description",{enumerable:!0,get:function(){return u.PopoverDescription}}),Object.defineProperty(t,"Popup",{enumerable:!0,get:function(){return a.PopoverPopup}}),Object.defineProperty(t,"Portal",{enumerable:!0,get:function(){return r.PopoverPortal}}),Object.defineProperty(t,"Positioner",{enumerable:!0,get:function(){return o.PopoverPositioner}}),Object.defineProperty(t,"Root",{enumerable:!0,get:function(){return n.PopoverRoot}}),Object.defineProperty(t,"Title",{enumerable:!0,get:function(){return h.PopoverTitle}}),Object.defineProperty(t,"Trigger",{enumerable:!0,get:function(){return s.PopoverTrigger}});var n=i(1881),s=i(4905),r=i(12309),o=i(53049),a=i(97069),l=i(85607),c=i(30509),h=i(63317),u=i(36253),d=i(89101)},97069(e,t,i){"use strict";var n=i(44898);Object.defineProperty(t,"__esModule",{value:!0}),t.PopoverPopup=void 0;var s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=g(t);if(i&&i.has(e))return i.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var o=s?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}return n.default=e,i&&i.set(e,n),n}(i(22155)),r=(n(i(5821)),i(62420)),o=i(4706),a=i(14434),l=i(66476),c=i(72204),h=(i(10389),i(60687)),u=i(65635),d=i(13214),p=i(65723);function g(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(g=function(e){return e?i:t})(e)}const f={...c.popupStateMapping,...h.transitionStatusMapping};t.PopoverPopup=s.forwardRef(function(e,t){const{className:i,render:n,initialFocus:c,finalFocus:h,...g}=e,{open:m,instantType:y,transitionStatus:v,getPopupProps:b,titleId:C,descriptionId:w,popupRef:S,mounted:x,openReason:E,onOpenChangeComplete:A,modal:M}=(0,o.usePopoverRootContext)(),T=(0,a.usePopoverPositionerContext)();(0,u.useOpenChangeComplete)({open:m,ref:S,onComplete(){m&&A?.(!0)}});const{props:D,resolvedInitialFocus:I}=(0,l.usePopoverPopup)({titleId:C,descriptionId:w,initialFocus:c}),R=s.useMemo(()=>({open:m,side:T.side,align:T.align,instant:y,transitionStatus:v}),[m,T.side,T.align,y,v]),k=(0,d.useRenderElement)("div",e,{state:R,ref:[t,S],props:[D,b,{style:"starting"===v?{transition:"none"}:{}},g],customStyleHookMapping:f});return(0,p.jsx)(r.FloatingFocusManager,{context:T.context,modal:"trap-focus"===M,disabled:!x||"hover"===E,initialFocus:I,returnFocus:h,children:k()})})},66476(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.usePopoverPopup=function(e){const{titleId:t,descriptionId:i,initialFocus:r}=e,{popupRef:o,openMethod:a}=(0,s.usePopoverRootContext)(),l=n.useMemo(()=>({"aria-labelledby":t,"aria-describedby":i}),[t,i]),c=n.useCallback(e=>"touch"===e?o:0,[o]),h=n.useMemo(()=>null==r?c(a??""):"function"==typeof r?r(a??""):r,[c,r,a]);return n.useMemo(()=>({props:l,resolvedInitialFocus:h}),[l,h])};var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=r(t);if(i&&i.has(e))return i.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=s?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,i&&i.set(e,n),n}(i(22155)),s=i(4706);function r(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(r=function(e){return e?i:t})(e)}},12309(e,t,i){"use strict";var n=i(44898);Object.defineProperty(t,"__esModule",{value:!0}),t.PopoverPortal=function(e){const{children:t,keepMounted:i=!1,container:n}=e,{mounted:l}=(0,r.usePopoverRootContext)();return l||i?(0,a.jsx)(o.PopoverPortalContext.Provider,{value:i,children:(0,a.jsx)(s.FloatingPortal,{root:n,children:t})}):null},function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=l(t);if(i&&i.has(e))return i.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var o=s?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}n.default=e,i&&i.set(e,n)}(i(22155)),n(i(5821));var s=i(62420),r=i(4706),o=(i(10389),i(53486)),a=i(65723);function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(l=function(e){return e?i:t})(e)}},53486(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PopoverPortalContext=void 0,t.usePopoverPortalContext=function(){const e=n.useContext(r);if(void 0===e)throw new Error("Base UI: <Popover.Portal> is missing.");return e};var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=s(t);if(i&&i.has(e))return i.get(e);var n={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=r?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,i&&i.set(e,n),n}(i(22155));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(s=function(e){return e?i:t})(e)}const r=t.PopoverPortalContext=n.createContext(void 0)},53049(e,t,i){"use strict";var n=i(44898);Object.defineProperty(t,"__esModule",{value:!0}),t.PopoverPositioner=void 0;var s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=g(t);if(i&&i.has(e))return i.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var o=s?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}return n.default=e,i&&i.set(e,n),n}(i(22155)),r=(n(i(5821)),i(4706)),o=i(35938),a=i(14434),l=i(72204),c=(i(10389),i(53486)),h=i(52454),u=i(42468),d=i(13214),p=i(65723);function g(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(g=function(e){return e?i:t})(e)}t.PopoverPositioner=s.forwardRef(function(e,t){const{render:i,className:n,anchor:g,positionMethod:f="absolute",side:m="bottom",align:y="center",sideOffset:v=0,alignOffset:b=0,collisionBoundary:C="clipping-ancestors",collisionPadding:w=5,arrowPadding:S=5,sticky:x=!1,trackAnchor:E=!0,...A}=e,{floatingRootContext:M,open:T,mounted:D,setPositionerElement:I,modal:R,openReason:k,openMethod:P}=(0,r.usePopoverRootContext)(),_=(0,c.usePopoverPortalContext)(),L=(0,o.usePopoverPositioner)({anchor:g,floatingRootContext:M,positionMethod:f,mounted:D,open:T,side:m,sideOffset:v,align:y,alignOffset:b,arrowPadding:S,collisionBoundary:C,collisionPadding:w,sticky:x,trackAnchor:E,keepMounted:_}),N=s.useMemo(()=>({open:T,side:L.side,align:L.align,anchorHidden:L.anchorHidden}),[T,L.side,L.align,L.anchorHidden]),O=(0,d.useRenderElement)("div",e,{state:N,props:[L.props,A],ref:[t,I],customStyleHookMapping:l.popupStateMapping});return(0,p.jsxs)(a.PopoverPositionerContext.Provider,{value:L,children:[D&&!0===R&&"hover"!==k&&"touch"!==P&&(0,p.jsx)(u.InternalBackdrop,{inert:(0,h.inertValue)(!T)}),O()]})})},14434(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PopoverPositionerContext=void 0,t.usePopoverPositionerContext=function(){const e=n.useContext(r);if(void 0===e)throw new Error("Base UI: PopoverPositionerContext is missing. PopoverPositioner parts must be placed within <Popover.Positioner>.");return e};var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=s(t);if(i&&i.has(e))return i.get(e);var n={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=r?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,i&&i.set(e,n),n}(i(22155));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(s=function(e){return e?i:t})(e)}const r=t.PopoverPositionerContext=n.createContext(void 0)},35938(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.usePopoverPositioner=function(e){const{open:t,mounted:i}=(0,r.usePopoverRootContext)(),o=(0,s.useAnchorPositioning)(e),a=n.useMemo(()=>{const e={};return t||(e.pointerEvents="none"),{role:"presentation",hidden:!i,style:{...o.positionerStyles,...e}}},[t,i,o.positionerStyles]);return n.useMemo(()=>({props:a,...o}),[a,o])};var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=o(t);if(i&&i.has(e))return i.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var a=s?Object.getOwnPropertyDescriptor(e,r):null;a&&(a.get||a.set)?Object.defineProperty(n,r,a):n[r]=e[r]}return n.default=e,i&&i.set(e,n),n}(i(22155)),s=i(54540),r=i(4706);function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(o=function(e){return e?i:t})(e)}},1881(e,t,i){"use strict";var n=i(44898);Object.defineProperty(t,"__esModule",{value:!0}),t.PopoverRoot=void 0;var s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=c(t);if(i&&i.has(e))return i.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var o=s?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}return n.default=e,i&&i.set(e,n),n}(i(22155)),r=(n(i(5821)),i(4706)),o=i(33890),a=i(81324),l=i(65723);function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(c=function(e){return e?i:t})(e)}t.PopoverRoot=function(e){const{defaultOpen:t=!1,onOpenChange:i,open:n,openOnHover:c=!1,delay:h,closeDelay:u=0,actionsRef:d,onOpenChangeComplete:p,modal:g=!1}=e,f=h??a.OPEN_DELAY,m=(0,o.usePopoverRoot)({...e,defaultOpen:t,onOpenChange:i,open:n,openOnHover:c,onOpenChangeComplete:p,delay:f,closeDelay:u,actionsRef:d,modal:g}),y=s.useMemo(()=>({...m,openOnHover:c,delay:f,closeDelay:u,modal:g}),[m,c,f,u,g]);return(0,l.jsx)(r.PopoverRootContext.Provider,{value:y,children:e.children})}},4706(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PopoverRootContext=void 0,t.usePopoverRootContext=function(){const e=n.useContext(r);if(void 0===e)throw new Error("Base UI: PopoverRootContext is missing. Popover parts must be placed within <Popover.Root>.");return e};var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=s(t);if(i&&i.has(e))return i.get(e);var n={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=r?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,i&&i.set(e,n),n}(i(22155));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(s=function(e){return e?i:t})(e)}const r=t.PopoverRootContext=n.createContext(void 0)},33890(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.usePopoverRoot=function(e){const{open:t,onOpenChange:i,defaultOpen:m=!1,delay:y,closeDelay:v,openOnHover:b=!1,onOpenChangeComplete:C,modal:w}=e,S=y??c.OPEN_DELAY,x=v??0,[E,A]=n.useState(),[M,T]=n.useState(),[D,I]=n.useState(),[R,k]=n.useState(null),[P,_]=n.useState(null),[L,N]=n.useState(null),[O,F]=n.useState(!0),G=n.useRef(null),B=n.useRef(-1),[V,H]=(0,o.useControlled)({controlled:t,default:m,name:"Popover",state:"open"}),U=(0,a.useEventCallback)(i),{mounted:z,setMounted:W,transitionStatus:j}=(0,l.useTransitionStatus)(V);(0,f.useScrollLock)({enabled:V&&!0===w&&"hover"!==L,mounted:z,open:V,referenceElement:P});const $=(0,a.useEventCallback)((e,t,i)=>{U(e,t,i),H(e),e&&N(i??null)}),K=(0,a.useEventCallback)(()=>{W(!1),F(!0),N(null),C?.(!1)});(0,p.useOpenChangeComplete)({enabled:!e.actionsRef,open:V,ref:G,onComplete(){V||K()}}),n.useImperativeHandle(e.actionsRef,()=>({unmount:K}),[K]);const Y=(0,a.useEventCallback)(()=>{clearTimeout(B.current)});n.useEffect(()=>{V||Y()},[Y,V]),n.useEffect(()=>Y,[Y]);const q=(0,r.useFloatingRootContext)({elements:{reference:R,floating:P},open:V,onOpenChange(e,t,i){const n="hover"===i||"safe-polygon"===i,r="click"===i&&0===t.detail,o=!e&&("escape-key"===i||null==i);function a(){$(e,t,(0,d.translateOpenChangeReason)(i))}n?(F(!0),Y(),B.current=window.setTimeout(()=>{F(!1)},g.PATIENT_CLICK_THRESHOLD),s.flushSync(a)):a(),A(r||o?r?"click":"dismiss":void 0)}}),{openMethod:X,triggerProps:Z}=(0,u.useOpenInteractionType)(V),Q=S,J=(0,r.useHover)(q,{enabled:b&&("touch"!==X||"click"!==L),mouseOnly:!0,move:!1,handleClose:(0,r.safePolygon)({blockPointerEvents:!0}),restMs:Q,delay:{close:x}}),ee=(0,r.useClick)(q,{stickIfOpen:O}),te=(0,r.useDismiss)(q),ie=(0,r.useRole)(q),{getReferenceProps:ne,getFloatingProps:se}=(0,r.useInteractions)([J,ee,te,ie]),re=n.useCallback((e={})=>ne((0,h.mergeProps)(Z,e)),[ne,Z]);return n.useMemo(()=>({open:V,setOpen:$,mounted:z,setMounted:W,transitionStatus:j,setTriggerElement:k,positionerElement:P,setPositionerElement:_,popupRef:G,titleId:M,setTitleId:T,descriptionId:D,setDescriptionId:I,getTriggerProps:re,getPopupProps:se,floatingRootContext:q,instantType:E,openMethod:X,openReason:L,onOpenChangeComplete:C}),[V,$,z,W,j,P,M,D,re,se,q,E,X,L,C])};var n=y(i(22155)),s=y(i(70316)),r=i(62420),o=i(46830),a=i(37041),l=i(30973),c=i(81324),h=i(80725),u=i(30626),d=i(861),p=i(65635),g=i(71202),f=i(22130);function m(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(m=function(e){return e?i:t})(e)}function y(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=m(t);if(i&&i.has(e))return i.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var o=s?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}return n.default=e,i&&i.set(e,n),n}},63317(e,t,i){"use strict";var n=i(44898);Object.defineProperty(t,"__esModule",{value:!0}),t.PopoverTitle=void 0;var s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=c(t);if(i&&i.has(e))return i.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var o=s?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}return n.default=e,i&&i.set(e,n),n}(i(22155)),r=(n(i(5821)),i(4706)),o=i(13214),a=i(26111),l=i(322);function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(c=function(e){return e?i:t})(e)}t.PopoverTitle=s.forwardRef(function(e,t){const{render:i,className:n,...s}=e,{setTitleId:c}=(0,r.usePopoverRootContext)(),h=(0,l.useBaseUiId)(s.id);return(0,a.useEnhancedEffect)(()=>(c(h),()=>{c(void 0)}),[c,h]),(0,o.useRenderElement)("h2",e,{ref:t,props:[{id:h},s]})()})},4905(e,t,i){"use strict";var n=i(44898);Object.defineProperty(t,"__esModule",{value:!0}),t.PopoverTrigger=void 0;var s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=c(t);if(i&&i.has(e))return i.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var o=s?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}return n.default=e,i&&i.set(e,n),n}(i(22155)),r=(n(i(5821)),i(4706)),o=i(1623),a=i(72204),l=i(13214);function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(c=function(e){return e?i:t})(e)}t.PopoverTrigger=s.forwardRef(function(e,t){const{render:i,className:n,disabled:c=!1,...h}=e,{open:u,setTriggerElement:d,getTriggerProps:p,openReason:g}=(0,r.usePopoverRootContext)(),f=s.useMemo(()=>({disabled:c,open:u}),[c,u]),{getButtonProps:m,buttonRef:y}=(0,o.useButton)({disabled:c,buttonRef:t}),v=s.useMemo(()=>({open:e=>e&&"click"===g?a.pressableTriggerOpenStateMapping.open(e):a.triggerOpenStateMapping.open(e)}),[g]);return(0,l.useRenderElement)("button",e,{state:f,ref:[y,d],props:[p,h,m],customStyleHookMapping:v})()})},81324(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OPEN_DELAY=void 0,t.OPEN_DELAY=300},1623(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useButton=function(e={}){const{buttonRef:t,disabled:i=!1,focusableWhenDisabled:h,tabIndex:u,type:d="button",elementName:p}=e,g=n.useRef(null),{rootElementName:f,updateRootElementName:m}=(0,l.useRootElementName)({rootElementName:p}),y=void 0!==(0,c.useCompositeRootContext)(!0),v=(0,a.useEventCallback)(()=>{const e=g.current;return"BUTTON"===f||"INPUT"===f&&["button","submit","reset"].includes(e?.type)}),b=(0,a.useEventCallback)(()=>{const e=g.current;return Boolean("A"===f&&e?.href)}),C=(0,s.useForkRef)(m,t,g),w=n.useMemo(()=>{const e={};return void 0===u||y||(e.tabIndex=u),"BUTTON"===f||"INPUT"===f?h||y?e["aria-disabled"]=i:y||(e.disabled=i):""!==f&&("A"!==f?(e.role="button",y||(e.tabIndex=u??0)):u&&!y&&(e.tabIndex=u),i&&(e["aria-disabled"]=i,y||(e.tabIndex=h?u??0:-1))),e},[i,f,h,y,u]);return(0,o.useEnhancedEffect)(()=>{const e=g.current;e instanceof HTMLButtonElement&&y&&i&&void 0===w.disabled&&e.disabled&&(e.disabled=!1)},[i,w.disabled,y]),{getButtonProps:n.useCallback((e={})=>{const{onClick:t,onMouseDown:n,onKeyUp:s,onKeyDown:o,onPointerDown:a,...l}=e;return(0,r.mergeProps)({type:"BUTTON"===f||"INPUT"===f?d:void 0,onClick(e){i?e.preventDefault():t?.(e)},onMouseDown(e){i||n?.(e)},onKeyDown(e){(i&&h&&"Tab"!==e.key||e.target===e.currentTarget&&!v()&&" "===e.key)&&e.preventDefault(),i||((0,r.makeEventPreventable)(e),o?.(e)),e.baseUIHandlerPrevented||e.target!==e.currentTarget||v()||b()||"Enter"!==e.key||i||(t?.(e),e.preventDefault())},onKeyUp(e){i||((0,r.makeEventPreventable)(e),s?.(e)),e.baseUIHandlerPrevented||e.target!==e.currentTarget||v()||i||" "!==e.key||t?.(e)},onPointerDown(e){i?e.preventDefault():a?.(e)},ref:C},w,l)},[w,i,f,h,v,b,C,d]),buttonRef:C}};var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=h(t);if(i&&i.has(e))return i.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var o=s?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}return n.default=e,i&&i.set(e,n),n}(i(22155)),s=i(74467),r=i(80725),o=i(56371),a=i(37041),l=i(46489),c=i(57506);function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(h=function(e){return e?i:t})(e)}},42468(e,t,i){"use strict";var n=i(44898);Object.defineProperty(t,"__esModule",{value:!0}),t.InternalBackdrop=void 0;var s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=o(t);if(i&&i.has(e))return i.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var a=s?Object.getOwnPropertyDescriptor(e,r):null;a&&(a.get||a.set)?Object.defineProperty(n,r,a):n[r]=e[r]}return n.default=e,i&&i.set(e,n),n}(i(22155)),r=(n(i(5821)),i(65723));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(o=function(e){return e?i:t})(e)}t.InternalBackdrop=s.forwardRef(function(e,t){return(0,r.jsx)("div",{ref:t,role:"presentation","data-floating-ui-inert":!0,...e,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none"}})})},71202(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TYPEAHEAD_RESET_MS=t.PATIENT_CLICK_THRESHOLD=void 0,t.TYPEAHEAD_RESET_MS=500,t.PATIENT_CLICK_THRESHOLD=500},71922(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNavigatorData=s,t.isFirefox=function(){return/firefox/i.test((0,n.getUserAgent)())},t.isIOS=function(){const e=s();return"MacIntel"===e.platform&&e.maxTouchPoints>1||/iP(hone|ad|od)|iOS/.test(e.platform)},t.isWebKit=function(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter:none")};var n=i(57735);function s(){if("undefined"==typeof navigator)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints}}},16073(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateRenderProp=function(e,t,i){return"function"==typeof e?e(t,i):n.cloneElement(e,{...(0,s.mergeProps)(t,e.props),ref:t.ref})};var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=r(t);if(i&&i.has(e))return i.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=s?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,i&&i.set(e,n),n}(i(22155)),s=i(80725);function r(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(r=function(e){return e?i:t})(e)}},95361(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getReactElementRef=function(e){return parseInt(n.version,10)>=19?e?.props?.ref||null:e?.ref||null};var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=s(t);if(i&&i.has(e))return i.get(e);var n={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=r?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,i&&i.set(e,n),n}(i(22155));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(s=function(e){return e?i:t})(e)}},87935(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getStyleHookProps=function(e,t){let i={};return Object.entries(e).forEach(([e,n])=>{if(t?.hasOwnProperty(e)){const s=t[e](n);return void(null!=s&&(i={...i,...s}))}!0===n?i[`data-${e.toLowerCase()}`]="":n&&(i[`data-${e.toLowerCase()}`]=n.toString())}),i}},26111(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(95361);Object.keys(n).forEach(function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===n[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return n[e]}}))});var s=i(46830);Object.keys(s).forEach(function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===s[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}}))});var r=i(56371);Object.keys(r).forEach(function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===r[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}}))});var o=i(74467);Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))});var a=i(50901);Object.keys(a).forEach(function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===a[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}}))});var l=i(22130);Object.keys(l).forEach(function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===l[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return l[e]}}))});var c=i(30973);Object.keys(c).forEach(function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===c[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return c[e]}}))});var h=i(21932);Object.keys(h).forEach(function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===h[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return h[e]}}))})},52454(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.inertValue=function(e){return(0,n.isReactVersionAtLeast)(19)?e:e?"true":void 0};var n=i(49958)},68736(e,t){"use strict";function i(e){return e&&e.ownerDocument||document}Object.defineProperty(t,"__esModule",{value:!0}),t.ownerDocument=i,t.ownerWindow=function(e){return i(e).defaultView||window}},72204(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.triggerOpenStateMapping=t.pressableTriggerOpenStateMapping=t.popupStateMapping=t.CommonTriggerDataAttributes=t.CommonPopupDataAttributes=void 0;var n=i(60687);let s=t.CommonPopupDataAttributes=function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=n.TransitionStatusDataAttributes.startingStyle]="startingStyle",e[e.endingStyle=n.TransitionStatusDataAttributes.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e}({}),r=t.CommonTriggerDataAttributes=function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e}({});const o={[r.popupOpen]:""},a={[r.popupOpen]:"",[r.pressed]:""},l={[s.open]:""},c={[s.closed]:""},h={[s.anchorHidden]:""};t.triggerOpenStateMapping={open:e=>e?o:null},t.pressableTriggerOpenStateMapping={open:e=>e?a:null},t.popupStateMapping={open:e=>e?l:c,anchorHidden:e=>e?h:null}},10389(e,t,i){"use strict";var n=i(44898);Object.defineProperty(t,"__esModule",{value:!0}),t.HTMLElementType=function(e,t,i,n,s){return null},t.exactProp=function(e){return e},t.refType=void 0;var s=n(i(5821));t.refType=s.default.oneOfType([s.default.func,s.default.object])},49958(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isReactVersionAtLeast=function(e){return r>=e};var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=s(t);if(i&&i.has(e))return i.get(e);var n={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=r?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,i&&i.set(e,n),n}(i(22155));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(s=function(e){return e?i:t})(e)}const r=parseInt(n.version,10)},74184(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveClassName=function(e,t){return"function"==typeof e?e(t):e}},60687(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.transitionStatusMapping=t.TransitionStatusDataAttributes=void 0;let i=t.TransitionStatusDataAttributes=function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e}({});const n={[i.startingStyle]:""},s={[i.endingStyle]:""};t.transitionStatusMapping={transitionStatus:e=>"starting"===e?n:"ending"===e?s:null}},861(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.translateOpenChangeReason=function(e){if(e)return{click:"click",hover:"hover",focus:"focus","focus-out":"focus-out","escape-key":"escape-key","outside-press":"outside-press","reference-press":"trigger-press","safe-polygon":"hover","ancestor-scroll":void 0,"list-navigation":void 0}[e]}},54540(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useAnchorPositioning=function(e){const{anchor:t,positionMethod:i="absolute",side:c="bottom",sideOffset:d=0,align:p="center",alignOffset:g=0,collisionBoundary:f,collisionPadding:m=5,sticky:y=!1,arrowPadding:v=5,keepMounted:b=!1,floatingRootContext:C,mounted:w,trackAnchor:S=!0,nodeId:x}=e,E="rtl"===(0,a.useDirection)(),A={top:"top",right:"right",bottom:"bottom",left:"left","inline-end":E?"left":"right","inline-start":E?"right":"left"}[c],M="center"===p?A:`${A}-${p}`,T={boundary:"clipping-ancestors"===f?"clippingAncestors":f,padding:m},D=n.useRef(null),I=(0,l.useLatestRef)(d),R=(0,l.useLatestRef)(g),k="function"!=typeof d?d:0,P="function"!=typeof g?g:0,_=[(0,s.offset)(({rects:e,placement:t})=>{const i={side:h(c,(0,r.getSide)(t),E),align:(0,r.getAlignment)(t)||"center",anchor:{width:e.reference.width,height:e.reference.height},positioner:{width:e.floating.width,height:e.floating.height}},n="function"==typeof I.current?I.current(i):I.current,s="function"==typeof R.current?R.current(i):R.current;return{mainAxis:n,crossAxis:s,alignmentAxis:s}},[k,P,E,c])],L=(0,s.flip)(T),N=(0,s.shift)({...T,crossAxis:y,limiter:y?void 0:(0,s.limitShift)(()=>{if(!D.current)return{};const{height:e}=D.current.getBoundingClientRect();return{offset:e/2+("number"==typeof m?m:0)}})});"center"!==p?_.push(L,N):_.push(N,L),_.push((0,s.size)({...T,apply({elements:{floating:e},rects:{reference:t},availableWidth:i,availableHeight:n}){Object.entries({"--available-width":`${i}px`,"--available-height":`${n}px`,"--anchor-width":`${t.width}px`,"--anchor-height":`${t.height}px`}).forEach(([t,i])=>{e.style.setProperty(t,i)})}}),(0,s.arrow)(()=>({element:D.current||document.createElement("div"),padding:v}),[v]),(0,s.hide)(),{name:"transformOrigin",fn({elements:e,middlewareData:t,placement:i}){const n=(0,r.getSide)(i),s=D.current,o=t.arrow?.x??0,a=t.arrow?.y??0,l=o+(s?.clientWidth??0)/2,c=a+(s?.clientHeight??0)/2,h={top:`${l}px calc(100% + ${d}px)`,bottom:`${l}px ${-d}px`,left:`calc(100% + ${d}px) ${c}px`,right:`${-d}px ${c}px`}[n];return e.floating.style.setProperty("--transform-origin",h),{}}});let O=C;!w&&C&&(O={...C,elements:{reference:null,floating:null,domReference:null}});const F=n.useMemo(()=>({elementResize:S&&"undefined"!=typeof ResizeObserver,layoutShift:S&&"undefined"!=typeof IntersectionObserver}),[S]),{refs:G,elements:B,floatingStyles:V,middlewareData:H,update:U,placement:z,context:W,isPositioned:j}=(0,s.useFloating)({rootContext:O,placement:M,middleware:_,strategy:i,whileElementsMounted:b?void 0:(...e)=>(0,s.autoUpdate)(...e,F),nodeId:x}),$=n.useRef(null);(0,o.useEnhancedEffect)(()=>{if(!w)return;const e="function"==typeof t?t():t;if(e){const t=u(e)?e.current:e;G.setPositionReference(t),$.current=t}},[w,G,t]),n.useEffect(()=>{w&&"function"!=typeof t&&u(t)&&t.current!==$.current&&(G.setPositionReference(t.current),$.current=t.current)},[w,G,t]),n.useEffect(()=>{if(b&&w&&B.domReference&&B.floating)return(0,s.autoUpdate)(B.domReference,B.floating,U,F)},[b,w,B,U,F]);const K=(0,r.getSide)(z),Y=h(c,K,E),q=(0,r.getAlignment)(z)||"center",X=Boolean(H.hide?.referenceHidden),Z=n.useMemo(()=>({position:"absolute",top:H.arrow?.y,left:H.arrow?.x}),[H.arrow]),Q=0!==H.arrow?.centerOffset;return n.useMemo(()=>({positionerStyles:V,arrowStyles:Z,arrowRef:D,arrowUncentered:Q,side:Y,align:q,anchorHidden:X,refs:G,context:W,isPositioned:j}),[V,Z,D,Q,Y,q,X,G,W,j])};var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=c(t);if(i&&i.has(e))return i.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var o=s?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}return n.default=e,i&&i.set(e,n),n}(i(22155)),s=i(62420),r=i(31924),o=i(56371),a=i(53079),l=i(12618);function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(c=function(e){return e?i:t})(e)}function h(e,t,i){const n="inline-start"===e||"inline-end"===e;return{top:"top",right:n?i?"inline-start":"inline-end":"right",bottom:"bottom",left:n?i?"inline-end":"inline-start":"left"}[t]}function u(e){return null!=e&&"current"in e}},6029(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useAnimationsFinished=function(e,t=!1){const i=n.useRef(-1),o=n.useRef(-1),a=(0,r.useEventCallback)(()=>{cancelAnimationFrame(i.current),clearTimeout(o.current)});return n.useEffect(()=>a,[a]),(0,r.useEventCallback)((n,r=null)=>{a();const l=e.current;l&&("function"!=typeof l.getAnimations||globalThis.BASE_UI_ANIMATIONS_DISABLED?n():i.current=requestAnimationFrame(()=>{function e(){l&&Promise.allSettled(l.getAnimations().map(e=>e.finished)).then(()=>{null!=r&&r.aborted||s.flushSync(n)})}t?o.current=window.setTimeout(e):e()}))})};var n=a(i(22155)),s=a(i(70316)),r=i(37041);function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(o=function(e){return e?i:t})(e)}function a(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=o(t);if(i&&i.has(e))return i.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var a=s?Object.getOwnPropertyDescriptor(e,r):null;a&&(a.get||a.set)?Object.defineProperty(n,r,a):n[r]=e[r]}return n.default=e,i&&i.set(e,n),n}},322(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useBaseUiId=function(e){return(0,n.useId)(e,"base-ui")};var n=i(50901)},46830(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useControlled=function({controlled:e,default:t,name:i,state:s="value"}){const{current:r}=n.useRef(void 0!==e),[o,a]=n.useState(t);return[r?e:o,n.useCallback(e=>{r||a(e)},[])]};var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=s(t);if(i&&i.has(e))return i.get(e);var n={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=r?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,i&&i.set(e,n),n}(i(22155));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(s=function(e){return e?i:t})(e)}},24842(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useEnhancedClickHandler=function(e){const t=n.useRef(""),i=n.useCallback(e=>{e.defaultPrevented||(t.current=e.pointerType)},[]);return{onClick:n.useCallback(i=>{0!==i.detail?("pointerType"in i&&e(i,i.pointerType),e(i,t.current),t.current=""):e(i,"keyboard")},[e]),onPointerDown:i}};var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=s(t);if(i&&i.has(e))return i.get(e);var n={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=r?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,i&&i.set(e,n),n}(i(22155));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(s=function(e){return e?i:t})(e)}},56371(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useEnhancedEffect=void 0;var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=s(t);if(i&&i.has(e))return i.get(e);var n={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=r?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,i&&i.set(e,n),n}(i(22155));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(s=function(e){return e?i:t})(e)}t.useEnhancedEffect="undefined"!=typeof window?n.useLayoutEffect:n.useEffect},37041(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useEventCallback=function(e){const t=n.useRef(e);return(0,s.useEnhancedEffect)(()=>{t.current=e}),n.useCallback((...e)=>t.current?.(...e),[])};var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=r(t);if(i&&i.has(e))return i.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=s?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,i&&i.set(e,n),n}(i(22155)),s=i(56371);function r(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(r=function(e){return e?i:t})(e)}},74467(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useForkRef=function(...e){const t=n.useRef(void 0),i=n.useCallback(t=>{const i=e.map(e=>{if(null==e)return null;if("function"==typeof e){const i=e,n=i(t);return"function"==typeof n?n:()=>{i(null)}}return e.current=t,()=>{e.current=null}});return()=>{i.forEach(e=>e?.())}},e);return n.useMemo(()=>e.every(e=>null==e)?null:e=>{t.current&&(t.current(),t.current=void 0),null!=e&&(t.current=i(e))},e)};var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=s(t);if(i&&i.has(e))return i.get(e);var n={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=r?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,i&&i.set(e,n),n}(i(22155));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(s=function(e){return e?i:t})(e)}},50901(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useId=function(e,t){if(void 0!==o){const i=o();return e??(t?`${t}-${i}`:i)}return function(e,t="mui"){const[i,s]=n.useState(e),o=e||i;return n.useEffect(()=>{null==i&&(r+=1,s(`${t}-${r}`))},[i,t]),o}(e,t)};var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=s(t);if(i&&i.has(e))return i.get(e);var n={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=r?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,i&&i.set(e,n),n}(i(22155));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(s=function(e){return e?i:t})(e)}let r=0;const o={...n}.useId},12618(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useLatestRef=function(e){const t=n.useRef(e);return(0,s.useEnhancedEffect)(()=>{t.current=e}),t};var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=r(t);if(i&&i.has(e))return i.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=s?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,i&&i.set(e,n),n}(i(22155)),s=i(56371);function r(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(r=function(e){return e?i:t})(e)}},65635(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useOpenChangeComplete=function(e){const{enabled:t=!0,open:i,ref:a,onComplete:l}=e,c=(0,o.useLatestRef)(i),h=(0,r.useEventCallback)(l),u=(0,s.useAnimationsFinished)(a,i);n.useEffect(()=>{t&&u(()=>{i===c.current&&h()})},[t,i,h,u,c])};var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=a(t);if(i&&i.has(e))return i.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var o=s?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}return n.default=e,i&&i.set(e,n),n}(i(22155)),s=i(6029),r=i(37041),o=i(12618);function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(a=function(e){return e?i:t})(e)}},30626(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useOpenInteractionType=function(e){const[t,i]=n.useState(null);e||null===t||i(null);const r=n.useCallback((t,n)=>{e||i(n)},[e,i]),{onClick:o,onPointerDown:a}=(0,s.useEnhancedClickHandler)(r);return n.useMemo(()=>({openMethod:t,triggerProps:{onClick:o,onPointerDown:a}}),[t,o,a])};var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=r(t);if(i&&i.has(e))return i.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=s?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,i&&i.set(e,n),n}(i(22155)),s=i(24842);function r(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(r=function(e){return e?i:t})(e)}},13214(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useRenderElement=function(e,t,i={}){const{className:h,render:d}=t,{propGetter:p=e=>e,state:g=u,ref:f,props:m,customStyleHookMapping:y,styleHooks:v=!0}=i,b=d||("string"==typeof e?(S=e,function(e){return"button"===S?(0,c.jsx)("button",{type:"button",...e}):"img"===S?(0,c.jsx)("img",{alt:"",...e}):(0,c.jsx)(S,{...e})}):e),C=(0,r.resolveClassName)(h,g),w=p({...n.useMemo(()=>v?(0,s.getStyleHookProps)(g,y):u,[g,y,v]),...Array.isArray(m)?(0,l.mergeProps)(...m):m});var S;let x=[];void 0!==f&&(x=Array.isArray(f)?f:[f]);const E={...w,ref:(0,a.useRenderPropForkRef)(b,w.ref,...x)};return void 0!==C&&(E.className=C),()=>(0,o.evaluateRenderProp)(b,E,g)};var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=h(t);if(i&&i.has(e))return i.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var o=s?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}return n.default=e,i&&i.set(e,n),n}(i(22155)),s=i(87935),r=i(74184),o=i(16073),a=i(58064),l=i(80725),c=i(65723);function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(h=function(e){return e?i:t})(e)}const u={}},58064(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useRenderPropForkRef=function(e,...t){let i;return i="function"!=typeof e?(0,s.isReactVersionAtLeast)(19)?e.props.ref:e.ref:null,(0,n.useForkRef)(i,...t)};var n=i(74467),s=i(49958)},46489(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useRootElementName=function(e){const{rootElementName:t=""}=e,[i,s]=n.useState(t.toUpperCase());return{rootElementName:i,updateRootElementName:n.useCallback(e=>{s(e?.tagName??"")},[])}};var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=s(t);if(i&&i.has(e))return i.get(e);var n={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=r?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,i&&i.set(e,n),n}(i(22155));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(s=function(e){return e?i:t})(e)}i(56371),i(6543)},22130(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPreventScrollCount=function(){return d},t.useScrollLock=function(e){const{enabled:t=!0,mounted:i,open:l,referenceElement:g}=e,f=n.useMemo(()=>t&&((0,r.isIOS)()||!("undefined"!=typeof CSS&&"function"==typeof CSS.supports&&CSS.supports("height","1dvh"))||(0,r.isFirefox)()&&!function(e){if("undefined"==typeof document)return!1;const t=(0,o.ownerDocument)(e);return(0,o.ownerWindow)(t).innerWidth-t.documentElement.clientWidth>0}(g)),[t,g]);(0,a.useEnhancedEffect)(()=>{if(i&&!l&&(0,r.isWebKit)()){const e=(0,o.ownerDocument)(g),t=e.body.style.userSelect,i=e.body.style.webkitUserSelect;return e.body.style.userSelect="none",e.body.style.webkitUserSelect="none",()=>{e.body.style.userSelect=t,e.body.style.webkitUserSelect=i}}},[i,l,g]),(0,s.usePreventScroll)({isDisabled:!f}),(0,a.useEnhancedEffect)(()=>{if(t&&!f)return d+=1,1===d&&(p=function(e){const t=(0,o.ownerDocument)(e),i=t.documentElement,n=t.body,s=(0,o.ownerWindow)(i);let a=0,l=0,d=-1;if((0,r.isWebKit)()&&1!==(s.visualViewport?.scale??1))return()=>{};function p(){const e=s.getComputedStyle(i),t=s.getComputedStyle(n);a=i.scrollTop,l=i.scrollLeft,c={overflowY:i.style.overflowY,overflowX:i.style.overflowX},u=i.style.scrollBehavior,h={position:n.style.position,height:n.style.height,width:n.style.width,boxSizing:n.style.boxSizing,overflowY:n.style.overflowY,overflowX:n.style.overflowX,scrollBehavior:n.style.scrollBehavior};const r=e.scrollbarGutter?.includes("stable"),o=i.scrollHeight>i.clientHeight,d=i.scrollWidth>i.clientWidth,p="scroll"===e.overflowY||"scroll"===t.overflowY,g="scroll"===e.overflowX||"scroll"===t.overflowX,f=Math.max(0,s.innerWidth-i.clientWidth),m=Math.max(0,s.innerHeight-i.clientHeight);Object.assign(i.style,{overflowY:r||!o&&!p?"hidden":"scroll",overflowX:r||!d&&!g?"hidden":"scroll"});const y=parseFloat(t.marginTop)+parseFloat(t.marginBottom),v=parseFloat(t.marginLeft)+parseFloat(t.marginRight);Object.assign(n.style,{position:"relative",height:y||m?`calc(100dvh - ${y+m}px)`:"100dvh",width:v||f?`calc(100vw - ${v+f}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),n.scrollTop=a,n.scrollLeft=l,i.setAttribute("data-base-ui-scroll-locked",""),i.style.scrollBehavior="unset"}function g(){Object.assign(i.style,c),Object.assign(n.style,h),i.scrollTop=a,i.scrollLeft=l,i.removeAttribute("data-base-ui-scroll-locked"),i.style.scrollBehavior=u}function f(){g(),cancelAnimationFrame(d),d=requestAnimationFrame(p)}return p(),s.addEventListener("resize",f),()=>{cancelAnimationFrame(d),g(),s.removeEventListener("resize",f)}}(g)),()=>{d-=1,0===d&&p()}},[t,f,g])};var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=l(t);if(i&&i.has(e))return i.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&{}.hasOwnProperty.call(e,r)){var o=s?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}return n.default=e,i&&i.set(e,n),n}(i(22155)),s=i(34446),r=i(71922),o=i(68736),a=i(56371);function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(l=function(e){return e?i:t})(e)}let c={},h={},u="",d=0,p=()=>{}},30973(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useTransitionStatus=function(e){const[t,i]=n.useState(e?"idle":void 0),[r,o]=n.useState(e);return e&&!r&&(o(!0),i("starting")),!e&&r&&"ending"!==t&&i("ending"),e||r||"ending"!==t||i(void 0),(0,s.useEnhancedEffect)(()=>{if(!e)return;e&&r&&"idle"!==t&&i("starting");const n=requestAnimationFrame(()=>{i("idle")});return()=>{cancelAnimationFrame(n)}},[e,r,i,t]),n.useMemo(()=>({mounted:r,setMounted:o,transitionStatus:t}),[r,t])};var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=r(t);if(i&&i.has(e))return i.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=s?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,i&&i.set(e,n),n}(i(22155)),s=i(56371);function r(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(r=function(e){return e?i:t})(e)}},21932(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.visuallyHidden=void 0,t.visuallyHidden={clip:"rect(0 0 0 0)",overflow:"hidden",whiteSpace:"nowrap",position:"fixed",top:0,left:0,border:0,padding:0,width:1,height:1,margin:-1}},6543(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.warn=function(...e){}},64379(e,t,i){"use strict";var n=i(7274),s=globalThis;e.exports=function(){for(var e=[],t=0;t<n.length;t++)"function"==typeof s[n[t]]&&(e[e.length]=n[t]);return e}},30395(e,t){var i;!function(){"use strict";var n={}.hasOwnProperty;function s(){for(var e="",t=0;t<arguments.length;t++){var i=arguments[t];i&&(e=o(e,r(i)))}return e}function r(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return s.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var i in e)n.call(e,i)&&e[i]&&(t=o(t,i));return t}function o(e,t){return t?e?e+" "+t:e+t:e}e.exports?(s.default=s,e.exports=s):void 0===(i=function(){return s}.apply(t,[]))||(e.exports=i)}()},58041(e,t,i){"use strict";const{normalizeIPv6:n,removeDotSegments:s,recomposeAuthority:r,normalizePercentEncoding:o,normalizePathEncoding:a,escapePreservingEscapes:l,reescapeHostDelimiters:c,isIPv4:h,nonSimpleDomain:u}=i(1900),{SCHEMES:d,getSchemeHandler:p}=i(41441);function g(e,t,i,n){const r={};return n||(e=v(f(e,i),i),t=v(f(t,i),i)),!(i=i||{}).tolerant&&t.scheme?(r.scheme=t.scheme,r.userinfo=t.userinfo,r.host=t.host,r.port=t.port,r.path=s(t.path||""),r.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(r.userinfo=t.userinfo,r.host=t.host,r.port=t.port,r.path=s(t.path||""),r.query=t.query):(t.path?("/"===t.path[0]?r.path=s(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?r.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:r.path=t.path:r.path="/"+t.path,r.path=s(r.path)),r.query=t.query):(r.path=e.path,void 0!==t.query?r.query=t.query:r.query=e.query),r.userinfo=e.userinfo,r.host=e.host,r.port=e.port),r.scheme=e.scheme),r.fragment=t.fragment,r}function f(e,t){const i={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),a=[],c=p(n.scheme||i.scheme);c&&c.serialize&&c.serialize(i,n),void 0!==i.path&&(n.skipEscape?i.path=o(i.path):(i.path=l(i.path),void 0!==i.scheme&&(i.path=i.path.split("%3A").join(":")))),"suffix"!==n.reference&&i.scheme&&a.push(i.scheme,":");const h=r(i);if(void 0!==h&&("suffix"!==n.reference&&a.push("//"),a.push(h),i.path&&"/"!==i.path[0]&&a.push("/")),void 0!==i.path){let e=i.path;n.absolutePath||c&&c.absolutePath||(e=s(e)),void 0===h&&"/"===e[0]&&"/"===e[1]&&(e="/%2F"+e.slice(2)),a.push(e)}return void 0!==i.query&&a.push("?",i.query),void 0!==i.fragment&&a.push("#",i.fragment),a.join("")}const m=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function y(e,t){const i=Object.assign({},t),s={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let r=!1,o=!1;"suffix"===i.reference&&(e=i.scheme?i.scheme+":"+e:"//"+e);const l=e.match(m);if(l){s.scheme=l[1],s.userinfo=l[3],s.host=l[4],s.port=parseInt(l[5],10),s.path=l[6]||"",s.query=l[7],s.fragment=l[8],isNaN(s.port)&&(s.port=l[5]);const t=function(e,t){return void 0!==t[2]&&e.path&&"/"!==e.path[0]?'URI path must start with "/" when authority is present.':"number"==typeof e.port&&(e.port<0||e.port>65535)?"URI port is malformed.":void 0}(s,l);if(void 0!==t&&(s.error=s.error||t,r=!0),s.host)if(!1===h(s.host)){const e=n(s.host);s.host=e.host.toLowerCase(),o=e.isIPV6}else o=!0;void 0!==s.scheme||void 0!==s.userinfo||void 0!==s.host||void 0!==s.port||void 0!==s.query||s.path?void 0===s.scheme?s.reference="relative":void 0===s.fragment?s.reference="absolute":s.reference="uri":s.reference="same-document",i.reference&&"suffix"!==i.reference&&i.reference!==s.reference&&(s.error=s.error||"URI is not a "+i.reference+" reference.");const d=p(i.scheme||s.scheme);if(!(i.unicodeSupport||d&&d.unicodeSupport)&&s.host&&(i.domainHost||d&&d.domainHost)&&!1===o&&u(s.host))try{s.host=URL.domainToASCII(s.host.toLowerCase())}catch(e){s.error=s.error||"Host's domain name can not be converted to ASCII: "+e}if((!d||d&&!d.skipNormalize)&&(-1!==e.indexOf("%")&&(void 0!==s.scheme&&(s.scheme=unescape(s.scheme)),void 0!==s.host&&(s.host=c(unescape(s.host),o))),s.path&&(s.path=a(s.path)),s.fragment))try{s.fragment=encodeURI(decodeURIComponent(s.fragment))}catch{s.error=s.error||"URI malformed"}d&&d.parse&&d.parse(s,i)}else s.error=s.error||"URI can not be parsed.";return{parsed:s,malformedAuthorityOrPort:r}}function v(e,t){return y(e,t).parsed}function b(e,t){const{parsed:i,malformedAuthorityOrPort:n}=y(e,t);return{normalized:n?e:f(i,t),malformedAuthorityOrPort:n}}function C(e,t){if("string"==typeof e){const{normalized:i,malformedAuthorityOrPort:n}=b(e,t);return n?void 0:i}if("object"==typeof e)return f(e,t)}const w={SCHEMES:d,normalize:function(e,t){return"string"==typeof e?e=function(e,t){return b(e,t).normalized}(e,t):"object"==typeof e&&(e=v(f(e,t),t)),e},resolve:function(e,t,i){const n=i?Object.assign({scheme:"null"},i):{scheme:"null"},s=g(v(e,n),v(t,n),n,!0);return n.skipEscape=!0,f(s,n)},resolveComponent:g,equal:function(e,t,i){const n=C(e,i),s=C(t,i);return void 0!==n&&void 0!==s&&n.toLowerCase()===s.toLowerCase()},serialize:f,parse:v};e.exports=w,e.exports.default=w,e.exports.fastUri=w},41441(e,t,i){"use strict";const{isUUID:n}=i(1900),s=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,r=["http","https","ws","wss","urn","urn:uuid"];function o(e){return!0===e.secure||!1!==e.secure&&!!e.scheme&&!(3!==e.scheme.length||"w"!==e.scheme[0]&&"W"!==e.scheme[0]||"s"!==e.scheme[1]&&"S"!==e.scheme[1]||"s"!==e.scheme[2]&&"S"!==e.scheme[2])}function a(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function l(e){const t="https"===String(e.scheme).toLowerCase();return e.port!==(t?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}const c={scheme:"http",domainHost:!0,parse:a,serialize:l},h={scheme:"ws",domainHost:!0,parse:function(e){return e.secure=o(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e},serialize:function(e){if(e.port!==(o(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){const[t,i]=e.resourceName.split("?");e.path=t&&"/"!==t?t:void 0,e.query=i,e.resourceName=void 0}return e.fragment=void 0,e}},u={http:c,https:{scheme:"https",domainHost:c.domainHost,parse:a,serialize:l},ws:h,wss:{scheme:"wss",domainHost:h.domainHost,parse:h.parse,serialize:h.serialize},urn:{scheme:"urn",parse:function(e,t){if(!e.path)return e.error="URN can not be parsed",e;const i=e.path.match(s);if(i){const n=t.scheme||e.scheme||"urn";e.nid=i[1].toLowerCase(),e.nss=i[2];const s=d(`${n}:${t.nid||e.nid}`);e.path=void 0,s&&(e=s.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e},serialize:function(e,t){if(void 0===e.nid)throw new Error("URN without nid cannot be serialized");const i=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),s=d(`${i}:${t.nid||n}`);s&&(e=s.serialize(e,t));const r=e,o=e.nss;return r.path=`${n||t.nid}:${o}`,t.skipEscape=!0,r},skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:function(e,t){const i=e;return i.uuid=i.nss,i.nss=void 0,t.tolerant||i.uuid&&n(i.uuid)||(i.error=i.error||"UUID is not valid."),i},serialize:function(e){const t=e;return t.nss=(e.uuid||"").toLowerCase(),t},skipNormalize:!0}};function d(e){return e&&(u[e]||u[e.toLowerCase()])||void 0}Object.setPrototypeOf(u,null),e.exports={wsIsSecure:o,SCHEMES:u,isValidSchemeName:function(e){return-1!==r.indexOf(e)},getSchemeHandler:d}},1900(e){"use strict";const t=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),i=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),n=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),s=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),r=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function o(e){let t="",i=0,n=0;for(n=0;n<e.length;n++)if(i=e[n].charCodeAt(0),48!==i){if(!(i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102))return"";t+=e[n];break}for(n+=1;n<e.length;n++){if(i=e[n].charCodeAt(0),!(i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102))return"";t+=e[n]}return t}const a=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function l(e){return e.length=0,!0}function c(e,t,i){if(e.length){const n=o(e);if(""===n)return i.error=!0,!1;t.push(n),e.length=0}return!0}function h(e){if(function(e){let t=0;for(let i=0;i<e.length;i++)":"===e[i]&&t++;return t}(e)<2)return{host:e,isIPV6:!1};const t=function(e){let t=0;const i={error:!1,address:"",zone:""},n=[],s=[];let r=!1,a=!1,h=c;for(let o=0;o<e.length;o++){const c=e[o];if("["!==c&&"]"!==c)if(":"!==c)if("%"===c){if(!h(s,n,i))break;h=l}else s.push(c);else{if(!0===r&&(a=!0),!h(s,n,i))break;if(++t>7){i.error=!0;break}o>0&&":"===e[o-1]&&(r=!0),n.push(":")}}return s.length&&(h===l?i.zone=s.join(""):a?n.push(s.join("")):n.push(o(s))),i.address=n.join(""),i}(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,i=t.address;return t.zone&&(e+="%"+t.zone,i+="%25"+t.zone),{host:e,isIPV6:!0,escapedHost:i}}}const u={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},d=/[@/?#:]/g,p=/[@/?#]/g;function g(e,t){const i=t?p:d;return i.lastIndex=0,e.replace(i,e=>u[e])}e.exports={nonSimpleDomain:a,recomposeAuthority:function(e){const t=[];if(void 0!==e.userinfo&&(t.push(e.userinfo),t.push("@")),void 0!==e.host){let n=unescape(e.host);if(!i(n)){const e=h(n);n=!0===e.isIPV6?`[${e.escapedHost}]`:g(n,!1)}t.push(n)}return"number"!=typeof e.port&&"string"!=typeof e.port||(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0},reescapeHostDelimiters:g,normalizePercentEncoding:function(e,t=!1){if(-1===e.indexOf("%"))return e;let i="";for(let r=0;r<e.length;r++){if("%"===e[r]&&r+2<e.length){const o=e.slice(r+1,r+3);if(n(o)){const e=o.toUpperCase(),n=String.fromCharCode(parseInt(e,16));t&&s(n)?i+=n:i+="%"+e,r+=2;continue}}i+=e[r]}return i},normalizePathEncoding:function(e){let t="";for(let i=0;i<e.length;i++){if("%"===e[i]&&i+2<e.length){const r=e.slice(i+1,i+3);if(n(r)){const e=r.toUpperCase(),n=String.fromCharCode(parseInt(e,16));"."!==n&&s(n)?t+=n:t+="%"+e,i+=2;continue}}r(e[i])?t+=e[i]:t+=escape(e[i])}return t},escapePreservingEscapes:function(e){let t="";for(let i=0;i<e.length;i++){if("%"===e[i]&&i+2<e.length){const s=e.slice(i+1,i+3);if(n(s)){t+="%"+s.toUpperCase(),i+=2;continue}}t+=escape(e[i])}return t},removeDotSegments:function(e){let t=e;const i=[];let n=-1,s=0;for(;s=t.length;){if(1===s){if("."===t)break;if("/"===t){i.push("/");break}i.push(t);break}if(2===s){if("."===t[0]){if("."===t[1])break;if("/"===t[1]){t=t.slice(2);continue}}else if("/"===t[0]&&("."===t[1]||"/"===t[1])){i.push("/");break}}else if(3===s&&"/.."===t){0!==i.length&&i.pop(),i.push("/");break}if("."===t[0]){if("."===t[1]){if("/"===t[2]){t=t.slice(3);continue}}else if("/"===t[1]){t=t.slice(2);continue}}else if("/"===t[0]&&"."===t[1]){if("/"===t[2]){t=t.slice(2);continue}if("."===t[2]&&"/"===t[3]){t=t.slice(3),0!==i.length&&i.pop();continue}}if(-1===(n=t.indexOf("/",1))){i.push(t);break}i.push(t.slice(0,n)),t=t.slice(n)}return i.join("")},isIPv4:i,isUUID:t,normalizeIPv6:h,stringArrayToHexStripped:o}},9374(e,t,i){"use strict";i.d(t,{k:()=>m});var n=i(65959),s=i(1645),r=i(74140),o=i(48448),a=i(87819),l=i(73476),c=i(34222),h=i(78027),u=i(97023),d=i(9420),p=i(85923),g=i(67558),f=i(23549),m=function(){function e(){this.assumeImmutableResults=!1,this.getFragmentDoc=(0,s.LV)(a.ct,{max:o.v["cache.fragmentQueryDocuments"]||1e3,cache:h.l})}return e.prototype.lookupFragment=function(e){return null},e.prototype.batch=function(e){var t,i=this,n="string"==typeof e.optimistic?e.optimistic:!1===e.optimistic?null:void 0;return this.performTransaction(function(){return t=e.update(i)},n),t},e.prototype.recordOptimisticTransaction=function(e,t){this.performTransaction(e,t)},e.prototype.transformDocument=function(e){return e},e.prototype.transformForLink=function(e){return e},e.prototype.identify=function(e){},e.prototype.gc=function(){return[]},e.prototype.modify=function(e){return!1},e.prototype.readQuery=function(e,t){var i=this;return void 0===t&&(t=!!e.optimistic),!1!==globalThis.__DEV__&&(0,f.cc)(e,"canonizeResults","cache.readQuery"),(0,f.lz)("canonizeResults",function(){return i.read((0,n.__assign)((0,n.__assign)({},e),{rootId:e.id||"ROOT_QUERY",optimistic:t}))})},e.prototype.watchFragment=function(e){var t=this,i=e.fragment,s=e.fragmentName,o=e.from,a=e.optimistic,h=void 0===a||a,u=(0,n.__rest)(e,["fragment","fragmentName","from","optimistic"]),f=this.getFragmentDoc(i,s),m=void 0===o||"string"==typeof o?o:this.identify(o),y=!!e[Symbol.for("apollo.dataMasking")];if(!1!==globalThis.__DEV__){var v=s||(0,l.E4)(i).name.value;m||!1!==globalThis.__DEV__&&p.V1.warn(1,v)}var b,C=(0,n.__assign)((0,n.__assign)({},u),{returnPartialData:!0,id:m,query:f,optimistic:h});return new r.c(function(r){return t.watch((0,n.__assign)((0,n.__assign)({},C),{immediate:!0,callback:function(o){var a=y?(0,g.z)(o.result,i,t,s):o.result;if(!b||!(0,d.a)(f,{data:b.result},{data:a},e.variables)){var l={data:a,complete:!!o.complete};o.missing&&(l.missing=(0,c.IM)(o.missing.map(function(e){return e.missing}))),b=(0,n.__assign)((0,n.__assign)({},o),{result:a}),r.next(l)}}}))})},e.prototype.readFragment=function(e,t){var i=this;return void 0===t&&(t=!!e.optimistic),!1!==globalThis.__DEV__&&(0,f.cc)(e,"canonizeResults","cache.readFragment"),(0,f.lz)("canonizeResults",function(){return i.read((0,n.__assign)((0,n.__assign)({},e),{query:i.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:t}))})},e.prototype.writeQuery=function(e){var t=e.id,i=e.data,s=(0,n.__rest)(e,["id","data"]);return this.write(Object.assign(s,{dataId:t||"ROOT_QUERY",result:i}))},e.prototype.writeFragment=function(e){var t=e.id,i=e.data,s=e.fragment,r=e.fragmentName,o=(0,n.__rest)(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(s,r),dataId:t,result:i}))},e.prototype.updateQuery=function(e,t){return!1!==globalThis.__DEV__&&(0,f.cc)(e,"canonizeResults","cache.updateQuery"),this.batch({update:function(i){var s=(0,f.lz)("canonizeResults",function(){return i.readQuery(e)}),r=t(s);return null==r?s:(i.writeQuery((0,n.__assign)((0,n.__assign)({},e),{data:r})),r)}})},e.prototype.updateFragment=function(e,t){return!1!==globalThis.__DEV__&&(0,f.cc)(e,"canonizeResults","cache.updateFragment"),this.batch({update:function(i){var s=(0,f.lz)("canonizeResults",function(){return i.readFragment(e)}),r=t(s);return null==r?s:(i.writeFragment((0,n.__assign)((0,n.__assign)({},e),{data:r})),r)}})},e}();!1!==globalThis.__DEV__&&(m.prototype.getMemoryInternals=u.tQ)},17657(e,t,i){"use strict";i.d(t,{Z:()=>s});var n=i(65959),s=function(e){function t(i,n,s,r){var o,a=e.call(this,i)||this;if(a.message=i,a.path=n,a.query=s,a.variables=r,Array.isArray(a.path)){a.missing=a.message;for(var l=a.path.length-1;l>=0;--l)a.missing=((o={})[a.path[l]]=a.missing,o)}else a.missing=a.path;return a.__proto__=t.prototype,a}return(0,n.__extends)(t,e),t}(Error)},91742(e,t,i){"use strict";i.d(t,{$3:()=>u,I6:()=>f,T9:()=>C,Ui:()=>y,Xx:()=>m,d1:()=>w,gk:()=>v,iJ:()=>b,lq:()=>x,mv:()=>S,or:()=>p});var n=i(77822),s=i(87819),r=i(73476),o=i(77038),a=i(34222),l=i(24568),c=i(83724),h=i(93565),u=Object.prototype.hasOwnProperty;function d(e){return null==e}function p(e,t){var i=e.__typename,n=e.id,s=e._id;if("string"==typeof i&&(t&&(t.keyObject=d(n)?d(s)?void 0:{_id:s}:{id:n}),d(n)&&!d(s)&&(n=s),!d(n)))return"".concat(i,":").concat("number"==typeof n||"string"==typeof n?n:JSON.stringify(n))}var g={dataIdFromObject:p,addTypename:!0,resultCaching:!0,canonizeResults:!1};function f(e){return(0,h.o)(g,e)}function m(e){var t=e.canonizeResults;return void 0===t?g.canonizeResults:t}function y(e,t){return(0,o.A_)(t)?e.get(t.__ref,"__typename"):t&&t.__typename}var v=/^[_a-z][_0-9a-z]*/i;function b(e){var t=e.match(v);return t?t[0]:e}function C(e,t,i){return!!(0,c.U)(t)&&((0,l.c)(t)?t.every(function(t){return C(e,t,i)}):e.selections.every(function(e){if((0,o.dt)(e)&&(0,n.MS)(e,i)){var s=(0,o.ue)(e);return u.call(t,s)&&(!e.selectionSet||C(e.selectionSet,t[s],i))}return!0}))}function w(e){return(0,c.U)(e)&&!(0,o.A_)(e)&&!(0,l.c)(e)}function S(){return new a.ZI}function x(e,t){var i=(0,s.JG)((0,r.zK)(e));return{fragmentMap:i,lookupFragment:function(e){var n=i[e];return!n&&t&&(n=t.lookup(e)),n||null}}}},19215(e,t,i){"use strict";i.d(t,{D:()=>Ce});var n=i(65959),s=i(85923),r=i(1645),o=i(45063),a=i(9374),l=i(17657),c=i(29957),h=i(49666),u=i(48448),d=i(87713),p=i(84305),g=i(77038),f=i(49270),m=i(51975),y=i(93565),v=i(73476),b=i(34222),C=i(77822),w=i(87819),S=i(58737),x=i(83724),E=i(69796),A=i(91742),M=Object.create(null),T=function(){return M},D=Object.create(null),I=function(){function e(e,t){var i=this;this.policies=e,this.group=t,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(e,t){return(0,S.G)((0,g.A_)(e)?i.get(e.__ref,t):e&&e[t])},this.canRead=function(e){return(0,g.A_)(e)?i.has(e.__ref):"object"==typeof e},this.toReference=function(e,t){if("string"==typeof e)return(0,g.WU)(e);if((0,g.A_)(e))return e;var n=i.policies.identify(e)[0];if(n){var s=(0,g.WU)(n);return t&&i.merge(n,e),s}}}return e.prototype.toObject=function(){return(0,n.__assign)({},this.data)},e.prototype.has=function(e){return void 0!==this.lookup(e,!0)},e.prototype.get=function(e,t){if(this.group.depend(e,t),A.$3.call(this.data,e)){var i=this.data[e];if(i&&A.$3.call(i,t))return i[t]}return"__typename"===t&&A.$3.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof _?this.parent.get(e,t):void 0},e.prototype.lookup=function(e,t){return t&&this.group.depend(e,"__exists"),A.$3.call(this.data,e)?this.data[e]:this instanceof _?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?Object.create(null):void 0},e.prototype.merge=function(e,t){var i,n=this;(0,g.A_)(e)&&(e=e.__ref),(0,g.A_)(t)&&(t=t.__ref);var r="string"==typeof e?this.lookup(i=e):e,o="string"==typeof t?this.lookup(i=t):t;if(o){(0,s.V1)("string"==typeof i,2);var a=new b.ZI(N).merge(r,o);if(this.data[i]=a,a!==r&&(delete this.refs[i],this.group.caching)){var l=Object.create(null);r||(l.__exists=1),Object.keys(o).forEach(function(e){if(!r||r[e]!==a[e]){l[e]=1;var t=(0,A.iJ)(e);t===e||n.policies.hasKeyArgs(a.__typename,t)||(l[t]=1),void 0!==a[e]||n instanceof _||delete a[e]}}),!l.__typename||r&&r.__typename||this.policies.rootTypenamesById[i]!==a.__typename||delete l.__typename,Object.keys(l).forEach(function(e){return n.group.dirty(i,e)})}}},e.prototype.modify=function(e,t){var i=this,r=this.lookup(e);if(r){var o=Object.create(null),a=!1,l=!0,c={DELETE:M,INVALIDATE:D,isReference:g.A_,toReference:this.toReference,canRead:this.canRead,readField:function(t,n){return i.policies.readField("string"==typeof t?{fieldName:t,from:n||(0,g.WU)(e)}:t,{store:i})}};if(Object.keys(r).forEach(function(h){var u=(0,A.iJ)(h),d=r[h];if(void 0!==d){var p="function"==typeof t?t:t[h]||t[u];if(p){var f=p===T?M:p((0,S.G)(d),(0,n.__assign)((0,n.__assign)({},c),{fieldName:u,storeFieldName:h,storage:i.getStorage(e,h)}));if(f===D)i.group.dirty(e,h);else if(f===M&&(f=void 0),f!==d&&(o[h]=f,a=!0,d=f,!1!==globalThis.__DEV__)){var m=function(e){if(void 0===i.lookup(e.__ref))return!1!==globalThis.__DEV__&&s.V1.warn(3,e),!0};if((0,g.A_)(f))m(f);else if(Array.isArray(f))for(var y=!1,v=void 0,b=0,C=f;b<C.length;b++){var w=C[b];if((0,g.A_)(w)){if(y=!0,m(w))break}else"object"==typeof w&&w&&i.policies.identify(w)[0]&&(v=w);if(y&&void 0!==v){!1!==globalThis.__DEV__&&s.V1.warn(4,v);break}}}}void 0!==d&&(l=!1)}}),a)return this.merge(e,o),l&&(this instanceof _?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},e.prototype.delete=function(e,t,i){var n,s=this.lookup(e);if(s){var r=this.getFieldValue(s,"__typename"),o=t&&i?this.policies.getStoreFieldName({typename:r,fieldName:t,args:i}):t;return this.modify(e,o?((n={})[o]=T,n):T)}return!1},e.prototype.evict=function(e,t){var i=!1;return e.id&&(A.$3.call(this.data,e.id)&&(i=this.delete(e.id,e.fieldName,e.args)),this instanceof _&&this!==t&&(i=this.parent.evict(e,t)||i),(e.fieldName||i)&&this.group.dirty(e.id,e.fieldName||"__exists")),i},e.prototype.clear=function(){this.replace(null)},e.prototype.extract=function(){var e=this,t=this.toObject(),i=[];return this.getRootIdSet().forEach(function(t){A.$3.call(e.policies.rootTypenamesById,t)||i.push(t)}),i.length&&(t.__META={extraRootIds:i.sort()}),t},e.prototype.replace=function(e){var t=this;if(Object.keys(this.data).forEach(function(i){e&&A.$3.call(e,i)||t.delete(i)}),e){var i=e.__META,s=(0,n.__rest)(e,["__META"]);Object.keys(s).forEach(function(e){t.merge(e,s[e])}),i&&i.extraRootIds.forEach(this.retain,this)}},e.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},e.prototype.release=function(e){if(this.rootIds[e]>0){var t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0},e.prototype.getRootIdSet=function(e){return void 0===e&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof _?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},e.prototype.gc=function(){var e=this,t=this.getRootIdSet(),i=this.toObject();t.forEach(function(n){A.$3.call(i,n)&&(Object.keys(e.findChildRefIds(n)).forEach(t.add,t),delete i[n])});var n=Object.keys(i);if(n.length){for(var s=this;s instanceof _;)s=s.parent;n.forEach(function(e){return s.delete(e)})}return n},e.prototype.findChildRefIds=function(e){if(!A.$3.call(this.refs,e)){var t=this.refs[e]=Object.create(null),i=this.data[e];if(!i)return t;var n=new Set([i]);n.forEach(function(e){(0,g.A_)(e)&&(t[e.__ref]=!0),(0,x.U)(e)&&Object.keys(e).forEach(function(t){var i=e[t];(0,x.U)(i)&&n.add(i)})})}return this.refs[e]},e.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},e}(),R=function(){function e(e,t){void 0===t&&(t=null),this.caching=e,this.parent=t,this.d=null,this.resetCaching()}return e.prototype.resetCaching=function(){this.d=this.caching?(0,r.yN)():null,this.keyMaker=new E.b(m.et)},e.prototype.depend=function(e,t){if(this.d){this.d(k(e,t));var i=(0,A.iJ)(t);i!==t&&this.d(k(e,i)),this.parent&&this.parent.depend(e,t)}},e.prototype.dirty=function(e,t){this.d&&this.d.dirty(k(e,t),"__exists"===t?"forget":"setDirty")},e}();function k(e,t){return t+"#"+e}function P(e,t){O(e)&&e.group.depend(t,"__exists")}!function(e){var t=function(e){function t(t){var i=t.policies,n=t.resultCaching,s=void 0===n||n,r=t.seed,o=e.call(this,i,new R(s))||this;return o.stump=new L(o),o.storageTrie=new E.b(m.et),r&&o.replace(r),o}return(0,n.__extends)(t,e),t.prototype.addLayer=function(e,t){return this.stump.addLayer(e,t)},t.prototype.removeLayer=function(){return this},t.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},t}(e);e.Root=t}(I||(I={}));var _=function(e){function t(t,i,n,s){var r=e.call(this,i.policies,s)||this;return r.id=t,r.parent=i,r.replay=n,r.group=s,n(r),r}return(0,n.__extends)(t,e),t.prototype.addLayer=function(e,i){return new t(e,this,i,this.group)},t.prototype.removeLayer=function(e){var t=this,i=this.parent.removeLayer(e);return e===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(e){var n=t.data[e],s=i.lookup(e);s?n?n!==s&&Object.keys(n).forEach(function(i){(0,o.L)(n[i],s[i])||t.group.dirty(e,i)}):(t.group.dirty(e,"__exists"),Object.keys(s).forEach(function(i){t.group.dirty(e,i)})):t.delete(e)}),i):i===this.parent?this:i.addLayer(this.id,this.replay)},t.prototype.toObject=function(){return(0,n.__assign)((0,n.__assign)({},this.parent.toObject()),this.data)},t.prototype.findChildRefIds=function(t){var i=this.parent.findChildRefIds(t);return A.$3.call(this.data,t)?(0,n.__assign)((0,n.__assign)({},i),e.prototype.findChildRefIds.call(this,t)):i},t.prototype.getStorage=function(){for(var e=this.parent;e.parent;)e=e.parent;return e.getStorage.apply(e,arguments)},t}(I),L=function(e){function t(t){return e.call(this,"EntityStore.Stump",t,function(){},new R(t.group.caching,t.group))||this}return(0,n.__extends)(t,e),t.prototype.removeLayer=function(){return this},t.prototype.merge=function(e,t){return this.parent.merge(e,t)},t}(_);function N(e,t,i){var n=e[i],s=t[i];return(0,o.L)(n,s)?n:s}function O(e){return!!(e instanceof I&&e.group.caching)}var F=i(24568),G=function(){function e(){this.known=new(m.En?WeakSet:Set),this.pool=new E.b(m.et),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return e.prototype.isKnown=function(e){return(0,x.U)(e)&&this.known.has(e)},e.prototype.pass=function(e){if((0,x.U)(e)){var t=function(e){return(0,x.U)(e)?(0,F.c)(e)?e.slice(0):(0,n.__assign)({__proto__:Object.getPrototypeOf(e)},e):e}(e);return this.passes.set(t,e),t}return e},e.prototype.admit=function(e){var t=this;if((0,x.U)(e)){var i=this.passes.get(e);if(i)return i;switch(Object.getPrototypeOf(e)){case Array.prototype:if(this.known.has(e))return e;var n=e.map(this.admit,this);return(a=this.pool.lookupArray(n)).array||(this.known.add(a.array=n),!1!==globalThis.__DEV__&&Object.freeze(n)),a.array;case null:case Object.prototype:if(this.known.has(e))return e;var s=Object.getPrototypeOf(e),r=[s],o=this.sortedKeys(e);r.push(o.json);var a,l=r.length;if(o.sorted.forEach(function(i){r.push(t.admit(e[i]))}),!(a=this.pool.lookupArray(r)).object){var c=a.object=Object.create(s);this.known.add(c),o.sorted.forEach(function(e,t){c[e]=r[l+t]}),!1!==globalThis.__DEV__&&Object.freeze(c)}return a.object}}return e},e.prototype.sortedKeys=function(e){var t=Object.keys(e),i=this.pool.lookupArray(t);if(!i.keys){t.sort();var n=JSON.stringify(t);(i.keys=this.keysByJSON.get(n))||this.keysByJSON.set(n,i.keys={sorted:t,json:n})}return i.keys},e}();function B(e){return[e.selectionSet,e.objectOrReference,e.context,e.context.canonizeResults]}var V=function(){function e(e){var t=this;this.knownResults=new(m.et?WeakMap:Map),this.config=(0,y.o)(e,{addTypename:!1!==e.addTypename,canonizeResults:(0,A.Xx)(e)}),this.canon=e.canon||new G,this.executeSelectionSet=(0,r.LV)(function(e){var i,s=e.context.canonizeResults,r=B(e);r[3]=!s;var o=(i=t.executeSelectionSet).peek.apply(i,r);return o?s?(0,n.__assign)((0,n.__assign)({},o),{result:t.canon.admit(o.result)}):o:(P(e.context.store,e.enclosingRef.__ref),t.execSelectionSetImpl(e))},{max:this.config.resultCacheMaxSize||u.v["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:B,makeCacheKey:function(e,t,i,n){if(O(i.store))return i.store.makeCacheKey(e,(0,g.A_)(t)?t.__ref:t,i.varString,n)}}),this.executeSubSelectedArray=(0,r.LV)(function(e){return P(e.context.store,e.enclosingRef.__ref),t.execSubSelectedArrayImpl(e)},{max:this.config.resultCacheMaxSize||u.v["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey:function(e){var t=e.field,i=e.array,n=e.context;if(O(n.store))return n.store.makeCacheKey(t,i,n.varString)}})}return e.prototype.resetCanon=function(){this.canon=new G},e.prototype.diffQueryAgainstStore=function(e){var t=e.store,i=e.query,s=e.rootId,r=void 0===s?"ROOT_QUERY":s,o=e.variables,a=e.returnPartialData,c=void 0===a||a,h=e.canonizeResults,u=void 0===h?this.config.canonizeResults:h,p=this.config.cache.policies;o=(0,n.__assign)((0,n.__assign)({},(0,v.wY)((0,v.AT)(i))),o);var f,m=(0,g.WU)(r),y=this.executeSelectionSet({selectionSet:(0,v.Vn)(i).selectionSet,objectOrReference:m,enclosingRef:m,context:(0,n.__assign)({store:t,query:i,policies:p,variables:o,varString:(0,d.M)(o),canonizeResults:u},(0,A.lq)(i,this.config.fragments))});if(y.missing&&(f=[new l.Z(H(y.missing),y.missing,i,o)],!c))throw f[0];return{result:y.result,complete:!f,missing:f}},e.prototype.isFresh=function(e,t,i,n){if(O(n.store)&&this.knownResults.get(e)===i){var s=this.executeSelectionSet.peek(i,t,n,this.canon.isKnown(e));if(s&&e===s.result)return!0}return!1},e.prototype.execSelectionSetImpl=function(e){var t=this,i=e.selectionSet,n=e.objectOrReference,r=e.enclosingRef,o=e.context;if((0,g.A_)(n)&&!o.policies.rootTypenamesById[n.__ref]&&!o.store.has(n.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(n.__ref," object")};var a,l=o.variables,c=o.policies,u=o.store.getFieldValue(n,"__typename"),d=[],p=new b.ZI;function m(e,t){var i;return e.missing&&(a=p.merge(a,((i={})[t]=e.missing,i))),e.result}this.config.addTypename&&"string"==typeof u&&!c.rootIdsByTypename[u]&&d.push({__typename:u});var y=new Set(i.selections);y.forEach(function(e){var i,v;if((0,C.MS)(e,l))if((0,g.dt)(e)){var b=c.readField({fieldName:e.name.value,field:e,variables:o.variables,from:n},o),S=(0,g.ue)(e);void 0===b?h.XY.added(e)||(a=p.merge(a,((i={})[S]="Can't find field '".concat(e.name.value,"' on ").concat((0,g.A_)(n)?n.__ref+" object":"object "+JSON.stringify(n,null,2)),i))):(0,F.c)(b)?b.length>0&&(b=m(t.executeSubSelectedArray({field:e,array:b,enclosingRef:r,context:o}),S)):e.selectionSet?null!=b&&(b=m(t.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:b,enclosingRef:(0,g.A_)(b)?b:r,context:o}),S)):o.canonizeResults&&(b=t.canon.pass(b)),void 0!==b&&d.push(((v={})[S]=b,v))}else{var x=(0,w.HQ)(e,o.lookupFragment);if(!x&&e.kind===f.b.FRAGMENT_SPREAD)throw(0,s.vA)(10,e.name.value);x&&c.fragmentMatches(x,u)&&x.selectionSet.selections.forEach(y.add,y)}});var v={result:(0,b.IM)(d),missing:a},x=o.canonizeResults?this.canon.admit(v):(0,S.G)(v);return x.result&&this.knownResults.set(x.result,i),x},e.prototype.execSubSelectedArrayImpl=function(e){var t,i=this,n=e.field,r=e.array,o=e.enclosingRef,a=e.context,l=new b.ZI;function c(e,i){var n;return e.missing&&(t=l.merge(t,((n={})[i]=e.missing,n))),e.result}return n.selectionSet&&(r=r.filter(a.store.canRead)),r=r.map(function(e,t){return null===e?null:(0,F.c)(e)?c(i.executeSubSelectedArray({field:n,array:e,enclosingRef:o,context:a}),t):n.selectionSet?c(i.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:e,enclosingRef:(0,g.A_)(e)?e:o,context:a}),t):(!1!==globalThis.__DEV__&&function(e,t,i){if(!t.selectionSet){var n=new Set([i]);n.forEach(function(i){(0,x.U)(i)&&((0,s.V1)(!(0,g.A_)(i),11,(0,A.Ui)(e,i),t.name.value),Object.values(i).forEach(n.add,n))})}}(a.store,n,e),e)}),{result:a.canonizeResults?this.canon.admit(r):r,missing:t}},e}();function H(e){try{JSON.stringify(e,function(e,t){if("string"==typeof t)throw t;return t})}catch(e){return e}}var U=i(10683),z=i(58462),W=i(23630),j=Object.create(null);function $(e){var t=JSON.stringify(e);return j[t]||(j[t]=Object.create(null))}function K(e){var t=$(e);return t.keyFieldsFn||(t.keyFieldsFn=function(t,i){var n=function(e,t){return i.readField(t,e)},r=i.keyObject=q(e,function(e){var r=Q(i.storeObject,e,n);return void 0===r&&t!==i.storeObject&&A.$3.call(t,e[0])&&(r=Q(t,e,Z)),(0,s.V1)(void 0!==r,5,e.join("."),t),r});return"".concat(i.typename,":").concat(JSON.stringify(r))})}function Y(e){var t=$(e);return t.keyArgsFn||(t.keyArgsFn=function(t,i){var n=i.field,s=i.variables,r=i.fieldName,o=q(e,function(e){var i=e[0],r=i.charAt(0);if("@"!==r)if("$"!==r){if(t)return Q(t,e)}else{var o=i.slice(1);if(s&&A.$3.call(s,o)){var a=e.slice(0);return a[0]=o,Q(s,a)}}else if(n&&(0,F.E)(n.directives)){var l=i.slice(1),c=n.directives.find(function(e){return e.name.value===l}),h=c&&(0,g.MB)(c,s);return h&&Q(h,e.slice(1))}}),a=JSON.stringify(o);return(t||"{}"!==a)&&(r+=":"+a),r})}function q(e,t){var i=new b.ZI;return X(e).reduce(function(e,n){var s,r=t(n);if(void 0!==r){for(var o=n.length-1;o>=0;--o)(s={})[n[o]]=r,r=s;e=i.merge(e,r)}return e},Object.create(null))}function X(e){var t=$(e);if(!t.paths){var i=t.paths=[],n=[];e.forEach(function(t,s){(0,F.c)(t)?(X(t).forEach(function(e){return i.push(n.concat(e))}),n.length=0):(n.push(t),(0,F.c)(e[s+1])||(i.push(n.slice(0)),n.length=0))})}return t.paths}function Z(e,t){return e[t]}function Q(e,t,i){return i=i||Z,J(t.reduce(function e(t,n){return(0,F.c)(t)?t.map(function(t){return e(t,n)}):t&&i(t,n)},e))}function J(e){return(0,x.U)(e)?(0,F.c)(e)?e.map(J):q(Object.keys(e).sort(),function(t){return Q(e,t)}):e}var ee=i(98453);function te(e){return void 0!==e.args?e.args:e.field?(0,g.MB)(e.field,e.variables):null}var ie=function(){},ne=function(e,t){return t.fieldName},se=function(e,t,i){return(0,i.mergeObjects)(e,t)},re=function(e,t){return t},oe=function(){function e(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=(0,n.__assign)({dataIdFromObject:A.or},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return e.prototype.identify=function(e,t){var i,s=this,r=t&&(t.typename||(null===(i=t.storeObject)||void 0===i?void 0:i.__typename))||e.__typename;if(r===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];var o,a=t&&t.storeObject||e,l=(0,n.__assign)((0,n.__assign)({},t),{typename:r,storeObject:a,readField:t&&t.readField||function(){var e=le(arguments,a);return s.readField(e,{store:s.cache.data,variables:e.variables})}}),c=r&&this.getTypePolicy(r),h=c&&c.keyFn||this.config.dataIdFromObject;return ee.yV.withValue(!0,function(){for(;h;){var t=h((0,n.__assign)((0,n.__assign)({},e),a),l);if(!(0,F.c)(t)){o=t;break}h=K(t)}}),o=o?String(o):void 0,l.keyObject?[o,l.keyObject]:[o]},e.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach(function(i){var s=e[i],r=s.queryType,o=s.mutationType,a=s.subscriptionType,l=(0,n.__rest)(s,["queryType","mutationType","subscriptionType"]);r&&t.setRootTypename("Query",i),o&&t.setRootTypename("Mutation",i),a&&t.setRootTypename("Subscription",i),A.$3.call(t.toBeAdded,i)?t.toBeAdded[i].push(l):t.toBeAdded[i]=[l]})},e.prototype.updateTypePolicy=function(e,t,i){var n=this.getTypePolicy(e),s=t.keyFields,r=t.fields;function o(e,t){e.merge="function"==typeof t?t:!0===t?se:!1===t?re:e.merge}o(n,t.merge),n.keyFn=!1===s?ie:(0,F.c)(s)?K(s):"function"==typeof s?s:n.keyFn,r&&Object.keys(r).forEach(function(t){var n=i[t];n&&(null==n?void 0:n.typename)===e||(n=i[t]={typename:e});var s=r[t];if("function"==typeof s)n.read=s;else{var a=s.keyArgs,l=s.read,c=s.merge;n.keyFn=!1===a?ne:(0,F.c)(a)?Y(a):"function"==typeof a?a:n.keyFn,"function"==typeof l&&(n.read=l),o(n,c)}n.read&&n.merge&&(n.keyFn=n.keyFn||ne)})},e.prototype.setRootTypename=function(e,t){void 0===t&&(t=e);var i="ROOT_"+e.toUpperCase(),n=this.rootTypenamesById[i];t!==n&&((0,s.V1)(!n||n===e,6,e),n&&delete this.rootIdsByTypename[n],this.rootIdsByTypename[t]=i,this.rootTypenamesById[i]=t)},e.prototype.addPossibleTypes=function(e){var t=this;this.usingPossibleTypes=!0,Object.keys(e).forEach(function(i){t.getSupertypeSet(i,!0),e[i].forEach(function(e){t.getSupertypeSet(e,!0).add(i);var n=e.match(A.gk);n&&n[0]===e||t.fuzzySubtypes.set(e,new RegExp(e))})})},e.prototype.getTypePolicy=function(e){var t=this;if(!A.$3.call(this.typePolicies,e)){var i=this.typePolicies[e]=Object.create(null);i.fields=Object.create(null);var s=this.supertypeMap.get(e);!s&&this.fuzzySubtypes.size&&(s=this.getSupertypeSet(e,!0),this.fuzzySubtypes.forEach(function(i,n){if(i.test(e)){var r=t.supertypeMap.get(n);r&&r.forEach(function(e){return s.add(e)})}})),s&&s.size&&s.forEach(function(e){var s=t.getTypePolicy(e),r=s.fields,o=(0,n.__rest)(s,["fields"]);Object.assign(i,o),Object.assign(i.fields,r)})}var r=this.toBeAdded[e];return r&&r.length&&r.splice(0).forEach(function(i){t.updateTypePolicy(e,i,t.typePolicies[e].fields)}),this.typePolicies[e]},e.prototype.getFieldPolicy=function(e,t){if(e)return this.getTypePolicy(e).fields[t]},e.prototype.getSupertypeSet=function(e,t){var i=this.supertypeMap.get(e);return!i&&t&&this.supertypeMap.set(e,i=new Set),i},e.prototype.fragmentMatches=function(e,t,i,n){var r=this;if(!e.typeCondition)return!0;if(!t)return!1;var o=e.typeCondition.name.value;if(t===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var a=this.getSupertypeSet(t,!0),l=[a],c=function(e){var t=r.getSupertypeSet(e,!1);t&&t.size&&l.indexOf(t)<0&&l.push(t)},h=!(!i||!this.fuzzySubtypes.size),u=!1,d=0;d<l.length;++d){var p=l[d];if(p.has(o))return a.has(o)||(u&&!1!==globalThis.__DEV__&&s.V1.warn(7,t,o),a.add(o)),!0;p.forEach(c),h&&d===l.length-1&&(0,A.T9)(e.selectionSet,i,n)&&(h=!1,u=!0,this.fuzzySubtypes.forEach(function(e,i){var n=t.match(e);n&&n[0]===t&&c(i)}))}return!1},e.prototype.hasKeyArgs=function(e,t){var i=this.getFieldPolicy(e,t);return!(!i||!i.keyFn)},e.prototype.getStoreFieldName=function(e){var t,i=e.typename,n=e.fieldName,s=this.getFieldPolicy(i,n),r=s&&s.keyFn;if(r&&i)for(var o={typename:i,fieldName:n,field:e.field||null,variables:e.variables},a=te(e);r;){var l=r(a,o);if(!(0,F.c)(l)){t=l||n;break}r=Y(l)}return void 0===t&&(t=e.field?(0,g.Ii)(e.field,e.variables):(0,g.o5)(n,te(e))),!1===t?n:n===(0,A.iJ)(t)?t:n+":"+t},e.prototype.readField=function(e,t){var i=e.from;if(i&&(e.field||e.fieldName)){if(void 0===e.typename){var n=t.store.getFieldValue(i,"__typename");n&&(e.typename=n)}var s=this.getStoreFieldName(e),r=(0,A.iJ)(s),o=t.store.getFieldValue(i,s),a=this.getFieldPolicy(e.typename,r),l=a&&a.read;if(l){var c=ae(this,i,e,t,t.store.getStorage((0,g.A_)(i)?i.__ref:i,s));return W.bl.withValue(this.cache,l,[o,c])}return o}},e.prototype.getReadFunction=function(e,t){var i=this.getFieldPolicy(e,t);return i&&i.read},e.prototype.getMergeFunction=function(e,t,i){var n=this.getFieldPolicy(e,t),s=n&&n.merge;return!s&&i&&(s=(n=this.getTypePolicy(i))&&n.merge),s},e.prototype.runMergeFunction=function(e,t,i,n,s){var r=i.field,o=i.typename,a=i.merge;return a===se?ce(n.store)(e,t):a===re?t:(n.overwrite&&(e=void 0),a(e,t,ae(this,void 0,{typename:o,fieldName:r.name.value,field:r,variables:n.variables},n,s||Object.create(null))))},e}();function ae(e,t,i,n,s){var r=e.getStoreFieldName(i),o=(0,A.iJ)(r),a=i.variables||n.variables,l=n.store,c=l.toReference,h=l.canRead;return{args:te(i),field:i.field||null,fieldName:o,storeFieldName:r,variables:a,isReference:g.A_,toReference:c,storage:s,cache:e.cache,canRead:h,readField:function(){return e.readField(le(arguments,t,a),n)},mergeObjects:ce(n.store)}}function le(e,t,i){var r,o=e[0],a=e[1],l=e.length;return"string"==typeof o?r={fieldName:o,from:l>1?a:t}:(r=(0,n.__assign)({},o),A.$3.call(r,"from")||(r.from=t)),!1!==globalThis.__DEV__&&void 0===r.from&&!1!==globalThis.__DEV__&&s.V1.warn(8,(0,z.p)(Array.from(e))),void 0===r.variables&&(r.variables=i),r}function ce(e){return function(t,i){if((0,F.c)(t)||(0,F.c)(i))throw(0,s.vA)(9);if((0,x.U)(t)&&(0,x.U)(i)){var r=e.getFieldValue(t,"__typename"),o=e.getFieldValue(i,"__typename");if(r&&o&&r!==o)return i;if((0,g.A_)(t)&&(0,A.d1)(i))return e.merge(t.__ref,i),t;if((0,A.d1)(t)&&(0,g.A_)(i))return e.merge(t,i.__ref),i;if((0,A.d1)(t)&&(0,A.d1)(i))return(0,n.__assign)((0,n.__assign)({},t),i)}return i}}function he(e,t,i){var s="".concat(t).concat(i),r=e.flavors.get(s);return r||e.flavors.set(s,r=e.clientOnly===t&&e.deferred===i?e:(0,n.__assign)((0,n.__assign)({},e),{clientOnly:t,deferred:i})),r}var ue=function(){function e(e,t,i){this.cache=e,this.reader=t,this.fragments=i}return e.prototype.writeToStore=function(e,t){var i=this,r=t.query,a=t.result,l=t.dataId,c=t.variables,h=t.overwrite,u=(0,v.Vu)(r),p=(0,A.mv)();c=(0,n.__assign)((0,n.__assign)({},(0,v.wY)(u)),c);var f=(0,n.__assign)((0,n.__assign)({store:e,written:Object.create(null),merge:function(e,t){return p.merge(e,t)},variables:c,varString:(0,d.M)(c)},(0,A.lq)(r,this.fragments)),{overwrite:!!h,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),m=this.processSelectionSet({result:a||Object.create(null),dataId:l,selectionSet:u.selectionSet,mergeTree:{map:new Map},context:f});if(!(0,g.A_)(m))throw(0,s.vA)(12,a);return f.incomingById.forEach(function(t,r){var a=t.storeObject,l=t.mergeTree,c=t.fieldNodeSet,h=(0,g.WU)(r);if(l&&l.map.size){var u=i.applyMerges(l,h,a,f);if((0,g.A_)(u))return;a=u}if(!1!==globalThis.__DEV__&&!f.overwrite){var d=Object.create(null);c.forEach(function(e){e.selectionSet&&(d[e.name.value]=!0)}),Object.keys(a).forEach(function(e){(function(e){return!0===d[(0,A.iJ)(e)]})(e)&&!function(e){var t=l&&l.map.get(e);return Boolean(t&&t.info&&t.info.merge)}(e)&&function(e,t,i,r){var a=function(e){var t=r.getFieldValue(e,i);return"object"==typeof t&&t},l=a(e);if(l){var c=a(t);if(c&&!(0,g.A_)(l)&&!(0,o.L)(l,c)&&!Object.keys(l).every(function(e){return void 0!==r.getFieldValue(c,e)})){var h=r.getFieldValue(e,"__typename")||r.getFieldValue(t,"__typename"),u=(0,A.iJ)(i),d="".concat(h,".").concat(u);if(!ye.has(d)){ye.add(d);var p=[];(0,F.c)(l)||(0,F.c)(c)||[l,c].forEach(function(e){var t=r.getFieldValue(e,"__typename");"string"!=typeof t||p.includes(t)||p.push(t)}),!1!==globalThis.__DEV__&&s.V1.warn(15,u,h,p.length?"either ensure all objects of type "+p.join(" and ")+" have an ID or a custom merge function, or ":"",d,(0,n.__assign)({},l),(0,n.__assign)({},c))}}}}(h,a,e,f.store)})}e.merge(r,a)}),e.retain(m.__ref),m},e.prototype.processSelectionSet=function(e){var t=this,i=e.dataId,r=e.result,o=e.selectionSet,a=e.context,l=e.mergeTree,c=this.cache.policies,u=Object.create(null),d=i&&c.rootTypenamesById[i]||(0,g.D$)(r,o,a.fragmentMap)||i&&a.store.get(i,"__typename");"string"==typeof d&&(u.__typename=d);var p=function(){var e=le(arguments,u,a.variables);if((0,g.A_)(e.from)){var t=a.incomingById.get(e.from.__ref);if(t){var i=c.readField((0,n.__assign)((0,n.__assign)({},e),{from:t.storeObject}),a);if(void 0!==i)return i}}return c.readField(e,a)},f=new Set;this.flattenFields(o,r,a,d).forEach(function(e,i){var n,o=(0,g.ue)(i),a=r[o];if(f.add(i),void 0!==a){var m=c.getStoreFieldName({typename:d,fieldName:i.name.value,field:i,variables:e.variables}),y=pe(l,m),v=t.processFieldValue(a,i,i.selectionSet?he(e,!1,!1):e,y),b=void 0;i.selectionSet&&((0,g.A_)(v)||(0,A.d1)(v))&&(b=p("__typename",v));var C=c.getMergeFunction(d,i.name.value,b);C?y.info={field:i,typename:d,merge:C}:me(l,m),u=e.merge(u,((n={})[m]=v,n))}else!1===globalThis.__DEV__||e.clientOnly||e.deferred||h.XY.added(i)||c.getReadFunction(d,i.name.value)||!1!==globalThis.__DEV__&&s.V1.error(13,(0,g.ue)(i),r)});try{var m=c.identify(r,{typename:d,selectionSet:o,fragmentMap:a.fragmentMap,storeObject:u,readField:p}),y=m[0],v=m[1];i=i||y,v&&(u=a.merge(u,v))}catch(e){if(!i)throw e}if("string"==typeof i){var b=(0,g.WU)(i),C=a.written[i]||(a.written[i]=[]);if(C.indexOf(o)>=0)return b;if(C.push(o),this.reader&&this.reader.isFresh(r,b,o,a))return b;var w=a.incomingById.get(i);return w?(w.storeObject=a.merge(w.storeObject,u),w.mergeTree=ge(w.mergeTree,l),f.forEach(function(e){return w.fieldNodeSet.add(e)})):a.incomingById.set(i,{storeObject:u,mergeTree:fe(l)?void 0:l,fieldNodeSet:f}),b}return u},e.prototype.processFieldValue=function(e,t,i,n){var s=this;return t.selectionSet&&null!==e?(0,F.c)(e)?e.map(function(e,r){var o=s.processFieldValue(e,t,i,pe(n,r));return me(n,r),o}):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:i,mergeTree:n}):!1!==globalThis.__DEV__?(0,U.m)(e):e},e.prototype.flattenFields=function(e,t,i,n){void 0===n&&(n=(0,g.D$)(t,e,i.fragmentMap));var r=new Map,o=this.cache.policies,a=new E.b(!1);return function e(l,c){var h=a.lookup(l,c.clientOnly,c.deferred);h.visited||(h.visited=!0,l.selections.forEach(function(a){if((0,C.MS)(a,i.variables)){var l=c.clientOnly,h=c.deferred;if(l&&h||!(0,F.E)(a.directives)||a.directives.forEach(function(e){var t=e.name.value;if("client"===t&&(l=!0),"defer"===t){var n=(0,g.MB)(e,i.variables);n&&!1===n.if||(h=!0)}}),(0,g.dt)(a)){var u=r.get(a);u&&(l=l&&u.clientOnly,h=h&&u.deferred),r.set(a,he(i,l,h))}else{var d=(0,w.HQ)(a,i.lookupFragment);if(!d&&a.kind===f.b.FRAGMENT_SPREAD)throw(0,s.vA)(14,a.name.value);d&&o.fragmentMatches(d,n,t,i.variables)&&e(d.selectionSet,he(i,l,h))}}}))}(e,i),r},e.prototype.applyMerges=function(e,t,i,r,o){var a,l=this;if(e.map.size&&!(0,g.A_)(i)){var c,h=(0,F.c)(i)||!(0,g.A_)(t)&&!(0,A.d1)(t)?void 0:t,u=i;h&&!o&&(o=[(0,g.A_)(h)?h.__ref:h]);var d=function(e,t){return(0,F.c)(e)?"number"==typeof t?e[t]:void 0:r.store.getFieldValue(e,String(t))};e.map.forEach(function(e,t){var i=d(h,t),n=d(u,t);if(void 0!==n){o&&o.push(t);var a=l.applyMerges(e,i,n,r,o);a!==n&&(c=c||new Map).set(t,a),o&&(0,s.V1)(o.pop()===t)}}),c&&(i=(0,F.c)(u)?u.slice(0):(0,n.__assign)({},u),c.forEach(function(e,t){i[t]=e}))}return e.info?this.cache.policies.runMergeFunction(t,i,e.info,r,o&&(a=r.store).getStorage.apply(a,o)):i},e}(),de=[];function pe(e,t){var i=e.map;return i.has(t)||i.set(t,de.pop()||{map:new Map}),i.get(t)}function ge(e,t){if(e===t||!t||fe(t))return e;if(!e||fe(e))return t;var i=e.info&&t.info?(0,n.__assign)((0,n.__assign)({},e.info),t.info):e.info||t.info,s=e.map.size&&t.map.size,r={info:i,map:s?new Map:e.map.size?e.map:t.map};if(s){var o=new Set(t.map.keys());e.map.forEach(function(e,i){r.map.set(i,ge(e,t.map.get(i))),o.delete(i)}),o.forEach(function(i){r.map.set(i,ge(t.map.get(i),e.map.get(i)))})}return r}function fe(e){return!e||!(e.info||e.map.size)}function me(e,t){var i=e.map,n=i.get(t);n&&fe(n)&&(de.push(n),i.delete(t))}var ye=new Set,ve=i(97023),be=i(23549),Ce=function(e){function t(t){void 0===t&&(t={});var i=e.call(this)||this;return i.watches=new Set,i.addTypenameTransform=new c.c(h.XY),i.assumeImmutableResults=!0,i.makeVar=W.UT,i.txCount=0,!1!==globalThis.__DEV__&&((0,be.cc)(t,"addTypename","InMemoryCache","Please remove the `addTypename` option when initializing `InMemoryCache`."),(0,be.cc)(t,"canonizeResults","InMemoryCache","Please remove the `canonizeResults` option when initializing `InMemoryCache`.")),i.config=(0,A.I6)(t),i.addTypename=!!i.config.addTypename,i.policies=new oe({cache:i,dataIdFromObject:i.config.dataIdFromObject,possibleTypes:i.config.possibleTypes,typePolicies:i.config.typePolicies}),i.init(),i}return(0,n.__extends)(t,e),t.prototype.init=function(){var e=this.data=new I.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=e.stump,this.resetResultCache()},t.prototype.resetResultCache=function(e){var t=this,i=this.storeReader,n=this.config.fragments;this.addTypenameTransform.resetCache(),null==n||n.resetCaches(),this.storeWriter=new ue(this,this.storeReader=new V({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:(0,A.Xx)(this.config),canon:e?void 0:i&&i.canon,fragments:n}),n),this.maybeBroadcastWatch=(0,r.LV)(function(e,i){return t.broadcastWatch(e,i)},{max:this.config.resultCacheMaxSize||u.v["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:function(e){var i=e.optimistic?t.optimisticData:t.data;if(O(i)){var n=e.optimistic,s=e.id,r=e.variables;return i.makeCacheKey(e.query,e.callback,(0,d.M)({optimistic:n,id:s,variables:r}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(function(e){return e.resetCaching()})},t.prototype.restore=function(e){return this.init(),e&&this.data.replace(e),this},t.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).extract()},t.prototype.read=function(e){!1!==globalThis.__DEV__&&(0,be.cc)(e,"canonizeResults","cache.read");var t=e.returnPartialData,i=void 0!==t&&t;try{return this.storeReader.diffQueryAgainstStore((0,n.__assign)((0,n.__assign)({},e),{store:e.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:i})).result||null}catch(e){if(e instanceof l.Z)return null;throw e}},t.prototype.write=function(e){try{return++this.txCount,this.storeWriter.writeToStore(this.data,e)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.modify=function(e){if(A.$3.call(e,"id")&&!e.id)return!1;var t=e.optimistic?this.optimisticData:this.data;try{return++this.txCount,t.modify(e.id||"ROOT_QUERY",e.fields)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.diff=function(e){return!1!==globalThis.__DEV__&&(0,be.cc)(e,"canonizeResults","cache.diff"),this.storeReader.diffQueryAgainstStore((0,n.__assign)((0,n.__assign)({},e),{store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",config:this.config}))},t.prototype.watch=function(e){var t=this;return this.watches.size||(0,W.MS)(this),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),function(){t.watches.delete(e)&&!t.watches.size&&(0,W.WR)(t),t.maybeBroadcastWatch.forget(e)}},t.prototype.gc=function(e){!1!==globalThis.__DEV__&&(0,be.cc)(e||{},"resetResultIdentities","cache.gc","First ensure all usages of `canonizeResults` are removed, then remove this option."),d.M.reset(),p.y.reset();var t=this.optimisticData.gc();return e&&!this.txCount&&(e.resetResultCache?this.resetResultCache(e.resetResultIdentities):e.resetResultIdentities&&this.storeReader.resetCanon()),t},t.prototype.retain=function(e,t){return(t?this.optimisticData:this.data).retain(e)},t.prototype.release=function(e,t){return(t?this.optimisticData:this.data).release(e)},t.prototype.identify=function(e){if((0,g.A_)(e))return e.__ref;try{return this.policies.identify(e)[0]}catch(e){!1!==globalThis.__DEV__&&s.V1.warn(e)}},t.prototype.evict=function(e){if(!e.id){if(A.$3.call(e,"id"))return!1;e=(0,n.__assign)((0,n.__assign)({},e),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(e,this.data)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.reset=function(e){var t=this;return this.init(),d.M.reset(),e&&e.discardWatches?(this.watches.forEach(function(e){return t.maybeBroadcastWatch.forget(e)}),this.watches.clear(),(0,W.WR)(this)):this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(e){var t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())},t.prototype.batch=function(e){var t,i=this,s=e.update,r=e.optimistic,o=void 0===r||r,a=e.removeOptimistic,l=e.onWatchUpdated,c=function(e){var n=i,r=n.data,o=n.optimisticData;++i.txCount,e&&(i.data=i.optimisticData=e);try{return t=s(i)}finally{--i.txCount,i.data=r,i.optimisticData=o}},h=new Set;return l&&!this.txCount&&this.broadcastWatches((0,n.__assign)((0,n.__assign)({},e),{onWatchUpdated:function(e){return h.add(e),!1}})),"string"==typeof o?this.optimisticData=this.optimisticData.addLayer(o,c):!1===o?c(this.data):c(),"string"==typeof a&&(this.optimisticData=this.optimisticData.removeLayer(a)),l&&h.size?(this.broadcastWatches((0,n.__assign)((0,n.__assign)({},e),{onWatchUpdated:function(e,t){var i=l.call(this,e,t);return!1!==i&&h.delete(e),i}})),h.size&&h.forEach(function(e){return i.maybeBroadcastWatch.dirty(e)})):this.broadcastWatches(e),t},t.prototype.performTransaction=function(e,t){return this.batch({update:e,optimistic:t||null!==t})},t.prototype.transformDocument=function(e){return this.addTypenameToDocument(this.addFragmentsToDocument(e))},t.prototype.fragmentMatches=function(e,t){return this.policies.fragmentMatches(e,t)},t.prototype.lookupFragment=function(e){var t;return(null===(t=this.config.fragments)||void 0===t?void 0:t.lookup(e))||null},t.prototype.broadcastWatches=function(e){var t=this;this.txCount||this.watches.forEach(function(i){return t.maybeBroadcastWatch(i,e)})},t.prototype.addFragmentsToDocument=function(e){var t=this.config.fragments;return t?t.transform(e):e},t.prototype.addTypenameToDocument=function(e){return this.addTypename?this.addTypenameTransform.transformDocument(e):e},t.prototype.broadcastWatch=function(e,t){var i=this,n=e.lastDiff,s=(0,be.lz)("canonizeResults",function(){return i.diff(e)});t&&(e.optimistic&&"string"==typeof t.optimistic&&(s.fromOptimisticTransaction=!0),t.onWatchUpdated&&!1===t.onWatchUpdated.call(this,e,s,n))||n&&(0,o.L)(n.result,s.result)||e.callback(e.lastDiff=s,n)},t}(a.k);!1!==globalThis.__DEV__&&(Ce.prototype.getMemoryInternals=ve.cM)},23630(e,t,i){"use strict";i.d(t,{MS:()=>l,UT:()=>c,WR:()=>a,bl:()=>s});var n=i(1645),s=new n.DX,r=new WeakMap;function o(e){var t=r.get(e);return t||r.set(e,t={vars:new Set,dep:(0,n.yN)()}),t}function a(e){o(e).vars.forEach(function(t){return t.forgetCache(e)})}function l(e){o(e).vars.forEach(function(t){return t.attachCache(e)})}function c(e){var t=new Set,i=new Set,n=function(a){if(arguments.length>0){if(e!==a){e=a,t.forEach(function(e){o(e).dep.dirty(n),function(e){e.broadcastWatches&&e.broadcastWatches()}(e)});var l=Array.from(i);i.clear(),l.forEach(function(t){return t(e)})}}else{var c=s.getValue();c&&(r(c),o(c).dep(n))}return e};n.onNextChange=function(e){return i.add(e),function(){i.delete(e)}};var r=n.attachCache=function(e){return t.add(e),o(e).vars.add(n),n};return n.forgetCache=function(e){return t.delete(e)},n}},36598(e,t,i){"use strict";i.d(t,{R:()=>Q});var n=i(65959),s=i(85923),r=i(33976),o=i(95197),a=i(31095),l=i(69861),c=i(45063),h=i(11177),u=i(77822),d=i(49666),p=i(87819),g=i(87713),f=i(29957),m=i(74855),y=i(931),v=i(24568),b=i(73476),C=i(77038),w=i(83724),S=i(31878),x=i(74140),E=i(98590),A=i(62199),M=i(42248),T=i(28299),D=i(34222),I=i(51975),R=i(23549),k=new(I.et?WeakMap:Map);function P(e,t){var i=e[t];"function"==typeof i&&(e[t]=function(){return k.set(e,(k.get(e)+1)%1e15),i.apply(this,arguments)})}var _=function(){function e(e,t){void 0===t&&(t=e.generateQueryId()),this.queryId=t,this.document=null,this.lastRequestId=1,this.stopped=!1,this.observableQuery=null;var i=this.cache=e.cache;k.has(i)||(k.set(i,0),P(i,"evict"),P(i,"modify"),P(i,"reset"))}return e.prototype.init=function(e){var t=e.networkStatus||T.pT.loading;return this.variables&&this.networkStatus!==T.pT.loading&&!(0,c.L)(this.variables,e.variables)&&(t=T.pT.setVariables),(0,c.L)(e.variables,this.variables)||(this.lastDiff=void 0,this.cancel()),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:t}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},e.prototype.resetDiff=function(){this.lastDiff=void 0},e.prototype.getDiff=function(){var e=this,t=this.getDiffOptions();if(this.lastDiff&&(0,c.L)(t,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables);var i=this.observableQuery;if(i&&"no-cache"===i.options.fetchPolicy)return{complete:!1};var n=(0,R.lz)("canonizeResults",function(){return e.cache.diff(t)});return this.updateLastDiff(n,t),n},e.prototype.updateLastDiff=function(e,t){this.lastDiff=e?{diff:e,options:t||this.getDiffOptions()}:void 0},e.prototype.getDiffOptions=function(e){var t;return void 0===e&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:null===(t=this.observableQuery)||void 0===t?void 0:t.options.canonizeResults}},e.prototype.setDiff=function(e){var t,i=this,n=this.lastDiff&&this.lastDiff.diff;e&&!e.complete&&(0,R.lz)("getLastError",function(){var e;return null===(e=i.observableQuery)||void 0===e?void 0:e.getLastError()})||(this.updateLastDiff(e),(0,c.L)(n&&n.result,e&&e.result)||null===(t=this.observableQuery)||void 0===t||t.scheduleNotify())},e.prototype.setObservableQuery=function(e){e!==this.observableQuery&&(this.observableQuery=e,e&&(e.queryInfo=this))},e.prototype.stop=function(){var e;if(!this.stopped){this.stopped=!0,null===(e=this.observableQuery)||void 0===e||e.resetNotifications(),this.cancel();var t=this.observableQuery;t&&t.stopPolling()}},e.prototype.cancel=function(){var e;null===(e=this.cancelWatch)||void 0===e||e.call(this),this.cancelWatch=void 0},e.prototype.updateWatch=function(e){var t=this;void 0===e&&(e=this.variables);var i=this.observableQuery;if(!i||"no-cache"!==i.options.fetchPolicy){var s=(0,n.__assign)((0,n.__assign)({},this.getDiffOptions(e)),{watcher:this,callback:function(e){return t.setDiff(e)}});this.lastWatch&&(0,c.L)(s,this.lastWatch)||(this.cancel(),this.cancelWatch=this.cache.watch(this.lastWatch=s))}},e.prototype.resetLastWrite=function(){this.lastWrite=void 0},e.prototype.shouldWrite=function(e,t){var i=this.lastWrite;return!(i&&i.dmCount===k.get(this.cache)&&(0,c.L)(t,i.variables)&&(0,c.L)(e.data,i.result.data))},e.prototype.markResult=function(e,t,i,n){var s,r=this,o=new D.ZI,a=(0,v.E)(e.errors)?e.errors.slice(0):[];if(null===(s=this.observableQuery)||void 0===s||s.resetNotifications(),"incremental"in e&&(0,v.E)(e.incremental)){var l=(0,h.bd)(this.getDiff().result,e);e.data=l}else if("hasNext"in e&&e.hasNext){var u=this.getDiff();e.data=o.merge(u.result,e.data)}this.graphQLErrors=a,"no-cache"===i.fetchPolicy?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(i.variables)):0!==n&&(L(e,i.errorPolicy)?this.cache.performTransaction(function(s){if(r.shouldWrite(e,i.variables))s.writeQuery({query:t,data:e.data,variables:i.variables,overwrite:1===n}),r.lastWrite={result:e,variables:i.variables,dmCount:k.get(r.cache)};else if(r.lastDiff&&r.lastDiff.diff.complete)return void(e.data=r.lastDiff.diff.result);var o=r.getDiffOptions(i.variables),a=(0,R.lz)("canonizeResults",function(){return s.diff(o)});!r.stopped&&(0,c.L)(r.variables,i.variables)&&r.updateWatch(i.variables),r.updateLastDiff(a,o),a.complete&&(e.data=a.result)}):this.lastWrite=void 0)},e.prototype.markReady=function(){return this.networkError=null,this.networkStatus=T.pT.ready},e.prototype.markError=function(e){var t;return this.networkStatus=T.pT.error,this.lastWrite=void 0,null===(t=this.observableQuery)||void 0===t||t.resetNotifications(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},e}();function L(e,t){void 0===t&&(t="none");var i="ignore"===t||"all"===t,n=!(0,y.t)(e);return!n&&i&&e.data&&(n=!0),n}var N=i(84305),O=i(69796),F=i(41171),G=i(48448),B=i(207),V=i(98453),H=i(67558),U=Object.prototype.hasOwnProperty,z=Object.create(null),W=function(){function e(e){var t=this;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new F.A(G.v["queryManager.getDocumentInfo"]||2e3),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new O.b(!1),this.noCacheWarningsByQueryId=new Set;var i=new f.c(function(e){return t.cache.transformDocument(e)},{cache:!1});this.cache=e.cache,this.link=e.link,this.defaultOptions=e.defaultOptions,this.queryDeduplication=e.queryDeduplication,this.clientAwareness=e.clientAwareness,this.localState=e.localState,this.ssrMode=e.ssrMode,this.assumeImmutableResults=e.assumeImmutableResults,this.dataMasking=e.dataMasking;var n=e.documentTransform;this.documentTransform=n?i.concat(n).concat(i):i,this.defaultContext=e.defaultContext||Object.create(null),(this.onBroadcast=e.onBroadcast)&&(this.mutationStore=Object.create(null))}return e.prototype.stop=function(){var e=this;this.queries.forEach(function(t,i){e.stopQueryNoBroadcast(i)}),this.cancelPendingFetches((0,s.vA)(35))},e.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach(function(t){return t(e)}),this.fetchCancelFns.clear()},e.prototype.mutate=function(e){return(0,n.__awaiter)(this,arguments,void 0,function(e){var t,i,r,o,a,l,c,h=e.mutation,u=e.variables,d=e.optimisticResponse,p=e.updateQueries,g=e.refetchQueries,f=void 0===g?[]:g,v=e.awaitRefetchQueries,b=void 0!==v&&v,C=e.update,w=e.onQueryUpdated,S=e.fetchPolicy,x=void 0===S?(null===(l=this.defaultOptions.mutate)||void 0===l?void 0:l.fetchPolicy)||"network-only":S,E=e.errorPolicy,M=void 0===E?(null===(c=this.defaultOptions.mutate)||void 0===c?void 0:c.errorPolicy)||"none":E,T=e.keepRootFields,D=e.context;return(0,n.__generator)(this,function(e){switch(e.label){case 0:return(0,s.V1)(h,36),(0,s.V1)("network-only"===x||"no-cache"===x,37),t=this.generateMutationId(),h=this.cache.transformForLink(this.transform(h)),i=this.getDocumentInfo(h).hasClientExports,u=this.getVariables(h,u),i?[4,this.localState.addExportedVariables(h,u,D)]:[3,2];case 1:u=e.sent(),e.label=2;case 2:return r=this.mutationStore&&(this.mutationStore[t]={mutation:h,variables:u,loading:!0,error:null}),o=d&&this.markMutationOptimistic(d,{mutationId:t,document:h,variables:u,fetchPolicy:x,errorPolicy:M,context:D,updateQueries:p,update:C,keepRootFields:T}),this.broadcastQueries(),a=this,[2,new Promise(function(e,i){return(0,m.x)(a.getObservableFromLink(h,(0,n.__assign)((0,n.__assign)({},D),{optimisticResponse:o?d:void 0}),u,{},!1),function(e){if((0,y.t)(e)&&"none"===M)throw new A.K4({graphQLErrors:(0,y.M)(e)});r&&(r.loading=!1,r.error=null);var i=(0,n.__assign)({},e);return"function"==typeof f&&(f=f(i)),"ignore"===M&&(0,y.t)(i)&&delete i.errors,a.markMutationResult({mutationId:t,result:i,document:h,variables:u,fetchPolicy:x,errorPolicy:M,context:D,update:C,updateQueries:p,awaitRefetchQueries:b,refetchQueries:f,removeOptimistic:o?t:void 0,onQueryUpdated:w,keepRootFields:T})}).subscribe({next:function(i){a.broadcastQueries(),"hasNext"in i&&!1!==i.hasNext||e((0,n.__assign)((0,n.__assign)({},i),{data:a.maskOperation({document:h,data:i.data,fetchPolicy:x,id:t})}))},error:function(e){r&&(r.loading=!1,r.error=e),o&&a.cache.removeOptimistic(t),a.broadcastQueries(),i(e instanceof A.K4?e:new A.K4({networkError:e}))}})})]}})})},e.prototype.markMutationResult=function(e,t){var i=this;void 0===t&&(t=this.cache);var s=e.result,r=[],o="no-cache"===e.fetchPolicy;if(!o&&L(s,e.errorPolicy)){if((0,h.ST)(s)||r.push({result:s.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),(0,h.ST)(s)&&(0,v.E)(s.incremental)){var a=t.diff({id:"ROOT_MUTATION",query:this.getDocumentInfo(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),l=void 0;a.result&&(l=(0,h.bd)(a.result,s)),void 0!==l&&(s.data=l,r.push({result:l,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var c=e.updateQueries;c&&this.queries.forEach(function(e,n){var o=e.observableQuery,a=o&&o.queryName;if(a&&U.call(c,a)){var l=c[a],h=i.queries.get(n),u=h.document,d=h.variables,p=t.diff({query:u,variables:d,returnPartialData:!0,optimistic:!1}),g=p.result;if(p.complete&&g){var f=l(g,{mutationResult:s,queryName:u&&(0,b.n4)(u)||void 0,queryVariables:d});f&&r.push({result:f,dataId:"ROOT_QUERY",query:u,variables:d})}}})}if(r.length>0||(e.refetchQueries||"").length>0||e.update||e.onQueryUpdated||e.removeOptimistic){var u=[];if(this.refetchQueries({updateCache:function(t){o||r.forEach(function(e){return t.write(e)});var a=e.update,l=!(0,h.YX)(s)||(0,h.ST)(s)&&!s.hasNext;if(a){if(!o){var c=t.diff({id:"ROOT_MUTATION",query:i.getDocumentInfo(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});c.complete&&("incremental"in(s=(0,n.__assign)((0,n.__assign)({},s),{data:c.result}))&&delete s.incremental,"hasNext"in s&&delete s.hasNext)}l&&a(t,s,{context:e.context,variables:e.variables})}o||e.keepRootFields||!l||t.modify({id:"ROOT_MUTATION",fields:function(e,t){var i=t.fieldName,n=t.DELETE;return"__typename"===i?e:n}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(e){return u.push(e)}),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(u).then(function(){return s})}return Promise.resolve(s)},e.prototype.markMutationOptimistic=function(e,t){var i=this,r="function"==typeof e?e(t.variables,{IGNORE:z}):e;return r!==z&&(this.cache.recordOptimisticTransaction(function(e){try{i.markMutationResult((0,n.__assign)((0,n.__assign)({},t),{result:{data:r}}),e)}catch(e){!1!==globalThis.__DEV__&&s.V1.error(e)}},t.mutationId),!0)},e.prototype.fetchQuery=function(e,t,i){return this.fetchConcastWithInfo(this.getOrCreateQuery(e),t,i).concast.promise},e.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach(function(t,i){e[i]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}}),e},e.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},e.prototype.transform=function(e){return this.documentTransform.transformDocument(e)},e.prototype.getDocumentInfo=function(e){var t=this.transformCache;if(!t.has(e)){var i={hasClientExports:(0,u.f2)(e),hasForcedResolvers:this.localState.shouldForceResolvers(e),hasNonreactiveDirective:(0,u.d8)(["nonreactive"],e),nonReactiveQuery:(0,d.x3)(e),clientQuery:this.localState.clientQuery(e),serverQuery:(0,d.iz)([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"},{name:"unmask"}],e),defaultVars:(0,b.wY)((0,b.Vu)(e)),asQuery:(0,n.__assign)((0,n.__assign)({},e),{definitions:e.definitions.map(function(e){return"OperationDefinition"===e.kind&&"query"!==e.operation?(0,n.__assign)((0,n.__assign)({},e),{operation:"query"}):e})})};t.set(e,i)}return t.get(e)},e.prototype.getVariables=function(e,t){return(0,n.__assign)((0,n.__assign)({},this.getDocumentInfo(e).defaultVars),t)},e.prototype.watchQuery=function(e){var t=this.transform(e.query);void 0===(e=(0,n.__assign)((0,n.__assign)({},e),{variables:this.getVariables(t,e.variables)})).notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var i=new _(this),s=new M.U({queryManager:this,queryInfo:i,options:e});return s.lastQuery=t,M.U.inactiveOnCreation.getValue()||this.queries.set(s.queryId,i),i.init({document:t,observableQuery:s,variables:s.variables}),s},e.prototype.query=function(e,t){var i=this;void 0===t&&(t=this.generateQueryId()),(0,s.V1)(e.query,38),(0,s.V1)("Document"===e.query.kind,39),(0,s.V1)(!e.returnPartialData,40),(0,s.V1)(!e.pollInterval,41);var r=this.transform(e.query);return this.fetchQuery(t,(0,n.__assign)((0,n.__assign)({},e),{query:r})).then(function(s){return s&&(0,n.__assign)((0,n.__assign)({},s),{data:i.maskOperation({document:r,data:s.data,fetchPolicy:e.fetchPolicy,id:t})})}).finally(function(){return i.stopQuery(t)})},e.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},e.prototype.generateRequestId=function(){return this.requestIdCounter++},e.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){var t=this.queries.get(e);t&&t.stop()},e.prototype.clearStore=function(e){return void 0===e&&(e={discardWatches:!0}),this.cancelPendingFetches((0,s.vA)(42)),this.queries.forEach(function(e){e.observableQuery?e.networkStatus=T.pT.loading:e.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},e.prototype.getObservableQueries=function(e){var t=this;void 0===e&&(e="active");var i=new Map,r=new Map,o=new Map,a=new Set;return Array.isArray(e)&&e.forEach(function(e){if("string"==typeof e)r.set(e,e),o.set(e,!1);else if((0,C.Kc)(e)){var i=(0,N.y)(t.transform(e));r.set(i,(0,b.n4)(e)),o.set(i,!1)}else(0,w.U)(e)&&e.query&&a.add(e)}),this.queries.forEach(function(t,n){var s=t.observableQuery,r=t.document;if(s){if("all"===e)return void i.set(n,s);var a=s.queryName;if("standby"===s.options.fetchPolicy||"active"===e&&!s.hasObservers())return;("active"===e||a&&o.has(a)||r&&o.has((0,N.y)(r)))&&(i.set(n,s),a&&o.set(a,!0),r&&o.set((0,N.y)(r),!0))}}),a.size&&a.forEach(function(e){var r=(0,S.v)("legacyOneTimeQuery"),o=t.getOrCreateQuery(r).init({document:e.query,variables:e.variables}),a=new M.U({queryManager:t,queryInfo:o,options:(0,n.__assign)((0,n.__assign)({},e),{fetchPolicy:"network-only"})});(0,s.V1)(a.queryId===r),o.setObservableQuery(a),i.set(r,a)}),!1!==globalThis.__DEV__&&o.size&&o.forEach(function(e,t){if(!e){var i=r.get(t);i?!1!==globalThis.__DEV__&&s.V1.warn(43,i):!1!==globalThis.__DEV__&&s.V1.warn(44)}}),i},e.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var i=[];return this.getObservableQueries(e?"all":"active").forEach(function(n,s){var r=n.options.fetchPolicy;(0,R.lz)("resetLastResults",function(){return n.resetLastResults()}),(e||"standby"!==r&&"cache-only"!==r)&&i.push(n.refetch()),(t.queries.get(s)||n.queryInfo).setDiff(null)}),this.broadcastQueries(),Promise.all(i)},e.prototype.startGraphQLSubscription=function(e){var t=this,i=e.query,n=e.variables,s=e.fetchPolicy,r=e.errorPolicy,o=void 0===r?"none":r,a=e.context,l=void 0===a?{}:a,c=e.extensions,h=void 0===c?{}:c;i=this.transform(i),n=this.getVariables(i,n);var u=function(e){return t.getObservableFromLink(i,l,e,h).map(function(n){"no-cache"!==s&&(L(n,o)&&t.cache.write({query:i,result:n.data,dataId:"ROOT_SUBSCRIPTION",variables:e}),t.broadcastQueries());var r=(0,y.t)(n),a=(0,A.uR)(n);if(r||a){var l={};if(r&&(l.graphQLErrors=n.errors),a&&(l.protocolErrors=n.extensions[A.K$]),"none"===o||a)throw new A.K4(l)}return"ignore"===o&&delete n.errors,n})};if(this.getDocumentInfo(i).hasClientExports){var d=this.localState.addExportedVariables(i,n,l).then(u);return new x.c(function(e){var t=null;return d.then(function(i){return t=i.subscribe(e)},e.error),function(){return t&&t.unsubscribe()}})}return u(n)},e.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},e.prototype.removeQuery=function(e){var t;this.fetchCancelFns.delete(e),this.queries.has(e)&&(null===(t=this.queries.get(e))||void 0===t||t.stop(),this.queries.delete(e))},e.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(e){var t;return null===(t=e.observableQuery)||void 0===t?void 0:t.notify()})},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,i,s,r){var a,l,c=this;void 0===r&&(r=null!==(a=null==t?void 0:t.queryDeduplication)&&void 0!==a?a:this.queryDeduplication);var h=this.getDocumentInfo(e),u=h.serverQuery,d=h.clientQuery;if(u){var p=this.inFlightLinkObservables,f=this.link,y={query:u,variables:i,operationName:(0,b.n4)(u)||void 0,context:this.prepareContext((0,n.__assign)((0,n.__assign)({},t),{forceFetch:!r})),extensions:s};if(t=y.context,r){var v=(0,N.y)(u),C=(0,g.M)(i),w=p.lookup(v,C);if(!(l=w.observable)){var S=new E.E([(0,o.g)(f,y)]);l=w.observable=S,S.beforeNext(function e(t,i){"next"===t&&"hasNext"in i&&i.hasNext?S.beforeNext(e):p.remove(v,C)})}}else l=new E.E([(0,o.g)(f,y)])}else l=new E.E([x.c.of({data:{}})]),t=this.prepareContext(t);return d&&(l=(0,m.x)(l,function(e){return c.localState.runResolvers({document:d,remoteResult:e,context:t,variables:i})})),l},e.prototype.getResultsFromLink=function(e,t,i){var n=e.lastRequestId=this.generateRequestId(),s=this.cache.transformForLink(i.query);return(0,m.x)(this.getObservableFromLink(s,i.context,i.variables),function(r){var o=(0,y.M)(r),a=o.length>0,l=i.errorPolicy;if(n>=e.lastRequestId){if(a&&"none"===l)throw e.markError(new A.K4({graphQLErrors:o}));e.markResult(r,s,i,t),e.markReady()}var c={data:r.data,loading:!1,networkStatus:T.pT.ready};return a&&"none"===l&&(c.data=void 0),a&&"ignore"!==l&&(c.errors=o,c.networkStatus=T.pT.error),c},function(t){var i=(0,A.Mn)(t)?t:new A.K4({networkError:t});throw n>=e.lastRequestId&&e.markError(i),i})},e.prototype.fetchConcastWithInfo=function(e,t,i,n){var s=this;void 0===i&&(i=T.pT.loading),void 0===n&&(n=t.query);var r,o,a=this.getVariables(n,t.variables),l=this.defaultOptions.watchQuery,c=t.fetchPolicy,h=void 0===c?l&&l.fetchPolicy||"cache-first":c,u=t.errorPolicy,d=void 0===u?l&&l.errorPolicy||"none":u,p=t.returnPartialData,g=void 0!==p&&p,f=t.notifyOnNetworkStatusChange,m=void 0!==f&&f,y=t.context,v=void 0===y?{}:y,b=Object.assign({},t,{query:n,variables:a,fetchPolicy:h,errorPolicy:d,returnPartialData:g,notifyOnNetworkStatusChange:m,context:v}),C=function(n){b.variables=n;var r=s.fetchQueryByPolicy(e,b,i);return"standby"!==b.fetchPolicy&&r.sources.length>0&&e.observableQuery&&e.observableQuery.applyNextFetchPolicy("after-fetch",t),r},w=function(){return s.fetchCancelFns.delete(e.queryId)};if(this.fetchCancelFns.set(e.queryId,function(e){w(),setTimeout(function(){return r.cancel(e)})}),this.getDocumentInfo(b.query).hasClientExports)r=new E.E(this.localState.addExportedVariables(b.query,b.variables,b.context).then(C).then(function(e){return e.sources})),o=!0;else{var S=C(b.variables);o=S.fromLink,r=new E.E(S.sources)}return r.promise.then(w,w),{concast:r,fromLink:o}},e.prototype.refetchQueries=function(e){var t=this,i=e.updateCache,n=e.include,s=e.optimistic,r=void 0!==s&&s,o=e.removeOptimistic,a=void 0===o?r?(0,S.v)("refetchQueries"):void 0:o,l=e.onQueryUpdated,c=new Map;n&&this.getObservableQueries(n).forEach(function(e,i){c.set(i,{oq:e,lastDiff:(t.queries.get(i)||e.queryInfo).getDiff()})});var h=new Map;return i&&this.cache.batch({update:i,optimistic:r&&a||!1,removeOptimistic:a,onWatchUpdated:function(e,t,i){var n=e.watcher instanceof _&&e.watcher.observableQuery;if(n){if(l){c.delete(n.queryId);var s=l(n,t,i);return!0===s&&(s=n.refetch()),!1!==s&&h.set(n,s),s}null!==l&&c.set(n.queryId,{oq:n,lastDiff:i,diff:t})}}}),c.size&&c.forEach(function(e,i){var n,s=e.oq,r=e.lastDiff,o=e.diff;l&&(o||(o=(0,R.lz)("canonizeResults",function(){return t.cache.diff(s.queryInfo.getDiffOptions())})),n=l(s,o,r)),l&&!0!==n||(n=s.refetch()),!1!==n&&h.set(s,n),i.indexOf("legacyOneTimeQuery")>=0&&t.stopQueryNoBroadcast(i)}),a&&this.cache.removeOptimistic(a),h},e.prototype.maskOperation=function(e){var t,i,n,r=e.document,o=e.data;if(!1!==globalThis.__DEV__){var a=e.fetchPolicy,l=e.id,c=null===(t=(0,b.Vu)(r))||void 0===t?void 0:t.operation,h=(null!==(i=null==c?void 0:c[0])&&void 0!==i?i:"o")+l;!this.dataMasking||"no-cache"!==a||(0,p.s6)(r)||this.noCacheWarningsByQueryId.has(h)||(this.noCacheWarningsByQueryId.add(h),!1!==globalThis.__DEV__&&s.V1.warn(45,null!==(n=(0,b.n4)(r))&&void 0!==n?n:"Unnamed ".concat(null!=c?c:"operation")))}return this.dataMasking?function(e,t,i){var n;if(!i.fragmentMatches)return!1!==globalThis.__DEV__&&(0,V.Ki)(),e;var r=(0,b.Vu)(t);return(0,s.V1)(r,63),null==e?e:(0,B.S)(e,r.selectionSet,{operationType:r.operation,operationName:null===(n=r.name)||void 0===n?void 0:n.value,fragmentMap:(0,p.JG)((0,b.zK)(t)),cache:i,mutableTargets:new V.jq,knownChanged:new V.xm})}(o,r,this.cache):o},e.prototype.maskFragment=function(e){var t=e.data,i=e.fragment,n=e.fragmentName;return this.dataMasking?(0,H.z)(t,i,this.cache,n):t},e.prototype.fetchQueryByPolicy=function(e,t,i){var s=this,r=t.query,o=t.variables,a=t.fetchPolicy,l=t.refetchWritePolicy,h=t.errorPolicy,u=t.returnPartialData,d=t.context,p=t.notifyOnNetworkStatusChange,g=e.networkStatus;e.init({document:r,variables:o,networkStatus:i});var f=function(){return e.getDiff()},m=function(t,i){void 0===i&&(i=e.networkStatus||T.pT.loading);var a=t.result;!1===globalThis.__DEV__||u||(0,c.L)(a,{})||(0,M.y)(t.missing);var l=function(e){return x.c.of((0,n.__assign)({data:e,loading:(0,T.bi)(i),networkStatus:i},t.complete?null:{partial:!0}))};return a&&s.getDocumentInfo(r).hasForcedResolvers?s.localState.runResolvers({document:r,remoteResult:{data:a},context:d,variables:o,onlyRunForcedResolvers:!0}).then(function(e){return l(e.data||void 0)}):"none"===h&&i===T.pT.refetch&&Array.isArray(t.missing)?l(void 0):l(a)},y="no-cache"===a?0:i===T.pT.refetch&&"merge"!==l?1:2,v=function(){return s.getResultsFromLink(e,y,{query:r,variables:o,context:d,fetchPolicy:a,errorPolicy:h})},b=p&&"number"==typeof g&&g!==i&&(0,T.bi)(i);switch(a){default:case"cache-first":return(C=f()).complete?{fromLink:!1,sources:[m(C,e.markReady())]}:u||b?{fromLink:!0,sources:[m(C),v()]}:{fromLink:!0,sources:[v()]};case"cache-and-network":var C;return(C=f()).complete||u||b?{fromLink:!0,sources:[m(C),v()]}:{fromLink:!0,sources:[v()]};case"cache-only":return{fromLink:!1,sources:[m(f(),e.markReady())]};case"network-only":return b?{fromLink:!0,sources:[m(f()),v()]}:{fromLink:!0,sources:[v()]};case"no-cache":return b?{fromLink:!0,sources:[m(e.getDiff()),v()]}:{fromLink:!0,sources:[v()]};case"standby":return{fromLink:!1,sources:[]}}},e.prototype.getOrCreateQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new _(this,e)),this.queries.get(e)},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return(0,n.__assign)((0,n.__assign)((0,n.__assign)({},this.defaultContext),t),{clientAwareness:this.clientAwareness})},e}(),j=i(85517),$=i(96891),K=i(23630),Y=function(){function e(e){var t=e.cache,i=e.client,n=e.resolvers,s=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=t,i&&(this.client=i),n&&this.addResolvers(n),s&&this.setFragmentMatcher(s)}return e.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach(function(e){t.resolvers=(0,D.D9)(t.resolvers,e)}):this.resolvers=(0,D.D9)(this.resolvers,e)},e.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(e){return(0,n.__awaiter)(this,arguments,void 0,function(e){var t=e.document,i=e.remoteResult,s=e.context,r=e.variables,o=e.onlyRunForcedResolvers,a=void 0!==o&&o;return(0,n.__generator)(this,function(e){return t?[2,this.resolveDocument(t,i.data,s,r,this.fragmentMatcher,a).then(function(e){return(0,n.__assign)((0,n.__assign)({},i),{data:e.result})})]:[2,i]})})},e.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(e){return(0,u.d8)(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return(0,d.er)(e)},e.prototype.prepareContext=function(e){var t=this.cache;return(0,n.__assign)((0,n.__assign)({},e),{cache:t,getCacheKey:function(e){return t.identify(e)}})},e.prototype.addExportedVariables=function(e){return(0,n.__awaiter)(this,arguments,void 0,function(e,t,i){return void 0===t&&(t={}),void 0===i&&(i={}),(0,n.__generator)(this,function(s){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(i),t).then(function(e){return(0,n.__assign)((0,n.__assign)({},t),e.exportedVariables)})]:[2,(0,n.__assign)({},t)]})})},e.prototype.shouldForceResolvers=function(e){var t=!1;return(0,j.YR)(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some(function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value})))return j.sP}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:(0,d.zc)(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t){return(0,n.__awaiter)(this,arguments,void 0,function(e,t,i,s,r,o){var a,l,c,h,u,d,g,f,m,y;return void 0===i&&(i={}),void 0===s&&(s={}),void 0===r&&(r=function(){return!0}),void 0===o&&(o=!1),(0,n.__generator)(this,function(v){return a=(0,b.Vn)(e),l=(0,b.zK)(e),c=(0,p.JG)(l),h=this.collectSelectionsToResolve(a,c),u=a.operation,d=u?u.charAt(0).toUpperCase()+u.slice(1):"Query",f=(g=this).cache,m=g.client,y={fragmentMap:c,context:(0,n.__assign)((0,n.__assign)({},i),{cache:f,client:m}),variables:s,fragmentMatcher:r,defaultOperationType:d,exportedVariables:{},selectionsToResolve:h,onlyRunForcedResolvers:o},[2,this.resolveSelectionSet(a.selectionSet,!1,t,y).then(function(e){return{result:e,exportedVariables:y.exportedVariables}})]})})},e.prototype.resolveSelectionSet=function(e,t,i,r){return(0,n.__awaiter)(this,void 0,void 0,function(){var o,a,l,c,h,d=this;return(0,n.__generator)(this,function(p){return o=r.fragmentMap,a=r.context,l=r.variables,c=[i],h=function(e){return(0,n.__awaiter)(d,void 0,void 0,function(){var h,d;return(0,n.__generator)(this,function(n){return(t||r.selectionsToResolve.has(e))&&(0,u.MS)(e,l)?(0,C.dt)(e)?[2,this.resolveField(e,t,i,r).then(function(t){var i;void 0!==t&&c.push(((i={})[(0,C.ue)(e)]=t,i))})]:((0,C.kd)(e)?h=e:(h=o[e.name.value],(0,s.V1)(h,21,e.name.value)),h&&h.typeCondition&&(d=h.typeCondition.name.value,r.fragmentMatcher(i,d,a))?[2,this.resolveSelectionSet(h.selectionSet,t,i,r).then(function(e){c.push(e)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(h)).then(function(){return(0,D.IM)(c)})]})})},e.prototype.resolveField=function(e,t,i,s){return(0,n.__awaiter)(this,void 0,void 0,function(){var r,o,a,l,c,h,u,d,p,g=this;return(0,n.__generator)(this,function(n){return i?(r=s.variables,o=e.name.value,a=(0,C.ue)(e),l=o!==a,c=i[a]||i[o],h=Promise.resolve(c),s.onlyRunForcedResolvers&&!this.shouldForceResolvers(e)||(u=i.__typename||s.defaultOperationType,(d=this.resolvers&&this.resolvers[u])&&(p=d[l?o:a])&&(h=Promise.resolve(K.bl.withValue(this.cache,p,[i,(0,C.MB)(e,r),s.context,{field:e,fragmentMap:s.fragmentMap}])))),[2,h.then(function(i){var n,r;if(void 0===i&&(i=c),e.directives&&e.directives.forEach(function(e){"export"===e.name.value&&e.arguments&&e.arguments.forEach(function(e){"as"===e.name.value&&"StringValue"===e.value.kind&&(s.exportedVariables[e.value.value]=i)})}),!e.selectionSet)return i;if(null==i)return i;var o=null!==(r=null===(n=e.directives)||void 0===n?void 0:n.some(function(e){return"client"===e.name.value}))&&void 0!==r&&r;return Array.isArray(i)?g.resolveSubSelectedArray(e,t||o,i,s):e.selectionSet?g.resolveSelectionSet(e.selectionSet,t||o,i,s):void 0})]):[2,null]})})},e.prototype.resolveSubSelectedArray=function(e,t,i,n){var s=this;return Promise.all(i.map(function(i){return null===i?null:Array.isArray(i)?s.resolveSubSelectedArray(e,t,i,n):e.selectionSet?s.resolveSelectionSet(e.selectionSet,t,i,n):void 0}))},e.prototype.collectSelectionsToResolve=function(e,t){var i=function(e){return!Array.isArray(e)},n=this.selectionsToResolveCache;return function e(r){if(!n.has(r)){var o=new Set;n.set(r,o),(0,j.YR)(r,{Directive:function(e,t,n,s,r){"client"===e.name.value&&r.forEach(function(e){i(e)&&(0,$.VK)(e)&&o.add(e)})},FragmentSpread:function(n,r,a,l,c){var h=t[n.name.value];(0,s.V1)(h,22,n.name.value);var u=e(h);u.size>0&&(c.forEach(function(e){i(e)&&(0,$.VK)(e)&&o.add(e)}),o.add(n),u.forEach(function(e){o.add(e)}))}})}return n.get(r)}(e)},e}(),q=i(22260),X=i(97023),Z=!1,Q=function(){function e(e){var t,i,o,c=this;if(this.resetStoreCallbacks=[],this.clearStoreCallbacks=[],!e.cache)throw(0,s.vA)(16);var h=e.uri,u=e.credentials,d=e.headers,p=e.cache,g=e.documentTransform,f=e.ssrMode,m=void 0!==f&&f,y=e.ssrForceFetchDelay,v=void 0===y?0:y,b=e.connectToDevTools,C=e.queryDeduplication,w=void 0===C||C,S=e.defaultOptions,x=e.defaultContext,E=e.assumeImmutableResults,A=void 0===E?p.assumeImmutableResults:E,M=e.resolvers,T=e.typeDefs,D=e.fragmentMatcher,I=e.clientAwareness,k=e.name,P=e.version,_=e.devtools,L=e.dataMasking;!1!==globalThis.__DEV__&&((0,R.cc)(e,"connectToDevTools","ApolloClient","Please use `devtools.enabled` instead."),(0,R.cc)(e,"uri","ApolloClient","Please initialize an instance of `HttpLink` with `uri` instead."),(0,R.cc)(e,"credentials","ApolloClient","Please initialize an instance of `HttpLink` with `credentials` instead."),(0,R.cc)(e,"headers","ApolloClient","Please initialize an instance of `HttpLink` with `headers` instead."),(0,R.cc)(e,"name","ApolloClient","Please use the `clientAwareness.name` option instead."),(0,R.cc)(e,"version","ApolloClient","Please use the `clientAwareness.version` option instead."),(0,R.cc)(e,"typeDefs","ApolloClient"),e.link||!1!==globalThis.__DEV__&&s.V1.warn(17));var N=e.link;N||(N=h?new l.P({uri:h,credentials:u,headers:d}):r.C.empty()),this.link=N,this.cache=p,this.disableNetworkFetches=m||v>0,this.queryDeduplication=w,this.defaultOptions=S||Object.create(null),this.typeDefs=T,this.devtoolsConfig=(0,n.__assign)((0,n.__assign)({},_),{enabled:null!==(t=null==_?void 0:_.enabled)&&void 0!==t?t:b}),void 0===this.devtoolsConfig.enabled&&(this.devtoolsConfig.enabled=!1!==globalThis.__DEV__),v&&setTimeout(function(){return c.disableNetworkFetches=!1},v),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.watchFragment=this.watchFragment.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),this.version=a.r,this.localState=new Y({cache:p,client:this,resolvers:M,fragmentMatcher:D}),this.queryManager=new W({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,defaultContext:x,documentTransform:g,queryDeduplication:w,ssrMode:m,dataMasking:!!L,clientAwareness:{name:null!==(i=null==I?void 0:I.name)&&void 0!==i?i:k,version:null!==(o=null==I?void 0:I.version)&&void 0!==o?o:P},localState:this.localState,assumeImmutableResults:A,onBroadcast:this.devtoolsConfig.enabled?function(){c.devToolsHookCb&&c.devToolsHookCb({action:{},state:{queries:c.queryManager.getQueryStore(),mutations:c.queryManager.mutationStore||{}},dataWithOptimisticResults:c.cache.extract(!0)})}:void 0}),this.devtoolsConfig.enabled&&this.connectToDevTools()}return Object.defineProperty(e.prototype,"prioritizeCacheValues",{get:function(){return this.disableNetworkFetches},set:function(e){this.disableNetworkFetches=e},enumerable:!1,configurable:!0}),e.prototype.connectToDevTools=function(){if("undefined"!=typeof window){var e=window,t=Symbol.for("apollo.devtools");(e[t]=e[t]||[]).push(this),e.__APOLLO_CLIENT__=this,Z||!1===globalThis.__DEV__||(Z=!0,window.document&&window.top===window.self&&/^(https?|file):$/.test(window.location.protocol)&&setTimeout(function(){if(!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__){var e=window.navigator,t=e&&e.userAgent,i=void 0;"string"==typeof t&&(t.indexOf("Chrome/")>-1?i="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":t.indexOf("Firefox/")>-1&&(i="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),i&&!1!==globalThis.__DEV__&&s.V1.log("Download the Apollo DevTools for a better development experience: %s",i)}},1e4))}},Object.defineProperty(e.prototype,"documentTransform",{get:function(){return this.queryManager.documentTransform},enumerable:!1,configurable:!0}),e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=(0,q.l)(this.defaultOptions.watchQuery,e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=(0,n.__assign)((0,n.__assign)({},e),{fetchPolicy:"cache-first"})),!1!==globalThis.__DEV__&&((0,R.cc)(e,"canonizeResults","client.watchQuery"),(0,R.cc)(e,"partialRefetch","client.watchQuery")),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=(0,q.l)(this.defaultOptions.query,e)),(0,s.V1)("cache-and-network"!==e.fetchPolicy,18),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=(0,n.__assign)((0,n.__assign)({},e),{fetchPolicy:"cache-first"})),!1!==globalThis.__DEV__&&((0,R.cc)(e,"canonizeResults","client.query"),(0,R.cc)(e,"notifyOnNetworkStatusChange","client.query","This option does not affect `client.query` and can be safely removed."),"standby"===e.fetchPolicy&&!1!==globalThis.__DEV__&&s.V1.warn(19)),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=(0,q.l)(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},e.prototype.subscribe=function(e){var t=this,i=this.queryManager.generateQueryId();return this.queryManager.startGraphQLSubscription(e).map(function(s){return(0,n.__assign)((0,n.__assign)({},s),{data:t.queryManager.maskOperation({document:e.query,data:s.data,fetchPolicy:e.fetchPolicy,id:i})})})},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},e.prototype.watchFragment=function(e){var t;return this.cache.watchFragment((0,n.__assign)((0,n.__assign)({},e),((t={})[Symbol.for("apollo.dataMasking")]=this.queryManager.dataMasking,t)))},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){var t=this.cache.writeQuery(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t},e.prototype.writeFragment=function(e){var t=this.cache.writeFragment(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return(0,o.g)(this.link,e)},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!1})}).then(function(){return Promise.all(e.resetStoreCallbacks.map(function(e){return e()}))}).then(function(){return e.reFetchObservableQueries()})},e.prototype.clearStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!0})}).then(function(){return Promise.all(e.clearStoreCallbacks.map(function(e){return e()}))})},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter(function(t){return t!==e})}},e.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter(function(t){return t!==e})}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},e.prototype.refetchQueries=function(e){var t=this.queryManager.refetchQueries(e),i=[],n=[];t.forEach(function(e,t){i.push(t),n.push(e)});var r=Promise.all(n);return r.queries=i,r.results=n,r.catch(function(e){!1!==globalThis.__DEV__&&s.V1.debug(20,e)}),r},e.prototype.getObservableQueries=function(e){return void 0===e&&(e="active"),this.queryManager.getObservableQueries(e)},e.prototype.extract=function(e){return this.cache.extract(e)},e.prototype.restore=function(e){return this.cache.restore(e)},e.prototype.addResolvers=function(e){this.localState.addResolvers(e)},e.prototype.setResolvers=function(e){this.localState.setResolvers(e)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},e.prototype.setLink=function(e){this.link=this.queryManager.link=e},Object.defineProperty(e.prototype,"defaultContext",{get:function(){return this.queryManager.defaultContext},enumerable:!1,configurable:!0}),e}();!1!==globalThis.__DEV__&&(Q.prototype.getMemoryInternals=X.ep)},42248(e,t,i){"use strict";i.d(t,{U:()=>C,y:()=>S});var n=i(65959),s=i(85923),r=i(45063),o=i(28299),a=i(74140),l=i(73476),c=i(31247),h=i(10683),u=i(8786),d=i(36700),p=i(93565),g=i(62199),f=i(9420),m=i(1645),y=i(23549),v=Object.assign,b=Object.hasOwnProperty,C=function(e){function t(i){var s=i.queryManager,r=i.queryInfo,o=i.options,a=this,c=t.inactiveOnCreation.getValue();(a=e.call(this,function(e){a._getOrCreateQuery();try{var t=e._subscription._observer;t&&!t.error&&(t.error=w)}catch(e){}var i=!a.observers.size;a.observers.add(e);var n=a.last;return n&&n.error?e.error&&e.error(n.error):n&&n.result&&e.next&&e.next(a.maskResult(n.result)),i&&a.reobserve().catch(function(){}),function(){a.observers.delete(e)&&!a.observers.size&&a.tearDownQuery()}})||this).observers=new Set,a.subscriptions=new Set,a.dirty=!1,a._getOrCreateQuery=function(){return c&&(s.queries.set(a.queryId,r),c=!1),a.queryManager.getOrCreateQuery(a.queryId)},a.queryInfo=r,a.queryManager=s,a.waitForOwnResult=x(o.fetchPolicy),a.isTornDown=!1,a.subscribeToMore=a.subscribeToMore.bind(a),a.maskResult=a.maskResult.bind(a);var h=s.defaultOptions.watchQuery,u=(void 0===h?{}:h).fetchPolicy,d=void 0===u?"cache-first":u,p=o.fetchPolicy,g=void 0===p?d:p,f=o.initialFetchPolicy,m=void 0===f?"standby"===g?d:g:f;a.options=(0,n.__assign)((0,n.__assign)({},o),{initialFetchPolicy:m,fetchPolicy:g}),a.queryId=r.queryId||s.generateQueryId();var y=(0,l.Vu)(a.query);return a.queryName=y&&y.name&&y.name.value,a}return(0,n.__extends)(t,e),Object.defineProperty(t.prototype,"query",{get:function(){return this.lastQuery||this.options.query},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),t.prototype.result=function(){var e=this;return!1!==globalThis.__DEV__&&(0,y.S2)("observableQuery.result",function(){!1!==globalThis.__DEV__&&s.V1.warn(23)}),new Promise(function(t,i){var n={next:function(i){t(i),e.observers.delete(n),e.observers.size||e.queryManager.removeQuery(e.queryId),setTimeout(function(){s.unsubscribe()},0)},error:i},s=e.subscribe(n)})},t.prototype.resetDiff=function(){this.queryInfo.resetDiff()},t.prototype.getCurrentFullResult=function(e){var t=this;void 0===e&&(e=!0);var i=(0,y.lz)("getLastResult",function(){return t.getLastResult(!0)}),s=this.queryInfo.networkStatus||i&&i.networkStatus||o.pT.ready,a=(0,n.__assign)((0,n.__assign)({},i),{loading:(0,o.bi)(s),networkStatus:s}),l=this.options.fetchPolicy,c=void 0===l?"cache-first":l;if(x(c)||this.queryManager.getDocumentInfo(this.query).hasForcedResolvers);else if(this.waitForOwnResult)this.queryInfo.updateWatch();else{var h=this.queryInfo.getDiff();(h.complete||this.options.returnPartialData)&&(a.data=h.result),(0,r.L)(a.data,{})&&(a.data=void 0),h.complete?(delete a.partial,!h.complete||a.networkStatus!==o.pT.loading||"cache-first"!==c&&"cache-only"!==c||(a.networkStatus=o.pT.ready,a.loading=!1)):a.partial=!0,a.networkStatus===o.pT.ready&&(a.error||a.errors)&&(a.networkStatus=o.pT.error),!1===globalThis.__DEV__||h.complete||this.options.partialRefetch||a.loading||a.data||a.error||S(h.missing)}return e&&this.updateLastResult(a),a},t.prototype.getCurrentResult=function(e){return void 0===e&&(e=!0),this.maskResult(this.getCurrentFullResult(e))},t.prototype.isDifferentFromLastResult=function(e,t){if(!this.last)return!0;var i=this.queryManager.getDocumentInfo(this.query),n=this.queryManager.dataMasking,s=n?i.nonReactiveQuery:this.query;return(n||i.hasNonreactiveDirective?!(0,f.a)(s,this.last.result,e,this.variables):!(0,r.L)(this.last.result,e))||t&&!(0,r.L)(this.last.variables,t)},t.prototype.getLast=function(e,t){var i=this.last;if(i&&i[e]&&(!t||(0,r.L)(i.variables,this.variables)))return i[e]},t.prototype.getLastResult=function(e){return!1!==globalThis.__DEV__&&(0,y.S2)("getLastResult",function(){!1!==globalThis.__DEV__&&s.V1.warn(24)}),this.getLast("result",e)},t.prototype.getLastError=function(e){return!1!==globalThis.__DEV__&&(0,y.S2)("getLastError",function(){!1!==globalThis.__DEV__&&s.V1.warn(25)}),this.getLast("error",e)},t.prototype.resetLastResults=function(){!1!==globalThis.__DEV__&&(0,y.S2)("resetLastResults",function(){!1!==globalThis.__DEV__&&s.V1.warn(26)}),delete this.last,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){!1!==globalThis.__DEV__&&!1!==globalThis.__DEV__&&s.V1.warn(27),this.queryManager.resetErrors(this.queryId)},t.prototype.refetch=function(e){var t,i={pollInterval:0},a=this.options.fetchPolicy;if(i.fetchPolicy="no-cache"===a?"no-cache":"network-only",!1!==globalThis.__DEV__&&e&&b.call(e,"variables")){var c=(0,l.AT)(this.query),h=c.variableDefinitions;h&&h.some(function(e){return"variables"===e.variable.name.value})||!1!==globalThis.__DEV__&&s.V1.warn(28,e,(null===(t=c.name)||void 0===t?void 0:t.value)||c)}return e&&!(0,r.L)(this.options.variables,e)&&(i.variables=this.options.variables=(0,n.__assign)((0,n.__assign)({},this.options.variables),e)),this.queryInfo.resetLastWrite(),this.reobserve(i,o.pT.refetch)},t.prototype.fetchMore=function(e){var t=this,i=(0,n.__assign)((0,n.__assign)({},e.query?e:(0,n.__assign)((0,n.__assign)((0,n.__assign)((0,n.__assign)({},this.options),{query:this.options.query}),e),{variables:(0,n.__assign)((0,n.__assign)({},this.options.variables),e.variables)})),{fetchPolicy:"no-cache"});i.query=this.transformDocument(i.query);var r=this.queryManager.generateQueryId();this.lastQuery=e.query?this.transformDocument(this.options.query):i.query;var a=this.queryInfo,l=a.networkStatus;a.networkStatus=o.pT.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var c=new Set,h=null==e?void 0:e.updateQuery,u="no-cache"!==this.options.fetchPolicy;return u||(0,s.V1)(h,29),this.queryManager.fetchQuery(r,i,o.pT.fetchMore).then(function(s){if(t.queryManager.removeQuery(r),a.networkStatus===o.pT.fetchMore&&(a.networkStatus=l),u)t.queryManager.cache.batch({update:function(n){var r=e.updateQuery;r?n.updateQuery({query:t.query,variables:t.variables,returnPartialData:!0,optimistic:!1},function(e){return r(e,{fetchMoreResult:s.data,variables:i.variables})}):n.writeQuery({query:i.query,variables:i.variables,data:s.data})},onWatchUpdated:function(e){c.add(e.query)}});else{var d=t.getLast("result"),p=h(d.data,{fetchMoreResult:s.data,variables:i.variables});t.reportResult((0,n.__assign)((0,n.__assign)({},d),{networkStatus:l,loading:(0,o.bi)(l),data:p}),t.variables)}return t.maskResult(s)}).finally(function(){u&&!c.has(t.query)&&t.reobserveCacheFirst()})},t.prototype.subscribeToMore=function(e){var t=this,i=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables,context:e.context}).subscribe({next:function(i){var s=e.updateQuery;s&&t.updateQuery(function(e,t){return s(e,(0,n.__assign)({subscriptionData:i},t))})},error:function(t){e.onError?e.onError(t):!1!==globalThis.__DEV__&&s.V1.error(30,t)}});return this.subscriptions.add(i),function(){t.subscriptions.delete(i)&&i.unsubscribe()}},t.prototype.setOptions=function(e){return!1!==globalThis.__DEV__&&((0,y.cc)(e,"canonizeResults","setOptions"),(0,y.S2)("setOptions",function(){!1!==globalThis.__DEV__&&s.V1.warn(31)})),this.reobserve(e)},t.prototype.silentSetOptions=function(e){var t=(0,p.o)(this.options,e||{});v(this.options,t)},t.prototype.setVariables=function(e){var t=this;return(0,r.L)(this.variables,e)?this.observers.size?(0,y.lz)("observableQuery.result",function(){return t.result()}):Promise.resolve():(this.options.variables=e,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:e},o.pT.setVariables):Promise.resolve())},t.prototype.updateQuery=function(e){var t=this.queryManager,i=t.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}),n=i.result,s=i.complete,r=e(n,{variables:this.variables,complete:!!s,previousData:n});r&&(t.cache.writeQuery({query:this.options.query,data:r,variables:this.variables}),t.broadcastQueries())},t.prototype.startPolling=function(e){this.options.pollInterval=e,this.updatePolling()},t.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},t.prototype.applyNextFetchPolicy=function(e,t){if(t.nextFetchPolicy){var i=t.fetchPolicy,n=void 0===i?"cache-first":i,s=t.initialFetchPolicy,r=void 0===s?n:s;"standby"===n||("function"==typeof t.nextFetchPolicy?t.fetchPolicy=t.nextFetchPolicy(n,{reason:e,options:t,observable:this,initialFetchPolicy:r}):t.fetchPolicy="variables-changed"===e?r:t.nextFetchPolicy)}return t.fetchPolicy},t.prototype.fetch=function(e,t,i){var n=this._getOrCreateQuery();return n.setObservableQuery(this),this.queryManager.fetchConcastWithInfo(n,e,t,i)},t.prototype.updatePolling=function(){var e=this;if(!this.queryManager.ssrMode){var t=this.pollingInfo,i=this.options.pollInterval;if(i&&this.hasObservers()){if(!t||t.interval!==i){(0,s.V1)(i,32),(t||(this.pollingInfo={})).interval=i;var n=function(){var t,i;e.pollingInfo&&((0,o.bi)(e.queryInfo.networkStatus)||(null===(i=(t=e.options).skipPollAttempt)||void 0===i?void 0:i.call(t))?r():e.reobserve({fetchPolicy:"no-cache"===e.options.initialFetchPolicy?"no-cache":"network-only"},o.pT.poll).then(r,r))},r=function(){var t=e.pollingInfo;t&&(clearTimeout(t.timeout),t.timeout=setTimeout(n,t.interval))};r()}}else t&&(clearTimeout(t.timeout),delete this.pollingInfo)}},t.prototype.updateLastResult=function(e,t){var i=this;void 0===t&&(t=this.variables);var s=(0,y.lz)("getLastError",function(){return i.getLastError()});return s&&this.last&&!(0,r.L)(t,this.last.variables)&&(s=void 0),this.last=(0,n.__assign)({result:this.queryManager.assumeImmutableResults?e:(0,h.m)(e),variables:t},s?{error:s}:null)},t.prototype.reobserveAsConcast=function(e,t){var i=this;this.isTornDown=!1;var s=t===o.pT.refetch||t===o.pT.fetchMore||t===o.pT.poll,a=this.options.variables,l=this.options.fetchPolicy,c=(0,p.o)(this.options,e||{}),h=s?c:v(this.options,c),u=this.transformDocument(h.query);this.lastQuery=u,s||(this.updatePolling(),!e||!e.variables||(0,r.L)(e.variables,a)||"standby"===h.fetchPolicy||h.fetchPolicy!==l&&"function"!=typeof h.nextFetchPolicy||(this.applyNextFetchPolicy("variables-changed",h),void 0===t&&(t=o.pT.setVariables))),this.waitForOwnResult&&(this.waitForOwnResult=x(h.fetchPolicy));var d=function(){i.concast===y&&(i.waitForOwnResult=!1)},f=h.variables&&(0,n.__assign)({},h.variables),m=this.fetch(h,t,u),y=m.concast,b=m.fromLink,C={next:function(e){(0,r.L)(i.variables,f)&&(d(),i.reportResult(e,f))},error:function(e){(0,r.L)(i.variables,f)&&((0,g.Mn)(e)||(e=new g.K4({networkError:e})),d(),i.reportError(e,f))}};return s||!b&&this.concast||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=y,this.observer=C),y.addObserver(C),y},t.prototype.reobserve=function(e,t){return(0,c.X)(this.reobserveAsConcast(e,t).promise.then(this.maskResult))},t.prototype.resubscribeAfterError=function(){for(var e=this,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var n=this.last;(0,y.lz)("resetLastResults",function(){return e.resetLastResults()});var s=this.subscribe.apply(this,t);return this.last=n,s},t.prototype.observe=function(){this.reportResult(this.getCurrentFullResult(!1),this.variables)},t.prototype.reportResult=function(e,t){var i=this,n=(0,y.lz)("getLastError",function(){return i.getLastError()}),s=this.isDifferentFromLastResult(e,t);(n||!e.partial||this.options.returnPartialData)&&this.updateLastResult(e,t),(n||s)&&(0,u.w)(this.observers,"next",this.maskResult(e))},t.prototype.reportError=function(e,t){var i=this,s=(0,n.__assign)((0,n.__assign)({},(0,y.lz)("getLastResult",function(){return i.getLastResult()})),{error:e,errors:e.graphQLErrors,networkStatus:o.pT.error,loading:!1});this.updateLastResult(s,t),(0,u.w)(this.observers,"error",this.last.error=e)},t.prototype.hasObservers=function(){return this.observers.size>0},t.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach(function(e){return e.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t.prototype.transformDocument=function(e){return this.queryManager.transform(e)},t.prototype.maskResult=function(e){return e&&"data"in e?(0,n.__assign)((0,n.__assign)({},e),{data:this.queryManager.maskOperation({document:this.query,data:e.data,fetchPolicy:this.options.fetchPolicy,id:this.queryId})}):e},t.prototype.resetNotifications=function(){this.cancelNotifyTimeout(),this.dirty=!1},t.prototype.cancelNotifyTimeout=function(){this.notifyTimeout&&(clearTimeout(this.notifyTimeout),this.notifyTimeout=void 0)},t.prototype.scheduleNotify=function(){var e=this;this.dirty||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return e.notify()},0)))},t.prototype.notify=function(){this.cancelNotifyTimeout(),this.dirty&&("cache-only"!=this.options.fetchPolicy&&"cache-and-network"!=this.options.fetchPolicy&&(0,o.bi)(this.queryInfo.networkStatus)||(this.queryInfo.getDiff().fromOptimisticTransaction?this.observe():this.reobserveCacheFirst())),this.dirty=!1},t.prototype.reobserveCacheFirst=function(){var e=this.options,t=e.fetchPolicy,i=e.nextFetchPolicy;return"cache-and-network"===t||"network-only"===t?this.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(e,n){return this.nextFetchPolicy=i,"function"==typeof this.nextFetchPolicy?this.nextFetchPolicy(e,n):t}}):this.reobserve()},t.inactiveOnCreation=new m.DX,t}(a.c);function w(e){!1!==globalThis.__DEV__&&s.V1.error(33,e.message,e.stack)}function S(e){!1!==globalThis.__DEV__&&e&&!1!==globalThis.__DEV__&&s.V1.debug(34,e)}function x(e){return"network-only"===e||"no-cache"===e||"standby"===e}(0,d.r)(C)},9420(e,t,i){"use strict";i.d(t,{a:()=>c});var n=i(65959),s=i(45063),r=i(77822),o=i(87819),a=i(73476),l=i(77038);function c(e,t,i,r){var l=t.data,c=(0,n.__rest)(t,["data"]),u=i.data,d=(0,n.__rest)(i,["data"]);return(0,s.A)(c,d)&&h((0,a.Vn)(e).selectionSet,l,u,{fragmentMap:(0,o.JG)((0,a.zK)(e)),variables:r})}function h(e,t,i,n){if(t===i)return!0;var a=new Set;return e.selections.every(function(e){if(a.has(e))return!0;if(a.add(e),!(0,r.MS)(e,n.variables))return!0;if(u(e))return!0;if((0,l.dt)(e)){var c=(0,l.ue)(e),d=t&&t[c],p=i&&i[c],g=e.selectionSet;if(!g)return(0,s.A)(d,p);var f=Array.isArray(d),m=Array.isArray(p);if(f!==m)return!1;if(f&&m){var y=d.length;if(p.length!==y)return!1;for(var v=0;v<y;++v)if(!h(g,d[v],p[v],n))return!1;return!0}return h(g,d,p,n)}var b=(0,o.HQ)(e,n.fragmentMap);return b?!!u(b)||h(b.selectionSet,t,i,n):void 0})}function u(e){return!!e.directives&&e.directives.some(d)}function d(e){return"nonreactive"===e.name.value}},96746(e,t,i){"use strict";i.r(t),i.d(t,{ApolloCache:()=>c.k,ApolloClient:()=>s.R,ApolloError:()=>l.K4,ApolloLink:()=>f.C,Cache:()=>n,DocumentTransform:()=>T.c,HttpLink:()=>w.HttpLink,InMemoryCache:()=>h.D,MissingFieldError:()=>u.Z,NetworkStatus:()=>a.pT,Observable:()=>x.c,ObservableQuery:()=>o.U,checkFetcher:()=>w.checkFetcher,concat:()=>b,createHttpLink:()=>w.createHttpLink,createSignalIfSupported:()=>w.createSignalIfSupported,defaultDataIdFromObject:()=>d.or,defaultPrinter:()=>w.defaultPrinter,disableExperimentalFragmentVariables:()=>R.qj,disableFragmentWarnings:()=>R.gi,empty:()=>m,enableExperimentalFragmentVariables:()=>R.VC,execute:()=>C.g,fallbackHttpConfig:()=>w.fallbackHttpConfig,from:()=>y,fromError:()=>A.N,fromPromise:()=>E,gql:()=>R.J1,isApolloError:()=>l.Mn,isNetworkRequestSettled:()=>a.D2,isReference:()=>D.A_,makeReference:()=>D.WU,makeVar:()=>p.UT,mergeOptions:()=>r.l,parseAndCheckHttpResponse:()=>w.parseAndCheckHttpResponse,resetCaches:()=>R.Nh,rewriteURIForGET:()=>w.rewriteURIForGET,selectHttpOptionsAndBody:()=>w.selectHttpOptionsAndBody,selectHttpOptionsAndBodyInternal:()=>w.selectHttpOptionsAndBodyInternal,selectURI:()=>w.selectURI,serializeFetchParameter:()=>w.serializeFetchParameter,setLogVerbosity:()=>I.Q9,split:()=>v,throwServerError:()=>M.A,toPromise:()=>S});var n,s=i(36598),r=i(22260),o=i(42248),a=i(28299),l=i(62199);n||(n={});var c=i(9374),h=i(19215),u=i(17657),d=i(91742),p=i(23630),g=i(85923),f=i(33976),m=f.C.empty,y=f.C.from,v=f.C.split,b=f.C.concat,C=i(95197),w=i(5623);function S(e){var t=!1;return new Promise(function(i,n){e.subscribe({next:function(e){t?!1!==globalThis.__DEV__&&g.V1.warn(57):(t=!0,i(e))},error:n})})}var x=i(74140);function E(e){return new x.c(function(t){e.then(function(e){t.next(e),t.complete()}).catch(t.error.bind(t))})}var A=i(26408),M=i(82343),T=i(29957),D=i(77038),I=i(92981),R=i(27477);(0,I.Q9)(!1!==globalThis.__DEV__?"log":"silent")},28299(e,t,i){"use strict";var n;function s(e){return!!e&&e<7}function r(e){return 7===e||8===e}i.d(t,{D2:()=>r,bi:()=>s,pT:()=>n}),function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"}(n||(n={}))},62199(e,t,i){"use strict";i.d(t,{K$:()=>r,K4:()=>l,Mn:()=>a,uR:()=>o});var n=i(65959),s=(i(85923),i(83724)),r=Symbol();function o(e){return!!e.extensions&&Array.isArray(e.extensions[r])}function a(e){return e.hasOwnProperty("graphQLErrors")}var l=function(e){function t(i){var r,o,a=i.graphQLErrors,l=i.protocolErrors,c=i.clientErrors,h=i.networkError,u=i.errorMessage,d=i.extraInfo,p=e.call(this,u)||this;return p.name="ApolloError",p.graphQLErrors=a||[],p.protocolErrors=l||[],p.clientErrors=c||[],p.networkError=h||null,p.message=u||(r=p,o=(0,n.__spreadArray)((0,n.__spreadArray)((0,n.__spreadArray)([],r.graphQLErrors,!0),r.clientErrors,!0),r.protocolErrors,!0),r.networkError&&o.push(r.networkError),o.map(function(e){return(0,s.U)(e)&&e.message||"Error message not found."}).join("\n")),p.extraInfo=d,p.cause=(0,n.__spreadArray)((0,n.__spreadArray)((0,n.__spreadArray)([h],a||[],!0),l||[],!0),c||[],!0).find(function(e){return!!e})||null,p.__proto__=t.prototype,p}return(0,n.__extends)(t,e),t}(Error)},40168(e,t,i){"use strict";i.r(t),i.d(t,{setContext:()=>o});var n=i(65959),s=i(33976),r=i(74140);function o(e){return new s.C(function(t,i){var s=(0,n.__rest)(t,[]);return new r.c(function(n){var r,o=!1;return Promise.resolve(s).then(function(i){return e(i,t.getContext())}).then(t.setContext).then(function(){o||(r=i(t).subscribe({next:n.next.bind(n),error:n.error.bind(n),complete:n.complete.bind(n)}))}).catch(n.error.bind(n)),function(){o=!0,r&&r.unsubscribe()}})})}},33976(e,t,i){"use strict";i.d(t,{C:()=>u});var n=i(85923),s=i(74140),r=i(65959),o=i(73476),a=i(23549);function l(e,t){return t?t(e):s.c.of()}function c(e){return"function"==typeof e?new u(e):e}function h(e){return e.request.length<=1}var u=function(){function e(e){e&&(this.request=e)}return e.empty=function(){return new e(function(){return s.c.of()})},e.from=function(t){return 0===t.length?e.empty():t.map(c).reduce(function(e,t){return e.concat(t)})},e.split=function(t,i,n){var r,o=c(i),a=c(n||new e(l));return r=h(o)&&h(a)?new e(function(e){return t(e)?o.request(e)||s.c.of():a.request(e)||s.c.of()}):new e(function(e,i){return t(e)?o.request(e,i)||s.c.of():a.request(e,i)||s.c.of()}),Object.assign(r,{left:o,right:a})},e.execute=function(e,t){return e.request(function(e,t){var i=(0,r.__assign)({},e);return Object.defineProperty(t,"setContext",{enumerable:!1,value:function(e){i="function"==typeof e?(0,r.__assign)((0,r.__assign)({},i),e(i)):(0,r.__assign)((0,r.__assign)({},i),e)}}),Object.defineProperty(t,"getContext",{enumerable:!1,value:function(){return(0,r.__assign)({},i)}}),t}(t.context,function(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName="string"!=typeof t.query?(0,o.n4)(t.query)||void 0:""),t}(function(e){for(var t=["query","operationName","variables","extensions","context"],i=0,s=Object.keys(e);i<s.length;i++){var r=s[i];if(t.indexOf(r)<0)throw(0,n.vA)(58,r)}return e}(t))))||s.c.of()},e.concat=function(t,i){var r=c(t);if(h(r))return!1!==globalThis.__DEV__&&n.V1.warn(47,r),r;var o,a=c(i);return o=h(a)?new e(function(e){return r.request(e,function(e){return a.request(e)||s.c.of()})||s.c.of()}):new e(function(e,t){return r.request(e,function(e){return a.request(e,t)||s.c.of()})||s.c.of()}),Object.assign(o,{left:r,right:a})},e.prototype.split=function(t,i,n){return this.concat(e.split(t,i,n||new e(l)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(e,t){throw(0,n.vA)(48)},e.prototype.onError=function(e,t){if(!1!==globalThis.__DEV__&&(0,a.S2)("onError",function(){!1!==globalThis.__DEV__&&n.V1.warn(49)}),t&&t.error)return t.error(e),!1;throw e},e.prototype.setOnError=function(e){return!1!==globalThis.__DEV__&&!1!==globalThis.__DEV__&&n.V1.warn(50),this.onError=e,this},e}()},95197(e,t,i){"use strict";i.d(t,{g:()=>n});var n=i(33976).C.execute},70085(e,t,i){"use strict";i.d(t,{S:()=>a});var n=i(65959),s=i(62199),r=i(74140),o=i(33976);function a(e){return new o.C(function(t,i){return new r.c(function(n){var r,o,a;try{r=i(t).subscribe({next:function(r){r.errors?a=e({graphQLErrors:r.errors,response:r,operation:t,forward:i}):(0,s.uR)(r)&&(a=e({protocolErrors:r.extensions[s.K$],response:r,operation:t,forward:i})),a?o=a.subscribe({next:n.next.bind(n),error:n.error.bind(n),complete:n.complete.bind(n)}):n.next(r)},error:function(s){(a=e({operation:t,networkError:s,graphQLErrors:s&&s.result&&s.result.errors||void 0,forward:i}))?o=a.subscribe({next:n.next.bind(n),error:n.error.bind(n),complete:n.complete.bind(n)}):n.error(s)},complete:function(){a||n.complete.bind(n)()}})}catch(s){e({networkError:s,operation:t,forward:i}),n.error(s)}return function(){r&&r.unsubscribe(),o&&r.unsubscribe()}})})}!function(e){function t(t){var i=e.call(this)||this;return i.link=a(t),i}(0,n.__extends)(t,e),t.prototype.request=function(e,t){return this.link.request(e,t)}}(o.C)},69861(e,t,i){"use strict";i.d(t,{P:()=>o});var n=i(65959),s=i(33976),r=i(68066),o=function(e){function t(t){void 0===t&&(t={});var i=e.call(this,(0,r.$)(t).request)||this;return i.options=t,i}return(0,n.__extends)(t,e),t}(s.C)},7842(e,t,i){"use strict";i.d(t,{S:()=>s});var n=i(85923),s=function(e){if(!e&&"undefined"==typeof fetch)throw(0,n.vA)(51)}},68066(e,t,i){"use strict";i.d(t,{$:()=>b});var n=i(65959),s=i(85923),r=i(33976),o=i(77822),a=i(74140),l=i(98204),c=i(91187),h=i(97747),u=i(7842),d=i(39182),p=i(50358),g=i(26408),f=i(85517),m=i(49666),y=i(73476),v=(0,s.no)(function(){return fetch}),b=function(e){void 0===e&&(e={});var t=e.uri,i=void 0===t?"/graphql":t,b=e.fetch,C=e.print,w=void 0===C?d.i1:C,S=e.includeExtensions,x=e.preserveHeaderCase,E=e.useGETForQueries,A=e.includeUnusedVariables,M=void 0!==A&&A,T=(0,n.__rest)(e,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);!1!==globalThis.__DEV__&&(0,u.S)(b||v);var D={http:{includeExtensions:S,preserveHeaderCase:x},options:T.fetchOptions,credentials:T.credentials,headers:T.headers};return new r.C(function(e){var t=(0,c.z)(e,i),r=e.getContext(),u={};if(r.clientAwareness){var C=r.clientAwareness,S=C.name,x=C.version;S&&(u["apollographql-client-name"]=S),x&&(u["apollographql-client-version"]=x)}var A=(0,n.__assign)((0,n.__assign)({},u),r.headers),T={http:r.http,options:r.fetchOptions,credentials:r.credentials,headers:A};if((0,o.d8)(["client"],e.query)){!1!==globalThis.__DEV__&&!1!==globalThis.__DEV__&&s.V1.warn(52);var I=(0,m.er)(e.query);if(!I)return(0,g.N)(new Error("HttpLink: Trying to send a client-only query to the server. To send to the server, ensure a non-client field is added to the query or set the `transformOptions.removeClientFields` option to `true`."));e.query=I}var R,k,P,_,L,N=(0,d.HY)(e,w,d.R4,D,T),O=N.options,F=N.body;F.variables&&!M&&(F.variables=(R=F.variables,k=e.query,P=(0,n.__assign)({},R),_=new Set(Object.keys(R)),(0,f.YR)(k,{Variable:function(e,t,i){i&&"VariableDefinition"!==i.kind&&_.delete(e.name.value)}}),_.forEach(function(e){delete P[e]}),P)),O.signal||"undefined"==typeof AbortController||(L=new AbortController,O.signal=L.signal);var G,B="OperationDefinition"===(G=(0,y.Vn)(e.query)).kind&&"subscription"===G.operation,V=(0,o.d8)(["defer"],e.query);if(E&&!e.query.definitions.some(function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation})&&(O.method="GET"),V||B){O.headers=O.headers||{};var H="multipart/mixed;";B&&V&&!1!==globalThis.__DEV__&&s.V1.warn(53),B?H+="boundary=graphql;subscriptionSpec=1.0,application/json":V&&(H+="deferSpec=20220824,application/json"),O.headers.accept=H}if("GET"===O.method){var U=(0,p.E)(t,F),z=U.newURI,W=U.parseError;if(W)return(0,g.N)(W);t=z}else try{O.body=(0,l.Y)(F,"Payload")}catch(W){return(0,g.N)(W)}return new a.c(function(i){var n=b||(0,s.no)(function(){return fetch})||v,r=i.next.bind(i);return n(t,O).then(function(t){var i;e.setContext({response:t});var n=null===(i=t.headers)||void 0===i?void 0:i.get("content-type");return null!==n&&/^multipart\/mixed/i.test(n)?(0,h.tD)(t,r):(0,h.OQ)(e)(t).then(r)}).then(function(){L=void 0,i.complete()}).catch(function(e){L=void 0,(0,h.H4)(e,i)}),function(){L&&L.abort()}})})}},5623(e,t,i){"use strict";i.r(t),i.d(t,{HttpLink:()=>h.P,checkFetcher:()=>o.S,createHttpLink:()=>c.$,createSignalIfSupported:()=>a,defaultPrinter:()=>r.i1,fallbackHttpConfig:()=>r.R4,parseAndCheckHttpResponse:()=>n.OQ,rewriteURIForGET:()=>u.E,selectHttpOptionsAndBody:()=>r.Wz,selectHttpOptionsAndBodyInternal:()=>r.HY,selectURI:()=>l.z,serializeFetchParameter:()=>s.Y}),i(85923);var n=i(97747),s=i(98204),r=i(39182),o=i(7842),a=function(){if("undefined"==typeof AbortController)return{controller:!1,signal:!1};var e=new AbortController;return{controller:e,signal:e.signal}},l=i(91187),c=i(68066),h=i(69861),u=i(50358)},97747(e,t,i){"use strict";i.d(t,{H4:()=>g,OQ:()=>f,tD:()=>u});var n=i(65959),s=i(51975);function r(e){var t={next:function(){return e.read()}};return s.uJ&&(t[Symbol.asyncIterator]=function(){return this}),t}function o(e){var t,i,n,o=e;if(e.body&&(o=e.body),n=o,s.uJ&&n[Symbol.asyncIterator])return i=o[Symbol.asyncIterator](),(t={next:function(){return i.next()}})[Symbol.asyncIterator]=function(){return this},t;if(function(e){return!!e.getReader}(o))return r(o.getReader());if(function(e){return!!e.stream}(o))return r(o.stream().getReader());if(function(e){return!!e.arrayBuffer}(o))return function(e){var t=!1,i={next:function(){return t?Promise.resolve({value:void 0,done:!0}):(t=!0,new Promise(function(t,i){e.then(function(e){t({value:e,done:!1})}).catch(i)}))}};return s.uJ&&(i[Symbol.asyncIterator]=function(){return this}),i}(o.arrayBuffer());if(function(e){return!!e.pipe}(o))return function(e){var t=null,i=null,n=!1,r=[],o=[];function a(e){if(!i){if(o.length){var t=o.shift();if(Array.isArray(t)&&t[0])return t[0]({value:e,done:!1})}r.push(e)}}function l(e){i=e,o.slice().forEach(function(t){t[1](e)}),!t||t()}function c(){n=!0,o.slice().forEach(function(e){e[0]({value:void 0,done:!0})}),!t||t()}t=function(){t=null,e.removeListener("data",a),e.removeListener("error",l),e.removeListener("end",c),e.removeListener("finish",c),e.removeListener("close",c)},e.on("data",a),e.on("error",l),e.on("end",c),e.on("finish",c),e.on("close",c);var h={next:function(){return new Promise(function(e,t){return i?t(i):r.length?e({value:r.shift(),done:!1}):n?e({value:void 0,done:!0}):void o.push([e,t])})}};return s.uJ&&(h[Symbol.asyncIterator]=function(){return this}),h}(o);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var a=i(82343),l=i(62199),c=i(11177),h=Object.prototype.hasOwnProperty;function u(e,t){return(0,n.__awaiter)(this,void 0,void 0,function(){var i,s,r,a,h,u,g,f,m,y,v,b,C,w,S,x,E,A,M,T,D,I,R,k;return(0,n.__generator)(this,function(P){switch(P.label){case 0:if(void 0===TextDecoder)throw new Error("TextDecoder must be defined in the environment: please import a polyfill.");i=new TextDecoder("utf-8"),s=null===(k=e.headers)||void 0===k?void 0:k.get("content-type"),r="boundary=",a=(null==s?void 0:s.includes(r))?null==s?void 0:s.substring((null==s?void 0:s.indexOf(r))+9).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",h="\r\n--".concat(a),u="",g=o(e),f=!0,P.label=1;case 1:return f?[4,g.next()]:[3,3];case 2:for(m=P.sent(),y=m.value,v=m.done,b="string"==typeof y?y:i.decode(y),C=u.length-h.length+1,f=!v,w=(u+=b).indexOf(h,C);w>-1;){if(S=void 0,I=[u.slice(0,w),u.slice(w+h.length)],u=I[1],x=(S=I[0]).indexOf("\r\n\r\n"),E=d(S.slice(0,x)),(A=E["content-type"])&&-1===A.toLowerCase().indexOf("application/json"))throw new Error("Unsupported patch content type: application/json is required.");if(M=S.slice(x))if(T=p(e,M),Object.keys(T).length>1||"data"in T||"incremental"in T||"errors"in T||"payload"in T)if((0,c.Nw)(T)){if(D={},"payload"in T){if(1===Object.keys(T).length&&null===T.payload)return[2];D=(0,n.__assign)({},T.payload)}"errors"in T&&(D=(0,n.__assign)((0,n.__assign)({},D),{extensions:(0,n.__assign)((0,n.__assign)({},"extensions"in D?D.extensions:null),(R={},R[l.K$]=T.errors,R))})),t(D)}else t(T);else if(1===Object.keys(T).length&&"hasNext"in T&&!T.hasNext)return[2];w=u.indexOf(h)}return[3,1];case 3:return[2]}})})}function d(e){var t={};return e.split("\n").forEach(function(e){var i=e.indexOf(":");if(i>-1){var n=e.slice(0,i).trim().toLowerCase(),s=e.slice(i+1).trim();t[n]=s}}),t}function p(e,t){e.status>=300&&(0,a.A)(e,function(){try{return JSON.parse(t)}catch(e){return t}}(),"Response not successful: Received status code ".concat(e.status));try{return JSON.parse(t)}catch(n){var i=n;throw i.name="ServerParseError",i.response=e,i.statusCode=e.status,i.bodyText=t,i}}function g(e,t){e.result&&e.result.errors&&e.result.data&&t.next(e.result),t.error(e)}function f(e){return function(t){return t.text().then(function(e){return p(t,e)}).then(function(i){return Array.isArray(i)||h.call(i,"data")||h.call(i,"errors")||(0,a.A)(t,i,"Server response was missing for query '".concat(Array.isArray(e)?e.map(function(e){return e.operationName}):e.operationName,"'.")),i})}}},50358(e,t,i){"use strict";i.d(t,{E:()=>s});var n=i(98204);function s(e,t){var i=[],s=function(e,t){i.push("".concat(e,"=").concat(encodeURIComponent(t)))};if("query"in t&&s("query",t.query),t.operationName&&s("operationName",t.operationName),t.variables){var r=void 0;try{r=(0,n.Y)(t.variables,"Variables map")}catch(e){return{parseError:e}}s("variables",r)}if(t.extensions){var o=void 0;try{o=(0,n.Y)(t.extensions,"Extensions map")}catch(e){return{parseError:e}}s("extensions",o)}var a="",l=e,c=e.indexOf("#");-1!==c&&(a=e.substr(c),l=e.substr(0,c));var h=-1===l.indexOf("?")?"?":"&";return{newURI:l+h+i.join("&")+a}}},39182(e,t,i){"use strict";i.d(t,{HY:()=>l,R4:()=>r,Wz:()=>a,i1:()=>o});var n=i(65959),s=i(84305),r={http:{includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},o=function(e,t){return t(e)};function a(e,t){for(var i=[],s=2;s<arguments.length;s++)i[s-2]=arguments[s];return i.unshift(t),l.apply(void 0,(0,n.__spreadArray)([e,o],i,!1))}function l(e,t){for(var i=[],r=2;r<arguments.length;r++)i[r-2]=arguments[r];var o={},a={};i.forEach(function(e){o=(0,n.__assign)((0,n.__assign)((0,n.__assign)({},o),e.options),{headers:(0,n.__assign)((0,n.__assign)({},o.headers),e.headers)}),e.credentials&&(o.credentials=e.credentials),a=(0,n.__assign)((0,n.__assign)({},a),e.http)}),o.headers&&(o.headers=function(e,t){if(!t){var i={};return Object.keys(Object(e)).forEach(function(t){i[t.toLowerCase()]=e[t]}),i}var n={};Object.keys(Object(e)).forEach(function(t){n[t.toLowerCase()]={originalName:t,value:e[t]}});var s={};return Object.keys(n).forEach(function(e){s[n[e].originalName]=n[e].value}),s}(o.headers,a.preserveHeaderCase));var l=e.operationName,c=e.extensions,h=e.variables,u=e.query,d={operationName:l,variables:h};return a.includeExtensions&&(d.extensions=c),a.includeQuery&&(d.query=t(u,s.y)),{options:o,body:d}}},91187(e,t,i){"use strict";i.d(t,{z:()=>n});var n=function(e,t){return e.getContext().uri||("function"==typeof t?t(e):t||"/graphql")}},98204(e,t,i){"use strict";i.d(t,{Y:()=>s});var n=i(85923),s=function(e,t){var i;try{i=JSON.stringify(e)}catch(e){var s=(0,n.vA)(54,t,e.message);throw s.parseError=e,s}return i}},26408(e,t,i){"use strict";i.d(t,{N:()=>s});var n=i(74140);function s(e){return new n.c(function(t){t.error(e)})}},82343(e,t,i){"use strict";i.d(t,{A:()=>n});var n=function(e,t,i){var n=new Error(i);throw n.name="ServerError",n.response=e,n.statusCode=e.status,n.result=t,n}},207(e,t,i){"use strict";i.d(t,{S:()=>c});var n=i(49270),s=i(77822),r=i(77038),o=i(58737),a=i(98453),l=i(85923);function c(e,t,i){return a.yV.withValue(!0,function(){var n=h(e,t,i,!1);return Object.isFrozen(e)&&(0,o.G)(n),n})}function h(e,t,i,o,a){var c,d=i.knownChanged,p=function(e,t){if(t.has(e))return t.get(e);var i=Array.isArray(e)?[]:Object.create(null);return t.set(e,i),i}(e,i.mutableTargets);if(Array.isArray(e)){for(var g=0,f=Array.from(e.entries());g<f.length;g++){var m=f[g],y=m[0],v=m[1];if(null!==v){var b=h(v,t,i,o,!1!==globalThis.__DEV__?"".concat(a||"","[").concat(y,"]"):void 0);d.has(b)&&d.add(p),p[y]=b}else p[y]=null}return d.has(p)?p:e}for(var C=0,w=t.selections;C<w.length;C++){var S=w[C],x=void 0;if(o&&d.add(p),S.kind===n.b.FIELD){var E=(0,r.ue)(S),A=S.selectionSet;if(void 0===(x=p[E]||e[E]))continue;A&&null!==x&&(b=h(e[E],A,i,o,!1!==globalThis.__DEV__?"".concat(a||"",".").concat(E):void 0),d.has(b)&&(x=b)),!1===globalThis.__DEV__&&(p[E]=x),!1!==globalThis.__DEV__&&(o&&"__typename"!==E&&!(null===(c=Object.getOwnPropertyDescriptor(p,E))||void 0===c?void 0:c.value)?Object.defineProperty(p,E,u(E,x,a||"",i.operationName,i.operationType)):(delete p[E],p[E]=x))}if(S.kind!==n.b.INLINE_FRAGMENT||S.typeCondition&&!i.cache.fragmentMatches(S,e.__typename)||(x=h(e,S.selectionSet,i,o,a)),S.kind===n.b.FRAGMENT_SPREAD){var M=S.name.value,T=i.fragmentMap[M]||(i.fragmentMap[M]=i.cache.lookupFragment(M));(0,l.V1)(T,59,M);var D=(0,s.s7)(S);"mask"!==D&&(x=h(e,T.selectionSet,i,"migrate"===D,a))}d.has(x)&&d.add(p)}return"__typename"in e&&!("__typename"in p)&&(p.__typename=e.__typename),Object.keys(p).length!==Object.keys(e).length&&d.add(p),d.has(p)?p:e}function u(e,t,i,n,s){var r=function(){return a.yV.getValue()||(!1!==globalThis.__DEV__&&l.V1.warn(60,n?"".concat(s," '").concat(n,"'"):"anonymous ".concat(s),"".concat(i,".").concat(e).replace(/^\./,"")),r=function(){return t}),t};return{get:function(){return r()},set:function(e){r=function(){return e}},enumerable:!0,configurable:!0}}},67558(e,t,i){"use strict";i.d(t,{z:()=>h});var n=i(49270),s=i(98453),r=i(85923),o=i(45063),a=i(207),l=i(87819),c=i(73476);function h(e,t,i,h){if(!i.fragmentMatches)return!1!==globalThis.__DEV__&&(0,s.Ki)(),e;var u=t.definitions.filter(function(e){return e.kind===n.b.FRAGMENT_DEFINITION});void 0===h&&((0,r.V1)(1===u.length,61,u.length),h=u[0].name.value);var d=u.find(function(e){return e.name.value===h});return(0,r.V1)(!!d,62,h),null==e||(0,o.A)(e,{})?e:(0,a.S)(e,d.selectionSet,{operationType:"fragment",operationName:d.name.value,fragmentMap:(0,l.JG)((0,c.zK)(t)),cache:i,mutableTargets:new s.jq,knownChanged:new s.xm})}},98453(e,t,i){"use strict";i.d(t,{Ki:()=>h,jq:()=>o,xm:()=>a,yV:()=>l});var n=i(1645),s=i(85923),r=i(51975),o=r.et?WeakMap:Map,a=r.En?WeakSet:Set,l=new n.DX,c=!1;function h(){c||(c=!0,!1!==globalThis.__DEV__&&s.V1.warn(64))}},61293(e,t,i){"use strict";i.d(t,{s:()=>a});var n=i(5821),s=i(86128),r=i(86643),o=i(85923);function a(e){(0,r.k)("<Mutation />",function(){!1!==globalThis.__DEV__&&o.V1.warn(65)});var t=(0,s.n)(e.mutation,e),i=t[0],n=t[1];return e.children?e.children(i,n):null}a.propTypes={mutation:n.object.isRequired,variables:n.object,optimisticResponse:n.oneOfType([n.object,n.func]),refetchQueries:n.oneOfType([n.arrayOf(n.oneOfType([n.string,n.object])),n.func]),awaitRefetchQueries:n.bool,update:n.func,children:n.func.isRequired,onCompleted:n.func,onError:n.func,fetchPolicy:n.string}},82136(e,t,i){"use strict";i.d(t,{X:()=>l});var n=i(65959),s=i(5821),r=i(65e3),o=i(85923),a=i(86643);function l(e){(0,a.k)("<Query />",function(){!1!==globalThis.__DEV__&&o.V1.warn(66)});var t=e.children,i=e.query,s=(0,n.__rest)(e,["children","query"]),l=(0,r.IT)(i,s);return l?t(l):null}l.propTypes={client:s.object,children:s.func.isRequired,fetchPolicy:s.string,notifyOnNetworkStatusChange:s.bool,onCompleted:s.func,onError:s.func,pollInterval:s.number,query:s.object.isRequired,variables:s.object,ssr:s.bool,partialRefetch:s.bool,returnPartialData:s.bool}},66489(e,t,i){"use strict";var n;i.d(t,{l:()=>l});var s=i(63780),r=i(51975),o=i(85923),a=r.ol?Symbol.for("__APOLLO_CONTEXT__"):"__APOLLO_CONTEXT__";function l(){(0,o.V1)("createContext"in(n||(n=i.t(s,2))),69);var e=s.createContext[a];return e||(Object.defineProperty(s.createContext,a,{value:e=s.createContext({}),enumerable:!1,writable:!1,configurable:!0}),e.displayName="ApolloContext"),e}},43681(e,t,i){"use strict";i.d(t,{X:()=>a});var n=i(65959),s=i(85923),r=i(63780),o=i(66489),a=function(e){var t=e.client,i=e.children,a=(0,o.l)(),l=r.useContext(a),c=r.useMemo(function(){return(0,n.__assign)((0,n.__assign)({},l),{client:t||l.client})},[l,t]);return(0,s.V1)(c.client,71),r.createElement(a.Provider,{value:c},i)}},76476(e,t,i){"use strict";i.d(t,{U:()=>w});var n=i(50255),s=i(65959),r=i(63780),o=i(4674),a=i(82136),l=i(85923),c=function(){return{}},h=function(){return!1};function u(e){return e.displayName||e.name||"Component"}function d(e,t){for(var i={},n=0,s=e.variables;n<s.length;n++){var r=s[n],o=r.variable,a=r.type;if(o.name&&o.name.value){var l=o.name.value,c=t[l];void 0===c?"NonNullType"!==a.kind&&(i[l]=void 0):i[l]=c}}return i}var p=function(e){function t(t){var i=e.call(this,t)||this;return i.withRef=!1,i.setWrappedInstance=i.setWrappedInstance.bind(i),i}return(0,s.__extends)(t,e),t.prototype.getWrappedInstance=function(){return(0,l.V1)(this.withRef,73),this.wrappedInstance},t.prototype.setWrappedInstance=function(e){this.wrappedInstance=e},t}(r.Component),g=i(92981),f=i(23549),m=i(61293),y=i(5821),v=i(58490),b=i(86643);function C(e){(0,b.k)("<Subscription />",function(){!1!==globalThis.__DEV__&&l.V1.warn(67)});var t=(0,v.R)(e.subscription,e);return e.children&&t?e.children(t):null}function w(e,t){switch(void 0===t&&(t={}),!1!==globalThis.__DEV__&&(0,f.S2)("graphql",function(){!1!==globalThis.__DEV__&&l.V1.warn(72)}),(0,f.lz)("parser",function(){return(0,n.K3)(e).type})){case n.KG.Mutation:return(0,f.lz)("withMutation",function(){return function(e,t){void 0===t&&(t={}),!1!==globalThis.__DEV__&&(0,f.S2)("withMutation",function(){!1!==globalThis.__DEV__&&l.V1.warn(74)});var i=(0,f.lz)("parser",n.K3,[e]),a=t.options,h=void 0===a?c:a,g=t.alias,y=void 0===g?"Apollo":g,v=h;return"function"!=typeof v&&(v=function(){return h}),function(n){var a="".concat(y,"(").concat(u(n),")"),l=function(o){function l(){return null!==o&&o.apply(this,arguments)||this}return(0,s.__extends)(l,o),l.prototype.render=function(){var o=this.props,a=v(o);return t.withRef&&(this.withRef=!0,o=Object.assign({},o,{ref:this.setWrappedInstance})),!a.variables&&i.variables.length>0&&(a.variables=d(i,o)),r.createElement(m.s,(0,s.__assign)({ignoreResults:!0},a,{mutation:e}),function(e,i){var a,l,c=i.data,h=(0,s.__rest)(i,["data"]),u=Object.assign(h,c||{}),d=t.name||"mutate",p=t.name?"".concat(d,"Result"):"result",g=((a={})[d]=e,a[p]=u,a);if(t.props){var f=((l={})[d]=e,l[p]=u,l.ownProps=o,l);g=t.props(f)}return r.createElement(n,(0,s.__assign)({},o,g))})},l.displayName=a,l.WrappedComponent=n,l}(p);return o(l,n,{})}}(e,t)});case n.KG.Subscription:return(0,f.lz)("withSubscription",function(){return function(e,t){void 0===t&&(t={}),!1!==globalThis.__DEV__&&(0,f.S2)("withSubscription",function(){!1!==globalThis.__DEV__&&l.V1.warn(76)});var i=(0,f.lz)("parser",n.K3,[e]),a=t.options,g=void 0===a?c:a,m=t.skip,y=void 0===m?h:m,v=t.alias,b=void 0===v?"Apollo":v,w=t.shouldResubscribe,S=g;"function"!=typeof S&&(S=function(){return g});var x,E=y;return"function"!=typeof E&&(E=function(){return y}),function(n){var a="".concat(b,"(").concat(u(n),")"),l=function(o){function l(e){var t=o.call(this,e)||this;return t.state={resubscribe:!1},t}return(0,s.__extends)(l,o),l.prototype.updateResubscribe=function(e){this.setState({resubscribe:e})},l.prototype.componentDidUpdate=function(e){var t=!(!w||!w(e,this.props));this.state.resubscribe!==t&&this.updateResubscribe(t)},l.prototype.render=function(){var o=this,l=this.props,c=E(l),h=c?Object.create(null):S(l);return!c&&!h.variables&&i.variables.length>0&&(h.variables=d(i,l)),r.createElement(C,(0,s.__assign)({},h,{displayName:a,skip:c,subscription:e,shouldResubscribe:this.state.resubscribe}),function(e){var i,a,h=e.data,u=(0,s.__rest)(e,["data"]);if(t.withRef&&(o.withRef=!0,l=Object.assign({},l,{ref:o.setWrappedInstance})),c)return r.createElement(n,(0,s.__assign)({},l,{}));var d=Object.assign(u,h||{}),p=t.name||"data",g=((i={})[p]=d,i);if(t.props){var f=((a={})[p]=d,a.ownProps=l,a);g=x=t.props(f,x)}return r.createElement(n,(0,s.__assign)({},l,g))})},l.displayName=a,l.WrappedComponent=n,l}(p);return o(l,n,{})}}(e,t)});case n.KG.Query:default:return(0,f.lz)("withQuery",function(){return function(e,t){void 0===t&&(t={}),!1!==globalThis.__DEV__&&(0,f.S2)("withQuery",function(){!1!==globalThis.__DEV__&&g.Ay.warn(75)});var i=(0,f.lz)("parser",n.K3,[e]),l=t.options,m=void 0===l?c:l,y=t.skip,v=void 0===y?h:y,b=t.alias,C=void 0===b?"Apollo":b,w=m;"function"!=typeof w&&(w=function(){return m});var S,x=v;return"function"!=typeof x&&(x=function(){return v}),function(n){var l="".concat(C,"(").concat(u(n),")"),c=function(o){function c(){return null!==o&&o.apply(this,arguments)||this}return(0,s.__extends)(c,o),c.prototype.render=function(){var o=this,c=this.props,h=x(c),u=h?Object.create(null):(0,s.__assign)({},w(c));return!h&&!u.variables&&i.variables.length>0&&(u.variables=d(i,c)),r.createElement(a.X,(0,s.__assign)({},u,{displayName:l,skip:h,query:e}),function(e){e.client;var i,a,l=e.data,u=(0,s.__rest)(e,["client","data"]);if(t.withRef&&(o.withRef=!0,c=Object.assign({},c,{ref:o.setWrappedInstance})),h)return r.createElement(n,(0,s.__assign)({},c,{}));var d=Object.assign(u,l||{}),p=t.name||"data",g=((i={})[p]=d,i);if(t.props){var f=((a={})[p]=d,a.ownProps=c,a);g=S=t.props(f,S)}return r.createElement(n,(0,s.__assign)({},c,g))})},c.displayName=l,c.WrappedComponent=n,c}(p);return o(c,n,{})}}(e,t)})}}C.propTypes={subscription:y.object.isRequired,variables:y.object,children:y.func,onSubscriptionData:y.func,onData:y.func,onSubscriptionComplete:y.func,onComplete:y.func,shouldResubscribe:y.oneOfType([y.func,y.bool])}},12262(e,t,i){"use strict";i.d(t,{W:()=>c});var n=i(65959),s=i(85923),r=i(63780),o=i(4674),a=i(66489),l=function(e){var t=(0,a.l)();return r.createElement(t.Consumer,null,function(t){return(0,s.V1)(t&&t.client,68),e.children(t.client)})};function c(e,t){void 0===t&&(t={});var i="withApollo(".concat(function(e){return e.displayName||e.name||"Component"}(e),")"),a=function(o){function a(e){var t=o.call(this,e)||this;return t.setWrappedInstance=t.setWrappedInstance.bind(t),t}return(0,n.__extends)(a,o),a.prototype.getWrappedInstance=function(){return(0,s.V1)(t.withRef,77),this.wrappedInstance},a.prototype.setWrappedInstance=function(e){this.wrappedInstance=e},a.prototype.render=function(){var i=this;return r.createElement(l,null,function(s){var o=Object.assign({},i.props,{client:s,ref:t.withRef?i.setWrappedInstance:void 0});return r.createElement(e,(0,n.__assign)({},o))})},a.displayName=i,a.WrappedComponent=e,a}(r.Component);return o(a,e,{})}},32505(e,t,i){"use strict";i.d(t,{E:()=>s});var n=i(63780),s=i(51975).Sw?n.useLayoutEffect:n.useEffect},86643(e,t,i){"use strict";i.d(t,{k:()=>r});var n=i(63780),s=i(23549);function r(e,t){var i=n.useRef(!1);!1!==globalThis.__DEV__&&(i.current||(0,s.S2)(e,t),i.current=!0)}},73270(e,t,i){"use strict";i.d(t,{h:()=>r});var n=i(63780),s=i(85923);function r(e,t,i,r){void 0===r&&(r="Please remove this option.");var o=n.useRef(!1);t in e&&!o.current&&(!1!==globalThis.__DEV__&&s.V1.warn(78,i,t,r),o.current=!0)}},68131(e,t,i){"use strict";i.d(t,{m:()=>o});var n=i(85923),s=i(63780),r=i(66489);function o(e){var t=s.useContext((0,r.l)()),i=e||t.client;return(0,n.V1)(!!i,79),i}},20262(e,t,i){"use strict";i.d(t,{_:()=>m});var n,s=i(65959),r=i(63780),o=i(22260),a=i(65e3),l=i(32505),c=i(73270),h=i(66223),u=i(23549);function d(){}var p=["refetch","reobserve","fetchMore","updateQuery","startPolling","stopPolling","subscribeToMore"],g=["initialFetchPolicy","onCompleted","onError","defaultOptions","partialRefetch","canonizeResults"],f=["query","ssr","client","fetchPolicy","nextFetchPolicy","refetchWritePolicy","errorPolicy","pollInterval","notifyOnNetworkStatusChange","returnPartialData","skipPollAttempt"];function m(e,t){var i;if(!1!==globalThis.__DEV__){var m=t||{};(0,c.h)(m,"canonizeResults","useLazyQuery"),(0,c.h)(m,"variables","useLazyQuery","Pass all `variables` to the returned `execute` function instead."),(0,c.h)(m,"context","useLazyQuery","Pass `context` to the returned `execute` function instead."),(0,c.h)(m,"onCompleted","useLazyQuery","If your `onCompleted` callback sets local state, switch to use derived state using `data` returned from the hook instead. Use `useEffect` to perform side-effects as a result of updates to `data`."),(0,c.h)(m,"onError","useLazyQuery","If your `onError` callback sets local state, switch to use derived state using `data`, `error` or `errors` returned from the hook instead. Use `useEffect` if you need to perform side-effects as a result of updates to `data`, `error` or `errors`."),(0,c.h)(m,"defaultOptions","useLazyQuery","Pass the options directly to the hook instead."),(0,c.h)(m,"initialFetchPolicy","useLazyQuery","Use the `fetchPolicy` option instead."),(0,c.h)(m,"partialRefetch","useLazyQuery")}var y=r.useRef(void 0),v=r.useRef(void 0),b=r.useRef(void 0),C=(0,o.l)(t,y.current||{}),w=null!==(i=null==C?void 0:C.query)&&void 0!==i?i:e;v.current=t,b.current=w;var S=(0,s.__assign)((0,s.__assign)({},C),{skip:!y.current}),x=(0,a.SX)(w,S),E=x.obsQueryFields,A=x.result,M=x.client,T=x.resultData,D=x.observable,I=x.onQueryExecuted,R=D.options.initialFetchPolicy||(0,a.kk)(S.defaultOptions,M.defaultOptions),k=r.useReducer(function(e){return e+1},0)[1],P=r.useMemo(function(){for(var e={},t=function(t){var i=E[t];e[t]=function(){return!1!==globalThis.__DEV__&&"reobserve"===t&&!1!==globalThis.__DEV__&&h.V1.warn(80),y.current||(y.current=Object.create(null),k()),i.apply(this,arguments)}},i=0,n=p;i<n.length;i++)t(n[i]);return e},[k,E]),_=!!y.current,L=r.useMemo(function(){return(0,s.__assign)((0,s.__assign)((0,s.__assign)({},A),P),{called:_})},[A,P,_]),N=(n||(n=r.createContext(null)),r.useCallback(function(){var e=console.error;try{return console.error=d,r.useContext(n),!0}catch(e){return!1}finally{console.error=e}},[])),O=r.useRef(new Set),F=r.useCallback(function(e){if(!1!==globalThis.__DEV__){N()&&!1!==globalThis.__DEV__&&h.V1.warn(81);for(var t=0,i=g;t<i.length;t++){var n=i[t];O.current.has(n)||((0,u.cc)(e||{},n,"useLazyQuery.execute"),O.current.add(n))}for(var r=0,l=f;r<l.length;r++){var c=l[r];O.current.has(c)||((0,u.cc)(e||{},c,"useLazyQuery.execute","Please pass the option to the `useLazyQuery` hook instead."),O.current.add(c))}}y.current=e?(0,s.__assign)((0,s.__assign)({},e),{fetchPolicy:e.fetchPolicy||R}):{fetchPolicy:R};var d=(0,o.l)(v.current,(0,s.__assign)({query:b.current},y.current)),p=function(e,t,i,n,s,r){var o=s.query||n,l=(0,a.Er)(i,o,s,!1)(t),c=t.reobserveAsConcast((0,a.t_)(t,i,s,l));return r(l),new Promise(function(n){var s;c.subscribe({next:function(e){s=e},error:function(){n((0,a.$X)(t.getCurrentResult(),e.previousData,t,i))},complete:function(){n((0,a.$X)(t.maskResult(s),e.previousData,t,i))}})})}(T,D,M,w,(0,s.__assign)((0,s.__assign)({},d),{skip:!1}),I).then(function(e){return Object.assign(e,P)});return p.catch(function(){}),p},[N,M,w,P,R,D,T,I]),G=r.useRef(F);(0,l.E)(function(){G.current=F});var B=r.useCallback(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return G.current.apply(G,e)},[]);return[B,L]}},86128(e,t,i){"use strict";i.d(t,{n:()=>d});var n=i(65959),s=i(63780),r=i(22260),o=i(45063),a=i(50255),l=i(62199),c=i(68131),h=i(32505),u=i(73270);function d(e,t){!1!==globalThis.__DEV__&&(0,u.h)(t||{},"ignoreResults","useMutation","If you don't want to synchronize component state with the mutation, please use the `useApolloClient` hook to get the client instance and call `client.mutate` directly.");var i=(0,c.m)(null==t?void 0:t.client);(0,a.D$)(e,a.KG.Mutation);var d=s.useState({called:!1,loading:!1,client:i}),p=d[0],g=d[1],f=s.useRef({result:p,mutationId:0,isMounted:!0,client:i,mutation:e,options:t});(0,h.E)(function(){Object.assign(f.current,{client:i,options:t,mutation:e})});var m=s.useCallback(function(e){void 0===e&&(e={});var t=f.current,i=t.options,s=t.mutation,a=(0,n.__assign)((0,n.__assign)({},i),{mutation:s}),c=e.client||f.current.client;f.current.result.loading||a.ignoreResults||!f.current.isMounted||g(f.current.result={loading:!0,error:void 0,data:void 0,called:!0,client:c});var h=++f.current.mutationId,u=(0,r.l)(a,e);return c.mutate(u).then(function(t){var i,n,s=t.data,r=t.errors,a=r&&r.length>0?new l.K4({graphQLErrors:r}):void 0,d=e.onError||(null===(i=f.current.options)||void 0===i?void 0:i.onError);if(a&&d&&d(a,u),h===f.current.mutationId&&!u.ignoreResults){var p={called:!0,loading:!1,data:s,error:a,client:c};f.current.isMounted&&!(0,o.L)(f.current.result,p)&&g(f.current.result=p)}var m=e.onCompleted||(null===(n=f.current.options)||void 0===n?void 0:n.onCompleted);return a||null==m||m(t.data,u),t},function(t){var i;if(h===f.current.mutationId&&f.current.isMounted){var n={loading:!1,error:t,data:void 0,called:!0,client:c};(0,o.L)(f.current.result,n)||g(f.current.result=n)}var s=e.onError||(null===(i=f.current.options)||void 0===i?void 0:i.onError);if(s)return s(t,u),{data:void 0,errors:t};throw t})},[]),y=s.useCallback(function(){if(f.current.isMounted){var e={called:!1,loading:!1,client:f.current.client};Object.assign(f.current,{mutationId:0,result:e}),g(e)}},[]);return s.useEffect(function(){var e=f.current;return e.isMounted=!0,function(){e.isMounted=!1}},[]),[m,(0,n.__assign)({reset:y},p)]}},65e3(e,t,i){"use strict";i.d(t,{Er:()=>T,kk:()=>k,t_:()=>D,jy:()=>P,$X:()=>_,IT:()=>E,SX:()=>M});var n=i(65959),s=i(85923),r=i(63780),o=i(34958),a=i(45063),l=i(22260),c=i(66489),h=i(62199),u=i(42248),d=i(28299),p=i(50255),g=i(68131),f=i(93565),m=i(24568),y=i(58737),v=Symbol.for("apollo.hook.wrappers"),b=i(73270),C=i(23549),w=Object.prototype.hasOwnProperty;function S(){}var x=Symbol();function E(e,t){return void 0===t&&(t=Object.create(null)),(i=A,(r=(s=(n=(0,g.m)(t&&t.client).queryManager)&&n[v])&&s.useQuery)?r(i):i)(e,t);var i,n,s,r}function A(e,t){!1!==globalThis.__DEV__&&((0,b.h)(t,"canonizeResults","useQuery"),(0,b.h)(t,"partialRefetch","useQuery"),(0,b.h)(t,"defaultOptions","useQuery","Pass the options directly to the hook instead."),(0,b.h)(t,"onCompleted","useQuery","If your `onCompleted` callback sets local state, switch to use derived state using `data` returned from the hook instead. Use `useEffect` to perform side-effects as a result of updates to `data`."),(0,b.h)(t,"onError","useQuery","If your `onError` callback sets local state, switch to use derived state using `data`, `error` or `errors` returned from the hook instead. Use `useEffect` if you need to perform side-effects as a result of updates to `data`, `error` or `errors`."));var i=M(e,t),s=i.result,o=i.obsQueryFields;return r.useMemo(function(){return(0,n.__assign)((0,n.__assign)({},s),o)},[s,o])}function M(e,t){var i=(0,g.m)(t.client),l=r.useContext((0,c.l)()).renderPromises,h=!!l,f=i.disableNetworkFetches,m=!1!==t.ssr&&!t.skip,y=t.partialRefetch,v=T(i,e,t,h),b=function(e,t,i,s,o){function a(n){var r;return(0,p.D$)(t,p.KG.Query),{client:e,query:t,observable:s&&s.getSSRObservable(o())||u.U.inactiveOnCreation.withValue(!s,function(){return(0,C.lz)("canonizeResults",function(){return e.watchQuery(D(void 0,e,i,o()))})}),resultData:{previousData:null===(r=null==n?void 0:n.resultData.current)||void 0===r?void 0:r.data}}}var l=r.useState(a),c=l[0],h=l[1];function d(e){var t,i;Object.assign(c.observable,((t={})[x]=e,t));var s=c.resultData;h((0,n.__assign)((0,n.__assign)({},c),{query:e.query,resultData:Object.assign(s,{previousData:(null===(i=s.current)||void 0===i?void 0:i.data)||s.previousData,current:void 0})}))}if(e!==c.client||t!==c.query){var g=a(c);return h(g),[g,d]}return[c,d]}(i,e,t,l,v),E=b[0],A=E.observable,M=E.resultData,k=b[1],P=v(A);!function(e,t,i,n,s){var r;t[x]&&!(0,a.L)(t[x],s)&&(t.reobserve(D(t,i,n,s)),e.previousData=(null===(r=e.current)||void 0===r?void 0:r.data)||e.previousData,e.current=void 0),t[x]=s}(M,A,i,t,P);var O=r.useMemo(function(){return function(e){return{refetch:e.refetch.bind(e),reobserve:function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return!1!==globalThis.__DEV__&&!1!==globalThis.__DEV__&&s.V1.warn(84),e.reobserve.apply(e,t)},fetchMore:e.fetchMore.bind(e),updateQuery:e.updateQuery.bind(e),startPolling:e.startPolling.bind(e),stopPolling:e.stopPolling.bind(e),subscribeToMore:e.subscribeToMore.bind(e)}}(A)},[A]);!function(e,t,i){t&&i&&(t.registerSSRObservable(e),e.getCurrentResult().loading&&t.addObservableQueryPromise(e))}(A,l,m);var F=function(e,t,i,n,s,l,c,h,u){var p=r.useRef(u);r.useEffect(function(){p.current=u});var g=!h&&!l||!1!==n.ssr||n.skip?n.skip||"standby"===s.fetchPolicy?N:void 0:L,f=e.previousData,m=r.useMemo(function(){return g&&_(g,f,t,i)},[i,t,g,f]);return(0,o.r)(r.useCallback(function(n){if(h)return function(){};var s=function(){var s=e.current,r=t.getCurrentResult();s&&s.loading===r.loading&&s.networkStatus===r.networkStatus&&(0,a.L)(s.data,r.data)||I(r,e,t,i,c,n,p.current)},r=function(l){if(o.current.unsubscribe(),o.current=t.resubscribeAfterError(s,r),!w.call(l,"graphQLErrors"))throw l;var h=e.current;(!h||h&&h.loading||!(0,a.L)(l,h.error))&&I({data:h&&h.data,error:l,loading:!1,networkStatus:d.pT.error},e,t,i,c,n,p.current)},o={current:t.subscribe(s,r)};return function(){setTimeout(function(){return o.current.unsubscribe()})}},[l,h,t,e,c,i]),function(){return m||R(e,t,p.current,c,i)},function(){return m||R(e,t,p.current,c,i)})}(M,A,i,t,P,f,y,h,{onCompleted:t.onCompleted||S,onError:t.onError||S});return{result:F,obsQueryFields:O,observable:A,resultData:M,client:i,onQueryExecuted:k}}function T(e,t,i,s){void 0===i&&(i={});var r=i.skip,o=(i.ssr,i.onCompleted,i.onError,i.defaultOptions),a=(0,n.__rest)(i,["skip","ssr","onCompleted","onError","defaultOptions"]);return function(i){var n=Object.assign(a,{query:t});return!s||"network-only"!==n.fetchPolicy&&"cache-and-network"!==n.fetchPolicy||(n.fetchPolicy="cache-first"),n.variables||(n.variables={}),r?(n.initialFetchPolicy=n.initialFetchPolicy||n.fetchPolicy||k(o,e.defaultOptions),n.fetchPolicy="standby"):n.fetchPolicy||(n.fetchPolicy=(null==i?void 0:i.options.initialFetchPolicy)||k(o,e.defaultOptions)),n}}function D(e,t,i,n){var s=[],r=t.defaultOptions.watchQuery;return r&&s.push(r),i.defaultOptions&&s.push(i.defaultOptions),s.push((0,f.o)(e&&e.options,n)),s.reduce(l.l)}function I(e,t,i,r,o,a,l){var c=t.current;c&&c.data&&(t.previousData=c.data),!e.error&&(0,m.E)(e.errors)&&(e.error=new h.K4({graphQLErrors:e.errors})),t.current=_(function(e,t,i){return!e.partial||!i||e.loading||e.data&&0!==Object.keys(e.data).length||"cache-only"===t.options.fetchPolicy?e:(t.refetch(),(0,n.__assign)((0,n.__assign)({},e),{loading:!0,networkStatus:d.pT.refetch}))}(e,i,o),t.previousData,i,r),a(),function(e,t,i){if(!e.loading){var n=P(e);Promise.resolve().then(function(){n?i.onError(n):e.data&&t!==e.networkStatus&&e.networkStatus===d.pT.ready&&i.onCompleted(e.data)}).catch(function(e){!1!==globalThis.__DEV__&&s.V1.warn(e)})}}(e,null==c?void 0:c.networkStatus,l)}function R(e,t,i,n,s){return e.current||I(t.getCurrentResult(),e,t,s,n,function(){},i),e.current}function k(e,t){var i;return(null==e?void 0:e.fetchPolicy)||(null===(i=null==t?void 0:t.watchQuery)||void 0===i?void 0:i.fetchPolicy)||"cache-first"}function P(e){return(0,m.E)(e.errors)?new h.K4({graphQLErrors:e.errors}):e.error}function _(e,t,i,s){var r=e.data,o=(e.partial,(0,n.__rest)(e,["data","partial"]));return(0,n.__assign)((0,n.__assign)({data:r},o),{client:s,observable:i,variables:i.variables,called:e!==L&&e!==N,previousData:t})}var L=(0,y.G)({loading:!0,data:void 0,error:void 0,networkStatus:d.pT.loading}),N=(0,y.G)({loading:!1,data:void 0,error:void 0,networkStatus:d.pT.ready})},58490(e,t,i){"use strict";i.d(t,{R:()=>g});var n=i(65959),s=i(85923),r=i(63780),o=i(45063),a=i(50255),l=i(62199),c=i(74140),h=i(68131),u=i(34958),d=i(65e3),p=i(32505);function g(e,t){void 0===t&&(t=Object.create(null));var i=r.useRef(!1),g=(0,h.m)(t.client);(0,a.D$)(e,a.KG.Subscription),i.current||(i.current=!0,t.onSubscriptionData&&!1!==globalThis.__DEV__&&s.V1.warn(t.onData?85:86),t.onSubscriptionComplete&&!1!==globalThis.__DEV__&&s.V1.warn(t.onComplete?87:88));var f,m,y,v=t.skip,b=t.fetchPolicy,C=t.errorPolicy,w=t.shouldResubscribe,S=t.context,x=t.extensions,E=t.ignoreResults,A=(f=function(){return t.variables},m=[t.variables],(y=r.useRef(void 0)).current&&(0,o.L)(y.current.deps,m)||(y.current={value:f(),deps:m}),y.current.value),M=function(){return function(e,t,i,s,r,o,a){var l={query:t,variables:i,fetchPolicy:s,errorPolicy:r,context:o,extensions:a},h=(0,n.__assign)((0,n.__assign)({},l),{client:e,result:{loading:!0,data:void 0,error:void 0,variables:i},setResult:function(e){h.result=e}}),u=null;return Object.assign(new c.c(function(t){u||(u=e.subscribe(l));var i=u.subscribe(t);return function(){return i.unsubscribe()}}),{__:h})}(g,e,A,b,C,S,x)},T=r.useState(t.skip?null:M),D=T[0],I=T[1],R=r.useRef(M);(0,p.E)(function(){R.current=M}),v?D&&I(D=null):D&&(g===D.__.client&&e===D.__.query&&b===D.__.fetchPolicy&&C===D.__.errorPolicy&&(0,o.L)(A,D.__.variables)||!1===("function"==typeof w?!!w(t):w))||I(D=M());var k=r.useRef(t);r.useEffect(function(){k.current=t});var P=!v&&!E,_=r.useMemo(function(){return{loading:P,error:void 0,data:void 0,variables:A}},[P,A]),L=r.useRef(E);(0,p.E)(function(){L.current=E});var N=(0,u.r)(r.useCallback(function(e){if(!D)return function(){};var t=!1,i=D.__.variables,n=D.__.client,s=D.subscribe({next:function(s){var r,o;if(!t){var a={loading:!1,data:s.data,error:(0,d.jy)(s),variables:i};D.__.setResult(a),L.current||e(),a.error?null===(o=(r=k.current).onError)||void 0===o||o.call(r,a.error):k.current.onData?k.current.onData({client:n,data:a}):k.current.onSubscriptionData&&k.current.onSubscriptionData({client:n,subscriptionData:a})}},error:function(n){var s,r;n=n instanceof l.K4?n:new l.K4({protocolErrors:[n]}),t||(D.__.setResult({loading:!1,data:void 0,error:n,variables:i}),L.current||e(),null===(r=(s=k.current).onError)||void 0===r||r.call(s,n))},complete:function(){t||(k.current.onComplete?k.current.onComplete():k.current.onSubscriptionComplete&&k.current.onSubscriptionComplete())}});return function(){t=!0,setTimeout(function(){s.unsubscribe()})}},[D]),function(){return!D||v||E?_:D.__.result},function(){return _}),O=r.useCallback(function(){(0,s.V1)(!k.current.skip,89),I(R.current())},[k,R]);return r.useMemo(function(){return(0,n.__assign)((0,n.__assign)({},N),{restart:O})},[N,O])}},34958(e,t,i){"use strict";var n;i.d(t,{r:()=>l});var s=i(85923),r=i(63780),o=i(51975),a=!1,l=(n||(n=i.t(r,2))).useSyncExternalStore||function(e,t,i){var n=t();!1===globalThis.__DEV__||a||n===t()||(a=!0,!1!==globalThis.__DEV__&&s.V1.error(92));var l=r.useState({inst:{value:n,getSnapshot:t}}),h=l[0].inst,u=l[1];return o.JR?r.useLayoutEffect(function(){Object.assign(h,{value:n,getSnapshot:t}),c(h)&&u({inst:h})},[e,n,t]):Object.assign(h,{value:n,getSnapshot:t}),r.useEffect(function(){return c(h)&&u({inst:h}),e(function(){c(h)&&u({inst:h})})},[e]),n};function c(e){var t=e.value,i=e.getSnapshot;try{return t!==i()}catch(e){return!0}}},50255(e,t,i){"use strict";i.d(t,{D$:()=>d,K3:()=>u,KG:()=>n});var n,s,r=i(85923),o=i(41171),a=i(48448),l=i(97023),c=i(23549);function h(e){var t;switch(e){case n.Query:t="Query";break;case n.Mutation:t="Mutation";break;case n.Subscription:t="Subscription"}return t}function u(e){(0,c.S2)("parser",function(){!1!==globalThis.__DEV__&&r.V1.warn(94)}),s||(s=new o.A(a.v.parser||1e3));var t,i,l=s.get(e);if(l)return l;(0,r.V1)(!!e&&!!e.kind,95,e);for(var h=[],u=[],d=[],p=[],g=0,f=e.definitions;g<f.length;g++){var m=f[g];if("FragmentDefinition"!==m.kind){if("OperationDefinition"===m.kind)switch(m.operation){case"query":u.push(m);break;case"mutation":d.push(m);break;case"subscription":p.push(m)}}else h.push(m)}(0,r.V1)(!h.length||u.length||d.length||p.length,96),(0,r.V1)(u.length+d.length+p.length<=1,97,e,u.length,p.length,d.length),i=u.length?n.Query:n.Mutation,u.length||d.length||(i=n.Subscription);var y=u.length?u:d.length?d:p;(0,r.V1)(1===y.length,98,e,y.length);var v=y[0];t=v.variableDefinitions||[];var b={name:v.name&&"Name"===v.name.kind?v.name.value:"data",type:i,variables:t};return s.set(e,b),b}function d(e,t){var i=(0,c.lz)("parser",u,[e]),n=h(t),s=h(i.type);(0,r.V1)(i.type===t,99,n,n,s)}!function(e){e[e.Query=0]="Query",e[e.Mutation=1]="Mutation",e[e.Subscription=2]="Subscription"}(n||(n={})),u.resetCache=function(){s=void 0},!1!==globalThis.__DEV__&&(0,l.D_)("parser",function(){return s?s.size:0})},41171(e,t,i){"use strict";i.d(t,{A:()=>a,V:()=>l});var n=i(23336),s=i(78027),r=new WeakSet;function o(e){e.size<=(e.max||-1)||r.has(e)||(r.add(e),setTimeout(function(){e.clean(),r.delete(e)},100))}var a=function(e,t){var i=new s.l(e,t);return i.set=function(e,t){var i=s.l.prototype.set.call(this,e,t);return o(this),i},i},l=function(e,t){var i=new n.C(e,t);return i.set=function(e,t){var i=n.C.prototype.set.call(this,e,t);return o(this),i},i}},97023(e,t,i){"use strict";i.d(t,{D_:()=>o,cM:()=>l,ep:()=>a,tQ:()=>c});var n=i(65959),s=i(48448),r={};function o(e,t){r[e]=t}var a=!1!==globalThis.__DEV__?function(){var e,t,i,o,a;if(!1===globalThis.__DEV__)throw new Error("only supported in development mode");return{limits:Object.fromEntries(Object.entries({parser:1e3,canonicalStringify:1e3,print:2e3,"documentTransform.cache":2e3,"queryManager.getDocumentInfo":2e3,"PersistedQueryLink.persistedQueryHashes":2e3,"fragmentRegistry.transform":2e3,"fragmentRegistry.lookup":1e3,"fragmentRegistry.findFragmentSpreads":4e3,"cache.fragmentQueryDocuments":1e3,"removeTypenameFromVariables.getVariableDefinitions":2e3,"inMemoryCache.maybeBroadcastWatch":5e3,"inMemoryCache.executeSelectionSet":5e4,"inMemoryCache.executeSubSelectedArray":1e4}).map(function(e){var t=e[0],i=e[1];return[t,s.v[t]||i]})),sizes:(0,n.__assign)({print:null===(e=r.print)||void 0===e?void 0:e.call(r),parser:null===(t=r.parser)||void 0===t?void 0:t.call(r),canonicalStringify:null===(i=r.canonicalStringify)||void 0===i?void 0:i.call(r),links:f(this.link),queryManager:{getDocumentInfo:this.queryManager.transformCache.size,documentTransforms:p(this.queryManager.documentTransform)}},null===(a=(o=this.cache).getMemoryInternals)||void 0===a?void 0:a.call(o))}}:void 0,l=!1!==globalThis.__DEV__?function(){var e=this.config.fragments;return(0,n.__assign)((0,n.__assign)({},h.apply(this)),{addTypenameDocumentTransform:p(this.addTypenameTransform),inMemoryCache:{executeSelectionSet:u(this.storeReader.executeSelectionSet),executeSubSelectedArray:u(this.storeReader.executeSubSelectedArray),maybeBroadcastWatch:u(this.maybeBroadcastWatch)},fragmentRegistry:{findFragmentSpreads:u(null==e?void 0:e.findFragmentSpreads),lookup:u(null==e?void 0:e.lookup),transform:u(null==e?void 0:e.transform)}})}:void 0,c=!1!==globalThis.__DEV__?h:void 0;function h(){return{cache:{fragmentQueryDocuments:u(this.getFragmentDoc)}}}function u(e){return function(e){return!!e&&"dirtyKey"in e}(e)?e.size:void 0}function d(e){return null!=e}function p(e){return g(e).map(function(e){return{cache:e}})}function g(e){return e?(0,n.__spreadArray)((0,n.__spreadArray)([u(null==e?void 0:e.performWork)],g(null==e?void 0:e.left),!0),g(null==e?void 0:e.right),!0).filter(d):[]}function f(e){var t;return e?(0,n.__spreadArray)((0,n.__spreadArray)([null===(t=null==e?void 0:e.getMemoryInternals)||void 0===t?void 0:t.call(e)],f(null==e?void 0:e.left),!0),f(null==e?void 0:e.right),!0).filter(d):[]}},48448(e,t,i){"use strict";i.d(t,{v:()=>o});var n=i(65959),s=i(85923),r=Symbol.for("apollo.cacheSize"),o=(0,n.__assign)({},s.Sf[r])},24568(e,t,i){"use strict";i.d(t,{E:()=>s,c:()=>n});var n=Array.isArray;function s(e){return Array.isArray(e)&&e.length>0}},51975(e,t,i){"use strict";i.d(t,{En:()=>o,JR:()=>u,Sw:()=>c,et:()=>r,ol:()=>a,uJ:()=>l});var n=i(85923),s="ReactNative"==(0,n.no)(function(){return navigator.product}),r="function"==typeof WeakMap&&!(s&&!globalThis.HermesInternal),o="function"==typeof WeakSet,a="function"==typeof Symbol&&"function"==typeof Symbol.for,l=a&&Symbol.asyncIterator,c="function"==typeof(0,n.no)(function(){return window.document.createElement}),h=(0,n.no)(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1,u=(c||s)&&!h},87713(e,t,i){"use strict";i.d(t,{M:()=>a});var n,s=i(41171),r=i(48448),o=i(97023),a=Object.assign(function(e){return JSON.stringify(e,l)},{reset:function(){n=new s.V(r.v.canonicalStringify||1e3)}});function l(e,t){if(t&&"object"==typeof t){var i=Object.getPrototypeOf(t);if(i===Object.prototype||null===i){var s=Object.keys(t);if(s.every(c))return t;var r=JSON.stringify(s),o=n.get(r);if(!o){s.sort();var a=JSON.stringify(s);o=n.get(a)||s,n.set(r,o),n.set(a,o)}var l=Object.create(i);return o.forEach(function(e){l[e]=t[e]}),l}}return t}function c(e,t,i){return 0===t||i[t-1]<=e}!1!==globalThis.__DEV__&&(0,o.D_)("canonicalStringify",function(){return n.size}),a.reset()},10683(e,t,i){"use strict";i.d(t,{m:()=>s});var n=Object.prototype.toString;function s(e){return r(e)}function r(e,t){switch(n.call(e)){case"[object Array]":if((t=t||new Map).has(e))return t.get(e);var i=e.slice(0);return t.set(e,i),i.forEach(function(e,n){i[n]=r(e,t)}),i;case"[object Object]":if((t=t||new Map).has(e))return t.get(e);var s=Object.create(Object.getPrototypeOf(e));return t.set(e,s),Object.keys(e).forEach(function(i){s[i]=r(e[i],t)}),s;default:return e}}},93565(e,t,i){"use strict";function n(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=Object.create(null);return e.forEach(function(e){e&&Object.keys(e).forEach(function(t){var n=e[t];void 0!==n&&(i[t]=n)})}),i}i.d(t,{o:()=>n})},931(e,t,i){"use strict";i.d(t,{M:()=>o,t:()=>r});var n=i(24568),s=i(11177);function r(e){var t=o(e);return(0,n.E)(t)}function o(e){var t=(0,n.E)(e.errors)?e.errors.slice(0):[];return(0,s.ST)(e)&&(0,n.E)(e.incremental)&&e.incremental.forEach(function(e){e.errors&&t.push.apply(t,e.errors)}),t}},11177(e,t,i){"use strict";i.d(t,{EQ:()=>a,Nw:()=>c,ST:()=>o,YX:()=>l,bd:()=>h});var n=i(83724),s=i(24568),r=i(34222);function o(e){return"incremental"in e}function a(e){return"hasNext"in e&&"data"in e}function l(e){return o(e)||a(e)}function c(e){return(0,n.U)(e)&&"payload"in e}function h(e,t){var i=e,n=new r.ZI;return o(t)&&(0,s.E)(t.incremental)&&t.incremental.forEach(function(e){for(var t=e.data,s=e.path,r=s.length-1;r>=0;--r){var o=s[r],a=isNaN(+o)?{}:[];a[o]=t,t=a}i=n.merge(i,t)}),i}},31878(e,t,i){"use strict";i.d(t,{v:()=>s});var n=new Map;function s(e){var t=n.get(e)||1;return n.set(e,t+1),"".concat(e,":").concat(t,":").concat(Math.random().toString(36).slice(2))}},58737(e,t,i){"use strict";i.d(t,{G:()=>s});var n=i(83724);function s(e){return!1!==globalThis.__DEV__&&(t=e,(i=new Set([t])).forEach(function(e){(0,n.U)(e)&&function(e){if(!1!==globalThis.__DEV__&&!Object.isFrozen(e))try{Object.freeze(e)}catch(e){if(e instanceof TypeError)return null;throw e}return e}(e)===e&&Object.getOwnPropertyNames(e).forEach(function(t){(0,n.U)(e[t])&&i.add(e[t])})})),e;var t,i}},34222(e,t,i){"use strict";i.d(t,{D9:()=>o,IM:()=>a,ZI:()=>c});var n=i(65959),s=i(83724),r=Object.prototype.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return a(e)}function a(e){var t=e[0]||{},i=e.length;if(i>1)for(var n=new c,s=1;s<i;++s)t=n.merge(t,e[s]);return t}var l=function(e,t,i){return this.merge(e[i],t[i])},c=function(){function e(e){void 0===e&&(e=l),this.reconciler=e,this.isObject=s.U,this.pastCopies=new Set}return e.prototype.merge=function(e,t){for(var i=this,o=[],a=2;a<arguments.length;a++)o[a-2]=arguments[a];return(0,s.U)(t)&&(0,s.U)(e)?(Object.keys(t).forEach(function(s){if(r.call(e,s)){var a=e[s];if(t[s]!==a){var l=i.reconciler.apply(i,(0,n.__spreadArray)([e,t,s],o,!1));l!==a&&((e=i.shallowCopyForMerge(e))[s]=l)}}else(e=i.shallowCopyForMerge(e))[s]=t[s]}),e):t},e.prototype.shallowCopyForMerge=function(e){return(0,s.U)(e)&&(this.pastCopies.has(e)||(e=Array.isArray(e)?e.slice(0):(0,n.__assign)({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},e}()},22260(e,t,i){"use strict";i.d(t,{l:()=>r});var n=i(65959),s=i(93565);function r(e,t){return(0,s.o)(e,t,t.variables&&{variables:(0,s.o)((0,n.__assign)((0,n.__assign)({},e&&e.variables),t.variables))})}},83724(e,t,i){"use strict";function n(e){return null!==e&&"object"==typeof e}function s(e){return null!==e&&"object"==typeof e&&(Object.getPrototypeOf(e)===Object.prototype||null===Object.getPrototypeOf(e))}i.d(t,{Q:()=>s,U:()=>n})},58462(e,t,i){"use strict";i.d(t,{p:()=>s});var n=i(31878);function s(e,t){void 0===t&&(t=0);var i=(0,n.v)("stringifyForDisplay");return JSON.stringify(e,function(e,t){return void 0===t?i:t},t).split(JSON.stringify(i)).join("<undefined>")}},23549(e,t,i){"use strict";i.d(t,{S2:()=>u,cc:()=>h,lz:()=>c});var n=i(65959),s=i(1645),r=i(85923),o=Symbol.for("apollo.deprecations"),a=r.Sf,l=new s.DX;function c(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];return l.withValue.apply(l,(0,n.__spreadArray)([Array.isArray(e)?e:[e]],t,!1))}function h(e,t,i,n){void 0===n&&(n="Please remove this option."),u(t,function(){t in e&&!1!==globalThis.__DEV__&&r.V1.warn(104,i,t,n)})}function u(e,t){(function(e){return a[o]||(l.getValue()||[]).includes(e)})(e)||t()}},20004(e,t,i){"use strict";i.d(t,{A:()=>s});var n=i(20531);const s=(0,n.n)(function(){return globalThis})||(0,n.n)(function(){return window})||(0,n.n)(function(){return self})||(0,n.n)(function(){return globalThis})||(0,n.n)(function(){return n.n.constructor("return this")()})},85923(e,t,i){"use strict";i.d(t,{IJ:()=>o,Sf:()=>r.A,V1:()=>n.V1,no:()=>s.n,vA:()=>n.vA});var n=i(66223),s=i(20531),r=i(20004),o=!1!==globalThis.__DEV__},66223(e,t,i){"use strict";i.d(t,{V1:()=>l,vA:()=>c});var n=i(92981),s=i(31095),r=i(20004),o=i(58462);function a(e){return function(t){for(var i=[],n=1;n<arguments.length;n++)i[n-1]=arguments[n];if("number"==typeof t){var s=t;(t=d(s))||(t=p(s,i),i=[])}e.apply(void 0,[t].concat(i))}}var l=Object.assign(function(e,t){for(var i=[],s=2;s<arguments.length;s++)i[s-2]=arguments[s];e||(0,n.V1)(e,d(t,i)||p(t,i))},{debug:a(n.V1.debug),log:a(n.V1.log),warn:a(n.V1.warn),error:a(n.V1.error)});function c(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];return new n.zU(d(e,t)||p(e,t))}var h=Symbol.for("ApolloErrorMessageHandler_"+s.r);function u(e){if("string"==typeof e)return e;try{return(0,o.p)(e,2).slice(0,1e3)}catch(e){return"<non-serializable>"}}function d(e,t){if(void 0===t&&(t=[]),e)return r.A[h]&&r.A[h](e,t.map(u))}function p(e,t){if(void 0===t&&(t=[]),e)return"An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({version:s.r,message:e,args:t.map(u)})))}},20531(e,t,i){"use strict";function n(e){try{return e()}catch(e){}}i.d(t,{n:()=>n})},29957(e,t,i){"use strict";i.d(t,{c:()=>u});var n=i(69796),s=i(51975),r=i(73476),o=i(85923),a=i(78027),l=i(1645),c=i(48448);function h(e){return e}var u=function(){function e(e,t){void 0===t&&(t=Object.create(null)),this.resultCache=s.En?new WeakSet:new Set,this.transform=e,t.getCacheKey&&(this.getCacheKey=t.getCacheKey),this.cached=!1!==t.cache,this.resetCache()}return e.prototype.getCacheKey=function(e){return[e]},e.identity=function(){return new e(h,{cache:!1})},e.split=function(t,i,n){return void 0===n&&(n=e.identity()),Object.assign(new e(function(e){return(t(e)?i:n).transformDocument(e)},{cache:!1}),{left:i,right:n})},e.prototype.resetCache=function(){var t=this;if(this.cached){var i=new n.b(s.et);this.performWork=(0,l.LV)(e.prototype.performWork.bind(this),{makeCacheKey:function(e){var n=t.getCacheKey(e);if(n)return(0,o.V1)(Array.isArray(n),105),i.lookupArray(n)},max:c.v["documentTransform.cache"],cache:a.l})}},e.prototype.performWork=function(e){return(0,r.sw)(e),this.transform(e)},e.prototype.transformDocument=function(e){if(this.resultCache.has(e))return e;var t=this.performWork(e);return this.resultCache.add(t),t},e.prototype.concat=function(t){var i=this;return Object.assign(new e(function(e){return t.transformDocument(i.transformDocument(e))},{cache:!1}),{left:this,right:t})},e}()},77822(e,t,i){"use strict";i.d(t,{I5:()=>c,MS:()=>o,d8:()=>h,f2:()=>u,hE:()=>l,s7:()=>p,sx:()=>a,tY:()=>d});var n=i(85923),s=i(49270),r=i(85517);function o(e,t){var i=e.directives;return!i||!i.length||d(i).every(function(e){var i=e.directive,s=e.ifArgument,r=!1;return"Variable"===s.value.kind?(r=t&&t[s.value.name.value],(0,n.V1)(void 0!==r,106,i.name.value)):r=s.value.value,"skip"===i.name.value?!r:r})}function a(e){var t=[];return(0,r.YR)(e,{Directive:function(e){t.push(e.name.value)}}),t}var l=function(e,t){return h(e,t,!1)},c=function(e,t){return h(e,t,!0)};function h(e,t,i){var n=new Set(e),s=n.size;return(0,r.YR)(t,{Directive:function(e){if(n.delete(e.name.value)&&(!i||!n.size))return r.sP}}),i?!n.size:n.size<s}function u(e){return e&&h(["client","export"],e,!0)}function d(e){var t=[];return e&&e.length&&e.forEach(function(e){if("skip"===(i=e.name.value)||"include"===i){var i,s=e.arguments,r=e.name.value;(0,n.V1)(s&&1===s.length,107,r);var o=s[0];(0,n.V1)(o.name&&"if"===o.name.value,108,r);var a=o.value;(0,n.V1)(a&&("Variable"===a.kind||"BooleanValue"===a.kind),109,r),t.push({directive:e,ifArgument:o})}}),t}function p(e){var t,i,r=null===(t=e.directives)||void 0===t?void 0:t.find(function(e){return"unmask"===e.name.value});if(!r)return"mask";var o=null===(i=r.arguments)||void 0===i?void 0:i.find(function(e){return"mode"===e.name.value});return!1!==globalThis.__DEV__&&o&&(o.value.kind===s.b.VARIABLE?!1!==globalThis.__DEV__&&n.V1.warn(110):o.value.kind!==s.b.STRING?!1!==globalThis.__DEV__&&n.V1.warn(111):"migrate"!==o.value.value&&!1!==globalThis.__DEV__&&n.V1.warn(112,o.value.value)),o&&"value"in o.value&&"migrate"===o.value.value?"migrate":"unmask"}},87819(e,t,i){"use strict";i.d(t,{HQ:()=>l,JG:()=>a,ct:()=>o,s6:()=>c});var n=i(65959),s=i(85923),r=i(85517);function o(e,t){var i=t,r=[];return e.definitions.forEach(function(e){if("OperationDefinition"===e.kind)throw(0,s.vA)(113,e.operation,e.name?" named '".concat(e.name.value,"'"):"");"FragmentDefinition"===e.kind&&r.push(e)}),void 0===i&&((0,s.V1)(1===r.length,114,r.length),i=r[0].name.value),(0,n.__assign)((0,n.__assign)({},e),{definitions:(0,n.__spreadArray)([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:i}}]}}],e.definitions,!0)})}function a(e){void 0===e&&(e=[]);var t={};return e.forEach(function(e){t[e.name.value]=e}),t}function l(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":var i=e.name.value;if("function"==typeof t)return t(i);var n=t&&t[i];return(0,s.V1)(n,115,i),n||null;default:return null}}function c(e){var t=!0;return(0,r.YR)(e,{FragmentSpread:function(e){if(!(t=!!e.directives&&e.directives.some(function(e){return"unmask"===e.name.value})))return r.sP}}),t}},73476(e,t,i){"use strict";i.d(t,{AT:()=>c,E4:()=>h,Vn:()=>u,Vu:()=>o,n4:()=>a,sw:()=>r,wY:()=>d,zK:()=>l});var n=i(85923),s=i(77038);function r(e){(0,n.V1)(e&&"Document"===e.kind,116);var t=e.definitions.filter(function(e){return"FragmentDefinition"!==e.kind}).map(function(e){if("OperationDefinition"!==e.kind)throw(0,n.vA)(117,e.kind);return e});return(0,n.V1)(t.length<=1,118,t.length),e}function o(e){return r(e),e.definitions.filter(function(e){return"OperationDefinition"===e.kind})[0]}function a(e){return e.definitions.filter(function(e){return"OperationDefinition"===e.kind&&!!e.name}).map(function(e){return e.name.value})[0]||null}function l(e){return e.definitions.filter(function(e){return"FragmentDefinition"===e.kind})}function c(e){var t=o(e);return(0,n.V1)(t&&"query"===t.operation,119),t}function h(e){(0,n.V1)("Document"===e.kind,120),(0,n.V1)(e.definitions.length<=1,121);var t=e.definitions[0];return(0,n.V1)("FragmentDefinition"===t.kind,122),t}function u(e){var t;r(e);for(var i=0,s=e.definitions;i<s.length;i++){var o=s[i];if("OperationDefinition"===o.kind){var a=o.operation;if("query"===a||"mutation"===a||"subscription"===a)return o}"FragmentDefinition"!==o.kind||t||(t=o)}if(t)return t;throw(0,n.vA)(123)}function d(e){var t=Object.create(null),i=e&&e.variableDefinitions;return i&&i.length&&i.forEach(function(e){e.defaultValue&&(0,s.J)(t,e.variable.name,e.defaultValue)}),t}},84305(e,t,i){"use strict";i.d(t,{y:()=>l});var n,s=i(74831),r=i(41171),o=i(48448),a=i(97023),l=Object.assign(function(e){var t=n.get(e);return t||(t=(0,s.y)(e),n.set(e,t)),t},{reset:function(){n=new r.A(o.v.print||2e3)}});l.reset(),!1!==globalThis.__DEV__&&(0,a.D_)("print",function(){return n?n.size:0})},77038(e,t,i){"use strict";i.d(t,{A_:()=>l,D$:()=>y,Ii:()=>u,J:()=>h,Kc:()=>c,MB:()=>f,WU:()=>a,dt:()=>v,kd:()=>b,o5:()=>g,ue:()=>m});var n=i(85923),s=i(83724),r=i(87819),o=i(87713);function a(e){return{__ref:String(e)}}function l(e){return Boolean(e&&"object"==typeof e&&"string"==typeof e.__ref)}function c(e){return(0,s.U)(e)&&"Document"===e.kind&&Array.isArray(e.definitions)}function h(e,t,i,s){if(function(e){return"IntValue"===e.kind}(i)||function(e){return"FloatValue"===e.kind}(i))e[t.value]=Number(i.value);else if(function(e){return"BooleanValue"===e.kind}(i)||function(e){return"StringValue"===e.kind}(i))e[t.value]=i.value;else if(function(e){return"ObjectValue"===e.kind}(i)){var r={};i.fields.map(function(e){return h(r,e.name,e.value,s)}),e[t.value]=r}else if(function(e){return"Variable"===e.kind}(i)){var o=(s||{})[i.name.value];e[t.value]=o}else if(function(e){return"ListValue"===e.kind}(i))e[t.value]=i.values.map(function(e){var i={};return h(i,t,e,s),i[t.value]});else if(function(e){return"EnumValue"===e.kind}(i))e[t.value]=i.value;else{if(!function(e){return"NullValue"===e.kind}(i))throw(0,n.vA)(124,t.value,i.kind);e[t.value]=null}}function u(e,t){var i=null;e.directives&&(i={},e.directives.forEach(function(e){i[e.name.value]={},e.arguments&&e.arguments.forEach(function(n){var s=n.name,r=n.value;return h(i[e.name.value],s,r,t)})}));var n=null;return e.arguments&&e.arguments.length&&(n={},e.arguments.forEach(function(e){var i=e.name,s=e.value;return h(n,i,s,t)})),g(e.name.value,n,i)}var d=["connection","include","skip","client","rest","export","nonreactive"],p=o.M,g=Object.assign(function(e,t,i){if(t&&i&&i.connection&&i.connection.key){if(i.connection.filter&&i.connection.filter.length>0){var n=i.connection.filter?i.connection.filter:[];n.sort();var s={};return n.forEach(function(e){s[e]=t[e]}),"".concat(i.connection.key,"(").concat(p(s),")")}return i.connection.key}var r=e;if(t){var o=p(t);r+="(".concat(o,")")}return i&&Object.keys(i).forEach(function(e){-1===d.indexOf(e)&&(i[e]&&Object.keys(i[e]).length?r+="@".concat(e,"(").concat(p(i[e]),")"):r+="@".concat(e))}),r},{setStringify:function(e){var t=p;return p=e,t}});function f(e,t){if(e.arguments&&e.arguments.length){var i={};return e.arguments.forEach(function(e){var n=e.name,s=e.value;return h(i,n,s,t)}),i}return null}function m(e){return e.alias?e.alias.value:e.name.value}function y(e,t,i){for(var n,s=0,o=t.selections;s<o.length;s++)if(v(c=o[s])){if("__typename"===c.name.value)return e[m(c)]}else n?n.push(c):n=[c];if("string"==typeof e.__typename)return e.__typename;if(n)for(var a=0,l=n;a<l.length;a++){var c=l[a],h=y(e,(0,r.HQ)(c,i).selectionSet,i);if("string"==typeof h)return h}}function v(e){return"Field"===e.kind}function b(e){return"InlineFragment"===e.kind}},49666(e,t,i){"use strict";i.d(t,{TC:()=>C,XY:()=>m,er:()=>S,hX:()=>v,it:()=>b,iz:()=>f,x3:()=>x,zc:()=>w});var n=i(65959),s=i(85923),r=i(49270),o=i(85517),a=i(73476),l=i(77038),c=i(87819),h=i(24568),u={kind:r.b.FIELD,name:{kind:r.b.NAME,value:"__typename"}};function d(e,t){return!e||e.selectionSet.selections.every(function(e){return e.kind===r.b.FRAGMENT_SPREAD&&d(t[e.name.value],t)})}function p(e){return d((0,a.Vu)(e)||(0,a.E4)(e),(0,c.JG)((0,a.zK)(e)))?null:e}function g(e){var t=new Map;return function(i){void 0===i&&(i=e);var n=t.get(i);return n||t.set(i,n={variables:new Set,fragmentSpreads:new Set}),n}}function f(e,t){(0,a.sw)(t);for(var i=g(""),l=g(""),c=function(e){for(var t=0,n=void 0;t<e.length&&(n=e[t]);++t)if(!(0,h.c)(n)){if(n.kind===r.b.OPERATION_DEFINITION)return i(n.name&&n.name.value);if(n.kind===r.b.FRAGMENT_DEFINITION)return l(n.name.value)}return!1!==globalThis.__DEV__&&s.V1.error(125),null},u=0,d=t.definitions.length-1;d>=0;--d)t.definitions[d].kind===r.b.OPERATION_DEFINITION&&++u;var f,m,y,v=(f=e,m=new Map,y=new Map,f.forEach(function(e){e&&(e.name?m.set(e.name,e):e.test&&y.set(e.test,e))}),function(e){var t=m.get(e.name.value);return!t&&y.size&&y.forEach(function(i,n){n(e)&&(t=i)}),t}),b=function(e){return(0,h.E)(e)&&e.map(v).some(function(e){return e&&e.remove})},C=new Map,w=!1,S={enter:function(e){if(b(e.directives))return w=!0,null}},x=(0,o.YR)(t,{Field:S,InlineFragment:S,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(e,t,i,n,s){var r=c(s);r&&r.variables.add(e.name.value)}},FragmentSpread:{enter:function(e,t,i,n,s){if(b(e.directives))return w=!0,null;var r=c(s);r&&r.fragmentSpreads.add(e.name.value)}},FragmentDefinition:{enter:function(e,t,i,n){C.set(JSON.stringify(n),e)},leave:function(e,t,i,n){return e===C.get(JSON.stringify(n))?e:u>0&&e.selectionSet.selections.every(function(e){return e.kind===r.b.FIELD&&"__typename"===e.name.value})?(l(e.name.value).removed=!0,w=!0,null):void 0}},Directive:{leave:function(e){if(v(e))return w=!0,null}}});if(!w)return t;var E=function(e){return e.transitiveVars||(e.transitiveVars=new Set(e.variables),e.removed||e.fragmentSpreads.forEach(function(t){E(l(t)).transitiveVars.forEach(function(t){e.transitiveVars.add(t)})})),e},A=new Set;x.definitions.forEach(function(e){e.kind===r.b.OPERATION_DEFINITION?E(i(e.name&&e.name.value)).fragmentSpreads.forEach(function(e){A.add(e)}):e.kind!==r.b.FRAGMENT_DEFINITION||0!==u||l(e.name.value).removed||A.add(e.name.value)}),A.forEach(function(e){E(l(e)).fragmentSpreads.forEach(function(e){A.add(e)})});var M={enter:function(e){if(t=e.name.value,!A.has(t)||l(t).removed)return null;var t}};return p((0,o.YR)(x,{FragmentSpread:M,FragmentDefinition:M,OperationDefinition:{leave:function(e){if(e.variableDefinitions){var t=E(i(e.name&&e.name.value)).transitiveVars;if(t.size<e.variableDefinitions.length)return(0,n.__assign)((0,n.__assign)({},e),{variableDefinitions:e.variableDefinitions.filter(function(e){return t.has(e.variable.name.value)})})}}}}))}var m=Object.assign(function(e){return(0,o.YR)(e,{SelectionSet:{enter:function(e,t,i){if(!i||i.kind!==r.b.OPERATION_DEFINITION){var s=e.selections;if(s&&!s.some(function(e){return(0,l.dt)(e)&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))})){var o=i;if(!((0,l.dt)(o)&&o.directives&&o.directives.some(function(e){return"export"===e.name.value})))return(0,n.__assign)((0,n.__assign)({},e),{selections:(0,n.__spreadArray)((0,n.__spreadArray)([],s,!0),[u],!1)})}}}}})},{added:function(e){return e===u}}),y={test:function(e){var t="connection"===e.name.value;return t&&(e.arguments&&e.arguments.some(function(e){return"key"===e.name.value})||!1!==globalThis.__DEV__&&s.V1.warn(126)),t}};function v(e){return f([y],(0,a.sw)(e))}function b(e,t){var i=function(e){return function(t){return e.some(function(e){return t.value&&t.value.kind===r.b.VARIABLE&&t.value.name&&(e.name===t.value.name.value||e.test&&e.test(t))})}}(e);return p((0,o.YR)(t,{OperationDefinition:{enter:function(t){return(0,n.__assign)((0,n.__assign)({},t),{variableDefinitions:t.variableDefinitions?t.variableDefinitions.filter(function(t){return!e.some(function(e){return e.name===t.variable.name.value})}):[]})}},Field:{enter:function(t){if(e.some(function(e){return e.remove})){var n=0;if(t.arguments&&t.arguments.forEach(function(e){i(e)&&(n+=1)}),1===n)return null}}},Argument:{enter:function(e){if(i(e))return null}}}))}function C(e,t){function i(t){if(e.some(function(e){return e.name===t.name.value}))return null}return p((0,o.YR)(t,{FragmentSpread:{enter:i},FragmentDefinition:{enter:i}}))}function w(e){return"query"===(0,a.Vn)(e).operation?e:(0,o.YR)(e,{OperationDefinition:{enter:function(e){return(0,n.__assign)((0,n.__assign)({},e),{operation:"query"})}}})}function S(e){return(0,a.sw)(e),f([{test:function(e){return"client"===e.name.value},remove:!0}],e)}function x(e){return(0,a.sw)(e),(0,o.YR)(e,{FragmentSpread:function(e){var t;if(!(null===(t=e.directives)||void 0===t?void 0:t.some(function(e){return"unmask"===e.name.value})))return(0,n.__assign)((0,n.__assign)({},e),{directives:(0,n.__spreadArray)((0,n.__spreadArray)([],e.directives||[],!0),[{kind:r.b.DIRECTIVE,name:{kind:r.b.NAME,value:"nonreactive"}}],!1)})}})}},18500(e,t,i){"use strict";i.r(t),i.d(t,{AutoCleanedStrongCache:()=>K.V,AutoCleanedWeakCache:()=>K.A,Concast:()=>P.E,DEV:()=>n.IJ,DeepMerger:()=>m.ZI,DocumentTransform:()=>r.c,Observable:()=>S.c,addNonReactiveToNamedFragments:()=>h.x3,addTypenameToDocument:()=>h.XY,argumentsObjectFromField:()=>c.MB,asyncMap:()=>k.x,buildQueryFromSelectionSet:()=>h.zc,cacheSizes:()=>Y.v,canUseAsyncIteratorSymbol:()=>F.uJ,canUseDOM:()=>F.Sw,canUseLayoutEffect:()=>F.JR,canUseSymbol:()=>F.ol,canUseWeakMap:()=>F.et,canUseWeakSet:()=>F.En,canonicalStringify:()=>z.M,checkDocument:()=>a.sw,cloneDeep:()=>D.m,compact:()=>G.o,concatPagination:()=>y,createFragmentMap:()=>o.JG,createFulfilledPromise:()=>x,createRejectedPromise:()=>E,fixObservableSubclass:()=>_.r,getDefaultValues:()=>a.wY,getDirectiveNames:()=>s.sx,getFragmentDefinition:()=>a.E4,getFragmentDefinitions:()=>a.zK,getFragmentFromSelection:()=>o.HQ,getFragmentMaskMode:()=>s.s7,getFragmentQueryDocument:()=>o.ct,getGraphQLErrorsFromResult:()=>O.M,getInclusionDirectives:()=>s.tY,getMainDefinition:()=>a.Vn,getOperationDefinition:()=>a.Vu,getOperationName:()=>a.n4,getQueryDefinition:()=>a.AT,getStoreKeyName:()=>c.o5,getTypenameFromResult:()=>c.D$,graphQLResultHasError:()=>O.t,hasAllDirectives:()=>s.I5,hasAnyDirectives:()=>s.hE,hasClientExports:()=>s.f2,hasDirectives:()=>s.d8,isApolloPayloadResult:()=>U.Nw,isArray:()=>L.c,isDocumentNode:()=>c.Kc,isExecutionPatchIncrementalResult:()=>U.ST,isExecutionPatchInitialResult:()=>U.EQ,isExecutionPatchResult:()=>U.YX,isField:()=>c.dt,isFullyUnmaskedOperation:()=>o.s6,isInlineFragment:()=>c.kd,isMutationOperation:()=>d,isNonEmptyArray:()=>L.E,isNonNullObject:()=>N.U,isPlainObject:()=>N.Q,isQueryOperation:()=>p,isReference:()=>c.A_,isStatefulPromise:()=>A,isSubscriptionOperation:()=>g,iterateObserversSafely:()=>R.w,makeReference:()=>c.WU,makeUniqueId:()=>B.v,maybe:()=>n.no,maybeDeepFreeze:()=>I.G,mergeDeep:()=>m.D9,mergeDeepArray:()=>m.IM,mergeIncrementalData:()=>U.bd,mergeOptions:()=>H.l,offsetLimitPagination:()=>v,omitDeep:()=>W,preventUnhandledRejection:()=>T.X,print:()=>l.y,relayStylePagination:()=>b,removeArgumentsFromDocument:()=>h.it,removeClientSetsFromDocument:()=>h.er,removeConnectionDirectiveFromDocument:()=>h.hX,removeDirectivesFromDocument:()=>h.iz,removeFragmentSpreadFromDocument:()=>h.TC,resultKeyNameFromField:()=>c.ue,shouldInclude:()=>s.MS,storeKeyNameFromField:()=>c.Ii,stringifyForDisplay:()=>V.p,stripTypename:()=>$,valueToObjectRepresentation:()=>c.J,wrapPromiseWithState:()=>M});var n=i(85923),s=i(77822),r=i(29957),o=i(87819),a=i(73476),l=i(84305),c=i(77038),h=i(49666);function u(e,t){var i;return(null===(i=(0,a.Vu)(e))||void 0===i?void 0:i.operation)===t}function d(e){return u(e,"mutation")}function p(e){return u(e,"query")}function g(e){return u(e,"subscription")}var f=i(65959),m=i(34222);function y(e){return void 0===e&&(e=!1),{keyArgs:e,merge:function(e,t){return e?(0,f.__spreadArray)((0,f.__spreadArray)([],e,!0),t,!0):t}}}function v(e){return void 0===e&&(e=!1),{keyArgs:e,merge:function(e,t,i){var n=i.args,s=e?e.slice(0):[];if(t)if(n)for(var r=n.offset,o=void 0===r?0:r,a=0;a<t.length;++a)s[o+a]=t[a];else s.push.apply(s,t);return s}}}function b(e){return void 0===e&&(e=!1),{keyArgs:e,read:function(e,t){var i=t.canRead,n=t.readField;if(!e)return e;var s=[],r="",o="";e.edges.forEach(function(e){i(n("node",e))&&(s.push(e),e.cursor&&(r=r||e.cursor||"",o=e.cursor||o))}),s.length>1&&r===o&&(r="");var a=e.pageInfo||{},l=a.startCursor,c=a.endCursor;return(0,f.__assign)((0,f.__assign)({},C(e)),{edges:s,pageInfo:(0,f.__assign)((0,f.__assign)({},e.pageInfo),{startCursor:l||r,endCursor:c||o})})},merge:function(e,t,i){var n=i.args,s=i.isReference,r=i.readField;if(e||(e={edges:[],pageInfo:{hasPreviousPage:!1,hasNextPage:!0,startCursor:"",endCursor:""}}),!t)return e;var o=t.edges?t.edges.map(function(e){return s(e=(0,f.__assign)({},e))&&(e.cursor=r("cursor",e)),e}):[];if(t.pageInfo){var a=t.pageInfo,l=a.startCursor,c=a.endCursor,h=o[0],u=o[o.length-1];h&&l&&(h.cursor=l),u&&c&&(u.cursor=c);var d=h&&h.cursor;d&&!l&&(t=(0,m.D9)(t,{pageInfo:{startCursor:d}}));var p=u&&u.cursor;p&&!c&&(t=(0,m.D9)(t,{pageInfo:{endCursor:p}}))}var g=e.edges,y=[];if(n&&n.after)(v=g.findIndex(function(e){return e.cursor===n.after}))>=0&&(g=g.slice(0,v+1));else if(n&&n.before){var v;y=(v=g.findIndex(function(e){return e.cursor===n.before}))<0?g:g.slice(v),g=[]}else t.edges&&(g=[]);var b=(0,f.__spreadArray)((0,f.__spreadArray)((0,f.__spreadArray)([],g,!0),o,!0),y,!0),w=(0,f.__assign)((0,f.__assign)({},t.pageInfo),e.pageInfo);if(t.pageInfo){var S=t.pageInfo,x=S.hasPreviousPage,E=S.hasNextPage,A=(l=S.startCursor,c=S.endCursor,(0,f.__rest)(S,["hasPreviousPage","hasNextPage","startCursor","endCursor"]));Object.assign(w,A),g.length||(void 0!==x&&(w.hasPreviousPage=x),void 0!==l&&(w.startCursor=l)),y.length||(void 0!==E&&(w.hasNextPage=E),void 0!==c&&(w.endCursor=c))}return(0,f.__assign)((0,f.__assign)((0,f.__assign)({},C(e)),C(t)),{edges:b,pageInfo:w})}}}var C=function(e){return(0,f.__rest)(e,w)},w=["edges","pageInfo"],S=i(74140);function x(e){var t=Promise.resolve(e);return t.status="fulfilled",t.value=e,t}function E(e){var t=Promise.reject(e);return t.catch(function(){}),t.status="rejected",t.reason=e,t}function A(e){return"status"in e}function M(e){if(A(e))return e;var t=e;return t.status="pending",t.then(function(e){if("pending"===t.status){var i=t;i.status="fulfilled",i.value=e}},function(e){if("pending"===t.status){var i=t;i.status="rejected",i.reason=e}}),e}var T=i(31247),D=i(10683),I=i(58737),R=i(8786),k=i(74855),P=i(98590),_=i(36700),L=i(24568),N=i(83724),O=i(931),F=i(51975),G=i(93565),B=i(31878),V=i(58462),H=i(22260),U=i(11177),z=i(87713);function W(e,t){return j(e,t)}function j(e,t,i){if(void 0===i&&(i=new Map),i.has(e))return i.get(e);var n=!1;if(Array.isArray(e)){var s=[];if(i.set(e,s),e.forEach(function(e,r){var o=j(e,t,i);n||(n=o!==e),s[r]=o}),n)return s}else if((0,N.Q)(e)){var r=Object.create(Object.getPrototypeOf(e));if(i.set(e,r),Object.keys(e).forEach(function(s){if(s!==t){var o=j(e[s],t,i);n||(n=o!==e[s]),r[s]=o}else n=!0}),n)return r}return e}function $(e){return W(e,"__typename")}var K=i(41171),Y=i(48448)},98590(e,t,i){"use strict";i.d(t,{E:()=>l});var n=i(65959),s=i(74140),r=i(8786),o=i(36700);function a(e){return e&&"function"==typeof e.then}var l=function(e){function t(t){var i=e.call(this,function(e){return i.addObserver(e),function(){return i.removeObserver(e)}})||this;return i.observers=new Set,i.promise=new Promise(function(e,t){i.resolve=e,i.reject=t}),i.handlers={next:function(e){null!==i.sub&&(i.latest=["next",e],i.notify("next",e),(0,r.w)(i.observers,"next",e))},error:function(e){var t=i.sub;null!==t&&(t&&setTimeout(function(){return t.unsubscribe()}),i.sub=null,i.latest=["error",e],i.reject(e),i.notify("error",e),(0,r.w)(i.observers,"error",e))},complete:function(){var e=i,t=e.sub,n=e.sources;if(null!==t){var s=(void 0===n?[]:n).shift();s?a(s)?s.then(function(e){return i.sub=e.subscribe(i.handlers)},i.handlers.error):i.sub=s.subscribe(i.handlers):(t&&setTimeout(function(){return t.unsubscribe()}),i.sub=null,i.latest&&"next"===i.latest[0]?i.resolve(i.latest[1]):i.resolve(),i.notify("complete"),(0,r.w)(i.observers,"complete"))}}},i.nextResultListeners=new Set,i.cancel=function(e){i.reject(e),i.sources=[],i.handlers.error(e)},i.promise.catch(function(e){}),"function"==typeof t&&(t=[new s.c(t)]),a(t)?t.then(function(e){return i.start(e)},i.handlers.error):i.start(t),i}return(0,n.__extends)(t,e),t.prototype.start=function(e){void 0===this.sub&&(this.sources=Array.from(e),this.handlers.complete())},t.prototype.deliverLastMessage=function(e){if(this.latest){var t=this.latest[0],i=e[t];i&&i.call(e,this.latest[1]),null===this.sub&&"next"===t&&e.complete&&e.complete()}},t.prototype.addObserver=function(e){this.observers.has(e)||(this.deliverLastMessage(e),this.observers.add(e))},t.prototype.removeObserver=function(e){this.observers.delete(e)&&this.observers.size<1&&this.handlers.complete()},t.prototype.notify=function(e,t){var i=this.nextResultListeners;i.size&&(this.nextResultListeners=new Set,i.forEach(function(i){return i(e,t)}))},t.prototype.beforeNext=function(e){var t=!1;this.nextResultListeners.add(function(i,n){t||(t=!0,e(i,n))})},t}(s.c);(0,o.r)(l)},74855(e,t,i){"use strict";i.d(t,{x:()=>s});var n=i(74140);function s(e,t,i){return new n.c(function(n){var s={then:function(e){return new Promise(function(t){return t(e())})}};function r(e,t){return function(i){if(e){var r=function(){return n.closed?0:e(i)};s=s.then(r,r).then(function(e){return n.next(e)},function(e){return n.error(e)})}else n[t](i)}}var o={next:r(t,"next"),error:r(i,"error"),complete:function(){s.then(function(){return n.complete()})}},a=e.subscribe(o);return function(){return a.unsubscribe()}})}},8786(e,t,i){"use strict";function n(e,t,i){var n=[];e.forEach(function(e){return e[t]&&n.push(e)}),n.forEach(function(e){return e[t](i)})}i.d(t,{w:()=>n})},36700(e,t,i){"use strict";i.d(t,{r:()=>r});var n=i(74140),s=i(51975);function r(e){function t(t){Object.defineProperty(e,t,{value:n.c})}return s.ol&&Symbol.species&&t(Symbol.species),t("@@species"),e}},31247(e,t,i){"use strict";function n(e){return e.catch(function(){}),e}i.d(t,{X:()=>n})},31095(e,t,i){"use strict";i.d(t,{r:()=>n});var n="3.14.0"},45688(e,t,i){"use strict";i.d(t,{vq:()=>fr});var n=i(95177),s=i(14927);const r="AAD",o="OIDC",a="none";var l=i(90865);const c="client_info_decoding_error",h="client_info_empty_error",u="token_parsing_error",d="null_or_empty_token",p="endpoints_resolution_error",g="network_error",f="openid_config_error",m="hash_not_deserialized",y="invalid_state",v="state_mismatch",b="state_not_found",C="nonce_mismatch",w="auth_time_not_found",S="max_age_transpired",x="multiple_matching_tokens",E="multiple_matching_accounts",A="multiple_matching_appMetadata",M="request_cannot_be_made",T="cannot_remove_empty_scope",D="cannot_append_scopeset",I="empty_input_scopeset",R="device_code_polling_cancelled",k="device_code_expired",P="device_code_unknown_error",_="no_account_in_silent_request",L="invalid_cache_record",N="invalid_cache_environment",O="no_account_found",F="no_crypto_object",G="unexpected_credential_type",B="invalid_assertion",V="invalid_client_credential",H="token_refresh_required",U="user_timeout_reached",z="token_claims_cnf_required_for_signedjwt",W="authorization_code_missing_from_server_response",j="binding_key_not_removed",$="end_session_endpoint_not_supported",K="key_id_missing",Y="no_network_connectivity",q="user_canceled",X="missing_tenant_id_error",Z="method_not_implemented",Q="nested_app_auth_bridge_disabled",J={[c]:"The client info could not be parsed/decoded correctly",[h]:"The client info was empty",[u]:"Token cannot be parsed",[d]:"The token is null or empty",[p]:"Endpoints cannot be resolved",[g]:"Network request failed",[f]:"Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints.",[m]:"The hash parameters could not be deserialized",[y]:"State was not the expected format",[v]:"State mismatch error",[b]:"State not found",[C]:"Nonce mismatch error",[w]:"Max Age was requested and the ID token is missing the auth_time variable. auth_time is an optional claim and is not enabled by default - it must be enabled. See https://aka.ms/msaljs/optional-claims for more information.",[S]:"Max Age is set to 0, or too much time has elapsed since the last end-user authentication.",[x]:"The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements such as authority or account.",[E]:"The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account",[A]:"The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata",[M]:"Token request cannot be made without authorization code or refresh token.",[T]:"Cannot remove null or empty scope from ScopeSet",[D]:"Cannot append ScopeSet",[I]:"Empty input ScopeSet cannot be processed",[R]:"Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true.",[k]:"Device code is expired.",[P]:"Device code stopped polling for unknown reasons.",[_]:"Please pass an account object, silent flow is not supported without account information",[L]:"Cache record object was null or undefined.",[N]:"Invalid environment when attempting to create cache entry",[O]:"No account found in cache for given key.",[F]:"No crypto object detected.",[G]:"Unexpected credential type.",[B]:"Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515",[V]:"Client credential (secret, certificate, or assertion) must not be empty when creating a confidential client. An application should at most have one credential",[H]:"Cannot return token from cache because it must be refreshed. This may be due to one of the following reasons: forceRefresh parameter is set to true, claims have been requested, there is no cached access token or it is expired.",[U]:"User defined timeout for device code polling reached",[z]:"Cannot generate a POP jwt if the token_claims are not populated",[W]:"Server response does not contain an authorization code to proceed",[j]:"Could not remove the credential's binding key from storage.",[$]:"The provided authority does not support logout",[K]:"A keyId value is missing from the requested bound token's cache record and is required to match the token to it's stored binding key.",[Y]:"No network connectivity. Check your internet connection.",[q]:"User cancelled the flow.",[X]:"A tenant id - not common, organizations, or consumers - must be specified when using the client_credentials flow.",[Z]:"This method has not been implemented",[Q]:"The nested app auth bridge is disabled"};class ee extends l.lR{constructor(e,t){super(e,t?`${J[e]}: ${t}`:J[e]),this.name="ClientAuthError",Object.setPrototypeOf(this,ee.prototype)}}function te(e,t){return new ee(e,t)}const ie={createNewGuid:()=>{throw te(Z)},base64Decode:()=>{throw te(Z)},base64Encode:()=>{throw te(Z)},base64UrlEncode:()=>{throw te(Z)},encodeKid:()=>{throw te(Z)},async getPublicKeyThumbprint(){throw te(Z)},async removeTokenBindingKey(){throw te(Z)},async clearKeystore(){throw te(Z)},async signJwt(){throw te(Z)},async hashString(){throw te(Z)}},ne="@azure/msal-common",se="14.15.0";function re(e,t){const i=function(e){if(!e)throw te(d);const t=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(e);if(!t||t.length<4)throw te(u);return t[2]}(e);try{const e=t(i);return JSON.parse(e)}catch(e){throw te(u)}}function oe(e,t){if(0===t||Date.now()-3e5>e+t)throw te(S)}function ae(){return Math.round((new Date).getTime()/1e3)}function le(e,t){const i=Number(e)||0;return ae()+t>i}function ce(e){return[ye(e),ve(e),be(e),Ce(e),we(e)].join(s.LR.CACHE_KEY_SEPARATOR).toLowerCase()}function he(e,t,i,n,r){return{credentialType:s.aG.ID_TOKEN,homeAccountId:e,environment:t,clientId:n,secret:i,realm:r}}function ue(e,t,i,n,r,o,a,l,c,h,u,d,p,g,f){const m={homeAccountId:e,credentialType:s.aG.ACCESS_TOKEN,secret:i,cachedAt:ae().toString(),expiresOn:a.toString(),extendedExpiresOn:l.toString(),environment:t,clientId:n,realm:r,target:o,tokenType:u||s.IO.BEARER};if(d&&(m.userAssertionHash=d),h&&(m.refreshOn=h.toString()),g&&(m.requestedClaims=g,m.requestedClaimsHash=f),m.tokenType?.toLowerCase()!==s.IO.BEARER.toLowerCase())switch(m.credentialType=s.aG.ACCESS_TOKEN_WITH_AUTH_SCHEME,m.tokenType){case s.IO.POP:const e=re(i,c);if(!e?.cnf?.kid)throw te(z);m.keyId=e.cnf.kid;break;case s.IO.SSH:m.keyId=p}return m}function de(e,t,i,n,r,o,a){const l={credentialType:s.aG.REFRESH_TOKEN,homeAccountId:e,environment:t,clientId:n,secret:i};return o&&(l.userAssertionHash=o),r&&(l.familyId=r),a&&(l.expiresOn=a.toString()),l}function pe(e){return e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("credentialType")&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("secret")}function ge(e){return!!e&&pe(e)&&e.hasOwnProperty("realm")&&e.hasOwnProperty("target")&&(e.credentialType===s.aG.ACCESS_TOKEN||e.credentialType===s.aG.ACCESS_TOKEN_WITH_AUTH_SCHEME)}function fe(e){return!!e&&pe(e)&&e.hasOwnProperty("realm")&&e.credentialType===s.aG.ID_TOKEN}function me(e){return!!e&&pe(e)&&e.credentialType===s.aG.REFRESH_TOKEN}function ye(e){return[e.homeAccountId,e.environment].join(s.LR.CACHE_KEY_SEPARATOR).toLowerCase()}function ve(e){const t=e.credentialType===s.aG.REFRESH_TOKEN&&e.familyId||e.clientId;return[e.credentialType,t,e.realm||""].join(s.LR.CACHE_KEY_SEPARATOR).toLowerCase()}function be(e){return(e.target||"").toLowerCase()}function Ce(e){return(e.requestedClaimsHash||"").toLowerCase()}function we(e){return e.tokenType&&e.tokenType.toLowerCase()!==s.IO.BEARER.toLowerCase()?e.tokenType.toLowerCase():""}function Se(){return ae()+s.u0.REFRESH_TIME_SECONDS}function xe(e,t,i){e.authorization_endpoint=t.authorization_endpoint,e.token_endpoint=t.token_endpoint,e.end_session_endpoint=t.end_session_endpoint,e.issuer=t.issuer,e.endpointsFromNetwork=i,e.jwks_uri=t.jwks_uri}function Ee(e,t,i){e.aliases=t.aliases,e.preferred_cache=t.preferred_cache,e.preferred_network=t.preferred_network,e.aliasesFromNetwork=i}function Ae(e){return e.expiresAt<=ae()}const Me="redirect_uri_empty",Te="claims_request_parsing_error",De="authority_uri_insecure",Ie="url_parse_error",Re="empty_url_error",ke="empty_input_scopes_error",Pe="invalid_prompt_value",_e="invalid_claims",Le="token_request_empty",Ne="logout_request_empty",Oe="invalid_code_challenge_method",Fe="pkce_params_missing",Ge="invalid_cloud_discovery_metadata",Be="invalid_authority_metadata",Ve="untrusted_authority",He="missing_ssh_jwk",Ue="missing_ssh_kid",ze="missing_nonce_authentication_header",We="invalid_authentication_header",je="cannot_set_OIDCOptions",$e="cannot_allow_native_broker",Ke="authority_mismatch",Ye={[Me]:"A redirect URI is required for all calls, and none has been set.",[Te]:"Could not parse the given claims request object.",[De]:"Authority URIs must use https.  Please see here for valid authority configuration options: https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-js-initializing-client-applications#configuration-options",[Ie]:"URL could not be parsed into appropriate segments.",[Re]:"URL was empty or null.",[ke]:"Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token.",[Pe]:"Please see here for valid configuration options: https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_common.html#commonauthorizationurlrequest",[_e]:"Given claims parameter must be a stringified JSON object.",[Le]:"Token request was empty and not found in cache.",[Ne]:"The logout request was null or undefined.",[Oe]:'code_challenge_method passed is invalid. Valid values are "plain" and "S256".',[Fe]:"Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request",[Ge]:"Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields",[Be]:"Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields.",[Ve]:"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter.",[He]:"Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme.",[Ue]:"Missing sshKid in SSH certificate request. A string that uniquely identifies the public SSH key is required when using the SSH authentication scheme.",[ze]:"Unable to find an authentication header containing server nonce. Either the Authentication-Info or WWW-Authenticate headers must be present in order to obtain a server nonce.",[We]:"Invalid authentication header provided",[je]:"Cannot set OIDCOptions parameter. Please change the protocol mode to OIDC or use a non-Microsoft authority.",[$e]:"Cannot set allowNativeBroker parameter to true when not in AAD protocol mode.",[Ke]:"Authority mismatch error. Authority provided in login request or PublicClientApplication config does not match the environment of the provided account. Please use a matching account or make an interactive request to login to this authority."};class qe extends l.lR{constructor(e){super(e,Ye[e]),this.name="ClientConfigurationError",Object.setPrototypeOf(this,qe.prototype)}}function Xe(e){return new qe(e)}class Ze{static isEmptyObj(e){if(e)try{const t=JSON.parse(e);return 0===Object.keys(t).length}catch(e){}return!0}static startsWith(e,t){return 0===e.indexOf(t)}static endsWith(e,t){return e.length>=t.length&&e.lastIndexOf(t)===e.length-t.length}static queryStringToObject(e){const t={},i=e.split("&"),n=e=>decodeURIComponent(e.replace(/\+/g," "));return i.forEach(e=>{if(e.trim()){const[i,s]=e.split(/=(.+)/g,2);i&&s&&(t[n(i)]=n(s))}}),t}static trimArrayEntries(e){return e.map(e=>e.trim())}static removeEmptyStringsFromArray(e){return e.filter(e=>!!e)}static jsonParseHelper(e){try{return JSON.parse(e)}catch(e){return null}}static matchPattern(e,t){return new RegExp(e.replace(/\\/g,"\\\\").replace(/\*/g,"[^ ]*").replace(/\?/g,"\\?")).test(t)}}class Qe{constructor(e){const t=e?Ze.trimArrayEntries([...e]):[],i=t?Ze.removeEmptyStringsFromArray(t):[];this.validateInputScopes(i),this.scopes=new Set,i.forEach(e=>this.scopes.add(e))}static fromString(e){const t=(e||s.YM.EMPTY_STRING).split(" ");return new Qe(t)}static createSearchScopes(e){const t=new Qe(e);return t.containsOnlyOIDCScopes()?t.removeScope(s.YM.OFFLINE_ACCESS_SCOPE):t.removeOIDCScopes(),t}validateInputScopes(e){if(!e||e.length<1)throw Xe(ke)}containsScope(e){const t=this.printScopesLowerCase().split(" "),i=new Qe(t);return!!e&&i.scopes.has(e.toLowerCase())}containsScopeSet(e){return!(!e||e.scopes.size<=0)&&this.scopes.size>=e.scopes.size&&e.asArray().every(e=>this.containsScope(e))}containsOnlyOIDCScopes(){let e=0;return s._A.forEach(t=>{this.containsScope(t)&&(e+=1)}),this.scopes.size===e}appendScope(e){e&&this.scopes.add(e.trim())}appendScopes(e){try{e.forEach(e=>this.appendScope(e))}catch(e){throw te(D)}}removeScope(e){if(!e)throw te(T);this.scopes.delete(e.trim())}removeOIDCScopes(){s._A.forEach(e=>{this.scopes.delete(e)})}unionScopeSets(e){if(!e)throw te(I);const t=new Set;return e.scopes.forEach(e=>t.add(e.toLowerCase())),this.scopes.forEach(e=>t.add(e.toLowerCase())),t}intersectingScopeSets(e){if(!e)throw te(I);e.containsOnlyOIDCScopes()||e.removeOIDCScopes();const t=this.unionScopeSets(e),i=e.getScopeCount(),n=this.getScopeCount();return t.size<n+i}getScopeCount(){return this.scopes.size}asArray(){const e=[];return this.scopes.forEach(t=>e.push(t)),e}printScopes(){return this.scopes?this.asArray().join(" "):s.YM.EMPTY_STRING}printScopesLowerCase(){return this.printScopes().toLowerCase()}}function Je(e,t){if(!e)throw te(h);try{const i=t(e);return JSON.parse(i)}catch(e){throw te(c)}}function et(e){if(!e)throw te(c);const t=e.split(s.LR.CLIENT_INFO_SEPARATOR,2);return{uid:t[0],utid:t.length<2?s.YM.EMPTY_STRING:t[1]}}function tt(e,t){return!!e&&!!t&&e===t.split(".")[1]}function it(e,t,i,n){if(n){const{oid:t,sub:i,tid:s,name:r,tfp:o,acr:a}=n,l=s||o||a||"";return{tenantId:l,localAccountId:t||i||"",name:r,isHomeTenant:tt(l,e)}}return{tenantId:i,localAccountId:t,isHomeTenant:tt(i,e)}}function nt(e,t,i,n){let s=e;if(t){const{isHomeTenant:i,...n}=t;s={...e,...n}}if(i){const{isHomeTenant:t,...r}=it(e.homeAccountId,e.localAccountId,e.tenantId,i);return s={...s,...r,idTokenClaims:i,idToken:n},s}return s}function st(e){return e&&(e.tid||e.tfp||e.acr)||null}class rt{generateAccountId(){return[this.homeAccountId,this.environment].join(s.LR.CACHE_KEY_SEPARATOR).toLowerCase()}generateAccountKey(){return rt.generateAccountCacheKey({homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId})}getAccountInfo(){return{homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId,name:this.name,nativeAccountId:this.nativeAccountId,authorityType:this.authorityType,tenantProfiles:new Map((this.tenantProfiles||[]).map(e=>[e.tenantId,e]))}}isSingleTenant(){return!this.tenantProfiles}static generateAccountCacheKey(e){const t=e.homeAccountId.split(".")[1];return[e.homeAccountId,e.environment||"",t||e.tenantId||""].join(s.LR.CACHE_KEY_SEPARATOR).toLowerCase()}static createAccount(e,t,i){const n=new rt;let o;1===t.authorityType?n.authorityType=s.Qd.ADFS_ACCOUNT_TYPE:t.protocolMode===r?n.authorityType=s.Qd.MSSTS_ACCOUNT_TYPE:n.authorityType=s.Qd.GENERIC_ACCOUNT_TYPE,e.clientInfo&&i&&(o=Je(e.clientInfo,i)),n.clientInfo=e.clientInfo,n.homeAccountId=e.homeAccountId,n.nativeAccountId=e.nativeAccountId;const a=e.environment||t&&t.getPreferredCache();if(!a)throw te(N);n.environment=a,n.realm=o?.utid||st(e.idTokenClaims)||"",n.localAccountId=o?.uid||e.idTokenClaims?.oid||e.idTokenClaims?.sub||"";const l=e.idTokenClaims?.preferred_username||e.idTokenClaims?.upn,c=e.idTokenClaims?.emails?e.idTokenClaims.emails[0]:null;if(n.username=l||c||"",n.name=e.idTokenClaims?.name||"",n.cloudGraphHostName=e.cloudGraphHostName,n.msGraphHost=e.msGraphHost,e.tenantProfiles)n.tenantProfiles=e.tenantProfiles;else{const t=it(e.homeAccountId,n.localAccountId,n.realm,e.idTokenClaims);n.tenantProfiles=[t]}return n}static createFromAccountInfo(e,t,i){const n=new rt;return n.authorityType=e.authorityType||s.Qd.GENERIC_ACCOUNT_TYPE,n.homeAccountId=e.homeAccountId,n.localAccountId=e.localAccountId,n.nativeAccountId=e.nativeAccountId,n.realm=e.tenantId,n.environment=e.environment,n.username=e.username,n.name=e.name,n.cloudGraphHostName=t,n.msGraphHost=i,n.tenantProfiles=Array.from(e.tenantProfiles?.values()||[]),n}static generateHomeAccountId(e,t,i,n,s){if(1!==t&&2!==t){if(e)try{const t=Je(e,n.base64Decode);if(t.uid&&t.utid)return`${t.uid}.${t.utid}`}catch(e){}i.warning("No client info in response")}return s?.sub||""}static isAccountEntity(e){return!!e&&e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("localAccountId")&&e.hasOwnProperty("username")&&e.hasOwnProperty("authorityType")}static accountInfoIsEqual(e,t,i){if(!e||!t)return!1;let n=!0;if(i){const i=e.idTokenClaims||{},s=t.idTokenClaims||{};n=i.iat===s.iat&&i.nonce===s.nonce}return e.homeAccountId===t.homeAccountId&&e.localAccountId===t.localAccountId&&e.username===t.username&&e.tenantId===t.tenantId&&e.environment===t.environment&&e.nativeAccountId===t.nativeAccountId&&n}}function ot(e){return e.startsWith("#/")?e.substring(2):e.startsWith("#")||e.startsWith("?")?e.substring(1):e}function at(e){if(!e||e.indexOf("=")<0)return null;try{const t=ot(e),i=Object.fromEntries(new URLSearchParams(t));if(i.code||i.error||i.error_description||i.state)return i}catch(e){throw te(m)}return null}class lt{get urlString(){return this._urlString}constructor(e){if(this._urlString=e,!this._urlString)throw Xe(Re);e.includes("#")||(this._urlString=lt.canonicalizeUri(e))}static canonicalizeUri(e){if(e){let t=e.toLowerCase();return Ze.endsWith(t,"?")?t=t.slice(0,-1):Ze.endsWith(t,"?/")&&(t=t.slice(0,-2)),Ze.endsWith(t,"/")||(t+="/"),t}return e}validateAsUri(){let e;try{e=this.getUrlComponents()}catch(e){throw Xe(Ie)}if(!e.HostNameAndPort||!e.PathSegments)throw Xe(Ie);if(!e.Protocol||"https:"!==e.Protocol.toLowerCase())throw Xe(De)}static appendQueryString(e,t){return t?e.indexOf("?")<0?`${e}?${t}`:`${e}&${t}`:e}static removeHashFromUrl(e){return lt.canonicalizeUri(e.split("#")[0])}replaceTenantPath(e){const t=this.getUrlComponents(),i=t.PathSegments;return!e||0===i.length||i[0]!==s.v2.COMMON&&i[0]!==s.v2.ORGANIZATIONS||(i[0]=e),lt.constructAuthorityUriFromObject(t)}getUrlComponents(){const e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),t=this.urlString.match(e);if(!t)throw Xe(Ie);const i={Protocol:t[1],HostNameAndPort:t[4],AbsolutePath:t[5],QueryString:t[7]};let n=i.AbsolutePath.split("/");return n=n.filter(e=>e&&e.length>0),i.PathSegments=n,i.QueryString&&i.QueryString.endsWith("/")&&(i.QueryString=i.QueryString.substring(0,i.QueryString.length-1)),i}static getDomainFromUrl(e){const t=RegExp("^([^:/?#]+://)?([^/?#]*)"),i=e.match(t);if(!i)throw Xe(Ie);return i[2]}static getAbsoluteUrl(e,t){if(e[0]===s.YM.FORWARD_SLASH){const i=new lt(t).getUrlComponents();return i.Protocol+"//"+i.HostNameAndPort+e}return e}static constructAuthorityUriFromObject(e){return new lt(e.Protocol+"//"+e.HostNameAndPort+"/"+e.PathSegments.join("/"))}static hashContainsKnownProperties(e){return!!at(e)}}const ct={"login.microsoftonline.com":{token_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.microsoftonline.com/{tenantid}/discovery/v2.0/keys",issuer:"https://login.microsoftonline.com/{tenantid}/v2.0",authorization_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/logout"},"login.chinacloudapi.cn":{token_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.chinacloudapi.cn/{tenantid}/discovery/v2.0/keys",issuer:"https://login.partner.microsoftonline.cn/{tenantid}/v2.0",authorization_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/logout"},"login.microsoftonline.us":{token_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.microsoftonline.us/{tenantid}/discovery/v2.0/keys",issuer:"https://login.microsoftonline.us/{tenantid}/v2.0",authorization_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/logout"}},ht={tenant_discovery_endpoint:"https://{canonicalAuthority}/v2.0/.well-known/openid-configuration",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},ut=new Set;function dt(e,t,i,n){if(n?.trace(`getAliasesFromMetadata called with source: ${i}`),e&&t){const s=pt(t,e);if(s)return n?.trace(`getAliasesFromMetadata: found cloud discovery metadata in ${i}, returning aliases`),s.aliases;n?.trace(`getAliasesFromMetadata: did not find cloud discovery metadata in ${i}`)}return null}function pt(e,t){for(let i=0;i<e.length;i++){const n=e[i];if(n.aliases.includes(t))return n}return null}ht.metadata.forEach(e=>{e.aliases.forEach(e=>{ut.add(e)})});const gt="cache_quota_exceeded",ft="cache_error_unknown",mt={[gt]:"Exceeded cache storage capacity.",[ft]:"Unexpected error occurred when using cache storage."};class yt extends Error{constructor(e,t){const i=t||(mt[e]?mt[e]:mt[ft]);super(`${e}: ${i}`),Object.setPrototypeOf(this,yt.prototype),this.name="CacheError",this.errorCode=e,this.errorMessage=i}}class vt{constructor(e,t,i,n){this.clientId=e,this.cryptoImpl=t,this.commonLogger=i.clone(ne,se),this.staticAuthorityOptions=n}getAllAccounts(e){return this.buildTenantProfiles(this.getAccountsFilteredBy(e||{}),e)}getAccountInfoFilteredBy(e){const t=this.getAllAccounts(e);return t.length>1?t.sort(e=>e.idTokenClaims?-1:1)[0]:1===t.length?t[0]:null}getBaseAccountInfo(e){const t=this.getAccountsFilteredBy(e);return t.length>0?t[0].getAccountInfo():null}buildTenantProfiles(e,t){return e.flatMap(e=>this.getTenantProfilesFromAccountEntity(e,t?.tenantId,t))}getTenantedAccountInfoByFilter(e,t,i,n){let s,r=null;if(n&&!this.tenantProfileMatchesFilter(i,n))return null;const o=this.getIdToken(e,t,i.tenantId);return o&&(s=re(o.secret,this.cryptoImpl.base64Decode),!this.idTokenClaimsMatchTenantProfileFilter(s,n))?null:(r=nt(e,i,s,o?.secret),r)}getTenantProfilesFromAccountEntity(e,t,i){const n=e.getAccountInfo();let s=n.tenantProfiles||new Map;const r=this.getTokenKeys();if(t){const e=s.get(t);if(!e)return[];s=new Map([[t,e]])}const o=[];return s.forEach(e=>{const t=this.getTenantedAccountInfoByFilter(n,r,e,i);t&&o.push(t)}),o}tenantProfileMatchesFilter(e,t){return!(t.localAccountId&&!this.matchLocalAccountIdFromTenantProfile(e,t.localAccountId)||t.name&&e.name!==t.name||void 0!==t.isHomeTenant&&e.isHomeTenant!==t.isHomeTenant)}idTokenClaimsMatchTenantProfileFilter(e,t){if(t){if(t.localAccountId&&!this.matchLocalAccountIdFromTokenClaims(e,t.localAccountId))return!1;if(t.loginHint&&!this.matchLoginHintFromTokenClaims(e,t.loginHint))return!1;if(t.username&&!this.matchUsername(e.preferred_username,t.username))return!1;if(t.name&&!this.matchName(e,t.name))return!1;if(t.sid&&!this.matchSid(e,t.sid))return!1}return!0}async saveCacheRecord(e,t,i){if(!e)throw te(L);try{e.account&&this.setAccount(e.account),e.idToken&&!1!==t?.idToken&&this.setIdTokenCredential(e.idToken),e.accessToken&&!1!==t?.accessToken&&await this.saveAccessToken(e.accessToken),e.refreshToken&&!1!==t?.refreshToken&&this.setRefreshTokenCredential(e.refreshToken),e.appMetadata&&this.setAppMetadata(e.appMetadata)}catch(e){throw this.commonLogger?.error("CacheManager.saveCacheRecord: failed"),e instanceof Error?(this.commonLogger?.errorPii(`CacheManager.saveCacheRecord: ${e.message}`,i),"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name||e.message.includes("exceeded the quota")?(this.commonLogger?.error("CacheManager.saveCacheRecord: exceeded storage quota",i),new yt(gt)):new yt(e.name,e.message)):(this.commonLogger?.errorPii(`CacheManager.saveCacheRecord: ${e}`,i),new yt(ft))}}async saveAccessToken(e){const t={clientId:e.clientId,credentialType:e.credentialType,environment:e.environment,homeAccountId:e.homeAccountId,realm:e.realm,tokenType:e.tokenType,requestedClaimsHash:e.requestedClaimsHash},i=this.getTokenKeys(),n=Qe.fromString(e.target),s=[];i.accessToken.forEach(e=>{if(!this.accessTokenKeyMatchesFilter(e,t,!1))return;const i=this.getAccessTokenCredential(e);i&&this.credentialMatchesFilter(i,t)&&Qe.fromString(i.target).intersectingScopeSets(n)&&s.push(this.removeAccessToken(e))}),await Promise.all(s),this.setAccessTokenCredential(e)}getAccountsFilteredBy(e){const t=this.getAccountKeys(),i=[];return t.forEach(t=>{if(!this.isAccountKey(t,e.homeAccountId))return;const n=this.getAccount(t,this.commonLogger);if(!n)return;if(e.homeAccountId&&!this.matchHomeAccountId(n,e.homeAccountId))return;if(e.username&&!this.matchUsername(n.username,e.username))return;if(e.environment&&!this.matchEnvironment(n,e.environment))return;if(e.realm&&!this.matchRealm(n,e.realm))return;if(e.nativeAccountId&&!this.matchNativeAccountId(n,e.nativeAccountId))return;if(e.authorityType&&!this.matchAuthorityType(n,e.authorityType))return;const s={localAccountId:e?.localAccountId,name:e?.name},r=n.tenantProfiles?.filter(e=>this.tenantProfileMatchesFilter(e,s));r&&0===r.length||i.push(n)}),i}isAccountKey(e,t,i){return!(e.split(s.LR.CACHE_KEY_SEPARATOR).length<3||t&&!e.toLowerCase().includes(t.toLowerCase())||i&&!e.toLowerCase().includes(i.toLowerCase()))}isCredentialKey(e){if(e.split(s.LR.CACHE_KEY_SEPARATOR).length<6)return!1;const t=e.toLowerCase();if(-1===t.indexOf(s.aG.ID_TOKEN.toLowerCase())&&-1===t.indexOf(s.aG.ACCESS_TOKEN.toLowerCase())&&-1===t.indexOf(s.aG.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase())&&-1===t.indexOf(s.aG.REFRESH_TOKEN.toLowerCase()))return!1;if(t.indexOf(s.aG.REFRESH_TOKEN.toLowerCase())>-1){const e=`${s.aG.REFRESH_TOKEN}${s.LR.CACHE_KEY_SEPARATOR}${this.clientId}${s.LR.CACHE_KEY_SEPARATOR}`,i=`${s.aG.REFRESH_TOKEN}${s.LR.CACHE_KEY_SEPARATOR}${s.hB}${s.LR.CACHE_KEY_SEPARATOR}`;if(-1===t.indexOf(e.toLowerCase())&&-1===t.indexOf(i.toLowerCase()))return!1}else if(-1===t.indexOf(this.clientId.toLowerCase()))return!1;return!0}credentialMatchesFilter(e,t){if(t.clientId&&!this.matchClientId(e,t.clientId))return!1;if(t.userAssertionHash&&!this.matchUserAssertionHash(e,t.userAssertionHash))return!1;if("string"==typeof t.homeAccountId&&!this.matchHomeAccountId(e,t.homeAccountId))return!1;if(t.environment&&!this.matchEnvironment(e,t.environment))return!1;if(t.realm&&!this.matchRealm(e,t.realm))return!1;if(t.credentialType&&!this.matchCredentialType(e,t.credentialType))return!1;if(t.familyId&&!this.matchFamilyId(e,t.familyId))return!1;if(t.target&&!this.matchTarget(e,t.target))return!1;if((t.requestedClaimsHash||e.requestedClaimsHash)&&e.requestedClaimsHash!==t.requestedClaimsHash)return!1;if(e.credentialType===s.aG.ACCESS_TOKEN_WITH_AUTH_SCHEME){if(t.tokenType&&!this.matchTokenType(e,t.tokenType))return!1;if(t.tokenType===s.IO.SSH&&t.keyId&&!this.matchKeyId(e,t.keyId))return!1}return!0}getAppMetadataFilteredBy(e){const t=this.getKeys(),i={};return t.forEach(t=>{if(!this.isAppMetadata(t))return;const n=this.getAppMetadata(t);n&&(e.environment&&!this.matchEnvironment(n,e.environment)||e.clientId&&!this.matchClientId(n,e.clientId)||(i[t]=n))}),i}getAuthorityMetadataByAlias(e){const t=this.getAuthorityMetadataKeys();let i=null;return t.forEach(t=>{if(!this.isAuthorityMetadata(t)||-1===t.indexOf(this.clientId))return;const n=this.getAuthorityMetadata(t);n&&-1!==n.aliases.indexOf(e)&&(i=n)}),i}async removeAllAccounts(){const e=this.getAccountKeys(),t=[];e.forEach(e=>{t.push(this.removeAccount(e))}),await Promise.all(t)}async removeAccount(e){const t=this.getAccount(e,this.commonLogger);t&&(await this.removeAccountContext(t),this.removeItem(e))}async removeAccountContext(e){const t=this.getTokenKeys(),i=e.generateAccountId(),n=[];t.idToken.forEach(e=>{0===e.indexOf(i)&&this.removeIdToken(e)}),t.accessToken.forEach(e=>{0===e.indexOf(i)&&n.push(this.removeAccessToken(e))}),t.refreshToken.forEach(e=>{0===e.indexOf(i)&&this.removeRefreshToken(e)}),await Promise.all(n)}updateOutdatedCachedAccount(e,t,i){if(t&&t.isSingleTenant()){this.commonLogger?.verbose("updateOutdatedCachedAccount: Found a single-tenant (outdated) account entity in the cache, migrating to multi-tenant account entity");const n=this.getAccountKeys().filter(e=>e.startsWith(t.homeAccountId)),s=[];n.forEach(e=>{const t=this.getCachedAccountEntity(e);t&&s.push(t)});const r=s.find(e=>tt(e.realm,e.homeAccountId))||s[0];r.tenantProfiles=s.map(e=>({tenantId:e.realm,localAccountId:e.localAccountId,name:e.name,isHomeTenant:tt(e.realm,e.homeAccountId)}));const o=vt.toObject(new rt,{...r}),a=o.generateAccountKey();return n.forEach(t=>{t!==a&&this.removeOutdatedAccount(e)}),this.setAccount(o),i?.verbose("Updated an outdated account entity in the cache"),o}return t}async removeAccessToken(e){const t=this.getAccessTokenCredential(e);if(t){if(t.credentialType.toLowerCase()===s.aG.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()&&t.tokenType===s.IO.POP){const e=t.keyId;if(e)try{await this.cryptoImpl.removeTokenBindingKey(e)}catch(e){throw te(j)}}return this.removeItem(e)}}removeAppMetadata(){return this.getKeys().forEach(e=>{this.isAppMetadata(e)&&this.removeItem(e)}),!0}readAccountFromCache(e){const t=rt.generateAccountCacheKey(e);return this.getAccount(t,this.commonLogger)}getIdToken(e,t,i,n,r){this.commonLogger.trace("CacheManager - getIdToken called");const o={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:s.aG.ID_TOKEN,clientId:this.clientId,realm:i},a=this.getIdTokensByFilter(o,t),l=a.size;if(l<1)return this.commonLogger.info("CacheManager:getIdToken - No token found"),null;if(l>1){let t=a;if(!i){const i=new Map;a.forEach((t,n)=>{t.realm===e.tenantId&&i.set(n,t)});const n=i.size;if(n<1)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account but none match account entity tenant id, returning first result"),a.values().next().value;if(1===n)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account, defaulting to home tenant profile"),i.values().next().value;t=i}return this.commonLogger.info("CacheManager:getIdToken - Multiple matching ID tokens found, clearing them"),t.forEach((e,t)=>{this.removeIdToken(t)}),n&&r&&n.addFields({multiMatchedID:a.size},r),null}return this.commonLogger.info("CacheManager:getIdToken - Returning ID token"),a.values().next().value}getIdTokensByFilter(e,t){const i=t&&t.idToken||this.getTokenKeys().idToken,n=new Map;return i.forEach(t=>{if(!this.idTokenKeyMatchesFilter(t,{clientId:this.clientId,...e}))return;const i=this.getIdTokenCredential(t);i&&this.credentialMatchesFilter(i,e)&&n.set(t,i)}),n}idTokenKeyMatchesFilter(e,t){const i=e.toLowerCase();return!(t.clientId&&-1===i.indexOf(t.clientId.toLowerCase())||t.homeAccountId&&-1===i.indexOf(t.homeAccountId.toLowerCase()))}removeIdToken(e){this.removeItem(e)}removeRefreshToken(e){this.removeItem(e)}getAccessToken(e,t,i,n,r,o){this.commonLogger.trace("CacheManager - getAccessToken called");const a=Qe.createSearchScopes(t.scopes),l=t.authenticationScheme||s.IO.BEARER,c=l&&l.toLowerCase()!==s.IO.BEARER.toLowerCase()?s.aG.ACCESS_TOKEN_WITH_AUTH_SCHEME:s.aG.ACCESS_TOKEN,h={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:c,clientId:this.clientId,realm:n||e.tenantId,target:a,tokenType:l,keyId:t.sshKid,requestedClaimsHash:t.requestedClaimsHash},u=i&&i.accessToken||this.getTokenKeys().accessToken,d=[];u.forEach(e=>{if(this.accessTokenKeyMatchesFilter(e,h,!0)){const t=this.getAccessTokenCredential(e);t&&this.credentialMatchesFilter(t,h)&&d.push(t)}});const p=d.length;return p<1?(this.commonLogger.info("CacheManager:getAccessToken - No token found"),null):p>1?(this.commonLogger.info("CacheManager:getAccessToken - Multiple access tokens found, clearing them"),d.forEach(e=>{this.removeAccessToken(ce(e))}),r&&o&&r.addFields({multiMatchedAT:d.length},o),null):(this.commonLogger.info("CacheManager:getAccessToken - Returning access token"),d[0])}accessTokenKeyMatchesFilter(e,t,i){const n=e.toLowerCase();if(t.clientId&&-1===n.indexOf(t.clientId.toLowerCase()))return!1;if(t.homeAccountId&&-1===n.indexOf(t.homeAccountId.toLowerCase()))return!1;if(t.realm&&-1===n.indexOf(t.realm.toLowerCase()))return!1;if(t.requestedClaimsHash&&-1===n.indexOf(t.requestedClaimsHash.toLowerCase()))return!1;if(t.target){const e=t.target.asArray();for(let t=0;t<e.length;t++){if(i&&!n.includes(e[t].toLowerCase()))return!1;if(!i&&n.includes(e[t].toLowerCase()))return!0}}return!0}getAccessTokensByFilter(e){const t=this.getTokenKeys(),i=[];return t.accessToken.forEach(t=>{if(!this.accessTokenKeyMatchesFilter(t,e,!0))return;const n=this.getAccessTokenCredential(t);n&&this.credentialMatchesFilter(n,e)&&i.push(n)}),i}getRefreshToken(e,t,i,n,r){this.commonLogger.trace("CacheManager - getRefreshToken called");const o=t?s.hB:void 0,a={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:s.aG.REFRESH_TOKEN,clientId:this.clientId,familyId:o},l=i&&i.refreshToken||this.getTokenKeys().refreshToken,c=[];l.forEach(e=>{if(this.refreshTokenKeyMatchesFilter(e,a)){const t=this.getRefreshTokenCredential(e);t&&this.credentialMatchesFilter(t,a)&&c.push(t)}});const h=c.length;return h<1?(this.commonLogger.info("CacheManager:getRefreshToken - No refresh token found."),null):(h>1&&n&&r&&n.addFields({multiMatchedRT:h},r),this.commonLogger.info("CacheManager:getRefreshToken - returning refresh token"),c[0])}refreshTokenKeyMatchesFilter(e,t){const i=e.toLowerCase();return!(t.familyId&&-1===i.indexOf(t.familyId.toLowerCase())||!t.familyId&&t.clientId&&-1===i.indexOf(t.clientId.toLowerCase())||t.homeAccountId&&-1===i.indexOf(t.homeAccountId.toLowerCase()))}readAppMetadataFromCache(e){const t={environment:e,clientId:this.clientId},i=this.getAppMetadataFilteredBy(t),n=Object.keys(i).map(e=>i[e]),s=n.length;if(s<1)return null;if(s>1)throw te(A);return n[0]}isAppMetadataFOCI(e){const t=this.readAppMetadataFromCache(e);return!(!t||t.familyId!==s.hB)}matchHomeAccountId(e,t){return!("string"!=typeof e.homeAccountId||t!==e.homeAccountId)}matchLocalAccountIdFromTokenClaims(e,t){return t===(e.oid||e.sub)}matchLocalAccountIdFromTenantProfile(e,t){return e.localAccountId===t}matchName(e,t){return!(t.toLowerCase()!==e.name?.toLowerCase())}matchUsername(e,t){return!(!e||"string"!=typeof e||t?.toLowerCase()!==e.toLowerCase())}matchUserAssertionHash(e,t){return!(!e.userAssertionHash||t!==e.userAssertionHash)}matchEnvironment(e,t){if(this.staticAuthorityOptions){const i=function(e,t){let i;const n=e.canonicalAuthority;if(n){const r=new lt(n).getUrlComponents().HostNameAndPort;i=dt(r,e.cloudDiscoveryMetadata?.metadata,s.E_.CONFIG,t)||dt(r,ht.metadata,s.E_.HARDCODED_VALUES,t)||e.knownAuthorities}return i||[]}(this.staticAuthorityOptions,this.commonLogger);if(i.includes(t)&&i.includes(e.environment))return!0}const i=this.getAuthorityMetadataByAlias(t);return!!(i&&i.aliases.indexOf(e.environment)>-1)}matchCredentialType(e,t){return e.credentialType&&t.toLowerCase()===e.credentialType.toLowerCase()}matchClientId(e,t){return!(!e.clientId||t!==e.clientId)}matchFamilyId(e,t){return!(!e.familyId||t!==e.familyId)}matchRealm(e,t){return!(e.realm?.toLowerCase()!==t.toLowerCase())}matchNativeAccountId(e,t){return!(!e.nativeAccountId||t!==e.nativeAccountId)}matchLoginHintFromTokenClaims(e,t){return e.login_hint===t||e.preferred_username===t||e.upn===t}matchSid(e,t){return e.sid===t}matchAuthorityType(e,t){return!(!e.authorityType||t.toLowerCase()!==e.authorityType.toLowerCase())}matchTarget(e,t){return!(e.credentialType!==s.aG.ACCESS_TOKEN&&e.credentialType!==s.aG.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target)&&Qe.fromString(e.target).containsScopeSet(t)}matchTokenType(e,t){return!(!e.tokenType||e.tokenType!==t)}matchKeyId(e,t){return!(!e.keyId||e.keyId!==t)}isAppMetadata(e){return-1!==e.indexOf(s.GU)}isAuthorityMetadata(e){return-1!==e.indexOf(s.u0.CACHE_KEY)}generateAuthorityMetadataCacheKey(e){return`${s.u0.CACHE_KEY}-${this.clientId}-${e}`}static toObject(e,t){for(const i in t)e[i]=t[i];return e}}class bt extends vt{setAccount(){throw te(Z)}getAccount(){throw te(Z)}getCachedAccountEntity(){throw te(Z)}setIdTokenCredential(){throw te(Z)}getIdTokenCredential(){throw te(Z)}setAccessTokenCredential(){throw te(Z)}getAccessTokenCredential(){throw te(Z)}setRefreshTokenCredential(){throw te(Z)}getRefreshTokenCredential(){throw te(Z)}setAppMetadata(){throw te(Z)}getAppMetadata(){throw te(Z)}setServerTelemetry(){throw te(Z)}getServerTelemetry(){throw te(Z)}setAuthorityMetadata(){throw te(Z)}getAuthorityMetadata(){throw te(Z)}getAuthorityMetadataKeys(){throw te(Z)}setThrottlingCache(){throw te(Z)}getThrottlingCache(){throw te(Z)}removeItem(){throw te(Z)}getKeys(){throw te(Z)}getAccountKeys(){throw te(Z)}getTokenKeys(){throw te(Z)}async clear(){throw te(Z)}updateCredentialCacheKey(){throw te(Z)}removeOutdatedAccount(){throw te(Z)}}const Ct={tokenRenewalOffsetSeconds:s.F0,preventCorsPreflight:!1},wt={loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:n.$.Info,correlationId:s.YM.EMPTY_STRING},St={claimsBasedCachingEnabled:!1},xt={async sendGetRequestAsync(){throw te(Z)},async sendPostRequestAsync(){throw te(Z)}},Et={sku:s.YM.SKU,version:se,cpu:s.YM.EMPTY_STRING,os:s.YM.EMPTY_STRING},At={clientSecret:s.YM.EMPTY_STRING,clientAssertion:void 0},Mt={azureCloudInstance:a,tenant:`${s.YM.DEFAULT_COMMON_TENANT}`},Tt={application:{appName:"",appVersion:""}};function Dt(e){return e.authOptions.authority.options.protocolMode===o}const It={sendGetRequestAsync:()=>Promise.reject(te(Z)),sendPostRequestAsync:()=>Promise.reject(te(Z))},Rt="acquireTokenByCode",kt="acquireTokenByRefreshToken",Pt="acquireTokenSilent",_t="acquireTokenSilentAsync",Lt="acquireTokenPopup",Nt="acquireTokenRedirect",Ot="cryptoOptsGetPublicKeyThumbprint",Ft="cryptoOptsSignJwt",Gt="silentCacheClientAcquireToken",Bt="silentIframeClientAcquireToken",Vt="silentRefreshClientAcquireToken",Ht="ssoSilent",Ut="standardInteractionClientGetDiscoveredAuthority",zt="fetchAccountIdWithNativeBroker",Wt="nativeInteractionClientAcquireToken",jt="refreshTokenClientExecutePostToTokenEndpoint",$t="authorizationCodeClientExecutePostToTokenEndpoint",Kt="refreshTokenClientExecuteTokenRequest",Yt="refreshTokenClientAcquireToken",qt="refreshTokenClientAcquireTokenWithCachedRefreshToken",Xt="refreshTokenClientAcquireTokenByRefreshToken",Zt="refreshTokenClientCreateTokenRequestBody",Qt="acquireTokenFromCache",Jt="silentFlowClientAcquireCachedToken",ei="silentFlowClientGenerateResultFromCacheRecord",ti="acquireTokenBySilentIframe",ii="initializeBaseRequest",ni="initializeSilentRequest",si="initializeClientApplication",ri="silentIframeClientTokenHelper",oi="silentHandlerInitiateAuthRequest",ai="silentHandlerMonitorIframeForHash",li="silentHandlerLoadFrame",ci="silentHandlerLoadFrameSync",hi="standardInteractionClientCreateAuthCodeClient",ui="standardInteractionClientGetClientConfiguration",di="standardInteractionClientInitializeAuthorizationRequest",pi="standardInteractionClientInitializeAuthorizationCodeRequest",gi="getAuthCodeUrl",fi="handleCodeResponseFromServer",mi="handleCodeResponse",yi="updateTokenEndpointAuthority",vi="authClientAcquireToken",bi="authClientExecuteTokenRequest",Ci="authClientCreateTokenRequestBody",wi="authClientCreateQueryString",Si="popTokenGenerateCnf",xi="popTokenGenerateKid",Ei="handleServerTokenResponse",Ai="deserializeResponse",Mi="authorityFactoryCreateDiscoveredInstance",Ti="authorityResolveEndpointsAsync",Di="authorityGetCloudDiscoveryMetadataFromNetwork",Ii="authorityUpdateCloudDiscoveryMetadata",Ri="authorityGetEndpointMetadataFromNetwork",ki="authorityUpdateEndpointMetadata",Pi="authorityUpdateMetadataWithRegionalInformation",_i="regionDiscoveryDetectRegion",Li="regionDiscoveryGetRegionFromIMDS",Ni="regionDiscoveryGetCurrentVersion",Oi="acquireTokenByCodeAsync",Fi="handleRedirectPromise",Gi="handleNativeRedirectPromise",Bi="nativeMessageHandlerHandshake",Vi="removeHiddenIframe",Hi="clearTokensAndKeysWithClaims",Ui="cacheManagerGetRefreshToken",zi="generatePkceCodes",Wi="generateCodeVerifier",ji="generateCodeChallengeFromVerifier",$i="sha256Digest",Ki="getRandomValues",Yi=(new Map([[Rt,"ATByCode"],[kt,"ATByRT"],[Pt,"ATS"],[_t,"ATSAsync"],[Lt,"ATPopup"],[Nt,"ATRedirect"],[Ot,"CryptoGetPKThumb"],[Ft,"CryptoSignJwt"],[Gt,"SltCacheClientAT"],[Bt,"SltIframeClientAT"],[Vt,"SltRClientAT"],[Ht,"SsoSlt"],[Ut,"StdIntClientGetDiscAuth"],[zt,"FetchAccIdWithNtvBroker"],[Wt,"NtvIntClientAT"],["baseClientCreateTokenRequestHeaders","BaseClientCreateTReqHead"],[jt,"RTClientExecPost"],[$t,"AuthCodeClientExecPost"],["brokerHandshake","BrokerHandshake"],["acquireTokenByRefreshTokenInBroker","ATByRTInBroker"],["acquireTokenByBroker","ATByBroker"],[Kt,"RTClientExecTReq"],[Yt,"RTClientAT"],[qt,"RTClientATWithCachedRT"],[Xt,"RTClientATByRT"],[Zt,"RTClientCreateTReqBody"],[Qt,"ATFromCache"],[Jt,"SltFlowClientATCached"],[ei,"SltFlowClientGenResFromCache"],[ti,"ATBySltIframe"],[ii,"InitBaseReq"],[ni,"InitSltReq"],[si,"InitClientApplication"],[ri,"SIClientTHelper"],[oi,"SHandlerInitAuthReq"],[ai,"SltHandlerMonitorIframeForHash"],[li,"SHandlerLoadFrame"],[ci,"SHandlerLoadFrameSync"],[hi,"StdIntClientCreateAuthCodeClient"],[ui,"StdIntClientGetClientConf"],[di,"StdIntClientInitAuthReq"],[pi,"StdIntClientInitAuthCodeReq"],[gi,"GetAuthCodeUrl"],[fi,"HandleCodeResFromServer"],[mi,"HandleCodeResp"],[yi,"UpdTEndpointAuth"],[vi,"AuthClientAT"],[bi,"AuthClientExecTReq"],[Ci,"AuthClientCreateTReqBody"],[wi,"AuthClientCreateQueryStr"],[Si,"PopTGenCnf"],[xi,"PopTGenKid"],[Ei,"HandleServerTRes"],[Ai,"DeserializeRes"],[Mi,"AuthFactCreateDiscInst"],[Ti,"AuthResolveEndpointsAsync"],["authorityResolveEndpointsFromLocalSources","AuthResolveEndpointsFromLocal"],[Di,"AuthGetCDMetaFromNet"],[Ii,"AuthUpdCDMeta"],[Ri,"AuthUpdCDMetaFromNet"],[ki,"AuthUpdEndpointMeta"],[Pi,"AuthUpdMetaWithRegInfo"],[_i,"RegDiscDetectReg"],[Li,"RegDiscGetRegFromIMDS"],[Ni,"RegDiscGetCurrentVer"],[Oi,"ATByCodeAsync"],["getEndpointMetadataFromNetwork","GetEndpointMetaFromNet"],["getCloudDiscoveryMetadataFromNetworkMeasurement","GetCDMetaFromNet"],[Fi,"HandleRedirectPromise"],[Gi,"HandleNtvRedirectPromise"],["updateCloudDiscoveryMetadataMeasurement","UpdateCDMeta"],["usernamePasswordClientAcquireToken","UserPassClientAT"],[Bi,"NtvMsgHandlerHandshake"],["nativeGenerateAuthResult","NtvGenAuthRes"],[Vi,"RemoveHiddenIframe"],[Hi,"ClearTAndKeysWithClaims"],[Ui,"CacheManagerGetRT"],[zi,"GenPkceCodes"],[Wi,"GenCodeVerifier"],[ji,"GenCodeChallengeFromVerifier"],[$i,"Sha256Digest"],[Ki,"GetRandomValues"]]),1);new Set(["accessTokenSize","durationMs","idTokenSize","matsSilentStatus","matsHttpStatus","refreshTokenSize","queuedTimeMs","startTimeMs","status","multiMatchedAT","multiMatchedID","multiMatchedRT"]);class qi{startMeasurement(){}endMeasurement(){}flushMeasurement(){return null}}class Xi{generateId(){return"callback-id"}startMeasurement(e,t){return{end:()=>null,discard:()=>{},add:()=>{},increment:()=>{},event:{eventId:this.generateId(),status:Yi,authority:"",libraryName:"",libraryVersion:"",clientId:"",name:e,startTimeMs:Date.now(),correlationId:t||""},measurement:new qi}}startPerformanceMeasurement(){return new qi}calculateQueuedTime(){return 0}addQueueMeasurement(){}setPreQueueTime(){}endMeasurement(){return null}discardMeasurements(){}removePerformanceCallback(){return!0}addPerformanceCallback(){return""}emitEvents(){}addFields(){}incrementFields(){}cacheEventByCorrelationId(){}}var Zi=i(58090);class Qi{navigateInternal(e,t){return Qi.defaultNavigateWindow(e,t)}navigateExternal(e,t){return Qi.defaultNavigateWindow(e,t)}static defaultNavigateWindow(e,t){return t.noHistory?window.location.replace(e):window.location.assign(e),new Promise(e=>{setTimeout(()=>{e(!0)},t.timeout)})}}var Ji=i(75970),en=i(2919);class tn{async sendGetRequestAsync(e,t){let i;try{i=await fetch(e,{method:Zi.CC.GET,headers:this.getFetchHeaders(t)})}catch(e){throw window.navigator.onLine?(0,Ji.bD)(en.Zw):(0,Ji.bD)(en.l7)}try{return{headers:this.getHeaderDict(i.headers),body:await i.json(),status:i.status}}catch(e){throw(0,Ji.bD)(en.db)}}async sendPostRequestAsync(e,t){const i=t&&t.body||s.YM.EMPTY_STRING;let n;try{n=await fetch(e,{method:Zi.CC.POST,headers:this.getFetchHeaders(t),body:i})}catch(e){throw window.navigator.onLine?(0,Ji.bD)(en.zv):(0,Ji.bD)(en.l7)}try{return{headers:this.getHeaderDict(n.headers),body:await n.json(),status:n.status}}catch(e){throw(0,Ji.bD)(en.db)}}getFetchHeaders(e){const t=new Headers;if(!e||!e.headers)return t;const i=e.headers;return Object.keys(i).forEach(e=>{t.append(e,i[e])}),t}getHeaderDict(e){const t={};return e.forEach((e,i)=>{t[i]=e}),t}}const nn="3.26.1";class sn{static loggerCallback(e,t){switch(e){case n.$.Error:return void console.error(t);case n.$.Info:return void console.info(t);case n.$.Verbose:return void console.debug(t);case n.$.Warning:return void console.warn(t);default:return void console.log(t)}}constructor(e){let t;this.browserEnvironment="undefined"!=typeof window,this.config=function({auth:e,cache:t,system:i,telemetry:l},c){const h={clientId:s.YM.EMPTY_STRING,authority:`${s.YM.DEFAULT_AUTHORITY}`,knownAuthorities:[],cloudDiscoveryMetadata:s.YM.EMPTY_STRING,authorityMetadata:s.YM.EMPTY_STRING,redirectUri:s.YM.EMPTY_STRING,postLogoutRedirectUri:s.YM.EMPTY_STRING,navigateToLoginRequestUrl:!0,clientCapabilities:[],protocolMode:r,OIDCOptions:{serverResponseType:s.zL.FRAGMENT,defaultScopes:[s.YM.OPENID_SCOPE,s.YM.PROFILE_SCOPE,s.YM.OFFLINE_ACCESS_SCOPE]},azureCloudOptions:{azureCloudInstance:a,tenant:s.YM.EMPTY_STRING},skipAuthorityMetadataCache:!1,supportsNestedAppAuth:!1,instanceAware:!1},u={cacheLocation:Zi.Al.SessionStorage,temporaryCacheLocation:Zi.Al.SessionStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!(!t||t.cacheLocation!==Zi.Al.LocalStorage),claimsBasedCachingEnabled:!1},d={loggerCallback:()=>{},logLevel:n.$.Info,piiLoggingEnabled:!1},p={...{...Ct,loggerOptions:d,networkClient:c?new tn:It,navigationClient:new Qi,loadFrameTimeout:0,windowHashTimeout:i?.loadFrameTimeout||6e4,iframeHashTimeout:i?.loadFrameTimeout||1e4,navigateFrameWait:0,redirectNavigationTimeout:3e4,asyncPopups:!1,allowRedirectInIframe:!1,allowNativeBroker:!1,nativeBrokerHandshakeTimeout:i?.nativeBrokerHandshakeTimeout||2e3,pollIntervalMilliseconds:Zi.Q1.DEFAULT_POLL_INTERVAL_MS},...i,loggerOptions:i?.loggerOptions||d},g={application:{appName:s.YM.EMPTY_STRING,appVersion:s.YM.EMPTY_STRING},client:new Xi};if(e?.protocolMode!==o&&e?.OIDCOptions&&new n.V(p.loggerOptions).warning(JSON.stringify(Xe(je))),e?.protocolMode&&e.protocolMode!==r&&p?.allowNativeBroker)throw Xe($e);return{auth:{...h,...e,OIDCOptions:{...h.OIDCOptions,...e?.OIDCOptions}},cache:{...u,...t},system:p,telemetry:{...g,...l}}}(e,this.browserEnvironment);try{t=window[Zi.Al.SessionStorage]}catch(e){}const i=t?.getItem(Zi.L$),l=t?.getItem(Zi.P3)?.toLowerCase(),c="true"===l||"false"!==l&&void 0,h={...this.config.system.loggerOptions},u=i&&Object.keys(n.$).includes(i)?n.$[i]:void 0;u&&(h.loggerCallback=sn.loggerCallback,h.logLevel=u),void 0!==c&&(h.piiLoggingEnabled=c),this.logger=new n.V(h,"@azure/msal-browser",nn),this.available=!1}getConfig(){return this.config}getLogger(){return this.logger}isAvailable(){return this.available}isBrowserEnvironment(){return this.browserEnvironment}}class rn extends sn{getModuleName(){return rn.MODULE_NAME}getId(){return rn.ID}async initialize(){return this.available="undefined"!=typeof window,this.available}}rn.MODULE_NAME="",rn.ID="StandardOperatingContext";const on="missing_kid_error",an="missing_alg_error",ln={[on]:"The JOSE Header for the requested JWT, JWS or JWK object requires a keyId to be configured as the 'kid' header claim. No 'kid' value was provided.",[an]:"The JOSE Header for the requested JWT, JWS or JWK object requires an algorithm to be specified as the 'alg' header claim. No 'alg' value was provided."};class cn extends l.lR{constructor(e,t){super(e,t),this.name="JoseHeaderError",Object.setPrototypeOf(this,cn.prototype)}}function hn(e){return new cn(e,ln[e])}class un{constructor(e){this.typ=e.typ,this.alg=e.alg,this.kid=e.kid}static getShrHeaderString(e){if(!e.kid)throw hn(on);if(!e.alg)throw hn(an);const t=new un({typ:e.typ||s.Lz.Pop,kid:e.kid,alg:e.alg});return JSON.stringify(t)}}function dn(e){return encodeURIComponent(gn(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"))}function pn(e){return fn(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function gn(e){return fn((new TextEncoder).encode(e))}function fn(e){const t=Array.from(e,e=>String.fromCodePoint(e)).join("");return btoa(t)}function mn(e){return(new TextDecoder).decode(function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw(0,Ji.bD)(en._t)}const i=atob(t);return Uint8Array.from(i,e=>e.codePointAt(0)||0)}(e))}const yn="SHA-256",vn=new Uint8Array([1,0,1]),bn="0123456789abcdef",Cn=new Uint32Array(1),wn={name:"RSASSA-PKCS1-v1_5",hash:yn,modulusLength:2048,publicExponent:vn};async function Sn(e,t,i){t?.addQueueMeasurement($i,i);const n=(new TextEncoder).encode(e);return window.crypto.subtle.digest(yn,n)}function xn(e){return window.crypto.getRandomValues(e)}function En(){return window.crypto.getRandomValues(Cn),Cn[0]}function An(){const e=Date.now(),t=1024*En()+(1023&En()),i=new Uint8Array(16),n=Math.trunc(t/2**30),s=t&2**30-1,r=En();i[0]=e/2**40,i[1]=e/2**32,i[2]=e/2**24,i[3]=e/65536,i[4]=e/256,i[5]=e,i[6]=112|n>>>8,i[7]=n,i[8]=128|s>>>24,i[9]=s>>>16,i[10]=s>>>8,i[11]=s,i[12]=r>>>24,i[13]=r>>>16,i[14]=r>>>8,i[15]=r;let o="";for(let e=0;e<i.length;e++)o+=bn.charAt(i[e]>>>4),o+=bn.charAt(15&i[e]),3!==e&&5!==e&&7!==e&&9!==e||(o+="-");return o}async function Mn(e){return window.crypto.subtle.exportKey(Zi.jb,e)}async function Tn(e){const t=await Sn(e);return pn(new Uint8Array(t))}class Dn{constructor(){this.dbName=Zi.$u,this.version=Zi.G8,this.tableName=Zi.WJ,this.dbOpen=!1}async open(){return new Promise((e,t)=>{const i=window.indexedDB.open(this.dbName,this.version);i.addEventListener("upgradeneeded",e=>{e.target.result.createObjectStore(this.tableName)}),i.addEventListener("success",t=>{const i=t;this.db=i.target.result,this.dbOpen=!0,e()}),i.addEventListener("error",()=>t((0,Ji.bD)(en.MG)))})}closeConnection(){const e=this.db;e&&this.dbOpen&&(e.close(),this.dbOpen=!1)}async validateDbIsOpen(){if(!this.dbOpen)return this.open()}async getItem(e){return await this.validateDbIsOpen(),new Promise((t,i)=>{if(!this.db)return i((0,Ji.bD)(en.rn));const n=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).get(e);n.addEventListener("success",e=>{const i=e;this.closeConnection(),t(i.target.result)}),n.addEventListener("error",e=>{this.closeConnection(),i(e)})})}async setItem(e,t){return await this.validateDbIsOpen(),new Promise((i,n)=>{if(!this.db)return n((0,Ji.bD)(en.rn));const s=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).put(t,e);s.addEventListener("success",()=>{this.closeConnection(),i()}),s.addEventListener("error",e=>{this.closeConnection(),n(e)})})}async removeItem(e){return await this.validateDbIsOpen(),new Promise((t,i)=>{if(!this.db)return i((0,Ji.bD)(en.rn));const n=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).delete(e);n.addEventListener("success",()=>{this.closeConnection(),t()}),n.addEventListener("error",e=>{this.closeConnection(),i(e)})})}async getKeys(){return await this.validateDbIsOpen(),new Promise((e,t)=>{if(!this.db)return t((0,Ji.bD)(en.rn));const i=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).getAllKeys();i.addEventListener("success",t=>{const i=t;this.closeConnection(),e(i.target.result)}),i.addEventListener("error",e=>{this.closeConnection(),t(e)})})}async containsKey(e){return await this.validateDbIsOpen(),new Promise((t,i)=>{if(!this.db)return i((0,Ji.bD)(en.rn));const n=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).count(e);n.addEventListener("success",e=>{const i=e;this.closeConnection(),t(1===i.target.result)}),n.addEventListener("error",e=>{this.closeConnection(),i(e)})})}async deleteDatabase(){return this.db&&this.dbOpen&&this.closeConnection(),new Promise((e,t)=>{const i=window.indexedDB.deleteDatabase(Zi.$u),n=setTimeout(()=>t(!1),200);i.addEventListener("success",()=>(clearTimeout(n),e(!0))),i.addEventListener("blocked",()=>(clearTimeout(n),e(!0))),i.addEventListener("error",()=>(clearTimeout(n),t(!1)))})}}class In{constructor(){this.cache=new Map}getItem(e){return this.cache.get(e)||null}setItem(e,t){this.cache.set(e,t)}removeItem(e){this.cache.delete(e)}getKeys(){const e=[];return this.cache.forEach((t,i)=>{e.push(i)}),e}containsKey(e){return this.cache.has(e)}clear(){this.cache.clear()}}class Rn{constructor(e){this.inMemoryCache=new In,this.indexedDBCache=new Dn,this.logger=e}handleDatabaseAccessError(e){if(!(e instanceof Ji.jT&&e.errorCode===en.MG))throw e;this.logger.error("Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.")}async getItem(e){const t=this.inMemoryCache.getItem(e);if(!t)try{return this.logger.verbose("Queried item not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.getItem(e)}catch(e){this.handleDatabaseAccessError(e)}return t}async setItem(e,t){this.inMemoryCache.setItem(e,t);try{await this.indexedDBCache.setItem(e,t)}catch(e){this.handleDatabaseAccessError(e)}}async removeItem(e){this.inMemoryCache.removeItem(e);try{await this.indexedDBCache.removeItem(e)}catch(e){this.handleDatabaseAccessError(e)}}async getKeys(){const e=this.inMemoryCache.getKeys();if(0===e.length)try{return this.logger.verbose("In-memory cache is empty, now querying persistent storage."),await this.indexedDBCache.getKeys()}catch(e){this.handleDatabaseAccessError(e)}return e}async containsKey(e){const t=this.inMemoryCache.containsKey(e);if(!t)try{return this.logger.verbose("Key not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.containsKey(e)}catch(e){this.handleDatabaseAccessError(e)}return t}clearInMemory(){this.logger.verbose("Deleting in-memory keystore"),this.inMemoryCache.clear(),this.logger.verbose("In-memory keystore deleted")}async clearPersistent(){try{this.logger.verbose("Deleting persistent keystore");const e=await this.indexedDBCache.deleteDatabase();return e&&this.logger.verbose("Persistent keystore deleted"),e}catch(e){return this.handleDatabaseAccessError(e),!1}}}class kn{constructor(e,t){this.logger=e,function(e){if(!("crypto"in window))throw e.error("BrowserCrypto: crypto interface is unavailable"),(0,Ji.bD)(en.rc);e.verbose("BrowserCrypto: modern crypto interface available")}(e),this.cache=new Rn(this.logger),this.performanceClient=t}createNewGuid(){return An()}base64Encode(e){return gn(e)}base64Decode(e){return mn(e)}base64UrlEncode(e){return dn(e)}encodeKid(e){return this.base64UrlEncode(JSON.stringify({kid:e}))}async getPublicKeyThumbprint(e){const t=this.performanceClient?.startMeasurement(Ot,e.correlationId),i=await async function(e,t){return window.crypto.subtle.generateKey(wn,e,t)}(kn.EXTRACTABLE,kn.POP_KEY_USAGES),n=await Mn(i.publicKey),s=Pn({e:n.e,kty:n.kty,n:n.n}),r=await this.hashString(s),o=await Mn(i.privateKey),a=await async function(e){return window.crypto.subtle.importKey(Zi.jb,e,wn,!1,["sign"])}(o);return await this.cache.setItem(r,{privateKey:a,publicKey:i.publicKey,requestMethod:e.resourceRequestMethod,requestUri:e.resourceRequestUri}),t&&t.end({success:!0}),r}async removeTokenBindingKey(e){return await this.cache.removeItem(e),!await this.cache.containsKey(e)}async clearKeystore(){this.cache.clearInMemory();try{return await this.cache.clearPersistent(),!0}catch(e){return e instanceof Error?this.logger.error(`Clearing keystore failed with error: ${e.message}`):this.logger.error("Clearing keystore failed with unknown error"),!1}}async signJwt(e,t,i,n){const s=this.performanceClient?.startMeasurement(Ft,n),r=await this.cache.getItem(t);if(!r)throw(0,Ji.bD)(en.e0);const o=await Mn(r.publicKey),a=Pn(o),l=dn(JSON.stringify({kid:t})),c=dn(un.getShrHeaderString({...i?.header,alg:o.alg,kid:l}));e.cnf={jwk:JSON.parse(a)};const h=`${c}.${dn(JSON.stringify(e))}`,u=(new TextEncoder).encode(h),d=await async function(e,t){return window.crypto.subtle.sign(wn,e,t)}(r.privateKey,u),p=`${h}.${pn(new Uint8Array(d))}`;return s&&s.end({success:!0}),p}async hashString(e){return Tn(e)}}function Pn(e){return JSON.stringify(e,Object.keys(e).sort())}kn.POP_KEY_USAGES=["sign","verify"],kn.EXTRACTABLE=!0;const _n=(e,t,i,n,s)=>(...r)=>{i.trace(`Executing function ${t}`);const o=n?.startMeasurement(t,s);if(s){const e=t+"CallCount";n?.incrementFields({[e]:1},s)}try{const n=e(...r);return o?.end({success:!0}),i.trace(`Returning result from ${t}`),n}catch(e){i.trace(`Error occurred in ${t}`);try{i.trace(JSON.stringify(e))}catch(e){i.trace("Unable to print error message.")}throw o?.end({success:!1},e),e}},Ln=(e,t,i,n,s)=>(...r)=>{i.trace(`Executing function ${t}`);const o=n?.startMeasurement(t,s);if(s){const e=t+"CallCount";n?.incrementFields({[e]:1},s)}return n?.setPreQueueTime(t,s),e(...r).then(e=>(i.trace(`Returning result from ${t}`),o?.end({success:!0}),e)).catch(e=>{i.trace(`Error occurred in ${t}`);try{i.trace(JSON.stringify(e))}catch(e){i.trace("Unable to print error message.")}throw o?.end({success:!1},e),e})};class Nn{constructor(e,t,i,n){this.networkInterface=e,this.logger=t,this.performanceClient=i,this.correlationId=n}async detectRegion(e,t){this.performanceClient?.addQueueMeasurement(_i,this.correlationId);let i=e;if(i)t.region_source=s.jZ.ENVIRONMENT_VARIABLE;else{const e=Nn.IMDS_OPTIONS;try{const n=await Ln(this.getRegionFromIMDS.bind(this),Li,this.logger,this.performanceClient,this.correlationId)(s.YM.IMDS_VERSION,e);if(n.status===s.Kk.httpSuccess&&(i=n.body,t.region_source=s.jZ.IMDS),n.status===s.Kk.httpBadRequest){const n=await Ln(this.getCurrentVersion.bind(this),Ni,this.logger,this.performanceClient,this.correlationId)(e);if(!n)return t.region_source=s.jZ.FAILED_AUTO_DETECTION,null;const r=await Ln(this.getRegionFromIMDS.bind(this),Li,this.logger,this.performanceClient,this.correlationId)(n,e);r.status===s.Kk.httpSuccess&&(i=r.body,t.region_source=s.jZ.IMDS)}}catch(e){return t.region_source=s.jZ.FAILED_AUTO_DETECTION,null}}return i||(t.region_source=s.jZ.FAILED_AUTO_DETECTION),i||null}async getRegionFromIMDS(e,t){return this.performanceClient?.addQueueMeasurement(Li,this.correlationId),this.networkInterface.sendGetRequestAsync(`${s.YM.IMDS_ENDPOINT}?api-version=${e}&format=text`,t,s.YM.IMDS_TIMEOUT)}async getCurrentVersion(e){this.performanceClient?.addQueueMeasurement(Ni,this.correlationId);try{const t=await this.networkInterface.sendGetRequestAsync(`${s.YM.IMDS_ENDPOINT}?format=json`,e);return t.status===s.Kk.httpBadRequest&&t.body&&t.body["newest-versions"]&&t.body["newest-versions"].length>0?t.body["newest-versions"][0]:null}catch(e){return null}}}Nn.IMDS_OPTIONS={headers:{Metadata:"true"}};class On{constructor(e,t,i,n,s,r,o,a){this.canonicalAuthority=e,this._canonicalAuthority.validateAsUri(),this.networkInterface=t,this.cacheManager=i,this.authorityOptions=n,this.regionDiscoveryMetadata={region_used:void 0,region_source:void 0,region_outcome:void 0},this.logger=s,this.performanceClient=o,this.correlationId=r,this.managedIdentity=a||!1,this.regionDiscovery=new Nn(t,this.logger,this.performanceClient,this.correlationId)}getAuthorityType(e){if(e.HostNameAndPort.endsWith(s.YM.CIAM_AUTH_URL))return 3;const t=e.PathSegments;if(t.length)switch(t[0].toLowerCase()){case s.YM.ADFS:return 1;case s.YM.DSTS:return 2}return 0}get authorityType(){return this.getAuthorityType(this.canonicalAuthorityUrlComponents)}get protocolMode(){return this.authorityOptions.protocolMode}get options(){return this.authorityOptions}get canonicalAuthority(){return this._canonicalAuthority.urlString}set canonicalAuthority(e){this._canonicalAuthority=new lt(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null}get canonicalAuthorityUrlComponents(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents}get hostnameAndPort(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()}get tenant(){return this.canonicalAuthorityUrlComponents.PathSegments[0]}get authorizationEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.authorization_endpoint);throw te(p)}get tokenEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint);throw te(p)}get deviceCodeEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));throw te(p)}get endSessionEndpoint(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw te($);return this.replacePath(this.metadata.end_session_endpoint)}throw te(p)}get selfSignedJwtAudience(){if(this.discoveryComplete())return this.replacePath(this.metadata.issuer);throw te(p)}get jwksUri(){if(this.discoveryComplete())return this.replacePath(this.metadata.jwks_uri);throw te(p)}canReplaceTenant(e){return 1===e.PathSegments.length&&!On.reservedTenantDomains.has(e.PathSegments[0])&&0===this.getAuthorityType(e)&&this.protocolMode===r}replaceTenant(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)}replacePath(e){let t=e;const i=new lt(this.metadata.canonical_authority).getUrlComponents(),n=i.PathSegments;return this.canonicalAuthorityUrlComponents.PathSegments.forEach((e,s)=>{let r=n[s];if(0===s&&this.canReplaceTenant(i)){const e=new lt(this.metadata.authorization_endpoint).getUrlComponents().PathSegments[0];r!==e&&(this.logger.verbose(`Replacing tenant domain name ${r} with id ${e}`),r=e)}e!==r&&(t=t.replace(`/${r}/`,`/${e}/`))}),this.replaceTenant(t)}get defaultOpenIdConfigurationEndpoint(){const e=this.hostnameAndPort;return this.canonicalAuthority.endsWith("v2.0/")||1===this.authorityType||this.protocolMode!==r&&!this.isAliasOfKnownMicrosoftAuthority(e)?`${this.canonicalAuthority}.well-known/openid-configuration`:`${this.canonicalAuthority}v2.0/.well-known/openid-configuration`}discoveryComplete(){return!!this.metadata}async resolveEndpointsAsync(){this.performanceClient?.addQueueMeasurement(Ti,this.correlationId);const e=this.getCurrentMetadataEntity(),t=await Ln(this.updateCloudDiscoveryMetadata.bind(this),Ii,this.logger,this.performanceClient,this.correlationId)(e);this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network);const i=await Ln(this.updateEndpointMetadata.bind(this),ki,this.logger,this.performanceClient,this.correlationId)(e);this.updateCachedMetadata(e,t,{source:i}),this.performanceClient?.addFields({cloudDiscoverySource:t,authorityEndpointSource:i},this.correlationId)}getCurrentMetadataEntity(){let e=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort);return e||(e={aliases:[],preferred_cache:this.hostnameAndPort,preferred_network:this.hostnameAndPort,canonical_authority:this.canonicalAuthority,authorization_endpoint:"",token_endpoint:"",end_session_endpoint:"",issuer:"",aliasesFromNetwork:!1,endpointsFromNetwork:!1,expiresAt:Se(),jwks_uri:""}),e}updateCachedMetadata(e,t,i){t!==s.E_.CACHE&&i?.source!==s.E_.CACHE&&(e.expiresAt=Se(),e.canonical_authority=this.canonicalAuthority);const n=this.cacheManager.generateAuthorityMetadataCacheKey(e.preferred_cache);this.cacheManager.setAuthorityMetadata(n,e),this.metadata=e}async updateEndpointMetadata(e){this.performanceClient?.addQueueMeasurement(ki,this.correlationId);const t=this.updateEndpointMetadataFromLocalSources(e);if(t)return t.source===s.E_.HARDCODED_VALUES&&this.authorityOptions.azureRegionConfiguration?.azureRegion&&t.metadata&&(xe(e,await Ln(this.updateMetadataWithRegionalInformation.bind(this),Pi,this.logger,this.performanceClient,this.correlationId)(t.metadata),!1),e.canonical_authority=this.canonicalAuthority),t.source;let i=await Ln(this.getEndpointMetadataFromNetwork.bind(this),Ri,this.logger,this.performanceClient,this.correlationId)();if(i)return this.authorityOptions.azureRegionConfiguration?.azureRegion&&(i=await Ln(this.updateMetadataWithRegionalInformation.bind(this),Pi,this.logger,this.performanceClient,this.correlationId)(i)),xe(e,i,!0),s.E_.NETWORK;throw te(f,this.defaultOpenIdConfigurationEndpoint)}updateEndpointMetadataFromLocalSources(e){this.logger.verbose("Attempting to get endpoint metadata from authority configuration");const t=this.getEndpointMetadataFromConfig();if(t)return this.logger.verbose("Found endpoint metadata in authority configuration"),xe(e,t,!1),{source:s.E_.CONFIG};if(this.logger.verbose("Did not find endpoint metadata in the config... Attempting to get endpoint metadata from the hardcoded values."),this.authorityOptions.skipAuthorityMetadataCache)this.logger.verbose("Skipping hardcoded metadata cache since skipAuthorityMetadataCache is set to true. Attempting to get endpoint metadata from the network metadata cache.");else{const t=this.getEndpointMetadataFromHardcodedValues();if(t)return xe(e,t,!1),{source:s.E_.HARDCODED_VALUES,metadata:t};this.logger.verbose("Did not find endpoint metadata in hardcoded values... Attempting to get endpoint metadata from the network metadata cache.")}const i=Ae(e);return this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!i?(this.logger.verbose("Found endpoint metadata in the cache."),{source:s.E_.CACHE}):(i&&this.logger.verbose("The metadata entity is expired."),null)}isAuthoritySameType(e){return new lt(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length}getEndpointMetadataFromConfig(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch(e){throw Xe(Be)}return null}async getEndpointMetadataFromNetwork(){this.performanceClient?.addQueueMeasurement(Ri,this.correlationId);const e={},t=this.defaultOpenIdConfigurationEndpoint;this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: attempting to retrieve OAuth endpoints from ${t}`);try{const i=await this.networkInterface.sendGetRequestAsync(t,e),n=function(e){return e.hasOwnProperty("authorization_endpoint")&&e.hasOwnProperty("token_endpoint")&&e.hasOwnProperty("issuer")&&e.hasOwnProperty("jwks_uri")}(i.body);return n?i.body:(this.logger.verbose("Authority.getEndpointMetadataFromNetwork: could not parse response as OpenID configuration"),null)}catch(e){return this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: ${e}`),null}}getEndpointMetadataFromHardcodedValues(){return this.hostnameAndPort in ct?ct[this.hostnameAndPort]:null}async updateMetadataWithRegionalInformation(e){this.performanceClient?.addQueueMeasurement(Pi,this.correlationId);const t=this.authorityOptions.azureRegionConfiguration?.azureRegion;if(t){if(t!==s.YM.AZURE_REGION_AUTO_DISCOVER_FLAG)return this.regionDiscoveryMetadata.region_outcome=s._2.CONFIGURED_NO_AUTO_DETECTION,this.regionDiscoveryMetadata.region_used=t,On.replaceWithRegionalInformation(e,t);const i=await Ln(this.regionDiscovery.detectRegion.bind(this.regionDiscovery),_i,this.logger,this.performanceClient,this.correlationId)(this.authorityOptions.azureRegionConfiguration?.environmentRegion,this.regionDiscoveryMetadata);if(i)return this.regionDiscoveryMetadata.region_outcome=s._2.AUTO_DETECTION_REQUESTED_SUCCESSFUL,this.regionDiscoveryMetadata.region_used=i,On.replaceWithRegionalInformation(e,i);this.regionDiscoveryMetadata.region_outcome=s._2.AUTO_DETECTION_REQUESTED_FAILED}return e}async updateCloudDiscoveryMetadata(e){this.performanceClient?.addQueueMeasurement(Ii,this.correlationId);const t=this.updateCloudDiscoveryMetadataFromLocalSources(e);if(t)return t;const i=await Ln(this.getCloudDiscoveryMetadataFromNetwork.bind(this),Di,this.logger,this.performanceClient,this.correlationId)();if(i)return Ee(e,i,!0),s.E_.NETWORK;throw Xe(Ve)}updateCloudDiscoveryMetadataFromLocalSources(e){this.logger.verbose("Attempting to get cloud discovery metadata  from authority configuration"),this.logger.verbosePii(`Known Authorities: ${this.authorityOptions.knownAuthorities||s.YM.NOT_APPLICABLE}`),this.logger.verbosePii(`Authority Metadata: ${this.authorityOptions.authorityMetadata||s.YM.NOT_APPLICABLE}`),this.logger.verbosePii(`Canonical Authority: ${e.canonical_authority||s.YM.NOT_APPLICABLE}`);const t=this.getCloudDiscoveryMetadataFromConfig();if(t)return this.logger.verbose("Found cloud discovery metadata in authority configuration"),Ee(e,t,!1),s.E_.CONFIG;if(this.logger.verbose("Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the hardcoded values."),this.options.skipAuthorityMetadataCache)this.logger.verbose("Skipping hardcoded cloud discovery metadata cache since skipAuthorityMetadataCache is set to true. Attempting to get cloud discovery metadata from the network metadata cache.");else{const t=(i=this.hostnameAndPort,pt(ht.metadata,i));if(t)return this.logger.verbose("Found cloud discovery metadata from hardcoded values."),Ee(e,t,!1),s.E_.HARDCODED_VALUES;this.logger.verbose("Did not find cloud discovery metadata in hardcoded values... Attempting to get cloud discovery metadata from the network metadata cache.")}var i;const n=Ae(e);return this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!n?(this.logger.verbose("Found cloud discovery metadata in the cache."),s.E_.CACHE):(n&&this.logger.verbose("The metadata entity is expired."),null)}getCloudDiscoveryMetadataFromConfig(){if(3===this.authorityType)return this.logger.verbose("CIAM authorities do not support cloud discovery metadata, generate the aliases from authority host."),On.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);if(this.authorityOptions.cloudDiscoveryMetadata){this.logger.verbose("The cloud discovery metadata has been provided as a network response, in the config.");try{this.logger.verbose("Attempting to parse the cloud discovery metadata.");const e=pt(JSON.parse(this.authorityOptions.cloudDiscoveryMetadata).metadata,this.hostnameAndPort);if(this.logger.verbose("Parsed the cloud discovery metadata."),e)return this.logger.verbose("There is returnable metadata attached to the parsed cloud discovery metadata."),e;this.logger.verbose("There is no metadata attached to the parsed cloud discovery metadata.")}catch(e){throw this.logger.verbose("Unable to parse the cloud discovery metadata. Throwing Invalid Cloud Discovery Metadata Error."),Xe(Ge)}}return this.isInKnownAuthorities()?(this.logger.verbose("The host is included in knownAuthorities. Creating new cloud discovery metadata from the host."),On.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)):null}async getCloudDiscoveryMetadataFromNetwork(){this.performanceClient?.addQueueMeasurement(Di,this.correlationId);const e=`${s.YM.AAD_INSTANCE_DISCOVERY_ENDPT}${this.canonicalAuthority}oauth2/v2.0/authorize`,t={};let i=null;try{const n=await this.networkInterface.sendGetRequestAsync(e,t);let r,o;if(function(e){return e.hasOwnProperty("tenant_discovery_endpoint")&&e.hasOwnProperty("metadata")}(n.body))r=n.body,o=r.metadata,this.logger.verbosePii(`tenant_discovery_endpoint is: ${r.tenant_discovery_endpoint}`);else{if(!function(e){return e.hasOwnProperty("error")&&e.hasOwnProperty("error_description")}(n.body))return this.logger.error("AAD did not return a CloudInstanceDiscoveryResponse or CloudInstanceDiscoveryErrorResponse"),null;if(this.logger.warning(`A CloudInstanceDiscoveryErrorResponse was returned. The cloud instance discovery network request's status code is: ${n.status}`),r=n.body,r.error===s.YM.INVALID_INSTANCE)return this.logger.error("The CloudInstanceDiscoveryErrorResponse error is invalid_instance."),null;this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error is ${r.error}`),this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error description is ${r.error_description}`),this.logger.warning("Setting the value of the CloudInstanceDiscoveryMetadata (returned from the network) to []"),o=[]}this.logger.verbose("Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request."),i=pt(o,this.hostnameAndPort)}catch(e){if(e instanceof l.lR)this.logger.error(`There was a network error while attempting to get the cloud discovery instance metadata.\nError: ${e.errorCode}\nError Description: ${e.errorMessage}`);else{const t=e;this.logger.error(`A non-MSALJS error was thrown while attempting to get the cloud instance discovery metadata.\nError: ${t.name}\nError Description: ${t.message}`)}return null}return i||(this.logger.warning("The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request."),this.logger.verbose("Creating custom Authority for custom domain scenario."),i=On.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),i}isInKnownAuthorities(){return this.authorityOptions.knownAuthorities.filter(e=>e&&lt.getDomainFromUrl(e).toLowerCase()===this.hostnameAndPort).length>0}static generateAuthority(e,t){let i;if(t&&t.azureCloudInstance!==a){const e=t.tenant?t.tenant:s.YM.DEFAULT_COMMON_TENANT;i=`${t.azureCloudInstance}/${e}/`}return i||e}static createCloudDiscoveryMetadataFromHost(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}}getPreferredCache(){if(this.managedIdentity)return s.YM.DEFAULT_AUTHORITY_HOST;if(this.discoveryComplete())return this.metadata.preferred_cache;throw te(p)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return ut.has(e)}static isPublicCloudAuthority(e){return s.YM.KNOWN_PUBLIC_CLOUDS.indexOf(e)>=0}static buildRegionalAuthorityString(e,t,i){const n=new lt(e);n.validateAsUri();const r=n.getUrlComponents();let o=`${t}.${r.HostNameAndPort}`;this.isPublicCloudAuthority(r.HostNameAndPort)&&(o=`${t}.${s.YM.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX}`);const a=lt.constructAuthorityUriFromObject({...n.getUrlComponents(),HostNameAndPort:o}).urlString;return i?`${a}?${i}`:a}static replaceWithRegionalInformation(e,t){const i={...e};return i.authorization_endpoint=On.buildRegionalAuthorityString(i.authorization_endpoint,t),i.token_endpoint=On.buildRegionalAuthorityString(i.token_endpoint,t),i.end_session_endpoint&&(i.end_session_endpoint=On.buildRegionalAuthorityString(i.end_session_endpoint,t)),i}static transformCIAMAuthority(e){let t=e;const i=new lt(e).getUrlComponents();return 0===i.PathSegments.length&&i.HostNameAndPort.endsWith(s.YM.CIAM_AUTH_URL)&&(t=`${t}${i.HostNameAndPort.split(".")[0]}${s.YM.AAD_TENANT_DOMAIN_SUFFIX}`),t}}function Fn(e){return e.endsWith(s.YM.FORWARD_SLASH)?e:`${e}${s.YM.FORWARD_SLASH}`}On.reservedTenantDomains=new Set(["{tenant}","{tenantid}",s.v2.COMMON,s.v2.CONSUMERS,s.v2.ORGANIZATIONS]);const Gn="no_tokens_found",Bn="native_account_unavailable",Vn="refresh_token_expired",Hn="bad_token",Un=["interaction_required","consent_required","login_required",Hn],zn=["message_only","additional_action","basic_action","user_password_expired","consent_required","bad_token"],Wn={[Gn]:"No refresh token found in the cache. Please sign-in.",[Bn]:"The requested account is not available in the native broker. It may have been deleted or logged out. Please sign-in again using an interactive API.",[Vn]:"Refresh token has expired.",[Hn]:"Identity provider returned bad_token due to an expired or invalid refresh token. Please invoke an interactive API to resolve."};class jn extends l.lR{constructor(e,t,i,n,r,o,a,l){super(e,t,i),Object.setPrototypeOf(this,jn.prototype),this.timestamp=n||s.YM.EMPTY_STRING,this.traceId=r||s.YM.EMPTY_STRING,this.correlationId=o||s.YM.EMPTY_STRING,this.claims=a||s.YM.EMPTY_STRING,this.name="InteractionRequiredAuthError",this.errorNo=l}}function $n(e,t,i){const n=!!e&&Un.indexOf(e)>-1,s=!!i&&zn.indexOf(i)>-1,r=!!t&&Un.some(e=>t.indexOf(e)>-1);return n||r||s}function Kn(e){return new jn(e,Wn[e])}class Yn{static setRequestState(e,t,i){const n=Yn.generateLibraryState(e,i);return t?`${n}${s.YM.RESOURCE_DELIM}${t}`:n}static generateLibraryState(e,t){if(!e)throw te(F);const i={id:e.createNewGuid()};t&&(i.meta=t);const n=JSON.stringify(i);return e.base64Encode(n)}static parseRequestState(e,t){if(!e)throw te(F);if(!t)throw te(y);try{const i=t.split(s.YM.RESOURCE_DELIM),n=i[0],r=i.length>1?i.slice(1).join(s.YM.RESOURCE_DELIM):s.YM.EMPTY_STRING,o=e.base64Decode(n),a=JSON.parse(o);return{userRequestState:r||s.YM.EMPTY_STRING,libraryState:a}}catch(e){throw te(y)}}}const qn="home_account_id",Xn="UPN";var Zn=i(24680),Qn=i(85362);class Jn{constructor(e){this.validateWindowStorage(e),this.windowStorage=window[e]}validateWindowStorage(e){if(e!==Zi.Al.LocalStorage&&e!==Zi.Al.SessionStorage||!window[e])throw(0,Zn.jz)(Qn.xz)}getItem(e){return this.windowStorage.getItem(e)}setItem(e,t){this.windowStorage.setItem(e,t)}removeItem(e){this.windowStorage.removeItem(e)}getKeys(){return Object.keys(this.windowStorage)}containsKey(e){return this.windowStorage.hasOwnProperty(e)}}function es(e,t){if(!t)return null;try{return Yn.parseRequestState(e,t).libraryState.meta}catch(e){throw te(y)}}class ts extends vt{constructor(e,t,i,n,s,r){super(e,i,n,s),this.COOKIE_LIFE_MULTIPLIER=864e5,this.cacheConfig=t,this.logger=n,this.internalStorage=new In,this.browserStorage=this.setupBrowserStorage(this.cacheConfig.cacheLocation),this.temporaryCacheStorage=this.setupTemporaryCacheStorage(this.cacheConfig.temporaryCacheLocation,this.cacheConfig.cacheLocation),t.cacheMigrationEnabled&&(this.migrateCacheEntries(),this.createKeyMaps()),this.performanceClient=r}setupBrowserStorage(e){switch(e){case Zi.Al.LocalStorage:case Zi.Al.SessionStorage:try{return new Jn(e)}catch(e){this.logger.verbose(e);break}}return this.cacheConfig.cacheLocation=Zi.Al.MemoryStorage,new In}setupTemporaryCacheStorage(e,t){switch(t){case Zi.Al.LocalStorage:case Zi.Al.SessionStorage:try{return new Jn(e||Zi.Al.SessionStorage)}catch(e){return this.logger.verbose(e),this.internalStorage}case Zi.Al.MemoryStorage:default:return this.internalStorage}}migrateCacheEntries(){const e=`${s.YM.CACHE_PREFIX}.${s.Gd.ID_TOKEN}`,t=`${s.YM.CACHE_PREFIX}.${s.Gd.CLIENT_INFO}`,i=`${s.YM.CACHE_PREFIX}.${s.Gd.ERROR}`,n=`${s.YM.CACHE_PREFIX}.${s.Gd.ERROR_DESC}`,r=[this.browserStorage.getItem(e),this.browserStorage.getItem(t),this.browserStorage.getItem(i),this.browserStorage.getItem(n)];[s.Gd.ID_TOKEN,s.Gd.CLIENT_INFO,s.Gd.ERROR,s.Gd.ERROR_DESC].forEach((e,t)=>{const i=r[t];i&&this.setTemporaryCache(e,i,!0)})}createKeyMaps(){this.logger.trace("BrowserCacheManager - createKeyMaps called.");const e=this.getItem(Zi.dh.ACCOUNT_KEYS),t=this.getItem(`${Zi.dh.TOKEN_KEYS}.${this.clientId}`);e&&t?this.logger.verbose("BrowserCacheManager:createKeyMaps - account and token key maps already exist, skipping migration."):this.browserStorage.getKeys().forEach(e=>{if(this.isCredentialKey(e)){const t=this.getItem(e);if(t){const i=this.validateAndParseJson(t);if(i&&i.hasOwnProperty("credentialType"))switch(i.credentialType){case s.aG.ID_TOKEN:if(fe(i)){this.logger.trace("BrowserCacheManager:createKeyMaps - idToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - idToken with key: ${e} found, saving key to token key map`);const t=i,n=this.updateCredentialCacheKey(e,t);return void this.addTokenKey(n,s.aG.ID_TOKEN)}this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching idToken schema with value containing idToken credentialType field but value failed IdTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed idToken validation on key: ${e}`);break;case s.aG.ACCESS_TOKEN:case s.aG.ACCESS_TOKEN_WITH_AUTH_SCHEME:if(ge(i)){this.logger.trace("BrowserCacheManager:createKeyMaps - accessToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - accessToken with key: ${e} found, saving key to token key map`);const t=i,n=this.updateCredentialCacheKey(e,t);return void this.addTokenKey(n,s.aG.ACCESS_TOKEN)}this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching accessToken schema with value containing accessToken credentialType field but value failed AccessTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed accessToken validation on key: ${e}`);break;case s.aG.REFRESH_TOKEN:if(me(i)){this.logger.trace("BrowserCacheManager:createKeyMaps - refreshToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - refreshToken with key: ${e} found, saving key to token key map`);const t=i,n=this.updateCredentialCacheKey(e,t);return void this.addTokenKey(n,s.aG.REFRESH_TOKEN)}this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching refreshToken schema with value containing refreshToken credentialType field but value failed RefreshTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed refreshToken validation on key: ${e}`)}}}if(this.isAccountKey(e)){const t=this.getItem(e);if(t){const i=this.validateAndParseJson(t);i&&rt.isAccountEntity(i)&&(this.logger.trace("BrowserCacheManager:createKeyMaps - account found, saving key to account key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - account with key: ${e} found, saving key to account key map`),this.addAccountKeyToMap(e))}}})}validateAndParseJson(e){try{const t=JSON.parse(e);return t&&"object"==typeof t?t:null}catch(e){return null}}getItem(e){return this.browserStorage.getItem(e)}setItem(e,t){this.browserStorage.setItem(e,t)}getAccount(e,t){this.logger.trace("BrowserCacheManager.getAccount called");const i=this.getCachedAccountEntity(e);return this.updateOutdatedCachedAccount(e,i,t)}getCachedAccountEntity(e){const t=this.getItem(e);if(!t)return this.removeAccountKeyFromMap(e),null;const i=this.validateAndParseJson(t);return i&&rt.isAccountEntity(i)?vt.toObject(new rt,i):(this.removeAccountKeyFromMap(e),null)}setAccount(e){this.logger.trace("BrowserCacheManager.setAccount called");const t=e.generateAccountKey();this.setItem(t,JSON.stringify(e)),this.addAccountKeyToMap(t)}getAccountKeys(){this.logger.trace("BrowserCacheManager.getAccountKeys called");const e=this.getItem(Zi.dh.ACCOUNT_KEYS);return e?JSON.parse(e):(this.logger.verbose("BrowserCacheManager.getAccountKeys - No account keys found"),[])}addAccountKeyToMap(e){this.logger.trace("BrowserCacheManager.addAccountKeyToMap called"),this.logger.tracePii(`BrowserCacheManager.addAccountKeyToMap called with key: ${e}`);const t=this.getAccountKeys();-1===t.indexOf(e)?(t.push(e),this.setItem(Zi.dh.ACCOUNT_KEYS,JSON.stringify(t)),this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key added")):this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key already exists in map")}removeAccountKeyFromMap(e){this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap called"),this.logger.tracePii(`BrowserCacheManager.removeAccountKeyFromMap called with key: ${e}`);const t=this.getAccountKeys(),i=t.indexOf(e);i>-1?(t.splice(i,1),this.setItem(Zi.dh.ACCOUNT_KEYS,JSON.stringify(t)),this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap account key removed")):this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap key not found in existing map")}async removeAccount(e){super.removeAccount(e),this.removeAccountKeyFromMap(e)}removeOutdatedAccount(e){this.removeItem(e),this.removeAccountKeyFromMap(e)}removeIdToken(e){super.removeIdToken(e),this.removeTokenKey(e,s.aG.ID_TOKEN)}async removeAccessToken(e){super.removeAccessToken(e),this.removeTokenKey(e,s.aG.ACCESS_TOKEN)}removeRefreshToken(e){super.removeRefreshToken(e),this.removeTokenKey(e,s.aG.REFRESH_TOKEN)}getTokenKeys(){this.logger.trace("BrowserCacheManager.getTokenKeys called");const e=this.getItem(`${Zi.dh.TOKEN_KEYS}.${this.clientId}`);if(e){const t=this.validateAndParseJson(e);if(t&&t.hasOwnProperty("idToken")&&t.hasOwnProperty("accessToken")&&t.hasOwnProperty("refreshToken"))return t;this.logger.error("BrowserCacheManager.getTokenKeys - Token keys found but in an unknown format. Returning empty key map.")}else this.logger.verbose("BrowserCacheManager.getTokenKeys - No token keys found");return{idToken:[],accessToken:[],refreshToken:[]}}addTokenKey(e,t){this.logger.trace("BrowserCacheManager addTokenKey called");const i=this.getTokenKeys();switch(t){case s.aG.ID_TOKEN:-1===i.idToken.indexOf(e)&&(this.logger.info("BrowserCacheManager: addTokenKey - idToken added to map"),i.idToken.push(e));break;case s.aG.ACCESS_TOKEN:-1===i.accessToken.indexOf(e)&&(this.logger.info("BrowserCacheManager: addTokenKey - accessToken added to map"),i.accessToken.push(e));break;case s.aG.REFRESH_TOKEN:-1===i.refreshToken.indexOf(e)&&(this.logger.info("BrowserCacheManager: addTokenKey - refreshToken added to map"),i.refreshToken.push(e));break;default:throw this.logger.error(`BrowserCacheManager:addTokenKey - CredentialType provided invalid. CredentialType: ${t}`),te(G)}this.setItem(`${Zi.dh.TOKEN_KEYS}.${this.clientId}`,JSON.stringify(i))}removeTokenKey(e,t){this.logger.trace("BrowserCacheManager removeTokenKey called");const i=this.getTokenKeys();switch(t){case s.aG.ID_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove idToken with key: ${e} from map`);const n=i.idToken.indexOf(e);n>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - idToken removed from map"),i.idToken.splice(n,1)):this.logger.info("BrowserCacheManager: removeTokenKey - idToken does not exist in map. Either it was previously removed or it was never added.");break;case s.aG.ACCESS_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove accessToken with key: ${e} from map`);const r=i.accessToken.indexOf(e);r>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - accessToken removed from map"),i.accessToken.splice(r,1)):this.logger.info("BrowserCacheManager: removeTokenKey - accessToken does not exist in map. Either it was previously removed or it was never added.");break;case s.aG.REFRESH_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove refreshToken with key: ${e} from map`);const o=i.refreshToken.indexOf(e);o>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken removed from map"),i.refreshToken.splice(o,1)):this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken does not exist in map. Either it was previously removed or it was never added.");break;default:throw this.logger.error(`BrowserCacheManager:removeTokenKey - CredentialType provided invalid. CredentialType: ${t}`),te(G)}this.setItem(`${Zi.dh.TOKEN_KEYS}.${this.clientId}`,JSON.stringify(i))}getIdTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeTokenKey(e,s.aG.ID_TOKEN),null;const i=this.validateAndParseJson(t);return i&&fe(i)?(this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit"),i):(this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeTokenKey(e,s.aG.ID_TOKEN),null)}setIdTokenCredential(e){this.logger.trace("BrowserCacheManager.setIdTokenCredential called");const t=ce(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,s.aG.ID_TOKEN)}getAccessTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,s.aG.ACCESS_TOKEN),null;const i=this.validateAndParseJson(t);return i&&ge(i)?(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit"),i):(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,s.aG.ACCESS_TOKEN),null)}setAccessTokenCredential(e){this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");const t=ce(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,s.aG.ACCESS_TOKEN)}getRefreshTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,s.aG.REFRESH_TOKEN),null;const i=this.validateAndParseJson(t);return i&&me(i)?(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit"),i):(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,s.aG.REFRESH_TOKEN),null)}setRefreshTokenCredential(e){this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");const t=ce(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,s.aG.REFRESH_TOKEN)}getAppMetadata(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null;const i=this.validateAndParseJson(t);return i&&((n=i)&&0===e.indexOf(s.GU)&&n.hasOwnProperty("clientId")&&n.hasOwnProperty("environment"))?(this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit"),i):(this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null);var n}setAppMetadata(e){this.logger.trace("BrowserCacheManager.setAppMetadata called");const t=function({environment:e,clientId:t}){return[s.GU,e,t].join(s.LR.CACHE_KEY_SEPARATOR).toLowerCase()}(e);this.setItem(t,JSON.stringify(e))}getServerTelemetry(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null;const i=this.validateAndParseJson(t);return i&&function(e,t){const i=0===e.indexOf(s.gT.CACHE_KEY);let n=!0;return t&&(n=t.hasOwnProperty("failedRequests")&&t.hasOwnProperty("errors")&&t.hasOwnProperty("cacheHits")),i&&n}(e,i)?(this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit"),i):(this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null)}setServerTelemetry(e,t){this.logger.trace("BrowserCacheManager.setServerTelemetry called"),this.setItem(e,JSON.stringify(t))}getAuthorityMetadata(e){const t=this.internalStorage.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAuthorityMetadata: called, no cache hit"),null;const i=this.validateAndParseJson(t);return i&&function(e,t){return!!t&&0===e.indexOf(s.u0.CACHE_KEY)&&t.hasOwnProperty("aliases")&&t.hasOwnProperty("preferred_cache")&&t.hasOwnProperty("preferred_network")&&t.hasOwnProperty("canonical_authority")&&t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("aliasesFromNetwork")&&t.hasOwnProperty("endpointsFromNetwork")&&t.hasOwnProperty("expiresAt")&&t.hasOwnProperty("jwks_uri")}(e,i)?(this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit"),i):null}getAuthorityMetadataKeys(){return this.internalStorage.getKeys().filter(e=>this.isAuthorityMetadata(e))}setWrapperMetadata(e,t){this.internalStorage.setItem(Zi.H3.WRAPPER_SKU,e),this.internalStorage.setItem(Zi.H3.WRAPPER_VER,t)}getWrapperMetadata(){return[this.internalStorage.getItem(Zi.H3.WRAPPER_SKU)||s.YM.EMPTY_STRING,this.internalStorage.getItem(Zi.H3.WRAPPER_VER)||s.YM.EMPTY_STRING]}setAuthorityMetadata(e,t){this.logger.trace("BrowserCacheManager.setAuthorityMetadata called"),this.internalStorage.setItem(e,JSON.stringify(t))}getActiveAccount(){const e=this.generateCacheKey(s.Gd.ACTIVE_ACCOUNT_FILTERS),t=this.getItem(e);if(!t){this.logger.trace("BrowserCacheManager.getActiveAccount: No active account filters cache schema found, looking for legacy schema");const e=this.generateCacheKey(s.Gd.ACTIVE_ACCOUNT),t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null;const i=this.getAccountInfoFilteredBy({localAccountId:t});return i?(this.logger.trace("BrowserCacheManager.getActiveAccount: Legacy active account cache schema found"),this.logger.trace("BrowserCacheManager.getActiveAccount: Adding active account filters cache schema"),this.setActiveAccount(i),i):null}const i=this.validateAndParseJson(t);return i?(this.logger.trace("BrowserCacheManager.getActiveAccount: Active account filters schema found"),this.getAccountInfoFilteredBy({homeAccountId:i.homeAccountId,localAccountId:i.localAccountId,tenantId:i.tenantId})):(this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null)}setActiveAccount(e){const t=this.generateCacheKey(s.Gd.ACTIVE_ACCOUNT_FILTERS),i=this.generateCacheKey(s.Gd.ACTIVE_ACCOUNT);if(e){this.logger.verbose("setActiveAccount: Active account set");const n={homeAccountId:e.homeAccountId,localAccountId:e.localAccountId,tenantId:e.tenantId};this.browserStorage.setItem(t,JSON.stringify(n)),this.browserStorage.setItem(i,e.localAccountId)}else this.logger.verbose("setActiveAccount: No account passed, active account not set"),this.browserStorage.removeItem(t),this.browserStorage.removeItem(i)}getThrottlingCache(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null;const i=this.validateAndParseJson(t);return i&&function(e,t){let i=!1;e&&(i=0===e.indexOf(s.Xw.THROTTLING_PREFIX));let n=!0;return t&&(n=t.hasOwnProperty("throttleTime")),i&&n}(e,i)?(this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit"),i):(this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null)}setThrottlingCache(e,t){this.logger.trace("BrowserCacheManager.setThrottlingCache called"),this.setItem(e,JSON.stringify(t))}getTemporaryCache(e,t){const i=t?this.generateCacheKey(e):e;if(this.cacheConfig.storeAuthStateInCookie){const e=this.getItemCookie(i);if(e)return this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies"),e}const n=this.temporaryCacheStorage.getItem(i);if(!n){if(this.cacheConfig.cacheLocation===Zi.Al.LocalStorage){const e=this.browserStorage.getItem(i);if(e)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage"),e}return this.logger.trace("BrowserCacheManager.getTemporaryCache: No cache item found in local storage"),null}return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item returned"),n}setTemporaryCache(e,t,i){const n=i?this.generateCacheKey(e):e;this.temporaryCacheStorage.setItem(n,t),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie"),this.setItemCookie(n,t))}removeItem(e){this.browserStorage.removeItem(e)}removeTemporaryItem(e){this.temporaryCacheStorage.removeItem(e),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie"),this.clearItemCookie(e))}getKeys(){return this.browserStorage.getKeys()}async clear(){await this.removeAllAccounts(),this.removeAppMetadata(),this.temporaryCacheStorage.getKeys().forEach(e=>{-1===e.indexOf(s.YM.CACHE_PREFIX)&&-1===e.indexOf(this.clientId)||this.removeTemporaryItem(e)}),this.browserStorage.getKeys().forEach(e=>{-1===e.indexOf(s.YM.CACHE_PREFIX)&&-1===e.indexOf(this.clientId)||this.browserStorage.removeItem(e)}),this.internalStorage.clear()}async clearTokensAndKeysWithClaims(e,t){e.addQueueMeasurement(Hi,t);const i=this.getTokenKeys(),n=[];i.accessToken.forEach(e=>{const t=this.getAccessTokenCredential(e);t?.requestedClaimsHash&&e.includes(t.requestedClaimsHash.toLowerCase())&&n.push(this.removeAccessToken(e))}),await Promise.all(n),n.length>0&&this.logger.warning(`${n.length} access tokens with claims in the cache keys have been removed from the cache.`)}setItemCookie(e,t,i){let n=`${encodeURIComponent(e)}=${encodeURIComponent(t)};path=/;SameSite=Lax;`;i&&(n+=`expires=${this.getCookieExpirationTime(i)};`),this.cacheConfig.secureCookies&&(n+="Secure;"),document.cookie=n}getItemCookie(e){const t=`${encodeURIComponent(e)}=`,i=document.cookie.split(";");for(let e=0;e<i.length;e++){let n=i[e];for(;" "===n.charAt(0);)n=n.substring(1);if(0===n.indexOf(t))return decodeURIComponent(n.substring(t.length,n.length))}return s.YM.EMPTY_STRING}clearMsalCookies(){const e=`${s.YM.CACHE_PREFIX}.${this.clientId}`;document.cookie.split(";").forEach(t=>{for(;" "===t.charAt(0);)t=t.substring(1);if(0===t.indexOf(e)){const e=t.split("=")[0];this.clearItemCookie(e)}})}clearItemCookie(e){this.setItemCookie(e,s.YM.EMPTY_STRING,-1)}getCookieExpirationTime(e){const t=new Date;return new Date(t.getTime()+e*this.COOKIE_LIFE_MULTIPLIER).toUTCString()}generateCacheKey(e){return this.validateAndParseJson(e)?JSON.stringify(e):Ze.startsWith(e,s.YM.CACHE_PREFIX)||Ze.startsWith(e,s.Gd.ADAL_ID_TOKEN)?e:`${s.YM.CACHE_PREFIX}.${this.clientId}.${e}`}generateAuthorityKey(e){const{libraryState:{id:t}}=Yn.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${Zi._p.AUTHORITY}.${t}`)}generateNonceKey(e){const{libraryState:{id:t}}=Yn.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${Zi._p.NONCE_IDTOKEN}.${t}`)}generateStateKey(e){const{libraryState:{id:t}}=Yn.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${Zi._p.REQUEST_STATE}.${t}`)}getCachedAuthority(e){const t=this.generateStateKey(e),i=this.getTemporaryCache(t);if(!i)return null;const n=this.generateAuthorityKey(i);return this.getTemporaryCache(n)}updateCacheEntries(e,t,i,n,s){this.logger.trace("BrowserCacheManager.updateCacheEntries called");const r=this.generateStateKey(e);this.setTemporaryCache(r,e,!1);const o=this.generateNonceKey(e);this.setTemporaryCache(o,t,!1);const a=this.generateAuthorityKey(e);if(this.setTemporaryCache(a,i,!1),s){const e={credential:s.homeAccountId,type:qn};this.setTemporaryCache(Zi._p.CCS_CREDENTIAL,JSON.stringify(e),!0)}else if(n){const e={credential:n,type:Xn};this.setTemporaryCache(Zi._p.CCS_CREDENTIAL,JSON.stringify(e),!0)}}resetRequestCache(e){this.logger.trace("BrowserCacheManager.resetRequestCache called"),e&&(this.temporaryCacheStorage.getKeys().forEach(t=>{-1!==t.indexOf(e)&&this.removeTemporaryItem(t)}),this.removeTemporaryItem(this.generateStateKey(e)),this.removeTemporaryItem(this.generateNonceKey(e)),this.removeTemporaryItem(this.generateAuthorityKey(e))),this.removeTemporaryItem(this.generateCacheKey(Zi._p.REQUEST_PARAMS)),this.removeTemporaryItem(this.generateCacheKey(Zi._p.ORIGIN_URI)),this.removeTemporaryItem(this.generateCacheKey(Zi._p.URL_HASH)),this.removeTemporaryItem(this.generateCacheKey(Zi._p.CORRELATION_ID)),this.removeTemporaryItem(this.generateCacheKey(Zi._p.CCS_CREDENTIAL)),this.removeTemporaryItem(this.generateCacheKey(Zi._p.NATIVE_REQUEST)),this.setInteractionInProgress(!1)}cleanRequestByState(e){if(this.logger.trace("BrowserCacheManager.cleanRequestByState called"),e){const t=this.generateStateKey(e),i=this.temporaryCacheStorage.getItem(t);this.logger.infoPii(`BrowserCacheManager.cleanRequestByState: Removing temporary cache items for state: ${i}`),this.resetRequestCache(i||s.YM.EMPTY_STRING)}this.clearMsalCookies()}cleanRequestByInteractionType(e){this.logger.trace("BrowserCacheManager.cleanRequestByInteractionType called"),this.temporaryCacheStorage.getKeys().forEach(t=>{if(-1===t.indexOf(Zi._p.REQUEST_STATE))return;const i=this.temporaryCacheStorage.getItem(t);if(!i)return;const n=es(this.cryptoImpl,i);n&&n.interactionType===e&&(this.logger.infoPii(`BrowserCacheManager.cleanRequestByInteractionType: Removing temporary cache items for state: ${i}`),this.resetRequestCache(i))}),this.clearMsalCookies(),this.setInteractionInProgress(!1)}cacheCodeRequest(e){this.logger.trace("BrowserCacheManager.cacheCodeRequest called");const t=gn(JSON.stringify(e));this.setTemporaryCache(Zi._p.REQUEST_PARAMS,t,!0)}getCachedRequest(e){this.logger.trace("BrowserCacheManager.getCachedRequest called");const t=this.getTemporaryCache(Zi._p.REQUEST_PARAMS,!0);if(!t)throw(0,Ji.bD)(en.y6);let i;try{i=JSON.parse(mn(t))}catch(e){throw this.logger.errorPii(`Attempted to parse: ${t}`),this.logger.error(`Parsing cached token request threw with error: ${e}`),(0,Ji.bD)(en.ot)}if(this.removeTemporaryItem(this.generateCacheKey(Zi._p.REQUEST_PARAMS)),!i.authority){const t=this.generateAuthorityKey(e),n=this.getTemporaryCache(t);if(!n)throw(0,Ji.bD)(en.Ne);i.authority=n}return i}getCachedNativeRequest(){this.logger.trace("BrowserCacheManager.getCachedNativeRequest called");const e=this.getTemporaryCache(Zi._p.NATIVE_REQUEST,!0);if(!e)return this.logger.trace("BrowserCacheManager.getCachedNativeRequest: No cached native request found"),null;return this.validateAndParseJson(e)||(this.logger.error("BrowserCacheManager.getCachedNativeRequest: Unable to parse native request"),null)}isInteractionInProgress(e){const t=this.getInteractionInProgress();return e?t===this.clientId:!!t}getInteractionInProgress(){const e=`${s.YM.CACHE_PREFIX}.${Zi._p.INTERACTION_STATUS_KEY}`;return this.getTemporaryCache(e,!1)}setInteractionInProgress(e){const t=`${s.YM.CACHE_PREFIX}.${Zi._p.INTERACTION_STATUS_KEY}`;if(e){if(this.getInteractionInProgress())throw(0,Ji.bD)(en.b);this.setTemporaryCache(t,this.clientId,!1)}else e||this.getInteractionInProgress()!==this.clientId||this.removeTemporaryItem(t)}getLegacyLoginHint(){const e=this.getTemporaryCache(s.Gd.ADAL_ID_TOKEN);e&&(this.browserStorage.removeItem(s.Gd.ADAL_ID_TOKEN),this.logger.verbose("Cached ADAL id token retrieved."));const t=this.getTemporaryCache(s.Gd.ID_TOKEN,!0);t&&(this.browserStorage.removeItem(this.generateCacheKey(s.Gd.ID_TOKEN)),this.logger.verbose("Cached MSAL.js v1 id token retrieved"));const i=t||e;if(i){const e=re(i,mn);if(e.preferred_username)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 preferred_username as loginHint"),e.preferred_username;if(e.upn)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 upn as loginHint"),e.upn;this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, however, no account hint claim found. Enable preferred_username or upn id token claim to get SSO.")}return null}updateCredentialCacheKey(e,t){const i=ce(t);if(e!==i){const n=this.getItem(e);if(n)return this.browserStorage.removeItem(e),this.setItem(i,n),this.logger.verbose(`Updated an outdated ${t.credentialType} cache key`),i;this.logger.error(`Attempted to update an outdated ${t.credentialType} cache key but no item matching the outdated key was found in storage`)}return e}async hydrateCache(e,t){const i=he(e.account?.homeAccountId,e.account?.environment,e.idToken,this.clientId,e.tenantId);let n;t.claims&&(n=await this.cryptoImpl.hashString(t.claims));const s={idToken:i,accessToken:ue(e.account?.homeAccountId,e.account.environment,e.accessToken,this.clientId,e.tenantId,e.scopes.join(" "),e.expiresOn?e.expiresOn.getTime()/1e3:0,e.extExpiresOn?e.extExpiresOn.getTime()/1e3:0,mn,void 0,e.tokenType,void 0,t.sshKid,t.claims,n)};return this.saveCacheRecord(s)}async saveCacheRecord(e,t,i){try{await super.saveCacheRecord(e,t,i)}catch(e){if(e instanceof yt&&this.performanceClient&&i)try{const e=this.getTokenKeys();this.performanceClient.addFields({cacheRtCount:e.refreshToken.length,cacheIdCount:e.idToken.length,cacheAtCount:e.accessToken.length},i)}catch(e){}throw e}}}function is(){return window.parent!==window}function ns(){return window.location.href.split("?")[0].split("#")[0]}function ss(){if("undefined"==typeof window)throw(0,Ji.bD)(en.tI)}function rs(e){if(!e)throw(0,Ji.bD)(en.IR)}function os(e){ss(),function(){if(lt.hashContainsKnownProperties(window.location.hash)&&is())throw(0,Ji.bD)(en.tZ)}(),function(){if("undefined"!=typeof window&&window.opener&&window.opener!==window&&"string"==typeof window.name&&0===window.name.indexOf(`${Zi.Q1.POPUP_NAME_PREFIX}.`))throw(0,Ji.bD)(en.aH)}(),rs(e)}function as(e,t){if(os(e),function(e){if(is()&&!e)throw(0,Ji.bD)(en.OT)}(t.system.allowRedirectInIframe),t.cache.cacheLocation===Zi.Al.MemoryStorage&&!t.cache.storeAuthStateInCookie)throw(0,Zn.jz)(Qn.jE)}function ls(e){const t=document.createElement("link");t.rel="preconnect",t.href=new URL(e).origin,t.crossOrigin="anonymous",document.head.appendChild(t),window.setTimeout(()=>{try{document.head.removeChild(t)}catch{}},1e4)}var cs=i(99268);class hs{constructor(e){this.eventCallbacks=new Map,this.logger=e||new n.V({})}addEventCallback(e,t,i){if("undefined"!=typeof window){const n=i||An();return this.eventCallbacks.has(n)?(this.logger.error(`Event callback with id: ${n} is already registered. Please provide a unique id or remove the existing callback and try again.`),null):(this.eventCallbacks.set(n,[e,t||[]]),this.logger.verbose(`Event callback registered with id: ${n}`),n)}return null}removeEventCallback(e){this.eventCallbacks.delete(e),this.logger.verbose(`Event callback ${e} removed.`)}emitEvent(e,t,i,n){if("undefined"!=typeof window){const s={eventType:e,interactionType:t||null,payload:i||null,error:n||null,timestamp:Date.now()};this.eventCallbacks.forEach(([t,i],n)=>{(0===i.length||i.includes(e))&&(this.logger.verbose(`Emitting event to callback ${n}: ${e}`),t.apply(null,[s]))})}}}class us extends l.lR{constructor(e,t,i,n,s){super(e,t,i),this.name="ServerError",this.errorNo=n,this.status=s,Object.setPrototypeOf(this,us.prototype)}}class ds{static generateThrottlingStorageKey(e){return`${s.Xw.THROTTLING_PREFIX}.${JSON.stringify(e)}`}static preProcess(e,t){const i=ds.generateThrottlingStorageKey(t),n=e.getThrottlingCache(i);if(n){if(n.throttleTime<Date.now())return void e.removeItem(i);throw new us(n.errorCodes?.join(" ")||s.YM.EMPTY_STRING,n.errorMessage,n.subError)}}static postProcess(e,t,i){if(ds.checkResponseStatus(i)||ds.checkResponseForRetryAfter(i)){const n={throttleTime:ds.calculateThrottleTime(parseInt(i.headers[s.OK.RETRY_AFTER])),error:i.body.error,errorCodes:i.body.error_codes,errorMessage:i.body.error_description,subError:i.body.suberror};e.setThrottlingCache(ds.generateThrottlingStorageKey(t),n)}}static checkResponseStatus(e){return 429===e.status||e.status>=500&&e.status<600}static checkResponseForRetryAfter(e){return!!e.headers&&e.headers.hasOwnProperty(s.OK.RETRY_AFTER)&&(e.status<200||e.status>=300)}static calculateThrottleTime(e){const t=e<=0?0:e,i=Date.now()/1e3;return Math.floor(1e3*Math.min(i+(t||s.Xw.DEFAULT_THROTTLE_TIME_SECONDS),i+s.Xw.DEFAULT_MAX_THROTTLE_TIME_SECONDS))}static removeThrottle(e,t,i,n){const s={clientId:t,authority:i.authority,scopes:i.scopes,homeAccountIdentifier:n,claims:i.claims,authenticationScheme:i.authenticationScheme,resourceRequestMethod:i.resourceRequestMethod,resourceRequestUri:i.resourceRequestUri,shrClaims:i.shrClaims,sshKid:i.sshKid},r=this.generateThrottlingStorageKey(s);e.removeItem(r)}}class ps{constructor(e,t){this.networkClient=e,this.cacheManager=t}async sendPostRequest(e,t,i){let n;ds.preProcess(this.cacheManager,e);try{n=await this.networkClient.sendPostRequestAsync(t,i)}catch(e){throw e instanceof l.lR?e:te(g)}return ds.postProcess(this.cacheManager,e,n),n}}const gs="client_id",fs="response_type",ms="token_type",ys="req_cnf",vs="return_spa_code",bs="x-client-xtra-sku";class Cs{static validateRedirectUri(e){if(!e)throw Xe(Me)}static validatePrompt(e){const t=[];for(const e in s._M)t.push(s._M[e]);if(t.indexOf(e)<0)throw Xe(Pe)}static validateClaims(e){try{JSON.parse(e)}catch(e){throw Xe(_e)}}static validateCodeChallengeParams(e,t){if(!e||!t)throw Xe(Fe);this.validateCodeChallengeMethod(t)}static validateCodeChallengeMethod(e){if([s.iF.PLAIN,s.iF.S256].indexOf(e)<0)throw Xe(Oe)}}class ws{constructor(){this.parameters=new Map}addResponseTypeCode(){this.parameters.set(fs,encodeURIComponent(s.YM.CODE_RESPONSE_TYPE))}addResponseTypeForTokenAndIdToken(){this.parameters.set(fs,encodeURIComponent(`${s.YM.TOKEN_RESPONSE_TYPE} ${s.YM.ID_TOKEN_RESPONSE_TYPE}`))}addResponseMode(e){this.parameters.set("response_mode",encodeURIComponent(e||s.p.QUERY))}addNativeBroker(){this.parameters.set("nativebroker",encodeURIComponent("1"))}addScopes(e,t=!0,i=s.aZ){!t||i.includes("openid")||e.includes("openid")||i.push("openid");const n=t?[...e||[],...i]:e||[],r=new Qe(n);this.parameters.set("scope",encodeURIComponent(r.printScopes()))}addClientId(e){this.parameters.set(gs,encodeURIComponent(e))}addRedirectUri(e){Cs.validateRedirectUri(e),this.parameters.set("redirect_uri",encodeURIComponent(e))}addPostLogoutRedirectUri(e){Cs.validateRedirectUri(e),this.parameters.set("post_logout_redirect_uri",encodeURIComponent(e))}addIdTokenHint(e){this.parameters.set("id_token_hint",encodeURIComponent(e))}addDomainHint(e){this.parameters.set("domain_hint",encodeURIComponent(e))}addLoginHint(e){this.parameters.set("login_hint",encodeURIComponent(e))}addCcsUpn(e){this.parameters.set(s.OK.CCS_HEADER,encodeURIComponent(`UPN:${e}`))}addCcsOid(e){this.parameters.set(s.OK.CCS_HEADER,encodeURIComponent(`Oid:${e.uid}@${e.utid}`))}addSid(e){this.parameters.set("sid",encodeURIComponent(e))}addClaims(e,t){const i=this.addClientCapabilitiesToClaims(e,t);Cs.validateClaims(i),this.parameters.set("claims",encodeURIComponent(i))}addCorrelationId(e){this.parameters.set("client-request-id",encodeURIComponent(e))}addLibraryInfo(e){this.parameters.set("x-client-SKU",e.sku),this.parameters.set("x-client-VER",e.version),e.os&&this.parameters.set("x-client-OS",e.os),e.cpu&&this.parameters.set("x-client-CPU",e.cpu)}addApplicationTelemetry(e){e?.appName&&this.parameters.set("x-app-name",e.appName),e?.appVersion&&this.parameters.set("x-app-ver",e.appVersion)}addPrompt(e){Cs.validatePrompt(e),this.parameters.set("prompt",encodeURIComponent(e))}addState(e){e&&this.parameters.set("state",encodeURIComponent(e))}addNonce(e){this.parameters.set("nonce",encodeURIComponent(e))}addCodeChallengeParams(e,t){if(Cs.validateCodeChallengeParams(e,t),!e||!t)throw Xe(Fe);this.parameters.set("code_challenge",encodeURIComponent(e)),this.parameters.set("code_challenge_method",encodeURIComponent(t))}addAuthorizationCode(e){this.parameters.set("code",encodeURIComponent(e))}addDeviceCode(e){this.parameters.set("device_code",encodeURIComponent(e))}addRefreshToken(e){this.parameters.set("refresh_token",encodeURIComponent(e))}addCodeVerifier(e){this.parameters.set("code_verifier",encodeURIComponent(e))}addClientSecret(e){this.parameters.set("client_secret",encodeURIComponent(e))}addClientAssertion(e){e&&this.parameters.set("client_assertion",encodeURIComponent(e))}addClientAssertionType(e){e&&this.parameters.set("client_assertion_type",encodeURIComponent(e))}addOboAssertion(e){this.parameters.set("assertion",encodeURIComponent(e))}addRequestTokenUse(e){this.parameters.set("requested_token_use",encodeURIComponent(e))}addGrantType(e){this.parameters.set("grant_type",encodeURIComponent(e))}addClientInfo(){this.parameters.set(s.JR,"1")}addExtraQueryParameters(e){Object.entries(e).forEach(([e,t])=>{!this.parameters.has(e)&&t&&this.parameters.set(e,t)})}addClientCapabilitiesToClaims(e,t){let i;if(e)try{i=JSON.parse(e)}catch(e){throw Xe(_e)}else i={};return t&&t.length>0&&(i.hasOwnProperty(s.Fq.ACCESS_TOKEN)||(i[s.Fq.ACCESS_TOKEN]={}),i[s.Fq.ACCESS_TOKEN][s.Fq.XMS_CC]={values:t}),JSON.stringify(i)}addUsername(e){this.parameters.set(s.Tq.username,encodeURIComponent(e))}addPassword(e){this.parameters.set(s.Tq.password,encodeURIComponent(e))}addPopToken(e){e&&(this.parameters.set(ms,s.IO.POP),this.parameters.set(ys,encodeURIComponent(e)))}addSshJwk(e){e&&(this.parameters.set(ms,s.IO.SSH),this.parameters.set(ys,encodeURIComponent(e)))}addServerTelemetry(e){this.parameters.set("x-client-current-telemetry",e.generateCurrentRequestHeaderValue()),this.parameters.set("x-client-last-telemetry",e.generateLastRequestHeaderValue())}addThrottling(){this.parameters.set("x-ms-lib-capability",s.Xw.X_MS_LIB_CAPABILITY_VALUE)}addLogoutHint(e){this.parameters.set("logout_hint",encodeURIComponent(e))}createQueryString(){const e=new Array;return this.parameters.forEach((t,i)=>{e.push(`${i}=${t}`)}),e.join("&")}}async function Ss(e,t,i,n,s,r,o){o?.addQueueMeasurement(Mi,r);const a=On.transformCIAMAuthority(Fn(e)),l=new On(a,t,i,n,s,r,o);try{return await Ln(l.resolveEndpointsAsync.bind(l),Ti,s,o,r)(),l}catch(e){throw te(p)}}class xs{constructor(e,t){this.config=function({authOptions:e,systemOptions:t,loggerOptions:i,cacheOptions:s,storageInterface:r,networkInterface:o,cryptoInterface:a,clientCredentials:l,libraryInfo:c,telemetry:h,serverTelemetryManager:u,persistencePlugin:d,serializableCache:p}){const g={...wt,...i};return{authOptions:(f=e,{clientCapabilities:[],azureCloudOptions:Mt,skipAuthorityMetadataCache:!1,instanceAware:!1,...f}),systemOptions:{...Ct,...t},loggerOptions:g,cacheOptions:{...St,...s},storageInterface:r||new bt(e.clientId,ie,new n.V(g)),networkInterface:o||xt,cryptoInterface:a||ie,clientCredentials:l||At,libraryInfo:{...Et,...c},telemetry:{...Tt,...h},serverTelemetryManager:u||null,persistencePlugin:d||null,serializableCache:p||null};var f}(e),this.logger=new n.V(this.config.loggerOptions,ne,se),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.networkManager=new ps(this.networkClient,this.cacheManager),this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=t}createTokenRequestHeaders(e){const t={};if(t[s.OK.CONTENT_TYPE]=s.YM.URL_FORM_CONTENT_TYPE,!this.config.systemOptions.preventCorsPreflight&&e)switch(e.type){case qn:try{const i=et(e.credential);t[s.OK.CCS_HEADER]=`Oid:${i.uid}@${i.utid}`}catch(e){this.logger.verbose("Could not parse home account ID for CCS Header: "+e)}break;case Xn:t[s.OK.CCS_HEADER]=`UPN: ${e.credential}`}return t}async executePostToTokenEndpoint(e,t,i,n,r,o){o&&this.performanceClient?.addQueueMeasurement(o,r);const a=await this.networkManager.sendPostRequest(n,e,{body:t,headers:i});return this.performanceClient?.addFields({refreshTokenSize:a.body.refresh_token?.length||0,httpVerToken:a.headers?.[s.OK.X_MS_HTTP_VERSION]||""},r),this.config.serverTelemetryManager&&a.status<500&&429!==a.status&&this.config.serverTelemetryManager.clearTelemetryCache(),a}async updateAuthority(e,t){this.performanceClient?.addQueueMeasurement(yi,t);const i=`https://${e}/${this.authority.tenant}/`,n=await Ss(i,this.networkClient,this.cacheManager,this.authority.options,this.logger,t,this.performanceClient);this.authority=n}createTokenQueryParameters(e){const t=new ws;return e.tokenQueryParameters&&t.addExtraQueryParameters(e.tokenQueryParameters),t.createQueryString()}}class Es{constructor(e,t){this.cryptoUtils=e,this.performanceClient=t}async generateCnf(e,t){this.performanceClient?.addQueueMeasurement(Si,e.correlationId);const i=await Ln(this.generateKid.bind(this),Si,t,this.performanceClient,e.correlationId)(e),n=this.cryptoUtils.base64UrlEncode(JSON.stringify(i));return{kid:i.kid,reqCnfString:n}}async generateKid(e){return this.performanceClient?.addQueueMeasurement(xi,e.correlationId),{kid:await this.cryptoUtils.getPublicKeyThumbprint(e),xms_ksl:"sw"}}async signPopToken(e,t,i){return this.signPayload(e,t,i)}async signPayload(e,t,i,n){const{resourceRequestMethod:s,resourceRequestUri:r,shrClaims:o,shrNonce:a,shrOptions:l}=i,c=r?new lt(r):void 0,h=c?.getUrlComponents();return this.cryptoUtils.signJwt({at:e,ts:ae(),m:s?.toUpperCase(),u:h?.HostNameAndPort,nonce:a||this.cryptoUtils.createNewGuid(),p:h?.AbsolutePath,q:h?.QueryString?[[],h.QueryString]:void 0,client_claims:o||void 0,...n},t,l,i.correlationId)}}class As{constructor(e,t){this.cache=e,this.hasChanged=t}get cacheHasChanged(){return this.hasChanged}get tokenCache(){return this.cache}}class Ms{constructor(e,t,i,n,s,r,o){this.clientId=e,this.cacheStorage=t,this.cryptoObj=i,this.logger=n,this.serializableCache=s,this.persistencePlugin=r,this.performanceClient=o}validateServerAuthorizationCodeResponse(e,t){if(!e.state||!t)throw e.state?te(b,"Cached State"):te(b,"Server State");let i,n;try{i=decodeURIComponent(e.state)}catch(t){throw te(y,e.state)}try{n=decodeURIComponent(t)}catch(t){throw te(y,e.state)}if(i!==n)throw te(v);if(e.error||e.error_description||e.suberror){const t=function(e){const t=e.error_uri?.lastIndexOf("code=");return t&&t>=0?e.error_uri?.substring(t+5):void 0}(e);if($n(e.error,e.error_description,e.suberror))throw new jn(e.error||"",e.error_description,e.suberror,e.timestamp||"",e.trace_id||"",e.correlation_id||"",e.claims||"",t);throw new us(e.error||"",e.error_description,e.suberror,t)}}validateTokenResponse(e,t){if(e.error||e.error_description||e.suberror){const i=`Error(s): ${e.error_codes||s.YM.NOT_AVAILABLE} - Timestamp: ${e.timestamp||s.YM.NOT_AVAILABLE} - Description: ${e.error_description||s.YM.NOT_AVAILABLE} - Correlation ID: ${e.correlation_id||s.YM.NOT_AVAILABLE} - Trace ID: ${e.trace_id||s.YM.NOT_AVAILABLE}`,n=e.error_codes?.length?e.error_codes[0]:void 0,r=new us(e.error,i,e.suberror,n,e.status);if(t&&e.status&&e.status>=s.t3.SERVER_ERROR_RANGE_START&&e.status<=s.t3.SERVER_ERROR_RANGE_END)return void this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently unavailable and the access token is unable to be refreshed.\n${r}`);if(t&&e.status&&e.status>=s.t3.CLIENT_ERROR_RANGE_START&&e.status<=s.t3.CLIENT_ERROR_RANGE_END)return void this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently available but is unable to refresh the access token.\n${r}`);if($n(e.error,e.error_description,e.suberror))throw new jn(e.error,e.error_description,e.suberror,e.timestamp||s.YM.EMPTY_STRING,e.trace_id||s.YM.EMPTY_STRING,e.correlation_id||s.YM.EMPTY_STRING,e.claims||s.YM.EMPTY_STRING,n);throw r}}async handleServerTokenResponse(e,t,i,n,r,o,a,l,c){let h,u;if(this.performanceClient?.addQueueMeasurement(Ei,e.correlation_id),e.id_token){if(h=re(e.id_token||s.YM.EMPTY_STRING,this.cryptoObj.base64Decode),r&&r.nonce&&h.nonce!==r.nonce)throw te(C);if(n.maxAge||0===n.maxAge){const e=h.auth_time;if(!e)throw te(w);oe(e,n.maxAge)}}this.homeAccountIdentifier=rt.generateHomeAccountId(e.client_info||s.YM.EMPTY_STRING,t.authorityType,this.logger,this.cryptoObj,h),r&&r.state&&(u=Yn.parseRequestState(this.cryptoObj,r.state)),e.key_id=e.key_id||n.sshKid||void 0;const d=this.generateCacheRecord(e,t,i,n,h,o,r);let p;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),p=new As(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(p)),a&&!l&&d.account){const e=d.account.generateAccountKey();if(!this.cacheStorage.getAccount(e,this.logger))return this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),await Ms.generateAuthenticationResult(this.cryptoObj,t,d,!1,n,h,u,void 0,c)}await this.cacheStorage.saveCacheRecord(d,n.storeInCache,n.correlationId)}finally{this.persistencePlugin&&this.serializableCache&&p&&(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),await this.persistencePlugin.afterCacheAccess(p))}return Ms.generateAuthenticationResult(this.cryptoObj,t,d,!1,n,h,u,e,c)}generateCacheRecord(e,t,i,n,s,r,o){const a=t.getPreferredCache();if(!a)throw te(N);const l=st(s);let c,h;e.id_token&&s&&(c=he(this.homeAccountIdentifier,a,e.id_token,this.clientId,l||""),h=Ts(this.cacheStorage,t,this.homeAccountIdentifier,this.cryptoObj.base64Decode,s,e.client_info,a,l,o,void 0,this.logger));let u=null;if(e.access_token){const s=e.scope?Qe.fromString(e.scope):new Qe(n.scopes||[]),o=("string"==typeof e.expires_in?parseInt(e.expires_in,10):e.expires_in)||0,c=("string"==typeof e.ext_expires_in?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,h=("string"==typeof e.refresh_in?parseInt(e.refresh_in,10):e.refresh_in)||void 0,d=i+o,p=d+c,g=h&&h>0?i+h:void 0;u=ue(this.homeAccountIdentifier,a,e.access_token,this.clientId,l||t.tenant||"",s.printScopes(),d,p,this.cryptoObj.base64Decode,g,e.token_type,r,e.key_id,n.claims,n.requestedClaimsHash)}let d=null;if(e.refresh_token){let t;e.refresh_token_expires_in&&(t=i+("string"==typeof e.refresh_token_expires_in?parseInt(e.refresh_token_expires_in,10):e.refresh_token_expires_in)),d=de(this.homeAccountIdentifier,a,e.refresh_token,this.clientId,e.foci,r,t)}let p=null;return e.foci&&(p={clientId:this.clientId,environment:a,familyId:e.foci}),{account:h,idToken:c,accessToken:u,refreshToken:d,appMetadata:p}}static async generateAuthenticationResult(e,t,i,n,r,o,a,l,c){let h,u,d=s.YM.EMPTY_STRING,p=[],g=null,f=s.YM.EMPTY_STRING;if(i.accessToken){if(i.accessToken.tokenType!==s.IO.POP||r.popKid)d=i.accessToken.secret;else{const t=new Es(e),{secret:n,keyId:s}=i.accessToken;if(!s)throw te(K);d=await t.signPopToken(n,s,r)}p=Qe.fromString(i.accessToken.target).asArray(),g=new Date(1e3*Number(i.accessToken.expiresOn)),h=new Date(1e3*Number(i.accessToken.extendedExpiresOn)),i.accessToken.refreshOn&&(u=new Date(1e3*Number(i.accessToken.refreshOn)))}i.appMetadata&&(f=i.appMetadata.familyId===s.hB?s.hB:"");const m=o?.oid||o?.sub||"",y=o?.tid||"";l?.spa_accountid&&i.account&&(i.account.nativeAccountId=l?.spa_accountid);const v=i.account?nt(i.account.getAccountInfo(),void 0,o,i.idToken?.secret):null;return{authority:t.canonicalAuthority,uniqueId:m,tenantId:y,scopes:p,account:v,idToken:i?.idToken?.secret||"",idTokenClaims:o||{},accessToken:d,fromCache:n,expiresOn:g,extExpiresOn:h,refreshOn:u,correlationId:r.correlationId,requestId:c||s.YM.EMPTY_STRING,familyId:f,tokenType:i.accessToken?.tokenType||s.YM.EMPTY_STRING,state:a?a.userRequestState:s.YM.EMPTY_STRING,cloudGraphHostName:i.account?.cloudGraphHostName||s.YM.EMPTY_STRING,msGraphHost:i.account?.msGraphHost||s.YM.EMPTY_STRING,code:l?.spa_code,fromNativeBroker:!1}}}function Ts(e,t,i,n,s,r,o,a,l,c,h){h?.verbose("setCachedAccount called");const u=e.getAccountKeys().find(e=>e.startsWith(i));let d=null;u&&(d=e.getAccount(u,h));const p=d||rt.createAccount({homeAccountId:i,idTokenClaims:s,clientInfo:r,environment:o,cloudGraphHostName:l?.cloud_graph_host_name,msGraphHost:l?.msgraph_host,nativeAccountId:c},t,n),g=p.tenantProfiles||[],f=a||p.realm;if(f&&!g.find(e=>e.tenantId===f)){const e=it(i,p.localAccountId,f,s);g.push(e)}return p.tenantProfiles=g,p}async function Ds(e,t,i){return"string"==typeof e?e:e({clientId:t,tokenEndpoint:i})}class Is extends xs{constructor(e,t){super(e,t),this.includeRedirectUri=!0,this.oidcDefaultScopes=this.config.authOptions.authority.options.OIDCOptions?.defaultScopes}async getAuthCodeUrl(e){this.performanceClient?.addQueueMeasurement(gi,e.correlationId);const t=await Ln(this.createAuthCodeUrlQueryString.bind(this),wi,this.logger,this.performanceClient,e.correlationId)(e);return lt.appendQueryString(this.authority.authorizationEndpoint,t)}async acquireToken(e,t){if(this.performanceClient?.addQueueMeasurement(vi,e.correlationId),!e.code)throw te(M);const i=ae(),n=await Ln(this.executeTokenRequest.bind(this),bi,this.logger,this.performanceClient,e.correlationId)(this.authority,e),r=n.headers?.[s.OK.X_MS_REQUEST_ID],o=new Ms(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin,this.performanceClient);return o.validateTokenResponse(n.body),Ln(o.handleServerTokenResponse.bind(o),Ei,this.logger,this.performanceClient,e.correlationId)(n.body,this.authority,i,e,t,void 0,void 0,void 0,r)}handleFragmentResponse(e,t){if(new Ms(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,null,null).validateServerAuthorizationCodeResponse(e,t),!e.code)throw te(W);return e}getLogoutUri(e){if(!e)throw Xe(Ne);const t=this.createLogoutUrlQueryString(e);return lt.appendQueryString(this.authority.endSessionEndpoint,t)}async executeTokenRequest(e,t){this.performanceClient?.addQueueMeasurement(bi,t.correlationId);const i=this.createTokenQueryParameters(t),n=lt.appendQueryString(e.tokenEndpoint,i),r=await Ln(this.createTokenRequestBody.bind(this),Ci,this.logger,this.performanceClient,t.correlationId)(t);let o;if(t.clientInfo)try{const e=Je(t.clientInfo,this.cryptoUtils.base64Decode);o={credential:`${e.uid}${s.LR.CLIENT_INFO_SEPARATOR}${e.utid}`,type:qn}}catch(e){this.logger.verbose("Could not parse client info for CCS Header: "+e)}const a=this.createTokenRequestHeaders(o||t.ccsCredential),l={clientId:t.tokenBodyParameters?.clientId||this.config.authOptions.clientId,authority:e.canonicalAuthority,scopes:t.scopes,claims:t.claims,authenticationScheme:t.authenticationScheme,resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,sshKid:t.sshKid};return Ln(this.executePostToTokenEndpoint.bind(this),$t,this.logger,this.performanceClient,t.correlationId)(n,r,a,l,t.correlationId,$t)}async createTokenRequestBody(e){this.performanceClient?.addQueueMeasurement(Ci,e.correlationId);const t=new ws;if(t.addClientId(e.tokenBodyParameters?.[gs]||this.config.authOptions.clientId),this.includeRedirectUri?t.addRedirectUri(e.redirectUri):Cs.validateRedirectUri(e.redirectUri),t.addScopes(e.scopes,!0,this.oidcDefaultScopes),t.addAuthorizationCode(e.code),t.addLibraryInfo(this.config.libraryInfo),t.addApplicationTelemetry(this.config.telemetry.application),t.addThrottling(),this.serverTelemetryManager&&!Dt(this.config)&&t.addServerTelemetry(this.serverTelemetryManager),e.codeVerifier&&t.addCodeVerifier(e.codeVerifier),this.config.clientCredentials.clientSecret&&t.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const i=this.config.clientCredentials.clientAssertion;t.addClientAssertion(await Ds(i.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),t.addClientAssertionType(i.assertionType)}if(t.addGrantType(s.$x.AUTHORIZATION_CODE_GRANT),t.addClientInfo(),e.authenticationScheme===s.IO.POP){const i=new Es(this.cryptoUtils,this.performanceClient);let n;n=e.popKid?this.cryptoUtils.encodeKid(e.popKid):(await Ln(i.generateCnf.bind(i),Si,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,t.addPopToken(n)}else if(e.authenticationScheme===s.IO.SSH){if(!e.sshJwk)throw Xe(He);t.addSshJwk(e.sshJwk)}const i=e.correlationId||this.config.cryptoInterface.createNewGuid();let n;if(t.addCorrelationId(i),(!Ze.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&t.addClaims(e.claims,this.config.authOptions.clientCapabilities),e.clientInfo)try{const t=Je(e.clientInfo,this.cryptoUtils.base64Decode);n={credential:`${t.uid}${s.LR.CLIENT_INFO_SEPARATOR}${t.utid}`,type:qn}}catch(e){this.logger.verbose("Could not parse client info for CCS Header: "+e)}else n=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&n)switch(n.type){case qn:try{const e=et(n.credential);t.addCcsOid(e)}catch(e){this.logger.verbose("Could not parse home account ID for CCS Header: "+e)}break;case Xn:t.addCcsUpn(n.credential)}return e.tokenBodyParameters&&t.addExtraQueryParameters(e.tokenBodyParameters),!e.enableSpaAuthorizationCode||e.tokenBodyParameters&&e.tokenBodyParameters[vs]||t.addExtraQueryParameters({[vs]:"1"}),t.createQueryString()}async createAuthCodeUrlQueryString(e){this.performanceClient?.addQueueMeasurement(wi,e.correlationId);const t=new ws;t.addClientId(e.extraQueryParameters?.[gs]||this.config.authOptions.clientId);const i=[...e.scopes||[],...e.extraScopesToConsent||[]];t.addScopes(i,!0,this.oidcDefaultScopes),t.addRedirectUri(e.redirectUri);const n=e.correlationId||this.config.cryptoInterface.createNewGuid();if(t.addCorrelationId(n),t.addResponseMode(e.responseMode),t.addResponseTypeCode(),t.addLibraryInfo(this.config.libraryInfo),Dt(this.config)||t.addApplicationTelemetry(this.config.telemetry.application),t.addClientInfo(),e.codeChallenge&&e.codeChallengeMethod&&t.addCodeChallengeParams(e.codeChallenge,e.codeChallengeMethod),e.prompt&&t.addPrompt(e.prompt),e.domainHint&&t.addDomainHint(e.domainHint),e.prompt!==s._M.SELECT_ACCOUNT)if(e.sid&&e.prompt===s._M.NONE)this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),t.addSid(e.sid);else if(e.account){const i=this.extractAccountSid(e.account);let n=this.extractLoginHint(e.account);if(n&&e.domainHint&&(this.logger.warning('AuthorizationCodeClient.createAuthCodeUrlQueryString: "domainHint" param is set, skipping opaque "login_hint" claim. Please consider not passing domainHint'),n=null),n){this.logger.verbose("createAuthCodeUrlQueryString: login_hint claim present on account"),t.addLoginHint(n);try{const i=et(e.account.homeAccountId);t.addCcsOid(i)}catch(e){this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(i&&e.prompt===s._M.NONE){this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),t.addSid(i);try{const i=et(e.account.homeAccountId);t.addCcsOid(i)}catch(e){this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(e.loginHint)this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from request"),t.addLoginHint(e.loginHint),t.addCcsUpn(e.loginHint);else if(e.account.username){this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),t.addLoginHint(e.account.username);try{const i=et(e.account.homeAccountId);t.addCcsOid(i)}catch(e){this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}}else e.loginHint&&(this.logger.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request"),t.addLoginHint(e.loginHint),t.addCcsUpn(e.loginHint));else this.logger.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");if(e.nonce&&t.addNonce(e.nonce),e.state&&t.addState(e.state),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&t.addClaims(e.claims,this.config.authOptions.clientCapabilities),this.addExtraQueryParams(e,t),e.nativeBroker&&(t.addNativeBroker(),e.authenticationScheme===s.IO.POP)){const i=new Es(this.cryptoUtils);let n;n=e.popKid?this.cryptoUtils.encodeKid(e.popKid):(await Ln(i.generateCnf.bind(i),Si,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,t.addPopToken(n)}return t.createQueryString()}createLogoutUrlQueryString(e){const t=new ws;return e.postLogoutRedirectUri&&t.addPostLogoutRedirectUri(e.postLogoutRedirectUri),e.correlationId&&t.addCorrelationId(e.correlationId),e.idTokenHint&&t.addIdTokenHint(e.idTokenHint),e.state&&t.addState(e.state),e.logoutHint&&t.addLogoutHint(e.logoutHint),this.addExtraQueryParams(e,t),t.createQueryString()}addExtraQueryParams(e,t){!(e.extraQueryParameters&&e.extraQueryParameters.hasOwnProperty("instance_aware"))&&this.config.authOptions.instanceAware&&(e.extraQueryParameters=e.extraQueryParameters||{},e.extraQueryParameters.instance_aware="true"),e.extraQueryParameters&&t.addExtraQueryParameters(e.extraQueryParameters)}extractAccountSid(e){return e.idTokenClaims?.sid||null}extractLoginHint(e){return e.idTokenClaims?.login_hint||null}}class Rs{constructor(e,t){this.cacheOutcome=s.Rv.NOT_APPLICABLE,this.cacheManager=t,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||s.YM.EMPTY_STRING,this.wrapperVer=e.wrapperVer||s.YM.EMPTY_STRING,this.telemetryCacheKey=s.gT.CACHE_KEY+s.LR.CACHE_KEY_SEPARATOR+e.clientId}generateCurrentRequestHeaderValue(){const e=`${this.apiId}${s.gT.VALUE_SEPARATOR}${this.cacheOutcome}`,t=[this.wrapperSKU,this.wrapperVer],i=this.getNativeBrokerErrorCode();i?.length&&t.push(`broker_error=${i}`);const n=t.join(s.gT.VALUE_SEPARATOR),r=[e,this.getRegionDiscoveryFields()].join(s.gT.VALUE_SEPARATOR);return[s.gT.SCHEMA_VERSION,r,n].join(s.gT.CATEGORY_SEPARATOR)}generateLastRequestHeaderValue(){const e=this.getLastRequests(),t=Rs.maxErrorsToSend(e),i=e.failedRequests.slice(0,2*t).join(s.gT.VALUE_SEPARATOR),n=e.errors.slice(0,t).join(s.gT.VALUE_SEPARATOR),r=e.errors.length,o=[r,t<r?s.gT.OVERFLOW_TRUE:s.gT.OVERFLOW_FALSE].join(s.gT.VALUE_SEPARATOR);return[s.gT.SCHEMA_VERSION,e.cacheHits,i,n,o].join(s.gT.CATEGORY_SEPARATOR)}cacheFailedRequest(e){const t=this.getLastRequests();t.errors.length>=s.gT.MAX_CACHED_ERRORS&&(t.failedRequests.shift(),t.failedRequests.shift(),t.errors.shift()),t.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof l.lR?e.subError?t.errors.push(e.subError):e.errorCode?t.errors.push(e.errorCode):t.errors.push(e.toString()):t.errors.push(e.toString()):t.errors.push(s.gT.UNKNOWN_ERROR),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t)}incrementCacheHits(){const e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e),e.cacheHits}getLastRequests(){return this.cacheManager.getServerTelemetry(this.telemetryCacheKey)||{failedRequests:[],errors:[],cacheHits:0}}clearTelemetryCache(){const e=this.getLastRequests(),t=Rs.maxErrorsToSend(e);if(t===e.errors.length)this.cacheManager.removeItem(this.telemetryCacheKey);else{const i={failedRequests:e.failedRequests.slice(2*t),errors:e.errors.slice(t),cacheHits:0};this.cacheManager.setServerTelemetry(this.telemetryCacheKey,i)}}static maxErrorsToSend(e){let t,i=0,n=0;const r=e.errors.length;for(t=0;t<r;t++){const r=e.failedRequests[2*t]||s.YM.EMPTY_STRING,o=e.failedRequests[2*t+1]||s.YM.EMPTY_STRING,a=e.errors[t]||s.YM.EMPTY_STRING;if(n+=r.toString().length+o.toString().length+a.length+3,!(n<s.gT.MAX_LAST_HEADER_BYTES))break;i+=1}return i}getRegionDiscoveryFields(){const e=[];return e.push(this.regionUsed||s.YM.EMPTY_STRING),e.push(this.regionSource||s.YM.EMPTY_STRING),e.push(this.regionOutcome||s.YM.EMPTY_STRING),e.join(",")}updateRegionDiscoveryMetadata(e){this.regionUsed=e.region_used,this.regionSource=e.region_source,this.regionOutcome=e.region_outcome}setCacheOutcome(e){this.cacheOutcome=e}setNativeBrokerErrorCode(e){const t=this.getLastRequests();t.nativeBrokerErrorCode=e,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t)}getNativeBrokerErrorCode(){return this.getLastRequests().nativeBrokerErrorCode}clearNativeBrokerErrorCode(){const e=this.getLastRequests();delete e.nativeBrokerErrorCode,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e)}static makeExtraSkuString(e){return function(e){const{skus:t,libraryName:i,libraryVersion:n,extensionName:s,extensionVersion:r}=e,o=new Map([[0,[i,n]],[2,[s,r]]]);let a=[];if(t?.length){if(a=t.split(","),a.length<4)return t}else a=Array.from({length:4},()=>"|");return o.forEach((e,t)=>{2===e.length&&e[0]?.length&&e[1]?.length&&function(e){const{skuArr:t,index:i,skuName:n,skuVersion:s}=e;i>=t.length||(t[i]=[n,s].join("|"))}({skuArr:a,index:t,skuName:e[0],skuVersion:e[1]})}),a.join(",")}(e)}}class ks{constructor(e,t,i,n,s,r,o,a,l){this.config=e,this.browserStorage=t,this.browserCrypto=i,this.networkClient=this.config.system.networkClient,this.eventHandler=s,this.navigationClient=r,this.nativeMessageHandler=a,this.correlationId=l||An(),this.logger=n.clone(Zi.Q1.MSAL_SKU,nn,this.correlationId),this.performanceClient=o}async clearCacheOnLogout(e){if(e){rt.accountInfoIsEqual(e,this.browserStorage.getActiveAccount(),!1)&&(this.logger.verbose("Setting active account to null"),this.browserStorage.setActiveAccount(null));try{await this.browserStorage.removeAccount(rt.generateAccountCacheKey(e)),this.logger.verbose("Cleared cache items belonging to the account provided in the logout request.")}catch(e){this.logger.error("Account provided in logout request was not found. Local cache unchanged.")}}else try{this.logger.verbose("No account provided in logout request, clearing all cache items.",this.correlationId),await this.browserStorage.clear(),await this.browserCrypto.clearKeystore()}catch(e){this.logger.error("Attempted to clear all MSAL cache items and failed. Local cache unchanged.")}}getRedirectUri(e){this.logger.verbose("getRedirectUri called");const t=e||this.config.auth.redirectUri||ns();return lt.getAbsoluteUrl(t,ns())}initializeServerTelemetryManager(e,t){this.logger.verbose("initializeServerTelemetryManager called");const i={clientId:this.config.auth.clientId,correlationId:this.correlationId,apiId:e,forceRefresh:t||!1,wrapperSKU:this.browserStorage.getWrapperMetadata()[0],wrapperVer:this.browserStorage.getWrapperMetadata()[1]};return new Rs(i,this.browserStorage)}async getDiscoveredAuthority(e){const{account:t}=e,i=e.requestExtraQueryParameters&&e.requestExtraQueryParameters.hasOwnProperty("instance_aware")?e.requestExtraQueryParameters.instance_aware:void 0;this.performanceClient.addQueueMeasurement(Ut,this.correlationId);const n={protocolMode:this.config.auth.protocolMode,OIDCOptions:this.config.auth.OIDCOptions,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},s=e.requestAuthority||this.config.auth.authority,r=i?.length?"true"===i:this.config.auth.instanceAware,o=t&&r?this.config.auth.authority.replace(lt.getDomainFromUrl(s),t.environment):s,a=On.generateAuthority(o,e.requestAzureCloudOptions||this.config.auth.azureCloudOptions),l=await Ln(Ss,Mi,this.logger,this.performanceClient,this.correlationId)(a,this.config.system.networkClient,this.browserStorage,n,this.logger,this.correlationId,this.performanceClient);if(t&&!l.isAlias(t.environment))throw Xe(Ke);return l}}async function Ps(e,t,i){e.addQueueMeasurement(zi,i);const n=_n(_s,Wi,t,e,i)(e,t,i);return{verifier:n,challenge:await Ln(Ls,ji,t,e,i)(n,e,t,i)}}function _s(e,t,i){try{const n=new Uint8Array(32);return _n(xn,Ki,t,e,i)(n),pn(n)}catch(e){throw(0,Ji.bD)(en.p5)}}async function Ls(e,t,i,n){t.addQueueMeasurement(ji,n);try{const s=await Ln(Sn,$i,i,t,n)(e,t,n);return pn(new Uint8Array(s))}catch(e){throw(0,Ji.bD)(en.p5)}}async function Ns(e,t,i,n){i.addQueueMeasurement(ii,e.correlationId);const r=e.authority||t.auth.authority,o=[...e&&e.scopes||[]],a={...e,correlationId:e.correlationId,authority:r,scopes:o};if(a.authenticationScheme){if(a.authenticationScheme===s.IO.SSH){if(!e.sshJwk)throw Xe(He);if(!e.sshKid)throw Xe(Ue)}n.verbose(`Authentication Scheme set to "${a.authenticationScheme}" as configured in Auth request`)}else a.authenticationScheme=s.IO.BEARER,n.verbose('Authentication Scheme wasn\'t explicitly set in request, defaulting to "Bearer" request');return t.cache.claimsBasedCachingEnabled&&e.claims&&!Ze.isEmptyObj(e.claims)&&(a.requestedClaimsHash=await Tn(e.claims)),a}async function Os(e,t,i,n,s){n.addQueueMeasurement(ni,e.correlationId);const r=await Ln(Ns,ii,s,n,e.correlationId)(e,i,n,s);return{...e,...r,account:t,forceRefresh:e.forceRefresh||!1}}class Fs extends ks{async initializeAuthorizationCodeRequest(e){this.performanceClient.addQueueMeasurement(pi,this.correlationId);const t=await Ln(Ps,zi,this.logger,this.performanceClient,this.correlationId)(this.performanceClient,this.logger,this.correlationId),i={...e,redirectUri:e.redirectUri,code:s.YM.EMPTY_STRING,codeVerifier:t.verifier};return e.codeChallenge=t.challenge,e.codeChallengeMethod=s.YM.S256_CODE_CHALLENGE_METHOD,i}initializeLogoutRequest(e){this.logger.verbose("initializeLogoutRequest called",e?.correlationId);const t={correlationId:this.correlationId||An(),...e};if(e)if(e.logoutHint)this.logger.verbose("logoutHint has already been set in logoutRequest");else if(e.account){const i=this.getLogoutHintFromIdTokenClaims(e.account);i&&(this.logger.verbose("Setting logoutHint to login_hint ID Token Claim value for the account provided"),t.logoutHint=i)}else this.logger.verbose("logoutHint was not set and account was not passed into logout request, logoutHint will not be set");else this.logger.verbose("logoutHint will not be set since no logout request was configured");return e&&null===e.postLogoutRedirectUri?this.logger.verbose("postLogoutRedirectUri passed as null, not setting post logout redirect uri",t.correlationId):e&&e.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to uri set on logout request",t.correlationId),t.postLogoutRedirectUri=lt.getAbsoluteUrl(e.postLogoutRedirectUri,ns())):null===this.config.auth.postLogoutRedirectUri?this.logger.verbose("postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect",t.correlationId):this.config.auth.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to configured uri",t.correlationId),t.postLogoutRedirectUri=lt.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,ns())):(this.logger.verbose("Setting postLogoutRedirectUri to current page",t.correlationId),t.postLogoutRedirectUri=lt.getAbsoluteUrl(ns(),ns())),t}getLogoutHintFromIdTokenClaims(e){const t=e.idTokenClaims;if(t){if(t.login_hint)return t.login_hint;this.logger.verbose("The ID Token Claims tied to the provided account do not contain a login_hint claim, logoutHint will not be added to logout request")}else this.logger.verbose("The provided account does not contain ID Token Claims, logoutHint will not be added to logout request");return null}async createAuthCodeClient(e){this.performanceClient.addQueueMeasurement(hi,this.correlationId);const t=await Ln(this.getClientConfiguration.bind(this),ui,this.logger,this.performanceClient,this.correlationId)(e);return new Is(t,this.performanceClient)}async getClientConfiguration(e){const{serverTelemetryManager:t,requestAuthority:i,requestAzureCloudOptions:n,requestExtraQueryParameters:r,account:o}=e;this.performanceClient.addQueueMeasurement(ui,this.correlationId);const a=await Ln(this.getDiscoveredAuthority.bind(this),Ut,this.logger,this.performanceClient,this.correlationId)({requestAuthority:i,requestAzureCloudOptions:n,requestExtraQueryParameters:r,account:o}),l=this.config.system.loggerOptions;return{authOptions:{clientId:this.config.auth.clientId,authority:a,clientCapabilities:this.config.auth.clientCapabilities},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:l.loggerCallback,piiLoggingEnabled:l.piiLoggingEnabled,logLevel:l.logLevel,correlationId:this.correlationId},cacheOptions:{claimsBasedCachingEnabled:this.config.cache.claimsBasedCachingEnabled},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:t,libraryInfo:{sku:Zi.Q1.MSAL_SKU,version:nn,cpu:s.YM.EMPTY_STRING,os:s.YM.EMPTY_STRING},telemetry:this.config.telemetry}}async initializeAuthorizationRequest(e,t){this.performanceClient.addQueueMeasurement(di,this.correlationId);const i=this.getRedirectUri(e.redirectUri),n={interactionType:t},r=Yn.setRequestState(this.browserCrypto,e&&e.state||s.YM.EMPTY_STRING,n),o={...await Ln(Ns,ii,this.logger,this.performanceClient,this.correlationId)({...e,correlationId:this.correlationId},this.config,this.performanceClient,this.logger),redirectUri:i,state:r,nonce:e.nonce||An(),responseMode:this.config.auth.OIDCOptions.serverResponseType},a=e.account||this.browserStorage.getActiveAccount();if(a&&(this.logger.verbose("Setting validated request account",this.correlationId),this.logger.verbosePii(`Setting validated request account: ${a.homeAccountId}`,this.correlationId),o.account=a),!o.loginHint&&!a){const e=this.browserStorage.getLegacyLoginHint();e&&(o.loginHint=e)}return o}}var Gs=i(5841);const Bs="user_switch",Vs={[Bs]:"User attempted to switch accounts in the native broker, which is not allowed. All new accounts must sign-in through the standard web flow first, please try again."};class Hs extends l.lR{constructor(e,t,i){super(e,t),Object.setPrototypeOf(this,Hs.prototype),this.name="NativeAuthError",this.ext=i}}function Us(e){return!(!e.ext||!e.ext.status||"PERSISTENT_ERROR"!==e.ext.status&&"DISABLED"!==e.ext.status)||!(!e.ext||!e.ext.error||-2147186943!==e.ext.error)||"ContentError"===e.errorCode}function zs(e,t,i){if(i&&i.status)switch(i.status){case"ACCOUNT_UNAVAILABLE":return Kn(Bn);case"USER_INTERACTION_REQUIRED":return new jn(e,t);case"USER_CANCEL":return(0,Ji.bD)(en.fN);case"NO_NETWORK":return(0,Ji.bD)(en.l7)}return new Hs(e,Vs[e]||t,i)}class Ws extends xs{constructor(e,t){super(e,t)}async acquireToken(e){this.performanceClient?.addQueueMeasurement(Yt,e.correlationId);const t=ae(),i=await Ln(this.executeTokenRequest.bind(this),Kt,this.logger,this.performanceClient,e.correlationId)(e,this.authority),n=i.headers?.[s.OK.X_MS_REQUEST_ID],r=new Ms(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin);return r.validateTokenResponse(i.body),Ln(r.handleServerTokenResponse.bind(r),Ei,this.logger,this.performanceClient,e.correlationId)(i.body,this.authority,t,e,void 0,void 0,!0,e.forceCache,n)}async acquireTokenByRefreshToken(e){if(!e)throw Xe(Le);if(this.performanceClient?.addQueueMeasurement(Xt,e.correlationId),!e.account)throw te(_);if(this.cacheManager.isAppMetadataFOCI(e.account.environment))try{return await Ln(this.acquireTokenWithCachedRefreshToken.bind(this),qt,this.logger,this.performanceClient,e.correlationId)(e,!0)}catch(t){const i=t instanceof jn&&t.errorCode===Gn,n=t instanceof us&&t.errorCode===s.I.INVALID_GRANT_ERROR&&t.subError===s.I.CLIENT_MISMATCH_ERROR;if(i||n)return Ln(this.acquireTokenWithCachedRefreshToken.bind(this),qt,this.logger,this.performanceClient,e.correlationId)(e,!1);throw t}return Ln(this.acquireTokenWithCachedRefreshToken.bind(this),qt,this.logger,this.performanceClient,e.correlationId)(e,!1)}async acquireTokenWithCachedRefreshToken(e,t){this.performanceClient?.addQueueMeasurement(qt,e.correlationId);const i=_n(this.cacheManager.getRefreshToken.bind(this.cacheManager),Ui,this.logger,this.performanceClient,e.correlationId)(e.account,t,void 0,this.performanceClient,e.correlationId);if(!i)throw Kn(Gn);if(i.expiresOn&&le(i.expiresOn,e.refreshTokenExpirationOffsetSeconds||300))throw Kn(Vn);const n={...e,refreshToken:i.secret,authenticationScheme:e.authenticationScheme||s.IO.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:qn}};try{return await Ln(this.acquireToken.bind(this),Yt,this.logger,this.performanceClient,e.correlationId)(n)}catch(e){if(e instanceof jn&&e.subError===Hn){this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache");const e=ce(i);this.cacheManager.removeRefreshToken(e)}throw e}}async executeTokenRequest(e,t){this.performanceClient?.addQueueMeasurement(Kt,e.correlationId);const i=this.createTokenQueryParameters(e),n=lt.appendQueryString(t.tokenEndpoint,i),s=await Ln(this.createTokenRequestBody.bind(this),Zt,this.logger,this.performanceClient,e.correlationId)(e),r=this.createTokenRequestHeaders(e.ccsCredential),o={clientId:e.tokenBodyParameters?.clientId||this.config.authOptions.clientId,authority:t.canonicalAuthority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid};return Ln(this.executePostToTokenEndpoint.bind(this),jt,this.logger,this.performanceClient,e.correlationId)(n,s,r,o,e.correlationId,jt)}async createTokenRequestBody(e){this.performanceClient?.addQueueMeasurement(Zt,e.correlationId);const t=e.correlationId,i=new ws;if(i.addClientId(e.tokenBodyParameters?.[gs]||this.config.authOptions.clientId),e.redirectUri&&i.addRedirectUri(e.redirectUri),i.addScopes(e.scopes,!0,this.config.authOptions.authority.options.OIDCOptions?.defaultScopes),i.addGrantType(s.$x.REFRESH_TOKEN_GRANT),i.addClientInfo(),i.addLibraryInfo(this.config.libraryInfo),i.addApplicationTelemetry(this.config.telemetry.application),i.addThrottling(),this.serverTelemetryManager&&!Dt(this.config)&&i.addServerTelemetry(this.serverTelemetryManager),i.addCorrelationId(t),i.addRefreshToken(e.refreshToken),this.config.clientCredentials.clientSecret&&i.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const t=this.config.clientCredentials.clientAssertion;i.addClientAssertion(await Ds(t.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),i.addClientAssertionType(t.assertionType)}if(e.authenticationScheme===s.IO.POP){const t=new Es(this.cryptoUtils,this.performanceClient);let n;n=e.popKid?this.cryptoUtils.encodeKid(e.popKid):(await Ln(t.generateCnf.bind(t),Si,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,i.addPopToken(n)}else if(e.authenticationScheme===s.IO.SSH){if(!e.sshJwk)throw Xe(He);i.addSshJwk(e.sshJwk)}if((!Ze.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&i.addClaims(e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case qn:try{const t=et(e.ccsCredential.credential);i.addCcsOid(t)}catch(e){this.logger.verbose("Could not parse home account ID for CCS Header: "+e)}break;case Xn:i.addCcsUpn(e.ccsCredential.credential)}return e.tokenBodyParameters&&i.addExtraQueryParameters(e.tokenBodyParameters),i.createQueryString()}}class js extends xs{constructor(e,t){super(e,t)}async acquireToken(e){try{const[t,i]=await this.acquireCachedToken({...e,scopes:e.scopes?.length?e.scopes:[...s.aZ]});return i===s.Rv.PROACTIVELY_REFRESHED&&(this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'. It's not expired, but must be refreshed."),new Ws(this.config,this.performanceClient).acquireTokenByRefreshToken(e).catch(()=>{})),t}catch(t){if(t instanceof ee&&t.errorCode===H)return new Ws(this.config,this.performanceClient).acquireTokenByRefreshToken(e);throw t}}async acquireCachedToken(e){this.performanceClient?.addQueueMeasurement(Jt,e.correlationId);let t=s.Rv.NOT_APPLICABLE;if(e.forceRefresh||!this.config.cacheOptions.claimsBasedCachingEnabled&&!Ze.isEmptyObj(e.claims))throw this.setCacheOutcome(s.Rv.FORCE_REFRESH_OR_CLAIMS,e.correlationId),te(H);if(!e.account)throw te(_);const i=e.account.tenantId||function(e){const t=new lt(e).getUrlComponents(),i=t.PathSegments.slice(-1)[0]?.toLowerCase();switch(i){case s.v2.COMMON:case s.v2.ORGANIZATIONS:case s.v2.CONSUMERS:return;default:return i}}(e.authority),n=this.cacheManager.getTokenKeys(),r=this.cacheManager.getAccessToken(e.account,e,n,i,this.performanceClient,e.correlationId);if(!r)throw this.setCacheOutcome(s.Rv.NO_CACHED_ACCESS_TOKEN,e.correlationId),te(H);if(o=r.cachedAt,Number(o)>ae()||le(r.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(s.Rv.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),te(H);var o;r.refreshOn&&le(r.refreshOn,0)&&(t=s.Rv.PROACTIVELY_REFRESHED);const a=e.authority||this.authority.getPreferredCache(),l={account:this.cacheManager.readAccountFromCache(e.account),accessToken:r,idToken:this.cacheManager.getIdToken(e.account,n,i,this.performanceClient,e.correlationId),refreshToken:null,appMetadata:this.cacheManager.readAppMetadataFromCache(a)};return this.setCacheOutcome(t,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await Ln(this.generateResultFromCacheRecord.bind(this),ei,this.logger,this.performanceClient,e.correlationId)(l,e),t]}setCacheOutcome(e,t){this.serverTelemetryManager?.setCacheOutcome(e),this.performanceClient?.addFields({cacheOutcome:e},t),e!==s.Rv.NOT_APPLICABLE&&this.logger.info(`Token refresh is required due to cache outcome: ${e}`)}async generateResultFromCacheRecord(e,t){let i;if(this.performanceClient?.addQueueMeasurement(ei,t.correlationId),e.idToken&&(i=re(e.idToken.secret,this.config.cryptoInterface.base64Decode)),t.maxAge||0===t.maxAge){const e=i?.auth_time;if(!e)throw te(w);oe(e,t.maxAge)}return Ms.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,t,i)}}class $s extends Fs{async acquireToken(e){this.performanceClient.addQueueMeasurement(Gt,e.correlationId);const t=this.initializeServerTelemetryManager(Zi.sA.acquireTokenSilent_silentFlow),i=await Ln(this.getClientConfiguration.bind(this),ui,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:t,requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,account:e.account}),n=new js(i,this.performanceClient);this.logger.verbose("Silent auth client created");try{const t=(await Ln(n.acquireCachedToken.bind(n),Jt,this.logger,this.performanceClient,e.correlationId)(e))[0];return this.performanceClient.addFields({fromCache:!0},e.correlationId),t}catch(e){throw e instanceof Ji.jT&&e.errorCode===en.e0&&this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair."),e}}logout(e){this.logger.verbose("logoutRedirect called");const t=this.initializeLogoutRequest(e);return this.clearCacheOnLogout(t?.account)}}const Ks="brk_redirect_uri";class Ys extends ks{constructor(e,t,i,n,s,r,o,a,l,c,h,u){super(e,t,i,n,s,r,a,l,u),this.apiId=o,this.accountId=c,this.nativeMessageHandler=l,this.nativeStorageManager=h,this.silentCacheClient=new $s(e,this.nativeStorageManager,i,n,s,r,a,l,u),this.serverTelemetryManager=this.initializeServerTelemetryManager(this.apiId);const d=this.nativeMessageHandler.getExtensionId()===Zi.JD.PREFERRED_EXTENSION_ID?"chrome":this.nativeMessageHandler.getExtensionId()?.length?"unknown":void 0;this.skus=Rs.makeExtraSkuString({libraryName:Zi.Q1.MSAL_SKU,libraryVersion:nn,extensionName:d,extensionVersion:this.nativeMessageHandler.getExtensionVersion()})}addRequestSKUs(e){e.extraParameters={...e.extraParameters,[bs]:this.skus}}async acquireToken(e){this.performanceClient.addQueueMeasurement(Wt,e.correlationId),this.logger.trace("NativeInteractionClient - acquireToken called.");const t=this.performanceClient.startMeasurement(Wt,e.correlationId),i=ae();try{const n=await this.initializeNativeRequest(e);try{const e=await this.acquireTokensFromCache(this.accountId,n);return t.end({success:!0,isNativeBroker:!1,fromCache:!0}),e}catch(e){this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call")}const{...s}=n,r={method:Zi.Ct.GetToken,request:s},o=await this.nativeMessageHandler.sendMessage(r),a=this.validateNativeResponse(o);return await this.handleNativeResponse(a,n,i).then(e=>(t.end({success:!0,isNativeBroker:!0,requestId:e.requestId}),this.serverTelemetryManager.clearNativeBrokerErrorCode(),e)).catch(e=>{throw t.end({success:!1,errorCode:e.errorCode,subErrorCode:e.subError,isNativeBroker:!0}),e})}catch(e){throw e instanceof Hs&&this.serverTelemetryManager.setNativeBrokerErrorCode(e.errorCode),e}}createSilentCacheRequest(e,t){return{authority:e.authority,correlationId:this.correlationId,scopes:Qe.fromString(e.scope).asArray(),account:t,forceRefresh:!1}}async acquireTokensFromCache(e,t){if(!e)throw this.logger.warning("NativeInteractionClient:acquireTokensFromCache - No nativeAccountId provided"),te(O);const i=this.browserStorage.getBaseAccountInfo({nativeAccountId:e});if(!i)throw te(O);try{const e=this.createSilentCacheRequest(t,i),n=await this.silentCacheClient.acquireToken(e),s={...i,idTokenClaims:n?.idTokenClaims,idToken:n?.idToken};return{...n,account:s}}catch(e){throw e}}async acquireTokenRedirect(e,t){this.logger.trace("NativeInteractionClient - acquireTokenRedirect called.");const{...i}=e;delete i.onRedirectNavigate;const n=await this.initializeNativeRequest(i),s={method:Zi.Ct.GetToken,request:n};try{const e=await this.nativeMessageHandler.sendMessage(s);this.validateNativeResponse(e)}catch(e){if(e instanceof Hs&&(this.serverTelemetryManager.setNativeBrokerErrorCode(e.errorCode),Us(e)))throw e}this.browserStorage.setTemporaryCache(Zi._p.NATIVE_REQUEST,JSON.stringify(n),!0);const r={apiId:Zi.sA.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},o=this.config.auth.navigateToLoginRequestUrl?window.location.href:this.getRedirectUri(e.redirectUri);t.end({success:!0}),await this.navigationClient.navigateExternal(o,r)}async handleRedirectPromise(e,t){if(this.logger.trace("NativeInteractionClient - handleRedirectPromise called."),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;const i=this.browserStorage.getCachedNativeRequest();if(!i)return this.logger.verbose("NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null."),e&&t&&e?.addFields({errorCode:"no_cached_request"},t),null;const{prompt:n,...s}=i;n&&this.logger.verbose("NativeInteractionClient - handleRedirectPromise called and prompt was included in the original request, removing prompt from cached request to prevent second interaction with native broker window."),this.browserStorage.removeItem(this.browserStorage.generateCacheKey(Zi._p.NATIVE_REQUEST));const r={method:Zi.Ct.GetToken,request:s},o=ae();try{this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker.");const e=await this.nativeMessageHandler.sendMessage(r);this.validateNativeResponse(e);const t=this.handleNativeResponse(e,s,o);this.browserStorage.setInteractionInProgress(!1);const i=await t;return this.serverTelemetryManager.clearNativeBrokerErrorCode(),i}catch(e){throw this.browserStorage.setInteractionInProgress(!1),e}}logout(){return this.logger.trace("NativeInteractionClient - logout called."),Promise.reject("Logout not implemented yet")}async handleNativeResponse(e,t,i){this.logger.trace("NativeInteractionClient - handleNativeResponse called.");const n=re(e.id_token,mn),s=this.createHomeAccountIdentifier(e,n),r=this.browserStorage.getAccountInfoFilteredBy({nativeAccountId:t.accountId})?.homeAccountId;if(s!==r&&e.account.id!==t.accountId)throw zs(Bs);const o=await this.getDiscoveredAuthority({requestAuthority:t.authority}),a=Ts(this.browserStorage,o,s,mn,n,e.client_info,void 0,n.tid,void 0,e.account.id,this.logger),l=await this.generateAuthenticationResult(e,t,n,a,o.canonicalAuthority,i);return this.cacheAccount(a),this.cacheNativeTokens(e,t,s,n,e.access_token,l.tenantId,i),l}createHomeAccountIdentifier(e,t){return rt.generateHomeAccountId(e.client_info||s.YM.EMPTY_STRING,0,this.logger,this.browserCrypto,t)}generateScopes(e,t){return e.scope?Qe.fromString(e.scope):Qe.fromString(t.scope)}async generatePopAccessToken(e,t){if(t.tokenType===s.IO.POP&&t.signPopToken){if(e.shr)return this.logger.trace("handleNativeServerResponse: SHR is enabled in native layer"),e.shr;const i=new Es(this.browserCrypto),n={resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,shrNonce:t.shrNonce};if(!t.keyId)throw te(K);return i.signPopToken(e.access_token,t.keyId,n)}return e.access_token}async generateAuthenticationResult(e,t,i,n,r,o){const a=this.addTelemetryFromNativeResponse(e),l=e.scope?Qe.fromString(e.scope):Qe.fromString(t.scope),c=e.account.properties||{},h=c.UID||i.oid||i.sub||s.YM.EMPTY_STRING,u=c.TenantId||i.tid||s.YM.EMPTY_STRING,d=nt(n.getAccountInfo(),void 0,i,e.id_token);d.nativeAccountId!==e.account.id&&(d.nativeAccountId=e.account.id);const p=await this.generatePopAccessToken(e,t),g=t.tokenType===s.IO.POP?s.IO.POP:s.IO.BEARER;return{authority:r,uniqueId:h,tenantId:u,scopes:l.asArray(),account:d,idToken:e.id_token,idTokenClaims:i,accessToken:p,fromCache:!!a&&this.isResponseFromCache(a),expiresOn:new Date(1e3*Number(o+e.expires_in)),tokenType:g,correlationId:this.correlationId,state:e.state,fromNativeBroker:!0}}cacheAccount(e){this.browserStorage.setAccount(e),this.browserStorage.removeAccountContext(e).catch(e=>{this.logger.error(`Error occurred while removing account context from browser storage. ${e}`)})}cacheNativeTokens(e,t,i,n,r,o,a){const l=he(i,t.authority,e.id_token||"",t.clientId,n.tid||""),c=a+(t.tokenType===s.IO.POP?s.YM.SHR_NONCE_VALIDITY:("string"==typeof e.expires_in?parseInt(e.expires_in,10):e.expires_in)||0),h=this.generateScopes(e,t),u={idToken:l,accessToken:ue(i,t.authority,r,t.clientId,n.tid||o,h.printScopes(),c,0,mn,void 0,t.tokenType,void 0,t.keyId)};this.nativeStorageManager.saveCacheRecord(u,t.storeInCache)}addTelemetryFromNativeResponse(e){const t=this.getMATSFromResponse(e);return t?(this.performanceClient.addFields({extensionId:this.nativeMessageHandler.getExtensionId(),extensionVersion:this.nativeMessageHandler.getExtensionVersion(),matsBrokerVersion:t.broker_version,matsAccountJoinOnStart:t.account_join_on_start,matsAccountJoinOnEnd:t.account_join_on_end,matsDeviceJoin:t.device_join,matsPromptBehavior:t.prompt_behavior,matsApiErrorCode:t.api_error_code,matsUiVisible:t.ui_visible,matsSilentCode:t.silent_code,matsSilentBiSubCode:t.silent_bi_sub_code,matsSilentMessage:t.silent_message,matsSilentStatus:t.silent_status,matsHttpStatus:t.http_status,matsHttpEventCount:t.http_event_count},this.correlationId),t):null}validateNativeResponse(e){if(e.hasOwnProperty("access_token")&&e.hasOwnProperty("id_token")&&e.hasOwnProperty("client_info")&&e.hasOwnProperty("account")&&e.hasOwnProperty("scope")&&e.hasOwnProperty("expires_in"))return e;throw(0,l.pz)(Gs.W,"Response missing expected properties.")}getMATSFromResponse(e){if(e.properties.MATS)try{return JSON.parse(e.properties.MATS)}catch(e){this.logger.error("NativeInteractionClient - Error parsing MATS telemetry, returning null instead")}return null}isResponseFromCache(e){return void 0===e.is_cached?(this.logger.verbose("NativeInteractionClient - MATS telemetry does not contain field indicating if response was served from cache. Returning false."),!1):!!e.is_cached}async initializeNativeRequest(e){this.logger.trace("NativeInteractionClient - initializeNativeRequest called");const t=e.authority||this.config.auth.authority;e.account&&await this.getDiscoveredAuthority({requestAuthority:t,requestAzureCloudOptions:e.azureCloudOptions,account:e.account});const i=new lt(t);i.validateAsUri();const{scopes:n,...r}=e,o=new Qe(n||[]);o.appendScopes(s.aZ);const a={...r,accountId:this.accountId,clientId:this.config.auth.clientId,authority:i.urlString,scope:o.printScopes(),redirectUri:this.getRedirectUri(e.redirectUri),prompt:(()=>{switch(this.apiId){case Zi.sA.ssoSilent:case Zi.sA.acquireTokenSilent_silentFlow:return this.logger.trace("initializeNativeRequest: silent request sets prompt to none"),s._M.NONE}if(e.prompt)switch(e.prompt){case s._M.NONE:case s._M.CONSENT:case s._M.LOGIN:return this.logger.trace("initializeNativeRequest: prompt is compatible with native flow"),e.prompt;default:throw this.logger.trace(`initializeNativeRequest: prompt = ${e.prompt} is not compatible with native flow`),(0,Ji.bD)(en.nF)}else this.logger.trace("initializeNativeRequest: prompt was not provided")})(),correlationId:this.correlationId,tokenType:e.authenticationScheme,windowTitleSubstring:document.title,extraParameters:{...e.extraQueryParameters,...e.tokenQueryParameters},extendedExpiryToken:!1,keyId:e.popKid};if(a.signPopToken&&e.popKid)throw(0,Ji.bD)(en.bT);if(this.handleExtraBrokerParams(a),a.extraParameters=a.extraParameters||{},a.extraParameters.telemetry=Zi.JD.MATS_TELEMETRY,e.authenticationScheme===s.IO.POP){const t={resourceRequestUri:e.resourceRequestUri,resourceRequestMethod:e.resourceRequestMethod,shrClaims:e.shrClaims,shrNonce:e.shrNonce},i=new Es(this.browserCrypto);let n;if(a.keyId)n=this.browserCrypto.base64UrlEncode(JSON.stringify({kid:a.keyId})),a.signPopToken=!1;else{const s=await Ln(i.generateCnf.bind(i),Si,this.logger,this.performanceClient,e.correlationId)(t,this.logger);n=s.reqCnfString,a.keyId=s.kid,a.signPopToken=!0}a.reqCnf=n}return this.addRequestSKUs(a),a}handleExtraBrokerParams(e){if(e.extraParameters&&e.extraParameters.hasOwnProperty("brk_client_id")&&e.extraParameters.hasOwnProperty(Ks)&&e.extraParameters.hasOwnProperty(gs)){const t=e.extraParameters[gs],i=e.redirectUri,n=e.extraParameters[Ks];e.extraParameters={child_client_id:t,child_redirect_uri:i},e.redirectUri=n}}}class qs{constructor(e,t,i,n){this.logger=e,this.handshakeTimeoutMs=t,this.extensionId=n,this.resolvers=new Map,this.handshakeResolvers=new Map,this.messageChannel=new MessageChannel,this.windowListener=this.onWindowMessage.bind(this),this.performanceClient=i,this.handshakeEvent=i.startMeasurement(Bi)}async sendMessage(e){this.logger.trace("NativeMessageHandler - sendMessage called.");const t={channel:Zi.JD.CHANNEL_ID,extensionId:this.extensionId,responseId:An(),body:e};return this.logger.trace("NativeMessageHandler - Sending request to browser extension"),this.logger.tracePii(`NativeMessageHandler - Sending request to browser extension: ${JSON.stringify(t)}`),this.messageChannel.port1.postMessage(t),new Promise((e,i)=>{this.resolvers.set(t.responseId,{resolve:e,reject:i})})}static async createProvider(e,t,i){e.trace("NativeMessageHandler - createProvider called.");try{const n=new qs(e,t,i,Zi.JD.PREFERRED_EXTENSION_ID);return await n.sendHandshakeRequest(),n}catch(n){const s=new qs(e,t,i);return await s.sendHandshakeRequest(),s}}async sendHandshakeRequest(){this.logger.trace("NativeMessageHandler - sendHandshakeRequest called."),window.addEventListener("message",this.windowListener,!1);const e={channel:Zi.JD.CHANNEL_ID,extensionId:this.extensionId,responseId:An(),body:{method:Zi.Ct.HandshakeRequest}};return this.handshakeEvent.add({extensionId:this.extensionId,extensionHandshakeTimeoutMs:this.handshakeTimeoutMs}),this.messageChannel.port1.onmessage=e=>{this.onChannelMessage(e)},window.postMessage(e,window.origin,[this.messageChannel.port2]),new Promise((t,i)=>{this.handshakeResolvers.set(e.responseId,{resolve:t,reject:i}),this.timeoutId=window.setTimeout(()=>{window.removeEventListener("message",this.windowListener,!1),this.messageChannel.port1.close(),this.messageChannel.port2.close(),this.handshakeEvent.end({extensionHandshakeTimedOut:!0,success:!1}),i((0,Ji.bD)(en.y3)),this.handshakeResolvers.delete(e.responseId)},this.handshakeTimeoutMs)})}onWindowMessage(e){if(this.logger.trace("NativeMessageHandler - onWindowMessage called"),e.source!==window)return;const t=e.data;if(t.channel&&t.channel===Zi.JD.CHANNEL_ID&&(!t.extensionId||t.extensionId===this.extensionId)&&t.body.method===Zi.Ct.HandshakeRequest){const e=this.handshakeResolvers.get(t.responseId);if(!e)return void this.logger.trace(`NativeMessageHandler.onWindowMessage - resolver can't be found for request ${t.responseId}`);this.logger.verbose(t.extensionId?`Extension with id: ${t.extensionId} not installed`:"No extension installed"),clearTimeout(this.timeoutId),this.messageChannel.port1.close(),this.messageChannel.port2.close(),window.removeEventListener("message",this.windowListener,!1),this.handshakeEvent.end({success:!1,extensionInstalled:!1}),e.reject((0,Ji.bD)(en.cq))}}onChannelMessage(e){this.logger.trace("NativeMessageHandler - onChannelMessage called.");const t=e.data,i=this.resolvers.get(t.responseId),n=this.handshakeResolvers.get(t.responseId);try{const e=t.body.method;if(e===Zi.Ct.Response){if(!i)return;const e=t.body.response;if(this.logger.trace("NativeMessageHandler - Received response from browser extension"),this.logger.tracePii(`NativeMessageHandler - Received response from browser extension: ${JSON.stringify(e)}`),"Success"!==e.status)i.reject(zs(e.code,e.description,e.ext));else{if(!e.result)throw(0,l.pz)(Gs.W,"Event does not contain result.");e.result.code&&e.result.description?i.reject(zs(e.result.code,e.result.description,e.result.ext)):i.resolve(e.result)}this.resolvers.delete(t.responseId)}else if(e===Zi.Ct.HandshakeResponse){if(!n)return void this.logger.trace(`NativeMessageHandler.onChannelMessage - resolver can't be found for request ${t.responseId}`);clearTimeout(this.timeoutId),window.removeEventListener("message",this.windowListener,!1),this.extensionId=t.extensionId,this.extensionVersion=t.body.version,this.logger.verbose(`NativeMessageHandler - Received HandshakeResponse from extension: ${this.extensionId}`),this.handshakeEvent.end({extensionInstalled:!0,success:!0}),n.resolve(),this.handshakeResolvers.delete(t.responseId)}}catch(t){this.logger.error("Error parsing response from WAM Extension"),this.logger.errorPii(`Error parsing response from WAM Extension: ${t}`),this.logger.errorPii(`Unable to parse ${e}`),i?i.reject(t):n&&n.reject(t)}}getExtensionId(){return this.extensionId}getExtensionVersion(){return this.extensionVersion}static isNativeAvailable(e,t,i,n){if(t.trace("isNativeAvailable called"),!e.system.allowNativeBroker)return t.trace("isNativeAvailable: allowNativeBroker is not enabled, returning false"),!1;if(!i)return t.trace("isNativeAvailable: WAM extension provider is not initialized, returning false"),!1;if(n)switch(n){case s.IO.BEARER:case s.IO.POP:return t.trace("isNativeAvailable: authenticationScheme is supported, returning true"),!0;default:return t.trace("isNativeAvailable: authenticationScheme is not supported, returning false"),!1}return!0}}class Xs{constructor(e,t,i,n,s){this.authModule=e,this.browserStorage=t,this.authCodeRequest=i,this.logger=n,this.performanceClient=s}async handleCodeResponse(e,t){let i;this.performanceClient.addQueueMeasurement(mi,t.correlationId);try{i=this.authModule.handleFragmentResponse(e,t.state)}catch(e){throw e instanceof us&&e.subError===en.fN?(0,Ji.bD)(en.fN):e}return Ln(this.handleCodeResponseFromServer.bind(this),fi,this.logger,this.performanceClient,t.correlationId)(i,t)}async handleCodeResponseFromServer(e,t,i=!0){if(this.performanceClient.addQueueMeasurement(fi,t.correlationId),this.logger.trace("InteractionHandler.handleCodeResponseFromServer called"),this.authCodeRequest.code=e.code,e.cloud_instance_host_name&&await Ln(this.authModule.updateAuthority.bind(this.authModule),yi,this.logger,this.performanceClient,t.correlationId)(e.cloud_instance_host_name,t.correlationId),i&&(e.nonce=t.nonce||void 0),e.state=t.state,e.client_info)this.authCodeRequest.clientInfo=e.client_info;else{const e=this.createCcsCredentials(t);e&&(this.authCodeRequest.ccsCredential=e)}return await Ln(this.authModule.acquireToken.bind(this.authModule),vi,this.logger,this.performanceClient,t.correlationId)(this.authCodeRequest,e)}createCcsCredentials(e){return e.account?{credential:e.account.homeAccountId,type:qn}:e.loginHint?{credential:e.loginHint,type:Xn}:null}}function Zs(e,t,i){const n=at(e);if(!n)throw ot(e)?(i.error(`A ${t} is present in the iframe but it does not contain known properties. It's likely that the ${t} has been replaced by code running on the redirectUri page.`),i.errorPii(`The ${t} detected is: ${e}`),(0,Ji.bD)(en.Lm)):(i.error(`The request has returned to the redirectUri but a ${t} is not present. It's likely that the ${t} has been removed or the page has been redirected by code running on the redirectUri page.`),(0,Ji.bD)(en.wv));return n}class Qs extends Fs{constructor(e,t,i,n,s,r,o,a,l,c){super(e,t,i,n,s,r,o,l,c),this.unloadWindow=this.unloadWindow.bind(this),this.nativeStorage=a}acquireToken(e){try{const t={popupName:this.generatePopupName(e.scopes||s.aZ,e.authority||this.config.auth.authority),popupWindowAttributes:e.popupWindowAttributes||{},popupWindowParent:e.popupWindowParent??window};return this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true, acquiring token"),this.acquireTokenPopupAsync(e,t)):(this.logger.verbose("asyncPopup set to false, opening popup before acquiring token"),t.popup=this.openSizedPopup("about:blank",t),this.acquireTokenPopupAsync(e,t))}catch(e){return Promise.reject(e)}}logout(e){try{this.logger.verbose("logoutPopup called");const t=this.initializeLogoutRequest(e),i={popupName:this.generateLogoutPopupName(t),popupWindowAttributes:e?.popupWindowAttributes||{},popupWindowParent:e?.popupWindowParent??window},n=e&&e.authority,s=e&&e.mainWindowRedirectUri;return this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true"),this.logoutPopupAsync(t,i,n,s)):(this.logger.verbose("asyncPopup set to false, opening popup"),i.popup=this.openSizedPopup("about:blank",i),this.logoutPopupAsync(t,i,n,s))}catch(e){return Promise.reject(e)}}async acquireTokenPopupAsync(e,t){this.logger.verbose("acquireTokenPopupAsync called");const i=this.initializeServerTelemetryManager(Zi.sA.acquireTokenPopup),n=await Ln(this.initializeAuthorizationRequest.bind(this),di,this.logger,this.performanceClient,this.correlationId)(e,Zi.X8.Popup);ls(n.authority);try{const s=await Ln(this.initializeAuthorizationCodeRequest.bind(this),pi,this.logger,this.performanceClient,this.correlationId)(n),r=await Ln(this.createAuthCodeClient.bind(this),hi,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:i,requestAuthority:n.authority,requestAzureCloudOptions:n.azureCloudOptions,requestExtraQueryParameters:n.extraQueryParameters,account:n.account}),o=qs.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme);let a;o&&(a=this.performanceClient.startMeasurement(zt,e.correlationId));const l=await r.getAuthCodeUrl({...n,nativeBroker:o}),c=new Xs(r,this.browserStorage,s,this.logger,this.performanceClient),h=this.initiateAuthRequest(l,t);this.eventHandler.emitEvent(cs.B.POPUP_OPENED,Zi.X8.Popup,{popupWindow:h},null);const u=await this.monitorPopupForHash(h,t.popupWindowParent),d=_n(Zs,Ai,this.logger,this.performanceClient,this.correlationId)(u,this.config.auth.OIDCOptions.serverResponseType,this.logger);if(ds.removeThrottle(this.browserStorage,this.config.auth.clientId,s),d.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),a&&a.end({success:!0,isNativeBroker:!0}),!this.nativeMessageHandler)throw(0,Ji.bD)(en.XC);const e=new Ys(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Zi.sA.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,d.accountId,this.nativeStorage,n.correlationId),{userRequestState:t}=Yn.parseRequestState(this.browserCrypto,n.state);return await e.acquireToken({...n,state:t,prompt:void 0})}return await c.handleCodeResponse(d,n)}catch(e){throw t.popup?.close(),e instanceof l.lR&&(e.setCorrelationId(this.correlationId),i.cacheFailedRequest(e)),e}}async logoutPopupAsync(e,t,i,n){this.logger.verbose("logoutPopupAsync called"),this.eventHandler.emitEvent(cs.B.LOGOUT_START,Zi.X8.Popup,e);const s=this.initializeServerTelemetryManager(Zi.sA.logoutPopup);try{await this.clearCacheOnLogout(e.account);const r=await Ln(this.createAuthCodeClient.bind(this),hi,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:s,requestAuthority:i,account:e.account||void 0});try{r.authority.endSessionEndpoint}catch{if(e.account?.homeAccountId&&e.postLogoutRedirectUri&&r.authority.protocolMode===o){if(this.browserStorage.removeAccount(e.account?.homeAccountId),this.eventHandler.emitEvent(cs.B.LOGOUT_SUCCESS,Zi.X8.Popup,e),n){const e={apiId:Zi.sA.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},t=lt.getAbsoluteUrl(n,ns());await this.navigationClient.navigateInternal(t,e)}return void t.popup?.close()}}const a=r.getLogoutUri(e);this.eventHandler.emitEvent(cs.B.LOGOUT_SUCCESS,Zi.X8.Popup,e);const l=this.openPopup(a,t);if(this.eventHandler.emitEvent(cs.B.POPUP_OPENED,Zi.X8.Popup,{popupWindow:l},null),await this.monitorPopupForHash(l,t.popupWindowParent).catch(()=>{}),n){const e={apiId:Zi.sA.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},t=lt.getAbsoluteUrl(n,ns());this.logger.verbose("Redirecting main window to url specified in the request"),this.logger.verbosePii(`Redirecting main window to: ${t}`),await this.navigationClient.navigateInternal(t,e)}else this.logger.verbose("No main window navigation requested")}catch(e){throw t.popup?.close(),e instanceof l.lR&&(e.setCorrelationId(this.correlationId),s.cacheFailedRequest(e)),this.browserStorage.setInteractionInProgress(!1),this.eventHandler.emitEvent(cs.B.LOGOUT_FAILURE,Zi.X8.Popup,null,e),this.eventHandler.emitEvent(cs.B.LOGOUT_END,Zi.X8.Popup),e}this.eventHandler.emitEvent(cs.B.LOGOUT_END,Zi.X8.Popup)}initiateAuthRequest(e,t){if(e)return this.logger.infoPii(`Navigate to: ${e}`),this.openPopup(e,t);throw this.logger.error("Navigate url is empty"),(0,Ji.bD)(en.B2)}monitorPopupForHash(e,t){return new Promise((t,i)=>{this.logger.verbose("PopupHandler.monitorPopupForHash - polling started");const n=setInterval(()=>{if(e.closed)return this.logger.error("PopupHandler.monitorPopupForHash - window closed"),clearInterval(n),void i((0,Ji.bD)(en.fN));let r="";try{r=e.location.href}catch(e){}if(!r||"about:blank"===r)return;clearInterval(n);let o="";const a=this.config.auth.OIDCOptions.serverResponseType;e&&(o=a===s.zL.QUERY?e.location.search:e.location.hash),this.logger.verbose("PopupHandler.monitorPopupForHash - popup window is on same origin as caller"),t(o)},this.config.system.pollIntervalMilliseconds)}).finally(()=>{this.cleanPopup(e,t)})}openPopup(e,t){try{let i;if(t.popup?(i=t.popup,this.logger.verbosePii(`Navigating popup window to: ${e}`),i.location.assign(e)):void 0===t.popup&&(this.logger.verbosePii(`Opening popup window to: ${e}`),i=this.openSizedPopup(e,t)),!i)throw(0,Ji.bD)(en.MP);return i.focus&&i.focus(),this.currentWindow=i,t.popupWindowParent.addEventListener("beforeunload",this.unloadWindow),i}catch(e){throw this.logger.error("error opening popup "+e.message),this.browserStorage.setInteractionInProgress(!1),(0,Ji.bD)(en.hs)}}openSizedPopup(e,{popupName:t,popupWindowAttributes:i,popupWindowParent:n}){const s=n.screenLeft?n.screenLeft:n.screenX,r=n.screenTop?n.screenTop:n.screenY,o=n.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=n.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;let l=i.popupSize?.width,c=i.popupSize?.height,h=i.popupPosition?.top,u=i.popupPosition?.left;return(!l||l<0||l>o)&&(this.logger.verbose("Default popup window width used. Window width not configured or invalid."),l=Zi.Q1.POPUP_WIDTH),(!c||c<0||c>a)&&(this.logger.verbose("Default popup window height used. Window height not configured or invalid."),c=Zi.Q1.POPUP_HEIGHT),(!h||h<0||h>a)&&(this.logger.verbose("Default popup window top position used. Window top not configured or invalid."),h=Math.max(0,a/2-Zi.Q1.POPUP_HEIGHT/2+r)),(!u||u<0||u>o)&&(this.logger.verbose("Default popup window left position used. Window left not configured or invalid."),u=Math.max(0,o/2-Zi.Q1.POPUP_WIDTH/2+s)),n.open(e,t,`width=${l}, height=${c}, top=${h}, left=${u}, scrollbars=yes`)}unloadWindow(e){this.browserStorage.cleanRequestByInteractionType(Zi.X8.Popup),this.currentWindow&&this.currentWindow.close(),e.preventDefault()}cleanPopup(e,t){e.close(),t.removeEventListener("beforeunload",this.unloadWindow),this.browserStorage.setInteractionInProgress(!1)}generatePopupName(e,t){return`${Zi.Q1.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${e.join("-")}.${t}.${this.correlationId}`}generateLogoutPopupName(e){const t=e.account&&e.account.homeAccountId;return`${Zi.Q1.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${t}.${this.correlationId}`}}class Js{constructor(e,t,i,n,s){this.authModule=e,this.browserStorage=t,this.authCodeRequest=i,this.logger=n,this.performanceClient=s}async initiateAuthRequest(e,t){if(this.logger.verbose("RedirectHandler.initiateAuthRequest called"),e){t.redirectStartPage&&(this.logger.verbose("RedirectHandler.initiateAuthRequest: redirectStartPage set, caching start page"),this.browserStorage.setTemporaryCache(Zi._p.ORIGIN_URI,t.redirectStartPage,!0)),this.browserStorage.setTemporaryCache(Zi._p.CORRELATION_ID,this.authCodeRequest.correlationId,!0),this.browserStorage.cacheCodeRequest(this.authCodeRequest),this.logger.infoPii(`RedirectHandler.initiateAuthRequest: Navigate to: ${e}`);const i={apiId:Zi.sA.acquireTokenRedirect,timeout:t.redirectTimeout,noHistory:!1};return"function"==typeof t.onRedirectNavigate?(this.logger.verbose("RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback"),!1!==t.onRedirectNavigate(e)?(this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating"),void await t.navigationClient.navigateExternal(e,i)):void this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation")):(this.logger.verbose("RedirectHandler.initiateAuthRequest: Navigating window to navigate url"),void await t.navigationClient.navigateExternal(e,i))}throw this.logger.info("RedirectHandler.initiateAuthRequest: Navigate url is empty"),(0,Ji.bD)(en.B2)}async handleCodeResponse(e,t){this.logger.verbose("RedirectHandler.handleCodeResponse called"),this.browserStorage.setInteractionInProgress(!1);const i=this.browserStorage.generateStateKey(t),n=this.browserStorage.getTemporaryCache(i);if(!n)throw te(b,"Cached State");let s;try{s=this.authModule.handleFragmentResponse(e,n)}catch(e){throw e instanceof us&&e.subError===en.fN?(0,Ji.bD)(en.fN):e}const r=this.browserStorage.generateNonceKey(n),o=this.browserStorage.getTemporaryCache(r);if(this.authCodeRequest.code=s.code,s.cloud_instance_host_name&&await Ln(this.authModule.updateAuthority.bind(this.authModule),yi,this.logger,this.performanceClient,this.authCodeRequest.correlationId)(s.cloud_instance_host_name,this.authCodeRequest.correlationId),s.nonce=o||void 0,s.state=n,s.client_info)this.authCodeRequest.clientInfo=s.client_info;else{const e=this.checkCcsCredentials();e&&(this.authCodeRequest.ccsCredential=e)}const a=await this.authModule.acquireToken(this.authCodeRequest,s);return this.browserStorage.cleanRequestByState(t),a}checkCcsCredentials(){const e=this.browserStorage.getTemporaryCache(Zi._p.CCS_CREDENTIAL,!0);if(e)try{return JSON.parse(e)}catch(t){this.authModule.logger.error("Cache credential could not be parsed"),this.authModule.logger.errorPii(`Cache credential could not be parsed: ${e}`)}return null}}class er extends Fs{constructor(e,t,i,n,s,r,o,a,l,c){super(e,t,i,n,s,r,o,l,c),this.nativeStorage=a}async acquireToken(e){const t=await Ln(this.initializeAuthorizationRequest.bind(this),di,this.logger,this.performanceClient,this.correlationId)(e,Zi.X8.Redirect);this.browserStorage.updateCacheEntries(t.state,t.nonce,t.authority,t.loginHint||"",t.account||null);const i=this.initializeServerTelemetryManager(Zi.sA.acquireTokenRedirect),n=e=>{e.persisted&&(this.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache."),this.browserStorage.cleanRequestByState(t.state),this.eventHandler.emitEvent(cs.B.RESTORE_FROM_BFCACHE,Zi.X8.Redirect))};try{const s=await Ln(this.initializeAuthorizationCodeRequest.bind(this),pi,this.logger,this.performanceClient,this.correlationId)(t),r=await Ln(this.createAuthCodeClient.bind(this),hi,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:i,requestAuthority:t.authority,requestAzureCloudOptions:t.azureCloudOptions,requestExtraQueryParameters:t.extraQueryParameters,account:t.account}),o=new Js(r,this.browserStorage,s,this.logger,this.performanceClient),a=await r.getAuthCodeUrl({...t,nativeBroker:qs.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme)}),l=this.getRedirectStartPage(e.redirectStartPage);return this.logger.verbosePii(`Redirect start page: ${l}`),window.addEventListener("pageshow",n),await o.initiateAuthRequest(a,{navigationClient:this.navigationClient,redirectTimeout:this.config.system.redirectNavigationTimeout,redirectStartPage:l,onRedirectNavigate:e.onRedirectNavigate||this.config.auth.onRedirectNavigate})}catch(e){throw e instanceof l.lR&&(e.setCorrelationId(this.correlationId),i.cacheFailedRequest(e)),window.removeEventListener("pageshow",n),this.browserStorage.cleanRequestByState(t.state),e}}async handleRedirectPromise(e="",t){const i=this.initializeServerTelemetryManager(Zi.sA.handleRedirectPromise);try{if(!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;const[n,r]=this.getRedirectResponse(e||"");if(!n)return this.logger.info("handleRedirectPromise did not detect a response as a result of a redirect. Cleaning temporary cache."),this.browserStorage.cleanRequestByInteractionType(Zi.X8.Redirect),"back_forward"!==function(){if("undefined"==typeof window||void 0===window.performance||"function"!=typeof window.performance.getEntriesByType)return;const e=window.performance.getEntriesByType("navigation"),t=e.length?e[0]:void 0;return t?.type}()?t.event.errorCode="no_server_response":this.logger.verbose("Back navigation event detected. Muting no_server_response error"),null;const o=this.browserStorage.getTemporaryCache(Zi._p.ORIGIN_URI,!0)||s.YM.EMPTY_STRING;if(lt.removeHashFromUrl(o)===lt.removeHashFromUrl(window.location.href)&&this.config.auth.navigateToLoginRequestUrl)return this.logger.verbose("Current page is loginRequestUrl, handling response"),o.indexOf("#")>-1&&function(e){const t=e.split("#");t.shift(),window.location.hash=t.length>0?t.join("#"):""}(o),await this.handleResponse(n,i);if(!this.config.auth.navigateToLoginRequestUrl)return this.logger.verbose("NavigateToLoginRequestUrl set to false, handling response"),await this.handleResponse(n,i);if(!is()||this.config.system.allowRedirectInIframe){this.browserStorage.setTemporaryCache(Zi._p.URL_HASH,r,!0);const e={apiId:Zi.sA.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0};let t=!0;if(o&&"null"!==o)this.logger.verbose(`Navigating to loginRequestUrl: ${o}`),t=await this.navigationClient.navigateInternal(o,e);else{const i=function(){const e=new lt(window.location.href).getUrlComponents();return`${e.Protocol}//${e.HostNameAndPort}/`}();this.browserStorage.setTemporaryCache(Zi._p.ORIGIN_URI,i,!0),this.logger.warning("Unable to get valid login request url from cache, redirecting to home page"),t=await this.navigationClient.navigateInternal(i,e)}if(!t)return await this.handleResponse(n,i)}return null}catch(e){throw e instanceof l.lR&&(e.setCorrelationId(this.correlationId),i.cacheFailedRequest(e)),this.browserStorage.cleanRequestByInteractionType(Zi.X8.Redirect),e}}getRedirectResponse(e){this.logger.verbose("getRedirectResponseHash called");let t=e;t||(t=this.config.auth.OIDCOptions.serverResponseType===s.zL.QUERY?window.location.search:window.location.hash);let i=at(t);if(i){try{!function(e,t,i){if(!e.state)throw(0,Ji.bD)(en.c$);const n=es(t,e.state);if(!n)throw(0,Ji.bD)(en.fA);if(n.interactionType!==i)throw(0,Ji.bD)(en.oe)}(i,this.browserCrypto,Zi.X8.Redirect)}catch(e){return e instanceof l.lR&&this.logger.error(`Interaction type validation failed due to ${e.errorCode}: ${e.errorMessage}`),[null,""]}return(n=window).location.hash="","function"==typeof n.history.replaceState&&n.history.replaceState(null,"",`${n.location.origin}${n.location.pathname}${n.location.search}`),this.logger.verbose("Hash contains known properties, returning response hash"),[i,t]}var n;const r=this.browserStorage.getTemporaryCache(Zi._p.URL_HASH,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey(Zi._p.URL_HASH)),r&&(i=at(r),i)?(this.logger.verbose("Hash does not contain known properties, returning cached hash"),[i,r]):[null,""]}async handleResponse(e,t){const i=e.state;if(!i)throw(0,Ji.bD)(en.c$);const n=this.browserStorage.getCachedRequest(i);if(this.logger.verbose("handleResponse called, retrieved cached request"),e.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw(0,Ji.bD)(en.XC);const t=new Ys(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Zi.sA.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,e.accountId,this.nativeStorage,n.correlationId),{userRequestState:s}=Yn.parseRequestState(this.browserCrypto,i);return t.acquireToken({...n,state:s,prompt:void 0}).finally(()=>{this.browserStorage.cleanRequestByState(i)})}const s=this.browserStorage.getCachedAuthority(i);if(!s)throw(0,Ji.bD)(en.Ne);const r=await Ln(this.createAuthCodeClient.bind(this),hi,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:t,requestAuthority:s});return ds.removeThrottle(this.browserStorage,this.config.auth.clientId,n),new Js(r,this.browserStorage,n,this.logger,this.performanceClient).handleCodeResponse(e,i)}async logout(e){this.logger.verbose("logoutRedirect called");const t=this.initializeLogoutRequest(e),i=this.initializeServerTelemetryManager(Zi.sA.logout);try{this.eventHandler.emitEvent(cs.B.LOGOUT_START,Zi.X8.Redirect,e),await this.clearCacheOnLogout(t.account);const n={apiId:Zi.sA.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},s=await Ln(this.createAuthCodeClient.bind(this),hi,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:i,requestAuthority:e&&e.authority,requestExtraQueryParameters:e?.extraQueryParameters,account:e&&e.account||void 0});if(s.authority.protocolMode===o)try{s.authority.endSessionEndpoint}catch{if(t.account?.homeAccountId)return this.browserStorage.removeAccount(t.account?.homeAccountId),void this.eventHandler.emitEvent(cs.B.LOGOUT_SUCCESS,Zi.X8.Redirect,t)}const r=s.getLogoutUri(t);if(this.eventHandler.emitEvent(cs.B.LOGOUT_SUCCESS,Zi.X8.Redirect,t),!e||"function"!=typeof e.onRedirectNavigate)return this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),void await this.navigationClient.navigateExternal(r,n);if(!1!==e.onRedirectNavigate(r))return this.logger.verbose("Logout onRedirectNavigate did not return false, navigating"),this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),void await this.navigationClient.navigateExternal(r,n);this.browserStorage.setInteractionInProgress(!1),this.logger.verbose("Logout onRedirectNavigate returned false, stopping navigation")}catch(e){throw e instanceof l.lR&&(e.setCorrelationId(this.correlationId),i.cacheFailedRequest(e)),this.eventHandler.emitEvent(cs.B.LOGOUT_FAILURE,Zi.X8.Redirect,null,e),this.eventHandler.emitEvent(cs.B.LOGOUT_END,Zi.X8.Redirect),e}this.eventHandler.emitEvent(cs.B.LOGOUT_END,Zi.X8.Redirect)}getRedirectStartPage(e){const t=e||window.location.href;return lt.getAbsoluteUrl(t,ns())}}async function tr(e,t,i,n,s){if(t.addQueueMeasurement(oi,n),!e)throw i.info("Navigate url is empty"),(0,Ji.bD)(en.B2);return s?Ln(nr,li,i,t,n)(e,s,t,n):_n(sr,ci,i,t,n)(e)}async function ir(e,t,i,n,r,o,a){return n.addQueueMeasurement(ai,o),new Promise((n,o)=>{t<1e4&&r.warning(`system.loadFrameTimeout or system.iframeHashTimeout set to lower (${t}ms) than the default (10000ms). This may result in timeouts.`);const l=window.setTimeout(()=>{window.clearInterval(c),o((0,Ji.bD)(en.Uf))},t),c=window.setInterval(()=>{let t="";const i=e.contentWindow;try{t=i?i.location.href:""}catch(e){}if(!t||"about:blank"===t)return;let r="";i&&(r=a===s.zL.QUERY?i.location.search:i.location.hash),window.clearTimeout(l),window.clearInterval(c),n(r)},i)}).finally(()=>{_n(or,Vi,r,n,o)(e)})}function nr(e,t,i,n){return i.addQueueMeasurement(li,n),new Promise((i,n)=>{const s=rr();window.setTimeout(()=>{s?(s.src=e,i(s)):n("Unable to load iframe")},t)})}function sr(e){const t=rr();return t.src=e,t}function rr(){const e=document.createElement("iframe");return e.className="msalSilentIframe",e.style.visibility="hidden",e.style.position="absolute",e.style.width=e.style.height="0",e.style.border="0",e.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),document.body.appendChild(e),e}function or(e){document.body===e.parentNode&&document.body.removeChild(e)}class ar extends Fs{constructor(e,t,i,n,s,r,o,a,l,c,h){super(e,t,i,n,s,r,a,c,h),this.apiId=o,this.nativeStorage=l}async acquireToken(e){this.performanceClient.addQueueMeasurement(Bt,e.correlationId),e.loginHint||e.sid||e.account&&e.account.username||this.logger.warning("No user hint provided. The authorization server may need more information to complete this request.");const t={...e};t.prompt?t.prompt!==s._M.NONE&&t.prompt!==s._M.NO_SESSION&&(this.logger.warning(`SilentIframeClient. Replacing invalid prompt ${t.prompt} with ${s._M.NONE}`),t.prompt=s._M.NONE):t.prompt=s._M.NONE;const i=await Ln(this.initializeAuthorizationRequest.bind(this),di,this.logger,this.performanceClient,e.correlationId)(t,Zi.X8.Silent);ls(i.authority);const n=this.initializeServerTelemetryManager(this.apiId);let r;try{return r=await Ln(this.createAuthCodeClient.bind(this),hi,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:n,requestAuthority:i.authority,requestAzureCloudOptions:i.azureCloudOptions,requestExtraQueryParameters:i.extraQueryParameters,account:i.account}),await Ln(this.silentTokenHelper.bind(this),ri,this.logger,this.performanceClient,e.correlationId)(r,i)}catch(i){if(i instanceof l.lR&&(i.setCorrelationId(this.correlationId),n.cacheFailedRequest(i)),!(r&&i instanceof l.lR&&i.errorCode===Zi.Q1.INVALID_GRANT_ERROR))throw i;this.performanceClient.addFields({retryError:i.errorCode},this.correlationId);const s=await Ln(this.initializeAuthorizationRequest.bind(this),di,this.logger,this.performanceClient,e.correlationId)(t,Zi.X8.Silent);return await Ln(this.silentTokenHelper.bind(this),ri,this.logger,this.performanceClient,this.correlationId)(r,s)}}logout(){return Promise.reject((0,Ji.bD)(en.v7))}async silentTokenHelper(e,t){const i=t.correlationId;this.performanceClient.addQueueMeasurement(ri,i);const n=await Ln(this.initializeAuthorizationCodeRequest.bind(this),pi,this.logger,this.performanceClient,i)(t),r=await Ln(e.getAuthCodeUrl.bind(e),gi,this.logger,this.performanceClient,i)({...t,nativeBroker:qs.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,t.authenticationScheme)}),o=new Xs(e,this.browserStorage,n,this.logger,this.performanceClient),a=await Ln(tr,oi,this.logger,this.performanceClient,i)(r,this.performanceClient,this.logger,i,this.config.system.navigateFrameWait),l=this.config.auth.OIDCOptions.serverResponseType,c=await Ln(ir,ai,this.logger,this.performanceClient,i)(a,this.config.system.iframeHashTimeout,this.config.system.pollIntervalMilliseconds,this.performanceClient,this.logger,i,l),h=_n(Zs,Ai,this.logger,this.performanceClient,this.correlationId)(c,l,this.logger);if(h.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw(0,Ji.bD)(en.XC);const e=new Ys(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.apiId,this.performanceClient,this.nativeMessageHandler,h.accountId,this.browserStorage,i),{userRequestState:n}=Yn.parseRequestState(this.browserCrypto,t.state);return Ln(e.acquireToken.bind(e),Wt,this.logger,this.performanceClient,i)({...t,state:n,prompt:t.prompt||s._M.NONE})}return Ln(o.handleCodeResponse.bind(o),mi,this.logger,this.performanceClient,i)(h,t)}}class lr extends Fs{async acquireToken(e){this.performanceClient.addQueueMeasurement(Vt,e.correlationId);const t=await Ln(Ns,ii,this.logger,this.performanceClient,e.correlationId)(e,this.config,this.performanceClient,this.logger),i={...e,...t};e.redirectUri&&(i.redirectUri=this.getRedirectUri(e.redirectUri));const n=this.initializeServerTelemetryManager(Zi.sA.acquireTokenSilent_silentFlow),s=await this.createRefreshTokenClient({serverTelemetryManager:n,authorityUrl:i.authority,azureCloudOptions:i.azureCloudOptions,account:i.account});return Ln(s.acquireTokenByRefreshToken.bind(s),Xt,this.logger,this.performanceClient,e.correlationId)(i).catch(e=>{throw e.setCorrelationId(this.correlationId),n.cacheFailedRequest(e),e})}logout(){return Promise.reject((0,Ji.bD)(en.v7))}async createRefreshTokenClient(e){const t=await Ln(this.getClientConfiguration.bind(this),ui,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:e.serverTelemetryManager,requestAuthority:e.authorityUrl,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account});return new Ws(t,this.performanceClient)}}class cr{constructor(e,t,i,n){this.isBrowserEnvironment="undefined"!=typeof window,this.config=e,this.storage=t,this.logger=i,this.cryptoObj=n}loadExternalTokens(e,t,i){if(!this.isBrowserEnvironment)throw(0,Ji.bD)(en.tI);const n=t.id_token?re(t.id_token,mn):void 0,s={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},r=e.authority?new On(On.generateAuthority(e.authority,e.azureCloudOptions),this.config.system.networkClient,this.storage,s,this.logger,e.correlationId||An()):void 0,o=this.loadAccount(e,i.clientInfo||t.client_info||"",n,r),a=this.loadIdToken(t,o.homeAccountId,o.environment,o.realm),l=this.loadAccessToken(e,t,o.homeAccountId,o.environment,o.realm,i),c=this.loadRefreshToken(t,o.homeAccountId,o.environment);return this.generateAuthenticationResult(e,{account:o,idToken:a,accessToken:l,refreshToken:c},n,r)}loadAccount(e,t,i,n){if(this.logger.verbose("TokenCache - loading account"),e.account){const t=rt.createFromAccountInfo(e.account);return this.storage.setAccount(t),t}if(!n||!t&&!i)throw this.logger.error("TokenCache - if an account is not provided on the request, authority and either clientInfo or idToken must be provided instead."),(0,Ji.bD)(en.s9);const s=rt.generateHomeAccountId(t,n.authorityType,this.logger,this.cryptoObj,i),r=i?.tid,o=Ts(this.storage,n,s,mn,i,t,n.hostnameAndPort,r,void 0,void 0,this.logger);return this.storage.setAccount(o),o}loadIdToken(e,t,i,n){if(!e.id_token)return this.logger.verbose("TokenCache - no id token found in response"),null;this.logger.verbose("TokenCache - loading id token");const s=he(t,i,e.id_token,this.config.auth.clientId,n);return this.storage.setIdTokenCredential(s),s}loadAccessToken(e,t,i,n,s,r){if(!t.access_token)return this.logger.verbose("TokenCache - no access token found in response"),null;if(!t.expires_in)return this.logger.error("TokenCache - no expiration set on the access token. Cannot add it to the cache."),null;if(!(t.scope||e.scopes&&e.scopes.length))return this.logger.error("TokenCache - scopes not specified in the request or response. Cannot add token to the cache."),null;this.logger.verbose("TokenCache - loading access token");const o=t.scope?Qe.fromString(t.scope):new Qe(e.scopes),a=r.expiresOn||t.expires_in+(new Date).getTime()/1e3,l=r.extendedExpiresOn||(t.ext_expires_in||t.expires_in)+(new Date).getTime()/1e3,c=ue(i,n,t.access_token,this.config.auth.clientId,s,o.printScopes(),a,l,mn);return this.storage.setAccessTokenCredential(c),c}loadRefreshToken(e,t,i){if(!e.refresh_token)return this.logger.verbose("TokenCache - no refresh token found in response"),null;this.logger.verbose("TokenCache - loading refresh token");const n=de(t,i,e.refresh_token,this.config.auth.clientId,e.foci,void 0,e.refresh_token_expires_in);return this.storage.setRefreshTokenCredential(n),n}generateAuthenticationResult(e,t,i,n){let s,r="",o=[],a=null;t?.accessToken&&(r=t.accessToken.secret,o=Qe.fromString(t.accessToken.target).asArray(),a=new Date(1e3*Number(t.accessToken.expiresOn)),s=new Date(1e3*Number(t.accessToken.extendedExpiresOn)));const l=t.account;return{authority:n?n.canonicalAuthority:"",uniqueId:t.account.localAccountId,tenantId:t.account.realm,scopes:o,account:l.getAccountInfo(),idToken:t.idToken?.secret||"",idTokenClaims:i||{},accessToken:r,fromCache:!0,expiresOn:a,correlationId:e.correlationId||"",requestId:"",extExpiresOn:s,familyId:t.refreshToken?.familyId||"",tokenType:t?.accessToken?.tokenType||"",state:e.state||"",cloudGraphHostName:l.cloudGraphHostName||"",msGraphHost:l.msGraphHost||"",fromNativeBroker:!1}}}class hr extends Is{constructor(e){super(e),this.includeRedirectUri=!1}}class ur extends Fs{constructor(e,t,i,n,s,r,o,a,l,c){super(e,t,i,n,s,r,a,l,c),this.apiId=o}async acquireToken(e){if(!e.code)throw(0,Ji.bD)(en.R3);const t=await Ln(this.initializeAuthorizationRequest.bind(this),di,this.logger,this.performanceClient,e.correlationId)(e,Zi.X8.Silent),i=this.initializeServerTelemetryManager(this.apiId);try{const n={...t,code:e.code},s=await Ln(this.getClientConfiguration.bind(this),ui,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:i,requestAuthority:t.authority,requestAzureCloudOptions:t.azureCloudOptions,requestExtraQueryParameters:t.extraQueryParameters,account:t.account}),r=new hr(s);this.logger.verbose("Auth code client created");const o=new Xs(r,this.browserStorage,n,this.logger,this.performanceClient);return await Ln(o.handleCodeResponseFromServer.bind(o),fi,this.logger,this.performanceClient,e.correlationId)({code:e.code,msgraph_host:e.msGraphHost,cloud_graph_host_name:e.cloudGraphHostName,cloud_instance_host_name:e.cloudInstanceHostName},t,!1)}catch(e){throw e instanceof l.lR&&(e.setCorrelationId(this.correlationId),i.cacheFailedRequest(e)),e}}logout(){return Promise.reject((0,Ji.bD)(en.v7))}}function dr(e){const t=e?.idTokenClaims;return t?.tfp||t?.acr?"B2C":t?.tid?"9188040d-6c67-4c5b-b112-36a304b66dad"===t?.tid?"MSA":"AAD":void 0}function pr(e,t){try{os(e)}catch(e){throw t.end({success:!1},e),e}}class gr{constructor(e){this.operatingContext=e,this.isBrowserEnvironment=this.operatingContext.isBrowserEnvironment(),this.config=e.getConfig(),this.initialized=!1,this.logger=this.operatingContext.getLogger(),this.networkClient=this.config.system.networkClient,this.navigationClient=this.config.system.navigationClient,this.redirectResponse=new Map,this.hybridAuthCodeResponses=new Map,this.performanceClient=this.config.telemetry.client,this.browserCrypto=this.isBrowserEnvironment?new kn(this.logger,this.performanceClient):ie,this.eventHandler=new hs(this.logger),this.browserStorage=this.isBrowserEnvironment?new ts(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger,function(e){const t=e.cloudDiscoveryMetadata;let i;if(t)try{i=JSON.parse(t)}catch(e){throw Xe(Ge)}return{canonicalAuthority:e.authority?Fn(e.authority):void 0,knownAuthorities:e.knownAuthorities,cloudDiscoveryMetadata:i}}(this.config.auth),this.performanceClient):((e,t)=>{const i={cacheLocation:Zi.Al.MemoryStorage,temporaryCacheLocation:Zi.Al.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};return new ts(e,i,ie,t)})(this.config.auth.clientId,this.logger);const t={cacheLocation:Zi.Al.MemoryStorage,temporaryCacheLocation:Zi.Al.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};this.nativeInternalStorage=new ts(this.config.auth.clientId,t,this.browserCrypto,this.logger,void 0,this.performanceClient),this.tokenCache=new cr(this.config,this.browserStorage,this.logger,this.browserCrypto),this.activeSilentTokenRequests=new Map,this.trackPageVisibility=this.trackPageVisibility.bind(this),this.trackPageVisibilityWithMeasurement=this.trackPageVisibilityWithMeasurement.bind(this),this.listeningToStorageEvents=!1,this.handleAccountCacheChange=this.handleAccountCacheChange.bind(this)}static async createController(e,t){const i=new gr(e);return await i.initialize(t),i}trackPageVisibility(e){e&&(this.logger.info("Perf: Visibility change detected"),this.performanceClient.incrementFields({visibilityChangeCount:1},e))}async initialize(e){if(this.logger.trace("initialize called"),this.initialized)return void this.logger.info("initialize has already been called, exiting early.");if(!this.isBrowserEnvironment)return this.logger.info("in non-browser environment, exiting early."),this.initialized=!0,void this.eventHandler.emitEvent(cs.B.INITIALIZE_END);const t=e?.correlationId||this.getRequestCorrelationId(),i=this.config.system.allowNativeBroker,n=this.performanceClient.startMeasurement(si,t);if(this.eventHandler.emitEvent(cs.B.INITIALIZE_START),i)try{this.nativeExtensionProvider=await qs.createProvider(this.logger,this.config.system.nativeBrokerHandshakeTimeout,this.performanceClient)}catch(e){this.logger.verbose(e)}this.config.cache.claimsBasedCachingEnabled||(this.logger.verbose("Claims-based caching is disabled. Clearing the previous cache with claims"),await Ln(this.browserStorage.clearTokensAndKeysWithClaims.bind(this.browserStorage),Hi,this.logger,this.performanceClient,t)(this.performanceClient,t)),this.initialized=!0,this.eventHandler.emitEvent(cs.B.INITIALIZE_END),n.end({allowNativeBroker:i,success:!0})}async handleRedirectPromise(e){if(this.logger.verbose("handleRedirectPromise called"),rs(this.initialized),this.isBrowserEnvironment){const t=e||"";let i=this.redirectResponse.get(t);return void 0===i?(i=this.handleRedirectPromiseInternal(e),this.redirectResponse.set(t,i),this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise")):this.logger.verbose("handleRedirectPromise has been called previously, returning the result from the first call"),i}return this.logger.verbose("handleRedirectPromise returns null, not browser environment"),null}async handleRedirectPromiseInternal(e){const t=this.getAllAccounts(),i=this.browserStorage.getCachedNativeRequest(),n=i&&qs.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider)&&this.nativeExtensionProvider&&!e,s=n?i?.correlationId:this.browserStorage.getTemporaryCache(Zi._p.CORRELATION_ID,!0)||"",r=this.performanceClient.startMeasurement(Nt,s);let o;if(this.eventHandler.emitEvent(cs.B.HANDLE_REDIRECT_START,Zi.X8.Redirect),n&&this.nativeExtensionProvider){this.logger.trace("handleRedirectPromise - acquiring token from native platform");const e=new Ys(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Zi.sA.handleRedirectPromise,this.performanceClient,this.nativeExtensionProvider,i.accountId,this.nativeInternalStorage,i.correlationId);o=Ln(e.handleRedirectPromise.bind(e),Gi,this.logger,this.performanceClient,r.event.correlationId)(this.performanceClient,r.event.correlationId)}else{this.logger.trace("handleRedirectPromise - acquiring token from web flow");const t=this.createRedirectClient(s);o=Ln(t.handleRedirectPromise.bind(t),Fi,this.logger,this.performanceClient,r.event.correlationId)(e,r)}return o.then(e=>(e?(t.length<this.getAllAccounts().length?(this.eventHandler.emitEvent(cs.B.LOGIN_SUCCESS,Zi.X8.Redirect,e),this.logger.verbose("handleRedirectResponse returned result, login success")):(this.eventHandler.emitEvent(cs.B.ACQUIRE_TOKEN_SUCCESS,Zi.X8.Redirect,e),this.logger.verbose("handleRedirectResponse returned result, acquire token success")),r.end({success:!0,accountType:dr(e.account)})):r.event.errorCode?r.end({success:!1}):r.discard(),this.eventHandler.emitEvent(cs.B.HANDLE_REDIRECT_END,Zi.X8.Redirect),e)).catch(e=>{const i=e;throw t.length>0?this.eventHandler.emitEvent(cs.B.ACQUIRE_TOKEN_FAILURE,Zi.X8.Redirect,null,i):this.eventHandler.emitEvent(cs.B.LOGIN_FAILURE,Zi.X8.Redirect,null,i),this.eventHandler.emitEvent(cs.B.HANDLE_REDIRECT_END,Zi.X8.Redirect),r.end({success:!1},i),e})}async acquireTokenRedirect(e){const t=this.getRequestCorrelationId(e);this.logger.verbose("acquireTokenRedirect called",t);const i=this.performanceClient.startMeasurement("acquireTokenPreRedirect",t);i.add({accountType:dr(e.account),scenarioId:e.scenarioId});const n=e.onRedirectNavigate;if(n)e.onRedirectNavigate=e=>{const t="function"==typeof n?n(e):void 0;return!1!==t?i.end({success:!0}):i.discard(),t};else{const e=this.config.auth.onRedirectNavigate;this.config.auth.onRedirectNavigate=t=>{const n="function"==typeof e?e(t):void 0;return!1!==n?i.end({success:!0}):i.discard(),n}}const s=this.getAllAccounts().length>0;try{let n;return as(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0),s?this.eventHandler.emitEvent(cs.B.ACQUIRE_TOKEN_START,Zi.X8.Redirect,e):this.eventHandler.emitEvent(cs.B.LOGIN_START,Zi.X8.Redirect,e),n=this.nativeExtensionProvider&&this.canUseNative(e)?new Ys(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Zi.sA.acquireTokenRedirect,this.performanceClient,this.nativeExtensionProvider,this.getNativeAccountId(e),this.nativeInternalStorage,t).acquireTokenRedirect(e,i).catch(i=>{if(i instanceof Hs&&Us(i))return this.nativeExtensionProvider=void 0,this.createRedirectClient(t).acquireToken(e);if(i instanceof jn)return this.logger.verbose("acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createRedirectClient(t).acquireToken(e);throw this.browserStorage.setInteractionInProgress(!1),i}):this.createRedirectClient(t).acquireToken(e),await n}catch(e){throw i.end({success:!1},e),s?this.eventHandler.emitEvent(cs.B.ACQUIRE_TOKEN_FAILURE,Zi.X8.Redirect,null,e):this.eventHandler.emitEvent(cs.B.LOGIN_FAILURE,Zi.X8.Redirect,null,e),e}}acquireTokenPopup(e){const t=this.getRequestCorrelationId(e),i=this.performanceClient.startMeasurement(Lt,t);i.add({scenarioId:e.scenarioId,accountType:dr(e.account)});try{this.logger.verbose("acquireTokenPopup called",t),pr(this.initialized,i),this.browserStorage.setInteractionInProgress(!0)}catch(e){return Promise.reject(e)}const n=this.getAllAccounts();let s;return n.length>0?this.eventHandler.emitEvent(cs.B.ACQUIRE_TOKEN_START,Zi.X8.Popup,e):this.eventHandler.emitEvent(cs.B.LOGIN_START,Zi.X8.Popup,e),s=this.canUseNative(e)?this.acquireTokenNative({...e,correlationId:t},Zi.sA.acquireTokenPopup).then(e=>(this.browserStorage.setInteractionInProgress(!1),i.end({success:!0,isNativeBroker:!0,requestId:e.requestId,accountType:dr(e.account)}),e)).catch(i=>{if(i instanceof Hs&&Us(i))return this.nativeExtensionProvider=void 0,this.createPopupClient(t).acquireToken(e);if(i instanceof jn)return this.logger.verbose("acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createPopupClient(t).acquireToken(e);throw this.browserStorage.setInteractionInProgress(!1),i}):this.createPopupClient(t).acquireToken(e),s.then(e=>(n.length<this.getAllAccounts().length?this.eventHandler.emitEvent(cs.B.LOGIN_SUCCESS,Zi.X8.Popup,e):this.eventHandler.emitEvent(cs.B.ACQUIRE_TOKEN_SUCCESS,Zi.X8.Popup,e),i.end({success:!0,requestId:e.requestId,accessTokenSize:e.accessToken.length,idTokenSize:e.idToken.length,accountType:dr(e.account)}),e)).catch(e=>(n.length>0?this.eventHandler.emitEvent(cs.B.ACQUIRE_TOKEN_FAILURE,Zi.X8.Popup,null,e):this.eventHandler.emitEvent(cs.B.LOGIN_FAILURE,Zi.X8.Popup,null,e),i.end({success:!1},e),Promise.reject(e)))}trackPageVisibilityWithMeasurement(){const e=this.ssoSilentMeasurement||this.acquireTokenByCodeAsyncMeasurement;e&&(this.logger.info("Perf: Visibility change detected in ",e.event.name),e.increment({visibilityChangeCount:1}))}async ssoSilent(e){const t=this.getRequestCorrelationId(e),i={...e,prompt:e.prompt,correlationId:t};let n;return this.ssoSilentMeasurement=this.performanceClient.startMeasurement(Ht,t),this.ssoSilentMeasurement?.add({scenarioId:e.scenarioId,accountType:dr(e.account)}),pr(this.initialized,this.ssoSilentMeasurement),this.ssoSilentMeasurement?.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),this.logger.verbose("ssoSilent called",t),this.eventHandler.emitEvent(cs.B.SSO_SILENT_START,Zi.X8.Silent,i),n=this.canUseNative(i)?this.acquireTokenNative(i,Zi.sA.ssoSilent).catch(e=>{if(e instanceof Hs&&Us(e))return this.nativeExtensionProvider=void 0,this.createSilentIframeClient(i.correlationId).acquireToken(i);throw e}):this.createSilentIframeClient(i.correlationId).acquireToken(i),n.then(e=>(this.eventHandler.emitEvent(cs.B.SSO_SILENT_SUCCESS,Zi.X8.Silent,e),this.ssoSilentMeasurement?.end({success:!0,isNativeBroker:e.fromNativeBroker,requestId:e.requestId,accessTokenSize:e.accessToken.length,idTokenSize:e.idToken.length,accountType:dr(e.account)}),e)).catch(e=>{throw this.eventHandler.emitEvent(cs.B.SSO_SILENT_FAILURE,Zi.X8.Silent,null,e),this.ssoSilentMeasurement?.end({success:!1},e),e}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenByCode(e){const t=this.getRequestCorrelationId(e);this.logger.trace("acquireTokenByCode called",t);const i=this.performanceClient.startMeasurement(Rt,t);pr(this.initialized,i),this.eventHandler.emitEvent(cs.B.ACQUIRE_TOKEN_BY_CODE_START,Zi.X8.Silent,e),i.add({scenarioId:e.scenarioId});try{if(e.code&&e.nativeAccountId)throw(0,Ji.bD)(en.$c);if(e.code){const n=e.code;let s=this.hybridAuthCodeResponses.get(n);return s?(this.logger.verbose("Existing acquireTokenByCode request found",t),i.discard()):(this.logger.verbose("Initiating new acquireTokenByCode request",t),s=this.acquireTokenByCodeAsync({...e,correlationId:t}).then(e=>(this.eventHandler.emitEvent(cs.B.ACQUIRE_TOKEN_BY_CODE_SUCCESS,Zi.X8.Silent,e),this.hybridAuthCodeResponses.delete(n),i.end({success:!0,isNativeBroker:e.fromNativeBroker,requestId:e.requestId,accessTokenSize:e.accessToken.length,idTokenSize:e.idToken.length,accountType:dr(e.account)}),e)).catch(e=>{throw this.hybridAuthCodeResponses.delete(n),this.eventHandler.emitEvent(cs.B.ACQUIRE_TOKEN_BY_CODE_FAILURE,Zi.X8.Silent,null,e),i.end({success:!1},e),e}),this.hybridAuthCodeResponses.set(n,s)),await s}if(e.nativeAccountId){if(this.canUseNative(e,e.nativeAccountId)){const n=await this.acquireTokenNative({...e,correlationId:t},Zi.sA.acquireTokenByCode,e.nativeAccountId).catch(e=>{throw e instanceof Hs&&Us(e)&&(this.nativeExtensionProvider=void 0),e});return i.end({accountType:dr(n.account),success:!0}),n}throw(0,Ji.bD)(en.gU)}throw(0,Ji.bD)(en.xp)}catch(e){throw this.eventHandler.emitEvent(cs.B.ACQUIRE_TOKEN_BY_CODE_FAILURE,Zi.X8.Silent,null,e),i.end({success:!1},e),e}}async acquireTokenByCodeAsync(e){this.logger.trace("acquireTokenByCodeAsync called",e.correlationId),this.acquireTokenByCodeAsyncMeasurement=this.performanceClient.startMeasurement(Oi,e.correlationId),this.acquireTokenByCodeAsyncMeasurement?.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement);const t=this.createSilentAuthCodeClient(e.correlationId);return await t.acquireToken(e).then(e=>(this.acquireTokenByCodeAsyncMeasurement?.end({success:!0,fromCache:e.fromCache,isNativeBroker:e.fromNativeBroker,requestId:e.requestId}),e)).catch(e=>{throw this.acquireTokenByCodeAsyncMeasurement?.end({success:!1},e),e}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenFromCache(e,t){switch(this.performanceClient.addQueueMeasurement(Qt,e.correlationId),t){case Zi.nN.Default:case Zi.nN.AccessToken:case Zi.nN.AccessTokenAndRefreshToken:const t=this.createSilentCacheClient(e.correlationId);return Ln(t.acquireToken.bind(t),Gt,this.logger,this.performanceClient,e.correlationId)(e);default:throw te(H)}}async acquireTokenByRefreshToken(e,t){switch(this.performanceClient.addQueueMeasurement(kt,e.correlationId),t){case Zi.nN.Default:case Zi.nN.AccessTokenAndRefreshToken:case Zi.nN.RefreshToken:case Zi.nN.RefreshTokenAndNetwork:const t=this.createSilentRefreshClient(e.correlationId);return Ln(t.acquireToken.bind(t),Vt,this.logger,this.performanceClient,e.correlationId)(e);default:throw te(H)}}async acquireTokenBySilentIframe(e){this.performanceClient.addQueueMeasurement(ti,e.correlationId);const t=this.createSilentIframeClient(e.correlationId);return Ln(t.acquireToken.bind(t),Bt,this.logger,this.performanceClient,e.correlationId)(e)}async logout(e){const t=this.getRequestCorrelationId(e);return this.logger.warning("logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.",t),this.logoutRedirect({correlationId:t,...e})}async logoutRedirect(e){const t=this.getRequestCorrelationId(e);return as(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0),this.createRedirectClient(t).logout(e)}logoutPopup(e){try{const t=this.getRequestCorrelationId(e);return os(this.initialized),this.browserStorage.setInteractionInProgress(!0),this.createPopupClient(t).logout(e)}catch(e){return Promise.reject(e)}}async clearCache(e){if(!this.isBrowserEnvironment)return void this.logger.info("in non-browser environment, returning early.");const t=this.getRequestCorrelationId(e);return this.createSilentCacheClient(t).logout(e)}getAllAccounts(e){return function(e,t,i,n){return e.verbose("getAllAccounts called"),i?t.getAllAccounts(n):[]}(this.logger,this.browserStorage,this.isBrowserEnvironment,e)}getAccount(e){return function(e,t,i){if(t.trace("getAccount called"),0===Object.keys(e).length)return t.warning("getAccount: No accountFilter provided"),null;const n=i.getAccountInfoFilteredBy(e);return n?(t.verbose("getAccount: Account matching provided filter found, returning"),n):(t.verbose("getAccount: No matching account found, returning null"),null)}(e,this.logger,this.browserStorage)}getAccountByUsername(e){return function(e,t,i){if(t.trace("getAccountByUsername called"),!e)return t.warning("getAccountByUsername: No username provided"),null;const n=i.getAccountInfoFilteredBy({username:e});return n?(t.verbose("getAccountByUsername: Account matching username found, returning"),t.verbosePii(`getAccountByUsername: Returning signed-in accounts matching username: ${e}`),n):(t.verbose("getAccountByUsername: No matching account found, returning null"),null)}(e,this.logger,this.browserStorage)}getAccountByHomeId(e){return function(e,t,i){if(t.trace("getAccountByHomeId called"),!e)return t.warning("getAccountByHomeId: No homeAccountId provided"),null;const n=i.getAccountInfoFilteredBy({homeAccountId:e});return n?(t.verbose("getAccountByHomeId: Account matching homeAccountId found, returning"),t.verbosePii(`getAccountByHomeId: Returning signed-in accounts matching homeAccountId: ${e}`),n):(t.verbose("getAccountByHomeId: No matching account found, returning null"),null)}(e,this.logger,this.browserStorage)}getAccountByLocalId(e){return function(e,t,i){if(t.trace("getAccountByLocalId called"),!e)return t.warning("getAccountByLocalId: No localAccountId provided"),null;const n=i.getAccountInfoFilteredBy({localAccountId:e});return n?(t.verbose("getAccountByLocalId: Account matching localAccountId found, returning"),t.verbosePii(`getAccountByLocalId: Returning signed-in accounts matching localAccountId: ${e}`),n):(t.verbose("getAccountByLocalId: No matching account found, returning null"),null)}(e,this.logger,this.browserStorage)}setActiveAccount(e){!function(e,t){t.setActiveAccount(e)}(e,this.browserStorage)}getActiveAccount(){return this.browserStorage.getActiveAccount()}async hydrateCache(e,t){this.logger.verbose("hydrateCache called");const i=rt.createFromAccountInfo(e.account,e.cloudGraphHostName,e.msGraphHost);return this.browserStorage.setAccount(i),e.fromNativeBroker?(this.logger.verbose("Response was from native broker, storing in-memory"),this.nativeInternalStorage.hydrateCache(e,t)):this.browserStorage.hydrateCache(e,t)}async acquireTokenNative(e,t,i){if(this.logger.trace("acquireTokenNative called"),!this.nativeExtensionProvider)throw(0,Ji.bD)(en.XC);return new Ys(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,t,this.performanceClient,this.nativeExtensionProvider,i||this.getNativeAccountId(e),this.nativeInternalStorage,e.correlationId).acquireToken(e)}canUseNative(e,t){if(this.logger.trace("canUseNative called"),!qs.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme))return this.logger.trace("canUseNative: isNativeAvailable returned false, returning false"),!1;if(e.prompt)switch(e.prompt){case s._M.NONE:case s._M.CONSENT:case s._M.LOGIN:this.logger.trace("canUseNative: prompt is compatible with native flow");break;default:return this.logger.trace(`canUseNative: prompt = ${e.prompt} is not compatible with native flow, returning false`),!1}return!(!t&&!this.getNativeAccountId(e)&&(this.logger.trace("canUseNative: nativeAccountId is not available, returning false"),1))}getNativeAccountId(e){const t=e.account||this.getAccount({loginHint:e.loginHint,sid:e.sid})||this.getActiveAccount();return t&&t.nativeAccountId||""}createPopupClient(e){return new Qs(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createRedirectClient(e){return new er(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentIframeClient(e){return new ar(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Zi.sA.ssoSilent,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentCacheClient(e){return new $s(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentRefreshClient(e){return new lr(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentAuthCodeClient(e){return new ur(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Zi.sA.acquireTokenByCode,this.performanceClient,this.nativeExtensionProvider,e)}addEventCallback(e,t){return this.eventHandler.addEventCallback(e,t)}removeEventCallback(e){this.eventHandler.removeEventCallback(e)}addPerformanceCallback(e){return ss(),this.performanceClient.addPerformanceCallback(e)}removePerformanceCallback(e){return this.performanceClient.removePerformanceCallback(e)}enableAccountStorageEvents(){"undefined"!=typeof window&&(this.listeningToStorageEvents?this.logger.verbose("Account storage listener already registered."):(this.logger.verbose("Adding account storage listener."),this.listeningToStorageEvents=!0,window.addEventListener("storage",this.handleAccountCacheChange)))}disableAccountStorageEvents(){"undefined"!=typeof window&&(this.listeningToStorageEvents?(this.logger.verbose("Removing account storage listener."),window.removeEventListener("storage",this.handleAccountCacheChange),this.listeningToStorageEvents=!1):this.logger.verbose("No account storage listener registered."))}handleAccountCacheChange(e){try{e.key?.includes(s.Gd.ACTIVE_ACCOUNT_FILTERS)&&this.eventHandler.emitEvent(cs.B.ACTIVE_ACCOUNT_CHANGED);const t=e.newValue||e.oldValue;if(!t)return;const i=JSON.parse(t);if("object"!=typeof i||!rt.isAccountEntity(i))return;const n=vt.toObject(new rt,i).getAccountInfo();!e.oldValue&&e.newValue?(this.logger.info("Account was added to cache in a different window"),this.eventHandler.emitEvent(cs.B.ACCOUNT_ADDED,void 0,n)):!e.newValue&&e.oldValue&&(this.logger.info("Account was removed from cache in a different window"),this.eventHandler.emitEvent(cs.B.ACCOUNT_REMOVED,void 0,n))}catch(e){return}}getTokenCache(){return this.tokenCache}getLogger(){return this.logger}setLogger(e){this.logger=e}initializeWrapperLibrary(e,t){this.browserStorage.setWrapperMetadata(e,t)}setNavigationClient(e){this.navigationClient=e}getConfiguration(){return this.config}getPerformanceClient(){return this.performanceClient}isBrowserEnv(){return this.isBrowserEnvironment}getRequestCorrelationId(e){return e?.correlationId?e.correlationId:this.isBrowserEnvironment?An():s.YM.EMPTY_STRING}async loginRedirect(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginRedirect called",t),this.acquireTokenRedirect({correlationId:t,...e||Zi.uq})}loginPopup(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginPopup called",t),this.acquireTokenPopup({correlationId:t,...e||Zi.uq})}async acquireTokenSilent(e){const t=this.getRequestCorrelationId(e),i=this.performanceClient.startMeasurement(Pt,t);i.add({cacheLookupPolicy:e.cacheLookupPolicy,scenarioId:e.scenarioId}),pr(this.initialized,i),this.logger.verbose("acquireTokenSilent called",t);const n=e.account||this.getActiveAccount();if(!n)throw(0,Ji.bD)(en.rR);i.add({accountType:dr(n)});const r={clientId:this.config.auth.clientId,authority:e.authority||s.YM.EMPTY_STRING,scopes:e.scopes,homeAccountIdentifier:n.homeAccountId,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid,shrOptions:e.shrOptions},o=JSON.stringify(r),a=this.activeSilentTokenRequests.get(o);if(void 0===a){this.logger.verbose("acquireTokenSilent called for the first time, storing active request",t);const s=Ln(this.acquireTokenSilentAsync.bind(this),_t,this.logger,this.performanceClient,t)({...e,correlationId:t},n).then(t=>(this.activeSilentTokenRequests.delete(o),i.end({success:!0,fromCache:t.fromCache,isNativeBroker:t.fromNativeBroker,cacheLookupPolicy:e.cacheLookupPolicy,requestId:t.requestId,accessTokenSize:t.accessToken.length,idTokenSize:t.idToken.length}),t)).catch(e=>{throw this.activeSilentTokenRequests.delete(o),i.end({success:!1},e),e});return this.activeSilentTokenRequests.set(o,s),{...await s,state:e.state}}return this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call",t),i.discard(),{...await a,state:e.state}}async acquireTokenSilentAsync(e,t){const i=()=>this.trackPageVisibility(e.correlationId);this.performanceClient.addQueueMeasurement(_t,e.correlationId),this.eventHandler.emitEvent(cs.B.ACQUIRE_TOKEN_START,Zi.X8.Silent,e),e.correlationId&&this.performanceClient.incrementFields({visibilityChangeCount:0},e.correlationId),document.addEventListener("visibilitychange",i);const n=await Ln(Os,ni,this.logger,this.performanceClient,e.correlationId)(e,t,this.config,this.performanceClient,this.logger),s=e.cacheLookupPolicy||Zi.nN.Default;return this.acquireTokenSilentNoIframe(n,s).catch(async e=>{const t=function(e,t){const i=!(e instanceof jn&&e.subError!==Hn),n=e.errorCode===Zi.Q1.INVALID_GRANT_ERROR||e.errorCode===H,s=i&&n||e.errorCode===Gn||e.errorCode===Vn,r=Zi.JE.includes(t);return s&&r}(e,s);if(t){if(this.activeIframeRequest){if(s!==Zi.nN.Skip){const[t,i]=this.activeIframeRequest;this.logger.verbose(`Iframe request is already in progress, awaiting resolution for request with correlationId: ${i}`,n.correlationId);const r=this.performanceClient.startMeasurement("awaitConcurrentIframe",n.correlationId);r.add({awaitIframeCorrelationId:i});const o=await t;if(r.end({success:o}),o)return this.logger.verbose(`Parallel iframe request with correlationId: ${i} succeeded. Retrying cache and/or RT redemption`,n.correlationId),this.acquireTokenSilentNoIframe(n,s);throw this.logger.info(`Iframe request with correlationId: ${i} failed. Interaction is required.`),e}return this.logger.warning("Another iframe request is currently in progress and CacheLookupPolicy is set to Skip. This may result in degraded performance and/or reliability for both calls. Please consider changing the CacheLookupPolicy to take advantage of request queuing and token cache.",n.correlationId),Ln(this.acquireTokenBySilentIframe.bind(this),ti,this.logger,this.performanceClient,n.correlationId)(n)}{let e;return this.activeIframeRequest=[new Promise(t=>{e=t}),n.correlationId],this.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.",n.correlationId),Ln(this.acquireTokenBySilentIframe.bind(this),ti,this.logger,this.performanceClient,n.correlationId)(n).then(t=>(e(!0),t)).catch(t=>{throw e(!1),t}).finally(()=>{this.activeIframeRequest=void 0})}}throw e}).then(t=>(this.eventHandler.emitEvent(cs.B.ACQUIRE_TOKEN_SUCCESS,Zi.X8.Silent,t),e.correlationId&&this.performanceClient.addFields({fromCache:t.fromCache,isNativeBroker:t.fromNativeBroker,requestId:t.requestId},e.correlationId),t)).catch(e=>{throw this.eventHandler.emitEvent(cs.B.ACQUIRE_TOKEN_FAILURE,Zi.X8.Silent,null,e),e}).finally(()=>{document.removeEventListener("visibilitychange",i)})}async acquireTokenSilentNoIframe(e,t){return qs.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme)&&e.account.nativeAccountId?(this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform"),this.acquireTokenNative(e,Zi.sA.acquireTokenSilent_silentFlow).catch(async e=>{if(e instanceof Hs&&Us(e))throw this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow"),this.nativeExtensionProvider=void 0,te(H);throw e})):(this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow"),Ln(this.acquireTokenFromCache.bind(this),Qt,this.logger,this.performanceClient,e.correlationId)(e,t).catch(i=>{if(t===Zi.nN.AccessToken)throw i;return this.eventHandler.emitEvent(cs.B.ACQUIRE_TOKEN_NETWORK_START,Zi.X8.Silent,e),Ln(this.acquireTokenByRefreshToken.bind(this),kt,this.logger,this.performanceClient,e.correlationId)(e,t)}))}}class fr{static async createPublicClientApplication(e){const t=await async function(e){const t=new rn(e);return await t.initialize(),gr.createController(t,void 0)}(e);return new fr(e,t)}constructor(e,t){this.controller=t||new gr(new rn(e))}async initialize(e){return this.controller.initialize(e)}async acquireTokenPopup(e){return this.controller.acquireTokenPopup(e)}acquireTokenRedirect(e){return this.controller.acquireTokenRedirect(e)}acquireTokenSilent(e){return this.controller.acquireTokenSilent(e)}acquireTokenByCode(e){return this.controller.acquireTokenByCode(e)}addEventCallback(e,t){return this.controller.addEventCallback(e,t)}removeEventCallback(e){return this.controller.removeEventCallback(e)}addPerformanceCallback(e){return this.controller.addPerformanceCallback(e)}removePerformanceCallback(e){return this.controller.removePerformanceCallback(e)}enableAccountStorageEvents(){this.controller.enableAccountStorageEvents()}disableAccountStorageEvents(){this.controller.disableAccountStorageEvents()}getAccount(e){return this.controller.getAccount(e)}getAccountByHomeId(e){return this.controller.getAccountByHomeId(e)}getAccountByLocalId(e){return this.controller.getAccountByLocalId(e)}getAccountByUsername(e){return this.controller.getAccountByUsername(e)}getAllAccounts(e){return this.controller.getAllAccounts(e)}handleRedirectPromise(e){return this.controller.handleRedirectPromise(e)}loginPopup(e){return this.controller.loginPopup(e)}loginRedirect(e){return this.controller.loginRedirect(e)}logout(e){return this.controller.logout(e)}logoutRedirect(e){return this.controller.logoutRedirect(e)}logoutPopup(e){return this.controller.logoutPopup(e)}ssoSilent(e){return this.controller.ssoSilent(e)}getTokenCache(){return this.controller.getTokenCache()}getLogger(){return this.controller.getLogger()}setLogger(e){this.controller.setLogger(e)}setActiveAccount(e){this.controller.setActiveAccount(e)}getActiveAccount(){return this.controller.getActiveAccount()}initializeWrapperLibrary(e,t){return this.controller.initializeWrapperLibrary(e,t)}setNavigationClient(e){this.controller.setNavigationClient(e)}getConfiguration(){return this.controller.getConfiguration()}async hydrateCache(e,t){return this.controller.hydrateCache(e,t)}clearCache(e){return this.controller.clearCache(e)}}},75970(e,t,i){"use strict";i.d(t,{bD:()=>l,jT:()=>a});var n=i(90865),s=i(2919);const r="For more visit: aka.ms/msaljs/browser-errors",o={[s.p5]:"The PKCE code challenge and verifier could not be generated.",[s.rc]:"The crypto object or function is not available.",[s.B2]:"Navigation URI is empty. Please check stack trace for more info.",[s.wv]:`Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash. ${r}`,[s.c$]:"Hash does not contain state. Please verify that the request originated from msal.",[s.Lm]:`Hash does not contain known properites. Please verify that your redirectUri is not changing the hash.  ${r}`,[s.fA]:"Unable to parse state. Please verify that the request originated from msal.",[s.oe]:"Hash contains state but the interaction type does not match the caller.",[s.b]:`Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API.   ${r}`,[s.hs]:"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser.",[s.MP]:"window.open returned null or undefined window object.",[s.fN]:"User cancelled the flow.",[s.OM]:`Token acquisition in popup failed due to timeout.  ${r}`,[s.Uf]:`Token acquisition in iframe failed due to timeout.  ${r}`,[s.OT]:"Redirects are not supported for iframed or brokered applications. Please ensure you are using MSAL.js in a top frame of the window if using the redirect APIs, or use the popup APIs.",[s.tZ]:`Request was blocked inside an iframe because MSAL detected an authentication response.  ${r}`,[s.aH]:"Request was blocked inside a popup because MSAL detected it was running in a popup.",[s.lg]:"The iframe being monitored was closed prematurely.",[s.v7]:"Silent logout not supported. Please call logoutRedirect or logoutPopup instead.",[s.rR]:"No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request.",[s.hZ]:"The value given for the prompt value is not valid for silent requests - must be set to 'none' or 'no_session'.",[s.y6]:"No token request found in cache.",[s.ot]:"The cached token request could not be parsed.",[s.Ne]:"No cached authority found.",[s.LW]:"Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler",[s.Mm]:"Invalid cache type",[s.tI]:"Login and token requests are not supported in non-browser environments.",[s.rn]:"Database is not open!",[s.l7]:"No network connectivity. Check your internet connection.",[s.zv]:"Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'",[s.Zw]:"Network request failed. Please check the network trace to determine root cause.",[s.db]:"Failed to parse network response. Check network trace.",[s.s9]:"Error loading token to cache.",[s.e0]:"Cryptographic Key or Keypair not found in browser storage.",[s.R3]:"An authorization code must be provided (as the `code` property on the request) to this flow.",[s.xp]:"An authorization code or nativeAccountId must be provided to this flow.",[s.$c]:"Request cannot contain both spa code and native account id.",[s.MG]:"IndexedDB, which is required for persistent cryptographic key storage, is unavailable. This may be caused by browser privacy features which block persistent storage in third-party contexts.",[s.gU]:`Unable to acquire token from native platform.  ${r}`,[s.y3]:"Timed out while attempting to establish connection to browser extension",[s.cq]:"Native extension is not installed. If you think this is a mistake call the initialize function.",[s.XC]:`Connection to native platform has not been established. Please install a compatible browser extension and run initialize().  ${r}`,[s.IR]:`You must call and await the initialize function before attempting to call any other MSAL API.  ${r}`,[s.nF]:"The provided prompt is not supported by the native platform. This request should be routed to the web based flow.",[s._t]:"Invalid base64 encoded string.",[s.bT]:"Invalid PoP token request. The request should not have both a popKid value and signPopToken set to true."};s.p5,s.p5,s.rc,s.rc,s.B2,s.B2,s.wv,s.wv,s.c$,s.c$,s.Lm,s.Lm,s.fA,s.fA,s.oe,s.oe,s.b,s.b,s.hs,s.hs,s.MP,s.MP,s.fN,s.fN,s.OM,s.OM,s.Uf,s.Uf,s.OT,s.OT,s.tZ,s.tZ,s.aH,s.aH,s.lg,s.lg,s.v7,s.v7,s.rR,s.rR,s.hZ,s.hZ,s.y6,s.y6,s.ot,s.ot,s.Ne,s.Ne,s.LW,s.LW,s.Mm,s.Mm,s.tI,s.tI,s.rn,s.rn,s.l7,s.l7,s.zv,s.zv,s.Zw,s.Zw,s.db,s.db,s.s9,s.s9,s.e0,s.e0,s.R3,s.R3,s.xp,s.xp,s.$c,s.$c,s.MG,s.MG,s.gU,s.gU,s.y3,s.y3,s.cq,s.cq,s.XC,s.XC,s.IR,s.IR,s.nF,s.nF,s._t,s._t,s.bT,s.bT;class a extends n.lR{constructor(e){super(e,o[e]),Object.setPrototypeOf(this,a.prototype),this.name="BrowserAuthError"}}function l(e){return new a(e)}},2919(e,t,i){"use strict";i.d(t,{$c:()=>B,B2:()=>r,IR:()=>j,LW:()=>T,Lm:()=>l,MG:()=>V,MP:()=>p,Mm:()=>D,Ne:()=>M,OM:()=>f,OT:()=>y,R3:()=>F,Uf:()=>m,XC:()=>W,Zw:()=>_,_t:()=>K,aH:()=>b,b:()=>u,bT:()=>Y,c$:()=>a,cq:()=>z,db:()=>L,e0:()=>O,fA:()=>c,fN:()=>g,gU:()=>H,hZ:()=>x,hs:()=>d,l7:()=>k,lg:()=>C,nF:()=>$,oe:()=>h,ot:()=>A,p5:()=>n,rR:()=>S,rc:()=>s,rn:()=>R,s9:()=>N,tI:()=>I,tZ:()=>v,v7:()=>w,wv:()=>o,xp:()=>G,y3:()=>U,y6:()=>E,zv:()=>P});const n="pkce_not_created",s="crypto_nonexistent",r="empty_navigate_uri",o="hash_empty_error",a="no_state_in_hash",l="hash_does_not_contain_known_properties",c="unable_to_parse_state",h="state_interaction_type_mismatch",u="interaction_in_progress",d="popup_window_error",p="empty_window_error",g="user_cancelled",f="monitor_popup_timeout",m="monitor_window_timeout",y="redirect_in_iframe",v="block_iframe_reload",b="block_nested_popups",C="iframe_closed_prematurely",w="silent_logout_unsupported",S="no_account_error",x="silent_prompt_value_error",E="no_token_request_cache_error",A="unable_to_parse_token_request_cache_error",M="no_cached_authority_error",T="auth_request_not_set_error",D="invalid_cache_type",I="non_browser_environment",R="database_not_open",k="no_network_connectivity",P="post_request_failed",_="get_request_failed",L="failed_to_parse_response",N="unable_to_load_token",O="crypto_key_not_found",F="auth_code_required",G="auth_code_or_nativeAccountId_required",B="spa_code_and_nativeAccountId_present",V="database_unavailable",H="unable_to_acquire_token_from_native_platform",U="native_handshake_timeout",z="native_extension_not_installed",W="native_connection_not_established",j="uninitialized_public_client_application",$="native_prompt_not_supported",K="invalid_base64_string",Y="invalid_pop_token_request"},24680(e,t,i){"use strict";i.d(t,{jz:()=>a});var n=i(90865),s=i(85362);const r={[s.xz]:"Given storage configuration option was not supported.",[s.dg]:"Stub instance of Public Client Application was called. If using msal-react, please ensure context is not used without a provider. For more visit: aka.ms/msaljs/browser-errors",[s.jE]:"Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true."};s.xz,s.xz,s.dg,s.dg,s.jE,s.jE;class o extends n.lR{constructor(e,t){super(e,t),this.name="BrowserConfigurationAuthError",Object.setPrototypeOf(this,o.prototype)}}function a(e){return new o(e,r[e])}},85362(e,t,i){"use strict";i.d(t,{dg:()=>s,jE:()=>r,xz:()=>n});const n="storage_not_supported",s="stubbed_public_client_application_called",r="in_mem_redirect_unavailable"},99268(e,t,i){"use strict";i.d(t,{B:()=>n});const n={INITIALIZE_START:"msal:initializeStart",INITIALIZE_END:"msal:initializeEnd",ACCOUNT_ADDED:"msal:accountAdded",ACCOUNT_REMOVED:"msal:accountRemoved",ACTIVE_ACCOUNT_CHANGED:"msal:activeAccountChanged",LOGIN_START:"msal:loginStart",LOGIN_SUCCESS:"msal:loginSuccess",LOGIN_FAILURE:"msal:loginFailure",ACQUIRE_TOKEN_START:"msal:acquireTokenStart",ACQUIRE_TOKEN_SUCCESS:"msal:acquireTokenSuccess",ACQUIRE_TOKEN_FAILURE:"msal:acquireTokenFailure",ACQUIRE_TOKEN_NETWORK_START:"msal:acquireTokenFromNetworkStart",SSO_SILENT_START:"msal:ssoSilentStart",SSO_SILENT_SUCCESS:"msal:ssoSilentSuccess",SSO_SILENT_FAILURE:"msal:ssoSilentFailure",ACQUIRE_TOKEN_BY_CODE_START:"msal:acquireTokenByCodeStart",ACQUIRE_TOKEN_BY_CODE_SUCCESS:"msal:acquireTokenByCodeSuccess",ACQUIRE_TOKEN_BY_CODE_FAILURE:"msal:acquireTokenByCodeFailure",HANDLE_REDIRECT_START:"msal:handleRedirectStart",HANDLE_REDIRECT_END:"msal:handleRedirectEnd",POPUP_OPENED:"msal:popupOpened",LOGOUT_START:"msal:logoutStart",LOGOUT_SUCCESS:"msal:logoutSuccess",LOGOUT_FAILURE:"msal:logoutFailure",LOGOUT_END:"msal:logoutEnd",RESTORE_FROM_BFCACHE:"msal:restoreFromBFCache"}},58090(e,t,i){"use strict";i.d(t,{$u:()=>v,Al:()=>a,CC:()=>l,Ct:()=>o,G8:()=>b,H3:()=>u,JD:()=>r,JE:()=>S,L$:()=>x,P3:()=>E,Q1:()=>s,T$:()=>g,WJ:()=>C,X8:()=>p,_p:()=>c,dh:()=>h,f7:()=>y,jb:()=>m,nN:()=>w,sA:()=>d,uq:()=>f});var n=i(14927);const s={INTERACTION_IN_PROGRESS_VALUE:"interaction_in_progress",INVALID_GRANT_ERROR:"invalid_grant",POPUP_WIDTH:483,POPUP_HEIGHT:600,POPUP_NAME_PREFIX:"msal",DEFAULT_POLL_INTERVAL_MS:30,MSAL_SKU:"msal.js.browser"},r={CHANNEL_ID:"53ee284d-920a-4b59-9d30-a60315b26836",PREFERRED_EXTENSION_ID:"ppnbnpeolgkicgegkbkbjmhlideopiji",MATS_TELEMETRY:"MATS"},o={HandshakeRequest:"Handshake",HandshakeResponse:"HandshakeResponse",GetToken:"GetToken",Response:"Response"},a={LocalStorage:"localStorage",SessionStorage:"sessionStorage",MemoryStorage:"memoryStorage"},l={GET:"GET",POST:"POST"},c={AUTHORITY:"authority",ACQUIRE_TOKEN_ACCOUNT:"acquireToken.account",SESSION_STATE:"session.state",REQUEST_STATE:"request.state",NONCE_IDTOKEN:"nonce.id_token",ORIGIN_URI:"request.origin",RENEW_STATUS:"token.renew.status",URL_HASH:"urlHash",REQUEST_PARAMS:"request.params",SCOPES:"scopes",INTERACTION_STATUS_KEY:"interaction.status",CCS_CREDENTIAL:"ccs.credential",CORRELATION_ID:"request.correlationId",NATIVE_REQUEST:"request.native",REDIRECT_CONTEXT:"request.redirect.context"},h={ACCOUNT_KEYS:"msal.account.keys",TOKEN_KEYS:"msal.token.keys"},u={WRAPPER_SKU:"wrapper.sku",WRAPPER_VER:"wrapper.version"},d={acquireTokenRedirect:861,acquireTokenPopup:862,ssoSilent:863,acquireTokenSilent_authCode:864,handleRedirectPromise:865,acquireTokenByCode:866,acquireTokenSilent_silentFlow:61,logout:961,logoutPopup:962};var p;!function(e){e.Redirect="redirect",e.Popup="popup",e.Silent="silent",e.None="none"}(p||(p={}));const g={Startup:"startup",Login:"login",Logout:"logout",AcquireToken:"acquireToken",SsoSilent:"ssoSilent",HandleRedirect:"handleRedirect",None:"none"},f={scopes:n.aZ},m="jwk",y={React:"@azure/msal-react",Angular:"@azure/msal-angular"},v="msal.db",b=1,C=`${v}.keys`,w={Default:0,AccessToken:1,AccessTokenAndRefreshToken:2,RefreshToken:3,RefreshTokenAndNetwork:4,Skip:5},S=[w.Default,w.Skip,w.RefreshTokenAndNetwork],x="msal.browser.log.level",E="msal.browser.log.pii"},90865(e,t,i){"use strict";i.d(t,{lR:()=>o,pz:()=>a});var n=i(14927),s=i(5841);const r={[s.W]:"Unexpected error in authentication.",[s.z]:"Post request failed from the network, could be a 4xx/5xx or a network unavailability. Please check the exact error code for details."};s.W,s.W,s.z,s.z;class o extends Error{constructor(e,t,i){super(t?`${e}: ${t}`:e),Object.setPrototypeOf(this,o.prototype),this.errorCode=e||n.YM.EMPTY_STRING,this.errorMessage=t||n.YM.EMPTY_STRING,this.subError=i||n.YM.EMPTY_STRING,this.name="AuthError"}setCorrelationId(e){this.correlationId=e}}function a(e,t){return new o(e,t?`${r[e]} ${t}`:r[e])}},5841(e,t,i){"use strict";i.d(t,{W:()=>n,z:()=>s});const n="unexpected_error",s="post_request_failed"},95177(e,t,i){"use strict";i.d(t,{$:()=>n,V:()=>r});var n,s=i(14927);!function(e){e[e.Error=0]="Error",e[e.Warning=1]="Warning",e[e.Info=2]="Info",e[e.Verbose=3]="Verbose",e[e.Trace=4]="Trace"}(n||(n={}));class r{constructor(e,t,i){this.level=n.Info;const o=e||r.createDefaultLoggerOptions();this.localCallback=o.loggerCallback||(()=>{}),this.piiLoggingEnabled=o.piiLoggingEnabled||!1,this.level="number"==typeof o.logLevel?o.logLevel:n.Info,this.correlationId=o.correlationId||s.YM.EMPTY_STRING,this.packageName=t||s.YM.EMPTY_STRING,this.packageVersion=i||s.YM.EMPTY_STRING}static createDefaultLoggerOptions(){return{loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:n.Info}}clone(e,t,i){return new r({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level,correlationId:i||this.correlationId},e,t)}logMessage(e,t){if(t.logLevel>this.level||!this.piiLoggingEnabled&&t.containsPii)return;const i=`[${(new Date).toUTCString()}] : [${t.correlationId||this.correlationId||""}] : ${this.packageName}@${this.packageVersion} : ${n[t.logLevel]} - ${e}`;this.executeCallback(t.logLevel,i,t.containsPii||!1)}executeCallback(e,t,i){this.localCallback&&this.localCallback(e,t,i)}error(e,t){this.logMessage(e,{logLevel:n.Error,containsPii:!1,correlationId:t||s.YM.EMPTY_STRING})}errorPii(e,t){this.logMessage(e,{logLevel:n.Error,containsPii:!0,correlationId:t||s.YM.EMPTY_STRING})}warning(e,t){this.logMessage(e,{logLevel:n.Warning,containsPii:!1,correlationId:t||s.YM.EMPTY_STRING})}warningPii(e,t){this.logMessage(e,{logLevel:n.Warning,containsPii:!0,correlationId:t||s.YM.EMPTY_STRING})}info(e,t){this.logMessage(e,{logLevel:n.Info,containsPii:!1,correlationId:t||s.YM.EMPTY_STRING})}infoPii(e,t){this.logMessage(e,{logLevel:n.Info,containsPii:!0,correlationId:t||s.YM.EMPTY_STRING})}verbose(e,t){this.logMessage(e,{logLevel:n.Verbose,containsPii:!1,correlationId:t||s.YM.EMPTY_STRING})}verbosePii(e,t){this.logMessage(e,{logLevel:n.Verbose,containsPii:!0,correlationId:t||s.YM.EMPTY_STRING})}trace(e,t){this.logMessage(e,{logLevel:n.Trace,containsPii:!1,correlationId:t||s.YM.EMPTY_STRING})}tracePii(e,t){this.logMessage(e,{logLevel:n.Trace,containsPii:!0,correlationId:t||s.YM.EMPTY_STRING})}isPiiLoggingEnabled(){return this.piiLoggingEnabled||!1}}},14927(e,t,i){"use strict";i.d(t,{$x:()=>f,E_:()=>x,F0:()=>L,Fq:()=>h,GU:()=>b,Gd:()=>l,I:()=>T,IO:()=>A,JR:()=>C,Kk:()=>I,LR:()=>y,Lz:()=>_,OK:()=>a,Qd:()=>m,Rv:()=>P,Tq:()=>D,Xw:()=>M,YM:()=>n,_2:()=>k,_A:()=>o,_M:()=>u,aG:()=>v,aZ:()=>r,gT:()=>E,hB:()=>w,iF:()=>d,jZ:()=>R,p:()=>g,t3:()=>s,u0:()=>S,v2:()=>c,zL:()=>p});const n={LIBRARY_NAME:"MSAL.JS",SKU:"msal.js.common",CACHE_PREFIX:"msal",DEFAULT_AUTHORITY:"https://login.microsoftonline.com/common/",DEFAULT_AUTHORITY_HOST:"login.microsoftonline.com",DEFAULT_COMMON_TENANT:"common",ADFS:"adfs",DSTS:"dstsv2",AAD_INSTANCE_DISCOVERY_ENDPT:"https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=",CIAM_AUTH_URL:".ciamlogin.com",AAD_TENANT_DOMAIN_SUFFIX:".onmicrosoft.com",RESOURCE_DELIM:"|",NO_ACCOUNT:"NO_ACCOUNT",CLAIMS:"claims",CONSUMER_UTID:"9188040d-6c67-4c5b-b112-36a304b66dad",OPENID_SCOPE:"openid",PROFILE_SCOPE:"profile",OFFLINE_ACCESS_SCOPE:"offline_access",EMAIL_SCOPE:"email",CODE_RESPONSE_TYPE:"code",CODE_GRANT_TYPE:"authorization_code",RT_GRANT_TYPE:"refresh_token",FRAGMENT_RESPONSE_MODE:"fragment",S256_CODE_CHALLENGE_METHOD:"S256",URL_FORM_CONTENT_TYPE:"application/x-www-form-urlencoded;charset=utf-8",AUTHORIZATION_PENDING:"authorization_pending",NOT_DEFINED:"not_defined",EMPTY_STRING:"",NOT_APPLICABLE:"N/A",NOT_AVAILABLE:"Not Available",FORWARD_SLASH:"/",IMDS_ENDPOINT:"http://169.254.169.254/metadata/instance/compute/location",IMDS_VERSION:"2020-06-01",IMDS_TIMEOUT:2e3,AZURE_REGION_AUTO_DISCOVER_FLAG:"TryAutoDetect",REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX:"login.microsoft.com",KNOWN_PUBLIC_CLOUDS:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],TOKEN_RESPONSE_TYPE:"token",ID_TOKEN_RESPONSE_TYPE:"id_token",SHR_NONCE_VALIDITY:240,INVALID_INSTANCE:"invalid_instance"},s={SUCCESS:200,SUCCESS_RANGE_START:200,SUCCESS_RANGE_END:299,REDIRECT:302,CLIENT_ERROR:400,CLIENT_ERROR_RANGE_START:400,BAD_REQUEST:400,UNAUTHORIZED:401,NOT_FOUND:404,REQUEST_TIMEOUT:408,TOO_MANY_REQUESTS:429,CLIENT_ERROR_RANGE_END:499,SERVER_ERROR:500,SERVER_ERROR_RANGE_START:500,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,SERVER_ERROR_RANGE_END:599,MULTI_SIDED_ERROR:600},r=[n.OPENID_SCOPE,n.PROFILE_SCOPE,n.OFFLINE_ACCESS_SCOPE],o=[...r,n.EMAIL_SCOPE],a={CONTENT_TYPE:"Content-Type",RETRY_AFTER:"Retry-After",CCS_HEADER:"X-AnchorMailbox",WWWAuthenticate:"WWW-Authenticate",AuthenticationInfo:"Authentication-Info",X_MS_REQUEST_ID:"x-ms-request-id",X_MS_HTTP_VERSION:"x-ms-httpver"},l={ID_TOKEN:"idtoken",CLIENT_INFO:"client.info",ADAL_ID_TOKEN:"adal.idtoken",ERROR:"error",ERROR_DESC:"error.description",ACTIVE_ACCOUNT:"active-account",ACTIVE_ACCOUNT_FILTERS:"active-account-filters"},c={COMMON:"common",ORGANIZATIONS:"organizations",CONSUMERS:"consumers"},h={ACCESS_TOKEN:"access_token",XMS_CC:"xms_cc"},u={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",CREATE:"create",NO_SESSION:"no_session"},d={PLAIN:"plain",S256:"S256"},p={QUERY:"query",FRAGMENT:"fragment"},g={...p,FORM_POST:"form_post"},f={IMPLICIT_GRANT:"implicit",AUTHORIZATION_CODE_GRANT:"authorization_code",CLIENT_CREDENTIALS_GRANT:"client_credentials",RESOURCE_OWNER_PASSWORD_GRANT:"password",REFRESH_TOKEN_GRANT:"refresh_token",DEVICE_CODE_GRANT:"device_code",JWT_BEARER:"urn:ietf:params:oauth:grant-type:jwt-bearer"},m={MSSTS_ACCOUNT_TYPE:"MSSTS",ADFS_ACCOUNT_TYPE:"ADFS",MSAV1_ACCOUNT_TYPE:"MSA",GENERIC_ACCOUNT_TYPE:"Generic"},y={CACHE_KEY_SEPARATOR:"-",CLIENT_INFO_SEPARATOR:"."},v={ID_TOKEN:"IdToken",ACCESS_TOKEN:"AccessToken",ACCESS_TOKEN_WITH_AUTH_SCHEME:"AccessToken_With_AuthScheme",REFRESH_TOKEN:"RefreshToken"},b="appmetadata",C="client_info",w="1",S={CACHE_KEY:"authority-metadata",REFRESH_TIME_SECONDS:86400},x={CONFIG:"config",CACHE:"cache",NETWORK:"network",HARDCODED_VALUES:"hardcoded_values"},E={SCHEMA_VERSION:5,MAX_CUR_HEADER_BYTES:80,MAX_LAST_HEADER_BYTES:330,MAX_CACHED_ERRORS:50,CACHE_KEY:"server-telemetry",CATEGORY_SEPARATOR:"|",VALUE_SEPARATOR:",",OVERFLOW_TRUE:"1",OVERFLOW_FALSE:"0",UNKNOWN_ERROR:"unknown_error"},A={BEARER:"Bearer",POP:"pop",SSH:"ssh-cert"},M={DEFAULT_THROTTLE_TIME_SECONDS:60,DEFAULT_MAX_THROTTLE_TIME_SECONDS:3600,THROTTLING_PREFIX:"throttling",X_MS_LIB_CAPABILITY_VALUE:"retry-after, h429"},T={INVALID_GRANT_ERROR:"invalid_grant",CLIENT_MISMATCH_ERROR:"client_mismatch"},D={username:"username",password:"password"},I={httpSuccess:200,httpBadRequest:400},R={FAILED_AUTO_DETECTION:"1",INTERNAL_CACHE:"2",ENVIRONMENT_VARIABLE:"3",IMDS:"4"},k={CONFIGURED_MATCHES_DETECTED:"1",CONFIGURED_NO_AUTO_DETECTION:"2",CONFIGURED_NOT_DETECTED:"3",AUTO_DETECTION_REQUESTED_SUCCESSFUL:"4",AUTO_DETECTION_REQUESTED_FAILED:"5"},P={NOT_APPLICABLE:"0",FORCE_REFRESH_OR_CLAIMS:"1",NO_CACHED_ACCESS_TOKEN:"2",CACHED_ACCESS_TOKEN_EXPIRED:"3",PROACTIVELY_REFRESHED:"4"},_={Jwt:"JWT",Jwk:"JWK",Pop:"pop"},L=300},55534(e,t,i){"use strict";i.d(t,{r7:()=>v,dk:()=>b});var n=i(22155),s=i(24680),r=i(85362);const o={initialize:()=>Promise.reject((0,s.jz)(r.dg)),acquireTokenPopup:()=>Promise.reject((0,s.jz)(r.dg)),acquireTokenRedirect:()=>Promise.reject((0,s.jz)(r.dg)),acquireTokenSilent:()=>Promise.reject((0,s.jz)(r.dg)),acquireTokenByCode:()=>Promise.reject((0,s.jz)(r.dg)),getAllAccounts:()=>[],getAccount:()=>null,getAccountByHomeId:()=>null,getAccountByUsername:()=>null,getAccountByLocalId:()=>null,handleRedirectPromise:()=>Promise.reject((0,s.jz)(r.dg)),loginPopup:()=>Promise.reject((0,s.jz)(r.dg)),loginRedirect:()=>Promise.reject((0,s.jz)(r.dg)),logout:()=>Promise.reject((0,s.jz)(r.dg)),logoutRedirect:()=>Promise.reject((0,s.jz)(r.dg)),logoutPopup:()=>Promise.reject((0,s.jz)(r.dg)),ssoSilent:()=>Promise.reject((0,s.jz)(r.dg)),addEventCallback:()=>null,removeEventCallback:()=>{},addPerformanceCallback:()=>"",removePerformanceCallback:()=>!1,enableAccountStorageEvents:()=>{},disableAccountStorageEvents:()=>{},getTokenCache:()=>{throw(0,s.jz)(r.dg)},getLogger:()=>{throw(0,s.jz)(r.dg)},setLogger:()=>{},setActiveAccount:()=>{},getActiveAccount:()=>null,initializeWrapperLibrary:()=>{},setNavigationClient:()=>{},getConfiguration:()=>{throw(0,s.jz)(r.dg)},hydrateCache:()=>Promise.reject((0,s.jz)(r.dg)),clearCache:()=>Promise.reject((0,s.jz)(r.dg))};var a=i(58090),l=i(95177);const c={instance:o,inProgress:a.T$.None,accounts:[],logger:new l.V({})},h=n.createContext(c);h.Consumer;var u=i(99268);class d{static getInteractionStatusFromEvent(e,t){switch(e.eventType){case u.B.LOGIN_START:return a.T$.Login;case u.B.SSO_SILENT_START:return a.T$.SsoSilent;case u.B.ACQUIRE_TOKEN_START:if(e.interactionType===a.X8.Redirect||e.interactionType===a.X8.Popup)return a.T$.AcquireToken;break;case u.B.HANDLE_REDIRECT_START:return a.T$.HandleRedirect;case u.B.LOGOUT_START:return a.T$.Logout;case u.B.SSO_SILENT_SUCCESS:case u.B.SSO_SILENT_FAILURE:if(t&&t!==a.T$.SsoSilent)break;return a.T$.None;case u.B.LOGOUT_END:if(t&&t!==a.T$.Logout)break;return a.T$.None;case u.B.HANDLE_REDIRECT_END:if(t&&t!==a.T$.HandleRedirect)break;return a.T$.None;case u.B.LOGIN_SUCCESS:case u.B.LOGIN_FAILURE:case u.B.ACQUIRE_TOKEN_SUCCESS:case u.B.ACQUIRE_TOKEN_FAILURE:case u.B.RESTORE_FROM_BFCACHE:if(e.interactionType===a.X8.Redirect||e.interactionType===a.X8.Popup){if(t&&t!==a.T$.Login&&t!==a.T$.AcquireToken)break;return a.T$.None}}return null}}function p(e,t){if(e.length!==t.length)return!1;const i=[...t];return e.every(e=>{const t=i.shift();return!(!e||!t)&&e.homeAccountId===t.homeAccountId&&e.localAccountId===t.localAccountId&&e.username===t.username})}const g="2.1.1",f="UNBLOCK_INPROGRESS",m="EVENT",y=(e,t)=>{const{type:i,payload:n}=t;let s=e.inProgress;switch(i){case f:e.inProgress===a.T$.Startup&&(s=a.T$.None,n.logger.info("MsalProvider - handleRedirectPromise resolved, setting inProgress to 'none'"));break;case m:const t=n.message,r=d.getInteractionStatusFromEvent(t,e.inProgress);r&&(n.logger.info(`MsalProvider - ${t.eventType} results in setting inProgress from ${e.inProgress} to ${r}`),s=r);break;default:throw new Error(`Unknown action type: ${i}`)}const r=n.instance.getAllAccounts();return s===e.inProgress||p(r,e.accounts)?s!==e.inProgress?{...e,inProgress:s}:p(r,e.accounts)?e:{...e,accounts:r}:{...e,inProgress:s,accounts:r}};function v({instance:e,children:t}){(0,n.useEffect)(()=>{e.initializeWrapperLibrary(a.f7.React,g)},[e]);const i=(0,n.useMemo)(()=>e.getLogger().clone("@azure/msal-react",g),[e]),[s,r]=(0,n.useReducer)(y,void 0,()=>({inProgress:a.T$.Startup,accounts:e.getAllAccounts()}));(0,n.useEffect)(()=>{const t=e.addEventCallback(t=>{r({payload:{instance:e,logger:i,message:t},type:m})});return i.verbose(`MsalProvider - Registered event callback with id: ${t}`),e.initialize().then(()=>{e.handleRedirectPromise().catch(()=>{}).finally(()=>{r({payload:{instance:e,logger:i},type:f})})}).catch(()=>{}),()=>{t&&(i.verbose(`MsalProvider - Removing event callback ${t}`),e.removeEventCallback(t))}},[e,i]);const o={instance:e,inProgress:s.inProgress,accounts:s.accounts,logger:i};return n.createElement(h.Provider,{value:o},t)}const b=()=>(0,n.useContext)(h);i(90865).lR},13925(e,t,i){"use strict";function n(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}i.d(t,{A:()=>n})},69932(e,t,i){"use strict";function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)({}).hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},n.apply(null,arguments)}i.d(t,{A:()=>n})},5704(e,t,i){"use strict";function n(e,t){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},n(e,t)}function s(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,n(e,t)}i.d(t,{A:()=>s})},12975(e,t,i){"use strict";function n(e,t){if(null==e)return{};var i={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;i[n]=e[n]}return i}i.d(t,{A:()=>n})},72743(e,t,i){"use strict";function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i<t;i++)n[i]=e[i];return n}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,s,r,o,a=[],l=!0,c=!1;try{if(r=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=r.call(i)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){c=!0,s=e}finally{try{if(!l&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(c)throw s}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?n(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}i.d(t,{A:()=>s})},97408(e,t,i){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}i.d(t,{A:()=>n})},15115(e,t,i){"use strict";i.d(t,{Ar:()=>c,Bc:()=>Se,Gw:()=>he,OO:()=>ke,_5:()=>o,et:()=>l,wm:()=>me,yU:()=>Re});var n=i(1993),s=i(51104),r=i(62388);class o{constructor(e,t,i,n){this.state=e,this.pos=t,this.explicit=i,this.view=n,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=(0,r.mv)(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),i=Math.max(t.from,this.pos-250),n=t.text.slice(i-t.from,this.pos-t.from),s=n.search(d(e,!1));return s<0?null:{from:i+s,to:this.pos,text:n.slice(s)}}get aborted(){return null==this.abortListeners}addEventListener(e,t,i){"abort"==e&&this.abortListeners&&(this.abortListeners.push(t),i&&i.onDocChange&&(this.abortOnDocChange=!0))}}function a(e){let t=Object.keys(e).join(""),i=/\w/.test(t);return i&&(t=t.replace(/\w/g,"")),`[${i?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function l(e){let t=e.map(e=>"string"==typeof e?{label:e}:e),[i,n]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:function(e){let t=Object.create(null),i=Object.create(null);for(let{label:n}of e){t[n[0]]=!0;for(let e=1;e<n.length;e++)i[n[e]]=!0}let n=a(t)+a(i)+"*$";return[new RegExp("^"+n),new RegExp(n)]}(t);return e=>{let s=e.matchBefore(n);return s||e.explicit?{from:s?s.from:e.pos,options:t,validFor:i}:null}}function c(e,t){return i=>{for(let t=(0,r.mv)(i.state).resolveInner(i.pos,-1);t;t=t.parent){if(e.indexOf(t.name)>-1)return null;if(t.type.isTop)break}return t(i)}}class h{constructor(e,t,i,n){this.completion=e,this.source=t,this.match=i,this.score=n}}function u(e){return e.selection.main.from}function d(e,t){var i;let{source:n}=e,s=t&&"^"!=n[0],r="$"!=n[n.length-1];return s||r?new RegExp(`${s?"^":""}(?:${n})${r?"$":""}`,null!==(i=e.flags)&&void 0!==i?i:e.ignoreCase?"i":""):e}const p=n.YH.define();function g(e,t,i,s){let{main:r}=e.selection,o=i-r.from,a=s-r.from;return{...e.changeByRange(l=>{if(l!=r&&i!=s&&e.sliceDoc(l.from+o,l.from+a)!=e.sliceDoc(i,s))return{range:l};let c=e.toText(t);return{changes:{from:l.from+o,to:s==r.from?l.to:l.from+a,insert:c},range:n.OF.cursor(l.from+o+c.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const f=new WeakMap;function m(e){if(!Array.isArray(e))return e;let t=f.get(e);return t||f.set(e,t=l(e)),t}const y=n.Pe.define(),v=n.Pe.define();class b{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let i=(0,n.vS)(e,t),s=(0,n.Fh)(i);this.chars.push(i);let r=e.slice(t,t+s),o=r.toUpperCase();this.folded.push((0,n.vS)(o==r?r.toLowerCase():o,0)),t+=s}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(0==this.pattern.length)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:i,any:s,precise:r,byWord:o}=this;if(1==t.length){let s=(0,n.vS)(e,0),r=(0,n.Fh)(s),o=r==e.length?0:-100;if(s==t[0]);else{if(s!=i[0])return null;o+=-200}return this.ret(o,[0,r])}let a=e.indexOf(this.pattern);if(0==a)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let l=t.length,c=0;if(a<0){for(let r=0,o=Math.min(e.length,200);r<o&&c<l;){let o=(0,n.vS)(e,r);o!=t[c]&&o!=i[c]||(s[c++]=r),r+=(0,n.Fh)(o)}if(c<l)return null}let h=0,u=0,d=!1,p=0,g=-1,f=-1,m=/[a-z]/.test(e),y=!0;for(let s=0,c=Math.min(e.length,200),v=0;s<c&&u<l;){let c=(0,n.vS)(e,s);a<0&&(h<l&&c==t[h]&&(r[h++]=s),p<l&&(c==t[p]||c==i[p]?(0==p&&(g=s),f=s+1,p++):p=0));let b,C=c<255?c>=48&&c<=57||c>=97&&c<=122?2:c>=65&&c<=90?1:0:(b=(0,n.MK)(c))!=b.toLowerCase()?1:b!=b.toUpperCase()?2:0;(!s||1==C&&m||0==v&&0!=C)&&(t[u]==c||i[u]==c&&(d=!0)?o[u++]=s:o.length&&(y=!1)),v=C,s+=(0,n.Fh)(c)}return u==l&&0==o[0]&&y?this.result((d?-200:0)-100,o,e):p==l&&0==g?this.ret(-200-e.length+(f==e.length?0:-100),[0,f]):a>-1?this.ret(-700-e.length,[a,a+this.pattern.length]):p==l?this.ret(-900-e.length,[g,f]):u==l?this.result((d?-200:0)-100-700+(y?0:-1100),o,e):2==t.length?null:this.result((s[0]?-700:0)-200-1100,s,e)}result(e,t,i){let s=[],r=0;for(let e of t){let t=e+(this.astral?(0,n.Fh)((0,n.vS)(i,e)):1);r&&s[r-1]==e?s[r-1]=t:(s[r++]=e,s[r++]=t)}return this.ret(e-i.length,s)}}class C{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),i=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return null==i?null:(this.matched=[0,t.length],this.score=i+(e.length==this.pattern.length?0:-100),this)}}const w=n.sj.define({combine:e=>(0,n.QR)(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:x,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>i=>S(e(i),t(i)),optionClass:(e,t)=>i=>S(e(i),t(i)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})});function S(e,t){return e?t?e+" "+t:e:t}function x(e,t,i,n,r,o){let a,l,c=e.textDirection==s.OP.RTL,h=c,u=!1,d="top",p=t.left-r.left,g=r.right-t.right,f=n.right-n.left,m=n.bottom-n.top;if(h&&p<Math.min(f,g)?h=!1:!h&&g<Math.min(f,p)&&(h=!0),f<=(h?p:g))a=Math.max(r.top,Math.min(i.top,r.bottom-m))-t.top,l=Math.min(400,h?p:g);else{u=!0,l=Math.min(400,(c?t.right:r.right-t.left)-30);let e=r.bottom-t.bottom;e>=m||e>t.top?a=i.bottom-t.top:(d="bottom",a=t.bottom-i.top)}return{style:`${d}: ${a/((t.bottom-t.top)/o.offsetHeight)}px; max-width: ${l/((t.right-t.left)/o.offsetWidth)}px`,class:"cm-completionInfo-"+(u?c?"left-narrow":"right-narrow":h?"left":"right")}}const E=n.Pe.define();function A(e,t,i){if(e<=i)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/i);return{from:e*i,to:(e+1)*i}}let n=Math.ceil((e-t)/i);return{from:e-n*i,to:e-(n-1)*i}}class M{constructor(e,t,i){this.view=e,this.stateField=t,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass="";let n=e.state.field(t),{options:s,selected:r}=n.open,o=e.state.facet(w);this.optionContent=function(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement("div");return t.classList.add("cm-completionIcon"),e.type&&t.classList.add(...e.type.split(/\s+/g).map(e=>"cm-completionIcon-"+e)),t.setAttribute("aria-hidden","true"),t},position:20}),t.push({render(e,t,i,n){let s=document.createElement("span");s.className="cm-completionLabel";let r=e.displayLabel||e.label,o=0;for(let e=0;e<n.length;){let t=n[e++],i=n[e++];t>o&&s.appendChild(document.createTextNode(r.slice(o,t)));let a=s.appendChild(document.createElement("span"));a.appendChild(document.createTextNode(r.slice(t,i))),a.className="cm-completionMatchedText",o=i}return o<r.length&&s.appendChild(document.createTextNode(r.slice(o))),s},position:50},{render(e){if(!e.detail)return null;let t=document.createElement("span");return t.className="cm-completionDetail",t.textContent=e.detail,t},position:80}),t.sort((e,t)=>e.position-t.position).map(e=>e.render)}(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=A(s.length,r,o.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",i=>{let{options:n}=e.state.field(t).open;for(let t,s=i.target;s&&s!=this.dom;s=s.parentNode)if("LI"==s.nodeName&&(t=/-(\d+)$/.exec(s.id))&&+t[1]<n.length)return this.applyCompletion(e,n[+t[1]]),void i.preventDefault();if(i.target==this.list){let t=this.list.classList.contains("cm-completionListIncompleteTop")&&i.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains("cm-completionListIncompleteBottom")&&i.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;null!=t&&(e.dispatch({effects:E.of(t)}),i.preventDefault())}}),this.dom.addEventListener("focusout",t=>{let i=e.state.field(this.stateField,!1);i&&i.tooltip&&e.state.facet(w).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:v.of(null)})}),this.showOptions(s,n.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let i=e.state.field(this.stateField),n=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),i!=n){let{options:s,selected:r,disabled:o}=i.open;n.open&&n.open.options==s||(this.range=A(s.length,r,e.state.facet(w).maxRenderedOptions),this.showOptions(s,i.id)),this.updateSel(),o!=(null===(t=n.open)||void 0===t?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!o)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(" "))e&&this.dom.classList.remove(e);for(let e of t.split(" "))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=A(t.options.length,t.selected,this.view.state.facet(w).maxRenderedOptions),this.showOptions(t.options,e.id));let i=this.updateSelectedOption(t.selected);if(i){this.destroyInfo();let{completion:n}=t.options[t.selected],{info:r}=n;if(!r)return;let o="string"==typeof r?document.createTextNode(r):r(n);if(!o)return;"then"in o?o.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,n)}).catch(e=>(0,s.c_)(this.view.state,e,"completion info")):(this.addInfoPane(o,n),i.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,t){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",i.id="cm-completionInfo-"+Math.floor(65535*Math.random()).toString(16),null!=e.nodeType)i.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:n}=e;i.appendChild(t),this.infoDestroy=n||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let i=this.list.firstChild,n=this.range.from;i;i=i.nextSibling,n++)"LI"==i.nodeName&&i.id?n==e?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),t=i):i.hasAttribute("aria-selected")&&(i.removeAttribute("aria-selected"),i.removeAttribute("aria-describedby")):n--;return t&&function(e,t){let i=e.getBoundingClientRect(),n=t.getBoundingClientRect(),s=i.height/e.offsetHeight;n.top<i.top?e.scrollTop-=(i.top-n.top)/s:n.bottom>i.bottom&&(e.scrollTop+=(n.bottom-i.bottom)/s)}(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),n=e.getBoundingClientRect(),s=this.space;if(!s){let e=this.dom.ownerDocument.documentElement;s={left:0,top:0,right:e.clientWidth,bottom:e.clientHeight}}return n.top>Math.min(s.bottom,t.bottom)-10||n.bottom<Math.max(s.top,t.top)+10?null:this.view.state.facet(w).positionInfo(this.view,t,n,i,s,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,i){const n=document.createElement("ul");n.id=t,n.setAttribute("role","listbox"),n.setAttribute("aria-expanded","true"),n.setAttribute("aria-label",this.view.state.phrase("Completions")),n.addEventListener("mousedown",e=>{e.target==n&&e.preventDefault()});let s=null;for(let r=i.from;r<i.to;r++){let{completion:o,match:a}=e[r],{section:l}=o;if(l){let e="string"==typeof l?l:l.name;e!=s&&(r>i.from||0==i.from)&&(s=e,"string"!=typeof l&&l.header?n.appendChild(l.header(l)):n.appendChild(document.createElement("completion-section")).textContent=e)}const c=n.appendChild(document.createElement("li"));c.id=t+"-"+r,c.setAttribute("role","option");let h=this.optionClass(o);h&&(c.className=h);for(let e of this.optionContent){let t=e(o,this.view.state,this.view,a);t&&c.appendChild(t)}}return i.from&&n.classList.add("cm-completionListIncompleteTop"),i.to<e.length&&n.classList.add("cm-completionListIncompleteBottom"),n}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function T(e,t){return i=>new M(i,e,t)}function D(e){return 100*(e.boost||0)+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}class I{constructor(e,t,i,n,s,r){this.options=e,this.attrs=t,this.tooltip=i,this.timestamp=n,this.selected=s,this.disabled=r}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new I(this.options,_(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,i,n,s,r){if(n&&!r&&e.some(e=>e.isPending))return n.setDisabled();let o=function(e,t){let i=[],n=null,s=null,r=e=>{i.push(e);let{section:t}=e.completion;if(t){n||(n=[]);let e="string"==typeof t?t:t.name;n.some(t=>t.name==e)||n.push("string"==typeof t?{name:e}:t)}},o=t.facet(w);for(let n of e)if(n.hasResult()){let e=n.result.getMatch;if(!1===n.result.filter)for(let t of n.result.options)r(new h(t,n.source,e?e(t):[],1e9-i.length));else{let i,a=t.sliceDoc(n.from,n.to),l=o.filterStrict?new C(a):new b(a);for(let t of n.result.options)if(i=l.match(t.label)){let o=t.displayLabel?e?e(t,i.matched):[]:i.matched,a=i.score+(t.boost||0);if(r(new h(t,n.source,o,a)),"object"==typeof t.section&&"dynamic"===t.section.rank){let{name:e}=t.section;s||(s=Object.create(null)),s[e]=Math.max(a,s[e]||-1e9)}}}}if(n){let e=Object.create(null),t=0,r=(e,t)=>("dynamic"===e.rank&&"dynamic"===t.rank?s[t.name]-s[e.name]:0)||("number"==typeof e.rank?e.rank:1e9)-("number"==typeof t.rank?t.rank:1e9)||(e.name<t.name?-1:1);for(let i of n.sort(r))t-=1e5,e[i.name]=t;for(let t of i){let{section:i}=t.completion;i&&(t.score+=e["string"==typeof i?i:i.name])}}let a=[],l=null,c=o.compareCompletions;for(let e of i.sort((e,t)=>t.score-e.score||c(e.completion,t.completion))){let t=e.completion;!l||l.label!=t.label||l.detail!=t.detail||null!=l.type&&null!=t.type&&l.type!=t.type||l.apply!=t.apply||l.boost!=t.boost?a.push(e):D(e.completion)>D(l)&&(a[a.length-1]=e),l=e.completion}return a}(e,t);if(!o.length)return n&&e.some(e=>e.isPending)?n.setDisabled():null;let a=t.facet(w).selectOnOpen?0:-1;if(n&&n.selected!=a&&-1!=n.selected){let e=n.options[n.selected].completion;for(let t=0;t<o.length;t++)if(o[t].completion==e){a=t;break}}return new I(o,_(i,a),{pos:e.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:H,above:s.aboveCursor},n?n.timestamp:Date.now(),a,!1)}map(e){return new I(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new I(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class R{constructor(e,t,i){this.active=e,this.id=t,this.open=i}static start(){return new R(L,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(e){let{state:t}=e,i=t.facet(w),n=(i.override||t.languageDataAt("autocomplete",u(t)).map(m)).map(t=>(this.active.find(e=>e.source==t)||new O(t,this.active.some(e=>0!=e.state)?1:0)).update(e,i));n.length==this.active.length&&n.every((e,t)=>e==this.active[t])&&(n=this.active);let s=this.open,r=e.effects.some(e=>e.is(G));s&&e.docChanged&&(s=s.map(e.changes)),e.selection||n.some(t=>t.hasResult()&&e.changes.touchesRange(t.from,t.to))||!function(e,t){if(e==t)return!0;for(let i=0,n=0;;){for(;i<e.length&&!e[i].hasResult();)i++;for(;n<t.length&&!t[n].hasResult();)n++;let s=i==e.length,r=n==t.length;if(s||r)return s==r;if(e[i++].result!=t[n++].result)return!1}}(n,this.active)||r?s=I.build(n,t,this.id,s,i,r):s&&s.disabled&&!n.some(e=>e.isPending)&&(s=null),!s&&n.every(e=>!e.isPending)&&n.some(e=>e.hasResult())&&(n=n.map(e=>e.hasResult()?new O(e.source,0):e));for(let t of e.effects)t.is(E)&&(s=s&&s.setSelected(t.value,this.id));return n==this.active&&s==this.open?this:new R(n,this.id,s)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?k:P}}const k={"aria-autocomplete":"list"},P={};function _(e,t){let i={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(i["aria-activedescendant"]=e+"-"+t),i}const L=[];function N(e,t){if(e.isUserEvent("input.complete")){let i=e.annotation(p);if(i&&t.activateOnCompletion(i))return 12}let i=e.isUserEvent("input.type");return i&&t.activateOnTyping?5:i?1:e.isUserEvent("delete.backward")?2:e.selection?8:e.docChanged?16:0}class O{constructor(e,t,i=!1){this.source=e,this.state=t,this.explicit=i}hasResult(){return!1}get isPending(){return 1==this.state}update(e,t){let i=N(e,t),n=this;(8&i||16&i&&this.touches(e))&&(n=new O(n.source,0)),4&i&&0==n.state&&(n=new O(this.source,1)),n=n.updateFor(e,i);for(let t of e.effects)if(t.is(y))n=new O(n.source,1,t.value);else if(t.is(v))n=new O(n.source,0);else if(t.is(G))for(let e of t.value)e.source==n.source&&(n=e);return n}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(u(e.state))}}class F extends O{constructor(e,t,i,n,s,r){super(e,3,t),this.limit=i,this.result=n,this.from=s,this.to=r}hasResult(){return!0}updateFor(e,t){var i;if(!(3&t))return this.map(e.changes);let n=this.result;n.map&&!e.changes.empty&&(n=n.map(n,e.changes));let s=e.changes.mapPos(this.from),r=e.changes.mapPos(this.to,1),a=u(e.state);if(a>r||!n||2&t&&(u(e.startState)==this.from||a<this.limit))return new O(this.source,4&t?1:0);let l=e.changes.mapPos(this.limit);return function(e,t,i,n){if(!e)return!1;let s=t.sliceDoc(i,n);return"function"==typeof e?e(s,i,n,t):d(e,!0).test(s)}(n.validFor,e.state,s,r)?new F(this.source,this.explicit,l,n,s,r):n.update&&(n=n.update(n,s,r,new o(e.state,a,!1)))?new F(this.source,this.explicit,l,n,n.from,null!==(i=n.to)&&void 0!==i?i:u(e.state)):new O(this.source,1,this.explicit)}map(e){if(e.empty)return this;let t=this.result.map?this.result.map(this.result,e):this.result;return t?new F(this.source,this.explicit,e.mapPos(this.limit),t,e.mapPos(this.from),e.mapPos(this.to,1)):new O(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}const G=n.Pe.define({map:(e,t)=>e.map(e=>e.map(t))}),B=n.sU.define({create:()=>R.start(),update:(e,t)=>e.update(t),provide:e=>[s.DK.from(e,e=>e.tooltip),s.Lz.contentAttributes.from(e,e=>e.attrs)]});function V(e,t){const i=t.completion.apply||t.completion.label;let n=e.state.field(B).active.find(e=>e.source==t.source);return n instanceof F&&("string"==typeof i?e.dispatch({...g(e.state,i,n.from,n.to),annotations:p.of(t.completion)}):i(e,t.completion,n.from,n.to),!0)}const H=T(B,V);function U(e,t="option"){return i=>{let n=i.state.field(B,!1);if(!n||!n.open||n.open.disabled||Date.now()-n.open.timestamp<i.state.facet(w).interactionDelay)return!1;let r,o=1;"page"==t&&(r=(0,s.Eg)(i,n.open.tooltip))&&(o=Math.max(2,Math.floor(r.dom.offsetHeight/r.dom.querySelector("li").offsetHeight)-1));let{length:a}=n.open.options,l=n.open.selected>-1?n.open.selected+o*(e?1:-1):e?0:a-1;return l<0?l="page"==t?0:a-1:l>=a&&(l="page"==t?a-1:0),i.dispatch({effects:E.of(l)}),!0}}const z=e=>!!e.state.field(B,!1)&&(e.dispatch({effects:y.of(!0)}),!0);class W{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const j=s.Z9.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(B).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(B),i=e.state.facet(w);if(!e.selectionSet&&!e.docChanged&&e.startState.field(B)==t)return;let n=e.transactions.some(e=>{let t=N(e,i);return 8&t||(e.selection||e.docChanged)&&!(3&t)});for(let t=0;t<this.running.length;t++){let i=this.running[t];if(n||i.context.abortOnDocChange&&e.docChanged||i.updates.length+e.transactions.length>50&&Date.now()-i.time>1e3){for(let e of i.context.abortListeners)try{e()}catch(e){(0,s.c_)(this.view.state,e)}i.context.abortListeners=null,this.running.splice(t--,1)}else i.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(e=>e.effects.some(e=>e.is(y)))&&(this.pendingStart=!0);let r=this.pendingStart?50:i.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(e=>e.isPending&&!this.running.some(t=>t.active.source==e.source))?setTimeout(()=>this.startUpdate(),r):-1,0!=this.composing)for(let t of e.transactions)t.isUserEvent("input.type")?this.composing=2:2==this.composing&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(B);for(let e of t.active)e.isPending&&!this.running.some(t=>t.active.source==e.source)&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(w).updateSyncTime))}startQuery(e){let{state:t}=this.view,i=u(t),n=new o(t,i,e.explicit,this.view),r=new W(e,n);this.running.push(r),Promise.resolve(e.source(n)).then(e=>{r.context.aborted||(r.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:v.of(null)}),(0,s.c_)(this.view.state,e)})}scheduleAccept(){this.running.every(e=>void 0!==e.done)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(w).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],i=this.view.state.facet(w),n=this.view.state.field(B);for(let s=0;s<this.running.length;s++){let r=this.running[s];if(void 0===r.done)continue;if(this.running.splice(s--,1),r.done){let n=u(r.updates.length?r.updates[0].startState:this.view.state),s=Math.min(n,r.done.from+(r.active.explicit?0:1)),o=new F(r.active.source,r.active.explicit,s,r.done,r.done.from,null!==(e=r.done.to)&&void 0!==e?e:n);for(let e of r.updates)o=o.update(e,i);if(o.hasResult()){t.push(o);continue}}let o=n.active.find(e=>e.source==r.active.source);if(o&&o.isPending)if(null==r.done){let e=new O(r.active.source,0);for(let t of r.updates)e=e.update(t,i);e.isPending||t.push(e)}else this.startQuery(o)}(t.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:G.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(B,!1);if(t&&t.tooltip&&this.view.state.facet(w).closeOnBlur){let i=t.open&&(0,s.Eg)(this.view,t.open.tooltip);i&&i.dom.contains(e.relatedTarget)||setTimeout(()=>this.view.dispatch({effects:v.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout(()=>this.view.dispatch({effects:y.of(!1)}),20),this.composing=0}}}),$="object"==typeof navigator&&/Win/.test(navigator.platform),K=n.Nb.highest(s.Lz.domEventHandlers({keydown(e,t){let i=t.state.field(B,!1);if(!i||!i.open||i.open.disabled||i.open.selected<0||e.key.length>1||e.ctrlKey&&(!$||!e.altKey)||e.metaKey)return!1;let n=i.open.options[i.open.selected],s=i.active.find(e=>e.source==n.source),r=n.completion.commitCharacters||s.result.commitCharacters;return r&&r.indexOf(e.key)>-1&&V(t,n),!1}})),Y=s.Lz.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class q{constructor(e,t,i,n){this.field=e,this.line=t,this.from=i,this.to=n}}class X{constructor(e,t,i){this.field=e,this.from=t,this.to=i}map(e){let t=e.mapPos(this.from,-1,n.iR.TrackDel),i=e.mapPos(this.to,1,n.iR.TrackDel);return null==t||null==i?null:new X(this.field,t,i)}}class Z{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let i=[],n=[t],s=e.doc.lineAt(t),o=/^\s*/.exec(s.text)[0];for(let s of this.lines){if(i.length){let i=o,a=/^\t*/.exec(s)[0].length;for(let t=0;t<a;t++)i+=e.facet(r.Xt);n.push(t+i.length-a),s=i+s.slice(a)}i.push(s),t+=s.length+1}let a=this.fieldPositions.map(e=>new X(e.field,n[e.line]+e.from,n[e.line]+e.to));return{text:i,ranges:a}}static parse(e){let t,i=[],n=[],s=[];for(let r of e.split(/\r\n?|\n/)){for(;t=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(r);){let e=t[1]?+t[1]:null,o=t[2]||t[3]||"",a=-1;0===e&&(e=1e9);let l=o.replace(/\\[{}]/g,e=>e[1]);for(let t=0;t<i.length;t++)(null!=e?i[t].seq==e:l&&i[t].name==l)&&(a=t);if(a<0){let t=0;for(;t<i.length&&(null==e||null!=i[t].seq&&i[t].seq<e);)t++;i.splice(t,0,{seq:e,name:l}),a=t;for(let e of s)e.field>=a&&e.field++}for(let e of s)if(e.line==n.length&&e.from>t.index){let i=t[2]?3+(t[1]||"").length:2;e.from-=i,e.to-=i}s.push(new q(a,n.length,t.index,t.index+l.length)),r=r.slice(0,t.index)+o+r.slice(t.index+t[0].length)}r=r.replace(/\\([{}])/g,(e,t,i)=>{for(let e of s)e.line==n.length&&e.from>i&&(e.from--,e.to--);return t}),n.push(r)}return new Z(n,s)}}let Q=s.NZ.widget({widget:new class extends s.xO{toDOM(){let e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}ignoreEvent(){return!1}}}),J=s.NZ.mark({class:"cm-snippetField"});class ee{constructor(e,t){this.ranges=e,this.active=t,this.deco=s.NZ.set(e.map(e=>(e.from==e.to?Q:J).range(e.from,e.to)),!0)}map(e){let t=[];for(let i of this.ranges){let n=i.map(e);if(!n)return null;t.push(n)}return new ee(t,this.active)}selectionInsideField(e){return e.ranges.every(e=>this.ranges.some(t=>t.field==this.active&&t.from<=e.from&&t.to>=e.to))}}const te=n.Pe.define({map:(e,t)=>e&&e.map(t)}),ie=n.Pe.define(),ne=n.sU.define({create:()=>null,update(e,t){for(let i of t.effects){if(i.is(te))return i.value;if(i.is(ie)&&e)return new ee(e.ranges,i.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>s.Lz.decorations.from(e,e=>e?e.deco:s.NZ.none)});function se(e,t){return n.OF.create(e.filter(e=>e.field==t).map(e=>n.OF.range(e.from,e.to)))}function re(e){let t=Z.parse(e);return(e,i,s,r)=>{let{text:o,ranges:a}=t.instantiate(e.state,s),{main:l}=e.state.selection,c={changes:{from:s,to:r==l.from?l.to:r,insert:n.EY.of(o)},scrollIntoView:!0,annotations:i?[p.of(i),n.ZX.userEvent.of("input.complete")]:void 0};if(a.length&&(c.selection=se(a,0)),a.some(e=>e.field>0)){let t=new ee(a,0),i=c.effects=[te.of(t)];void 0===e.state.field(ne,!1)&&i.push(n.Pe.appendConfig.of([ne,ce,ue,Y]))}e.dispatch(e.state.update(c))}}function oe(e){return({state:t,dispatch:i})=>{let n=t.field(ne,!1);if(!n||e<0&&0==n.active)return!1;let s=n.active+e,r=e>0&&!n.ranges.some(t=>t.field==s+e);return i(t.update({selection:se(n.ranges,s),effects:te.of(r?null:new ee(n.ranges,s)),scrollIntoView:!0})),!0}}const ae=[{key:"Tab",run:oe(1),shift:oe(-1)},{key:"Escape",run:({state:e,dispatch:t})=>!!e.field(ne,!1)&&(t(e.update({effects:te.of(null)})),!0)}],le=n.sj.define({combine:e=>e.length?e[0]:ae}),ce=n.Nb.highest(s.w4.compute([le],e=>e.facet(le)));function he(e,t){return{...t,apply:re(e)}}const ue=s.Lz.domEventHandlers({mousedown(e,t){let i,n=t.state.field(ne,!1);if(!n||null==(i=t.posAtCoords({x:e.clientX,y:e.clientY})))return!1;let s=n.ranges.find(e=>e.from<=i&&e.to>=i);return!(!s||s.field==n.active||(t.dispatch({selection:se(n.ranges,s.field),effects:te.of(n.ranges.some(e=>e.field>s.field)?new ee(n.ranges,s.field):null),scrollIntoView:!0}),0))}}),de={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},pe=n.Pe.define({map(e,t){let i=t.mapPos(e,-1,n.iR.TrackAfter);return null==i?void 0:i}}),ge=new class extends n.FB{};ge.startSide=1,ge.endSide=-1;const fe=n.sU.define({create:()=>n.om.empty,update(e,t){if(e=e.map(t.changes),t.selection){let i=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:e=>e>=i.from&&e<=i.to})}for(let i of t.effects)i.is(pe)&&(e=e.update({add:[ge.range(i.value,i.value+1)]}));return e}});function me(){return[we,fe]}const ye="()[]{}<>«»»«［］｛｝";function ve(e){for(let t=0;t<16;t+=2)if(ye.charCodeAt(t)==e)return ye.charAt(t+1);return(0,n.MK)(e<128?e:e+1)}function be(e,t){return e.languageDataAt("closeBrackets",t)[0]||de}const Ce="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),we=s.Lz.inputHandler.of((e,t,i,s)=>{if((Ce?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let r=e.state.selection.main;if(s.length>2||2==s.length&&1==(0,n.Fh)((0,n.vS)(s,0))||t!=r.from||i!=r.to)return!1;let o=function(e,t){let i=be(e,e.selection.main.head),s=i.brackets||de.brackets;for(let r of s){let o=ve((0,n.vS)(r,0));if(t==r)return o==r?Te(e,r,s.indexOf(r+r+r)>-1,i):Ae(e,r,o,i.before||de.before);if(t==o&&xe(e,e.selection.main.from))return Me(e,0,o)}return null}(e.state,s);return!!o&&(e.dispatch(o),!0)}),Se=[{key:"Backspace",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=be(e,e.selection.main.head).brackets||de.brackets,s=null,r=e.changeByRange(t=>{if(t.empty){let s=function(e,t){let i=e.sliceString(t-2,t);return(0,n.Fh)((0,n.vS)(i,0))==i.length?i:i.slice(1)}(e.doc,t.head);for(let r of i)if(r==s&&Ee(e.doc,t.head)==ve((0,n.vS)(r,0)))return{changes:{from:t.head-r.length,to:t.head+r.length},range:n.OF.cursor(t.head-r.length)}}return{range:s=t}});return s||t(e.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!s}}];function xe(e,t){let i=!1;return e.field(fe).between(0,e.doc.length,e=>{e==t&&(i=!0)}),i}function Ee(e,t){let i=e.sliceString(t,t+2);return i.slice(0,(0,n.Fh)((0,n.vS)(i,0)))}function Ae(e,t,i,s){let r=null,o=e.changeByRange(o=>{if(!o.empty)return{changes:[{insert:t,from:o.from},{insert:i,from:o.to}],effects:pe.of(o.to+t.length),range:n.OF.range(o.anchor+t.length,o.head+t.length)};let a=Ee(e.doc,o.head);return!a||/\s/.test(a)||s.indexOf(a)>-1?{changes:{insert:t+i,from:o.head},effects:pe.of(o.head+t.length),range:n.OF.cursor(o.head+t.length)}:{range:r=o}});return r?null:e.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function Me(e,t,i){let s=null,r=e.changeByRange(t=>t.empty&&Ee(e.doc,t.head)==i?{changes:{from:t.head,to:t.head+i.length,insert:i},range:n.OF.cursor(t.head+i.length)}:s={range:t});return s?null:e.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function Te(e,t,i,s){let o=s.stringPrefixes||de.stringPrefixes,a=null,l=e.changeByRange(s=>{if(!s.empty)return{changes:[{insert:t,from:s.from},{insert:t,from:s.to}],effects:pe.of(s.to+t.length),range:n.OF.range(s.anchor+t.length,s.head+t.length)};let l,c=s.head,h=Ee(e.doc,c);if(h==t){if(De(e,c))return{changes:{insert:t+t,from:c},effects:pe.of(c+t.length),range:n.OF.cursor(c+t.length)};if(xe(e,c)){let s=i&&e.sliceDoc(c,c+3*t.length)==t+t+t?t+t+t:t;return{changes:{from:c,to:c+s.length,insert:s},range:n.OF.cursor(c+s.length)}}}else{if(i&&e.sliceDoc(c-2*t.length,c)==t+t&&(l=Ie(e,c-2*t.length,o))>-1&&De(e,l))return{changes:{insert:t+t+t+t,from:c},effects:pe.of(c+t.length),range:n.OF.cursor(c+t.length)};if(e.charCategorizer(c)(h)!=n.Je.Word&&Ie(e,c,o)>-1&&!function(e,t,i,n){let s=(0,r.mv)(e).resolveInner(t,-1),o=n.reduce((e,t)=>Math.max(e,t.length),0);for(let r=0;r<5;r++){let r=e.sliceDoc(s.from,Math.min(s.to,s.from+i.length+o)),a=r.indexOf(i);if(!a||a>-1&&n.indexOf(r.slice(0,a))>-1){let t=s.firstChild;for(;t&&t.from==s.from&&t.to-t.from>i.length+a;){if(e.sliceDoc(t.to-i.length,t.to)==i)return!1;t=t.firstChild}return!0}let l=s.to==t&&s.parent;if(!l)break;s=l}return!1}(e,c,t,o))return{changes:{insert:t+t,from:c},effects:pe.of(c+t.length),range:n.OF.cursor(c+t.length)}}return{range:a=s}});return a?null:e.update(l,{scrollIntoView:!0,userEvent:"input.type"})}function De(e,t){let i=(0,r.mv)(e).resolveInner(t+1);return i.parent&&i.from==t}function Ie(e,t,i){let s=e.charCategorizer(t);if(s(e.sliceDoc(t-1,t))!=n.Je.Word)return t;for(let r of i){let i=t-r.length;if(e.sliceDoc(i,t)==r&&s(e.sliceDoc(i-1,i))!=n.Je.Word)return i}return-1}function Re(e={}){return[K,B,w.of(e),j,Pe,Y]}const ke=[{key:"Ctrl-Space",run:z},{mac:"Alt-`",run:z},{mac:"Alt-i",run:z},{key:"Escape",run:e=>{let t=e.state.field(B,!1);return!(!t||!t.active.some(e=>0!=e.state)||(e.dispatch({effects:v.of(null)}),0))}},{key:"ArrowDown",run:U(!0)},{key:"ArrowUp",run:U(!1)},{key:"PageDown",run:U(!0,"page")},{key:"PageUp",run:U(!1,"page")},{key:"Enter",run:e=>{let t=e.state.field(B,!1);return!(e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(w).interactionDelay)&&V(e,t.open.options[t.open.selected])}}],Pe=n.Nb.highest(s.w4.computeN([w],e=>e.facet(w).defaultKeymap?[ke]:[]))},78633(e,t,i){"use strict";i.d(t,{Yc:()=>_e,b6:()=>b,cL:()=>N,pw:()=>Pe});var n=i(1993),s=i(51104),r=i(62388),o=i(16713);function a(e,t){return({state:i,dispatch:n})=>{if(i.readOnly)return!1;let s=e(t,i);return!!s&&(n(i.update(s)),!0)}}const l=a(p,0),c=a(d,0),h=a((e,t)=>d(e,t,function(e){let t=[];for(let i of e.selection.ranges){let n=e.doc.lineAt(i.from),s=i.to<=n.to?n:e.doc.lineAt(i.to);s.from>n.from&&s.from==i.to&&(s=i.to==n.to+1?n:e.doc.lineAt(i.to-1));let r=t.length-1;r>=0&&t[r].to>n.from?t[r].to=s.to:t.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:s.to})}return t}(t)),0);function u(e,t){let i=e.languageDataAt("commentTokens",t,1);return i.length?i[0]:{}}function d(e,t,i=t.selection.ranges){let n=i.map(e=>u(t,e.from).block);if(!n.every(e=>e))return null;let s=i.map((e,i)=>function(e,{open:t,close:i},n,s){let r,o,a=e.sliceDoc(n-50,n),l=e.sliceDoc(s,s+50),c=/\s*$/.exec(a)[0].length,h=/^\s*/.exec(l)[0].length,u=a.length-c;if(a.slice(u-t.length,u)==t&&l.slice(h,h+i.length)==i)return{open:{pos:n-c,margin:c&&1},close:{pos:s+h,margin:h&&1}};s-n<=100?r=o=e.sliceDoc(n,s):(r=e.sliceDoc(n,n+50),o=e.sliceDoc(s-50,s));let d=/^\s*/.exec(r)[0].length,p=/\s*$/.exec(o)[0].length,g=o.length-p-i.length;return r.slice(d,d+t.length)==t&&o.slice(g,g+i.length)==i?{open:{pos:n+d+t.length,margin:/\s/.test(r.charAt(d+t.length))?1:0},close:{pos:s-p-i.length,margin:/\s/.test(o.charAt(g-1))?1:0}}:null}(t,n[i],e.from,e.to));if(2!=e&&!s.every(e=>e))return{changes:t.changes(i.map((e,t)=>s[t]?[]:[{from:e.from,insert:n[t].open+" "},{from:e.to,insert:" "+n[t].close}]))};if(1!=e&&s.some(e=>e)){let e=[];for(let t,i=0;i<s.length;i++)if(t=s[i]){let s=n[i],{open:r,close:o}=t;e.push({from:r.pos-s.open.length,to:r.pos+r.margin},{from:o.pos-o.margin,to:o.pos+s.close.length})}return{changes:e}}return null}function p(e,t,i=t.selection.ranges){let n=[],s=-1;e:for(let{from:e,to:r}of i){let i,o=n.length,a=1e9;for(let o=e;o<=r;){let l=t.doc.lineAt(o);if(null==i&&(i=u(t,l.from).line,!i))continue e;if(l.from>s&&(e==r||r>l.from)){s=l.from;let e=/^\s*/.exec(l.text)[0].length,t=e==l.length,r=l.text.slice(e,e+i.length)==i?e:-1;e<l.text.length&&e<a&&(a=e),n.push({line:l,comment:r,token:i,indent:e,empty:t,single:!1})}o=l.to+1}if(a<1e9)for(let e=o;e<n.length;e++)n[e].indent<n[e].line.text.length&&(n[e].indent=a);n.length==o+1&&(n[o].single=!0)}if(2!=e&&n.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:i,indent:s,empty:r,single:o}of n)!o&&r||e.push({from:t.from+s,insert:i+" "});let i=t.changes(e);return{changes:i,selection:t.selection.map(i,1)}}if(1!=e&&n.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:i,token:s}of n)if(i>=0){let n=t.from+i,r=n+s.length;" "==t.text[r-t.from]&&r++,e.push({from:n,to:r})}return{changes:e}}return null}const g=n.YH.define(),f=n.YH.define(),m=n.sj.define(),y=n.sj.define({combine:e=>(0,n.QR)(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(i,n)=>e(i,n)||t(i,n)})}),v=n.sU.define({create:()=>L.empty,update(e,t){let i=t.state.facet(y),s=t.annotation(g);if(s){let n=A.fromTransaction(t,s.selection),r=s.side,o=0==r?e.undone:e.done;return o=n?M(o,o.length,i.minDepth,n):I(o,t.startState.selection),new L(0==r?s.rest:o,0==r?o:s.rest)}let r=t.annotation(f);if("full"!=r&&"before"!=r||(e=e.isolate()),!1===t.annotation(n.ZX.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);let o=A.fromTransaction(t),a=t.annotation(n.ZX.time),l=t.annotation(n.ZX.userEvent);return o?e=e.addChanges(o,a,l,i,t):t.selection&&(e=e.addSelection(t.startState.selection,a,l,i.newGroupDelay)),"full"!=r&&"after"!=r||(e=e.isolate()),e},toJSON:e=>({done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}),fromJSON:e=>new L(e.done.map(A.fromJSON),e.undone.map(A.fromJSON))});function b(e={}){return[v,y.of(e),s.Lz.domEventHandlers({beforeinput(e,t){let i="historyUndo"==e.inputType?w:"historyRedo"==e.inputType?S:null;return!!i&&(e.preventDefault(),i(t))}})]}function C(e,t){return function({state:i,dispatch:n}){if(!t&&i.readOnly)return!1;let s=i.field(v,!1);if(!s)return!1;let r=s.pop(e,i,t);return!!r&&(n(r),!0)}}const w=C(0,!1),S=C(1,!1),x=C(0,!0),E=C(1,!0);class A{constructor(e,t,i,n,s){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=n,this.selectionsAfter=s}setSelAfter(e){return new A(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;return{changes:null===(e=this.changes)||void 0===e?void 0:e.toJSON(),mapped:null===(t=this.mapped)||void 0===t?void 0:t.toJSON(),startSelection:null===(i=this.startSelection)||void 0===i?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(e){return new A(e.changes&&n.VR.fromJSON(e.changes),[],e.mapped&&n.Gu.fromJSON(e.mapped),e.startSelection&&n.OF.fromJSON(e.startSelection),e.selectionsAfter.map(n.OF.fromJSON))}static fromTransaction(e,t){let i=D;for(let t of e.startState.facet(m)){let n=t(e);n.length&&(i=i.concat(n))}return!i.length&&e.changes.empty?null:new A(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,D)}static selection(e){return new A(void 0,D,void 0,void 0,e)}}function M(e,t,i,n){let s=t+1>i+20?t-i-1:0,r=e.slice(s,t);return r.push(n),r}function T(e,t){return e.length?t.length?e.concat(t):e:t}const D=[];function I(e,t){if(e.length){let i=e[e.length-1],n=i.selectionsAfter.slice(Math.max(0,i.selectionsAfter.length-200));return n.length&&n[n.length-1].eq(t)?e:(n.push(t),M(e,e.length-1,1e9,i.setSelAfter(n)))}return[A.selection([t])]}function R(e){let t=e[e.length-1],i=e.slice();return i[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),i}function k(e,t){if(!e.length)return e;let i=e.length,n=D;for(;i;){let s=P(e[i-1],t,n);if(s.changes&&!s.changes.empty||s.effects.length){let t=e.slice(0,i);return t[i-1]=s,t}t=s.mapped,i--,n=s.selectionsAfter}return n.length?[A.selection(n)]:D}function P(e,t,i){let s=T(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):D,i);if(!e.changes)return A.selection(s);let r=e.changes.map(t),o=t.mapDesc(e.changes,!0),a=e.mapped?e.mapped.composeDesc(o):o;return new A(r,n.Pe.mapEffects(e.effects,t),a,e.startSelection.map(o),s)}const _=/^(input\.type|delete)($|\.)/;class L{constructor(e,t,i=0,n=void 0){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=n}isolate(){return this.prevTime?new L(this.done,this.undone):this}addChanges(e,t,i,s,r){let o=this.done,a=o[o.length-1];return o=a&&a.changes&&!a.changes.empty&&e.changes&&(!i||_.test(i))&&(!a.selectionsAfter.length&&t-this.prevTime<s.newGroupDelay&&s.joinToEvent(r,function(e,t){let i=[],n=!1;return e.iterChangedRanges((e,t)=>i.push(e,t)),t.iterChangedRanges((e,t,s,r)=>{for(let e=0;e<i.length;){let t=i[e++],o=i[e++];r>=t&&s<=o&&(n=!0)}}),n}(a.changes,e.changes))||"input.type.compose"==i)?M(o,o.length-1,s.minDepth,new A(e.changes.compose(a.changes),T(n.Pe.mapEffects(e.effects,a.changes),a.effects),a.mapped,a.startSelection,D)):M(o,o.length,s.minDepth,e),new L(o,D,t,i)}addSelection(e,t,i,n){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:D;return s.length>0&&t-this.prevTime<n&&i==this.prevUserEvent&&i&&/^select($|\.)/.test(i)&&(r=s[s.length-1],o=e,r.ranges.length==o.ranges.length&&0===r.ranges.filter((e,t)=>e.empty!=o.ranges[t].empty).length)?this:new L(I(this.done,e),this.undone,t,i);var r,o}addMapping(e){return new L(k(this.done,e),k(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,i){let n=0==e?this.done:this.undone;if(0==n.length)return null;let s=n[n.length-1],r=s.selectionsAfter[0]||(s.startSelection?s.startSelection.map(s.changes.invertedDesc,1):t.selection);if(i&&s.selectionsAfter.length)return t.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:g.of({side:e,rest:R(n),selection:r}),userEvent:0==e?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let i=1==n.length?D:n.slice(0,n.length-1);return s.mapped&&(i=k(i,s.mapped)),t.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:g.of({side:e,rest:i,selection:r}),filter:!1,userEvent:0==e?"undo":"redo",scrollIntoView:!0})}return null}}L.empty=new L(D,D);const N=[{key:"Mod-z",run:w,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:S,preventDefault:!0},{linux:"Ctrl-Shift-z",run:S,preventDefault:!0},{key:"Mod-u",run:x,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:E,preventDefault:!0}];function O(e,t){return n.OF.create(e.ranges.map(t),e.mainIndex)}function F(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function G({state:e,dispatch:t},i){let n=O(e.selection,i);return!n.eq(e.selection,!0)&&(t(F(e,n)),!0)}function B(e,t){return n.OF.cursor(t?e.to:e.from)}function V(e,t){return G(e,i=>i.empty?e.moveByChar(i,t):B(i,t))}function H(e){return e.textDirectionAt(e.state.selection.main.head)==s.OP.LTR}const U=e=>V(e,!H(e)),z=e=>V(e,H(e));function W(e,t){return G(e,i=>i.empty?e.moveByGroup(i,t):B(i,t))}function j(e,t,i){if(t.type.prop(i))return!0;let n=t.to-t.from;return n&&(n>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function $(e,t,i){let s,a,l=(0,r.mv)(e).resolveInner(t.head),c=i?o.uY.closedBy:o.uY.openedBy;for(let n=t.head;;){let t=i?l.childAfter(n):l.childBefore(n);if(!t)break;j(e,t,c)?l=t:n=i?t.to:t.from}return a=l.type.prop(c)&&(s=i?(0,r.jU)(e,l.from,1):(0,r.jU)(e,l.to,-1))&&s.matched?i?s.end.to:s.end.from:i?l.to:l.from,n.OF.cursor(a,i?-1:1)}function K(e,t){return G(e,i=>{if(!i.empty)return B(i,t);let n=e.moveVertically(i,t);return n.head!=i.head?n:e.moveToLineBoundary(i,t)})}"undefined"!=typeof Intl&&Intl.Segmenter;const Y=e=>K(e,!1),q=e=>K(e,!0);function X(e){let t,i=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0;if(i){for(let t of e.state.facet(s.Lz.scrollMargins)){let i=t(e);(null==i?void 0:i.top)&&(n=Math.max(null==i?void 0:i.top,n)),(null==i?void 0:i.bottom)&&(r=Math.max(null==i?void 0:i.bottom,r))}t=e.scrollDOM.clientHeight-n-r}else t=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:i,height:Math.max(e.defaultLineHeight,t-5)}}function Z(e,t){let i,n=X(e),{state:r}=e,o=O(r.selection,i=>i.empty?e.moveVertically(i,t,n.height):B(i,t));if(o.eq(r.selection))return!1;if(n.selfScroll){let t=e.coordsAtPos(r.selection.main.head),a=e.scrollDOM.getBoundingClientRect(),l=a.top+n.marginTop,c=a.bottom-n.marginBottom;t&&t.top>l&&t.bottom<c&&(i=s.Lz.scrollIntoView(o.main.head,{y:"start",yMargin:t.top-l}))}return e.dispatch(F(r,o),{effects:i}),!0}const Q=e=>Z(e,!1),J=e=>Z(e,!0);function ee(e,t,i){let s=e.lineBlockAt(t.head),r=e.moveToLineBoundary(t,i);if(r.head==t.head&&r.head!=(i?s.to:s.from)&&(r=e.moveToLineBoundary(t,i,!1)),!i&&r.head==s.from&&s.length){let i=/^\s*/.exec(e.state.sliceDoc(s.from,Math.min(s.from+100,s.to)))[0].length;i&&t.head!=s.from+i&&(r=n.OF.cursor(s.from+i))}return r}function te(e,t,i){let s=O(e.state.selection,e=>{e.undirectional&&e.head>=e.anchor!=t&&(e=n.OF.range(e.head,e.anchor));let s=i(e);return n.OF.range(e.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});return!s.eq(e.state.selection)&&(e.dispatch(F(e.state,s)),!0)}function ie(e,t){return te(e,t,i=>e.moveByChar(i,t))}const ne=e=>ie(e,!H(e)),se=e=>ie(e,H(e));function re(e,t){return te(e,t,i=>e.moveByGroup(i,t))}function oe(e,t){return te(e,t,i=>e.moveVertically(i,t))}const ae=e=>oe(e,!1),le=e=>oe(e,!0);function ce(e,t){return te(e,t,i=>e.moveVertically(i,t,X(e).height))}const he=e=>ce(e,!1),ue=e=>ce(e,!0),de=({state:e,dispatch:t})=>(t(F(e,{anchor:0})),!0),pe=({state:e,dispatch:t})=>(t(F(e,{anchor:e.doc.length})),!0),ge=({state:e,dispatch:t})=>(t(F(e,{anchor:e.selection.main.anchor,head:0})),!0),fe=({state:e,dispatch:t})=>(t(F(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0);function me(e,t){let{state:i}=e,s=i.selection,r=i.selection.ranges.slice();for(let n of i.selection.ranges){let s=i.doc.lineAt(n.head);if(t?s.to<e.state.doc.length:s.from>0)for(let i=n;;){let n=e.moveVertically(i,t);if(n.head<s.from||n.head>s.to){r.some(e=>e.head==n.head)||r.push(n);break}if(n.head==i.head)break;i=n}}return r.length!=s.ranges.length&&(e.dispatch(F(i,n.OF.create(r,r.length-1))),!0)}function ye(e,t){if(e.state.readOnly)return!1;let i="delete.selection",{state:r}=e,o=r.changeByRange(s=>{let{from:r,to:o}=s;if(r==o){let n=t(s);n<r?(i="delete.backward",n=ve(e,n,!1)):n>r&&(i="delete.forward",n=ve(e,n,!0)),r=Math.min(r,n),o=Math.max(o,n)}else r=ve(e,r,!1),o=ve(e,o,!0);return r==o?{range:s}:{changes:{from:r,to:o},range:n.OF.cursor(r,r<s.head?-1:1)}});return!o.changes.empty&&(e.dispatch(r.update(o,{scrollIntoView:!0,userEvent:i,effects:"delete.selection"==i?s.Lz.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function ve(e,t,i){if(e instanceof s.Lz)for(let n of e.state.facet(s.Lz.atomicRanges).map(t=>t(e)))n.between(t,t,(e,n)=>{e<t&&n>t&&(t=i?n:e)});return t}const be=(e,t,i)=>ye(e,s=>{let o,a,l=s.from,{state:c}=e,h=c.doc.lineAt(l);if(i&&!t&&l>h.from&&l<h.from+200&&!/[^ \t]/.test(o=h.text.slice(0,l-h.from))){if("\t"==o[o.length-1])return l-1;let e=(0,n.y$)(o,c.tabSize)%(0,r.tp)(c)||(0,r.tp)(c);for(let t=0;t<e&&" "==o[o.length-1-t];t++)l--;a=l}else a=(0,n.zK)(h.text,l-h.from,t,t)+h.from,a==l&&h.number!=(t?c.doc.lines:1)?a+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(h.text.slice(a-h.from,l-h.from))&&(a=(0,n.zK)(h.text,a-h.from,!1,!1)+h.from);return a}),Ce=e=>be(e,!1,!0),we=e=>be(e,!0,!1),Se=(e,t)=>ye(e,i=>{let s=i.head,{state:r}=e,o=r.doc.lineAt(s),a=r.charCategorizer(s);for(let e=null;;){if(s==(t?o.to:o.from)){s==i.head&&o.number!=(t?r.doc.lines:1)&&(s+=t?1:-1);break}let l=(0,n.zK)(o.text,s-o.from,t)+o.from,c=o.text.slice(Math.min(s,l)-o.from,Math.max(s,l)-o.from),h=a(c);if(null!=e&&h!=e)break;" "==c&&s==i.head||(e=h),s=l}return s}),xe=e=>Se(e,!1);function Ee(e){let t=[],i=-1;for(let n of e.selection.ranges){let s=e.doc.lineAt(n.from),r=e.doc.lineAt(n.to);if(n.empty||n.to!=r.from||(r=e.doc.lineAt(n.to-1)),i>=s.number){let e=t[t.length-1];e.to=r.to,e.ranges.push(n)}else t.push({from:s.from,to:r.to,ranges:[n]});i=r.number+1}return t}function Ae(e,t,i){if(e.readOnly)return!1;let s=[],r=[];for(let t of Ee(e)){if(i?t.to==e.doc.length:0==t.from)continue;let o=e.doc.lineAt(i?t.to+1:t.from-1),a=o.length+1;if(i){s.push({from:t.to,to:o.to},{from:t.from,insert:o.text+e.lineBreak});for(let i of t.ranges)r.push(n.OF.range(Math.min(e.doc.length,i.anchor+a),Math.min(e.doc.length,i.head+a)))}else{s.push({from:o.from,to:t.from},{from:t.to,insert:e.lineBreak+o.text});for(let e of t.ranges)r.push(n.OF.range(e.anchor-a,e.head-a))}}return!!s.length&&(t(e.update({changes:s,scrollIntoView:!0,selection:n.OF.create(r,e.selection.mainIndex),userEvent:"move.line"})),!0)}function Me(e,t,i){if(e.readOnly)return!1;let n=[];for(let t of Ee(e))i?n.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):n.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let s=e.changes(n);return t(e.update({changes:s,selection:e.selection.map(s,i?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Te=De(!1);function De(e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let s=t.changeByRange(i=>{let{from:s,to:a}=i,l=t.doc.lineAt(s),c=!e&&s==a&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let i,n=(0,r.mv)(e).resolveInner(t),s=n.childBefore(t),a=n.childAfter(t);return s&&a&&s.to<=t&&a.from>=t&&(i=s.type.prop(o.uY.closedBy))&&i.indexOf(a.name)>-1&&e.doc.lineAt(s.to).from==e.doc.lineAt(a.from).from&&!/\S/.test(e.sliceDoc(s.to,a.from))?{from:s.to,to:a.from}:null}(t,s);e&&(s=a=(a<=l.to?l:t.doc.lineAt(a)).to);let h=new r.KB(t,{simulateBreak:s,simulateDoubleBreak:!!c}),u=(0,r._v)(h,s);for(null==u&&(u=(0,n.y$)(/^\s*/.exec(t.doc.lineAt(s).text)[0],t.tabSize));a<l.to&&/\s/.test(l.text[a-l.from]);)a++;c?({from:s,to:a}=c):s>l.from&&s<l.from+100&&!/\S/.test(l.text.slice(0,s))&&(s=l.from);let d=["",(0,r.EI)(t,u)];return c&&d.push((0,r.EI)(t,h.lineIndent(l.from,-1))),{changes:{from:s,to:a,insert:n.EY.of(d)},range:n.OF.cursor(s+1+d[1].length)}});return i(t.update(s,{scrollIntoView:!0,userEvent:"input"})),!0}}function Ie(e,t){let i=-1;return e.changeByRange(s=>{let r=[];for(let n=s.from;n<=s.to;){let o=e.doc.lineAt(n);o.number>i&&(s.empty||s.to>o.from)&&(t(o,r,s),i=o.number),n=o.to+1}let o=e.changes(r);return{changes:r,range:n.OF.range(o.mapPos(s.anchor,1),o.mapPos(s.head,1))}})}const Re=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(Ie(e,(t,i)=>{i.push({from:t.from,insert:e.facet(r.Xt)})}),{userEvent:"input.indent"})),!0),ke=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(Ie(e,(t,i)=>{let s=/^\s*/.exec(t.text)[0];if(!s)return;let o=(0,n.y$)(s,e.tabSize),a=0,l=(0,r.EI)(e,Math.max(0,o-(0,r.tp)(e)));for(;a<s.length&&a<l.length&&s.charCodeAt(a)==l.charCodeAt(a);)a++;i.push({from:t.from+a,to:t.from+s.length,insert:l.slice(a)})}),{userEvent:"delete.dedent"})),!0),Pe=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:e=>G(e,t=>$(e.state,t,!H(e))),shift:e=>{let t=!H(e);return te(e,t,i=>$(e.state,i,t))}},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:e=>G(e,t=>$(e.state,t,H(e))),shift:e=>{let t=H(e);return te(e,t,i=>$(e.state,i,t))}},{key:"Alt-ArrowUp",run:({state:e,dispatch:t})=>Ae(e,t,!1)},{key:"Shift-Alt-ArrowUp",run:({state:e,dispatch:t})=>Me(e,t,!1)},{key:"Alt-ArrowDown",run:({state:e,dispatch:t})=>Ae(e,t,!0)},{key:"Shift-Alt-ArrowDown",run:({state:e,dispatch:t})=>Me(e,t,!0)},{key:"Mod-Alt-ArrowUp",run:e=>me(e,!1)},{key:"Mod-Alt-ArrowDown",run:e=>me(e,!0)},{key:"Escape",run:({state:e,dispatch:t})=>{let i=e.selection,s=null;return i.ranges.length>1?s=n.OF.create([i.main]):i.main.empty||(s=n.OF.create([n.OF.cursor(i.main.head)])),!!s&&(t(F(e,s)),!0)}},{key:"Mod-Enter",run:De(!0)},{key:"Alt-l",mac:"Ctrl-l",run:({state:e,dispatch:t})=>{let i=Ee(e).map(({from:t,to:i})=>n.OF.undirectionalRange(t,Math.min(i+1,e.doc.length)));return t(e.update({selection:n.OF.create(i),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:e,dispatch:t})=>{let i=O(e.selection,t=>{let i=(0,r.mv)(e),s=i.resolveStack(t.from,1);if(t.empty){let e=i.resolveStack(t.from,-1);e.node.from>=s.node.from&&e.node.to<=s.node.to&&(s=e)}for(let e=s;e;e=e.next){let{node:i}=e;if((i.from<t.from&&i.to>=t.to||i.to>t.to&&i.from<=t.from)&&e.next)return n.OF.undirectionalRange(i.from,i.to)}return t});return!i.eq(e.selection)&&(t(F(e,i)),!0)},preventDefault:!0},{key:"Mod-[",run:ke},{key:"Mod-]",run:Re},{key:"Mod-Alt-\\",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=Object.create(null),n=new r.KB(e,{overrideIndentation:e=>{let t=i[e];return null==t?-1:t}}),s=Ie(e,(t,s,o)=>{let a=(0,r._v)(n,t.from);if(null==a)return;/\S/.test(t.text)||(a=0);let l=/^\s*/.exec(t.text)[0],c=(0,r.EI)(e,a);(l!=c||o.from<t.from+l.length)&&(i[t.from]=a,s.push({from:t.from,to:t.from+l.length,insert:c}))});return s.changes.empty||t(e.update(s,{userEvent:"indent"})),!0}},{key:"Shift-Mod-k",run:e=>{if(e.state.readOnly)return!1;let{state:t}=e,i=t.changes(Ee(t).map(({from:e,to:i})=>(e>0?e--:i<t.doc.length&&i++,{from:e,to:i}))),n=O(t.selection,t=>{let i;if(e.lineWrapping){let n=e.lineBlockAt(t.head),s=e.coordsAtPos(t.head,t.assoc||1);s&&(i=n.bottom+e.documentTop-s.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,i)}).map(i);return e.dispatch({changes:i,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:e,dispatch:t})=>function(e,t,i){let s=!1,o=O(e.selection,t=>{let o=(0,r.jU)(e,t.head,-1)||(0,r.jU)(e,t.head,1)||t.head>0&&(0,r.jU)(e,t.head-1,1)||t.head<e.doc.length&&(0,r.jU)(e,t.head+1,-1);if(!o||!o.end)return t;s=!0;let a=o.start.from==t.head?o.end.to:o.end.from;return i?n.OF.range(t.anchor,a):n.OF.cursor(a)});return!!s&&(t(F(e,o)),!0)}(e,t,!1)},{key:"Mod-/",run:e=>{let{state:t}=e,i=t.doc.lineAt(t.selection.main.from),n=u(e.state,i.from);return n.line?l(e):!!n.block&&h(e)}},{key:"Alt-A",mac:"Ctrl-A",run:c},{key:"Ctrl-m",mac:"Shift-Alt-m",run:e=>(e.setTabFocusMode(),!0)}].concat([{key:"ArrowLeft",run:U,shift:ne,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:e=>W(e,!H(e)),shift:e=>re(e,!H(e)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:e=>G(e,t=>ee(e,t,!H(e))),shift:e=>{let t=!H(e);return te(e,t,i=>ee(e,i,t))},preventDefault:!0},{key:"ArrowRight",run:z,shift:se,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:e=>W(e,H(e)),shift:e=>re(e,H(e)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:e=>G(e,t=>ee(e,t,H(e))),shift:e=>{let t=H(e);return te(e,t,i=>ee(e,i,t))},preventDefault:!0},{key:"ArrowUp",run:Y,shift:ae,preventDefault:!0},{mac:"Cmd-ArrowUp",run:de,shift:ge},{mac:"Ctrl-ArrowUp",run:Q,shift:he},{key:"ArrowDown",run:q,shift:le,preventDefault:!0},{mac:"Cmd-ArrowDown",run:pe,shift:fe},{mac:"Ctrl-ArrowDown",run:J,shift:ue},{key:"PageUp",run:Q,shift:he},{key:"PageDown",run:J,shift:ue},{key:"Home",run:e=>G(e,t=>ee(e,t,!1)),shift:e=>te(e,!1,t=>ee(e,t,!1)),preventDefault:!0},{key:"Mod-Home",run:de,shift:ge},{key:"End",run:e=>G(e,t=>ee(e,t,!0)),shift:e=>te(e,!0,t=>ee(e,t,!0)),preventDefault:!0},{key:"Mod-End",run:pe,shift:fe},{key:"Enter",run:Te,shift:Te},{key:"Mod-a",run:({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:Ce,shift:Ce,preventDefault:!0},{key:"Delete",run:we,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:xe,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:e=>Se(e,!0),preventDefault:!0},{mac:"Mod-Backspace",run:e=>ye(e,t=>{let i=e.moveToLineBoundary(t,!1).head;return t.head>i?i:Math.max(0,t.head-1)}),preventDefault:!0},{mac:"Mod-Delete",run:e=>ye(e,t=>{let i=e.moveToLineBoundary(t,!0).head;return t.head<i?i:Math.min(e.state.doc.length,t.head+1)}),preventDefault:!0}].concat([{key:"Ctrl-b",run:U,shift:ne,preventDefault:!0},{key:"Ctrl-f",run:z,shift:se},{key:"Ctrl-p",run:Y,shift:ae},{key:"Ctrl-n",run:q,shift:le},{key:"Ctrl-a",run:e=>G(e,t=>e.moveToLineBoundary(t,!1,!1)),shift:e=>te(e,!1,t=>n.OF.cursor(e.lineBlockAt(t.head).from))},{key:"Ctrl-e",run:e=>G(e,t=>e.moveToLineBoundary(t,!0,!1)),shift:e=>te(e,!0,t=>n.OF.cursor(e.lineBlockAt(t.head).to))},{key:"Ctrl-d",run:we},{key:"Ctrl-h",run:Ce},{key:"Ctrl-k",run:e=>ye(e,t=>{let i=e.lineBlockAt(t.head).to;return t.head<i?i:Math.min(e.state.doc.length,t.head+1)})},{key:"Ctrl-Alt-h",run:xe},{key:"Ctrl-o",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:n.EY.of(["",""])},range:n.OF.cursor(e.from)}));return t(e.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange(t=>{if(!t.empty||0==t.from||t.from==e.doc.length)return{range:t};let i=t.from,s=e.doc.lineAt(i),r=i==s.from?i-1:(0,n.zK)(s.text,i-s.from,!1)+s.from,o=i==s.to?i+1:(0,n.zK)(s.text,i-s.from,!0)+s.from;return{changes:{from:r,to:o,insert:e.doc.slice(i,o).append(e.doc.slice(r,i))},range:n.OF.cursor(o)}});return!i.changes.empty&&(t(e.update(i,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:J}].map(e=>({mac:e.key,run:e.run,shift:e.shift})))),_e={key:"Tab",run:Re,shift:ke}},90364(e,t,i){"use strict";i.d(t,{Yk:()=>C,css:()=>w,mz:()=>v});var n=i(29199),s=i(62388),r=i(16713);let o=null;function a(){if(!o&&"object"==typeof document&&document.body){let{style:e}=document.body,t=[],i=new Set;for(let n in e)"cssText"!=n&&"cssFloat"!=n&&"string"==typeof e[n]&&(/[A-Z]/.test(n)&&(n=n.replace(/[A-Z]/g,e=>"-"+e.toLowerCase())),i.has(n)||(t.push(n),i.add(n)));o=t.sort().map(e=>({type:"property",label:e,apply:e+": "}))}return o||[]}const l=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(e=>({type:"class",label:e})),c=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(e=>({type:"keyword",label:e})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(e=>({type:"constant",label:e}))),h=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(e=>({type:"type",label:e})),u=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(e=>({type:"keyword",label:e})),d=/^(\w[\w-]*|-\w[\w-]*|)$/,p=/^-(-[\w-]*)?$/,g=new r.RY,f=["Declaration"];function m(e){for(let t=e;;){if(t.type.isTop)return t;if(!(t=t.parent))return e}}function y(e,t,i){if(t.to-t.from>4096){let n=g.get(t);if(n)return n;let s=[],o=new Set,a=t.cursor(r.Qj.IncludeAnonymous);if(a.firstChild())do{for(let t of y(e,a.node,i))o.has(t.label)||(o.add(t.label),s.push(t))}while(a.nextSibling());return g.set(t,s),s}{let n=[],s=new Set;return t.cursor().iterate(t=>{var r;if(i(t)&&t.matchContext(f)&&":"==(null===(r=t.node.nextSibling)||void 0===r?void 0:r.name)){let i=e.sliceString(t.from,t.to);s.has(i)||(s.add(i),n.push({label:i,type:"variable"}))}}),n}}const v=e=>t=>{let{state:i,pos:n}=t,r=(0,s.mv)(i).resolveInner(n,-1),o=r.type.isError&&r.from==r.to-1&&"-"==i.doc.sliceString(r.from,r.to);if("PropertyName"==r.name||(o||"TagName"==r.name)&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:a(),validFor:d};if("ValueName"==r.name)return{from:r.from,options:c,validFor:d};if("PseudoClassName"==r.name)return{from:r.from,options:l,validFor:d};if(e(r)||(t.explicit||o)&&function(e,t){var i;if(("("==e.name||e.type.isError)&&(e=e.parent||e),"ArgList"!=e.name)return!1;let n=null===(i=e.parent)||void 0===i?void 0:i.firstChild;return"Callee"==(null==n?void 0:n.name)&&"var"==t.sliceString(n.from,n.to)}(r,i.doc))return{from:e(r)||o?r.from:n,options:y(i.doc,m(r),e),validFor:p};if("TagName"==r.name){for(let{parent:e}=r;e;e=e.parent)if("Block"==e.name)return{from:r.from,options:a(),validFor:d};return{from:r.from,options:h,validFor:d}}if("AtKeyword"==r.name)return{from:r.from,options:u,validFor:d};if(!t.explicit)return null;let g=r.resolve(n),f=g.childBefore(n);return f&&":"==f.name&&"PseudoClassSelector"==g.name?{from:n,options:l,validFor:d}:f&&":"==f.name&&"Declaration"==g.name||"ArgList"==g.name?{from:n,options:c,validFor:d}:"Block"==g.name||"Styles"==g.name?{from:n,options:a(),validFor:d}:null},b=v(e=>"VariableName"==e.name),C=s.bj.define({name:"css",parser:n.K.configure({props:[s.Oh.add({Declaration:(0,s.mz)()}),s.b_.add({"Block KeyframeList":s.yd})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function w(){return new s.Yy(C,C.data.of({autocomplete:b}))}},35903(e,t,i){"use strict";i.d(t,{$g:()=>T,html:()=>L});var n=i(99064),s=i(90364),r=i(121),o=i(51104),a=i(1993),l=i(62388);const c=["_blank","_self","_top","_parent"],h=["ascii","utf-8","utf-16","latin1","latin1"],u=["get","post","put","delete"],d=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],p=["true","false"],g={},f={a:{attrs:{href:null,ping:null,type:null,media:null,target:c,hreflang:null}},abbr:g,address:g,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:g,aside:g,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:g,base:{attrs:{href:null,target:c}},bdi:g,bdo:g,blockquote:{attrs:{cite:null}},body:g,br:g,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:d,formmethod:u,formnovalidate:["novalidate"],formtarget:c,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:g,center:g,cite:g,code:g,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:g,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:g,div:g,dl:g,dt:g,em:g,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:g,figure:g,footer:g,form:{attrs:{action:null,name:null,"accept-charset":h,autocomplete:["on","off"],enctype:d,method:u,novalidate:["novalidate"],target:c}},h1:g,h2:g,h3:g,h4:g,h5:g,h6:g,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:g,hgroup:g,hr:g,html:{attrs:{manifest:null}},i:g,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:d,formmethod:u,formnovalidate:["novalidate"],formtarget:c,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:g,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:g,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:g,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:h,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:g,noscript:g,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:g,param:{attrs:{name:null,value:null}},pre:g,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:g,rt:g,ruby:g,samp:g,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:h}},section:g,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:g,source:{attrs:{src:null,type:null,media:null}},span:g,strong:g,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:g,summary:g,sup:g,table:g,tbody:g,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:g,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:g,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:g,time:{attrs:{datetime:null}},title:g,tr:g,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:g,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:g},m={accesskey:null,class:null,contenteditable:p,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:p,autocorrect:p,autocapitalize:p,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":p,"aria-autocomplete":["inline","list","both","none"],"aria-busy":p,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":p,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":p,"aria-hidden":p,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":p,"aria-multiselectable":p,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":p,"aria-relevant":null,"aria-required":p,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},y="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(e=>"on"+e);for(let e of y)m[e]=null;class v{constructor(e,t){this.tags={...f,...e},this.globalAttrs={...m,...t},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}function b(e,t,i=e.length){if(!t)return"";let n=t.firstChild,s=n&&n.getChild("TagName");return s?e.sliceString(s.from,Math.min(s.to,i)):""}function C(e,t=!1){for(;e;e=e.parent)if("Element"==e.name){if(!t)return e;t=!1}return null}function w(e,t,i){let n=i.tags[b(e,C(t))];return(null==n?void 0:n.children)||i.allTags}function S(e,t){let i=[];for(let n=C(t);n&&!n.type.isTop;n=C(n.parent)){let s=b(e,n);if(s&&"CloseTag"==n.lastChild.name)break;s&&i.indexOf(s)<0&&("EndTag"==t.name||t.from>=n.firstChild.to)&&i.push(s)}return i}v.default=new v;const x=/^[:\-\.\w\u00b7-\uffff]*$/;function E(e,t,i,n,s){let r=/\s*>/.test(e.sliceDoc(s,s+5))?"":">",o=C(i,"StartTag"==i.name||"TagName"==i.name);return{from:n,to:s,options:w(e.doc,o,t).map(e=>({label:e,type:"type"})).concat(S(e.doc,i).map((e,t)=>({label:"/"+e,apply:"/"+e+r,type:"type",boost:99-t}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function A(e,t,i,n){let s=/\s*>/.test(e.sliceDoc(n,n+5))?"":">";return{from:i,to:n,options:S(e.doc,t).map((e,t)=>({label:e,apply:e+s,type:"type",boost:99-t})),validFor:x}}function M(e,t){let{state:i,pos:n}=t,s=(0,l.mv)(i).resolveInner(n,-1),r=s.resolve(n);for(let e,t=n;r==s&&(e=s.childBefore(t));){let i=e.lastChild;if(!i||!i.type.isError||i.from<i.to)break;r=s=e,t=i.from}return"TagName"==s.name?s.parent&&/CloseTag$/.test(s.parent.name)?A(i,s,s.from,n):E(i,e,s,s.from,n):"StartTag"==s.name||"IncompleteTag"==s.name?E(i,e,s,n,n):"StartCloseTag"==s.name||"IncompleteCloseTag"==s.name?A(i,s,n,n):"OpenTag"==s.name||"SelfClosingTag"==s.name||"AttributeName"==s.name?function(e,t,i,n,s){let r=C(i),o=r?t.tags[b(e.doc,r)]:null,a=o&&o.attrs?Object.keys(o.attrs):[];return{from:n,to:s,options:(o&&!1===o.globalAttrs?a:a.length?a.concat(t.globalAttrNames):t.globalAttrNames).map(e=>({label:e,type:"property"})),validFor:x}}(i,e,s,"AttributeName"==s.name?s.from:n,n):"Is"==s.name||"AttributeValue"==s.name||"UnquotedAttributeValue"==s.name?function(e,t,i,n,s){var r;let o,a=null===(r=i.parent)||void 0===r?void 0:r.getChild("AttributeName"),l=[];if(a){let r=e.sliceDoc(a.from,a.to),c=t.globalAttrs[r];if(!c){let n=C(i),s=n?t.tags[b(e.doc,n)]:null;c=(null==s?void 0:s.attrs)&&s.attrs[r]}if(c){let t=e.sliceDoc(n,s).toLowerCase(),i='"',r='"';/^['"]/.test(t)?(o='"'==t[0]?/^[^"]*$/:/^[^']*$/,i="",r=e.sliceDoc(s,s+1)==t[0]?"":t[0],t=t.slice(1),n++):o=/^[^\s<>='"]*$/;for(let e of c)l.push({label:e,apply:i+e+r,type:"constant"})}}return{from:n,to:s,options:l,validFor:o}}(i,e,s,"Is"==s.name?n:s.from,n):!t.explicit||"Element"!=r.name&&"Text"!=r.name&&"Document"!=r.name?null:function(e,t,i,n){let s=[],r=0;for(let n of w(e.doc,i,t))s.push({label:"<"+n,type:"type"});for(let t of S(e.doc,i))s.push({label:"</"+t+">",type:"type",boost:99-r++});return{from:n,to:n,options:s,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}(i,e,s,n)}function T(e){return M(v.default,e)}function D(e){let{extraTags:t,extraGlobalAttributes:i}=e,n=i||t?new v(t,i):v.default;return e=>M(n,e)}const I=r.o$.parser.configure({top:"SingleExpression"}),R=[{tag:"script",attrs:e=>"text/typescript"==e.type||"ts"==e.lang,parser:r.sL.parser},{tag:"script",attrs:e=>"text/babel"==e.type||"text/jsx"==e.type,parser:r.W6.parser},{tag:"script",attrs:e=>"text/typescript-jsx"==e.type,parser:r.g4.parser},{tag:"script",attrs:e=>/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type),parser:I},{tag:"script",attrs:e=>!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type),parser:r.o$.parser},{tag:"style",attrs:e=>(!e.lang||"css"==e.lang)&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type)),parser:s.Yk.parser}],k=[{name:"style",parser:s.Yk.parser.configure({top:"Styles"})}].concat(y.map(e=>({name:e,parser:r.o$.parser}))),P=l.bj.define({name:"html",parser:n.K.configure({props:[l.Oh.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag":e=>e.column(e.node.from)+e.unit,Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].length<e.node.to)return e.continue();let t,i=null;for(let t=e.node;;){let e=t.lastChild;if(!e||"Element"!=e.name||e.to!=t.to)break;i=t=e}return i&&(!(t=i.lastChild)||"CloseTag"!=t.name&&"SelfClosingTag"!=t.name)?e.lineIndent(i.from)+e.unit:null}}),l.b_.add({Element(e){let t=e.firstChild,i=e.lastChild;return t&&"OpenTag"==t.name?{from:t.to,to:"CloseTag"==i.name?i.from:e.to}:null}}),l.Q_.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"\x3c!--",close:"--\x3e"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),_=P.configure({wrap:(0,n.n)(R,k)});function L(e={}){let t,i="";!1===e.matchClosingTags&&(i="noMatch"),!0===e.selfClosingTags&&(i=(i?i+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(t=(0,n.n)((e.nestedLanguages||[]).concat(R),(e.nestedAttributes||[]).concat(k)));let o=t?P.configure({wrap:t,dialect:i}):i?_.configure({dialect:i}):_;return new l.Yy(o,[_.data.of({autocomplete:D(e)}),!1!==e.autoCloseTags?O:[],(0,r.javascript)().support,(0,s.css)().support])}const N=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),O=o.Lz.inputHandler.of((e,t,i,n,s)=>{if(e.composing||e.state.readOnly||t!=i||">"!=n&&"/"!=n||!_.isActiveAt(e.state,t,-1))return!1;let r=s(),{state:o}=r,c=o.changeByRange(e=>{var t;let i,s=o.doc.sliceString(e.from-1,e.to)==n,{head:r}=e,c=(0,l.mv)(o).resolveInner(r,-1);if(s&&">"==n&&"EndTag"==c.name){let t=c.parent;if((i=b(o.doc,t.parent,r))&&!N.has(i)&&!function(e,t,i){for(var n;;){if("CloseTag"!=(null===(n=t.lastChild)||void 0===n?void 0:n.name))return!1;let s=t.parent;if(!s||b(e,s)!=i)return!0;t=s}}(o.doc,t.parent,i))return{range:e,changes:{from:r,to:r+(">"===o.doc.sliceString(r,r+1)?1:0),insert:`</${i}>`}}}else if(s&&"/"==n&&"IncompleteCloseTag"==c.name){let e=c.parent;if(c.from==r-2&&"CloseTag"!=(null===(t=e.lastChild)||void 0===t?void 0:t.name)&&(i=b(o.doc,e,r))&&!N.has(i)){let e=r+(">"===o.doc.sliceString(r,r+1)?1:0),t=`${i}>`;return{range:a.OF.cursor(r+t.length,-1),changes:{from:r,to:e,insert:t}}}}return{range:e}});return!c.changes.empty&&(e.dispatch([r,o.update(c,{userEvent:"input.complete",scrollIntoView:!0})]),!0)})},121(e,t,i){"use strict";i.d(t,{W6:()=>x,g4:()=>E,javascript:()=>D,o$:()=>C,sL:()=>S});var n=i(70062),s=i(62388),r=i(1993),o=i(51104),a=i(15115),l=i(16713);const c=[(0,a.Gw)("function ${name}(${params}) {\n\t${}\n}",{label:"function",detail:"definition",type:"keyword"}),(0,a.Gw)("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n\t${}\n}",{label:"for",detail:"loop",type:"keyword"}),(0,a.Gw)("for (let ${name} of ${collection}) {\n\t${}\n}",{label:"for",detail:"of loop",type:"keyword"}),(0,a.Gw)("do {\n\t${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),(0,a.Gw)("while (${}) {\n\t${}\n}",{label:"while",detail:"loop",type:"keyword"}),(0,a.Gw)("try {\n\t${}\n} catch (${error}) {\n\t${}\n}",{label:"try",detail:"/ catch block",type:"keyword"}),(0,a.Gw)("if (${}) {\n\t${}\n}",{label:"if",detail:"block",type:"keyword"}),(0,a.Gw)("if (${}) {\n\t${}\n} else {\n\t${}\n}",{label:"if",detail:"/ else block",type:"keyword"}),(0,a.Gw)("class ${name} {\n\tconstructor(${params}) {\n\t\t${}\n\t}\n}",{label:"class",detail:"definition",type:"keyword"}),(0,a.Gw)('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),(0,a.Gw)('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],h=c.concat([(0,a.Gw)("interface ${name} {\n\t${}\n}",{label:"interface",detail:"definition",type:"keyword"}),(0,a.Gw)("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),(0,a.Gw)("enum ${name} {\n\t${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),u=new l.RY,d=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function p(e){return(t,i)=>{let n=t.node.getChild("VariableDefinition");return n&&i(n,e),!0}}const g=["FunctionDeclaration"],f={FunctionDeclaration:p("function"),ClassDeclaration:p("class"),ClassExpression:()=>!0,EnumDeclaration:p("constant"),TypeAliasDeclaration:p("type"),NamespaceDeclaration:p("namespace"),VariableDefinition(e,t){e.matchContext(g)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function m(e,t){let i=u.get(t);if(i)return i;let n=[],s=!0;function r(t,i){let s=e.sliceString(t.from,t.to);n.push({label:s,type:i})}return t.cursor(l.Qj.IncludeAnonymous).iterate(t=>{if(s)s=!1;else if(t.name){let e=f[t.name];if(e&&e(t,r)||d.has(t.name))return!1}else if(t.to-t.from>8192){for(let i of m(e,t.node))n.push(i);return!1}}),u.set(t,n),n}const y=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,v=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function b(e){let t=(0,s.mv)(e.state).resolveInner(e.pos,-1);if(v.indexOf(t.name)>-1)return null;let i="VariableName"==t.name||t.to-t.from<20&&y.test(e.state.sliceDoc(t.from,t.to));if(!i&&!e.explicit)return null;let n=[];for(let i=t;i;i=i.parent)d.has(i.name)&&(n=n.concat(m(e.state.doc,i)));return{options:n,from:i?t.from:e.pos,validFor:y}}const C=s.bj.define({name:"javascript",parser:n.K.configure({props:[s.Oh.add({IfStatement:(0,s.mz)({except:/^\s*({|else\b)/}),TryStatement:(0,s.mz)({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:s._Y,SwitchBody:e=>{let t=e.textAfter,i=/^\s*\}/.test(t),n=/^\s*(case|default)\b/.test(t);return e.baseIndent+(i?0:n?1:2)*e.unit},Block:(0,s.Ay)({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":(0,s.mz)({except:/^\s*{/}),JSXElement(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},JSXEscape(e){let t=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"JSXOpenTag JSXSelfClosingTag":e=>e.column(e.node.from)+e.unit}),s.b_.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":s.yd,BlockComment:e=>({from:e.from+2,to:e.to-2}),JSXElement(e){let t=e.firstChild;if(!t||"JSXSelfClosingTag"==t.name)return null;let i=e.lastChild;return{from:t.to,to:i.type.isError?e.to:i.from}},"JSXSelfClosingTag JSXOpenTag"(e){var t;let i=null===(t=e.firstChild)||void 0===t?void 0:t.nextSibling,n=e.lastChild;return!i||i.type.isError?null:{from:i.to,to:n.type.isError?e.to:n.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),w={test:e=>/^JSX/.test(e.name),facet:(0,s.p9)({commentTokens:{block:{open:"{/*",close:"*/}"}}})},S=C.configure({dialect:"ts"},"typescript"),x=C.configure({dialect:"jsx",props:[s.Q0.add(e=>e.isTop?[w]:void 0)]}),E=C.configure({dialect:"jsx ts",props:[s.Q0.add(e=>e.isTop?[w]:void 0)]},"typescript");let A=e=>({label:e,type:"keyword"});const M="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(A),T=M.concat(["declare","implements","private","protected","public"].map(A));function D(e={}){let t=e.jsx?e.typescript?E:x:e.typescript?S:C,i=e.typescript?h.concat(T):c.concat(M);return new s.Yy(t,[C.data.of({autocomplete:(0,a.Ar)(v,(0,a.et)(i))}),C.data.of({autocomplete:b}),e.jsx?k:[]])}function I(e,t,i=e.length){for(let n=null==t?void 0:t.firstChild;n;n=n.nextSibling)if("JSXIdentifier"==n.name||"JSXBuiltin"==n.name||"JSXNamespacedName"==n.name||"JSXMemberExpression"==n.name)return e.sliceString(n.from,Math.min(n.to,i));return""}const R="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),k=o.Lz.inputHandler.of((e,t,i,n,o)=>{if((R?e.composing:e.compositionStarted)||e.state.readOnly||t!=i||">"!=n&&"/"!=n||!C.isActiveAt(e.state,t,-1))return!1;let a=o(),{state:l}=a,c=l.changeByRange(e=>{var t;let i,{head:o}=e,a=(0,s.mv)(l).resolveInner(o-1,-1);if("JSXStartTag"==a.name&&(a=a.parent),l.doc.sliceString(o-1,o)!=n||"JSXAttributeValue"==a.name&&a.to>o);else{if(">"==n&&"JSXFragmentTag"==a.name)return{range:e,changes:{from:o,insert:"</>"}};if("/"==n&&"JSXStartCloseTag"==a.name){let e=a.parent,n=e.parent;if(n&&e.from==o-2&&((i=I(l.doc,n.firstChild,o))||"JSXFragmentTag"==(null===(t=n.firstChild)||void 0===t?void 0:t.name))){let e=`${i}>`;return{range:r.OF.cursor(o+e.length,-1),changes:{from:o,insert:e}}}}else if(">"==n){let t=function(e){for(;;){if("JSXOpenTag"==e.name||"JSXSelfClosingTag"==e.name||"JSXFragmentTag"==e.name)return e;if("JSXEscape"==e.name||!e.parent)return null;e=e.parent}}(a);if(t&&"JSXOpenTag"==t.name&&!/^\/?>|^<\//.test(l.doc.sliceString(o,o+2))&&(i=I(l.doc,t,o)))return{range:e,changes:{from:o,insert:`</${i}>`}}}}return{range:e}});return!c.changes.empty&&(e.dispatch([a,l.update(c,{userEvent:"input.complete",scrollIntoView:!0})]),!0)})},13617(e,t,i){"use strict";i.d(t,{markdown:()=>D});var n=i(1993),s=i(51104),r=i(62388),o=i(15115),a=i(84735),l=i(35903),c=i(16713);const h=(0,r.p9)({commentTokens:{block:{open:"\x3c!--",close:"--\x3e"}}}),u=new c.uY,d=a.K3.configure({props:[r.b_.add(e=>!e.is("Block")||e.is("Document")||null!=p(e)||function(e){return"OrderedList"==e.name||"BulletList"==e.name}(e)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),u.add(p),r.Oh.add({Document:()=>null}),r.iB.add({Document:h})]});function p(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function g(e,t){let i=e;for(;;){let e,n=i.nextSibling;if(!n||null!=(e=p(n.type))&&e<=t)break;i=n}return i.to}const f=r.t.of((e,t,i)=>{for(let n=(0,r.mv)(e).resolveInner(i,-1);n&&!(n.from<t);n=n.parent){let e=n.type.prop(u);if(null==e)continue;let t=g(n,e);if(t>i)return{from:i,to:t}}return null});function m(e){return new r.TM(h,e,[],"markdown")}const y=m(d),v=m(d.configure([a.Fz,a.E,a.Z3,a.zT,{props:[r.b_.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]));class b{constructor(e,t,i,n,s,r,o){this.node=e,this.from=t,this.to=i,this.spaceBefore=n,this.spaceAfter=s,this.type=r,this.item=o}blank(e,t=!0){let i=this.spaceBefore+("Blockquote"==this.node.name?">":"");if(null!=e){for(;i.length<e;)i+=" ";return i}for(let e=this.to-this.from-i.length-this.spaceAfter.length;e>0;e--)i+=" ";return i+(t?this.spaceAfter:"")}marker(e,t){let i="OrderedList"==this.node.name?String(+w(this.item,e)[2]+t):"";return this.spaceBefore+i+this.type+this.spaceAfter}}function C(e,t){let i=[],n=[];for(let t=e;t;t=t.parent){if("FencedCode"==t.name)return n;"ListItem"!=t.name&&"Blockquote"!=t.name||i.push(t)}for(let e=i.length-1;e>=0;e--){let s,r=i[e],o=t.lineAt(r.from),a=r.from-o.from;if("Blockquote"==r.name&&(s=/^ *>( ?)/.exec(o.text.slice(a))))n.push(new b(r,a,a+s[0].length,"",s[1],">",null));else if("ListItem"==r.name&&"OrderedList"==r.parent.name&&(s=/^( *)\d+([.)])( *)/.exec(o.text.slice(a)))){let e=s[3],t=s[0].length;e.length>=4&&(e=e.slice(0,e.length-4),t-=4),n.push(new b(r.parent,a,a+t,s[1],e,s[2],r))}else if("ListItem"==r.name&&"BulletList"==r.parent.name&&(s=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(a)))){let e=s[4],t=s[0].length;e.length>4&&(e=e.slice(0,e.length-4),t-=4);let i=s[2];s[3]&&(i+=s[3].replace(/[xX]/," ")),n.push(new b(r.parent,a,a+t,s[1],e,i,r))}}return n}function w(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function S(e,t,i,n=0){for(let s=-1,r=e;;){if("ListItem"==r.name){let e=w(r,t),o=+e[2];if(s>=0){if(o!=s+1)return;i.push({from:r.from+e[1].length,to:r.from+e[0].length,insert:String(s+2+n)})}s=o}let e=r.nextSibling;if(!e)break;r=e}}function x(e,t){let i=/^[ \t]*/.exec(e)[0].length;if(!i||"\t"!=t.facet(r.Xt))return e;let s="";for(let t=(0,n.y$)(e,4,i);t>0;)t>=4?(s+="\t",t-=4):(s+=" ",t--);return s+e.slice(i)}function E(e){return"QuoteMark"==e.name||"ListMark"==e.name}function A(e,t,i){let s="";for(let t=0,r=e.length-2;t<=r;t++)s+=e[t].blank(t<r?(0,n.y$)(i.text,4,e[t+1].from)-s.length:null,t<r);return x(s,t)}const M=[{key:"Enter",run:((e={})=>({state:t,dispatch:i})=>{let s=(0,r.mv)(t),{doc:o}=t,a=null,l=t.changeByRange(i=>{if(!i.empty||!v.isActiveAt(t,i.from,-1)&&!v.isActiveAt(t,i.from,1))return a={range:i};let r=i.from,l=o.lineAt(r),c=C(s.resolveInner(r,-1),o);for(;c.length&&c[c.length-1].from>r-l.from;)c.pop();if(!c.length)return a={range:i};let h=c[c.length-1];if(h.to-h.spaceAfter.length>r-l.from)return a={range:i};let u=r>=h.to-h.spaceAfter.length&&!/\S/.test(l.text.slice(h.to));if(h.item&&u){if(h.item.from<l.from&&!/^[\s>]*$/.test(l.text.slice(0,h.to)))return a={range:i};let s=h.node.firstChild,u=h.node.getChild("ListItem","ListItem");if(s.to>=r||u&&u.to<r||l.from>0&&!/[^\s>]/.test(o.lineAt(l.from-1).text)||!1===e.nonTightLists){let e,t=c.length>1?c[c.length-2]:null,i="";t&&t.item?(e=l.from+t.from,i=t.marker(o,1)):e=l.from+(t?t.to:0);let s=[{from:e,to:r,insert:i}];return"OrderedList"==h.node.name&&S(h.item,o,s,-2),t&&"OrderedList"==t.node.name&&S(t.item,o,s),{range:n.OF.cursor(e+i.length),changes:s}}{let e=A(c,t,l);return{range:n.OF.cursor(r+e.length+1),changes:{from:l.from,insert:e+t.lineBreak}}}}if("Blockquote"==h.node.name&&u&&l.from){let e=o.lineAt(l.from-1),n=/>\s*$/.exec(e.text);if(n&&n.index==h.from){let s=t.changes([{from:e.from+n.index,to:e.to},{from:l.from+h.from,to:l.to}]);return{range:i.map(s),changes:s}}}let d=[];"OrderedList"==h.node.name&&S(h.item,o,d);let p=h.item&&h.item.from<l.from,g="";if(!p||/^[\s\d.)\-+*>]*/.exec(l.text)[0].length>=h.to)for(let e=0,t=c.length-1;e<=t;e++)g+=e!=t||p?c[e].blank(e<t?(0,n.y$)(l.text,4,c[e+1].from)-g.length:null):c[e].marker(o,1);let f=r;for(;f>l.from&&/\s/.test(l.text.charAt(f-l.from-1));)f--;return g=x(g,t),function(e,t){if("OrderedList"!=e.name&&"BulletList"!=e.name)return!1;let i=e.firstChild,n=e.getChild("ListItem","ListItem");if(!n)return!1;let s=t.lineAt(i.to),r=t.lineAt(n.from),o=/^[\s>]*$/.test(s.text);return s.number+(o?0:1)<r.number}(h.node,t.doc)&&(g=A(c,t,l)+t.lineBreak+g),d.push({from:f,to:r,insert:t.lineBreak+g}),{range:n.OF.cursor(f+g.length+1),changes:d}});return!a&&(i(t.update(l,{scrollIntoView:!0,userEvent:"input"})),!0)})()},{key:"Backspace",run:({state:e,dispatch:t})=>{let i=(0,r.mv)(e),s=null,o=e.changeByRange(t=>{let r=t.from,{doc:o}=e;if(t.empty&&v.isActiveAt(e,t.from)){let t=o.lineAt(r),s=C(function(e,t){let i=e.resolveInner(t,-1),n=t;E(i)&&(n=i.from,i=i.parent);for(let e;e=i.childBefore(n);)if(E(e))n=e.from;else{if("OrderedList"!=e.name&&"BulletList"!=e.name)break;i=e.lastChild,n=i.to}return i}(i,r),o);if(s.length){let i=s[s.length-1],o=i.to-i.spaceAfter.length+(i.spaceAfter?1:0);if(r-t.from>o&&!/\S/.test(t.text.slice(o,r-t.from)))return{range:n.OF.cursor(t.from+o),changes:{from:t.from+o,to:r}};if(r-t.from==o&&(i.item&&t.from<=i.item.from||/^[\s>]*$/.test(t.text.slice(0,i.to)))){let s=t.from+i.from;if(i.item&&i.node.from<i.item.from&&/\S/.test(t.text.slice(i.from,i.to))){let r=i.blank((0,n.y$)(t.text,4,i.to)-(0,n.y$)(t.text,4,i.from));return s==t.from&&(r=x(r,e)),{range:n.OF.cursor(s+r.length),changes:{from:s,to:t.from+i.to,insert:r}}}if(s<r)return{range:n.OF.cursor(s),changes:{from:s,to:r}}}}}return s={range:t}});return!s&&(t(e.update(o,{scrollIntoView:!0,userEvent:"delete"})),!0)}}],T=(0,l.html)({matchClosingTags:!1});function D(e={}){let{codeLanguages:t,defaultCodeLanguage:i,addKeymap:o=!0,base:{parser:l}=y,completeHTMLTags:c=!0,pasteURLAsLink:h=!0,htmlTagLanguage:u=T}=e;if(!(l instanceof a.Fd))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let d,p=e.extensions?[e.extensions]:[],g=[u.support,f];h&&g.push(_),i instanceof r.Yy?(g.push(i.support),d=i.language):i&&(d=i);let v=t||d?(b=t,C=d,e=>{if(e&&b){let t=null;if(e=/\S*/.exec(e)[0],t="function"==typeof b?b(e):r.t$.matchLanguageName(b,e,!0),t instanceof r.t$)return t.support?t.support.language.parser:r.nq.getSkippingParser(t.load());if(t)return t.parser}return C?C.parser:null}):void 0;var b,C;p.push((0,a.Xp)({codeParser:v,htmlParser:u.language.parser})),o&&g.push(n.Nb.high(s.w4.of(M)));let w=m(l.configure(p));return c&&g.push(w.data.of({autocomplete:I})),new r.Yy(w,g)}function I(e){let{state:t,pos:i}=e,n=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(i-25,i));if(!n)return null;let s=(0,r.mv)(t).resolveInner(i,-1);for(;s&&!s.type.isTop;){if("CodeBlock"==s.name||"FencedCode"==s.name||"ProcessingInstructionBlock"==s.name||"CommentBlock"==s.name||"Link"==s.name||"Image"==s.name)return null;s=s.parent}return{from:i-n[0].length,to:i,options:k(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let R=null;function k(){if(R)return R;let e=(0,l.$g)(new o._5(n.$t.create({extensions:T}),0,!0));return R=e?e.options:[]}const P=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,_=s.Lz.domEventHandlers({paste:(e,t)=>{var i;let{main:n}=t.state.selection;if(n.empty)return!1;let s=null===(i=e.clipboardData)||void 0===i?void 0:i.getData("text/plain");if(!s||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(s))return!1;if(/^www\./.test(s)&&(s="https://"+s),!v.isActiveAt(t.state,n.from,1))return!1;let o=(0,r.mv)(t.state),a=!1;return o.iterate({from:n.from,to:n.to,enter:e=>{(e.from>n.from||P.test(e.name))&&(a=!0)},leave:e=>{e.to<n.to&&(a=!0)}}),!a&&(t.dispatch({changes:[{from:n.from,insert:"["},{from:n.to,insert:`](${s})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}})},85215(e,t,i){"use strict";i.d(t,{e:()=>o});var n=i(62388);function s(e){return new n.Yy(n.Tg.define(e))}function r(e){return i.e(6775).then(i.bind(i,29156)).then(t=>t.sql({dialect:t[e]}))}const o=[n.t$.of({name:"C",extensions:["c","h","ino"],load:()=>i.e(88).then(i.bind(i,10088)).then(e=>e.cpp())}),n.t$.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load:()=>i.e(88).then(i.bind(i,10088)).then(e=>e.cpp())}),n.t$.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load:()=>r("Cassandra")}),n.t$.of({name:"CSS",extensions:["css"],load:()=>Promise.resolve().then(i.bind(i,90364)).then(e=>e.css())}),n.t$.of({name:"Go",extensions:["go"],load:()=>i.e(5740).then(i.bind(i,5740)).then(e=>e.go())}),n.t$.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load:()=>Promise.resolve().then(i.bind(i,35903)).then(e=>e.html())}),n.t$.of({name:"Java",extensions:["java"],load:()=>i.e(603).then(i.bind(i,30603)).then(e=>e.java())}),n.t$.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load:()=>Promise.resolve().then(i.bind(i,121)).then(e=>e.javascript())}),n.t$.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load:()=>i.e(6523).then(i.bind(i,76523)).then(e=>e.jinja())}),n.t$.of({name:"JSON",alias:["json5"],extensions:["json","map"],load:()=>i.e(3423).then(i.bind(i,73423)).then(e=>e.json())}),n.t$.of({name:"JSX",extensions:["jsx"],load:()=>Promise.resolve().then(i.bind(i,121)).then(e=>e.javascript({jsx:!0}))}),n.t$.of({name:"LESS",extensions:["less"],load:()=>i.e(2154).then(i.bind(i,32154)).then(e=>e.less())}),n.t$.of({name:"Liquid",extensions:["liquid"],load:()=>i.e(822).then(i.bind(i,10822)).then(e=>e.liquid())}),n.t$.of({name:"MariaDB SQL",load:()=>r("MariaSQL")}),n.t$.of({name:"Markdown",extensions:["md","markdown","mkd"],load:()=>Promise.resolve().then(i.bind(i,13617)).then(e=>e.markdown())}),n.t$.of({name:"MS SQL",load:()=>r("MSSQL")}),n.t$.of({name:"MySQL",load:()=>r("MySQL")}),n.t$.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load:()=>i.e(5635).then(i.bind(i,85635)).then(e=>e.php())}),n.t$.of({name:"PLSQL",extensions:["pls"],load:()=>r("PLSQL")}),n.t$.of({name:"PostgreSQL",load:()=>r("PostgreSQL")}),n.t$.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load:()=>i.e(8583).then(i.bind(i,88583)).then(e=>e.python())}),n.t$.of({name:"Rust",extensions:["rs"],load:()=>i.e(5012).then(i.bind(i,35012)).then(e=>e.rust())}),n.t$.of({name:"Sass",extensions:["sass"],load:()=>i.e(5292).then(i.bind(i,45292)).then(e=>e.sass({indented:!0}))}),n.t$.of({name:"SCSS",extensions:["scss"],load:()=>i.e(5292).then(i.bind(i,45292)).then(e=>e.sass())}),n.t$.of({name:"SQL",extensions:["sql"],load:()=>r("StandardSQL")}),n.t$.of({name:"SQLite",load:()=>r("SQLite")}),n.t$.of({name:"TSX",extensions:["tsx"],load:()=>Promise.resolve().then(i.bind(i,121)).then(e=>e.javascript({jsx:!0,typescript:!0}))}),n.t$.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load:()=>Promise.resolve().then(i.bind(i,121)).then(e=>e.javascript({typescript:!0}))}),n.t$.of({name:"WebAssembly",extensions:["wat","wast"],load:()=>i.e(9818).then(i.bind(i,19818)).then(e=>e.wast())}),n.t$.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load:()=>i.e(25).then(i.bind(i,25)).then(e=>e.xml())}),n.t$.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load:()=>i.e(3328).then(i.bind(i,53328)).then(e=>e.yaml())}),n.t$.of({name:"APL",extensions:["dyalog","apl"],load:()=>i.e(2558).then(i.bind(i,2558)).then(e=>s(e.apl))}),n.t$.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load:()=>i.e(7239).then(i.bind(i,27239)).then(e=>s(e.asciiArmor))}),n.t$.of({name:"ASN.1",extensions:["asn","asn1"],load:()=>i.e(5064).then(i.bind(i,55064)).then(e=>s(e.asn1({})))}),n.t$.of({name:"Asterisk",filename:/^extensions\.conf$/i,load:()=>i.e(8345).then(i.bind(i,8345)).then(e=>s(e.asterisk))}),n.t$.of({name:"Brainfuck",extensions:["b","bf"],load:()=>i.e(638).then(i.bind(i,80638)).then(e=>s(e.brainfuck))}),n.t$.of({name:"Cobol",extensions:["cob","cpy"],load:()=>i.e(6466).then(i.bind(i,66466)).then(e=>s(e.cobol))}),n.t$.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load:()=>i.e(9439).then(i.bind(i,19439)).then(e=>s(e.csharp))}),n.t$.of({name:"Clojure",extensions:["clj","cljc","cljx"],load:()=>i.e(3893).then(i.bind(i,43893)).then(e=>s(e.clojure))}),n.t$.of({name:"ClojureScript",extensions:["cljs"],load:()=>i.e(3893).then(i.bind(i,43893)).then(e=>s(e.clojure))}),n.t$.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load:()=>i.e(770).then(i.bind(i,60770)).then(e=>s(e.gss))}),n.t$.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load:()=>i.e(5306).then(i.bind(i,5306)).then(e=>s(e.cmake))}),n.t$.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load:()=>i.e(8902).then(i.bind(i,48902)).then(e=>s(e.coffeeScript))}),n.t$.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load:()=>i.e(5540).then(i.bind(i,15540)).then(e=>s(e.commonLisp))}),n.t$.of({name:"Cypher",extensions:["cyp","cypher"],load:()=>i.e(6762).then(i.bind(i,86762)).then(e=>s(e.cypher))}),n.t$.of({name:"Cython",extensions:["pyx","pxd","pxi"],load:()=>i.e(411).then(i.bind(i,10411)).then(e=>s(e.cython))}),n.t$.of({name:"Crystal",extensions:["cr"],load:()=>i.e(355).then(i.bind(i,80355)).then(e=>s(e.crystal))}),n.t$.of({name:"D",extensions:["d"],load:()=>i.e(3197).then(i.bind(i,83197)).then(e=>s(e.d))}),n.t$.of({name:"Dart",extensions:["dart"],load:()=>i.e(9439).then(i.bind(i,19439)).then(e=>s(e.dart))}),n.t$.of({name:"diff",extensions:["diff","patch"],load:()=>i.e(9410).then(i.bind(i,99410)).then(e=>s(e.diff))}),n.t$.of({name:"Dockerfile",filename:/^Dockerfile$/,load:()=>i.e(9156).then(i.bind(i,66775)).then(e=>s(e.dockerFile))}),n.t$.of({name:"DTD",extensions:["dtd"],load:()=>i.e(6781).then(i.bind(i,76781)).then(e=>s(e.dtd))}),n.t$.of({name:"Dylan",extensions:["dylan","dyl","intr"],load:()=>i.e(6323).then(i.bind(i,96323)).then(e=>s(e.dylan))}),n.t$.of({name:"EBNF",load:()=>i.e(4374).then(i.bind(i,34374)).then(e=>s(e.ebnf))}),n.t$.of({name:"ECL",extensions:["ecl"],load:()=>i.e(2765).then(i.bind(i,92765)).then(e=>s(e.ecl))}),n.t$.of({name:"edn",extensions:["edn"],load:()=>i.e(3893).then(i.bind(i,43893)).then(e=>s(e.clojure))}),n.t$.of({name:"Eiffel",extensions:["e"],load:()=>i.e(34).then(i.bind(i,90034)).then(e=>s(e.eiffel))}),n.t$.of({name:"Elm",extensions:["elm"],load:()=>i.e(2525).then(i.bind(i,42525)).then(e=>s(e.elm))}),n.t$.of({name:"Erlang",extensions:["erl"],load:()=>i.e(4846).then(i.bind(i,44846)).then(e=>s(e.erlang))}),n.t$.of({name:"Esper",load:()=>i.e(417).then(i.bind(i,70417)).then(e=>s(e.esper))}),n.t$.of({name:"Factor",extensions:["factor"],load:()=>i.e(8038).then(i.bind(i,18038)).then(e=>s(e.factor))}),n.t$.of({name:"FCL",load:()=>i.e(3992).then(i.bind(i,63992)).then(e=>s(e.fcl))}),n.t$.of({name:"Forth",extensions:["forth","fth","4th"],load:()=>i.e(3294).then(i.bind(i,63294)).then(e=>s(e.forth))}),n.t$.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load:()=>i.e(171).then(i.bind(i,30171)).then(e=>s(e.fortran))}),n.t$.of({name:"F#",alias:["fsharp"],extensions:["fs"],load:()=>i.e(2951).then(i.bind(i,42951)).then(e=>s(e.fSharp))}),n.t$.of({name:"Gas",extensions:["s"],load:()=>i.e(7784).then(i.bind(i,27784)).then(e=>s(e.gas))}),n.t$.of({name:"Gherkin",extensions:["feature"],load:()=>i.e(8491).then(i.bind(i,28491)).then(e=>s(e.gherkin))}),n.t$.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load:()=>i.e(3879).then(i.bind(i,73879)).then(e=>s(e.groovy))}),n.t$.of({name:"Haskell",extensions:["hs"],load:()=>i.e(365).then(i.bind(i,50365)).then(e=>s(e.haskell))}),n.t$.of({name:"Haxe",extensions:["hx"],load:()=>i.e(9097).then(i.bind(i,99097)).then(e=>s(e.haxe))}),n.t$.of({name:"HXML",extensions:["hxml"],load:()=>i.e(9097).then(i.bind(i,99097)).then(e=>s(e.hxml))}),n.t$.of({name:"HTTP",load:()=>i.e(2757).then(i.bind(i,42757)).then(e=>s(e.http))}),n.t$.of({name:"IDL",extensions:["pro"],load:()=>i.e(6770).then(i.bind(i,36770)).then(e=>s(e.idl))}),n.t$.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load:()=>i.e(7706).then(i.bind(i,67706)).then(e=>s(e.jsonld))}),n.t$.of({name:"Julia",extensions:["jl"],load:()=>i.e(5104).then(i.bind(i,65104)).then(e=>s(e.julia))}),n.t$.of({name:"Kotlin",extensions:["kt","kts"],load:()=>i.e(9439).then(i.bind(i,19439)).then(e=>s(e.kotlin))}),n.t$.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load:()=>i.e(1480).then(i.bind(i,11480)).then(e=>s(e.liveScript))}),n.t$.of({name:"Lua",extensions:["lua"],load:()=>i.e(8043).then(i.bind(i,68043)).then(e=>s(e.lua))}),n.t$.of({name:"mIRC",extensions:["mrc"],load:()=>i.e(7472).then(i.bind(i,97472)).then(e=>s(e.mirc))}),n.t$.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load:()=>i.e(7909).then(i.bind(i,17909)).then(e=>s(e.mathematica))}),n.t$.of({name:"Modelica",extensions:["mo"],load:()=>i.e(1057).then(i.bind(i,51057)).then(e=>s(e.modelica))}),n.t$.of({name:"MUMPS",extensions:["mps"],load:()=>i.e(6821).then(i.bind(i,16821)).then(e=>s(e.mumps))}),n.t$.of({name:"Mbox",extensions:["mbox"],load:()=>i.e(965).then(i.bind(i,70965)).then(e=>s(e.mbox))}),n.t$.of({name:"Nginx",filename:/nginx.*\.conf$/i,load:()=>i.e(7481).then(i.bind(i,17481)).then(e=>s(e.nginx))}),n.t$.of({name:"NSIS",extensions:["nsh","nsi"],load:()=>i.e(6022).then(i.bind(i,26022)).then(e=>s(e.nsis))}),n.t$.of({name:"NTriples",extensions:["nt","nq"],load:()=>i.e(118).then(i.bind(i,118)).then(e=>s(e.ntriples))}),n.t$.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load:()=>i.e(9439).then(i.bind(i,19439)).then(e=>s(e.objectiveC))}),n.t$.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load:()=>i.e(9439).then(i.bind(i,19439)).then(e=>s(e.objectiveCpp))}),n.t$.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load:()=>i.e(2951).then(i.bind(i,42951)).then(e=>s(e.oCaml))}),n.t$.of({name:"Octave",extensions:["m"],load:()=>i.e(3449).then(i.bind(i,43449)).then(e=>s(e.octave))}),n.t$.of({name:"Oz",extensions:["oz"],load:()=>i.e(9732).then(i.bind(i,69732)).then(e=>s(e.oz))}),n.t$.of({name:"Pascal",extensions:["p","pas"],load:()=>i.e(9897).then(i.bind(i,9897)).then(e=>s(e.pascal))}),n.t$.of({name:"Perl",extensions:["pl","pm"],load:()=>i.e(8332).then(i.bind(i,58332)).then(e=>s(e.perl))}),n.t$.of({name:"Pig",extensions:["pig"],load:()=>i.e(5473).then(i.bind(i,35473)).then(e=>s(e.pig))}),n.t$.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load:()=>i.e(236).then(i.bind(i,236)).then(e=>s(e.powerShell))}),n.t$.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load:()=>i.e(7124).then(i.bind(i,87124)).then(e=>s(e.properties))}),n.t$.of({name:"ProtoBuf",extensions:["proto"],load:()=>i.e(6486).then(i.bind(i,36486)).then(e=>s(e.protobuf))}),n.t$.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load:()=>i.e(157).then(i.bind(i,30157)).then(e=>s(e.pug))}),n.t$.of({name:"Puppet",extensions:["pp"],load:()=>i.e(4471).then(i.bind(i,14471)).then(e=>s(e.puppet))}),n.t$.of({name:"Q",extensions:["q"],load:()=>i.e(3602).then(i.bind(i,93602)).then(e=>s(e.q))}),n.t$.of({name:"R",alias:["rscript"],extensions:["r","R"],load:()=>i.e(7439).then(i.bind(i,7439)).then(e=>s(e.r))}),n.t$.of({name:"RPM Changes",load:()=>i.e(1740).then(i.bind(i,61740)).then(e=>s(e.rpmChanges))}),n.t$.of({name:"RPM Spec",extensions:["spec"],load:()=>i.e(1740).then(i.bind(i,61740)).then(e=>s(e.rpmSpec))}),n.t$.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load:()=>i.e(1725).then(i.bind(i,51725)).then(e=>s(e.ruby))}),n.t$.of({name:"SAS",extensions:["sas"],load:()=>i.e(1052).then(i.bind(i,61052)).then(e=>s(e.sas))}),n.t$.of({name:"Scala",extensions:["scala"],load:()=>i.e(9439).then(i.bind(i,19439)).then(e=>s(e.scala))}),n.t$.of({name:"Scheme",extensions:["scm","ss"],load:()=>i.e(2890).then(i.bind(i,32890)).then(e=>s(e.scheme))}),n.t$.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load:()=>i.e(9523).then(i.bind(i,69523)).then(e=>s(e.shell))}),n.t$.of({name:"Sieve",extensions:["siv","sieve"],load:()=>i.e(8295).then(i.bind(i,8295)).then(e=>s(e.sieve))}),n.t$.of({name:"Smalltalk",extensions:["st"],load:()=>i.e(8552).then(i.bind(i,58552)).then(e=>s(e.smalltalk))}),n.t$.of({name:"Solr",load:()=>i.e(225).then(i.bind(i,90225)).then(e=>s(e.solr))}),n.t$.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load:()=>i.e(2951).then(i.bind(i,42951)).then(e=>s(e.sml))}),n.t$.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load:()=>i.e(2680).then(i.bind(i,12680)).then(e=>s(e.sparql))}),n.t$.of({name:"Spreadsheet",alias:["excel","formula"],load:()=>i.e(5659).then(i.bind(i,55659)).then(e=>s(e.spreadsheet))}),n.t$.of({name:"Squirrel",extensions:["nut"],load:()=>i.e(9439).then(i.bind(i,19439)).then(e=>s(e.squirrel))}),n.t$.of({name:"Stylus",extensions:["styl"],load:()=>i.e(2883).then(i.bind(i,32883)).then(e=>s(e.stylus))}),n.t$.of({name:"Swift",extensions:["swift"],load:()=>i.e(7942).then(i.bind(i,27942)).then(e=>s(e.swift))}),n.t$.of({name:"sTeX",load:()=>i.e(3919).then(i.bind(i,83919)).then(e=>s(e.stex))}),n.t$.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load:()=>i.e(3919).then(i.bind(i,83919)).then(e=>s(e.stex))}),n.t$.of({name:"SystemVerilog",extensions:["v","sv","svh"],load:()=>i.e(4955).then(i.bind(i,24955)).then(e=>s(e.verilog))}),n.t$.of({name:"Tcl",extensions:["tcl"],load:()=>i.e(4862).then(i.bind(i,24862)).then(e=>s(e.tcl))}),n.t$.of({name:"Textile",extensions:["textile"],load:()=>i.e(8624).then(i.bind(i,78624)).then(e=>s(e.textile))}),n.t$.of({name:"TiddlyWiki",load:()=>i.e(1609).then(i.bind(i,71609)).then(e=>s(e.tiddlyWiki))}),n.t$.of({name:"Tiki wiki",load:()=>i.e(4278).then(i.bind(i,34278)).then(e=>s(e.tiki))}),n.t$.of({name:"TOML",extensions:["toml"],load:()=>i.e(3369).then(i.bind(i,13369)).then(e=>s(e.toml))}),n.t$.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load:()=>i.e(6518).then(i.bind(i,84137)).then(e=>s(e.troff))}),n.t$.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load:()=>i.e(6132).then(i.bind(i,56132)).then(e=>s(e.ttcn))}),n.t$.of({name:"TTCN_CFG",extensions:["cfg"],load:()=>i.e(235).then(i.bind(i,20235)).then(e=>s(e.ttcnCfg))}),n.t$.of({name:"Turtle",extensions:["ttl"],load:()=>i.e(9383).then(i.bind(i,59383)).then(e=>s(e.turtle))}),n.t$.of({name:"Web IDL",extensions:["webidl"],load:()=>i.e(900).then(i.bind(i,90900)).then(e=>s(e.webIDL))}),n.t$.of({name:"VB.NET",extensions:["vb"],load:()=>i.e(8957).then(i.bind(i,38957)).then(e=>s(e.vb))}),n.t$.of({name:"VBScript",extensions:["vbs"],load:()=>i.e(7138).then(i.bind(i,7138)).then(e=>s(e.vbScript))}),n.t$.of({name:"Velocity",extensions:["vtl"],load:()=>i.e(7490).then(i.bind(i,87490)).then(e=>s(e.velocity))}),n.t$.of({name:"Verilog",extensions:["v"],load:()=>i.e(4955).then(i.bind(i,24955)).then(e=>s(e.verilog))}),n.t$.of({name:"VHDL",extensions:["vhd","vhdl"],load:()=>i.e(2835).then(i.bind(i,42835)).then(e=>s(e.vhdl))}),n.t$.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load:()=>i.e(6909).then(i.bind(i,66909)).then(e=>s(e.xQuery))}),n.t$.of({name:"Yacas",extensions:["ys"],load:()=>i.e(1082).then(i.bind(i,21082)).then(e=>s(e.yacas))}),n.t$.of({name:"Z80",extensions:["z80"],load:()=>i.e(5423).then(i.bind(i,65423)).then(e=>s(e.z80))}),n.t$.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load:()=>i.e(8284).then(i.bind(i,65903)).then(e=>s(e.mscgen))}),n.t$.of({name:"Xù",extensions:["xu"],load:()=>i.e(8284).then(i.bind(i,65903)).then(e=>s(e.xu))}),n.t$.of({name:"MsGenny",extensions:["msgenny"],load:()=>i.e(8284).then(i.bind(i,65903)).then(e=>s(e.msgenny))}),n.t$.of({name:"Vue",extensions:["vue"],load:()=>i.e(6894).then(i.bind(i,36894)).then(e=>e.vue())}),n.t$.of({name:"Angular Template",load:()=>i.e(485).then(i.bind(i,10485)).then(e=>e.angular())})]},62388(e,t,i){"use strict";i.d(t,{cr:()=>ve,KB:()=>L,bj:()=>m,TM:()=>g,t$:()=>D,Yy:()=>T,nq:()=>C,Tg:()=>ze,SG:()=>Ne,Q_:()=>Oe,mz:()=>W,Zt:()=>Me,p9:()=>d,Ay:()=>H,_Y:()=>z,Lv:()=>me,yd:()=>Y,f7:()=>ae,b_:()=>K,t:()=>$,tp:()=>k,_v:()=>_,GY:()=>xe,Oh:()=>N,WD:()=>j,EI:()=>P,Xt:()=>R,BH:()=>M,iB:()=>u,jU:()=>Be,Q0:()=>p,y9:()=>Se,mv:()=>y});var n,s=i(16713),r=i(1993),o=i(51104),a=i(60214),l=i(14991);function c(e,t,i,n=0,s=0){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);let r=s;for(let s=n;s<t;s++)9==e.charCodeAt(s)?r+=i-r%i:r++;return r}class h{constructor(e,t,i,n){this.string=e,this.tabSize=t,this.indentUnit=i,this.overrideIndent=n,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return 0==this.pos}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(e){let t,i=this.string.charAt(this.pos);if(t="string"==typeof e?i==e:i&&(e instanceof RegExp?e.test(i):e(i)),t)return++this.pos,i}eatWhile(e){let t=this.pos;for(;this.eat(e););return this.pos>t}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=c(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){var e;return null!==(e=this.overrideIndent)&&void 0!==e?e:c(this.string,null,this.tabSize)}match(e,t,i){if("string"==typeof e){let n=e=>i?e.toLowerCase():e;return n(this.string.substr(this.pos,e.length))==n(e)?(!1!==t&&(this.pos+=e.length),!0):null}{let i=this.string.slice(this.pos).match(e);return i&&i.index>0?null:(i&&!1!==t&&(this.pos+=i[0].length),i)}}current(){return this.string.slice(this.start,this.pos)}}const u=new s.uY;function d(e){return r.sj.define({combine:e?t=>t.concat(e):void 0})}const p=new s.uY;class g{constructor(e,t,i=[],n=""){this.data=e,this.name=n,r.$t.prototype.hasOwnProperty("tree")||Object.defineProperty(r.$t.prototype,"tree",{get(){return y(this)}}),this.parser=t,this.extension=[M.of(this),r.$t.languageData.of((e,t,i)=>{let n=f(e,t,i),s=n.type.prop(u);if(!s)return[];let r=e.facet(s),o=n.type.prop(p);if(o){let s=n.resolve(t-n.from,i);for(let t of o)if(t.test(s,e)){let i=e.facet(t.facet);return"replace"==t.type?i:i.concat(r)}}return r})].concat(i)}isActiveAt(e,t,i=-1){return f(e,t,i).type.prop(u)==this.data}findRegions(e){let t=e.facet(M);if((null==t?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],n=(e,t)=>{if(e.prop(u)==this.data)return void i.push({from:t,to:t+e.length});let r=e.prop(s.uY.mounted);if(r){if(r.tree.prop(u)==this.data){if(r.overlay)for(let e of r.overlay)i.push({from:e.from+t,to:e.to+t});else i.push({from:t,to:t+e.length});return}if(r.overlay){let e=i.length;if(n(r.tree,r.overlay[0].from+t),i.length>e)return}}for(let i=0;i<e.children.length;i++){let r=e.children[i];r instanceof s.PH&&n(r,e.positions[i]+t)}};return n(y(e),0),i}get allowsNesting(){return!0}}function f(e,t,i){let n=e.facet(M),r=y(e).topNode;if(!n||n.allowsNesting)for(let e=r;e;e=e.enter(t,i,s.Qj.ExcludeBuffers|s.Qj.EnterBracketed))e.type.isTop&&(r=e);return r}g.setState=r.Pe.define();class m extends g{constructor(e,t,i){super(e,t,[],i),this.parser=t}static define(e){let t=d(e.languageData);return new m(t,e.parser.configure({props:[u.add(e=>e.isTop?t:void 0)]}),e.name)}configure(e,t){return new m(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function y(e){let t=e.field(g.state,!1);return t?t.tree:s.PH.empty}class v{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let i=this.cursorPos-this.string.length;return e<i||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}}let b=null;class C{constructor(e,t,i=[],n,s,r,o,a){this.parser=e,this.state=t,this.fragments=i,this.tree=n,this.treeLen=s,this.viewport=r,this.skipped=o,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new C(e,t,[],s.PH.empty,0,i,[],null)}startParse(){return this.parser.startParse(new v(this.state.doc),this.fragments)}work(e,t){return null!=t&&t>=this.state.doc.length&&(t=void 0),this.tree!=s.PH.empty&&this.isDone(null!=t?t:this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if("number"==typeof e){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||(this.parse=this.startParse()),null!=t&&(null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let n=this.parse.advance();if(n){if(this.fragments=this.withoutTempSkipped(s.rr.addTree(n,this.fragments,null!=this.parse.stoppedAt)),this.treeLen=null!==(i=this.parse.stoppedAt)&&void 0!==i?i:this.state.doc.length,this.tree=n,this.parse=null,!(this.treeLen<(null!=t?t:this.state.doc.length)))return!0;this.parse=this.startParse()}if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(s.rr.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=b;b=this;try{return e()}finally{b=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=w(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:n,treeLen:r,viewport:o,skipped:a}=this;if(this.takeTree(),!e.empty){let t=[];if(e.iterChangedRanges((e,i,n,s)=>t.push({fromA:e,toA:i,fromB:n,toB:s})),i=s.rr.applyChanges(i,t),n=s.PH.empty,r=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){a=[];for(let t of this.skipped){let i=e.mapPos(t.from,1),n=e.mapPos(t.to,-1);i<n&&a.push({from:i,to:n})}}}return new C(this.parser,t,i,n,r,o,a,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let t=0;t<this.skipped.length;t++){let{from:i,to:n}=this.skipped[t];i<e.to&&n>e.from&&(this.fragments=w(this.fragments,i,n),this.skipped.splice(t--,1))}return!(this.skipped.length>=t||(this.reset(),0))}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends s.iX{createParse(t,i,n){let r=n[0].from,o=n[n.length-1].to;return{parsedPos:r,advance(){let t=b;if(t){for(let e of n)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=o,new s.PH(s.Z6.none,[],[],o-r)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&0==t[0].from&&t[0].to>=e}static get(){return b}}function w(e,t,i){return s.rr.applyChanges(e,[{fromA:t,toA:i,fromB:t,toB:i}])}class S{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new S(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=C.create(e.facet(M).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new S(i)}}g.state=r.sU.define({create:S.init,update(e,t){for(let e of t.effects)if(e.is(g.setState))return e.value;return t.startState.facet(M)!=t.state.facet(M)?S.init(t.state):e.apply(t)}});let x=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};"undefined"!=typeof requestIdleCallback&&(x=e=>{let t=-1,i=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(i):cancelIdleCallback(t)});const E="undefined"!=typeof navigator&&(null===(n=navigator.scheduling)||void 0===n?void 0:n.isInputPending)?()=>navigator.scheduling.isInputPending():null,A=o.Z9.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(g.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(g.state);t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=x(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:i,viewport:{to:n}}=this.view,s=i.field(g.state);if(s.tree==s.context.tree&&s.context.isDone(n+1e5))return;let r=Date.now()+Math.min(this.chunkBudget,100,e&&!E?Math.max(25,e.timeRemaining()-5):1e9),o=s.context.treeLen<n&&i.doc.length>n+1e3,a=s.context.work(()=>E&&E()||Date.now()>r,n+(o?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:g.setState.of(new S(s.context))})),this.chunkBudget>0&&(!a||o)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>(0,o.c_)(this.view.state,e)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),M=r.sj.define({combine:e=>e.length?e[0]:null,enables:e=>[g.state,A,o.Lz.contentAttributes.compute([e],t=>{let i=t.facet(e);return i&&i.name?{"data-language":i.name}:{}})]});class T{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}class D{constructor(e,t,i,n,s,r=void 0){this.name=e,this.alias=t,this.extensions=i,this.filename=n,this.loadFunc=s,this.support=r,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:t,support:i}=e;if(!t){if(!i)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(i)}return new D(e.name,(e.alias||[]).concat(e.name).map(e=>e.toLowerCase()),e.extensions||[],e.filename,t,i)}static matchFilename(e,t){for(let i of e)if(i.filename&&i.filename.test(t))return i;let i=/\.([^.]+)$/.exec(t);if(i)for(let t of e)if(t.extensions.indexOf(i[1])>-1)return t;return null}static matchLanguageName(e,t,i=!0){t=t.toLowerCase();for(let i of e)if(i.alias.some(e=>e==t))return i;if(i)for(let i of e)for(let e of i.alias){let n=t.indexOf(e);if(n>-1&&(e.length>2||!/\w/.test(t[n-1])&&!/\w/.test(t[n+e.length])))return i}return null}}const I=r.sj.define(),R=r.sj.define({combine:e=>{if(!e.length)return"  ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function k(e){let t=e.facet(R);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function P(e,t){let i="",n=e.tabSize,s=e.facet(R)[0];if("\t"==s){for(;t>=n;)i+="\t",t-=n;s=" "}for(let e=0;e<t;e++)i+=s;return i}function _(e,t){e instanceof r.$t&&(e=new L(e));for(let i of e.state.facet(I)){let n=i(e,t);if(void 0!==n)return n}let i=y(e.state);return i.length>=t?function(e,t,i){let n=t.resolveStack(i),s=t.resolveInner(i,-1).resolve(i,0).enterUnfinishedNodesBefore(i);if(s!=n.node){let e=[];for(let t=s;t&&!(t.from<n.node.from||t.to>n.node.to||t.from==n.node.from&&t.type==n.node.type);t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)n={node:e[t],next:n}}return O(n,e,i)}(e,i,t):null}class L{constructor(e,t={}){this.state=e,this.options=t,this.unit=k(e)}lineAt(e,t=1){let i=this.state.doc.lineAt(e),{simulateBreak:n,simulateDoubleBreak:s}=this.options;return null!=n&&n>=i.from&&n<=i.to?s&&n==e?{text:"",from:e}:(t<0?n<e:n<=e)?{text:i.text.slice(n-i.from),from:n}:{text:i.text.slice(0,n-i.from),from:i.from}:i}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:i,from:n}=this.lineAt(e,t);return i.slice(e-n,Math.min(i.length,e+100-n))}column(e,t=1){let{text:i,from:n}=this.lineAt(e,t),s=this.countColumn(i,e-n),r=this.options.overrideIndentation?this.options.overrideIndentation(n):-1;return r>-1&&(s+=r-this.countColumn(i,i.search(/\S|$/))),s}countColumn(e,t=e.length){return(0,r.y$)(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:n}=this.lineAt(e,t),s=this.options.overrideIndentation;if(s){let e=s(n);if(e>-1)return e}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const N=new s.uY;function O(e,t,i){for(let n=e;n;n=n.next){let e=F(n.node);if(e)return e(B.create(t,i,n))}return 0}function F(e){let t=e.type.prop(N);if(t)return t;let i,n=e.firstChild;if(n&&(i=n.type.prop(s.uY.closedBy))){let t=e.lastChild,n=t&&i.indexOf(t.name)>-1;return e=>U(e,!0,1,void 0,n&&!function(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}(e)?t.from:void 0)}return null==e.parent?G:null}function G(){return 0}class B extends L{constructor(e,t,i){super(e.state,e.options),this.base=e,this.pos=t,this.context=i}get node(){return this.context.node}static create(e,t,i){return new B(e,t,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let i=e.resolve(t.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(V(i,e))break;t=this.state.doc.lineAt(i.from)}return this.lineIndent(t.from)}continue(){return O(this.context.next,this.base,this.pos)}}function V(e,t){for(let i=t;i;i=i.parent)if(e==i)return!0;return!1}function H({closing:e,align:t=!0,units:i=1}){return n=>U(n,t,i,e)}function U(e,t,i,n,s){let r=e.textAfter,o=r.match(/^\s*/)[0].length,a=n&&r.slice(o,o+n.length)==n||s==e.pos+o,l=t?function(e){let t=e.node,i=t.childAfter(t.from),n=t.lastChild;if(!i)return null;let s=e.options.simulateBreak,r=e.state.doc.lineAt(i.from),o=null==s||s<=r.from?r.to:Math.min(r.to,s);for(let e=i.to;;){let s=t.childAfter(e);if(!s||s==n)return null;if(!s.type.isSkipped){if(s.from>=o)return null;let e=/^ */.exec(r.text.slice(i.to-r.from))[0].length;return{from:i.from,to:i.to+e}}e=s.to}}(e):null;return l?a?e.column(l.from):e.column(l.to):e.baseIndent+(a?0:e.unit*i)}const z=e=>e.baseIndent;function W({except:e,units:t=1}={}){return i=>{let n=e&&e.test(i.textAfter);return i.baseIndent+(n?0:t*i.unit)}}function j(){return r.$t.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let i=e.newDoc,{head:n}=e.newSelection.main,s=i.lineAt(n);if(n>s.from+200)return e;let r=i.sliceString(s.from,n);if(!t.some(e=>e.test(r)))return e;let{state:o}=e,a=-1,l=[];for(let{head:e}of o.selection.ranges){let t=o.doc.lineAt(e);if(t.from==a)continue;a=t.from;let i=_(o,t.from);if(null==i)continue;let n=/^\s*/.exec(t.text)[0],s=P(o,i);n!=s&&l.push({from:t.from,to:t.from+n.length,insert:s})}return l.length?[e,{changes:l,sequential:!0}]:e})}const $=r.sj.define(),K=new s.uY;function Y(e){let t=e.firstChild,i=e.lastChild;return t&&t.to<i.from?{from:t.to,to:i.type.isError?e.to:i.from}:null}function q(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function X(e,t,i){for(let n of e.facet($)){let s=n(e,t,i);if(s)return s}return function(e,t,i){let n=y(e);if(n.length<i)return null;let s=null;for(let r=n.resolveStack(i,1);r;r=r.next){let o=r.node;if(o.to<=i||o.from>i)continue;if(s&&o.from<t)break;let a=o.type.prop(K);if(a&&(o.to<n.length-50||n.length==e.doc.length||!q(o))){let n=a(o,e);n&&n.from<=i&&n.from>=t&&n.to>i&&(s=n)}}return s}(e,t,i)}function Z(e,t){let i=t.mapPos(e.from,1),n=t.mapPos(e.to,-1);return i>=n?void 0:{from:i,to:n}}const Q=r.Pe.define({map:Z}),J=r.Pe.define({map:Z});function ee(e){let t=[];for(let{head:i}of e.state.selection.ranges)t.some(e=>e.from<=i&&e.to>=i)||t.push(e.lineBlockAt(i));return t}const te=r.sU.define({create:()=>o.NZ.none,update(e,t){t.isUserEvent("delete")&&t.changes.iterChangedRanges((t,i)=>e=ie(e,t,i)),e=e.map(t.changes);let i=[];for(let n of t.effects)n.is(Q)&&!se(e,n.value.from,n.value.to)?i.push(n.value):n.is(J)&&(e=e.update({filter:(e,t)=>n.value.from!=e||n.value.to!=t,filterFrom:n.value.from,filterTo:n.value.to}));if(i.length){let{preparePlaceholder:n}=t.state.facet(ce),s=i.map(e=>(n?o.NZ.replace({widget:new pe(n(t.state,e))}):de).range(e.from,e.to));e=e.update({add:s})}return t.selection&&(e=ie(e,t.selection.main.head)),e},provide:e=>o.Lz.decorations.from(e),toJSON(e,t){let i=[];return e.between(0,t.doc.length,(e,t)=>{i.push(e,t)}),i},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw new RangeError("Invalid JSON for fold state");let t=[];for(let i=0;i<e.length;){let n=e[i++],s=e[i++];if("number"!=typeof n||"number"!=typeof s)throw new RangeError("Invalid JSON for fold state");t.push(de.range(n,s))}return o.NZ.set(t,!0)}});function ie(e,t,i=t){let n=!1;return e.between(t,i,(e,s)=>{e<i&&s>t&&(n=!0)}),n?e.update({filterFrom:t,filterTo:i,filter:(e,n)=>e>=i||n<=t}):e}function ne(e,t,i){var n;let s=null;return null===(n=e.field(te,!1))||void 0===n||n.between(t,i,(e,t)=>{(!s||s.from>e)&&(s={from:e,to:t})}),s}function se(e,t,i){let n=!1;return e.between(t,t,(e,s)=>{e==t&&s==i&&(n=!0)}),n}function re(e,t){return e.field(te,!1)?t:t.concat(r.Pe.appendConfig.of(he()))}function oe(e,t,i=!0){let n=e.state.doc.lineAt(t.from).number,s=e.state.doc.lineAt(t.to).number;return o.Lz.announce.of(`${e.state.phrase(i?"Folded lines":"Unfolded lines")} ${n} ${e.state.phrase("to")} ${s}.`)}const ae=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:e=>{for(let t of ee(e)){let i=X(e.state,t.from,t.to);if(i)return e.dispatch({effects:re(e.state,[Q.of(i),oe(e,i)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:e=>{if(!e.state.field(te,!1))return!1;let t=[];for(let i of ee(e)){let n=ne(e.state,i.from,i.to);n&&t.push(J.of(n),oe(e,n,!1))}return t.length&&e.dispatch({effects:t}),t.length>0}},{key:"Ctrl-Alt-[",run:e=>{let{state:t}=e,i=[];for(let n=0;n<t.doc.length;){let s=e.lineBlockAt(n),r=X(t,s.from,s.to);r&&i.push(Q.of(r)),n=(r?e.lineBlockAt(r.to):s).to+1}return i.length&&e.dispatch({effects:re(e.state,i)}),!!i.length}},{key:"Ctrl-Alt-]",run:e=>{let t=e.state.field(te,!1);if(!t||!t.size)return!1;let i=[];return t.between(0,e.state.doc.length,(e,t)=>{i.push(J.of({from:e,to:t}))}),e.dispatch({effects:i}),!0}}],le={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},ce=r.sj.define({combine:e=>(0,r.QR)(e,le)});function he(e){let t=[te,ye];return e&&t.push(ce.of(e)),t}function ue(e,t){let{state:i}=e,n=i.facet(ce),s=t=>{let i=e.lineBlockAt(e.posAtDOM(t.target)),n=ne(e.state,i.from,i.to);n&&e.dispatch({effects:J.of(n)}),t.preventDefault()};if(n.placeholderDOM)return n.placeholderDOM(e,s,t);let r=document.createElement("span");return r.textContent=n.placeholderText,r.setAttribute("aria-label",i.phrase("folded code")),r.title=i.phrase("unfold"),r.className="cm-foldPlaceholder",r.onclick=s,r}const de=o.NZ.replace({widget:new class extends o.xO{toDOM(e){return ue(e,null)}}});class pe extends o.xO{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return ue(e,this.value)}}const ge={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class fe extends o.wJ{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function me(e={}){let t={...ge,...e},i=new fe(t,!0),n=new fe(t,!1),s=o.Z9.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(e){(e.docChanged||e.viewportChanged||e.startState.facet(M)!=e.state.facet(M)||e.startState.field(te,!1)!=e.state.field(te,!1)||y(e.startState)!=y(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new r.vB;for(let s of e.viewportLineBlocks){let r=ne(e.state,s.from,s.to)?n:X(e.state,s.from,s.to)?i:null;r&&t.add(s.from,s.from,r)}return t.finish()}}),{domEventHandlers:a}=t;return[s,(0,o.cU)({class:"cm-foldGutter",markers(e){var t;return(null===(t=e.plugin(s))||void 0===t?void 0:t.markers)||r.om.empty},initialSpacer:()=>new fe(t,!1),domEventHandlers:{...a,click:(e,t,i)=>{if(a.click&&a.click(e,t,i))return!0;let n=ne(e.state,t.from,t.to);if(n)return e.dispatch({effects:J.of(n)}),!0;let s=X(e.state,t.from,t.to);return!!s&&(e.dispatch({effects:Q.of(s)}),!0)}}}),he()]}const ye=o.Lz.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class ve{constructor(e,t){let i;function n(e){let t=l.G.newName();return(i||(i=Object.create(null)))["."+t]=e,t}this.specs=e;const s="string"==typeof t.all?t.all:t.all?n(t.all):void 0,r=t.scope;this.scope=r instanceof g?e=>e.prop(u)==r.data:r?e=>e==r:void 0,this.style=(0,a.az)(e.map(e=>({tag:e.tag,class:e.class||n(Object.assign({},e,{tag:null}))})),{all:s}).style,this.module=i?new l.G(i):null,this.themeType=t.themeType}static define(e,t){return new ve(e,t||{})}}const be=r.sj.define(),Ce=r.sj.define({combine:e=>e.length?[e[0]]:null});function we(e){let t=e.facet(be);return t.length?t:e.facet(Ce)}function Se(e,t){let i,n=[Ae];return e instanceof ve&&(e.module&&n.push(o.Lz.styleModule.of(e.module)),i=e.themeType),(null==t?void 0:t.fallback)?n.push(Ce.of(e)):i?n.push(be.computeN([o.Lz.darkTheme],t=>t.facet(o.Lz.darkTheme)==("dark"==i)?[e]:[])):n.push(be.of(e)),n}function xe(e,t,i){let n=we(e),s=null;if(n)for(let e of n)if(!e.scope||i&&e.scope(i)){let i=e.style(t);i&&(s=s?s+" "+i:i)}return s}class Ee{constructor(e){this.markCache=Object.create(null),this.tree=y(e.state),this.decorations=this.buildDeco(e,we(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=y(e.state),i=we(e.state),n=i!=we(e.startState),{viewport:s}=e.view,r=e.changes.mapPos(this.decoratedTo,1);t.length<s.to&&!n&&t.type==this.tree.type&&r>=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=r):(t!=this.tree||e.viewportChanged||n)&&(this.tree=t,this.decorations=this.buildDeco(e.view,i),this.decoratedTo=s.to)}buildDeco(e,t){if(!t||!this.tree.length)return o.NZ.none;let i=new r.vB;for(let{from:n,to:s}of e.visibleRanges)(0,a.DM)(this.tree,t,(e,t,n)=>{i.add(e,t,this.markCache[n]||(this.markCache[n]=o.NZ.mark({class:n})))},n,s);return i.finish()}}const Ae=r.Nb.high(o.Z9.fromClass(Ee,{decorations:e=>e.decorations})),Me=ve.define([{tag:a._A.meta,color:"#404740"},{tag:a._A.link,textDecoration:"underline"},{tag:a._A.heading,textDecoration:"underline",fontWeight:"bold"},{tag:a._A.emphasis,fontStyle:"italic"},{tag:a._A.strong,fontWeight:"bold"},{tag:a._A.strikethrough,textDecoration:"line-through"},{tag:a._A.keyword,color:"#708"},{tag:[a._A.atom,a._A.bool,a._A.url,a._A.contentSeparator,a._A.labelName],color:"#219"},{tag:[a._A.literal,a._A.inserted],color:"#164"},{tag:[a._A.string,a._A.deleted],color:"#a11"},{tag:[a._A.regexp,a._A.escape,a._A.special(a._A.string)],color:"#e40"},{tag:a._A.definition(a._A.variableName),color:"#00f"},{tag:a._A.local(a._A.variableName),color:"#30a"},{tag:[a._A.typeName,a._A.namespace],color:"#085"},{tag:a._A.className,color:"#167"},{tag:[a._A.special(a._A.variableName),a._A.macroName],color:"#256"},{tag:a._A.definition(a._A.propertyName),color:"#00c"},{tag:a._A.comment,color:"#940"},{tag:a._A.invalid,color:"#f00"}]),Te=o.Lz.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),De="()[]{}",Ie=r.sj.define({combine:e=>(0,r.QR)(e,{afterCursor:!0,brackets:De,maxScanDistance:1e4,renderMatch:Pe})}),Re=o.NZ.mark({class:"cm-matchingBracket"}),ke=o.NZ.mark({class:"cm-nonmatchingBracket"});function Pe(e){let t=[],i=e.matched?Re:ke;return t.push(i.range(e.start.from,e.start.to)),e.end&&t.push(i.range(e.end.from,e.end.to)),t}function _e(e){let t=[],i=e.facet(Ie);for(let n of e.selection.ranges){if(!n.empty)continue;let s=Be(e,n.head,-1,i)||n.head>0&&Be(e,n.head-1,1,i)||i.afterCursor&&(Be(e,n.head,1,i)||n.head<e.doc.length&&Be(e,n.head+1,-1,i));s&&(t=t.concat(i.renderMatch(s,e)))}return o.NZ.set(t,!0)}const Le=[o.Z9.fromClass(class{constructor(e){this.paused=!1,this.decorations=_e(e.state)}update(e){(e.docChanged||e.selectionSet||this.paused)&&(e.view.composing?(this.decorations=this.decorations.map(e.changes),this.paused=!0):(this.decorations=_e(e.state),this.paused=!1))}},{decorations:e=>e.decorations}),Te];function Ne(e={}){return[Ie.of(e),Le]}const Oe=new s.uY;function Fe(e,t,i){let n=e.prop(t<0?s.uY.openedBy:s.uY.closedBy);if(n)return n;if(1==e.name.length){let n=i.indexOf(e.name);if(n>-1&&n%2==(t<0?1:0))return[i[n+t]]}return null}function Ge(e){let t=e.type.prop(Oe);return t?t(e.node):e}function Be(e,t,i,n={}){let s=n.maxScanDistance||1e4,r=n.brackets||De,o=y(e),a=o.resolveInner(t,i);for(let e=a;e;e=e.parent){let n=Fe(e.type,i,r);if(n&&e.from<e.to){let s=Ge(e);if(s&&(i>0?t>=s.from&&t<s.to:t>s.from&&t<=s.to))return Ve(0,0,i,e,s,n,r)}}return function(e,t,i,n,s,r,o){if(i<0?!t:t==e.doc.length)return null;let a=i<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),l=o.indexOf(a);if(l<0||l%2==0!=i>0)return null;let c={from:i<0?t-1:t,to:i>0?t+1:t},h=e.doc.iterRange(t,i>0?e.doc.length:0),u=0;for(let e=0;!h.next().done&&e<=r;){let r=h.value;i<0&&(e+=r.length);let a=t+e*i;for(let e=i>0?0:r.length-1,t=i>0?r.length:-1;e!=t;e+=i){let t=o.indexOf(r[e]);if(!(t<0||n.resolveInner(a+e,1).type!=s))if(t%2==0==i>0)u++;else{if(1==u)return{start:c,end:{from:a+e,to:a+e+1},matched:t>>1==l>>1};u--}}i>0&&(e+=r.length)}return h.done?{start:c,matched:!1}:null}(e,t,i,o,a.type,s,r)}function Ve(e,t,i,n,s,r,o){let a=n.parent,l={from:s.from,to:s.to},c=0,h=null==a?void 0:a.cursor();if(h&&(i<0?h.childBefore(n.from):h.childAfter(n.to)))do{if(i<0?h.to<=n.from:h.from>=n.to){if(0==c&&r.indexOf(h.type.name)>-1&&h.from<h.to){let e=Ge(h);return{start:l,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}if(Fe(h.type,i,o))c++;else if(Fe(h.type,-i,o)){if(0==c){let e=Ge(h);return{start:l,end:e&&e.from<e.to?{from:e.from,to:e.to}:void 0,matched:!1}}c--}}}while(i<0?h.prevSibling():h.nextSibling());return{start:l,matched:!1}}function He(e){if("object"!=typeof e)return e;let t={};for(let i in e){let n=e[i];t[i]=n instanceof Array?n.slice():n}return t}const Ue=new WeakMap;class ze extends g{constructor(e){let t,i=d(e.languageData),n={name:(r=e).name||"",token:r.token,blankLine:r.blankLine||(()=>{}),startState:r.startState||(()=>!0),copyState:r.copyState||He,indent:r.indent||(()=>null),languageData:r.languageData||{},tokenTable:r.tokenTable||Ye,mergeTokens:!1!==r.mergeTokens};var r;super(i,new class extends s.iX{createParse(e,i,n){return new $e(t,e,i,n)}},[],e.name),this.topNode=function(e,t){let i=s.Z6.define({id:qe.length,name:"Document",props:[u.add(()=>e),N.add(()=>e=>t.getIndent(e))],top:!0});return qe.push(i),i}(i,this),t=this,this.streamParser=n,this.stateAfter=new s.uY({perNode:!0}),this.tokenTable=e.tokenTable?new et(n.tokenTable):tt}static define(e){return new ze(e)}getIndent(e){let t,{overrideIndentation:i}=e.options;i&&(t=Ue.get(e.state),null!=t&&t<e.pos-1e4&&(t=void 0));let n,s,r=We(this,e.node.tree,e.node.from,e.node.from,null!=t?t:e.pos);if(r?(s=r.state,n=r.pos+1):(s=this.streamParser.startState(e.unit),n=e.node.from),e.pos-n>1e4)return null;for(;n<e.pos;){let t=e.state.doc.lineAt(n),r=Math.min(e.pos,t.to);if(t.length){let n=i?i(t.from):-1,o=new h(t.text,e.state.tabSize,e.unit,n<0?void 0:n);for(;o.pos<r-t.from;)Ke(this.streamParser.token,o,s)}else this.streamParser.blankLine(s,e.unit);if(r==e.pos)break;n=t.to+1}let o=e.lineAt(e.pos);return i&&null==t&&Ue.set(e.state,o.from),this.streamParser.indent(s,/^\s*(.*)/.exec(o.text)[1],e)}get allowsNesting(){return!1}}function We(e,t,i,n,r){let o=i>=n&&i+t.length<=r&&t.prop(e.stateAfter);if(o)return{state:e.streamParser.copyState(o),pos:i+t.length};for(let o=t.children.length-1;o>=0;o--){let a=t.children[o],l=i+t.positions[o],c=a instanceof s.PH&&l<r&&We(e,a,l,n,r);if(c)return c}return null}function je(e,t,i,n,r){if(r&&i<=0&&n>=t.length)return t;r||0!=i||t.type!=e.topNode||(r=!0);for(let o=t.children.length-1;o>=0;o--){let a,l=t.positions[o],c=t.children[o];if(l<n&&c instanceof s.PH){if(!(a=je(e,c,i-l,n-l,r)))break;return r?new s.PH(t.type,t.children.slice(0,o).concat(a),t.positions.slice(0,o+1),l+a.length):a}}return null}class $e{constructor(e,t,i,n){this.lang=e,this.input=t,this.fragments=i,this.ranges=n,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=n[n.length-1].to;let r=C.get(),o=n[0].from,{state:a,tree:l}=function(e,t,i,n,r){for(let s of t){let t,r=s.from+(s.openStart?25:0),o=s.to-(s.openEnd?25:0),a=r<=i&&o>i&&We(e,s.tree,0-s.offset,i,o);if(a&&a.pos<=n&&(t=je(e,s.tree,i+s.offset,a.pos+s.offset,!1)))return{state:a.state,tree:t}}return{state:e.streamParser.startState(r?k(r):4),tree:s.PH.empty}}(e,i,o,this.to,null==r?void 0:r.state);this.state=a,this.parsedPos=this.chunkStart=o+l.length;for(let e=0;e<l.children.length;e++)this.chunks.push(l.children[e]),this.chunkPos.push(l.positions[e]);r&&this.parsedPos<r.viewport.from-1e5&&n.some(e=>e.from<=r.viewport.from&&e.to>=r.viewport.from)&&(this.state=this.lang.streamParser.startState(k(r.state)),r.skipUntilInView(this.parsedPos,r.viewport.from),this.parsedPos=r.viewport.from),this.moveRangeIndex()}advance(){let e=C.get(),t=null==this.stoppedAt?this.to:Math.min(this.to,this.stoppedAt),i=Math.min(t,this.chunkStart+512);for(e&&(i=Math.min(i,e.viewport.to));this.parsedPos<i;)this.parseLine(e);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)"\n"==t&&(t="");else{let e=t.indexOf("\n");e>-1&&(t=t.slice(0,e))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),i=e+t.length;for(let e=this.rangeIndex;;){let n=this.ranges[e].to;if(n>=i)break;if(t=t.slice(0,n-(i-t.length)),e++,e==this.ranges.length)break;let s=this.ranges[e].from,r=this.lineAfter(s);t+=r,i=s+r.length}return{line:t,end:i}}skipGapsTo(e,t,i){for(;;){let n=this.ranges[this.rangeIndex].to,s=e+t;if(i>0?n>s:n>=s)break;t+=this.ranges[++this.rangeIndex].from-n}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,t,i,n){let s=4;if(this.ranges.length>1){t+=n=this.skipGapsTo(t,n,1);let e=this.chunk.length;i+=n=this.skipGapsTo(i,n,-1),s+=this.chunk.length-e}let r=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&4==s&&r>=0&&this.chunk[r]==e&&this.chunk[r+2]==t?this.chunk[r+2]=i:this.chunk.push(e,t,i,s),n}parseLine(e){let{line:t,end:i}=this.nextLine(),n=0,{streamParser:s}=this.lang,r=new h(t,e?e.state.tabSize:4,e?k(e.state):2);if(r.eol())s.blankLine(this.state,r.indentUnit);else for(;!r.eol();){let e=Ke(s.token,r,this.state);if(e&&(n=this.emitToken(this.lang.tokenTable.resolve(e),this.parsedPos+r.start,this.parsedPos+r.pos,n)),r.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=s.PH.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:Xe,topID:0,maxBufferLength:512,reused:this.chunkReused});e=new s.PH(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new s.PH(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function Ke(e,t,i){t.start=t.pos;for(let n=0;n<10;n++){let n=e(t,i);if(t.pos>t.start)return n}throw new Error("Stream parser failed to advance stream.")}const Ye=Object.create(null),qe=[s.Z6.none],Xe=new s.fI(qe),Ze=[],Qe=Object.create(null),Je=Object.create(null);for(let[e,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Je[e]=nt(Ye,t);class et{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),Je)}resolve(e){return e?this.table[e]||(this.table[e]=nt(this.extra,e)):0}}const tt=new et(Ye);function it(e,t){Ze.indexOf(e)>-1||(Ze.push(e),console.warn(t))}function nt(e,t){let i=[];for(let n of t.split(" ")){let t=[];for(let i of n.split(".")){let n=e[i]||a._A[i];n?"function"==typeof n?t.length?t=t.map(n):it(i,`Modifier ${i} used at start of tag`):t.length?it(i,`Tag ${i} used as modifier`):t=Array.isArray(n)?n:[n]:it(i,`Unknown highlighting tag ${i}`)}for(let e of t)i.push(e)}if(!i.length)return 0;let n=t.replace(/ /g,"_"),r=n+" "+i.map(e=>e.id),o=Qe[r];if(o)return o.id;let l=Qe[r]=s.Z6.define({id:qe.length,name:n,props:[(0,a.pn)({[n]:i})]});return qe.push(l),l.id}o.OP.RTL,o.OP.LTR},99873(e,t,i){"use strict";i.d(t,{SV:()=>ye});var n=i(51104),s=i(1993),r=i(14991);i(62388),i(60214);class o{constructor(e,t,i,n){this.fromA=e,this.toA=t,this.fromB=i,this.toB=n}offset(e,t=e){return new o(this.fromA+e,this.toA+e,this.fromB+t,this.toB+t)}}function a(e,t,i,n,s,r){if(e==n)return[];let h=m(e,t,i,n,s,r),u=y(e,t+h,i,n,s+h,r),f=(i-=u)-(t+=h),v=(r-=u)-(s+=h);if(!f||!v)return[new o(t,i,s,r)];if(f>v){let a=e.slice(t,i).indexOf(n.slice(s,r));if(a>-1)return[new o(t,t+a,s,s),new o(t+a+v,i,r,r)]}else if(v>f){let a=n.slice(s,r).indexOf(e.slice(t,i));if(a>-1)return[new o(t,t,s,s+a),new o(i,i,s+a+f,r)]}if(1==f||1==v)return[new o(t,i,s,r)];let w=b(e,t,i,n,s,r);if(w){let[o,l,c]=w;return a(e,t,o,n,s,l).concat(a(e,o+c,i,n,l+c,r))}return function(e,t,i,n,s,r){let a=i-t,h=r-s;if(l<1e9&&Math.min(a,h)>16*l||c>0&&Date.now()>c)return Math.min(a,h)>64*l?[new o(t,i,s,r)]:C(e,t,i,n,s,r);let u=Math.ceil((a+h)/2);d.reset(u),p.reset(u);let f=(i,r)=>e.charCodeAt(t+i)==n.charCodeAt(s+r),m=(t,s)=>e.charCodeAt(i-t-1)==n.charCodeAt(r-s-1),y=(a-h)%2!=0?p:null,v=y?null:d;for(let o=0;o<u;o++){if(o>l||c>0&&!(63&o)&&Date.now()>c)return C(e,t,i,n,s,r);let b=d.advance(o,a,h,u,y,!1,f)||p.advance(o,a,h,u,v,!0,m);if(b)return g(e,t,i,t+b[0],n,s,r,s+b[1])}return[new o(t,i,s,r)]}(e,t,i,n,s,r)}let l=1e9,c=0,h=!1;class u{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let e=0;e<this.len;e++)this.vec[e]=-1;this.vec[e+1]=0,this.start=this.end=0}advance(e,t,i,n,s,r,o){for(let a=-e+this.start;a<=e-this.end;a+=2){let l=n+a,c=a==-e||a!=e&&this.vec[l-1]<this.vec[l+1]?this.vec[l+1]:this.vec[l-1]+1,h=c-a;for(;c<t&&h<i&&o(c,h);)c++,h++;if(this.vec[l]=c,c>t)this.end+=2;else if(h>i)this.start+=2;else if(s){let e=n+(t-i)-a;if(e>=0&&e<this.len&&-1!=s.vec[e])if(r){let i=s.vec[e];if(i>=t-c)return[i,n+i-e]}else if(c>=t-s.vec[e])return[c,h]}}return null}}const d=new u,p=new u;function g(e,t,i,n,s,r,l,c){let h=!1;return P(e,n)||++n!=i||(h=!0),P(s,c)||++c!=l||(h=!0),h?[new o(t,i,r,l)]:a(e,t,n,s,r,c).concat(a(e,n,i,s,c,l))}function f(e,t){let i=1,n=Math.min(e,t);for(;i<n;)i<<=1;return i}function m(e,t,i,n,s,r){if(t==i||t==r||e.charCodeAt(t)!=n.charCodeAt(s))return 0;let o=f(i-t,r-s);for(let a=t,l=s;;){let s=a+o,c=l+o;if(s>i||c>r||e.slice(a,s)!=n.slice(l,c)){if(1==o)return a-t-(P(e,a)?0:1);o>>=1}else{if(s==i||c==r)return s-t;a=s,l=c}}}function y(e,t,i,n,s,r){if(t==i||s==r||e.charCodeAt(i-1)!=n.charCodeAt(r-1))return 0;let o=f(i-t,r-s);for(let a=i,l=r;;){let r=a-o,c=l-o;if(r<t||c<s||e.slice(r,a)!=n.slice(c,l)){if(1==o)return i-a-(P(e,a)?0:1);o>>=1}else{if(r==t||c==s)return i-r;a=r,l=c}}}function v(e,t,i,n,s,r,o,a){let l=n.slice(s,r),c=null;for(;;){if(c||o<a)return c;for(let a=t+o;;){P(e,a)||a++;let h=a+o;if(P(e,h)||(h+=h==a+1?1:-1),h>=i)break;let u=e.slice(a,h),d=-1;for(;-1!=(d=l.indexOf(u,d+1));){let o=m(e,h,i,n,s+d+u.length,r),l=y(e,t,a,n,s,s+d),p=u.length+o+l;(!c||c[2]<p)&&(c=[a-l,s+d-l,p])}a=h}if(a<0)return c;o>>=1}}function b(e,t,i,n,s,r){let o=i-t,a=r-s;if(o<a){let o=b(n,s,r,e,t,i);return o&&[o[1],o[0],o[2]]}return o<4||2*a<o?null:v(e,t,i,n,s,r,Math.floor(o/4),-1)}function C(e,t,i,n,s,r){h=!0;let l,c=i-t,u=r-s;if(c<u){let o=v(n,s,r,e,t,i,Math.floor(c/6),50);l=o&&[o[1],o[0],o[2]]}else l=v(e,t,i,n,s,r,Math.floor(u/6),50);if(!l)return[new o(t,i,s,r)];let[d,p,g]=l;return a(e,t,d,n,s,p).concat(a(e,d+g,i,n,p+g,r))}function w(e,t){for(let i=1;i<e.length;i++){let n=e[i-1],s=e[i];n.toA>s.fromA-t&&n.toB>s.fromB-t&&(e[i-1]=new o(n.fromA,s.toA,n.fromB,s.toB),e.splice(i--,1))}}let S;try{S=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch(e){}function x(e){return e>48&&e<58||e>64&&e<91||e>96&&e<123}function E(e,t){if(t==e.length)return 0;let i=e.charCodeAt(t);return i<192?x(i)?1:0:S?R(i)&&t!=e.length-1?S.test(e.slice(t,t+2))?2:0:S.test(String.fromCharCode(i))?1:0:0}function A(e,t){if(!t)return 0;let i=e.charCodeAt(t-1);return i<192?x(i)?1:0:S?k(i)&&1!=t?S.test(e.slice(t-2,t))?2:0:S.test(String.fromCharCode(i))?1:0:0}function M(e,t,i){if(t==e.length||!A(e,t))return t;for(let n=t,s=t+i,r=0;r<8;r++){let t=E(e,n);if(!t||n+t>s)return n;n+=t}return t}function T(e,t,i){if(!t||!E(e,t))return t;for(let n=t,s=t-i,r=0;r<8;r++){let t=A(e,n);if(!t||n-t<s)return n;n-=t}return t}function D(e,t,i){for(;t!=i;t--)if(10==e.charCodeAt(t-1))return t;return-1}function I(e,t,i){for(;t!=i;t++)if(10==e.charCodeAt(t))return t;return-1}const R=e=>e>=55296&&e<=56319,k=e=>e>=56320&&e<=57343;function P(e,t){return!t||t==e.length||!R(e.charCodeAt(t-1))||!k(e.charCodeAt(t))}function _(){return!h}function L(e,t,i){return function(e,t,i){for(let n=0,s=0;s<e.length;s++){let r=e[s],a=r.toA-r.fromA,l=r.toB-r.fromB;if(a&&l||a>3||l>3){let c=s==e.length-1?t.length:e[s+1].fromA,h=r.fromA-n,u=c-r.toA,d=T(t,r.fromA,h),p=M(t,r.toA,u),g=r.fromA-d,f=p-r.toA;if((!a||!l)&&g&&f){let h=Math.max(a,l),[u,m,y]=a?[t,r.fromA,r.toA]:[i,r.fromB,r.toB];h>g&&t.slice(d,r.fromA)==u.slice(y-g,y)?(r=e[s]=new o(d,d+a,r.fromB-g,r.toB-g),d=r.fromA,p=M(t,r.toA,c-r.toA)):h>f&&t.slice(r.toA,p)==u.slice(m,m+f)&&(r=e[s]=new o(p-a,p,r.fromB+f,r.toB+f),p=r.toA,d=T(t,r.fromA,r.fromA-n)),g=r.fromA-d,f=p-r.toA}if(g||f)r=e[s]=new o(r.fromA-g,r.toA+f,r.fromB-g,r.toB+f);else if(a){if(!l){let i,n=I(t,r.fromA,r.toA),o=n<0?-1:D(t,r.toA,r.fromA);n>-1&&(i=n-r.fromA)<=u&&t.slice(r.fromA,n)==t.slice(r.toA,r.toA+i)?r=e[s]=r.offset(i):o>-1&&(i=r.toA-o)<=h&&t.slice(r.fromA-i,r.fromA)==t.slice(o,r.toA)&&(r=e[s]=r.offset(-i))}}else{let t,n=I(i,r.fromB,r.toB),o=n<0?-1:D(i,r.toB,r.fromB);n>-1&&(t=n-r.fromB)<=u&&i.slice(r.fromB,n)==i.slice(r.toB,r.toB+t)?r=e[s]=r.offset(t):o>-1&&(t=r.toB-o)<=h&&i.slice(r.fromB-t,r.fromB)==i.slice(o,r.toB)&&(r=e[s]=r.offset(-t))}}n=r.toA}return w(e,3),e}(function(e,t,i){var n;let s=null==i?void 0:i.override;return s?s(e,t):(l=(null!==(n=null==i?void 0:i.scanLimit)&&void 0!==n?n:1e9)>>1,c=(null==i?void 0:i.timeout)?Date.now()+i.timeout:0,h=!1,function(e,t,i){for(;;){w(i,1);let n=!1;for(let s=0;s<i.length;s++){let r,a,l=i[s];(r=m(e,l.fromA,l.toA,t,l.fromB,l.toB))&&(l=i[s]=new o(l.fromA+r,l.toA,l.fromB+r,l.toB)),(a=y(e,l.fromA,l.toA,t,l.fromB,l.toB))&&(l=i[s]=new o(l.fromA,l.toA-a,l.fromB,l.toB-a));let c=l.toA-l.fromA,h=l.toB-l.fromB;if(c&&h)continue;let u=l.fromA-(s?i[s-1].toA:0),d=(s<i.length-1?i[s+1].fromA:e.length)-l.toA;if(!u||!d)continue;let p=c?e.slice(l.fromA,l.toA):t.slice(l.fromB,l.toB);u<=p.length&&e.slice(l.fromA-u,l.fromA)==p.slice(p.length-u)?(i[s]=new o(l.fromA-u,l.toA-u,l.fromB-u,l.toB-u),n=!0):d<=p.length&&e.slice(l.toA,l.toA+d)==p.slice(0,d)&&(i[s]=new o(l.fromA+d,l.toA+d,l.fromB+d,l.toB+d),n=!0)}if(!n)break}return i}(e,t,a(e,0,e.length,t,0,t.length)))}(e,t,i),e,t)}const N=s.sj.define({combine:e=>e[0]}),O=s.Pe.define(),F=s.sj.define(),G=s.sU.define({create:e=>null,update(e,t){for(let i of t.effects)i.is(O)&&(e=i.value);for(let i of t.state.facet(F))e=i(e,t);return e}});class B{constructor(e,t,i,n,s,r=!0){this.changes=e,this.fromA=t,this.toA=i,this.fromB=n,this.toB=s,this.precise=r}offset(e,t){return e||t?new B(this.changes,this.fromA+e,this.toA+e,this.fromB+t,this.toB+t,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,t,i){return U(L(e.toString(),t.toString(),i),e,t,0,0,_())}static updateA(e,t,i,n,s){return $(j(e,n,!0,i.length),e,t,i,s)}static updateB(e,t,i,n,s){return $(j(e,n,!1,t.length),e,t,i,s)}}function V(e,t,i,n){let s=i.lineAt(e),r=n.lineAt(t);return s.to==e&&r.to==t&&e<i.length&&t<n.length?[e+1,t+1]:[s.from,r.from]}function H(e,t,i,n){let s=i.lineAt(e),r=n.lineAt(t);return s.from==e&&r.from==t?[e,t]:[s.to+1,r.to+1]}function U(e,t,i,n,s,r){let o=[];for(let a=0;a<e.length;a++){let l=e[a],[c,h]=V(l.fromA+n,l.fromB+s,t,i),[u,d]=H(l.toA+n,l.toB+s,t,i),p=[l.offset(-c+n,-h+s)];for(;a<e.length-1;){let r=e[a+1],[o,l]=V(r.fromA+n,r.fromB+s,t,i);if(o>u+1&&l>d+1)break;p.push(r.offset(-c+n,-h+s)),[u,d]=H(r.toA+n,r.toB+s,t,i),a++}o.push(new B(p,c,Math.max(c,u),h,Math.max(h,d),r))}return o}const z=1e3;function W(e,t,i,n){let s=0,r=e.length;for(;;){if(s==r){let n=0,r=0;s&&({toA:n,toB:r}=e[s-1]);let o=t-(i?n:r);return[n+o,r+o]}let o=s+r>>1,a=e[o],[l,c]=i?[a.fromA,a.toA]:[a.fromB,a.toB];if(l>t)r=o;else{if(!(c<=t))return n?[a.fromA,a.fromB]:[a.toA,a.toB];s=o+1}}}function j(e,t,i,n){let s=[];return t.iterChangedRanges((r,o,a,l)=>{let c=0,h=i?t.length:n,u=0,d=i?n:t.length;r>z&&([c,u]=W(e,r-z,i,!0)),o<t.length-z&&([h,d]=W(e,o+z,i,!1));let p,g=l-a-(o-r),[f,m]=i?[g,0]:[0,g];s.length&&(p=s[s.length-1]).toA>=c?s[s.length-1]={fromA:p.fromA,fromB:p.fromB,toA:h,toB:d,diffA:p.diffA+f,diffB:p.diffB+m}:s.push({fromA:c,toA:h,fromB:u,toB:d,diffA:f,diffB:m})}),s}function $(e,t,i,n,s){if(!e.length)return t;let r=[];for(let o=0,a=0,l=0,c=0;;o++){let h=o==e.length?null:e[o],u=h?h.fromA+a:i.length,d=h?h.fromB+l:n.length;for(;c<t.length;){let e=t[c];if(h&&(e.toA+a>u||e.toB+l>d))break;r.push(e.offset(a,l)),c++}if(!h)break;let p=h.toA+a+h.diffA,g=h.toB+l+h.diffB,f=L(i.sliceString(u,p),n.sliceString(d,g),s);for(let e of U(f,i,n,u,d,_()))r.push(e);for(a+=h.diffA,l+=h.diffB;c<t.length;){let e=t[c];if(e.fromA+a>p&&e.fromB+l>g)break;c++}}return r}const K={scanLimit:500},Y=n.Z9.fromClass(class{constructor(e){({deco:this.deco,gutter:this.gutter}=ie(e))}update(e){var t,i;(e.docChanged||e.viewportChanged||(t=e.startState,i=e.state,t.field(G,!1)!=i.field(G,!1))||function(e,t){return e.facet(N)!=t.facet(N)}(e.startState,e.state))&&({deco:this.deco,gutter:this.gutter}=ie(e.view))}},{decorations:e=>e.deco}),q=s.Nb.low((0,n.cU)({class:"cm-changeGutter",markers:e=>{var t;return(null===(t=e.plugin(Y))||void 0===t?void 0:t.gutter)||s.om.empty}})),X=n.NZ.line({class:"cm-changedLine"}),Z=n.NZ.mark({class:"cm-changedText"}),Q=n.NZ.mark({tagName:"ins",class:"cm-insertedLine"}),J=n.NZ.mark({tagName:"del",class:"cm-deletedLine"}),ee=new class extends n.wJ{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function te(e,t,i,n,s,r){let o=i?e.fromA:e.fromB,a=i?e.toA:e.toB,l=0;if(o!=a){s.add(o,o,X),s.add(o,a,i?J:Q),r&&r.add(o,o,ee);for(let c=t.iterRange(o,a-1),h=o;!c.next().done;){if(c.lineBreak){h++,s.add(h,h,X),r&&r.add(h,h,ee);continue}let t=h+c.value.length;if(n)for(;l<e.changes.length;){let n=e.changes[l],r=o+(i?n.fromA:n.fromB),a=o+(i?n.toA:n.toB),c=Math.max(h,r),u=Math.min(t,a);if(c<u&&s.add(c,u,Z),!(a<t))break;l++}h=t}}}function ie(e){let t=e.state.field(G),{side:i,highlightChanges:n,markGutter:r,overrideChunk:o}=e.state.facet(N),a="a"==i,l=new s.vB,c=r?new s.vB:null,{from:h,to:u}=e.viewport;for(let i of t){if((a?i.fromA:i.fromB)>=u)break;(a?i.toA:i.toB)>h&&(o&&o(e.state,i,l,c)||te(i,e.state.doc,a,n,l,c))}return{deco:l.finish(),gutter:c&&c.finish()}}class ne extends n.xO{constructor(e){super(),this.height=e}eq(e){return this.height==e.height}toDOM(){let e=document.createElement("div");return e.className="cm-mergeSpacer",e.style.height=this.height+"px",e}updateDOM(e){return e.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}const se=s.Pe.define({map:(e,t)=>e.map(t)}),re=s.sU.define({create:()=>n.NZ.none,update:(e,t)=>{for(let e of t.effects)if(e.is(se))return e.value;return e.map(t.changes)},provide:e=>n.Lz.decorations.from(e)}),oe=.01;function ae(e,t){if(e.size!=t.size)return!1;let i=e.iter(),n=t.iter();for(;i.value;){if(i.from!=n.from||Math.abs(i.value.spec.widget.height-n.value.spec.widget.height)>1)return!1;i.next(),n.next()}return!0}const le=s.Pe.define({map:(e,t)=>t.mapPos(e)});class ce extends n.xO{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let t=document.createElement("div");return t.className="cm-collapsedLines",t.textContent=e.state.phrase("$ unchanged lines",this.lines),t.addEventListener("click",t=>{let i=e.posAtDOM(t.target);e.dispatch({effects:le.of(i)});let{side:n,sibling:s}=e.state.facet(N);s&&s().dispatch({effects:le.of(he(i,e.state.field(G),"a"==n))})}),t}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function he(e,t,i){let n=0,s=0;for(let r=0;;r++){let o=r<t.length?t[r]:null;if(!o||(i?o.fromA:o.fromB)>=e)return s+(e-n);[n,s]=i?[o.toA,o.toB]:[o.toB,o.toA]}}const ue=s.sU.define({create:e=>n.NZ.none,update(e,t){e=e.map(t.changes);for(let i of t.effects)i.is(le)&&(e=e.update({filter:e=>e!=i.value}));if(e.size&&t.state.field(G)!=t.startState.field(G,!1)){let i="a"==t.state.facet(N).side,n=[];for(let s of t.state.field(G))e.between(i?s.fromA:s.fromB,i?s.toA:s.toB,e=>{n.push(e)});n.length&&(e=e.update({filter:e=>n.indexOf(e)<0}))}return e},provide:e=>n.Lz.decorations.from(e)});function de({margin:e=3,minSize:t=4}){return ue.init(i=>function(e,t,i){let r=new s.vB,o="a"==e.facet(N).side,a=e.field(G),l=1;for(let s=0;;s++){let c=s<a.length?a[s]:null,h=s?l+t:1,u=c?e.doc.lineAt(o?c.fromA:c.fromB).number-1-t:e.doc.lines,d=u-h+1;if(d>=i&&r.add(e.doc.line(h).from,e.doc.line(u).to,n.NZ.replace({widget:new ce(d),block:!0})),!c)break;l=e.doc.lineAt(Math.min(e.doc.length,o?c.toA:c.toB)).number}return r.finish()}(i,e,t))}const pe=n.Lz.styleModule.of(new r.G({".cm-mergeView":{overflowY:"auto"},".cm-mergeViewEditors":{display:"flex",alignItems:"stretch"},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:"hidden"},".cm-merge-revert":{width:"1.6em",flexGrow:0,flexShrink:0,position:"relative"},".cm-merge-revert button":{position:"absolute",display:"block",width:"100%",boxSizing:"border-box",textAlign:"center",background:"none",border:"none",font:"inherit",cursor:"pointer"}})),ge=n.Lz.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat"},"&.cm-merge-b .cm-deletedText":{background:"#ff000033"},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer","&:before":{content:'"⦚"',marginInlineEnd:"7px"},"&:after":{content:'"⦚"',marginInlineStart:"7px"}},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"},".cm-inlineChangedLineGutter":{background:"#75d"}}),fe=new s.xx,me=new s.xx;class ye{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||K;let t=[s.Nb.low(Y),ge,pe,re,n.Lz.updateListener.of(e=>{this.measuring<0&&(e.heightChanged||e.viewportChanged)&&!e.transactions.some(e=>e.effects.some(e=>e.is(se)))&&this.measure()})],i=[N.of({side:"a",sibling:()=>this.b,highlightChanges:!1!==e.highlightChanges,markGutter:!1!==e.gutter})];!1!==e.gutter&&i.push(q);let r=s.$t.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],n.Lz.editorAttributes.of({class:"cm-merge-a"}),me.of(i),t]}),o=[N.of({side:"b",sibling:()=>this.a,highlightChanges:!1!==e.highlightChanges,markGutter:!1!==e.gutter})];!1!==e.gutter&&o.push(q);let a=s.$t.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],n.Lz.editorAttributes.of({class:"cm-merge-b"}),me.of(o),t]});this.chunks=B.build(r.doc,a.doc,this.diffConf);let l=[G.init(()=>this.chunks),fe.of(e.collapseUnchanged?de(e.collapseUnchanged):[])];r=r.update({effects:s.Pe.appendConfig.of(l)}).state,a=a.update({effects:s.Pe.appendConfig.of(l)}).state,this.dom=document.createElement("div"),this.dom.className="cm-mergeView",this.editorDOM=this.dom.appendChild(document.createElement("div")),this.editorDOM.className="cm-mergeViewEditors";let c=e.orientation||"a-b",h=document.createElement("div");h.className="cm-mergeViewEditor";let u=document.createElement("div");u.className="cm-mergeViewEditor",this.editorDOM.appendChild("a-b"==c?h:u),this.editorDOM.appendChild("a-b"==c?u:h),this.a=new n.Lz({state:r,parent:h,root:e.root,dispatchTransactions:e=>this.dispatch(e,this.a)}),this.b=new n.Lz({state:a,parent:u,root:e.root,dispatchTransactions:e=>this.dispatch(e,this.b)}),this.setupRevertControls(!!e.revertControls,"b-to-a"==e.revertControls,e.renderRevertControl),e.parent&&e.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(e,t){if(e.some(e=>e.docChanged)){let i=e[e.length-1],n=e.reduce((e,t)=>e.compose(t.changes),s.VR.empty(e[0].startState.doc.length));this.chunks=t==this.a?B.updateA(this.chunks,i.newDoc,this.b.state.doc,n,this.diffConf):B.updateB(this.chunks,this.a.state.doc,i.newDoc,n,this.diffConf),t.update([...e,i.state.update({effects:O.of(this.chunks)})]);let r=t==this.a?this.b:this.a;r.update([r.state.update({effects:O.of(this.chunks)})]),this.scheduleMeasure()}else t.update(e)}reconfigure(e){if("diffConfig"in e&&(this.diffConf=e.diffConfig),"orientation"in e){let t="b-a"!=e.orientation;if(t!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let e=this.a.dom.parentNode,i=this.b.dom.parentNode;e.remove(),i.remove(),this.editorDOM.insertBefore(t?e:i,this.editorDOM.firstChild),this.editorDOM.appendChild(t?i:e),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in e||"renderRevertControl"in e){let t=!!this.revertDOM,i=this.revertToA,n=this.renderRevert;"revertControls"in e&&(t=!!e.revertControls,i="b-to-a"==e.revertControls),"renderRevertControl"in e&&(n=e.renderRevertControl),this.setupRevertControls(t,i,n)}let t="highlightChanges"in e,i="gutter"in e,n="collapseUnchanged"in e;if(t||i||n){let s=[],r=[];if(t||i){let n=this.a.state.facet(N),o=i?!1!==e.gutter:n.markGutter,a=t?!1!==e.highlightChanges:n.highlightChanges;s.push(me.reconfigure([N.of({side:"a",sibling:()=>this.b,highlightChanges:a,markGutter:o}),o?q:[]])),r.push(me.reconfigure([N.of({side:"b",sibling:()=>this.a,highlightChanges:a,markGutter:o}),o?q:[]]))}if(n){let t=fe.reconfigure(e.collapseUnchanged?de(e.collapseUnchanged):[]);s.push(t),r.push(t)}this.a.dispatch({effects:s}),this.b.dispatch({effects:r})}this.scheduleMeasure()}setupRevertControls(e,t,i){this.revertToA=t,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=i,!e&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):e&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement("div"),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener("mousedown",e=>this.revertClicked(e)),this.revertDOM.className="cm-merge-revert"):this.revertDOM&&(this.revertDOM.textContent="")}scheduleMeasure(){if(this.measuring<0){let e=this.dom.ownerDocument.defaultView||window;this.measuring=e.requestAnimationFrame(()=>{this.measuring=-1,this.measure()})}}measure(){!function(e,t,i){let r=new s.vB,o=new s.vB,a=e.state.field(re).iter(),l=t.state.field(re).iter(),c=0,h=0,u=0,d=0,p=e.viewport,g=t.viewport;for(let s=0;;s++){let f=s<i.length?i[s]:null,m=f?f.fromA:e.state.doc.length,y=f?f.fromB:t.state.doc.length;if(c<m){let i=e.lineBlockAt(c).top+u-(t.lineBlockAt(h).top+d);i<-.01?(u-=i,r.add(c,c,n.NZ.widget({widget:new ne(-i),block:!0,side:-1}))):i>oe&&(d+=i,o.add(h,h,n.NZ.widget({widget:new ne(i),block:!0,side:-1})))}if(m>c+1e3&&c<p.from&&m>p.from&&h<g.from&&y>g.from){let e=Math.min(p.from-c,g.from-h);c+=e,h+=e,s--}else{if(!f)break;c=f.toA,h=f.toB}for(;a.value&&a.from<c;)u-=a.value.spec.widget.height,a.next();for(;l.value&&l.from<h;)d-=l.value.spec.widget.height,l.next()}for(;a.value;)u-=a.value.spec.widget.height,a.next();for(;l.value;)d-=l.value.spec.widget.height,l.next();let f=e.contentHeight+u-(t.contentHeight+d);f<oe?r.add(e.state.doc.length,e.state.doc.length,n.NZ.widget({widget:new ne(-f),block:!0,side:1})):f>oe&&o.add(t.state.doc.length,t.state.doc.length,n.NZ.widget({widget:new ne(f),block:!0,side:1}));let m=r.finish(),y=o.finish();ae(m,e.state.field(re))||e.dispatch({effects:se.of(m)}),ae(y,t.state.field(re))||t.dispatch({effects:se.of(y)})}(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let e=this.revertDOM,t=e.firstChild,i=this.a.viewport,n=this.b.viewport;for(let s=0;s<this.chunks.length;s++){let r=this.chunks[s];if(r.fromA>i.to||r.fromB>n.to)break;if(r.fromA<i.from||r.fromB<n.from)continue;let o=this.a.lineBlockAt(r.fromA).top+"px";for(;t&&+t.dataset.chunk<s;)t=ve(t);t&&t.dataset.chunk==String(s)?(t.style.top!=o&&(t.style.top=o),t=t.nextSibling):e.insertBefore(this.renderRevertButton(o,s),t)}for(;t;)t=ve(t)}renderRevertButton(e,t){let i;if(this.renderRevert)i=this.renderRevert();else{i=document.createElement("button");let e=this.a.state.phrase("Revert this chunk");i.setAttribute("aria-label",e),i.setAttribute("title",e),i.textContent=this.revertToLeft?"⇜":"⇝"}return i.style.top=e,i.setAttribute("data-chunk",String(t)),i}revertClicked(e){let t,i=e.target;for(;i&&i.parentNode!=this.revertDOM;)i=i.parentNode;if(i&&(t=this.chunks[i.dataset.chunk])){let[i,n,s,r,o,a]=this.revertToA?[this.b,this.a,t.fromB,t.toB,t.fromA,t.toA]:[this.a,this.b,t.fromA,t.toA,t.fromB,t.toB],l=i.state.sliceDoc(s,Math.max(s,r-1));s!=r&&a<=n.state.doc.length&&(l+=i.state.lineBreak),n.dispatch({changes:{from:o,to:Math.min(n.state.doc.length,a),insert:l},userEvent:"revert"}),e.preventDefault()}}destroy(){this.a.destroy(),this.b.destroy(),this.measuring>-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}}function ve(e){let t=e.nextSibling;return e.remove(),t}n.xO,n.xO},1993(e,t,i){"use strict";i.d(t,{$t:()=>fe,EY:()=>s,FB:()=>ye,Fh:()=>y,Gu:()=>C,Je:()=>de,MK:()=>m,Nb:()=>H,OF:()=>I,Pe:()=>se,QR:()=>me,VR:()=>w,YH:()=>te,ZX:()=>re,iR:()=>b,kn:()=>Oe,om:()=>Se,sU:()=>B,sj:()=>P,vB:()=>Ee,vS:()=>f,xx:()=>z,y$:()=>Ne,zK:()=>g});var n=i(23877);class s{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){[e,t]=p(this,e,t);let n=[];return this.decompose(0,e,n,2),i.length&&i.decompose(0,i.length,n,3),this.decompose(t,this.length,n,1),o.from(n,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=p(this,e,t);let i=[];return this.decompose(e,t,i,0),o.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),n=new c(this),s=new c(e);for(let e=t,r=t;;){if(n.next(e),s.next(e),e=0,n.lineBreak!=s.lineBreak||n.done!=s.done||n.value!=s.value)return!1;if(r+=n.value.length,n.done||r>=i)return!0}}iter(e=1){return new c(this,e)}iterRange(e,t=this.length){return new h(this,e,t)}iterLines(e,t){let i;if(null==e)i=this.iter();else{null==t&&(t=this.lines+1);let n=this.line(e).from;i=this.iterRange(n,Math.max(n,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new u(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(0==e.length)throw new RangeError("A document must have at least one line");return 1!=e.length||e[0]?e.length<=32?new r(e):o.from(r.split(e,[])):s.empty}}class r extends s{constructor(e,t=function(e){let t=-1;for(let i of e)t+=i.length+1;return t}(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,n){for(let s=0;;s++){let r=this.text[s],o=n+r.length;if((t?i:o)>=e)return new d(n,o,i,r);n=o+1,i++}}decompose(e,t,i,n){let s=e<=0&&t>=this.length?this:new r(l(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(1&n){let e=i.pop(),t=a(s.text,e.text.slice(),0,s.length);if(t.length<=32)i.push(new r(t,e.length+s.length));else{let e=t.length>>1;i.push(new r(t.slice(0,e)),new r(t.slice(e)))}}else i.push(s)}replace(e,t,i){if(!(i instanceof r))return super.replace(e,t,i);[e,t]=p(this,e,t);let n=a(this.text,a(i.text,l(this.text,0,e)),t),s=this.length+i.length-(t-e);return n.length<=32?new r(n,s):o.from(r.split(n,[]),s)}sliceString(e,t=this.length,i="\n"){[e,t]=p(this,e,t);let n="";for(let s=0,r=0;s<=t&&r<this.text.length;r++){let o=this.text[r],a=s+o.length;s>e&&r&&(n+=i),e<a&&t>s&&(n+=o.slice(Math.max(0,e-s),t-s)),s=a+1}return n}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],n=-1;for(let s of e)i.push(s),n+=s.length+1,32==i.length&&(t.push(new r(i,n)),i=[],n=-1);return n>-1&&t.push(new r(i,n)),t}}class o extends s{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let t of e)this.lines+=t.lines}lineInner(e,t,i,n){for(let s=0;;s++){let r=this.children[s],o=n+r.length,a=i+r.lines-1;if((t?a:o)>=e)return r.lineInner(e,t,i,n);n=o+1,i=a+1}}decompose(e,t,i,n){for(let s=0,r=0;r<=t&&s<this.children.length;s++){let o=this.children[s],a=r+o.length;if(e<=a&&t>=r){let s=n&((r<=e?1:0)|(a>=t?2:0));r>=e&&a<=t&&!s?i.push(o):o.decompose(e-r,t-r,i,s)}r=a+1}}replace(e,t,i){if([e,t]=p(this,e,t),i.lines<this.lines)for(let n=0,s=0;n<this.children.length;n++){let r=this.children[n],a=s+r.length;if(e>=s&&t<=a){let l=r.replace(e-s,t-s,i),c=this.lines-r.lines+l.lines;if(l.lines<c>>4&&l.lines>c>>6){let s=this.children.slice();return s[n]=l,new o(s,this.length-(t-e)+i.length)}return super.replace(s,a,l)}s=a+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i="\n"){[e,t]=p(this,e,t);let n="";for(let s=0,r=0;s<this.children.length&&r<=t;s++){let o=this.children[s],a=r+o.length;r>e&&s&&(n+=i),e<a&&t>r&&(n+=o.sliceString(e-r,t-r,i)),r=a+1}return n}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof o))return 0;let i=0,[n,s,r,a]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;n+=t,s+=t){if(n==r||s==a)return i;let o=this.children[n],l=e.children[s];if(o!=l)return i+o.scanIdentical(l,t);i+=o.length+1}}static from(e,t=e.reduce((e,t)=>e+t.length+1,-1)){let i=0;for(let t of e)i+=t.lines;if(i<32){let i=[];for(let t of e)t.flatten(i);return new r(i,t)}let n=Math.max(32,i>>5),s=n<<1,a=n>>1,l=[],c=0,h=-1,u=[];function d(e){let t;if(e.lines>s&&e instanceof o)for(let t of e.children)d(t);else e.lines>a&&(c>a||!c)?(p(),l.push(e)):e instanceof r&&c&&(t=u[u.length-1])instanceof r&&e.lines+t.lines<=32?(c+=e.lines,h+=e.length+1,u[u.length-1]=new r(t.text.concat(e.text),t.length+1+e.length)):(c+e.lines>n&&p(),c+=e.lines,h+=e.length+1,u.push(e))}function p(){0!=c&&(l.push(1==u.length?u[0]:o.from(u,h)),h=-1,c=u.length=0)}for(let t of e)d(t);return p(),1==l.length?l[0]:new o(l,t)}}function a(e,t,i=0,n=1e9){for(let s=0,r=0,o=!0;r<e.length&&s<=n;r++){let a=e[r],l=s+a.length;l>=i&&(l>n&&(a=a.slice(0,n-s)),s<i&&(a=a.slice(i-s)),o?(t[t.length-1]+=a,o=!1):t.push(a)),s=l+1}return t}function l(e,t,i){return a(e,[""],t,i)}s.empty=new r([""],0);class c{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof r?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,n=this.nodes[i],s=this.offsets[i],o=s>>1,a=n instanceof r?n.text.length:n.children.length;if(o==(t>0?a:0)){if(0==i)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&s)==(t>0?0:1)){if(this.offsets[i]+=t,0==e)return this.lineBreak=!0,this.value="\n",this;e--}else if(n instanceof r){let s=n.text[o+(t<0?-1:0)];if(this.offsets[i]+=t,s.length>Math.max(0,e))return this.value=0==e?s:t>0?s.slice(e):s.slice(0,s.length-e),this;e-=s.length}else{let s=n.children[o+(t<0?-1:0)];e>s.length?(e-=s.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(s),this.offsets.push(t>0?1:(s instanceof r?s.text.length:s.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class h{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new c(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:n}=this.cursor.next(e);return this.pos+=(n.length+e)*t,this.value=n.length<=i?n:t<0?n.slice(n.length-i):n.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class u{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:n}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=n,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(s.prototype[Symbol.iterator]=function(){return this.iter()},c.prototype[Symbol.iterator]=h.prototype[Symbol.iterator]=u.prototype[Symbol.iterator]=function(){return this});class d{constructor(e,t,i,n){this.from=e,this.to=t,this.number=i,this.text=n}get length(){return this.to-this.from}}function p(e,t,i){return[t=Math.max(0,Math.min(e.length,t)),Math.max(t,Math.min(e.length,i))]}function g(e,t,i=!0,s=!0){return(0,n.z)(e,t,i,s)}function f(e,t){let i=e.charCodeAt(t);if(!((n=i)>=55296&&n<56320&&t+1!=e.length))return i;var n;let s=e.charCodeAt(t+1);return function(e){return e>=56320&&e<57344}(s)?s-56320+(i-55296<<10)+65536:i}function m(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function y(e){return e<65536?1:2}const v=/\r\n?|\n/;var b=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(b||(b={}));class C{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t+1];e+=i<0?this.sections[t]:i}return e}get empty(){return 0==this.sections.length||2==this.sections.length&&this.sections[1]<0}iterGaps(e){for(let t=0,i=0,n=0;t<this.sections.length;){let s=this.sections[t++],r=this.sections[t++];r<0?(e(i,n,s),n+=s):n+=r,i+=s}}iterChangedRanges(e,t=!1){E(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let i=this.sections[t++],n=this.sections[t++];n<0?e.push(i,n):e.push(n,i)}return new C(e)}composeDesc(e){return this.empty?e:e.empty?this:M(this,e)}mapDesc(e,t=!1){return e.empty?this:A(this,e,t)}mapPos(e,t=-1,i=b.Simple){let n=0,s=0;for(let r=0;r<this.sections.length;){let o=this.sections[r++],a=this.sections[r++],l=n+o;if(a<0){if(l>e)return s+(e-n);s+=o}else{if(i!=b.Simple&&l>=e&&(i==b.TrackDel&&n<e&&l>e||i==b.TrackBefore&&n<e||i==b.TrackAfter&&l>e))return null;if(l>e||l==e&&t<0&&!o)return e==n||t<0?s:s+a;s+=a}n=l}if(e>n)throw new RangeError(`Position ${e} is out of range for changeset of length ${n}`);return s}touchesRange(e,t=e){for(let i=0,n=0;i<this.sections.length&&n<=t;){let s=n+this.sections[i++];if(this.sections[i++]>=0&&n<=t&&s>=e)return!(n<e&&s>t)||"cover";n=s}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let i=this.sections[t++],n=this.sections[t++];e+=(e?" ":"")+i+(n>=0?":"+n:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(e=>"number"!=typeof e))throw new RangeError("Invalid JSON representation of ChangeDesc");return new C(e)}static create(e){return new C(e)}}class w extends C{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return E(this,(t,i,n,s,r)=>e=e.replace(n,n+(i-t),r),!1),e}mapDesc(e,t=!1){return A(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let n=0,r=0;n<t.length;n+=2){let o=t[n],a=t[n+1];if(a>=0){t[n]=a,t[n+1]=o;let l=n>>1;for(;i.length<l;)i.push(s.empty);i.push(o?e.slice(r,r+o):s.empty)}r+=o}return new w(t,i)}compose(e){return this.empty?e:e.empty?this:M(this,e,!0)}map(e,t=!1){return e.empty?this:A(this,e,t,!0)}iterChanges(e,t=!1){E(this,e,t)}get desc(){return C.create(this.sections)}filter(e){let t=[],i=[],n=[],s=new T(this);e:for(let r=0,o=0;;){let a=r==e.length?1e9:e[r++];for(;o<a||o==a&&0==s.len;){if(s.done)break e;let e=Math.min(s.len,a-o);S(n,e,-1);let r=-1==s.ins?-1:0==s.off?s.ins:0;S(t,e,r),r>0&&x(i,t,s.text),s.forward(e),o+=e}let l=e[r++];for(;o<l;){if(s.done)break e;let e=Math.min(s.len,l-o);S(t,e,-1),S(n,e,-1==s.ins?-1:0==s.off?s.ins:0),s.forward(e),o+=e}}return{changes:new w(t,i),filtered:C.create(n)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t],n=this.sections[t+1];n<0?e.push(i):0==n?e.push([i]):e.push([i].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,i){let n=[],r=[],o=0,a=null;function l(e=!1){if(!e&&!n.length)return;o<t&&S(n,t-o,-1);let i=new w(n,r);a=a?a.compose(i.map(a)):i,n=[],r=[],o=0}return function e(c){if(Array.isArray(c))for(let t of c)e(t);else if(c instanceof w){if(c.length!=t)throw new RangeError(`Mismatched change set length (got ${c.length}, expected ${t})`);l(),a=a?a.compose(c.map(a)):c}else{let{from:e,to:a=e,insert:h}=c;if(e>a||e<0||a>t)throw new RangeError(`Invalid change range ${e} to ${a} (in doc of length ${t})`);let u=h?"string"==typeof h?s.of(h.split(i||v)):h:s.empty,d=u.length;if(e==a&&0==d)return;e<o&&l(),e>o&&S(n,e-o,-1),S(n,a-e,d),x(r,n,u),o=a}}(e),l(!a),a}static empty(e){return new w(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let n=0;n<e.length;n++){let r=e[n];if("number"==typeof r)t.push(r,-1);else{if(!Array.isArray(r)||"number"!=typeof r[0]||r.some((e,t)=>t&&"string"!=typeof e))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==r.length)t.push(r[0],0);else{for(;i.length<n;)i.push(s.empty);i[n]=s.of(r.slice(1)),t.push(r[0],i[n].length)}}}return new w(t,i)}static createSet(e,t){return new w(e,t)}}function S(e,t,i,n=!1){if(0==t&&i<=0)return;let s=e.length-2;s>=0&&i<=0&&i==e[s+1]?e[s]+=t:s>=0&&0==t&&0==e[s]?e[s+1]+=i:n?(e[s]+=t,e[s+1]+=i):e.push(t,i)}function x(e,t,i){if(0==i.length)return;let n=t.length-2>>1;if(n<e.length)e[e.length-1]=e[e.length-1].append(i);else{for(;e.length<n;)e.push(s.empty);e.push(i)}}function E(e,t,i){let n=e.inserted;for(let r=0,o=0,a=0;a<e.sections.length;){let l=e.sections[a++],c=e.sections[a++];if(c<0)r+=l,o+=l;else{let h=r,u=o,d=s.empty;for(;h+=l,u+=c,c&&n&&(d=d.append(n[a-2>>1])),!(i||a==e.sections.length||e.sections[a+1]<0);)l=e.sections[a++],c=e.sections[a++];t(r,h,o,u,d),r=h,o=u}}}function A(e,t,i,n=!1){let s=[],r=n?[]:null,o=new T(e),a=new T(t);for(let e=-1;;){if(o.done&&a.len||a.done&&o.len)throw new Error("Mismatched change set lengths");if(-1==o.ins&&-1==a.ins){let e=Math.min(o.len,a.len);S(s,e,-1),o.forward(e),a.forward(e)}else if(a.ins>=0&&(o.ins<0||e==o.i||0==o.off&&(a.len<o.len||a.len==o.len&&!i))){let t=a.len;for(S(s,a.ins,-1);t;){let i=Math.min(o.len,t);o.ins>=0&&e<o.i&&o.len<=i&&(S(s,0,o.ins),r&&x(r,s,o.text),e=o.i),o.forward(i),t-=i}a.next()}else{if(!(o.ins>=0)){if(o.done&&a.done)return r?w.createSet(s,r):C.create(s);throw new Error("Mismatched change set lengths")}{let t=0,i=o.len;for(;i;)if(-1==a.ins){let e=Math.min(i,a.len);t+=e,i-=e,a.forward(e)}else{if(!(0==a.ins&&a.len<i))break;i-=a.len,a.next()}S(s,t,e<o.i?o.ins:0),r&&e<o.i&&x(r,s,o.text),e=o.i,o.forward(o.len-i)}}}}function M(e,t,i=!1){let n=[],s=i?[]:null,r=new T(e),o=new T(t);for(let e=!1;;){if(r.done&&o.done)return s?w.createSet(n,s):C.create(n);if(0==r.ins)S(n,r.len,0,e),r.next();else if(0!=o.len||o.done){if(r.done||o.done)throw new Error("Mismatched change set lengths");{let t=Math.min(r.len2,o.len),i=n.length;if(-1==r.ins){let i=-1==o.ins?-1:o.off?0:o.ins;S(n,t,i,e),s&&i&&x(s,n,o.text)}else-1==o.ins?(S(n,r.off?0:r.len,t,e),s&&x(s,n,r.textBit(t))):(S(n,r.off?0:r.len,o.off?0:o.ins,e),s&&!o.off&&x(s,n,o.text));e=(r.ins>t||o.ins>=0&&o.len>t)&&(e||n.length>i),r.forward2(t),o.forward(t)}}else S(n,0,o.ins,e),s&&x(s,n,o.text),o.next()}}class T{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return-2==this.ins}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?s.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?s.empty:t[i].slice(this.off,null==e?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){-1==this.ins?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class D{constructor(e,t,i,n){this.from=e,this.to=t,this.flags=i,this.goalColumn=n}get anchor(){return 32&this.flags?this.to:this.from}get head(){return 32&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 8&this.flags?-1:16&this.flags?1:0}get undirectional(){return(64&this.flags)>0}get bidiLevel(){let e=7&this.flags;return 7==e?null:e}map(e,t=-1){let i,n;return this.empty?i=n=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),n=e.mapPos(this.to,-1)),i==this.from&&n==this.to?this:new D(i,n,this.flags,this.goalColumn)}extend(e,t=e,i=0){if(e<=this.anchor&&t>=this.anchor)return I.range(e,t,void 0,void 0,i);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return I.range(this.anchor,n,void 0,void 0,i)}eq(e,t=!1){return!(this.anchor!=e.anchor||this.head!=e.head||this.goalColumn!=e.goalColumn||t&&this.empty&&this.assoc!=e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||"number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid JSON representation for SelectionRange");return I.range(e.anchor,e.head)}static create(e,t,i,n){return new D(e,t,i,n)}}class I{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:I.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(e.ranges[i],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return 1==this.ranges.length?this:new I([this.main],0)}addRange(e,t=!0){return I.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let i=this.ranges.slice();return i[t]=e,I.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||"number"!=typeof e.main||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new I(e.ranges.map(e=>D.fromJSON(e)),e.main)}static single(e,t=e){return new I([I.range(e,t)],0)}static create(e,t=0){if(0==e.length)throw new RangeError("A selection needs at least one range");for(let i=0,n=0;n<e.length;n++){let s=e[n];if(s.empty?s.from<=i:s.from<i)return I.normalized(e.slice(),t);i=s.to}return new I(e,t)}static cursor(e,t=0,i,n){return D.create(e,e,(0==t?0:t<0?8:16)|(null==i?7:Math.min(6,i)),n)}static range(e,t,i,n,s){let r=null==n?7:Math.min(6,n);return s||e==t||(s=t<e?1:-1),s&&(r|=s<0?8:16),t<e?D.create(t,e,32|r,i):D.create(e,t,r,i)}static undirectionalRange(e,t){return D.create(e,t,64,void 0)}static normalized(e,t=0){let i=e[t];e.sort((e,t)=>e.from-t.from),t=e.indexOf(i);for(let i=1;i<e.length;i++){let n=e[i],s=e[i-1];if(n.empty?n.from<=s.to:n.from<s.to){let r=s.from,o=Math.max(n.to,s.to);i<=t&&t--,e.splice(--i,2,n.anchor>n.head?I.range(o,r):I.range(r,o))}}return new I(e,t)}}function R(e,t){for(let i of e.ranges)if(i.to>t)throw new RangeError("Selection points outside of document")}let k=0;class P{constructor(e,t,i,n,s){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=n,this.id=k++,this.default=e([]),this.extensions="function"==typeof s?s(this):s}get reader(){return this}static define(e={}){return new P(e.combine||(e=>e),e.compareInput||((e,t)=>e===t),e.compare||(e.combine?(e,t)=>e===t:_),!!e.static,e.enables)}of(e){return new L([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new L(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new L(e,this,2,t)}from(e,t){return t||(t=e=>e),this.compute([e],i=>t(i.field(e)))}}function _(e,t){return e==t||e.length==t.length&&e.every((e,i)=>e===t[i])}class L{constructor(e,t,i,n){this.dependencies=e,this.facet=t,this.type=i,this.value=n,this.id=k++}dynamicSlot(e){var t;let i=this.value,n=this.facet.compareInput,s=this.id,r=e[s]>>1,o=2==this.type,a=!1,l=!1,c=[];for(let i of this.dependencies)"doc"==i?a=!0:"selection"==i?l=!0:1&(null!==(t=e[i.id])&&void 0!==t?t:1)||c.push(e[i.id]);return{create:e=>(e.values[r]=i(e),1),update(e,t){if(a&&t.docChanged||l&&(t.docChanged||t.selection)||O(e,c)){let t=i(e);if(o?!N(t,e.values[r],n):!n(t,e.values[r]))return e.values[r]=t,1}return 0},reconfigure:(e,t)=>{let a,l=t.config.address[s];if(null!=l){let s=K(t,l);if(this.dependencies.every(i=>i instanceof P?t.facet(i)===e.facet(i):!(i instanceof B)||t.field(i,!1)==e.field(i,!1))||(o?N(a=i(e),s,n):n(a=i(e),s)))return e.values[r]=s,0}else a=i(e);return e.values[r]=a,1}}}get extension(){return this}}function N(e,t,i){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!i(e[n],t[n]))return!1;return!0}function O(e,t){let i=!1;for(let n of t)1&$(e,n)&&(i=!0);return i}function F(e,t,i){let n=i.map(t=>e[t.id]),s=i.map(e=>e.type),r=n.filter(e=>!(1&e)),o=e[t.id]>>1;function a(e){let i=[];for(let t=0;t<n.length;t++){let r=K(e,n[t]);if(2==s[t])for(let e of r)i.push(e);else i.push(r)}return t.combine(i)}return{create(e){for(let t of n)$(e,t);return e.values[o]=a(e),1},update(e,i){if(!O(e,r))return 0;let n=a(e);return t.compare(n,e.values[o])?0:(e.values[o]=n,1)},reconfigure(e,s){let r=O(e,n),l=s.config.facets[t.id],c=s.facet(t);if(l&&!r&&_(i,l))return e.values[o]=c,0;let h=a(e);return t.compare(h,c)?(e.values[o]=c,0):(e.values[o]=h,1)}}}const G=P.define({static:!0});class B{constructor(e,t,i,n,s){this.id=e,this.createF=t,this.updateF=i,this.compareF=n,this.spec=s,this.provides=void 0}static define(e){let t=new B(k++,e.create,e.update,e.compare||((e,t)=>e===t),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(G).find(e=>e.field==this);return((null==t?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,i)=>{let n=e.values[t],s=this.updateF(n,i);return this.compareF(n,s)?0:(e.values[t]=s,1)},reconfigure:(e,i)=>{let n,s=e.facet(G),r=i.facet(G);return(n=s.find(e=>e.field==this))&&n!=r.find(e=>e.field==this)?(e.values[t]=n.create(e),1):null!=i.config.address[this.id]?(e.values[t]=i.field(this),0):(e.values[t]=this.create(e),1)}}}init(e){return[this,G.of({field:this,create:e})]}get extension(){return this}}function V(e){return t=>new U(t,e)}const H={highest:V(0),high:V(1),default:V(2),low:V(3),lowest:V(4)};class U{constructor(e,t){this.inner=e,this.prec=t}get extension(){return this}}class z{of(e){return new W(this,e)}reconfigure(e){return z.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class W{constructor(e,t){this.compartment=e,this.inner=t}get extension(){return this}}class j{constructor(e,t,i,n,s,r){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=n,this.staticValues=s,this.facets=r,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return null==t?e.default:this.staticValues[t>>1]}static resolve(e,t,i){let n=[],s=Object.create(null),r=new Map;for(let i of function(e,t,i){let n=[[],[],[],[],[]],s=new Map;return function e(r,o){let a=s.get(r);if(null!=a){if(a<=o)return;let e=n[a].indexOf(r);e>-1&&n[a].splice(e,1),r instanceof W&&i.delete(r.compartment)}if(s.set(r,o),Array.isArray(r))for(let t of r)e(t,o);else if(r instanceof W){if(i.has(r.compartment))throw new RangeError("Duplicate use of compartment in extensions");let n=t.get(r.compartment)||r.inner;i.set(r.compartment,n),e(n,o)}else if(r instanceof U)e(r.inner,r.prec);else if(r instanceof B)n[o].push(r),r.provides&&e(r.provides,o);else if(r instanceof L)n[o].push(r),r.facet.extensions&&e(r.facet.extensions,2);else{let t=r.extension;if(!t)throw new Error(`Unrecognized extension value in extension set (${r}).`);if(t==r)throw new Error(`Unrecognized extension value in extension set (${r}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);e(t,o)}}(e,2),n.reduce((e,t)=>e.concat(t))}(e,t,r))i instanceof B?n.push(i):(s[i.facet.id]||(s[i.facet.id]=[])).push(i);let o=Object.create(null),a=[],l=[];for(let e of n)o[e.id]=l.length<<1,l.push(t=>e.slot(t));let c=null==i?void 0:i.config.facets;for(let e in s){let t=s[e],n=t[0].facet,r=c&&c[e]||[];if(t.every(e=>0==e.type))if(o[n.id]=a.length<<1|1,_(r,t))a.push(i.facet(n));else{let e=n.combine(t.map(e=>e.value));a.push(i&&n.compare(e,i.facet(n))?i.facet(n):e)}else{for(let e of t)0==e.type?(o[e.id]=a.length<<1|1,a.push(e.value)):(o[e.id]=l.length<<1,l.push(t=>e.dynamicSlot(t)));o[n.id]=l.length<<1,l.push(e=>F(e,n,t))}}let h=l.map(e=>e(o));return new j(e,r,h,o,a,s)}}function $(e,t){if(1&t)return 2;let i=t>>1,n=e.status[i];if(4==n)throw new Error("Cyclic dependency between fields and/or facets");if(2&n)return n;e.status[i]=4;let s=e.computeSlot(e,e.config.dynamicSlots[i]);return e.status[i]=2|s}function K(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}const Y=P.define(),q=P.define({combine:e=>e.some(e=>e),static:!0}),X=P.define({combine:e=>e.length?e[0]:void 0,static:!0}),Z=P.define(),Q=P.define(),J=P.define(),ee=P.define({combine:e=>!!e.length&&e[0]});class te{constructor(e,t){this.type=e,this.value=t}static define(){return new ie}}class ie{of(e){return new te(this,e)}}class ne{constructor(e){this.map=e}of(e){return new se(this,e)}}class se{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return void 0===t?void 0:t==this.value?this:new se(this.type,t)}is(e){return this.type==e}static define(e={}){return new ne(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let n of e){let e=n.map(t);e&&i.push(e)}return i}}se.reconfigure=se.define(),se.appendConfig=se.define();class re{constructor(e,t,i,n,s,r){this.startState=e,this.changes=t,this.selection=i,this.effects=n,this.annotations=s,this.scrollIntoView=r,this._doc=null,this._state=null,i&&R(i,t.newLength),s.some(e=>e.type==re.time)||(this.annotations=s.concat(re.time.of(Date.now())))}static create(e,t,i,n,s,r){return new re(e,t,i,n,s,r)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(re.userEvent);return!(!t||!(t==e||t.length>e.length&&t.slice(0,e.length)==e&&"."==t[e.length]))}}function oe(e,t){let i=[];for(let n=0,s=0;;){let r,o;if(n<e.length&&(s==t.length||t[s]>=e[n]))r=e[n++],o=e[n++];else{if(!(s<t.length))return i;r=t[s++],o=t[s++]}!i.length||i[i.length-1]<r?i.push(r,o):i[i.length-1]<o&&(i[i.length-1]=o)}}function ae(e,t,i){var n;let s,r,o;return i?(s=t.changes,r=w.empty(t.changes.length),o=e.changes.compose(t.changes)):(s=t.changes.map(e.changes),r=e.changes.mapDesc(t.changes,!0),o=e.changes.compose(s)),{changes:o,selection:t.selection?t.selection.map(r):null===(n=e.selection)||void 0===n?void 0:n.map(s),effects:se.mapEffects(e.effects,s).concat(se.mapEffects(t.effects,r)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function le(e,t,i){let n=t.selection,s=ue(t.annotations);return t.userEvent&&(s=s.concat(re.userEvent.of(t.userEvent))),{changes:t.changes instanceof w?t.changes:w.of(t.changes||[],i,e.facet(X)),selection:n&&(n instanceof I?n:I.single(n.anchor,n.head)),effects:ue(t.effects),annotations:s,scrollIntoView:!!t.scrollIntoView}}function ce(e,t,i){let n=le(e,t.length?t[0]:{},e.doc.length);t.length&&!1===t[0].filter&&(i=!1);for(let s=1;s<t.length;s++){!1===t[s].filter&&(i=!1);let r=!!t[s].sequential;n=ae(n,le(e,t[s],r?n.changes.newLength:e.doc.length),r)}let s=re.create(e,n.changes,n.selection,n.effects,n.annotations,n.scrollIntoView);return function(e){let t=e.startState,i=t.facet(J),n=e;for(let s=i.length-1;s>=0;s--){let r=i[s](e);r&&Object.keys(r).length&&(n=ae(n,le(t,r,e.changes.newLength),!0))}return n==e?e:re.create(t,e.changes,e.selection,n.effects,n.annotations,n.scrollIntoView)}(i?function(e){let t=e.startState,i=!0;for(let n of t.facet(Z)){let t=n(e);if(!1===t){i=!1;break}Array.isArray(t)&&(i=!0===i?t:oe(i,t))}if(!0!==i){let n,s;if(!1===i)s=e.changes.invertedDesc,n=w.empty(t.doc.length);else{let t=e.changes.filter(i);n=t.changes,s=t.filtered.mapDesc(t.changes).invertedDesc}e=re.create(t,n,e.selection&&e.selection.map(s),se.mapEffects(e.effects,s),e.annotations,e.scrollIntoView)}let n=t.facet(Q);for(let i=n.length-1;i>=0;i--){let s=n[i](e);e=s instanceof re?s:Array.isArray(s)&&1==s.length&&s[0]instanceof re?s[0]:ce(t,ue(s),!1)}return e}(s):s)}re.time=te.define(),re.userEvent=te.define(),re.addToHistory=te.define(),re.remote=te.define();const he=[];function ue(e){return null==e?he:Array.isArray(e)?e:[e]}var de=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(de||(de={}));const pe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let ge;try{ge=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(e){}class fe{constructor(e,t,i,n,s,r){this.config=e,this.doc=t,this.selection=i,this.values=n,this.status=e.statusTemplate.slice(),this.computeSlot=s,r&&(r._state=this);for(let e=0;e<this.config.dynamicSlots.length;e++)$(this,e<<1);this.computeSlot=null}field(e,t=!0){let i=this.config.address[e.id];if(null!=i)return $(this,i),K(this,i);if(t)throw new RangeError("Field is not present in this state")}update(...e){return ce(this,e,!0)}applyTransaction(e){let t,i=this.config,{base:n,compartments:s}=i;for(let t of e.effects)t.is(z.reconfigure)?(i&&(s=new Map,i.compartments.forEach((e,t)=>s.set(t,e)),i=null),s.set(t.value.compartment,t.value.extension)):t.is(se.reconfigure)?(i=null,n=t.value):t.is(se.appendConfig)&&(i=null,n=ue(n).concat(t.value));i?t=e.startState.values.slice():(i=j.resolve(n,s,this),t=new fe(i,this.doc,this.selection,i.dynamicSlots.map(()=>null),(e,t)=>t.reconfigure(e,this),null).values);let r=e.startState.facet(q)?e.newSelection:e.newSelection.asSingle();new fe(i,e.newDoc,r,t,(t,i)=>i.update(t,e),e)}replaceSelection(e){return"string"==typeof e&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:I.cursor(t.from+e.length,-1)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),n=this.changes(i.changes),s=[i.range],r=ue(i.effects);for(let i=1;i<t.ranges.length;i++){let o=e(t.ranges[i]),a=this.changes(o.changes),l=a.map(n);for(let e=0;e<i;e++)s[e]=s[e].map(l);let c=n.mapDesc(a,!0);s.push(o.range.map(c)),n=n.compose(l),r=se.mapEffects(r,l).concat(se.mapEffects(ue(o.effects),c))}return{changes:n,selection:I.create(s,t.mainIndex),effects:r}}changes(e=[]){return e instanceof w?e:w.of(e,this.doc.length,this.facet(fe.lineSeparator))}toText(e){return s.of(e.split(this.facet(fe.lineSeparator)||v))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return null==t?e.default:($(this,t),K(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let i in e){let n=e[i];n instanceof B&&null!=this.config.address[n.id]&&(t[i]=n.spec.toJSON(this.field(e[i]),this))}return t}static fromJSON(e,t={},i){if(!e||"string"!=typeof e.doc)throw new RangeError("Invalid JSON representation for EditorState");let n=[];if(i)for(let t in i)if(Object.prototype.hasOwnProperty.call(e,t)){let s=i[t],r=e[t];n.push(s.init(e=>s.spec.fromJSON(r,e)))}return fe.create({doc:e.doc,selection:I.fromJSON(e.selection),extensions:t.extensions?n.concat([t.extensions]):n})}static create(e={}){let t=j.resolve(e.extensions||[],new Map),i=e.doc instanceof s?e.doc:s.of((e.doc||"").split(t.staticFacet(fe.lineSeparator)||v)),n=e.selection?e.selection instanceof I?e.selection:I.single(e.selection.anchor,e.selection.head):I.single(0);return R(n,i.length),t.staticFacet(q)||(n=n.asSingle()),new fe(t,i,n,t.dynamicSlots.map(()=>null),(e,t)=>t.create(e),null)}get tabSize(){return this.facet(fe.tabSize)}get lineBreak(){return this.facet(fe.lineSeparator)||"\n"}get readOnly(){return this.facet(ee)}phrase(e,...t){for(let t of this.facet(fe.phrases))if(Object.prototype.hasOwnProperty.call(t,e)){e=t[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(e,i)=>{if("$"==i)return"$";let n=+(i||1);return!n||n>t.length?e:t[n-1]})),e}languageDataAt(e,t,i=-1){let n=[];for(let s of this.facet(Y))for(let r of s(this,t,i))Object.prototype.hasOwnProperty.call(r,e)&&n.push(r[e]);return n}charCategorizer(e){let t=this.languageDataAt("wordChars",e);return i=t.length?t[0]:"",e=>{if(!/\S/.test(e))return de.Space;if(function(e){if(ge)return ge.test(e);for(let t=0;t<e.length;t++){let i=e[t];if(/\w/.test(i)||i>""&&(i.toUpperCase()!=i.toLowerCase()||pe.test(i)))return!0}return!1}(e))return de.Word;for(let t=0;t<i.length;t++)if(e.indexOf(i[t])>-1)return de.Word;return de.Other};var i}wordAt(e){let{text:t,from:i,length:n}=this.doc.lineAt(e),s=this.charCategorizer(e),r=e-i,o=e-i;for(;r>0;){let e=g(t,r,!1);if(s(t.slice(e,r))!=de.Word)break;r=e}for(;o<n;){let e=g(t,o);if(s(t.slice(o,e))!=de.Word)break;o=e}return r==o?null:I.range(r+i,o+i)}}function me(e,t,i={}){let n={};for(let t of e)for(let e of Object.keys(t)){let s=t[e],r=n[e];if(void 0===r)n[e]=s;else if(r===s||void 0===s);else{if(!Object.hasOwnProperty.call(i,e))throw new Error("Config merge conflict for field "+e);n[e]=i[e](r,s)}}for(let e in t)void 0===n[e]&&(n[e]=t[e]);return n}fe.allowMultipleSelections=q,fe.tabSize=P.define({combine:e=>e.length?e[0]:4}),fe.lineSeparator=X,fe.readOnly=ee,fe.phrases=P.define({compare(e,t){let i=Object.keys(e),n=Object.keys(t);return i.length==n.length&&i.every(i=>e[i]==t[i])}}),fe.languageData=Y,fe.changeFilter=Z,fe.transactionFilter=Q,fe.transactionExtender=J,z.reconfigure=se.define();class ye{eq(e){return this==e}range(e,t=e){return be.create(e,t,this)}}function ve(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}ye.prototype.startSide=ye.prototype.endSide=0,ye.prototype.point=!1,ye.prototype.mapMode=b.TrackDel;class be{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new be(e,t,i)}}function Ce(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class we{constructor(e,t,i,n){this.from=e,this.to=t,this.value=i,this.maxPoint=n}get length(){return xe(this.to)}findIndex(e,t,i,n=0){let s=i?this.to:this.from;for(let r=n,o=s.length;;){if(r==o)return r;let n=r+o>>1,a=s[n]-e||(i?this.value[n].endSide:this.value[n].startSide)-t;if(n==r)return a>=0?r:o;a>=0?o=n:r=n+1}}between(e,t,i,n){for(let s=this.findIndex(t,-1e9,!0),r=this.findIndex(i,1e9,!1,s);s<r;s++)if(!1===n(this.from[s]+e,this.to[s]+e,this.value[s]))return!1}map(e,t,i,n,s){let r=[],o=[],a=[],l=-1,c=-1;e:for(let h=0;h<this.value.length;h++){let u,d,p=this.value[h],g=this.from[h]+e,f=this.to[h]+e;if(g==f){let e=t.mapPos(g,p.startSide,p.mapMode);if(null==e)continue;if(u=d=e,p.startSide!=p.endSide&&(d=t.mapPos(g,p.endSide),d<u))continue}else if(u=t.mapPos(g,p.startSide),d=t.mapPos(f,p.endSide),u>d||u==d&&p.startSide>0&&p.endSide<=0)continue;if(!((d-u||p.endSide-p.startSide)<0))if(l<0&&(l=u),p.point&&(c=Math.max(c,d-u)),(u-i||p.startSide-n)>=0)r.push(p),o.push(u-l),a.push(d-l),i=d,n=p.endSide;else{if(u==d)for(let e=r.length;e>0;e--){if((u-(a[e-1]+l)||p.startSide-r[e-1].endSide)>=0){r.splice(e,0,p),o.splice(e,0,u-l),a.splice(e,0,d-l);continue e}if((u-(o[e-1]+l)||p.endSide-r[e-1].startSide)>0)break}s(u,d,p)}}return{mapped:r.length?new we(o,a,r,c):null,pos:l}}}class Se{constructor(e,t,i,n){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=n}static create(e,t,i,n){return new Se(e,t,i,n)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:i=!1,filterFrom:n=0,filterTo:s=this.length}=e,r=e.filter;if(0==t.length&&!r)return this;if(i&&(t=t.slice().sort(Ce)),this.isEmpty)return t.length?Se.of(t):this;let o=new Me(this,null,-1).goto(0),a=0,l=[],c=new Ee;for(;o.value||a<t.length;)if(a<t.length&&(o.from-t[a].from||o.startSide-t[a].value.startSide)>=0){let e=t[a++];c.addInner(e.from,e.to,e.value,!1)||l.push(e)}else 1==o.rangeIndex&&o.chunkIndex<this.chunk.length&&(a==t.length||this.chunkEnd(o.chunkIndex)<t[a].from)&&(!r||n>this.chunkEnd(o.chunkIndex)||s<this.chunkPos[o.chunkIndex])&&c.addChunk(this.chunkPos[o.chunkIndex],this.chunk[o.chunkIndex])?o.nextChunk():((!r||n>o.to||s<o.from||r(o.from,o.to,o.value))&&(c.addInner(o.from,o.to,o.value,!1)||l.push(be.create(o.from,o.to,o.value))),o.next());return c.finishInner(this.nextLayer.isEmpty&&!l.length?Se.empty:this.nextLayer.update({add:l,filter:r,filterFrom:n,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let t,i=[],n=[],s=-1,r=(e,i,n)=>{t||(t=new Ee),t.addRange(e,i,n,!1)};for(let t=0;t<this.chunk.length;t++){let o=this.chunkPos[t],a=this.chunk[t],l=e.touchesRange(o,o+a.length);if(!1===l)s=Math.max(s,a.maxPoint),i.push(a),n.push(e.mapPos(o));else if(!0===l){let[t,l]=i.length?[xe(n)+xe(i).length,xe(xe(i).value).endSide]:[-1,-1],{mapped:c,pos:h}=a.map(o,e,t,l,r);c&&(s=Math.max(s,c.maxPoint),i.push(c),n.push(h))}}let o=this.nextLayer.map(e);return t&&(o=t.finishInner(o)),0==i.length?o:new Se(n,i,o||Se.empty,s)}between(e,t,i){if(!this.isEmpty){for(let n=0;n<this.chunk.length;n++){let s=this.chunkPos[n],r=this.chunk[n];if(t>=s&&e<=s+r.length&&!1===r.between(s,e-s,t-s,i))return}this.nextLayer.between(e,t,i)}}iter(e=0){return Te.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Te.from(e).goto(t)}static compare(e,t,i,n,s=-1){let r=e.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=s),o=t.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=s),a=Ae(r,o,i),l=new Ie(r,a,s),c=new Ie(o,a,s);i.iterGaps((e,t,i)=>Re(l,e,c,t,i,n)),i.empty&&0==i.length&&Re(l,0,c,0,0,n)}static eq(e,t,i=0,n){null==n&&(n=999999999);let s=e.filter(e=>!e.isEmpty&&t.indexOf(e)<0),r=t.filter(t=>!t.isEmpty&&e.indexOf(t)<0);if(s.length!=r.length)return!1;if(!s.length)return!0;let o=Ae(s,r),a=new Ie(s,o,0).goto(i),l=new Ie(r,o,0).goto(i);for(;;){if(a.to!=l.to||!ke(a.active,l.active)||a.point&&(!l.point||!ve(a.point,l.point)))return!1;if(a.to>n)return!0;a.next(),l.next()}}static spans(e,t,i,n,s=-1){let r=new Ie(e,null,s).goto(t),o=t,a=r.openStart;for(;;){let e=Math.min(r.to,i);if(r.point){let i=r.activeForPoint(r.to),s=r.pointFrom<t?i.length+1:r.point.startSide<0?i.length:Math.min(i.length,a);n.point(o,e,r.point,i,s,r.pointRank),a=Math.min(r.openEnd(e),i.length)}else e>o&&(n.span(o,e,r.active,a),a=r.openEnd(e));if(r.to>i)return a+(r.point&&r.to>i?1:0);o=r.to,r.next()}}static of(e,t=!1){let i=new Ee;for(let n of e instanceof be?[e]:t?function(e){if(e.length>1)for(let t=e[0],i=1;i<e.length;i++){let n=e[i];if(Ce(t,n)>0)return e.slice().sort(Ce);t=n}return e}(e):e)i.add(n.from,n.to,n.value);return i.finish()}static join(e){if(!e.length)return Se.empty;let t=xe(e);for(let i=e.length-2;i>=0;i--)for(let n=e[i];n!=Se.empty;n=n.nextLayer)t=new Se(n.chunkPos,n.chunk,t,Math.max(n.maxPoint,t.maxPoint));return t}}function xe(e){return e[e.length-1]}Se.empty=new Se([],[],null,-1),Se.empty.nextLayer=Se.empty;class Ee{finishChunk(e){this.chunks.push(new we(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,i){this.addRange(e,t,i,!0)}addRange(e,t,i,n){this.addInner(e,t,i,n)||(this.nextLayer||(this.nextLayer=new Ee)).addRange(e,t,i,n)}addInner(e,t,i,n){let s=e-this.lastTo||i.startSide-this.last.endSide;if(n&&s<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(s<0||(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=t,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),0))}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let i=t.value.length-1;return this.last=t.value[i],this.lastFrom=t.from[i]+e,this.lastTo=t.to[i]+e,!0}finish(){return this.finishInner(Se.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;let t=Se.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function Ae(e,t,i){let n=new Map;for(let t of e)for(let e=0;e<t.chunk.length;e++)t.chunk[e].maxPoint<=0&&n.set(t.chunk[e],t.chunkPos[e]);let s=new Set;for(let e of t)for(let t=0;t<e.chunk.length;t++){let r=n.get(e.chunk[t]);null==r||(i?i.mapPos(r):r)!=e.chunkPos[t]||(null==i?void 0:i.touchesRange(r,r+e.chunk[t].length))||s.add(e.chunk[t])}return s}class Me{constructor(e,t,i,n=0){this.layer=e,this.skip=t,this.minPoint=i,this.rank=n}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,i){for(;this.chunkIndex<this.layer.chunk.length;){let t=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(t)||this.layer.chunkEnd(this.chunkIndex)<e||t.maxPoint<this.minPoint))break;this.chunkIndex++,i=!1}if(this.chunkIndex<this.layer.chunk.length){let n=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!i||this.rangeIndex<n)&&this.setRangeIndex(n)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;){if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],i=e+t.from[this.rangeIndex];if(this.from=i,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class Te{constructor(e){this.heap=e}static from(e,t=null,i=-1){let n=[];for(let s=0;s<e.length;s++)for(let r=e[s];!r.isEmpty;r=r.nextLayer)r.maxPoint>=i&&n.push(new Me(r,t,i,s));return 1==n.length?n[0]:new Te(n)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let i of this.heap)i.goto(e,t);for(let e=this.heap.length>>1;e>=0;e--)De(this.heap,e);return this.next(),this}forward(e,t){for(let i of this.heap)i.forward(e,t);for(let e=this.heap.length>>1;e>=0;e--)De(this.heap,e);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),De(this.heap,0)}}}function De(e,t){for(let i=e[t];;){let n=1+(t<<1);if(n>=e.length)break;let s=e[n];if(n+1<e.length&&s.compare(e[n+1])>=0&&(s=e[n+1],n++),i.compare(s)<0)break;e[n]=i,e[t]=s,t=n}}class Ie{constructor(e,t,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Te.from(e,t,i)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){Pe(this.active,e),Pe(this.activeTo,e),Pe(this.activeRank,e),this.minActive=Le(this.active,this.activeTo)}addActive(e){let t=0,{value:i,to:n,rank:s}=this.cursor;for(;t<this.activeRank.length&&(s-this.activeRank[t]||n-this.activeTo[t])>0;)t++;_e(this.active,t,i),_e(this.activeTo,t,n),_e(this.activeRank,t,s),e&&_e(e,t,this.cursor.from),this.minActive=Le(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let n=this.minActive;if(n>-1&&(this.activeTo[n]-this.cursor.from||this.active[n].endSide-this.cursor.startSide)<0){if(this.activeTo[n]>e){this.to=this.activeTo[n],this.endSide=this.active[n].endSide;break}this.removeActive(n),i&&Pe(i,n)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}{let e=this.cursor.value;if(e.point){if(!(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)){this.point=e,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=e.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}this.cursor.next()}else this.addActive(i),this.cursor.next()}}}if(i){this.openStart=0;for(let t=i.length-1;t>=0&&i[t]<e;t--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let i=this.active.length-1;i>=0&&!(this.activeRank[i]<this.pointRank);i--)(this.activeTo[i]>e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&t.push(this.active[i]);return t.reverse()}openEnd(e){let t=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)t++;return t}}function Re(e,t,i,n,s,r){e.goto(t),i.goto(n);let o=n+s,a=n,l=n-t,c=!!r.boundChange;for(let t=!1;;){let n=e.to+l-i.to,s=n||e.endSide-i.endSide,h=s<0?e.to+l:i.to,u=Math.min(h,o);if(e.point||i.point?(e.point&&i.point&&ve(e.point,i.point)&&ke(e.activeForPoint(e.to),i.activeForPoint(i.to))||r.comparePoint(a,u,e.point,i.point),t=!1):(t&&(r.boundChange(a),t=!1),u>a&&!ke(e.active,i.active)&&r.compareRange(a,u,e.active,i.active),c&&u<o&&(n||e.openEnd(h)!=i.openEnd(h))&&(t=!0)),h>o)break;a=h,s<=0&&e.next(),s>=0&&i.next()}}function ke(e,t){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++)if(e[i]!=t[i]&&!ve(e[i],t[i]))return!1;return!0}function Pe(e,t){for(let i=t,n=e.length-1;i<n;i++)e[i]=e[i+1];e.pop()}function _e(e,t,i){for(let i=e.length-1;i>=t;i--)e[i+1]=e[i];e[t]=i}function Le(e,t){let i=-1,n=1e9;for(let s=0;s<t.length;s++)(t[s]-n||e[s].endSide-e[i].endSide)<0&&(i=s,n=t[s]);return i}function Ne(e,t,i=e.length){let n=0;for(let s=0;s<i&&s<e.length;)9==e.charCodeAt(s)?(n+=t-n%t,s++):(n++,s=g(e,s));return n}function Oe(e,t,i,n){for(let n=0,s=0;;){if(s>=t)return n;if(n==e.length)break;s+=9==e.charCodeAt(n)?i-s%i:1,n=g(e,n)}return!0===n?-1:e.length}},51104(e,t,i){"use strict";i.d(t,{$K:()=>pr,A:()=>qn,D4:()=>ds,DK:()=>Ms,Eg:()=>Ls,HJ:()=>fs,Lz:()=>mn,N$:()=>ns,NZ:()=>M,OP:()=>oe,S7:()=>Hs,TS:()=>Tn,Ux:()=>Ps,VH:()=>Bn,Wu:()=>yr,Z9:()=>We,ab:()=>_s,cU:()=>Qs,c_:()=>Ve,dz:()=>as,ld:()=>Fs,rC:()=>zs,ui:()=>Us,w4:()=>En,wJ:()=>Ks,xO:()=>E});var n=i(1993),s=i(14991),r=i(41563),o=i(61145);let a="undefined"!=typeof navigator?navigator:{userAgent:"",vendor:"",platform:""},l="undefined"!=typeof document?document:{documentElement:{style:{}}};const c=/Edge\/(\d+)/.exec(a.userAgent),h=/MSIE \d/.test(a.userAgent),u=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(a.userAgent),d=!!(h||u||c),p=!d&&/gecko\/(\d+)/i.test(a.userAgent),g=!d&&/Chrome\/(\d+)/.exec(a.userAgent),f="webkitFontSmoothing"in l.documentElement.style,m=!d&&/Apple Computer/.test(a.vendor),y=m&&(/Mobile\/\w+/.test(a.userAgent)||a.maxTouchPoints>2);var v={mac:y||/Mac/.test(a.platform),windows:/Win/.test(a.platform),linux:/Linux|X11/.test(a.platform),ie:d,ie_version:h?l.documentMode||6:u?+u[1]:c?+c[1]:0,gecko:p,gecko_version:p?+(/Firefox\/(\d+)/.exec(a.userAgent)||[0,0])[1]:0,chrome:!!g,chrome_version:g?+g[1]:0,ios:y,android:/Android\b/.test(a.userAgent),webkit:f,webkit_version:f?+(/\bAppleWebKit\/(\d+)/.exec(a.userAgent)||[0,0])[1]:0,safari:m,safari_version:m?+(/\bVersion\/(\d+(\.\d+)?)/.exec(a.userAgent)||[0,0])[1]:0,tabSize:null!=l.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};function b(e,t){for(let i in e)"class"==i&&t.class?t.class+=" "+e.class:"style"==i&&t.style?t.style+=";"+e.style:t[i]=e[i];return t}const C=Object.create(null);function w(e,t,i){if(e==t)return!0;e||(e=C),t||(t=C);let n=Object.keys(e),s=Object.keys(t);if(n.length-0!=s.length-0)return!1;for(let r of n)if(r!=i&&(-1==s.indexOf(r)||e[r]!==t[r]))return!1;return!0}function S(e,t,i){let n=!1;if(t)for(let s in t)i&&s in i||(n=!0,"style"==s?e.style.cssText="":e.removeAttribute(s));if(i)for(let s in i)t&&t[s]==i[s]||(n=!0,"style"==s?e.style.cssText=i[s]:e.setAttribute(s,i[s]));return n}function x(e){let t=Object.create(null);for(let i=0;i<e.attributes.length;i++){let n=e.attributes[i];t[n.name]=n.value}return t}class E{eq(e){return!1}updateDOM(e,t,i){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,i){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var A=function(e){return e[e.Text=0]="Text",e[e.WidgetBefore=1]="WidgetBefore",e[e.WidgetAfter=2]="WidgetAfter",e[e.WidgetRange=3]="WidgetRange",e}(A||(A={}));class M extends n.FB{constructor(e,t,i,n){super(),this.startSide=e,this.endSide=t,this.widget=i,this.spec=n}get heightRelevant(){return!1}static mark(e){return new T(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),i=!!e.block;return t+=i&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new I(e,t,t,i,e.widget||null,!1)}static replace(e){let t,i,n=!!e.block;if(e.isBlockGap)t=-5e8,i=4e8;else{let{start:s,end:r}=R(e,n);t=(s?n?-3e8:-1:5e8)-1,i=1+(r?n?2e8:1:-6e8)}return new I(e,t,i,n,e.widget||null,!0)}static line(e){return new D(e)}static set(e,t=!1){return n.om.of(e,t)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}M.none=n.om.empty;class T extends M{constructor(e){let{start:t,end:i}=R(e);super(t?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?b(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||C}eq(e){return this==e||e instanceof T&&this.tagName==e.tagName&&w(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}T.prototype.point=!1;class D extends M{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof D&&this.spec.class==e.spec.class&&w(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}D.prototype.mapMode=n.iR.TrackBefore,D.prototype.point=!0;class I extends M{constructor(e,t,i,s,r,o){super(t,i,r,e),this.block=s,this.isReplace=o,this.mapMode=s?t<=0?n.iR.TrackBefore:n.iR.TrackAfter:n.iR.TrackDel}get type(){return this.startSide!=this.endSide?A.WidgetRange:this.startSide<=0?A.WidgetBefore:A.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof I&&((t=this.widget)==(i=e.widget)||!!(t&&i&&t.compare(i)))&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide;var t,i}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}function R(e,t=!1){let{inclusiveStart:i,inclusiveEnd:n}=e;return null==i&&(i=e.inclusive),null==n&&(n=e.inclusive),{start:null!=i?i:t,end:null!=n?n:t}}function k(e,t,i,n=0){let s=i.length-1;s>=0&&i[s]+n>=e?i[s]=Math.max(i[s],t):i.push(e,t)}I.prototype.point=!0;class P extends n.FB{constructor(e,t,i){super(),this.tagName=e,this.attributes=t,this.rank=i}eq(e){return e==this||e instanceof P&&this.tagName==e.tagName&&w(this.attributes,e.attributes)}static create(e){return new P(e.tagName,e.attributes||C,null==e.rank?50:Math.max(0,Math.min(e.rank,100)))}static set(e,t=!1){return n.om.of(e,t)}}P.prototype.startSide=P.prototype.endSide=-1;const _=e=>1==e.nodeType,L=e=>3==e.nodeType;function N(e){let t;return t=11==e.nodeType?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function O(e,t){return!!t&&(e==t||e.contains(1!=t.nodeType?t.parentNode:t))}function F(e,t){if(!t.anchorNode)return!1;try{return O(e,t.anchorNode)}catch(e){return!1}}function G(e){return L(e)?ee(e,0,e.nodeValue.length).getClientRects():_(e)?e.getClientRects():[]}function B(e,t,i,n){return!!i&&(U(e,t,i,n,-1)||U(e,t,i,n,1))}function V(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function H(e){return _(e)&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function U(e,t,i,n,s){for(;;){if(e==i&&t==n)return!0;if(t==(s<0?0:z(e))){if("DIV"==e.nodeName)return!1;let i=e.parentNode;if(!i||!_(i))return!1;t=V(e)+(s<0?0:1),e=i}else{if(!_(e))return!1;if(e=e.childNodes[t+(s<0?-1:0)],_(e)&&("IMG"==e.nodeName||"BR"==e.nodeName||"false"==e.contentEditable))return!1;t=s<0?z(e):0}}}function z(e){return L(e)?e.nodeValue.length:e.childNodes.length}function W(e,t){let{left:i,right:n}=e;if(i==n)return e;let s=t?i:n;return{left:s,right:s,top:e.top,bottom:e.bottom}}function j(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function $(e,t){let i=t.width/e.offsetWidth,n=t.height/e.offsetHeight;return(i>.995&&i<1.005||!isFinite(i)||Math.abs(t.width-e.offsetWidth)<1)&&(i=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.height-e.offsetHeight)<1)&&(n=1),{scaleX:i,scaleY:n}}function K(e,t=!0){let i=e.ownerDocument,n=null,s=null;for(let r=e.parentNode;r&&r!=i.body&&(t&&!n||!s);)if(_(r))!s&&r.scrollHeight>r.clientHeight&&(s=r),t&&!n&&r.scrollWidth>r.clientWidth&&(n=r),r=r.assignedSlot||r.parentNode;else{if(11!=r.nodeType)break;r=r.host}return{x:n,y:s}}class Y{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:i}=e;this.set(t,Math.min(e.anchorOffset,t?z(t):0),i,Math.min(e.focusOffset,i?z(i):0))}set(e,t,i,n){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=n}}function q(e){let t=[];for(let i=e;i;i=11==i.nodeType?i.host:i.parentNode)_(i)&&t.push({node:i,left:i.scrollLeft,top:i.scrollTop});return t}function X(e,t=!0){for(let{node:i,left:n,top:s}of e)t&&i.scrollTop!=s&&(i.scrollTop=s),i.scrollLeft!=n&&(i.scrollLeft=n)}let Z,Q=null;function J(e){if(e.setActive)return e.setActive();if(Q)return e.focus(Q);let t=q(e);e.focus(null==Q?{get preventScroll(){return Q={preventScroll:!0},!0}}:void 0),Q||(Q=!1,X(t))}function ee(e,t,i=t){let n=Z||(Z=document.createRange());return n.setEnd(e,i),n.setStart(e,t),n}function te(e,t,i,n){let s={key:t,code:t,keyCode:i,which:i,cancelable:!0};n&&({altKey:s.altKey,ctrlKey:s.ctrlKey,shiftKey:s.shiftKey,metaKey:s.metaKey}=n);let r=new KeyboardEvent("keydown",s);r.synthetic=!0,e.dispatchEvent(r);let o=new KeyboardEvent("keyup",s);return o.synthetic=!0,e.dispatchEvent(o),r.defaultPrevented||o.defaultPrevented}function ie(e){return e instanceof Window?e.pageYOffset>Math.max(0,e.document.documentElement.scrollHeight-e.innerHeight-4):e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function ne(e,t){for(let i=e,n=t;;){if(L(i)&&n>0)return{node:i,offset:n};if(_(i)&&n>0){if("false"==i.contentEditable)return null;i=i.childNodes[n-1],n=z(i)}else{if(!i.parentNode||H(i))return null;n=V(i),i=i.parentNode}}}function se(e,t){for(let i=e,n=t;;){if(L(i)&&n<i.nodeValue.length)return{node:i,offset:n};if(_(i)&&n<i.childNodes.length){if("false"==i.contentEditable)return null;i=i.childNodes[n],n=0}else{if(!i.parentNode||H(i))return null;n=V(i)+1,i=i.parentNode}}}v.safari&&v.safari_version>=26&&(Q=!1);class re{constructor(e,t,i=!0){this.node=e,this.offset=t,this.precise=i}static before(e,t){return new re(e.parentNode,V(e),t)}static after(e,t){return new re(e.parentNode,V(e)+1,t)}}var oe=function(e){return e[e.LTR=0]="LTR",e[e.RTL=1]="RTL",e}(oe||(oe={}));const ae=oe.LTR,le=oe.RTL;function ce(e){let t=[];for(let i=0;i<e.length;i++)t.push(1<<+e[i]);return t}const he=ce("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),ue=ce("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),de=Object.create(null),pe=[];for(let e of["()","[]","{}"]){let t=e.charCodeAt(0),i=e.charCodeAt(1);de[t]=i,de[i]=-t}function ge(e){return e<=247?he[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?ue[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}const fe=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class me{get dir(){return this.level%2?le:ae}constructor(e,t,i){this.from=e,this.to=t,this.level=i}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,i,n){let s=-1;for(let r=0;r<e.length;r++){let o=e[r];if(o.from<=t&&o.to>=t){if(o.level==i)return r;(s<0||(0!=n?n<0?o.from<t:o.to>t:e[s].level>o.level))&&(s=r)}}if(s<0)throw new RangeError("Index out of range");return s}}function ye(e,t){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++){let n=e[i],s=t[i];if(n.from!=s.from||n.to!=s.to||n.direction!=s.direction||!ye(n.inner,s.inner))return!1}return!0}const ve=[];function be(e,t,i,n,s,r,o){let a=n%2?2:1;if(n%2==s%2)for(let l=t,c=0;l<i;){let t=!0,h=!1;if(c==r.length||l<r[c].from){let e=ve[l];e!=a&&(t=!1,h=16==e)}let u=t||1!=a?null:[],d=t?n:n+1,p=l;e:for(;;)if(c<r.length&&p==r[c].from){if(h)break e;let g=r[c];if(!t)for(let e=g.to,t=c+1;;){if(e==i)break e;if(!(t<r.length&&r[t].from==e)){if(ve[e]==a)break e;break}e=r[t++].to}c++,u?u.push(g):(g.from>l&&o.push(new me(l,g.from,d)),Ce(e,g.direction==ae!=!(d%2)?n+1:n,s,g.inner,g.from,g.to,o),l=g.to),p=g.to}else{if(p==i||(t?ve[p]!=a:ve[p]==a))break;p++}u?be(e,l,p,n+1,s,u,o):l<p&&o.push(new me(l,p,d)),l=p}else for(let l=i,c=r.length;l>t;){let i=!0,h=!1;if(!c||l>r[c-1].to){let e=ve[l-1];e!=a&&(i=!1,h=16==e)}let u=i||1!=a?null:[],d=i?n:n+1,p=l;e:for(;;)if(c&&p==r[c-1].to){if(h)break e;let g=r[--c];if(!i)for(let e=g.from,i=c;;){if(e==t)break e;if(!i||r[i-1].to!=e){if(ve[e-1]==a)break e;break}e=r[--i].from}u?u.push(g):(g.to<l&&o.push(new me(g.to,l,d)),Ce(e,g.direction==ae!=!(d%2)?n+1:n,s,g.inner,g.from,g.to,o),l=g.from),p=g.from}else{if(p==t||(i?ve[p-1]!=a:ve[p-1]==a))break;p--}u?be(e,p,l,n+1,s,u,o):p<l&&o.push(new me(p,l,d)),l=p}}function Ce(e,t,i,n,s,r,o){let a=t%2?2:1;!function(e,t,i,n,s){for(let r=0;r<=n.length;r++){let o=r?n[r-1].to:t,a=r<n.length?n[r].from:i,l=r?256:s;for(let t=o,i=l,n=l;t<a;t++){let s=ge(e.charCodeAt(t));512==s?s=i:8==s&&4==n&&(s=16),ve[t]=4==s?2:s,7&s&&(n=s),i=s}for(let e=o,t=l,n=l;e<a;e++){let s=ve[e];if(128==s)e<a-1&&t==ve[e+1]&&24&t?s=ve[e]=t:ve[e]=256;else if(64==s){let s=e+1;for(;s<a&&64==ve[s];)s++;let r=e&&8==t||s<i&&8==ve[s]?1==n?1:8:256;for(let t=e;t<s;t++)ve[t]=r;e=s-1}else 8==s&&1==n&&(ve[e]=1);t=s,7&s&&(n=s)}}}(e,s,r,n,a),function(e,t,i,n,s){let r=1==s?2:1;for(let o=0,a=0,l=0;o<=n.length;o++){let c=o?n[o-1].to:t,h=o<n.length?n[o].from:i;for(let t,i,n,o=c;o<h;o++)if(i=de[t=e.charCodeAt(o)])if(i<0){for(let e=a-3;e>=0;e-=3)if(pe[e+1]==-i){let t=pe[e+2],i=2&t?s:4&t?1&t?r:s:0;i&&(ve[o]=ve[pe[e]]=i),a=e;break}}else{if(189==pe.length)break;pe[a++]=o,pe[a++]=t,pe[a++]=l}else if(2==(n=ve[o])||1==n){let e=n==s;l=e?0:1;for(let t=a-3;t>=0;t-=3){let i=pe[t+2];if(2&i)break;if(e)pe[t+2]|=2;else{if(4&i)break;pe[t+2]|=4}}}}}(e,s,r,n,a),function(e,t,i,n){for(let s=0,r=n;s<=i.length;s++){let o=s?i[s-1].to:e,a=s<i.length?i[s].from:t;for(let l=o;l<a;){let o=ve[l];if(256==o){let o=l+1;for(;;)if(o==a){if(s==i.length)break;o=i[s++].to,a=s<i.length?i[s].from:t}else{if(256!=ve[o])break;o++}let c=1==r,h=c==(1==(o<t?ve[o]:n))?c?1:2:n;for(let t=o,n=s,r=n?i[n-1].to:e;t>l;)t==r&&(t=i[--n].from,r=n?i[n-1].to:e),ve[--t]=h;l=o}else r=o,l++}}}(s,r,n,a),be(e,s,r,t,i,n,o)}function we(e){return[new me(0,e,0)]}let Se="";function xe(e,t,i,s,r){var o;if(!e.length)return null;let a,l=s.head-e.from;if(s.head==e.from&&s.assoc<0){if(!r)return null;l=t[a=0].side(!1,i)}else if(s.head==e.to&&s.assoc>0){if(r)return null;l=t[a=t.length-1].side(!0,i)}else a=me.find(t,l,null!==(o=s.bidiLevel)&&void 0!==o?o:-1,s.assoc);let c=t[a],h=c.side(r,i);if(l==h){let e=a+=r?1:-1;if(e<0||e>=t.length)return null;c=t[a=e],l=c.side(!r,i),h=c.side(r,i)}let u=(0,n.zK)(e.text,l,c.forward(r,i));(u<c.from||u>c.to)&&(u=h),Se=e.text.slice(Math.min(l,u),Math.max(l,u));let d=a==(r?t.length-1:0)?null:t[a+(r?1:-1)];if(u==h){if(!d)return r?n.OF.cursor(e.to,1):n.OF.cursor(e.from,-1);if(d.level+(r?0:1)<c.level)return n.OF.cursor(d.side(!r,i)+e.from,d.forward(r,i)?1:-1,d.level)}return n.OF.cursor(u+e.from,c.forward(r,i)?-1:1,c.level)}function Ee(e,t,i){for(let n=t;n<i;n++){let t=ge(e.charCodeAt(n));if(1==t)return ae;if(2==t||4==t)return le}return ae}const Ae=n.sj.define(),Me=n.sj.define(),Te=n.sj.define(),De=n.sj.define(),Ie=n.sj.define(),Re=n.sj.define(),ke=n.sj.define(),Pe=n.sj.define(),_e=n.sj.define(),Le=n.sj.define({combine:e=>e.some(e=>e)}),Ne=n.sj.define({combine:e=>e.some(e=>e)}),Oe=n.sj.define();class Fe{constructor(e,t,i,n,s,r=!1){this.range=e,this.y=t,this.x=i,this.yMargin=n,this.xMargin=s,this.isSnapshot=r}map(e){return e.empty?this:new Fe(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new Fe(n.OF.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Ge=n.Pe.define({map:(e,t)=>e.map(t)}),Be=n.Pe.define();function Ve(e,t,i){let n=e.facet(De);n.length?n[0](t):window.onerror&&window.onerror(String(t),i,void 0,void 0,t)||(i?console.error(i+":",t):console.error(t))}const He=n.sj.define({combine:e=>!e.length||e[0]});let Ue=0;const ze=n.sj.define({combine:e=>e.filter((t,i)=>{for(let n=0;n<i;n++)if(e[n].plugin==t.plugin)return!1;return!0})});class We{constructor(e,t,i,n,s){this.id=e,this.create=t,this.domEventHandlers=i,this.domEventObservers=n,this.baseExtensions=s(this),this.extension=this.baseExtensions.concat(ze.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(ze.of({plugin:this,arg:e}))}static define(e,t){const{eventHandlers:i,eventObservers:n,provide:s,decorations:r}=t||{};return new We(Ue++,e,i,n,e=>{let t=[];return r&&t.push(Ye.of(t=>{let i=t.plugin(e);return i?r(i):M.none})),s&&t.push(s(e)),t})}static fromClass(e,t){return We.define((t,i)=>new e(t,i),t)}}class je{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(t){if(Ve(e.state,t,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(e){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){Ve(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(null===(t=this.value)||void 0===t?void 0:t.destroy)try{this.value.destroy()}catch(t){Ve(e.state,t,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const $e=n.sj.define(),Ke=n.sj.define(),Ye=n.sj.define(),qe=n.sj.define(),Xe=n.sj.define(),Ze=n.sj.define(),Qe=n.sj.define();function Je(e,t){let i=e.state.facet(Qe);if(!i.length)return i;let s=i.map(t=>t instanceof Function?t(e):t),r=[];return n.om.spans(s,t.from,t.to,{point(){},span(e,i,n,s){let o=e-t.from,a=i-t.from,l=r;for(let e=n.length-1;e>=0;e--,s--){let i,r=n[e].spec.bidiIsolate;if(null==r&&(r=Ee(t.text,o,a)),s>0&&l.length&&(i=l[l.length-1]).to==o&&i.direction==r)i.to=a,l=i.inner;else{let e={from:o,to:a,direction:r,inner:[]};l.push(e),l=e.inner}}}}),r}const et=n.sj.define();function tt(e){let t=0,i=0,n=0,s=0;for(let r of e.state.facet(et)){let o=r(e);o&&(null!=o.left&&(t=Math.max(t,o.left)),null!=o.right&&(i=Math.max(i,o.right)),null!=o.top&&(n=Math.max(n,o.top)),null!=o.bottom&&(s=Math.max(s,o.bottom)))}return{left:t,right:i,top:n,bottom:s}}const it=n.sj.define();class nt{constructor(e,t,i,n){this.fromA=e,this.toA=t,this.fromB=i,this.toB=n}join(e){return new nt(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,i=this;for(;t>0;t--){let n=e[t-1];if(!(n.fromA>i.toA)){if(n.toA<i.fromA)break;i=i.join(n),e.splice(t-1,1)}}return e.splice(t,0,i),e}static extendWithRanges(e,t){if(0==t.length)return e;let i=[];for(let n=0,s=0,r=0;;){let o=n<e.length?e[n].fromB:1e9,a=s<t.length?t[s]:1e9,l=Math.min(o,a);if(1e9==l)break;let c=l+r,h=l,u=c;for(;;)if(s<t.length&&t[s]<=h){let i=t[s+1];s+=2,h=Math.max(h,i);for(let t=n;t<e.length&&e[t].fromB<=h;t++)r=e[t].toA-e[t].toB;u=Math.max(u,i+r)}else{if(!(n<e.length&&e[n].fromB<=h))break;{let t=e[n++];h=Math.max(h,t.toB),u=Math.max(u,t.toA),r=t.toA-t.toB}}i.push(new nt(c,u,l,h))}return i}}class st{constructor(e,t,i){this.view=e,this.state=t,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=n.VR.empty(this.startState.doc.length);for(let e of i)this.changes=this.changes.compose(e.changes);let s=[];this.changes.iterChangedRanges((e,t,i,n)=>s.push(new nt(e,t,i,n))),this.changedRanges=s}static create(e,t,i){return new st(e,t,i)}get viewportChanged(){return(4&this.flags)>0}get viewportMoved(){return(8&this.flags)>0}get heightChanged(){return(2&this.flags)>0}get geometryChanged(){return this.docChanged||(18&this.flags)>0}get focusChanged(){return(1&this.flags)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return 0==this.flags&&0==this.transactions.length}}const rt=[];class ot{constructor(e,t,i=0){this.dom=e,this.length=t,this.flags=i,this.parent=null,e.cmTile=this}get breakAfter(){return 1&this.flags}get children(){return rt}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,4&this.flags){this.flags&=-5;let e=this.domAttrs;e&&function(e,t){for(let i=e.attributes.length-1;i>=0;i--){let n=e.attributes[i].name;null==t[n]&&e.removeAttribute(n)}for(let i in t){let n=t[i];"style"==i?e.style.cssText=n:e.getAttribute(i)!=n&&e.setAttribute(i,n)}}(this.dom,e)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let i=t;for(let t of this.children){if(t==e)return i;i+=t.length+t.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t,i){return null}domPosFor(e,t){let i=V(this.dom),n=this.length?e>0:t>0;return new re(this.parent.dom,i+(n?1:0),0==e||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&2&this.parent.flags&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof ct)return e;return null}static get(e){return e.cmTile}}class at extends ot{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(2&this.flags)return;super.sync(e);let t,i=this.dom,n=null,s=(null==e?void 0:e.node)==i?e:null,r=0;for(let o of this.children){if(o.sync(e),r+=o.length+o.breakAfter,t=n?n.nextSibling:i.firstChild,s&&t!=o.dom&&(s.written=!0),o.dom.parentNode==i)for(;t&&t!=o.dom;)t=lt(t);else i.insertBefore(o.dom,t);n=o.dom}for(t=n?n.nextSibling:i.firstChild,s&&t&&(s.written=!0);t;)t=lt(t);this.length=r}}function lt(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class ct extends at{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=ot.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],i=this,n=0,s=0;;)if(n==i.children.length){if(!t.length)return;i=i.parent,i.breakAfter&&s++,n=t.pop()}else{let r=i.children[n++];if(r instanceof ht)t.push(n),i=r,n=0;else{let t=s+r.length,i=e(r,s);if(void 0!==i)return i;s=t+r.breakAfter}}}resolveBlock(e,t){let i,n,s=-1,r=-1;if(this.blockTiles((o,a)=>{let l=a+o.length;if(e>=a&&e<=l){if(o.isWidget()&&t>=-1&&t<=1){if(32&o.flags)return!0;16&o.flags&&(i=void 0)}(a<e||e==l&&(t<-1?o.length:o.covers(1)))&&(!i||!o.isWidget()&&i.isWidget())&&(i=o,s=e-a),(l>e||e==a&&(t>1?o.length:o.covers(-1)))&&(!n||!o.isWidget()&&n.isWidget())&&(n=o,r=e-a)}}),!i&&!n)throw new Error("No tile at position "+e);return i&&t<0||!n?{tile:i,offset:s}:{tile:n,offset:r}}}class ht extends at{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return!!this.children.length&&(e<0?this.children[0].covers(-1):this.lastChild.covers(1))}get domAttrs(){return this.wrapper.attributes}static of(e,t){let i=new ht(t||document.createElement(e.tagName),e);return t||(i.flags|=4),i}}class ut extends at{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(e,t,i){let n=new ut(t||document.createElement("div"),e);return t&&i||(n.flags|=4),n}get domAttrs(){return this.attrs}resolveInline(e,t,i=!1){let n=null,s=-1,r=null,o=-1;!function e(a,l){for(let c=0,h=0;c<a.children.length&&h<=l;c++){let u=a.children[c],d=h+u.length;d>=l&&(u.isComposite()?e(u,l-h):(!r||i&&r.isHidden&&(t>0&&!(32&r.flags)||i&&dt(r,u)))&&(d>l||32&u.flags&&t<=1)?(r=u,o=l-h):(h<l||16&u.flags&&(!i||!u.isHidden)&&t>=-1)&&(n=u,s=l-h)),h=d}}(this,e);let a=(t<0?n:r)||n||r;return a?{tile:a,offset:a==n?s:o}:null}coordsIn(e,t,i){let n=this.resolveInline(e,t,!0);return n?n.tile.coordsIn(Math.max(0,n.offset),t,i):function(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let i=G(t);return i[i.length-1]||null}(this)}domIn(e,t){let i=this.resolveInline(e,t);if(i){let{tile:e,offset:n}=i;if(this.dom.contains(e.dom))return e.isText()?new re(e.dom,Math.min(e.dom.nodeValue.length,n)):e.domPosFor(n,16&e.flags?1:32&e.flags?-1:t);let s=i.tile.parent,r=!1;for(let e of s.children){if(r)return new re(e.dom,0);e==i.tile&&(r=!0)}}return new re(this.dom,0)}}function dt(e,t){let i=e.coordsIn(0,1),n=t.coordsIn(0,1);return i&&n&&n.top<i.bottom}class pt extends at{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(e,t){let i=new pt(t||document.createElement(e.tagName),e);return t||(i.flags|=4),i}}class gt extends ot{constructor(e,t){super(e,t.length),this.text=t}sync(e){2&this.flags||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,t,i){let n=this.dom.nodeValue.length;e>n&&(e=n);let s=e,r=e,o=0;0==e&&t<0||e==n&&t>=0?v.chrome||v.gecko||(e?(s--,o=1):r<n&&(r++,o=-1)):t<0?s--:r<n&&r++;let a=ee(this.dom,s,r).getClientRects();if(!a.length)return null;let l=a[(o?o<0:t>=0)?0:a.length-1];return v.safari&&!o&&0==l.width&&(l=Array.prototype.find.call(a,e=>e.width)||l),null==i?l:W(l,(o?o>0:t<0)==i)}static of(e,t){let i=new gt(t||document.createTextNode(e),e);return t||(i.flags|=2),i}}class ft extends ot{constructor(e,t,i,n){super(e,t,n),this.widget=i}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return!(48&this.flags)&&(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,i){let n=this.widget.coordsAt(this.dom,e,t);if(n)return n;if(i)return W(this.dom.getBoundingClientRect(),this.length?0==e:t<=0);{let t=this.dom.getClientRects(),i=null;if(!t.length)return null;let n=!!(16&this.flags)||!(32&this.flags)&&e>0;for(let s=n?t.length-1:0;i=t[s],!(e>0?0==s:s==t.length-1||i.top<i.bottom);s+=n?-1:1);return W(i,!n)}}get overrideDOMText(){if(!this.length)return n.EY.empty;let{root:e}=this;if(!e)return n.EY.empty;let t=this.posAtStart;return e.view.state.doc.slice(t,t+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,t,i,n,s){return s||(s=e.toDOM(t),e.editable||(s.contentEditable="false")),new ft(s,i,e,n)}}class mt extends ot{constructor(e){let t=document.createElement("img");t.className="cm-widgetBuffer",t.setAttribute("aria-hidden","true"),super(t,0,e)}get isHidden(){return!0}get overrideDOMText(){return n.EY.empty}coordsIn(e,t,i){let n=this.dom.getBoundingClientRect();return null==i?n:W(n,t>0==i)}}class yt{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,i){let{tile:n,index:s,beforeBreak:r,parents:o}=this;for(;e||t>0;)if(n.isComposite())if(r){if(!e)break;i&&i.break(),e--,r=!1}else if(s==n.children.length){if(!e&&!o.length)break;i&&i.leave(n),r=!!n.breakAfter,({tile:n,index:s}=o.pop()),s++}else{let a=n.children[s],l=a.breakAfter;!(t>0?a.length<=e:a.length<e)||i&&!1===i.skip(a,0,a.length)&&a.isComposite?(o.push({tile:n,index:s}),n=a,s=0,i&&a.isComposite()&&i.enter(a)):(r=!!l,s++,e-=a.length)}else{let t=n.length;if(s<t&&e){let r=Math.min(e,t-s);i&&i.skip(n,s,s+r),e-=r,s+=r}if(s==t)r=!!n.breakAfter,({tile:n,index:s}=o.pop()),s++;else if(!e)break}return this.tile=n,this.index=s,this.beforeBreak=r,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class vt{constructor(e,t,i,n){this.from=e,this.to=t,this.wrapper=i,this.rank=n}}class bt{constructor(e,t,i){this.cache=e,this.root=t,this.blockWrappers=i,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,i,n){var s;this.flushBuffer();let r=this.ensureMarks(t,i),o=r.lastChild;o&&o.isText()&&!(8&o.flags)&&o.length+e.length<512?(this.cache.reused.set(o,2),(r.children[r.children.length-1]=new gt(o.dom,o.text+e)).parent=r):r.append(n||gt.of(e,null===(s=this.cache.find(gt))||void 0===s?void 0:s.dom)),this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let i=this.curLine;i.dom!=t.line.dom&&(i.setDOM(this.cache.reused.has(t.line)?Mt(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let n=i;for(let e=t.marks.length-1;e>=0;e--){let i=t.marks[e],s=n.lastChild;if(s instanceof pt&&s.mark.eq(i.mark))s.dom!=i.dom&&s.setDOM(Mt(i.dom)),n=s;else{let{dom:e}=i;this.cache.reused.get(i)&&ot.get(i.dom)&&(e=Mt(i.dom));let t=pt.of(i.mark,e);n.append(t),n=t}this.cache.reused.set(i,2)}let s=ot.get(e.text);s&&this.cache.reused.set(s,2);let r=new gt(e.text,e.text.nodeValue);r.flags|=8,this.pos=e.range.toB,n.append(r)}addInlineWidget(e,t,i){let n=this.afterWidget&&48&e.flags&&(48&this.afterWidget.flags)==(48&e.flags);n||this.flushBuffer();let s=this.ensureMarks(t,i);n||16&e.flags||s.append(this.getBuffer(1)),s.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,i){this.flushBuffer(),this.ensureMarks(t,i).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){(this.afterWidget||this.lastBlock).length+=e,this.pos+=e}addLineStart(e,t){var i;e||(e=At);let n=ut.start(e,t||(null===(i=this.cache.find(ut))||void 0===i?void 0:i.dom),!!t);this.getBlockPos().append(this.lastBlock=this.curLine=n)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){var i;let n=this.curLine;for(let s=e.length-1;s>=0;s--){let r,o=e[s];if(t>0&&(r=n.lastChild)&&r instanceof pt&&r.mark.eq(o))n=r,t--;else{let e=pt.of(o,null===(i=this.cache.find(pt,e=>e.mark.eq(o)))||void 0===i?void 0:i.dom);n.append(e),n=e,t=0}}return n}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;e&&Et(this.curLine,!1)&&("BR"==e.dom.nodeName||!e.isWidget()||v.ios&&Et(this.curLine,!0))||this.curLine.append(this.cache.findWidget(Dt,0,32)||new ft(Dt.toDOM(),0,Dt,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let t=102*e.rank+e.value.rank,i=new vt(e.from,e.to,e.value,t),n=this.wrappers.length;for(;n>0&&(this.wrappers[n-1].rank-i.rank||this.wrappers[n-1].to-i.to)<0;)n--;this.wrappers.splice(n,0,i)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let t=this.root;for(let i of this.wrappers){let n=t.lastChild;if(i.from<this.pos&&n instanceof ht&&n.wrapper.eq(i.wrapper))t=n;else{let n=ht.of(i.wrapper,null===(e=this.cache.find(ht,e=>e.wrapper.eq(i.wrapper)))||void 0===e?void 0:e.dom);t.append(n),t=n}}return t}blockPosCovered(){let e=this.lastBlock;return null!=e&&!e.breakAfter&&(!e.isWidget()||(160&e.flags)>0)}getBuffer(e){let t=2|(e<0?16:32),i=this.cache.find(mt,void 0,1);return i&&(i.flags=t),i||new mt(t)}flushBuffer(){!this.afterWidget||32&this.afterWidget.flags||(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class Ct{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:t,lineBreak:i,done:n}=this.cursor.next(this.skipCount);if(this.skipCount=0,n)throw new Error("Ran out of text content when drawing inline views");this.text=t;let s=this.textOff=Math.min(e,t.length);return i?null:t.slice(0,s)}let t=Math.min(this.text.length,this.textOff+e),i=this.text.slice(this.textOff,t);return this.textOff=t,i}}const wt=[ft,ut,gt,pt,mt,ht,ct];for(let e=0;e<wt.length;e++)wt[e].bucket=e;class St{constructor(e){this.view=e,this.buckets=wt.map(()=>[]),this.index=wt.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,i=this.buckets[t];i.length<6?i.push(e):i[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,i=2){let n=e.bucket,s=this.buckets[n],r=this.index[n];for(let e=0;e<s.length;e++){let o=(e+r)%s.length,a=s[o];if((!t||t(a))&&!this.reused.has(a))return s.splice(o,1),o<r&&this.index[n]--,this.reused.set(a,i),a}return null}findWidget(e,t,i){let n=this.buckets[0];if(n.length)for(let s=0,r=0;;s++){if(s==n.length){if(r)return null;r=1,s=0}let o=n[s];if(!this.reused.has(o)&&(0==r?o.widget.compare(e):o.widget.constructor==e.constructor&&e.updateDOM(o.dom,this.view,o.widget)))return n.splice(s,1),s<this.index[0]&&this.index[0]--,o.widget==e&&o.length==t&&(497&o.flags)==i?(this.reused.set(o,1),o):(this.reused.set(o,2),new ft(o.dom,t,e,-498&o.flags|i))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,t=2){if(!this.reused.has(e))return this.reused.set(e,t),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class xt{constructor(e,t,i,s,r){this.view=e,this.decorations=s,this.disallowBlockEffectsFor=r,this.openWidget=!1,this.openMarks=0,this.cache=new St(e),this.text=new Ct(e.state.doc),this.builder=new bt(this.cache,new ct(e,e.contentDOM),n.om.iter(i)),this.cache.reused.set(t,2),this.old=new yt(t),this.reuseWalker={skip:(e,t,i)=>{if(this.cache.add(e),e.isComposite())return!1},enter:e=>this.cache.add(e),leave:()=>{},break:()=>{}}}run(e,t){let i=t&&this.getCompositionContext(t.text);for(let n=0,s=0,r=0;;){let o=r<e.length?e[r++]:null,a=o?o.fromA:this.old.root.length;if(a>n){let e=a-n;this.preserve(e,!r,!o),n=a,s+=e}if(!o)break;t&&o.fromA<=t.range.fromA&&o.toA>=t.range.toA?(this.forward(o.fromA,t.range.fromA,t.range.fromA<t.range.toA?1:-1),this.emit(s,t.range.fromB),this.builder.flushBuffer(),this.cache.clear(),this.builder.addComposition(t,i),this.text.skip(t.range.toB-t.range.fromB),this.forward(t.range.fromA,o.toA),this.emit(t.range.toB,o.toB)):(this.forward(o.fromA,o.toA),this.emit(s,o.toB)),s=o.toB,n=o.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,i){let n=function(e){let t=[];for(let i=e.parents.length;i>1;i--){let n=i==e.parents.length?e.tile:e.parents[i].tile;n instanceof pt&&t.push(n.mark)}return t}(this.old),s=this.openMarks;this.old.advance(e,i?1:-1,{skip:(e,t,i)=>{if(e.isWidget())if(this.openWidget)this.builder.continueWidget(i-t);else{let r=i>0||t<e.length?ft.of(e.widget,this.view,i-t,496&e.flags,this.cache.maybeReuse(e)):this.cache.reuse(e);256&r.flags?(r.flags&=-2,this.builder.addBlockWidget(r)):(this.builder.ensureLine(null),this.builder.addInlineWidget(r,n,s),s=n.length)}else if(e.isText())this.builder.ensureLine(null),t||i!=e.length||this.cache.reused.has(e)?(this.cache.add(e),this.builder.addText(e.text.slice(t,i),n,s)):this.builder.addText(e.text,n,s,this.cache.reuse(e)),s=n.length;else if(e.isLine())e.flags&=-2,this.cache.reused.set(e,1),this.builder.addLine(e);else if(e instanceof mt)this.cache.add(e);else{if(!(e instanceof pt))return!1;this.builder.ensureLine(null),this.builder.addMark(e,n,s),this.cache.reused.set(e,1),s=n.length}this.openWidget=!1},enter:e=>{e.isLine()?this.builder.addLineStart(e.attrs,this.cache.maybeReuse(e)):(this.cache.add(e),e instanceof pt&&n.unshift(e.mark)),this.openWidget=!1},leave:e=>{e.isLine()?n.length&&(n.length=s=0):e instanceof pt&&(n.shift(),s=Math.min(s,n.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let i=null,s=this.builder,r=-1,o=n.om.spans(this.decorations,e,t,{point:(e,t,n,o,a,l)=>{if(n instanceof I){if(this.disallowBlockEffectsFor[l]){if(n.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.view.state.doc.lineAt(e).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(r=o.length,a>o.length)s.continueWidget(t-e);else{let r=n.widget||(n.block?Tt.block:Tt.inline),l=function(e){let t=e.isReplace?(e.startSide<0?64:0)|(e.endSide>0?128:0):e.startSide>0?32:16;return e.block&&(t|=256),t}(n),c=this.cache.findWidget(r,t-e,l)||ft.of(r,this.view,t-e,l);n.block?(n.startSide>0&&s.addLineStartIfNotCovered(i),s.addBlockWidget(c)):(s.ensureLine(i),s.addInlineWidget(c,o,a))}i=null}else i=function(e,t){let i=t.spec.attributes,n=t.spec.class;return i||n?(e||(e={class:"cm-line"}),i&&b(i,e),n&&(e.class+=" "+n),e):e}(i,n);t>e&&this.text.skip(t-e)},span:(e,t,n,o)=>{for(let r=e;r<t;){let a=this.text.next(Math.min(512,t-r));null==a?(s.addLineStartIfNotCovered(i),s.addBreak(),r++):(s.ensureLine(i),s.addText(a,n,r==e?o:n.length),r+=a.length),i=null}r=n.length}});r>-1&&(this.openWidget=o>r),this.openWidget||s.addLineStartIfNotCovered(i),this.openMarks=o}forward(e,t,i=1){t-e<=10?this.old.advance(t-e,i,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,i,this.reuseWalker))}getCompositionContext(e){let t=[],i=null;for(let n=e.parentNode;;n=n.parentNode){let e=ot.get(n);if(n==this.view.contentDOM)break;e instanceof pt?t.push(e):(null==e?void 0:e.isLine())?i=e:e instanceof ht||("DIV"!=n.nodeName||i?i||t.push(pt.of(new T({tagName:n.nodeName.toLowerCase(),attributes:x(n)}),n)):i=new ut(n,At))}return i?{line:i,marks:t}:null}}function Et(e,t){let i=e=>{for(let n of e.children)if((t?n.isText():n.length)||i(n))return!0;return!1};return i(e)}const At={class:"cm-line"};function Mt(e){let t=ot.get(e);return t&&t.setDOM(e.cloneNode()),e}class Tt extends E{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Tt.inline=new Tt("span"),Tt.block=new Tt("div");const Dt=new class extends E{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class It{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=M.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new ct(e,e.contentDOM),this.updateInner([new nt(0,0,0,e.state.doc.length)],null)}update(e){var t;let i=e.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:e,toA:t})=>t<this.minWidthFrom||e>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let s=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&((null===(t=this.domChanged)||void 0===t?void 0:t.newSel)?s=this.domChanged.newSel.head:function(e,t){let i=!1;return t&&e.iterChangedRanges((e,n)=>{e<t.to&&n>t.from&&(i=!0)}),i}(e.changes,this.hasComposition)||e.selectionSet||(s=e.state.selection.main.head));let r=s>-1?function(e,t,i){let n=kt(e,i);if(!n)return null;let{node:s,from:r,to:o}=n,a=s.nodeValue;if(/[\n\r]/.test(a))return null;if(e.state.doc.sliceString(n.from,n.to)!=a)return null;let l=t.invertedDesc;return{range:new nt(l.mapPos(r),l.mapPos(o),r,o),text:s}}(this.view,e.changes,s):null;if(this.domChanged=null,this.hasComposition){let{from:t,to:n}=this.hasComposition;i=new nt(t,n,e.changes.mapPos(t,-1),e.changes.mapPos(n,1)).addToSet(i.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(v.ie||v.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,a=this.blockWrappers;this.updateDeco();let l=function(e,t,i){let s=new Pt;return n.om.compare(e,t,i,s),s.changes}(o,this.decorations,e.changes);l.length&&(i=nt.extendWithRanges(i,l));let c=function(e,t,i){let s=new _t;return n.om.compare(e,t,i,s),s.changes}(a,this.blockWrappers,e.changes);return c.length&&(i=nt.extendWithRanges(i,c)),r&&!i.some(e=>e.fromA<=r.range.fromA&&e.toA>=r.range.toA)&&(i=r.range.addToSet(i.slice())),!(2&this.tile.flags&&0==i.length||(this.updateInner(i,r),e.transactions.length&&(this.lastUpdate=Date.now()),0))}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:i}=this.view;i.ignore(()=>{if(t||e.length){let i=this.tile,n=new xt(this.view,i,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&&ot.get(t.text)&&n.cache.reused.set(ot.get(t.text),2),this.tile=n.run(e,t),Rt(i,n.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let n=v.chrome||v.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(n),!n||!n.written&&i.selectionRange.focusNode==n.node&&this.tile.dom.contains(n.node)||(this.forceSelection=!0),this.tile.dom.style.height=""});let n=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let e of this.tile.children)e.isWidget()&&e.widget instanceof Lt&&n.push(e.dom);i.updateGaps(n)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let e of t.effects)e.is(Be)&&(this.editContextFormatting=e.value)}updateSelection(e=!1,t=!1){!e&&this.view.observer.selectionRange.focusNode||this.view.observer.readSelectionRange();let{dom:i}=this.tile,n=this.view.root.activeElement,s=n==i,r=!s&&!(this.view.state.facet(He)||i.tabIndex>-1)&&F(i,this.view.observer.selectionRange)&&!(n&&i.contains(n));if(!(s||t||r))return;let o=this.forceSelection;this.forceSelection=!1;let a,l,c=this.view.state.selection.main;if(c.empty?l=a=this.inlineDOMNearPos(c.anchor,c.assoc||1):(l=this.inlineDOMNearPos(c.head,c.head==c.from?1:-1),a=this.inlineDOMNearPos(c.anchor,c.anchor==c.from?1:-1)),v.gecko&&c.empty&&!this.hasComposition&&_((h=a).node)&&h.node.firstChild&&(0==h.offset||"false"==h.node.childNodes[h.offset-1].contentEditable)&&(h.offset==h.node.childNodes.length||"false"==h.node.childNodes[h.offset].contentEditable)){let e=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(e,a.node.childNodes[a.offset]||null)),a=l=new re(e,0),o=!0}var h;let u=this.view.observer.selectionRange;!o&&u.focusNode&&(B(a.node,a.offset,u.anchorNode,u.anchorOffset)&&B(l.node,l.offset,u.focusNode,u.focusOffset)||this.suppressWidgetCursorChange(u,c))||(this.view.observer.ignore(()=>{v.android&&v.chrome&&i.contains(u.focusNode)&&function(e,t){for(let i=e;i&&i!=t;i=i.assignedSlot||i.parentNode)if(_(i)&&"false"==i.contentEditable)return!0;return!1}(u.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let e=N(this.view.root);if(e)if(c.empty){if(v.gecko){let e=(t=a.node,s=a.offset,_(t)?(s&&"false"==t.childNodes[s-1].contentEditable?1:0)|(s<t.childNodes.length&&"false"==t.childNodes[s].contentEditable?2:0):0);if(e&&3!=e){let t=(1==e?ne:se)(a.node,a.offset);t&&(a=new re(t.node,t.offset))}}e.collapse(a.node,a.offset),null!=c.bidiLevel&&void 0!==e.caretBidiLevel&&(e.caretBidiLevel=c.bidiLevel)}else if(e.extend){e.collapse(a.node,a.offset);try{e.extend(l.node,l.offset)}catch(e){}}else{let t=document.createRange();c.anchor>c.head&&([a,l]=[l,a]),t.setEnd(l.node,l.offset),t.setStart(a.node,a.offset),e.removeAllRanges(),e.addRange(t)}var t,s;r&&this.view.root.activeElement==i&&(i.blur(),n&&n.focus())}),this.view.observer.setSelectionRange(a,l)),this.impreciseAnchor=a.precise?null:new re(u.anchorNode,u.anchorOffset),this.impreciseHead=l.precise?null:new re(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&B(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,i=N(e.root),{anchorNode:n,anchorOffset:s}=e.observer.selectionRange;if(!(i&&t.empty&&t.assoc&&i.modify))return;let r=this.lineAt(t.head,t.assoc);if(!r)return;let o=r.posAtStart;if(t.head==o||t.head==o+r.length)return;let a=this.coordsAt(t.head,-1),l=this.coordsAt(t.head,1);if(!a||!l||a.bottom>l.top)return;let c=this.domAtPos(t.head+t.assoc,t.assoc);i.collapse(c.node,c.offset),i.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let h=e.observer.selectionRange;e.docView.posFromDOM(h.anchorNode,h.anchorOffset)!=t.from&&i.collapse(n,s)}posFromDOM(e,t){let i=this.tile.nearest(e);if(!i)return 2&this.tile.dom.compareDocumentPosition(e)?0:this.view.state.doc.length;let n=i.posAtStart;if(!i.isComposite())return i.isText()?e==i.dom?n+t:n+(t?i.length:0):n;{let s;if(e==i.dom)s=i.dom.childNodes[t];else{let n=0==z(e)?0:0==t?-1:1;for(;;){let t=e.parentNode;if(t==i.dom)break;0==n&&t.firstChild!=t.lastChild&&(n=e==t.firstChild?-1:1),e=t}s=n<0?e:e.nextSibling}if(s==i.dom.firstChild)return n;for(;s&&!ot.get(s);)s=s.nextSibling;if(!s)return n+i.length;for(let e=0,t=n;;e++){let n=i.children[e];if(n.dom==s)return t;t+=n.length+n.breakAfter}}}domAtPos(e,t){let{tile:i,offset:n}=this.tile.resolveBlock(e,t);return i.isWidget()?i.domPosFor(n,t):i.domIn(n,t)}inlineDOMNearPos(e,t){let i,n,s=-1,r=!1,o=-1,a=!1;return this.tile.blockTiles((t,l)=>{if(t.isWidget()){if(32&t.flags&&l>=e)return!0;16&t.flags&&(r=!0)}else{let c=l+t.length;if(l<=e&&(i=t,s=e-l,r=c<e),c>=e&&!n&&(n=t,o=e-l,a=l>e),l>e&&n)return!0}}),i||n?(r&&n?i=null:a&&i&&(n=null),i&&t<0||!n?i.domIn(s,t):n.domIn(o,t)):this.domAtPos(e,t)}coordsAt(e,t,i){let{tile:n,offset:s}=this.tile.resolveBlock(e,t);return n.isWidget()?n.widget instanceof Lt?null:n.coordsInWidget(s,t,!0):n.coordsIn(s,t,i)}lineAt(e,t){let{tile:i}=this.tile.resolveBlock(e,t);return i.isLine()?i:null}coordsForChar(e){let{tile:t,offset:i}=this.tile.resolveBlock(e,1);return t.isLine()?function e(t,i){if(t.isComposite())for(let n of t.children){if(n.length>=i){let t=e(n,i);if(t)return t}if((i-=n.length)<0)break}else if(t.isText()&&i<t.length){let e=(0,n.zK)(t.text,i);if(e==i)return null;let s=ee(t.dom,i,e).getClientRects();for(let e=0;e<s.length;e++){let t=s[e];if(e==s.length-1||t.top<t.bottom&&t.left<t.right)return t}}return null}(t,i):null}measureVisibleLineHeights(e){let t=[],{from:i,to:n}=e,s=this.view.contentDOM.clientWidth,r=s>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=-1,a=this.view.textDirection==oe.LTR,l=0,c=(e,h,u)=>{for(let d=0;d<e.children.length&&!(h>n);d++){let n=e.children[d],p=h+n.length,g=n.dom.getBoundingClientRect(),{height:f}=g;if(u&&!d&&(l+=g.top-u.top),n instanceof ht)p>i&&c(n,h,g);else if(h>=i&&(l>0&&t.push(-l),t.push(f+l),l=0,r)){let e=n.dom.lastChild,t=e?G(e):[];if(t.length){let e=t[t.length-1],i=a?e.right-g.left:g.right-e.left;i>o&&(o=i,this.minWidth=s,this.minWidthFrom=h,this.minWidthTo=p)}}u&&d==e.children.length-1&&(l+=u.bottom-g.bottom),h=p+n.breakAfter}};return c(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return"rtl"==getComputedStyle(t.dom).direction?oe.RTL:oe.LTR}measureTextSize(){let e=this.tile.blockTiles(e=>{if(e.isLine()&&e.children.length&&e.length<=20){let t,i=0;for(let n of e.children){if(!n.isText()||/[^ -~]/.test(n.text))return;let e=G(n.dom);if(1!=e.length)return;i+=e[0].width,t=e[0].height}if(i)return{lineHeight:e.dom.getBoundingClientRect().height,charWidth:i/e.length,textHeight:t}}});if(e)return e;let t,i,n,s=document.createElement("div");return s.className="cm-line",s.style.width="99999px",s.style.position="absolute",s.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(s);let e=G(s.firstChild)[0];t=s.getBoundingClientRect().height,i=e&&e.width?e.width/27:7,n=e&&e.height?e.height:t,s.remove()}),{lineHeight:t,charWidth:i,textHeight:n}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,n=0;;n++){let s=n==t.viewports.length?null:t.viewports[n],r=s?s.from-1:this.view.state.doc.length;if(r>i){let n=(t.lineBlockAt(r).bottom-t.lineBlockAt(i).top)/this.view.scaleY;e.push(M.replace({widget:new Lt(n),block:!0,inclusive:!0,isBlockGap:!0}).range(i,r))}if(!s)break;i=s.to+1}return M.set(e)}updateDeco(){let e=1,t=this.view.state.facet(Ye).map(t=>(this.dynamicDecorationMap[e++]="function"==typeof t)?t(this.view):t),i=!1,s=this.view.state.facet(Xe).map((e,t)=>{let n="function"==typeof e;return n&&(i=!0),n?e(this.view):e});for(s.length&&(this.dynamicDecorationMap[e++]=i,t.push(n.om.join(s))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(qe).map(e=>"function"==typeof e?e(this.view):e)}scrollIntoView(e){if(e.isSnapshot){let t=this.view.viewState.lineBlockAt(e.range.head);return this.view.scrollDOM.scrollTop=t.top-e.yMargin,void(this.view.scrollDOM.scrollLeft=e.xMargin)}for(let t of this.view.state.facet(Oe))try{if(t(this.view,e.range,e))return!0}catch(e){Ve(this.view.state,e,"scroll handler")}let t,{range:i}=e,n=this.coordsAt(i.head,i.assoc||(i.head>i.anchor?-1:1));if(!n)return;!i.empty&&(t=this.coordsAt(i.anchor,i.anchor>i.head?-1:1))&&(n={left:Math.min(n.left,t.left),top:Math.min(n.top,t.top),right:Math.max(n.right,t.right),bottom:Math.max(n.bottom,t.bottom)});let s=tt(this.view),r={left:n.left-s.left,top:n.top-s.top,right:n.right+s.right,bottom:n.bottom+s.bottom},{offsetWidth:o,offsetHeight:a}=this.view.scrollDOM;if(function(e,t,i,n,s,r,o,a){let l=e.ownerDocument,c=l.defaultView||window;for(let h=e,u=!1;h&&!u;)if(_(h)){let e,d=h==l.body,p=1,g=1;if(d)e=j(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(u=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let t=h.getBoundingClientRect();({scaleX:p,scaleY:g}=$(h,t)),e={left:t.left,right:t.left+h.clientWidth*p,top:t.top,bottom:t.top+h.clientHeight*g}}let f=0,m=0;if("nearest"==s)t.top<e.top+o?(m=t.top-(e.top+o),i>0&&t.bottom>e.bottom+m&&(m=t.bottom-e.bottom+o)):t.bottom>e.bottom-o&&(m=t.bottom-e.bottom+o,i<0&&t.top-m<e.top&&(m=t.top-(e.top+o)));else{let n=t.bottom-t.top,r=e.bottom-e.top;m=("center"==s&&n<=r?t.top+n/2-r/2:"start"==s||"center"==s&&i<0?t.top-o:t.bottom-r+o)-e.top}if("nearest"==n?t.left<e.left+r?(f=t.left-(e.left+r),i>0&&t.right>e.right+f&&(f=t.right-e.right+r)):t.right>e.right-r&&(f=t.right-e.right+r,i<0&&t.left<e.left+f&&(f=t.left-(e.left+r))):f=("center"==n?t.left+(t.right-t.left)/2-(e.right-e.left)/2:"start"==n==a?t.left-r:t.right-(e.right-e.left)+r)-e.left,f||m)if(d)c.scrollBy(f,m);else{let e=0,i=0;if(m){let e=h.scrollTop;h.scrollTop+=m/g,i=(h.scrollTop-e)*g}if(f){let t=h.scrollLeft;h.scrollLeft+=f/p,e=(h.scrollLeft-t)*p}t={left:t.left-e,top:t.top-i,right:t.right-e,bottom:t.bottom-i},e&&Math.abs(e-f)<1&&(n="nearest"),i&&Math.abs(i-m)<1&&(s="nearest")}if(d)break;(t.top<e.top||t.bottom>e.bottom||t.left<e.left||t.right>e.right)&&(t={left:Math.max(t.left,e.left),right:Math.min(t.right,e.right),top:Math.max(t.top,e.top),bottom:Math.min(t.bottom,e.bottom)}),h=h.assignedSlot||h.parentNode}else{if(11!=h.nodeType)break;h=h.host}}(this.view.scrollDOM,r,i.head<i.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,o),-o),Math.max(Math.min(e.yMargin,a),-a),this.view.textDirection==oe.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(n.top>window.visualViewport.offsetTop+window.visualViewport.height||n.bottom<window.visualViewport.offsetTop)){let e=this.view.docView.lineAt(i.head,1);if(e){let t=q(e.dom);e.dom.scrollIntoView({block:"nearest"}),X(t,!1)}}}lineHasWidget(e){let t=e=>e.isWidget()||e.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){Rt(this.tile)}}function Rt(e,t){let i=null==t?void 0:t.get(e);if(1!=i){null==i&&e.destroy();for(let i of e.children)Rt(i,t)}}function kt(e,t){let i=e.observer.selectionRange;if(!i.focusNode)return null;let n=ne(i.focusNode,i.focusOffset),s=se(i.focusNode,i.focusOffset),r=n||s;if(s&&n&&s.node!=n.node){let t=ot.get(s.node);if(!t||t.isText()&&t.text!=s.node.nodeValue)r=s;else if(e.docView.lastCompositionAfterCursor){let e=ot.get(n.node);!e||e.isText()&&e.text!=n.node.nodeValue||(r=s)}}if(e.docView.lastCompositionAfterCursor=r!=n,!r)return null;let o=t-r.offset;return{from:o,to:o+r.node.nodeValue.length,node:r.node}}let Pt=class{constructor(){this.changes=[]}compareRange(e,t){k(e,t,this.changes)}comparePoint(e,t){k(e,t,this.changes)}boundChange(e){k(e,e,this.changes)}};class _t{constructor(){this.changes=[]}compareRange(e,t){k(e,t,this.changes)}comparePoint(){}boundChange(e){k(e,e,this.changes)}}class Lt extends E{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function Nt(e,t,i){let n=e.lineBlockAt(t);if(Array.isArray(n.type)){let e;for(let s of n.type){if(s.from>t)break;if(!(s.to<t)){if(s.from<t&&s.to>t)return s;e&&(s.type!=A.Text||e.type==s.type&&!(i<0?s.from<t:s.to>t))||(e=s)}}return e||n}return n}function Ot(e,t,i,s){let r=e.state.doc.lineAt(t.head),o=e.bidiSpans(r),a=e.textDirectionAt(r.from);for(let l=t,c=null;;){let t=xe(r,o,a,l,i),h=Se;if(!t){if(r.number==(i?e.state.doc.lines:1))return l;h="\n",r=e.state.doc.line(r.number+(i?1:-1)),o=e.bidiSpans(r),t=i?n.OF.cursor(r.from,-1):n.OF.cursor(r.to,1)}if(c){if(!c(h))return l}else{if(!s)return t;c=s(h)}l=t}}function Ft(e,t,i){for(;;){let n=0;for(let s of e)s.between(t-1,t+1,(e,s,r)=>{if(t>e&&t<s){let r=n||i||(t-e<s-t?-1:1);t=r<0?e:s,n=r}});if(!n)return t}}function Gt(e,t){let i=null;for(let s=0;s<t.ranges.length;s++){let r=t.ranges[s],o=null;if(r.empty){let t=Ft(e,r.from,0);t!=r.from&&(o=n.OF.cursor(t,-1))}else{let t=Ft(e,r.from,-1),i=Ft(e,r.to,1);t==r.from&&i==r.to||(o=r.undirectional?n.OF.undirectionalRange(r.from,r.to):n.OF.range(r.from==r.anchor?t:i,r.from==r.head?t:i))}o&&(i||(i=t.ranges.slice()),i[s]=o)}return i?n.OF.create(i,t.mainIndex):t}function Bt(e,t,i){let s=Ft(e.state.facet(Ze).map(t=>t(e)),i.from,t.head>i.from?-1:1);return s==i.from?i:n.OF.cursor(s,s<i.from?1:-1)}class Vt{constructor(e,t){this.pos=e,this.assoc=t}}function Ht(e,t,i,s){let r,o=e.contentDOM.getBoundingClientRect(),a=o.top+e.viewState.paddingTop,{x:l,y:c}=t,h=c-a;for(;;){if(h<0)return new Vt(0,1);if(h>e.viewState.docHeight)return new Vt(e.state.doc.length,-1);if(r=e.elementAtHeight(h),null==s)break;if(r.type==A.Text){if(s<0?r.to<e.viewport.from:r.from>e.viewport.to)break;let t=e.docView.coordsAt(s<0?r.from:r.to,s>0?-1:1);if(t&&(s<0?t.top<=h+a:t.bottom>=h+a))break}let t=e.viewState.heightOracle.textHeight/2;h=s>0?r.bottom+t:r.top-t}if(e.viewport.from>=r.to||e.viewport.to<=r.from){if(i)return null;if(r.type==A.Text){let t=function(e,t,i,s,r){let o=Math.round((s-t.left)*e.defaultCharacterWidth);if(e.lineWrapping&&i.height>1.5*e.defaultLineHeight){let t=e.viewState.heightOracle.textHeight;o+=Math.floor((r-i.top-.5*(e.defaultLineHeight-t))/t)*e.viewState.heightOracle.lineLength}let a=e.state.sliceDoc(i.from,i.to);return i.from+(0,n.kn)(a,o,e.state.tabSize)}(e,o,r,l,c);return new Vt(t,t==r.from?1:-1)}}if(r.type!=A.Text)return h<(r.top+r.bottom)/2?new Vt(r.from,1):new Vt(r.to,-1);let u=e.docView.lineAt(r.from,2);return u&&u.length==r.length||(u=e.docView.lineAt(r.from,-2)),new Ut(e,l,c,e.textDirectionAt(r.from)).scanTile(u,r.from)}class Ut{constructor(e,t,i,n){this.view=e,this.x=t,this.y=i,this.baseDir=n,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:i,spans:n}=this.bidiSpansAt(e);return n[me.find(n,e-i.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:i,spans:n}=this.bidiSpansAt(e);return n[me.find(n,e-i.from,-1,t)].dir}bidiIn(e,t){let{spans:i,line:n}=this.bidiSpansAt(e);return i.length>1||i.length&&(i[0].level!=this.baseDir||i[0].to+n.from<t)}scan(e,t,i=!1){let n,s,r,o=0,a=e.length-1,l=new Set,c=this.bidiIn(e[0],e[a]),h=-1,u=1e9;e:for(;o<a;){let i=a-o,d=o+a>>1;t:if(l.has(d)){for(let e=1;e<i;e++){let t=d+e;if(t>=a&&(t-=i),!l.has(t)){d=t;break t}}break e}l.add(d);let p=t(d),g=0;if(p)for(let e=0;e<p.length;e++){let t=p[e];if(!(0==t.width&&p.length>1))if(t.bottom<this.y)(!n||n.bottom<t.bottom)&&(n=t),g=1;else if(t.top>this.y)(!s||s.top>t.top)&&(s=t),g=-1;else{let e=t.left>this.x?this.x-t.left:t.right<this.x?this.x-t.right:0,i=Math.abs(e);i<u&&(h=d,u=i,r=t),e&&(g=e<0==(this.baseDir==oe.LTR)?-1:1)}}-1!=g||c&&!this.baseDirAt(e[d],1)?1!=g||c&&!this.baseDirAt(e[d+1],-1)||(o=d+1):a=d}if(!r){if(!s&&!n)return{i:0,after:!1};let i=n&&(!s||this.y-n.bottom<s.top-this.y)?n:s;return this.y=(i.top+i.bottom)/2,this.scan(e,t,!0)}if(u&&!i){let{top:i,bottom:o}=r;if(n&&n.bottom>(i+i+o)/3)return this.y=n.bottom-1,this.scan(e,t,!0);if(s&&s.top<(i+o+o)/3)return this.y=s.top+1,this.scan(e,t,!0)}let d=(c?this.dirAt(e[h],1):this.baseDir)==oe.LTR;return{i:h,after:this.x>(r.left+r.right)/2==d}}scanText(e,t){let i=[];for(let s=0;s<e.length;s=(0,n.zK)(e.text,s))i.push(t+s);i.push(t+e.length);let s=this.scan(i,n=>{let s=i[n]-t,r=i[n+1]-t;return ee(e.dom,s,r).getClientRects()});return s.after?new Vt(i[s.i+1],-1):new Vt(i[s.i],1)}scanTile(e,t){if(!e.length)return new Vt(t,1);if(1==e.children.length){let i=e.children[0];if(i.isText())return this.scanText(i,t);if(i.isComposite())return this.scanTile(i,t)}let i=[t];for(let n=0,s=t;n<e.children.length;n++)i.push(s+=e.children[n].length);let n=this.scan(i,t=>{let i=e.children[t];return 48&i.flags?null:(_(i.dom)?i.dom:ee(i.dom,0,i.length)).getClientRects()}),s=e.children[n.i],r=i[n.i];return s.isText()?this.scanText(s,r):s.isComposite()?this.scanTile(s,r):n.after?new Vt(i[n.i+1],-1):new Vt(r,1)}}const zt="￿";class Wt{constructor(e,t){this.points=e,this.view=t,this.text="",this.lineSeparator=t.state.facet(n.$t.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=zt}readRange(e,t){if(!e)return this;let i=e.parentNode;for(let n=e;;){this.findPointBefore(i,n);let e=this.text.length;this.readNode(n);let s=ot.get(n),r=n.nextSibling;if(r==t){(null==s?void 0:s.breakAfter)&&!r&&i!=this.view.contentDOM&&this.lineBreak();break}let o=ot.get(r);(s&&o?s.breakAfter:(s?s.breakAfter:H(n))||H(r)&&("BR"!=n.nodeName||(null==s?void 0:s.isWidget()))&&this.text.length>e)&&!$t(r,t)&&this.lineBreak(),n=r}return this.findPointBefore(i,t),this}readTextNode(e){let t=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,t.length));for(let i=0,n=this.lineSeparator?null:/\r\n?|\n/g;;){let s,r=-1,o=1;if(this.lineSeparator?(r=t.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(s=n.exec(t))&&(r=s.index,o=s[0].length),this.append(t.slice(i,r<0?t.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=o-1);i=r+o}}readNode(e){let t=ot.get(e),i=t&&t.overrideDOMText;if(null!=i){this.findPointInside(e,i.length);for(let e=i.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else L(e)?this.readTextNode(e):"BR"==e.nodeName?e.nextSibling&&this.lineBreak():_(e)&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}findPointInside(e,t){for(let i of this.points)(L(e)?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(jt(e,i.node,i.offset)?t:0))}}function jt(e,t,i){for(;;){if(!t||i<z(t))return!1;if(t==e)return!0;i=V(t)+1,t=t.parentNode}}function $t(e,t){let i;for(;e!=t&&e;e=e.nextSibling){let t=ot.get(e);if(!(null==t?void 0:t.isWidget()))return!1;t&&(i||(i=[])).push(t)}if(i)for(let e of i){let t=e.overrideDOMText;if(null==t?void 0:t.length)return!1}return!0}class Kt{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class Yt{constructor(e,t,i,s){this.typeOver=s,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:r,impreciseAnchor:o}=e.docView,a=e.state.selection;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=qt(e.docView.tile,t,i,0))){let t=r||o?[]:function(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:i,anchorOffset:n,focusNode:s,focusOffset:r}=e.observer.selectionRange;return i&&(t.push(new Kt(i,n)),s==i&&r==n||t.push(new Kt(s,r))),t}(e),i=new Wt(t,e);i.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=i.text,this.newSel=function(e,t){if(0==e.length)return null;let i=e[0].pos,s=2==e.length?e[1].pos:i;return i<0||s<0?null:i==s?n.OF.create([n.OF.cursor(s+t,-1)]):n.OF.single(i+t,s+t)}(t,this.bounds.from)}else{let t=e.observer.selectionRange,i=r&&r.node==t.focusNode&&r.offset==t.focusOffset||!O(e.contentDOM,t.focusNode)?a.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),s=o&&o.node==t.anchorNode&&o.offset==t.anchorOffset||!O(e.contentDOM,t.anchorNode)?a.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),l=e.viewport;if((v.ios||v.chrome)&&i!=s&&Math.min(i,s)<=a.main.from&&Math.max(i,s)>=a.main.to&&(l.from>0||l.to<e.state.doc.length)){let t=Math.min(i,s),n=Math.max(i,s),r=l.from-t,o=l.to-n;0!=r&&1!=r&&0!=t||0!=o&&-1!=o&&n!=e.state.doc.length||(i=0,s=e.state.doc.length)}if(e.inputState.composing>-1&&a.ranges.length>1)this.newSel=a.replaceRange(n.OF.range(s,i));else if(e.lineWrapping&&s==i&&(!a.main.empty||a.main.head!=i)&&e.inputState.lastTouchTime>Date.now()-100){let t=e.coordsAtPos(i,-1),s=0;t&&(s=e.inputState.lastTouchY<=t.bottom?-1:1),this.newSel=n.OF.create([n.OF.cursor(i,s)])}else this.newSel=n.OF.single(s,i)}}}function qt(e,t,i,n){if(e.isComposite()){let s=-1,r=-1,o=-1,a=-1;for(let l=0,c=n,h=n;l<e.children.length;l++){let n=e.children[l],u=c+n.length;if(c<t&&u>i)return qt(n,t,i,c);if(u>=t&&-1==s&&(s=l,r=c),c>i&&n.dom.parentNode==e.dom){o=l,a=h;break}h=u,c=u+n.breakAfter}return{from:r,to:a<0?n+e.length:a,startDOM:(s?e.children[s-1].dom.nextSibling:null)||e.dom.firstChild,endDOM:o<e.children.length&&o>=0?e.children[o].dom:null}}return e.isText()?{from:n,to:n+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling}:null}function Xt(e,t){let i,{newSel:s}=t,{state:r}=e,o=r.selection.main,a=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:e,to:s}=t.bounds,l=o.from,c=null;(8===a||v.android&&t.text.length<s-e)&&(l=o.to,c="end");let h,u,d=r.doc.sliceString(e,s,zt);!o.empty&&o.from>=e&&o.to<=s&&(t.typeOver||d!=t.text)&&d.slice(0,o.from-e)==t.text.slice(0,o.from-e)&&d.slice(o.to-e)==t.text.slice(h=t.text.length-(d.length-(o.to-e)))?i={from:o.from,to:o.to,insert:n.EY.of(t.text.slice(o.from-e,h).split(zt))}:(u=Qt(d,t.text,l-e,c))&&(v.chrome&&13==a&&u.toB==u.from+2&&t.text.slice(u.from,u.toB)==zt+zt&&u.toB--,i={from:e+u.from,to:e+u.toA,insert:n.EY.of(t.text.slice(u.from,u.toB).split(zt))})}else s&&(!e.hasFocus&&r.facet(He)||Jt(s,o))&&(s=null);if(!i&&!s)return!1;if((v.mac||v.android)&&i&&i.from==i.to&&i.from==o.head-1&&/^\. ?$/.test(i.insert.toString())&&"off"==e.contentDOM.getAttribute("autocorrect")?(s&&2==i.insert.length&&(s=n.OF.single(s.main.anchor-1,s.main.head-1)),i={from:i.from,to:i.to,insert:n.EY.of([i.insert.toString().replace("."," ")])}):r.doc.lineAt(o.from).to<o.to&&e.docView.lineHasWidget(o.to)&&e.inputState.insertingTextAt>Date.now()-50?i={from:o.from,to:o.to,insert:r.toText(e.inputState.insertingText)}:v.chrome&&i&&i.from==i.to&&i.from==o.head&&"\n "==i.insert.toString()&&e.lineWrapping&&(s&&(s=n.OF.single(s.main.anchor-1,s.main.head-1)),i={from:o.from,to:o.to,insert:n.EY.of([" "])}),i)return Zt(e,i,s,a);if(s&&!Jt(s,o)){let t=!1,i="select";return e.inputState.lastSelectionTime>Date.now()-50&&("select"==e.inputState.lastSelectionOrigin&&(t=!0),i=e.inputState.lastSelectionOrigin,"select.pointer"==i&&(s=Gt(r.facet(Ze).map(t=>t(e)),s))),e.dispatch({selection:s,scrollIntoView:t,userEvent:i}),!0}return!1}function Zt(e,t,i,s=-1){if(v.ios&&e.inputState.flushIOSKey(t))return!0;let r=e.state.selection.main;if(v.android&&(t.to==r.to&&(t.from==r.from||t.from==r.from-1&&" "==e.state.sliceDoc(t.from,r.from))&&1==t.insert.length&&2==t.insert.lines&&te(e.contentDOM,"Enter",13)||(t.from==r.from-1&&t.to==r.to&&0==t.insert.length||8==s&&t.insert.length<t.to-t.from&&t.to>r.head)&&te(e.contentDOM,"Backspace",8)||t.from==r.from&&t.to==r.to+1&&0==t.insert.length&&te(e.contentDOM,"Delete",46)))return!0;let o,a=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let l=()=>o||(o=function(e,t,i){let s,r=e.state,o=r.selection.main,a=-1;if(t.from==t.to&&t.from<o.from||t.from>o.to){let i=t.from<o.from?-1:1,n=i<0?o.from:o.to,s=Ft(r.facet(Ze).map(t=>t(e)),n,i);t.from==s&&(a=s)}if(a>-1)s={changes:t,selection:n.OF.cursor(t.from+t.insert.length,-1)};else if(t.from>=o.from&&t.to<=o.to&&t.to-t.from>=(o.to-o.from)/3&&(!i||i.main.empty&&i.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let i=o.from<t.from?r.sliceDoc(o.from,t.from):"",n=o.to>t.to?r.sliceDoc(t.to,o.to):"";s=r.replaceSelection(e.state.toText(i+t.insert.sliceString(0,void 0,e.state.lineBreak)+n))}else{let a=r.changes(t),l=i&&i.main.to<=a.newLength?i.main:void 0;if(r.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=o.to+10&&t.to>=o.to-10){let c,h=e.state.sliceDoc(t.from,t.to),u=i&&kt(e,i.main.head);if(u){let e=t.insert.length-(t.to-t.from);c={from:u.from,to:u.to-e}}else c=e.state.doc.lineAt(o.head);let d=o.to-t.to;s=r.changeByRange(i=>{if(i.from==o.from&&i.to==o.to)return{changes:a,range:l||i.map(a)};let s=i.to-d,u=s-h.length;if(e.state.sliceDoc(u,s)!=h||s>=c.from&&u<=c.to)return{range:i};let p=r.changes({from:u,to:s,insert:t.insert}),g=i.to-o.to;return{changes:p,range:l?n.OF.range(Math.max(0,l.anchor+g),Math.max(0,l.head+g)):i.map(p)}})}else s={changes:a,selection:l&&r.selection.replaceRange(l)}}let l="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,l+=".compose",e.inputState.compositionFirstChange&&(l+=".start",e.inputState.compositionFirstChange=!1)),r.update(s,{userEvent:l,scrollIntoView:!0})}(e,t,i));return e.state.facet(Re).some(i=>i(e,t.from,t.to,a,l))||e.dispatch(l()),!0}function Qt(e,t,i,n){let s=Math.min(e.length,t.length),r=0;for(;r<s&&e.charCodeAt(r)==t.charCodeAt(r);)r++;if(r==s&&e.length==t.length)return null;let o=e.length,a=t.length;for(;o>0&&a>0&&e.charCodeAt(o-1)==t.charCodeAt(a-1);)o--,a--;return"end"==n&&(i-=o+Math.max(0,r-Math.min(o,a))-r),o<r&&e.length<t.length?(r-=i<=r&&i>=o?r-i:0,a=r+(a-o),o=r):a<r&&(r-=i<=r&&i>=a?r-i:0,o=r+(o-a),a=r),{from:r,toA:o,toB:a}}function Jt(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}class ei{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,v.safari&&e.contentDOM.addEventListener("input",()=>null),v.gecko&&function(e){Ei.has(e)||(Ei.add(e),e.addEventListener("copy",()=>{}),e.addEventListener("cut",()=>{}))}(e.contentDOM.ownerDocument)}handleEvent(e){(function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let i,n=t.target;n!=e.contentDOM;n=n.parentNode)if(!n||11==n.nodeType||(i=ot.get(n))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(t))return!1;return!0})(this.view,e)&&!this.ignoreDuringComposition(e)&&("keydown"==e.type&&this.keydown(e)||(0!=this.view.updateState?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e)))}runHandlers(e,t){let i=this.handlers[e];if(i){for(let e of i.observers)e(this.view,t);for(let e of i.handlers){if(t.defaultPrevented)break;if(e(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=ii(e),i=this.handlers,n=this.view.contentDOM;for(let e in t)if("scroll"!=e){let s=!t[e].handlers.length,r=i[e];r&&s!=!r.handlers.length&&(n.removeEventListener(e,this.handleEvent),r=null),r||n.addEventListener(e,this.handleEvent,{passive:s})}for(let e in i)"scroll"==e||t[e]||n.removeEventListener(e,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),9==e.keyCode&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&27!=e.keyCode&&ri.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),v.android&&v.chrome&&!e.synthetic&&(13==e.keyCode||8==e.keyCode))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;if(v.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&(ni.some(t=>t.keyCode==e.keyCode)&&!e.ctrlKey||si.indexOf(e.key)>-1&&e.ctrlKey)){let i={ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey,shiftKey:e.shiftKey};i.shiftKey&&v.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&(t=this.view.win).visualViewport&&t.visualViewport.height*t.visualViewport.scale/t.document.documentElement.clientHeight<.85&&(i.shiftKey=!1);let n=this.pendingIOSKey={key:e.key,keyCode:e.keyCode,mods:i};return setTimeout(()=>{this.pendingIOSKey==n&&this.flushIOSKey()},50),!0}var t;return 229!=e.keyCode&&this.view.observer.forceFlush(),!1}flushIOSKey(e){let t=this.pendingIOSKey;return!(!t||this.view.observer.pendingRecords().length)&&!("Enter"==t.key&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString()))&&(this.pendingIOSKey=void 0,te(this.view.contentDOM,t.key,t.keyCode,t.mods))}ignoreDuringComposition(e){return!(!/^key/.test(e.type)||e.synthetic)&&(this.composing>0||!!(v.safari&&!v.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100)&&(this.compositionPendingKey=!1,!0))}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function ti(e,t){return(i,n)=>{try{return t.call(e,n,i)}catch(e){Ve(i.state,e)}}}function ii(e){let t=Object.create(null);function i(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let t of e){let e=t.spec,n=e&&e.plugin.domEventHandlers,s=e&&e.plugin.domEventObservers;if(n)for(let e in n){let s=n[e];s&&i(e).handlers.push(ti(t.value,s))}if(s)for(let e in s){let n=s[e];n&&i(e).observers.push(ti(t.value,n))}}for(let e in li)i(e).handlers.push(li[e]);for(let e in ci)i(e).observers.push(ci[e]);return t}const ni=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],si="dthko",ri=[16,17,18,20,91,92,224,225];function oi(e){return.7*Math.max(0,e)+8}class ai{constructor(e,t,i,s){this.view=e,this.startEvent=t,this.style=i,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=K(e.contentDOM),this.atoms=e.state.facet(Ze).map(t=>t(e));let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(n.$t.allowMultipleSelections)&&function(e,t){let i=e.state.facet(Ae);return i.length?i[0](t):v.mac?t.metaKey:t.ctrlKey}(e,t),this.dragging=!(!function(e,t){let{main:i}=e.state.selection;if(i.empty)return!1;let n=N(e.root);if(!n||0==n.rangeCount)return!0;let s=n.getRangeAt(0).getClientRects();for(let e=0;e<s.length;e++){let i=s[e];if(i.left<=t.clientX&&i.right>=t.clientX&&i.top<=t.clientY&&i.bottom>=t.clientY)return!0}return!1}(e,t)||1!=vi(t))&&null}start(e){!1===this.dragging&&this.select(e)}move(e){if(0==e.buttons)return this.destroy();if(this.dragging||null==this.dragging&&(t=this.startEvent,i=e,Math.max(Math.abs(t.clientX-i.clientX),Math.abs(t.clientY-i.clientY))<10))return;var t,i;this.select(this.lastEvent=e);let n=0,s=0,r=0,o=0,a=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:o,bottom:l}=this.scrollParents.y.getBoundingClientRect());let c=tt(this.view);e.clientX-c.left<=r+6?n=-oi(r-e.clientX):e.clientX+c.right>=a-6&&(n=oi(e.clientX-a)),e.clientY-c.top<=o+6?s=-oi(o-e.clientY):e.clientY+c.bottom>=l-6&&(s=oi(e.clientY-l)),this.setScrollSpeed(n,s)}up(e){null==this.dragging&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),!1===this.dragging&&this.select(this.lastEvent)}select(e){let{view:t}=this,i=Gt(this.atoms,this.style.get(e,this.extend,this.multiple));!this.mustSelect&&i.eq(t.state.selection,!1===this.dragging)||this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(e=>e.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}const li=Object.create(null),ci=Object.create(null),hi=v.ie&&v.ie_version<15||v.ios&&v.webkit_version<604;function ui(e,t,i){for(let n of e.facet(t))i=n(i,e);return i}function di(e,t){t=ui(e.state,Pe,t);let i,{state:s}=e,r=1,o=s.toText(t),a=o.lines==s.selection.ranges.length;if(null!=Ci&&s.selection.ranges.every(e=>e.empty)&&Ci==o.toString()){let e=-1;i=s.changeByRange(i=>{let l=s.doc.lineAt(i.from);if(l.from==e)return{range:i};e=l.from;let c=s.toText((a?o.line(r++).text:t)+s.lineBreak);return{changes:{from:l.from,insert:c},range:n.OF.cursor(i.from+c.length,-1)}})}else i=a?s.changeByRange(e=>{let t=o.line(r++);return{changes:{from:e.from,to:e.to,insert:t.text},range:n.OF.cursor(e.from+t.length,-1)}}):s.replaceSelection(o);e.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}function pi(e,t,i,s){if(1==s)return n.OF.cursor(t,i);if(2==s)return function(e,t,i=1){let s=e.charCategorizer(t),r=e.doc.lineAt(t),o=t-r.from;if(0==r.length)return n.OF.cursor(t);0==o?i=1:o==r.length&&(i=-1);let a=o,l=o;i<0?a=(0,n.zK)(r.text,o,!1):l=(0,n.zK)(r.text,o);let c=s(r.text.slice(a,l));for(;a>0;){let e=(0,n.zK)(r.text,a,!1);if(s(r.text.slice(e,a))!=c)break;a=e}for(;l<r.length;){let e=(0,n.zK)(r.text,l);if(s(r.text.slice(l,e))!=c)break;l=e}return n.OF.undirectionalRange(a+r.from,l+r.from)}(e.state,t,i);{let s=e.docView.lineAt(t,i),r=e.state.doc.lineAt(s?s.posAtEnd:t),o=s?s.posAtStart:r.from,a=s?s.posAtEnd:r.to;return a<e.state.doc.length&&a==r.to&&a++,n.OF.undirectionalRange(o,a)}}ci.scroll=e=>{let t=e.inputState;t.lastScrollTop=e.scrollDOM.scrollTop,t.lastScrollLeft=e.scrollDOM.scrollLeft,v.ios&&!t.touchActive&&(t.lastIOSMomentumScroll=Date.now())},ci.wheel=ci.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()},li.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),27==t.keyCode&&0!=e.inputState.tabFocusMode&&(e.inputState.tabFocusMode=Date.now()+2e3),!1),ci.touchstart=(e,t)=>{let i=e.inputState,n=t.targetTouches[0];i.touchActive=!0,i.lastTouchTime=Date.now(),n&&(i.lastTouchX=n.clientX,i.lastTouchY=n.clientY),i.setSelectionOrigin("select.pointer")},ci.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")},ci.touchend=(e,t)=>{e.inputState.touchActive=!1},li.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let i=null;for(let n of e.state.facet(Te))if(i=n(e,t),i)break;if(i||0!=t.button||(i=function(e,t){let i=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),s=vi(t),r=e.state.selection;return{update(e){e.docChanged&&(i.pos=e.changes.mapPos(i.pos),r=r.map(e.changes))},get(t,o,a){let l,c=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),h=pi(e,c.pos,c.assoc,s);if(i.pos!=c.pos&&!o){let t=pi(e,i.pos,i.assoc,s),r=Math.min(t.from,h.from),o=Math.max(t.to,h.to);h=r<h.from?n.OF.range(r,o,h.assoc):n.OF.range(o,r,h.assoc)}return o?r.replaceRange(r.main.extend(h.from,h.to,h.assoc)):a&&1==s&&r.ranges.length>1&&(l=function(e,t){for(let i=0;i<e.ranges.length;i++){let{from:s,to:r}=e.ranges[i];if(s<=t&&r>=t)return n.OF.create(e.ranges.slice(0,i).concat(e.ranges.slice(i+1)),e.mainIndex==i?0:e.mainIndex-(e.mainIndex>i?1:0))}return null}(r,c.pos))?l:a?r.addRange(h):n.OF.create([h])}}}(e,t)),i){let n=!e.hasFocus;e.inputState.startMouseSelection(new ai(e,t,i,n)),n&&e.observer.ignore(()=>{J(e.contentDOM);let t=e.root.activeElement;t&&!t.contains(e.contentDOM)&&t.blur()});let s=e.inputState.mouseSelection;if(s)return s.start(t),!1===s.dragging}else e.inputState.setSelectionOrigin("select.pointer");return!1};const gi=v.ie&&v.ie_version<=11;let fi=null,mi=0,yi=0;function vi(e){if(!gi)return e.detail;let t=fi,i=yi;return fi=e,yi=Date.now(),mi=!t||i>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(mi+1)%3:1}function bi(e,t,i,n){if(!(i=ui(e.state,Pe,i)))return;let s=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:r}=e.inputState,o=n&&r&&function(e,t){let i=e.state.facet(Me);return i.length?i[0](t):v.mac?!t.altKey:!t.ctrlKey}(e,t)?{from:r.from,to:r.to}:null,a={from:s,insert:i},l=e.state.changes(o?[o,a]:a);e.focus(),e.dispatch({changes:l,selection:{anchor:l.mapPos(s,-1),head:l.mapPos(s,1)},userEvent:o?"move.drop":"input.drop"}),e.inputState.draggedContent=null}li.dragstart=(e,t)=>{let{selection:{main:i}}=e.state;if(t.target.draggable){let s=e.docView.tile.nearest(t.target);if(s&&s.isWidget()){let e=s.posAtStart,t=e+s.length;(e>=i.to||t<=i.from)&&(i=n.OF.undirectionalRange(e,t))}}let{inputState:s}=e;return s.mouseSelection&&(s.mouseSelection.dragging=!0),s.draggedContent=i,t.dataTransfer&&(t.dataTransfer.setData("Text",ui(e.state,_e,e.state.sliceDoc(i.from,i.to))),t.dataTransfer.effectAllowed="copyMove"),!1},li.dragend=e=>(e.inputState.draggedContent=null,!1),li.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let i=t.dataTransfer.files;if(i&&i.length){let n=Array(i.length),s=0,r=()=>{++s==i.length&&bi(e,t,n.filter(e=>null!=e).join(e.state.lineBreak),!1)};for(let e=0;e<i.length;e++){let t=new FileReader;t.onerror=r,t.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(n[e]=t.result),r()},t.readAsText(i[e])}return!0}{let i=t.dataTransfer.getData("Text");if(i)return bi(e,t,i,!0),!0}return!1},li.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let i=hi?null:t.clipboardData;return i?(di(e,i.getData("text/plain")||i.getData("text/uri-list")),!0):(function(e){let t=e.dom.parentNode;if(!t)return;let i=t.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus(),setTimeout(()=>{e.focus(),i.remove(),di(e,i.value)},50)}(e),!1)};let Ci=null;li.copy=li.cut=(e,t)=>{if(!F(e.contentDOM,e.observer.selectionRange))return!1;let{text:i,ranges:n,linewise:s}=function(e){let t=[],i=[],n=!1;for(let n of e.selection.ranges)n.empty||(t.push(e.sliceDoc(n.from,n.to)),i.push(n));if(!t.length){let s=-1;for(let{from:n}of e.selection.ranges){let r=e.doc.lineAt(n);r.number>s&&(t.push(r.text),i.push({from:r.from,to:Math.min(e.doc.length,r.to+1)})),s=r.number}n=!0}return{text:ui(e,_e,t.join(e.lineBreak)),ranges:i,linewise:n}}(e.state);if(!i&&!s)return!1;Ci=s?i:null,"cut"!=t.type||e.state.readOnly||e.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"});let r=hi?null:t.clipboardData;return r?(r.clearData(),r.setData("text/plain",i),!0):(function(e,t){let i=e.dom.parentNode;if(!i)return;let n=i.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.value=t,n.focus(),n.selectionEnd=t.length,n.selectionStart=0,setTimeout(()=>{n.remove(),e.focus()},50)}(e,i),!1)};const wi=n.YH.define();function Si(e,t){let i=[];for(let n of e.facet(ke)){let s=n(e,t);s&&i.push(s)}return i.length?e.update({effects:i,annotations:wi.of(!0)}):null}function xi(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let i=Si(e.state,t);i?e.dispatch(i):e.update([])}},10)}ci.focus=e=>{e.inputState.lastFocusTime=Date.now(),e.scrollDOM.scrollTop||!e.inputState.lastScrollTop&&!e.inputState.lastScrollLeft||(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),xi(e)},ci.blur=e=>{e.observer.clearSelectionRange(),xi(e)},ci.compositionstart=ci.compositionupdate=(e,t)=>{if(!e.observer.editContext&&(null==e.inputState.compositionFirstChange&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0)){let{main:t}=e.state.selection;t.empty||e.lineBlockAt(t.from).from==e.lineBlockAt(t.to).from||e.state.readOnly||e.dispatch({changes:e.state.selection.ranges.filter(e=>!e.empty).map(e=>({from:e.from,to:e.to})),userEvent:"input"}),e.inputState.composing=0}},ci.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,v.chrome&&v.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))},ci.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},li.beforeinput=(e,t)=>{var i,n;if("insertText"!=t.inputType&&"insertCompositionText"!=t.inputType||(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),"insertReplacementText"==t.inputType&&e.observer.editContext){let n=null===(i=t.dataTransfer)||void 0===i?void 0:i.getData("text/plain"),s=t.getTargetRanges();if(n&&s.length){let t=s[0],i=e.posAtDOM(t.startContainer,t.startOffset),r=e.posAtDOM(t.endContainer,t.endOffset);return Zt(e,{from:i,to:r,insert:e.state.toText(n)},null),!0}}let s;if(v.chrome&&v.android&&(s=ni.find(e=>e.inputType==t.inputType))&&(e.observer.delayAndroidKey(s.key,s.keyCode),"Backspace"==s.key||"Delete"==s.key)){let t=(null===(n=window.visualViewport)||void 0===n?void 0:n.height)||0;setTimeout(()=>{var i;((null===(i=window.visualViewport)||void 0===i?void 0:i.height)||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return v.ios&&"deleteContentForward"==t.inputType&&e.observer.flushSoon(),v.safari&&"insertText"==t.inputType&&e.inputState.composing>=0&&setTimeout(()=>ci.compositionend(e,t),20),!1};const Ei=new Set,Ai=["pre-wrap","normal","pre-line","break-spaces"];let Mi=!1;function Ti(){Mi=!1}class Di{constructor(e){this.lineWrapping=e,this.doc=n.EY.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let i=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((t-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return Ai.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let i=0;i<e.length;i++){let n=e[i];n<0?i++:this.heightSamples[Math.floor(10*n)]||(t=!0,this.heightSamples[Math.floor(10*n)]=!0)}return t}refresh(e,t,i,n,s,r){let o=Ai.indexOf(e)>-1,a=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=o;if(this.lineWrapping=o,this.lineHeight=t,this.charWidth=i,this.textHeight=n,this.lineLength=s,a){this.heightSamples={};for(let e=0;e<r.length;e++){let t=r[e];t<0?e++:this.heightSamples[Math.floor(10*t)]=!0}}return a}}class Ii{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class Ri{constructor(e,t,i,n,s){this.from=e,this.length=t,this.top=i,this.height=n,this._content=s}get type(){return"number"==typeof this._content?A.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof I?this._content.widget:null}get widgetLineBreaks(){return"number"==typeof this._content?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new Ri(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var ki=function(e){return e[e.ByPos=0]="ByPos",e[e.ByHeight=1]="ByHeight",e[e.ByPosNoHeight=2]="ByPosNoHeight",e}(ki||(ki={}));const Pi=.001;class _i{constructor(e,t,i=2){this.length=e,this.height=t,this.flags=i}get outdated(){return(2&this.flags)>0}set outdated(e){this.flags=(e?2:0)|-3&this.flags}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>Pi&&(Mi=!0),this.height=e)}replace(e,t,i){return _i.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,n){let s=this,r=i.doc;for(let o=n.length-1;o>=0;o--){let{fromA:a,toA:l,fromB:c,toB:h}=n[o],u=s.lineAt(a,ki.ByPosNoHeight,i.setDoc(t),0,0),d=u.to>=l?u:s.lineAt(l,ki.ByPosNoHeight,i,0,0);for(h+=d.to-l,l=d.to;o>0&&u.from<=n[o-1].toA;)a=n[o-1].fromA,c=n[o-1].fromB,o--,a<u.from&&(u=s.lineAt(a,ki.ByPosNoHeight,i,0,0));c+=u.from-a,a=u.from;let p=Hi.build(i.setDoc(r),e,c,h);s=Li(s,s.replace(a,l,p))}return s.updateHeight(i,0)}static empty(){return new Fi(0,0,0)}static of(e){if(1==e.length)return e[0];let t=0,i=e.length,n=0,s=0;for(;;)if(t==i)if(n>2*s){let s=e[t-1];s.break?e.splice(--t,1,s.left,null,s.right):e.splice(--t,1,s.left,s.right),i+=1+s.break,n-=s.size}else{if(!(s>2*n))break;{let t=e[i];t.break?e.splice(i,1,t.left,null,t.right):e.splice(i,1,t.left,t.right),i+=2+t.break,s-=t.size}}else if(n<s){let i=e[t++];i&&(n+=i.size)}else{let t=e[--i];t&&(s+=t.size)}let r=!1;return null==e[t-1]?(r=!0,t--):null==e[t]&&(r=!0,i++),new Bi(_i.of(e.slice(0,t)),r,_i.of(e.slice(i)))}}function Li(e,t){return e==t?e:(e.constructor!=t.constructor&&(Mi=!0),t)}_i.prototype.size=1;const Ni=M.replace({});class Oi extends _i{constructor(e,t,i){super(e,t),this.deco=i,this.spaceAbove=0}mainBlock(e,t){return new Ri(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,i,n){return this.spaceAbove&&e<i+this.spaceAbove?new Ri(n,0,i,this.spaceAbove,Ni):this.mainBlock(i,n)}lineAt(e,t,i,n,s){let r=this.mainBlock(n,s);return this.spaceAbove?this.blockAt(0,i,n,s).join(r):r}forEachLine(e,t,i,n,s,r){e<=s+this.length&&t>=s&&r(this.lineAt(0,ki.ByPos,i,n,s))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,i=!1,n){return n&&n.from<=t&&n.more&&this.setMeasuredHeight(n),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Fi extends Oi{constructor(e,t,i){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=i}mainBlock(e,t){return new Ri(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,t,i){let n=i[0];return 1==i.length&&(n instanceof Fi||n instanceof Gi&&4&n.flags)&&Math.abs(this.length-n.length)<10?(n instanceof Gi?n=new Fi(n.length,this.height,this.spaceAbove):n.height=this.height,this.outdated||(n.outdated=!1),n):_i.of(i)}updateHeight(e,t=0,i=!1,n){return n&&n.from<=t&&n.more?this.setMeasuredHeight(n):(i||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Gi extends _i{constructor(e){super(e,0)}heightMetrics(e,t){let i,n=e.doc.lineAt(t).number,s=e.doc.lineAt(t+this.length).number,r=s-n+1,o=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*r);i=t/r,this.length>r+1&&(o=(this.height-t)/(this.length-r-1))}else i=this.height/r;return{firstLine:n,lastLine:s,perLine:i,perChar:o}}blockAt(e,t,i,n){let{firstLine:s,lastLine:r,perLine:o,perChar:a}=this.heightMetrics(t,n);if(t.lineWrapping){let s=n+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length)),r=t.doc.lineAt(s),l=o+r.length*a,c=Math.max(i,e-l/2);return new Ri(r.from,r.length,c,l,0)}{let n=Math.max(0,Math.min(r-s,Math.floor((e-i)/o))),{from:a,length:l}=t.doc.line(s+n);return new Ri(a,l,i+o*n,o,0)}}lineAt(e,t,i,n,s){if(t==ki.ByHeight)return this.blockAt(e,i,n,s);if(t==ki.ByPosNoHeight){let{from:t,to:n}=i.doc.lineAt(e);return new Ri(t,n-t,0,0,0)}let{firstLine:r,perLine:o,perChar:a}=this.heightMetrics(i,s),l=i.doc.lineAt(e),c=o+l.length*a,h=l.number-r,u=n+o*h+a*(l.from-s-h);return new Ri(l.from,l.length,Math.max(n,Math.min(u,n+this.height-c)),c,0)}forEachLine(e,t,i,n,s,r){e=Math.max(e,s),t=Math.min(t,s+this.length);let{firstLine:o,perLine:a,perChar:l}=this.heightMetrics(i,s);for(let c=e,h=n;c<=t;){let t=i.doc.lineAt(c);if(c==e){let i=t.number-o;h+=a*i+l*(e-s-i)}let n=a+l*t.length;r(new Ri(t.from,t.length,h,n,0)),h+=n,c=t.to+1}}replace(e,t,i){let n=this.length-t;if(n>0){let e=i[i.length-1];e instanceof Gi?i[i.length-1]=new Gi(e.length+n):i.push(null,new Gi(n-1))}if(e>0){let t=i[0];t instanceof Gi?i[0]=new Gi(e+t.length):i.unshift(new Gi(e-1),null)}return _i.of(i)}decomposeLeft(e,t){t.push(new Gi(e-1),null)}decomposeRight(e,t){t.push(null,new Gi(this.length-e-1))}updateHeight(e,t=0,i=!1,n){let s=t+this.length;if(n&&n.from<=t+this.length&&n.more){let i=[],r=Math.max(t,n.from),o=-1;for(n.from>t&&i.push(new Gi(n.from-t-1).updateHeight(e,t));r<=s&&n.more;){let t=e.doc.lineAt(r).length;i.length&&i.push(null);let s=n.heights[n.index++],a=0;s<0&&(a=-s,s=n.heights[n.index++]),-1==o?o=s:Math.abs(s-o)>=Pi&&(o=-2);let l=new Fi(t,s,a);l.outdated=!1,i.push(l),r+=t+1}r<=s&&i.push(null,new Gi(s-r).updateHeight(e,r));let a=_i.of(i);return(o<0||Math.abs(a.height-this.height)>=Pi||Math.abs(o-this.heightMetrics(e,t).perLine)>=Pi)&&(Mi=!0),Li(this,a)}return(i||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class Bi extends _i{constructor(e,t,i){super(e.length+(t?1:0)+i.length,e.height+i.height,(t?1:0)|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return 1&this.flags}blockAt(e,t,i,n){let s=i+this.left.height;return e<s?this.left.blockAt(e,t,i,n):this.right.blockAt(e,t,s,n+this.left.length+this.break)}lineAt(e,t,i,n,s){let r=n+this.left.height,o=s+this.left.length+this.break,a=t==ki.ByHeight?e<r:e<o,l=a?this.left.lineAt(e,t,i,n,s):this.right.lineAt(e,t,i,r,o);if(this.break||(a?l.to<o:l.from>o))return l;let c=t==ki.ByPosNoHeight?ki.ByPosNoHeight:ki.ByPos;return a?l.join(this.right.lineAt(o,c,i,r,o)):this.left.lineAt(o,c,i,n,s).join(l)}forEachLine(e,t,i,n,s,r){let o=n+this.left.height,a=s+this.left.length+this.break;if(this.break)e<a&&this.left.forEachLine(e,t,i,n,s,r),t>=a&&this.right.forEachLine(e,t,i,o,a,r);else{let l=this.lineAt(a,ki.ByPos,i,n,s);e<l.from&&this.left.forEachLine(e,Math.min(t,l.from-1),i,n,s,r),l.to>=e&&l.from<=t&&r(l),t>l.to&&this.right.forEachLine(Math.max(e,l.to+1),t,i,o,a,r)}}replace(e,t,i){let n=this.left.length+this.break;if(t<n)return this.balanced(this.left.replace(e,t,i),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-n,t-n,i));let s=[];e>0&&this.decomposeLeft(e,s);let r=s.length;for(let e of i)s.push(e);if(e>0&&Vi(s,r-1),t<this.length){let e=s.length;this.decomposeRight(t,s),Vi(s,e)}return _i.of(s)}decomposeLeft(e,t){let i=this.left.length;if(e<=i)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(i++,e>=i&&t.push(null)),e>i&&this.right.decomposeLeft(e-i,t)}decomposeRight(e,t){let i=this.left.length,n=i+this.break;if(e>=n)return this.right.decomposeRight(e-n,t);e<i&&this.left.decomposeRight(e,t),this.break&&e<n&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?_i.of(this.break?[e,null,t]:[e,t]):(this.left=Li(this.left,e),this.right=Li(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,i=!1,n){let{left:s,right:r}=this,o=t+s.length+this.break,a=null;return n&&n.from<=t+s.length&&n.more?a=s=s.updateHeight(e,t,i,n):s.updateHeight(e,t,i),n&&n.from<=o+r.length&&n.more?a=r=r.updateHeight(e,o,i,n):r.updateHeight(e,o,i),a?this.balanced(s,r):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Vi(e,t){let i,n;null==e[t]&&(i=e[t-1])instanceof Gi&&(n=e[t+1])instanceof Gi&&e.splice(t-1,3,new Gi(i.length+1+n.length))}class Hi{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let e=Math.min(t,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof Fi?i.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new Fi(e-this.pos,-1,0)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,i){if(e<t||i.heightRelevant){let n=i.widget?i.widget.estimatedHeight:0,s=i.widget?i.widget.lineBreaks:0;n<0&&(n=this.oracle.lineHeight);let r=t-e;i.block?this.addBlock(new Oi(r,n,i)):(r||s||n>=5)&&this.addLineDeco(n,s,r)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||null==this.nodes[this.nodes.length-1])&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new Fi(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let i=new Gi(t-e);return this.oracle.doc.lineAt(e).to==t&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Fi)return e;let t=new Fi(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,i){let n=this.ensureLine();n.length+=i,n.collapsed+=i,n.widgetHeight=Math.max(n.widgetHeight,e),n.breaks+=t,this.writtenTo=this.pos=this.pos+i}finish(e){let t=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||t instanceof Fi||this.isCovered?(this.writtenTo<this.pos||null==t)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos)):this.nodes.push(new Fi(0,-1,0));let i=e;for(let e of this.nodes)e instanceof Fi&&e.updateHeight(this.oracle,i),i+=e?e.length:1;return this.nodes}static build(e,t,i,s){let r=new Hi(i,e);return n.om.spans(t,i,s,r,0),r.finish(i)}}class Ui{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,i,n){(e<t||i&&i.heightRelevant||n&&n.heightRelevant)&&k(e,t,this.changes,5)}}function zi(e,t){let i=e.getBoundingClientRect(),n=e.ownerDocument,s=n.defaultView||window,r=Math.max(0,i.left),o=Math.min(s.innerWidth,i.right),a=Math.max(0,i.top),l=Math.min(s.innerHeight,i.bottom);for(let t=e.parentNode;t&&t!=n.body;)if(_(t)){let i=window.getComputedStyle(t);if((t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth)&&"visible"!=i.overflow){let i=t.getBoundingClientRect();r=Math.max(r,i.left),o=Math.min(o,i.right),a=Math.max(a,i.top),l=Math.min(t==e.parentNode?s.innerHeight:l,i.bottom)}t="absolute"==i.position||"fixed"==i.position?t.offsetParent:t.parentNode}else{if(11!=t.nodeType)break;t=t.host}return{left:r-i.left,right:Math.max(r,o)-i.left,top:a-(i.top+t),bottom:Math.max(a,l)-(i.top+t)}}function Wi(e,t){let i=e.getBoundingClientRect();return{left:0,right:i.right-i.left,top:t,bottom:i.bottom-(i.top+t)}}class ji{constructor(e,t,i,n){this.from=e,this.to=t,this.size=i,this.displaySize=n}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++){let n=e[i],s=t[i];if(n.from!=s.from||n.to!=s.to||n.size!=s.size)return!1}return!0}draw(e,t){return M.replace({widget:new $i(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class $i extends E{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class Ki{constructor(e,t){this.view=e,this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=Zi,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=oe.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let i=t.facet(Ke).some(e=>"function"!=typeof e&&"cm-lineWrapping"==e.class);this.heightOracle=new Di(i),this.stateDeco=Qi(t),this.heightMap=_i.empty().applyChanges(this.stateDeco,n.EY.empty,this.heightOracle.setDoc(t.doc),[new nt(0,0,0,t.doc.length)]);for(let e=0;e<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());e++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=M.set(this.lineGaps.map(e=>e.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let i=0;i<=1;i++){let n=i?t.head:t.anchor;if(!e.some(({from:e,to:t})=>n>=e&&n<=t)){let{from:t,to:i}=this.lineBlockAt(n);e.push(new Yi(t,i))}}return this.viewports=e.sort((e,t)=>e.from-t.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?Zi:new Ji(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(en(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=Qi(this.state);let s=e.changedRanges,r=nt.extendWithRanges(s,function(e,t,i){let s=new Ui;return n.om.compare(e,t,i,s,0),s.changes}(i,this.stateDeco,e?e.changes:n.VR.empty(this.state.doc.length))),o=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);Ti(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),(this.heightMap.height!=o||Mi)&&(e.flags|=2),a?(this.scrollAnchorPos=e.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let l=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<l.from||t.range.head>l.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,t));let c=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,e.flags|=this.updateForViewport(),(c||!e.changes.empty||2&e.flags)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(Ne)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,t=e.contentDOM,i=window.getComputedStyle(t),s=this.heightOracle,r=i.whiteSpace;this.defaultTextDirection="rtl"==i.direction?oe.RTL:oe.LTR;let o=this.heightOracle.mustRefreshForWrapping(r)||"refresh"===this.mustMeasureContent,a=t.getBoundingClientRect(),l=o||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let c=0,h=0;if(a.width&&a.height){let{scaleX:e,scaleY:i}=$(t,a);(e>.005&&Math.abs(this.scaleX-e)>.005||i>.005&&Math.abs(this.scaleY-i)>.005)&&(this.scaleX=e,this.scaleY=i,c|=16,o=l=!0)}let u=(parseInt(i.paddingTop)||0)*this.scaleY,d=(parseInt(i.paddingBottom)||0)*this.scaleY;this.paddingTop==u&&this.paddingBottom==d||(this.paddingTop=u,this.paddingBottom=d,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(l=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let p=K(this.view.contentDOM,!1).y;p!=this.scrollParent&&(this.scrollParent=p,this.scrollAnchorHeight=-1,this.scrollOffset=0);let g=this.getScrollOffset();this.scrollOffset!=g&&(this.scrollAnchorHeight=-1,this.scrollOffset=g),this.scrolledToBottom=ie(this.scrollParent||e.win);let f=(this.printing?Wi:zi)(t,this.paddingTop),m=f.top-this.pixelViewport.top,y=f.bottom-this.pixelViewport.bottom;this.pixelViewport=f;let v=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(v!=this.inView&&(this.inView=v,v&&(l=!0)),!this.inView&&!this.scrollTarget&&!function(e){let t=e.getBoundingClientRect(),i=e.ownerDocument.defaultView||window;return t.left<i.innerWidth&&t.right>0&&t.top<i.innerHeight&&t.bottom>0}(e.dom))return 0;let b=a.width;if(this.contentDOMWidth==b&&this.editorHeight==e.scrollDOM.clientHeight||(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),l){let t=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(t)&&(o=!0),o||s.lineWrapping&&Math.abs(b-this.contentDOMWidth)>s.charWidth){let{lineHeight:i,charWidth:n,textHeight:a}=e.docView.measureTextSize();o=i>0&&s.refresh(r,i,n,a,Math.max(5,b/n),t),o&&(e.docView.minWidth=0,c|=16)}m>0&&y>0?h=Math.max(m,y):m<0&&y<0&&(h=Math.min(m,y)),Ti();for(let i of this.viewports){let r=i.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(i);this.heightMap=(o?_i.empty().applyChanges(this.stateDeco,n.EY.empty,this.heightOracle,[new nt(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,o,new Ii(i.from,r))}Mi&&(c|=2)}let C=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return C&&(2&c&&(c|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),c|=this.updateForViewport()),(2&c||C)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),n=this.heightMap,s=this.heightOracle,{visibleTop:r,visibleBottom:o}=this,a=new Yi(n.lineAt(r-1e3*i,ki.ByHeight,s,0,0).from,n.lineAt(o+1e3*(1-i),ki.ByHeight,s,0,0).to);if(t){let{head:e}=t.range;if(e<a.from||e>a.to){let i,r=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),o=n.lineAt(e,ki.ByPos,s,0,0);i="center"==t.y?(o.top+o.bottom)/2-r/2:"start"==t.y||"nearest"==t.y&&e<a.from?o.top:o.bottom-r,a=new Yi(n.lineAt(i-500,ki.ByHeight,s,0,0).from,n.lineAt(i+r+500,ki.ByHeight,s,0,0).to)}}return a}mapViewport(e,t){let i=t.mapPos(e.from,-1),n=t.mapPos(e.to,1);return new Yi(this.heightMap.lineAt(i,ki.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(n,ki.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},i=0){if(!this.inView)return!0;let{top:n}=this.heightMap.lineAt(e,ki.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(t,ki.ByPos,this.heightOracle,0,0),{visibleTop:r,visibleBottom:o}=this;return(0==e||n<=r-Math.max(10,Math.min(-i,250)))&&(t==this.state.doc.length||s>=o+Math.max(10,Math.min(i,250)))&&n>r-2e3&&s<o+2e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let i=[];for(let n of e)t.touchesRange(n.from,n.to)||i.push(new ji(t.mapPos(n.from),t.mapPos(n.to),n.size,n.displaySize));return i}ensureLineGaps(e,t){let i=this.heightOracle.lineWrapping,s=i?1e4:2e3,r=s>>1,o=s<<1;if(this.defaultTextDirection!=oe.LTR&&!i)return[];let a=[],l=(s,o,c,h)=>{if(o-s<r)return;let u=this.state.selection.main,d=[u.from];u.empty||d.push(u.to);for(let e of d)if(e>s&&e<o)return l(s,e-10,c,h),void l(e+10,o,c,h);let p=function(e,t){for(let i of e)if(t(i))return i}(e,e=>e.from>=c.from&&e.to<=c.to&&Math.abs(e.from-s)<r&&Math.abs(e.to-o)<r&&!d.some(t=>e.from<t&&e.to>t));if(!p){if(o<c.to&&t&&i&&t.visibleRanges.some(e=>e.from<=o&&e.to>=o)){let e=t.moveToLineBoundary(n.OF.cursor(o),!1,!0).head;e>s&&(o=e)}let e=this.gapSize(c,s,o,h);p=new ji(s,o,e,i||e<2e6?e:2e6)}a.push(p)},c=t=>{if(t.length<o||t.type!=A.Text)return;let r=function(e,t,i){let s=[],r=e,o=0;return n.om.spans(i,e,t,{span(){},point(e,t){e>r&&(s.push({from:r,to:e}),o+=e-r),r=t}},20),r<t&&(s.push({from:r,to:t}),o+=t-r),{total:o,ranges:s}}(t.from,t.to,this.stateDeco);if(r.total<o)return;let a,c,h=this.scrollTarget?this.scrollTarget.range.head:null;if(i){let e,i,n=s/this.heightOracle.lineLength*this.heightOracle.lineHeight;if(null!=h){let s=Xi(r,h),o=((this.visibleBottom-this.visibleTop)/2+n)/t.height;e=s-o,i=s+o}else e=(this.visibleTop-t.top-n)/t.height,i=(this.visibleBottom-t.top+n)/t.height;a=qi(r,e),c=qi(r,i)}else{let i=r.total*this.heightOracle.charWidth,n=s*this.heightOracle.charWidth,o=0;if(i>2e6)for(let i of e)i.from>=t.from&&i.from<t.to&&i.size!=i.displaySize&&i.from*this.heightOracle.charWidth+o<this.pixelViewport.left&&(o=i.size-i.displaySize);let l,u,d=this.pixelViewport.left+o,p=this.pixelViewport.right+o;if(null!=h){let e=Xi(r,h),t=((p-d)/2+n)/i;l=e-t,u=e+t}else l=(d-n)/i,u=(p+n)/i;a=qi(r,l),c=qi(r,u)}a>t.from&&l(t.from,a,t,r),c<t.to&&l(c,t.to,t,r)};for(let e of this.viewportLines)Array.isArray(e.type)?e.type.forEach(c):c(e);return a}gapSize(e,t,i,n){let s=Xi(n,i)-Xi(n,t);return this.heightOracle.lineWrapping?e.height*s:n.total*this.heightOracle.charWidth*s}updateLineGaps(e){ji.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=M.set(e.map(e=>e.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let i=[];n.om.spans(t,this.viewport.from,this.viewport.to,{span(e,t){i.push({from:e,to:t})},point(){}},20);let s=0;if(i.length!=this.visibleRanges.length)s=12;else for(let t=0;t<i.length&&!(8&s);t++){let n=this.visibleRanges[t],r=i[t];n.from==r.from&&n.to==r.to||(s|=4,e&&e.mapPos(n.from,-1)==r.from&&e.mapPos(n.to,1)==r.to||(s|=8))}return this.visibleRanges=i,s}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||en(this.heightMap.lineAt(e,ki.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||en(this.heightMap.lineAt(this.scaler.fromDOM(e),ki.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop*this.scaleY:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return en(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Yi{constructor(e,t){this.from=e,this.to=t}}function qi({total:e,ranges:t},i){if(i<=0)return t[0].from;if(i>=1)return t[t.length-1].to;let n=Math.floor(e*i);for(let e=0;;e++){let{from:i,to:s}=t[e],r=s-i;if(n<=r)return i+n;n-=r}}function Xi(e,t){let i=0;for(let{from:n,to:s}of e.ranges){if(t<=s){i+=t-n;break}i+=s-n}return i/e.total}const Zi={toDOM:e=>e,fromDOM:e=>e,scale:1,eq(e){return e==this}};function Qi(e){let t=e.facet(Ye).filter(e=>"function"!=typeof e),i=e.facet(Xe).filter(e=>"function"!=typeof e);return i.length&&t.push(n.om.join(i)),t}class Ji{constructor(e,t,i){let n=0,s=0,r=0;this.viewports=i.map(({from:i,to:s})=>{let r=t.lineAt(i,ki.ByPos,e,0,0).top,o=t.lineAt(s,ki.ByPos,e,0,0).bottom;return n+=o-r,{from:i,to:s,top:r,bottom:o,domTop:0,domBottom:0}}),this.scale=(7e6-n)/(t.height-n);for(let e of this.viewports)e.domTop=r+(e.top-s)*this.scale,r=e.domBottom=e.domTop+(e.bottom-e.top),s=e.bottom}toDOM(e){for(let t=0,i=0,n=0;;t++){let s=t<this.viewports.length?this.viewports[t]:null;if(!s||e<s.top)return n+(e-i)*this.scale;if(e<=s.bottom)return s.domTop+(e-s.top);i=s.bottom,n=s.domBottom}}fromDOM(e){for(let t=0,i=0,n=0;;t++){let s=t<this.viewports.length?this.viewports[t]:null;if(!s||e<s.domTop)return i+(e-n)/this.scale;if(e<=s.domBottom)return s.top+(e-s.domTop);i=s.bottom,n=s.domBottom}}eq(e){return e instanceof Ji&&this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((t,i)=>t.from==e.viewports[i].from&&t.to==e.viewports[i].to)}}function en(e,t){if(1==t.scale)return e;let i=t.toDOM(e.top),n=t.toDOM(e.bottom);return new Ri(e.from,e.length,i,n-i,Array.isArray(e._content)?e._content.map(e=>en(e,t)):e._content)}const tn=n.sj.define({combine:e=>e.join(" ")}),nn=n.sj.define({combine:e=>e.indexOf(!0)>-1}),sn=s.G.newName(),rn=s.G.newName(),on=s.G.newName(),an={"&light":"."+rn,"&dark":"."+on};function ln(e,t,i){return new s.G(t,{finish:t=>/&/.test(t)?t.replace(/&\w*/,t=>{if("&"==t)return e;if(!i||!i[t])throw new RangeError(`Unsupported selector: ${t}`);return i[t]}):e+" "+t})}const cn=ln("."+sn,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{userSelect:"none",position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},".cm-panels-top":{top:"0"},".cm-panels-bottom":{bottom:"0"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"baseline",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{background:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 0) no-repeat",backgroundSize:".4em",backgroundPosition:"calc(min(50%, 0px)) center"},".cm-highlightTab":{backgroundImage:'url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>\')',backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},an),hn={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},un=v.ie&&v.ie_version<=11;class dn{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Y,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let e of t)this.queue.push(e);(v.ie&&v.ie_version<=11||v.ios&&e.composing)&&t.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():this.flush()}),!window.EditContext||!v.android||!1===e.constructor.EDIT_CONTEXT||v.chrome&&v.chrome_version<126||(this.editContext=new fn(e),e.state.facet(He)&&(e.contentDOM.editContext=this.editContext.editContext)),un&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),"function"==typeof ResizeObserver&&(this.resizeScroll=new ResizeObserver(()=>{var e;(null===(e=this.view.docView)||void 0===e?void 0:e.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),"function"==typeof IntersectionObserver&&(this.intersection=new IntersectionObserver(e=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){("change"!=e.type&&e.type||e.matches)&&(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,i)=>t!=e[i]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,n=this.selectionRange;if(i.state.facet(He)?i.root.activeElement!=this.dom:!F(this.dom,n))return;let s=n.anchorNode&&i.docView.tile.nearest(n.anchorNode);s&&s.isWidget()&&s.widget.ignoreEvent(e)?t||(this.selectionChanged=!1):(v.ie&&v.ie_version<=11||v.android&&v.chrome)&&!i.state.selection.main.empty&&n.focusNode&&B(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=N(e.root);if(!t)return!1;let i=v.safari&&11==e.root.nodeType&&e.root.activeElement==this.dom&&function(e,t){if(t.getComposedRanges){let i=t.getComposedRanges(e.root)[0];if(i)return gn(e,i)}let i=null;function n(e){e.preventDefault(),e.stopImmediatePropagation(),i=e.getTargetRanges()[0]}return e.contentDOM.addEventListener("beforeinput",n,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",n,!0),i?gn(e,i):null}(this.view,t)||t;if(!i||this.selectionRange.eq(i))return!1;let n=F(this.dom,i);return n&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&function(e,t){let i=t.focusNode,n=t.focusOffset;if(!i||t.anchorNode!=i||t.anchorOffset!=n)return!1;for(n=Math.min(n,z(i));;)if(n){if(!_(i))return!1;let e=i.childNodes[n-1];"false"==e.contentEditable?n--:(i=e,n=z(i))}else{if(i==e)return!0;n=V(i),i=i.parentNode}}(this.dom,i)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(i),n&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let i=this.dom;i;)if(_(i))!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==i?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(i),i=i.assignedSlot||i.parentNode;else{if(11!=i.nodeType)break;i=i.host}if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let e of this.scrollTargets)e.removeEventListener("scroll",this.onScroll);for(let e of this.scrollTargets=t)e.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,hn),un&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),un&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var i;if(!this.delayedAndroidKey){let e=()=>{let e=this.delayedAndroidKey;e&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&te(this.dom,e.key,e.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(e)}this.delayedAndroidKey&&"Enter"!=e||(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(null===(i=this.delayedAndroidKey)||void 0===i?void 0:i.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,i=-1,n=!1;for(let s of e){let e=this.readMutation(s);e&&(e.typeOver&&(n=!0),-1==t?({from:t,to:i}=e):(t=Math.min(e.from,t),i=Math.max(e.to,i)))}return{from:t,to:i,typeOver:n}}readChange(){let{from:e,to:t,typeOver:i}=this.processRecords(),n=this.selectionChanged&&F(this.dom,this.selectionRange);if(e<0&&!n)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new Yt(this.view,e,t,i);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.selectionChanged,i=this.readChange();if(!i)return this.view.requestMeasure(),!1;let n=this.view.state,s=Xt(this.view,i);return this.view.state==n&&(i.domChanged||t)&&this.view.update([]),s}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty("attributes"==e.type),"childList"==e.type){let i=pn(t,e.previousSibling||e.target.previousSibling,-1),n=pn(t,e.nextSibling||e.target.nextSibling,1);return{from:i?t.posAfter(i):t.posAtStart,to:n?t.posBefore(n):t.posAtEnd,typeOver:!1}}return"characterData"==e.type?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(He)!=e.state.facet(He)&&(e.view.contentDOM.editContext=e.state.facet(He)?this.editContext.editContext:null))}destroy(){var e,t,i;this.stop(),null===(e=this.intersection)||void 0===e||e.disconnect(),null===(t=this.gapIntersection)||void 0===t||t.disconnect(),null===(i=this.resizeScroll)||void 0===i||i.disconnect();for(let e of this.scrollTargets)e.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function pn(e,t,i){for(;t;){let n=ot.get(t);if(n&&n.parent==e)return n;let s=t.parentNode;t=s!=e.dom?s:i>0?t.nextSibling:t.previousSibling}return null}function gn(e,t){let i=t.startContainer,n=t.startOffset,s=t.endContainer,r=t.endOffset,o=e.docView.domAtPos(e.state.selection.main.anchor,1);return B(o.node,o.offset,s,r)&&([i,n,s,r]=[s,r,i,n]),{anchorNode:i,anchorOffset:n,focusNode:s,focusOffset:r}}class fn{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=i=>{let s=e.state.selection.main,{anchor:r,head:o}=s,a=this.toEditorPos(i.updateRangeStart),l=this.toEditorPos(i.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:a,drifted:!1});let c=l-a>i.text.length;a==this.from&&r<this.from?a=r:l==this.to&&r>this.to&&(l=r);let h=Qt(e.state.sliceDoc(a,l),i.text,(c?s.from:s.to)-a,c?"end":null);if(!h){let t=n.OF.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));return void(Jt(t,s)||e.dispatch({selection:t,userEvent:"select"}))}let u={from:h.from+a,to:h.toA+a,insert:n.EY.of(i.text.slice(h.from,h.toB).split("\n"))};if((v.mac||v.android)&&u.from==o-1&&/^\. ?$/.test(i.text)&&"off"==e.contentDOM.getAttribute("autocorrect")&&(u={from:a,to:l,insert:n.EY.of([i.text.replace("."," ")])}),this.pendingContextChange=u,!e.state.readOnly){let t=this.to-this.from+(u.to-u.from+u.insert.length);Zt(e,u,n.OF.single(this.toEditorPos(i.selectionStart,t),this.toEditorPos(i.selectionEnd,t)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),u.from<u.to&&!u.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(t.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let n=[],s=null;for(let t=this.toEditorPos(i.rangeStart),r=this.toEditorPos(i.rangeEnd);t<r;t++){let i=e.coordsForChar(t);s=i&&new DOMRect(i.left,i.top,i.right-i.left,i.bottom-i.top)||s||new DOMRect,n.push(s)}t.updateCharacterBounds(i.rangeStart,n)},this.handlers.textformatupdate=t=>{let i=[];for(let e of t.getTextFormats()){let t=e.underlineStyle,n=e.underlineThickness;if(!/none/i.test(t)&&!/none/i.test(n)){let s=this.toEditorPos(e.rangeStart),r=this.toEditorPos(e.rangeEnd);if(s<r){let e=`text-decoration: underline ${/^[a-z]/.test(t)?t+" ":"Dashed"==t?"dashed ":"Squiggle"==t?"wavy ":""}${/thin/i.test(n)?1:2}px`;i.push(M.mark({attributes:{style:e}}).range(s,r))}}}e.dispatch({effects:Be.of(M.set(i))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:t}=this.composing;this.composing=null,t&&this.reset(e.state)}};for(let e in this.handlers)t.addEventListener(e,this.handlers[e]);this.measureReq={read:e=>{let t=N(e.root);t&&t.rangeCount&&this.editContext.updateSelectionBounds(t.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,i=!1,n=this.pendingContextChange;return e.changes.iterChanges((s,r,o,a,l)=>{if(i)return;let c=l.length-(r-s);if(n&&r>=n.to){if(n.from==s&&n.to==r&&n.insert.eq(l))return n=this.pendingContextChange=null,t+=c,void(this.to+=c);n=null,this.revertPending(e.state)}if(s+=t,(r+=t)<=this.from)this.from+=c,this.to+=c;else if(s<this.to){if(s<this.from||r>this.to||this.to-this.from+l.length>3e4)return void(i=!0);this.editContext.updateText(this.toContextPos(s),this.toContextPos(r),l.toString()),this.to+=c}t+=c}),n&&!i&&this.revertPending(e.state),!i}update(e){let t=this.pendingContextChange,i=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(i.from,i.to)&&e.transactions.some(e=>!e.isUserEvent("input.type")&&e.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):this.applyEdits(e)&&this.rangeIsValid(e.state)?(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state):(this.pendingContextChange=null,this.reset(e.state)),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),n=this.toContextPos(t.head);this.editContext.selectionStart==i&&this.editContext.selectionEnd==n||this.editContext.updateSelection(i,n)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>3e4)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let i=this.composing;return i&&i.drifted?i.editorBase+(e-i.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class mn{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.clearAnnouncement=-1,this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:i}=e;this.dispatchTransactions=e.dispatchTransactions||i&&(e=>e.forEach(e=>i(e,this)))||(e=>this.update(e)),this.dispatch=this.dispatch.bind(this),this._root=e.root||function(e){for(;e;){if(e&&(9==e.nodeType||11==e.nodeType&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}(e.parent)||document,this.viewState=new Ki(this,e.state||n.$t.create(e)),e.scrollTo&&e.scrollTo.is(Ge)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(ze).map(e=>new je(e));for(let e of this.plugins)e.update(this);this.observer=new dn(this),this.inputState=new ei(this),this.inputState.ensureHandlers(this.plugins),this.docView=new It(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),(null===(t=document.fonts)||void 0===t?void 0:t.ready)&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let t=1==e.length&&e[0]instanceof n.ZX?e:1==e.length&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t,i=!1,s=!1,r=this.state;for(let t of e){if(t.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=t.state}if(this.destroyed)return void(this.viewState.state=r);let o=this.hasFocus,a=0,l=null;e.some(e=>e.annotation(wi))?(this.inputState.notifiedFocused=o,a=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,l=Si(r,o),l||(a=1));let c=this.observer.delayedAndroidKey,h=null;if(c?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(h=null)):this.observer.clear(),r.facet(n.$t.phrases)!=this.state.facet(n.$t.phrases))return this.setState(r);t=st.create(this,r,e),t.flags|=a;let u=this.viewState.scrollTarget;try{this.updateState=2;for(let t of e){if(u&&(u=u.map(t.changes)),t.scrollIntoView){let{main:e}=t.state.selection,{x:i,y:s}=this.state.facet(mn.cursorScrollMargin);u=new Fe(e.empty?e:n.OF.cursor(e.head,e.head>e.anchor?-1:1),"nearest","nearest",s,i)}for(let e of t.effects)e.is(Ge)&&(u=e.value.clip(this.state))}this.viewState.update(t,u),this.bidiCache=bn.update(this.bidiCache,t.changes),t.empty||(this.updatePlugins(t),this.inputState.update(t)),i=this.docView.update(t),this.state.facet(it)!=this.styleModules&&this.mountStyles(),s=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(i,e.some(e=>e.isUserEvent("select.pointer")))}finally{this.updateState=0}if(t.startState.facet(tn)!=t.state.facet(tn)&&(this.viewState.mustMeasureContent=!0),(i||s||u||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),i&&this.docViewUpdate(),!t.empty)for(let e of this.state.facet(Ie))try{e(t)}catch(e){Ve(this.state,e,"update listener")}(l||h)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),h&&!Xt(this,h)&&c.force&&te(this.contentDOM,c.key,c.keyCode)})}setState(e){if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed)return void(this.viewState.state=e);this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);this.viewState=new Ki(this,e),this.plugins=e.facet(ze).map(e=>new je(e)),this.pluginMap.clear();for(let e of this.plugins)e.update(this);this.docView.destroy(),this.docView=new It(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(ze),i=e.state.facet(ze);if(t!=i){let n=[];for(let s of i){let i=t.indexOf(s);if(i<0)n.push(new je(s));else{let t=this.plugins[i];t.mustUpdate=e,n.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=n,this.pluginMap.clear()}else for(let t of this.plugins)t.mustUpdate=e;for(let e=0;e<this.plugins.length;e++)this.plugins[e].update(this);t!=i&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(e){Ve(this.state,e,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey)return this.measureScheduled=-1,void this.requestMeasure();this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,i=this.viewState.scrollParent,n=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:r,scaleY:o}=this.viewState;Math.abs(n-this.viewState.scrollOffset)>1&&(r=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(r<0){if(ie(i||this.win))s=-1,r=this.viewState.heightMap.height/this.viewState.scaleY;else{let e=this.viewState.scrollAnchorAt(n);s=e.from,r=e.top}o=this.viewState.scaleY}this.updateState=1;let a=this.viewState.measure();if(!a&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(e>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let l=[];4&a||([this.measureRequests,l]=[l,this.measureRequests]);let c=l.map(e=>{try{return e.read(this)}catch(e){return Ve(this.state,e),vn}}),h=st.create(this,this.state,[]),u=!1;h.flags|=a,t?t.flags|=a:t=h,this.updateState=2,h.empty||(this.updatePlugins(h),this.inputState.update(h),this.updateAttrs(),u=this.docView.update(h),u&&this.docViewUpdate());for(let e=0;e<l.length;e++)if(c[e]!=vn)try{let t=l[e];t.write&&t.write(c[e],this)}catch(e){Ve(this.state,e)}if(u&&this.docView.updateSelection(!0),!h.viewportChanged&&0==this.measureRequests.length){if(this.viewState.editorHeight){if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,r=-1;continue}{let e=(s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)/this.viewState.scaleY-r/o;if((e>1||e<-1)&&!(v.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(i==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){n+=e,i?s<0?i.scrollTop=i.scrollHeight:i.scrollTop+=e:this.win.scrollBy(0,e),r=-1;continue}}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let e of this.state.facet(Ie))e(t)}get themeClasses(){return sn+" "+(this.state.facet(nn)?on:rn)+" "+this.state.facet(tn)}updateAttrs(){let e=Cn(this,$e,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(He)?"true":"false",class:"cm-content",style:`${v.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Cn(this,Ke,t);let i=this.observer.ignore(()=>{let i=S(this.contentDOM,this.contentAttrs,t),n=S(this.dom,this.editorAttrs,e);return i||n});return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let e of i.effects)e.is(mn.announce)&&(t&&(this.announceDOM.textContent="",this.win.clearTimeout(this.clearAnnouncement),this.clearAnnouncement=this.win.setTimeout(()=>{this.announceDOM.textContent=" "},200),t=!1),this.announceDOM.appendChild(document.createElement("div")).textContent=e.value)}mountStyles(){this.styleModules=this.state.facet(it);let e=this.state.facet(mn.cspNonce);s.G.mount(this.root,this.styleModules.concat(cn).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(2==this.updateState)throw new Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(null!=e.key)for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key)return void(this.measureRequests[t]=e);this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(void 0===t||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(t=>t.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,i){return Bt(this,e,Ot(this,e,t,i))}moveByGroup(e,t){return Bt(this,e,Ot(this,e,t,t=>function(e,t,i){let s=e.state.charCategorizer(t),r=s(i);return e=>{let t=s(e);return r==n.Je.Space&&(r=t),r==t}}(this,e.head,t)))}visualLineSide(e,t){return t?n.OF.cursor(e.to,1):n.OF.cursor(e.from,-1)}moveToLineBoundary(e,t,i=!0){return function(e,t,i,s){let r=Nt(e,t.head,t.assoc||-1),o=s&&r.type==A.Text&&(e.lineWrapping||r.widgetLineBreaks)?e.coordsAtPos(t.assoc<0&&t.head>r.from?t.head-1:t.head):null;if(o){let t=e.dom.getBoundingClientRect(),s=e.textDirectionAt(r.from),a=e.posAtCoords({x:i==(s==oe.LTR)?t.right-1:t.left+1,y:(o.top+o.bottom)/2});if(null!=a)return n.OF.cursor(a,i?-1:1)}return n.OF.cursor(i?r.to:r.from,i?-1:1)}(this,e,t,i)}moveVertically(e,t,i){return Bt(this,e,function(e,t,i,s){let r=t.head,o=i?1:-1;if(r==(i?e.state.doc.length:0))return n.OF.cursor(r,t.assoc);let a,l=t.goalColumn,c=e.contentDOM.getBoundingClientRect(),h=e.coordsAtPos(r,t.assoc||((t.empty?i:t.head==t.from)?1:-1)),u=e.documentTop;if(h)null==l&&(l=h.left-c.left),a=o<0?h.top:h.bottom;else{let t=e.viewState.lineBlockAt(r);null==l&&(l=Math.min(c.right-c.left,e.defaultCharacterWidth*(r-t.from))),a=(o<0?t.top:t.bottom)+u}let d=c.left+l,p=e.viewState.heightOracle.textHeight>>1,g=null!=s?s:p;for(let t=0;;t+=p){let s=a+(g+t)*o,r=Ht(e,{x:d,y:s},!1,o);if(i?s>c.bottom:s<c.top)return n.OF.cursor(r.pos,r.assoc);let h=e.coordsAtPos(r.pos,r.assoc),u=h?(h.top+h.bottom)/2:0;if(!h||(i?u>a:u<a))return n.OF.cursor(r.pos,r.assoc,void 0,l)}}(this,e,t,i))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let i=Ht(this,e,t);return i&&i.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),Ht(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.state.doc.lineAt(e),n=this.bidiSpans(i),s=n[me.find(n,e-i.from,-1,t)];return i.length&&(e==i.from&&t<0||e==i.to&&t>0)&&s.dir!=this.textDirectionAt(i.from)&&(e==i.to?(e=i.from+s.from,t=1):(e=i.from+s.to,t=-1)),this.docView.coordsAt(e,t,s.dir==oe.RTL)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(Le)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>yn)return we(e.length);let t,i=this.textDirectionAt(e.from);for(let n of this.bidiCache)if(n.from==e.from&&n.dir==i&&(n.fresh||ye(n.isolates,t=Je(this,e))))return n.order;t||(t=Je(this,e));let n=function(e,t,i){if(!e)return[new me(0,0,t==le?1:0)];if(t==ae&&!i.length&&!fe.test(e))return we(e.length);if(i.length)for(;e.length>ve.length;)ve[ve.length]=256;let n=[],s=t==ae?0:1;return Ce(e,s,s,i,0,e.length,n),n}(e.text,i,t);return this.bidiCache.push(new bn(e.from,e.to,i,t,!0,n)),n}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||v.safari&&(null===(e=this.inputState)||void 0===e?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{J(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((9==e.nodeType?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.win.clearTimeout(this.clearAnnouncement),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){var i,s,r,o;return Ge.of(new Fe("number"==typeof e?n.OF.cursor(e):e,null!==(i=t.y)&&void 0!==i?i:"nearest",null!==(s=t.x)&&void 0!==s?s:"nearest",null!==(r=t.yMargin)&&void 0!==r?r:5,null!==(o=t.xMargin)&&void 0!==o?o:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,i=this.viewState.scrollAnchorAt(e);return Ge.of(new Fe(n.OF.cursor(i.from),"start","start",i.top-e,t,!0))}setTabFocusMode(e){null==e?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:"boolean"==typeof e?this.inputState.tabFocusMode=e?0:-1:0!=this.inputState.tabFocusMode&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return We.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return We.define(()=>({}),{eventObservers:e})}static theme(e,t){let i=s.G.newName(),n=[tn.of(i),it.of(ln(`.${i}`,e))];return t&&t.dark&&n.push(nn.of(!0)),n}static baseTheme(e){return n.Nb.lowest(it.of(ln("."+sn,e,an)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),n=i&&ot.get(i)||ot.get(e);return(null===(t=null==n?void 0:n.root)||void 0===t?void 0:t.view)||null}}mn.styleModule=it,mn.inputHandler=Re,mn.clipboardInputFilter=Pe,mn.clipboardOutputFilter=_e,mn.scrollHandler=Oe,mn.focusChangeEffect=ke,mn.perLineTextDirection=Le,mn.exceptionSink=De,mn.updateListener=Ie,mn.editable=He,mn.mouseSelectionStyle=Te,mn.dragMovesSelection=Me,mn.clickAddsSelectionRange=Ae,mn.decorations=Ye,mn.blockWrappers=qe,mn.outerDecorations=Xe,mn.atomicRanges=Ze,mn.bidiIsolatedRanges=Qe,mn.cursorScrollMargin=n.sj.define({combine:e=>{let t=5,i=5;for(let n of e)"number"==typeof n?t=i=n:({x:t,y:i}=n);return{x:t,y:i}}}),mn.scrollMargins=et,mn.darkTheme=nn,mn.cspNonce=n.sj.define({combine:e=>e.length?e[0]:""}),mn.contentAttributes=Ke,mn.editorAttributes=$e,mn.lineWrapping=mn.contentAttributes.of({class:"cm-lineWrapping"}),mn.announce=n.Pe.define();const yn=4096,vn={};class bn{constructor(e,t,i,n,s,r){this.from=e,this.to=t,this.dir=i,this.isolates=n,this.fresh=s,this.order=r}static update(e,t){if(t.empty&&!e.some(e=>e.fresh))return e;let i=[],n=e.length?e[e.length-1].dir:oe.LTR;for(let s=Math.max(0,e.length-10);s<e.length;s++){let r=e[s];r.dir!=n||t.touchesRange(r.from,r.to)||i.push(new bn(t.mapPos(r.from,1),t.mapPos(r.to,-1),r.dir,r.isolates,!1,r.order))}return i}}function Cn(e,t,i){for(let n=e.state.facet(t),s=n.length-1;s>=0;s--){let t=n[s],r="function"==typeof t?t(e):t;r&&b(r,i)}return i}const wn=v.mac?"mac":v.windows?"win":v.linux?"linux":"key";function Sn(e,t,i){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==i&&t.shiftKey&&(e="Shift-"+e),e}const xn=n.Nb.default(mn.domEventHandlers({keydown:(e,t)=>Rn(Mn(t.state),e,t,"editor")})),En=n.sj.define({enables:xn}),An=new WeakMap;function Mn(e){let t=e.facet(En),i=An.get(t);return i||An.set(t,i=function(e,t=wn){let i=Object.create(null),n=Object.create(null),s=(e,t)=>{let i=n[e];if(null==i)n[e]=t;else if(i!=t)throw new Error("Key binding "+e+" is used both as a regular binding and as a multi-stroke prefix")},r=(e,n,r,o,a)=>{var l,c;let h=i[e]||(i[e]=Object.create(null)),u=n.split(/ (?!$)/).map(e=>function(e,t){const i=e.split(/-(?!$)/);let n,s,r,o,a=i[i.length-1];"Space"==a&&(a=" ");for(let e=0;e<i.length-1;++e){const a=i[e];if(/^(cmd|meta|m)$/i.test(a))o=!0;else if(/^a(lt)?$/i.test(a))n=!0;else if(/^(c|ctrl|control)$/i.test(a))s=!0;else if(/^s(hift)?$/i.test(a))r=!0;else{if(!/^mod$/i.test(a))throw new Error("Unrecognized modifier name: "+a);"mac"==t?o=!0:s=!0}}return n&&(a="Alt-"+a),s&&(a="Ctrl-"+a),o&&(a="Meta-"+a),r&&(a="Shift-"+a),a}(e,t));for(let t=1;t<u.length;t++){let i=u.slice(0,t).join(" ");s(i,!0),h[i]||(h[i]={preventDefault:!0,stopPropagation:!1,run:[t=>{let n=Dn={view:t,prefix:i,scope:e};return setTimeout(()=>{Dn==n&&(Dn=null)},4e3),!0}]})}let d=u.join(" ");s(d,!1);let p=h[d]||(h[d]={preventDefault:!1,stopPropagation:!1,run:(null===(c=null===(l=h._any)||void 0===l?void 0:l.run)||void 0===c?void 0:c.slice())||[]});r&&p.run.push(r),o&&(p.preventDefault=!0),a&&(p.stopPropagation=!0)};for(let n of e){let e=n.scope?n.scope.split(" "):["editor"];if(n.any)for(let t of e){let e=i[t]||(i[t]=Object.create(null));e._any||(e._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:s}=n;for(let t in e)e[t].run.push(e=>s(e,In))}let s=n[t]||n.key;if(s)for(let t of e)r(t,s,n.run,n.preventDefault,n.stopPropagation),n.shift&&r(t,"Shift-"+s,n.shift,n.preventDefault,n.stopPropagation)}return i}(t.reduce((e,t)=>e.concat(t),[]))),i}function Tn(e,t,i){return Rn(Mn(e.state),t,e,i)}let Dn=null,In=null;function Rn(e,t,i,s){In=t;let o=(0,r.xT)(t),a=(0,n.vS)(o,0),l=(0,n.Fh)(a)==o.length&&" "!=o,c="",h=!1,u=!1,d=!1;Dn&&Dn.view==i&&Dn.scope==s&&(c=Dn.prefix+" ",ri.indexOf(t.keyCode)<0&&(u=!0,Dn=null));let p,g,f=new Set,m=e=>{if(e){for(let t of e.run)if(!f.has(t)&&(f.add(t),t(i)))return e.stopPropagation&&(d=!0),!0;e.preventDefault&&(e.stopPropagation&&(d=!0),u=!0)}return!1},y=e[s];return y&&(m(y[c+Sn(o,t,!l)])?h=!0:!l||!(t.altKey||t.metaKey||t.ctrlKey)||v.windows&&t.ctrlKey&&t.altKey||v.mac&&t.altKey&&!t.ctrlKey&&!t.metaKey||!(p=r.E3[t.keyCode])||p==o?l&&t.shiftKey&&m(y[c+Sn(o,t,!0)])&&(h=!0):(m(y[c+Sn(p,t,!0)])||t.shiftKey&&(g=r.BN[t.keyCode])!=o&&g!=p&&m(y[c+Sn(g,t,!1)]))&&(h=!0),!h&&m(y._any)&&(h=!0)),u&&(h=!0),h&&d&&t.stopPropagation(),In=null,h}class kn{constructor(e,t,i,n,s){this.className=e,this.left=t,this.top=i,this.width=n,this.height=s}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className==this.className&&(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",null!=this.width&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,i){if(i.empty){let n=e.coordsAtPos(i.head,i.assoc||1);if(!n)return[];let s=Pn(e);return[new kn(t,n.left-s.left,n.top-s.top,null,n.bottom-n.top)]}return function(e,t,i){if(i.to<=e.viewport.from||i.from>=e.viewport.to)return[];let n=Math.max(i.from,e.viewport.from),s=Math.min(i.to,e.viewport.to),r=e.textDirection==oe.LTR,o=e.contentDOM,a=o.getBoundingClientRect(),l=Pn(e),c=o.querySelector(".cm-line"),h=c&&window.getComputedStyle(c),u=a.left+(h?parseInt(h.paddingLeft)+Math.min(0,parseInt(h.textIndent)):0),d=a.right-(h?parseInt(h.paddingRight):0),p=Nt(e,n,1),g=Nt(e,s,-1),f=p.type==A.Text?p:null,m=g.type==A.Text?g:null;if(f&&(e.lineWrapping||p.widgetLineBreaks)&&(f=_n(e,n,1,f)),m&&(e.lineWrapping||g.widgetLineBreaks)&&(m=_n(e,s,-1,m)),f&&m&&f.from==m.from&&f.to==m.to)return v(b(i.from,i.to,f));{let t=f?b(i.from,null,f):C(p,!1),n=m?b(null,i.to,m):C(g,!0),s=[];return(f||p).to<(m||g).from-(f&&m?1:0)||p.widgetLineBreaks>1&&t.bottom+e.defaultLineHeight/2<n.top?s.push(y(u,t.bottom,d,n.top)):t.bottom<n.top&&e.elementAtHeight((t.bottom+n.top)/2).type==A.Text&&(t.bottom=n.top=(t.bottom+n.top)/2),v(t).concat(s).concat(v(n))}function y(e,i,n,s){return new kn(t,e-l.left,i-l.top,Math.max(0,n-e),s-i)}function v({top:e,bottom:t,horizontal:i}){let n=[];for(let s=0;s<i.length;s+=2)n.push(y(i[s],e,i[s+1],t));return n}function b(t,i,n){let s=1e9,o=-1e9,a=[];function l(t,i,l,c,h){let p=e.coordsAtPos(t,t==n.to?-2:2),g=e.coordsAtPos(l,l==n.from?2:-2);p&&g&&(s=Math.min(p.top,g.top,s),o=Math.max(p.bottom,g.bottom,o),h==oe.LTR?a.push(r&&i?u:p.left,r&&c?d:g.right):a.push(!r&&c?u:g.left,!r&&i?d:p.right))}let c=null!=t?t:n.from,h=null!=i?i:n.to;for(let n of e.visibleRanges)if(n.to>c&&n.from<h)for(let s=Math.max(n.from,c),r=Math.min(n.to,h);;){let n=e.state.doc.lineAt(s);for(let o of e.bidiSpans(n)){let e=o.from+n.from,a=o.to+n.from;if(e>=r)break;a>s&&l(Math.max(e,s),null==t&&e<=c,Math.min(a,r),null==i&&a>=h,o.dir)}if(s=n.to+1,s>=r)break}return 0==a.length&&l(c,null==t,h,null==i,e.textDirection),{top:s,bottom:o,horizontal:a}}function C(e,t){let i=a.top+(t?e.top:e.bottom);return{top:i,bottom:i,horizontal:[]}}}(e,t,i)}}function Pn(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==oe.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function _n(e,t,i,n){let s=e.coordsAtPos(t,2*i);if(!s)return n;let r=e.dom.getBoundingClientRect(),o=(s.top+s.bottom)/2,a=e.posAtCoords({x:r.left+1,y:o}),l=e.posAtCoords({x:r.right-1,y:o});return null==a||null==l?n:{from:Math.max(n.from,Math.min(a,l)),to:Math.min(n.to,Math.max(a,l))}}class Ln{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(Nn)!=e.state.facet(Nn)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){!1!==this.layer.updateOnDocViewUpdate&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,i=e.facet(Nn);for(;t<i.length&&i[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;e==this.scaleX&&t==this.scaleY||(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((e,t)=>{return i=e,n=this.drawn[t],!(i.constructor==n.constructor&&i.eq(n));var i,n})){let t=this.dom.firstChild,i=0;for(let n of e)n.update&&t&&n.constructor&&this.drawn[i].constructor&&n.update(t,this.drawn[i])?(t=t.nextSibling,i++):this.dom.insertBefore(n.draw(),t);for(;t;){let e=t.nextSibling;t.remove(),t=e}this.drawn=e,v.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Nn=n.sj.define();function On(e){return[We.define(t=>new Ln(t,e)),Nn.of(e)]}const Fn=!v.ios,Gn=n.sj.define({combine:e=>(0,n.QR)(e,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})});function Bn(e={}){return[Gn.of(e),Hn,zn,jn,Ne.of(!0)]}function Vn(e){return e.startState.facet(Gn)!=e.state.facet(Gn)}const Hn=On({above:!0,markers(e){let{state:t}=e,i=t.facet(Gn),s=[];for(let r of t.selection.ranges){let o=r==t.selection.main;if(r.empty||i.drawRangeCursor&&!(o&&v.ios&&i.iosSelectionHandles)){let t=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",i=r.empty?r:n.OF.cursor(r.head,r.assoc);for(let n of kn.forRange(e,t,i))s.push(n)}}return s},update(e,t){e.transactions.some(e=>e.selection)&&(t.style.animationName="cm-blink"==t.style.animationName?"cm-blink2":"cm-blink");let i=Vn(e);return i&&Un(e.state,t),e.docChanged||e.selectionSet||i},mount(e,t){Un(t.state,e)},class:"cm-cursorLayer"});function Un(e,t){t.style.animationDuration=e.facet(Gn).cursorBlinkRate+"ms"}const zn=On({above:!1,markers(e){let t=[],{main:i,ranges:s}=e.state.selection;for(let n of s)if(!n.empty&&(Fn||n!=i))for(let i of kn.forRange(e,"cm-selectionBackground",n))t.push(i);if(v.ios&&!i.empty&&e.state.facet(Gn).iosSelectionHandles){for(let s of kn.forRange(e,"cm-selectionHandle cm-selectionHandle-start",n.OF.cursor(i.from,1)))t.push(s);for(let s of kn.forRange(e,"cm-selectionHandle cm-selectionHandle-end",n.OF.cursor(i.to,1)))t.push(s)}return t},update:(e,t)=>e.docChanged||e.selectionSet||e.viewportChanged||Vn(e),class:"cm-selectionLayer"}),Wn=v.gecko&&153==v.gecko_version?"#ffffff01":"transparent",jn=n.Nb.highest(mn.theme({".cm-line":{...Fn?{"& ::selection, &::selection":{backgroundColor:`${Wn} !important`}}:{},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important",...Fn?{"&::selection, & ::selection":{backgroundColor:"Highlight !important"}}:{}}}})),$n=n.Pe.define({map:(e,t)=>null==e?null:t.mapPos(e)}),Kn=n.sU.define({create:()=>null,update:(e,t)=>(null!=e&&(e=t.changes.mapPos(e)),t.effects.reduce((e,t)=>t.is($n)?t.value:e,e))}),Yn=We.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let i=e.state.field(Kn);null==i?null!=this.cursor&&(null===(t=this.cursor)||void 0===t||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field(Kn)!=i||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(Kn),i=null!=t&&e.coordsAtPos(t);if(!i)return null;let n=e.scrollDOM.getBoundingClientRect();return{left:i.left-n.left+e.scrollDOM.scrollLeft*e.scaleX,top:i.top-n.top+e.scrollDOM.scrollTop*e.scaleY,height:i.bottom-i.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:i}=this.view;e?(this.cursor.style.left=e.left/t+"px",this.cursor.style.top=e.top/i+"px",this.cursor.style.height=e.height/i+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(Kn)!=e&&this.view.dispatch({effects:$n.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){e.target!=this.view.contentDOM&&this.view.contentDOM.contains(e.relatedTarget)||this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function qn(){return[Kn,Yn]}function Xn(e,t,i,n,s){t.lastIndex=0;for(let r,o=e.iterRange(i,n),a=i;!o.next().done;a+=o.value.length)if(!o.lineBreak)for(;r=t.exec(o.value);)s(a+r.index,r)}class Zn{constructor(e){const{regexp:t,decoration:i,decorate:n,boundary:s,maxLength:r=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,n)this.addMatch=(e,t,i,s)=>n(s,i,i+e[0].length,e,t);else if("function"==typeof i)this.addMatch=(e,t,n,s)=>{let r=i(e,t,n);r&&s(n,n+e[0].length,r)};else{if(!i)throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.addMatch=(e,t,n,s)=>s(n,n+e[0].length,i)}this.boundary=s,this.maxLength=r}createDeco(e){let t=new n.vB,i=t.add.bind(t);for(let{from:t,to:n}of function(e,t){let i=e.visibleRanges;if(1==i.length&&i[0].from==e.viewport.from&&i[0].to==e.viewport.to)return i;let n=[];for(let{from:s,to:r}of i)s=Math.max(e.state.doc.lineAt(s).from,s-t),r=Math.min(e.state.doc.lineAt(r).to,r+t),n.length&&n[n.length-1].to>=s?n[n.length-1].to=r:n.push({from:s,to:r});return n}(e,this.maxLength))Xn(e.state.doc,this.regexp,t,n,(t,n)=>this.addMatch(n,e,t,i));return t.finish()}updateDeco(e,t){let i=1e9,n=-1;return e.docChanged&&e.changes.iterChanges((t,s,r,o)=>{o>=e.view.viewport.from&&r<=e.view.viewport.to&&(i=Math.min(r,i),n=Math.max(o,n))}),e.viewportMoved||n-i>1e3?this.createDeco(e.view):n>-1?this.updateRange(e.view,t.map(e.changes),i,n):t}updateRange(e,t,i,n){for(let s of e.visibleRanges){let r=Math.max(s.from,i),o=Math.min(s.to,n);if(o>=r){let i=e.state.doc.lineAt(r),n=i.to<o?e.state.doc.lineAt(o):i,a=Math.max(s.from,i.from),l=Math.min(s.to,n.to);if(this.boundary){for(;r>i.from;r--)if(this.boundary.test(i.text[r-1-i.from])){a=r;break}for(;o<n.to;o++)if(this.boundary.test(n.text[o-n.from])){l=o;break}}let c,h=[],u=(e,t,i)=>h.push(i.range(e,t));if(i==n)for(this.regexp.lastIndex=a-i.from;(c=this.regexp.exec(i.text))&&c.index<l-i.from;)this.addMatch(c,e,c.index+i.from,u);else Xn(e.state.doc,this.regexp,a,l,(t,i)=>this.addMatch(i,e,t,u));t=t.update({filterFrom:a,filterTo:l,filter:(e,t)=>e<a||t>l,add:h})}}return t}}const Qn=null!=/x/.unicode?"gu":"g",Jn=new RegExp("[\0-\b\n--­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\ufeff￹-￼]",Qn),es={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let ts=null;const is=n.sj.define({combine(e){let t=(0,n.QR)(e,{render:null,specialChars:Jn,addSpecialChars:null});return(t.replaceTabs=!function(){var e;if(null==ts&&"undefined"!=typeof document&&document.body){let t=document.body.style;ts=null!=(null!==(e=t.tabSize)&&void 0!==e?e:t.MozTabSize)}return ts||!1}())&&(t.specialChars=new RegExp("\t|"+t.specialChars.source,Qn)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,Qn)),t}});function ns(e={}){return[is.of(e),ss||(ss=We.fromClass(class{constructor(e){this.view=e,this.decorations=M.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(is)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new Zn({regexp:e.specialChars,decoration:(t,i,s)=>{let{doc:r}=i.state,o=(0,n.vS)(t[0],0);if(9==o){let e=r.lineAt(s),t=i.state.tabSize,o=(0,n.y$)(e.text,t,s-e.from);return M.replace({widget:new os((t-o%t)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=M.replace({widget:new rs(e,o)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(is);e.startState.facet(is)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))]}let ss=null;class rs extends E{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=(i=this.code)>=32?"•":10==i?"␤":String.fromCharCode(9216+i);var i;let n=e.state.phrase("Control character")+" "+(es[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,n,t);if(s)return s;let r=document.createElement("span");return r.textContent=t,r.title=n,r.setAttribute("aria-label",n),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class os extends E{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent="\t",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function as(){return cs}const ls=M.line({class:"cm-activeLine"}),cs=We.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,i=[];for(let n of e.state.selection.ranges){let s=e.lineBlockAt(n.head);s.from>t&&(i.push(ls.range(s.from)),t=s.from)}return M.set(i)}},{decorations:e=>e.decorations}),hs=2e3;function us(e,t){let i=e.posAtCoords({x:t.clientX,y:t.clientY},!1),s=e.state.doc.lineAt(i),r=i-s.from,o=r>hs?-1:r==s.length?function(e,t){let i=e.coordsAtPos(e.viewport.from);return i?Math.round(Math.abs((i.left-t)/e.defaultCharacterWidth)):-1}(e,t.clientX):(0,n.y$)(s.text,e.state.tabSize,i-s.from);return{line:s.number,col:o,off:r}}function ds(e){let t=(null==e?void 0:e.eventFilter)||(e=>e.altKey&&0==e.button);return mn.mouseSelectionStyle.of((e,i)=>t(i)?function(e,t){let i=us(e,t),s=e.state.selection;return i?{update(e){if(e.docChanged){let t=e.changes.mapPos(e.startState.doc.line(i.line).from),n=e.state.doc.lineAt(t);i={line:n.number,col:i.col,off:Math.min(i.off,n.length)},s=s.map(e.changes)}},get(t,r,o){let a=us(e,t);if(!a)return s;let l=function(e,t,i){let s=Math.min(t.line,i.line),r=Math.max(t.line,i.line),o=[];if(t.off>hs||i.off>hs||t.col<0||i.col<0){let a=Math.min(t.off,i.off),l=Math.max(t.off,i.off);for(let t=s;t<=r;t++){let i=e.doc.line(t);i.length<=l&&o.push(n.OF.range(i.from+a,i.to+l))}}else{let a=Math.min(t.col,i.col),l=Math.max(t.col,i.col);for(let t=s;t<=r;t++){let i=e.doc.line(t),s=(0,n.kn)(i.text,a,e.tabSize,!0);if(s<0)o.push(n.OF.cursor(i.to));else{let t=(0,n.kn)(i.text,l,e.tabSize);o.push(n.OF.range(i.from+s,i.from+t))}}}return o}(e.state,i,a);return l.length?o?n.OF.create(l.concat(s.ranges)):n.OF.create(l):s}}:null}(e,i):null)}const ps={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},gs={style:"cursor: crosshair"};function fs(e={}){let[t,i]=ps[e.key||"Alt"],n=We.fromClass(class{constructor(e){this.view=e,this.isDown=!1}set(e){this.isDown!=e&&(this.isDown=e,this.view.update([]))}},{eventObservers:{keydown(e){this.set(e.keyCode==t||i(e))},keyup(e){e.keyCode!=t&&i(e)||this.set(!1)},mousemove(e){this.set(i(e))}}});return[n,mn.contentAttributes.of(e=>{var t;return(null===(t=e.plugin(n))||void 0===t?void 0:t.isDown)?gs:null})]}const ms="-10000px";class ys{constructor(e,t,i,n){this.facet=t,this.createTooltipView=i,this.removeTooltipView=n,this.input=e.state.facet(t),this.tooltips=this.input.filter(e=>e);let s=null;this.tooltipViews=this.tooltips.map(e=>s=i(e,s))}update(e,t){var i;let n=e.state.facet(this.facet),s=n.filter(e=>e);if(n===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let r=[],o=t?[]:null;for(let i=0;i<s.length;i++){let n=s[i],a=-1;if(n){for(let e=0;e<this.tooltips.length;e++){let t=this.tooltips[e];t&&t.create==n.create&&(a=e)}if(a<0)r[i]=this.createTooltipView(n,i?r[i-1]:null),o&&(o[i]=!!n.above);else{let n=r[i]=this.tooltipViews[a];o&&(o[i]=t[a]),n.update&&n.update(e)}}}for(let e of this.tooltipViews)r.indexOf(e)<0&&(this.removeTooltipView(e),null===(i=e.destroy)||void 0===i||i.call(e));return t&&(o.forEach((e,i)=>t[i]=e),t.length=o.length),this.input=n,this.tooltips=s,this.tooltipViews=r,!0}}function vs(e){let t=e.dom.ownerDocument.documentElement,i=t.clientWidth,n=getComputedStyle(t);if(!/stable/.test(n.scrollbarGutter||""))return{left:0,right:i};let s=t.getBoundingClientRect(),r=e.win.scrollX;return{left:Math.max(0,s.left+r-parseFloat(n.marginLeft)),right:Math.min(i,s.right+r+parseFloat(n.marginRight))}}function bs(e){let{left:t,right:i}=vs(e);return{top:0,left:t,right:i,bottom:e.dom.ownerDocument.documentElement.clientHeight}}const Cs=n.sj.define({combine:e=>{var t,i,n;return{position:v.ios?"absolute":(null===(t=e.find(e=>e.position))||void 0===t?void 0:t.position)||"fixed",parent:(null===(i=e.find(e=>e.parent))||void 0===i?void 0:i.parent)||null,tooltipSpace:(null===(n=e.find(e=>e.tooltipSpace))||void 0===n?void 0:n.tooltipSpace)||bs}}}),ws=new WeakMap,Ss=We.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(Cs);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver="function"==typeof ResizeObserver?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new ys(e,Ms,(e,t)=>this.createTooltip(e,t),e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()}),this.above=this.manager.tooltips.map(e=>!!e.above),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver(e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let i=t||e.geometryChanged,n=e.state.facet(Cs);if(n.position!=this.position&&!this.madeAbsolute){this.position=n.position;for(let e of this.manager.tooltipViews)e.dom.style.position=this.position;i=!0}if(n.parent!=this.parent){this.parent&&this.container.remove(),this.parent=n.parent,this.createContainer();for(let e of this.manager.tooltipViews)this.container.appendChild(e.dom);i=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);i&&this.maybeMeasure()}createTooltip(e,t){let i=e.create(this.view),n=t?t.dom:null;if(i.dom.classList.add("cm-tooltip"),e.arrow&&!i.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let e=document.createElement("div");e.className="cm-tooltip-arrow",i.dom.appendChild(e)}return i.dom.style.position=this.position,i.dom.style.top=ms,i.dom.style.left="0px",this.container.insertBefore(i.dom,n),i.mount&&i.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(i.dom),i}destroy(){var e,t,i;this.view.win.removeEventListener("resize",this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),null===(e=t.destroy)||void 0===e||e.call(t);this.parent&&this.container.remove(),null===(t=this.resizeObserver)||void 0===t||t.disconnect(),null===(i=this.intersectionObserver)||void 0===i||i.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,i=!1,n=0;if("fixed"==this.position&&this.manager.tooltipViews.length){let{dom:e}=this.manager.tooltipViews[0];if(v.safari){let t=e.getBoundingClientRect();i=Math.abs(t.top+1e4)>1||Math.abs(t.left)>1}else i=!!e.offsetParent&&e.offsetParent!=this.container.ownerDocument.body}if(i||"absolute"==this.position)if(this.parent){let i=this.parent.getBoundingClientRect();i.width&&i.height&&(e=i.width/this.parent.offsetWidth,t=i.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);else n=vs(this.view).left;let s=this.view.scrollDOM.getBoundingClientRect(),r=tt(this.view);return{visible:{left:s.left+r.left,top:s.top+r.top,right:s.right-r.right,bottom:s.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((e,t)=>{let i=this.manager.tooltipViews[t];return i.getCoords?i.getCoords(e.pos):this.view.coordsAtPos(e.pos)}),size:this.manager.tooltipViews.map(({dom:e})=>e.getBoundingClientRect()),space:this.view.state.facet(Cs).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:i,fixedLeft:n}}writeMeasure(e){var t;if(e.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let e of this.manager.tooltipViews)e.dom.style.position="absolute"}let{visible:i,space:n,scaleX:s,scaleY:r}=e,o=[];for(let a=0;a<this.manager.tooltips.length;a++){let l=this.manager.tooltips[a],c=this.manager.tooltipViews[a],{dom:h}=c,u=e.pos[a],d=e.size[a];if(!u||!1!==l.clip&&(u.bottom<=Math.max(i.top,n.top)||u.top>=Math.min(i.bottom,n.bottom)||u.right<Math.max(i.left,n.left)-.1||u.left>Math.min(i.right,n.right)+.1)){h.style.top=ms;continue}let p=l.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,g=p?7:0,f=d.right-d.left,m=null!==(t=ws.get(c))&&void 0!==t?t:d.bottom-d.top,y=c.offset||As,v=this.view.textDirection==oe.LTR,b=d.width>n.right-n.left?v?n.left:n.right-d.width:v?Math.max(n.left,Math.min(u.left-(p?14:0)+y.x,n.right-f)):Math.min(Math.max(n.left,u.left-f+(p?14:0)-y.x),n.right-f),C=this.above[a];!l.strictSide&&(C?u.top-m-g-y.y<n.top:u.bottom+m+g+y.y>n.bottom)&&C==n.bottom-u.bottom>u.top-n.top&&(C=this.above[a]=!C);let w=(C?u.top-n.top:n.bottom-u.bottom)-g;if(w<m&&!1!==c.resize){if(w<this.view.defaultLineHeight){h.style.top=ms;continue}ws.set(c,m),h.style.height=(m=w)/r+"px"}else h.style.height&&(h.style.height="");let S=C?u.top-m-g-y.y:u.bottom+g+y.y,x=b+f;if(!0!==c.overlap)for(let e of o)e.left<x&&e.right>b&&e.top<S+m&&e.bottom>S&&(S=C?e.top-m-2-g:e.bottom+g+2);if("absolute"==this.position?(h.style.top=(S-e.parent.top)/r+"px",xs(h,(b-e.parent.left)/s)):(h.style.top=S/r+"px",xs(h,(b-e.fixedLeft)/s)),p){let e=u.left+(v?y.x:-y.x)-(b+14-7);p.style.left=e/s+"px"}!0!==c.overlap&&o.push({left:b,top:S,right:x,bottom:S+m}),h.classList.toggle("cm-tooltip-above",C),h.classList.toggle("cm-tooltip-below",!C),c.positioned&&c.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=ms}},{eventObservers:{scroll(){this.maybeMeasure()}}});function xs(e,t){let i=parseInt(e.style.left,10);(isNaN(i)||Math.abs(t-i)>1)&&(e.style.left=t+"px")}const Es=mn.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),As={x:0,y:0},Ms=n.sj.define({enables:[Ss,Es]}),Ts=n.sj.define({combine:e=>e.reduce((e,t)=>e.concat(t),[])});class Ds{static create(e){return new Ds(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new ys(e,Ts,(e,t)=>this.createHostedView(e,t),e=>e.dom.remove())}createHostedView(e,t){let i=e.create(this.view);return i.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(i.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)null===(e=t.destroy)||void 0===e||e.call(t)}passProp(e){let t;for(let i of this.manager.tooltipViews){let n=i[e];if(void 0!==n)if(void 0===t)t=n;else if(t!==n)return}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const Is=Ms.compute([Ts],e=>{let t=e.facet(Ts);return 0===t.length?null:{pos:Math.min(...t.map(e=>e.pos)),end:Math.max(...t.map(e=>{var t;return null!==(t=e.end)&&void 0!==t?t:e.pos})),create:Ds.create,above:t[0].above,arrow:t.some(e=>e.arrow)}}),Rs=n.sj.define();class ks{constructor(e,t,i,n,s,r){this.view=e,this.source=t,this.field=i,this.locked=n,this.setHover=s,this.hoverTime=r,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(e){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,i=e.docView.tile.nearest(t.target);if(!i)return;let n,s=1;if(i.isWidget())n=i.posAtStart;else{if(n=e.posAtCoords(t),null==n)return;let i=e.coordsAtPos(n);if(!i||t.y<i.top||t.y>i.bottom||t.x<i.left-e.defaultCharacterWidth||t.x>i.right+e.defaultCharacterWidth)return;let r=e.bidiSpans(e.state.doc.lineAt(n)).find(e=>e.from<=n&&e.to>=n),o=r&&r.dir==oe.RTL?-1:1;s=t.x<i.left?-o:o}this.activateHover(e,n,s)}activateHover(e,t,i,n){let s=this.source(e,t,i),r=t=>{if(t&&(!Array.isArray(t)||t.length)){let i=Array.isArray(t)?t:[t];n&&this.locked.set(i,n),e.dispatch({effects:this.setHover.of(i)})}};if(s&&"then"in s){let i=this.pending={pos:t};s.then(e=>{this.pending==i&&(this.pending=null,r(e))},t=>Ve(e.state,t,"hover tooltip"))}else r(s)}get tooltip(){let e=this.view.plugin(Ss),t=e?e.manager.tooltips.findIndex(e=>e.create==Ds.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,i;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:n,tooltip:s}=this;if(n.length&&!this.locked.has(n)&&s&&!function(e,t){let i,{left:n,right:s,top:r,bottom:o}=e.getBoundingClientRect();if(i=e.querySelector(".cm-tooltip-arrow")){let e=i.getBoundingClientRect();r=Math.min(e.top,r),o=Math.max(e.bottom,o)}return t.clientX>=n-4&&t.clientX<=s+4&&t.clientY>=r-4&&t.clientY<=o+4}(s.dom,e)||this.pending){let{pos:s}=n[0]||this.pending,r=null!==(i=null===(t=n[0])||void 0===t?void 0:t.end)&&void 0!==i?i:s;(s==r?this.view.posAtCoords(this.lastMove)==s:function(e,t,i,n,s){let r=e.scrollDOM.getBoundingClientRect(),o=e.documentTop+e.documentPadding.top+e.contentHeight;if(r.left>n||r.right<n||r.top>s||Math.min(r.bottom,o)<s)return!1;let a=e.posAtCoords({x:n,y:s},!1);return a>=t&&a<=i}(this.view,s,r,e.clientX,e.clientY))||(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length&&!this.locked.has(t)){let{tooltip:t}=this;t&&t.dom.contains(e.relatedTarget)?this.watchTooltipLeave(t.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=i=>{e.removeEventListener("mouseleave",t);let{active:n}=this;!n.length||this.locked.has(n)||this.view.dom.contains(i.relatedTarget)||this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}function Ps(e,t={}){let i=n.Pe.define(),s=new WeakMap,r=n.sU.define({create:()=>[],update(e,o){let a=s.get(e);if(e.length&&(t.hideOnChange&&(o.docChanged||o.selection)||a&&a(o)?e=[]:t.hideOn&&(e=e.filter(e=>!t.hideOn(o,e)))),o.docChanged&&e.length){let t=[];for(let i of e){let e=o.changes.mapPos(i.pos,-1,n.iR.TrackDel);if(null!=e){let n=Object.assign(Object.create(null),i);n.pos=e,null!=n.end&&(n.end=o.changes.mapPos(n.end)),t.push(n)}}e=t}for(let t of o.effects)t.is(i)&&(e=t.value,a=void 0),(t.is(Ns)&&!t.value||t.value==r)&&(e=[]);return e.length&&a&&s.set(e,a),e},provide:e=>Ts.from(e)});const o=We.define(n=>new ks(n,e,r,s,i,t.hoverTime||300));return{active:r,extension:[r,o,Rs.of(o),Is]}}function _s(e,t,i,n={}){var s;let r=e.state.facet(Rs).map(t=>e.plugin(t)).filter(e=>!!e);if(n.tooltip&&n.tooltip.active){let e=r.find(e=>e.field==n.tooltip.active);e&&(r=[e])}for(let o of r)o.activateHover(e,t,i,null!==(s=n.until)&&void 0!==s?s:()=>!1)}function Ls(e,t){let i=e.plugin(Ss);if(!i)return null;let n=i.manager.tooltips.indexOf(t);return n<0?null:i.manager.tooltipViews[n]}const Ns=n.Pe.define(),Os=n.sj.define({combine(e){let t,i;for(let n of e)t=t||n.topContainer,i=i||n.bottomContainer;return{topContainer:t,bottomContainer:i}}});function Fs(e,t){let i=e.plugin(Gs),n=i?i.specs.indexOf(t):-1;return n>-1?i.panels[n]:null}const Gs=We.fromClass(class{constructor(e){this.input=e.state.facet(Hs),this.specs=this.input.filter(e=>e),this.panels=this.specs.map(t=>t(e));let t=e.state.facet(Os);this.top=new Bs(e,!0,t.topContainer),this.bottom=new Bs(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(e=>e.top)),this.bottom.sync(this.panels.filter(e=>!e.top));for(let e of this.panels)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}update(e){let t=e.state.facet(Os);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new Bs(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new Bs(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let i=e.state.facet(Hs);if(i!=this.input){let t=i.filter(e=>e),n=[],s=[],r=[],o=[];for(let i of t){let t,a=this.specs.indexOf(i);a<0?(t=i(e.view),o.push(t)):(t=this.panels[a],t.update&&t.update(e)),n.push(t),(t.top?s:r).push(t)}this.specs=t,this.panels=n,this.top.sync(s),this.bottom.sync(r);for(let e of o)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}else for(let t of this.panels)t.update&&t.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>mn.scrollMargins.of(t=>{let i=t.plugin(e);return i&&{top:i.top.scrollMargin(),bottom:i.bottom.scrollMargin()}})});class Bs{constructor(e,t,i){this.view=e,this.top=t,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(0==this.panels.length)return void(this.dom&&(this.dom.remove(),this.dom=void 0));if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom";let e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=Vs(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=Vs(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(this.container&&this.classes!=this.view.themeClasses){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function Vs(e){let t=e.nextSibling;return e.remove(),t}const Hs=n.sj.define({enables:Gs});function Us(e,t){let i,s=new Promise(e=>i=e),r=e=>function(e,t,i){let n=t.content?t.content(e,()=>a(null)):null;if(!n){if(n=(0,o.A)("form"),t.input){let e=(0,o.A)("input",t.input);/^(text|password|number|email|tel|url)$/.test(e.type)&&e.classList.add("cm-textfield"),e.name||(e.name="input"),n.appendChild((0,o.A)("label",(t.label||"")+": ",e))}else n.appendChild(document.createTextNode(t.label||""));n.appendChild(document.createTextNode(" ")),n.appendChild((0,o.A)("button",{class:"cm-button",type:"submit"},t.submitLabel||"OK"))}let s="FORM"==n.nodeName?[n]:n.querySelectorAll("form");for(let e=0;e<s.length;e++){let t=s[e];t.addEventListener("keydown",e=>{27==e.keyCode?(e.preventDefault(),a(null)):13==e.keyCode&&(e.preventDefault(),a(t))}),t.addEventListener("submit",e=>{e.preventDefault(),a(t)})}let r=(0,o.A)("div",n,(0,o.A)("button",{onclick:()=>a(null),"aria-label":e.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));function a(t){r.contains(r.ownerDocument.activeElement)&&e.focus(),i(t)}return t.class&&(r.className=t.class),r.classList.add("cm-dialog"),{dom:r,top:t.top,mount:()=>{if(t.focus){let e;e="string"==typeof t.focus?n.querySelector(t.focus):n.querySelector("input")||n.querySelector("button"),e&&"select"in e?e.select():e&&"focus"in e&&e.focus()}}}}(e,t,i);e.state.field(Ws,!1)?e.dispatch({effects:js.of(r)}):e.dispatch({effects:n.Pe.appendConfig.of(Ws.init(()=>[r]))});let a=$s.of(r);return{close:a,result:s.then(t=>((e.win.queueMicrotask||(t=>e.win.setTimeout(t,10)))(()=>{e.state.field(Ws).indexOf(r)>-1&&e.dispatch({effects:a})}),t))}}function zs(e,t){let i=e.state.field(Ws,!1)||[];for(let n of i){let i=Fs(e,n);if(i&&i.dom.classList.contains(t))return i}return null}const Ws=n.sU.define({create:()=>[],update(e,t){for(let i of t.effects)i.is(js)?e=[i.value].concat(e):i.is($s)&&(e=e.filter(e=>e!=i.value));return e},provide:e=>Hs.computeN([e],t=>t.field(e))}),js=n.Pe.define(),$s=n.Pe.define();class Ks extends n.FB{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Ks.prototype.elementClass="",Ks.prototype.toDOM=void 0,Ks.prototype.mapMode=n.iR.TrackBefore,Ks.prototype.startSide=Ks.prototype.endSide=-1,Ks.prototype.point=!0;const Ys=n.sj.define(),qs=n.sj.define(),Xs={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>n.om.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},Zs=n.sj.define();function Qs(e){return[er(),Zs.of({...Xs,...e})]}const Js=n.sj.define({combine:e=>e.some(e=>e)});function er(e){let t=[tr];return e&&!1===e.fixed&&t.push(Js.of(!0)),t}const tr=We.fromClass(class{constructor(e){this.view=e,this.domAfter=null,this.prevViewport=e.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=e.state.facet(Zs).map(t=>new rr(e,t)),this.fixed=!e.state.facet(Js);for(let e of this.gutters)"after"==e.config.side?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(e){if(this.updateGutters(e)){let t=this.prevViewport,i=e.view.viewport,n=Math.min(t.to,i.to)-Math.max(t.from,i.from);this.syncGutters(n<.8*(i.to-i.from))}if(e.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(Js)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let i=n.om.iter(this.view.state.facet(Ys),this.view.viewport.from),s=[],r=this.gutters.map(e=>new sr(e,this.view.viewport,-this.view.documentPadding.top));for(let e of this.view.viewportLineBlocks)if(s.length&&(s=[]),Array.isArray(e.type)){let t=!0;for(let n of e.type)if(n.type==A.Text&&t){nr(i,s,n.from);for(let e of r)e.line(this.view,n,s);t=!1}else if(n.widget)for(let e of r)e.widget(this.view,n)}else if(e.type==A.Text){nr(i,s,e.from);for(let t of r)t.line(this.view,e,s)}else if(e.widget)for(let t of r)t.widget(this.view,e);for(let e of r)e.finish();e&&(this.view.scrollDOM.insertBefore(this.dom,t),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(e){let t=e.startState.facet(Zs),i=e.state.facet(Zs),s=e.docChanged||e.heightChanged||e.viewportChanged||!n.om.eq(e.startState.facet(Ys),e.state.facet(Ys),e.view.viewport.from,e.view.viewport.to);if(t==i)for(let t of this.gutters)t.update(e)&&(s=!0);else{s=!0;let n=[];for(let s of i){let i=t.indexOf(s);i<0?n.push(new rr(this.view,s)):(this.gutters[i].update(e),n.push(this.gutters[i]))}for(let e of this.gutters)e.dom.remove(),n.indexOf(e)<0&&e.destroy();for(let e of n)"after"==e.config.side?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.gutters=n}return s}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:e=>mn.scrollMargins.of(t=>{let i=t.plugin(e);if(!i||0==i.gutters.length||!i.fixed)return null;let n=i.dom.offsetWidth*t.scaleX,s=i.domAfter?i.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==oe.LTR?{left:n,right:s}:{right:n,left:s}})});function ir(e){return Array.isArray(e)?e:[e]}function nr(e,t,i){for(;e.value&&e.from<=i;)e.from==i&&t.push(e.value),e.next()}class sr{constructor(e,t,i){this.gutter=e,this.height=i,this.i=0,this.cursor=n.om.iter(e.markers,t.from)}addElement(e,t,i){let{gutter:n}=this,s=(t.top-this.height)/e.scaleY,r=t.height/e.scaleY;if(this.i==n.elements.length){let t=new or(e,r,s,i);n.elements.push(t),n.dom.appendChild(t.dom)}else n.elements[this.i].update(e,r,s,i);this.height=t.bottom,this.i++}line(e,t,i){let n=[];nr(this.cursor,n,t.from),i.length&&(n=n.concat(i));let s=this.gutter.config.lineMarker(e,t,n);s&&n.unshift(s);let r=this.gutter;(0!=n.length||r.config.renderEmptyElements)&&this.addElement(e,t,n)}widget(e,t){let i=this.gutter.config.widgetMarker(e,t.widget,t),n=i?[i]:null;for(let i of e.state.facet(qs)){let s=i(e,t.widget,t);s&&(n||(n=[])).push(s)}n&&this.addElement(e,t,n)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class rr{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in t.domEventHandlers)this.dom.addEventListener(i,n=>{let s,r=n.target;if(r!=this.dom&&this.dom.contains(r)){for(;r.parentNode!=this.dom;)r=r.parentNode;let e=r.getBoundingClientRect();s=(e.top+e.bottom)/2}else s=n.clientY;let o=e.lineBlockAtHeight(s-e.documentTop);t.domEventHandlers[i](e,o,n)&&n.preventDefault()});this.markers=ir(t.markers(e)),t.initialSpacer&&(this.spacer=new or(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=ir(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let t=this.config.updateSpacer(this.spacer.markers[0],e);t!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[t])}let i=e.view.viewport;return!n.om.eq(this.markers,t,i.from,i.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(e)}destroy(){for(let e of this.elements)e.destroy()}}class or{constructor(e,t,i,n){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,i,n)}update(e,t,i,n){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),function(e,t){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++)if(!e[i].compare(t[i]))return!1;return!0}(this.markers,n)||this.setMarkers(e,n)}setMarkers(e,t){let i="cm-gutterElement",n=this.dom.firstChild;for(let s=0,r=0;;){let o=r,a=s<t.length?t[s++]:null,l=!1;if(a){let e=a.elementClass;e&&(i+=" "+e);for(let e=r;e<this.markers.length;e++)if(this.markers[e].compare(a)){o=e,l=!0;break}}else o=this.markers.length;for(;r<o;){let e=this.markers[r++];if(e.toDOM){e.destroy(n);let t=n.nextSibling;n.remove(),n=t}}if(!a)break;a.toDOM&&(l?n=n.nextSibling:this.dom.insertBefore(a.toDOM(e),n)),l&&r++}this.dom.className=i,this.markers=t}destroy(){this.setMarkers(null,[])}}const ar=n.sj.define(),lr=n.sj.define(),cr=n.sj.define({combine:e=>(0,n.QR)(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let i=Object.assign({},e);for(let e in t){let n=i[e],s=t[e];i[e]=n?(e,t,i)=>n(e,t,i)||s(e,t,i):s}return i}})});class hr extends Ks{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function ur(e,t){return e.state.facet(cr).formatNumber(t,e.state)}const dr=Zs.compute([cr],e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers:e=>e.state.facet(ar),lineMarker:(e,t,i)=>i.some(e=>e.toDOM)?null:new hr(ur(e,e.state.doc.lineAt(t.from).number)),widgetMarker:(e,t,i)=>{for(let n of e.state.facet(lr)){let s=n(e,t,i);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(cr)!=e.state.facet(cr),initialSpacer:e=>new hr(ur(e,gr(e.state.doc.lines))),updateSpacer(e,t){let i=ur(t.view,gr(t.view.state.doc.lines));return i==e.number?e:new hr(i)},domEventHandlers:e.facet(cr).domEventHandlers,side:"before"}));function pr(e={}){return[cr.of(e),er(),dr]}function gr(e){let t=9;for(;t<e;)t=10*t+9;return t}const fr=new class extends Ks{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},mr=Ys.compute(["selection"],e=>{let t=[],i=-1;for(let n of e.selection.ranges){let s=e.doc.lineAt(n.head).from;s>i&&(i=s,t.push(fr.range(s)))}return n.om.of(t)});function yr(){return mr}},4830(e,t,i){"use strict";i.d(t,{UE:()=>N,RK:()=>R,ll:()=>T,rD:()=>G,__:()=>D,UU:()=>P,jD:()=>L,mG:()=>O,ER:()=>F,cY:()=>I,iD:()=>A,BN:()=>k,Ej:()=>_});var n=i(51771);function s(e,t,i){let{reference:s,floating:r}=e;const o=(0,n.TV)(t),a=(0,n.Dz)(t),l=(0,n.sq)(a),c=(0,n.C0)(t),h="y"===o,u=s.x+s.width/2-r.width/2,d=s.y+s.height/2-r.height/2,p=s[l]/2-r[l]/2;let g;switch(c){case"top":g={x:u,y:s.y-r.height};break;case"bottom":g={x:u,y:s.y+s.height};break;case"right":g={x:s.x+s.width,y:d};break;case"left":g={x:s.x-r.width,y:d};break;default:g={x:s.x,y:s.y}}switch((0,n.Sg)(t)){case"start":g[a]-=p*(i&&h?-1:1);break;case"end":g[a]+=p*(i&&h?-1:1)}return g}async function r(e,t){var i;void 0===t&&(t={});const{x:s,y:r,platform:o,rects:a,elements:l,strategy:c}=e,{boundary:h="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:g=0}=(0,n._3)(t,e),f=(0,n.nI)(g),m=l[p?"floating"===d?"reference":"floating":d],y=(0,n.B1)(await o.getClippingRect({element:null==(i=await(null==o.isElement?void 0:o.isElement(m)))||i?m:m.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(l.floating)),boundary:h,rootBoundary:u,strategy:c})),v="floating"===d?{x:s,y:r,width:a.floating.width,height:a.floating.height}:a.reference,b=await(null==o.getOffsetParent?void 0:o.getOffsetParent(l.floating)),C=await(null==o.isElement?void 0:o.isElement(b))&&await(null==o.getScale?void 0:o.getScale(b))||{x:1,y:1},w=(0,n.B1)(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:b,strategy:c}):v);return{top:(y.top-w.top+f.top)/C.y,bottom:(w.bottom-y.bottom+f.bottom)/C.y,left:(y.left-w.left+f.left)/C.x,right:(w.right-y.right+f.right)/C.x}}function o(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function a(e){return n.r_.some(t=>e[t]>=0)}function l(e){const t=(0,n.jk)(...e.map(e=>e.left)),i=(0,n.jk)(...e.map(e=>e.top));return{x:t,y:i,width:(0,n.T9)(...e.map(e=>e.right))-t,height:(0,n.T9)(...e.map(e=>e.bottom))-i}}const c=new Set(["left","top"]);var h=i(32125);function u(e){const t=(0,h.L9)(e);let i=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const r=(0,h.sb)(e),o=r?e.offsetWidth:i,a=r?e.offsetHeight:s,l=(0,n.LI)(i)!==o||(0,n.LI)(s)!==a;return l&&(i=o,s=a),{width:i,height:s,$:l}}function d(e){return(0,h.vq)(e)?e:e.contextElement}function p(e){const t=d(e);if(!(0,h.sb)(t))return(0,n.Jx)(1);const i=t.getBoundingClientRect(),{width:s,height:r,$:o}=u(t);let a=(o?(0,n.LI)(i.width):i.width)/s,l=(o?(0,n.LI)(i.height):i.height)/r;return a&&Number.isFinite(a)||(a=1),l&&Number.isFinite(l)||(l=1),{x:a,y:l}}const g=(0,n.Jx)(0);function f(e){const t=(0,h.zk)(e);return(0,h.Tc)()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:g}function m(e,t,i,s){void 0===t&&(t=!1),void 0===i&&(i=!1);const r=e.getBoundingClientRect(),o=d(e);let a=(0,n.Jx)(1);t&&(s?(0,h.vq)(s)&&(a=p(s)):a=p(e));const l=function(e,t,i){return void 0===t&&(t=!1),!(!i||t&&i!==(0,h.zk)(e))&&t}(o,i,s)?f(o):(0,n.Jx)(0);let c=(r.left+l.x)/a.x,u=(r.top+l.y)/a.y,g=r.width/a.x,m=r.height/a.y;if(o){const e=(0,h.zk)(o),t=s&&(0,h.vq)(s)?(0,h.zk)(s):s;let i=e,n=(0,h._m)(i);for(;n&&s&&t!==i;){const e=p(n),t=n.getBoundingClientRect(),s=(0,h.L9)(n),r=t.left+(n.clientLeft+parseFloat(s.paddingLeft))*e.x,o=t.top+(n.clientTop+parseFloat(s.paddingTop))*e.y;c*=e.x,u*=e.y,g*=e.x,m*=e.y,c+=r,u+=o,i=(0,h.zk)(n),n=(0,h._m)(i)}}return(0,n.B1)({width:g,height:m,x:c,y:u})}function y(e,t){const i=(0,h.CP)(e).scrollLeft;return t?t.left+i:m((0,h.ep)(e)).left+i}function v(e,t){const i=e.getBoundingClientRect();return{x:i.left+t.scrollLeft-y(e,i),y:i.top+t.scrollTop}}function b(e,t,i){let s;if("viewport"===t)s=function(e,t){const i=(0,h.zk)(e),n=(0,h.ep)(e),s=i.visualViewport;let r=n.clientWidth,o=n.clientHeight,a=0,l=0;if(s){r=s.width,o=s.height;const e=(0,h.Tc)();(!e||e&&"fixed"===t)&&(a=s.offsetLeft,l=s.offsetTop)}const c=y(n);if(c<=0){const e=n.ownerDocument,t=e.body,i=getComputedStyle(t),s="CSS1Compat"===e.compatMode&&parseFloat(i.marginLeft)+parseFloat(i.marginRight)||0,o=Math.abs(n.clientWidth-t.clientWidth-s);o<=25&&(r-=o)}else c<=25&&(r+=c);return{width:r,height:o,x:a,y:l}}(e,i);else if("document"===t)s=function(e){const t=(0,h.ep)(e),i=(0,h.CP)(e),s=e.ownerDocument.body,r=(0,n.T9)(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),o=(0,n.T9)(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let a=-i.scrollLeft+y(e);const l=-i.scrollTop;return"rtl"===(0,h.L9)(s).direction&&(a+=(0,n.T9)(t.clientWidth,s.clientWidth)-r),{width:r,height:o,x:a,y:l}}((0,h.ep)(e));else if((0,h.vq)(t))s=function(e,t){const i=m(e,!0,"fixed"===t),s=i.top+e.clientTop,r=i.left+e.clientLeft,o=(0,h.sb)(e)?p(e):(0,n.Jx)(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:r*o.x,y:s*o.y}}(t,i);else{const i=f(e);s={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return(0,n.B1)(s)}function C(e,t){const i=(0,h.$4)(e);return!(i===t||!(0,h.vq)(i)||(0,h.eu)(i))&&("fixed"===(0,h.L9)(i).position||C(i,t))}function w(e,t,i){const s=(0,h.sb)(t),r=(0,h.ep)(t),o="fixed"===i,a=m(e,!0,o,t);let l={scrollLeft:0,scrollTop:0};const c=(0,n.Jx)(0);function u(){c.x=y(r)}if(s||!s&&!o)if(("body"!==(0,h.mq)(t)||(0,h.ZU)(r))&&(l=(0,h.CP)(t)),s){const e=m(t,!0,o,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else r&&u();o&&!s&&r&&u();const d=!r||s||o?(0,n.Jx)(0):v(r,l);return{x:a.left+l.scrollLeft-c.x-d.x,y:a.top+l.scrollTop-c.y-d.y,width:a.width,height:a.height}}function S(e){return"static"===(0,h.L9)(e).position}function x(e,t){if(!(0,h.sb)(e)||"fixed"===(0,h.L9)(e).position)return null;if(t)return t(e);let i=e.offsetParent;return(0,h.ep)(e)===i&&(i=i.ownerDocument.body),i}function E(e,t){const i=(0,h.zk)(e);if((0,h.Tf)(e))return i;if(!(0,h.sb)(e)){let t=(0,h.$4)(e);for(;t&&!(0,h.eu)(t);){if((0,h.vq)(t)&&!S(t))return t;t=(0,h.$4)(t)}return i}let n=x(e,t);for(;n&&(0,h.Lv)(n)&&S(n);)n=x(n,t);return n&&(0,h.eu)(n)&&S(n)&&!(0,h.sQ)(n)?i:n||(0,h.gJ)(e)||i}const A={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:i,offsetParent:s,strategy:r}=e;const o="fixed"===r,a=(0,h.ep)(s),l=!!t&&(0,h.Tf)(t.floating);if(s===a||l&&o)return i;let c={scrollLeft:0,scrollTop:0},u=(0,n.Jx)(1);const d=(0,n.Jx)(0),g=(0,h.sb)(s);if((g||!g&&!o)&&(("body"!==(0,h.mq)(s)||(0,h.ZU)(a))&&(c=(0,h.CP)(s)),g)){const e=m(s);u=p(s),d.x=e.x+s.clientLeft,d.y=e.y+s.clientTop}const f=!a||g||o?(0,n.Jx)(0):v(a,c);return{width:i.width*u.x,height:i.height*u.y,x:i.x*u.x-c.scrollLeft*u.x+d.x+f.x,y:i.y*u.y-c.scrollTop*u.y+d.y+f.y}},getDocumentElement:h.ep,getClippingRect:function(e){let{element:t,boundary:i,rootBoundary:s,strategy:r}=e;const o=[..."clippingAncestors"===i?(0,h.Tf)(t)?[]:function(e,t){const i=t.get(e);if(i)return i;let n=(0,h.v9)(e,[],!1).filter(e=>(0,h.vq)(e)&&"body"!==(0,h.mq)(e)),s=null;const r="fixed"===(0,h.L9)(e).position;let o=r?(0,h.$4)(e):e;for(;(0,h.vq)(o)&&!(0,h.eu)(o);){const t=(0,h.L9)(o),i=(0,h.sQ)(o);i||"fixed"!==t.position||(s=null),(r?!i&&!s:!i&&"static"===t.position&&s&&("absolute"===s.position||"fixed"===s.position)||(0,h.ZU)(o)&&!i&&C(e,o))?n=n.filter(e=>e!==o):s=t,o=(0,h.$4)(o)}return t.set(e,n),n}(t,this._c):[].concat(i),s],a=b(t,o[0],r);let l=a.top,c=a.right,u=a.bottom,d=a.left;for(let e=1;e<o.length;e++){const i=b(t,o[e],r);l=(0,n.T9)(i.top,l),c=(0,n.jk)(i.right,c),u=(0,n.jk)(i.bottom,u),d=(0,n.T9)(i.left,d)}return{width:c-d,height:u-l,x:d,y:l}},getOffsetParent:E,getElementRects:async function(e){const t=this.getOffsetParent||E,i=this.getDimensions,n=await i(e.floating);return{reference:w(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:i}=u(e);return{width:t,height:i}},getScale:p,isElement:h.vq,isRTL:function(e){return"rtl"===(0,h.L9)(e).direction}};function M(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function T(e,t,i,s){void 0===s&&(s={});const{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:c=!1}=s,u=d(e),p=r||o?[...u?(0,h.v9)(u):[],...t?(0,h.v9)(t):[]]:[];p.forEach(e=>{r&&e.addEventListener("scroll",i,{passive:!0}),o&&e.addEventListener("resize",i)});const g=u&&l?function(e,t){let i,s=null;const r=(0,h.ep)(e);function o(){var e;clearTimeout(i),null==(e=s)||e.disconnect(),s=null}return function a(l,c){void 0===l&&(l=!1),void 0===c&&(c=1),o();const h=e.getBoundingClientRect(),{left:u,top:d,width:p,height:g}=h;if(l||t(),!p||!g)return;const f={rootMargin:-(0,n.RI)(d)+"px "+-(0,n.RI)(r.clientWidth-(u+p))+"px "+-(0,n.RI)(r.clientHeight-(d+g))+"px "+-(0,n.RI)(u)+"px",threshold:(0,n.T9)(0,(0,n.jk)(1,c))||1};let m=!0;function y(t){const n=t[0].intersectionRatio;if(n!==c){if(!m)return a();n?a(!1,n):i=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==n||M(h,e.getBoundingClientRect())||a(),m=!1}try{s=new IntersectionObserver(y,{...f,root:r.ownerDocument})}catch(e){s=new IntersectionObserver(y,f)}s.observe(e)}(!0),o}(u,i):null;let f,y=-1,v=null;a&&(v=new ResizeObserver(e=>{let[n]=e;n&&n.target===u&&v&&t&&(v.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var e;null==(e=v)||e.observe(t)})),i()}),u&&!c&&v.observe(u),t&&v.observe(t));let b=c?m(e):null;return c&&function t(){const n=m(e);b&&!M(b,n)&&i(),b=n,f=requestAnimationFrame(t)}(),i(),()=>{var e;p.forEach(e=>{r&&e.removeEventListener("scroll",i),o&&e.removeEventListener("resize",i)}),null==g||g(),null==(e=v)||e.disconnect(),v=null,c&&cancelAnimationFrame(f)}}const D=r,I=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var i,s;const{x:r,y:o,placement:a,middlewareData:l}=t,h=await async function(e,t){const{placement:i,platform:s,elements:r}=e,o=await(null==s.isRTL?void 0:s.isRTL(r.floating)),a=(0,n.C0)(i),l=(0,n.Sg)(i),h="y"===(0,n.TV)(i),u=c.has(a)?-1:1,d=o&&h?-1:1,p=(0,n._3)(t,e);let{mainAxis:g,crossAxis:f,alignmentAxis:m}="number"==typeof p?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&"number"==typeof m&&(f="end"===l?-1*m:m),h?{x:f*d,y:g*u}:{x:g*u,y:f*d}}(t,e);return a===(null==(i=l.offset)?void 0:i.placement)&&null!=(s=l.arrow)&&s.alignmentOffset?{}:{x:r+h.x,y:o+h.y,data:{...h,placement:a}}}}},R=function(e){return void 0===e&&(e={}),{name:"autoPlacement",options:e,async fn(t){var i,s,r;const{rects:o,middlewareData:a,placement:l,platform:c,elements:h}=t,{crossAxis:u=!1,alignment:d,allowedPlacements:p=n.DD,autoAlignment:g=!0,...f}=(0,n._3)(e,t),m=void 0!==d||p===n.DD?function(e,t,i){return(e?[...i.filter(t=>(0,n.Sg)(t)===e),...i.filter(t=>(0,n.Sg)(t)!==e)]:i.filter(e=>(0,n.C0)(e)===e)).filter(i=>!e||(0,n.Sg)(i)===e||!!t&&(0,n.aD)(i)!==i)}(d||null,g,p):p,y=await c.detectOverflow(t,f),v=(null==(i=a.autoPlacement)?void 0:i.index)||0,b=m[v];if(null==b)return{};const C=(0,n.w7)(b,o,await(null==c.isRTL?void 0:c.isRTL(h.floating)));if(l!==b)return{reset:{placement:m[0]}};const w=[y[(0,n.C0)(b)],y[C[0]],y[C[1]]],S=[...(null==(s=a.autoPlacement)?void 0:s.overflows)||[],{placement:b,overflows:w}],x=m[v+1];if(x)return{data:{index:v+1,overflows:S},reset:{placement:x}};const E=S.map(e=>{const t=(0,n.Sg)(e.placement);return[e.placement,t&&u?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),A=(null==(r=E.filter(e=>e[2].slice(0,(0,n.Sg)(e[0])?2:3).every(e=>e<=0))[0])?void 0:r[0])||E[0][0];return A!==l?{data:{index:v+1,overflows:S},reset:{placement:A}}:{}}}},k=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:i,y:s,placement:r,platform:o}=t,{mainAxis:a=!0,crossAxis:l=!1,limiter:c={fn:e=>{let{x:t,y:i}=e;return{x:t,y:i}}},...h}=(0,n._3)(e,t),u={x:i,y:s},d=await o.detectOverflow(t,h),p=(0,n.TV)((0,n.C0)(r)),g=(0,n.PG)(p);let f=u[g],m=u[p];if(a){const e="y"===g?"bottom":"right",t=f+d["y"===g?"top":"left"],i=f-d[e];f=(0,n.qE)(t,f,i)}if(l){const e="y"===p?"bottom":"right",t=m+d["y"===p?"top":"left"],i=m-d[e];m=(0,n.qE)(t,m,i)}const y=c.fn({...t,[g]:f,[p]:m});return{...y,data:{x:y.x-i,y:y.y-s,enabled:{[g]:a,[p]:l}}}}}},P=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var i,s;const{placement:r,middlewareData:o,rects:a,initialPlacement:l,platform:c,elements:h}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:m=!0,...y}=(0,n._3)(e,t);if(null!=(i=o.arrow)&&i.alignmentOffset)return{};const v=(0,n.C0)(r),b=(0,n.TV)(l),C=(0,n.C0)(l)===l,w=await(null==c.isRTL?void 0:c.isRTL(h.floating)),S=p||(C||!m?[(0,n.bV)(l)]:(0,n.WJ)(l)),x="none"!==f;!p&&x&&S.push(...(0,n.lP)(l,m,f,w));const E=[l,...S],A=await c.detectOverflow(t,y),M=[];let T=(null==(s=o.flip)?void 0:s.overflows)||[];if(u&&M.push(A[v]),d){const e=(0,n.w7)(r,a,w);M.push(A[e[0]],A[e[1]])}if(T=[...T,{placement:r,overflows:M}],!M.every(e=>e<=0)){var D,I;const e=((null==(D=o.flip)?void 0:D.index)||0)+1,t=E[e];if(t&&("alignment"!==d||b===(0,n.TV)(t)||T.every(e=>(0,n.TV)(e.placement)!==b||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let i=null==(I=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:I.placement;if(!i)switch(g){case"bestFit":{var R;const e=null==(R=T.filter(e=>{if(x){const t=(0,n.TV)(e.placement);return t===b||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:R[0];e&&(i=e);break}case"initialPlacement":i=l}if(r!==i)return{reset:{placement:i}}}return{}}}},_=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var i,s;const{placement:r,rects:o,platform:a,elements:l}=t,{apply:c=()=>{},...h}=(0,n._3)(e,t),u=await a.detectOverflow(t,h),d=(0,n.C0)(r),p=(0,n.Sg)(r),g="y"===(0,n.TV)(r),{width:f,height:m}=o.floating;let y,v;"top"===d||"bottom"===d?(y=d,v=p===(await(null==a.isRTL?void 0:a.isRTL(l.floating))?"start":"end")?"left":"right"):(v=d,y="end"===p?"top":"bottom");const b=m-u.top-u.bottom,C=f-u.left-u.right,w=(0,n.jk)(m-u[y],b),S=(0,n.jk)(f-u[v],C),x=!t.middlewareData.shift;let E=w,A=S;if(null!=(i=t.middlewareData.shift)&&i.enabled.x&&(A=C),null!=(s=t.middlewareData.shift)&&s.enabled.y&&(E=b),x&&!p){const e=(0,n.T9)(u.left,0),t=(0,n.T9)(u.right,0),i=(0,n.T9)(u.top,0),s=(0,n.T9)(u.bottom,0);g?A=f-2*(0!==e||0!==t?e+t:(0,n.T9)(u.left,u.right)):E=m-2*(0!==i||0!==s?i+s:(0,n.T9)(u.top,u.bottom))}await c({...t,availableWidth:A,availableHeight:E});const M=await a.getDimensions(l.floating);return f!==M.width||m!==M.height?{reset:{rects:!0}}:{}}}},L=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:i,platform:s}=t,{strategy:r="referenceHidden",...l}=(0,n._3)(e,t);switch(r){case"referenceHidden":{const e=o(await s.detectOverflow(t,{...l,elementContext:"reference"}),i.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:a(e)}}}case"escaped":{const e=o(await s.detectOverflow(t,{...l,altBoundary:!0}),i.floating);return{data:{escapedOffsets:e,escaped:a(e)}}}default:return{}}}}},N=e=>({name:"arrow",options:e,async fn(t){const{x:i,y:s,placement:r,rects:o,platform:a,elements:l,middlewareData:c}=t,{element:h,padding:u=0}=(0,n._3)(e,t)||{};if(null==h)return{};const d=(0,n.nI)(u),p={x:i,y:s},g=(0,n.Dz)(r),f=(0,n.sq)(g),m=await a.getDimensions(h),y="y"===g,v=y?"top":"left",b=y?"bottom":"right",C=y?"clientHeight":"clientWidth",w=o.reference[f]+o.reference[g]-p[g]-o.floating[f],S=p[g]-o.reference[g],x=await(null==a.getOffsetParent?void 0:a.getOffsetParent(h));let E=x?x[C]:0;E&&await(null==a.isElement?void 0:a.isElement(x))||(E=l.floating[C]||o.floating[f]);const A=w/2-S/2,M=E/2-m[f]/2-1,T=(0,n.jk)(d[v],M),D=(0,n.jk)(d[b],M),I=T,R=E-m[f]-D,k=E/2-m[f]/2+A,P=(0,n.qE)(I,k,R),_=!c.arrow&&null!=(0,n.Sg)(r)&&k!==P&&o.reference[f]/2-(k<I?T:D)-m[f]/2<0,L=_?k<I?k-I:k-R:0;return{[g]:p[g]+L,data:{[g]:P,centerOffset:k-P-L,..._&&{alignmentOffset:L}},reset:_}}}),O=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:i,elements:s,rects:r,platform:o,strategy:a}=t,{padding:c=2,x:h,y:u}=(0,n._3)(e,t),d=Array.from(await(null==o.getClientRects?void 0:o.getClientRects(s.reference))||[]),p=function(e){const t=e.slice().sort((e,t)=>e.y-t.y),i=[];let s=null;for(let e=0;e<t.length;e++){const n=t[e];!s||n.y-s.y>s.height/2?i.push([n]):i[i.length-1].push(n),s=n}return i.map(e=>(0,n.B1)(l(e)))}(d),g=(0,n.B1)(l(d)),f=(0,n.nI)(c),m=await o.getElementRects({reference:{getBoundingClientRect:function(){if(2===p.length&&p[0].left>p[1].right&&null!=h&&null!=u)return p.find(e=>h>e.left-f.left&&h<e.right+f.right&&u>e.top-f.top&&u<e.bottom+f.bottom)||g;if(p.length>=2){if("y"===(0,n.TV)(i)){const e=p[0],t=p[p.length-1],s="top"===(0,n.C0)(i),r=e.top,o=t.bottom,a=s?e.left:t.left,l=s?e.right:t.right;return{top:r,bottom:o,left:a,right:l,width:l-a,height:o-r,x:a,y:r}}const e="left"===(0,n.C0)(i),t=(0,n.T9)(...p.map(e=>e.right)),s=(0,n.jk)(...p.map(e=>e.left)),r=p.filter(i=>e?i.left===s:i.right===t),o=r[0].top,a=r[r.length-1].bottom;return{top:o,bottom:a,left:s,right:t,width:t-s,height:a-o,x:s,y:o}}return g}},floating:s.floating,strategy:a});return r.reference.x!==m.reference.x||r.reference.y!==m.reference.y||r.reference.width!==m.reference.width||r.reference.height!==m.reference.height?{reset:{rects:m}}:{}}}},F=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:i,y:s,placement:r,rects:o,middlewareData:a}=t,{offset:l=0,mainAxis:h=!0,crossAxis:u=!0}=(0,n._3)(e,t),d={x:i,y:s},p=(0,n.TV)(r),g=(0,n.PG)(p);let f=d[g],m=d[p];const y=(0,n._3)(l,t),v="number"==typeof y?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(h){const e="y"===g?"height":"width",t=o.reference[g]-o.floating[e]+v.mainAxis,i=o.reference[g]+o.reference[e]-v.mainAxis;f<t?f=t:f>i&&(f=i)}if(u){var b,C;const e="y"===g?"width":"height",t=c.has((0,n.C0)(r)),i=o.reference[p]-o.floating[e]+(t&&(null==(b=a.offset)?void 0:b[p])||0)+(t?0:v.crossAxis),s=o.reference[p]+o.reference[e]+(t?0:(null==(C=a.offset)?void 0:C[p])||0)-(t?v.crossAxis:0);m<i?m=i:m>s&&(m=s)}return{[g]:f,[p]:m}}}},G=(e,t,i)=>{const n=new Map,o={platform:A,...i},a={...o.platform,_c:n};return(async(e,t,i)=>{const{placement:n="bottom",strategy:o="absolute",middleware:a=[],platform:l}=i,c=l.detectOverflow?l:{...l,detectOverflow:r},h=await(null==l.isRTL?void 0:l.isRTL(t));let u=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:p}=s(u,n,h),g=n,f=0;const m={};for(let i=0;i<a.length;i++){const r=a[i];if(!r)continue;const{name:y,fn:v}=r,{x:b,y:C,data:w,reset:S}=await v({x:d,y:p,initialPlacement:n,placement:g,strategy:o,middlewareData:m,rects:u,platform:c,elements:{reference:e,floating:t}});d=null!=b?b:d,p=null!=C?C:p,m[y]={...m[y],...w},S&&f<50&&(f++,"object"==typeof S&&(S.placement&&(g=S.placement),S.rects&&(u=!0===S.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):S.rects),({x:d,y:p}=s(u,g,h))),i=-1)}return{x:d,y:p,placement:g,strategy:o,middlewareData:m}})(e,t,{...o,platform:a})}},18740(e,t,i){"use strict";i.d(t,{BN:()=>p,ER:()=>g,Ej:()=>m,RK:()=>y,UE:()=>C,UU:()=>f,cY:()=>d,jD:()=>v,mG:()=>b,we:()=>u});var n=i(4830),s=i(22155),r=i(70316),o="undefined"!=typeof document?s.useLayoutEffect:function(){};function a(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let i,n,s;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(i=e.length,i!==t.length)return!1;for(n=i;0!==n--;)if(!a(e[n],t[n]))return!1;return!0}if(s=Object.keys(e),i=s.length,i!==Object.keys(t).length)return!1;for(n=i;0!==n--;)if(!{}.hasOwnProperty.call(t,s[n]))return!1;for(n=i;0!==n--;){const i=s[n];if(!("_owner"===i&&e.$$typeof||a(e[i],t[i])))return!1}return!0}return e!=e&&t!=t}function l(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function c(e,t){const i=l(e);return Math.round(t*i)/i}function h(e){const t=s.useRef(e);return o(()=>{t.current=e}),t}function u(e){void 0===e&&(e={});const{placement:t="bottom",strategy:i="absolute",middleware:u=[],platform:d,elements:{reference:p,floating:g}={},transform:f=!0,whileElementsMounted:m,open:y}=e,[v,b]=s.useState({x:0,y:0,strategy:i,placement:t,middlewareData:{},isPositioned:!1}),[C,w]=s.useState(u);a(C,u)||w(u);const[S,x]=s.useState(null),[E,A]=s.useState(null),M=s.useCallback(e=>{e!==R.current&&(R.current=e,x(e))},[]),T=s.useCallback(e=>{e!==k.current&&(k.current=e,A(e))},[]),D=p||S,I=g||E,R=s.useRef(null),k=s.useRef(null),P=s.useRef(v),_=null!=m,L=h(m),N=h(d),O=h(y),F=s.useCallback(()=>{if(!R.current||!k.current)return;const e={placement:t,strategy:i,middleware:C};N.current&&(e.platform=N.current),(0,n.rD)(R.current,k.current,e).then(e=>{const t={...e,isPositioned:!1!==O.current};G.current&&!a(P.current,t)&&(P.current=t,r.flushSync(()=>{b(t)}))})},[C,t,i,N,O]);o(()=>{!1===y&&P.current.isPositioned&&(P.current.isPositioned=!1,b(e=>({...e,isPositioned:!1})))},[y]);const G=s.useRef(!1);o(()=>(G.current=!0,()=>{G.current=!1}),[]),o(()=>{if(D&&(R.current=D),I&&(k.current=I),D&&I){if(L.current)return L.current(D,I,F);F()}},[D,I,F,L,_]);const B=s.useMemo(()=>({reference:R,floating:k,setReference:M,setFloating:T}),[M,T]),V=s.useMemo(()=>({reference:D,floating:I}),[D,I]),H=s.useMemo(()=>{const e={position:i,left:0,top:0};if(!V.floating)return e;const t=c(V.floating,v.x),n=c(V.floating,v.y);return f?{...e,transform:"translate("+t+"px, "+n+"px)",...l(V.floating)>=1.5&&{willChange:"transform"}}:{position:i,left:t,top:n}},[i,f,V.floating,v.x,v.y]);return s.useMemo(()=>({...v,update:F,refs:B,elements:V,floatingStyles:H}),[v,F,B,V,H])}const d=(e,t)=>{const i=(0,n.cY)(e);return{name:i.name,fn:i.fn,options:[e,t]}},p=(e,t)=>{const i=(0,n.BN)(e);return{name:i.name,fn:i.fn,options:[e,t]}},g=(e,t)=>({fn:(0,n.ER)(e).fn,options:[e,t]}),f=(e,t)=>{const i=(0,n.UU)(e);return{name:i.name,fn:i.fn,options:[e,t]}},m=(e,t)=>{const i=(0,n.Ej)(e);return{name:i.name,fn:i.fn,options:[e,t]}},y=(e,t)=>{const i=(0,n.RK)(e);return{name:i.name,fn:i.fn,options:[e,t]}},v=(e,t)=>{const i=(0,n.jD)(e);return{name:i.name,fn:i.fn,options:[e,t]}},b=(e,t)=>{const i=(0,n.mG)(e);return{name:i.name,fn:i.fn,options:[e,t]}},C=(e,t)=>{const i=(e=>({name:"arrow",options:e,fn(t){const{element:i,padding:s}="function"==typeof e?e(t):e;return i&&(r=i,{}.hasOwnProperty.call(r,"current"))?null!=i.current?(0,n.UE)({element:i.current,padding:s}).fn(t):{}:i?(0,n.UE)({element:i,padding:s}).fn(t):{};var r}}))(e);return{name:i.name,fn:i.fn,options:[e,t]}}},32125(e,t,i){"use strict";function n(){return"undefined"!=typeof window}function s(e){return a(e)?(e.nodeName||"").toLowerCase():"#document"}function r(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function o(e){var t;return null==(t=(a(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function a(e){return!!n()&&(e instanceof Node||e instanceof r(e).Node)}function l(e){return!!n()&&(e instanceof Element||e instanceof r(e).Element)}function c(e){return!!n()&&(e instanceof HTMLElement||e instanceof r(e).HTMLElement)}function h(e){return!(!n()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof r(e).ShadowRoot)}function u(e){const{overflow:t,overflowX:i,overflowY:n,display:s}=S(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+i)&&"inline"!==s&&"contents"!==s}function d(e){return/^(table|td|th)$/.test(s(e))}function p(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}i.d(t,{$4:()=>E,CP:()=>x,L9:()=>S,Ll:()=>a,Lv:()=>d,Ng:()=>h,Tc:()=>C,Tf:()=>p,ZU:()=>u,_m:()=>T,ep:()=>o,eu:()=>w,gJ:()=>b,mq:()=>s,sQ:()=>v,sb:()=>c,v9:()=>M,vq:()=>l,zk:()=>r});const g=/transform|translate|scale|rotate|perspective|filter/,f=/paint|layout|strict|content/,m=e=>!!e&&"none"!==e;let y;function v(e){const t=l(e)?S(e):e;return m(t.transform)||m(t.translate)||m(t.scale)||m(t.rotate)||m(t.perspective)||!C()&&(m(t.backdropFilter)||m(t.filter))||g.test(t.willChange||"")||f.test(t.contain||"")}function b(e){let t=E(e);for(;c(t)&&!w(t);){if(v(t))return t;if(p(t))return null;t=E(t)}return null}function C(){return null==y&&(y="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),y}function w(e){return/^(html|body|#document)$/.test(s(e))}function S(e){return r(e).getComputedStyle(e)}function x(e){return l(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function E(e){if("html"===s(e))return e;const t=e.assignedSlot||e.parentNode||h(e)&&e.host||o(e);return h(t)?t.host:t}function A(e){const t=E(e);return w(t)?e.ownerDocument?e.ownerDocument.body:e.body:c(t)&&u(t)?t:A(t)}function M(e,t,i){var n;void 0===t&&(t=[]),void 0===i&&(i=!0);const s=A(e),o=s===(null==(n=e.ownerDocument)?void 0:n.body),a=r(s);if(o){const e=T(a);return t.concat(a,a.visualViewport||[],u(s)?s:[],e&&i?M(e):[])}return t.concat(s,M(s,[],i))}function T(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}},51771(e,t,i){"use strict";i.d(t,{B1:()=>R,C0:()=>g,DD:()=>r,Dz:()=>b,Jx:()=>h,LI:()=>l,PG:()=>m,RI:()=>c,Sg:()=>f,T9:()=>a,TV:()=>v,WJ:()=>w,_3:()=>p,aD:()=>S,bV:()=>D,jk:()=>o,lP:()=>T,nI:()=>I,qE:()=>d,r_:()=>n,sq:()=>y,w7:()=>C});const n=["top","right","bottom","left"],s=["start","end"],r=n.reduce((e,t)=>e.concat(t,t+"-"+s[0],t+"-"+s[1]),[]),o=Math.min,a=Math.max,l=Math.round,c=Math.floor,h=e=>({x:e,y:e}),u={left:"right",right:"left",bottom:"top",top:"bottom"};function d(e,t,i){return a(e,o(t,i))}function p(e,t){return"function"==typeof e?e(t):e}function g(e){return e.split("-")[0]}function f(e){return e.split("-")[1]}function m(e){return"x"===e?"y":"x"}function y(e){return"y"===e?"height":"width"}function v(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function b(e){return m(v(e))}function C(e,t,i){void 0===i&&(i=!1);const n=f(e),s=b(e),r=y(s);let o="x"===s?n===(i?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[r]>t.floating[r]&&(o=D(o)),[o,D(o)]}function w(e){const t=D(e);return[S(e),t,S(t)]}function S(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const x=["left","right"],E=["right","left"],A=["top","bottom"],M=["bottom","top"];function T(e,t,i,n){const s=f(e);let r=function(e,t,i){switch(e){case"top":case"bottom":return i?t?E:x:t?x:E;case"left":case"right":return t?A:M;default:return[]}}(g(e),"start"===i,n);return s&&(r=r.map(e=>e+"-"+s),t&&(r=r.concat(r.map(S)))),r}function D(e){const t=g(e);return u[t]+e.slice(t.length)}function I(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function R(e){const{x:t,y:i,width:n,height:s}=e;return{width:n,height:s,top:i,left:t,right:t+n,bottom:i+s,x:t,y:i}}},73579(e,t,i){"use strict";i.d(t,{iX:()=>z});var n=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],s=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],r="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-࢏ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚ౜ౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ೜-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-Ƛ꟱-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ﬀ-ﬆﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼＡ-Ｚａ-ｚｦ-ﾾￂ-ￇￊ-ￏￒ-ￗￚ-ￜ",o={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},a="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",l={5:a,"5module":a+" export import",6:a+" const class extends export import super"},c=/^in(stanceof)?$/,h=new RegExp("["+r+"]"),u=new RegExp("["+r+"‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-᫝᫠-᫫ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏０-９＿･]");function d(e,t){for(var i=65536,n=0;n<t.length;n+=2){if((i+=t[n])>e)return!1;if((i+=t[n+1])>=e)return!0}return!1}function p(e,t){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&h.test(String.fromCharCode(e)):!1!==t&&d(e,s)))}function g(e,t){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&u.test(String.fromCharCode(e)):!1!==t&&(d(e,s)||d(e,n)))))}var f=function(e,t){void 0===t&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function m(e,t){return new f(e,{beforeExpr:!0,binop:t})}var y={beforeExpr:!0},v={startsExpr:!0},b={};function C(e,t){return void 0===t&&(t={}),t.keyword=e,b[e]=new f(e,t)}var w={num:new f("num",v),regexp:new f("regexp",v),string:new f("string",v),name:new f("name",v),privateId:new f("privateId",v),eof:new f("eof"),bracketL:new f("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new f("]"),braceL:new f("{",{beforeExpr:!0,startsExpr:!0}),braceR:new f("}"),parenL:new f("(",{beforeExpr:!0,startsExpr:!0}),parenR:new f(")"),comma:new f(",",y),semi:new f(";",y),colon:new f(":",y),dot:new f("."),question:new f("?",y),questionDot:new f("?."),arrow:new f("=>",y),template:new f("template"),invalidTemplate:new f("invalidTemplate"),ellipsis:new f("...",y),backQuote:new f("`",v),dollarBraceL:new f("${",{beforeExpr:!0,startsExpr:!0}),eq:new f("=",{beforeExpr:!0,isAssign:!0}),assign:new f("_=",{beforeExpr:!0,isAssign:!0}),incDec:new f("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new f("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:m("||",1),logicalAND:m("&&",2),bitwiseOR:m("|",3),bitwiseXOR:m("^",4),bitwiseAND:m("&",5),equality:m("==/!=/===/!==",6),relational:m("</>/<=/>=",7),bitShift:m("<</>>/>>>",8),plusMin:new f("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:m("%",10),star:m("*",10),slash:m("/",10),starstar:new f("**",{beforeExpr:!0}),coalesce:m("??",1),_break:C("break"),_case:C("case",y),_catch:C("catch"),_continue:C("continue"),_debugger:C("debugger"),_default:C("default",y),_do:C("do",{isLoop:!0,beforeExpr:!0}),_else:C("else",y),_finally:C("finally"),_for:C("for",{isLoop:!0}),_function:C("function",v),_if:C("if"),_return:C("return",y),_switch:C("switch"),_throw:C("throw",y),_try:C("try"),_var:C("var"),_const:C("const"),_while:C("while",{isLoop:!0}),_with:C("with"),_new:C("new",{beforeExpr:!0,startsExpr:!0}),_this:C("this",v),_super:C("super",v),_class:C("class",v),_extends:C("extends",y),_export:C("export"),_import:C("import",v),_null:C("null",v),_true:C("true",v),_false:C("false",v),_in:C("in",{beforeExpr:!0,binop:7}),_instanceof:C("instanceof",{beforeExpr:!0,binop:7}),_typeof:C("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:C("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:C("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},S=/\r\n?|\n|\u2028|\u2029/,x=new RegExp(S.source,"g");function E(e){return 10===e||13===e||8232===e||8233===e}function A(e,t,i){void 0===i&&(i=e.length);for(var n=t;n<i;n++){var s=e.charCodeAt(n);if(E(s))return n<i-1&&13===s&&10===e.charCodeAt(n+1)?n+2:n+1}return-1}var M=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,T=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,D=Object.prototype,I=D.hasOwnProperty,R=D.toString,k=Object.hasOwn||function(e,t){return I.call(e,t)},P=Array.isArray||function(e){return"[object Array]"===R.call(e)},_=Object.create(null);function L(e){return _[e]||(_[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function N(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}var O=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,F=function(e,t){this.line=e,this.column=t};F.prototype.offset=function(e){return new F(this.line,this.column+e)};var G=function(e,t,i){this.start=t,this.end=i,null!==e.sourceFile&&(this.source=e.sourceFile)};function B(e,t){for(var i=1,n=0;;){var s=A(e,n,t);if(s<0)return new F(i,t-n);++i,n=s}}var V={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},H=!1;function U(e,t){return 2|(e?4:0)|(t?8:0)}var z=function(e,t,i){this.options=e=function(e){var t={};for(var i in V)t[i]=e&&k(e,i)?e[i]:V[i];if("latest"===t.ecmaVersion?t.ecmaVersion=1e8:null==t.ecmaVersion?(!H&&"object"==typeof console&&console.warn&&(H=!0,console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.")),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),e&&null!=e.allowHashBang||(t.allowHashBang=t.ecmaVersion>=14),P(t.onToken)){var n=t.onToken;t.onToken=function(e){return n.push(e)}}if(P(t.onComment)&&(t.onComment=function(e,t){return function(i,n,s,r,o,a){var l={type:i?"Block":"Line",value:n,start:s,end:r};e.locations&&(l.loc=new G(this,o,a)),e.ranges&&(l.range=[s,r]),t.push(l)}}(t,t.onComment)),"commonjs"===t.sourceType&&t.allowAwaitOutsideFunction)throw new Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return t}(e),this.sourceFile=e.sourceFile,this.keywords=L(l[e.ecmaVersion>=6?6:"module"===e.sourceType?"5module":5]);var n="";!0!==e.allowReserved&&(n=o[e.ecmaVersion>=6?6:5===e.ecmaVersion?5:3],"module"===e.sourceType&&(n+=" await")),this.reservedWords=L(n);var s=(n?n+" ":"")+o.strict;this.reservedWordsStrict=L(s),this.reservedWordsStrictBind=L(s+" "+o.strictBind),this.input=String(t),this.containsEsc=!1,i?(this.pos=i,this.lineStart=this.input.lastIndexOf("\n",i-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(S).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=w.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===e.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope("commonjs"===this.options.sourceType?2:1),this.regexpState=null,this.privateNameStack=[]},W={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowReturn:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},allowUsing:{configurable:!0},inClassStaticBlock:{configurable:!0}};z.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},W.inFunction.get=function(){return(2&this.currentVarScope().flags)>0},W.inGenerator.get=function(){return(8&this.currentVarScope().flags)>0},W.inAsync.get=function(){return(4&this.currentVarScope().flags)>0},W.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(768&t)return!1;if(2&t)return(4&t)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},W.allowReturn.get=function(){return!!this.inFunction||!!(this.options.allowReturnOutsideFunction&&1&this.currentVarScope().flags)},W.allowSuper.get=function(){return(64&this.currentThisScope().flags)>0||this.options.allowSuperOutsideMethod},W.allowDirectSuper.get=function(){return(128&this.currentThisScope().flags)>0},W.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},W.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(768&t||2&t&&!(16&t))return!0}return!1},W.allowUsing.get=function(){var e=this.currentScope().flags;return!(1024&e||!this.inModule&&1&e)},W.inClassStaticBlock.get=function(){return(256&this.currentVarScope().flags)>0},z.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var i=this,n=0;n<e.length;n++)i=e[n](i);return i},z.parse=function(e,t){return new this(t,e).parse()},z.parseExpressionAt=function(e,t,i){var n=new this(i,e,t);return n.nextToken(),n.parseExpression()},z.tokenizer=function(e,t){return new this(t,e)},Object.defineProperties(z.prototype,W);var j=z.prototype,$=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;j.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){T.lastIndex=e,e+=T.exec(this.input)[0].length;var t=$.exec(this.input.slice(e));if(!t)return!1;if("use strict"===(t[1]||t[2])){T.lastIndex=e+t[0].length;var i=T.exec(this.input),n=i.index+i[0].length,s=this.input.charAt(n);return";"===s||"}"===s||S.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(s)||"!"===s&&"="===this.input.charAt(n+1))}e+=t[0].length,T.lastIndex=e,e+=T.exec(this.input)[0].length,";"===this.input[e]&&e++}},j.eat=function(e){return this.type===e&&(this.next(),!0)},j.isContextual=function(e){return this.type===w.name&&this.value===e&&!this.containsEsc},j.eatContextual=function(e){return!!this.isContextual(e)&&(this.next(),!0)},j.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},j.canInsertSemicolon=function(){return this.type===w.eof||this.type===w.braceR||S.test(this.input.slice(this.lastTokEnd,this.start))},j.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},j.semicolon=function(){this.eat(w.semi)||this.insertSemicolon()||this.unexpected()},j.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},j.expect=function(e){this.eat(e)||this.unexpected()},j.unexpected=function(e){this.raise(null!=e?e:this.start,"Unexpected token")};var K=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};j.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var i=t?e.parenthesizedAssign:e.parenthesizedBind;i>-1&&this.raiseRecoverable(i,t?"Assigning to rvalue":"Parenthesized pattern")}},j.checkExpressionErrors=function(e,t){if(!e)return!1;var i=e.shorthandAssign,n=e.doubleProto;if(!t)return i>=0||n>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),n>=0&&this.raiseRecoverable(n,"Redefinition of __proto__ property")},j.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},j.isSimpleAssignTarget=function(e){return"ParenthesizedExpression"===e.type?this.isSimpleAssignTarget(e.expression):"Identifier"===e.type||"MemberExpression"===e.type};var Y=z.prototype;Y.parseTopLevel=function(e){var t=Object.create(null);for(e.body||(e.body=[]);this.type!==w.eof;){var i=this.parseStatement(null,!0,t);e.body.push(i)}if(this.inModule)for(var n=0,s=Object.keys(this.undefinedExports);n<s.length;n+=1){var r=s[n];this.raiseRecoverable(this.undefinedExports[r].start,"Export '"+r+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType="commonjs"===this.options.sourceType?"script":this.options.sourceType,this.finishNode(e,"Program")};var q={kind:"loop"},X={kind:"switch"};Y.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;T.lastIndex=this.pos;var t=T.exec(this.input),i=this.pos+t[0].length,n=this.fullCharCodeAt(i);if(91===n||92===n)return!0;if(e)return!1;if(123===n)return!0;if(p(n)){var s=i;do{i+=n<=65535?1:2}while(g(n=this.fullCharCodeAt(i)));if(92===n)return!0;var r=this.input.slice(s,i);if(!c.test(r))return!0}return!1},Y.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;T.lastIndex=this.pos;var e,t=T.exec(this.input),i=this.pos+t[0].length;return!(S.test(this.input.slice(this.pos,i))||"function"!==this.input.slice(i,i+8)||i+8!==this.input.length&&(g(e=this.fullCharCodeAt(i+8))||92===e))},Y.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?"await":"using"))return!1;T.lastIndex=this.pos;var i=T.exec(this.input),n=this.pos+i[0].length;if(S.test(this.input.slice(this.pos,n)))return!1;if(e){var s,r=n+5;if("using"!==this.input.slice(n,r)||r===this.input.length||g(s=this.fullCharCodeAt(r))||92===s)return!1;T.lastIndex=r;var o=T.exec(this.input);if(n=r+o[0].length,o&&S.test(this.input.slice(r,n)))return!1}var a=this.fullCharCodeAt(n);if(!p(a)&&92!==a)return!1;var l=n;do{n+=a<=65535?1:2}while(g(a=this.fullCharCodeAt(n)));if(92===a)return!0;var h=this.input.slice(l,n);return!(c.test(h)||t&&"of"===h)},Y.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)},Y.isUsing=function(e){return this.isUsingKeyword(!1,e)},Y.parseStatement=function(e,t,i){var n,s=this.type,r=this.startNode();switch(this.isLet(e)&&(s=w._var,n="let"),s){case w._break:case w._continue:return this.parseBreakContinueStatement(r,s.keyword);case w._debugger:return this.parseDebuggerStatement(r);case w._do:return this.parseDoStatement(r);case w._for:return this.parseForStatement(r);case w._function:return e&&(this.strict||"if"!==e&&"label"!==e)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(r,!1,!e);case w._class:return e&&this.unexpected(),this.parseClass(r,!0);case w._if:return this.parseIfStatement(r);case w._return:return this.parseReturnStatement(r);case w._switch:return this.parseSwitchStatement(r);case w._throw:return this.parseThrowStatement(r);case w._try:return this.parseTryStatement(r);case w._const:case w._var:return n=n||this.value,e&&"var"!==n&&this.unexpected(),this.parseVarStatement(r,n);case w._while:return this.parseWhileStatement(r);case w._with:return this.parseWithStatement(r);case w.braceL:return this.parseBlock(!0,r);case w.semi:return this.parseEmptyStatement(r);case w._export:case w._import:if(this.options.ecmaVersion>10&&s===w._import){T.lastIndex=this.pos;var o=T.exec(this.input),a=this.pos+o[0].length,l=this.input.charCodeAt(a);if(40===l||46===l)return this.parseExpressionStatement(r,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),s===w._import?this.parseImport(r):this.parseExport(r,i);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(r,!0,!e);var c=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(c)return this.allowUsing||this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"),"await using"===c&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.next(),this.parseVar(r,!1,c),this.semicolon(),this.finishNode(r,"VariableDeclaration");var h=this.value,u=this.parseExpression();return s===w.name&&"Identifier"===u.type&&this.eat(w.colon)?this.parseLabeledStatement(r,h,u,e):this.parseExpressionStatement(r,u)}},Y.parseBreakContinueStatement=function(e,t){var i="break"===t;this.next(),this.eat(w.semi)||this.insertSemicolon()?e.label=null:this.type!==w.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var n=0;n<this.labels.length;++n){var s=this.labels[n];if(null==e.label||s.name===e.label.name){if(null!=s.kind&&(i||"loop"===s.kind))break;if(e.label&&i)break}}return n===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,i?"BreakStatement":"ContinueStatement")},Y.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")},Y.parseDoStatement=function(e){return this.next(),this.labels.push(q),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(w._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(w.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},Y.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(q),this.enterScope(0),this.expect(w.parenL),this.type===w.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var i=this.isLet();if(this.type===w._var||this.type===w._const||i){var n=this.startNode(),s=i?"let":this.value;return this.next(),this.parseVar(n,!0,s),this.finishNode(n,"VariableDeclaration"),this.parseForAfterInit(e,n,t)}var r=this.isContextual("let"),o=!1,a=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(a){var l=this.startNode();return this.next(),"await using"===a&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.parseVar(l,!0,a),this.finishNode(l,"VariableDeclaration"),this.parseForAfterInit(e,l,t)}var c=this.containsEsc,h=new K,u=this.start,d=t>-1?this.parseExprSubscripts(h,"await"):this.parseExpression(!0,h);return this.type===w._in||(o=this.options.ecmaVersion>=6&&this.isContextual("of"))?(t>-1?(this.type===w._in&&this.unexpected(t),e.await=!0):o&&this.options.ecmaVersion>=8&&(d.start!==u||c||"Identifier"!==d.type||"async"!==d.name?this.options.ecmaVersion>=9&&(e.await=!1):this.unexpected()),r&&o&&this.raise(d.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(d,!1,h),this.checkLValPattern(d),this.parseForIn(e,d)):(this.checkExpressionErrors(h,!0),t>-1&&this.unexpected(t),this.parseFor(e,d))},Y.parseForAfterInit=function(e,t,i){return(this.type===w._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===t.declarations.length?(this.options.ecmaVersion>=9&&(this.type===w._in?i>-1&&this.unexpected(i):e.await=i>-1),this.parseForIn(e,t)):(i>-1&&this.unexpected(i),this.parseFor(e,t))},Y.parseFunctionStatement=function(e,t,i){return this.next(),this.parseFunction(e,Q|(i?0:J),!1,t)},Y.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(w._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")},Y.parseReturnStatement=function(e){return this.allowReturn||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(w.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},Y.parseSwitchStatement=function(e){var t;this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(w.braceL),this.labels.push(X),this.enterScope(1024);for(var i=!1;this.type!==w.braceR;)if(this.type===w._case||this.type===w._default){var n=this.type===w._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),n?t.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,t.test=null),this.expect(w.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},Y.parseThrowStatement=function(e){return this.next(),S.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var Z=[];Y.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t="Identifier"===e.type;return this.enterScope(t?32:0),this.checkLValPattern(e,t?4:2),this.expect(w.parenR),e},Y.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===w._catch){var t=this.startNode();this.next(),this.eat(w.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(w._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},Y.parseVarStatement=function(e,t,i){return this.next(),this.parseVar(e,!1,t,i),this.semicolon(),this.finishNode(e,"VariableDeclaration")},Y.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(q),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},Y.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")},Y.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},Y.parseLabeledStatement=function(e,t,i,n){for(var s=0,r=this.labels;s<r.length;s+=1)r[s].name===t&&this.raise(i.start,"Label '"+t+"' is already declared");for(var o=this.type.isLoop?"loop":this.type===w._switch?"switch":null,a=this.labels.length-1;a>=0;a--){var l=this.labels[a];if(l.statementStart!==e.start)break;l.statementStart=this.start,l.kind=o}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(n?-1===n.indexOf("label")?n+"label":n:"label"),this.labels.pop(),e.label=i,this.finishNode(e,"LabeledStatement")},Y.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},Y.parseBlock=function(e,t,i){for(void 0===e&&(e=!0),void 0===t&&(t=this.startNode()),t.body=[],this.expect(w.braceL),e&&this.enterScope(0);this.type!==w.braceR;){var n=this.parseStatement(null);t.body.push(n)}return i&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")},Y.parseFor=function(e,t){return e.init=t,this.expect(w.semi),e.test=this.type===w.semi?null:this.parseExpression(),this.expect(w.semi),e.update=this.type===w.parenR?null:this.parseExpression(),this.expect(w.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},Y.parseForIn=function(e,t){var i=this.type===w._in;return this.next(),"VariableDeclaration"===t.type&&null!=t.declarations[0].init&&(!i||this.options.ecmaVersion<8||this.strict||"var"!==t.kind||"Identifier"!==t.declarations[0].id.type)&&this.raise(t.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(w.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,i?"ForInStatement":"ForOfStatement")},Y.parseVar=function(e,t,i,n){for(e.declarations=[],e.kind=i;;){var s=this.startNode();if(this.parseVarId(s,i),this.eat(w.eq)?s.init=this.parseMaybeAssign(t):n||"const"!==i||this.type===w._in||this.options.ecmaVersion>=6&&this.isContextual("of")?n||"using"!==i&&"await using"!==i||!(this.options.ecmaVersion>=17)||this.type===w._in||this.isContextual("of")?n||"Identifier"===s.id.type||t&&(this.type===w._in||this.isContextual("of"))?s.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.raise(this.lastTokEnd,"Missing initializer in "+i+" declaration"):this.unexpected(),e.declarations.push(this.finishNode(s,"VariableDeclarator")),!this.eat(w.comma))break}return e},Y.parseVarId=function(e,t){e.id="using"===t||"await using"===t?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,"var"===t?1:2,!1)};var Q=1,J=2;function ee(e,t){var i=t.key.name,n=e[i],s="true";return"MethodDefinition"!==t.type||"get"!==t.kind&&"set"!==t.kind||(s=(t.static?"s":"i")+t.kind),"iget"===n&&"iset"===s||"iset"===n&&"iget"===s||"sget"===n&&"sset"===s||"sset"===n&&"sget"===s?(e[i]="true",!1):!!n||(e[i]=s,!1)}function te(e,t){var i=e.computed,n=e.key;return!i&&("Identifier"===n.type&&n.name===t||"Literal"===n.type&&n.value===t)}Y.parseFunction=function(e,t,i,n,s){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!n)&&(this.type===w.star&&t&J&&this.unexpected(),e.generator=this.eat(w.star)),this.options.ecmaVersion>=8&&(e.async=!!n),t&Q&&(e.id=4&t&&this.type!==w.name?null:this.parseIdent(),!e.id||t&J||this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?1:2:3));var r=this.yieldPos,o=this.awaitPos,a=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(U(e.async,e.generator)),t&Q||(e.id=this.type===w.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,i,!1,s),this.yieldPos=r,this.awaitPos=o,this.awaitIdentPos=a,this.finishNode(e,t&Q?"FunctionDeclaration":"FunctionExpression")},Y.parseFunctionParams=function(e){this.expect(w.parenL),e.params=this.parseBindingList(w.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},Y.parseClass=function(e,t){this.next();var i=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var n=this.enterClassBody(),s=this.startNode(),r=!1;for(s.body=[],this.expect(w.braceL);this.type!==w.braceR;){var o=this.parseClassElement(null!==e.superClass);o&&(s.body.push(o),"MethodDefinition"===o.type&&"constructor"===o.kind?(r&&this.raiseRecoverable(o.start,"Duplicate constructor in the same class"),r=!0):o.key&&"PrivateIdentifier"===o.key.type&&ee(n,o)&&this.raiseRecoverable(o.key.start,"Identifier '#"+o.key.name+"' has already been declared"))}return this.strict=i,this.next(),e.body=this.finishNode(s,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},Y.parseClassElement=function(e){if(this.eat(w.semi))return null;var t=this.options.ecmaVersion,i=this.startNode(),n="",s=!1,r=!1,o="method",a=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(w.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===w.star?a=!0:n="static"}if(i.static=a,!n&&t>=8&&this.eatContextual("async")&&(!this.isClassElementNameStart()&&this.type!==w.star||this.canInsertSemicolon()?n="async":r=!0),!n&&(t>=9||!r)&&this.eat(w.star)&&(s=!0),!n&&!r&&!s){var l=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?o=l:n=l)}if(n?(i.computed=!1,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=n,this.finishNode(i.key,"Identifier")):this.parseClassElementName(i),t<13||this.type===w.parenL||"method"!==o||s||r){var c=!i.static&&te(i,"constructor"),h=c&&e;c&&"method"!==o&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=c?"constructor":o,this.parseClassMethod(i,s,r,h)}else this.parseClassField(i);return i},Y.isClassElementNameStart=function(){return this.type===w.name||this.type===w.privateId||this.type===w.num||this.type===w.string||this.type===w.bracketL||this.type.keyword},Y.parseClassElementName=function(e){this.type===w.privateId?("constructor"===this.value&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},Y.parseClassMethod=function(e,t,i,n){var s=e.key;"constructor"===e.kind?(t&&this.raise(s.start,"Constructor can't be a generator"),i&&this.raise(s.start,"Constructor can't be an async method")):e.static&&te(e,"prototype")&&this.raise(s.start,"Classes may not have a static property named prototype");var r=e.value=this.parseMethod(t,i,n);return"get"===e.kind&&0!==r.params.length&&this.raiseRecoverable(r.start,"getter should have no params"),"set"===e.kind&&1!==r.params.length&&this.raiseRecoverable(r.start,"setter should have exactly one param"),"set"===e.kind&&"RestElement"===r.params[0].type&&this.raiseRecoverable(r.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")},Y.parseClassField=function(e){return te(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&te(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(w.eq)?(this.enterScope(576),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,"PropertyDefinition")},Y.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(320);this.type!==w.braceR;){var i=this.parseStatement(null);e.body.push(i)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")},Y.parseClassId=function(e,t){this.type===w.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,2,!1)):(!0===t&&this.unexpected(),e.id=null)},Y.parseClassSuper=function(e){e.superClass=this.eat(w._extends)?this.parseExprSubscripts(null,!1):null},Y.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},Y.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,i=e.used;if(this.options.checkPrivateFields)for(var n=this.privateNameStack.length,s=0===n?null:this.privateNameStack[n-1],r=0;r<i.length;++r){var o=i[r];k(t,o.name)||(s?s.used.push(o):this.raiseRecoverable(o.start,"Private field '#"+o.name+"' must be declared in an enclosing class"))}},Y.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==w.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")},Y.parseExport=function(e,t){if(this.next(),this.eat(w.star))return this.parseExportAllDeclaration(e,t);if(this.eat(w._default))return this.checkExport(t,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),"VariableDeclaration"===e.declaration.type?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==w.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var i=0,n=e.specifiers;i<n.length;i+=1){var s=n[i];this.checkUnreserved(s.local),this.checkLocalExport(s.local),"Literal"===s.local.type&&this.raise(s.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[])}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")},Y.parseExportDeclaration=function(e){return this.parseStatement(null)},Y.parseExportDefaultDeclaration=function(){var e;if(this.type===w._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,4|Q,!1,e)}if(this.type===w._class){var i=this.startNode();return this.parseClass(i,"nullableID")}var n=this.parseMaybeAssign();return this.semicolon(),n},Y.checkExport=function(e,t,i){e&&("string"!=typeof t&&(t="Identifier"===t.type?t.name:t.value),k(e,t)&&this.raiseRecoverable(i,"Duplicate export '"+t+"'"),e[t]=!0)},Y.checkPatternExport=function(e,t){var i=t.type;if("Identifier"===i)this.checkExport(e,t,t.start);else if("ObjectPattern"===i)for(var n=0,s=t.properties;n<s.length;n+=1){var r=s[n];this.checkPatternExport(e,r)}else if("ArrayPattern"===i)for(var o=0,a=t.elements;o<a.length;o+=1){var l=a[o];l&&this.checkPatternExport(e,l)}else"Property"===i?this.checkPatternExport(e,t.value):"AssignmentPattern"===i?this.checkPatternExport(e,t.left):"RestElement"===i&&this.checkPatternExport(e,t.argument)},Y.checkVariableExport=function(e,t){if(e)for(var i=0,n=t;i<n.length;i+=1){var s=n[i];this.checkPatternExport(e,s.id)}},Y.shouldParseExportStatement=function(){return"var"===this.type.keyword||"const"===this.type.keyword||"class"===this.type.keyword||"function"===this.type.keyword||this.isLet()||this.isAsyncFunction()},Y.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual("as")?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,"ExportSpecifier")},Y.parseExportSpecifiers=function(e){var t=[],i=!0;for(this.expect(w.braceL);!this.eat(w.braceR);){if(i)i=!1;else if(this.expect(w.comma),this.afterTrailingComma(w.braceR))break;t.push(this.parseExportSpecifier(e))}return t},Y.parseImport=function(e){return this.next(),this.type===w.string?(e.specifiers=Z,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===w.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ImportDeclaration")},Y.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual("as")?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,2),this.finishNode(e,"ImportSpecifier")},Y.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,2),this.finishNode(e,"ImportDefaultSpecifier")},Y.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,2),this.finishNode(e,"ImportNamespaceSpecifier")},Y.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===w.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(w.comma)))return e;if(this.type===w.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(w.braceL);!this.eat(w.braceR);){if(t)t=!1;else if(this.expect(w.comma),this.afterTrailingComma(w.braceR))break;e.push(this.parseImportSpecifier())}return e},Y.parseWithClause=function(){var e=[];if(!this.eat(w._with))return e;this.expect(w.braceL);for(var t={},i=!0;!this.eat(w.braceR);){if(i)i=!1;else if(this.expect(w.comma),this.afterTrailingComma(w.braceR))break;var n=this.parseImportAttribute(),s="Identifier"===n.key.type?n.key.name:n.key.value;k(t,s)&&this.raiseRecoverable(n.key.start,"Duplicate attribute key '"+s+"'"),t[s]=!0,e.push(n)}return e},Y.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===w.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved),this.expect(w.colon),this.type!==w.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,"ImportAttribute")},Y.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===w.string){var e=this.parseLiteral(this.value);return O.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)},Y.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},Y.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&"ExpressionStatement"===e.type&&"Literal"===e.expression.type&&"string"==typeof e.expression.value&&('"'===this.input[e.start]||"'"===this.input[e.start])};var ie=z.prototype;ie.toAssignable=function(e,t,i){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&"await"===e.name&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",i&&this.checkPatternErrors(i,!0);for(var n=0,s=e.properties;n<s.length;n+=1){var r=s[n];this.toAssignable(r,t),"RestElement"!==r.type||"ArrayPattern"!==r.argument.type&&"ObjectPattern"!==r.argument.type||this.raise(r.argument.start,"Unexpected token")}break;case"Property":"init"!==e.kind&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,t);break;case"ArrayExpression":e.type="ArrayPattern",i&&this.checkPatternErrors(i,!0),this.toAssignableList(e.elements,t);break;case"SpreadElement":e.type="RestElement",this.toAssignable(e.argument,t),"AssignmentPattern"===e.argument.type&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":"="!==e.operator&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,i);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}else i&&this.checkPatternErrors(i,!0);return e},ie.toAssignableList=function(e,t){for(var i=e.length,n=0;n<i;n++){var s=e[n];s&&this.toAssignable(s,t)}if(i){var r=e[i-1];6===this.options.ecmaVersion&&t&&r&&"RestElement"===r.type&&"Identifier"!==r.argument.type&&this.unexpected(r.argument.start)}return e},ie.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")},ie.parseRestBinding=function(){var e=this.startNode();return this.next(),6===this.options.ecmaVersion&&this.type!==w.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")},ie.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case w.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(w.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case w.braceL:return this.parseObj(!0)}return this.parseIdent()},ie.parseBindingList=function(e,t,i,n){for(var s=[],r=!0;!this.eat(e);)if(r?r=!1:this.expect(w.comma),t&&this.type===w.comma)s.push(null);else{if(i&&this.afterTrailingComma(e))break;if(this.type===w.ellipsis){var o=this.parseRestBinding();this.parseBindingListItem(o),s.push(o),this.type===w.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}s.push(this.parseAssignableListItem(n))}return s},ie.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t},ie.parseBindingListItem=function(e){return e},ie.parseMaybeDefault=function(e,t,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(w.eq))return i;var n=this.startNodeAt(e,t);return n.left=i,n.right=this.parseMaybeAssign(),this.finishNode(n,"AssignmentPattern")},ie.checkLValSimple=function(e,t,i){void 0===t&&(t=0);var n=0!==t;switch(e.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(n?"Binding ":"Assigning to ")+e.name+" in strict mode"),n&&(2===t&&"let"===e.name&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),i&&(k(i,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),i[e.name]=!0),5!==t&&this.declareName(e.name,t,e.start));break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":n&&this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":return n&&this.raiseRecoverable(e.start,"Binding parenthesized expression"),this.checkLValSimple(e.expression,t,i);default:this.raise(e.start,(n?"Binding":"Assigning to")+" rvalue")}},ie.checkLValPattern=function(e,t,i){switch(void 0===t&&(t=0),e.type){case"ObjectPattern":for(var n=0,s=e.properties;n<s.length;n+=1){var r=s[n];this.checkLValInnerPattern(r,t,i)}break;case"ArrayPattern":for(var o=0,a=e.elements;o<a.length;o+=1){var l=a[o];l&&this.checkLValInnerPattern(l,t,i)}break;default:this.checkLValSimple(e,t,i)}},ie.checkLValInnerPattern=function(e,t,i){switch(void 0===t&&(t=0),e.type){case"Property":this.checkLValInnerPattern(e.value,t,i);break;case"AssignmentPattern":this.checkLValPattern(e.left,t,i);break;case"RestElement":this.checkLValPattern(e.argument,t,i);break;default:this.checkLValPattern(e,t,i)}};var ne=function(e,t,i,n,s){this.token=e,this.isExpr=!!t,this.preserveSpace=!!i,this.override=n,this.generator=!!s},se={b_stat:new ne("{",!1),b_expr:new ne("{",!0),b_tmpl:new ne("${",!1),p_stat:new ne("(",!1),p_expr:new ne("(",!0),q_tmpl:new ne("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new ne("function",!1),f_expr:new ne("function",!0),f_expr_gen:new ne("function",!0,!1,null,!0),f_gen:new ne("function",!1,!1,null,!0)},re=z.prototype;re.initialContext=function(){return[se.b_stat]},re.curContext=function(){return this.context[this.context.length-1]},re.braceIsBlock=function(e){var t=this.curContext();return t===se.f_expr||t===se.f_stat||(e!==w.colon||t!==se.b_stat&&t!==se.b_expr?e===w._return||e===w.name&&this.exprAllowed?S.test(this.input.slice(this.lastTokEnd,this.start)):e===w._else||e===w.semi||e===w.eof||e===w.parenR||e===w.arrow||(e===w.braceL?t===se.b_stat:e!==w._var&&e!==w._const&&e!==w.name&&!this.exprAllowed):!t.isExpr)},re.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if("function"===t.token)return t.generator}return!1},re.updateContext=function(e){var t,i=this.type;i.keyword&&e===w.dot?this.exprAllowed=!1:(t=i.updateContext)?t.call(this,e):this.exprAllowed=i.beforeExpr},re.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)},w.parenR.updateContext=w.braceR.updateContext=function(){if(1!==this.context.length){var e=this.context.pop();e===se.b_stat&&"function"===this.curContext().token&&(e=this.context.pop()),this.exprAllowed=!e.isExpr}else this.exprAllowed=!0},w.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?se.b_stat:se.b_expr),this.exprAllowed=!0},w.dollarBraceL.updateContext=function(){this.context.push(se.b_tmpl),this.exprAllowed=!0},w.parenL.updateContext=function(e){var t=e===w._if||e===w._for||e===w._with||e===w._while;this.context.push(t?se.p_stat:se.p_expr),this.exprAllowed=!0},w.incDec.updateContext=function(){},w._function.updateContext=w._class.updateContext=function(e){!e.beforeExpr||e===w._else||e===w.semi&&this.curContext()!==se.p_stat||e===w._return&&S.test(this.input.slice(this.lastTokEnd,this.start))||(e===w.colon||e===w.braceL)&&this.curContext()===se.b_stat?this.context.push(se.f_stat):this.context.push(se.f_expr),this.exprAllowed=!1},w.colon.updateContext=function(){"function"===this.curContext().token&&this.context.pop(),this.exprAllowed=!0},w.backQuote.updateContext=function(){this.curContext()===se.q_tmpl?this.context.pop():this.context.push(se.q_tmpl),this.exprAllowed=!1},w.star.updateContext=function(e){if(e===w._function){var t=this.context.length-1;this.context[t]===se.f_expr?this.context[t]=se.f_expr_gen:this.context[t]=se.f_gen}this.exprAllowed=!0},w.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==w.dot&&("of"===this.value&&!this.exprAllowed||"yield"===this.value&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var oe=z.prototype;function ae(e){return"Identifier"===e.type||"ParenthesizedExpression"===e.type&&ae(e.expression)}function le(e){return"MemberExpression"===e.type&&"PrivateIdentifier"===e.property.type||"ChainExpression"===e.type&&le(e.expression)||"ParenthesizedExpression"===e.type&&le(e.expression)}oe.checkPropClash=function(e,t,i){if(!(this.options.ecmaVersion>=9&&"SpreadElement"===e.type||this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var n,s=e.key;switch(s.type){case"Identifier":n=s.name;break;case"Literal":n=String(s.value);break;default:return}var r=e.kind;if(this.options.ecmaVersion>=6)"__proto__"===n&&"init"===r&&(t.proto&&(i?i.doubleProto<0&&(i.doubleProto=s.start):this.raiseRecoverable(s.start,"Redefinition of __proto__ property")),t.proto=!0);else{var o=t[n="$"+n];o?("init"===r?this.strict&&o.init||o.get||o.set:o.init||o[r])&&this.raiseRecoverable(s.start,"Redefinition of property"):o=t[n]={init:!1,get:!1,set:!1},o[r]=!0}}},oe.parseExpression=function(e,t){var i=this.start,n=this.startLoc,s=this.parseMaybeAssign(e,t);if(this.type===w.comma){var r=this.startNodeAt(i,n);for(r.expressions=[s];this.eat(w.comma);)r.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(r,"SequenceExpression")}return s},oe.parseMaybeAssign=function(e,t,i){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var n=!1,s=-1,r=-1,o=-1;t?(s=t.parenthesizedAssign,r=t.trailingComma,o=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new K,n=!0);var a=this.start,l=this.startLoc;this.type!==w.parenL&&this.type!==w.name||(this.potentialArrowAt=this.start,this.potentialArrowInForAwait="await"===e);var c=this.parseMaybeConditional(e,t);if(i&&(c=i.call(this,c,a,l)),this.type.isAssign){var h=this.startNodeAt(a,l);return h.operator=this.value,this.type===w.eq&&(c=this.toAssignable(c,!1,t)),n||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=c.start&&(t.shorthandAssign=-1),this.type===w.eq?this.checkLValPattern(c):this.checkLValSimple(c),h.left=c,this.next(),h.right=this.parseMaybeAssign(e),o>-1&&(t.doubleProto=o),this.finishNode(h,"AssignmentExpression")}return n&&this.checkExpressionErrors(t,!0),s>-1&&(t.parenthesizedAssign=s),r>-1&&(t.trailingComma=r),c},oe.parseMaybeConditional=function(e,t){var i=this.start,n=this.startLoc,s=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return s;if(this.eat(w.question)){var r=this.startNodeAt(i,n);return r.test=s,r.consequent=this.parseMaybeAssign(),this.expect(w.colon),r.alternate=this.parseMaybeAssign(e),this.finishNode(r,"ConditionalExpression")}return s},oe.parseExprOps=function(e,t){var i=this.start,n=this.startLoc,s=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||s.start===i&&"ArrowFunctionExpression"===s.type?s:this.parseExprOp(s,i,n,-1,e)},oe.parseExprOp=function(e,t,i,n,s){var r=this.type.binop;if(null!=r&&(!s||this.type!==w._in)&&r>n){var o=this.type===w.logicalOR||this.type===w.logicalAND,a=this.type===w.coalesce;a&&(r=w.logicalAND.binop);var l=this.value;this.next();var c=this.start,h=this.startLoc,u=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,s),c,h,r,s),d=this.buildBinary(t,i,e,u,l,o||a);return(o&&this.type===w.coalesce||a&&(this.type===w.logicalOR||this.type===w.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(d,t,i,n,s)}return e},oe.buildBinary=function(e,t,i,n,s,r){"PrivateIdentifier"===n.type&&this.raise(n.start,"Private identifier can only be left side of binary expression");var o=this.startNodeAt(e,t);return o.left=i,o.operator=s,o.right=n,this.finishNode(o,r?"LogicalExpression":"BinaryExpression")},oe.parseMaybeUnary=function(e,t,i,n){var s,r=this.start,o=this.startLoc;if(this.isContextual("await")&&this.canAwait)s=this.parseAwait(n),t=!0;else if(this.type.prefix){var a=this.startNode(),l=this.type===w.incDec;a.operator=this.value,a.prefix=!0,this.next(),a.argument=this.parseMaybeUnary(null,!0,l,n),this.checkExpressionErrors(e,!0),l?this.checkLValSimple(a.argument):this.strict&&"delete"===a.operator&&ae(a.argument)?this.raiseRecoverable(a.start,"Deleting local variable in strict mode"):"delete"===a.operator&&le(a.argument)?this.raiseRecoverable(a.start,"Private fields can not be deleted"):t=!0,s=this.finishNode(a,l?"UpdateExpression":"UnaryExpression")}else if(t||this.type!==w.privateId){if(s=this.parseExprSubscripts(e,n),this.checkExpressionErrors(e))return s;for(;this.type.postfix&&!this.canInsertSemicolon();){var c=this.startNodeAt(r,o);c.operator=this.value,c.prefix=!1,c.argument=s,this.checkLValSimple(s),this.next(),s=this.finishNode(c,"UpdateExpression")}}else(n||0===this.privateNameStack.length)&&this.options.checkPrivateFields&&this.unexpected(),s=this.parsePrivateIdent(),this.type!==w._in&&this.unexpected();return i||!this.eat(w.starstar)?s:t?void this.unexpected(this.lastTokStart):this.buildBinary(r,o,s,this.parseMaybeUnary(null,!1,!1,n),"**",!1)},oe.parseExprSubscripts=function(e,t){var i=this.start,n=this.startLoc,s=this.parseExprAtom(e,t);if("ArrowFunctionExpression"===s.type&&")"!==this.input.slice(this.lastTokStart,this.lastTokEnd))return s;var r=this.parseSubscripts(s,i,n,!1,t);return e&&"MemberExpression"===r.type&&(e.parenthesizedAssign>=r.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=r.start&&(e.parenthesizedBind=-1),e.trailingComma>=r.start&&(e.trailingComma=-1)),r},oe.parseSubscripts=function(e,t,i,n,s){for(var r=this.options.ecmaVersion>=8&&"Identifier"===e.type&&"async"===e.name&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,o=!1;;){var a=this.parseSubscript(e,t,i,n,r,o,s);if(a.optional&&(o=!0),a===e||"ArrowFunctionExpression"===a.type){if(o){var l=this.startNodeAt(t,i);l.expression=a,a=this.finishNode(l,"ChainExpression")}return a}e=a}},oe.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(w.arrow)},oe.parseSubscriptAsyncArrow=function(e,t,i,n){return this.parseArrowExpression(this.startNodeAt(e,t),i,!0,n)},oe.parseSubscript=function(e,t,i,n,s,r,o){var a=this.options.ecmaVersion>=11,l=a&&this.eat(w.questionDot);n&&l&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var c=this.eat(w.bracketL);if(c||l&&this.type!==w.parenL&&this.type!==w.backQuote||this.eat(w.dot)){var h=this.startNodeAt(t,i);h.object=e,c?(h.property=this.parseExpression(),this.expect(w.bracketR)):this.type===w.privateId&&"Super"!==e.type?h.property=this.parsePrivateIdent():h.property=this.parseIdent("never"!==this.options.allowReserved),h.computed=!!c,a&&(h.optional=l),e=this.finishNode(h,"MemberExpression")}else if(!n&&this.eat(w.parenL)){var u=new K,d=this.yieldPos,p=this.awaitPos,g=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var f=this.parseExprList(w.parenR,this.options.ecmaVersion>=8,!1,u);if(s&&!l&&this.shouldParseAsyncArrow())return this.checkPatternErrors(u,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=d,this.awaitPos=p,this.awaitIdentPos=g,this.parseSubscriptAsyncArrow(t,i,f,o);this.checkExpressionErrors(u,!0),this.yieldPos=d||this.yieldPos,this.awaitPos=p||this.awaitPos,this.awaitIdentPos=g||this.awaitIdentPos;var m=this.startNodeAt(t,i);m.callee=e,m.arguments=f,a&&(m.optional=l),e=this.finishNode(m,"CallExpression")}else if(this.type===w.backQuote){(l||r)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var y=this.startNodeAt(t,i);y.tag=e,y.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(y,"TaggedTemplateExpression")}return e},oe.parseExprAtom=function(e,t,i){this.type===w.slash&&this.readRegexp();var n,s=this.potentialArrowAt===this.start;switch(this.type){case w._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),n=this.startNode(),this.next(),this.type!==w.parenL||this.allowDirectSuper||this.raise(n.start,"super() call outside constructor of a subclass"),this.type!==w.dot&&this.type!==w.bracketL&&this.type!==w.parenL&&this.unexpected(),this.finishNode(n,"Super");case w._this:return n=this.startNode(),this.next(),this.finishNode(n,"ThisExpression");case w.name:var r=this.start,o=this.startLoc,a=this.containsEsc,l=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!a&&"async"===l.name&&!this.canInsertSemicolon()&&this.eat(w._function))return this.overrideContext(se.f_expr),this.parseFunction(this.startNodeAt(r,o),0,!1,!0,t);if(s&&!this.canInsertSemicolon()){if(this.eat(w.arrow))return this.parseArrowExpression(this.startNodeAt(r,o),[l],!1,t);if(this.options.ecmaVersion>=8&&"async"===l.name&&this.type===w.name&&!a&&(!this.potentialArrowInForAwait||"of"!==this.value||this.containsEsc))return l=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(w.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(r,o),[l],!0,t)}return l;case w.regexp:var c=this.value;return(n=this.parseLiteral(c.value)).regex={pattern:c.pattern,flags:c.flags},n;case w.num:case w.string:return this.parseLiteral(this.value);case w._null:case w._true:case w._false:return(n=this.startNode()).value=this.type===w._null?null:this.type===w._true,n.raw=this.type.keyword,this.next(),this.finishNode(n,"Literal");case w.parenL:var h=this.start,u=this.parseParenAndDistinguishExpression(s,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(u)&&(e.parenthesizedAssign=h),e.parenthesizedBind<0&&(e.parenthesizedBind=h)),u;case w.bracketL:return n=this.startNode(),this.next(),n.elements=this.parseExprList(w.bracketR,!0,!0,e),this.finishNode(n,"ArrayExpression");case w.braceL:return this.overrideContext(se.b_expr),this.parseObj(!1,e);case w._function:return n=this.startNode(),this.next(),this.parseFunction(n,0);case w._class:return this.parseClass(this.startNode(),!1);case w._new:return this.parseNew();case w.backQuote:return this.parseTemplate();case w._import:return this.options.ecmaVersion>=11?this.parseExprImport(i):this.unexpected();default:return this.parseExprAtomDefault()}},oe.parseExprAtomDefault=function(){this.unexpected()},oe.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===w.parenL&&!e)return this.parseDynamicImport(t);if(this.type===w.dot){var i=this.startNodeAt(t.start,t.loc&&t.loc.start);return i.name="import",t.meta=this.finishNode(i,"Identifier"),this.parseImportMeta(t)}this.unexpected()},oe.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(w.parenR)?e.options=null:(this.expect(w.comma),this.afterTrailingComma(w.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(w.parenR)||(this.expect(w.comma),this.afterTrailingComma(w.parenR)||this.unexpected())));else if(!this.eat(w.parenR)){var t=this.start;this.eat(w.comma)&&this.eat(w.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")},oe.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),"meta"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),"module"===this.options.sourceType||this.options.allowImportExportEverywhere||this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")},oe.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),110===t.raw.charCodeAt(t.raw.length-1)&&(t.bigint=null!=t.value?t.value.toString():t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")},oe.parseParenExpression=function(){this.expect(w.parenL);var e=this.parseExpression();return this.expect(w.parenR),e},oe.shouldParseArrow=function(e){return!this.canInsertSemicolon()},oe.parseParenAndDistinguishExpression=function(e,t){var i,n=this.start,s=this.startLoc,r=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o,a=this.start,l=this.startLoc,c=[],h=!0,u=!1,d=new K,p=this.yieldPos,g=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==w.parenR;){if(h?h=!1:this.expect(w.comma),r&&this.afterTrailingComma(w.parenR,!0)){u=!0;break}if(this.type===w.ellipsis){o=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===w.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}c.push(this.parseMaybeAssign(!1,d,this.parseParenItem))}var f=this.lastTokEnd,m=this.lastTokEndLoc;if(this.expect(w.parenR),e&&this.shouldParseArrow(c)&&this.eat(w.arrow))return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=p,this.awaitPos=g,this.parseParenArrowList(n,s,c,t);c.length&&!u||this.unexpected(this.lastTokStart),o&&this.unexpected(o),this.checkExpressionErrors(d,!0),this.yieldPos=p||this.yieldPos,this.awaitPos=g||this.awaitPos,c.length>1?((i=this.startNodeAt(a,l)).expressions=c,this.finishNodeAt(i,"SequenceExpression",f,m)):i=c[0]}else i=this.parseParenExpression();if(this.options.preserveParens){var y=this.startNodeAt(n,s);return y.expression=i,this.finishNode(y,"ParenthesizedExpression")}return i},oe.parseParenItem=function(e){return e},oe.parseParenArrowList=function(e,t,i,n){return this.parseArrowExpression(this.startNodeAt(e,t),i,!1,n)};var ce=[];oe.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===w.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();var i=this.containsEsc;return e.property=this.parseIdent(!0),"target"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),i&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var n=this.start,s=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),n,s,!0,!1),this.eat(w.parenL)?e.arguments=this.parseExprList(w.parenR,this.options.ecmaVersion>=8,!1):e.arguments=ce,this.finishNode(e,"NewExpression")},oe.parseTemplateElement=function(e){var t=e.isTagged,i=this.startNode();return this.type===w.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),i.value={raw:this.value.replace(/\r\n?/g,"\n"),cooked:null}):i.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),i.tail=this.type===w.backQuote,this.finishNode(i,"TemplateElement")},oe.parseTemplate=function(e){void 0===e&&(e={});var t=e.isTagged;void 0===t&&(t=!1);var i=this.startNode();this.next(),i.expressions=[];var n=this.parseTemplateElement({isTagged:t});for(i.quasis=[n];!n.tail;)this.type===w.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(w.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(w.braceR),i.quasis.push(n=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(i,"TemplateLiteral")},oe.isAsyncProp=function(e){return!e.computed&&"Identifier"===e.key.type&&"async"===e.key.name&&(this.type===w.name||this.type===w.num||this.type===w.string||this.type===w.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===w.star)&&!S.test(this.input.slice(this.lastTokEnd,this.start))},oe.parseObj=function(e,t){var i=this.startNode(),n=!0,s={};for(i.properties=[],this.next();!this.eat(w.braceR);){if(n)n=!1;else if(this.expect(w.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(w.braceR))break;var r=this.parseProperty(e,t);e||this.checkPropClash(r,s,t),i.properties.push(r)}return this.finishNode(i,e?"ObjectPattern":"ObjectExpression")},oe.parseProperty=function(e,t){var i,n,s,r,o=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(w.ellipsis))return e?(o.argument=this.parseIdent(!1),this.type===w.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(o,"RestElement")):(o.argument=this.parseMaybeAssign(!1,t),this.type===w.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(o,"SpreadElement"));this.options.ecmaVersion>=6&&(o.method=!1,o.shorthand=!1,(e||t)&&(s=this.start,r=this.startLoc),e||(i=this.eat(w.star)));var a=this.containsEsc;return this.parsePropertyName(o),!e&&!a&&this.options.ecmaVersion>=8&&!i&&this.isAsyncProp(o)?(n=!0,i=this.options.ecmaVersion>=9&&this.eat(w.star),this.parsePropertyName(o)):n=!1,this.parsePropertyValue(o,e,i,n,s,r,t,a),this.finishNode(o,"Property")},oe.parseGetterSetter=function(e){var t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(!1),e.kind=t;var i="get"===e.kind?0:1;if(e.value.params.length!==i){var n=e.value.start;"get"===e.kind?this.raiseRecoverable(n,"getter should have no params"):this.raiseRecoverable(n,"setter should have exactly one param")}else"set"===e.kind&&"RestElement"===e.value.params[0].type&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")},oe.parsePropertyValue=function(e,t,i,n,s,r,o,a){(i||n)&&this.type===w.colon&&this.unexpected(),this.eat(w.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind="init"):this.options.ecmaVersion>=6&&this.type===w.parenL?(t&&this.unexpected(),e.method=!0,e.value=this.parseMethod(i,n),e.kind="init"):t||a||!(this.options.ecmaVersion>=5)||e.computed||"Identifier"!==e.key.type||"get"!==e.key.name&&"set"!==e.key.name||this.type===w.comma||this.type===w.braceR||this.type===w.eq?this.options.ecmaVersion>=6&&!e.computed&&"Identifier"===e.key.type?((i||n)&&this.unexpected(),this.checkUnreserved(e.key),"await"!==e.key.name||this.awaitIdentPos||(this.awaitIdentPos=s),t?e.value=this.parseMaybeDefault(s,r,this.copyNode(e.key)):this.type===w.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(s,r,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.kind="init",e.shorthand=!0):this.unexpected():((i||n)&&this.unexpected(),this.parseGetterSetter(e))},oe.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(w.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(w.bracketR),e.key;e.computed=!1}return e.key=this.type===w.num||this.type===w.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},oe.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},oe.parseMethod=function(e,t,i){var n=this.startNode(),s=this.yieldPos,r=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(n),this.options.ecmaVersion>=6&&(n.generator=e),this.options.ecmaVersion>=8&&(n.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|U(t,n.generator)|(i?128:0)),this.expect(w.parenL),n.params=this.parseBindingList(w.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(n,!1,!0,!1),this.yieldPos=s,this.awaitPos=r,this.awaitIdentPos=o,this.finishNode(n,"FunctionExpression")},oe.parseArrowExpression=function(e,t,i,n){var s=this.yieldPos,r=this.awaitPos,o=this.awaitIdentPos;return this.enterScope(16|U(i,!1)),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,n),this.yieldPos=s,this.awaitPos=r,this.awaitIdentPos=o,this.finishNode(e,"ArrowFunctionExpression")},oe.parseFunctionBody=function(e,t,i,n){var s=t&&this.type!==w.braceL,r=this.strict,o=!1;if(s)e.body=this.parseMaybeAssign(n),e.expression=!0,this.checkParams(e,!1);else{var a=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);r&&!a||(o=this.strictDirective(this.end))&&a&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list");var l=this.labels;this.labels=[],o&&(this.strict=!0),this.checkParams(e,!r&&!o&&!t&&!i&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,5),e.body=this.parseBlock(!1,void 0,o&&!r),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=l}this.exitScope()},oe.isSimpleParamList=function(e){for(var t=0,i=e;t<i.length;t+=1)if("Identifier"!==i[t].type)return!1;return!0},oe.checkParams=function(e,t){for(var i=Object.create(null),n=0,s=e.params;n<s.length;n+=1){var r=s[n];this.checkLValInnerPattern(r,1,t?null:i)}},oe.parseExprList=function(e,t,i,n){for(var s=[],r=!0;!this.eat(e);){if(r)r=!1;else if(this.expect(w.comma),t&&this.afterTrailingComma(e))break;var o=void 0;i&&this.type===w.comma?o=null:this.type===w.ellipsis?(o=this.parseSpread(n),n&&this.type===w.comma&&n.trailingComma<0&&(n.trailingComma=this.start)):o=this.parseMaybeAssign(!1,n),s.push(o)}return s},oe.checkUnreserved=function(e){var t=e.start,i=e.end,n=e.name;this.inGenerator&&"yield"===n&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&"await"===n&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),259&this.currentThisScope().flags||"arguments"!==n||this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer"),!this.inClassStaticBlock||"arguments"!==n&&"await"!==n||this.raise(t,"Cannot use "+n+" in class static initialization block"),this.keywords.test(n)&&this.raise(t,"Unexpected keyword '"+n+"'"),this.options.ecmaVersion<6&&-1!==this.input.slice(t,i).indexOf("\\")||(this.strict?this.reservedWordsStrict:this.reservedWords).test(n)&&(this.inAsync||"await"!==n||this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,"The keyword '"+n+"' is reserved"))},oe.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,"Identifier"),e||(this.checkUnreserved(t),"await"!==t.name||this.awaitIdentPos||(this.awaitIdentPos=t.start)),t},oe.parseIdentNode=function(){var e=this.startNode();return this.type===w.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,"class"!==e.name&&"function"!==e.name||this.lastTokEnd===this.lastTokStart+1&&46===this.input.charCodeAt(this.lastTokStart)||this.context.pop(),this.type=w.name):this.unexpected(),e},oe.parsePrivateIdent=function(){var e=this.startNode();return this.type===w.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,"PrivateIdentifier"),this.options.checkPrivateFields&&(0===this.privateNameStack.length?this.raise(e.start,"Private field '#"+e.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e},oe.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);var t=this.startNode();return this.next(),this.type===w.semi||this.canInsertSemicolon()||this.type!==w.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(w.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")},oe.parseAwait=function(e){this.awaitPos||(this.awaitPos=this.start);var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,"AwaitExpression")};var he=z.prototype;he.raise=function(e,t){var i=B(this.input,e);t+=" ("+i.line+":"+i.column+")",this.sourceFile&&(t+=" in "+this.sourceFile);var n=new SyntaxError(t);throw n.pos=e,n.loc=i,n.raisedAt=this.pos,n},he.raiseRecoverable=he.raise,he.curPosition=function(){if(this.options.locations)return new F(this.curLine,this.pos-this.lineStart)};var ue=z.prototype,de=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};ue.enterScope=function(e){this.scopeStack.push(new de(e))},ue.exitScope=function(){this.scopeStack.pop()},ue.treatFunctionsAsVarInScope=function(e){return 2&e.flags||!this.inModule&&1&e.flags},ue.declareName=function(e,t,i){var n=!1;if(2===t){var s=this.currentScope();n=s.lexical.indexOf(e)>-1||s.functions.indexOf(e)>-1||s.var.indexOf(e)>-1,s.lexical.push(e),this.inModule&&1&s.flags&&delete this.undefinedExports[e]}else if(4===t)this.currentScope().lexical.push(e);else if(3===t){var r=this.currentScope();n=this.treatFunctionsAsVar?r.lexical.indexOf(e)>-1:r.lexical.indexOf(e)>-1||r.var.indexOf(e)>-1,r.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var a=this.scopeStack[o];if(a.lexical.indexOf(e)>-1&&!(32&a.flags&&a.lexical[0]===e)||!this.treatFunctionsAsVarInScope(a)&&a.functions.indexOf(e)>-1){n=!0;break}if(a.var.push(e),this.inModule&&1&a.flags&&delete this.undefinedExports[e],259&a.flags)break}n&&this.raiseRecoverable(i,"Identifier '"+e+"' has already been declared")},ue.checkLocalExport=function(e){-1===this.scopeStack[0].lexical.indexOf(e.name)&&-1===this.scopeStack[0].var.indexOf(e.name)&&(this.undefinedExports[e.name]=e)},ue.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},ue.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(771&t.flags)return t}},ue.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(771&t.flags&&!(16&t.flags))return t}};var pe=function(e,t,i){this.type="",this.start=t,this.end=0,e.options.locations&&(this.loc=new G(e,i)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},ge=z.prototype;function fe(e,t,i,n){return e.type=t,e.end=i,this.options.locations&&(e.loc.end=n),this.options.ranges&&(e.range[1]=i),e}ge.startNode=function(){return new pe(this,this.start,this.startLoc)},ge.startNodeAt=function(e,t){return new pe(this,e,t)},ge.finishNode=function(e,t){return fe.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},ge.finishNodeAt=function(e,t,i,n){return fe.call(this,e,t,i,n)},ge.copyNode=function(e){var t=new pe(this,e.start,this.startLoc);for(var i in e)t[i]=e[i];return t};var me="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",ye=me+" Extended_Pictographic",ve=ye+" EBase EComp EMod EPres ExtPict",be={9:me,10:ye,11:ye,12:ve,13:ve,14:ve},Ce={9:"",10:"",11:"",12:"",13:"",14:"Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji"},we="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Se="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",xe=Se+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Ee=xe+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Ae=Ee+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Me=Ae+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",Te={9:Se,10:xe,11:Ee,12:Ae,13:Me,14:Me+" Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz"},De={};function Ie(e){var t=De[e]={binary:L(be[e]+" "+we),binaryOfStrings:L(Ce[e]),nonBinary:{General_Category:L(we),Script:L(Te[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var Re=0,ke=[9,10,11,12,13,14];Re<ke.length;Re+=1)Ie(ke[Re]);var Pe=z.prototype,_e=function(e,t){this.parent=e,this.base=t||this};_e.prototype.separatedFrom=function(e){for(var t=this;t;t=t.parent)for(var i=e;i;i=i.parent)if(t.base===i.base&&t!==i)return!0;return!1},_e.prototype.sibling=function(){return new _e(this.parent,this.base)};var Le=function(e){this.parser=e,this.validFlags="gim"+(e.options.ecmaVersion>=6?"uy":"")+(e.options.ecmaVersion>=9?"s":"")+(e.options.ecmaVersion>=13?"d":"")+(e.options.ecmaVersion>=15?"v":""),this.unicodeProperties=De[e.options.ecmaVersion>=14?14:e.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};function Ne(e){return 105===e||109===e||115===e}function Oe(e){return 36===e||e>=40&&e<=43||46===e||63===e||e>=91&&e<=94||e>=123&&e<=125}function Fe(e){return e>=65&&e<=90||e>=97&&e<=122}function Ge(e){return Fe(e)||95===e}function Be(e){return Ge(e)||Ve(e)}function Ve(e){return e>=48&&e<=57}function He(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Ue(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e-48}function ze(e){return e>=48&&e<=55}Le.prototype.reset=function(e,t,i){var n=-1!==i.indexOf("v"),s=-1!==i.indexOf("u");this.start=0|e,this.source=t+"",this.flags=i,n&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=s&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=s&&this.parser.options.ecmaVersion>=9)},Le.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},Le.prototype.at=function(e,t){void 0===t&&(t=!1);var i=this.source,n=i.length;if(e>=n)return-1;var s=i.charCodeAt(e);if(!t&&!this.switchU||s<=55295||s>=57344||e+1>=n)return s;var r=i.charCodeAt(e+1);return r>=56320&&r<=57343?(s<<10)+r-56613888:s},Le.prototype.nextIndex=function(e,t){void 0===t&&(t=!1);var i=this.source,n=i.length;if(e>=n)return n;var s,r=i.charCodeAt(e);return!t&&!this.switchU||r<=55295||r>=57344||e+1>=n||(s=i.charCodeAt(e+1))<56320||s>57343?e+1:e+2},Le.prototype.current=function(e){return void 0===e&&(e=!1),this.at(this.pos,e)},Le.prototype.lookahead=function(e){return void 0===e&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},Le.prototype.advance=function(e){void 0===e&&(e=!1),this.pos=this.nextIndex(this.pos,e)},Le.prototype.eat=function(e,t){return void 0===t&&(t=!1),this.current(t)===e&&(this.advance(t),!0)},Le.prototype.eatChars=function(e,t){void 0===t&&(t=!1);for(var i=this.pos,n=0,s=e;n<s.length;n+=1){var r=s[n],o=this.at(i,t);if(-1===o||o!==r)return!1;i=this.nextIndex(i,t)}return this.pos=i,!0},Pe.validateRegExpFlags=function(e){for(var t=e.validFlags,i=e.flags,n=!1,s=!1,r=0;r<i.length;r++){var o=i.charAt(r);-1===t.indexOf(o)&&this.raise(e.start,"Invalid regular expression flag"),i.indexOf(o,r+1)>-1&&this.raise(e.start,"Duplicate regular expression flag"),"u"===o&&(n=!0),"v"===o&&(s=!0)}this.options.ecmaVersion>=15&&n&&s&&this.raise(e.start,"Invalid regular expression flag")},Pe.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&function(e){for(var t in e)return!0;return!1}(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))},Pe.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,i=e.backReferenceNames;t<i.length;t+=1){var n=i[t];e.groupNames[n]||e.raise("Invalid named capture referenced")}},Pe.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new _e(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets")},Pe.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},Pe.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise("Invalid quantifier"),!0):!!(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))&&(this.regexp_eatQuantifier(e),!0)},Pe.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var i=!1;if(this.options.ecmaVersion>=9&&(i=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!i,!0}return e.pos=t,!1},Pe.regexp_eatQuantifier=function(e,t){return void 0===t&&(t=!1),!!this.regexp_eatQuantifierPrefix(e,t)&&(e.eat(63),!0)},Pe.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},Pe.regexp_eatBracedQuantifier=function(e,t){var i=e.pos;if(e.eat(123)){var n=0,s=-1;if(this.regexp_eatDecimalDigits(e)&&(n=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(s=e.lastIntValue),e.eat(125)))return-1!==s&&s<n&&!t&&e.raise("numbers out of order in {} quantifier"),!0;e.switchU&&!t&&e.raise("Incomplete quantifier"),e.pos=i}return!1},Pe.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},Pe.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},Pe.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var i=this.regexp_eatModifiers(e),n=e.eat(45);if(i||n){for(var s=0;s<i.length;s++){var r=i.charAt(s);i.indexOf(r,s+1)>-1&&e.raise("Duplicate regular expression modifiers")}if(n){var o=this.regexp_eatModifiers(e);i||o||58!==e.current()||e.raise("Invalid regular expression modifiers");for(var a=0;a<o.length;a++){var l=o.charAt(a);(o.indexOf(l,a+1)>-1||i.indexOf(l)>-1)&&e.raise("Duplicate regular expression modifiers")}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise("Unterminated group")}}e.pos=t}return!1},Pe.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):63===e.current()&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1},Pe.regexp_eatModifiers=function(e){for(var t="",i=0;-1!==(i=e.current())&&Ne(i);)t+=N(i),e.advance();return t},Pe.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},Pe.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},Pe.regexp_eatSyntaxCharacter=function(e){var t=e.current();return!!Oe(t)&&(e.lastIntValue=t,e.advance(),!0)},Pe.regexp_eatPatternCharacters=function(e){for(var t=e.pos,i=0;-1!==(i=e.current())&&!Oe(i);)e.advance();return e.pos!==t},Pe.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return!(-1===t||36===t||t>=40&&t<=43||46===t||63===t||91===t||94===t||124===t||(e.advance(),0))},Pe.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise("Invalid group");var t=this.options.ecmaVersion>=16,i=e.groupNames[e.lastStringValue];if(i)if(t)for(var n=0,s=i;n<s.length;n+=1)s[n].separatedFrom(e.branchID)||e.raise("Duplicate capture group name");else e.raise("Duplicate capture group name");t?(i||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=!0}},Pe.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1},Pe.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=N(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=N(e.lastIntValue);return!0}return!1},Pe.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,n=e.current(i);return e.advance(i),92===n&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(n=e.lastIntValue),function(e){return p(e,!0)||36===e||95===e}(n)?(e.lastIntValue=n,!0):(e.pos=t,!1)},Pe.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,n=e.current(i);return e.advance(i),92===n&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(n=e.lastIntValue),function(e){return g(e,!0)||36===e||95===e||8204===e||8205===e}(n)?(e.lastIntValue=n,!0):(e.pos=t,!1)},Pe.regexp_eatAtomEscape=function(e){return!!(this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e))||(e.switchU&&(99===e.current()&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)},Pe.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var i=e.lastIntValue;if(e.switchU)return i>e.maxBackReference&&(e.maxBackReference=i),!0;if(i<=e.numCapturingParens)return!0;e.pos=t}return!1},Pe.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1},Pe.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},Pe.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},Pe.regexp_eatZero=function(e){return 48===e.current()&&!Ve(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},Pe.regexp_eatControlEscape=function(e){var t=e.current();return 116===t?(e.lastIntValue=9,e.advance(),!0):110===t?(e.lastIntValue=10,e.advance(),!0):118===t?(e.lastIntValue=11,e.advance(),!0):102===t?(e.lastIntValue=12,e.advance(),!0):114===t&&(e.lastIntValue=13,e.advance(),!0)},Pe.regexp_eatControlLetter=function(e){var t=e.current();return!!Fe(t)&&(e.lastIntValue=t%32,e.advance(),!0)},Pe.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){void 0===t&&(t=!1);var i,n=e.pos,s=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var r=e.lastIntValue;if(s&&r>=55296&&r<=56319){var o=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var a=e.lastIntValue;if(a>=56320&&a<=57343)return e.lastIntValue=1024*(r-55296)+(a-56320)+65536,!0}e.pos=o,e.lastIntValue=r}return!0}if(s&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&(i=e.lastIntValue)>=0&&i<=1114111)return!0;s&&e.raise("Invalid unicode escape"),e.pos=n}return!1},Pe.regexp_eatIdentityEscape=function(e){if(e.switchU)return!!this.regexp_eatSyntaxCharacter(e)||!!e.eat(47)&&(e.lastIntValue=47,!0);var t=e.current();return!(99===t||e.switchN&&107===t||(e.lastIntValue=t,e.advance(),0))},Pe.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do{e.lastIntValue=10*e.lastIntValue+(t-48),e.advance()}while((t=e.current())>=48&&t<=57);return!0}return!1},Pe.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(function(e){return 100===e||68===e||115===e||83===e||119===e||87===e}(t))return e.lastIntValue=-1,e.advance(),1;var i=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((i=80===t)||112===t)){var n;if(e.lastIntValue=-1,e.advance(),e.eat(123)&&(n=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return i&&2===n&&e.raise("Invalid property name"),n;e.raise("Invalid property name")}return 0},Pe.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var i=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var n=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,i,n),1}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var s=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,s)}return 0},Pe.regexp_validateUnicodePropertyNameAndValue=function(e,t,i){k(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(i)||e.raise("Invalid property value")},Pe.regexp_validateUnicodePropertyNameOrValue=function(e,t){return e.unicodeProperties.binary.test(t)?1:e.switchV&&e.unicodeProperties.binaryOfStrings.test(t)?2:void e.raise("Invalid property name")},Pe.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";Ge(t=e.current());)e.lastStringValue+=N(t),e.advance();return""!==e.lastStringValue},Pe.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";Be(t=e.current());)e.lastStringValue+=N(t),e.advance();return""!==e.lastStringValue},Pe.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},Pe.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),i=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),t&&2===i&&e.raise("Negated character class may contain strings"),!0}return!1},Pe.regexp_classContents=function(e){return 93===e.current()?1:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),1)},Pe.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var i=e.lastIntValue;!e.switchU||-1!==t&&-1!==i||e.raise("Invalid character class"),-1!==t&&-1!==i&&t>i&&e.raise("Range out of order in character class")}}},Pe.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var i=e.current();(99===i||ze(i))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var n=e.current();return 93!==n&&(e.lastIntValue=n,e.advance(),!0)},Pe.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},Pe.regexp_classSetExpression=function(e){var t,i=1;if(this.regexp_eatClassSetRange(e));else if(t=this.regexp_eatClassSetOperand(e)){2===t&&(i=2);for(var n=e.pos;e.eatChars([38,38]);)38!==e.current()&&(t=this.regexp_eatClassSetOperand(e))?2!==t&&(i=1):e.raise("Invalid character in character class");if(n!==e.pos)return i;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(n!==e.pos)return i}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(!(t=this.regexp_eatClassSetOperand(e)))return i;2===t&&(i=2)}},Pe.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var i=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var n=e.lastIntValue;return-1!==i&&-1!==n&&i>n&&e.raise("Range out of order in character class"),!0}e.pos=t}return!1},Pe.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?1:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)},Pe.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var i=e.eat(94),n=this.regexp_classContents(e);if(e.eat(93))return i&&2===n&&e.raise("Negated character class may contain strings"),n;e.pos=t}if(e.eat(92)){var s=this.regexp_eatCharacterClassEscape(e);if(s)return s;e.pos=t}return null},Pe.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var i=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return i}else e.raise("Invalid escape");e.pos=t}return null},Pe.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)2===this.regexp_classString(e)&&(t=2);return t},Pe.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return 1===t?1:2},Pe.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return!(!this.regexp_eatCharacterEscape(e)&&!this.regexp_eatClassSetReservedPunctuator(e)&&(e.eat(98)?(e.lastIntValue=8,0):(e.pos=t,1)));var i=e.current();return!(i<0||i===e.lookahead()&&function(e){return 33===e||e>=35&&e<=38||e>=42&&e<=44||46===e||e>=58&&e<=64||94===e||96===e||126===e}(i)||function(e){return 40===e||41===e||45===e||47===e||e>=91&&e<=93||e>=123&&e<=125}(i)||(e.advance(),e.lastIntValue=i,0))},Pe.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return!!function(e){return 33===e||35===e||37===e||38===e||44===e||45===e||e>=58&&e<=62||64===e||96===e||126===e}(t)&&(e.lastIntValue=t,e.advance(),!0)},Pe.regexp_eatClassControlLetter=function(e){var t=e.current();return!(!Ve(t)&&95!==t||(e.lastIntValue=t%32,e.advance(),0))},Pe.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1},Pe.regexp_eatDecimalDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;Ve(i=e.current());)e.lastIntValue=10*e.lastIntValue+(i-48),e.advance();return e.pos!==t},Pe.regexp_eatHexDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;He(i=e.current());)e.lastIntValue=16*e.lastIntValue+Ue(i),e.advance();return e.pos!==t},Pe.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var i=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=64*t+8*i+e.lastIntValue:e.lastIntValue=8*t+i}else e.lastIntValue=t;return!0}return!1},Pe.regexp_eatOctalDigit=function(e){var t=e.current();return ze(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)},Pe.regexp_eatFixedHexDigits=function(e,t){var i=e.pos;e.lastIntValue=0;for(var n=0;n<t;++n){var s=e.current();if(!He(s))return e.pos=i,!1;e.lastIntValue=16*e.lastIntValue+Ue(s),e.advance()}return!0};var We=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new G(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},je=z.prototype;function $e(e){return"function"!=typeof BigInt?null:BigInt(e.replace(/_/g,""))}je.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new We(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},je.getToken=function(){return this.next(),new We(this)},"undefined"!=typeof Symbol&&(je[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===w.eof,value:t}}}}),je.nextToken=function(){var e=this.curContext();return e&&e.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(w.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},je.readToken=function(e){return p(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},je.fullCharCodeAt=function(e){var t=this.input.charCodeAt(e);if(t<=55295||t>=56320)return t;var i=this.input.charCodeAt(e+1);return i<=56319||i>=57344?t:(t<<10)+i-56613888},je.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)},je.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(-1===i&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(var n=void 0,s=t;(n=A(this.input,s,this.pos))>-1;)++this.curLine,s=this.lineStart=n;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,i),t,this.pos,e,this.curPosition())},je.skipLineComment=function(e){for(var t=this.pos,i=this.options.onComment&&this.curPosition(),n=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!E(n);)n=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,i,this.curPosition())},je.skipSpace=function(){e:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:10===this.input.charCodeAt(this.pos+1)&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(!(e>8&&e<14||e>=5760&&M.test(String.fromCharCode(e))))break e;++this.pos}}},je.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var i=this.type;this.type=e,this.value=t,this.updateContext(i)},je.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===e&&46===t?(this.pos+=3,this.finishToken(w.ellipsis)):(++this.pos,this.finishToken(w.dot))},je.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===e?this.finishOp(w.assign,2):this.finishOp(w.slash,1)},je.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),i=1,n=42===e?w.star:w.modulo;return this.options.ecmaVersion>=7&&42===e&&42===t&&(++i,n=w.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp(w.assign,i+1):this.finishOp(n,i)},je.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.options.ecmaVersion>=12&&61===this.input.charCodeAt(this.pos+2)?this.finishOp(w.assign,3):this.finishOp(124===e?w.logicalOR:w.logicalAND,2):61===t?this.finishOp(w.assign,2):this.finishOp(124===e?w.bitwiseOR:w.bitwiseAND,1)},je.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(w.assign,2):this.finishOp(w.bitwiseXOR,1)},je.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?45!==t||this.inModule||62!==this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!S.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(w.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===t?this.finishOp(w.assign,2):this.finishOp(w.plusMin,1)},je.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),i=1;return t===e?(i=62===e&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+i)?this.finishOp(w.assign,i+1):this.finishOp(w.bitShift,i)):33!==t||60!==e||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===t&&(i=2),this.finishOp(w.relational,i)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},je.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return 61===t?this.finishOp(w.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===e&&62===t&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(w.arrow)):this.finishOp(61===e?w.eq:w.prefix,1)},je.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(46===t){var i=this.input.charCodeAt(this.pos+2);if(i<48||i>57)return this.finishOp(w.questionDot,2)}if(63===t)return e>=12&&61===this.input.charCodeAt(this.pos+2)?this.finishOp(w.assign,3):this.finishOp(w.coalesce,2)}return this.finishOp(w.question,1)},je.readToken_numberSign=function(){var e=35;if(this.options.ecmaVersion>=13&&(++this.pos,p(e=this.fullCharCodeAtPos(),!0)||92===e))return this.finishToken(w.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+N(e)+"'")},je.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(w.parenL);case 41:return++this.pos,this.finishToken(w.parenR);case 59:return++this.pos,this.finishToken(w.semi);case 44:return++this.pos,this.finishToken(w.comma);case 91:return++this.pos,this.finishToken(w.bracketL);case 93:return++this.pos,this.finishToken(w.bracketR);case 123:return++this.pos,this.finishToken(w.braceL);case 125:return++this.pos,this.finishToken(w.braceR);case 58:return++this.pos,this.finishToken(w.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(w.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(120===t||88===t)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===t||79===t)return this.readRadixNumber(8);if(98===t||66===t)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(w.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+N(e)+"'")},je.finishOp=function(e,t){var i=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,i)},je.readRegexp=function(){for(var e,t,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var n=this.input.charAt(this.pos);if(S.test(n)&&this.raise(i,"Unterminated regular expression"),e)e=!1;else{if("["===n)t=!0;else if("]"===n&&t)t=!1;else if("/"===n&&!t)break;e="\\"===n}++this.pos}var s=this.input.slice(i,this.pos);++this.pos;var r=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(r);var a=this.regexpState||(this.regexpState=new Le(this));a.reset(i,s,o),this.validateRegExpFlags(a),this.validateRegExpPattern(a);var l=null;try{l=new RegExp(s,o)}catch(e){}return this.finishToken(w.regexp,{pattern:s,flags:o,value:l})},je.readInt=function(e,t,i){for(var n=this.options.ecmaVersion>=12&&void 0===t,s=i&&48===this.input.charCodeAt(this.pos),r=this.pos,o=0,a=0,l=0,c=null==t?1/0:t;l<c;++l,++this.pos){var h=this.input.charCodeAt(this.pos),u=void 0;if(n&&95===h)s&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),95===a&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),0===l&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),a=h;else{if((u=h>=97?h-97+10:h>=65?h-65+10:h>=48&&h<=57?h-48:1/0)>=e)break;a=h,o=o*e+u}}return n&&95===a&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===r||null!=t&&this.pos-r!==t?null:o},je.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var i=this.readInt(e);return null==i&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&110===this.input.charCodeAt(this.pos)?(i=$e(this.input.slice(t,this.pos)),++this.pos):p(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(w.num,i)},je.readNumber=function(e){var t=this.pos;e||null!==this.readInt(10,void 0,!0)||this.raise(t,"Invalid number");var i=this.pos-t>=2&&48===this.input.charCodeAt(t);i&&this.strict&&this.raise(t,"Invalid number");var n=this.input.charCodeAt(this.pos);if(!i&&!e&&this.options.ecmaVersion>=11&&110===n){var s=$e(this.input.slice(t,this.pos));return++this.pos,p(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(w.num,s)}i&&/[89]/.test(this.input.slice(t,this.pos))&&(i=!1),46!==n||i||(++this.pos,this.readInt(10),n=this.input.charCodeAt(this.pos)),69!==n&&101!==n||i||(43!==(n=this.input.charCodeAt(++this.pos))&&45!==n||++this.pos,null===this.readInt(10)&&this.raise(t,"Invalid number")),p(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var r,o=(r=this.input.slice(t,this.pos),i?parseInt(r,8):parseFloat(r.replace(/_/g,"")));return this.finishToken(w.num,o)},je.readCodePoint=function(){var e;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var t=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else e=this.readHexChar(4);return e},je.readString=function(e){for(var t="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var n=this.input.charCodeAt(this.pos);if(n===e)break;92===n?(t+=this.input.slice(i,this.pos),t+=this.readEscapedChar(!1),i=this.pos):8232===n||8233===n?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(E(n)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(i,this.pos++),this.finishToken(w.string,t)};var Ke={};je.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==Ke)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},je.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Ke;this.raise(e,t)},je.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var i=this.input.charCodeAt(this.pos);if(96===i||36===i&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==w.template&&this.type!==w.invalidTemplate?(e+=this.input.slice(t,this.pos),this.finishToken(w.template,e)):36===i?(this.pos+=2,this.finishToken(w.dollarBraceL)):(++this.pos,this.finishToken(w.backQuote));if(92===i)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(E(i)){switch(e+=this.input.slice(t,this.pos),++this.pos,i){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(i)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},je.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if("{"!==this.input[this.pos+1])break;case"`":return this.finishToken(w.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":"\n"===this.input[this.pos+1]&&++this.pos;case"\n":case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1}this.raise(this.start,"Unterminated template")},je.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return N(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var i=this.pos-1;this.invalidStringToken(i,"Invalid escape sequence in template string")}default:if(t>=48&&t<=55){var n=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],s=parseInt(n,8);return s>255&&(n=n.slice(0,-1),s=parseInt(n,8)),this.pos+=n.length-1,t=this.input.charCodeAt(this.pos),"0"===n&&56!==t&&57!==t||!this.strict&&!e||this.invalidStringToken(this.pos-1-n.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(s)}return E(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(t)}},je.readHexChar=function(e){var t=this.pos,i=this.readInt(16,e);return null===i&&this.invalidStringToken(t,"Bad character escape sequence"),i},je.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,i=this.pos,n=this.options.ecmaVersion>=6;this.pos<this.input.length;){var s=this.fullCharCodeAtPos();if(g(s,n))this.pos+=s<=65535?1:2;else{if(92!==s)break;this.containsEsc=!0,e+=this.input.slice(i,this.pos);var r=this.pos;117!==this.input.charCodeAt(++this.pos)&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var o=this.readCodePoint();(t?p:g)(o,n)||this.invalidStringToken(r,"Invalid Unicode escape"),e+=N(o),i=this.pos}t=!1}return e+this.input.slice(i,this.pos)},je.readWord=function(){var e=this.readWord1(),t=w.name;return this.keywords.test(e)&&(t=b[e]),this.finishToken(t,e)},z.acorn={Parser:z,version:"8.16.0",defaultOptions:V,Position:F,SourceLocation:G,getLineInfo:B,Node:pe,TokenType:f,tokTypes:w,keywordTypes:b,TokContext:ne,tokContexts:se,isIdentifierChar:g,isIdentifierStart:p,Token:We,isNewLine:E,lineBreak:S,lineBreakG:x,nonASCIIwhitespace:M}},45401(e,t,i){"use strict";i.d(t,{Ku:()=>Ty,LW:()=>Ew,Mo:()=>bw,On:()=>Dy,a9:()=>Tw,n1:()=>Dw,uB:()=>iS,ui:()=>mw,xv:()=>Ki});var n=i(26203),s=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=(e,t)=>{for(var i in t)s(e,i,{get:t[i],enumerable:!0})},a=(e,t,i,n)=>{for(var o,a=n>1?void 0:n?r(t,i):t,l=e.length-1;l>=0;l--)(o=e[l])&&(a=(n?o(t,i,a):o(a))||a);return n&&a&&s(t,i,a),a},l=class{constructor(){this.destroyFns=[]}destroy(){for(const e of this.destroyFns)e()}},c=new class{constructor(){this.modules=[],this.dependencies=new Map,this.modulesByOptionKey=new Map}register(...e){for(const t of e){this.registerDependencies(t);const e=this.modules.find(e=>!(t.type!==e.type||"optionsKey"in t&&"optionsKey"in e&&t.optionsKey!==e.optionsKey||t.identifier!==e.identifier));if(e){if("enterprise"===t.packageType&&"community"===e.packageType){const i=this.modules.indexOf(e);this.modules.splice(i,1,t),"optionsKey"in t&&this.modulesByOptionKey.set(t.optionsKey,t)}}else this.modules.push(t),"optionsKey"in t&&this.modulesByOptionKey.set(t.optionsKey,t)}}hasEnterpriseModules(){return this.modules.some(e=>"enterprise"===e.packageType)}*byType(...e){const t=new Set,i=this.modules.filter(t=>e.includes(t.type)),n=e=>{const t=this.dependencies.get(e);return t?.flatMap(n).concat(t)??[]},s=[];for(const r of i){const i="optionsKey"in r?r.optionsKey:r.contextKey;if(!t.has(i)){for(const r of n(i)){if(t.has(r))continue;const i=this.modulesByOptionKey.get(r);i?e.includes(i.type)&&(yield i,t.add(r)):s.push(r)}yield r,t.add(i)}}if(s.length>0)throw new Error(`Could not resolve module dependencies: ${s}`)}registerDependencies(e){if(null==e.dependencies||0===e.dependencies.length)return;const t="optionsKey"in e?e.optionsKey:e.contextKey;this.dependencies.set(t,e.dependencies)}},h={containsPoint:function(e,t,i){return t>=e.x&&t<=e.x+e.width&&i>=e.y&&i<=e.y+e.height},equals:function(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height},isEmpty:function(e){return null==e||0===e.height||0===e.width||isNaN(e.height)||isNaN(e.width)},normalize:function(e){let{x:t,y:i,width:n,height:s}=e;return(null==n||n>0)&&(null==s||s>0)?e:(null!=t&&null!=n&&n<0&&(n=-n,t-=n),null!=i&&null!=s&&s<0&&(s=-s,i-=s),{x:t,y:i,width:n,height:s})}},u=Symbol("interpolate"),d=e=>null!=e[u];function p(e,t,i,n=1/0){const s={nearest:void 0,distanceSquared:n};for(const n of i){const i=n.distanceSquared(e,t);if(0===i)return{nearest:n,distanceSquared:0};i<s.distanceSquared&&(s.nearest=n,s.distanceSquared=i)}return s}function g(e,t,i,n=1/0){const{x:s=e,y:r=t}=i.transformPoint?.(e,t)??{},o={nearest:void 0,distanceSquared:n};for(const e of i.children){const{nearest:t,distanceSquared:i}=e.nearestSquared(s,r,o.distanceSquared);if(0===i)return{nearest:t,distanceSquared:i};i<o.distanceSquared&&(o.nearest=t,o.distanceSquared=i)}return o}var f=class e{constructor(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n}static fromDOMRect({x:t,y:i,width:n,height:s}){return new e(t,i,n,s)}static merge(t){let i=1/0,n=1/0,s=-1/0,r=-1/0;for(const e of t)e.x<i&&(i=e.x),e.y<n&&(n=e.y),e.x+e.width>s&&(s=e.x+e.width),e.y+e.height>r&&(r=e.y+e.height);return new e(i,n,s-i,r-n)}static nearestBox(e,t,i){return p(e,t,i)}toDOMRect(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.y,left:this.x,right:this.x+this.width,bottom:this.y+this.height,toJSON:()=>({})}}clone(){const{x:t,y:i,width:n,height:s}=this;return new e(t,i,n,s)}equals(e){return h.equals(this,e)}containsPoint(e,t){return h.containsPoint(this,e,t)}intersection(t){if(!this.collidesBBox(t))return;const i=(0,n.qE)(t.x,this.x,t.x+t.width),s=(0,n.qE)(t.y,this.y,t.y+t.height),r=(0,n.qE)(t.x,this.x+this.width,t.x+t.width),o=(0,n.qE)(t.y,this.y+this.height,t.y+t.height);return new e(i,s,r-i,o-s)}collidesBBox(e){return this.x<e.x+e.width&&this.x+this.width>e.x&&this.y<e.y+e.height&&this.y+this.height>e.y}computeCenter(){return{x:this.x+this.width/2,y:this.y+this.height/2}}isFinite(){return Number.isFinite(this.x)&&Number.isFinite(this.y)&&Number.isFinite(this.width)&&Number.isFinite(this.height)}distanceSquared(e,t){if(this.containsPoint(e,t))return 0;const i=e-(0,n.qE)(this.x,e,this.x+this.width),s=t-(0,n.qE)(this.y,t,this.y+this.height);return i*i+s*s}shrink(e,t){if("number"==typeof e)this.applyMargin(e,t);else for(const t of Object.keys(e)){const i=e[t];"number"==typeof i&&this.applyMargin(i,t)}return this.width<0&&(this.width=0),this.height<0&&(this.height=0),this}grow(e,t){if("number"==typeof e)this.applyMargin(-e,t);else for(const t of Object.keys(e)){const i=e[t];"number"==typeof i&&this.applyMargin(-i,t)}return this}applyMargin(e,t){switch(t){case"top":this.y+=e;case"bottom":this.height-=e;break;case"left":this.x+=e;case"right":this.width-=e;break;case"vertical":this.y+=e,this.height-=2*e;break;case"horizontal":this.x+=e,this.width-=2*e;break;case void 0:this.x+=e,this.y+=e,this.width-=2*e,this.height-=2*e}}translate(e,t){return this.x+=e,this.y+=t,this}[u](t,i){return new e(this.x*(1-i)+t.x*i,this.y*(1-i)+t.y*i,this.width*(1-i)+t.width*i,this.height*(1-i)+t.height*i)}};f.zero=Object.freeze(new f(0,0,0,0)),f.NaN=Object.freeze(new f(NaN,NaN,NaN,NaN));var m=f,y=Date.now(),v={create:(...e)=>Object.assign((...t)=>{v.check(...e)&&("function"==typeof t[0]&&(t=(0,n.$r)(t[0]())),(()=>{const e=Date.now()-y;if(e>2e3){const t=(Math.floor(e/100)/10).toFixed(1);n.Vy.log(`**** ${t}s since last log message ****`)}y=Date.now()})(),n.Vy.log(...t))},{check:()=>v.check(...e),group:(t,i)=>v.check(...e)?n.Vy.logGroup(t,i):i()}),check:(...e)=>(0===e.length&&e.push(!0),(0,n.$r)((0,n.zk)("agChartsDebug")).some(t=>e.includes(t))),inDevelopmentMode(e){if(v.check("dev"))return e()}};function b({context:e,pixelRatio:t,width:i,height:n}){e.save(),e.resetTransform(),e.clearRect(0,0,Math.ceil(i*t),Math.ceil(n*t)),e.restore()}function C(e){if(v.check("canvas")){const t=e.save.bind(e),i=e.restore.bind(e);let n=0;Object.assign(e,{save(){t(),n++},restore(){if(0===n)throw new Error("AG Charts - Unable to restore() past depth 0");i(),n--},verifyDepthZero(){if(0!==n)throw new Error(`AG Charts - Save/restore depth is non-zero: ${n}`)}})}}function w(e,t,i){return[Math.floor(e*i),Math.floor(t*i)]}var S=class{constructor(e){const{width:t,height:i,pixelRatio:n,willReadFrequently:s=!1}=e;this.width=t,this.height=i,this.pixelRatio=n;const[r,o]=w(t,i,n);this.canvas=new OffscreenCanvas(r,o),this.context=this.canvas.getContext("2d",{willReadFrequently:s}),this.context.setTransform(n,0,0,n,0,0),C(this.context)}drawImage(e,t=0,i=0){return e.drawImage(this.canvas,t,i)}transferToImageBitmap(){return this.canvas.transferToImageBitmap()}resize(e,t,i){if(!(e>0&&t>0))return;const{canvas:n,context:s}=this;if(e!==this.width||t!==this.height||i!==this.pixelRatio){const[s,r]=w(e,t,i);n.width=s,n.height=r}s.setTransform(i,0,0,i,0,0),this.width=e,this.height=t,this.pixelRatio=i}clear(){b(this)}destroy(){this.canvas.width=0,this.canvas.height=0,this.context.clearRect(0,0,0,0),this.canvas=null,this.context=null,Object.freeze(this)}},x=Symbol("BREAK"),E="__decorator_config",A="__decorator_accessors";function M(e,t){if(null==Object.getOwnPropertyDescriptor(e,E)&&Object.defineProperty(e,E,{value:{}}),null==Object.getOwnPropertyDescriptor(e,A)){const t=Object.getPrototypeOf(e)?.[A],i=t?.slice()??[];Object.defineProperty(e,A,{value:i})}const i=e[E],n=t.toString();if(null!=i[n])return i[n];i[n]={setters:[],getters:[],observers:[]};const s=Object.getOwnPropertyDescriptor(e,t);let r=s?.get,o=s?.set;if(null==r||null==o){const i=e[A];let n=i.indexOf(t);-1===n&&(n=i.push(t)-1),r??(r=function(){let e=this.__accessors;return null==e&&(e=i.slice().fill(void 0),Object.defineProperty(this,"__accessors",{value:e})),e[n]}),o??(o=function(e){let t=this.__accessors;null==t&&(t=i.slice().fill(void 0),Object.defineProperty(this,"__accessors",{value:t})),t[n]=e})}return Object.defineProperty(e,t,{set:function(e){const{setters:s,observers:a}=i[n];let l;s.some(e=>e.length>2)&&(l=r.call(this));for(const i of s)if((e=i(this,t,e,l))===x)return;o.call(this,e);for(const t of a)t(this,e,l)},get:function(){let e=r.call(this);for(const s of i[n].getters)if(e=s(this,t,e),e===x)return;return e},enumerable:!0,configurable:!1}),i[n]}function T(e,t,i){return(n,s)=>{const r=M(n,s);r.setters.push(e),t&&r.getters.unshift(t),i&&Object.assign(r,i)}}function D(e){return(t,i)=>{M(t,i).observers.push(e)}}function I(e){return void 0!==e&&E in e}function R(e){const t=new Set;for(;I(e);)t.add(e?.[E]),e=Object.getPrototypeOf(e);return Array.from(t).flatMap(e=>Object.keys(e))}function k(e){return R(e).reduce((t,i)=>(t[i]=e[i]??null,t),{})}function P(e,t){return Array.isArray(e)?!!Array.isArray(t)&&e.length===t.length&&e.every((e,i)=>P(e,t[i])):(0,n.Qd)(e)?!!(0,n.Qd)(t)&&_(e,t,P):e===t}function _(e,t,i){if(Object.is(e,t))return!0;for(const i of Object.keys(t))if(!(i in e))return!1;for(const n of Object.keys(e)){if(!(n in t))return!1;if(!i(e[n],t[n]))return!1}return!0}function L(...e){const t={};for(const i of e){if(!(0,n.Gv)(i))continue;const e=I(i)?R(i):Object.keys(i);for(const s of e)(0,n.Qd)(t[s])&&(0,n.Qd)(i[s])?t[s]=L(t[s],i[s]):t[s]??(t[s]=i[s])}return t}function N(...e){const t={};for(const i of e){if(!(0,n.Gv)(i))continue;const e=I(i)?R(i):Object.keys(i);for(const s of e)(0,n.Qd)(t[s])&&(0,n.Qd)(i[s])?t[s]=N(t[s],i[s]):s in t||(t[s]??(t[s]=i[s]))}return t}function O(e,...t){return t&&(0,n.cy)(e)?e.map(e=>L(e,...t)):e}function F(e,t){const i={};for(const[s,r]of(0,n.jO)(e))i[s]=t(r,s,e);return i}function G(e,t){const i={...e};for(const e of t)delete i[e];return i}function B(e,t){return((0,n.cy)(t)?t:t.split(".")).reduce((e,t)=>e[t],e)}var V=new Set(["__proto__","constructor","prototype"]);function H(e,t,i){const s=(0,n.cy)(t)?t.slice():t.split("."),r=s.pop();if(s.some(e=>V.has(e)))return;const o=s.reduce((e,t)=>e[t],e);return o[r]=i,o[r]}function U(e,t,i){if(void 0===i)return t;for(const n of e){const e=i[n];void 0!==e&&(t[n]=e)}return t}function z(e){return null!=e&&"object"==typeof e&&(0,n.Qd)(e)?(Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const i=e[t];null===i||"object"!=typeof i&&"function"!=typeof i||Object.isFrozen(i)||z(i)}),e):e}function W(e,t){return(0,n.Qd)(e)&&t in e}function j(e,t){return W(e,t)&&"string"==typeof e[t]}var $=(e,t)=>e===t;function K(e){return function(t,i){const n=`__${i}`;t[i]||function(e,t,i,n){const{changeCb:s,convertor:r,checkDirtyOnAssignment:o=!1}=n??{},a={changeCb:s,checkDirtyOnAssignment:o,convertor:r},l=function(e,t,i){const{checkDirtyOnAssignment:n}=i;return n?function(i){const n=t.call(this,i);return!0===i?._dirty&&this.markDirty(e),n}:t}(i,function(e,t){const{changeCb:i}=t;return i?function(t){const n=e.call(this,t);return n!==X&&i.call(this,this),n}:e}(function(e,t){const{convertor:i}=t;return i?function(t){e.call(this,i(t))}:e}(function(e,t){const{equals:i=$}=t;return function(t){const n=this[e];return i(t,n)?X:(this[e]=t,this.onChangeDetection(e),t)}}(i,a),a),a),a);Object.defineProperty(e,t,{set:l,get:function(){return this[i]},enumerable:!0,configurable:!0})}(t,i,n,e)}}function Y(e){return K(e)}function q(e){return(e??{}).equals=n.r1,K(e)}var X=Symbol("no-change"),Z=(e=>(e[e.All=0]="All",e[e.None=1]="None",e))(Z||{}),Q=class e{constructor(t){this.serialNumber=e._nextSerialNumber++,this.childNodeCounts={groups:0,nonGroups:0,thisComplexity:0,complexity:0},this.id=(0,n.sX)(this),this.pointerEvents=0,this.scene=void 0,this._dirty=!0,this.dirtyZIndex=!1,this.isContainerNode=!1,this.visible=!0,this.zIndex=0,this.name=t?.name,this.tag=t?.tag??NaN,this.zIndex=t?.zIndex??0,(t?.debugDirty??e._debugEnabled)&&(this._debugDirtyProperties=new Map([["__first__",[]]]))}static toSVG(e,t,i){const s=e?.toSVG();if(null==s||!s.elements.length&&!s.defs?.length)return;const r=(0,n.FJ)("svg");if(r.setAttribute("width",String(t)),r.setAttribute("height",String(i)),r.setAttribute("viewBox",`0 0 ${t} ${i}`),s.defs?.length){const e=(0,n.FJ)("defs");e.append(...s.defs),r.append(e)}return r.append(...s.elements),r.outerHTML}static*extractBBoxes(e,t){for(const i of e)if(!t||i.visible&&!i.transitionOut){const e=i.getBBox();e&&(yield e)}}get datum(){return this._datum}set datum(e){this._datum!==e&&(this._previousDatum=this._datum,this._datum=e)}get previousDatum(){return this._previousDatum}get layerManager(){return this.scene?.layersManager}get imageLoader(){return this.scene?.imageLoader}get dirty(){return this._dirty}closestDatum(){for(const{datum:e}of this.traverseUp(!0))if(null!=e)return e}preRender(e,t=1){this.childNodeCounts.groups=0,this.childNodeCounts.nonGroups=1,this.childNodeCounts.complexity=t,this.childNodeCounts.thisComplexity=t;for(const t of this.children()){const i=t.preRender(e);this.childNodeCounts.groups+=i.groups,this.childNodeCounts.nonGroups+=i.nonGroups,this.childNodeCounts.complexity+=i.complexity}return this.childNodeCounts}render(e){const{stats:t}=e;if(this._dirty=!1,this.debugDirtyProperties(),e.debugNodeSearch){const t=this.name??this.id;e.debugNodeSearch.some(e=>"string"==typeof e?e===t:e.test(t))&&(e.debugNodes[this.name??this.id]=this)}t&&(t.nodesRendered++,t.opsPerformed+=this.childNodeCounts.thisComplexity)}setScene(e){this.scene=e,this._debug=e?.layersManager?.debug;for(const t of this.children())t.setScene(e)}sortChildren(e){if(this.dirtyZIndex=!1,!this.childNodes)return;const t=[...this.childNodes].sort(e);this.childNodes.clear();for(const e of t)this.childNodes.add(e)}*traverseUp(e){let t=this;for(e&&(yield t);t=t.parentNode;)yield t}*children(){if(this.childNodes)for(const e of this.childNodes)yield e}*descendants(){for(const e of this.children())yield e,yield*e.descendants()}isLeaf(){return!this.childNodes?.size}isRoot(){return!this.parentNode}append(e){this.childNodes??(this.childNodes=new Set);for(const t of(0,n.Rp)(e))t.parentNode?.removeChild(t),this.childNodes.add(t),t.parentNode=this,t.setScene(this.scene);this.invalidateCachedBBox(),this.dirtyZIndex=!0,this.markDirty()}appendChild(e){return this.append(e),e}removeChild(e){if(!this.childNodes?.delete(e))throw new Error(`AG Charts - internal error, unknown child node ${e.name??e.id} in $${this.name??this.id}`);delete e.parentNode,e.setScene(),this.invalidateCachedBBox(),this.dirtyZIndex=!0,this.markDirty()}remove(){this.parentNode?.removeChild(this)}clear(){for(const e of this.children())delete e.parentNode,e.setScene();this.childNodes?.clear(),this.invalidateCachedBBox()}destroy(){this.parentNode?.removeChild(this)}setProperties(e,t){if(t)for(const i of t)this[i]=e[i];else Object.assign(this,e);return this}containsPoint(e,t){return!1}pickNode(e,t){if(this.visible&&1!==this.pointerEvents&&this.containsPoint(e,t))if(null!=this.childNodes&&0!==this.childNodes.size){const i=[...this.children()];for(let n=i.length-1;n>=0;n--){const s=i[n].pickNode(e,t);if(s)return s}}else if(!this.isContainerNode)return this}pickNodes(e,t,i=[]){if(!this.visible||1===this.pointerEvents||!this.containsPoint(e,t))return i;this.isContainerNode||i.push(this);for(const n of this.children())n.pickNodes(e,t,i);return i}invalidateCachedBBox(){null!=this.cachedBBox&&(this.cachedBBox=void 0,this.parentNode?.invalidateCachedBBox())}getBBox(){return null==this.cachedBBox&&(this.cachedBBox=Object.freeze(this.computeBBox())),this.cachedBBox}computeBBox(){}onChangeDetection(e){this.markDirty(e)}markDirty(e){const{_dirty:t}=this;null!=e&&this._debugDirtyProperties&&this.markDebugProperties(e),null==this.cachedBBox&&t||(this.invalidateCachedBBox(),this._dirty=!0,this.parentNode&&this.parentNode.markDirty())}markClean(){if(this._dirty){this._dirty=!1,this.debugDirtyProperties();for(const e of this.children())e.markClean()}}markDebugProperties(e){const t=this._debugDirtyProperties?.get(e)??[],i=(new Error).stack?.split("\n").filter(e=>!("Error"===e||e.includes(".markDebugProperties")||e.includes(".markDirty")||e.includes("Object.assign ")||e.includes(`${this.constructor.name}.`)))??"unknown";t.push(i[0].replace(" at ","").trim()),this._debugDirtyProperties?.set(e,t)}debugDirtyProperties(){null!=this._debugDirtyProperties&&(this._debugDirtyProperties.has("__first__")||this._debugDirtyProperties.forEach((e,t)=>{e.length>1&&(console.groupCollapsed(`Property changed multiple times before render: ${this.constructor.name}.${t} (${e.length}x)`),e.forEach(e=>console.log(e)),console.groupEnd())}),this._debugDirtyProperties.clear())}onZIndexChange(){const{parentNode:e}=this;e&&(e.dirtyZIndex=!0)}toSVG(){}};Q._nextSerialNumber=0,Q._debugEnabled=!1,a([K()],Q.prototype,"visible",2),a([Y({equals:P,changeCb:e=>e.onZIndexChange()})],Q.prototype,"zIndex",2);var J=Q,ee=2*Math.PI,te=Math.PI/2;function ie(e){return e%=ee,(e+=ee)%ee}function ne(e){return e%=ee,(e+=ee)!==ee&&(e%=ee),e}function se(e){return(e%=ee)<-Math.PI?e+=ee:e>=Math.PI&&(e-=ee),e}function re(e,t,i){const n=ie(e),s=ie(t),r=ie(i);return s<r?s<=n&&n<=r:!(s>r)||s<=n||n<=r}function oe(e){return e/180*Math.PI}function ae(e){return e/Math.PI*180}function le(e,t){return e=ie(e),(t=ie(t))-e+(e>t?ee:0)}function ce(e){const t=ie(e);return t<=te?t/te:t<=Math.PI?(Math.PI-t)/te:t<=1.5*Math.PI?(t-Math.PI)/te:(ee-t)/te}function he(e,t,i){const n=ce(i);return e*n+t*Math.abs(1-n)}function ue(e){return e?ie(oe(e)):0}var de=(e,t,i)=>e*(1-i)+t*i,pe=e=>{const t=e<0?-1:1,i=Math.abs(e);return i<=.04045?e/12.92:t*((i+.055)/1.055)**2.4},ge=e=>{const t=e<0?-1:1,i=Math.abs(e);return i>.0031308?t*(1.055*i**(1/2.4)-.055):12.92*e},fe=class e{constructor(e,t,i,s=1){this.r=(0,n.qE)(0,e||0,1),this.g=(0,n.qE)(0,t||0,1),this.b=(0,n.qE)(0,i||0,1),this.a=(0,n.qE)(0,s||0,1)}static validColorString(t){return t.indexOf("#")>=0?!!e.parseHex(t):t.indexOf("rgb")>=0?!!e.stringToRgba(t):e.nameToHex.has(t.toLowerCase())}static fromString(t){if(t.indexOf("#")>=0)return e.fromHexString(t);const i=e.nameToHex.get(t.toLowerCase());if(i)return e.fromHexString(i);if(t.indexOf("rgb")>=0)return e.fromRgbaString(t);throw new Error(`Invalid color string: '${t}'`)}static parseHex(e){let t;switch((e=e.replace(/ /g,"").slice(1)).length){case 6:case 8:t=[];for(let i=0;i<e.length;i+=2)t.push(parseInt(`${e[i]}${e[i+1]}`,16));break;case 3:case 4:t=e.split("").map(e=>parseInt(e,16)).map(e=>e+16*e)}if(t?.length>=3&&t.every(e=>e>=0))return 3===t.length&&t.push(255),t}static fromHexString(t){const i=e.parseHex(t);if(i){const[t,n,s,r]=i;return new e(t/255,n/255,s/255,r/255)}throw new Error(`Malformed hexadecimal color string: '${t}'`)}static stringToRgba(e){let t=-1,i=-1;for(let n=0;n<e.length;n++){const s=e[n];if(-1===t&&"("===s)t=n;else if(")"===s){i=n;break}}if(-1===t||-1===i)return;const s=e.substring(t+1,i).split(","),r=[];for(let e=0;e<s.length;e++){const t=s[e];let i=parseFloat(t);if(!Number.isFinite(i))return;t.indexOf("%")>=0?(i=(0,n.qE)(0,i,100),i/=100):3===e?i=(0,n.qE)(0,i,1):(i=(0,n.qE)(0,i,255),i/=255),r.push(i)}return r}static fromRgbaString(t){const i=e.stringToRgba(t);if(i){if(3===i.length)return new e(i[0],i[1],i[2]);if(4===i.length)return new e(i[0],i[1],i[2],i[3])}throw new Error(`Malformed rgb/rgba color string: '${t}'`)}static fromArray(t){if(4===t.length)return new e(t[0],t[1],t[2],t[3]);if(3===t.length)return new e(t[0],t[1],t[2]);throw new Error("The given array should contain 3 or 4 color components (numbers).")}static fromHSB(t,i,n,s=1){const r=e.HSBtoRGB(t,i,n);return new e(r[0],r[1],r[2],s)}static fromHSL(t,i,n,s=1){const r=e.HSLtoRGB(t,i,n);return new e(r[0],r[1],r[2],s)}static fromOKLCH(t,i,n,s=1){const r=e.OKLCHtoRGB(t,i,n);return new e(r[0],r[1],r[2],s)}static padHex(e){return 1===e.length?"0"+e:e}toHexString(){let t="#"+e.padHex(Math.round(255*this.r).toString(16))+e.padHex(Math.round(255*this.g).toString(16))+e.padHex(Math.round(255*this.b).toString(16));return this.a<1&&(t+=e.padHex(Math.round(255*this.a).toString(16))),t}toRgbaString(e=3){const t=[Math.round(255*this.r),Math.round(255*this.g),Math.round(255*this.b)],i=Math.pow(10,e);return 1!==this.a?(t.push(Math.round(this.a*i)/i),`rgba(${t.join(", ")})`):`rgb(${t.join(", ")})`}toString(){return 1===this.a?this.toHexString():this.toRgbaString()}toHSB(){return e.RGBtoHSB(this.r,this.g,this.b)}static RGBtoOKLCH(e,t,i){const n=pe(e),s=pe(t),r=pe(i),o=Math.cbrt(.4122214708*n+.5363325363*s+.0514459929*r),a=Math.cbrt(.2119034982*n+.6806995451*s+.1073969566*r),l=Math.cbrt(.0883024619*n+.2817188376*s+.6299787005*r),c=.2104542553*o+.793617785*a-.0040720468*l,h=1.9779984951*o-2.428592205*a+.4505937099*l,u=.0259040371*o+.7827717662*a-.808675766*l,d=180*Math.atan2(u,h)/Math.PI;return[c,Math.hypot(h,u),d>=0?d:d+360]}static OKLCHtoRGB(e,t,i){const n=e,s=t*Math.cos(i*Math.PI/180),r=t*Math.sin(i*Math.PI/180),o=(n+.3963377774*s+.2158037573*r)**3,a=(n-.1055613458*s-.0638541728*r)**3,l=(n-.0894841775*s-1.291485548*r)**3,c=-1.2684380046*o+2.6097574011*a-.3413193965*l,h=-.0041960863*o-.7034186147*a+1.707614701*l;return[ge(4.0767416621*o-3.3077115913*a+.2309699292*l),ge(c),ge(h)]}static RGBtoHSL(e,t,i){const n=Math.min(e,t,i),s=Math.max(e,t,i),r=(s+n)/2;let o,a;if(s===n)o=0,a=0;else{const l=s-n;a=r>.5?l/(2-s-n):l/(s+n),o=s===e?(t-i)/l+(t<i?6:0):s===t?(i-e)/l+2:(e-t)/l+4,o*=60}return[o,a,r]}static HSLtoRGB(e,t,i){if(0===t)return[i,i,i];const n=i<.5?i*(1+t):i+t-i*t,s=2*i-n;function r(e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?s+6*(n-s)*e:e<.5?n:e<2/3?s+(n-s)*(2/3-e)*6:s}return[r((e=(e%360+360)%360)/360+1/3),r(e/360),r(e/360-1/3)]}static RGBtoHSB(e,t,i){const n=Math.min(e,t,i),s=Math.max(e,t,i);let r=0;if(n!==s){const o=s-n,a=(s-e)/o,l=(s-t)/o,c=(s-i)/o;r=e===s?c-l:t===s?2+a-c:4+l-a,r/=6,r<0&&(r+=1)}return[360*r,0===s?0:(s-n)/s,s]}static HSBtoRGB(e,t,i){e=(e%360+360)%360/360;let n=0,s=0,r=0;if(0===t)n=s=r=i;else{const o=6*(e-Math.floor(e)),a=o-Math.floor(o),l=i*(1-t),c=i*(1-t*a),h=i*(1-t*(1-a));switch(0|o){case 0:n=i,s=h,r=l;break;case 1:n=c,s=i,r=l;break;case 2:n=l,s=i,r=h;break;case 3:n=l,s=c,r=i;break;case 4:n=h,s=l,r=i;break;case 5:n=i,s=l,r=c}}return[n,s,r]}static mix(t,i,n){return new e(de(t.r,i.r,n),de(t.g,i.g,n),de(t.b,i.b,n),de(t.a,i.a,n))}static lighten(t,i){const s=e.RGBtoOKLCH(t.r,t.g,t.b);return e.fromOKLCH((0,n.qE)(0,s[0]+i,1),s[1],s[2])}static darken(t,i){const s=e.RGBtoOKLCH(t.r,t.g,t.b);return e.fromOKLCH((0,n.qE)(0,s[0]-i,1),s[1],s[2])}static interpolate(t,i){const n=1/(t.length-1),s=t.map(t=>e.RGBtoOKLCH(t.r,t.g,t.b));return Array.from({length:i},(r,o)=>{const a=o/(i-1),l=t.length<=2?0:Math.min(Math.floor(a*(t.length-1)),t.length-2),c=(a-l*n)/n,h=s[l],u=s[l+1];return e.fromOKLCH(de(h[0],u[0],c),de(h[1],u[1],c),de(h[2],u[2],c))})}};fe.nameToHex=new Map([["aliceblue","#F0F8FF"],["antiquewhite","#FAEBD7"],["aqua","#00FFFF"],["aquamarine","#7FFFD4"],["azure","#F0FFFF"],["beige","#F5F5DC"],["bisque","#FFE4C4"],["black","#000000"],["blanchedalmond","#FFEBCD"],["blue","#0000FF"],["blueviolet","#8A2BE2"],["brown","#A52A2A"],["burlywood","#DEB887"],["cadetblue","#5F9EA0"],["chartreuse","#7FFF00"],["chocolate","#D2691E"],["coral","#FF7F50"],["cornflowerblue","#6495ED"],["cornsilk","#FFF8DC"],["crimson","#DC143C"],["cyan","#00FFFF"],["darkblue","#00008B"],["darkcyan","#008B8B"],["darkgoldenrod","#B8860B"],["darkgray","#A9A9A9"],["darkgreen","#006400"],["darkgrey","#A9A9A9"],["darkkhaki","#BDB76B"],["darkmagenta","#8B008B"],["darkolivegreen","#556B2F"],["darkorange","#FF8C00"],["darkorchid","#9932CC"],["darkred","#8B0000"],["darksalmon","#E9967A"],["darkseagreen","#8FBC8F"],["darkslateblue","#483D8B"],["darkslategray","#2F4F4F"],["darkslategrey","#2F4F4F"],["darkturquoise","#00CED1"],["darkviolet","#9400D3"],["deeppink","#FF1493"],["deepskyblue","#00BFFF"],["dimgray","#696969"],["dimgrey","#696969"],["dodgerblue","#1E90FF"],["firebrick","#B22222"],["floralwhite","#FFFAF0"],["forestgreen","#228B22"],["fuchsia","#FF00FF"],["gainsboro","#DCDCDC"],["ghostwhite","#F8F8FF"],["gold","#FFD700"],["goldenrod","#DAA520"],["gray","#808080"],["green","#008000"],["greenyellow","#ADFF2F"],["grey","#808080"],["honeydew","#F0FFF0"],["hotpink","#FF69B4"],["indianred","#CD5C5C"],["indigo","#4B0082"],["ivory","#FFFFF0"],["khaki","#F0E68C"],["lavender","#E6E6FA"],["lavenderblush","#FFF0F5"],["lawngreen","#7CFC00"],["lemonchiffon","#FFFACD"],["lightblue","#ADD8E6"],["lightcoral","#F08080"],["lightcyan","#E0FFFF"],["lightgoldenrodyellow","#FAFAD2"],["lightgray","#D3D3D3"],["lightgreen","#90EE90"],["lightgrey","#D3D3D3"],["lightpink","#FFB6C1"],["lightsalmon","#FFA07A"],["lightseagreen","#20B2AA"],["lightskyblue","#87CEFA"],["lightslategray","#778899"],["lightslategrey","#778899"],["lightsteelblue","#B0C4DE"],["lightyellow","#FFFFE0"],["lime","#00FF00"],["limegreen","#32CD32"],["linen","#FAF0E6"],["magenta","#FF00FF"],["maroon","#800000"],["mediumaquamarine","#66CDAA"],["mediumblue","#0000CD"],["mediumorchid","#BA55D3"],["mediumpurple","#9370DB"],["mediumseagreen","#3CB371"],["mediumslateblue","#7B68EE"],["mediumspringgreen","#00FA9A"],["mediumturquoise","#48D1CC"],["mediumvioletred","#C71585"],["midnightblue","#191970"],["mintcream","#F5FFFA"],["mistyrose","#FFE4E1"],["moccasin","#FFE4B5"],["navajowhite","#FFDEAD"],["navy","#000080"],["oldlace","#FDF5E6"],["olive","#808000"],["olivedrab","#6B8E23"],["orange","#FFA500"],["orangered","#FF4500"],["orchid","#DA70D6"],["palegoldenrod","#EEE8AA"],["palegreen","#98FB98"],["paleturquoise","#AFEEEE"],["palevioletred","#DB7093"],["papayawhip","#FFEFD5"],["peachpuff","#FFDAB9"],["peru","#CD853F"],["pink","#FFC0CB"],["plum","#DDA0DD"],["powderblue","#B0E0E6"],["purple","#800080"],["rebeccapurple","#663399"],["red","#FF0000"],["rosybrown","#BC8F8F"],["royalblue","#4169E1"],["saddlebrown","#8B4513"],["salmon","#FA8072"],["sandybrown","#F4A460"],["seagreen","#2E8B57"],["seashell","#FFF5EE"],["sienna","#A0522D"],["silver","#C0C0C0"],["skyblue","#87CEEB"],["slateblue","#6A5ACD"],["slategray","#708090"],["slategrey","#708090"],["snow","#FFFAFA"],["springgreen","#00FF7F"],["steelblue","#4682B4"],["tan","#D2B48C"],["teal","#008080"],["thistle","#D8BFD8"],["tomato","#FF6347"],["transparent","#00000000"],["turquoise","#40E0D0"],["violet","#EE82EE"],["wheat","#F5DEB3"],["white","#FFFFFF"],["whitesmoke","#F5F5F5"],["yellow","#FFFF00"],["yellowgreen","#9ACD32"]]);var me=fe,ye=class{ticks(e,t,i){}niceDomain(e,t=this.domain){return t}tickFormatter(e){}datumFormatter(e){}get bandwidth(){}get step(){}get inset(){}},ve=(e,t)=>{const i=Symbol(String(t));e[i]=void 0,Object.defineProperty(e,t,{get(){return this[i]},set(e){this[i]!==e&&(this[i]=e,this.invalid=!0)},enumerable:!0,configurable:!1})},be=e=>{const t=me.fromString(e),[i,n,s]=me.RGBtoOKLCH(t.r,t.g,t.b);return{l:i,c:n,h:s,a:t.a}},Ce=1e-6,we=e=>e.c<Ce||e.l<Ce||e.l>1-Ce,Se=class extends ye{constructor(){super(...arguments),this.type="color",this.invalid=!0,this.domain=[0,1],this.range=["red","blue"],this.parsedRange=this.range.map(be)}update(){const{domain:e,range:t}=this;e.length<2&&(n.Vy.warnOnce("`colorDomain` should have at least 2 values."),0===e.length?e.push(0,1):1===e.length&&e.push(e[0]+1));for(let t=1;t<e.length;t++)if(e[t-1]>=e[t]){n.Vy.warnOnce("`colorDomain` values should be supplied in ascending order."),e.sort((e,t)=>e-t);break}if(t.length<e.length)for(let i=t.length;i<e.length;i++)t.push(t.length>0?t[0]:"black");this.parsedRange=this.range.map(be)}normalizeDomains(...e){return{domain:e.flat(),animatable:!0}}toDomain(){}convert(e){this.refresh();const{domain:t,range:i,parsedRange:s}=this,r=t[0],o=t.at(-1),a=i[0],l=i[i.length-1];if(e<=r)return a;if(e>=o)return l;let c,h;if(2===t.length){const t=(e-r)/(o-r),n=1/(i.length-1);c=i.length<=2?0:Math.min(Math.floor(t*(i.length-1)),i.length-2),h=(t-c*n)/n}else{for(c=0;c<t.length-2&&!(e<t[c+1]);c++);const i=t[c];h=(e-i)/(t[c+1]-i)}return((e,t,i)=>{let s;if(i=(0,n.qE)(0,i,1),we(e))s=t.h;else if(we(t))s=e.h;else{const n=e.h;let r=t.h;const o=t.h-e.h;o>180?r-=360:o<-180&&(r+=360),s=n*(1-i)+r*i}const r=e.c*(1-i)+t.c*i,o=e.l*(1-i)+t.l*i,a=e.a*(1-i)+t.a*i;return me.fromOKLCH(o,r,s,a)})(s[c],s[c+1],h).toRgbaString()}invert(){}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&n.Vy.warnOnce("Expected update to not invalidate scale"))}};a([ve],Se.prototype,"domain",2),a([ve],Se.prototype,"range",2);var xe=class{constructor(e,t=[],i){this.colorSpace=e,this.stops=t,this.bbox=i,this._cache=void 0}createGradient(e,t,i){const n=this.bbox??t;if(isNaN(n.x)||isNaN(n.y))return;if(null!=this._cache&&this._cache.ctx===e&&this._cache.bbox.equals(n))return this._cache.gradient;const{stops:s,colorSpace:r}=this;if(0===s.length)return;if(1===s.length)return s[0].color;let o=this.createCanvasGradient(e,n,i);if(null==o)return;const a="oklch"===r;let l=s[0];o.addColorStop(l.stop,l.color);for(let e=1;e<s.length;e+=1){const t=s[e];if(a){const e=new Se;e.domain=[l.stop,t.stop],e.range=[l.color,t.color];for(let i=l.stop+.05;i<t.stop;i+=.05)o.addColorStop(i,e.convert(i))}o.addColorStop(t.stop,t.color),l=t}return"createPattern"in o&&(o=o.createPattern()),this._cache={ctx:e,bbox:n,gradient:o},o}toSvg(e){const t=this.bbox??e,i=this.createSvgGradient(t);return this.stops.forEach(({stop:e,color:t})=>{const s=(0,n.FJ)("stop");s.setAttribute("offset",`${e}`),s.setAttribute("stop-color",`${t}`),i.appendChild(s)}),i}},Ee=class extends xe{constructor(e,t,i=0,n){super(e,t,n),this.angle=i}createCanvasGradient(e,t,i){const{angle:n}=this,s=ue(n+-90),r=i?.centerX??t.x+.5*t.width,o=i?.centerY??t.y+.5*t.height;return e.createConicGradient(s,r,o)}createSvgGradient(e){return(0,n.FJ)("linearGradient")}},Ae=class extends xe{constructor(e,t,i=0,n){super(e,t,n),this.angle=i}getGradientPoints(e){const{angle:t}=this,i=ue(t+90),n=Math.cos(i),s=Math.sin(i),r=e.width,o=e.height,a=e.x+.5*r,l=e.y+.5*o,c=Math.sqrt(o*o+r*r)/2,h=Math.atan2(o,r);let u;u=i<Math.PI/2?i:i<Math.PI?Math.PI-i:i<1.5*Math.PI?i-Math.PI:2*Math.PI-i;const d=c*Math.abs(Math.cos(u-h));return{x0:a+n*d,y0:l+s*d,x1:a-n*d,y1:l-s*d}}createCanvasGradient(e,t){const{x0:i,y0:n,x1:s,y1:r}=this.getGradientPoints(t);if(!(isNaN(i)||isNaN(n)||isNaN(s)||isNaN(r)))return e.createLinearGradient(i,n,s,r)}createSvgGradient(e){const{x0:t,y0:i,x1:s,y1:r}=this.getGradientPoints(e),o=(0,n.FJ)("linearGradient");return o.setAttribute("x1",String(t)),o.setAttribute("y1",String(i)),o.setAttribute("x2",String(s)),o.setAttribute("y2",String(r)),o.setAttribute("gradientUnits","userSpaceOnUse"),o}},Me=class extends xe{constructor(e,t,i){super(e,t,i)}createCanvasGradient(e,t,i){const n=i?.centerX??t.x+.5*t.width,s=i?.centerY??t.y+.5*t.height,r=i?.innerRadius??0,o=i?.outerRadius??Math.hypot(.5*t.width,.5*t.height)/Math.SQRT2;return e.createRadialGradient(n,s,r,n,s,o)}createSvgGradient(e){const t=e.x+.5*e.width,i=e.y+.5*e.height,s=(0,n.FJ)("radialGradient");return s.setAttribute("cx",String(t)),s.setAttribute("cy",String(i)),s.setAttribute("r",String(Math.hypot(.5*e.width,.5*e.height)/Math.SQRT2)),s.setAttribute("gradientUnits","userSpaceOnUse"),s}},Te=function(e,t){M(e,t).optional=!0},De=class{handleUnknownProperties(e,t){}set(e){const{className:t=this.constructor.name}=this.constructor;if("object"!=typeof e)return n.Vy.warn(`unable to set ${t} - expecting a properties object`),this;const i=new Set(Object.keys(e));for(const t of R(this))if(i.has(t)){const s=e[t],r=this;if(Re(r[t]))if(r[t]instanceof Ie){const e=r[t].reset(s);null!=e?r[t]=e:n.Vy.warn(`unable to set [${t}] - expecting a properties array`)}else r[t].set(s);else(0,n.Qd)(s)?r[t]=N(s,r[t]??{}):r[t]=s;i.delete(t)}this.handleUnknownProperties(i,e);for(const e of i)n.Vy.warn(`unable to set [${e}] in ${t} - property is unknown`);return this}toJson(){return R(this).reduce((e,t)=>{const i=this[t];return e[t]=Re(i)?i.toJson():i,e},{})}},Ie=class e extends Array{constructor(e,...t){super(t.length);const i=(n=e,Boolean(n?.prototype?.constructor?.name)?t=>(new e).set(t):e);var n;Object.defineProperty(this,"itemFactory",{value:i,enumerable:!1,configurable:!1}),this.set(t)}set(e){if((0,n.cy)(e)){this.length=e.length;for(let t=0;t<e.length;t++)this[t]=this.itemFactory(e[t])}return this}reset(t){if(Array.isArray(t))return new e(this.itemFactory,...t)}toJson(){return this.map(e=>e?.toJson?.()??e)}};function Re(e){return e instanceof De||e instanceof Ie}var ke=class extends De{constructor(){super(...arguments),this.color="black"}};function Pe(e){return e.flatMap((t,i)=>{const{stop:n}=t,s=e.at(i+1)?.color;return null!=s?[t,{stop:n,color:s}]:[t]})}function _e(e,t,i,s="continuous"){const r=e.map(e=>"string"==typeof e?{color:e}:e);if(0===r.length)return function(e,t){const i="discrete"===t?1:0,n=e.map((e,t,{length:n})=>({stop:(t+i)/(n-1+i),color:e}));return"discrete"===t?Pe(n):n}(t,s);if(!function(e){let t;for(const i of e)if(null!=i?.stop){if(null!=t&&i.stop<t)return!1;t=i.stop}return!0}(r))return n.Vy.warnOnce("[fills] must have the stops defined in ascending order"),[];const o=Math.min(...i),a=Math.max(...i),l="discrete"===s,c=new Float64Array(r.length);let h=0,u=-1;for(let e=0;e<r.length;e+=1){const t=r[e];if(e>=u){u=r.length-1;for(let t=e+1;t<r.length;t+=1)if(null!=r[t]?.stop){u=t;break}}let i=t?.stop;if(null==i){const t=r[h]?.stop,n=r[u]?.stop,s=t??o,c=l&&null==t?1:0;i=s+((n??a)-s)*(e-h+c)/(u-h+c)}else h=e;c[e]=Math.max(0,Math.min(1,(i-o)/(a-o)))}let d,p=r.find(e=>null!=e.color)?.color;const g=r.map((e,i)=>{let n=e?.color;const s=c[i];return null!=n?p=n:null!=p?n=p:(null==d&&(d=new Se,d.domain=[0,1],d.range=t),n=d.convert(s)),{stop:s,color:n}});return"discrete"===s?Pe(g):g}a([Te],ke.prototype,"stop",2),a([Te],ke.prototype,"color",2);var Le=class{constructor(e,t){this.imageLoader=e,this._cache=void 0,this.url=t.url,this.backgroundFill=t.backgroundFill??"black",this.backgroundFillOpacity=t.backgroundFillOpacity??1,this.repeat=t.repeat??"no-repeat",this.width=t.width,this.height=t.height,this.fit=t.fit??"stretch",this.rotation=t.rotation??0}createCanvasImage(e,t,i,s){if(!t)return null;const[r,o]=this.getSize(t.width,t.height,i,s);return r<1||o<1?(n.Vy.warnOnce("Image fill is too small to render, ignoring."),null):e.createPattern(t,this.repeat)}getSize(e,t,i,n){const{fit:s}=this;let r=e,o=t,a=1;const l=i/n,c=e/t;return"stretch"===s||0===e||0===t?(r=i,o=n):"contain"===s?a=c>l?i/e:n/t:"cover"===s&&(a=c>l?n/t:i/e),[Math.max(1,r*a),Math.max(1,o*a)]}setImageTransform(e,t){if("string"==typeof e)return;const{url:i,rotation:n,width:s,height:r}=this,o=this.imageLoader?.loadImage(i);if(!o)return;const a=ue(n),l=Math.cos(a),c=Math.sin(a),[h,u]=this.getSize(o.width,o.height,s??t.width,r??t.height),d=h/o.width,p=u/o.height,g=t.x+t.width/2,f=t.y+t.height/2,m=(l*h-c*u)/2,y=(c*h+l*u)/2;e?.setTransform(new DOMMatrix([l*d,c*p,-c*d,l*p,g-m,f-y]))}createPattern(e,t,i,n){const s=this.width??t,r=this.height??i,o=this._cache;if(null!=o&&o.ctx===e&&o.width===s&&o.height===r)return o.pattern;const a=this.imageLoader?.loadImage(this.url,n),l=this.createCanvasImage(e,a,s,r);return null==l?this.backgroundFill:(this._cache={ctx:e,pattern:l,width:s,height:r},l)}toSvg(e,t){const{url:i,rotation:s,backgroundFill:r,backgroundFillOpacity:o}=this,{x:a,y:l,width:c,height:h}=e,u=(0,n.FJ)("pattern");u.setAttribute("viewBox",`0 0 ${c} ${h}`),u.setAttribute("x",String(a)),u.setAttribute("y",String(l)),u.setAttribute("width",String(c)),u.setAttribute("height",String(h)),u.setAttribute("patternUnits","userSpaceOnUse");const d=(0,n.FJ)("rect");d.setAttribute("x","0"),d.setAttribute("y","0"),d.setAttribute("width",String(c)),d.setAttribute("height",String(h)),d.setAttribute("fill",r),d.setAttribute("fill-opacity",String(o)),u.appendChild(d);const p=(0,n.FJ)("image");return p.setAttribute("href",i),p.setAttribute("x","0"),p.setAttribute("y","0"),p.setAttribute("width",String(c)),p.setAttribute("height",String(h)),p.setAttribute("preserveAspectRatio","none"),p.setAttribute("transform",`scale(${1/t}) rotate(${s}, ${c/2}, ${h/2})`),u.appendChild(p),u}},Ne=/^[\t\n\f\r ]*([achlmqstvz])[\t\n\f\r ]*/i,Oe=/^[+-]?((\d*\.\d+)|(\d+\.)|(\d+))(e[+-]?\d+)?/i,Fe=/[\t\n\f\r ]*,?[\t\n\f\r ]*/,Ge=/^[01]/,Be={z:[],h:[Oe],v:[Oe],m:[Oe,Oe],l:[Oe,Oe],t:[Oe,Oe],s:[Oe,Oe,Oe,Oe],q:[Oe,Oe,Oe,Oe],c:[Oe,Oe,Oe,Oe,Oe,Oe],a:[Oe,Oe,Oe,Ge,Ge,Oe,Oe]};function Ve(e,t,i){const s=Be[e.toLocaleLowerCase()],r={command:e,params:[]};for(const o of s){const s=t.slice(i),a=o.exec(s);if(null==a)return 1===r.params.length?[i,r]:void n.Vy.warnOnce(`Invalid SVG path, error at index ${i}: No path segment parameters for command [${e}]`);{r.params.push(parseFloat(a[0])),i+=a[0].length;const e=Fe.exec(s.slice(a[0].length));null!=e&&(i+=e[0].length)}}return[i,r]}function He(e,t,i,n){const s=e-i,r=t-n;return s*s+r*r}function Ue(e,t,i,n,s,r,o){if(i===s&&n===r)return Math.min(o,He(e,t,i,n));const a=s-i,l=r-n,c=Math.max(0,Math.min(1,((e-i)*a+(t-n)*l)/(a*a+l*l))),h=i+c*a,u=n+c*l;return Math.min(o,He(e,t,h,u))}function ze(e,t,i,n,s,r,o,a,l){if(a&&([o,r]=[r,o]),!re(Math.atan2(t-n,e-i),r,o)){const o=i+Math.cos(r)*s,a=n+Math.sin(r)*s,c=i+Math.cos(r)*s,h=n+Math.sin(r)*s;return Math.min(l,He(e,t,o,a),He(e,t,c,h))}const c=s-Math.sqrt(He(e,t,i,n));return Math.min(l,c*c)}function We(e,t,i,n,s,r,o,a){const l=(i-e)*(a-r)-(n-t)*(o-s);if(0===l)return 0;const c=((o-s)*(t-r)-(e-s)*(a-r))/l,h=((i-e)*(t-r)-(n-t)*(e-s))/l;return c>=0&&c<=1&&h>=0&&h<=1?1:0}function je(e,t,i,n,s,r,o,a,l,c,h,u){let d=0;const p=c-u,g=h-l,f=l*(u-c)-c*(h-l),m=$e(e,i,s,o),y=$e(t,n,r,a),v=function(e,t,i,n){if(0===e)return function(e,t,i){if(0===e)return function(e,t){const i=-t/e;return 0!==e&&i>=0&&i<=1?[i]:[]}(t,i);const n=t*t-4*e*i,s=[];if(0===n){const i=-t/(2*e);i>=0&&i<=1&&s.push(i)}else if(n>0){const i=Math.sqrt(n),r=(-t-i)/(2*e),o=(-t+i)/(2*e);r>=0&&r<=1&&s.push(r),o>=0&&o<=1&&s.push(o)}return s}(t,i,n);const s=t/e,r=i/e,o=(3*r-s*s)/9,a=(9*s*r-n/e*27-2*s*s*s)/54,l=o*o*o+a*a,c=1/3,h=[];if(l>=0){const e=Math.sqrt(l),t=Math.sign(a+e)*Math.pow(Math.abs(a+e),c),i=Math.sign(a-e)*Math.pow(Math.abs(a-e),c),n=Math.abs(Math.sqrt(3)*(t-i)/2),r=-c*s+(t+i);if(r>=0&&r<=1&&h.push(r),0===n){const e=-c*s-(t+i)/2;e>=0&&e<=1&&h.push(e)}}else{const e=Math.acos(a/Math.sqrt(-o*o*o)),t=c*s,i=2*Math.sqrt(-o),n=i*Math.cos(c*e)-t,r=i*Math.cos(c*(e+2*Math.PI))-t,l=i*Math.cos(c*(e+4*Math.PI))-t;n>=0&&n<=1&&h.push(n),r>=0&&r<=1&&h.push(r),l>=0&&l<=1&&h.push(l)}return h}(p*m[0]+g*y[0],p*m[1]+g*y[1],p*m[2]+g*y[2],p*m[3]+g*y[3]+f);for(const e of v){const t=e*e,i=e*t,n=m[0]*i+m[1]*t+m[2]*e+m[3],s=y[0]*i+y[1]*t+y[2]*e+y[3];let r;r=l===h?(s-c)/(u-c):(n-l)/(h-l),r>=0&&r<=1&&d++}return d}function $e(e,t,i,n){return[3*t-e-3*i+n,3*e-6*t+3*i,-3*e+3*t,e]}function Ke(e,t,i,n,s,r,o,a,l,c){if(isNaN(e)||isNaN(t))return 0;r&&([s,n]=[n,s]);const h=(c-a)/(l-o),u=a-h*o,d=Math.pow(h,2)+1,p=2*(h*(u-t)-e),g=Math.pow(e,2)+Math.pow(u-t,2)-Math.pow(i,2),f=Math.pow(p,2)-4*d*g;if(f<0)return 0;const m=(-p+Math.sqrt(f))/2/d,y=(-p-Math.sqrt(f))/2/d;let v=0;return[m,y].forEach(i=>{if(!(i>=Math.min(o,l)&&i<=Math.max(o,l)))return;const r=i-e,a=h*i+u-t;re(Math.atan2(a,r),n,s)&&v++}),v}function Ye(e,t,i,n,s){return(1-s)**3*e+3*(1-s)**2*s*t+3*(1-s)*s**2*i+s**3*n}function qe(e,t,i,n,s){if(s<=Math.min(e,n))return e<n?0:1;if(s>=Math.max(e,n))return e<n?1:0;let r=0,o=1,a=NaN;for(let l=0;l<12;l+=1)a=(r+o)/2,Ye(e,t,i,n,a)<s?r=a:o=a;return a}function Xe(e,t,i,n,s,r,o,a,l){const c=(1-l)*e+l*i,h=(1-l)*t+l*n,u=(1-l)*i+l*s,d=(1-l)*n+l*r,p=(1-l)*s+l*o,g=(1-l)*r+l*a,f=(1-l)*c+l*u,m=(1-l)*h+l*d,y=(1-l)*u+l*p,v=(1-l)*d+l*g,b=(1-l)*f+l*y,C=(1-l)*m+l*v;return[[{x:e,y:t},{x:c,y:h},{x:f,y:m},{x:b,y:C}],[{x:b,y:C},{x:y,y:v},{x:p,y:g},{x:o,y:a}]]}function Ze(e,t,i,n){const s=3*t-e-3*i+n,r=2*(e-2*t+i),o=-e+t;if(0===s){if(0!==r){const e=-o/r;if(e>0&&e<1)return[e]}return[]}const a=r*r-4*s*o;if(a>=0){const e=Math.sqrt(a);return[(-r+e)/(2*s),(-r-e)/(2*s)].filter(e=>e>0&&e<1)}return[]}function Qe(e,t,i,n,s,r,o,a){return[...Ze(e,i,s,o),...Ze(t,n,r,a)]}var Je=class{constructor(){this.path2d=new Path2D,this.previousCommands=[],this.previousParams=[],this.previousClosedPath=!1,this.commands=[],this.params=[],this.openedPath=!1,this.closedPath=!1}isEmpty(){return 0===this.commands.length}isDirty(){return this.closedPath!==this.previousClosedPath||this.previousCommands.length!==this.commands.length||this.previousParams.length!==this.params.length||this.previousCommands.toString()!==this.commands.toString()||this.previousParams.toString()!==this.params.toString()}getPath2D(){return this.path2d}moveTo(e,t){this.openedPath=!0,this.path2d.moveTo(e,t),this.commands.push(0),this.params.push(e,t)}lineTo(e,t){this.openedPath?(this.path2d.lineTo(e,t),this.commands.push(1),this.params.push(e,t)):this.moveTo(e,t)}rect(e,t,i,n){this.moveTo(e,t),this.lineTo(e+i,t),this.lineTo(e+i,t+n),this.lineTo(e,t+n),this.closePath()}appendSvg(e){let t,i,n=0,s=0,r=0,o=0;for(const{command:a,params:l}of e){t??(t=l[0]),i??(i=l[1]);const e=a===a.toLowerCase(),c=e?t:0,h=e?i:0;switch(a.toLowerCase()){case"m":this.moveTo(c+l[0],h+l[1]),t=c+l[0],i=h+l[1],n=t,s=i;break;case"c":this.cubicCurveTo(c+l[0],h+l[1],c+l[2],h+l[3],c+l[4],h+l[5]),r=c+l[2],o=h+l[3],t=c+l[4],i=h+l[5];break;case"s":this.cubicCurveTo(t+t-r,i+i-o,c+l[0],h+l[1],c+l[2],h+l[3]),r=c+l[0],o=h+l[1],t=c+l[2],i=h+l[3];break;case"q":this.cubicCurveTo((c+2*l[0])/3,(h+2*l[1])/3,(2*l[0]+l[2])/3,(2*l[1]+l[3])/3,l[2],l[3]),r=l[0],o=l[1],t=l[2],i=l[3];break;case"t":this.cubicCurveTo((t+2*(t+t-r))/3,(i+2*(i+i-o))/3,(2*(t+t-r)+l[0])/3,(2*(i+i-o)+l[1])/3,l[0],l[1]),r=t+t-r,o=i+i-o,t=l[0],i=l[1];break;case"a":this.ellipse(t,i,l[0],l[1],l[2]*Math.PI/180,l[3],l[4],c+l[5],h+l[6]),t=c+l[5],i=h+l[6];break;case"h":this.lineTo(c+l[0],i),t=c+l[0];break;case"l":this.lineTo(c+l[0],h+l[1]),t=c+l[0],i=h+l[1];break;case"v":this.lineTo(t,h+l[0]),i=h+l[0];break;case"z":this.closePath(),t=n,i=s;break;default:throw new Error(`Could not translate command '${a}' with '${l.join(" ")}'`)}}}ellipse(e,t,i,n,s,r,o,a,l){i=Math.abs(i),n=Math.abs(n);const c=(e-a)/2,h=(t-l)/2,u=Math.sin(s),d=Math.cos(s),p=d*c+u*h,g=-u*c+d*h,f=p/i,m=g/n;let y=f*f+m*m,v=(e+a)/2,b=(t+l)/2,C=0,w=0;y>=1?(y=Math.sqrt(y),i*=y,n*=y):(y=Math.sqrt(1/y-1),r===o&&(y=-y),C=y*i*m,w=-y*n*f,v+=d*C-u*w,b+=u*C+d*w);const S=Math.atan2((g-w)/n,(p-C)/i),x=S+(Math.atan2((-g-w)/n,(-p-C)/i)-S),E=!!(1-o);this.ellipticalArc(v,b,i,n,s,S,x,E)}ellipticalArc(e,t,i,n,s,r,o,a){a&&([r,o]=[o,r]);const l=[],c=.5522847498307935,h=Math.sin(r),u=Math.cos(r),d=Math.sin(s),p=Math.cos(s);let g=p*u*i-d*h*n,f=d*u*i+p*h*n,m=-p*h*i-d*u*n,y=-d*h*i+p*u*n;l.push(g+e,f+t),o=ie(o-=r);const v=Math.PI/2,b=Math.floor(o/v),C=o%v;for(let i=0;i<b;i++)l.push(g+m*c+e,f+y*c+t,g*c+m+e,f*c+y+t,m+e,y+t),[g,m]=[m,-g],[f,y]=[y,-f];if(C>0){const i=Math.sin(C),n=Math.cos(C),s=Math.tan(C/4)*(4/3),r=n+s*i,o=i-s*n;l.push(g+m*s+e,f+y*s+t,g*r+m*o+e,f*r+y*o+t,g*n+m*i+e,f*n+y*i+t)}if(a)for(let e=0,t=l.length-2;e<t;e+=2,t-=2)[l[e],l[t]]=[l[t],l[e]],[l[e+1],l[t+1]]=[l[t+1],l[e+1]];for(let e=2;e<l.length;e+=6){const[t,i,n,s,r,o]=l.slice(e,e+6);this.cubicCurveTo(t,i,n,s,r,o)}}roundRect(e,t,i,n,s){s=Math.min(s,i/2,n/2),this.moveTo(e,t+s),this.arc(e+s,t+s,s,Math.PI,1.5*Math.PI),this.lineTo(e+s,t),this.lineTo(e+i-s,t),this.arc(e+i-s,t+s,s,1.5*Math.PI,2*Math.PI),this.lineTo(e+i,t+s),this.lineTo(e+i,t+n-s),this.arc(e+i-s,t+n-s,s,0,Math.PI/2),this.lineTo(e+i-s,t+n),this.lineTo(e+s,t+n),this.arc(e+ +s,t+n-s,s,Math.PI/2,Math.PI),this.lineTo(e,t+n-s),this.closePath()}arc(e,t,i,n,s,r){this.openedPath=!0,this.path2d.arc(e,t,i,n,s,r),this.commands.push(2),this.params.push(e,t,i,n,s,r?1:0)}cubicCurveTo(e,t,i,n,s,r){this.openedPath||this.moveTo(e,t),this.path2d.bezierCurveTo(e,t,i,n,s,r),this.commands.push(3),this.params.push(e,t,i,n,s,r)}closePath(){this.openedPath&&(this.path2d.closePath(),this.commands.push(4),this.openedPath=!1,this.closedPath=!0)}clear(e){e&&(this.previousCommands=this.commands,this.previousParams=this.params,this.previousClosedPath=this.closedPath),this.path2d=new Path2D,this.openedPath=!1,this.closedPath=!1,this.commands=[],this.params=[]}isPointInPath(e,t){const i=this.commands,n=this.params,s=i.length,r=-1e4,o=-1e4;let a=NaN,l=NaN,c=0,h=0,u=0;for(let d=0,p=0;d<s;d++)switch(i[d]){case 0:u+=We(a,l,c,h,r,o,e,t),c=n[p++],a=c,h=n[p++],l=h;break;case 1:u+=We(c,h,n[p++],n[p++],r,o,e,t),c=n[p-2],h=n[p-1];break;case 3:u+=je(c,h,n[p++],n[p++],n[p++],n[p++],n[p++],n[p++],r,o,e,t),c=n[p-2],h=n[p-1];break;case 2:{const i=n[p++],s=n[p++],l=n[p++],d=n[p++],g=n[p++];u+=Ke(i,s,l,d,g,Boolean(n[p++]),r,o,e,t),isNaN(a)||(u+=We(c,h,i+Math.cos(d)*l,s+Math.sin(d)*l,r,o,e,t)),c=i+Math.cos(g)*l,h=s+Math.sin(g)*l;break}case 4:u+=We(a,l,c,h,r,o,e,t)}return u%2==1}distanceSquared(e,t){let i=1/0;const s=this.commands,r=this.params,o=s.length;let a=NaN,l=NaN,c=0,h=0;for(let u=0,d=0;u<o;u++)switch(s[u]){case 0:c=a=r[d++],h=l=r[d++];break;case 1:i=Ue(e,t,c,h,r[d++],r[d++],i);break;case 3:n.Vy.error("Command.Curve distanceSquare not implemented");break;case 2:{const n=r[d++],s=r[d++],o=r[d++],a=r[d++],l=r[d++],u=n+Math.cos(a)*o,p=s+Math.sin(a)*o,g=Boolean(r[d++]);i=Ue(e,t,c,h,u,p,i),i=ze(e,t,n,s,o,a,l,g,i),c=n+Math.cos(l)*o,h=s+Math.sin(l)*o;break}case 4:i=Ue(e,t,c,h,a,l,i)}return i}toSVG(e=(e,t)=>({x:e,y:t})){const t=[],{commands:i,params:n}=this,s=(i,...n)=>{t.push(i);for(let i=0;i<n.length;i+=2){const{x:s,y:r}=e(n[i],n[i+1]);t.push(s,r)}};let r=0;for(const e of i)switch(e){case 0:s("M",n[r++],n[r++]);break;case 1:s("L",n[r++],n[r++]);break;case 3:s("C",n[r++],n[r++],n[r++],n[r++],n[r++],n[r++]);break;case 2:{const e=n[r++],i=n[r++],o=n[r++],a=n[r++],l=n[r++],c=n[r++];let h=c?a-l:l-a;h<0&&(h+=2*Math.ceil(-h/(2*Math.PI))*Math.PI),c&&(h=-h);const u=Math.max(Math.ceil(Math.abs(h)/(Math.PI/2)),1),d=h/u,p=4/3*Math.tan(d/4);s(0===t.length?"M":"L",e+Math.cos(a)*o,i+Math.sin(a)*o);for(let t=0;t<u;t+=1){const n=a+d*(t+0),r=a+d*(t+1),l=o*Math.sin(n),c=o*Math.cos(n),h=o*Math.sin(r),u=o*Math.cos(r);s("C",e+c-p*l,i+l+p*c,e+u+p*h,i+h-p*u,e+u,i+h)}break}case 4:t.push("Z")}return t.join(" ")}computeBBox(){const{commands:e,params:t}=this;let[i,n,s,r]=[1/0,1/0,-1/0,-1/0],[o,a]=[NaN,NaN],[l,c]=[NaN,NaN];const h=(e,t,l)=>{i=Math.min(t,i),n=Math.min(e,n),s=Math.max(e,s),r=Math.max(t,r),l&&([o,a]=[e,t])},u=(e,t,i,n,s)=>{const r=e+i*Math.cos(n),o=t+i*Math.sin(n);h(r,o,s)};let d=0;for(const i of e)switch(i){case 0:h(t[d++],t[d++],!0),[l,c]=[o,a];break;case 1:h(t[d++],t[d++],!0);break;case 3:{const e=t[d++],i=t[d++],n=t[d++],s=t[d++],r=t[d++],l=t[d++];Qe(o,a,e,i,n,s,r,l).forEach(t=>{const c=Ye(o,e,n,r,t),u=Ye(a,i,s,l,t);h(c,u)}),h(r,l,!0);break}case 2:{const e=t[d++],i=t[d++],n=t[d++],s=ie(t[d++]),r=ie(t[d++]),o=t[d++];u(e,i,n,s);const a=[0,Math.PI/2,Math.PI,3*Math.PI/2],[l,c]=o?[r,s]:[s,r];for(const t of a)(l<c&&l<=t&&t<=c||l>c&&(l<=t||t<=c))&&u(e,i,n,t);u(e,i,n,r,!0);break}case 4:[o,a]=[l,c]}return new m(n,i,s-n,r-i)}};function et(e,t,i){const n=Math.round(t*e)/e;return null==i?n:0===i?0:i<1?Math.ceil(i*e)/e:Math.round((i+t)*e)/e-n}function tt(e,t){return Math.floor(t*e)/e}function it(e,t,i){const{width:n,height:s,padding:r,strokeWidth:o}=t,a=n/2,l=s/2,c=Math.max(1,n-r-o/2),h=Math.max(1,s-r-o/2);let u=!1;for(const[t,n]of i){const i=a+(t-.5)*c,s=l+(n-.5)*h;u?e.lineTo(i,s):e.moveTo(i,s),u=!0}e.closePath()}var nt={circles(e,{width:t,strokeWidth:i,padding:n}){const s=t/2,r=Math.max(1,s-n-i/2);e.arc(s,s,r,0,2*Math.PI)},squares(e,{width:t,height:i,pixelRatio:n,padding:s,strokeWidth:r}){const o=s+r/2;e.moveTo(et(n,o),et(n,o)),e.lineTo(et(n,t-o),et(n,o)),e.lineTo(et(n,t-o),et(n,i-o)),e.lineTo(et(n,o),et(n,i-o)),e.closePath()},triangles(e,t){it(e,t,[[.5,0],[1,1],[0,1]])},diamonds(e,t){it(e,t,[[.5,0],[1,.5],[.5,1],[0,.5]])},stars(e,{width:t,height:i,padding:n}){const s=Math.max(1,(t-n)/2),r=s/2,o=Math.PI/2;for(let n=0;n<10;n++){const a=n%2==0?s:r,l=n*Math.PI/5-o,c=t/2+Math.cos(l)*a,h=i/2+Math.sin(l)*a;e.lineTo(c,h)}e.closePath()},hearts(e,{width:t,height:i,padding:n}){const s=Math.max(1,t/4-n/2),r=t/2,o=i/2+s/2;e.arc(r-s,o-s,s,oe(130),oe(330)),e.arc(r+s,o-s,s,oe(220),oe(50)),e.lineTo(r,o+s),e.closePath()},crosses(e,t){it(e,t,[[.25,0],[.5,.25],[.75,0],[1,.25],[.75,.5],[1,.75],[.75,1],[.5,.75],[.25,1],[0,.75],[.25,.5],[0,.25]])},"vertical-lines"(e,{width:t,height:i,pixelRatio:n,strokeWidth:s}){const r=et(n,t/2)-s%2/2;e.moveTo(r,0),e.lineTo(r,i)},"horizontal-lines"(e,{width:t,height:i,pixelRatio:n,strokeWidth:s}){const r=et(n,i/2)-s%2/2;e.moveTo(0,r),e.lineTo(t,r)},"forward-slanted-lines"(e,{width:t,height:i,strokeWidth:n}){const s=Math.atan2(i,t),r=n*Math.cos(s),o=n*Math.sin(s);e.moveTo(-r,o),e.lineTo(r,-o),e.moveTo(-r,i+o),e.lineTo(t+r,-o),e.moveTo(t-r,i+o),e.lineTo(t+r,i-o)},"backward-slanted-lines"(e,{width:t,height:i,strokeWidth:n}){const s=Math.atan2(i,t),r=n*Math.cos(s),o=n*Math.sin(s);e.moveTo(t-r,-o),e.lineTo(t+r,o),e.moveTo(-r,-o),e.lineTo(t+r,i+o),e.moveTo(-r,i-o),e.lineTo(r,i+o)}},st=class{constructor(e){this._cache=void 0,this.width=Math.max(e?.width??10,1),this.height=Math.max(e?.height??10,1),this.fill=e.fill??"none",this.fillOpacity=e.fillOpacity??1,this.backgroundFill=e.backgroundFill??"none",this.backgroundFillOpacity=e.backgroundFillOpacity??1,this.stroke=e.stroke??"black",this.strokeOpacity=e.strokeOpacity??1,this.strokeWidth=e.strokeWidth??1,this.padding=e.padding??1,this.pattern=e.pattern??"forward-slanted-lines",this.rotation=e.rotation??0,this.scale=e.scale??1,this.path=e.path}getPath(e){const{pattern:t,width:i,height:s,padding:r,strokeWidth:o,path:a}=this,l=new Je,c=function(e){if(!e)return;const t=[];let i,s=0;for(;s<e.length;){const r=Ne.exec(e.slice(s));let o;if(null==r){if(!i)return void n.Vy.warnOnce(`Invalid SVG path, error at index ${s}: Missing command.`);o=i}else o=r[1],s+=r[0].length;const a=Ve(o,e,s);if(!a)return;s=a[0],i=o,t.push(a[1])}return t}(a);return c?l.appendSvg(c):nt[t](l,{width:i,height:s,pixelRatio:e,strokeWidth:o,padding:r}),l}renderStroke(e,t){const{stroke:i,strokeWidth:n,strokeOpacity:s}=this;n&&(t.strokeStyle=i,t.lineWidth=n,t.globalAlpha=s,t.stroke(e))}renderFill(e,t){const{fill:i,fillOpacity:n}=this;"none"!==i&&(t.fillStyle=i,t.globalAlpha=n,t.fill(e))}createCanvasPattern(e,t){const{width:i,height:s,scale:r,backgroundFill:o,backgroundFillOpacity:a}=this;if(i*r<1||s*r<1)return n.Vy.warnOnce("Pattern fill is too small to render, ignoring."),null;const l=new S({width:i,height:s,pixelRatio:t*r}),c=l.context;"none"!==o&&(c.fillStyle=o,c.globalAlpha=a,c.fillRect(0,0,i,s));const h=this.getPath(t).getPath2D();this.renderFill(h,c),this.renderStroke(h,c);const u=e.createPattern(l.canvas,"repeat");return this.setPatternTransform(u,t),l.destroy(),u}setPatternTransform(e,t,i=0,n=0){const s=ue(this.rotation),r=1/t,o=Math.cos(s)*r,a=Math.sin(s)*r;e?.setTransform(new DOMMatrix([o,a,-a,o,i,n]))}createPattern(e,t){if(null!=this._cache&&this._cache.ctx===e&&this._cache.pixelRatio===t)return this._cache.pattern;const i=this.createCanvasPattern(e,t);return null!=i?(this._cache={ctx:e,pattern:i,pixelRatio:t},i):void 0}toSvg(){const{width:e,height:t,fill:i,fillOpacity:s,backgroundFill:r,backgroundFillOpacity:o,stroke:a,strokeWidth:l,strokeOpacity:c,rotation:h,scale:u}=this,d=(0,n.FJ)("pattern");d.setAttribute("viewBox",`0 0 ${e} ${t}`),d.setAttribute("width",String(e)),d.setAttribute("height",String(t)),d.setAttribute("patternUnits","userSpaceOnUse");const p=(0,n.FJ)("rect");p.setAttribute("x","0"),p.setAttribute("y","0"),p.setAttribute("width",String(e)),p.setAttribute("height",String(t)),p.setAttribute("fill",r),p.setAttribute("fill-opacity",String(o)),d.appendChild(p);const g=(0,n.FJ)("path");return g.setAttribute("fill",i),g.setAttribute("fill-opacity",String(s)),g.setAttribute("stroke-opacity",String(c)),g.setAttribute("stroke",a),g.setAttribute("stroke-width",String(l)),g.setAttribute("transform",`rotate(${h}) scale(${u})`),g.setAttribute("d",this.getPath(1).toSVG()),d.appendChild(g),d}};function rt(e){return(0,n.Gv)(e)&&"gradient"==e.type}function ot(e){return(0,n.cy)(e)&&e.every(e=>"string"==typeof e)}function at(e){return null!==e&&(0,n.Gv)(e)&&"pattern"==e.type}function lt(e){return null!==e&&(0,n.Gv)(e)&&"image"==e.type}function ct(e){return rt(e)||at(e)}var ht=class e extends J{constructor(){super(...arguments),this.fillOpacity=1,this.strokeOpacity=1,this.fill=e.defaultStyles.fill,this.stroke=e.defaultStyles.stroke,this.strokeWidth=e.defaultStyles.strokeWidth,this.lineDash=e.defaultStyles.lineDash,this.lineDashOffset=e.defaultStyles.lineDashOffset,this.lineCap=e.defaultStyles.lineCap,this.lineJoin=e.defaultStyles.lineJoin,this.miterLimit=void 0,this.opacity=e.defaultStyles.opacity,this.fillShadow=e.defaultStyles.fillShadow}restoreOwnStyles(){const{defaultStyles:e}=this.constructor;Object.assign(this,e)}getGradient(e){if(rt(e))return this.createGradient(e)}createGradient(e){const{colorSpace:t="rgb",gradient:i="linear",colorStops:n,rotation:s=0,reverse:r=!1}=e;if(null==n)return;let o=_e(n,["black"],[0,1]);switch(r&&(o=o.map(e=>({color:e.color,stop:1-e.stop})).reverse()),i){case"linear":return new Ae(t,o,s);case"radial":return new Me(t,o);case"conic":return new Ee(t,o,s)}}getPattern(e){if(at(e))return this.createPattern(e)}createPattern(e){return new st(e)}getImage(e){if(lt(e))return this.createImage(e)}createImage(e){return new Le(this.imageLoader,e)}onFillChange(){"object"==typeof this.fill&&P(this._cachedFill??{},this.fill)||(this.fillGradient=this.getGradient(this.fill),this.fillPattern=this.getPattern(this.fill),this.fillImage=this.getImage(this.fill),this._cachedFill=this.fill)}onStrokeChange(){this.strokeGradient=this.getGradient(this.stroke)}align(e,t){return et(this.layerManager?.canvas?.pixelRatio??1,e,t)}preRender(e,t){return this.dirty&&(this.cachedDefaultGradientFillBBox=void 0),super.preRender(e,t)}fillStroke(e,t){this.renderFill(e,t),this.renderStroke(e,t)}renderFill(e,t){const{fill:i,fillImage:n}=this;if(i&&"none"!==i){const{globalAlpha:i}=e;n&&(e.globalAlpha=n.backgroundFillOpacity,e.fillStyle=n.backgroundFill,this.executeFill(e,t),e.globalAlpha=i),this.applyFillAndAlpha(e),this.applyShadow(e),this.executeFill(e,t),e.globalAlpha=i}e.shadowColor="rgba(0, 0, 0, 0)"}executeFill(e,t){t?e.fill(t):e.fill()}applyFillAndAlpha(e){const{fill:t,fillGradient:i,fillPattern:n,fillImage:s,fillOpacity:r,opacity:o}=this;if(e.globalAlpha*=o*r,i){const{fillBBox:t=this.getDefaultGradientFillBBox()??this.getBBox(),fillParams:n}=this;e.fillStyle=i.createGradient(e,t,n)??"black"}else if(n){const{x:t,y:i}=this.getBBox(),s=this.layerManager?.canvas?.pixelRatio??1,r=n.createPattern(e,s);n.setPatternTransform(r,s,t,i),r?e.fillStyle=r:(e.fillStyle=n.fill,e.globalAlpha*=n.fillOpacity)}else if(s){const t=this.getBBox(),i=s.createPattern(e,t.width,t.height,this);s.setImageTransform(i,t),e.fillStyle=i??"transparent"}else e.fillStyle="string"==typeof t?t:"black"}applyStrokeAndAlpha(e){const{stroke:t,strokeOpacity:i,strokeGradient:n,opacity:s}=this;e.strokeStyle=n?.createGradient(e,this.getBBox())??("string"==typeof t?t:void 0)??"black",e.globalAlpha*=s*i}applyShadow(e){const t=this.layerManager?.canvas.pixelRatio??1,i=this.fillShadow;i?.enabled&&(e.shadowColor=i.color,e.shadowOffsetX=i.xOffset*t,e.shadowOffsetY=i.yOffset*t,e.shadowBlur=i.blur*t)}renderStroke(e,t){const{stroke:i,strokeWidth:n,lineDash:s,lineDashOffset:r,lineCap:o,lineJoin:a,miterLimit:l}=this;if(i&&n){const{globalAlpha:i}=e;this.applyStrokeAndAlpha(e),e.lineWidth=n,s&&e.setLineDash(s),r&&(e.lineDashOffset=r),o&&(e.lineCap=o),a&&(e.lineJoin=a),null!=l&&(e.miterLimit=l),this.executeStroke(e,t),e.globalAlpha=i}}executeStroke(e,t){t?e.stroke(t):e.stroke()}getDefaultGradientFillBBox(){return null==this.cachedDefaultGradientFillBBox&&(this.cachedDefaultGradientFillBBox=Object.freeze(this.computeDefaultGradientFillBBox())),this.cachedDefaultGradientFillBBox}computeDefaultGradientFillBBox(){}containsPoint(e,t){return this.isPointInPath(e,t)}applySvgFillAttributes(e,t){const{fill:i,fillOpacity:s}=this;if("string"==typeof i)e.setAttribute("fill",i);else if(rt(i)&&this.fillGradient){t??(t=[]);const i=this.fillGradient.toSvg(this.fillBBox??this.getBBox()),s=(0,n.lk)();i.setAttribute("id",s),t.push(i),e.setAttribute("fill",`url(#${s})`)}else if(at(i)&&this.fillPattern){t??(t=[]);const i=this.fillPattern.toSvg(),s=(0,n.lk)();i.setAttribute("id",s),t.push(i),e.setAttribute("fill",`url(#${s})`)}else if(lt(i)&&this.fillImage){t??(t=[]);const i=this.layerManager?.canvas?.pixelRatio??1,s=this.fillImage.toSvg(this.getBBox(),i),r=(0,n.lk)();s.setAttribute("id",r),t.push(s),e.setAttribute("fill",`url(#${r})`)}else e.setAttribute("fill","none");return e.setAttribute("fill-opacity",String(s)),t}applySvgStrokeAttributes(e){const{stroke:t,strokeOpacity:i,strokeWidth:n,lineDash:s,lineDashOffset:r}=this;if(null!=t&&(e.setAttribute("stroke","string"==typeof t?t:"none"),e.setAttribute("stroke-opacity",String(i)),e.setAttribute("stroke-width",String(n))),!0===s?.some(e=>0!==e)){const t=s.length%2==1?[...s,...s]:s;e.setAttribute("stroke-dasharray",t.join(" ")),e.setAttribute("stroke-dashoffset",String(r))}}};ht.defaultStyles={fill:"black",stroke:void 0,strokeWidth:0,lineDash:void 0,lineDashOffset:0,lineCap:void 0,lineJoin:void 0,opacity:1,fillShadow:void 0},a([K()],ht.prototype,"fillOpacity",2),a([K()],ht.prototype,"strokeOpacity",2),a([Y({equals:P,changeCb:e=>e.onFillChange()})],ht.prototype,"fill",2),a([Y({equals:P,changeCb:e=>e.onStrokeChange()})],ht.prototype,"stroke",2),a([K()],ht.prototype,"strokeWidth",2),a([q()],ht.prototype,"lineDash",2),a([K()],ht.prototype,"lineDashOffset",2),a([K()],ht.prototype,"lineCap",2),a([K()],ht.prototype,"lineJoin",2),a([K()],ht.prototype,"miterLimit",2),a([K({convertor:e=>(0,n.qE)(0,e,1)})],ht.prototype,"opacity",2),a([Y({equals:$,checkDirtyOnAssignment:!0})],ht.prototype,"fillShadow",2),a([Y({equals:h.equals,changeCb:e=>e.onFillChange()})],ht.prototype,"fillBBox",2),a([Y({equals:P,changeCb:e=>e.onFillChange()})],ht.prototype,"fillParams",2);var ut=ht,dt=[1,0,0,1,0,0],pt=class e{get e(){return[...this.elements]}constructor(e=dt){this.elements=[...e]}setElements(e){const t=this.elements;return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],this}get identity(){const e=this.elements;return(0,n.YX)(e[0],1)&&(0,n.YX)(e[1],0)&&(0,n.YX)(e[2],0)&&(0,n.YX)(e[3],1)&&(0,n.YX)(e[4],0)&&(0,n.YX)(e[5],0)}AxB(e,t,i){const n=e[0]*t[0]+e[2]*t[1],s=e[1]*t[0]+e[3]*t[1],r=e[0]*t[2]+e[2]*t[3],o=e[1]*t[2]+e[3]*t[3],a=e[0]*t[4]+e[2]*t[5]+e[4],l=e[1]*t[4]+e[3]*t[5]+e[5];(i=i??e)[0]=n,i[1]=s,i[2]=r,i[3]=o,i[4]=a,i[5]=l}multiplySelf(e){return this.AxB(this.elements,e.elements),this}multiply(t){const i=new Array(6);return t instanceof e?this.AxB(this.elements,t.elements,i):this.AxB(this.elements,[t.a,t.b,t.c,t.d,t.e,t.f],i),new e(i)}preMultiplySelf(e){return this.AxB(e.elements,this.elements,this.elements),this}inverse(){const t=this.elements;let i=t[0],n=t[1],s=t[2],r=t[3];const o=t[4],a=t[5],l=1/(i*r-n*s);return i*=l,n*=l,s*=l,r*=l,new e([r,-n,-s,i,s*a-r*o,n*o-i*a])}invertSelf(){const e=this.elements;let t=e[0],i=e[1],n=e[2],s=e[3];const r=e[4],o=e[5],a=1/(t*s-i*n);return t*=a,i*=a,n*=a,s*=a,e[0]=s,e[1]=-i,e[2]=-n,e[3]=t,e[4]=n*o-s*r,e[5]=i*r-t*o,this}transformPoint(e,t){const i=this.elements;return{x:e*i[0]+t*i[2]+i[4],y:e*i[1]+t*i[3]+i[5]}}transformBBox(e,t){const i=this.elements,n=i[0],s=i[1],r=i[2],o=i[3],a=.5*e.width,l=.5*e.height,c=e.x+a,h=e.y+l,u=Math.abs(a*n)+Math.abs(l*r),d=Math.abs(a*s)+Math.abs(l*o);return t??(t=new m(0,0,0,0)),t.x=c*n+h*r+i[4]-u,t.y=c*s+h*o+i[5]-d,t.width=u+u,t.height=d+d,t}toContext(e){if(this.identity)return;const t=this.elements;e.transform(t[0],t[1],t[2],t[3],t[4],t[5])}static updateTransformMatrix(e,t,i,n,s,r,o){const a=t,l=i;let c,h;1===a&&1===l?(c=0,h=0):(c=o?.scalingCenterX??0,h=o?.scalingCenterY??0);const u=n,d=Math.cos(u),p=Math.sin(u);let g,f;0===u?(g=0,f=0):(g=o?.rotationCenterX??0,f=o?.rotationCenterY??0);const m=s,y=r,v=c*(1-a)-g,b=h*(1-l)-f;return e.setElements([d*a,p*a,-p*l,d*l,d*v-p*b+g+m,p*v+d*b+f+y]),e}};function gt(e){return mt(e.constructor)}var ft=Symbol("isMatrixTransform");function mt(e){return!0===e[ft]}function yt(e){var t;const i=e;if(mt(e))return e;const s=Symbol("matrix_combined_transform");class r extends i{constructor(){super(...arguments),this[t]=new pt,this._dirtyTransform=!0}markDirtyTransform(){this._dirtyTransform=!0,super.markDirty()}onChangeDetection(e){super.onChangeDetection(e),this.markDirtyTransform()}updateMatrix(e){}computeTransformMatrix(){this._dirtyTransform&&(this[s].setElements(dt),this.updateMatrix(this[s]),this._dirtyTransform=!1)}toParent(e){return this.computeTransformMatrix(),this[s].identity?e.clone():this[s].transformBBox(e)}toParentPoint(e,t){return this.computeTransformMatrix(),this[s].identity?{x:e,y:t}:this[s].transformPoint(e,t)}fromParent(e){return this.computeTransformMatrix(),this[s].identity?e.clone():this[s].inverse().transformBBox(e)}fromParentPoint(e,t){return this.computeTransformMatrix(),this[s].identity?{x:e,y:t}:this[s].inverse().transformPoint(e,t)}computeBBox(){const e=super.computeBBox();return e?this.toParent(e):e}computeBBoxWithoutTransforms(){return super.computeBBox()}pickNode(e,t){return({x:e,y:t}=this.fromParentPoint(e,t)),super.pickNode(e,t)}pickNodes(e,t,i){return({x:e,y:t}=this.fromParentPoint(e,t)),super.pickNodes(e,t,i)}render(e){this.computeTransformMatrix();const{ctx:t}=e,i=this[s];let n=!1;i.identity||(t.save(),n=!0,i.toContext(t)),super.render(e),n&&t.restore()}toSVG(){this.computeTransformMatrix();const e=super.toSVG(),t=this[s];if(t.identity||null==e)return e;const i=(0,n.FJ)("g");i.append(...e.elements);const[r,o,a,l,c,h]=t.e;return i.setAttribute("transform",`matrix(${r} ${o} ${a} ${l} ${c} ${h})`),{elements:[i],defs:e.defs}}}return t=s,r[ft]=!0,r}function vt(e){var t;const i=e,n=Symbol("matrix_rotation");class s extends(yt(i)){constructor(){super(...arguments),this[t]=new pt,this.rotationCenterX=0,this.rotationCenterY=0,this.rotation=0}updateMatrix(e){super.updateMatrix(e);const{rotation:t,rotationCenterX:i,rotationCenterY:s}=this;0!==t&&(pt.updateTransformMatrix(this[n],1,1,t,0,0,{rotationCenterX:i,rotationCenterY:s}),e.multiplySelf(this[n]))}}return t=n,a([K()],s.prototype,"rotationCenterX",2),a([K()],s.prototype,"rotationCenterY",2),a([K()],s.prototype,"rotation",2),s}function bt(e){var t;const i=e,n=Symbol("matrix_scale");class s extends(yt(i)){constructor(){super(...arguments),this[t]=new pt,this.scalingX=1,this.scalingY=1,this.scalingCenterX=0,this.scalingCenterY=0}updateMatrix(e){super.updateMatrix(e);const{scalingX:t,scalingY:i,scalingCenterX:s,scalingCenterY:r}=this;1===t&&1===i||(pt.updateTransformMatrix(this[n],t,i,0,0,0,{scalingCenterX:s,scalingCenterY:r}),e.multiplySelf(this[n]))}}return t=n,a([K()],s.prototype,"scalingX",2),a([K()],s.prototype,"scalingY",2),a([K()],s.prototype,"scalingCenterX",2),a([K()],s.prototype,"scalingCenterY",2),s}function Ct(e){var t;const i=e,n=Symbol("matrix_translation");class s extends(yt(i)){constructor(){super(...arguments),this[t]=new pt,this.translationX=0,this.translationY=0}updateMatrix(e){super.updateMatrix(e);const{translationX:t,translationY:i}=this;0===t&&0===i||(pt.updateTransformMatrix(this[n],1,1,0,t,i),e.multiplySelf(this[n]))}}return t=n,a([K()],s.prototype,"translationX",2),a([K()],s.prototype,"translationY",2),s}var wt,St=class{static fromCanvas(e,t){const i=[];for(const t of e.traverseUp())gt(t)&&i.unshift(t);for(const e of i)t=e.fromParent(t);return gt(e)&&(t=e.fromParent(t)),t}static toCanvas(e,t){null==t?t=e.getBBox():gt(e)&&(t=e.toParent(t));for(const i of e.traverseUp())gt(i)&&(t=i.toParent(t));return t}static fromCanvasPoint(e,t,i){const n=[];for(const t of e.traverseUp())gt(t)&&n.unshift(t);for(const e of n)({x:t,y:i}=e.fromParentPoint(t,i));return gt(e)&&({x:t,y:i}=e.fromParentPoint(t,i)),{x:t,y:i}}static toCanvasPoint(e,t,i){gt(e)&&({x:t,y:i}=e.toParentPoint(t,i));for(const n of e.traverseUp())gt(n)&&({x:t,y:i}=n.toParentPoint(t,i));return{x:t,y:i}}},xt=(e,t)=>Math.sign(e-t);function Et(e,t){if("number"==typeof e&&"number"==typeof t)return xt(e,t);const i="number"==typeof e?[e]:e,n="number"==typeof t?[t]:t,s=Math.min(i.length,n.length);for(let e=0;e<s;e+=1){const t=xt(i[e],n[e]);if(0!==t)return t}return xt(i.length,n.length)}var At=class e extends J{constructor(e){super(e),this.opacity=1,this.renderToOffscreenCanvas=!1,this.optimizeForInfrequentRedraws=!1,this.layer=void 0,this.image=void 0,this._lastWidth=NaN,this._lastHeight=NaN,this._lastDevicePixelRatio=NaN,this.isContainerNode=!0,this.renderToOffscreenCanvas=!0===e?.renderToOffscreenCanvas}static is(t){return t instanceof e}static computeChildrenBBox(e,t=!0){return m.merge(J.extractBBoxes(e,t))}static compareChildren(e,t){return Et(e.zIndex,t.zIndex)||e.serialNumber-t.serialNumber}containsPoint(e,t){return!0}computeBBox(){return e.computeChildrenBBox(this.children())}computeSafeClippingBBox(e){const t=this.computeBBox();if(!t.isFinite())return;let i=0;for(const e of this.descendants())e instanceof ut&&(i=Math.max(i,e.strokeWidth));const n=Math.max(1,i/2*4),{x:s,y:r}=St.toCanvasPoint(this,0,0),o=tt(e,s+t.x-n)-s,a=tt(e,r+t.y-n)-r,l=Math.ceil(t.x+t.width-o+n),c=Math.ceil(t.y+t.height-a+n);return new m(o,a,l,c)}prepareSharedCanvas(e,t,i){return null==wt||wt.pixelRatio!==i?wt=new S({width:e,height:t,pixelRatio:i}):wt.resize(e,t,i),wt}isDirty(e){const{width:t,height:i,devicePixelRatio:n}=e,{dirty:s,dirtyZIndex:r,layer:o}=this,a=null!=o&&(this._lastWidth!==t||this._lastHeight!==i),l=this._lastDevicePixelRatio!==n;if(this._lastWidth=t,this._lastHeight=i,this._lastDevicePixelRatio=n,s||r||a||l)return!0;for(const e of this.children())if(e.dirty)return!0;return!1}preRender(e){const t=super.preRender(e,0);return t.groups+=1,t.nonGroups-=1,this.renderToOffscreenCanvas&&!this.optimizeForInfrequentRedraws&&t.nonGroups>0&&this.getVisibility()?this.layer??(this.layer=this.layerManager?.addLayer({name:this.name})):null!=this.layer&&(this.layerManager?.removeLayer(this.layer),this.layer=void 0),t}render(t){const{layer:i,renderToOffscreenCanvas:n}=this,s={...t};if(!n)return this.renderInContext(s),void super.render(s);const{ctx:r,stats:o,devicePixelRatio:a}=t;let{image:l}=this;if(this.isDirty(t)){l?.bitmap.close(),l=void 0;const t=i?void 0:this.computeSafeClippingBBox(a),n=(e,...t)=>{const i=e.context;s.ctx=i,e.clear(),i.save(),i.setTransform(...t),i.globalAlpha=1,this.renderInContext(s),i.restore(),i.verifyDepthZero?.()};if(i)n(i,r.getTransform());else if(t){const{x:e,y:i,width:s,height:r}=t,o=this.prepareSharedCanvas(s,r,a);n(o,a,0,0,a,-e*a,-i*a),l={bitmap:o.transferToImageBitmap(),x:e,y:i,width:s,height:r}}else this.dirtyZIndex&&this.sortChildren(e.compareChildren);this.image=l,o&&o.layersRendered++}else this.skipRender(s),o&&o.layersSkipped++;const{globalAlpha:c}=r;if(r.globalAlpha=c*this.opacity,i)r.save(),r.resetTransform(),i.drawImage(r),r.restore();else if(l){const{bitmap:e,x:t,y:i,width:n,height:s}=l;r.drawImage(e,0,0,n*a,s*a,t,i,n,s)}r.globalAlpha=c,super.render(s)}skipRender(e){const{stats:t}=e;for(const e of this.children())e.markClean(),t&&(t.nodesSkipped+=this.childNodeCounts.groups+this.childNodeCounts.nonGroups,t.opsSkipped+=this.childNodeCounts.complexity)}applyClip(e,t){const{x:i,y:n,width:s,height:r}=t;e.beginPath(),e.rect(i,n,s,r),e.clip()}renderInContext(t){const{ctx:i,stats:n}=t;this.dirtyZIndex&&this.sortChildren(e.compareChildren),i.save(),i.globalAlpha*=this.opacity,null!=this.clipRect&&(this.applyClip(i,this.clipRect),t.clipBBox=St.toCanvas(this,this.clipRect));for(const e of this.children())e.visible?(i.save(),e.render(t),i.restore()):(e.markClean(),n&&(n.nodesSkipped+=e.childNodeCounts.nonGroups+e.childNodeCounts.groups,n.opsSkipped+=e.childNodeCounts.complexity));i.restore()}setClipRect(e){this.clipRect=e?St.fromCanvas(this,e):void 0}setClipRectCanvasSpace(e){this.clipRect=e}setScene(e){this.layer&&(this.scene?.layersManager.removeLayer(this.layer),this.layer=void 0),super.setScene(e)}getVisibility(){for(const e of this.traverseUp(!0))if(!e.visible)return!1;return!0}toSVG(){if(!this.visible)return;const e=[],t=[];for(const i of this.children()){const n=i.toSVG();null!=n&&(t.push(...n.elements),null!=n.defs&&e.push(...n.defs))}return{elements:t,defs:e}}};At.className="Group",a([K({convertor:e=>(0,n.qE)(0,e,1)})],At.prototype,"opacity",2);var Mt=At,Tt=class extends(bt(Mt)){},Dt=class extends(vt(Mt)){},It=class extends(Ct(Mt)){},Rt=class extends(vt(Ct(Mt))){};function kt(e,t){e&&(null==(t=h.normalize(t)).width?e.style.removeProperty("width"):e.style.width=`${t.width}px`,null==t.height?e.style.removeProperty("height"):e.style.height=`${t.height}px`,null==t.x?e.style.removeProperty("left"):e.style.left=`${t.x}px`,null==t.y?e.style.removeProperty("top"):e.style.top=`${t.y}px`)}function Pt(e){const t=parseFloat(e.style.width)||e.offsetWidth,i=parseFloat(e.style.height)||e.offsetHeight;return{x:parseFloat(e.style.left)||e.offsetLeft,y:parseFloat(e.style.top)||e.offsetTop,width:t,height:i}}function _t(e){if(e.focus({preventScroll:!0}),null==e.lastChild?.textContent)return;const t=(0,n.YE)().createRange();t.setStart(e.lastChild,e.lastChild.textContent.length),t.setEnd(e.lastChild,e.lastChild.textContent.length);const i=(0,n.zk)().getSelection();i?.removeAllRanges(),i?.addRange(t)}function Lt(){const e=(0,n.zk)("navigator");if("scheduling"in e){const t=e.scheduling;if("isInputPending"in t)return t.isInputPending({includeContinuous:!0})}return!1}function Nt(e){return`ag-charts-icon ag-charts-icon-${e}`}var Ot="class-instance";function Ft(e,t,i){if((0,n.cy)(t)){if(!(0,n.cy)(e)||e.length!==t.length||t.some((t,n)=>null!=Ft(e[n],t,i)))return t}else{if((0,n.Qd)(t)){if(!(0,n.Qd)(e))return t;const s={},r=new Set([...Object.keys(e),...Object.keys(t)]);for(const n of r)if(e[n]!==t[n])if(i?.has(n))s[n]=t[n];else if(typeof e[n]==typeof t[n]){const r=Ft(e[n],t[n],i);null!==r&&(s[n]=r)}else s[n]=t[n];return Object.keys(s).length?s:null}if(e!==t)return t}return null}function Gt(e,t){for(const i of Object.keys(e))if(e[i]!==t?.[i])return!1;return!0}function Bt(e,t){return(0,n.cy)(e)?function(e,t){const i=[],s=t?.seen;for(const r of e)"object"==typeof r&&s?.includes(r)?n.Vy.warn("cycle detected in array",r):(s?.push(r),i.push(Bt(r,t)),s?.pop());return i}(e,t):(0,n.Qd)(e)?function(e,t){const i={};for(const n of Object.keys(e))t?.assign?.has(n)?i[n]=e[n]:t?.shallow?.has(n)?i[n]=Vt(e[n]):i[n]=Bt(e[n],t);return i}(e,t):e instanceof Map?new Map(Bt(Array.from(e))):Vt(e)}function Vt(e){return(0,n.cy)(e)?e.slice(0):(0,n.Qd)(e)?{...e}:(0,n.$P)(e)?new Date(e):(0,n.gd)(e)?new RegExp(e.source,e.flags):e}function Ht(e,t,i,s,r,o){if((0,n.cy)(e)){o=t(e,s,r,o);let n=0;for(const a of e)o=Ht(a,t,i,s?.[n],r,o),n++}else if((0,n.Qd)(e)){o=t(e,s,r,o);for(const n of Object.keys(e))i?.has(n)||(o=Ht(e[n],t,i,s?.[n],r,o))}return o}function Ut(e,t,i={}){const{path:s,matcherPath:r=s?.replace(/(\[[0-9+]+])/i,"[]"),skip:o=[]}=i;if(null==e)throw new Error(`AG Charts - target is uninitialised: ${s??"<root>"}`);if(null==t)return e;if(Re(e))return e.set(t);const a=e,l=zt(e);for(const c of Object.keys(t)){if(V.has(c))continue;const h=`${r?r+".":""}${c}`;if(o.includes(h))continue;const u=t[c],d=`${s?s+".":""}${c}`,p=a.constructor,g=a[c];try{const t=zt(g),s=zt(u);if(l===Ot&&!(c in e)&&"context"!==c){if(void 0===u)continue;n.Vy.warn(`unable to set [${d}] in ${p?.name} - property is unknown`);continue}if(null!=t&&null!=s&&s!==t&&(t!==Ot||"object"!==s)){n.Vy.warn(`unable to set [${d}] in ${p?.name} - can't apply type of [${s}], allowed types are: [${t}]`);continue}if(Re(g))a[c].set(u);else if("object"===s&&"context"!==c){if(null==g){n.Vy.warn(`unable to set [${d}] in ${p?.name} - property is unknown`);continue}Ut(g,u,{...i,path:d,matcherPath:h})}else a[c]=u}catch(e){n.Vy.warn(`unable to set [${d}] in [${p?.name}]; nested error is: ${e.message}`)}}return e}function zt(e){return null==e?null:(0,n.uE)(e)||(0,n.$P)(e)?"primitive":(0,n.cy)(e)?"array":(0,n.Gv)(e)?(0,n.Qd)(e)?"object":Ot:(0,n.Tn)(e)?"function":"primitive"}function Wt(e,t,i,n){return $t(e,t,n??e,{matches:new Map},i)}var jt=Symbol("operation-resolved-undefined");function $t(e,t,i,s,r,o=[],a={}){if((0,n.cy)(e)){Kt(e,t,i,s,o,a);let n=0;for(const l of e)$t(l,t,i,s,r,[...o,`${n}`],a),n++}else if((0,n.Qd)(e)){Kt(e,t,i,s,o,a);for(const n of Object.keys(e)){if(r?.has(n))continue;const l=e[n];qt(l)?e[n]=Yt(l,t,i,s,[...o,n],a):$t(l,t,i,s,r,[...o,n],a)}}return a}function Kt(e,t,i,s,r,o){if((0,n.cy)(e))for(let n=0;n<e.length;n++)e[n]=Yt(e[n],t,i,s,[...r,`${n}`],o),e[n]===jt&&(e[n]=void 0);else{let n=!1;for(const a of Object.keys(e))e[a]=Yt(e[a],t,i,s,[...r,a],o),n||(n=Zt(a,ti)),e[a]===jt&&delete e[a];if(n&&Object.keys(e).length>1)for(const t of Object.keys(e))Zt(t,ti)&&delete e[t]}}function Yt(e,t,i,n,s,r){const o=qt(e);if(!o)return e;r[s.join(".")]=e;const a=Xt(o.operation,o.values,t,i,s,n);return void 0===a?jt:a}function qt(e){if(!(0,n.Qd)(e))return;const[t]=Object.keys(e);return Zt(t,ti)?{operation:t,values:e[t]}:void 0}function Xt(e,t,i,s,r,o){return o.referencedParams??(o.referencedParams=new Set),(0,n.cy)(t)&&!["$find","$map"].includes(e)&&(t=t.map(e=>{const t=qt(e);return t?Xt(t.operation,t.values,i,s,r,o):e})),(0,ti[e])(t,r,i,s,o)}function Zt(e,t){return(0,n.Kg)(e)&&((0,n.Gv)(t)||(0,n.cy)(t))&&e in t}function Qt(e){return(0,n.Et)(e)&&e>=0&&e<=1}function Jt(e){return(0,n.Gv)(e)&&"gradient"==e.type}function ei(e,t){const i=t.split("/");let n=[...e];t.startsWith("/")&&(n=[],i.shift());let s=!1;for(const t of i){if(".."===t)n.pop(),s||n.pop();else if("."===t)n.pop();else if("$index"===t){const t=e.findLast(e=>!isNaN(Number(e)));null!=t&&n.push(t)}else if("$prevIndex"===t){const t=e.findLast(e=>!isNaN(Number(e)));null!=t&&n.push(""+(Number(t)-1))}else 0!==t.length&&n.push(t);s=".."===t}return n}var ti={...{$ref:function e(t,i,s,r,o){if(!Zt(t,s))return void n.Vy.warnOnce(`\`$ref\` json operation failed on [${String(t)}] at [${i.join(".")}], expecting one of [${Object.keys(s).join(", ")}].`);const a=qt(s[t]);return"$ref"!==a?.operation?s[t]:o.referencedParams?.has(a.values)?void n.Vy.warnOnce(`\`$ref\` json operation failed on [${String(t)}] at [${i.join(".")}], circular reference detected with [${[...o.referencedParams].join(", ")}].`):(o.referencedParams?.add(a.values),e(a.values,i,s,r,o))},$path:function(e,t,i,s){let r,o=!1,a=!1,l=s;if((0,n.cy)(e))o=!0,r=e[1],a=3===e.length,l=a?e[2]:l,e=e[0];else if(!(0,n.Kg)(e))return void n.Vy.warnOnce(`\`$path\` json operation failed on [${String(e)}] at [${t.join(".")}], expecting a string.`);const c=ei(a?[]:t,e);let h=l;for(const i of c){if(!Zt(i,h))return o?r:void n.Vy.warnOnce(`\`$path\` json operation failed on [${String(e)}] at [${t.join(".")}] resolved to [${c.join(".")}], could not find path in object.`);h=h[i]}return Object.isFrozen(h)?Bt(h):h},$palette:function(e,t,i,s){if(!(0,n.Kg)(e))return;const r=i.__palette;if(["fill","fillFallback","stroke","gradient","range2"].includes(e)){const i=t.findLastIndex(e=>!isNaN(Number(e)));let o=Number(t[i]);if(isNaN(o))return;const a=t.slice(0,i),l=["map-shape-background","map-line-background"];switch(o-=B(s,a).slice(0,o).filter(e=>l.includes(e.type)).length,e){case"fill":return(0,n.XK)(r.fills,1,o)[0];case"fillFallback":return(0,n.XK)(r.fillsFallback,1,o)[0];case"stroke":return(0,n.XK)(r.strokes,1,o)[0];case"gradient":return(0,n.XK)(r.sequentialColors,1,o)[0];case"range2":return(0,n.XK)(r.fills,2,o)}return}return"gradients"===e?r.sequentialColors:B(r,e)}},$if:([e,t,i])=>e?t:i,$eq:([e,t])=>e===t,$not:([e])=>!e,$or:e=>(0,n.cy)(e)&&e.some(Boolean),$and:e=>(0,n.cy)(e)&&e.every(Boolean),$switch:()=>{},$isOperation:function(e,t,i,s){const r=(0,n.Kg)(e)?ei(t,e):t;return null!=qt(0===r.length?s:B(s,r))},$isEven:function([e],t){if("number"==typeof e)return e%2==0;n.Vy.warnOnce(`\`$isEven\` json operation failed on [${String(e)}] at [${t.join(".")}], expecting a number.`)},$mul:function([e,t],i){if("number"==typeof e&&"number"==typeof t)return e*t;n.Vy.warnOnce(`\`$mul\` json operation failed on [${String(e)}] and [${String(t)}] at [${i.join(".")}], expecting two numbers.`)},$round:function([e],t){if("number"==typeof e)return Math.round(e);n.Vy.warnOnce(`\`$round\` json operation failed on [${String(e)}] at [${t.join(".")}], expecting a number.`)},$map:function([e,t],i,s,r,o){const a=qt(t);if(a&&(t=Xt(a.operation,a.values,s,r,i,o)),!(0,n.cy)(t))return[];const l=qt(e);return l?(o.matches.set(i.join("."),t),t.map(()=>({[l.operation]:l.values}))):[]},$find:function([e,t],i,s,r,o){const a=qt(t);if(a&&(t=Xt(a.operation,a.values,s,r,i,o)),!(0,n.cy)(t))return;const l=qt(e);return l?t.find(e=>Xt(l.operation,l.values,s,e,[],o)):e?t[0]:void 0},$merge:function(e){if((0,n.cy)(e)){for(const t of e)if(!(0,n.Qd)(t))return;return L(...e)}},$omit:function([e,t]){if((0,n.cy)(e)&&(0,n.Qd)(t))return G(t,e)},$value:function(e,t,i,n,s){if("$1"!==e&&"$index"!==e)return e;const r=t.findLastIndex(e=>!isNaN(Number(e)));if(-1===r)return e;const o=Number(t[r]);if("$index"===e)return o;const a=t.slice(0,r).join(".");return s.matches.get(a)?.at(o)},$rem:function([e],t,i){const s="fontSize";if(Zt(s,i)&&"number"==typeof i[s]&&"number"==typeof e)return Math.round(e*i[s]);n.Vy.warnOnce(`\`$rem\` json operation failed on [${String(e)}] at [${t.join(".")}], expecting a number.`)},$mix:function([e,t,i],s){const r=`\`$mix\` json operation failed on [${String(e)}, ${String(t)}, ${String(i)}] at [${s.join(".")}], expecting`,o=`${r} two colors and a number between 0 and 1.`;if("string"!=typeof t||!Qt(i))return void n.Vy.warnOnce(o);if("string"==typeof e)try{return me.mix(me.fromString(e),me.fromString(t),i).toString()}catch{return void n.Vy.warnOnce(o)}if(!Jt(e))return void n.Vy.warnOnce(o);let a=e.colorStops;try{a=a?.map(e=>{let n;return"string"==typeof e.color&&(n=me.mix(me.fromString(e.color),me.fromString(t),i).toString()),{...e,color:n}})}catch{return void n.Vy.warnOnce(`${r} a gradient, a color and a number between 0 and 1.`)}return{...e,colorStops:a}},$foregroundBackgroundMix:function([e],t,i){const s="foregroundColor",r="backgroundColor";if(Zt(s,i)&&Zt(r,i)&&"string"==typeof i[s]&&"string"==typeof i[r]&&Qt(e))return me.mix(me.fromString(i[s]),me.fromString(i[r]),e).toString();n.Vy.warnOnce(`\`$foregroundBackgroundMix\` json operation failed on [${String(e)}}}] at [${t.join(".")}], expecting a number between 0 and 1.`)},$foregroundBackgroundAccentMix:function([e,t],i,s){const r="foregroundColor",o="backgroundColor",a="accentColor";if(Zt(r,s)&&Zt(o,s)&&Zt(a,s)&&"string"==typeof s[r]&&"string"==typeof s[o]&&"string"==typeof s[a]&&Qt(e)&&Qt(t))return me.mix(me.mix(me.fromString(s[r]),me.fromString(s[o]),e),me.fromString(s[a]),t).toString();n.Vy.warnOnce(`\`$foregroundBackgroundAccentMix\` json operation failed on [${String(e)}, ${String(t)}}] at [${i.join(".")}], expecting two numbers between 0 and 1.`)},$interpolate:function([e,t]){if((0,n.cy)(e)&&(0,n.Et)(t))return me.interpolate(e.map(e=>me.fromString(e)),t).map(e=>e.toString())},$isGradient:([e])=>Jt(e),$isPattern:([e])=>{return null!==(t=e)&&(0,n.Gv)(t)&&"pattern"==t.type;var t},$isImage:([e])=>{return null!==(t=e)&&(0,n.Gv)(t)&&"image"==t.type;var t}},ii=class{constructor(){this.available=!0,this.acquireQueue=[]}acquire(e){return new Promise(t=>{this.acquireQueue.push([e,t]),this.available&&this.dispatchNext().catch(e=>n.Vy.errorOnce(e))})}async acquireImmediately(e){return!!this.available&&(await this.acquire(e),!0)}async waitForClearAcquireQueue(){return this.acquire(()=>Promise.resolve(void 0))}async dispatchNext(){this.available=!1;let[e,t]=this.acquireQueue.shift()??[];for(;e;){try{await e(),t?.()}catch(e){n.Vy.error("mutex callback error",e),t?.()}[e,t]=this.acquireQueue.shift()??[]}this.available=!0}},ni=class{constructor(){this.eventListeners=new Map}addEventListener(e,t){if("function"!=typeof t)throw new Error("AG Charts - listener must be a Function");const i=this.eventListeners.get(e);i?i.add(t):this.eventListeners.set(e,new Set([t]))}removeEventListener(e,t){const i=this.eventListeners.get(e);null!=i&&(i.delete(t),0===i.size&&this.eventListeners.delete(e))}hasEventListener(e){return this.eventListeners.has(e)}clearEventListeners(){this.eventListeners.clear()}fireEvent(e){this.eventListeners.get(e.type)?.forEach(t=>t(e))}},si=class extends De{constructor(e=0,t=e,i=e,n=t){super(),this.top=e,this.right=t,this.bottom=i,this.left=n}};function ri(e,t){const i=(0,n.cy)(e)?e:e.split(".");if(1===i.length){const[e]=i;return T((t,i,n)=>t[e]=n,t=>t[e],t)}return T((e,t,n)=>H(e,i,n),e=>B(e,i),t)}function oi(e){return T((t,i,n)=>t[e]=n)}function ai(e,t){return T((i,n,s)=>i[e][t??n]=s)}function li(e){const{newValue:t,oldValue:i,changeValue:n}=e;return T((e,s,r,o)=>(r!==o&&(void 0!==o&&i?.call(e,o),void 0!==r&&t?.call(e,r),n?.call(e,r,o)),r))}function ci(e){return D(e)}function hi(e,t){let i,n,s=0,r=!1;const o=()=>r,a=()=>{r=!1,n?.(),n=void 0,i=void 0,s>0&&e(l)},l=()=>{const e=s;s=0,r=!0;const i=t({count:e});i?i.then(a,a):a()};return{schedule(t){0!==s||o()||e(l,t),s++},async await(){if(o())for(null==i&&(i=new Promise(e=>{n=e}));o();)await i}}}a([Te],si.prototype,"top",2),a([Te],si.prototype,"right",2),a([Te],si.prototype,"bottom",2),a([Te],si.prototype,"left",2);var ui=["blur","change","contextmenu","focus","keydown","keyup","click","dblclick","mouseenter","mousemove","mouseleave","wheel","touchstart","touchmove","touchend","touchcancel"];function di(e,t,i){const{offsetX:n,offsetY:s,clientX:r,clientY:o}=t,{currentX:a,currentY:l}=fi.calcCurrentXY(i,t);return{type:e,offsetX:n,offsetY:s,clientX:r,clientY:o,currentX:a,currentY:l,sourceEvent:t}}function pi(e,t,i){return{type:e,sourceEvent:t}}var gi={blur:e=>({type:"blur",sourceEvent:e}),change:e=>({type:"change",sourceEvent:e}),contextmenu:(e,t)=>di("contextmenu",e,t),focus:e=>({type:"focus",sourceEvent:e}),keydown:e=>({type:"keydown",sourceEvent:e}),keyup:e=>({type:"keyup",sourceEvent:e}),click:(e,t)=>di("click",e,t),dblclick:(e,t)=>di("dblclick",e,t),mouseenter:(e,t)=>di("mouseenter",e,t),mousemove:(e,t)=>di("mousemove",e,t),mouseleave:(e,t)=>di("mouseleave",e,t),wheel:e=>{const{offsetX:t,offsetY:i,clientX:n,clientY:s}=e,r=0===e.deltaMode?.01:1;return{type:"wheel",offsetX:t,offsetY:i,clientX:n,clientY:s,deltaX:e.deltaX*r,deltaY:e.deltaY*r,sourceEvent:e}},touchstart:(e,t)=>pi("touchstart",e),touchmove:(e,t)=>pi("touchmove",e),touchend:(e,t)=>pi("touchend",e),touchcancel:(e,t)=>pi("touchcancel",e)},fi=class{static alloc(e,t,i){return gi[e](t,i)}static isHTMLEvent(e){return ui.includes(e)}static calcCurrentXY(e,t){const i=e.getBoundingClientRect();return{currentX:t.clientX-i.x,currentY:t.clientY-i.y}}},mi=class{constructor(){this.widgetListeners={},this.sourceListeners={}}initSourceHandler(e,t){this.sourceListeners??(this.sourceListeners={}),this.sourceListeners[e]=t}lazyGetWidgetListeners(e,t){var i;if(!(e in(this.sourceListeners??{}))){const i=i=>{const n=fi.alloc(e,i,t.getElement());for(const i of this.widgetListeners?.[e]??[])i(n,t)},n={};e.startsWith("touch")&&(n.passive=!1),this.initSourceHandler(e,i),t.getElement().addEventListener(e,i,n)}return this.widgetListeners??(this.widgetListeners={}),(i=this.widgetListeners)[e]??(i[e]=[]),this.widgetListeners[e]}add(e,t,i){this.lazyGetWidgetListeners(e,t).push(i)}remove(e,t,i){const n=this.lazyGetWidgetListeners(e,t),s=n.indexOf(i);s>-1&&n.splice(s,1)}destroy(e){for(const[t,i]of(0,n.jO)(this.sourceListeners??{}))e.getElement().removeEventListener(t,i);this.widgetListeners=void 0,this.sourceListeners=void 0}},yi=class{constructor(e,t,i,s){this.glob=e,this.self=t,this.window=(0,n.zk)(),this.mousegeneral=e=>{e.stopPropagation(),e.stopImmediatePropagation()},this.mousemove=e=>{e.stopPropagation(),e.stopImmediatePropagation(),this.glob.globalMouseDragCallbacks?.mousemove(e)},this.mouseup=e=>{0===e.button&&(e.stopPropagation(),e.stopImmediatePropagation(),this.glob.globalMouseDragCallbacks?.mouseup(e),this.destroy())};const{window:r,mousegeneral:o,mousemove:a,mouseup:l}=this;r.addEventListener("mousedown",o,{capture:!0}),r.addEventListener("mouseenter",o,{capture:!0}),r.addEventListener("mouseleave",o,{capture:!0}),r.addEventListener("mouseout",o,{capture:!0}),r.addEventListener("mouseover",o,{capture:!0}),r.addEventListener("mousemove",a,{capture:!0}),r.addEventListener("mouseup",l,{capture:!0}),t.mouseDragger=this,e.globalMouseDragCallbacks=i,e.globalMouseDragCallbacks.mousedown(s)}destroy(){const{window:e,mousegeneral:t,mousemove:i,mouseup:n}=this;e.removeEventListener("mousedown",t,{capture:!0}),e.removeEventListener("mouseenter",t,{capture:!0}),e.removeEventListener("mouseleave",t,{capture:!0}),e.removeEventListener("mouseout",t,{capture:!0}),e.removeEventListener("mouseover",t,{capture:!0}),e.removeEventListener("mousemove",i,{capture:!0}),e.removeEventListener("mouseup",n,{capture:!0}),this.glob.globalMouseDragCallbacks=void 0,this.self.mouseDragger=void 0}},vi=!1,bi=class{constructor(e,t,i,s,r){this.glob=e,this.self=t,this.initialTouch=s,this.target=r,this.longTapInterrupted=!1,this.longtap=()=>{const{target:e,initialTouch:t}=this;if(!this.longTapInterrupted){e.dispatchEvent(new TouchEvent("touchcancel",{touches:[t],bubbles:!0})),vi=!0;const i=e=>{e.preventDefault()},s=t=>{vi=!1,t.preventDefault(),e.removeEventListener("touchmove",i),e.removeEventListener("touchend",s),e.removeEventListener("touchcancel",s)};e.addEventListener("touchmove",i,{passive:!1}),e.addEventListener("touchend",s,{passive:!1}),e.addEventListener("touchcancel",s,{passive:!1});const{clientX:r,clientY:o}=t,a=new PointerEvent("contextmenu",{bubbles:!0,cancelable:!0,view:(0,n.zk)(),clientX:r,clientY:o,pointerType:"touch"});e.dispatchEvent(a)}},this.touchmove=e=>{const{glob:t,self:i,initialTouch:n}=this,s=this.findInitialFinger(e.targetTouches);null!=s&&(this.longTapInterrupted=this.longTapInterrupted||function(e,t){const i=e.clientX-t.clientX,n=e.clientY-t.clientY;return i*i+n*n}(n,s)>100,i.dragTouchEnabled&&null!=s&&t.globalTouchDragCallbacks?.touchmove(e,s))},this.touchend=e=>{this.longTapInterrupted=!0;const t=this.findInitialFinger(e.changedTouches,e.touches);null!=t&&this.glob.globalTouchDragCallbacks?.touchend(e,t),this.destroy()},this.longtapTimer=setTimeout(this.longtap,500);const{touchmove:o,touchend:a}=this;r.addEventListener("touchmove",o,{passive:!1}),r.addEventListener("touchstart",a,{passive:!1}),r.addEventListener("touchend",a,{passive:!1}),r.addEventListener("touchcancel",a,{passive:!1}),t.touchDragger=this,e.globalTouchDragCallbacks=i}destroy(){const{longtapTimer:e,touchmove:t,touchend:i}=this;clearTimeout(e),this.target.removeEventListener("touchstart",i),this.target.removeEventListener("touchmove",t),this.target.removeEventListener("touchend",i),this.target.removeEventListener("touchcancel",i),this.glob.globalTouchDragCallbacks=void 0,this.self.touchDragger=void 0}findInitialFinger(...e){const t=e.map(e=>Array.from(e)).flat();return Array.from(t).find(e=>e.identifier===this.initialTouch.identifier)}};function Ci(e,t,i,n){const{currentX:s,currentY:r}=fi.calcCurrentXY(e.getElement(),n),o=n.pageX-i.pageX,a=n.pageY-i.pageY;return{type:t,device:"mouse",offsetX:i.offsetX+o,offsetY:i.offsetY+a,clientX:n.clientX,clientY:n.clientY,currentX:s,currentY:r,originDeltaX:o,originDeltaY:a,sourceEvent:n}}function wi(e,{pageX:t,pageY:i}){const{x:n,y:s}=e.getElement().getBoundingClientRect();return{offsetX:t-n,offsetY:i-s}}function Si(e,t,i,n,s){const{currentX:r,currentY:o}=fi.calcCurrentXY(e.getElement(),s),a=s.pageX-i.pageX,l=s.pageY-i.pageY;return{type:t,device:"touch",offsetX:i.offsetX+a,offsetY:i.offsetY+l,clientX:s.clientX,clientY:s.clientY,currentX:r,currentY:o,originDeltaX:a,originDeltaY:l,sourceEvent:n}}var xi={},Ei=class{constructor(e){this.dispatchCallback=e,this.dragTouchEnabled=!0}destroy(){this.dragTriggerRemover?.(),this.dragTriggerRemover=void 0,this.listeners?.clear(),this.mouseDragger?.destroy(),this.touchDragger?.destroy()}getListenerSet(e){this.listeners??(this.listeners=new Map);let t=this.listeners.get(e);return void 0===t&&(t=new Set,this.listeners.set(e,t)),t}add(e,t,i){switch(this.getListenerSet(e).add(i),e){case"drag-start":case"drag-move":case"drag-end":this.registerDragTrigger(t)}}remove(e,t,i){this.getListenerSet(e).delete(i)}registerDragTrigger(e){if(null==this.dragTriggerRemover){const t=t=>this.triggerMouseDrag(e,t),i=t=>this.triggerTouchDrag(e,t);e.getElement().addEventListener("mousedown",t),e.getElement().addEventListener("touchstart",i,{passive:!1}),this.dragTriggerRemover=()=>{e.getElement().removeEventListener("mousedown",t),e.getElement().removeEventListener("touchstart",i)}}}triggerMouseDrag(e,t){0===t.button&&this.startMouseDrag(e,t)}startMouseDrag(e,t){const i={pageX:NaN,pageY:NaN,offsetX:NaN,offsetY:NaN};U(["pageX","pageY","offsetX","offsetY"],i,t);const n={mousedown:t=>{const n=Ci(e,"drag-start",i,t);this.dispatch("drag-start",e,n)},mousemove:t=>{const n=Ci(e,"drag-move",i,t);this.dispatch("drag-move",e,n)},mouseup:t=>{const n=Ci(e,"drag-end",i,t);this.dispatch("drag-end",e,n),this.endDrag(e,n)}};this.mouseDragger=function(e,t,i,n){if(null==e.globalMouseDragCallbacks)return new yi(e,t,i,n)}(xi,this,n,t)}endDrag(e,{sourceEvent:t,clientX:i,clientY:n}){const s=e.getElement(),r=s.getBoundingClientRect();h.containsPoint(r,i,n)||(s.dispatchEvent(new MouseEvent("mouseleave",t)),t.target?.dispatchEvent(new MouseEvent("mouseenter",t)))}triggerTouchDrag(e,t){const i=t.targetTouches[0];1===t.targetTouches.length&&null!=i&&this.startOneFingerTouch(e,t,i)}startOneFingerTouch(e,t,i){const n={pageX:NaN,pageY:NaN,...wi(e,i)};U(["pageX","pageY"],n,i);const s={touchmove:(t,i)=>{const s=Si(e,"drag-move",n,t,i);this.dispatch("drag-move",e,s)},touchend:(t,i)=>{const s=Si(e,"drag-end",n,t,i);this.dispatch("drag-end",e,s)}},r=e.getElement();this.touchDragger=function(e,t,i,n,s){if(null==e.globalTouchDragCallbacks&&!vi)return new bi(e,t,i,n,s)}(xi,this,s,i,r);const o=Si(e,"drag-start",n,t,i);this.dispatch("drag-start",e,o)}dispatch(e,t,i){for(const n of this.getListenerSet(e))n(i,t);this.dispatchCallback(e,i)}},Ai=class{constructor(e){this.elem=e}setBounds(e){kt(this.elemContainer??this.elem,e)}getBounds(){return Pt(this.elemContainer??this.elem)}static setElementContainer(e,t){kt(t,e.getBounds()),(0,n.Hs)(e.elem,{width:"100%",height:"100%"}),e.elem.remove(),e.elemContainer=t,e.elemContainer.replaceChildren(e.elem)}},Mi=class extends Ai{constructor(e){super(e),this.elem=e,this.index=NaN,this.children=[]}set id(e){(0,n.Bq)(this.elem,"id",e)}get id(){return(0,n.D$)(this.elem,"id")}getElement(){return this.elem}getBoundingClientRect(){return this.elem.getBoundingClientRect()}get clientWidth(){return this.elem.clientWidth}get clientHeight(){return this.elem.clientHeight}destroy(){this.parent?.removeChild(this),this.children.forEach(e=>{e.parent=void 0,e.destroy()}),this.children.length=0,this.destructor(),this.remove(),this.internalListener?.destroy(),this.htmlListener?.destroy(this)}remove(){this.elem.remove(),this.elemContainer?.remove()}setHidden(e){(0,n.EM)(this.elem,"display",e?"none":void 0)}isHidden(){return"none"===(0,n.zk)()?.getComputedStyle?.(this.elem).display}setCursor(e){(0,n.EM)(this.elem,"cursor",e)}setTextContent(e){this.elem.textContent=e??null}setAriaDescribedBy(e){(0,n.Bq)(this.elem,"aria-describedby",e)}setAriaHidden(e){(0,n.Bq)(this.elem,"aria-hidden",e)}setAriaLabel(e){(0,n.Bq)(this.elem,"aria-label",e)}setAriaExpanded(e){(0,n.Bq)(this.elem,"aria-expanded",e)}setAriaControls(e){(0,n.Bq)(this.elem,"aria-controls",e)}setAriaHasPopup(e){(0,n.Bq)(this.elem,"aria-haspopup",e)}setInnerHTML(e){this.elem.innerHTML=e}setPointerEvents(e){(0,n.EM)(this.elem,"pointer-events",e)}isDisabled(){return(0,n.D$)(this.elem,"aria-disabled",!1)}hasPopup(){const e=(0,n.D$)(this.elem,"aria-haspopup");return void 0!==e&&"false"!==e}parseFloat(e){return""===e?0:parseFloat(e)}cssLeft(){return this.parseFloat(this.elem.style.left)}cssTop(){return this.parseFloat(this.elem.style.top)}cssWidth(){return this.parseFloat(this.elem.style.width)}cssHeight(){return this.parseFloat(this.elem.style.height)}focus(e){this.elem.focus(e)}setFocusOverride(e){(0,n.Bq)(this.elem,"data-focus-override",e)}setPreventsDefault(e){(0,n.Bq)(this.elem,"data-preventdefault",e)}setTabIndex(e){(0,n.Bq)(this.elem,"tabindex",e)}addChild(e){this.addChildToDOM(e,this.getBefore(e)),this.children.push(e),e.index=this.children.length-1,e.parent=this,this.onChildAdded(e)}removeChild(e){const t=this.children.findIndex(t=>t===e);this.children.splice(t,1),this.removeChildFromDOM(e),this.onChildRemoved(e)}moveChild(e,t){e.domIndex!==t&&(e.domIndex=t,this.removeChildFromDOM(e),this.addChildToDOM(e,this.getBefore(e)))}addClass(...e){this.elem.classList.add(...e)}removeClass(...e){this.elem.classList.remove(...e)}toggleClass(e,t){this.elem.classList.toggle(e,t)}appendOrInsert(e,t){t?t.getElement().insertAdjacentElement("beforebegin",e):this.elem.appendChild(e)}addChildToDOM(e,t){this.appendOrInsert(e.getElement(),t)}removeChildFromDOM(e){this.elem.removeChild(e.getElement())}onChildAdded(e){}onChildRemoved(e){}getBefore({domIndex:e}){if(void 0!==e)return this.children.filter(t=>void 0!==t.domIndex&&t.domIndex>e).reduce((e,t)=>!e||t.domIndex<e.domIndex?t:e,void 0)}addListener(e,t){return fi.isHTMLEvent(e)?(this.htmlListener??(this.htmlListener=new mi),this.htmlListener.add(e,this,t)):(this.internalListener??(this.internalListener=new Ei(this.onDispatch.bind(this))),this.internalListener.add(e,this,t)),()=>this.removeListener(e,t)}removeListener(e,t){fi.isHTMLEvent(e)?this.htmlListener?.remove(e,this,t):null!=this.htmlListener&&this.internalListener?.remove(e,this,t)}setDragTouchEnabled(e){this.internalListener??(this.internalListener=new Ei(this.onDispatch.bind(this))),this.internalListener.dragTouchEnabled=e}onDispatch(e,t){if(!t.sourceEvent?.bubbles)return;let{parent:i}=this;for(;null!=i;){const{internalListener:n}=i;if(null!=n){const s={...t,...fi.calcCurrentXY(i.getElement(),t)};n.dispatch(e,i,s)}i=i.parent}}static addWindowEvent(e,t){const i=e=>{e.persisted||t()};return(0,n.zk)().addEventListener("pagehide",i),()=>(0,n.zk)().removeEventListener("pagehide",i)}},Ti=class{constructor(e=5){this.maxCacheSize=e,this.store=new Map}get(e){if(!this.store.has(e))return;const t=this.store.get(e);return this.store.delete(e),this.store.set(e,t),t}has(e){return this.store.has(e)}set(e,t){if(this.store.set(e,t),this.store.size>this.maxCacheSize){const e=this.store.keys();let t=this.store.size-this.maxCacheSize;for(;t>0;){const i=e.next();i.done||this.store.delete(i.value),t--}}return t}clear(){this.store.clear()}},Di=class{static measureText(e,t){return this.getMeasurer(t).measureText(e)}static measureLines(e,t){return this.getMeasurer(t).measureLines(e)}static getMeasurer(e){const t="string"==typeof e.font?e.font:Ri.toFontString(e.font),i=`${t}-${e.textAlign??"start"}-${e.textBaseline??"alphabetic"}`;return this.instanceMap.get(i)??this.createFontMeasurer(t,e,i)}static clear(){this.instanceMap.clear()}static createFontMeasurer(e,t,i){const n=function(e=0,t=0){return new OffscreenCanvas(e,t).getContext("2d")}();n.font=e,n.textAlign=t.textAlign??"start",n.textBaseline=t.textBaseline??"alphabetic";const s=new Ii(n,t);return this.instanceMap.set(i,s),s}};Di.instanceMap=new Ti(10);var Ii=class{constructor(e,t){this.ctx=e,this.measureMap=new Ti(100),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline),e.font="string"==typeof t.font?t.font:Ri.toFontString(t.font),this.textMeasurer=new ki(e=>this.cachedCtxMeasureText(e),t.textBaseline??"alphabetic")}textWidth(e,t){return this.textMeasurer.textWidth(e,t)}measureText(e){return this.textMeasurer.measureText(e)}measureLines(e){return this.textMeasurer.measureLines(e)}cachedCtxMeasureText(e){if(!this.measureMap.has(e)){const t=this.ctx.measureText(e);this.measureMap.set(e,{actualBoundingBoxAscent:t.actualBoundingBoxAscent,emHeightAscent:t.emHeightAscent,emHeightDescent:t.emHeightDescent,actualBoundingBoxDescent:t.actualBoundingBoxDescent,actualBoundingBoxLeft:t.actualBoundingBoxLeft,actualBoundingBoxRight:t.actualBoundingBoxRight,alphabeticBaseline:t.alphabeticBaseline,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent,hangingBaseline:t.hangingBaseline,ideographicBaseline:t.ideographicBaseline,width:t.width})}return this.measureMap.get(e)}},Ri=class{static toFontString({fontSize:e=10,fontStyle:t,fontWeight:i,fontFamily:n,lineHeight:s}){let r="";return t&&(r+=`${t} `),i&&(r+=`${i} `),r+=`${e}px`,s&&(r+=`/${s}px`),r+=` ${n}`,r.trim()}static getLineHeight(e){return Math.ceil(e*this.defaultLineHeight)}static getVerticalModifier(e){switch(e){case"hanging":case"top":return 0;case"middle":return.5;default:return 1}}};Ri.EllipsisChar="…",Ri.defaultLineHeight=1.15,Ri.lineSplitter=/\r?\n/g;var ki=class{constructor(e,t="alphabetic"){this.measureTextFn=e,this.textBaseline=t,this.charMap=new Map}getMetrics(e){const t=this.measureTextFn(e);return t.fontBoundingBoxAscent??(t.fontBoundingBoxAscent=t.emHeightAscent),t.fontBoundingBoxDescent??(t.fontBoundingBoxDescent=t.emHeightDescent),{width:t.width,height:t.actualBoundingBoxAscent+t.actualBoundingBoxDescent,lineHeight:t.fontBoundingBoxAscent+t.fontBoundingBoxDescent,offsetTop:t.actualBoundingBoxAscent,offsetLeft:t.actualBoundingBoxLeft}}getMultilineMetrics(e){let t=0,i=0,n=0,s=0,r=0;const o=Ri.getVerticalModifier(this.textBaseline),a=[];let l=0;const c=e.length;for(const o of e){const e=this.measureTextFn(o);e.fontBoundingBoxAscent??(e.fontBoundingBoxAscent=e.emHeightAscent),e.fontBoundingBoxDescent??(e.fontBoundingBoxDescent=e.emHeightDescent),t<e.width&&(t=e.width),s<e.actualBoundingBoxLeft&&(s=e.actualBoundingBoxLeft),0===l?(i+=e.actualBoundingBoxAscent,n+=e.actualBoundingBoxAscent):r+=e.fontBoundingBoxAscent,l===c-1?i+=e.actualBoundingBoxDescent:r+=e.fontBoundingBoxDescent,a.push({text:o,width:e.width,height:e.actualBoundingBoxAscent+e.actualBoundingBoxDescent,lineHeight:e.fontBoundingBoxAscent+e.fontBoundingBoxDescent,offsetTop:e.actualBoundingBoxAscent,offsetLeft:e.actualBoundingBoxLeft}),l++}return i+=r,n+=r*o,{width:t,height:i,offsetTop:n,offsetLeft:s,lineMetrics:a}}textWidth(e,t){if(t){let t=0;for(let i=0;i<e.length;i++)t+=this.textWidth(e.charAt(i));return t}return e.length>1?this.measureTextFn(e).width:this.charMap.get(e)??this.charWidth(e)}measureText(e){return this.getMetrics(e)}measureLines(e){const t="string"==typeof e?e.split(Ri.lineSplitter):e;return this.getMultilineMetrics(t)}charWidth(e){const{width:t}=this.measureTextFn(e);return this.charMap.set(e,t),t}},Pi=class e extends ut{constructor(){super(...arguments),this.x=0,this.y=0,this.lines=[],this.text=void 0,this.fontSize=10,this.fontFamily="sans-serif",this.textAlign=e.defaultStyles.textAlign,this.textBaseline=e.defaultStyles.textBaseline}onTextChange(){this.lines=this.text?.split("\n").map(e=>e.trim())??[]}static computeBBox(e,t,i,n){const{offsetTop:s,offsetLeft:r,width:o,height:a}=Di.measureLines(e,n),l=n.lineHeight?n.lineHeight*e.length:a;return new m(t-r,i-s,o,l)}computeBBox(){const{x:t,y:i,lines:n,textBaseline:s,textAlign:r,lineHeight:o}=this;return e.computeBBox(n,t,i,{font:this,textBaseline:s,textAlign:r,lineHeight:o})}getTextMeasureBBox(){return this.computeBBox()}isPointInPath(e,t){const i=this.getBBox();return!!i&&i.containsPoint(e,t)}render(e){const{ctx:t,stats:i}=e;if(!this.lines.length||!this.layerManager)return i&&(i.nodesSkipped+=1),super.render(e);const{fill:n,stroke:s,strokeWidth:r}=this,{globalAlpha:o}=t,{pixelRatio:a}=this.layerManager.canvas;if(!(n||null!=s&&r>0))return super.render(e);const l=Ri.toFontString(this);if(t.font!==l&&(t.font=l),t.textAlign=this.textAlign,t.textBaseline=this.textBaseline,n){this.applyFillAndAlpha(t);const{fillShadow:e}=this;e?.enabled&&(t.shadowColor=e.color,t.shadowOffsetX=e.xOffset*a,t.shadowOffsetY=e.yOffset*a,t.shadowBlur=e.blur*a),this.renderLines((e,i,n)=>t.fillText(e,i,n)),t.globalAlpha=o}if(s&&r){this.applyStrokeAndAlpha(t),t.lineWidth=r;const{lineDash:e,lineDashOffset:i,lineCap:n,lineJoin:s}=this;e&&t.setLineDash([...e]),i&&(t.lineDashOffset=i),n&&(t.lineCap=n),s&&(t.lineJoin=s),this.renderLines((e,i,n)=>t.strokeText(e,i,n)),t.globalAlpha=o}super.render(e)}renderLines(e){const{lines:t,x:i,y:n}=this,s=this.lineHeight??Ri.getLineHeight(this.fontSize);let r=(s-s*t.length)*Ri.getVerticalModifier(this.textBaseline);for(const o of t)e(o,i,n+r),r+=s}setFont(e){this.fontFamily=e.fontFamily,this.fontSize=e.fontSize,this.fontStyle=e.fontStyle,this.fontWeight=e.fontWeight}setAlign(e){this.textAlign=e.textAlign,this.textBaseline=e.textBaseline}toSVG(){if(!this.visible||!this.text)return;const e=(0,n.FJ)("text");return this.applySvgFillAttributes(e),e.setAttribute("font-family",this.fontFamily?.split(",")[0]??""),e.setAttribute("font-size",String(this.fontSize)),e.setAttribute("font-style",this.fontStyle??""),e.setAttribute("font-weight",String(this.fontWeight??"")),e.setAttribute("text-anchor",{center:"middle",left:"start",right:"end",start:"start",end:"end"}[this.textAlign??"start"]),e.setAttribute("alignment-baseline",{alphabetic:"alphabetic",top:"top",bottom:"bottom",hanging:"hanging",middle:"middle",ideographic:"ideographic"}[this.textBaseline??"alphabetic"]),e.setAttribute("x",String(this.x)),e.setAttribute("y",String(this.y)),e.textContent=this.text??"",{elements:[e]}}};Pi.className="Text",Pi.defaultStyles={...ut.defaultStyles,textAlign:"start",fontStyle:void 0,fontWeight:void 0,fontSize:10,fontFamily:"sans-serif",textBaseline:"alphabetic"},a([K()],Pi.prototype,"x",2),a([K()],Pi.prototype,"y",2),a([K({convertor:e=>(0,n.vM)(e)?String(e):e,changeCb:e=>e.onTextChange()})],Pi.prototype,"text",2),a([K()],Pi.prototype,"fontStyle",2),a([K()],Pi.prototype,"fontWeight",2),a([K()],Pi.prototype,"fontSize",2),a([K()],Pi.prototype,"fontFamily",2),a([K()],Pi.prototype,"textAlign",2),a([K()],Pi.prototype,"textBaseline",2),a([K()],Pi.prototype,"lineHeight",2);var _i=Pi,Li=class extends(vt(_i)){},Ni=class extends(vt(Ct(_i))){},Oi=class{static wrapText(e,t){return this.wrapLines(e,t).join("\n")}static wrapLines(e,t){const i=this.textWrap(e,t);return"hide"===t.overflow&&i.some(e=>e.endsWith(Ri.EllipsisChar))?[]:i}static appendEllipsis(e){return e.replace(/[.,]{1,5}$/,"")+Ri.EllipsisChar}static truncateLine(e,t,i,n){const s=t.textWidth(Ri.EllipsisChar);let r=0,o=0;for(;o<e.length;o++){const n=t.textWidth(e.charAt(o));if(r+n>i)break;r+=n}if(e.length===o&&(!n||r+s<=i))return n?e+Ri.EllipsisChar:e;for(e=e.slice(0,o).trimEnd();e.length&&t.textWidth(e)+s>i;)e=e.slice(0,-1).trimEnd();return e+Ri.EllipsisChar}static textWrap(e,t){const i=e.split(Ri.lineSplitter),n=Di.getMeasurer(t);if("never"===t.textWrap)return i.map(e=>this.truncateLine(e.trimEnd(),n,t.maxWidth));const s=[],r="hyphenate"===t.textWrap,o=null==t.textWrap||"on-space"===t.textWrap;for(const e of i){let i=e.trimEnd();if(""===i){s.push(i);continue}let a=0,l=0,c=0;for(;a<i.length;){const e=i.charAt(a);if(l+=n.textWidth(e)," "===e&&(c=a),l>t.maxWidth){if(0===a)break;const e=n.textWidth(i.slice(0,a+1));if(e<=t.maxWidth){l=e,a++;continue}if(c){const e=this.getWordAt(i,c+1),r=n.textWidth(e);if(r<=t.maxWidth){s.push(i.slice(0,c).trimEnd()),i=i.slice(c).trimStart(),a=0,l=0,c=0;continue}o&&r>t.maxWidth&&s.push(i.slice(0,c).trimEnd(),this.truncateLine(i.slice(c).trimStart(),n,t.maxWidth,!0))}else o&&s.push(this.truncateLine(i,n,t.maxWidth,!0));if(o){i="";break}const h=r?"-":"";let u=i.slice(0,a).trim();for(;u.length&&n.textWidth(u+h)>t.maxWidth;)u=u.slice(0,-1).trimEnd();if(s.push(u+h),!u.length){i="";break}i=i.slice(u.length).trimStart(),a=-1,l=0,c=0}a++}i&&s.push(i)}return this.avoidOrphans(s,n,t),this.clipLines(s,n,t)}static getWordAt(e,t){const i=e.indexOf(" ",t);return-1===i?e.slice(t):e.slice(t,i)}static clipLines(e,t,i){if(!i.maxHeight)return e;const{height:n,lineMetrics:s}=t.measureLines(e);if(n<=i.maxHeight)return e;for(let n=0,r=0;n<s.length;n++){const{lineHeight:o}=s[n];if(r+=o,r>i.maxHeight){if("hide"===i.overflow)return[];const s=e.slice(0,n||1),r=s.pop();return s.concat(this.truncateLine(r,t,i.maxWidth,!0))}}return e}static avoidOrphans(e,t,i){if(!1===i.avoidOrphans||e.length<2)return;const{length:n}=e,s=e[n-1],r=e[n-2];if(r.length<s.length)return;const o=r.lastIndexOf(" ");if(-1===o||o===r.indexOf(" ")||s.includes(" "))return;const a=r.slice(o+1);t.textWidth(s+a)<=i.maxWidth&&(e[n-2]=r.slice(0,o),e[n-1]=a+" "+s)}},Fi=class extends De{constructor(){super(...arguments),this.id=(0,n.sX)(this),this.node=new Li({zIndex:1}).setProperties({textAlign:"center",pointerEvents:1}),this.enabled=!1,this.textAlign="center",this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always",this.padding=0,this.layoutStyle="block",this.truncated=!1}registerInteraction(e,t){return e.layoutManager.addListener("layout:complete",()=>this.updateA11yText(e,t))}computeTextWrap(e,t){const{text:i,padding:n,wrapping:s}=this,r=Math.min(this.maxWidth??1/0,e)-2*n,o=this.maxHeight??t-2*n;if(!isFinite(r)&&!isFinite(o))return void(this.node.text=i);const a=Oi.wrapText(i??"",{maxWidth:r,maxHeight:o,font:this,textWrap:s});this.node.text=a,this.truncated=a.includes(Ri.EllipsisChar)}updateA11yText(e,t){const{proxyInteractionService:i}=e;if(this.enabled&&this.text){const n=St.toCanvas(this.node);if(n){const{id:s}=this;this.proxyText??(this.proxyText=i.createProxyElement({type:"text",domManagerId:s,where:t})),this.proxyText.textContent=this.text,this.proxyText.setBounds(n),this.proxyText.addListener("mousemove",t=>this.handleMouseMove(e,t)),this.proxyText.addListener("mouseleave",t=>this.handleMouseLeave(e,t))}}else this.proxyText?.destroy(),this.proxyText=void 0}handleMouseMove(e,t){if(null!=t&&this.enabled&&this.node.visible&&this.truncated){const{x:i,y:n}=St.toCanvas(this.node),s=t.sourceEvent.offsetX+i,r=t.sourceEvent.offsetY+n;e.tooltipManager.updateTooltip(this.id,{canvasX:s,canvasY:r,showArrow:!1},[{type:"structured",title:this.text}])}}handleMouseLeave(e,t){e.tooltipManager.removeTooltip(this.id)}};Fi.SMALL_PADDING=10,a([Te,ai("node","visible")],Fi.prototype,"enabled",2),a([Te,ai("node")],Fi.prototype,"text",2),a([Te,ai("node")],Fi.prototype,"textAlign",2),a([Te,ai("node")],Fi.prototype,"fontStyle",2),a([Te,ai("node")],Fi.prototype,"fontWeight",2),a([Te,ai("node")],Fi.prototype,"fontSize",2),a([Te,ai("node")],Fi.prototype,"fontFamily",2),a([Te,ai("node","fill")],Fi.prototype,"color",2),a([Te],Fi.prototype,"spacing",2),a([Te],Fi.prototype,"maxWidth",2),a([Te],Fi.prototype,"maxHeight",2),a([Te],Fi.prototype,"wrapping",2),a([Te],Fi.prototype,"padding",2),a([Te],Fi.prototype,"layoutStyle",2);var Gi=(e=>(e.X="x",e.Y="y",e.Angle="angle",e.Radius="radius",e))(Gi||{});function Bi(e){switch(e){case"x":case"y":case"angle":case"radius":return!0;default:return!1}}var Vi=(e=>(e[e.Caption=0]="Caption",e[e.Legend=1]="Legend",e[e.ToolbarLeft=2]="ToolbarLeft",e[e.ToolbarBottom=3]="ToolbarBottom",e[e.Navigator=4]="Navigator",e[e.Overlay=5]="Overlay",e))(Vi||{}),Hi=class{constructor(){this.events=new n.bk,this.elements=new Map}addListener(e,t){return this.events.on(e,t)}registerElement(e,t){return this.elements.has(e)?this.elements.get(e).add(t):this.elements.set(e,new Set([t])),()=>this.elements.get(e)?.delete(t)}createContext(e,t){const i=new Ui(e,t);for(const e of Object.values(Vi))"number"==typeof e&&this.elements.get(e)?.forEach(e=>e(i));return i}emitLayoutComplete(e,t){const i="layout:complete",{width:n,height:s}=e;this.events.emit(i,{type:i,axes:t.axes??[],chart:{width:n,height:s},clipSeries:t.clipSeries??!1,series:t.series})}},Ui=class{constructor(e,t){this.width=e,this.height=t,this.layoutBox=new m(0,0,e,t)}},zi=class{constructor(){this.title=new Fi,this.subtitle=new Fi,this.footnote=new Fi}positionCaptions(e){const{title:t,subtitle:i,footnote:n}=this,s=e.layoutBox.height/10;if(t.enabled){const{spacing:i}=t;this.positionCaption("top",t,e.layoutBox,s),this.shrinkLayoutByCaption("top",t,e.layoutBox,i)}i.enabled&&(this.positionCaption("top",i,e.layoutBox,s),this.shrinkLayoutByCaption("top",i,e.layoutBox,i.spacing)),n.enabled&&(this.positionCaption("bottom",n,e.layoutBox,s),this.shrinkLayoutByCaption("bottom",n,e.layoutBox,n.spacing))}positionAbsoluteCaptions(e){const{title:t,subtitle:i,footnote:n}=this,{rect:s}=e.series;for(const e of[t,i,n])if("overlay"===e.layoutStyle)if("left"===e.textAlign)e.node.x=s.x+e.padding;else if("right"===e.textAlign){const t=e.node.getBBox();e.node.x=s.x+s.width-t.width-e.padding}}computeX(e,t){return"left"===e?t.x:"right"===e?t.x+t.width:t.x+t.width/2}positionCaption(e,t,i,n){const s=Math.max(Ri.getLineHeight(t.fontSize),n);t.node.x=this.computeX(t.textAlign,i)+t.padding,t.node.y=i.y+("top"===e?0:i.height)+t.padding,t.node.textBaseline=e,t.computeTextWrap(i.width,s)}shrinkLayoutByCaption(e,t,i,n=0){if("block"===t.layoutStyle){const s=t.node.getTextMeasureBBox();i.shrink("top"===e?Math.ceil(s.y-i.y+s.height+n):Math.ceil(i.y+i.height-s.y+n),e)}}};a([Te],zi.prototype,"title",2),a([Te],zi.prototype,"subtitle",2),a([Te],zi.prototype,"footnote",2);var Wi=["candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"],ji=class{constructor(e){this.chartService=e,this.mementoOriginatorKey="chartType"}createMemento(){let e=this.chartService.publicApi?.getOptions()?.chartType;return null==e&&(e="candlestick"),e}guardMemento(e){return null==e||Wi.includes(e)}restoreMemento(e,t,i){if(null==i)return;const s={chartType:i};this.chartService.publicApi?.updateDelta(s).catch(e=>n.Vy.error("error restoring state",e))}},$i=class{constructor(){this.destroyFns=[]}destroy(){this.destroyFns.forEach(e=>e()),this.destroyFns.length=0}setFns(e){this.destroy(),this.destroyFns=e}push(...e){this.destroyFns.push(...e)}},Ki="11.3.2",Yi=Symbol("previous-memento-not-found"),qi=class{constructor(e){this.history=[],this.historyIndex=-1,this.originators=new Map,this.clearState=new Map,this.maxHistoryLength=100,this.debug=v.create(!0,"history"),this.destroyFns=new $i,this.destroyFns.setFns([e.addListener("series-undo",this.undo.bind(this)),e.addListener("series-redo",this.redo.bind(this))])}destroy(){this.destroyFns.destroy()}addMementoOriginator(e){this.originators.set(e.mementoOriginatorKey,e),this.clearState.set(e.mementoOriginatorKey,e.createMemento()),this.debugEvent("History add originator:",e.mementoOriginatorKey)}clear(){this.debug("History clear:",Object.keys(this.originators)),this.history=[],this.historyIndex=-1;for(const[e,t]of this.originators.entries())this.clearState.set(e,t.createMemento())}record(e,...t){this.historyIndex<this.history.length-1&&(this.history=this.history.slice(0,this.historyIndex+1)),this.history.length>this.maxHistoryLength&&(this.history=this.history.slice(-this.maxHistoryLength));const i=new Map;for(const e of t){if(!this.originators.has(e.mementoOriginatorKey))throw new Error(`Originator [${e.mementoOriginatorKey}] has not been added to the HistoryManager.`);i.set(e.mementoOriginatorKey,e.createMemento())}this.history.push({label:e,mementos:i}),this.historyIndex=this.history.length-1,this.debugEvent(`History record: [${e}]`)}undo(){const e=this.history[this.historyIndex];if(e){for(const t of e.mementos.keys()){const e=this.findPreviousMemento(t);if(e===Yi)throw new Error(`Could not find previous memento for [${t}].`);this.restoreMemento(t,e)}this.historyIndex-=1,this.debugEvent(`History undo: [${e.label}]`)}}redo(){const e=this.history[this.historyIndex+1];if(e){for(const[t,i]of e.mementos.entries())this.restoreMemento(t,i);this.historyIndex+=1,this.debugEvent(`History redo: [${e.label}]`)}}findPreviousMemento(e){for(let t=this.historyIndex-1;t>=0;t--)if(this.history[t].mementos.has(e))return this.history[t].mementos.get(e);return this.clearState.has(e)?this.clearState.get(e):Yi}restoreMemento(e,t){this.originators.get(e)?.restoreMemento(Ki,Ki,t)}debugEvent(...e){this.debug(...e,this.history.map((e,t)=>t===this.historyIndex?`** ${e.label} **`:e.label))}},Xi=class e{constructor(e){this.version=e.split("-")[0]}save(...e){const t={version:this.version};for(const i of Object.values(e))t[i.mementoOriginatorKey]=this.encode(i,i.createMemento());return t}restore(e,...t){if("object"==typeof e)if(null!=e)if("version"in e&&"string"==typeof e.version)for(const i of t){const t=this.decode(i,e[i.mementoOriginatorKey]),s=[];if(!i.guardMemento(t,s)){const e=s.length>0?`\n\n${s.join("\n\n")}\n\n`:"";return void n.Vy.warnOnce(`Could not restore [${i.mementoOriginatorKey}] data, value was invalid, ignoring.${e}`,t)}i.restoreMemento(this.version,e.version,t)}else n.Vy.warnOnce("Could not restore data, missing [version] string in object, ignoring.");else n.Vy.warnOnce("Could not restore data of type [null], expecting an object, ignoring.");else n.Vy.warnOnce(`Could not restore data of type [${typeof e}], expecting an object, ignoring.`)}encode(t,i){try{return JSON.parse(JSON.stringify(i,e.encodeTypes))}catch(e){throw new Error(`Failed to encode [${t.mementoOriginatorKey}] value [${e}].`,{cause:e})}}decode(t,i){if(null==i)return i;try{return JSON.parse(JSON.stringify(i),e.decodeTypes)}catch(e){throw new Error(`Failed to decode [${t.mementoOriginatorKey}] value [${e}].`,{cause:e})}}static encodeTypes(e,t){return(0,n.$P)(this[e])?{__type:"date",value:this[e].toISOString()}:t}static decodeTypes(e,t){return(0,n.Gv)(this[e])&&"__type"in this[e]&&"date"===this[e].__type?new Date(this[e].value):t}},Zi=class{constructor(){this.caretaker=new Xi(Ki),this.state=new Map}setState(e,t){P(this.state.get(e.mementoOriginatorKey),t)||this.setStateAndRestore(e,t)}setStateAndRestore(e,t){this.state.set(e.mementoOriginatorKey,t),this.restoreState(e)}restoreState(e){const{caretaker:t,state:i}=this;if(!i.has(e.mementoOriginatorKey))return;const n=i.get(e.mementoOriginatorKey);t.restore({version:t.version,[e.mementoOriginatorKey]:n},e)}},Qi=class{constructor(){this.registeredListeners=new Map}addListener(e,t){const i={symbol:Symbol(e),handler:t};return this.registeredListeners.has(e)?this.registeredListeners.get(e).push(i):this.registeredListeners.set(e,[i]),()=>this.removeListener(i.symbol)}removeListener(e){for(const[t,i]of this.registeredListeners.entries()){const n=i.findIndex(t=>t.symbol===e);if(n>=0){i.splice(n,1),0===i.length&&this.registeredListeners.delete(t);break}}}dispatch(e,...t){for(const i of this.getListenersByType(e))try{i.handler(...t)}catch(e){n.Vy.errorOnce(e)}}getListenersByType(e){return this.registeredListeners.get(e)??[]}destroy(){this.registeredListeners.clear()}},Ji=class{constructor(){this.listeners=new Qi,this.destroyFns=[],this.destroyed=!1}addListener(e,t){return this.listeners.addListener(e,t)}destroy(){this.listeners.destroy(),this.destroyFns.forEach(e=>e()),this.destroyed=!0}},en=class e{constructor(e,t,i){this.element=e,this.topTabGuard=t,this.bottomTabGuard=i,this.destroyFns=[],this.guardTabIndex=0,this.hasFocus=!1,this.initTabGuard(this.topTabGuard,e=>this.onTab(e,!1)),this.initTabGuard(this.bottomTabGuard,e=>this.onTab(e,!0)),this.element.addEventListener("focus",()=>this.onFocus(),{capture:!0}),this.element.addEventListener("blur",e=>this.onBlur(e),{capture:!0})}set tabIndex(e){this.guardTabIndex=e,0===this.guardTabIndex?this.setGuardIndices(void 0):this.hasFocus||this.setGuardIndices(this.guardTabIndex)}destroy(){for(const e of this.destroyFns)e();this.destroyFns.length=0}initTabGuard(e,t){const i=()=>t(e);e.addEventListener("focus",i),this.destroyFns.push(()=>e.removeEventListener("focus",i))}setGuardIndices(e){const t=e;(0,n.Bq)(this.topTabGuard,"tabindex",t),(0,n.Bq)(this.bottomTabGuard,"tabindex",t)}onFocus(){this.hasFocus=!0,0!==this.guardTabIndex&&this.setGuardIndices(0)}onBlur({relatedTarget:e}){const{topTabGuard:t,bottomTabGuard:i}=this;this.hasFocus=!1,0!==this.guardTabIndex&&e!==t&&e!==i&&this.setGuardIndices(this.guardTabIndex)}onTab(e,t){if(0!==this.guardTabIndex){let i;0===e.tabIndex?(i=this.findExitTarget(!t),this.setGuardIndices(this.guardTabIndex)):i=this.findEnterTarget(t),i?.focus()}}static queryFocusable(e,t){const i=(0,n.zk)();return Array.from(e.querySelectorAll(t)).filter(e=>{if(e instanceof HTMLElement){const t=i.getComputedStyle(e);return"none"!==t.display&&"none"!==t.visibility}return!1})}findEnterTarget(t){const i=e.queryFocusable(this.element,'[tabindex="0"]');return i[t?i.length-1:0]}findExitTarget(t){const i=e.queryFocusable((0,n.YE)(),"[tabindex]").filter(e=>e.tabIndex>0).sort((e,t)=>e.tabIndex-t.tabIndex),{before:s,after:r}=e.findBeforeAndAfter(i,this.guardTabIndex);return t?s:r}static findBeforeAndAfter(e,t){let i,n,s=0,r=e.length-1;for(;s<=r;){const o=Math.floor((s+r)/2),a=e[o].tabIndex;if(a===t){i=e[o-1]||void 0,n=e[o+1]||void 0;break}a<t?(i=e[o],s=o+1):(n=e[o],r=o-1)}return{before:i,after:n}}};function tn(e,t,i,n,s){t.addEventListener(i,n);const r=()=>t.removeEventListener(i,n,s);return e.push(r),r}function nn(e,t,i,n=["Escape"]){tn(e,t,"keydown",e=>{cn(e,...n)&&i(e)})}function sn(e,t,i){const n=tn(e,window,"mousedown",e=>{[0,2].includes(e.button)&&!on(t,e)&&(i(),n())});return n}function rn(e,t,i){const n=tn(e,window,"touchstart",e=>{Array.from(e.targetTouches).some(e=>!on(t,e))&&(i(),n())});return n}function on(e,t){return t.target instanceof Node&&e.contains(t.target)}function an(e,t,i,s){i.forEach(e=>(0,n.Bq)(e,"data-focus-visible-override",s)),tn(e,t,"keydown",()=>{i.forEach(e=>(0,n.Bq)(e,"data-focus-visible-override",!0))},{once:!0})}function ln(e){return!(e.shiftKey||e.altKey||e.ctrlKey||e.metaKey)}function cn(e,...t){return ln(e)&&t.some(t=>e.key===t)}function hn(e,t,i,n){i&&tn(e,t,"keydown",e=>{cn(e,n)&&i.focus()})}function un(e,t,i,n,s,r){hn(e,t,s,r),hn(e,t,i,n),tn(e,t,"keydown",e=>{cn(e,n,r)&&e.preventDefault()})}var dn={horizontal:{nextKey:"ArrowRight",prevKey:"ArrowLeft"},vertical:{nextKey:"ArrowDown",prevKey:"ArrowUp"}};function pn(e){const{orientation:t,buttons:i,wrapAround:n=!1,onEscape:s,onFocus:r,onBlur:o}=e,{nextKey:a,prevKey:l}=dn[t],c=e=>{e.target&&"tabIndex"in e.target&&(i.forEach(e=>e.tabIndex=-1),e.target.tabIndex=0)},[h,u]=n?[i.length,i.length]:[0,1/0],d=[];for(let e=0;e<i.length;e++){const t=i[(h+e-1)%u],n=i[e],p=i[(h+e+1)%u];tn(d,n,"focus",c),r&&tn(d,n,"focus",r),o&&tn(d,n,"blur",o),s&&nn(d,n,s),un(d,n,p,a,t,l),n.tabIndex=0===e?0:-1}return d}var gn=class{constructor(e,t,i){this.lastFocus=t,this.closeCallback=i,this.destroyFns=[],this.destroyFns.push(sn(this.destroyFns,e,()=>this.close(!0))),this.destroyFns.push(rn(this.destroyFns,e,()=>this.close(!0)))}close(e){this.destroyFns.forEach(e=>e()),this.destroyFns.length=0,this.closeCallback(),this.finishClosing(e)}finishClosing(e){this.destroyFns.forEach(e=>e()),this.destroyFns.length=0,(0,n.Bq)(this.lastFocus,"aria-expanded",!1),e||this.lastFocus?.focus({preventScroll:!0}),this.lastFocus=void 0}};function fn(e){const{sourceEvent:t,orientation:i,menu:s,buttons:r,closeCallback:o,overrideFocusVisible:a}=e,{nextKey:l,prevKey:c}=dn[i],h=vn(t);(0,n.Bq)(h,"aria-expanded",!0);const u=new gn(s,h,o),d=()=>u.close(),{destroyFns:p}=u;return s.role="menu",s.ariaOrientation=i,p.push(...pn({orientation:i,buttons:r,onEscape:d,wrapAround:!0})),s.tabIndex=-1,nn(p,s,d),tn(p,s,"keydown",e=>{e.target!==s||e.key!==l&&e.key!==c||(e.preventDefault(),r[0]?.focus())}),r[0]?.focus({preventScroll:!0}),void 0!==a&&an(p,s,r,a),u}function mn(e,t){return i=>{if("true"===e.ariaDisabled)return i.preventDefault();t(i)}}function yn(e){return"button"in e?0===e.button:ln(e)&&("Space"===e.code||"Enter"===e.key)}function vn(e){if(e?.target instanceof HTMLElement&&"tabindex"in e.target.attributes)return e.target}function bn(e){const t=e=>{e.defaultPrevented||(0,n.D$)(e.target,"data-preventdefault",!0)&&cn(e,"ArrowRight","ArrowLeft","ArrowDown","ArrowUp")&&e.preventDefault()};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}var Cn=class{constructor(e){this.callback=e,this.devicePixelRatio=(0,n.zk)("devicePixelRatio")??1,this.devicePixelRatioMediaQuery=void 0,this.devicePixelRatioListener=e=>{e.matches||(this.devicePixelRatio=(0,n.zk)("devicePixelRatio")??1,this.unregisterDevicePixelRatioListener(),this.registerDevicePixelRatioListener(),this.callback(this.pixelRatio))}}get pixelRatio(){return this.devicePixelRatio}observe(){this.registerDevicePixelRatioListener()}disconnect(){this.unregisterDevicePixelRatioListener()}unregisterDevicePixelRatioListener(){this.devicePixelRatioMediaQuery?.removeEventListener("change",this.devicePixelRatioListener),this.devicePixelRatioMediaQuery=void 0}registerDevicePixelRatioListener(){const e=(0,n.zk)("matchMedia")?.(`(resolution: ${this.pixelRatio}dppx)`);e?.addEventListener("change",this.devicePixelRatioListener),this.devicePixelRatioMediaQuery=e}},wn=class{constructor(){let e;this.elements=new Map,this.documentReady=!1,this.queuedObserveRequests=[],this.onLoad=()=>{this.documentReady=!0,this.queuedObserveRequests.forEach(([e,t])=>this.observe(e,t)),this.queuedObserveRequests=[],this.observeWindow()},"undefined"!=typeof ResizeObserver&&(this.resizeObserver=new ResizeObserver(e=>{for(const{target:t,contentRect:{width:i,height:n}}of e){const e=this.elements.get(t);this.checkSize(e,t,i,n)}})),this.pixelRatioObserver=new Cn(()=>{clearTimeout(e),e=setTimeout(()=>this.checkPixelRatio(),0)}),this.documentReady="complete"===(0,n.YE)("readyState"),this.documentReady?this.observeWindow():(0,n.zk)()?.addEventListener("load",this.onLoad)}destroy(){(0,n.zk)()?.removeEventListener("load",this.onLoad),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.pixelRatioObserver?.disconnect(),this.pixelRatioObserver=void 0}observeWindow(){this.pixelRatioObserver?.observe()}checkPixelRatio(){const e=this.pixelRatioObserver?.pixelRatio??1;for(const[t,i]of this.elements)if(null!=i.size&&i.size.pixelRatio!==e){const{width:n,height:s}=i.size;i.size={width:n,height:s,pixelRatio:e},i.cb(i.size,t)}}checkSize(e,t,i,n){if(e&&(i!==e.size?.width||n!==e.size?.height)){const s=this.pixelRatioObserver?.pixelRatio??1;e.size={width:i,height:n,pixelRatio:s},e.cb(e.size,t)}}observe(e,t){if(!this.documentReady)return void this.queuedObserveRequests.push([e,t]);this.elements.has(e)?this.removeFromQueue(e):this.resizeObserver?.observe(e);const i={cb:t};this.elements.set(e,i)}unobserve(e){this.resizeObserver?.unobserve(e),this.elements.delete(e),this.removeFromQueue(e),this.elements.size||this.destroy()}removeFromQueue(e){this.queuedObserveRequests=this.queuedObserveRequests.filter(([t])=>t!==e)}},Sn=class extends Map{constructor(e,t){super(),this.defaultValue=e,this.defaultState=t}set(e,t){return this.delete(e),void 0!==t&&super.set(e,t),this}stateId(){return Array.from(this.keys()).pop()??this.defaultState}stateValue(){return Array.from(this.values()).pop()??this.defaultValue}},xn=["styles","canvas","canvas-center","canvas-container","canvas-overlay","canvas-proxy","series-area","tooltip-container"],En=new Set(["canvas-container","canvas","tooltip-container"]),An=new Map([["styles",{childElementType:"style"}],["canvas",{childElementType:"canvas"}],["canvas-proxy",{childElementType:"div"}],["canvas-overlay",{childElementType:"div"}],["canvas-center",{childElementType:"div"}],["series-area",{childElementType:"div"}],["tooltip-container",{childElementType:"div"}]]),Mn={x:0,y:0,width:0,height:0,top:0,bottom:0,left:0,right:0,toJSON:()=>Mn};function Tn(e,t){const i=(0,n.n)("div");return i.className="ag-charts-tab-guard",e.insertAdjacentElement(t,i),i}var Dn=class e extends Ji{constructor(e,t,i,s="normal"){super(),this.chart=e,this.styleContainer=i,this.mode=s,this.anchorName=`--${(0,n.sX)(this)}`,this.styles=new Map,this.pendingContainer=void 0,this.container=void 0,this.documentRoot=void 0,this.initiallyConnected=void 0,this.containerSize=void 0,this.sizeMonitor=new wn,this.cursorState=new Sn("default"),this.minWidth=0,this.minHeight=0,this.element=this.initDOM(),this.rootElements=this.initRootElements(),this.rootElements.canvas.element.style.setProperty("anchor-name",this.anchorName);let r=!1;if(this.observer=function(e,t){if("undefined"==typeof IntersectionObserver)return;const i=new IntersectionObserver(i=>{for(const n of i)n.target===e&&t(n.intersectionRatio)},{root:e});return i.observe(e),i}(this.element,e=>{0!==e||r||this.listeners.dispatch("hidden",{type:"hidden"}),r=0===e}),this.setSizeOptions(),this.updateContainerSize(),this.addStyles("ag-charts-community",'.ag-charts-wrapper,.ag-charts-wrapper:after,.ag-charts-wrapper:before,.ag-charts-wrapper *,.ag-charts-wrapper *:after,.ag-charts-wrapper *:before{box-sizing:border-box}.ag-charts-wrapper{--align-items: center;--justify-content: center;position:relative;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.ag-charts-wrapper--safe-horizontal{--justify-content: flex-start}.ag-charts-wrapper--safe-vertical{--align-items: flex-start}.ag-charts-tab-guard{width:0%;height:0%;position:absolute;pointer-events:none}.ag-charts-canvas-center{width:100%;height:100%;position:absolute;touch-action:auto;pointer-events:auto;display:flex;align-items:var(--align-items);justify-content:var(--justify-content)}.ag-charts-canvas-container,.ag-charts-canvas{position:relative;user-select:none;-webkit-user-select:none}.ag-charts-canvas-container>*,.ag-charts-canvas>*{pointer-events:none}.ag-charts-canvas canvas{display:block}.ag-charts-series-area{outline:none;pointer-events:auto;position:absolute}.ag-charts-swapchain{top:0;left:0;outline:none;opacity:0;pointer-events:none;position:absolute;width:100%;height:100%}.ag-charts-swapchain:focus-visible{opacity:1}.ag-charts-canvas-proxy,.ag-charts-canvas-overlay{inset:0;pointer-events:none;position:absolute;user-select:none;-webkit-user-select:none}.ag-charts-canvas-overlay>*{position:absolute;pointer-events:auto}.ag-charts-theme-default,.ag-charts-theme-default-dark{--ag-charts-accent-color: #2196f3;--ag-charts-background-color: #fff;--ag-charts-border-color: #dddddd;--ag-charts-foreground-color: #464646;--ag-charts-font-family: Verdana, sans-serif;--ag-charts-font-size: 12px;--ag-charts-font-weight: 400;--ag-charts-padding: 20px;--ag-charts-shadow-color: #00000080;--ag-charts-subtle-text-color: #8c8c8c;--ag-charts-text-color: #464646;--ag-charts-chrome-background-color: #fafafa;--ag-charts-chrome-font-family: Verdana, sans-serif;--ag-charts-chrome-font-size: 12px;--ag-charts-chrome-font-weight: 400;--ag-charts-chrome-subtle-text-color: #8c8c8c;--ag-charts-chrome-text-color: #181d1f;--ag-charts-input-background-color: #fff;--ag-charts-input-text-color: #464646;--ag-charts-crosshair-label-background-color: #fff;--ag-charts-crosshair-label-text-color: #464646;--ag-charts-spacing: 4px;--ag-charts-border-radius: 4px;--ag-charts-icon-size: 16px;--ag-charts-shadow: 0 2px 8px 0 color-mix(in srgb, black 8%, transparent);--ag-charts-focus-shadow: 0 0 0 3px var(--ag-charts-accent-color);--ag-charts-focus-color: color-mix(in srgb, var(--ag-charts-background-color), var(--ag-charts-accent-color) 12%);--ag-charts-input-border-color: var(--ag-charts-border-color);--ag-charts-input-border-radius: var(--ag-charts-border-radius);--ag-charts-input-focus-border-color: var(--ag-charts-accent-color);--ag-charts-input-focus-text-color: var(--ag-charts-accent-color);--ag-charts-input-disabled-background-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-foreground-color) 6% );--ag-charts-input-disabled-border-color: var(--ag-charts-border-color);--ag-charts-input-disabled-text-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-input-text-color) 50% );--ag-charts-input-placeholder-text-color: color-mix( in srgb, var(--ag-charts-input-background-color), var(--ag-charts-input-text-color) 60% );--ag-charts-button-background-color: var(--ag-charts-background-color);--ag-charts-button-border-color: var(--ag-charts-border-color);--ag-charts-button-border-radius: var(--ag-charts-border-radius);--ag-charts-button-text-color: var(--ag-charts-text-color);--ag-charts-button-focus-background-color: color-mix( in srgb, var(--ag-charts-button-background-color), var(--ag-charts-accent-color) 12% );--ag-charts-button-focus-border-color: var(--ag-charts-accent-color);--ag-charts-button-focus-text-color: var(--ag-charts-accent-color);--ag-charts-button-disabled-background-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-foreground-color) 6% );--ag-charts-button-disabled-border-color: var(--ag-charts-border-color);--ag-charts-button-disabled-text-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-chrome-text-color) 50% );--ag-charts-checkbox-background-color: color-mix( in srgb, var(--ag-charts-background-color), var(--ag-charts-foreground-color) 35% );--ag-charts-checkbox-checked-background-color: var(--ag-charts-accent-color);--ag-charts-chrome-font-size-small: var(--ag-charts-chrome-font-size);--ag-charts-chrome-font-size-medium: calc(var(--ag-charts-chrome-font-size) * (13 / 12));--ag-charts-chrome-font-size-large: calc(var(--ag-charts-chrome-font-size) * (14 / 12));--ag-charts-border: solid 1px var(--ag-charts-border-color);--ag-charts-focus-border: solid 1px var(--ag-charts-accent-color);--ag-charts-focus-border-shadow: 0 0 0 3px color-mix(in srgb, transparent, var(--ag-charts-accent-color) 20%);--ag-charts-layer-menu: 6;--ag-charts-layer-ui-overlay: 5;--ag-charts-layer-tooltip: 4;--ag-charts-layer-toolbar: 3;--ag-charts-layer-crosshair: 2;--ag-charts-layer-annotations: 1}.ag-charts-theme-default-dark{--ag-charts-shadow: 0 2px 12px 0 color-mix(in srgb, black 33.3%, transparent);--ag-charts-focus-color: color-mix(in srgb, var(--ag-charts-background-color), var(--ag-charts-accent-color) 22%)}.ag-chart-canvas-wrapper .ag-charts-theme-default{--ag-charts-border-radius: var(--ag-border-radius, 4px);--ag-charts-border: var(--ag-borders-critical, solid 1px) var(--ag-charts-border-color);--ag-charts-focus-shadow: var(--ag-focus-shadow, 0 0 0 3px var(--ag-charts-accent-color));--ag-charts-focus-border-shadow: var( --ag-focus-shadow, 0 0 0 3px color-mix(in srgb, transparent, var(--ag-charts-accent-color) 20%) )}.ag-charts-icon{display:block;width:20px;height:20px;speak:none;speak:never;mask:var(--icon) center / contain no-repeat;background-color:currentColor;transition:background-color .25s ease-in-out}.ag-charts-icon-align-center{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNNyAxMGg2djFIN3pNNCA3aDEydjFINHptMSA2aDEwdjFINXoiLz48L3N2Zz4=)}.ag-charts-icon-align-left{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNNCAxMGg2djFINHptMC0zaDEydjFINHptMCA2aDEwdjFINHoiLz48L3N2Zz4=)}.ag-charts-icon-align-right{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMTAgMTBoNnYxaC02ek00IDdoMTJ2MUg0em0yIDZoMTB2MUg2eiIvPjwvc3ZnPg==)}.ag-charts-icon-arrow-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTE1LjI5MyA0LjVIMTIuNXYtMUgxN3Y0aC0xVjUuMjA3bC05LjY0NiA5LjY0Ny0uNzA4LS43MDh6IiBmaWxsPSIjMDAwIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03IDE2YTIuNSAyLjUgMCAxIDEtNSAwIDIuNSAyLjUgMCAwIDEgNSAwbS0yLjUgMS41YTEuNSAxLjUgMCAxIDAgMC0zIDEuNSAxLjUgMCAwIDAgMCAzIiBmaWxsPSIjMDAwIi8+PC9zdmc+)}.ag-charts-icon-arrow-down-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02IDhMMS41IDhMMTAgMThMMTguNSA4TDE0IDhMMTQgM0w2IDNMNiA4Wk03IDRMNyA5SDMuNjYyNDRMMTAgMTYuNDU2TDE2LjMzNzYgOUwxMyA5TDEzIDRMNyA0WiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-arrow-up-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNCAxMkgxOC41TDEwIDJMMS41IDEySDZMNi4wMDAwMiAxN0gxNFYxMlpNMTMgMTZWMTFIMTYuMzM3NkwxMCAzLjU0NDA1TDMuNjYyNDQgMTFIN0w3LjAwMDAyIDE2SDEzWiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-callout-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMyA0LjVBMS41IDEuNSAwIDAgMSA0LjUgM2gxMUExLjUgMS41IDAgMCAxIDE3IDQuNXY4YTEuNSAxLjUgMCAwIDEtMS41IDEuNWgtNC41MTRhMjYgMjYgMCAwIDAtMi4wMTcgMS41NGwtLjMxNC4yNmMtLjU1LjQ1Ny0xLjExNS45MjYtMS43NiAxLjQtLjY2OS40OTEtMS41NjItLjAxMi0xLjU2Mi0uOFYxNEg0LjVBMS41IDEuNSAwIDAgMSAzIDEyLjV6TTQuNSA0YS41LjUgMCAwIDAtLjUuNXY4YS41LjUgMCAwIDAgLjUuNWgxLjgzM3YzLjM3MmEzNiAzNiAwIDAgMCAxLjY3OC0xLjMzOGwuMzItLjI2NWEyNiAyNiAwIDAgMSAyLjIyNS0xLjY4NWwuMTI2LS4wODRIMTUuNWEuNS41IDAgMCAwIC41LS41di04YS41LjUgMCAwIDAtLjUtLjV6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-candlestick-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNyAxdjNoMnYxMkg3djNINnYtM0g0VjRoMlYxek01IDVoM3YxMEg1ek0xMSAxNFY2aDJWMy4yNWgxVjZoMnY4aC0ydjIuNzVoLTFWMTR6bTEtN2gzdjZoLTN6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-close{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJtNSA1IDEwIDEwTTUgMTUgMTUgNSIgc3Ryb2tlPSIjMDAwIi8+PC9zdmc+)}.ag-charts-icon-comment-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNy41MTMgMy45OTVhNi41IDYuNSAwIDAgMSA2LjA5OCAxMS40MWMtLjU4OC4zOTMtMS4yMTcuNTM2LTEuODI5LjU4NWExMyAxMyAwIDAgMS0xLjI3LjAxN0EyNyAyNyAwIDAgMCAxMCAxNkg0LjVhLjUuNSAwIDAgMS0uNS0uNVYxMHEwLS4yNDctLjAwNy0uNTEzYy0uMDA4LS40MTYtLjAxNi0uODU3LjAxNy0xLjI2OS4wNS0uNjEyLjE5Mi0xLjI0LjU4NS0xLjgzYTYuNSA2LjUgMCAwIDEgMi45MTgtMi4zOTNtMy41Ni42MWE1LjUgNS41IDAgMCAwLTUuNjQ2IDIuMzRjLS4yNjYuMzk3LS4zNzkuODQyLS40MiAxLjM1NC0uMDMuMzYtLjAyMi43MTgtLjAxNSAxLjEwOFE1IDkuNjg5IDUgMTB2NWg1cS4zMTEuMDAxLjU5My4wMDhjLjM5LjAwNy43NDcuMDE1IDEuMTA4LS4wMTUuNTEyLS4wNDEuOTU3LS4xNTQgMS4zNTUtLjQyYTUuNSA1LjUgMCAwIDAtMS45ODMtOS45NjciIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-crosshair-add-line{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTEwIDUuNWEuNS41IDAgMCAxIC41LjV2My41aDMuODc1YS41LjUgMCAwIDEgMCAxSDEwLjV2NC4yNWEuNS41IDAgMSAxLTEgMFYxMC41SDUuNjI1YS41LjUgMCAxIDEgMC0xSDkuNVY2YS41LjUgMCAwIDEgLjUtLjUiLz48L3N2Zz4=)}.ag-charts-icon-date-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMiAyaDF2MTZIMnptMTUgMGgxdjE2aC0xeiIgZmlsbD0iIzE4MUQxRiIvPjxwYXRoIGQ9Ik0xMy4xNTcgMTFINXYtMWg3Ljc5M0wxMSA4LjIwN2wuNzA3LS43MDcgMy4xODIgMy4xODItMy4xODIgMy4xODItLjcwNy0uNzA3eiIgZmlsbD0iIzAwMCIvPjwvc3ZnPg==)}.ag-charts-icon-date-price-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMyAySDJ2MTZoMXptMy41MDcgNC44OUw4LjUgNC44OTVWMTBINXYxaDMuNXY3aDF2LTdoNS4wODhsLTEuOTU3IDEuOTU3LjcwNy43MDcgMy4xODItMy4xODJMMTMuMzM4IDcuM2wtLjcwNy43MDdMMTQuNjI0IDEwSDkuNVY0LjkzMmwxLjk1NyAxLjk1Ny43MDctLjcwN0w4Ljk4MiAzIDUuOCA2LjE4MnoiIGZpbGw9IiMxODFEMUYiLz48L3N2Zz4=)}.ag-charts-icon-delete{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZD0iTTguNDk2IDguOTk2QS41LjUgMCAwIDEgOSA5LjQ5MnY0YS41LjUgMCAxIDEtMSAuMDA4di00YS41LjUgMCAwIDEgLjQ5Ni0uNTA0TTEyIDkuNWEuNS41IDAgMCAwLTEgMHY0YS41LjUgMCAwIDAgMSAweiIvPjxwYXRoIGZpbGw9IiMxMzE3MjIiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTYgNVYzLjVBMi41IDIuNSAwIDAgMSA4LjUgMWgzQTIuNSAyLjUgMCAwIDEgMTQgMy41VjVoMi44MzNhLjUuNSAwIDAgMSAwIDFIMTV2MTAuMjVjMCAuNDE1LS4wNjYuODYzLS4zIDEuMjIxLS4yNTcuMzk0LS42NzIuNjEyLTEuMi42MTJoLTdjLS41MjggMC0uOTQzLS4yMTgtMS4yLS42MTItLjIzNC0uMzU4LS4zLS44MDYtLjMtMS4yMjFWNkgzLjMzM2EuNS41IDAgMCAxIDAtMXptMS0xLjVBMS41IDEuNSAwIDAgMSA4LjUgMmgzQTEuNSAxLjUgMCAwIDEgMTMgMy41VjVIN3pNNiAxNi4yNVY2aDh2MTAuMjVjMCAuMzM1LS4wNTkuNTU0LS4xMzguNjc1LS4wNTUuMDg1LS4xNC4xNTgtLjM2Mi4xNThoLTdjLS4yMjIgMC0uMzA3LS4wNzMtLjM2Mi0uMTU4LS4wOC0uMTIxLS4xMzgtLjM0LS4xMzgtLjY3NSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-disjoint-channel,.ag-charts-icon-disjoint-channel-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTkuMDI4IDE3LjQ2YTIuMjUgMi4yNSAwIDAgMC00LjA5Mi0xLjg1bC05LjUxMS0yLjM3OGEyLjI1IDIuMjUgMCAxIDAtLjIyNS45NzRsOS40NzUgMi4zNjlhMi4yNTEgMi4yNTEgMCAwIDAgNC4zNTMuODg2bS0xLjY2Mi0xLjk2NWExLjI1IDEuMjUgMCAxIDEtLjg4NSAyLjMzOCAxLjI1IDEuMjUgMCAwIDEgLjg4NS0yLjMzOE00LjM0MyAxMy42NjlhMS4yNSAxLjI1IDAgMSAwLTIuMzM4LS44ODUgMS4yNSAxLjI1IDAgMCAwIDIuMzM4Ljg4NU0zLjk3IDguNzY5YTIuMjUgMi4yNSAwIDAgMCAxLjQ1NS0yLjExbDkuNTExLTIuMzc4YTIuMjUgMi4yNSAwIDEgMC0uMjYtLjk2NUw1LjIgNS42ODVhMi4yNSAyLjI1IDAgMSAwLTEuMjMgMy4wODRtLjM3My0yLjU0N2ExLjI1IDEuMjUgMCAxIDEtMi4zMzguODg1IDEuMjUgMS4yNSAwIDAgMSAyLjMzOC0uODg1bTEzLjc1LTMuNDM4YTEuMjUgMS4yNSAwIDEgMS0yLjMzOC44ODUgMS4yNSAxLjI1IDAgMCAxIDIuMzM4LS44ODUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-drag-handle{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSI1Ljc1IiBjeT0iNy43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iOS43NSIgY3k9IjcuNzUiIHI9Ii43NSIgZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuNSIvPjxjaXJjbGUgY3g9IjEzLjc1IiBjeT0iNy43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iMTMuNzUiIGN5PSIxMS43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iOS43NSIgY3k9IjExLjc1IiByPSIuNzUiIGZpbGw9IiMwMDAiIGZpbGwtb3BhY2l0eT0iLjUiLz48Y2lyY2xlIGN4PSI1Ljc1IiBjeT0iMTEuNzUiIHI9Ii43NSIgZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuNSIvPjwvc3ZnPg==)}.ag-charts-icon-fibonacci-retracement-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA1aDEydjFIMnoiLz48Y2lyY2xlIGN4PSIxNS43NSIgY3k9IjUuNSIgcj0iMS43NSIgc3Ryb2tlPSIjMDAwIi8+PGNpcmNsZSBjeD0iNC4yNSIgY3k9IjE0LjUiIHI9IjEuNzUiIHN0cm9rZT0iIzAwMCIvPjxwYXRoIGZpbGw9IiMwMDAiIGQ9Ik0xOCAxNUg2di0xaDEyem0wLTQuNUgydi0xaDE2eiIvPjwvc3ZnPg==)}.ag-charts-icon-fibonacci-retracement-trend-based-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJtNC45OTYgMTIuNjc0IDMuMjkxLTUuNzQzLjg2OC40OTctMy4yOTEgNS43NDN6Ii8+PGNpcmNsZSBjeD0iOS43NSIgY3k9IjUuNSIgcj0iMS43NSIgc3Ryb2tlPSIjMDAwIi8+PGNpcmNsZSBjeD0iNC4zNTEiIGN5PSIxNC41IiByPSIxLjc1IiBzdHJva2U9IiMwMDAiLz48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMTggNmgtN1Y1aDd6bTAgNC41aC03di0xaDd6bTAgNC41SDZ2LTFoMTJ6Ii8+PC9zdmc+)}.ag-charts-icon-fill-color{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtOC4wNzEgNC4wNi0uOTI0LS45MjQuNzA3LS43MDcgNy4yODggNy4yODgtNC45NSA0Ljk1YTMuNSAzLjUgMCAwIDEtNC45NSAwbC0xLjQxNC0xLjQxNGEzLjUgMy41IDAgMCAxIDAtNC45NXptLjcwNy43MDhMNC41MzYgOS4wMWEyLjUgMi41IDAgMCAwIDAgMy41MzZMNS45NSAxMy45NmEyLjUgMi41IDAgMCAwIDMuNTM1IDBsNC4yNDMtNC4yNDN6bTYuOSA3LjIwMi0uMzQ1LjM2My0uMzQ0LS4zNjNhLjUuNSAwIDAgMSAuNjg4IDBtLS4zNDUgMS4wOGE4IDggMCAwIDAtLjI4LjMyMyA0LjMgNC4zIDAgMCAwLS40MDkuNTgyYy0uMTEzLjIwMS0uMTQ0LjMyNi0uMTQ0LjM3OGEuODMzLjgzMyAwIDAgMCAxLjY2NyAwYzAtLjA1Mi0uMDMxLS4xNzctLjE0NC0uMzc4YTQuMyA0LjMgMCAwIDAtLjQxLS41ODIgOCA4IDAgMCAwLS4yOC0uMzIybS0uMzQ0LTEuMDguMzQ0LjM2My4zNDQtLjM2My4wMDIuMDAyLjAwNC4wMDQuMDEzLjAxMmE2IDYgMCAwIDEgLjIwNi4yMDhjLjEzMS4xMzYuMzA4LjMyNy40ODUuNTQ1LjE3Ni4yMTUuMzYzLjQ2Ny41MDcuNzI0LjEzNy4yNDMuMjczLjU1My4yNzMuODY4YTEuODMzIDEuODMzIDAgMSAxLTMuNjY3IDBjMC0uMzE1LjEzNi0uNjI1LjI3My0uODY4LjE0NC0uMjU3LjMzLS41MDkuNTA3LS43MjRhOSA5IDAgMCAxIC42NDUtLjcwOGwuMDQ2LS4wNDUuMDEzLS4wMTIuMDA0LS4wMDR6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-hollow-candlestick-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1vcGFjaXR5PSIuMTUiIGQ9Ik01IDVoM3YxMEg1eiIvPjxwYXRoIGZpbGw9IiMxMzE3MjIiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTcgMXYzaDJ2MTJIN3YzSDZ2LTNINFY0aDJWMXpNNSA1aDN2MTBINXptNyAyaDN2NmgtM3ptLTEgN1Y2aDJWMy4yNWgxVjZoMnY4aC0ydjIuNzVoLTFWMTR6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-horizontal-line,.ag-charts-icon-horizontal-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNLjUgOS41aDcuMzA2YTIuMjUgMi4yNSAwIDAgMSA0LjM4OCAwSDE5LjV2MWgtNy4zMDZhMi4yNSAyLjI1IDAgMCAxLTQuMzg4IDBILjV6bTkuNSAxLjc1YTEuMjUgMS4yNSAwIDEgMCAwLTIuNSAxLjI1IDEuMjUgMCAwIDAgMCAyLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-line-color{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTQuMjQyIDIuNzIyYy0uNjEyIDAtMS4yLjI0My0xLjYzMi42NzVsLTEuMzQzIDEuMzQ0YS41LjUgMCAwIDAtLjExMi4xMTJMNC4wNSAxMS45NTljLS4yMDcuMjA3LS4zNi40Ni0uNDQ2Ljc0di4wMDFsLS42OSAyLjc2N3YuMDAyYS44Mi44MiAwIDAgMCAxLjAyMiAxLjAyMWguMDAybDIuNjM0LS44MjJjLjI4LS4wODUuNTM0LS4yMzcuNzQtLjQ0M2w3LjEwNy03LjEwOGEuNS41IDAgMCAwIC4xMTItLjExMmwxLjM0My0xLjM0M2EyLjMwOCAyLjMwOCAwIDAgMC0xLjYzMi0zLjk0TTE0LjEyMiA3bDEuMDQ0LTEuMDQ1YTEuMzA4IDEuMzA4IDAgMSAwLTEuODQ5LTEuODVMMTIuMjcxIDUuMTV6bS0yLjU1OC0xLjE0Mi02LjgwNyA2LjgwOWEuOC44IDAgMCAwLS4xOTYuMzI1bC0uNzUgMi40NjggMi40Ny0uNzQ5YS44LjggMCAwIDAgLjMyNS0uMTk0bDYuODA4LTYuODF6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-line-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTcuMzYyIDQuODczLTQuNTk0IDYuNjU0LTQuODUtMy4zMTctNC4yNTEgNi45NzctLjg1NC0uNTJMNy42MTIgNi43OWw0Ljg5OSAzLjM1IDQuMDI4LTUuODM2eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-line-style-dashed{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA5aDR2MUgyem0xMiAwaDR2MWgtNHpNOCA5aDR2MUg4eiIvPjwvc3ZnPg==)}.ag-charts-icon-line-style-dotted{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSIyLjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iNC41IiBjeT0iOS41IiByPSIuNSIgZmlsbD0iIzAwMCIvPjxjaXJjbGUgY3g9IjYuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48Y2lyY2xlIGN4PSI4LjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iMTAuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48Y2lyY2xlIGN4PSIxMi41IiBjeT0iOS41IiByPSIuNSIgZmlsbD0iIzAwMCIvPjxjaXJjbGUgY3g9IjE0LjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iMTYuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48L3N2Zz4=)}.ag-charts-icon-line-style-solid{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA5aDE2djFIMnoiLz48L3N2Zz4=)}.ag-charts-icon-line-with-markers-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTguMTk4IDQuODg4LTMuNTU2IDQuOTE4YTIuMjUgMi4yNSAwIDEgMS0zLjg2Ni43NWwtMS40MzItLjlhMi4yNCAyLjI0IDAgMCAxLTIuMDA5LjQzNWwtMy44MjggNi40MjgtLjg2LS41MTJMNi40NSA5LjYyM2EyLjI1IDIuMjUgMCAxIDEgMy41MS0uNzYxbDEuMzI5LjgzNWEyLjI0IDIuMjQgMCAwIDEgMi41NTctLjQ5N2wzLjU0Mi00Ljg5OHptLTQuOTYgNS4xNTNhMS4yNSAxLjI1IDAgMSAwLS42NCAyLjQxOSAxLjI1IDEuMjUgMCAwIDAgLjY0LTIuNDE5TTkuMSA4LjMyMXEuMDY2LS4xOTIuMDY3LS40MDRhMS4yNSAxLjI1IDAgMSAwLS4wNjcuNDA0IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-lock,.ag-charts-icon-locked{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuMjA3IDMuNzY0YTIuODk0IDIuODk0IDAgMCAwLTIuODk1IDIuODk0VjloNS43ODlWNi42NThhMi44OTQgMi44OTQgMCAwIDAtMi44OTUtMi44OTRNMTQuMSA5VjYuNjU4YTMuODk0IDMuODk0IDAgMSAwLTcuNzg5IDB2Mi4zNDlBMi41IDIuNSAwIDAgMCA0IDExLjV2M0EyLjUgMi41IDAgMCAwIDYuNSAxN2g4YTIuNSAyLjUgMCAwIDAgMi41LTIuNXYtM0EyLjUgMi41IDAgMCAwIDE0LjUgOXpNNi41IDEwQTEuNSAxLjUgMCAwIDAgNSAxMS41djNBMS41IDEuNSAwIDAgMCA2LjUgMTZoOGExLjUgMS41IDAgMCAwIDEuNS0xLjV2LTNhMS41IDEuNSAwIDAgMC0xLjUtMS41eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-measurer-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibTQuNDYxIDEyLjcxIDEuNTMyLTEuNTMxIDEuNDE0IDEuNDE0LjcwNy0uNzA3TDYuNyAxMC40NzJsMS41MzItMS41MzMgMiAyIC43MDctLjcwNy0yLTIgNi4wMS02LjAxIDIuODMgMi44MjhMNS4wNSAxNy43NzggMi4yMjIgMTQuOTVsMS41MzItMS41MzIgMS40MTQgMS40MTQuNzA3LS43MDd6TS44MDggMTQuOTVsLjcwNy0uNzA3TDE0LjI0MyAxLjUxNWwuNzA3LS43MDcuNzA3LjcwNyAyLjgyOCAyLjgyOC43MDcuNzA3LS43MDcuNzA3TDUuNzU3IDE4LjQ4NWwtLjcwNy43MDctLjcwNy0uNzA3LTIuODI4LTIuODI4em0xMS4wNzgtNi44MzVMMTAuNDcgNi43bC43MDctLjcwNyAxLjQxNSAxLjQxNHptLjgyNC0zLjY1NCAxIDEgLjcwOC0uNzA3LTEtMXoiIGZpbGw9IiMxODFEMUYiLz48L3N2Zz4=)}.ag-charts-icon-note-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMyA0LjVBMS41IDEuNSAwIDAgMSA0LjUgM2gxMUExLjUgMS41IDAgMCAxIDE3IDQuNXY4YTEuNSAxLjUgMCAwIDEtMS41IDEuNWgtMy4yMWwtMS40NjkgMi41N2ExIDEgMCAwIDEtMS42ODIuMDg1TDcuMjQzIDE0SDQuNUExLjUgMS41IDAgMCAxIDMgMTIuNXpNNC41IDRhLjUuNSAwIDAgMC0uNS41djhhLjUuNSAwIDAgMCAuNS41aDMuMjU3bDIuMTk2IDMuMDc0TDExLjcxIDEzaDMuNzlhLjUuNSAwIDAgMCAuNS0uNXYtOGEuNS41IDAgMCAwLS41LS41eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNi41IDYuNUEuNS41IDAgMCAxIDcgNmg2YS41LjUgMCAwIDEgMCAxSDdhLjUuNSAwIDAgMS0uNS0uNU02LjUgOS41QS41LjUgMCAwIDEgNyA5aDZhLjUuNSAwIDAgMSAwIDFIN2EuNS41IDAgMCAxLS41LS41IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-ohlc-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZD0iTTEzIDExaC0zdi0xaDNWM2gxdjJoNHYxaC00djExaC0xek02IDE3di0yaDN2LTFINlY0SDV2MUgydjFoM3YxMXoiLz48L3N2Zz4=)}.ag-charts-icon-pan-end{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0ibTYuNjQ2IDEzLjgxMy0uMzUzLjM1NC43MDcuNzA3LjM1NC0uMzU0ek0xMS4xNjYgMTBsLjM1NC4zNTQuMzU0LS4zNTQtLjM1NC0uMzU0ek03LjM1NSA1LjQ4IDcgNS4xMjZsLS43MDcuNzA3LjM1My4zNTR6bTAgOS4wNCA0LjE2Ni00LjE2Ni0uNzA3LS43MDgtNC4xNjcgNC4xNjd6bTQuMTY2LTQuODc0TDcuMzU0IDUuNDhsLS43MDguNzA3IDQuMTY3IDQuMTY3ek0xMy4wODMgNXYxMGgxVjV6Ii8+PC9zdmc+)}.ag-charts-icon-pan-left{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTIuNzkgNS44MzMgOC42MjUgMTBsNC4xNjYgNC4xNjctLjcwNy43MDdMNy4yMSAxMGw0Ljg3My00Ljg3NHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-pan-right{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNy4yMSAxNC4xNjcgMTEuMzc2IDEwIDcuMjEgNS44MzNsLjcwNy0uNzA3TDEyLjc5IDEwbC00Ljg3MyA0Ljg3NHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-pan-start{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTYgNXYxMGgxVjV6TTkuNjI0IDEwbDQuMTY2LTQuMTY3LS43MDctLjcwN0w4LjIxIDEwbDQuODc0IDQuODc0LjcwNy0uNzA3eiIvPjwvc3ZnPg==)}.ag-charts-icon-parallel-channel,.ag-charts-icon-parallel-channel-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTcuNzIgNS4zMzFBMi4yNSAyLjI1IDAgMSAwIDE0LjcwNSAzLjZsLTkuNDkgNC41NjJhMi4yNSAyLjI1IDAgMSAwIC4yMDkgMS4wMWw5LjY2Mi00LjY0NmEyLjI1IDIuMjUgMCAwIDAgMi42MzQuODA1bS4zNzMtMi41NDdhMS4yNSAxLjI1IDAgMSAxLTIuMzM4Ljg4NSAxLjI1IDEuMjUgMCAwIDEgMi4zMzgtLjg4NU00LjM0MyA4LjY3YTEuMjUgMS4yNSAwIDEgMS0yLjMzOC44ODUgMS4yNSAxLjI1IDAgMCAxIDIuMzM4LS44ODVNNS4zMDcgMTYuNzI4YTIuMjUgMi4yNSAwIDEgMS0uNTI1LS44NThsOS45MjMtNC43N2EyLjI1IDIuMjUgMCAxIDEgLjM4MS45MjZ6bS0uOTY0LjI3NGExLjI1IDEuMjUgMCAxIDEtMi4zMzguODg1IDEuMjUgMS4yNSAwIDAgMSAyLjMzOC0uODg1bTEzLjAyMy01LjEwNmExLjI1IDEuMjUgMCAxIDAtLjg4NS0yLjMzOSAxLjI1IDEuMjUgMCAwIDAgLjg4NSAyLjMzOSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-position-bottom{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii4yNSIgZD0iTTMgMTBoMTR2MUgzem0zLTNoOHYxSDZ6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTYgMTNoOHYxSDZ6Ii8+PC9zdmc+)}.ag-charts-icon-position-center{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMyAxMGgxNHYxSDN6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuMjUiIGQ9Ik02IDdoOHYxSDZ6bTAgNmg4djFINnoiLz48L3N2Zz4=)}.ag-charts-icon-position-top{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii4yNSIgZD0iTTMgMTBoMTR2MUgzeiIvPjxwYXRoIGZpbGw9IiMwMDAiIGQ9Ik02IDdoOHYxSDZ6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuMjUiIGQ9Ik02IDEzaDh2MUg2eiIvPjwvc3ZnPg==)}.ag-charts-icon-price-label-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNC41IDNBMS41IDEuNSAwIDAgMCAzIDQuNVYxM2ExLjUgMS41IDAgMCAwIDEuNSAxLjVoLjgzM3YuMDU3Yy4yNDItLjI5OS41OTctLjUwMyAxLS41NDhWMTMuNUg0LjVBLjUuNSAwIDAgMSA0IDEzVjQuNWEuNS41IDAgMCAxIC41LS41aDExYS41LjUgMCAwIDEgLjUuNXY4YS41LjUgMCAwIDEtLjUuNWgtNC44MThsLS4xMjYuMDg0YTI2IDI2IDAgMCAwLTIuMjI1IDEuNjg1bC0uMzIuMjY1LS4wNjguMDU2YTEuNSAxLjUgMCAwIDEtMi42MDkgMS4zNTRjLjAzMy43NjMuOTA1IDEuMjM4IDEuNTYuNzU2LjY0Ni0uNDc0IDEuMjEtLjk0MyAxLjc2MS0xLjRsLjMxMy0uMjZBMjYgMjYgMCAwIDEgMTAuOTg2IDE0SDE1LjVhMS41IDEuNSAwIDAgMCAxLjUtMS41di04QTEuNSAxLjUgMCAwIDAgMTUuNSAzeiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNOC43MTYgMTQuODE1YTIuMjUgMi4yNSAwIDEgMS00LjIxIDEuNTkzIDIuMjUgMi4yNSAwIDAgMSA0LjIxLTEuNTkzbS0xLjY2MiAxLjk2NmExLjI1IDEuMjUgMCAxIDAtLjg4NS0yLjMzOSAxLjI1IDEuMjUgMCAwIDAgLjg4NSAyLjMzOSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-price-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNOS4wNDYgMTVWNS44NzdoLjk0MlYxNXoiIGZpbGw9IiMxODFEMUYiLz48cGF0aCBkPSJNOS4wNDYgMTVWNS44NzdoLjk0MlYxNXoiIGZpbGw9IiMxODFEMUYiLz48cGF0aCBkPSJNOS41IDYuMjI4IDcuMTY3IDguMzc2IDYuNSA3Ljc2MiA5LjUgNWwzIDIuNzYyLS42NjcuNjE0eiIgZmlsbD0iIzAwMCIvPjxwYXRoIGQ9Ik0yIDE4di0xaDE2djF6TTIgM1YyaDE2djF6IiBmaWxsPSIjMTgxRDFGIi8+PC9zdmc+)}.ag-charts-icon-reset{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTIuMDQgNC40NDVhNS44MSA1LjgxIDAgMCAwLTcuMjU3IDIuNDUzLjUuNSAwIDAgMS0uODY1LS41MDJBNi44MSA2LjgxIDAgMSAxIDMgOS44MTNhLjUuNSAwIDAgMSAxIDAgNS44MSA1LjgxIDAgMSAwIDguMDQtNS4zNjgiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjxwYXRoIGZpbGw9IiMwMDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTQuMjg5IDMuMDAyYS41LjUgMCAwIDEgLjUuNXYyLjY1NWgyLjY1NWEuNS41IDAgMCAxIDAgMUg0LjI5YS41LjUgMCAwIDEtLjUtLjVWMy41MDJhLjUuNSAwIDAgMSAuNS0uNSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-settings{--icon: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgc3R5bGU9ImZpbGwtcnVsZTpldmVub2RkIj48cGF0aCBkPSJNMTAgMTNhMyAzIDAgMSAwIDAtNiAzIDMgMCAwIDAgMCA2bTAtMWEyIDIgMCAxIDEtLjAwMS0zLjk5OUEyIDIgMCAwIDEgMTAgMTIiLz48cGF0aCBkPSJNMi4zMSAxNC4zNDVjLS44MTctMS40OTEuMDI3LTIuNDk5LjQ3NC0yLjg2NS41MzEtLjQzNC45NjktLjM2NS45NzItMS40OC0uMDAzLTEuMTE1LS40NDEtMS4wNDYtLjk3Mi0xLjQ4MS0uNDU0LS4zNzEtMS4zMTctMS40MDUtLjQzNC0yLjkzNmwuMDA1LS4wMDljLjg4NC0xLjUyIDIuMjA3LTEuMjkgMi43NTUtMS4wODMuNjQxLjI0My44MDEuNjU2IDEuNzY4LjEwMS45NjQtLjU2LjY4Ni0uOTA0Ljc5Ni0xLjU4Mi4wOTQtLjU3OC41NTktMS44NDMgMi4zMjYtMS44NDNoLjAxYzEuNzU5LjAwNSAyLjIyMiAxLjI2NiAyLjMxNiAxLjg0My4xMS42NzgtLjE2OCAxLjAyMi43OTYgMS41ODIuOTY3LjU1NSAxLjEyNy4xNDIgMS43NjgtLjEwMS41NDktLjIwOCAxLjg3Ni0uNDM4IDIuNzYgMS4wOTJzLjAyIDIuNTY1LS40MzQgMi45MzZjLS41MzEuNDM1LS45NjkuMzY2LS45NzIgMS40ODEuMDAzIDEuMTE1LjQ0MSAxLjA0Ni45NzIgMS40OC40NTQuMzcyIDEuMzE3IDEuNDA2LjQzNCAyLjkzN2wtLjAwNS4wMDljLS44ODQgMS41Mi0yLjIwNyAxLjI5LTIuNzU1IDEuMDgzLS42NDEtLjI0My0uODAxLS42NTYtMS43NjgtLjEwMS0uOTY0LjU2LS42ODYuOTA0LS43OTYgMS41ODEtLjA5NC41NzktLjU1OSAxLjg0NC0yLjMyNiAxLjg0NGgtLjAxYy0xLjc1OS0uMDA1LTIuMjIyLTEuMjY2LTIuMzE2LTEuODQ0LS4xMS0uNjc3LjE2OC0xLjAyMS0uNzk2LTEuNTgxLS45NjctLjU1NS0xLjEyNy0uMTQyLTEuNzY4LjEwMS0uNTQ5LjIwOC0xLjg3Ni40MzgtMi43Ni0xLjA5MmwtLjAyLS4wMzZ6TTkuOTg0IDIuMTYySDEwYzEuMzU1IDAgMS4zNDIgMS4wMzkgMS4zNTMgMS40MjUuMDA4LjMxMi4wNCAxLjE2IDEuMjU5IDEuODcybC4wMTUuMDA4YzEuMjI1LjcgMS45NzYuMzA0IDIuMjUxLjE1NS4zMzctLjE4MyAxLjIyNi0uNzExIDEuOTAyLjQ0NWwuMDA4LjAxNGMuNjc4IDEuMTczLS4yMjkgMS42ODItLjU1OCAxLjg4NC0uMjY2LjE2My0uOTg0LjYxNS0uOTkxIDIuMDI3di4wMTZjLjAwNyAxLjQxMi43MjUgMS44NjQuOTkxIDIuMDI3LjMyOC4yMDEgMS4yMjkuNzA3LjU2NiAxLjg3bC0uMDA4LjAxNGMtLjY3NyAxLjE3NC0xLjU3MS42NDMtMS45MS40NTktLjI3NS0uMTQ5LTEuMDI2LS41NDUtMi4yNTEuMTU0bC0uMDE1LjAwOWMtMS4yMTkuNzEyLTEuMjUxIDEuNTYtMS4yNTkgMS44NzItLjAxMS4zODYuMDAyIDEuNDI1LTEuMzUzIDEuNDI1cy0xLjM0Mi0xLjAzOS0xLjM1My0xLjQyNWMtLjAwOC0uMzEyLS4wNC0xLjE2LTEuMjU5LTEuODcybC0uMDE1LS4wMDljLTEuMjI1LS42OTktMS45NzYtLjMwMy0yLjI1MS0uMTU0LS4zMzYuMTgzLTEuMjE5LjcwNi0xLjg5NC0uNDMybC0uMDE2LS4wMjdjLS42NzgtMS4xNzQuMjI5LTEuNjgyLjU1OC0xLjg4NC4yNjYtLjE2My45ODQtLjYxNS45OTEtMi4wMjd2LS4wMTZjLS4wMDctMS40MTItLjcyNS0xLjg2NC0uOTkxLTIuMDI3LS4zMjgtLjIwMS0xLjIyOS0uNzA3LS41NjYtMS44N2wuMDA4LS4wMTRjLjY3Ny0xLjE3NCAxLjU3MS0uNjQzIDEuOTEtLjQ1OS4yNzUuMTQ5IDEuMDI2LjU0NSAyLjI1MS0uMTU1bC4wMTUtLjAwOGMxLjIxOS0uNzEyIDEuMjUxLTEuNTYgMS4yNTktMS44NzIuMDEtLjM4NC0uMDAyLTEuNDE3IDEuMzM3LTEuNDI1Ii8+PC9zdmc+)}.ag-charts-icon-step-line-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzE4MUQxRiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNiA0aDV2OGgzVjhoNXYxaC00djRoLTVWNUg3djEwSDJ2LTFoNHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-text-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00IDRIMTZWN0gxNVY1SDEwLjVWMTVIMTRWMTZINlYxNUg5LjVWNUg1VjdINFY0WiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-trend-line,.ag-charts-icon-trend-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNS4zMTQgMTAuOTM4YTIuMjUgMi4yNSAwIDEgMSAuMDEtMWg5LjM1MmEyLjI1IDIuMjUgMCAxIDEgLjAxIDF6bS0yLjE4OS43MjlhMS4yNSAxLjI1IDAgMSAwIDAtMi41IDEuMjUgMS4yNSAwIDAgMCAwIDIuNW0xMy43NSAwYTEuMjUgMS4yNSAwIDEgMCAwLTIuNSAxLjI1IDEuMjUgMCAwIDAgMCAyLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-unlock,.ag-charts-icon-unlocked{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuNjUxIDMuNWEyLjg5NCAyLjg5NCAwIDAgMC0yLjg5NCAyLjg5NFY5SDE0LjVhMi41IDIuNSAwIDAgMSAyLjUgMi41djNhMi41IDIuNSAwIDAgMS0yLjUgMi41aC04QTIuNSAyLjUgMCAwIDEgNCAxNC41di0zQTIuNSAyLjUgMCAwIDEgNi41IDloLjI1N1Y2LjM5NGEzLjg5NCAzLjg5NCAwIDEgMSA3Ljc4OSAwIC41LjUgMCAwIDEtMSAwQTIuODk0IDIuODk0IDAgMCAwIDEwLjY1IDMuNU02LjUgMTBBMS41IDEuNSAwIDAgMCA1IDExLjV2M0ExLjUgMS41IDAgMCAwIDYuNSAxNmg4YTEuNSAxLjUgMCAwIDAgMS41LTEuNXYtM2ExLjUgMS41IDAgMCAwLTEuNS0xLjV6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-vertical-line,.ag-charts-icon-vertical-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuNSA3LjgwNmEyLjI1IDIuMjUgMCAwIDEgMCA0LjM4OFYxOS41aC0xdi03LjMwNmEyLjI1IDIuMjUgMCAwIDEgMC00LjM4OFYuNWgxem0tLjUuOTQ0YTEuMjUgMS4yNSAwIDEgMSAwIDIuNSAxLjI1IDEuMjUgMCAwIDEgMC0yLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-zoom-in{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTEwIDUuNWEuNS41IDAgMCAxIC41LjV2My41aDMuODc1YS41LjUgMCAwIDEgMCAxSDEwLjV2NC4yNWEuNS41IDAgMSAxLTEgMFYxMC41SDUuNjI1YS41LjUgMCAxIDEgMC0xSDkuNVY2YS41LjUgMCAwIDEgLjUtLjUiLz48L3N2Zz4=)}.ag-charts-icon-zoom-out{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNS41IDEwYS41LjUgMCAwIDEgLjUtLjVoOGEuNS41IDAgMCAxIDAgMUg2YS41LjUgMCAwIDEtLjUtLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-high-low-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNyA0aDJ2MTJINFY0aDNNNSA1aDN2MTBINXpNMTEgMTRWNmg1djhoLTVtMS03aDN2NmgtM3oiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-hlc-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTguMTYzIDEuODM3LTUuMzM0IDExLjYyMUw2Ljk1NyA4LjEybC00LjE5OSA5LjYyMi0uOTE2LS40IDQuNzU2LTEwLjlMMTIuNDkgMTEuOCAxNy4yNTQgMS40MnoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjxwYXRoIGZpbGw9IiMwMDAiIGZpbGwtb3BhY2l0eT0iLjQiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTUuODI1IDIuNzA0LjU1IDEzLjc4NWwuOTAyLjQzIDQuNzI0LTkuOTE5IDYuMDM0IDUuMDI5IDMuMjU1LTguMTQtLjkyOC0uMzctMi43NDUgNi44NnptNy44NTIgMTQuNjM2IDUuNzgtMTMuMTM5LS45MTUtLjQwMi01LjIxOSAxMS44Ni02LjAwNS01LjUwNC0zLjI3OCA3LjY0OC45Mi4zOTQgMi43MjItNi4zNTJ6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-zoom-in-alt{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXpvb20taW4iPjxjaXJjbGUgY3g9IjExIiBjeT0iMTEiIHI9IjgiLz48bGluZSB4MT0iMjEiIHgyPSIxNi42NSIgeTE9IjIxIiB5Mj0iMTYuNjUiLz48bGluZSB4MT0iMTEiIHgyPSIxMSIgeTE9IjgiIHkyPSIxNCIvPjxsaW5lIHgxPSI4IiB4Mj0iMTQiIHkxPSIxMSIgeTI9IjExIi8+PC9zdmc+)}.ag-charts-icon-zoom-out-alt{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXpvb20tb3V0Ij48Y2lyY2xlIGN4PSIxMSIgY3k9IjExIiByPSI4Ii8+PGxpbmUgeDE9IjIxIiB4Mj0iMTYuNjUiIHkxPSIyMSIgeTI9IjE2LjY1Ii8+PGxpbmUgeDE9IjgiIHgyPSIxNCIgeTE9IjExIiB5Mj0iMTEiLz48L3N2Zz4=)}.ag-charts-input{--input-layer-active: 1;--input-layer-focus: 2;--input-padding: calc(var(--ag-charts-spacing) * 2);--input-padding-large: calc(var(--ag-charts-spacing) * 2.5);color:var(--ag-charts-input-text-color);font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size-large);transition-duration:.25s;transition-property:none;transition-timing-function:ease-out}.ag-charts-input:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:var(--input-layer-focus)}.ag-charts-button{background:var(--ag-charts-button-background-color);border:1px solid var(--ag-charts-border-color);border-radius:var(--ag-charts-button-border-radius);color:var(--ag-charts-button-text-color);cursor:pointer;padding:var(--input-padding);transition-property:background,border-color}.ag-charts-button:hover{background:var(--ag-charts-focus-color)}.ag-charts-button:has(.ag-charts-icon){padding:2px}.ag-charts-checkbox{--checkbox-transition-duration: .1s;appearance:none;background:var(--ag-charts-checkbox-background-color);border-radius:calc(var(--ag-charts-border-radius) * 9);cursor:pointer;height:18px;margin:0;transition-duration:var(--checkbox-transition-duration);transition-property:margin;width:29px}.ag-charts-checkbox:before{display:block;background:var(--ag-charts-input-background-color);border-radius:calc(var(--ag-charts-border-radius) * 7);content:" ";height:14px;margin:2px;transition-duration:var(--checkbox-transition-duration);transition-property:margin;transition-timing-function:var(--ag-charts-input-transition-easing);width:14px}.ag-charts-checkbox:checked{background:var(--ag-charts-checkbox-checked-background-color)}.ag-charts-checkbox:checked:before{margin-left:13px}.ag-charts-select{background:var(--ag-charts-input-background-color);border:1px solid var(--ag-charts-input-border-color);border-radius:var(--ag-charts-input-border-radius);padding:3px 2px 4px;font-size:inherit}.ag-charts-textarea{--textarea-line-height: 1.38;background:var(--ag-charts-input-background-color);border:1px solid var(--ag-charts-border-color);border-radius:var(--ag-charts-input-border-radius);line-height:var(--textarea-line-height);font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size-large);padding:var(--input-padding-large) var(--input-padding)}.ag-charts-textarea::placeholder{color:var(--ag-charts-input-placeholder-text-color)}.ag-charts-proxy-container{pointer-events:none;position:absolute}.ag-charts-proxy-elem{-webkit-appearance:none;appearance:none;background:none;border:none;color:#0000;overflow:hidden;pointer-events:auto;position:absolute}.ag-charts-proxy-elem::-moz-range-thumb,.ag-charts-proxy-elem::-moz-range-track{opacity:0}.ag-charts-proxy-elem::-webkit-slider-runnable-track,.ag-charts-proxy-elem::-webkit-slider-thumb{opacity:0}.ag-charts-proxy-elem:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow)}.ag-charts-focus-indicator{position:absolute;display:block;pointer-events:none;user-select:none;-webkit-user-select:none;width:100%;height:100%}.ag-charts-focus-indicator>div{position:absolute;outline:solid 1px var(--ag-charts-chrome-background-color);box-shadow:var(--ag-charts-focus-shadow)}.ag-charts-focus-indicator>svg{width:100%;height:100%;fill:none;overflow:visible}.ag-charts-focus-svg-outer-path{stroke:var(--ag-charts-chrome-background-color);stroke-width:4px}.ag-charts-focus-svg-inner-path{stroke:var(--ag-charts-accent-color);stroke-width:2px}.ag-charts-overlay{color:#181d1f;pointer-events:none}.ag-charts-overlay.ag-charts-dark-overlay{color:#fff}.ag-charts-overlay--loading{color:#8c8c8c}.ag-charts-overlay__loading-background{background:#fff;pointer-events:none}.ag-charts-overlay.ag-charts-dark-overlay .ag-charts-overlay__loading-background{background:#192232}.ag-charts-tooltip{--tooltip-arrow-size: 8px;--tooltip-row-spacing: 8px;--tooltip-column-spacing: 16px;position:fixed;inset:unset;margin:0;padding:0;overflow:visible;top:var(--top, 0px);left:var(--left, 0px);width:max-content;max-width:100%;font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);color:var(--ag-charts-chrome-text-color);background:var(--ag-charts-chrome-background-color);border:var(--ag-charts-border);border-radius:var(--ag-charts-border-radius);box-shadow:var(--ag-charts-shadow)}.ag-charts-tooltip--compact .ag-charts-tooltip-content{--tooltip-row-spacing: 2px;--tooltip-column-spacing: 8px;padding:3px 6px}.ag-charts-tooltip--arrow-top:before,.ag-charts-tooltip--arrow-right:before,.ag-charts-tooltip--arrow-bottom:before,.ag-charts-tooltip--arrow-left:before{content:"";position:absolute;display:block;width:var(--tooltip-arrow-size);height:var(--tooltip-arrow-size);border:inherit;border-bottom-color:transparent;border-right-color:transparent;background:inherit;clip-path:polygon(0 0,100% 0,100% 1px,1px 100%,0 100%)}.ag-charts-tooltip--arrow-top:before{bottom:100%;left:50%;transform:translate(-50%) translateY(calc(var(--tooltip-arrow-size) * .5)) rotate(45deg)}.ag-charts-tooltip--arrow-bottom:before{top:100%;left:50%;transform:translate(-50%) translateY(calc(var(--tooltip-arrow-size) * -.5)) rotate(225deg)}.ag-charts-tooltip--arrow-left:before{right:100%;top:50%;transform:translateY(-50%) translate(calc(var(--tooltip-arrow-size) * .5)) rotate(315deg)}.ag-charts-tooltip--arrow-right:before{left:100%;top:50%;transform:translateY(-50%) translate(calc(var(--tooltip-arrow-size) * -.5)) rotate(135deg)}.ag-charts-tooltip--no-interaction{pointer-events:none;user-select:none;-webkit-user-select:none}.ag-charts-tooltip--wrap-always{overflow-wrap:break-word;word-break:break-word;hyphens:none}.ag-charts-tooltip--wrap-hyphenate{overflow-wrap:break-word;word-break:break-word;hyphens:auto}.ag-charts-tooltip--wrap-on-space{overflow-wrap:normal;word-break:normal}.ag-charts-tooltip--wrap-never{white-space:nowrap}.ag-charts-tooltip-heading,.ag-charts-tooltip-title,.ag-charts-tooltip-label,.ag-charts-tooltip-value{overflow:hidden;text-overflow:ellipsis}.ag-charts-tooltip-content{display:grid;grid:auto-flow minmax(1em,auto) / 1fr;padding:8px 12px;gap:var(--tooltip-row-spacing)}.ag-charts-tooltip-content:has(.ag-charts-tooltip-symbol){grid:auto-flow minmax(1em,auto) / auto 1fr}.ag-charts-tooltip-heading{grid-column:1 / -1}.ag-charts-tooltip-symbol{grid-column:1 / 2;place-self:center}.ag-charts-tooltip-symbol svg{display:block}.ag-charts-tooltip-title{grid-column:-2 / -1}.ag-charts-tooltip-row{grid-column:1 / -1;display:flex;gap:var(--tooltip-column-spacing);align-items:baseline;justify-content:space-between;overflow:hidden}.ag-charts-tooltip-row--inline{grid-column:-2 / -1}.ag-charts-tooltip-label{flex:1;min-width:0}.ag-charts-tooltip-value{min-width:0}.ag-charts-tooltip-footer{grid-column:1 / -1;color:var(--ag-charts-chrome-subtle-text-color);text-align:center}.ag-charts-popover{position:absolute;border:var(--ag-charts-border);border-radius:var(--ag-charts-border-radius);background:var(--ag-charts-chrome-background-color);color:var(--ag-charts-chrome-text-color);font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);box-shadow:var(--ag-charts-shadow);z-index:var(--ag-charts-layer-ui-overlay)}.ag-charts-menu{--item-padding: 6px 12px;--icon-color: var(--ag-charts-chrome-text-color);display:grid;grid:auto-flow auto / 1fr;column-gap:12px;font-size:var(--ag-charts-chrome-font-size)}.ag-charts-menu:has(.ag-charts-menu__icon,.ag-charts-menu__row--stroke-width-visible){grid:auto-flow auto / auto 1fr}.ag-charts-menu__row--stroke-width-visible:before{content:"";height:var(--strokeWidth);width:12px;background:var(--icon-color)}.ag-charts-menu__row--stroke-width-visible[aria-disabled=true]:before{filter:grayscale(1);opacity:.5}.ag-charts-menu__row{display:grid;grid-column:1 / -1;grid-template-columns:subgrid;align-items:center;padding:var(--item-padding)}.ag-charts-menu__row:not(.ag-charts-menu__row--active){cursor:pointer}.ag-charts-menu__row:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.ag-charts-menu__row:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.ag-charts-menu__row:focus{background:var(--ag-charts-focus-color)}.ag-charts-menu__row:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:var(--ag-charts-layer-menu)}.ag-charts-menu__row--active{--icon-color: var(--ag-charts-accent-color);background:var(--ag-charts-focus-color);color:var(--ag-charts-accent-color)}.ag-charts-menu__label{grid-column:-1 / span 1}.ag-charts-toolbar{--toolbar-gap: calc(var(--ag-charts-spacing) * 2);--toolbar-size: 34px;--toolbar-button-padding: 6px;align-items:center;display:flex;flex-wrap:nowrap;position:absolute}.ag-charts-toolbar__button{align-items:center;background:var(--ag-charts-chrome-background-color);border:var(--ag-charts-border);color:var(--ag-charts-chrome-text-color);cursor:pointer;display:flex;font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size-medium);font-weight:var(--ag-charts-chrome-font-weight);justify-content:center;min-height:var(--toolbar-size);min-width:var(--toolbar-size);padding:var(--toolbar-button-padding);position:relative;transition:background-color .25s ease-in-out,border-color .25s ease-in-out,color .25s ease-in-out;white-space:nowrap}.ag-charts-toolbar__button:hover{background:var(--ag-charts-focus-color);z-index:1}.ag-charts-toolbar__button:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:calc(var(--ag-charts-layer-ui-overlay) + 1)}.ag-charts-toolbar__button--active{background:var(--ag-charts-focus-color);border-color:var(--ag-charts-accent-color);color:var(--ag-charts-accent-color);z-index:2}.ag-charts-toolbar__button[aria-disabled=true]{background:var(--ag-charts-button-disabled-background-color);color:var(--ag-charts-button-disabled-text-color);cursor:default}.ag-charts-toolbar--horizontal{flex-direction:row;.ag-charts-toolbar__button{margin:0 0 0 -1px}.ag-charts-toolbar__button--first{border-bottom-left-radius:var(--ag-charts-border-radius);border-top-left-radius:var(--ag-charts-border-radius);margin:0}.ag-charts-toolbar__button--last{border-bottom-right-radius:var(--ag-charts-border-radius);border-top-right-radius:var(--ag-charts-border-radius)}}.ag-charts-toolbar--vertical{flex-direction:column;.ag-charts-toolbar__button{margin:-1px 0 0;max-width:100%}.ag-charts-toolbar__button--first{border-top-left-radius:var(--ag-charts-border-radius);border-top-right-radius:var(--ag-charts-border-radius);margin:0}.ag-charts-toolbar__button--last{border-bottom-left-radius:var(--ag-charts-border-radius);border-bottom-right-radius:var(--ag-charts-border-radius)}}.ag-charts-toolbar__icon+.ag-charts-toolbar__label{margin-left:var(--toolbar-gap)}.ag-charts-toolbar__icon,.ag-charts-toolbar__label{pointer-events:none}.ag-charts-floating-toolbar{border:none;display:flex;.ag-charts-toolbar{align-items:unset;position:unset}}.ag-charts-floating-toolbar__drag-handle{align-items:center;background:var(--ag-charts-chrome-background-color);border:var(--ag-charts-border);border-bottom-left-radius:var(--ag-charts-border-radius);border-top-left-radius:var(--ag-charts-border-radius);cursor:grab;display:flex;justify-content:center;min-width:24px;padding-left:0;padding-right:0}.ag-charts-floating-toolbar__drag-handle--dragging{cursor:grabbing}\n'),this.setContainer(t),this.destroyFns.push(bn(this.element)),"normal"===this.mode){const e=this.rootElements["canvas-center"].element;if(null==e)throw new Error("Error initializing tab guards");const t=Tn(e,"beforebegin"),i=Tn(e,"afterend");this.tabGuards=new en(e,t,i)}}initDOM(){if("normal"===this.mode){const e=(0,n.n)("div");return e.innerHTML='<div role="presentation" class="ag-charts-wrapper ag-charts-styles" data-ag-charts><div role="presentation" class="ag-charts-canvas-center"><div role="presentation" class="ag-charts-canvas-container"><div role="presentation" class="ag-charts-canvas" aria-hidden="true"></div><div role="figure" class="ag-charts-canvas-proxy"><div role="presentation" class="ag-charts-series-area"></div></div><div role="presentation" class="ag-charts-canvas-overlay ag-charts-tooltip-container"></div></div></div></div>',e.firstChild}const e=(0,n.n)("div");e.role="presentation",e.dataset.agCharts="",e.classList.add("ag-charts-wrapper");const t=(0,n.n)("div");return e.appendChild(t),t.role="presentation",t.classList.add("ag-charts-series-area"),e}initRootElements(){const{mode:e,element:t}=this,i={};for(const s of xn){const r=`ag-charts-${s}`;let o;if(o="normal"===e?t.classList.contains(r)?t:t.getElementsByClassName(r)[0]:En.has(s)?t:t.getElementsByClassName(r)[0]??(0,n.n)("div"),null==o)throw new Error(`AG Charts - unable to find DOM element ${r}`);i[s]={element:o,children:new Map,listeners:[]}}return i}destroy(){super.destroy(),this.observer?.unobserve(this.element),this.container&&this.sizeMonitor.unobserve(this.container),this.pendingContainer=void 0,Object.values(this.rootElements).forEach(e=>{e.children.forEach(e=>e.remove()),e.element.remove()}),this.element.remove()}postRenderUpdate(){"minimal"!==this.mode&&null!=this.pendingContainer&&this.pendingContainer!==this.container&&(0===e.batchedUpdateContainer.length&&(0,n.zk)().setTimeout(this.applyBatchedUpdateContainer.bind(this),0),e.batchedUpdateContainer.push(this))}applyBatchedUpdateContainer(){for(const t of e.batchedUpdateContainer)t.destroyed||t.updateContainer();e.batchedUpdateContainer.splice(0)}setSizeOptions(e=300,t=300,i,n){const{style:s}=this.element;s.width=`${i??e}px`,s.height=`${n??t}px`,this.minWidth=i??e,this.minHeight=n??t,this.updateContainerClassName()}updateContainerSize(){const{style:e}=this.rootElements["canvas-center"].element;e.visibility=null==this.containerSize?"hidden":"",this.containerSize?(e.width=`${this.containerSize.width??0}px`,e.height=`${this.containerSize.height??0}px`):(e.width="",e.height=""),this.updateContainerClassName()}setTabGuardIndex(e){this.tabGuards&&(this.tabGuards.tabIndex=e)}setContainer(e){e!==this.container&&(this.pendingContainer=e,"minimal"!==this.mode&&null!=this.container||this.updateContainer())}updateContainer(){const{pendingContainer:e}=this;if(null!=e&&e!==this.container){if(this.container&&(this.container.removeChild(this.element),this.sizeMonitor.unobserve(this.container)),null!=this.documentRoot)for(const e of this.rootElements.styles.children.keys())this.removeChild("styles",e);this.container=e,this.pendingContainer=void 0,this.documentRoot=this.getShadowDocumentRoot(e),this.initiallyConnected="minimal"===this.mode||e.isConnected;for(const[e,t]of this.styles)this.addStyles(e,t);e.appendChild(this.element),this.sizeMonitor.observe(e,e=>{this.containerSize=e,this.updateContainerSize(),this.listeners.dispatch("resize",{type:"resize"})}),this.listeners.dispatch("container-changed",{type:"container-changed"})}}setThemeClass(e){this.element.classList.forEach(t=>{t.startsWith("ag-charts-theme-")&&t!==e&&this.element.classList.remove(t)}),this.element.classList.add(e)}setThemeParameters(e){const t={accentColor:"accent-color",axisColor:"axis-color",backgroundColor:"background-color",borderColor:"border-color",foregroundColor:"foreground-color",fontFamily:"font-family",fontSize:"font-size",fontWeight:"font-weight",gridLineColor:"grid-line-color",padding:"padding",subtleTextColor:"subtle-text-color",textColor:"text-color",chromeBackgroundColor:"chrome-background-color",chromeFontFamily:"chrome-font-family",chromeFontSize:"chrome-font-size",chromeFontWeight:"chrome-font-weight",chromeSubtleTextColor:"chrome-subtle-text-color",chromeTextColor:"chrome-text-color",inputBackgroundColor:"input-background-color",inputTextColor:"input-text-color",crosshairLabelBackgroundColor:"crosshair-label-background-color",crosshairLabelTextColor:"crosshair-label-text-color"},i=["fontSize","chromeFontSize"];for(const[s,r]of(0,n.jO)(e)){let e=`${r}`;i.includes(s)&&(e=`${r}px`),this.element.style.setProperty(`--ag-charts-${t[s]}`,e)}}updateCanvasLabel(e){(0,n.Bq)(this.rootElements["canvas-proxy"].element,"aria-label",e)}getEventElement(e,t){return["focus","blur","keydown","keyup"].includes(t)?this.rootElements["series-area"].element:e}addEventListener(e,t,i){this.getEventElement(this.element,e).addEventListener(e,t,i)}removeEventListener(e,t,i){this.getEventElement(this.element,e).removeEventListener(e,t,i)}getBoundingClientRect(){return this.rootElements.canvas.element.getBoundingClientRect()}getOverlayClientRect(){const e=(0,n.zk)(),t=new m(0,0,e.innerWidth,e.innerHeight),i=this.getRawOverlayClientRect();return t.intersection(i)?.toDOMRect()??Mn}getRawOverlayClientRect(){let e=this.element;const t=this.element.getRootNode()?.fullscreenElement;for(;null!=e;){let i;if(null!=t&&e===t)i=!0;else{const t=e.computedStyleMap?.(),n=t?.get("overflow-y")?.toString();i="auto"===n||"scroll"===n}if(i)return m.fromDOMRect(e.getBoundingClientRect());e=e.parentElement}if(null!=this.documentRoot)return m.fromDOMRect(this.documentRoot.getBoundingClientRect());const{innerWidth:i,innerHeight:s}=(0,n.zk)();return new m(0,0,i,s)}getShadowDocumentRoot(e=this.container){const t=e?.ownerDocument?.body??(0,n.YE)("body");for(;null!=e;){if(e===t)return;if(e.parentNode instanceof DocumentFragment)return e;e=e.parentNode}}getParent(e){return this.rootElements[e].element}getChildBoundingClientRect(e){const{children:t}=this.rootElements[e],i=[];for(const e of t.values())i.push(m.fromDOMRect(e.getBoundingClientRect()));return m.merge(i)}isManagedChildDOMElement(e,t,i){const{children:n}=this.rootElements[t],s=n?.get(i);return null!=s&&e.contains(s)}contains(e,t){return null==t?this.element.contains(e):this.rootElements[t].element.contains(e)}addStyles(t,i){const s="data-ag-charts";if(this.styles.set(t,i),null==this.container)return;const r=e=>e.getAttribute(s)===t,o=e=>{const t=new Set(["TITLE","META"]);let i,o=!0;for(const n of e.children)if(o&&t.has(n.tagName))i=n;else{if(o=!1,r(n))return;n.hasAttribute(s)&&(i=n)}const a=(0,n.n)("style");return null!=this.chart.styleNonce&&(a.nonce=this.chart.styleNonce),null==i?e.prepend(a):e.insertBefore(a,i.nextSibling),a};let a;this.styleContainer?a=o(this.styleContainer):!1===this.initiallyConnected?a=this.addChild("styles",t):null!=this.documentRoot||e.headStyles.has(t)?null!=this.documentRoot&&(a=this.addChild("styles",t)):(a=o((0,n.YE)("head")),e.headStyles.add(t)),null==a||r(a)||(a.setAttribute(s,t),a.innerHTML=i)}removeStyles(e){this.removeChild("styles",e)}updateCursor(e,t){this.cursorState.set(e,t),this.element.style.cursor=this.cursorState.stateValue()}getCursor(){return this.element.style.cursor}addChild(e,t,i,s){const{element:r,children:o,listeners:a}=this.rootElements[e];if(!o)throw new Error("AG Charts - unable to create DOM elements after destroy()");if(o.has(t))return o.get(t);const{childElementType:l="div"}=An.get(e)??{};if(i&&i.tagName.toLowerCase()!==l.toLowerCase())throw new Error("AG Charts - mismatching DOM element type");const c=i??(0,n.n)(l);for(const[e,t,i]of a)c.addEventListener(e,t,i);if(o.set(t,c),"style"===l&&null!=this.chart.styleNonce&&(c.nonce=this.chart.styleNonce),s){const e=r.querySelector(s.query);if(null==e)throw new Error(`AG Charts - addChild query failed ${s.query}`);e.insertAdjacentElement(s.where,c)}else r?.appendChild(c);return c}removeChild(e,t){const{children:i}=this.rootElements[e];i&&(i.get(t)?.remove(),i.delete(t))}incrementDataCounter(e){const{dataset:t}=this.element;t[e]??(t[e]="0"),t[e]=String(Number(t[e])+1)}setDataBoolean(e,t){this.element.dataset[e]=String(t)}updateContainerClassName(){const{element:e,containerSize:t,minWidth:i,minHeight:n}=this;e.classList.toggle("ag-charts-wrapper--safe-horizontal",i>=(t?.width??1/0)),e.classList.toggle("ag-charts-wrapper--safe-vertical",n>=(t?.height??1/0))}};Dn.batchedUpdateContainer=[],Dn.headStyles=new Set;var In=Dn,Rn=class extends Mi{constructor(){super((0,n.n)("div")),this.textElement=(0,n.FJ)("text"),this.textElement.role="presentation",this.svgElement=(0,n.FJ)("svg"),this.svgElement.appendChild(this.textElement),this.svgElement.style.width="100%",this.svgElement.style.opacity="0",this.svgElement.role="presentation",this.elem.appendChild(this.svgElement),this.elem.role="presentation"}set textContent(e){this.textElement.textContent=e;const t=this.textElement,i=t.getBBox?.();i&&this.svgElement.setAttribute("viewBox",`${i.x} ${i.y} ${i.width} ${i.height}`)}get textContent(){return this.textElement.textContent}destructor(){}},kn=class extends Mi{constructor(e,t){super(e),(0,n.Bq)(this.elem,"role",t),this.setEnabled(!0)}destructor(){}setEnabled(e){(0,n.Bq)(this.elem,"aria-disabled",!e)}addListener(e,t){return super.addListener(e,(i,n)=>{("click"!==e&&"dblclick"!==e||!this.isDisabled())&&t(i,n)})}},Pn=class extends kn{constructor(){super((0,n.n)("button"))}},_n=class extends Mi{constructor(){super((0,n.n)("div")),(0,n.Bq)(this.elem,"role","group")}destructor(){}},Ln=class extends Mi{constructor(e,t){super((0,n.n)("div")),this.focusedChildIndex=0,this.onChildFocus=(e,t)=>{const i=this.children[this.focusedChildIndex];this.focusedChildIndex=t.index,i?.setTabIndex(-1),t.setTabIndex(0)},this.onChildKeyDown=(e,t)=>{const i=this.orientation,[n,s]="both"===i?[dn.horizontal,dn.vertical]:[dn[i],void 0];let r=-1;if(ln(e.sourceEvent)){const i=e.sourceEvent.key;i===n.nextKey||i===s?.nextKey?r=t.index+1:i!==n.prevKey&&i!==s?.prevKey||(r=t.index-1)}this.children[r]?.focus()},(0,n.Bq)(this.elem,"role",t),this.orientation=e}get orientation(){return(0,n.D$)(this.elem,"aria-orientation")??"both"}set orientation(e){(0,n.Bq)(this.elem,"aria-orientation","both"!==e?e:void 0)}focus(){this.children[this.focusedChildIndex]?.focus()}clear(){this.focusedChildIndex=0;for(const e of this.children)this.removeChildListeners(e),e.parent=void 0;this.elem.textContent="",this.children.length=0}addChildListeners(e){e.addListener("focus",this.onChildFocus),e.addListener("keydown",this.onChildKeyDown)}removeChildListeners(e){e.removeListener("focus",this.onChildFocus),e.removeListener("keydown",this.onChildKeyDown)}onChildAdded(e){this.addChildListeners(e),e.setTabIndex(1===this.children.length?0:-1)}onChildRemoved(e){this.removeChildListeners(e);const{focusedChildIndex:t,children:i}=this,n=t===e.index;for(let e=0;e<i.length;e++){const n=i[e];n.index===t&&(this.focusedChildIndex=e),n.index=e}if(n){const e=i[t]??i[t-1];e?(this.focusedChildIndex=e.index,e.setTabIndex(0)):this.focusedChildIndex=0}}},Nn=class extends Ln{constructor(){super("both","list"),this.setHidden(!0)}destructor(){this.children.forEach(e=>e.getElement().parentElement.remove())}addChildToDOM(e,t){const i=(0,n.n)("div");(0,n.Bq)(i,"role","listitem"),(0,n.EM)(i,"position","absolute"),Mi.setElementContainer(e,i),this.appendOrInsert(i,t),this.setHidden(!1)}removeChildFromDOM(e){e.getElement().parentElement.remove(),this.setHidden(0===this.children.length)}setHidden(e){0===this.children.length&&(e=!0),super.setHidden(e)}},On=class extends Mi{constructor(e){super(e)}destructor(){}},Fn=new Intl.NumberFormat("en-US",{style:"percent"});function Gn(e,t=2){return"number"==typeof e?Hn(e,t):"string"==typeof e?e:String(e??"")}function Bn(e){return Fn.format(e)}var Vn=(new Map).set(2,new Intl.NumberFormat("en-US",{maximumFractionDigits:2,useGrouping:!1}));function Hn(e,t){let i=Vn.get(t);return i||(i=new Intl.NumberFormat("en-US",{maximumFractionDigits:t,useGrouping:!1}),Vn.set(t,i)),i.format(e)}var Un=class e extends Mi{constructor(){super((0,n.n)("input")),this._step=e.STEP_ONE,this.orientation="both"}get step(){return this._step}set step(e){this._step=e,this.getElement().step=e.attributeValue}get keyboardStep(){return this._keyboardStep?.step??this._step}set keyboardStep(e){if(e!==this._keyboardStep?.step&&(void 0!==this._keyboardStep&&(this.removeListener("keydown",this._keyboardStep.onKeyDown),this.removeListener("keyup",this._keyboardStep.onKeyUp),this.removeListener("blur",this._keyboardStep.onBlur),this._keyboardStep=void 0),void 0!==e)){const t=()=>this.getElement().step=e.attributeValue,i=()=>this.getElement().step=this._step.attributeValue;this._keyboardStep={step:e,onKeyDown:t,onKeyUp:i,onBlur:i},this.addListener("keydown",this._keyboardStep.onKeyDown),this.addListener("keyup",this._keyboardStep.onKeyUp),this.addListener("blur",this._keyboardStep.onBlur)}}get orientation(){return(0,n.D$)(this.elem,"aria-orientation")??"both"}set orientation(t){(0,n.Bq)(this.elem,"aria-orientation","both"!==t?t:void 0),e.registerDefaultPreventers(this,t)}destructor(){}clampValueRatio(e,t){const i=this.getValueRatio(),s=(0,n.qE)(e,i,t);return s!==i&&this.setValueRatio(s),s}setValueRatio(e,t){const{divider:i}=this.step,n=Math.round(1e4*e)/i,{ariaValueText:s=Bn(n/i)}=t??{},r=this.getElement();r.value=`${n}`,r.ariaValueText=s}getValueRatio(){return parseFloat(this.getElement().value)/this.step.divider}static registerDefaultPreventers(t,i){"both"===i?t.removeListener("keydown",e.onKeyDown):t.addListener("keydown",e.onKeyDown)}static onKeyDown(e,t){let i=[];const{orientation:n}=t;"horizontal"===n?i=["ArrowUp","ArrowDown"]:"vertical"===n&&(i=["ArrowLeft","ArrowRight"]),i.includes(e.sourceEvent.code)&&e.sourceEvent.preventDefault()}};Un.STEP_ONE={attributeValue:"1",divider:1},Un.STEP_HUNDRETH={attributeValue:"0.01",divider:100};var zn=Un,Wn=class extends Pn{constructor(){super(),(0,n.Bq)(this.elem,"role","switch"),this.setChecked(!1)}setChecked(e){(0,n.Bq)(this.elem,"aria-checked",e)}},jn=class extends Ln{constructor(e="horizontal"){super(e,"toolbar")}destructor(){}};function $n(e,t){return t.params?.type===e}function Kn(e){const t={params:e,result:void 0};return t.result=function(e){if("button"===e)return new Pn;if("slider"===e)return new zn;if("toolbar"===e)return new jn;if("group"===e)return new _n;if("list"===e)return new Nn;if("region"===e)return new On((0,n.n)("div"));if("text"===e)return new Rn;if("listswitch"===e)return new Wn;throw Error("AG Charts - error allocating meta")}(t.params.type),t}var Yn=class{constructor(e,t){this.localeManager=e,this.domManager=t,this.destroyFns=[]}destroy(){this.destroyFns.forEach(e=>e())}addLocalisation(e){e(),this.destroyFns.push(this.localeManager.addListener("locale-changed",e))}createProxyContainer(e){const t=Kn(e),{params:i,result:n}=t,s=n.getElement();return this.domManager.addChild("canvas-proxy",i.domManagerId,s),s.classList.add(...i.classList,"ag-charts-proxy-container"),s.role=i.type,"ariaOrientation"in i&&(s.ariaOrientation=i.ariaOrientation),$n("toolbar",t)&&(t.result.orientation=t.params.orientation),this.addLocalisation(()=>{s.ariaLabel=this.localeManager.t(i.ariaLabel.id,i.ariaLabel.params)}),n}createProxyElement(e){const t=Kn(e);if($n("button",t)){const{params:e,result:i}=t,n=i.getElement();if(this.initInteract(e,i),"string"==typeof e.textContent)n.textContent=e.textContent;else{const{textContent:t}=e;this.addLocalisation(()=>{n.textContent=this.localeManager.t(t.id,t.params)})}this.setParent(t.params,t.result)}if($n("slider",t)){const{params:e,result:i}=t,n=i.getElement();this.initInteract(e,i),n.type="range",n.role="presentation",n.style.margin="0px",this.addLocalisation(()=>{n.ariaLabel=this.localeManager.t(e.ariaLabel.id,e.ariaLabel.params)}),this.setParent(t.params,t.result)}if($n("text",t)){const{params:e,result:i}=t;this.initElement(e,i),this.setParent(t.params,t.result)}if($n("listswitch",t)){const{params:e,result:i}=t;this.initInteract(e,i),i.setTextContent(e.textContent),i.setChecked(e.ariaChecked),i.setAriaDescribedBy(e.ariaDescribedBy),this.setParent(t.params,t.result)}if($n("region",t)){const{params:e,result:i}=t,n=i.getElement();this.initInteract(e,i),n.role="region",this.setParent(t.params,t.result)}return t.result}initElement(e,t){const i=t.getElement();return(0,n.EM)(i,"cursor",e.cursor),i.classList.toggle("ag-charts-proxy-elem",!0),i}initInteract(e,t){const{tabIndex:i,domIndex:n}=e,s=this.initElement(e,t);void 0!==i&&(s.tabIndex=i),void 0!==n&&(t.domIndex=n)}setParent(e,t){if("parent"in e)e.parent?.addChild(t);else{const i={where:e.where,query:".ag-charts-series-area"};this.domManager.addChild("canvas-proxy",e.domManagerId,t.getElement(),i)}}},qn={ariaAnnounceHoverDatum:"${datum}",ariaAnnounceChart:"chart, ${seriesCount}[number] series",ariaAnnounceHierarchyChart:"hierarchy chart, ${caption}",ariaAnnounceGaugeChart:"gauge chart, ${caption}",ariaAnnounceHierarchyDatum:"level ${level}[number], ${count}[number] children, ${description}",ariaAnnounceFlowProportionLink:"link ${index} of ${count}, from ${from} to ${to}, ${sizeName} ${size}",ariaAnnounceFlowProportionNode:"node ${index} of ${count}, ${description}",ariaDescriptionLegendItem:"Press Space or Enter to toggle visibility",ariaLabelAddHorizontalLine:"Add Horizontal Line",ariaLabelAnnotationOptionsToolbar:"Annotation Options",ariaLabelAnnotationSettingsDialog:"Annotation Settings",ariaLabelColorPicker:"Color picker",ariaLabelFinancialCharts:"Financial Charts",ariaLabelLegend:"Legend",ariaLabelLegendPagination:"Legend Pagination",ariaLabelLegendPagePrevious:"Previous Legend Page",ariaLabelLegendPageNext:"Next Legend Page",ariaLabelLegendItem:"${label}, Legend item ${index}[number] of ${count}[number]",ariaLabelLegendItemUnknown:"Unknown legend item",ariaLabelNavigator:"Navigator",ariaLabelNavigatorRange:"Range",ariaLabelNavigatorMinimum:"Minimum",ariaLabelNavigatorMaximum:"Maximum",ariaLabelRangesToolbar:"Ranges",ariaLabelSettingsTabBar:"Settings",ariaLabelZoomToolbar:"Zoom",ariaValuePanRange:"${min}[percent0to2dp] to ${max}[percent0to2dp]",iconAltTextLineStyleSolid:"Solid",iconAltTextLineStyleDashed:"Long-dashed",iconAltTextLineStyleDotted:"Short-dashed",iconAltTextPositionTop:"Top",iconAltTextPositionCenter:"Center",iconAltTextPositionBottom:"Bottom",iconAltTextAlignLeft:"Left",iconAltTextAlignCenter:"Center",iconAltTextAlignRight:"Right",iconAltTextClose:"Close",overlayLoadingData:"Loading data...",overlayNoData:"No data to display",overlayNoVisibleSeries:"No visible series",overlayUnsupportedBrowser:"Incompatible browser version. Please upgrade your browser.",seriesHistogramTooltipFrequency:"Frequency",seriesHistogramTooltipSum:"${yName} (sum)",seriesHistogramTooltipCount:"${yName} (count)",seriesHistogramTooltipMean:"${yName} (mean)",toolbarSeriesTypeDropdown:"Chart Type",toolbarSeriesTypeOHLC:"OHLC",toolbarSeriesTypeHLC:"HLC",toolbarSeriesTypeHighLow:"High Low",toolbarSeriesTypeCandles:"Candles",toolbarSeriesTypeHollowCandles:"Hollow Candles",toolbarSeriesTypeLine:"Line",toolbarSeriesTypeLineWithMarkers:"Line with Markers",toolbarSeriesTypeStepLine:"Step Line",toolbarAnnotationsTrendLine:"Trend Line",toolbarAnnotationsFibonacciRetracement:"Fib Retracement",toolbarAnnotationsFibonacciRetracementTrendBased:"Fib Trend Based",toolbarAnnotationsHorizontalLine:"Horizontal Line",toolbarAnnotationsVerticalLine:"Vertical Line",toolbarAnnotationsParallelChannel:"Parallel Channel",toolbarAnnotationsDisjointChannel:"Disjoint Channel",toolbarAnnotationsClearAll:"Clear All",toolbarAnnotationsFillColor:"Fill Color",toolbarAnnotationsLineColor:"Line Color",toolbarAnnotationsLineStyle:"Line Style",toolbarAnnotationsLineStrokeWidth:"Line Stroke Width",toolbarAnnotationsSettings:"Settings",toolbarAnnotationsTextColor:"Text Color",toolbarAnnotationsTextSize:"Text Size",toolbarAnnotationsLock:"Lock",toolbarAnnotationsUnlock:"Unlock",toolbarAnnotationsDelete:"Delete",toolbarAnnotationsDragHandle:"Drag Toolbar",toolbarAnnotationsLineAnnotations:"Trend Lines",toolbarAnnotationsFibonacciAnnotations:"Fibonacci",toolbarAnnotationsTextAnnotations:"Text Annotations",toolbarAnnotationsShapeAnnotations:"Arrows",toolbarAnnotationsMeasurerAnnotations:"Measurers",toolbarAnnotationsCallout:"Callout",toolbarAnnotationsComment:"Comment",toolbarAnnotationsNote:"Note",toolbarAnnotationsText:"Text",toolbarAnnotationsArrow:"Arrow",toolbarAnnotationsArrowUp:"Arrow Up",toolbarAnnotationsArrowDown:"Arrow Down",toolbarAnnotationsDateRange:"Date Range",toolbarAnnotationsPriceRange:"Price Range",toolbarAnnotationsDatePriceRange:"Date and Price",toolbarAnnotationsQuickDatePriceRange:"Measure",toolbarRange1Month:"1M",toolbarRange1MonthAria:"1 month",toolbarRange3Months:"3M",toolbarRange3MonthsAria:"3 months",toolbarRange6Months:"6M",toolbarRange6MonthsAria:"6 months",toolbarRangeYearToDate:"YTD",toolbarRangeYearToDateAria:"Year to date",toolbarRange1Year:"1Y",toolbarRange1YearAria:"1 year",toolbarRangeAll:"All",toolbarRangeAllAria:"All",toolbarZoomZoomOut:"Zoom out",toolbarZoomZoomIn:"Zoom in",toolbarZoomPanLeft:"Pan left",toolbarZoomPanRight:"Pan right",toolbarZoomPanStart:"Pan to the start",toolbarZoomPanEnd:"Pan to the end",toolbarZoomReset:"Reset the zoom",contextMenuDownload:"Download",contextMenuToggleSeriesVisibility:"Toggle Visibility",contextMenuToggleOtherSeries:"Toggle Other Series",contextMenuZoomToCursor:"Zoom to here",contextMenuPanToCursor:"Pan to here",dialogHeaderChannel:"Channel",dialogHeaderLine:"Line",dialogHeaderFibonacciRange:"Fib Retracement",dialogHeaderDateRange:"Date Range",dialogHeaderPriceRange:"Price Range",dialogHeaderDatePriceRange:"Date and Price",dialogHeaderText:"Text",dialogInputAlign:"Align",dialogInputColorPicker:"Color",dialogInputColorPickerAltText:"Text Color",dialogInputFillColorPicker:"Fill",dialogInputFillColorPickerAltText:"Fill Color",dialogInputExtendChannelStart:"Extend channel start",dialogInputExtendChannelEnd:"Extend channel end",dialogInputExtendLineStart:"Extend line start",dialogInputExtendLineEnd:"Extend line end",dialogInputExtendAbove:"Extend above",dialogInputExtendBelow:"Extend below",dialogInputExtendLeft:"Extend left",dialogInputExtendRight:"Extend right",dialogInputReverse:"Reverse",dialogInputShowFill:"Show Fill",dialogInputFontSize:"Size",dialogInputFontSizeAltText:"Font Size",dialogInputLineStyle:"Dash",dialogInputPosition:"Position",dialogInputStrokeWidth:"Weight",dialogInputStrokeWidthAltText:"Line Weight",dialogInputFibonacciBands:"Bands",dialogInputFibonacciBandsAltText:"Fibonacci Bands",inputTextareaPlaceholder:"Add Text",measurerDateRangeBars:"${value}[number] bars",measurerPriceRangeValue:"${value}[number]",measurerPriceRangePercent:"${value}[percent]",measurerVolume:"Vol ${value}",tooltipPaginationStatus:"${index}[number] of ${count}[number]"},Xn=/\$\{(\w+)}(?:\[(\w+)])?/gi,Zn={number:new Intl.NumberFormat("en-US"),percent:new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:2,maximumFractionDigits:2}),percent0to2dp:new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:0,maximumFractionDigits:2}),date:new Intl.DateTimeFormat("en-US",{dateStyle:"full"}),time:new Intl.DateTimeFormat("en-US",{timeStyle:"full"}),datetime:new Intl.DateTimeFormat("en-US",{dateStyle:"full",timeStyle:"full"})},Qn=class extends Qi{constructor(){super(...arguments),this.localeText=void 0,this.getLocaleText=void 0}setLocaleText(e){this.localeText!==e&&(this.localeText=e,this.dispatch("locale-changed"))}setLocaleTextFormatter(e){this.getLocaleText=e,this.getLocaleText!==e&&(this.getLocaleText=e,this.dispatch("locale-changed"))}t(e,t={}){const{localeText:i=qn,getLocaleText:s}=this,r=i[e];return s?.({key:e,defaultValue:r,variables:t})??(({defaultValue:e,variables:t})=>e?.replaceAll(Xn,(e,i,s)=>{const r=t[i],o=null!=s?Zn[s]:null;return null!=s&&null==o&&n.Vy.warnOnce(`Format style [${s}] is not supported`),null!=o?o.format(r):"number"==typeof r?Zn.number.format(r):r instanceof Date?Zn.datetime.format(r):String(r)}))({key:e,defaultValue:r,variables:t})??e}},Jn=class{constructor(e){this.enabled=!0,this.width=600,this.height=300;const{width:t,height:i,canvasElement:s,willReadFrequently:r=!1}=e;this.pixelRatio=e.pixelRatio??(0,n.zk)("devicePixelRatio")??1,this.element=s??(0,n.n)("canvas"),this.element.style.display="block",this.element.style.width=(t??this.width)+"px",this.element.style.height=(i??this.height)+"px",this.element.width=Math.round((t??this.width)*this.pixelRatio),this.element.height=Math.round((i??this.height)*this.pixelRatio),this.context=this.element.getContext("2d",{willReadFrequently:r}),this.onEnabledChange(),this.resize(t??0,i??0,this.pixelRatio),C(this.context)}drawImage(e,t=0,i=0){return e.drawImage(this.context.canvas,t,i)}toDataURL(e){return this.element.toDataURL(e)}resize(e,t,i){if(!(e>0&&t>0))return;const{element:n,context:s}=this;n.width=Math.round(e*i),n.height=Math.round(t*i),s.setTransform(i,0,0,i,0,0),n.style.width=e+"px",n.style.height=t+"px",this.width=e,this.height=t,this.pixelRatio=i}clear(){b(this)}destroy(){this.element.remove(),this.element.width=0,this.element.height=0,this.context.clearRect(0,0,0,0),Object.freeze(this)}reset(){this.context.resetTransform()}onEnabledChange(){this.element&&(this.element.style.display=this.enabled?"":"none")}};a([ci(e=>e.onEnabledChange())],Jn.prototype,"enabled",2);var es=class extends n.bk{constructor(){super(...arguments),this.cache=new Map,this.imageLoadingCount=0}loadImage(e,t){const i=this.cache.get(e);if(i?.image)return i.image;if(null!=i&&t)return void i.nodes.add(t);if(!t)return;const n={image:void 0,nodes:new Set([t])},s=new Image;return this.imageLoadingCount++,s.onload=()=>{n.image=s,n.nodes.forEach(e=>e.markDirty()),n.nodes.clear(),this.imageLoadingCount--,this.emit("image-loaded",{uri:e})},s.onerror=()=>{this.imageLoadingCount--,n.nodes.clear(),this.emit("image-error",{uri:e})},s.src=e,this.cache.set(e,n),n.image}waitingToLoad(){return this.imageLoadingCount>0}destroy(){this.cache.forEach(e=>{e.nodes.clear()}),this.cache.clear()}},ts=class{constructor(e){this.canvas=e,this.debug=v.create(!0,"scene"),this.layersMap=new Map,this.nextLayerId=0}get size(){return this.layersMap.size}resize(e,t,i){this.canvas.resize(e,t,i),this.layersMap.forEach(({canvas:n})=>n.resize(e,t,i))}addLayer(e){const{width:t,height:i,pixelRatio:n}=this.canvas,{name:s}=e,r=new S({width:t,height:i,pixelRatio:n});return this.layersMap.set(r,{id:this.nextLayerId++,name:s,canvas:r}),this.debug("Scene.addLayer() - layers",this.layersMap),r}removeLayer(e){this.layersMap.has(e)&&(this.layersMap.delete(e),e.destroy(),this.debug("Scene.removeLayer() -  layers",this.layersMap))}clear(){for(const e of this.layersMap.values())e.canvas.destroy();this.layersMap.clear()}};function is(e){for(const t of["B","KB","MB","GB"]){if(e<1536)return`${e.toFixed(1)}${t}`;e/=1024}return`${e.toFixed(1)}TB}`}function ns(e,t,i,s,r={},o=m.zero){if(!v.check("scene:stats","scene:stats:verbose"))return;const{layersRendered:a=0,layersSkipped:l=0,nodesRendered:c=0,nodesSkipped:h=0,opsPerformed:u=0,opsSkipped:d=0}=s??{},p=performance.now(),{start:g,...f}=t,y=Object.entries(f).map(([e,t])=>hs(e,t)).filter(e=>null!=e).join(" + "),b=Object.entries(r).map(([e,t])=>`${e}: ${JSON.stringify(t)}`).join(" ; "),C=v.check("scene:stats:verbose"),w=function(){if(!("memory"in performance))return;const{totalJSHeapSize:e,usedJSHeapSize:t,jsHeapSizeLimit:i}=performance.memory,n=[];for(const s of[t,e,i])"number"==typeof s&&n.push(is(s));return`Heap ${n.join(" / ")}`}(),S=[`${hs("⏱️",g,p)} (${y})`,`${b}`,`Layers: ${C?cs(a,l):e.size}`,C?`Nodes: ${cs(c,h)}`:null,C?`Ops: ${cs(u,d)}`:null,C&&w?w:null].filter(n.Kg),x=new ki(e=>i.measureText(e)),E=new Map(S.map(e=>[e,x.measureLines(e)])),A=Math.max(...Array.from(E.values(),e=>e.width)),M=function(e,t){let i=0;for(const n of e)i+=t(n);return i}(E.values(),e=>e.height),T=2+o.x;i.save(),i.fillStyle="white",i.fillRect(T,0,A,M),i.fillStyle="black";let D=0;for(const[e,t]of E.entries())D+=t.height,i.fillText(e,T,D);i.restore()}var ss=new Set,rs=new Set(["gradient","zIndex","clipRect","cachedBBox","childNodeCounts","path","__zIndex","name","__scalingCenterX","__scalingCenterY","__rotationCenterX","__rotationCenterY","_previousDatum","__fill","__lineDash","borderPath","borderClipPath","_clipPath"]);function os(e){const{...t}=e;for(const e of Object.keys(t))rs.has(e)||"number"!=typeof t[e]&&"string"!=typeof t[e]&&"boolean"!=typeof t[e]&&(ss.add(e),delete t[e]);return t}function as(e,t){if(!v.check(!0,"scene"))return{};let i=0;return{node:"json"===t?os(e):e,name:e.name??e.id,dirty:e.dirty,...Array.from(e.children(),e=>as(e,t)).reduce((e,t)=>{let{name:n}=t;const{node:{visible:s,opacity:r,zIndex:o,translationX:a,translationY:l,rotation:c,scalingX:h,scalingY:u},node:d}=t;(!s||r<=0)&&(n=`(${n})`),Mt.is(d)&&d.renderToOffscreenCanvas&&(n=`*${n}*`);const p=Array.isArray(o)?`(${o.join(", ")})`:o,g=[`${(i++).toString().padStart(3,"0")}|`,`${n??"<unknown>"}`,`z: ${p}`,a&&`x: ${a}`,l&&`y: ${l}`,c&&`r: ${c}`,null!=h&&1!==h&&`sx: ${h}`,null!=u&&1!==u&&`sy: ${u}`].filter(e=>!!e).join(" ");let f=g,m=1;for(;null!=e[f]&&m<100;)f=`${g} (${m++})`;return e[f]=t,e},{})}}function ls(e){if(!e.dirty)return{dirtyTree:{},paths:[]};const t=Array.from(e.children(),e=>ls(e)).filter(e=>e.paths.length>0),i=Mt.is(e)?e.name??e.id:e.id,n=t.length?t.flatMap(e=>e.paths).map(e=>`${i}.${e}`):[i];return{dirtyTree:{name:i,node:e,dirty:e.dirty,...t.map(e=>e.dirtyTree).filter(e=>null!=e.dirty).reduce((e,t)=>(e[t.name??"<unknown>"]=t,e),{})},paths:n}}function cs(e,t){const i=e+t;return`${e} / ${i} (${Math.round(100*e/i)}%)`}function hs(e,t,i){const n=null!=i?i-t:t;return`${e}: ${Math.round(100*n)/100}ms`}var us=class extends n.bk{constructor(e){super(),this.debug=v.create(!0,"scene"),this.id=(0,n.sX)(this),this.imageLoader=new es,this.root=null,this.pendingSize=null,this.isDirty=!1,this.destroyFns=[],this.updateDebugFlags(),this.canvas=new Jn(e),this.layersManager=new ts(this.canvas),this.destroyFns.push(this.imageLoader.on("image-loaded",()=>{this.emit("scene-changed",{})}),this.imageLoader.on("image-error",({uri:e})=>{n.Vy.warnOnce(`Unable to load image ${e}`)}))}waitingForUpdate(){return this.imageLoader?.waitingToLoad()??!1}get width(){return this.pendingSize?.[0]??this.canvas.width}get height(){return this.pendingSize?.[1]??this.canvas.height}get pixelRatio(){return this.pendingSize?.[2]??this.canvas.pixelRatio}setContainer(e){const{element:t}=this.canvas;return t.parentElement?.removeChild(t),e.appendChild(t),this}setRoot(e){return this.root===e||(this.isDirty=!0,this.root?.setScene(),this.root=e,e&&(e.visible=!0,e.setScene(this))),this}updateDebugFlags(){v.inDevelopmentMode(()=>J._debugEnabled=!0)}clearCanvas(){this.canvas.clear()}attachNode(e){return this.appendChild(e),()=>this.removeChild(e)}appendChild(e){return this.root?.appendChild(e),this}removeChild(e){return this.root?.removeChild(e),this}download(e,t){(0,n.Is)(this.canvas.toDataURL(t),e?.trim()??"image")}getDataURL(e){return this.canvas.toDataURL(e)}resize(e,t,i){return e=Math.round(e),t=Math.round(t),i??(i=this.pixelRatio),e>0&&t>0&&(e!==this.width||t!==this.height||i!==this.pixelRatio)&&(this.pendingSize=[e,t,i],this.isDirty=!0,!0)}render(e){const{debugSplitTimes:t={start:performance.now()},extraDebugStats:i,seriesRect:s}=e??{},{canvas:r,canvas:{context:o}={},root:a,pendingSize:l,width:c,height:h,pixelRatio:u}=this;if(!o)return;const d=performance.now();let p=!1;if(l&&(p=!0,this.layersManager.resize(...l),this.pendingSize=null),a&&!a.visible)return void(this.isDirty=!1);if(!1===a?.dirty&&!this.isDirty)return this.debug.check()&&this.debug("Scene.render() - no-op",{tree:as(a,"console")}),void ns(this.layersManager,t,o,void 0,i,s);const g={ctx:o,width:c,height:h,devicePixelRatio:u,debugNodes:{}};v.check("scene:stats:verbose")&&(g.stats={layersRendered:0,layersSkipped:0,nodesRendered:0,nodesSkipped:0,opsPerformed:0,opsSkipped:0}),function(e){const t=(0,n.$r)((0,n.zk)("agChartsSceneDebug")),i=[];for(const e of t)"layout"===e?i.push("seriesRoot","legend","root",/.*Axis-\d+-axis.*/):i.push(e);e.debugNodeSearch=i}(g);let f=!1;if((!1!==a?.dirty||p)&&(f=!0,r.clear()),a&&v.check("scene:dirtyTree")){const{dirtyTree:e,paths:t}=ls(a);v.create("scene:dirtyTree")("Scene.render() - dirtyTree",{dirtyTree:e,paths:t})}if(a&&f){if(a.visible&&a.preRender(g),this.debug.check()){const e=as(a,"console");this.debug("Scene.render() - before",{canvasCleared:f,tree:e})}if(a.visible)try{o.save(),a.render(g),o.restore()}catch(e){throw this.canvas.reset(),e}}t["✍️"]=performance.now()-d,o.verifyDepthZero?.(),this.isDirty=!1,ns(this.layersManager,t,o,g.stats,i,s),function(e,t){e.save();for(const[i,s]of Object.entries(t)){const t=St.toCanvas(s);t?(e.globalAlpha=.8,e.strokeStyle="red",e.lineWidth=1,e.strokeRect(t.x,t.y,t.width,t.height),e.fillStyle="red",e.strokeStyle="white",e.font="16px sans-serif",e.textBaseline="top",e.textAlign="left",e.lineWidth=2,e.strokeText(i,t.x,t.y,t.width),e.fillText(i,t.x,t.y,t.width)):n.Vy.log(`Scene.render() - no bbox for debugged node [${i}].`)}e.restore()}(o,g.debugNodes),a&&this.debug.check()&&this.debug("Scene.render() - after",{tree:as(a,"console"),canvasCleared:f})}toSVG(){const{root:e,width:t,height:i}=this;if(null!=e)return J.toSVG(e,t,i)}strip(){const{context:e,pixelRatio:t}=this.canvas;e.setTransform(t,0,0,t,0,0),this.layersManager.clear(),this.setRoot(null),this.isDirty=!1,this.clear()}destroy(){this.strip(),this.canvas.destroy(),this.imageLoader.destroy(),this.destroyFns.forEach(e=>e()),Object.assign(this,{canvas:void 0})}};function ds(e,t){return!(!function(e){return"context"in e}(e)||null==t[0]||"object"!=typeof t[0]||(t[0].context=e.context,0))}function ps(e,t,i,n){return ds(e,n)||t&&ds(t,n),i(...n)}us.className="Scene";var gs=class{constructor(){this.cache=new WeakMap}call(e,t,i,...n){let s,r=this.cache.get(i);try{s=JSON.stringify(n)}catch{return this.invoke(e,t,i,n,r)}return null==r&&(r=new Map,this.cache.set(i,r)),r.has(s)?r.get(s):this.invoke(e,t,i,n,r,s)}invoke(e,t,i,s,r,o){try{const n=ps(e,t,i,s);return r&&null!=o&&r.set(o,n),n}catch(e){return void n.Vy.warnOnce("User callback errored, ignoring",e)}}invalidateCache(){this.cache=new WeakMap}},fs=class extends Ji{constructor(e,t){super(),this.annotationRoot=e,this.fireChartEvent=t,this.mementoOriginatorKey="annotations",this.annotations=[]}createMemento(){return this.annotations}guardMemento(e){return null==e||(0,n.cy)(e)}restoreMemento(e,t,i){this.annotations=this.cleanData(i??[]).map(e=>L(e,this.getAnnotationTypeStyles(e.type))),this.listeners.dispatch("restore-annotations",{type:"restore-annotations",annotations:this.annotations})}updateData(e){this.annotations=this.cleanData(e??[])}fireChangedEvent(){this.fireChartEvent({type:"annotations",annotations:Bt([...this.annotations])})}attachNode(e){return this.annotationRoot.append(e),()=>(this.annotationRoot?.removeChild(e),this)}setAnnotationStyles(e){this.styles=e}getAnnotationTypeStyles(e){return this.styles?.[e]}cleanData(e){for(const t of e)"textAlign"in t&&delete t.textAlign;return e}},ms=(e=>(e[e.CHART_BACKGROUND=0]="CHART_BACKGROUND",e[e.AXIS_GRID=1]="AXIS_GRID",e[e.AXIS=2]="AXIS",e[e.ZOOM_SELECTION=3]="ZOOM_SELECTION",e[e.SERIES_CROSSLINE_RANGE=4]="SERIES_CROSSLINE_RANGE",e[e.SERIES_LAYER=5]="SERIES_LAYER",e[e.AXIS_FOREGROUND=6]="AXIS_FOREGROUND",e[e.SERIES_CROSSHAIR=7]="SERIES_CROSSHAIR",e[e.SERIES_CROSSLINE_LINE=8]="SERIES_CROSSLINE_LINE",e[e.SERIES_ANNOTATION=9]="SERIES_ANNOTATION",e[e.CHART_ANNOTATION=10]="CHART_ANNOTATION",e[e.CHART_ANNOTATION_FOCUSED=11]="CHART_ANNOTATION_FOCUSED",e[e.STATUS_BAR=12]="STATUS_BAR",e[e.SERIES_LABEL=13]="SERIES_LABEL",e[e.LEGEND=14]="LEGEND",e[e.NAVIGATOR=15]="NAVIGATOR",e[e.FOREGROUND=16]="FOREGROUND",e))(ms||{}),ys=class{constructor(e){this.sceneRoot=e,this.axes=new Map,this.axisGridGroup=new Mt({name:"Axes-Grids",zIndex:1}),this.axisGroup=new Mt({name:"Axes",zIndex:2}),this.axisLabelGroup=new Mt({name:"Axes-Labels",zIndex:13}),this.axisCrosslineRangeGroup=new Mt({name:"Axes-Crosslines-Range",zIndex:4}),this.axisCrosslineLineGroup=new Mt({name:"Axes-Crosslines-Line",zIndex:8}),this.axisCrosslineLabelGroup=new Mt({name:"Axes-Crosslines-Label",zIndex:13}),this.sceneRoot.appendChild(this.axisGroup),this.sceneRoot.appendChild(this.axisGridGroup),this.sceneRoot.appendChild(this.axisLabelGroup),this.sceneRoot.appendChild(this.axisCrosslineRangeGroup),this.sceneRoot.appendChild(this.axisCrosslineLineGroup),this.sceneRoot.appendChild(this.axisCrosslineLabelGroup)}updateAxes(e,t){const i={axisNode:this.axisGroup,gridNode:this.axisGridGroup,labelNode:this.axisLabelGroup,crossLineRangeNode:this.axisCrosslineRangeGroup,crossLineLineNode:this.axisCrosslineLineGroup,crossLineLabelNode:this.axisCrosslineLabelGroup};for(const n of e)t.includes(n)||(n.detachAxis(i),n.destroy());for(const n of t)e?.includes(n)||n.attachAxis(i);this.axes.clear();for(const e of t){const t=e.createAxisContext();this.axes.has(t.direction)?this.axes.get(t.direction)?.push(t):this.axes.set(t.direction,[t])}}getAxisContext(e){return this.axes.get(e)??[]}destroy(){this.axes.clear(),this.sceneRoot.removeChild(this.axisGroup),this.sceneRoot.removeChild(this.axisGridGroup)}},vs=(e=>(e[e.FULL=0]="FULL",e[e.UPDATE_DATA=1]="UPDATE_DATA",e[e.PROCESS_DATA=2]="PROCESS_DATA",e[e.PROCESS_DOMAIN=3]="PROCESS_DOMAIN",e[e.PERFORM_LAYOUT=4]="PERFORM_LAYOUT",e[e.SERIES_UPDATE=5]="SERIES_UPDATE",e[e.PRE_SCENE_RENDER=6]="PRE_SCENE_RENDER",e[e.SCENE_RENDER=7]="SCENE_RENDER",e[e.NONE=8]="NONE",e))(vs||{}),bs=class extends Qi{constructor(e){super(),this.animationManager=e,this.dispatchOnlyLatest=!0,this.dispatchThrottle=0,this.requestThrottle=300,this.isLoadingInitialData=!1,this.isLoadingData=!1,this.freshRequests=[],this.requestCounter=0,this.debug=v.create(!0,"data-model","data-source"),this.throttledFetch=this.createThrottledFetch(this.requestThrottle),this.throttledDispatch=this.createThrottledDispatch(this.dispatchThrottle)}updateCallback(e){"function"==typeof e&&(this.debug("DataService - updated data source callback"),this.dataSourceCallback=e,this.isLoadingInitialData=!0,this.animationManager.skip(),this.dispatch("data-source-change"))}clearCallback(){this.dataSourceCallback=void 0}load(e){this.isLoadingData=!0,this.throttledFetch(e)}isLazy(){return null!=this.dataSourceCallback}isLoading(){return this.isLazy()&&(this.isLoadingInitialData||this.isLoadingData)}createThrottledFetch(e){return(0,n.nF)(e=>this.fetch(e).catch(e=>n.Vy.error("callback failed",e)),e,{leading:!1,trailing:!0})}createThrottledDispatch(e){return(0,n.nF)((e,t)=>{this.debug(`DataService - dispatching 'data-load' | ${e}`),this.dispatch("data-load",{type:"data-load",data:t})},e,{leading:!0,trailing:!0})}async fetch(e){if(!this.dataSourceCallback)throw new Error("DataService - [dataSource.getData] callback not initialised");const t=performance.now(),i=this.requestCounter++;let s;this.debug(`DataService - requesting | ${i}`),this.freshRequests.push(i);try{s=await this.dataSourceCallback(e),this.debug(`DataService - response | ${performance.now()-t}ms | ${i}`)}catch(e){this.debug(`DataService - request failed | ${i}`),n.Vy.errorOnce(`DataService - request failed | [${e}]`)}this.isLoadingInitialData=!1;const r=this.freshRequests.findIndex(e=>e===i);-1===r||this.dispatchOnlyLatest&&r!==this.freshRequests.length-1?this.debug(`DataService - discarding stale request | ${i}`):(this.freshRequests=this.freshRequests.slice(r+1),0===this.freshRequests.length&&(this.isLoadingData=!1),Array.isArray(s)?this.throttledDispatch(i,s):this.dispatch("data-error"))}};a([li({newValue(e){this.throttledDispatch=this.createThrottledDispatch(e)}})],bs.prototype,"dispatchThrottle",2),a([li({newValue(e){this.throttledFetch=this.createThrottledFetch(e)}})],bs.prototype,"requestThrottle",2);var Cs=class{constructor(e,t){this.domManager=e,this.updateService=t,this.observers=[]}updateFonts(e){e&&0!==e.size&&(this.loadFonts(e),e.forEach(e=>{this.observeFontStatus(e)}))}destroy(){for(const e of this.observers)e.disconnect();this.observers=[]}loadFonts(e){const t=Array.from(e).map(e=>encodeURIComponent(e)),i=":wght@100;200;300;400;500;600;700;800;900",n=`${i}&family=`,s=`@import url('https://fonts.googleapis.com/css2?family=${t.join(n)}${i}&display=swap');\n`;this.domManager.addStyles(`google-font-${t.join("-")}`,s)}observeFontStatus(e){const t=window.document.createElement("div");t.style.setProperty("position","absolute"),t.style.setProperty("top","0"),t.style.setProperty("margin","0"),t.style.setProperty("padding","0"),t.style.setProperty("overflow","hidden"),t.style.setProperty("visibility","hidden"),t.style.setProperty("width","auto"),t.style.setProperty("max-width","none"),t.style.setProperty("font-synthesis","none"),t.style.setProperty("font-family",e),t.style.setProperty("font-size","16px"),t.style.setProperty("white-space","nowrap"),t.textContent="UVWxyz",this.domManager.addChild("canvas-container",`font-check-${encodeURIComponent(e)}`,t);const i=new ResizeObserver(e=>{const t=e?.at(0)?.contentBoxSize.at(0)?.inlineSize;null!=t&&t>0&&(Di.clear(),this.updateService.update(4))});i.observe(t),this.observers.push(i)}};function ws(e,t){if("string"==typeof e)try{e=me.fromString(e)}catch{e=me.fromArray([0,0,0])}if("string"==typeof t)try{t=me.fromString(t)}catch{t=me.fromArray([0,0,0])}return i=>me.mix(e,t,i).toRgbaString()}var Ss={};o(Ss,{easeIn:()=>Es,easeInOut:()=>Ms,easeInOutQuad:()=>Is,easeInQuad:()=>Ts,easeOut:()=>As,easeOutQuad:()=>Ds,inverseEaseOut:()=>Rs,linear:()=>xs});var xs=e=>e,Es=e=>1-Math.cos(e*Math.PI/2),As=e=>Math.sin(e*Math.PI/2),Ms=e=>-(Math.cos(e*Math.PI)-1)/2,Ts=e=>e*e,Ds=e=>1-(1-e)**2,Is=e=>e<.5?2*e*e:1-(-2*e+2)**2/2,Rs=e=>2*Math.asin(e)/Math.PI,ks=["initial","remove","update","add","trailing","end","none"],Ps={initial:{animationDuration:1,animationDelay:0},add:{animationDuration:.25,animationDelay:.75},remove:{animationDuration:.25,animationDelay:0},update:{animationDuration:.5,animationDelay:.25},trailing:{animationDuration:.2,animationDelay:1,skipIfNoEarlierAnimations:!0},end:{animationDelay:1.2,animationDuration:0,skipIfNoEarlierAnimations:!0},none:{animationDuration:0,animationDelay:0}},_s=(e=>(e.Loop="loop",e.Reverse="reverse",e))(_s||{});function Ls(e){return e.every(e=>e instanceof J)?{nodes:e,selections:[]}:{nodes:[],selections:e}}function Ns(e,t){return e===t||(Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((e,i)=>Ns(e,t[i])):d(e)&&d(t)?e.equals(t):!(!(0,n.Qd)(e)||!(0,n.Qd)(t))&&_(e,t,Ns))}var Os=class{constructor(e){this.isComplete=!1,this.elapsed=0,this.iteration=0,this.isPlaying=!1,this.isReverse=!1,this.id=e.id,this.groupId=e.groupId,this.autoplay=e.autoplay??!0,this.ease=e.ease??xs,this.phase=e.phase;const t=e.duration??Ps[this.phase].animationDuration;this.duration=t*e.defaultDuration,this.delay=(e.delay??0)*e.defaultDuration,this.onComplete=e.onComplete,this.onPlay=e.onPlay,this.onStop=e.onStop,this.onUpdate=e.onUpdate,this.interpolate=this.createInterpolator(e.from,e.to),this.from=e.from,!0===e.skip&&(this.onUpdate?.(e.to,!1,this),this.onStop?.(this),this.onComplete?.(this),this.isComplete=!0),!1!==e.collapsable&&(this.duration=this.checkCollapse(e,this.duration))}checkCollapse(e,t){return Ns(e.from,e.to)?0:t}play(e=!1){this.isPlaying||this.isComplete||(this.isPlaying=!0,this.onPlay?.(this),this.autoplay&&(this.autoplay=!1,e&&this.onUpdate?.(this.from,!0,this)))}stop(){this.isPlaying=!1,this.isComplete||(this.isComplete=!0,this.onStop?.(this))}update(e){if(this.isComplete)return e;!this.isPlaying&&this.autoplay&&this.play(!0);const t=this.elapsed;if(this.elapsed+=e,this.delay>this.elapsed)return 0;const i=this.interpolate(this.isReverse?1-this.delta:this.delta);this.onUpdate?.(i,!1,this);const n=this.delay+this.duration;return this.elapsed>=n?(this.stop(),this.isComplete=!0,this.onComplete?.(this),e-(n-t)):0}get delta(){return this.ease((0,n.qE)(0,(this.elapsed-this.delay)/this.duration,1))}createInterpolator(e,t){if("object"!=typeof t||d(t))return this.interpolateValue(e,t);const i=[];for(const n of Object.keys(t)){const s=this.interpolateValue(e[n],t[n]);null!=s&&i.push([n,s])}return e=>{const t={};for(const[n,s]of i)t[n]=s(e);return t}}interpolateValue(e,t){if(null!=e&&null!=t){if(d(e))return i=>e[u](t,i);try{switch(typeof e){case"number":return function(e,t){return i=>Number(e)*(1-i)+Number(t)*i}(e,t);case"string":return ws(e,t);case"boolean":if(e===t)return()=>e;break;case"object":return()=>e;default:throw new Error(`Unable to interpolate values: ${e}, ${t}`)}}catch{}throw new Error(`Unable to interpolate values: ${e}, ${t}`)}}},Fs=class{constructor(e){this.maxAnimationTime=e,this.debug=v.create(!0,"animation"),this.controllers=new Map,this.stoppedCbs=new Set,this.currentPhase=0,this.phases=new Map(ks.map(e=>[e,[]])),this.skipAnimations=!1,this.animationTimeConsumed=0,this.isReady=!1}get size(){return this.controllers.size}get consumedTimeMs(){return this.animationTimeConsumed}isActive(){return this.controllers.size>0}getActiveControllers(){return this.phases.get(ks[this.currentPhase])??[]}checkOverlappingId(e){null!=e&&this.controllers.has(e)&&(this.controllers.get(e).stop(),this.debug(`Skipping animation batch due to update of existing animation: ${e}`),this.skip())}addAnimation(e){if(!e.isComplete)return ks.indexOf(e.phase)<this.currentPhase?(this.debug("Skipping animation due to being for an earlier phase",e.id),void e.stop()):(this.controllers.set(e.id,e),void this.phases.get(e.phase)?.push(e))}removeAnimation(e){this.controllers.delete(e.id);const t=this.phases.get(e.phase),i=t?.indexOf(e);null!=i&&i>=0&&t?.splice(i,1)}progress(e){if(!this.isReady)return;let t=0===e?.01:e;const i=()=>{const e=ks[this.currentPhase];return{phaseControllers:[...this.getActiveControllers()],phase:e,phaseMeta:Ps[e]}};let{phase:n,phaseControllers:s,phaseMeta:r}=i();const o=()=>null==ks[this.currentPhase],a=()=>{for(({phase:n,phaseControllers:s,phaseMeta:r}=i());!o()&&0===s.length;)this.currentPhase++,({phase:n,phaseControllers:s,phaseMeta:r}=i()),this.debug(`AnimationBatch - phase changing to ${n}`,{unusedTime:t},s)},l=this.controllers.size;this.debug(`AnimationBatch - ${e}ms; phase ${n} with ${s?.length} of ${l}`);do{const e=t,i=r.skipIfNoEarlierAnimations&&0===this.animationTimeConsumed;let n=0;for(const r of s)i?r.stop():t=Math.min(r.update(e),t),r.isComplete&&(n++,this.removeAnimation(r));this.animationTimeConsumed+=e-t,this.debug(`AnimationBatch - updated ${s.length} controllers; ${n} completed`),this.debug(`AnimationBatch - animationTimeConsumed: ${this.animationTimeConsumed}`),a()}while(t>0&&!o());this.animationTimeConsumed>this.maxAnimationTime&&(this.debug("Animation batch exceeded max animation time, skipping",[...this.controllers]),this.stop())}ready(){if(this.isReady)return;this.isReady=!0,this.debug(`AnimationBatch - ready; skipped: ${this.skipAnimations}`,[...this.controllers]);let e=!0;for(const[,t]of this.controllers)if(t.duration>0&&!0!==Ps[t.phase].skipIfNoEarlierAnimations){e=!1;break}if(!e)for(const[,e]of this.controllers)e.autoplay&&e.play(!0)}skip(e=!0){if(!1===this.skipAnimations&&!0===e){for(const e of this.controllers.values())e.stop();this.controllers.clear()}this.skipAnimations=e}play(){for(const e of this.controllers.values())e.play()}stop(){for(const e of this.controllers.values())try{e.stop(),this.removeAnimation(e)}catch(e){n.Vy.error("Error during animation stop",e)}this.dispatchStopped()}stopByAnimationId(e){if(null!=e&&this.controllers.has(e)){const t=this.controllers.get(e);t&&(t.stop(),this.removeAnimation(t))}}stopByAnimationGroupId(e){for(const t of this.controllers.values())t.groupId===e&&this.stopByAnimationId(t.id)}dispatchStopped(){this.stoppedCbs.forEach(e=>e()),this.stoppedCbs.clear()}isSkipped(){return this.skipAnimations}getRemainingTime(e){if(!this.isActive())return 0;let t=0;for(const[i,n]of this.phases)0!==n.length&&(null!=e&&e!==i||(t+=Math.max(...n.map(e=>e.isComplete?0:e.delay+e.duration-(e.elapsed??0)))));return t}destroy(){this.stop(),this.controllers.clear()}},Gs=(e=>(e[e.Default=32]="Default",e[e.ZoomDrag=16]="ZoomDrag",e[e.Annotations=8]="Annotations",e[e.ContextMenu=4]="ContextMenu",e[e.Animation=2]="Animation",e[e.AnnotationsSelected=1]="AnnotationsSelected",e[e.Clickable=41]="Clickable",e[e.Focusable=34]="Focusable",e[e.Keyable=43]="Keyable",e[e.ContextMenuable=36]="ContextMenuable",e[e.AnnotationsMoveable=9]="AnnotationsMoveable",e[e.AnnotationsDraggable=57]="AnnotationsDraggable",e[e.ZoomDraggable=50]="ZoomDraggable",e[e.ZoomClickable=34]="ZoomClickable",e[e.ZoomWheelable=59]="ZoomWheelable",e[e.All=63]="All",e))(Gs||{}),Bs=class{constructor(){this.stateQueue=34}pushState(e){this.stateQueue|=e}popState(e){this.stateQueue&=~e}isState(e){return!!(this.stateQueue&-this.stateQueue&e)}};function Vs(e){return null==e||!isNaN(e)&&e>=0&&e<=2}var Hs=class{constructor(e,t){this.interactionManager=e,this.chartUpdateMutex=t,this.defaultDuration=1e3,this.batch=new Fs(1.5*this.defaultDuration),this.debug=v.create(!0,"animation"),this.events=new n.bk,this.rafAvailable="undefined"!=typeof requestAnimationFrame,this.isPlaying=!0,this.requestId=null,this.skipAnimations=!0,this.currentAnonymousAnimationId=0}addListener(e,t){return this.events.on(e,t)}animate(e){const t=this.batch;try{t.checkOverlappingId(e.id)}catch(e){return void this.failsafeOnError(e)}let{id:i}=e;null==i&&(i=`__${this.currentAnonymousAnimationId}`,this.currentAnonymousAnimationId+=1);const n=this.isSkipped()||"none"===e.phase;n&&this.debug("AnimationManager - skipping animation");const{delay:s,duration:r}=e;if(!Vs(s))throw new Error(`Animation delay of ${s} is unsupported (${i})`);if(!Vs(r))throw new Error(`Animation duration of ${r} is unsupported (${i})`);const o=new Os({...e,id:i,skip:n,autoplay:!!this.isPlaying&&e.autoplay,phase:e.phase,defaultDuration:this.defaultDuration});if(!this.forceTimeJump(o,this.defaultDuration))return this.batch.addAnimation(o),o}play(){if(!this.isPlaying){this.isPlaying=!0,this.debug("AnimationManager.play()");try{this.batch.play()}catch(e){this.failsafeOnError(e)}this.requestAnimation()}}stop(){this.isPlaying=!1,this.cancelAnimation(),this.debug("AnimationManager.stop()"),this.batch.stop()}stopByAnimationId(e){try{this.batch.stopByAnimationId(e)}catch(e){this.failsafeOnError(e)}}stopByAnimationGroupId(e){try{this.batch.stopByAnimationGroupId(e)}catch(e){this.failsafeOnError(e)}}reset(){this.isPlaying?(this.stop(),this.play()):this.stop()}skip(e=!0){this.skipAnimations=e}isSkipped(){return!this.rafAvailable||this.skipAnimations||this.batch.isSkipped()}isActive(){return this.isPlaying&&this.batch.isActive()}getRemainingTime(e){return this.batch.getRemainingTime(e)}skipCurrentBatch(){this.debug.check()&&this.debug("AnimationManager - skipCurrentBatch()",{stack:(new Error).stack}),this.batch.skip()}isSkippingFrames(){return!0}scheduleAnimationFrame(e){this.requestId=(0,n.zk)().requestAnimationFrame(t=>{e(t).catch(e=>n.Vy.error(e))})}forceTimeJump(e,t){return!1}requestAnimation(){if(!this.rafAvailable)return;if(!this.batch.isActive()||null!==this.requestId)return;let e;const t=async i=>{const n=()=>{const t=i-(e??i);e=i,this.debug("AnimationManager - onAnimationFrame()",{controllersCount:this.batch.size,deltaTime:t}),this.interactionManager.pushState(2);try{this.batch.progress(t)}catch(e){this.failsafeOnError(e)}this.events.emit("animation-frame",{type:"animation-frame",deltaMs:t})};this.isSkippingFrames()?await this.chartUpdateMutex.acquireImmediately(n):await this.chartUpdateMutex.acquire(n),this.batch.isActive()?this.scheduleAnimationFrame(t):(this.batch.stop(),this.events.emit("animation-stop",{type:"animation-stop",deltaMs:this.batch.consumedTimeMs}))};this.events.emit("animation-start",{type:"animation-start",deltaMs:0}),this.scheduleAnimationFrame(t)}cancelAnimation(){null!==this.requestId&&(cancelAnimationFrame(this.requestId),this.requestId=null,this.startBatch())}failsafeOnError(e,t=!0){n.Vy.error("Error during animation, skipping animations",e),t&&this.cancelAnimation()}startBatch(e){this.debug(`AnimationManager - startBatch() with skipAnimations=${e}.`),this.reset(),this.batch.destroy(),this.batch=new Fs(1.5*this.defaultDuration),!0===e&&this.batch.skip()}endBatch(){this.batch.isActive()?(this.batch.ready(),this.requestAnimation()):(this.interactionManager.popState(2),this.batch.isSkipped()&&this.batch.skip(!1))}onBatchStop(e){this.batch.stoppedCbs.add(e)}destroy(){this.stop(),this.events.clear()}},Us=class extends Ji{seriesEvent(e){this.listeners.dispatch(e,{type:e})}seriesKeyNavZoom(e,t){const i={type:"series-keynav-zoom",delta:e,widgetEvent:t};this.listeners.dispatch("series-keynav-zoom",i)}legendItemClick(e,t,i,n,s){const r={type:"legend-item-click",legendType:e,series:t,itemId:i,enabled:n,legendItemName:s};this.listeners.dispatch("legend-item-click",r)}legendItemDoubleClick(e,t,i,n,s,r){const o={type:"legend-item-double-click",legendType:e,series:t,itemId:i,enabled:n,legendItemName:r,numVisibleItems:s};this.listeners.dispatch("legend-item-double-click",o)}},zs=class{constructor(){this.download={type:"action",showOn:"always",label:"contextMenuDownload",enabled:!0,action:void 0,items:void 0},this["zoom-to-cursor"]={type:"action",showOn:"series-area",label:"contextMenuZoomToCursor",enabled:!0,action:void 0,items:void 0},this["pan-to-cursor"]={type:"action",showOn:"series-area",label:"contextMenuPanToCursor",enabled:!0,action:void 0,items:void 0},this["toggle-series-visibility"]={type:"action",showOn:"legend-item",label:"contextMenuToggleSeriesVisibility",enabled:!0,action:void 0,items:void 0},this["toggle-other-series"]={type:"action",showOn:"legend-item",label:"contextMenuToggleOtherSeries",enabled:!0,action:void 0,items:void 0},this.separator={type:"separator",showOn:"always",label:"separator",enabled:!0,action:void 0,items:void 0}}},Ws=class{constructor(){this.defaults=["download","zoom-to-cursor","pan-to-cursor","toggle-series-visibility","toggle-other-series"]}},js=class{constructor(){this.items=new zs,this.lists=new Ws}},$s=class extends Ji{constructor(){super(),this.builtins=new js,this.hiddenActions=new Set,this.setVisible("zoom-to-cursor",!1),this.setVisible("pan-to-cursor",!1)}static check(e,t){return t.showOn==e}static checkCallback(e,t,i){return e===t}dispatchContext(e,t,i,n){const{widgetEvent:s}=t;if(s.sourceEvent.defaultPrevented)return;const r={type:"context-setup",showOn:e,x:n?.x??t.canvasX,y:n?.y??t.canvasY,context:i,widgetEvent:s};this.listeners.dispatch("context-setup",r),r.type="context-complete",this.listeners.dispatch("context-complete",r)}isVisible(e){return!this.hiddenActions.has(e)}setVisible(e,t){t?this.hiddenActions.delete(e):this.hiddenActions.add(e)}},Ks=class extends Ji{constructor(){super(...arguments),this.highlightStates=new Sn}updateHighlight(e,t){const{activeHighlight:i}=this;this.highlightStates.set(e,t),this.activeHighlight=this.highlightStates.stateValue(),this.isEqual(this.activeHighlight,i)||this.listeners.dispatch("highlight-change",{type:"highlight-change",currentHighlight:this.activeHighlight,previousHighlight:i,callerId:e})}getActiveHighlight(){return this.activeHighlight}isEqual(e,t){return e===t||null!=e&&null!=t&&e?.series===t?.series&&e?.itemId===t?.itemId&&e?.datum===t?.datum}};function Ys(e,t){if(null==e||0===t.length)return[!1,!1];const i=e.valueOf(),n=t[0],s=t[t.length-1];if("string"==typeof n)return[i===n,i===s];let r=n.valueOf(),o=s.valueOf();return r>o&&([r,o]=[o,r]),[i===r,i===o]}function qs(e,t,i,n,s){const{xValue:r,yValue:o}=e,[a,l]=Ys(o,s),[c,h]=Ys(r,n);return{xKey:t,yKey:i,xValue:r,yValue:o,first:c,last:h,min:a,max:l}}function Xs(e,[t,i],s){const r=(0,n.S3)(0,e-1,e=>{const i=s(e)?.[1]??NaN;return!Number.isFinite(i)||i>t})??0;let o=(0,n.I5)(0,e-1,e=>{const t=s(e)?.[0]??NaN;return!Number.isFinite(t)||t<i})??e-1;return o=Math.min(o+1,e),[r,o]}function Zs(e,t,i){if(i){const{x:e,y:t,width:n,height:s}=i;return{canvasX:e+n/2,canvasY:t+s/2}}const n=t.yBar?.upperPoint??t.midPoint??e.datumMidPoint?.(t);if(n){const{x:t,y:i}=St.toCanvasPoint(e.contentGroup,n.x,n.y);return{canvasX:Math.round(t),canvasY:Math.round(i)}}}function Qs(e,t,i,n,s){let r=-1,o=0,a=0,l=!1;for(;o<n&&r<=t-e;){r+=1;const n=i+a;l||(a*=-1),a>=0&&(a+=1),l&&a<0&&(a-=1),n<e||n>t?l=!0:s(n)&&(o+=1)}return o}var Js=class{constructor(e,t,i){this.domManager=t,this.tooltip=i,this.stateTracker=new Sn,this.suppressState=new Sn(!1),this.appliedState=null,this.destroyFns=[],this.destroyFns.push(i.setup(e,t),t.addListener("hidden",()=>this.tooltip.hide()))}destroy(){this.destroyFns.forEach(e=>e())}updateTooltip(e,t,i,n){i??(i=this.stateTracker.get(e)?.content),this.stateTracker.set(e,{meta:t,content:i,pagination:n}),this.applyStates()}removeTooltip(e){this.stateTracker.delete(e),this.applyStates()}suppressTooltip(e){this.suppressState.set(e,!0)}unsuppressTooltip(e){this.suppressState.delete(e)}applyStates(){const e=this.stateTracker.stateId(),t=e?this.stateTracker.get(e):void 0;if(this.suppressState.stateValue()||null==t?.meta||null==t?.content)return this.appliedState=null,void this.tooltip.hide();const i=this.domManager.getBoundingClientRect(),n="extended"===this.tooltip.bounds?this.domManager.getOverlayClientRect():i;if(this.appliedState?.content===t?.content){const e=this.tooltip.isVisible();this.tooltip.show(n,i,t?.meta,null,void 0,e)}else this.tooltip.show(n,i,t?.meta,t?.content,t?.pagination);this.appliedState=t}static makeTooltipMeta(e,t,i,n){const{canvasX:s,canvasY:r}=e,o=t.properties.tooltip,{placement:a,defaultPlacement:l,anchorTo:c,defaultAnchorTo:h,xOffset:u,yOffset:d}=o.position,p=Zs(t,i,n);return{canvasX:s,canvasY:r,nodeCanvasX:p?.canvasX??s,nodeCanvasY:p?.canvasY??r,enableInteraction:o.interaction?.enabled??!1,showArrow:o.showArrow,position:{placement:a,defaultPlacement:l,anchorTo:c,defaultAnchorTo:h,xOffset:u,yOffset:d}}}isEnteringInteractiveTooltip(e){const{tooltip:t}=this,i=e.relatedTarget;return t.interactive&&t.enabled&&t.isVisible()&&t.contains(i)}};function er(e,t,i){const{offsetX:n,offsetY:s,clientX:r,clientY:o,currentX:a,currentY:l,sourceEvent:c}=i;return{type:t,device:e,offsetX:n,offsetY:s,clientX:r,clientY:o,currentX:a,currentY:l,sourceEvent:c}}function tr(e,t){return e*e+t*t>=9}var ir=class{constructor(e){this.destroyFns=[],this.listeners=new Qi,this.isDragging=!1,this.touch={distanceTravelledX:0,distanceTravelledY:0,clientX:0,clientY:0},this.destroyFns.push(e.addListener("touchstart",this.onTouchStart.bind(this)),e.addListener("touchmove",this.onTouchMove.bind(this)),e.addListener("touchend",this.onTouchEnd.bind(this)),e.addListener("mousemove",this.onMouseMove.bind(this)),e.addListener("dblclick",this.onDblClick.bind(this)),e.addListener("drag-start",this.onDragStart.bind(this)),e.addListener("drag-move",this.onDragMove.bind(this)),e.addListener("drag-end",this.onDragEnd.bind(this)))}destroy(){this.destroyFns.forEach(e=>e()),this.listeners.destroy()}addListener(e,t){return this.listeners.addListener(e,t)}dispatch(e){this.listeners.dispatch(e.type,e)}onTouchStart(e){const{clientX:t,clientY:i}=e.sourceEvent.targetTouches[0]??{clientX:1/0,clientY:1/0};this.touch.distanceTravelledX=0,this.touch.distanceTravelledY=0,this.touch.clientX=t,this.touch.clientY=i}onTouchMove(e){const{clientX:t,clientY:i}=e.sourceEvent.targetTouches[0]??{clientX:1/0,clientY:1/0};this.touch.distanceTravelledX+=Math.abs(this.touch.clientX-t),this.touch.distanceTravelledY+=Math.abs(this.touch.clientY-i),this.touch.clientX=t,this.touch.clientY=i}onTouchEnd(e){e.sourceEvent.preventDefault()}onMouseMove(e){this.dispatch(e)}onDblClick(e){this.dispatch({device:"mouse",...e})}onDragStart(e){this.dragStartEvent=e}onDragMove(e){null!=this.dragStartEvent&&tr(e.originDeltaX,e.originDeltaY)&&(this.dispatch(this.dragStartEvent),this.dispatch({...this.dragStartEvent,type:"drag-move"}),this.dragStartEvent=void 0,this.isDragging=!0),this.isDragging&&this.dispatch(e)}onDragEnd(e){if(this.isDragging)return this.dispatch(e),void(this.isDragging=!1);if("mouse"===e.device){const t=er("mouse","click",e);this.dispatch(t)}else if("touchend"===e.sourceEvent.type){if(tr(this.touch.distanceTravelledX,this.touch.distanceTravelledY))return;const t=er("touch","click",e);this.dispatch(t);const i=Date.now();if(void 0!==this.lastClick&&i-this.lastClick.time<=505&&function(e,t){const i=e.clientX-t.clientX,n=e.clientY-t.clientY;return i*i+n*n<900}(this.lastClick,e)){const t=er(e.device,"dblclick",e);this.dispatch(t),this.lastClick=void 0}else this.lastClick={time:i,clientX:e.clientX,clientY:e.clientY}}}},nr=class extends On{constructor(e){super(e)}addChildToDOM(){}removeChildFromDOM(){}},sr=class{constructor(e){this.seriesWidget=new nr(e.getParent("series-area")),this.chartWidget=new nr(e.getParent("canvas-proxy")),this.containerWidget=new nr(e.getParent("canvas-container")),this.containerWidget.addChild(this.chartWidget),this.chartWidget.addChild(this.seriesWidget),this.seriesDragInterpreter=new ir(this.seriesWidget)}destroy(){this.seriesDragInterpreter.destroy(),this.seriesWidget.destroy(),this.chartWidget.destroy(),this.containerWidget.destroy()}};function rr(e,t){const[i,s]=or(t);return(0,n.qE)(i,e,s)}function or(e){if(0===e.length)return[];const t=[1/0,-1/0];for(const i of e)i<t[0]&&(t[0]=i),i>t[1]&&(t[1]=i);return t}function ar(e){const[t,i]=or(e);return i-t}var lr=class e extends ye{constructor(e=[],t=[]){super(),this.domain=e,this.range=t,this.defaultClamp=!1}static is(t){return t instanceof e}normalizeDomains(...e){return hr(...e)}transform(e){return e}transformInvert(e){return e}calcBandwidth(e=1,t=1){const{domain:i}=this,n=this.getPixelRange();if(0===i.length)return n;let s=Math.abs(i[1].valueOf()-i[0].valueOf())/e+1;if(0!==t){const e=Math.floor(n);s=Math.min(s,e)}return n/Math.max(1,s)}convert(e,t){const{domain:i}=this;if(!i||i.length<2)return NaN;const n=t?.clamp??this.defaultClamp,s=Number(this.transform(i[0])),r=Number(this.transform(i[1])),o=Number(this.transform(e)),{range:a}=this,[l,c]=a;if(n){const[e,t]=or([s,r]);if(o<e)return l;if(o>t)return c}return s===r?(l+c)/2:o===s?l:o===r?c:l+(o-s)/(r-s)*(c-l)}invert(e,t){const i=this.domain.map(e=>this.transform(e)),[n,s]=i,{range:r}=this,[o,a]=r;let l;return l=o===a?this.toDomain((Number(n)+Number(s))/2):this.toDomain(Number(n)+(e-o)/(a-o)*(Number(s)-Number(n))),this.transformInvert(l)}getPixelRange(){const[e,t]=this.range;return Math.abs(t-e)}};lr.defaultTickCount=5;var cr=lr;function hr(...e){let t,i,n=1/0,s=-1/0;for(const r of e)for(const e of r){const r=e.valueOf();r<n&&(n=r,t=e),r>s&&(s=r,i=e)}return null!=t&&null!=i?{domain:[t,i],animatable:!0}:{domain:[],animatable:!1}}var ur={};o(ur,{TimeInterval:()=>br,day:()=>Sr,friday:()=>Or,hour:()=>Ir,millisecond:()=>xr,minute:()=>Tr,monday:()=>Pr,month:()=>wr,saturday:()=>Fr,second:()=>Ar,sunday:()=>kr,thursday:()=>Nr,tuesday:()=>_r,utcDay:()=>Vr,utcHour:()=>Ur,utcMinute:()=>Hr,utcMonth:()=>Br,utcYear:()=>Gr,wednesday:()=>Lr,year:()=>Cr});var dr=1e3,pr=6e4,gr=36e5,fr=864e5,mr=6048e5,yr=2592e6,vr=31536e6,br=class e{constructor(e,t,i,n,s,r=1,o){this.unit=e,this.milliseconds=t,this.hierarchy=i,this._encode=n,this._decode=s,this.step=r,this._rangeCallback=o}static extent(e,t,i){if(e.getTime()>t.getTime()&&([e,t]=[t,e],null!=i&&(i=[1-i[1],1-i[0]])),null!=i){const n=t.getTime()-e.getTime(),s=e.getTime();e=new Date(s+i[0]*n),t=new Date(s+i[1]*n)}return[e,t]}getOffset(e,t){return Math.floor(this._encode(new Date(e)))%t}floor(e){const t=new Date(e),i=this._encode(t);return this._decode(i)}ceil(e){const t=new Date(Number(e)-1),i=this._encode(t);return this._decode(i+1)}rangeIndices(t,i,{extend:n=!1,visibleRange:s=[0,1],limit:r}){[t,i]=e.extent(t,i,s);const o=this._encode(n?this.floor(t):this.ceil(t));let a=this._encode(n?this.ceil(i):this.floor(i));return null!=r&&a-o>r&&(a=o+r),[o,a]}range(e,t,i={}){let n;n=e.getTime()>t.getTime()?this._rangeCallback?.(t,e):this._rangeCallback?.(e,t);const[s,r]=this.rangeIndices(e,t,i),o=[];for(let e=s;e<=r;e++){const t=this._decode(e);o.push(t)}return n?.(),o}previous(e){return this._decode(this._encode(this.ceil(e))-1)}next(e){return this._decode(this._encode(this.floor(e))+1)}rangeCount(e,t,i={}){const[n,s]=this.rangeIndices(e,t,i);return s-n}every(t,i){if(1===t&&null!=i?.snapTo)return this;const{unit:s,milliseconds:r,hierarchy:o,step:a}=this;let l,c=0;const h=t;h!==(t=Math.max(1,Math.round(t)))&&n.Vy.warnOnce(`interval step of [${h}] rounded to [${t}].`);const{snapTo:u="start"}=i??{};if("string"==typeof u){const e=c;l=(i,n)=>{const s="start"===u?i:n;return c=this.getOffset(s,t),()=>c=e}}else"number"==typeof u?c=this.getOffset(new Date(u),t):u instanceof Date&&(c=this.getOffset(u,t));return new e(s,r*t,o,e=>Math.floor((this._encode(e)-c)/t),e=>this._decode(e*t+c),a*t,l)}},Cr=new br("year",525949.2*60*1e3,void 0,function(e){return e.getFullYear()},function(e){const t=new Date;return t.setFullYear(e),t.setMonth(0,1),t.setHours(0,0,0,0),t}),wr=new br("month",Cr.milliseconds/12,Cr,function(e){return 12*e.getFullYear()+e.getMonth()},function(e){const t=Math.floor(e/12);return new Date(t,e-12*t,1)}),Sr=new br("day",864e5,wr,function(e){const t=e.getTimezoneOffset()*pr;return Math.floor((e.getTime()-t)/fr)},function(e){const t=new Date(1970,0,1);return t.setDate(t.getDate()+e),t}),xr=new br("millisecond",1,Sr,function(e){return e.getTime()},function(e){return new Date(e)}),Er=(new Date).getTimezoneOffset()*pr,Ar=new br("second",1e3,Sr,function(e){return Math.floor((e.getTime()-Er)/dr)},function(e){return new Date(Er+e*dr)}),Mr=(new Date).getTimezoneOffset()*pr,Tr=new br("minute",6e4,Sr,function(e){return Math.floor((e.getTime()-Mr)/pr)},function(e){return new Date(Mr+e*pr)}),Dr=(new Date).getTimezoneOffset()*pr,Ir=new br("hour",36e5,Sr,function(e){return Math.floor((e.getTime()-Dr)/gr)},function(e){return new Date(Dr+e*gr)});function Rr(e){const t=(7+e-4)%7;return new br("day",6048e5,wr,function(e){const i=e.getTimezoneOffset()*pr;return Math.floor((e.getTime()-i)/mr-t/7)},function(e){const i=new Date(1970,0,1);return i.setDate(i.getDate()+7*e+t),i},7)}var kr=Rr(0),Pr=Rr(1),_r=Rr(2),Lr=Rr(3),Nr=Rr(4),Or=Rr(5),Fr=Rr(6),Gr=new br("year",Cr.milliseconds,void 0,function(e){return e.getUTCFullYear()},function(e){const t=new Date;return t.setUTCFullYear(e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0),t}),Br=new br("month",wr.milliseconds,Gr,function(e){return 12*e.getUTCFullYear()+e.getUTCMonth()},function(e){const t=Math.floor(e/12),i=e-12*t;return new Date(Date.UTC(t,i,1))}),Vr=new br("day",864e5,Br,function(e){return Math.floor(e.getTime()/fr)},function(e){const t=new Date(0);return t.setUTCDate(t.getUTCDate()+e),t.setUTCHours(0,0,0,0),t}),Hr=new br("minute",6e4,Vr,function(e){return Math.floor(e.getTime()/pr)},function(e){return new Date(e*pr)}),Ur=new br("hour",36e5,Vr,function(e){return Math.floor(e.getTime()/gr)},function(e){return new Date(e*gr)}),zr={periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]};function Wr(e,t=new Date(e.getFullYear(),0,1)){const i=e.getTimezoneOffset()-t.getTimezoneOffset(),n=e.getTime()-t.getTime()+6e4*i;return Math.floor(n/864e5)}function jr(e,t){const i=(t-new Date(e.getFullYear(),0,1).getDay()+7)%7,n=new Date(e.getFullYear(),0,i+1);return n<=e?Math.floor(Wr(e,n)/7)+1:0}function $r(e,t=e.getFullYear()){const i=new Date(t,0,1).getDay(),n=new Date(t,0,(4-i+7)%7-3+1);return n<=e?Math.floor(Wr(e,n)/7)+1:$r(e,t-1)}var Kr={a:e=>zr.shortDays[e.getDay()],A:e=>zr.days[e.getDay()],b:e=>zr.shortMonths[e.getMonth()],B:e=>zr.months[e.getMonth()],c:"%x, %X",d:(e,t)=>qr(e.getDate(),2,t??"0"),e:"%_d",f:(e,t)=>qr(1e3*e.getMilliseconds(),6,t??"0"),H:(e,t)=>qr(e.getHours(),2,t??"0"),I:(e,t)=>{const i=e.getHours()%12;return 0===i?"12":qr(i,2,t??"0")},j:(e,t)=>qr(Wr(e)+1,3,t??"0"),m:(e,t)=>qr(e.getMonth()+1,2,t??"0"),M:(e,t)=>qr(e.getMinutes(),2,t??"0"),L:(e,t)=>qr(e.getMilliseconds(),3,t??"0"),p:e=>e.getHours()<12?"AM":"PM",Q:e=>String(e.getTime()),s:e=>String(Math.floor(e.getTime()/1e3)),S:(e,t)=>qr(e.getSeconds(),2,t??"0"),u:e=>{let t=e.getDay();return t<1&&(t+=7),String(t%7)},U:(e,t)=>qr(jr(e,0),2,t??"0"),V:(e,t)=>qr($r(e),2,t??"0"),w:(e,t)=>qr(e.getDay(),2,t??"0"),W:(e,t)=>qr(jr(e,1),2,t??"0"),x:"%-m/%-d/%Y",X:"%-I:%M:%S %p",y:(e,t)=>qr(e.getFullYear()%100,2,t??"0"),Y:(e,t)=>qr(e.getFullYear(),4,t??"0"),Z:e=>function(e){const t=e.getTimezoneOffset(),i=Math.abs(t);return`${t>0?"-":"+"}${qr(Math.floor(i/60),2,"0")}${qr(Math.floor(i%60),2,"0")}`}(e),"%":()=>"%"},Yr={_:" ",0:"0","-":""};function qr(e,t,i){const n=String(Math.floor(e));return n.length>=t?n:`${i.repeat(t-n.length)}${n}`}function Xr(e){const t=[];for(;e.length>0;){let i=e.indexOf("%");if(0!==i){const n=i>0?e.substring(0,i):e;t.push(n)}if(i<0)break;const n=e[i+1],s=Yr[n];null!=s&&i++;const r=e[i+1],o=Kr[r];if("function"==typeof o)t.push([o,s]);else if("string"==typeof o){const e=Xr(o);t.push([e,s])}else t.push(`${s??""}${r}`);e=e.substring(i+2)}return e=>{const i="number"==typeof e?new Date(e):e;return t.map(e=>"string"==typeof e?e:e[0](i,e[1])).join("")}}function Zr(e){return e instanceof Date?e.getTime():e}function Qr(e,t,i){const n=Xr(Jr(e,t,i));return e=>n(e)}function Jr(e,t,i=0){let n=1/0;for(let t=1;t<e.length;t++)n=Math.min(n,Math.abs(e[t].valueOf()-e[t-1].valueOf()));const[s,r]=0===t.length?[0,0]:or([t[0].valueOf(),t[t.length-1].valueOf()]),o=new Date(s).getFullYear(),a=new Date(r).getFullYear()-o>0,l=isFinite(n)?function(e,t){return e<dr?0:e<pr?1:e<gr?2:e<fr?3:e<mr?4:e<24192e5||e<26784e5&&function(e){let t=new Date(e[0]).getMonth();for(let i=1;i<e.length;i++){const n=new Date(e[i]).getMonth();if(t===n)return!0;t=n}return!1}(t)?5:e<vr?6:7}(n,e):(c=e[0],Ar.floor(c)<c?0:Tr.floor(c)<c?1:Ir.floor(c)<c?2:Sr.floor(c)<c?3:wr.floor(c)<c?kr.floor(c)<c?4:5:Cr.floor(c)<c?6:7);var c;return function(e,t,i){const n=Zr(i[0]),s=Zr(i.at(-1)),r=Math.abs(s-n),o=[["hour",216e5,12096e5,3,"%I %p"],["hour",pr,216e5,3,"%I:%M"],["second",1e3,216e5,1,":%S"],["ms",0,216e5,0,".%L"],["am/pm",pr,216e5,3,"%p"]," ",["day",fr,mr,4,"%a"],["month",0===r?0:mr,314496e5,5,"%b %d"],["month",3024e6,31536e7,6,"%B"]," ",["year",t||7===e?0:vr,1/0,7,"%Y"]].filter(t=>{if("string"==typeof t)return!0;const[i,n,s,o]=t;return o>=e&&n<=r&&r<s}).reduce((e,t)=>("string"==typeof t?e.result.push(t):e.used.has(t[0])||(e.result.push(t),e.used.add(t[0])),e),{result:[],used:new Set}).result,a=o.findIndex(e=>"string"!=typeof e),l=o.findLastIndex(e=>"string"!=typeof e);return o.slice(a,l+1).map(e=>"string"==typeof e?e:e[4]).join("").replaceAll(/\s+/g," ").trim()}(Math.max(l-i,0),a,e)}var eo=class e extends ye{constructor(){super(...arguments),this.invalid=!0,this.range=[0,1],this.round=!1,this._bandwidth=1,this._step=1,this._inset=1,this._rawBandwidth=1,this._paddingInner=0,this._paddingOuter=0}static is(t){return t instanceof e}get bandwidth(){return this.refresh(),this._bandwidth}get step(){return this.refresh(),this._step}get inset(){return this.refresh(),this._inset}get rawBandwidth(){return this.refresh(),this._rawBandwidth}set padding(e){e=(0,n.qE)(0,e,1),this._paddingInner=e,this._paddingOuter=e}get padding(){return this._paddingInner}set paddingInner(e){this.invalid=!0,this._paddingInner=(0,n.qE)(0,e,1)}get paddingInner(){return this._paddingInner}set paddingOuter(e){this.invalid=!0,this._paddingOuter=(0,n.qE)(0,e,1)}get paddingOuter(){return this._paddingOuter}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&n.Vy.warnOnce("Expected update to not invalidate scale"))}convert(e,t){this.refresh();const i=this.findIndex(e);return null==i||i<0||i>=this.bands.length?NaN:this.ordinalRange(i)}invertNearestIndex(e){this.refresh();const t=this.bands.length;if(0===t)return-1;let i=0,n=t-1,s=1/0,r=0;for(;i<=n;){const t=(n+i)/2|0,o=this.ordinalRange(t),a=Math.abs(o-e);if(0===a)return t;a<s&&(s=a,r=t),o<e?i=t+1:n=t-1}return r}update(){const[e,t]=this.range;let{_paddingInner:i}=this;const{_paddingOuter:n,round:s,bands:r}=this,o=r.length;if(0===o)return;const a=t-e;let l;1===o?(i=0,l=a*(1-2*n)):l=a/Math.max(1,o-i+2*n);const c=s?Math.floor(l):l;let h=e+(a-c*(o-i))/2,u=c*(1-i);s&&(h=Math.round(h),u=Math.round(u)),this._step=c,this._inset=h,this._bandwidth=u,this._rawBandwidth=l*(1-i)}ordinalRange(e){const{_inset:t,_step:i,range:s}=this,r=Math.min(s[0],s[1]),o=Math.max(s[0],s[1]);return(0,n.qE)(r,t+i*e,o)}};a([ve],eo.prototype,"range",2),a([ve],eo.prototype,"round",2);var to=eo,io=class e extends to{static is(t){return t instanceof e}toDomain(e){return new Date(e)}convert(e,t){const{domain:i,bands:s}=this;if(i.length<=0)return NaN;const r=this.ordinalRange(0),o=this.ordinalRange(s.length-1),a=t?.interpolate??!1,l=i[0].valueOf()>i[i.length-1].valueOf();if(!a){const i=super.convert(e,t);return l?o-(i-r):i}if(0===s.length)return r;const c=e.valueOf();let h;h=l?((0,n.S3)(0,i.length-1,e=>i[e].valueOf()<=c)??i.length)-1:(0,n.I5)(0,i.length-1,e=>i[e].valueOf()<=c)??0,h=Math.min(Math.max(h,0),i.length-2);const u=i[h].valueOf(),d=i[h+1].valueOf();return(h+(c-u)/(d-u))/(i.length-1)*(o-r)+r}invert(e,t=!1){this.refresh();const{domain:i,bands:s}=this,r=i[0].valueOf()>i[i.length-1].valueOf();let o;return o=t?this.invertNearestIndex(e-this.bandwidth/2):(0,n.S3)(0,s.length-1,t=>this.ordinalRange(t)>=e)??0,s[r?s.length-1-o:o]}tickFormatter({domain:e,ticks:t,specifier:i},n){return null!=i?Xr(i):Qr(t,e,n)}},no={bottomCenter:function(e){return{x:(e.x1+e.x2)/2,y:Math.max(e.y1,e.y2)}},center:function(e){return{x:(e.x1+e.x2)/2,y:(e.y1+e.y2)/2}},clone:function(e){return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2}},collides:function(e,t){const i=so(e),n=so(t);return i.x1<=n.x2&&i.x2>=n.x1&&i.y1<=n.y2&&i.y2>=n.y1},end:function(e){return{x:e.x2,y:e.y2}},from:function(e,t,i,n){if("number"==typeof e)return{x1:e,y1:t,x2:i,y2:n};if("width"in e)return so({x1:e.x,y1:e.y,x2:e.x+e.width,y2:e.y+e.height});throw new Error(`Values can not be converted into a vector4: [${JSON.stringify(e)}] [${t}] [${i}] [${n}]`)},height:function(e){return Math.abs(e.y2-e.y1)},round:function(e){return{x1:Math.round(e.x1),y1:Math.round(e.y1),x2:Math.round(e.x2),y2:Math.round(e.y2)}},start:function(e){return{x:e.x1,y:e.y1}},topCenter:function(e){return{x:(e.x1+e.x2)/2,y:Math.min(e.y1,e.y2)}},origin:function(){return{x1:0,y1:0,x2:0,y2:0}},width:function(e){return Math.abs(e.x2-e.x1)}};function so(e){return{x1:Math.min(e.x1,e.x2),x2:Math.max(e.x1,e.x2),y1:Math.min(e.y1,e.y2),y2:Math.max(e.y1,e.y2)}}function ro(e,t,i,n,s){return t+(s-e)/(i-e)*(n-t)}function oo(e,t,i,n,s){return e+(i-e)/(n-t)*(s-t)}function ao(e,t,i){return[oo(e,i.min,t,i.max,0),oo(e,i.min,t,i.max,1)]}function lo(e,t,i,s,r,o){if(i<=r&&o<=s)return i;const a=r-i,l=o-s,c=Math.abs(a)<Math.abs(l)?a:l;return(0,n.qE)(e,i+c,t)}var co=["rangeX","rangeY","ratioX","ratioY","autoScaledAxes"],ho=class{constructor(){this.enabled=!1,this.padding=0,this.manuallyAdjusted=!1}},uo=e=>(0,n.W$)((t,{options:i})=>!cr.is(e?.scale)&&!io.is(e?.scale)||null==t||null==i.end||t<=i.end,"to be less than end"),po=class extends Ji{constructor(e,t){super(),this.fireChartEvent=e,this.mementoOriginatorKey="zoom",this.axisZoomManagers=new Map,this.state=new Sn(void 0,"initial"),this.axes=[],this.didLayoutAxes=!1,this.autoScaleYAxis=new ho,this.lastRestoredState=void 0,this.independentAxes=!1,this.navigatorModule=!1,this.zoomModule=!1,this.pendingMemento=void 0,this.destroyFns.push(t.addListener("layout:complete",()=>{const{pendingMemento:e}=this,t=!this.didLayoutAxes;this.didLayoutAxes=!0,e?this.restoreMemento(e.version,e.mementoVersion,e.memento):t&&this.autoScaleYZoom("zoom-manager")}))}createMemento(){return this.getMementoRanges()}guardMemento(e,t){if(null==e)return!0;if(!(0,n.Gv)(e))return!1;for(const t of Object.keys(e))if(!co.includes(t))return!1;const i=this.getPrimaryAxis("x"),s=this.getPrimaryAxis("y"),r={rangeX:{start:(0,n.Uo)((0,n.or)(n.ai,n.p6),uo(i)),end:(0,n.or)(n.ai,n.p6)},rangeY:{start:(0,n.Uo)((0,n.or)(n.ai,n.p6),uo(s)),end:(0,n.or)(n.ai,n.p6)},ratioX:{start:(0,n.Uo)(n.CG,(0,n.Xe)("end")),end:n.CG},ratioY:{start:(0,n.Uo)(n.CG,(0,n.Xe)("end")),end:n.CG},autoScaledAxes:(0,n.jk)((0,n.KC)("y"))},{invalid:o}=(0,n.tf)(e,r);return!(o.length>0&&(t.push(...o.map(String)),1))}restoreMemento(e,t,i){const{independentAxes:n}=this;if(!this.axes||!this.didLayoutAxes)return void(this.pendingMemento={version:e,mementoVersion:t,memento:i});this.pendingMemento=void 0;const s=this.getDefinedZoom();if(s.x=i?.rangeX?this.rangeToRatio(i.rangeX,"x")??{min:0,max:1}:i?.ratioX?{min:i.ratioX.start??0,max:i.ratioX.end??1}:{min:0,max:1},!this.navigatorModule||this.zoomModule){let e=i?.autoScaledAxes?.includes("y");i?.rangeY?(s.y=this.rangeToRatio(i.rangeY,"y")??{min:0,max:1},e??(e=!1)):i?.ratioY?(s.y={min:i.ratioY.start??0,max:i.ratioY.end??1},e??(e=!1)):(s.y={min:0,max:1},e??(e=!0)),s.autoScaleYAxis=e}if(this.lastRestoredState=s,!0!==n)return void this.updateZoom("zoom-manager",s);const r=this.getPrimaryAxis("x"),o=this.getPrimaryAxis("y");for(const e of[r,o])e&&this.updateAxisZoom("zoom-manager",e.id,s[e.direction])}updateAxes(e){this.axes=e;const t=new Map(e.map(e=>[e.id,this.axisZoomManagers.get(e.id)]));this.axisZoomManagers.clear();for(const i of e)this.axisZoomManagers.set(i.id,t.get(i.id)??new go(i));this.state.size>0&&e.length>0&&this.updateZoom(this.state.stateId(),this.state.stateValue())}setIndependentAxes(e=!0){this.independentAxes=e}setAutoScaleYAxis(e,t){this.autoScaleYAxis.enabled=e,this.autoScaleYAxis.padding=t}setNavigatorEnabled(e=!0){this.navigatorModule=e}setZoomModuleEnabled(e=!0){this.zoomModule=e}isNavigatorEnabled(){return this.navigatorModule}isZoomEnabled(){return this.zoomModule}updateZoom(e,t){if(t?.x&&(t.x.min<0||t.x.max>1)&&(n.Vy.warnOnce(`Attempted to update x-axis zoom to an invalid ratio of [{ min: ${t.x.min}, max: ${t.x.max} }], expecting a ratio of 0 to 1, ignoring.`),t.x=void 0),t?.y&&(t.y.min<0||t.y.max>1)&&(n.Vy.warnOnce(`Attempted to update y-axis zoom to an invalid ratio of [{ min: ${t.y.min}, max: ${t.y.max} }], expecting a ratio of 0 to 1, ignoring.`),t.y=void 0),0===this.axisZoomManagers.size){const i=this.state.stateId();return void("initial"!==i&&i!==e||this.state.set(e,t))}this.state.set(e,t);const i=t?.autoScaleYAxis;null!=i&&(this.autoScaleYAxis.manuallyAdjusted=!i),this.axisZoomManagers.forEach(i=>{i.updateZoom(e,t?.[i.getDirection()])}),this.applyChanges(e)}updateAxisZoom(e,t,i){this.axisZoomManagers.get(t)?.updateZoom(e,i),this.applyChanges(e)}resetZoom(e){this.autoScaleYAxis.manuallyAdjusted=!1;const t=this.getRestoredZoom();this.updateZoom(e,{x:{min:t?.x?.min??0,max:t?.x?.max??1},y:{min:t?.y?.min??0,max:t?.y?.max??1},autoScaleYAxis:t?.autoScaleYAxis??!0})}resetAxisZoom(e,t){const i=this.axisZoomManagers.get(t),n=i?.getDirection();if(null==n)return;const s=this.getRestoredZoom();if("y"===n){const e=s?.autoScaleYAxis??!0;this.autoScaleYAxis.manuallyAdjusted=!e}for(const t of this.axes)t.direction===n&&this.updateAxisZoom(e,t.id,s?.[n]??{min:0,max:1})}setAxisManuallyAdjusted(e,t){const i=this.axisZoomManagers.get(t)?.getDirection();"y"===i&&(this.autoScaleYAxis.manuallyAdjusted=!0)}updatePrimaryAxisZoom(e,t,i){const n=this.getPrimaryAxis(t);n&&this.updateAxisZoom(e,n.id,i)}panToBBox(e,t,i){if(!this.isZoomEnabled()&&!this.isNavigatorEnabled())return!1;const s=this.getZoom();if(void 0===s||!s.x&&!s.y)return!1;if(!(t.width>0&&t.height>0&&Math.abs(i.width)<=Math.abs(t.width)&&Math.abs(i.height)<=Math.abs(t.height)))return n.Vy.warnOnce("cannot pan to target BBox - chart too small?"),!1;const r=function(e,t,i){const{x:s={min:0,max:1},y:r={min:0,max:1}}=t,o=no.from(i),a=no.from(e),l=function(e,t,i){const[n,s]=ao(e.x1,e.x2,t),[r,o]=ao(e.y1,e.y2,i);return{x1:n,x2:s,y1:r,y2:o}}(a,s,r),c=lo(l.x1,l.x2,a.x1,a.x2,o.x1,o.x2),h=lo(l.y1,l.y2,a.y1,a.y2,o.y1,o.y2),u={x:{min:ro(a.x1,s.min,a.x2,s.max,c),max:ro(a.x1,s.min,a.x2,s.max,c+e.width)},y:{min:ro(a.y1,r.min,a.y2,r.max,h),max:ro(a.y1,r.min,a.y2,r.max,h+e.height)}},d=u.x.max-u.x.min,p=u.y.max-u.y.min;return u.x.min=(0,n.qE)(0,u.x.min,1-d),u.x.max=u.x.min+d,u.y.min=(0,n.qE)(0,u.y.min,1-p),u.y.max=u.y.min+p,u}(t,s,i);return this.independentAxes?(this.updatePrimaryAxisZoom(e,"x",r.x),this.updatePrimaryAxisZoom(e,"y",r.y)):this.updateZoom(e,r),!0}fireZoomPanStartEvent(e){this.listeners.dispatch("zoom-pan-start",{type:"zoom-pan-start",callerId:e})}extendToEnd(e,t,i){return this.extendWith(e,t,e=>Number(e)-i)}extendWith(e,t,i){const n=this.getPrimaryAxis(t);if(!n)return;const s=this.getDomainExtents(n);if(!s)return;const[,r]=s,o=i(r),a=this.rangeToRatio({start:o,end:r},t);a&&this.updateZoom(e,{[t]:a})}updateWith(e,t,i){const n=this.getPrimaryAxis(t);if(!n)return;const s=this.getDomainExtents(n);if(!s)return;let[r,o]=s;[r,o]=i(r,o);const a=this.rangeToRatio({start:r,end:o},t);a&&this.updateZoom(e,{[t]:a})}getZoom(){let e,t;if(this.axisZoomManagers.forEach(i=>{"x"===i.getDirection()?e??(e=i.getZoom()):"y"===i.getDirection()&&(t??(t=i.getZoom()))}),e||t)return{x:e,y:t}}getAxisZoom(e){return this.axisZoomManagers.get(e)?.getZoom()??{min:0,max:1}}getAxisZooms(){const e={};for(const[t,i]of this.axisZoomManagers.entries())e[t]={direction:i.getDirection(),zoom:i.getZoom()};return e}getRestoredZoom(){return this.lastRestoredState}getPrimaryAxisId(e){return this.getPrimaryAxis(e)?.id}isVisibleItemsCountAtLeast(e,t){const i=this.getPrimaryAxis("x"),n=this.getPrimaryAxis("y"),s=new Set;let r=0;const o=[e.x.min,e.x.max],a=[e.y.min,e.y.max];for(const e of i?.boundSeries??[]){s.add(e.id);const i=t-(r??0);if(r+=e.getVisibleItems(o,a,i),r>=t)return!0}for(const e of n?.boundSeries??[]){if(s.has(e.id))continue;const i=t-(r??0);if(r+=e.getVisibleItems(o,a,i),r>=t)return!0}return 0===s.size}getMementoRanges(){const e=this.getDefinedZoom();let t;return this.autoScaleYAxis.enabled&&(t=this.autoScaleYAxis.manuallyAdjusted?[]:["y"]),{rangeX:this.getRangeDirection(e.x,"x"),rangeY:this.getRangeDirection(e.y,"y"),ratioX:{start:e.x.min,end:e.x.max},ratioY:{start:e.y.min,end:e.y.max},autoScaledAxes:t}}autoScaleYZoom(e,t=!0){if(!this.isZoomEnabled())return;const{independentAxes:i,autoScaleYAxis:n}=this,s=this.getZoom();if(null==s?.x||!n.enabled||n.manuallyAdjusted)return;const{padding:r}=n;let o;if(o=0===s.x?.min&&1===s.x?.max?{min:0,max:1}:i?this.primaryAxisZoom("y",s.x,{padding:r}):this.combinedAxisZoom("y",s.x,{padding:r}),null!=o){if(i){const e=this.getPrimaryAxis("y"),t=null==e?void 0:this.axisZoomManagers.get(e.id);t?.updateZoom("zoom-manager",o)}else for(const e of this.axisZoomManagers.values())"y"===e.getDirection()&&e.updateZoom("zoom-manager",o);t&&this.applyChanges(e)}}applyChanges(e){if(this.autoScaleYZoom(e,!1),!Array.from(this.axisZoomManagers.values(),e=>e.applyChanges()).includes(!0))return;const t={};for(const[e,i]of this.axisZoomManagers.entries())t[e]=i.getZoom();this.listeners.dispatch("zoom-change",{type:"zoom-change",...this.getZoom(),axes:t,callerId:e}),this.fireChartEvent({type:"zoom",...this.getMementoRanges()})}getRangeDirection(e,t){const i=this.getPrimaryAxis(t);if(!i||!cr.is(i.scale)&&!io.is(i.scale))return;const n=this.getDomainPixelExtents(i);if(!n)return;const[s,r]=n;let o,a;return s<=r?(o=i.scale.invert(0),a=i.scale.invert(s+(r-s)*e.max)):(o=i.scale.invert(s-(s-r)*e.min),a=i.scale.invert(0)),{start:o,end:a}}rangeToRatio(e,t){const i=this.getPrimaryAxis(t);if(!i)return;const s=this.getDomainPixelExtents(i);if(!s)return;const[r,o]=s;let a=null==e.start?r:i.scale.convert?.(e.start),l=null==e.end?o:i.scale.convert?.(e.end);if(!(0,n.Bf)(a)||!(0,n.Bf)(l))return;const[c,h]=[Math.min(r,o),Math.max(r,o)];if(a<c||a>h)return void n.Vy.warnOnce(`Invalid range start [${e.start}], expecting a value between [${i.scale.invert?.(r)}] and [${i.scale.invert?.(o)}], ignoring.`);if(l<c||l>h)return void n.Vy.warnOnce(`Invalid range end [${e.end}], expecting a value between [${i.scale.invert?.(r)}] and [${i.scale.invert?.(o)}], ignoring.`);a=Math.min(h,Math.max(c,a)),l=Math.min(h,Math.max(c,l));const u=o-r;return{min:Math.abs((a-r)/u),max:Math.abs((l-r)/u)}}getPrimaryAxis(e){return this.axes?.find(t=>t.direction===e)}getDomainExtents(e){const{domain:t}=e.scale,i=t.at(0),n=t.at(-1);if(null!=i&&null!=n)return[i,n]}getDomainPixelExtents(e){const{domain:t}=e.scale,i=e.scale.convert?.(t.at(0)),s=e.scale.convert?.(t.at(-1));if((0,n.Bf)(i)&&(0,n.Bf)(s))return[i,s]}getDefinedZoom(){const e=this.getZoom();return{x:{min:e?.x?.min??0,max:e?.x?.max??1},y:{min:e?.y?.min??0,max:e?.y?.max??1}}}zoomBounds(e,t,i,s){const r=e.scale,o=r.range;r.range=[0,1];const a=t.scale,l=a.range;a.range=[0,1];let c=1,h=!1,u=0,d=!1;for(const e of t.boundSeries){const{connectsToYAxis:t}=e,n=e.getRange("y",[i.min,i.max]);for(const e of n){const i=a.convert(e);Number.isFinite(i)&&(i<c&&(c=i,h=!t||e<0),i>u&&(u=i,d=!t||e>0))}}if((0,n.Bf)(t.min)&&(c=0),(0,n.Bf)(t.max)&&(u=1),r.range=o,a.range=l,c>=u)return;const p=(h?s:0)+(d?s:0),g=Math.min((u-c)*(1+p),1);if(!(g<=0)){if(h&&d){const e=(u+c)/2;c=e-g/2,u=e+g/2}else!h&&d?u=c+g:h&&!d&&(c=u-g);return c<0?(u+=-c,c=0):u>1&&(c-=u-1,u=1),{min:c,max:u}}}primaryAxisZoom(e,t,{padding:i=0}={}){const n="x"===e?"y":"x",s=this.getPrimaryAxis(n),r=this.getPrimaryAxis(e);if(null!=s&&null!=r)return this.zoomBounds(s,r,t,i)}combinedAxisZoom(e,t,{padding:i=0}={}){const n="x"===e?"y":"x",s=new Map;for(const e of this.axes)if(e.direction===n)for(const t of e.boundSeries)s.set(t,e);let r=1,o=0;for(const n of this.axes)if(n.direction===e)for(const e of n.boundSeries){const a=s.get(e);if(null==a)continue;const l=this.zoomBounds(a,n,t,i);if(null==l)return;r=Math.min(r,l.min),o=Math.max(o,l.max)}if(r<1e-6&&(r=0),o>.999999&&(o=1),!(r>o))return{min:r,max:o}}},go=class{constructor(e){this.axis=e;const[t=0,i=1]=e.visibleRange;this.state=new Sn({min:t,max:i}),this.currentZoom=this.state.stateValue()}getDirection(){return this.axis.direction}updateZoom(e,t){this.state.set(e,t)}getZoom(){return Bt(this.state.stateValue())}hasChanges(){const e=this.currentZoom,t=this.state.stateValue();return e.min!==t.min||e.max!==t.max}applyChanges(){const e=this.hasChanges();return this.currentZoom=this.state.stateValue(),e}};function fo(e,t,i,n,s,r){if(0===e.size)return!1;let o=e.x,a=e.y;null!=t&&(o-=(t.x-.5)*e.size,a-=(t.y-.5)*e.size);let l=o;o<i?l=i:o>i+s&&(l=i+s);let c=a;a<n?c=n:a>n+r&&(c=n+r);const h=o-l,u=a-c;return Math.sqrt(h*h+u*u)<=.5*e.size}function mo(e,t,i,n,s){const r=e.x+e.width>t&&e.x<t+n,o=e.y+e.height>i&&e.y<i+s;return r&&o}function yo(e,t,i,n,s){return t+n<e.x+e.width&&t>e.x&&i>e.y&&i+s<e.y+e.height}function vo(e){return null!=e&&"object"==typeof e.point&&"object"==typeof e.label}var bo={top:{x:0,y:-1},bottom:{x:0,y:1},left:{x:-1,y:0},right:{x:1,y:0},"top-left":{x:-1,y:-1},"top-right":{x:1,y:-1},"bottom-left":{x:-1,y:1},"bottom-right":{x:1,y:1}};function Co(e,t=0){const i=[];for(let n=0;n<e.length;n++){const s=e[n],{point:{x:r,y:o},label:{text:a}}=s;let{width:l,height:c}=s.label;if(l+=t,c+=t,i.some(e=>mo(e,r,o,l,c)))return!0;i.push({index:n,text:a,x:r,y:o,width:l,height:c,datum:s})}return!1}var wo=class{constructor(){this.labelData=new Map}updateLabels(e,t,i=m.zero){const n={x:-t.left,y:-t.top,width:i.width+t.left+t.right,height:i.height+t.top+t.bottom},s=new Set(e.map(e=>e.id));for(const e of this.labelData.keys())s.has(e)||this.labelData.delete(e);for(const t of e){const e=t.getLabelData();e.every(vo)&&this.labelData.set(t.id,e)}const r=function(e,t,i=5){const n=new Map,s=[],r=new Map([...e.entries()].map(([e,t])=>[e,t.toSorted((e,t)=>t.point.size-e.point.size)])),o=[...r.values()].flat();for(const[e,a]of r.entries()){const r=[];if(a[0]?.label){for(let e=0,n=a.length;e<n;e++){const n=a[e],{point:l,label:c,anchor:h}=n,{text:u,width:d,height:p}=c,g=.5*l.size;let f=0,m=0;if(g>0&&null!=n.placement){const e=bo[n.placement];f=(.5*d+g+i)*e.x,m=(.5*p+g+i)*e.y}const y=l.x-.5*d+f-((h?.x??.5)-.5)*l.size,v=l.y-.5*p+m-((h?.y??.5)-.5)*l.size;if(t&&!yo(t,y,v,d,p))continue;if(o.some(e=>fo(e.point,e.anchor,y,v,d,p)))continue;if(s.some(e=>mo(e,y,v,d,p)))continue;const b={index:e,text:u,x:y,y:v,width:d,height:p,datum:n};r.push(b),s.push(b)}n.set(e,r)}}return n}(this.labelData,n,5);for(const t of e)t.updatePlacedLabelData?.(r.get(t.id)??[])}},So=class extends Ji{constructor(){super(...arguments),this.mementoOriginatorKey="legend",this.legendDataMap=new Map}createMemento(){return this.getData().filter(({hideInLegend:e,isFixed:t})=>!e&&!t).map(({enabled:e,seriesId:t,itemId:i,legendItemName:n})=>({visible:e,seriesId:t,itemId:i,legendItemName:n}))}guardMemento(e){return null==e||(0,n.cy)(e)}restoreMemento(e,t,i){i?.forEach(e=>{const{seriesId:t,data:i}=this.getRestoredData(e)??{};t&&i&&this.updateData(t,i)}),this.update()}getRestoredData(e){const{seriesId:t,itemId:i,legendItemName:n,visible:s}=e;if(t){const e=(this.legendDataMap.get(t)??[]).map(e=>{const n=e.seriesId===t&&(!i||e.itemId===i);return n&&e.isFixed&&this.warnFixed(e.seriesId,e.itemId),!e.isFixed&&n?{...e,enabled:s}:e});return{seriesId:t,data:e}}if(null!=i||null!=n)for(const e of this.getData()){if(null!=i&&e.itemId!==i||null!=n&&e.legendItemName!==n)continue;if(e.isFixed)return void this.warnFixed(e.seriesId,i);const t=(this.legendDataMap.get(e.seriesId)??[]).map(e=>e.itemId===i||e.legendItemName===n?{...e,enabled:s}:e);return{seriesId:e.seriesId,data:t}}}warnFixed(e,t){n.Vy.warnOnce(`The legend item with seriesId [${e}] and itemId [${t}] is not configurable, this series item cannot be toggled through the legend.`)}update(e){this.listeners.dispatch("legend-change",{type:"legend-change",legendData:e??this.getData()})}updateData(e,t=[]){this.legendDataMap.set(e,t)}clearData(){this.legendDataMap.clear()}toggleItem(e,t,i,n){if(n)return void this.getData().forEach(t=>{const i=(this.legendDataMap.get(t.seriesId)??[]).map(t=>t.legendItemName===n?{...t,enabled:e}:t);this.updateData(t.seriesId,i)});const s=this.getData(t),r=1===s.length,o=s.map(t=>null==i&&r||t.itemId===i?{...t,enabled:e}:t);this.updateData(t,o)}getData(e){return e?this.legendDataMap.get(e)??[]:[...this.legendDataMap].reduce((e,[t,i])=>e.concat(i),[])}getDatum({seriesId:e,itemId:t}={}){return this.getData(e).find(e=>e.itemId===t)}getSeriesEnabled(e){const t=this.getData(e);if(t.length>0)return t.some(e=>e.enabled)}getItemEnabled({seriesId:e,itemId:t}={}){return this.getDatum({seriesId:e,itemId:t})?.enabled??!0}},xo=class{constructor(){this.groups={}}registerSeries({internalId:e,seriesGrouping:t,visible:i,type:n}){var s;t&&((s=this.groups)[n]??(s[n]={}),this.groups[n][e]={grouping:t,visible:i})}updateSeries({internalId:e,seriesGrouping:t,visible:i,type:n}){if(!t)return;const s=this.groups[n]?.[e];s&&(s.grouping=t,s.visible=i)}deregisterSeries({internalId:e,type:t}){this.groups[t]&&delete this.groups[t][e],this.groups[t]&&0===Object.keys(this.groups[t]).length&&delete this.groups[t]}getVisiblePeerGroupIndex({type:e,seriesGrouping:t,visible:i}){if(!t)return{visibleGroupCount:i?1:0,visibleSameStackCount:i?1:0,index:0};const n=new Set,s=new Set;for(const i of Object.values(this.groups[e]??{}))i.visible&&(n.add(i.grouping.groupIndex),i.grouping.groupIndex===t.groupIndex&&s.add(i.grouping.stackIndex));const r=Array.from(n);return r.sort((e,t)=>e-t),{visibleGroupCount:r.length,visibleSameStackCount:s.size,index:r.indexOf(t.groupIndex)}}},Eo=class{constructor(e){this.updateCallback=e,this.events=new n.bk}addListener(e,t){return this.events.on(e,t)}removeListener(e,t){return this.events.on(e,t)}destroy(){this.events.clear()}update(e=0,t){this.updateCallback(e,t)}dispatchUpdateComplete(e){this.events.emit("update-complete",{type:"update-complete",apiUpdate:e})}dispatchPreDomUpdate(){this.events.emit("pre-dom-update",{type:"pre-dom-update"})}dispatchPreSceneRender(){this.events.emit("pre-scene-render",{type:"pre-scene-render"})}dispatchProcessData({series:e}){this.events.emit("process-data",{type:"process-data",series:e})}},Ao=class{constructor(e,t){this.callbackCache=new gs,this.chartEventManager=new Us,this.highlightManager=new Ks,this.layoutManager=new Hi,this.localeManager=new Qn,this.seriesStateManager=new xo,this.stateManager=new Zi,this.seriesLabelLayoutManager=new wo,this.destroyFns=[],this.contextModules=[];const{scene:i,root:n,syncManager:s,container:r,fireEvent:o,updateCallback:a,updateMutex:l,styleContainer:h,chartType:u,domMode:d}=t;this.chartService=e,this.syncManager=s,this.domManager=new In(this.chartService,r,h,d),this.widgets=new sr(this.domManager);const p=this.domManager.addChild("canvas","scene-canvas",i?.canvas.element);this.scene=i??new us({canvasElement:p}),this.scene.setRoot(n),this.destroyFns.push(this.scene.on("scene-changed",()=>{this.updateService.update(7)})),this.axisManager=new ys(n),this.legendManager=new So,this.annotationManager=new fs(e.annotationRoot,o),this.chartTypeOriginator=new ji(e),this.interactionManager=new Bs,this.contextMenuRegistry=new $s,this.updateService=new Eo(a),this.proxyInteractionService=new Yn(this.localeManager,this.domManager),this.fontManager=new Cs(this.domManager,this.updateService),this.historyManager=new qi(this.chartEventManager),this.animationManager=new Hs(this.interactionManager,l),this.dataService=new bs(this.animationManager),this.tooltipManager=new Js(this.localeManager,this.domManager,e.tooltip),this.zoomManager=new po(o,this.layoutManager);for(const e of c.byType("context")){if(!e.chartTypes.includes(u))continue;const t=e.moduleFactory(this);this.contextModules.push(t),this[e.contextKey]=t}}destroy(){this.animationManager.destroy(),this.highlightManager.destroy(),this.axisManager.destroy(),this.callbackCache.invalidateCache(),this.chartEventManager.destroy(),this.domManager.destroy(),this.fontManager.destroy(),this.highlightManager.destroy(),this.proxyInteractionService.destroy(),this.syncManager.destroy(),this.tooltipManager.destroy(),this.zoomManager.destroy(),this.widgets.destroy(),this.contextModules.forEach(e=>e.destroy()),this.destroyFns.forEach(e=>e())}},Mo=class extends De{constructor(){super(...arguments),this.range="tooltip"}};function To(e,t){if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}function Do(e,t){if(null==e||null==t)return e===t;if(e.size!==t.size)return!1;for(const[i,n]of e){const e=t.get(i);if(null==e)return!1;if(!To(n,e))return!1}return!0}function Io(e,t,i,s){return t===e.data&&(0,n.r1)(i,e.ids)&&function(e,t){const{props:i,...s}=e,{props:r,...o}=t;return P(s,o)&&function(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i+=1){const{type:s,idsMap:r,scopes:o,data:a,...l}=e[i],{type:c,idsMap:h,scopes:u,data:d,...p}=t[i];if(s!==c)return!1;if(o&&u&&!(0,n.r1)(o,u))return!1;if(a&&d&&a!==d)return!1;if(!P(l,p)||!Do(r,h))return!1}return!0}(i,r)}(s,e.opts)}a([Te],Mo.prototype,"range",2);var Ro=class e{constructor(){this.domain=new Set}static is(t){return t instanceof e}extend(e){this.domain.add(e)}getDomain(){return Array.from(this.domain)}},ko=class e{constructor(){this.domain=[1/0,-1/0]}static is(t){return t instanceof e}static extendDomain(e,t=[1/0,-1/0]){for(const i of e)"number"==typeof i&&(t[0]>i&&(t[0]=i),t[1]<i&&(t[1]=i));return t}extend(e){this.domain[0]>e&&(this.domain[0]=e),this.domain[1]<e&&(this.domain[1]=e)}getDomain(){return[...this.domain]}},Po=class{constructor(e){const t=e.reduce((e,t)=>Math.max(e,t.length),0);let i=1<<32-Math.clz32(t);t===i/2&&(i>>>=1),this.maxLevelSize=i;const n=new Float64Array(2*(2*i-1)).fill(NaN);for(const t of e)for(let e=0;e<t.length;e+=1){const s=Number(t[e]),r=i+e-1,o=0+(2*r|0),a=1+(2*r|0),l=n[o],c=n[a];(!Number.isFinite(l)||s<l)&&(n[o]=s),(!Number.isFinite(c)||s>c)&&(n[a]=s)}for(let e=i/2|0;e>=1;e=e/2|0){const t=e-1|0,i=t+e|0;for(let s=0;s<e;s+=1){const e=t+s,r=i+2*s,o=r+1,a=n[0+(2*r|0)],l=n[0+(2*o|0)];n[0+(2*e|0)]=!Number.isFinite(l)||a<l?a:l;const c=n[1+(2*r|0)],h=n[1+(2*o|0)];n[1+(2*e|0)]=!Number.isFinite(h)||c>h?c:h}}this.buffer=n}computeRangeInto(e,t,i,n,s,r,o){const a=s+r-1;if(a<t||s>=i)return o;if(s>=t&&a<i){const t=e[0+(2*n|0)],i=e[1+(2*n|0)];Number.isFinite(t)&&(o[0]=Math.min(o[0],t)),Number.isFinite(i)&&(o[1]=Math.max(o[1],i))}else r>1&&(n=2*n|0,r=r/2|0,this.computeRangeInto(e,t,i,n+1|0,s,r,o),this.computeRangeInto(e,t,i,n+2|0,s+r,r,o));return o}rangeBetween(e,t){if(e>t)return[NaN,NaN];const{maxLevelSize:i,buffer:n}=this,s=[1/0,-1/0];return this.computeRangeInto(n,e,t,0,0,i,s),s}get range(){const{buffer:e}=this;return[e[0],e[1]]}},_o=Symbol("domain-ranges");function Lo(e){return e.map(e=>(0,n.Gv)(e)?JSON.stringify(e):e).join("-")}function No(e){const t=e?.map(Number);return t?.every(Number.isFinite)?t:[]}function Oo(e,t){return t?.get(e.id)??0}function Fo(e){return"scopes"in e&&Array.isArray(e.scopes)}function Go(e,t){const i=[];for(let n=0;n<e;n+=1)i[n]=t;return i}function Bo(e,t,i){const n=[];for(const s of e){const e=s.get(t)?.[i];if(null==e)return;n.push(e)}return n}function Vo(e){const t=[];let i,n=0;const s=/((?:(?:^|\.)\s*\w+|\[\s*(?:'(?:[^']|(?<!\\)\\')*'|"(?:[^"]|(?<!\\)\\")*"|-?\d+)\s*\])\s*)/g;for(;i=s.exec(e);){if(i.index!==n)return;n=i.index+i[0].length;const e=i[1].trim();if(e.startsWith("."))t.push(e.slice(1).trim());else if(e.startsWith("[")){const i=e.slice(1,-1).trim();i.startsWith("'")?t.push(i.slice(1,-1).replace(/(?<!\\)\\'/g,"'")):i.startsWith('"')?t.push(i.slice(1,-1).replace(/(?<!\\)\\"/g,'"')):t.push(i)}else t.push(e)}if(n===e.length)return t}function Ho(e){return t=>{let i=t;for(const t of e)i=i[t];return i}}var Uo=class{constructor(e,t="standalone",i=!1){this.opts=e,this.mode=t,this.suppressFieldDotNotation=i,this.debug=v.create(!0,"data-model"),this.scopeCache=new Map,this.keys=[],this.values=[],this.aggregates=[],this.groupProcessors=[],this.propertyProcessors=[],this.reducers=[],this.processors=[],this.markScopeDatumInvalid=function(e,t,i,n){for(const s of e)n.has(s)||n.set(s,Go(t.length,!1)),n.get(s)[i]=!0};let n=!0;for(const t of e.props){if("key"===t.type&&!n)throw new Error("AG Charts - internal config error: keys must come before values.");"value"===t.type&&n&&(n=!1)}const s=({matchGroupIds:e=[]})=>{for(const t of e)if(this.values.every(e=>e.groupId!==t))throw new Error(`AG Charts - internal config error: matchGroupIds properties must match defined groups (${t}).`)},r=new Set,o=new Set;for(const t of e.props){const e="key"===t.type?r:o;switch(Fo(t)&&t.scopes?.forEach(t=>e.add(t)),t.type){case"key":this.keys.push({...t,index:this.keys.length,missing:new Map});break;case"value":if(null==t.property)throw new Error(`AG Charts - internal config error: no properties specified for value definitions: ${JSON.stringify(t)}`);this.values.push({...t,index:this.values.length,missing:new Map});break;case"aggregate":s(t),this.aggregates.push({...t,index:this.aggregates.length});break;case"group-value-processor":s(t),this.groupProcessors.push({...t,index:this.groupProcessors.length});break;case"property-value-processor":this.propertyProcessors.push({...t,index:this.propertyProcessors.length});break;case"reducer":this.reducers.push({...t,index:this.reducers.length});break;case"processor":this.processors.push({...t,index:this.processors.length})}}if(this.opts.groupByKeys||null!=this.opts.groupByFn){const e=new Set(o.values());if(r.forEach(t=>e.delete(t)),e.size>0)throw new Error(`AG Charts - scopes missing key for grouping, illegal configuration: ${[...e.values()]}`)}}resolveProcessedDataDefById(e,t){const i=this.scopeCache.get(e.id)?.get(t);if(!i)throw new Error(`AG Charts - didn't find property definition for [${t}, ${e.id}]`);return{index:i.index,def:i}}resolveProcessedDataIndexById(e,t){return this.resolveProcessedDataDefById(e,t).index}resolveKeysById(e,t,i){const n=this.resolveProcessedDataIndexById(e,t),s=i.keys[n];if(null==s)throw new Error(`AG Charts - didn't find keys for [${t}, ${e.id}]`);return s.get(e.id)}hasColumnById(e,t){return null!=this.scopeCache.get(e.id)?.get(t)}resolveColumnById(e,t,i){const n=this.resolveProcessedDataIndexById(e,t),s=i.columns?.[n];if(null==s)throw new Error(`AG Charts - didn't find column for [${t}, ${e.id}]`);return s}*forEachDatum(e,t,i){const n=t.columnScopes.findIndex(t=>t.has(e.id));for(const e of i.datumIndices[n]??[])yield t.columns[n][e]}*forEachGroupDatum(e,t){const i=t.columnScopes.findIndex(t=>t.has(e.id)),n={groupIndex:0,columnIndex:i},s=[];for(const e of t.groups){n.group=e;let t=0;for(const r of e.datumIndices[i]??s)n.datumIndex=r,n.valueIndex=t++,yield n;n.groupIndex++}}*forEachGroupDatumTuple(e,t){const i={columnIndex:t.columnScopes.findIndex(t=>t.has(e.id)),datumIndexes:[void 0,void 0,void 0]};for(const n of this.forEachGroupDatum(e,t))i.group=i.nextGroup,i.groupIndex=i.nextGroupIndex,i.nextGroup=n.group,i.nextGroupIndex=n.groupIndex,i.datumIndexes[0]=i.datumIndexes[1],i.datumIndexes[1]=i.datumIndexes[2],i.datumIndexes[2]=n.datumIndex,null!=i.group&&null!=i.datumIndexes[1]&&(yield i);i.group=i.nextGroup,i.groupIndex=i.nextGroupIndex,i.nextGroup=void 0,i.nextGroupIndex=void 0,i.datumIndexes[0]=i.datumIndexes[1],i.datumIndexes[1]=i.datumIndexes[2],i.datumIndexes[2]=void 0,null!=i.group&&null!=i.datumIndexes[1]&&(yield i)}getDomain(e,t,i,n){const s=this.getDomainsByType(i??"value",n);return s?.[this.resolveProcessedDataIndexById(e,t)]??[]}getDomainBetweenRange(e,t,[i,n],s){const r=t.map(t=>this.resolveProcessedDataIndexById(e,t)),o=r.join(":"),a=s[_o];let l=a.get(o);if(null==l){const e=r.map(e=>s.columns[e]);l=new Po(e),a.set(o,l)}return l.rangeBetween(i,n)}getDomainsByType(e,t){switch(e){case"key":return t.domain.keys;case"value":return t.domain.values;case"aggregate":return t.domain.aggValues;case"group-value-processor":return t.domain.groups;default:return null}}processData(e){const{opts:{groupByKeys:t,groupByFn:i},aggregates:s,groupProcessors:r,reducers:o,processors:a,propertyProcessors:l}=this,c=performance.now();if(t&&0===this.keys.length)return;let h=this.extractData(e);t?h=this.groupData(h):i&&(h=this.groupData(h,i(h))),r.length>0&&"grouped"===h.type&&this.postProcessGroups(h),s.length>0&&"ungrouped"===h.type?this.aggregateUngroupedData(h):s.length>0&&"grouped"===h.type&&this.aggregateGroupedData(h),l.length>0&&this.postProcessProperties(h),o.length>0&&this.reduceData(h),a.length>0&&this.postProcessData(h),this.warnDataMissingProperties(e);const u=performance.now();return h.time=u-c,this.debug.check()&&function(e){const t=(e,t)=>{t.length>0&&(n.Vy.log(`DataModel.processData() - ${e}`),n.Vy.table(t))};n.Vy.log("DataModel.processData() - processedData",e),t("Key Domains",e.domain.keys),t("Group Domains",e.domain.groups??[]),t("Value Domains",e.domain.values),t("Aggregate Domains",e.domain.aggValues??[])}(h),this.processScopeCache(),h}warnDataMissingProperties(e){if(0!==e.size)for(const t of(0,n.nl)(this.keys,this.values))for(const[i,s]of t.missing){if(s<(e.get(i)?.length??1/0))continue;const r=null==i?"":` for ${i}`;n.Vy.warnOnce(`the key '${t.property}' was not found in any data element${r}.`)}}processScopeCache(){this.scopeCache.clear();for(const e of(0,n.nl)(this.keys,this.values,this.aggregates))if(e.idsMap)for(const[t,i]of e.idsMap)for(const n of i)if(this.scopeCache.has(t)){if(this.scopeCache.get(t)?.has(n))throw new Error("duplicate definition ids on the same scope are not allowed.");this.scopeCache.get(t).set(n,e)}else this.scopeCache.set(t,new Map([[n,e]]))}valueGroupIdxLookup({matchGroupIds:e}){const t=[];for(const[i,n]of this.values.entries())(!e||n.groupId&&e.includes(n.groupId))&&t.push(i);return t}valueIdxLookup(e,t){const i=null==e||0===e.length,n="string"==typeof t?t:t.id,s=this.values.reduce((t,s,r)=>((null==s.scopes||i&&!s.scopes.length||s.scopes.some(t=>e?.includes(t)))&&(s.property===n||s.id===n||(t=>{if(t.idsMap)for(const[i,s]of t.idsMap)if(e?.includes(i)&&s.has(n))return!0;return!1})(s))&&t.push(r),t),[]);if(0===s.length)throw new Error(`AG Charts - configuration error, unknown property ${JSON.stringify(t)} in scope(s) ${JSON.stringify(e)}`);return s}extractData(e){const{dataDomain:t,processValue:i,allScopesHaveSameDefs:n}=this.initDataDomainProcessor(),{keys:s,values:r}=this,{invalidData:o,invalidKeys:a,allKeyMappings:l}=this.extractKeys(s,e,i),{columns:c,columnScopes:h,partialValidDataCount:u,maxDataLength:d}=this.extractValues(o,r,e,a,i),p=e=>{const i=t.get(e),n=i.getDomain();return ko.is(i)&&n[0]>n[1]?[]:n};return{type:"ungrouped",input:{count:d},scopes:new Set(e.keys()),dataSources:e,aggregation:void 0,keys:[...l.values()],columns:c,columnScopes:h,invalidKeys:a,invalidData:o,domain:{keys:s.map(p),values:r.map(p)},defs:{allScopesHaveSameDefs:n,keys:s,values:r},partialValidDataCount:u,time:0,[_o]:new Map}}extractKeys(e,t,i){const n=new Map,s=new Map,r=new Map;let o,a;const l=(e,t)=>{const i=a.get(e);o.set(t,o.get(i)),n.has(i)&&(n.set(t,n.get(i)),s.set(t,s.get(i)))};for(const c of e){const{invalidValue:e,scopes:h}=c;o=new Map,a=new Map,r.set(c,o);for(const r of h??[]){const h=t.get(r)??[];if(a.has(h)){l(h,r);continue}const u=[];let d,p;o.set(r,u),a.set(h,r);for(let t=0;t<h.length;t++){if(null==h[t]||"object"!=typeof h[t])continue;const n=i(c,h[t],t,r);n.valid?u.push(n.value):(u.push(e),d??(d=Go(h.length,!1)),p??(p=Go(h.length,!1)),d[t]=!0,p[t]=!0)}d&&p&&(n.set(r,d),s.set(r,p))}}return{invalidData:s,invalidKeys:n,allKeyMappings:r}}extractValues(e,t,i,s,r){let o=0;const a=[],l=[];let c=0;for(const h of t){const{invalidValue:t}=h;if(new Set(h.scopes.map(e=>i.get(e))).size>1)throw new Error(`AG Charts - more than one data source for: ${JSON.stringify(h)}`);const u=new Set(h.scopes),d=(0,n.$1)(h.scopes),p=i.get(d),g=new Array;for(let i=0;i<p.length;i++){if(null==p[i]||"object"!=typeof p[i])continue;const n=p[i],a=s.get(d)?.[i],l=r(h,n,i,h.scopes);let c=l.value;!a&&l.valid||this.markScopeDatumInvalid(h.scopes,p,i,e),a?c=t:l.valid||(o+=1,c=t),g[i]=c}a.push(g),l.push(u),c=Math.max(c,g.length)}return{columns:a,columnScopes:l,partialValidDataCount:o,maxDataLength:c}}groupData(e,t){var i;const s=new Map,{keys:r,columns:o,columnScopes:a,invalidKeys:l,invalidData:c}=e,h=e.scopes,u=new Set;for(const e of h){const d=o.map((e,t)=>t).filter(t=>!u.has(t)&&a[t].has(e));if(0===d.length)continue;for(const e of d)u.add(e);const p=new Set;for(const e of d)for(const t of a[e])p.add(t);const g=r.map(t=>t.get(e)).filter(e=>null!=e),f=o[(0,n.$1)(d)],m=c?.get(e),y=l?.get(e);for(let n=0;n<f.length;n++){if(!0===y?.[n])continue;const r=g.map(e=>e[n]);if(null==r||0===r.length)throw new Error("AG Charts - no keys found for scope: "+e);const o=t?.(r)??r,a=Lo(o),l=s.get(a)??{keys:o,datumIndices:[],validScopes:h};if(s.has(a)||s.set(a,l),!0===m?.[n]){l.validScopes===h&&(l.validScopes=new Set(h.values()));for(const e of p)l.validScopes.delete(e)}for(const e of d)(i=l.datumIndices)[e]??(i[e]=[]),l.datumIndices[e].push(n)}}const d=[],p=[];for(const{keys:e,datumIndices:t,validScopes:i}of s.values())d.push(e),p.push({datumIndices:t,keys:e,aggregation:[],validScopes:i});return{...e,type:"grouped",domain:{...e.domain,groups:d},groups:p}}aggregateUngroupedData(e){const t=this.aggregates.map(()=>[1/0,-1/0]);e.domain.aggValues=t;const{keys:i,columns:s,dataSources:r}=e,o=(0,n.$1)(r.keys()),a=r.get(o);e.aggregation=a?.map((e,n)=>{const r=[];for(const[e,a]of this.aggregates.entries()){const l=this.valueGroupIdxLookup(a);let c=a.groupAggregateFunction?.()??[1/0,-1/0];const h=l.map(e=>s[e][n]),u=Bo(i,o,n),d=null!=u?a.aggregateFunction(h,u):void 0;d&&(c=a.groupAggregateFunction?.(d,c)??ko.extendDomain(d,c));const p=a.finalFunction?.(c)??c;r[e]=p,ko.extendDomain(p,t[e])}return r})}aggregateGroupedData(e){const t=this.aggregates.map(()=>[1/0,-1/0]);e.domain.aggValues=t;const{columns:i}=e;for(const[n,s]of this.aggregates.entries()){const r=this.valueGroupIdxLookup(s);for(const o of e.groups){o.aggregation??(o.aggregation=[]);const e=o.keys;let a=s.groupAggregateFunction?.()??[1/0,-1/0];const l=Math.max(...r.map(e=>o.datumIndices[e]?.length??0));for(let t=0;t<l;t++){const n=r.map(e=>i[e][o.datumIndices[e]?.[t]]),l=s.aggregateFunction(n,e);l&&(a=s.groupAggregateFunction?.(l,a)??ko.extendDomain(l,a))}const c=s.finalFunction?.(a)??a;o.aggregation[n]=c,ko.extendDomain(c,t[n])}}}postProcessGroups(e){const{groupProcessors:t}=this,{columnScopes:i,columns:s,invalidData:r}=e;for(const o of t){const t=this.valueGroupIdxLookup(o),a=o.adjust()();for(const i of e.groups)a(s,t,i);for(const o of t){const t="category"===this.values[o].valueType,a=s[o],l=(0,n.$1)(i[o]),c=r?.get(l),h=t?new Ro:new ko;for(let e=0;e<a.length;e+=1)!0!==c?.[e]&&h.extend(a[e]);e.domain.values[o]=h.getDomain()}}}postProcessProperties(e){for(const{adjust:t,property:i,scopes:n}of this.propertyProcessors)for(const s of this.valueIdxLookup(n,i))t()(e,s)}reduceData(e){e.reduced??(e.reduced={});const{dataSources:t,keys:i}=e;for(const s of this.reducers){const r=s.reducer();let o=s.initialValue;if("grouped"===e.type)for(const t of e.groups)o=r(o,t.keys);else{const e=(0,n.$1)(t.keys()),s=i.map(t=>t.get(e)).filter(e=>null!=e),a=s.map(()=>{}),l=t.get(e);for(let e=0;e<l.length;e+=1){for(let t=0;t<a.length;t++)a[t]=s[t]?.[e];o=r(o,a)}}e.reduced[s.property]=o}}postProcessData(e){e.reduced??(e.reduced={});for(const t of this.processors)e.reduced[t.property]=t.calculate(e,e.reduced[t.property])}initDataDomainProcessor(){const{keys:e,values:t}=this,i=new Set;for(const e of t)if(e.scopes)for(const t of e.scopes)i.add(t);const s=new Map,r=new Map;let o=!0;const a=()=>{for(const r of(0,n.nl)(e,t))"category"===r.valueType?s.set(r,new Ro):(s.set(r,new ko),o&&(o=(r.scopes??[]).length===i.size))};a();const l=this.buildAccessors((0,n.nl)(e,t)),c={value:void 0,missing:!1,valid:!1};return{dataDomain:s,processValue:(e,t,i,o)=>{let h,u;if(l.has(e.property)){try{u=l.get(e.property)(t)}catch{}h=null!=u}else h=e.property in t,u=h?t[e.property]:e.missingValue;if(null!=e.forceValue&&(u=h&&(0,n.cI)(u)?-1*e.forceValue:e.forceValue,h=!0),c.missing=!h,!h&&!("missingValue"in e))if("string"==typeof o){const t=e.missing.get(o)??0;e.missing.set(o,t+1)}else for(const t of o){const i=e.missing.get(t)??0;e.missing.set(t,i+1)}if(s.has(e)||a(),h&&!1===e.validation?.(u,t,i)){if(c.valid=!1,!("invalidValue"in e))return"integrated"!==this.mode&&n.Vy.warnOnce(`invalid value of type [${typeof u}] for [${e.scopes} / ${e.id}] ignored:`,`[${u}]`),c.value=void 0,c;u=e.invalidValue}else c.valid=!0;if(e.processor){let t=r.get(e);null==t&&(t=e.processor(),r.set(e,t)),u=t(u,i)}return s.get(e)?.extend(u),c.value=u,c},initDataDomain:a,scopes:i,allScopesHaveSameDefs:o}}buildAccessors(e){const t=new Map;if(this.suppressFieldDotNotation)return t;for(const i of e){if(!i.property.includes(".")&&!i.property.includes("["))continue;const e=Vo(i.property);if(null==e){n.Vy.warnOnce("Invalid property path [%s]",i.property);continue}const s=Ho(e);t.set(i.property,s)}return t}},zo=class e{constructor(e,t){this.mode=e,this.suppressFieldDotNotation=t,this.debug=v.create(!0,"data-model"),this.requested=[],this.status="setup"}async request(e,t,i){if("setup"!==this.status)throw new Error("AG Charts - data request after data setup phase.");return new Promise((n,s)=>{this.requested.push({id:e,opts:i,data:t,resolve:n,reject:s})})}execute(e){if("setup"!==this.status)throw new Error("AG Charts - data request after data setup phase.");this.status="executed",this.debug("DataController.execute() - requested",this.requested);const t=this.validateRequests(this.requested);this.debug("DataController.execute() - validated",t);const i=this.mergeRequested(t);this.debug("DataController.execute() - merged",i),this.debug.check()&&((0,n.zk)().processedData=[]);const s=[];for(const{data:r,ids:o,opts:a,resolves:l,rejects:c}of i){const i=e?.find(e=>Io(e,r,o,a));let h,u;if(null==i)try{h=new Uo(a,this.mode,this.suppressFieldDotNotation);const e=new Map(t.map(e=>[e.id,e.data]));u=h.processData(e)}catch(e){c.forEach(t=>t(e));continue}else({dataModel:h,processedData:u}=i);s.push({opts:a,data:r,ids:o,dataModel:h,processedData:u}),this.debug.check()&&(0,n.zk)("processedData").push(u),0===u?.partialValidDataCount?l.forEach(e=>e({dataModel:h,processedData:u})):u?this.splitResult(h,u,o,l):c.forEach(e=>e(new Error("AG Charts - no processed data generated")))}return s}validateRequests(e){const t=[];for(const[i,n]of e.entries())i>0&&n.data.length!==e[0].data.length&&!1===n.opts.groupByData&&!1===n.opts.groupByKeys?n.reject(new Error("all series[].data arrays must be of the same length and have matching keys.")):t.push(n);return t}mergeRequested(t){const i=[];for(const n of t){const t=i.find(e.groupMatch(n));t?t.push(n):i.push([n])}return i.map(e.mergeRequests)}splitResult(e,t,i,n){for(let s=0;s<i.length;s++)(0,n[s])({dataModel:e,processedData:t})}static groupMatch({data:e,opts:t}){function i(e){return e.filter(e=>"key"===e.type).map(e=>e.property).join(";")}const{groupByData:n,groupByKeys:s=!1,groupByFn:r,props:o}=t,a=i(o);return([t])=>(!1===n||t.data===e)&&(t.opts.groupByKeys??!1)===s&&t.opts.groupByFn===r&&i(t.opts.props)===a}static mergeRequests(t){const i=new Set(["key","group-value-processor"]);return t.reduce((t,{id:n,data:s,resolve:r,reject:o,opts:{props:a,...l}})=>{t.ids.push(n),t.rejects.push(o),t.resolves.push(r),t.data??(t.data=s),t.opts??(t.opts={...l,props:[]});for(const r of a){const o={...r,scopes:[n],data:s};e.createIdsMap(n,o);const a=t.opts.props.find(t=>t.type===o.type&&(i.has(t.type)||t.data===o.data)&&e.deepEqual(t,o));a?(a.scopes??(a.scopes=[]),a.scopes.push(...o.scopes??[]),"key"!==a.type&&"value"!==a.type||!o.idsMap?.size||e.mergeIdsMap(o.idsMap,a.idsMap)):t.opts.props.push(o)}return t},{ids:[],rejects:[],resolves:[],data:null,opts:null})}static mergeIdsMap(e,t){for(const[i,n]of e){const e=t.get(i);if(null==e)t.set(i,new Set(n));else for(const t of n)e.add(t)}}static createIdsMap(e,t){null!=t.id&&(t.idsMap??(t.idsMap=new Map),t.idsMap.has(e)?t.idsMap.get(e).add(t.id):t.idsMap.set(e,new Set([t.id])))}static deepEqual(t,i){if(t===i)return!0;if(t&&i&&"object"==typeof t&&"object"==typeof i){if(t.constructor!==i.constructor)return!1;let n,s;if(Array.isArray(t)){if(s=t.length,s!==i.length)return!1;for(n=s-1;n>=0;n--)if(!e.deepEqual(t[n],i[n]))return!1;return!0}const r=Object.keys(t);if(s=r.length,s!==Object.keys(i).length)return!1;for(n=s-1;n>=0;n--){const s=r[n];if(!(e.skipKeys.has(s)||Object.hasOwn(i,s)&&e.deepEqual(t[s],i[s])))return!1}return!0}return!1}};zo.skipKeys=new Set(["id","idsMap","type","scopes","data"]);var Wo=zo,jo=new class{constructor(){this.axesMap=new Map,this.themeTemplates=new Map}register(e,t){this.axesMap.set(e,t.moduleFactory),t.themeTemplate&&this.setThemeTemplate(e,t.themeTemplate)}create(e,t){const i=this.axesMap.get(e);if(i)return i(t);throw new Error(`AG Charts - unknown axis type: ${e}`)}has(e){return this.axesMap.has(e)}keys(){return this.axesMap.keys()}setThemeTemplate(e,t){return this.themeTemplates.set(e,t),this}getThemeTemplate(e){return this.themeTemplates.get(e)}},$o=[{type:"root",optionsKey:"animation",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"]},{type:"root",optionsKey:"annotations",chartTypes:["cartesian"]},{type:"root",optionsKey:"background",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],optionsInnerKey:"image"},{type:"root",optionsKey:"foreground",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],optionsInnerKey:"image"},{type:"root",optionsKey:"chartToolbar",chartTypes:["cartesian"]},{type:"root",optionsKey:"contextMenu",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"]},{type:"root",optionsKey:"statusBar",chartTypes:["cartesian"],identifier:"status-bar"},{type:"root",optionsKey:"dataSource",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"]},{type:"root",optionsKey:"sync",chartTypes:["cartesian"]},{type:"root",optionsKey:"zoom",chartTypes:["cartesian","topology"]},{type:"root",optionsKey:"ranges",chartTypes:["cartesian"]},{type:"legend",optionsKey:"gradientLegend",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],identifier:"gradient"},{type:"root",optionsKey:"navigator",chartTypes:["cartesian"]},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"angle-category"},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"angle-number"},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"radius-category"},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"radius-number"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"bar",community:!0},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"line",community:!0},{type:"axis",optionsKey:"axes[]",chartTypes:["cartesian"],identifier:"ordinal-time"},{type:"axis-option",optionsKey:"crosshair",chartTypes:["cartesian"]},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"box-plot"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"candlestick"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"cone-funnel"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"funnel"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"ohlc"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"heatmap"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"range-area"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"range-bar"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"waterfall"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"nightingale"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radar-area"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radar-line"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radial-bar"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radial-column"},{type:"series",optionsKey:"series[]",chartTypes:["hierarchy"],identifier:"sunburst"},{type:"series",optionsKey:"series[]",chartTypes:["hierarchy"],identifier:"treemap"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-shape"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-line"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-marker"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-shape-background"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-line-background"},{type:"series",optionsKey:"series[]",chartTypes:["flow-proportion"],identifier:"chord"},{type:"series",optionsKey:"series[]",chartTypes:["flow-proportion"],identifier:"sankey"},{type:"series",optionsKey:"series[]",chartTypes:["standalone"],identifier:"pyramid"},{type:"series",optionsKey:"series[]",chartTypes:["gauge"],identifier:"linear-gauge"},{type:"series",optionsKey:"series[]",chartTypes:["gauge"],identifier:"radial-gauge"},{type:"series-option",optionsKey:"errorBar",chartTypes:["cartesian"],identifier:"error-bars"},{type:"context",contextKey:"sharedToolbar",chartTypes:["cartesian"]}];function Ko(e){return $o.find(t=>"series"===t.type&&t.identifier===e)?.chartTypes}function Yo(e){if(!function(e){return"enterprise"===e.packageType}(e))throw new Error("AG Charts - internal configuration error, only enterprise modules need verification.");const t=$o.find(t=>t.type===e.type&&(!("optionsKey"in t)||!("optionsKey"in e)||t.optionsKey===e.optionsKey)&&(!("contextKey"in t)||!("contextKey"in e)||t.contextKey===e.contextKey)&&t.identifier===e.identifier&&e.chartTypes.every(e=>t.chartTypes.includes(e)));return t&&(t.useCount??(t.useCount=0),t.useCount++),null!=t}var qo=new class{constructor(){this.legendMap=new Map,this.themeTemplates=new Map}register(e,{optionsKey:t,moduleFactory:i,themeTemplate:n}){this.legendMap.set(e,{optionsKey:t,moduleFactory:i}),this.themeTemplates.set(t,n)}create(e,t){const i=this.legendMap.get(e)?.moduleFactory;if(i)return i(t);throw new Error(`AG Charts - unknown legend type: ${e}`)}getThemeTemplates(){return Object.fromEntries(this.themeTemplates)}getKeys(){return Array.from(this.legendMap.entries()).reduce((e,[t,i])=>(e[t]=i.optionsKey,e),{})}},Xo=class extends Map{get(e){return super.get(e)??"unknown"}isCartesian(e){return"cartesian"===this.get(e)}isPolar(e){return"polar"===this.get(e)}isHierarchy(e){return"hierarchy"===this.get(e)}isTopology(e){return"topology"===this.get(e)}isFlowProportion(e){return"flow-proportion"===this.get(e)}isStandalone(e){return"standalone"===this.get(e)}isGauge(e){return"gauge"===this.get(e)}get seriesTypes(){return Array.from(this.keys())}get cartesianTypes(){return this.seriesTypes.filter(e=>this.isCartesian(e))}get polarTypes(){return this.seriesTypes.filter(e=>this.isPolar(e))}get hierarchyTypes(){return this.seriesTypes.filter(e=>this.isHierarchy(e))}get topologyTypes(){return this.seriesTypes.filter(e=>this.isTopology(e))}get flowProportionTypes(){return this.seriesTypes.filter(e=>this.isFlowProportion(e))}get standaloneTypes(){return this.seriesTypes.filter(e=>this.isStandalone(e))}get gaugeTypes(){return this.seriesTypes.filter(e=>this.isGauge(e))}},Zo=class extends Map{set(e,t){return super.set(e,L(t,this.get(e)))}},Qo=new Xo,Jo=new Xo,ea=new Zo,ta=new class{constructor(){this.seriesMap=new Map,this.themeTemplates=new Map}register(e,{chartTypes:[t],moduleFactory:i,tooltipDefaults:n,defaultAxes:s,themeTemplate:r,solo:o,stackable:a,groupable:l,stackedByDefault:c,hidden:h}){this.setThemeTemplate(e,r),this.seriesMap.set(e,{moduleFactory:i,tooltipDefaults:n,defaultAxes:s,solo:o,stackable:a,groupable:l,stackedByDefault:c}),Qo.set(e,t),h||Jo.set(e,t)}create(e,t){const i=this.seriesMap.get(e)?.moduleFactory;if(i)return i(t);throw new Error(`AG Charts - unknown series type: ${e}`)}cloneDefaultAxes(e){const t=this.seriesMap.get(e)?.defaultAxes;return null==t?null:{axes:Bt(t)}}setThemeTemplate(e,t){const i=this.themeTemplates.get(e);this.themeTemplates.set(e,L(t,i))}getThemeTemplate(e){return this.themeTemplates.get(e)}getTooltipDefauls(e){return this.seriesMap.get(e)?.tooltipDefaults}isSolo(e){return this.seriesMap.get(e)?.solo??!1}isGroupable(e){return this.seriesMap.get(e)?.groupable??!1}isStackable(e){return this.seriesMap.get(e)?.stackable??!1}isStackedByDefault(e){return this.seriesMap.get(e)?.stackedByDefault??!1}},ia=class e extends Ji{constructor(e){super(),this.chart=e}subscribe(t=e.DEFAULT_GROUP){let i=this.get(t);return i||(i={members:new Set},e.chartsGroups.set(t,i)),i.members.add(this.chart),this}unsubscribe(t=e.DEFAULT_GROUP){const i=this.get(t);return i?.members.delete(this.chart),delete i?.domains?.x?.sources?.[this.chart.id],delete i?.domains?.y?.sources?.[this.chart.id],this}getChart(){return this.chart}getGroupState(t=e.DEFAULT_GROUP){return this.get(t)}getGroupMembers(t=e.DEFAULT_GROUP){const i=this.get(t);return i?Array.from(i.members):[]}getGroupSiblings(t=e.DEFAULT_GROUP){return this.getGroupMembers(t).filter(e=>e!==this.chart)}getGroupSyncMode(t=e.DEFAULT_GROUP){return this.getGroupMembers(t).some(e=>e.series.length>1)?"multi-series":"single-series"}get(t){return e.chartsGroups.get(t)}};ia.chartsGroups=new Map,ia.DEFAULT_GROUP=Symbol("sync-group-default");var na=ia,sa=class extends De{constructor(){super(...arguments),this.enabled=!1}};a([Te],sa.prototype,"enabled",2),a([Te],sa.prototype,"tabIndex",2);var ra={};o(ra,{NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>oa,fromToMotion:()=>aa,staticFromToMotion:()=>la});var oa={added:"add",updated:"update",removed:"remove",unknown:"initial","no-op":"none"};function aa(e,t,i,n,s,r,o){const{fromFn:a,toFn:l,applyFn:c=(e,t)=>e.setProperties(t)}=s,{nodes:h,selections:u}=Ls(n),d=(n,s)=>{let h,u=0,d=0;for(const p of s){const g=n[u]===p,f={last:d>=s.length-1,lastLive:u>=n.length-1,prev:s[d-1],prevFromProps:h,prevLive:n[u-1],next:s[d+1],nextLive:n[u+(g?1:0)]},m=`${e}_${t}_${p.id}`;i.stopByAnimationId(m);let y="unknown";g?r&&o&&(y=ca(p,p.datum,r,o)):y="removed",p.transitionOut="removed"===y;const{phase:v,start:b,finish:C,delay:w,duration:S,...x}=a(p,p.datum,y,f),{phase:E,start:A,finish:M,delay:T,duration:D,...I}=l(p,p.datum,y,f),R=null==C;i.animate({id:m,groupId:e,phase:v??E??"update",duration:S??D,delay:w??T,from:x,to:I,ease:As,collapsable:R,onPlay:()=>{const e={...b,...A,...x};c(p,e,"start")},onUpdate(e){c(p,e,"update")},onStop:()=>{const e={...b,...A,...x,...I,...C,...M};c(p,e,"end")}}),g&&u++,d++,h=x}};let p=0;for(const n of u){const s=n.nodes();d(s.filter(e=>!n.isGarbage(e)),s),i.animate({id:`${e}_${t}_selection_${p}`,groupId:e,phase:"end",from:0,to:1,ease:As,onStop(){n.cleanup()}}),p++}d(h,h)}function la(e,t,i,n,s,r,o){const{nodes:a,selections:l}=Ls(n),{start:c,finish:h,phase:u}=o;i.animate({id:`${e}_${t}`,groupId:e,phase:u??"update",from:s,to:r,ease:As,onPlay:()=>{if(c){for(const e of a)e.setProperties(c);for(const e of l)for(const t of e.nodes())t.setProperties(c)}},onUpdate(e){for(const t of a)t.setProperties(e);for(const t of l)for(const i of t.nodes())i.setProperties(e)},onStop:()=>{for(const e of a)e.setProperties({...r,...h});for(const e of l){for(const t of e.nodes())t.setProperties({...r,...h});e.cleanup()}}})}function ca(e,t,i,n){const s=i(e,t);return n.added.has(s)?"added":n.removed.has(s)?"removed":null==e.previousDatum&&null!=e.datum?"added":null!=e.previousDatum&&null==e.datum?"removed":"updated"}var ha={};function ua(e,t){const{nodes:i,selections:n}=Ls(e);for(const e of n){for(const i of e.nodes()){const e=t(i,i.datum);i.setProperties(e)}e.cleanup()}for(const e of i){const i=t(e,e.datum);e.setProperties(i)}}o(ha,{resetMotion:()=>ua});var da=class e{constructor(e,t,i=!0){this.parentNode=e,this.autoCleanup=i,this.garbageBin=new Set,this._nodesMap=new Map,this._nodes=[],this.data=[],this.debug=v.create(!0,"scene","scene:selections"),this.nodeFactory=Object.prototype.isPrototypeOf.call(J,t)?()=>new t:t}static select(t,i,n=!0){return new e(t,i,n)}static selectAll(e,t){const i=[],n=e=>{t(e)&&i.push(e);for(const t of e.children())n(t)};return n(e),i}static selectByClass(t,...i){return e.selectAll(t,e=>i.some(t=>e instanceof t))}static selectByTag(t,i){return e.selectAll(t,e=>e.tag===i)}createNode(e,t,i){const n=this.nodeFactory(e);return n.datum=e,t?.(n),null==i?this._nodes.push(n):this._nodes.splice(i,0,n),this.parentNode.appendChild(n),n}update(e,t,i){if(this.garbageBin.size>0&&this.debug("Selection - update() called with pending garbage",e),i){const n=new Map(e.map((e,t)=>[i(e),[e,t]]));for(const[e,t]of this._nodesMap.entries())if(n.has(t)){const[i]=n.get(t);e.datum=i,this.garbageBin.delete(e),n.delete(t)}else this.garbageBin.add(e);for(const[e,[i,s]]of n.entries())this._nodesMap.set(this.createNode(i,t,s),e)}else{const i=Math.max(e.length,this.data.length);for(let n=0;n<i;n++)n>=e.length?this.garbageBin.add(this._nodes[n]):n>=this._nodes.length?this.createNode(e[n],t):(this._nodes[n].datum=e[n],this.garbageBin.delete(this._nodes[n]))}return this.data=e.slice(),this.autoCleanup&&this.cleanup(),this}cleanup(){return 0===this.garbageBin.size||(this._nodes=this._nodes.filter(e=>!this.garbageBin.has(e)||(this._nodesMap.delete(e),this.garbageBin.delete(e),e.destroy(),!1))),this}clear(){return this.update([]),this}isGarbage(e){return this.garbageBin.has(e)}each(e){for(const t of this._nodes.entries())e(t[1],t[1].datum,t[0]);return this}*[Symbol.iterator](){for(let e=0;e<this._nodes.length;e++){const t=this._nodes[e];yield{node:t,datum:t.datum,index:e}}}select(t){return e.selectAll(this.parentNode,t)}selectByClass(t){return e.selectByClass(this.parentNode,t)}selectByTag(t){return e.selectByTag(this.parentNode,t)}nodes(){return this._nodes}at(e){return this._nodes.at(e)}get length(){return this._nodes.length}},pa=class extends ut{constructor(e={}){super(e),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.restoreOwnStyles()}set x(e){this.x1=e,this.x2=e}set y(e){this.y1=e,this.y2=e}get midPoint(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}}computeBBox(){return new m(Math.min(this.x1,this.x2),Math.min(this.y1,this.y2),Math.abs(this.x2-this.x1),Math.abs(this.y2-this.y1))}isPointInPath(e,t){return(this.x1===this.x2||this.y1===this.y2)&&this.getBBox().clone().grow(this.strokeWidth/2).containsPoint(e,t)}distanceSquared(e,t){const{x1:i,y1:n,x2:s,y2:r}=this;return Ue(e,t,i,n,s,r,1/0)}render(e){const{ctx:t,devicePixelRatio:i}=e;let{x1:n,y1:s,x2:r,y2:o}=this;if(n===r){const{strokeWidth:e}=this,t=Math.round(n*i)/i+Math.trunc(e*i)%2/(2*i);n=t,r=t}else if(s===o){const{strokeWidth:e}=this,t=Math.round(s*i)/i+Math.trunc(e*i)%2/(2*i);s=t,o=t}t.beginPath(),t.moveTo(n,s),t.lineTo(r,o),this.fillStroke(t),this.fillShadow?.markClean(),super.render(e)}toSVG(){if(!this.visible)return;const e=(0,n.FJ)("line");return e.setAttribute("x1",String(this.x1)),e.setAttribute("y1",String(this.y1)),e.setAttribute("x2",String(this.x2)),e.setAttribute("y2",String(this.y2)),this.applySvgStrokeAttributes(e),{elements:[e]}}};pa.className="Line",pa.defaultStyles={...ut.defaultStyles,fill:void 0,strokeWidth:1},a([K()],pa.prototype,"x1",2),a([K()],pa.prototype,"y1",2),a([K()],pa.prototype,"x2",2),a([K()],pa.prototype,"y2",2);var ga="color: green",fa="color: grey";function ma(){return D(()=>{})}function ya(e,t){const i=R(t);if(0===i.length)return;const n=k(e);for(const e of i)e in n&&(t[e]=n[e])}var va=class{transitionRoot(e,t){this.parent?this.parent.transitionRoot(e,t):this.transition(e,t)}},ba=class e extends va{constructor(e,t,i){super(),this.defaultState=e,this.states=t,this.enterEach=i,this.debug=v.create(!0,"animation"),this.state=e,this.debug(`%c${this.constructor.name} | init -> ${e}`,ga)}transition(t,i){if(!this.transitionChild(t,i)||this.state===e.child||this.state===e.parent)return;const n=this.state,s=this.states[this.state];let r=s[t];const o=`%c${this.constructor.name} | ${this.state} -> ${t} ->`;if(Array.isArray(r))r=r.find(e=>{if(!e.guard)return!0;const t=e.guard(i);return t||this.debug(`${o} (guarded)`,e.target,fa),t});else if("object"==typeof r&&!(r instanceof e)&&r.guard&&!r.guard(i))return void this.debug(`${o} (guarded)`,r.target,fa);if(!r)return void this.debug(`${o} ${this.state}`,fa);const a=this.getDestinationState(r),l=a===this.state?void 0:s.onExit;this.debug(`${o} ${a}`,ga),this.state=a,"function"==typeof r?r(i):"object"!=typeof r||r instanceof e||r.action?.(i),l?.(),this.enterEach?.(n,a),a!==n&&a!==e.child&&a!==e.parent&&this.states[a].onEnter?.(n,i)}transitionAsync(e,t){setTimeout(()=>{this.transition(e,t)},0)}is(t){return this.state===e.child&&this.childState?this.childState.is(t):this.state===t}resetHierarchy(){this.debug(`%c${this.constructor.name} | ${this.state} -> [resetHierarchy] -> ${this.defaultState}`,"color: green"),this.state=this.defaultState}transitionChild(t,i){return this.state!==e.child||!this.childState||(ya(this,this.childState),this.childState.transition(t,i),!this.childState.is(e.parent)||(this.debug(`%c${this.constructor.name} | ${this.state} -> ${t} -> ${this.defaultState}`,ga),this.state=this.defaultState,this.states[this.state].onEnter?.(),this.childState.resetHierarchy(),!1))}getDestinationState(t){let i=this.state;return"string"==typeof t?i=t:t instanceof e?(this.childState=t,this.childState.parent=this,i=e.child):"object"==typeof t&&(t.target instanceof e?(this.childState=t.target,this.childState.parent=this,i=e.child):null!=t.target&&(i=t.target)),i}};ba.child="__child",ba.parent="__parent";var Ca=ba,wa=class extends va{constructor(...e){super(),this.stateMachines=e;for(const t of e)t.parent=this}transition(e,t){for(const i of this.stateMachines)ya(this,i),i.transition(e,t)}transitionAsync(e,t){for(const i of this.stateMachines)ya(this,i),i.transitionAsync(e,t)}},Sa=class{constructor(){this.moduleMap=new Map}*modules(){for(const e of this.moduleMap.values())yield e.moduleInstance}addModule(e,t){if(this.moduleMap.has(e.optionsKey))throw new Error(`AG Charts - module already initialised: ${e.optionsKey}`);this.moduleMap.set(e.optionsKey,{module:e,moduleInstance:t(e)})}removeModule(e){const t=(0,n.Kg)(e)?e:e.optionsKey;this.moduleMap.get(t)?.moduleInstance.destroy(),this.moduleMap.delete(t)}getModule(e){return this.moduleMap.get((0,n.Kg)(e)?e:e.optionsKey)?.moduleInstance}isEnabled(e){return this.moduleMap.has((0,n.Kg)(e)?e:e.optionsKey)}mapModules(e){return Array.from(this.moduleMap.values(),(t,i)=>e(t.moduleInstance,i))}destroy(){for(const e of this.moduleMap.keys())this.moduleMap.get(e)?.moduleInstance.destroy();this.moduleMap.clear()}};function xa(e){return"string"==typeof e?ur[e]:e}function Ea(e){return xa(e).unit}function Aa(e){return xa(e).hierarchy}function Ma(e){return xa(e).milliseconds}function Ta(e,t,i,n){return xa(e).range(t,i,n)}function Da(e,t){return xa(e).floor(t)}var Ia=class e extends io{constructor(){super(...arguments),this.type="unit-time",this._domain=[],this._bands=void 0}static is(t){return t instanceof e}set domain(e){e!==this._domain&&(this._domain=e,this._bands=void 0)}get domain(){return this._domain}get interval(){return this._interval}set interval(e){this._interval!==e&&(this._interval=e,this._bands=void 0)}get bands(){return this._bands??(this._bands=this.calculateBands(this._domain,[0,1])),this._bands}normalizeDomains(...e){return hr(...e)}convert(e,t){const{domain:i,interval:n}=this;if(i.length<2)return NaN;if(null!=n){const t=e.valueOf(),[s,r]=this.calculateBandRange(i,n),o=Math.min(s.valueOf(),r.valueOf()),a=Math.max(s.valueOf(),r.valueOf());if(t<o||t>=a+Ma(n))return NaN}return super.convert(e,t)}calculateBandRange(e,t){return[Da(t,e[0]),Da(t,e[1])]}calculateBands(e,t,i=!1){if(e===this.domain&&0===t[0]&&1===t[1]&&!i&&null!=this._bands)return this._bands;if(e.length<2)return[];const{interval:n}=this;if(null==n)return[];const[s,r]=this.calculateBandRange(e,n);return Ta(n,s,r,{visibleRange:t,extend:i})}ticks({interval:e},t=this.domain,i=[0,1],s=!1){if(t.length<2)return;const r=this.calculateBands(t,i,s),o=this.interval?Ma(this.interval):1/0;if(null==e)return{ticks:r,count:void 0};const a=Math.min(t[0].valueOf(),t[1].valueOf()),l=Math.max(t[0].valueOf(),t[1].valueOf()),c=[];let h,u,d,p,g,f;e instanceof br?(h=e.range(t[0],t[1],{extend:!0,visibleRange:i}),u=0,d=h.length-1):(h=r,u=(0,n.I5)(0,r.length-1,e=>r[e].valueOf()<=a)??0,d=(0,n.I5)(0,r.length-1,e=>r[e].valueOf()<=l)??r.length-1);for(let e=u;e<=d;e++){const t=h[e].valueOf(),i=(0,n.I5)(0,r.length-1,e=>r[e].valueOf()<=t),s=null!=i&&i!=p?r[i]:void 0;p=i,null!=s&&t-s.getTime()<=o&&c.push(s)}if(this.interval){const e=this.calculateBandRange([new Date(a),new Date(l)],this.interval);g=e[0].valueOf(),f=e[1].valueOf()}else g=a,f=l;let m=(0,n.S3)(0,c.length-1,e=>c[e].valueOf()>=g)??0,y=(0,n.I5)(0,c.length-1,e=>c[e].valueOf()<=f)??c.length-1;return s&&(m=Math.max(m-1,0),y=Math.min(y+1,c.length-1)),{ticks:c.slice(m,y+1),count:c.length}}findIndex(e){const{bands:t}=this,i=e.valueOf();return(0,n.I5)(0,t.length-1,e=>t[e].valueOf()<=i)}datumFormatter(e){const t=this.tickFormatter(e,1);return e=>{const i=this.findIndex(e);return t(null!=i?this.bands[i]:e)}}};Ia.defaultTickCount=12;var Ra=Ia;function ka(e,t){return e.valueOf()-t.valueOf()}function Pa(e){const t=e.slice().sort(ka);return null==_a(t)?function(e){let t=NaN;const i=[];for(const n of e){const e=n.valueOf();t!==e&&i.push(n),t=e}return i}(t):t}function _a(e){if(0===e.length)return 1;const t=Number(e[e.length-1])>Number(e[0])?1:-1;let i=-1/0*t;for(const n of e){const e=n.valueOf();if(Math.sign(e-i)!==t)return;i=e}return t}var La=(e,t,i)=>({duration:t*i,timeInterval:e,step:i}),Na=[La(Ar,dr,1),La(Ar,dr,5),La(Ar,dr,15),La(Ar,dr,30),La(Tr,pr,1),La(Tr,pr,5),La(Tr,pr,15),La(Tr,pr,30),La(Ir,gr,1),La(Ir,gr,3),La(Ir,gr,6),La(Ir,gr,12),La(Sr,fr,1),La(Sr,fr,2),La(kr,mr,1),La(kr,mr,2),La(kr,mr,3),La(wr,yr,1),La(wr,yr,2),La(wr,yr,3),La(wr,yr,4),La(wr,yr,6),La(Cr,vr,1)],Oa=[1,2,5,10];function Fa(e,t){return Math.abs(Math.round(e)-e)<t}function Ga(e,t,i){return Math.abs(t-e)>=i?Math.abs(t-e)/i+1:1}function Ba(e,t,i,n,s,r){if(e===t)return{ticks:[e],count:1};if(i<2)return{ticks:[e,t],count:2};const o=za(e,t,i,n,s);if(!Number.isFinite(o))return{ticks:[],count:0};let a=e,l=t;if(Fa(a/o,1e-12)||(a=Math.ceil(a/o)*o),Fa(l/o,1e-12)||(l=Math.floor(l/o)*o),null!=r){const i=l-a,n=t-e;r=[(e+n*r[0]-a)/i,(e+n*r[1]-a)/i]}const{ticks:c}=$a(a,l,o,r);return{ticks:c,count:Ga(e,t,o)}}var Va=Math.floor(2*kr.milliseconds/wr.milliseconds*10)/10;function Ha({timeInterval:e,step:t}){return e.milliseconds*t<=(e.hierarchy?.milliseconds??1/0)*Va}function Ua(e,t,i,n,s,{weekStart:r,primaryOnly:o=!1,targetInterval:a}){if(i<=0)return;const l=a??Math.abs(t-e)/Math.max(i,1),c=Na.findLast(e=>(!o||Ha(e))&&l>e.duration),h=Na.find(e=>(!o||Ha(e))&&l<=e.duration);if(null==c){const r=Math.max(za(e,t,i,n,s),1);return xr.every(r)}if(null==h){const r=null==a?za(e/vr,t/vr,i,n,s):1;return Cr.every(r)}const{timeInterval:u,step:d}=l-c.duration<h.duration-l?c:h;return u===kr?r?.every(d)??Sr.every(7*d):u.every(d)}function za(e,t,i,s=0,r=1/0){if(e===t)return(0,n.qE)(1,s,r);if(i<1)return NaN;const o=Math.abs(t-e),a=10**Math.floor(Math.log10(o/i));let l=NaN,c=1/0,h=!1;for(const e of Oa){const t=Math.ceil(o/(e*a)),n=t>=s&&t<=r;if(h&&!n)continue;const u=Math.abs(t-i);(c>u||h!==n)&&(h||(h=n),c=u,l=e)}return l*a}function Wa(e){for(let t=e.length-1;t>=0;t-=1)if("0"!==e[t])return t+1;return 0}function ja(e,t){const i=(0,n.sA)(t??",f");(null==i.precision||isNaN(i.precision))&&(!i.type||"eEFgGnprs".includes(i.type)?i.precision=Math.max(...e.map(e=>{if(!Number.isFinite(e))return 0;const[t,n]=e.toExponential((i.type?6:12)-1).split(/[.e]/g);return("1"!==t&&"-1"!==t?1:0)+Wa(n)+1})):"f%".includes(i.type)&&(i.precision=Math.max(...e.map(e=>{if(!Number.isFinite(e)||0===e)return 0;const t=Math.floor(Math.log10(Math.abs(e))),n=i.type?6:12,s=Wa(e.toExponential(n-1).split(/[.e]/g)[1]);return Math.max(0,s-t)}))));const s=(0,n.OR)(i);return e=>s(Number(e))}function $a(e,t,i,s){if(!Number.isFinite(i)||i<=0)return{ticks:[],count:0};if(e===t)return{ticks:[e],count:1};const r=10**(0,n.o3)(i),o=Math.min(e,t),a=Math.max(e,t);let l,c;if(null==s||0===s[0]&&1===s[1])l=o,c=a;else{const i=t-e,n=e+i*s[0],r=t-i*(1-s[1]);l=Math.min(n,r),c=Math.max(n,r)}l=Math.floor(l*r)/r,c=Math.ceil(c*r)/r;const h=[];for(let e=0;;e+=1){const t=Math.round((o+i*e)*r)/r;if(t>a)break;t>=l&&t<=c&&h.push(t)}return{ticks:h,count:Ga(o,a,i)}}function Ka(e,t){return e>=t&&(n.Vy.warnOnce("the configured interval results in more than 1 item per pixel, ignoring. Supply a larger interval or omit this configuration"),!0)}function Ya(e,t){const i=Math.abs(t-e),n=10**Math.floor(Math.log10(i));let s=1/0,r=[e,t];for(const o of Oa){const a=o*n,l=Math.floor(e/a)*a,c=Math.ceil(t/a)*a,h=1-i/Math.abs(c-l);s>h&&(s=h,r=[l,c])}return r}function qa(e,t,i,s,r,o){if(e<=0)return{minTickCount:0,maxTickCount:0,tickCount:0};o=Math.max(o,e/(r+1)),i??(i=o),s??(s=e),i>s&&(i===o?i=s:s=i);const a=Math.max(1,Math.floor(e/(t*i))),l=Math.min(a,Math.ceil(e/(t*s)));return{minTickCount:l,maxTickCount:a,tickCount:(0,n.qE)(l,Math.floor(r/t),a)}}var Xa=class e extends cr{constructor(){super([],[0,1]),this.type="time"}static is(t){return t instanceof e}toDomain(e){return new Date(e)}convert(e,t){return e instanceof Date||(e=new Date(e)),super.convert(e,t)}invert(e){return new Date(super.invert(e))}niceDomain(e,t=this.domain){if(t.length<2)return[];let[i,n]=t;const s=this.getPixelRange();for(let t=0;t<4;t++){const[t,r]=Ja(i,n,e,s);if(Zr(i)===Zr(t)&&Zr(n)===Zr(r))break;i=t,n=r}return[i,n]}ticks(e,t=this.domain,i=[0,1],n=!1){const{nice:s,interval:r,tickCount:o=cr.defaultTickCount,minTickCount:a,maxTickCount:l}=e;if(t.length<2)return;const c=t.map(Zr),h=c[0],u=c[c.length-1];return null!=r?{ticks:Qa({start:h,stop:u,interval:r,availableRange:this.getPixelRange(),visibleRange:i,extend:n})??Za({start:h,stop:u,tickCount:o,minTickCount:a,maxTickCount:l,visibleRange:i,extend:n}),count:void 0}:s&&2===o?{ticks:t,count:void 0}:s&&1===o?{ticks:t.slice(0,1),count:void 0}:{ticks:Za({start:h,stop:u,tickCount:o,minTickCount:a,maxTickCount:l,visibleRange:i,extend:n}),count:void 0}}_tickFormatter({domain:e,ticks:t,specifier:i},n){return null!=i?Xr(i):Qr(t,e,n)}tickFormatter(e){return this._tickFormatter(e)}datumFormatter(e){return this._tickFormatter(e,1)}};function Za({start:e,stop:t,tickCount:i,minTickCount:n,maxTickCount:s,visibleRange:r,extend:o}){const a=Ua(e,t,i,n,s,{weekStart:kr});return a?a.range(new Date(e),new Date(t),{visibleRange:r,extend:o}):[]}function Qa({start:e,stop:t,interval:i,availableRange:n,visibleRange:s,extend:r}){if(!i)return[];if(i instanceof br||"string"==typeof i){const o=Ta(i,new Date(e),new Date(t),{visibleRange:s,extend:r});if(Ka(o.length,n))return;return o}const o=Math.abs(i);if(Ka(Math.abs(t-e)/o,n))return;const a=Na.findLast(e=>o%e.duration===0);if(a)return a.timeInterval.every(o/(a.duration/a.step)).range(new Date(e),new Date(t),{visibleRange:s,extend:r});let l=new Date(Math.min(e,t));const c=new Date(Math.max(e,t)),h=[];for(;l<=c;)h.push(l),l=new Date(l),l.setMilliseconds(l.getMilliseconds()+o);return h}function Ja(e,t,i,n){const{interval:s}=i,r=Math.min(Zr(e),Zr(t)),o=Math.max(Zr(e),Zr(t));let a;if(s instanceof br)a=s;else if("string"==typeof s)a=s;else{let e;"number"==typeof s&&(e=(o-r)/Math.max(s,1),Ka(e,n)&&(e=void 0)),e??(e=i.tickCount??cr.defaultTickCount),a=Ua(r,o,e,i.minTickCount,i.maxTickCount,{weekStart:kr})}if(null==a)return[e,t];const l=Ta(a,new Date(r),new Date(o),{extend:!0});if(null==l||l.length<2)return[e,t];const c=l[0],h=l[l.length-1];return e<=t?[c,h]:[h,c]}var el=class e extends io{constructor(){super(...arguments),this.type="ordinal-time",this._domain=[],this.isReversed=!1}static is(t){return t instanceof e}set domain(e){e!==this._domain&&(this.invalid=!0,this._domain=e,this._bands=void 0,this.isReversed=e.length>0&&e[0]>e[e.length-1],this.sortedTimestamps=void 0,this.precomputedSteps=void 0)}get domain(){return this._domain}get bands(){return this._bands??(this._bands=this.isReversed?this.domain.slice().reverse():this.domain),this._bands}normalizeDomains(...e){const t=e.filter(e=>e.length>0);if(0===t.length)return{domain:[],animatable:!1};if(1===t.length){let e=t[0];const i=_a(e);return-1===i?e=e.slice().reverse():null==i&&(e=Pa(e.slice())),{domain:e,animatable:!0}}return{domain:Pa(t.flat()),animatable:!0}}ticks({interval:e,maxTickCount:t},i=this.domain,n=[0,1],s=!1){if(!i.length)return;this.refresh();const{isReversed:r}=this;if(null==e)return{ticks:tl(i,t,r,n,s),count:void 0};const o=i[0].valueOf(),a=i[i.length-1].valueOf(),[l,c]=this.range;let h=Qa({start:o,stop:a,interval:e,availableRange:Math.abs(c-l),visibleRange:n,extend:s})??tl(i,t,r,n,s),u=-1;return h=h.filter(e=>{const t=this.findInterval(e.valueOf()),i=t===u;return u=t,!i}),{ticks:h,count:void 0}}getSortedTimestamps(){let{sortedTimestamps:e}=this;return null==e&&(e??(e=this.bands.map(Zr)),this.sortedTimestamps=e),e}getPrecomputedSteps(){const{domain:e}=this;let{precomputedSteps:t}=this;const i=e.length<1e4?e.length:Math.ceil(e.length/16);if(null!=t||i<=1)return t;const n=this.getSortedTimestamps();t=new Int32Array(i);const s=n[0],r=n[n.length-1]-s,o=n.length-1;for(let e=0;e<t.length;e+=1)t[e]=this.findIntervalInRange(s+e/i*r,0,o);this.precomputedSteps=t}findIntervalInRange(e,t,i){const n=this.getSortedTimestamps();for(;t<=i;){const s=(t+i)/2|0;if(n[s]===e)return s;n[s]<e?t=s+1:i=s-1}return t}findInterval(e){const t=this.getPrecomputedSteps();let i,n;if(null==t)i=0,n=this.domain.length-1;else{const s=this.getSortedTimestamps(),r=s[0],o=s[s.length-1],a=Math.min((e-r)/(o-r)*t.length|0,t.length-1|0);i=t[a],n=a<t.length-2?t[a+1]:s.length-1}return this.findIntervalInRange(e,i,n)}datumFormatter(e){return this.tickFormatter(e)}findIndex(e){const t=this.getSortedTimestamps(),i=Number(e);if(!(i<t[0]))return this.findInterval(i)}};function tl(e,t,i,n,s){const r=[],o=Math.ceil(e.length/t),a=Math.floor(o/2);let l=Math.floor(n[0]*e.length),c=Math.ceil(n[1]*e.length);s&&(l>o&&(l-=o),c<e.length-o&&(c+=o));for(let t=l;t<c;t+=1){const n=i?e.length-1-t:t;(o<=0||(n+a)%o===0)&&r.push(e[t])}return r}var il=class extends ut{constructor(e={}){super(e),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.startLine=!1,this.endLine=!1,this.horizontal=!1,this.restoreOwnStyles()}computeBBox(){return new m(this.x1,this.y1,this.x2-this.x1,this.y2-this.y1)}isPointInPath(e,t){return!1}render(e){const{ctx:t}=e;let{x1:i,y1:n,x2:s,y2:r}=this;i=this.align(i),n=this.align(n),s=this.align(s),r=this.align(r);const{fill:o,horizontal:a}=this,{globalAlpha:l}=t;null!=o&&(this.applyFillAndAlpha(t),t.beginPath(),t.moveTo(i,n),t.lineTo(s,n),t.lineTo(s,r),t.lineTo(i,r),t.closePath(),t.fill(),t.globalAlpha=l);const{stroke:c,strokeWidth:h,startLine:u,endLine:d}=this;if((u||d)&&c&&h){const{lineDash:e,lineDashOffset:o,lineCap:c,lineJoin:p}=this;this.applyStrokeAndAlpha(t),t.lineWidth=h,e&&t.setLineDash([...e]),o&&(t.lineDashOffset=o),c&&(t.lineCap=c),p&&(t.lineJoin=p),t.beginPath(),u&&(t.moveTo(i,n),a?t.lineTo(i,r):t.lineTo(s,n)),d&&(t.moveTo(s,r),a?t.lineTo(s,n):t.lineTo(i,r)),t.stroke(),t.globalAlpha=l}this.fillShadow?.markClean(),super.render(e)}};function nl(e){return(0,n.Bf)(e)||(0,n.vd)(e)||function(e){return null!=e&&Object.hasOwn(e,"valueOf")&&(0,n.Bf)(e.valueOf())}(e)}function sl(e){return function(e){return null!=e&&Object.hasOwn(e,"toString")&&(0,n.Kg)(e.toString())}(e)&&Object.hasOwn(e,"id")?e.id:e}function rl(e){switch(e.type){case"line":return e.value;case"range":return e.range}}function ol(e,t){if(null==e)return!1;const i=cr.is(t)||io.is(t),s=e=>function(e,t){return null!=e&&(!t||nl(e))}(e,i)&&!isNaN(t.convert(e));if((0,n.cy)(e)){const[t,i]=e;return s(t)&&s(i)}return s(e)}il.className="Range",il.defaultStyles={...ut.defaultStyles,strokeWidth:1},a([K()],il.prototype,"x1",2),a([K()],il.prototype,"y1",2),a([K()],il.prototype,"x2",2),a([K()],il.prototype,"y2",2),a([K()],il.prototype,"startLine",2),a([K()],il.prototype,"endLine",2),a([K()],il.prototype,"horizontal",2);var al={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:1},"top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:-1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:-1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:-1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:-1},"bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:-1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:-1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:1},"inside-top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},ll={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:-1},"top-left":{rangeH:-1,rangeV:-1,labelH:1,labelV:-1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:1,labelV:-1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:1,labelV:1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:1,labelV:1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:1},"bottom-right":{rangeH:1,rangeV:1,labelH:-1,labelV:1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:-1,labelV:1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:-1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:-1,labelV:-1},"inside-top-right":{rangeH:-1,rangeV:-1,labelH:-1,labelV:-1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},cl={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:-1},"top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:-1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:-1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:-1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:1},"bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:-1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:1},"inside-top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:-1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},hl={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:-1},"top-left":{rangeH:-1,rangeV:-1,labelH:1,labelV:-1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:-1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:-1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:1,labelV:1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:1},"bottom-right":{rangeH:1,rangeV:1,labelH:-1,labelV:1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:-1,labelV:-1},"inside-top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:-1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},ul=class extends De{constructor(){super(...arguments),this.fontSize=14,this.fontFamily="Verdana, sans-serif",this.padding=5,this.color="rgba(87, 87, 87, 1)"}};a([Te],ul.prototype,"enabled",2),a([Te],ul.prototype,"text",2),a([Te],ul.prototype,"fontStyle",2),a([Te],ul.prototype,"fontWeight",2),a([Te],ul.prototype,"fontSize",2),a([Te],ul.prototype,"fontFamily",2),a([Te],ul.prototype,"padding",2),a([Te],ul.prototype,"color",2),a([Te],ul.prototype,"position",2),a([Te],ul.prototype,"rotation",2),a([Te],ul.prototype,"parallel",2);var dl=class extends De{constructor(){super(),this.id=(0,n.sX)(this),this.defaultColorRange=[],this.fill="#c16068",this.label=new ul,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.position="top",this.rangeGroup=new Mt({name:this.id}),this.lineGroup=new Mt({name:this.id}),this.labelGroup=new Mt({name:this.id}),this.crossLineRange=new il,this.crossLineLabel=new Ni,this.data=void 0,this.startLine=!1,this.endLine=!1,this._isRange=void 0,this.lineGroup.append(this.crossLineRange),this.labelGroup.append(this.crossLineLabel),this.crossLineRange.pointerEvents=1}get defaultLabelPosition(){return"top"}update(e){const{enabled:t,type:i,data:n,scale:s}=this;if(!(s&&t&&e&&ol(rl(this),s)&&null!=n))return this.rangeGroup.visible=!1,this.lineGroup.visible=!1,void(this.labelGroup.visible=!1);this.rangeGroup.visible=e,this.lineGroup.visible=e,this.labelGroup.visible=e,this.updateNodes();const r="range"===i;r!==this._isRange&&(r?this.rangeGroup.appendChild(this.crossLineRange):this.lineGroup.appendChild(this.crossLineRange)),this._isRange=r}calculateLayout(e,t){if(this.data=void 0,!e)return;const{type:i,range:n,value:s,scale:r,clippedRange:o,strokeWidth:a=0}=this;if(!r)return;const l=r.bandwidth??0,c=r.step??0,h=(t?-1:1)*(r instanceof to?(c-l)/2:0);let u,d,p,g;if("line"===i){const e=l/2;u=r.convert(s)+e,d=NaN,p=r.convert(s,{clamp:!0})+e,g=NaN}else{if(!n)return;{const[e,t]=n,i=e?.valueOf()===t?.valueOf()&&el.is(r)?l/2+h:0;u=r.convert(e)+i,d=r.convert(t)+l,p=r.convert(e,{clamp:!0})+i-h,g=r.convert(t,{clamp:!0})+l+h}}p=rr(p,o),g=rr(g,o);const f=(u===p||d===g||p!==g)&&Math.abs(g-p)>0;f&&p>g&&([p,g]=[g,p],[u,d]=[d,u]),u-h>=p&&(u-=h),d+h<=g&&(d+=h),this.startLine=a>0&&u>=p&&u<=p+h,this.endLine=a>0&&d>=g-l-h&&d<=g,("range"!==i||f||this.startLine||this.endLine)&&(this.data=[p,g],!1!==this.label.enabled&&this.label.text)}updateNodes(){const{position:e,data:[t,i]=[0,0],gridLength:n}=this,s=Number.isFinite(i)?i-t:0;let r;switch(e){case"top":case"bottom":r=new m(t,"top"===e?0:-n,s,n);break;case"left":case"right":r=new m("left"===e?0:-n,t,n,s)}this.updateRangeNode(r);const{label:o}=this;!1!==o.enabled&&o.text&&(this.updateLabel(),this.positionLabel(r))}updateRangeNode(e){const{type:t,position:i,crossLineRange:n,startLine:s,endLine:r,fill:o,fillOpacity:a,stroke:l,strokeWidth:c,strokeOpacity:h,lineDash:u}=this;n.x1=e.x,n.x2=e.x+e.width,n.y1=e.y,n.y2=e.y+e.height,n.horizontal="top"===i||"bottom"===i,n.startLine=s,n.endLine=r,n.fill="range"===t?o:void 0,n.fillOpacity=a??1,n.stroke=l,n.strokeWidth=c??1,n.strokeOpacity=h??1,n.lineDash=u}updateLabel(){const{crossLineLabel:e,label:t}=this;t.text&&(e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.fontSize=t.fontSize,e.fontFamily=t.fontFamily,e.fill=t.color,e.text=t.text)}get anchor(){const e="left"===this.position||"right"===this.position,t="range"===this.type,{position:i=this.defaultLabelPosition}=this.label;return t?(e?cl:hl)[i]:(e?al:ll)[i]}positionLabel(e){const{crossLineLabel:t,label:i,anchor:n}=this;t.rotation=oe(i.rotation??0),t.textBaseline="middle",t.textAlign="center";const s=t.getBBox();if(!s)return;const{width:r,height:o}=s,a=i.padding+r/2,l=i.padding+o/2,c=e.x+e.width*(n.rangeH+1)/2-a*n.labelH,h=e.y+e.height*(n.rangeV+1)/2-l*n.labelV;t.x=c,t.y=h,t.rotationCenterX=c,t.rotationCenterY=h}computeLabelSize(){const{label:e}=this;if(!1===e.enabled||!e.text)return;const t=new Ni;t.fontFamily=e.fontFamily,t.fontSize=e.fontSize,t.fontStyle=e.fontStyle,t.fontWeight=e.fontWeight,t.text=e.text,t.rotation=oe(e.rotation??0),t.textBaseline="middle",t.textAlign="center";const i=t.getBBox();if(!i)return;const{width:n,height:s}=i;return{width:n,height:s}}calculatePadding(e){const{label:t,anchor:i}=this,n=this.computeLabelSize();if(!n)return;const{width:s,height:r}=n,o=t.padding+s,a=t.padding+r,l="left"===this.position||"right"===this.position;l&&(-1===i.rangeH&&1===i.labelH?e.left=Math.max(e.left??0,o):1===i.rangeH&&-1===i.labelH&&(e.right=Math.max(e.right??0,o))),l||(-1===i.rangeV&&1===i.labelV?e.top=Math.max(e.top??0,a):1===i.rangeV&&-1===i.labelV&&(e.bottom=Math.max(e.bottom??0,a)))}};dl.className="CrossLine",a([Te],dl.prototype,"enabled",2),a([Te],dl.prototype,"type",2),a([Te],dl.prototype,"range",2),a([Te],dl.prototype,"value",2),a([Te],dl.prototype,"defaultColorRange",2),a([Te],dl.prototype,"fill",2),a([Te],dl.prototype,"fillOpacity",2),a([Te],dl.prototype,"stroke",2),a([Te],dl.prototype,"strokeWidth",2),a([Te],dl.prototype,"strokeOpacity",2),a([Te],dl.prototype,"lineDash",2),a([Te],dl.prototype,"label",2);var pl=class extends De{constructor(){super(...arguments),this.enabled=!0}getFont(){return Ri.toFontString(this)}};function gl(e,t,i,n,s){const r=t>0&&t<=Math.PI,o=i>0&&i<=Math.PI;if(e){if(!t&&!i)return"center";if(n*(r||o?-1:1)==-1)return"end"}else if(n*s===-1)return"end";return"start"}function fl(e,t){if(null!=e)return"string"==typeof e?e:(0,n.Qd)(e)&&null!=t?e[Ea(t)]:void 0}a([Te],pl.prototype,"enabled",2),a([Te],pl.prototype,"color",2),a([Te],pl.prototype,"fontStyle",2),a([Te],pl.prototype,"fontWeight",2),a([Te],pl.prototype,"fontSize",2),a([Te],pl.prototype,"fontFamily",2),a([Te],pl.prototype,"formatter",2);var ml=class{constructor(){this.enabled=!0,this.width=1,this.style=[{stroke:void 0,lineDash:[]}]}};a([Te],ml.prototype,"enabled",2),a([Te],ml.prototype,"width",2),a([Te],ml.prototype,"style",2);var yl=class extends De{};a([Te],yl.prototype,"step",2),a([Te],yl.prototype,"values",2),a([Te],yl.prototype,"minSpacing",2),a([Te],yl.prototype,"maxSpacing",2);var vl=class extends De{constructor(){super(...arguments),this.enabled=!0,this.spacing=5,this.color="#575757",this.avoidCollisions=!0,this.mirrored=!1,this.parallel=!1}getSideFlag(){return this.mirrored?1:-1}getFont(){return Ri.toFontString(this)}};a([Te],vl.prototype,"enabled",2),a([Te],vl.prototype,"fontStyle",2),a([Te],vl.prototype,"fontWeight",2),a([Te],vl.prototype,"fontSize",2),a([Te],vl.prototype,"fontFamily",2),a([Te],vl.prototype,"spacing",2),a([Te],vl.prototype,"minSpacing",2),a([Te],vl.prototype,"color",2),a([Te],vl.prototype,"rotation",2),a([Te],vl.prototype,"avoidCollisions",2),a([Te],vl.prototype,"mirrored",2),a([Te],vl.prototype,"parallel",2),a([Te],vl.prototype,"itemStyler",2),a([Te],vl.prototype,"formatter",2),a([Te],vl.prototype,"format",2);var bl=class{constructor(){this.enabled=!0,this.width=1,this.stroke=void 0}};a([Te],bl.prototype,"enabled",2),a([Te],bl.prototype,"width",2),a([Te],bl.prototype,"stroke",2);var Cl=class extends De{constructor(){super(...arguments),this.enabled=!0,this.width=1,this.size=6}};a([Te],Cl.prototype,"enabled",2),a([Te],Cl.prototype,"width",2),a([Te],Cl.prototype,"size",2),a([Te],Cl.prototype,"stroke",2);var wl=class extends De{constructor(){super(...arguments),this.caption=new Fi,this.enabled=!1,this.spacing=Fi.SMALL_PADDING,this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always"}};a([Te],wl.prototype,"enabled",2),a([Te],wl.prototype,"text",2),a([Te],wl.prototype,"spacing",2),a([Te],wl.prototype,"fontStyle",2),a([Te],wl.prototype,"fontWeight",2),a([Te],wl.prototype,"fontSize",2),a([Te],wl.prototype,"fontFamily",2),a([Te],wl.prototype,"color",2),a([Te],wl.prototype,"wrapping",2),a([Te],wl.prototype,"formatter",2);var Sl=(e=>(e[e.TickAndDomain=0]="TickAndDomain",e[e.TicksOnly=1]="TicksOnly",e[e.Off=2]="Off",e))(Sl||{});function xl(e){const[t,i]=or(e.range),n=Math.floor(t),s=Math.ceil(i);return{min:n,max:s,visible:n!==s}}var El=2*Math.PI,Al=El/2;function Ml(e){const{min:t,max:i}=e,n=e=>e<t||e>i,s={fromFn(e,t,i){let{x1:s,x2:r,y1:o,y2:a}=e,l=e.opacity;return("added"===i||n(t.offset))&&(({x1:s,x2:r,y1:o,y2:a}=t),l=0),{x1:s,x2:r,y1:o,y2:a,opacity:l,phase:oa[i]}},toFn(e,t,i){const{x1:n,x2:s,y1:r,y2:o}=t;let a=1;return"removed"===i&&(a=0),{x1:n,x2:s,y1:r,y2:o,opacity:a}},applyFn(e,t){e.setProperties(t),e.visible=!n(e.y)}},r={fromFn(e,t,i){const s=e.previousDatum??t;let{x:r,y:o,rotationCenterX:a,rotationCenterY:l,rotation:c}=s,h=e.opacity;return"removed"===i||n(s.y)?c=t.rotation:("added"===i||n(e.datum.y))&&(({x:r,y:o,rotationCenterX:a,rotationCenterY:l,rotation:c}=t),h=0),{x:r,y:o,rotationCenterX:a,rotationCenterY:l,rotation:c,opacity:h,phase:oa[i]}},toFn(e,t,i){const{x:n,y:s,rotationCenterX:r,rotationCenterY:o}=t;let a=0,l=1;var c,h;return"added"===i?a=t.rotation:"removed"===i?(l=0,a=t.rotation):(c=e.previousDatum?.rotation??t.rotation,h=t.rotation,a=Math.abs(h-c)<Al?h:c>h?h+El:h-El),{x:n,y:s,rotationCenterX:r,rotationCenterY:o,rotation:a,opacity:l,finish:{rotation:t.rotation}}}};return{tick:s,line:{fromFn(e,t){const{x1:i,x2:n,y1:s,y2:r}=e.previousDatum??t;return{x1:i,x2:n,y1:s,y2:r,phase:oa.updated}},toFn(e,t){const{x1:i,x2:n,y1:s,y2:r}=t;return{x1:i,x2:n,y1:s,y2:r}}},label:r,group:{fromFn(e,t){const{translationX:i,translationY:n}=e;return{translationX:i,translationY:n,phase:oa.updated}},toFn(e,t){const{translationX:i,translationY:n}=t;return{translationX:i,translationY:n}}}}}function Tl(){return(e,t)=>({translationX:t.translationX,translationY:t.translationY})}function Dl(){return(e,t)=>({x:t.x,y:t.y,rotationCenterX:t.rotationCenterX,rotationCenterY:t.rotationCenterY,rotation:t.rotation})}function Il(){return(e,t)=>{const{x1:i,x2:n,y1:s,y2:r}=t;return{x1:i,x2:n,y1:s,y2:r}}}var Rl={millisecond:"%Y %b %e %H:%M:%S.%L",second:"%Y %b %e %H:%M:%S",minute:"%Y %b %e %H:%M",hour:"%Y %b %e %H:%M",day:"%Y %b %e",month:"%Y %b",year:"%Y"},kl={year:0,month:1,day:2,hour:3,minute:4,second:5,millisecond:6},Pl=/%[-_0]?L/,_l=/%[-_0]?S/,Ll=/%[-_0]?M/,Nl=/%[-_0]?[HI]/,Ol=/^%[-_0]?[de]$/,Fl=/^%[-_0]?[Bbm]$/,Gl=/^%[-_0]?[Yy]$/,Bl=class extends(Ct(pa)){},Vl=(e=>(e[e.TickLines=0]="TickLines",e[e.AxisLine=1]="AxisLine",e[e.TickLabels=2]="TickLabels",e))(Vl||{}),Hl=class e{constructor(t,i){this.moduleCtx=t,this.scale=i,this.id=(0,n.sX)(this),this.nice=!0,this.reverse=!1,this.keys=[],this.interval=new yl,this.dataDomain={domain:[],clipped:!1},this.layoutConstraints={stacked:!0,align:"start",width:100,unit:"percent"},this.boundSeries=[],this.includeInvisibleDomains=!1,this.interactionEnabled=!0,this.axisGroup=new Mt({name:`${this.id}-axis`}),this.tickLineGroup=this.axisGroup.appendChild(new Rt({name:`${this.id}-Axis-tick-lines`,zIndex:0})),this.tickLabelGroup=this.axisGroup.appendChild(new Rt({name:`${this.id}-Axis-tick-labels`,zIndex:2})),this.labelGroup=new Mt({name:`${this.id}-Labels`,zIndex:9}),this.gridGroup=new It({name:`${this.id}-Axis-grid`,zIndex:1}),this.gridLineGroup=this.gridGroup.appendChild(new Mt({name:`${this.id}-gridLines`})),this.crossLineRangeGroup=new Rt({name:`${this.id}-CrossLines-Range`,zIndex:4}),this.crossLineLineGroup=new Rt({name:`${this.id}-CrossLines-Line`,zIndex:8}),this.crossLineLabelGroup=new Rt({name:`${this.id}-CrossLines-Label`,zIndex:13}),this.tickLabelGroupSelection=da.select(this.tickLabelGroup,Ni,!1),this._crossLines=[],this.line=new bl,this.tick=new Cl,this.gridLine=new ml,this.label=this.createLabel(),this.defaultTickMinSpacing=e.defaultTickMinSpacing,this.translation={x:0,y:0},this.layout={label:{fractionDigits:0,spacing:this.label.spacing,format:this.label.format}},this.axisContext=void 0,this.labelFormatter=void 0,this.datumFormatter=void 0,this.scaleFormatterParams=void 0,this.destroyFns=[],this.range=[0,1],this.visibleRange=[0,1],this.title=new wl,this.gridLength=0,this.gridPadding=0,this.seriesAreaPadding=0,this.animatable=!0,this._cachedUnzoomedInputDomain=void 0,this._cachedUnzoomedRangeExtent=NaN,this._cachedUnzoomedTickCount=0,this.moduleMap=new Sa,this.range=this.scale.range.slice(),this.crossLines.forEach(e=>this.initCrossLine(e))}get type(){return this.constructor.type??""}get labelNodes(){return this.tickLabelGroupSelection.nodes()}set crossLines(e){const{CrossLineConstructor:t}=this.constructor;this._crossLines.forEach(e=>this.detachCrossLine(e)),this._crossLines=e.map(e=>{const i=new t;return i.set(e),i}),this._crossLines.forEach(e=>{this.attachCrossLine(e),this.initCrossLine(e)})}get crossLines(){return this._crossLines}resetAnimation(e){}attachCrossLine(e){this.crossLineRangeGroup.appendChild(e.rangeGroup),this.crossLineLineGroup.appendChild(e.lineGroup),this.crossLineLabelGroup.appendChild(e.labelGroup)}detachCrossLine(e){this.crossLineRangeGroup.removeChild(e.rangeGroup),this.crossLineLineGroup.removeChild(e.lineGroup),this.crossLineLabelGroup.removeChild(e.labelGroup)}destroy(){this.moduleMap.destroy(),this.destroyFns.forEach(e=>e())}updateScale(){const{range:e,visibleRange:t,scale:i}=this,n=(e[1]-e[0])/(t[1]-t[0]),s=n*t[0],r=e[0]-s;i.range=[r,r+n],this.crossLines.forEach(t=>{t.clippedRange=[e[0],e[1]]})}setCrossLinesVisible(e){this.crossLineRangeGroup.visible=e,this.crossLineLineGroup.visible=e,this.crossLineLabelGroup.visible=e}attachAxis(e){e.gridNode.appendChild(this.gridGroup),e.axisNode.appendChild(this.axisGroup),e.labelNode.appendChild(this.labelGroup),e.crossLineRangeNode.appendChild(this.crossLineRangeGroup),e.crossLineLineNode.appendChild(this.crossLineLineGroup),e.crossLineLabelNode.appendChild(this.crossLineLabelGroup)}detachAxis(e){e.gridNode.removeChild(this.gridGroup),e.axisNode.removeChild(this.axisGroup),e.labelNode.removeChild(this.labelGroup),e.crossLineRangeNode.removeChild(this.crossLineRangeGroup),e.crossLineLineNode.removeChild(this.crossLineLineGroup),e.crossLineLabelNode.removeChild(this.crossLineLabelGroup)}attachLabel(e){this.labelGroup.append(e)}inRange(e,t=0){const[i,n]=or(this.range);return e>=i-t&&e<=n+t}getRangeOverflow(e){const{range:t,visibleRange:i}=this,n=(t[1]-t[0])/(i[1]-i[0]),[s,r]=or([t[0]-n*i[0],t[0]-n*i[0]+n]);return e<s?e-s:e>r?e-r:0}defaultDatumFormatter(e,t){return Gn(e,t+1)}defaultLabelFormatter(e,t){return Gn(e,t)}onGridLengthChange(e,t){t^e&&this.onGridVisibilityChange(),this.crossLines.forEach(e=>this.initCrossLine(e))}onGridVisibilityChange(){}createLabel(){return new vl}update(){this.updatePosition(),this.updateSelections(),this.tickLineGroup.visible=this.tick.enabled,this.gridLineGroup.visible=this.gridLine.enabled,this.tickLabelGroup.visible=this.label.enabled,this.updateLabels(),this.updateCrossLines()}getLabelStyles(e,t,i=this.label){const n={color:i.color,spacing:i.spacing,fontFamily:i.fontFamily,fontSize:i.fontSize,fontStyle:i.fontStyle,fontWeight:i.fontWeight};let s;i.itemStyler&&(s=this.callWithContext(i.itemStyler,{...e,...n}));const{color:r,fontFamily:o,fontSize:a,fontStyle:l,fontWeight:c,spacing:h}=L(s,t,n);return{fill:r,fontFamily:o,fontSize:a,fontStyle:l,fontWeight:c,spacing:h}}getTickSize(e=this.tick){return e.enabled?e.size:0}processData(){const{includeInvisibleDomains:e,boundSeries:t,direction:i}=this,n=(e?t:t.filter(e=>e.isEnabled())).map(e=>e.getDomain(i));this.setDomains(...n)}setDomains(...e){let t,i;e.length>0?({domain:t,animatable:i}=this.scale.normalizeDomains(...e)):(t=[],i=!0),this.dataDomain=this.normaliseDataDomain(t),this.reverse&&this.dataDomain.domain.reverse(),this.animatable=i}calculateLayout(e,t){const{scale:i,label:s,visibleRange:r,nice:o}=this;this.chartPadding=t,this.updateScale();const a=ar(this.range),l=this.dataDomain.domain;let c,h,u;if(0===r[0]&&1===r[1])c=void 0,h=void 0;else if(this._cachedUnzoomedInputDomain===l&&this._cachedUnzoomedRangeExtent===a)c=this.scale.domain,h=this._cachedUnzoomedTickCount;else{const e=this.calculateTickLayout(l,o?0:2,[0,1]);c=e.niceDomain,h=e.rawTickCount??0}u=o?null==c?0:1:2;const{niceDomain:d,ticks:p,rawTickCount:g=0,tickDomain:f,fractionDigits:m,bbox:y}=this.calculateTickLayout(c??l,u,r,e);h??(h=g);const v=0!==g&&0!==h?{zoomed:g,unzoomed:h}:void 0,b=Ra.is(i)?i.interval:void 0;this.scale.domain=d,this._cachedUnzoomedInputDomain=l,this._cachedUnzoomedRangeExtent=a,this._cachedUnzoomedTickCount=h;const C=fl(null==b?s.format:function(e,t){if(!(0,n.Qd)(e))return e;const i=Ea(t),{millisecond:s,second:r,minute:o,hour:a,day:l,month:c,year:h}=e,u=kl[i],d=Rl[i];if(u>=kl.year&&!Gl.test(h)||u>=kl.month&&!Fl.test(c)||u>=kl.day&&!Ol.test(l))return d;let p;switch(i){case"year":return h;case"month":return`${c} ${h}`;case"day":return`${c} ${l} ${h}`;case"hour":p=a;break;case"minute":p=o;break;case"second":p=r;break;case"millisecond":p=s;break;default:return d}return u>=kl.hour&&!Nl.test(p)||u>=kl.minute&&!Ll.test(p)||u>=kl.second&&!_l.test(p)||u>=kl.millisecond&&!Pl.test(p)?d:`${p} ${c} ${l} ${h}`}(s.format,b),b);return this.labelFormatter=i.tickFormatter({domain:f,specifier:C,ticks:p,fractionDigits:m})??(e=>this.defaultLabelFormatter(e,m)),this.datumFormatter=i.datumFormatter({domain:f,specifier:C,ticks:p,fractionDigits:m})??(e=>this.defaultDatumFormatter(e,m)),this.scaleFormatterParams={domain:f,ticks:p,fractionDigits:m},this.layout.label={fractionDigits:m,spacing:this.label.spacing,format:this.label.format},this.layoutCrossLines(),{primaryTickCount:v,bbox:y}}updateCrossLines(){const e=this.isAnySeriesActive();this.crossLines.forEach(t=>{t.update(e)})}updatePosition(){const{crossLineRangeGroup:e,crossLineLineGroup:t,crossLineLabelGroup:i,gridGroup:n,translation:s}=this,r=Math.floor(s.x),o=Math.floor(s.y);n.setProperties({translationX:r,translationY:o}),e.setProperties({translationX:r,translationY:o}),t.setProperties({translationX:r,translationY:o}),i.setProperties({translationX:r,translationY:o})}formatTick(e,t,i,n,s,r){const{labelFormatter:o,label:{formatter:a}}=this;let l;if(a){const r=this.getFormatterBoundSeries(),o=s?Ea(s):void 0,c=s?xa(s).step:void 0;l=this.callWithContext(a,{value:e,index:t,domain:i,fractionDigits:n,unit:o,step:c,boundSeries:r})}else r?l=r(e):o&&(l=o(e));return String(l??e)}formatDatum(e){const{label:{formatter:t},datumFormatter:i=this.labelFormatter}=this;let s;if(t){const{domain:i}=this.scale,n=this.getFormatterBoundSeries();s=this.callWithContext(t,{value:e,index:NaN,domain:i,boundSeries:n})}else i?s=this.callWithContext(i,e):(0,n.cy)(e)&&(s=e.filter(Boolean).join(" - "));return String(s??e)}getScaleValueFormatter(e){const{scaleFormatterParams:t}=this;let i;try{null!=e&&null!=t&&(i=this.scale.tickFormatter({...t,specifier:e}))}catch{n.Vy.warnOnce(`the format string ${e} is invalid, ignoring.`)}return i??(i=e=>this.formatDatum(e)),i}getBBox(){return this.axisGroup.getBBox()}initCrossLine(e){e.scale=this.scale,e.gridLength=this.gridLength}isAnySeriesActive(){return this.boundSeries.some(e=>this.includeInvisibleDomains||e.isEnabled())}clipTickLines(e,t,i,n){this.tickLineGroup.setClipRect(new m(e,t,i,n))}clipGrid(e,t,i,n){this.gridGroup.setClipRect(new m(e,t,i,n))}getFormatterBoundSeries(){const{direction:e}=this,t=[];for(const i of this.boundSeries){const n=i.getKeys(e),s=i.getNames(e);for(let e=0;e<n.length;e++)t.push({key:n[e],name:s[e]})}return t}getTitleFormatterParams(e){const{direction:t}=this;return{domain:e,direction:t,boundSeries:this.getFormatterBoundSeries(),defaultValue:this.title?.text}}normaliseDataDomain(e){return{domain:[...e],clipped:!1}}getLayoutState(){return{id:this.id,rect:this.getBBox(),gridPadding:this.gridPadding,seriesAreaPadding:this.seriesAreaPadding,tickSize:this.getTickSize(),direction:this.direction,domain:this.dataDomain.domain,scale:this.scale,...this.layout}}getModuleMap(){return this.moduleMap}createModuleContext(){return this.axisContext??(this.axisContext=this.createAxisContext()),{...this.moduleCtx,parent:this.axisContext}}createAxisContext(){const{scale:e}=this;return{axisId:this.id,scale:this.scale,direction:this.direction,continuous:cr.is(e)||io.is(e),getCanvasBounds:()=>St.toCanvas(this.axisGroup),seriesKeyProperties:()=>this.boundSeries.reduce((e,t)=>(t.getKeyProperties(this.direction).forEach(t=>e.add(t)),e),new Set),seriesIds:()=>this.boundSeries.map(e=>e.id),scaleValueFormatter:e=>this.getScaleValueFormatter(e),scaleInvert:t=>e.invert(t,!0),scaleInvertNearest:t=>e.invert(t,!0),attachLabel:e=>this.attachLabel(e),inRange:(e,t)=>this.inRange(e,t),getRangeOverflow:e=>this.getRangeOverflow(e)}}isReversed(){return this.reverse}callWithContext(e,...t){const{callbackCache:i,chartService:n}=this.moduleCtx;return i.call(this,n,e,...t)}};Hl.defaultTickMinSpacing=50,Hl.CrossLineConstructor=dl,a([Te],Hl.prototype,"nice",2),a([Te],Hl.prototype,"reverse",2),a([Te],Hl.prototype,"keys",2),a([Te],Hl.prototype,"interval",2),a([Te],Hl.prototype,"title",2),a([ci((e,t,i)=>e.onGridLengthChange(t,i))],Hl.prototype,"gridLength",2);var Ul=Hl;function zl(){const e=new Map;return t=>{const i=e.get(t);return i?(e.set(t,i+1),`${t}_${i}`):(e.set(t,1),t)}}var Wl=class{constructor(e){this.axis=e}estimateTickCount(e,t,i){const{scale:n,range:s,defaultTickMinSpacing:r}=this.axis,o=Ra.is(n)?Ra.defaultTickCount:cr.defaultTickCount;return qa(ar(s),ar(e),t,i,o,r)}filterTicks(e,t){const{minSpacing:i,maxSpacing:n}=this.axis.interval,s=null!=i||null!=n?Math.ceil(e.length/t):2,r=e.length%s?-1:0;return e.filter((e,t)=>(t+r)%s===0)}generateTicks({domain:e,primaryTickCount:t,visibleRange:i,niceMode:n,parallelFlipRotation:s,regularFlipRotation:r,labelX:o,sideFlag:a,removeOverflowLabels:l,removeOverflowThreshold:c=0}){const{scale:h,label:u,primaryLabel:d,interval:{minSpacing:p,maxSpacing:g}}=this.axis,{parallel:f,fontFamily:y,fontSize:v,fontStyle:b,fontWeight:C}=u,w=void 0!==t,{defaultRotation:S,configuredRotation:x,parallelFlipFlag:E,regularFlipFlag:A}=function(e,t,i=0,n=0){const s=ue(e),r=!s&&n>=0&&n<=Math.PI?-1:1,o=!s&&i>=0&&i<=Math.PI?-1:1;let a=0;return t?a=r*Math.PI/2:-1===o&&(a=Math.PI),{configuredRotation:s,defaultRotation:a,parallelFlipFlag:r,regularFlipFlag:o}}(u.rotation,f,r,s),{maxTickCount:M}=this.estimateTickCount(i,p,g),T=!cr.is(h)&&!io.is(h)||isNaN(M)?10:M;let D=gl(f,x,0,a,A);const I=function(e,t,i,n,s){return e&&!t?i*n===-1?s?"hanging":"top":"bottom":"middle"}(f,x,a,E,null==d),R=Ri.toFontString({fontFamily:y,fontSize:v,fontStyle:b,fontWeight:C}),k=Di.getMeasurer({font:R}),P={fontFamily:y,fontSize:v,fontStyle:b,fontWeight:C,textBaseline:I,textAlign:D},_=u.enabled&&u.avoidCollisions,L=x+S,N=new pt,O=e=>{const t=L+e;pt.updateTransformMatrix(N,1,1,t,0,0)},F=({ticks:e},t)=>(O(t),function(e,t,i,n){const s=[];for(const{tickLabel:r,translationY:o}of e){if(!r)continue;const{x:e,y:a}=i.transformBBox(new m(t,o,0,0)),{width:l,height:c}=n.measureLines(r);s.push({point:{x:e,y:a},label:{text:r,width:l,height:c}})}return s}(e,o,N,k)),G=(t,i)=>{if(!_)return!1;const n=0!==x||0!==i,s=function(e,t){return null!=e?e:t?0:10}(u.minSpacing,n);return Co(((t,i)=>{const{niceDomain:n,ticks:s,rawTicks:r,timeInterval:a}=t;if(null==a)return[];O(i);const l=function(e){if(e.length<2)return 1/0;let t=0,i=e[0].translationY;for(let n=1;n<e.length;n++){const s=e[n].translationY,r=Math.abs(s-i);t=Math.max(t,r),i=s}return t}(s),{width:c,height:p}=function(e,t,i,n,s,r,o){const a={domain:n,ticks:s,fractionDigits:0,specifier:fl(t.format,r)??("string"==typeof t.format?t.format:void 0)},l=e.tickFormatter(a),c=r?Aa(r):void 0,h=fl(i?.format,c),u=h?e.tickFormatter({...a,specifier:h}):l,d=new Date(n[0]),p=new Date(n[n.length-1]),g=c?.range(new Date(n[0]),new Date(n[n.length-1]),{extend:!0});let f=0,m=0;if(null!=l){let e,t;null!=g&&g.length>1?(e=g[0],t=g[1]):(e=d,t=p);const i=Ta(r,e,t,{limit:50});for(const e of i){const t=l(e),{width:i,height:n}=o.measureLines(t);f=Math.max(f,i),m=Math.max(m,n)}}if(null!=u&&null!=g)for(const e of g){const t=u(e),{width:i,height:n}=o.measureLines(t);f=Math.max(f,i),m=Math.max(m,n)}return{width:Math.ceil(f),height:Math.ceil(m)}}(h,u,d,n??e,r,a,k);return function({width:e,height:t,spacing:i},n,s){const r=[];for(const o of[0,i]){const{x:i,y:a}=s.transformBBox(new m(n,o,0,0));r.push({point:{x:i,y:a},label:{text:void 0,width:e,height:t}})}return r}({width:c,height:p,spacing:l},o,N)})(t,i),s)||Co(F(t,i),s)};let B={tickDomain:[],ticks:[],rawTicks:[],rawTickCount:void 0,timeInterval:void 0,fractionDigits:0,niceDomain:void 0},V=0,H=0,U=!0,z=!1;for(;!z&&U&&V<=T;){H=0;for(const s of this.getTickStrategies({domain:e,niceMode:n,secondaryAxis:w,index:V}))({tickData:B,index:V,autoRotation:H,terminate:z}=s({index:V,tickData:B,textProps:P,terminate:z,primaryTickCount:t,visibleRange:i,labelsOverlap:()=>G(B,H)}));U=G(B,H)}D=gl(f,x,H,a,A);const W=x+H;if(l&&B.ticks.length>2){const e=F(B,H),t=B.ticks.at(-1),n=e.at(-1);if(null!=t&&null!=n&&t.translationY+n.label.width/2>this.axis.range[1]+c){t.tickLabel=void 0;const e=B.ticks[0];0===e.translationY&&0===i[0]&&1===i[1]&&(e.tickLabel=void 0)}}return{tickData:B,rotation:W,textBaseline:I,textAlign:D}}getTickStrategies({domain:e,niceMode:t,index:i,secondaryAxis:n}){const{scale:s,label:r,interval:o}=this.axis,{minSpacing:a}=o,l=cr.is(s)||io.is(s),c=r.enabled&&r.avoidCollisions,h=!l&&0!==i&&c,u=!0===r.autoRotate&&void 0===r.rotation,d=[];let p;if(p=o.values?3:n?1:h?2:0,d.push(({index:i,tickData:n,primaryTickCount:s,visibleRange:r,terminate:o})=>this.createTickData(e,t,r,s,p,i,n,o)),!l&&null!=a){const i=({index:i,tickData:n,primaryTickCount:s,visibleRange:r,terminate:o})=>this.createTickData(e,t,r,s,2,i,n,o);d.push(i)}if(c&&u){const e=({index:e,tickData:t,labelsOverlap:i,terminate:n})=>({index:e,tickData:t,autoRotation:i()?ue(r.autoRotateAngle):0,terminate:n});d.push(e)}return d}ticksEqual(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i+=1)if(e[i]?.valueOf()!==t[i]?.valueOf())return!1;return!0}createTickData(e,t,i,n,s,r,o,a){const{scale:l,interval:c}=this.axis,{step:h,values:u,minSpacing:d,maxSpacing:p}=c,{maxTickCount:g,minTickCount:f,tickCount:m}=this.estimateTickCount(i,d,p),y=cr.is(l)||io.is(l),v=!y||isNaN(g)?10:g,b=e=>y?Math.max(m-e,f):g,C=o.rawTicks,w=null==h&&null==u&&b(r)>f&&(y||2===s),S={domain:e,niceMode:t,visibleRange:i,primaryTickCount:n,tickGenerationType:s,previousTicks:C,minTickCount:f,maxTickCount:g,tickCount:0};if(S.tickCount=b(r),o=this.getTicks(S),w&&this.ticksEqual(o.rawTicks,C)){let e=r,t=v;for(;e<=t;)r=(e+t)/2|0,S.tickCount=b(r),o=this.getTicks(S),this.ticksEqual(o.rawTicks,C)?e=r+1:t=r-1}return a||(a=null!=h||null!=u),{tickData:o,index:r+=1,autoRotation:0,terminate:a}}getTimeIntervalTicks(e,t,i){const s=Aa(i);if(null==s)return;const{scale:r,reverse:o}=this.axis;if(!Xa.is(r)&&!io.is(r))return;o&&(e=[1-e[1],1-e[0]]);const a=Math.min(r.domain[0].valueOf(),r.domain[r.domain.length-1].valueOf()),l=Math.max(r.domain[0].valueOf(),r.domain[r.domain.length-1].valueOf());let[c,h]=br.extent(new Date(a),new Date(l),e);c=s.floor(c),c.valueOf()>=a&&(c=s.previous(c)),h=s.ceil(h),h.valueOf()<=l&&(h=s.next(h));const u=s.range(c,h),d=Ma(i),p=Ra.is(r)&&null!=r.interval&&Ma(r.interval)<d;let g,f=new Set;if(Xa.is(r)||Ra.is(r)){g=[];const e={...t,interval:i},s=!Ra.is(r)||p;for(let t=0;t<u.length-1;t+=1){const i=u[t],o=u[t+1],c=t===u.length-2,h=o.valueOf()-i.valueOf(),p=[Math.max((a-i.valueOf())/h,0),Math.min((l-i.valueOf())/h,1)],m=s?this.timeScaleTicks(e,[i,o],p,!0):r.ticks(e,[i,o],p,!0)?.ticks??[];if((0,n.nm)(m,e=>e.valueOf()<i.valueOf()),c||(0,n.xA)(m,e=>s?e.valueOf()+d>o.valueOf():e.valueOf()>=o.valueOf()),0===m.length)continue;const y=ka(m[0],i);(s?0===y:y<=d)&&f.add(g.length),g.push(...m)}}else if(el.is(r)){g=r.ticks(t,void 0,e,!0)?.ticks??[];let i=0;for(let e=0;e<g.length;e++){const t=g[e];let n=!1;for(;i<u.length&&ka(u[i],t)<=0;)n=!0,i++;n&&f.add(e)}}else g=[];return(0===f.size||1===f.size&&f.has(0))&&(f=void 0),{ticks:g,tickCount:void 0,primaryTicksIndices:f,interpolate:p}}timeScaleTicks(e,t,i,n){const{interval:s}=e;if(null==s)return t;const r=t[0].valueOf(),o=t[1].valueOf();if("number"!=typeof s)return xa(s).every(1,{snapTo:t[0]}).range(t[0],t[1],{visibleRange:i,extend:n});const a=[];for(let e=r;e<=o;e+=s){const t=new Date(e);a.push(t)}return a}getTicks({domain:e,niceMode:t,visibleRange:i,tickGenerationType:s,previousTicks:r,tickCount:o,minTickCount:a,maxTickCount:l,primaryTickCount:c}){const{axis:h}=this,{label:u,primaryLabel:d,range:p,scale:g,interval:f}=h,m=zl(),y={nice:0===t,interval:f.step,tickCount:o,minTickCount:a,maxTickCount:l},v={...y,nice:0===t||1===t};let b;1===s&&null!=c&&cr.is(g)&&(b=function(e,t,i,s,r){let[o,a]=or(t.map(Number));const l=Math.floor(i.unzoomed);if(l<=1){const[t,i]=function(e,t){let i=e,n=t,s=0;do{[i,n]=Ya(i,n);const{ticks:e}=Ba(i,n,5);if(e.length%2==1)return[i,n];i-=1,n+=1}while(s++<10);return[e,t]}(o,a),n=5*Math.pow(2,-Math.ceil(Math.log2(r[1]-r[0]))),{ticks:l}=Ba(t,i,n,void 0,void 0,r),c=[e.toDomain(t),e.toDomain(i)];return s&&c.reverse(),{domain:c,ticks:l}}if(o===a){const e=Math.floor(Math.log10(o)),t=Math.pow(10,e),i=Math.min(t,1),n=l-1;o-=i*Math.floor(n/2),a=o+i*n}let c=o,h=a;c=function(e,t,i){e=Math.floor(e);const n=Math.abs(t-e)/(i-1),s=Math.floor(Math.log10(n)),r=Math.pow(10,s);return Math.floor(e/r)*r}(c,h,l);const u=function(e,t,i){return function(e){const t=Math.floor(Math.log10(e)),i=Math.pow(10,t),n=e/i;return n>0&&n<=1?i:n>1&&n<=2?2*i:n>2&&n<=5?5*i:n>5&&n<=10?10*i:e}((t-e)/(i-1))}(c,h,l);h=c+(l-1)*u;const d=Math.floor(c/u)*u,p=Math.floor(h/u)*u;d<=o&&p>=a&&(c=d,h=p);const g=[e.toDomain(c),e.toDomain(h)];s&&g.reverse();const f=function(e,t,i){const s=(0,n.o3)(t),r=Math.pow(10,s),o=[];for(let n=0;n<i;n++){const i=e+t*n;o.push(Math.round(i*r)/r)}return o}(c,u*((i.unzoomed-1)/(i.zoomed-1)),Math.floor(i.zoomed));return{domain:g,ticks:f}}(g,e,c,h.reverse,i));const C=0===t?b?.domain??g.niceDomain(y,e):e;let w,S,x,E,A=C,M=!1;const T=g.domain;switch(g.domain=C,s){case 3:if(A=f.values,w=f.values,S=w.length,M=Ra.is(g),cr.is(g)){const[e,t]=or(C.map(Number));w=w.filter(i=>Number(i)>=e&&Number(i)<=t).sort((e,t)=>Number(e)-Number(t))}break;case 1:if(b)w=b.ticks,S=b.ticks.length;else{const e=g.ticks(v,C,i);w=e?.ticks??[],S=e?.count}break;case 2:w=this.filterTicks(r,o),S=void 0;break;default:{if(C.length>0&&null==v.interval&&(Ra.is(g)||null!=d&&(Xa.is(g)||el.is(g)))){const e=C;x=Ua(Math.min(e[0].valueOf(),e[e.length-1].valueOf()),Math.max(e[0].valueOf(),e[e.length-1].valueOf()),o,a,l,{weekStart:null==d?kr:void 0,primaryOnly:Ra.is(g)})}const e=Ra.is(g)?g.interval:void 0;null!=e&&null!=x&&Ma(e)>Ma(x)&&(x=e);const t=x?this.getTimeIntervalTicks(i,v,x):void 0;if(t)({ticks:w,tickCount:S,primaryTicksIndices:E,interpolate:M}=t);else{const e=Ra.is(g)&&null!=x?{...v,interval:v.interval??x}:v,t=g.ticks(e,C,i);w=t?.ticks??[],S=t?.count}}}const D=w.reduce((e,t)=>Math.max(e,"number"==typeof t?(0,n.o3)(t):0),0),I={domain:A,ticks:w,fractionDigits:D,specifier:fl(u.format,x)??("string"==typeof u.format?u.format:void 0)},R=g.tickFormatter(I),k=fl(d?.format,x?Aa(x):void 0),P=k?g.tickFormatter({...I,specifier:k}):R,_=(g.bandwidth??0)/2,L=[];for(let e=0;e<w.length;e++){const t=w[e],i=g.convert(t,{interpolate:M})+_,n=E?.has(e)??!1;if(p.length>0&&!h.inRange(i,.001))continue;const s=n&&!0===d?.enabled?P:R,r=u.enabled?h.formatTick(t,e,C,D,x,s):"";L.push({tick:t,tickId:m(r),tickLabel:r,translationY:Math.floor(i),primary:n})}return g.domain=T,{tickDomain:A,rawTicks:w,rawTickCount:S,fractionDigits:D,timeInterval:x,ticks:L,niceDomain:C}}},jl=class extends vl{constructor(){super(...arguments),this.autoRotateAngle=335}};a([Te],jl.prototype,"autoRotate",2),a([Te],jl.prototype,"autoRotateAngle",2);var $l=class e extends Ul{constructor(e,t){let i;super(e,t),this.headingLabelGroup=this.axisGroup.appendChild(new It({name:`${this.id}-Axis-heading`})),this.lineNodeGroup=this.axisGroup.appendChild(new It({name:`${this.id}-Axis-line`})),this.lineNode=this.lineNodeGroup.appendChild(new pa({zIndex:1})),this.tickLineGroupSelection=da.select(this.tickLineGroup,pa,!1),this.gridLineGroupSelection=da.select(this.gridLineGroup,pa,!1),this.tempText=new Ni({debugDirty:!1}),this.tempCaption=new Fi,this.tickGenerator=new Wl(this),this.generatedTicks=void 0,this.animationManager=e.animationManager,this.animationState=new Ca("empty",{empty:{update:{target:"ready",action:()=>this.resetSelectionNodes()},reset:"empty"},ready:{update:e=>this.animateReadyUpdate(e),resize:()=>this.resetSelectionNodes(),reset:"empty"}}),this.headingLabelGroup.appendChild(this.title.caption.node),this.destroyFns.push(e.layoutManager.addListener("layout:complete",e=>{const t=[e.chart.width,e.chart.height];null==i||(0,n.r1)(t,i)||this.animationState.transition("resize"),i=t}),this.title.caption.registerInteraction(this.moduleCtx,"afterend"))}static is(t){return t instanceof e}get primaryLabel(){}get primaryTick(){}get horizontal(){return"top"===this.position||"bottom"===this.position}onGridVisibilityChange(){this.gridLineGroupSelection.clear()}resetAnimation(e){"initial"===e&&this.animationState.transition("reset")}get direction(){return"top"===this.position||"bottom"===this.position?"x":"y"}createAxisContext(){return{...super.createAxisContext(),position:this.position}}createLabel(){return new jl}updateDirection(){switch(this.position){case"top":this.label.mirrored=!0,this.label.parallel=!0;break;case"right":this.label.mirrored=!0,this.label.parallel=!1;break;case"bottom":this.label.mirrored=!1,this.label.parallel=!0;break;case"left":this.label.mirrored=!1,this.label.parallel=!1}this.axisContext&&(this.axisContext.position=this.position,this.axisContext.direction=this.direction)}calculateLayout(e,t){return this.updateDirection(),super.calculateLayout(e,t)}layoutCrossLines(){const e=this.isAnySeriesActive();this.crossLines.forEach(t=>{t.calculateLayout?.(e,this.reverse)})}calculateTickLayout(e,t,i,n){const s=this.label.getSideFlag(),r=this.horizontal?-.5*Math.PI:0,o=ie(r),a=ie(r-Math.PI/2),l=s*(this.getTickSize()+this.label.spacing+this.seriesAreaPadding);if(2===t&&!1===this.label.enabled&&!1===this.tick.enabled&&!1===this.gridLine.enabled){const{bbox:t,spacing:i}=this.tickBBox(e,[],[]);return this.generatedTicks={ticks:[],tickLines:[],gridLines:[],labels:[],spacing:i},{ticks:[],rawTickCount:0,tickDomain:e,niceDomain:e,fractionDigits:0,timeInterval:void 0,bbox:t}}const c=this.horizontal&&cr.is(this.scale),h=this.tickGenerator.generateTicks({domain:e,niceMode:t,visibleRange:i,primaryTickCount:n,parallelFlipRotation:o,regularFlipRotation:a,labelX:l,sideFlag:s,removeOverflowLabels:c,removeOverflowThreshold:this.chartPadding?.right}),{tickData:u}=h,{ticks:d,tickDomain:p,rawTicks:g,rawTickCount:f,fractionDigits:m,timeInterval:y,niceDomain:v=e}=u,b=d.map(e=>this.getTickLabelProps(e,h)),{position:C,horizontal:w,gridPadding:S,gridLength:x}=this,E="bottom"===C||"right"===C?-1:1,A=S,M=E*x-S,{gridLine:T}=this,D=d.map(({tickId:e,translationY:t},i)=>{const[n,s,r,o]=w?[t,A,t,M]:[A,t,M,t],{style:a,width:l}=T,{stroke:c,lineDash:h}=a[i%a.length]??{};return{tickId:e,offset:t,x1:n,y1:s,x2:r,y2:o,stroke:c,strokeWidth:l,lineDash:h}}),{tick:I,primaryTick:R}=this,k=d.map(({primary:e,tickId:t,translationY:i})=>{const n=e&&R?.enabled?R:I,s=-E*this.getTickSize(n),[r,o,a,l]=w?[i,0,i,s]:[0,i,s,i],{stroke:c,width:h}=n;return{tickId:t,offset:i,x1:r,y1:o,x2:a,y2:l,stroke:c,strokeWidth:h,lineDash:void 0}}),{bbox:P,spacing:_}=this.tickBBox(p,d,b);return this.generatedTicks={ticks:d,gridLines:D,tickLines:k,labels:b,spacing:_},{ticks:g,rawTickCount:f,tickDomain:p,niceDomain:v,fractionDigits:m,timeInterval:y,bbox:P}}update(){this.updateDirection();const e=Array.from(this.tickLabelGroupSelection.nodes(),e=>e.datum.tickId);super.update(),this.tickLineGroup.visible=this.tick.enabled||(this.primaryTick?.enabled??!1),this.tickLabelGroup.visible=this.label.enabled||(this.primaryTick?.enabled??!1);const{generatedTicks:t}=this;if(this.updateTitle(this.scale.domain,t?.spacing??0),this.animatable||this.moduleCtx.animationManager.skipCurrentBatch(),this.generatedTicks){const{ticks:t}=this.generatedTicks;if(this.animationManager.isSkipped())this.resetSelectionNodes();else{const i=t.map(e=>e.tickId),s=(0,n.E3)(e,i);this.animationState.transition("update",s)}}const{enabled:i,stroke:s,width:r}=this.line;this.lineNode.setProperties({stroke:s,strokeWidth:i?r:0}),this.updateTickLines(),this.updateGridLines()}getAxisTransform(){return{translationX:Math.floor(this.translation.x),translationY:Math.floor(this.translation.y)}}updatePosition(){super.updatePosition();const e=this.getAxisTransform();this.tickLineGroup.datum=e,this.tickLabelGroup.datum=e,this.lineNodeGroup.datum=e,this.headingLabelGroup.datum=e}getAxisLineCoordinates(){const{horizontal:e}=this,[t,i]=or(this.range);return e?{x1:t,x2:i,y1:0,y2:0}:{x1:0,x2:0,y1:t,y2:i}}getTickLineBBox(e){const{position:t,primaryTick:i}=this,n=Math.max(this.getTickSize(),i?.enabled?this.getTickSize(i):0),{translationY:s}=e;switch(t){case"top":return new m(s,-n,s,n);case"bottom":return new m(s,0,s,n);case"left":return new m(-n,s,n,s);case"right":return new m(0,s,n,s)}}lineNodeBBox(){const{position:e,seriesAreaPadding:t}=this,{y1:i,y2:n}=this.getAxisLineCoordinates(),s=n-i;switch(e){case"top":return new m(i,-t,s,t);case"bottom":return new m(i,0,s,t);case"left":return new m(-t,i,t,s);case"right":return new m(0,i,t,s)}}titleBBox(e,t){const{tempCaption:i}=this;return i.node.setProperties(this.titleProps(i,e,t)),i.node.getBBox()}tickBBox(e,t,i){const{tick:s,primaryTick:r,label:o,primaryLabel:a,title:l,position:c,horizontal:h,seriesAreaPadding:u}=this,d=[];if(d.push(this.lineNodeBBox()),s.enabled||r?.enabled)for(const e of t)d.push(this.getTickLineBBox(e));const{tempText:p}=this;if(o.enabled)for(const e of i){if(!e.visible)continue;p.setProperties(e);const t=p.getBBox();t&&d.push(t)}if(a?.enabled&&null!=a.format&&"bottom"===c){const{fontSize:e,format:t}=a,i=((0,n.Qd)(t)?Object.values(t):[t]).reduce((e,t)=>Math.max(e,(0,n.lt)(t)),0),o=this.getTickSize(r??s)+a.spacing+u,l=2,c=i*Ri.getLineHeight(e)+l;d.push(new m(0,o,1,c))}let g=0;if(l.enabled){const t=m.merge(d);g=h?t.height:t.width,d.push(this.titleBBox(e,g))}return{bbox:m.merge(d),spacing:g}}titleProps(e,t,i){const{title:n}=this;if(!n.enabled)return e.enabled=!1,{visible:!1,text:"",textBaseline:"bottom",x:0,y:0,rotationCenterX:0,rotationCenterY:0,rotation:0};e.enabled=!0,e.color=n.color,e.fontFamily=n.fontFamily,e.fontSize=n.fontSize,e.fontStyle=n.fontStyle,e.fontWeight=n.fontWeight,e.wrapping=n.wrapping;const s=(n.spacing??0)+i,{range:r}=this,o=(r[0]+r[1])/2;let a,l,c,h;switch(this.position){case"top":a=o,l=-s,c=0,h="bottom";break;case"bottom":a=o,l=s,c=0,h="top";break;case"left":a=-s,l=o,c=-.5*Math.PI,h="bottom";break;case"right":a=s,l=o,c=.5*Math.PI,h="bottom"}const{formatter:u=e=>e.defaultValue}=n,d=this.callWithContext(u,this.getTitleFormatterParams(t));return e.text=d,{visible:!0,text:d,textBaseline:h,x:a,y:l,rotationCenterX:a,rotationCenterY:l,rotation:c}}getTickLabelProps(e,t){const{horizontal:i,primaryLabel:n,primaryTick:s,seriesAreaPadding:r,scale:o}=this,{tickId:a,tickLabel:l="",translationY:c,primary:h}=e,u=h&&n?.enabled?n:this.label,d=h&&s?.enabled?s:this.tick,{rotation:p,textBaseline:g,textAlign:f}=t,{range:m}=o,y=this.label.getSideFlag()*(this.getTickSize(d)+u.spacing+r),v=""!==l,b=i?c:y,C=i?-y:c;return{...this.getLabelStyles({value:l},void 0,u),tickId:a,rotation:p,text:l,textAlign:f,textBaseline:g,visible:v,x:b,y:C,rotationCenterX:b,rotationCenterY:C,range:m}}updateSelections(){if(!this.generatedTicks)return;const e=this.getAxisLineCoordinates(),{tickLines:t,gridLines:i,labels:n}=this.generatedTicks,s=e=>e.tickId;this.lineNode.datum=e,this.gridLineGroupSelection.update(this.gridLine.enabled?i:[],void 0,s),this.tickLineGroupSelection.update(t,void 0,s),this.tickLabelGroupSelection.update(n,void 0,s)}updateGridLines(){this.gridLineGroupSelection.each((e,t)=>{e.stroke=t.stroke,e.strokeWidth=t.strokeWidth,e.lineDash=t.lineDash})}updateTickLines(){this.tickLineGroupSelection.each((e,t)=>{e.stroke=t.stroke,e.strokeWidth=t.strokeWidth,e.lineDash=t.lineDash})}updateTitle(e,t){const{caption:i}=this.title,n=this.titleProps(i,e,t);i.node.visible=n.visible,i.node.text=n.text,i.node.textBaseline=n.textBaseline,i.node.datum=n}updateLabels(){this.label.enabled&&this.tickLabelGroupSelection.each((e,t)=>{e.fill=t.fill,e.fontFamily=t.fontFamily,e.fontSize=t.fontSize,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.text=t.text,e.textBaseline=t.textBaseline,e.textAlign=t.textAlign??"center"})}animateReadyUpdate(e){const{animationManager:t}=this.moduleCtx,i=Ml(xl(this));aa(this.id,"axis-group",t,[this.lineNodeGroup,this.tickLabelGroup,this.tickLineGroup,this.headingLabelGroup],i.group),aa(this.id,"line",t,[this.lineNode],i.line),aa(this.id,"line-paths",t,[this.gridLineGroupSelection,this.tickLineGroupSelection],i.tick,(e,t)=>t.tickId,e),aa(this.id,"tick-labels",t,[this.tickLabelGroupSelection],i.label,(e,t)=>t.tickId,e),aa(this.id,"title",t,[this.title.caption.node],i.label,(e,t)=>t.tickId,e)}resetSelectionNodes(){ua([this.lineNodeGroup,this.tickLabelGroup,this.tickLineGroup,this.headingLabelGroup],(e,t)=>({translationX:t.translationX,translationY:t.translationY})),ua([this.gridLineGroupSelection,this.tickLineGroupSelection],(e,t)=>{const{x1:i,x2:n,y1:s,y2:r}=t;return{x1:i,x2:n,y1:s,y2:r}}),ua([this.tickLabelGroupSelection],(e,t)=>({x:t.x,y:t.y,rotationCenterX:t.rotationCenterX,rotationCenterY:t.rotationCenterY,rotation:t.rotation})),ua([this.title.caption.node],(e,t)=>({x:t.x,y:t.y,rotationCenterX:t.rotationCenterX,rotationCenterY:t.rotationCenterY,rotation:t.rotation})),ua([this.lineNode],(e,t)=>{const{x1:i,x2:n,y1:s,y2:r}=t;return{x1:i,x2:n,y1:s,y2:r}})}};a([Te],$l.prototype,"thickness",2),a([Te],$l.prototype,"position",2);var Kl=$l,Yl=["top","right","bottom","left"];function ql(e){return"string"==typeof e&&Yl.includes(e)}var Xl=["direction","xKey","yKey","sizeKey","angleKey","radiusKey","normalizedTo"];function Zl(e){const{series:t}=e;return t?.[0]?.type??"line"}function Ql(e){const t=Zl(e);return Qo.isCartesian(t)||function(e){const t=Ko(e)?.find(e=>"cartesian"===e);return"cartesian"===t}(t)}function Jl(e){const t=Zl(e);return Qo.isPolar(t)||function(e){const t=Ko(e)?.find(e=>"polar"===e);return"polar"===t}(t)}function ec(e){const t=Zl(e);return Qo.isHierarchy(t)||function(e){const t=Ko(e)?.find(e=>"hierarchy"===e);return"hierarchy"===t}(t)}function tc(e){const t=Zl(e);return Qo.isTopology(t)||function(e){const t=Ko(e)?.find(e=>"topology"===e);return"topology"===t}(t)}function ic(e){const t=Zl(e);return Qo.isFlowProportion(t)||function(e){const t=Ko(e)?.find(e=>"flow-proportion"===e);return"flow-proportion"===t}(t)}function nc(e){const t=Zl(e);return Qo.isStandalone(t)||function(e){const t=Ko(e)?.find(e=>"standalone"===e);return"standalone"===t}(t)}function sc(e){const t=Zl(e);return Qo.isGauge(t)||function(e){const t=Ko(e)?.find(e=>"gauge"===e);return"gauge"===t}(t)}var rc=class extends Sa{applyOptions(e){for(const t of this.moduleMap.values())t.module.optionsKey in e&&Re(t.moduleInstance)&&t.moduleInstance.set(e[t.module.optionsKey])}*legends(){for(const{module:e,moduleInstance:t}of this.moduleMap.values())"legend"===e.type&&(yield{legendType:e.identifier,legend:t})}},oc="ag-charts-overlay",ac="ag-charts-dark-overlay",lc=class extends De{constructor(e,t){super(),this.className=e,this.defaultMessageId=t,this.enabled=!0}getText(e){return e.t(this.text??this.defaultMessageId)}getElement(e,t,i){if(this.content?.remove(),this.focusBox=i,this.renderer){const e=this.renderer();if(e instanceof HTMLElement)this.content=e;else{const t=(0,n.n)("div");t.innerHTML=e;const{firstElementChild:i}=t;i instanceof HTMLElement&&1===t.childElementCount?this.content=i:this.content=t}}else{const i=(0,n.n)("div",{display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",height:"100%",margin:"8px",fontFamily:"var(--ag-charts-font-family)",fontSize:"var(--ag-charts-font-size)",fontWeight:"var(--ag-charts-font-weight)"});i.innerText=this.getText(t),this.content=i,e?.animate({from:0,to:1,id:"overlay",phase:"add",groupId:"opacity",onUpdate(e){i.style.opacity=String(e)},onStop(){i.style.opacity="1"}})}return this.content}removeElement(e=()=>this.content?.remove(),t){if(this.content){if(t){const{content:i}=this;t.animate({from:1,to:0,phase:"remove",id:"overlay",groupId:"opacity",onUpdate(e){i.style.opacity=String(e)},onStop(){e?.()}})}else e?.();this.content=void 0,this.focusBox=void 0}}};a([Te],lc.prototype,"enabled",2),a([Te],lc.prototype,"text",2),a([Te],lc.prototype,"renderer",2);var cc=class extends De{constructor(){super(...arguments),this.darkTheme=!1,this.loading=new lc("ag-charts-loading-overlay","overlayLoadingData"),this.noData=new lc("ag-charts-no-data-overlay","overlayNoData"),this.noVisibleSeries=new lc("ag-charts-no-visible-series","overlayNoVisibleSeries"),this.unsupportedBrowser=new lc("ag-charts-unsupported-browser","overlayUnsupportedBrowser")}getFocusInfo(e){for(const t of[this.loading,this.noData,this.noVisibleSeries,this.unsupportedBrowser])if(void 0!==t.focusBox)return{text:t.getText(e),rect:t.focusBox}}destroy(){this.loading.removeElement(),this.noData.removeElement(),this.noVisibleSeries.removeElement(),this.unsupportedBrowser.removeElement()}};a([Te],cc.prototype,"darkTheme",2),a([Te],cc.prototype,"loading",2),a([Te],cc.prototype,"noData",2),a([Te],cc.prototype,"noVisibleSeries",2),a([Te],cc.prototype,"unsupportedBrowser",2);var hc=(e=>(e[e.BACKGROUND=0]="BACKGROUND",e[e.ANY_CONTENT=1]="ANY_CONTENT",e))(hc||{}),uc=(e=>(e[e.FOREGROUND=0]="FOREGROUND",e[e.HIGHLIGHT=1]="HIGHLIGHT",e[e.LABEL=2]="LABEL",e))(uc||{});function dc(e,t,i,n){if(rt(e))return{type:"gradient",gradient:e.gradient??t.gradient,colorStops:e.colorStops??t.colorStops,bounds:e.bounds??t.bounds,rotation:e.rotation??t.rotation,reverse:e.reverse??t.reverse};if(at(e)){const t=e.pattern??i.pattern;let n=e.strokeWidth;return"backward-slanted-lines"===t||"forward-slanted-lines"===t||"horizontal-lines"===t||"vertical-lines"===t?n??(n=i.strokeWidth):n??(n=0),{type:"pattern",pattern:t,width:e.width??e.height??i.width,height:e.height??e.width??i.height,path:e.path,padding:e.padding??i.padding,fill:e.fill??i.fill,fillOpacity:e.fillOpacity??i.fillOpacity,backgroundFill:e.backgroundFill??i.backgroundFill,backgroundFillOpacity:e.backgroundFillOpacity??i.backgroundFillOpacity,stroke:e.stroke??i.stroke,strokeOpacity:e.strokeOpacity??i.strokeOpacity,strokeWidth:n,rotation:e.rotation??i.rotation,scale:e.scale??i.scale}}return lt(e)?{type:"image",url:e.url,width:e.width,height:e.height,backgroundFill:e.backgroundFill??n.backgroundFill,backgroundFillOpacity:e.backgroundFillOpacity??n.backgroundFillOpacity,rotation:e.rotation??n.rotation,repeat:e.repeat??n.repeat,fit:e.fit??n.fit}:e}function pc(e,t,i,n){return rt(e?.fill)||at(e?.fill)||lt(e?.fill)?{...e,fill:dc(e.fill,t,i,n)}:e}function gc(e,t,i,n){null!=i&&rt(t)&&null!=t.bounds&&"item"!==t.bounds?e.fillBBox=i[t.bounds]:e.fillBBox=void 0,e.fillParams=n}function fc(e,t,i,n,s){const r=i?.fill??t.fill;e.fill=r,gc(e,i?.fill??t.fill,n,s),e.fillOpacity=i?.fillOpacity??t.fillOpacity??1,e.stroke=i?.stroke??t.stroke,e.strokeOpacity=i?.strokeOpacity??t.strokeOpacity??1,e.strokeWidth=i?.strokeWidth??t.strokeWidth??0,e.lineDash=i?.lineDash??t.lineDash,e.lineDashOffset=i?.lineDashOffset??t.lineDashOffset??0}var mc=(e=>(e[e.EXACT_SHAPE_MATCH=0]="EXACT_SHAPE_MATCH",e[e.NEAREST_NODE=1]="NEAREST_NODE",e[e.AXIS_ALIGNED=2]="AXIS_ALIGNED",e))(mc||{}),yc=class{constructor(e,t,i,n){this.type=e,this.event=t,this.defaultPrevented=!1,this.datum=i.datum,this.seriesId=n.id}preventDefault(){this.defaultPrevented=!0}},vc=class{constructor(e,t,i){this.series=e,this.seriesGrouping=t,this.oldGrouping=i,this.type="groupingChanged"}},bc=class extends ni{constructor(e){super(),this.destroyFns=[],this.usesPlacedLabels=!1,this.seriesGrouping=void 0,this.NodeEvent=yc,this.internalId=(0,n.sX)(this),this.contentGroup=new It({name:`${this.internalId}-content`,zIndex:1}),this.highlightGroup=new It({name:`${this.internalId}-highlight`,zIndex:1}),this.annotationGroup=new It({name:`${this.internalId}-annotation`}),this.labelGroup=new It({name:`${this.internalId}-series-labels`}),this.axes={},this.directions=["x","y"],this.nodeDataRefresh=!0,this.moduleMap=new Sa,this.datumCallbackCache=new Map,this.connectsToYAxis=!1,this._declarationOrder=-1,this.seriesListeners=new Qi,this._pickNodeCache=new Ti;const{moduleCtx:t,pickModes:i,directionKeys:s={},directionNames:r={},canHaveAxes:o=!1,usesPlacedLabels:a=!1}=e;this.ctx=t,this.directionKeys=s,this.directionNames=r,this.canHaveAxes=o,this.usesPlacedLabels=a,this.highlightGroup=new It({name:`${this.internalId}-highlight`}),this.highlightNode=this.highlightGroup.appendChild(new Mt({name:"highlightNode",zIndex:0})),this.highlightLabel=this.highlightGroup.appendChild(new Mt({name:"highlightLabel",zIndex:10})),this.pickModes=i}get pickModeAxis(){return"main"}get id(){return this.properties?.id??this.internalId}get type(){return this.constructor.type??""}get focusable(){return!0}get data(){return this._data??this._chartData}set visible(e){this.properties.visible=e,this.ctx.legendManager.toggleItem(e,this.id),this.ctx.legendManager.update(),this.visibleMaybeChanged()}get visible(){return this.ctx.legendManager.getSeriesEnabled(this.id)??this.properties.visible}get hasData(){return null!=this.data&&this.data.length>0}get tooltipEnabled(){return this.properties.tooltip?.enabled}onDataChange(){this.nodeDataRefresh=!0,this._pickNodeCache.clear()}setOptionsData(e){this._data=e,this.onDataChange()}setChartData(e){this._chartData=e,this.data===e&&this.onDataChange()}onSeriesGroupingChange(e,t){const{internalId:i,type:n,visible:s}=this;e&&this.ctx.seriesStateManager.deregisterSeries(this),t&&this.ctx.seriesStateManager.registerSeries({internalId:i,type:n,visible:s,seriesGrouping:t}),this.fireEvent(new vc(this,t,e))}getBandScalePadding(){return{inner:1,outer:0}}attachSeries(e,t,i){e.appendChild(this.contentGroup),t.appendChild(this.highlightGroup),t.appendChild(this.labelGroup),i?.appendChild(this.annotationGroup)}detachSeries(e,t,i){e?.removeChild(this.contentGroup),t.removeChild(this.highlightGroup),t.removeChild(this.labelGroup),i?.removeChild(this.annotationGroup)}setSeriesIndex(e){return e!==this._declarationOrder&&(this._declarationOrder=e,this.contentGroup.zIndex=[1,e,0],this.highlightGroup.zIndex=[1,e,1],this.labelGroup.zIndex=[1,e,2],this.annotationGroup.zIndex=e,!0)}renderToOffscreenCanvas(){return!1}addEventListener(e,t){return super.addEventListener(e,t)}removeEventListener(e,t){return super.removeEventListener(e,t)}hasEventListener(e){return super.hasEventListener(e)}addListener(e,t){return this.seriesListeners.addListener(e,t)}dispatch(e,t){this.seriesListeners.dispatch(e,t)}addChartEventListeners(){}updatedDomains(){}destroy(){this.destroyFns.forEach(e=>e()),this.destroyFns=[],this.resetDatumCallbackCache(),this.ctx.seriesStateManager.deregisterSeries(this)}getDirectionValues(e,t){const i=this.resolveKeyDirection(e),n=t?.[i],s=[];if(!n)return s;const r=(...e)=>{for(const t of e)Array.isArray(t)?r(...t):"object"==typeof t?r(...Object.values(t)):s.push(t)};return r(...n.map(e=>this.properties[e])),s}getKeys(e){return this.getDirectionValues(e,this.directionKeys)}getKeyProperties(e){return this.directionKeys[this.resolveKeyDirection(e)]??[]}getNames(e){return this.getDirectionValues(e,this.directionNames)}resolveKeyDirection(e){return e}getDomain(e){const t=this.getSeriesDomain(e),i=this.moduleMap.mapModules(t=>t.getDomain(e)).flat();return 0!==i.length?t.concat(i):t}getRange(e,t){return this.getSeriesRange(e,t)}getVisibleItems(e,t,i){return 1/0}markNodeDataDirty(){this.nodeDataRefresh=!0,this._pickNodeCache.clear(),this.visibleMaybeChanged()}visibleMaybeChanged(){this.ctx.seriesStateManager.updateSeries(this)}getOpacity(){const{dimOpacity:e=1,enabled:t=!0}=this.properties.highlightStyle.series;if(!t||1===e)return 1;switch(this.isItemIdHighlighted()){case 0:case 1:return 1;default:return e}}getStrokeWidth(e){const{strokeWidth:t,enabled:i=!0}=this.properties.highlightStyle.series;if(!i||void 0===t)return e;switch(this.isItemIdHighlighted()){case 1:return t;case 0:case 2:return e}}isItemIdHighlighted(){const e=this.ctx.highlightManager?.getActiveHighlight()?.series;return null==e?0:e!==this?2:1}getModuleTooltipParams(){return this.moduleMap.mapModules(e=>e.getTooltipParams()).reduce((e,t)=>Object.assign(e,t),{})}pickNodes(e,t,i=!1){const{pickModes:n,pickModeAxis:s,visible:r,contentGroup:o}=this;if(!r||!o.visible)return;if("highlight"===t&&!this.properties.highlight.enabled)return;if("highlight-tooltip"===t&&!this.properties.highlight.enabled)return;let a=1/0;if("tooltip"===t||"highlight-tooltip"===t){const{tooltip:e}=this.properties;a="number"==typeof e.range?e.range:1/0,i||(i="exact"===e.range)}else if("event"===t||"context-menu"===t){const{nodeClickRange:e}=this.properties;a="number"==typeof e?e:1/0,i||(i="exact"===e)}const l=n.filter(e=>!i||0===e),{x:c,y:h}=e,u=JSON.stringify({x:c,y:h,maxDistance:a,selectedPickModes:l});if(this._pickNodeCache.has(u))return this._pickNodeCache.get(u);for(const t of l){let i;switch(t){case 0:{const t=this.pickNodesExactShape(e);i=0===t.length?void 0:{datums:t,distance:0};break}case 1:{const t=this.pickNodeClosestDatum(e),n=0===t?.distance?this.pickNodesExactShape(e):void 0;i=null!=n&&0!==n.length?{datums:n,distance:0}:t?{datums:[t.datum],distance:t.distance}:void 0;break}case 2:{const t=null!=s?this.pickNodeMainAxisFirst(e,"main-category"===s):void 0;i=null!=t?{datums:[t.datum],distance:t.distance}:void 0;break}}if(i&&i.distance<=a)return this._pickNodeCache.set(u,{pickMode:t,datums:i.datums,distance:i.distance})}return this._pickNodeCache.set(u,void 0)}pickNodesExactShape(e){const t=[];for(const i of this.contentGroup.pickNodes(e.x,e.y)){const e=i.closestDatum();null!=e&&!0!==e.missing&&t.push(e)}return t}pickNodeClosestDatum(e){throw new Error("AG Charts - Series.pickNodeClosestDatum() not implemented")}pickNodeNearestDistantObject(e,t){const i=p(e.x,e.y,t),n=i.nearest?.closestDatum();if(null!=n&&!0!==n.missing)return{datum:n,distance:Math.sqrt(i.distanceSquared)}}pickNodeMainAxisFirst(e,t){throw new Error("AG Charts - Series.pickNodeMainAxisFirst() not implemented")}getLabelData(){return[]}updatePlacedLabelData(e){}fireNodeClickEvent(e,t){const i=new this.NodeEvent("seriesNodeClick",e,t,this);return this.fireEvent(i),!i.defaultPrevented}fireNodeDoubleClickEvent(e,t){const i=new this.NodeEvent("seriesNodeDoubleClick",e,t,this);return this.fireEvent(i),!i.defaultPrevented}createNodeContextMenuActionEvent(e,t){return new this.NodeEvent("nodeContextMenuAction",e,t,this)}onLegendInitialState(e,t){const{visible:i=!0,itemId:n,legendItemName:s}=t??{};this.toggleSeriesItem(i,e,n,s)}onLegendItemClick(e){const{enabled:t,itemId:i,series:n,legendType:s}=e,r="legendItemName"in this.properties?this.properties.legendItemName:void 0,o="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,a=null!=r&&r===e.legendItemName;(n.id===this.id||a||null!=o)&&this.toggleSeriesItem(t,s,i,r,e)}onLegendItemDoubleClick(e){const{enabled:t,itemId:i,series:n,numVisibleItems:s,legendType:r}=e,o="legendItemName"in this.properties?this.properties.legendItemName:void 0,a="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,l=null!=o&&o===e.legendItemName;n.id===this.id||l||null!=a?this.toggleSeriesItem(!0,r,i,o,e):t&&1===s?this.toggleSeriesItem(!0,r,void 0,o):this.toggleSeriesItem(!1,r,void 0,o)}toggleSeriesItem(e,t,i,n,s){const r=this.id;(e||"category"!==t)&&(this.visible=e),this.nodeDataRefresh=!0,this._pickNodeCache.clear();const o={type:"seriesVisibilityChange",seriesId:r,itemId:i,legendItemName:s?.legendItemName??n,visible:e};this.fireEvent(o),this.ctx.legendManager.toggleItem(e,r,i,n)}isEnabled(){return this.visible}getModuleMap(){return this.moduleMap}createModuleContext(){return{...this.ctx,series:this}}getLabelText(e,t,i=Gn){return e.formatter?this.cachedCallWithContext(e.formatter,{seriesId:this.id,...t})??this.callWithContext(i,t.value):this.callWithContext(i,t.value)}getMarkerStyle(e,t,i,n=!1,s=e.size??0,r){const{itemStyler:o,fillGradientDefaults:a,fillPatternDefaults:l,fillImageDefaults:c}=e;let h=pc(L({size:s},r,e.getStyle()),a,l,c);return o&&i&&(h=pc(L(this.cachedCallWithContext(o,{seriesId:this.id,...h,...i,highlighted:n,datum:t}),h),a,l,c)),h}updateMarkerStyle(e,t,i,n,s,r,o,a,{applyTranslation:l=!0,selected:c=!0}={}){const h=this.getMarkerStyle(e,i,s,r,n?.size,o),{shape:u,size:d}=h,p=this.visible&&d>0&&n&&!isNaN(n.x)&&!isNaN(n.y);if(fc(t,h,void 0,a),l?t.setProperties({visible:p,shape:u,size:d,x:n?.x,y:n?.y,scalingCenterX:n?.x,scalingCenterY:n?.y}):t.setProperties({visible:p,shape:u,size:d}),c||(t.fillOpacity*=.25,t.strokeOpacity*=.125),"function"==typeof e.shape&&!t.dirtyPath){t.path.clear(!0),t.updatePath(),t.checkPathDirty();const e=t.getBBox();if(void 0!==n&&e.isFinite()){const t=e.computeCenter(),[i,s]=["x","y"].map(e=>(h.strokeWidth??0)+Math.abs(t[e]-n[e]));n.focusSize=Math.max(e.width+i,e.height+s)}}}get nodeDataDependencies(){return this._nodeDataDependencies??{seriesRectWidth:NaN,seriesRectHeight:NaN}}checkResize(e){const{width:t,height:i}=e??{width:NaN,height:NaN},n=e?{seriesRectWidth:t,seriesRectHeight:i}:void 0,s=null!=Ft(this.nodeDataDependencies,n);return s&&(this._nodeDataDependencies=n,this.markNodeDataDirty()),s}pickFocus(e){}resetDatumCallbackCache(){this.datumCallbackCache.clear()}cachedDatumCallback(e,t){const{datumCallbackCache:i}=this,s=i.get(e);if(null!=s)return s;try{const n=t();return i.set(e,n),n}catch(e){n.Vy.error(String(e))}}cachedCallWithContext(e,...t){return this.ctx.callbackCache.call(this.properties,this.ctx.chartService,e,...t)}callWithContext(e,...t){return ps(this.properties,this.ctx.chartService,e,t)}formatTooltipWithContext(e,t,i){return e.formatTooltip(this.properties,this.ctx.chartService,t,i)}};a([li({changeValue:function(e,t){this.onSeriesGroupingChange(t,e)}})],bc.prototype,"seriesGrouping",2);var Cc=class extends ut{constructor(){super(...arguments),this.path=new Je,this._clipX=NaN,this._clipY=NaN,this.clip=!1,this._dirtyPath=!0,this.lastPixelRatio=NaN}set clipX(e){this._clipX=e,this.dirtyPath=!0}set clipY(e){this._clipY=e,this.dirtyPath=!0}set dirtyPath(e){this._dirtyPath!==e&&(this._dirtyPath=e,e&&this.markDirty("path"))}get dirtyPath(){return this._dirtyPath}checkPathDirty(){this._dirtyPath||(this.dirtyPath=this.path.isDirty()||(this.fillShadow?.isDirty()??!1)||(this._clipPath?.isDirty()??!1))}onChangeDetection(e){this._dirtyPath||(this._dirtyPath=!0,super.onChangeDetection(e))}computeBBox(){return this.updatePathIfDirty(),this.path.computeBBox()}isPointInPath(e,t){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(e,t)}distanceSquared(e,t){return this.distanceSquaredTransformedPoint(e,t)}svgPathData(e){return this.updatePathIfDirty(),this.path.toSVG(e)}distanceSquaredTransformedPoint(e,t){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(e,t)?0:this.path.distanceSquared(e,t)}isDirtyPath(){return!1}updatePath(){}updatePathIfDirty(){(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1)}preRender(e){return e.devicePixelRatio!==this.lastPixelRatio&&(this.dirtyPath=!0),this.lastPixelRatio=e.devicePixelRatio,this.updatePathIfDirty(),super.preRender(e,this.path.commands.length)}render(e){const{ctx:t}=e;if(!this.clip||isNaN(this._clipX)||isNaN(this._clipY))this._clipPath=void 0,this.drawPath(t);else{t.save();const e=this.strokeWidth/2;this._clipPath??(this._clipPath=new Je),this._clipPath.clear(),this._clipPath.rect(-e,-e,this._clipX+e,this._clipY+e+e),t.clip(this._clipPath?.getPath2D()),this._clipX>0&&this._clipY>0&&this.drawPath(t),t.restore()}this.fillShadow?.markClean(),super.render(e)}drawPath(e){this.fillStroke(e,this.path.getPath2D())}toSVG(){if(!this.visible)return;const e=(0,n.FJ)("path");e.setAttribute("d",this.svgPathData());const t=this.applySvgFillAttributes(e,[]);return this.applySvgStrokeAttributes(e),{elements:[e],defs:t}}};Cc.className="Path",a([K()],Cc.prototype,"clip",2),a([K()],Cc.prototype,"clipX",1),a([K()],Cc.prototype,"clipY",1);var wc=class{constructor(e){this.swapChain=e,this.hasBeenActivated=!1,this.div=(0,n.n)("div"),this.svg=(0,n.FJ)("svg"),this.outerPath=(0,n.FJ)("path"),this.innerPath=(0,n.FJ)("path"),this.svg.append(this.outerPath),this.svg.append(this.innerPath),this.outerPath.classList.add("ag-charts-focus-svg-outer-path"),this.innerPath.classList.add("ag-charts-focus-svg-inner-path"),this.element=(0,n.n)("div","ag-charts-focus-indicator"),this.element.ariaHidden="true",this.element.append(this.svg),this.swapChain.addListener("swap",e=>this.onSwap(e))}clear(){}update(e,t,i){if(null!=t)if(e instanceof Cc){const i=(i,n)=>{let{x:s,y:r}=St.toCanvasPoint(e,i,n);return s-=t.x??0,r-=t.y??0,{x:s,y:r}},n=e.svgPathData(i);this.outerPath.setAttribute("d",n),this.innerPath.setAttribute("d",n),this.show(this.svg)}else{let n;if(i){const i=Math.max(e.x-t.x,0),s=Math.max(e.y-t.y,0),r=Math.min(e.x+e.width-t.x,t.width),o=Math.min(e.y+e.height-t.y,t.height);n=new m(i,s,r-i,o-s)}else n=new m(e.x-t.x,e.y-t.y,e.width,e.height);kt(this.div,n),this.show(this.div)}}onSwap(e){e!==this.element.parentElement&&(this.element.remove(),e.appendChild(this.element),this.overrideFocusVisible(this.focusVisible))}show(e){this.hasBeenActivated=!0,this.element.innerHTML="",this.element.append(e)}overrideFocusVisible(e){this.focusVisible=e;const t=this.element.parentElement;t?.style.setProperty("opacity",{true:"1",false:"0",undefined:""}[`${e}`])}isFocusVisible(e=!1){if(!e&&!this.hasBeenActivated)return!1;const t=this.element.parentElement;return null!=t&&"1"===(0,n.zk)().getComputedStyle(t).opacity}},Sc=class{constructor(e,t,i){this.label1=e,this.label2=t,this.hasFocus=!1,this.skipDispatch=!1,this.listeners={blur:[],focus:[],swap:[]},this.onBlur=e=>((0,n.EM)(e.target,"pointer-events",void 0),!this.skipDispatch&&this.dispatch("blur",e)),this.onFocus=e=>((0,n.EM)(e.target,"pointer-events","auto"),!this.skipDispatch&&this.dispatch("focus",e)),(0,n.Bq)(this.label1,"id",(0,n.wW)()),(0,n.Bq)(this.label2,"id",(0,n.wW)()),(0,n.EM)(this.label1,"display","none"),(0,n.EM)(this.label2,"display","none"),this.activeAnnouncer=this.createAnnouncer(i),this.inactiveAnnouncer=this.createAnnouncer(i),(0,n.Bq)(this.activeAnnouncer,"tabindex",0),this.label2.insertAdjacentElement("afterend",this.activeAnnouncer),this.label2.insertAdjacentElement("afterend",this.inactiveAnnouncer),this.swap("")}createAnnouncer(e){const t=(0,n.n)("div");return t.role=e,t.className="ag-charts-swapchain",t.addEventListener("blur",this.onBlur),t.addEventListener("focus",this.onFocus),t}destroy(){for(const e of[this.activeAnnouncer,this.inactiveAnnouncer])e.removeEventListener("blur",this.onBlur),e.removeEventListener("focus",this.onFocus),e.remove()}focus(e){this.focusOptions=e,this.activeAnnouncer.focus(e),this.focusOptions=void 0}update(e){this.skipDispatch=!0,this.swap(e),this.hasFocus&&this.activeAnnouncer.focus(this.focusOptions),this.skipDispatch=!1}addListener(e,t){this.listeners[e].push(t),"swap"===e&&t(this.activeAnnouncer)}dispatch(e,t){"focus"===e?this.hasFocus=!0:"blur"===e&&(this.hasFocus=!1),this.listeners[e].forEach(e=>e(t))}swap(e){const t=this.activeAnnouncer.tabIndex;this.label2.textContent=e,[this.inactiveAnnouncer,this.activeAnnouncer]=[this.activeAnnouncer,this.inactiveAnnouncer],[this.label1,this.label2]=[this.label2,this.label1],(0,n.Wp)(this.inactiveAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!0,tabindex:void 0}),(0,n.Wp)(this.activeAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!1,tabindex:t}),this.dispatch("swap",this.activeAnnouncer)}},xc={arrowdown:{bindings:[{code:"ArrowDown"}]},arrowleft:{bindings:[{code:"ArrowLeft"}]},arrowright:{bindings:[{code:"ArrowRight"}]},arrowup:{bindings:[{code:"ArrowUp"}]},delete:{bindings:[{key:"Backspace"},{key:"Delete"}],activatesFocusIndicator:!1},redo:{bindings:[{key:"y",ctrlOrMeta:!0},{key:"z",ctrlOrMeta:!0,shift:!0}],activatesFocusIndicator:!1},undo:{bindings:[{key:"z",ctrlOrMeta:!0}],activatesFocusIndicator:!1},submit:{bindings:[{key:"Enter"},{code:"Enter"},{code:"Space"}]},zoomin:{bindings:[{key:"+"},{code:"ZoomIn"},{code:"Add"}],activatesFocusIndicator:!1},zoomout:{bindings:[{key:"-"},{code:"ZoomOut"},{code:"Substract"}],activatesFocusIndicator:!1}};function Ec(e,t){for(const i of t)if("code"in i){if(i.code===e.code)return!0}else if(!(i.key!==e.key||void 0!==i.shift&&i.shift!==e.shiftKey||void 0!==i.ctrlOrMeta&&i.ctrlOrMeta!==e.ctrlKey&&i.ctrlOrMeta!==e.metaKey))return!0;return!1}function Ac(){return(e,t)=>{const i=[`Property [${e}] is deprecated.`,t].filter(Boolean).join(" ");n.Vy.warnOnce(i)}}function Mc(e,t){const i=Ac(),n=t?.default;return T((t,s,r)=>(r!==n&&i(s.toString(),e),r))}function Tc(e,t){const i=Ac();return T((n,s,r)=>(r!==n[e]&&(i(s.toString(),`Use [${e}] instead.`),H(n,e,t?t(r):r)),x),(t,n)=>(i(n.toString(),`Use [${e}] instead.`),B(t,e)))}function Dc(e,t,i,n){let{top:s,right:r,bottom:o,left:a,width:l,height:c}=n;return null!=a?null!=l?r=i.width-a+l:null!=r&&(l=i.width-a-r):null!=r&&null!=l&&(a=i.width-r-l),null!=s?null!=c?o=i.height-s-c:null!=o&&(c=i.height-o-s):null!=o&&null!=c&&(s=i.height-o-c),null==l?null==c?(l=e,c=t):l=Math.ceil(e*c/t):null==c&&(c=Math.ceil(t*l/e)),null==a&&(a=null==r?Math.floor((i.width-l)/2):i.width-r-l),null==s&&(s=null==o?Math.floor((i.height-c)/2):i.height-c-o),{x:a,y:s,width:l,height:c}}var Ic=class extends Qi{constructor(){super(...arguments),this.x1=NaN,this.y1=NaN,this.x=NaN,this.y=NaN,this.vx=0,this.vy=0,this.t0=NaN,this.animationFrameHandle=void 0}reset(){this.x=NaN,this.y=NaN,null!=this.animationFrameHandle&&(cancelAnimationFrame(this.animationFrameHandle),this.animationFrameHandle=void 0)}update(e,t){if(Number.isNaN(this.x)||Number.isNaN(this.y))return this.x=e,this.y=t,this.vx=0,this.vy=0,this.emitUpdate(),void(null!=this.animationFrameHandle&&(cancelAnimationFrame(this.animationFrameHandle),this.animationFrameHandle=void 0));this.x1=e,this.y1=t,this.t0=Date.now(),null==this.animationFrameHandle&&(this.animationFrameHandle=requestAnimationFrame(this.onFrame.bind(this)))}onFrame(){this.animationFrameHandle=void 0;const{x1:e,y1:t,t0:i}=this,n=Date.now(),s=n-i;this.t0=n;const r=.001,o=0|Math.ceil(s/1);let{x:a,y:l,vx:c,vy:h}=this;for(let i=0;i<o;i+=1)c+=-(200*(a-e)+12*c)/.1*r,h+=-(200*(l-t)+12*h)/.1*r,a+=c*r,l+=h*r;Math.hypot(a-e,l-t)<.5?(this.x=this.x1,this.y=this.y1,this.vx=0,this.vy=0):(this.x=a,this.y=l,this.vx=c,this.vy=h,this.animationFrameHandle=requestAnimationFrame(this.onFrame.bind(this))),this.emitUpdate()}emitUpdate(){this.dispatch("update",{type:"update",x:this.x,y:this.y})}},Rc=null;function kc(e){return""===e?"":(Rc??(Rc=(0,n.n)("div")),Rc.textContent=String(e),Rc.innerHTML.replace(/\n/g,"<br>"))}function Pc(e,t){const{path:i,size:n}=e,{x:s,y:r}=e;i.clear();let o=!1;for(const[e,a]of t){const t=s+(e-.5)*n,l=r+(a-.5)*n;o?i.lineTo(t,l):i.moveTo(t,l),o=!0}i.closePath()}var _c={circle({path:e,x:t,y:i,size:n}){const s=n/2;e.arc(t,i,s,0,2*Math.PI),e.closePath()},cross(e){Pc(e,[[.25,0],[.5,.25],[.75,0],[1,.25],[.75,.5],[1,.75],[.75,1],[.5,.75],[.25,1],[0,.75],[.25,.5],[0,.25]])},diamond(e){Pc(e,[[.5,0],[1,.5],[.5,1],[0,.5]])},heart({path:e,x:t,y:i,size:n}){const s=n/4;i+=s/2,e.arc(t-s,i-s,s,oe(130),oe(330)),e.arc(t+s,i-s,s,oe(220),oe(50)),e.lineTo(t,i+s),e.closePath()},pin({path:e,x:t,y:i,size:n}){const s=.5,r=.5;e.moveTo(t+-.34375*n,i+-.15625*n),e.cubicCurveTo(t+-.34375*n,i+-.348509*n,t+-.192259*n,i+-.5*n,t+0*n,i+-.5*n),e.cubicCurveTo(t+(.692259-s)*n,i+-.5*n,t+.34375*n,i+-.348509*n,t+.34375*n,i+-.15625*n),e.cubicCurveTo(t+.34375*n,i+(.493824-r)*n,t+.284625*n,i+(.600181-r)*n,t+(.716461-s)*n,i+(.695393-r)*n),e.cubicCurveTo(t+.199009*n,i+.219769*n,t+(.681271-s)*n,i+.243104*n,t+(.663785-s)*n,i+(.766105-r)*n),e.cubicCurveTo(t+(.611893-s)*n,i+(.834367-r)*n,t+(.562228-s)*n,i+.399699*n,t+(.528896-s)*n,i+(.980648-r)*n),e.cubicCurveTo(t+(.524075-s)*n,i+(.992358-r)*n,t+(.512663-s)*n,i+.5*n,t+0*n,i+.5*n),e.cubicCurveTo(t+(.487337-s)*n,i+.5*n,t+(.475925-s)*n,i+(.992358-r)*n,t+(.471104-s)*n,i+(.980648-r)*n),e.cubicCurveTo(t+(.487337-s)*n,i+.5*n,t+(.475925-s)*n,i+(.992358-r)*n,t+(.471104-s)*n,i+(.980648-r)*n),e.cubicCurveTo(t+(.437772-s)*n,i+.399699*n,t+(.388107-s)*n,i+(.834367-r)*n,t+(.336215-s)*n,i+(.766105-r)*n),e.cubicCurveTo(t+(.318729-s)*n,i+.243104*n,t+-.199009*n,i+.219769*n,t+(.283539-s)*n,i+(.695393-r)*n),e.cubicCurveTo(t+-.284625*n,i+(.600181-r)*n,t+-.34375*n,i+(.493824-r)*n,t+-.34375*n,i+-.15625*n),e.closePath()},plus(e){Pc(e,[[1/3,0],[2/3,0],[2/3,1/3],[1,1/3],[1,2/3],[2/3,2/3],[2/3,1],[1/3,1],[1/3,2/3],[0,2/3],[0,1/3],[1/3,1/3]])},square({path:e,x:t,y:i,size:n,pixelRatio:s}){const r=n/2;e.moveTo(et(s,t-r),et(s,i-r)),e.lineTo(et(s,t+r),et(s,i-r)),e.lineTo(et(s,t+r),et(s,i+r)),e.lineTo(et(s,t-r),et(s,i+r)),e.closePath()},star({path:e,x:t,y:i,size:n}){const s=n/2,r=s/2,o=Math.PI/2;for(let n=0;n<10;n++){const a=n%2==0?s:r,l=n*Math.PI/5-o,c=t+Math.cos(l)*a,h=i+Math.sin(l)*a;e.lineTo(c,h)}e.closePath()},triangle(e){Pc(e,[[.5,0],[1,.87],[0,.87]])}},Lc=class extends Cc{constructor(){super(...arguments),this.shape="square",this.x=0,this.y=0,this.size=12}updatePath(){const{path:e,shape:t,x:i,y:n,size:s}=this,r=this.layerManager?.canvas?.pixelRatio??1,o=Nc.anchor(t),a={path:e,x:i-(o.x-.5)*s,y:n-(o.y-.5)*s,size:s,pixelRatio:r};e.clear(),"string"==typeof t?_c[t](a):"function"==typeof t&&t(a)}computeBBox(){const{x:e,y:t,size:i}=this,n=Nc.anchor(this.shape);return new m(e-i*n.x,t-i*n.y,i,i)}executeFill(e,t){if(t)return super.executeFill(e,t)}executeStroke(e,t){if(t)return super.executeStroke(e,t)}};a([Y({equals:$})],Lc.prototype,"shape",2),a([K()],Lc.prototype,"x",2),a([K()],Lc.prototype,"y",2),a([K({convertor:Math.abs})],Lc.prototype,"size",2);var Nc=class extends(vt(bt(Ct(Lc)))){static anchor(e){return"pin"===e?{x:.5,y:1}:"function"==typeof e&&"anchor"in e?e.anchor:{x:.5,y:.5}}constructor(e){super(e),null!=e?.shape&&(this.shape=e.shape)}};function Oc(e,t,i=t*(5/3)){const n=new Mt,s=Math.min(e.marker.strokeWidth??1,2),r=Math.min(e.line?.strokeWidth??0,2),o=Math.max(!1===e.marker.enabled?0:t,null==e.line?0:i),a=Math.max(!1===e.marker.enabled?0:t,r);if(null!=e.line){const{stroke:t,strokeOpacity:i,lineDash:s}=e.line,l=new pa;l.x1=0,l.y1=a/2,l.x2=o,l.y2=a/2,l.stroke=t,l.strokeOpacity=i,l.strokeWidth=r,l.lineDash=s,n.append(l)}if(!1!==e.marker.enabled){const{shape:i,fill:r,fillOpacity:l,stroke:c,strokeOpacity:h,lineDash:u,lineDashOffset:d}=e.marker,p=new Nc;p.shape=i??"square",p.size=t,p.fill=r,p.fillOpacity=l??1,p.stroke=c,p.strokeOpacity=h??1,p.strokeWidth=s,p.lineDash=u,p.lineDashOffset=d??0;const g=Nc.anchor(i),f=o/2+(g.x-.5)*t,m=a/2+(g.y-.5)*t,y=t/(t+s);p.x=f,p.y=m,p.scalingCenterX=f,p.scalingCenterY=m,p.scalingX=y,p.scalingY=y,n.append(p)}return Mt.toSVG(n,o,a)}var Fc="ag-charts-tooltip",Gc="ag-charts-tooltip--dark";function Bc(e){const t=[],i=new Map;for(const n of e)if("structured"===n.type){const{heading:e}=n,s=null!=e?i.get(e):void 0,r={type:"structured",heading:e,items:[n]};null==s?(i.set(e,r),t.push(r)):s.items.push(n)}else t.push(n);return t}function Vc(e){const t=Bc(e),i=[];return t.forEach(e=>{if("raw"===e.type)return"";null!=e.heading&&i.push(e.heading),e.items.forEach(e=>{null!=e.title&&i.push(e.title),e.data?.forEach(e=>{i.push(e.label??e.fallbackLabel,e.value)})})}),i.join("; ")}function Hc(e,t,i){let n="";null==e?n+=`<span class="${Fc}-label">${kc(t)}</span>`:(n+=`<span class="${Fc}-label">${kc(e)}</span>`,n+=" ",n+=`<span class="${Fc}-value">${kc(t)}</span>`);const s=[`${Fc}-row`];return i&&s.push(`${Fc}-row--inline`),n=`<div class="${s.join(" ")}">${n}</div>`,n}function Uc(e,t){if(null==e||1===t.length)return;const i=e?.t("tooltipPaginationStatus",{index:t.index+1,count:t.length});return`<div class="${Fc}-footer">${i}</div>`}function zc(e,t,i,n){const s=1===t.items.length?t.items[0]:void 0;let r,o,a;switch(i){case"compact":r=!0,o=s?.title;break;case"single":r=null!=s&&(null==t.heading||null==s.title)&&1===s.data?.length&&null==s.data[0].label&&null!=s.data[0].value,a=t.heading??s?.title;break;case"shared":r=!1}let l="";if(r&&null!=s?(null!=o&&(l+=Hc(void 0,o,!1)),s.data?.forEach(e=>{l+=Hc(e.label??a,e.value,!1),l+=" "})):(null!=t.heading&&(l+=`<span class="${Fc}-heading">${kc(t.heading)}</span>`,l+=" "),t.items.forEach(e=>{l+=function(e){let t="";if(e.data?.length&&e.data.every(e=>null==e.value||""===e.value))return t;const i=null==e.title&&1===e.data?.length,n=null==e.symbol?void 0:Oc(e.symbol,12);return null==n||null==e.title&&!e.data?.length||(t+=`<span class="${Fc}-symbol">${n}</span>`),null!=e.title&&(t+=`<span class="${Fc}-title">${kc(e.title)}</span>`,t+=" "),e.data?.forEach(e=>{t+=Hc(e.label??e.fallbackLabel,e.value,i),t+=" "}),t}(e)})),0===l.length)return;const c="compact"!==i&&null!=n?Uc(e,n):void 0;return c+null&&(l+=c),l=`<div class="${Fc}-content">${l.trimEnd()}</div>`,l}function Wc(e,t,i,n){const s=Bc(t);if(0!==s.length){if(1===s.length&&"structured"===s[0].type)return zc(e,s[0],i,n);{const t=s.map(t=>"structured"===t.type?zc(e,t,i):t.rawHtmlString);return null!=n&&t.push(function(e,t){const i=null==t?void 0:Uc(e,t);return null==i?"":`<div class="${Fc}-content">${i}</div>`}(e,n)??""),t.join("")}}}var jc={left:-1,"top-left":-1,"bottom-left":-1,top:0,center:0,bottom:0,right:1,"top-right":1,"bottom-right":1},$c={"top-left":-1,top:-1,"top-right":-1,left:0,center:0,right:0,"bottom-left":1,bottom:1,"bottom-right":1},Kc={left:3,"top-left":void 0,"bottom-left":void 0,top:2,center:void 0,bottom:1,right:0,"top-right":void 0,"bottom-right":void 0},Yc={top:2,bottom:2,left:1,right:1,"top-right":3,"top-left":3,"bottom-right":3,"bottom-left":3,center:0},qc=class extends De{constructor(){super(...arguments),this.xOffset=0,this.yOffset=0}get defaultAnchorTo(){const{type:e,_seriesOverrideType:t}=this,i=e??t??"pointer";return"node"===i||"pointer"===i?i:"chart"}get defaultPlacement(){const{type:e,_seriesOverrideType:t}=this,i=e??t??"pointer";return"node"===i||"pointer"===i?"top":i}};a([Te,Mc("Use `anchorTo` and/or `placement` options instead.")],qc.prototype,"type",2),a([Te],qc.prototype,"_seriesOverrideType",2),a([Te],qc.prototype,"xOffset",2),a([Te],qc.prototype,"yOffset",2),a([Te],qc.prototype,"anchorTo",2),a([Te],qc.prototype,"placement",2);var Xc=class extends De{constructor(){super(),this.enabled=!0,this.mode="single",this.delay=0,this.range=void 0,this.wrapping="hyphenate",this.position=new qc,this.pagination=!1,this.darkTheme=!1,this.bounds="extended",this.destroyFns=[],this.springAnimation=new Ic,this.enableInteraction=!1,this.wrapTypes=["always","hyphenate","on-space","never"],this.sizeMonitor=new wn,this._elementSize=void 0,this._showTimeout=void 0,this.arrowPosition=void 0,this._visible=!1,this.positionParams=void 0,this.localeManager=void 0,this.destroyFns.push(this.springAnimation.addListener("update",this.updateTooltipPosition.bind(this)))}get interactive(){return this.enableInteraction}setup(e,t){return"togglePopover"in(0,n.zk)().HTMLElement.prototype&&(this.element=t.addChild("tooltip-container",Fc),this.element.setAttribute("popover","manual"),this.element.className=Fc,this.element.style.positionAnchor=t.anchorName,this.sizeMonitor.observe(this.element,e=>{this._elementSize=e,this.updateTooltipPosition()})),this.localeManager=e,()=>{t.removeChild("tooltip-container",Fc),this.destroyFns.forEach(e=>e()),this.element&&this.sizeMonitor.unobserve(this.element)}}isVisible(){return this._visible}contains(e){return this.element?.contains(e)??!1}updateTooltipPosition(){const{element:e,_elementSize:t,positionParams:i}=this;if(null==e||null==t||null==i)return;const{canvasRect:s,relativeRect:r,meta:o}=i,{x:a,y:l}=this.springAnimation;let c=o.position?.placement??this.position.placement??o.position?.defaultPlacement??this.position.defaultPlacement;Array.isArray(c)||(c=[c]);const h=o.position?.anchorTo??this.position.anchorTo??o.position?.defaultAnchorTo??this.position.defaultAnchorTo,u=o.position?.xOffset??0,d=o.position?.yOffset??0,p=r.x,g=r.y,f=r.width-t.width-1+p,m=r.height-t.height+g;let y,v,b=0,C=!1;do{y=c[b],b+=1;const e=this.getTooltipBounds({elementSize:t,placement:y,anchorTo:h,canvasX:a,canvasY:l,yOffset:d,xOffset:u,canvasRect:s});v=Dc(t.width,t.height,r,e),C=!1,1&Yc[y]&&(C||(C=v.x<p||v.x>f)),2&Yc[y]&&(C||(C=v.y<g||v.y>m))}while(b<c.length&&C);const w=(0,n.qE)(p,v.x,f),S=(0,n.qE)(g,v.y,m);C||(C=w!==v.x||S!==v.y);const x="chart"!==h&&!C&&!u&&!d,E=o.showArrow??this.showArrow??x;this.arrowPosition=E?Kc[y]:void 0,this.updateClassModifiers(),e.style.translate=`${w}px ${S}px`}show(e,t,i,n,s,r=!1){const{element:o}=this;if(null!=o&&null!=n&&0!==n.length){const e=Wc(this.localeManager,n,this.mode,this.pagination?s:void 0);if(null==e)return void this.toggle(!1);o.innerHTML=e}else if(null==o||""===o.innerHTML)return void this.toggle(!1);const a={x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height};switch(this.positionParams={canvasRect:t,relativeRect:a,meta:i},i.position?.anchorTo??this.position.anchorTo??i.position?.defaultAnchorTo??this.position.defaultAnchorTo){case"node":this.springAnimation.update(i.nodeCanvasX??i.canvasX,i.nodeCanvasY??i.canvasY);break;case"pointer":this.springAnimation.update(i.canvasX,i.canvasY);break;case"chart":this.springAnimation.reset()}i.enableInteraction?(this.enableInteraction=!0,o.style.pointerEvents="auto",o.removeAttribute("aria-hidden"),o.tabIndex=-1):(this.enableInteraction=!1,o.style.pointerEvents="none",o.setAttribute("aria-hidden","true"),o.removeAttribute("tabindex")),o.style.setProperty("--top",`${t.top}px`),o.style.setProperty("--left",`${t.left}px`),this.updateClassModifiers(),this.toggle(!0,r)}hide(){this.toggle(!1)}toggle(e,t=!1){const{delay:i}=this;e&&i>0&&!t?this._showTimeout??(this._showTimeout=setTimeout(()=>{this._showTimeout=void 0,this.toggleCallback(!0)},i)):(clearTimeout(this._showTimeout),this._showTimeout=void 0,this.toggleCallback(e))}toggleCallback(e){this.element?.isConnected&&this._visible!==e&&(this._visible=e,this.element.togglePopover(e),e?this.updateTooltipPosition():this.springAnimation.reset())}updateClassModifiers(){if(!this.element?.isConnected)return;const{classList:e}=this.element,t=(t,i)=>e.toggle(`${Fc}--${t}`,i);t("no-interaction",!this.enableInteraction),t("arrow-top",1===this.arrowPosition),t("arrow-right",3===this.arrowPosition),t("arrow-bottom",2===this.arrowPosition),t("arrow-left",0===this.arrowPosition),t("compact","compact"===this.mode),e.toggle(Gc,this.darkTheme);for(const t of this.wrapTypes)e.toggle(`${Fc}--wrap-${t}`,t===this.wrapping)}getTooltipBounds(e){const{elementSize:t,anchorTo:i,placement:n,canvasX:s,canvasY:r,yOffset:o,xOffset:a,canvasRect:l}=e,{width:c,height:h}=t,u={width:c,height:h};if("node"===i||"pointer"===i){const e=jc[n],t=$c[n];return u.top=r+o+h*(t-1)/2+8*t,u.left=s+a+c*(e-1)/2+8*e,u}switch(n){case"top":return u.top=o,u.left=l.width/2-c/2+a,u;case"right":return u.top=l.height/2-h/2+o,u.left=l.width-c/2+a,u;case"left":return u.top=l.height/2-h/2+o,u.left=a,u;case"bottom":return u.top=l.height-h+o,u.left=l.width/2-c/2+a,u;case"top-left":return u.top=o,u.left=a,u;case"top-right":return u.top=o,u.left=l.width-c+a,u;case"bottom-right":return u.top=l.height-h+o,u.left=l.width-c+a,u;case"bottom-left":return u.top=l.height-h+o,u.left=a,u}return u}};function Zc(e,t){return e.series===t.series&&P(e.datumIndex,t.datumIndex)}a([Te],Xc.prototype,"enabled",2),a([Te],Xc.prototype,"mode",2),a([Te],Xc.prototype,"showArrow",2),a([Te],Xc.prototype,"delay",2),a([Te],Xc.prototype,"range",2),a([Te],Xc.prototype,"wrapping",2),a([Te],Xc.prototype,"position",2),a([Te],Xc.prototype,"pagination",2),a([Te],Xc.prototype,"darkTheme",2),a([Te],Xc.prototype,"bounds",2);var Qc=class{constructor(){this.candidates=[]}get current(){return this.active}reset(){this.candidates.length=0,this.active=void 0}update(e,t){this.candidates=e;let i=null!=t?e.findIndex(e=>Zc(e,t)):-1;return-1===i&&(i=0),this.active=e[i],{current:this.active,index:i,length:e.length}}next(){const{candidates:e,active:t}=this,i=null==t?-1:e.findIndex(e=>Zc(e,t));if(-1===i)return;let n=i+1;return n>=e.length&&(n=0),this.active=e[n],{current:this.active,index:n,length:this.candidates.length}}},Jc=class extends Ji{constructor(e){super(),this.chart=e,this.id=(0,n.sX)(this),this.series=[],this.highlight={pendingHoverEvent:void 0,appliedHoverEvent:void 0,stashedHoverEvent:void 0},this.tooltip={lastHover:void 0},this.hoverDevice="pointer",this.previousInputDevice="keyboard",this.focus={sortedSeries:[],series:void 0,seriesIndex:0,datumIndex:0,datum:void 0},this.hoverScheduler=hi((e,t)=>(0,n.zk)().requestAnimationFrame(e),()=>{(this.tooltip.lastHover||this.highlight.pendingHoverEvent)&&(this.chart.getUpdateType()<=5?this.hoverScheduler.schedule():(this.highlight.pendingHoverEvent&&this.handleHoverHighlight(!1),this.tooltip.lastHover&&this.handleHoverTooltip(this.tooltip.lastHover,!1)))}),this.tooltipCandidates=new Qc;const t=e.ctx.domManager.addChild("series-area","series-area-aria-label1"),i=e.ctx.domManager.addChild("series-area","series-area-aria-label2");this.swapChain=new Sc(t,i,"img"),this.swapChain.addListener("blur",e=>this.onBlur(e)),this.swapChain.addListener("focus",()=>this.onFocus()),"normal"===e.ctx.domManager.mode&&(this.focusIndicator=new wc(this.swapChain),this.focusIndicator.overrideFocusVisible("integrated"!==e.mode&&void 0));const{seriesDragInterpreter:s,seriesWidget:r,containerWidget:o}=e.ctx.widgets;r.setTabIndex(-1),this.destroyFns.push(()=>e.ctx.domManager.removeChild("series-area","series-area-aria-label1"),()=>e.ctx.domManager.removeChild("series-area","series-area-aria-label2"),r.addListener("focus",()=>this.swapChain.focus()),r.addListener("mousemove",e=>this.onHover(e)),r.addListener("wheel",e=>this.onWheel(e)),r.addListener("mouseleave",e=>this.onLeave(e)),r.addListener("keydown",e=>this.onKeyDown(e)),r.addListener("contextmenu",(e,t)=>this.onContextMenu(e,t)),s.addListener("drag-move",e=>this.onDragMove(e)),s.addListener("click",e=>this.onClick(e,r)),s.addListener("dblclick",e=>this.onClick(e,r)),o.addListener("contextmenu",(e,t)=>this.onContextMenu(e,t)),o.addListener("click",(e,t)=>this.onClick(e,t)),o.addListener("dblclick",(e,t)=>this.onClick(e,t)),e.ctx.animationManager.addListener("animation-start",()=>this.clearAll()),e.ctx.domManager.addListener("resize",()=>this.clearAll()),e.ctx.highlightManager.addListener("highlight-change",e=>this.changeHighlightDatum(e)),e.ctx.layoutManager.addListener("layout:complete",e=>this.layoutComplete(e)),e.ctx.updateService.addListener("pre-scene-render",()=>this.preSceneRender()),e.ctx.updateService.addListener("update-complete",()=>this.updateComplete()),e.ctx.zoomManager.addListener("zoom-change",()=>this.clearAll()),e.ctx.zoomManager.addListener("zoom-pan-start",()=>this.clearAll()))}get bbox(){return(this.seriesRect??m.zero).clone()}isState(e){return this.chart.ctx.interactionManager.isState(e)}isIgnoredTouch(e){return"touch"===e.device&&"click"!==e.type&&"hover"!==this.chart.ctx.chartService.touch.dragAction&&("drag"!==this.chart.ctx.chartService.touch.dragAction||!this.isState(9))}dataChanged(){var e;(e=this.highlight).stashedHoverEvent??(e.stashedHoverEvent=this.highlight.appliedHoverEvent),this.chart.ctx.tooltipManager.removeTooltip(this.id),this.focusIndicator?.clear(),this.clearHighlight()}preSceneRender(){null!=this.highlight.stashedHoverEvent&&(this.highlight.pendingHoverEvent=this.highlight.stashedHoverEvent,this.highlight.stashedHoverEvent=void 0,this.handleHoverHighlight(!0)),null!=this.tooltip.lastHover&&this.handleHoverTooltip(this.tooltip.lastHover,!0)}updateComplete(){this.isState(34)&&this.focusIndicator?.isFocusVisible()&&this.handleSeriesFocus(0,0,!0)}update(e,t){this.chart.ctx.updateService.update(e,t)}seriesChanged(e){this.focus.sortedSeries=[...e].sort((e,t)=>{let i=e.properties.focusPriority??1/0,n=t.properties.focusPriority??1/0;return i===n&&([i,n]=[e._declarationOrder,t._declarationOrder]),i<n?-1:i>n?1:0}),this.series=e}layoutComplete(e){this.seriesRect=e.series.rect,this.hoverRect=e.series.paddedRect,this.chart.ctx.widgets.seriesWidget.setBounds(e.series.paddedRect),"normal"===this.chart.ctx.domManager.mode&&this.chart.ctx.widgets.chartWidget.setBounds(e.chart)}onContextMenu(e,t){const{sourceEvent:i}=e;if(i.currentTarget!=t.getElement())return;if(i.target==this.chart.ctx.widgets.containerWidget.getElement()){if(this.isState(36)){const{currentX:t,currentY:i}=e;this.chart.ctx.contextMenuRegistry.dispatchContext("always",{widgetEvent:e,canvasX:t,canvasY:i},void 0)}return}let n,s;if(this.focusIndicator?.isFocusVisible())n=this.chart.ctx.highlightManager.getActiveHighlight(),n&&this.seriesRect&&n.midPoint&&(s=St.toCanvasPoint(n.series.contentGroup,n.midPoint.x,n.midPoint.y));else if(this.isState(36)){const t=this.pickNodes({x:e.currentX,y:e.currentY},"context-menu");t&&(this.chart.ctx.highlightManager.updateHighlight(this.id),n=t.matches[0].datum)}const r=n?.series;this.clearAll();const o=e.currentX+t.cssLeft(),a=e.currentY+t.cssTop();r&&n?this.chart.ctx.contextMenuRegistry.dispatchContext("series-node",{widgetEvent:e,canvasX:o,canvasY:a},{pickedSeries:r,pickedNode:n},s):this.chart.ctx.contextMenuRegistry.dispatchContext("series-area",{widgetEvent:e,canvasX:o,canvasY:a},void 0,s)}onLeave(e){if(!this.isState(41))return;const t=e.sourceEvent.relatedTarget;"ag-charts-text-input__textarea"!==t?.className&&(this.chart.ctx.tooltipManager.isEnteringInteractiveTooltip(e.sourceEvent)||(this.chart.ctx.domManager.updateCursor(this.id),"keyboard"!==this.hoverDevice&&this.clearAll()))}onWheel(e){this.isState(41)&&(this.focusIndicator?.overrideFocusVisible(!1),this.previousInputDevice="pointer")}onDragMove(e){this.isState(41)&&(this.focusIndicator?.overrideFocusVisible(!1),this.onHoverLikeEvent(e))}onHover(e){this.isState(41)&&this.onHoverLikeEvent(e)}onHoverLikeEvent(e){if(!this.isIgnoredTouch(e)&&("touch"!==e.device&&"drag-move"===e.type||(this.tooltip.lastHover=e),"touch"===e.device&&"hover"===this.chart.ctx.chartService.touch.dragAction&&e.sourceEvent.preventDefault(),this.hoverDevice="pointer",this.previousInputDevice="pointer",this.highlight.pendingHoverEvent=e,this.hoverScheduler.schedule(),this.isState(32))){const{currentX:t,currentY:i}=e,n=this.pickNodes({x:t,y:i},"event")?.matches,s=n?.[0];s?.series.hasEventListener("seriesNodeClick")||s?.series.hasEventListener("seriesNodeDoubleClick")||null!=n&&n.length>1&&this.chart.tooltip.pagination?this.chart.ctx.domManager.updateCursor(this.id,"pointer"):this.chart.ctx.domManager.updateCursor(this.id)}}onClick(e,t){if(t===this.chart.ctx.widgets.seriesWidget&&this.chart.ctx.animationManager.isActive()&&this.chart.ctx.animationManager.skipCurrentBatch(),"touch"===e.device&&t===this.chart.ctx.widgets.seriesWidget&&this.swapChain.focus({preventScroll:!0}),!this.isState(41))return;if(t===this.chart.ctx.widgets.seriesWidget){if(!t.getElement().contains(e.sourceEvent.target))return}else if(e.sourceEvent.target!=t.getElement())return;if(this.focusIndicator?.overrideFocusVisible(!1),this.onHoverLikeEvent(e),!this.isState(32))return;if(t==this.chart.ctx.widgets.seriesWidget&&this.checkSeriesNodeClick(e))return this.update(5),void e.sourceEvent.preventDefault();const i={type:"click"===e.type?"click":"doubleClick",event:e.sourceEvent};this.chart.fireEvent(i)}onFocus(){this.isState(34)&&(this.hoverDevice=this.focusIndicator?.isFocusVisible(!0)?"keyboard":"pointer",this.handleFocus(0,0))}onBlur(e){this.isState(34)&&(this.hoverDevice="pointer",this.chart.ctx.tooltipManager.isEnteringInteractiveTooltip(e)||this.clearAll(),this.focusIndicator?.overrideFocusVisible(void 0))}onKeyDown(e){if(!this.isState(43))return;const t=function(e){for(const[t,{activatesFocusIndicator:i=!0,bindings:s}]of(0,n.jO)(xc))if(Ec(e,s))return{name:t,activatesFocusIndicator:i}}(e.sourceEvent);switch(!1===t?.activatesFocusIndicator&&this.focusIndicator?.overrideFocusVisible("keyboard"===this.previousInputDevice),t?.name){case"redo":return this.chart.ctx.chartEventManager.seriesEvent("series-redo");case"undo":return this.chart.ctx.chartEventManager.seriesEvent("series-undo");case"zoomin":return this.chart.ctx.chartEventManager.seriesKeyNavZoom(1,e);case"zoomout":return this.chart.ctx.chartEventManager.seriesKeyNavZoom(-1,e);case"arrowup":return this.onArrow(-1,0,e);case"arrowdown":return this.onArrow(1,0,e);case"arrowleft":return this.onArrow(0,-1,e);case"arrowright":return this.onArrow(0,1,e);case"submit":return this.onSubmit(e)}}onArrow(e,t,i){this.isState(34)&&(this.hoverDevice="keyboard",this.previousInputDevice="keyboard",this.focusIndicator?.overrideFocusVisible(!0),this.focus.seriesIndex+=e,this.focus.datumIndex+=t,this.handleFocus(e,t),i.sourceEvent.preventDefault(),this.chart.ctx.chartEventManager.seriesEvent("series-focus-change"))}onSubmit(e){if(!this.isState(34))return;const{series:t,datum:i}=this.focus,n=e.sourceEvent;void 0!==t&&void 0!==i?t.fireNodeClickEvent(n,i):this.chart.fireEvent({type:"click",event:n}),n.preventDefault()}checkSeriesNodeClick(e){var t;const i=this.pickNodes({x:e.currentX,y:e.currentY},"event");if(null==i||0===i.matches.length)return;const n=this.chart.tooltip.pagination?this.tooltipCandidates.update(i.matches,this.tooltipCandidates.current)?.current:void 0,{series:s,datum:r}=n??i.matches[0],o=null==n?i.distance:0;if("click"===e.type){const i=s.fireNodeClickEvent(e.sourceEvent,r)&&this.chart.tooltip.pagination?this.tooltipCandidates.next():void 0;if(null!=i){e.sourceEvent.preventDefault();const{currentX:n,currentY:s}=e,r=n+(this.hoverRect?.x??0),o=s+(this.hoverRect?.y??0);(t=this.highlight).pendingHoverEvent??(t.pendingHoverEvent=this.highlight.appliedHoverEvent),this.handleHoverHighlight(!1),this.showTooltip(i.current,r,o,{index:i.index,length:i.length})}return!0}return"dblclick"===e.type&&(e.preventZoomDblClick=0===o,s.fireNodeDoubleClickEvent(e.sourceEvent,r),!0)}handleFocus(e,t){const i=this.chart.overlays.getFocusInfo(this.chart.ctx.localeManager);null==i?this.handleSeriesFocus(e,t):this.focusIndicator?.update(i.rect,this.seriesRect,!1)}handleSeriesFocus(e,t,i=!1){if("hierarchy"===this.chart.chartType||"gauge"===this.chart.chartType)return void this.handleSoloSeriesFocus(e,t,i);const{focus:s}=this,r=s.sortedSeries.filter(e=>e.visible&&e.focusable);if(0===r.length)return;const o=s.datumIndex-t,a=s.seriesIndex-e;s.seriesIndex=(0,n.qE)(0,s.seriesIndex,r.length-1),s.series=r[s.seriesIndex];const l=this.focus.datumIndex,c=this.focus.seriesIndex;this.updatePickedFocus(l,t,o,c,e,a,i)}handleSoloSeriesFocus(e,t,i){this.focus.series=this.focus.sortedSeries[0];const n=this.focus.datumIndex,s=this.focus.seriesIndex,r=this.focus.datumIndex-t,o=this.focus.seriesIndex-e;this.updatePickedFocus(n,t,r,s,e,o,i)}updatePickedFocus(e,t,i,n,s,r,o){const{focus:a,hoverRect:l,seriesRect:c}=this;if(void 0===a.series||void 0===l)return;const h=a?.series?.pickFocus({datumIndex:e,datumIndexDelta:t,otherIndex:n,otherIndexDelta:s,seriesRect:c});if(!h)return;const{datum:u}=h;if(void 0!==h.otherIndex&&(a.seriesIndex=h.otherIndex),a.datumIndex=h.datumIndex,a.datum=u,this.focusIndicator?.isFocusVisible()&&this.chart.ctx.animationManager.reset(),this.focusIndicator?.isFocusVisible()){const e=function({bounds:e}){return e instanceof m?e:null!=e?St.toCanvas(e):m.NaN}(h),{x:t,y:i}=e.computeCenter();if(!l.containsPoint(t,i)&&this.chart.ctx.zoomManager.panToBBox(this.id,l,e))return;const{x1:n,x2:s,y1:r,y2:o}=no.from(e),a=l.containsPoint(n,r),c=l.containsPoint(s,r),u=l.containsPoint(n,o),d=l.containsPoint(s,o);if(!(a||c||u||d)){const t=no.from(l);h.movedBounds=e.clone(),n<t.x1&&s<t.x1?(h.movedBounds.x=t.x1-2,h.movedBounds.width=4):n>t.x2&&s>t.x2&&(h.movedBounds.x=t.x2-2,h.movedBounds.width=4),r<t.y1&&o<t.y1?(h.movedBounds.y=t.y1-2,h.movedBounds.height=4):r>t.y2&&o>t.y2&&(h.movedBounds.y=t.y2-2,h.movedBounds.height=4)}}this.focusIndicator?.update(h.movedBounds??h.bounds,this.seriesRect,h.clipFocusBox);const d=function(e,t,i){const{x:n,y:s}=function(e,t,i){const n=Zs(e,i.datum,i.movedBounds);if(null!=n)return{x:n.canvasX,y:n.canvasY};const s=i.bounds;if(null!=s){if(s instanceof m){const{x:e,y:i}=s.computeCenter();return{x:t.x+e,y:t.y+i}}return St.toCanvas(s).computeCenter()}}(e,t,i)??{};if(void 0!==n&&void 0!==s)return{type:"keyboard",canvasX:n,canvasY:s}}(a.series,l,h);if(void 0!==d&&"keyboard"===this.hoverDevice){this.tooltip.lastHover=void 0,this.highlight.appliedHoverEvent=void 0,this.highlight.pendingHoverEvent=void 0,this.highlight.stashedHoverEvent=void 0;const e=this.chart.getTooltipContent(a.series,u.datumIndex,u),n=Js.makeTooltipMeta(d,a.series,u,h.movedBounds);this.chart.ctx.highlightManager.updateHighlight(this.id,u),a.series.tooltipEnabled??this.chart.tooltip.enabled?this.chart.ctx.tooltipManager.updateTooltip(this.id,n,e):this.chart.ctx.tooltipManager.removeTooltip(this.id),o||(0===t&&0===s||i!==h.datumIndex||r!==(h.otherIndex??a.seriesIndex))&&this.swapChain.update(this.getDatumAriaText(u,e))}}getDatumAriaText(e,t){const i=null==t?"":Vc(t);return this.chart.ctx.localeManager.t("ariaAnnounceHoverDatum",{datum:e.series.getDatumAriaText?.(e,i)??i})}clearHighlight(){this.highlight.pendingHoverEvent=void 0,this.highlight.appliedHoverEvent=void 0,this.chart.ctx.highlightManager.updateHighlight(this.id)}clearTooltip(){this.chart.ctx.tooltipManager.removeTooltip(this.id),this.tooltip.lastHover=void 0}clearAll(){this.clearHighlight(),this.clearTooltip(),this.focusIndicator?.clear()}handleHoverHighlight(e){this.highlight.appliedHoverEvent=this.highlight.pendingHoverEvent,this.highlight.pendingHoverEvent=void 0;const t=this.highlight.appliedHoverEvent;if(!t||!this.isState(41))return;const{currentX:i,currentY:n}=t,s=t.currentX+(this.hoverRect?.x??0),r=t.currentY+(this.hoverRect?.y??0);if(e?this.chart.ctx.animationManager.isActive():!this.hoverRect?.containsPoint(s,r))return void this.clearHighlight();const{range:o}=this.chart.highlight,a="tooltip"===o?"highlight-tooltip":"highlight",l=this.pickNodes({x:i,y:n},a);if(!l||0===l.matches.length)return void this.chart.ctx.highlightManager.updateHighlight(this.id);const{current:c}=this.tooltipCandidates,h=null==c?void 0:l.matches.find(e=>Zc(e,c)),u=h?.datum??l.matches[0].datum;this.chart.ctx.highlightManager.updateHighlight(this.id,u),this.hoverDevice="pointer"}handleHoverTooltip(e,t){const{current:i}=this.tooltipCandidates;if(this.tooltipCandidates.reset(),!this.isState(41))return;const{currentX:n,currentY:s}=e,r=n+(this.hoverRect?.x??0),o=s+(this.hoverRect?.y??0),a=e.sourceEvent.target;if(t?this.chart.ctx.animationManager.isActive():!this.hoverRect?.containsPoint(r,o))return void("pointer"==this.hoverDevice&&this.clearTooltip());if(a&&this.chart.tooltip.interactive&&this.chart.ctx.domManager.isManagedChildDOMElement(a,"canvas-overlay",Fc))return;const l=this.pickNodes({x:e.currentX,y:e.currentY},"tooltip");if(l&&0!==l.matches.length)if(this.hoverDevice="pointer",0===l.distance){const{current:e,index:t,length:n}=this.tooltipCandidates.update(l.matches,this.chart.tooltip.pagination?i:void 0);this.showTooltip(e,r,o,{index:t,length:n})}else this.showTooltip(l.matches[0],r,o);else"pointer"==this.hoverDevice&&this.clearTooltip()}showTooltip({series:e,datum:t,datumIndex:i},n,s,r){const o=this.chart.getTooltipContent(e,i,t);if((e.tooltipEnabled??this.chart.tooltip.enabled)&&null!=o){const i=Js.makeTooltipMeta({type:"pointermove",canvasX:n,canvasY:s},e,t,void 0);this.chart.ctx.tooltipManager.updateTooltip(this.id,i,o,r)}else this.chart.ctx.tooltipManager.removeTooltip(this.id)}changeHighlightDatum(e){const t=new Set,{series:i,datum:n}=e.currentHighlight??{},{series:s,datum:r}=e.previousHighlight??{};s&&t.add(s),i&&t.add(i),s?.properties.cursor&&r&&this.chart.ctx.domManager.updateCursor(s.id),i?.properties.cursor&&"default"!==i?.properties.cursor&&n&&this.chart.ctx.domManager.updateCursor(i.id,i.properties.cursor),null==i||null==s?this.update(5):this.update(5,{seriesToUpdate:t})}pickNodes(e,t,i){const n=[...this.series].reverse();let s;for(const r of n){if(!r.visible||!r.contentGroup.visible)continue;const n=r.pickNodes(e,t,i);if(null==n||0===n.datums.length)continue;const{datums:o,distance:a}=n;if(0!==n.datums.length)if(0===a){0!==s?.distance&&(s={matches:[],distance:0});for(const e of o){const{datumIndex:t}=e;s.matches.push({series:r,datum:e,datumIndex:t})}}else if(null==s||s.distance>a){const[e]=o,{datumIndex:t}=e;s={matches:[{series:r,datum:e,datumIndex:t}],distance:a}}}return s}},eh=class{constructor(e){this.seriesRoot=e,this.groups=new Map,this.series=new Map,this.expectedSeriesCount=1,this.mode="normal"}setSeriesCount(e){this.expectedSeriesCount=e}requestGroup(e){const{internalId:t,type:i,contentGroup:n,seriesGrouping:s}=e,{groupIndex:r=t}=s??{},o=this.series.get(t);if(null!=o)throw new Error(`AG Charts - series already has an allocated layer: ${JSON.stringify(o)}`);0===this.series.size&&(this.mode=this.expectedSeriesCount>=30?"aggressive-grouping":"normal");let a=this.groups.get(i);null==a&&(a=new Map,this.groups.set(i,a));const l=this.lookupIdx(r);let c=a.get(l);return null==c&&(c={type:i,id:l,seriesIds:[],group:this.seriesRoot.appendChild(new Mt({name:`${e.contentGroup.name??i}-managed-layer`,zIndex:e.contentGroup.zIndex,renderToOffscreenCanvas:!1}))},a.set(l,c)),this.series.set(t,{layerState:c,seriesConfig:e}),c.seriesIds.push(t),c.group.appendChild(n),c.group}changeGroup(e){const{internalId:t,seriesGrouping:i,type:n,contentGroup:s,oldGrouping:r}=e,{groupIndex:o=t}=i??{};this.groups.get(n)?.get(o)?.seriesIds.includes(t)||(this.series.has(t)&&this.releaseGroup({internalId:t,seriesGrouping:r,type:n,contentGroup:s}),this.requestGroup(e))}releaseGroup(e){const{internalId:t,contentGroup:i,type:n}=e;if(!this.series.has(t))throw new Error(`AG Charts - series doesn't have an allocated layer: ${t}`);const s=this.series.get(t)?.layerState;s&&(s.seriesIds=s.seriesIds.filter(e=>e!==t),s.group.removeChild(i)),0===s?.seriesIds.length?(this.seriesRoot.removeChild(s.group),this.groups.get(s.type)?.delete(s.id),this.groups.get(n)?.delete(t)):null!=s&&s.seriesIds.length>0&&(s.group.zIndex=this.getLowestSeriesZIndex(s.seriesIds)),this.series.delete(t)}updateLayerCompositing(){this.groups.forEach(e=>{e.forEach(e=>{const{group:t,seriesIds:i}=e;let n;if(0===i.length)n=!1;else if(i.length>1)n=!0;else{const e=this.series.get(i[0]);n=!0===e?.seriesConfig.renderToOffscreenCanvas()}t.renderToOffscreenCanvas=n,t.zIndex=this.getLowestSeriesZIndex(i)})})}lookupIdx(e){return"normal"===this.mode?e:"string"!=typeof e||(e=Number(e.split("-").at(-1)))?Math.floor(30*(0,n.qE)(0,e/this.expectedSeriesCount,1)):0}destroy(){this.groups.forEach(e=>{e.forEach(e=>{this.seriesRoot.removeChild(e.group)})}),this.groups.clear(),this.series.clear()}getLowestSeriesZIndex(e){return e.reduce((e,t)=>{const i=this.series.get(t),n=i?.seriesConfig.contentGroup.zIndex;return null==e||null==n?n:Et(e,n)<=0?e:n},void 0)??1}},th=class extends De{constructor(){super(...arguments),this.dragAction="drag"}};a([Te],th.prototype,"dragAction",2);var ih=class{constructor(e,t,i,n,s){this.chart=e,this.dataService=t,this.updateService=i,this.zoomManager=n,this.animationManager=s,this.dirtyZoom=!1,this.dirtyDataSource=!1,this.lastAxisZooms=new Map,this.destroyFns=[],this.destroyFns.push(this.dataService.addListener("data-source-change",()=>this.onDataSourceChange()),this.dataService.addListener("data-load",()=>this.onDataLoad()),this.dataService.addListener("data-error",()=>this.onDataError()),this.updateService.addListener("update-complete",e=>this.onUpdateComplete(e)),this.zoomManager.addListener("zoom-change",()=>this.onZoomChange()))}destroy(){this.destroyFns.forEach(e=>e())}onDataLoad(){this.animationManager.skip(),this.updateService.update(1)}onDataError(){this.updateService.update(4)}onDataSourceChange(){this.dirtyDataSource=!0}onUpdateComplete(e){(e.apiUpdate||this.dirtyZoom||this.dirtyDataSource)&&this.updateWindow(e)}onZoomChange(){this.dirtyZoom=!0}updateWindow(e){if(!this.dataService.isLazy())return;const t=this.getValidAxis();let i,n=!0;if(t){const s=this.zoomManager.getAxisZoom(t.id);i=this.getAxisWindow(t,s),n=this.shouldRefresh(e,t,s)}this.dirtyZoom=!1,this.dirtyDataSource=!1,n&&this.dataService.load({windowStart:i?.min,windowEnd:i?.max})}getValidAxis(){return this.chart.axes.find(e=>"time"===e.type)}shouldRefresh(e,t,i){if(e.apiUpdate)return!0;if(this.dirtyDataSource)return!0;if(!this.dirtyZoom)return!1;const n=this.lastAxisZooms.get(t.id);return!(n&&i.min===n.min&&i.max===n.max||(this.lastAxisZooms.set(t.id,i),0))}getAxisWindow(e,t){const{domain:i}=e.scale;if(!t||0===i.length||isNaN(Number(i[0])))return;const n=Number(i[1])-Number(i[0]);return{min:new Date(Number(i[0])+n*t.min),max:new Date(Number(i[0])+n*t.max)}}},nh=/^((?!chrome|android).)*safari/i,sh=/Version\/(\d+(\.\d+)?)/,rh=/Chrome/,oh=/Chrome\/(\d+)/,ah=/Edg/,lh=/OPR/,ch=new Set(["map-shape-background","map-line-background"]),hh=class{constructor(e,t,i,n,s,r,o){this.chartLike=e,this.overlays=t,this.dataService=i,this.layoutManager=n,this.localeManager=s,this.animationManager=r,this.domManager=o,this.destroyFns=[],this.overlayElem=this.domManager.addChild("canvas-overlay","overlay"),this.overlayElem.role="status",this.overlayElem.ariaAtomic="false",this.overlayElem.ariaLive="polite",this.overlayElem.classList.toggle(oc),this.destroyFns.push(this.layoutManager.addListener("layout:complete",e=>this.onLayoutComplete(e)))}destroy(){this.destroyFns.forEach(e=>e()),this.domManager.removeChild("canvas-overlay","overlay")}onLayoutComplete({series:{rect:e}}){const t=this.dataService.isLoading(),i=this.chartLike.series.some(e=>e.hasData),s=this.chartLike.series.some(e=>e.visible&&!ch.has(e.type));this.overlays.darkTheme?this.overlayElem.classList.add(ac):this.overlayElem.classList.remove(ac),this.overlayElem.style.left=`${e.x}px`,this.overlayElem.style.top=`${e.y}px`,this.overlayElem.style.width=`${e.width}px`,this.overlayElem.style.height=`${e.height}px`;const r=t,o=!t&&!i,a=i&&!s,l=this.overlays.unsupportedBrowser.enabled&&function(){const{userAgent:e}=(0,n.zk)("navigator");if(nh.test(e)){const t=sh.exec(e);if(null==t)return!1;const i=parseFloat(t[1]),s=Math.floor(i)>16;return s||n.Vy.warnOnce(`Unsupported Safari version: ${i}; ${e}`),!s}if(rh.test(e)&&!ah.test(e)&&!lh.test(e)){const t=oh.exec(e);if(null==t)return!1;const i=parseInt(t[1],10),s=i>126;return s||n.Vy.warnOnce(`Unsupported Chrome version: ${i}; ${e}`),!s}return!1}();r?this.showOverlay(this.overlays.loading,e):this.hideOverlay(this.overlays.loading),o?this.showOverlay(this.overlays.noData,e):this.hideOverlay(this.overlays.noData),a?this.showOverlay(this.overlays.noVisibleSeries,e):this.hideOverlay(this.overlays.noVisibleSeries),l?this.showOverlay(this.overlays.unsupportedBrowser,e):this.hideOverlay(this.overlays.unsupportedBrowser);const c=r||o||a||l;(0,n.Bq)(this.overlayElem,"aria-hidden",!c)}showOverlay(e,t){if(!e.enabled)return;const i=e.getElement(this.animationManager,this.localeManager,t);this.overlayElem.appendChild(i)}hideOverlay(e){e.removeElement(()=>{this.overlayElem.innerText=" "},this.animationManager)}},uh=v.create(!0,"opts"),dh=class extends De{constructor(){super(...arguments),this.padding=new si(0)}};a([Te],dh.prototype,"clip",2),a([Te],dh.prototype,"padding",2);var ph=class e extends ni{constructor(e,t){var i;super(),this.id=(0,n.sX)(this),this.seriesRoot=new It({name:`${this.id}-series-root`,zIndex:5}),this.annotationRoot=new It({name:`${this.id}-annotation-root`,zIndex:9}),this.titleGroup=new Mt({name:"titles",zIndex:13}),this.debug=v.create(),this.extraDebugStats={},this.data=[],this._firstAutoSize=!0,this._autoSizeNotify=new n.iN,this.padding=new si(20),this.seriesArea=new dh,this.keyboard=new sa,this.touch=new th,this.mode="standalone",this.chartCaptions=new zi,this.suppressFieldDotNotation=!1,this.loadGoogleFonts=!1,this.destroyed=!1,this._destroyFns=[],this.chartAnimationPhase="initial",this.modulesManager=new rc,this.processors=[],this.queuedUserOptions=[],this.queuedChartOptions=[],this.firstApply=!0,this.syncStatus="init",this.apiUpdate=!1,this._pendingFactoryUpdatesCount=0,this._performUpdateSkipAnimations=!1,this._performUpdateNotify=new n.iN,this.performUpdateType=8,this.runningUpdateType=8,this.updateShortcutCount=0,this.seriesToUpdate=new Set,this.updateMutex=new ii,this.updateRequestors={},this.performUpdateTrigger=hi((e,t=0)=>{0===t?queueMicrotask(e):setTimeout(e,t)},({count:e})=>{this.destroyed||this.updateMutex.acquire(async()=>{try{await this.performUpdate(e)}catch(e){n.Vy.error("update error",e)}}).catch(e=>n.Vy.errorOnce(e))}),this._performUpdateSplits={},this.axes=[],this.series=[],this._cachedData=void 0,this.onSeriesNodeClick=e=>{this.fireEvent(e)},this.onSeriesNodeDoubleClick=e=>{this.fireEvent(e)},this.onSeriesVisibilityChange=e=>{this.fireEvent(e)},this.seriesGroupingChanged=e=>{if(!(e instanceof vc))return;const{series:t,seriesGrouping:i,oldGrouping:n}=e;t.contentGroup.isRoot()||this.seriesLayerManager.changeGroup({internalId:t.internalId,type:t.type,contentGroup:t.contentGroup,renderToOffscreenCanvas:()=>t.renderToOffscreenCanvas(),seriesGrouping:i,oldGrouping:n})},this.chartOptions=e;const s=t?.scene,r=t?.container??e.processedOptions.container??void 0,o=t?.styleContainer??e.specialOverrides.styleContainer;s&&(this._firstAutoSize=!1,this._lastAutoSize=[s.width,s.height,s.pixelRatio]);const a=new Mt({name:"root"});a.visible=!1,a.append(this.seriesRoot),a.append(this.annotationRoot),a.append(this.titleGroup),this.titleGroup.append(this.title.node),this.titleGroup.append(this.subtitle.node),this.titleGroup.append(this.footnote.node),this.tooltip=new Xc,this.seriesLayerManager=new eh(this.seriesRoot),this.mode=e.userOptions.mode??this.mode,this.styleNonce=e.processedOptions.styleNonce;const l=this.ctx=new Ao(this,{chartType:this.getChartType(),scene:s,root:a,container:r,styleContainer:o,domMode:e.optionMetadata.domMode,syncManager:new na(this),fireEvent:e=>this.fireEvent(e),updateCallback:(e,t)=>this.update(e,t),updateMutex:this.updateMutex});this._destroyFns.push(l.domManager.addListener("resize",()=>this.parentResize(l.domManager.containerSize))),this.overlays=new cc,(i=this.overlays.loading).renderer??(i.renderer=()=>function(e,t){const{animationDuration:i}=Ps.add,s=i*t,r=(0,n.n)("div",`${oc}--loading`,{display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",height:"100%",boxSizing:"border-box",font:"13px Verdana, sans-serif",userSelect:"none",animation:`ag-charts-loading ${s}ms linear 50ms both`}),o=(0,n.n)("span",{width:"45px",height:"40px",backgroundImage:["linear-gradient(#0000 calc(1 * 100% / 6), #ccc 0 calc(3 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(2 * 100% / 6), #ccc 0 calc(4 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(3 * 100% / 6), #ccc 0 calc(5 * 100% / 6), #0000 0)"].join(""),backgroundSize:"10px 400%",backgroundRepeat:"no-repeat",animation:"ag-charts-loading-matrix 1s infinite linear"}),a=(0,n.n)("p",{marginTop:"1em"});a.innerText=e;const l=(0,n.n)("div",`${oc}__loading-background`,{position:"absolute",inset:"0",opacity:"0.5",zIndex:"-1"}),c=(0,n.n)("style");return c.innerText=["@keyframes ag-charts-loading { from { opacity: 0 } to { opacity: 1 } }","@keyframes ag-charts-loading-matrix {","0% { background-position: 0% 0%, 50% 0%, 100% 0%; }","100% { background-position: 0% 100%, 50% 100%, 100% 100%; }","}"].join(" "),r.replaceChildren(c,o,a,l),r}(this.overlays.loading.getText(l.localeManager),l.animationManager.defaultDuration)),this.processors=[new ih(this,l.dataService,l.updateService,l.zoomManager,l.animationManager),new hh(this,this.overlays,l.dataService,l.layoutManager,l.localeManager,l.animationManager,l.domManager)],this.highlight=new Mo,this.container=r;const c=this.getModuleContext();l.domManager.setDataBoolean("animating",!1),this.seriesAreaManager=new Jc(this.initSeriesAreaDependencies()),this._destroyFns.push(l.layoutManager.registerElement(0,e=>{e.layoutBox.shrink(this.padding.toJson()),this.chartCaptions.positionCaptions(e)}),l.layoutManager.addListener("layout:complete",e=>this.chartCaptions.positionAbsoluteCaptions(e)),l.dataService.addListener("data-load",e=>{this.data=e.data}),this.title.registerInteraction(c,"beforebegin"),this.subtitle.registerInteraction(c,"beforebegin"),this.footnote.registerInteraction(c,"afterend"),Mi.addWindowEvent("page-left",()=>this.destroy()),l.animationManager.addListener("animation-frame",()=>{this.update(7)}),l.animationManager.addListener("animation-start",()=>l.domManager.setDataBoolean("animating",!0)),l.animationManager.addListener("animation-stop",()=>l.domManager.setDataBoolean("animating",!1)),l.zoomManager.addListener("zoom-change",()=>{this.series.forEach(e=>e.animationState?.transition("updateData"));const e="initial"!==this.chartAnimationPhase;this.update(4,{forceNodeDataRefresh:!0,skipAnimations:e})})),this.parentResize(l.domManager.containerSize)}static getInstance(t){return e.chartsInstances.get(t)}get canvasElement(){return this.ctx.scene.canvas.element}download(e,t){this.ctx.scene.download(e,t)}getCanvasDataURL(e){return this.ctx.scene.getDataURL(e)}toSVG(){return this.ctx.scene.toSVG()}get seriesAreaBoundingBox(){return this.seriesAreaManager.bbox}getOptions(){return this.queuedUserOptions.at(-1)??this.chartOptions.userOptions}getChartOptions(){return this.queuedChartOptions.at(-1)??this.chartOptions}overrideFocusVisible(e){this.seriesAreaManager.focusIndicator?.overrideFocusVisible(e)}initSeriesAreaDependencies(){const{ctx:e,tooltip:t,highlight:i,overlays:n,seriesRoot:s,mode:r}=this,o=this.getChartType();return{fireEvent:this.fireEvent.bind(this),getUpdateType:()=>this.performUpdateType,getTooltipContent:(e,t,i)=>this.getTooltipContent(e,t,i),chartType:o,ctx:e,tooltip:t,highlight:i,overlays:n,seriesRoot:s,mode:r}}getModuleContext(){return this.ctx}getTooltipContent(e,t,i){const n=!1!==e.properties.tooltip.enabled?e.getTooltipContent(t,i):void 0,s=null==n?[]:[n];if("shared"!==this.tooltip.mode||1===this.series.length)return s;const r=e.getCategoryValue(t);return null==r?s:this.series.flatMap(t=>{if(t===e)return s;if(!t.isEnabled()||!1===t.properties.tooltip.enabled)return[];const i=t.datumIndexForCategoryValue(r),n=null==i?void 0:t.getTooltipContent(i,void 0);return null==n?[]:[n]})}getCaptionText(){return[this.title,this.subtitle,this.footnote].filter(e=>e.enabled&&e.text).map(e=>e.text).join(". ")}getAriaLabel(){return this.ctx.localeManager.t("ariaAnnounceChart",{seriesCount:this.series.length})}resetAnimations(){this.chartAnimationPhase="initial";for(const e of this.series)e.resetAnimation(this.chartAnimationPhase);for(const e of this.axes)e.resetAnimation(this.chartAnimationPhase);this.animationRect=void 0,this.ctx.animationManager.reset()}skipAnimations(){this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0}detachAndClear(){this.container=void 0,this.ctx.scene.clearCanvas()}destroy(e){if(this.destroyed)return;const t=e?.keepTransferableResources;let i;return this.performUpdateType=8,this._destroyFns.forEach(e=>e()),this.processors.forEach(e=>e.destroy()),this.overlays.destroy(),this.modulesManager.destroy(),t?(this.ctx.scene.strip(),i={container:this.container,scene:this.ctx.scene}):(this.ctx.scene.destroy(),this.container=void 0),this.destroySeries(this.series),this.seriesLayerManager.destroy(),this.axes.forEach(e=>e.destroy()),this.axes=[],this.animationRect=void 0,this.ctx.destroy(),this.destroyed=!0,Object.freeze(this),i}requestFactoryUpdate(e){this.destroyed||(this._pendingFactoryUpdatesCount++,this.updateMutex.acquire(async()=>{if(!this.destroyed)try{await e(this)}finally{this.destroyed||this._pendingFactoryUpdatesCount--}}).catch(e=>n.Vy.errorOnce(e)))}clearCallbackCache(){this.ctx.callbackCache.invalidateCache();for(const e of this.series)e.resetDatumCallbackCache()}update(e=0,t){if(this.destroyed)return;const{forceNodeDataRefresh:i=!1,skipAnimations:n,seriesToUpdate:s=this.series,newAnimationBatch:r,apiUpdate:o=!1}=t??{};this.apiUpdate=o,this.ctx.widgets.seriesWidget.setDragTouchEnabled("none"!==this.touch.dragAction),i&&this.series.forEach(e=>e.markNodeDataDirty());for(const e of s)this.seriesToUpdate.add(e);if(n&&(this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0),r&&this.ctx.animationManager.isActive()&&(this._performUpdateSkipAnimations=!0),this.debug.check()){let t=(new Error).stack??"<unknown>";t=t.replace(/\([^)]*/g,""),this.updateRequestors[t]=e}e<this.performUpdateType&&(this.performUpdateType=e,this.ctx.domManager.setDataBoolean("updatePending",!0),this.performUpdateTrigger.schedule(t?.backOffMs))}async performUpdate(e){const{performUpdateType:t,extraDebugStats:i,_performUpdateSplits:n,ctx:s}=this,r=[...this.seriesToUpdate];this.clearCallbackCache(),this.performUpdateType=8,this.seriesToUpdate.clear(),this.runningUpdateType=t,0===this.updateShortcutCount&&t<7&&(s.animationManager.startBatch(this._performUpdateSkipAnimations),s.animationManager.onBatchStop(()=>this.chartAnimationPhase="ready")),this.ctx.scene.updateDebugFlags(),this.debug("Chart.performUpdate() - start",vs[t]);let o=performance.now();n.start??(n.start=o);const a=e=>{n[e]??(n[e]=0),n[e]+=performance.now()-o,o=performance.now()};switch(t){case 0:if(this.checkUpdateShortcut(0))break;this.ctx.updateService.dispatchPreDomUpdate(),this.updateDOM();case 1:if(this.checkUpdateShortcut(1))break;await this.updateData(),a("⬇️");case 2:if(this.checkUpdateShortcut(2))break;await this.processData(),this.seriesAreaManager.dataChanged(),a("🏭");case 3:if(this.checkUpdateShortcut(3))break;await this.processDomains(),a("⛰️");case 4:if(await this.checkFirstAutoSize(),this.checkUpdateShortcut(4))break;await this.processLayout(),a("⌖");case 5:if(this.checkUpdateShortcut(5))break;await this.updateSeries(r),a("🤔"),this.updateAriaLabels(),this.seriesLayerManager.updateLayerCompositing();case 6:if(this.checkUpdateShortcut(6))break;s.updateService.dispatchPreSceneRender(),a("↖");case 7:if(this.checkUpdateShortcut(7))break;s.animationManager.endBatch(),i.updateShortcutCount=this.updateShortcutCount,s.scene.render({debugSplitTimes:n,extraDebugStats:i,seriesRect:this.seriesRect}),this.extraDebugStats={};for(const e of Object.keys(n))delete n[e];this.ctx.domManager.incrementDataCounter("sceneRenders"),this.ctx.domManager.postRenderUpdate();case 8:this.updateShortcutCount=0,this.updateRequestors={},this._performUpdateSkipAnimations=!1,s.animationManager.endBatch()}this.destroyed||(s.updateService.dispatchUpdateComplete(this.apiUpdate),this.apiUpdate=!1,this.ctx.domManager.setDataBoolean("updatePending",!1),this.runningUpdateType=8,this.syncStatus="ready"),this._performUpdateNotify.notify();const l=performance.now();this.debug("Chart.performUpdate() - end",{chart:this,durationMs:Math.round(100*(l-n.start))/100,count:e,performUpdateType:vs[t]})}updateThemeClassName(){const e="ag-charts-theme-",t=[`${e}default`,`${e}default-dark`];let i=t[0],n=!1,{theme:s}=this.chartOptions.processedOptions;for(;"string"!=typeof s&&null!=s;)s=s.baseTheme;"string"==typeof s&&(i=s.replace("ag-",e),n=s.includes("-dark")),t.includes(i)||(i=n?t[1]:t[0]),this.ctx.domManager.setThemeClass(i)}updateDOM(){this.updateThemeClassName();const{enabled:e,tabIndex:t}=this.keyboard;this.ctx.domManager.setTabGuardIndex(e?t??0:-1),this.ctx.domManager.setThemeParameters(this.chartOptions.themeParameters)}updateAriaLabels(){this.ctx.domManager.updateCanvasLabel(this.getAriaLabel())}checkUpdateShortcut(e){return!!this.destroyed||(this.updateShortcutCount>3?(n.Vy.warn("exceeded the maximum number of simultaneous updates (4), discarding changes and rendering",this.updateRequestors),!1):this.performUpdateType<=e&&(this.updateShortcutCount++,!0))}async checkFirstAutoSize(){null!=this.width&&null!=this.height||this._lastAutoSize||await this._autoSizeNotify.await(500)||this.debug("Chart.checkFirstAutoSize() - timeout for first size update.")}onAxisChange(e,t){null==t&&0===e.length||this.ctx.axisManager.updateAxes(t??[],e)}onSeriesChange(e,t){const i=t?.filter(t=>!e.includes(t))??[];this.destroySeries(i),this.seriesLayerManager?.setSeriesCount(e.length);for(const i of e){if(t?.includes(i))continue;const e=this.seriesLayerManager.requestGroup(i);i.attachSeries(e,this.seriesRoot,this.annotationRoot);const n=this;i.chart={get mode(){return n.mode},get isMiniChart(){return!1},get seriesRect(){return n.seriesRect}},i.resetAnimation(this.chartAnimationPhase),this.addSeriesListeners(i),i.addChartEventListeners()}this.seriesAreaManager?.seriesChanged(e)}destroySeries(e){e?.forEach(e=>{e.removeEventListener("seriesNodeClick",this.onSeriesNodeClick),e.removeEventListener("seriesNodeDoubleClick",this.onSeriesNodeDoubleClick),e.removeEventListener("groupingChanged",this.seriesGroupingChanged),e.destroy(),this.seriesLayerManager.releaseGroup(e),e.detachSeries(void 0,this.seriesRoot,this.annotationRoot),e.chart=void 0})}addSeriesListeners(e){this.hasEventListener("seriesNodeClick")&&e.addEventListener("seriesNodeClick",this.onSeriesNodeClick),this.hasEventListener("seriesNodeDoubleClick")&&e.addEventListener("seriesNodeDoubleClick",this.onSeriesNodeDoubleClick),this.hasEventListener("seriesVisibilityChange")&&e.addEventListener("seriesVisibilityChange",this.onSeriesVisibilityChange),e.addEventListener("groupingChanged",this.seriesGroupingChanged)}assignSeriesToAxes(){for(const e of this.axes)e.boundSeries=this.series.filter(t=>t.axes[e.direction]===e)}assignAxesToSeries(){const e=(0,n.$z)(this.axes,e=>e.direction);for(const t of this.series)for(const i of t.directions){const s=e[i];if(!s)return void n.Vy.warnOnce(`no available axis for direction [${i}]; check series and axes configuration.`);const r=t.getKeys(i),o=s.find(e=>!e.keys.length||r.some(t=>e.keys.includes(t)));if(!o)return void n.Vy.warnOnce(`no matching axis for direction [${i}] and keys [${r}]; check series and axes configuration.`);t.axes[i]=o}}parentResize(e){if(null==e||null!=this.width&&null!=this.height)return;let{width:t,height:i}=e;const{pixelRatio:n}=e;if(t=Math.floor(t),i=Math.floor(i),0===t&&0===i)return;const[s=0,r=0,o=1]=this._lastAutoSize??[];s===t&&r===i&&o===n||(this._lastAutoSize=[t,i,n],this.resize("SizeMonitor",{}))}resize(e,t){const{scene:i,animationManager:s}=this.ctx,{inWidth:r,inHeight:o,inMinWidth:a,inMinHeight:l,inOverrideDevicePixelRatio:c}=t;this.ctx.domManager.setSizeOptions(a??this.minWidth,l??this.minHeight,r??this.width,o??this.height);const h=r??this.width??this._lastAutoSize?.[0],u=o??this.height??this._lastAutoSize?.[1],d=c??this.overrideDevicePixelRatio??this._lastAutoSize?.[2];if(this.debug(`Chart.resize() from ${e}`,{width:h,height:u,pixelRatio:d,stack:(new Error).stack}),null!=h&&null!=u&&(0,n.Bf)(h)&&(0,n.Bf)(u)&&i.resize(h,u,d)){s.reset();let e=!0;null!=this.width&&null!=this.height||!this._firstAutoSize||(e=!1,this._firstAutoSize=!1),this.update(4,{forceNodeDataRefresh:!0,skipAnimations:e}),this._autoSizeNotify.notify()}}async updateData(){this.series.forEach(e=>e.setChartData(this.data));const e=this.modulesManager.mapModules(e=>e.updateData?.(this.data));await Promise.all(e)}async processData(){this.series.some(e=>e.canHaveAxes)&&(this.assignAxesToSeries(),this.assignSeriesToAxes());const e=new Wo(this.mode,this.suppressFieldDotNotation),t=this.series.map(t=>t.processData(e)),i=this.modulesManager.mapModules(t=>t.processData?.(e));this._cachedData=e.execute(this._cachedData),await Promise.all([...t,...i]),this.updateLegends()}async processDomains(){for(const e of this.axes)e.processData();for(const e of this.series)e.updatedDomains()}updateLegends(e){for(const{legend:t,legendType:i}of this.modulesManager.legends())"category"===i?this.setCategoryLegendData(e):this.setLegendData(i,t)}setCategoryLegendData(e){var t;const{ctx:{legendManager:i,stateManager:s}}=this;e&&this.series.forEach(t=>{const i=e.find(e=>e.seriesId===t.id);t.onLegendInitialState("category",i)});const r=this.series.flatMap(e=>{const t=e.getLegendData("category");return i.updateData(e.id,t),t});if(e)s.setStateAndRestore(i,e);else{if("integrated"!==this.mode){const e={},i=new Map(this.series.map(e=>[e.id,e.type]));for(const{seriesId:s,symbol:{marker:o},label:a}of r.filter(e=>!e.hideInLegend)){if(null==o.fill)continue;const r=i.get(s),l=e[r]??(e[r]={});l[t=a.text]??(l[t]=o.fill),l[a.text]!==o.fill&&n.Vy.warnOnce(`legend item '${a.text}' has multiple fill colors, this may cause unexpected behaviour.`)}}i.update()}}setLegendData(e,t){t.data=this.series.filter(e=>e.properties.showInLegend).flatMap(t=>t.getLegendData(e))}async processLayout(){const e=this.animationRect,{width:t,height:i}=this.ctx.scene,n=this.ctx.layoutManager.createContext(t,i);await this.performLayout(n),e&&!this.animationRect?.equals(e)&&this.ctx.animationManager.skipCurrentBatch(),this.debug("Chart.performUpdate() - seriesRect",this.seriesRect)}async updateSeries(e){const{seriesRect:t}=this;await Promise.all(e.map(e=>e.update({seriesRect:t}))),this.ctx.seriesLabelLayoutManager.updateLabels(this.series.filter(e=>e.visible&&e.usesPlacedLabels),this.padding,this.seriesRect)}async waitForUpdate(e=1e4,t=!1){const i=performance.now();for(;(this._pendingFactoryUpdatesCount>0||8!==this.performUpdateType||8!==this.runningUpdateType||this.ctx.scene.waitingForUpdate())&&!this.destroyed;){if(this._pendingFactoryUpdatesCount>0&&await this.updateMutex.waitForClearAcquireQueue(),8===this.performUpdateType&&8===this.runningUpdateType||await this._performUpdateNotify.await(),performance.now()-i>e){const i=`Chart.waitForUpdate() timeout of ${e} reached - first chart update taking too long.`;if(t)throw new Error(i);n.Vy.warnOnce(i)}Lt()&&await(0,n.v7)(),this.ctx.scene.waitingForUpdate()&&await(0,n.v7)(50)}}filterMiniChartSeries(e){return e?.filter(e=>!1!==e.showInMiniChart)}applyOptions(e){const t=this.firstApply?e.processedOptions:e.diffOptions(this.chartOptions);if(null==t||0===Object.keys(t).length)return;const i=this.firstApply?{}:this.chartOptions.processedOptions,n=e.processedOptions;uh("Chart.applyOptions() - applying delta",t);const s=this.applyModules(n);t.listeners&&this.registerListeners(this,t.listeners),Ut(this,t,{skip:["type","data","series","listeners","preset","theme","legend.listeners","navigator.miniChart.series","navigator.miniChart.label","locale.localeText","axes","topology","nodes","initialState","styleContainer"]});let r=!1,o="no-op";null!=t.series&&(o=this.applySeries(this,t.series,i?.series),r=!0),"replaced"===o&&this.resetAnimations(),this.applyAxes(this,n,i,o,[])&&(r=!0),t.data&&(this.data=t.data),t.legend?.listeners&&this.modulesManager.isEnabled("legend")&&Object.assign(this.legend.listeners,t.legend.listeners),t.locale?.localeText&&(this.modulesManager.getModule("locale").localeText=t.locale?.localeText),this.chartOptions=e;const a=this.modulesManager.getModule("navigator"),l=this.modulesManager.getModule("zoom");a?.enabled||l?.enabled||this.ctx.zoomManager.updateZoom("chart");const c=a?.miniChart,h=n.navigator?.miniChart?.series??n.series;!0===c?.enabled&&null!=h?this.applyMiniChartOptions(c,h,n,i):!1===c?.enabled&&(c.series=[],c.axes=[]),this.ctx.annotationManager.setAnnotationStyles(e.annotationThemes),r||(r=this.shouldForceNodeDataRefresh(t,o));const u=r||s?0:4;this.maybeResetAnimations(o),this.shouldClearLegendData(n,i,o)&&this.ctx.legendManager.clearData(),this.applyInitialState(n),uh("Chart.applyOptions() - update type",vs[u],{seriesStatus:o,forceNodeDataRefresh:r}),this.update(u,{apiUpdate:!0,forceNodeDataRefresh:r,newAnimationBatch:!0}),this.firstApply=!1}applyInitialState(e){const{annotationManager:t,chartTypeOriginator:i,historyManager:n,stateManager:s,zoomManager:r}=this.ctx,{initialState:o}=e;if("annotations"in e&&e.annotations?.enabled&&null!=o?.annotations){const e=o.annotations.map(e=>L(e,t.getAnnotationTypeStyles(e.type)));s.setState(t,e)}null!=o?.chartType&&s.setState(i,o.chartType),(e.navigator?.enabled||e.zoom?.enabled)&&null!=o?.zoom&&s.setState(r,o.zoom),null!=o?.legend&&this.updateLegends(o.legend),null!=o&&n.clear()}maybeResetAnimations(e){if("standalone"===this.mode)switch(e){case"series-grouping-change":case"replaced":this.resetAnimations()}}shouldForceNodeDataRefresh(e,t){const i=!!e.data||"data-change"===t||"replaced"===t,n=qo.getKeys(),s=Object.values(n).some(t=>null!=e[t]),r=null!=e.title&&null!=e.subtitle;return i||s||r}shouldClearLegendData(e,t,i){const n="replaced"===i||"series-grouping-change"===i||"updated"===i&&(e.series?.length!==t.series?.length||!e.series?.every((e,i)=>e.type===t.series?.[i].type)),s=null!=t.legend&&null==e.legend;return n||s}applyMiniChartOptions(e,t,i,n){const s=n?.navigator?.miniChart?.series??n?.series,r=this.applySeries(e,this.filterMiniChartSeries(t),this.filterMiniChartSeries(s));this.applyAxes(e,i,n,r,["axes[].tick","axes[].thickness","axes[].title","axes[].crosshair","axes[].gridLine","axes[].label"]);const o=e.series;for(const e of o)e.properties.id=void 0;const a=e.axes,l=a.find(e=>"x"===e.direction);for(const e of a)e.nice=!1,e.gridLine.enabled=!1,e.label.enabled=e===l,e.tick.enabled=!1,e.interactionEnabled=!1;if(null!=l){const e=i.navigator?.miniChart,t=e?.label,n=e?.label?.interval;if(l.line.enabled=!1,l.label.set(G(t,["interval","rotation","minSpacing","autoRotate","autoRotateAngle"])),l.tick.set(G(n,["enabled","width","size","color","interval","step"])),"grouped-category"===l.type){l.label.enabled=!1,l.label.rotation=0;const{depthOptions:e}=l;if(0===e.length)e.set([{label:{enabled:!0}}]);else for(let t=1;t<e.length;t++)e[t].label.enabled=!1}else"time"!==l.type&&"unit-time"!==l.type&&"ordinal-time"!==l.type||(l.parentLevel.enabled=!1);const s=n?.step;null!=s&&(l.interval.step=s)}}applyModules(e){const{type:t}=this.constructor;let i=!1;for(const n of c.byType("root","legend")){const s=null!=e[n.optionsKey]&&n.chartTypes.includes(t);s!==this.modulesManager.isEnabled(n)&&(s?(this.modulesManager.addModule(n,e=>e.moduleFactory(this.getModuleContext())),"legend"===n.type&&this.modulesManager.getModule(n)?.attachLegend(this.ctx.scene),this[n.optionsKey]=this.modulesManager.getModule(n)):(this.modulesManager.removeModule(n),delete this[n.optionsKey]),i=!0)}return i}initSeriesDeclarationOrder(e){for(let t=0;t<e.length;t++)e[t].setSeriesIndex(t)}applySeries(e,t,i){if(!t)return"no-change";const n=function(e,t,i){const n=(e,t,i)=>{const n=[e];for(const e of Xl)e in t&&null!=t[e]&&n.push(`${e}=${t[e]}`);return i?.seriesGrouping&&n.push(`seriesGrouping.groupId=${i?.seriesGrouping.groupId}`),n.join(";")},s=new Map;let r=0;for(const t of e){const e=n(t.type,t.properties,i?.[r]);s.has(e)||s.set(e,[]),s.get(e)?.push([t,r++])}const o=new Map;r=0;for(const e of t){const t=n(e.type,e,e);o.has(t)||o.set(t,[]),o.get(t)?.push([e,r++])}if(![...s.keys()].some(e=>o.has(e)))return{status:"no-overlap",oldKeys:s.keys(),newKeys:o.keys()};const a=[];for(const[e,t]of o.entries())for(const[n,r]of t){const t=s.get(e);if(null==t||t.length<1){a.push({opts:n,targetIdx:r,idx:r,status:"add"}),s.delete(e);continue}const[o,l]=t.shift(),c=Ft(i?.[l]??{},n??{}),{groupIndex:h,stackIndex:u}=c?.seriesGrouping??{};null!=h||null!=u?a.push({opts:n,series:o,diff:c,targetIdx:r,idx:l,status:"series-grouping"}):c?a.push({opts:n,series:o,diff:c,targetIdx:r,idx:l,status:"update"}):a.push({opts:n,series:o,targetIdx:r,idx:l,status:"no-op"}),0===t.length&&s.delete(e)}for(const e of s.values())for(const[t,i]of e)a.push({series:t,idx:i,targetIdx:-1,status:"remove"});return{status:"overlap",changes:a}}(e.series,t,i);if("no-overlap"===n.status){uh(`Chart.applySeries() - creating new series instances, status: ${n.status}`,n);const i=t.map(e=>this.createSeries(e));return this.initSeriesDeclarationOrder(i),e.series=i,"replaced"}uh("Chart.applySeries() - matchResult",n);const s=[];let r=!1,o=!1,a=!1;const l=n.changes.toSorted((e,t)=>e.targetIdx-t.targetIdx);for(const e of l)switch(o||(o="series-grouping"===e.status),r||(r=null!=e.diff?.data),a||(a="no-op"!==e.status),e.status){case"add":{const t=this.createSeries(e.opts);s.push(t),uh("Chart.applySeries() - created new series",t);break}case"remove":uh(`Chart.applySeries() - removing series at previous idx ${e.idx}`,e.series);break;case"no-op":s.push(e.series),uh(`Chart.applySeries() - no change to series at previous idx ${e.idx}`,e.series);break;default:{const{series:t,diff:i,idx:n}=e;uh(`Chart.applySeries() - applying series diff previous idx ${n}`,i,t),this.applySeriesValues(t,i),t.markNodeDataDirty(),s.push(t)}}return this.initSeriesDeclarationOrder(s),uh("Chart.applySeries() - final series instances",s),e.series=s,o?"series-grouping-change":r?"data-change":a?"updated":"no-op"}applyAxes(e,t,i,n,s=[]){if(!("axes"in t)||!t.axes)return!1;s=["axes[].type",...s];const r=t.axes.map(e=>"time"===e.type&&null!=e.unit?{...e,type:"unit-time"}:e);return"replaced"!==n&&e.axes.length===r.length&&e.axes.every((e,t)=>e.type===r[t].type)&&Ql(i)?(e.axes.forEach((e,t)=>{const n=Ft(i.axes?.[t]??{},r[t]);uh(`Chart.applyAxes() - applying axis diff idx ${t}`,n),Ut(e,n,{path:`axes[${t}]`,skip:s})}),!0):(uh(`Chart.applyAxes() - creating new axes instances; seriesStatus: ${n}`),e.axes=this.createAxis(r,s),!0)}createSeries(e){const t=ta.create(e.type,this.getModuleContext());return this.applySeriesOptionModules(t,e),this.applySeriesValues(t,e),t}applySeriesOptionModules(e,t){const i=e.createModuleContext(),n=e.getModuleMap();for(const s of c.byType("series-option"))s.optionsKey in t&&s.seriesTypes.includes(e.type)&&n.addModule(s,e=>e.moduleFactory(i))}applySeriesValues(e,t){const i=e.getModuleMap(),{type:n,data:s,listeners:r,seriesGrouping:o,showInMiniChart:a,...l}=t;for(const e of $o)if("series-option"===e.type&&e.optionsKey in l){const t=i.getModule(e.optionsKey);if(t){const i=l[e.optionsKey];delete l[e.optionsKey],t.properties.set(i)}}null!=l.visible&&(e.visible=l.visible),e.properties.set(l),"data"in t&&e.setOptionsData(s),r&&this.registerListeners(e,r,{nodeClick:"seriesNodeClick",nodeDoubleClick:"seriesNodeDoubleClick"}),"seriesGrouping"in t&&(e.seriesGrouping=null==o?void 0:{...e.seriesGrouping,...o})}createAxis(e,t){const i=[],n=this.getModuleContext();for(let s=0;s<e.length;s++){const r=e[s],o=jo.create(r.type,n);this.applyAxisModules(o,r),Ut(o,r,{path:`axes[${s}]`,skip:t}),i.push(o)}return function(e){const t=[],i=[],n=[...Yl];for(const n of e)n instanceof Kl&&(ql(n.position)?i.push(n.position):t.push(n));for(const e of t){let t;do{t=n.pop()}while(t&&i.includes(t));if(null==t)break;e.position=t}}(i),i}applyAxisModules(e,t){const i=e.createModuleContext(),n=e.getModuleMap();for(const s of c.byType("axis-option")){const r=null!=t[s.optionsKey];r!==n.isEnabled(s)&&(r?(n.addModule(s,e=>e.moduleFactory(i)),e[s.optionsKey]=n.getModule(s)):(n.removeModule(s),delete e[s.optionsKey]))}}registerListeners(e,t,i){e.clearEventListeners();for(const[s,r]of(0,n.jO)(t))if((0,n.Tn)(r)){const t=i?.[s];null==t?e.addEventListener(s,r):e.addEventListener(t,e=>{if(e?.type===t){const t=new Proxy(e,{get:(e,t,i)=>"type"===t?s:Reflect.get(e,t,i)});r(t)}else r(e)})}}};ph.chartsInstances=new WeakMap,a([li({newValue(e){this.destroyed||(this.ctx.domManager.setContainer(e),ph.chartsInstances.set(e,this))},oldValue(e){ph.chartsInstances.delete(e)}})],ph.prototype,"container",2),a([li({newValue(e){this.resize("width option",{inWidth:e})}})],ph.prototype,"width",2),a([li({newValue(e){this.resize("height option",{inHeight:e})}})],ph.prototype,"height",2),a([li({newValue(e){this.resize("minWidth option",{inMinWidth:e})}})],ph.prototype,"minWidth",2),a([li({newValue(e){this.resize("minHeight option",{inMinHeight:e})}})],ph.prototype,"minHeight",2),a([li({newValue(e){this.resize("overrideDevicePixelRatio option",{inOverrideDevicePixelRatio:e})}})],ph.prototype,"overrideDevicePixelRatio",2),a([Te],ph.prototype,"padding",2),a([Te],ph.prototype,"seriesArea",2),a([Te],ph.prototype,"keyboard",2),a([Te],ph.prototype,"touch",2),a([Te],ph.prototype,"mode",2),a([Te],ph.prototype,"styleNonce",2),a([ri("chartCaptions.title")],ph.prototype,"title",2),a([ri("chartCaptions.subtitle")],ph.prototype,"subtitle",2),a([ri("chartCaptions.footnote")],ph.prototype,"footnote",2),a([Te],ph.prototype,"suppressFieldDotNotation",2),a([Te],ph.prototype,"loadGoogleFonts",2),a([li({changeValue(e,t){this.onAxisChange(e,t)}})],ph.prototype,"axes",2),a([li({changeValue(e,t){this.onSeriesChange(e,t)}})],ph.prototype,"series",2);var gh=ph,fh=v.create(!0,"opts"),mh="AG Charts - Chart was destroyed, cannot perform request.",yh=class{constructor(e,t,i){this.factoryApi=t,this.licenseManager=i,this.chart=e}async update(e){if(!this.chart)throw new Error(mh);return fh.group("AgChartInstance.update()",async()=>{this.factoryApi.update(e,this),await(this.chart?.waitForUpdate())})}async updateDelta(e){if(!this.chart)throw new Error(mh);return fh.group("AgChartInstance.updateDelta()",async()=>{this.factoryApi.updateUserDelta(this,e),await(this.chart?.waitForUpdate())})}getOptions(){if(!this.chart)throw new Error(mh);const e=Bt(this.chart.getOptions());for(const t of Object.keys(e))t.startsWith("_")&&delete e[t];return e}waitForUpdate(){if(!this.chart)throw new Error(mh);return this.chart.waitForUpdate()}async download(e){if(!this.chart)throw new Error(mh);const t=await this.prepareResizedChart(this,this.chart,e);try{t.chart?.download(e?.fileName,e?.fileFormat)}finally{t.destroy()}}async __toSVG(e){if(!this.chart)throw new Error(mh);const t=await this.prepareResizedChart(this,this.chart,{width:600,height:300,...e});try{return t?.chart?.toSVG()}finally{t?.destroy()}}async getImageDataURL(e){if(!this.chart)throw new Error(mh);const t=await this.prepareResizedChart(this,this.chart,e);try{return t.chart.getCanvasDataURL(e?.fileFormat)}finally{t.destroy()}}getState(){return this.factoryApi.caretaker.save(...this.getEnabledOriginators())}async setState(e){const{chart:t}=this;if(!t)return;const i=this.getEnabledOriginators();i.includes(t.ctx.legendManager)?(await this.setStateOriginators(e,i.filter(e=>e!==t.ctx.zoomManager)),await this.setStateOriginators(e,[t.ctx.zoomManager])):await this.setStateOriginators(e,i)}resetAnimations(){this.chart?.resetAnimations()}skipAnimations(){this.chart?.skipAnimations()}destroy(){this.releaseChart?(this.releaseChart(),this.releaseChart=void 0):this.chart&&(this.chart.publicApi=void 0,this.chart.destroy()),this.chart=void 0}async prepareResizedChart(e,t,i={}){const n=i.width??t.width??t.ctx.scene.canvas.width,s=i.height??t.height??t.ctx.scene.canvas.height,r=e.getState(),o=c.hasEnterpriseModules(),a={...t.chartOptions.processedOverrides,container:document.createElement("div"),width:n,height:s};null!=i.width&&null!=i.height&&(a.overrideDevicePixelRatio=1);const l=t.getOptions();o&&(a.animation={enabled:!1},this.licenseManager?.isDisplayWatermark()&&(a.foreground={text:this.licenseManager.getWatermarkMessage(),image:{url:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjU4IiBoZWlnaHQ9IjQwIiB2aWV3Qm94PSIwIDAgMjU4IDQwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjUuNzc5IDI4LjY1N0gxMy4zNTlMMTEuMTczIDM0LjAxMkg1LjY3Mjk3TDE3LjE4MiA3LjA1OTk5SDIxLjk1M0wzMy40NjIgMzQuMDEySDI3Ljk2MkwyNS43NzYgMjguNjU3SDI1Ljc3OVpNMjQuMDY4IDI0LjM5N0wxOS41ODggMTMuNDM0TDE1LjEwNyAyNC4zOTdIMjQuMDY4Wk02Mi4wOTIgMTguODIzSDQ5LjgxN1YyMy4wODZINTYuNzc1QzU2LjU1NSAyNS4yMjIgNTUuNzU1IDI2LjkyNyA1NC4zNzIgMjguMjAyQzUyLjk4OSAyOS40NzYgNTEuMTY2IDMwLjExNSA0OC45MDkgMzAuMTE1QzQ3LjYyMiAzMC4xMTUgNDYuNDUgMjkuODg1IDQ1LjM5MyAyOS40MjNDNDQuMzU4MyAyOC45NzgxIDQzLjQzMjYgMjguMzEzOCA0Mi42OCAyNy40NzZDNDEuOTI3IDI2LjYzOSA0MS4zNDQgMjUuNjMxIDQwLjkzMSAyNC40NTNDNDAuNTE5IDIzLjI3NSA0MC4zMTEgMjEuOTcgNDAuMzExIDIwLjUzN0M0MC4zMTEgMTkuMTA1IDQwLjUxNiAxNy44IDQwLjkzMSAxNi42MjFDNDEuMzQ0IDE1LjQ0MyA0MS45MjcgMTQuNDM2IDQyLjY4IDEzLjU5OEM0My40Mzc2IDEyLjc1NzcgNDQuMzY5NiAxMi4wOTMyIDQ1LjQxMSAxMS42NTFDNDYuNDc4IDExLjE4OSA0Ny42NTYgMTAuOTYgNDguOTQ2IDEwLjk2QzUxLjYxMiAxMC45NiA1My42MzcgMTEuNjAyIDU1LjAyIDEyLjg4NUw1OC4zIDkuNjA0OTlDNTUuODE3IDcuNjY5OTkgNTIuNjc2IDYuNjk5OTkgNDguODcyIDYuNjk5OTlDNDYuNzYgNi42OTk5OSA0NC44NTMgNy4wMzQ5OSA0My4xNTQgNy43MDA5OUM0MS40NTUgOC4zNjc5OSAzOS45OTggOS4zMDM5OSAzOC43ODMgMTAuNTA0QzM3LjU2NyAxMS43MDcgMzYuNjM0IDEzLjE1OCAzNS45NzcgMTQuODU3QzM1LjMxOSAxNi41NTYgMzQuOTk0IDE4LjQ1MSAzNC45OTQgMjAuNTRDMzQuOTk0IDIyLjYzIDM1LjMyOSAyNC40OTQgMzUuOTk1IDI2LjIwNUMzNi42NjIgMjcuOTE2IDM3LjYwNSAyOS4zNzQgMzguODE3IDMwLjU3N0M0MC4wMzIgMzEuNzggNDEuNDg2IDMyLjcxMyA0My4xODggMzMuMzgzQzQ0Ljg4OCAzNC4wNDkgNDYuNzgyIDM0LjM4NCA0OC44NzIgMzQuMzg0QzUwLjk2MSAzNC4zODQgNTIuNzUgMzQuMDQ5IDU0LjM5IDMzLjM4M0M1Ni4wMzEgMzIuNzE2IDU3LjQyNiAzMS43OCA1OC41NzkgMzAuNTc3QzU5LjczMyAyOS4zNzQgNjAuNjE5IDI3LjkxNiA2MS4yMzkgMjYuMjA1QzYxLjg2IDI0LjQ5NCA2Mi4xNyAyMi42MDUgNjIuMTcgMjAuNTRDNjIuMTY5NiAxOS45Njg4IDYyLjE0NDUgMTkuMzk4IDYyLjA5NSAxOC44MjlMNjIuMDkyIDE4LjgyM1pNMTUxLjgxIDE2Ljk4MUMxNTMuNDEgMTQuNjA5IDE1Ny40MTkgMTQuMzU4IDE1OS4wMjIgMTQuMzU4VjE4LjkxQzE1Ni45NTcgMTguOTEgMTU0Ljk4NSAxOC45OTYgMTUzLjc1NyAxOS44OTJDMTUyLjUyOSAyMC43OTIgMTUxLjkxOSAyMS45ODIgMTUxLjkxOSAyMy40NjRWMzMuOTlIMTQ2Ljk2NFYxNC4zNThIMTUxLjczNkwxNTEuODEgMTYuOTgxWk0xNDMuMDExIDE0LjM2MVYzNC4wMzFIMTM4LjI0TDEzOC4xMzEgMzEuMDQ1QzEzNy40NjYgMzIuMDc2IDEzNi41NTEgMzIuOTIxOSAxMzUuNDcxIDMzLjUwNEMxMzQuMzc2IDM0LjA5OSAxMzMuMDY4IDM0LjM5NiAxMzEuNTM2IDM0LjM5NkMxMzAuMiAzNC4zOTYgMTI4Ljk2MyAzNC4xNTIgMTI3LjgyMiAzMy42NjhDMTI2LjcgMzMuMTk2NCAxMjUuNjg5IDMyLjQ5NSAxMjQuODU1IDMxLjYwOUMxMjQuMDE4IDMwLjcyMiAxMjMuMzU0IDI5LjY2MiAxMjIuODcxIDI4LjQyMkMxMjIuMzg0IDI3LjE4NSAxMjIuMTQyIDI1LjgxMSAxMjIuMTQyIDI0LjMwNEMxMjIuMTQyIDIyLjc5OCAxMjIuMzg0IDIxLjM3OCAxMjIuODcxIDIwLjExNkMxMjMuMzU3IDE4Ljg1NCAxMjQuMDE4IDE3Ljc3MiAxMjQuODU1IDE2Ljg3M0MxMjUuNjg4IDE1Ljk3NjQgMTI2LjY5OCAxNS4yNjM2IDEyNy44MjIgMTQuNzhDMTI4Ljk2MyAxNC4yODEgMTMwLjIwMyAxNC4wMzMgMTMxLjUzNiAxNC4wMzNDMTMzLjA0MyAxNC4wMzMgMTM0LjMzIDE0LjMxOCAxMzUuMzk3IDE0Ljg4OEMxMzYuNDYyIDE1LjQ1ODkgMTM3LjM3NSAxNi4yNzggMTM4LjA1NyAxNy4yNzZWMTQuMzYxSDE0My4wMTFaTTEzMi42MzEgMzAuMTMzQzEzNC4yNTYgMzAuMTMzIDEzNS41NjcgMjkuNTk0IDEzNi41NjUgMjguNTEyQzEzNy41NjEgMjcuNDMgMTM4LjA2IDI1Ljk5MSAxMzguMDYgMjQuMTk2QzEzOC4wNiAyMi40MDEgMTM3LjU2MSAyMC45OSAxMzYuNTY1IDE5Ljg5OUMxMzUuNTcgMTguODA3IDEzNC4yNTkgMTguMjU4IDEzMi42MzEgMTguMjU4QzEzMS4wMDMgMTguMjU4IDEyOS43MjkgMTguODA0IDEyOC43MzQgMTkuODk5QzEyNy43MzggMjAuOTkzIDEyNy4yMzkgMjIuNDM4IDEyNy4yMzkgMjQuMjMzQzEyNy4yMzkgMjYuMDI4IDEyNy43MzUgMjcuNDMzIDEyOC43MzQgMjguNTE1QzEyOS43MjkgMjkuNTk0IDEzMS4wMjggMzAuMTM2IDEzMi42MzEgMzAuMTM2VjMwLjEzM1pNOTMuNjk4IDI3Ljg3NkM5My41Nzk1IDI4LjAwMjUgOTMuNDU2NCAyOC4xMjQ2IDkzLjMyOSAyOC4yNDJDOTEuOTQ3IDI5LjUxNiA5MC4xMjMgMzAuMTU1IDg3Ljg2NiAzMC4xNTVDODYuNTggMzAuMTU1IDg1LjQwOCAyOS45MjYgODQuMzUgMjkuNDY0QzgzLjMxNTUgMjkuMDE4OSA4Mi4zODk4IDI4LjM1NDYgODEuNjM3IDI3LjUxN0M4MC44ODQgMjYuNjc5IDgwLjMwMSAyNS42NzIgNzkuODg5IDI0LjQ5NEM3OS40NzYgMjMuMzE1IDc5LjI2OSAyMi4wMSA3OS4yNjkgMjAuNTc4Qzc5LjI2OSAxOS4xNDUgNzkuNDczIDE3Ljg0IDc5Ljg4OSAxNi42NjJDODAuMzAxIDE1LjQ4NCA4MC44ODQgMTQuNDc2IDgxLjYzNyAxMy42MzlDODIuMzk0OSAxMi43OTg3IDgzLjMyNzMgMTIuMTM0MiA4NC4zNjkgMTEuNjkyQzg1LjQzNiAxMS4yMyA4Ni42MTQgMTEgODcuOTAzIDExQzkwLjU3IDExIDkyLjU5NSAxMS42NDIgOTMuOTc3IDEyLjkyNkw5Ny4yNTggOS42NDQ5OUM5NC43NzQgNy43MTA5OSA5MS42MzMgNi43Mzk5OSA4Ny44MjkgNi43Mzk5OUM4NS43MTggNi43Mzk5OSA4My44MTEgNy4wNzQ5OSA4Mi4xMTIgNy43NDE5OUM4MC40MTMgOC40MDc5OSA3OC45NTYgOS4zNDQ5OSA3Ny43NCAxMC41NDVDNzYuNTI1IDExLjc0NyA3NS41OTIgMTMuMTk5IDc0LjkzNCAxNC44OThDNzQuMjc3IDE2LjU5NyA3My45NTEgMTguNDkxIDczLjk1MSAyMC41ODFDNzMuOTUxIDIyLjY3IDc0LjI4NiAyNC41MzQgNzQuOTUzIDI2LjI0NUM3NS42MTkgMjcuOTU3IDc2LjU2MiAyOS40MTQgNzcuNzc0IDMwLjYxN0M3OC45OSAzMS44MiA4MC40NDQgMzIuNzUzIDgyLjE0NiAzMy40MjNDODMuODQ1IDM0LjA5IDg1LjczOSAzNC40MjQgODcuODI5IDM0LjQyNEM4OS45MTkgMzQuNDI0IDkxLjcwOCAzNC4wOSA5My4zNDggMzMuNDIzQzk0LjcxOCAzMi44NjUgOTUuOTE4IDMyLjEyMSA5Ni45NDggMzEuMTkxQzk3LjE0OSAzMS4wMDggOTcuMzQ4IDMwLjgxNSA5Ny41MzcgMzAuNjJMOTMuNzAxIDI3Ljg4NUw5My42OTggMjcuODc2Wk0xMTAuODAyIDE0LjAxNUMxMDkuMTk5IDE0LjAxNSAxMDYuODM2IDE0LjQ3MSAxMDUuNjExIDE2LjE1OEwxMDUuNTM3IDYuMDE1OTlIMTAwLjc2NVYzMy45MzlIMTA1LjcyVjIyLjY0MUMxMDUuNzcxIDIxLjQ2MDcgMTA2LjI4OCAyMC4zNDg4IDEwNy4xNTcgMTkuNTQ4OUMxMDguMDI3IDE4Ljc0OTEgMTA5LjE3OCAxOC4zMjY2IDExMC4zNTggMTguMzc0QzExMy4zOTcgMTguMzc0IDExNC4yNjggMjEuMTU5IDExNC4yNjggMjIuNjQxVjMzLjkzOUgxMTkuMjIzVjIxLjA1OUMxMTkuMjIzIDIxLjA1OSAxMTkuMTQyIDE0LjAxNSAxMTAuODAyIDE0LjAxNVpNMTczLjc2MyAxNC4zNThIMTY5Ljk5OVY4LjcxNDk5SDE2NS4wNDhWMTQuMzU4SDE2MS4yODRWMTguOTE2SDE2NS4wNDhWMzQuMDAzSDE2OS45OTlWMTguOTE2SDE3My43NjNWMTQuMzU4Wk0xOTAuNzg3IDI1LjI2MkMxOTAuMTI5IDI0LjUwMTQgMTg5LjMwNyAyMy44OTk0IDE4OC4zODQgMjMuNTAxQzE4Ny40ODggMjMuMTE3IDE4Ni4zMzEgMjIuNzMyIDE4NC45NDggMjIuMzY0QzE4NC4xNjUgMjIuMTQzOSAxODMuMzkgMjEuODk3OCAxODIuNjIzIDIxLjYyNkMxODIuMTYzIDIxLjQ2MjEgMTgxLjc0MSAyMS4yMDY2IDE4MS4zODMgMjAuODc1QzE4MS4yMzUgMjAuNzQyMSAxODEuMTE4IDIwLjU3ODkgMTgxLjAzOSAyMC4zOTY0QzE4MC45NjEgMjAuMjE0IDE4MC45MjIgMjAuMDE2NiAxODAuOTI3IDE5LjgxOEMxODAuOTI3IDE5LjI3MiAxODEuMTU2IDE4Ljg0NCAxODEuNjI1IDE4LjUxQzE4Mi4xMjEgMTguMTU2IDE4Mi44NjIgMTcuOTc2IDE4My44MjYgMTcuOTc2QzE4NC43OSAxNy45NzYgMTg1LjU4NyAxOC4yMDkgMTg2LjE0OCAxOC42NjhDMTg2LjcwNiAxOS4xMjQgMTg3LjAwNyAxOS43MjUgMTg3LjA3MiAyMC41TDE4Ny4wOTQgMjAuNzgySDE5MS42MzNMMTkxLjYxNyAyMC40NkMxOTEuNTIxIDE4LjQ4NSAxOTAuNzcxIDE2LjkgMTg5LjM4NSAxNS43NUMxODguMDEyIDE0LjYxMiAxODYuMTg1IDE0LjAzMyAxODMuOTYyIDE0LjAzM0MxODIuNDc3IDE0LjAzMyAxODEuMTQxIDE0LjI4NyAxNzkuOTk0IDE0Ljc4NkMxNzguODMxIDE1LjI5MSAxNzcuOTI2IDE1Ljk5NSAxNzcuMjk2IDE2Ljg4MkMxNzYuNjczIDE3Ljc0NTUgMTc2LjMzOCAxOC43ODQgMTc2LjM0MSAxOS44NDlDMTc2LjM0MSAyMS4xNjcgMTc2LjY5OCAyMi4yNDkgMTc3LjM5OSAyMy4wNjRDMTc4LjA2IDIzLjg0MzIgMTc4Ljg5OCAyNC40NTM0IDE3OS44NDIgMjQuODQ0QzE4MC43NDQgMjUuMjE2IDE4MS45MjggMjUuNjA3IDE4My4zNjEgMjZDMTg0LjgwNiAyNi40MSAxODUuODcyIDI2Ljc4NSAxODYuNTMgMjcuMTIzQzE4Ny4xIDI3LjQxNCAxODcuMzc5IDI3Ljg0NSAxODcuMzc5IDI4LjQ0NEMxODcuMzc5IDI5LjA0MiAxODcuMTIyIDI5LjQ2NyAxODYuNTk1IDI5LjgzOUMxODYuMDQzIDMwLjIyNiAxODUuMjM3IDMwLjQyNSAxODQuMjAxIDMwLjQyNUMxODMuMTY2IDMwLjQyNSAxODIuMzk0IDMwLjE3NCAxODEuNzQ5IDI5LjY3NEMxODEuMTEzIDI5LjE4MSAxODAuNzcyIDI4LjU4OSAxODAuNzEgMjcuODY0TDE4MC42ODUgMjcuNTgySDE3Ni4wMTNMMTc2LjAyNSAyNy45MDFDMTc2LjA2NyAyOS4wOTU1IDE3Ni40NzIgMzAuMjQ4NyAxNzcuMTg4IDMxLjIwNkMxNzcuOTA3IDMyLjE4IDE3OC44OTMgMzIuOTU4IDE4MC4xMTggMzMuNTE5QzE4MS4zMzYgMzQuMDc3IDE4Mi43MzIgMzQuMzYyIDE4NC4yNjYgMzQuMzYyQzE4NS44MDEgMzQuMzYyIDE4Ny4xMDkgMzQuMTA4IDE4OC4yMzggMzMuNjA5QzE4OS4zNzYgMzMuMTA0IDE5MC4yNzIgMzIuMzk0IDE5MC45MDEgMzEuNDk0QzE5MS41MzQgMzAuNTkyIDE5MS44NTMgMjkuNTU0IDE5MS44NTMgMjguNDAzQzE5MS44MjggMjcuMTEgMTkxLjQ2NiAyNi4wNTMgMTkwLjc3NyAyNS4yNjJIMTkwLjc4N1oiIGZpbGw9IiM5QjlCOUIiLz4KPHBhdGggZD0iTTI0MS45ODIgMjUuNjU4MlYxNy43MTE3SDIyOC40NDFMMjIwLjQ5NCAyNS42NTgySDI0MS45ODJaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNTcuMjM5IDUuOTUwODFIMjQwLjI2NUwyMzIuMjU1IDEzLjg5NzNIMjU3LjIzOVY1Ljk1MDgxWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjEyLjYxMSAzMy42MDQ4TDIxNi42OCAyOS41MzYxSDIzMC40MTJWMzcuNDgyN0gyMTIuNjExVjMzLjYwNDhaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yMTUuNTk5IDIxLjc4MDNIMjI0LjM3MkwyMzIuMzgyIDEzLjgzMzdIMjE1LjU5OVYyMS43ODAzWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjA2IDMzLjYwNDdIMjEyLjYxMUwyMjAuNDk0IDI1LjY1ODJIMjA2VjMzLjYwNDdaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNDAuMjY1IDUuOTUwODFMMjM2LjE5NyAxMC4wMTk0SDIxMC4yNTlWMi4wNzI4OEgyNDAuMjY1VjUuOTUwODFaIiBmaWxsPSIjOUI5QjlCIi8+Cjwvc3ZnPgo=",width:170,height:25,right:25,bottom:50,opacity:.7}}));const h={...t.chartOptions.specialOverrides},u={...t.chartOptions.optionMetadata},d=this.factoryApi.create(l,a,h,u);await d.setState(r),d.chart?.ctx.zoomManager.updateZoom("chartProxy",t.ctx.zoomManager.getZoom()),d.chart?.ctx.legendManager.clearData(),d.chart?.ctx.legendManager.update(t.ctx.legendManager.getData()),t.series.forEach((e,t)=>{d.chart.series[t].visible=e.visible});const p=[];for(const e of t.modulesManager.legends())p.push(e.legend.pagination?.currentPage??0);for(const e of d.chart.modulesManager.legends()){const t=p.shift()??0;e.legend.pagination&&e.legend.pagination.setPage(t)}return d.chart?.update(0,{forceNodeDataRefresh:!0}),await d.waitForUpdate(),d}getEnabledOriginators(){if(!this.chart)return[];const{chartOptions:{processedOptions:e,optionMetadata:t},ctx:{annotationManager:i,chartTypeOriginator:n,zoomManager:s,legendManager:r}}=this.chart,o=[];return"annotations"in e&&e.annotations?.enabled&&o.push(i),"price-volume"===t.presetType&&o.push(n),(e.navigator?.enabled||e.zoom?.enabled)&&o.push(s),"legend"in this.chart&&o.push(r),o}async setStateOriginators(e,t){this.factoryApi.caretaker.restore(e,...t),this.chart?.ctx.updateService.update(2,{forceNodeDataRefresh:!0}),await(this.chart?.waitForUpdate())}};yh.chartInstances=new WeakMap,a([li({oldValue(e){e.destroyed||(e.publicApi=void 0),yh.chartInstances.delete(e)},newValue(e){e&&(e.publicApi=this,yh.chartInstances.set(e,this))}})],yh.prototype,"chart",2);var vh=yh,bh=class extends l{constructor(e){super(),this.ctx=e,this.localeText=void 0}};a([ci(e=>{e.ctx.localeManager.setLocaleText(e.localeText)}),Te],bh.prototype,"localeText",2),a([ci(e=>{e.ctx.localeManager.setLocaleTextFormatter(e.getLocaleText)}),Te],bh.prototype,"getLocaleText",2);var Ch={type:"root",optionsKey:"locale",packageType:"community",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:e=>new bh(e)};function wh(e,t,i){if(null==i||0===i[0]&&1===i[1])return{ticks:e,count:e.length};const s=(0,n.qE)(0,Math.floor(i[0]*e.length),e.length),r=(0,n.qE)(0,Math.ceil(i[1]*e.length),e.length),o=t?e.length-r:s,a=t?e.length-s:r;return{ticks:e.slice(o,a),count:e.length}}var Sh=class e extends to{constructor(){super(...arguments),this.type="band",this.index=void 0,this._domain=[]}static is(t){return t instanceof e}set domain(e){this._domain!==e&&(this.invalid=!0,this._domain=e,this.index=void 0)}get domain(){return this._domain}get bands(){return this._domain}normalizeDomains(...e){let t;const i=new Set;let n=!0;for(const s of e)i.has(s)||(i.add(s),null==t?t=xh(s):(n&&(n=Eh(s,t)),t=xh([...t,...s])));return t??(t=[]),{domain:t,animatable:n}}toDomain(e){}invert(e,t=!1){this.refresh();const i=t?this.bandwidth/2:0,n=this.invertNearestIndex(Math.max(0,e-i));return t||e===this.ordinalRange(n)?this.domain[n]:void 0}ticks(e,t=this.domain,i){return wh(t,!1,i)}findIndex(e){let{index:t}=this;if(null==t){const{domain:e}=this;t=new Map;for(let i=0;i<e.length;i++)t.set(Zr(e[i]),i);this.index=t}return t.get(Zr(e))}};function xh(e){let t;const i=new Set;for(const n of e){const s=Zr(n),r=i.size;i.add(s),i.size!==r?t?.push(n):t??(t=e.slice(0,i.size))}return t??e}function Eh(e,t){let i=-1;for(const n of e){const e=t.indexOf(n);if(-1===e)i=1/0;else{if(e<=i)return!1;i=e}}return!0}var Ah=class e extends Kl{constructor(e,t=new Sh){super(e,t),this.groupPaddingInner=.1,this.includeInvisibleDomains=!0,this.nice=!1}static is(t){return t instanceof e}normaliseDataDomain(e){return{domain:e,clipped:!1}}updateScale(){super.updateScale();let{paddingInner:e,paddingOuter:t}=this;if(!(0,n.Bf)(e)||!(0,n.Bf)(t)){const i=this.reduceBandScalePadding();e??(e=i.inner),t??(t=i.outer)}this.scale.paddingInner=e??0,this.scale.paddingOuter=t??0}reduceBandScalePadding(){return this.boundSeries.reduce((e,t)=>{const i=t.getBandScalePadding?.();return i&&(e.inner>i.inner&&(e.inner=i.inner),e.outer<i.outer&&(e.outer=i.outer)),e},{inner:1/0,outer:-1/0})}};Ah.className="CategoryAxis",Ah.type="category",a([Te],Ah.prototype,"groupPaddingInner",2),a([Te],Ah.prototype,"paddingInner",2),a([Te],Ah.prototype,"paddingOuter",2);var Mh=Ah,Th=class e extends Sh{static is(t){return t instanceof e}normalizeDomains(...e){const{domain:t}=super.normalizeDomains(...e);return{domain:t,animatable:!1}}findIndex(e){return super.findIndex(e)??this.getMatchIndex(e)}getMatchIndex(e){const t=JSON.stringify(e),i=this._domain.find(e=>JSON.stringify(e)===t);if(null!=i)return super.findIndex(i)}};function Dh(e){if(0===e.length)return null;let t=1/0,i=-1/0;for(const n of e){const e=n instanceof Date?n.getTime():n;"number"==typeof e&&(e<t&&(t=e),e>i&&(i=e))}const n=[t,i];return n.every(isFinite)?n:null}function Ih(e,t,i){let n=!1;return e.length>2&&(e=Dh(e)??[NaN,NaN]),null!=t&&(n||(n=t>e[0]),e=[t,e[1]]),null!=i&&(n||(n=i<e[1]),e=[e[0],i]),e[0]>e[1]&&(e=[]),{extent:e,clipped:n}}var Rh=new WeakMap;function kh(e,t){const i=JSON.stringify(e,null,0);return Rh.has(t)||Rh.set(t,new Map),Rh.get(t)?.has(i)||Rh.get(t)?.set(i,t(e)),Rh.get(t)?.get(i)}function Ph(e,t){const i=new Map,n={},s=new WeakMap;return(...r)=>{const o=0===r.length?[n]:((...e)=>e.map(e=>"object"==typeof e||"symbol"==typeof e?e:(i.has(e)||i.set(e,{v:e}),i.get(e))))(...r);let a=s;for(const e of o.slice(0,-1))a.has(e)||a.set(e,new WeakMap),a=a.get(e);const l=o.at(-1);let c=a.get(l);return c?t?.("hit",e,r):(c=e(...r),a.set(l,c),t?.("miss",e,r)),c}}function _h(e,t=[0,0]){for(const i of e)"number"==typeof i&&(i<0&&(t[0]+=i),i>0&&(t[1]+=i));return t}function Lh(e,t){return{id:e,matchGroupIds:[t],type:"aggregate",aggregateFunction:e=>_h(e)}}function Nh(e,t){return{id:e,type:"aggregate",matchGroupIds:t?[t]:void 0,aggregateFunction:e=>_h(e),groupAggregateFunction:(e,t=[0,0])=>(t[0]+=e?.[0]??0,t[1]+=e?.[1]??0,t)}}function Oh(e){return{id:e,type:"aggregate",aggregateFunction:()=>[0,1],groupAggregateFunction:(e,t=[0,0])=>(t[0]+=e?.[0]??0,t[1]+=e?.[1]??0,t)}}function Fh(e,t){return{id:e,matchGroupIds:t?[t]:void 0,type:"aggregate",aggregateFunction:e=>_h(e),groupAggregateFunction:(e,t=[0,0,-1])=>(t[0]+=e?.[0]??0,t[1]+=e?.[1]??0,t[2]++,t),finalFunction:(e=[0,0,0])=>{const t=e[0]+e[1];return t>=0?[0,t/e[2]]:[t/e[2],0]}}}function Gh(e,t,i){const n={id:e,matchGroupIds:i?[i]:void 0,type:"aggregate",aggregateFunction:(e,i=[])=>{const n=i[1]-i[0];return t.aggregateFunction(e).map(e=>e/n)}};return t.groupAggregateFunction&&(n.groupAggregateFunction=t.groupAggregateFunction),n}function Bh(e){return()=>{let t=0;return i=>(0,n.Bf)(i)?(t+=e?Math.max(0,i):i,t):i}}function Vh(){return()=>{let e=0;return t=>{if(!(0,n.Bf)(t))return t;const i=e;return e+=t,i}}}function Hh(e){return null!=e&&nl(e)}function Uh(e){return null!=e}function zh(e){switch(e){case"number":case"log":case"ordinal-time":case"unit-time":case"time":case"color":return Hh;default:return Uh}}function Wh(e){switch(e){case"number":case"log":case"time":case"color":return"range";default:return"category"}}function jh(e,t,i={}){return{property:e,type:"key",valueType:Wh(t),validation:zh(t),...i}}function $h(e,t,i={}){return{property:e,type:"value",valueType:Wh(t),validation:zh(t),...i}}function Kh(e,t={}){return{property:e,type:"value",valueType:"range",missingValue:1,processor:()=>()=>1,...t}}var Yh=function(e){return e};function qh(...e){const t=e.filter(e=>null!=e);return 0===t.length?()=>Yh:1===t.length?t[0]:()=>{const e=t.map(e=>e());return(t,i)=>e.reduce((e,t)=>t(e,i),t)}}function Xh(e,t={}){const{min:i=-1/0,max:s=1/0,processor:r,...o}=t;return{type:"value",property:e,valueType:"range",validation:Hh,processor:qh(r,()=>e=>(0,n.Bf)(e)?(0,n.qE)(i,e,s):e),...o}}function Zh(e,t,i={}){const{onlyPositive:n,processor:s,...r}=i;return{...$h(e,t,r),processor:qh(s,Bh(n))}}function Qh(e,t,i={}){return{...$h(e,t,i),processor:Vh()}}function Jh(e,t,i,n,s){return[$h(e,s,n),du(n.groupId,t,i,n.separateNegative),...null!=n.rangeId?[(r=n.rangeId,o=n.groupId,{id:r,matchGroupIds:[o],type:"aggregate",aggregateFunction:e=>ko.extendDomain(e)})]:[]];var r,o}function eu(e,t,i){return[$h(e,t,i),gu(i.groupId)]}var tu={type:"reducer",property:"smallestKeyInterval",initialValue:1/0,reducer:()=>{let e=NaN;return(t=1/0,i)=>{const n="number"==typeof i[0]?i[0]:Number(i[0]),s=Math.abs(n-e);return e=n,!isNaN(s)&&s>0&&s<t?s:t}}},iu={type:"reducer",property:"largestKeyInterval",initialValue:-1/0,reducer:()=>{let e=NaN;return(t=-1/0,i)=>{const n="number"==typeof i[0]?i[0]:Number(i[0]),s=Math.abs(n-e);return e=n,!isNaN(s)&&s>0&&s>t?s:t}}},nu={type:"processor",property:"sortedGroupDomain",calculate:({domain:{groups:e}})=>e?.slice().sort((e,t)=>{for(let i=0;i<e.length;i++){const n=e[i]-t[i];if(0!==n)return n}return 0})};function su({normaliseTo:e}){const t=(t,i)=>{if(0===i)return null;const n=(t??0)*e/i;return n>=0?Math.min(e,n):Math.max(-e,n)};return()=>()=>(e,i,n)=>{const s=function(e,t,i){const n=[0,0];for(const s of t){const t=e[s];for(const e of i.datumIndices[s]??[]){const i=t[e];if(null==i)continue;const s="number"==typeof i?i:Math.max(...i.map(e=>e??0)),r=s<0?0:1;n[r]=0===r?Math.min(n[r],s):Math.max(n[r],s)}}return Math.max(Math.abs(n[0]),n[1])}(e,i,n);for(const r of i)for(const i of n.datumIndices[r]??[]){const n=e[r],o=n[i];n[i]=null!=o?"number"==typeof o?t(o,s):o.map(e=>t(e,s)):void 0}}}function ru(e,t){return{type:"group-value-processor",matchGroupIds:e,adjust:kh({normaliseTo:t},su)}}function ou({normaliseTo:e,zeroDomain:t,rangeMin:i,rangeMax:n}){const s=e[1]-e[0],r=(i,n,r)=>{const o=e[0]+(i-n)/r*s;return 0===r?t:o>=e[1]?e[1]:o<e[0]?e[0]:o};return()=>(t,s)=>{let[o,a]=t.domain.values[s];null!=i&&(o=i),null!=n&&(a=n);const l=a-o;t.domain.values[s]=[e[0],e[1]];const c=t.columns[s];for(let e=0;e<c.length;e+=1)c[e]=r(c[e],o,l)}}function au(e,t,i,n,s){return{type:"property-value-processor",property:e,adjust:kh({normaliseTo:t,rangeMin:n,rangeMax:s,zeroDomain:i},ou)}}function lu(e,t,i,n){let s=3;if("category"===t.valueType)return i.length<e&&(s&=-2),s;let r=n[0]?.valueOf();for(let e=1;0!==s&&e<n.length;e++){const t=n[e]?.valueOf();(!Number.isFinite(t)||r>t)&&(s&=-3),Number.isFinite(t)&&r===t&&(s&=-2),r=t}return s}function cu(e){return{type:"processor",property:"animationValidation",calculate(t){const{keys:i,values:n}=t.defs,{input:{count:s},domain:{keys:r,values:o},keys:a,columns:l}=t;let c=3;if(0!==s){for(let e=0;0!==c&&e<i.length;e++)for(const t of i[e].scopes)c&=lu(s,i[e],r[e],a[e].get(t));for(let t=0;0!==c&&t<n.length;t++){const i=n[t];e?.includes(i.id)&&(c&=lu(s,i,o[t],l[t]))}}return{uniqueKeys:!!(1&c),orderedKeys:!!(2&c)}}}}function hu({mode:e,separateNegative:t}){return()=>()=>(i,s,r)=>{const o=[0,0];for(const a of s)for(const s of r.datumIndices[a]??[]){const r=i[a],l=r[s],c=(0,n.cI)(l)&&t?0:1;(0,n.Bf)(l)&&("normal"===e&&(o[c]+=l),r[s]=o[c],"trailing"===e&&(o[c]+=l))}}}function uu({mode:e,sum:t}){return()=>{const i=[];let s=!0;return()=>(r,o,a)=>{let l=0;for(const c of o){const o=r[c];for(const r of a.datumIndices[c]??[]){const a=o[r],h=s&&"current"===t?0:i[c];i[c]=a;const u="current"===t?a:h;(0,n.Bf)(a)&&(0,n.Bf)(h)?("normal"===e&&(l+=u),o[r]=l,"trailing"===e&&(l+=u)):o[r]=l}}s=!1}}}function du(e,t,i,n=!1){let s;return s=t.startsWith("window")?kh({mode:t.endsWith("-trailing")?"trailing":"normal",sum:i},uu):kh({mode:t,separateNegative:n},hu),{type:"group-value-processor",matchGroupIds:[e],adjust:s}}function pu(){return()=>(e,t,i)=>{const n=new Float64Array(t.length);let s=0;for(const r of t){const t=e[r];for(const e of i.datumIndices[r]??[]){const i=t[e];n[s]=Number.isFinite(i)?i:NaN,s+=1,t[e]=n.subarray(0,s)}}}}function gu(e){return{type:"group-value-processor",matchGroupIds:[e],adjust:pu}}function fu(e){return e.id??e.property}function mu(e,t,i,n,s){for(const{previousIndex:r,nextIndex:o}of i){const i=e[r],a=t[o];if(i[n]!==a[s])return!1}return!0}function yu(e,t,i=!0){return{type:"processor",property:"diff",calculate(n,s){const r=new Map,o=new Map,a=new Map,l=new Map,c=t.keys,h=n.keys,u=t.columns,d=n.columns,p=function(e,t,i){const n=new Map,s=t.defs.values;for(let t=0;t<s.length;t+=1){const i=s[t];if(!1===i.scopes?.includes(e))continue;const r=fu(i);if(n.has(r))return;n.set(r,t)}const r=[],o=i.defs.values;for(let t=0;t<o.length;t+=1){const i=o[t];if(!1===i.scopes?.includes(e))continue;const s=fu(i),a=n.get(s);if(null==a)return;n.delete(s),r.push({previousIndex:a,nextIndex:t})}if(0===n.size)return r}(e,t,n);if(null==p)return s;const g=Math.max(t.input.count,n.input.count);for(let s=0;s<g;s++){const g=s<t.input.count,f=s<n.input.count,m=g?Bo(c,e,s):void 0,y=null!=m?vu(m):"",v=f?Bo(h,e,s):void 0,b=null!=v?vu(v):"";if(f&&g&&y===b){mu(u,d,p,s,s)||a.set(b,s);continue}const C=l.get(b);null!=C?(!i&&mu(u,d,p,C,s)||(a.set(b,s),r.set(b,s)),l.delete(b)):f&&o.set(b,s);const w=o.get(y);null!=w?(!i&&mu(u,d,p,w,s)||(a.set(y,s),r.set(y,s)),o.delete(y)):g&&(a.delete(y),l.set(y,s))}const f={changed:o.size>0||a.size>0||l.size>0,added:new Set(o.keys()),updated:new Set(a.keys()),removed:new Set(l.keys()),moved:new Set(r.keys())};return{...s,[e]:f}}}}function vu(e,...t){let i;return i=(0,n.cy)(e)?e.map(e=>sl(e)).join("___"):sl(e),("string"==typeof i||"number"==typeof i||"boolean"==typeof i||i instanceof Date)&&t.length>0&&(i+=`___${t.join("___")}`),i}var bu=class{constructor(){this.top=1/0,this.right=-1/0,this.bottom=-1/0,this.left=1/0}update(e,t){e>this.right&&(this.right=e),e<this.left&&(this.left=e),t>this.bottom&&(this.bottom=t),t<this.top&&(this.top=t)}},Cu=class e{constructor(e="",t,i){this.label=e,this.parent=t,this.refId=i,this.position=0,this.subtreeLeft=NaN,this.subtreeRight=NaN,this.children=[],this.leafCount=0,this.prelim=0,this.mod=0,this.ancestor=this,this.change=0,this.shift=0,this.index=0,this.screen=0,this.depth=t?t.depth+1:0}insertTick(t,i){let n=this;for(let s=0;s<t.length;s++){const r=t[s],o=s!==t.length-1,{children:a}=n,l=a.find(e=>e.label===r);if(l&&o)n=l;else{const t=new e(r,n,i);t.index=a.length,a.push(t),o&&(n=t)}}}getLeftSibling(){return this.index>0?this.parent?.children[this.index-1]:void 0}getLeftmostSibling(){return this.index>0?this.parent?.children[0]:void 0}nextLeft(){return this.children[0]}nextRight(){return this.children.at(-1)}getSiblings(){return this.parent?.children.filter((e,t)=>t!==this.index)??[]}};function wu(e,t,i){const n=i/(t.index-e.index);t.change-=n,t.shift+=i,e.change+=n,t.prelim+=i,t.mod+=i}function Su(e,t,i){return t.getSiblings().indexOf(e.ancestor)>=0?e.ancestor:i}function xu(e,t){const i=e.getLeftSibling();if(i){let n=e,s=e,r=i,o=s.getLeftmostSibling(),a=s.mod,l=n.mod,c=r.mod,h=o.mod;for(;r.nextRight()&&s.nextLeft();){r=r.nextRight(),s=s.nextLeft(),o=o.nextLeft(),n=n.nextRight(),n.ancestor=e;const i=r.prelim+c-(s.prelim+a)+1;i>0&&(wu(Su(r,e,t),e,i),a+=i,l+=i),c+=r.mod,a+=s.mod,h+=o.mod,l+=n.mod}r.nextRight()&&!n.nextRight()?n.mod+=c-l:(s.nextLeft()&&!o.nextLeft()&&(o.mod+=a-h),t=e)}return t}function Eu(e){const{children:t}=e;if(t.length){let[i]=t;for(const e of t)Eu(e),i=xu(e,i);!function({children:e}){let t=0,i=0;for(let n=e.length-1;n>=0;n--){const s=e[n];s.prelim+=t,s.mod+=t,i+=s.change,t+=s.shift+i}}(e);const n=(t[0].prelim+t.at(-1).prelim)/2,s=e.getLeftSibling();s?(e.prelim=s.prelim+1,e.mod=e.prelim-n):e.prelim=n}else{const t=e.getLeftSibling();e.prelim=t?t.prelim+1:0}}function Au(e,t,i){e.position=e.prelim+t,i.insertNode(e);for(const n of e.children)Au(n,t+e.mod,i)}function Mu(e){const{children:t}=e;let i=0;for(const e of t)Mu(e),e.children.length?i+=e.leafCount:i++;e.leafCount=i,t.length?(e.subtreeLeft=t[0].subtreeLeft,e.subtreeRight=t[t.length-1].subtreeRight,e.position=(e.subtreeLeft+e.subtreeRight)/2):(e.subtreeLeft=e.position,e.subtreeRight=e.position)}function Tu(e){const t=new Du,i=function(e){const t=e.reduce((e,t)=>e<t.length?t.length:e,0),i=new Cu;for(let n=0;n<e.length;n++){const s=e[n];for(;s.length<t;)s.push("");i.insertTick(s,n)}return i}(e);return Eu(i),Au(i,-i.prelim,t),Mu(i),t}var Du=class{constructor(){this.dimensions=new bu,this.nodes=[],this.depth=0}insertNode(e){this.depth<e.depth&&(this.depth=e.depth),this.dimensions.update(e.position,e.depth),this.nodes.push(e)}scaling(e,t){let i=1;if(e>0){const{left:t,right:n}=this.dimensions;n!==t&&(i=e/(n-t))}return t&&(i*=-1),i}},Iu=class extends De{constructor(){super(...arguments),this.enabled=!0}};a([Te],Iu.prototype,"enabled",2),a([Te],Iu.prototype,"avoidCollisions",2),a([Te],Iu.prototype,"color",2),a([Te],Iu.prototype,"spacing",2),a([Te],Iu.prototype,"rotation",2),a([Te],Iu.prototype,"fontStyle",2),a([Te],Iu.prototype,"fontWeight",2),a([Te],Iu.prototype,"fontSize",2),a([Te],Iu.prototype,"fontFamily",2);var Ru=class extends De{constructor(){super(...arguments),this.enabled=!0}};a([Te],Ru.prototype,"enabled",2),a([Te],Ru.prototype,"width",2),a([Te],Ru.prototype,"stroke",2);var ku=class extends De{constructor(){super(...arguments),this.label=new Iu,this.tick=new Ru}};a([Te],ku.prototype,"label",2),a([Te],ku.prototype,"tick",2);var Pu=class extends Mh{constructor(e){super(e,new Th),this.tickScale=new Th,this.depthOptions=new Ie(ku),this.includeInvisibleDomains=!0,this.tickScale.paddingInner=1,this.tickScale.paddingOuter=0}resizeTickTree(){if(!this.tickTreeLayout)return;const{nodes:e}=this.tickTreeLayout,{range:t,step:i,inset:n,bandwidth:s}=this.scale,r=Math.abs(t[1]-t[0])-i,o=this.tickTreeLayout.scaling(r,t[0]>t[1]),a=n+s/2;let l=0;for(const t of e){const e=t.position*o;l>e&&(l=e),t.screen=e+a}for(const t of e)t.screen-=l}getDepthOptionsMap(e){const t=[],{depthOptions:i,label:n}=this,s=this.horizontal?0:-90;for(let r=0;r<e;r++)t.push(i[r]?.label.enabled??n.enabled?{enabled:!0,spacing:i[r]?.label.spacing??n.spacing,rotation:i[r]?.label.rotation??(r?s:n.rotation),avoidCollisions:i[r]?.label.avoidCollisions??n.avoidCollisions}:{enabled:!1,spacing:0,rotation:0,avoidCollisions:!1});return t}updateCategoryLabels(){this.computedLayout&&this.tickLabelGroupSelection.update(this.computedLayout.tickLabelLayout).each((e,t)=>e.setProperties(t))}updateAxisLine(){this.computedLayout&&(this.lineNode.visible=this.line.enabled,this.lineNode.stroke=this.line.stroke,this.lineNode.strokeWidth=this.line.width)}computeLayout(){if(this.updateDirection(),this.updateScale(),this.resizeTickTree(),!this.tickTreeLayout?.depth)return{bbox:m.zero,spacing:0,separatorLayout:[],tickLabelLayout:[]};const{step:e}=this.scale,{title:t,label:i,range:s,depthOptions:r,horizontal:o}=this,{depth:a,nodes:l}=this.tickTreeLayout,c=Math.ceil(i.fontSize/e),h=o?-i.getSideFlag():i.getSideFlag(),u=[],d=new Map,p=new Ni,g=this.getDepthOptionsMap(a),f=h*g[0].spacing,y=(e,t)=>{const l=a-e.depth;if(!g[l]?.enabled||t%c!==0||!(0,n.r4)(e.screen,s))return!1;const h=this.formatTick(e.label,t-1,this.scale.domain),u=this.getLabelStyles({value:h,depth:l},r[l]?.label);return p.setProperties({...u,text:h,textAlign:"center",textBaseline:i.parallel?"hanging":"bottom",lineHeight:Ri.getLineHeight(u.fontSize),x:o?e.screen:f,y:o?f:e.screen,rotation:0}),!0},v={};l.forEach((e,t)=>{const i=a-e.depth;if(!y(e,t)||!p.getBBox())return;d.set(t,p.getBBox()),p.rotation=ue(g[i]?.rotation);const{width:n,height:s}=p.getBBox(),r=o?s:n;v[i]??(v[i]=0),v[i]<r&&(v[i]=r)});const b=zl(),C=new Map;l.forEach((t,n)=>{if(0===n)return;const s=y(t,n),r=!t.children.length,l=a-t.depth;if(t.parent){const e=r?t.position:t.position-(t.leafCount-1)/2;if(!C.has(e)){const t=this.depthOptions[l]?.tick;let i=v[0];for(let e=0;e<=l;e++)i+=g[e].spacing,0!==e&&(i+=v[e]);C.set(e,{tickSize:i,tickStroke:t?.stroke,tickWidth:!1!==t?.enabled?t?.width:0})}}if(!s)return;const c=ue(g[l].rotation),{width:f,height:m}=d.get(n),w=(e=>{if(0===e)return 0;let t=v[0];for(let i=1;i<=e;i++)t+=g[i].spacing,i!==e&&(t+=v[i]);return t})(l);if(p.textAlign="end",p.textBaseline="middle",p.rotation=c,o?(p.x+=f/2,p.y+=(w+he(f/2,m/2,c))*h,p.rotationCenterX=t.screen,p.rotationCenterY=p.y):(p.x+=w*h+he((g[l].spacing*h+f)/2,i.mirrored?f:0,c),p.rotationCenterX=p.x-f/2,p.rotationCenterY=t.screen),g[l].avoidCollisions){const{width:i,height:s}=p.getBBox();if((o?i:s)>(r?e:t.leafCount*e))return void d.delete(n)}const{text:S=""}=p;u.push({text:S,visible:!0,range:this.scale.range,tickId:b(S),fill:p.fill,fontFamily:p.fontFamily,fontSize:p.fontSize,fontStyle:p.fontStyle,fontWeight:p.fontWeight,rotation:p.rotation,rotationCenterX:p.rotationCenterX,rotationCenterY:p.rotationCenterY,textAlign:p.textAlign,textBaseline:p.textBaseline,x:p.x,y:p.y}),d.set(n,St.toCanvas(p))});const{enabled:w,stroke:S,width:x}=this.line;this.lineNode.datum=o?{x1:s[0],x2:s[1],y1:0,y2:0}:{x1:0,x2:0,y1:s[0],y2:s[1]},this.lineNode.setProperties({stroke:S,strokeWidth:w?x:0});const E=[...C.values()];E.push(E[0]);const A=[this.lineNodeBBox(),m.merge(d.values()),new m(0,0,E[0].tickSize*h,0)];let M=0;if(t.enabled){const e=m.merge(A);M=o?e.height:e.width,A.push(this.titleBBox(this.scale.domain,M))}return{bbox:m.merge(A),spacing:M,separatorLayout:E,tickLabelLayout:u}}update(){if(!this.computedLayout)return;this.moduleCtx.animationManager.skipCurrentBatch();const{tickScale:e,tick:t,gridLine:i,gridLength:n}=this,{separatorLayout:s,spacing:r}=this.computedLayout,{position:o,horizontal:a,gridPadding:l}=this,c="bottom"===o||"right"===o?-1:1,h=l,u=c*n-l,d=e.ticks({nice:!1,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0}).ticks.map((t,i)=>({tickId:vu(t,i),offset:Math.round(e.convert(t))}));this.gridLineGroupSelection.update(i.enabled&&n?d.map(({tickId:e,offset:t},n)=>{const[s,r,o,l]=a?[t,t,h,u]:[h,u,t,t],{style:c,width:d}=i,{stroke:p,lineDash:g}=c[n%c.length]??{};return{tickId:e,offset:t,x1:s,y1:o,x2:r,y2:l,stroke:p,strokeWidth:d,lineDash:g}}):[]),this.tickLineGroupSelection.update(t.enabled?d.map(({tickId:e,offset:i},n)=>{const{tickSize:r=this.getTickSize(),tickStroke:o=t.stroke,tickWidth:l=t.width}=s[n]??{},h=-c*r,[u,d,p,g]=a?[i,i,0,h]:[0,h,i,i];return{tickId:e,offset:i,x1:u,y1:p,x2:d,y2:g,stroke:o,strokeWidth:l,lineDash:void 0}}):[]),this.updatePosition(),this.updateCategoryLabels(),this.updateAxisLine(),this.updateGridLines(),this.updateTickLines(),this.updateTitle(this.scale.domain,r),this.resetSelectionNodes()}calculateLayout(){const{separatorLayout:e,tickLabelLayout:t,spacing:i,bbox:n}=this.computeLayout();return this.computedLayout={separatorLayout:e,tickLabelLayout:t,spacing:i},{bbox:n,niceDomain:this.scale.domain}}onGridVisibilityChange(){this.gridLineGroupSelection.clear(),this.tickLabelGroupSelection.clear()}updateScale(){super.updateScale(),this.tickScale.range=this.scale.range,this.scale.paddingOuter=this.scale.paddingInner/2}processData(){const{direction:e}=this,t=this.boundSeries.filter(e=>e.visible).flatMap(t=>t.getDomain(e));this.dataDomain={domain:Dh(t)??this.filterDuplicateArrays(t),clipped:!1},this.isReversed()&&this.dataDomain.domain.reverse();const i=this.dataDomain.domain.map(e=>(0,n.$r)((0,n.Gv)(e)&&"value"in e?e.value:e));this.tickTreeLayout=Tu(i);const s=[];for(const e of this.tickTreeLayout.nodes)e.leafCount||null==e.refId||s.push(this.dataDomain.domain[e.refId]);this.scale.domain=(0,n.EG)(this.dataDomain.domain,s),this.tickScale.domain=i.concat([[""]])}filterDuplicateArrays(e){const t=new Set;return e.filter(e=>{const i=(0,n.cy)(e)?JSON.stringify(e):e;return!t.has(i)&&(t.add(i),!0)})}};Pu.className="GroupedCategoryAxis",Pu.type="grouped-category",a([Te],Pu.prototype,"depthOptions",2);var _u={2:(e,t)=>Math.log2(t),[Math.E]:(e,t)=>Math.log(t),10:(e,t)=>Math.log10(t)},Lu=(e,t)=>Math.log(t)/Math.log(e);function Nu(e,t,i){const n=Math.min(...t),s=_u[e]??Lu;return n>=0?s(e,i):-s(e,-i)}var Ou={[Math.E]:(e,t)=>Math.exp(t),10:(e,t)=>t>=0?10**t:1/10**-t},Fu=(e,t)=>e**t;function Gu(e,t,i){const n=Math.min(...t),s=Ou[e]??Fu;return n>=0?s(e,i):-s(e,-i)}var Bu=class e extends cr{constructor(e=[1,10],t=[0,1]){super(e,t),this.type="log",this.defaultClamp=!0,this.base=10,this.log=e=>Nu(this.base,this.domain,e),this.pow=e=>Gu(this.base,this.domain,e)}static is(t){return t instanceof e}toDomain(e){return e}transform(e){const[t,i]=or(this.domain);return t>=0!=i>=0?NaN:t>=0?Math.log(e):-Math.log(-e)}transformInvert(e){const[t,i]=or(this.domain);return t>=0!=i>=0?NaN:t>=0?Math.exp(e):-Math.exp(-e)}niceDomain(e,t=this.domain){if(t.length<2)return[];const{base:i}=this,[n,s]=t,r=n>s?Math.ceil:Math.floor,o=n>s?Math.floor:Math.ceil;return[Gu(i,t,r(Nu(i,t,n))),Gu(i,t,o(Nu(i,t,s)))]}ticks({interval:e,tickCount:t=cr.defaultTickCount},i=this.domain,s){if(!i||i.length<2||t<1)return;const r=this.base,[o,a]=i,l=Math.min(o,a),c=Math.max(o,a);let h=this.log(l),u=this.log(c);if(e){const t=e=>e>=l&&e<=c,i=Math.min(Math.abs(e),Math.abs(u-h)),{ticks:n,count:r}=$a(h,u,i,s),o=n.map(this.pow).filter(t);if(!Ka(o.length,this.getPixelRange()))return{ticks:o,count:r}}if(!(0,n.Fq)(r)||u-h>=t){const e=Math.min(u-h,t),{ticks:i,count:n}=Ba(h,u,e,void 0,void 0,s);return{ticks:i.map(this.pow),count:n}}const d=[],p=l>0;h=Math.floor(h)-1,u=Math.round(u)+1;const g=ar(this.range)/t;let f=1/0;for(let e=h;e<=u;e++){const t=this.convert(this.pow(e+1));for(let i=1;i<r;i++){const n=p?i:r-i+1,s=this.pow(e)*n,o=this.convert(s),a=Math.abs(f-o),h=Math.abs(o-t);s>=l&&s<=c&&(1===i||a>=g&&h>=g||0===d.length)&&(d.push(s),f=o)}}return wh(d,p,s)}tickFormatter({specifier:e}){return null!=e?(0,n.OR)(e):String}datumFormatter(e){return this.tickFormatter(e)}},Vu=class e extends cr{constructor(){super([0,1],[0,1]),this.type="number"}static is(t){return t instanceof e}static getTickStep(e,t,i){const{interval:n,tickCount:s=cr.defaultTickCount,minTickCount:r,maxTickCount:o}=i;return n??za(e,t,s,r,o)}toDomain(e){return e}ticks({interval:e,tickCount:t=cr.defaultTickCount,minTickCount:i,maxTickCount:n},s=this.domain,r){if(!s||s.length<2||t<1||!s.every(isFinite))return{ticks:[],count:0};const[o,a]=s;if(e){const t=Math.abs(e);if(!Ka((a-o)/t,this.getPixelRange()))return $a(o,a,t,r)}return Ba(o,a,t,i,n,r)}niceDomain(t,i=this.domain){if(i.length<2)return[];const{tickCount:n=cr.defaultTickCount}=t;let[s,r]=i;if(1===n)[s,r]=Ya(s,r);else if(n>1){const n=s>r?Math.ceil:Math.floor,o=s>r?Math.floor:Math.ceil,a=4;for(let l=0;l<a;l++){const a=s,l=r,c=e.getTickStep(s,r,t),[h,u]=i;if(s=n(h/c)*c,r=o(u/c)*c,s===a&&r===l)break}}return[s,r]}tickFormatter({ticks:e,fractionDigits:t,specifier:i}){return null!=i?ja(e,i):e=>Gn(e,t)}datumFormatter({ticks:e,fractionDigits:t,specifier:i}){return null!=i?ja(e,i):e=>Gn(e,t+1)}},Hu=class extends Kl{constructor(e,t=new Vu){super(e,t)}normaliseDataDomain(e){const{min:t,max:i}=this,{extent:n,clipped:s}=Ih(e,t,i);return{domain:n,clipped:s}}};Hu.className="NumberAxis",Hu.type="number",a([Te],Hu.prototype,"min",2),a([Te],Hu.prototype,"max",2);var Uu=class extends Hu{normaliseDataDomain(e){const{min:t,max:i}=this,{extent:s,clipped:r}=Ih(e,t,i);return s[0]<0&&s[1]>0||e[0]<0&&e[1]>0?(n.Vy.warn("The log axis domain crosses zero, the chart data cannot be rendered. See log axis documentation for more information."),{domain:[],clipped:r}):0===s[0]||0===s[1]||0===e[0]||0===e[1]?(n.Vy.warn("The log axis domain contains a value of 0, the chart data cannot be rendered. See log axis documentation for more information."),{domain:[],clipped:r}):{domain:s,clipped:r}}set base(e){this.scale.base=e}get base(){return this.scale.base}constructor(e){super(e,new Bu)}defaultDatumFormatter(e,t){return String(e)}defaultLabelFormatter(e,t){return String(e)}};Uu.className="LogAxis",Uu.type="log";var zu=class extends De{constructor(){super(...arguments),this.enabled=!1,this.label=new vl,this.tick=new Cl}};a([Te],zu.prototype,"enabled",2),a([Te],zu.prototype,"label",2),a([Te],zu.prototype,"tick",2);var Wu=class extends Kl{constructor(e){super(e,new Xa),this.parentLevel=new zu,this.min=void 0,this.max=void 0,this.groupPaddingInner=.1}get primaryLabel(){return this.parentLevel.enabled?this.parentLevel.label:void 0}get primaryTick(){return this.parentLevel.enabled?this.parentLevel.tick:void 0}normaliseDataDomain(e){return ju(e,this.min,this.max)}};function ju(e,t,i){let n=!1;return"number"==typeof t&&(t=new Date(t)),"number"==typeof i&&(i=new Date(i)),e.length>2&&(e=Dh(e)?.map(e=>new Date(e))??[]),t instanceof Date&&(n||(n=t>e[0]),e=[t,e[1]]),i instanceof Date&&(n||(n=i<e[1]),e=[e[0],i]),e[0]>e[1]&&(e=[]),{domain:e,clipped:n}}Wu.className="TimeAxis",Wu.type="time",a([Te],Wu.prototype,"parentLevel",2),a([Te],Wu.prototype,"min",2),a([Te],Wu.prototype,"max",2),a([Te],Wu.prototype,"groupPaddingInner",2),a([Te],Wu.prototype,"paddingInner",2),a([Te],Wu.prototype,"paddingOuter",2);var $u=class extends Mh{constructor(e){super(e,new Ra),this.parentLevel=new zu,this.min=void 0,this.max=void 0}get primaryLabel(){return this.parentLevel.enabled?this.parentLevel.label:void 0}get primaryTick(){return this.parentLevel.enabled?this.parentLevel.tick:void 0}updateScale(){super.updateScale(),this.scale.interval=this.unit}normaliseDataDomain(e){return ju(e,this.min,this.max)}};$u.className="UnitTimeAxis",$u.type="unit-time",a([Te],$u.prototype,"parentLevel",2),a([Te],$u.prototype,"min",2),a([Te],$u.prototype,"max",2),a([Te],$u.prototype,"unit",2);var Ku=(e,{x0:t,y0:i,x1:n,y1:s,cx:r,cy:o},a,l)=>{if(l&&e.moveTo(t,i),t!==n||i!==s){const l=Math.atan2(i-o,t-r),c=Math.atan2(s-o,n-r);e.arc(r,o,a,l,c)}else e.lineTo(t,i)},Yu=1e-6,qu=(e,t,i,n,s)=>{let r=!1,o=!1,a=n-Math.sqrt(Math.max(s**2-i**2,0)),l=0,c=0,h=i-Math.sqrt(Math.max(s**2-n**2,0));return a>e?(r=!0,a=e,l=i-Math.sqrt(Math.max(s**2-(n-e)**2))):a<Yu&&(a=0),h>t?(o=!0,c=n-Math.sqrt(Math.max(s**2-(i-t)**2)),h=t):h<Yu&&(h=0),{leading0:a,leading1:l,trailing0:c,trailing1:h,leadingClipped:r,trailingClipped:o}},Xu=(e,t,i,n,s,r,o)=>{let{topLeft:a,topRight:l,bottomRight:c,bottomLeft:h}=r;const u=Math.max(a+h,l+c),d=Math.max(a+l,h+c);if(u<=0&&d<=0)return void(null==o?e.rect(t,i,n,s):e.rect(o.x,o.y,o.width,o.height));if(null==o&&a===l&&a===c&&a===h)return void e.roundRect(t,i,n,s,a);if(n<0&&(t+=n,n=Math.abs(n)),s<0&&(i+=s,s=Math.abs(s)),n<=0||s<=0)return;if(null==o)o=new m(t,i,n,s);else{const e=Math.max(t,o.x),r=Math.min(t+n,o.x+o.width),a=Math.max(i,o.y),l=Math.min(i+s,o.y+o.height);o=new m(e,a,r-e,l-a)}const p=Math.max(u/s,d/n,1);p>1&&(a/=p,l/=p,c/=p,h/=p);let g,f,y,v,b=!0,C=!0,w=!0,S=!0;if(b){const e=qu(o.height,o.width,Math.max(t+a-o.x,0),Math.max(i+a-o.y,0),a);e.leadingClipped&&(S=!1),e.trailingClipped&&(C=!1),g={x0:Math.max(o.x+e.leading1,o.x),y0:Math.max(o.y+e.leading0,o.y),x1:Math.max(o.x+e.trailing1,o.x),y1:Math.max(o.y+e.trailing0,o.y),cx:t+a,cy:i+a}}if(C){const e=qu(o.width,o.height,Math.max(i+l-o.y,0),Math.max(o.x+o.width-(t+n-l),0),l);e.leadingClipped&&(b=!1),e.trailingClipped&&(w=!1),f={x0:Math.min(o.x+o.width-e.leading0,o.x+o.width),y0:Math.max(o.y+e.leading1,o.y),x1:Math.min(o.x+o.width-e.trailing0,o.x+o.width),y1:Math.max(o.y+e.trailing1,o.y),cx:t+n-l,cy:i+l}}if(w){const e=qu(o.height,o.width,Math.max(o.x+o.width-(t+n-c),0),Math.max(o.y+o.height-(i+s-c),0),c);e.leadingClipped&&(C=!1),e.trailingClipped&&(S=!1),y={x0:Math.min(o.x+o.width-e.leading1,o.x+o.width),y0:Math.min(o.y+o.height-e.leading0,o.y+o.height),x1:Math.min(o.x+o.width-e.trailing1,o.x+o.width),y1:Math.min(o.y+o.height-e.trailing0,o.y+o.height),cx:t+n-c,cy:i+s-c}}if(S){const e=qu(o.width,o.height,Math.max(o.y+o.height-(i+s-h),0),Math.max(t+h-o.x,0),h);e.leadingClipped&&(w=!1),e.trailingClipped&&(b=!1),v={x0:Math.max(o.x+e.leading0,o.x),y0:Math.min(o.y+o.height-e.leading1,o.y+o.height),x1:Math.max(o.x+e.trailing0,o.x),y1:Math.min(o.y+o.height-e.trailing1,o.y+o.height),cx:t+h,cy:i+s-h}}let x=!1;b&&null!=g&&(Ku(e,g,a,!x),x||(x=!0)),C&&null!=f&&(Ku(e,f,l,!x),x||(x=!0)),w&&null!=y&&(Ku(e,y,c,!x),x||(x=!0)),S&&null!=v&&Ku(e,v,h,!x),e.closePath()},Zu=class extends Cc{constructor(){super(...arguments),this.borderPath=new Je,this.x=0,this.y=0,this.width=10,this.height=10,this.topLeftCornerRadius=0,this.topRightCornerRadius=0,this.bottomRightCornerRadius=0,this.bottomLeftCornerRadius=0,this.clipBBox=void 0,this.crisp=!1,this.lastUpdatePathStrokeWidth=ut.defaultStyles.strokeWidth,this.effectiveStrokeWidth=ut.defaultStyles.strokeWidth,this.hittester=super.isPointInPath.bind(this),this.distanceCalculator=super.distanceSquaredTransformedPoint.bind(this),this.microPixelEffectOpacity=1}set cornerRadius(e){this.topLeftCornerRadius=e,this.topRightCornerRadius=e,this.bottomRightCornerRadius=e,this.bottomLeftCornerRadius=e}isDirtyPath(){return this.lastUpdatePathStrokeWidth!==this.strokeWidth||Boolean(this.path.isDirty()||this.borderPath.isDirty())}updatePath(){const{path:e,borderPath:t,crisp:i,topLeftCornerRadius:n,topRightCornerRadius:s,bottomRightCornerRadius:r,bottomLeftCornerRadius:o}=this;let{x:a,y:l,width:c,height:h,strokeWidth:u,clipBBox:d}=this;const p=1/(this.layerManager?.canvas.pixelRatio??1);let g=1;if(e.clear(!0),t.clear(!0),i&&(c<=p&&(g*=c/p),h<=p&&(g*=h/p),c=this.align(a,c),h=this.align(l,h),a=this.align(a),l=this.align(l),d=null!=d?new m(this.align(d.x),this.align(d.y),this.align(d.x,d.width),this.align(d.y,d.height)):void 0),u)if(c<p){const e=a+p/2;t.moveTo(e,l),t.lineTo(e,l+h),u=p,this.borderClipPath=void 0}else if(h<p){const e=l+p/2;t.moveTo(a,e),t.lineTo(a+c,e),u=p,this.borderClipPath=void 0}else if(u<c&&u<h){const i=u/2;a+=i,l+=i,c-=u,h-=u;const p=d?.clone().shrink(i),g={topLeft:n>0?n-u:0,topRight:s>0?s-u:0,bottomRight:r>0?r-u:0,bottomLeft:o>0?o-u:0};this.borderClipPath=void 0,c>0&&h>0&&(null==p||p?.width>0&&p?.height>0)&&(Xu(e,a,l,c,h,g,p),Xu(t,a,l,c,h,g,p))}else this.borderClipPath=this.borderClipPath??new Je,this.borderClipPath.clear(!0),this.borderClipPath.rect(a,l,c,h),t.rect(a,l,c,h);else{const t={topLeft:n,topRight:s,bottomRight:r,bottomLeft:o};this.borderClipPath=void 0,Xu(e,a,l,c,h,t,d)}if([n,s,r,o].every(e=>0===e)){const e=this.getBBox();this.hittester=e.containsPoint.bind(e),this.distanceSquared=(e,t)=>this.getBBox().distanceSquared(e,t)}else this.hittester=super.isPointInPath,this.distanceCalculator=super.distanceSquaredTransformedPoint;this.effectiveStrokeWidth=u,this.lastUpdatePathStrokeWidth=u,this.microPixelEffectOpacity=g}computeBBox(){const{x:e,y:t,width:i,height:n,clipBBox:s}=this;return s?.clone()??new m(e,t,i,n)}isPointInPath(e,t){return this.hittester(e,t)}get midPoint(){return{x:this.x+this.width/2,y:this.y+this.height/2}}distanceSquared(e,t){return this.distanceCalculator(e,t)}applyFillAndAlpha(e){super.applyFillAndAlpha(e),e.globalAlpha*=this.microPixelEffectOpacity}applyStrokeAndAlpha(e){super.applyStrokeAndAlpha(e),e.globalAlpha*=this.microPixelEffectOpacity}renderStroke(e){const{stroke:t,effectiveStrokeWidth:i}=this;if(t&&i){const{globalAlpha:t}=e,{lineDash:n,lineDashOffset:s,lineCap:r,lineJoin:o,borderPath:a,borderClipPath:l}=this;l&&e.clip(l.getPath2D()),this.applyStrokeAndAlpha(e),e.lineWidth=i,n&&e.setLineDash(n),s&&(e.lineDashOffset=s),r&&(e.lineCap=r),o&&(e.lineJoin=o),e.stroke(a.getPath2D()),e.globalAlpha=t}}};Zu.className="Rect",a([K()],Zu.prototype,"x",2),a([K()],Zu.prototype,"y",2),a([K()],Zu.prototype,"width",2),a([K()],Zu.prototype,"height",2),a([K()],Zu.prototype,"topLeftCornerRadius",2),a([K()],Zu.prototype,"topRightCornerRadius",2),a([K()],Zu.prototype,"bottomRightCornerRadius",2),a([K()],Zu.prototype,"bottomLeftCornerRadius",2),a([Y({equals:h.equals})],Zu.prototype,"clipBBox",2),a([K()],Zu.prototype,"crisp",2);var Qu=class extends l{constructor(e){super(),this.ctx=e,this.rectNode=new Zu,this.textNode=new _i,this.fill="white",this.node=this.createNode(),this.node.append([this.rectNode,this.textNode]),this.visible=!0,this.destroyFns.push(e.scene.attachNode(this.node),e.layoutManager.addListener("layout:complete",e=>this.onLayoutComplete(e)))}createNode(){return new Mt({name:"background",zIndex:0})}onLayoutComplete(e){const{width:t,height:i}=e.chart;this.rectNode.width=t,this.rectNode.height=i}};a([Te,ai("node","visible")],Qu.prototype,"visible",2),a([Te,ai("rectNode","fill")],Qu.prototype,"fill",2),a([Te],Qu.prototype,"image",2),a([Te,ai("textNode")],Qu.prototype,"text",2);var Ju={type:"root",optionsKey:"background",packageType:"community",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:e=>new Qu(e)};function ed({orientation:e,bboxes:t,maxHeight:i,maxWidth:n,itemPaddingY:s=0,itemPaddingX:r=0,forceResult:o=!1}){const a="horizontal"===e,l={max:a?n:i,fn:a?e=>e.width:e=>e.height,padding:a?r:s},c={max:a?i:n,fn:a?e=>e.height:e=>e.width,padding:a?s:r};let h=0;const u=[];for(;h<t.length;){const e=td(t.slice(h),h,l,c,o);if(!e)return;h+=e.processedBBoxCount,u.push(e.pageIndices)}return function(e,t,i,n,s){let r=0,o=0;return{pages:e.map(e=>{"horizontal"===t&&(e=function(e){const t=[];for(const i of e[0])t.push([]);return e.forEach((e,i)=>{e.forEach((e,n)=>{t[n][i]=e})}),t}(e));let a=0;const l=e.map(e=>{const t=e.map(e=>(a=Math.max(e,a),i[e]));let r=0,o=0;return t.forEach(e=>{r+=e.height+n,o=Math.max(o,e.width+s)}),{indices:e,bboxes:t,columnHeight:Math.ceil(r),columnWidth:Math.ceil(o)}});let c=0,h=0;return l.forEach(e=>{c+=e.columnWidth,h=Math.max(h,e.columnHeight)}),r=Math.max(c,r),o=Math.max(h,o),{columns:l,startIndex:e[0][0],endIndex:a,pageWidth:c,pageHeight:h}}),maxPageWidth:r,maxPageHeight:o}}(u,e,t,s,r)}function td(e,t,i,n,s){let r=function(e,t){const i=e.length;let n=0;for(let s=0;s<i;s++)if(n+=t.fn(e[s])+t.padding,n>t.max)return i/s<2?Math.ceil(i/2):s;return i}(e,i);if(r<1){if(!s)return;r=1}let o=r;for(;o>=1;){const r=id(e,t,o,i,n,s);if(null==r&&o<=1)return;if(null!=r){if("number"!=typeof r)return{processedBBoxCount:r.length*r[0].length,pageIndices:r};if(r<=1)return;o=r<o&&r>1?r:o,o--}else o--}}function id(e,t,i,n,s,r){const o=[];let a=0,l=0,c=[];const h=[];for(let u=0;u<e.length;u++){const d=(u+i)%i;0===d&&(a+=l,l=0,c.length>0&&o.push(c),c=[]);const p=n.fn(e[u])+n.padding;h[d]=Math.max(h[d]??0,p),l=Math.max(l,s.fn(e[u])+s.padding);const g=a+l,f=!r||o.length>0;if(g>s.max&&f){c=[];break}if(h.reduce((e,t)=>e+t,0)>n.max&&!r)return h.length<i?h.length:void 0;c.push(u+t)}return c.length>0&&o.push(c),o.length>0?o:void 0}var nd=class extends De{constructor(){super(...arguments),this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=12,this.fontFamily="Verdana, sans-serif"}};a([Te],nd.prototype,"color",2),a([Te],nd.prototype,"fontStyle",2),a([Te],nd.prototype,"fontWeight",2),a([Te],nd.prototype,"fontSize",2),a([Te],nd.prototype,"fontFamily",2);var sd=class extends De{constructor(){super(...arguments),this.size=15,this.fill=void 0,this.fillOpacity=void 0,this.stroke=void 0,this.strokeWidth=1,this.strokeOpacity=1}};a([Te],sd.prototype,"size",2),a([Te],sd.prototype,"fill",2),a([Te],sd.prototype,"fillOpacity",2),a([Te],sd.prototype,"stroke",2),a([Te],sd.prototype,"strokeWidth",2),a([Te],sd.prototype,"strokeOpacity",2);var rd=class extends De{constructor(e){super(),this.parent=e,this.shape="triangle",this.size=15,this.padding=8}};a([li({changeValue(){this.parent.marker===this&&this.parent.onMarkerShapeChange()}})],rd.prototype,"shape",2),a([Te],rd.prototype,"size",2),a([Te],rd.prototype,"padding",2);var od=class extends De{constructor(e,t){super(),this.chartUpdateCallback=e,this.pageUpdateCallback=t,this.id=(0,n.sX)(this),this.marker=new rd(this),this.activeStyle=new sd,this.inactiveStyle=new sd,this.highlightStyle=new sd,this.label=new nd,this.group=new It({name:"pagination"}),this.labelNode=new _i,this.totalPages=0,this.currentPage=0,this.translationX=0,this.translationY=0,this.nextButtonDisabled=!1,this.previousButtonDisabled=!1,this._visible=!0,this._enabled=!0,this._orientation="vertical",this.nextButton=new Nc,this.previousButton=new Nc,this.labelNode.setProperties({textBaseline:"middle",fontSize:12,fontFamily:"Verdana, sans-serif",fill:"black",y:1}),this.group.append([this.nextButton,this.previousButton,this.labelNode]),this.update(),this.updateMarkers()}set visible(e){this._visible=e,this.updateGroupVisibility()}get visible(){return this._visible}set enabled(e){this._enabled=e,this.updateGroupVisibility()}get enabled(){return this._enabled}updateGroupVisibility(){this.group.visible=this.enabled&&this.visible}set orientation(e){this._orientation=e,"horizontal"===e?(this.previousButton.rotation=-Math.PI/2,this.nextButton.rotation=Math.PI/2):(this.previousButton.rotation=0,this.nextButton.rotation=Math.PI)}get orientation(){return this._orientation}update(){this.updateLabel(),this.updatePositions(),this.enableOrDisableButtons()}updatePositions(){this.group.translationX=this.translationX,this.group.translationY=this.translationY,this.updateLabelPosition(),this.updateNextButtonPosition()}updateLabelPosition(){const{size:e,padding:t}=this.marker;this.nextButton.size=e,this.previousButton.size=e,this.labelNode.x=e/2+t}updateNextButtonPosition(){const e=this.labelNode.getBBox();this.nextButton.translationX=e.width+2*(this.marker.size/2+this.marker.padding)}updateLabel(){const{currentPage:e,totalPages:t,labelNode:i,label:{color:n,fontStyle:s,fontWeight:r,fontSize:o,fontFamily:a}}=this;i.text=`${e+1} / ${t}`,i.fill=n,i.fontStyle=s,i.fontWeight=r,i.fontSize=o,i.fontFamily=a}updateMarkers(){const{nextButton:e,previousButton:t,nextButtonDisabled:i,previousButtonDisabled:n,activeStyle:s,inactiveStyle:r,highlightStyle:o,highlightActive:a}=this,l=(e,t)=>t?r:e===a?o:s;this.updateMarker(e,l("next",i)),this.updateMarker(t,l("previous",n))}updateMarker(e,t){const{shape:i,size:n}=this.marker;e.shape=i,e.size=n,e.fill=t.fill,e.fillOpacity=t.fillOpacity??1,e.stroke=t.stroke,e.strokeWidth=t.strokeWidth,e.strokeOpacity=t.strokeOpacity}enableOrDisableButtons(){const{currentPage:e,totalPages:t}=this,i=0===t,n=e===t-1,s=0===e;this.nextButtonDisabled=n||i,this.previousButtonDisabled=s||i}setPage(e){e=(0,n.qE)(0,e,Math.max(0,this.totalPages-1)),this.currentPage!==e&&(this.currentPage=e,this.onPaginationChanged())}getCursor(e){return{previous:this.previousButtonDisabled,next:this.nextButtonDisabled}[e]?void 0:"pointer"}onClick(e,t){e.preventDefault(),"next"!==t||this.nextButtonDisabled?"previous"!==t||this.previousButtonDisabled||(this.decrementPage(),this.onPaginationChanged()):(this.incrementPage(),this.onPaginationChanged())}onMouseHover(e){this.highlightActive=e,this.updateMarkers(),this.chartUpdateCallback(7)}onPaginationChanged(){this.pageUpdateCallback(this.currentPage)}incrementPage(){this.currentPage=Math.min(this.currentPage+1,this.totalPages-1)}decrementPage(){this.currentPage=Math.max(this.currentPage-1,0)}onMarkerShapeChange(){this.updatePositions(),this.updateMarkers(),this.chartUpdateCallback(7)}attachPagination(e){e.append(this.group)}getBBox(){return this.group.getBBox()}computeCSSBounds(){return{prev:St.toCanvas(this.previousButton),next:St.toCanvas(this.nextButton)}}};od.className="Pagination",a([Te],od.prototype,"marker",2),a([Te],od.prototype,"activeStyle",2),a([Te],od.prototype,"inactiveStyle",2),a([Te],od.prototype,"highlightStyle",2),a([Te],od.prototype,"label",2);var ad=class{constructor(e,t){this.dirty=!0,this.destroyFns=new $i,this.itemList=e.proxyInteractionService.createProxyContainer({type:"list",domManagerId:`${t}-toolbar`,classList:["ag-charts-proxy-legend-toolbar"],ariaLabel:{id:"ariaLabelLegend"}}),this.paginationGroup=e.proxyInteractionService.createProxyContainer({type:"group",domManagerId:`${t}-pagination`,classList:["ag-charts-proxy-legend-pagination"],ariaLabel:{id:"ariaLabelLegendPagination"},ariaOrientation:"horizontal"}),this.itemDescription=(0,n.n)("p"),this.itemDescription.style.display="none",this.itemDescription.id=(0,n.wW)(),this.itemDescription.textContent=this.getItemAriaDescription(e.localeManager),this.itemList.getElement().append(this.itemDescription)}destroy(){this.destroyFns.destroy()}initLegendList(e){if(!this.dirty)return;const{ctx:t,itemSelection:i,datumReader:n,itemListener:s}=e,r=t.localeManager,o=i.length;i.each((e,i,a)=>{e.proxyButton?.destroy(),e.proxyButton=t.proxyInteractionService.createProxyElement({type:"listswitch",textContent:this.getItemAriaText(r,n.getItemLabel(i),a,o),ariaChecked:!!e.datum.enabled,ariaDescribedBy:this.itemDescription.id,parent:this.itemList});const l=e.proxyButton;l.addListener("click",t=>s.onClick(t.sourceEvent,e.datum,l)),l.addListener("dblclick",t=>s.onDoubleClick(t.sourceEvent,e.datum)),l.addListener("mouseenter",t=>s.onHover(t.sourceEvent,e)),l.addListener("mouseleave",()=>s.onLeave()),l.addListener("contextmenu",t=>s.onContextClick(t,e)),l.addListener("blur",()=>s.onLeave()),l.addListener("focus",t=>s.onHover(t.sourceEvent,e)),l.addListener("drag-start",()=>{})}),this.dirty=!1}update(e){e.visible&&(this.initLegendList(e),this.updateItemProxyButtons(e),this.updatePaginationProxyButtons(e,!0)),this.updateVisibility(e.visible)}updateVisibility(e){this.itemList.setHidden(!e),this.paginationGroup.setHidden(!e)}updateItemProxyButtons({itemSelection:e,group:t,pagination:i,interactive:n}){const s=St.toCanvas(t);this.itemList.setBounds(s);const r=Math.max(...e.nodes().map(e=>e.getBBox().height));e.each((e,t)=>{if(e.proxyButton){const t=e.pageIndex===i.currentPage,{x:o,y:a,height:l,width:c}=St.toCanvas(e),h=(r-l)/2,u={x:o-s.x,y:a-h-s.y,height:r,width:c},d=n&&t;e.proxyButton.setCursor("pointer"),e.proxyButton.setEnabled(d),e.proxyButton.setPointerEvents(d?void 0:"none"),e.proxyButton.setBounds(u)}})}updatePaginationProxyButtons(e,t){const{pagination:i}=e;if(this.paginationGroup.setHidden(!i.visible),t&&"ctx"in e){const{ctx:t,oldPages:n,newPages:s}=e,r=(n?.length??s.length)>1,o=s.length>1;r!==o&&(o?(this.prevButton=t.proxyInteractionService.createProxyElement({type:"button",textContent:{id:"ariaLabelLegendPagePrevious"},tabIndex:0,parent:this.paginationGroup}),this.prevButton.addListener("click",t=>this.onPageButton(e,t,"previous")),this.prevButton.addListener("mouseenter",()=>i.onMouseHover("previous")),this.prevButton.addListener("mouseleave",()=>i.onMouseHover(void 0)),this.nextButton??(this.nextButton=t.proxyInteractionService.createProxyElement({type:"button",textContent:{id:"ariaLabelLegendPageNext"},tabIndex:0,parent:this.paginationGroup})),this.nextButton.addListener("click",t=>this.onPageButton(e,t,"next")),this.nextButton.addListener("mouseenter",()=>i.onMouseHover("next")),this.nextButton.addListener("mouseleave",()=>i.onMouseHover(void 0))):(this.nextButton?.destroy(),this.prevButton?.destroy(),this.nextButton=void 0,this.prevButton=void 0))}const{prev:n,next:s}=i.computeCSSBounds();this.prevButton?.setBounds(n),this.nextButton?.setBounds(s),this.prevButton?.setEnabled(0!==i.currentPage),this.nextButton?.setEnabled(i.currentPage!==i.totalPages-1),this.nextButton?.setCursor(i.getCursor("next")),this.prevButton?.setCursor(i.getCursor("previous"))}onPageButton(e,t,i){e.pagination.onClick(t.sourceEvent,i),this.updatePaginationProxyButtons(e,!1)}onDataUpdate(e,t){this.dirty=e.length!==t.length||e.some((i,n,s)=>{const[r,o]=[t[n],e[n]];return r.id!==o.id})}onLocaleChanged(e,t,i){const n=t.length;t.each(({proxyButton:t},s,r)=>{const o=t?.getElement();if(null!=o){const t=i.getItemLabel(s);o.textContent=this.getItemAriaText(e,t,r,n)}}),this.itemDescription.textContent=this.getItemAriaDescription(e)}onPageChange(e){this.updateItemProxyButtons(e),this.updatePaginationProxyButtons(e,!1)}getItemAriaText(e,t,i,n){return i>=0&&t?(i++,e.t("ariaLabelLegendItem",{label:t,index:i,count:n})):e.t("ariaLabelLegendItemUnknown")}getItemAriaDescription(e){return e.t("ariaDescriptionLegendItem")}};function ld(e,t,i,n){const s={defaultPrevented:!1,apiEvent:{type:e,itemId:t,seriesId:i,event:n,preventDefault:()=>s.defaultPrevented=!0}};return s}var cd=class extends(Ct(Mt)){constructor(){super({name:"markerLabelGroup"}),this.symbolsGroup=this.appendChild(new Mt({name:"legend-markerLabel-symbols"})),this.label=this.appendChild(new _i),this.enabled=!0,this.pageIndex=NaN,this.spacing=0,this.length=0,this.isCustomMarker=!1,this.marker=this.symbolsGroup.appendChild(new Nc({zIndex:1})),this.line=this.symbolsGroup.appendChild(new pa({zIndex:0}));const{label:e,line:t,symbolsGroup:i}=this;t.visible=!1,i.renderToOffscreenCanvas=!0,i.optimizeForInfrequentRedraws=!0,e.textBaseline="middle",e.fontSize=12,e.fontFamily="Verdana, sans-serif",e.fill="black",e.y=1}destroy(){super.destroy(),this.proxyButton?.destroy()}setEnabled(e){this.enabled=e,this.refreshVisibilities()}getTextMeasureBBox(){return this.layout(),m.merge([this.symbolsGroup.getBBox(),this.label.getTextMeasureBBox()])}refreshVisibilities(){const e=this.enabled?1:.5;this.label.opacity=e,this.opacity=e}layout(){const{marker:e,line:t,length:i,isCustomMarker:n}=this;let s=0,r=0;if(e.visible){const{size:t}=e,o=Nc.anchor(e.shape);s=(o.x-.5)*t+i/2,r=(o.y-.5)*t,n?(e.x=0,e.y=0,e.translationX=s,e.translationY=r):(e.x=s,e.y=r,e.translationX=0,e.translationY=0)}t.visible&&(t.x1=0,t.x2=i,t.y1=0,t.y2=0)}preRender(e){const t=super.preRender(e);return this.layout(),t}layoutLabel(){const{length:e,spacing:t}=this;this.label.x=e+t}computeBBox(){return this.layout(),super.computeBBox()}};cd.className="MarkerLabel",a([ai("label")],cd.prototype,"text",2),a([ai("label")],cd.prototype,"fontStyle",2),a([ai("label")],cd.prototype,"fontWeight",2),a([ai("label")],cd.prototype,"fontSize",2),a([ai("label")],cd.prototype,"fontFamily",2),a([ai("label","fill")],cd.prototype,"color",2),a([ci(e=>e.layoutLabel())],cd.prototype,"spacing",2),a([ci(e=>e.layoutLabel())],cd.prototype,"length",2),a([K()],cd.prototype,"isCustomMarker",2);var hd=class extends De{constructor(){super(...arguments),this.maxLength=void 0,this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=12,this.fontFamily="Verdana, sans-serif"}};a([Te],hd.prototype,"maxLength",2),a([Te],hd.prototype,"color",2),a([Te],hd.prototype,"fontStyle",2),a([Te],hd.prototype,"fontWeight",2),a([Te],hd.prototype,"fontSize",2),a([Te],hd.prototype,"fontFamily",2),a([Te],hd.prototype,"formatter",2);var ud=class extends De{constructor(){super(...arguments),this.shape=void 0,this.size=15,this.padding=8}};a([Te],ud.prototype,"shape",2),a([Te],ud.prototype,"size",2),a([Te],ud.prototype,"padding",2),a([Te],ud.prototype,"strokeWidth",2),a([Te],ud.prototype,"enabled",2);var dd=class extends De{};a([Te],dd.prototype,"strokeWidth",2),a([Te],dd.prototype,"length",2);var pd=class extends De{constructor(){super(...arguments),this.paddingX=16,this.paddingY=8,this.showSeriesStroke=!1,this.marker=new ud,this.label=new hd,this.line=new dd}};a([Te],pd.prototype,"maxWidth",2),a([Te],pd.prototype,"paddingX",2),a([Te],pd.prototype,"paddingY",2),a([Te],pd.prototype,"showSeriesStroke",2),a([Te],pd.prototype,"marker",2),a([Te],pd.prototype,"label",2),a([Te],pd.prototype,"line",2);var gd=class extends De{};a([Te],gd.prototype,"legendItemClick",2),a([Te],gd.prototype,"legendItemDoubleClick",2);var fd={type:"gradient",bounds:"item",gradient:"linear",colorStops:[{color:"black"}],rotation:0,reverse:!1},md={type:"pattern",pattern:"forward-slanted-lines",width:8,height:8,padding:1,fill:"black",fillOpacity:1,backgroundFill:"white",backgroundFillOpacity:1,stroke:"black",strokeOpacity:1,strokeWidth:0,rotation:0,scale:1},yd={type:"image",backgroundFill:"black",backgroundFillOpacity:1,rotation:0,repeat:"no-repeat",fit:"contain",width:8,height:8},vd=class extends De{constructor(e){super(),this.ctx=e,this.id=(0,n.sX)(this),this.group=new It({name:"legend",zIndex:14}),this.itemSelection=da.select(this.group,cd),this.oldSize=[0,0],this.pages=[],this.maxPageSize=[0,0],this.paginationTrackingIndex=0,this.truncatedItems=new Set,this._data=[],this.toggleSeries=!0,this.item=new pd,this.listeners=new gd,this.enabled=!0,this.position="bottom",this.spacing=20,this.destroyFns=[],this.size=[0,0],this._visible=!0,this.pagination=new od(t=>e.updateService.update(t),e=>this.updatePageNumber(e)),this.pagination.attachPagination(this.group);const{items:t}=e.contextMenuRegistry.builtins;t["toggle-series-visibility"].action=e=>this.contextToggleVisibility(e),t["toggle-other-series"].action=e=>this.contextToggleOtherSeries(e),this.destroyFns.push(e.legendManager.addListener("legend-change",this.onLegendDataChange.bind(this))),this.destroyFns.push(()=>delete t["toggle-series-visibility"].action,()=>delete t["toggle-other-series"].action,e.layoutManager.registerElement(1,e=>this.positionLegend(e)),e.localeManager.addListener("locale-changed",()=>this.onLocaleChanged()),()=>this.group.remove()),this.domProxy=new ad(this.ctx,this.id),this.ctx.historyManager.addMementoOriginator(e.legendManager)}set data(e){P(e,this._data)||(this.domProxy.onDataUpdate(this._data,e),this._data=e,this.updateGroupVisibility())}get data(){return this._data}onLegendDataChange({legendData:e=[]}){this.enabled&&(this.data=e.filter(e=>!e.hideInLegend))}destroy(){this.ctx.domManager.removeChild("canvas-overlay",`${this.id}-toolbar`),this.ctx.domManager.removeChild("canvas-overlay",`${this.id}-pagination`),this.destroyFns.forEach(e=>e()),this.itemSelection.clear(),this.domProxy.destroy()}getOrientation(){return this.orientation??"horizontal"}set visible(e){this._visible=e,this.updateGroupVisibility()}get visible(){return this._visible}updateGroupVisibility(){this.group.visible=this.enabled&&this.visible&&this.data.length>0}attachLegend(e){e.appendChild(this.group)}getItemLabel(e){const{formatter:t}=this.item.label;if(t){const i=e.datum;return this.cachedCallWithContext(t,{itemId:e.itemId,value:e.label.text,seriesId:e.seriesId,...i&&{datum:i}})}return e.label.text}calcLayout(e,t){const{paddingX:i,paddingY:n,label:s,maxWidth:r,label:{maxLength:o=1/0,fontStyle:a,fontWeight:l,fontSize:c,fontFamily:h}}=this.item,u=[...this.data];this.reverseOrder&&u.reverse(),this.itemSelection.update(u);const d=[],p=Ri.toFontString(s),g=r??.8*e,{markerWidth:f,anyLineEnabled:m}=this.calculateMarkerWidth();if(this.itemSelection.each((e,t)=>{e.fontStyle=a,e.fontWeight=l,e.fontSize=c,e.fontFamily=h;const i=this.updateMarkerLabel(e,t,f,m),n=t.itemId??t.id,s=(this.getItemLabel(t)??"<unknown>").replace(/\r?\n/g," ");e.text=this.truncate(s,o,g,i,p,n),d.push(e.getTextMeasureBBox())}),e=Math.max(1,e),t=Math.max(1,t),!isFinite(e))return{};const y=this.size,v=this.oldSize;y[0]=e,y[1]=t,y[0]===v[0]&&y[1]===v[1]||(v[0]=y[0],v[1]=y[1]);const{pages:b,maxPageHeight:C,maxPageWidth:w}=this.updatePagination(d,e,t),S=this.pages;this.pages=b,this.maxPageSize=[w-i,C-n];const x=this.pagination.currentPage,E=this.pages[x];return this.pages.length<1||!E?(this.visible=!1,{oldPages:S}):(this.visible=!0,this.updatePositions(x),this.update(),{oldPages:S})}isCustomMarker(e,t){return e&&void 0!==t&&"string"!=typeof t}calcSymbolsEnabled(e){const{showSeriesStroke:t,marker:i}=this.item,n=!!i.enabled||!t||(e.marker.enabled??!0);return{markerEnabled:n,lineEnabled:!(!e.line||!t),isCustomMarker:this.isCustomMarker(n,e.marker.shape)}}calcSymbolsLengths(e,t,i){const{marker:n,line:s}=this.item;let r;const{shape:o}=e.marker;if(this.isCustomMarker(t,o)){const e=new Nc;e.shape=o,e.updatePath();const t=e.getBBox();r=Math.max(t.width,t.height)}return{markerLength:t?n.size:0,lineLength:i?s.length??25:0,customMarkerSize:r}}calculateMarkerWidth(){let e=0,t=!1;return this.itemSelection.each((i,n)=>{const{symbol:s}=n,{lineEnabled:r,markerEnabled:o}=this.calcSymbolsEnabled(s),{markerLength:a,lineLength:l,customMarkerSize:c=-1/0}=this.calcSymbolsLengths(s,o,r);e=Math.max(e,l,c,a),t||(t=r)}),{markerWidth:e,anyLineEnabled:t}}updateMarkerLabel(e,t,i,n){const{marker:s,paddingX:r}=this.item,{symbol:o}=t;let a=r;const{markerEnabled:l,isCustomMarker:c}=this.calcSymbolsEnabled(o),h=s.padding;(l||n)&&(a+=h+i);const{marker:u,line:d}=e;return u.visible=l,u.visible&&(u.shape=s.shape??o.marker.shape??"square",u.size=s.size,fc(u,this.getMarkerStyles(o))),d.visible=n,d.visible&&fc(d,this.getLineStyles(o)),e.length=i,e.spacing=h,e.isCustomMarker=c,a}truncate(e,t,i,n,s,r){let o=!1;e.length>t&&(e=e.substring(0,t),o=!0);const a=Di.getMeasurer({font:s}),l=Oi.truncateLine(e,a,i-n,o);return l.endsWith(Ri.EllipsisChar)?this.truncatedItems.add(r):this.truncatedItems.delete(r),l}updatePagination(e,t,i){const s=this.getOrientation(),r=Math.min(this.paginationTrackingIndex,e.length);this.pagination.orientation=s,this.pagination.translationX=0,this.pagination.translationY=0;const{pages:o,maxPageHeight:a,maxPageWidth:l,paginationBBox:c,paginationVertical:h}=this.calculatePagination(e,t,i),u=o.findIndex(e=>e.endIndex>=r);this.pagination.currentPage=(0,n.qE)(0,u,o.length-1);const{paddingX:d,paddingY:p}=this.item,g=l-d,f=a-p;let m=0,y=-c.y-this.item.marker.size/2;h?y+=f+8:(m+=-c.x+g+8,y+=(f-c.height)/2),this.pagination.translationX=m,this.pagination.translationY=y,this.pagination.update(),this.pagination.updateMarkers();let v=0;return this.itemSelection.each((e,t,i)=>{i>(o[v]?.endIndex??1/0)&&v++,e.pageIndex=v}),{maxPageHeight:a,maxPageWidth:l,pages:o}}calculatePagination(e,t,i){const{paddingX:s,paddingY:r}=this.item,o=this.getOrientation(),a=["left","right"].includes(this.position);let l=this.pagination.getBBox(),c=new m(0,0,0,0),h=[],u=0,d=0,p=0;const g=e=>e.width===l.width&&e.height===l.height,f=void 0!==this.maxWidth&&void 0!==this.maxHeight;do{if(p++>10){n.Vy.warn("unable to find stable legend layout.");break}l=c;const g=t-(a?0:l.width),m=ed({orientation:o,bboxes:e,maxHeight:i-(a?l.height:0),maxWidth:g,itemPaddingY:r,itemPaddingX:s,forceResult:f});h=m?.pages??[],u=m?.maxPageWidth??0,d=m?.maxPageHeight??0;const y=h.length;if(this.pagination.visible=y>1,this.pagination.totalPages=y,this.pagination.update(),this.pagination.updateMarkers(),c=this.pagination.getBBox(),!this.pagination.visible)break}while(!g(c));return{maxPageWidth:u,maxPageHeight:d,pages:h,paginationBBox:c,paginationVertical:a}}updatePositions(e=0){const{item:{paddingY:t},itemSelection:i,pages:n}=this;if(n.length<1||!n[e])return;const{columns:s,startIndex:r,endIndex:o}=n[e];let a=0,l=0;const c=s.length,h=s[0].indices.length,u="horizontal"===this.getOrientation(),d=s[0].bboxes[0].height+t,p=[];i.each((e,t,i)=>{if(i<r||i>o)return void(e.visible=!1);const n=i-r;let g,f;u?(g=n%c,f=Math.floor(n/c)):(g=Math.floor(n/h),f=n%h),e.visible=!0;const m=s[g];m&&(l=Math.floor(d*f),a=Math.floor(p[f]??0),p[f]=(p[f]??0)+m.columnWidth,e.translationX=a,e.translationY=l)})}updatePageNumber(e){const{itemSelection:t,group:i,pagination:n,pages:s,toggleSeries:r}=this,{startIndex:o,endIndex:a}=s[e];0===o?this.paginationTrackingIndex=0:e===s.length-1?this.paginationTrackingIndex=a:this.paginationTrackingIndex=Math.floor((o+a)/2),this.pagination.update(),this.pagination.updateMarkers(),this.updatePositions(e),this.domProxy.onPageChange({itemSelection:t,group:i,pagination:n,interactive:r}),this.ctx.updateService.update(7)}update(){const{label:{color:e}}=this.item;this.itemSelection.each((t,i)=>{t.setEnabled(i.enabled),t.color=e}),this.updateContextMenu()}updateContextMenu(){this.ctx.contextMenuRegistry.setVisible("toggle-series-visibility",this.toggleSeries),this.ctx.contextMenuRegistry.setVisible("toggle-other-series",this.toggleSeries)}getLineStyles(e){const{stroke:t,strokeOpacity:i=1,strokeWidth:n,lineDash:s}=e.line??{},r=Math.min(2,n??1);return{stroke:t,strokeOpacity:i,strokeWidth:this.item.line.strokeWidth??r,lineDash:s}}getMarkerStyles({marker:e}){const{fill:t,stroke:i,strokeOpacity:n=1,fillOpacity:s=1,strokeWidth:r,lineDash:o,lineDashOffset:a}=e,l=Math.min(2,r??1);return at(t)&&(t.width=8,t.height=8,t.padding=1,t.strokeWidth=Math.min(2,t.strokeWidth??2)),lt(t)&&(t.fit="contain",t.width=void 0,t.height=void 0,t.repeat="no-repeat"),pc({fill:t,stroke:i,strokeOpacity:n,fillOpacity:s,strokeWidth:this.item.marker.strokeWidth??l,lineDash:o,lineDashOffset:a},fd,md,yd)}computePagedBBox(){const e=Mt.computeChildrenBBox(this.group.children());if(this.pages.length>1){const[t,i]=this.maxPageSize;e.height=Math.max(i,e.height),e.width=Math.max(t,e.width)}return e}findNode(e){const{datum:t,proxyButton:i}=this.itemSelection.select(t=>t.datum?.itemId===e.itemId)[0]??{};if(void 0===t||void 0===i)throw new Error(`AG Charts - Missing required properties { datum: ${t}, proxyButton: ${JSON.stringify(i)} }`);return{datum:t,proxyButton:i}}contextToggleVisibility(e){const{datum:t,proxyButton:i}=this.findNode(e);this.doClick(e.event,t,i)}contextToggleOtherSeries(e){this.doDoubleClick(e.event,this.findNode(e).datum)}onContextClick(e,t){const{sourceEvent:i}=e,n=t.datum;this.preventHidingAll&&this.contextMenuDatum?.enabled&&this.getVisibleItemCount()<=1?this.ctx.contextMenuRegistry.builtins.items["toggle-series-visibility"].enabled=!1:this.ctx.contextMenuRegistry.builtins.items["toggle-series-visibility"].enabled=!0;const s=this.ctx.chartService.series.length>1&&!0!==this.ctx.chartService.series[0]?.getLegendData("category")[0]?.hideToggleOtherSeries;this.ctx.contextMenuRegistry.setVisible("toggle-other-series",s);const{offsetX:r,offsetY:o}=i,{x:a,y:l}=St.toCanvasPoint(t,r,o);this.ctx.contextMenuRegistry.dispatchContext("legend-item",{widgetEvent:e,canvasX:a,canvasY:l},{legendItem:n})}onClick(e,t,i){this.doClick(e,t,i)&&e.preventDefault()}getVisibleItemCount(){return this.ctx.chartService.series.flatMap(e=>e.getLegendData("category")).filter(e=>e.enabled).length}doClick(e,t,i){const{listeners:{legendItemClick:n},ctx:{chartService:s,highlightManager:r},preventHidingAll:o,toggleSeries:a}=this;if(!t)return!1;const{legendType:l,seriesId:c,itemId:h,enabled:u}=t,d=s.series.find(e=>e.id===c);if(!d)return!1;let p=u;const g=ld("click",h,d.id,e);return n?.(g.apiEvent),g.defaultPrevented||(a&&(p=!u,o&&!p&&this.getVisibleItemCount()<2&&(p=!0),i.setChecked(p),this.ctx.chartEventManager.legendItemClick(l,d,h,p,t.legendItemName)),p?r.updateHighlight(this.id,{series:d,itemId:h,datum:void 0,datumIndex:void 0}):r.updateHighlight(this.id),this.ctx.legendManager.update(),this.ctx.updateService.update(2,{forceNodeDataRefresh:!0,skipAnimations:t.skipAnimations??!1})),!0}onDoubleClick(e,t){this.doDoubleClick(e,t)&&e.preventDefault()}doDoubleClick(e,t){const{listeners:{legendItemDoubleClick:i},ctx:{chartService:n},toggleSeries:s}=this;if(!t)return!1;const{legendType:r,id:o,itemId:a,seriesId:l}=t,c=n.series.find(e=>e.id===o);if(!c)return!1;const h=ld("dblclick",a,c.id,e);if(i?.(h.apiEvent),h.defaultPrevented)return!0;if(s){const e=n.series.flatMap(e=>e.getLegendData("category"));let t=0;const i=new Set;for(const n of e)n.enabled&&(t+=1,null!=n.legendItemName&&i.add(n.legendItemName));i.size>0&&(t=i.size);const s=e.find(e=>e.itemId===a&&e.seriesId===l);this.ctx.chartEventManager.legendItemDoubleClick(r,c,a,s?.enabled??!1,t,s?.legendItemName)}return this.ctx.legendManager.update(),this.ctx.updateService.update(2,{forceNodeDataRefresh:!0}),!0}toTooltipMeta(e,t){let i;return e instanceof FocusEvent?i=St.toCanvas(t).computeCenter():(e.preventDefault(),i=St.toCanvasPoint(t,e.offsetX,e.offsetY)),{canvasX:i.x,canvasY:i.y,showArrow:!1}}onHover(e,t){if(!this.enabled)throw new Error("AG Charts - onHover handler called on disabled legend");this.pagination.setPage(t.pageIndex);const i=t.datum,n=i?this.ctx.chartService.series.find(e=>e.id===i?.id):void 0;if(i&&this.truncatedItems.has(i.itemId??i.id)){const n=this.toTooltipMeta(e,t);this.ctx.tooltipManager.updateTooltip(this.id,n,[{type:"structured",title:this.getItemLabel(i)}])}else this.ctx.tooltipManager.removeTooltip(this.id);i?.enabled&&n?this.updateHighlight({series:n,itemId:i?.itemId,datum:void 0,datumIndex:void 0}):this.updateHighlight()}onLeave(){this.ctx.tooltipManager.removeTooltip(this.id),this.updateHighlight()}updateHighlight(e){this.ctx.interactionManager.isState(32)?this.ctx.highlightManager.updateHighlight(this.id,e):this.ctx.interactionManager.isState(2)&&(this.pendingHighlightDatum=e,this.ctx.animationManager.onBatchStop(()=>{this.ctx.highlightManager.updateHighlight(this.id,this.pendingHighlightDatum)}))}onLocaleChanged(){this.domProxy.onLocaleChanged(this.ctx.localeManager,this.itemSelection,this)}positionLegend(e){const t=this.positionLegendScene(e);this.positionLegendDOM(t)}positionLegendScene(e){if(!this.enabled||!this.data.length)return;const{layoutBox:t}=e,{x:i,y:n,width:s,height:r}=t,[o,a]=this.calculateLegendDimensions(t),{oldPages:l}=this.calcLayout(o,a),c=this.computePagedBBox(),h=()=>{switch(this.position){case"top":case"left":return 0;case"bottom":return r-c.height;default:return s-c.width}};if(this.visible){const e=this.spacing;let o,a;switch(this.position){case"top":case"bottom":o=(s-c.width)/2,a=h(),t.shrink(c.height+e,this.position);break;default:o=h(),a=(r-c.height)/2,t.shrink(c.width+e,this.position)}this.group.translationX=Math.floor(i+o-c.x),this.group.translationY=Math.floor(n+a-c.y)}return l}positionLegendDOM(e){const{ctx:t,itemSelection:i,pagination:n,pages:s,toggleSeries:r,group:o,listeners:{legendItemClick:a,legendItemDoubleClick:l}}=this,c=this.visible&&this.enabled,h=r||null!=l||null!=a;this.domProxy.update({visible:c,interactive:h,ctx:t,itemSelection:i,group:o,pagination:n,oldPages:e,newPages:s,datumReader:this,itemListener:this})}calculateLegendDimensions(e){const{width:t,height:i}=e,n=t/i;let s,r;switch(this.position){case"top":case"bottom":{const e=n<1?Math.min(.5,1/n*.2):.2;s=this.maxWidth?Math.min(this.maxWidth,t):t,r=this.maxHeight?Math.min(this.maxHeight,i):Math.round(i*e);break}default:{const e=n>1?Math.min(.5,.25*n):.25;s=this.maxWidth?Math.min(this.maxWidth,t):Math.round(t*e),r=this.maxHeight?Math.min(this.maxHeight,i):i}}return[s,r]}cachedCallWithContext(e,...t){const{callbackCache:i,chartService:n}=this.ctx;return i.call(this,n,e,...t)}};vd.className="Legend",a([Te],vd.prototype,"toggleSeries",2),a([Te],vd.prototype,"pagination",2),a([Te],vd.prototype,"item",2),a([Te],vd.prototype,"listeners",2),a([ci((e,t,i)=>{if(e.updateGroupVisibility(),t===i)return;const{ctx:{legendManager:n,stateManager:s}}=e;!1===i&&!0===t&&s.restoreState(n)}),Te],vd.prototype,"enabled",2),a([Te],vd.prototype,"position",2),a([Te],vd.prototype,"maxWidth",2),a([Te],vd.prototype,"maxHeight",2),a([Te],vd.prototype,"reverseOrder",2),a([Te],vd.prototype,"orientation",2),a([Te],vd.prototype,"preventHidingAll",2),a([Te],vd.prototype,"spacing",2);var bd={type:"legend",optionsKey:"legend",identifier:"category",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:e=>new vd(e),packageType:"community",removable:"standalone-only"},Cd={};o(Cd,{CARTESIAN_AXIS_TYPE:()=>Ed,CARTESIAN_POSITION:()=>xd,FONT_SIZE:()=>wd,FONT_SIZE_RATIO:()=>Sd,POLAR_AXIS_SHAPE:()=>Md,POLAR_AXIS_TYPE:()=>Ad});var wd=(e=>(e[e.SMALLEST=8]="SMALLEST",e[e.SMALLER=10]="SMALLER",e[e.SMALL=12]="SMALL",e[e.MEDIUM=13]="MEDIUM",e[e.LARGE=14]="LARGE",e[e.LARGEST=17]="LARGEST",e))(wd||{}),Sd=(e=>(e[e.SMALLEST=.6666666666666666]="SMALLEST",e[e.SMALLER=.8333333333333334]="SMALLER",e[e.SMALL=1]="SMALL",e[e.MEDIUM=1.0833333333333333]="MEDIUM",e[e.LARGE=1.1666666666666667]="LARGE",e[e.LARGEST=1.4166666666666667]="LARGEST",e))(Sd||{}),xd=(e=>(e.TOP="top",e.RIGHT="right",e.BOTTOM="bottom",e.LEFT="left",e))(xd||{}),Ed=(e=>(e.CATEGORY="category",e.GROUPED_CATEGORY="grouped-category",e.ORDINAL_TIME="ordinal-time",e.UNIT_TIME="unit-time",e.NUMBER="number",e.TIME="time",e.LOG="log",e))(Ed||{}),Ad=(e=>(e.ANGLE_CATEGORY="angle-category",e.ANGLE_NUMBER="angle-number",e.RADIUS_CATEGORY="radius-category",e.RADIUS_NUMBER="radius-number",e))(Ad||{}),Md=(e=>(e.CIRCLE="circle",e.POLYGON="polygon",e))(Md||{}),Td={};o(Td,{DEFAULT_ANNOTATION_HANDLE_FILL:()=>Zd,DEFAULT_ANNOTATION_STATISTICS_COLOR:()=>ep,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:()=>tp,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:()=>ip,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:()=>np,DEFAULT_ANNOTATION_STATISTICS_FILL:()=>Qd,DEFAULT_ANNOTATION_STATISTICS_STROKE:()=>Jd,DEFAULT_CAPTION_ALIGNMENT:()=>Pd,DEFAULT_CAPTION_LAYOUT_STYLE:()=>kd,DEFAULT_FIBONACCI_STROKES:()=>Yd,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:()=>Xd,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:()=>Kd,DEFAULT_GRIDLINE_ENABLED:()=>lp,DEFAULT_POLAR_SERIES_STROKE:()=>jd,DEFAULT_SEPARATION_LINES_COLOUR:()=>Id,DEFAULT_SHADOW_COLOUR:()=>Rd,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:()=>$d,DEFAULT_TEXTBOX_COLOR:()=>op,DEFAULT_TEXTBOX_FILL:()=>sp,DEFAULT_TEXTBOX_STROKE:()=>rp,DEFAULT_TEXT_ANNOTATION_COLOR:()=>qd,DEFAULT_TOOLBAR_POSITION:()=>ap,IS_DARK_THEME:()=>Dd,PALETTE_ALT_DOWN_FILL:()=>Ud,PALETTE_ALT_DOWN_STROKE:()=>Vd,PALETTE_ALT_NEUTRAL_FILL:()=>zd,PALETTE_ALT_NEUTRAL_STROKE:()=>Wd,PALETTE_ALT_UP_FILL:()=>Hd,PALETTE_ALT_UP_STROKE:()=>Bd,PALETTE_DOWN_FILL:()=>Od,PALETTE_DOWN_STROKE:()=>Ld,PALETTE_NEUTRAL_FILL:()=>Gd,PALETTE_NEUTRAL_STROKE:()=>Fd,PALETTE_UP_FILL:()=>Nd,PALETTE_UP_STROKE:()=>_d});var Dd=Symbol("is-dark-theme"),Id=Symbol("default-separation-lines-colour"),Rd=Symbol("default-shadow-colour"),kd=Symbol("default-caption-layout-style"),Pd=Symbol("default-caption-alignment"),_d=Symbol("palette-up-stroke"),Ld=Symbol("palette-down-stroke"),Nd=Symbol("palette-up-fill"),Od=Symbol("palette-down-fill"),Fd=Symbol("palette-neutral-stroke"),Gd=Symbol("palette-neutral-fill"),Bd=Symbol("palette-alt-up-stroke"),Vd=Symbol("palette-alt-down-stroke"),Hd=Symbol("palette-alt-up-fill"),Ud=Symbol("palette-alt-down-fill"),zd=Symbol("palette-gray-fill"),Wd=Symbol("palette-gray-stroke"),jd=Symbol("default-polar-series-stroke"),$d=Symbol("default-sparkline-crosshair-stroke"),Kd=Symbol("default-financial-charts-annotation-stroke"),Yd=Symbol("default-hierarchy-strokes"),qd=Symbol("default-text-annotation-color"),Xd=Symbol("default-financial-charts-annotation-background-fill"),Zd=Symbol("default-annotation-handle-fill"),Qd=Symbol("default-annotation-statistics-fill"),Jd=Symbol("default-annotation-statistics-stroke"),ep=Symbol("default-annotation-statistics-color"),tp=Symbol("default-annotation-statistics-divider-stroke"),ip=Symbol("default-annotation-statistics-fill"),np=Symbol("default-annotation-statistics-stroke"),sp=Symbol("default-textbox-fill"),rp=Symbol("default-textbox-stroke"),op=Symbol("default-textbox-color"),ap=Symbol("default-toolbar-position"),lp=Symbol("default-gridline-enabled"),cp=[{type:"number",position:{$if:[{$eq:[{$path:["/direction",void 0]},"horizontal"]},"bottom","left"]}},{type:"category",position:{$if:[{$eq:[{$path:["/direction",void 0]},"horizontal"]},"left","bottom"]}}],hp={$if:[{$or:[{$isGradient:[{$palette:"fill"}]},{$isPattern:[{$palette:"fill"}]},{$isImage:[{$value:"$1"}]}]},{$palette:"fillFallback"},{$palette:"fill"}]},up={$if:[{$or:[{$isGradient:[{$palette:"fill"}]},{$isPattern:[{$palette:"fill"}]},{$isImage:[{$value:"$1"}]}]},{$palette:"fillsFallback"},{$palette:"fills"}]},dp={$if:[{$isGradient:[{$palette:"fill"}]},{$palette:"fillFallback"},{$if:[{$isPattern:[{$palette:"fill"}]},{$path:["./stroke",{$palette:"fillFallback"},{$palette:"fill"}]},{$palette:"fill"}]}]},pp={$if:[{$or:[{$isGradient:[{$palette:"fill"}]},{$isPattern:[{$palette:"fill"}]},{$isImage:[{$value:"$1"}]}]},[{$palette:"fillFallback"},{$palette:"fillFallback"}],{$palette:"range2"}]},gp={type:"pattern",pattern:"forward-slanted-lines",width:10,height:10,padding:2,fill:{$if:[{$or:[{$isGradient:[{$palette:"fill"}]},{$isImage:[{$palette:"fill"}]}]},{$palette:"fillFallback"},{$if:[{$isPattern:[{$palette:"fill"}]},{$path:["./fill",{$palette:"fillFallback"},{$palette:"fill"}]},{$palette:"fill"}]}]},fillOpacity:1,stroke:dp,strokeOpacity:1,strokeWidth:4,backgroundFill:"none",backgroundFillOpacity:1,rotation:0,scale:1},fp={type:"image",backgroundFill:{$palette:"fillFallback"},backgroundFillOpacity:1,repeat:"no-repeat",fit:"contain",rotation:0};function mp(e){return F(e,e=>{const t=me.fromString(e);return[me.darken(t,.15).toString(),e,me.lighten(t,.15).toString()]})}function yp(e,t,i,n,s){const{addPhaseFn:r,updatePhaseFn:o,removePhaseFn:a}=s,l=(n,s,r)=>{i.animate({id:`${e}_${t}_${s.id}_${n}`,groupId:e,from:0,to:1,ease:As,collapsable:!1,onUpdate(e,t){t&&"removed"!==n||(s.path.clear(!0),r(e,s),s.checkPathDirty())},onStop(){"added"===n&&(s.path.clear(!0),r(1,s),s.checkPathDirty())},phase:oa[n]})};for(const e of n)i.isSkipped()||(l("removed",e,a),l("updated",e,o)),l("added",e,r)}function vp({id:e},t,i,...n){for(const e of n)e.cleanup();la(e,t,i,n,{opacity:0},{opacity:1},{phase:"trailing"})}function bp({id:e},t,i,...n){la(e,t,i,n,{opacity:1},{opacity:0},{phase:"remove"})}function Cp(e){return{opacity:1}}var wp=class extends De{constructor(){super(...arguments),this._dirty=!0}markDirty(){this._dirty=!0}markClean(e){this._dirty=!1}isDirty(){return this._dirty}onChangeDetection(e){this.markDirty()}},Sp=class extends wp{constructor(){super(...arguments),this.enabled=!0,this.color="rgba(0, 0, 0, 0.5)",this.xOffset=0,this.yOffset=0,this.blur=5}};a([Te,K()],Sp.prototype,"enabled",2),a([Te,K()],Sp.prototype,"color",2),a([Te,K()],Sp.prototype,"xOffset",2),a([Te,K()],Sp.prototype,"yOffset",2),a([Te,K()],Sp.prototype,"blur",2);var xp=class extends De{constructor(){super(...arguments),this.fill="rgba(255,255,255, 0.33)",this.stroke="rgba(0, 0, 0, 0.4)",this.strokeWidth=2}};a([Te],xp.prototype,"fill",2),a([Te],xp.prototype,"fillOpacity",2),a([Te],xp.prototype,"stroke",2),a([Te],xp.prototype,"strokeWidth",2),a([Te],xp.prototype,"strokeOpacity",2),a([Te],xp.prototype,"lineDash",2),a([Te],xp.prototype,"lineDashOffset",2);var Ep=class extends De{};a([Te],Ep.prototype,"strokeWidth",2),a([Te],Ep.prototype,"dimOpacity",2),a([Te],Ep.prototype,"enabled",2);var Ap=class extends De{constructor(){super(...arguments),this.color="black"}};a([Te],Ap.prototype,"color",2);var Mp=class extends De{constructor(){super(...arguments),this.enabled=!0}};a([Te],Mp.prototype,"enabled",2);var Tp=class extends De{constructor(){super(...arguments),this.type="gradient",this.colorStops=[],this.bounds="item",this.gradient="linear",this.rotation=0,this.reverse=!1}};a([Te],Tp.prototype,"type",2),a([Te],Tp.prototype,"colorStops",2),a([Te],Tp.prototype,"bounds",2),a([Te],Tp.prototype,"gradient",2),a([Te],Tp.prototype,"rotation",2),a([Te],Tp.prototype,"reverse",2);var Dp=class extends De{constructor(){super(...arguments),this.type="pattern",this.colorStops=[],this.bounds="item",this.gradient="linear",this.rotation=0,this.scale=1,this.reverse=!1,this.pattern="forward-slanted-lines",this.width=26,this.height=26,this.padding=6,this.fill="black",this.fillOpacity=1,this.backgroundFill="white",this.backgroundFillOpacity=1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0}};a([Te],Dp.prototype,"type",2),a([Te],Dp.prototype,"colorStops",2),a([Te],Dp.prototype,"bounds",2),a([Te],Dp.prototype,"gradient",2),a([Te],Dp.prototype,"rotation",2),a([Te],Dp.prototype,"scale",2),a([Te],Dp.prototype,"reverse",2),a([Te],Dp.prototype,"path",2),a([Te],Dp.prototype,"pattern",2),a([Te],Dp.prototype,"width",2),a([Te],Dp.prototype,"height",2),a([Te],Dp.prototype,"padding",2),a([Te],Dp.prototype,"fill",2),a([Te],Dp.prototype,"fillOpacity",2),a([Te],Dp.prototype,"backgroundFill",2),a([Te],Dp.prototype,"backgroundFillOpacity",2),a([Te],Dp.prototype,"stroke",2),a([Te],Dp.prototype,"strokeOpacity",2),a([Te],Dp.prototype,"strokeWidth",2);var Ip=class extends De{constructor(){super(...arguments),this.type="image",this.url="",this.rotation=0,this.scale=1,this.backgroundFill="black",this.backgroundFillOpacity=1,this.repeat="no-repeat",this.fit="contain"}};a([Te],Ip.prototype,"type",2),a([Te],Ip.prototype,"url",2),a([Te],Ip.prototype,"rotation",2),a([Te],Ip.prototype,"scale",2),a([Te],Ip.prototype,"backgroundFill",2),a([Te],Ip.prototype,"backgroundFillOpacity",2),a([Te],Ip.prototype,"repeat",2),a([Te],Ip.prototype,"fit",2);var Rp=class extends De{constructor(){super(...arguments),this.item=new xp,this.series=new Ep,this.text=new Ap}};a([Te],Rp.prototype,"item",2),a([Te],Rp.prototype,"series",2),a([Te],Rp.prototype,"text",2);var kp=class extends De{constructor(){super(...arguments),this.visible=!0,this.focusPriority=1/0,this.showInLegend=!0,this.cursor="default",this.nodeClickRange="exact",this.highlight=new Mp,this.highlightStyle=new Rp}handleUnknownProperties(e,t){"context"in t&&(this.context=t.context,e.delete("context"))}};a([Te],kp.prototype,"id",2),a([Te],kp.prototype,"visible",2),a([Te],kp.prototype,"focusPriority",2),a([Te],kp.prototype,"showInLegend",2),a([Te],kp.prototype,"cursor",2),a([Te],kp.prototype,"nodeClickRange",2),a([Te],kp.prototype,"highlight",2),a([Te],kp.prototype,"highlightStyle",2);var Pp=class extends wp{constructor(){super(...arguments),this.enabled=!0,this.shape="circle",this.size=6,this.fillGradientDefaults=new Tp,this.fillPatternDefaults=new Dp,this.fillImageDefaults=new Ip,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(){const{size:e,shape:t,fill:i,fillOpacity:n,stroke:s,strokeWidth:r,strokeOpacity:o,lineDash:a,lineDashOffset:l}=this;return{size:e,shape:t,fill:i,fillOpacity:n,stroke:s,strokeWidth:r,strokeOpacity:o,lineDash:a,lineDashOffset:l}}getDiameter(){return this.size+this.strokeWidth}};a([Te,K()],Pp.prototype,"enabled",2),a([Te,Y({equals:$})],Pp.prototype,"shape",2),a([Te,K()],Pp.prototype,"size",2),a([Te,Y({equals:P})],Pp.prototype,"fill",2),a([Te],Pp.prototype,"fillGradientDefaults",2),a([Te],Pp.prototype,"fillPatternDefaults",2),a([Te],Pp.prototype,"fillImageDefaults",2),a([Te,K()],Pp.prototype,"fillOpacity",2),a([Te,K()],Pp.prototype,"stroke",2),a([Te,K()],Pp.prototype,"strokeWidth",2),a([Te,K()],Pp.prototype,"strokeOpacity",2),a([Te],Pp.prototype,"lineDash",2),a([Te],Pp.prototype,"lineDashOffset",2),a([Te,Y({equals:$})],Pp.prototype,"itemStyler",2);var _p=class extends De{constructor(){super(...arguments),this.enabled=!1}};a([Te],_p.prototype,"enabled",2);var Lp=class extends De{constructor(){super(...arguments),this.interaction=new _p,this.position=new qc,this.range=void 0,this.class=void 0}formatTooltip(e,t,i,n){const s=null==this.renderer?void 0:ps(e,t,this.renderer,[n]);return"string"==typeof s?{type:"raw",rawHtmlString:s}:null!=s?{type:"structured",...i,...s}:{type:"structured",...i}}};a([Te],Lp.prototype,"enabled",2),a([Te],Lp.prototype,"showArrow",2),a([Te],Lp.prototype,"renderer",2),a([Te],Lp.prototype,"interaction",2),a([Te],Lp.prototype,"position",2),a([Te],Lp.prototype,"range",2),a([Te],Lp.prototype,"class",2);var Np=class{constructor(e,t,i){this.root=new Gp(e,t,i)}clear(e){this.root.clear(e)}addValue(e,t){const i={hitTester:e,value:t,distanceSquared:(t,i)=>e.distanceSquared(t,i)};this.root.addElem(i)}find(e,t){const i={best:{nearest:void 0,distanceSquared:1/0}};return this.root.find(e,t,i),i.best}},Op=class{constructor(e,t,i,n){this.nw=e,this.ne=t,this.sw=i,this.se=n}addElem(e){this.nw.addElem(e),this.ne.addElem(e),this.sw.addElem(e),this.se.addElem(e)}find(e,t,i){this.nw.find(e,t,i),this.ne.find(e,t,i),this.sw.find(e,t,i),this.se.find(e,t,i)}},Fp=class{constructor(e,t,i){this.capacity=e,this.maxdepth=t,this.boundary=i??m.NaN,this.elems=[],this.subdivisions=void 0}clear(e){this.elems.length=0,this.boundary=e,this.subdivisions=void 0}addElem(e){this.addCondition(e)&&(void 0===this.subdivisions?0===this.maxdepth||this.elems.length<this.capacity?this.elems.push(e):this.subdivide(e):this.subdivisions.addElem(e))}find(e,t,i){this.findCondition(e,t,i)&&(void 0===this.subdivisions?this.findAction(e,t,i):this.subdivisions.find(e,t,i))}subdivide(e){this.subdivisions=this.makeSubdivisions();for(const e of this.elems)this.subdivisions.addElem(e);this.subdivisions.addElem(e),this.elems.length=0}makeSubdivisions(){const{x:e,y:t,width:i,height:n}=this.boundary,{capacity:s}=this,r=this.maxdepth-1,o=i/2,a=n/2,l=new m(e,t,o,a),c=new m(e+o,t,o,a),h=new m(e,t+a,o,a),u=new m(e+o,t+a,o,a);return new Op(this.child(s,r,l),this.child(s,r,c),this.child(s,r,h),this.child(s,r,u))}},Gp=class e extends Fp{addCondition(e){const{x:t,y:i}=e.hitTester.midPoint;return this.boundary.containsPoint(t,i)}findCondition(e,t,i){const{best:n}=i;return 0!==n.distanceSquared&&this.boundary.distanceSquared(e,t)<n.distanceSquared}findAction(e,t,i){const n=p(e,t,this.elems,i.best.distanceSquared);void 0!==n.nearest&&n.distanceSquared<i.best.distanceSquared&&(i.best=n)}child(t,i,n){return new e(t,i,n)}},Bp=class extends bc{constructor({clipFocusBox:e,categoryKey:t,...i}){super(i),this.categoryKey=t,this.clipFocusBox=e??!0}getScaleInformation({xScale:e,yScale:t}){return{isContinuousX:cr.is(e),isContinuousY:cr.is(t),xScaleType:e?.type,yScaleType:t?.type}}getModulePropertyDefinitions(){const e=this.axes.x?.scale,t=this.axes.y?.scale;return this.moduleMap.mapModules(i=>i.getPropertyDefinitions(this.getScaleInformation({xScale:e,yScale:t}))).flat()}async requestDataModel(e,t,i){i.props.push(...this.getModulePropertyDefinitions());const{dataModel:n,processedData:s}=await e.request(this.id,t??[],i);return this.dataModel=n,this.processedData=s,this.dispatch("data-processed",{dataModel:n,processedData:s}),{dataModel:n,processedData:s}}isProcessedDataAnimatable(){const e=this.processedData?.reduced?.animationValidation;if(!e)return!0;const{orderedKeys:t,uniqueKeys:i}=e;return t&&i}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}pickFocus(e){const t=this.getNodeData();if(void 0===t||0===t.length)return;const i=this.computeFocusDatumIndex(e,t);if(void 0===i)return;const{clipFocusBox:n}=this,s=t[i],r={...e,datumIndex:i},o=this.computeFocusBounds(r);return void 0!==o?{bounds:o,clipFocusBox:n,datum:s,datumIndex:i}:void 0}isDatumEnabled(e,t){const{missing:i=!1,enabled:n=!0,focusable:s=!0}=e[t];return!i&&n&&s}computeFocusDatumIndex(e,t){const i=(e,i)=>{for(;e>=0&&!this.isDatumEnabled(t,e);)e+=i;return-1===e?void 0:e},s=(e,i)=>{for(;e<t.length&&!this.isDatumEnabled(t,e);)e+=i;return e===t.length?void 0:e};let r;const o=(0,n.qE)(0,e.datumIndex,t.length-1);return r=e.datumIndexDelta<0?i(o,e.datumIndexDelta):e.datumIndexDelta>0?s(o,e.datumIndexDelta):s(o,1)??i(o,-1),void 0===r?0===e.datumIndexDelta?void 0:e.datumIndex-e.datumIndexDelta:r}keysOrValues(e){const t=this.dataModel.resolveProcessedDataIndexById(this,e);return this.processedData?.keys[t]?.get(this.id)??this.processedData?.columns[t]??[]}getCategoryKey(){return this.categoryKey}getCategoryValue(e){const{processedData:t,dataModel:i}=this,n=this.getCategoryKey();if(t&&i&&n)return t.invalidData?.get(this.id)?.[e]?void 0:this.keysOrValues(n)[e]}datumIndexForCategoryValue(e){const{processedData:t,dataModel:i}=this,n=this.getCategoryKey();if(!t||!i||!n)return;e=e.valueOf();const s=t.invalidData?.get(this.id),r=this.keysOrValues(n);for(let t=0;t<r.length;t+=1){if(!0===s?.[t])continue;const i=r[t]?.valueOf();if(P(e,i))return t}}},Vp={x:["xKey"],y:["yKey"]},Hp={x:["xName"],y:["yName"]},Up=class extends yc{constructor(e,t,i,n){super(e,t,i,n),this.xKey=n.properties.xKey,this.yKey=n.properties.yKey}},zp=class extends kp{constructor(){super(...arguments),this.pickOutsideVisibleMinorAxis=!1}};a([Te],zp.prototype,"legendItemName",2),a([Te],zp.prototype,"pickOutsideVisibleMinorAxis",2);var Wp=100,jp=class extends Bp{constructor({pathsPerSeries:e=["path"],hasMarkers:t=!1,hasHighlightedLabels:i=!1,pathsZIndexSubOrderOffset:n=[],datumSelectionGarbageCollection:s=!0,markerSelectionGarbageCollection:r=!0,animationAlwaysUpdateSelections:o=!1,animationResetFns:a,directionKeys:l,directionNames:c,...h}){if(super({directionKeys:l,directionNames:c,canHaveAxes:!0,...h}),this.NodeEvent=Up,this.dataNodeGroup=this.contentGroup.appendChild(new Mt({name:`${this.id}-series-dataNodes`,zIndex:0})),this.markerGroup=this.contentGroup.appendChild(new Mt({name:`${this.id}-series-markers`,zIndex:1})),this.labelGroup=this.contentGroup.appendChild(new It({name:`${this.id}-series-labels`})),this.labelSelection=da.select(this.labelGroup,_i),this.highlightSelection=da.select(this.highlightNode,()=>this.opts.hasMarkers?new Nc:this.nodeFactory()),this.highlightLabelSelection=da.select(this.highlightLabel,_i),this.annotationSelections=new Set,this.debug=v.create(),!l||!c)throw new Error(`Unable to initialise series type ${this.type}`);this.opts={pathsPerSeries:e,hasMarkers:t,hasHighlightedLabels:i,pathsZIndexSubOrderOffset:n,directionKeys:l,directionNames:c,animationResetFns:a,animationAlwaysUpdateSelections:o,datumSelectionGarbageCollection:s,markerSelectionGarbageCollection:r},this.paths=e.map(e=>new Cc({name:`${this.id}-${e}`})),this.datumSelection=da.select(this.dataNodeGroup,()=>this.nodeFactory(),s),this.markerSelection=da.select(this.markerGroup,Nc,r),this.animationState=new Ca("empty",{empty:{update:{target:"ready",action:e=>this.animateEmptyUpdateReady(e)},reset:"empty",skip:"ready",disable:"disabled"},ready:{updateData:"waiting",clear:"clearing",highlight:e=>this.animateReadyHighlight(e),highlightMarkers:e=>this.animateReadyHighlightMarkers(e),resize:e=>this.animateReadyResize(e),reset:"empty",skip:"ready",disable:"disabled"},waiting:{update:{target:"ready",action:e=>{this.ctx.animationManager.isSkipped()?this.resetAllAnimation(e):this.animateWaitingUpdateReady(e)}},reset:"empty",skip:"ready",disable:"disabled"},disabled:{update:e=>this.resetAllAnimation(e),reset:"empty"},clearing:{update:{target:"empty",action:e=>this.animateClearingUpdateEmpty(e)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}get contextNodeData(){return this._contextNodeData}getNodeData(){return this.contextNodeData?.nodeData}attachSeries(e,t,i){super.attachSeries(e,t,i),this.attachPaths(this.paths,t,i)}detachSeries(e,t,i){super.detachSeries(e,t,i),this.detachPaths(this.paths,t,i)}updatedDomains(){this.animationState.transition("updateData")}attachPaths(e,t,i){for(const t of e)this.contentGroup.appendChild(t)}detachPaths(e,t,i){for(const t of e)this.contentGroup.removeChild(t)}renderToOffscreenCanvas(){const e=this.getNodeData();return null!=e&&e.length>Wp}resetAnimation(e){"initial"===e?this.animationState.transition("reset"):"ready"===e?this.animationState.transition("skip"):"disabled"===e&&this.animationState.transition("disable")}addChartEventListeners(){this.destroyFns.push(this.ctx.chartEventManager.addListener("legend-item-click",e=>this.onLegendItemClick(e)),this.ctx.chartEventManager.addListener("legend-item-double-click",e=>this.onLegendItemDoubleClick(e)))}destroy(){super.destroy(),this._contextNodeData=void 0}update({seriesRect:e}){const{visible:t,_contextNodeData:i}=this,n=this.ctx.highlightManager?.getActiveHighlight()?.series,s=n===this,r=this.checkResize(e),o=this.updateHighlightSelection(s);this.updateSelections(t),this.updateNodes(o,s,t);const a=this.getAnimationData(e,i);a&&(r&&this.animationState.transition("resize",a),this.animationState.transition("update",a))}updateSelections(e){var t;const i=!this.opts.animationAlwaysUpdateSelections&&this.ctx.animationManager.isSkipped();if((e||!i)&&(this.nodeDataRefresh||this.isPathOrSelectionDirty())){if(this.nodeDataRefresh){this.nodeDataRefresh=!1,this.debug("CartesianSeries.updateSelections() - calling createNodeData() for",this.id),this.markQuadtreeDirty(),this._contextNodeData=this.createNodeData();const e=this.isProcessedDataAnimatable();this._contextNodeData&&((t=this._contextNodeData).animationValid??(t.animationValid=e));const{dataModel:i,processedData:n}=this;void 0!==i&&void 0!==n&&this.dispatch("data-update",{dataModel:i,processedData:n})}this.updateSeriesSelections()}}updateSeriesSelections(e){const{datumSelection:t,labelSelection:i,markerSelection:n,paths:s}=this,r=this._contextNodeData;if(!r)return;const{nodeData:o,labelData:a,itemId:l}=r;this.updatePaths({seriesHighlighted:e,itemId:l,contextData:r,paths:s}),this.datumSelection=this.updateDatumSelection({nodeData:o,datumSelection:t}),this.labelSelection=this.updateLabelSelection({labelData:a,labelSelection:i})??i,this.opts.hasMarkers&&(this.markerSelection=this.updateMarkerSelection({nodeData:o,markerSelection:n}))}getShapeFillBBox(){const{axes:e}=this,t=e.x,i=e.y,[n,s]=or(t?.range??[0,1]),[r,o]=or(i?.range??[0,1]),a=this.getSeriesDomain("x"),l=[t?.scale.convert(a.at(0)),t?.scale.convert(a.at(-1))],c=this.getSeriesDomain("y"),h=[i?.scale.convert(c.at(0)),i?.scale.convert(c.at(-1))],[u,d]=or(l),[p,g]=or(h);return{axis:new m(n,r,s-n,o-r),series:new m(u,p,d-u,g-p)}}updateNodes(e,t,i){const{highlightSelection:n,highlightLabelSelection:s,opts:{hasMarkers:r,hasHighlightedLabels:o}}=this,a=!this.ctx.animationManager.isSkipped(),l=this.visible&&null!=this._contextNodeData&&i;this.contentGroup.visible=a||l,this.highlightGroup.visible=(a||l)&&t;const c=this.getOpacity();r?(this.updateMarkerNodes({markerSelection:n,isHighlight:!0}),this.animationState.transition("highlightMarkers",n)):(this.updateDatumNodes({datumSelection:n,isHighlight:!0}),this.animationState.transition("highlight",n)),o&&this.updateLabelNodes({labelSelection:s});const{dataNodeGroup:h,markerGroup:u,datumSelection:d,labelSelection:p,markerSelection:g,paths:f,labelGroup:m}=this,{itemId:y}=this.contextNodeData??{};h.opacity=c,h.visible=a||l,m.visible=l,r&&(u.opacity=c,u.visible=l),m&&(m.opacity=c),this.updatePathNodes({seriesHighlighted:t,itemId:y,paths:f,opacity:c,visible:l,animationEnabled:a}),h.visible&&(this.updateDatumNodes({datumSelection:d,highlightedItems:e,isHighlight:!1}),this.usesPlacedLabels||this.updateLabelNodes({labelSelection:p}),r&&this.updateMarkerNodes({markerSelection:g,isHighlight:!1}))}getHighlightLabelData(e,t){const i=e.filter(e=>e.datum===t.datum&&e.itemId===t.itemId);return 0===i.length?void 0:i}getHighlightData(e,t){return t?[t]:void 0}updateHighlightSelection(e){const{highlightSelection:t,highlightLabelSelection:i,_contextNodeData:n}=this;if(!n)return;const s=this.ctx.highlightManager?.getActiveHighlight(),r=e&&s?.datum?s:void 0;let o,a;if(null!=r){const e=this.isLabelEnabled(),{labelData:t,nodeData:i}=n;a=this.getHighlightData(i,r),o=e?this.getHighlightLabelData(t,r):void 0}return this.highlightSelection=this.updateHighlightSelectionItem({items:a,highlightSelection:t}),this.highlightLabelSelection=this.updateHighlightSelectionLabel({items:o,highlightLabelSelection:i}),a}markQuadtreeDirty(){this.quadtree=void 0}*datumNodesIter(){for(const{node:e}of this.datumSelection)!0!==e.datum.missing&&(yield e)}getQuadTree(){if(void 0===this.quadtree){const{width:e,height:t}=this.ctx.scene.canvas,i=new m(0,0,e,t);this.quadtree=new Np(100,10,i),this.initQuadTree(this.quadtree)}return this.quadtree}initQuadTree(e){}pickNodesExactShape(e){const t=super.pickNodesExactShape(e);if(0!==t.length)return t;const{x:i,y:n}=e,{opts:{hasMarkers:s}}=this,{dataNodeGroup:r,markerGroup:o}=this;let a=r.pickNodes(i,n).filter(e=>!0!==e.datum.missing);if(0===a.length&&s&&(a=o?.pickNodes(i,n).filter(e=>!0!==e.datum.missing)),0!==a.length)return a.map(e=>e.datum);for(const t of this.moduleMap.modules()){const{datum:i}=t.pickNodeExact(e)??{};if(null!=i&&!0!==i?.missing)return[i]}return[]}pickNodeClosestDatum(e){const{x:t,y:i}=e,{axes:n,_contextNodeData:s}=this;if(!s)return;const r=n.x,o=n.y,a=t,l=i;let c,h=1/0;for(const e of s.nodeData){const{point:{x:t=NaN,y:i=NaN}={}}=e;if(isNaN(t)||isNaN(i))continue;if(!r?.inRange(t)||!o?.inRange(i))continue;const n=Math.max((a-t)**2+(l-i)**2,0);n<h&&(h=n,c=e)}for(const t of this.moduleMap.modules()){const i=t.pickNodeNearest(e);if(void 0!==i&&i.distanceSquared<h){h=i.distanceSquared,c=i.datum;break}}return c?{datum:c,distance:Math.max(Math.sqrt(h)-(c.point?.size??0)/2,0)}:void 0}pickNodeMainAxisFirst(e,t){const{x:i,y:n}=e,{axes:s,_contextNodeData:r}=this,{pickOutsideVisibleMinorAxis:o}=this.properties;if(!r)return;const a=s.x,l=s.y,c=[a,l].filter(Mh.is).map(e=>e.direction);if(t&&0===c.length)return;const[h="x"]=c,u=[i,n];"x"!==h&&u.reverse();const d=[1/0,1/0];let p;for(const e of r.nodeData){const{x:t=NaN,y:i=NaN}=e.point??e.midPoint??{};if(isNaN(t)||isNaN(i)||!0===e.missing)continue;const n=[a?.inRange(t),l?.inRange(i)];if("x"!==h&&n.reverse(),!n[0]||!o&&!n[1])continue;const s=[t,i];"x"!==h&&s.reverse();let r=!0;for(let e=0;e<s.length;e++){const t=Math.abs(s[e]-u[e]);if(t>d[e]){r=!1;break}t<d[e]&&(d[e]=t,d.fill(1/0,e+1,d.length))}r&&(p=e)}if(p){let t=Math.max(d[0]**2+d[1]**2-(p.point?.size??0),0);for(const i of this.moduleMap.modules()){const n=i.pickNodeMainAxisFirst(e);if(void 0!==n&&n.distanceSquared<t){p=n.datum,t=n.distanceSquared;break}}return{datum:p,distance:Math.sqrt(t)}}}isPathOrSelectionDirty(){return!1}shouldFlipXY(){return!1}visibleRange(e,t,i){const n=this.keysOrValues(e);return Xs(i?.length??n.length,t,e=>{const t=i?.[e]??e;return this.xCoordinateRange(n[t],0,t)})}domainForVisibleRange(e,t,i,n,s,r){const{processedData:o,dataModel:a}=this,[l,c]=n,h=this.keysOrValues(i);if(s){const e=this.visibleRange(i,n,r);return a.getDomainBetweenRange(this,t,e,o)}const u=t.map(e=>this.keysOrValues(e));let d=1/0,p=-1/0;return h.forEach((e,i)=>{const[n,s]=this.xCoordinateRange(e,0,i);if(!(s<l||n>c))for(let e=0;e<t.length;e++){const t=u[e][i];d=Math.min(d,t),p=Math.max(p,t)}}),d>p?[NaN,NaN]:[d,p]}domainForClippedRange(e,t,i,s){const{processedData:r,dataModel:o,axes:a}=this,l=function(e){let t,i;if((e instanceof Hu||e instanceof Wu)&&({min:t,max:i}=e),null!=t||null!=i)return t??(t=-1/0),i??(i=1/0),[t,i]}(a["x"===e?"y":"x"]);if(!l)return t.flatMap(e=>o.getDomain(this,e,"value",r));const c=this.keysOrValues(i);if(s){const e=function(e,t,i){const s=t[0].valueOf(),r=t[1].valueOf(),o=(0,n.S3)(0,e-1,e=>{const t=i(e)?.valueOf();return!Number.isFinite(t)||t>=s});let a=(0,n.I5)(0,e-1,e=>{const t=i(e)?.valueOf();return!Number.isFinite(t)||t<=r});return null==o||null==a?[0,0]:(a=Math.min(a+1,e),[o,a])}(c.length,l,e=>c[e]);return o.getDomainBetweenRange(this,t,e,r)}const h=t.map(e=>this.keysOrValues(e)),u=l[0].valueOf(),d=l[1].valueOf(),p=[];return c.forEach((e,t)=>{const i=e.valueOf();if(i<u||i>d)return;const n=h.map(e=>e[t]);i>=u&&p.push(...n),i<=d&&p.push(...n)}),p}countVisibleItems(e,t,i,s,r){const{dataModel:o,processedData:a}=this;if(!o||!a)return 1/0;const l=this.keysOrValues(e),c=t.map(e=>o.resolveColumnById(this,e,a)),h=this.axes.x,u=this.axes.y,d=this.shouldFlipXY(),p=h.range,g=u.range,f=(e,t,i)=>e[0]+(i-t[0])/(t[1]-t[0])*(e[1]-e[0]),m=f(p,h.visibleRange,i[0]),y=f(p,h.visibleRange,i[1]),v=f(g,u.visibleRange,d?s[0]:s[1]),b=f(g,u.visibleRange,d?s[1]:s[0]),C=Math.round((i[0]+(i[1]-i[0])/2)*l.length);return Qs(0,l.length-1,C,r,e=>{let[t,i]=this.xCoordinateRange(l[e],0,e),[s,r]=this.yCoordinateRange(c.map(t=>t[e]),0,e);return!!((0,n.Bf)(t)&&(0,n.Bf)(i)&&(0,n.Bf)(s)&&(0,n.Bf)(r))&&(d&&([t,i,s,r]=[s,r,t,i]),t>=m&&i<=y&&s>=v&&r<=b)})}updateHighlightSelectionItem(e){const{opts:{hasMarkers:t}}=this,{items:i,highlightSelection:n}=e,s=i??[];if(t){const e=n;return this.updateMarkerSelection({nodeData:s,markerSelection:e})}return this.updateDatumSelection({nodeData:s,datumSelection:n})}updateHighlightSelectionLabel(e){return this.updateLabelSelection({labelData:e.items??[],labelSelection:e.highlightLabelSelection})}updateDatumSelection(e){return e.datumSelection}updateDatumNodes(e){}updateMarkerSelection(e){return e.markerSelection}updateMarkerNodes(e){}updatePaths(e){e.paths.forEach(e=>e.visible=!1)}updatePathNodes(e){const{paths:t,opacity:i,visible:n}=e;for(const e of t)e.opacity=i,e.visible=n}resetPathAnimation(e){const{path:t}=this.opts?.animationResetFns??{};t&&e.paths.forEach(e=>{ua([e],t)})}resetDatumAnimation(e){const{datum:t}=this.opts?.animationResetFns??{};t&&ua([e.datumSelection],t)}resetLabelAnimation(e){const{label:t}=this.opts?.animationResetFns??{};t&&ua([e.labelSelection],t)}resetMarkerAnimation(e){const{marker:t}=this.opts?.animationResetFns??{};t&&this.opts.hasMarkers&&ua([e.markerSelection],t)}resetAllAnimation(e){this.ctx.animationManager.stopByAnimationGroupId(this.id),this.resetPathAnimation(e),this.resetDatumAnimation(e),this.resetLabelAnimation(e),this.resetMarkerAnimation(e),!1===e.contextData?.animationValid&&this.ctx.animationManager.skipCurrentBatch()}animateEmptyUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateWaitingUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateReadyHighlight(e){const{datum:t}=this.opts?.animationResetFns??{};t&&ua([e],t)}animateReadyHighlightMarkers(e){const{marker:t}=this.opts?.animationResetFns??{};t&&ua([e],t)}animateReadyResize(e){this.resetAllAnimation(e)}animateClearingUpdateEmpty(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}getAnimationData(e,t){const{_contextNodeData:i}=this;if(i)return{datumSelection:this.datumSelection,markerSelection:this.markerSelection,labelSelection:this.labelSelection,annotationSelections:[...this.annotationSelections],contextData:i,previousContextData:t,paths:this.paths,seriesRect:e}}updateLabelSelection(e){return e.labelSelection}getScaling(e){if(e instanceof Bu){const{range:t,domain:i}=e;return{type:"log",convert:t=>e.convert(t),domain:[i[0],i[1]],range:[t[0],t[1]]}}if(e instanceof cr){const{range:t,domain:i}=e;return{type:"continuous",domain:[i[0],i[1]],range:[t[0],t[1]]}}if(e instanceof to){const{domain:t}=e;return{type:"category",domain:t,inset:e.inset,step:e.step}}}calculateScaling(){const e={};for(const t of Object.values(Gi)){const i=this.axes[t];if(!i)continue;const n=this.getScaling(i.scale);null!=n&&(e[t]=n)}return e}},$p=class extends De{constructor(){super(...arguments),this.type="linear",this.tension=1,this.position="end"}};a([Te],$p.prototype,"type",2),a([Te],$p.prototype,"tension",2),a([Te],$p.prototype,"position",2);var Kp=class extends zp{constructor(){super(...arguments),this.xName=void 0,this.fill="#c16068",this.fillGradientDefaults=new Tp,this.fillPatternDefaults=new Dp,this.fillImageDefaults=new Ip,this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new $p,this.shadow=new Sp,this.marker=new Pp,this.label=new pl,this.tooltip=new Lp,this.connectMissingData=!1}};function Yp(e){switch(e.type){case"linear":case"step":return[{x:e.x0,y:e.y0},{x:e.x1,y:e.y1}];case"cubic":return[{x:e.cp0x,y:e.cp0y},{x:e.cp3x,y:e.cp3y}]}}function qp(e,t,i){const[n,s]=Yp(e),r=s.x!==n.x?(i.x-t.x)/(s.x-n.x):0,o=s.y!==n.y?(i.y-t.y)/(s.y-n.y):0;switch(e.type){case"linear":return{type:"linear",moveTo:e.moveTo,x0:t.x,y0:t.y,x1:i.x,y1:i.y};case"cubic":return{type:"cubic",moveTo:e.moveTo,cp0x:t.x,cp0y:t.y,cp1x:i.x-(e.cp2x-n.x)*r,cp1y:i.y-(e.cp2y-n.y)*o,cp2x:i.x-(e.cp1x-n.x)*r,cp2y:i.y-(e.cp1y-n.y)*o,cp3x:i.x,cp3y:i.y};case"step":return{type:"step",moveTo:e.moveTo,x0:t.x,y0:t.y,x1:i.x,y1:i.y,stepX:i.x-(e.stepX-n.x)*r}}}function Xp(e,t,i){const{moveTo:n}=e,[s,r]=function(e){const t=Yp(e);return t[0].x>t[1].x&&t.reverse(),t}(e),{x:o,y:a}=s,{x:l,y:c}=r;if(i<o)return qp(e,s,s);if(t>l)return qp(e,r,r);switch(e.type){case"linear":{const e=a===c?void 0:(c-a)/(l-o);return{type:"linear",moveTo:n,x0:t,y0:null==e?a:e*(t-o)+a,x1:i,y1:null==e?a:e*(i-o)+a}}case"step":if(i<=e.stepX){const s=e.y0;return{type:"step",moveTo:n,x0:t,y0:s,x1:i,y1:s,stepX:i}}if(t>=e.stepX){const s=e.y1;return{type:"step",moveTo:n,x0:t,y0:s,x1:i,y1:s,stepX:t}}{const{y0:s,y1:r,stepX:o}=e;return{type:"step",moveTo:n,x0:t,y0:s,x1:i,y1:r,stepX:o}}case"cubic":{const s=qe(e.cp0x,e.cp1x,e.cp2x,e.cp3x,t);let[r,o]=Xe(e.cp0x,e.cp0y,e.cp1x,e.cp1y,e.cp2x,e.cp2y,e.cp3x,e.cp3y,s);const a=qe(o[0].x,o[1].x,o[2].x,o[3].x,i);return[o,r]=Xe(o[0].x,o[0].y,o[1].x,o[1].y,o[2].x,o[2].y,o[3].x,o[3].y,a),{type:"cubic",moveTo:n,cp0x:o[0].x,cp0y:o[0].y,cp1x:o[1].x,cp1y:o[1].y,cp2x:o[2].x,cp2y:o[2].y,cp3x:o[3].x,cp3y:o[3].y}}}}a([Te],Kp.prototype,"xKey",2),a([Te],Kp.prototype,"xName",2),a([Te],Kp.prototype,"yKey",2),a([Te],Kp.prototype,"yName",2),a([Te],Kp.prototype,"yFilterKey",2),a([Te],Kp.prototype,"normalizedTo",2),a([Te],Kp.prototype,"fill",2),a([Te],Kp.prototype,"fillGradientDefaults",2),a([Te],Kp.prototype,"fillPatternDefaults",2),a([Te],Kp.prototype,"fillImageDefaults",2),a([Te],Kp.prototype,"fillOpacity",2),a([Te],Kp.prototype,"stroke",2),a([Te],Kp.prototype,"strokeWidth",2),a([Te],Kp.prototype,"strokeOpacity",2),a([Te],Kp.prototype,"lineDash",2),a([Te],Kp.prototype,"lineDashOffset",2),a([Te],Kp.prototype,"interpolation",2),a([Te],Kp.prototype,"shadow",2),a([Te],Kp.prototype,"marker",2),a([Te],Kp.prototype,"label",2),a([Te],Kp.prototype,"tooltip",2),a([Te],Kp.prototype,"connectMissingData",2);var Zp={start:0,middle:.5,end:1},Qp=.05;function Jp(e,t,i){return(t-e)*i+e}function eg(e,t){return"linear"===e.type?function(e,t){const{x0:i,y0:n,x1:s,y1:r}=e,o=(r-n)/(s-i)*(t-i)+n;return{leftCp1x:i,leftCp1y:n,leftCp2x:t,leftCp2y:o,stepX:t,stepY0:o,stepY1:o,rightCp1x:t,rightCp1y:o,rightCp2x:s,rightCp2y:r}}(e,t):"cubic"===e.type?function(e,t){const{cp0x:i,cp0y:n,cp1x:s,cp1y:r,cp2x:o,cp2y:a,cp3x:l,cp3y:c}=e,h=qe(i,s,o,l,t),[u,d]=Xe(i,n,s,r,o,a,l,c,h),p=u[3].y;return{leftCp1x:u[1].x,leftCp1y:u[1].y,leftCp2x:u[2].x,leftCp2y:u[2].y,stepX:t,stepY0:p,stepY1:p,rightCp1x:d[1].x,rightCp1y:d[1].y,rightCp2x:d[2].x,rightCp2y:d[2].y}}(e,t):function(e){const{x0:t,y0:i,x1:n,y1:s,stepX:r}=e;return{leftCp1x:(t+r)/2,leftCp1y:i,leftCp2x:(t+r)/2,leftCp2y:i,stepX:r,stepY0:i,stepY1:s,rightCp1x:(r+n)/2,rightCp1y:s,rightCp2x:(r+n)/2,rightCp2y:s}}(e)}function tg(e,t,i,n,s,r,o){switch(t){case 0:o?e.moveTo(s,r):e.moveTo(i,n);break;case 1:o?e.lineTo(s,r):e.lineTo(i,n)}}function ig(e,t,i,n,s,r){r?e.lineTo(t,i):e.lineTo(n,s)}function ng(e,t,i,n,s,r,o,a,l,c){c?e.cubicCurveTo(r,o,n,s,t,i):e.cubicCurveTo(n,s,r,o,a,l)}function sg(e,t,i,n,s,r,o){o?(e.lineTo(r,s),e.lineTo(r,i),e.lineTo(t,i)):(e.lineTo(r,i),e.lineTo(r,s),e.lineTo(n,s))}function rg(e,t,i,n){const[s,r]=Yp(t);switch(tg(e,i,s.x,s.y,r.x,r.y,n),t.type){case"linear":ig(e,t.x0,t.y0,t.x1,t.y1,n);break;case"cubic":ng(e,t.cp0x,t.cp0y,t.cp1x,t.cp1y,t.cp2x,t.cp2y,t.cp3x,t.cp3y,n);break;case"step":sg(e,t.x0,t.y0,t.x1,t.y1,t.stepX,n)}}function og(e,t,i){const[n,s]=Yp(e),[r,o]=Yp(t);return[{x:Jp(n.x,r.x,i),y:Jp(n.y,r.y,i)},{x:Jp(s.x,o.x,i),y:Jp(s.y,o.y,i)}]}function ag(e,t,i,n,s,r){const[{x:o,y:a},{x:l,y:c}]=og(t,i,n);if(tg(e,s,o,a,l,c,r),"cubic"===t.type&&"cubic"===i.type)ng(e,o,a,Jp(t.cp1x,i.cp1x,n),Jp(t.cp1y,i.cp1y,n),Jp(t.cp2x,i.cp2x,n),Jp(t.cp2y,i.cp2y,n),l,c,r);else if("step"===t.type&&"step"===i.type)sg(e,o,a,l,c,Jp(t.stepX,i.stepX,n),r);else if("linear"===t.type&&"linear"===i.type)ig(e,o,a,l,c,r);else{let s;s="step"===t.type?t.stepX:"step"===i.type?i.stepX:(o+l)/2;const h=eg(t,s),u=eg(i,s),d=Jp(h.leftCp1x,u.leftCp1x,n),p=Jp(h.leftCp1y,u.leftCp1y,n),g=Jp(h.leftCp2x,u.leftCp2x,n),f=Jp(h.leftCp2y,u.leftCp2y,n),m=Jp(h.stepX,u.stepX,n),y=Jp(h.stepY0,u.stepY0,n),v=Jp(h.stepY1,u.stepY1,n),b=Jp(h.rightCp1x,u.rightCp1x,n),C=Jp(h.rightCp1y,u.rightCp1y,n),w=Jp(h.rightCp2x,u.rightCp2x,n),S=Jp(h.rightCp2y,u.rightCp2y,n);r?(e.cubicCurveTo(w,S,b,C,m,v),e.lineTo(m,y),e.cubicCurveTo(g,f,d,p,o,a)):(e.cubicCurveTo(d,p,g,f,m,y),e.lineTo(m,v),e.cubicCurveTo(b,C,w,S,l,c))}}var lg=(e=>(e[e.Zero=0]="Zero",e[e.Split=1]="Split",e))(lg||{});function cg(e,t){if(!t)return NaN;if(e instanceof Date&&(e=e.getTime()),"continuous"===t.type&&"number"==typeof e)return(e-t.domain[0])/(t.domain[1]-t.domain[0])*(t.range[1]-t.range[0])+t.range[0];if("log"===t.type&&"number"==typeof e)return t.convert(e);if("category"!==t.type)return NaN;let i=t.domain.findIndex(t=>t===e);return-1===i&&(i=t.domain.findIndex(t=>{return n=t,null!=(i=e)&&null!=n&&"object"==typeof i&&"object"==typeof n&&("id"in i&&"id"in n?i.id===n.id:i.toString()===n.toString());var i,n})),i>=0?t.inset+t.step*i:NaN}function hg(e){return sl(e).valueOf()}function ug({data:e},t){return e.map((e,i)=>({xValue0Index:t.indexOf(hg(e.xValue0)),xValue1Index:t.indexOf(hg(e.xValue1)),datumIndex:i}))}function dg(e,t,i){if(i.xValue1Index===i.xValue0Index+1)return e;const n=Yp(e),s=(n[1].x-n[0].x)/(i.xValue1Index-i.xValue0Index),r=n[0].x+(t-i.xValue0Index)*s;return Xp(e,r,r+s)}function pg(e,t){const[i,n]=Yp(e),s=cg(0,t.scales.y);return qp(e,{x:i.x,y:s},{x:n.x,y:s})}function gg(e){const[t,i]=Yp(e);return function(e,t){const{x:i,y:n}=t;switch(e.type){case"linear":return{type:"linear",moveTo:e.moveTo,x0:i,y0:n,x1:i,y1:n};case"step":return{type:"step",moveTo:e.moveTo,x0:i,y0:n,x1:i,y1:n,stepX:i};case"cubic":return{type:"cubic",moveTo:e.moveTo,cp0x:i,cp0y:n,cp1x:i,cp1y:n,cp2x:i,cp2y:n,cp3x:i,cp3y:n}}}(e,{x:(t.x+i.x)/2,y:(t.y+i.y)/2})}function fg(e,t,i,n,s,r){let o,a;if(s.xValue0Index>=r.xValue1Index){const e=n.findLast(e=>e.xValue1Index<=r.xValue1Index)?.datumIndex,t=null!=e?i.data[e]:void 0;o=t?.xValue1,a=t?.yValue1}else if(s.xValue0Index<=r.xValue0Index){const e=n.find(e=>e.xValue0Index>=r.xValue0Index)?.datumIndex,t=null!=e?i.data[e]:void 0;o=t?.xValue0,a=t?.yValue0}if(null==o||null==a)switch(t){case 0:return pg(e,i);case 1:return gg(e)}const l={x:cg(o,i.scales.x),y:cg(a,i.scales.y)};return qp(e,l,l)}function mg(e,t){if(null==t)return;const i=hg(e.xValue0),n=hg(e.xValue1);return t.find(e=>hg(e.xValue0)===i&&hg(e.xValue1)===n)?.span}function yg(e,t,i,n,s,r,o){const a=e.data[n.datumIndex],l=a.span,c=mg(a,s);if(null!=c)o.removed.push({from:c,to:c}),o.moved.push({from:c,to:l}),o.added.push({from:l,to:l});else{const s=fg(l,t,e,i,n,r);o.added.push({from:s,to:l})}}function vg(e,t,i,n,s,r,o){const a=e.data[n.datumIndex],l=a.span,c=mg(a,s);if(null!=c)o.removed.push({from:l,to:l}),o.moved.push({from:l,to:c}),o.added.push({from:c,to:c});else{const s=fg(l,t,e,i,n,r);o.removed.push({from:l,to:s})}}function bg(e,t,i,n,s){const r=t[s.xValue0Index],o=i.data.find(e=>hg(e.xValue0)===r),a=t[s.xValue1Index],l=i.data.find(e=>hg(e.xValue1)===a);if(null==o||null==l)return;const[{x:c},{x:h}]=Yp(e),u=cg(o.xValue0,i.scales.x),d=cg(o.yValue0,i.scales.y),p=cg(l.xValue1,i.scales.x),g=cg(l.yValue1,i.scales.y);let f=n.data[s.datumIndex].span;return f=qp(f,{x:u,y:d},{x:p,y:g}),f=Xp(f,c,h),f}function Cg(e,t,i,n,s,r,o,a,l){const c=s+1,h=o.find(e=>e.xValue0Index<=s&&e.xValue1Index>=c),u=r.find(e=>e.xValue0Index<=s&&e.xValue1Index>=c),d=t.zeroData,p=e.zeroData;if(null==h&&null!=u)return void yg(e,i,r,u,d,a,l);if(null!=h&&null==u)return void vg(t,i,o,h,p,a,l);if(null==h||null==u)return;let g;g=h.xValue0Index===u.xValue0Index&&h.xValue1Index===u.xValue1Index?0:h.xValue0Index<=u.xValue0Index&&h.xValue1Index>=u.xValue1Index?-1:h.xValue0Index>=u.xValue0Index&&h.xValue1Index<=u.xValue1Index?1:0;const f=dg(t.data[h.datumIndex].span,s,h),m=dg(e.data[u.datumIndex].span,s,u);if(1===g){const s=bg(f,n,t,e,u);null!=s?(l.removed.push({from:f,to:s}),l.moved.push({from:s,to:m}),l.added.push({from:m,to:m})):vg(t,i,o,h,p,a,l)}else if(-1===g){const s=bg(m,n,e,t,h);null!=s?(l.removed.push({from:f,to:f}),l.moved.push({from:f,to:s}),l.added.push({from:s,to:m})):yg(e,i,r,u,d,a,l)}else l.removed.push({from:f,to:f}),l.moved.push({from:f,to:m}),l.added.push({from:m,to:m})}function wg(e,t,i){const{span:n}=t;switch(i){case 0:return mg(t,e.zeroData)??pg(n,e);case 1:return gg(n)}}function Sg(e,t,i){if(!function(e,t){const i=t.scales.x,n=e.scales.x;if("category"!==i?.type||"category"!==n?.type)return!0;let s=-1/0;for(const e of i.domain){const t=cg(e,n);if(Number.isFinite(t)){if(t<s)return!1;s=t}}return!0}(e,t))return;const n=function(e,t){const i=new Map;for(const{xValue0:t,xValue1:n}of e.data){const e=hg(t),s=hg(n);i.set(e,t).set(s,n)}const n=Array.from(i,([e,t])=>({axisValue:e,value:t}));n.sort((t,i)=>cg(t.value,e.scales.x)-cg(i.value,e.scales.x));const s=[];for(const{xValue0:e,xValue1:n}of t.data){const t=hg(e),r=hg(n);i.has(t)||(i.set(t,e),s.push({axisValue:t,value:e})),i.has(r)||(i.set(r,n),s.push({axisValue:r,value:n}))}s.sort((e,i)=>cg(e.value,t.scales.x)-cg(i.value,t.scales.x));const r=n;let o=0;for(const e of s){for(let i=r.length-1;i>o;i-=1)if(cg(e.value,t.scales.x)>cg(r[i].value,t.scales.x)){o=i+1;break}r.splice(o,0,e),o+=1}if(!function(e,t){let i=-1/0;for(const n of e){const e=cg(n.value,t.scales.x);if(Number.isFinite(e)){if(e<i)return!1;i=e}}return!0}(r,t))return;const a=r.map(e=>e.axisValue);return{axisValues:a,oldDataAxisIndices:ug(t,a),newDataAxisIndices:ug(e,a)}}(e,t);return null==n?function(e,t,i){const n=[],s=[];for(const e of t.data){const n=e.span,r=wg(t,e,i);s.push({from:n,to:r})}for(const t of e.data){const s=t.span,r=wg(e,t,i);n.push({from:r,to:s})}return{removed:s,moved:[],added:n}}(e,t,i):function(e,t,i,n){const s={removed:[],moved:[],added:[]},{axisValues:r,oldDataAxisIndices:o,newDataAxisIndices:a}=e,l={xValue0Index:Math.max(o.at(0)?.xValue0Index??-1/0,a.at(0)?.xValue0Index??-1/0),xValue1Index:Math.min(o.at(-1)?.xValue1Index??1/0,a.at(-1)?.xValue1Index??1/0)};for(let e=0;e<r.length-1;e+=1)Cg(t,i,n,r,e,a,o,l,s);return s}(n,e,t,i)}function xg(e){return"continuous"===e.type||"log"===e.type}function Eg(e){return"category"===e.type}function Ag(e,t){return void 0===e||void 0===t?void 0!==e||void 0!==t:xg(e)&&xg(t)?e.type===t.type&&(0,n.r1)(e.domain,t.domain)&&(0,n.r1)(e.range,t.range):!(!Eg(e)||!Eg(t))&&e.inset===t.inset&&e.step===t.step&&(0,n.r1)(e.domain,t.domain)}function Mg(e){return null!=e&&("category"===e.type?e.domain.every(e=>null!=e):e.domain.every(e=>Number.isFinite(e)||e instanceof Date)&&e.range.every(e=>Number.isFinite(e)))}function Tg(e,t){let i;const n=e.map(e=>e.point);switch(t.type){case"linear":i=function(e){const t=[];let i=0,n=NaN,s=NaN;for(const{x:r,y:o}of e){if(i>0){const e=1===i;t.push({type:"linear",moveTo:e,x0:n,y0:s,x1:r,y1:o})}i+=1,n=r,s=o}return t}(n);break;case"smooth":i=function(e,t){const i=Array.isArray(e)?e:Array.from(e);if(i.length<=1)return[];const n=i.map((e,t)=>{const n=0===t?e:i[t-1],s=t===i.length-1?e:i[t+1],r=0===t||t===i.length-1;if(Math.sign(n.y-e.y)===Math.sign(s.y-e.y))return 0;if(!r){const t=Math.abs(n.y-s.y),i=Math.abs(e.y-n.y)/t,r=Math.abs(e.y-s.y)/t;if(i<=Qp||1-i<=Qp||r<=Qp||1-r<=Qp)return 0}return(s.y-n.y)/(s.x-n.x)});0===n[1]&&(n[0]*=2),0===n[n.length-2]&&(n[n.length-1]*=2);const s=[];for(let e=1;e<i.length;e+=1){const r=i[e-1],o=n[e-1],a=i[e],l=n[e],c=a.x-r.x,h=a.y-r.y;let u=c*t/3,d=c*o*t/3,p=c*t/3,g=c*l*t/3;0===l&&Math.abs(d)>Math.abs(h)&&(u*=Math.abs(h/d),d=Math.sign(d)*Math.abs(h)),0===o&&Math.abs(g)>Math.abs(h)&&(p*=Math.abs(h/g),g=Math.sign(g)*Math.abs(h)),s.push({type:"cubic",moveTo:1===e,cp0x:r.x,cp0y:r.y,cp1x:r.x+u,cp1y:r.y+d,cp2x:a.x-p,cp2y:a.y-g,cp3x:a.x,cp3y:a.y})}return s}(n,t.tension);break;case"step":i=function(e,t){const i=[];let n=0,s=NaN,r=NaN;const o="number"==typeof t?t:Zp[t];for(const{x:t,y:a}of e){if(n>0){const e=1===n,l=s+(t-s)*o;i.push({type:"step",moveTo:e,x0:s,y0:r,x1:t,y1:a,stepX:l})}n+=1,s=t,r=a}return i}(n,t.position)}return i.map((t,i)=>({span:t,xValue0:e[i].xDatum,yValue0:e[i].yDatum,xValue1:e[i+1].xDatum,yValue1:e[i+1].yDatum}))}function Dg(e,t,i=.001){return Math.abs(e.x-t.x)<i&&Math.abs(e.y-t.y)<i}function Ig({path:e},t){let i;for(const{span:n}of t){const[t,s]=Yp(n);rg(e,n,null!=i&&Dg(i,t)?1:0,!1),i=s}}function Rg(e,t,i){let n;for(const s of i){const[i,r]=og(s.from,s.to,e),o=null!=n&&Dg(n,i)?1:0;ag(t.path,s.from,s.to,e,o,!1),n=r}}function kg(e,t,i){return{status:e,path:{addPhaseFn:(e,i)=>Rg(e,i,t.added),updatePhaseFn:(e,i)=>Rg(e,i,t.moved),removePhaseFn:(e,i)=>Rg(e,i,t.removed)},pathProperties:Pg(e,i)}}function Pg(e,t){const i="none"===t?"updated":e,n={fromFn:t=>{let n;return n="removed"===e?{finish:{visible:!1}}:"added"===e?{start:{visible:!0}}:{},{phase:oa[i],...n}},toFn:e=>({phase:oa[i]})};return"fade"===t?{fromFn:t=>({opacity:"added"===e?0:t.opacity,...n.fromFn(t)}),toFn:t=>({opacity:"removed"===e?0:1,...n.toFn(t)})}:n}function _g(e,t,i){if("category"===e.scales.x?.type!=("category"===t.scales.x?.type)||!Mg(e.scales.x)||!Mg(t.scales.x))return;if(null==e.strokeData||null==t.strokeData)return;let n="updated";t.visible&&!e.visible?n="removed":!t.visible&&e.visible&&(n="added");const s=Sg({scales:e.scales,data:e.strokeData.spans},{scales:t.scales,data:t.strokeData.spans},1);return null!=s?{status:n,stroke:kg(n,s,"fade"),hasMotion:(i?.changed??!0)||!Ag(e.scales.x,t.scales.x)||!Ag(e.scales.y,t.scales.y)||"updated"!==n}:void 0}function Lg({path:e},{spans:t,phantomSpans:i}){for(let n=0;n<t.length;n+=1){const{span:s}=t[n],r=i[n].span;rg(e,s,0,!1),rg(e,r,1,!0),e.closePath()}}function Ng(e,{path:t},i,n){for(let s=0;s<i.length;s+=1){const r=i[s],o=n[s];ag(t,r.from,r.to,e,0,!1),ag(t,o.from,o.to,e,1,!0),t.closePath()}}function Og(e,t,i,n){return{status:e,path:{addPhaseFn:(e,n)=>Ng(e,n,t.added,i.added),updatePhaseFn:(e,n)=>Ng(e,n,t.moved,i.moved),removePhaseFn:(e,n)=>Ng(e,n,t.removed,i.removed)},pathProperties:Pg(e,n)}}function Fg(e,t){if("category"===e.scales.x?.type!=("category"===t.scales.x?.type)||!Mg(e.scales.x)||!Mg(t.scales.x))return;let i="updated";t.visible&&!e.visible?i="removed":!t.visible&&e.visible&&(i="added");const n=Sg({scales:e.scales,data:e.fillData.spans},{scales:t.scales,data:t.fillData.spans},0);if(null==n)return;const s=Sg({scales:e.scales,data:e.fillData.phantomSpans},{scales:t.scales,data:t.fillData.phantomSpans},0);if(null==s)return;const r=Sg({scales:e.scales,data:e.strokeData.spans,zeroData:e.fillData.phantomSpans},{scales:t.scales,data:t.strokeData.spans,zeroData:t.fillData.phantomSpans},0);if(null==r)return;const o="none";return{status:i,fill:Og(i,n,s,o),stroke:kg(i,r,o)}}function Gg({id:e},t,i,...n){la(e,"markers",t,n,{opacity:0},{opacity:1},{phase:i?oa[i]:"trailing"}),n.forEach(e=>e.cleanup())}function Bg({id:e},t,...i){la(e,"markers",t,i,{scalingX:0,scalingY:0},{scalingX:1,scalingY:1},{phase:"initial"}),i.forEach(e=>e.cleanup())}function Vg({id:e,nodeDataDependencies:t},i,...s){const r=t.seriesRectWidth;aa(e,"markers",i,s,{fromFn:(e,t)=>{const i=t.midPoint?.x??r;let s=(0,n.qE)(0,Rs(i/r),1);return isNaN(s)&&(s=0),{scalingX:0,scalingY:0,delay:s,duration:.2,phase:"initial"}},toFn:()=>({scalingX:1,scalingY:1})})}function Hg(e){return{opacity:1,scalingX:1,scalingY:1}}function Ug(e,t){return{x:t.point?.x??NaN,y:t.point?.y??NaN,scalingCenterX:t.point?.x??NaN,scalingCenterY:t.point?.y??NaN}}function zg(e,{datumIndex:t}){const i=e.getNodeData();if(void 0===i)return;const n=i[t],{point:s}=n??{};if(null==n||null==s)return;const r=4+(s.focusSize??e.getFormattedMarkerStyle(n).size),o=r/2,a=n.point.x-o,l=n.point.y-o;return St.toCanvas(e.contentGroup,new m(a,l,r,r))}function Wg({id:e,visible:t,nodeDataDependencies:i},n,...s){const{seriesRectWidth:r,seriesRectHeight:o}=i;la(e,"path_properties",n,s,{clipX:0},{clipX:r},{phase:"initial",start:{clip:!0,clipY:o,visible:t},finish:{clip:!1,visible:t}})}function jg({id:e},t,i,n="add",...s){la(e,t,i,s,{opacity:0},{opacity:1},{phase:n})}function $g(e){return t=>({visible:e.getVisible(),opacity:e.getOpacity(),clipScalingX:1,clip:!1})}function Kg({nodeDataDependencies:e},t){const i=e=>isFinite(e)?e:0;t.clipX=i(e.seriesRectWidth),t.clipY=i(e.seriesRectHeight)}var Yg=class extends jp{constructor(e){super({moduleCtx:e,directionKeys:Vp,directionNames:Hp,categoryKey:"xValue",pathsPerSeries:["fill","stroke"],pathsZIndexSubOrderOffset:[0,1e3],hasMarkers:!0,markerSelectionGarbageCollection:!1,pickModes:[2,0],animationResetFns:{path:$g({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:Cp,marker:(e,t)=>({opacity:1,scalingX:1,scalingY:1,...Ug(0,t)})},clipFocusBox:!1}),this.properties=new Kp,this.connectsToYAxis=!0,this.backgroundGroup=new Mt({name:`${this.id}-background`,zIndex:0}),this._isStacked=void 0}get pickModeAxis(){return"main"}renderToOffscreenCanvas(){return super.renderToOffscreenCanvas()||null!=this.contextNodeData&&(this.contextNodeData.fillData.spans.length>Wp||this.contextNodeData.strokeData.spans.length>Wp)}attachSeries(e,t,i){super.attachSeries(e,t,i),e.appendChild(this.backgroundGroup)}detachSeries(e,t,i){super.detachSeries(e,t,i),e?.removeChild(this.backgroundGroup)}attachPaths([e,t]){this.backgroundGroup.appendChild(e),this.contentGroup.appendChild(t),t.zIndex=-1}detachPaths([e,t]){this.backgroundGroup.removeChild(e),this.contentGroup.removeChild(t)}isStacked(){return(this.seriesGrouping?.stackCount??1)>1}setSeriesIndex(e){const t=this.isStacked();return!(!super.setSeriesIndex(e)&&this._isStacked===t||(this._isStacked=t,t?(this.backgroundGroup.zIndex=[0,e],this.contentGroup.zIndex=[1,e,0]):(this.backgroundGroup.zIndex=[1,e,0,0],this.contentGroup.zIndex=[1,e,0,1]),0))}async processData(e){if(null==this.data)return;const{data:t,visible:i,seriesGrouping:{groupIndex:s=this.id,stackCount:r=1}={}}=this,{xKey:o,yKey:a,yFilterKey:l,connectMissingData:c,normalizedTo:h}=this.properties,u=!this.ctx.animationManager.isSkipped(),d=this.axes.x?.scale,p=this.axes.y?.scale,{xScaleType:g,yScaleType:f}=this.getScaleInformation({xScale:d,yScale:p}),m={value:`area-stack-${s}-yValue`,values:`area-stack-${s}-yValues`,stack:`area-stack-${s}-yValue-stack`,marker:`area-stack-${s}-yValues-marker`},y=[];(0,n.vM)(h)&&y.push(ru(Object.values(m),h)),u&&y.push(cu());const v={invalidValue:null};((0,n.vM)(h)||c)&&r>1&&(v.invalidValue=0),i||(v.forceValue=0),await this.requestDataModel(e,t,{props:[jh(o,g,{id:"xValue"}),$h(a,f,{id:"yValueRaw",...v}),...null!=l?[$h(l,f,{id:"yFilterRaw"})]:[],...eu(a,f,{id:"yValueStack",...v,groupId:m.stack}),$h(a,f,{id:"yValue",...v,groupId:m.value}),...Jh(a,"window","current",{id:"yValueEnd",...v,groupId:m.values},f),...Jh(a,"normal","current",{id:"yValueCumulative",...v,groupId:m.marker},f),...y],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")}xCoordinateRange(e,t){const{marker:i}=this.properties,n=this.axes.x.scale.convert(e),s=i.enabled?.5*i.size*t:0;return[n-s,n+s]}yCoordinateRange(e,t){const{marker:i}=this.properties,n=this.axes.y.scale.convert(e[0]),s=i.enabled?.5*i.size*t:0;return[n-s,n+s]}getSeriesDomain(e){const{processedData:t,dataModel:i,axes:n}=this;if(!t||!i)return[];const s=n.y;if("x"===e){const e=i.resolveProcessedDataDefById(this,"xValue"),n=i.getDomain(this,"xValue","key",t);return"key"===e?.def.type&&"category"===e.def.valueType?n:No(Dh(n))}const r=this.domainForClippedRange("y",["yValueCumulative"],"xValue",!0);return No(s instanceof Uu||s instanceof Wu?r:Number.isFinite(r[1]-r[0])?[r[0]>0?0:r[0],r[1]<0?0:r[1]]:[])}getSeriesRange(e,t){const[i,n]=this.domainForVisibleRange("y",["yValueCumulative"],"xValue",t,!0);return[Math.min(i,0),Math.max(n,0)]}getVisibleItems(e,t,i){return this.countVisibleItems("xValue",["yValueCumulative"],e,t,i)}createNodeData(){const{axes:e,data:t,processedData:i,dataModel:s}=this,r=e.x,o=e.y;if(!(r&&o&&t&&s&&"grouped"===i?.type))return;const{yKey:a,xKey:l,yFilterKey:c,marker:h,label:u,fill:d,stroke:p,connectMissingData:g,interpolation:f}=this.properties,{scale:m}=r,{scale:y}=o,{isContinuousY:v}=this.getScaleInformation({xScale:m,yScale:y}),b=(m.bandwidth??0)/2,C=s.resolveKeysById(this,"xValue",i),w=s.resolveColumnById(this,"yValueEnd",i),S=s.resolveColumnById(this,"yValueRaw",i),x=s.resolveColumnById(this,"yValueCumulative",i),E=null!=c?s.resolveColumnById(this,"yFilterRaw",i):void 0,A=s.resolveColumnById(this,"yValueStack",i),M=(e,t,i)=>{let s;return((0,n.vM)(this.properties.normalizedTo)?v&&nl(i):!isNaN(i))&&(s=t),{x:m.convert(e)+b,y:y.convert(s),size:h.size}},T=[],D=[],{visibleSameStackCount:I}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);let R=!1;const{dataSources:k}=i,P=k.get(this.id)??[];for(const{datumIndex:e}of s.forEachGroupDatum(this,i)){const t=C[e];if(null==t)return;const i=P[e],n=S[e],s=x[e],r=w[e],o=Number.isFinite(n),c=M(t,+s,n),g=null!=E?E[e]===n:void 0;if(!1===g&&(R=!0),o&&h&&D.push({series:this,itemId:a,datum:i,datumIndex:e,midPoint:{x:c.x,y:c.y},cumulativeValue:r,yValue:n,xValue:t,yKey:a,xKey:l,point:c,fill:h.fill??d,stroke:h.stroke??p,strokeWidth:h.strokeWidth??this.getStrokeWidth(this.properties.strokeWidth),selected:g}),o&&u){const t=this.getLabelText(u,{value:n,datum:i,xKey:l,yKey:a,xName:this.properties.xName,yName:this.properties.yName});T.push({series:this,itemId:a,datum:i,datumIndex:e,x:c.x,y:c.y,labelText:t})}}const _=(e,t)=>({point:{x:m.convert(e)+b,y:y.convert(t)},xDatum:e,yDatum:t}),L=e=>{const t=[];for(const{datumIndexes:[n,r,o]}of s.forEachGroupDatumTuple(this,i)){const i=C[r],s=A[r],a=s[e],l=Number.isFinite(a);if(g&&!l)continue;const c=null!=n?A[n]:void 0,h=null!=o?A[o]:void 0;let u=0,d=0;for(let t=0;t<=e;t+=1){const e=s[t];Number.isFinite(e)&&((null==c||Number.isFinite(c[t]))&&(u+=e),(null==h||Number.isFinite(h[t]))&&(d+=e))}const p=t[t.length-1];if(g||u===d&&l){const e=g?a:Math.max(u,d),n=_(i,e);Array.isArray(p)?p.push(n):null!=p?(p.skip+=1,t.push([n])):t.push([n])}else if(!l&&Array.isArray(p)&&1===p.length)t[t.length-1]={skip:1};else{const e=_(i,u),n=_(i,d);Array.isArray(p)?p.push(e):null!=p&&(p.skip+=1),t.push(l?[n]:{skip:0})}}return(e=>e.flatMap(e=>Array.isArray(e)?Tg(e,f):new Array(e.skip).fill(null)))(t)},N=this.seriesGrouping?.stackIndex??0,O=()=>Tg(Array.from(s.forEachGroupDatum(this,i),({datumIndex:e})=>{const t=C[e],i=A[e][N];if(!g||Number.isFinite(i))return _(t,0)}).filter(e=>null!=e),f),F=L(N),G=F.map(()=>null);for(let e=N-1;e>=-1;e-=1){let t;for(let i=0;i<G.length;i+=1)null==G[i]&&(t??(t=-1!==e?L(e):O()),G[i]=t[i])}const B=F.map((e,t)=>e??G[t]),V=F.filter(e=>null!=e);return{itemId:a,fillData:{itemId:a,spans:B,phantomSpans:G},strokeData:{itemId:a,spans:V},labelData:T,nodeData:D,scales:this.calculateScaling(),visible:this.visible,stackVisible:I>0,crossFiltering:R}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(e){const{opacity:t,visible:i,animationEnabled:n}=e,[s,r]=e.paths,o=!0===this.contextNodeData?.crossFiltering,a=this.getStrokeWidth(this.properties.strokeWidth);r.setProperties({fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:1,stroke:this.properties.stroke,strokeWidth:a,strokeOpacity:this.properties.strokeOpacity*(o?.25:1),lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset,opacity:t,visible:i||n}),fc(s,{fill:dc(this.properties.fill,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults),stroke:void 0,fillOpacity:this.properties.fillOpacity*(o?.125:1)},void 0,this.getShapeFillBBox()),s.setProperties({lineJoin:"round",pointerEvents:1,fillShadow:this.properties.shadow,opacity:t,visible:i||n}),Kg(this,r),Kg(this,s)}updatePaths(e){this.updateAreaPaths(e.paths,e.contextData)}updateAreaPaths(e,t){for(const i of e)i.visible=t.visible;if(t.visible)this.updateFillPath(e,t),this.updateStrokePath(e,t);else for(const t of e)t.path.clear(),t.markDirty("AreaSeries")}updateFillPath(e,t){const[i]=e;i.path.clear(),Lg(i,t.fillData),i.markDirty("AreaSeries")}updateStrokePath(e,t){const{spans:i}=t.strokeData,[,n]=e;n.path.clear(),Ig(n,i),n.markDirty("AreaSeries")}updateMarkerSelection(e){const{nodeData:t,markerSelection:i}=e,n=this.properties.marker.enabled||!0===this.contextNodeData?.crossFiltering;return this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(n?t:[])}updateMarkerNodes(e){const{markerSelection:t,isHighlight:i}=e,{xKey:n,yKey:s,marker:r,fill:o,stroke:a,strokeWidth:l,fillOpacity:c,strokeOpacity:h,highlightStyle:u}=this.properties,d=this.getSeriesDomain("x"),p=this.getSeriesDomain("y"),g=L(i&&u.item,r.getStyle(),{fill:o,stroke:a,strokeWidth:l,fillOpacity:c,strokeOpacity:h}),f=this.getShapeFillBBox();t.each((e,t)=>{this.updateMarkerStyle(r,e,t.datum,t.point,qs(t,n,s,d,p),i,g,f,{selected:t.selected})}),i||this.properties.marker.markClean()}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t)}updateLabelNodes(e){const{labelSelection:t}=e,{enabled:i,fontStyle:n,fontWeight:s,fontSize:r,fontFamily:o,color:a}=this.properties.label;t.each((e,t)=>{const{x:l,y:c,labelText:h}=t;h&&i&&this.visible?(e.fontStyle=n,e.fontWeight=s,e.fontSize=r,e.fontFamily=o,e.textAlign="center",e.textBaseline="bottom",e.text=h,e.x=l,e.y=c-10,e.fill=a,e.visible=!0):e.visible=!1})}getTooltipContent(e){const{id:t,dataModel:i,processedData:n,axes:s,properties:r}=this,{xKey:o,xName:a,yKey:l,yName:c,tooltip:h,marker:u}=r,d=s.x,p=s.y;if(!(i&&n&&d&&p))return;const g=n.dataSources.get(this.id)?.[e],f=i.resolveKeysById(this,"xValue",n)[e],m=i.resolveColumnById(this,"yValueRaw",n)[e],{xDomain:y,yDomain:v}=this.cachedDatumCallback("domain",()=>({xDomain:this.getSeriesDomain("x"),yDomain:this.getSeriesDomain("y")}));if(null==f)return;const b=u.getStyle(),C={datum:g,xValue:f,yValue:m},w=this.getMarkerStyle(u,g,qs(C,o,l,y,v),!1,void 0,b);return this.formatTooltipWithContext(h,{heading:d.formatDatum(f),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:p.formatDatum(m)}]},{seriesId:t,datum:g,title:c,xKey:o,xName:a,yKey:l,yName:c,...w,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:e,stroke:t,fillOpacity:i,strokeOpacity:n,strokeWidth:s,lineDash:r,marker:o,fillGradientDefaults:a,fillPatternDefaults:l,fillImageDefaults:c}=this.properties,h=!o.enabled||void 0===o.fill,u=h?dc(e,a,l,c):dc(o.fill,o.fillGradientDefaults,o.fillPatternDefaults,o.fillImageDefaults);return{marker:{...this.getMarkerStyle(o,void 0,void 0,!1,void 0,{fill:u,fillOpacity:h?i:o.fillOpacity}),enabled:o.enabled||s<=0},line:{stroke:t,strokeOpacity:n,strokeWidth:s,lineDash:r}}}getLegendData(e){if("category"!==e)return[];const{id:t,ctx:{legendManager:i},visible:n}=this,{yKey:s,yName:r,legendItemName:o,showInLegend:a}=this.properties;return[{legendType:e,id:t,itemId:s,seriesId:t,enabled:n&&i.getItemEnabled({seriesId:t,itemId:s}),label:{text:o??r??s},symbol:this.legendItemSymbol(),legendItemName:o,hideInLegend:!a}]}animateEmptyUpdateReady(e){const{markerSelection:t,labelSelection:i,contextData:n,paths:s}=e,{animationManager:r}=this.ctx;this.updateAreaPaths(s,n),Wg(this,r,...s),ua([t],Ug),Vg(this,r,t),vp(this,"labels",r,i)}animateReadyResize(e){const{contextData:t,paths:i}=e;this.updateAreaPaths(i,t),super.animateReadyResize(e)}animateWaitingUpdateReady(e){const{animationManager:t}=this.ctx,{markerSelection:i,labelSelection:n,contextData:s,paths:r,previousContextData:o}=e,[a,l]=r;if(null==a&&null==l)return;this.resetMarkerAnimation(e),this.resetLabelAnimation(e);const c=()=>{this.resetPathAnimation(e),this.updateAreaPaths(r,s)},h=()=>{t.skipCurrentBatch(),c()};if(null==s||null==o)return c(),Gg(this,t,"added",i),jg(this,"fill_path_properties",t,"add",a),jg(this,"stroke_path_properties",t,"add",l),void vp(this,"labels",t,n);if(s.crossFiltering!==o.crossFiltering)return void h();const u=Fg(s,o);void 0!==u?"no-op"!==u.status&&(Gg(this,t,void 0,i),aa(this.id,"fill_path_properties",t,[a],u.fill.pathProperties),yp(this.id,"fill_path_update",t,[a],u.fill.path),aa(this.id,"stroke_path_properties",t,[l],u.stroke.pathProperties),yp(this.id,"stroke_path_update",t,[l],u.stroke.path),vp(this,"labels",t,n),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateAreaPaths(r,s)})):h()}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new Mt}getFormattedMarkerStyle(e){const{xKey:t,yKey:i}=e,n=this.getSeriesDomain("x"),s=this.getSeriesDomain("y");return this.getMarkerStyle(this.properties.marker,e.datum,qs(e,t,i,n,s),!0)}computeFocusBounds(e){return zg(this,e)}};Yg.className="AreaSeries",Yg.type="area";var qg=(0,n.KC)("millisecond","second","minute","hour","day","month","year"),Xg=(0,n.W$)(n.t$,"a valid number format string"),Zg={enabled:n.zM,text:n.Yj,padding:n.ai,...n.LV},Qg=(0,n.W$)({enabled:n.zM,type:(0,n.mw)((0,n.KC)("line","range")),range:(0,n.Uo)((0,n.W$)((e,{options:t})=>"range"===t.type,"crossLine type to be 'range'"),(0,n.jk)(n.sw),(0,n.O9)(2,2)),value:(0,n.Uo)((0,n.W$)((e,{options:t})=>"line"===t.type,"crossLine type to be 'line'"),n.sw),label:Zg,fill:n.Yj,fillOpacity:n.CG,...n.AF,...n.mL},"cross-line options"),Jg={...Qg,label:{...Zg,position:(0,n.KC)("top","left","right","bottom","top-left","top-right","bottom-left","bottom-right","inside","inside-left","inside-right","inside-top","inside-bottom","inside-top-left","inside-bottom-left","inside-top-right","inside-bottom-right"),rotation:n.ai}},ef={enabled:n.zM,rotation:n.ai,avoidCollisions:n.zM,minSpacing:n.Ly,spacing:n.Ly,formatter:n.E2,itemStyler:(0,n.YI)({...n.LV,spacing:n.ai}),...n.LV},tf={autoRotate:n.zM,autoRotateAngle:n.ai,...ef},nf={format:Xg,...tf},sf={format:(0,n.or)(n.Yj,n.Ik),...tf},rf={enabled:n.zM,width:n.Ly,size:n.Ly,stroke:n.yW},of={enabled:n.zM,label:sf,tick:rf},af={reverse:n.zM,gridLine:{enabled:n.zM,width:n.Ly,style:(0,n.J$)({stroke:(0,n.or)(n.yW,n.I_),lineDash:(0,n.jk)(n.Ly)},"a grid-line style object array")},interval:{values:(0,n.jk)(n.sw),minSpacing:n.Ly},label:ef,line:{enabled:n.zM,width:n.Ly,stroke:n.yW},tick:rf};af.context=(0,n._L)(()=>!0),af.layoutConstraints=(0,n._L)({stacked:(0,n.mw)(n.zM),align:(0,n.mw)((0,n.KC)("start","end")),unit:(0,n.mw)((0,n.KC)("percent","px")),width:(0,n.mw)(n.Ly)});var lf={...af,keys:(0,n.jk)(n.Yj),crossLines:(0,n.J$)(Jg,"a cross-line options array"),position:(0,n.KC)("top","right","bottom","left"),thickness:n.Ly,title:{enabled:n.zM,text:n.Yj,spacing:n.Ly,formatter:n.E2,...n.LV}};function cf(e){const t={enabled:n.zM,xOffset:n.ai,yOffset:n.ai,renderer:(0,n.R3)((0,n.or)(n.Yj,(0,n.fd)({text:n.Yj,color:n.yW,backgroundColor:n.yW,opacity:n.CG},"crosshair label renderer result object")))};return e&&(t.format=n.Yj),{enabled:n.zM,snap:n.zM,label:t,...n.AF,...n.mL}}function hf(e,t){return{min:(0,n.Uo)(e,(0,n.Xe)("max")),max:(0,n.Uo)(e,(0,n.MM)("min")),nice:n.zM,interval:{step:t?(0,n.or)(n.MX,qg,(0,n.hR)(br)):n.MX,values:(0,n.jk)(e),minSpacing:(0,n.Uo)(n.Ly,(0,n.Xe)("maxSpacing")),maxSpacing:(0,n.Uo)(n.Ly,(0,n.MM)("minSpacing"))}}}lf.title._enabledFromTheme=(0,n._L)(n.zM);var uf=(0,n.or)((0,n.KC)("circle","cross","diamond","heart","plus","pin","square","star","triangle"),n.E2),df=(0,n.KC)("never","always","hyphenate","on-space"),pf=(0,n.KC)("top","right","bottom","left","top-right","bottom-right","bottom-left","top-left","center"),gf=(0,n.KC)("pointer","node","top","right","bottom","left","top-left","top-right","bottom-left","bottom-right"),ff=(0,n.or)(n.Ly,(0,n.KC)("exact","nearest")),mf=(0,n.KC)("pointer","start","middle","end"),yf={enabled:n.zM,text:n.Yj,textAlign:(0,n.KC)("left","center","right"),wrapping:(0,n.KC)("never","always","hyphenate","on-space"),spacing:n.Ly,maxWidth:n.Ly,maxHeight:n.Ly,...n.LV};yf.padding=(0,n._L)(n.Ly);var vf={enabled:n.zM,text:n.Yj,renderer:(0,n.R3)((0,n.or)(n.Yj,n.Sc))},bf=["defaults","download","zoom-to-cursor","pan-to-cursor","toggle-series-visibility","toggle-other-series","separator"],Cf={type:(0,n.KC)("action","separator"),showOn:(0,n.KC)("always","series-area","series-node","legend-item"),label:(0,n.mw)(n.Yj),enabled:n.zM,action:n.E2,items:(e,t)=>xf(e,t)};Cf.iconUrl=(0,n._L)(n.Yj);var wf=(0,n.fd)(Cf),Sf=(0,n.W$)((e,t)=>{let i;return"string"==typeof e?bf.includes(e)?i=!0:(i={valid:!1,invalid:[],cleared:null},i.invalid.push(new n.yI(n.By.Invalid,`a context menu item string alias: ["${bf.join('", "')}"]`,e,t.path))):i=wf(e,t),i},`a context menu item object or string alias: [${bf.join(", ")}]`),xf=(0,n.jk)(Sf,"a menu items array",!1),Ef=(0,n.J$)({label:(0,n.mw)(n.Yj),action:(0,n.mw)(n.E2)},"a context menu actions array"),Af={label:n.Yj,ariaLabel:n.Yj,tooltip:n.Yj,icon:(0,n.KC)("align-center","align-left","align-right","arrow-drawing","arrow-down-drawing","arrow-up-drawing","callout-annotation","candlestick-series","close","comment-annotation","date-range-drawing","date-price-range-drawing","delete","disjoint-channel-drawing","drag-handle","fill-color","line-style-solid","line-style-dashed","line-style-dotted","high-low-series","hlc-series","hollow-candlestick-series","horizontal-line-drawing","line-color","line-series","line-with-markers-series","locked","measurer-drawing","note-annotation","ohlc-series","pan-end","pan-left","pan-right","pan-start","parallel-channel-drawing","position-bottom","position-center","position-top","price-label-annotation","price-range-drawing","reset","settings","step-line-series","text-annotation","trend-line-drawing","fibonacci-retracement-drawing","fibonacci-retracement-trend-based-drawing","unlocked","vertical-line-drawing","zoom-in","zoom-out")},Mf={width:n.Ly,height:n.Ly,minWidth:n.Ly,minHeight:n.Ly,suppressFieldDotNotation:n.zM,title:yf,subtitle:yf,footnote:yf,padding:{top:n.Ly,right:n.Ly,bottom:n.Ly,left:n.Ly},seriesArea:{clip:n.zM,padding:{top:n.Ly,right:n.Ly,bottom:n.Ly,left:n.Ly}},legend:{enabled:n.zM,position:(0,n.KC)("top","right","bottom","left"),orientation:(0,n.KC)("horizontal","vertical"),maxWidth:n.Ly,maxHeight:n.Ly,spacing:n.Ly,preventHidingAll:n.zM,reverseOrder:n.zM,toggleSeries:n.zM,item:{marker:{size:n.Ly,shape:uf,padding:n.Ly,strokeWidth:n.Ly},line:{length:n.Ly,strokeWidth:n.Ly},label:{maxLength:n.Ly,formatter:n.E2,...n.LV},maxWidth:n.Ly,paddingX:n.Ly,paddingY:n.Ly,showSeriesStroke:n.zM},pagination:{marker:{size:n.Ly,shape:uf,padding:n.Ly},activeStyle:{...n.Fu,...n.AF},inactiveStyle:{...n.Fu,...n.AF},highlightStyle:{...n.Fu,...n.AF},label:n.LV},listeners:{legendItemClick:n.E2,legendItemDoubleClick:n.E2}},gradientLegend:{enabled:n.zM,position:(0,n.KC)("top","right","bottom","left"),spacing:n.Ly,reverseOrder:n.zM,gradient:{preferredLength:n.Ly,thickness:n.Ly},scale:{label:{...n.LV,format:Xg,formatter:n.E2},padding:n.Ly,interval:{step:n.ai,values:n.YO,minSpacing:(0,n.Uo)(n.Ly,(0,n.Xe)("maxSpacing")),maxSpacing:(0,n.Uo)(n.Ly,(0,n.MM)("minSpacing"))}}},listeners:{seriesNodeClick:n.E2,seriesNodeDoubleClick:n.E2,seriesVisibilityChange:n.E2,click:n.E2,doubleClick:n.E2,annotations:n.E2,zoom:n.E2},loadGoogleFonts:n.zM,highlight:{range:(0,n.KC)("tooltip","node")},overlays:{loading:vf,noData:vf,noVisibleSeries:vf,unsupportedBrowser:vf},tooltip:{enabled:n.zM,showArrow:n.zM,pagination:n.zM,delay:n.Ly,range:ff,wrapping:df,mode:(0,n.KC)("single","shared","compact"),position:{type:gf,anchorTo:(0,n.KC)("pointer","node","chart"),placement:(0,n.or)(pf,(0,n.jk)(pf)),xOffset:n.ai,yOffset:n.ai}},animation:{enabled:n.zM,duration:n.Ly},contextMenu:{enabled:n.zM,items:xf,extraActions:Ef,extraSeriesAreaActions:Ef,extraNodeActions:Ef,extraLegendItemActions:Ef},dataSource:{getData:n.E2},keyboard:{enabled:n.zM,tabIndex:n.ai},touch:{dragAction:(0,n.KC)("none","drag","hover")},ranges:{enabled:n.zM,buttons:(0,n.J$)({...Af,value:(0,n.or)(n.ai,(0,n.Uo)((0,n.jk)((0,n.or)(n.ai,n.p6)),(0,n.O9)(2,2)),n.E2)},"range button options array")},locale:{localeText:n.Ik,getLocaleText:(0,n.R3)(n.Yj)},background:{visible:n.zM,fill:n.yW,image:{url:(0,n.mw)(n.Yj),top:n.ai,right:n.ai,bottom:n.ai,left:n.ai,width:n.Ly,height:n.Ly,opacity:n.CG}},styleNonce:n.Yj,sync:{enabled:n.zM,groupId:n.Yj,axes:(0,n.KC)("x","y","xy"),nodeInteraction:n.zM,zoom:n.zM},zoom:{enabled:n.zM,enableAxisDragging:n.zM,enableDoubleClickToReset:n.zM,enablePanning:n.zM,enableScrolling:n.zM,enableSelecting:n.zM,enableTwoFingerZoom:n.zM,keepAspectRatio:n.zM,anchorPointX:mf,anchorPointY:mf,axes:(0,n.KC)("x","y","xy"),deceleration:(0,n.or)((0,n.KC)("off","short","long"),n.CG),minVisibleItems:n.Ly,minVisibleItemsX:n.Ly,minVisibleItemsY:n.Ly,panKey:(0,n.KC)("alt","ctrl","meta","shift"),scrollingStep:n.CG,autoScaling:{enabled:n.zM,padding:n.CG},buttons:{enabled:n.zM,buttons:(0,n.J$)({...Af,value:(0,n.KC)("reset","zoom-in","zoom-out","pan-left","pan-right","pan-start","pan-end"),section:n.Yj},"zoom button options array"),visible:(0,n.KC)("always","zoomed","hover")}}};Mf.dataSource.requestThrottle=(0,n._L)(n.Ly),Mf.dataSource.updateThrottle=(0,n._L)(n.Ly),Mf.dataSource.updateDuringInteraction=(0,n._L)(n.zM),Mf.zoom.enableIndependentAxes=(0,n._L)(n.zM),Mf.statusBar=(0,n._L)(n.sw),Mf.foreground=(0,n._L)({visible:n.zM,text:n.Yj,image:{url:n.Yj,top:n.ai,right:n.ai,bottom:n.ai,left:n.ai,width:n.Ly,height:n.Ly,opacity:n.CG},...n.Fu}),Mf.context=(0,n._L)(()=>!0),Mf.overrideDevicePixelRatio=(0,n._L)(n.ai),Mf.sync.domainMode=(0,n._L)((0,n.KC)("direction","position","key"));var Tf={cursor:n.Yj,showInLegend:n.zM,nodeClickRange:ff,listeners:{nodeClick:n.E2,nodeDoubleClick:n.E2},highlightStyle:{item:{...n.Fu,...n.AF},series:{enabled:n.zM,dimOpacity:n.CG,strokeWidth:n.Ly}}},Df={...Tf,id:n.Yj,visible:n.zM,data:n.YO};Df.context=(0,n._L)(()=>!0),Df.seriesGrouping=(0,n._L)(n.sw),Df.highlight=(0,n._L)({enabled:n.zM});var If={enabled:n.zM,shape:uf,size:n.Ly,itemStyler:(0,n.YI)({...n.Fu,...n.AF,...n.mL,shape:uf,size:n.Ly}),...n.Fu,...n.AF,...n.mL},Rf={enabled:n.zM,formatter:n.E2,...n.LV},kf={...Rf,lineHeight:n.Ly,minimumFontSize:n.Ly,wrapping:df,overflowStrategy:(0,n.KC)("ellipsis","hide")},Pf={visible:n.zM,cap:{visible:n.zM,length:n.Ly,lengthRatio:n.CG,...n.AF,...n.mL},...n.AF,...n.mL},_f={...Pf,xLowerKey:n.Yj,xUpperKey:n.Yj,yLowerKey:n.Yj,yUpperKey:n.Yj,xLowerName:n.Yj,xUpperName:n.Yj,yLowerName:n.Yj,yUpperName:n.Yj,itemStyler:(0,n.YI)({visible:n.zM,...n.AF,...n.mL,cap:{visible:n.zM,length:n.Ly,lengthRatio:n.CG,...n.AF,...n.mL}})},Lf={enabled:n.zM,showArrow:n.zM,range:ff,renderer:(0,n.R3)((0,n.or)(n.Yj,(0,n.fd)({heading:n.Yj,title:n.Yj,data:(0,n.J$)({label:(0,n.mw)(n.Yj),value:(0,n.mw)(n.Yj)})},"tooltip renderer result object"))),position:{type:gf,anchorTo:(0,n.KC)("node","pointer","chart"),placement:(0,n.or)(pf,(0,n.jk)(pf)),xOffset:n.ai,yOffset:n.ai},interaction:{enabled:n.zM}};Lf.position._seriesOverrideType=(0,n._L)(gf);var Nf={enabled:n.zM,xOffset:n.ai,yOffset:n.ai,blur:n.Ly,color:n.yW},Of=(0,n.is)({linear:{},smooth:{tension:n.CG},step:{position:(0,n.KC)("start","middle","end")}},"interpolation line options"),Ff={showInMiniChart:n.zM,connectMissingData:n.zM,interpolation:Of,label:Rf,marker:If,tooltip:Lf,shadow:Nf,...Tf,...n.Fu,...n.AF,...n.mL},Gf={...Ff,...Df,type:(0,n.mw)((0,n.dY)("area")),xKey:(0,n.mw)(n.Yj),yKey:(0,n.mw)(n.Yj),xName:n.Yj,yName:n.Yj,stacked:n.zM,stackGroup:n.Yj,normalizedTo:n.ai},Bf={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"area",moduleFactory:e=>new Yg(e),stackable:!0,tooltipDefaults:{range:"nearest"},defaultAxes:[{type:"number",position:"left"},{type:"category",position:"bottom"}],themeTemplate:{series:{nodeClickRange:"nearest",tooltip:{position:{_seriesOverrideType:"node"}},fill:{$palette:"fill"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:gp,fillImageDefaults:fp,stroke:{$palette:"stroke"},fillOpacity:.8,strokeOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,shadow:{enabled:!1,color:Rd,xOffset:3,yOffset:3,blur:5},interpolation:{type:"linear"},marker:{enabled:!1,shape:"circle",size:7,strokeWidth:0,fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:gp},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}}}},Vf={type:"series",name:"area",chartType:"cartesian",options:Gf,create:e=>new Yg(e)};function Hf(e,t){for(const i of t){const t=i.datum;void 0===t?n.Vy.error("undefined datum"):e.addValue(i,t)}}function Uf(e,t){const{x:i,y:n}=t,{nearest:s,distanceSquared:r}=e.getQuadTree().find(i,n);if(void 0!==s)return{datum:s.value,distance:Math.sqrt(r)}}var zf=class extends zp{constructor(){super(...arguments),this.direction="vertical"}};a([Te],zf.prototype,"direction",2);var Wf=class extends jp{constructor(){super(...arguments),this.groupScale=new Sh,this.smallestDataInterval=void 0,this.largestDataInterval=void 0}padBandExtent(e,t){const i="boolean"==typeof t?1:.5,s=(0,n.Bf)(this.smallestDataInterval)?this.smallestDataInterval*i:0,r=Dh(e)??[NaN,NaN];return"boolean"==typeof t?r[t?0:1]-=(t?1:-1)*s:(r[0]-=s,r[1]+=s),No(r)}getBandScalePadding(){return{inner:.3,outer:.15}}shouldFlipXY(){return!this.isVertical()}isVertical(){return"vertical"===this.properties.direction}getBarDirection(){return this.shouldFlipXY()?"x":"y"}getCategoryDirection(){return this.shouldFlipXY()?"y":"x"}getValueAxis(){const e=this.getBarDirection();return this.axes[e]}getCategoryAxis(){const e=this.getCategoryDirection();return this.axes[e]}getBandwidth(e,t){return cr.is(e.scale)?e.scale.calcBandwidth(this.smallestDataInterval,t):e.scale.bandwidth}xCoordinateRange(e){const t=this.axes[this.getCategoryDirection()],i=t.scale,n=this.getBandwidth(t,0)??0,s=cr.is(i)?-.5*n:0,r=i.convert(e)+s;return[r,r+n]}yCoordinateRange(e){const t=this.axes[this.getBarDirection()].scale,i=e.map(e=>t.convert(e));if(1===i.length){const e=t.convert(0);return[Math.min(i[0],e),Math.max(i[0],e)]}return[Math.min(...i),Math.max(...i)]}updateGroupScale(e){const t=[],{groupScale:i}=this,n=this.getBandwidth(e),{index:s,visibleGroupCount:r}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);for(let e=0;e<r;e++)t.push(String(e));return i.domain=t,i.range=[0,n??0],e instanceof Pu?i.paddingInner=e.groupPaddingInner:e instanceof Mh?(i.paddingInner=e.groupPaddingInner,i.round=0!==i.padding):i.padding=0,{barWidth:i.bandwidth>=1?i.bandwidth:i.rawBandwidth,groupIndex:s}}resolveKeyDirection(e){return"x"===this.getBarDirection()?"x"===e?"y":"x":e}initQuadTree(e){Hf(e,this.datumNodesIter())}pickNodeClosestDatum(e){return Uf(this,e)}},jf=class extends pl{constructor(){super(...arguments),this.placement="inside-center",this.padding=0}};a([Te],jf.prototype,"placement",2),a([Te],jf.prototype,"padding",2);var $f=class extends zf{constructor(){super(...arguments),this.fill="#c16068",this.fillGradientDefaults=new Tp,this.fillPatternDefaults=new Dp,this.fillImageDefaults=new Ip,this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.crisp=void 0,this.shadow=new Sp,this.label=new jf,this.tooltip=new Lp,this.sparklineMode=!1,this.fastDataProcessing=!1}};function Kf(e,t,i,n){if(null!=t){const[e,i]=t;if(0!==e||1!==i)return!1}if(cr.is(e)){const t=e.calcBandwidth(n)-e.calcBandwidth(i);if(t>0&&t<1)return!1}return!0}a([Te],$f.prototype,"xKey",2),a([Te],$f.prototype,"xName",2),a([Te],$f.prototype,"yKey",2),a([Te],$f.prototype,"yName",2),a([Te],$f.prototype,"yFilterKey",2),a([Te],$f.prototype,"stackGroup",2),a([Te],$f.prototype,"normalizedTo",2),a([Te],$f.prototype,"fill",2),a([Te],$f.prototype,"fillGradientDefaults",2),a([Te],$f.prototype,"fillPatternDefaults",2),a([Te],$f.prototype,"fillImageDefaults",2),a([Te],$f.prototype,"fillOpacity",2),a([Te],$f.prototype,"stroke",2),a([Te],$f.prototype,"strokeWidth",2),a([Te],$f.prototype,"strokeOpacity",2),a([Te],$f.prototype,"lineDash",2),a([Te],$f.prototype,"lineDashOffset",2),a([Te],$f.prototype,"cornerRadius",2),a([Te],$f.prototype,"crisp",2),a([Te],$f.prototype,"itemStyler",2),a([Te],$f.prototype,"shadow",2),a([Te],$f.prototype,"label",2),a([Te],$f.prototype,"tooltip",2),a([Te],$f.prototype,"sparklineMode",2),a([Te],$f.prototype,"fastDataProcessing",2);var Yf=e=>(0,n.cI)(e.yValue??0);function qf(e,t,i){const{startingX:n,startingY:s}=function(e,t){const i=t[e?"y":"x"];let n=1/0,s=0;return i?(e?s=i.scale.convert(cr.is(i.scale)?0:Math.max(...i.range)):n=i.scale.convert(cr.is(i.scale)?0:Math.min(...i.range)),{startingX:n,startingY:s}):{startingX:n,startingY:s}}(e,t);return{isVertical:e,calculate:(t,i)=>{let r=e?t.x:n,o=e?s:t.y,a=e?t.width:0,l=e?0:t.height;const{opacity:c=1}=t;let h;return i&&(isNaN(r)||isNaN(o))&&(({x:r,y:o}=i),a=e?i.width:0,l=e?0:i.height,e&&!Yf(i)?o+=i.height:!e&&Yf(i)&&(r+=i.width)),h=null==t.clipBBox?void 0:Yf(t)?e?new m(r,o-l,a,l):new m(r-a,o,a,l):new m(r,o,a,l),{x:r,y:o,width:a,height:l,clipBBox:h,opacity:c}},mode:i}}function Xf(e,t){return{isVertical:e,calculate:t=>({x:e?t.x:t.x+t.width/2,y:e?t.y+t.height/2:t.y,width:e?t.width:0,height:e?0:t.height,clipBBox:t.clipBBox,opacity:t.opacity??1}),mode:t}}function Zf(e){const t=e=>null==e||isNaN(e.x)||isNaN(e.y);return{toFn:(i,n,s)=>"removed"===s&&null==i.datum&&"fade"===e.mode?{...Qf(i,n),opacity:0}:"removed"===s||t(n)?e.calculate(n,i.previousDatum):{x:n.x,y:n.y,width:n.width,height:n.height,clipBBox:n.clipBBox,opacity:n.opacity??1},fromFn:(i,n,s)=>{let r;"updated"===s&&t(n)?s="removed":"updated"===s&&t(i.previousDatum)&&(s="added"),r="added"===s&&null==i.previousDatum&&"fade"===e.mode?{...Qf(i,n),opacity:0}:"unknown"===s||"added"===s?e.calculate(n,i.previousDatum):{x:i.x,y:i.y,width:i.width,height:i.height,clipBBox:i.clipBBox,opacity:i.opacity??1};const o=oa[s];return{...r,phase:o}},applyFn:(e,t,i)=>{e.setProperties(t),e.crisp="end"===i&&(e.datum?.crisp??!1)}}}function Qf(e,{x:t,y:i,width:n,height:s,clipBBox:r,opacity:o=1}){return{x:t,y:i,width:n,height:s,clipBBox:r,opacity:o,crisp:e.datum?.crisp??!1}}function Jf(e,t){if(void 0===t)return;const{x:i,y:n,width:s,height:r}=t;return St.toCanvas(e.contentGroup,new m(i,n,s,r))}function em(e,t,i,n,s,r){let o=r?.reduced?.diff?.[e];if(o?.changed)return o;const a=function(e,t){if(!t)return!1;const i=e.scales,n=t.scales;if(!Ag(i.x,n.x))return!0;if(!Ag(i.y,n.y))return!0;if(!tm(e)||!tm(t))return!1;return!Ag(e.groupScale,t.groupScale)}(n,s);return null==o&&null!=r?.reduced?.diff?(o={changed:!0,added:new Set,updated:new Set,removed:new Set,moved:new Set},a?o.updated=new Set(Array.from(t,({datum:e})=>i(e))):o.added=new Set(Array.from(t,({datum:e})=>i(e)))):a&&(o={changed:!0,added:new Set,updated:new Set(Array.from(t,({datum:e})=>i(e))),removed:new Set,moved:new Set}),o}function tm(e){return"object"==typeof e&&null!==e&&"groupScale"in e}function im(e,t,i){if(t.enabled&&i){const{x:n,y:s,text:r,textAlign:o,textBaseline:a}=i,{color:l,fontStyle:c,fontWeight:h,fontSize:u,fontFamily:d}=t;e.setProperties({visible:!0,x:n,y:s,text:r,fill:l,fontStyle:c,fontWeight:h,fontSize:u,fontFamily:d,textAlign:o,textBaseline:a})}else e.visible=!1}var nm={"inside-start":{inside:!0,direction:-1,textAlignment:1},"inside-end":{inside:!0,direction:1,textAlignment:-1},"outside-start":{inside:!1,direction:-1,textAlignment:-1},"outside-end":{inside:!1,direction:1,textAlignment:1}};function sm({isUpward:e,isVertical:t,placement:i,padding:n=0,rect:s}){let r=s.x+s.width/2,o=s.y+s.height/2,a="center",l="middle";if("inside-center"!==i){const c=(e?1:-1)*(t?-1:1),{direction:h,textAlignment:u}=nm[i],d=.5*(h+1);t?(o=(e?s.y+s.height:s.y)+s.height*c*d+n*u*c,l=u===c?"top":"bottom"):(r=(e?s.x:s.x+s.width)+s.width*c*d+n*u*c,a=u===c?"left":"right")}return{x:r,y:o,textAlign:a,textBaseline:l}}var rm=class extends Wf{constructor(e){super({moduleCtx:e,directionKeys:Vp,directionNames:Hp,categoryKey:"xValue",pickModes:[2,1,0],pathsPerSeries:[],hasHighlightedLabels:!0,datumSelectionGarbageCollection:!1,animationAlwaysUpdateSelections:!0,animationResetFns:{datum:Qf,label:Cp}}),this.properties=new $f,this.connectsToYAxis=!0,this.dataAggregationFilters=void 0}get pickModeAxis(){return this.properties.sparklineMode?"main":void 0}crossFilteringEnabled(){return null!=this.properties.yFilterKey&&(null==this.seriesGrouping||0===this.seriesGrouping.stackIndex)}async processData(e){if(!this.data)return;const{xKey:t,yKey:i,yFilterKey:s,normalizedTo:r,fastDataProcessing:o}=this.properties,{seriesGrouping:{groupIndex:a=this.id}={},data:l}=this,c=this.seriesGrouping?.groupCount??0,h=(this.seriesGrouping?.stackCount??0)>=1||null!=r,u=!o||c>1||h,d=!this.ctx.animationManager.isSkipped(),p=this.getCategoryAxis()?.scale,g=this.getValueAxis()?.scale,{isContinuousX:f,xScaleType:m,yScaleType:y}=this.getScaleInformation({xScale:p,yScale:g}),v=`bar-stack-${a}-yValues`,b=`${v}-trailing`,C=this.visible?{}:{forceValue:0},w=[jh(t,m,{id:"xValue"}),$h(i,y,{id:"yValue-raw",invalidValue:null,...C})];this.crossFilteringEnabled()&&w.push($h(s,y,{id:"yFilterValue",invalidValue:null,...C})),h&&w.push(...Jh(i,"normal","current",{id:"yValue-end",rangeId:"yValue-range",invalidValue:null,missingValue:0,groupId:v,separateNegative:!0,...C},y),...Jh(i,"trailing","current",{id:"yValue-start",invalidValue:null,missingValue:0,groupId:b,separateNegative:!0,...C},y)),f&&w.push(tu,iu),(0,n.Bf)(r)&&w.push(ru([v,b],Math.abs(r))),d&&this.processedData&&w.push(yu(this.id,this.processedData)),!d&&u||w.push(cu());const{dataModel:S,processedData:x}=await this.requestDataModel(e,l,{props:w,groupByKeys:u,groupByData:!u});this.dataAggregationFilters=this.aggregateData(S,x),this.smallestDataInterval=x.reduced?.smallestKeyInterval,this.largestDataInterval=x.reduced?.largestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(null==i||null==t)return[];if(e===this.getCategoryDirection()){const e=i.resolveProcessedDataDefById(this,"xValue"),n=i.getDomain(this,"xValue","key",t);return"key"===e?.def.type&&"category"===e.def.valueType?n:this.padBandExtent(n)}const n=this.dataModel?.hasColumnById(this,"yValue-end")?"yValue-end":"yValue-raw";let s=this.domainForClippedRange(e,[n],"xValue",!0);const r=this.crossFilteringEnabled()?i.getDomain(this,"yFilterValue","value",t):void 0;return null!=r&&(s=[Math.min(s[0],r[0]),Math.max(s[1],r[1])]),this.getValueAxis()instanceof Uu?No(s):No(Number.isFinite(s[1]-s[0])?[Math.min(0,s[0]),Math.max(0,s[1])]:[])}getSeriesRange(e,t){const i=this.dataModel?.hasColumnById(this,"yValue-end")?"yValue-end":"yValue-raw",[n,s]=this.domainForVisibleRange("y",[i],"xValue",t,!0);return[Math.min(n,0),Math.max(s,0)]}getVisibleItems(e,t,i){const n=this.dataModel?.hasColumnById(this,"yValue-end")?"yValue-end":"yValue-raw";return this.countVisibleItems("xValue",[n],e,t,i)}aggregateData(e,t){}createNodeData(){const{dataModel:e,processedData:t,groupScale:i,dataAggregationFilters:n}=this,s=this.getCategoryAxis(),r=this.getValueAxis();if(!(e&&t&&s&&r))return;const o=t.dataSources?.get(this.id);if(null==o)return;const a=s.scale,l=r.scale,{xKey:c,yKey:h,xName:u,yName:d,legendItemName:p,label:g}=this.properties,f=r.isReversed(),{barWidth:y,groupIndex:v}=this.updateGroupScale(s),b=i.convert(String(v)),C=cr.is(a)?-.5*y:0,w=e.resolveKeysById(this,"xValue",t),S=e.resolveColumnById(this,"yValue-raw",t),x=this.crossFilteringEnabled()?e.resolveColumnById(this,"yFilterValue",t):void 0,E=!this.ctx.animationManager.isSkipped(),A=e=>a.convert(w[e])+b+C,M=this.properties.crisp??Kf(s?.scale,s?.visibleRange,this.smallestDataInterval,this.largestDataInterval),T=l.convert(0),D=({datum:e,datumIndex:t,valueIndex:i,xValue:n,yValue:s,cumulativeValue:r,phantom:o,currY:a,prevY:u,x:d,width:p,isPositive:y,yRange:v,labelText:b,opacity:C,crossScale:w=1})=>{const S=y!==f,x=l.convert(a),E=l.convert(u),A=l.convert(v),D="x"===this.getBarDirection(),I=.5*p*(1-w),R={x:D?Math.min(x,E):d+I,y:D?d+I:Math.min(x,E),width:D?Math.abs(E-x):p*w,height:D?p*w:Math.abs(E-x)},k=new m(R.x,R.y,R.width,R.height),P={x:D?Math.min(T,A):d+I,y:D?d+I:Math.min(T,A),width:D?Math.abs(T-A):p*w,height:D?p*w:Math.abs(T-A)},_=this.shouldFlipXY()?R.height:R.width;return{series:this,itemId:o?vu(h,o):h,datum:e,datumIndex:t,valueIndex:i,cumulativeValue:r,phantom:o,xValue:n,yValue:s,yKey:h,xKey:c,capDefaults:{lengthRatioMultiplier:_,lengthMax:_},x:P.x,y:P.y,width:P.width,height:P.height,midPoint:{x:R.x+R.width/2,y:R.y+R.height/2},opacity:C,topLeftCornerRadius:D!==S,topRightCornerRadius:S,bottomRightCornerRadius:D===S,bottomLeftCornerRadius:!S,clipBBox:k,crisp:M,label:null!=b?{text:b,...sm({isUpward:S,isVertical:!D,placement:g.placement,padding:g.padding,rect:R})}:void 0,missing:null==s,focusable:!o}},I=[],R=[],k=[],P=(e,t,i,n,s,r,a,l)=>{const g=w[e];if(null==g)return;const f=S[e],m=null!=x?Number(x[e]):void 0,y=f>=0&&!Object.is(f,-0);if(!Number.isFinite(r))return;if(null!=m&&!Number.isFinite(m))return;const v=null!=f?this.getLabelText(this.properties.label,{datum:o[e],value:m??f,xKey:c,yKey:h,xName:u,yName:d,legendItemName:p}):void 0,b=null!=m&&m>f,C=D({datum:o[e],datumIndex:e,valueIndex:t,xValue:g,yValue:m??f,cumulativeValue:m??r,phantom:!1,currY:null!=m?s+m:r,prevY:s,x:i,width:n,isPositive:y,yRange:Math.max(s+(m??-1/0),a),labelText:v,opacity:l,crossScale:b?.6:void 0});if(R.push(C),k.push(C),null!=m){const c=D({datum:o[e],datumIndex:e,valueIndex:t,xValue:g,yValue:m,cumulativeValue:m,phantom:!0,currY:r,prevY:s,x:i,width:n,isPositive:y,yRange:a,labelText:void 0,opacity:l,crossScale:void 0});I.push(c)}},[_,L]=a.range,N=L-_,O=n?.find(e=>e.maxRange>N);if("grouped"===t.type){const i=y,n=e.hasColumnById(this,"yValue-start"),s=n?e.resolveColumnById(this,"yValue-start",t):void 0,r=n?e.resolveColumnById(this,"yValue-end",t):void 0,o=n?e.resolveProcessedDataIndexById(this,"yValue-range"):-1;for(const{datumIndex:a,valueIndex:l,group:{aggregation:c}}of e.forEachGroupDatum(this,t)){const e=A(a),t=S[a],h=t>=0&&!Object.is(t,-0),u=n?Number(s?.[a]):0,d=n?Number(r?.[a]):t;let p=d;n&&(p=c[o][h?1:0]),P(a,l,e,i,u,d,p,1)}}else if(null==O){const e=y;let[i,n]=this.visibleRange("xValue",s.range);t.input.count<1e3&&(i=0,n=t.input.count);for(let t=i;t<n;t+=1){const i=A(t),n=Number(S[t]);P(t,0,i,e,0,n,n,1)}}else{const{indexData:e,indices:t}=O,[i,n]=this.visibleRange("xValue",s.range,t);for(let t=i;t<n;t+=1){const i=4*t,n=e[i+0],s=e[i+1],r=e[i+2],o=e[i+3];if(-1===n)continue;const a=A((n+s)/2|0),l=Math.abs(A(s)-A(n))+y,c=null!=w[o]?Number(S[o]):NaN,h=null!=w[r]?Number(S[r]):NaN;c>0&&P(o,0,a,l,0,c,c,h>=0?h/c:1),h<0&&P(r,1,a,l,0,h,h,c<=0?c/h:1)}}return{itemId:h,nodeData:I.length>0?[...I,...R]:R,labelData:k,scales:this.calculateScaling(),visible:this.visible||E,groupScale:this.getScaling(this.groupScale)}}nodeFactory(){return new Zu}getHighlightData(e,t){const i=e.find(e=>e.datum===t.datum&&!e.phantom);return null!=i?[i]:void 0}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,e=>this.getDatumId(e))}getItemBaseStyle(e){const{properties:t}=this,{cornerRadius:i,fillGradientDefaults:n,fillPatternDefaults:s,fillImageDefaults:r}=t,o=e?t.highlightStyle.item:void 0;return pc({fill:o?.fill??t.fill,fillOpacity:o?.fillOpacity??t.fillOpacity,stroke:o?.stroke??t.stroke,strokeWidth:o?.strokeWidth??this.getStrokeWidth(t.strokeWidth),strokeOpacity:o?.strokeOpacity??t.strokeOpacity,lineDash:o?.lineDash??t.lineDash??[],lineDashOffset:o?.lineDashOffset??t.lineDashOffset,cornerRadius:i},n,s,r)}getItemStyleOverrides(e,t,i,n,s,r){const{id:o,properties:a}=this,{xKey:l,yKey:c,itemStyler:h,fillGradientDefaults:u,fillPatternDefaults:d,fillImageDefaults:p}=a;if(null==h)return;const{xDomain:g,yDomain:f}=this.cachedDatumCallback("domain",()=>({xDomain:this.getSeriesDomain("x"),yDomain:this.getSeriesDomain("y")}));return pc(this.cachedDatumCallback(vu(e,r?"highlight":"node"),()=>this.callWithContext(h,{seriesId:o,...qs(t,l,c,g,f),datum:t,xValue:i,yValue:n,highlighted:r,...s})),u,d,p)}updateDatumNodes(e){const{shadow:t}=this.properties,i="x"===this.getCategoryDirection(),n=this.getItemBaseStyle(e.isHighlight),s=this.getShapeFillBBox();e.datumSelection.each((r,o)=>{const a=this.getItemStyleOverrides(String(o.datumIndex),o.datum,o.xValue,o.yValue,n,e.isHighlight);r.opacity=o.opacity??0,fc(r,n,a,s);const l=a?.cornerRadius??n.cornerRadius;r.topLeftCornerRadius=o.topLeftCornerRadius?l:0,r.topRightCornerRadius=o.topRightCornerRadius?l:0,r.bottomRightCornerRadius=o.bottomRightCornerRadius?l:0,r.bottomLeftCornerRadius=o.bottomLeftCornerRadius?l:0,r.visible=i?(o.clipBBox?.width??o.width)>0:(o.clipBBox?.height??o.height)>0,r.crisp=o.crisp,r.fillShadow=t})}updateLabelSelection(e){const t=this.isLabelEnabled()?e.labelData:[];return e.labelSelection.update(t,e=>{e.pointerEvents=1})}updateLabelNodes(e){e.labelSelection.each((e,t)=>{im(e,this.properties.label,t.label)})}getTooltipContent(e){const{id:t,dataModel:i,processedData:n,properties:s}=this,{xKey:r,xName:o,yKey:a,yName:l,legendItemName:c,stackGroup:h,tooltip:u}=s,d=this.getCategoryAxis(),p=this.getValueAxis();if(!(i&&n&&d&&p))return;const g=n.dataSources.get(this.id)?.[e],f=i.resolveKeysById(this,"xValue",n)[e],m=i.resolveColumnById(this,"yValue-raw",n)[e];if(null==f)return;const y=this.getItemBaseStyle(!1);return Object.assign(y,this.getItemStyleOverrides(String(e),g,f,m,y,!1)),this.formatTooltipWithContext(u,{heading:d.formatDatum(f),symbol:this.legendItemSymbol(),data:[{label:l,fallbackLabel:a,value:p.formatDatum(m)}]},{seriesId:t,datum:g,title:l,xKey:r,xName:o,yKey:a,yName:l,legendItemName:c,stackGroup:h,...y,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:e,stroke:t,strokeWidth:i,fillOpacity:n,strokeOpacity:s,lineDash:r,lineDashOffset:o,fillGradientDefaults:a,fillPatternDefaults:l,fillImageDefaults:c}=this.properties;return{marker:pc({fill:e??"rgba(0, 0, 0, 0)",stroke:t??"rgba(0, 0, 0, 0)",fillOpacity:n,strokeOpacity:s,strokeWidth:i,lineDash:r,lineDashOffset:o},a,l,c)}}getLegendData(e){const{showInLegend:t}=this.properties;if("category"!==e)return[];const{id:i,ctx:{legendManager:n},visible:s}=this,{yKey:r,yName:o,legendItemName:a}=this.properties;return[{legendType:"category",id:i,itemId:r,seriesId:i,enabled:s&&n.getItemEnabled({seriesId:i,itemId:r}),label:{text:a??o??r},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!t}]}animateEmptyUpdateReady({datumSelection:e,labelSelection:t,annotationSelections:i}){const n=Zf(qf(this.isVertical(),this.axes,"normal"));aa(this.id,"nodes",this.ctx.animationManager,[e],n),vp(this,"labels",this.ctx.animationManager,t),vp(this,"annotations",this.ctx.animationManager,...i)}animateWaitingUpdateReady(e){const{datumSelection:t,labelSelection:i,annotationSelections:n,contextData:s,previousContextData:r}=e;this.ctx.animationManager.stopByAnimationGroupId(this.id);const o=em(this.id,t,this.getDatumId.bind(this),e.contextData,r,this.processedData),a=null==r?"fade":"normal",l=Zf(qf(this.isVertical(),this.axes,a));aa(this.id,"nodes",this.ctx.animationManager,[t],l,(e,t)=>this.getDatumId(t),o),!o?.changed&&Ag(s.groupScale,r?.groupScale)||(vp(this,"labels",this.ctx.animationManager,i),vp(this,"annotations",this.ctx.animationManager,...n))}getDatumId(e){return vu(e.xValue,e.valueIndex,e.phantom)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e}){const t=this.contextNodeData?.nodeData[e].clipBBox;return Jf(this,t)}};rm.className="BarSeries",rm.type="bar";var om={direction:(0,n.KC)("horizontal","vertical"),showInMiniChart:n.zM,cornerRadius:n.Ly,itemStyler:(0,n.YI)({...n.Fu,...n.AF,...n.mL,cornerRadius:n.Ly}),crisp:n.zM,label:{...Rf,placement:(0,n.KC)("inside-center","inside-start","inside-end","outside-start","outside-end"),padding:n.Ly},errorBar:Pf,shadow:Nf,tooltip:Lf,...Tf,...n.Fu,...n.AF,...n.mL};om.sparklineMode=(0,n._L)(n.zM);var am={...om,...Df,type:(0,n.mw)((0,n.dY)("bar")),xKey:(0,n.mw)(n.Yj),yKey:(0,n.mw)(n.Yj),xName:n.Yj,yName:n.Yj,direction:(0,n.KC)("horizontal","vertical"),grouped:n.zM,stacked:n.zM,stackGroup:n.Yj,normalizedTo:n.ai,legendItemName:n.Yj,errorBar:_f};am.pickOutsideVisibleMinorAxis=(0,n._L)(n.zM),am.fastDataProcessing=(0,n._L)(n.zM),am.focusPriority=(0,n._L)(n.ai);var lm={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"bar",moduleFactory:e=>new rm(e),stackable:!0,groupable:!0,tooltipDefaults:{range:"exact"},defaultAxes:cp,themeTemplate:{series:{direction:"vertical",fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:gp,fillImageDefaults:fp,fillOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,label:{enabled:!1,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$if:[{$or:[{$eq:[{$path:"./placement"},"outside-start"]},{$eq:[{$path:"./placement"},"outside-end"]}]},{$ref:"textColor"},{$ref:"backgroundColor"}]},placement:"inside-center"},shadow:{enabled:!1,color:Rd,xOffset:3,yOffset:3,blur:5},errorBar:{cap:{lengthRatio:.3}}}}},cm={type:"series",name:"bar",chartType:"cartesian",options:am,create:e=>new rm(e)},hm=class extends Pp{constructor(){super(...arguments),this.maxSize=30}};a([Te,K()],hm.prototype,"maxSize",2),a([Te,q()],hm.prototype,"domain",2);var um=class extends pl{constructor(){super(...arguments),this.placement="top"}};a([Te],um.prototype,"placement",2);var dm=class extends zp{constructor(){super(...arguments),this.label=new um,this.tooltip=new Lp,this.marker=new hm}};a([Te],dm.prototype,"xKey",2),a([Te],dm.prototype,"yKey",2),a([Te],dm.prototype,"sizeKey",2),a([Te],dm.prototype,"labelKey",2),a([Te],dm.prototype,"xFilterKey",2),a([Te],dm.prototype,"yFilterKey",2),a([Te],dm.prototype,"sizeFilterKey",2),a([Te],dm.prototype,"xName",2),a([Te],dm.prototype,"yName",2),a([Te],dm.prototype,"sizeName",2),a([Te],dm.prototype,"labelName",2),a([Te],dm.prototype,"title",2),a([ri("marker.shape")],dm.prototype,"shape",2),a([ri("marker.size")],dm.prototype,"size",2),a([ri("marker.maxSize")],dm.prototype,"maxSize",2),a([ri("marker.domain")],dm.prototype,"domain",2),a([ri("marker.fillGradientDefaults")],dm.prototype,"fillGradientDefaults",2),a([ri("marker.fillPatternDefaults")],dm.prototype,"fillPatternDefaults",2),a([ri("marker.fillImageDefaults")],dm.prototype,"fillImageDefaults",2),a([ri("marker.fill")],dm.prototype,"fill",2),a([ri("marker.fillOpacity")],dm.prototype,"fillOpacity",2),a([ri("marker.stroke")],dm.prototype,"stroke",2),a([ri("marker.strokeWidth")],dm.prototype,"strokeWidth",2),a([ri("marker.strokeOpacity")],dm.prototype,"strokeOpacity",2),a([ri("marker.lineDash")],dm.prototype,"lineDash",2),a([ri("marker.lineDashOffset")],dm.prototype,"lineDashOffset",2),a([ri("marker.itemStyler")],dm.prototype,"itemStyler",2),a([Te],dm.prototype,"label",2),a([Te],dm.prototype,"tooltip",2);var pm=class extends Up{constructor(e,t,i,n){super(e,t,i,n),this.sizeKey=n.properties.sizeKey}},gm=class extends jp{constructor(e){super({moduleCtx:e,directionKeys:Vp,directionNames:Hp,categoryKey:void 0,pickModes:[2,1,0],pathsPerSeries:[],hasMarkers:!0,markerSelectionGarbageCollection:!1,animationResetFns:{label:Cp,marker:Hg},usesPlacedLabels:!0,clipFocusBox:!1}),this.NodeEvent=pm,this.properties=new dm,this.sizeScale=new Vu}get pickModeAxis(){return"main-category"}async processData(e){if(null==this.data||!this.visible)return;const t=this.axes.x?.scale,i=this.axes.y?.scale,{xScaleType:n,yScaleType:s}=this.getScaleInformation({xScale:t,yScale:i}),r=this.sizeScale.type,{xKey:o,yKey:a,sizeKey:l,xFilterKey:c,yFilterKey:h,sizeFilterKey:u,labelKey:d,marker:p}=this.properties,{dataModel:g,processedData:f}=await this.requestDataModel(e,this.data,{props:[$h(o,n,{id:"xValue"}),$h(a,s,{id:"yValue"}),...null!=c?[$h(c,n,{id:"xFilterValue"})]:[],...null!=h?[$h(h,s,{id:"yFilterValue"})]:[],...null!=u?[$h(u,r,{id:"sizeFilterValue"})]:[],$h(l,r,{id:"sizeValue"}),...d?[$h(d,"band",{id:"labelValue"})]:[]]}),m=g.resolveProcessedDataIndexById(this,"sizeValue"),y=p.domain?[p.domain[0],p.domain[1]]:void 0;this.sizeScale.domain=y??f.domain.values[m]??[],this.animationState.transition("updateData")}xCoordinateRange(e,t,i){const{properties:n,sizeScale:s}=this,{size:r,sizeKey:o}=n,a=this.axes.x.scale.convert(e),l=null!=o?this.dataModel.resolveColumnById(this,"sizeValue",this.processedData):void 0,c=.5*(null!=l?s.convert(l[i]):r)*t;return[a-c,a+c]}yCoordinateRange(e,t,i){const{properties:n,sizeScale:s}=this,{size:r,sizeKey:o}=n,a=this.axes.y.scale.convert(e[0]),l=null!=o?this.dataModel.resolveColumnById(this,"sizeValue",this.processedData):void 0,c=.5*(null!=l?s.convert(l[i]):r)*t;return[a-c,a+c]}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return[];const n={x:"xValue",y:"yValue"},s=n[e],r=t.resolveProcessedDataDefById(this,s),o=t.getDomain(this,s,"value",i);if("value"===r?.def.type&&"category"===r?.def.valueType)return o;const a=n["x"===e?"y":"x"];return No(Dh(this.domainForClippedRange(e,[s],a,!1)))}getSeriesRange(e,t){return this.domainForVisibleRange("y",["yValue"],"xValue",t,!1)}getVisibleItems(e,t,i){return this.countVisibleItems("xValue",["yValue"],e,t,i)}createNodeData(){const{axes:e,dataModel:t,processedData:i,sizeScale:n,visible:s}=this,{xKey:r,yKey:o,sizeKey:a,xFilterKey:l,yFilterKey:c,sizeFilterKey:h,labelKey:u,xName:d,yName:p,sizeName:g,labelName:f,label:m,marker:y}=this.properties,{placement:v}=m,b=Nc.anchor(y.shape),C=e.x,w=e.y;if(!(t&&i&&s&&C&&w))return;const S=t.resolveColumnById(this,"xValue",i),x=t.resolveColumnById(this,"yValue",i),E=null!=a?t.resolveColumnById(this,"sizeValue",i):void 0,A=null!=u?t.resolveColumnById(this,"labelValue",i):void 0,M=null!=l?t.resolveColumnById(this,"xFilterValue",i):void 0,T=null!=c?t.resolveColumnById(this,"yFilterValue",i):void 0,D=null!=h?t.resolveColumnById(this,"sizeFilterValue",i):void 0,I=C.scale,R=w.scale,k=(I.bandwidth??0)/2,P=(R.bandwidth??0)/2,_=[];n.range=[y.size,y.maxSize];const L=m.getFont(),N=Di.getMeasurer({font:L});return i.dataSources.get(this.id)?.forEach((e,t)=>{const i=S[t],s=x[t],l=E?.[t],c=I.convert(i)+k,h=R.convert(s)+P;let C;null!=M&&null!=T&&(C=M[t]===i&&T[t]===s,null!=D&&C&&(C=D[t]===l));const w=this.getLabelText(m,{value:null!=A?A[t]:s,datum:e,xKey:r,yKey:o,sizeKey:a,labelKey:u,xName:d,yName:p,sizeName:g,labelName:f}),L=N.measureText(String(w)),O=null!=l?n.convert(l):y.size;_.push({series:this,itemId:o,yKey:o,xKey:r,datum:e,datumIndex:t,xValue:i,yValue:s,sizeValue:l,point:{x:c,y:h,size:O},midPoint:{x:c,y:h},label:{text:w,...L},anchor:b,placement:v,selected:C})}),{itemId:o,nodeData:_,labelData:_,scales:this.calculateScaling(),visible:this.visible}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}updateMarkerSelection(e){const{nodeData:t,markerSelection:i}=e;this.properties.marker.isDirty()&&(i.clear(),i.cleanup());const n=this.properties.marker.enabled?t:[];return i.update(n,void 0,e=>vu([e.xValue,e.yValue,e.sizeValue,e.label.text]))}updateMarkerNodes(e){const{markerSelection:t,isHighlight:i}=e,{xKey:n,yKey:s,sizeKey:r,labelKey:o,marker:a}=this.properties,l=L(i&&this.properties.highlightStyle.item,a.getStyle());this.sizeScale.range=[a.size,a.maxSize];const c=this.getShapeFillBBox();t.each((e,t)=>{this.updateMarkerStyle(a,e,t.datum,t.point,{xKey:n,yKey:s,sizeKey:r,labelKey:o},i,l,c,{selected:t.selected})}),i||this.properties.marker.markClean()}updatePlacedLabelData(e){this.labelSelection.update(e.map(e=>({...e.datum,point:{x:e.x,y:e.y,size:e.datum.point.size}})),e=>{e.pointerEvents=1}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(e){const{label:t}=this.properties;e.labelSelection.each((e,i)=>{e.text=i.label.text,e.fill=t.color,e.x=i.point?.x??0,e.y=i.point?.y??0,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.fontSize=t.fontSize,e.fontFamily=t.fontFamily,e.textAlign="left",e.textBaseline="top"})}getTooltipContent(e){const{id:t,dataModel:i,processedData:n,axes:s,properties:r}=this,{xKey:o,xName:a,yKey:l,yName:c,sizeKey:h,sizeName:u,labelKey:d,labelName:p,title:g,tooltip:f,marker:m}=r,y=s.x,v=s.y;if(!(i&&n&&y&&v))return;const b=n.dataSources.get(this.id)?.[e],C=i.resolveColumnById(this,"xValue",n)[e],w=i.resolveColumnById(this,"yValue",n)[e],S=this.contextNodeData?.nodeData[e];if(null==C||null==S)return;const x=[{label:a,fallbackLabel:o,value:y.formatDatum(C)},{label:c,fallbackLabel:l,value:v.formatDatum(w)}];if(null!=h){const t=i.resolveColumnById(this,"sizeValue",n)[e];x.push({label:u,fallbackLabel:h,value:String(t)})}const E=m.getStyle(),A=this.getMarkerStyle(m,b,{xKey:o,yKey:l,sizeKey:h,labelKey:d,highlighted:!0},!1,void 0,E);return this.formatTooltipWithContext(f,{title:g,symbol:this.legendItemSymbol(),data:x},{seriesId:t,datum:b,title:l,xKey:o,xName:a,yKey:l,yName:c,sizeKey:h,sizeName:u,labelKey:d,labelName:p,...A,...this.getModuleTooltipParams()})}legendItemSymbol(){return{marker:this.getMarkerStyle(this.properties.marker)}}getLegendData(){const{id:e,ctx:{legendManager:t},visible:i}=this,{yKey:n,yName:s,title:r}=this.properties;return[{legendType:"category",id:e,itemId:n,seriesId:e,enabled:i&&t.getItemEnabled({seriesId:e,itemId:n}),label:{text:r??s??n},symbol:this.legendItemSymbol()}]}animateEmptyUpdateReady({markerSelection:e,labelSelection:t}){Bg(this,this.ctx.animationManager,e),vp(this,"labels",this.ctx.animationManager,t)}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new Mt}getFormattedMarkerStyle(e){const{xKey:t,yKey:i,sizeKey:n,labelKey:s,marker:r}=this.properties;return this.getMarkerStyle(r,e,{xKey:t,yKey:i,sizeKey:n,labelKey:s},!1,e.point.size)}computeFocusBounds(e){return zg(this,e)}};gm.className="BubbleSeries",gm.type="bubble";var fm={title:n.Yj,domain:(0,n.jk)(n.ai),maxSize:n.Ly,showInMiniChart:n.zM,label:{placement:(0,n.KC)("top","right","bottom","left"),...Rf},tooltip:Lf,...Tf,...G(If,["enabled"])},mm={...fm,...Df,type:(0,n.mw)((0,n.dY)("bubble")),xKey:(0,n.mw)(n.Yj),yKey:(0,n.mw)(n.Yj),sizeKey:(0,n.mw)(n.Yj),labelKey:n.Yj,xName:n.Yj,yName:n.Yj,sizeName:n.Yj,labelName:n.Yj},ym={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"bubble",moduleFactory:e=>new gm(e),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{shape:"circle",size:7,maxSize:30,fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:gp,fillImageDefaults:fp,fillOpacity:.8,tooltip:{position:{_seriesOverrideType:"node"}},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}}}},vm={type:"series",name:"bubble",chartType:"cartesian",options:mm,create:e=>new gm(e)},bm=class extends zp{constructor(){super(...arguments),this.fillGradientDefaults=new Tp,this.fillPatternDefaults=new Dp,this.fillImageDefaults=new Ip,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.areaPlot=!1,this.aggregation="sum",this.shadow=new Sp,this.label=new pl,this.tooltip=new Lp}};a([Te],bm.prototype,"xKey",2),a([Te],bm.prototype,"yKey",2),a([Te],bm.prototype,"xName",2),a([Te],bm.prototype,"yName",2),a([Te],bm.prototype,"fill",2),a([Te],bm.prototype,"fillGradientDefaults",2),a([Te],bm.prototype,"fillPatternDefaults",2),a([Te],bm.prototype,"fillImageDefaults",2),a([Te],bm.prototype,"fillOpacity",2),a([Te],bm.prototype,"stroke",2),a([Te],bm.prototype,"strokeWidth",2),a([Te],bm.prototype,"strokeOpacity",2),a([Te],bm.prototype,"lineDash",2),a([Te],bm.prototype,"lineDashOffset",2),a([Te],bm.prototype,"cornerRadius",2),a([Te],bm.prototype,"areaPlot",2),a([Te],bm.prototype,"bins",2),a([Te],bm.prototype,"aggregation",2),a([Te],bm.prototype,"binCount",2),a([Te],bm.prototype,"shadow",2),a([Te],bm.prototype,"label",2),a([Te],bm.prototype,"tooltip",2);var Cm=class extends jp{constructor(e){super({moduleCtx:e,directionKeys:Vp,directionNames:Hp,categoryKey:void 0,pickModes:[1,0],datumSelectionGarbageCollection:!1,animationResetFns:{datum:Qf,label:Cp}}),this.properties=new bm,this.calculatedBins=[]}deriveBins(e){const t=Ba(e[0],e[1],10).ticks,i=za(e[0],e[1],10),[n]=t;return[[n-i,n],...t.map(e=>[e,e+i])]}calculateNiceBins(e,t){const i=Math.floor(e[0]),n=e[1],s=t||1,{start:r,binSize:o}=this.calculateNiceStart(i,n,s);return this.getBins(r,n,o,s)}getBins(e,t,i,n){const s=[],r=this.calculatePrecision(i);for(let o=0;o<n;o++){const a=Math.round((e+o*i)*r)/r;let l=Math.round((e+(o+1)*i)*r)/r;o===n-1&&(l=Math.max(l,t)),s[o]=[a,l]}return s}calculatePrecision(e){let t=10;if(isFinite(e)&&e>0)for(;e<1;)t*=10,e*=10;return t}calculateNiceStart(e,t,i){const n=Math.abs(t-e)/i,s=Math.floor(Math.log10(n)),r=Math.pow(10,s);return{start:Math.floor(e/r)*r,binSize:n}}async processData(e){this.visible||(this.processedData=void 0,this.animationState.transition("updateData"));const{xKey:t,yKey:i,areaPlot:s,aggregation:r}=this.properties,o=this.axes.x?.scale,a=this.axes.y?.scale,{xScaleType:l,yScaleType:c}=this.getScaleInformation({yScale:a,xScale:o}),h=[jh(t,l),nu];if(i){let e=Oh("groupAgg");"count"===r||("sum"===r?e=Nh("groupAgg"):"mean"===r&&(e=Fh("groupAgg"))),s&&(e=Gh("groupAgg",e)),h.push($h(i,c,{invalidValue:void 0}),e)}else{h.push(Kh("count"));let e=Oh("groupAgg");s&&(e=Gh("groupAgg",e)),h.push(e)}!this.ctx.animationManager.isSkipped()&&this.processedData&&h.push(yu(this.id,this.processedData,!1)),await this.requestDataModel(e,this.data,{props:h,groupByFn:e=>{const t=No(e.domain.keys[0]);if(0===t.length)return e.domain.groups=[],()=>[];const i=(0,n.Et)(this.properties.binCount)?this.calculateNiceBins(t,this.properties.binCount):this.properties.bins??this.deriveBins(t),s=i.length;return this.calculatedBins=[...i],e=>{let t=e[0];if((0,n.$P)(t)&&(t=t.getTime()),!(0,n.Et)(t))return[];for(let e=0;e<s;e++){const n=i[e];if(t>=n[0]&&t<n[1])return n;if(e===s-1&&t<=n[1])return n}return[]}}}),this.animationState.transition("updateData")}xCoordinateRange(){return[NaN,NaN]}yCoordinateRange(){return[NaN,NaN]}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!t||!i||!this.calculatedBins.length)return[];const n=i.getDomain(this,"groupAgg","aggregate",t),s=this.calculatedBins?.[0][0],r=this.calculatedBins?.[(this.calculatedBins?.length??0)-1][1];return No("x"===e?[s,r]:n)}getSeriesRange(e,[t,i]){const{dataModel:n,processedData:s}=this;if(!n||"grouped"!==s?.type)return[NaN,NaN];const r=this.axes.x.scale;let o=-1/0;return s.groups.forEach(({keys:e,aggregation:n})=>{const[[s,a]=[0,0]]=n,[l,c]=e,[h,u]=or([r.convert(l),r.convert(c)]);if(u>=t&&h<=i){const e=s+a;o=Math.max(o,e)}}),0>o?[NaN,NaN]:[0,o]}frequency(e){return e.datumIndices.reduce((e,t)=>e+t.length,0)}createNodeData(){const{id:e,axes:t,processedData:i,dataModel:n}=this,s=t.x,r=t.y;if(!s||!r||!n)return;const{scale:o}=s,{scale:a}=r,{xKey:l,yKey:c,xName:h,yName:u}=this.properties,d=this.properties.label.formatter,p=[],g={itemId:this.properties.yKey??this.id,nodeData:p,labelData:p,scales:this.calculateScaling(),animationValid:!0,visible:this.visible};return this.visible&&null!=i&&"grouped"===i.type?(i.groups.forEach((t,s)=>{const{keys:g,aggregation:f}=t,[[m,y]=[0,0]]=f,v=this.frequency(t),b=g,[C,w]=b,S=[...n.forEachDatum(this,i,t)],x=o.convert(C),E=o.convert(w),A=m+y,M=a.convert(0),T=a.convert(A),D=Math.abs(E-x),I=Math.abs(T-M),R=Math.min(x,E),k=Math.min(M,T);let P;0!==A&&(P={x:R+D/2,y:k+I/2,text:this.cachedDatumCallback(vu(s,"label"),()=>d?.({value:A,datum:S,seriesId:e,xKey:l,yKey:c,xName:h,yName:u}))??r.formatDatum(A)});const _={x:R+D/2,y:k+I/2},L=r.isReversed();p.push({series:this,datumIndex:s,datum:S,aggregatedValue:A,frequency:v,domain:b,yKey:c,xKey:l,x:R,y:k,xValue:x,yValue:T,width:D,height:I,midPoint:_,topLeftCornerRadius:!L,topRightCornerRadius:!L,bottomRightCornerRadius:L,bottomLeftCornerRadius:L,label:P,crisp:!0})}),p.sort((e,t)=>e.x-t.x),g):g}nodeFactory(){return new Zu}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e;return i.update(t,void 0,e=>e.domain.join("_"))}getItemBaseStyle(e){const{properties:t}=this,i=e?t.highlightStyle.item:void 0;return pc({fill:i?.fill??t.fill,fillOpacity:i?.fillOpacity??t.fillOpacity,stroke:i?.stroke??t.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(t.strokeWidth),strokeOpacity:i?.strokeOpacity??t.strokeOpacity,lineDash:i?.lineDash??t.lineDash,lineDashOffset:i?.lineDashOffset??t.lineDashOffset,cornerRadius:t.cornerRadius},t.fillGradientDefaults,t.fillPatternDefaults,t.fillImageDefaults)}updateDatumNodes(e){const{isHighlight:t}=e,{shadow:i}=this.properties,n=this.getItemBaseStyle(t),s=this.getShapeFillBBox();e.datumSelection.each((e,t)=>{const{cornerRadius:r}=n,{topLeftCornerRadius:o,topRightCornerRadius:a,bottomRightCornerRadius:l,bottomLeftCornerRadius:c}=t;fc(e,n,void 0,s),e.topLeftCornerRadius=o?r:0,e.topRightCornerRadius=a?r:0,e.bottomRightCornerRadius=l?r:0,e.bottomLeftCornerRadius=c?r:0,e.crisp=t.crisp,e.fillShadow=i,e.visible=t.height>0})}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t,e=>{e.pointerEvents=1,e.textAlign="center",e.textBaseline="middle"})}updateLabelNodes(e){const{fontStyle:t,fontWeight:i,fontFamily:n,fontSize:s,color:r}=this.properties.label,o=this.isLabelEnabled();e.labelSelection.each((e,a)=>{o&&a?.label?(e.text=a.label.text,e.x=a.label.x,e.y=a.label.y,e.fontStyle=t,e.fontWeight=i,e.fontFamily=n,e.fontSize=s,e.fill=r,e.visible=!0):e.visible=!1})}initQuadTree(e){const{value:t}=this.contentGroup.children().next();t&&Hf(e,t.children())}pickNodeClosestDatum(e){return Uf(this,e)}getTooltipContent(e){const{id:t,dataModel:i,processedData:n,axes:s,properties:r,ctx:{localeManager:o}}=this,{xKey:a,xName:l,yKey:c,yName:h,tooltip:u}=r,d=s.x,p=s.y;if(!i||"grouped"!==n?.type||!d||!p)return;const g=n.groups[e],{aggregation:f,keys:m}=g,[[y,v]=[0,0]]=f,b=this.frequency(g),C=m,[w,S]=C,x=y+v,E={data:[...i.forEachDatum(this,n,g)],aggregatedValue:x,frequency:b,domain:C},A=[{label:l,fallbackLabel:a,value:`${d.formatDatum(w)} - ${d.formatDatum(S)}`},{label:o.t("seriesHistogramTooltipFrequency"),value:p.formatDatum(b)}];if(null!=c){let e;switch(r.aggregation){case"sum":e=o.t("seriesHistogramTooltipSum",{yName:h??c});break;case"mean":e=o.t("seriesHistogramTooltipMean",{yName:h??c});break;case"count":e=o.t("seriesHistogramTooltipCount",{yName:h??c})}A.push({label:e,value:p.formatDatum(x)})}return this.formatTooltipWithContext(u,{symbol:this.legendItemSymbol(),data:A},{seriesId:t,datum:E,title:h,xKey:a,xName:l,yKey:c,yName:h,xRange:[w,S],frequency:b,...this.getItemBaseStyle(!1)})}legendItemSymbol(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:n,strokeOpacity:s,lineDash:r,lineDashOffset:o,fillGradientDefaults:a,fillPatternDefaults:l,fillImageDefaults:c}=this.properties;return{marker:pc({fill:e??"rgba(0, 0, 0, 0)",stroke:i??"rgba(0, 0, 0, 0)",fillOpacity:t,strokeOpacity:s,strokeWidth:n,lineDash:r,lineDashOffset:o},a,l,c)}}getLegendData(e){if("category"!==e)return[];const{id:t,ctx:{legendManager:i},visible:n}=this,{xKey:s,yName:r,showInLegend:o}=this.properties;return[{legendType:"category",id:t,itemId:s,seriesId:t,enabled:n&&i.getItemEnabled({seriesId:t,itemId:s}),label:{text:r??s??"Frequency"},symbol:this.legendItemSymbol(),hideInLegend:!o}]}animateEmptyUpdateReady({datumSelection:e,labelSelection:t}){const i=Zf(qf(!0,this.axes,"normal"));aa(this.id,"datums",this.ctx.animationManager,[e],i),vp(this,"labels",this.ctx.animationManager,t)}animateWaitingUpdateReady(e){const t=Zf(qf(!0,this.axes,"normal")),i=em(this.id,e.datumSelection,e=>vu(e.domain),e.contextData,e.previousContextData,this.processedData);aa(this.id,"datums",this.ctx.animationManager,[e.datumSelection],t,(e,t)=>vu(t.domain),i),i?.changed&&vp(this,"labels",this.ctx.animationManager,e.labelSelection)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e}){return Jf(this,this.contextNodeData?.nodeData[e])}};Cm.className="HistogramSeries",Cm.type="histogram";var wm={showInMiniChart:n.zM,cornerRadius:n.Ly,label:Rf,tooltip:Lf,shadow:Nf,...Tf,...n.Fu,...n.AF,...n.mL},Sm={...wm,...Df,type:(0,n.mw)((0,n.dY)("histogram")),xKey:(0,n.mw)(n.Yj),yKey:n.Yj,xName:n.Yj,yName:n.Yj,areaPlot:n.zM,aggregation:(0,n.KC)("count","sum","mean"),bins:(0,n.jk)((0,n.jk)(n.ai)),binCount:n.Ly},xm={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"histogram",moduleFactory:e=>new Cm(e),tooltipDefaults:{range:"exact"},defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:gp,fillImageDefaults:fp,strokeWidth:1,fillOpacity:1,strokeOpacity:1,lineDash:[0],lineDashOffset:0,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"}},shadow:{enabled:!1,color:Rd,xOffset:3,yOffset:3,blur:5}}}},Em={type:"series",name:"histogram",chartType:"cartesian",enterprise:!0,options:Sm,create:e=>new Cm(e)},Am=class extends zp{constructor(){super(...arguments),this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new $p,this.marker=new Pp,this.label=new pl,this.tooltip=new Lp,this.connectMissingData=!1,this.sparklineMode=!1}};a([Te],Am.prototype,"xKey",2),a([Te],Am.prototype,"yKey",2),a([Te],Am.prototype,"xName",2),a([Te],Am.prototype,"yName",2),a([Te],Am.prototype,"yFilterKey",2),a([Te],Am.prototype,"stackGroup",2),a([Te],Am.prototype,"normalizedTo",2),a([Te],Am.prototype,"title",2),a([Te],Am.prototype,"stroke",2),a([Te],Am.prototype,"strokeWidth",2),a([Te],Am.prototype,"strokeOpacity",2),a([Te],Am.prototype,"lineDash",2),a([Te],Am.prototype,"lineDashOffset",2),a([Te],Am.prototype,"interpolation",2),a([Te],Am.prototype,"marker",2),a([Te],Am.prototype,"label",2),a([Te],Am.prototype,"tooltip",2),a([Te],Am.prototype,"connectMissingData",2),a([Te],Am.prototype,"sparklineMode",2);var Mm=class extends jp{constructor(e){super({moduleCtx:e,directionKeys:Vp,directionNames:Hp,categoryKey:"xValue",hasMarkers:!0,pickModes:[2,1,0],markerSelectionGarbageCollection:!1,animationResetFns:{path:$g({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:Cp,marker:(e,t)=>({opacity:1,scalingX:1,scalingY:1,...Ug(0,t)})},clipFocusBox:!1}),this.properties=new Am,this.dataAggregationFilters=void 0}get pickModeAxis(){return this.properties.sparklineMode?"main":"main-category"}async processData(e){if(null==this.data)return;const{data:t,visible:i,seriesGrouping:{groupIndex:s=this.id,stackCount:r=0}={}}=this,{xKey:o,yKey:a,yFilterKey:l,connectMissingData:c,normalizedTo:h}=this.properties,u=!this.ctx.animationManager.isSkipped(),d=this.axes.x?.scale,p=this.axes.y?.scale,{isContinuousX:g,xScaleType:f,yScaleType:m}=this.getScaleInformation({xScale:d,yScale:p}),y=r>=1||null!=h,v={invalidValue:null};c&&y&&(v.invalidValue=0),y&&!i&&(v.forceValue=0);const b=[];if(g&&!y||b.push(jh(o,f,{id:"xKey"})),b.push($h(o,f,{id:"xValue"}),$h(a,m,{id:"yValueRaw",...v,invalidValue:void 0})),null!=l&&b.push($h(l,m,{id:"yFilterRaw"})),y){const e=[`line-stack-${s}-yValues`,`line-stack-${s}-yValues-trailing`,`line-stack-${s}-yValues-marker`];b.push(...Jh(a,"window","current",{id:"yValueEnd",...v,groupId:e[0]},m),...Jh(a,"window-trailing","current",{id:"yValueStart",...v,groupId:e[1]},m),...Jh(a,"normal","current",{id:"yValueCumulative",...v,groupId:e[2]},m)),(0,n.vM)(h)&&b.push(ru([e[0],e[1],e[2]],h))}u&&(b.push(cu(g?["xValue"]:void 0)),this.processedData&&b.push(yu(this.id,this.processedData)));const{dataModel:C,processedData:w}=await this.requestDataModel(e,t,{props:b,groupByKeys:y,groupByData:!y});this.dataAggregationFilters=this.aggregateData(C,w),this.animationState.transition("updateData")}xCoordinateRange(e,t){const{marker:i}=this.properties,n=this.axes.x.scale.convert(e),s=i.enabled?.5*i.size*t:0;return[n-s,n+s]}yCoordinateRange(e,t){const{marker:i}=this.properties,n=this.axes.y.scale.convert(e[0]),s=i.enabled?.5*i.size*t:0;return[n-s,n+s]}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!t||!i)return[];if("x"===e){const e=t.resolveProcessedDataDefById(this,"xValue"),n=t.getDomain(this,"xValue","value",i);return"value"===e?.def.type&&"category"===e.def.valueType?n:No(Dh(n))}const n=this.dataModel?.hasColumnById(this,"yValueEnd")?"yValueEnd":"yValueRaw";return No(this.domainForClippedRange("y",[n],"xValue",!0))}getSeriesRange(e,t){const i=this.dataModel?.hasColumnById(this,"yValueEnd")?"yValueEnd":"yValueRaw";return this.domainForVisibleRange("y",[i],"xValue",t,!0)}getVisibleItems(e,t,i){const n=this.dataModel?.hasColumnById(this,"yValueEnd")?"yValueEnd":"yValueRaw";return this.countVisibleItems("xValue",[n],e,t,i)}aggregateData(e,t){}createNodeData(){const{dataModel:e,processedData:t,axes:i,dataAggregationFilters:n}=this,s=i.x,r=i.y;if(!(e&&t&&s&&r))return;const{xKey:o,yKey:a,yFilterKey:l,xName:c,yName:h,marker:u,label:d,connectMissingData:p,interpolation:g,legendItemName:f}=this.properties,m=this.dataModel?.hasColumnById(this,"yValueEnd"),y=s.scale,v=r.scale,b=(y.bandwidth??0)/2,C=(v.bandwidth??0)/2,w=u.enabled?u.size:0,S=t.dataSources.get(this.id)??[],x=e.resolveColumnById(this,"xValue",t),E=e.resolveColumnById(this,"yValueRaw",t),A=m?e.resolveColumnById(this,"yValueEnd",t):void 0,M=m?e.resolveColumnById(this,"yValueCumulative",t):E,T=null!=l?e.resolveColumnById(this,"yFilterRaw",t):void 0,D={lengthRatioMultiplier:this.properties.marker.getDiameter(),lengthMax:1/0},I=[];let R;const k=e=>{const t=S[e],i=x[e],n=E[e],s=A?.[e],r=T?.[e],l=(u=e,y.convert(x[u])+b);var u;const g=(e=>v.convert(M[e])+C)(e);if(!Number.isFinite(l))return;if(null!=n){const u=d.enabled?this.getLabelText(d,{value:n,datum:t,xKey:o,yKey:a,xName:c,yName:h,legendItemName:f}):void 0;I.push({series:this,datum:t,datumIndex:e,yKey:a,xKey:o,point:{x:l,y:g,size:w},midPoint:{x:l,y:g},cumulativeValue:s,yValue:n,xValue:i,capDefaults:D,labelText:u,selected:r})}if(null==R)return;const m=R[R.length-1];if(null!=n){const e={point:{x:l,y:g},xDatum:i,yDatum:n};Array.isArray(m)?m.push(e):null!=m?(m.skip+=1,R.push([e])):R.push([e])}else p||(Array.isArray(m)||null==m?R.push({skip:0}):m.skip+=1)},[P,_]=y.range,L=_-P,N=n?.find(e=>e.maxRange>L),O=N?.indices;let[F,G]=this.visibleRange("xValue",s.range,O);F=Math.max(F-1,0),G=Math.min(G+1,O?.length??x.length),t.input.count<1e3&&(F=0,G=t.input.count),null==O&&(R=[]);for(let e=F;e<G;e+=1)k(O?.[e]??e);const B=R?.flatMap(e=>Array.isArray(e)?Tg(e,g):[]),V=null!=B?{itemId:a,spans:B}:void 0,H=T?.some((e,t)=>e===E[t])??!1;return{itemId:a,nodeData:I,labelData:I,strokeData:V,scales:this.calculateScaling(),visible:this.visible,crossFiltering:H}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(e){const{paths:[t],opacity:i,visible:n,animationEnabled:s}=e,r=!0===this.contextNodeData?.crossFiltering;t.setProperties({fill:void 0,lineJoin:"round",pointerEvents:1,opacity:i,stroke:this.properties.stroke,strokeWidth:this.getStrokeWidth(this.properties.strokeWidth),strokeOpacity:this.properties.strokeOpacity*(r?.25:1),lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset}),s||(t.visible=n),Kg(this,t)}getMarkerItemBaseStyle(e){const{properties:t}=this,{marker:i}=t,n=e?t.highlightStyle.item:void 0;return pc({size:i.size,shape:i.shape,fill:n?.fill??i.fill,fillOpacity:n?.fillOpacity??i.fillOpacity,stroke:n?.stroke??i.stroke,strokeWidth:n?.strokeWidth??i.strokeWidth,strokeOpacity:n?.strokeOpacity??i.strokeOpacity,lineDash:n?.lineDash??i.lineDash,lineDashOffset:n?.lineDashOffset??i.lineDashOffset},i.fillGradientDefaults,i.fillPatternDefaults,i.fillImageDefaults)}getMarkerItemStyleOverrides(e,t,i,n){const{id:s,properties:r}=this,{xKey:o,yKey:a,marker:l}=r,{itemStyler:c}=l;if(null!=c)return this.cachedDatumCallback(vu(e,n?"highlight":"node"),()=>{const e=this.getSeriesDomain("x"),r=this.getSeriesDomain("y");return this.callWithContext(c,{seriesId:s,...qs(t,o,a,e,r),datum:t,highlighted:n,...i})})}updateMarkerSelection(e){let{nodeData:t}=e;const{markerSelection:i}=e;return t=this.properties.marker.enabled||!0===this.contextNodeData?.crossFiltering?t:[],this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(t,void 0,e=>vu(e.xValue))}updateMarkerNodes(e){const{markerSelection:t,isHighlight:i}=e,{xKey:n,yKey:s,stroke:r,strokeWidth:o,strokeOpacity:a,marker:l,highlightStyle:c}=this.properties,h=this.getSeriesDomain("x"),u=this.getSeriesDomain("y"),d=L(i&&c.item,l.getStyle(),{stroke:r,strokeWidth:o,strokeOpacity:a}),p=this.ctx.animationManager.isSkipped(),g=this.getShapeFillBBox();t.each((e,t)=>{this.updateMarkerStyle(l,e,t.datum,t.point,qs(t,n,s,h,u),i,d,g,{applyTranslation:p,selected:t.selected})}),i||l.markClean()}updateLabelSelection(e){return e.labelSelection.update(this.isLabelEnabled()?e.labelData:[])}updateLabelNodes(e){const{enabled:t,fontStyle:i,fontWeight:n,fontSize:s,fontFamily:r,color:o}=this.properties.label;e.labelSelection.each((e,a)=>{t&&a?.labelText?(e.fontStyle=i,e.fontWeight=n,e.fontSize=s,e.fontFamily=r,e.textAlign="center",e.textBaseline="bottom",e.text=a.labelText,e.x=a.point.x,e.y=a.point.y-10,e.fill=o,e.visible=!0):e.visible=!1})}getTooltipContent(e){const{id:t,dataModel:i,processedData:n,axes:s,properties:r}=this,{xKey:o,xName:a,yKey:l,yName:c,tooltip:h}=r,u=s.x,d=s.y;if(!(i&&n&&u&&d))return;const p=n.dataSources.get(this.id)?.[e],g=i.resolveColumnById(this,"xValue",n)[e],f=i.resolveColumnById(this,"yValueRaw",n)[e];if(null==g)return;const m=this.getMarkerItemBaseStyle(!1);return Object.assign(m,this.getMarkerItemStyleOverrides(String(e),p,m,!1)),this.formatTooltipWithContext(h,{heading:u.formatDatum(g),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:d.formatDatum(f)}]},{seriesId:t,datum:p,title:c,xKey:o,xName:a,yKey:l,yName:c,...m,...this.getModuleTooltipParams()})}legendItemSymbol(){const e="rgba(0, 0, 0, 0)",{stroke:t,strokeOpacity:i,strokeWidth:n,lineDash:s,marker:r}=this.properties;return{marker:{...this.getMarkerStyle(r,void 0,void 0,!1,void 0,{fill:r.fill??e,stroke:r.stroke??t??e}),enabled:r.enabled},line:{stroke:t??e,strokeOpacity:i,strokeWidth:n,lineDash:s}}}getLegendData(e){if("category"!==e)return[];const{id:t,ctx:{legendManager:i},visible:n}=this,{yKey:s,yName:r,title:o,legendItemName:a,showInLegend:l}=this.properties;return[{legendType:"category",id:t,itemId:s,legendItemName:a,seriesId:t,enabled:n&&i.getItemEnabled({seriesId:t,itemId:s}),label:{text:a??o??r??s},symbol:this.legendItemSymbol(),hideInLegend:!l}]}updatePaths(e){this.updateLinePaths(e.paths,e.contextData)}plotNodeDataPoints(e,t){if(0===t.length)return;const i=t[0].point;e.moveTo(i.x,i.y);for(let i=1;i<t.length;i+=1){const{x:n,y:s}=t[i].point;e.lineTo(n,s)}}updateLinePaths(e,t){const i=t.strokeData?.spans,[n]=e;n.path.clear(),null!=i?Ig(n,i):this.plotNodeDataPoints(n.path,t.nodeData),n.markDirty("LineSeries")}animateEmptyUpdateReady(e){const{markerSelection:t,labelSelection:i,annotationSelections:n,contextData:s,paths:r}=e,{animationManager:o}=this.ctx;this.updateLinePaths(r,s),Wg(this,o,...r),ua([t],Ug),Vg(this,o,t),vp(this,"labels",o,i),vp(this,"annotations",o,...n)}animateReadyResize(e){const{contextData:t,paths:i}=e;this.updateLinePaths(i,t),super.animateReadyResize(e)}animateWaitingUpdateReady(e){const{animationManager:t}=this.ctx,{markerSelection:i,labelSelection:n,annotationSelections:s,contextData:r,paths:o,previousContextData:a}=e,[l]=o;this.resetMarkerAnimation(e),this.resetLabelAnimation(e);const c=()=>{this.resetPathAnimation(e),this.updateLinePaths(o,r)},h=()=>{t.skipCurrentBatch(),c()};if(null==r||null==a)return c(),Gg(this,t,"added",i),jg(this,"path_properties",t,"add",l),vp(this,"labels",t,n),void vp(this,"annotations",t,...s);if(r.crossFiltering!==a.crossFiltering)return void h();const u=_g(r,a,this.processedData?.reduced?.diff?.[this.id]);void 0!==u?"no-op"!==u.status&&(aa(this.id,"path_properties",t,[l],u.stroke.pathProperties),"added"===u.status?this.updateLinePaths(o,r):"removed"===u.status?this.updateLinePaths(o,a):yp(this.id,"path_update",t,[l],u.stroke.path),u.hasMotion&&(Gg(this,t,void 0,i),vp(this,"labels",t,n),vp(this,"annotations",t,...s))):h()}isLabelEnabled(){return this.properties.label.enabled}getBandScalePadding(){return{inner:1,outer:.1}}nodeFactory(){return new Mt}getFormattedMarkerStyle(e){const{xKey:t,yKey:i}=this.properties,n=this.getSeriesDomain("x"),s=this.getSeriesDomain("y");return this.getMarkerStyle(this.properties.marker,e.datum,qs(e,t,i,n,s),!0)}computeFocusBounds(e){return zg(this,e)}};Mm.className="LineSeries",Mm.type="line";var Tm={title:n.Yj,showInMiniChart:n.zM,connectMissingData:n.zM,interpolation:Of,label:Rf,marker:If,tooltip:Lf,errorBar:Pf,...Tf,...n.AF,...n.mL};Tm.sparklineMode=(0,n._L)(n.zM);var Dm={...Tm,...Df,type:(0,n.dY)("line"),xKey:(0,n.mw)(n.Yj),yKey:(0,n.mw)(n.Yj),xName:n.Yj,yName:n.Yj,stacked:n.zM,stackGroup:n.Yj,normalizedTo:n.ai,legendItemName:n.Yj,errorBar:_f};Dm.pickOutsideVisibleMinorAxis=(0,n._L)(n.zM),Dm.focusPriority=(0,n._L)(n.ai);var Im={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"line",moduleFactory:e=>new Mm(e),stackable:!0,tooltipDefaults:{range:"nearest"},defaultAxes:[{type:"number",position:"left"},{type:"category",position:"bottom"}],themeTemplate:{series:{tooltip:{position:{_seriesOverrideType:"node"}},stroke:dp,strokeWidth:2,strokeOpacity:1,lineDash:[0],lineDashOffset:0,interpolation:{type:"linear"},marker:{shape:"circle",size:7,strokeWidth:0,fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:gp,fillImageDefaults:fp},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},errorBar:{cap:{lengthRatio:1}}}}},Rm={type:"series",name:"line",chartType:"cartesian",options:Dm,create:e=>new Mm(e)},km=class extends pl{constructor(){super(...arguments),this.placement="top"}};a([Te],km.prototype,"placement",2);var Pm=class extends zp{constructor(){super(...arguments),this.label=new km,this.tooltip=new Lp,this.marker=new Pp}};a([Te],Pm.prototype,"xKey",2),a([Te],Pm.prototype,"yKey",2),a([Te],Pm.prototype,"labelKey",2),a([Te],Pm.prototype,"xFilterKey",2),a([Te],Pm.prototype,"yFilterKey",2),a([Te],Pm.prototype,"xName",2),a([Te],Pm.prototype,"yName",2),a([Te],Pm.prototype,"labelName",2),a([Te],Pm.prototype,"title",2),a([ri("marker.shape")],Pm.prototype,"shape",2),a([ri("marker.size")],Pm.prototype,"size",2),a([ri("marker.fill")],Pm.prototype,"fill",2),a([ri("marker.fillGradientDefaults")],Pm.prototype,"fillGradientDefaults",2),a([ri("marker.fillPatternDefaults")],Pm.prototype,"fillPatternDefaults",2),a([ri("marker.fillImageDefaults")],Pm.prototype,"fillImageDefaults",2),a([ri("marker.fillOpacity")],Pm.prototype,"fillOpacity",2),a([ri("marker.stroke")],Pm.prototype,"stroke",2),a([ri("marker.strokeWidth")],Pm.prototype,"strokeWidth",2),a([ri("marker.strokeOpacity")],Pm.prototype,"strokeOpacity",2),a([ri("marker.lineDash")],Pm.prototype,"lineDash",2),a([ri("marker.lineDashOffset")],Pm.prototype,"lineDashOffset",2),a([ri("marker.itemStyler")],Pm.prototype,"itemStyler",2),a([Te],Pm.prototype,"label",2),a([Te],Pm.prototype,"tooltip",2);var _m=class extends jp{constructor(e){super({moduleCtx:e,directionKeys:Vp,directionNames:Hp,categoryKey:void 0,pickModes:[2,1,0],pathsPerSeries:[],hasMarkers:!0,markerSelectionGarbageCollection:!1,animationResetFns:{marker:Hg,label:Cp},usesPlacedLabels:!0,clipFocusBox:!1}),this.properties=new Pm}get pickModeAxis(){return"main-category"}async processData(e){if(null==this.data||!this.visible)return;const t=this.axes.x?.scale,i=this.axes.y?.scale,{xScaleType:n,yScaleType:s}=this.getScaleInformation({xScale:t,yScale:i}),{xKey:r,yKey:o,xFilterKey:a,yFilterKey:l,labelKey:c}=this.properties;await this.requestDataModel(e,this.data,{props:[$h(r,n,{id:"xValue"}),$h(o,s,{id:"yValue"}),...null!=a?[$h(a,n,{id:"xFilterValue"})]:[],...null!=l?[$h(l,s,{id:"yFilterValue"})]:[],...c?[$h(c,"band",{id:"labelValue"})]:[]]}),this.animationState.transition("updateData")}xCoordinateRange(e,t){const i=this.axes.x.scale.convert(e),n=.5*this.properties.size*t;return[i-n,i+n]}yCoordinateRange(e,t){const i=this.axes.y.scale.convert(e[0]),n=.5*this.properties.size*t;return[i-n,i+n]}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return[];const n={x:"xValue",y:"yValue"},s=n[e],r=t.resolveProcessedDataDefById(this,s),o=t.getDomain(this,s,"value",i);if("value"===r?.def.type&&"category"===r?.def.valueType)return o;const a=n["x"===e?"y":"x"];return No(Dh(this.domainForClippedRange(e,[s],a,!1)))}getSeriesRange(e,t){return this.domainForVisibleRange("y",["yValue"],"xValue",t,!1)}getVisibleItems(e,t,i){return this.countVisibleItems("xValue",["yValue"],e,t,i)}createNodeData(){const{axes:e,dataModel:t,processedData:i,visible:n}=this,{xKey:s,yKey:r,xFilterKey:o,yFilterKey:a,labelKey:l,xName:c,yName:h,labelName:u,marker:d,label:p}=this.properties,{placement:g}=p,f=Nc.anchor(d.shape),m=e.x,y=e.y;if(!(t&&i&&n&&m&&y))return;const v=t.resolveColumnById(this,"xValue",i),b=t.resolveColumnById(this,"yValue",i),C=null!=l?t.resolveColumnById(this,"labelValue",i):void 0,w=null!=o?t.resolveColumnById(this,"xFilterValue",i):void 0,S=null!=a?t.resolveColumnById(this,"yFilterValue",i):void 0,x=m.scale,E=y.scale,A=(x.bandwidth??0)/2,M=(E.bandwidth??0)/2,T=[],D=p.getFont(),I=Di.getMeasurer({font:D});return(i.dataSources.get(this.id)??[]).forEach((e,t)=>{const i=v[t],n=b[t],o=x.convert(i)+A,a=E.convert(n)+M,m=null!=w&&null!=S?w[t]===i&&S[t]===n:void 0,y=this.getLabelText(p,{value:null!=C?C?.[t]:n,datum:e,xKey:s,yKey:r,labelKey:l,xName:c,yName:h,labelName:u}),D=I.measureText(y);T.push({series:this,itemId:r,yKey:r,xKey:s,datum:e,datumIndex:t,xValue:i,yValue:n,capDefaults:{lengthRatioMultiplier:d.getDiameter(),lengthMax:1/0},point:{x:o,y:a,size:d.size},midPoint:{x:o,y:a},label:{text:y,...D},anchor:f,placement:g,selected:m})}),{itemId:r,nodeData:T,labelData:T,scales:this.calculateScaling(),visible:this.visible}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}updateMarkerSelection(e){const{nodeData:t,markerSelection:i}=e;return this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(this.properties.marker.enabled?t:[])}updateMarkerNodes(e){const{markerSelection:t,isHighlight:i}=e,{xKey:n,yKey:s,labelKey:r,marker:o,highlightStyle:a}=this.properties,l=L(i&&a.item,o.getStyle()),c=this.getShapeFillBBox();t.each((e,t)=>{this.updateMarkerStyle(o,e,t.datum,t.point,{xKey:n,yKey:s,labelKey:r},i,l,c,{selected:t.selected})}),i||o.markClean()}updatePlacedLabelData(e){this.labelSelection.update(e.map(e=>({...e.datum,point:{x:e.x,y:e.y,size:e.datum.point.size}})),e=>{e.pointerEvents=1}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(e){const{label:t}=this.properties;e.labelSelection.each((e,i)=>{e.text=i.label.text,e.fill=t.color,e.x=i.point?.x??0,e.y=i.point?.y??0,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.fontSize=t.fontSize,e.fontFamily=t.fontFamily,e.textAlign="left",e.textBaseline="top"})}getTooltipContent(e){const{id:t,dataModel:i,processedData:n,axes:s,properties:r}=this,{xKey:o,xName:a,yKey:l,yName:c,labelKey:h,labelName:u,title:d,tooltip:p,marker:g}=r,f=s.x,m=s.y;if(!(i&&n&&f&&m))return;const y=n.dataSources.get(this.id)?.[e],v=i.resolveColumnById(this,"xValue",n)[e],b=i.resolveColumnById(this,"yValue",n)[e],C=this.contextNodeData?.nodeData[e];if(null==v||null==C)return;const w=this.getMarkerStyle(g,C.datum,{xKey:o,yKey:l,labelKey:h,highlighted:!0});return this.formatTooltipWithContext(p,{symbol:this.legendItemSymbol(),title:d,data:[{label:a,fallbackLabel:o,value:f.formatDatum(v)},{label:c,fallbackLabel:l,value:m.formatDatum(b)}]},{seriesId:t,datum:y,title:c,xKey:o,xName:a,yKey:l,yName:c,labelKey:h,labelName:u,...w,...this.getModuleTooltipParams()})}legendItemSymbol(){return{marker:this.getMarkerStyle(this.properties.marker)}}getLegendData(e){if("category"!==e)return[];const{yKey:t,yName:i,title:n,showInLegend:s}=this.properties,{id:r,ctx:{legendManager:o},visible:a}=this;return[{legendType:"category",id:r,itemId:t,seriesId:r,enabled:a&&o.getItemEnabled({seriesId:r,itemId:t}),label:{text:n??i??t},symbol:this.legendItemSymbol(),hideInLegend:!s}]}animateEmptyUpdateReady(e){const{markerSelection:t,labelSelection:i,annotationSelections:n}=e;Bg(this,this.ctx.animationManager,t),vp(this,"labels",this.ctx.animationManager,i),vp(this,"annotations",this.ctx.animationManager,...n)}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new Mt}getFormattedMarkerStyle(e){const{xKey:t,yKey:i,labelKey:n}=this.properties;return this.getMarkerStyle(this.properties.marker,e.datum,{xKey:t,yKey:i,labelKey:n},!0)}computeFocusBounds(e){return zg(this,e)}};_m.className="ScatterSeries",_m.type="scatter";var Lm={title:n.Yj,showInMiniChart:n.zM,label:{placement:(0,n.KC)("top","right","bottom","left"),...Rf},tooltip:Lf,errorBar:Pf,...Tf,...G(If,["enabled"])},Nm={...Lm,...Df,type:(0,n.mw)((0,n.dY)("scatter")),xKey:(0,n.mw)(n.Yj),yKey:(0,n.mw)(n.Yj),labelKey:n.Yj,xName:n.Yj,yName:n.Yj,labelName:n.Yj,errorBar:_f},Om={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"scatter",moduleFactory:e=>new _m(e),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{shape:"circle",size:7,fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:gp,fillImageDefaults:fp,fillOpacity:.8,tooltip:{position:{_seriesOverrideType:"node"}},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},errorBar:{cap:{lengthRatio:1}}}}},Fm={type:"series",name:"scatter",chartType:"cartesian",options:Nm,create:e=>new _m(e)},Gm=class e{constructor(e,t,i,n){this.startAngle=e,this.endAngle=t,this.innerRadius=i,this.outerRadius=n}clone(){const{startAngle:t,endAngle:i,innerRadius:n,outerRadius:s}=this;return new e(t,i,n,s)}equals(e){return this.startAngle===e.startAngle&&this.endAngle===e.endAngle&&this.innerRadius===e.innerRadius&&this.outerRadius===e.outerRadius}[u](t,i){return new e(this.startAngle*(1-i)+t.startAngle*i,this.endAngle*(1-i)+t.endAngle*i,this.innerRadius*(1-i)+t.innerRadius*i,this.outerRadius*(1-i)+t.outerRadius*i)}};function Bm({startAngle:e,endAngle:t,innerRadius:i,outerRadius:n}){let s=1/0,r=1/0,o=-1/0,a=-1/0;const l=(e,t)=>{s=Math.min(e,s),r=Math.min(t,r),o=Math.max(e,o),a=Math.max(t,a)};return l(i*Math.cos(e),i*Math.sin(e)),l(i*Math.cos(t),i*Math.sin(t)),l(n*Math.cos(e),n*Math.sin(e)),l(n*Math.cos(t),n*Math.sin(t)),re(0,e,t)&&l(n,0),re(.5*Math.PI,e,t)&&l(0,n),re(Math.PI,e,t)&&l(-n,0),re(1.5*Math.PI,e,t)&&l(0,-n),new m(s,r,o-s,a-r)}function Vm(e,t,i){const n=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),{innerRadius:s,outerRadius:r}=i;if(i.startAngle===i.endAngle||n<Math.min(s,r)||n>Math.max(s,r))return!1;const o=se(i.startAngle),a=se(i.endAngle),l=Math.atan2(t,e);return o<a?l<=a&&l>=o:l<=a&&l>=-Math.PI||l>=o&&l<=Math.PI}function Hm(e,t){const{startAngle:i,endAngle:n,innerRadius:s,outerRadius:r}=t,o={x:r*Math.cos(i),y:r*Math.sin(i)},a={x:r*Math.cos(n),y:r*Math.sin(n)},l=0===s?{x:0,y:0}:{x:s*Math.cos(i),y:s*Math.sin(i)},c=0===s?{x:0,y:0}:{x:s*Math.cos(n),y:s*Math.sin(n)};return We(e.start.x,e.start.y,e.end.x,e.end.y,o.x,o.y,l.x,l.y)||We(e.start.x,e.start.y,e.end.x,e.end.y,a.x,a.y,c.x,c.y)||Ke(0,0,r,i,n,!0,e.start.x,e.start.y,e.end.x,e.end.y)}function Um(e,t){const i={x:e.x,y:e.y},n={x:e.x+e.width,y:e.y},s={x:e.x,y:e.y+e.height},r={x:e.x+e.width,y:e.y+e.height};return Hm({start:i,end:n},t)||Hm({start:s,end:r},t)}function zm(e,t,i,n){if(0===i&&0===n)return 0;if(Math.asin(Math.abs(1*i)/(e+1*i))+Math.asin(Math.abs(1*n)/(e+1*n))-t<0)return 1;let s=0,r=1;for(let o=0;o<8;o+=1){const o=(s+r)/2;Math.asin(Math.abs(o*i)/(e+o*i))+Math.asin(Math.abs(o*n)/(e+o*n))-t<0?s=o:r=o}return s}function Wm(e,t){return le(e,t)<1e-6?t:ie(e-t)+t}function jm(e,t,i=0){const n=Math.abs(t-e)>=2*Math.PI?2*Math.PI:ie(t-e);return{startAngle:e=Wm(e,i),endAngle:t=e+n}}function $m(e,t,i,n,s,r){const o=Math.sin(r),a=Math.cos(r),l=e**2+t**2-i**2;let c,h,u,d;if(a>.5){const i=o/a,n=1+i**2,s=-2*(e+t*i),r=s**2-4*n*l;if(r<0)return;const p=(-s+Math.sqrt(r))/(2*n),g=(-s-Math.sqrt(r))/(2*n);c=p,h=p*i,u=g,d=g*i}else{const i=a/o,n=1+i**2,s=-2*(t+e*i),r=s**2-4*n*l;if(r<0)return;const p=(-s+Math.sqrt(r))/(2*n),g=(-s-Math.sqrt(r))/(2*n);c=p*i,h=p,u=g*i,d=g}const p=u*a+d*o,g=c*a+h*o>0?Wm(Math.atan2(h-t,c-e),n):NaN,f=p>0?Wm(Math.atan2(d-t,u-e),n):NaN;return g>=n&&g<=s?g:f>=n&&f<=s?f:void 0}function Km(e,t,i,n,s,r){const o=Math.hypot(e,t),a=o-(o**2-i**2+r**2)/(2*o),l=Math.atan2(t,e),c=Math.acos(-a/i),h=Wm(l+c,n),u=Wm(l-c,n);return h>=n&&h<=s?h:u>=n&&u<=s?u:void 0}var Ym=class{constructor(e,t,i,n,s){this.cx=e,this.cy=t,this.r=i,this.a0=n,this.a1=s,this.a0>=this.a1&&(this.a0=NaN,this.a1=NaN)}isValid(){return Number.isFinite(this.a0)&&Number.isFinite(this.a1)}pointAt(e){return{x:this.cx+this.r*Math.cos(e),y:this.cy+this.r*Math.sin(e)}}clipStart(e){null==e||!this.isValid()||e<this.a0||(this.a0=e,(Number.isNaN(e)||this.a0>=this.a1)&&(this.a0=NaN,this.a1=NaN))}clipEnd(e){null==e||!this.isValid()||e>this.a1||(this.a1=e,(Number.isNaN(e)||this.a0>=this.a1)&&(this.a0=NaN,this.a1=NaN))}},qm=class extends Cc{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.innerRadius=10,this.outerRadius=20,this.startAngle=0,this.endAngle=2*Math.PI,this.clipSector=void 0,this.concentricEdgeInset=0,this.radialEdgeInset=0,this.startOuterCornerRadius=0,this.endOuterCornerRadius=0,this.startInnerCornerRadius=0,this.endInnerCornerRadius=0}set inset(e){this.concentricEdgeInset=e,this.radialEdgeInset=e}set cornerRadius(e){this.startOuterCornerRadius=e,this.endOuterCornerRadius=e,this.startInnerCornerRadius=e,this.endInnerCornerRadius=e}computeBBox(){return Bm(this).translate(this.centerX,this.centerY)}normalizedRadii(){const{concentricEdgeInset:e}=this;let{innerRadius:t,outerRadius:i}=this;return t=t>0?t+e:0,i=Math.max(i-e,0),{innerRadius:t,outerRadius:i}}normalizedClipSector(){const{clipSector:e}=this;if(null==e)return;const{startAngle:t,endAngle:i}=jm(this.startAngle,this.endAngle),{innerRadius:n,outerRadius:s}=this.normalizedRadii(),r=jm(e.startAngle,e.endAngle,t);return new Gm(Math.max(t,r.startAngle),Math.min(i,r.endAngle),Math.max(n,e.innerRadius),Math.min(s,e.outerRadius))}getAngleOffset(e){return e>0?this.radialEdgeInset/e:0}arc(e,t,i,n,s,r,o,a){if(e<=0)return;const{startAngle:l,endAngle:c}=jm(this.startAngle,this.endAngle),{innerRadius:h,outerRadius:u}=this.normalizedRadii(),d=this.normalizedClipSector();if(a&&h<=0)return;const p=a?this.getAngleOffset(h+e):this.getAngleOffset(u-e),g=o?l+p+t:c-p-t,f=a?h+e:u-e,m=f*Math.cos(g),y=f*Math.sin(g);if(null!=d){const e=1e-6;if(!(o||g>=l-e&&g<=d.endAngle-e))return;if(o&&!(g>=d.startAngle+e&&g<=c-e))return;if(a&&f<d.innerRadius-e)return;if(!a&&f>d.outerRadius+e)return}const v=new Ym(m,y,e,i,n);if(null!=d){let t,c;if(a?(v.clipStart($m(m,y,e,i,n,d.endAngle)),v.clipEnd($m(m,y,e,i,n,d.startAngle))):(v.clipStart($m(m,y,e,i,n,d.startAngle)),v.clipEnd($m(m,y,e,i,n,d.endAngle))),o?(t=Km(m,y,e,i,n,d.innerRadius),c=Km(m,y,e,i,n,d.outerRadius)):(t=Km(m,y,e,i,n,d.outerRadius),c=Km(m,y,e,i,n,d.innerRadius)),v.clipStart(t),v.clipEnd(c),null!=t){const{x:e,y:i}=v.pointAt(t),n=Wm(Math.atan2(i,e),l);o?r?.clipStart(n):s.clipEnd(n)}if(null!=c){const{x:e,y:t}=v.pointAt(c),i=Wm(Math.atan2(t,e),l);o?s.clipStart(i):r?.clipEnd(i)}}if(null!=d){const{x:e,y:t}=v.pointAt((v.a0+v.a1)/2);if(!Vm(e,t,d))return}const{x:b,y:C}=v.pointAt(o===a?v.a0:v.a1),w=Wm(Math.atan2(C,b),l),S=a?r:s;return o?S?.clipStart(w):S?.clipEnd(w),v}updatePath(){const{path:e,centerX:t,centerY:i,concentricEdgeInset:n,radialEdgeInset:s}=this;let{startOuterCornerRadius:r,endOuterCornerRadius:o,startInnerCornerRadius:a,endInnerCornerRadius:l}=this;const{startAngle:c,endAngle:h}=jm(this.startAngle,this.endAngle),{innerRadius:u,outerRadius:d}=this.normalizedRadii(),p=this.normalizedClipSector(),g=h-c,f=g>=2*Math.PI-1e-6;if(e.clear(),0===u&&0===d||u>d)return;if((p?.startAngle??c)===(p?.endAngle??h))return;if(f&&null==this.clipSector&&0===r&&0===o&&0===a&&0===l)return e.moveTo(t+d*Math.cos(c),i+d*Math.sin(c)),e.arc(t,i,d,c,h),u>n&&(e.moveTo(t+u*Math.cos(h),i+u*Math.sin(h)),e.arc(t,i,u,h,c,!0)),void e.closePath();if(null==this.clipSector&&Math.abs(u-d)<1e-6)return e.arc(t,i,d,c,h,!1),e.arc(t,i,d,h,c,!0),void e.closePath();const m=this.getAngleOffset(u),y=this.getAngleOffset(d);if(g<2*y)return;const v=(p?.innerRadius??u)>n,b=u<n||g<2*m,C=d-u,w=Math.max(r,a,o,l),S=w>0?Math.min(C/w,1):1;r*=S,o*=S,a*=S,l*=S;const x=zm(d,g-2*y,-r,-o);if(r*=x,o*=x,!b&&v){const e=zm(u,g-2*m,a,l);a*=e,l*=e}else a=0,l=0;const E=Math.max(r+a,o+l),A=E>0?Math.min(C/E,1):1;r*=A,o*=A,a*=A,l*=A;let M=0,T=0;const D=r/(d-r),I=o/(d-o);if(D>=0&&D<.999999)M=Math.asin(D);else{M=g/2;const e=d/(1/Math.sin(M)+1);r=Math.min(e,r)}if(I>=0&&I<.999999)T=Math.asin(I);else{T=g/2;const e=d/(1/Math.sin(T)+1);o=Math.min(e,o)}const R=Math.asin(a/(u+a)),k=Math.asin(l/(u+l)),P=p?.outerRadius??d,_=this.getAngleOffset(P),L=new Ym(0,0,P,c+_,h-_),N=p?.innerRadius??u,O=this.getAngleOffset(N),F=v?new Ym(0,0,N,c+O,h-O):void 0;null!=p&&(L.clipStart(p.startAngle),L.clipEnd(p.endAngle),F?.clipStart(p.startAngle),F?.clipEnd(p.endAngle));const G=this.arc(r,M,c-.5*Math.PI,c+M,L,F,!0,!1),B=this.arc(o,T,h-T,h+.5*Math.PI,L,F,!1,!1),V=this.arc(l,k,h+.5*Math.PI,h+Math.PI-k,L,F,!1,!0),H=this.arc(a,R,c+Math.PI+R,c+1.5*Math.PI,L,F,!0,!0);if(b){const n=g<.5*Math.PI?s*(1+Math.cos(g))/Math.sin(g):NaN;let r;r=n>0&&n<d?Math.max(Math.hypot(s,n),u):s,r=Math.max(r,u);const o=c+.5*g;e.moveTo(t+r*Math.cos(o),i+r*Math.sin(o))}else if(!0===H?.isValid()||!0===F?.isValid());else{const n=c+g/2,s=u*Math.cos(n),r=u*Math.sin(n);e.moveTo(t+s,i+r)}if(!0===G?.isValid()){const{cx:n,cy:s,r,a0:o,a1:a}=G;e.arc(t+n,i+s,r,o,a)}if(L.isValid()){const{r:n,a0:s,a1:r}=L;e.arc(t,i,n,s,r)}if(!0===B?.isValid()){const{cx:n,cy:s,r,a0:o,a1:a}=B;e.arc(t+n,i+s,r,o,a)}if(!b){if(!0===V?.isValid()){const{cx:n,cy:s,r,a0:o,a1:a}=V;e.arc(t+n,i+s,r,o,a)}if(!0===F?.isValid()){const{r:n,a0:s,a1:r}=F;e.arc(t,i,n,r,s,!0)}if(!0===H?.isValid()){const{cx:n,cy:s,r,a0:o,a1:a}=H;e.arc(t+n,i+s,r,o,a)}}e.closePath()}isPointInPath(e,t){const{startAngle:i,endAngle:n,innerRadius:s,outerRadius:r}=this.clipSector??this;return Vm(e-this.centerX,t-this.centerY,{startAngle:i,endAngle:n,innerRadius:Math.min(s,r),outerRadius:Math.max(s,r)})}};qm.className="Sector",a([K()],qm.prototype,"centerX",2),a([K()],qm.prototype,"centerY",2),a([K()],qm.prototype,"innerRadius",2),a([K()],qm.prototype,"outerRadius",2),a([K()],qm.prototype,"startAngle",2),a([K()],qm.prototype,"endAngle",2),a([Y({equals:(e,t)=>e.equals(t)})],qm.prototype,"clipSector",2),a([K()],qm.prototype,"concentricEdgeInset",2),a([K()],qm.prototype,"radialEdgeInset",2),a([K()],qm.prototype,"startOuterCornerRadius",2),a([K()],qm.prototype,"endOuterCornerRadius",2),a([K()],qm.prototype,"startInnerCornerRadius",2),a([K()],qm.prototype,"endInnerCornerRadius",2);var Xm={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},Zm={BLUE:"#2b5c95",ORANGE:"#cc6f10",GREEN:"#1e652e",CYAN:"#18859e",YELLOW:"#a69400",VIOLET:"#603c88",GRAY:"#575757",MAGENTA:"#7d2f6d",BROWN:"#4f3508",RED:"#a82529"},Qm=class extends Fi{constructor(){super(...arguments),this.showInLegend=!1}};a([Te],Qm.prototype,"showInLegend",2);var Jm=class extends pl{constructor(){super(...arguments),this.spacing=2}set(e,t){return super.set(e)}};a([Te],Jm.prototype,"text",2),a([Te],Jm.prototype,"spacing",2);var ey=class extends De{constructor(){super(...arguments),this.fill="transparent",this.fillOpacity=1}};a([Te],ey.prototype,"fill",2),a([Te],ey.prototype,"fillOpacity",2);var ty=class extends pl{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}};a([Te],ty.prototype,"offset",2),a([Te],ty.prototype,"minAngle",2),a([Te],ty.prototype,"minSpacing",2),a([Te],ty.prototype,"maxCollisionOffset",2),a([Te],ty.prototype,"avoidCollisions",2);var iy=class extends pl{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}};a([Te],iy.prototype,"positionOffset",2),a([Te],iy.prototype,"positionRatio",2);var ny=class extends De{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}};a([Te],ny.prototype,"colors",2),a([Te],ny.prototype,"length",2),a([Te],ny.prototype,"strokeWidth",2);var sy=class extends kp{constructor(){super(...arguments),this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=Object.values(Xm),this.strokes=Object.values(Zm),this.fillOpacity=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.outerRadiusOffset=0,this.outerRadiusRatio=1,this.strokeWidth=1,this.sectorSpacing=0,this.hideZeroValueSectorsInLegend=!1,this.innerLabels=new Ie(Jm),this.title=new Qm,this.innerCircle=new ey,this.shadow=new Sp,this.calloutLabel=new ty,this.sectorLabel=new iy,this.calloutLine=new ny,this.tooltip=new Lp}};function ry(e,t,i,n){const s=[i.convert(0),i.convert(1)],r=[n.convert(0),n.convert(1)],o=Math.PI/-2+oe(t),a=e?"initial":"update";return{nodes:{toFn:(e,t,i,{prevLive:n})=>{let{startAngle:r,endAngle:a,innerRadius:l,outerRadius:c}=t;const{stroke:h,fill:u}=t.sectorFormat;if("removed"===i&&n?(r=n.datum?.endAngle,a=n.datum?.endAngle):"removed"!==i||n||(r=o,a=o),"removed"===i){const e=(({radius:e})=>({innerRadius:s[0],outerRadius:s[0]+(s[1]-s[0])*e}))(t);l=e.innerRadius,c=e.outerRadius}return{startAngle:r,endAngle:a,outerRadius:c,innerRadius:l,stroke:h,fill:u}},fromFn:(t,i,n,{prevFromProps:s})=>{let{startAngle:l,endAngle:c,innerRadius:h,outerRadius:u}=t,{fill:d,stroke:p}=i.sectorFormat;if("updated"===n&&null==t.previousDatum&&(n="added"),"unknown"===n||"added"===n&&!s?(l=o,c=o,h=i.innerRadius,u=i.outerRadius):"added"===n&&s&&(l=s.endAngle??o,c=s.endAngle??o,h=s.innerRadius??i.innerRadius,u=s.outerRadius??i.outerRadius),"added"===n&&!e){const e=(({radius:e})=>({innerRadius:r[0],outerRadius:r[0]+(r[1]-r[0])*e}))(i);h=e.innerRadius,u=e.outerRadius}return"updated"===n&&(d=t.fill??d,p=("string"==typeof t.stroke?t.stroke:void 0)??p),{startAngle:l,endAngle:c,innerRadius:h,outerRadius:u,fill:d,stroke:p,phase:a}}},innerCircle:{fromFn:(e,t)=>({size:e.previousDatum?.radius??e.size??0,phase:a}),toFn:(e,t)=>({size:t.radius??0})}}}function oy(e,t){return{startAngle:t.startAngle,endAngle:t.endAngle,innerRadius:t.innerRadius,outerRadius:t.outerRadius,stroke:t.sectorFormat.stroke}}function ay(e,t){const i=t.y-e.centerY,n=t.x-e.centerX,s=Math.atan2(i,n),r=e.getItemNodes();for(const e of r)if(!0!==e.datum.missing&&re(s,e.startAngle,e.endAngle)){const t=Math.sqrt(n*n+i*i);let s=0;return t<e.innerRadius?s=e.innerRadius-t:t>e.outerRadius&&(s=t-e.outerRadius),{datum:e.datum,distance:s}}}a([Te],sy.prototype,"angleKey",2),a([Te],sy.prototype,"angleName",2),a([Te],sy.prototype,"angleFilterKey",2),a([Te],sy.prototype,"radiusKey",2),a([Te],sy.prototype,"radiusName",2),a([Te],sy.prototype,"radiusMin",2),a([Te],sy.prototype,"radiusMax",2),a([Te],sy.prototype,"calloutLabelKey",2),a([Te],sy.prototype,"calloutLabelName",2),a([Te],sy.prototype,"sectorLabelKey",2),a([Te],sy.prototype,"sectorLabelName",2),a([Te],sy.prototype,"legendItemKey",2),a([Te],sy.prototype,"defaultColorRange",2),a([Te],sy.prototype,"defaultPatternFills",2),a([Te],sy.prototype,"fills",2),a([Te],sy.prototype,"strokes",2),a([Te],sy.prototype,"fillOpacity",2),a([Te],sy.prototype,"strokeOpacity",2),a([Te],sy.prototype,"lineDash",2),a([Te],sy.prototype,"lineDashOffset",2),a([Te],sy.prototype,"cornerRadius",2),a([Te],sy.prototype,"itemStyler",2),a([Te],sy.prototype,"rotation",2),a([Te],sy.prototype,"outerRadiusOffset",2),a([Te],sy.prototype,"outerRadiusRatio",2),a([Te],sy.prototype,"innerRadiusOffset",2),a([Te],sy.prototype,"innerRadiusRatio",2),a([Te],sy.prototype,"strokeWidth",2),a([Te],sy.prototype,"sectorSpacing",2),a([Te],sy.prototype,"hideZeroValueSectorsInLegend",2),a([Te],sy.prototype,"innerLabels",2),a([Te],sy.prototype,"title",2),a([Te],sy.prototype,"innerCircle",2),a([Te],sy.prototype,"shadow",2),a([Te],sy.prototype,"calloutLabel",2),a([Te],sy.prototype,"sectorLabel",2),a([Te],sy.prototype,"calloutLine",2),a([Te],sy.prototype,"tooltip",2);var ly=(e=>(e[e.BACKGROUND=0]="BACKGROUND",e[e.FOREGROUND=1]="FOREGROUND",e[e.HIGHLIGHT=2]="HIGHLIGHT",e[e.LABEL=3]="LABEL",e))(ly||{}),cy=class extends Bp{constructor({categoryKey:e,useLabelLayer:t=!1,pickModes:i=[1,0],canHaveAxes:n=!1,animationResetFns:s,...r}){super({...r,categoryKey:e,useLabelLayer:t,pickModes:i,directionKeys:{angle:["angleKey"],radius:["radiusKey"]},directionNames:{angle:["angleName"],radius:["radiusName"]},canHaveAxes:n}),this.directions=["angle","radius"],this.itemGroup=this.contentGroup.appendChild(new Mt),this.nodeData=[],this.itemSelection=da.select(this.itemGroup,()=>this.nodeFactory(),!1),this.labelSelection=da.select(this.labelGroup,()=>this.labelFactory(),!1),this.highlightSelection=da.select(this.highlightGroup,()=>this.nodeFactory()),this.highlightLabelSelection=da.select(this.highlightLabel,()=>this.labelFactory()),this.centerX=0,this.centerY=0,this.radius=0,this.animationResetFns=s,this.animationState=new Ca("empty",{empty:{update:{target:"ready",action:e=>this.animateEmptyUpdateReady(e)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:e=>this.animateReadyHighlight(e),highlightMarkers:e=>this.animateReadyHighlightMarkers(e),resize:e=>this.animateReadyResize(e),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:e=>this.animateWaitingUpdateReady(e)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:e=>this.animateClearingUpdateEmpty(e)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}getItemNodes(){return[...this.itemGroup.children()]}getNodeData(){return this.nodeData}setSeriesIndex(e){return!!super.setSeriesIndex(e)&&(this.contentGroup.zIndex=[e,1],this.highlightGroup.zIndex=[e,2],this.labelGroup.zIndex=[e,3],!0)}resetAnimation(e){"initial"===e?this.animationState.transition("reset"):"ready"===e&&this.animationState.transition("skip")}labelFactory(){const e=new _i;return e.pointerEvents=1,e}addChartEventListeners(){this.destroyFns.push(this.ctx.chartEventManager?.addListener("legend-item-click",e=>this.onLegendItemClick(e)),this.ctx.chartEventManager?.addListener("legend-item-double-click",e=>this.onLegendItemDoubleClick(e)))}getInnerRadius(){return 0}computeLabelsBBox(e,t){return null}getShapeFillBBox(){const e=this.radius;return{series:new m(-e,-e,2*e,2*e),axis:new m(-e,-e,2*e,2*e)}}resetAllAnimation(){const{item:e,label:t}=this.animationResetFns??{};this.ctx.animationManager.stopByAnimationGroupId(this.id),e&&ua([this.itemSelection,this.highlightSelection],e),t&&ua([this.labelSelection,this.highlightLabelSelection],t),this.itemSelection.cleanup(),this.labelSelection.cleanup(),this.highlightSelection.cleanup(),this.highlightLabelSelection.cleanup()}animateEmptyUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateWaitingUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateReadyHighlight(e){const{item:t,label:i}=this.animationResetFns??{};t&&ua([this.highlightSelection],t),i&&ua([this.highlightLabelSelection],i)}animateReadyHighlightMarkers(e){}animateReadyResize(e){this.resetAllAnimation()}animateClearingUpdateEmpty(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}computeFocusBounds(e){const t=this.getNodeData()?.[e.datumIndex];if(void 0!==t)return this.itemSelection.select(e=>e instanceof Cc&&e.datum===t)[0]}getSeriesRange(e,t){return[NaN,NaN]}},hy=class extends yc{constructor(e,t,i,n){super(e,t,i,n),this.angleKey=n.properties.angleKey,this.radiusKey=n.properties.radiusKey,this.calloutLabelKey=n.properties.calloutLabelKey,this.sectorLabelKey=n.properties.sectorLabelKey}},uy=class extends cy{constructor(e){super({moduleCtx:e,categoryKey:void 0,pickModes:[1,0],useLabelLayer:!0,animationResetFns:{item:oy,label:Cp}}),this.properties=new sy,this.phantomNodeData=void 0,this.backgroundGroup=new It({name:`${this.id}-background`,zIndex:0}),this.noVisibleData=!1,this.previousRadiusScale=new Vu,this.radiusScale=new Vu,this.phantomGroup=this.backgroundGroup.appendChild(new Mt({name:"phantom"})),this.phantomSelection=da.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.calloutLabelGroup=this.contentGroup.appendChild(new Mt({name:"pieCalloutLabels"})),this.calloutLabelSelection=new da(this.calloutLabelGroup,Mt),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new Mt({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new Nc({shape:"circle"})),this.zerosumInnerRing=this.zerosumRingsGroup.appendChild(new Nc({shape:"circle"})),this.innerLabelsGroup=this.contentGroup.appendChild(new Mt({name:"innerLabels"})),this.innerCircleGroup=this.backgroundGroup.appendChild(new Mt({name:`${this.id}-innerCircle`})),this.innerLabelsSelection=da.select(this.innerLabelsGroup,_i),this.innerCircleSelection=da.select(this.innerCircleGroup,()=>new Nc({shape:"circle"})),this.surroundingRadius=void 0,this.NodeEvent=hy,this.angleScale=new Vu,this.angleScale.domain=[0,1],this.angleScale.range=[-Math.PI,Math.PI].map(e=>e+Math.PI/2),this.phantomGroup.opacity=.2}get calloutNodeData(){return this.phantomNodeData??this.nodeData}attachSeries(e,t,i){super.attachSeries(e,t,i),e?.appendChild(this.backgroundGroup)}detachSeries(e,t,i){super.detachSeries(e,t,i),e?.removeChild(this.backgroundGroup)}setSeriesIndex(e){return!!super.setSeriesIndex(e)&&(this.backgroundGroup.zIndex=[0,e],!0)}nodeFactory(){return new qm}getSeriesDomain(e){return"angle"===e?this.angleScale.domain:this.radiusScale.domain}async processData(e){if(null==this.data)return;const{visible:t,id:i,ctx:{legendManager:s}}=this,{angleKey:r,angleFilterKey:o,radiusKey:a,calloutLabelKey:l,sectorLabelKey:c,legendItemKey:h}=this.properties,u=()=>(e,n)=>t&&s.getItemEnabled({seriesId:i,itemId:n})?e:0,d=!this.ctx.animationManager.isSkipped(),p=[],g=[];h?p.push(jh(h,"band",{id:"legendItemKey"})):l?p.push(jh(l,"band",{id:"calloutLabelKey"})):c&&p.push(jh(c,"band",{id:"sectorLabelKey"}));const f=this.radiusScale.type,m=this.angleScale.type;a&&g.push(Xh(a,{id:"radiusValue",min:this.properties.radiusMin??0,max:this.properties.radiusMax,missingValue:this.properties.radiusMax??1,processor:u}),$h(a,f,{id:"radiusRaw",processor:u}),au("radiusValue",[0,1],1,this.properties.radiusMin??0,this.properties.radiusMax)),l&&g.push($h(l,"band",{id:"calloutLabelValue"})),c&&g.push($h(c,"band",{id:"sectorLabelValue"})),h&&g.push($h(h,"band",{id:"legendItemValue"})),o&&g.push(Zh(o,m,{id:"angleFilterValue",onlyPositive:!0,invalidValue:0,processor:u}),$h(o,m,{id:"angleFilterRaw"}),au("angleFilterValue",[0,1],0,0)),d&&this.processedData&&p.length>0&&g.push(yu(this.id,this.processedData)),g.push(cu()),await this.requestDataModel(e,this.data,{props:[...p,Zh(r,m,{id:"angleValue",onlyPositive:!0,invalidValue:0,processor:u}),$h(r,m,{id:"angleRaw"}),au("angleValue",[0,1],0,0),...g]});for(const e of this.processedData?.defs?.values??[]){const{id:t,missing:i,property:s}=e,r=Oo(this,i);"angleRaw"!==t&&r>0&&n.Vy.warnOnce(`no value was found for the key '${String(s)}' on ${r} data element${r>1?"s":""}`)}this.animationState.transition("updateData")}maybeRefreshNodeData(){if(!this.nodeDataRefresh)return;const{nodeData:e=[],phantomNodeData:t}=this.createNodeData()??{};this.nodeData=e,this.phantomNodeData=t,this.nodeDataRefresh=!1}getProcessedDataValues(e,t){return{angleValues:e.resolveColumnById(this,"angleValue",t),angleRawValues:e.resolveColumnById(this,"angleRaw",t),angleFilterValues:null!=this.properties.angleFilterKey?e.resolveColumnById(this,"angleFilterValue",t):void 0,angleFilterRawValues:null!=this.properties.angleFilterKey?e.resolveColumnById(this,"angleFilterRaw",t):void 0,radiusValues:this.properties.radiusKey?e.resolveColumnById(this,"radiusValue",t):void 0,radiusRawValues:this.properties.radiusKey?e.resolveColumnById(this,"radiusRaw",t):void 0,calloutLabelValues:this.properties.calloutLabelKey?e.resolveColumnById(this,"calloutLabelValue",t):void 0,sectorLabelValues:this.properties.sectorLabelKey?e.resolveColumnById(this,"sectorLabelValue",t):void 0,legendItemValues:this.properties.legendItemKey?e.resolveColumnById(this,"legendItemValue",t):void 0}}createNodeData(){const{id:e,processedData:t,dataModel:i,angleScale:n,ctx:{legendManager:s},visible:r}=this,{rotation:o,innerRadiusRatio:a}=this.properties;if(!i||"ungrouped"!==t?.type)return;const{angleValues:l,angleRawValues:c,angleFilterValues:h,angleFilterRawValues:u,radiusValues:d,radiusRawValues:p,calloutLabelValues:g,sectorLabelValues:f,legendItemValues:m}=this.getProcessedDataValues(i,t),y=u?.some((e,t)=>e>c[t])??!1;let v=0,b=0;const C=[],w=null!=u?[]:void 0,S=t.dataSources.get(this.id)??[],x=t.invalidData?.get(this.id);return S.forEach((t,i)=>{if(!0===x?.[i])return;const a=y?h[i]:l[i],S=null==u||y?1:Math.sqrt(u[i]/c[i]),E=n.convert(v)+oe(o);v=a,b+=a;const A=n.convert(v)+oe(o),M=Math.abs(A-E),T=E+M/2,D=c[i],I=(d?.[i]??1)*S,R=p?.[i],k=m?.[i],P=this.getLabels(t,T,M,!0,g?.[i],f?.[i],k),_=this.getSectorFormat(t,i,!1),L={itemId:i,series:this,datum:t,datumIndex:i,angleValue:D,midAngle:T,midCos:Math.cos(T),midSin:Math.sin(T),startAngle:E,endAngle:A,radius:I,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(I),0),sectorFormat:_,radiusValue:R,legendItemValue:k,enabled:r&&s.getItemEnabled({seriesId:e,itemId:i}),focusable:!0,...P};C.push(L),null!=w&&w.push({...L,radius:1,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(1),0),focusable:!1})}),this.zerosumOuterRing.visible=0===b,this.zerosumInnerRing.visible=0===b&&null!=a&&1!==a&&a>0,{itemId:e,nodeData:C,labelData:C,phantomNodeData:w}}getLabels(e,t,i,n,s,r,o){const{calloutLabel:a,sectorLabel:l,legendItemKey:c}=this.properties,h=!n||a.enabled?this.properties.calloutLabelKey:void 0,u=!n||l.enabled?this.properties.sectorLabelKey:void 0;if(!h&&!u&&!c)return{};const d={datum:e,angleKey:this.properties.angleKey,angleName:this.properties.angleName,radiusKey:this.properties.radiusKey,radiusName:this.properties.radiusName,calloutLabelKey:this.properties.calloutLabelKey,calloutLabelName:this.properties.calloutLabelName,sectorLabelKey:this.properties.sectorLabelKey,sectorLabelName:this.properties.sectorLabelName,legendItemKey:this.properties.legendItemKey},p={};return h&&i>=oe(a.minAngle)&&(p.calloutLabel={...this.getTextAlignment(t),text:this.getLabelText(a,{...d,value:s}),hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0}),u&&(p.sectorLabel={text:this.getLabelText(l,{...d,value:r})}),null!=c&&null!=o&&(p.legendItem={key:c,text:o}),p}getTextAlignment(e){const t=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"hanging"},{textAlign:"right",textBaseline:"middle"}],i=se(e)- -.75*Math.PI,s=Math.floor(i/(Math.PI/2));return t[(0,n.GT)(s,t.length)]}getNodeFill(e,t,i){return dc(e,{type:"gradient",bounds:"series",colorStops:t.map(e=>({color:e})),gradient:"radial",rotation:0,reverse:!0},{type:"pattern",pattern:"forward-slanted-lines",fill:i,fillOpacity:1,backgroundFill:"none",backgroundFillOpacity:1,stroke:i,strokeOpacity:1,strokeWidth:4,rotation:0},{type:"image",backgroundFill:i,backgroundFillOpacity:1,fit:"contain",repeat:"no-repeat",rotation:0})}getFillParams(e,t,i){if(rt(e)&&"item"!==e.bounds)return{centerX:0,centerY:0,innerRadius:t,outerRadius:i}}getSectorFormat(e,t,i){const{angleKey:n,radiusKey:s,calloutLabelKey:r,sectorLabelKey:o,legendItemKey:a,fills:l,strokes:c,defaultColorRange:h,defaultPatternFills:u,itemStyler:d}=this.properties,p=c[t%c.length],{fill:g,fillOpacity:f,stroke:m,strokeWidth:y,strokeOpacity:v,lineDash:b,lineDashOffset:C,cornerRadius:w}=L(i&&this.properties.highlightStyle.item,{fill:l.length>0?l[t%l.length]:void 0,stroke:p,strokeWidth:this.getStrokeWidth(this.properties.strokeWidth),strokeOpacity:this.getOpacity()},this.properties),S=h[t%h.length],x=u[t%u.length],E=g??"black";let A;return d&&(A=this.cachedDatumCallback(this.getDatumId(t)+(i?"-highlight":"-hide"),()=>this.callWithContext(d,{datum:e,angleKey:n,radiusKey:s,calloutLabelKey:r,sectorLabelKey:o,legendItemKey:a,fill:this.getNodeFill(E,S,x),fillOpacity:f,stroke:m,strokeWidth:y,strokeOpacity:v,lineDash:b,lineDashOffset:C,cornerRadius:w,highlighted:i,seriesId:this.id}))),{fill:this.getNodeFill(A?.fill??E,S,x),fillOpacity:A?.fillOpacity??f,stroke:A?.stroke??m,strokeWidth:A?.strokeWidth??y,strokeOpacity:A?.strokeOpacity??v,lineDash:A?.lineDash??b,lineDashOffset:A?.lineDashOffset??C,cornerRadius:A?.cornerRadius??w}}getInnerRadius(){const{radius:e}=this,{innerRadiusRatio:t=1,innerRadiusOffset:i=0}=this.properties,n=e*t+i;return n===e||n<0?0:n}getOuterRadius(){const{outerRadiusRatio:e,outerRadiusOffset:t}=this.properties;return Math.max(this.radius*e+t,0)}updateRadiusScale(e){const t=[this.getInnerRadius(),this.getOuterRadius()];this.radiusScale.range=t,e&&(this.previousRadiusScale.range=t);const i=e=>({...e,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(e.radius),0)});this.nodeData=this.nodeData.map(i),this.phantomNodeData=this.phantomNodeData?.map(i)}getTitleTranslationY(){const e=Math.max(0,this.radiusScale.range[1]);return 0===e?NaN:-e-(2+(this.properties.title?.spacing??0))-Math.max(0,-e)}update({seriesRect:e}){const{title:t}=this.properties,i={seriesRectWidth:e?.width,seriesRectHeight:e?.height},n=null!=Ft(this.nodeDataDependencies,i);if(n&&(this._nodeDataDependencies=i),this.maybeRefreshNodeData(),this.updateTitleNodes(),this.updateRadiusScale(n),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.backgroundGroup.translationX=this.centerX,this.backgroundGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),t){const e=this.getTitleTranslationY();t.node.y=isFinite(e)?e:0;const i=t.node.getBBox();t.node.visible=t.enabled&&isFinite(e)&&!this.bboxIntersectsSurroundingSeries(i)}for(const e of[this.zerosumInnerRing,this.zerosumOuterRing])e.fillOpacity=0,e.stroke=this.properties.calloutLabel.color,e.strokeWidth=1,e.strokeOpacity=1;this.updateNodeMidPoint(),this.updateSelections(),this.updateNodes(e)}updateTitleNodes(){const{oldTitle:e}=this,{title:t}=this.properties;e!==t&&(e&&this.labelGroup?.removeChild(e.node),t&&(t.node.textBaseline="bottom",this.labelGroup?.appendChild(t.node)),this.oldTitle=t)}updateNodeMidPoint(){const e=e=>{const t=e.innerRadius+(e.outerRadius-e.innerRadius)/2;e.midPoint={x:e.midCos*Math.max(0,t),y:e.midSin*Math.max(0,t)}};this.nodeData.forEach(e),this.phantomNodeData?.forEach(e)}updateSelections(){this.updateGroupSelection(),this.updateInnerCircleSelection()}updateGroupSelection(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,highlightLabelSelection:n,calloutLabelSelection:s,labelSelection:r,innerLabelsSelection:o}=this,a=this.nodeData.map(e=>({...e,sectorFormat:{...e.sectorFormat}})),l=(e,t)=>{e.update(t,void 0,e=>this.getDatumId(e.datumIndex)),this.ctx.animationManager.isSkipped()&&e.cleanup()};l(e,this.nodeData),l(t,a),l(i,this.phantomNodeData??[]),s.update(this.calloutNodeData,e=>{const t=new pa;t.tag=0,t.pointerEvents=1,e.appendChild(t);const i=new _i;i.tag=1,i.pointerEvents=1,e.appendChild(i)}),r.update(this.nodeData),n.update(a),o.update(this.properties.innerLabels,e=>{e.pointerEvents=1})}updateInnerCircleSelection(){const{innerCircle:e}=this.properties;let t=0;const i=this.getInnerRadius();if(i>0){const e=Math.min(i,this.getOuterRadius()),n=1;t=Math.ceil(2*e+n)}const n=e?[{radius:t}]:[];this.innerCircleSelection.update(n)}updateNodes(e){const t=this.ctx.highlightManager.getActiveHighlight(),{visible:i}=this;this.backgroundGroup.visible=i,this.contentGroup.visible=i,this.highlightGroup.visible=i&&t?.series===this,this.highlightLabel.visible=i&&t?.series===this,this.labelGroup.visible=i,this.contentGroup.opacity=this.getOpacity(),this.innerCircleSelection.each((e,{radius:t})=>{e.setProperties({fill:this.getNodeFill(this.properties.innerCircle?.fill,["black"],"black"),opacity:this.properties.innerCircle?.fillOpacity,size:t})});const n=this.radiusScale.range[0],s=this.radiusScale.range[1],r=this.getShapeFillBBox(),o=this.ctx.animationManager.isSkipped(),a=(e,t,i,a)=>{const l=this.getSectorFormat(t.datum,t.itemId,a);t.sectorFormat.fill=l.fill,t.sectorFormat.stroke=l.stroke,o&&(e.startAngle=t.startAngle,e.endAngle=t.endAngle,e.innerRadius=t.innerRadius,e.outerRadius=t.outerRadius),(a||o)&&(e.fill=l.fill,e.stroke=l.stroke);const c=this.getFillParams(l.fill,n,s);gc(e,l.fill,r,c),e.strokeWidth=l.strokeWidth,e.fillOpacity=l.fillOpacity,e.strokeOpacity=l.strokeOpacity,e.lineDash=l.lineDash,e.lineDashOffset=l.lineDashOffset,e.cornerRadius=l.cornerRadius,e.fillShadow=this.properties.shadow;const h=Math.max((this.properties.sectorSpacing+(null!=l.stroke?l.strokeWidth:0))/2,0);e.inset=h,e.lineJoin=this.properties.sectorSpacing>=0||h>0?"miter":"round"};this.itemSelection.each((e,t,i)=>a(e,t,0,!1)),this.highlightSelection.each((e,i,n)=>{a(e,i,0,!0),e.visible=i.itemId===t?.itemId}),this.phantomSelection.each((e,t,i)=>a(e,t,0,!1)),this.updateCalloutLineNodes(),this.updateCalloutLabelNodes(e),this.updateSectorLabelNodes(),this.updateInnerLabelNodes(),this.updateZerosumRings(),this.animationState.transition("update")}updateCalloutLineNodes(){const{calloutLine:{length:e,strokeWidth:t,colors:i},strokes:n}=this.properties,s=t,r=ot(i)?i??this.properties.strokes:n,{offset:o}=this.properties.calloutLabel;this.calloutLabelSelection.selectByTag(0).forEach(t=>{const i=t.closestDatum(),{calloutLabel:n,outerRadius:a,datumIndex:l}=i;if(n?.text&&!n.hidden&&0!==a){t.visible=!0,t.strokeWidth=s,t.stroke=r[l%r.length],t.fill=void 0;const c=i.midCos*a,h=i.midSin*a;let u=i.midCos*(a+e),d=i.midSin*(a+e);if((n.collisionTextAlign??0!==n.collisionOffsetY)&&null!=n.box){const e=n.box;let t=u,i=d;u<e.x?t=e.x:u>e.x+e.width&&(t=e.x+e.width),d<e.y?i=e.y:d>e.y+e.height&&(i=e.y+e.height);const s=t-u,r=i-d,a=Math.sqrt(Math.pow(s,2)+Math.pow(r,2)),l=a-o;l>0&&(u+=s*l/a,d+=r*l/a)}t.x1=c,t.y1=h,t.x2=u,t.y2=d}else t.visible=!1})}getLabelOverflow(e,t,i){const n=-this.centerX,s=n+i.width,r=-this.centerY,o=r+i.height;let a=1;t.x+1<n?a=(t.x+t.width-n)/t.width:t.x+t.width-1>s&&(a=(s-t.x)/t.width);const l=t.y+1<r||t.y+t.height-1>o;return{textLength:1===a?e.length:Math.floor(e.length*a)-1,hasVerticalOverflow:l,hasSurroundingSeriesOverflow:this.bboxIntersectsSurroundingSeries(t)}}bboxIntersectsSurroundingSeries(e){const{surroundingRadius:t}=this;if(null==t)return!1;const i=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],n=t**2;return i.some(e=>e.x**2+e.y**2>n)}computeCalloutLabelCollisionOffsets(){const{radiusScale:e}=this,{calloutLabel:t,calloutLine:i}=this.properties,{offset:n,minSpacing:s}=t,r=e.convert(0),o=this.calloutNodeData,a=o.filter(e=>{return!(!(t=e).calloutLabel||0===t.outerRadius);var t});if(a.forEach(e=>{const t=e.calloutLabel;null!=t&&(t.hidden=!1,t.collisionTextAlign=void 0,t.collisionOffsetY=0)}),a.length<=1)return;const l=a.filter(e=>e.midCos<0).sort((e,t)=>e.midSin-t.midSin),c=a.filter(e=>e.midCos>=0).sort((e,t)=>e.midSin-t.midSin),h=a.filter(e=>e.midSin<0&&"center"===e.calloutLabel?.textAlign).sort((e,t)=>e.midCos-t.midCos),u=a.filter(e=>e.midSin>=0&&"center"===e.calloutLabel?.textAlign).sort((e,t)=>e.midCos-t.midCos),d=e=>{const t=e.calloutLabel;if(null==t)return m.zero.clone();const s=e.outerRadius+i.length+n,r=e.midCos*s,o=e.midSin*s+t.collisionOffsetY,a=t.collisionTextAlign??t.textAlign,l=t.textBaseline;return _i.computeBBox(t.text,r,o,{font:this.properties.calloutLabel,textAlign:a,textBaseline:l})},p=(e,t,i)=>{const n=d(e).grow(s/2),r=d(t).grow(s/2);n.x<r.x+r.width&&n.x+n.width>r.x&&("to-top"===i?n.y<r.y+r.height:n.y+n.height>r.y)&&(t.calloutLabel.collisionOffsetY="to-top"===i?n.y-r.y-r.height:n.y+n.height-r.y)},g=e=>{const t=e.slice().sort((e,t)=>Math.abs(e.midSin)-Math.abs(t.midSin))[0],i=e.indexOf(t);for(let t=i-1;t>=0;t--){const i=e[t+1],n=e[t];p(i,n,"to-top")}for(let t=i+1;t<e.length;t++){const i=e[t-1],n=e[t];p(i,n,"to-bottom")}},f=e=>{const t=a.some(e=>0!==e.calloutLabel.collisionOffsetY),i=e.map(e=>d(e)),n=i.map(e=>e.clone().grow(s/2));let l=!1;for(let t=0;t<n.length&&!l;t++){const i=n[t];for(let s=t+1;s<e.length;s++){const e=n[s];if(i.collidesBBox(e)){l=!0;break}}}const c=o.map(e=>{const{startAngle:t,endAngle:i,outerRadius:n}=e;return{startAngle:t,endAngle:i,innerRadius:r,outerRadius:n}}),h=i.some(e=>c.some(t=>Um(e,t)));(l||t||h)&&e.filter(e=>"center"===e.calloutLabel.textAlign).forEach(e=>{const t=e.calloutLabel;e.midCos<0?t.collisionTextAlign="right":e.midCos>0?t.collisionTextAlign="left":t.collisionTextAlign="center"})};g(l),g(c),f(h),f(u)}updateCalloutLabelNodes(e){const{radiusScale:t}=this,{calloutLabel:i,calloutLine:n}=this.properties,s=n.length,{offset:r,color:o}=i,a=new _i;this.calloutLabelSelection.selectByTag(1).forEach(n=>{const l=n.closestDatum(),c=l.calloutLabel,h=t.convert(l.radius),u=Math.max(0,h);if(!c?.text||0===u||c.hidden)return void(n.visible=!1);const d=u+s+r,p=l.midCos*d,g=l.midSin*d+c.collisionOffsetY,f={textAlign:c.collisionTextAlign??c.textAlign,textBaseline:c.textBaseline};a.text=c.text,a.x=p,a.y=g,a.setFont(this.properties.calloutLabel),a.setAlign(f);const m=a.getBBox();let y=c.text,v=!0;if(i.avoidCollisions){const{textLength:t,hasVerticalOverflow:i}=this.getLabelOverflow(c.text,m,e);y=c.text.length===t?c.text:`${c.text.substring(0,t)}…`,v=!i}n.text=y,n.x=p,n.y=g,n.setFont(this.properties.calloutLabel),n.setAlign(f),n.fill=o,n.visible=v})}computeLabelsBBox(e,t){const{calloutLabel:i,calloutLine:n}=this.properties,s=n.length,{offset:r,maxCollisionOffset:o,minSpacing:a}=i;if(!i.avoidCollisions)return null;this.maybeRefreshNodeData(),this.updateRadiusScale(!1),this.computeCalloutLabelCollisionOffsets();const l=[],c=new _i;let h;const{title:u}=this.properties;if(u?.text&&u.enabled){const e=this.getTitleTranslationY();isFinite(e)&&(c.text=u.text,c.x=0,c.y=e,c.setFont(u),c.setAlign({textBaseline:"bottom",textAlign:"center"}),h=c.getBBox(),l.push(h))}return this.calloutNodeData.forEach(i=>{const n=i.calloutLabel;if(!n||0===i.outerRadius)return null;const u=i.outerRadius+s+r,d=i.midCos*u,p=i.midSin*u+n.collisionOffsetY;c.text=n.text,c.x=d,c.y=p,c.setFont(this.properties.calloutLabel),c.setAlign({textAlign:n.collisionTextAlign??n.textAlign,textBaseline:n.textBaseline});const g=c.getBBox();if(n.box=g,Math.abs(n.collisionOffsetY)>o)n.hidden=!0;else{if(h){const e=-this.centerY,t=new m(h.x-a,e,h.width+2*a,h.y+h.height+a-e);if(g.collidesBBox(t))return void(n.hidden=!0)}if(e.hideWhenNecessary){const{textLength:e,hasVerticalOverflow:i,hasSurroundingSeriesOverflow:s}=this.getLabelOverflow(n.text,g,t),r=n.text.length>2&&e<2;if(i||r||s)return void(n.hidden=!0)}n.hidden=!1,l.push(g)}}),0===l.length?null:m.merge(l)}updateSectorLabelNodes(){const{radiusScale:e}=this,t=e.convert(0),{fontSize:i,fontStyle:n,fontWeight:s,fontFamily:r,positionOffset:o,positionRatio:a,color:l}=this.properties.sectorLabel,c=(e,c)=>{const{sectorLabel:h,outerRadius:u}=c;let d=!1;if(h&&0!==u){const p=t*(1-a)+u*a+o;e.fill=l,e.fontStyle=n,e.fontWeight=s,e.fontSize=i,e.fontFamily=r,e.text=h.text,e.x=c.midCos*p,e.y=c.midSin*p,e.textAlign="center",e.textBaseline="middle";const g=e.getBBox(),f=[[g.x,g.y],[g.x+g.width,g.y],[g.x+g.width,g.y+g.height],[g.x,g.y+g.height]],{startAngle:m,endAngle:y}=c,v={startAngle:m,endAngle:y,innerRadius:t,outerRadius:u};f.every(([e,t])=>Vm(e,t,v))&&(d=!0)}e.visible=d};this.labelSelection.each(c),this.highlightLabelSelection.each(c)}updateInnerLabelNodes(){const e=[],t=[];this.innerLabelsSelection.each((i,n)=>{const{fontStyle:s,fontWeight:r,fontSize:o,fontFamily:a,color:l}=n;i.fontStyle=s,i.fontWeight=r,i.fontSize=o,i.fontFamily=a,i.text=n.text,i.x=0,i.y=0,i.fill=l,i.textAlign="center",i.textBaseline="alphabetic",e.push(i.getBBox()),t.push(n.spacing)});const i=e=>0===e?0:t[e],n=e=>e===t.length-1?0:t[e],s=e.reduce((e,t,s)=>e+t.height+i(s)+n(s),0),r=Math.max(...e.map(e=>e.width)),o=this.getInnerRadius(),a=Math.sqrt(Math.pow(r/2,2)+Math.pow(s/2,2))<=(o>0?o:this.getOuterRadius()),l=[];for(let t=0,r=-s/2;t<e.length;t++){const s=e[t].height+r+i(t);l.push(s),r=s+n(t)}this.innerLabelsSelection.each((e,t,i)=>{e.y=l[i],e.visible=a})}updateZerosumRings(){this.zerosumOuterRing.size=2*this.getOuterRadius(),this.zerosumInnerRing.size=2*this.getInnerRadius()}pickNodeClosestDatum(e){return ay(this,e)}getTooltipContent(e){const{id:t,dataModel:i,processedData:n,properties:s}=this,{legendItemKey:r,calloutLabelKey:o,calloutLabelName:a,sectorLabelKey:l,sectorLabelName:c,angleKey:h,angleName:u,radiusKey:d,radiusName:p,tooltip:g}=s,f=this.properties.title.text;if(!i||!n)return;const m=n.dataSources.get(this.id)?.[e],{angleRawValues:y,legendItemValues:v,calloutLabelValues:b,sectorLabelValues:C}=this.getProcessedDataValues(i,n),w=y[e],S=v?.[e]??(o===h?void 0:b?.[e])??(l===h?void 0:C?.[e])??u;return this.formatTooltipWithContext(g,{title:f,symbol:this.legendItemSymbol(e),data:[{label:S,fallbackLabel:h,value:Gn(w,3)}]},{seriesId:t,datum:m,title:u,legendItemKey:r,calloutLabelKey:o,calloutLabelName:a,sectorLabelKey:l,sectorLabelName:c,angleKey:h,angleName:u,radiusKey:d,radiusName:p,...this.getSectorFormat(m,e,!1)})}legendItemSymbol(e){const t=this.processedData?.dataSources.get(this.id)?.[e],i=this.getSectorFormat(t,e,!1),{fillOpacity:n,strokeOpacity:s,strokeWidth:r,lineDash:o,lineDashOffset:a}=this.properties;let{fill:l}=i;const{stroke:c}=i;return rt(l)&&(l={...l,gradient:"linear",rotation:0,reverse:!1}),{marker:{fill:l,stroke:c,fillOpacity:n,strokeOpacity:s,strokeWidth:r,lineDash:o,lineDashOffset:a}}}getLegendData(e){const{visible:t,processedData:i,dataModel:n,id:s,ctx:{legendManager:r}}=this;if(!n||!i||"category"!==e)return[];const{angleKey:o,calloutLabelKey:a,sectorLabelKey:l,legendItemKey:c,showInLegend:h}=this.properties;if(!(c||a&&a!==o||l&&l!==o))return[];const{angleRawValues:u,calloutLabelValues:d,sectorLabelValues:p,legendItemValues:g}=this.getProcessedDataValues(n,i),f=this.properties.title?.showInLegend&&this.properties.title.text,m=[],y=this.properties.hideZeroValueSectorsInLegend,v=i.dataSources.get(this.id),b=i.invalidData?.get(this.id);for(let e=0;e<i.input.count;e++){const i=v?.[e],n=u[e];if(!0===b?.[e]||y&&0===n)continue;const C=[];f&&C.push(f);const w=this.getLabels(i,2*Math.PI,2*Math.PI,!1,d?.[e],p?.[e],g?.[e]);c&&void 0!==w.legendItem?C.push(w.legendItem.text):a&&a!==o&&void 0!==w.calloutLabel?.text?C.push(w.calloutLabel?.text):l&&l!==o&&void 0!==w.sectorLabel?.text&&C.push(w.sectorLabel?.text),0!==C.length&&m.push({legendType:"category",id:s,datum:i,itemId:e,seriesId:s,hideToggleOtherSeries:!0,enabled:t&&r.getItemEnabled({seriesId:s,itemId:e}),label:{text:C.join(" - ")},symbol:this.legendItemSymbol(e),legendItemName:null!=c?i[c]:void 0,hideInLegend:!h})}return m}setLegendState(e){const{id:t,ctx:{legendManager:i,updateService:n}}=this;e.forEach((e,n)=>i.toggleItem(e,t,n)),i.update(),n.update(5)}animateEmptyUpdateReady(e){const{animationManager:t}=this.ctx,i=ry(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);aa(this.id,"nodes",t,[this.itemSelection,this.highlightSelection,this.phantomSelection],i.nodes,(e,t)=>this.getDatumId(t.datumIndex)),aa(this.id,"innerCircle",t,[this.innerCircleSelection],i.innerCircle),vp(this,"callout",t,this.calloutLabelSelection),vp(this,"sector",t,this.labelSelection),vp(this,"highlight",t,this.highlightLabelSelection),vp(this,"inner",t,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,processedData:n,radiusScale:s,previousRadiusScale:r}=this,{animationManager:o}=this.ctx,a=n?.reduced?.diff?.[this.id];this.ctx.animationManager.stopByAnimationGroupId(this.id);const l=0===(a?.moved.size??0),c=(n?.defs.keys.length??0)>0;l&&c&&(n?.reduced?.animationValidation?.uniqueKeys??1)||this.ctx.animationManager.skipCurrentBatch();const h=!this.nodeData.some(e=>e.enabled),u=ry(!1,this.properties.rotation,s,r);aa(this.id,"nodes",o,[e,t,i],u.nodes,(e,t)=>this.getDatumId(t.datumIndex),a),aa(this.id,"innerCircle",o,[this.innerCircleSelection],u.innerCircle),vp(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),vp(this,"sector",this.ctx.animationManager,this.labelSelection),vp(this,"highlight",this.ctx.animationManager,this.highlightLabelSelection),this.noVisibleData!==h&&(this.noVisibleData=h,vp(this,"inner",this.ctx.animationManager,this.innerLabelsSelection)),this.previousRadiusScale.range=this.radiusScale.range}animateClearingUpdateEmpty(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,radiusScale:n,previousRadiusScale:s}=this,{animationManager:r}=this.ctx,o=ry(!1,this.properties.rotation,n,s);aa(this.id,"nodes",r,[e,t,i],o.nodes,(e,t)=>this.getDatumId(t.datumIndex)),aa(this.id,"innerCircle",r,[this.innerCircleSelection],o.innerCircle),bp(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),bp(this,"sector",this.ctx.animationManager,this.labelSelection),bp(this,"highlight",this.ctx.animationManager,this.highlightLabelSelection),bp(this,"inner",this.ctx.animationManager,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}getDatumId(e){return`${e}`}};uy.className="DonutSeries",uy.type="donut";var dy={radiusMin:n.Ly,radiusMax:n.Ly,rotation:n.ai,outerRadiusOffset:n.ai,outerRadiusRatio:n.CG,hideZeroValueSectorsInLegend:n.zM,sectorSpacing:n.Ly,cornerRadius:n.Ly,itemStyler:(0,n.YI)({...n.Fu,...n.AF,...n.mL,cornerRadius:n.Ly}),title:{enabled:n.zM,text:n.Yj,showInLegend:n.zM,spacing:n.Ly,...n.LV},calloutLabel:{enabled:n.zM,offset:n.ai,minAngle:n.Ly,avoidCollisions:n.zM,formatter:n.E2,...n.LV},sectorLabel:{enabled:n.zM,positionOffset:n.ai,positionRatio:n.CG,formatter:n.E2,...n.LV},calloutLine:{colors:(0,n.jk)(n.yW),length:n.Ly,strokeWidth:n.Ly},fills:(0,n.jk)(n.Jp),strokes:(0,n.jk)(n.yW),tooltip:Lf,shadow:Nf,...Tf,...n.mL,...G(n.Fu,["fill"]),...G(n.AF,["stroke"])},py={...dy,...Df,type:(0,n.mw)((0,n.dY)("pie")),angleKey:(0,n.mw)(n.Yj),radiusKey:n.Yj,calloutLabelKey:n.Yj,sectorLabelKey:n.Yj,legendItemKey:n.Yj,angleName:n.Yj,radiusName:n.Yj,calloutLabelName:n.Yj,sectorLabelName:n.Yj};py.defaultColorRange=(0,n._L)((0,n.jk)((0,n.jk)(n.yW))),py.defaultPatternFills=(0,n._L)((0,n.jk)(n.yW)),py.title._enabledFromTheme=(0,n._L)(n.zM),py.calloutLabel._enabledFromTheme=(0,n._L)(n.zM),py.sectorLabel._enabledFromTheme=(0,n._L)(n.zM);var gy={...dy,innerRadiusOffset:n.ai,innerRadiusRatio:n.CG,innerCircle:{fill:n.Yj,fillOpacity:n.CG},innerLabels:{spacing:n.Ly,...n.LV}},fy={...gy,...py,type:(0,n.mw)((0,n.dY)("donut")),innerLabels:(0,n.J$)({text:(0,n.mw)(n.Yj),spacing:n.Ly,...n.LV},"inner label options array")},my={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["polar"],identifier:"donut",moduleFactory:e=>new uy(e),tooltipDefaults:{range:"exact"},themeTemplate:{series:{title:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.1666666666666667]},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},spacing:5},calloutLabel:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},offset:3,minAngle:.001},sectorLabel:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"backgroundColor"},positionOffset:0,positionRatio:.5},calloutLine:{length:10,strokeWidth:2,colors:{$map:[{$if:[{$or:[{$isGradient:[{$value:"$1"}]},{$isPattern:[{$value:"$1"}]},{$isImage:[{$value:"$1"}]}]},{$path:["../../strokes/$index",{$ref:"foregroundColor"}]},{$value:"$1"}]},{$if:[{$eq:[{$path:"../strokeWidth"},0]},{$path:"../fills"},{$path:"../strokes"}]}]}},fills:{$palette:"fills"},strokes:{$palette:"strokes"},defaultColorRange:{$palette:"gradients"},defaultPatternFills:up,fillOpacity:1,strokeOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,rotation:0,sectorSpacing:1,innerRadiusRatio:{$if:[{$eq:[{$path:["./innerRadiusOffset",void 0]},void 0]},.7,void 0]},shadow:{enabled:!1,color:Rd,xOffset:3,yOffset:3,blur:5},innerLabels:{fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:2}},legend:{enabled:!0}}},yy={type:"series",name:"donut",chartType:"polar",options:fy,create:e=>new uy(e)},vy=class extends Fi{constructor(){super(...arguments),this.showInLegend=!1}};a([Te],vy.prototype,"showInLegend",2);var by=class extends pl{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}};a([Te],by.prototype,"offset",2),a([Te],by.prototype,"minAngle",2),a([Te],by.prototype,"minSpacing",2),a([Te],by.prototype,"maxCollisionOffset",2),a([Te],by.prototype,"avoidCollisions",2);var Cy=class extends pl{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}};a([Te],Cy.prototype,"positionOffset",2),a([Te],Cy.prototype,"positionRatio",2);var wy=class extends De{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}};a([Te],wy.prototype,"colors",2),a([Te],wy.prototype,"length",2),a([Te],wy.prototype,"strokeWidth",2);var Sy=class extends kp{constructor(){super(...arguments),this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=Object.values(Xm),this.strokes=Object.values(Zm),this.fillOpacity=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.outerRadiusOffset=0,this.outerRadiusRatio=1,this.strokeWidth=1,this.sectorSpacing=0,this.hideZeroValueSectorsInLegend=!1,this.title=new vy,this.shadow=new Sp,this.calloutLabel=new by,this.sectorLabel=new Cy,this.calloutLine=new wy,this.tooltip=new Lp}};a([Te],Sy.prototype,"angleKey",2),a([Te],Sy.prototype,"angleName",2),a([Te],Sy.prototype,"angleFilterKey",2),a([Te],Sy.prototype,"radiusKey",2),a([Te],Sy.prototype,"radiusName",2),a([Te],Sy.prototype,"radiusMin",2),a([Te],Sy.prototype,"radiusMax",2),a([Te],Sy.prototype,"calloutLabelKey",2),a([Te],Sy.prototype,"calloutLabelName",2),a([Te],Sy.prototype,"sectorLabelKey",2),a([Te],Sy.prototype,"sectorLabelName",2),a([Te],Sy.prototype,"legendItemKey",2),a([Te],Sy.prototype,"defaultColorRange",2),a([Te],Sy.prototype,"defaultPatternFills",2),a([Te],Sy.prototype,"fills",2),a([Te],Sy.prototype,"strokes",2),a([Te],Sy.prototype,"fillOpacity",2),a([Te],Sy.prototype,"strokeOpacity",2),a([Te],Sy.prototype,"lineDash",2),a([Te],Sy.prototype,"lineDashOffset",2),a([Te],Sy.prototype,"cornerRadius",2),a([Te],Sy.prototype,"itemStyler",2),a([Te],Sy.prototype,"rotation",2),a([Te],Sy.prototype,"outerRadiusOffset",2),a([Te],Sy.prototype,"outerRadiusRatio",2),a([Te],Sy.prototype,"strokeWidth",2),a([Te],Sy.prototype,"sectorSpacing",2),a([Te],Sy.prototype,"hideZeroValueSectorsInLegend",2),a([Te],Sy.prototype,"title",2),a([Te],Sy.prototype,"shadow",2),a([Te],Sy.prototype,"calloutLabel",2),a([Te],Sy.prototype,"sectorLabel",2),a([Te],Sy.prototype,"calloutLine",2),a([Te],Sy.prototype,"tooltip",2);var xy=class extends yc{constructor(e,t,i,n){super(e,t,i,n),this.angleKey=n.properties.angleKey,this.radiusKey=n.properties.radiusKey,this.calloutLabelKey=n.properties.calloutLabelKey,this.sectorLabelKey=n.properties.sectorLabelKey}},Ey=class extends cy{constructor(e){super({moduleCtx:e,categoryKey:void 0,pickModes:[1,0],useLabelLayer:!0,animationResetFns:{item:oy,label:Cp}}),this.properties=new Sy,this.phantomNodeData=void 0,this.backgroundGroup=new It({name:`${this.id}-background`,zIndex:0}),this.previousRadiusScale=new Vu,this.radiusScale=new Vu,this.phantomGroup=this.backgroundGroup.appendChild(new Mt({name:"phantom"})),this.phantomSelection=da.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.calloutLabelGroup=this.contentGroup.appendChild(new Mt({name:"pieCalloutLabels"})),this.calloutLabelSelection=new da(this.calloutLabelGroup,Mt),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new Mt({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new Nc({shape:"circle"})),this.surroundingRadius=void 0,this.NodeEvent=xy,this.angleScale=new Vu,this.angleScale.domain=[0,1],this.angleScale.range=[-Math.PI,Math.PI].map(e=>e+Math.PI/2),this.phantomGroup.opacity=.2}get calloutNodeData(){return this.phantomNodeData??this.nodeData}attachSeries(e,t,i){super.attachSeries(e,t,i),e.appendChild(this.backgroundGroup)}detachSeries(e,t,i){super.detachSeries(e,t,i),e?.removeChild(this.backgroundGroup)}setSeriesIndex(e){return!!super.setSeriesIndex(e)&&(this.backgroundGroup.zIndex=[0,e],!0)}nodeFactory(){const e=new qm;return e.miterLimit=1e9,e}getSeriesDomain(e){return"angle"===e?this.angleScale.domain:this.radiusScale.domain}async processData(e){if(null==this.data)return;const{visible:t,id:i,ctx:{legendManager:s}}=this,{angleKey:r,angleFilterKey:o,radiusKey:a,calloutLabelKey:l,sectorLabelKey:c,legendItemKey:h}=this.properties,u=()=>(e,n)=>t&&s.getItemEnabled({seriesId:i,itemId:n})?e:0,d=!this.ctx.animationManager.isSkipped(),p=[],g=[];h?p.push(jh(h,"band",{id:"legendItemKey"})):l?p.push(jh(l,"band",{id:"calloutLabelKey"})):c&&p.push(jh(c,"band",{id:"sectorLabelKey"}));const f=this.radiusScale.type,m=this.angleScale.type;a&&g.push(Xh(a,{id:"radiusValue",min:this.properties.radiusMin??0,max:this.properties.radiusMax,missingValue:this.properties.radiusMax??1,processor:u}),$h(a,f,{id:"radiusRaw",processor:u}),au("radiusValue",[0,1],1,this.properties.radiusMin??0,this.properties.radiusMax)),l&&g.push($h(l,"band",{id:"calloutLabelValue"})),c&&g.push($h(c,"band",{id:"sectorLabelValue"})),h&&g.push($h(h,"band",{id:"legendItemValue"})),o&&g.push(Zh(o,m,{id:"angleFilterValue",onlyPositive:!0,invalidValue:0,processor:u}),$h(o,m,{id:"angleFilterRaw"}),au("angleFilterValue",[0,1],0,0)),d&&this.processedData?.reduced?.animationValidation?.uniqueKeys&&p.length>0&&g.push(yu(this.id,this.processedData)),g.push(cu()),await this.requestDataModel(e,this.data,{props:[...p,Zh(r,m,{id:"angleValue",onlyPositive:!0,invalidValue:0,processor:u}),$h(r,m,{id:"angleRaw"}),au("angleValue",[0,1],0,0),...g]});for(const e of this.processedData?.defs?.values??[]){const{id:t,missing:i,property:s}=e,r=Oo(this,i);"angleRaw"!==t&&r>0&&n.Vy.warnOnce(`no value was found for the key '${String(s)}' on ${r} data element${r>1?"s":""}`)}this.animationState.transition("updateData")}maybeRefreshNodeData(){if(!this.nodeDataRefresh)return;const{nodeData:e=[],phantomNodeData:t}=this.createNodeData()??{};this.nodeData=e,this.phantomNodeData=t,this.nodeDataRefresh=!1}getProcessedDataValues(e,t){return{angleValues:e.resolveColumnById(this,"angleValue",t),angleRawValues:e.resolveColumnById(this,"angleRaw",t),angleFilterValues:null!=this.properties.angleFilterKey?e.resolveColumnById(this,"angleFilterValue",t):void 0,angleFilterRawValues:null!=this.properties.angleFilterKey?e.resolveColumnById(this,"angleFilterRaw",t):void 0,radiusValues:this.properties.radiusKey?e.resolveColumnById(this,"radiusValue",t):void 0,radiusRawValues:this.properties.radiusKey?e.resolveColumnById(this,"radiusRaw",t):void 0,calloutLabelValues:this.properties.calloutLabelKey?e.resolveColumnById(this,"calloutLabelValue",t):void 0,sectorLabelValues:this.properties.sectorLabelKey?e.resolveColumnById(this,"sectorLabelValue",t):void 0,legendItemValues:this.properties.legendItemKey?e.resolveColumnById(this,"legendItemValue",t):void 0}}createNodeData(){const{id:e,processedData:t,dataModel:i,angleScale:n,ctx:{legendManager:s},visible:r}=this,{rotation:o}=this.properties;if(!i||"ungrouped"!==t?.type)return;const{angleValues:a,angleRawValues:l,angleFilterValues:c,angleFilterRawValues:h,radiusValues:u,radiusRawValues:d,calloutLabelValues:p,sectorLabelValues:g,legendItemValues:f}=this.getProcessedDataValues(i,t),m=h?.some((e,t)=>e>l[t])??!1;let y=0,v=0;const b=[],C=null!=h?[]:void 0,w=t.dataSources.get(this.id)??[],S=t.invalidData?.get(this.id);return w.forEach((t,i)=>{if(!0===S?.[i])return;const w=m?c[i]:a[i],x=null==h||m?1:Math.sqrt(h[i]/l[i]),E=n.convert(y)+oe(o);y=w,v+=w;const A=n.convert(y)+oe(o),M=Math.abs(A-E),T=E+M/2,D=l[i],I=(u?.[i]??1)*x,R=d?.[i],k=f?.[i],P=this.getLabels(t,T,M,!0,p?.[i],g?.[i],k),_=this.getSectorFormat(t,i,!1),L={itemId:i,series:this,datum:t,datumIndex:i,angleValue:D,midAngle:T,midCos:Math.cos(T),midSin:Math.sin(T),startAngle:E,endAngle:A,radius:I,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(I),0),sectorFormat:_,radiusValue:R,legendItemValue:k,enabled:r&&s.getItemEnabled({seriesId:e,itemId:i}),...P};b.push(L),null!=C&&C.push({...L,radius:1,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(1),0)})}),this.zerosumOuterRing.visible=0===v,{itemId:e,nodeData:b,labelData:b,phantomNodeData:C}}getLabels(e,t,i,n,s,r,o){const{calloutLabel:a,sectorLabel:l,legendItemKey:c}=this.properties,h=!n||a.enabled?this.properties.calloutLabelKey:void 0,u=!n||l.enabled?this.properties.sectorLabelKey:void 0;if(!h&&!u&&!c)return{};const d={datum:e,angleKey:this.properties.angleKey,angleName:this.properties.angleName,radiusKey:this.properties.radiusKey,radiusName:this.properties.radiusName,calloutLabelKey:this.properties.calloutLabelKey,calloutLabelName:this.properties.calloutLabelName,sectorLabelKey:this.properties.sectorLabelKey,sectorLabelName:this.properties.sectorLabelName,legendItemKey:this.properties.legendItemKey},p={};return h&&i>=oe(a.minAngle)&&(p.calloutLabel={...this.getTextAlignment(t),text:this.getLabelText(a,{...d,value:s}),hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0}),u&&(p.sectorLabel={text:this.getLabelText(l,{...d,value:r})}),null!=c&&null!=o&&(p.legendItem={key:c,text:o}),p}getTextAlignment(e){const t=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"hanging"},{textAlign:"right",textBaseline:"middle"}],i=se(e)- -.75*Math.PI,s=Math.floor(i/(Math.PI/2));return t[(0,n.GT)(s,t.length)]}getNodeFill(e,t,i){return dc(e,{type:"gradient",bounds:"series",colorStops:t.map(e=>({color:e})),gradient:"radial",rotation:0,reverse:!0},{type:"pattern",pattern:"forward-slanted-lines",fill:i,fillOpacity:1,backgroundFill:"none",backgroundFillOpacity:1,stroke:i,strokeOpacity:1,strokeWidth:4,rotation:0},{type:"image",backgroundFill:i,backgroundFillOpacity:1,fit:"contain",repeat:"no-repeat",rotation:0})}getFillParams(e,t,i){if(rt(e)&&"item"!==e.bounds)return{centerX:0,centerY:0,innerRadius:t,outerRadius:i}}getSectorFormat(e,t,i){const{angleKey:n,radiusKey:s,calloutLabelKey:r,sectorLabelKey:o,legendItemKey:a,fills:l,strokes:c,defaultColorRange:h,defaultPatternFills:u,itemStyler:d}=this.properties,p=c[t%c.length],{fill:g,fillOpacity:f,stroke:m,strokeWidth:y,strokeOpacity:v,lineDash:b,lineDashOffset:C,cornerRadius:w}=L(i&&this.properties.highlightStyle.item,{fill:l.length>0?l[t%l.length]:void 0,stroke:p,strokeWidth:this.getStrokeWidth(this.properties.strokeWidth),strokeOpacity:this.getOpacity()},this.properties),S=h[t%h.length],x=u[t%u.length],E=g??"black";let A;return d&&(A=this.cachedDatumCallback(this.getDatumId(t)+(i?"-highlight":"-hide"),()=>this.callWithContext(d,{datum:e,angleKey:n,radiusKey:s,calloutLabelKey:r,sectorLabelKey:o,legendItemKey:a,fill:this.getNodeFill(E,S,x),strokeOpacity:v,stroke:m,strokeWidth:y,fillOpacity:f,lineDash:b,lineDashOffset:C,cornerRadius:w,highlighted:i,seriesId:this.id}))),{fill:this.getNodeFill(A?.fill??E,S,x),fillOpacity:A?.fillOpacity??f,stroke:A?.stroke??m,strokeWidth:A?.strokeWidth??y,strokeOpacity:A?.strokeOpacity??v,lineDash:A?.lineDash??b,lineDashOffset:A?.lineDashOffset??C,cornerRadius:A?.cornerRadius??w}}getOuterRadius(){return Math.max(this.radius*this.properties.outerRadiusRatio+this.properties.outerRadiusOffset,0)}updateRadiusScale(e){const t=[0,this.getOuterRadius()];this.radiusScale.range=t,e&&(this.previousRadiusScale.range=t);const i=e=>({...e,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(e.radius),0)});this.nodeData=this.nodeData.map(i),this.phantomNodeData=this.phantomNodeData?.map(i)}getTitleTranslationY(){const e=Math.max(0,this.radiusScale.range[1]);return 0===e?NaN:-e-(2+(this.properties.title?.spacing??0))-Math.max(0,-e)}update({seriesRect:e}){const{title:t}=this.properties,i={seriesRectWidth:e?.width,seriesRectHeight:e?.height},n=null!=Ft(this.nodeDataDependencies,i);if(n&&(this._nodeDataDependencies=i),this.maybeRefreshNodeData(),this.updateTitleNodes(),this.updateRadiusScale(n),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.backgroundGroup.translationX=this.centerX,this.backgroundGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),t){const e=this.getTitleTranslationY();t.node.y=isFinite(e)?e:0;const i=t.node.getBBox();t.node.visible=t.enabled&&isFinite(e)&&!this.bboxIntersectsSurroundingSeries(i)}this.zerosumOuterRing.fillOpacity=0,this.zerosumOuterRing.stroke=this.properties.calloutLabel.color,this.zerosumOuterRing.strokeWidth=1,this.zerosumOuterRing.strokeOpacity=1,this.updateNodeMidPoint(),this.updateSelections(),this.updateNodes(e)}updateTitleNodes(){const{oldTitle:e}=this,{title:t}=this.properties;e!==t&&(e&&this.labelGroup?.removeChild(e.node),t&&(t.node.textBaseline="bottom",this.labelGroup?.appendChild(t.node)),this.oldTitle=t)}updateNodeMidPoint(){const e=e=>{const t=e.innerRadius+(e.outerRadius-e.innerRadius)/2;e.midPoint={x:e.midCos*Math.max(0,t),y:e.midSin*Math.max(0,t)}};this.nodeData.forEach(e),this.phantomNodeData?.forEach(e)}updateSelections(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,highlightLabelSelection:n,calloutLabelSelection:s,labelSelection:r}=this,o=this.nodeData.map(e=>({...e,sectorFormat:{...e.sectorFormat}})),a=(e,t)=>{e.update(t,void 0,e=>this.getDatumId(e.datumIndex)),this.ctx.animationManager.isSkipped()&&e.cleanup()};a(e,this.nodeData),a(t,o),a(i,this.phantomNodeData??[]),s.update(this.calloutNodeData,e=>{const t=new pa;t.tag=0,t.pointerEvents=1,e.appendChild(t);const i=new _i;i.tag=1,i.pointerEvents=1,e.appendChild(i)}),r.update(this.nodeData),n.update(o)}updateNodes(e){const t=this.ctx.highlightManager.getActiveHighlight(),{visible:i}=this;this.backgroundGroup.visible=i,this.contentGroup.visible=i,this.highlightGroup.visible=i&&t?.series===this,this.highlightLabel.visible=i&&t?.series===this,this.labelGroup&&(this.labelGroup.visible=i),this.contentGroup.opacity=this.getOpacity();const n=this.radiusScale.range[0],s=this.radiusScale.range[1],r=this.getShapeFillBBox(),o=this.ctx.animationManager.isSkipped(),a=(e,t,i,a)=>{const l=this.getSectorFormat(t.datum,t.itemId,a);t.sectorFormat.fill=l.fill,t.sectorFormat.stroke=l.stroke,o&&(e.startAngle=t.startAngle,e.endAngle=t.endAngle,e.innerRadius=t.innerRadius,e.outerRadius=t.outerRadius),(a||o)&&(e.fill=l.fill,e.stroke=l.stroke);const c=this.getFillParams(l.fill,n,s);gc(e,l.fill,r,c),e.strokeWidth=l.strokeWidth,e.fillOpacity=l.fillOpacity,e.strokeOpacity=l.strokeOpacity,e.lineDash=l.lineDash,e.lineDashOffset=l.lineDashOffset,e.cornerRadius=l.cornerRadius,e.fillShadow=this.properties.shadow;const h=Math.max((this.properties.sectorSpacing+(null!=l.stroke?l.strokeWidth:0))/2,0);e.inset=h,e.lineJoin=this.properties.sectorSpacing>=0||h>0?"miter":"round"};this.itemSelection.each((e,t,i)=>a(e,t,0,!1)),this.highlightSelection.each((e,i,n)=>{a(e,i,0,!0),e.visible=i.itemId===t?.itemId}),this.phantomSelection.each((e,t,i)=>a(e,t,0,!1)),this.updateCalloutLineNodes(),this.updateCalloutLabelNodes(e),this.updateSectorLabelNodes(),this.updateZerosumRings(),this.animationState.transition("update")}updateCalloutLineNodes(){const{calloutLine:{length:e,strokeWidth:t,colors:i},strokes:n}=this.properties,s=t,r=ot(i)?i:n,{offset:o}=this.properties.calloutLabel;this.calloutLabelSelection.selectByTag(0).forEach(t=>{const i=t.closestDatum(),{calloutLabel:n,outerRadius:a,datumIndex:l}=i;if(n?.text&&!n.hidden&&0!==a){t.visible=!0,t.strokeWidth=s,t.stroke=r[l%r.length],t.fill=void 0;const c=i.midCos*a,h=i.midSin*a;let u=i.midCos*(a+e),d=i.midSin*(a+e);if((n.collisionTextAlign??0!==n.collisionOffsetY)&&null!=n.box){const e=n.box;let t=u,i=d;u<e.x?t=e.x:u>e.x+e.width&&(t=e.x+e.width),d<e.y?i=e.y:d>e.y+e.height&&(i=e.y+e.height);const s=t-u,r=i-d,a=Math.sqrt(Math.pow(s,2)+Math.pow(r,2)),l=a-o;l>0&&(u+=s*l/a,d+=r*l/a)}t.x1=c,t.y1=h,t.x2=u,t.y2=d}else t.visible=!1})}getLabelOverflow(e,t,i){const n=-this.centerX,s=n+i.width,r=-this.centerY,o=r+i.height;let a=1;t.x+1<n?a=(t.x+t.width-n)/t.width:t.x+t.width-1>s&&(a=(s-t.x)/t.width);const l=t.y+1<r||t.y+t.height-1>o;return{textLength:1===a?e.length:Math.floor(e.length*a)-1,hasVerticalOverflow:l,hasSurroundingSeriesOverflow:this.bboxIntersectsSurroundingSeries(t)}}bboxIntersectsSurroundingSeries(e){const{surroundingRadius:t}=this;if(null==t)return!1;const i=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],n=t**2;return i.some(e=>e.x**2+e.y**2>n)}computeCalloutLabelCollisionOffsets(){const{radiusScale:e}=this,{calloutLabel:t,calloutLine:i}=this.properties,{offset:n,minSpacing:s}=t,r=e.convert(0),o=this.calloutNodeData,a=o.filter(e=>{return!(!(t=e).calloutLabel||0===t.outerRadius);var t});if(a.forEach(e=>{const t=e.calloutLabel;null!=t&&(t.hidden=!1,t.collisionTextAlign=void 0,t.collisionOffsetY=0)}),a.length<=1)return;const l=a.filter(e=>e.midCos<0).sort((e,t)=>e.midSin-t.midSin),c=a.filter(e=>e.midCos>=0).sort((e,t)=>e.midSin-t.midSin),h=a.filter(e=>e.midSin<0&&"center"===e.calloutLabel?.textAlign).sort((e,t)=>e.midCos-t.midCos),u=a.filter(e=>e.midSin>=0&&"center"===e.calloutLabel?.textAlign).sort((e,t)=>e.midCos-t.midCos),d=e=>{const t=e.calloutLabel;if(null==t)return m.zero.clone();const s=e.outerRadius+i.length+n,r=e.midCos*s,o=e.midSin*s+t.collisionOffsetY,a=t.collisionTextAlign??t.textAlign,l=t.textBaseline;return _i.computeBBox(t.text,r,o,{font:this.properties.calloutLabel,textAlign:a,textBaseline:l})},p=(e,t,i)=>{const n=d(e).grow(s/2),r=d(t).grow(s/2);n.x<r.x+r.width&&n.x+n.width>r.x&&("to-top"===i?n.y<r.y+r.height:n.y+n.height>r.y)&&(t.calloutLabel.collisionOffsetY="to-top"===i?n.y-r.y-r.height:n.y+n.height-r.y)},g=e=>{const t=e.slice().sort((e,t)=>Math.abs(e.midSin)-Math.abs(t.midSin))[0],i=e.indexOf(t);for(let t=i-1;t>=0;t--){const i=e[t+1],n=e[t];p(i,n,"to-top")}for(let t=i+1;t<e.length;t++){const i=e[t-1],n=e[t];p(i,n,"to-bottom")}},f=e=>{const t=a.some(e=>0!==e.calloutLabel.collisionOffsetY),i=e.map(e=>d(e)),n=i.map(e=>e.clone().grow(s/2));let l=!1;for(let t=0;t<n.length&&!l;t++){const i=n[t];for(let s=t+1;s<e.length;s++){const e=n[s];if(i.collidesBBox(e)){l=!0;break}}}const c=o.map(e=>{const{startAngle:t,endAngle:i,outerRadius:n}=e;return{startAngle:t,endAngle:i,innerRadius:r,outerRadius:n}}),h=i.some(e=>c.some(t=>Um(e,t)));(l||t||h)&&e.filter(e=>"center"===e.calloutLabel.textAlign).forEach(e=>{const t=e.calloutLabel;e.midCos<0?t.collisionTextAlign="right":e.midCos>0?t.collisionTextAlign="left":t.collisionTextAlign="center"})};g(l),g(c),f(h),f(u)}updateCalloutLabelNodes(e){const{radiusScale:t}=this,{calloutLabel:i,calloutLine:n}=this.properties,s=n.length,{offset:r,color:o}=i,a=new _i;this.calloutLabelSelection.selectByTag(1).forEach(n=>{const l=n.closestDatum(),c=l.calloutLabel,h=t.convert(l.radius),u=Math.max(0,h);if(!c?.text||0===u||c.hidden)return void(n.visible=!1);const d=u+s+r,p=l.midCos*d,g=l.midSin*d+c.collisionOffsetY,f={textAlign:c.collisionTextAlign??c.textAlign,textBaseline:c.textBaseline};a.text=c.text,a.x=p,a.y=g,a.setFont(this.properties.calloutLabel),a.setAlign(f);const m=a.getBBox();let y=c.text,v=!0;if(i.avoidCollisions){const{textLength:t,hasVerticalOverflow:i}=this.getLabelOverflow(c.text,m,e);y=c.text.length===t?c.text:`${c.text.substring(0,t)}…`,v=!i}n.text=y,n.x=p,n.y=g,n.setFont(this.properties.calloutLabel),n.setAlign(f),n.fill=o,n.visible=v})}computeLabelsBBox(e,t){const{calloutLabel:i,calloutLine:n}=this.properties,s=n.length,{offset:r,maxCollisionOffset:o,minSpacing:a}=i;if(!i.avoidCollisions)return null;this.maybeRefreshNodeData(),this.updateRadiusScale(!1),this.computeCalloutLabelCollisionOffsets();const l=[],c=new _i;let h;const{title:u}=this.properties;if(u?.text&&u.enabled){const e=this.getTitleTranslationY();isFinite(e)&&(c.text=u.text,c.x=0,c.y=e,c.setFont(u),c.setAlign({textBaseline:"bottom",textAlign:"center"}),h=c.getBBox(),l.push(h))}return this.calloutNodeData.forEach(i=>{const n=i.calloutLabel;if(!n||0===i.outerRadius)return null;const u=i.outerRadius+s+r,d=i.midCos*u,p=i.midSin*u+n.collisionOffsetY;c.text=n.text,c.x=d,c.y=p,c.setFont(this.properties.calloutLabel),c.setAlign({textAlign:n.collisionTextAlign??n.textAlign,textBaseline:n.textBaseline});const g=c.getBBox();if(n.box=g,Math.abs(n.collisionOffsetY)>o)n.hidden=!0;else{if(h){const e=-this.centerY,t=new m(h.x-a,e,h.width+2*a,h.y+h.height+a-e);if(g.collidesBBox(t))return void(n.hidden=!0)}if(e.hideWhenNecessary){const{textLength:e,hasVerticalOverflow:i,hasSurroundingSeriesOverflow:s}=this.getLabelOverflow(n.text,g,t),r=n.text.length>2&&e<2;if(i||r||s)return void(n.hidden=!0)}n.hidden=!1,l.push(g)}}),0===l.length?null:m.merge(l)}updateSectorLabelNodes(){const{radiusScale:e}=this,t=e.convert(0),{fontSize:i,fontStyle:n,fontWeight:s,fontFamily:r,positionOffset:o,positionRatio:a,color:l}=this.properties.sectorLabel,c=t>0,h=1===this.ctx.legendManager.getData(this.id)?.filter(e=>e.enabled).length,u=(e,u)=>{const{sectorLabel:d,outerRadius:p,startAngle:g,endAngle:f}=u;let m=!1;if(d&&0!==p){const y=t*(1-a)+p*a+o;e.fill=l,e.fontStyle=n,e.fontWeight=s,e.fontSize=i,e.fontFamily=r,e.text=d.text,!c&&h?(e.x=0,e.y=0):(e.x=u.midCos*y,e.y=u.midSin*y),e.textAlign="center",e.textBaseline="middle";const v=e.getBBox(),b=[[v.x,v.y],[v.x+v.width,v.y],[v.x+v.width,v.y+v.height],[v.x,v.y+v.height]],C={startAngle:g,endAngle:f,innerRadius:t,outerRadius:p};b.every(([e,t])=>Vm(e,t,C))&&(m=!0)}e.visible=m};this.labelSelection.each(u),this.highlightLabelSelection.each(u)}updateZerosumRings(){this.zerosumOuterRing.size=2*this.getOuterRadius()}pickNodeClosestDatum(e){return ay(this,e)}getTooltipContent(e){const{id:t,dataModel:i,processedData:n,properties:s}=this,{legendItemKey:r,calloutLabelKey:o,calloutLabelName:a,sectorLabelKey:l,sectorLabelName:c,angleKey:h,angleName:u,radiusKey:d,radiusName:p,tooltip:g}=s,f=this.properties.title.text;if(!i||!n)return;const m=n.dataSources.get(this.id)?.[e],{angleRawValues:y,legendItemValues:v,calloutLabelValues:b,sectorLabelValues:C}=this.getProcessedDataValues(i,n),w=y[e],S=v?.[e]??(o===h?void 0:b?.[e])??(l===h?void 0:C?.[e])??u;return this.formatTooltipWithContext(g,{title:f,symbol:this.legendItemSymbol(e),data:[{label:S,fallbackLabel:h,value:Gn(w,3)}]},{seriesId:t,datum:m,title:u,legendItemKey:r,calloutLabelKey:o,calloutLabelName:a,sectorLabelKey:l,sectorLabelName:c,angleKey:h,angleName:u,radiusKey:d,radiusName:p,...this.getSectorFormat(m,e,!1)})}legendItemSymbol(e){const t=this.processedData?.dataSources.get(this.id)?.[e],i=this.getSectorFormat(t,e,!1),{fillOpacity:n,strokeOpacity:s,strokeWidth:r,lineDash:o,lineDashOffset:a}=this.properties;let{fill:l}=i;const{stroke:c}=i;return rt(l)&&(l={...l,gradient:"linear",rotation:0,reverse:!1}),{marker:{fill:l,stroke:c,fillOpacity:n,strokeOpacity:s,strokeWidth:r,lineDash:o,lineDashOffset:a}}}getLegendData(e){const{id:t,visible:i,processedData:n,dataModel:s,ctx:{legendManager:r}}=this;if(!s||!n||"category"!==e)return[];const{angleKey:o,calloutLabelKey:a,sectorLabelKey:l,legendItemKey:c,showInLegend:h}=this.properties;if(!(c||a&&a!==o||l&&l!==o))return[];const{calloutLabelValues:u,sectorLabelValues:d,legendItemValues:p,angleRawValues:g}=this.getProcessedDataValues(s,n),f=this.properties.title?.showInLegend&&this.properties.title.text,m=[],y=this.properties.hideZeroValueSectorsInLegend,v=n.dataSources.get(this.id),b=n.invalidData?.get(this.id);for(let e=0;e<n.input.count;e++){const n=v?.[e],s=g[e];if(!0===b?.[e]||y&&0===s)continue;const C=[];f&&C.push(f);const w=this.getLabels(n,2*Math.PI,2*Math.PI,!1,u?.[e],d?.[e],p?.[e]);c&&void 0!==w.legendItem?C.push(w.legendItem.text):a&&a!==o&&void 0!==w.calloutLabel?.text?C.push(w.calloutLabel?.text):l&&l!==o&&void 0!==w.sectorLabel?.text&&C.push(w.sectorLabel?.text),0!==C.length&&m.push({legendType:"category",id:t,datum:n,itemId:e,seriesId:t,hideToggleOtherSeries:!0,enabled:i&&r.getItemEnabled({seriesId:t,itemId:e}),label:{text:C.join(" - ")},symbol:this.legendItemSymbol(e),legendItemName:null!=c?n[c]:void 0,hideInLegend:!h})}return m}setLegendState(e){const{id:t,ctx:{legendManager:i,updateService:n}}=this;e.forEach((e,n)=>i.toggleItem(e,t,n)),i.update(),n.update(5)}animateEmptyUpdateReady(e){const{animationManager:t}=this.ctx,i=ry(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);aa(this.id,"nodes",t,[this.itemSelection,this.highlightSelection,this.phantomSelection],i.nodes,(e,t)=>this.getDatumId(t.datumIndex)),vp(this,"callout",t,this.calloutLabelSelection),vp(this,"sector",t,this.labelSelection),vp(this,"highlight",t,this.highlightLabelSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,processedData:n,radiusScale:s,previousRadiusScale:r}=this,{animationManager:o}=this.ctx,a=n?.reduced?.diff?.[this.id];this.ctx.animationManager.stopByAnimationGroupId(this.id);const l=0===(a?.moved.size??0),c=(n?.defs.keys.length??0)>0;l&&c&&(n?.reduced?.animationValidation?.uniqueKeys??1)||this.ctx.animationManager.skipCurrentBatch();const h=ry(!1,this.properties.rotation,s,r);aa(this.id,"nodes",o,[e,t,i],h.nodes,(e,t)=>this.getDatumId(t.datumIndex),a),vp(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),vp(this,"sector",this.ctx.animationManager,this.labelSelection),vp(this,"highlight",this.ctx.animationManager,this.highlightLabelSelection),this.previousRadiusScale.range=this.radiusScale.range}animateClearingUpdateEmpty(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,radiusScale:n,previousRadiusScale:s}=this,{animationManager:r}=this.ctx,o=ry(!1,this.properties.rotation,n,s);aa(this.id,"nodes",r,[e,t,i],o.nodes,(e,t)=>this.getDatumId(t.datumIndex)),bp(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),bp(this,"sector",this.ctx.animationManager,this.labelSelection),bp(this,"highlight",this.ctx.animationManager,this.highlightLabelSelection),this.previousRadiusScale.range=this.radiusScale.range}getDatumId(e){return`${e}`}};Ey.className="PieSeries",Ey.type="pie";var Ay={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["polar"],identifier:"pie",moduleFactory:e=>new Ey(e),tooltipDefaults:{range:"exact"},themeTemplate:{series:{title:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.1666666666666667]},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},spacing:5},calloutLabel:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},offset:3,minAngle:.001},sectorLabel:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"backgroundColor"},positionOffset:0,positionRatio:.5},calloutLine:{length:10,strokeWidth:2,colors:{$map:[{$if:[{$or:[{$isGradient:[{$value:"$1"}]},{$isPattern:[{$value:"$1"}]},{$isImage:[{$value:"$1"}]}]},{$path:["../../strokes/$index",{$ref:"foregroundColor"}]},{$value:"$1"}]},{$if:[{$eq:[{$path:"../strokeWidth"},0]},{$path:"../fills"},{$path:"../strokes"}]}]}},fills:{$palette:"fills"},strokes:{$palette:"strokes"},defaultColorRange:{$palette:"gradients"},defaultPatternFills:up,fillOpacity:1,strokeOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,rotation:0,sectorSpacing:1,shadow:{enabled:!1,color:Rd,xOffset:3,yOffset:3,blur:5}},legend:{enabled:!0}}},My={type:"series",name:"pie",chartType:"polar",options:py,create:e=>new Ey(e)};function Ty(){c.register(Ju,bd,Ch,Bf,lm,ym,Im,Om,my,Ay,xm);for(const e of[Hu,Mh,Wu,Pu,Uu,$u])jo.register(e.type,{moduleFactory:t=>new e(t)})}var Dy=["bar","line","scatter"],Iy=(e=>(e.POINTER="pointer",e.NODE="node",e.CHART="chart",e))(Iy||{}),Ry=(e=>(e.TOP="top",e.RIGHT="right",e.BOTTOM="bottom",e.LEFT="left",e.TOP_RIGHT="top-right",e.BOTTOM_RIGHT="bottom-right",e.BOTTOM_LEFT="bottom-left",e.TOP_LEFT="top-left",e.CENTER="center",e))(Ry||{}),ky=(e=>(e.POINTER="pointer",e.NODE="node",e.TOP="top",e.RIGHT="right",e.BOTTOM="bottom",e.LEFT="left",e.TOP_LEFT="top-left",e.TOP_RIGHT="top-right",e.BOTTOM_RIGHT="bottom-right",e.BOTTOM_LEFT="bottom-left",e))(ky||{}),Py=Symbol("IGNORED_PROP");function _y(e,t){const i={};for(const n of Object.keys(t)){const s=t[n];s!==Py&&Object.hasOwn(e,n)&&(i[n]=s)}return i}function Ly(e){const{enabled:t,mode:i,showArrow:n,range:s,position:r,pagination:o,delay:a,wrapping:l,interaction:c,renderer:h,...u}=e,d=_y(e,{enabled:t,showArrow:n,range:s,position:r,interaction:c,renderer:h,...u});return{chartTooltipOptions:_y(e,{enabled:Py,showArrow:Py,range:Py,position:Py,mode:i,pagination:o,delay:a,wrapping:l,...u}),seriesTooltipOptions:d}}function Ny(e,t){if(null==t)return e;const{targets:i,...n}=t;return null!=(e=L(e,n)).targets&&null!=i&&(e.targets=O(e.targets,i)),e}var Oy={fills:(0,n.Uo)((0,n.O9)(2),(0,n.jk)((0,n.fd)({color:n.yW,stop:n.ai},"")),n.hz),fillMode:(0,n.KC)("continuous","discrete")},Fy={value:(0,n.mw)(n.ai),text:n.Yj,shape:(0,n.or)((0,n.KC)("circle","cross","diamond","heart","plus","pin","square","star","triangle","line"),n.E2),placement:(0,n.KC)("before","after","middle"),spacing:n.Ly,size:n.Ly,rotation:n.ai,...n.Fu,...n.AF,...n.mL},Gy={value:(0,n.mw)(n.ai),text:n.Yj,shape:(0,n.or)((0,n.KC)("circle","cross","diamond","heart","plus","pin","square","star","triangle","line"),n.E2),placement:(0,n.KC)("inside","outside","middle"),spacing:n.Ly,size:n.Ly,rotation:n.ai,label:{...Rf,spacing:n.Ly},...n.Fu,...n.AF,...n.mL},By={direction:(0,n.KC)("horizontal","vertical"),cornerMode:(0,n.KC)("container","item"),cornerRadius:n.Ly,thickness:n.Ly,segmentation:{enabled:n.zM,spacing:n.Ly,interval:{values:(0,n.jk)(n.ai),step:n.ai,count:n.ai}},bar:{enabled:n.zM,thickness:n.Ly,thicknessRatio:n.CG,...Oy,...n.Fu,...n.AF,...n.mL},label:{...kf,text:n.Yj,spacing:n.Ly,avoidCollisions:n.zM,placement:(0,n.KC)("inside-start","outside-start","inside-end","outside-end","inside-center","bar-inside","bar-inside-end","bar-outside-end","bar-end")},tooltip:Lf,...G(Tf,["listeners"])},Vy={...By,...G(Df,["listeners"]),type:(0,n.mw)((0,n.dY)("linear-gauge")),value:(0,n.mw)(n.ai),scale:{min:(0,n.Uo)(n.ai,(0,n.Xe)("max")),max:(0,n.Uo)(n.ai,(0,n.MM)("min")),label:{enabled:n.zM,formatter:n.E2,rotation:n.ai,spacing:n.Ly,minSpacing:n.Ly,placement:(0,n.KC)("before","after"),avoidCollisions:n.zM,format:Xg,...n.LV},interval:{values:(0,n.jk)(n.ai),step:n.ai},...Oy,...n.Fu,...n.AF,...n.mL},targets:(0,n.J$)(Fy,"target options array")};Vy.margin=(0,n._L)(n.ai),Vy.defaultColorRange=(0,n._L)((0,n.jk)(n.yW)),Vy.defaultTarget=(0,n._L)({...Fy,value:n.ai,label:{...Rf,spacing:n.ai}}),Vy.defaultScale=(0,n._L)(Vy.scale),Vy.scale.defaultFill=(0,n._L)(n.yW);var Hy={outerRadius:n.Ly,innerRadius:n.Ly,outerRadiusRatio:n.CG,innerRadiusRatio:n.CG,startAngle:n.ai,endAngle:n.ai,spacing:n.Ly,cornerMode:(0,n.KC)("container","item"),cornerRadius:n.Ly,scale:{min:(0,n.Uo)(n.ai,(0,n.Xe)("max")),max:(0,n.Uo)(n.ai,(0,n.MM)("min")),label:{enabled:n.zM,formatter:n.E2,rotation:n.ai,spacing:n.Ly,minSpacing:n.Ly,avoidCollisions:n.zM,format:Xg,...n.LV},interval:{values:(0,n.jk)(n.ai),step:n.ai},...Oy,...n.Fu,...n.AF,...n.mL},segmentation:{enabled:n.zM,spacing:n.Ly,interval:{values:(0,n.jk)(n.ai),step:n.ai,count:n.ai}},bar:{enabled:n.zM,...Oy,...n.Fu,...n.AF,...n.mL},needle:{enabled:n.zM,spacing:n.Ly,radiusRatio:n.CG,...n.Fu,...n.AF,...n.mL},label:{text:n.Yj,spacing:n.Ly,...kf},secondaryLabel:{text:n.Yj,...kf},tooltip:Lf,...Tf},Uy={...Hy,...Df,type:(0,n.mw)((0,n.dY)("radial-gauge")),value:(0,n.mw)(n.ai),targets:(0,n.J$)(Gy,"target options array")};Uy.defaultColorRange=(0,n._L)((0,n.jk)(n.yW)),Uy.defaultTarget=(0,n._L)({...Gy,value:n.ai,label:{...Rf,spacing:n.ai}}),Uy.scale.defaultFill=(0,n._L)(n.yW);var zy={stroke:Kd},Wy={fill:Zd},jy={color:"white",fill:Kd},$y={color:Kd},Ky={color:qd,fontSize:{$rem:[1.1666666666666667]},fontFamily:{$ref:"fontFamily"}},Yy={...Ky,fontSize:{$ref:"fontSize"},color:ep,fill:Qd,stroke:Jd,strokeWidth:1,divider:{stroke:tp,strokeWidth:1,strokeOpacity:.5}},qy={...zy,background:{fill:Xd,fillOpacity:.2},handle:{...Wy},text:{...$y},statistics:{...Yy}},Xy={line:{...zy,handle:{...Wy},text:{...$y}},"horizontal-line":{...zy,handle:{...Wy},axisLabel:{...jy},text:{...$y}},"vertical-line":{...zy,handle:{...Wy},axisLabel:{...jy},text:{...$y}},"disjoint-channel":{...zy,background:{fill:Xd,fillOpacity:.2},handle:{...Wy},text:{...$y}},"parallel-channel":{...zy,background:{fill:Xd,fillOpacity:.2},handle:{...Wy},text:{...$y}},"fibonacci-retracement":{...zy,strokes:Yd,rangeStroke:Kd,handle:{...Wy},text:{...$y,position:"center"},label:{...Ky,color:void 0,fontSize:{$round:[{$mul:[{$ref:"fontSize"},10/12]}]}}},"fibonacci-retracement-trend-based":{...zy,strokes:Yd,rangeStroke:Kd,handle:{...Wy},text:{...$y,position:"center"},label:{...Ky,color:void 0,fontSize:{$round:[{$mul:[{$ref:"fontSize"},10/12]}]}}},callout:{...zy,...Ky,color:{$ref:"textColor"},handle:{...Wy},fill:Xd,fillOpacity:.2},comment:{...Ky,color:"white",fontWeight:700,handle:{...Wy},fill:Kd},note:{...Ky,color:op,fill:Kd,stroke:{$ref:"backgroundColor"},strokeWidth:1,strokeOpacity:1,handle:{...Wy},background:{fill:sp,stroke:rp,strokeWidth:1}},text:{...Ky,handle:{...Wy}},arrow:{...zy,handle:{...Wy},text:{...$y}},"arrow-up":{fill:{$palette:"up.fill"},handle:{...Wy,stroke:Kd}},"arrow-down":{fill:{$palette:"down.fill"},handle:{...Wy,stroke:Kd}},"date-range":{...qy},"price-range":{...qy},"date-price-range":{...qy},"quick-date-price-range":{up:{...zy,fill:Xd,fillOpacity:.2,handle:{...Wy},statistics:{...Yy,color:"#fff",fill:Xd,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}},down:{...zy,stroke:np,fill:ip,fillOpacity:.2,handle:{...Wy,stroke:np},statistics:{...Yy,color:"#fff",fill:ip,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}}},axesButtons:{enabled:!0}},Zy=["ohlc","line","step-line","hlc","high-low","candlestick","hollow-candlestick"],Qy=[{icon:"trend-line-drawing",tooltip:"toolbarAnnotationsLineAnnotations",value:"line-menu"},{icon:"fibonacci-retracement-drawing",tooltip:"toolbarAnnotationsFibonacciAnnotations",value:"fibonacci-menu"},{icon:"text-annotation",tooltip:"toolbarAnnotationsTextAnnotations",value:"text-menu"},{icon:"arrow-drawing",tooltip:"toolbarAnnotationsShapeAnnotations",value:"shape-menu"},{icon:"measurer-drawing",tooltip:"toolbarAnnotationsMeasurerAnnotations",value:"measurer-menu"},{icon:"delete",tooltip:"toolbarAnnotationsClearAll",value:"clear"}],Jy="range-area";function ev(e,t){return[{type:"candlestick",focusPriority:0,...e,...t}]}function tv(e,t){return t[e]??t.default}var iv={title:{enabled:!1},label:{enabled:!1},line:{enabled:!1},gridLine:{enabled:!1},crosshair:{enabled:!1,stroke:$d,lineDash:[0],label:{enabled:!1}}},nv={...iv,nice:!1},sv={mode:"compact",position:{anchorTo:"node",placement:["right","left"]},showArrow:!1},rv={style:[{stroke:{$ref:"gridLineColor"}}],width:2},ov={number:{gridLine:rv},time:{gridLine:rv},category:{gridLine:rv}},av={overrides:{common:{animation:{enabled:!1},contextMenu:{enabled:!1},keyboard:{enabled:!1},background:{visible:!1},navigator:{enabled:!1},padding:{top:0,right:0,bottom:0,left:0},axes:{number:{...nv,interval:{values:[0]}},log:{...nv},time:{...nv},category:{...iv}}},bar:{series:{crisp:!1,label:{placement:"inside-end",padding:4},sparklineMode:!0},tooltip:{...sv,position:{...sv.position,anchorTo:"pointer"},range:"nearest"},axes:ov},line:{seriesArea:{padding:{top:2,right:2,bottom:2,left:2}},series:{sparklineMode:!0,strokeWidth:1,marker:{enabled:!1,size:3}},tooltip:sv},area:{seriesArea:{padding:{top:1,right:0,bottom:1,left:0}},series:{strokeWidth:1,fillOpacity:.4},tooltip:sv}}},lv=Ph(function(e,t){return"string"==typeof e?{...t,baseTheme:e}:null!=e?{...e,baseTheme:lv(e.baseTheme,t)}:t});function cv(e){if(Array.isArray(e)&&0!==e.length){const t=e[0];if("number"==typeof t)return{data:e.map((e,t)=>({x:t,y:e})),series:[{xKey:"x",yKey:"y"}],datumKey:"y"};if(Array.isArray(t))return{data:e.map(e=>({x:e[0],y:e[1],datum:e})),series:[{xKey:"x",yKey:"y"}],datumKey:"datum"}}return{data:e}}function hv(e){switch(e?.type){case"number":{const{type:t,min:i,max:n,reverse:s}=e;return _y(e,{type:t,reverse:s,min:i,max:n})}case"time":{const{type:t,min:i,max:n,reverse:s}=e;return _y(e,{type:t,reverse:s,min:i,max:n})}default:const{paddingInner:t,paddingOuter:i,reverse:n}=e??{};return _y({...e,type:"category"},{type:"category",reverse:n,paddingInner:t,paddingOuter:i})}}function uv(e,t,i){const n={};return null!=e?.stroke&&(n.style=[{stroke:e?.stroke}],n.enabled??(n.enabled=!0)),null!=e?.strokeWidth&&(n.width=e?.strokeWidth,n.enabled??(n.enabled=!0)),"bar"===i.type&&"horizontal"!==i.direction&&(n.enabled??(n.enabled=!0)),null!=e?.visible&&(n.enabled=e.visible),n.enabled??(n.enabled=t),n}var dv=Ph((e,t,i)=>n=>{const s=n.datum[n.xKey],r=n.datum[n.yKey],o=null!=i?n.datum[i]:n.datum,a=t?.renderer?.({context:e,datum:o,xValue:s,yValue:r});if("string"==typeof a)return a;const l=a?.content??r.toFixed(2);return a?.title?{heading:void 0,title:void 0,data:[{label:a.title,value:l}]}:{heading:void 0,title:l,data:[]}}),pv={chartType:(0,n.KC)("candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"),dateKey:n.Yj,openKey:n.Yj,highKey:n.Yj,lowKey:n.Yj,closeKey:n.Yj,volumeKey:n.Yj,navigator:n.zM,volume:n.zM,rangeButtons:n.zM,statusBar:n.zM,toolbar:n.zM,zoom:n.zM,sync:n.zM,theme:n.sw,container:n.sw,width:n.sw,height:n.sw,minWidth:n.sw,minHeight:n.sw,listeners:n.sw,initialState:n.sw,title:n.sw,data:n.YO},gv={theme:n.sw,container:n.sw,animation:n.sw,background:n.sw,contextMenu:n.sw,listeners:n.sw,locale:n.sw,width:n.sw,height:n.sw,minWidth:n.sw,minHeight:n.sw,title:n.sw,subtitle:n.sw,footnote:n.sw,padding:n.sw,tooltip:{...Lf,...Mf.tooltip}};gv.overrideDevicePixelRatio=(0,n._L)(n.Ly);var fv=["showInLegend","showInMiniChart","grouped","stacked","stackGroup","tooltip","listeners","errorBar","xKey","yKey","type"],mv={visible:n.zM,reverse:n.zM,stroke:n.yW,strokeWidth:n.Ly},yv={context:n.sw,tooltip:n.sw,theme:n.sw,background:n.sw,container:n.sw,width:n.sw,height:n.sw,minWidth:n.sw,minHeight:n.sw,padding:n.sw,listeners:n.sw,locale:n.sw,data:n.sw,styleNonce:n.Yj,axis:(0,n.is)({number:{...mv,min:(0,n.Uo)(n.ai,(0,n.Xe)("max")),max:(0,n.Uo)(n.ai,(0,n.MM)("min"))},category:{...mv,paddingInner:n.CG,paddingOuter:n.CG},time:{...mv,min:(0,n.Uo)((0,n.or)(n.ai,n.p6),(0,n.Xe)("max")),max:(0,n.Uo)((0,n.or)(n.ai,n.p6),(0,n.MM)("min"))}},"axis options","category"),min:(0,n.Uo)(n.ai,(0,n.Xe)("max")),max:(0,n.Uo)(n.ai,(0,n.MM)("min")),crosshair:{enabled:n.zM,snap:n.zM,...n.AF,...n.mL},xKey:n.Yj,yKey:n.Yj},vv={type:"preset",name:"price-volume",enterprise:!0,options:pv,create:function(e,t,i){const{dateKey:s="date",highKey:r="high",openKey:o="open",lowKey:a="low",closeKey:l="close",volumeKey:c="volume",chartType:h="candlestick",navigator:u=!1,volume:d=!0,rangeButtons:p=!0,statusBar:g=!0,toolbar:f=!0,zoom:m=!0,sync:y=!1,theme:v,data:b,...C}=e,w=function(e,t,i,s,r,o){const a={xKey:t,openKey:r,closeKey:o,highKey:i,lowKey:s},l={xKey:t,yKey:o},c={pickOutsideVisibleMinorAxis:!0};switch(e??"candlestick"){case"ohlc":return function(e,t){return[{type:"ohlc",focusPriority:0,...e,...t}]}(c,a);case"line":case"step-line":return function(e,t){return[{type:"line",focusPriority:0,...e,...t}]}(c,l);case"hlc":return function(e,t,{xKey:i,highKey:n,closeKey:s,lowKey:r}){return[{type:Jy,focusPriority:0,...e,xKey:i,yHighKey:n,yLowKey:s,fill:Nd,stroke:_d},{type:Jy,focusPriority:0,...e,xKey:i,yHighKey:s,yLowKey:r,fill:Od,stroke:Ld},{type:"line",...e,...t}]}(c,l,a);case"high-low":return function(e,{xKey:t,highKey:i,lowKey:n}){return[{type:"range-bar",...e,xKey:t,yHighKey:i,yLowKey:n,fill:Gd,stroke:Fd,tooltip:{range:"nearest"},focusPriority:0,fastDataProcessing:!0}]}(c,a);case"candlestick":case"hollow-candlestick":return ev(c,a);default:return n.Vy.warnOnce(`unknown chart type: ${e}; expected one of: ${Zy.join(", ")}`),ev(c,a)}}(h,s,r,a,o,l),S=function(e,t,i,n,s){return n?[{type:"bar",xKey:"date",yKey:s,tooltip:{enabled:!1},itemStyler({datum:n}){const{up:s,down:r}=e().palette;return{fill:n[t]<n[i]?s?.fill:r?.fill}},focusPriority:1,fastDataProcessing:!0,highlight:{enabled:!1}}]:[]}(i,o,l,d,c),x={navigator:{enabled:u,...d?{miniChart:{enabled:u,series:[{type:"line",xKey:s,yKey:c,stroke:dp,marker:{enabled:!1}}]},height:40,minHandle:{height:46},maxHandle:{height:46}}:null}},E={annotations:{enabled:f,optionsToolbar:{enabled:f},snap:!0,toolbar:{enabled:f,buttons:Qy,padding:0},data:b,xKey:s,volumeKey:d?c:void 0}},A=g?{statusBar:{enabled:!0,data:b,highKey:r,openKey:o,lowKey:a,closeKey:l,volumeKey:d?c:void 0}}:null,M={zoom:{enabled:m,autoScaling:{enabled:!0},enableIndependentAxes:!0}},T={ranges:{enabled:p}},D=y?{sync:{enabled:y,nodeInteraction:!0,zoom:!0}}:null,I=d?[{type:"number",position:"left",keys:[c],label:{enabled:!1},crosshair:{enabled:!1},gridLine:{enabled:!1},nice:!1,layoutConstraints:{stacked:!1,width:20,unit:"percent",align:"end"}}]:[];return{theme:{baseTheme:"string"==typeof v?v:"ag-financial",...L("object"==typeof v?v:null,{overrides:{common:{title:{padding:4},padding:{top:6,right:8,bottom:5},chartToolbar:{enabled:f},annotations:{...Xy},axes:{number:{interval:{maxSpacing:45},label:{format:".2f"}}}},bar:{series:{fillOpacity:.5}},line:{series:{marker:{enabled:!1},...tv(h,{hlc:{stroke:{$palette:"altNeutral.stroke"},strokeWidth:2},line:{stroke:{$palette:"neutral.stroke"}},"step-line":{stroke:{$palette:"neutral.stroke"},interpolation:{type:"step"}}})}},candlestick:{series:{...tv(h,{"hollow-candlestick":{item:{up:{fill:"transparent"}}}})}},"range-area":{series:{fillOpacity:.3,strokeWidth:2}}}})},animation:{enabled:!1},legend:{enabled:!1},series:[...S,...w],axes:[{type:"number",position:"right",keys:[o,l,r,a],crosshair:{enabled:!0,snap:!1},layoutConstraints:{stacked:!1,width:100,unit:"percent",align:"start"}},...I,{type:"ordinal-time",position:"bottom",line:{enabled:!1},label:{enabled:!0},crosshair:{enabled:!0}}],tooltip:{enabled:!1},data:b,...E,...x,...A,...M,...T,...D,...C}}},bv={type:"preset",name:"gauge-preset",enterprise:!0,options:(0,n.is)({"linear-gauge":{...G(Vy,["type"]),...gv},"radial-gauge":{...G(Uy,["type"]),...gv}},"gauge options"),create:function(e,t){if(e.listeners){const{nodeClick:t,nodeDoubleClick:i,...n}=e.listeners;e={...e,listeners:{seriesNodeClick:t,seriesNodeDoubleClick:i,...n}}}switch(e.type){case"radial-gauge":return function(e){const{animation:t,background:i,container:n,contextMenu:s,footnote:r,height:o,listeners:a,locale:l,minHeight:c,minWidth:h,overrideDevicePixelRatio:u,padding:d,subtitle:p,theme:g,title:f,width:m,type:y,cursor:v,nodeClickRange:b,tooltip:C={},value:w,scale:S={},startAngle:x,endAngle:E,highlightStyle:A,segmentation:M,bar:T,needle:D,targets:I,outerRadius:R,innerRadius:k,outerRadiusRatio:P,innerRadiusRatio:_,cornerRadius:L,cornerMode:N,label:O,secondaryLabel:F,spacing:G,...B}=e,{chartTooltipOptions:V,seriesTooltipOptions:H}=Ly(C),U=_y(e,{animation:t,background:i,container:n,contextMenu:s,footnote:r,height:o,listeners:a,locale:l,minHeight:c,minWidth:h,overrideDevicePixelRatio:u,padding:d,subtitle:p,theme:g,title:f,tooltip:V,width:m}),z=_y(e,{needle:null!=D?{enabled:!0,...D}:Py,startAngle:x,endAngle:E,scale:S,type:y,cursor:v,nodeClickRange:b,tooltip:H,value:w,highlightStyle:A,segmentation:M,bar:T,targets:I,outerRadius:R,innerRadius:k,outerRadiusRatio:P,innerRadiusRatio:_,cornerRadius:L,cornerMode:N,label:O,secondaryLabel:F,spacing:G,...B});return"context"in e&&(U.context=e.context),{...U,series:[z]}}(Ny(e,t));case"linear-gauge":return function(e){const{animation:t,background:i,container:n,contextMenu:s,footnote:r,height:o,listeners:a,locale:l,minHeight:c,minWidth:h,overrideDevicePixelRatio:u,padding:d,subtitle:p,theme:g,title:f,width:m,type:y,cursor:v,nodeClickRange:b,tooltip:C={},value:w,scale:S={},direction:x="vertical",thickness:E,highlightStyle:A,segmentation:M,bar:T,targets:D,cornerRadius:I,cornerMode:R,label:k,...P}=e,{chartTooltipOptions:_,seriesTooltipOptions:L}=Ly(C),N=_y(e,{animation:t,background:i,container:n,contextMenu:s,footnote:r,height:o,listeners:a,locale:l,minHeight:c,minWidth:h,overrideDevicePixelRatio:u,padding:d,subtitle:p,theme:g,title:f,tooltip:_,width:m}),O=_y(e,{scale:S,type:y,cursor:v,nodeClickRange:b,tooltip:L,value:w,direction:x,thickness:E,highlightStyle:A,segmentation:M,bar:T,targets:D,cornerRadius:I,cornerMode:R,label:k,...P});return"context"in e&&(N.context=e.context),{...N,series:[O]}}(Ny(e,t));default:return{}}}},Cv={type:"preset",name:"sparkline",options:(0,n.is)({area:{...yv,...G(Gf,fv)},bar:{...yv,...G(am,fv)},line:{...yv,...G(Dm,fv)}},"sparkline options"),create:function(e){const{background:t,container:i,height:n,listeners:s,locale:r,minHeight:o,minWidth:a,overrideDevicePixelRatio:l,padding:c,width:h,theme:u,data:d,crosshair:p,axis:g,min:f,max:m,tooltip:y,context:v,styleNonce:b,...C}=e,w=_y(e,{background:t,container:i,height:n,listeners:s,locale:r,minHeight:o,minWidth:a,overrideDevicePixelRatio:l,padding:c,width:h,styleNonce:b,tooltip:Py,context:Py,data:Py,crosshair:Py,axis:Py,min:Py,max:Py,theme:Py}),{data:S,series:[x]=[],datumKey:E}=cv(d),A=C;null!=x&&Object.assign(A,x),A.tooltip={...y,renderer:dv(v,y,E)},w.theme=lv(u,av),w.data=S,w.series=[A];const M="bar"!==A.type||"horizontal"!==A.direction,[T,D]=M?["bottom","left"]:["left","bottom"],I={...hv(g),position:T,..._y(e,{crosshair:p})},R={type:"number",gridLine:uv(g,!1,e),position:D,..._y(e,{min:f,max:m})};return w.axes=M?[R,I]:[I,R],w},processData:cv},wv=["top","right","bottom","left"],Sv=class e extends gh{constructor(e,t){super(e,t),this.paired=!0,this.lastUpdateClipRect=void 0,this.lastLayoutWidth=NaN,this.lastLayoutHeight=NaN}onAxisChange(e,t){super.onAxisChange(e,t),this.syncAxisChanges(e,t),null!=this.ctx&&this.ctx.zoomManager.updateAxes(e)}destroySeries(e){super.destroySeries(e),this.lastLayoutWidth=NaN,this.lastLayoutHeight=NaN}getChartType(){return"cartesian"}setRootClipRects(e){const{seriesRoot:t,annotationRoot:i}=this;t.setClipRect(e),i.setClipRect(e)}async processData(){await super.processData(),"init"===this.syncStatus&&(this.syncStatus="domains-calculated"),this.ctx.updateService.dispatchProcessData({series:{shouldFlipXY:this.shouldFlipXY()}})}async processDomains(){await super.processDomains();for(const e of this.axes){const t=await this.getSyncedDomain(e);null!=t&&e.setDomains(t)}}performLayout(e){const{seriesRoot:t,annotationRoot:i}=this,{clipSeries:n,seriesRect:s,visible:r}=this.updateAxes(e.layoutBox);this.seriesRoot.visible=r,this.seriesRect=s,this.animationRect=e.layoutBox;const{x:o,y:a}=s;if(e.width!==this.lastLayoutWidth||e.height!==this.lastLayoutHeight)for(const e of[t,i])e.translationX=Math.floor(o),e.translationY=Math.floor(a);else{const{translationX:e,translationY:n}=t;la(this.id,"seriesRect",this.ctx.animationManager,[t,i],{translationX:e,translationY:n},{translationX:Math.floor(o),translationY:Math.floor(a)},{phase:"update"})}this.lastLayoutWidth=e.width,this.lastLayoutHeight=e.height;const l=s.clone().grow(this.seriesArea.padding),c=this.seriesArea.clip||n?l:void 0,{lastUpdateClipRect:h}=this;this.lastUpdateClipRect=c,this.ctx.animationManager.isActive()&&null!=h?this.ctx.animationManager.animate({id:this.id,groupId:"clip-rect",phase:"update",from:h,to:l,onUpdate:e=>this.setRootClipRects(e),onComplete:()=>this.setRootClipRects(c)}):this.setRootClipRects(c),this.ctx.layoutManager.emitLayoutComplete(e,{axes:this.axes.map(e=>e.getLayoutState()),series:{visible:r,rect:s,paddedRect:l},clipSeries:n})}updateAxes(e){const{clipSeries:t,seriesRect:i,overflows:n}=this.resolveAxesLayout(e);for(const t of this.axes)t.update(),t.setCrossLinesVisible(!n),this.clipAxis(t,i,e);return{clipSeries:t,seriesRect:i,visible:!n}}resolveAxesLayout(e){let t,i,s=0;do{if(i=t??this.getDefaultState(),t=this.updateAxesPass(new Map(i.axisAreaWidths),e.clone()),s++>10){n.Vy.warn("Max iterations reached. Unable to stabilize axes layout.");break}}while(!this.isLayoutStable(t,i));return this.lastAreaWidths=t.axisAreaWidths,t}updateAxesPass(t,i){const s=new Map,r={};let o=!1,a=!1;for(const e of wv){const t=this.seriesArea.padding[e],n=this.axes.findLast(t=>t.position===e);n?n.seriesAreaPadding=t:i.shrink(t,e)}const l=(t.get("left")??0)+(t.get("right")??0),c=(t.get("top")??0)+(t.get("bottom")??0),h=this.buildCrossLinePadding(t),u=h.left+h.right,d=h.top+h.bottom;i.width<=l+u||i.height<=c+d?o=!0:i.shrink(h);const p=i.clone().shrink(Object.fromEntries(t));for(const e of this.axes){const{position:t="left",direction:i}=e;this.sizeAxis(e,p,t);const n="y"===i,{primaryTickCount:o,bbox:l}=e.calculateLayout(e.nice?r[i]:void 0,this.padding);r[i]??(r[i]=o),a||(a=e.dataDomain.clipped||e.visibleRange[0]>0||e.visibleRange[1]<1),s.set(e.id,Math.ceil(e.thickness??(n?l?.width:l?.height)??0))}const g=(0,n.$z)(this.axes,e=>e.position??"left"),{width:f,height:m,pixelRatio:y}=this.ctx.scene,v=new Map,b=new Map;for(const[t,i]of(0,n.jO)(g)){let n="left"===t||"right"===t?m%y:f%y,r=0;for(const t of i??[]){b.set(t.id,n);const i=s.get(t.id)??0;r=Math.max(r,n+i),t.layoutConstraints.stacked&&(n+=i+e.AxesPadding)}v.set(t,Math.ceil(r))}for(const[e,t]of(0,n.jO)(g))this.positionAxes({axes:t??[],position:e,axisWidths:s,axisOffsets:b,axisAreaWidths:v,axisBound:i,seriesRect:p});return{clipSeries:a,seriesRect:p,axisAreaWidths:v,overflows:o}}buildCrossLinePadding(e){const t={top:0,right:0,bottom:0,left:0};this.axes.forEach(e=>{const{position:i,label:n}=e;e.crossLines?.forEach(e=>{var s;e instanceof dl&&(e.position=i??"top",(s=e.label).parallel??(s.parallel=n.parallel)),e.calculatePadding?.(t)})});for(const[i,s=0]of(0,n.jO)(t))t[i]=Math.max(s-(e.get(i)??0),0);return t}clampToOutsideSeriesRect(e,t,i,n){const s="x"===i?e.x:e.y,r="x"===i?e.width:e.height;return 1===n?Math.min(t,s+r):Math.max(t,s)}async getSyncedDomain(e){const t=this.modulesManager.getModule("sync");if(t?.enabled)return await t.getSyncedDomain(e)}syncAxisChanges(e,t){const i=this.modulesManager.getModule("sync");if(!i?.enabled)return;const n=new Set(t??[]);for(const t of e)n.delete(t);for(const e of n)i.removeAxis(e)}sizeAxis(e,t,i){const n=e instanceof Mh,s="left"===i||"right"===i,{width:r,height:o}=t,a=s?o:r;let l=0,c=a,{min:h,max:u}=this.ctx.zoomManager.getAxisZoom(e.id);const{width:d,unit:p,align:g}=e.layoutConstraints;c="px"===p?l+d:c*d/100,"end"===g&&(l=a-(c-l),c=a),s&&(n?[h,u]=[1-u,1-h]:[l,c]=[c,l]),e.range=[l,c],e.visibleRange=[h,u],e.gridLength=s?r:o}positionAxes(e){const{axes:t,axisBound:i,axisWidths:n,axisOffsets:s,axisAreaWidths:r,seriesRect:o,position:a}=e,l=r.get(a)??0;let c="x",h="y",u=1;"top"!==a&&"bottom"!==a||(c="y",h="x");let d=i[c];"right"!==a&&"bottom"!==a||(u=-1,d+="x"===c?i.width:i.height);for(const e of t){const t=r.get("x"===h?"left":"top")??0,a=n.get(e.id)??0,p=s.get(e.id)??0;e.gridPadding=l-p-a,e.translation[h]=i[h]+t,e.translation[c]=this.clampToOutsideSeriesRect(o,d+u*(p+a),c,u)}}shouldFlipXY(){return this.series.every(e=>e instanceof jp&&e.shouldFlipXY())}getDefaultState(){const e=new Map;if(this.lastAreaWidths)for(const{position:t="left"}of this.axes){const i=this.lastAreaWidths.get(t);null!=i&&e.set(t,i)}return{axisAreaWidths:e,clipSeries:!1,overflows:!1}}isLayoutStable(e,t){if(t.overflows!==e.overflows||t.clipSeries!==e.clipSeries)return!1;for(const i of e.axisAreaWidths.keys())if(!t.axisAreaWidths.has(i))return!1;for(const[i,n]of t.axisAreaWidths.entries()){const t=e.axisAreaWidths.get(i);if((null!=n||null!=t)&&n!==t)return!1}return!0}clipAxis(e,t,i){const n=Math.ceil(e.gridLine?.width??0),s=Math.ceil(e.line?.width??0);let{width:r,height:o}=t;switch(r+="x"===e.direction?n:s,o+="y"===e.direction?n:s,e.clipGrid(t.x,t.y,r,o),e.position){case"left":case"right":e.clipTickLines(i.x,t.y-n,i.width+n,t.height+2*n);break;case"top":case"bottom":e.clipTickLines(t.x-n,i.y,t.width+2*n,i.height+n)}}};Sv.className="CartesianChart",Sv.type="cartesian",Sv.AxesPadding=15;var xv=Sv,Ev={mode:(0,n._L)((0,n.KC)("integrated","standalone")),container:n.Sc,theme:n.sw,series:n.YO,annotations:n.sw,navigator:n.sw,initialState:{chartType:n.Yj,annotations:n.sw,legend:(0,n.J$)({visible:n.zM,seriesId:n.Yj,itemId:n.Yj,legendItemName:n.Yj},"legend state array"),zoom:n.sw}},Av={...Mf,...Ev,axes:n.sw,data:n.YO},Mv={...Mf,...Ev,axes:n.sw,data:n.YO},Tv={...Mf,...Ev,data:n.YO,topology:n.eW},Dv={...Mf,...Ev,data:n.YO},Iv={...Mf,...Ev,data:n.YO},Rv={...Mf,...Ev,data:n.YO,nodes:n.YO},kv={...Mf,...Ev,data:n.YO},Pv=new Set(["number","log","time"]),_v=e=>(0,n.Gv)(e)&&!Pv.has(e.type),Lv={type:"chart",name:"cartesian",options:Av,detect:Ql,create:(e,t)=>new xv(e,t),validate(e,t,i){const s=[];"histogram"===e?.series?.[0]?.type&&e?.axes?.some(_v)&&(s.push(new n.yI("invalid","only continuous axis types when histogram series is used",e.axes,i,"axes")),e=G(e,["axes"]));const r=(0,n.tf)(e,t,i);return r.invalid.push(...s),r}},Nv=()=>{throw new Error("Enterprise module placeholder cannot be initialised")},Ov={type:"chart",name:"flow-proportion",placeholder:!0,options:{},detect:ic,create:Nv},Fv={type:"chart",name:"gauge",placeholder:!0,options:{},detect:sc,create:Nv},Gv={type:"chart",name:"hierarchy",placeholder:!0,options:{},detect:ec,create:Nv},Bv={type:"chart",name:"standalone",placeholder:!0,options:{},detect:nc,create:Nv},Vv={type:"chart",name:"topology",placeholder:!0,options:{},detect:tc,create:Nv},Hv=class extends Ul{constructor(){super(...arguments),this.shape="polygon",this.innerRadiusRatio=0,this.defaultTickMinSpacing=20}layoutCrossLines(){const e=this.label.getSideFlag(),t=this.isAnySeriesActive(),{rotation:i,parallelFlipRotation:n,regularFlipRotation:s}=this.calculateRotations();this.crossLines.forEach(r=>{r.sideFlag=-e,r.direction=i===-Math.PI/2?"angle":"radius",r.parallelFlipRotation=n,r.regularFlipRotation=s,r.calculateLayout?.(t,this.reverse)})}updatePosition(){super.updatePosition();const e=Math.floor(this.translation.x),t=Math.floor(this.translation.y);this.tickLineGroup.translationX=e,this.tickLineGroup.translationY=t,this.tickLabelGroup.translationX=e,this.tickLabelGroup.translationY=t,this.crossLineRangeGroup.translationX=e,this.crossLineRangeGroup.translationY=t,this.crossLineLineGroup.translationX=e,this.crossLineLineGroup.translationY=t,this.crossLineLabelGroup.translationX=e,this.crossLineLabelGroup.translationY=t,this.tickLabelGroupSelection.each((e,t)=>({x:t.x,y:t.y,rotationCenterX:t.rotationCenterX,rotationCenterY:t.rotationCenterY,rotation:t.rotation}))}computeLabelsBBox(e,t){return null}computeRange(){}getAxisLinePoints(){}};a([Te],Hv.prototype,"shape",2),a([Te],Hv.prototype,"innerRadiusRatio",2);var Uv=class extends gh{constructor(e,t){super(e,t),this.padding=new si(40),this.ctx.axisManager.axisGroup.zIndex=6}getChartType(){return"polar"}async performLayout(e){const{layoutBox:t}=e;t.shrink(this.seriesArea.padding.toJson());const i=t.clone();this.seriesRect=i,this.animationRect=i,this.seriesRoot.translationX=i.x,this.seriesRoot.translationY=i.y,await this.computeCircle(i),this.axes.forEach(e=>e.update()),this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:!0,rect:i,paddedRect:i}})}updateAxes(e,t,i,n){const s=this.axes.find(e=>"angle"===e.direction),r=this.axes.find(e=>"radius"===e.direction);if(!(s instanceof Hv&&r instanceof Hv))return;const o=s.scale,a=r.innerRadiusRatio;s.innerRadiusRatio=a,s.computeRange(),s.gridLength=n,r.gridAngles=o.ticks({nice:s.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.ticks?.map(e=>o.convert(e)),r.gridRange=s.range,r.range=[n,n*a],[s,r].forEach(n=>{n.translation.x=e.x+t,n.translation.y=e.y+i,n.calculateLayout()})}async computeCircle(e){const t=this.series.filter(zv),i=this.axes.filter(Wv),s=(i,n,s)=>{this.updateAxes(e,i,n,s),t.forEach(e=>{e.centerX=i,e.centerY=n,e.radius=s});const r=t.filter(e=>"donut"===e.type||"pie"===e.type);if(r.length>1){const e=r.map(e=>{const t=e.getInnerRadius();return{series:e,innerRadius:t}}).sort((e,t)=>e.innerRadius-t.innerRadius);e.at(-1).series.surroundingRadius=void 0;for(let t=0;t<e.length-1;t++)e[t].series.surroundingRadius=e[t+1].innerRadius}},r=e.width/2,o=e.height/2,a=Math.max(0,Math.min(e.width,e.height)/2);let l=a;s(r,o,l);const c=async({hideWhenNecessary:c=!1}={})=>{const h=[];for(const s of(0,n.nl)(i,t)){const t=await s.computeLabelsBBox({hideWhenNecessary:c},e);t&&h.push(t)}if(0===h.length)return void s(r,o,a);const u=m.merge(h),d=this.refineCircle(u,l,e);s(d.centerX,d.centerY,d.radius),l=d.radius};await c(),await c(),await c(),await c({hideWhenNecessary:!0}),await c({hideWhenNecessary:!0});for(const s of(0,n.nl)(i,t))await s.computeLabelsBBox({hideWhenNecessary:!0},e);return{radius:l,centerX:r,centerY:o}}refineCircle(e,t,i){const n=-t,s=-t,r=t,o=t;let a=Math.max(0,n-e.x),l=Math.max(0,s-e.y),c=Math.max(0,e.x+e.width-r),h=Math.max(0,e.y+e.height-o);a=c=Math.max(a,c),l=h=Math.max(l,h);const u=i.width-a-c,d=i.height-l-h;let p=Math.min(u,d)/2;const g=.5*i.width/2,f=.5*i.height/2,m=Math.min(g,f);if(p<m){p=m;const e=a+c;if(2*p+(l+h)>i.height){const e=i.height-2*p;2*Math.min(l,h)>e?(l=e/2,h=e/2):l>h?l=e-h:h=e-l}if(2*p+e>i.width){const e=i.width-2*p;2*Math.min(a,c)>e?(a=e/2,c=e/2):a>c?a=e-c:c=e-a}}const y=a+2*p+c,v=l+2*p+h;return{centerX:(i.width-y)/2+a+p,centerY:(i.height-v)/2+l+p,radius:p}}};function zv(e){return e instanceof cy}function Wv(e){return e instanceof Hv}Uv.className="PolarChart",Uv.type="polar";var jv={type:"chart",name:"polar",options:Mv,detect:Jl,create:(e,t)=>new Uv(e,t),validate(e,t,i){const s=[],r=e?.series?.[0]?.type;"pie"!==r&&"donut"!==r||e?.axes&&(s.push(new n.Bk([],e.axes,i,"axes")),e=G(e,["axes"]));const o=(0,n.tf)(e,t,i);return o.invalid.push(...s),o}},$v={...lf,...hf(n.ai),type:(0,n.mw)((0,n.dY)("number")),label:nf,crosshair:cf(!0)},Kv={...lf,...hf(n.ai),type:(0,n.mw)((0,n.dY)("log")),base:(0,n.Uo)(n.MX,(0,n.W$)(e=>1!==e,"not equal to 1")),label:nf,crosshair:cf(!0)},Yv={...lf,...hf((0,n.or)(n.ai,n.p6),!0),type:(0,n.mw)((0,n.dY)("time")),label:sf,parentLevel:of,crosshair:cf(!0)};Yv.paddingInner=n.Ly,Yv.paddingOuter=n.Ly,Yv.groupPaddingInner=n.Ly;var qv={...lf,type:(0,n.mw)((0,n.dY)("category")),label:tf,paddingInner:n.CG,paddingOuter:n.CG,groupPaddingInner:n.CG,crosshair:cf()},Xv={...lf,type:(0,n.mw)((0,n.dY)("grouped-category")),label:tf,crosshair:cf(),paddingInner:n.CG,groupPaddingInner:n.CG,depthOptions:(0,n.J$)({label:{enabled:n.zM,avoidCollisions:n.zM,rotation:n.ai,spacing:n.ai,...n.LV},tick:{enabled:n.zM,stroke:n.yW,width:n.Ly}},"depth options objects array")},Zv={...lf,...hf((0,n.or)(n.ai,n.p6),!0),type:(0,n.mw)((0,n.dY)("unit-time")),unit:(0,n.or)((0,n.hR)(br),qg),label:sf,parentLevel:of,paddingInner:n.CG,paddingOuter:n.CG,groupPaddingInner:n.CG,crosshair:cf(!0)},Qv=(e,t)=>{const i={};for(const s of new Set([...Object.keys(e),...Object.keys(t)])){const r=e[s],o=t[s];(0,n.Qd)(r)&&(0,n.Qd)(o)?i[s]=Qv(r,o):i[s]=null!=r&&null!=o&&r!==o?(0,n.or)(r,o):r??o}return i},Jv=[Lv,{type:"axis",name:"number",chartType:"cartesian",options:$v,create:e=>new Hu(e)},{type:"axis",name:"log",chartType:"cartesian",options:Kv,create:e=>new Uu(e)},{type:"axis",name:"time",chartType:"cartesian",options:Qv(Yv,Zv),create:e=>new Wu(e)},{type:"axis",name:"category",chartType:"cartesian",options:qv,create:e=>new Mh(e)},{type:"axis",name:"grouped-category",chartType:"cartesian",options:Xv,create:e=>new Pu(e)},{type:"axis",name:"unit-time",chartType:"cartesian",options:Zv,create:e=>new $u(e)},Vf,cm,vm,Em,Rm,Fm,jv,yy,My,Ov,Fv,Gv,Bv,Vv,vv,bv,Cv],eb={isEnterprise:!1};function tb(e,t){let i=[];const s=sc(e),r=Zl(e),o=r?Qo.get(r):"unknown";for(const t of $o)if("unknown"===o||t.chartTypes.includes(o))if("root"===t.type||"legend"===t.type){const n=e[t.optionsKey];if(null==n)continue;t.optionsInnerKey?n[t.optionsInnerKey]&&(i.push(`${t.optionsKey}.${t.optionsInnerKey}`),delete n[t.optionsInnerKey]):(i.push(t.optionsKey),delete e[t.optionsKey])}else if("axis"===t.type){if(!("axes"in e)||!(0,n.cy)(e.axes)||!e.axes?.some(e=>e.type===t.identifier))continue;i.push(`axis[type=${t.identifier}]`),e.axes=e.axes.filter(e=>e.type!==t.identifier)}else if("axis-option"===t.type){if(!("axes"in e)||!(0,n.cy)(e.axes)||!e.axes?.some(e=>e[t.optionsKey]))continue;i.push(`axis.${t.optionsKey}`),e.axes.forEach(e=>{e[t.optionsKey]&&delete e[t.optionsKey]})}else if("series"===t.type){if(t.community)continue;if(!(0,n.cy)(e.series)||!e.series?.some(e=>e.type===t.identifier))continue;i.push(`series[type=${t.identifier}]`),e.series=e.series.filter(e=>e.type!==t.identifier)}else if("series-option"===t.type){if(!(0,n.cy)(e.series)||!e.series?.some(e=>e[t.optionsKey]))continue;i.push(`series.${t.optionsKey}`),e.series.forEach(e=>{e[t.optionsKey]&&delete e[t.optionsKey]})}if(i.length&&!t){s&&(i=["AgCharts.createGauge"]);let t="ag-charts-enterprise",r="https://www.ag-grid.com/charts/javascript/installation/";"integrated"===e.mode&&(t="ag-grid-charts-enterprise' or 'ag-grid-enterprise/charts-enterprise",r="https://www.ag-grid.com/javascript-data-grid/integrated-charts-installation/"),n.Vy.warnOnce([`unable to use these enterprise features as '${t}' has not been loaded:`,"",...i,"",`See: ${r}`].join("\n"))}}function ib(e){return e?.up||e?.down||e?.neutral?"user-full":e?.fills||e?.strokes?"user-indexed":"inbuilt"}var nb="white",sb={get cartesian(){return{seriesTypes:Qo.cartesianTypes,commonOptions:["zoom","navigator"]}},get polar(){return{seriesTypes:Qo.polarTypes,commonOptions:[]}},get hierarchy(){return{seriesTypes:Qo.hierarchyTypes,commonOptions:[]}},get topology(){return{seriesTypes:Qo.topologyTypes,commonOptions:[]}},get"flow-proportion"(){return{seriesTypes:Qo.flowProportionTypes,commonOptions:[]}},get standalone(){return{seriesTypes:Qo.standaloneTypes,commonOptions:[]}},get gauge(){return{seriesTypes:Qo.gaugeTypes,commonOptions:[]}}},rb={"radial-gauge":!0,"linear-gauge":!0};function ob(e){return!0===rb[e]}var ab={millisecond:"%H:%M:%S.L",second:"%H:%M:%S",minute:"%H:%M",hour:"%H:%M",day:"%e %B",month:"%B",year:"%Y"},lb="%H:%M:%S.%L",cb="%H:%M:%S",hb="%H:%M",ub="%H:%M",db=Object.values(sb).reduce((e,{commonOptions:t})=>e.concat(t),[]),pb=class e{static getDefaultColors(){return{fills:Xm,fillsFallback:Object.values(Xm),strokes:Zm,sequentialColors:mp(Xm),divergingColors:[Xm.ORANGE,Xm.YELLOW,Xm.GREEN],hierarchyColors:["#fff","#e0e5ea","#c1ccd5","#a3b4c1","#859cad"],secondSequentialColors:me.interpolate([me.fromHexString(Xm.BLUE),me.fromHexString("#cbdef5")],8).map(e=>e.toString()),secondDivergingColors:[Xm.GREEN,Xm.YELLOW,Xm.RED],secondHierarchyColors:["#fff","#c5cbd1","#a4b1bd","#8498a9","#648096"],up:{fill:Xm.GREEN,stroke:Zm.GREEN},down:{fill:Xm.RED,stroke:Zm.RED},neutral:{fill:Xm.GRAY,stroke:Zm.GRAY},altUp:{fill:Xm.BLUE,stroke:Zm.BLUE},altDown:{fill:Xm.ORANGE,stroke:Zm.ORANGE},altNeutral:{fill:Xm.GRAY,stroke:Zm.GRAY}}}static getDefaultPublicParameters(){return{accentColor:"#2196f3",axisColor:{$foregroundBackgroundMix:[.675]},backgroundColor:nb,borderColor:{$foregroundBackgroundMix:[.818]},foregroundColor:"#464646",fontFamily:"Verdana, sans-serif",fontSize:12,fontWeight:400,gridLineColor:{$foregroundBackgroundAccentMix:[.93,.085]},padding:20,subtleTextColor:{$mix:[{$ref:"textColor"},{$ref:"backgroundColor"},.38]},textColor:{$ref:"foregroundColor"},chromeBackgroundColor:{$foregroundBackgroundMix:[.975]},chromeFontFamily:{$ref:"fontFamily"},chromeFontSize:{$ref:"fontSize"},chromeFontWeight:{$ref:"fontWeight"},chromeTextColor:"#181d1f",chromeSubtleTextColor:{$mix:[{$ref:"chromeTextColor"},{$ref:"backgroundColor"},.38]},inputBackgroundColor:{$ref:"backgroundColor"},inputTextColor:{$ref:"textColor"},crosshairLabelBackgroundColor:{$ref:"foregroundColor"},crosshairLabelTextColor:{$ref:"backgroundColor"}}}static getAxisDefaults(e,{title:t,time:i}){const n="modern"===i?ab:void 0;return L(e,t&&{title:{enabled:!1,text:"Axis Title",spacing:25,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.0833333333333333]},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}}},"off"!==i&&{label:{format:{millisecond:{$if:[{$path:["../../parentLevel/enabled",{$path:"../enabled"}]},lb,n?.millisecond]},second:{$if:[{$path:["../../parentLevel/enabled",{$path:"../enabled"}]},cb,n?.second]},minute:{$if:[{$path:["../../parentLevel/enabled",{$path:"../enabled"}]},hb,n?.minute]},hour:{$if:[{$path:["../../parentLevel/enabled",{$path:"../enabled"}]},ub,n?.hour]},day:{$if:[{$path:["../../parentLevel/enabled",{$path:"../enabled"}]},"%e",n?.day]},month:{$if:[{$path:["../../parentLevel/enabled",{$path:"../enabled"}]},"%b",n?.month]},year:{$if:[{$path:["../../parentLevel/enabled",{$path:"../enabled"}]},"%Y",n?.year]}}},parentLevel:{enabled:!1,label:{enabled:{$path:"../../label/enabled"},fontSize:{$path:"../../label/fontSize"},fontFamily:{$path:"../../label/fontFamily"},fontWeight:"bold",spacing:{$path:"../../label/spacing"},color:{$path:"../../label/color"},avoidCollisions:{$path:"../../label/avoidCollisions"},format:{millisecond:{$path:["../../../label/format/millisecond",lb]},second:{$path:["../../../label/format/second",cb]},minute:{$path:["../../../label/format/minute",hb]},hour:{$path:["../../../label/format/hour",ub]},day:{$path:["../../../label/format/day","%e"]},month:{$path:["../../../label/format/month","%b"]},year:{$path:["../../../label/format/year","%Y"]}}},tick:{enabled:{$path:"../../tick/enabled"},size:{$path:"../../tick/size"},width:{$path:"../../tick/width"},stroke:{$path:"../../tick/stroke"}}}},{label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},spacing:11,color:{$ref:"textColor"},avoidCollisions:!0},line:{enabled:!0,width:1,stroke:{$ref:"axisColor"}},tick:{enabled:!1,size:6,width:1,stroke:{$ref:"axisColor"}},gridLine:{enabled:!0,style:[{stroke:{$ref:"gridLineColor"},lineDash:[]}]},crossLines:{enabled:!0,fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},fillOpacity:.1,strokeWidth:1,label:{fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},padding:5,color:{$ref:"textColor"}}}})}getChartDefaults(){return{minHeight:300,minWidth:300,background:{visible:!0,fill:{$ref:"backgroundColor"}},padding:{top:{$ref:"padding"},right:{$ref:"padding"},bottom:{$ref:"padding"},left:{$ref:"padding"}},seriesArea:{padding:{top:0,right:0,bottom:0,left:0}},keyboard:{enabled:!0},title:{enabled:!1,text:"Title",spacing:{$if:[{$path:"../subtitle/enabled"},10,20]},fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.4166666666666667]},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},wrapping:"hyphenate",layoutStyle:kd,textAlign:Pd},subtitle:{enabled:!1,text:"Subtitle",spacing:20,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.0833333333333333]},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:kd,textAlign:Pd},footnote:{enabled:!1,text:"Footnote",spacing:20,fontSize:{$rem:[1.0833333333333333]},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:kd,textAlign:Pd},legend:{position:"bottom",orientation:{$if:[{$or:[{$eq:[{$path:"./position"},"left"]},{$eq:[{$path:"./position"},"right"]}]},"vertical","horizontal"]},spacing:30,listeners:{},toggleSeries:!0,item:{paddingX:16,paddingY:8,marker:{size:15,padding:8},showSeriesStroke:!0,label:{color:{$ref:"textColor"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"}}},reverseOrder:!1,pagination:{marker:{size:12},activeStyle:{fill:{$ref:"foregroundColor"}},inactiveStyle:{fill:{$ref:"subtleTextColor"}},highlightStyle:{fill:{$ref:"foregroundColor"}},label:{color:{$ref:"textColor"}}}},tooltip:{enabled:!0,darkTheme:Dd,delay:0,pagination:!1},overlays:{darkTheme:Dd},listeners:{}}}constructor(e={}){const{overrides:t,palette:i,params:n}=Bt(e),s=this.createChartConfigPerChartType(this.getDefaults()),r={};t&&this.mergeOverrides(s,r,t);const{fills:o,strokes:a,sequentialColors:l,...c}=this.getDefaultColors();this.palette=z(L(i,{fills:Object.values(o),strokes:Object.values(a),sequentialColors:Object.values(l),...c})),this.paletteType=ib(i),this.params=L(n,this.getPublicParameters()),this.config=z(this.templateTheme(s)),this.presets=z(r)}mergeOverrides(e,t,i){for(const{seriesTypes:t,commonOptions:n}of Object.values(sb)){const s={...i.common};for(const e of db)n.includes(e)||delete s[e];for(const i of t){const t=i;ob(t)||(e[t]=L(s,e[t]))}}Qo.seriesTypes.forEach(n=>{const s=n,r=i[s];ob(s)?t[s]=r:e[s]=L(r,e[s])})}createChartConfigPerChartType(e){for(const[t,{seriesTypes:i}]of(0,n.jO)(sb)){const n=ea.get(t);for(const t of i)e[t]??(e[t]=Bt(n))}return e}getDefaults(){const t=(t,i)=>{const n={},s={axes:{},...qo.getThemeTemplates(),...this.getChartDefaults(),...ea.get(t)};for(const t of i){n[t]=L(ta.getThemeTemplate(t),n[t]??Bt(s));const{axes:i}=n[t];for(const t of jo.keys())i[t]=L(i[t],jo.getThemeTemplate(t),e.axisDefault[t])}return n};return L(t("cartesian",Qo.cartesianTypes),t("polar",Qo.polarTypes),t("hierarchy",Qo.hierarchyTypes),t("topology",Qo.topologyTypes),t("flow-proportion",Qo.flowProportionTypes),t("standalone",Qo.standaloneTypes),t("gauge",Qo.gaugeTypes))}static applyTemplateTheme(e,t,i){if((0,n.cy)(e))for(let t=0;t<e.length;t++){const n=e[t];"symbol"==typeof n&&i?.has(n)&&(e[t]=i.get(n))}else for(const t of Object.keys(e)){const n=e[t];"symbol"==typeof n&&i?.has(n)&&(e[t]=i.get(n))}}templateTheme(t,i=!0){const n=i?Bt(t):t,s=this.getTemplateParameters();return Ht(n,e.applyTemplateTheme,void 0,void 0,s),n}getDefaultColors(){return e.getDefaultColors()}getPublicParameters(){return e.getDefaultPublicParameters()}getTemplateParameters(){const e=new Map;e.set(Dd,!1),e.set(Id,"#d9d9d9"),e.set(Rd,"#00000080"),e.set($d,"#aaa"),e.set(kd,"block"),e.set(Pd,"center"),e.set(Yd,["#797b86","#e24c4a","#f49d2d","#65ab58","#409682","#4db9d2","#5090dc","#3068f9","#e24c4a","#913aac","#d93e64"]),e.set(jd,nb),e.set(Kd,Xm.BLUE),e.set(Xd,Xm.BLUE),e.set(qd,Xm.BLUE),e.set(Zd,nb),e.set(Qd,"#fafafa"),e.set(Jd,"#ddd"),e.set(ep,"#000"),e.set(tp,"#181d1f"),e.set(ip,"#e35c5c"),e.set(np,"#e35c5c"),e.set(sp,"#fafafa"),e.set(rp,"#ddd"),e.set(op,"#000"),e.set(ap,"top"),e.set(lp,!1);const t=this.getDefaultColors();return e.set(_d,this.palette.up?.stroke??t.up.stroke),e.set(Nd,this.palette.up?.fill??t.up.fill),e.set(Ld,this.palette.down?.stroke??t.down.stroke),e.set(Od,this.palette.down?.fill??t.down.fill),e.set(Fd,this.palette.neutral?.stroke??t.neutral.stroke),e.set(Gd,this.palette.neutral?.fill??t.neutral.fill),e.set(Bd,this.palette.altUp?.stroke??t.up.stroke),e.set(Hd,this.palette.altUp?.fill??t.up.fill),e.set(Vd,this.palette.altDown?.stroke??t.down.stroke),e.set(Ud,this.palette.altDown?.fill??t.down.fill),e.set(zd,this.palette.altNeutral?.fill??t.altNeutral.fill),e.set(Wd,this.palette.altNeutral?.stroke??t.altNeutral.stroke),e}};pb.axisDefault={number:pb.getAxisDefaults({keys:[],line:{enabled:!1},crosshair:{enabled:!0}},{title:!0,time:"off"}),log:pb.getAxisDefaults({keys:[],base:10,line:{enabled:!1},crosshair:{enabled:!0}},{title:!0,time:"off"}),category:pb.getAxisDefaults({keys:[],groupPaddingInner:.1,label:{autoRotate:!0},gridLine:{enabled:lp},crosshair:{enabled:!1}},{title:!0,time:"off"}),"grouped-category":pb.getAxisDefaults({keys:[],tick:{enabled:!0,stroke:Id},label:{spacing:10,rotation:270},paddingInner:.4,groupPaddingInner:.2,crosshair:{enabled:!1}},{title:!0,time:"off"}),time:pb.getAxisDefaults({keys:[],gridLine:{enabled:lp},crosshair:{enabled:!0}},{title:!0,time:"legacy"}),"ordinal-time":pb.getAxisDefaults({keys:[],groupPaddingInner:0,label:{autoRotate:!1},gridLine:{enabled:lp},crosshair:{enabled:!0}},{title:!0,time:"legacy"}),"unit-time":pb.getAxisDefaults({keys:[],groupPaddingInner:.1,label:{autoRotate:!1},gridLine:{enabled:lp},crosshair:{enabled:!0},parentLevel:{enabled:!0}},{title:!0,time:"modern"}),"angle-category":pb.getAxisDefaults({label:{spacing:5},gridLine:{enabled:lp},shape:{$path:["./shape",void 0,{$find:[{$not:[{$isOperation:"./shape"}]},{$path:".."}]}]}},{title:!1,time:"off"}),"angle-number":pb.getAxisDefaults({label:{spacing:5},gridLine:{enabled:lp}},{title:!1,time:"off"}),"radius-category":pb.getAxisDefaults({positionAngle:0,line:{enabled:!1}},{title:!0,time:"off"}),"radius-number":pb.getAxisDefaults({positionAngle:0,line:{enabled:!1},shape:{$path:["./shape",void 0,{$find:[{$not:[{$isOperation:"./shape"}]},{$path:".."}]}]}},{title:!0,time:"off"})};var gb=pb,fb="#192232",mb={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},yb={BLUE:"#74a8e6",ORANGE:"#ffbe70",GREEN:"#6cb176",CYAN:"#75d4ef",YELLOW:"#f6e559",VIOLET:"#aa86d8",GRAY:"#a1a1a1",MAGENTA:"#ce7ab9",BROWN:"#997b52",RED:"#ff7872"},vb=class extends gb{getDefaultColors(){return{fills:mb,fillsFallback:Object.values(mb),strokes:yb,sequentialColors:mp(mb),divergingColors:[mb.ORANGE,mb.YELLOW,mb.GREEN],hierarchyColors:["#192834","#253746","#324859","#3f596c","#4d6a80"],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],secondDivergingColors:[mb.GREEN,mb.YELLOW,mb.RED],secondHierarchyColors:["#192834","#3b5164","#496275","#577287","#668399"],up:{fill:mb.GREEN,stroke:yb.GREEN},down:{fill:mb.RED,stroke:yb.RED},neutral:{fill:mb.GRAY,stroke:yb.GRAY},altUp:{fill:mb.BLUE,stroke:yb.BLUE},altDown:{fill:mb.ORANGE,stroke:yb.ORANGE},altNeutral:{fill:mb.GRAY,stroke:yb.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),axisColor:{$foregroundBackgroundMix:[.263]},backgroundColor:fb,borderColor:{$foregroundBackgroundMix:[.784]},chromeBackgroundColor:{$foregroundBackgroundMix:[.93]},foregroundColor:"#fff",gridLineColor:{$foregroundBackgroundAccentMix:[.743,.01]},subtleTextColor:{$mix:[{$ref:"textColor"},{$ref:"backgroundColor"},.57]},chromeTextColor:{$ref:"textColor"},crosshairLabelBackgroundColor:{$foregroundBackgroundAccentMix:[.35,.1]}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Dd,!0),e.set(jd,fb),e.set(Id,"#7f8389"),e.set(Kd,mb.BLUE),e.set(qd,"#fff"),e.set(Xd,mb.BLUE),e.set(Zd,fb),e.set(Qd,"#28313e"),e.set(Jd,"#4b525d"),e.set(ep,"#fff"),e.set(tp,"#fff"),e.set(sp,"#28313e"),e.set(rp,"#4b525d"),e.set(op,"#fff"),e}constructor(e){super(e)}},bb={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},Cb={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},wb=class extends vb{getDefaultColors(){return{...super.getDefaultColors(),fills:{...bb},fillsFallback:Object.values({...bb}),strokes:{...Cb},sequentialColors:mp(bb),divergingColors:[bb.GREEN,bb.BLUE,bb.RED],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],up:{fill:bb.GREEN,stroke:Cb.GREEN},down:{fill:bb.RED,stroke:Cb.RED},neutral:{fill:bb.BLUE,stroke:Cb.BLUE},altUp:{fill:bb.GREEN,stroke:Cb.GREEN},altDown:{fill:bb.RED,stroke:Cb.RED},altNeutral:{fill:bb.GRAY,stroke:Cb.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),gridLineColor:{$foregroundBackgroundAccentMix:[.88,.01]},padding:0}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Kd,bb.BLUE),e.set(Xd,bb.BLUE),e.set(kd,"overlay"),e.set(Pd,"left"),e.set(ap,"bottom"),e.set(lp,!0),e}},Sb={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},xb={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},Eb=class extends gb{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Sb},fillsFallback:Object.values({...Sb}),strokes:{...xb},sequentialColors:mp(Sb),divergingColors:[Sb.GREEN,Sb.BLUE,Sb.RED],up:{fill:Sb.GREEN,stroke:xb.GREEN},down:{fill:Sb.RED,stroke:xb.RED},neutral:{fill:Sb.BLUE,stroke:xb.BLUE},altUp:{fill:Sb.GREEN,stroke:xb.GREEN},altDown:{fill:Sb.RED,stroke:xb.RED},altNeutral:{fill:Sb.GRAY,stroke:xb.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),gridLineColor:{$foregroundBackgroundAccentMix:[.94,.01]},padding:0}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Kd,Sb.BLUE),e.set(Xd,Sb.BLUE),e.set(kd,"overlay"),e.set(Pd,"left"),e.set(ap,"bottom"),e.set(lp,!0),e}},Ab={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},Mb={BLUE:"#90CAF9",ORANGE:"#FFCC80",GREEN:"#A5D6A7",CYAN:"#80DEEA",YELLOW:"#FFF9C4",VIOLET:"#B39DDB",GRAY:"#E0E0E0",MAGENTA:"#F48FB1",BROWN:"#A1887F",RED:"#EF9A9A"},Tb=class extends vb{getDefaultColors(){return{...super.getDefaultColors(),fills:Ab,fillsFallback:Object.values(Ab),strokes:Mb,sequentialColors:mp(Ab),divergingColors:[Ab.ORANGE,Ab.YELLOW,Ab.GREEN],secondSequentialColors:["#2196f3","#208FEC","#1E88E5","#1C7FDC","#1976d2","#176EC9","#1565c0"],secondDivergingColors:[Ab.GREEN,Ab.YELLOW,Ab.RED],up:{fill:Ab.GREEN,stroke:Mb.GREEN},down:{fill:Ab.RED,stroke:Mb.RED},neutral:{fill:Ab.GRAY,stroke:Mb.GRAY},altUp:{fill:Ab.BLUE,stroke:Mb.BLUE},altDown:{fill:Ab.RED,stroke:Mb.RED},altNeutral:{fill:Ab.GRAY,stroke:Mb.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Kd,Ab.BLUE),e.set(Xd,Ab.BLUE),e}},Db={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},Ib={BLUE:"#1565C0",ORANGE:"#E65100",GREEN:"#2E7D32",CYAN:"#00838F",YELLOW:"#F9A825",VIOLET:"#4527A0",GRAY:"#616161",MAGENTA:"#C2185B",BROWN:"#4E342E",RED:"#B71C1C"},Rb=class extends gb{getDefaultColors(){return{...super.getDefaultColors(),fills:Db,fillsFallback:Object.values(Db),strokes:Ib,sequentialColors:mp(Db),divergingColors:[Db.ORANGE,Db.YELLOW,Db.GREEN],secondSequentialColors:["#2196f3","#329EF4","#42a5f5","#53ADF6","#64b5f6","#7AC0F8","#90caf9"],secondDivergingColors:[Db.GREEN,Db.YELLOW,Db.RED],up:{fill:Db.GREEN,stroke:Ib.GREEN},down:{fill:Db.RED,stroke:Ib.RED},neutral:{fill:Db.GRAY,stroke:Ib.GRAY},altUp:{fill:Db.BLUE,stroke:Ib.BLUE},altDown:{fill:Db.RED,stroke:Ib.RED},altNeutral:{fill:Db.GRAY,stroke:Ib.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Kd,Db.BLUE),e.set(Xd,Db.BLUE),e}},kb={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},Pb={BLUE:"#6698ff",PURPLE:"#c0a3ff",MAGENTA:"#fc8dfc",PINK:"#ff82b1",RED:"#ff9b70",ORANGE:"#ffcf4e",YELLOW:"#ffff58",GREEN:"#58dd70",CYAN:"#51e2c9",MODERATE_BLUE:"#4fd7ff",GRAY:"#eeeeee"},_b=class extends vb{getDefaultColors(){return{fills:kb,fillsFallback:Object.values(kb),strokes:Pb,sequentialColors:mp(kb),divergingColors:[kb.BLUE,kb.RED],hierarchyColors:[],secondSequentialColors:[kb.BLUE,kb.PURPLE,kb.MAGENTA,kb.PINK,kb.RED,kb.ORANGE,kb.YELLOW,kb.GREEN],secondDivergingColors:[kb.BLUE,kb.RED],secondHierarchyColors:[],up:{fill:kb.GREEN,stroke:Pb.GREEN},down:{fill:kb.RED,stroke:Pb.RED},neutral:{fill:kb.GRAY,stroke:Pb.GRAY},altUp:{fill:kb.BLUE,stroke:Pb.BLUE},altDown:{fill:kb.RED,stroke:Pb.RED},altNeutral:{fill:kb.GRAY,stroke:Pb.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Kd,kb.BLUE),e.set(Xd,kb.BLUE),e}},Lb={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},Nb={BLUE:"#2346c9",PURPLE:"#7653d4",MAGENTA:"#a73da9",PINK:"#c32d66",RED:"#c84b1c",ORANGE:"#c87f00",YELLOW:"#c1b900",GREEN:"#008c1c",CYAN:"#00927c",MODERATE_BLUE:"#0087bb",GRAY:"#888888"},Ob=class extends gb{getDefaultColors(){return{...super.getDefaultColors(),fills:Lb,fillsFallback:Object.values(Lb),strokes:Nb,sequentialColors:mp(Lb),divergingColors:[Lb.BLUE,Lb.RED],hierarchyColors:[],secondSequentialColors:[Lb.BLUE,Lb.PURPLE,Lb.MAGENTA,Lb.PINK,Lb.RED,Lb.ORANGE,Lb.YELLOW,Lb.GREEN],secondDivergingColors:[Lb.BLUE,Lb.RED],secondHierarchyColors:[],up:{fill:Lb.GREEN,stroke:Nb.GREEN},down:{fill:Lb.RED,stroke:Nb.RED},neutral:{fill:Lb.GRAY,stroke:Nb.GRAY},altUp:{fill:Lb.BLUE,stroke:Nb.BLUE},altDown:{fill:Lb.RED,stroke:Nb.RED},altNeutral:{fill:Lb.GRAY,stroke:Nb.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Kd,Lb.BLUE),e.set(Xd,Lb.BLUE),e}},Fb={BLUE:"#4472C4",ORANGE:"#ED7D31",GRAY:"#A5A5A5",YELLOW:"#FFC000",MODERATE_BLUE:"#5B9BD5",GREEN:"#70AD47",DARK_GRAY:"#7B7B7B",DARK_BLUE:"#264478",VERY_DARK_GRAY:"#636363",DARK_YELLOW:"#997300"},Gb={BLUE:"#6899ee",ORANGE:"#ffa55d",GRAY:"#cdcdcd",YELLOW:"#ffea53",MODERATE_BLUE:"#82c3ff",GREEN:"#96d56f",DARK_GRAY:"#a1a1a1",DARK_BLUE:"#47689f",VERY_DARK_GRAY:"#878787",DARK_YELLOW:"#c0993d"},Bb=class extends vb{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Fb,RED:Fb.ORANGE},fillsFallback:Object.values({...Fb,RED:Fb.ORANGE}),strokes:{...Gb,RED:Gb.ORANGE},sequentialColors:mp({...Fb,RED:Fb.ORANGE}),divergingColors:[Fb.ORANGE,Fb.YELLOW,Fb.GREEN],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],secondDivergingColors:[Fb.GREEN,Fb.YELLOW,Fb.ORANGE],up:{fill:Fb.GREEN,stroke:Gb.GREEN},down:{fill:Fb.ORANGE,stroke:Gb.ORANGE},neutral:{fill:Fb.GRAY,stroke:Gb.GRAY},altUp:{fill:Fb.BLUE,stroke:Gb.BLUE},altDown:{fill:Fb.ORANGE,stroke:Gb.ORANGE},altNeutral:{fill:Fb.GRAY,stroke:Gb.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Kd,Fb.BLUE),e.set(Xd,Fb.BLUE),e}},Vb={BLUE:"#5281d5",ORANGE:"#ff8d44",GRAY:"#b5b5b5",YELLOW:"#ffd02f",MODERATE_BLUE:"#6aabe6",GREEN:"#7fbd57",DARK_GRAY:"#8a8a8a",DARK_BLUE:"#335287",VERY_DARK_GRAY:"#717171",DARK_YELLOW:"#a98220"},Hb={BLUE:"#214d9b",ORANGE:"#c25600",GRAY:"#7f7f7f",YELLOW:"#d59800",MODERATE_BLUE:"#3575ac",GREEN:"#4b861a",DARK_GRAY:"#575757",DARK_BLUE:"#062253",VERY_DARK_GRAY:"#414141",DARK_YELLOW:"#734f00"},Ub=class extends gb{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Vb,RED:Vb.ORANGE},fillsFallback:Object.values({...Vb,RED:Vb.ORANGE}),strokes:{...Hb,RED:Hb.ORANGE},sequentialColors:mp({...Vb,RED:Vb.ORANGE}),divergingColors:[Vb.ORANGE,Vb.YELLOW,Vb.GREEN],secondSequentialColors:["#5090dc","#629be0","#73a6e3","#85b1e7","#96bcea","#a8c8ee","#b9d3f1","#cbdef5"],secondDivergingColors:[Vb.GREEN,Vb.YELLOW,Vb.ORANGE],secondHierarchyColors:[],up:{fill:Vb.GREEN,stroke:Hb.GREEN},down:{fill:Vb.ORANGE,stroke:Hb.ORANGE},neutral:{fill:Hb.GRAY,stroke:Hb.GRAY},altUp:{fill:Vb.BLUE,stroke:Hb.BLUE},altDown:{fill:Vb.ORANGE,stroke:Hb.ORANGE},altNeutral:{fill:Vb.GRAY,stroke:Hb.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Kd,Vb.BLUE),e.set(Xd,Vb.BLUE),e}},zb={...lf,type:(0,n.mw)((0,n.dY)("ordinal-time")),paddingInner:n.CG,paddingOuter:n.CG,groupPaddingInner:n.CG,label:sf,parentLevel:of,interval:hf((0,n.or)(n.ai,n.p6),!0).interval,crosshair:cf(!0)},Wb={...af,...hf(n.ai),type:(0,n.mw)((0,n.dY)("angle-number")),crossLines:(0,n.J$)(Qg),startAngle:n.ai,endAngle:n.ai,label:{...ef,orientation:(0,n.KC)("fixed","parallel","perpendicular"),format:Xg}},jb={innerRadiusRatio:n.CG},$b={...af,...jb,type:(0,n.mw)((0,n.dY)("angle-category")),shape:(0,n.KC)("polygon","circle"),crossLines:(0,n.J$)(Qg),startAngle:n.ai,endAngle:n.ai,paddingInner:n.CG,groupPaddingInner:n.CG,label:{...ef,orientation:(0,n.KC)("fixed","parallel","perpendicular")}},Kb={...af,...hf(n.ai),type:(0,n.mw)((0,n.dY)("radius-number")),shape:(0,n.KC)("polygon","circle"),positionAngle:n.ai,innerRadiusRatio:n.CG,crossLines:(0,n.J$)({...Qg,label:{...Zg,positionAngle:n.ai}},"cross-line options"),title:{enabled:n.zM,text:n.Yj,spacing:n.Ly,formatter:n.E2,...n.LV},label:{...ef,format:Xg}},Yb={...af,type:(0,n.mw)((0,n.dY)("radius-category")),positionAngle:n.ai,innerRadiusRatio:n.CG,paddingInner:n.CG,paddingOuter:n.CG,groupPaddingInner:n.CG,label:ef,crossLines:(0,n.J$)({...Qg,label:{...Zg,positionAngle:n.ai}},"cross-line options"),title:{enabled:n.zM,text:n.Yj,spacing:n.Ly,formatter:n.E2,...n.LV}},qb={lineStyle:(0,n.KC)("solid","dashed","dotted"),...n.mL},Xb={...n.Fu,...n.AF,...n.mL},Zb={visible:n.zM,locked:n.zM,handle:Xb,...n.LV},Qb={position:(0,n.KC)("top","center","bottom"),alignment:(0,n.KC)("left","center","right"),...n.LV},Jb={position:(0,n.KC)("top","inside","bottom"),alignment:(0,n.KC)("left","center","right"),...n.LV},eC={enabled:n.zM,cornerRadius:n.Ly,formatter:n.E2,...n.LV,...n.Fu,...n.AF,...n.mL},tC={visible:n.zM,...qb,...n.AF},iC={divider:n.AF,...n.Fu,...n.AF,...n.LV},nC={handle:Xb,statistics:iC,...qb,...n.Fu,...n.AF},sC={visible:n.zM,locked:n.zM,extendStart:n.zM,extendEnd:n.zM,handle:Xb,text:Qb,...qb,...n.AF},rC={visible:n.zM,locked:n.zM,axisLabel:eC,handle:Xb,text:Qb,...qb,...n.AF},oC={visible:n.zM,locked:n.zM,extendStart:n.zM,extendEnd:n.zM,handle:Xb,text:Jb,background:n.Fu,...qb,...n.AF},aC={...oC},lC={...oC,middle:tC},cC={label:n.LV,showFill:n.zM,isMultiColor:n.zM,strokes:(0,n.jk)(n.yW),rangeStroke:n.yW,bands:(0,n.KC)(4,6,10),...sC},hC={...n.Fu,...n.AF,...Zb},uC={...n.Fu,...n.AF,...Zb},dC={...n.Fu,...n.AF,...Zb,background:{...n.Fu,...n.AF}},pC={visible:n.zM,locked:n.zM,handle:Xb,...n.Fu},gC={visible:n.zM,locked:n.zM,extendStart:n.zM,extendEnd:n.zM,handle:Xb,text:Qb,background:n.Fu,statistics:iC,...qb,...n.AF},fC={visible:n.zM,up:nC,down:nC},mC={enabled:n.zM,axesButtons:{enabled:n.zM,axes:(0,n.KC)("x","y","xy")},toolbar:{enabled:n.zM,padding:n.Ly,buttons:(0,n.J$)({...Af,value:(0,n.KC)("line-menu","fibonacci-menu","text-menu","shape-menu","measurer-menu","line","horizontal-line","vertical-line","parallel-channel","disjoint-channel","fibonacci-retracement","fibonacci-retracement-trend-based","text","comment","callout","note","clear")},"annotation toolbar buttons array")},optionsToolbar:{enabled:n.zM,buttons:(0,n.jk)((0,n.or)((0,n.fd)({...Af,value:(0,n.mw)((0,n.KC)("line-stroke-width","line-style-type","line-color","fill-color","text-color","text-size","delete","settings"))}),(0,n.fd)({...Af,value:(0,n.mw)((0,n.KC)("lock")),checkedOverrides:Af})))}};mC.data=(0,n._L)(n.YO),mC.xKey=(0,n._L)(n.Yj),mC.volumeKey=(0,n._L)(n.Yj),mC.snap=(0,n._L)(n.zM);var yC={direction:(0,n.KC)("horizontal","vertical"),showInMiniChart:n.zM,cornerRadius:n.Ly,itemStyler:(0,n.YI)({...n.Fu,...n.AF,...n.mL,cornerRadius:n.Ly,whisker:{...n.AF,...n.mL},cap:{lengthRatio:n.CG}}),whisker:{...n.AF,...n.mL},cap:{lengthRatio:n.CG},tooltip:Lf,...Tf,...n.Fu,...n.AF,...n.mL},vC={cornerRadius:n.Ly,wick:{...n.AF,...n.mL},...n.Fu,...n.AF,...n.mL},bC={item:{up:vC,down:vC},itemStyler:(0,n.YI)({...n.Fu,...n.AF,...n.mL,cornerRadius:n.Ly,wick:{...n.AF,...n.mL}}),showInMiniChart:n.zM,tooltip:Lf,...Tf},CC={fills:(0,n.jk)(n.Jp),strokes:(0,n.jk)(n.yW),label:{spacing:n.Ly,maxWidth:n.Ly,...Rf},link:{tension:n.CG,itemStyler:(0,n.YI)({...n.Fu,...n.AF,...n.mL,tension:n.CG}),...n.Fu,...n.AF,...n.mL},node:{width:n.Ly,spacing:n.Ly,itemStyler:(0,n.YI)({...n.Fu,...n.AF,...n.mL}),...n.Fu,...n.AF,...n.mL},tooltip:Lf,...Tf},wC={direction:(0,n.KC)("horizontal","vertical"),fills:(0,n.jk)(n.Jp),strokes:(0,n.jk)(n.yW),showInMiniChart:n.zM,label:{spacing:n.Ly,placement:(0,n.KC)("before","middle","after"),...Rf},stageLabel:{rotation:n.ai,spacing:n.Ly,minSpacing:n.Ly,placement:(0,n.KC)("before","after"),avoidCollisions:n.zM,itemStyler:(0,n.YI)({...n.LV,spacing:n.ai}),format:n.Yj,...Rf},tooltip:Lf,...Tf,...G(n.Fu,["fill"]),...G(n.AF,["stroke"]),...n.mL},SC={direction:(0,n.KC)("horizontal","vertical"),fills:(0,n.jk)(n.Jp),strokes:(0,n.jk)(n.yW),showInMiniChart:n.zM,itemStyler:(0,n.YI)({...n.Fu,...n.AF,...n.mL}),spacingRatio:n.CG,crisp:n.zM,dropOff:{enabled:n.zM,...n.Fu,...n.AF,...n.mL},stageLabel:{rotation:n.ai,spacing:n.Ly,minSpacing:n.Ly,placement:(0,n.KC)("before","after"),avoidCollisions:n.zM,itemStyler:(0,n.YI)({...n.LV,spacing:n.ai}),format:n.Yj,...Rf},label:Rf,tooltip:Lf,shadow:Nf,...Tf,...G(n.Fu,["fill"]),...G(n.AF,["stroke"]),...n.mL},xC={title:n.Yj,textAlign:(0,n.KC)("left","center","right"),verticalAlign:(0,n.KC)("top","middle","bottom"),itemPadding:n.Ly,itemStyler:(0,n.YI)({...n.Fu,...n.AF}),showInMiniChart:n.zM,label:kf,tooltip:Lf,...Tf,...n.AF},EC={showInMiniChart:n.zM,itemStyler:(0,n.YI)({...n.AF,...n.mL}),item:{up:{...n.AF,...n.mL},down:{...n.AF,...n.mL}},tooltip:Lf,...Tf},AC={maxStrokeWidth:n.Ly,itemStyler:(0,n.YI)({...n.AF,...n.mL}),sizeDomain:(0,n.jk)(n.Ly),label:Rf,tooltip:Lf,...Tf,...n.AF,...n.mL,highlightStyle:{...Tf.highlightStyle,...n.AF}},MC={...n.AF,...n.mL},TC={colorRange:(0,n.jk)(n.yW),maxSize:n.Ly,sizeDomain:(0,n.jk)(n.Ly),label:{placement:(0,n.KC)("top","bottom","left","right"),...Rf},tooltip:Lf,...Tf,...G(If,["enabled"]),highlightStyle:{...Tf.highlightStyle,...n.Fu,...n.AF}},DC={colorRange:(0,n.jk)(n.yW),padding:n.Ly,itemStyler:(0,n.YI)({...n.Fu,...n.AF,...n.mL}),label:kf,tooltip:Lf,...Tf,...n.Fu,...n.AF,...n.mL,highlightStyle:{...Tf.highlightStyle,...n.Fu,...n.AF}},IC={...Tf,...n.Fu,...n.AF,...n.mL},RC={cornerRadius:n.Ly,itemStyler:(0,n.YI)({...n.Fu,...n.AF,...n.mL,cornerRadius:n.Ly}),label:Rf,tooltip:Lf,...Tf,...n.Fu,...n.AF,...n.mL},kC={direction:(0,n.KC)("horizontal","vertical"),aspectRatio:n.Ly,spacing:n.Ly,reverse:n.zM,itemStyler:(0,n.YI)({...n.Fu,...n.AF,...n.mL}),fills:(0,n.jk)(n.Jp),strokes:(0,n.jk)(n.yW),label:Rf,stageLabel:{spacing:n.Ly,placement:(0,n.KC)("before","after"),...Rf},tooltip:Lf,shadow:Nf,...Tf,...G(n.Fu,["fill"]),...G(n.AF,["stroke"]),...n.mL},PC={connectMissingData:n.zM,marker:If,label:Rf,tooltip:Lf,...Tf,...n.Fu,...n.AF,...n.mL},_C={connectMissingData:n.zM,marker:If,label:Rf,tooltip:Lf,...Tf,...n.AF,...n.mL},LC={cornerRadius:n.Ly,itemStyler:(0,n.YI)({...n.Fu,...n.AF,...n.mL,cornerRadius:n.Ly}),label:Rf,tooltip:Lf,...Tf,...n.Fu,...n.AF,...n.mL},NC={cornerRadius:n.Ly,columnWidthRatio:n.CG,maxColumnWidthRatio:n.CG,itemStyler:(0,n.YI)({...n.Fu,...n.AF,...n.mL,cornerRadius:n.Ly}),label:Rf,tooltip:Lf,...Tf,...n.Fu,...n.AF,...n.mL},OC={showInMiniChart:n.zM,connectMissingData:n.zM,interpolation:Of,label:{...Rf,padding:n.Ly,placement:(0,n.KC)("inside","outside")},marker:If,tooltip:Lf,shadow:Nf,...Tf,...n.Fu,...n.AF,...n.mL},FC={direction:(0,n.KC)("horizontal","vertical"),showInMiniChart:n.zM,cornerRadius:n.Ly,itemStyler:(0,n.YI)({...n.Fu,...n.AF,...n.mL,cornerRadius:n.Ly}),label:{...Rf,padding:n.Ly,placement:(0,n.KC)("inside","outside")},tooltip:Lf,shadow:Nf,...Tf,...n.Fu,...n.AF,...n.mL},GC={fills:(0,n.jk)(n.Jp),strokes:(0,n.jk)(n.yW),label:{...Rf,spacing:n.Ly},link:{itemStyler:(0,n.YI)({...n.Fu,...n.AF,...n.mL}),...n.Fu,...n.AF,...n.mL},node:{width:n.Ly,spacing:n.Ly,alignment:(0,n.KC)("left","center","right","justify"),itemStyler:(0,n.YI)({...n.Fu,...n.AF,...n.mL}),...n.Fu,...n.AF,...n.mL},tooltip:Lf,...Tf},BC={fills:(0,n.jk)(n.Jp),strokes:(0,n.jk)(n.yW),colorRange:(0,n.jk)(n.yW),sectorSpacing:n.Ly,cornerRadius:n.Ly,padding:n.Ly,itemStyler:(0,n.YI)({...n.Fu,...n.AF}),label:{spacing:n.Ly,...kf},secondaryLabel:kf,tooltip:Lf,...Tf,...G(n.Fu,["fill"]),...G(n.AF,["stroke"]),highlightStyle:{label:{color:n.yW},secondaryLabel:{color:n.yW},...n.Fu,...n.AF}},VC={fills:(0,n.jk)(n.Jp),strokes:(0,n.jk)(n.yW),colorRange:(0,n.jk)(n.yW),itemStyler:(0,n.YI)({...n.Fu,...n.AF}),group:{gap:n.Ly,padding:n.Ly,cornerRadius:n.Ly,textAlign:(0,n.KC)("left","center","right"),interactive:n.zM,label:{...Rf,spacing:n.Ly},...n.Fu,...n.AF},tile:{gap:n.Ly,padding:n.Ly,cornerRadius:n.Ly,textAlign:(0,n.KC)("left","center","right"),verticalAlign:(0,n.KC)("top","middle","bottom"),label:{...Rf,spacing:n.Ly,lineHeight:n.Ly,minimumFontSize:n.Ly,wrapping:(0,n.KC)("never","always","hyphenate","on-space"),overflowStrategy:(0,n.KC)("ellipsis","hide")},secondaryLabel:{...Rf,lineHeight:n.Ly,minimumFontSize:n.Ly,wrapping:(0,n.KC)("never","always","hyphenate","on-space"),overflowStrategy:(0,n.KC)("ellipsis","hide")},...n.Fu,...n.AF},tooltip:Lf,...Tf,highlightStyle:{group:{label:{color:n.yW},...n.Fu,...n.AF},tile:{label:{color:n.yW},secondaryLabel:{color:n.yW},...n.Fu,...n.AF}}},HC={name:n.Yj,cornerRadius:n.Ly,itemStyler:(0,n.YI)({...n.Fu,...n.AF,...n.mL,cornerRadius:n.Ly}),label:{...Rf,padding:n.Ly,placement:(0,n.KC)("inside-start","inside-center","inside-end","outside-start","outside-end")},tooltip:Lf,shadow:Nf,...n.Fu,...n.AF,...n.mL},UC={direction:(0,n.KC)("horizontal","vertical"),showInMiniChart:n.zM,item:{positive:HC,negative:HC,total:HC},line:{enabled:n.zM,...n.AF,...n.mL},tooltip:Lf,...Tf},zC=(0,n.fd)({__type:(0,n.mw)((0,n.dY)("date")),value:(0,n.or)(n.Yj,n.ai)},"a serializable date object"),WC={width:n.Ly,height:n.Ly,grip:n.zM,fill:n.yW,stroke:n.yW,strokeWidth:n.Ly,cornerRadius:n.Ly},jC={enabled:n.zM,height:n.Ly,spacing:n.Ly,cornerRadius:n.ai,mask:{fill:n.yW,fillOpacity:n.CG,stroke:n.yW,strokeWidth:n.Ly},minHandle:WC,maxHandle:WC,miniChart:{enabled:n.zM,padding:{top:n.Ly,bottom:n.Ly},label:{enabled:n.zM,avoidCollisions:n.zM,spacing:n.Ly,format:Xg,formatter:n.E2,interval:{minSpacing:n.Ly,maxSpacing:n.Ly,values:n.YO,step:n.ai},...n.LV},series:n.sw}},$C={number:{...G($v,["type","crossLines"]),top:G($v,["type","crossLines","position"]),right:G($v,["type","crossLines","position"]),bottom:G($v,["type","crossLines","position"]),left:G($v,["type","crossLines","position"]),crossLines:G(Jg,["type"])},log:{...G(Kv,["type","crossLines"]),top:G(Kv,["type","crossLines","position"]),right:G(Kv,["type","crossLines","position"]),bottom:G(Kv,["type","crossLines","position"]),left:G(Kv,["type","crossLines","position"]),crossLines:G(Jg,["type"])},category:{...G(qv,["type","crossLines"]),top:G(qv,["type","crossLines","position"]),right:G(qv,["type","crossLines","position"]),bottom:G(qv,["type","crossLines","position"]),left:G(qv,["type","crossLines","position"]),crossLines:G(Jg,["type"])},time:{...G(Yv,["type","crossLines"]),top:G(Yv,["type","crossLines","position"]),right:G(Yv,["type","crossLines","position"]),bottom:G(Yv,["type","crossLines","position"]),left:G(Yv,["type","crossLines","position"]),crossLines:G(Jg,["type"])},"grouped-category":{...G(Xv,["type"]),top:G(Xv,["type","position"]),right:G(Xv,["type","position"]),bottom:G(Xv,["type","position"]),left:G(Xv,["type","position"]),crossLines:G(Jg,["type"])},"unit-time":{...G(Zv,["type","crossLines"]),top:G(Zv,["type","crossLines","position"]),right:G(Zv,["type","crossLines","position"]),bottom:G(Zv,["type","crossLines","position"]),left:G(Zv,["type","crossLines","position"]),crossLines:G(Jg,["type"])},"ordinal-time":{...G(zb,["type","crossLines"]),top:G(zb,["type","crossLines","position"]),right:G(zb,["type","crossLines","position"]),bottom:G(zb,["type","crossLines","position"]),left:G(zb,["type","crossLines","position"]),crossLines:G(Jg,["type"])}},KC={"angle-category":{...G($b,["type","crossLines"]),crossLines:G(Qg,["type"])},"angle-number":{...G(Wb,["type","crossLines"]),crossLines:G(Qg,["type"])},"radius-category":{...G(Yb,["type","crossLines"]),crossLines:{...G(Qg,["type"]),label:{...Zg,positionAngle:n.ai}}},"radius-number":{...G(Kb,["type","crossLines"]),crossLines:{...G(Qg,["type"]),label:{...Zg,positionAngle:n.ai}}}},YC={visible:n.zM};function qC(e,t){const i={};for(const n of Reflect.ownKeys(e))i[n]=t(e[n],n,e);return i}var XC=qC({common:{...Mf,navigator:jC,axes:{...$C,...KC},annotations:{...mC,line:sC,"horizontal-line":rC,"vertical-line":rC,"disjoint-channel":aC,"parallel-channel":lC,"fibonacci-retracement":cC,"fibonacci-retracement-trend-based":cC,callout:hC,comment:uC,note:dC,text:Zb,arrow:sC,"arrow-up":pC,"arrow-down":pC,"date-range":gC,"price-range":gC,"date-price-range":gC,"quick-date-price-range":fC},chartToolbar:{enabled:n.zM},initialState:{legend:(0,n.J$)({visible:n.zM,seriesId:n.Yj,itemId:n.Yj,legendItemName:n.Yj},"legend state array"),zoom:{rangeX:{start:(0,n.or)(n.ai,zC),end:(0,n.or)(n.ai,zC)},rangeY:{start:(0,n.or)(n.ai,zC),end:(0,n.or)(n.ai,zC)},ratioX:{start:n.CG,end:n.CG},ratioY:{start:n.CG,end:n.CG},autoScaledAxes:(0,n.jk)((0,n.dY)("y"))}}},line:{...Mf,axes:$C,series:Tm,navigator:jC,...YC},scatter:{...Mf,axes:$C,series:Lm,navigator:jC,...YC},bubble:{...Mf,axes:$C,series:fm,navigator:jC,...YC},area:{...Mf,axes:$C,series:Ff,navigator:jC,...YC},bar:{...Mf,axes:$C,series:om,navigator:jC,...YC},"box-plot":{...Mf,axes:$C,series:yC,navigator:jC,...YC},candlestick:{...Mf,axes:$C,series:bC,navigator:jC,...YC},"cone-funnel":{...Mf,axes:$C,series:wC,navigator:jC,...YC},funnel:{...Mf,axes:$C,series:SC,navigator:jC,...YC},ohlc:{...Mf,axes:$C,series:EC,navigator:jC,...YC},histogram:{...Mf,axes:G($C,["category","grouped-category","ordinal-time","unit-time"]),series:wm,navigator:jC,...YC},heatmap:{...Mf,axes:$C,series:xC,navigator:jC,...YC},waterfall:{...Mf,axes:$C,series:UC,navigator:jC,...YC},"range-bar":{...Mf,axes:$C,series:FC,navigator:jC,...YC},"range-area":{...Mf,axes:$C,series:OC,navigator:jC,...YC},donut:{...Mf,series:gy,navigator:jC,...YC},pie:{...Mf,series:dy,navigator:jC,...YC},"radar-line":{...Mf,axes:KC,series:_C,navigator:jC,...YC},"radar-area":{...Mf,axes:KC,series:PC,navigator:jC,...YC},"radial-bar":{...Mf,axes:KC,series:LC,navigator:jC,...YC},"radial-column":{...Mf,axes:KC,series:NC,navigator:jC,...YC},nightingale:{...Mf,axes:KC,series:RC,navigator:jC,...YC},sunburst:{...Mf,series:BC,navigator:jC,...YC},treemap:{...Mf,series:VC,navigator:jC,...YC},"map-shape":{...Mf,series:DC,navigator:jC,...YC},"map-line":{...Mf,series:AC,navigator:jC,...YC},"map-marker":{...Mf,series:TC,navigator:jC,...YC},"map-shape-background":{...Mf,series:IC,navigator:jC,...YC},"map-line-background":{...Mf,series:MC,navigator:jC,...YC},sankey:{...Mf,series:GC,navigator:jC,...YC},chord:{...Mf,series:CC,navigator:jC,...YC},pyramid:{...Mf,series:kC,navigator:jC,...YC},"radial-gauge":{...Mf,...Hy,targets:G(Gy,["value"]),tooltip:{...Hy.tooltip,...Mf.tooltip}},"linear-gauge":{...Mf,...By,targets:G(Fy,["value"]),tooltip:{...By.tooltip,...Mf.tooltip}}},function e(t,i){if((0,n.Bm)(i))return t;if((0,n.Tn)(t))return(0,n.or)(t,n.I_,n.Bm);if((0,n.Gv)(t))return(0,n.or)((0,n.fd)(n.ie in t?qC(t,t=>(0,n.Gv)(t)?qC(t,e):t):qC(t,e)),n.I_,n.Bm);throw new Error(`Invalid theme override value: ${String(t)}`)}),ZC={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},QC={BLUE:"#67b7ff",ORANGE:"#ffc24d",GREEN:"#5cc86f",CYAN:"#54ebff",VIOLET:"#fff653",YELLOW:"#c18aff",GRAY:"#aeaeae",MAGENTA:"#f078d4",BROWN:"#ba8438",RED:"#ff726e"},JC=class extends vb{getDefaultColors(){return{fills:ZC,fillsFallback:Object.values(ZC),strokes:QC,sequentialColors:mp(ZC),divergingColors:[ZC.ORANGE,ZC.YELLOW,ZC.GREEN],hierarchyColors:[],secondSequentialColors:["#0083ff","#0076e6","#0069cc","#005cb3","#004f99","#004280","#003466","#00274c"],secondDivergingColors:[ZC.GREEN,ZC.YELLOW,ZC.RED],secondHierarchyColors:[],up:{fill:ZC.GREEN,stroke:QC.GREEN},down:{fill:ZC.RED,stroke:QC.RED},neutral:{fill:ZC.GRAY,stroke:QC.GRAY},altUp:{fill:ZC.BLUE,stroke:QC.BLUE},altDown:{fill:ZC.ORANGE,stroke:QC.ORANGE},altNeutral:{fill:ZC.GRAY,stroke:QC.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Kd,ZC.BLUE),e.set(Xd,ZC.BLUE),e}},ew={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},tw={BLUE:"#0f68c0",ORANGE:"#d47100",GREEN:"#007922",CYAN:"#009ac2",VIOLET:"#bca400",YELLOW:"#753cac",GRAY:"#646464",MAGENTA:"#9b2685",BROWN:"#6c3b00",RED:"#cb0021"},iw=class extends gb{getDefaultColors(){return{...super.getDefaultColors(),fills:ew,fillsFallback:Object.values(ew),strokes:tw,sequentialColors:mp(ew),divergingColors:[ew.ORANGE,ew.YELLOW,ew.GREEN],hierarchyColors:[],secondSequentialColors:["#0083ff","#1a8fff","#339cff","#4da8ff","#66b5ff","#80c1ff","#99cdff","#b3daff"],secondDivergingColors:[ew.GREEN,ew.YELLOW,ew.RED],secondHierarchyColors:[],up:{fill:ew.GREEN,stroke:tw.GREEN},down:{fill:ew.RED,stroke:tw.RED},neutral:{fill:ew.GRAY,stroke:tw.GRAY},altUp:{fill:ew.BLUE,stroke:tw.BLUE},altDown:{fill:ew.ORANGE,stroke:tw.ORANGE},altNeutral:{fill:ew.GRAY,stroke:tw.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Kd,ew.BLUE),e.set(Xd,ew.BLUE),e}},nw=Ph(()=>new gb),sw=v.create(!0,"perf"),rw=(e,t,i)=>{sw("[CACHE] ChartTheme",e,t.name,i)},ow={"ag-default-dark":Ph(()=>new vb),"ag-sheets-dark":Ph(()=>new Bb,rw),"ag-polychroma-dark":Ph(()=>new _b,rw),"ag-vivid-dark":Ph(()=>new JC,rw),"ag-material-dark":Ph(()=>new Tb,rw),"ag-financial-dark":Ph(()=>new wb,rw),"ag-default":nw,"ag-sheets":Ph(()=>new Ub,rw),"ag-polychroma":Ph(()=>new Ob,rw),"ag-vivid":Ph(()=>new iw,rw),"ag-material":Ph(()=>new Rb,rw),"ag-financial":Ph(()=>new Eb,rw)},aw=Ph(function(e){if(e instanceof gb)return e;if(!function(e){const{invalid:t}=(0,n.tf)({theme:e},{theme:(0,n.or)(cw,n.Ik)});for(const e of t)n.Vy.warnOnce(String(e));return 0===t.length}(e))return nw();if(null==e||"string"==typeof e){const t=ow[e??"ag-default"];if(t)return t();throw new Error(`Cannot find theme \`${e}\`.`)}const{cleared:t,invalid:i}=(0,n.tf)(function(e){if(!(0,n.Gv)(e)||!(0,n.Gv)(e.baseTheme))return e;let t,i,s=e;const r=[];for(;"object"==typeof s;)t??(t=s.palette),i??(i=s.params),s.overrides&&r.push(s.overrides),s=s.baseTheme;return{baseTheme:s,overrides:L(...r),params:i,palette:t}}(e),lw,"theme");for(const e of i)n.Vy.warnOnce(String(e));const s=t?.baseTheme?aw(t.baseTheme):nw();return t?new s.constructor(t):s},rw),lw={baseTheme:(0,n.or)(n.Yj,n.Ik),overrides:XC,params:{accentColor:n.yW,axisColor:n.yW,backgroundColor:n.yW,borderColor:n.yW,foregroundColor:n.yW,fontFamily:n.jj,fontSize:n.ai,fontWeight:(0,n.or)(n.Yj,n.ai),gridLineColor:n.yW,padding:n.ai,subtleTextColor:n.yW,textColor:n.yW,chromeBackgroundColor:n.yW,chromeFontFamily:n.jj,chromeFontSize:n.ai,chromeFontWeight:(0,n.or)(n.Yj,n.ai),chromeSubtleTextColor:n.yW,chromeTextColor:n.yW,inputBackgroundColor:n.yW,inputTextColor:n.yW,crosshairLabelBackgroundColor:n.yW,crosshairLabelTextColor:n.yW},palette:{fills:(0,n.jk)(n.Jp),strokes:(0,n.jk)(n.yW),up:{fill:(0,n.or)(n.yW,n.MP),stroke:n.yW},down:{fill:(0,n.or)(n.yW,n.MP),stroke:n.yW},neutral:{fill:(0,n.or)(n.yW,n.MP),stroke:n.yW}}},cw=(0,n.KC)("ag-default","ag-default-dark","ag-sheets","ag-sheets-dark","ag-polychroma","ag-polychroma-dark","ag-vivid","ag-vivid-dark","ag-material","ag-material-dark","ag-financial","ag-financial-dark"),hw=e=>`'${e}'`,uw=class e{constructor(t,i,n,s,r,o,a=!1){this.themeParameters={},this.optionMetadata=r??{},this.processedOverrides=n??{};let l,c,h,u,d,p,g,f=null;t instanceof e?(f=t,this.specialOverrides=f.specialOverrides,void 0===o&&(o=Ft(f.userOptions,i,e.JSON_DIFF_OPTS)),this.userOptions=Bt(N(o,f.userOptions),{...e.OPTIONS_CLONE_OPTS,seen:[]})):(this.userOptions=Bt(t??i,{...e.OPTIONS_CLONE_OPTS,seen:[]}),this.specialOverrides=this.specialOverridesDefaults({...s})),a&&this.removeLeftoverSymbols(this.userOptions),!a&&void 0!==o&&e.isFastPathDelta(o)&&null!=f?(({activeTheme:l,processedOptions:c,defaultAxes:h,fastDelta:u}=this.fastSetup(o,f)),d=f.themeParameters,p=f.annotationThemes):(e.perfDebug("ChartOptions.slowSetup()"),({activeTheme:l,processedOptions:c,defaultAxes:h,themeParameters:d,annotationThemes:p,googleFonts:g}=this.slowSetup(n,o,a))),this.activeTheme=l,this.processedOptions=c,this.defaultAxes=h,this.fastDelta=u??void 0,this.themeParameters=d,this.annotationThemes=p,this.googleFonts=g,v.inDevelopmentMode(()=>z(this))}static isFastPathDelta(t){for(const i of Object.keys(t??{}))if(!this.FAST_PATH_OPTIONS.has(i))return e.perfDebug("ChartOptions.isFastPathDelta() - slow path required due to presence of: ",i),!1;return e.perfDebug("ChartOptions.isFastPathDelta() - fast path possible."),!0}fastSetup(t,i){const{activeTheme:s,defaultAxes:r,processedOptions:o}=i,{presetType:a}=this.optionMetadata;if(null!=a&&null!=t?.data){const e=n.sy.getPresetModule(a);if(e?.processData){const{series:i,data:n}=e.processData(t.data);t=L({series:i,data:n},t)}}this.fastSeriesSetup(t,o);const l=L(t,o);return e.debug("ChartOptions.fastSetup() - processed options",l),{activeTheme:s,defaultAxes:r,processedOptions:l,fastDelta:t}}fastSeriesSetup(e,t){e?.series&&(e.series?.every((e,i)=>Gt(e,t.series?.[i]??{}))?delete e.series:e.series=e.series.map((e,i)=>N(e,t.series?.[i]??{})))}slowSetup(t,i,s=!1){let r=Bt(this.userOptions,e.OPTIONS_CLONE_OPTS);i&&(r=L(i,r),s&&this.removeLeftoverSymbols(r));const{presetType:o}=this.optionMetadata;if(null!=o){const t=n.sy.getPresetModule(o);if(t){const{validate:i=n.tf}=t,s=r,o=r.type,a=null!=o?aw(r.theme).presets[o]:void 0,{cleared:l,invalid:c}=i(s,t.options,"");c.forEach(e=>n.Vy.warn(e)),(0,n.eh)(c,"")?r={}:(e.debug(">>> AgCharts.createOrUpdate() - applying preset",l),r=t.create(l,a,()=>this.activeTheme))}}this.soloSeriesIntegrity(r),eb.isEnterprise||tb(r);const a=aw(r.theme);if(null!=o&&a.templateTheme(r,!1),this.validateSeriesOptions(r),this.chartDef=n.sy.detectChartDefinition(r),!this.chartDef.placeholder){const{validate:e=n.tf}=this.chartDef,{cleared:t,invalid:i}=e(r,this.chartDef.options,"");i.forEach(e=>n.Vy.warn(e)),r=t}this.validateAxesOptions(r),this.removeDisabledOptions(r);const l=this.optionsType(r),{annotations:h={},axes:u={},series:d,...p}=this.getSeriesThemeConfig(l,a),[g,f]=this.splitAnnotationsOptions(h),m=Bt(f),y=this.getDefaultAxes(r,d);let v=L(t,r,g,p,y);this.processAxesOptions(v,u),this.processSeriesOptions(v,a),v=Bt(v,e.OPTIONS_CLONE_OPTS),(Ql(v)||nc(v)||function(e){const t=Zl(e);return Jl(e)&&"pie"!==t&&"donut"!==t}(v))&&null==v.legend?.enabled&&(v.legend??(v.legend={}),v.legend.enabled=v.series.length>1),this.enableConfiguredOptions(v,r);let b=this.processFonts(v);const C=a.params;return b=this.processFonts(C,b),C.__palette=Bt(a.palette),C.__palette.type=(0,n.Gv)(r.theme)?ib(r.theme?.palette):"inbuilt",this.resolveThemeOperations(C,C),this.resolveThemeOperations(C,v),this.resolveThemeOperations(C,m),a.templateTheme(v,!1),function(e){const t="mode"in e&&"integrated"===e.mode;for(const i of c.byType("root","legend")){const n=e[i.optionsKey],s=null!=n&&!1===n.enabled,r=!("removable"in i)||!0===i.removable||"standalone-only"===i.removable&&!t;s&&r&&delete e[i.optionsKey]}}(v),eb.isEnterprise||tb(v,!0),this.validateSeriesOptions(v),this.validateAxesOptions(v),this.validatePluginOptions(v),this.processMiniChartSeriesOptions(v),v.loadGoogleFonts||b.clear(),e.debug(()=>["ChartOptions.slowSetup() - processed options",Bt(v)]),{activeTheme:a,processedOptions:v,defaultAxes:y,themeParameters:C,annotationThemes:m,googleFonts:b}}validatePluginOptions(e){for(const t of n.sy.listModulesByType(n.nR.Plugin)){const i=t.name;if(i in e&&(!t.chartType||t.chartType===this.chartDef?.name)){const{cleared:s,invalid:r}=(0,n.tf)(e[i],t.options,t.name);r.forEach(e=>n.Vy.warn(e)),e[i]=s}}}validateSeriesOptions(e){const t=this.chartDef?.name,i=[],s=e.series?.length??0;let r;for(let o=0;o<s;o++){const s=`series[${o}]`,a=e.series[o],l=n.sy.getSeriesModule(a.type??"line");if(null==l){r??(r=(0,n.lp)(Array.from(n.sy.listModulesByType(n.nR.Series)).filter(e=>!t||e.chartType===t).map(e=>e.name),"or",hw)),n.Vy.warn(`Unknown type \`${a.type}\` at \`${s}.type\`; expecting ${r}, ignoring.`);continue}if(t&&l.chartType!==t){n.Vy.warn(`Series type \`${l.name}\` at \`${s}.type\` is not supported by chart type \`${t}\`, ignoring.`);continue}const{validate:c=n.tf}=l,{cleared:h,invalid:u}=c(a,l.options,s);u.forEach(e=>n.Vy.warn(e)),(0,n.eh)(u,s)||i.push(h)}e.series=i}validateAxesOptions(e){if(!("axes"in e)||!e.axes)return;const t=this.chartDef?.name,i=[],s=e.axes.length??0;let r;for(let o=0;o<s;o++){const s=`axes[${o}]`;let a=e.axes[o];"time"===a.type&&null!=a.unit&&(a={...a,type:"unit-time"});const l=n.sy.getAxisModule(a.type);if(null==l){r??(r=(0,n.lp)(Array.from(n.sy.listModulesByType(n.nR.Axis)).filter(e=>e.chartType===t).map(e=>e.name),"or",hw)),n.Vy.warn(`Unknown type \`${a.type}\` at  \`${s}.type\`; expecting one of ${r}, ignoring all axes options.`),delete e.axes;break}if(l.chartType!==t){n.Vy.warn(`Axis type \`${l.name}\` at  \`${s}.type\` is not supported by chart type \`${t}\`, ignoring.`);break}const{validate:c=n.tf}=l,{cleared:h,invalid:u}=c(a,l.options,s);u.forEach(e=>n.Vy.warn(e)),(0,n.eh)(u,s)||i.push(h)}e.axes=i}diffOptions(t){return this===t?{}:null==t?this.processedOptions:this.fastDelta??Ft(t.processedOptions,this.processedOptions,e.JSON_DIFF_OPTS)}getSeriesThemeConfig(e,t){return t?.config[e]??{}}getDefaultAxes(e,t){const i=this.optionsType(e),n=e.series?.find(e=>(e.type??"line")===i)??{},s=ta.cloneDefaultAxes(i);return Wt(s,{},void 0,L(n,t)),s}optionsType(e){return e.series?.[0]?.type??"line"}splitAnnotationsOptions(e){const{axesButtons:t=null,enabled:i=null,optionsToolbar:n=null,toolbar:s=null,...r}=e;return null==t&&null==i&&null==n&&null==s?[{},r]:[{annotations:{axesButtons:t,enabled:i,optionsToolbar:n,toolbar:s}},r]}processAxesOptions(e,t){"axes"in e&&(e.axes=e.axes?.map(e=>{const{crossLines:i,...n}=L(t[e.type]?.[e.position],t[e.type]);e.crossLines&&(e.crossLines=O(e.crossLines,i));const s=n.gridLine?.style;e.gridLine?.style&&s?.length&&(e.gridLine.style=e.gridLine.style.map((e,t)=>null!=e.stroke||null!=e.lineDash?L(e,s.at(t%s.length)):e));const{top:r,right:o,bottom:a,left:l,...c}=L(e,n);return c}))}processSeriesOptions(e,t){const i=this.getTooltipPositionDefaults(e),s=e.series?.map(s=>{s.type??(s.type="line");const{innerLabels:r,...o}=this.getSeriesThemeConfig(s.type,t).series??{},a=n.sy.getSeriesModule(s.type),l=Boolean(a?.options.tooltip),c=Boolean(a?.options.visible),h=l&&this.getTooltipRangeDefaults(e,s.type),u=L(this.getSeriesGroupingOptions(s),s,l&&i,h,o,c&&{visible:!0});return u.innerLabels&&(u.innerLabels=O(u.innerLabels,r)),u});e.series=this.setSeriesGroupingOptions(s??[])}processMiniChartSeriesOptions(e){let t=e.navigator?.miniChart?.series;null!=t&&(t=t.map(e=>(e.type??(e.type="line"),e)),e.navigator.miniChart.series=this.setSeriesGroupingOptions(t))}resolveThemeOperations(t,i){const n=Wt(i,t,new Set(["palette","data","theme"]));e.debug("ChartOptions.resolveTheme()",n)}getSeriesGroupingOptions(e){const t=ta.isGroupable(e.type),i=ta.isStackable(e.type),s=ta.isStackedByDefault(e.type);e.grouped&&!t&&n.Vy.warnOnce(`unsupported grouping of series type "${e.type}".`),!e.stacked&&!e.stackGroup||i||n.Vy.warnOnce(`unsupported stacking of series type "${e.type}".`);let{grouped:r,stacked:o}=e;return o??(o=(s||null!=e.stackGroup)&&!(t&&r)),r??(r=!0),{stacked:i&&o,grouped:t&&r&&!(i&&o)}}setSeriesGroupingOptions(t){const i=this.getSeriesGrouping(t);e.debug("ChartOptions.setSeriesGroupingOptions() - series grouping: ",i);const n={},s=i.reduce((e,t)=>{var i;return"default"===t.groupType||(e[i=t.seriesType]??(e[i]=0),e[t.seriesType]+="stack"===t.groupType?1:t.series.length),e},{});return i.flatMap(e=>{var t;switch(n[t=e.seriesType]??(n[t]=0),e.groupType){case"stack":{const t=n[e.seriesType]++;return e.series.map((i,n)=>Object.assign(i,{seriesGrouping:{groupId:e.groupId,groupIndex:t,groupCount:s[e.seriesType],stackIndex:n,stackCount:e.series.length}}))}case"group":return e.series.map(t=>Object.assign(t,{seriesGrouping:{groupId:e.groupId,groupIndex:n[e.seriesType]++,groupCount:s[e.seriesType],stackIndex:0,stackCount:0}}))}return e.series}).map(({stacked:e,grouped:t,...i})=>i)}getSeriesGroupId(e){return[e.type,e.xKey,e.stacked?e.stackGroup??"stacked":"grouped"].filter(Boolean).join("-")}getSeriesGrouping(e){const t=new Map;return e.reduce((e,i)=>{const n=i.type;if(i.stacked||i.grouped){const s=this.getSeriesGroupId(i);if(!t.has(s)){const r={groupType:i.stacked?"stack":"group",seriesType:n,series:[],groupId:s};t.set(s,r),e.push(r)}t.get(s).series.push(i)}else e.push({groupType:"default",seriesType:n,series:[i],groupId:"__default__"});return e},[])}getTooltipPositionDefaults(e){const t=e.tooltip?.position;if(!(0,n.Qd)(t))return;const{type:i,anchorTo:s,placement:r,xOffset:o,yOffset:a}=t,l={};return(0,n.Kg)(i)&&(0,n.Xl)(ky,i)&&(l.type=i),(0,n.Kg)(s)&&(0,n.Xl)(Iy,s)&&(l.anchorTo=s),(0,n.Kg)(r)&&(0,n.Xl)(Ry,r)&&(l.placement=r),(0,n.Bf)(o)&&(l.xOffset=o),(0,n.Bf)(a)&&(l.yOffset=a),{tooltip:{position:l}}}getTooltipRangeDefaults(e,t){return{tooltip:{range:e.tooltip?.range??ta.getTooltipDefauls(t)?.range}}}soloSeriesIntegrity(e){if(!(0,n.cy)(e.series))return;const t=e.series;if(t&&t.length>1&&t.some(e=>ta.isSolo(e.type))){const i=this.optionsType(e);if(ta.isSolo(i))n.Vy.warn(`series[0] of type '${i}' is incompatible with other series types. Only processing series[0]`),e.series=t.slice(0,1);else{const{solo:i,nonSolo:s}=(0,n.$z)(t,e=>ta.isSolo(e.type)?"solo":"nonSolo"),r=(0,n.Am)(i.map(e=>e.type)).join(", ");n.Vy.warn(`Unable to mix these series types with the lead series type: ${r}`),e.series=s}}}static enableConfiguredJsonOptions(e,t){"object"==typeof t&&"enabled"in t&&!t._enabledFromTheme&&null==e.enabled&&(t.enabled=!0)}static cleanupEnabledFromThemeJsonOptions(e){null!=e._enabledFromTheme&&delete e._enabledFromTheme}enableConfiguredOptions(t,i){Ht(i,e.enableConfiguredJsonOptions,new Set(["data","theme"]),t),Ht(t,e.cleanupEnabledFromThemeJsonOptions,new Set(["data","theme"]))}static processFontOptions(e,t,i,n=new Set){if("object"==typeof e&&"fontFamily"in e)if(Array.isArray(e.fontFamily)){const t=[];for(const i of e.fontFamily)"object"==typeof i&&"googleFont"in i?(t.push(i.googleFont),n?.add(i.googleFont)):t.push(i);e.fontFamily=t.join(", ")}else"object"==typeof e.fontFamily&&"googleFont"in e.fontFamily&&(e.fontFamily=e.fontFamily.googleFont,n?.add(e.fontFamily));return n}processFonts(t,i=new Set){return Ht(t,e.processFontOptions,new Set(["data","theme"]),void 0,void 0,i)}static removeDisabledOptionJson(e){"enabled"in e&&!1===e.enabled&&Object.keys(e).forEach(t=>{"enabled"!==t&&delete e[t]})}removeDisabledOptions(t){Ht(t,e.removeDisabledOptionJson,new Set(["data","theme","contextMenu"]))}static removeLeftoverSymbolsJson(e){if(e&&(0,n.Gv)(e))for(const t of Object.keys(e)){const i=e[t];(0,n.Bm)(i)&&delete e[t]}}removeLeftoverSymbols(t){Ht(t,e.removeLeftoverSymbolsJson,new Set(["data"]))}specialOverridesDefaults(e){if(null==e.window?e.window=(0,n.zk)():(0,n.d1)(e.window),null==e.document?e.document=(0,n.YE)():(0,n._9)(e.document),null==e.window)throw new Error("AG Charts - unable to resolve global window");if(null==e.document)throw new Error("AG Charts - unable to resolve global document");return e}};uw.OPTIONS_CLONE_OPTS={shallow:new Set(["data","container"]),assign:new Set(["context","theme"])},uw.JSON_DIFF_OPTS=new Set(["data"]),uw.perfDebug=v.create(!0,"perf"),uw.FAST_PATH_OPTIONS=new Set(["data","width","height","container"]),uw.debug=v.create(!0,"opts");var dw=uw,pw=class e{constructor(e,t,i,n,s,r=1e3){this.name=e,this.buildItem=t,this.releaseItem=i,this.destroyItem=n,this.maxPoolSize=s,this.cleanupTimeMs=r,this.freePool=[],this.busyPool=new Set}static getPool(t,i,n,s,r){return this.pools.has(t)||this.pools.set(t,new e(t,i,n,s,r)),this.pools.get(t)}isFull(){return this.freePool.length+this.busyPool.size>=this.maxPoolSize}hasFree(){return this.freePool.length>0}obtain(t){if(!this.hasFree()&&this.isFull())throw new Error("AG Charts - pool exhausted");let i=this.freePool.pop();return null==i?(i=this.buildItem(t),e.debug(()=>[`Pool[name=${this.name}]: Created instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,i])):e.debug(()=>[`Pool[name=${this.name}]: Re-used instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,i]),this.busyPool.add(i),{item:i,release:()=>this.release(i)}}obtainFree(){const t=this.freePool.pop();if(null==t)throw new Error("AG Charts - pool has no free instances");return e.debug(()=>[`Pool[name=${this.name}]: Re-used instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,t]),this.busyPool.add(t),{item:t,release:()=>this.release(t)}}release(t){if(!this.busyPool.has(t))throw new Error("AG Charts - cannot free item from pool which is not tracked as busy.");e.debug(()=>[`Pool[name=${this.name}]: Releasing instance (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`,t]),this.releaseItem(t),this.busyPool.delete(t),this.freePool.push(t),e.debug(()=>[`Pool[name=${this.name}]: Returned instance to free pool (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`,t]);const i=Date.now(),n=i+.5*this.cleanupTimeMs;this.cleanPoolTimer&&(this.cleanPoolDue??1/0)<n&&(clearTimeout(this.cleanPoolTimer),this.cleanPoolTimer=void 0),this.cleanPoolTimer||(this.cleanPoolDue=i+this.cleanupTimeMs,this.cleanPoolTimer=setTimeout(this.cleanPool.bind(this),this.cleanupTimeMs))}cleanPool(){const t=this.freePool.splice(0);for(const e of t)this.destroyItem(e);e.debug(()=>[`Pool[name=${this.name}]: Cleaned pool of ${t.length} items (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`])}destroy(){this.cleanPool();for(const e of this.busyPool.values())this.destroyItem(e);this.busyPool.clear()}};pw.pools=new Map,pw.debug=v.create(!0,"pool");var gw=pw;n.sy.registerMany(Jv);var fw=v.create(!0,"opts"),mw=class{static licenseCheck(e){this.licenseChecked||(this.licenseManager=eb.licenseManager?.(e),this.licenseManager?.validateLicense(),this.licenseChecked=!0)}static getLicenseDetails(e){return eb.licenseManager?.({}).getLicenseDetails(e)}static getInstance(e){return vw.getInstance(e)}static create(e,t){return fw.group("AgCharts.create()",()=>{e=v.inDevelopmentMode(()=>z(Bt(e)))??e,this.licenseCheck(e);const i=vw.createOrUpdate({userOptions:e,licenseManager:this.licenseManager,optionsMetadata:t});return this.licenseManager?.isDisplayWatermark()&&this.licenseManager&&eb.injectWatermark?.(i.chart.ctx.domManager,this.licenseManager.getWatermarkMessage()),i})}static createFinancialChart(e){return fw.group("AgCharts.createFinancialChart()",()=>this.create(e,{presetType:"price-volume"}))}static createGauge(e){return fw.group("AgCharts.createGauge()",()=>this.create(e,{presetType:"gauge-preset"}))}static __createSparkline(e){return fw.group("AgCharts.__createSparkline()",()=>{const{pool:t,...i}=e;return this.create(i,{presetType:"sparkline",pool:t??!0,domMode:"minimal"})})}};mw.licenseChecked=!1;var yw=class e{static getInstance(e){const t=gh.getInstance(e);return t?vh.chartInstances.get(t):void 0}static initialiseModules(){e.initialised||(Ty(),function(){for(const e of c.modules){if("enterprise"!==e.packageType||Yo(e)||n.Vy.errorOnce("Unexpected enterprise module registered: "+e.identifier),"root"===e.type&&e.themeTemplate)for(const t of e.chartTypes)ea.set(t,e.themeTemplate);if("series"===e.type){if(e.chartTypes.length>1)throw new Error(`AG Charts - Module definition error: ${e.identifier}`);ta.register(e.identifier,e)}if("series-option"===e.type&&e.themeTemplate)for(const t of e.seriesTypes)ta.setThemeTemplate(t,e.themeTemplate);if("axis-option"===e.type&&e.themeTemplate)for(const t of e.axisTypes){const i=jo.getThemeTemplate(t),n=L(e.themeTemplate,i);jo.setThemeTemplate(t,n)}"axis"===e.type&&jo.register(e.identifier,e),"legend"===e.type&&qo.register(e.identifier,e)}if(c.hasEnterpriseModules()){const e=$o.filter(({useCount:e})=>null==e||0===e);e.length>0&&n.Vy.errorOnce("Enterprise modules expected but not registered: ",e)}}(),e.initialised=!0)}static createOrUpdate(t){let{proxy:i}=t;const{userOptions:s,licenseManager:r,processedOverrides:o=i?.chart?.chartOptions.processedOverrides??{},specialOverrides:a=i?.chart?.chartOptions.specialOverrides??{},optionsMetadata:l=i?.chart?.chartOptions.optionMetadata??{},deltaOptions:c,stripSymbols:h=!1}=t,u=null!=eb.styles?[["ag-charts-enterprise",eb.styles]]:[],{presetType:d}=l;e.initialiseModules(),fw(()=>[">>> AgCharts.createOrUpdate() user options",Bt(s)]);let p=s;mw.optionsMutationFn&&p&&(p=mw.optionsMutationFn(Bt(p),d),fw(()=>[">>> AgCharts.createOrUpdate() MUTATED user options",Bt(p)]));const g=this.getPool(l);let f,m=!1,y=i?.chart;null==y&&g?.hasFree()&&(f=g.obtainFree(),y=f.item);const{document:v,window:b,styleContainer:C,...w}=p??{},S=y?.getChartOptions(),x=new dw(S,w,o,{...a,document:v,window:b,styleContainer:C},l,c,h);return null!=y&&n.sy.detectChartDefinition(x.processedOptions)===n.sy.detectChartDefinition(y.chartOptions.processedOptions)||(f?.release(),f=this.getPool(x.optionMetadata)?.obtain(x),f?y=f.item:(m=!0,y=e.createChartInstance(x,y))),u.forEach(([e,t])=>{y.ctx.domManager.addStyles(e,t)}),y.ctx.fontManager.updateFonts(x.googleFonts),null==i?(i=new vh(y,e.callbackApi,r),i.releaseChart=f?.release):(f||m)&&(i.releaseChart?.(),i.chart=y,i.releaseChart=f?.release),fw.check()&&"undefined"!=typeof window&&(window.agChartInstances??(window.agChartInstances={}),window.agChartInstances[y.id]=y),y.queuedUserOptions.push(x.userOptions),y.queuedChartOptions.push(x),y.requestFactoryUpdate(e=>{fw.group(">>>> Chart.applyOptions()",()=>{e.applyOptions(x);const t=e.queuedUserOptions.indexOf(x.userOptions)+1;e.queuedUserOptions.splice(0,t),e.queuedChartOptions.splice(0,t)})}),i}static markRemovedProperties(e,t,i=!1){if("object"!=typeof e)return i;for(const t of Object.keys(e))void 0===e[t]&&(Object.assign(e,{[t]:Symbol("UNSET")}),i||(i=!0));return i}static updateUserDelta(t,i){const n=Ht(i=Bt(i,dw.OPTIONS_CLONE_OPTS),e.markRemovedProperties,new Set(["data"]),void 0,void 0,!1);fw(()=>[">>> AgCharts.updateUserDelta() user delta",Bt(i)]),e.createOrUpdate({proxy:t,deltaOptions:i,stripSymbols:n})}static createChartInstance(e,t){const i=t?.destroy({keepTransferableResources:!0});return n.sy.detectChartDefinition(e.processedOptions).create(e,i)}static getPool(e){if(!0===e.pool)return gw.getPool(e.presetType??"default",this.createChartInstance,this.detachAndClear,this.destroy,1/0)}};yw.caretaker=new Xi(Ki),yw.initialised=!1,yw.callbackApi={caretaker:yw.caretaker,create:(e,t,i,n)=>yw.createOrUpdate({userOptions:e,processedOverrides:t,specialOverrides:i,optionsMetadata:n}),update:(e,t)=>yw.createOrUpdate({userOptions:e,proxy:t}),updateUserDelta:(e,t)=>yw.updateUserDelta(e,t)},yw.detachAndClear=e=>e.detachAndClear(),yw.destroy=e=>e.destroy();var vw=yw,bw={};o(bw,{Arc:()=>Cw,BBox:()=>m,Caption:()=>Fi,CategoryScale:()=>Sh,Group:()=>Mt,Line:()=>pa,LinearScale:()=>Vu,Marker:()=>Nc,Path:()=>Cc,RadialColumnShape:()=>Sw,Rect:()=>Zu,Scene:()=>us,Sector:()=>qm,Shape:()=>ut,TranslatableGroup:()=>It,getRadialColumnWidth:()=>xw,toRadians:()=>oe});var Cw=class extends Cc{constructor(){super(),this.centerX=0,this.centerY=0,this.radius=10,this.startAngle=0,this.endAngle=2*Math.PI,this.counterClockwise=!1,this.type=0,this.restoreOwnStyles()}get fullPie(){return(0,n.YX)(ie(this.startAngle),ie(this.endAngle))}updatePath(){const e=this.path;e.clear(),e.arc(this.centerX,this.centerY,this.radius,this.startAngle,this.endAngle,this.counterClockwise),1===this.type?e.closePath():2!==this.type||this.fullPie||(e.lineTo(this.centerX,this.centerY),e.closePath())}computeBBox(){return new m(this.centerX-this.radius,this.centerY-this.radius,2*this.radius,2*this.radius)}isPointInPath(e,t){const i=this.getBBox();return 0!==this.type&&i.containsPoint(e,t)&&this.path.isPointInPath(e,t)}};function ww(e,t,i){const n=Math.sqrt(e**2+t**2),s=Math.atan2(t,e)+i;return{x:Math.cos(s)*n,y:Math.sin(s)*n}}Cw.className="Arc",a([K()],Cw.prototype,"centerX",2),a([K()],Cw.prototype,"centerY",2),a([K()],Cw.prototype,"radius",2),a([K()],Cw.prototype,"startAngle",2),a([K()],Cw.prototype,"endAngle",2),a([K()],Cw.prototype,"counterClockwise",2),a([K()],Cw.prototype,"type",2);var Sw=class extends Cc{constructor(){super(...arguments),this.isBeveled=!0,this.columnWidth=0,this.startAngle=0,this.endAngle=0,this.outerRadius=0,this.innerRadius=0,this.axisInnerRadius=0,this.axisOuterRadius=0,this.isRadiusAxisReversed=!1}set cornerRadius(e){}computeBBox(){const{innerRadius:e,outerRadius:t,columnWidth:i}=this,n=this.getRotation(),s=-i/2,r=i/2,o=-t,a=-e;let l=1/0,c=1/0,h=-1/0,u=-1/0;for(let e=0;e<4;e+=1){const{x:t,y:i}=ww(e%2==0?s:r,e<2?o:a,n);l=Math.min(t,l),c=Math.min(i,c),h=Math.max(t,h),u=Math.max(i,u)}return new m(l,c,h-l,u-c)}getRotation(){const{startAngle:e,endAngle:t}=this;return ie(e+le(e,t)/2+Math.PI/2)}updatePath(){const{isBeveled:e}=this;e?this.updateBeveledPath():this.updateRectangularPath(),this.checkPathDirty()}updateRectangularPath(){const{columnWidth:e,innerRadius:t,outerRadius:i,path:n}=this,s=-e/2,r=e/2,o=-i,a=-t,l=this.getRotation(),c=[[s,a],[s,o],[r,o],[r,a]].map(([e,t])=>ww(e,t,l));n.clear(!0),n.moveTo(c[0].x,c[0].y),n.lineTo(c[1].x,c[1].y),n.lineTo(c[2].x,c[2].y),n.lineTo(c[3].x,c[3].y),n.closePath()}updateBeveledPath(){const{columnWidth:e,path:t,outerRadius:i,innerRadius:s,axisInnerRadius:r,axisOuterRadius:o,isRadiusAxisReversed:a}=this,l=(0,n.YX)(s,r),c=Math.asin(e/2/s),h=this.getRotation(),u=(e,t)=>ww(e,t,h),d=(e,t)=>Math.sqrt(e**2+t**2),p=(e,t)=>t>e?0:Math.sqrt(e**2-t**2),g=(e,t,i)=>i?e<t:e>t,f=l&&!isNaN(c)&&c<Math.PI/6;let m=-e/2,y=e/2;const v=-i,b=-s*(f?Math.cos(c):1),C=g(o,d(s,e/2),!a);if(C){const e=p(o,s);m=-e,y=e}t.clear(!0);const w=u(m,b);t.moveTo(w.x,w.y);const S=(0,n.YX)(s,i),x=g(o,d(i,e/2),!a);if(S&&f)t.arc(0,0,s,ie(-c-Math.PI/2)+h,ie(c-Math.PI/2)+h,!1);else if(x){const s=-p(o,e/2),r=p(o,i);if(!C){const e=u(m,s);t.lineTo(e.x,e.y)}if(t.arc(0,0,o,Math.atan2(s,m)+h,Math.atan2(v,-r)+h,!1),!(0,n.YX)(r,0)){const e=u(r,v);t.lineTo(e.x,e.y)}t.arc(0,0,o,Math.atan2(v,r)+h,Math.atan2(s,y)+h,!1)}else{const e=u(m,v),i=u(y,v);t.lineTo(e.x,e.y),t.lineTo(i.x,i.y)}const E=u(y,b);if(t.lineTo(E.x,E.y),f)t.arc(0,0,s,ie(c-Math.PI/2)+h,ie(-c-Math.PI/2)+h,!0);else{const e=u(m,b);t.lineTo(e.x,e.y)}t.closePath()}};function xw(e,t,i,n,s){const r=le(e,t),o=r*(1-n)/2;if(e+=o,t-=o,r<.001)return 2*i*s;if(r>=2*Math.PI){const i=e+r/2;e=i-Math.PI,t=i+Math.PI}const a=i*Math.cos(e),l=i*Math.sin(e),c=i*Math.cos(t),h=i*Math.sin(t),u=Math.floor(Math.sqrt((a-c)**2+(l-h)**2)),d=2*i*s;return Math.max(1,Math.min(d,u))}Sw.className="RadialColumnShape",a([K()],Sw.prototype,"isBeveled",2),a([K()],Sw.prototype,"columnWidth",2),a([K()],Sw.prototype,"startAngle",2),a([K()],Sw.prototype,"endAngle",2),a([K()],Sw.prototype,"outerRadius",2),a([K()],Sw.prototype,"innerRadius",2),a([K()],Sw.prototype,"axisInnerRadius",2),a([K()],Sw.prototype,"axisOuterRadius",2),a([K()],Sw.prototype,"isRadiusAxisReversed",2);var Ew={};o(Ew,{ChartTheme:()=>gb,DEFAULT_ANNOTATION_HANDLE_FILL:()=>Zd,DEFAULT_ANNOTATION_STATISTICS_COLOR:()=>ep,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:()=>tp,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:()=>ip,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:()=>np,DEFAULT_ANNOTATION_STATISTICS_FILL:()=>Qd,DEFAULT_ANNOTATION_STATISTICS_STROKE:()=>Jd,DEFAULT_CAPTION_ALIGNMENT:()=>Pd,DEFAULT_CAPTION_LAYOUT_STYLE:()=>kd,DEFAULT_FIBONACCI_STROKES:()=>Yd,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:()=>Xd,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:()=>Kd,DEFAULT_GRIDLINE_ENABLED:()=>lp,DEFAULT_POLAR_SERIES_STROKE:()=>jd,DEFAULT_SEPARATION_LINES_COLOUR:()=>Id,DEFAULT_SHADOW_COLOUR:()=>Rd,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:()=>$d,DEFAULT_TEXTBOX_COLOR:()=>op,DEFAULT_TEXTBOX_FILL:()=>sp,DEFAULT_TEXTBOX_STROKE:()=>rp,DEFAULT_TEXT_ANNOTATION_COLOR:()=>qd,DEFAULT_TOOLBAR_POSITION:()=>ap,IS_DARK_THEME:()=>Dd,PALETTE_ALT_DOWN_FILL:()=>Ud,PALETTE_ALT_DOWN_STROKE:()=>Vd,PALETTE_ALT_NEUTRAL_FILL:()=>zd,PALETTE_ALT_NEUTRAL_STROKE:()=>Wd,PALETTE_ALT_UP_FILL:()=>Hd,PALETTE_ALT_UP_STROKE:()=>Bd,PALETTE_DOWN_FILL:()=>Od,PALETTE_DOWN_STROKE:()=>Ld,PALETTE_NEUTRAL_FILL:()=>Gd,PALETTE_NEUTRAL_STROKE:()=>Fd,PALETTE_UP_FILL:()=>Nd,PALETTE_UP_STROKE:()=>_d,getChartTheme:()=>aw,resolveOperation:()=>Mw,themeNames:()=>Aw,themeSymbols:()=>Td,themes:()=>ow});var Aw=Object.keys(ow);function Mw(e){const t=gb.getDefaultPublicParameters();t.__palette=gb.getDefaultColors();const i={operation:e};return Wt(i,t),i.operation}var Tw={};o(Tw,{Color:()=>me,interpolateColor:()=>ws});var Dw={};o(Dw,{AbstractBarSeries:()=>Wf,AbstractBarSeriesProperties:()=>zf,ActionOnSet:()=>li,AnchoredPopover:()=>lS,Animation:()=>Os,AnimationManager:()=>Hs,Arc:()=>Cw,Axis:()=>Ul,AxisGroupZIndexMap:()=>Vl,AxisInterval:()=>yl,AxisLabel:()=>vl,AxisTick:()=>Cl,AxisTickGenerator:()=>Wl,AxisTicks:()=>Ww,BBox:()=>m,BBoxValues:()=>h,Background:()=>Qu,BackgroundModule:()=>Ju,BandScale:()=>to,BarSeries:()=>rm,BarSeriesModule:()=>lm,BaseModuleInstance:()=>l,BaseProperties:()=>De,BaseToolbar:()=>gS,ButtonWidget:()=>Pn,CachedTextMeasurer:()=>Ii,CachedTextMeasurerPool:()=>Di,CallbackCache:()=>gs,Caption:()=>Fi,CartesianAxis:()=>Kl,CartesianSeries:()=>jp,CartesianSeriesNodeEvent:()=>Up,CartesianSeriesProperties:()=>zp,CategoryAxis:()=>Mh,CategoryScale:()=>Sh,ChangeDetectableProperties:()=>wp,Chart:()=>gh,ChartAxisDirection:()=>Gi,ChartEventManager:()=>Us,ChartOptions:()=>dw,ChartUpdateType:()=>vs,CollapseMode:()=>lg,Color:()=>me,ColorScale:()=>Se,ConicGradient:()=>Ee,ContextMenuBuiltins:()=>js,ContextMenuRegistry:()=>$s,ContinuousScale:()=>cr,DEFAULT_CARTESIAN_DIRECTION_KEYS:()=>Vp,DEFAULT_CARTESIAN_DIRECTION_NAMES:()=>Hp,DEFAULT_TOOLTIP_CLASS:()=>Fc,DEFAULT_TOOLTIP_DARK_CLASS:()=>Gc,DIRECTION_SWAP_AXES:()=>cp,DOMManager:()=>In,DataController:()=>Wo,DataModel:()=>Uo,DataModelSeries:()=>Bp,DataService:()=>bs,Debug:()=>v,Deprecated:()=>Mc,DeprecatedAndRenamedTo:()=>Tc,DiscreteTimeScale:()=>io,DragInterpreter:()=>ir,DraggablePopover:()=>hS,DropShadow:()=>Sp,ExtendedPath2D:()=>Je,FILL_IMAGE_DEFAULTS:()=>fp,FILL_PATTERN_DEFAULTS:()=>gp,FONT_SIZE_RATIO:()=>Sd,FillGradientDefaults:()=>Tp,FillImageDefaults:()=>Ip,FillPatternDefaults:()=>Dp,FloatingToolbar:()=>yS,Gradient:()=>xe,Group:()=>Mt,GroupedCategoryAxis:()=>Pu,HdpiCanvas:()=>Jn,HierarchyNode:()=>_w,HierarchySeries:()=>Lw,HierarchySeriesProperties:()=>Nw,HighlightManager:()=>Ks,HighlightProperties:()=>Mp,HighlightStyle:()=>Rp,Image:()=>tS,InteractionManager:()=>Bs,InteractionState:()=>Gs,InterpolationProperties:()=>$p,Invalidating:()=>ve,LARGEST_KEY_INTERVAL:()=>iu,Label:()=>pl,LayoutElement:()=>Vi,LayoutManager:()=>Hi,LegendMarkerLabel:()=>cd,Line:()=>pa,LineSeries:()=>Mm,LineSeriesModule:()=>Im,LinearGradient:()=>Ae,LinearScale:()=>Vu,Listeners:()=>Qi,LogScale:()=>Bu,LonLatBBox:()=>Ow,Marker:()=>Nc,Menu:()=>cS,MenuItemWidget:()=>nS,MenuWidget:()=>rS,MercatorScale:()=>Uw,ModuleRegistry:()=>n.sy,Motion:()=>Ss,NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>oa,NativeWidget:()=>On,NewAreaSeriesModule:()=>Vf,NewBarSeriesModule:()=>cm,NewBubbleSeriesModule:()=>vm,NewHistogramSeriesModule:()=>Em,NewLineSeriesModule:()=>Rm,NewScatterSeriesModule:()=>Fm,NiceMode:()=>Sl,Node:()=>J,NumberAxis:()=>Hu,ObserveChanges:()=>ci,OrdinalTimeScale:()=>el,PHASE_METADATA:()=>Ps,PHASE_ORDER:()=>ks,PREV_NEXT_KEYS:()=>dn,Padding:()=>si,ParallelStateMachine:()=>wa,Path:()=>Cc,PointerEvents:()=>Z,PolarAxis:()=>Hv,PolarSeries:()=>cy,PolarZIndexMap:()=>ly,Popover:()=>aS,PropertiesArray:()=>Ie,Property:()=>Te,ProxyInteractionService:()=>Yn,ProxyOnWrite:()=>oi,ProxyProperty:()=>ri,ProxyPropertyOnWrite:()=>ai,QUICK_TRANSITION:()=>.2,RENDER_TO_OFFSCREEN_CANVAS_THRESHOLD:()=>Wp,RadialColumnShape:()=>Sw,Range:()=>il,Rect:()=>Zu,RepeatType:()=>_s,Rotatable:()=>vt,RotatableGroup:()=>Dt,RotatableText:()=>Li,SAFE_FILLS_OPERATION:()=>up,SAFE_FILL_OPERATION:()=>hp,SAFE_RANGE2_OPERATION:()=>pp,SAFE_STROKE_FILL_OPERATION:()=>dp,SKIP_JS_BUILTINS:()=>V,SMALLEST_KEY_INTERVAL:()=>tu,SORT_DOMAIN_GROUPS:()=>nu,Scalable:()=>bt,ScalableGroup:()=>Tt,Scene:()=>us,SceneArrayChangeDetection:()=>q,SceneChangeDetection:()=>K,SceneObjectChangeDetection:()=>Y,Sector:()=>qm,SectorBox:()=>Gm,Selection:()=>da,Series:()=>bc,SeriesContentZIndexMap:()=>uc,SeriesGroupingChangedEvent:()=>vc,SeriesItemHighlightStyle:()=>xp,SeriesMarker:()=>Pp,SeriesNodeEvent:()=>yc,SeriesNodePickMode:()=>mc,SeriesProperties:()=>kp,SeriesTooltip:()=>Lp,SeriesZIndexMap:()=>hc,Shape:()=>ut,SimpleTextMeasurer:()=>ki,SliderWidget:()=>zn,StateMachine:()=>Ca,StateMachineProperty:()=>ma,StopProperties:()=>ke,SvgPath:()=>eS,TRIPLE_EQ:()=>$,Text:()=>_i,TextUtils:()=>Ri,TextWrapper:()=>Oi,ThemeConstants:()=>Cd,ThemeSymbols:()=>Td,TimeAxisParentLevel:()=>zu,TimeScale:()=>Xa,Toolbar:()=>fS,ToolbarButtonProperties:()=>uS,ToolbarButtonWidget:()=>dS,ToolbarWidget:()=>jn,Tooltip:()=>Xc,TooltipManager:()=>Js,TooltipPosition:()=>qc,Transformable:()=>St,TransformableGroup:()=>Rt,TransformableText:()=>Ni,Translatable:()=>Ct,TranslatableGroup:()=>It,TranslatableLine:()=>Bl,UnitTimeScale:()=>Ra,UpdateService:()=>Eo,Vec2:()=>Iw,Vec4:()=>no,WIDGET_HTML_EVENTS:()=>ui,Widget:()=>Mi,WidgetEventUtil:()=>fi,ZIndexMap:()=>ms,ZoomManager:()=>po,accumulateGroup:()=>du,accumulateStack:()=>gu,accumulatedValue:()=>Bh,accumulativeValueProperty:()=>Zh,addEscapeEventListener:()=>nn,addHitTestersToQuadtree:()=>Hf,addMouseCloseListener:()=>sn,addOverrideFocusVisibleEventListener:()=>an,addTouchCloseListener:()=>rn,adjustLabelPlacement:()=>sm,angleBetween:()=>le,angleCategoryAxisOptionsDefs:()=>$b,angleNumberAxisOptionsDefs:()=>Wb,angularPadding:()=>he,animationValidation:()=>cu,annotationCalloutStylesDefs:()=>hC,annotationChannelStyleDefs:()=>oC,annotationChannelTextDefs:()=>Jb,annotationCommentStylesDefs:()=>uC,annotationCrossLineStyleDefs:()=>rC,annotationDisjointChannelStyleDefs:()=>aC,annotationFibonacciStylesDefs:()=>cC,annotationLineStyleDefs:()=>sC,annotationLineTextDefs:()=>Qb,annotationMeasurerStylesDefs:()=>gC,annotationNoteStylesDefs:()=>dC,annotationOptionsDef:()=>mC,annotationParallelChannelStyleDefs:()=>lC,annotationQuickMeasurerStylesDefs:()=>fC,annotationShapeStylesDefs:()=>pC,annotationTextStylesDef:()=>Zb,applyShapeFillBBox:()=>gc,applyShapeStyle:()=>fc,areScalingEqual:()=>Ag,area:()=>Gh,autoSizedLabelOptionsDefs:()=>kf,boxPlotSeriesThemeableOptionsDef:()=>yC,buildFormatter:()=>Xr,buildResetPathFn:()=>$g,calculateDataDiff:()=>em,calculateDefaultTimeTickFormat:()=>Jr,calculateDerivativeExtrema:()=>Ze,calculateDerivativeExtremaXY:()=>Qe,calculateLabelTranslation:()=>Kw,calculatePlacement:()=>Dc,callWithContext:()=>ps,candlestickSeriesThemeableOptionsDef:()=>bC,cartesianAxisCrosshairOptions:()=>cf,cartesianAxisLabelOptionsDefs:()=>tf,cartesianAxisOptionsDefs:()=>lf,cartesianChartOptionsDefs:()=>Av,cartesianCrossLineOptionsDefs:()=>Jg,cartesianNumericAxisLabel:()=>nf,cartesianTimeAxisLabel:()=>sf,cartesianTimeAxisParentLevel:()=>of,checkCrisp:()=>Kf,chordSeriesThemeableOptionsDef:()=>CC,clampArray:()=>rr,clippedRoundRect:()=>Xu,collapsedStartingBarPosition:()=>qf,commonAxisLabelOptionsDefs:()=>ef,commonAxisOptionsDefs:()=>af,commonChartOptionsDefs:()=>Mf,commonCrossLineLabelOptionsDefs:()=>Zg,commonCrossLineOptionsDefs:()=>Qg,commonSeriesOptionsDefs:()=>Df,commonSeriesThemeableOptionsDefs:()=>Tf,compareDates:()=>ka,computeBarFocusBounds:()=>Jf,computeMarkerFocusBounds:()=>zg,coneFunnelSeriesThemeableOptionsDef:()=>wC,continuousAxisOptions:()=>hf,countExpandingSearch:()=>Qs,createButton:()=>Yw,createCheckbox:()=>qw,createDatumId:()=>vu,createDeprecationWarning:()=>Ac,createIcon:()=>Qw,createSelect:()=>Xw,createTextArea:()=>Zw,dateToNumber:()=>Zr,datesSortOrder:()=>_a,datumKeys:()=>Bo,datumStylerProperties:()=>qs,deconstructSelectionsOrNodes:()=>Ls,deepClone:()=>Bt,deepFreeze:()=>z,defaultTimeTickFormat:()=>Qr,diff:()=>yu,drawCorner:()=>Ku,drawMarkerUnitPolygon:()=>Pc,easing:()=>Ss,enterpriseModule:()=>eb,errorBarOptionsDefs:()=>_f,errorBarThemeableOptionsDefs:()=>Pf,evaluateBezier:()=>Ye,extent:()=>Dh,extractDecoratedProperties:()=>k,fillsOptionsDef:()=>Oy,findMinMax:()=>or,findQuadtreeMatch:()=>Uf,findRangeExtent:()=>ar,fixNumericExtent:()=>No,flowProportionChartOptionsDefs:()=>Rv,focusCursorAtEnd:()=>_t,formatNumber:()=>Hn,formatPercent:()=>Bn,formatValue:()=>Gn,fromToMotion:()=>aa,funnelSeriesThemeableOptionsDef:()=>SC,gaugeChartOptionsDefs:()=>kv,getAngleRatioRadians:()=>ce,getColorStops:()=>_e,getCrossLineValue:()=>rl,getDateTicksForInterval:()=>Qa,getDatumRefPoint:()=>Zs,getElementBBox:()=>Pt,getIconClassNames:()=>Nt,getLastFocus:()=>vn,getMissCount:()=>Oo,getPath:()=>B,getPathComponents:()=>Vo,getRadialColumnWidth:()=>xw,getSequentialColors:()=>mp,getShapeFill:()=>dc,getShapeStyle:()=>pc,groupAccumulativeValueProperty:()=>Jh,groupAverage:()=>Fh,groupCount:()=>Oh,groupStackValueProperty:()=>eu,groupSum:()=>Nh,hasNoModifiers:()=>ln,heatmapSeriesThemeableOptionsDef:()=>xC,hierarchyChartOptionsDefs:()=>Iv,initMenuKeyNav:()=>fn,initRovingTabIndex:()=>pn,interpolatePoints:()=>Tg,interpolationOptionsDefs:()=>Of,isAgFlowProportionChartOptions:()=>ic,isAgGaugeChartOptions:()=>sc,isAgHierarchyChartOptions:()=>ec,isAgStandaloneChartOptions:()=>nc,isAgTopologyChartOptions:()=>tc,isBetweenAngles:()=>re,isButtonClickEvent:()=>yn,isChartAxisDirection:()=>Bi,isContinuous:()=>nl,isDecoratedObject:()=>I,isDenseInterval:()=>Ka,isGradientFill:()=>rt,isGradientOrPatternFill:()=>ct,isImageFill:()=>lt,isInputPending:()=>Lt,isObjectWithProperty:()=>W,isObjectWithStringProperty:()=>j,isPatternFill:()=>at,isProperties:()=>Re,isScaleValid:()=>Mg,jsonApply:()=>Ut,jsonDiff:()=>Ft,jsonPropertyCompare:()=>Gt,jsonResolveOperations:()=>Wt,jsonWalk:()=>Ht,keyProperty:()=>jh,legendSymbolSvg:()=>Oc,lineDistanceSquared:()=>Ue,linearGaugeSeriesOptionsDef:()=>Vy,linearGaugeSeriesThemeableOptionsDef:()=>By,linearGaugeTargetOptionsDef:()=>Fy,listDecoratedProperties:()=>R,makeAccessibleClickListener:()=>mn,mapLineBackgroundSeriesThemeableOptionsDef:()=>MC,mapLineSeriesThemeableOptionsDef:()=>AC,mapMarkerSeriesThemeableOptionsDef:()=>TC,mapShapeBackgroundSeriesThemeableOptionsDef:()=>IC,mapShapeSeriesThemeableOptionsDef:()=>DC,mapValues:()=>F,markerFadeInAnimation:()=>Gg,markerOptionsDefs:()=>If,markerScaleInAnimation:()=>Bg,markerSwipeScaleInAnimation:()=>Vg,merge:()=>N,mergeArrayDefaults:()=>O,mergeDefaults:()=>L,midpointStartingBarPosition:()=>Xf,moduleRegistry:()=>c,motion:()=>bS,nearestSquared:()=>p,nearestSquaredInContainer:()=>g,nightingaleSeriesThemeableOptionsDef:()=>RC,normaliseGroupTo:()=>ru,normalisePropertyTo:()=>au,normalisedExtentWithMetadata:()=>Ih,normalizeAngle180:()=>se,normalizeAngle360:()=>ie,normalizeAngle360FromDegrees:()=>ue,normalizeAngle360Inclusive:()=>ne,normalizeContinuousDomains:()=>hr,numberFormatValidator:()=>Xg,objectsEqual:()=>P,objectsEqualWith:()=>_,ohlcSeriesThemeableOptionsDef:()=>EC,ordinalTimeAxisOptionsDefs:()=>zb,pairUpSpans:()=>Sg,partialAssign:()=>U,pathFadeInAnimation:()=>jg,pathMotion:()=>yp,pathSwipeInAnimation:()=>Wg,pickByMatchingAngle:()=>ay,plotAreaPathFill:()=>Lg,plotInterpolatedAreaSeriesFillSpans:()=>Ng,plotInterpolatedLinePathStroke:()=>Rg,plotLinePathStroke:()=>Ig,polarChartOptionsDefs:()=>Mv,prepareAreaFillAnimationFns:()=>Og,prepareAreaPathAnimation:()=>Fg,prepareAxisAnimationContext:()=>xl,prepareAxisAnimationFunctions:()=>Ml,prepareBarAnimationFunctions:()=>Zf,prepareLinePathAnimation:()=>_g,prepareLinePathPropertyAnimation:()=>Pg,prepareLinePathStrokeAnimationFns:()=>kg,preparePieSeriesAnimationFunctions:()=>ry,pyramidSeriesThemeableOptionsDef:()=>kC,radarAreaSeriesThemeableOptionsDef:()=>PC,radarLineSeriesThemeableOptionsDef:()=>_C,radialBarSeriesThemeableOptionsDef:()=>LC,radialColumnSeriesThemeableOptionsDef:()=>NC,radialGaugeSeriesOptionsDef:()=>Uy,radialGaugeSeriesThemeableOptionsDef:()=>Hy,radialGaugeTargetOptionsDef:()=>Gy,radiusCategoryAxisOptionsDefs:()=>Yb,radiusNumberAxisOptionsDefs:()=>Kb,range:()=>$a,rangeAreaSeriesThemeableOptionsDef:()=>OC,rangeBarSeriesThemeableOptionsDef:()=>FC,rangeValidator:()=>ff,rangedValueProperty:()=>Xh,resetAxisGroupFn:()=>Tl,resetAxisLabelSelectionFn:()=>Dl,resetAxisLineSelectionFn:()=>Il,resetBarSelectionsFn:()=>Qf,resetLabelFn:()=>Cp,resetMarkerFn:()=>Hg,resetMarkerPositionFn:()=>Ug,resetMotion:()=>ua,resetPieSelectionsFn:()=>oy,rowCountProperty:()=>Kh,sankeySeriesThemeableOptionsDef:()=>GC,scale:()=>cg,sectorBox:()=>Bm,seriesLabelFadeInAnimation:()=>vp,seriesLabelFadeOutAnimation:()=>bp,seriesLabelOptionsDefs:()=>Rf,setElementBBox:()=>kt,setPath:()=>H,shadowOptionsDefs:()=>Nf,shallowClone:()=>Vt,solveBezier:()=>qe,sortAndUniqueDates:()=>Pa,splitBezier:()=>Xe,standaloneChartOptionsDefs:()=>Dv,staticFromToMotion:()=>la,stopPageScrolling:()=>bn,sum:()=>Lh,sumValues:()=>_h,sunburstSeriesThemeableOptionsDef:()=>BC,timeIntervalUnit:()=>qg,toDegrees:()=>ae,toRadians:()=>oe,toolbarButtonOptionsDefs:()=>Af,tooltipContentAriaLabel:()=>Vc,tooltipHtml:()=>Wc,tooltipOptionsDefs:()=>Lf,topologyChartOptionsDefs:()=>Tv,trailingAccumulatedValue:()=>Vh,trailingAccumulatedValueProperty:()=>Qh,treemapSeriesThemeableOptionsDef:()=>VC,updateClipPath:()=>Kg,updateLabelNode:()=>im,validateCrossLineValue:()=>ol,valueProperty:()=>$h,visibleRangeIndices:()=>Xs,waterfallSeriesThemeableOptionsDef:()=>UC,without:()=>G});var Iw={add:function(e,t){return"number"==typeof t?{x:e.x+t,y:e.y+t}:{x:e.x+t.x,y:e.y+t.y}},angle:function(e,t){return null==t?Math.atan2(e.y,e.x):Math.atan2(e.y,e.x)-Math.atan2(t.y,t.x)},apply:function(e,t){return e.x=t.x,e.y=t.y,e},equal:function(e,t){return e.x===t.x&&e.y===t.y},distance:function(e,t){const i=Rw(e,t);return Math.sqrt(i.x*i.x+i.y*i.y)},distanceSquared:function(e,t){const i=Rw(e,t);return i.x*i.x+i.y*i.y},from:function(e,t){if("number"==typeof e)return{x:e,y:t};if("currentX"in e)return{x:e.currentX,y:e.currentY};if("offsetWidth"in e)return{x:e.offsetWidth,y:e.offsetHeight};if("width"in e)return[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y+e.height}];if("x1"in e)return[{x:e.x1,y:e.y1},{x:e.x2,y:e.y2}];throw new Error(`Values can not be converted into a vector: [${JSON.stringify(e)}] [${t}]`)},gradient:function(e,t,i){const n=t.x-e.x;return(null==i?t.y-e.y:i-t.y-(i-e.y))/n},intercept:function(e,t,i){return(null==i?e.y:i-e.y)-t*e.x},intersectAtX:function(e,t,i=0,n){const s=e===1/0?1/0:e*i+t;return{x:i,y:null==n?s:n-s}},intersectAtY:function(e,t,i=0,n){return{x:e===1/0?1/0:(i-t)/e,y:null==n?i:n-i}},length:kw,lengthSquared:function(e){return e.x*e.x+e.y*e.y},multiply:function(e,t){return"number"==typeof t?{x:e.x*t,y:e.y*t}:{x:e.x*t.x,y:e.y*t.y}},normalized:function(e){const t=kw(e);return{x:e.x/t,y:e.y/t}},origin:function(){return{x:0,y:0}},required:function(e){return{x:e?.x??0,y:e?.y??0}},rotate:function(e,t,i={x:0,y:0}){const n=kw(e);return{x:i.x+n*Math.cos(t),y:i.y+n*Math.sin(t)}},round:function(e,t=2){return{x:(0,n.GB)(e.x,t),y:(0,n.GB)(e.y,t)}},sub:Rw};function Rw(e,t){return"number"==typeof t?{x:e.x-t,y:e.y-t}:{x:e.x-t.x,y:e.y-t.y}}function kw(e){return Math.sqrt(e.x*e.x+e.y*e.y)}var Pw=class e{constructor(e,t,i,n,s,r,o,a,l){this.series=e,this.datumIndex=t,this.datum=i,this.sizeValue=n,this.colorValue=s,this.sumSize=r,this.depth=o,this.parent=a,this.children=l,this.midPoint={x:0,y:0}}get hasChildren(){return this.children.length>0}walk(t,i=e.Walk.PreOrder){i===e.Walk.PreOrder&&t(this),this.children.forEach(e=>{e.walk(t,i)}),i===e.Walk.PostOrder&&t(this)}*[Symbol.iterator](){yield this;for(const e of this.children)yield*e}};Pw.Walk={PreOrder:0,PostOrder:1};var _w=Pw,Lw=class extends bc{constructor(e){super({moduleCtx:e,pickModes:[1,0]}),this.colorDomain=[0,0],this.maxDepth=0,this.colorScale=new Se,this.animationState=new Ca("empty",{empty:{update:{target:"ready",action:e=>this.animateEmptyUpdateReady(e)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:e=>this.animateReadyHighlight(e),resize:e=>this.animateReadyResize(e),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:e=>this.animateWaitingUpdateReady(e)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:e=>this.animateClearingUpdateEmpty(e)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}resetAnimation(e){"initial"===e?this.animationState.transition("reset"):"ready"===e&&this.animationState.transition("skip")}processData(){const{NodeClass:e}=this,{childrenKey:t,sizeKey:i,colorKey:n,colorRange:s}=this.properties;let r=0,o=1/0,a=-1/0;const l=(s,l,h)=>{const u=null!=h.depth?h.depth+1:0,d=null!=t?s[t]:void 0,p=null==d||0===d.length;let g=null!=i?s[i]:void 0;g=Number.isFinite(g)?Math.max(g,0):p?1:0;const f=g;r=Math.max(r,u);const m=null!=n?s[n]:void 0;return"number"==typeof m&&(o=Math.min(o,m),a=Math.max(a,m)),c(new e(this,l,s,g,m,f,u,h,[]),d)},c=(e,t)=>{const{datumIndex:i}=e;return t?.forEach((t,n)=>{const s=l(t,i.concat(n),e);e.children.push(s),e.sumSize+=s.sumSize}),e},h=c(new e(this,[],void 0,0,void 0,0,void 0,void 0,[]),this.data),u=[o,a];this.colorScale.domain=o<a?[o,a]:[0,1],this.colorScale.range=s??["black"],this.colorScale.update(),this.rootNode=h,this.maxDepth=r,this.colorDomain=u}update({seriesRect:e}){this.updateSelections(),this.updateNodes();const t=this.getAnimationData();this.checkResize(e)&&this.animationState.transition("resize",t),this.animationState.transition("update",t)}resetAllAnimation(e){this.ctx.animationManager.stopByAnimationGroupId(this.id)}animateEmptyUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateWaitingUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateReadyHighlight(e){}animateReadyResize(e){this.resetAllAnimation(e)}animateClearingUpdateEmpty(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}getAnimationData(){return{}}isProcessedDataAnimatable(){return!0}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}getSeriesDomain(){return[NaN,NaN]}getSeriesRange(e,t){return[NaN,NaN]}getLegendData(e){const{colorKey:t,colorName:i,colorRange:n}=this.properties,{id:s,ctx:{legendManager:r},visible:o}=this;return"gradient"===e&&null!=t&&null!=n?[{legendType:"gradient",enabled:o&&r.getItemEnabled({seriesId:s}),seriesId:s,colorName:i,colorRange:n,colorDomain:this.colorDomain}]:[]}getDatumIdFromData(e){return e.datumIndex.join(":")}getDatumId(e){return this.getDatumIdFromData(e)}removeMeIndexPathForIndex(e){return this.datumSelection.at(e+1)?.datum.datumIndex??[]}removeMeIndexForIndexPath(e){for(const{index:t,datum:i}of this.datumSelection)if((0,n.r1)(i.datumIndex,e))return t-1;return 0}pickFocus(e){if(!this.rootNode?.children.length)return;const t=(0,n.qE)(0,e.datumIndex-e.datumIndexDelta,this.datumSelection.length-1),{datumIndexDelta:i,otherIndexDelta:s}=e;let r=this.removeMeIndexPathForIndex(t);const o=r.reduce((e,t)=>e.children[t],this.rootNode);if(s>0&&o.hasChildren)r=[...r,0];else if(s<0&&r.length>1)r=r.slice(0,-1);else if(0===s&&0!==i){const e=o.parent.children.length-1;r=r.slice(),r[r.length-1]=(0,n.qE)(0,r[r.length-1]+i,e)}const a=r.reduce((e,t)=>e.children[t],this.rootNode),l=this.computeFocusBounds(this.datumSelection.at(t+1));return null!=l?{datum:a,datumIndex:this.removeMeIndexForIndexPath(r),otherIndex:a.depth,bounds:l,clipFocusBox:!0}:void 0}getDatumAriaText(e,t){if(e instanceof this.NodeClass)return this.ctx.localeManager.t("ariaAnnounceHierarchyDatum",{level:(e.depth??-1)+1,count:e.children.length,description:t});n.Vy.error(`datum is not HierarchyNode: ${JSON.stringify(e)}`)}getCategoryValue(e){}datumIndexForCategoryValue(e){}},Nw=class extends kp{constructor(){super(...arguments),this.childrenKey="children",this.fills=Object.values(Xm),this.fillGradientDefaults=new Tp,this.fillPatternDefaults=new Dp,this.fillImageDefaults=new Ip,this.strokes=Object.values(Zm)}};a([Te],Nw.prototype,"childrenKey",2),a([Te],Nw.prototype,"sizeKey",2),a([Te],Nw.prototype,"colorKey",2),a([Te],Nw.prototype,"colorName",2),a([Te],Nw.prototype,"fills",2),a([Te],Nw.prototype,"fillGradientDefaults",2),a([Te],Nw.prototype,"fillPatternDefaults",2),a([Te],Nw.prototype,"fillImageDefaults",2),a([Te],Nw.prototype,"strokes",2),a([Te],Nw.prototype,"colorRange",2);var Ow=class{constructor(e,t,i,n){this.lon0=e,this.lat0=t,this.lon1=i,this.lat1=n}merge(e){this.lon0=Math.min(this.lon0,e.lon0),this.lat0=Math.min(this.lat0,e.lat0),this.lon1=Math.max(this.lon1,e.lon1),this.lat1=Math.max(this.lat1,e.lat1)}},Fw=Math.PI/180,Gw=e=>e*Fw,Bw=e=>-Math.log(Math.tan(.25*Math.PI+e*Fw*.5)),Vw=e=>e/Fw,Hw=e=>(Math.atan(Math.exp(-e))-.25*Math.PI)/(.5*Fw),Uw=class e extends ye{constructor(t,i){super(),this.domain=t,this.range=i,this.type="mercator",this.bounds=e.bounds(t)}static bounds(e){const[[t,i],[n,s]]=e,r=Gw(t),o=Bw(i),a=Gw(n),l=Bw(s);return new m(Math.min(r,a),Math.min(o,l),Math.abs(a-r),Math.abs(l-o))}static fixedScale(){return new e([[Vw(0),Hw(0)],[Vw(1),Hw(1)]],[[0,0],[1,1]])}toDomain(){}normalizeDomains(...e){let t=-1/0,i=1/0,n=-1/0,s=1/0;for(const r of e)for(const[e,o]of r)t=Math.min(e,t),i=Math.max(e,i),n=Math.min(o,n),s=Math.max(o,s);return{domain:[[t,n],[i,s]],animatable:!0}}convert([e,t]){const[[i,n],[s,r]]=this.range,o=(s-i)/this.bounds.width,a=(r-n)/this.bounds.height;return[(Gw(e)-this.bounds.x)*o+i,(Bw(t)-this.bounds.y)*a+n]}invert([e,t]){const[[i,n],[s,r]]=this.range,o=(s-i)/this.bounds.width,a=(r-n)/this.bounds.height;return[Vw((e-i)/o+this.bounds.x),Hw((t-n)/a+this.bounds.y)]}},zw=class e{constructor(){this.id=(0,n.sX)(this),this.axisGroup=new It({name:`${this.id}-AxisTicks`,zIndex:2}),this.labelSelection=da.select(this.axisGroup,_i),this.interval=new yl,this.label=new vl,this.scale=new Vu,this.position="bottom",this.translationX=0,this.translationY=0,this.padding=0}attachAxis(e){e.appendChild(this.axisGroup)}calculateLayout(){const e=[],t=this.generateTicks(),{translationX:i,translationY:n}=this;return this.labelSelection.update(t.ticks.map(e=>this.createLabelDatum(e)),void 0,e=>e.tickId),this.labelSelection.each((t,i)=>{t.setProperties(i),i.visible&&e.push(t.getBBox())}),this.axisGroup.setProperties({translationX:i,translationY:n}),e.length>0?m.merge(e):void 0}getLabelParams(e){const{padding:t}=this,{translate:i}=e;switch(this.position){case"top":case"bottom":return{x:i,y:t,textAlign:"center",textBaseline:"top"};case"left":case"right":return{x:t,y:i,textAlign:"start",textBaseline:"middle"}}}inRange(e,t=.001){const[i,n]=or(this.scale.range);return e>=i-t&&e<=n+t}createLabelDatum(e){const{x:t,y:i,textBaseline:n,textAlign:s}=this.getLabelParams(e);return{visible:Boolean(e.tickLabel),tickId:e.tickId,fill:this.label.color,fontFamily:this.label.fontFamily,fontSize:this.label.fontSize,fontStyle:this.label.fontStyle,fontWeight:this.label.fontWeight,rotation:0,rotationCenterX:0,text:e.tickLabel,textAlign:s,textBaseline:n,x:t,y:i}}generateTicks(){const{minSpacing:t,maxSpacing:i}=this.interval,{maxTickCount:n,minTickCount:s,tickCount:r}=qa(ar(this.scale.range),1,t,i,e.DefaultTickCount,e.DefaultMinSpacing),o=this.getTicksData({nice:!0,interval:this.interval.step,tickCount:r,minTickCount:s,maxTickCount:n});if("bottom"===this.position||"top"===this.position){const e=Di.getMeasurer({font:this.label}),{domain:t}=this.scale,i=t[0]>t[1]?-1:1;let n=-1/0*i;o.ticks=o.ticks.filter(t=>Math.sign(t.translate-n)===i&&(n=t.translate+e.textWidth(t.tickLabel,!0)*i,!0))}return o}getTicksData(e){const t=[],i=e.nice?this.scale.niceDomain(e):this.scale.domain,s=this.scale.ticks(e,i)?.ticks??[],r=s.reduce((e,t)=>Math.max(e,(0,n.o3)(t)),0),o=[],a=zl(),l="string"==typeof this.label.format?this.scale.tickFormatter({domain:i,ticks:s,fractionDigits:r,specifier:this.label.format}):e=>Gn(e,r);for(let e=0;e<s.length;e++){const n=s[e],c=this.scale.convert(n);if(!this.inRange(c))continue;const h=this.label.formatter?.({value:n,index:e,domain:i,fractionDigits:r,boundSeries:o})??l(n),u=a(h);t.push({tick:n,tickId:u,tickLabel:h,translate:c})}return{rawTicks:s,fractionDigits:r,ticks:t}}};zw.DefaultTickCount=5,zw.DefaultMinSpacing=10;var Ww=zw,jw={top:{xTranslationDirection:0,yTranslationDirection:-1},bottom:{xTranslationDirection:0,yTranslationDirection:1},left:{xTranslationDirection:-1,yTranslationDirection:0},right:{xTranslationDirection:1,yTranslationDirection:0},"top-left":{xTranslationDirection:1,yTranslationDirection:-1},"top-right":{xTranslationDirection:-1,yTranslationDirection:-1},"bottom-left":{xTranslationDirection:1,yTranslationDirection:1},"bottom-right":{xTranslationDirection:-1,yTranslationDirection:1},inside:{xTranslationDirection:0,yTranslationDirection:0},"inside-left":{xTranslationDirection:1,yTranslationDirection:0},"inside-right":{xTranslationDirection:-1,yTranslationDirection:0},"inside-top":{xTranslationDirection:0,yTranslationDirection:1},"inside-bottom":{xTranslationDirection:0,yTranslationDirection:-1},"inside-top-left":{xTranslationDirection:1,yTranslationDirection:1},"inside-bottom-left":{xTranslationDirection:1,yTranslationDirection:-1},"inside-top-right":{xTranslationDirection:-1,yTranslationDirection:1},"inside-bottom-right":{xTranslationDirection:-1,yTranslationDirection:-1}},$w={top:{xTranslationDirection:1,yTranslationDirection:0},bottom:{xTranslationDirection:-1,yTranslationDirection:0},left:{xTranslationDirection:0,yTranslationDirection:-1},right:{xTranslationDirection:0,yTranslationDirection:1},"top-left":{xTranslationDirection:-1,yTranslationDirection:-1},"top-right":{xTranslationDirection:-1,yTranslationDirection:1},"bottom-left":{xTranslationDirection:1,yTranslationDirection:-1},"bottom-right":{xTranslationDirection:1,yTranslationDirection:1},inside:{xTranslationDirection:0,yTranslationDirection:0},"inside-left":{xTranslationDirection:0,yTranslationDirection:1},"inside-right":{xTranslationDirection:0,yTranslationDirection:-1},"inside-top":{xTranslationDirection:-1,yTranslationDirection:0},"inside-bottom":{xTranslationDirection:1,yTranslationDirection:0},"inside-top-left":{xTranslationDirection:-1,yTranslationDirection:1},"inside-bottom-left":{xTranslationDirection:1,yTranslationDirection:1},"inside-top-right":{xTranslationDirection:-1,yTranslationDirection:-1},"inside-bottom-right":{xTranslationDirection:1,yTranslationDirection:-1}};function Kw({yDirection:e,padding:t=0,position:i="top",bbox:n}){const s=e?jw:$w,{xTranslationDirection:r,yTranslationDirection:o}=s[i];return{xTranslation:r*(t+n.width/2),yTranslation:o*(t+n.height/2)}}function Yw(e,t){const i=(0,n.n)("button",Jw("ag-charts-input ag-charts-button",t));return void 0!==e.label?i.append(e.label):(i.append(Qw(e.icon)),i.ariaLabel=e.altText),i.addEventListener("click",e.onPress),(0,n.Wp)(i,t),i}function qw(e,t){const i=(0,n.n)("input",Jw("ag-charts-input ag-charts-checkbox",t));return i.type="checkbox",i.checked=e.checked,i.addEventListener("change",t=>e.onChange(i.checked,t)),i.addEventListener("keydown",e=>{yn(e)&&(e.preventDefault(),i.click())}),(0,n.Wp)(i,t),i}function Xw(e,t){const i=(0,n.n)("select",Jw("ag-charts-input ag-charts-select",t));return i.append(...e.options.map(e=>{const t=(0,n.n)("option");return t.value=e.value,t.textContent=e.label,t})),(0,n.Bq)(i,"data-preventdefault",!1),i.value=e.value,i.addEventListener("change",t=>e.onChange(i.value,t)),(0,n.Wp)(i,t),i}function Zw(e,t){const i=(0,n.n)("textarea",Jw("ag-charts-input ag-charts-textarea",t));return i.value=e.value,i.addEventListener("input",t=>e.onChange(i.value,t)),(0,n.Wp)(i,t),(0,n.Bq)(i,"data-preventdefault",!1),i}function Qw(e){const t=(0,n.n)("span",`ag-charts-icon ag-charts-icon-${e}`);return(0,n.Bq)(t,"aria-hidden",!0),t}function Jw(e,t){return null==t?e:`${e} ${t.class}`}var eS=class extends Cc{constructor(e=""){super(),this.x=0,this.y=0,this.commands=[],this._d="",this.d=e}get d(){return this._d}set d(e){if(e!==this._d){this._d=e,this.commands.length=0;for(const[t,i,n]of e.matchAll(/([A-Z])([0-9. ]*)/g)){const e=n.split(/\s+/g).map(Number);this.commands.push([i,e])}this.checkPathDirty()}}updatePath(){const{path:e,x:t,y:i}=this;e.clear();let n=t,s=i;for(const[r,o]of this.commands)switch(r){case"M":e.moveTo(t+o[0],i+o[1]),n=t+o[0];break;case"C":e.cubicCurveTo(t+o[0],i+o[1],t+o[2],i+o[3],t+o[4],i+o[5]),n=t+o[4],s=i+o[5];break;case"H":e.lineTo(t+o[0],s),n=i+o[0];break;case"L":e.lineTo(t+o[0],i+o[1]),n=t+o[0],s=i+o[1];break;case"V":e.lineTo(n,i+o[0]),s=i+o[0];break;case"Z":e.closePath();break;default:throw new Error(`Could not translate command '${r}' with '${o.join(" ")}'`)}e.closePath()}};a([K()],eS.prototype,"x",2),a([K()],eS.prototype,"y",2);var tS=class extends J{constructor(e){super(),this.sourceImage=e,this.x=0,this.y=0,this.width=0,this.height=0,this.opacity=1}render(e){const{ctx:t}=e,i=this.sourceImage;i&&(t.globalAlpha=this.opacity,t.drawImage(i,0,0,i.width,i.height,this.x,this.y,this.width,this.height)),super.render(e)}};a([K()],tS.prototype,"x",2),a([K()],tS.prototype,"y",2),a([K()],tS.prototype,"width",2),a([K()],tS.prototype,"height",2),a([K()],tS.prototype,"opacity",2);var iS={};o(iS,{ButtonWidget:()=>Pn,MenuItemWidget:()=>nS,MenuWidget:()=>rS,NativeWidget:()=>On,SliderWidget:()=>zn,ToolbarWidget:()=>jn,WIDGET_HTML_EVENTS:()=>ui,Widget:()=>Mi,WidgetEventUtil:()=>fi});var nS=class extends kn{constructor(){super((0,n.n)("div"),"menuitem")}},sS=["Escape","ArrowLeft"],rS=class e extends Ln{constructor(e="vertical"){super(e,"menu"),this.closeSubMenu=e=>this.openSubMenu(e,void 0)}destructor(){this.selfClose("2")}addSeparator(){const e=(0,n.YE)().createElement("div");return(0,n.Bq)(e,"role","separator"),this.elem.appendChild(e),e}onChildAdded(e){super.onChildAdded(e),e.hasPopup()||e.addListener("mouseenter",this.closeSubMenu)}onChildRemoved(e){super.onChildRemoved(e),e.hasPopup()||e.removeListener("mouseenter",this.closeSubMenu)}addSubMenu(){const t=new nS,i=(0,n.wW)(),s=new e(this.orientation),r=e=>{t.isDisabled()||this.openSubMenu(e,s)};return t.setAriaHasPopup("menu"),t.setAriaExpanded(!1),t.setAriaControls(i),t.addListener("click",r),t.addListener("mouseenter",r),t.addListener("keydown",e=>{ln(e.sourceEvent)&&"ArrowRight"===e.sourceEvent.code&&r(e)}),s.addListener("close-widget",()=>t.setAriaExpanded(!1)),s.addListener("open-widget",()=>t.setAriaExpanded(!0)),s.id=i,this.addChild(t),{subMenuButton:t,subMenu:s}}openSubMenu(e,t){const{openScope:i}=this;i&&(i.openSubMenu?.selfClose("4"),t?.open(e),i.openSubMenu=t)}open(e,t){const{overrideFocusVisible:i}=t??{};if(null!=this.openScope)return;this.openScope={lastFocus:vn(e.sourceEvent),openSubMenu:void 0,abort:()=>this.selfClose("1"),close:()=>this.selfClose("0"),removers:new $i};const s=this.children.map(e=>e.getElement());(0,n.Bq)(this.openScope.lastFocus,"aria-expanded",!0),sn(this.openScope.removers,this.elem,this.openScope.abort),rn(this.openScope.removers,this.elem,this.openScope.abort);for(const e of this.children)nn(this.openScope.removers,e.getElement(),this.openScope.close,sS);void 0!==i&&an(this.openScope.removers,this.elem,s,i),this.internalListener?.dispatch("open-widget",this,{type:"open-widget"}),this.children[0]?.focus({preventScroll:!0})}selfClose(e){if(void 0===this.openScope)return;const{lastFocus:t,removers:i,openSubMenu:s}=this.openScope;this.openScope=void 0,s?.selfClose("3"),(0,n.Bq)(t,"aria-expanded",!1),"0"===e&&t?.focus({preventScroll:!0}),i.destroy(),this.internalListener?.dispatch("close-widget",this,{type:"close-widget"})}close(){this.selfClose("0")}},oS="canvas-overlay",aS=class extends l{constructor(e,t,i){super(),this.ctx=e,this.hideFns=[],this.moduleId=`popover-${t}`,this.element=i?.detached?(0,n.n)("div"):e.domManager.addChild(oS,this.moduleId),this.element.setAttribute("role","presentation"),this.destroyFns.push(()=>e.domManager.removeChild(oS,this.moduleId))}attachTo(e){this.element.parentElement||e.element.append(this.element)}hide(e){const{lastFocus:t=this.lastFocus}=e??{};0!==this.element.children.length&&(this.hideFns.forEach(e=>e()),t?.focus(),this.lastFocus=void 0)}removeChildren(){this.element.replaceChildren()}showWithChildren(e,t){if(!this.element.parentElement)throw new Error("Can not show popover that has not been attached to a parent.");const i=(0,n.n)("div","ag-charts-popover");if(null!=t.ariaLabel&&i.setAttribute("aria-label",t.ariaLabel),null!=t.class&&i.classList.add(t.class),i.replaceChildren(...e),this.element.replaceChildren(i),this.hideFns.push(()=>this.removeChildren()),t.onHide&&this.hideFns.push(t.onHide),t.initialFocus&&t.sourceEvent){const e=vn(t.sourceEvent);void 0!==e&&(this.lastFocus=e,this.initialFocus=t.initialFocus)}return i}getPopoverElement(){return this.element.firstElementChild}updatePosition(e){const t=this.getPopoverElement();t&&(t.style.setProperty("right","unset"),t.style.setProperty("bottom","unset"),null!=e.x&&t.style.setProperty("left",`${Math.floor(e.x)}px`),null!=e.y&&t.style.setProperty("top",`${Math.floor(e.y)}px`),this.initialFocus?.focus(),this.initialFocus=void 0)}},lS=class extends aS{setAnchor(e,t){this.anchor=e,this.fallbackAnchor=t,this.updatePosition(e),this.repositionWithinBounds()}showWithChildren(e,t){const i=t.anchor??this.anchor,s=t.fallbackAnchor??this.fallbackAnchor,r=super.showWithChildren(e,t);return i&&this.setAnchor(i,s),(0,n.zk)().requestAnimationFrame(()=>{this.repositionWithinBounds()}),r}repositionWithinBounds(){const{anchor:e,ctx:t,fallbackAnchor:i}=this,s=this.getPopoverElement();if(!e||!s)return;const r=t.domManager.getBoundingClientRect(),{offsetWidth:o,offsetHeight:a}=s;let l=(0,n.qE)(0,e.x,r.width-o),c=(0,n.qE)(0,e.y,r.height-a);l!==e.x&&null!=i?.x&&(l=(0,n.qE)(0,i.x-o,r.width-o)),c!==e.y&&null!=i?.y&&(c=(0,n.qE)(0,i.y-a,r.height-a)),this.updatePosition({x:l,y:c})}},cS=class extends lS{show(e){const t=e.items.map(t=>this.createRow(e,t)),i=this.showWithChildren(t,e);i.classList.add("ag-charts-menu"),i.setAttribute("role","menu"),this.menuCloser=fn({orientation:"vertical",menu:i,buttons:t,sourceEvent:e.sourceEvent,closeCallback:()=>this.hide()}),this.hideFns.push(()=>{this.menuCloser?.finishClosing(),this.menuCloser=void 0})}createRow(e,t){const{menuItemRole:i="menuitem"}=e,s=t.value===e.value,r=(0,n.n)("div","ag-charts-menu__row");if(r.setAttribute("role",i),"menuitemradio"===i&&r.setAttribute("aria-checked",(e.value===t.value).toString()),"string"==typeof t.value&&(r.dataset.popoverId=t.value),r.classList.toggle("ag-charts-menu__row--active",s),null!=t.icon){const e=(0,n.n)("span",`ag-charts-menu__icon ${Nt(t.icon)}`);r.appendChild(e)}const o=null!=t.strokeWidth;if(o&&(r.classList.toggle("ag-charts-menu__row--stroke-width-visible",o),r.style.setProperty("--strokeWidth",o?`${t.strokeWidth}px`:null)),null!=t.label){const e=(0,n.n)("span","ag-charts-menu__label");e.textContent=this.ctx.localeManager.t(t.label),r.appendChild(e)}"altText"in t&&(r.ariaLabel=this.ctx.localeManager.t(t.altText));const a=i=>{yn(i)&&(e.onPress?.(t),i.preventDefault(),i.stopPropagation())};return r.addEventListener("keydown",a),r.addEventListener("click",a),r.addEventListener("mousemove",()=>{r.focus({preventScroll:!0})}),r}},hS=class extends aS{constructor(){super(...arguments),this.dragged=!1}setDragHandle(e){e.addListener("drag-start",t=>{e.addClass(this.dragHandleDraggingClass),this.onDragStart(t)}),e.addListener("drag-move",this.onDragMove.bind(this)),e.addListener("drag-end",()=>{e.removeClass(this.dragHandleDraggingClass),this.onDragEnd.bind(this)})}onDragStart(e){const t=this.getPopoverElement();t&&(e.sourceEvent.preventDefault(),this.dragged=!0,this.dragStartState={client:Iw.from(e.clientX,e.clientY),position:Iw.from(Number(t.style.getPropertyValue("left").replace("px","")),Number(t.style.getPropertyValue("top").replace("px","")))})}onDragMove(e){const{dragStartState:t}=this,i=this.getPopoverElement();if(!t||!i)return;const n=Iw.sub(Iw.from(e.clientX,e.clientY),t.client),s=Iw.add(t.position,n),r=this.ctx.domManager.getBoundingClientRect(),o={};s.x>=0&&s.x+i.offsetWidth<=r.width&&(o.x=s.x),s.y>=0&&s.y+i.offsetHeight<=r.height&&(o.y=s.y),this.updatePosition(o)}onDragEnd(){this.dragStartState=void 0}},uS=class extends De{};a([Te],uS.prototype,"icon",2),a([Te],uS.prototype,"label",2),a([Te],uS.prototype,"ariaLabel",2),a([Te],uS.prototype,"tooltip",2);var dS=class extends Pn{constructor(e){super(),this.localeManager=e}update(e){const{localeManager:t}=this;e.tooltip&&(this.elem.title=t.t(e.tooltip));let i="";null!=e.icon&&(i=`<span class="${Nt(e.icon)} ag-charts-toolbar__icon"></span>`),null!=e.label&&(i=`${i}<span class="ag-charts-toolbar__label">${t.t(e.label)}</span>`),this.elem.innerHTML=i}setChecked(e){(0,n.Bq)(this.elem,"aria-checked",e)}},pS="ag-charts-toolbar__button--active",gS=class extends jn{constructor(e,t="horizontal"){super(t),this.localeManager=e,this.horizontalSpacing=10,this.verticalSpacing=10,this.events=new Qi,this.hasPrefix=!1,this.buttonWidgets=[],this.addClass("ag-charts-toolbar"),this.toggleClass("ag-charts-toolbar--horizontal","horizontal"===t),this.toggleClass("ag-charts-toolbar--vertical","vertical"===t)}addToolbarListener(e,t){return this.events.addListener(e,t)}clearButtons(){for(const e of this.buttonWidgets)e.destroy();this.buttonWidgets.splice(0)}updateButtons(e){const{buttonWidgets:t}=this;for(const[t,i]of e.entries())(this.buttonWidgets.at(t)??this.createButton(t,i)).update(i);for(let i=e.length;i<t.length;i++){const e=this.buttonWidgets.at(i);e?.destroy()}this.buttonWidgets.splice(e.length),this.refreshButtonClasses()}updateButtonByIndex(e,t){this.buttonWidgets.at(e)?.update(t)}clearActiveButton(){for(const e of this.buttonWidgets)e.toggleClass(pS,!1)}toggleActiveButtonByIndex(e){if(-1!==e)for(const[t,i]of this.buttonWidgets.entries())i.toggleClass(pS,null!=e&&e===t)}toggleButtonEnabledByIndex(e,t){-1!==e&&this.buttonWidgets.at(e)?.setEnabled(t)}toggleSwitchCheckedByIndex(e,t){-1!==e&&this.buttonWidgets.at(e)?.setChecked(t)}getButtonBounds(){return this.buttonWidgets.map(e=>this.getButtonWidgetBounds(e))}setButtonHiddenByIndex(e,t){this.buttonWidgets.at(e)?.setHidden(t)}getButtonWidgetBounds(e){const t=this.getBounds(),i=e.getBounds();return new m(i.x+t.x,i.y+t.y,i.width,i.height)}refreshButtonClasses(){const{buttonWidgets:e,hasPrefix:t}=this;let i,n,s;for(const[r,o]of e.entries())i=!t&&0===r||s!=o.section,n=r===e.length-1||o.section!=e.at(r+1)?.section,o.toggleClass("ag-charts-toolbar__button--first",i),o.toggleClass("ag-charts-toolbar__button--last",n),o.toggleClass("ag-charts-toolbar__button--gap",r>0&&i),s=o.section}createButton(e,t){const i=this.createButtonWidget();return i.addClass("ag-charts-toolbar__button"),i.addListener("click",n=>{const s={index:e,...t instanceof De?t.toJson():t},r=this.getButtonWidgetBounds(i);this.events.dispatch("button-pressed",{event:n,button:s,buttonBounds:r})}),i.addListener("focus",()=>{this.events.dispatch("button-focused",{button:{index:e}})}),t.section&&(i.section=t.section),this.buttonWidgets.push(i),this.addChild(i),i}},fS=class extends gS{createButtonWidget(){return new dS(this.localeManager)}},mS=class extends hS{constructor(e,t,i){super(e,t),this.onPopoverMoved=i,this.dragHandleDraggingClass="ag-charts-floating-toolbar__drag-handle--dragging"}show(e,t={}){this.showWithChildren(e,{...t,class:"ag-charts-floating-toolbar"})}hide(){this.dragged=!1,super.hide()}getBounds(){const e=this.getPopoverElement();return new m(e?.offsetLeft??0,e?.offsetTop??0,e?.offsetWidth??0,e?.offsetHeight??0)}hasBeenDragged(){return this.dragged}setAnchor(e,t,i){const n=this.getPopoverElement();if(!n)return;const s=e.position??"above",{offsetWidth:r,offsetHeight:o}=n;let a=e.y-o-i,l=e.x-r/2;"below"===s?a=e.y+i:"right"===s?(a=e.y-o/2,l=e.x+t):"above-left"===s&&(l=e.x),this.updatePosition({x:l,y:a})}ignorePointerEvents(){const e=this.getPopoverElement();e&&(e.style.pointerEvents="none")}capturePointerEvents(){const e=this.getPopoverElement();e&&(e.style.pointerEvents="unset")}updatePosition(e){const t=this.getBounds(),i=this.ctx.domManager.getBoundingClientRect();e.x=Math.floor((0,n.qE)(0,e.x,i.width-t.width)),e.y=Math.floor((0,n.qE)(0,e.y,i.height-t.height)),super.updatePosition(e),this.onPopoverMoved()}},yS=class extends gS{constructor(e,t){super(e.localeManager),this.hasPrefix=!0,this.popover=new mS(e,t,this.onPopoverMoved.bind(this)),this.dragHandle=new vS(e.localeManager.t("toolbarAnnotationsDragHandle")),this.popover.setDragHandle(this.dragHandle)}show(e={}){this.popover.show([this.dragHandle.getElement(),this.getElement()],e)}hide(){this.popover.hide()}setAnchor(e){this.popover.setAnchor(e,this.horizontalSpacing,this.verticalSpacing)}hasBeenDragged(){return this.popover.hasBeenDragged()}ignorePointerEvents(){this.popover.ignorePointerEvents()}capturePointerEvents(){this.popover.capturePointerEvents()}onPopoverMoved(){const e=this.popover.getBounds();if(this.popoverBounds?.equals(e))return;this.popoverBounds=e.clone();const t=this.getButtonBounds();this.events.dispatch("toolbar-moved",{popoverBounds:e,buttonBounds:t})}getButtonWidgetBounds(e){const t=this.popover.getBounds(),i=super.getButtonWidgetBounds(e),n=this.dragHandle.getBounds();return new m(i.x+t.x-n.width,i.y+t.y,i.width,i.height)}},vS=class extends On{constructor(e){super((0,n.n)("div","ag-charts-floating-toolbar__drag-handle"));const t=new On((0,n.n)("span",`${Nt("drag-handle")} ag-charts-toolbar__icon`));t.setAriaHidden(!0),this.addChild(t),this.elem.title=e}},bS={...ra,...ha};mw.create.bind(mw),mw.__createSparkline.bind(mw)},26203(e,t,i){"use strict";i.d(t,{$1:()=>Dt,$P:()=>V,$r:()=>mt,$z:()=>vt,AF:()=>rt,Am:()=>yt,Bf:()=>Y,Bk:()=>fe,Bm:()=>Z,Bq:()=>_t,By:()=>de,CG:()=>He,D$:()=>Nt,E2:()=>Te,E3:()=>Ht,EG:()=>wt,EM:()=>Ot,Et:()=>K,F4:()=>Vt,FJ:()=>O,Fq:()=>$t,Fu:()=>ut,GB:()=>Kt,GT:()=>Yt,GY:()=>at,Gv:()=>W,Hs:()=>Ft,I5:()=>Gt,I_:()=>Je,Ik:()=>Pe,Is:()=>F,J$:()=>Ye,Jp:()=>ht,KC:()=>We,Kg:()=>$,LV:()=>ft,Ly:()=>Be,MM:()=>ze,MP:()=>st,MX:()=>Ve,O9:()=>Ne,OR:()=>di,Qd:()=>j,R3:()=>qe,Rp:()=>Tt,S3:()=>Bt,Sc:()=>Le,Tn:()=>z,Uo:()=>Se,Vy:()=>r,W$:()=>ye,Wp:()=>Lt,XK:()=>Ct,Xe:()=>Ue,Xl:()=>X,YE:()=>k,YI:()=>Xe,YO:()=>Ae,YX:()=>Wt,Yj:()=>_e,Zd:()=>lt,_9:()=>_,_L:()=>be,ai:()=>ke,bX:()=>Q,bk:()=>I,cI:()=>jt,cy:()=>B,d1:()=>L,dY:()=>je,eW:()=>ii,eh:()=>Ze,fN:()=>Ge,fd:()=>Ce,gd:()=>U,hR:()=>$e,hz:()=>tt,iN:()=>Et,ie:()=>he,is:()=>we,jO:()=>It,jj:()=>gt,jk:()=>Ke,lk:()=>ai,lp:()=>ie,lt:()=>se,mL:()=>dt,mw:()=>ve,n:()=>N,nF:()=>ee,nR:()=>y,nl:()=>Mt,nm:()=>St,o3:()=>qt,or:()=>xe,p6:()=>Ie,qE:()=>Ut,r1:()=>bt,r4:()=>zt,sA:()=>ui,sX:()=>ri,sg:()=>J,sw:()=>Re,sy:()=>m,t$:()=>hi,tf:()=>me,uE:()=>q,v7:()=>At,vM:()=>G,vd:()=>H,wW:()=>oi,wi:()=>ot,xA:()=>xt,yI:()=>ge,yW:()=>De,zM:()=>Me,zk:()=>P});var n=Object.defineProperty,s=(e,t)=>{for(var i in t)n(e,i,{get:t[i],enumerable:!0})},r={};s(r,{error:()=>c,errorOnce:()=>p,log:()=>a,logGroup:()=>f,reset:()=>g,table:()=>h,warn:()=>l,warnOnce:()=>d});var o=new Set;function a(...e){console.log(...e)}function l(e,...t){console.warn(`AG Charts - ${e}`,...t)}function c(e,...t){"object"==typeof e?console.error("AG Charts error",e,...t):console.error(`AG Charts - ${e}`,...t)}function h(...e){console.table(...e)}function u(e,t,i){let n;n=e instanceof Error?e.message:"string"==typeof e?e:"object"==typeof e?JSON.stringify(e):String(e);const s=`${t}: ${n}`;o.has(s)||(i(e),o.add(s))}function d(e,...t){u(e,"Logger.warn",e=>l(e,...t))}function p(e,...t){u(e,"Logger.error",e=>c(e,...t))}function g(){o.clear()}function f(e,t){console.groupCollapsed(e);try{return t()}finally{console.groupEnd()}}var m={};s(m,{detectChartDefinition:()=>E,getAxisModule:()=>A,getPresetModule:()=>M,getSeriesModule:()=>T,hasModule:()=>S,listModulesByType:()=>x,register:()=>b,registerMany:()=>C,reset:()=>w});var y=(e=>(e.Axis="axis",e.Chart="chart",e.Preset="preset",e.Plugin="plugin",e.Series="series",e))(y||{}),v=new Map;function b(e){const t=v.get(e.name);if(t&&(t.enterprise||!e.enterprise))throw new Error(`AG Charts - Module '${e.name}' already registered`);v.set(e.name,e)}function C(e){for(const t of e)b(t)}function w(){v.clear()}function S(e){return v.has(e)}function*x(e){for(const t of v.values())D(e,t)&&(yield t)}function E(e){for(const t of v.values())if(D("chart",t)&&t.detect(e))return t;throw new Error("AG Charts - Unknown chart type; Check options are correctly structured and series types are specified")}function A(e){const t=v.get(e);if(D("axis",t))return t}function M(e){const t=v.get(e);if(D("preset",t))return t}function T(e){const t=v.get(e);if(D("series",t))return t}function D(e,t){return t?.type===e}var I=class{constructor(){this.events=new Map}on(e,t){return this.events.has(e)||this.events.set(e,new Set),this.events.get(e)?.add(t),()=>this.off(e,t)}off(e,t){const i=this.events.get(e);i&&(i.delete(t),0===i.size&&this.events.delete(e))}emit(e,t){this.events.get(e)?.forEach(e=>e(t))}clear(e){e?this.events.delete(e):this.events.clear()}},R={};function k(e){return e?R.document?.[e]:R.document}function P(e){return e?R.window?.[e]:R.window}function _(e){R.document=e}function L(e){R.window=e}function N(e,t,i){const n=k().createElement(e);if("object"==typeof t&&(i=t,t=void 0),t)for(const e of t.split(" "))n.classList.add(e);return i&&Object.assign(n.style,i),n}function O(e){return k().createElementNS("http://www.w3.org/2000/svg",e)}function F(e,t){const i=k("body"),n=N("a",{display:"none"});n.href=e,n.download=t,i.appendChild(n),n.click(),setTimeout(()=>i.removeChild(n))}function G(e){return null!=e}function B(e){return Array.isArray(e)}function V(e){return e instanceof Date}function H(e){return V(e)&&!isNaN(Number(e))}function U(e){return e instanceof RegExp}function z(e){return"function"==typeof e}function W(e){return"object"==typeof e&&null!==e&&!B(e)}function j(e){return"object"==typeof e&&null!==e&&"Object"===e.constructor?.name}function $(e){return"string"==typeof e}function K(e){return"number"==typeof e}function Y(e){return Number.isFinite(e)}function q(e){return"undefined"!=typeof window&&e instanceof HTMLElement}function X(e,t){return Object.values(e).includes(t)}function Z(e){return"symbol"==typeof e}function Q(e,t){return e in t}function J(e,t=0,i){const{leading:n=!1,trailing:s=!0,maxWait:r=1/0}=i??{};let o,a;if(r<t)throw new Error("Value of maxWait cannot be lower than waitMs.");return Object.assign(function(...i){if(n&&!a)return a=Date.now(),o=setTimeout(()=>a=null,t),void e(...i);let l=t;if(r!==1/0&&a){const e=Date.now()-a;t>r-e&&(l=r-e)}clearTimeout(o),a??(a=Date.now()),o=setTimeout(()=>{a=null,s&&e(...i)},l)},{cancel(){clearTimeout(o),a=null}})}function ee(e,t,i){const{leading:n=!0,trailing:s=!0}=i??{};let r,o,a=!1;function l(){s&&o?(r=setTimeout(l,t),e(...o)):a=!1,o=null}return Object.assign(function(...i){a?o=i:(a=!0,r=setTimeout(l,t),n?e(...i):o=i)},{cancel(){clearTimeout(r),a=!1,o=null}})}function te(e,t,i=""){try{return e(...t)}catch(e){d("Uncaught exception in user callback"+(i?` \`${i}\``:""),e)}}function ie(e,t="and",i=String,n=1/0){if(0===e.length)return"";if(1===e.length)return i(e[0]);const s=(e=e.map(i)).pop();if(e.length>=n){const i=e.length-(n-1);return`${e.slice(0,n-1).join(", ")}, and ${i} more ${t} ${s}`}return`${e.join(", ")} ${t} ${s}`}function ne(e,t=1/0){if("number"==typeof e){if(isNaN(e))return"NaN";if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity"}const i=JSON.stringify(e)??typeof e;return i.length>t?`${i.slice(0,t)}... (+${i.length-t} characters)`:i}function se(e){let t=1;for(let i=0;i<e.length;i++)10===e.charCodeAt(i)&&t++;return t}function re(e,t){if(e===t)return 0;const[i,n]=e.length<t.length?[e,t]:[t,e],s=i.length,r=n.length;let o=new Array(s+1).fill(0).map((e,t)=>t),a=new Array(s+1);for(let e=1;e<=r;e++){a[0]=e;for(let t=1;t<=s;t++){const s=n[e-1]===i[t-1]?0:1;a[t]=Math.min(o[t]+1,a[t-1]+1,o[t-1]+s)}[o,a]=[a,o]}return o[s]}"undefined"!=typeof window?R.window=window:"undefined"!=typeof globalThis&&(R.window=globalThis.window),"undefined"!=typeof document?R.document=document:"undefined"!=typeof globalThis&&(R.document=globalThis.document);var oe=Symbol("description"),ae=Symbol("required"),le=Symbol("marked"),ce=Symbol("undocumented"),he=Symbol("union"),ue=[["placement","position"],["padding","spacing","gap"],["color","fill","stroke"],["whisker","wick"],["nodeClick","seriesNodeClick"],["nodeDoubleClick","seriesNodeDoubleClick"],["src","url"]].reduce((e,t)=>{for(const i of t)e.set(i.toLowerCase(),new Set(t.filter(e=>e!==i)));return e},new Map),de=(e=>(e.Invalid="invalid",e.Required="required",e.Unknown="unknown",e))(de||{});function pe(e,t){return Y(t)?`${e}[${t}]`:e?`${e}.${t}`:t}var ge=class{constructor(e,t,i,n,s){this.type=e,this.description=t,this.value=i,this.path=n,this.key=s}setUnionType(e,t){if(this.path.startsWith(t)){const i=this.path.slice(t.length);this.altPath=`${t}[type=${e}]${i}`}}getPrefix(){const{altPath:e=this.path,key:t}=this;return e||t?`Option \`${t?pe(e,t):e}\``:"Value"}toString(){const{description:e="unknown",type:t,value:i}=this;return"required"===t&&null==i?`${this.getPrefix()} is required and has not been provided; expecting ${e}, ignoring.`:`${this.getPrefix()} cannot be set to \`${ne(i,50)}\`; expecting ${e}, ignoring.`}},fe=class extends ge{constructor(e,t,i,n){super("unknown",void 0,t,i,n),this.suggestions=e,this.key=n}getPrefix(){return`Unknown option \`${pe(this.path,this.key)}\``}getPostfix(){const e=ie(function(e,t,i=2){const n=[],s=e.toLowerCase(),r=ue.get(s);for(const e of t){const t=e.toLowerCase();(r?.has(e)||t.includes(s)||re(s,t)<=i)&&n.push(e)}return n}(this.key,this.suggestions),"or",e=>`\`${e}\``);return e?`; Did you mean ${e}? Ignoring.`:", ignoring."}toString(){return`${this.getPrefix()}${this.getPostfix()}`}};function me(e,t,i=""){if(!W(e))return{cleared:null,invalid:[new ge("required","an object",e,i)]};const n={},s=[],r=new Set(Object.keys(e)),o=[];if(he in t){const r=Object.keys(t),o=t[he];if(null!=e.type&&r.includes(e.type)||null==e.type&&null!=o){const{type:r=o,...a}=e,l=me(a,t[r],i);Object.assign(n,{type:r},l.cleared);for(const e of l.invalid)e.setUnionType(r,i);s.push(...l.invalid)}else{const t=ie(r,"or",e=>`'${e}'`);s.push(new ge("required",`a keyword such as ${t}`,e.type,i,"type"))}return{cleared:n,invalid:s}}for(const a of Object.keys(t)){const l=t[a],c=l[ae],h=e[a];if(r.delete(a),void 0===h&&(l[ce]||o.push(a),!c))continue;const u=pe(i,a);if(z(l)){const t=l(h,{options:e,path:u});if("object"==typeof t){if(s.push(...t.invalid),t.valid){n[a]=t.cleared;continue}if(Ze(t.invalid,u))continue}else if(t){n[a]=h;continue}s.push(new ge(c?"required":"invalid",l[oe],h,i,a))}else{const e=me(h,l,u);null!=e.cleared&&(n[a]=e.cleared),s.push(...e.invalid)}}for(const t of r){const n=e[t];void 0!==n&&s.push(new fe(o,n,i,t))}return{cleared:n,invalid:s}}function ye(e,t){return Object.assign(z(e)?(t,i)=>e(t,i):{...e},{[oe]:t})}function ve(e){return Object.assign(z(e)?(t,i)=>e(t,i):Ce(e),{[ae]:!0,[oe]:e[oe]})}function be(e){return Object.assign(z(e)?(t,i)=>e(t,i):Ce(e),{[ce]:!0,[oe]:e[oe]})}var Ce=(e,t="an object")=>ye((t,i)=>{const n=me(t,e,i.path);return{valid:!Ze(n.invalid,i.path),cleared:n.cleared,invalid:n.invalid}},t),we=(e,t,i)=>({...e,[oe]:t,[he]:i}),Se=(...e)=>ye((t,i)=>{const n=[];for(const s of e){const e=s(t,i);if("object"==typeof e){if(n.push(...e.invalid),!e.valid)return{valid:!1,cleared:t,invalid:n};t=e.cleared}else if(!e)return!1}return{valid:!0,cleared:t,invalid:n}},e.map(e=>e[oe]).filter(Boolean).join(" and ")),xe=(...e)=>ye((t,i)=>{for(const n of e){const e=n(t,i);if("object"==typeof e?e.valid:e)return e}return!1},e.map(e=>e[oe]).filter(Boolean).join(" or ")),Ee=e=>Y(e)||H(e),Ae=ye(B,"an array"),Me=ye(function(e){return"boolean"==typeof e},"a boolean"),Te=ye(z,"a function"),De=ye(function(e){return $(e)&&("none"===e||null!=function(e){const t=P("Option"),{style:i}=new t;return i.color=e,i.color||null}(e))},"a color string"),Ie=ye(e=>V(e)||(Y(e)||$(e))&&H(new Date(e)),"a date"),Re=ye(G,"a defined value"),ke=ye(Y,"a number"),Pe=ye(W,"an object"),_e=ye($,"a string"),Le=ye(e=>"undefined"==typeof HTMLElement||e instanceof HTMLElement,"an html element"),Ne=(e,t=1/0)=>{let i;return i=t===1/0?`an array of at least ${e} items`:e===t?`an array of exactly ${e} items`:0===e?`an array of no more than ${t} items`:`an array of at least ${e} and no more than ${t} items`,ye(i=>B(i)&&i.length>=e&&i.length<=t,i)},Oe=(e,t=1/0)=>{let i;return i=t===1/0?`a string of at least ${e} characters`:e===t?`an string of exactly ${e} characters`:0===e?`an string of no more than ${t} characters`:`an string of at least ${e} and no more than ${t} characters`,ye(i=>$(i)&&i.length>=e&&i.length<=t,i)},Fe=(e,t=!0)=>ye(i=>Y(i)&&(i>e||t&&i===e),`a number greater than ${t?"or equal to ":""}${e}`),Ge=(e,t)=>ye(i=>Y(i)&&i>=e&&i<=t,`a number between ${e} and ${t} inclusive`),Be=Fe(0),Ve=Fe(0,!1),He=Ge(0,1),Ue=e=>ye((t,{options:i})=>!Ee(t)||!Ee(i[e])||t<i[e],`the value to be less than \`${e}\``),ze=e=>ye((t,{options:i})=>!Ee(t)||!Ee(i[e])||t>i[e],`the value to be greater than \`${e}\``);function We(...e){return W(e[0])&&(e=Object.values(e[0])),ye(t=>e.includes(t),`a keyword such as ${ie(e,"or",e=>`'${e}'`)}`)}var je=e=>ye(t=>e===t,`the value ${JSON.stringify(e)}`),$e=(e,t)=>ye(t=>t instanceof e,t??`an instance of ${e.name}`),Ke=(e,t,i=!0)=>ye((t,n)=>{if(!B(t))return!1;let s=i;const r=[],o=[],a=e=>s=i?s&&e:s||e;if(0===t.length)return{valid:!0,cleared:r,invalid:o};for(let i=0;i<t.length;i++){const l=t[i],c=e(l,{options:l,path:`${n.path}[${i}]`});"object"==typeof c?(s=a(c.valid),o.push(...c.invalid),null!=c.cleared&&r.push(c.cleared)):(s=a(c),c&&r.push(l))}return{valid:s,cleared:s||!i?r:null,invalid:o}},t??`${e[oe]} array`),Ye=(e,t="an object array")=>ye((t,i)=>{if(!B(t))return!1;const n=[],s=[];for(let r=0;r<t.length;r++){const o=`${i.path}[${r}]`,a=me(t[r],e,o);Ze(a.invalid,o)||n.push(a.cleared),s.push(...a.invalid)}return{valid:!0,cleared:n,invalid:s}},t),qe=(e,t)=>ye((i,n)=>!!z(i)&&(le in i||{valid:!0,cleared:Object.assign((...s)=>{const r=te(i,s);if(null==r)return;const o=e(r,{options:r,path:""});if("object"==typeof o){if(o.invalid.forEach(Qe(n,t??e[oe])),o.valid)return o.cleared}else{if(o)return r;d(`Callback \`${n.path}\` returned an invalid value \`${ne(r,50)}\`; expecting ${t??e[oe]}, ignoring.`)}},{[le]:!0}),invalid:[]}),"a function"),Xe=(e,t="an object")=>ye((i,n)=>!!z(i)&&(le in i||{valid:!0,cleared:Object.assign((...s)=>{const r=te(i,s,n.path);if(null==r)return;const o=me(r,e);return o.invalid.forEach(Qe(n,t)),o.cleared},{[le]:!0}),invalid:[]}),"a function");function Ze(e,t){return e.some(e=>"required"===e.type&&e.path===t)}function Qe(e,t){return i=>{if(i instanceof fe)return d(`Callback \`${e.path}\` returned an unknown property \`${pe(i.path,i.key)}\`${i.getPostfix()}`);const n=ne(i.value,50);d(i.key?`Callback \`${e.path}\` returned an invalid property \`${pe(i.path,i.key)}\`: \`${n}\`; expecting ${i.description}, ignoring.`:`Callback \`${e.path}\` returned an invalid value \`${n}\`; expecting ${t??i.description}, ignoring.`)}}var Je=e=>{if(!W(e))return!1;const t=Object.keys(e);return 1===t.length&&t[0].startsWith("$")},et=Ce({color:De,stop:He},""),tt=ye(e=>{let t=-1/0;for(const i of e)if(null!=i?.stop){if(i.stop<t)return!1;t=i.stop}return!0},"color stops to be defined in ascending order"),it=Se(Ne(2),Ke(et),tt),nt=We("axis","item","series"),st=Ce({type:ve(je("gradient")),colorStops:ve(it),rotation:ke,gradient:be(We("linear","radial","conic")),bounds:be(nt),reverse:be(Me)},"a gradient object with color stops"),rt={stroke:De,strokeWidth:Be,strokeOpacity:He},ot=Ce({type:ve(je("gradient")),gradient:ve(We("linear","radial","conic")),bounds:ve(nt),colorStops:ve(xe(it,Se(Ne(2),Ke(De)))),rotation:ve(ke),reverse:ve(Me)}),at=Ce({type:ve(je("pattern")),pattern:ve(We("vertical-lines","horizontal-lines","forward-slanted-lines","backward-slanted-lines","circles","squares","triangles","diamonds","stars","hearts","crosses")),path:Oe(2),width:ve(Be),height:ve(Be),fill:ve(De),fillOpacity:ve(He),backgroundFill:ve(De),backgroundFillOpacity:ve(He),padding:ve(Be),rotation:ve(ke),scale:ve(Be),stroke:ve(De),strokeWidth:ve(Be),strokeOpacity:ve(He)}),lt=Ce({type:ve(je("image")),url:_e,width:Be,height:Be,rotation:ve(ke),backgroundFill:ve(De),backgroundFillOpacity:He,fit:ve(We("stretch","contain","cover")),repeat:ve(We("repeat","repeat-x","repeat-y","no-repeat"))}),ct=we({gradient:{colorStops:it,rotation:ke,gradient:be(We("linear","radial","conic")),bounds:be(nt),reverse:be(Me)},pattern:{pattern:We("vertical-lines","horizontal-lines","forward-slanted-lines","backward-slanted-lines","circles","squares","triangles","diamonds","stars","hearts","crosses"),path:Oe(2),width:Be,height:Be,rotation:ke,scale:Be,fill:De,fillOpacity:He,backgroundFill:De,backgroundFillOpacity:He,...rt,padding:be(Be)},image:{url:ve(_e),backgroundFill:De,backgroundFillOpacity:He,width:Be,height:Be,fit:We("stretch","contain","cover","none"),repeat:We("repeat","repeat-x","repeat-y","no-repeat"),rotation:ke}},"a color object"),ht=xe(De,Ce(ct,"a color object")),ut={fill:ht,fillOpacity:He};ut.fillGradientDefaults=be(ot),ut.fillPatternDefaults=be(at),ut.fillImageDefaults=be(lt);var dt={lineDash:Ke(Be),lineDashOffset:ke},pt=Ce({googleFont:_e},"google font"),gt=xe(_e,Je,pt,Ke(xe(_e,pt))),ft={color:De,fontFamily:gt,fontSize:Be,fontStyle:We("normal","italic","oblique"),fontWeight:xe(Be,We("normal","bold","bolder","lighter"))};function mt(e){return void 0===e?[]:Array.isArray(e)?e:[e]}function yt(e){return Array.from(new Set(e))}function vt(e,t){return e.reduce((e,i)=>{const n=t(i);return e[n]??(e[n]=[]),e[n].push(i),e},{})}function bt(e,t){if(null==e||null==t||e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(Array.isArray(e[i])&&Array.isArray(t[i])){if(!bt(e[i],t[i]))return!1}else if(e[i]!==t[i])return!1;return!0}function Ct(e,t,i=0){if(0===e.length)return[];const n=[];for(let s=0;s<t;s++)n.push(e.at((s+i)%e.length));return n}function wt(e,t){const i=new Map;return t.forEach((e,t)=>{i.set(e,t)}),e.sort((e,t)=>(i.get(e)??1/0)-(i.get(t)??1/0))}function St(e,t){let i=0;for(;i<e.length&&t(e[i]);)i+=1;const n=i;0!==n&&e.splice(0,n)}function xt(e,t){let i=e.length-1;for(;i>=0&&t(e[i]);)i-=1;const n=e.length-1-i;0!==n&&e.splice(e.length-n,n)}var Et=class{constructor(){this.queue=[]}await(e=50){return new Promise(t=>{const i=()=>{clearTimeout(n),t(!0)},n=setTimeout(()=>{const e=this.queue.indexOf(i);e<0||(this.queue.splice(e,1),t(!1))},e);this.queue.push(i)})}notify(){this.queue.splice(0).forEach(e=>e())}};function At(e=0){return new Promise(t=>{setTimeout(t,e)})}function*Mt(...e){for(const t of e)yield*t}function Tt(e){return null!=e&&"object"==typeof e&&Symbol.iterator in e?e:[e]}function Dt(e){for(const t of e)return t;throw new Error("AG Charts - no first() value found")}function*It(e){const t=[void 0,void 0];for(const i of Object.keys(e))t[0]=i,t[1]=e[i],yield t}function Rt(e){return"true"===e}function kt(e){return e}var Pt={role:kt,"aria-checked":Rt,"aria-controls":kt,"aria-describedby":kt,"aria-disabled":Rt,"aria-expanded":Rt,"aria-haspopup":kt,"aria-hidden":Rt,"aria-label":kt,"aria-labelledby":kt,"aria-live":kt,"aria-orientation":kt,"aria-selected":Rt,"data-focus-override":Rt,"data-focus-visible-override":Rt,"data-preventdefault":Rt,class:kt,for:kt,id:kt,tabindex:function(e){return Number(e)},title:kt,placeholder:kt};function _t(e,t,i){null==i||""===i||""===i?e?.removeAttribute(t):e?.setAttribute(t,i.toString())}function Lt(e,t){if(null!=t)for(const[i,n]of It(t))"class"!==i&&_t(e,i,n)}function Nt(e,t,i){if(!(e instanceof HTMLElement))return;const n=e.getAttribute(t);return null===n?i:Pt[t]?.(n)??void 0}function Ot(e,t,i){null!=e&&(null==i?e.style.removeProperty(t):e.style.setProperty(t,i.toString()))}function Ft(e,t){for(const[i,n]of It(t))Ot(e,i,n)}function Gt(e,t,i){if(e>t)return;let n;for(;t>=e;){const s=Math.floor((t+e)/2);i(s)?(n=s,e=s+1):t=s-1}return n}function Bt(e,t,i){if(e>t)return;let n;for(;t>=e;){const s=Math.floor((t+e)/2);i(s)?(n=s,t=s-1):e=s+1}return n}function Vt(e,t,i){if(e>t)return;let n;for(;t>=e;){const s=Math.floor((t+e)/2),r=i(s);null==r?t=s-1:(n=r,e=s+1)}return n}function Ht(e,t){const i=Math.max(e.length,t.length),n=new Set,s=new Set;for(let r=0;r<i;r++){const i=e[r],o=t[r];i!==o&&(s.has(o)?s.delete(o):o&&n.add(o),n.has(i)?n.delete(i):i&&s.add(i))}return{changed:n.size>0||s.size>0,added:n,removed:s}}function Ut(e,t,i){return Math.min(i,Math.max(e,t))}function zt(e,t,i=1e-10){return e>=t[0]-i&&e<=t[1]+i}function Wt(e,t,i=1e-10){return e===t||Math.abs(e-t)<i}function jt(e){return-1===Math.sign(e)||Object.is(e,-0)}function $t(e){return e%1==0}function Kt(e,t=2){const i=10**t;return Math.round(e*i)/i}function Yt(e,t){return Math.floor(e%t+(e<0?Math.abs(t):0))}function qt(e){if(Math.floor(e)===e)return 0;let t=String(e),i=0;if(e<1e-6||e>=1e21){let e;[t,e]=t.split("e"),null!=e&&(i=Number(e))}const n=t.split(".")[1]?.length??0;return Math.max(n-i,0)}function Xt(e){return Array.isArray(e)&&e.length>=2&&e.every(Y)}function Zt(e){return Array.isArray(e)&&e.length>=2&&e.every(Xt)}function Qt(e){const t=e[0],i=e[e.length-1];return Wt(t[0],i[0],.001)&&Wt(t[1],i[1],.001)}function Jt(e){return Array.isArray(e)&&e.every(Zt)&&e.every(Qt)}function ei(e){if(null===e)return!0;if(!W(e)||null==e.type)return!1;const{type:t,coordinates:i}=e;switch(t){case"GeometryCollection":return Array.isArray(e.geometries)&&e.geometries.every(ei);case"MultiPolygon":return Array.isArray(i)&&i.every(Jt);case"Polygon":return Jt(i);case"MultiLineString":return Array.isArray(i)&&i.every(Zt);case"LineString":case"MultiPoint":return Zt(i);case"Point":return Xt(i);default:return!1}}function ti(e){return W(e)&&"Feature"===e.type&&ei(e.geometry)}var ii=ye(function(e){return W(e)&&"FeatureCollection"===e.type&&Array.isArray(e.features)&&e.features.every(ti)},"a GeoJSON object"),ni=new Map,si=(Symbol("ElementID"),1);function ri(e){const t=e.constructor,i=Object.hasOwn(t,"className")?t.className:t.name;if(!i)throw new Error(`The ${t} is missing the 'className' property.`);const n=(ni.get(i)??0)+1;return ni.set(i,n),`${i}-${n}`}function oi(){return"ag-charts-"+si++}function ai(){return crypto.randomUUID?.()??function(){const e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=15&e[6]|64,e[8]=63&e[8]|128;let t="";for(let i=0;i<e.length;i++)4!==i&&6!==i&&8!==i&&10!==i||(t+="-"),t+=e[i].toString(16).padStart(2,"0");return t}()}var li=/^(?:(.)?([<>=^]))?([+\-( ])?([$€£¥₣₹#])?(0)?(\d+)?(,)?(?:\.(\d+))?(~)?([%a-z])?$/i,ci=/^((?:[^#]|#[^{])*)#{([^}]+)}(.*)$/;function hi(e){if(!$(e))return!1;const t=ci.exec(e);return li.test(t?t[2]:e)}function ui(e){let t,i;const n=ci.exec(e);n&&([,t,e,i]=n);const s=li.exec(e);if(!s)throw new Error(`The number formatter is invalid: ${e}`);const[,r,o,a,l,c,h,u,d,p,g]=s;return{fill:r,align:o,sign:a,symbol:l,zero:c,width:parseInt(h),comma:u,precision:parseInt(d),trim:Boolean(p),type:g,prefix:t,suffix:i}}function di(e){const t="string"==typeof e?ui(e):e,{fill:i,align:n,sign:s="-",symbol:r,zero:o,width:a,comma:l,type:c,prefix:h="",suffix:u="",precision:d}=t;let{trim:p}=t;const g=null==d||isNaN(d);let f,m;if(c)if(c in gi&&c in pi)f=g?pi[c]:gi[c];else if(c in gi)f=gi[c];else{if(!(c in pi))throw new Error(`The number formatter type is invalid: ${c}`);f=pi[c]}else f=gi.g,p=!0;return m=g?c?6:12:d,e=>{let t=f(e,m);return p&&(t=t.replace(/\.0+$/,"").replace(/(\.[1-9])0+$/,"$1")),l&&(t=function(e,t){let i=e.indexOf(".");i<0&&(i=e.length);const n=e.substring(0,i).split(""),s=e.substring(i);for(let e=n.length-3;e>0;e-=3)n.splice(e,0,t);return`${n.join("")}${s}`}(t,l)),t=function(e,t,i=""){if("("===i)return e>=0?t:`(${t})`;return`${e>=0?"+"===i?"+":"":"−"}${t}`}(e,t,s),r&&"#"!==r&&(t=`${r}${t}`),"#"===r&&"x"===c&&(t=`0x${t}`),"s"===c&&(t=`${t}${function(e){return yi[bi(e)]}(e)}`),"%"!==c&&"p"!==c||(t=`${t}%`),null==a||isNaN(a)||(t=function(e,t,i=" ",n=">"){let s=e;if(">"!==n&&n){if("<"===n)s=s.padEnd(t,i);else if("^"===n){const e=Math.max(0,t-s.length),n=Math.ceil(e/2),r=Math.floor(e/2);s=s.padStart(n+s.length,i),s=s.padEnd(r+s.length,i)}}else s=s.padStart(t,i);return s}(t,a,i??o,n)),t=`${h}${t}${u}`,t}}var pi={b:e=>vi(e).toString(2),c:e=>String.fromCharCode(e),d:e=>Math.round(Math.abs(e)).toFixed(0),o:e=>vi(e).toString(8),x:e=>vi(e).toString(16),X:e=>pi.x(e).toUpperCase(),n:e=>pi.d(e),"%":e=>`${vi(100*e).toFixed(0)}`},gi={e:(e,t)=>Math.abs(e).toExponential(t),E:(e,t)=>gi.e(e,t).toUpperCase(),f:(e,t)=>Math.abs(e).toFixed(t),F:(e,t)=>gi.f(e,t).toUpperCase(),g:(e,t)=>{if(0===e)return"0";const i=Math.abs(e),n=Math.floor(Math.log10(i));return n>=-4&&n<t?i.toFixed(t-1-n):i.toExponential(t-1)},G:(e,t)=>gi.g(e,t).toUpperCase(),n:(e,t)=>gi.g(e,t),p:(e,t)=>gi.r(100*e,t),r:(e,t)=>{if(0===e)return"0";const i=Math.abs(e),n=Math.floor(Math.log10(i))-(t-1);if(n<=0)return i.toFixed(-n);const s=10**n;return(Math.round(i/s)*s).toFixed()},s:(e,t)=>{const i=bi(e);return gi.r(e/10**i,t)},"%":(e,t)=>gi.f(100*e,t)},fi=-24,mi=24,yi={[fi]:"y",[-21]:"z",[-18]:"a",[-15]:"f",[-12]:"p",[-9]:"n",[-6]:"µ",[-3]:"m",0:"",3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",[mi]:"Y"};function vi(e){return Math.floor(Math.abs(e))}function bi(e){return Ut(-24,e?3*Math.floor(Math.log10(Math.abs(e))/3):0,24)}},85255(e,t,i){"use strict";i.d(t,{hF:()=>X_});var n=i(45401),s=i(26203),r=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=(e,t,i,n)=>{for(var s,a=n>1?void 0:n?o(t,i):t,l=e.length-1;l>=0;l--)(s=e[l])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&r(t,i,a),a},l=class{constructor(){this.ieCompatibility=!1}init(){this.ieCompatibility="5d41402abc4b2a76b9719d911017c592"!=this.md5("hello")}md5cycle(e,t){let i=e[0],n=e[1],s=e[2],r=e[3];i=this.ff(i,n,s,r,t[0],7,-680876936),r=this.ff(r,i,n,s,t[1],12,-389564586),s=this.ff(s,r,i,n,t[2],17,606105819),n=this.ff(n,s,r,i,t[3],22,-1044525330),i=this.ff(i,n,s,r,t[4],7,-176418897),r=this.ff(r,i,n,s,t[5],12,1200080426),s=this.ff(s,r,i,n,t[6],17,-1473231341),n=this.ff(n,s,r,i,t[7],22,-45705983),i=this.ff(i,n,s,r,t[8],7,1770035416),r=this.ff(r,i,n,s,t[9],12,-1958414417),s=this.ff(s,r,i,n,t[10],17,-42063),n=this.ff(n,s,r,i,t[11],22,-1990404162),i=this.ff(i,n,s,r,t[12],7,1804603682),r=this.ff(r,i,n,s,t[13],12,-40341101),s=this.ff(s,r,i,n,t[14],17,-1502002290),n=this.ff(n,s,r,i,t[15],22,1236535329),i=this.gg(i,n,s,r,t[1],5,-165796510),r=this.gg(r,i,n,s,t[6],9,-1069501632),s=this.gg(s,r,i,n,t[11],14,643717713),n=this.gg(n,s,r,i,t[0],20,-373897302),i=this.gg(i,n,s,r,t[5],5,-701558691),r=this.gg(r,i,n,s,t[10],9,38016083),s=this.gg(s,r,i,n,t[15],14,-660478335),n=this.gg(n,s,r,i,t[4],20,-405537848),i=this.gg(i,n,s,r,t[9],5,568446438),r=this.gg(r,i,n,s,t[14],9,-1019803690),s=this.gg(s,r,i,n,t[3],14,-187363961),n=this.gg(n,s,r,i,t[8],20,1163531501),i=this.gg(i,n,s,r,t[13],5,-1444681467),r=this.gg(r,i,n,s,t[2],9,-51403784),s=this.gg(s,r,i,n,t[7],14,1735328473),n=this.gg(n,s,r,i,t[12],20,-1926607734),i=this.hh(i,n,s,r,t[5],4,-378558),r=this.hh(r,i,n,s,t[8],11,-2022574463),s=this.hh(s,r,i,n,t[11],16,1839030562),n=this.hh(n,s,r,i,t[14],23,-35309556),i=this.hh(i,n,s,r,t[1],4,-1530992060),r=this.hh(r,i,n,s,t[4],11,1272893353),s=this.hh(s,r,i,n,t[7],16,-155497632),n=this.hh(n,s,r,i,t[10],23,-1094730640),i=this.hh(i,n,s,r,t[13],4,681279174),r=this.hh(r,i,n,s,t[0],11,-358537222),s=this.hh(s,r,i,n,t[3],16,-722521979),n=this.hh(n,s,r,i,t[6],23,76029189),i=this.hh(i,n,s,r,t[9],4,-640364487),r=this.hh(r,i,n,s,t[12],11,-421815835),s=this.hh(s,r,i,n,t[15],16,530742520),n=this.hh(n,s,r,i,t[2],23,-995338651),i=this.ii(i,n,s,r,t[0],6,-198630844),r=this.ii(r,i,n,s,t[7],10,1126891415),s=this.ii(s,r,i,n,t[14],15,-1416354905),n=this.ii(n,s,r,i,t[5],21,-57434055),i=this.ii(i,n,s,r,t[12],6,1700485571),r=this.ii(r,i,n,s,t[3],10,-1894986606),s=this.ii(s,r,i,n,t[10],15,-1051523),n=this.ii(n,s,r,i,t[1],21,-2054922799),i=this.ii(i,n,s,r,t[8],6,1873313359),r=this.ii(r,i,n,s,t[15],10,-30611744),s=this.ii(s,r,i,n,t[6],15,-1560198380),n=this.ii(n,s,r,i,t[13],21,1309151649),i=this.ii(i,n,s,r,t[4],6,-145523070),r=this.ii(r,i,n,s,t[11],10,-1120210379),s=this.ii(s,r,i,n,t[2],15,718787259),n=this.ii(n,s,r,i,t[9],21,-343485551),e[0]=this.add32(i,e[0]),e[1]=this.add32(n,e[1]),e[2]=this.add32(s,e[2]),e[3]=this.add32(r,e[3])}cmn(e,t,i,n,s,r){return t=this.add32(this.add32(t,e),this.add32(n,r)),this.add32(t<<s|t>>>32-s,i)}ff(e,t,i,n,s,r,o){return this.cmn(t&i|~t&n,e,t,s,r,o)}gg(e,t,i,n,s,r,o){return this.cmn(t&n|i&~n,e,t,s,r,o)}hh(e,t,i,n,s,r,o){return this.cmn(t^i^n,e,t,s,r,o)}ii(e,t,i,n,s,r,o){return this.cmn(i^(t|~n),e,t,s,r,o)}md51(e){const t=e.length,i=[1732584193,-271733879,-1732584194,271733878];let n;for(n=64;n<=e.length;n+=64)this.md5cycle(i,this.md5blk(e.substring(n-64,n)));e=e.substring(n-64);const s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(n=0;n<e.length;n++)s[n>>2]|=e.charCodeAt(n)<<(n%4<<3);if(s[n>>2]|=128<<(n%4<<3),n>55)for(this.md5cycle(i,s),n=0;n<16;n++)s[n]=0;return s[14]=8*t,this.md5cycle(i,s),i}md5blk(e){const t=[];for(let i=0;i<64;i+=4)t[i>>2]=e.charCodeAt(i)+(e.charCodeAt(i+1)<<8)+(e.charCodeAt(i+2)<<16)+(e.charCodeAt(i+3)<<24);return t}rhex(e){const t="0123456789abcdef".split("");let i="",n=0;for(;n<4;n++)i+=t[e>>8*n+4&15]+t[e>>8*n&15];return i}hex(e){for(let t=0;t<e.length;t++)e[t]=this.rhex(e[t]);return e.join("")}md5(e){return this.hex(this.md51(e))}add32(e,t){return this.ieCompatibility?this.add32Compat(e,t):this.add32Std(e,t)}add32Std(e,t){return e+t&4294967295}add32Compat(e,t){const i=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(i>>16)<<16|65535&i}};function c(e){return null==e||0===e.length}var h={"01":"GRID","02":"CHARTS","0102":"BOTH"},u="https://www.ag-grid.com/charts/licensing/",d=class e{constructor(e){this.watermarkMessage=void 0,this.totalMessageLength=124,this.document=e,this.md5=new l,this.md5.init()}validateLicense(){const t=this.getLicenseDetails(e.licenseKey,e.gridContext),i=`AG ${"BOTH"===t.currentLicenseType?"Grid and ":""}Charts Enterprise`;let n="";if("BOTH"===t.suppliedLicenseType?n="AG Grid and AG Charts Enterprise":"GRID"===t.suppliedLicenseType?n="AG Grid Enterprise":void 0!==t.suppliedLicenseType&&(n="AG Charts Enterprise"),t.missing)this.isWebsiteUrl()&&!this.isForceWatermark()||this.outputMissingLicenseKey(i);else if(t.expired){const i=e.getChartsReleaseDate(),s=e.formatDate(i);this.outputExpiredKey(t.expiry,s,n)}else t.valid?t.isTrial&&t.trialExpired&&this.outputExpiredTrialKey(t.expiry,i,n):this.outputInvalidLicenseKey(!!t.incorrectLicenseType,i,n)}static extractExpiry(t){const i=t.substring(t.lastIndexOf("_")+1,t.length);return new Date(parseInt(e.decode(i),10))}static extractLicenseComponents(t){let i=t.replace(/[\u200B-\u200D\uFEFF]/g,"");if(i=i.replace(/\r?\n|\r/g,""),t.length<=32)return{md5:null,license:t,version:null,isTrial:null};const n=i.length-32,s=i.substring(n),r=i.substring(0,n),[o,a,l]=e.extractBracketedInformation(i);return{md5:s,license:r,version:o,isTrial:a,type:l}}getLicenseDetails(t,i=!1){const n="CHARTS";if(c(t))return{licenseKey:t,valid:!1,missing:!0,currentLicenseType:n};const s=e.getChartsReleaseDate(),{md5:r,license:o,version:a,isTrial:l,type:u}=e.extractLicenseComponents(t);let d,p,g,f=r===this.md5.md5(o)&&-1===t.indexOf("For_Trialing_ag-Grid_Only"),m=null,y=!1;if(f&&(m=e.extractExpiry(o),f=!isNaN(m.getTime()),f))switch(p=s>m,a){case"legacy":case"2":f=!1;break;case"3":c(u)?f=!1:(g=u,u!==h["02"]&&u!==h["0102"]?(f=!1,y=!0):l&&(d=m<new Date,p=void 0))}return f?{licenseKey:t,valid:f,expiry:e.formatDate(m),expired:p,version:a,isTrial:l,trialExpired:d,invalidLicenseTypeForCombo:i?"BOTH"!==g:void 0,incorrectLicenseType:y,currentLicenseType:n,suppliedLicenseType:g}:{licenseKey:t,valid:f,incorrectLicenseType:y,currentLicenseType:n,suppliedLicenseType:g}}isDisplayWatermark(){return this.isForceWatermark()||!this.isLocalhost()&&!this.isE2ETest()&&!this.isWebsiteUrl()&&!c(this.watermarkMessage)}getWatermarkMessage(){return this.watermarkMessage??""}getHostname(){if(!this.document)return"localhost";const e=this.document.defaultView??window;if(!e)return"localhost";const t=e.location,{hostname:i=""}=t;return i}isForceWatermark(){if(!this.document)return!1;const e=this.document?.defaultView??"undefined"!=typeof window?window:void 0;if(!e)return!1;const{pathname:t}=e.location;return!!t&&-1!==t.indexOf("forceWatermark")}isWebsiteUrl(){const e=this.getHostname();return null!==/^((?:[\w-]+\.)?ag-grid\.com)$/.exec(e)}isLocalhost(){const e=this.getHostname();return null!==/^(?:127\.0\.0\.1|localhost)$/.exec(e)}isE2ETest(){const e=this.getHostname();return null!==/^(?:172\.17\.0\.1|host\.docker\.internal)$/.exec(e)}static formatDate(e){const t=e.getDate(),i=e.getMonth(),n=e.getFullYear();return t+" "+["January","February","March","April","May","June","July","August","September","October","November","December"][i]+" "+n}static getChartsReleaseDate(){return new Date(parseInt(e.decode(e.RELEASE_INFORMATION),10))}static decode(t){const i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let n,s,r,o,a,l,c,h="",u=0;const d=t.replace(/[^A-Za-z0-9+/=]/g,"");for(;u<d.length;)o=i.indexOf(d.charAt(u++)),a=i.indexOf(d.charAt(u++)),l=i.indexOf(d.charAt(u++)),c=i.indexOf(d.charAt(u++)),n=o<<2|a>>4,s=(15&a)<<4|l>>2,r=(3&l)<<6|c,h+=String.fromCharCode(n),64!=l&&(h+=String.fromCharCode(s)),64!=c&&(h+=String.fromCharCode(r));return h=e.utf8_decode(h),h}static utf8_decode(e){e=e.replace(/rn/g,"n");let t="";for(let i=0;i<e.length;i++){const n=e.charCodeAt(i);n<128?t+=String.fromCharCode(n):n>127&&n<2048?(t+=String.fromCharCode(n>>6|192),t+=String.fromCharCode(63&n|128)):(t+=String.fromCharCode(n>>12|224),t+=String.fromCharCode(n>>6&63|128),t+=String.fromCharCode(63&n|128))}return t}static setGridContext(t=!1){e.gridContext=t}static setLicenseKey(t){e.licenseKey=t}static extractBracketedInformation(e){if(!e.includes("["))return["legacy",!1,void 0];const t=e.match(/\[(.*?)\]/g).map(e=>e.replace("[","").replace("]",""));if(!t||0===t.length)return["legacy",!1,void 0];const i=1===t.filter(e=>"TRIAL"===e).length,n=t.filter(e=>e.startsWith("v"))[0];return[n?n.replace("v",""):"legacy",i,h[t.filter(e=>h[e])[0]]]}centerPadAndOutput(e){const t=this.totalMessageLength-e.length;console.error(e.padStart(t/2+e.length,"*").padEnd(this.totalMessageLength,"*"))}padAndOutput(e,t="*",i=""){console.error(e.padEnd(this.totalMessageLength-i.length,t)+i)}outputInvalidLicenseKey(t,i,n){e.gridContext||(t?(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Incompatible License Key "),this.padAndOutput(`* Your license key is for ${n} only and does not cover you for ${i}.`," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${u}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")):(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Invalid License Key "),this.padAndOutput("* Your license key is not valid."," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${u}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""))),this.watermarkMessage="Invalid License"}outputExpiredTrialKey(t,i,n){e.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Trial Period Expired. "),this.padAndOutput(`* Your trial only license for ${n} expired on ${t}.`," ","*"),this.padAndOutput("* Please email info@ag-grid.com to purchase a license."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="Trial Period Expired"}outputMissingLicenseKey(t){e.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${t} License `),this.centerPadAndOutput(" License Key Not Found "),this.padAndOutput(`* All ${t} features are unlocked for trial.`," ","*"),this.padAndOutput("* If you want to hide the watermark please email info@ag-grid.com for a trial license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="For Trial Use Only"}outputExpiredKey(t,i,n){e.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${n} License `),this.centerPadAndOutput(" Incompatible Software Version "),this.padAndOutput(`* Your license key works with versions of ${n} released before ${t}.`," ","*"),this.padAndOutput(`* The version you are trying to use was released on ${i}.`," ","*"),this.padAndOutput("* Please contact info@ag-grid.com to renew your license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="License Expired"}};d.RELEASE_INFORMATION="MTc0OTAyMzU3MDQyNA==",d.gridContext=!1;var p=d;function g(e,t,i){const n=(t,i,n,s)=>{let r=e[0];for(let o=t;n>0?o<=i:o>i;o+=n){const t=e[o];if(s(r,t))return!0;r=t}return!1},s=Math.floor(e.length/2);return!!n(t,s,t,i)||n(e.length-t,s,-t,i)}var{AxisInterval:f,Property:m}=n.n1,y=class extends f{};a([m],y.prototype,"minSpacing",2);var{BaseProperties:v,ChartAxisDirection:b,Property:C,Group:w}=n.n1,S=class extends v{constructor(){super(...arguments),this.fontSize=14,this.fontFamily="Verdana, sans-serif",this.padding=5,this.color="rgba(87, 87, 87, 1)"}};a([C],S.prototype,"enabled",2),a([C],S.prototype,"text",2),a([C],S.prototype,"fontStyle",2),a([C],S.prototype,"fontWeight",2),a([C],S.prototype,"fontSize",2),a([C],S.prototype,"fontFamily",2),a([C],S.prototype,"padding",2),a([C],S.prototype,"color",2),a([C],S.prototype,"parallel",2);var x=class extends v{constructor(){super(...arguments),this.id=(0,s.sX)(this),this.defaultColorRange=[],this.shape="polygon",this.label=new S,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.sideFlag=-1,this.parallelFlipRotation=0,this.regularFlipRotation=0,this.direction=b.Angle,this.axisInnerRadius=0,this.axisOuterRadius=0,this.lineGroup=new w({name:this.id}),this.rangeGroup=new w({name:this.id}),this.labelGroup=new w({name:this.id}),this._isRange=void 0}assignCrossLineGroup(e,t){e!==this._isRange&&(e?this.rangeGroup.appendChild(t):this.lineGroup.appendChild(t)),this._isRange=e}setSectorNodeProps(e){e.fill=this.fill,e.fillOpacity=this.fillOpacity??1,e.stroke=this.stroke,e.strokeOpacity=this.strokeOpacity??1,e.strokeWidth=this.strokeWidth??1,e.lineDash=this.lineDash}setLabelNodeProps(e,t,i,n,s){const{label:r}=this;e.x=t,e.y=i,e.text=r.text,e.textAlign="center",e.textBaseline=n,e.rotation=s,e.rotationCenterX=t,e.rotationCenterY=i,e.fill=r.color,e.fontFamily=r.fontFamily,e.fontSize=r.fontSize,e.fontStyle=r.fontStyle,e.visible=!0}};a([C],x.prototype,"enabled",2),a([C],x.prototype,"type",2),a([C],x.prototype,"range",2),a([C],x.prototype,"value",2),a([C],x.prototype,"defaultColorRange",2),a([C],x.prototype,"fill",2),a([C],x.prototype,"fillOpacity",2),a([C],x.prototype,"stroke",2),a([C],x.prototype,"strokeWidth",2),a([C],x.prototype,"strokeOpacity",2),a([C],x.prototype,"lineDash",2),a([C],x.prototype,"shape",2),a([C],x.prototype,"label",2);var{ChartAxisDirection:E,getCrossLineValue:A,validateCrossLineValue:M,normalizeAngle360:T,Group:D,Path:I,Sector:R,RotatableText:k,ContinuousScale:P}=n.n1,_=class extends x{constructor(){super(),this.direction=E.Angle,this.polygonNode=new I,this.sectorNode=new R,this.lineNode=new I,this.crossLineRange=new D,this.labelNode=new k,this.ticks=[],this.crossLineRange.append(this.polygonNode),this.crossLineRange.append(this.sectorNode),this.crossLineRange.append(this.lineNode),this.labelGroup.append(this.labelNode)}visibilityCheck(){if(!P.is(this.scale))return!0;const[e,t]=this.scale.domain,i=A(this);if((0,s.cy)(i)){const[n,s]=i;return n>=e&&n<=t&&s>=n&&s<=t}return i>=e&&i<=t}update(e){const{scale:t}=this;if(!t||!M(A(this),t)||!this.visibilityCheck())return this.rangeGroup.visible=!1,this.lineGroup.visible=!1,void(this.labelGroup.visible=!1);this.rangeGroup.visible=e,this.lineGroup.visible=e,this.labelGroup.visible=e,this.updateLineNode(e),this.updatePolygonNode(e),this.updateSectorNode(e),this.updateLabelNode(e)}updateLineNode(e){const{scale:t,type:i,value:n,lineNode:s}=this;if(!e||"line"!==i||!t)return void(s.visible=!1);const r=t.convert(n);if(isNaN(r))return void(s.visible=!1);const{axisInnerRadius:o,axisOuterRadius:a}=this;s.visible=!0,s.stroke=this.stroke,s.strokeOpacity=this.strokeOpacity??1,s.strokeWidth=this.strokeWidth??1,s.fill=void 0,s.lineDash=this.lineDash;const l=a*Math.cos(r),c=a*Math.sin(r),h=o*Math.cos(r),u=o*Math.sin(r);s.path.clear(!0),s.path.moveTo(h,u),s.path.lineTo(l,c),this.assignCrossLineGroup(!1,this.crossLineRange)}updatePolygonNode(e){const{polygonNode:t,range:i,scale:n,shape:s,type:r,ticks:o}=this;if(!e||"range"!==r||"polygon"!==s||!n||!i)return void(t.visible=!1);const{axisInnerRadius:a,axisOuterRadius:l}=this,c=o.indexOf(i[0]),h=o.indexOf(i[1]),u=(c<=h?o.slice(c,h+1):o.slice(c).concat(o.slice(0,h+1))).map(e=>n.convert(e));t.visible=!0,this.setSectorNodeProps(t);const{path:d}=t;d.clear(!0),u.forEach((e,t)=>{const i=l*Math.cos(e),n=l*Math.sin(e);0===t?d.moveTo(i,n):d.lineTo(i,n)}),0===a?d.lineTo(0,0):u.slice().reverse().forEach(e=>{const t=a*Math.cos(e),i=a*Math.sin(e);d.lineTo(t,i)}),t.path.closePath(),this.assignCrossLineGroup(!0,this.crossLineRange)}updateSectorNode(e){const{sectorNode:t,range:i,scale:s,shape:r,type:o}=this;if(!e||"range"!==o||"circle"!==r||!s||!i)return void(t.visible=!1);const{axisInnerRadius:a,axisOuterRadius:l}=this,c=i.map(e=>s.convert(e)),h=s.step??0,u=s instanceof n.n1.BandScale?h/2:0;t.visible=!0,this.setSectorNodeProps(t),t.centerX=0,t.centerY=0,t.innerRadius=a,t.outerRadius=l,t.startAngle=c[0]-u,t.endAngle=c[1]+u,this.assignCrossLineGroup(!0,this.crossLineRange)}updateLabelNode(e){const{label:t,labelNode:i,range:n,scale:r,type:o,ticks:a}=this;if(!e||!1===t.enabled||!t.text||!r||"range"===o&&!n)return void(i.visible=!1);i.visible=!0;const{axisInnerRadius:l,axisOuterRadius:c}=this;let h,u,d,p;if("line"===o){const e=T(r.convert(this.value)),i=1.5*Math.PI,n=(0,s.YX)(e,i)||e>i||e<Math.PI/2,o=(l+c)/2*Math.cos(e),a=(l+c)/2*Math.sin(e);h=o+t.padding*Math.cos(e+Math.PI/2),u=a+t.padding*Math.sin(e+Math.PI/2),p=n?"top":"bottom",d=n?e:e-Math.PI}else{const[e,i]=n.map(e=>T(r.convert(e)));let o=(e+i)/2;e>i&&(o-=Math.PI),o=T(o);const l=((0,s.YX)(o,0)||o>0)&&o<Math.PI;let g;g="circle"===this.shape||a.length<3?c-t.padding:c*Math.cos(Math.PI/a.length)-t.padding,h=g*Math.cos(o),u=g*Math.sin(o),p=l?"bottom":"top",d=l?o-Math.PI/2:o+Math.PI/2}this.setLabelNodeProps(i,h,u,p,d)}};_.className="AngleCrossLine";var{ChartAxisDirection:L,TextWrapper:N,TextUtils:O,Property:F,toRadians:G,normalizeAngle360:B,normalizeAngle360Inclusive:V,Path:H,RotatableText:U,Transformable:z,BBox:W,Selection:j,Line:$}=n.n1,K=class extends n.n1.AxisLabel{constructor(){super(...arguments),this.orientation="fixed"}};a([F],K.prototype,"orientation",2);var Y=class extends n.n1.PolarAxis{constructor(e,t){super(e,t),this.startAngle=0,this.endAngle=void 0,this.tickLineGroupSelection=j.select(this.tickLineGroup,$,!1),this.gridLineGroupSelection=j.select(this.gridLineGroup,$,!1),this.labelData=[],this.tickData=[],this.radiusLineGroup=this.axisGroup.appendChild(new n.n1.TransformableGroup),this.radiusLine=this.radiusLineGroup.appendChild(new H),this.includeInvisibleDomains=!0}get direction(){return L.Angle}createLabel(){return new K}calculateRotations(){const e=G(this.startAngle);return{rotation:e,parallelFlipRotation:B(e),regularFlipRotation:B(e-Math.PI/2)}}calculateTickLayout(e){const{nice:t,scale:i}=this,n={nice:t,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0},r=t?i.niceDomain(n,e):e,o=this.generateAngleTicks(r);this.tickData=o;const a=o.map(e=>e.value),l=a.reduce((e,t)=>Math.max("number"==typeof t?(0,s.o3)(t):0,e),0);return{niceDomain:r,tickDomain:r,ticks:a,rawTickCount:void 0,fractionDigits:l,timeInterval:void 0,bbox:this.getBBox()}}update(){super.update(),this.updateRadiusLine(),this.updateGridLines(),this.updateTickLines()}normalizedAngles(){const e=B(-Math.PI/2+G(this.startAngle));return[e,e+(null!=this.endAngle?V(G(this.endAngle)-G(this.startAngle)):2*Math.PI)]}computeRange(){this.range=this.normalizedAngles()}updateSelections(){const e=this.tickData;this.gridLineGroupSelection.update(this.gridLength&&this.gridLine.enabled?e:[]),this.tickLineGroupSelection.update(this.tick.enabled?e:[]),this.tickLabelGroupSelection.update(this.label.enabled?e:[]),this.gridLineGroupSelection.cleanup(),this.tickLineGroupSelection.cleanup(),this.tickLabelGroupSelection.cleanup()}updatePosition(){super.updatePosition();const{translation:e,radiusLineGroup:t}=this,i=Math.floor(e.x),n=Math.floor(e.y);t.translationX=i,t.translationY=n}updateRadiusLine(){const e=this.radiusLine,{path:t}=e;t.clear(!0);const{points:i,closePath:n}=this.getAxisLinePoints();i.forEach(({x:e,y:i,moveTo:n,arc:s,radius:r=0,startAngle:o=0,endAngle:a=0})=>{s?t.arc(e,i,r,o,a):n?t.moveTo(e,i):t.lineTo(e,i)}),n&&t.closePath(),e.visible=this.line.enabled,e.stroke=this.line.stroke,e.strokeWidth=this.line.width,e.fill=void 0}getAxisLinePoints(){const{scale:e,shape:t,gridLength:i}=this,[n,r]=this.range,o=(0,s.YX)(r-n,2*Math.PI),a=[];if("circle"===t)o?a.push({x:i,y:0,moveTo:!0},{x:0,y:0,radius:i,startAngle:0,endAngle:2*Math.PI,arc:!0,moveTo:!1}):a.push({x:i*Math.cos(n),y:i*Math.sin(n),moveTo:!0},{x:0,y:0,radius:i,startAngle:B(n),endAngle:B(r),arc:!0,moveTo:!1});else if("polygon"===t){const t=e.ticks({nice:this.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.ticks?.map(t=>e.convert(t));t&&t.length>2&&t.forEach((e,t)=>{const n=i*Math.cos(e),s=i*Math.sin(e),r=0===t;a.push({x:n,y:s,moveTo:r})})}return{points:a,closePath:o}}updateGridLines(){const{scale:e,gridLength:t,gridLine:{style:i,width:n},innerRadiusRatio:s}=this;if(!(i&&t>0))return;const r=t*s,o=i.length;this.gridLineGroupSelection.each((s,a,l)=>{const{value:c}=a,{stroke:h,lineDash:u}=i[l%o],d=e.convert(c);s.x1=r*Math.cos(d),s.y1=r*Math.sin(d),s.x2=t*Math.cos(d),s.y2=t*Math.sin(d),s.stroke=h,s.strokeWidth=n,s.lineDash=u,s.fill=void 0}),this.gridLineGroupSelection.cleanup()}updateLabels(){const{label:e,tickLabelGroupSelection:t}=this;t.each((t,i,n)=>{const s=this.labelData[n];s&&!s.hidden?(t.text=s.text,t.setFont(e),t.fill=e.color,t.x=s.x,t.y=s.y,t.textAlign=s.textAlign,t.textBaseline=s.textBaseline,t.visible=!0,s.rotation?(t.rotation=s.rotation,t.rotationCenterX=s.x,t.rotationCenterY=s.y):t.rotation=0):t.visible=!1})}updateTickLines(){const{scale:e,gridLength:t,tick:i,tickLineGroupSelection:n}=this;n.each((n,s)=>{const{value:r}=s,o=e.convert(r),a=Math.cos(o),l=Math.sin(o);n.x1=t*a,n.y1=t*l,n.x2=(t+i.size)*a,n.y2=(t+i.size)*l,n.stroke=i.stroke,n.strokeWidth=i.width})}createLabelNodeData(e,t,i){const{label:n,gridLength:r,scale:o,tick:a}=this;if(!n.enabled)return[];const l=new U,c=i.x-this.translation.x,h=i.x+i.width-this.translation.x,u=e.map((i,u)=>{const{value:d}=i,p=r+n.spacing+a.size,g=o.convert(d),f=p*Math.cos(g),m=p*Math.sin(g),{textAlign:y,textBaseline:v}=this.getLabelAlign(g),b=u===e.length-1&&d!==e[0]&&(0,s.YX)(B(g),B(o.convert(e[0]))),C=this.getLabelRotation(g);let w=this.formatTick(d,u,o.domain);l.text=w,l.x=f,l.y=m,l.setFont(n),l.textAlign=y,l.textBaseline=v,l.rotation=C,C&&(l.rotationCenterX=f,l.rotationCenterY=m);let S=C?z.toCanvas(l):l.getBBox();if(S&&t.hideWhenNecessary&&!C){const e=c-S.x,t=S.x+S.width-h,i=1;if(e>i||t>i){const i=S.width-Math.max(e,t);w=N.wrapText(w,{maxWidth:i,font:n,textWrap:"never"}),w===O.EllipsisChar&&(w=""),l.text=w,S=l.getBBox()}}return{text:w,x:f,y:m,textAlign:y,textBaseline:v,hidden:""===w||i.hidden||b,rotation:C,box:S}});return n.avoidCollisions&&this.avoidLabelCollisions(u),u}computeLabelsBBox(e,t){this.labelData=this.createLabelNodeData(this.tickData,e,t);const i=this.labelData.map(({box:e})=>e).filter(e=>null!=e);return this.label.enabled&&0!==i.length?W.merge(i):null}getLabelOrientation(){const{label:e}=this;return e instanceof K?e.orientation:"fixed"}getLabelRotation(e){let t=G(this.label.rotation??0);e=B(e);const i=this.getLabelOrientation();return"parallel"===i?(t+=e,e>=0&&e<Math.PI?t-=Math.PI/2:t+=Math.PI/2):"perpendicular"===i&&(t+=e,e>=Math.PI/2&&e<1.5*Math.PI&&(t+=Math.PI)),t}getLabelAlign(e){const t=Math.cos(e),i=Math.sin(e);let n,r;const o=this.getLabelOrientation(),a=(0,s.YX)(t,0),l=(0,s.YX)(i,0),c=(0,s.YX)(t,1),h=(0,s.YX)(i,-1),u=t>0&&!a,d=i>0&&!l;return"parallel"===o?(n="center",r=c&&l||d?"top":"bottom"):"perpendicular"===o?(n=h||u?"left":"right",r="middle"):(n="right",a?n="center":u&&(n="left"),r="bottom",l?r="middle":d&&(r="top")),{textAlign:n,textBaseline:r}}updateCrossLines(){const{shape:e,gridLength:t,innerRadiusRatio:i}=this;this.crossLines.forEach(n=>{n instanceof _&&(n.ticks=this.tickData.map(e=>e.value),n.shape=e,n.axisOuterRadius=t,n.axisInnerRadius=t*i)}),super.updateCrossLines()}};Y.CrossLineConstructor=_,a([F],Y.prototype,"startAngle",2),a([F],Y.prototype,"endAngle",2);var{Property:q,CategoryScale:X}=n.n1,Z=class extends Y{constructor(e){super(e,new X),this.groupPaddingInner=0,this.paddingInner=0,this.interval=new y}generateAngleTicks(){const{scale:e,gridLength:t}=this,{values:i,minSpacing:n}=this.interval,s=i??e.ticks({nice:this.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.ticks??[];if(s.length<2||null==n)return s.map(e=>({value:e,visible:!0}));const r=s[0],o=e.convert(r),a=t*Math.cos(o),l=t*Math.sin(o);for(let i=1;i<s.length-1;i++){const c=s[i],h=e.convert(c);if(h-o>Math.PI)break;const u=t*Math.cos(h),d=t*Math.sin(h);if(Math.sqrt((u-a)**2+(d-l)**2)>n){const e=new Set([r]);return g(s,i,(t,i)=>{e.add(i)}),s.map(t=>({value:t,visible:e.has(t)}))}}return[{value:r,visible:!0}]}avoidLabelCollisions(e){const{minSpacing:t}=this.label;if(e.length<3)return;const i=(e,i)=>{if(e.hidden||i.hidden)return!1;if(null==t)return e.box.collidesBBox(i.box);const n=e.box.clone().grow(t/2),s=i.box.clone().grow(t/2);return n.collidesBBox(s)},n=e[0],r=e.at(-1),o=new Set([n]),a=(0,s.YX)(n.x,r.x)&&(0,s.YX)(n.y,r.y),l=Math.floor(e.length/2);for(let t=1;t<=l;t++){const n=a?e.slice(0,-1):e;if(!g(n,t,i)){g(n,t,(e,t)=>{o.add(t)});break}}e.forEach(e=>{o.has(e)||(e.hidden=!0,e.box=void 0)})}};Z.className="AngleCategoryAxis",Z.type="angle-category",a([q],Z.prototype,"groupPaddingInner",2),a([q],Z.prototype,"paddingInner",2),a([q],Z.prototype,"interval",2);var Q={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"angle-category",moduleFactory:e=>new Z(e)},{range:J,isDenseInterval:ee,LinearScale:te}=n.n1,ie=class e extends te{constructor(){super(...arguments),this.arcLength=0}static getNiceStepAndTickCount(e,t){const[i,n]=t;let s=te.getTickStep(i,n,e);const r=isNaN(e.maxTickCount)?1/0:e.maxTickCount,o=Math.abs(n-i)/s;let a=Math.pow(2,Math.ceil(Math.log(o)/Math.log(2)));return a>r&&(a/=2,s*=2),{count:a,step:s}}ticks(t,i=this.domain){const{arcLength:n}=this;if(!i||i.length<2||i.some(e=>!isFinite(e))||n<=0)return{ticks:[],count:0};const{nice:s,interval:r}=t,[o,a]=i;if(r){const e=Math.abs(r),t=this.getPixelRange();if(!ee((a-o)/e,t))return J(o,a,e)}let l;if(s&&this.hasNiceRange()){const n=super.niceDomain(t,i);l=e.getNiceStepAndTickCount(t,n).step}else l=te.getTickStep(o,a,t);return J(o,a,l)}hasNiceRange(){const e=this.range.slice().sort((e,t)=>e-t);return[Math.PI,2*Math.PI].some(t=>(0,s.YX)(t,e[1]-e[0]))}niceDomain(t,i=this.domain){const n=super.niceDomain(t,i);if(!this.hasNiceRange())return n;const s=n[0]>n[1],r=s?n[1]:n[0],{step:o,count:a}=e.getNiceStepAndTickCount(t,n),l=1/o,c=o>=1?Math.ceil(r/o+a)*o:Math.ceil((r+a*o)*l)/l;return s?[c,r]:[r,c]}getPixelRange(){return this.arcLength}},{Property:ne,angleBetween:se,normalisedExtentWithMetadata:re,findMinMax:oe}=n.n1,ae=class extends Y{constructor(e){super(e,new ie),this.shape="circle",this.interval=new y}normaliseDataDomain(e){const{min:t,max:i}=this,{extent:n,clipped:s}=re(e,t,i);return{domain:n,clipped:s}}updateScale(){super.updateScale(),this.scale.arcLength=this.getRangeArcLength()}getRangeArcLength(){const{range:e}=this,t=Math.min(...e),i=Math.max(...e);return(se(t,i)||2*Math.PI)*this.gridLength}generateAngleTicks(e){const{scale:t,range:i,nice:n}=this,{values:s,step:r,minSpacing:o,maxSpacing:a}=this.interval;let l;if(null==s){const{arcLength:s}=t,c=a?Math.floor(s/a):1,h=o?Math.floor(s/o):1/0,u=Math.floor(4/Math.PI*Math.abs(i[0]-i[1])),d={nice:n,interval:r,tickCount:Math.max(c,Math.min(h,u)),minTickCount:c,maxTickCount:h};l=t.ticks(d,e)?.ticks??[]}else{const[t,i]=oe(e.map(Number));l=s.filter(e=>e>=t&&e<=i).sort((e,t)=>e-t)}return l.map(e=>({value:e,visible:!0}))}avoidLabelCollisions(e){const{minSpacing:t}=this.label,i=(e,i)=>{if(e.hidden||i.hidden)return!1;if(null==t)return e.box.collidesBBox(i.box);const n=e.box.clone().grow(t/2),s=i.box.clone().grow(t/2);return n.collidesBBox(s)},n=e[0],r=e.at(-1);n!==r&&(0,s.YX)(n.x,r.x)&&(0,s.YX)(n.y,r.y)&&(r.hidden=!0);for(let t=1;t<e.length;t*=2){let n=!1;for(let s=t;s<e.length;s+=t){const r=e[s];if(i(e[s-t],r)){n=!0;break}}if(!n)return void e.forEach((e,i)=>{i%t>0&&(e.hidden=!0,e.box=void 0)})}e.forEach((e,t)=>{t>0&&(e.hidden=!0,e.box=void 0)})}};ae.className="AngleNumberAxis",ae.type="angle-number",a([ne],ae.prototype,"min",2),a([ne],ae.prototype,"max",2),a([ne],ae.prototype,"interval",2);var le={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"angle-number",moduleFactory:e=>new ae(e)},{OrdinalTimeScale:ce,Property:he,TimeAxisParentLevel:ue}=n.n1,de=class extends n.n1.CategoryAxis{constructor(e){super(e,new ce),this.parentLevel=new ue}get primaryLabel(){return this.parentLevel.enabled?this.parentLevel.label:void 0}get primaryTick(){return this.parentLevel.enabled?this.parentLevel.tick:void 0}};de.className="OrdinalTimeAxis",de.type="ordinal-time",a([he],de.prototype,"parentLevel",2);var pe={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"ordinal-time",moduleFactory:e=>new de(e)},{ChartAxisDirection:ge,Property:fe,getCrossLineValue:me,validateCrossLineValue:ye,normalizeAngle360FromDegrees:ve,Group:be,Path:Ce,Sector:we,RotatableText:Se}=n.n1,xe=class extends S{constructor(){super(...arguments),this.positionAngle=void 0}};a([fe],xe.prototype,"positionAngle",2);var Ee=class extends x{constructor(){super(),this.direction=ge.Radius,this.label=new xe,this.polygonNode=new Ce,this.sectorNode=new we,this.crossLineRange=new be,this.labelNode=new Se,this.outerRadius=0,this.innerRadius=0,this.crossLineRange.append(this.polygonNode),this.crossLineRange.append(this.sectorNode),this.labelGroup.append(this.labelNode)}update(e){const{scale:t}=this;if(!t||!ye(me(this),t))return this.rangeGroup.visible=!1,this.lineGroup.visible=!1,void(this.labelGroup.visible=!1);this.updateRadii();const{innerRadius:i,outerRadius:n}=this;e&&(e=i>=this.axisInnerRadius&&n<=this.axisOuterRadius),this.rangeGroup.visible=e,this.lineGroup.visible=e,this.labelGroup.visible=e,this.updatePolygonNode(e),this.updateSectorNode(e),this.updateLabelNode(e),this.assignCrossLineGroup("range"===this.type,this.crossLineRange)}updateRadii(){const{range:e,scale:t,type:i,axisInnerRadius:n,axisOuterRadius:s}=this;if(!t)return{innerRadius:0,outerRadius:0};const r=e=>s+n-e;let o,a;if("line"===i)o=r(t.convert(this.value)),a=o;else{const i=Math.abs(t?.bandwidth??0),n=e.map(e=>t.convert(e));o=r(Math.max(...n)),a=r(Math.min(...n))+i}this.outerRadius=o,this.innerRadius=a}drawPolygon(e,t,i){t.forEach((t,n)=>{const s=e*Math.cos(t),r=e*Math.sin(t);0===n?i.path.moveTo(s,r):i.path.lineTo(s,r)}),i.path.closePath()}updatePolygonNode(e){const{gridAngles:t,polygonNode:i,scale:n,shape:s,type:r,innerRadius:o,outerRadius:a}=this;if(!e||"polygon"!==s||!n||!t)return void(i.visible=!1);i.visible=!0;const l=this.getPadding();i.path.clear(!0),this.drawPolygon(a-l,t,i);const c=t.slice().reverse(),h="line"===r?a-l:o+l;this.drawPolygon(h,c,i),this.setSectorNodeProps(i)}updateSectorNode(e){const{axisInnerRadius:t,axisOuterRadius:i,scale:n,sectorNode:r,shape:o,innerRadius:a,outerRadius:l}=this;if(!e||"circle"!==o||!n)return void(r.visible=!1);r.visible=!0,r.startAngle=0,r.endAngle=2*Math.PI;const c=this.getPadding(),h=(0,s.qE)(t,a+c,i),u=(0,s.qE)(t,l-c,i);r.innerRadius=Math.min(h,u),r.outerRadius=Math.max(h,u),this.setSectorNodeProps(r)}updateLabelNode(e){const{innerRadius:t,label:i,labelNode:n,scale:r,shape:o,type:a}=this;if(!e||!1===i.enabled||!i.text||!r)return void(n.visible=!1);const l=ve((i.positionAngle??0)-90),c=((0,s.YX)(l,0)||l>0)&&l<Math.PI,h=c?l-Math.PI/2:l+Math.PI/2;let u;const d=this.gridAngles??[];u="line"===a?t+i.padding:"circle"===o||d.length<3?t-i.padding:t*Math.cos(Math.PI/d.length)-i.padding;const p=u*Math.cos(l),g=u*Math.sin(l);let f;f="line"===a?c?"top":"bottom":c?"bottom":"top",this.setLabelNodeProps(n,p,g,f,h)}getPadding(){const{scale:e}=this;if(!e)return 0;const t=Math.abs(e.bandwidth??0),i=Math.abs(e.step??0);return e instanceof n.n1.BandScale?(i-t)/2:0}};Ee.className="RadiusCrossLine";var{ChartAxisDirection:Ae,ZIndexMap:Me,Property:Te,normalizeAngle360:De,toRadians:Ie,Caption:Re,Group:ke,TransformableGroup:Pe,Path:_e,Line:Le,Selection:Ne,AxisTickGenerator:Oe,AxisGroupZIndexMap:Fe}=n.n1,Ge=class extends n.n1.AxisLabel{constructor(){super(...arguments),this.autoRotateAngle=335}};a([Te],Ge.prototype,"autoRotate",2),a([Te],Ge.prototype,"autoRotateAngle",2);var Be=class extends n.n1.PolarAxis{constructor(e,t){super(e,t),this.positionAngle=0,this.gridLineGroupSelection=Ne.select(this.gridLineGroup,Le,!1),this.tickGenerator=new Oe(this),this.generatedTicks=void 0,this.headingLabelGroup=this.axisGroup.appendChild(new Pe({name:`${this.id}-Axis-heading`})),this.lineNodeGroup=this.axisGroup.appendChild(new Pe({name:`${this.id}-Axis-line`})),this.lineNode=this.lineNodeGroup.appendChild(new Le({name:`${this.id}-Axis-line`,zIndex:Fe.AxisLine})),this.gridPathGroup=this.gridGroup.appendChild(new ke({name:`${this.id}-gridPaths`,zIndex:Me.AXIS_GRID})),this.gridPathSelection=Ne.select(this.gridPathGroup,_e),this.headingLabelGroup.appendChild(this.title.caption.node),this.destroyFns.push(this.title.caption.registerInteraction(this.moduleCtx,"afterend"))}get direction(){return Ae.Radius}getAxisTransform(){const e=this.scale.range[0],{translation:t,positionAngle:i,innerRadiusRatio:n}=this,s=e*n,r=Ie(i);return{translationX:t.x,translationY:t.y-e-s,rotation:r,rotationCenterX:0,rotationCenterY:e+s}}update(){super.update(),this.updateTitle(),this.updateGridLines();const{enabled:e,stroke:t,width:i}=this.line;this.lineNode.setProperties({stroke:t,strokeWidth:e?i:0,x1:0,y1:this.range[0],x2:0,y2:this.range[1]})}updatePosition(){super.updatePosition();const e=this.getAxisTransform();this.tickLineGroup.setProperties(e),this.tickLabelGroup.setProperties(e),this.lineNodeGroup.setProperties(e),this.headingLabelGroup.setProperties(e)}calculateRotations(){return{rotation:0,parallelFlipRotation:0,regularFlipRotation:-Math.PI/2}}calculateTickLayout(e,t,i){const n=-Math.PI/2,s=this.label.getSideFlag(),r=s*(this.getTickSize()+this.label.spacing+this.seriesAreaPadding),o=this.tickGenerator.generateTicks({domain:e,niceMode:t,visibleRange:[0,1],primaryTickCount:void 0,parallelFlipRotation:0,regularFlipRotation:n,labelX:r,sideFlag:s,removeOverflowLabels:!1}),{tickData:a}=o,{ticks:l,rawTicks:c,rawTickCount:h,tickDomain:u,fractionDigits:d,niceDomain:p=e}=a,g=l.map(e=>this.getTickLabelProps(e,o));return this.generatedTicks={ticks:l,labels:g},{ticks:c,tickDomain:u,niceDomain:p,rawTickCount:h,fractionDigits:d,timeInterval:void 0}}updateSelections(){const{generatedTicks:e}=this;if(!e)return;const{ticks:t,labels:i}=e;this.gridLineGroupSelection.update(this.gridLength?t:[]),this.tickLabelGroupSelection.update(i),this.gridPathSelection.update(this.gridLine.enabled?this.prepareGridPathTickData(t):[]),this.gridLineGroupSelection.cleanup(),this.tickLabelGroupSelection.cleanup(),this.gridPathSelection.cleanup()}updateLabels(){if(!this.label.enabled)return;const e=n.n1.resetAxisLabelSelectionFn();this.tickLabelGroupSelection.each((t,i)=>{t.fill=i.fill,t.fontFamily=i.fontFamily,t.fontSize=i.fontSize,t.fontStyle=i.fontStyle,t.fontWeight=i.fontWeight,t.text=i.text,t.textBaseline=i.textBaseline,t.textAlign=i.textAlign??"center",t.setProperties(e(t,i))})}updateGridLines(){const{gridLine:{style:e,width:t},shape:i,generatedTicks:n}=this;if(!e||!n)return;const r=e.length,[o,a]=this.gridRange??[0,2*Math.PI],l=(0,s.YX)(a-o,2*Math.PI),c="circle"===i?(e,t)=>{const{path:i}=e;i.clear(!0);const n=this.getTickRadius(t);l?(i.moveTo(n,0),i.arc(0,0,n,0,2*Math.PI)):(i.moveTo(n*Math.cos(o),n*Math.sin(o)),i.arc(0,0,n,De(o),De(a))),l&&i.closePath()}:(e,t)=>{const{path:i}=e,n=this.gridAngles;if(i.clear(!0),!n||n.length<3)return;const s=this.getTickRadius(t);n.forEach((e,t)=>{const r=s*Math.cos(e),o=s*Math.sin(e);0===t?i.moveTo(r,o):i.lineTo(r,o),n.forEach((e,t)=>{const n=s*Math.cos(e),r=s*Math.sin(e);0===t?i.moveTo(n,r):i.lineTo(n,r)}),i.closePath()}),i.closePath()};this.gridPathSelection.each((i,n,s)=>{((i,n)=>{const{stroke:s,lineDash:o}=e[n%r];i.stroke=s,i.strokeWidth=t,i.lineDash=o,i.fill=void 0})(i,s),c(i,n)})}updateTitle(){const e=e=>e.defaultValue,{title:t,range:i}=this,{formatter:n=e}=this.title;t.caption.enabled=t.enabled,t.caption.fontFamily=t.fontFamily,t.caption.fontSize=t.fontSize,t.caption.fontStyle=t.fontStyle,t.caption.fontWeight=t.fontWeight,t.caption.color=t.color,t.caption.wrapping=t.wrapping;let s=!1;const r=t.caption.node;t.enabled&&(s=!0,r.rotation=Math.PI/2,r.x=Math.floor((i[0]+i[1])/2),r.y=-Re.SMALL_PADDING,r.textAlign="center",r.textBaseline="bottom",r.text=this.callWithContext(n,this.getTitleFormatterParams(this.scale.domain))),r.visible=s}updateCrossLines(){this.crossLines.forEach(e=>{if(e instanceof Ee){const{shape:t,gridAngles:i,range:n,innerRadiusRatio:s}=this,r=n[0];e.shape=t,e.gridAngles=i,e.axisOuterRadius=r,e.axisInnerRadius=r*s}}),super.updateCrossLines()}createLabel(){return new Ge}getTickLabelProps(e,t){const{label:i}=this,{rotation:n,textBaseline:s,textAlign:r}=t,o=this.scale.range,a=e.tickLabel??"",l=i.getSideFlag()*(this.getTickSize()+i.spacing+this.seriesAreaPadding),c=""!==a&&null!=a,h=n;return{...this.getLabelStyles({value:e.tickLabel}),tickId:e.tickId,rotation:h,text:a,textAlign:r,textBaseline:s,visible:c,x:l,y:e.translationY,rotationCenterX:l,rotationCenterY:e.translationY,range:o}}};Be.CrossLineConstructor=Ee,a([Te],Be.prototype,"positionAngle",2);var{ProxyPropertyOnWrite:Ve,Property:He,CategoryScale:Ue}=n.n1,ze=class extends Be{constructor(e){super(e,new Ue),this.shape="circle",this.groupPaddingInner=0,this.paddingInner=0,this.paddingOuter=0}normaliseDataDomain(e){return{domain:e,clipped:!1}}prepareGridPathTickData(e){return e.slice().reverse()}getTickRadius(e){const{scale:t,innerRadiusRatio:i}=this,n=t.range[0],s=n*i;if(Ue.is(t)){const i=t.domain,n=i.length-1-i.indexOf(e.tick);return 0===n?s:t.inset+t.step*(n-.5)+t.bandwidth/2}{const i=(n-s)/t.domain.length;return n-e.translationY+s-i/2}}};ze.className="RadiusCategoryAxis",ze.type="radius-category",a([He],ze.prototype,"groupPaddingInner",2),a([Ve("scale","paddingInner"),He],ze.prototype,"paddingInner",2),a([Ve("scale","paddingOuter"),He],ze.prototype,"paddingOuter",2);var We={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radius-category",moduleFactory:e=>new ze(e)},{Property:je,normalisedExtentWithMetadata:$e,LinearScale:Ke}=n.n1,Ye=class extends Be{constructor(e){super(e,new Ke),this.shape="polygon"}prepareGridPathTickData(e){const{scale:t}=this,i=t.domain[1];return e.filter(({tick:e})=>e!==i).sort((e,t)=>t.tick-e.tick)}getTickRadius(e){const{scale:t}=this,i=t.range[0],n=i*this.innerRadiusRatio;return i-e.translationY+n}normaliseDataDomain(e){const{min:t,max:i}=this,{extent:n,clipped:s}=$e(e,t,i);return{domain:n,clipped:s}}};Ye.className="RadiusNumberAxis",Ye.type="radius-number",a([je],Ye.prototype,"min",2),a([je],Ye.prototype,"max",2);var qe={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radius-number",moduleFactory:e=>new Ye(e)},{ObserveChanges:Xe,Property:Ze}=n.n1,Qe=class extends n.n1.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!0,e.animationManager.skip(!1),this.destroyFns.push(()=>{e.animationManager.skip(!0)})}};a([Xe((e,t)=>{e.ctx.animationManager.skip(!t)}),Ze],Qe.prototype,"enabled",2),a([Xe((e,t)=>{e.ctx.animationManager.defaultDuration=t}),Ze],Qe.prototype,"duration",2);var Je={type:"root",optionsKey:"animation",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:e=>new Qe(e),themeTemplate:{animation:{enabled:!0}}},{focusCursorAtEnd:et}=n.n1,tt="text-input",it="canvas-overlay",nt=class extends n.n1.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.layout={getTextInputCoords:()=>({x:0,y:0}),getTextPosition:()=>"center",alignment:"center",textAlign:"center"},this.visible=!1,this.element=e.domManager.addChild(it,tt),this.element.classList.add("ag-charts-text-input"),this.destroyFns.push(()=>e.domManager.removeChild(it,tt))}setKeyDownHandler(e){this.element.addEventListener("keydown",e),this.destroyFns.push(()=>this.element.removeEventListener("keydown",e))}show(e){this.element.innerHTML='<div contenteditable="plaintext-only" class="ag-charts-text-input__textarea" tabindex="0"></div>';const t=this.element.firstElementChild;(0,s.Bq)(t,"data-preventdefault",!1),t.isContentEditable||(t.contentEditable="true"),t.setAttribute("placeholder",this.ctx.localeManager.t(e.placeholderText??"inputTextareaPlaceholder")),e.styles?.placeholderColor&&t.style.setProperty("--placeholder-text-color",e.styles?.placeholderColor),t.innerText=e.text??"",t.style.color=e.styles?.color??"inherit",t.style.fontFamily=e.styles?.fontFamily??"inherit",t.style.fontSize=e.styles?.fontSize?`${e.styles.fontSize}px`:"inherit",t.style.fontStyle=e.styles?.fontStyle??"inherit",t.style.fontWeight="number"==typeof e.styles?.fontWeight?`${e.styles.fontWeight}`:e.styles?.fontWeight??"inherit",et(t),t.addEventListener("input",()=>{this.updatePosition(),e.onChange?.(this.getValue(),this.getBBox())}),t.addEventListener("click",e=>{e.stopPropagation()}),e.layout&&(this.layout=e.layout,this.updatePosition()),e.onChange?.(this.getValue(),this.getBBox()),this.visible=!0}hide(){this.element.innerHTML="",this.layout={getTextInputCoords:()=>({x:0,y:0}),getTextPosition:()=>"center",alignment:"center",textAlign:"center"},this.visible=!1}isVisible(){return this.visible}updateColor(e){this.element.firstElementChild&&(this.element.firstElementChild.style.color=e)}updateFontSize(e){if(this.element.firstElementChild)return this.element.firstElementChild.style.fontSize=`${e}px`,this.updatePosition(),this.getBBox()}getValue(){if(this.element.firstElementChild)return this.element.firstElementChild.innerText.trim()}updatePosition(){const{element:e}=this,t=e.firstElementChild;if(!t)return;const i=this.ctx.domManager.getBoundingClientRect(),{width:n,getTextInputCoords:s,getTextPosition:r,alignment:o,textAlign:a}=this.layout;e.style.setProperty("width",n?`${n}px`:"unset");const l=t.getBoundingClientRect(),c=s(l.height);let h=c.x;"center"===o?h-=(n??l.width)/2:"right"===o&&(h-=n??l.width);const u=r();let d=c.y;"center"===u?d-=l.height/2:"bottom"===u&&(d-=l.height),e.style.setProperty("top",`${d}px`),e.style.setProperty("left",`${h}px`),e.style.setProperty("max-width",i.width-h+"px"),e.style.setProperty("text-align",o),t.style.setProperty("text-align",a)}getBBox(){const{left:e,top:t,width:i,height:s}=this.element.getBoundingClientRect();return new n.n1.BBox(e,t,i,s)}},{BaseProperties:st,Property:rt}=n.n1,ot=class extends st{constructor(){super(...arguments),this.enabled=!1,this.axes="y"}};a([rt],ot.prototype,"enabled",2),a([rt],ot.prototype,"axes",2);var at=(e=>(e.Line="line",e.HorizontalLine="horizontal-line",e.VerticalLine="vertical-line",e.DisjointChannel="disjoint-channel",e.ParallelChannel="parallel-channel",e.FibonacciRetracement="fibonacci-retracement",e.FibonacciRetracementTrendBased="fibonacci-retracement-trend-based",e.Callout="callout",e.Comment="comment",e.Note="note",e.Text="text",e.Arrow="arrow",e.ArrowUp="arrow-up",e.ArrowDown="arrow-down",e.DateRange="date-range",e.PriceRange="price-range",e.DatePriceRange="date-price-range",e.QuickDatePriceRange="quick-date-price-range",e))(at||{}),lt=Object.values(at),{BaseProperties:ct,Property:ht}=n.n1,ut=class extends ct{};a([ht],ut.prototype,"x",2),a([ht],ut.prototype,"y",2);var dt=class extends(kt(Pt(It(ct)))){},pt=class extends(kt(Pt(Rt(Mt(_t(ct)))))){constructor(){super(...arguments),this.cornerRadius=2}};a([ht],pt.prototype,"enabled",2),a([ht],pt.prototype,"cornerRadius",2);var gt=class extends(Rt(ct)){},ft=class extends(kt(Pt(Rt(ct)))){},mt=class extends(_t(ct)){constructor(){super(...arguments),this.label="",this.position="top",this.alignment="left"}};a([ht],mt.prototype,"label",2),a([ht],mt.prototype,"position",2),a([ht],mt.prototype,"alignment",2);var yt=class extends(_t(ct)){},vt=class extends(_t(ct)){constructor(){super(...arguments),this.label=""}};function bt(e){class t extends(function(e){class t extends e{}return a([ht],t.prototype,"locked",2),t}(It(e))){constructor(){super(...arguments),this.id=(0,s.lk)()}}return t}function Ct(e){class t extends e{constructor(){super(...arguments),this.start=new ut,this.end=new ut}}return a([ht],t.prototype,"start",2),a([ht],t.prototype,"end",2),t}function wt(e){class t extends e{}return a([ht],t.prototype,"x",2),a([ht],t.prototype,"y",2),t}function St(e){class t extends e{}return a([ht],t.prototype,"value",2),t}function xt(e){class t extends e{constructor(){super(...arguments),this.background=new gt}}return a([ht],t.prototype,"background",2),t}function Et(e){class t extends e{constructor(){super(...arguments),this.handle=new ft}}return a([ht],t.prototype,"handle",2),t}function At(e){class t extends e{constructor(){super(...arguments),this.axisLabel=new pt}}return a([ht],t.prototype,"axisLabel",2),t}function Mt(e){class t extends e{constructor(){super(...arguments),this.padding=void 0,this.textAlign="center",this.formatter=void 0}}return a([ht],t.prototype,"padding",2),a([ht],t.prototype,"textAlign",2),a([ht],t.prototype,"formatter",2),t}function Tt(e){class t extends e{}return a([ht],t.prototype,"extendStart",2),a([ht],t.prototype,"extendEnd",2),t}function Dt(e){return class extends e{setLocaleManager(e){this.localeManager??(this.localeManager=e)}}}function It(e){class t extends e{}return a([ht],t.prototype,"visible",2),t}function Rt(e){class t extends e{}return a([ht],t.prototype,"fill",2),a([ht],t.prototype,"fillOpacity",2),t}function kt(e){class t extends e{}return a([ht],t.prototype,"stroke",2),a([ht],t.prototype,"strokeOpacity",2),a([ht],t.prototype,"strokeWidth",2),t}function Pt(e){class t extends e{constructor(){super(...arguments),this.lineCap=void 0,this.computedLineDash=void 0}}return a([ht],t.prototype,"lineDash",2),a([ht],t.prototype,"lineDashOffset",2),a([ht],t.prototype,"lineStyle",2),t}function _t(e){class t extends e{constructor(){super(...arguments),this.fontSize=12,this.fontFamily="Verdana, sans-serif"}}return a([ht],t.prototype,"fontStyle",2),a([ht],t.prototype,"fontWeight",2),a([ht],t.prototype,"fontSize",2),a([ht],t.prototype,"fontFamily",2),a([ht],t.prototype,"color",2),t}function Lt(e){return(0,s.Et)(e)||(0,s.Kg)(e)||(0,s.$P)(e)?{value:e,groupPercentage:0}:e??{value:void 0,groupPercentage:0}}function Nt(e){return Lt(e)?.value}a([ht],vt.prototype,"label",2),a([ht],vt.prototype,"position",2),a([ht],vt.prototype,"alignment",2);var{clampArray:Ot}=n.n1;function Ft(e,t){if(null==e.start||null==e.end)return;const i=Gt(e.start,t),n=Gt(e.end,t);return null!=i&&null!=n?{x1:i.x,y1:i.y,x2:n.x,y2:n.y}:void 0}function Gt(e,t){return{x:Bt(e.x,t.xAxis),y:Bt(e.y,t.yAxis)}}function Bt(e,t){if(null==e)return 0;const{value:i,groupPercentage:n}=Lt(e),{scale:s,snapToGroup:r}=t,o=0===s.bandwidth?s.step??0:s.bandwidth??0,a=r?o/2:o*n;return s.convert(i)+a}function Vt(e,t){return{x:Ht(e.x,t.xAxis),y:Ht(e.y,t.yAxis)}}function Ht(e,t){const{scale:i}=t;if(t.continuous&&null==i.step)return t.scaleInvert(e);const n=t.scaleInvertNearest(e),s=0===i.bandwidth?i.step:i.bandwidth??0,r=i.convert(n),o=r+s,a=Ot(e,i.range);return{value:n,groupPercentage:r===o?0:(a-r)/(o-r)}}var{BaseProperties:Ut}=n.n1,zt=class extends(bt(Ct(Et(Ut)))){constructor(){super(...arguments),this.snapToAngle=45}getDefaultColor(e){}getDefaultOpacity(e){}},{Property:Wt}=n.n1,jt=class extends(Dt(Mt(_t(zt)))){constructor(){super(...arguments),this.text="",this.position="top",this.alignment="left",this.placement="inside",this.placeholderText="inputTextareaPlaceholder"}getDefaultColor(e){return this.color}getDefaultOpacity(e){}getPlaceholderColor(){}getPadding(){const{padding:e=0}=this;return{top:e,right:e,bottom:e,left:e}}getText(){const e=0==this.text.length;let t=this.text;return e&&(t=this.placeholderText??"",this.localeManager&&(t=this.localeManager.t(t))),{text:t,isPlaceholder:e}}getTextInputCoords(e,t){return Gt(this.end,e)}getTextPosition(){return this.position}};a([Wt],jt.prototype,"text",2);var{Property:$t,Color:Kt}=n.n1,Yt={top:6,right:12,bottom:9,left:12},qt=class extends(Rt(kt(jt))){constructor(){super(...arguments),this.type="callout",this.position="bottom",this.alignment="left"}static is(e){return(0,s.Gv)(e)&&"callout"===e.type}getDefaultColor(e){switch(e){case"fill-color":return this.fill;case"line-color":return this.stroke;default:return this.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.fillOpacity;case"line-color":return this.strokeOpacity;default:return}}getPlaceholderColor(){const{r:e,g:t,b:i}=Kt.fromString(this.color??"#888888");return new Kt(e,t,i,.66).toString()}getPadding(){const{padding:e}=this;return null==e?{...Yt}:{top:e,right:e,bottom:e,left:e}}getTextInputCoords(e,t){const i=super.getTextInputCoords(e,t),n=this.getPadding(),s=n.left??0,r=n.bottom??0;return{x:i.x+s,y:i.y-r}}};a([$t],qt.prototype,"type",2);var{BaseProperties:Xt,Property:Zt}=n.n1,Qt=class extends(bt(wt(Et(Mt(_t(Xt)))))){constructor(){super(...arguments),this.text="",this.position="top",this.alignment="left",this.placement="inside",this.placeholderText="inputTextareaPlaceholder"}getDefaultColor(e){return this.color}getDefaultOpacity(e){}getPlaceholderColor(){}getPadding(){const{padding:e=0}=this;return{top:e,right:e,bottom:e,left:e}}getText(){const e=0==this.text.length;return{text:e?this.placeholderText??"":this.text,isPlaceholder:e}}getTextInputCoords(e,t){return Gt(this,e)}getTextPosition(){return this.position}};a([Zt],Qt.prototype,"text",2);var{Property:Jt,Color:ei}=n.n1,ti=class extends(Rt(kt(Qt))){constructor(){super(...arguments),this.type="comment",this.position="bottom",this.alignment="left"}static is(e){return(0,s.Gv)(e)&&"comment"===e.type}getDefaultColor(e){switch(e){case"fill-color":return this.fill;case"line-color":return this.stroke;default:return this.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.fillOpacity;case"line-color":return this.strokeOpacity;default:return}}getPlaceholderColor(){const{r:e,g:t,b:i}=ei.fromString(this.color??"#888888");return new ei(e,t,i,.66).toString()}getPadding(){const{padding:e,fontSize:t}=this;return null==e?{top:Math.max(.4*t,8),bottom:Math.max(.4*t,8),left:Math.max(.8*t,14),right:Math.max(.8*t,14)}:{top:e,right:e,bottom:e,left:e}}getTextInputCoords(e,t){const i=super.getTextInputCoords(e,t),n=this.getPadding();return{x:i.x+n.left,y:i.y-n.bottom}}};a([Jt],ti.prototype,"type",2);var{Vec2:ii}=n.n1;function ni(e,t){return e?"dashed":t??"solid"}function si(e,t){switch(t){case"solid":return[];case"dashed":return[4*e,2*e];case"dotted":return[0,2*e]}}function ri(e,t,i,n){const s=ni(e,i);return t??e??si(n??1,s)}function oi(e,t,i){const n=ni(t,i);return e??"dotted"===n?"round":void 0}var{BaseProperties:ai,Property:li}=n.n1,ci=class extends(kt(ai)){},hi=class extends(_t(Rt(kt(ai)))){constructor(){super(...arguments),this.divider=new ci}};a([li],hi.prototype,"divider",2);var ui=class extends(Rt(kt(Et(ai)))){constructor(){super(...arguments),this.statistics=new hi}};a([li],ui.prototype,"statistics",2);var di=class extends(Dt(xt(kt(Pt(zt))))){constructor(){super(...arguments),this.direction="both",this.hasDateRange=!1,this.hasPriceRange=!1,this.statistics=new hi,this.getVolume=()=>{},this.text=new mt}getDefaultColor(e){switch(e){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return ri(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return oi(this.lineCap,this.lineDash,this.lineStyle)}};function pi(e){return class extends e{constructor(){super(...arguments),this.hasDateRange=!0}}}function gi(e){return class extends e{constructor(){super(...arguments),this.hasPriceRange=!0}}}a([li],di.prototype,"statistics",2),a([li],di.prototype,"text",2);var fi=class extends(pi(di)){constructor(){super(...arguments),this.type="date-range",this.direction="horizontal"}static is(e){return(0,s.Gv)(e)&&"date-range"===e.type}};a([li],fi.prototype,"type",2),a([li],fi.prototype,"extendAbove",2),a([li],fi.prototype,"extendBelow",2);var mi=class extends(gi(di)){constructor(){super(...arguments),this.type="price-range",this.direction="vertical"}static is(e){return(0,s.Gv)(e)&&"price-range"===e.type}};a([li],mi.prototype,"type",2),a([li],mi.prototype,"extendLeft",2),a([li],mi.prototype,"extendRight",2);var yi=class extends(pi(gi(di))){constructor(){super(...arguments),this.type="date-price-range",this.direction="both"}static is(e){return(0,s.Gv)(e)&&"date-price-range"===e.type}};a([li],yi.prototype,"type",2);var vi=class extends(pi(gi(di))){constructor(){super(...arguments),this.type="quick-date-price-range",this.up=new ui,this.down=new ui,this.direction="both"}static is(e){return(0,s.Gv)(e)&&"quick-date-price-range"===e.type}};a([li],vi.prototype,"type",2),a([li],vi.prototype,"up",2),a([li],vi.prototype,"down",2);var{TextWrapper:bi,CachedTextMeasurerPool:Ci,BBox:wi}=n.n1,Si=1.38;function xi(e){return{font:{fontFamily:e.fontFamily,fontSize:e.fontSize,fontStyle:e.fontStyle,fontWeight:e.fontWeight},textAlign:e.textAlign,textBaseline:"center"==e.position?"middle":e.position,lineHeight:Si,avoidOrphans:!1,textWrap:"always"}}function Ei(e,t,i){return i?bi.wrapText(t,{...xi(e),maxWidth:i}):t}function Ai(e,t,i,n){let s=n?.width??0,r=n?.height??0;if(!n){const i=null!=e.width?Ei(e,t,e.width):t;({width:s,height:r}=function(e,t){const i=xi(e),{lineMetrics:n,width:s}=Ci.measureLines(t,i);return{width:s,height:n.length*(e.fontSize??14)*Si}}(e,i))}return new wi(i.x,i.y,s,r)}function Mi(e,t,i,n,{x:s,y:r},o){const{visible:a=!0,fontFamily:l,fontSize:c=14,fontStyle:h,fontWeight:u,textAlign:d}=n,p=c*Si;o??(o="center"==n.position?"middle":n.position);const g=i?n.getPlaceholderColor():n.color;e.setProperties({x:s,y:r,visible:a,text:t,fill:g,fontFamily:l,fontSize:c,fontStyle:h,fontWeight:u,textAlign:d,lineHeight:p,textBaseline:o})}var{BaseProperties:Ti,Property:Di}=n.n1,Ii=class extends(Rt(kt(Ti))){},Ri=class extends(Rt(kt(Qt))){constructor(){super(...arguments),this.type="note",this.background=new Ii,this.position="bottom",this.alignment="center",this.width=200}static is(e){return(0,s.Gv)(e)&&"note"===e.type}getDefaultColor(e){switch(e){case"line-color":return this.fill;case"text-color":return this.color}}getDefaultOpacity(e){switch(e){case"line-color":return this.fillOpacity;case"text-color":return}}getPadding(){const e=this.padding??10;return{top:e,right:e,bottom:e,left:e}}getTextInputCoords(e,t){const{width:i,text:n}=this,r=super.getTextInputCoords(e,t),o=this.getPadding().top,a=Ai(this,n,r);a.x=(0,s.qE)(i/2,a.x,e.seriesRect.width-i/2);const l=a.y-30-2*o,c=a.y+11+2*o;return l-Math.max(a.height,t)-34<0?(a.y=c,this.position="top"):(a.y=l+o,this.position="bottom"),{x:a.x,y:a.y}}};a([Di],Ri.prototype,"type",2),a([Di],Ri.prototype,"background",2);var{BaseProperties:ki}=n.n1,Pi=class extends(bt(wt(Et(ki)))){getDefaultColor(e){}getDefaultOpacity(e){}},_i=class e extends(Rt(Pi)){constructor(){super(...arguments),this.size=32}static is(t){return t instanceof e}getDefaultColor(e){return"fill-color"===e?this.fill:void 0}getDefaultOpacity(e){return"fill-color"===e?this.fillOpacity:void 0}},{BaseProperties:Li,Property:Ni}=n.n1,Oi=class extends(bt(St(Et(At(kt(Pt(Li))))))){constructor(){super(...arguments),this.direction="horizontal",this.type="horizontal-line",this.text=new mt}static is(e){return(0,s.Gv)(e)&&"horizontal-line"===e.type}getDefaultColor(){return this.stroke}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return ri(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return oi(this.lineCap,this.lineDash,this.lineStyle)}};a([Ni],Oi.prototype,"type",2),a([Ni],Oi.prototype,"text",2);var Fi=class extends(bt(St(Et(At(kt(Pt(Li))))))){constructor(){super(...arguments),this.direction="vertical",this.type="vertical-line",this.text=new mt}static is(e){return(0,s.Gv)(e)&&"vertical-line"===e.type}getDefaultColor(){return this.stroke}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return ri(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return oi(this.lineCap,this.lineDash,this.lineStyle)}};a([Ni],Fi.prototype,"type",2),a([Ni],Fi.prototype,"text",2);var{BaseProperties:Gi,Property:Bi}=n.n1,Vi=class extends(bt(xt(Ct(Et(Tt(kt(Pt(Gi)))))))){constructor(){super(...arguments),this.type="disjoint-channel",this.text=new vt,this.snapToAngle=45}static is(e){return(0,s.Gv)(e)&&"disjoint-channel"===e.type}get bottom(){const e={start:{x:this.start.x,y:this.start.y},end:{x:this.end.x,y:this.end.y}};return"number"==typeof e.start.y&&"number"==typeof e.end.y?(e.start.y-=this.startHeight,e.end.y-=this.endHeight):s.Vy.warnOnce(`Annotation [${this.type}] can only be used with a numeric y-axis.`),e}getDefaultColor(e){switch(e){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return ri(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return oi(this.lineCap,this.lineDash,this.lineStyle)}};a([Bi],Vi.prototype,"type",2),a([Bi],Vi.prototype,"startHeight",2),a([Bi],Vi.prototype,"endHeight",2),a([Bi],Vi.prototype,"text",2);var{Property:Hi}=n.n1,Ui=class extends(Dt(function(e){return class extends e{}}(Tt(kt(Pt(zt)))))){constructor(){super(...arguments),this.text=new mt}getDefaultColor(e){switch(e){case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return ri(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return oi(this.lineCap,this.lineDash,this.lineStyle)}};a([Hi],Ui.prototype,"text",2);var zi=class extends Ui{constructor(){super(...arguments),this.type="arrow",this.endCap="arrow"}static is(e){return(0,s.Gv)(e)&&"arrow"===e.type}};a([Hi],zi.prototype,"type",2);var Wi=class extends Ui{constructor(){super(...arguments),this.type="line"}static is(e){return(0,s.Gv)(e)&&"line"===e.type}};a([Hi],Wi.prototype,"type",2);var{Property:ji}=n.n1,$i=class extends Ui{constructor(){super(...arguments),this.label=new yt,this.reverse=!1,this.showFill=!0,this.isMultiColor=!0,this.strokes=[],this.bands=10}getDefaultColor(e){switch(e){case"line-color":return this.rangeStroke??this.stroke;case"text-color":return this.text.color}}};a([ji],$i.prototype,"label",2),a([ji],$i.prototype,"reverse",2),a([ji],$i.prototype,"showFill",2),a([ji],$i.prototype,"isMultiColor",2),a([ji],$i.prototype,"strokes",2),a([ji],$i.prototype,"rangeStroke",2),a([ji],$i.prototype,"bands",2);var{Property:Ki}=n.n1,Yi=class extends $i{constructor(){super(...arguments),this.type="fibonacci-retracement-trend-based",this.endRetracement=new ut}static is(e){return(0,s.Gv)(e)&&"fibonacci-retracement-trend-based"===e.type}};a([Ki],Yi.prototype,"type",2),a([Ki],Yi.prototype,"endRetracement",2);var{Property:qi}=n.n1,Xi=class extends $i{constructor(){super(...arguments),this.type="fibonacci-retracement"}static is(e){return(0,s.Gv)(e)&&"fibonacci-retracement"===e.type}};a([qi],Xi.prototype,"type",2);var{BaseProperties:Zi,Property:Qi}=n.n1,Ji=class extends(bt(xt(Ct(Et(Tt(kt(Pt(Zi)))))))){constructor(){super(...arguments),this.type="parallel-channel",this.middle=new dt,this.text=new vt,this.snapToAngle=45}static is(e){return(0,s.Gv)(e)&&"parallel-channel"===e.type}get bottom(){const e={start:{x:this.start.x,y:this.start.y},end:{x:this.end.x,y:this.end.y}};return"number"==typeof e.start.y&&"number"==typeof e.end.y?(e.start.y-=this.height,e.end.y-=this.height):s.Vy.warnOnce(`Annotation [${this.type}] can only be used with a numeric y-axis.`),e}getDefaultColor(e){switch(e){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return ri(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return oi(this.lineCap,this.lineDash,this.lineStyle)}};a([Qi],Ji.prototype,"type",2),a([Qi],Ji.prototype,"height",2),a([Qi],Ji.prototype,"middle",2),a([Qi],Ji.prototype,"text",2);var{Property:en}=n.n1,tn=class extends Qt{constructor(){super(...arguments),this.type="text",this.position="bottom"}static is(e){return(0,s.Gv)(e)&&"text"===e.type}};function nn(e){return vi.is(e)}function sn(e){return Wi.is(e)||Oi.is(e)||Fi.is(e)||zi.is(e)||on(e)}function rn(e){return Vi.is(e)||Ji.is(e)}function on(e){return Xi.is(e)||Yi.is(e)}function an(e){return qt.is(e)||ti.is(e)||Ri.is(e)||tn.is(e)}function ln(e){return fi.is(e)||mi.is(e)||yi.is(e)||vi.is(e)}function cn(e){return an(e)&&!Ri.is(e)}function hn(e){return sn(e)||rn(e)||ln(e)&&!vi.is(e)}function un(e){return sn(e)||rn(e)||ln(e)||qt.is(e)||Ri.is(e)}function dn(e){return rn(e)||ln(e)||qt.is(e)||ti.is(e)||_i.is(e)}function pn(e){return an(e)&&!Ri.is(e)}function gn(e){return(sn(e)||rn(e)||ln(e))&&!nn(e)&&(0,s.Gv)(e.text)}function fn(e,t){"fontSize"in e&&(e.fontSize=t),gn(e)&&(e.text.fontSize=t)}function mn(e,t){const i=t?.strokeWidth??e.strokeWidth??1,n=t?.type??e.lineStyle,s=n??ni(e.lineDash,n),r=si(i,s);e.strokeWidth=i,e.computedLineDash=r,e.lineStyle=s,e.lineCap="dotted"===s?"round":void 0}function yn(e,t,i,n,s,r){switch(t){case"fill-color":"fill"in e&&(e.fill=n),"fillOpacity"in e&&(e.fillOpacity=s),"background"in e&&(e.background.fill=n,e.background.fillOpacity=s);break;case"line-color":"axisLabel"in e&&(e.axisLabel.fill=n,e.axisLabel.fillOpacity=s,e.axisLabel.stroke=n,e.axisLabel.strokeOpacity=s),"fill"in e&&"fillOpacity"in e&&function(e){return Ri.is(e)}(e)?(e.fill=n,e.fillOpacity=s):("strokeOpacity"in e&&(e.strokeOpacity=s),"isMultiColor"in e&&"rangeStroke"in e?(e.isMultiColor=r,e.rangeStroke=n):"stroke"in e&&(e.stroke=n));break;case"text-color":"color"in e&&(e.color=i),gn(e)&&(e.text.color=n)}}a([en],tn.prototype,"type",2);var{deepClone:vn}=n.n1,bn=class{constructor(){this.mementoOriginatorKey="annotation-defaults",this.colors=new Map(Object.values(at).map(e=>[e,new Map([["line-color",void 0],["fill-color",void 0],["text-color",void 0]])])),this.fontSizes=new Map([["callout",void 0],["comment",void 0],["text",void 0],["arrow",void 0],["line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineStyles=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineTextAlignments=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineTextPositions=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.fibonacciOptions=new Map([["fibonacci-retracement",{bands:void 0,reverse:void 0,showFill:void 0}],["fibonacci-retracement-trend-based",{bands:void 0,reverse:void 0,showFill:void 0}]])}createMemento(){return{colors:vn(this.colors),fontSizes:vn(this.fontSizes),lineStyles:vn(this.lineStyles),lineTextAlignments:vn(this.lineTextAlignments),lineTextPositions:vn(this.lineTextPositions),fibonacciOptions:vn(this.fibonacciOptions)}}guardMemento(e){return!0}restoreMemento(e,t,i){this.colors=vn(i.colors),this.fontSizes=vn(i.fontSizes),this.lineStyles=vn(i.lineStyles),this.lineTextAlignments=vn(i.lineTextAlignments),this.lineTextPositions=vn(i.lineTextPositions),this.fibonacciOptions=vn(i.fibonacciOptions)}setDefaultColor(e,t,i,n,s,r){this.colors.get(e)?.set(t,[i,n,s,r])}setDefaultFontSize(e,t){this.fontSizes.set(e,t)}setDefaultLineStyleType(e,t){const i=this.lineStyles.get(e);i?i.type=t:this.lineStyles.set(e,{type:t})}setDefaultLineStyleWidth(e,t){const i=this.lineStyles.get(e);i?i.strokeWidth=t:this.lineStyles.set(e,{strokeWidth:t})}setDefaultLineTextAlignment(e,t){this.lineTextAlignments.set(e,t)}setDefaultLineTextPosition(e,t){this.lineTextPositions.set(e,t)}setDefaultFibonacciOptions(e,t,i){if("fibonacci-retracement"!=e&&"fibonacci-retracement-trend-based"!=e)return;const n=this.fibonacciOptions.get(e);n[t]=i,this.fibonacciOptions.set(e,n)}applyDefaults(e){for(const[t,i]of this.colors)if(e.type===t)for(const[t,[n,s,r,o]=[]]of i)n&&s&&null!=r&&null!=o&&yn(e,t,n,s,r,o);for(const[t,i]of this.fontSizes)e.type===t&&null!=i&&fn(e,i);for(const[t,i]of this.lineStyles)e.type===t&&null!=i&&mn(e,i);for(const[t,i]of this.lineTextPositions)e.type===t&&null!=i&&(e.text.position=i);for(const[t,i]of this.lineTextAlignments)e.type===t&&null!=i&&(e.text.alignment=i);for(const[t,i]of this.fibonacciOptions)e.type===t&&null!=i&&Object.keys(i).forEach(t=>{const n=i[t];null!=n&&e.set({[t]:n})})}},{Color:Cn}=n.n1,wn=e=>{try{const t=Cn.fromString(e),[i,n,s]=t.toHSB();return[i,n,s,t.a]}catch{return}},Sn=class extends n.n1.AnchoredPopover{constructor(e,t){super(e,"color-picker",t),this.hasChanged=!1,this.hideFns.push(()=>{this.hasChanged&&this.onChangeHide?.()})}show(e){this.hasChanged=!1,this.onChangeHide=e.onChangeHide;const{element:t,initialFocus:i}=this.createColorPicker(e),n=this.showWithChildren([t],{initialFocus:i,...e});n.classList.add("ag-charts-color-picker"),n.setAttribute("role","dialog")}createColorPicker(e){let t=e.isMultiColor??!1,[i,n,r,o]=wn(e.color??"#f00")??[0,1,.5,1];o=e.opacity??o;const a=(0,s.n)("div","ag-charts-color-picker__content");a.innerHTML='<div class="ag-charts-color-picker__palette" tabindex="0"></div><div class="ag-charts-color-picker__color-row"><button class="ag-charts-color-picker__multi-color-button" tabindex="0" type="button"></button> <input class="ag-charts-color-picker__hue-input" tabindex="0" type="range" min="0" max="360" value="0"></div><input class="ag-charts-color-picker__alpha-input" tabindex="0" type="range" min="0" max="1" value="1" step="0.01"> <label class="ag-charts-color-picker__color-field"><span class="ag-charts-color-picker__color-label">Color</span> <input class="ag-charts-color-picker__color-input" tabindex="0" value="#000"></label>',a.ariaLabel=this.ctx.localeManager.t("ariaLabelColorPicker");const l=a.querySelector(".ag-charts-color-picker__palette"),c=a.querySelector(".ag-charts-color-picker__hue-input"),h=a.querySelector(".ag-charts-color-picker__multi-color-button"),u=a.querySelector(".ag-charts-color-picker__alpha-input"),d=a.querySelector(".ag-charts-color-picker__color-input"),p=a.querySelector(".ag-charts-color-picker__color-label");h.classList.toggle("ag-charts-color-picker__multi-color-button--hidden",!e.hasMultiColorOption);const g=(s=!0)=>{const l=Cn.fromHSB(i,n,r,o).toHexString();if(a.style.setProperty("--h",`${i}`),a.style.setProperty("--s",`${n}`),a.style.setProperty("--v",`${r}`),a.style.setProperty("--a",`${o}`),a.style.setProperty("--color",l.slice(0,7)),a.style.setProperty("--color-a",l),c.value=`${i}`,u.value=`${o}`,u.classList.toggle("ag-charts-color-picker__alpha-input--opaque",1===o),h.classList.toggle("ag-charts-color-picker__multi-color-button--active",t),p.classList.toggle("ag-charts-color-picker__color-label--multi-color",t),document.activeElement!==d&&(d.value=t?"Multi Colour":l.toUpperCase()),s||null==e.color){const s=Cn.fromHSB(i,n,r,1).toHexString();e.onChange?.(l,s,o,t)}s&&(this.hasChanged=!0)};g(!1);const f=e=>e.preventDefault(),m=e=>e.stopPropagation();return a.addEventListener("mousedown",m),a.addEventListener("touchstart",m),a.addEventListener("touchmove",m),a.addEventListener("keydown",e=>{switch(e.stopPropagation(),e.key){case"Enter":case"Escape":this.hide();break;default:return}e.preventDefault()}),l.addEventListener("pointerdown",e=>{e.preventDefault();const i=e.currentTarget;i.focus();const s=i.getBoundingClientRect(),o=({clientX:e,clientY:i})=>{t=!1,n=Math.min(Math.max((e-s.left)/s.width,0),1),r=1-Math.min(Math.max((i-s.top)/s.height,0),1),g()};o(e),window.addEventListener("pointermove",o),window.addEventListener("pointerup",()=>{window.removeEventListener("pointermove",o)},{once:!0})}),l.addEventListener("touchstart",f,{passive:!1}),l.addEventListener("touchmove",f,{passive:!1}),l.addEventListener("keydown",e=>{if("ArrowLeft"===e.key)n=(0,s.qE)(0,n-.01,1);else if("ArrowRight"===e.key)n=(0,s.qE)(0,n+.01,1);else if("ArrowUp"===e.key)r=(0,s.qE)(0,r+.01,1);else{if("ArrowDown"!==e.key)return;r=(0,s.qE)(0,r-.01,1)}e.preventDefault(),g()}),h.addEventListener("click",()=>{t=!t,g()}),c.addEventListener("input",e=>{t=!1,i=e.currentTarget.valueAsNumber??0,g()}),u.addEventListener("input",e=>{t=!1,o=e.currentTarget.valueAsNumber??0,g()}),d.addEventListener("input",e=>{t=!1;const s=wn(e.currentTarget.value);null!=s&&([i,n,r,o]=s,g())}),d.addEventListener("blur",()=>g()),d.addEventListener("keydown",e=>{"Enter"===e.key&&(e.currentTarget.blur(),g())}),{element:a,initialFocus:l}}};function xn(e){return!(e instanceof n.n1.LogScale||e instanceof n.n1.BandScale)}var En=[{label:"toolbarAnnotationsTrendLine",icon:"trend-line-drawing",value:"line"},{label:"toolbarAnnotationsHorizontalLine",icon:"horizontal-line-drawing",value:"horizontal-line"},{label:"toolbarAnnotationsVerticalLine",icon:"vertical-line-drawing",value:"vertical-line"},{label:"toolbarAnnotationsParallelChannel",icon:"parallel-channel-drawing",value:"parallel-channel",visible:xn},{label:"toolbarAnnotationsDisjointChannel",icon:"disjoint-channel-drawing",value:"disjoint-channel",visible:xn}],An=[{label:"toolbarAnnotationsFibonacciRetracement",icon:"fibonacci-retracement-drawing",value:"fibonacci-retracement"},{label:"toolbarAnnotationsFibonacciRetracementTrendBased",icon:"fibonacci-retracement-trend-based-drawing",value:"fibonacci-retracement-trend-based"}],Mn=[{label:"Fibonacci - Extended",value:10},{label:"Fibonacci - 6 Band",value:6},{label:"Fibonacci - 4 Band",value:4}],Tn=[{label:"toolbarAnnotationsText",icon:"text-annotation",value:"text"},{label:"toolbarAnnotationsComment",icon:"comment-annotation",value:"comment"},{label:"toolbarAnnotationsCallout",icon:"callout-annotation",value:"callout"},{label:"toolbarAnnotationsNote",icon:"note-annotation",value:"note"}],Dn=[{label:"toolbarAnnotationsArrow",icon:"arrow-drawing",value:"arrow"},{label:"toolbarAnnotationsArrowUp",icon:"arrow-up-drawing",value:"arrow-up"},{label:"toolbarAnnotationsArrowDown",icon:"arrow-down-drawing",value:"arrow-down"}],In=[{label:"toolbarAnnotationsQuickDatePriceRange",icon:"measurer-drawing",value:"quick-date-price-range"},{label:"toolbarAnnotationsDateRange",icon:"date-range-drawing",value:"date-range"},{label:"toolbarAnnotationsPriceRange",icon:"price-range-drawing",value:"price-range"},{label:"toolbarAnnotationsDatePriceRange",icon:"date-price-range-drawing",value:"date-price-range"}],Rn=[{strokeWidth:1,label:"1",value:1},{strokeWidth:2,label:"2",value:2},{strokeWidth:3,label:"3",value:3},{strokeWidth:4,label:"4",value:4},{strokeWidth:8,label:"8",value:8}],kn=[{icon:"line-style-solid",altText:"iconAltTextLineStyleSolid",value:"solid"},{icon:"line-style-dashed",altText:"iconAltTextLineStyleDashed",value:"dashed"},{icon:"line-style-dotted",altText:"iconAltTextLineStyleDotted",value:"dotted"}],Pn=[{label:"10",value:10},{label:"12",value:12},{label:"14",value:14},{label:"16",value:16},{label:"18",value:18},{label:"22",value:22},{label:"28",value:28},{label:"36",value:36},{label:"46",value:46}],{Color:_n,FloatingToolbar:Ln,Listeners:Nn,Menu:On,PropertiesArray:Fn,ToolbarButtonProperties:Gn,ToolbarButtonWidget:Bn,Property:Vn}=n.n1,Hn=class extends Gn{constructor(){super(...arguments),this.checkedOverrides=new Gn}};a([Vn],Hn.prototype,"value",2),a([Vn],Hn.prototype,"checkedOverrides",2),a([Vn],Hn.prototype,"color",2),a([Vn],Hn.prototype,"strokeWidth",2),a([Vn],Hn.prototype,"isMultiColor",2);var Un=class extends Bn{update(e){super.update(e),"line-stroke-width"===e.value&&this.updateLineStrokeWidth(e),"fill-color"!==e.value&&"line-color"!==e.value&&"text-color"!==e.value||this.updateFillColor(e)}updateFillColor(e){const t=this.getElement();t.classList.add("ag-charts-annotations__color-picker-button"),t.classList.toggle("ag-charts-annotations__color-picker-button--multi-color",e.isMultiColor),t.style.setProperty("--color",e.color??null)}updateLineStrokeWidth(e){const t=this.getElement();t.classList.add("ag-charts-annotations__stroke-width-button"),t.style.setProperty("--stroke-width",`${e.strokeWidth}px`)}},zn=class extends Ln{createButtonWidget(){return new Un(this.localeManager)}},Wn=class extends n.n1.BaseProperties{constructor(e,t){super(),this.ctx=e,this.getActiveDatum=t,this.enabled=!0,this.buttons=new Fn(Hn),this.destroyFns=[],this.events=new Nn,this.visibleButtons=[],this.toolbar=new zn(this.ctx,"annotation-options"),this.colorPicker=new Sn(this.ctx),this.textSizeMenu=new On(this.ctx,"text-size"),this.lineStyleTypeMenu=new On(this.ctx,"annotations-line-style-type"),this.lineStrokeWidthMenu=new On(this.ctx,"annotations-line-stroke-width"),this.destroyFns.push(this.toolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),this.toolbar.addToolbarListener("toolbar-moved",this.onToolbarMoved.bind(this)),e.widgets.seriesWidget.addListener("drag-start",this.onDragStart.bind(this)),e.widgets.seriesWidget.addListener("drag-end",this.onDragEnd.bind(this)),()=>this.colorPicker.destroy())}onDragStart(){this.toolbar.ignorePointerEvents()}onDragEnd(){this.toolbar.capturePointerEvents()}destroy(){for(const e of this.destroyFns)e()}addListener(e,t){return this.events.addListener(e,t)}show(){this.enabled&&this.toolbar.show()}hide(){this.toolbar.hide()}updateButtons(e){if(!this.enabled)return;const t={"line-style-type":hn(e),"line-stroke-width":hn(e),"line-color":un(e),"text-color":pn(e),"fill-color":dn(e),"text-size":cn(e),settings:gn(e),lock:!0,delete:!0};this.visibleButtons=this.buttons.filter(e=>t[e.value]),this.toolbar.clearButtons(),this.toolbar.updateButtons(this.visibleButtons),this.refreshButtons(e)}setAnchorScene(e){this.toolbar.hasBeenDragged()||this.toolbar.setAnchor(e.getAnchor())}hideOverlays(){this.toolbar.clearActiveButton(),this.colorPicker.hide({lastFocus:null}),this.textSizeMenu.hide(),this.lineStyleTypeMenu.hide(),this.lineStrokeWidthMenu.hide(),this.dispatch("hid-overlays")}clearActiveButton(){this.toolbar.clearActiveButton()}updateColors(e){this.updateColorPickerColor("line-color",e.getDefaultColor("line-color"),e.getDefaultOpacity("line-color"),"isMultiColor"in e&&e?.isMultiColor),this.updateColorPickerColor("fill-color",e.getDefaultColor("fill-color"),e.getDefaultOpacity("fill-color"),"isMultiColor"in e&&e?.isMultiColor),this.updateColorPickerColor("text-color",e.getDefaultColor("text-color"),e.getDefaultOpacity("text-color"),"isMultiColor"in e&&e?.isMultiColor)}updateColorPickerColor(e,t,i,n){if(null!=t&&null!=i){const{r:e,g:n,b:s}=_n.fromString(t);t=_n.fromArray([e,n,s,i]).toHexString()}this.updateButtonByValue(e,{color:t,isMultiColor:n})}updateFontSize(e){this.updateButtonByValue("text-size",{label:null!=e?String(e):void 0})}updateLineStyleType(e){this.updateButtonByValue("line-style-type",{icon:e.icon})}updateStrokeWidth(e){this.updateButtonByValue("line-stroke-width",{label:e.label,strokeWidth:e.value})}dispatch(e,t){this.events.dispatch(e,t)}onButtonPress({event:e,button:t}){const i=this.getActiveDatum();if(i)switch(this.hideOverlays(),t.value){case"line-style-type":{const t=hn(i)?ni(i.lineDash,i.lineStyle):void 0;this.lineStyleTypeMenu.show({items:kn,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsLineStyle"),value:t,sourceEvent:e.sourceEvent,onPress:e=>this.onLineStyleTypeMenuPress(e,i),class:"ag-charts-annotations__line-style-type-menu"});break}case"line-stroke-width":{const t=hn(i)?i.strokeWidth:void 0;this.lineStrokeWidthMenu.show({items:Rn,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsLineStrokeWidth"),value:t,sourceEvent:e.sourceEvent,onPress:e=>this.onLineStrokeWidthMenuPress(e,i),class:"ag-charts-annotations__line-stroke-width-menu"});break}case"line-color":case"fill-color":case"text-color":this.toolbar.toggleActiveButtonByIndex(t.index),this.colorPicker.show({color:i?.getDefaultColor(t.value),opacity:i?.getDefaultOpacity(t.value),sourceEvent:e.sourceEvent,hasMultiColorOption:"isMultiColor"in i,isMultiColor:"isMultiColor"in i&&i?.isMultiColor,onChange:null!=i?this.onColorPickerChange.bind(this,t.value,i):void 0,onChangeHide:(e=>{this.dispatch("saved-color",{type:i.type,colorPickerType:t.value,color:i.getDefaultColor(e)})}).bind(this,t.value)});break;case"text-size":{const t=an(i)?i.fontSize:void 0;this.textSizeMenu.show({items:Pn,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsTextSize"),value:t,sourceEvent:e.sourceEvent,onPress:e=>this.onTextSizeMenuPress(e,i),class:"ag-charts-annotations__text-size-menu"});break}case"delete":this.dispatch("pressed-delete");break;case"lock":i.locked=!i.locked,this.refreshButtons(i),this.dispatch("pressed-lock");break;case"settings":this.toolbar.toggleActiveButtonByIndex(t.index),this.dispatch("pressed-settings",e)}}onToolbarMoved(e){const{buttonBounds:t,popoverBounds:i}=e,n={x:i.x,y:i.y+i.height+4},s={y:i.y-4};this.colorPicker.setAnchor(n,s);for(const[e,i]of t.entries()){const t=this.visibleButtons.at(e);if(!t)continue;const n={x:i.x,y:i.y+i.height-1},s={y:i.y};switch(t.value){case"line-stroke-width":this.lineStrokeWidthMenu.setAnchor(n,s);break;case"line-style-type":this.lineStyleTypeMenu.setAnchor(n,s);break;case"text-size":this.textSizeMenu.setAnchor(n,s)}}}onColorPickerChange(e,t,i,n,s,r){this.dispatch("updated-color",{type:t.type,colorPickerType:e,colorOpacity:i,color:n,opacity:s,isMultiColor:r}),this.updateColorPickerColor(e,i,s,r)}onTextSizeMenuPress(e,t){if(!cn(t))return;const i=e.value;this.dispatch("updated-font-size",{type:t.type,fontSize:i}),this.textSizeMenu.hide(),this.updateFontSize(i)}onLineStyleTypeMenuPress(e,t){if(!hn(t))return;const i=e.value;this.dispatch("updated-line-style",{type:t.type,lineStyleType:i}),this.lineStyleTypeMenu.hide(),this.updateLineStyleType(e)}onLineStrokeWidthMenuPress(e,t){if(!hn(t))return;const i=e.value;this.dispatch("updated-line-width",{type:t.type,strokeWidth:i}),this.lineStrokeWidthMenu.hide(),this.updateStrokeWidth(e)}refreshButtons(e){const t=e.locked??!1;for(const[e,i]of this.visibleButtons.entries())i&&("lock"===i.value?(this.toolbar.toggleSwitchCheckedByIndex(e,t),this.updateButtonByIndex(e,t?i.checkedOverrides.toJson():i.toJson())):this.toolbar.toggleButtonEnabledByIndex(e,!t));cn(e)&&this.updateFontSize(e.fontSize),this.updateColors(e),this.updateLineStyles(e)}updateLineStyles(e){if(!hn(e))return;const t=e.strokeWidth??1,i=ni(e.lineDash,e.lineStyle);this.updateStrokeWidth({strokeWidth:t,value:t,label:String(t)}),this.updateLineStyleType(kn.find(e=>e.value===i)??kn[0])}updateButtonByValue(e,t){const i=this.visibleButtons.findIndex(t=>t.value===e);-1!==i&&this.updateButtonByIndex(i,t)}updateButtonByIndex(e,t){const i=this.visibleButtons.at(e);i&&this.toolbar.updateButtonByIndex(e,{...i.toJson(),...t,value:t.value??i.value})}};a([Vn],Wn.prototype,"enabled",2),a([Vn],Wn.prototype,"buttons",2);var{StateMachine:jn,StateMachineProperty:$n,Vec2:Kn,Debug:Yn}=n.n1,qn=class extends jn{constructor(e){const t=({context:t})=>{this.node?.drag(this.datum,this.offset,t,this.snapping),e.update()};super("idle",{idle:{dragStart:{target:"dragging",action:({offset:e,context:t})=>{this.hasMoved=!1,this.dragStart=e,this.offset=e,this.node?.dragStart(this.datum,e,t)}}},dragging:{keyDown:t,keyUp:t,drag:({offset:t,context:i})=>{this.hasMoved=Kn.lengthSquared(Kn.sub(t,this.dragStart))>0,this.offset=t,this.node?.drag(this.datum,t,i,this.snapping),e.update()},dragEnd:{target:jn.parent,action:()=>{this.node?.stopDragging(),this.hasMoved&&e.recordAction("Move annotation"),e.update()}}}}),this.debug=Yn.create(!0,"annotations"),this.hasMoved=!1,this.snapping=!1}};a([$n()],qn.prototype,"snapping",2),a([$n()],qn.prototype,"datum",2),a([$n()],qn.prototype,"node",2);var{Property:Xn}=n.n1,Zn=class extends _i{constructor(){super(...arguments),this.type="arrow-down"}static is(e){return(0,s.Gv)(e)&&"arrow-down"===e.type}};a([Xn],Zn.prototype,"type",2);var Qn=class e extends n.n1.Group{constructor(){super(...arguments),this.active=!1,this.locked=!1,this.visible=!1,this.zIndex=1}drag(e){const{handle:t,locked:i}=this;return i?{point:{x:t.x,y:t.y},offset:{x:0,y:0}}:{point:e,offset:{x:e.x-t.x,y:e.y-t.y}}}toggleActive(t){this.active=t,t||(this.handle.strokeWidth=e.INACTIVE_STROKE_WIDTH)}toggleHovered(e){this.glow.visible=!this.locked&&e,this.glow.dirtyPath=!0}toggleDragging(e){this.locked||(this.handle.visible=!e,this.glow.visible=this.glow.visible&&!e,this.handle.dirtyPath=!0,this.glow.dirtyPath=!0)}toggleLocked(e){this.locked=e}getCursor(){}containsPoint(e,t){return this.handle.containsPoint(e,t)}};Qn.INACTIVE_STROKE_WIDTH=2;var Jn=Qn,es=class e extends Jn{constructor(){super(),this.handle=new n.n1.Marker({shape:"circle"}),this.glow=new n.n1.Marker({shape:"circle"}),this.append([this.handle]),this.handle.size=e.HANDLE_SIZE,this.handle.strokeWidth=Jn.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2}update(e){this.handle.setProperties({...e,strokeWidth:Jn.INACTIVE_STROKE_WIDTH})}drag(e){return{point:e,offset:{x:0,y:0}}}};es.HANDLE_SIZE=7,es.GLOW_SIZE=9;var ts=es,is=class e extends Jn{constructor(){super(),this.handle=new n.n1.Rect,this.glow=new n.n1.Rect,this.gradient="horizontal",this.append([this.glow,this.handle]),this.handle.cornerRadius=e.CORNER_RADIUS,this.handle.width=e.HANDLE_SIZE,this.handle.height=e.HANDLE_SIZE,this.handle.strokeWidth=Jn.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2,this.glow.cornerRadius=e.CORNER_RADIUS,this.glow.width=e.GLOW_SIZE,this.glow.height=e.GLOW_SIZE,this.glow.strokeWidth=0,this.glow.fillOpacity=.2,this.glow.zIndex=1,this.glow.visible=!1}toggleLocked(t){if(super.toggleLocked(t),t){const t=(e.HANDLE_SIZE-ts.HANDLE_SIZE)/2;this.handle.cornerRadius=1,this.handle.fill=this.handle.stroke,this.handle.strokeWidth=0,this.handle.x+=t,this.handle.y+=t,this.handle.width=ts.HANDLE_SIZE,this.handle.height=ts.HANDLE_SIZE,this.glow.width=ts.GLOW_SIZE,this.glow.height=ts.GLOW_SIZE}else this.handle.cornerRadius=e.CORNER_RADIUS,this.handle.width=e.HANDLE_SIZE,this.handle.height=e.HANDLE_SIZE,this.glow.width=e.GLOW_SIZE,this.glow.height=e.GLOW_SIZE,this.cachedStyles&&this.handle.setProperties(this.cachedStyles)}update(t){if(this.cachedStyles={...t},this.active||delete t.strokeWidth,this.locked){delete t.fill,delete t.strokeWidth;const i=(e.HANDLE_SIZE-ts.HANDLE_SIZE)/2;t.x-=i,t.y-=i,this.cachedStyles.x-=i,this.cachedStyles.y-=i}this.handle.setProperties(t),this.glow.setProperties({...t,x:(t.x??this.glow.x)-2,y:(t.y??this.glow.y)-2,strokeWidth:0,fill:t.stroke})}drag(e){return this.locked?{point:e,offset:{x:0,y:0}}:"vertical"===this.gradient?{point:{x:e.x,y:this.handle.y},offset:{x:e.x-this.handle.x,y:0}}:{point:{x:this.handle.x,y:e.y},offset:{x:0,y:e.y-this.handle.y}}}getCursor(){if(!this.locked)return"vertical"===this.gradient?"col-resize":"row-resize"}};is.HANDLE_SIZE=12,is.GLOW_SIZE=16,is.CORNER_RADIUS=4;var ns=is,ss=class e extends Jn{constructor(){super(),this.handle=new n.n1.Marker({shape:"circle"}),this.glow=new n.n1.Marker({shape:"circle"}),this.append([this.glow,this.handle]),this.handle.size=e.HANDLE_SIZE,this.handle.strokeWidth=Jn.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2,this.glow.size=e.GLOW_SIZE,this.glow.strokeWidth=0,this.glow.fillOpacity=.2,this.glow.zIndex=1,this.glow.visible=!1}toggleLocked(t){super.toggleLocked(t),t?(this.handle.fill=this.handle.stroke,this.handle.strokeWidth=0,this.handle.size=ts.HANDLE_SIZE,this.glow.size=ts.GLOW_SIZE):(this.handle.size=e.HANDLE_SIZE,this.glow.size=e.GLOW_SIZE,this.cachedStyles&&this.handle.setProperties(this.cachedStyles))}update(e){this.cachedStyles={...e},this.active||delete e.strokeWidth,this.locked&&(delete e.fill,delete e.strokeWidth),this.handle.setProperties(e),this.glow.setProperties({...e,strokeWidth:0,fill:e.stroke})}getCursor(){return"pointer"}};ss.HANDLE_SIZE=11,ss.GLOW_SIZE=17;var rs=ss,{ZIndexMap:os}=n.n1,as=class extends n.n1.Group{constructor(){super(...arguments),this.name="AnnotationScene",this.zIndex=os.CHART_ANNOTATION}static isCheck(e,t){return(0,s.Gv)(e)&&Object.hasOwn(e,"type")&&e.type===t}toggleHovered(e){this.toggleHandles(e)}*nonHandleChildren(){for(const e of this.children())e instanceof Jn||(yield e)}computeBBoxWithoutHandles(){return n.n1.Transformable.toCanvas(this,n.n1.Group.computeChildrenBBox(this.nonHandleChildren()))}updateNode(e,t,i){if(i||!t)return i&&null==t&&(t=new e,this.appendChild(t)),t;this.removeChild(t)}},{ContinuousScale:ls,Vec2:cs,toRadians:hs}=n.n1;function us(e,t,i=!1,n,s=1){return Vt(i?ds(e,n?Gt(n,t):cs.origin(),s):e,t)}function ds(e,t,i){const n=cs.sub(e,t),s=hs(i),r=Math.round(cs.angle(n)/s)*s;return cs.rotate(n,r,t)}function ps(e,t){const i={};for(const[n,r]of(0,s.jO)(e))i[n]=Gt(r,t);return i}function gs(e,t,i,n={overflowContinuous:0,translateVectors:void 0,invertYVectors:void 0,snap:void 0}){const{xAxis:s,yAxis:r}=i,o=Object.keys(e),a=[],l=[],c=new Set(n.translateVectors??o),h=new Set(n.invertYVectors??[]),u=new Set([...c,...h]),d=cs.multiply(t,cs.from(1,-1));for(const i of o)u.has(i)&&(e[i]=cs.add(e[i],h.has(i)?d:t),n.snap&&(e[i]=ds(e[i],n.snap.vectors[i],n.snap.angle))),a.push(s.getRangeOverflow(e[i].x)),l.push(r.getRangeOverflow(e[i].y));const p=(e,t)=>Math.abs(e)-Math.abs(t),g=(e,t,i)=>0!==n.overflowContinuous&&ls.is(e)?o.length===u.size?i.toSorted(p).at(-n.overflowContinuous-1)??0:i.filter(e=>0!==e).length<=n.overflowContinuous?0:i.filter((e,i)=>0!==e&&Math.abs(e)<=Math.abs(t)&&u.has(o[i])).toSorted(p).at(-1)??0:i.toSorted(p).at(-1)??0,f=cs.from(g(s.scale,t.x,a),g(r.scale,t.y,l));if(!cs.equal(f,cs.origin()))for(const t of o)u.has(t)&&(e[t]=cs.round(cs.sub(e[t],f),4));const m={};for(const t of o)m[t]=Vt(e[t],i);return m}var{Vec2:fs}=n.n1,ms=class extends as{constructor(){super(...arguments),this.handle=new rs,this.anchor={x:0,y:0,position:"above"}}update(e,t){const i=Gt(e,t);this.updateHandle(e,i),this.anchor=this.updateAnchor(e,i,t)}dragStart(e,t,i){this.dragState={offset:t,...ps({handle:e},i)}}drag(e,t,i){const{dragState:n}=this;if(e.locked||!n)return;const{point:s}=gs({point:n.handle},fs.sub(t,n.offset),i);e.x=s.x,e.y=s.y}translate(e,t,i){if(e.locked)return;const{point:n}=gs({point:Gt(e,i)},t,i);e.x=n.x,e.y=n.y}toggleHandles(e){this.handle.visible=Boolean(e),this.handle.toggleHovered("handle"===this.activeHandle)}toggleActive(e){this.toggleHandles(e),this.handle.toggleActive(e)}stopDragging(){this.handle.toggleDragging(!1)}copy(e,t,i){const n=Gt(e,i),s=Vt({x:n.x-30,y:n.y-30},i);return t.x=s.x,t.y=s.y,t}getAnchor(){return this.anchor}getCursor(){return"pointer"}containsPoint(e,t){const{handle:i}=this;return this.activeHandle=void 0,!!i.containsPoint(e,t)&&(this.activeHandle="handle",!0)}getNodeAtCoords(e,t){if(this.handle.containsPoint(e,t))return"handle"}updateHandle(e,t,i){const{x:n,y:s}=this.getHandleCoords(e,t,i),r=this.getHandleStyles(e);this.handle.update({...r,x:n,y:s}),this.handle.toggleLocked(e.locked??!1)}updateAnchor(e,t,i){const n=this.getHandleCoords(e,t);return{x:n.x+i.seriesRect.x,y:n.y+i.seriesRect.y,position:this.anchor.position}}getHandleCoords(e,t,i){return{x:t.x,y:t.y}}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}}},ys=class extends ms{constructor(){super(),this.append([this.handle])}update(e,t){super.update(e,t);const i=Gt(e,t);this.updateShape(e,i)}updateShape(e,t){this.updateShapeStyles(e),this.updateShapePath(e,t)}updateShapeStyles(e){const{shape:t}=this;t.fill=e.fill,t.fillOpacity=e.fillOpacity??1}updateShapePath(e,t){const{shape:i}=this;i.x=t.x,i.y=t.y,i.size=e.size}containsPoint(e,t){return super.containsPoint(e,t)||this.shape.containsPoint(e,t)}getNodeAtCoords(e,t){return this.shape.containsPoint(e,t)?"shape":super.getNodeAtCoords(e,t)}},vs=[[.5,0],[1,.5],[.75,.5],[.75,1],[.25,1],[.25,.5],[0,.5]];function bs(e){n.n1.drawMarkerUnitPolygon(e,vs)}bs.anchor={x:.5,y:0};var Cs=class extends ys{constructor(){super(),this.type="arrow-up",this.shape=new n.n1.Marker({shape:bs}),this.append([this.shape])}static is(e){return as.isCheck(e,"arrow-up")}getHandleCoords(e,t){const i=rs.HANDLE_SIZE/2,n=super.getHandleCoords(e,t);return n.y-=i,n}},ws=vs.map(([e,t])=>[e,1-t]);function Ss(e){n.n1.drawMarkerUnitPolygon(e,ws)}Ss.anchor={x:.5,y:1};var xs=class extends ys{constructor(){super(),this.type="arrow-down",this.shape=new n.n1.Marker({shape:Ss}),this.append([this.shape])}static is(e){return as.isCheck(e,"arrow-down")}updateAnchor(e,t,i){const n=super.updateAnchor(e,t,i);return n.y-=e.size,n}getHandleCoords(e,t){const i=rs.HANDLE_SIZE/2,n=super.getHandleCoords(e,t);return n.y+=i,n}},{StateMachine:Es,StateMachineProperty:As,Debug:Ms}=n.n1,Ts=class extends Es{constructor(e){const t=({point:t})=>{const i=this.createDatum();i.set({x:t.x,y:t.y}),e.create(i)};super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},cancel:Es.parent,reset:Es.parent},"waiting-first-render":{render:{target:Es.parent,action:()=>{this.node?.toggleActive(!0),e.showAnnotationOptions(),e.update()}}}}),this.debug=Ms.create(!0,"annotations")}};a([As()],Ts.prototype,"node",2);var Ds=class extends Ts{createDatum(){return new Zn}},Is={type:"arrow-down",datum:Zn,scene:xs,isDatum:Zn.is,translate:(e,t,i,n)=>{Zn.is(t)&&xs.is(e)&&e.translate(t,i,n)},copy:(e,t,i,n)=>{if(Zn.is(t)&&Zn.is(i)&&xs.is(e))return e.copy(t,i,n)},update:(e,t,i)=>{Zn.is(t)&&xs.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Ds({...e,create:t("arrow-down")}),dragState:e=>new qn(e)},{Property:Rs}=n.n1,ks=class extends _i{constructor(){super(...arguments),this.type="arrow-up"}static is(e){return(0,s.Gv)(e)&&"arrow-up"===e.type}};a([Rs],ks.prototype,"type",2);var Ps=class extends Ts{createDatum(){return new ks}},_s={type:"arrow-up",datum:ks,scene:Cs,isDatum:ks.is,translate:(e,t,i,n)=>{ks.is(t)&&Cs.is(e)&&e.translate(t,i,n)},copy:(e,t,i,n)=>{if(ks.is(t)&&ks.is(i)&&Cs.is(e))return e.copy(t,i,n)},update:(e,t,i)=>{ks.is(t)&&Cs.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Ps({...e,create:t("arrow-up")}),dragState:e=>new qn(e)},{Vec2:Ls,Vec4:Ns}=n.n1,Os=class extends as{constructor(){super(...arguments),this.overflowContinuous=0}extendLine({x1:e,y1:t,x2:i,y2:n},s,r){const o={x1:e,y1:t,x2:i,y2:n};if(!s.extendStart&&!s.extendEnd)return o;const[a,l]=function(e,t){const[i,n]=ii.from(e),s=t.height,r=ii.gradient(n,i,s),o=ii.intercept(n,r,s),a=[{x:i.x,y:s??0},{x:i.x,y:null==s?t.height:s-t.height}];if(r===1/0)return a;let l=[ii.intersectAtY(r,o,0,s),ii.intersectAtY(r,o,t.height,s),ii.intersectAtX(r,o,0,s),ii.intersectAtX(r,o,t.width,s)];return l=l.filter(e=>e.x>=t.x&&e.x<=t.width&&e.y>=t.y&&e.y<=t.height).sort((e,t)=>e.x===t.x?0:e.x<t.x?-1:1),2!==l.length?a:l}(o,r.yAxis.bounds),c=o.x2<o.x1,h=o.y1>=o.y2,u=o.x2===o.x1;return s.extendEnd&&(u?o.y2=h?l.y:a.y:(o.x2=c?a.x:l.x,o.y2=c?a.y:l.y)),s.extendStart&&(u?o.y1=h?a.y:l.y:(o.x1=c?l.x:a.x,o.y1=c?l.y:a.y)),o}dragStart(e,t,i){this.dragState={offset:t,...ps({start:e.start,end:e.end},i)}}drag(e,t,i,n){e.locked||(this.activeHandle?this.dragHandle(e,t,i,n):this.dragAll(e,t,i))}dragAll(e,t,i){const{dragState:n}=this;n&&this.translatePoints(e,n.start,n.end,Ls.sub(t,n.offset),i)}translate(e,t,i){e.locked||this.translatePoints(e,Gt(e.start,i),Gt(e.end,i),t,i)}copy(e,t,i){const n=Ft(e,i);if(!n)return;const s=this.computeBBoxWithoutHandles(),r={x:-s.width/2,y:-s.height/2};return this.translatePoints(t,Ns.start(n),Ns.end(n),r,i),t}translatePoints(e,t,i,n,s){const r=gs(this.getTranslatePointsVectors(t,i),n,s,{overflowContinuous:this.overflowContinuous});e.start.x=r.start.x,e.end.x=r.end.x,e.start.y=r.start.y,e.end.y=r.end.y}getTranslatePointsVectors(e,t){return{start:e,end:t}}},{Vec2:Fs,Vec4:Gs}=n.n1,Bs=class extends Os{constructor(){super(...arguments),this.start=new rs,this.end=new rs,this.anchor={x:0,y:0,position:"above"}}update(e,t){const i=Ft(e,t);null!=i&&(this.updateHandles(e,i),this.updateAnchor(e,i,t))}toggleHandles(e){if("boolean"==typeof e)this.start.visible=e,this.end.visible=e;else for(const[t,i]of(0,s.jO)(e))this[t].visible=i;this.start.toggleHovered("start"===this.activeHandle),this.end.toggleHovered("end"===this.activeHandle)}toggleActive(e){this.toggleHandles(e),this.start.toggleActive(e),this.end.toggleActive(e)}dragHandle(e,t,i,n){const{activeHandle:s,dragState:r}=this;if(!s||!r)return;this[s].toggleDragging(!0);const o="start"===s?"end":"start",a=n?{vectors:{[s]:Gt(e[o],i)},angle:e.snapToAngle}:void 0,{[s]:l}=gs({[s]:r[s]},Fs.sub(t,r.offset),i,{overflowContinuous:0,snap:a});e[s].x=l.x,e[s].y=l.y}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1)}getAnchor(){return this.anchor}getCursor(){return"pointer"}containsPoint(e,t){const{start:i,end:n}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="start",!0):!!n.containsPoint(e,t)&&(this.activeHandle="end",!0)}getNodeAtCoords(e,t){if(this.start.containsPoint(e,t)||this.end.containsPoint(e,t))return"handle"}updateHandles(e,t,i){this.start.update({...this.getHandleStyles(e,"start"),...this.getHandleCoords(e,t,"start")}),this.end.update({...this.getHandleStyles(e,"end"),...this.getHandleCoords(e,t,"end",i)}),this.start.toggleLocked(e.locked??!1),this.end.toggleLocked(e.locked??!1)}updateAnchor(e,t,i,n){this.anchor={x:t.x1+i.seriesRect.x,y:t.y1+i.seriesRect.y,position:this.anchor.position}}getHandleCoords(e,t,i,n){return"start"===i?Gs.start(t):Gs.end(t)}getHandleStyles(e,t){return{fill:e.handle.fill,stroke:e.handle.stroke,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}}},{Vec4:Vs}=n.n1,Hs=class extends Bs{constructor(){super(...arguments),this.label=new n.n1.Text({zIndex:1}),this.anchor={x:0,y:0,position:"above-left"}}setTextInputBBox(e){this.textInputBBox=e,this.markDirty("TextualStartEndScene")}update(e,t){const i=Ft(e,t);if(null==i)return;const n=this.getTextBBox(e,i);this.updateLabel(e,n,i),this.updateHandles(e,i,n),this.updateShape(e,n,i),this.updateAnchor(e,i,t,n)}containsPoint(e,t){return super.containsPoint(e,t)||this.label.containsPoint(e,t)}getNodeAtCoords(e,t){return this.label.containsPoint(e,t)?"text":super.getNodeAtCoords(e,t)}getTextBBox(e,t){const{text:i}=e.getText();return Ai(e,i,Vs.end(t),this.textInputBBox)}updateLabel(e,t,i){const{text:n,isPlaceholder:s}=e.getText();Mi(this.label,n,s,e,this.getLabelCoords(e,t,i))}updateShape(e,t,i){}getLabelCoords(e,t,i){return Vs.end(i)}getHandleStyles(e,t){return{...super.getHandleStyles(e,t),stroke:e.handle.stroke??e.color}}},{drawCorner:Us,Path:zs}=n.n1,Ws=class extends Hs{constructor(){super(),this.type="callout",this.shape=new zs,this.append([this.shape,this.label,this.start,this.end])}static is(e){return as.isCheck(e,"callout")}drag(e,t,i,n){e.locked||("end"===this.activeHandle?this.dragHandle(e,t,i,n):this.dragAll(e,t,i))}getLabelCoords(e,t,i){const n=e.getPadding(),{bodyBounds:s={x:0,y:0,width:0,height:0}}=this.getDimensions(e,t,i)??{};return{x:s.x+n.left,y:s.y-n.bottom}}getHandleStyles(e,t){return"start"===t?{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}:{fill:void 0,strokeWidth:0}}updateAnchor(e,t,i,n){const{bodyBounds:s}=this.getDimensions(e,n,t)??{},r=s??n;this.anchor={x:r.x+i.seriesRect.x,y:r.y+i.seriesRect.y-r.height,position:this.anchor.position}}updateShape(e,t,i){const{shape:n}=this;n.fill=e.fill,n.fillOpacity=e.fillOpacity??1,n.stroke=e.stroke,n.strokeWidth=e.strokeWidth??1,n.strokeOpacity=e.strokeOpacity??1;const{tailPoint:s,bodyBounds:r}=this.getDimensions(e,t,i)??{};s&&r&&this.updatePath(s,r)}updatePath(e,t){const{x:i,y:n}=e,{x:s,y:r,width:o,height:a}=t,l=r-a,c=s+o,h=this.calculateCalloutPlacement({x:i,y:n},t),u=[{coordinates:{x0:s,x1:s+8,y0:l+8,y1:l,cx:"topLeft"===h?i:s+8,cy:"topLeft"===h?n:l+8},type:"topLeft"===h?"calloutCorner":"corner"},{coordinates:{x0:s+8,x1:c-8,y0:l,y1:l,cx:i,cy:n},type:"top"===h?"calloutSide":"side"},{coordinates:{x0:c-8,x1:c,y0:l,y1:l+8,cx:"topRight"===h?i:c-8,cy:"topRight"===h?n:l+8},type:"topRight"===h?"calloutCorner":"corner"},{coordinates:{x0:c,x1:c,y0:l+8,y1:r-8,cx:i,cy:n},type:"right"===h?"calloutSide":"side"},{coordinates:{x0:c,x1:c-8,y0:r-8,y1:r,cx:"bottomRight"===h?i:c-8,cy:"bottomRight"===h?n:r-8},type:"bottomRight"===h?"calloutCorner":"corner"},{coordinates:{x0:c-8,x1:s+8,y0:r,y1:r,cx:i,cy:n},type:"bottom"===h?"calloutSide":"side"},{coordinates:{x0:s+8,x1:s,y0:r,y1:r-8,cx:"bottomLeft"===h?i:s+8,cy:"bottomLeft"===h?n:r-8},type:"bottomLeft"===h?"calloutCorner":"corner"},{coordinates:{x0:s,x1:s,y0:r-8,y1:l+8,cx:i,cy:n},type:"left"===h?"calloutSide":"side"}],{path:d}=this.shape;d.clear(),d.moveTo(s,l+8),u.forEach(({coordinates:e,type:t})=>{this.drawPath(d,e,8,t)}),d.closePath()}drawPath(e,{x0:t,y0:i,x1:n,y1:s,cx:r,cy:o},a,l){switch(l){case"calloutCorner":e.lineTo(r,o),e.lineTo(n,s);break;case"corner":Us(e,{x0:t,x1:n,y0:i,y1:s,cx:r,cy:o},a,!1);break;case"calloutSide":if(t!==n){const a=t>n?-1:1,l=Math.min(t,n)+Math.abs(n-t)/2;e.lineTo(l-6*a,i),e.lineTo(r,o),e.lineTo(l+6*a,i),e.lineTo(n,s)}else{const a=i>s?-1:1,l=Math.min(i,s)+Math.abs(i-s)/2;e.lineTo(t,l-6*a),e.lineTo(r,o),e.lineTo(t,l+6*a),e.lineTo(n,s)}break;default:e.lineTo(n,s)}}calculateCalloutPlacement(e,t){const i=t.x+t.width,n=t.y-t.height;let s,r;return e.x>i?s="right":e.x<t.x&&(s="left"),e.y>t.y?r="bottom":e.y<n&&(r="top"),s&&r?`${r}${s[0].toUpperCase()}${s.substring(1)}`:r??s}getDimensions(e,t,i){const{fontSize:n}=e,s=e.getPadding(),r=s.left+s.right,o=s.top+s.bottom,a=t.width+r,l=Math.max(t.height+o,n+o);return{tailPoint:{x:i.x1,y:i.y1},bodyBounds:{x:t.x,y:t.y,width:a,height:l}}}containsPoint(e,t){const{start:i,end:n,shape:s}=this;if(this.activeHandle=void 0,i.containsPoint(e,t))return this.activeHandle="start",!0;const r=n.containsPoint(e,t)||s.containsPoint(e,t);return r&&(this.activeHandle="end"),r}};function js({key:e}){return"Escape"===e}function $s({key:e,shiftKey:t}){return!t&&"Enter"===e}var{StateMachine:Ks,StateMachineProperty:Ys,Debug:qs}=n.n1,Xs=class extends Ks{constructor(e){const t=({point:t})=>{const i=this.createDatum();i.set({start:t,end:t,visible:!0}),e.create(i)},i=({point:t})=>{const{datum:i,node:n}=this;i?.set({end:t}),n?.toggleActive(!0),n?.toggleHandles({end:!1}),e.update()},n=()=>{e.showAnnotationOptions(),this.node?.toggleHandles({end:!0})},s=()=>{e.delete()},r=({textInputValue:t,bbox:i})=>{const{datum:n}=this;if(null!=i&&null!=t&&t.length>0){if(!an(n))return;const s=Ei(n,t,i.width);n?.set({text:s}),e.update(),e.recordAction(`Create ${n?.type} annotation`)}else e.delete()};super("start",{start:{click:{target:"waiting-first-render",action:t},dragStart:{target:"waiting-first-render",action:t},cancel:Ks.parent,reset:Ks.parent},"waiting-first-render":{render:{target:"end",action:()=>{const{node:e}=this;e?.toggleActive(!0),e?.toggleHandles({start:!0})}}},end:{hover:i,drag:i,click:{target:"edit",action:n},dragEnd:{target:"edit",action:n},reset:{target:Ks.parent,action:s},cancel:{target:Ks.parent,action:s}},edit:{onEnter:()=>{e.showTextInput(),this.datum&&(this.datum.visible=!1)},updateTextInputBBox:t=>{this.node?.setTextInputBBox(t),e.update()},color:({colorPickerType:t,colorOpacity:i,color:n,opacity:s,isMultiColor:r})=>{const{datum:o}=this;o&&("text-color"===t&&e.updateTextInputColor(n),yn(o,t,i,n,s,r),e.update())},fontSize:t=>{const{datum:i,node:n}=this;i&&n&&an(i)&&(i.fontSize=t,e.updateTextInputFontSize(t),e.update())},textInput:[{guard:js,target:Ks.parent,action:s},{guard:$s,target:Ks.parent,action:r}],click:{target:Ks.parent,action:r},dragStart:{target:Ks.parent,action:r},resize:{target:Ks.parent,action:r},onExit:()=>{e.hideTextInput(),this.datum&&(this.datum.visible=!0),e.deselect()},cancel:{target:Ks.parent,action:s}}}),this.debug=qs.create(!0,"annotations")}};a([Ys()],Xs.prototype,"datum",2),a([Ys()],Xs.prototype,"node",2);var Zs=class extends Xs{createDatum(){return new qt}},Qs={type:"callout",datum:qt,scene:Ws,isDatum:qt.is,translate:(e,t,i,n)=>{if(qt.is(t)&&Ws.is(e))return e.translate(t,i,n)},copy:(e,t,i,n)=>{if(qt.is(t)&&qt.is(i)&&Ws.is(e))return e.copy(t,i,n)},update:(e,t,i)=>{qt.is(t)&&Ws.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Zs({...e,create:t("callout")}),dragState:e=>new qn(e)},Js=class extends ms{constructor(){super(...arguments),this.label=new n.n1.Text({zIndex:1}),this.anchor={x:0,y:0,position:"above-left"}}setTextInputBBox(e){this.textInputBBox=e,this.markDirty("TextualPointScene")}update(e,t){const i=Gt(e,t),n=this.getTextBBox(e,i,t);this.updateLabel(e,n),this.updateHandle(e,i,n),this.updateShape(e,n),this.anchor=this.updateAnchor(e,n,t)}copy(e,t,i){const n=Gt(e,i),s=this.getTextBBox(e,n,i),r=e.getPadding(),o=r.left+r.right,a=r.top+r.bottom,l=(s.width+o)/2,c=s.height+a,h=Vt({x:n.x-l,y:n.y-c},i);return t.x=h.x,t.y=h.y,t}containsPoint(e,t){const{label:i}=this;return super.containsPoint(e,t)||i.visible&&i.containsPoint(e,t)}getNodeAtCoords(e,t){return this.label.visible&&this.label.containsPoint(e,t)?"text":super.getNodeAtCoords(e,t)}getTextBBox(e,t,i){const{text:n}=e.getText();return Ai(e,n,{x:t.x,y:t.y},this.textInputBBox)}updateLabel(e,t){const{text:i,isPlaceholder:n}=e.getText();Mi(this.label,i,n,e,this.getLabelCoords(e,t),this.getTextBaseline(e))}updateShape(e,t){}updateAnchor(e,t,i){return{x:t.x+i.seriesRect.x,y:t.y+i.seriesRect.y-t.height,position:this.anchor.position}}getLabelCoords(e,t){return t}getTextBaseline(e){return"center"==e.position?"middle":e.position}getHandleCoords(e,t,i){return i}getHandleStyles(e){const t=super.getHandleStyles(e);return t.stroke=e.handle.stroke??e.color,t}},{drawCorner:er}=n.n1,tr=class extends Js{constructor(){super(),this.type="comment",this.shape=new n.n1.Path,this.append([this.shape,this.label,this.handle])}static is(e){return as.isCheck(e,"comment")}updateShape(e,t){const{shape:i}=this;i.fill=e.fill,i.fillOpacity=e.fillOpacity??1,i.stroke=e.stroke??"transparent",i.strokeWidth=e.strokeWidth??1,i.strokeOpacity=e.strokeOpacity??1,this.updatePath(e,t)}getLabelCoords(e,t){const i=e.getPadding();return{x:t.x+i.left,y:t.y-i.bottom}}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke??e.fill,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}}updateAnchor(e,t,i){const n=super.updateAnchor(e,t,i),s=e.getPadding();return n.y-=s.bottom+s.top,n}updatePath(e,t){const i=e.getPadding(),{x:n,y:s}=t;let{width:r,height:o}=t;const{fontSize:a}=e,l=i.left+i.right,c=i.top+i.bottom;r+=l,o=Math.max(o+c,a+c);const h=s-o,u=n+r,d=(a*Si+c)/2,{path:p}=this.shape;p.clear(),p.moveTo(n,s),p.lineTo(n,h+d),er(p,{x0:n,x1:n+d,y0:h+d,y1:h,cx:n+d,cy:h+d},d,!1),p.lineTo(u-d,h),er(p,{x0:u-d,x1:u,y0:h,y1:h+d,cx:u-d,cy:h+d},d,!1),p.lineTo(u,s-d),er(p,{x0:u,x1:u-d,y0:s-d,y1:s,cx:u-d,cy:s-d},d,!1),p.closePath()}containsPoint(e,t){return super.containsPoint(e,t)||this.shape.containsPoint(e,t)}},{StateMachine:ir,StateMachineProperty:nr,Debug:sr}=n.n1,rr=class extends ir{constructor(e){const t=({point:t})=>{const i=this.createDatum();i.set({x:t.x,y:t.y}),e.create(i)},i=()=>{e.delete()},n=({textInputValue:t,bbox:i})=>{if(null!=i&&null!=t&&t.length>0){const{datum:n}=this;if(!an(n))return;const s=Ei(n,t,i.width);n?.set({text:s}),e.update(),e.recordAction(`Create ${n?.type} annotation`)}else e.delete()};super("start",{start:{click:{target:"waiting-first-render",action:t},dragStart:{target:"waiting-first-render",action:t},cancel:ir.parent,reset:ir.parent},"waiting-first-render":{render:{target:"edit",action:()=>{this.node?.toggleActive(!0),e.showAnnotationOptions(),e.update()}}},edit:{onEnter:()=>{e.showTextInput(),this.datum&&(this.datum.visible=!1)},updateTextInputBBox:t=>{this.node?.setTextInputBBox(t),e.update()},color:({colorPickerType:t,colorOpacity:i,color:n,opacity:s,isMultiColor:r})=>{this.datum&&("text-color"===t&&e.updateTextInputColor(n),yn(this.datum,t,i,n,s,r),e.update())},fontSize:t=>{const{datum:i,node:n}=this;i&&n&&an(i)&&(i.fontSize=t,e.updateTextInputFontSize(t),e.update())},textInput:[{guard:js,target:ir.parent,action:i},{guard:$s,target:ir.parent,action:n}],click:{target:ir.parent,action:n},dragStart:{target:ir.parent,action:n},resize:{target:ir.parent,action:n},onExit:()=>{e.hideTextInput(),this.datum&&(this.datum.visible=!0),e.deselect()},cancel:{target:ir.parent,action:i}}}),this.debug=sr.create(!0,"annotations")}};a([nr()],rr.prototype,"datum",2),a([nr()],rr.prototype,"node",2);var or=class extends rr{createDatum(){return new ti}},ar={type:"comment",datum:ti,scene:tr,isDatum:ti.is,translate:(e,t,i,n)=>{ti.is(t)&&tr.is(e)&&e.translate(t,i,n)},copy:(e,t,i,n)=>{if(ti.is(t)&&ti.is(i)&&tr.is(e))return e.copy(t,i,n)},update:(e,t,i)=>{ti.is(t)&&tr.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new or({...e,create:t("comment")}),dragState:e=>new qn(e)},{calculateLabelTranslation:lr,ChartAxisDirection:cr}=n.n1,hr=class extends n.n1.Group{constructor(){super({name:"AnnotationAxisLabelGroup"}),this.label=new n.n1.Text({zIndex:1}),this.rect=new n.n1.Rect;const{label:e}=this;e.fontSize=12,e.fontFamily="Verdana, sans-serif",e.fill="black",e.textBaseline="middle",e.textAlign="center",this.append([this.rect,this.label])}update(e){this.updateLabel(e),this.updateRect(e),this.updatePosition(e)}updateLabel({value:e,styles:t,context:i}){const{fontWeight:n,fontSize:s,fontStyle:r,fontFamily:o,textAlign:a,color:l="white",formatter:c}=t,h=c?c({value:e}):i.scaleValueFormatter()(e);this.label.setProperties({fontWeight:n,fontSize:s,fontStyle:r,fontFamily:o,textAlign:a,fill:l,text:h})}updateRect({styles:e}){const{rect:t}=this,{cornerRadius:i,fill:n,fillOpacity:s,stroke:r,strokeOpacity:o}=e;t.setProperties({cornerRadius:i,fill:n,fillOpacity:s,stroke:r,strokeOpacity:o})}updatePosition({x:e,y:t,context:i,styles:{padding:n}}){const{label:s,rect:r}=this,o=s.getBBox()?.clone(),a=n??8,l=n??5;o.grow(a,"horizontal"),o.grow(l,"vertical");const c=i.direction===cr.X?Math.round(l/2):a,{xTranslation:h,yTranslation:u}=lr({yDirection:!0,padding:i.labelPadding-c,position:i.position??"left",bbox:o}),d=e+h,p=t+u;s.x=d,s.y=p,r.y=p-Math.round(o.height/2),r.x=d-Math.round(o.width/2),r.height=o.height,r.width=o.width}};hr.className="AxisLabel";var{Vec2:ur}=n.n1,dr=class extends n.n1.Line{constructor(){super(...arguments),this.growCollisionBox=9,this.clipMask=new Map}setProperties(e,t){return super.setProperties(e,t),this.updateCollisionBBox(),this}updateCollisionBBox(){const{growCollisionBox:e,strokeWidth:t,x1:i,y1:s,x2:r,y2:o}=this;let a=t+e;a%2==0&&(a+=1);const l=ur.from(i,s-Math.floor(a/2)),c=ur.from(r,o),h=ur.distance(l,c);this.collisionBBox=new n.n1.BBox(l.x,l.y,h,a)}isPointInPath(e,t){const{collisionBBox:i,x1:n,y1:s,x2:r,y2:o}=this;if(!i)return!1;const a=ur.from(n,s),l=ur.from(r,o),c=ur.sub(ur.from(e,t),a),h=ur.sub(l,a),u=ur.rotate(c,ur.angle(c,h),a);return i.containsPoint(u.x,u.y)??!1}render(e){this.applyClipMask(e.ctx),super.render(e),this.closeClipMask(e.ctx)}setClipMask(e,t){const i=this.clipMask.get(e);null!=n.n1.jsonDiff(i,t)&&this.markDirty("CollidableLine"),t?this.clipMask.set(e,t):this.clipMask.delete(e)}applyClipMask(e){const{clipMask:t}=this;0!==t.size&&this.clipMask.forEach(t=>{const{x:i,y:n,radius:s}=t;e.save(),e.beginPath(),e.rect(0,0,e.canvas.width,e.canvas.height),e.ellipse(i,n,s,s,0,2*Math.PI,0,!0),e.clip()})}closeClipMask(e){0!==this.clipMask.size&&e.restore()}},pr=class extends n.n1.TransformableText{constructor(){super(...arguments),this.growCollisionBox={top:4,right:4,bottom:4,left:4}}isPointInPath(e,t){const i=this.fromParentPoint(e,t),n=this.computeBBoxWithoutTransforms();return!!n&&n.grow(this.growCollisionBox).containsPoint(i.x,i.y)}},{Vec2:gr}=n.n1;function fr(e,t,i,n,s,r,o){if(!r||!s||!n)return void t.setClipMask(e);const{alignment:a,position:l}=n,c=yr(i,n.fontSize,o),{point:h,textBaseline:u}=vr(c,l,a);br(s,r,n,h,c.angle,u);const{x:d,y:p,width:g,height:f}=s.getBBox(),m={x:d+g/2,y:p+f/2,radius:gr.length(gr.from(g,f))/2+gr.length(c.offset)};return"center"===l?t.setClipMask(e,m):t.setClipMask(e),{clipMask:m,numbers:c}}function mr(e,t,i,n,s,r,o){if(!o||!r)return;const{alignment:a,position:l}=n,[c,h]=t.y1<=i.y1?[t,i]:[i,t];let u=c;"bottom"===l?u=h:"inside"===l&&(u={x1:(c.x1+h.x1)/2,y1:(c.y1+h.y1)/2,x2:(c.x2+h.x2)/2,y2:(c.y2+h.y2)/2});const d=yr(u,n.fontSize,s),{point:p,textBaseline:g}=vr(d,"inside"===l?"center":l,a,e);br(r,o,n,p,d.angle,g)}function yr(e,t,i){let[n,s]=gr.from(e);n.x>s.x&&([n,s]=[s,n]);const r=gr.normalized(gr.sub(s,n));return{left:n,right:s,normal:r,angle:gr.angle(r),inset:gr.multiply(r,rs.HANDLE_SIZE/2+(t??14)/2),offset:gr.multiply(r,(i??2)/2+(t??14)/3)}}function vr({left:e,right:t,normal:i,angle:n,inset:s,offset:r},o,a,l){let c;c="right"===a?gr.sub(t,s):"center"===a?gr.add(e,gr.multiply(i,gr.distance(e,t)/2)):gr.add(e,s);let h="bottom";return"bottom"===o?(c=gr.rotate(r,n+Math.PI/2,c),h="top"):"center"!==o||l?c=gr.rotate(r,n-Math.PI/2,c):h="middle",{point:c,textBaseline:h}}function br(e,t,i,n,s,r){e.setProperties({text:t,x:n.x,y:n.y,rotation:s,rotationCenterX:n.x,rotationCenterY:n.y,fill:i.color,fontFamily:i.fontFamily,fontSize:i.fontSize,fontStyle:i.fontStyle,fontWeight:i.fontWeight,textAlign:i.alignment,textBaseline:r})}var{ChartAxisDirection:Cr,Vec2:wr,Vec4:Sr}=n.n1,xr=class extends as{constructor(){super(),this.type="cross-line",this.line=new dr,this.middle=new ns,this.isHorizontal=!1,this.append([this.line,this.middle])}static is(e){return as.isCheck(e,"cross-line")}update(e,t){const{seriesRect:i}=t;this.seriesRect=i,this.isHorizontal=Oi.is(e);const n=this.isHorizontal?t.yAxis:t.xAxis,s=this.convertCrossLine(e,n);null!=s?(this.visible=e.visible??!0,this.visible&&(this.updateLine(e,s),this.updateHandle(e,s),this.updateText(e,s),this.updateAxisLabel(e,n,s))):this.visible=!1}updateLine(e,t){const{line:i}=this,{lineDashOffset:n,stroke:s,strokeWidth:r,strokeOpacity:o}=e,{x1:a,y1:l,x2:c,y2:h}=t;i.setProperties({x1:a,y1:l,x2:c,y2:h,lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:n,stroke:s,strokeWidth:r,strokeOpacity:o,fillOpacity:0})}updateHandle(e,t){const{middle:i}=this,{locked:n,stroke:s,strokeWidth:r,strokeOpacity:o}=e,a={fill:e.handle.fill,stroke:e.handle.stroke??s,strokeOpacity:e.handle.strokeOpacity??o,strokeWidth:e.handle.strokeWidth??r},l=wr.sub(Sr.center(t),wr.from(i.handle.width/2,i.handle.height/2));i.gradient=this.isHorizontal?"horizontal":"vertical",i.update({...a,...l}),i.toggleLocked(n??!1)}updateText(e,t){this.text=this.updateNode(pr,this.text,!!e.text.label),fr(this.line.id,this.line,t,e.text,this.text,e.text.label,e.strokeWidth)}createAxisLabel(e){const t=new hr;return e.attachLabel(t),t}updateAxisLabel(e,t,i){this.axisLabel||(this.axisLabel=this.createAxisLabel(t));const{axisLabel:n,seriesRect:s}=this,{direction:r,position:o}=t;if(e.axisLabel.enabled){n.visible=this.visible;const a="left"===o||"top"===o?Sr.start(i):Sr.end(i),l=r===Cr.X?a.x:a.y;if(!t.inRange(l))return void(n.visible=!1);const c=Nt(e.value);n.update({...wr.add(a,wr.required(s)),value:c,styles:e.axisLabel,context:t})}else n.visible=!1}setAxisLabelOpacity(e){this.axisLabel&&(this.axisLabel.opacity=e)}setAxisLabelVisible(e){this.axisLabel&&(this.axisLabel.visible=e)}toggleHandles(e){this.middle.visible=e,this.middle.toggleHovered("middle"===this.activeHandle)}destroy(){super.destroy(),this.axisLabel?.destroy()}toggleActive(e){this.toggleHandles(e),this.middle.toggleActive(e)}dragStart(e,t,i){const n=Oi.is(e)?{x:t.x,y:Bt(e.value,i.yAxis)}:{x:Bt(e.value,i.xAxis),y:t.y};this.dragState={offset:t,middle:n}}drag(e,t,i){const{activeHandle:n,dragState:s}=this;!e.locked&&s&&(n&&this[n].toggleDragging(!0),this.translatePoint(e,s.middle,wr.sub(t,s.offset),i))}translate(e,t,i){if(e.locked)return;const n=Oi.is(e)?wr.from(0,Bt(e.value,i.yAxis)):wr.from(Bt(e.value,i.xAxis),0);this.translatePoint(e,n,t,i)}translatePoint(e,t,i,n){const s=Oi.is(e);s?i.x=0:i.y=0;const{point:r}=gs({point:t},i,n);e.value=s?r.y:r.x}stopDragging(){this.middle.toggleDragging(!1)}copy(e,t,i){const n=Oi.is(e),s=this.isHorizontal?i.yAxis:i.xAxis,r=this.convertCrossLine(e,s);if(!r)return;const o=n?-30:0,a=n?0:-30,l=Vt({x:r.x1+a,y:r.y1+o},i);return t.set({value:n?l.y:l.x}),t}getCursor(){return null==this.activeHandle?"pointer":this[this.activeHandle].getCursor()}containsPoint(e,t){const{middle:i,line:n,text:s}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="middle",!0):n.isPointInPath(e,t)||Boolean(s?.containsPoint(e,t))}getNodeAtCoords(e,t){return this.text?.containsPoint(e,t)?"text":this.line.isPointInPath(e,t)?"line":this.middle.containsPoint(e,t)?"handle":void 0}getAnchor(){const e=this.computeBBoxWithoutHandles();return this.isHorizontal?{x:e.x+e.width/2,y:e.y}:{x:e.x+e.width,y:e.y+e.height/2,position:"right"}}convertCrossLine(e,t){if(null==e.value)return;let i,n,s=0,r=0;const{bounds:o}=t,a=Bt(e.value,t);return Oi.is(e)?(i=o.width,r=a,n=a):(s=a,i=a,n=o.height),{x1:s,y1:r,x2:i,y2:n}}},{StateMachine:Er,StateMachineProperty:Ar,Debug:Mr}=n.n1,Tr=class extends Er{constructor(e,t){const i=({point:i})=>{const n="horizontal"===e,s=n?new Oi:new Fi;s.set({value:n?i.y:i.x}),t.create(s),t.recordAction(`Create ${n?"horizontal-line":"vertical-line"} annotation`)};super("start",{start:{click:{target:"waiting-first-render",action:i},drag:{target:"waiting-first-render",action:i},reset:Er.parent,cancel:Er.parent},"waiting-first-render":{render:{target:Er.parent,action:()=>{this.node?.toggleActive(!0),t.showAnnotationOptions(),t.update()}}}}),this.debug=Mr.create(!0,"annotations")}};a([Ar()],Tr.prototype,"node",2);var Dr={type:"horizontal-line",datum:Oi,scene:xr,isDatum:Oi.is,translate:(e,t,i,n)=>{Oi.is(t)&&xr.is(e)&&e.translate(t,i,n)},copy:(e,t,i,n)=>{if(Oi.is(t)&&Oi.is(i)&&xr.is(e))return e.copy(t,i,n)},update:(e,t,i)=>{Oi.is(t)&&xr.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Tr("horizontal",{...e,create:t("horizontal-line")}),dragState:e=>new qn(e)},Ir={type:"vertical-line",datum:Fi,scene:xr,isDatum:Fi.is,translate:(e,t,i,n)=>{Fi.is(t)&&xr.is(e)&&e.translate(t,i,n)},copy:(e,t,i,n)=>{if(Fi.is(t)&&Fi.is(i)&&xr.is(e))return e.copy(t,i,n)},update:(e,t,i)=>{Fi.is(t)&&xr.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Tr("vertical",{...e,create:t("vertical-line")}),dragState:e=>new qn(e)},{Vec4:Rr}=n.n1,kr=class{static updateBackground(e,t,i,n){const{background:s}=this,{seriesRect:r}=n;s.path.clear(!0);const o=Rr.from(0,0,r.width,r.height),a=this.getBackgroundPoints(e,t,i,o);for(let e=0;e<a.length;e++){const t=a[e];0===e?s.path.moveTo(t.x,t.y):s.path.lineTo(t.x,t.y)}s.path.closePath(),s.checkPathDirty();const l=this.getBackgroundStyles?.(e)??e.background;s.setProperties({fill:l.fill,fillOpacity:l.fillOpacity})}},Pr=class extends Os{constructor(){super(...arguments),this.handles={},this.overflowContinuous=2,this.topLine=new dr,this.bottomLine=new dr,this.background=new n.n1.Path({zIndex:-1}),this.anchor={x:0,y:0},this.updateBackground=kr.updateBackground.bind(this)}update(e,t){const{locked:i,visible:n}=e,s=Ft(e,t),r=Ft(e.bottom,t);if(null==s||null==r)return void(this.visible=!1);this.visible=n??!0;const o=this.extendLine(s,e,t),a=this.extendLine(r,e,t);this.updateLines(e,o,a,t,s,r),this.updateHandles(e,s,r),this.updateText(e,s,r),this.updateBackground(e,o,a,t),this.updateAnchor(s,r);for(const e of Object.values(this.handles))e.toggleLocked(i??!1)}toggleHandles(e){const{handles:t}=this;if("boolean"!=typeof e)for(const[i,n]of Object.entries(e)){const e=t[i];e.visible=n??!0,e.toggleHovered(this.activeHandle===i)}else for(const[i,n]of Object.entries(t))n.visible=e,n.toggleHovered(this.activeHandle===i)}toggleActive(e){this.toggleHandles(e);for(const t of Object.values(this.handles))t.toggleActive(e)}stopDragging(){const{activeHandle:e,handles:t}=this;null!=e&&t[e].toggleDragging(!1)}getAnchor(){return this.anchor}getCursor(){return null==this.activeHandle?"pointer":this.handles[this.activeHandle].getCursor()}containsPoint(e,t){const{handles:i,topLine:n,bottomLine:s,text:r}=this;this.activeHandle=void 0;for(const[n,s]of Object.entries(i))if(s.containsPoint(e,t))return this.activeHandle=n,!0;return n.containsPoint(e,t)||s.containsPoint(e,t)||Boolean(r?.containsPoint(e,t))}getNodeAtCoords(e,t){if(this.text?.containsPoint(e,t))return"text";if(this.topLine.containsPoint(e,t)||this.bottomLine.containsPoint(e,t))return"line";for(const[i,n]of Object.entries(this.handles))if(n.containsPoint(e,t))return"handle"}updateAnchor(e,t){const{x:i,y:s}=n.n1.Transformable.toCanvasPoint(this.topLine,(e.x1+e.x2)/2,Math.min(e.y1,e.y2,t.y1,t.y2));this.anchor.x=i,this.anchor.y=s}},{Vec2:_r,Vec4:Lr}=n.n1,Nr=class extends Pr{constructor(){super(),this.type="disjoint-channel",this.handles={topLeft:new rs,topRight:new rs,bottomLeft:new rs,bottomRight:new ns},this.append([this.background,this.topLine,this.bottomLine,...Object.values(this.handles)])}static is(e){return as.isCheck(e,"disjoint-channel")}dragHandle(e,t,i,n){const{activeHandle:s,handles:r}=this;if(null==s)return;const{offset:o}=r[s].drag(t);r[s].toggleDragging(!0),"bottomRight"===s&&(o.x=0);let a=[],l=[],c=n;switch(s){case"topLeft":a=["topLeft"],l=["bottomLeft"];break;case"bottomLeft":a=["bottomLeft"],l=["topLeft"];break;case"topRight":a=["topRight"],l=["bottomRight"];break;case"bottomRight":a=["bottomLeft","bottomRight"],c=!1}const h=Ft(e,i),u=Ft(e.bottom,i);if(!h||!u)return;const d={topLeft:Lr.start(h),topRight:Lr.end(h),bottomLeft:Lr.start(u),bottomRight:Lr.end(u)},p={vectors:{topLeft:d.topRight,bottomLeft:d.bottomRight,topRight:d.topLeft,bottomRight:d.bottomLeft},angle:e.snapToAngle},g=gs(d,o,i,{overflowContinuous:this.overflowContinuous,translateVectors:a,invertYVectors:l,snap:c?p:void 0});e.start.x=g.topLeft.x,e.start.y=g.topLeft.y,e.end.x=g.topRight.x,e.end.y=g.topRight.y,e.startHeight=g.topLeft.y-g.bottomLeft.y,e.endHeight=g.topRight.y-g.bottomRight.y}getTranslatePointsVectors(e,t){const{bottomLeft:i,bottomRight:n,topLeft:s,topRight:r}=this.handles,o=i.getBBox().y-s.getBBox().y,a=n.getBBox().y-r.getBBox().y;return{start:e,end:t,bottomStart:_r.add(e,_r.from(0,o)),bottomEnd:_r.add(t,_r.from(0,a))}}updateLines(e,t,i){const{topLine:n,bottomLine:s}=this,{lineDashOffset:r,stroke:o,strokeOpacity:a,strokeWidth:l}=e,c={lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:r,stroke:o,strokeOpacity:a,strokeWidth:l};n.setProperties({...t,...c}),s.setProperties({...i,...c})}updateHandles(e,t,i){const{handles:{topLeft:n,topRight:s,bottomLeft:r,bottomRight:o}}=this,a={fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth};n.update({...a,...Lr.start(t)}),s.update({...a,...Lr.end(t)}),r.update({...a,...Lr.start(i)}),o.update({...a,..._r.sub(Lr.end(i),_r.from(o.handle.width/2,o.handle.height/2))})}updateText(e,t,i){this.text=this.updateNode(pr,this.text,!!e.text.label),mr(!1,t,i,e.text,e.strokeWidth,this.text,e.text.label)}getBackgroundPoints(e,t,i,n){const s=t.x1>t.x2,r=t.y1>t.y2,o=r?n.y2:n.y1,a=r?n.y1:n.y2,l=_r.from(t);return e.extendEnd&&t.y2===a&&l.push(_r.from(s?n.x1:n.x2,r?n.y1:n.y2)),e.extendEnd&&i.y2===o&&l.push(_r.from(s?n.x1:n.x2,r?n.y2:n.y1)),l.push(..._r.from(i).reverse()),e.extendStart&&i.y1===a&&l.push(_r.from(s?n.x2:n.x1,r?n.y1:n.y2)),e.extendStart&&t.y1===o&&l.push(_r.from(s?n.x2:n.x1,r?n.y2:n.y1)),l}},{StateMachine:Or,StateMachineProperty:Fr,Debug:Gr}=n.n1,Br=class extends Or{constructor(e){const t=({point:t})=>{const i=new Vi;i.set({start:t,end:t,startHeight:0,endHeight:0}),e.create(i)},i=({offset:t,context:i})=>{const{datum:n,snapping:s}=this;n&&(n.set({end:us(t,i,s,n.start,n.snapToAngle)}),e.update())},n=()=>{this.node?.toggleHandles({topRight:!0}),e.update()},r=({point:t})=>{const{datum:i,node:n}=this,r=Nt(i?.end.y),o=Nt(i?.start.y),{y:a}=t;if(null==i||!(0,s.Et)(o)||!(0,s.Et)(r)||!(0,s.Et)(a))return;const l=r-(a??0),c=2*(o-r)+l,h={x:i.start.x,y:o-l},u={x:i.end.x,y:t.y};n?.toggleHandles(!0),e.validatePoint(h,{overflowContinuous:!0})&&e.validatePoint(u,{overflowContinuous:!0})&&(i.set({startHeight:c,endHeight:l}),e.recordAction("Create disjoint-channel annotation"),e.showAnnotationOptions(),e.update())},o=()=>e.delete();super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},reset:Or.parent},"waiting-first-render":{render:{target:"end",action:()=>{const{node:e}=this;e?.toggleActive(!0),e?.toggleHandles({topLeft:!0,topRight:!1,bottomLeft:!1,bottomRight:!1})}}},end:{hover:i,drag:i,click:{target:"height",action:n},dragEnd:{target:"height",action:n},reset:{target:Or.parent,action:o},cancel:{target:Or.parent,action:o}},height:{hover:({point:t})=>{const{datum:i,node:n}=this,r=Nt(i?.end.y),o=Nt(i?.start.y),{y:a}=t;if(null==i||!(0,s.Et)(o)||!(0,s.Et)(r)||!(0,s.Et)(a))return;const l=r-(a??0),c=2*(o-r)+l,h={x:i?.start.x,y:o-c},u={x:i?.end.x,y:t.y};n?.toggleHandles({bottomLeft:!0,bottomRight:!0}),e.validatePoint(h,{overflowContinuous:!0})&&e.validatePoint(u,{overflowContinuous:!0})&&(i.set({startHeight:c,endHeight:l}),e.update())},click:{target:Or.parent,action:r},drag:{target:Or.parent,action:r},reset:{target:Or.parent,action:o},cancel:{target:Or.parent,action:o}}}),this.debug=Gr.create(!0,"annotations"),this.snapping=!1}};a([Fr()],Br.prototype,"datum",2),a([Fr()],Br.prototype,"node",2),a([Fr()],Br.prototype,"snapping",2);var Vr={type:"disjoint-channel",datum:Vi,scene:Nr,isDatum:Vi.is,translate:(e,t,i,n)=>{Vi.is(t)&&Nr.is(e)&&e.translate(t,i,n)},copy:(e,t,i,n)=>{if(Vi.is(t)&&Vi.is(i)&&Nr.is(e))return e.copy(t,i,n)},update:(e,t,i)=>{Vi.is(t)&&Nr.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Br({...e,create:t("disjoint-channel")}),dragState:e=>new qn(e)},Hr=[0,23.6,38.2,50,61.8,78.6,100],Ur={10:[...Hr,161.8,261.8,361.8,423.6],6:Hr,4:Hr.filter(e=>78.6!==e&&23.6!==e)};function zr({x1:e,y1:t,x2:i,y2:n},s,r,o,a=10){const l=t-n,c=r?-1:1;let h=o;const u=[];return Ur[a].forEach((t,n)=>{const r=o+l*(t/100)*c,a=s.yAxis.scaleInvert(r);u.push({id:n,x1:e,x2:i,y1:h,y2:r,tag:100==t?0:1,label:{x1:Math.min(e,i)-10,x2:i,y1:r,y2:r,text:`${(t/100).toFixed(3)} (${a.toFixed(2)})`}}),h=r}),u}var{Vec2:Wr,Vec4:jr}=n.n1,$r=class extends as{constructor(){super(),this.trendLine=new dr,this.rangeFillsGroup=new n.n1.Group({name:`${this.id}-range-fills`}),this.rangeFillsGroupSelection=n.n1.Selection.select(this.rangeFillsGroup,n.n1.Range),this.rangeStrokesGroup=new n.n1.Group({name:`${this.id}-range-strokes`}),this.rangeStrokesGroupSelection=n.n1.Selection.select(this.rangeStrokesGroup,dr),this.labelsGroup=new n.n1.Group({name:`${this.id}-ranges-labels`}),this.labelsGroupSelection=n.n1.Selection.select(this.labelsGroup,pr),this.anchor={x:0,y:0,position:"above"},this.append([this.trendLine,this.rangeFillsGroup,this.rangeStrokesGroup,this.labelsGroup])}update(e,t){let i=Ft(e,t);if(null==i)return void(this.visible=!1);if(i=jr.round(i),this.visible=e.visible??!0,!this.visible)return;this.updateLine(e,i,this.trendLine),this.updateHandles(e,i),this.updateAnchor(e,i,t);const{reverse:n}=e,s=this.extendLine(i,e,t),r=n?s.y1:s.y2,o=n?s.y2:s.y1,a=zr(s,t,e.reverse,r,e.bands);this.updateRanges(e,a,t);const l={...s,y1:o,y2:o};this.updateText(e,l)}extendLine({x1:e,y1:t,x2:i,y2:n},s,r){const o={x1:e,y1:t,x2:i,y2:n};if(!s.extendStart&&!s.extendEnd)return o;const{x:a,width:l}=r.xAxis.bounds;return s.extendEnd&&(o[e>i?"x1":"x2"]=a+l),s.extendStart&&(o[e>i?"x2":"x1"]=a),o}updateLine(e,t,i){if(!t||!i)return;const{lineDashOffset:n,strokeWidth:s,strokeOpacity:r,stroke:o}=e;i.setProperties({...t,lineCap:e.getLineCap(),lineDash:[3,4],lineDashOffset:n,strokeWidth:s,strokeOpacity:r,fillOpacity:0,stroke:o})}updateRangeStrokes(e){const{lineDashOffset:t,strokeWidth:i,strokeOpacity:n,strokes:s,rangeStroke:r,isMultiColor:o}=e;this.rangeStrokesGroupSelection.each((a,{x1:l,x2:c,y2:h,tag:u},d)=>{const p=h,g=o?s[d%s.length]:r;a.setProperties({x1:l,x2:c,y1:p,y2:p,stroke:g,strokeOpacity:n,strokeWidth:i,lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:t,tag:u})})}updateRanges(e,t,i){const n=e=>e.id;this.rangeFillsGroupSelection.update(t,void 0,n),this.rangeStrokesGroupSelection.update(t,void 0,n),this.labelsGroupSelection.update(t,void 0,n),this.updateRangeFills(e),this.updateRangeStrokes(e),this.updateRangeLabels(e,i)}updateRangeFills(e){const{lineDashOffset:t,strokeWidth:i,strokeOpacity:n,strokes:s,rangeStroke:r,showFill:o,isMultiColor:a}=e;this.rangeFillsGroupSelection.each((l,{x1:c,x2:h,y1:u,y2:d},p)=>{const g=a?s[p%s.length]:r;o?l.setProperties({x1:c,x2:h,y1:u,y2:d,startLine:!1,endLine:!1,stroke:g,strokeOpacity:n,fill:g,fillOpacity:.15*(n??1),strokeWidth:i,lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:t,visible:!0}):l.visible=!1})}updateRangeLabels(e,{xAxis:t}){const{rangeStrokesGroupSelection:i}=this,{strokes:n,strokeWidth:s,rangeStroke:r,isMultiColor:o,label:{fontFamily:a,fontSize:l,fontStyle:c,fontWeight:h,color:u}}=e,d={fontFamily:a,fontSize:l,fontStyle:c,fontWeight:h},p=this.checkWithinBounds(t,d,this.labelsGroupSelection.at(0));this.labelsGroupSelection.each((e,t,a)=>{const l=u??(o?n[a%n.length]:r),c=i.at(a);if(!c)return;const{text:h,...g}=t.label;if(p)e.setProperties({...d,text:h,x:g.x1,y:g.y1,textBaseline:"middle",textAlign:"end",fill:l}),fr(e.id,c,g);else{const t={...d,label:h,position:"center",alignment:"left",color:l};fr(e.id,c,g,t,e,h,s)}})}checkWithinBounds(e,t,i){if(!i)return!1;const{text:n,...s}=i.datum.label;i.setProperties({...t,text:n,x:s.x1,y:s.y1,textBaseline:"middle",textAlign:"end"});const{x:r}=i.getBBox();return r>=e.bounds.x&&r<=e.bounds.x+e.bounds.width}updateText(e,t){const i=this.rangeStrokesGroupSelection.selectByTag(0)[0];if(!i)return;const{text:n,strokeWidth:s}=e;this.text=this.updateNode(pr,this.text,!!n.label),fr(i.id,i,t,n,this.text,n.label,s)}updateAnchor(e,t,i,s){const r=jr.topCenter(t);Wr.apply(this.anchor,n.n1.Transformable.toCanvasPoint(this.trendLine,r.x,r.y))}containsPoint(e,t){const{trendLine:i,rangeStrokesGroupSelection:n,text:s}=this;let r=!1;return n.each(i=>r||(r=i.isPointInPath(e,t))),r||i.isPointInPath(e,t)||Boolean(s?.containsPoint(e,t))}getNodeAtCoords(e,t){return this.text?.containsPoint(e,t)?"text":this.trendLine.isPointInPath(e,t)?"line":void 0}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth}}drag(e,t,i,n){e.locked||(this.activeHandle?this.dragHandle(e,t,i,n):this.dragAll(e,t,i))}getAnchor(){return this.anchor}getCursor(){return"pointer"}},{ContinuousScale:Kr}=n.n1;function Yr(e,t,i={overflowContinuous:!1},n){if(null==t.x||null==t.y)return n&&s.Vy.warnOnce(`${n}requires both an [x] and [y] property, ignoring.`),!1;const{xAxis:r,yAxis:o}=e,a=i.overflowContinuous&&Kr.is(r.scale),l=i.overflowContinuous&&Kr.is(o.scale),c=a||qr(t.x,r),h=l||qr(t.y,o);if(c&&h)return!0;if(n){let e="x & y domains";c&&(e="y domain"),h&&(e="x domain");const i=Nt(t.x),r=Nt(t.y);s.Vy.warnOnce(`${n}is outside the ${e}, ignoring. - x: [${i}], y: ${r}]`)}return!1}function qr(e,t){const{domain:i}=t.scale,n=Nt(e);return!i||null==n||!t.continuous||n>=i[0]&&n<=i.at(-1)}var{Vec2:Xr,Vec4:Zr}=n.n1,Qr=class extends $r{constructor(){super(),this.type="fibonacci-retracement-trend-based",this.endRetracementLine=new dr,this.start=new rs,this.end=new rs,this.endRetracement=new rs,this.append([this.endRetracementLine,this.start,this.end,this.endRetracement])}static is(e){return as.isCheck(e,"fibonacci-retracement-trend-based")}update(e,t){let{coords1:i,coords2:n}=this.getCoords(e,t);if(null==i||null==n)return void(this.visible=!1);if(i=Zr.round(i),n=Zr.round(n),this.visible=e.visible??!0,!this.visible)return;null!=e.endRetracement.x&&null!=e.endRetracement.y||(n=void 0),this.updateLine(e,i,this.trendLine),this.updateLine(e,n,this.endRetracementLine),this.updateHandles(e,i,n),this.updateAnchor(e,n??i,t);const{reverse:s,bands:r}=e,o=function(e,t){const{x2:i,y1:n,y2:s}=e,r=n-s;return null==t?{x1:i,x2:i,y1:s-r,y2:s}:{x1:t.x1,x2:t.x2,y1:t.y2-r,y2:t.y2}}(i,n),a=this.extendLine(o,e,t),l=a.y2,c=a.y1,h=n?zr(a,t,s,l,r):[];this.updateRanges(e,h,t);const u={...a,y1:c,y2:c};this.updateText(e,u)}containsPoint(e,t){const{start:i,end:n,endRetracement:s,endRetracementLine:r}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="start",!0):n.containsPoint(e,t)?(this.activeHandle="end",!0):s.containsPoint(e,t)?(this.activeHandle="endRetracement",!0):r.isPointInPath(e,t)||super.containsPoint(e,t)}getNodeAtCoords(e,t){return this.start.containsPoint(e,t)||this.end.containsPoint(e,t)||this.endRetracement.containsPoint(e,t)?"handle":this.endRetracementLine.isPointInPath(e,t)?"line":super.getNodeAtCoords(e,t)}dragStart(e,t,i){this.dragState={offset:t,...ps({start:e.start,end:e.end,endRetracement:e.endRetracement},i)}}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1),this.endRetracement.toggleDragging(!1)}dragAll(e,t,i){const{dragState:n}=this;n&&this.translatePoints({datum:e,start:n.start,end:n.end,endRetracement:n.endRetracement,translation:Xr.sub(t,n.offset),context:i})}dragHandle(e,t,i,n){const{activeHandle:s,dragState:r}=this;if(!s||!r)return;this[s].toggleDragging(!0);const o=n?this.snapToAngle(e,t,i):Vt(this[s].drag(t).point,i);o&&Yr(i,o)&&(e[s].x=o.x,e[s].y=o.y)}snapToAngle(e,t,i){const{activeHandle:n}=this,s=["start","end","endRetracement"];if(!n)return;const r=(s.indexOf(n)+1)%s.length,o=s[r];return this[n].toggleDragging(!0),Vt(ds(t,Gt(e[o],i),e.snapToAngle),i)}translatePoints({datum:e,start:t,end:i,endRetracement:n,translation:s,context:r}){const o=gs({start:t,end:i,endRetracement:n},s,r,{overflowContinuous:2});e.start.x=o.start.x,e.end.x=o.end.x,e.endRetracement.x=o.endRetracement.x,e.start.y=o.start.y,e.end.y=o.end.y,e.endRetracement.y=o.endRetracement.y}translate(e,t,i){this.translatePoints({datum:e,start:Gt(e.start,i),end:Gt(e.end,i),endRetracement:Gt(e.endRetracement,i),translation:t,context:i})}copy(e,t,i){const{coords1:n,coords2:s}=this.getCoords(e,i);if(!n||!s)return;const r=this.computeBBoxWithoutHandles();return this.translatePoints({datum:t,start:Zr.start(n),end:Zr.end(n),endRetracement:Zr.end(s),translation:{x:-r.width/2,y:-r.height/2},context:i}),t}getCoords(e,t){return{coords1:Ft(e,t),coords2:Ft({start:e.end,end:e.endRetracement},t)}}toggleHandles(e){if("boolean"==typeof e)this.start.visible=e,this.end.visible=e,this.endRetracement.visible=e;else for(const[t,i]of(0,s.jO)(e))this[t].visible=i;this.start.toggleHovered("start"===this.activeHandle),this.end.toggleHovered("end"===this.activeHandle),this.endRetracement.toggleHovered("endRetracement"===this.activeHandle)}toggleActive(e){this.toggleHandles(e),this.start.toggleActive(e),this.end.toggleActive(e),this.endRetracement.toggleActive(e)}updateHandles(e,t,i,n){this.start.update({...this.getHandleStyles(e),...this.getHandleCoords(e,t,"start")}),this.end.update({...this.getHandleStyles(e),...this.getHandleCoords(e,t,"end",n)}),i&&this.endRetracement.update({...this.getHandleStyles(e),...this.getHandleCoords(e,i,"endRetracement",n)}),this.start.toggleLocked(e.locked??!1),this.end.toggleLocked(e.locked??!1),this.endRetracement.toggleLocked(e.locked??!1)}getHandleCoords(e,t,i,n){return"start"===i?Zr.start(t):Zr.end(t)}},{StateMachine:Jr,StateMachineProperty:eo,Debug:to}=n.n1,io=class extends Jr{constructor(e){const t=({point:t})=>{const i=this.createDatum();i.set({start:t,end:t}),e.create(i)},i=({offset:t,context:i})=>{const{datum:n,snapping:s}=this;n&&(n.set({end:us(t,i,s,n.start,n.snapToAngle)}),e.update())},n=()=>{const{datum:t}=this;t&&(t.endRetracement.x=t.end.x,t.endRetracement.y=t.end.y,this.node?.toggleHandles({end:!0}),e.update())},s=()=>{this.node?.toggleHandles({endRetracement:!0}),e.update()},r=()=>e.delete();super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},reset:Jr.parent},"waiting-first-render":{render:{target:"end",action:()=>{const{node:e}=this;e?.toggleActive(!0),e?.toggleHandles({start:!0,end:!1,endRetracement:!1})}}},end:{hover:i,click:{target:"endRetracement",action:n},drag:i,dragEnd:{target:"endRetracement",action:n},reset:{target:Jr.parent,action:r},cancel:{target:Jr.parent,action:r},onExit:()=>{e.showAnnotationOptions(),e.recordAction(`Create ${this.datum?.type} annotation`)}},endRetracement:{hover:({offset:t,context:i})=>{const{datum:n,snapping:s}=this;n&&(n.set({endRetracement:us(t,i,s,n.end,n.snapToAngle)}),e.update())},click:{target:Jr.parent,action:s},drag:{target:Jr.parent,action:s},reset:{target:Jr.parent,action:r},cancel:{target:Jr.parent,action:r}}}),this.debug=to.create(!0,"annotations"),this.snapping=!1}createDatum(){return new Yi}};a([eo()],io.prototype,"datum",2),a([eo()],io.prototype,"node",2),a([eo()],io.prototype,"snapping",2);var no={type:"fibonacci-retracement-trend-based",datum:Yi,scene:Qr,isDatum:Yi.is,translate:(e,t,i,n)=>{Yi.is(t)&&Qr.is(e)&&e.translate(t,i,n)},copy:(e,t,i,n)=>{if(Yi.is(t)&&Yi.is(i)&&Qr.is(e))return e.copy(t,i,n)},update:(e,t,i)=>{Yi.is(t)&&Qr.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new io({...e,create:t("fibonacci-retracement-trend-based")}),dragState:e=>new qn(e)},{Vec2:so,Vec4:ro}=n.n1,oo=class extends $r{constructor(){super(),this.type="fibonacci-retracement",this.start=new rs,this.end=new rs,this.append([this.start,this.end])}static is(e){return as.isCheck(e,"fibonacci-retracement")}containsPoint(e,t){const{start:i,end:n}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="start",!0):n.containsPoint(e,t)?(this.activeHandle="end",!0):super.containsPoint(e,t)}getNodeAtCoords(e,t){return this.start.containsPoint(e,t)||this.end.containsPoint(e,t)?"handle":super.getNodeAtCoords(e,t)}dragStart(e,t,i){this.dragState={offset:t,...ps({start:e.start,end:e.end},i)}}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1)}dragAll(e,t,i){const{dragState:n}=this;n&&this.translatePoints({datum:e,start:n.start,end:n.end,translation:so.sub(t,n.offset),context:i})}dragHandle(e,t,i,n){const{activeHandle:s,dragState:r}=this;if(!s||!r)return;this[s].toggleDragging(!0);const o=n?this.snapToAngle(e,t,i):Vt(this[s].drag(t).point,i);o&&Yr(i,o)&&(e[s].x=o.x,e[s].y=o.y)}snapToAngle(e,t,i){const{activeHandle:n}=this,s=["start","end"].find(e=>e!==n);if(n&&s)return this[n].toggleDragging(!0),Vt(ds(t,Gt(e[s],i),e.snapToAngle),i)}translatePoints({datum:e,start:t,end:i,translation:n,context:s}){const r=gs({start:t,end:i},n,s,{overflowContinuous:1});e.start.x=r.start.x,e.end.x=r.end.x,e.start.y=r.start.y,e.end.y=r.end.y}translate(e,t,i){this.translatePoints({datum:e,start:Gt(e.start,i),end:Gt(e.end,i),translation:t,context:i})}copy(e,t,i){const n=Ft(e,i);if(!n)return;const s=this.computeBBoxWithoutHandles();return this.translatePoints({datum:t,start:{x:n.x1,y:n.y1},end:{x:n.x2,y:n.y2},translation:{x:-s.width/2,y:-s.height/2},context:i}),t}toggleHandles(e){if("boolean"==typeof e)this.start.visible=e,this.end.visible=e;else for(const[t,i]of(0,s.jO)(e))this[t].visible=i;this.start.toggleHovered("start"===this.activeHandle),this.end.toggleHovered("end"===this.activeHandle)}toggleActive(e){this.toggleHandles(e),this.start.toggleActive(e),this.end.toggleActive(e)}updateHandles(e,t,i,n){this.start.update({...this.getHandleStyles(e),...this.getHandleCoords(e,t,"start")}),this.end.update({...this.getHandleStyles(e),...this.getHandleCoords(e,t,"end",n)}),this.start.toggleLocked(e.locked??!1),this.end.toggleLocked(e.locked??!1)}getHandleCoords(e,t,i,n){return"start"===i?ro.start(t):ro.end(t)}},{StateMachine:ao,StateMachineProperty:lo,Debug:co}=n.n1,ho=class extends ao{constructor(e){const t=({point:t})=>{const i=this.createDatum();i.set({start:t,end:t}),e.create(i)},i=({offset:t,context:i})=>{const{datum:n,snapping:s}=this;n&&(n.set({end:us(t,i,s,n.start,n.snapToAngle)}),e.update())},n=()=>{this.node?.toggleHandles({end:!0}),e.update()},s=()=>e.delete();super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},reset:ao.parent},"waiting-first-render":{render:{target:"end",action:()=>{const{node:e}=this;e?.toggleActive(!0),e?.toggleHandles({start:!0,end:!1})}}},end:{hover:i,click:{target:ao.parent,action:n},drag:i,dragEnd:{target:ao.parent,action:n},reset:{target:ao.parent,action:s},cancel:{target:ao.parent,action:s},onExit:()=>{e.showAnnotationOptions(),e.recordAction(`Create ${this.datum?.type} annotation`)}}}),this.debug=co.create(!0,"annotations"),this.snapping=!1}};a([lo()],ho.prototype,"datum",2),a([lo()],ho.prototype,"node",2),a([lo()],ho.prototype,"snapping",2);var uo=class extends ho{createDatum(){return new zi}},po=class extends ho{createDatum(){return new Wi}},go=class extends ho{createDatum(){return new Xi}},fo={type:"fibonacci-retracement",datum:Xi,scene:oo,isDatum:Xi.is,translate:(e,t,i,n)=>{Xi.is(t)&&oo.is(e)&&e.translate(t,i,n)},copy:(e,t,i,n)=>{if(Xi.is(t)&&Xi.is(i)&&oo.is(e))return e.copy(t,i,n)},update:(e,t,i)=>{Xi.is(t)&&oo.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new go({...e,create:t("fibonacci-retracement")}),dragState:e=>new qn(e)},{Vec2:mo}=n.n1,yo=class extends n.n1.Group{},vo=class extends yo{constructor(){super(),this.type="arrow",this.path=new n.n1.Path,this.armLength=6,this.append([this.path])}update(e){const{path:t}=this,{x:i,y:n,angle:s,...r}=e,o=mo.from(i,n),a=3*Math.PI/4,l=this.armLength+2*(e.strokeWidth??0),c=mo.rotate(mo.from(0,l),s+a,o),h=mo.rotate(mo.from(l,0),s-a,o);t.setProperties(r),t.fillOpacity=0,t.path.clear(),t.path.moveTo(c.x,c.y),t.path.lineTo(o.x,o.y),t.path.lineTo(h.x,h.y)}},{Vec2:bo,Vec4:Co}=n.n1,wo=class extends Bs{constructor(){super(),this.type="line",this.line=new dr,this.append([this.line,this.start,this.end])}static is(e){return as.isCheck(e,"line")}update(e,t){let i=Ft(e,t);null!=i?(i=Co.round(i),this.visible=e.visible??!0,this.visible&&(this.updateLine(e,i,t),this.updateHandles(e,i),this.updateText(e,i),this.updateCaps(e,i),this.updateAnchor(e,i,t))):this.visible=!1}updateLine(e,t,i){const{line:n}=this,{lineDashOffset:s,stroke:r,strokeWidth:o,strokeOpacity:a}=e,l=this.extendLine(t,e,i);n.setProperties({...l,lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:s,stroke:r,strokeWidth:o,strokeOpacity:a,fillOpacity:0})}updateText(e,t){this.text=this.updateNode(pr,this.text,!!e.text.label),fr(this.line.id,this.line,t,e.text,this.text,e.text.label,e.strokeWidth)}updateCaps(e,t){if(!e.startCap&&this.startCap&&(this.removeChild(this.startCap),this.startCap=void 0),!e.endCap&&this.endCap&&(this.removeChild(this.endCap),this.endCap=void 0),!e.startCap&&!e.endCap)return;const{stroke:i,strokeWidth:n,strokeOpacity:s}=e,[r,o]=bo.from(t),a=bo.angle(bo.sub(o,r));e.startCap&&(this.startCap&&this.startCap.type!==e.startCap&&(this.removeChild(this.startCap),this.startCap=void 0),null==this.startCap&&(this.startCap=new vo,this.append([this.startCap])),this.startCap.update({x:r.x,y:r.y,angle:a-Math.PI,stroke:i,strokeWidth:n,strokeOpacity:s})),e.endCap&&(this.endCap&&this.endCap.type!==e.endCap&&(this.removeChild(this.endCap),this.endCap=void 0),null==this.endCap&&(this.endCap=new vo,this.append([this.endCap])),this.endCap.update({x:o.x,y:o.y,angle:a,stroke:i,strokeWidth:n,strokeOpacity:s}))}updateAnchor(e,t,i,s){const r=Co.topCenter(t);bo.apply(this.anchor,n.n1.Transformable.toCanvasPoint(this.line,r.x,r.y))}containsPoint(e,t){const{line:i,text:n}=this;return super.containsPoint(e,t)||i.isPointInPath(e,t)||Boolean(n?.containsPoint(e,t))}getNodeAtCoords(e,t){return this.text?.containsPoint(e,t)?"text":this.line.isPointInPath(e,t)?"line":super.getNodeAtCoords(e,t)}getHandleCoords(e,t,i,n){const{startCap:s,endCap:r}=this;let[o,a]=bo.from(t);const l=bo.angle(bo.sub(a,o));return s&&(o=bo.rotate(bo.from(0,-rs.HANDLE_SIZE/2),l,o)),r&&(a=bo.rotate(bo.from(0,rs.HANDLE_SIZE/2),l,a)),"start"===i?o:a}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth}}},So={type:"line",datum:Wi,scene:wo,isDatum:Wi.is,translate:(e,t,i,n)=>{Wi.is(t)&&wo.is(e)&&e.translate(t,i,n)},copy:(e,t,i,n)=>{if(Wi.is(t)&&Wi.is(i)&&wo.is(e))return e.copy(t,i,n)},update:(e,t,i)=>{Wi.is(t)&&wo.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new po({...e,create:t("line")}),dragState:e=>new qn(e)},xo={type:"arrow",datum:zi,scene:wo,isDatum:zi.is,translate:(e,t,i,n)=>{zi.is(t)&&wo.is(e)&&e.translate(t,i,n)},copy:(e,t,i,n)=>{if(zi.is(t)&&zi.is(i)&&wo.is(e))return e.copy(t,i,n)},update:(e,t,i)=>{zi.is(t)&&wo.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new uo({...e,create:t("arrow")}),dragState:e=>new qn(e)};function Eo(e,t=0,i=0){let s=t;for(const t of e)if(Array.isArray(t)){for(const e of t)Ao(e,s);s+=n.n1.Group.computeChildrenBBox(t).width+i}else Ao(t,s),s+=t.getBBox().width+i}function Ao(e,t){"x1"in e?(e.x2=t+(e.x2-e.x1),e.x1=t):e.x=t}function Mo(e,t){"y1"in e?(e.y2=t+(e.y2-e.y1),e.y1=t):e.y=t}function To(e,t){"x1"in e?(e.x1+=t,e.x2+=t):e.x+=t}function Do(e,t){"y1"in e?(e.y1+=t,e.y2+=t):e.y+=t}var{Vec4:Io}=n.n1,Ro=class extends n.n1.Group{constructor(){super(),this.name="MeasurerStatisticsScene",this.background=new n.n1.Rect,this.dateRangeBarsText=new n.n1.Text,this.dateRangeDivider=new n.n1.Line,this.dateRangeValueText=new n.n1.Text,this.priceRangeValueText=new n.n1.Text,this.priceRangeDivider=new n.n1.Line,this.priceRangePercentageText=new n.n1.Text,this.volumeText=new n.n1.Text,this.volumeFormatter=new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2}),this.append([this.background,this.dateRangeBarsText,this.dateRangeDivider,this.dateRangeValueText,this.priceRangeValueText,this.priceRangeDivider,this.priceRangePercentageText,this.volumeText])}update(e,t,i,s,r,o,a){this.verticalDirection=o;const l=this.updateStatistics(e,t,i,a),c=n.n1.Group.computeChildrenBBox(l.flat());c.grow(10),this.updateBackground(e,c,10),this.reposition(l,10,r),this.checkVisibility(e,r,s)}checkVisibility(e,t,i){const s=Io.from(new n.n1.BBox(0,0,t.seriesRect.width,t.seriesRect.height));Io.collides(i,s)?this.visible=e.visible??!0:this.visible=!1}updateStatistics(e,t,i,s){const{dateRangeBarsText:r,dateRangeDivider:o,dateRangeValueText:a,priceRangeValueText:l,priceRangeDivider:c,priceRangePercentageText:h,volumeText:u}=this,d=e.statistics.fontSize+3,p=this.getTextStyles(e),g={...this.getDividerStyles(e),x1:0,y1:0,x2:0,y2:d},f=[r,o,a],m=[l,c,h],y=[];return t.priceRange&&(l.setProperties({...p,text:this.formatPriceRangeValue(t.priceRange.value,s)}),c.setProperties(g),h.setProperties({...p,text:this.formatPriceRangePercentage(t.priceRange.percentage,s)}),Eo(m,i.x,8),y.push(m)),t.dateRange&&(r.setProperties({...p,text:this.formatDateRangeBars(t.dateRange.bars,s)}),o.setProperties(g),a.setProperties({...p,text:this.formatDateRangeValue(t.dateRange.value)}),Eo(f,i.x,8),y.push(f)),null!=t.volume?(u.setProperties({...p,x:i.x,text:this.formatVolume(t.volume,s),visible:!0}),y.push(u)):u.visible=!1,function(e,t=0,i=0){let s=t;for(const t of e)if(Array.isArray(t)){for(const e of t)Mo(e,s);s+=n.n1.Group.computeChildrenBBox(t).height+i}else Mo(t,s),s+=t.getBBox().height+i}(y,i.y,6),c.y1+=-2,c.y2+=-2,o.y1+=-2,o.y2+=-2,y}updateBackground(e,t,i){const n=this.getBackgroundStyles(e);this.background.setProperties({...n,...t,x:t.x-t.width/2+i,y:t.y})}reposition(e,t,i){const{width:s,height:r}=i.seriesRect,o=Io.from(this.background.getBBox());let a=0;o.x1<0&&(a=-o.x1),o.x2>s&&(a=s-o.x2);const l=Math.min(t,r-o.y2);for(const t of e)if(Array.isArray(t)){const e=n.n1.Group.computeChildrenBBox(t).width;for(const i of t)To(i,a-e/2),Do(i,l)}else To(t,a-t.getBBox().width/2),Do(t,l);this.background.x+=a,this.background.y+=l}getTextStyles(e){return{fill:e.statistics.color,fontFamily:e.statistics.fontFamily,fontSize:e.statistics.fontSize,fontStyle:e.statistics.fontStyle,fontWeight:e.statistics.fontWeight,textBaseline:"top"}}getDividerStyles(e){return{stroke:e.statistics.divider.stroke,strokeOpacity:e.statistics.divider.strokeOpacity,strokeWidth:e.statistics.divider.strokeWidth}}getBackgroundStyles(e){return{fill:e.statistics.fill,stroke:e.statistics.stroke,strokeOpacity:e.statistics.strokeOpacity,strokeWidth:e.statistics.strokeWidth,cornerRadius:4}}formatDateRangeBars(e,t){return t?.t("measurerDateRangeBars",{value:e})??`${e}`}formatDateRangeValue(e){const t=[],i=e>=0?"":"-";e=Math.abs(e);const n=36e5,s=24*n,r=Math.floor(e/6e4),o=Math.floor(e/n),a=Math.floor(e/s),l=o%24,c=r%60;return a>=1&&t.push(`${a}d`),o>=1&&(e<s||0!==l)&&t.push(`${l}h`),(e<n||0!==c)&&t.push(`${c}m`),t[0]=`${i}${t[0]}`,t.join(" ")}formatPriceRangeValue(e,t){return t?.t("measurerPriceRangeValue",{value:Number(e.toFixed(2))})??`${e}`}formatPriceRangePercentage(e,t){return t?.t("measurerPriceRangePercent",{value:e})??`${e}`}formatVolume(e,t){const i=isNaN(e)?"":this.volumeFormatter.format(e);return t?.t("measurerVolume",{value:i})??i}},ko=class extends Ro{getDirectionStyles(e){return"down"===this.verticalDirection?e.down.statistics:e.up.statistics}getTextStyles(e){const t=this.getDirectionStyles(e);return{...super.getTextStyles(e),fill:t.color,fontFamily:t.fontFamily,fontSize:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight}}getDividerStyles(e){const t=this.getDirectionStyles(e);return{stroke:t.divider.stroke,strokeOpacity:t.divider.strokeOpacity,strokeWidth:t.divider.strokeWidth}}getBackgroundStyles(e){const t=this.getDirectionStyles(e);return{...super.getBackgroundStyles(e),fill:t.fill,stroke:t.stroke,strokeOpacity:t.strokeOpacity,strokeWidth:t.strokeWidth}}},{Vec2:Po,Vec4:_o}=n.n1,Lo=class extends Bs{constructor(){super(),this.type="measurer",this.horizontalLine=new dr,this.verticalLine=new dr,this.horizontalStartLine=new dr,this.horizontalEndLine=new dr,this.verticalStartLine=new dr,this.verticalEndLine=new dr,this.horizontalEndCap=new vo,this.verticalEndCap=new vo,this.background=new n.n1.Path({zIndex:-1}),this.updateBackground=kr.updateBackground.bind(this),this.statistics=this.createStatisticsScene(),this.statistics.zIndex=1,this.append([this.background,this.verticalStartLine,this.verticalEndLine,this.horizontalStartLine,this.horizontalEndLine,this.horizontalLine,this.verticalLine,this.horizontalEndCap,this.verticalEndCap,this.start,this.end,this.statistics])}static is(e){return as.isCheck(e,"measurer")}createStatisticsScene(){return new Ro}update(e,t){const i=Ft(e,t);if(null==i)return void(this.visible=!1);if(this.visible=e.visible??!0,!this.visible)return;const n=this.extendPerpendicular(i,e,t),s={...n,y2:n.y1},r={...n,y1:n.y2};this.verticalDirection=i.y1<i.y2?"down":"up",this.updateVisibilities(e),this.updateLines(e,i),this.updateHandles(e,i),this.updateText(e,i),this.updateCaps(e,i),this.updateBoundingLines(e,n),this.updateBackground(e,s,r,t),this.updateStatistics(e,i,t),this.updateAnchor(e,i,t)}extendPerpendicular(e,t,i){const n={x1:Math.min(e.x1,e.x2),x2:Math.max(e.x1,e.x2),y1:Math.min(e.y1,e.y2),y2:Math.max(e.y1,e.y2)},[s,r]=Po.from(i.yAxis.bounds);return fi.is(t)?(t.extendAbove&&(n.y1=s.y),t.extendBelow&&(n.y2=r.y)):mi.is(t)&&(t.extendLeft&&(n.x1=s.x),t.extendRight&&(n.x2=r.x)),n}updateVisibilities(e){const{horizontalStartLine:t,horizontalEndLine:i,horizontalEndCap:n,verticalStartLine:s,verticalEndLine:r,verticalEndCap:o}=this,{direction:a}=e;s.visible="vertical"!==a,r.visible="vertical"!==a,n.visible="vertical"!==a,t.visible="horizontal"!==a,i.visible="horizontal"!==a,o.visible="horizontal"!==a}updateLines(e,t){const{horizontalLine:i,verticalLine:n}=this,{direction:s}=e,{x1:r,y1:o,x2:a,y2:l}=t,c=Po.round(_o.center(t),0),h=this.getLineStyles(e);"vertical"!==s&&i.setProperties({...h,x1:r,x2:a,y1:c.y,y2:c.y}),"horizontal"!==s&&n.setProperties({...h,x1:c.x,x2:c.x,y1:o,y2:l})}updateText(e,t){const{direction:i}=e,n=Po.round(_o.center(t),0);let s;const r={...t};"vertical"===i?(s=this.verticalLine,r.x1=n.x,r.x2=n.x):(s=this.horizontalLine,r.y1=n.y,r.y2=n.y),this.text=this.updateNode(pr,this.text,!!e.text.label);const{id:o}=s,a=fr(o,s,r,e.text,this.text,e.text.label,e.strokeWidth);let l;if("both"===i&&a&&this.text){const e=_o.from(this.text.getBBox()),{offset:t}=a.numbers;e.x1<=n.x+t.x&&e.x2>=n.x-t.x&&(l={x:n.x,y:a.clipMask.y,radius:this.text.getBBox().height/2+Po.length(t)})}this.verticalLine.setClipMask(o,l)}updateCaps(e,t){const{horizontalEndCap:i,verticalEndCap:n}=this,{direction:s}=e,{x1:r,y1:o,x2:a,y2:l}=t,c=Po.round(_o.center(t),0),{stroke:h,strokeWidth:u,strokeOpacity:d}=this.getLineStyles(e),p={stroke:h,strokeWidth:u,strokeOpacity:d};if("vertical"!==s){const e=r<=a?0:Math.PI;let t=a;"horizontal"===s&&(t+=r<=a?-2:2),i.update({...p,x:t,y:c.y,angle:e})}if("horizontal"!==s){const e=o<=l?Math.PI/2:Math.PI/-2;let t=l;"vertical"===s&&(t+=o<=l?-2:2),n.update({...p,x:c.x,y:t,angle:e})}}updateBoundingLines(e,t){const{verticalStartLine:i,verticalEndLine:n,horizontalStartLine:s,horizontalEndLine:r}=this,{direction:o}=e,{x1:a,y1:l,x2:c,y2:h}=t,u=this.getLineStyles(e);"horizontal"===o&&(i.setProperties({...u,x1:a,y1:l,x2:a,y2:h}),n.setProperties({...u,x1:c,y1:l,x2:c,y2:h})),"vertical"===o&&(s.setProperties({...u,x1:a,y1:l,x2:c,y2:l}),r.setProperties({...u,x1:a,y1:h,x2:c,y2:h}))}updateStatistics(e,t,i){const n=Po.add(_o.bottomCenter(t),Po.from(0,10)),s={volume:this.getVolume(e)};e.hasPriceRange&&(s.priceRange={percentage:this.getPriceRangePercentage(e),value:this.getPriceRangeValue(e)}),e.hasDateRange&&(s.dateRange={bars:this.getDateRangeBars(t,i),value:this.getDateRangeValue(e)}),this.statistics.update(e,s,n,t,i,this.verticalDirection,e.localeManager)}updateAnchor(e,t,i,s){const r=_o.topCenter(t);Po.apply(this.anchor,n.n1.Transformable.toCanvasPoint(this.horizontalLine,r.x,r.y))}getBackgroundPoints(e,t,i,n){const[s,r]=Po.from(t),[o,a]=Po.from(i);return[s,r,a,o]}getLineStyles(e){const{lineDashOffset:t,stroke:i,strokeWidth:n,strokeOpacity:s}=e;return{lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:t,stroke:i,strokeWidth:n,strokeOpacity:s,fillOpacity:0}}getBackgroundStyles(e){const{background:t}=e;return{fill:t.fill,fillOpacity:t.fillOpacity}}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth}}containsPoint(e,t){const{horizontalLine:i,text:n,verticalLine:s,horizontalStartLine:r,horizontalEndLine:o,verticalStartLine:a,verticalEndLine:l}=this;return super.containsPoint(e,t)||i.isPointInPath(e,t)||s.isPointInPath(e,t)||r.visible&&r.isPointInPath(e,t)||o.visible&&o.isPointInPath(e,t)||a.visible&&a.isPointInPath(e,t)||l.visible&&l.isPointInPath(e,t)||Boolean(n?.containsPoint(e,t))}getNodeAtCoords(e,t){return this.text?.containsPoint(e,t)?"text":this.start.containsPoint(e,t)||this.end.containsPoint(e,t)?"handle":"line"}getDateRangeBars(e,t){const{step:i}=t.xAxis.scale,n=e.x1<=e.x2?1:-1;return i?Math.round(_o.width(e)/i)*n:0}getDateRangeValue(e){const t=Nt(e.start.x),i=Nt(e.end.x);if(!(0,s.$P)(t)||!(0,s.$P)(i))throw new Error("Can not create a date range measurement of non-date x-axis.");return i.getTime()-t.getTime()}getPriceRangePercentage(e){if(null==e.start.y||null==e.end.y)throw new Error("Can not create a price range measurement of a non-numeric y-axis");const t=Nt(e.end.y),i=Nt(e.start.y);if(!(0,s.Et)(t)||!(0,s.Et)(i))throw new Error("Can not create a price range measurement of a non-numeric y-axis");return(t-i)/i}getPriceRangeValue(e){if(null==e.start.y||null==e.end.y)throw new Error("Can not create a price range measurement of a non-numeric y-axis");const t=Nt(e.end.y),i=Nt(e.start.y);if(!(0,s.Et)(t)||!(0,s.Et)(i))throw new Error("Can not create a price range measurement of a non-numeric y-axis");return t-i}getVolume(e){return e.getVolume(e.start.x,e.end.x)}},No=class extends Lo{constructor(){super(...arguments),this.type="quick-measurer"}static is(e){return as.isCheck(e,"quick-measurer")}createStatisticsScene(){return new ko}getDirectionStyles(e){return"down"===this.verticalDirection?e.down:e.up}getLineStyles(e){const t=this.getDirectionStyles(e);return{...super.getLineStyles(e),stroke:t.stroke,strokeWidth:t.strokeWidth,strokeOpacity:t.strokeOpacity}}getBackgroundStyles(e){const t=this.getDirectionStyles(e);return{fill:t.fill,fillOpacity:t.fillOpacity}}getHandleStyles(e){const t=this.getDirectionStyles(e);return{fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity??t.strokeOpacity,strokeWidth:t.handle.strokeWidth??t.strokeWidth}}},{StateMachine:Oo,StateMachineProperty:Fo,Debug:Go}=n.n1,Bo=class extends Oo{constructor(e){const t=({point:t})=>{const i=this.createDatum();i.set({start:t,end:t}),e.create(i)},i=({point:t})=>{const{datum:i,node:n}=this;i?.set({end:t}),n?.toggleActive(!0),n?.toggleHandles({end:!1}),e.update()},n=()=>{this.node?.toggleHandles({end:!0})},s=()=>e.delete();super("start",{start:{reset:Oo.parent,click:{target:"end",action:t},drag:{target:"end",action:t}},end:{hover:i,drag:i,click:{target:Oo.parent,action:n},dragEnd:{target:Oo.parent,action:n},reset:{target:Oo.parent,action:s},cancel:{target:Oo.parent,action:s},onExit:()=>{e.showAnnotationOptions(),nn(this.datum)||e.recordAction(`Create ${this.node?.type} annotation`)}}}),this.debug=Go.create(!0,"annotations")}};a([Fo()],Bo.prototype,"datum",2),a([Fo()],Bo.prototype,"node",2);var Vo=class extends Bo{createDatum(){return new fi}},Ho=class extends Bo{createDatum(){return new mi}},Uo=class extends Bo{createDatum(){return new yi}},zo=class extends Bo{createDatum(){return new vi}},Wo={type:"date-range",datum:fi,scene:Lo,isDatum:fi.is,translate:(e,t,i,n)=>{fi.is(t)&&Lo.is(e)&&e.translate(t,i,n)},copy:(e,t,i,n)=>{if(fi.is(t)&&fi.is(i)&&Lo.is(e))return e.copy(t,i,n)},update:(e,t,i)=>{fi.is(t)&&Lo.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Vo({...e,create:t("date-range")}),dragState:e=>new qn(e)},jo={type:"price-range",datum:mi,scene:Lo,isDatum:mi.is,translate:(e,t,i,n)=>{mi.is(t)&&Lo.is(e)&&e.translate(t,i,n)},copy:(e,t,i,n)=>{if(mi.is(t)&&mi.is(i)&&Lo.is(e))return e.copy(t,i,n)},update:(e,t,i)=>{mi.is(t)&&Lo.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Ho({...e,create:t("date-range")}),dragState:e=>new qn(e)},$o={type:"date-price-range",datum:yi,scene:Lo,isDatum:yi.is,translate:(e,t,i,n)=>{yi.is(t)&&Lo.is(e)&&e.translate(t,i,n)},copy:(e,t,i,n)=>{if(yi.is(t)&&yi.is(i)&&Lo.is(e))return e.copy(t,i,n)},update:(e,t,i)=>{yi.is(t)&&Lo.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Uo({...e,create:t("date-range")}),dragState:e=>new qn(e)},Ko={type:"quick-date-price-range",datum:vi,scene:No,isDatum:vi.is,translate:(e,t,i,n)=>{vi.is(t)&&No.is(e)&&e.translate(t,i,n)},copy:(e,t,i,n)=>{if(vi.is(t)&&vi.is(i)&&No.is(e))return e.copy(t,i,n)},update:(e,t,i)=>{vi.is(t)&&No.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new zo({...e,create:t("quick-date-price-range")}),dragState:e=>new qn(e)},{ZIndexMap:Yo,TextWrapper:qo}=n.n1,Xo=class extends Js{constructor(){super(),this.type="note",this.shape=new n.n1.Rect,this.iconBackground=new n.n1.SvgPath("M22 1.83333C22 0.820811 21.1792 0 20.1667 0H1.83333C0.820811 0 0 0.82081 0 1.83333V13.9868C0 14.9994 0.820811 15.8202 1.83333 15.8202L5.88971 15.8202C6.44575 15.8202 6.97175 16.0725 7.31971 16.5062L9.57006 19.3112C10.304 20.2259 11.6962 20.2259 12.4301 19.3112L14.6804 16.5062C15.0284 16.0725 15.5544 15.8202 16.1104 15.8202L20.1667 15.8202C21.1792 15.8202 22 14.9994 22 13.9868V1.83333Z"),this.iconLines=new n.n1.SvgPath("M17.1114 5.75C17.1114 6.16421 16.7756 6.5 16.3614 6.5H5.63916C5.22495 6.5 4.88916 6.16421 4.88916 5.75V5.75C4.88916 5.33579 5.22495 5 5.63916 5H16.3614C16.7756 5 17.1114 5.33579 17.1114 5.75V5.75ZM17.1114 9.25C17.1114 9.66421 16.7756 10 16.3614 10H5.63916C5.22495 10 4.88916 9.66421 4.88916 9.25V9.25C4.88916 8.83579 5.22495 8.5 5.63916 8.5H16.3614C16.7756 8.5 17.1114 8.83579 17.1114 9.25V9.25Z"),this.active=!1,this.shape.visible=!1,this.label.visible=!1,this.iconBackground.fillShadow=new n.n1.DropShadow,this.append([this.shape,this.label,this.iconBackground,this.iconLines,this.handle])}static is(e){return as.isCheck(e,"note")}update(e,t){this.updateIcon(e,t),super.update(e,t)}getTextBBox(e,t,i){const n=super.getTextBBox(e,t,i);n.x-=e.width/2,n.x=(0,s.qE)(0,n.x,i.seriesRect.width-e.width);const r=e.getPadding().top,o=n.y-30-2*r,a=n.y+rs.HANDLE_SIZE+2*r;return o-n.height-34<0?(n.y=a,e.position="top"):(n.y=o+r,e.position="bottom"),n}updateLabel(e,t){const i=!1!==e.visible&&this.label.visible;super.updateLabel(e,t),this.label.visible=i,this.label.text=qo.wrapText(e.text,{font:{fontFamily:e.fontFamily,fontSize:e.fontSize,fontStyle:e.fontStyle,fontWeight:e.fontWeight},avoidOrphans:!1,textAlign:e.textAlign,textBaseline:"hanging",textWrap:"always",maxWidth:200})}updateShape(e,t){const{shape:i}=this;i.fill=e.background.fill,i.fillOpacity=e.background.fillOpacity??1,i.stroke=e.background.stroke,i.strokeOpacity=e.background.strokeOpacity??1,i.strokeWidth=e.background.strokeWidth??1,i.cornerRadius=4;const n=e.getPadding().top,s="top"===e.position;i.x=t.x-n,i.width=e.width+2*n,i.height=t.height+2*n,i.y=t.y+(s?0:-t.height)-n}updateIcon(e,t){const{active:i,iconBackground:n,iconLines:s}=this,{x:r,y:o}=Gt(e,t);n.x=r-11,n.y=o-20,s.x=n.x,s.y=n.y,n.fill=e.fill,n.fillOpacity=e.fillOpacity??1,n.stroke=e.stroke,n.strokeOpacity=e.strokeOpacity??1,n.strokeWidth=e.strokeWidth??1,s.fill=e.stroke,n.fillShadow.color=i?e.fill??"rgba(0, 0, 0, 0.22)":"rgba(0, 0, 0, 0.22)"}updateAnchor(e,t,i){const n=e.getPadding().top,s="top"===e.position,r=s?1:-1;return{x:t.x+i.seriesRect.x+e.width/2,y:t.y+i.seriesRect.y+r*(t.height+n),position:s?"below":"above"}}getLabelCoords(e,t){const i="top"===e.position,n=e.getPadding().top+e.fontSize*Si/2;return{x:t.x,y:t.y+(i?n/2:0)}}getTextBaseline(e){return"top"===e.position?"middle":e.position}getHandleCoords(e,t,i){return{x:t.x,y:t.y+rs.HANDLE_SIZE/2+4}}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.fill,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}}toggleHovered(e){super.toggleHovered(e),this.label.visible=e,this.shape.visible=e,this.zIndex=e?Yo.CHART_ANNOTATION_FOCUSED:Yo.CHART_ANNOTATION}toggleActive(e){super.toggleActive(e),this.label.visible=e,this.shape.visible=e,this.active=e}containsPoint(e,t){return!(!this.shape.visible||!this.shape.containsPoint(e,t))||!!this.iconBackground.containsPoint(e,t)||super.containsPoint(e,t)}},Zo=class extends rr{createDatum(){return new Ri}},Qo={type:"note",datum:Ri,scene:Xo,isDatum:Ri.is,translate:(e,t,i,n)=>{Ri.is(t)&&Xo.is(e)&&e.translate(t,i,n)},copy:(e,t,i,n)=>{if(Ri.is(t)&&Ri.is(i)&&Xo.is(e))return e.copy(t,i,n)},update:(e,t,i)=>{Ri.is(t)&&Xo.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Zo({...e,create:t("note")}),dragState:e=>new qn(e)},{Vec2:Jo,Vec4:ea}=n.n1,ta=class extends Pr{constructor(){super(),this.type="parallel-channel",this.handles={topLeft:new rs,topMiddle:new ns,topRight:new rs,bottomLeft:new rs,bottomMiddle:new ns,bottomRight:new rs},this.middleLine=new dr,this.append([this.background,this.topLine,this.middleLine,this.bottomLine,...Object.values(this.handles)])}static is(e){return as.isCheck(e,"parallel-channel")}dragHandle(e,t,i,n){const{activeHandle:s,handles:r}=this;if(null==s)return;const{offset:o}=r[s].drag(t);r[s].toggleDragging(!0),"topMiddle"!==s&&"bottomMiddle"!==s||(o.x=0);let a=[],l=n;switch(s){case"topLeft":case"bottomLeft":a=["topLeft","bottomLeft"];break;case"topMiddle":a=["topLeft","topRight"],o.y-=ns.HANDLE_SIZE/2,l=!1;break;case"topRight":case"bottomRight":a=["topRight","bottomRight"];break;case"bottomMiddle":a=["bottomLeft","bottomRight"],o.y-=ns.HANDLE_SIZE/2,l=!1}const c=Ft(e,i),h=Ft(e.bottom,i);if(!c||!h)return;const u={topLeft:ea.start(c),topRight:ea.end(c),bottomLeft:ea.start(h),bottomRight:ea.end(h)},d={vectors:{topLeft:u.topRight,bottomLeft:u.bottomRight,topRight:u.topLeft,bottomRight:u.bottomLeft},angle:e.snapToAngle},p=gs(u,o,i,{overflowContinuous:this.overflowContinuous,translateVectors:a,snap:l?d:void 0});e.start.x=p.topLeft.x,e.start.y=p.topLeft.y,e.end.x=p.topRight.x,e.end.y=p.topRight.y,e.height=p.topLeft.y-p.bottomLeft.y}getTranslatePointsVectors(e,t){const{bottomLeft:i,topLeft:n}=this.handles,s=i.getBBox().y-n.getBBox().y;return{start:e,end:t,bottomStart:Jo.add(e,Jo.from(0,s)),bottomEnd:Jo.add(t,Jo.from(0,s))}}containsPoint(e,t){return super.containsPoint(e,t)||this.middleLine.visible&&this.middleLine.strokeWidth>0&&this.middleLine.containsPoint(e,t)}getNodeAtCoords(e,t){return this.middleLine.visible&&this.middleLine.strokeWidth>0&&this.middleLine.containsPoint(e,t)?"line":super.getNodeAtCoords(e,t)}updateLines(e,t,i,n,s,r){const{topLine:o,middleLine:a,bottomLine:l}=this,{lineDashOffset:c,stroke:h,strokeOpacity:u,strokeWidth:d}=e,p=e.getLineDash(),g={lineCap:e.getLineCap(),lineDash:p,lineDashOffset:c,stroke:h,strokeOpacity:u,strokeWidth:d};o.setProperties({...t,...g}),l.setProperties({...i,...g});const f=this.extendLine({x1:s.x1,y1:r.y1+(s.y1-r.y1)/2,x2:s.x2,y2:r.y2+(s.y2-r.y2)/2},e,n);a.setProperties({...f,lineDash:e.middle.lineDash??p,lineDashOffset:e.middle.lineDashOffset??c,stroke:e.middle.stroke??h,strokeOpacity:e.middle.strokeOpacity??u,strokeWidth:e.middle.strokeWidth??d,visible:e.middle.visible??!0})}updateHandles(e,t,i){const{handles:{topLeft:n,topMiddle:s,topRight:r,bottomLeft:o,bottomMiddle:a,bottomRight:l}}=this,c={fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth};n.update({...c,...ea.start(t)}),r.update({...c,...ea.end(t)}),o.update({...c,...ea.start(i)}),l.update({...c,...ea.end(i)}),s.update({...c,...Jo.sub(ea.center(t),Jo.from(s.handle.width/2,s.handle.height/2))}),a.update({...c,...Jo.sub(ea.center(i),Jo.from(a.handle.width/2,a.handle.height/2))})}updateText(e,t,i){this.text=this.updateNode(pr,this.text,!!e.text.label),mr(!0,t,i,e.text,e.strokeWidth,this.text,e.text.label)}getBackgroundPoints(e,t,i,n){const s=t.x1>t.x2,r=t.y1>t.y2,o=t.x1!==i.x1&&t.y1!==i.y1,a=t.x2!==i.x2&&t.y2!==i.y2,l=Jo.from(t);return e.extendEnd&&a&&l.push(Jo.from(s?n.x1:n.x2,r?n.y1:n.y2)),l.push(...Jo.from(i).reverse()),e.extendStart&&o&&l.push(Jo.from(s?n.x2:n.x1,r?n.y2:n.y1)),l}},{StateMachine:ia,StateMachineProperty:na,Debug:sa}=n.n1,ra=class extends ia{constructor(e){const t=({point:t})=>{const i=new Ji;i.set({start:t,end:t,height:0}),e.create(i)},i=({offset:t,context:i})=>{const{datum:n,snapping:s}=this;n&&(n.set({end:us(t,i,s,n.start,n.snapToAngle)}),e.update())},n=()=>{this.node?.toggleHandles({topRight:!0}),e.update()},r=({point:t})=>{const{datum:i,node:n}=this,r=Nt(i?.end.y),o=Nt(i?.start.y),{y:a}=t;if(null==i||!(0,s.Et)(o)||!(0,s.Et)(r)||!(0,s.Et)(a))return;const l=r-(a??0),c=o-l;n?.toggleHandles(!0),e.validatePoint({x:i.start.x,y:c},{overflowContinuous:!0})&&e.validatePoint({x:i.end.x,y:t.y},{overflowContinuous:!0})&&(i.set({height:l}),e.recordAction("Create parallel-channel annotation"),e.showAnnotationOptions(),e.update())},o=()=>e.delete();super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},reset:ia.parent},"waiting-first-render":{render:{target:"end",action:()=>{const{node:e}=this;e?.toggleActive(!0),e?.toggleHandles({topLeft:!0,topMiddle:!1,topRight:!1,bottomLeft:!1,bottomMiddle:!1,bottomRight:!1})}}},end:{hover:i,drag:i,click:{target:"height",action:n},dragEnd:{target:"height",action:n},reset:{target:ia.parent,action:o},cancel:{target:ia.parent,action:o}},height:{hover:({point:t})=>{const{datum:i,node:n}=this,r=Nt(i?.end.y),o=Nt(i?.start.y),{y:a}=t;if(null==i||!(0,s.Et)(o)||!(0,s.Et)(r)||!(0,s.Et)(a))return;const l=r-(a??0),c=o-l;n?.toggleHandles({bottomLeft:!0,bottomRight:!0}),e.validatePoint({x:i.start.x,y:c},{overflowContinuous:!0})&&e.validatePoint({x:i.end.x,y:t.y},{overflowContinuous:!0})&&(i.set({height:l}),e.update())},click:{target:ia.parent,action:r},drag:{target:ia.parent,action:r},reset:{target:ia.parent,action:o},cancel:{target:ia.parent,action:o}}}),this.debug=sa.create(!0,"annotations"),this.snapping=!1}};a([na()],ra.prototype,"datum",2),a([na()],ra.prototype,"node",2),a([na()],ra.prototype,"snapping",2);var oa={type:"parallel-channel",datum:Ji,scene:ta,isDatum:Ji.is,translate:(e,t,i,n)=>{Ji.is(t)&&ta.is(e)&&e.translate(t,i,n)},copy:(e,t,i,n)=>{if(Ji.is(t)&&Ji.is(i)&&ta.is(e))return e.copy(t,i,n)},update:(e,t,i)=>{Ji.is(t)&&ta.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new ra({...e,create:t("parallel-channel")}),dragState:e=>new qn(e)},aa=class extends Js{constructor(){super(),this.type="text",this.append([this.label,this.handle])}static is(e){return as.isCheck(e,"text")}getHandleCoords(e,t){const i=rs.HANDLE_SIZE/2;return{x:t.x+i,y:t.y+2+i}}},la=class extends rr{createDatum(){return new tn}},ca={type:"text",datum:tn,scene:aa,isDatum:tn.is,translate:(e,t,i,n)=>{tn.is(t)&&aa.is(e)&&e.translate(t,i,n)},copy:(e,t,i,n)=>{if(tn.is(t)&&tn.is(i)&&aa.is(e))return e.copy(t,i,n)},update:(e,t,i)=>{tn.is(t)&&aa.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new la({...e,create:t("text")}),dragState:e=>new qn(e)},ha={[So.type]:So,[Dr.type]:Dr,[Ir.type]:Ir,[oa.type]:oa,[Vr.type]:Vr,[fo.type]:fo,[no.type]:no,[Qs.type]:Qs,[ar.type]:ar,[Qo.type]:Qo,[ca.type]:ca,[xo.type]:xo,[_s.type]:_s,[Is.type]:Is,[Wo.type]:Wo,[jo.type]:jo,[$o.type]:$o,[Ko.type]:Ko};function ua(e){for(const{isDatum:t}of Object.values(ha))if(t(e))return e}var{ActionOnSet:da,ParallelStateMachine:pa,StateMachine:ga,StateMachineProperty:fa,Debug:ma}=n.n1,ya=class extends pa{constructor(e){super(new va(e=>{this.snapping=e}),new ba(()=>{this.node=null==this.active?void 0:e.node(this.active)}),new Ca(e,t=>{this.active=t,this.datum=null==this.active?void 0:e.datum(this.active),this.node=null==this.active?void 0:e.node(this.active)})),this.snapping=!1}getActive(){return this.active}isActive(e){return e===this.active}};a([fa()],ya.prototype,"snapping",2),a([fa()],ya.prototype,"datum",2),a([fa()],ya.prototype,"node",2);var va=class extends ga{constructor(e){super("idle",{idle:{hover:({shiftKey:t})=>e(t),keyDown:({shiftKey:t})=>e(t),keyUp:({shiftKey:t})=>e(t),click:({shiftKey:t})=>e(t),drag:({shiftKey:t})=>e(t)},dragging:{},translating:{},"text-input":{}})}},ba=class extends ga{constructor(e){super("idle",{idle:{onEnter:e,render:e},dragging:{onEnter:e,render:e},translating:{onEnter:e,render:e},"text-input":{render:e}})}},Ca=class extends ga{constructor(e,t){const i=()=>{null!=this.active&&e.delete(this.active),this.active=void 0,e.select()},n={createDatum:t=>i=>{e.create(t,i),this.active=e.selectLast()}},s={...e,delete:i,showTextInput:()=>{null!=this.active&&e.showTextInput(this.active)},deselect:()=>{const t=this.active;this.active=void 0,this.hovered=void 0,e.select(this.active,t)},showAnnotationOptions:()=>{null!=this.active&&e.showAnnotationOptions(this.active)}},r=({colorPickerType:t,colorOpacity:i,color:n,opacity:s,isMultiColor:r})=>{this.datum&&("text-color"===t&&e.updateTextInputColor(n),yn(this.datum,t,i,n,s,r),e.update())},o=t=>{const{datum:i,node:n}=this;i&&n&&(an(i)?(i.fontSize=t,e.updateTextInputFontSize(t)):gn(i)&&(i.text.fontSize=t),e.update())},a=t=>{const{node:i}=this;i&&"setTextInputBBox"in i&&(i.setTextInputBBox(t),e.update())},l=({textInputValue:t,bbox:i})=>{const{datum:n}=this;if(null!=i&&null!=t&&t.length>0){if(!an(n))return;const s=Ei(n,t,i.width);n.set({text:s}),e.update(),e.recordAction(`Change ${n.type} annotation text`)}else e.delete(this.active),e.recordAction(`Delete ${n?.type} annotation`)},c=()=>{e.updateTextInputBBox(void 0)},h=()=>null!=this.active,u=()=>{const{active:e,datum:t}=this;return null!=e&&!!t&&gn(t)&&!t.locked},d=()=>null!=this.active&&!nn(this.datum);super("idle",{idle:{onEnter:()=>{e.select(this.active,this.active),this.hoverCoords&&(this.hovered=e.hoverAtCoords(this.hoverCoords,this.active,this.hovered))},hover:({offset:t})=>{this.hovered=e.hoverAtCoords(t,this.active,this.hovered),this.hoverCoords=t},translate:{guard:h,target:"translating",action:({translation:t})=>{e.startInteracting(),e.translate(this.active,t),e.update()}},copy:{guard:d,action:()=>{this.copied=e.copy(this.active)}},cut:{guard:d,action:()=>{this.copied=e.copy(this.active),i()}},paste:{guard:()=>null!=this.copied,action:()=>{e.paste(this.copied)}},selectLast:()=>{const t=this.active;this.active=e.selectLast(),e.select(this.active,t)},click:[{guard:()=>{const{active:e,hovered:t,datum:i}=this;return null!=e&&t===e&&!!i&&an(i)&&!i.locked},target:"text-input"},{action:()=>{const t=this.active;this.active=this.hovered,e.select(this.active,t)}}],dblclick:{guard:u,action:({offset:t})=>{const i="text"===e.getNodeAtCoords(t,this.active)?"text":"line";e.showAnnotationSettings(this.active,void 0,i)}},dragStart:[{guard:()=>null!=this.hovered,target:"dragging",action:()=>{const t=this.active;this.active=this.hovered,e.select(this.active,t),e.startInteracting()}},{action:()=>{const t=this.active;this.active=this.hovered,e.select(this.active,t)}}],color:{guard:h,action:r},fontSize:{guard:h,action:o},lineProps:{guard:h,action:t=>{const i=ua(this.datum);i?.set(t),e.update(),e.recordAction(`Change ${i?.type} ${Object.entries(t).map(([e,t])=>`${e} to ${t}`).join(", ")}`)}},lineStyle:{guard:h,action:t=>{const{datum:i,node:n}=this;i&&n&&hn(i)&&(mn(i,t),e.update())}},lineText:{guard:h,action:t=>{const i=ua(this.datum);gn(i)&&(rn(i)&&"center"===t.position&&(t.position="inside"),i.text.set(t),e.update())}},updateTextInputBBox:{guard:h,action:a},toolbarPressSettings:{guard:u,action:t=>{e.showAnnotationSettings(this.active,t)}},reset:()=>{null!=this.active&&this.node?.toggleActive(!1),this.hovered=void 0,this.active=void 0,e.select(this.active,this.active),e.resetToIdle()},delete:()=>{null!=this.active&&(e.delete(this.active),nn(this.datum)||e.recordAction(`Delete ${this.datum?.type} annotation`))},deleteAll:()=>{e.deleteAll()},...Object.fromEntries(Object.entries(ha).map(([e,t])=>[e,t.createState(s,n)]))},dragging:{onEnter:(t,i)=>{if(null==this.active)return;const n=e.getAnnotationType(this.active);n&&(this.transitionRoot(n),this.transitionRoot("dragStart",i))},...Object.fromEntries(Object.entries(ha).map(([t,i])=>[t,i.dragState(e,n)]))},translating:{onEnter:()=>{},translate:{guard:h,target:"translating",action:({translation:t})=>{e.startInteracting(),e.translate(this.active,t),e.update()}},translateEnd:{guard:h,target:"idle"},onExit:()=>{e.stopInteracting(),e.update(),e.recordAction("Translate annotation")}},"text-input":{onEnter:()=>{if(null==this.active)return;const t=ua(this.datum);t&&"getTextInputCoords"in t&&(e.startInteracting(),e.showTextInput(this.active),t.visible=!1,e.update())},updateTextInputBBox:{guard:h,action:a},resize:{target:"idle",action:l},click:{target:"idle",action:l},drag:{target:"idle",action:l},textInput:[{guard:js,target:"idle",action:c},{guard:$s,target:"idle",action:l}],color:{guard:h,action:r},fontSize:{guard:h,action:o},cancel:{target:"idle",action:c},onExit:()=>{e.stopInteracting(),e.hideTextInput();const t=this.active;if(this.active=this.hovered=void 0,e.select(this.active,t),null==t)return;const i=e.datum(t),n=e.node(t);i&&n&&(i.visible=!0)}}}),this.setActive=t,this.debug=ma.create(!0,"annotations"),this.snapping=!1}};a([da({changeValue(e){this.setActive(e)}}),fa()],Ca.prototype,"active",2),a([fa()],Ca.prototype,"hovered",2),a([fa()],Ca.prototype,"hoverCoords",2),a([fa()],Ca.prototype,"copied",2),a([fa()],Ca.prototype,"snapping",2),a([fa()],Ca.prototype,"datum",2),a([fa()],Ca.prototype,"node",2);var{ActionOnSet:wa,LayoutElement:Sa,Menu:xa,PropertiesArray:Ea,ToolbarButtonProperties:Aa,Property:Ma,ChartAxisDirection:Ta}=n.n1,Da=class extends Aa{};a([Ma],Da.prototype,"value",2);var Ia=class extends n.n1.BaseProperties{constructor(e){super(),this.ctx=e,this.enabled=!0,this.padding=20,this.buttons=new Ea(Da),this.events=new n.n1.Listeners,this.annotationMenu=new xa(this.ctx,"annotations"),this.destroyFns=[],this.toolbar=e.sharedToolbar.getSharedToolbar("annotations");const t=this.onKeyDown.bind(this);this.toolbar.addListener("keydown",t),this.destroyFns.push(this.toolbar.addToolbarListener("button-pressed",this.onToolbarButtonPress.bind(this)),e.layoutManager.registerElement(Sa.ToolbarLeft,this.onLayoutStart.bind(this)),()=>{this.toolbar.removeListener("keydown",t),this.toolbar.destroy()})}destroy(){for(const e of this.destroyFns)e()}addListener(e,t){return this.events.addListener(e,t)}toggleVisibility(e){this.toolbar.setHidden(!e)}toggleClearButtonEnabled(e){const t=this.buttons.findIndex(e=>"clear"===e.value);this.toolbar.toggleButtonEnabledByIndex(t,e)}resetButtonIcons(){for(const[e,t]of this.buttons.entries())switch(t.value){case"line-menu":this.updateButtonByIndex(e,{icon:"trend-line-drawing",value:"line-menu"});break;case"fibonacci-menu":this.updateButtonByIndex(e,{icon:"fibonacci-retracement-drawing",value:"fibonacci-menu"});break;case"text-menu":this.updateButtonByIndex(e,{icon:"text-annotation",value:"text-menu"});break;case"shape-menu":this.updateButtonByIndex(e,{icon:"arrow-drawing",value:"shape-menu"});break;case"measurer-menu":this.updateButtonByIndex(e,{icon:"measurer-drawing",value:"measurer-menu"})}}hideOverlays(){this.annotationMenu.hide()}clearActiveButton(){this.toolbar.clearActiveButton()}dispatch(e,t){this.events.dispatch(e,t)}onLayoutStart(e){this.enabled&&(this.toolbar.updateButtons(this.buttons),this.toolbar.layout(e.layoutBox,this.padding))}refreshButtonsEnabled(e){for(const[t,i]of this.buttons.entries())i&&this.toolbar.toggleButtonEnabledByIndex(t,e)}onToolbarButtonPress({event:e,button:t,buttonBounds:i}){const n=this.ctx.axisManager.getAxisContext(Ta.Y)[0].scale;switch(t.value){case"clear":this.dispatch("pressed-clear");break;case"line-menu":this.onToolbarButtonPressShowMenu(e,i,t.value,"toolbarAnnotationsLineAnnotations",En.filter(e=>!e.visible||e.visible(n)));break;case"fibonacci-menu":this.onToolbarButtonPressShowMenu(e,i,t.value,"toolbarAnnotationsFibonacciAnnotations",An);break;case"text-menu":this.onToolbarButtonPressShowMenu(e,i,t.value,"toolbarAnnotationsTextAnnotations",Tn);break;case"shape-menu":this.onToolbarButtonPressShowMenu(e,i,t.value,"toolbarAnnotationsShapeAnnotations",Dn);break;case"measurer-menu":this.onToolbarButtonPressShowMenu(e,i,t.value,"toolbarAnnotationsMeasurerAnnotations",In)}}onToolbarButtonPressShowMenu(e,t,i,n,s){this.dispatch("pressed-show-menu");const r=this.buttons.findIndex(e=>e.value===i);this.toolbar.toggleActiveButtonByIndex(r),this.annotationMenu.setAnchor({x:t.x+t.width+6,y:t.y}),this.annotationMenu.show({items:s,ariaLabel:this.ctx.localeManager.t(n),class:"ag-charts-annotations__toolbar-menu",sourceEvent:e.sourceEvent,onPress:this.onButtonPressMenuCreateAnnotation.bind(this,i)})}onButtonPressMenuCreateAnnotation(e,t){const i=this.buttons.findIndex(t=>t.value===e);this.updateButtonByIndex(i,{icon:t.icon}),this.dispatch("pressed-create-annotation",{annotation:t.value}),this.annotationMenu.hide()}onKeyDown({sourceEvent:e}){"Escape"===e.key&&this.dispatch("cancel-create-annotation")}updateButtonByIndex(e,t){const i=this.buttons.at(e);i&&(i.set({...i.toJson(),...t,value:t.value??i.value}),this.toolbar.updateButtonByIndex(e,{...i.toJson()}))}};a([Ma,wa({changeValue(e){this.toolbar?.setHidden(!e)}})],Ia.prototype,"enabled",2),a([Ma],Ia.prototype,"padding",2),a([Ma],Ia.prototype,"buttons",2);var{BaseModuleInstance:Ra,InteractionState:ka,Property:Pa,ChartAxisDirection:_a,getIconClassNames:La}=n.n1,Na="ag-charts-annotations__axis-button",Oa=class extends Ra{constructor(e,t,i,n){super(),this.ctx=e,this.axisCtx=t,this.onButtonClick=i,this.seriesRect=n,this.enabled=!0,this.snap=!1,this.padding=0,this.button=this.setup(),this.toggleVisibility(!1),this.updateButtonElement(),this.snap=Boolean(t.scale.bandwidth),e.domManager.addEventListener("focusin",({target:t})=>{const i=t instanceof HTMLElement?t:void 0;i&&e.domManager.contains(i,"series-area")||i===this.button.getElement()||this.hide()}),this.destroyFns.push(e.widgets.seriesWidget.addListener("drag-move",e=>this.onMouseDrag(e)),e.widgets.seriesWidget.addListener("mousemove",e=>this.onMouseMove(e)),e.widgets.seriesWidget.addListener("mouseleave",()=>this.onMouseLeave()),e.widgets.seriesDragInterpreter.addListener("click",e=>this.onClick(e)),e.chartEventManager.addListener("series-focus-change",()=>this.onKeyPress()),e.zoomManager.addListener("zoom-pan-start",()=>this.hide()),e.zoomManager.addListener("zoom-change",()=>this.hide()),()=>this.destroyElements(),()=>this.button.destroy())}update(e,t){this.seriesRect=e,this.padding=t}setup(){const e=new n.uB.ButtonWidget;return e.addClass(Na),e.setTabIndex(-1),e.setAriaLabel(this.ctx.localeManager.t("ariaLabelAddHorizontalLine")),this.ctx.widgets.seriesWidget.getElement().appendChild(e.getElement()),e}destroyElements(){this.ctx.domManager.removeChild("canvas-overlay",Na)}onMouseMove(e){this.ctx.interactionManager.isState(ka.Clickable)&&this.show(e)}onMouseDrag(e){this.ctx.interactionManager.isState(ka.AnnotationsMoveable)&&this.show(e)}onMouseLeave(){this.ctx.interactionManager.isState(ka.Clickable)&&this.hide()}onClick(e){this.ctx.interactionManager.isState(ka.Clickable)&&"touch"===e.device&&this.show(e)}show(e){const{sourceEvent:t,currentX:i,currentY:n}=e;if(!this.enabled||!this.ctx.widgets.seriesWidget.getElement().contains(t.target))return void this.hide();this.toggleVisibility(!0);const s=this.getButtonCoordinates({x:i,y:n});this.coords={x:s.x+this.button.clientWidth/2,y:s.y+this.button.clientHeight/2},this.updatePosition(s)}hide(){this.toggleVisibility(!1)}onKeyPress(){this.snap&&this.ctx.interactionManager.isState(ka.Default)||this.hide()}getButtonCoordinates({x:e,y:t}){const{axisCtx:{direction:i,position:n},seriesRect:s,snap:r,axisCtx:o,padding:a}=this,{clientWidth:l,clientHeight:c}=this.button,[h,u]=[0,s.height],[d,p]=[0,s.width];if(r&&(e=Bt(Ht(e-s.x,o),o)+s.x,t=Bt(Ht(t-s.y,o),o)+s.y),i===_a.X){const i=5,s=c-Math.max(0,a-i);e-=l/2,t="top"===n?h-c+s:u-s}else{const i=9,s=l-Math.max(0,a-i);e="left"===n?d-l+s:p-s,t-=c/2}return{x:e,y:t}}toggleVisibility(e){const{button:t}=this;if(null==t)return;const i=this.enabled&&e;this.toggleClass("-hidden",!i)}toggleClass(e,t){this.button.toggleClass(`${Na}-${e}`,t)}updatePosition({x:e,y:t}){this.button.getElement().style.transform=`translate(${Math.round(e)}px, ${Math.round(t)}px)`}updateButtonElement(){const{button:e}=this;e.addListener("click",()=>this.onButtonClick(this.coords)),e.addListener("touchend",()=>this.onButtonClick(this.coords)),e.addListener("drag-start",()=>{}),e.setInnerHTML(`<span class="${La("zoom-in")} ${Na}-icon"></span>`)}};a([Pa],Oa.prototype,"enabled",2);var{Color:Fa,DraggablePopover:Ga,NativeWidget:Ba,Vec2:Va,createButton:Ha,createCheckbox:Ua,createSelect:za,createTextArea:Wa,initRovingTabIndex:ja,getIconClassNames:$a,mapValues:Ka}=n.n1,Ya=class e extends Ga{constructor(e,t){super(e,t),this.dragHandleDraggingClass="ag-charts-dialog__drag-handle--dragging",this.colorPicker=new Sn(this.ctx,{detached:!0}),this.destroyFns.push(e.layoutManager.addListener("layout:complete",this.onLayoutComplete.bind(this)))}showWithChildren(e,t){const i=super.showWithChildren(e,t);return i.classList.add("ag-charts-dialog"),i.setAttribute("role","dialog"),i.addEventListener("mousedown",e=>{e.target.classList?.contains("ag-charts-dialog__color-picker-button")||this.colorPicker.hide()}),i.addEventListener("keydown",this.onKeyDown.bind(this)),(0,s.zk)().requestAnimationFrame(()=>this.reposition()),this.colorPicker.attachTo(this),i}updatePosition(e){super.updatePosition(e);const{anchor:t,fallbackAnchor:i}=this.getColorPickerAnchors()??{};t&&this.colorPicker.setAnchor(t,i)}createTabs(e,t,i){const n=(0,s.n)("div","ag-charts-dialog__tabs"),r=Ka(i,()=>(0,s.wW)()),o=Ka(i,()=>(0,s.wW)());for(const[e,t]of(0,s.jO)(i))(0,s.Wp)(t.panel,{id:o[e],role:"tabpanel","aria-labelledby":r[e]});const a=e=>{for(const[t,n]of(0,s.jO)(i))n.panel.classList.toggle("ag-charts-dialog__tab-panel--active",t===e),h[t].classList.toggle("ag-charts-dialog__tab-button--active",t===e),(0,s.Bq)(h[t],"aria-selected",t===e),t===e&&n.onShow?.()},l=new Ba((0,s.n)("div","ag-charts-dialog__header"));l.addListener("drag-start",e=>{const{sourceEvent:t}=e;t.target instanceof Element&&t.target.classList.contains("ag-charts-dialog__header")&&this.onDragStart(e)}),l.addListener("drag-move",e=>this.onDragMove(e)),l.addListener("drag-end",()=>this.onDragEnd());const c=new Xa;this.setDragHandle(c);const h=Ka(i,(e,t)=>Ha({label:this.ctx.localeManager.t(e.label),onPress:()=>a(t)},{id:r[t],class:"ag-charts-dialog__tab-button",role:"tab","aria-controls":o[t]})),u=(0,s.n)("div","ag-charts-dialog__tab-list");(0,s.Wp)(u,{role:"tablist","aria-label":this.ctx.localeManager.t(e)}),u.append(...Object.values(h));const d=this.createHeaderCloseButton();return l.getElement().append(c.getElement(),u,d),n.append(l.getElement(),...Object.values(i).map(e=>e.panel)),a(t),ja({orientation:"horizontal",buttons:Object.values(h)}),{tabs:n,initialFocus:h[t]}}createTabPanel(){return(0,s.n)("div","ag-charts-dialog__tab-panel")}createInputGroupLine(){return(0,s.n)("div","ag-charts-dialog__input-group-line")}createRadioGroup({label:e,options:t,value:i,onChange:n}){const r=this.createInputGroup(e);(0,s.Wp)(r,{role:"radiogroup",tabindex:-1,"aria-label":this.ctx.localeManager.t(e)});const o="ag-charts-dialog__button--active",a=[];for(const e of t){const{icon:t,altText:s}=e,l=this.ctx.localeManager.t(s),c=Ha({icon:t,altText:l,onPress:()=>{for(const e of Array.from(r.children))e.classList.remove(o),e.ariaChecked="false";c.classList.add(o),c.ariaChecked="true",n(e.value)}},{"aria-checked":e.value===i,class:"ag-charts-dialog__button",role:"radio",title:l});e.value===i&&c.classList.add(o),r.appendChild(c),a.push(c)}return ja({orientation:"horizontal",buttons:a}),r}createSelect({altText:e,label:t,options:i,value:n,onChange:s}){const r=this.createInputGroup(t),o=this.ctx.localeManager.t(e),a=za({value:n,options:i,onChange:s},{class:"ag-charts-dialog__select","aria-label":o,title:o});return r.append(a),r}createTextArea({placeholder:e,value:t,onChange:i}){const n=e?this.ctx.localeManager.t(e):void 0;return Wa({value:t,onChange:i},{placeholder:n})}createCheckbox({label:e,checked:t,onChange:i}){const n=(0,s.wW)(),r=this.createInputGroup(e,{for:n}),o=Ua({checked:t,onChange:i},{class:"ag-charts-dialog__checkbox",role:"switch",id:n});return r.append(o),r}createColorPicker({color:e,opacity:t,label:i,altText:n,onChange:s,onChangeHide:r,isMultiColor:o,hasMultiColorOption:a}){const l=this.createInputGroup(i),c=this.ctx.localeManager.t(n),h=Ha({label:c,onPress:i=>{const{anchor:n,fallbackAnchor:l}=this.getColorPickerAnchors(h)??{};this.colorPicker.show({anchor:n,fallbackAnchor:l,color:e,opacity:t,isMultiColor:o,hasMultiColorOption:a,sourceEvent:i,onChange:(e,t,i,n)=>{h.style.setProperty("--color",e),h.classList.toggle("ag-charts-dialog__color-picker-button--multi-color",n),s(e,t,i,n)},onChangeHide:r})}},{"aria-label":c,tabindex:0,class:"ag-charts-dialog__color-picker-button",title:c});if(o)h.classList.toggle("ag-charts-dialog__color-picker-button--multi-color");else if(e){const i=Fa.fromString(e),n=new Fa(i.r,i.g,i.b,t);h.style.setProperty("--color",n.toHexString())}return l.append(h),this.hideFns.push(()=>{this.colorPicker.hide()}),l}createHeaderCloseButton(){return Ha({icon:"close",altText:this.ctx.localeManager.t("iconAltTextClose"),onPress:()=>this.hide()},{class:"ag-charts-dialog__close-button"})}createInputGroup(e,t){const i=(0,s.n)("div","ag-charts-dialog__input-group"),n=(0,s.n)("label","ag-charts-dialog__input-group-label");return n.innerText=this.ctx.localeManager.t(e),(0,s.Bq)(n,"for",t?.for),i.appendChild(n),i}onLayoutComplete(e){this.seriesRect=e.series.paddedRect,this.reposition()}onKeyDown(e){e.altKey||e.ctrlKey||e.metaKey||e.isComposing||"Escape"!==e.key||this.hide()}reposition(){const{seriesRect:t,ctx:i}=this,n=i.domManager.getBoundingClientRect(),s=this.getPopoverElement();if(!t||!s)return;const r=Va.from(0,t.y),o=Va.from(n.width,t.height),a=Va.from(s),l=Va.from(.5,1);let c;if(t.width>1e3){const t=Va.sub(Va.add(r,Va.multiply(o,l)),Va.multiply(a,l));c=Va.sub(t,Va.from(0,e.offset))}else{const t=Va.sub(Va.add(r,o),a);c=Va.sub(t,e.offset)}this.updatePosition(c)}getColorPickerAnchors(e){if(e&&(this.colorPickerAnchorElement=e),!this.colorPickerAnchorElement)return;const t=this.colorPickerAnchorElement.getBoundingClientRect(),i=this.ctx.domManager.getBoundingClientRect(),n=Va.sub(Va.from(t.x,t.y),Va.from(i.left,i.top));return{anchor:Va.add(n,Va.from(0,t.height+5)),fallbackAnchor:Va.sub(n,Va.from(0,5))}}};Ya.offset=60;var qa=Ya,Xa=class extends Ba{constructor(){super((0,s.n)("div","ag-charts-dialog__drag-handle"));const e=new Ba((0,s.n)("span",$a("drag-handle")));e.setAriaHidden(!0),this.addChild(e)}},{Listeners:Za,focusCursorAtEnd:Qa}=n.n1,Ja=class extends qa{constructor(e){super(e,"settings"),this.events=new Za,this.hideFns.push(()=>this.events.dispatch("hidden"))}addListener(e,t){return this.events.addListener(e,t)}show(e,t){const i=this.createLinearLineTab(e,t),n=this.createLinearTextTab(e,t);let s="dialogHeaderLine";rn(e)?s="dialogHeaderChannel":on(e)?s="dialogHeaderFibonacciRange":"date-range"===e.type?s="dialogHeaderDateRange":"price-range"===e.type?s="dialogHeaderPriceRange":"date-price-range"===e.type&&(s="dialogHeaderDatePriceRange");const{tabs:r,initialFocus:o}=this.createTabs("ariaLabelSettingsTabBar",t.initialSelectedTab,{line:{label:s,panel:i},text:{label:"dialogHeaderText",panel:n.panel,onShow:n.onShow}});t.initialFocus=o,this.showWithChildren([r],t).classList.add("ag-charts-dialog--annotation-settings")}createLinearLineTab(e,t){const i=this.createTabPanel(),n=this.createInputGroupLine(),s=this.createInputGroupLine(),r="isMultiColor"in e,o=this.createColorPickerInput("line-color",e.getDefaultColor("line-color"),e.getDefaultOpacity("line-color"),!!r&&e.isMultiColor,r,t.onChangeLineColor,t.onChangeHideLineColor),a=this.createStrokeWidthSelect(e.strokeWidth??2,t.onChangeLineStyleWidth),l=this.createLineStyleRadioGroup(e.lineStyle??"solid",t.onChangeLineStyleType);if(n.append(o),"background"in e){const i=this.createColorPickerInput("fill-color",e.getDefaultColor("fill-color"),e.getDefaultOpacity("fill-color"),!1,!1,t.onChangeFillColor,t.onChangeHideFillColor);n.append(i),s.append(a)}else"showFill"in e?(n.append(this.createCheckbox({label:"dialogInputShowFill",checked:e.showFill??!0,onChange:e=>t.onChangeLine({showFill:e})})),s.append(a)):n.append(a);return s.append(l),i.append(n,s),"bands"in e&&i.append(this.createFibonacciRatioSelect(e.bands??10,e=>t.onChangeLine({bands:e}))),"extendStart"in e&&"extendEnd"in e&&i.append(this.createCheckbox({label:rn(e)?"dialogInputExtendChannelStart":"dialogInputExtendLineStart",checked:e.extendStart??!1,onChange:e=>t.onChangeLine({extendStart:e})}),this.createCheckbox({label:rn(e)?"dialogInputExtendChannelEnd":"dialogInputExtendLineEnd",checked:e.extendEnd??!1,onChange:e=>t.onChangeLine({extendEnd:e})})),"extendAbove"in e&&"extendBelow"in e&&i.append(this.createCheckbox({label:"dialogInputExtendAbove",checked:e.extendAbove??!1,onChange:e=>t.onChangeLine({extendAbove:e})}),this.createCheckbox({label:"dialogInputExtendBelow",checked:e.extendBelow??!1,onChange:e=>t.onChangeLine({extendBelow:e})})),"extendLeft"in e&&"extendRight"in e&&i.append(this.createCheckbox({label:"dialogInputExtendLeft",checked:e.extendLeft??!1,onChange:e=>t.onChangeLine({extendLeft:e})}),this.createCheckbox({label:"dialogInputExtendRight",checked:e.extendRight??!1,onChange:e=>t.onChangeLine({extendRight:e})})),"reverse"in e&&"showFill"in e&&i.append(this.createCheckbox({label:"dialogInputReverse",checked:e.reverse??!1,onChange:e=>t.onChangeLine({reverse:e})})),i}createLinearTextTab(e,t){const i=this.createTabPanel(),n=this.createTextArea({placeholder:"inputTextareaPlaceholder",value:e.text.label,onChange:e=>t.onChangeText({label:e})}),s=this.createFontSizeSelect(e.text.fontSize,t.onChangeTextFontSize),r=this.createColorPickerInput("text-color",e.text.color,1,!1,!1,t.onChangeTextColor,t.onChangeHideTextColor),o="inside"===e.text.position?"center":e.text.position,a=this.createPositionRadioGroup(o??"top",e=>t.onChangeText({position:e})),l=this.createAlignmentRadioGroup(e.text.alignment??"center",e=>t.onChangeText({alignment:e})),c=this.createInputGroupLine();return c.append(s,r,a,l),i.append(n,c),{panel:i,onShow:()=>Qa(n)}}createColorPickerInput(e,t,i,n,s,r,o){const a="fill-color"===e?"dialogInputFillColorPicker":"dialogInputColorPicker",l="fill-color"===e?"dialogInputFillColorPickerAltText":"dialogInputColorPickerAltText";return this.createColorPicker({label:a,altText:l,color:t,opacity:i,isMultiColor:n,hasMultiColorOption:s,onChange:r,onChangeHide:o})}createStrokeWidthSelect(e,t){return this.createSelect({label:"dialogInputStrokeWidth",altText:"dialogInputStrokeWidthAltText",options:Rn.map(({label:e,value:t})=>({label:e,value:`${t}`})),value:String(e),onChange:e=>t(Number(e))})}createFibonacciRatioSelect(e,t){return this.createSelect({label:"dialogInputFibonacciBands",altText:"dialogInputFibonacciBandsAltText",options:Mn.map(({label:e,value:t})=>({label:e,value:`${t}`})),value:String(e),onChange:e=>t(Number(e))})}createLineStyleRadioGroup(e,t){return this.createRadioGroup({label:"dialogInputLineStyle",options:[{icon:"line-style-solid",altText:"iconAltTextLineStyleSolid",value:"solid"},{icon:"line-style-dashed",altText:"iconAltTextLineStyleDashed",value:"dashed"},{icon:"line-style-dotted",altText:"iconAltTextLineStyleDotted",value:"dotted"}],value:e,onChange:t})}createFontSizeSelect(e,t){return this.createSelect({label:"dialogInputFontSize",altText:"dialogInputFontSizeAltText",options:Pn.map(({label:e,value:t})=>({label:e,value:String(t)})),value:String(e),onChange:e=>t(Number(e))})}createPositionRadioGroup(e,t){return this.createRadioGroup({label:"dialogInputPosition",options:[{icon:"position-top",altText:"iconAltTextPositionTop",value:"top"},{icon:"position-center",altText:"iconAltTextPositionCenter",value:"center"},{icon:"position-bottom",altText:"iconAltTextPositionBottom",value:"bottom"}],value:e,onChange:t})}createAlignmentRadioGroup(e,t){return this.createRadioGroup({label:"dialogInputAlign",options:[{icon:"align-left",altText:"iconAltTextAlignLeft",value:"left"},{icon:"align-center",altText:"iconAltTextAlignCenter",value:"center"},{icon:"align-right",altText:"iconAltTextAlignRight",value:"right"}],value:e,onChange:t})}};function el(e){return e.gridPadding+e.seriesAreaPadding+e.tickSize+e.label.spacing}var{ChartUpdateType:tl,InteractionState:il,ObserveChanges:nl,PropertiesArray:sl,Property:rl,ChartAxisDirection:ol,Vec2:al,keyProperty:ll,valueProperty:cl,Selection:hl,BBox:ul}=n.n1,dl=class e extends n.n1.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.enabled=!0,this.toolbar=new Ia(this.ctx),this.optionsToolbar=new Wn(this.ctx,()=>{const e=this.state.getActive();if(null!=e)return ua(this.annotationData.at(e))}),this.axesButtons=new ot,this.snap=!1,this.data=void 0,this.xKey=void 0,this.volumeKey=void 0,this.annotationData=new sl(e.createAnnotationDatum),this.defaults=new bn,this.container=new n.n1.Group({name:"static-annotations"}),this.annotations=new hl(this.container,this.createAnnotationScene.bind(this)),this.settingsDialog=new Ja(this.ctx),this.textInput=new nt(this.ctx),this.postUpdateFns=[],this.state=this.setupStateMachine(),this.setupListeners(),this.setupDOM(),this.ctx.historyManager.addMementoOriginator(t.annotationManager),this.ctx.historyManager.addMementoOriginator(this.defaults),this.textInput.setKeyDownHandler(this.onTextInput.bind(this))}setupStateMachine(){const{ctx:e}=this;return new ya({resetToIdle:()=>{e.domManager.updateCursor("annotations"),this.popAnnotationState(il.Annotations),this.hideOverlays(),this.optionsToolbar.hide(),this.deleteEphemeralAnnotations(),this.update()},hoverAtCoords:(t,i,n)=>{let s;return this.annotations.each((e,n,r)=>{const o=e.containsPoint(t.x,t.y);o&&(s??(s=r)),e.toggleHovered(o||i===r)}),null!=s?e.tooltipManager.suppressTooltip("annotations"):this.isAnnotationState()||e.tooltipManager.unsuppressTooltip("annotations"),this.ctx.domManager.updateCursor("annotations",null==s?void 0:this.annotations.at(s)?.getCursor()),s!==n&&this.update(),s},getNodeAtCoords:(e,t)=>{const i=this.annotations.at(t);if(i)return i.getNodeAtCoords(e.x,e.y)},translate:(e,t)=>{const i=this.annotations.at(e),n=ua(this.annotationData.at(e));if(i&&n)return this.translateNode(i,n,t)},copy:e=>{const t=this.annotations.at(e),i=ua(this.annotationData.at(e));if(t&&i)return this.createAnnotationDatumCopy(t,i)},paste:e=>{this.createAnnotation(e.type,e,!1),this.postUpdateFns.push(()=>{this.state.transitionAsync("selectLast"),this.state.transitionAsync("copy")})},select:(e,t)=>{const{annotations:i,optionsToolbar:n,toolbar:s}=this;this.hideOverlays(),s.clearActiveButton(),s.resetButtonIcons();const r=null!=e?i.at(e):null,o=null!=t?i.at(t):null;o===r&&null!=r||(o?.toggleActive(!1),n.hide(),r?(this.pushAnnotationState(il.AnnotationsSelected),r.toggleActive(!0),n.updateButtons(this.annotationData.at(e)),this.postUpdateFns.push(()=>{n.show(),n.setAnchorScene(r)})):(this.popAnnotationState(il.AnnotationsSelected),this.popAnnotationState(il.Annotations)),this.deleteEphemeralAnnotations(),this.update())},selectLast:()=>(this.pushAnnotationState(il.AnnotationsSelected),this.annotationData.length-1),startInteracting:()=>{this.pushAnnotationState(il.Annotations)},stopInteracting:()=>{this.popAnnotationState(il.Annotations)},create:(e,t)=>{this.createAnnotation(e,t)},delete:e=>{this.annotationData.splice(e,1)},deleteAll:()=>{this.annotationData.splice(0,this.annotationData.length)},validatePoint:(e,t)=>{const i=this.getAnnotationContext();return!i||Yr(i,e,t)},getAnnotationType:e=>function(e){for(const t of lt)if(t===e)return t}(this.annotationData[e].type),datum:e=>this.annotationData.at(e),node:e=>this.annotations.at(e),recordAction:e=>{this.recordActionAfterNextUpdate(e)},update:()=>{this.postUpdateFns.push(()=>{const e=this.state.getActive(),t=null!=e?this.annotations.at(e):null;null!=t&&this.optionsToolbar.setAnchorScene(t)}),this.update()},showTextInput:e=>{const t=ua(this.annotationData.at(e));if(!(this.annotations.at(e)&&t&&"getTextInputCoords"in t&&"getTextPosition"in t))return;const i={color:t.color,fontFamily:t.fontFamily,fontSize:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight,placeholderColor:t.getPlaceholderColor()},n=this.getAnnotationContext();this.textInput.show({styles:i,layout:{getTextInputCoords:e=>al.add(t.getTextInputCoords(n,e),al.required(this.seriesRect)),getTextPosition:()=>t.getTextPosition(),alignment:t.alignment,textAlign:t.textAlign,width:t.width},text:t.text,placeholderText:t.placeholderText,onChange:(e,t)=>{this.state.transition("updateTextInputBBox",t)}}),this.ctx.domManager.updateCursor("annotations")},hideTextInput:()=>{this.textInput.hide()},updateTextInputColor:e=>{this.textInput.updateColor(e)},updateTextInputFontSize:e=>{const t=this.textInput.updateFontSize(e);this.state.transition("updateTextInputBBox",t)},updateTextInputBBox:e=>{this.state.transition("updateTextInputBBox",e)},showAnnotationOptions:e=>{const t=this.annotations.at(e);t&&!nn(this.annotationData.at(e))&&(this.optionsToolbar.updateButtons(this.annotationData.at(e)),this.optionsToolbar.show(),this.optionsToolbar.setAnchorScene(t))},showAnnotationSettings:(e,t,i="line")=>{const n=this.annotationData.at(e);if(!sn(n)&&!rn(n)&&!ln(n))return;if(nn(n))return;const s=e=>(t,i,s,r)=>{this.setColorAndDefault(n.type,e,t,i,s,r),this.optionsToolbar.updateColorPickerColor(e,i,s,r)},r=e=>()=>{this.recordActionAfterNextUpdate(`Change ${n.type} ${e} to ${n.getDefaultColor(e)}`,["annotations","defaults"]),this.update()},o={initialSelectedTab:i,ariaLabel:this.ctx.localeManager.t("ariaLabelAnnotationSettingsDialog"),sourceEvent:t,onChangeLine:e=>{this.state.transition("lineProps",e),null!=e.bands&&this.defaults.setDefaultFibonacciOptions(n.type,"bands",e.bands),null!=e.reverse&&this.defaults.setDefaultFibonacciOptions(n.type,"reverse",e.reverse),null!=e.showFill&&this.defaults.setDefaultFibonacciOptions(n.type,"showFill",e.showFill)},onChangeText:e=>{this.state.transition("lineText",e),e.alignment&&this.defaults.setDefaultLineTextAlignment(n.type,e.alignment),e.position&&this.defaults.setDefaultLineTextPosition(n.type,e.position),this.recordActionAfterNextUpdate(`Change ${n.type} text ${Object.keys(e).map(t=>`${t} to ${e[t]}`).join(", ")}`)},onChangeFillColor:s("fill-color"),onChangeHideFillColor:r("fill-color"),onChangeLineColor:s("line-color"),onChangeHideLineColor:r("line-color"),onChangeLineStyleType:e=>{this.setLineStyleTypeAndDefault(n.type,e),this.optionsToolbar.updateLineStyleType(kn.find(t=>t.value===e)??kn[0])},onChangeLineStyleWidth:e=>{this.setLineStyleWidthAndDefault(n.type,e),this.optionsToolbar.updateStrokeWidth({strokeWidth:e,value:e,label:String(e)})},onChangeTextColor:s("text-color"),onChangeHideTextColor:r("text-color"),onChangeTextFontSize:e=>{this.setFontSizeAndDefault(n.type,e)}};this.settingsDialog.show(n,o)}})}setupListeners(){const{ctx:e,optionsToolbar:t,settingsDialog:i,toolbar:n}=this,{seriesWidget:s,seriesDragInterpreter:r,chartWidget:o}=e.widgets;this.destroyFns.push(r.addListener("click",this.hoverTouchPreHandler.bind(this)),r.addListener("drag-start",this.hoverTouchPreHandler.bind(this)),r.addListener("drag-move",this.dragMoveTouchPreHandler.bind(this)),r.addListener("mousemove",this.onHover.bind(this)),r.addListener("click",this.onClick.bind(this)),r.addListener("dblclick",this.onDoubleClick.bind(this)),r.addListener("drag-start",this.onDragStart.bind(this)),r.addListener("drag-move",this.onDrag.bind(this)),r.addListener("drag-end",this.onDragEnd.bind(this)),s.addListener("keydown",this.onKeyDown.bind(this)),s.addListener("keyup",this.onKeyUp.bind(this)),o.addListener("click",this.onCancel.bind(this)),e.annotationManager.addListener("restore-annotations",this.onRestoreAnnotations.bind(this)),e.layoutManager.addListener("layout:complete",this.onLayoutComplete.bind(this)),e.updateService.addListener("pre-scene-render",this.onPreRender.bind(this)),e.zoomManager.addListener("zoom-change",()=>this.onResize()),e.domManager.addListener("resize",()=>this.onResize()),n.addListener("cancel-create-annotation",()=>{this.cancel(),this.reset(),this.update()}),n.addListener("pressed-create-annotation",({annotation:e})=>{this.cancel(),this.pushAnnotationState(il.Annotations),this.state.transition(e),this.update()}),n.addListener("pressed-clear",()=>{this.clear(),this.recordActionAfterNextUpdate("Clear all")}),n.addListener("pressed-show-menu",()=>{this.cancel(),this.reset()}),n.addListener("pressed-unrelated",()=>{this.reset()}),t.addListener("pressed-delete",()=>{this.cancel(),this.delete(),this.reset()}),t.addListener("pressed-settings",({sourceEvent:e})=>{this.state.transition("toolbarPressSettings",e)}),t.addListener("pressed-lock",()=>{this.update()}),t.addListener("hid-overlays",()=>{this.settingsDialog.hide()}),t.addListener("saved-color",({type:e,colorPickerType:t,color:i})=>{this.recordActionAfterNextUpdate(`Change ${e} ${t} to ${i}`,["annotations","defaults"])}),t.addListener("updated-color",({type:e,colorPickerType:t,colorOpacity:i,color:n,opacity:s,isMultiColor:r})=>{this.setColorAndDefault(e,t,i,n,s,r)}),t.addListener("updated-font-size",({type:e,fontSize:t})=>{this.setFontSizeAndDefault(e,t)}),t.addListener("updated-line-style",({type:e,lineStyleType:t})=>{this.setLineStyleTypeAndDefault(e,t)}),t.addListener("updated-line-width",({type:e,strokeWidth:t})=>{this.setLineStyleWidthAndDefault(e,t)}),i.addListener("hidden",()=>{this.optionsToolbar.clearActiveButton()}))}setupDOM(){const{ctx:e,toolbar:t}=this;this.destroyFns.push(e.annotationManager.attachNode(this.container),()=>e.domManager.removeStyles(Na),()=>t.destroy())}async processData(e){if(!this.enabled||null==this.data||null==this.xKey||null==this.volumeKey)return;const t=[ll(this.xKey,void 0,{id:"date"}),cl(this.volumeKey,"number",{id:"volume"})],{dataModel:i,processedData:n}=await e.request("annotations",this.data,{props:t});this.dataModel=i,this.processedData=n}createAnnotationScene(e){if(e.type in ha)return new ha[e.type].scene;throw new Error(`AG Charts - Cannot create annotation scene of type [${e.type}], expected one of [${Object.keys(ha)}], ignoring.`)}static createAnnotationDatum(e){if(e.type in ha)return(new ha[e.type].datum).set(e);throw new Error(`AG Charts - Cannot create annotation datum of unknown type [${e.type}], expected one of [${Object.keys(ha)}], ignoring.`)}createAnnotation(e,t,i=!0){if(this.annotationData.push(t),i){const i=this.ctx.annotationManager.getAnnotationTypeStyles(e);i&&t.set(i),this.defaults.applyDefaults(t)}this.injectDatumDependencies(t),this.update()}injectDatumDependencies(e){"setLocaleManager"in e&&e.setLocaleManager(this.ctx.localeManager),"getVolume"in e&&(e.getVolume=this.getDatumRangeVolume.bind(this))}getDatumRangeVolume(e,t){const{dataModel:i,processedData:n}=this;let r=Nt(e),o=Nt(t);if(!((0,s.vd)(r)&&(0,s.vd)(o)&&i&&n&&null!=this.volumeKey))return;r>o&&([r,o]=[o,r]);const a=i.resolveKeysById({id:"annotations"},"date",n),l=i.resolveColumnById({id:"annotations"},"volume",n);let c=0;for(let e=0;e<n.input.count;e++){const t=a[e];(0,s.vd)(t)&&t>=r&&t<=o&&(c+=l[e])}return c}translateNode(e,t,i){const n=this.getAnnotationConfig(t),s=this.getAnnotationContext();s&&n.translate(e,t,i,s)}createAnnotationDatumCopy(e,t){const i=this.getAnnotationConfig(t),n=new i.datum;n.set(t.toJson());const s=this.getAnnotationContext();if(s)return i.copy(e,t,n,s)}getAnnotationConfig(e){if(e.type in ha)return ha[e.type];throw new Error(`AG Charts - Cannot get annotation config of unknown type [${e.type}], expected one of [${Object.keys(ha)}], ignoring.`)}onRestoreAnnotations(e){this.enabled&&(this.clear(),this.annotationData.set(e.annotations),this.postUpdateFns.push(()=>{this.ctx.annotationManager.fireChangedEvent()}),this.update())}onLayoutComplete(e){const t=e.series.paddedRect;this.seriesRect=t,this.container.setClipRect(t);for(const i of e.axes??[])i.direction===n.n1.ChartAxisDirection.X?this.xAxis=this.getAxis(i,t,this.xAxis?.button):this.yAxis=this.getAxis(i,t,this.yAxis?.button);this.showAnnotations()?this.animateAnnotations({from:0,to:1,phase:"trailing"}):this.animateAnnotations({from:1,to:0,phase:"remove"})}showAnnotations(){if(!this.yAxis||!this.xAxis)return!1;const e=this.ctx.chartService.series.some(e=>e.hasData),t=this.yAxis.context.seriesIds().some(e=>{const t=this.ctx.chartService.series.find(t=>t.id===e);return t?.visible});return e&&t}animateAnnotations({from:e,to:t,phase:i}){const{annotations:n}=this;this.ctx.animationManager?.animate({from:e,to:t,id:"chart-annotations",phase:i,groupId:"opacity",onUpdate(e){n.each(t=>{t.opacity=e,"setAxisLabelOpacity"in t&&t.setAxisLabelOpacity(e)})},onStop(){n.each(e=>{e.opacity=t,"setAxisLabelOpacity"in e&&e.setAxisLabelOpacity(t)})}})}onPreRender(){this.updateAnnotations(),this.state.transition("render")}getAxis(e,t,i){const n=this.ctx.axisManager.getAxisContext(e.direction)[0],{position:s="bottom",direction:r}=n,o=e.gridPadding+e.seriesAreaPadding,a=new ul(0,0,t.width,t.height).grow(o,s),l=n.direction===ol.X?"vertical":"horizontal",{axesButtons:c,snap:h}=this;if(this.enabled&&c.enabled&&("xy"===c.axes||c.axes===r)){i??(i=new Oa(this.ctx,{...n,snapToGroup:h},e=>this.onAxisButtonClick(e,l),t));const s=el(e);i.update(t,s)}else i?.destroy(),i=void 0;return{layout:e,context:n,bounds:a,button:i}}recordActionAfterNextUpdate(e,t=["annotations"]){const{defaults:i,ctx:{annotationManager:n,historyManager:s}}=this,r=t.map(e=>"defaults"===e?i:n);this.postUpdateFns.push(()=>{s.record(e,...r),n.fireChangedEvent()})}setColorAndDefault(e,t,i,n,s,r){this.state.transition("color",{colorPickerType:t,colorOpacity:i,color:n,opacity:s,isMultiColor:r}),this.defaults.setDefaultColor(e,t,i,n,s,r)}setFontSizeAndDefault(e,t){this.state.transition("fontSize",t),this.defaults.setDefaultFontSize(e,t),this.recordActionAfterNextUpdate(`Change ${e} font size to ${t}`,["annotations","defaults"])}setLineStyleTypeAndDefault(e,t){this.state.transition("lineStyle",{type:t}),this.defaults.setDefaultLineStyleType(e,t),this.recordActionAfterNextUpdate(`Change ${e} line style to ${t}`,["annotations","defaults"])}setLineStyleWidthAndDefault(e,t){this.state.transition("lineStyle",{strokeWidth:t}),this.defaults.setDefaultLineStyleWidth(e,t),this.recordActionAfterNextUpdate(`Change ${e} stroke width to ${t}`,["annotations","defaults"])}updateAnnotations(){const{annotationData:e,annotations:t,seriesRect:i,ctx:{annotationManager:n}}=this,s=this.getAnnotationContext();if(!i||!s)return;n.updateData(e.toJson().filter(e=>!nn(e)));const r=this.showAnnotations();this.toolbar.refreshButtonsEnabled(r),this.toolbar.toggleClearButtonEnabled(e.length>0&&r),t.update(e??[],void 0,e=>e.id).each((e,t)=>{if(!r)return e.visible=!1,void("setAxisLabelVisible"in e&&e.setAxisLabelVisible(!1));"setAxisLabelVisible"in e&&e.setAxisLabelVisible(!0),this.injectDatumDependencies(t),function(e,t,i){for(const{update:n}of Object.values(ha))n(e,t,i)}(e,t,s)}),this.postUpdateFns.forEach(e=>e()),this.postUpdateFns=[]}getAnnotationContext(){const{seriesRect:e,xAxis:t,yAxis:i,snap:n}=this;if(e&&t&&i)return{seriesRect:e,xAxis:{...t.context,bounds:t.bounds,labelPadding:el(t.layout),snapToGroup:n},yAxis:{...i.context,bounds:i.bounds,labelPadding:el(t.layout),snapToGroup:n}}}onHover(e){const{state:t}=this,i=this.getAnnotationContext();if(!i)return;const n=e.sourceEvent.shiftKey,s=al.from(e),r=Vt(s,i);t.transition("hover",{offset:s,point:r,shiftKey:n,context:i})}onClick(e){const{state:t}=this,i=this.getAnnotationContext();if(!i)return;const n=e.sourceEvent.shiftKey,s=Vt(al.from(e),i),r=this.textInput.getValue(),o=this.textInput.getBBox();t.transition("click",{point:s,shiftKey:n,textInputValue:r,bbox:o})}onDoubleClick(e){const{state:t}=this;if(!this.getAnnotationContext())return;const i=al.from(e);t.transition("dblclick",{offset:i})}onAxisButtonClick(e,t){this.cancel(),this.reset();const i=this.getAnnotationContext();if(!this.annotationData||!i)return;const{state:n}=this;this.pushAnnotationState(il.Annotations);const s="horizontal"===t;if(n.transition(s?"horizontal-line":"vertical-line"),this.optionsToolbar.hide(),!e)return;const r=Vt(e,i);Yr(i,r)&&(n.transition("click",{point:r,shiftKey:!1}),this.update())}onResize(){const e=this.textInput.getValue(),t=this.textInput.getBBox();this.state.transition("resize",{textInputValue:e,bbox:t})}hoverTouchPreHandler(e){"touch"===e.device&&this.onHover(e)}dragMoveTouchPreHandler(e){"touch"===e.device&&this.ctx.interactionManager.isState(il.AnnotationsSelected)&&e.sourceEvent.preventDefault()}onDragStart(e){if(!this.ctx.interactionManager.isState(il.AnnotationsDraggable))return;const t=this.getAnnotationContext();if(!t)return;const i=al.from(e),n=Vt(i,t),s=this.textInput.getValue(),r=this.textInput.getBBox();this.state.transition("dragStart",{context:t,offset:i,point:n,textInputValue:s,bbox:r})}onDrag(e){if(!this.ctx.interactionManager.isState(il.AnnotationsDraggable))return;const t=this.getAnnotationContext();if(!t)return;const i=al.from(e),n=Vt(i,t),s=e.sourceEvent.shiftKey,r=this.textInput.getValue(),o=this.textInput.getBBox();this.state.transition("drag",{context:t,offset:i,point:n,shiftKey:s,textInputValue:r,bbox:o})}onDragEnd(){this.state.transition("dragEnd")}onCancel(e){const{sourceEvent:t}=e??{};t?.currentTarget===t?.target&&(this.cancel(),this.reset())}onDelete(){this.textInput.isVisible()||(this.cancel(),this.delete(),this.reset(),this.update())}onTextInput(e){const{state:t}=this,i=this.getAnnotationContext();if(!i)return;const{key:n,shiftKey:s}=e,r=this.textInput.getValue(),o=this.textInput.getBBox();t.transition("textInput",{key:n,shiftKey:s,textInputValue:r,bbox:o,context:i})}onKeyDown(e){const{state:t}=this,i=this.getAnnotationContext();if(!i)return;const{sourceEvent:n}=e,{shiftKey:s,ctrlKey:r,metaKey:o}=n,a=r||o,l=r||s;t.transition("keyDown",{shiftKey:s,context:i});const c={x:0,y:0},h=Math.max(i?.xAxis.scale.bandwidth??0,l?10:1),u=Math.max(i?.yAxis.scale.bandwidth??0,l?10:1);switch(n.key){case"ArrowDown":c.y=u;break;case"ArrowUp":c.y=-u;break;case"ArrowLeft":c.x=-h;break;case"ArrowRight":c.x=h;break;case"Escape":return void this.onCancel();case"Backspace":case"Delete":return void this.onDelete()}if((c.x||c.y)&&(t.transition("translate",{translation:c}),n.stopPropagation(),n.preventDefault()),a)switch(n.key){case"c":return void t.transition("copy");case"x":return t.transition("cut"),void this.recordActionAfterNextUpdate("Cut annotation");case"v":return t.transition("paste"),void this.recordActionAfterNextUpdate("Paste annotation")}}onKeyUp(e){const{shiftKey:t}=e.sourceEvent,i=this.getAnnotationContext();i&&(this.state.transition("keyUp",{shiftKey:t,context:i}),this.state.transition("translateEnd"))}clear(){this.cancel(),this.deleteAll(),this.reset()}reset(){this.state.transition("reset")}cancel(){this.state.transition("cancel")}delete(){this.state.transition("delete")}deleteAll(){this.state.transition("deleteAll")}deleteEphemeralAnnotations(){for(const[e,t]of this.annotationData.entries())nn(t)&&this.annotationData.splice(e,1)}hideOverlays(){this.settingsDialog.hide(),this.toolbar.hideOverlays(),this.optionsToolbar.hideOverlays()}pushAnnotationState(e){this.ctx.interactionManager.pushState(e),this.ctx.tooltipManager.suppressTooltip("annotations")}popAnnotationState(e){this.ctx.interactionManager.popState(e),this.ctx.tooltipManager.unsuppressTooltip("annotations")}isAnnotationState(){return this.ctx.interactionManager.isState(il.Annotations)||this.ctx.interactionManager.isState(il.AnnotationsSelected)}update(e=tl.PRE_SCENE_RENDER){this.ctx.updateService.update(e)}};a([nl((e,t,i)=>{const{ctx:{annotationManager:n,stateManager:s}}=e;t!==i&&(e.toolbar?.toggleVisibility(Boolean(t)),!1===i&&!0===t?s.restoreState(n):!1===t&&e.clear())}),rl],dl.prototype,"enabled",2),a([rl],dl.prototype,"toolbar",2),a([rl],dl.prototype,"optionsToolbar",2),a([rl],dl.prototype,"axesButtons",2),a([rl],dl.prototype,"snap",2);var pl=dl,{FONT_SIZE_RATIO:gl,ThemeSymbols:fl}=n.n1,ml={stroke:{$ref:"foregroundColor"},strokeOpacity:1,strokeWidth:2},yl={fill:fl.DEFAULT_ANNOTATION_HANDLE_FILL,strokeOpacity:1,strokeWidth:2},vl={color:{$ref:"backgroundColor"},fontSize:{$rem:[gl.LARGE]},fontFamily:{$ref:"fontFamily"}},bl={...vl,enabled:!0,fill:{$ref:"foregroundColor"},fontSize:{$ref:"fontSize"}},Cl={...vl,textAlign:"left"},wl={...vl,position:"top",alignment:"center",color:{$ref:"textColor"}},Sl={...vl,position:"top",alignment:"center",color:{$ref:"textColor"}},xl={...vl,fontSize:{$ref:"fontSize"},color:fl.DEFAULT_ANNOTATION_STATISTICS_COLOR,fill:fl.DEFAULT_ANNOTATION_STATISTICS_FILL,stroke:fl.DEFAULT_ANNOTATION_STATISTICS_STROKE,strokeWidth:1,divider:{stroke:fl.DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE,strokeWidth:1,strokeOpacity:.5}},El={...ml,background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...yl},text:{...wl},statistics:{...xl}},Al={type:"root",optionsKey:"annotations",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:e=>new pl(e),themeTemplate:{annotations:{enabled:!1,line:{...ml,handle:{...yl},text:{...wl}},"horizontal-line":{...ml,handle:{...yl},axisLabel:{...bl},text:{...wl}},"vertical-line":{...ml,handle:{...yl},axisLabel:{...bl},text:{...wl}},"disjoint-channel":{...ml,background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...yl},text:{...Sl}},"parallel-channel":{...ml,middle:{lineDash:[6,5],strokeWidth:1},background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...yl},text:{...Sl}},"fibonacci-retracement":{...ml,strokes:fl.DEFAULT_FIBONACCI_STROKES,rangeStroke:{$ref:"foregroundColor"},handle:{...yl},text:{...wl,position:"center"},label:{...vl,color:void 0,fontSize:{$round:[{$mul:[{$ref:"fontSize"},10/12]}]}}},"fibonacci-retracement-trend-based":{...ml,strokes:fl.DEFAULT_FIBONACCI_STROKES,rangeStroke:{$ref:"foregroundColor"},handle:{...yl},text:{...wl,position:"center"},label:{...vl,color:void 0,fontSize:{$round:[{$mul:[{$ref:"fontSize"},10/12]}]}}},callout:{...ml,...Cl,color:{$ref:"textColor"},handle:{...yl},fill:{$ref:"foregroundColor"},fillOpacity:.075},comment:{...Cl,fontWeight:700,handle:{...yl},fill:{$ref:"foregroundColor"}},note:{...Cl,color:fl.DEFAULT_TEXTBOX_COLOR,fill:fl.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR,stroke:{$ref:"backgroundColor"},strokeWidth:1,strokeOpacity:1,handle:{...yl},background:{fill:fl.DEFAULT_TEXTBOX_FILL,stroke:fl.DEFAULT_TEXTBOX_STROKE,strokeWidth:1}},text:{...Cl,color:{$ref:"textColor"},handle:{...yl}},arrow:{...ml,handle:{...yl},text:{...wl}},"arrow-up":{fill:{$palette:"up.fill"},handle:{...yl,stroke:{$ref:"foregroundColor"}}},"arrow-down":{fill:{$palette:"down.fill"},handle:{...yl,stroke:{$ref:"foregroundColor"}}},"date-range":{...El},"price-range":{...El},"date-price-range":{...El},"quick-date-price-range":{up:{...ml,fill:fl.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,fillOpacity:.2,handle:{...yl},statistics:{...xl,color:"#fff",fill:fl.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}},down:{...ml,stroke:fl.DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE,fill:fl.DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL,fillOpacity:.2,handle:{...yl,stroke:fl.DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE},statistics:{...xl,color:"#fff",fill:fl.DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}}},axesButtons:{},toolbar:{buttons:[{icon:"text-annotation",tooltip:"toolbarAnnotationsTextAnnotations",value:"text-menu"},{icon:"trend-line-drawing",tooltip:"toolbarAnnotationsLineAnnotations",value:"line-menu"},{icon:"arrow-drawing",tooltip:"toolbarAnnotationsShapeAnnotations",value:"shape-menu"},{icon:"delete",tooltip:"toolbarAnnotationsClearAll",value:"clear"}],padding:{$ref:"padding"}},optionsToolbar:{buttons:[{icon:"text-annotation",tooltip:"toolbarAnnotationsTextColor",value:"text-color"},{icon:"line-color",tooltip:"toolbarAnnotationsLineColor",value:"line-color"},{icon:"fill-color",tooltip:"toolbarAnnotationsFillColor",value:"fill-color"},{tooltip:"toolbarAnnotationsTextSize",value:"text-size"},{tooltip:"toolbarAnnotationsLineStrokeWidth",value:"line-stroke-width"},{icon:"line-style-solid",tooltip:"toolbarAnnotationsLineStyle",value:"line-style-type"},{icon:"settings",tooltip:"toolbarAnnotationsSettings",value:"settings"},{icon:"unlocked",tooltip:"toolbarAnnotationsLock",ariaLabel:"toolbarAnnotationsLock",checkedOverrides:{icon:"locked",tooltip:"toolbarAnnotationsUnlock"},value:"lock"},{icon:"delete",tooltip:"toolbarAnnotationsDelete",value:"delete"}]}}}},{BaseProperties:Ml,ObserveChanges:Tl,ProxyProperty:Dl,Property:Il,calculatePlacement:Rl}=n.n1,kl=class extends Ml{constructor(){super(),this.opacity=1,this.loadedSynchronously=!0,this.containerWidth=0,this.containerHeight=0,this.onLoad=void 0,this.onImageLoad=()=>{this.loadedSynchronously||(this.node.visible=!1,this.performLayout(this.containerWidth,this.containerHeight),this.onLoad?.())},this.imageElement=(0,s.n)("img"),this.imageElement.onload=this.onImageLoad,this.node=new n.n1.Image(this.imageElement)}get complete(){return this.imageElement.width>0&&this.imageElement.height>0}performLayout(e,t){this.containerWidth=e,this.containerHeight=t;const i={width:e,height:t},n=Rl(this.imageElement.width,this.imageElement.height,i,this);return this.node.setProperties(this.complete?{visible:!0,opacity:this.opacity,...n}:{visible:!1}),n}};a([Il],kl.prototype,"top",2),a([Il],kl.prototype,"right",2),a([Il],kl.prototype,"bottom",2),a([Il],kl.prototype,"left",2),a([Il],kl.prototype,"width",2),a([Il],kl.prototype,"height",2),a([Il],kl.prototype,"opacity",2),a([Dl("imageElement.src"),Tl(e=>e.loadedSynchronously=e.complete)],kl.prototype,"url",2);var{ActionOnSet:Pl,Property:_l}=n.n1,Ll=class extends n.n1.Background{constructor(){super(...arguments),this.image=new kl}onLayoutComplete(e){if(super.onLayoutComplete(e),this.image){const{width:t,height:i}=e.chart;this.image.performLayout(t,i)}}onImageLoad(){this.ctx.updateService.update(n.n1.ChartUpdateType.SCENE_RENDER)}};a([_l,Pl({newValue(e){this.node.appendChild(e.node),e.onLoad=()=>this.onImageLoad()},oldValue(e){this.node.removeChild(e.node),e.onLoad=void 0}})],Ll.prototype,"image",2);var Nl={type:"root",optionsKey:"background",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:e=>new Ll(e)},{ActionOnSet:Ol,LayoutElement:Fl,Menu:Gl,Property:Bl}=n.n1,Vl=[{label:"toolbarSeriesTypeOHLC",icon:"ohlc-series",value:"ohlc"},{label:"toolbarSeriesTypeCandles",icon:"candlestick-series",value:"candlestick"},{label:"toolbarSeriesTypeHollowCandles",icon:"hollow-candlestick-series",value:"hollow-candlestick"},{label:"toolbarSeriesTypeLine",icon:"line-series",value:"line"},{label:"toolbarSeriesTypeStepLine",icon:"step-line-series",value:"step-line"},{label:"toolbarSeriesTypeHLC",icon:"hlc-series",value:"hlc"},{label:"toolbarSeriesTypeHighLow",icon:"high-low-series",value:"high-low"}],Hl=class extends n.n1.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!1,this.menu=new Gl(this.ctx,"chart-toolbar"),this.toolbar=e.sharedToolbar.getSharedToolbar("chartToolbar"),this.destroyFns.push(this.toolbar.addToolbarListener("button-pressed",this.onButtonPressed.bind(this)),e.layoutManager.registerElement(Fl.ToolbarLeft,this.onLayoutStart.bind(this)),()=>this.toolbar.destroy())}onLayoutStart(e){this.enabled&&(this.updateButton(),this.toolbar.layout(e.layoutBox))}onButtonPressed({event:e,buttonBounds:t}){this.menu.setAnchor({x:t.x+t.width+6,y:t.y}),this.menu.show({items:Vl,menuItemRole:"menuitemradio",ariaLabel:this.ctx.localeManager.t("toolbarSeriesTypeDropdown"),class:"ag-charts-chart-toolbar__menu",value:this.getChartType(),sourceEvent:e.sourceEvent,onPress:e=>{this.setChartType(e.value),this.hidePopover()},onHide:()=>{this.toolbar.clearActiveButton()}}),this.toolbar.toggleActiveButtonByIndex(0)}updateButton(){const e=this.getChartType(),t=Vl.find(t=>t.value===e)?.icon;null!=t&&this.toolbar.updateButtons([{icon:t,tooltip:"toolbarSeriesTypeDropdown"}])}hidePopover(){this.toolbar.clearActiveButton(),this.menu.hide()}setChartType(e){const t={chartType:e};this.ctx.chartService.publicApi?.updateDelta(t).catch(e=>s.Vy.error(e))}getChartType(){const e=this.ctx.chartService.publicApi?.getOptions()?.chartType;return null!=e&&Vl.some(t=>t.value===e)?e:"candlestick"}};a([Bl,Ol({changeValue(e){this.toolbar?.setHidden(!e)}})],Hl.prototype,"enabled",2);var Ul={type:"root",optionsKey:"chartToolbar",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:e=>new Hl(e)};function zl(e,t,i){let n=!0;if("separator"===t.type){const e=i.at(i.length-1);n=void 0!==e&&"separator"!==e.type}if(n&&(n=function(e,t){return"always"===e||("series-area"===e?"series-area"===t||"series-node"===t:e===t)}(t.showOn??"always",e)),n){const e=new Kl(t);return i.push(e),e}}function Wl(e,t,i,n){t.isVisible(i)&&zl(e,t.builtins.items[i],n)}function jl(e,t,i,n){const{builtins:r}=t;if((0,s.bX)(i,r.lists))for(const s of r.lists[i])Wl(e,t,s,n);else Wl(e,t,i,n)}function $l(e,t,i,n){for(const s of i)if("string"==typeof s)jl(e,t,s,n);else{const i=zl(e,s,n);s.items&&i&&s.items.length>0&&$l(e,t,s.items,i.items)}"separator"===n[n.length-1]?.type&&n.pop()}var Kl=class{constructor(e){this.type="action",this.showOn="always",this.label="",this.iconUrl=void 0,this.enabled=!0,this.items=[],this.action=void 0,e&&this.setOptions(e),this.items=[]}setField(e,t,i){t[e]=i}setOptions(e){let t;for(t in e)void 0!==e[t]&&this.setField(t,this,e[t])}},Yl="ag-charts-context-menu",ql="ag-charts-dark-context-menu",{Deprecated:Xl,Property:Zl,ContextMenuRegistry:Ql}=n.n1,Jl="context-menu",ec="Use [items] instead",tc=class extends n.n1.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!0,this.darkTheme=!1,this.items=["defaults"],this.pickedNode=void 0,this.showEvent=void 0,this.x=0,this.y=0,this.closingSubMenus=0,this.menuWidget=new n.uB.MenuWidget;const t=this;if(this.deprecationMap={extraActions:{get items(){return t.extraActions??[]},showOn:"always"},extraSeriesAreaActions:{get items(){return t.extraSeriesAreaActions??[]},showOn:"series-area"},extraNodeActions:{get items(){return t.extraNodeActions??[]},showOn:"series-node"},extraLegendItemActions:{get items(){return t.extraLegendItemActions??[]},showOn:"legend-item"}},this.interactionManager=e.interactionManager,this.registry=e.contextMenuRegistry,this.element=e.domManager.addChild("canvas-overlay",Jl),this.element.classList.add(Yl),this.element.style.display="none",this.element.addEventListener("contextmenu",e=>e.preventDefault()),this.element.addEventListener("focusout",({relatedTarget:e})=>{this.closingSubMenus>0||(null==e||e instanceof Node&&!this.element.contains(e))&&this.hide()}),this.destroyFns.push(()=>this.element.parentNode?.removeChild(this.element),()=>this.menuWidget.destroy(),e.domManager.addListener("hidden",()=>this.hide()),this.menuWidget.addListener("close-widget",()=>this.onClose())),this.menuWidget.addClass(`${Yl}__menu`),"undefined"!=typeof MutationObserver){const e=new MutationObserver(()=>{this.element.contains(this.menuWidget.getElement())&&this.reposition()});e.observe(this.element,{childList:!0}),this.mutationObserver=e,this.destroyFns.push(()=>e.disconnect())}this.ctx.contextMenuRegistry.builtins.items.download.action=()=>{const t=e.chartService.title;let i="image";t?.enabled&&void 0!==t?.text&&(i=t.text.replace(/\.+/,"")),this.ctx.chartService.publicApi?.download({fileName:i}).catch(e=>{s.Vy.error("Unable to download chart",e)})},this.destroyFns.push(this.registry.addListener("context-complete",e=>this.onContext(e)))}createDeprecatedAdaptorItems(){const e=[];for(const t of Object.keys(this.deprecationMap)){const{items:i,showOn:n}=this.deprecationMap[t];e.push("separator");for(const{action:t,label:s}of i){const i="action",r=!0;e.push({type:i,showOn:n,enabled:r,label:s,action:t})}}return e}expandItemsOptions(e){const t=[],i=this.createDeprecatedAdaptorItems();return $l(e,this.ctx.contextMenuRegistry,this.items,t),$l(e,this.ctx.contextMenuRegistry,i,t),t}onContext(e){if(!this.enabled)return;e.widgetEvent.sourceEvent.preventDefault(),this.showEvent=e.widgetEvent.sourceEvent,this.x=e.x,this.y=e.y,this.pickedNode=void 0,this.pickedLegendItem=void 0,Ql.check("series-node",e)?this.pickedNode=e.context.pickedNode:Ql.check("legend-item",e)&&(this.pickedLegendItem=e.context.legendItem);const t=this.expandItemsOptions(e.showOn);0!==t.length&&this.show(e.widgetEvent,t)}show(e,t){this.interactionManager.pushState(n.n1.InteractionState.ContextMenu),this.element.classList.toggle(ql,this.darkTheme),this.element.style.display="block";const i="touch"!==e.sourceEvent.pointerType&&void 0;void 0!==i&&this.ctx.chartService.overrideFocusVisible(i),this.createMenu(t),this.element.appendChild(this.menuWidget.getElement()),this.menuWidget.open(e,{overrideFocusVisible:i})}hide(){this.menuWidget.close()}onClose(){this.interactionManager.popState(n.n1.InteractionState.ContextMenu),this.element.removeChild(this.menuWidget.getElement()),this.element.style.display="none"}onSubMenuOpen(e,t){const i=e.getBounds();e.setFocusOverride(!0),e.getElement().insertAdjacentElement("afterend",t.getElement()),t.getElement().style.position="absolute";const n=this.ctx.domManager.getBoundingClientRect(),s=e.getBoundingClientRect(),r=n.right-s.right,o=s.left-n.left,{offsetWidth:a,offsetHeight:l}=t.getElement();let c=i.y;if(n.height>l){const e=n.bottom-s.top;e<l&&(c-=l-e)}if(r>=a)t.setBounds({x:i.x+i.width,y:c});else{const e=i.x-a,n=o+e;n>=0?t.setBounds({x:e,y:c}):t.setBounds({x:e-n,y:c})}}onSubMenuClose(e,t){e.setFocusOverride(void 0),this.closingSubMenus++,t.remove(),this.closingSubMenus--}createMenu(e){const{menuWidget:t}=this;t.clear(),t.toggleClass(ql,this.darkTheme),t.setTabIndex(-1),this.createMenuItems(t,e)}createMenuItems(e,t){for(const i of t)switch(i.type){case"separator":const t=e.addSeparator();t.classList.add(`${Yl}__divider`),t.classList.toggle(ql,this.darkTheme),this.initTableCells(t);break;case"action":if(0===i.items.length){const t=new n.uB.MenuItemWidget;this.initButtonElement(t,i),e.addChild(t)}else{const{subMenuButton:t,subMenu:n}=e.addSubMenu();n.addClass(`${Yl}__menu`),n.addListener("open-widget",()=>this.onSubMenuOpen(t,n)),n.addListener("close-widget",()=>this.onSubMenuClose(t,n)),this.initButtonElement(t,i),this.createMenuItems(n,i.items)}break;default:throw new Error("unhandled case")}}createButtonOnClick(e,t){return Ql.checkCallback("legend-item",e,t)?e=>{const i=e.sourceEvent;if(this.pickedLegendItem){const{seriesId:e,itemId:n}=this.pickedLegendItem;t({type:"contextmenu",seriesId:e,itemId:n,event:i}),this.hide()}else s.Vy.error("legend item not found")}:Ql.checkCallback("series-area",e,t)?()=>{t({type:"seriesContextMenuAction",event:this.showEvent}),this.hide()}:Ql.checkCallback("series-node",e,t)?()=>{const{pickedNode:e,showEvent:i}=this,n=e?.series.createNodeContextMenuActionEvent(i,e);n?t(n):s.Vy.error("series node not found"),this.hide()}:()=>{t({type:"contextMenuEvent",event:this.showEvent}),this.hide()}}initTableCells(e){const t=(0,s.n)("div"),i=(0,s.n)("div"),n=(0,s.n)("div");return t.classList.toggle("ag-charts-context-menu__icon",!0),i.classList.toggle("ag-charts-context-menu__label",!0),n.classList.toggle("ag-charts-context-menu__rightarrowhead",!0),t.ariaHidden="true",i.role="presentation",n.ariaHidden="true",e.append(t,i,n),{cellIcon:t,cellLabel:i,cellArrow:n}}initButtonElement(e,t){e.addClass(`${Yl}__item`),e.toggleClass(ql,this.darkTheme),e.setEnabled(t.enabled);const i=this.ctx.localeManager.t(t.label),r=`${Yl}__cellpadding`,{cellIcon:o,cellLabel:a,cellArrow:l}=this.initTableCells(e.getElement());if(a.textContent=i,a.classList.add(r),null!=t.iconUrl){const e=(0,s.n)("img");e.src=t.iconUrl,o.append(e),o.classList.add(r)}t.items.length>0&&(l.textContent="❯",l.classList.add(r));const{showOn:c,action:h}=t;if(null!=h){const t=this.createButtonOnClick(c,h);e.addListener("click",t),e.addListener("keydown",e=>{n.n1.isButtonClickEvent(e.sourceEvent)&&(e.sourceEvent.preventDefault(),t(e))})}e.addListener("mousemove",()=>e.focus({preventScroll:!0}))}reposition(){let{x:e,y:t}=this;this.element.style.top="unset",this.element.style.bottom="unset";const i=this.ctx.domManager.getBoundingClientRect(),{offsetWidth:n,offsetHeight:r}=this.element;e=(0,s.qE)(0,e,i.width-n),t=(0,s.qE)(0,t,i.height-r),this.element.style.left=`${e}px`,this.element.style.top=`calc(${t}px - 0.5em)`}destroy(){super.destroy(),this.mutationObserver?.disconnect(),this.ctx.domManager.removeStyles(Jl),this.ctx.domManager.removeChild("canvas-overlay",Jl)}};a([Zl],tc.prototype,"enabled",2),a([Zl],tc.prototype,"darkTheme",2),a([Zl],tc.prototype,"items",2),a([Xl(ec)],tc.prototype,"extraActions",2),a([Xl(ec)],tc.prototype,"extraNodeActions",2),a([Xl(ec)],tc.prototype,"extraSeriesAreaActions",2),a([Xl(ec)],tc.prototype,"extraLegendItemActions",2);var ic={type:"root",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],optionsKey:"contextMenu",moduleFactory:e=>new tc(e),themeTemplate:{contextMenu:{enabled:!0,darkTheme:n.n1.ThemeSymbols.IS_DARK_THEME}}},{BaseProperties:nc,Property:sc}=n.n1,rc=class extends n.n1.ChangeDetectableProperties{constructor(){super(...arguments),this.enabled=!0,this.xOffset=0,this.yOffset=0,this.format=void 0,this.renderer=void 0}};a([sc],rc.prototype,"enabled",2),a([sc],rc.prototype,"xOffset",2),a([sc],rc.prototype,"yOffset",2),a([sc],rc.prototype,"format",2),a([sc],rc.prototype,"renderer",2);var oc=class extends nc{constructor(e,t,i){super(),this.domManager=e,this.id=(0,s.sX)(this),this.enabled=!0,this.xOffset=0,this.yOffset=0,this.renderer=void 0,this.element=e.addChild("canvas-overlay",`crosshair-label-${this.id}`),this.element.classList.add("ag-charts-crosshair-label"),(0,s.Bq)(this.element,"aria-hidden",!0),this.element.setAttribute("data-key",t),this.element.setAttribute("data-axis-id",i)}show(e){const{element:t}=this,i=e.x+this.xOffset,n=e.y+this.yOffset;t.style.top=`${Math.round(n)}px`,t.style.left=`${Math.round(i)}px`,this.toggle(!0)}setLabelHtml({html:e,styles:t}){void 0!==e&&(this.element.innerHTML=e),void 0!==t&&Object.assign(this.element.style,t)}getBBox(){const{element:e}=this;return new n.n1.BBox(e.clientLeft,e.clientTop,e.clientWidth,e.clientHeight)}toggle(e){this.element.classList.toggle("ag-charts-crosshair-label--hidden",!e)}destroy(){this.domManager.removeChild("canvas-overlay",`crosshair-label-${this.id}`)}toLabelHtml(e,t){if("string"==typeof e)return{html:e,styles:{}};t=t??{};const{text:i=t.text??"",color:n=t.color,backgroundColor:s=t.backgroundColor,opacity:r=t.opacity??1}=e;return{html:`<div class="ag-charts-crosshair-label-content">\n                    <span>${i}</span>\n                </div>`,styles:{opacity:r,"background-color":s?.toLowerCase(),color:n}}}};a([sc],oc.prototype,"enabled",2),a([sc],oc.prototype,"xOffset",2),a([sc],oc.prototype,"yOffset",2),a([sc],oc.prototype,"format",2),a([sc],oc.prototype,"renderer",2);var{Group:ac,TranslatableGroup:lc,Line:cc,BBox:hc,InteractionState:uc,Property:dc,ZIndexMap:pc,formatNumber:gc,ChartAxisDirection:fc}=n.n1,mc=class extends n.n1.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.id=(0,s.sX)(this),this.enabled=!1,this.stroke="rgb(195, 195, 195)",this.lineDash=[6,3],this.lineDashOffset=0,this.strokeWidth=1,this.strokeOpacity=1,this.snap=!0,this.label=new rc,this.seriesRect=new hc(0,0,0,0),this.bounds=new hc(0,0,0,0),this.crosshairGroup=new lc({name:"crosshairs",zIndex:pc.SERIES_CROSSHAIR}),this.lineGroup=this.crosshairGroup.appendChild(new ac({name:`${this.id}-crosshair-lines`,zIndex:pc.SERIES_CROSSHAIR})),this.lineGroupSelection=n.n1.Selection.select(this.lineGroup,cc,!1),this.activeHighlight=void 0,this.axisCtx=e.parent,this.labels={},this.hideCrosshairs(),e.domManager.addEventListener("focusin",({target:t})=>{const i=t instanceof HTMLElement&&e.domManager.contains(t,"series-area");this.crosshairGroup.visible&&!i&&(this.hideCrosshairs(),this.ctx.updateService.update(n.n1.ChartUpdateType.PERFORM_LAYOUT))}),this.destroyFns.push(e.scene.attachNode(this.crosshairGroup),e.widgets.seriesWidget.addListener("mousemove",e=>this.onMouseHoverLike(e)),e.widgets.seriesWidget.addListener("drag-move",e=>this.onMouseHoverLike(e)),e.widgets.seriesWidget.addListener("mouseleave",()=>this.onMouseOut()),e.widgets.seriesDragInterpreter.addListener("click",e=>this.onClick(e)),e.chartEventManager.addListener("series-focus-change",()=>this.onKeyPress()),e.zoomManager.addListener("zoom-pan-start",()=>this.onMouseOut()),e.zoomManager.addListener("zoom-change",()=>this.onMouseOut()),e.highlightManager.addListener("highlight-change",e=>this.onHighlightChange(e)),e.layoutManager.addListener("layout:complete",e=>this.layout(e)),()=>Object.values(this.labels).forEach(e=>e.destroy()))}layout({series:{rect:e,visible:t},axes:i}){if(!t||!i||!this.enabled)return;this.seriesRect=e;const{position:n="left",axisId:s}=this.axisCtx,r=i.find(e=>e.id===s);if(!r)return;this.axisLayout=r,this.bounds=e.clone().grow(r.gridPadding+r.seriesAreaPadding,n);const{crosshairGroup:o,bounds:a}=this;o.translationX=Math.round(a.x),o.translationY=Math.round(a.y);const l=["pointer",...this.axisCtx.seriesKeyProperties()];this.updateSelections(l),this.updateLines(),this.updateLabels(l)}updateSelections(e){this.lineGroupSelection.update(e,e=>e.append(new cc),e=>e)}updateLabels(e){const{labels:t,ctx:i}=this;for(const n of e)this.label.enabled&&(t[n]??(t[n]=new oc(i.domManager,n,this.axisCtx.axisId))),t[n]&&this.updateLabel(t[n]);this.labelFormatter=this.axisCtx.scaleValueFormatter(this.label.format)}updateLabel(e){const{enabled:t,xOffset:i,yOffset:n,format:s,renderer:r}=this.label;e.enabled=t,e.xOffset=i,e.yOffset=n,e.format=s,e.renderer=r}updateLines(){const{lineGroupSelection:e,bounds:t,stroke:i,strokeWidth:n,strokeOpacity:s,lineDash:r,lineDashOffset:o,axisLayout:a}=this;if(!a)return;const l=this.isVertical();e.each(e=>{e.stroke=i,e.strokeWidth=n,e.strokeOpacity=s,e.lineDash=r,e.lineDashOffset=o,e.y1=0,e.y2=l?t.height:0,e.x1=0,e.x2=l?0:t.width})}isVertical(){return this.axisCtx.direction===fc.X}isHover(e){return"mousemove"===e.type||"click"===e.type||"touch"===e.device&&"hover"===this.ctx.chartService.touch.dragAction}formatValue(e){const{labelFormatter:t,axisLayout:i}=this;if(t){const i=this.cachedCallWithContext(t,e);if(null!=i)return i}if("number"==typeof e){const t=(i?.label.fractionDigits??0)+((0,s.Fq)(e)?0:1);return gc(e,t)}return String(e??"")}onClick(e){"touch"===e.device&&this.onMouseHoverLike(e)}onMouseHoverLike(e){if(!this.enabled||this.snap)return;const t=this.isHover(e)?uc.Clickable:uc.AnnotationsMoveable;this.ctx.interactionManager.isState(t)&&(this.updatePositions(this.getData(e)),this.crosshairGroup.visible=!0,this.ctx.updateService.update(n.n1.ChartUpdateType.SCENE_RENDER))}onMouseOut(){this.ctx.interactionManager.isState(uc.Clickable)&&(this.hideCrosshairs(),this.ctx.updateService.update(n.n1.ChartUpdateType.SCENE_RENDER))}onKeyPress(){this.enabled&&!this.snap&&this.ctx.interactionManager.isState(uc.Default)&&this.hideCrosshairs()}onHighlightChange(e){if(!this.enabled)return;const{crosshairGroup:t,axisCtx:i}=this,{datum:n,series:s}=e.currentHighlight??{},r=n&&(s?.axes.x?.id===i.axisId||s?.axes.y?.id===i.axisId);if(this.activeHighlight=r?e.currentHighlight:void 0,this.activeHighlight){if(this.snap){const e=this.getActiveHighlightData(this.activeHighlight);this.updatePositions(e),t.visible=!0}}else this.hideCrosshairs()}isInRange(e){return this.axisCtx.inRange(e)}updatePositions(e){const{seriesRect:t,lineGroupSelection:i}=this;i.each((i,n)=>{const s=e[n];if(!s)return i.visible=!1,void this.hideLabel(n);i.visible=!0;const{value:r,position:o}=s;let a=0,l=0;this.isVertical()?(a=o,i.x=Math.round(a)):(l=o,i.y=Math.round(l)),this.label.enabled?this.showLabel(a+t.x,l+t.y,r,n):this.hideLabel(n)})}getData(e){const{axisCtx:t}=this,i="pointer",{datum:n,xKey:s="",yKey:r=""}=this.activeHighlight??{},{currentX:o,currentY:a}=e,l=this.isVertical(),c=l?o:a;let h=n?.[l?s:r]??"";return t.continuous&&(h=t.scaleInvert(c)),{[i]:{position:c,value:h}}}getActiveHighlightData(e){const{axisCtx:t}=this,{datum:i,series:n,xKey:s="",aggregatedValue:r,cumulativeValue:o,midPoint:a}=e,l=n.getKeyProperties(t.direction),c=(t.scale.bandwidth??0)/2,h=n.axes[t.direction]?.id===t.axisId,u=l.indexOf("yKey")>-1&&h,d=l.indexOf("xKey")>-1&&h,p=r??o;if(u&&void 0!==p){const e=t.scale.convert(p)+c;return this.isInRange(e)?{yKey:{value:p,position:e}}:{}}if(d){const e=(this.isVertical()?a?.x:a?.y)??0,n=t.continuous?t.scaleInvert(e):i[s];return this.isInRange(e)?{xKey:{value:n,position:e}}:{}}const g={};return l.forEach(e=>{const s=n.properties[e],r=i[s],o=t.scale.convert(r)+c;this.isInRange(o)&&(g[e]={value:r,position:o})}),g}getLabelHtml(e,t){const i=this.axisLayout?.label?.fractionDigits??0,n={text:this.formatValue(e)};return this.label.renderer?t.toLabelHtml(this.label.renderer({value:e,fractionDigits:i}),n):t.toLabelHtml(n)}showLabel(e,t,i,n){if(!this.axisLayout)return;const{bounds:s}=this,r=this.labels[n],o=this.getLabelHtml(i,r);r.setLabelHtml(o);const{width:a,height:l}=r.getBBox(),c=this.axisCtx.position;let h=this.axisLayout.label.spacing+this.axisLayout.tickSize;this.axisCtx.direction===fc.X?(h-=4,r.show({x:e-a/2,y:"bottom"===c?s.y+s.height+h:s.y-l-h})):(h-=8,r.show({x:"right"===c?s.x+s.width+h:s.x-a-h,y:t-l/2}))}hideCrosshairs(){this.crosshairGroup.visible=!1;for(const e of Object.keys(this.labels))this.hideLabel(e)}hideLabel(e){this.labels[e]?.toggle(!1)}cachedCallWithContext(e,...t){const{callbackCache:i,chartService:n}=this.ctx;return i.call(this.axisCtx,n,e,...t)}};a([dc],mc.prototype,"enabled",2),a([dc],mc.prototype,"stroke",2),a([dc],mc.prototype,"lineDash",2),a([dc],mc.prototype,"lineDashOffset",2),a([dc],mc.prototype,"strokeWidth",2),a([dc],mc.prototype,"strokeOpacity",2),a([dc],mc.prototype,"snap",2),a([dc],mc.prototype,"label",2);var yc={type:"axis-option",optionsKey:"crosshair",packageType:"enterprise",chartTypes:["cartesian"],axisTypes:["category","ordinal-time","unit-time","number","log","time"],moduleFactory:e=>new mc(e),themeTemplate:{crosshair:{snap:!0,stroke:{$ref:"subtleTextColor"},strokeWidth:1,strokeOpacity:1,lineDash:[5,6],lineDashOffset:0,label:{enabled:!0}}}},{ActionOnSet:vc,Property:bc}=n.n1,Cc=class extends n.n1.BaseModuleInstance{constructor(e){super(),this.enabled=!1,this.getData=()=>Promise.resolve(),this.dataService=e.dataService}updateCallback(e,t){this.dataService&&(e&&null!=t?this.dataService.updateCallback(t):this.dataService.clearCallback())}};a([vc({newValue(e){this.updateCallback(e,this.getData)}}),bc],Cc.prototype,"enabled",2),a([vc({newValue(e){this.updateCallback(this.enabled,e)}}),bc],Cc.prototype,"getData",2),a([vc({newValue(e){this.dataService.requestThrottle=e}})],Cc.prototype,"requestThrottle",2),a([vc({newValue(e){this.dataService.dispatchThrottle=e}})],Cc.prototype,"updateThrottle",2),a([vc({newValue(e){this.dataService.dispatchOnlyLatest=!e}})],Cc.prototype,"updateDuringInteraction",2);var wc={type:"root",optionsKey:"dataSource",packageType:"enterprise",chartTypes:["cartesian","hierarchy","polar","topology","flow-proportion","standalone","gauge"],moduleFactory:e=>new Cc(e),themeTemplate:{dataSource:{enabled:!1}}},{nearestSquaredInContainer:Sc,partialAssign:xc,mergeDefaults:Ec,BBox:Ac}=n.n1,Mc=class{constructor(e){this.components=e,this.union=Ac.merge(e)}containsPoint(e,t){if(!this.union.containsPoint(e,t))return!1;for(const i of this.components)if(i.containsPoint(e,t))return!0;return!1}},Tc=class extends n.n1.Group{constructor(){super(),this.capLength=NaN,this._datum=void 0,this.whiskerPath=new n.n1.Path,this.capsPath=new n.n1.Path,this.bboxes=new Mc([]),this.append([this.whiskerPath,this.capsPath])}get datum(){return this._datum}set datum(e){this._datum=e}calculateCapLength(e,t){const{lengthRatio:i=1,length:n}=e,{lengthRatioMultiplier:s,lengthMax:r}=t,o=n??i*s;return Math.min(o,r)}getItemStylerParams(e,t,i){const{datum:n}=this;if(null==n||null==e.itemStyler)return;const{xLowerKey:s,xUpperKey:r,yLowerKey:o,yUpperKey:a}=e;return{...t,datum:n.datum,seriesId:n.datum.seriesId,xKey:n.xKey,yKey:n.yKey,xLowerKey:s,xUpperKey:r,yLowerKey:o,yUpperKey:a,highlighted:i}}formatStyles(e,t,i,n){let{cap:s,...r}=e;const o=this.getItemStylerParams(t,e,n);if(null!=o&&null!=t.itemStyler){const e=i.callWithContext(t.itemStyler,o);r=Ec(e,r),s=Ec(e?.cap,e,s)}return{whiskerStyle:r,capsStyle:s}}applyStyling(e,t){xc(["visible","stroke","strokeWidth","strokeOpacity","lineDash","lineDashOffset"],e,t)}update(e,t,i,n){if(void 0===this.datum)return;const{whiskerStyle:s,capsStyle:r}=this.formatStyles(e,t,i,n),{xBar:o,yBar:a,capDefaults:l}=this.datum,c=this.whiskerPath;this.applyStyling(c,s),c.path.clear(!0),void 0!==a&&(c.path.moveTo(a.lowerPoint.x,a.lowerPoint.y),c.path.lineTo(a.upperPoint.x,a.upperPoint.y)),void 0!==o&&(c.path.moveTo(o.lowerPoint.x,o.lowerPoint.y),c.path.lineTo(o.upperPoint.x,o.upperPoint.y)),c.path.closePath(),this.capLength=this.calculateCapLength(r??{},l);const h=this.capLength/2,u=this.capsPath;this.applyStyling(u,r),u.path.clear(!0),void 0!==a&&(u.path.moveTo(a.lowerPoint.x-h,a.lowerPoint.y),u.path.lineTo(a.lowerPoint.x+h,a.lowerPoint.y),u.path.moveTo(a.upperPoint.x-h,a.upperPoint.y),u.path.lineTo(a.upperPoint.x+h,a.upperPoint.y)),void 0!==o&&(u.path.moveTo(o.lowerPoint.x,o.lowerPoint.y-h),u.path.lineTo(o.lowerPoint.x,o.lowerPoint.y+h),u.path.moveTo(o.upperPoint.x,o.upperPoint.y-h),u.path.lineTo(o.upperPoint.x,o.upperPoint.y+h)),u.path.closePath()}updateBBoxes(){const{capLength:e,whiskerPath:t,capsPath:i}=this,{yBar:n,xBar:s}=this.datum??{},r=e/2,o=[];if(void 0!==n){const s=n.lowerPoint.y-n.upperPoint.y;o.push(new Ac(n.lowerPoint.x,n.upperPoint.y,t.strokeWidth,s),new Ac(n.lowerPoint.x-r,n.lowerPoint.y,e,i.strokeWidth),new Ac(n.upperPoint.x-r,n.upperPoint.y,e,i.strokeWidth))}if(void 0!==s){const n=s.upperPoint.x-s.lowerPoint.x;o.push(new Ac(s.lowerPoint.x,s.upperPoint.y,n,t.strokeWidth),new Ac(s.lowerPoint.x,s.lowerPoint.y-r,i.strokeWidth,e),new Ac(s.upperPoint.x,s.upperPoint.y-r,i.strokeWidth,e))}this.bboxes.components=o,this.bboxes.union=Ac.merge(o)}containsPoint(e,t){return this.bboxes.containsPoint(e,t)}pickNode(e,t){return this.containsPoint(e,t)?this:void 0}nearestSquared(e,t,i){const{bboxes:n}=this;if(n.union.distanceSquared(e,t)>i)return{nearest:void 0,distanceSquared:1/0};const{distanceSquared:s}=Ac.nearestBox(e,t,n.components);return{nearest:this,distanceSquared:s}}},Dc=class extends n.n1.Group{nearestSquared(e,t){const{nearest:i,distanceSquared:n}=Sc(e,t,{children:this.children()});if(void 0!==i&&!isNaN(n))return{datum:i.datum,distanceSquared:n}}},{BaseProperties:Ic,Property:Rc}=n.n1,kc=class extends Ic{};a([Rc],kc.prototype,"visible",2),a([Rc],kc.prototype,"stroke",2),a([Rc],kc.prototype,"strokeWidth",2),a([Rc],kc.prototype,"strokeOpacity",2),a([Rc],kc.prototype,"lineDash",2),a([Rc],kc.prototype,"lineDashOffset",2),a([Rc],kc.prototype,"length",2),a([Rc],kc.prototype,"lengthRatio",2);var Pc=class extends Ic{constructor(){super(...arguments),this.visible=!0,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.cap=new kc}};a([Rc],Pc.prototype,"yLowerKey",2),a([Rc],Pc.prototype,"yLowerName",2),a([Rc],Pc.prototype,"yUpperKey",2),a([Rc],Pc.prototype,"yUpperName",2),a([Rc],Pc.prototype,"xLowerKey",2),a([Rc],Pc.prototype,"xLowerName",2),a([Rc],Pc.prototype,"xUpperKey",2),a([Rc],Pc.prototype,"xUpperName",2),a([Rc],Pc.prototype,"visible",2),a([Rc],Pc.prototype,"stroke",2),a([Rc],Pc.prototype,"strokeWidth",2),a([Rc],Pc.prototype,"strokeOpacity",2),a([Rc],Pc.prototype,"lineDash",2),a([Rc],Pc.prototype,"lineDashOffset",2),a([Rc],Pc.prototype,"itemStyler",2),a([Rc],Pc.prototype,"cap",2);var{fixNumericExtent:_c,groupAccumulativeValueProperty:Lc,mergeDefaults:Nc,valueProperty:Oc,ChartAxisDirection:Fc}=n.n1,Gc=class e extends n.n1.BaseModuleInstance{constructor(e){super(),this.properties=new Pc;const t=function(e){for(const t of n.On)if(t===e.series.type)return e.series;throw new Error(`AG Charts - unsupported series type '${e.series.type}', error bars supported series types: ${n.On.join(", ")}`)}(e),{annotationGroup:i,annotationSelections:s}=t;this.cartesianSeries=t,this.groupNode=new Dc({name:`${i.id}-errorBars`}),i.appendChild(this.groupNode),this.selection=n.n1.Selection.select(this.groupNode,()=>this.errorBarFactory()),s.add(this.selection),t.addEventListener("seriesVisibilityChange",e=>this.onToggleSeriesItem(e)),this.destroyFns.push(t.addListener("data-processed",e=>this.onDataProcessed(e)),t.addListener("data-update",e=>this.onDataUpdate(e)),e.highlightManager.addListener("highlight-change",e=>this.onHighlightChange(e)),()=>i.removeChild(this.groupNode),()=>s.delete(this.selection))}hasErrorBars(){const{xLowerKey:e,xUpperKey:t,yLowerKey:i,yUpperKey:n}=this.properties;return(0,s.vM)(e)&&(0,s.vM)(t)||(0,s.vM)(i)&&(0,s.vM)(n)}isStacked(){const e=this.cartesianSeries.seriesGrouping?.stackCount;return null!=e&&e>0}getUnstackPropertyDefinition(e){const t=[],{xLowerKey:i,xUpperKey:n,yLowerKey:s,yUpperKey:r,xErrorsID:o,yErrorsID:a}=this.getMaybeFlippedKeys(),{xScaleType:l,yScaleType:c}=e;return null!=s&&null!=r&&t.push(Oc(s,c,{id:`${a}-lower`}),Oc(r,c,{id:`${a}-upper`})),null!=i&&null!=n&&t.push(Oc(i,l,{id:`${o}-lower`}),Oc(n,l,{id:`${o}-upper`})),t}getStackPropertyDefinition(e){const t=[],{cartesianSeries:i}=this,{xLowerKey:n,xUpperKey:s,yLowerKey:r,yUpperKey:o,xErrorsID:a,yErrorsID:l}=this.getMaybeFlippedKeys(),{xScaleType:c,yScaleType:h}=e,u=i.seriesGrouping?.groupIndex??i.id,d={invalidValue:null,missingValue:0,separateNegative:!0,...i.visible?{}:{forceValue:0}},p=(e,t,i,n)=>Lc(e,"normal","current",{id:`${t}-${i}`,groupId:`errorGroup-${u}-${i}`,...d},n),g=(e,i,n,s)=>{t.push(...p(e,n,"lower",s),...p(i,n,"upper",s))};return null!=r&&null!=o&&g(r,o,l,h),null!=n&&null!=s&&g(n,s,a,c),t}getPropertyDefinitions(e){return this.isStacked()?this.getStackPropertyDefinition(e):this.getUnstackPropertyDefinition(e)}onDataProcessed(e){this.dataModel=e.dataModel,this.processedData=e.processedData}getDomain(e){const{xLowerKey:t,xUpperKey:i,xErrorsID:n,yLowerKey:r,yUpperKey:o,yErrorsID:a}=this.getMaybeFlippedKeys();if(e===Fc.X?(0,s.vM)(t)&&(0,s.vM)(i):(0,s.vM)(r)&&(0,s.vM)(o)){const{dataModel:t,processedData:i,cartesianSeries:s}=this;if(null!=t&&null!=i){const r={x:n,y:a}[e],o=t.getDomain(s,`${r}-lower`,"value",i),l=t.getDomain(s,`${r}-upper`,"value",i),c=[Math.min(...o,...l),Math.max(...o,...l)];return _c(c)}}return[]}onDataUpdate(e){this.dataModel=e.dataModel,this.processedData=e.processedData,(0,s.vM)(e.dataModel)&&(0,s.vM)(e.processedData)&&(this.createNodeData(),this.update())}getNodeData(){return this.hasErrorBars()?this.cartesianSeries.contextNodeData?.nodeData:void 0}createNodeData(){const e=this.getNodeData(),t=this.cartesianSeries.axes[Fc.X]?.scale,i=this.cartesianSeries.axes[Fc.Y]?.scale;if(t&&i&&e)for(let n=0;n<e.length;n++){const{midPoint:r,xLower:o,xUpper:a,yLower:l,yUpper:c}=this.getDatum(e,n);if(null!=r){let h,u;(0,s.vM)(o)&&(0,s.vM)(a)&&(h={lowerPoint:{x:this.convert(t,o),y:r.y},upperPoint:{x:this.convert(t,a),y:r.y}}),(0,s.vM)(l)&&(0,s.vM)(c)&&(u={lowerPoint:{x:r.x,y:this.convert(i,l)},upperPoint:{x:r.x,y:this.convert(i,c)}}),e[n].xBar=h,e[n].yBar=u}}}getMaybeFlippedKeys(){let{xLowerKey:e,xUpperKey:t,yLowerKey:i,yUpperKey:n}=this.properties,[s,r]=["xValue-errors","yValue-errors"];return this.cartesianSeries.shouldFlipXY()&&([e,i]=[i,e],[t,n]=[n,t],[s,r]=[r,s]),{xLowerKey:e,xUpperKey:t,xErrorsID:s,yLowerKey:i,yUpperKey:n,yErrorsID:r}}static getDatumKey(e,t,i){if(null==t)return;const n=e.datum[t];if(null!=n){if("number"==typeof n)return n+i;s.Vy.warnOnce(`Found [${t}] error value of type ${typeof n}. Expected number type`)}}getDatum(t,i){const{xLowerKey:n,xUpperKey:s,yLowerKey:r,yUpperKey:o}=this.getMaybeFlippedKeys(),a=t[i],l=null!=a.cumulativeValue&&this.isStacked()?a.cumulativeValue-a.yValue:0,[c,h]=this.cartesianSeries.shouldFlipXY()?[l,0]:[0,l];return{midPoint:a.midPoint,xLower:e.getDatumKey(a,n,c),xUpper:e.getDatumKey(a,s,c),yLower:e.getDatumKey(a,r,h),yUpper:e.getDatumKey(a,o,h)}}convert(e,t){const i=(e.bandwidth??0)/2;return e.convert(t)+i}update(){const e=this.getNodeData();null!=e&&(this.selection.update(e),this.selection.each((e,t,i)=>this.updateNode(e,t,i)))}updateNode(e,t,i){e.datum=t,e.update(this.getDefaultStyle(),this.properties,this.cartesianSeries,!1),e.updateBBoxes()}pickNodeExact(e){const{x:t,y:i}=e,n=this.groupNode.pickNode(t,i);if(null!=n)return{datum:n.datum,distanceSquared:0}}pickNodeNearest(e){return this.groupNode.nearestSquared(e.x,e.y)}pickNodeMainAxisFirst(e){return this.groupNode.nearestSquared(e.x,e.y)}getTooltipParams(){const{xLowerKey:e,xUpperKey:t,yLowerKey:i,yUpperKey:n,xLowerName:s=e,xUpperName:r=t,yLowerName:o=i,yUpperName:a=n}=this.properties;return{xLowerKey:e,xLowerName:s,xUpperKey:t,xUpperName:r,yLowerKey:i,yLowerName:o,yUpperKey:n,yUpperName:a}}onToggleSeriesItem(e){this.groupNode.visible=e.visible}makeStyle(e){return{visible:e.visible,lineDash:e.lineDash,lineDashOffset:e.lineDashOffset,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeOpacity:e.strokeOpacity,cap:Nc(this.properties.cap,e)}}getDefaultStyle(){return this.makeStyle(this.getWhiskerProperties())}getHighlightStyle(){return this.makeStyle(this.getWhiskerProperties())}restyleHighlightChange(e,t,i){const n=this.getNodeData();if(null!=n)for(let s=0;s<n.length;s++)if(e===n[s]){this.selection.at(s)?.update(t,this.properties,this.cartesianSeries,i);break}}onHighlightChange(e){const{previousHighlight:t,currentHighlight:i}=e;i?.series===this.cartesianSeries&&this.restyleHighlightChange(i,this.getHighlightStyle(),!0),t?.series===this.cartesianSeries&&this.restyleHighlightChange(t,this.getDefaultStyle(),!1),this.groupNode.opacity=this.cartesianSeries.getOpacity()}errorBarFactory(){return new Tc}getWhiskerProperties(){const{stroke:e,strokeWidth:t,visible:i,strokeOpacity:n,lineDash:s,lineDashOffset:r}=this.properties;return{stroke:e,strokeWidth:t,visible:i,strokeOpacity:n,lineDash:s,lineDashOffset:r}}},Bc={type:"series-option",identifier:"error-bars",optionsKey:"errorBar",packageType:"enterprise",chartTypes:["cartesian"],seriesTypes:n.On,moduleFactory:e=>new Gc(e),themeTemplate:{series:{errorBar:{visible:!0,stroke:{$ref:"foregroundColor"},strokeWidth:1,strokeOpacity:1,cap:{length:void 0,lengthRatio:void 0}}}}},{ZIndexMap:Vc,ActionOnSet:Hc,Property:Uc,ProxyPropertyOnWrite:zc}=n.n1,Wc=class extends n.n1.Background{constructor(){super(...arguments),this.image=new kl,this.fill="transparent",this.fillOpacity=void 0}createNode(){return new n.n1.Group({name:"foreground",zIndex:Vc.FOREGROUND})}onLayoutComplete(e){super.onLayoutComplete(e);const{width:t,height:i}=e.chart;let n={x:0,y:0,width:t,height:i};this.image&&(n=this.image.performLayout(t,i)),this.text&&this.updateTextNode(n)}onImageLoad(){this.ctx.updateService.update(n.n1.ChartUpdateType.SCENE_RENDER)}updateTextNode(e){const{textNode:t}=this;t.fontWeight="bold",t.fontFamily="Impact, sans-serif",t.fontSize=19,t.opacity=.7,t.fill="#9b9b9b",t.textBaseline="top";const i=this.textNode.getBBox();t.x=e.x+e.width/2-i.width/2,t.y=e.y+e.height+10}};a([Uc,Hc({newValue(e){this.node.appendChild(e.node),e.onLoad=()=>this.onImageLoad()},oldValue(e){this.node.removeChild(e.node),e.onLoad=void 0}})],Wc.prototype,"image",2),a([Uc,zc("rectNode","fill")],Wc.prototype,"fill",2),a([Uc,zc("rectNode","fillOpacity")],Wc.prototype,"fillOpacity",2);var jc={type:"root",optionsKey:"foreground",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:e=>new Wc(e)},{TranslatableGroup:$c,SceneChangeDetection:Kc}=n.n1,Yc=class extends $c{constructor(){super(...arguments),this.inset=0,this.cornerRadius=0}applyClip(e,t){const{cornerRadius:i,inset:n}=this,{x:s,y:r,width:o,height:a}=t;e.beginPath(),e.roundRect(s+n,r+n,o-2*n,a-2*n,i),e.clip()}};a([Kc()],Yc.prototype,"inset",2),a([Kc()],Yc.prototype,"cornerRadius",2);var{Property:qc,ZIndexMap:Xc,ActionOnSet:Zc,CategoryAxis:Qc,TextUtils:Jc,Padding:eh,Group:th,BBox:ih,ProxyProperty:nh}=n.n1,sh=class{constructor(){this.top=0,this.bottom=0}};a([qc],sh.prototype,"top",2),a([qc],sh.prototype,"bottom",2);var rh=class extends n.n1.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!1,this.padding=new sh,this.root=new th({name:"root"}),this.seriesRoot=this.root.appendChild(new Yc({name:"Series-root",zIndex:Xc.SERIES_LAYER,renderToOffscreenCanvas:!0})),this.axisGridGroup=this.root.appendChild(new th({name:"Axes-Grids",zIndex:Xc.AXIS_GRID})),this.axisGroup=this.root.appendChild(new th({name:"Axes-Grids",zIndex:Xc.AXIS_GRID})),this.axisLabelGroup=this.root.appendChild(new th({name:"Axes-Labels",zIndex:Xc.SERIES_LABEL})),this.axisCrosslineRangeGroup=this.root.appendChild(new th({name:"Axes-Crosslines-Range",zIndex:Xc.SERIES_CROSSLINE_RANGE})),this.axisCrosslineLineGroup=this.root.appendChild(new th({name:"Axes-Crosslines-Line",zIndex:Xc.SERIES_CROSSLINE_LINE})),this.axisCrosslineLabelGroup=this.root.appendChild(new th({name:"Axes-Crosslines-Label",zIndex:Xc.SERIES_LABEL})),this.data=[],this._destroyed=!1,this.miniChartAnimationPhase="initial",this.axes=[],this.series=[]}destroy(){this._destroyed||(this.destroySeries(this.series),this.axes.forEach(e=>e.destroy()),this.axes=[],this._destroyed=!0)}onSeriesChange(e,t){const i=t?.filter(t=>!e.includes(t))??[];this.destroySeries(i);for(const i of e){if(t?.includes(i))continue;i.attachSeries(this.seriesRoot,this.seriesRoot,void 0);const e=this;i.chart={get mode(){return"standalone"},get isMiniChart(){return!0},get seriesRect(){return e.seriesRect}},i.resetAnimation("initial"===this.miniChartAnimationPhase?"initial":"disabled")}}destroySeries(e){e?.forEach(e=>{e.destroy(),e.detachSeries(this.seriesRoot,this.seriesRoot,void 0),e.chart=void 0})}assignSeriesToAxes(){this.axes.forEach(e=>{e.boundSeries=this.series.filter(t=>t.axes[e.direction]===e)})}assignAxesToSeries(){const e={};this.axes.forEach(t=>{const i=t.direction;(e[i]??(e[i]=[])).push(t)}),this.series.forEach(t=>{t.directions.forEach(i=>{const n=e[i];if(!n)return void s.Vy.warnOnce(`no available axis for direction [${i}]; check series and axes configuration.`);const r=t.getKeys(i),o=this.findMatchingAxis(n,r);o?t.axes[i]=o:s.Vy.warnOnce(`no matching axis for direction [${i}] and keys [${r}]; check series and axes configuration.`)})})}findMatchingAxis(e,t){for(const i of e){if(!i.keys.length)return i;if(t)for(const e of t)if(i.keys.includes(e))return i}}updateData(e){this.series.forEach(t=>t.setChartData(e)),"initial"===this.miniChartAnimationPhase&&this.ctx.animationManager.onBatchStop(()=>{this.miniChartAnimationPhase="ready",this.series.forEach(e=>e.resetAnimation("disabled"))})}async processData(e){this.series.some(e=>e.canHaveAxes)&&(this.assignAxesToSeries(),this.assignSeriesToAxes()),await Promise.all(this.series.map(t=>(t.resetDatumCallbackCache(),t.processData(e))));for(const e of this.axes)e.processData()}computeAxisPadding(){const e=new eh;return this.enabled?(this.axes.forEach(({position:t,thickness:i,line:n,label:s})=>{if(null==t)return;let r;r=i||(n.enabled?n.width:0)+(s.enabled?Jc.getLineHeight(s.fontSize??0)+s.spacing:0),e[t]=Math.ceil(r)}),e):e}async layout(e,t){const{padding:i}=this,n=null!=this.seriesRect,s=new ih(0,0,e,t-(i.top+i.bottom));this.seriesRect=s,this.seriesRoot.translationY=i.top,this.seriesRoot.setClipRectCanvasSpace(new ih(0,-i.top,e,t)),this.axes.forEach(i=>{const{position:r="left"}=i;switch(r){case"top":case"bottom":i.range=[0,s.width],i.gridLength=s.height;break;case"right":case"left":{const e=i instanceof Qc;i.range=e?[0,s.height]:[s.height,0],i.gridLength=s.width;break}}i.gridPadding=0,i.translation.x=0,i.translation.y=0,"right"===r?i.translation.x=e:"bottom"===r&&(i.translation.y=t),n||i.resetAnimation("initial"),i.calculateLayout(),i.update()}),await Promise.all(this.series.map(e=>e.update({seriesRect:s})))}};a([qc],rh.prototype,"enabled",2),a([nh(["seriesRoot","inset"])],rh.prototype,"inset",2),a([nh(["seriesRoot","cornerRadius"])],rh.prototype,"cornerRadius",2),a([Zc({changeValue(e,t=[]){const i={axisNode:this.axisGroup,gridNode:this.axisGridGroup,labelNode:this.axisLabelGroup,crossLineLineNode:this.axisCrosslineLineGroup,crossLineRangeNode:this.axisCrosslineRangeGroup,crossLineLabelNode:this.axisCrosslineLabelGroup};for(const n of t)e.includes(n)||(n.detachAxis(i),n.destroy());for(const n of e)t?.includes(n)||n.attachAxis(i)}})],rh.prototype,"axes",2),a([Zc({changeValue(e,t){this.onSeriesChange(e,t)}})],rh.prototype,"series",2);var{SliderWidget:oh}=n.n1,ah=class{constructor(e,t){this.ctx=e,this.sliderHandlers=t,this._min=0,this._max=1,this.minRange=.001,this.dragStartX=0,this.ctx=e,this.toolbar=e.proxyInteractionService.createProxyContainer({type:"toolbar",domManagerId:"navigator-toolbar",classList:["ag-charts-proxy-navigator-toolbar"],orientation:"vertical",ariaLabel:{id:"ariaLabelNavigator"}}),this.sliders=[e.proxyInteractionService.createProxyElement({type:"slider",domIndex:1,ariaLabel:{id:"ariaLabelNavigatorMinimum"},parent:this.toolbar,cursor:"ew-resize"}),e.proxyInteractionService.createProxyElement({type:"slider",domIndex:-1/0,ariaLabel:{id:"ariaLabelNavigatorRange"},parent:this.toolbar,cursor:"grab"}),e.proxyInteractionService.createProxyElement({type:"slider",domIndex:2,ariaLabel:{id:"ariaLabelNavigatorMaximum"},parent:this.toolbar,cursor:"ew-resize"})];for(const[e,t]of["min","pan","max"].entries()){const i=this.sliders[e];i.step=oh.STEP_HUNDRETH,i.keyboardStep=oh.STEP_ONE,i.orientation="horizontal",i.setPreventsDefault(!1),i.addListener("drag-start",i=>this.onDragStart(e,i,t)),i.addListener("drag-move",e=>this.onDrag(i,e,t)),i.addListener("drag-end",()=>this.updateSliderRatios()),i.addListener("contextmenu",e=>this.onContextMenu(i,e))}this.sliders[0].addListener("change",()=>this.onMinSliderChange()),this.sliders[1].addListener("change",()=>this.onPanSliderChange()),this.sliders[2].addListener("change",()=>this.onMaxSliderChange()),this.updateSliderRatios(),this.updateVisibility(!1)}destroy(){this.toolbar.destroy()}updateVisibility(e){this.toolbar.setHidden(!e)}updateZoom(){const{_min:e,_max:t}=this;if(null!=e&&null!=t)return this.ctx.zoomManager.updateZoom("navigator",{x:{min:e,max:t}})}updateBounds(e){this.toolbar.setBounds(e)}updateSliderBounds(e,t){this.sliders[e].setBounds(t)}updateMinMax(e,t){this._min=e,this._max=t,this.updateSliderRatios()}updateSliderRatios(){let{_min:e,_max:t}=this;e=Math.round(100*e)/100,t=Math.round(100*t)/100;const i=this.ctx.localeManager.t("ariaValuePanRange",{min:e,max:t});this.sliders[0].setValueRatio(e),this.sliders[1].setValueRatio(e,{ariaValueText:i}),this.sliders[2].setValueRatio(t)}toCanvasOffsets(e){return{offsetX:this.dragStartX+e.originDeltaX}}moveToFront(e){if(1===e)return;const t=this.sliders[e],i=this.sliders[2-e];this.toolbar.moveChild(i,t.domIndex-1)}onDragStart(e,t,i){const n=this.sliders[e],s=this.toolbar.cssLeft(),r=n.cssLeft();this.dragStartX=s+r+t.offsetX,this.moveToFront(e),"touch"===t.device&&t.sourceEvent.preventDefault(),this.sliderHandlers.onDragStart(i,this.toCanvasOffsets(t))}onDrag(e,t,i){"touch"===t.device&&t.sourceEvent.preventDefault(),this.sliderHandlers.onDrag(i,this.toCanvasOffsets(t))}onContextMenu(e,t){const{offsetX:i,offsetY:n}=t,{x:s,y:r}=this.toolbar.getBounds(),{x:o,y:a}=e.getBounds(),l=i+s+o,c=n+r+a;this.ctx.contextMenuRegistry.dispatchContext("always",{widgetEvent:t,canvasX:l,canvasY:c},void 0)}onPanSliderChange(){const e=this.sliders[1].getValueRatio(),t=this._max-this._min;this._min=(0,s.qE)(0,e,1-t),this._max=this._min+t,this.updateZoom()}onMinSliderChange(){this._min=this.sliders[0].clampValueRatio(0,this._max-this.minRange),this.updateZoom()}onMaxSliderChange(){this._max=this.sliders[2].clampValueRatio(this._min+this.minRange,1),this.updateZoom()}},{Property:lh,SceneChangeDetection:ch,BBox:hh,ExtendedPath2D:uh}=n.n1,dh=class extends n.n1.Path{constructor(){super(...arguments),this.zIndex=3,this.centerX=0,this.centerY=0,this.width=8,this.height=16,this.cornerRadius=4,this.grip=!0,this.gripPath=new uh}setCenter(e,t){this.dirtyPath=!0,this.centerX===e&&this.centerY===t||(this.centerX=e,this.centerY=t,this.markDirty("center"))}static align(e,t,i,n,s,r,o,a,l){const c=e.align(i+s*o)+l,h=c+e.align(i+s*o,s*(a-o))-2*l,u=e.align(n+r/2);e.setCenter(c,u),t.setCenter(h,u)}computeBBox(){const{centerX:e,centerY:t,width:i,height:n}=this;return new hh(e-i/2,t-n/2,i,n)}isPointInPath(e,t){return this.getBBox().containsPoint(e,t)}updatePath(){const{centerX:e,centerY:t,path:i,gripPath:n,strokeWidth:s,cornerRadius:r,grip:o}=this,a=s/2,l=this.layerManager?.canvas?.pixelRatio??1;i.clear(),n.clear();const c=Math.floor(this.width/2*l)/l,h=Math.floor(this.height/2*l)/l;if(i.roundRect(e-c+a,t-h+a,2*(c-a),2*(h-a),r),o)for(let i=-.5;i<=.5;i+=1)for(let s=-1;s<=1;s+=1)n.arc(e+3*i,t+3*s,1,0,2*Math.PI),n.closePath()}renderFill(e,t){const{stroke:i}=this;super.renderFill(e,t),e.fillStyle="string"==typeof i?i:"black",e.fill(this.gripPath.getPath2D())}};dh.className="RangeHandle",a([lh,ch()],dh.prototype,"width",2),a([lh,ch()],dh.prototype,"height",2),a([lh,ch()],dh.prototype,"cornerRadius",2),a([lh,ch()],dh.prototype,"grip",2);var{Path:ph,BBox:gh,ExtendedPath2D:fh,clippedRoundRect:mh,Property:yh,SceneChangeDetection:vh}=n.n1,bh=class extends ph{constructor(){super(...arguments),this.cornerRadius=4,this.zIndex=2,this.x=0,this.y=0,this.width=200,this.height=30,this.min=0,this.max=1,this.visiblePath=new fh}layout(e,t,i,n,s,r){s=isNaN(s)?this.min:s,r=isNaN(r)?this.max:r,e===this.x&&t===this.y&&i===this.width&&this.height===n&&s===this.min&&r===this.max||(this.x=e,this.y=t,this.width=i,this.height=n,this.min=s,this.max=r,this.dirtyPath=!0,this.markDirty("RangeMask.layout"))}computeBBox(){const{x:e,y:t,width:i,height:n}=this;return new gh(e,t,i,n)}computeVisibleRangeBBox(){const{x:e,y:t,width:i,height:n,min:s,max:r}=this,o=e+i*s;return new gh(o,t,e+i*r-o,n)}updatePath(){const{path:e,visiblePath:t,x:i,y:n,width:s,height:r,min:o,max:a,strokeWidth:l,cornerRadius:c}=this,h=l/2;e.clear(),t.clear();const u=this.align(i)+h,d=this.align(n)+h,p=this.align(i,s)-2*h,g=this.align(n,r)-2*h,f=this.align(i+s*o)+h,m=f+this.align(i+s*o,s*(a-o))-2*h,y={topLeft:c,topRight:c,bottomRight:c,bottomLeft:c};mh(e,u,d,p,g,y,new gh(u,d,f-u,g)),mh(e,u,d,p,g,y,new gh(m,d,p+u-m,g)),m-f>1&&mh(t,u,d,p,g,y,new gh(f,d,m-f,g))}renderStroke(e,t){super.renderStroke(e,t),super.renderStroke(e,this.visiblePath.getPath2D())}};bh.className="RangeMask",a([yh,vh()],bh.prototype,"cornerRadius",2);var Ch=class extends n.n1.Group{constructor(e){super({name:"rangeSelectorGroup",zIndex:n.n1.ZIndexMap.NAVIGATOR}),this.x=0,this.y=0,this.width=200,this.height=30,this.lOffset=0,this.rOffset=0,this.background=this.appendChild(new n.n1.TranslatableGroup({name:"navigator-background",zIndex:1})),this.append(e)}layout(e,t,i,n,s,r){this.x=e,this.y=t,this.width=i,this.height=n,this.lOffset=s,this.rOffset=r,this.background.translationX=e,this.background.translationY=t,this.markDirty("RangeSelector")}updateBackground(e,t){null!=e&&this.background.removeChild(e),null!=t&&this.background.appendChild(t),this.markDirty("RangeSelector")}computeBBox(){const{x:e,y:t,width:i,height:s,lOffset:r,rOffset:o}=this;return new n.n1.BBox(e-r,t,i+(r+o),s)}},{BaseModuleInstance:wh,ObserveChanges:Sh,Property:xh}=n.n1,Eh=class extends wh{constructor(e){super(),this.ctx=e,this.enabled=!1,this.mask=new bh,this.minHandle=new dh,this.maxHandle=new dh,this.maskVisibleRange={id:"navigator-mask-visible-range",getBBox:()=>this.mask.computeVisibleRangeBBox(),toCanvasBBox:()=>this.mask.computeVisibleRangeBBox(),fromCanvasPoint:(e,t)=>({x:e,y:t})},this.height=30,this.cornerRadius=0,this.spacing=10,this.x=0,this.y=0,this.width=0,this.rangeSelector=new Ch([this.mask,this.minHandle,this.maxHandle]),this.destroyFns.push(e.scene.attachNode(this.rangeSelector),this.ctx.localeManager.addListener("locale-changed",()=>this.updateZoom()),this.ctx.layoutManager.registerElement(n.n1.LayoutElement.Navigator,e=>this.onLayoutStart(e)),this.ctx.layoutManager.addListener("layout:complete",e=>this.onLayoutComplete(e)),e.zoomManager.addListener("zoom-change",e=>this.onZoomChange(e))),this.domProxy=new ah(e,this),this.updateGroupVisibility(),this.miniChart=new rh(e)}updateBackground(e,t){this.rangeSelector?.updateBackground(e,t)}updateGroupVisibility(){const{enabled:e}=this;null!=this.rangeSelector&&e!==this.rangeSelector.visible&&(this.rangeSelector.visible=e,this.domProxy.updateVisibility(e),e?this.updateZoom():this.ctx.zoomManager.updateZoom("navigator"))}onLayoutStart(e){if(this.enabled){const{layoutBox:t}=e,i=this.height+this.spacing;t.shrink(i,"bottom"),this.y=t.y+t.height+this.spacing}else this.y=0;if(this.enabled&&this.miniChart){const{top:t,bottom:i}=this.miniChart.computeAxisPadding();e.layoutBox.shrink(t+i,"bottom"),this.y-=i,this.miniChart.inset=this.mask.strokeWidth/2,this.miniChart.cornerRadius=this.mask.cornerRadius}}onLayoutComplete(e){const{x:t,width:i}=e.series.rect,{y:n,height:r}=this;if(this.domProxy.updateVisibility(this.enabled),this.enabled){const{_min:e,_max:s}=this.domProxy;this.layoutNodes(t,n,i,r,e,s),this.domProxy.updateBounds({x:t,y:n,width:i,height:r})}this.x=t,this.width=i,this.miniChart?.layout(i,r).catch(e=>s.Vy.error(e))}canDrag(){return this.enabled&&this.ctx.interactionManager.isState(n.n1.InteractionState.ZoomDraggable)}onDragStart(e,{offsetX:t}){this.canDrag()&&("pan"===e&&(this.panStart=(t-this.x)/this.width-this.domProxy._min),this.ctx.zoomManager.fireZoomPanStartEvent("navigator"))}onDrag(e,{offsetX:t}){if(!this.canDrag())return;const{panStart:i,x:n,width:r}=this,{minRange:o}=this.domProxy;let{_min:a,_max:l}=this.domProxy;const c=(t-n)/r;if("min"===e)a=(0,s.qE)(0,c,l-o);else if("max"===e)l=(0,s.qE)(a+o,c,1);else if("pan"===e&&null!=i){const e=l-a;a=(0,s.qE)(0,c-i,1-e),l=a+e}this.domProxy._min=a,this.domProxy._max=l,this.updateZoom()}onZoomChange(e){const{x:t}=e;if(!t)return;const{x:i,y:n,width:s,height:r}=this,{min:o,max:a}=t;this.domProxy.updateMinMax(o,a),this.layoutNodes(i,n,s,r,o,a)}layoutNodes(e,t,i,n,s,r){const{rangeSelector:o,mask:a,minHandle:l,maxHandle:c}=this;a.layout(e,t,i,n,s,r),o.layout(e,t,i,n,l.width/2,c.width/2),dh.align(l,c,e,t,i,n,s,r,a.strokeWidth/2),s+(r-s)/2<.5?(l.zIndex=3,c.zIndex=4):(l.zIndex=4,c.zIndex=3),[l,this.maskVisibleRange,c].forEach((i,n)=>{const s=i.getBBox(),r={x:s.x-e,y:s.y-t,height:s.height,width:s.width};this.domProxy.updateSliderBounds(n,r)})}updateZoom(){this.enabled&&this.domProxy.updateZoom()}updateData(e){return this.miniChart?.updateData(e)}async processData(e){if(this.miniChart)return this.miniChart?.processData(e)}};a([Sh((e,t,i)=>{e.updateBackground(i?.root,t?.root)})],Eh.prototype,"miniChart",2),a([xh,Sh((e,t)=>{e.ctx.zoomManager.setNavigatorEnabled(Boolean(t)),e.updateGroupVisibility()})],Eh.prototype,"enabled",2),a([xh],Eh.prototype,"height",2),a([xh,Sh((e,t)=>{e.mask.cornerRadius=t})],Eh.prototype,"cornerRadius",2),a([xh],Eh.prototype,"spacing",2);var Ah={type:"root",optionsKey:"navigator",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:e=>new Eh(e),removable:!1,themeTemplate:{navigator:{enabled:!1,height:18,cornerRadius:4,mask:{fill:{$ref:"foregroundColor"},fillOpacity:.1,stroke:{$ref:"borderColor"},strokeWidth:1},minHandle:{fill:{$ref:"backgroundColor"},stroke:{$ref:"borderColor"},strokeWidth:1,width:12,height:24,cornerRadius:4},maxHandle:{fill:{$ref:"backgroundColor"},stroke:{$ref:"borderColor"},strokeWidth:1,width:12,height:24,cornerRadius:4},miniChart:{enabled:!1,label:{color:{$ref:"textColor"},fontSize:{$rem:[n.n1.FONT_SIZE_RATIO.SMALLER]},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},spacing:5},padding:{top:0,bottom:0}}}}},{ToolbarButtonProperties:Mh,Property:Th}=n.n1,Dh=class extends Mh{};a([Th],Dh.prototype,"value",2);var{ChartAxisDirection:Ih,LayoutElement:Rh,PropertiesArray:kh,Toolbar:Ph,Property:_h}=n.n1,Lh=class extends n.n1.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!1,this.buttons=new kh(Dh),this.verticalSpacing=10,this.container=e.domManager.addChild("canvas-overlay","range-buttons"),this.container.role="presentation",this.toolbar=new Ph(this.ctx.localeManager),this.toolbar.addClass("ag-charts-range-buttons"),this.container.append(this.toolbar.getElement()),this.destroyFns.push(this.toolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),e.layoutManager.registerElement(Rh.ToolbarBottom,this.onLayoutStart.bind(this)),e.zoomManager.addListener("zoom-change",this.onZoomChanged.bind(this)),this.teardown.bind(this))}teardown(){this.container.removeChild(this.toolbar.getElement()),this.toolbar.destroy()}onLayoutStart(e){const{buttons:t,ctx:i,enabled:n,toolbar:s,verticalSpacing:r}=this,{layoutBox:o}=e;if(!n||!i.zoomManager.isZoomEnabled())return void s.setHidden(!0);s.setHidden(!1),s.updateButtons(t);const a=s.getBounds().height;s.setBounds({x:o.x,y:o.y+o.height-a,width:o.width,height:a}),o.shrink({bottom:a+r})}onZoomChanged(){this.toolbar.clearActiveButton()}onButtonPress({button:{index:e}}){const{zoomManager:t}=this.ctx,i=this.buttons.at(e);if(!i)return;const{value:n}=i;"number"==typeof n?t.extendToEnd("zoom-buttons",Ih.X,n):Array.isArray(n)?t.updateWith("zoom-buttons",Ih.X,()=>n):"function"==typeof n&&t.updateWith("zoom-buttons",Ih.X,n),this.toolbar.toggleActiveButtonByIndex(e)}};a([_h],Lh.prototype,"enabled",2),a([_h],Lh.prototype,"buttons",2);var Nh=864e5,Oh=30*Nh,Fh={type:"root",optionsKey:"ranges",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:e=>new Lh(e),themeTemplate:{ranges:{enabled:!1,buttons:[{label:"toolbarRange1Month",ariaLabel:"toolbarRange1MonthAria",value:Oh},{label:"toolbarRange3Months",ariaLabel:"toolbarRange3MonthsAria",value:3*Oh},{label:"toolbarRange6Months",ariaLabel:"toolbarRange6MonthsAria",value:6*Oh},{label:"toolbarRangeYearToDate",ariaLabel:"toolbarRangeYearToDateAria",value:(e,t)=>[new Date(`${new Date(t).getFullYear()}-01-01`).getTime(),t]},{label:"toolbarRange1Year",ariaLabel:"toolbarRange1YearAria",value:365*Nh},{label:"toolbarRangeAll",ariaLabel:"toolbarRangeAllAria",value:(e,t)=>[e,t]}]}}},Gh=class e extends n.n1.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.activeSections=new Set,this.sectionButtons={annotations:[],chartToolbar:[]},this.container=this.ctx.domManager.addChild("canvas-overlay","shared-toolbar"),this.container.role="presentation"}getSharedToolbar(e){return this.sharedToolbar||this.createSharedToolbar(),this.toolbarWithSection(e)}createSharedToolbar(){this.sharedToolbar=new n.n1.Toolbar(this.ctx.localeManager,"vertical"),this.sharedToolbar.addClass("ag-charts-shared-toolbar"),this.container.append(this.sharedToolbar.getElement()),this.destroyFns.push(()=>{this.sharedToolbar&&(this.container.removeChild(this.sharedToolbar.getElement()),this.sharedToolbar.destroy(),this.sharedToolbar=void 0)})}toolbarWithSection(t){const i=this.sharedToolbar,n={layout:(e,n)=>{if(null!=this.firstLayoutSection&&this.firstLayoutSection!==t&&this.activeSections.has(this.firstLayoutSection))return;this.firstLayoutSection=t;const s=i.getBounds().width;i.setBounds({x:e.x,y:e.y,width:s}),e.shrink({left:s+i.horizontalSpacing+(n??0)})},addToolbarListener:(e,n)=>i.addToolbarListener(e,e=>{const i=this.getSectionIndex(t,e.button.index);if(i<0)return;const s={...e,button:this.sectionButtons[t][i]};n(s)}),updateButtons:n=>{this.sectionButtons[t]=n;const s=e.SECTION_ORDER.flatMap(e=>this.sectionButtons[e]);i.updateButtons(s)},updateButtonByIndex:(e,n)=>{i.updateButtonByIndex(this.getIndex(t,e),n)},toggleActiveButtonByIndex:e=>{i.toggleActiveButtonByIndex(this.getIndex(t,e))},toggleButtonEnabledByIndex:(e,n)=>{i.toggleButtonEnabledByIndex(this.getIndex(t,e),n)},setHidden:n=>{n?this.activeSections.delete(t):this.activeSections.add(t);let s=0;for(const r of e.SECTION_ORDER)if(r===t)for(const e of this.sectionButtons[t].keys())i.setButtonHiddenByIndex(s+e,n);else s+=this.sectionButtons[r].length},destroy:()=>{n.setHidden(!0),0===this.activeSections.size&&this.destroy()},clearActiveButton:i.clearActiveButton.bind(i),addListener:i.addListener.bind(i),removeListener:i.removeListener.bind(i)};return n.setHidden(!1),n}getIndex(t,i){let n=0;for(const s of e.SECTION_ORDER){if(s===t)return n+i;n+=this.sectionButtons[s].length}return-1}getSectionIndex(t,i){let n=0;for(const s of e.SECTION_ORDER){if(s===t)return i>=n+this.sectionButtons[t].length?-1:i-n;n+=this.sectionButtons[s].length}return-1}};Gh.SECTION_ORDER=["chartToolbar","annotations"];var Bh=Gh,Vh={type:"context",contextKey:"sharedToolbar",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:e=>new Bh(e)},{CachedTextMeasurerPool:Hh,ZIndexMap:Uh,LayoutElement:zh,Property:Wh,BaseProperties:jh,valueProperty:$h,TextUtils:Kh,Group:Yh,Label:qh,Rect:Xh,Text:Zh}=n.n1,Qh={ohlc:62,candlestick:62,"hollow-candlestick":62,line:96,"step-line":96,hlc:184,"high-low":800},Jh={up:"positive",down:"negative"},eu={hlc:"altNeutral"},tu=class extends jh{constructor(){super(...arguments),this.fill="black",this.fillOpacity=1}};a([Wh],tu.prototype,"fill",2),a([Wh],tu.prototype,"fillOpacity",2);var iu=class extends n.n1.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!1,this.openKey=void 0,this.highKey=void 0,this.lowKey=void 0,this.closeKey=void 0,this.volumeKey=void 0,this.title=new qh,this.positive=new qh,this.negative=new qh,this.neutral=new qh,this.altNeutral=new qh,this.background=new tu,this.layoutStyle="block",this.id="status-bar",this.data=void 0,this.layer=new Yh({name:"StatusBar",zIndex:Uh.STATUS_BAR}),this.labelGroup=this.layer.appendChild(new n.n1.TranslatableGroup),this.backgroundNode=this.labelGroup.appendChild(new Xh),this.labels=[{label:"O",configuration:2,title:this.labelGroup.appendChild(new Zh),value:this.labelGroup.appendChild(new Zh),id:"openValue",key:"openKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"H",configuration:16,title:this.labelGroup.appendChild(new Zh),value:this.labelGroup.appendChild(new Zh),id:"highValue",key:"highKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"H",configuration:256,title:this.labelGroup.appendChild(new Zh),value:this.labelGroup.appendChild(new Zh),style:"neutral",id:"highValue",key:"highKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"L",configuration:8,title:this.labelGroup.appendChild(new Zh),value:this.labelGroup.appendChild(new Zh),id:"lowValue",key:"lowKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"L",configuration:512,title:this.labelGroup.appendChild(new Zh),value:this.labelGroup.appendChild(new Zh),style:"neutral",id:"lowValue",key:"lowKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"C",configuration:4,title:this.labelGroup.appendChild(new Zh),value:this.labelGroup.appendChild(new Zh),id:"closeValue",key:"closeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"C",configuration:128,title:this.labelGroup.appendChild(new Zh),value:this.labelGroup.appendChild(new Zh),id:"closeValue",key:"closeKey",style:"neutral",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"",configuration:64,title:this.labelGroup.appendChild(new Zh),value:this.labelGroup.appendChild(new Zh),style:"neutral",id:"closeValue",key:"closeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2})},{label:"Vol",configuration:32,title:this.labelGroup.appendChild(new Zh),value:this.labelGroup.appendChild(new Zh),id:"volumeValue",key:"volumeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2})}],this.highlightManager=e.highlightManager,this.labelGroup.visible=!1,this.destroyFns.push(e.scene.attachNode(this.layer),e.layoutManager.registerElement(zh.Overlay,e=>this.startPerformLayout(e)),e.layoutManager.addListener("layout:complete",e=>this.onLayoutComplete(e)),e.highlightManager.addListener("highlight-change",()=>this.updateHighlight()))}async processData(e){if(!this.enabled||null==this.data)return;const t=[];for(const e of this.labels){const{id:i,key:n}=e,s=this[n];null==s?e.domain=void 0:t.push($h(s,"number",{id:i}))}if(0===t.length)return;const{processedData:i,dataModel:n}=await e.request(this.id,this.data,{props:t});for(const e of this.labels){const{id:t,key:s}=e;null!=this[s]&&(e.domain=n.getDomain(this,t,"value",i))}}startPerformLayout(e){if(this.labelGroup.translationX=0,this.labelGroup.translationY=0,!this.enabled)return;const{layoutBox:t}=e;this.labelGroup.translationY=t.y+0;const i=Math.max(this.title.fontSize,this.positive.fontSize,this.negative.fontSize),n=Kh.getLineHeight(i),s=Qh[this.getChartType()]??0;let r,o=0,a="alphabetic";if("block"===this.layoutStyle)t.shrink(0+n+8,"top"),r=i+(n-i)/2;else{const{title:e}=this.ctx.chartService;if(a="top",r=0+e.padding,e.enabled){const t=e.node.getBBox();o=t.x+t.width+12}else o=e.padding}for(const{label:e,configuration:t,title:i,value:n,domain:l,formatter:c}of this.labels){if(null==l||0===(s&t)){i.visible=!1,n.visible=!1;continue}const h=Math.max(Hh.measureText(c.format(l[0]),{font:this.positive.getFont(),textBaseline:a,textAlign:"left"}).width,Hh.measureText(c.format(l[1]),{font:this.positive.getFont(),textBaseline:a,textAlign:"left"}).width,Hh.measureText(c.format(l[0]),{font:this.negative.getFont(),textBaseline:a,textAlign:"left"}).width,Hh.measureText(c.format(l[1]),{font:this.negative.getFont(),textBaseline:a,textAlign:"left"}).width);i.visible=!0,n.visible=!0;const u=Hh.measureText(e,{font:this.title.getFont(),textBaseline:a,textAlign:"left"});i.setFont(this.title),i.fill=this.title.color,i.text=e,i.textBaseline=a,i.y=r,i.x=o,o+=u.width+4,n.textBaseline=a,n.y=r,n.x=o,o+=h+12}this.backgroundNode.x=0,this.backgroundNode.y=0,this.backgroundNode.width=o-12,this.backgroundNode.height=n+0+8,this.backgroundNode.fill=this.background.fill,this.backgroundNode.fillOpacity=this.background.fillOpacity}onLayoutComplete(e){this.labelGroup.translationX=e.series.rect.x,this.updateHighlight()}updateHighlight(){if(!this.enabled)return;const e=this.highlightManager.getActiveHighlight(),t=e?.datum??this.data?.at(-1);if(null==t)return void(this.labelGroup.visible=!1);this.labelGroup.visible=!0;const i=e?.itemId;let n=null!=i?Jh[i]:void 0;null==n&&null!=this.openKey&&null!=this.closeKey&&(n=t[this.openKey]<t[this.closeKey]?"positive":"negative");for(const{domain:e,value:i,key:s,formatter:r,style:o}of this.labels){if(null==e)continue;let a=o??n??"neutral";"neutral"===a&&(a=eu[this.getChartType()]??a);const l=this[s],c=null!=l?t?.[l]:void 0;i.setFont(this[a]),i.fill=this[a].color,i.text="number"==typeof c?r.format(c):""}}getChartType(){let e=this.ctx.chartService.publicApi?.getOptions()?.chartType;return null!=e&&null!=Qh[e]||(e="candlestick"),e}};a([Wh],iu.prototype,"enabled",2),a([Wh],iu.prototype,"openKey",2),a([Wh],iu.prototype,"highKey",2),a([Wh],iu.prototype,"lowKey",2),a([Wh],iu.prototype,"closeKey",2),a([Wh],iu.prototype,"volumeKey",2),a([Wh],iu.prototype,"title",2),a([Wh],iu.prototype,"positive",2),a([Wh],iu.prototype,"negative",2),a([Wh],iu.prototype,"neutral",2),a([Wh],iu.prototype,"altNeutral",2),a([Wh],iu.prototype,"background",2),a([Wh],iu.prototype,"layoutStyle",2);var nu={type:"root",identifier:"status-bar",optionsKey:"statusBar",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:e=>new iu(e),themeTemplate:{statusBar:{enabled:!1,layoutStyle:n.n1.ThemeSymbols.DEFAULT_CAPTION_LAYOUT_STYLE,title:{color:{$ref:"textColor"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},positive:{color:{$palette:"up.stroke"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},negative:{color:{$palette:"down.stroke"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},neutral:{color:{$palette:"neutral.stroke"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},background:{fill:{$ref:"backgroundColor"},fillOpacity:.5},altNeutral:{color:"gray",fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}}}}},{BaseProperties:su,CartesianAxis:ru,ChartAxisDirection:ou,ContinuousScale:au,ChartUpdateType:lu,ObserveChanges:cu,TooltipManager:hu,Property:uu,findMinMax:du,isObjectWithStringProperty:pu}=n.n1,gu=n.n1.Debug.create("sync");function fu(e,t,i){const n=e.getKeys(t),s=e.getKeys(i);return e.shouldFlipXY?.()?[s,n]:[n,s]}function mu(e="x"){switch(e){case"x":return[ou.X];case"y":return[ou.Y];case"xy":return[ou.X,ou.Y]}}var yu=class extends su{constructor(e){super(),this.moduleContext=e,this.enabled=!1,this.axes="x",this.nodeInteraction=!0,this.zoom=!0,this.domainMode="key",this.domainSync=new s.iN}updateSiblings(e){const{syncManager:t}=this.moduleContext;for(const i of t.getGroupSiblings(e??this.groupId))gu("ChartSync.updateSiblings()",i.id,i),this.updateChart(i)}updateChart(e,t=lu.PROCESS_DOMAIN){gu("ChartSync.updateChart()",e.id,lu[t],e),t===lu.PROCESS_DOMAIN?e.ctx.updateService.update(t,{forceNodeDataRefresh:!0}):e.ctx.updateService.update(t)}enabledZoomSync(){const{syncManager:e,zoomManager:t}=this.moduleContext;this.disableZoomSync?.(),this.disableZoomSync=t.addListener("zoom-change",()=>{for(const t of e.getGroupSiblings(this.groupId))t.modulesManager.getModule("sync")?.zoom&&t.ctx.zoomManager.updateZoom("sync",this.mergeZoom(t))})}enabledNodeInteractionSync(){const{highlightManager:e}=this.moduleContext;this.disableNodeInteractionSync?.(),this.disableNodeInteractionSync=e.addListener("highlight-change",this.onHighlightChange.bind(this))}onHighlightChange(e){const{syncManager:t}=this.moduleContext;if(e.callerId.endsWith("-sync"))return;gu("ChartSync.onHighlightChange()",e);const i=e.currentHighlight?.series,[n]=mu(this.axes),r=n===ou.X?ou.Y:ou.X,[o,a]=i?fu(i,n,r):[];let l=o?.[0]?e.currentHighlight?.datum?.[o[0]]:void 0;const c=(0,s.$P)(l);if(c&&(l=l.getTime()),!e.currentHighlight?.datum){for(const e of t.getGroupSiblings(this.groupId))e.modulesManager.getModule("sync")?.nodeInteraction&&(e.ctx.highlightManager.updateHighlight(`${e.id}-sync`),e.ctx.tooltipManager.removeTooltip(`${e.id}-sync`));return}const h="multi-series"===t.getGroupSyncMode(this.groupId);this.findMatchingHighlightNodes(n,r,h?a:[],c,l,e)}findMatchingHighlightNodes(e,t,i,n,r,o){const{syncManager:a}=this.moduleContext;gu("ChartSync.findMatchingHighlightNodes()",{mainDirection:e,secondaryKeys:i});for(const l of a.getGroupSiblings(this.groupId)){if(!l.modulesManager.getModule("sync")?.nodeInteraction)continue;let a=!1;for(const o of l.axes){if(!ru.is(o)||o.direction!==e)continue;const c=l.series.filter(n=>{if(!n.visible)return!1;if(i.length>0){const[,s]=fu(n,e,t);return i.every(e=>s.includes(e))}return!0}).map(this.findMatchingNodes(o,e,n,r)).filter(s.vM);if(1===c.length&&c[0]?.nodeDatum!==l.ctx.highlightManager.getActiveHighlight()){this.dispatchHighlightUpdate(l,c[0].nodeDatum),a=!0;break}}a||(gu("ChartSync.findMatchingHighlightNodes() - no matching nodes",l.id,o),this.dispatchHighlightUpdate(l))}}findMatchingNodes(e,t,i,n){return s=>{const r=s.getKeys(e.direction);if(e.keys.length&&!e.keys.some(e=>r.includes(e)))return;const o=s.contextNodeData?.nodeData??[];if(!o?.length)return;const a=o[0],l=`${t}Key`;if(!pu(a,l))return;const c=a[l],h=o.find(e=>{const t=e.datum[c];return i?t.getTime()===n:t===n});return h?{series:s,nodeDatum:h}:null}}dispatchHighlightUpdate(e,t){gu("ChartSync.dispatchHighlightUpdate()",e.id,t),e.ctx.highlightManager.updateHighlight(`${e.id}-sync`,t);const i=t?.series.tooltipEnabled??e.tooltip.enabled;if(t&&i){const i=e.seriesAreaBoundingBox,n=i.x+(t.midPoint?.x??t.point?.x??0),s=i.y+(t.midPoint?.y??t.point?.y??0),r=hu.makeTooltipMeta({type:"pointermove",canvasX:n,canvasY:s},t.series,t,void 0);e.ctx.tooltipManager.updateTooltip(`${e.id}-sync`,r,e.getTooltipContent(t.series,t.datumIndex,t))}else e.ctx.tooltipManager.removeTooltip(`${e.id}-sync`);this.updateChart(e,lu.SERIES_UPDATE)}async getSyncedDomain(e){if(!ru.is(e)||"xy"!==this.axes&&this.axes!==e.direction)return;const{groupState:t,directionDomains:i,domainsByKey:n,positionDomains:s}=this.updateDomainState(e);return this.validateAxis(e,t),await this.waitForDomainsToBeReady(),"position"===this.domainMode?this.calculateDerivedDomain(e,s):"direction"===this.domainMode||0===e.keys.length?this.calculateDerivedDomain(e,i):this.calculateKeyDerivedDomain(e,n)}updateDomainState(e){var t,i,n,s,r;const{syncManager:o}=this.moduleContext,a=o.getChart().id,l=e.id,c=o.getGroupState(this.groupId);if(!c)throw new Error("AG Charts - no GroupState for groupId: "+this.groupId);const h=c.domains??(c.domains={}),u=h[t=e.direction]??(h[t]={derived:[],sources:{},dirty:!0});((i=u.sources)[a]??(i[a]={}))[l]=e.dataDomain.domain,u.dirty=!0;const d=c.domainsByKey??(c.domainsByKey={});for(const t of e.keys??[]){const i=d[t]??(d[t]={derived:[],sources:{},dirty:!0});((n=i.sources)[a]??(n[a]={}))[l]=e.dataDomain.domain,i.dirty=!0}const p=c.domainsByPosition??(c.domainsByPosition={}),g=p[s=e.position]??(p[s]={derived:[],sources:{},dirty:!0});return((r=g.sources)[a]??(r[a]={}))[l]=e.dataDomain.domain,g.dirty=!0,{groupState:c,directionDomains:u,domainsByKey:d,positionDomains:g}}validateAxis(e,t){const i="multi-series"===this.moduleContext.syncManager.getGroupSyncMode(this.groupId);mu(this.axes).includes(e.direction)&&(i?this.validateMultiSeries(e,t):this.validateSingleSeries(e,t))}validateMultiSeries(e,t){const{min:i,max:n,nice:r,reverse:o}=e,a=new Set(e.boundSeries.flatMap(t=>t.getKeys(e.direction)));for(const e of t.members){const{axes:t,modulesManager:l}=e,c=mu(l.getModule("sync")?.axes),h=t.filter(e=>c.includes(e.direction)).filter(e=>e.boundSeries.some(t=>t.getKeys(e.direction).some(e=>a.has(e))));if(0===h.length)continue;const[u]=h;if(u.min!==i||u.max!==n||u.nice!==r||u.reverse!==o)return s.Vy.warnOnce("To allow synchronization, ensure that all synchronized axes with matching keys have matching min, max, nice, and reverse properties."),void(this.enabled=!1)}}validateSingleSeries(e,t){const i=t.members,[{axes:n}]=i,{direction:r,min:o,max:a,nice:l,reverse:c}=e;for(const e of n)if(r===e.direction&&(l!==e.nice||c!==e.reverse||o!==e.min&&((0,s.Bf)(o)||(0,s.Bf)(e.min))||a!==e.max&&((0,s.Bf)(a)||(0,s.Bf)(e.max))))return s.Vy.warnOnce("To allow synchronization, ensure that all charts have matching min, max, nice, and reverse properties on the synchronized axes."),void(this.enabled=!1)}calculateDerivedDomain(e,t){if(!t.dirty)return t.derived;const i=t.derived;return t.derived=(0,s.Am)(Object.values(t.sources).map(e=>Object.values(e)).flat(2)),au.is(e.scale)&&(t.derived=du(t.derived)),t.dirty=!1,(0,s.r1)(i,t.derived)||(gu(e.id,"updated",e.keys,{before:i,after:t.derived}),this.updateSiblings()),t.derived}calculateKeyDerivedDomain(e,t){let i=[],n=[],r=!1;for(const o of e.keys??[]){const a=t[o],l=a.derived;i.push(...l),a.dirty?(a.derived=(0,s.Am)(Object.values(a.sources).map(e=>Object.values(e)).flat(2)),au.is(e.scale)&&(a.derived=du(a.derived)),n.push(...a.derived),a.dirty=!1,r||(r=!(0,s.r1)(l,a.derived))):n.push(...a.derived)}return au.is(e.scale)&&(i=du(i),n=du(n)),r&&!(0,s.r1)(i,n)&&(gu(e.id,"updated",e.keys,{before:i,after:n}),this.updateSiblings()),n}removeAxis(e){if(!ru.is(e)||"xy"!==this.axes&&this.axes!==e.direction)return;const{syncManager:t}=this.moduleContext,i=t.getGroupState(this.groupId),n=t.getChart().id,s=e.id;delete i?.domains?.[e.direction]?.sources?.[n]?.[s];for(const t of e.keys??[])delete i?.domainsByKey?.[t]?.sources?.[n]?.[s];delete i?.domainsByPosition?.[e.position]?.sources?.[n]?.[s]}async waitForDomainsToBeReady(){const{syncManager:e}=this.moduleContext;let t=0;for(;e.getGroupMembers(this.groupId).some(e=>"init"===e.syncStatus);)gu("ChartSync.waitForDomainsToBeReady() - waiting for all domains to be calculated",this.groupId),await this.domainSync.await(),t++;t>0&&gu("ChartSync.waitForDomainsToBeReady() - waited for",t,"iterations"),this.domainSync.notify()}mergeZoom(e){const{zoomManager:t}=this.moduleContext;if("xy"===this.axes)return t.getZoom();const i=e.ctx.zoomManager.getZoom()??{};return i[this.axes]=t.getZoom()?.[this.axes],i}onEnabledChange(){const{syncManager:e}=this.moduleContext;this.enabled?e.subscribe(this.groupId):e.unsubscribe(this.groupId),this.updateSiblings(),this.onNodeInteractionChange(),this.onZoomChange()}onGroupIdChange(e,t){if(!this.enabled||e===t)return;const{syncManager:i}=this.moduleContext;i.unsubscribe(t),i.subscribe(e),this.updateSiblings(t),this.updateSiblings(e)}onAxesChange(){if(!this.enabled)return;const{syncManager:e}=this.moduleContext;this.updateChart(e.getChart())}onNodeInteractionChange(){this.enabled&&this.nodeInteraction?this.enabledNodeInteractionSync():this.disableNodeInteractionSync?.()}onZoomChange(){this.enabled&&this.zoom?this.enabledZoomSync():this.disableZoomSync?.()}destroy(){const{syncManager:e}=this.moduleContext;e.unsubscribe(this.groupId),this.updateSiblings(),this.disableZoomSync?.()}};yu.className="Sync",a([uu,cu(e=>e.onEnabledChange())],yu.prototype,"enabled",2),a([uu,cu((e,t,i)=>e.onGroupIdChange(t,i))],yu.prototype,"groupId",2),a([uu,cu(e=>e.onAxesChange())],yu.prototype,"axes",2),a([uu,cu(e=>e.onNodeInteractionChange())],yu.prototype,"nodeInteraction",2),a([uu,cu(e=>e.onZoomChange())],yu.prototype,"zoom",2),a([uu,cu(e=>e.onAxesChange())],yu.prototype,"domainMode",2);var vu={type:"root",optionsKey:"sync",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:e=>new yu(e),themeTemplate:{sync:{enabled:!1}}},{Property:bu}=n.n1,Cu="#2196f3",wu=class extends n.n1.Rect{constructor(){super(...arguments),this.fill=Cu,this.fillOpacity=.2,this.zIndex=n.n1.ZIndexMap.ZOOM_SELECTION}updateValid(){this.fill=Cu}updateInvalid(){this.fill="#8a8a8a"}};wu.className="ZoomRect",a([bu],wu.prototype,"fill",2),a([bu],wu.prototype,"fillOpacity",2);var Su={min:0,max:1},xu=Su.max-Su.min,Eu="middle",Au=(e,t=Su.min,i=Su.max)=>(0,s.qE)(t,e,i);function Mu(){return{x:{...Su},y:{...Su}}}function Tu(e){return e.x.max-e.x.min}function Du(e){return e.y.max-e.y.min}function Iu(e,t,i=1e-10){return(0,s.YX)(e.min,t.min,i)&&(0,s.YX)(e.max,t.max,i)}function Ru(e,t,i){return Iu(e.x,t.x,i)&&Iu(e.y,t.y,i)}function ku(e){return{x:{min:e?.x?.min??Su.min,max:e?.x?.max??Su.max},y:{min:e?.y?.min??Su.min,max:e?.y?.max??Su.max}}}function Pu(e,t,i){if(!e)return{x:0,y:0};const n=Au(t-e.x,0,e.x+e.width),s=Au(i-e.y,0,e.y+e.height),r=1/e.width*n,o=1-1/e.height*s;return{x:Au(r),y:Au(o)}}function _u(e,t,i){return{x:{min:e.x.min+t,max:e.x.max+t},y:{min:e.y.min+i,max:e.y.max+i}}}function Lu(e,t,i){return{x:{min:e.x.min,max:e.x.min+Tu(e)*t},y:{min:e.y.min,max:e.y.min+Du(e)*i}}}function Nu(e,t,i){const n=Tu(e),s=Du(e),r=e.x.min+n/2,o=e.y.min+s/2;return{x:{min:r-n*t/2,max:r+n*t/2},y:{min:o-s*i/2,max:o+s*i/2}}}function Ou(e,t,i,n){const{min:s,max:r}=t,o=s+(r-s)/2,a=e.max-e.min;switch(i){case"start":return{min:s,max:t.min+a};case"end":return{min:t.max-a,max:r};case"middle":return{min:o-a/2,max:o+a/2};case"pointer":return function(e,t,i){const n=e.max-e.min,s=i-i*(1-(t.max-t.min-n));return{min:e.min+s,max:e.max+s}}(e,t,n??o);default:return{min:s,max:r}}}function Fu(e){return{x:Gu(e.x),y:Gu(e.y)}}function Gu(e){const t=e.max-e.min;let i=e.max>Su.max?Su.max-t:e.min,n=e.min<Su.min?t:e.max;return i=Math.max(Su.min,i),n=Math.min(Su.max,n),{min:i,max:n}}var Bu=class{update(e,t,i,s,r,o){return this.oldZoom??(this.oldZoom=ku(t===n.n1.ChartAxisDirection.X?{...r,x:o}:{...r,y:o})),this.updateCoords(e.currentX,e.currentY),this.updateZoom(t,i,s)}stop(){this.coords=void 0,this.oldZoom=void 0}updateCoords(e,t){this.coords?(this.coords.x2=e,this.coords.y2=t):this.coords={x1:e,y1:t,x2:e,y2:t}}updateZoom(e,t,i){const{coords:s,oldZoom:r}=this;let o=ku(r);if(!s||!r)return e===n.n1.ChartAxisDirection.X?o.x:o.y;const a=Pu(i,s.x1,s.y1),l=Pu(i,s.x2,s.y2);if(e===n.n1.ChartAxisDirection.X){const e=(l.x-a.x)*Tu(r);return o.x.max+=e,o.x=Ou(o.x,r.x,t,a.x),o=Fu(o),o.x}const c=(l.y-a.y)*Du(r);return o.y.max-=c,o.y=Ou(o.y,r.y,t,a.y),o=Fu(o),o.y}},Vu=class{constructor(e,t,i,n,s,r){this.contextMenuRegistry=e,this.zoomManager=t,this.getModuleProperties=i,this.getRect=n,this.updateZoom=s,this.isZoomValid=r}registerActions(e){const{contextMenuRegistry:t}=this;if(!e)return t.setVisible("zoom-to-cursor",!1),void t.setVisible("pan-to-cursor",!1);t.setVisible("zoom-to-cursor",!0),t.setVisible("pan-to-cursor",!0),t.builtins.items["zoom-to-cursor"].action=this.onZoomToHere.bind(this),t.builtins.items["pan-to-cursor"].action=this.onPanToHere.bind(this);const i=e=>{const t=this.getRect();if(!t)return!0;const i=Pu(t,e.x,e.y);return null!=this.iterateFindNextZoomAtPoint(i)},n=()=>!Ru(ku(this.zoomManager.getZoom()),Mu()),s=t.addListener("context-setup",e=>{t.builtins.items["zoom-to-cursor"].enabled=i(e),t.builtins.items["pan-to-cursor"].enabled=n()});return()=>{s(),t.setVisible("zoom-to-cursor",!1),t.setVisible("pan-to-cursor",!1)}}computeOrigin(e){const t=this.getRect(),{enabled:i}=this.getModuleProperties();if(i&&t&&e?.target&&e instanceof MouseEvent)return Pu({x:0,y:0,width:t.width,height:t.height},e.offsetX,e.offsetY)}onZoomToHere({event:e}){const t=this.computeOrigin(e);if(!t)return;const i=this.iterateFindNextZoomAtPoint(t);null!=i&&this.updateZoom(i)}onPanToHere({event:e}){const t=this.computeOrigin(e);if(!t)return;const i=ku(this.zoomManager.getZoom()),n=Tu(i),s=Du(i),r=t.x*n,o=t.y*s,a=xu/2;let l={x:{min:t.x-a,max:t.x+a},y:{min:t.y-a,max:t.y+a}};l=Nu(l,n,s),l=_u(l,i.x.min-t.x+r,i.y.min-t.y+o),this.updateZoom(Fu(l))}iterateFindNextZoomAtPoint(e){const{scrollingStep:t}=this.getModuleProperties();for(let i=t;i<=1-t;i+=t){const t=this.getNextZoomAtPoint(e,i);if(this.isZoomValid(t))return t}}getNextZoomAtPoint(e,t){const{isScalingX:i,isScalingY:n}=this.getModuleProperties(),s=ku(this.zoomManager.getZoom()),r=e.x*Tu(s),o=e.y*Du(s),a=xu/2;let l={x:{min:e.x-a,max:e.x+a},y:{min:e.y-a,max:e.y+a}};return l=Nu(l,i?Tu(s)*t:xu,n?Du(s)*t:xu),l=_u(l,s.x.min-e.x+r,s.y.min-e.y+o),Fu(l)}},{BBoxValues:Hu,ChartAxisDirection:Uu}=n.n1,zu=class{constructor(e){this.axesHandlers=e,this.axes=[]}destroy(){this.axes.forEach(e=>e.div.destroy())}update(e,t){if(this.axes.forEach(t=>t.div.setHidden(!e)),!e)return;const{X:i,Y:s}=n.n1.ChartAxisDirection,r=[...t.axisManager.getAxisContext(i),...t.axisManager.getAxisContext(s)],{removed:o,added:a}=this.diffAxisIds(r);o.length>0&&(this.axes=this.axes.filter(e=>!o.includes(e.axisId)||(e.div.destroy(),!1)));for(const e of a){const{axisId:i,direction:n}=e;this.axes.push(this.initAxis(t,i,this.axesHandlers,n))}for(const e of this.axes){const t=r.find(t=>t.axisId===e.axisId).getCanvasBounds();e.div.setHidden(Hu.isEmpty(t)),void 0!==t&&e.div.setBounds(t)}}toggleAxisDraggingCursor(e,t){for(const i of this.axes)i.direction===e&&i.div.setCursor(t?this.getCursor(e):void 0)}getCursor(e){return e===Uu.X?"ew-resize":"ns-resize"}initAxis(e,t,i,n){const s=e.proxyInteractionService.createProxyElement({type:"region",domManagerId:t,where:"afterend"});return s.setCursor(this.getCursor(n)),s.addListener("drag-start",e=>{"touch"===e.device&&e.sourceEvent.preventDefault(),i.onDragStart(t,n)}),s.addListener("drag-move",e=>i.onDrag(e)),s.addListener("drag-end",i.onDragEnd),s.addListener("dblclick",()=>i.onDoubleClick(t,n)),{axisId:t,div:s,direction:n}}diffAxisIds(e){const t=this.axes.map(e=>e.axisId),i=e.map(e=>e.axisId);return{removed:t.filter(e=>!i.includes(e)),added:e.filter(e=>!t.includes(e.axisId))}}},Wu={off:1,short:.01,long:.002},ju=class{constructor(){this.deceleration=1,this.zoomCoordsHistoryIndex=0,this.coordsHistory=[]}get decelerationValue(){const{deceleration:e}=this;return Math.max("number"==typeof e?e:Wu[e]??1,1e-4)}addListener(e,t){return this.onUpdate=t,()=>{this.onUpdate=void 0}}stopInteractions(){null!=this.inertiaHandle&&(cancelAnimationFrame(this.inertiaHandle),this.inertiaHandle=void 0)}update(e){this.updateCoords(e.currentX,e.currentY);const{x1:t=0,y1:i=0,x2:n=0,y2:s=0}=this.coords??{};this.onUpdate?.({type:"update",deltaX:t-n,deltaY:i-s})}start(){this.coordsMonitorTimeout=setInterval(this.recordCurrentZoomCoords.bind(this),16)}stop(){const{coordsHistory:e}=this;let t=0,i=0,n=0;if(e.length>0){const s=this.zoomCoordsHistoryIndex%16;let r=s-1;r<0&&(r=e.length-1);let o=s;o>=e.length&&(o=0);const a=e[r],l=e[o];t=a.x-l.x,i=a.y-l.y,n=a.t-l.t}if(this.coords=void 0,clearInterval(this.coordsMonitorTimeout),this.coordsMonitorTimeout=void 0,this.zoomCoordsHistoryIndex=0,this.coordsHistory.length=0,n>0&&this.decelerationValue<1){const e=t/n,r=i/n,o=Math.hypot(e,r),a=Math.atan2(r,e),l=performance.now();this.inertiaHandle=(0,s.zk)().requestAnimationFrame(e=>{this.animateInertia(e,e,l,o,a)})}}recordCurrentZoomCoords(){const{coords:e,coordsHistory:t,zoomCoordsHistoryIndex:i}=this;if(!e)return;const{x2:n,y2:s}=e,r=Date.now();t[i%16]={x:n,y:s,t:r},this.zoomCoordsHistoryIndex+=1}animateInertia(e,t,i,n,s){const r=1-this.decelerationValue,o=-n/Math.log(r),a=n*(r**(t-i)-1)/Math.log(r),l=n*(r**(e-i)-1)/Math.log(r);this.onUpdate?.({type:"update",deltaX:-Math.cos(s)*(l-a),deltaY:-Math.sin(s)*(l-a)}),l>=o-1||(this.inertiaHandle=requestAnimationFrame(t=>{this.animateInertia(t,e,i,n,s)}))}updateCoords(e,t){this.coords?this.coords={x1:this.coords.x2,y1:this.coords.y2,x2:e,y2:t}:this.coords={x1:e,y1:t,x2:e,y2:t}}translateZooms(e,t,i,n){const r=Pu(e,e.x+Math.abs(i),e.y+e.height-Math.abs(n)),o=Math.sign(i)*r.x,a=-Math.sign(n)*r.y,l={};for(const[e,{direction:i,zoom:n}]of(0,s.jO)(t)){if(n&&n.min===Su.min&&n.max===Su.max)continue;let t=ku({[i]:n});t=Fu(_u(t,o*Tu(t),a*Du(t))),l[e]={direction:i,zoom:t[i]}}return l}},$u=class{update(e,t,i,n){const s=e.deltaX*t*200;return this.translateZooms(i,n,s)}translateZooms(e,t,i){const r={},o=Pu(e,e.x+Math.abs(i),0),a=i<0?-o.x:o.x;for(const[e,{direction:i,zoom:o}]of(0,s.jO)(t)){if(i!==n.n1.ChartAxisDirection.X)continue;let t=ku({x:o});t=Fu(_u(t,a*Tu(t),0)),r[e]={direction:i,zoom:t.x}}return r}},Ku=class{updateAxes(e,t,i,r){const o=e.sourceEvent,a={},{anchorPointX:l,anchorPointY:c,isScalingX:h,isScalingY:u,scrollingStep:d}=t,p=Pu(i,o.offsetX??o.clientX,o.offsetY??o.clientY);for(const[t,{direction:i,zoom:o}]of(0,s.jO)(r)){if(null==o)continue;let s={...o};const r=d*e.deltaY*(o.max-o.min);if(i===n.n1.ChartAxisDirection.X&&h)s.max+=r,s=Ou(s,o,l,p.x);else{if(i!==n.n1.ChartAxisDirection.Y||!u)continue;s.max+=r,s=Ou(s,o,c,p.y)}a[t]={direction:i,zoom:Gu(s)}}return a}update(e,t,i,n){const{anchorPointX:s,anchorPointY:r,isScalingX:o,isScalingY:a,scrollingStep:l}=t,c=Pu(i,e.offsetX+i.x,e.offsetY+i.y),h=e.deltaY;let u=ku(n);return u.x.max+=o?l*h*Tu(n):0,u.y.max+=a?l*h*Du(n):0,o&&(u.x=Ou(u.x,n.x,s,c.x)),a&&(u.y=Ou(u.y,n.y,r,c.y)),u=Fu(u),u}updateDelta(e,t,i){const{anchorPointX:n,anchorPointY:s,isScalingX:r,isScalingY:o,scrollingStep:a}=t;let l=ku(i);return l.x.max+=r?a*-e*Tu(i):0,l.y.max+=o?a*-e*Du(i):0,r&&(l.x=Ou(l.x,i.x,n)),o&&(l.y=Ou(l.y,i.y,s)),l=Fu(l),l}},Yu=class{constructor(e,t,i){this.rect=e,this.getZoom=t,this.isZoomValid=i,this.rect.visible=!1}update(e,t,i){const n=e.currentX+(i?.x??0),s=e.currentY+(i?.y??0);this.rect.visible=!0,this.updateCoords(n,s,t,i),this.updateRect(i)}stop(e,t,i){let n=ku();return e&&t?(this.coords&&(n=this.createZoomFromCoords(t,i)),n=Fu(function(e,t,i){return{x:{min:e.x.min*t,max:e.x.max*t},y:{min:e.y.min*i,max:e.y.max*i}}}(n,t.width/e.width,t.height/e.height)),this.reset(),n):n}reset(){this.coords=void 0,this.rect.visible=!1}didUpdate(){return this.rect.visible&&this.rect.width>0&&this.rect.height>0}updateCoords(e,t,i,n){if(!this.coords)return void(this.coords={x1:e,y1:t,x2:e,y2:t});const{coords:s}=this;if(s.x2=e,s.y2=t,!n)return;const{isScalingX:r,isScalingY:o,keepAspectRatio:a}=i,l=this.getNormalisedDimensions();if(a&&r&&o){const e=n.width/n.height;s.y2<s.y1?s.y2=Math.min(s.y1-l.width/e,s.y1):s.y2=Math.max(s.y1+l.width/e,s.y1)}r||(s.x1=n.x,s.x2=n.x+n.width),o||(s.y1=n.y,s.y2=n.y+n.height)}updateRect(e){if(!e)return;const{rect:t}=this,i=this.getNormalisedDimensions(),{width:n,height:s}=i;let{x:r,y:o}=i;r=Math.max(r,e.x),r-=Math.max(0,r+n-(e.x+e.width)),o=Math.max(o,e.y),o-=Math.max(0,o+s-(e.y+e.height)),t.x=r,t.y=o,t.width=n,t.height=s;const a=this.createZoomFromCoords(e,this.getZoom());this.isZoomValid(a)?t.updateValid():t.updateInvalid()}createZoomFromCoords(e,t){const i=ku(t),n=this.getNormalisedDimensions(),s=Pu(e,n.x,n.y+n.height);let r=Lu(i,n.width/e.width,n.height/e.height);return r=_u(r,s.x*Tu(i),s.y*Du(i)),r=Fu(r),r}getNormalisedDimensions(){const{x1:e=0,y1:t=0,x2:i=0,y2:n=0}=this.coords??{};return{x:e<=i?e:i,y:t<=n?t:n,width:e<=i?i-e:e-i,height:t<=n?n-t:t-n}}},{ActionOnSet:qu,BaseProperties:Xu,ChartAxisDirection:Zu,NativeWidget:Qu,PropertiesArray:Ju,Toolbar:ed,ToolbarButtonProperties:td,Property:id}=n.n1,nd=class extends td{};a([id],nd.prototype,"value",2),a([id],nd.prototype,"section",2);var sd=class extends Xu{constructor(e,t,i,n,r,o,a){super(),this.ctx=e,this.getModuleProperties=t,this.getResetZoom=i,this.updateZoom=n,this.updateAxisZoom=r,this.resetZoom=o,this.isZoomValid=a,this.enabled=!1,this.buttons=new Ju(nd),this.visible="hover",this.verticalSpacing=10,this.detectionRange=38,this.destroyFns=[],this.container=new Qu((0,s.n)("div")),this.container.addClass("ag-charts-zoom-buttons"),e.domManager.addChild("canvas-overlay","zoom-buttons",this.container.getElement()),this.toolbar=new ed(e.localeManager),this.container.addChild(this.toolbar),this.toolbar.getElement().style.transform="translateY(54px)",this.toggleVisibility("always"===this.visible),this.destroyFns.push(this.toolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),this.toolbar.addToolbarListener("button-focused",this.onButtonFocus.bind(this)),e.widgets.containerWidget.addListener("mousemove",this.onHover.bind(this)),e.widgets.containerWidget.addListener("mouseleave",this.onLeave.bind(this)),e.layoutManager.addListener("layout:complete",this.onLayoutComplete.bind(this)),this.teardown.bind(this))}destroy(){for(const e of this.destroyFns)e()}toggleVisibleZoomed(e){"zoomed"===this.visible&&this.toggleVisibility(!e)}teardown(){this.ctx.domManager.removeChild("canvas-overlay","zoom-buttons"),this.container.destroy()}onLayoutComplete(e){const{buttons:t,container:i}=this,{rect:n}=e.series;this.toolbar.updateButtons(t),this.toggleButtons();const s=i.getBounds().height;i.setBounds({y:n.y+n.height-s})}onHover(e){if(!this.enabled||"hover"!==this.visible||this.toolbar.isHidden())return;const{container:t,detectionRange:i,ctx:{scene:n}}=this,{currentY:s,sourceEvent:{target:r}}=e,o=t.getElement(),a=s>o.offsetTop-i&&s<n.canvas.element.offsetHeight||r===o;this.toggleVisibility(a)}onLeave(){"hover"===this.visible&&this.toggleVisibility(!1)}toggleVisibility(e,t=!1){const{container:i,toolbar:n,verticalSpacing:s}=this;n.toggleClass("ag-charts-zoom-buttons__toolbar--hidden",!e);const r=n.getElement();r.style.transitionDuration=t?"0s":"",r.style.transform=e?"translateY(0)":`translateY(${i.getBounds().height+s}px)`}toggleButtons(){const e=ku(this.ctx.zoomManager.getZoom());if(!this.previousZoom||!Ru(this.previousZoom,e)){this.previousZoom=e;for(const[t,i]of this.buttons.entries()){let n=!0;switch(i?.value){case"pan-start":case"pan-left":n=e.x.min>Su.min;break;case"pan-end":case"pan-right":n=e.x.max<Su.max;break;case"zoom-out":n=!Ru(e,Mu());break;case"zoom-in":n=this.isZoomValid(this.getNextZoomStateUnified("zoom-in",e,this.getModuleProperties()));break;case"reset":n=!Ru(e,this.getResetZoom())}this.toolbar.toggleButtonEnabledByIndex(t,n)}}}onButtonPress({button:e}){if(!this.enabled||this.toolbar.isHidden())return;const t=this.getModuleProperties();if(t.independentAxes&&"reset"!==e.value){const i=this.ctx.zoomManager.getAxisZooms();for(const[n,{direction:r,zoom:o}]of(0,s.jO)(i))null!=o&&this.onButtonPressAxis(e,t,n,r,o)}else this.onButtonPressUnified(e,t)}onButtonFocus(e){this.toggleVisibility(!0,!0)}onButtonPressAxis(e,t,i,n,s){const{isScalingX:r,isScalingY:o,scrollingStep:a}=t;let l={...s};const c=s.max-s.min;switch(e.value){case"pan-start":l.max=c,l.min=0;break;case"pan-end":l.min=l.max-c,l.max=Su.max;break;case"pan-left":l.min-=c*a,l.max-=c*a;break;case"pan-right":l.min+=c*a,l.max+=c*a;break;case"zoom-in":case"zoom-out":{const i=n===Zu.X,c=i&&r||!i&&o;let h="zoom-in"===e.value?1-a:1+a;c||(h=1);const u=i?this.getAnchorPointX(t):this.getAnchorPointY(t);l.max=l.min+(l.max-l.min)*h,l=Ou(l,s,u);break}}this.updateAxisZoom(i,n,Gu(l))}onButtonPressUnified(e,t){const{scrollingStep:i}=t,n=ku(this.ctx.zoomManager.getZoom());let s=ku(n);switch(e.value){case"reset":return void this.resetZoom();case"pan-start":s.x.max=Tu(s),s.x.min=0;break;case"pan-end":s.x.min=Su.max-Tu(s),s.x.max=Su.max;break;case"pan-left":s=_u(s,-Tu(s)*i,0);break;case"pan-right":s=_u(s,Tu(s)*i,0);break;case"zoom-in":case"zoom-out":s=this.getNextZoomStateUnified(e.value,n,t)}this.updateZoom(Fu(s))}getNextZoomStateUnified(e,t,i){const{isScalingX:n,isScalingY:s,scrollingStep:r}=i,o="zoom-in"===e?1-r:1+r,a=Lu(t,n?o:1,s?o:1);return a.x=Ou(a.x,t.x,this.getAnchorPointX(i)),a.y=Ou(a.y,t.y,this.getAnchorPointY(i)),a}getAnchorPointX(e){const t=this.anchorPointX??e.anchorPointX;return"pointer"===t?"end":t}getAnchorPointY(e){const t=this.anchorPointY??e.anchorPointY;return"pointer"===t?Eu:t}};a([id,qu({changeValue(e){this.toolbar?.setHidden(!e)}})],sd.prototype,"enabled",2),a([id],sd.prototype,"buttons",2),a([id,qu({changeValue(e,t){null!=t&&this.toggleVisibility("always"===e)}})],sd.prototype,"visible",2),a([id],sd.prototype,"anchorPointX",2),a([id],sd.prototype,"anchorPointY",2);var rd=1e6;function od({min:e,max:t},i,n,s){return 0===s?0:rd*((i-n)/s*(t-e)+e)}function ad(e,t,i,n){return 0===t&&(t=30),0===n&&(n=30),!(e+t<i-n||i+n<e-t)}var ld=class{constructor(){this.touchStart={origins:[{identifier:0,normalX:NaN,normalY:NaN},{identifier:0,normalX:NaN,normalY:NaN}]},this.initialZoom={x:{min:0,max:1},y:{min:0,max:1}},this.previous={a1:NaN,a2:NaN,b1:NaN,b2:NaN}}start(e,t,i){if(2!==e.sourceEvent.targetTouches.length)return!1;e.sourceEvent.preventDefault();const n=Array.from(e.sourceEvent.targetTouches),{x:s,y:r,width:o,height:a}=t.getBoundingClientRect();this.initialZoom.x.min=i.x?.min??0,this.initialZoom.x.max=i.x?.max??1,this.initialZoom.y.min=i.y?.min??0,this.initialZoom.y.max=i.y?.max??1,this.touchStart.origins.forEach(e=>e.identifier=0),this.previous.a1=NaN,this.previous.a2=NaN,this.previous.b1=NaN,this.previous.b2=NaN;for(const e of[0,1]){const t=n[e].clientX,i=r+a-n[e].clientY;this.touchStart.origins[e].identifier=n[e].identifier,this.touchStart.origins[e].normalX=od(this.initialZoom.x,t,s,o),this.touchStart.origins[e].normalY=od(this.initialZoom.y,i,r,a)}const[l,c]=n,[h,u]=this.touchStart.origins,d=ad(l.clientX,l.radiusX,c.clientX,c.radiusX);return ad(l.clientY,l.radiusY,c.clientY,c.radiusY)&&(h.normalY=u.normalY=(h.normalY+u.normalY)/2),d&&(h.normalX=u.normalX=(h.normalX+u.normalX)/2),!0}update(e,t){e.sourceEvent.preventDefault();const i=Array.from(e.sourceEvent.targetTouches),{x:n,y:s,width:r,height:o}=t.getBoundingClientRect(),{origins:a}=this.touchStart,l=[0,1].map(e=>i.find(t=>t.identifier===a[e].identifier)),c=a[0].normalX,h=a[1].normalX,u=l[0].clientX,d=l[1].clientX,p=a[0].normalY,g=a[1].normalY,f=s+o-l[0].clientY,m=s+o-l[1].clientY;return this.twitchTolerantZoomPan4(c,h,u,d,p,g,f,m,n,s,r,o)}end(e){const t=Array.from(e.sourceEvent.targetTouches).map(e=>e.identifier);return!t.includes(this.touchStart.origins[0].identifier)||!t.includes(this.touchStart.origins[1].identifier)}twitchTolerantZoomPan4(e,t,i,n,s,r,o,a,l,c,h,u){const{initialZoom:d,previous:p}=this;return{x:cd(e,t,i,n,p,"a1","a2",l,h,d.x),y:cd(s,r,o,a,p,"b1","b2",c,u,d.y)}}};function cd(e,t,i,n,s,r,o,a,l,c){if(e!=t){const c=s[r],h=s[o];return Math.abs(i-c)+Math.abs(n-h)<=1?(i=c,n=h):(s[r]=i,s[o]=n),function(e,t,i,n,s,r){[e,t]=[Math.min(e,t),Math.max(e,t)],[i,n]=[Math.min(i,n),Math.max(i,n)];const o=rd*(n-s)/r,a=(i-s)/(n-s),l=(e-a*t)/(rd-rd*(i-s)/r+a*(o-rd));return{min:l,max:(t+(o-rd)*l)/o}}(e,t,i,n,a,l)}{const t=(e-(od(c,i,a,l)+od(c,n,a,l))/2)/rd;return{min:c.min+t,max:c.max+t}}}var{ActionOnSet:hd,ChartAxisDirection:ud,ChartUpdateType:dd,Deprecated:pd,Property:gd,InteractionState:fd,ProxyProperty:md}=n.n1,yd=e=>(0,s.GB)(e,10),vd="zoom-cursor",bd="zoom-tooltip",Cd=class extends n.n1.BaseProperties{constructor(e){super(),this.onChange=e,this.enabled=!1,this.padding=0}};a([gd,hd({changeValue(e){this.onChange({enabled:e,padding:this.padding})}})],Cd.prototype,"enabled",2),a([gd,hd({changeValue(e){this.onChange({enabled:this.enabled,padding:e})}})],Cd.prototype,"padding",2);var wd=class extends n.n1.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!1,this.enableAxisDragging=!0,this.enableDoubleClickToReset=!0,this.enablePanning=!0,this.enableScrolling=!0,this.enableSelecting=!1,this.enableTwoFingerZoom=!0,this.panKey="alt",this.axes="x",this.scrollingStep=xu/10,this.keepAspectRatio=!1,this.minVisibleItems=2,this.anchorPointX="end",this.anchorPointY=Eu,this.autoScaling=new Cd(e=>{this.ctx.zoomManager.setAutoScaleYAxis(e.enabled,e.padding)}),this.buttons=new sd(this.ctx,this.getModuleProperties.bind(this),this.getResetZoom.bind(this),this.updateZoom.bind(this),this.updateAxisZoom.bind(this),this.resetZoom.bind(this),this.isZoomValid.bind(this)),this.axisDragger=new Bu,this.panner=new ju,this.scroller=new Ku,this.scrollPanner=new $u,this.twoFingers=new ld,this.deceleration="short",this.dragState=0,this.isState=e=>this.ctx.interactionManager.isState(e),this.destroyContextMenuActions=void 0,this.isFirstWheelEvent=!0,this.debouncedWheelReset=(0,s.sg)(()=>{this.isFirstWheelEvent=!0},100);const t=new wu;this.selector=new Yu(t,this.getZoom.bind(this),this.isZoomValid.bind(this)),this.contextMenu=new Vu(e.contextMenuRegistry,e.zoomManager,this.getModuleProperties.bind(this),()=>this.paddedRect,this.updateZoom.bind(this),this.isZoomValid.bind(this)),this.domProxy=new zu({onDragStart:(e,t)=>this.onAxisDragStart(e,t),onDrag:e=>{this.onDragMove({...e,currentX:e.offsetX,currentY:e.offsetY})},onDragEnd:()=>this.onDragEnd(),onDoubleClick:(e,t)=>{this.hoveredAxis={id:e,direction:t},this.onDoubleClick(),this.hoveredAxis=void 0}}),this.destroyFns.push(e.scene.attachNode(t),e.chartEventManager.addListener("series-keynav-zoom",e=>this.onNavZoom(e)),e.widgets.seriesDragInterpreter.addListener("dblclick",e=>this.onDoubleClick(e)),e.widgets.seriesDragInterpreter.addListener("drag-move",e=>this.onDragMove(e)),e.widgets.seriesDragInterpreter.addListener("drag-start",e=>this.onDragStart(e)),e.widgets.seriesDragInterpreter.addListener("drag-end",()=>this.onDragEnd()),e.widgets.seriesWidget.addListener("wheel",e=>this.onWheel(e)),e.widgets.seriesWidget.addListener("touchstart",(e,t)=>this.onTouchStart(e,t)),e.widgets.seriesWidget.addListener("touchmove",(e,t)=>this.onTouchMove(e,t)),e.widgets.seriesWidget.addListener("touchend",e=>this.onTouchEnd(e)),e.widgets.seriesWidget.addListener("touchcancel",e=>this.onTouchEnd(e)),e.updateService.addListener("process-data",e=>this.onProcessData(e)),e.layoutManager.addListener("layout:complete",e=>this.onLayoutComplete(e)),e.zoomManager.addListener("zoom-change",e=>this.onZoomChange(e)),e.zoomManager.addListener("zoom-pan-start",e=>this.onZoomPanStart(e)),this.panner.addListener("update",e=>this.onPanUpdate(e)),()=>this.teardown())}teardown(){this.ctx.zoomManager.setZoomModuleEnabled(!1),this.buttons.destroy(),this.destroyContextMenuActions?.()}onEnabledChange(e){this.ctx.zoomManager.setZoomModuleEnabled(e),this.contextMenu&&(this.destroyContextMenuActions?.(),this.destroyContextMenuActions=this.contextMenu.registerActions(e))}isIgnoredTouch(e){if("touch"!==e?.device)return!1;if("drag"!==this.ctx.chartService.touch.dragAction)return!0;if(this.enableSelecting)return!1;if(!this.enablePanning)return!0;const{x:t,y:i}=this.getZoom();return 0===t.min&&1===t.max&&0===i.min&&1===i.max}onDoubleClick(e){const{enabled:t,enableDoubleClickToReset:i,hoveredAxis:n,ctx:{zoomManager:s}}=this;t&&i&&this.isState(fd.ZoomClickable)&&(n?s.resetAxisZoom("zoom",n.id):e?.preventZoomDblClick||this.resetZoom())}onDragStart(e){const{enabled:t,enableAxisDragging:i,enablePanning:n,enableSelecting:s,hoveredAxis:r,ctx:{domManager:o,zoomManager:a}}=this;if(!t)return;if(!this.hoveredAxis&&(!this.isState(fd.ZoomDraggable)||0!==this.dragState||this.isIgnoredTouch(e)))return;this.panner.stopInteractions();let l=0;if(i&&r)l=1;else if(null!=e){const t=this.isPanningKeyPressed(e.sourceEvent);!n||s&&!t?s&&!t&&(l=3):(o.updateCursor(vd,"grabbing"),l=2,this.panner.start())}0!==(this.dragState=l)&&a.fireZoomPanStartEvent("zoom")}onDragMove(e){const{anchorPointX:t,anchorPointY:i,axisDragger:s,dragState:r,enabled:o,paddedRect:a,panner:l,selector:c,seriesRect:h,shouldFlipXY:u,hoveredAxis:d,ctx:{interactionManager:p,tooltipManager:g,updateService:f,zoomManager:m}}=this;if(!o||!a||!h)return;if(!d&&(!this.isState(fd.ZoomDraggable)||this.isIgnoredTouch(e)))return;p.pushState(n.n1.InteractionState.ZoomDrag),"touch"===e.device&&e.sourceEvent.preventDefault();const y=this.getZoom();switch(r){case 1:{if(!d)break;const{id:n,direction:r}=d;let o=r===ud.X?t:i;u&&(o=r===ud.X?i:t);const a=m.getAxisZoom(n),l=s.update(e,r,o,h,y,a);m.setAxisManuallyAdjusted("zoom",n),this.updateAxisZoom(n,r,l);break}case 2:l.update(e);break;case 3:c.update(e,this.getModuleProperties(),a);break;case 0:return}g.updateTooltip(bd),f.update(dd.PERFORM_LAYOUT,{skipAnimations:!0})}onDragEnd(){const{axisDragger:e,dragState:t,enabled:i,panner:s,selector:r,ctx:{domManager:o,interactionManager:a,tooltipManager:l}}=this;if(a.popState(n.n1.InteractionState.ZoomDrag),i&&0!==t){switch(t){case 1:this.hoveredAxis=void 0,e.stop();break;case 2:s.stop();break;case 3:{if(!r.didUpdate())break;const e=this.getZoom(),t=r.stop(this.seriesRect,this.paddedRect,e);this.updateZoom(t);break}}this.dragState=0,o.updateCursor(vd),l.removeTooltip(bd)}}onNavZoom(e){const{enabled:t,enableScrolling:i,scroller:s}=this;this.ctx.interactionManager.isState(n.n1.InteractionState.Default)&&t&&i&&(e.widgetEvent.sourceEvent.preventDefault(),this.updateZoom(s.updateDelta(e.delta,this.getModuleProperties(),this.getZoom())))}onWheel(e){const{enabled:t,enablePanning:i,enableScrolling:n,paddedRect:s}=this;if(!(t&&n&&s&&this.isState(fd.ZoomWheelable)))return;const{deltaX:r,deltaY:o}=e.sourceEvent,a=null!=r&&null!=o&&Math.abs(r)>Math.abs(o);i&&a?this.onWheelPanning(e):this.onWheelScrolling(e)}onWheelPanning(e){const{scrollingStep:t,scrollPanner:i,seriesRect:n,ctx:{zoomManager:r}}=this;if(!n)return;e.sourceEvent.preventDefault();const o=i.update(e,t,n,r.getAxisZooms());for(const[e,{direction:t,zoom:i}]of(0,s.jO)(o))this.updateAxisZoom(e,t,i)}onWheelScrolling(e){const{enableAxisDragging:t,enableIndependentAxes:i,hoveredAxis:r,scroller:o,seriesRect:a,ctx:{zoomManager:l}}=this;if(!a)return;const c=this.getZoom();let h=e.deltaY>0&&this.isMaxZoom(c);const u=t&&null!=r;let d=this.isScalingX(),p=this.isScalingY();u&&(d=r.direction===n.n1.ChartAxisDirection.X,p=!d);const g=this.getModuleProperties({isScalingX:d,isScalingY:p});let f=!0;if(!0===i){const t=o.updateAxes(e,g,a,l.getAxisZooms());for(const[e,{direction:i,zoom:n}]of(0,s.jO)(t))u&&r.id!==e||f&&(f=this.updateAxisZoom(e,i,n))}else{const t=o.update(e,g,a,this.getZoom());f=this.updateUnifiedZoom(t)}h||(h=e.deltaY<0&&!f),this.isFirstWheelEvent&&h||e.sourceEvent.preventDefault(),this.isFirstWheelEvent=!1,this.debouncedWheelReset()}onAxisDragStart(e,t){this.hoveredAxis={id:e,direction:t},this.onDragStart(void 0)}onTouchStart(e,t){this.enableTwoFingerZoom&&0===this.dragState&&this.twoFingers.start(e,t,this.getZoom())&&(this.dragState=4)}onTouchMove(e,t){if(!this.enableTwoFingerZoom||4!==this.dragState)return;const i=this.twoFingers.update(e,t);this.updateZoom(Fu(i))}onTouchEnd(e){this.enableTwoFingerZoom&&4===this.dragState&&(e.sourceEvent.preventDefault(),this.twoFingers.end(e)&&(this.dragState=0))}onProcessData(e){this.shouldFlipXY=e.series.shouldFlipXY}onLayoutComplete(e){this.domProxy.update(this.enableAxisDragging,this.ctx),this.enabled&&(this.seriesRect=e.series.rect,this.paddedRect=e.series.paddedRect,this.enableAxisDragging&&this.toggleAxisDraggingCursors())}onZoomChange(e){"zoom"!==e.callerId&&this.panner.stopInteractions();const t=this.getZoom();this.buttons.toggleVisibleZoomed(this.isMaxZoom(t))}onZoomPanStart(e){"zoom"===e.callerId&&this.panner.stopInteractions()}onPanUpdate(e){const{panner:t,seriesRect:i,ctx:{tooltipManager:n,zoomManager:r}}=this;if(!i)return;const o=t.translateZooms(i,r.getAxisZooms(),e.deltaX,e.deltaY);for(const[e,{direction:t,zoom:i}]of(0,s.jO)(o))this.updateAxisZoom(e,t,i);n.updateTooltip(bd)}isPanningKeyPressed(e){switch(this.panKey){case"alt":return e.altKey;case"ctrl":return e.ctrlKey;case"shift":return e.shiftKey;case"meta":return e.metaKey}}isScalingX(){return"xy"===this.axes||(this.shouldFlipXY?"y"===this.axes:"x"===this.axes)}isScalingY(){return"xy"===this.axes||(this.shouldFlipXY?"x"===this.axes:"y"===this.axes)}getAnchorPointX(){return this.shouldFlipXY?this.anchorPointY:this.anchorPointX}getAnchorPointY(){return this.shouldFlipXY?this.anchorPointX:this.anchorPointY}isMaxZoom(e){return Ru(e,Mu())}isZoomValid(e){const{minVisibleItems:t,minVisibleItemsX:i,minVisibleItemsY:n,ctx:{zoomManager:s}}=this;if(0===t)return!0;const r=this.getZoom(),o=yd(Tu(e))<yd(Tu(r)),a=yd(Du(e))<yd(Du(r));return!o&&!a||(null!=i&&o?s.isVisibleItemsCountAtLeast(e,i):null!=n&&a?s.isVisibleItemsCountAtLeast(e,n):s.isVisibleItemsCountAtLeast(e,t))}isAxisZoomValid(e,t){const{minVisibleItems:i,minVisibleItemsX:n,minVisibleItemsY:s,ctx:{zoomManager:r}}=this,o=this.getZoom(),a=t.max-t.min,l=o[e].max-o[e].min,c={...o,[e]:t},h=e===ud.X?n:s;return a>=l||r.isVisibleItemsCountAtLeast(c,h??i)}resetZoom(){this.ctx.zoomManager.resetZoom("zoom")}updateZoom(e){this.enableIndependentAxes?this.updatePrimaryAxisZooms(e):this.updateUnifiedZoom(e)}updateUnifiedZoom(e){return this.isZoomValid(e)?(this.ctx.zoomManager.updateZoom("zoom",e),!0):(this.ctx.updateService.update(dd.SCENE_RENDER,{skipAnimations:!0}),!1)}updatePrimaryAxisZooms(e){this.updatePrimaryAxisZoom(e,ud.X),this.updatePrimaryAxisZoom(e,ud.Y)}updatePrimaryAxisZoom(e,t){const i=this.ctx.zoomManager.getPrimaryAxisId(t);null!=i&&this.updateAxisZoom(i,t,e[t])}updateAxisZoom(e,t,i){const{enableIndependentAxes:n,ctx:{zoomManager:s}}=this;if(!i)return!1;const r=this.getZoom();return!0!==n?(r[t]=i,this.updateUnifiedZoom(r)):!!this.isAxisZoomValid(t,i)&&(s.updateAxisZoom("zoom",e,i),!0)}toggleAxisDraggingCursors(){const{anchorPointX:e,anchorPointY:t,domProxy:i}=this,n=this.getZoom();let s=Tu(n)!==xu,r=Du(n)!==xu;if(!s){const t=Lu(n,.999,1);t.x=Ou(t.x,n.x,e),s=this.isZoomValid(t)}if(!r){const e=Lu(n,1,.999);e.y=Ou(e.y,n.y,t),r=this.isZoomValid(e)}i.toggleAxisDraggingCursor(ud.X,s),i.toggleAxisDraggingCursor(ud.Y,r)}getZoom(){return ku(this.ctx.zoomManager.getZoom())}getResetZoom(){return ku(this.ctx.zoomManager.getRestoredZoom())}getModuleProperties(e){return{anchorPointX:e?.anchorPointX??this.getAnchorPointX(),anchorPointY:e?.anchorPointY??this.getAnchorPointY(),enabled:e?.enabled??this.enabled,independentAxes:e?.independentAxes??!0===this.enableIndependentAxes,isScalingX:e?.isScalingX??this.isScalingX(),isScalingY:e?.isScalingY??this.isScalingY(),keepAspectRatio:e?.keepAspectRatio??this.keepAspectRatio,scrollingStep:e?.scrollingStep??this.scrollingStep}}};a([hd({newValue(e){this.onEnabledChange(e)}}),gd],wd.prototype,"enabled",2),a([gd],wd.prototype,"enableAxisDragging",2),a([gd],wd.prototype,"enableDoubleClickToReset",2),a([hd({changeValue(e){this.ctx.zoomManager.setIndependentAxes(Boolean(e))}}),gd],wd.prototype,"enableIndependentAxes",2),a([gd],wd.prototype,"enablePanning",2),a([gd],wd.prototype,"enableScrolling",2),a([gd],wd.prototype,"enableSelecting",2),a([gd],wd.prototype,"enableTwoFingerZoom",2),a([gd],wd.prototype,"panKey",2),a([gd],wd.prototype,"axes",2),a([gd],wd.prototype,"scrollingStep",2),a([gd],wd.prototype,"keepAspectRatio",2),a([gd],wd.prototype,"minVisibleItems",2),a([pd("Use [minVisibleItems] instead."),gd],wd.prototype,"minVisibleItemsX",2),a([pd("Use [minVisibleItems] instead."),gd],wd.prototype,"minVisibleItemsY",2),a([gd],wd.prototype,"anchorPointX",2),a([gd],wd.prototype,"anchorPointY",2),a([gd],wd.prototype,"autoScaling",2),a([gd],wd.prototype,"buttons",2),a([md("panner.deceleration"),gd],wd.prototype,"deceleration",2);var Sd={type:"root",optionsKey:"zoom",packageType:"enterprise",chartTypes:["cartesian","topology"],moduleFactory:e=>new wd(e),themeTemplate:{zoom:{anchorPointX:"end",anchorPointY:"middle",axes:"x",buttons:{enabled:!0,visible:"hover",buttons:[{icon:"zoom-out",tooltip:"toolbarZoomZoomOut",value:"zoom-out",section:"scale"},{icon:"zoom-in",tooltip:"toolbarZoomZoomIn",value:"zoom-in",section:"scale"},{icon:"pan-left",tooltip:"toolbarZoomPanLeft",value:"pan-left",section:"pan"},{icon:"pan-right",tooltip:"toolbarZoomPanRight",value:"pan-right",section:"pan"},{icon:"reset",tooltip:"toolbarZoomReset",value:"reset",section:"reset"}]},enabled:!1,enableAxisDragging:!0,enableDoubleClickToReset:!0,enablePanning:!0,enableScrolling:!0,enableSelecting:!1,enableTwoFingerZoom:!0,deceleration:"short",minVisibleItems:2,panKey:"alt",scrollingStep:.1,autoScaling:{enabled:!1,padding:.05}}}},{BaseProperties:xd,AxisTicks:Ed,ZIndexMap:Ad,ProxyProperty:Md,Property:Td,LayoutElement:Dd,Group:Id,Rect:Rd,Marker:kd,TranslatableGroup:Pd,BBox:_d}=n.n1,Ld=class extends xd{constructor(){super(...arguments),this.thickness=16,this.preferredLength=100}};a([Td],Ld.prototype,"thickness",2),a([Td],Ld.prototype,"preferredLength",2);var Nd=class{constructor(e){this.axisTicks=e}};a([Md("axisTicks.label")],Nd.prototype,"label",2),a([Md("axisTicks.interval")],Nd.prototype,"interval",2),a([Md("axisTicks.padding")],Nd.prototype,"padding",2);var Od=class{constructor(e){this.ctx=e,this.id=(0,s.sX)(this),this.legendGroup=new Pd({name:"legend",zIndex:Ad.LEGEND}),this.gradientRect=new Rd,this.arrow=new kd({shape:"triangle"}),this.ticksGroup=new Id({name:"legend-axis-group"}),this.destroyFns=[],this.enabled=!1,this.position="bottom",this.reverseOrder=!1,this.gradient=new Ld,this.spacing=20,this.data=[],this.highlightManager=e.highlightManager,this.axisTicks=new Ed,this.axisTicks.attachAxis(this.ticksGroup),this.scale=new Nd(this.axisTicks),this.legendGroup.append([this.gradientRect,this.arrow,this.ticksGroup]),this.destroyFns.push(e.highlightManager.addListener("highlight-change",()=>this.onChartHoverChange()),e.layoutManager.registerElement(Dd.Legend,e=>this.onStartLayout(e)),()=>this.legendGroup.remove())}isVertical(){return"right"===this.position||"left"===this.position}destroy(){this.destroyFns.forEach(e=>e())}attachLegend(e){e.appendChild(this.legendGroup)}onStartLayout(e){const[t]=this.data;if(!this.enabled||!t?.enabled||"gradient"!==t.legendType)return void(this.legendGroup.visible=!1);const{colorRange:i}=this.normalizeColorArrays(t);this.updateGradientRect(e.layoutBox,i);const n=this.updateAxis(t)??new _d(0,0,0,0),{left:s,top:r}=this.getMeasurements(e.layoutBox,n);this.updateArrow(),this.legendGroup.visible=!0,this.legendGroup.translationX=s,this.legendGroup.translationY=r}normalizeColorArrays(e){let t=e.colorDomain.slice();const i=e.colorRange.slice();if(t.length===i.length)return{colorDomain:t,colorRange:i};t.length>i.length&&i.splice(t.length);const[n,s]=t,r=i.length;return t=i.map((e,t)=>0===t?n:t===r-1?s:n+(s-n)*t/(r-1)),{colorDomain:t,colorRange:i}}updateGradientRect(e,t){const{gradientRect:i}=this,{preferredLength:n,thickness:s}=this.gradient;let r;this.isVertical()?(r=0,i.width=s,i.height=Math.min(e.height,n)):(r=90,i.width=Math.min(e.width,n),i.height=s),i.fill={type:"gradient",gradient:"linear",colorSpace:"oklch",colorStops:t.map((e,i)=>({stop:i/(t.length-1),color:e})),rotation:r}}updateAxis(e){const{axisTicks:t}=this,i=this.isVertical(),n=this.reverseOrder!==i;return t.position=this.position,t.translationX=i?this.gradient.thickness:0,t.translationY=i?0:this.gradient.thickness,t.scale.domain=n?e.colorDomain.slice().reverse():e.colorDomain,t.scale.range=i?[0,this.gradientRect.height]:[0,this.gradientRect.width],t.calculateLayout()}updateArrow(){const e=this.highlightManager.getActiveHighlight(),{arrow:t}=this;if(null==e?.colorValue)return void(t.visible=!1);const{scale:i,label:n}=this.axisTicks,s=n.fontSize??0,r=i.convert(e.colorValue);let{x:o,y:a}=this.gradientRect,l=Math.PI;this.isVertical()?(o-=s/2,a+=r,l/=2):(o+=r,a-=s/2),t.visible=!0,t.fill=n.color,t.rotation=l,t.size=s,t.translationX=o,t.translationY=a}getMeasurements(e,t){let{x:i,y:n}=e,{width:s,height:r}=this.gradientRect;switch(this.isVertical()?s+=t.width+5:r+=t.height+5,this.position){case"left":n+=e.height/2-r/2,e.shrink(s+this.spacing,"left");break;case"right":i+=e.width-s,n+=e.height/2-r/2,e.shrink(s+this.spacing,"right");break;case"top":i+=e.width/2-s/2,e.shrink(r+this.spacing,"top");break;case"bottom":i+=e.width/2-s/2,n+=e.height-r,e.shrink(r+this.spacing,"bottom")}return{top:n,left:i}}onChartHoverChange(){this.enabled&&this.updateArrow()}};Od.className="GradientLegend",a([Td],Od.prototype,"enabled",2),a([Td],Od.prototype,"position",2),a([Td],Od.prototype,"reverseOrder",2),a([Td],Od.prototype,"gradient",2),a([Td],Od.prototype,"spacing",2);var Fd={type:"legend",optionsKey:"gradientLegend",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],identifier:"gradient",moduleFactory:e=>new Od(e),themeTemplate:{enabled:!1,position:"bottom",spacing:20,scale:{padding:13,label:{color:{$ref:"textColor"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"}},interval:{minSpacing:15}},gradient:{preferredLength:100,thickness:16},reverseOrder:!1},removable:"standalone-only"};function Gd(e,t){const i=e.addChild("canvas-overlay","watermark"),n=(0,s.n)("span");n.innerText=t,i.addEventListener("animationend",()=>{e.removeChild("canvas-overlay","watermark"),e.removeStyles("watermark")}),i.classList.add("ag-watermark"),i.appendChild(n)}var{ordinalTimeAxisOptionsDefs:Bd,angleNumberAxisOptionsDefs:Vd,angleCategoryAxisOptionsDefs:Hd,radiusNumberAxisOptionsDefs:Ud,radiusCategoryAxisOptionsDefs:zd}=n.n1,Wd={type:"axis",name:"ordinal-time",chartType:"cartesian",enterprise:!0,options:Bd,create:e=>new de(e)},jd={type:"axis",name:"angle-number",chartType:"polar",enterprise:!0,options:Vd,create:e=>new ae(e)},$d={type:"axis",name:"angle-category",chartType:"polar",enterprise:!0,options:Hd,create:e=>new Z(e)},Kd={type:"axis",name:"radius-number",chartType:"polar",enterprise:!0,options:Ud,create:e=>new Ye(e)},Yd={type:"axis",name:"radius-category",chartType:"polar",enterprise:!0,options:zd,create:e=>new ze(e)},{Chart:qd,Property:Xd}=n.n1,Zd=class extends qd{getChartType(){return"flow-proportion"}async updateData(){await super.updateData();const e=this.getOptions();this.nodes!==e.nodes&&(this.nodes=e.nodes);const{nodes:t}=this;this.series.forEach(e=>{(function(e){return"sankey"===e.type||"chord"===e.type})(e)&&e.setChartNodes(t)})}performLayout(e){const{seriesRoot:t,annotationRoot:i}=this,{layoutBox:n}=e;n.shrink(this.seriesArea.padding.toJson());const s=n.clone();this.seriesRect=s,this.animationRect=s,t.visible=this.series.some(e=>e.visible);for(const e of[t,i])e.translationX=Math.floor(s.x),e.translationY=Math.floor(s.y);this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:t.visible,rect:s,paddedRect:s}})}};Zd.className="FlowProportionChart",Zd.type="flow-proportion",a([Xd],Zd.prototype,"nodes",2);var{isAgFlowProportionChartOptions:Qd,flowProportionChartOptionsDefs:Jd}=n.n1,ep={type:"chart",name:"flow-proportion",enterprise:!0,options:Jd,detect:Qd,create:(e,t)=>new Zd(e,t)},{Chart:tp}=n.n1,ip=class extends tp{getChartType(){return"gauge"}performLayout(e){const{seriesRoot:t,annotationRoot:i,series:n,seriesArea:s}=this,{layoutBox:r}=e,o=r.clone();r.shrink(s.padding.toJson()),this.seriesRect=o.clone().translate(o.x-r.x,o.y-r.y),this.animationRect=r,t.visible=n.some(e=>e.visible);for(const e of[t,i])e.translationX=Math.floor(r.x),e.translationY=Math.floor(r.y);this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:t.visible,rect:o,paddedRect:r}})}getAriaLabel(){const e=[],t=this.getCaptionText();0!==t.length&&e.push(t);for(const t of this.series)e.push(t.getCaptionText());const i=e.join(". ");return this.ctx.localeManager.t("ariaAnnounceGaugeChart",{caption:i})}};ip.className="GaugeChart",ip.type="gauge";var{isAgGaugeChartOptions:np,gaugeChartOptionsDefs:sp}=n.n1,rp={type:"chart",name:"gauge",enterprise:!0,options:sp,detect:np,create:(e,t)=>new ip(e,t)},{Chart:op}=n.n1,ap=class extends op{getChartType(){return"hierarchy"}performLayout(e){const{seriesRoot:t,annotationRoot:i}=this,{layoutBox:n}=e;n.shrink(this.seriesArea.padding.toJson());const s=n.clone();this.seriesRect=s,this.animationRect=s;for(const e of[t,i])e.translationX=Math.floor(s.x),e.translationY=Math.floor(s.y);t.visible=this.series[0].visible,t.setClipRect(s.clone()),this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:!0,rect:s,paddedRect:s}})}getAriaLabel(){const e=this.getCaptionText();return this.ctx.localeManager.t("ariaAnnounceHierarchyChart",{caption:e})}};ap.className="HierarchyChart",ap.type="hierarchy";var{isAgHierarchyChartOptions:lp,hierarchyChartOptionsDefs:cp}=n.n1,hp={type:"chart",name:"hierarchy",enterprise:!0,options:cp,detect:lp,create:(e,t)=>new ap(e,t)},{Chart:up}=n.n1,dp=class extends up{getChartType(){return"standalone"}performLayout(e){const{seriesRoot:t,annotationRoot:i}=this,{layoutBox:n}=e;n.shrink(this.seriesArea.padding.toJson());const s=n.clone();this.seriesRect=s,this.animationRect=s;for(const e of[t,i])e.translationX=Math.floor(n.x),e.translationY=Math.floor(n.y);t.visible=this.series[0].visible,this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:!0,rect:s,paddedRect:n}})}getAriaLabel(){const e=this.getCaptionText();return this.ctx.localeManager.t("ariaAnnounceHierarchyChart",{caption:e})}};dp.className="StandaloneChart",dp.type="standalone";var{isAgStandaloneChartOptions:pp,standaloneChartOptionsDefs:gp}=n.n1,fp={type:"chart",name:"standalone",enterprise:!0,options:gp,detect:pp,create:(e,t)=>new dp(e,t)},{Chart:mp,MercatorScale:yp,NumberAxis:vp,Property:bp}=n.n1;function Cp(e){return"map-shape"===e.type||"map-line"===e.type||"map-marker"===e.type||"map-shape-background"===e.type||"map-line-background"===e.type}var wp=class extends mp{constructor(e,t){super(e,t),this.xAxis=new vp(this.getModuleContext()),this.xAxis.position="bottom",this.yAxis=new vp(this.getModuleContext()),this.yAxis.position="left",this.ctx.zoomManager.updateAxes([this.xAxis,this.yAxis])}getChartType(){return"topology"}async updateData(){await super.updateData();const e=this.getOptions();this.topology!==e.topology&&(this.topology=e.topology);const{topology:t}=this;this.series.forEach(e=>{Cp(e)&&e.setChartTopology(t)})}performLayout(e){const{seriesRoot:t,annotationRoot:i}=this,{layoutBox:n}=e;n.shrink(this.seriesArea.padding.toJson());const s=n.clone();this.seriesRect=s,this.animationRect=s;const r=this.series.filter(Cp),o=r.reduce((e,t)=>{if(!t.visible)return e;const i=t.topologyBounds;return null==i?e:null==e?i:(e.merge(i),e)},void 0);let a;if(null!=o){const{lon0:e,lat0:t,lon1:i,lat1:n}=o,r=[[e,t],[i,n]],l=yp.bounds(r),{width:c,height:h}=s,u=Math.min(c/l.width,h/l.height),d=l.width*u,p=l.height*u,g=(c-d)/2,f=(h-p)/2,m=g,y=f,v=g+d,b=f+p,C=this.ctx.zoomManager.getAxisZoom(this.xAxis.id),w=this.ctx.zoomManager.getAxisZoom(this.yAxis.id),S=(v-m)/(C.max-C.min),x=m-S*C.min,E=(b-y)/(1-w.min-(1-w.max)),A=y-E*(1-w.max);a=new yp(r,[[x,A],[x+S,A+E]])}r.forEach(e=>{e.scale=a});const l=this.series.some(e=>e.visible);t.visible=l;for(const e of[t,i])e.translationX=Math.floor(s.x),e.translationY=Math.floor(s.y),e.setClipRect(s.clone());this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:l,rect:s,paddedRect:s}})}};wp.className="TopologyChart",wp.type="topology",a([bp],wp.prototype,"topology",2);var{isAgTopologyChartOptions:Sp,topologyChartOptionsDefs:xp}=n.n1,Ep={type:"chart",name:"topology",enterprise:!0,options:xp,detect:Sp,create:(e,t)=>new wp(e,t)},{annotationCalloutStylesDefs:Ap,annotationNoteStylesDefs:Mp,annotationTextStylesDef:Tp,annotationCommentStylesDefs:Dp,annotationMeasurerStylesDefs:Ip,annotationShapeStylesDefs:Rp,annotationChannelTextDefs:kp,annotationCrossLineStyleDefs:Pp,annotationFibonacciStylesDefs:_p,annotationLineStyleDefs:Lp,annotationLineTextDefs:Np,annotationDisjointChannelStyleDefs:Op,annotationParallelChannelStyleDefs:Fp}=n.n1,Gp=(0,s.fd)({__type:(0,s.mw)((0,s.dY)("date")),value:(0,s.or)(s.Yj,s.ai)},"a serializable date object"),Bp=(0,s.or)(s.Yj,s.ai,Gp),Vp=(0,s.or)(Bp,(0,s.fd)({value:Bp,groupPercentage:(0,s.fN)(-1,1)})),Hp={...kp,label:s.Yj},Up={...Np,label:s.Yj},zp={x:Vp,y:s.ai},Wp=(0,s.is)({line:{...Lp,start:zp,end:zp,text:Up},"horizontal-line":{...Pp,value:Vp,text:Up},"vertical-line":{...Pp,value:Vp,text:Up},"disjoint-channel":{...Op,startHeight:s.Ly,endHeight:s.Ly,start:zp,end:zp,text:Hp},"parallel-channel":{...Fp,height:s.Ly,start:zp,end:zp,text:Hp},"fibonacci-retracement":{..._p,start:zp,end:zp,text:Up,reverse:s.zM},"fibonacci-retracement-trend-based":{..._p,start:zp,end:zp,endRetracement:zp,text:Up,reverse:s.zM},callout:{...Ap,start:zp,end:zp,text:s.Yj},comment:{...Dp,...zp,text:s.Yj},note:{...Mp,...zp,text:s.Yj},text:{...Tp,...zp,text:s.Yj},arrow:{...Lp,text:Up,start:zp,end:zp},"arrow-up":{...Rp,...zp},"arrow-down":{...Rp,...zp},"date-range":{...Ip,extendAbove:s.zM,extendBelow:s.zM,text:Up,start:zp,end:zp},"price-range":{...Ip,extendLeft:s.zM,extendRight:s.zM,text:Up,start:zp,end:zp},"date-price-range":{...Ip,text:Up,start:zp,end:zp}},"an annotation initial state object"),jp={chartType:(0,s.KC)("candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"),annotations:(0,s.J$)(Wp),legend:(0,s.J$)({visible:s.zM,seriesId:s.Yj,itemId:s.Yj,legendItemName:s.Yj},"legend state array"),zoom:{rangeX:{start:(0,s.or)(s.ai,Gp),end:(0,s.or)(s.ai,Gp)},rangeY:{start:(0,s.or)(s.ai,Gp),end:(0,s.or)(s.ai,Gp)},ratioX:{start:s.CG,end:s.CG},ratioY:{start:s.CG,end:s.CG},autoScaledAxes:(0,s.jk)((0,s.dY)("y"))}},{ScalableGroup:$p,Rect:Kp,Line:Yp,BBox:qp,Selection:Xp,applyShapeFillBBox:Zp}=n.n1,Qp=class extends $p{constructor(){super(),this.append([new Kp({tag:0}),new Kp({tag:2}),new Kp({tag:1}),new Yp({tag:3}),new Yp({tag:3}),new Yp({tag:4}),new Yp({tag:4})])}updateDatumStyles(e,t,i,n,s){const{bandwidth:r,scaledValues:{xValue:o,medianValue:a}}=e;let{minValue:l,q1Value:c,q3Value:h,maxValue:u}=e.scaledValues;(i&&!n||!i&&n)&&([u,h,c,l]=[l,c,h,u]);const d=(e,t,n,s)=>i?{y:e,x:t,width:s,height:n}:{x:e,y:t,width:n,height:s},p=(e,t,n)=>i?{y1:e,y2:t,x:n}:{x1:e,x2:t,y:n},g=(e,t,n)=>i?{x1:t,x2:n,y:e}:{x:e,y1:t,y2:n},{fill:f,fillOpacity:m,stroke:y,strokeWidth:v,strokeOpacity:b,lineDash:C,lineDashOffset:w,cornerRadius:S,cap:x,whisker:E}=t,A=Xp.select(this,Kp),[M]=A.selectByTag(0),[T]=A.selectByTag(2),[D]=A.selectByTag(1),I=A.selectByTag(3),R=A.selectByTag(4);E.strokeWidth>r&&(E.strokeWidth=r);const k=d(c,o,h-c,r);T.setProperties(k),M.setProperties(k),M.setProperties({cornerRadius:S});const P=Math.max(Math.round(a-v/2),c+v),_=Math.min(Math.round(a+v/2),h-v);var L,N,O,F;D.setProperties(k),D.setProperties({visible:P<_,cornerRadius:S,clipBBox:(L=P,N=o+v,O=_-P,F=Math.max(0,r-2*v),({x:L,y:N,width:O,height:F}=d(L,N,O,F)),new qp(L,N,O,F))});const G=Math.floor(o+r*(1-x.lengthRatio)/2),B=Math.ceil(o+r*(1+x.lengthRatio)/2);R[0].setProperties(g(l,G,B)),R[1].setProperties(g(u,G,B)),I[0].setProperties(p(Math.round(l+E.strokeWidth/2),c,Math.floor(o+r/2))),I[1].setProperties(p(h,Math.round(u-E.strokeWidth/2),Math.floor(o+r/2))),Zp(M,f,s),M.setProperties({fill:f,fillOpacity:m,strokeWidth:2*v,strokeOpacity:0}),D.setProperties({fill:y,fillOpacity:b,strokeWidth:0});for(const e of[...I,...R])e.setProperties(E);T.setProperties({stroke:y,strokeWidth:v,strokeOpacity:b,lineDash:C,lineDashOffset:w,cornerRadius:S,fillOpacity:0})}distanceSquared(e,t){const i=Xp.selectByClass(this,Kp,Yp);return n.n1.nearestSquared(e,t,i).distanceSquared}get midPoint(){const e=this.datum;return void 0===e.midPoint?(s.Vy.error("BoxPlotGroup.datum.midPoint is undefined"),{x:NaN,y:NaN}):e.midPoint}},{BaseProperties:Jp,FillGradientDefaults:eg,FillPatternDefaults:tg,FillImageDefaults:ig,AbstractBarSeriesProperties:ng,SeriesTooltip:sg,Property:rg,mergeDefaults:og}=n.n1,ag=class extends Jp{constructor(){super(...arguments),this.lengthRatio=.5}};a([rg],ag.prototype,"lengthRatio",2);var lg=class extends Jp{};a([rg],lg.prototype,"stroke",2),a([rg],lg.prototype,"strokeWidth",2),a([rg],lg.prototype,"strokeOpacity",2),a([rg],lg.prototype,"lineDash",2),a([rg],lg.prototype,"lineDashOffset",2);var cg=class extends ng{constructor(){super(...arguments),this.fill="#c16068",this.fillGradientDefaults=new eg,this.fillPatternDefaults=new tg,this.fillImageDefaults=new ig,this.fillOpacity=1,this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.cap=new ag,this.whisker=new lg,this.tooltip=new sg}toJson(){const{stroke:e,strokeWidth:t,strokeOpacity:i,lineDash:n,lineDashOffset:s}=this,r=super.toJson();return r.whisker=og(r.whisker,{stroke:e,strokeWidth:t,strokeOpacity:i,lineDash:n,lineDashOffset:s}),r}};a([rg],cg.prototype,"xKey",2),a([rg],cg.prototype,"minKey",2),a([rg],cg.prototype,"q1Key",2),a([rg],cg.prototype,"medianKey",2),a([rg],cg.prototype,"q3Key",2),a([rg],cg.prototype,"maxKey",2),a([rg],cg.prototype,"xName",2),a([rg],cg.prototype,"yName",2),a([rg],cg.prototype,"minName",2),a([rg],cg.prototype,"q1Name",2),a([rg],cg.prototype,"medianName",2),a([rg],cg.prototype,"q3Name",2),a([rg],cg.prototype,"maxName",2),a([rg],cg.prototype,"fill",2),a([rg],cg.prototype,"fillGradientDefaults",2),a([rg],cg.prototype,"fillPatternDefaults",2),a([rg],cg.prototype,"fillImageDefaults",2),a([rg],cg.prototype,"fillOpacity",2),a([rg],cg.prototype,"stroke",2),a([rg],cg.prototype,"strokeWidth",2),a([rg],cg.prototype,"strokeOpacity",2),a([rg],cg.prototype,"lineDash",2),a([rg],cg.prototype,"lineDashOffset",2),a([rg],cg.prototype,"cornerRadius",2),a([rg],cg.prototype,"itemStyler",2),a([rg],cg.prototype,"cap",2),a([rg],cg.prototype,"whisker",2),a([rg],cg.prototype,"tooltip",2);var{extractDecoratedProperties:hg,fixNumericExtent:ug,keyProperty:dg,mergeDefaults:pg,SeriesNodePickMode:gg,SMALLEST_KEY_INTERVAL:fg,valueProperty:mg,diff:yg,animationValidation:vg,computeBarFocusBounds:bg,createDatumId:Cg,ContinuousScale:wg,ChartAxisDirection:Sg,motion:xg,isGradientFill:Eg,getShapeStyle:Ag}=n.n1,Mg=class extends n.n1.SeriesNodeEvent{constructor(e,t,i,n){super(e,t,i,n),this.xKey=n.properties.xKey,this.minKey=n.properties.minKey,this.q1Key=n.properties.q1Key,this.medianKey=n.properties.medianKey,this.q3Key=n.properties.q3Key,this.maxKey=n.properties.maxKey}},Tg=class extends n.n1.AbstractBarSeries{constructor(e){super({moduleCtx:e,pickModes:[gg.NEAREST_NODE,gg.EXACT_SHAPE_MATCH],directionKeys:{x:["xKey"],y:["medianKey","q1Key","q3Key","minKey","maxKey"]},directionNames:{x:["xName"],y:["medianName","q1Name","q3Name","minName","maxName"]},categoryKey:"xValue",pathsPerSeries:[],hasHighlightedLabels:!0}),this.properties=new cg,this.NodeEvent=Mg}async processData(e){if(!this.visible)return;const{xKey:t,minKey:i,q1Key:n,medianKey:s,q3Key:r,maxKey:o}=this.properties,a=!this.ctx.animationManager.isSkipped(),l=this.getCategoryAxis()?.scale,c=this.getValueAxis()?.scale,{isContinuousX:h,xScaleType:u,yScaleType:d}=this.getScaleInformation({xScale:l,yScale:c}),p=[];a&&this.processedData&&p.push(yg(this.id,this.processedData)),a&&p.push(vg());const{processedData:g}=await this.requestDataModel(e,this.data,{props:[dg(t,u,{id:"xValue"}),mg(i,d,{id:"minValue"}),mg(n,d,{id:"q1Value"}),mg(s,d,{id:"medianValue"}),mg(r,d,{id:"q3Value"}),mg(o,d,{id:"maxValue"}),...h?[fg]:[],...p]});this.smallestDataInterval=g.reduced?.smallestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!t||!i)return[];if(e!==this.getBarDirection()){const{index:e,def:n}=i.resolveProcessedDataDefById(this,"xValue"),s=t.domain.keys[e];return"key"===n.type&&"category"===n.valueType?s:this.padBandExtent(s)}const n=this.domainForClippedRange(e,["minValue","maxValue"],"xValue",!0);return ug(n)}getSeriesRange(e,t){return this.domainForVisibleRange(Sg.Y,["maxValue","minValue"],"xValue",t,!0)}createNodeData(){const{visible:e,dataModel:t,processedData:i}=this,n=this.getCategoryAxis(),s=this.getValueAxis();if(!(t&&i&&n&&s))return;const{xKey:r,fill:o,fillOpacity:a,stroke:l,strokeWidth:c,strokeOpacity:h,lineDash:u,lineDashOffset:d,cap:p,whisker:g}=this.properties,f=[],m=t.resolveKeysById(this,"xValue",i),y=t.resolveColumnById(this,"minValue",i),v=t.resolveColumnById(this,"q1Value",i),b=t.resolveColumnById(this,"medianValue",i),C=t.resolveColumnById(this,"q3Value",i),w=t.resolveColumnById(this,"maxValue",i),{barWidth:S,groupIndex:x}=this.updateGroupScale(n),E=wg.is(n.scale)?-.5*S:0,{groupScale:A}=this,M=this.isVertical(),T={itemId:r,nodeData:f,labelData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.groupScale),visible:this.visible};return e?((i.dataSources.get(this.id)??[]).forEach((e,t)=>{const i=m[t];if(null==i)return;const T=y[t],D=v[t],I=b[t],R=C[t],k=w[t];if([T,D,I,R,k].some(e=>"number"!=typeof e)||T>D||D>I||I>R||R>k)return;const P={xValue:Math.round(n.scale.convert(i)),minValue:Math.round(s.scale.convert(T)),q1Value:Math.round(s.scale.convert(D)),medianValue:Math.round(s.scale.convert(I)),q3Value:Math.round(s.scale.convert(R)),maxValue:Math.round(s.scale.convert(k))};P.xValue+=Math.round(A.convert(String(x)))+E;const _=Math.round(S),L=Math.abs(P.q3Value-P.q1Value),N=P.xValue+_/2,O=Math.min(P.q3Value,P.q1Value)+L/2,F={x:M?N:O,y:M?O:N};let G;G=M?{x:F.x-_/2,y:P.minValue,width:_,height:P.maxValue-P.minValue}:{x:P.minValue,y:F.y-_/2,width:P.maxValue-P.minValue,height:_},f.push({series:this,itemId:i,datum:e,datumIndex:t,xKey:r,bandwidth:_,scaledValues:P,cap:p,whisker:g,fill:o,fillOpacity:a,stroke:l,strokeWidth:c,strokeOpacity:h,lineDash:u,lineDashOffset:d,midPoint:F,focusRect:G})}),T):T}legendItemSymbol(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:n,strokeOpacity:s,lineDash:r,lineDashOffset:o,fillGradientDefaults:a,fillPatternDefaults:l,fillImageDefaults:c}=this.properties;return{marker:Ag({fill:e,fillOpacity:t,stroke:i,strokeOpacity:s,strokeWidth:n,lineDash:r,lineDashOffset:o},a,l,c)}}getLegendData(e){const{id:t,ctx:{legendManager:i},visible:n}=this,{xKey:s,yName:r,showInLegend:o,legendItemName:a}=this.properties;return s&&"category"===e?[{legendType:"category",id:t,itemId:t,seriesId:t,enabled:n&&i.getItemEnabled({seriesId:t,itemId:t}),label:{text:a??r??t},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!o}]:[]}getTooltipContent(e){const{id:t,dataModel:i,processedData:n,properties:s}=this,{xKey:r,xName:o,yName:a,medianKey:l,medianName:c,q1Key:h,q1Name:u,q3Key:d,q3Name:p,minKey:g,minName:f,maxKey:m,maxName:y,legendItemName:v,tooltip:b}=s,C=this.getCategoryAxis(),w=this.getValueAxis();if(!(i&&n&&C&&w))return;const S=n.dataSources.get(this.id)?.[e],x=i.resolveKeysById(this,"xValue",n)[e],E=i.resolveColumnById(this,"minValue",n)[e],A=i.resolveColumnById(this,"q1Value",n)[e],M=i.resolveColumnById(this,"medianValue",n)[e],T=i.resolveColumnById(this,"q3Value",n)[e],D=i.resolveColumnById(this,"maxValue",n)[e];if(null==x)return;const I=this.getItemBaseStyle(!1);return Object.assign(I,this.getItemStyleOverrides(String(e),S,I,!1)),this.formatTooltipWithContext(b,{heading:C.formatDatum(x),title:v??a,symbol:this.legendItemSymbol(),data:[{label:f,fallbackLabel:g,value:w.formatDatum(E)},{label:u,fallbackLabel:h,value:w.formatDatum(A)},{label:c,fallbackLabel:l,value:w.formatDatum(M)},{label:p,fallbackLabel:d,value:w.formatDatum(T)},{label:y,fallbackLabel:m,value:w.formatDatum(D)}]},{seriesId:t,datum:S,title:a,xKey:r,xName:o,yName:a,medianKey:l,medianName:c,q1Key:h,q1Name:u,q3Key:d,q3Name:p,minKey:g,minName:f,maxKey:m,maxName:y,...I})}animateEmptyUpdateReady({datumSelection:e}){const t=this.isVertical(),{from:i,to:n}=function(e){return{from:e?{scalingX:1,scalingY:0}:{scalingX:0,scalingY:1},to:{scalingX:1,scalingY:1}}}(t);xg.resetMotion([e],function(e){return(t,i)=>e?{scalingCenterY:i.scaledValues.medianValue}:{scalingCenterX:i.scaledValues.medianValue}}(t)),xg.staticFromToMotion(this.id,"datums",this.ctx.animationManager,[e],i,n,{phase:"initial"})}isLabelEnabled(){return!1}updateDatumSelection(e){const t=e.nodeData??[];return e.datumSelection.update(t)}getItemBaseStyle(e){const{properties:t}=this,{cornerRadius:i,cap:n,whisker:s,fillGradientDefaults:r,fillPatternDefaults:o,fillImageDefaults:a}=t,l=e?t.highlightStyle.item:void 0,c=this.getStrokeWidth(t.strokeWidth);return Ag({fill:l?.fill??t.fill,fillOpacity:l?.fillOpacity??t.fillOpacity,stroke:l?.stroke??t.stroke,strokeWidth:l?.strokeWidth??c,strokeOpacity:l?.strokeOpacity??t.strokeOpacity,lineDash:l?.lineDash??t.lineDash??[],lineDashOffset:l?.lineDashOffset??t.lineDashOffset,cornerRadius:i,cap:n,whisker:s},r,o,a)}getItemStyleOverrides(e,t,i,n){const{id:s,properties:r}=this,{xKey:o,minKey:a,q1Key:l,medianKey:c,q3Key:h,maxKey:u,fillGradientDefaults:d,fillPatternDefaults:p,fillImageDefaults:g,itemStyler:f}=r;if(null==f)return;const m=this.cachedDatumCallback(Cg(e,n?"highlight":"node"),()=>this.callWithContext(f,{seriesId:s,datum:t,xKey:o,minKey:a,q1Key:l,medianKey:c,q3Key:h,maxKey:u,highlighted:n,...i}));return Ag(m,d,p,g)}updateDatumNodes({datumSelection:e,isHighlight:t}){const i=this.isVertical(),n=this.getValueAxis()?.isReversed(),{highlightStyle:s}=this.properties;e.each((e,r)=>{let o=this.getFormattedStyles(r,t?"highlight":"node");t&&(o=pg(s.item,o));const{stroke:a,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:u}=o;o.whisker=pg(o.whisker,{stroke:a,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:u});const d=this.getShapeFillBBox();e.updateDatumStyles(r,o,i,n,d)})}updateLabelNodes(){}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t)}nodeFactory(){return new Qp}getFormattedStyles(e,t){const{id:i,properties:n}=this,{xKey:s,minKey:r,q1Key:o,medianKey:a,q3Key:l,maxKey:c,itemStyler:h,cornerRadius:u,fillGradientDefaults:d,fillPatternDefaults:p,fillImageDefaults:g}=n,{datum:f,stroke:m,strokeWidth:y,strokeOpacity:v,lineDash:b,lineDashOffset:C,cap:w,whisker:S}=e;let x,E=1;Eg(e.fill)?x=e.fill:(x=e.fill,E=n.fillOpacity);let A=Ag({fill:x,fillOpacity:E,stroke:m,strokeWidth:y,strokeOpacity:v,lineDash:b,lineDashOffset:C,cornerRadius:u,cap:hg(w),whisker:hg(S)},d,p,g);if(h){const e=this.cachedDatumCallback(Cg(f.index,t),()=>this.callWithContext(h,{datum:f,seriesId:i,highlighted:"highlight"===t,...A,xKey:s,minKey:r,q1Key:o,medianKey:a,q3Key:l,maxKey:c}));e&&(A=Ag(pg(e,A),d,p,g))}return A}computeFocusBounds({datumIndex:e}){return bg(this,this.contextNodeData?.nodeData[e].focusRect)}};Tg.className="BoxPlotSeries",Tg.type="box-plot";var{boxPlotSeriesThemeableOptionsDef:Dg,commonSeriesOptionsDefs:Ig}=n.n1,Rg={...Dg,...Ig,type:(0,s.mw)((0,s.dY)("box-plot")),xKey:(0,s.mw)(s.Yj),minKey:(0,s.mw)(s.Yj),q1Key:(0,s.mw)(s.Yj),medianKey:(0,s.mw)(s.Yj),q3Key:(0,s.mw)(s.Yj),maxKey:(0,s.mw)(s.Yj),xName:s.Yj,yName:s.Yj,minName:s.Yj,q1Name:s.Yj,medianName:s.Yj,q3Name:s.Yj,maxName:s.Yj,grouped:s.zM,legendItemName:s.Yj},{CARTESIAN_AXIS_TYPE:kg}=n.n1.ThemeConstants,Pg={series:{direction:"vertical",fill:{$if:[{$or:[{$isGradient:[{$palette:"fill"}]},{$isPattern:[{$palette:"fill"}]},{$isImage:[{$palette:"fill"}]}]},{$palette:"fill"},{$mix:[n.n1.SAFE_FILL_OPERATION,{$ref:"backgroundColor"},.7]}]},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:n.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:n.n1.FILL_IMAGE_DEFAULTS,strokeWidth:2},axes:{[kg.NUMBER]:{crosshair:{snap:!1}},[kg.CATEGORY]:{groupPaddingInner:.2,crosshair:{enabled:!1,snap:!1}}}},_g={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"box-plot",moduleFactory:e=>new Tg(e),tooltipDefaults:{range:"exact"},defaultAxes:n.n1.DIRECTION_SWAP_AXES,themeTemplate:Pg,groupable:!0},Lg={type:"series",name:"box-plot",chartType:"cartesian",enterprise:!0,options:Rg,create:e=>new Tg(e)},{findMinMax:Ng}=n.n1;function Og(e,t=1){let i=Math.ceil(Math.log2(e.length/t))-1;return i=Math.min(Math.max(i,0),16),2**i|0}function Fg(e){return Ng(e.map(e=>Number(e)))}function Gg(e,t,i){return(e.valueOf()-t)/(i-t)}function Bg(e,t){return 4*Math.min(Math.floor(e*t),t-1)|0}function Vg(e,t,i,n,s,r){const o=new Int32Array(4*r).fill(-1),a=new Float64Array(4*r).fill(NaN);for(let l=0;l<e.length;l+=1){const c=e[l],h=t[l],u=i[l];if(null==c||null==h||null==u)continue;const d=Gg(c,n,s),p=h.valueOf(),g=u.valueOf(),f=Bg(d,r),m=-1===o[f+0];(m||d<a[f+0])&&(o[f+0]=l,a[f+0]=d),(m||d>a[f+1])&&(o[f+1]=l,a[f+1]=d),(m||g<a[f+2])&&(o[f+2]=l,a[f+2]=g),(m||p>a[f+3])&&(o[f+3]=l,a[f+3]=p)}return{indexData:o,valueData:a}}function Hg(e,t,i,{inPlace:n=!1}={}){const s=i/2|0,r=n?e:new Int32Array(4*s),o=n?t:new Float64Array(4*s);for(let i=0;i<s;i+=1){const n=4*i|0,s=2*n|0,a=s+4|0,l=-1===e[a+0],c=l||t[s+0]<t[a+0]?s:a;r[n+0]=e[c+0],o[n+0]=t[c+0];const h=l||t[s+1]>t[a+1]?s:a;r[n+1]=e[h+1],o[n+1]=t[h+1];const u=l||t[s+2]<t[a+2]?s:a;r[n+2]=e[u+2],o[n+2]=t[u+2];const d=l||t[s+3]>t[a+3]?s:a;r[n+3]=e[d+3],o[n+3]=t[d+3]}return{maxRange:s,indexData:r,valueData:o}}var{fixNumericExtent:Ug,keyProperty:zg,createDatumId:Wg,SeriesNodePickMode:jg,ChartAxisDirection:$g,SMALLEST_KEY_INTERVAL:Kg,valueProperty:Yg,diff:qg,animationValidation:Xg,computeBarFocusBounds:Zg,visibleRangeIndices:Qg,ContinuousScale:Jg,DiscreteTimeScale:ef,BandScale:tf,getShapeStyle:nf}=n.n1,sf=class extends n.n1.SeriesNodeEvent{constructor(e,t,i,n){super(e,t,i,n),this.xKey=n.properties.xKey,this.openKey=n.properties.openKey,this.closeKey=n.properties.closeKey,this.highKey=n.properties.highKey,this.lowKey=n.properties.lowKey}},rf=class extends n.n1.AbstractBarSeries{constructor(e){super({moduleCtx:e,pickModes:[jg.AXIS_ALIGNED,jg.EXACT_SHAPE_MATCH],directionKeys:{x:["xKey"],y:["lowKey","highKey","openKey","closeKey"]},directionNames:{x:["xName"],y:["lowName","highName","openName","closeName"]},categoryKey:"xValue",pathsPerSeries:[]}),this.NodeEvent=sf,this.dataAggregationFilters=void 0}async processData(e){if(!this.visible)return;const{xKey:t,openKey:i,closeKey:n,highKey:s,lowKey:r}=this.properties,o=!this.ctx.animationManager.isSkipped(),a=this.getCategoryAxis()?.scale,l=this.getValueAxis()?.scale,{isContinuousX:c,xScaleType:h,yScaleType:u}=this.getScaleInformation({xScale:a,yScale:l}),d=[];o&&(this.processedData&&d.push(qg(this.id,this.processedData)),d.push(Xg())),i&&d.push(Yg(i,u,{id:"openValue",invalidValue:void 0,missingValue:void 0}));const{dataModel:p,processedData:g}=await this.requestDataModel(e,this.data,{props:[zg(t,h,{id:"xValue"}),Yg(n,u,{id:"closeValue"}),Yg(s,u,{id:"highValue"}),Yg(r,u,{id:"lowValue"}),...c?[Kg]:[],...d]});this.smallestDataInterval=g.reduced?.smallestKeyInterval,this.dataAggregationFilters=this.aggregateData(p,g),this.animationState.transition("updateData")}aggregateData(e,t){const i=this.axes[$g.X];if(null==i||!Jg.is(i.scale)&&!ef.is(i.scale))return;const n=e.resolveKeysById(this,"xValue",t),s=e.resolveColumnById(this,"highValue",t),r=e.resolveColumnById(this,"lowValue",t),{index:o}=e.resolveProcessedDataDefById(this,"xValue");return function(e,t,i,n){if(e.length<1e3)return;const[s,r]=Fg(n);let o=Og(e),{indexData:a,valueData:l}=Vg(e,t,i,s,r,o);const c=[{maxRange:o,indexData:a}];for(;o>64;)({indexData:a,valueData:l,maxRange:o}=Hg(a,l,o)),c.push({maxRange:o,indexData:a});return c.reverse(),c}(n,s,r,t.domain.keys[o])}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!t||!i)return[];if(e!==this.getBarDirection()){const{index:e,def:n}=i.resolveProcessedDataDefById(this,"xValue"),s=t.domain.keys[e];return"key"===n.type&&"category"===n.valueType?s:this.padBandExtent(s)}const n=this.domainForClippedRange(e,["highValue","lowValue"],"xValue",!0);return Ug(n)}getSeriesRange(e,t){return this.domainForVisibleRange($g.Y,["highValue","lowValue"],"xValue",t,!0)}getVisibleItems(e,t,i){return this.countVisibleItems("xValue",["highValue","lowValue"],e,t,i)}createNodeData(){const{visible:e,dataModel:t,processedData:i}=this,n=this.getCategoryAxis(),r=this.getValueAxis();if(!(t&&i&&n&&r))return;const o=[],{xKey:a,highKey:l,lowKey:c}=this.properties,h=i.dataSources.get(this.id)??[],u=t.resolveKeysById(this,"xValue",i),d=t.resolveColumnById(this,"openValue",i),p=t.resolveColumnById(this,"closeValue",i),g=t.resolveColumnById(this,"highValue",i),f=t.resolveColumnById(this,"lowValue",i),{groupScale:m}=this,{barWidth:y,groupIndex:v}=this.updateGroupScale(n),b=m.convert(String(v)),C=y>=1?y:m.rawBandwidth,w=tf.is(n.scale),S={itemId:a,nodeData:o,labelData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.groupScale),visible:this.visible};if(!e)return S;const x=(e,t,i,s,l,c,u,d)=>{const p=h[e],g=w?u/2:0,f=n.scale.convert(t)+b+g,m=r.scale.convert(i),y=r.scale.convert(s),v=r.scale.convert(l),C=r.scale.convert(c),S=s>i,x=S?"up":"down",E=Math.min(v,C),A=Math.max(v,C)-E,M={x:f,y:E+A/2};o.push({series:this,itemId:x,datum:p,datumIndex:e,xKey:a,xValue:t,openValue:i,closeValue:s,highValue:l,lowValue:c,midPoint:M,aggregatedValue:s,isRising:S,centerX:f,width:u,y:E,height:A,yOpen:m,yClose:y,crisp:d})},{dataAggregationFilters:E}=this,A=n.scale,[M,T]=A.range,D=T-M,I=e=>A.convert(u[e])+b,R=E?.find(e=>e.maxRange>D);if(null==R){let[e,t]=Qg(h.length,n.range,e=>{const t=I(e);return[t,t+C]});i.input.count<1e3&&(e=0,t=i.input.count);for(let i=e;i<t;i+=1){const e=u[i];if(null==e)continue;const t=d[i],n=p[i],r=g[i],o=f[i];null!=o&&o<=t&&o<=n?null!=r&&r>=t&&r>=n?x(i,e,t,n,r,o,C,!0):s.Vy.warnOnce(`invalid high value for key [${l}] in data element, high value cannot be lower than datum open or close values.`):s.Vy.warnOnce(`invalid low value for key [${c}] in data element, low value cannot be higher than datum open or close values`)}}else{const{maxRange:e,indexData:t}=R,[i,s]=Qg(e,n.range,e=>{const i=4*e,n=t[i+0],s=t[i+1];if(-1!==n)return[I(n),I(s)+C]});for(let e=i;e<s;e+=1){const i=4*e,n=t[i+0],s=t[i+1],r=t[i+3],o=t[i+2];if(-1===n)continue;const a=(n+s)/2|0,l=u[a];null!=l&&x(a,l,d[n],p[s],g[r],f[o],Math.abs(I(s)-I(n))+C,!1)}}return S}isVertical(){return!0}isLabelEnabled(){return!1}updateDatumSelection(e){const t=e.nodeData??[];return e.datumSelection.update(t)}updateLabelNodes(e){}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t)}getItemBaseStyle(e,t){const{properties:i}=this,n=i.item[e],s=t?i.highlightStyle.item:void 0,r={fill:s?.fill??n.fill,fillOpacity:s?.fillOpacity??n.fillOpacity,stroke:s?.stroke??n.stroke,strokeWidth:s?.strokeWidth??n.strokeWidth,strokeOpacity:s?.strokeOpacity??n.strokeOpacity,lineDash:s?.lineDash??n.lineDash,lineDashOffset:s?.lineDashOffset??n.lineDashOffset};return n.fillGradientDefaults&&n.fillPatternDefaults&&n.fillImageDefaults?nf(r,n.fillGradientDefaults,n.fillPatternDefaults,n.fillImageDefaults):r}getItemStyleOverrides(e,t,i,n,s){const{id:r,properties:o}=this,a=o.item[i],{itemStyler:l}=o;if(null==l)return;const{xKey:c,openKey:h,closeKey:u,highKey:d,lowKey:p}=o,g=this.cachedDatumCallback(Wg(e,s?"highlight":"node"),()=>this.callWithContext(l,{seriesId:r,datum:t,itemId:i,xKey:c,openKey:h,closeKey:u,highKey:d,lowKey:p,highlighted:s,...n}));return a.fillGradientDefaults&&a.fillPatternDefaults&&a.fillImageDefaults?nf(g,a.fillGradientDefaults,a.fillPatternDefaults,a.fillImageDefaults):g}getTooltipContent(e){const{id:t,dataModel:i,processedData:n,properties:s}=this,{xKey:r,xName:o,yName:a,openKey:l,openName:c,highKey:h,highName:u,lowKey:d,lowName:p,closeKey:g,closeName:f,legendItemName:m,tooltip:y}=s,v=this.getCategoryAxis(),b=this.getValueAxis();if(!(i&&n&&v&&b))return;const C=n.dataSources.get(this.id)?.[e],w=i.resolveKeysById(this,"xValue",n)[e],S=i.resolveColumnById(this,"openValue",n)[e],x=i.resolveColumnById(this,"highValue",n)[e],E=i.resolveColumnById(this,"lowValue",n)[e],A=i.resolveColumnById(this,"closeValue",n)[e];if(null==w)return;const M=A>=S?"up":"down",T=this.properties.item[M],D=this.getItemBaseStyle(M,!1);Object.assign(D,this.getItemStyleOverrides(String(e),C,M,D,!1));let I={fill:T.fill??T.stroke,fillOpacity:T.fillOpacity??T.strokeOpacity??1,stroke:T.stroke,strokeWidth:T.strokeWidth??1,strokeOpacity:T.strokeOpacity??1,lineDash:T.lineDash??[0],lineDashOffset:T.lineDashOffset??0};return T.fillGradientDefaults&&T.fillPatternDefaults&&T.fillImageDefaults&&(I=nf(I,T.fillGradientDefaults,T.fillPatternDefaults,T.fillImageDefaults)),this.formatTooltipWithContext(y,{heading:v.formatDatum(w),title:m,symbol:{marker:I},data:[{label:c,fallbackLabel:l,value:b.formatDatum(S)},{label:u,fallbackLabel:h,value:b.formatDatum(x)},{label:p,fallbackLabel:d,value:b.formatDatum(E)},{label:f,fallbackLabel:g,value:b.formatDatum(A)}]},{seriesId:t,datum:C,title:a,itemId:M,xKey:r,xName:o,yName:a,openKey:l,openName:c,highKey:h,highName:u,lowKey:d,lowName:p,closeKey:g,closeName:f,...D})}getDatumId(e){return Wg(e.xValue)}computeFocusBounds(e){const t=this.getNodeData()?.at(e.datumIndex);if(null==t)return;const{centerX:i,y:n,width:s,height:r}=t;return Zg(this,{x:i-s/2,y:n,width:s,height:r})}},{Path:of,SceneChangeDetection:af,BBox:lf}=n.n1,cf=class extends of{constructor(){super(...arguments),this.centerX=0,this.y=0,this.width=0,this.height=0,this.yOpen=0,this.yClose=0,this.crisp=!1,this.strokeAlignment=0}computeBBox(){const{centerX:e,y:t,width:i,height:n}=this;return new lf(e-i/2,t,i,n)}isPointInPath(e,t){return this.getBBox().containsPoint(e,t)}distanceSquared(e,t){return this.getBBox().distanceSquared(e,t)}get midPoint(){return{x:this.centerX,y:this.y+this.height/2}}alignedCoordinates(){const{y:e,width:t,height:i,crisp:n,strokeAlignment:s}=this;let{centerX:r,yOpen:o,yClose:a}=this,l=r-t/2,c=r+t/2,h=e,u=e+i;if(n&&t>1){r=this.align(r),o=this.align(o),a=this.align(a);const n=this.align(t/2);l=r-n,c=r+n,h=this.align(e),u=h+this.align(h,i)}const d=(h+u)/2;return r+=s,l+=s,c+=s,h-=s,u+=s,o+=o<d?s:-s,a+=a<d?s:-s,{centerX:r,x0:l,x1:c,y0:h,y1:u,yOpen:o,yClose:a}}executeStroke(e,t){const{width:i,strokeWidth:n}=this;i<n&&(e.lineWidth=i),super.executeStroke(e,t)}};a([af()],cf.prototype,"centerX",2),a([af()],cf.prototype,"y",2),a([af()],cf.prototype,"width",2),a([af()],cf.prototype,"height",2),a([af()],cf.prototype,"yOpen",2),a([af()],cf.prototype,"yClose",2),a([af()],cf.prototype,"crisp",2),a([af()],cf.prototype,"strokeAlignment",2);var hf=class extends cf{updatePath(){const{path:e}=this,{centerX:t,x0:i,x1:n,y0:s,y1:r,yOpen:o,yClose:a}=this.alignedCoordinates();e.clear(),e.moveTo(t,s),e.lineTo(t,r),Math.abs(n-i)>1&&(e.moveTo(i,o),e.lineTo(t,o),e.moveTo(t,a),e.lineTo(n,a))}},{SceneArrayChangeDetection:uf,SceneChangeDetection:df,ExtendedPath2D:pf,BBox:gf}=n.n1,ff=class extends cf{constructor(){super(...arguments),this.wickPath=new pf,this.wickStroke=void 0,this.wickStrokeWidth=void 0,this.wickStrokeOpacity=void 0}computeDefaultGradientFillBBox(){const{width:e,centerX:t,yOpen:i,yClose:n}=this,s=Math.min(i,n),r=Math.max(i,n),o=t-e/2;return new gf(o,s,t+e/2-o,r-s)}updatePath(){const{path:e,stroke:t,strokeWidth:i,strokeOpacity:n,lineDash:s,lineDashOffset:r,wickStroke:o,wickStrokeWidth:a,wickStrokeOpacity:l,wickLineDash:c,wickLineDashOffset:h,strokeAlignment:u}=this,{centerX:d,x0:p,x1:g,y0:f,y1:m,yOpen:y,yClose:v}=this.alignedCoordinates();this.path.clear(),this.wickPath.clear();const b=null!=o&&o!==t||null!=a&&a!==i||null!=l&&l!==n||null!=c&&c!==s||null!=h&&h!==r?this.wickPath:e;if(Math.abs(g-p)<=3)return b.moveTo(d,f),void b.lineTo(d,m);const C=Math.min(y,v),w=Math.max(y,v);b.moveTo(d,f),b.lineTo(d,C+i/2),b.moveTo(d,m),b.lineTo(d,w-i/2);const S=u+i/2,x=w-C-2*S;if(x>0)e.rect(p+S,C+S,g-p-2*S,x);else{const t=(C+w)/2;e.moveTo(p,t),e.lineTo(g,t)}}drawPath(e){super.drawPath(e);const{wickPath:t}=this;if(t.isEmpty())return;const{stroke:i,strokeWidth:n,strokeOpacity:s,lineDash:r,lineDashOffset:o,wickStroke:a=i,wickStrokeWidth:l=n,wickStrokeOpacity:c=s,wickLineDash:h=r,wickLineDashOffset:u=o}=this;0!==l&&(e.globalAlpha*=c,"string"==typeof a&&(e.strokeStyle=a),e.lineWidth=l,null!=h&&e.setLineDash([...h]),e.lineDashOffset=u,e.stroke(t.getPath2D()))}};a([df()],ff.prototype,"wickStroke",2),a([df()],ff.prototype,"wickStrokeWidth",2),a([df()],ff.prototype,"wickStrokeOpacity",2),a([uf()],ff.prototype,"wickLineDash",2),a([df()],ff.prototype,"wickLineDashOffset",2);var{BaseProperties:mf,Property:yf,AbstractBarSeriesProperties:vf,SeriesTooltip:bf}=n.n1,Cf=class extends mf{constructor(){super(...arguments),this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};a([yf],Cf.prototype,"stroke",2),a([yf],Cf.prototype,"strokeWidth",2),a([yf],Cf.prototype,"strokeOpacity",2),a([yf],Cf.prototype,"lineDash",2),a([yf],Cf.prototype,"lineDashOffset",2);var wf=class extends mf{constructor(){super(...arguments),this.up=new Cf,this.down=new Cf}};a([yf],wf.prototype,"up",2),a([yf],wf.prototype,"down",2);var Sf=class extends vf{};a([yf],Sf.prototype,"xKey",2),a([yf],Sf.prototype,"openKey",2),a([yf],Sf.prototype,"closeKey",2),a([yf],Sf.prototype,"highKey",2),a([yf],Sf.prototype,"lowKey",2),a([yf],Sf.prototype,"xName",2),a([yf],Sf.prototype,"yName",2),a([yf],Sf.prototype,"openName",2),a([yf],Sf.prototype,"closeName",2),a([yf],Sf.prototype,"highName",2),a([yf],Sf.prototype,"lowName",2);var xf=class extends Sf{constructor(){super(...arguments),this.tooltip=new bf,this.item=new wf}};a([yf],xf.prototype,"tooltip",2),a([yf],xf.prototype,"item",2),a([yf],xf.prototype,"itemStyler",2);var{FillGradientDefaults:Ef,FillPatternDefaults:Af,FillImageDefaults:Mf,BaseProperties:Tf,SeriesTooltip:Df,Property:If}=n.n1,Rf=class extends Tf{};a([If],Rf.prototype,"stroke",2),a([If],Rf.prototype,"strokeWidth",2),a([If],Rf.prototype,"strokeOpacity",2),a([If],Rf.prototype,"lineDash",2),a([If],Rf.prototype,"lineDashOffset",2);var kf=class extends Tf{constructor(){super(...arguments),this.fill="#c16068",this.fillGradientDefaults=new Ef,this.fillPatternDefaults=new Af,this.fillImageDefaults=new Mf,this.fillOpacity=1,this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.wick=new Rf}};a([If],kf.prototype,"fill",2),a([If],kf.prototype,"fillGradientDefaults",2),a([If],kf.prototype,"fillPatternDefaults",2),a([If],kf.prototype,"fillImageDefaults",2),a([If],kf.prototype,"fillOpacity",2),a([If],kf.prototype,"stroke",2),a([If],kf.prototype,"strokeWidth",2),a([If],kf.prototype,"strokeOpacity",2),a([If],kf.prototype,"lineDash",2),a([If],kf.prototype,"lineDashOffset",2),a([If],kf.prototype,"cornerRadius",2),a([If],kf.prototype,"wick",2);var Pf=class extends Tf{constructor(){super(...arguments),this.up=new kf,this.down=new kf}};a([If],Pf.prototype,"up",2),a([If],Pf.prototype,"down",2);var _f=class extends Sf{constructor(){super(...arguments),this.item=new Pf,this.tooltip=new Df}};a([If],_f.prototype,"item",2),a([If],_f.prototype,"tooltip",2),a([If],_f.prototype,"itemStyler",2);var{createDatumId:Lf,isGradientFill:Nf,isPatternFill:Of,isImageFill:Ff,getShapeFill:Gf,applyShapeStyle:Bf,getShapeStyle:Vf}=n.n1,Hf=class extends rf{constructor(){super(...arguments),this.properties=new _f}nodeFactory(){return new ff}updateDatumNodes({datumSelection:e,isHighlight:t}){const{id:i,properties:n}=this,{xKey:s,highKey:r,lowKey:o,openKey:a,closeKey:l,item:c,itemStyler:h}=n,{up:u,down:d}=c,p=Vf({fill:u.fill,fillOpacity:u.fillOpacity,stroke:u.stroke,strokeWidth:u.strokeWidth,strokeOpacity:u.strokeOpacity,lineDash:u.lineDash,lineDashOffset:u.lineDashOffset},u.fillGradientDefaults,u.fillPatternDefaults,u.fillImageDefaults),g=Vf({fill:d.fill,fillOpacity:d.fillOpacity,stroke:d.stroke,strokeWidth:d.strokeWidth,strokeOpacity:d.strokeOpacity,lineDash:d.lineDash,lineDashOffset:d.lineDashOffset},d.fillGradientDefaults,d.fillPatternDefaults,d.fillImageDefaults),f=t?n.highlightStyle.item:void 0;e.each((e,n)=>{const{isRising:c,centerX:m,width:y,y:v,height:b,yOpen:C,yClose:w,crisp:S}=n;let x;if(null!=h){const{fill:e,fillOpacity:f,stroke:m,strokeWidth:y,strokeOpacity:v,lineDash:b,lineDashOffset:C}=c?p:g;x=Vf(this.cachedDatumCallback(Lf(this.getDatumId(n),t?"highlight":"node"),()=>this.callWithContext(h,{seriesId:i,itemId:n.itemId,xKey:s,highKey:r,lowKey:o,openKey:a,closeKey:l,datum:n.datum,fill:e,fillOpacity:f,strokeOpacity:v,stroke:m,strokeWidth:y,lineDash:b,lineDashOffset:C,highlighted:t})),c?u.fillGradientDefaults:d.fillGradientDefaults,c?u.fillPatternDefaults:d.fillPatternDefaults,c?u.fillImageDefaults:d.fillImageDefaults)}e.centerX=m,e.width=y,e.y=v,e.height=b,e.yOpen=C,e.yClose=w,e.crisp=S;const E=c?p:g,A=c?u.wick:d.wick;Bf(e,{fill:f?.fill??x?.fill??E.fill,fillOpacity:f?.fillOpacity??x?.fillOpacity??E.fillOpacity,stroke:f?.stroke??x?.stroke??E.stroke,strokeWidth:f?.strokeWidth??x?.strokeWidth??E.strokeWidth,strokeOpacity:f?.strokeOpacity??x?.strokeOpacity??E.strokeOpacity,lineDash:f?.lineDash??x?.lineDash??E.lineDash,lineDashOffset:f?.lineDashOffset??x?.lineDashOffset??E.lineDashOffset},void 0,this.getShapeFillBBox());const M=x?.wick;e.wickStroke=f?.stroke??M?.stroke??A.stroke,e.wickStrokeWidth=f?.strokeWidth??M?.strokeWidth??A.strokeWidth,e.wickStrokeOpacity=f?.strokeOpacity??M?.strokeOpacity??A.strokeOpacity,e.wickLineDash=f?.lineDash??M?.lineDash??A.lineDash,e.wickLineDashOffset=f?.lineDashOffset??M?.lineDashOffset??A.lineDashOffset,e.strokeAlignment=(x?.strokeWidth??E.strokeWidth)/2})}legendItemSymbol(){const{up:e,down:t}=this.properties.item,i=Gf(e.fill,e.fillGradientDefaults,e.fillPatternDefaults,e.fillImageDefaults),n=Nf(i)?i.colorStops.map(e=>"string"==typeof e?e:{color:e.color,stop:null!=e.stop?.5*e.stop:void 0}):[{color:Of(i)||Ff(i)?e.stroke:i,stop:0},{color:Of(i)||Ff(i)?e.stroke:i,stop:.5}],s=Gf(t.fill,t.fillGradientDefaults,t.fillPatternDefaults,t.fillImageDefaults),r={type:"gradient",gradient:"linear",rotation:90,colorStops:[...n,...Nf(s)?s.colorStops.map(e=>"string"==typeof e?e:{color:e.color,stop:null!=e.stop?.5*e.stop:void 0}):[{color:Of(s)||Ff(s)?t.stroke:s,stop:.5}]],reverse:!1},o={type:"gradient",gradient:"linear",rotation:90,colorStops:[{color:e.stroke,stop:0},{color:e.stroke,stop:.5},{color:t.stroke,stop:.5}],reverse:!1};return{marker:{fill:r,fillOpacity:e.fillOpacity,stroke:o,strokeWidth:e.strokeWidth??1,strokeOpacity:e.strokeOpacity??1,lineDash:e.lineDash,lineDashOffset:e.lineDashOffset}}}getLegendData(e){const{id:t,data:i,visible:n,ctx:{legendManager:s}}=this,{xKey:r,yName:o,showInLegend:a,legendItemName:l}=this.properties;return i?.length&&r&&"category"===e?[{legendType:"category",id:t,itemId:t,seriesId:t,enabled:n&&s.getItemEnabled({seriesId:t,itemId:t}),label:{text:l??o??t},symbol:this.legendItemSymbol(),legendItemName:l,hideInLegend:!a}]:[]}};Hf.className="CandleStickSeries",Hf.type="candlestick";var{commonSeriesOptionsDefs:Uf,candlestickSeriesThemeableOptionsDef:zf}=n.n1,Wf={...zf,...Uf,type:(0,s.mw)((0,s.dY)("candlestick")),xKey:(0,s.mw)(s.Yj),openKey:(0,s.mw)(s.Yj),highKey:(0,s.mw)(s.Yj),lowKey:(0,s.mw)(s.Yj),closeKey:(0,s.mw)(s.Yj),xName:s.Yj,yName:s.Yj,openName:s.Yj,highName:s.Yj,lowName:s.Yj,closeName:s.Yj};Wf.pickOutsideVisibleMinorAxis=(0,s._L)(s.zM),Wf.focusPriority=(0,s._L)(s.ai);var{CARTESIAN_AXIS_TYPE:jf}=n.n1.ThemeConstants;function $f(e){return{fill:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},"up"===e?"transparent":{$palette:"fill"},{$palette:`${e}.fill`}]},stroke:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$palette:"stroke"},{$palette:`${e}.stroke`}]},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$if:[{$or:[{$isGradient:[{$palette:`${e}.fill`}]},{$isPattern:[{$palette:`${e}.fill`}]},{$isImage:[{$palette:`${e}.fill`}]}]},{$map:[{$path:["./color",void 0,{$value:"$1"}]},{$path:["./colorStops",void 0,{$palette:`${e}.fill`}]}]},[{$mix:[{$palette:`${e}.fill`},"black",.15]},{$mix:[{$palette:`${e}.fill`},"white",.15]}]]},rotation:0,reverse:!1},fillPatternDefaults:n.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:n.n1.FILL_IMAGE_DEFAULTS}}var Kf={series:{item:{up:$f("up"),down:$f("down")},highlightStyle:{item:{strokeWidth:3}}},animation:{enabled:!1},axes:{[jf.NUMBER]:{crosshair:{snap:!1}},[jf.ORDINAL_TIME]:{groupPaddingInner:0,crosshair:{enabled:!0}}}},{CARTESIAN_AXIS_TYPE:Yf,CARTESIAN_POSITION:qf}=n.n1.ThemeConstants,Xf={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"candlestick",moduleFactory:e=>new Hf(e),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:Yf.NUMBER,position:qf.LEFT},{type:Yf.ORDINAL_TIME,position:qf.BOTTOM}],themeTemplate:Kf,groupable:!1},Zf={type:"series",name:"candlestick",chartType:"cartesian",enterprise:!0,options:Wf,create:e=>new Hf(e)},{CachedTextMeasurerPool:Qf,TextUtils:Jf,TextWrapper:em}=n.n1;function tm(e,t){return null!=e.lineHeight&&null!=e.fontSize?e.lineHeight*t/e.fontSize:Jf.getLineHeight(t)}function im(e,t,i,n,{padding:r},o){const{spacing:a=0}=t,l=2*r,c=2*r+a,h=(t.minimumFontSize??t.fontSize)+(n.minimumFontSize??n.fontSize);if(h>o(h+c,!1).height-c)return;const u=function(e,t){const{fontSize:i,minimumFontSize:n=i}=e,{fontSize:s,minimumFontSize:r=s}=t,o=i-n,a=s-r;let l=e.fontSize,c=t.fontSize;const h=[{labelFontSize:i,secondaryLabelFontSize:s}];for(;l>n||c>r;)(o>0?(l-n)/o:-1)>(a>0?(c-r)/a:-1)?l--:c--,h.push({labelFontSize:l,secondaryLabelFontSize:c});return h.reverse(),h}(t,n),d={fontFamily:t.fontFamily,fontSize:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight},p={fontFamily:n.fontFamily,fontSize:n.fontSize,fontStyle:n.fontStyle,fontWeight:n.fontWeight};let g,f;return(0,s.F4)(0,u.length-1,s=>{const{labelFontSize:r,secondaryLabelFontSize:h}=u[s],m=0===s,y=tm(t,r),v=tm(n,h),b=o(y+v+c,m),C=b.width-l,w=b.height-c;if(y+v>w)return;if(null!=g&&g.fontSize===r||(d.fontSize=r,g=om(t,e,C,w,d,t.wrapping,m?t.overflowStrategy:"hide")),null==g||g.width>C||g.height>w)return;if(null!=f&&f.fontSize===h||(p.fontSize=h,f=om(n,i,C,w,p,n.wrapping,m?n.overflowStrategy:"hide")),null==f)return;const S=g.height+f.height;return f.width>C||S>w?void 0:{width:Math.max(g.width,f.width),height:S+a,meta:b.meta,label:g,secondaryLabel:f}})}function nm(e,t,{padding:i},n){const r=2*i,o=Math.min(t.minimumFontSize??t.fontSize,t.fontSize),a={fontFamily:t.fontFamily,fontSize:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight};return(0,s.F4)(o,t.fontSize,i=>{const s=tm(t,i),l=i===o,c=n(s+r,l),h=c.width-r,u=c.height-r;if(s>u)return;a.fontSize=i;const d=em.wrapLines(e,{maxWidth:h,maxHeight:u,font:a,textWrap:t.wrapping,overflow:(l?t.overflowStrategy:void 0)??"hide"});if(!d.length)return;const p=function(e,{font:t,lineHeight:i=Jf.defaultLineHeight,maxWidth:n,maxHeight:s=1/0}){let r=i*e.length;for(;r>s;){if(1===e.length)return;e.pop(),e[e.length-1]=em.appendEllipsis(e.at(-1)),r=i*e.length}const o=Qf.measureLines(e,{font:t});let a,l;if(o.width>n){const e=[];l=0;for(const t of o.lineMetrics){if(t.width>n){if(!e.length)return;break}e.push(t.text),l=Math.max(l,t.width)}a=em.appendEllipsis(e.join("\n"))}else a=e.join("\n"),l=o.width;return{text:a,width:l,height:r}}(d,{lineHeight:s,font:a,maxWidth:h,maxHeight:u});return p?[{fontSize:i,lineHeight:s,...p},c.meta]:void 0})}function sm(e){return null!=e?.minimumFontSize&&null!=e?.fontSize&&e?.minimumFontSize>e?.fontSize}function rm(e,t,i,n,r,o){const a=t.enabled?e:void 0,l=n.enabled?i:void 0;let c,h,u;if((sm(t)||sm(n))&&s.Vy.warnOnce("minimumFontSize should be set to a value less than or equal to the font size"),null!=a&&null!=l&&(c=im(a,t,l,n,r,o)),null==c&&null!=a&&(h=nm(a,t,r,o)),null!=h){const[e,t]=h;c={width:e.width,height:e.height,meta:t,label:e,secondaryLabel:void 0}}if(null==c&&null==a&&null!=l&&(u=nm(l,n,r,o)),null!=u){const[e,t]=u;c={width:e.width,height:e.height,meta:t,label:void 0,secondaryLabel:e}}return c}function om(e,t,i,n,s,r,o){const a=em.wrapLines(t,{maxWidth:i,maxHeight:n,font:s,textWrap:r,overflow:o});if(!a.length)return;const l=tm(e,s.fontSize),{width:c}=Qf.measureLines(a,{font:s});return{width:c,lineHeight:l,text:a.join("\n"),height:a.length*l,fontSize:s.fontSize}}var{Property:am}=n.n1,lm=class extends n.n1.Label{constructor(){super(...arguments),this.wrapping="on-space",this.overflowStrategy="ellipsis"}};a([am],lm.prototype,"wrapping",2),a([am],lm.prototype,"overflowStrategy",2),a([am],lm.prototype,"lineHeight",2),a([am],lm.prototype,"minimumFontSize",2);var cm=class extends lm{constructor(){super(...arguments),this.spacing=0}};a([am],cm.prototype,"spacing",2);var hm=class extends lm{},{CartesianSeriesProperties:um,SeriesTooltip:dm,Property:pm}=n.n1,gm=class extends um{constructor(){super(...arguments),this.colorRange=["black","black"],this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.textAlign="center",this.verticalAlign="middle",this.itemPadding=0,this.label=new cm,this.tooltip=new dm}};a([pm],gm.prototype,"title",2),a([pm],gm.prototype,"xKey",2),a([pm],gm.prototype,"yKey",2),a([pm],gm.prototype,"colorKey",2),a([pm],gm.prototype,"xName",2),a([pm],gm.prototype,"yName",2),a([pm],gm.prototype,"colorName",2),a([pm],gm.prototype,"colorRange",2),a([pm],gm.prototype,"stroke",2),a([pm],gm.prototype,"strokeOpacity",2),a([pm],gm.prototype,"strokeWidth",2),a([pm],gm.prototype,"textAlign",2),a([pm],gm.prototype,"verticalAlign",2),a([pm],gm.prototype,"itemPadding",2),a([pm],gm.prototype,"itemStyler",2),a([pm],gm.prototype,"label",2),a([pm],gm.prototype,"tooltip",2);var{SeriesNodePickMode:fm,computeBarFocusBounds:mm,getMissCount:ym,valueProperty:vm,ChartAxisDirection:bm,DEFAULT_CARTESIAN_DIRECTION_KEYS:Cm,DEFAULT_CARTESIAN_DIRECTION_NAMES:wm,createDatumId:Sm,ColorScale:xm,Rect:Em,PointerEvents:Am,applyShapeStyle:Mm}=n.n1,Tm=class extends n.n1.CartesianSeriesNodeEvent{constructor(e,t,i,n){super(e,t,i,n),this.colorKey=n.properties.colorKey}},Dm={left:-.5,center:0,right:-.5},Im={top:-.5,middle:0,bottom:-.5},Rm=class extends n.n1.CartesianSeries{constructor(e){super({moduleCtx:e,directionKeys:Cm,directionNames:wm,categoryKey:void 0,pickModes:[fm.NEAREST_NODE,fm.EXACT_SHAPE_MATCH],pathsPerSeries:[],hasMarkers:!1,hasHighlightedLabels:!0}),this.properties=new gm,this.NodeEvent=Tm,this.colorScale=new xm}async processData(e){const t=this.axes[bm.X],i=this.axes[bm.Y];if(!t||!i||!this.data?.length)return;const{xKey:n,yKey:s,colorRange:r,colorKey:o}=this.properties,a=this.axes[bm.X]?.scale,l=this.axes[bm.Y]?.scale,{xScaleType:c,yScaleType:h}=this.getScaleInformation({xScale:a,yScale:l}),u=this.colorScale.type,{dataModel:d,processedData:p}=await this.requestDataModel(e,this.data,{props:[vm(n,c,{id:"xValue"}),vm(s,h,{id:"yValue"}),...o?[vm(o,u,{id:"colorValue",invalidValue:null})]:[]]});if(this.isColorScaleValid()){const e=d.resolveProcessedDataIndexById(this,"colorValue");this.colorScale.domain=p.domain.values[e],this.colorScale.range=r,this.colorScale.update()}}isColorScaleValid(){const{colorKey:e}=this.properties;if(!e)return!1;const{dataModel:t,processedData:i}=this;if(!t||!i)return!1;const n=t.resolveProcessedDataIndexById(this,"colorValue"),s=i.input.count,r=ym(this,i.defs.values[n].missing);return!(0===s||s===r)}xCoordinateRange(e,t){const i=this.axes[bm.X].scale,n=t*(i.bandwidth??0)/2,s=i.convert(e)+n;return[s,s+t*(i.bandwidth??10)]}yCoordinateRange(e,t){const i=this.axes[bm.Y].scale,n=t*(i.bandwidth??0)/2,s=i.convert(e[0])+n;return[s,s+t*(i.bandwidth??10)]}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;return t&&i?e===bm.X?t.getDomain(this,"xValue","value",i):t.getDomain(this,"yValue","value",i):[]}getSeriesRange(e,t){return[NaN,NaN]}createNodeData(){const{data:e,visible:t,axes:i,dataModel:n,processedData:r}=this,o=i[bm.X],a=i[bm.Y];if(!(e&&n&&r&&t&&o&&a))return;if("category"!==o.type||"category"!==a.type)return void s.Vy.warnOnce(`Heatmap series expected axes to have "category" type, but received "${o.type}" and "${a.type}" instead.`);const{xKey:l,xName:c,yKey:h,yName:u,colorKey:d,colorName:p,textAlign:g,verticalAlign:f,itemPadding:m,label:y}=this.properties,v=n.resolveColumnById(this,"xValue",r),b=n.resolveColumnById(this,"yValue",r),C=d?n.resolveColumnById(this,"colorValue",r):void 0,w=o.scale,S=a.scale,x=(w.bandwidth??0)/2,E=(S.bandwidth??0)/2,A=[],M=[],T=w.bandwidth??10,D=S.bandwidth??10,I=(T-2*m)*Dm[g],R=(D-2*m)*Im[f],k=()=>({width:T,height:D,meta:null});return(r.dataSources.get(this.id)??[]).forEach((e,t)=>{const i=v[t],n=b[t],s=w.convert(i)+x,r=S.convert(n)+E,o=C?.[t],a=rm(null==o?void 0:this.getLabelText(y,{value:o,datum:e,colorKey:d,colorName:p,xKey:l,yKey:h,xName:c,yName:u}),this.properties.label,void 0,this.properties.label,{padding:m},k),P={x:s,y:r,size:0};if(A.push({series:this,itemId:h,datumIndex:t,yKey:h,xKey:l,xValue:i,yValue:n,colorValue:o,datum:e,point:P,width:T,height:D,midPoint:{x:s,y:r},missing:null!=C&&null==o}),null!=a?.label){const{text:i,fontSize:n,lineHeight:s,height:r}=a.label,{fontStyle:o,fontFamily:l,fontWeight:c,color:u}=this.properties.label,d=P.x+I*(T-2*m),p=P.y+R*(D-2*m)-.5*(a.height-r);M.push({series:this,itemId:h,datum:e,datumIndex:t,text:i,fontSize:n,lineHeight:s,fontStyle:o,fontFamily:l,fontWeight:c,color:u,textAlign:g,verticalAlign:f,x:d,y:p})}}),{itemId:this.properties.yKey??this.id,nodeData:A,labelData:M,scales:this.calculateScaling(),visible:this.visible}}nodeFactory(){return new Em}update(e){return this.ctx.animationManager.skipCurrentBatch(),super.update(e)}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,n=t??[];return i.update(n)}getItemBaseStyle(e){const{properties:t}=this,i=e?t.highlightStyle.item:void 0;return{fill:i?.fill,fillOpacity:i?.fillOpacity??1,stroke:i?.stroke??t.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(t.strokeWidth),strokeOpacity:i?.strokeOpacity??t.strokeOpacity}}getItemStyleOverrides(e,t,i,n,s){const{id:r,properties:o}=this,{xKey:a,yKey:l,itemStyler:c}=o,h=this.isColorScaleValid()&&null!=i?this.colorScale.convert(i):"transparent";let u=null==n.fill?{fill:h}:void 0;if(null!=c){u??(u={});const i=this.cachedDatumCallback(Sm(e,s?"highlight":"node"),()=>this.callWithContext(c,{seriesId:r,datum:t,xKey:a,yKey:l,highlighted:s,...n,fill:h}));Object.assign(u,i)}return u}updateDatumNodes(e){const{isHighlight:t}=e,i=this.axes[bm.X],[n,s]=i?.visibleRange??[],r=!(0!==n||1!==s),o=this.getItemBaseStyle(t);e.datumSelection.each((e,i)=>{const{datumIndex:n,colorValue:s,datum:a,point:l,width:c,height:h}=i,u=this.getItemStyleOverrides(String(n),a,s,o,t);e.crisp=r,e.x=Math.floor(l.x-c/2),e.y=Math.floor(l.y-h/2),e.width=Math.ceil(c),e.height=Math.ceil(h),Mm(e,o,u)})}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e,{enabled:n}=this.properties.label,s=n?t:[];return i.update(s)}updateLabelNodes(e){e.labelSelection.each((e,t)=>{e.text=t.text,e.fontSize=t.fontSize,e.lineHeight=t.lineHeight,e.fontStyle=t.fontStyle,e.fontFamily=t.fontFamily,e.fontWeight=t.fontWeight,e.fill=t.color,e.textAlign=t.textAlign,e.textBaseline=t.verticalAlign,e.x=t.x,e.y=t.y,e.pointerEvents=Am.None})}getTooltipContent(e){const{id:t,dataModel:i,processedData:n,axes:s,properties:r,colorScale:o}=this,{xKey:a,xName:l,yKey:c,yName:h,colorKey:u,colorName:d,colorRange:p,title:g,legendItemName:f,tooltip:m}=r,y=s[bm.X],v=s[bm.Y];if(!(i&&n&&y&&v))return;const b=n.dataSources.get(this.id)?.[e],C=i.resolveColumnById(this,"xValue",n)[e],w=i.resolveColumnById(this,"yValue",n)[e],S=null!=u&&this.isColorScaleValid()?i.resolveColumnById(this,"colorValue",n)[e]:void 0;if(null==C)return;const x=[];let E;null==S?E=p[0]:(E=o.convert(S),x.push({label:d,fallbackLabel:u,value:String(S)})),x.push({label:l,fallbackLabel:a,value:y.formatDatum(C)},{label:h,fallbackLabel:c,value:v.formatDatum(w)});const A=this.getItemBaseStyle(!1);Object.assign(A,this.getItemStyleOverrides(String(e),b,S,A,!1)),null!=A.fill&&(E=A.fill);const M=null!=E?{marker:{shape:"square",fill:E,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0}}:void 0;return this.formatTooltipWithContext(m,{title:g??f,symbol:M,data:x},{seriesId:t,datum:b,title:g,xKey:a,xName:l,yKey:c,yName:h,colorKey:u,colorName:d,...A})}getLegendData(e){return"gradient"===e&&this.isColorScaleValid()&&this.dataModel?[{legendType:"gradient",enabled:this.visible,seriesId:this.id,colorName:this.properties.colorName,colorDomain:this.processedData.domain.values[this.dataModel.resolveProcessedDataIndexById(this,"colorValue")],colorRange:this.properties.colorRange}]:[]}isLabelEnabled(){return this.properties.label.enabled&&Boolean(this.properties.colorKey)}getBandScalePadding(){return{inner:0,outer:0}}computeFocusBounds({datumIndex:e}){const t=this.contextNodeData?.nodeData[e];if(void 0===t)return;const{width:i,height:n,midPoint:s}=t,r={x:s.x-i/2,y:s.y-n/2,width:i,height:n};return mm(this,r)}};Rm.className="HeatmapSeries",Rm.type="heatmap";var{commonSeriesOptionsDefs:km,heatmapSeriesThemeableOptionsDef:Pm}=n.n1,_m={...Pm,...km,type:(0,s.mw)((0,s.dY)("heatmap")),xKey:(0,s.mw)(s.Yj),yKey:(0,s.mw)(s.Yj),colorKey:s.Yj,xName:s.Yj,yName:s.Yj,colorName:s.Yj,colorRange:(0,s.jk)(s.yW)},Lm={series:{stroke:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$ref:"backgroundColor"},{$path:["./0",{$palette:"stroke"},{$palette:"strokes"}]}]},colorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"divergingColors"},n.n1.SAFE_RANGE2_OPERATION]},label:{enabled:!1,color:{$ref:"textColor"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},wrapping:"on-space",overflowStrategy:"ellipsis"},itemPadding:3},gradientLegend:{enabled:!0}},{ThemeConstants:{CARTESIAN_AXIS_TYPE:Nm,CARTESIAN_POSITION:Om}}=n.n1,Fm={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"heatmap",moduleFactory:e=>new Rm(e),tooltipDefaults:{range:"exact"},defaultAxes:[{type:Nm.CATEGORY,position:Om.LEFT},{type:Nm.CATEGORY,position:Om.BOTTOM}],themeTemplate:Lm},Gm={type:"series",name:"heatmap",chartType:"cartesian",enterprise:!0,options:_m,create:e=>new Rm(e)},{createDatumId:Bm}=n.n1,Vm=class extends rf{constructor(){super(...arguments),this.properties=new xf}nodeFactory(){return new hf}updateDatumNodes({datumSelection:e,isHighlight:t}){const{id:i,properties:n}=this,{xKey:s,highKey:r,lowKey:o,openKey:a,closeKey:l,item:c,itemStyler:h}=n,{up:u,down:d}=c,{stroke:p,strokeWidth:g,strokeOpacity:f,lineDash:m,lineDashOffset:y}=u,{stroke:v,strokeWidth:b,strokeOpacity:C,lineDash:w,lineDashOffset:S}=d,x=t?n.highlightStyle.item:void 0;e.each((e,n)=>{const{isRising:c,centerX:E,width:A,y:M,height:T,yOpen:D,yClose:I,crisp:R}=n;let k;if(null!=h){const{stroke:e,strokeWidth:p,strokeOpacity:g,lineDash:f,lineDashOffset:m}=c?u:d;k=this.cachedDatumCallback(Bm(this.getDatumId(n),t?"highlight":"node"),()=>this.callWithContext(h,{seriesId:i,itemId:n.itemId,xKey:s,highKey:r,lowKey:o,openKey:a,closeKey:l,datum:n.datum,strokeOpacity:g,stroke:e,strokeWidth:p,lineDash:f,lineDashOffset:m,highlighted:t}))}e.centerX=E,e.width=A,e.y=M,e.height=T,e.yOpen=D,e.yClose=I,e.crisp=R,e.stroke=x?.stroke??k?.stroke??(c?p:v),e.strokeWidth=x?.strokeWidth??k?.strokeWidth??(c?g:b),e.strokeOpacity=x?.strokeOpacity??k?.strokeOpacity??(c?f:C),e.lineDash=x?.lineDash??k?.lineDash??(c?m:w),e.lineDashOffset=x?.lineDashOffset??k?.lineDashOffset??(c?y:S),e.strokeAlignment=(k?.strokeWidth??(c?g:b))/2})}getLegendData(e){const{id:t,data:i,ctx:{legendManager:n},visible:s}=this,{xKey:r,yName:o,item:{up:a,down:l},showInLegend:c,legendItemName:h}=this.properties;if(!i?.length||!r||"category"!==e)return[];const u={type:"gradient",gradient:"linear",colorSpace:"rgb",colorStops:[{color:a.stroke,stop:0},{color:a.stroke,stop:.5},{color:l.stroke,stop:.5}],rotation:90};return[{legendType:"category",id:t,itemId:t,seriesId:t,enabled:s&&n.getItemEnabled({seriesId:t,itemId:t}),label:{text:h??o??t},symbol:{marker:{fill:u,fillOpacity:a.strokeOpacity,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0}},legendItemName:h,hideInLegend:!c}]}};Vm.className="ohlc",Vm.type="ohlc";var{commonSeriesOptionsDefs:Hm,ohlcSeriesThemeableOptionsDef:Um}=n.n1,zm={...Um,...Hm,type:(0,s.mw)((0,s.dY)("ohlc")),xKey:(0,s.mw)(s.Yj),openKey:(0,s.mw)(s.Yj),highKey:(0,s.mw)(s.Yj),lowKey:(0,s.mw)(s.Yj),closeKey:(0,s.mw)(s.Yj),xName:s.Yj,yName:s.Yj,openName:s.Yj,highName:s.Yj,lowName:s.Yj,closeName:s.Yj};zm.pickOutsideVisibleMinorAxis=(0,s._L)(s.zM),zm.focusPriority=(0,s._L)(s.ai);var{CARTESIAN_AXIS_TYPE:Wm,CARTESIAN_POSITION:jm}=n.n1.ThemeConstants,$m={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"ohlc",moduleFactory:e=>new Vm(e),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:Wm.NUMBER,position:jm.LEFT},{type:Wm.ORDINAL_TIME,position:jm.BOTTOM}],themeTemplate:{animation:{enabled:!1},series:{item:{up:{stroke:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$palette:"stroke"},{$palette:"up.stroke"}]}},down:{stroke:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$palette:"stroke"},{$palette:"down.stroke"}]}}}},axes:{[Wm.NUMBER]:{crosshair:{snap:!1}},[Wm.ORDINAL_TIME]:{groupPaddingInner:0,crosshair:{enabled:!0}}}},groupable:!1},Km={type:"series",name:"ohlc",chartType:"cartesian",enterprise:!0,options:zm,create:e=>new Vm(e)};function Ym(e,t,i,n,s,r){const o=e[r];return null!=o&&r===n[Bg(Gg(o,t,i),s)+3]}function qm(e,t,i,n,s,r){const o=e[r];return null!=o&&r===n[Bg(Gg(o,t,i),s)+2]}var{CartesianSeriesProperties:Xm,FillGradientDefaults:Zm,FillPatternDefaults:Qm,FillImageDefaults:Jm,InterpolationProperties:ey,SeriesMarker:ty,SeriesTooltip:iy,Property:ny,DropShadow:sy,Label:ry}=n.n1,oy=class extends ry{constructor(){super(...arguments),this.placement="outside",this.padding=6}};a([ny],oy.prototype,"placement",2),a([ny],oy.prototype,"padding",2);var ay=class extends Xm{constructor(){super(...arguments),this.fill="#99CCFF",this.fillGradientDefaults=new Zm,this.fillPatternDefaults=new Qm,this.fillImageDefaults=new Jm,this.fillOpacity=1,this.stroke="#99CCFF",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new ey,this.shadow=(new sy).set({enabled:!1}),this.marker=new ty,this.label=new oy,this.tooltip=new iy,this.connectMissingData=!1}};a([ny],ay.prototype,"xKey",2),a([ny],ay.prototype,"yLowKey",2),a([ny],ay.prototype,"yHighKey",2),a([ny],ay.prototype,"xName",2),a([ny],ay.prototype,"yName",2),a([ny],ay.prototype,"yLowName",2),a([ny],ay.prototype,"yHighName",2),a([ny],ay.prototype,"fill",2),a([ny],ay.prototype,"fillGradientDefaults",2),a([ny],ay.prototype,"fillPatternDefaults",2),a([ny],ay.prototype,"fillImageDefaults",2),a([ny],ay.prototype,"fillOpacity",2),a([ny],ay.prototype,"stroke",2),a([ny],ay.prototype,"strokeWidth",2),a([ny],ay.prototype,"strokeOpacity",2),a([ny],ay.prototype,"lineDash",2),a([ny],ay.prototype,"lineDashOffset",2),a([ny],ay.prototype,"interpolation",2),a([ny],ay.prototype,"shadow",2),a([ny],ay.prototype,"marker",2),a([ny],ay.prototype,"label",2),a([ny],ay.prototype,"tooltip",2),a([ny],ay.prototype,"connectMissingData",2);var{CollapseMode:ly,isScaleValid:cy,pairUpSpans:hy,prepareAreaFillAnimationFns:uy,plotInterpolatedLinePathStroke:dy,prepareLinePathPropertyAnimation:py,areScalingEqual:gy}=n.n1;var{valueProperty:fy,keyProperty:my,ChartAxisDirection:yy,mergeDefaults:vy,updateLabelNode:by,fixNumericExtent:Cy,buildResetPathFn:wy,resetLabelFn:Sy,resetMarkerFn:xy,resetMarkerPositionFn:Ey,pathSwipeInAnimation:Ay,resetMotion:My,markerSwipeScaleInAnimation:Ty,seriesLabelFadeInAnimation:Dy,animationValidation:Iy,diff:Ry,updateClipPath:ky,computeMarkerFocusBounds:Py,plotAreaPathFill:_y,plotLinePathStroke:Ly,interpolatePoints:Ny,pathFadeInAnimation:Oy,markerFadeInAnimation:Fy,fromToMotion:Gy,pathMotion:By,extent:Vy,createDatumId:Hy,applyShapeFillBBox:Uy,PointerEvents:zy,Group:Wy,BBox:jy,ContinuousScale:$y,DiscreteTimeScale:Ky,findMinMax:Yy,getShapeStyle:qy,getShapeFill:Xy,applyShapeStyle:Zy}=n.n1,Qy=class extends n.n1.SeriesNodeEvent{constructor(e,t,i,n){super(e,t,i,n),this.xKey=n.properties.xKey,this.yLowKey=n.properties.yLowKey,this.yHighKey=n.properties.yHighKey}},Jy=class extends n.n1.CartesianSeries{constructor(e){super({moduleCtx:e,hasMarkers:!0,pathsPerSeries:["fill","stroke"],pickModes:[n.n1.SeriesNodePickMode.AXIS_ALIGNED],directionKeys:{[yy.X]:["xKey"],[yy.Y]:["yLowKey","yHighKey"]},directionNames:{[yy.X]:["xName"],[yy.Y]:["yLowName","yHighName","yName"]},categoryKey:"xValue",animationResetFns:{path:wy({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:Sy,marker:(e,t)=>({...xy(e),...Ey(e,t)})},clipFocusBox:!1}),this.properties=new ay,this.NodeEvent=Qy,this.dataAggregationFilters=void 0}async processData(e){const{xKey:t,yLowKey:i,yHighKey:n}=this.properties,s=this.axes[yy.X]?.scale,r=this.axes[yy.Y]?.scale,{xScaleType:o,yScaleType:a}=this.getScaleInformation({xScale:s,yScale:r}),l=[],c=!this.ctx.animationManager.isSkipped();!this.ctx.animationManager.isSkipped()&&this.processedData&&l.push(Ry(this.id,this.processedData)),c&&l.push(Iy());const{dataModel:h,processedData:u}=await this.requestDataModel(e,this.data,{props:[my(t,o,{id:"xValue"}),fy(i,a,{id:"yLowValue"}),fy(n,a,{id:"yHighValue"}),...l]});this.dataAggregationFilters=this.aggregateData(h,u),this.animationState.transition("updateData")}aggregateData(e,t){const i=this.axes[yy.X];if(null==i||!$y.is(i.scale)&&!Ky.is(i.scale))return;const n=e.resolveKeysById(this,"xValue",t),s=e.resolveColumnById(this,"yHighValue",t),r=e.resolveColumnById(this,"yLowValue",t),{index:o}=e.resolveProcessedDataDefById(this,"xValue");return function(e,t,i,n){if(e.length<1e3)return;const[s,r]=Fg(n);let o=Og(e);const{indexData:a,valueData:l}=Vg(e,t,i,s,r,o);let c=[],h=[];for(let t=0;t<e.length;t+=1)Ym(e,s,r,a,o,t)&&c.push(t),qm(e,s,r,a,o,t)&&h.push(t);const u=[{maxRange:o,topIndices:c,bottomIndices:h}];for(;o>64;)({maxRange:o}=Hg(a,l,o,{inPlace:!0})),c=c.filter(Ym.bind(null,e,s,r,a,o)),h=h.filter(qm.bind(null,e,s,r,a,o)),u.push({maxRange:o,topIndices:c,bottomIndices:h});return u.reverse(),u}(n,s,r,t.domain.keys[o])}xCoordinateRange(e){const t=this.axes[yy.X].scale.convert(e);return[t,t]}yCoordinateRange(e){const t=this.axes[yy.Y].scale.convert(e[0]);return[t,t]}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!t||!i)return[];const{domain:{keys:[n]}}=t;if(e===yy.X){const e=i.resolveProcessedDataDefById(this,"xValue");return"key"===e?.def.type&&"category"===e.def.valueType?n:Cy(Vy(n))}{const e=this.domainForClippedRange(yy.Y,["yHighValue","yLowValue"],"xValue",!0),t=Yy(e);return Cy(t)}}getSeriesRange(e,t){return this.domainForVisibleRange(yy.Y,["yHighValue","yLowValue"],"xValue",t,!0)}createNodeData(){const{data:e,dataModel:t,processedData:i,axes:n}=this,s=n[yy.X],r=n[yy.Y];if(!(e&&s&&r&&t&&i))return;const o=s.scale,a=r.scale,{xKey:l,yLowKey:c,yHighKey:h,connectMissingData:u,marker:d,interpolation:p}=this.properties,g=i.dataSources.get(this.id)??[],f=(o.bandwidth??0)/2,m=t.resolveKeysById(this,"xValue",i),y=t.resolveColumnById(this,"yHighValue",i),v=t.resolveColumnById(this,"yLowValue",i),b=[],C=[],w=[],S=(e,t,i)=>{const n=g[e],s=m[e];if(null==s)return;const r=w[w.length-1];if(Number.isFinite(t)&&Number.isFinite(i)){const u=(r,o,a)=>{C.push({index:e,series:this,itemId:r,datum:n,datumIndex:e,midPoint:{x:y,y:a},yHighValue:t,yLowValue:i,xValue:s,xKey:l,yLowKey:c,yHighKey:h,point:{x:y,y:a,size:x},enabled:!0});const u=this.createLabelData({datumIndex:e,point:{x:y,y:a},value:o,yLowValue:i,yHighValue:t,itemId:r,inverted:g,datum:n,series:this});b.push(u)},g=i>t,y=(p=e,o.convert(m[p])+f),v=a.convert(t),S=a.convert(i),{size:x}=d;u("high",t,v),u("low",i,S);const E={high:{point:{x:y,y:v},xDatum:s,yDatum:t},low:{point:{x:y,y:S},xDatum:s,yDatum:i}};Array.isArray(r)?r.push(E):null!=r?(r.skip+=1,w.push([E])):w.push([E])}else u||(Array.isArray(r)||null==r?w.push({skip:0}):r.skip+=1);var p},{dataAggregationFilters:x}=this,[E,A]=o.range,M=A-E,T=x?.find(e=>e.maxRange>M),D=T?.topIndices,I=T?.bottomIndices;let[R,k]=this.visibleRange("xValue",s.range,D);R=Math.max(R-1,0),k=Math.min(k+1,D?.length??m.length),i.input.count<1e3&&(R=0,k=i.input.count);for(let e=R;e<k;e+=1){const t=D?.[e]??e,i=I?.[e]??e;S(t,y[t],v[i])}const P=w.flatMap(e=>{if(!Array.isArray(e))return[];const t=e.map(e=>e.high);return Ny(t,p)}),_=w.flatMap(e=>{if(!Array.isArray(e))return[];const t=e.map(e=>e.low);return Ny(t,p)});return{itemId:`${c}-${h}`,labelData:b,nodeData:C,fillData:{itemId:"high",spans:P,phantomSpans:_},highStrokeData:{itemId:"high",spans:P},lowStrokeData:{itemId:"low",spans:_},scales:this.calculateScaling(),visible:this.visible}}createLabelData({datumIndex:e,point:t,value:i,itemId:n,inverted:s,datum:r,series:o}){const{xKey:a,yLowKey:l,yHighKey:c,xName:h,yName:u,yLowName:d,yHighName:p,label:g}=this.properties,{placement:f,padding:m=10}=g;let y=n;s&&(y="low"===n?"high":"low");const v="outside"===f&&"high"===y||"inside"===f&&"low"===y?-1:1;return{x:t.x,y:t.y+m*v,series:o,itemId:n,datum:r,datumIndex:e,text:this.getLabelText(g,{value:i,datum:r,itemId:n,xKey:a,yLowKey:l,yHighKey:c,xName:h,yLowName:d,yHighName:p,yName:u}),textAlign:"center",textBaseline:-1===v?"bottom":"top"}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(e){const{opacity:t,visible:i}=e,[n,s]=e.paths,r=this.getStrokeWidth(this.properties.strokeWidth);s.setProperties({fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:zy.None,stroke:this.properties.stroke,strokeWidth:r,strokeOpacity:this.properties.strokeOpacity,lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset,opacity:t,visible:i});const o=Xy(this.properties.fill,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults),a=this.getShapeFillBBox();Uy(n,o,a),Zy(n,{stroke:void 0,fill:o,fillOpacity:this.properties.fillOpacity,lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset,strokeOpacity:this.properties.strokeOpacity,strokeWidth:r},void 0,a),n.setProperties({pointerEvents:zy.None,lineJoin:"round",fillShadow:this.properties.shadow,opacity:t,visible:i}),ky(this,s),ky(this,n)}updatePaths(e){this.updateAreaPaths(e.paths,e.contextData)}updateAreaPaths(e,t){for(const i of e)i.visible=t.visible;if(t.visible)this.updateFillPath(e,t),this.updateStrokePath(e,t);else for(const t of e)t.path.clear(),t.markDirty("RangeArea")}updateFillPath(e,t){const[i]=e;i.path.clear(),_y(i,t.fillData),i.markDirty("RangeArea")}updateStrokePath(e,t){const[,i]=e;i.path.clear(),Ly(i,t.highStrokeData.spans),Ly(i,t.lowStrokeData.spans),i.markDirty("RangeArea")}updateMarkerSelection(e){const{nodeData:t,markerSelection:i}=e;return this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(this.properties.marker.enabled?t:[])}getMarkerItemBaseStyle(e){const{properties:t}=this,{marker:i}=t,n=e?t.highlightStyle.item:void 0;return{shape:i.shape,size:i.size,fill:n?.fill??i.fill,fillOpacity:n?.fillOpacity??i.fillOpacity,stroke:n?.stroke??i.stroke,strokeWidth:n?.strokeWidth??this.getStrokeWidth(i.strokeWidth),strokeOpacity:n?.strokeOpacity??i.strokeOpacity,lineDash:n?.lineDash??i.lineDash,lineDashOffset:n?.lineDashOffset??i.lineDashOffset}}getMarkerItemStyleOverrides(e,t,i,n){const{id:s,properties:r}=this,{xKey:o,yHighKey:a,yLowKey:l,marker:c}=r,{itemStyler:h}=c;if(null!=h)return this.cachedDatumCallback(Hy(e,n?"highlight":"node"),()=>this.callWithContext(h,{seriesId:s,datum:t,xKey:o,yHighKey:a,yLowKey:l,highlighted:n,...i}))}updateMarkerNodes(e){const{markerSelection:t,isHighlight:i}=e,{xKey:n,yLowKey:s,yHighKey:r,marker:o,fill:a,stroke:l,strokeWidth:c,fillOpacity:h,strokeOpacity:u}=this.properties,d=vy(i&&this.properties.highlightStyle.item,o.getStyle(),{fill:a,fillOpacity:h,stroke:l,strokeWidth:c,strokeOpacity:u}),p=this.getShapeFillBBox();t.each((e,t)=>{this.updateMarkerStyle(o,e,t.datum,t.point,{xKey:n,yHighKey:r,yLowKey:s},i,d,p)}),i||this.properties.marker.markClean()}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t,e=>{e.pointerEvents=zy.None})}updateLabelNodes(e){e.labelSelection.each((e,t)=>{by(e,this.properties.label,t)})}getHighlightLabelData(e,t){const i=e.filter(e=>e.datum===t.datum);return i.length>0?i:void 0}getHighlightData(e,t){const i=e.filter(e=>e.datum===t.datum);return i.length>0?i:void 0}getTooltipContent(e,t){const{id:i,dataModel:n,processedData:s,axes:r,properties:o}=this,{xName:a,yName:l,yLowKey:c,yLowName:h,xKey:u,yHighKey:d,yHighName:p,tooltip:g}=o,f=r[yy.X],m=r[yy.Y];if(!(n&&s&&f&&m))return;const y=s.dataSources.get(this.id)?.[e],v=n.resolveKeysById(this,"xValue",s)[e],b=n.resolveColumnById(this,"yHighValue",s)[e],C=n.resolveColumnById(this,"yLowValue",s)[e];if(null==v)return;const w=this.getMarkerItemBaseStyle(!1);Object.assign(w,this.getMarkerItemStyleOverrides(String(e),e,w,!1));const S=`${m.formatDatum(C)} - ${m.formatDatum(b)}`;return this.formatTooltipWithContext(g,{heading:f.formatDatum(v),symbol:this.legendItemSymbol(),data:[{label:l,fallbackLabel:`${h??c} - ${p??d}`,value:S}]},{seriesId:i,datum:y,title:l,itemId:t?.itemId??"unknown",xName:a,yName:l,yLowKey:c,yLowName:h,xKey:u,yHighKey:d,yHighName:p,...w})}legendItemSymbol(){const{fill:e,stroke:t,strokeWidth:i,strokeOpacity:n,lineDash:s,marker:r}=this.properties;return{marker:qy({shape:r.shape,fill:r.fill??e,stroke:r.stroke??t,fillOpacity:r.fillOpacity,strokeOpacity:r.strokeOpacity,strokeWidth:r.strokeWidth,lineDash:r.lineDash,lineDashOffset:r.lineDashOffset},r.fillGradientDefaults,r.fillPatternDefaults,r.fillImageDefaults),line:{stroke:t,strokeOpacity:n,strokeWidth:i,lineDash:s}}}getLegendData(e){if("category"!==e)return[];const{id:t,visible:i}=this,{yLowKey:n,yHighKey:s,yName:r,yLowName:o,yHighName:a,showInLegend:l}=this.properties;return[{legendType:"category",id:t,itemId:`${n}-${s}`,seriesId:t,enabled:i,label:{text:`${r??`${o??n} - ${a??s}`}`},symbol:this.legendItemSymbol(),hideInLegend:!l}]}isLabelEnabled(){return this.properties.label.enabled}onDataChange(){}nodeFactory(){return new Wy}animateEmptyUpdateReady(e){const{markerSelection:t,labelSelection:i,contextData:n,paths:s}=e,{animationManager:r}=this.ctx;this.updateAreaPaths(s,n),Ay(this,r,...s),My([t],Ey),Ty(this,r,t),Dy(this,"labels",r,i)}animateReadyResize(e){const{contextData:t,paths:i}=e;this.updateAreaPaths(i,t),super.animateReadyResize(e)}animateWaitingUpdateReady(e){const{animationManager:t}=this.ctx,{markerSelection:i,labelSelection:n,contextData:s,paths:r,previousContextData:o}=e,[a,l]=r;if(null==a&&null==l)return;this.resetMarkerAnimation(e),this.resetLabelAnimation(e);const c=()=>{this.resetPathAnimation(e),this.updateAreaPaths(r,s)};if(null==s||null==o)return c(),Fy(this,t,"added",i),Oy(this,"fill_path_properties",t,"add",a),Oy(this,"stroke_path_properties",t,"add",l),void Dy(this,"labels",t,n);const h=function(e,t,i){if("category"===e.scales.x?.type!=("category"===t.scales.x?.type)||!cy(e.scales.x)||!cy(t.scales.x))return;let n="updated";t.visible&&!e.visible?n="removed":!t.visible&&e.visible&&(n="added");const s=hy({scales:e.scales,data:e.fillData.spans},{scales:t.scales,data:t.fillData.spans},ly.Split);if(null==s)return;const r=hy({scales:e.scales,data:e.fillData.phantomSpans},{scales:t.scales,data:t.fillData.phantomSpans},ly.Split);if(null==r)return;const o=hy({scales:e.scales,data:e.highStrokeData.spans},{scales:t.scales,data:t.highStrokeData.spans},ly.Split);if(null==o)return;const a=hy({scales:e.scales,data:e.lowStrokeData.spans},{scales:t.scales,data:t.lowStrokeData.spans},ly.Split);if(null==a)return;const l="fade",c=uy(n,s,r,l),h=function(e,t,i,n){return{status:e,path:{addPhaseFn:(e,n)=>{dy(e,n,t.added),dy(e,n,i.added)},updatePhaseFn:(e,n)=>{dy(e,n,t.moved),dy(e,n,i.moved)},removePhaseFn:(e,n)=>{dy(e,n,t.removed),dy(e,n,i.removed)}},pathProperties:py(e,n)}}(n,o,a,l);return{status:n,fill:c,stroke:h,hasMotion:(i?.changed??!0)||!gy(e.scales.x,t.scales.x)||!gy(e.scales.y,t.scales.y)||"updated"!==n}}(s,o,this.processedData?.reduced?.diff?.[this.id]);if(void 0===h)return t.skipCurrentBatch(),void c();"no-op"!==h.status&&(Gy(this.id,"fill_path_properties",t,[a],h.fill.pathProperties),Gy(this.id,"stroke_path_properties",t,[l],h.stroke.pathProperties),"added"===h.status?this.updateAreaPaths(r,s):"removed"===h.status?this.updateAreaPaths(r,o):(By(this.id,"fill_path_update",t,[a],h.fill.path),By(this.id,"stroke_path_update",t,[l],h.stroke.path)),h.hasMotion&&(Fy(this,t,void 0,i),Dy(this,"labels",t,n)),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateAreaPaths(r,s)}))}getFormattedMarkerStyle(e){const{xKey:t,yLowKey:i,yHighKey:n}=this.properties;return this.getMarkerStyle(this.properties.marker,e.datum,{xKey:t,yLowKey:i,yHighKey:n},!0)}computeFocusBounds(e){const t=Py(this,e),i=Py(this,{...e,datumIndex:e.datumIndex+1});if(t&&i)return jy.merge([t,i])}isDatumEnabled(e,t){return t%2==0&&super.isDatumEnabled(e,t)}};Jy.className="RangeAreaSeries",Jy.type="range-area";var{commonSeriesOptionsDefs:ev,rangeAreaSeriesThemeableOptionsDef:tv}=n.n1,iv={...tv,...ev,type:(0,s.mw)((0,s.dY)("range-area")),xKey:(0,s.mw)(s.Yj),yLowKey:(0,s.mw)(s.Yj),yHighKey:(0,s.mw)(s.Yj),xName:s.Yj,yName:s.Yj,yLowName:s.Yj,yHighName:s.Yj};iv.pickOutsideVisibleMinorAxis=(0,s._L)(s.zM),iv.focusPriority=(0,s._L)(s.ai);var nv={series:{fill:{$palette:"fill"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:n.n1.FILL_PATTERN_DEFAULTS,stroke:{$palette:"stroke"},fillOpacity:.7,nodeClickRange:"nearest",marker:{enabled:!1,fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:n.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:n.n1.FILL_IMAGE_DEFAULTS,size:6,strokeWidth:2},label:{enabled:!1,placement:"outside",padding:10,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},interpolation:{type:"linear"}},axes:{[n.n1.ThemeConstants.CARTESIAN_AXIS_TYPE.NUMBER]:{crosshair:{enabled:!0}}}},{ThemeConstants:{CARTESIAN_AXIS_TYPE:sv,CARTESIAN_POSITION:rv}}=n.n1,ov={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"range-area",moduleFactory:e=>new Jy(e),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:sv.NUMBER,position:rv.LEFT},{type:sv.CATEGORY,position:rv.BOTTOM}],themeTemplate:nv},av={type:"series",name:"range-area",chartType:"cartesian",enterprise:!0,options:iv,create:e=>new Jy(e)},{AbstractBarSeriesProperties:lv,FillGradientDefaults:cv,FillPatternDefaults:hv,FillImageDefaults:uv,SeriesTooltip:dv,Property:pv,DropShadow:gv,Label:fv}=n.n1,mv=class extends fv{constructor(){super(...arguments),this.placement="inside",this.padding=6}};a([pv],mv.prototype,"placement",2),a([pv],mv.prototype,"padding",2);var yv=class extends lv{constructor(){super(...arguments),this.fill="#99CCFF",this.fillGradientDefaults=new cv,this.fillPatternDefaults=new hv,this.fillImageDefaults=new uv,this.fillOpacity=1,this.stroke="#99CCFF",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.shadow=(new gv).set({enabled:!1}),this.label=new mv,this.tooltip=new dv,this.fastDataProcessing=!1}};a([pv],yv.prototype,"xKey",2),a([pv],yv.prototype,"yLowKey",2),a([pv],yv.prototype,"yHighKey",2),a([pv],yv.prototype,"xName",2),a([pv],yv.prototype,"yName",2),a([pv],yv.prototype,"yLowName",2),a([pv],yv.prototype,"yHighName",2),a([pv],yv.prototype,"fill",2),a([pv],yv.prototype,"fillGradientDefaults",2),a([pv],yv.prototype,"fillPatternDefaults",2),a([pv],yv.prototype,"fillImageDefaults",2),a([pv],yv.prototype,"fillOpacity",2),a([pv],yv.prototype,"stroke",2),a([pv],yv.prototype,"strokeWidth",2),a([pv],yv.prototype,"strokeOpacity",2),a([pv],yv.prototype,"lineDash",2),a([pv],yv.prototype,"lineDashOffset",2),a([pv],yv.prototype,"cornerRadius",2),a([pv],yv.prototype,"itemStyler",2),a([pv],yv.prototype,"shadow",2),a([pv],yv.prototype,"label",2),a([pv],yv.prototype,"tooltip",2),a([pv],yv.prototype,"fastDataProcessing",2);var{SeriesNodePickMode:vv,valueProperty:bv,keyProperty:Cv,ChartAxisDirection:wv,checkCrisp:Sv,updateLabelNode:xv,SMALLEST_KEY_INTERVAL:Ev,LARGEST_KEY_INTERVAL:Av,diff:Mv,prepareBarAnimationFunctions:Tv,midpointStartingBarPosition:Dv,resetBarSelectionsFn:Iv,fixNumericExtent:Rv,seriesLabelFadeInAnimation:kv,resetLabelFn:Pv,animationValidation:_v,computeBarFocusBounds:Lv,visibleRangeIndices:Nv,createDatumId:Ov,ContinuousScale:Fv,DiscreteTimeScale:Gv,Rect:Bv,PointerEvents:Vv,motion:Hv,applyShapeStyle:Uv,findMinMax:zv,getShapeStyle:Wv,areScalingEqual:jv}=n.n1,$v=class extends n.n1.SeriesNodeEvent{constructor(e,t,i,n){super(e,t,i,n),this.xKey=n.properties.xKey,this.yLowKey=n.properties.yLowKey,this.yHighKey=n.properties.yHighKey}},Kv=class extends n.n1.AbstractBarSeries{constructor(e){super({moduleCtx:e,pickModes:[vv.AXIS_ALIGNED,vv.EXACT_SHAPE_MATCH],hasHighlightedLabels:!0,directionKeys:{x:["xKey"],y:["yLowKey","yHighKey"]},directionNames:{x:["xName"],y:["yLowName","yHighName","yName"]},categoryKey:"xValue",datumSelectionGarbageCollection:!1,animationResetFns:{datum:Iv,label:Pv}}),this.properties=new yv,this.dataAggregationFilters=void 0,this.NodeEvent=$v}async processData(e){const{xKey:t,yLowKey:i,yHighKey:n,fastDataProcessing:s}=this.properties,r=!s,o=this.getCategoryAxis()?.scale,a=this.getValueAxis()?.scale,{isContinuousX:l,xScaleType:c,yScaleType:h}=this.getScaleInformation({xScale:o,yScale:a}),u=[];this.ctx.animationManager.isSkipped()||(this.processedData&&u.push(Mv(this.id,this.processedData)),u.push(_v()));const d=this.visible?{}:{forceValue:0},{dataModel:p,processedData:g}=await this.requestDataModel(e,this.data,{props:[Cv(t,c,{id:"xValue"}),bv(i,h,{id:"yLowValue",invalidValue:null,...d}),bv(n,h,{id:"yHighValue",invalidValue:null,...d}),...l?[Ev,Av]:[],...u],groupByKeys:r});this.smallestDataInterval=g.reduced?.smallestKeyInterval,this.largestDataInterval=g.reduced?.largestKeyInterval,this.dataAggregationFilters=this.aggregateData(p,g),this.animationState.transition("updateData")}aggregateData(e,t){if("grouped"!==t.type)return;const i=this.axes[wv.X];if(null==i||!Fv.is(i.scale)&&!Gv.is(i.scale))return;const n=e.resolveKeysById(this,"xValue",t),s=e.resolveColumnById(this,"yHighValue",t),r=e.resolveColumnById(this,"yLowValue",t),{index:o}=e.resolveProcessedDataDefById(this,"xValue");return function(e,t,i,n){if(e.length<1e3)return;const[s,r]=Fg(n);let o=Og(e,5),{indexData:a,valueData:l}=Vg(e,t,i,s,r,o);const c=[{maxRange:o,indexData:a}];for(;o>64;)({indexData:a,valueData:l,maxRange:o}=Hg(a,l,o)),c.push({maxRange:o,indexData:a});return c.reverse(),c}(n,s,r,t.domain.keys[o])}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!t||!i)return[];const{keys:[n]}=t.domain;if(e===this.getCategoryDirection()){const e=i.resolveProcessedDataDefById(this,"xValue");return"key"===e?.def.type&&"category"===e?.def.valueType?n:this.padBandExtent(n)}{const t=this.domainForClippedRange(e,["yHighValue","yLowValue"],"xValue",!0),i=zv(t);return Rv(i)}}getSeriesRange(e,t){return this.domainForVisibleRange(wv.Y,["yHighValue","yLowValue"],"xValue",t,!0)}createNodeData(){const{data:e,dataModel:t,groupScale:i,processedData:n,visible:s}=this,r=this.getCategoryAxis(),o=this.getValueAxis();if(!(e&&r&&o&&t&&n?.dataSources))return;const a=r.scale,l=o.scale,c=this.getBarDirection()===wv.X,{xKey:h,yLowKey:u,yHighKey:d,strokeWidth:p}=this.properties,g=`${u}-${d}`,f={itemId:g,nodeData:[],labelData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.groupScale),visible:this.visible};if(!s)return f;const m=n.dataSources.get(this.id)??[],y=t.resolveKeysById(this,"xValue",n),v=t.resolveColumnById(this,"yLowValue",n),b=t.resolveColumnById(this,"yHighValue",n),{barWidth:C,groupIndex:w}=this.updateGroupScale(r),S=Fv.is(a)?-.5*C:0,x=i.convert(String(w)),E=Sv(r?.scale,r?.visibleRange,this.smallestDataInterval,this.largestDataInterval),A=e=>Math.round(a.convert(y[e]))+x+S,M=(e,t,i,n,s,r,o)=>{const a=m[e],C=y[e];if(null==C)return;const w=v[e],S=b[e];if(!Number.isFinite(w?.valueOf())||!Number.isFinite(S?.valueOf()))return;const[x,E]=w<S?[w,S]:[S,w],A=Math.round(l.convert(r)),M=Math.round(l.convert(s)),T=Math.max(p,Math.abs(M-A)),D={x:c?Math.min(A,M):i,y:c?i:Math.min(A,M),width:c?T:n,height:c?n:T},I={x:D.x+D.width/2,y:D.y+D.height/2},R=this.createLabelData({datumIndex:e,rect:D,barAlongX:c,yLowValue:x,yHighValue:E,datum:a,series:this}),k={index:t,valueIndex:e,series:this,itemId:g,datum:a,datumIndex:e,xValue:C,yLowValue:w,yHighValue:S,yLowKey:u,yHighKey:d,xKey:h,x:D.x,y:D.y,width:D.width,height:D.height,midPoint:I,crisp:o,labels:R};f.nodeData.push(k),f.labelData.push(...R)},{dataAggregationFilters:T}=this,[D,I]=a.range,R=I-D,k=T?.find(e=>e.maxRange>R);if(null!=k){const{maxRange:e,indexData:t}=k,[i,n]=Nv(e,r.range,e=>{const i=4*e,n=t[i+0],s=t[i+1];if(-1!==n)return[A((n+s)/2|0),A(s)+C]});for(let e=i;e<n;e+=1){const i=4*e,n=t[i+0],s=t[i+1],r=t[i+2],o=t[i+3];if(-1===n)continue;const a=(n+s)/2|0;null!=y[a]&&M(a,0,A(a),Math.abs(A(n)-A(s))+C,v[r],b[o],!1)}}else if("ungrouped"===n.type){let[e,t]=Nv(m.length,r.range,e=>[A(e),C]);n.input.count<1e3&&(e=0,t=n.input.count);for(let i=e;i<t;i+=1)M(i,0,A(i),C,v[i],b[i],E)}else for(const{datumIndex:e,groupIndex:i}of t.forEachGroupDatum(this,n))M(e,i,A(e),C,v[e],b[e],E);return f}createLabelData({datumIndex:e,rect:t,barAlongX:i,yLowValue:n,yHighValue:s,datum:r,series:o}){const{xKey:a,yLowKey:l,yHighKey:c,xName:h,yLowName:u,yHighName:d,yName:p,label:g}=this.properties,f={datum:r,xKey:a,yLowKey:l,yHighKey:c,xName:h,yLowName:u,yHighName:d,yName:p},{placement:m,padding:y}=g,v=y*("outside"===m?1:-1),b={datumIndex:e,x:t.x+(i?-v:t.width/2),y:t.y+(i?t.height/2:t.height+v),textAlign:i?"left":"center",textBaseline:i?"middle":"bottom",text:this.getLabelText(g,{itemId:"low",value:n,...f}),itemId:"low",datum:r,series:o},C={datumIndex:e,x:t.x+(i?t.width+v:t.width/2),y:t.y+(i?t.height/2:-v),textAlign:i?"right":"center",textBaseline:i?"middle":"top",text:this.getLabelText(g,{itemId:"high",value:s,...f}),itemId:"high",datum:r,series:o};return"outside"===m&&(b.textAlign=i?"right":"center",b.textBaseline=i?"middle":"top",C.textAlign=i?"left":"center",C.textBaseline=i?"middle":"bottom"),[b,C]}nodeFactory(){return new Bv}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,n=t??[];return i.update(n,void 0,e=>this.getDatumId(e))}getItemBaseStyle(e){const{properties:t}=this,{cornerRadius:i,fillGradientDefaults:n,fillPatternDefaults:s,fillImageDefaults:r}=t,o=e?t.highlightStyle.item:void 0;return Wv({fill:o?.fill??t.fill,fillOpacity:o?.fillOpacity??t.fillOpacity,stroke:o?.stroke??t.stroke,strokeWidth:o?.strokeWidth??this.getStrokeWidth(t.strokeWidth),strokeOpacity:o?.strokeOpacity??t.strokeOpacity,lineDash:o?.lineDash??t.lineDash??[],lineDashOffset:o?.lineDashOffset??t.lineDashOffset,cornerRadius:i},n,s,r)}getItemStyleOverrides(e,t,i,n){const{id:s,properties:r}=this,{xKey:o,yHighKey:a,yLowKey:l,itemStyler:c,fillGradientDefaults:h,fillPatternDefaults:u,fillImageDefaults:d}=r;if(null==c)return;const p=this.cachedDatumCallback(Ov(e,n?"highlight":"node"),()=>this.callWithContext(c,{seriesId:s,datum:t,xKey:o,yHighKey:a,yLowKey:l,highlighted:n,...i}));return Wv(p,h,u,d)}updateDatumNodes(e){const{datumSelection:t,isHighlight:i}=e,n=this.getCategoryDirection()===wv.X,s=this.getItemBaseStyle(i),r=this.getShapeFillBBox();t.each((e,t)=>{const o=this.getItemStyleOverrides(String(t.datumIndex),t.datum,s,i);Uv(e,s,o,r),e.cornerRadius=o?.cornerRadius??s.cornerRadius,e.visible=n?t.width>0:t.height>0,e.crisp=t.crisp})}getHighlightLabelData(e,t){const i=e.filter(e=>e.datum===t.datum);return i.length>0?i:void 0}updateLabelSelection(e){const t=this.properties.label.enabled?e.labelData:[];return e.labelSelection.update(t,e=>{e.pointerEvents=Vv.None})}updateLabelNodes(e){e.labelSelection.each((e,t)=>{xv(e,this.properties.label,t)})}getTooltipContent(e){const{id:t,dataModel:i,processedData:n,properties:s}=this,{xKey:r,xName:o,yName:a,yLowKey:l,yHighKey:c,yLowName:h,yHighName:u,tooltip:d}=s,p=this.getCategoryAxis(),g=this.getValueAxis();if(!(i&&n&&p&&g))return;const f=n.dataSources.get(this.id)?.[e],m=i.resolveKeysById(this,"xValue",n)[e],y=i.resolveColumnById(this,"yHighValue",n)[e],v=i.resolveColumnById(this,"yLowValue",n)[e];if(null==m)return;const b=this.getItemBaseStyle(!1);Object.assign(b,this.getItemStyleOverrides(String(e),f,b,!1));const C=`${g.formatDatum(v)} - ${g.formatDatum(y)}`;return this.formatTooltipWithContext(d,{heading:p.formatDatum(m),symbol:this.legendItemSymbol(),data:[{label:a,fallbackLabel:`${h??l} - ${u??c}`,value:C}]},{seriesId:t,datum:f,title:a,xKey:r,xName:o,yName:a,yLowKey:l,yHighKey:c,yLowName:h,yHighName:u,...b})}legendItemSymbol(){const{fill:e,stroke:t,strokeWidth:i,fillOpacity:n,strokeOpacity:s,lineDash:r,lineDashOffset:o,fillGradientDefaults:a,fillPatternDefaults:l,fillImageDefaults:c}=this.properties;return{marker:Wv({fill:e,stroke:t,fillOpacity:n,strokeOpacity:s,strokeWidth:i,lineDash:r,lineDashOffset:o},a,l,c)}}getLegendData(e){if("category"!==e)return[];const{id:t,visible:i}=this,{yName:n,yLowName:s,yHighName:r,yLowKey:o,yHighKey:a,showInLegend:l}=this.properties;return[{legendType:"category",id:t,itemId:`${o}-${a}`,seriesId:t,enabled:i,label:{text:`${n??`${s??o} - ${r??a}`}`},symbol:this.legendItemSymbol(),hideInLegend:!l}]}animateEmptyUpdateReady({datumSelection:e,labelSelection:t}){const i=Tv(Dv(this.isVertical(),"normal"));Hv.fromToMotion(this.id,"datums",this.ctx.animationManager,[e],i),kv(this,"labels",this.ctx.animationManager,t)}animateWaitingUpdateReady(e){const{datumSelection:t,labelSelection:i,contextData:s,previousContextData:r}=e,o=n.n1.calculateDataDiff(this.id,t,this.getDatumId.bind(this),s,r,this.processedData);this.ctx.animationManager.stopByAnimationGroupId(this.id);const a=null==r?"fade":"normal",l=Tv(Dv(this.isVertical(),a));Hv.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],l,(e,t)=>this.getDatumId(t),o),!o?.changed&&jv(s.groupScale,r?.groupScale)||kv(this,"labels",this.ctx.animationManager,i)}getDatumId(e){return`${e.xValue}-${e.valueIndex}`}isLabelEnabled(){return this.properties.label.enabled}onDataChange(){}computeFocusBounds({datumIndex:e}){return Lv(this,this.contextNodeData?.nodeData[e])}};Kv.className="RangeBarSeries",Kv.type="range-bar";var{commonSeriesOptionsDefs:Yv,rangeBarSeriesThemeableOptionsDef:qv}=n.n1,Xv={...qv,...Yv,type:(0,s.mw)((0,s.dY)("range-bar")),xKey:(0,s.mw)(s.Yj),yLowKey:(0,s.mw)(s.Yj),yHighKey:(0,s.mw)(s.Yj),xName:s.Yj,yName:s.Yj,yLowName:s.Yj,yHighName:s.Yj};Xv.pickOutsideVisibleMinorAxis=(0,s._L)(s.zM),Xv.fastDataProcessing=(0,s._L)(s.zM),Xv.focusPriority=(0,s._L)(s.ai);var Zv={series:{direction:"vertical",fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:n.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:n.n1.FILL_IMAGE_DEFAULTS,strokeWidth:0,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"},placement:"inside"}},axes:{[n.n1.ThemeConstants.CARTESIAN_AXIS_TYPE.NUMBER]:{crosshair:{enabled:!0}}}},Qv={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"range-bar",moduleFactory:e=>new Kv(e),tooltipDefaults:{range:"exact"},defaultAxes:n.n1.DIRECTION_SWAP_AXES,themeTemplate:Zv,groupable:!0},Jv={type:"series",name:"range-bar",chartType:"cartesian",enterprise:!0,options:Xv,create:e=>new Kv(e)},{AbstractBarSeriesProperties:eb,BaseProperties:tb,FillGradientDefaults:ib,FillPatternDefaults:nb,FillImageDefaults:sb,PropertiesArray:rb,SeriesTooltip:ob,Property:ab,DropShadow:lb,Label:cb}=n.n1,hb=class extends tb{};a([ab],hb.prototype,"totalType",2),a([ab],hb.prototype,"index",2),a([ab],hb.prototype,"axisLabel",2);var ub=class extends tb{};a([ab],ub.prototype,"renderer",2);var db=class extends cb{constructor(){super(...arguments),this.placement="outside-end",this.padding=6}};a([ab],db.prototype,"placement",2),a([ab],db.prototype,"padding",2);var pb=class extends tb{constructor(){super(...arguments),this.fill="#c16068",this.fillGradientDefaults=new ib,this.fillPatternDefaults=new nb,this.fillImageDefaults=new sb,this.stroke="#c16068",this.fillOpacity=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.strokeWidth=1,this.cornerRadius=0,this.shadow=(new lb).set({enabled:!1}),this.label=new db,this.tooltip=new ub}};a([ab],pb.prototype,"name",2),a([ab],pb.prototype,"fill",2),a([ab],pb.prototype,"fillGradientDefaults",2),a([ab],pb.prototype,"fillPatternDefaults",2),a([ab],pb.prototype,"fillImageDefaults",2),a([ab],pb.prototype,"stroke",2),a([ab],pb.prototype,"fillOpacity",2),a([ab],pb.prototype,"strokeOpacity",2),a([ab],pb.prototype,"lineDash",2),a([ab],pb.prototype,"lineDashOffset",2),a([ab],pb.prototype,"strokeWidth",2),a([ab],pb.prototype,"cornerRadius",2),a([ab],pb.prototype,"itemStyler",2),a([ab],pb.prototype,"shadow",2),a([ab],pb.prototype,"label",2),a([ab],pb.prototype,"tooltip",2);var gb=class extends tb{constructor(){super(...arguments),this.enabled=!0,this.stroke="black",this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.strokeWidth=2}};a([ab],gb.prototype,"enabled",2),a([ab],gb.prototype,"stroke",2),a([ab],gb.prototype,"strokeOpacity",2),a([ab],gb.prototype,"lineDash",2),a([ab],gb.prototype,"lineDashOffset",2),a([ab],gb.prototype,"strokeWidth",2);var fb=class extends tb{constructor(){super(...arguments),this.positive=new pb,this.negative=new pb,this.total=new pb}};a([ab],fb.prototype,"positive",2),a([ab],fb.prototype,"negative",2),a([ab],fb.prototype,"total",2);var mb=class extends eb{constructor(){super(...arguments),this.item=new fb,this.totals=new rb(hb),this.line=new gb,this.tooltip=new ob}};a([ab],mb.prototype,"xKey",2),a([ab],mb.prototype,"yKey",2),a([ab],mb.prototype,"xName",2),a([ab],mb.prototype,"yName",2),a([ab],mb.prototype,"item",2),a([ab],mb.prototype,"totals",2),a([ab],mb.prototype,"line",2),a([ab],mb.prototype,"tooltip",2);var{adjustLabelPlacement:yb,SeriesNodePickMode:vb,fixNumericExtent:bb,valueProperty:Cb,keyProperty:wb,accumulativeValueProperty:Sb,trailingAccumulatedValueProperty:xb,ChartAxisDirection:Eb,createDatumId:Ab,checkCrisp:Mb,updateLabelNode:Tb,prepareBarAnimationFunctions:Db,collapsedStartingBarPosition:Ib,resetBarSelectionsFn:Rb,seriesLabelFadeInAnimation:kb,resetLabelFn:Pb,animationValidation:_b,DEFAULT_CARTESIAN_DIRECTION_KEYS:Lb,DEFAULT_CARTESIAN_DIRECTION_NAMES:Nb,computeBarFocusBounds:Ob,isContinuous:Fb,Rect:Gb,motion:Bb,applyShapeStyle:Vb,getShapeStyle:Hb}=n.n1,Ub=class extends n.n1.AbstractBarSeries{constructor(e){super({moduleCtx:e,directionKeys:Lb,directionNames:Nb,categoryKey:void 0,pickModes:[vb.NEAREST_NODE,vb.EXACT_SHAPE_MATCH],pathsPerSeries:["connector"],hasHighlightedLabels:!0,pathsZIndexSubOrderOffset:[-1,-1],animationResetFns:{datum:Rb,label:Pb}}),this.properties=new mb,this.seriesItemTypes=new Set(["positive","negative","total"])}async processData(e){const{xKey:t,yKey:i,totals:s}=this.properties,{data:r=[]}=this;if(!this.visible)return;const o={missingValue:void 0,invalidValue:void 0},a=[],l=s.reduce((e,t)=>{const i=e.get(t.index);return i?i.push(t):e.set(t.index,[t]),e},new Map);r.forEach((e,i)=>{a.push(e),l.get(i)?.forEach(e=>a.push({...e.toJson(),[t]:e.axisLabel}))});const c=[];this.ctx.animationManager.isSkipped()||c.push(_b());const h=this.getCategoryAxis()?.scale,u=this.getValueAxis()?.scale,{isContinuousX:d,xScaleType:p,yScaleType:g}=this.getScaleInformation({xScale:h,yScale:u}),{processedData:f}=await this.requestDataModel(e,a,{props:[wb(t,p,{id:"xValue"}),Sb(i,g,{...o,id:"yCurrent"}),Sb(i,g,{...o,missingValue:0,id:"yCurrentTotal"}),Sb(i,g,{...o,id:"yCurrentPositive",validation:e=>Fb(e)&&Number(e)>=0}),Sb(i,g,{...o,id:"yCurrentNegative",validation:e=>Fb(e)&&Number(e)>=0}),xb(i,g,{...o,id:"yPrevious"}),Cb(i,g,{id:"yRaw"}),Cb("totalType","band",{id:"totalTypeValue",missingValue:void 0,validation:e=>"total"===e||"subtotal"===e}),...d?[n.n1.SMALLEST_KEY_INTERVAL,n.n1.LARGEST_KEY_INTERVAL]:[],...c]});this.smallestDataInterval=f.reduced?.smallestKeyInterval,this.largestDataInterval=f.reduced?.largestKeyInterval,this.updateSeriesItemTypes(),this.animationState.transition("updateData")}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!t||!i)return[];const{keys:[n],values:s}=t.domain;if(e===this.getCategoryDirection()){const t=i.resolveProcessedDataDefById(this,"xValue");if("key"===t?.def.type&&"category"===t?.def.valueType)return n;const s=e===Eb.Y,r=this.getCategoryAxis().isReversed();return this.padBandExtent(n,r!==s)}{const e=s[i.resolveProcessedDataIndexById(this,"yCurrent")],t=[Math.min(0,e[0]),Math.max(0,e[1])];return bb(t)}}getSeriesRange(e,t){return[NaN,NaN]}createNodeData(){const{data:e,dataModel:t,processedData:i}=this,n=this.getCategoryAxis(),s=this.getValueAxis();if(!(e&&n&&s&&t&&i))return;const{line:r}=this.properties,o=n.scale,a=s.scale,l=this.getBarDirection()===Eb.X,c=this.getBandwidth(n)??10,h=n.isReversed(),u=s.isReversed();if("ungrouped"!==i.type)return;const d={itemId:this.properties.yKey,nodeData:[],labelData:[],pointData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.groupScale),visible:this.visible};if(!this.visible)return d;const p=[],g=t.resolveKeysById(this,"xValue",i),f=t.resolveColumnById(this,"yRaw",i),m=t.resolveColumnById(this,"totalTypeValue",i),y=t.resolveColumnById(this,"yCurrent",i),v=t.resolveColumnById(this,"yPrevious",i),b=t.resolveColumnById(this,"yCurrentTotal",i),C=Mb(n?.scale,n?.visibleRange,this.smallestDataInterval,this.largestDataInterval);let w=0;const{xKey:S,yKey:x,xName:E,yName:A}=this.properties;(i.dataSources.get(this.id)??[]).forEach((e,t)=>{const i=m[t],n=this.isSubtotal(i),s=this.isTotal(i),M=s||n,T=g[t];if(null==T)return;const D=Math.round(o.convert(T)),I=f[t],{cumulativeValue:R,trailingValue:k}=function(e,t,i){return e||t?{cumulativeValue:b[i],trailingValue:t?w:0}:{cumulativeValue:y[i],trailingValue:v[i]}}(s,n,t);M&&(w=R??0);const P=Math.round(a.convert(R)),_=Math.round(a.convert(k)),L=function(e,t,i,n,s){return e?n:t?(n??0)-(s??0):i}(s,n,I,R,k),N=(L??0)>=0,O=this.getSeriesItemType(N,i),{strokeWidth:F,label:G}=this.getItemConfig(O),B=N?P:_,V=N?_:P,H=Math.max(F,Math.abs(V-B)),U={x:l?Math.min(B,V):D,y:l?D:Math.min(B,V),width:l?H:c,height:l?c:H},z={x:U.x+U.width/2,y:U.y+U.height/2},W=M?P:_,j=Math.floor(r.strokeWidth)%2/2,$=h?P:W,K=h?W:P;let Y,q;l?(Y={x:$+j,y:U.y},q={x:K+j,y:U.y+U.height}):(Y={x:U.x,y:$+j},q={x:U.x+U.width,y:K+j});const X={x:h?q.x:Y.x,y:h?q.y:Y.y,x2:h?Y.x:q.x,y2:h?Y.y:q.y,size:0};p.push(X);const Z="subtotal"===O?"total":O,Q=this.getLabelText(G,{itemId:Z,value:L,datum:e,xKey:S,yKey:x,xName:E,yName:A}),J={index:t,series:this,itemId:O,datum:e,datumIndex:t,cumulativeValue:R??0,xValue:T,yValue:L,yKey:x,xKey:S,x:U.x,y:U.y,width:U.width,height:U.height,midPoint:z,crisp:C,label:{text:Q,...yb({isUpward:(L??-1)>=0!==u,isVertical:!l,placement:G.placement,padding:G.padding,rect:U})}};d.nodeData.push(J),d.labelData.push(J)});const M=this.properties.line.enabled;return null!=y&&M&&(d.pointData=p),d}updateSeriesItemTypes(){const{dataModel:e,seriesItemTypes:t,processedData:i}=this;if(!e||!i)return;t.clear();const n=e.resolveProcessedDataIndexById(this,"yCurrentPositive"),s=e.resolveProcessedDataIndexById(this,"yCurrentNegative"),r=e.resolveProcessedDataIndexById(this,"totalTypeValue"),o=i.domain.values[n]??[],a=i.domain.values[s]??[];o.length>0&&t.add("positive"),a.length>0&&t.add("negative");const l=i?.domain.values[r];l&&l.forEach(e=>{"total"!==e&&"subtotal"!==e||t.add("total")})}isSubtotal(e){return"subtotal"===e}isTotal(e){return"total"===e}nodeFactory(){return new Gb}getSeriesItemType(e,t){return t??(e?"positive":"negative")}getItemConfig(e){switch(e){case"positive":return this.properties.item.positive;case"negative":return this.properties.item.negative;case"subtotal":case"total":return this.properties.item.total}}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,n=t??[];return i.update(n)}getItemStyle(e,t,i,n){const{id:s,properties:r}=this,o=r.item["subtotal"===i?"total":i],a=n?r.highlightStyle.item:void 0,{itemStyler:l,fillGradientDefaults:c,fillPatternDefaults:h,fillImageDefaults:u}=o,{xKey:d,yKey:p}=r,g=Hb({fill:a?.fill??o.fill,fillOpacity:a?.fillOpacity??o.fillOpacity,stroke:a?.stroke??o.stroke,strokeWidth:a?.strokeWidth??o.strokeWidth,strokeOpacity:a?.strokeOpacity??o.strokeOpacity,lineDash:a?.lineDash??o.lineDash??[],lineDashOffset:a?.lineDashOffset??o.lineDashOffset,cornerRadius:o.cornerRadius},c,h,u);if(null!=l){let r=this.cachedDatumCallback(Ab(e,n?"highlight":"node"),()=>this.callWithContext(l,{seriesId:s,itemId:i,datum:t,xKey:d,yKey:p,highlighted:n,...g}));r=Hb(r,c,h,u),Object.assign(g,r)}return g}updateDatumNodes(e){const{datumSelection:t,isHighlight:i}=e,n=this.getCategoryDirection()===Eb.X,s=this.getShapeFillBBox();t.each((e,t)=>{const r=t.itemId,o=this.getItemStyle(String(t.datumIndex),t.datum,r,i);Vb(e,o,void 0,s),e.visible=n?t.width>0:t.height>0,e.crisp=t.crisp})}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;if(0===t.length)return i.update([]);const n=t.filter(e=>{const{label:t}=this.getItemConfig(e.itemId);return t.enabled});return i.update(n)}updateLabelNodes(e){e.labelSelection.each((e,t)=>{Tb(e,this.getItemConfig(t.itemId).label,t.label)})}getTooltipContent(e){const{id:t,dataModel:i,processedData:n,properties:s}=this,{xKey:r,xName:o,yKey:a,yName:l,tooltip:c}=s,h=this.getCategoryAxis(),u=this.getValueAxis();if(!(i&&n&&h&&u))return;const d=n.dataSources.get(this.id)?.[e],p=i.resolveKeysById(this,"xValue",n)[e],g=i.resolveColumnById(this,"yRaw",n)[e],f=i.resolveColumnById(this,"yCurrentTotal",n),m=i.resolveColumnById(this,"totalTypeValue",n);if(null==p)return;const y=m[e],v=(g??0)>=0,b=this.getSeriesItemType(v,y);let C;if(this.isTotal(y))C=f[e];else if(this.isSubtotal(y)){C=f[e];for(let t=e-1;t>=0;t-=1)if(this.isSubtotal(m[t])){C-=f[t];break}}else C=g;const w=this.getItemStyle(String(e),d,b,!1);return this.formatTooltipWithContext(c,{heading:h.formatDatum(p),symbol:this.legendItemSymbol(b),data:[{label:l,fallbackLabel:a,value:u.formatDatum(C)}]},{seriesId:t,datum:d,title:l,itemId:b,xKey:r,xName:o,yKey:a,yName:l,...w})}legendItemSymbol(e){const{fill:t,stroke:i,fillOpacity:n,strokeOpacity:s,strokeWidth:r,lineDash:o,lineDashOffset:a,fillGradientDefaults:l,fillPatternDefaults:c,fillImageDefaults:h}=this.getItemConfig(e);return{marker:Hb({fill:t,stroke:i,fillOpacity:n,strokeOpacity:s,strokeWidth:r,lineDash:o,lineDashOffset:a},l,c,h)}}getLegendData(e){if("category"!==e)return[];const{id:t,seriesItemTypes:i}=this,n=[],{showInLegend:s}=this.properties;return i.forEach(e=>{const{name:i}=this.getItemConfig(e);var r;n.push({legendType:"category",id:t,itemId:e,seriesId:t,enabled:!0,label:{text:i??(r=e,r.charAt(0).toUpperCase()+r.substring(1))},symbol:this.legendItemSymbol(e),hideInLegend:!s,isFixed:!0})}),n}toggleSeriesItem(){}animateEmptyUpdateReady(e){const{datumSelection:t,labelSelection:i,contextData:n}=e,s=Db(Ib(this.isVertical(),this.axes,"normal"));Bb.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],s),kb(this,"labels",this.ctx.animationManager,i);const{pointData:r}=n;r&&(this.isVertical()?this.animateConnectorLinesVertical(e):this.animateConnectorLinesHorizontal(e))}animateConnectorLinesHorizontal(e){const{pointData:t=[]}=e.contextData,[i]=e.paths,{path:s}=i;this.updateLineNode(i);const r=this.getValueAxis(),o=r?.isReversed(),a=o?(e,t)=>e<t:(e,t)=>e>t,l=r?.scale.convert(0),c=t.reduce((e,t)=>(a(t.x,e)&&(e=t.x),e),o?1/0:0),h=(e,t,i,n,s)=>(e-t)/(i-t)*(s-n)+n;this.ctx.animationManager.animate({id:`${this.id}_connectors`,groupId:this.id,phase:"initial",from:l,to:c,ease:n.n1.Motion.easeOut,collapsable:!1,onUpdate(e){s.clear(!0),t.forEach((t,i)=>{const n=h(e,l,c,l,t.x),r=h(e,l,c,l,t.x2);0!==i&&s.lineTo(n,t.y),s.moveTo(r,t.y2)}),i.checkPathDirty()},onStop:()=>this.resetConnectorLinesPath(e)})}animateConnectorLinesVertical(e){const{pointData:t=[]}=e.contextData,[i]=e.paths,{path:s}=i;this.updateLineNode(i);const r=this.getValueAxis(),o=r?.isReversed(),a=o?(e,t)=>e>t:(e,t)=>e<t,l=r?.scale.convert(0),c=t.reduce((e,t)=>(a(t.y,e)&&(e=t.y),e),o?0:1/0),h=(e,t,i,n,s)=>(e-t)/(i-t)*(s-n)+n;this.ctx.animationManager.animate({id:`${this.id}_connectors`,groupId:this.id,phase:"initial",from:l,to:c,ease:n.n1.Motion.easeOut,collapsable:!1,onUpdate(e){s.clear(!0),t.forEach((t,i)=>{const n=h(e,l,c,l,t.y),r=h(e,l,c,l,t.y2);0!==i&&s.lineTo(t.x,n),s.moveTo(t.x2,r)}),i.checkPathDirty()},onStop:()=>this.resetConnectorLinesPath(e)})}animateReadyResize(e){super.animateReadyResize(e),this.resetConnectorLinesPath(e)}updatePaths(e){this.resetConnectorLinesPath({contextData:e.contextData,paths:e.paths})}resetConnectorLinesPath({contextData:e,paths:t}){if(0===t.length)return;const[i]=t;this.updateLineNode(i);const{path:n}=i;n.clear(!0);const{pointData:s}=e;s&&(s.forEach((e,t)=>{0!==t&&n.lineTo(e.x,e.y),n.moveTo(e.x2,e.y2)}),i.checkPathDirty())}updateLineNode(e){const{stroke:t,strokeWidth:i,strokeOpacity:s,lineDash:r,lineDashOffset:o}=this.properties.line;e.setProperties({fill:void 0,stroke:t,strokeWidth:this.getStrokeWidth(i),strokeOpacity:s,lineDash:r,lineDashOffset:o,lineJoin:"round",pointerEvents:n.n1.PointerEvents.None})}isLabelEnabled(){const{positive:e,negative:t,total:i}=this.properties.item;return e.label.enabled||t.label.enabled||i.label.enabled}onDataChange(){}computeFocusBounds({datumIndex:e}){return Ob(this,this.contextNodeData?.nodeData[e])}};Ub.className="WaterfallSeries",Ub.type="waterfall";var{commonSeriesOptionsDefs:zb,waterfallSeriesThemeableOptionsDef:Wb}=n.n1,jb={...Wb,...zb,type:(0,s.mw)((0,s.dY)("waterfall")),xKey:(0,s.mw)(s.Yj),yKey:(0,s.mw)(s.Yj),xName:s.Yj,yName:s.Yj,totals:(0,s.J$)({totalType:(0,s.mw)((0,s.KC)("total","subtotal")),index:(0,s.mw)(s.Ly),axisLabel:(0,s.mw)(s.Yj)},"a total definition options array")};function $b(e,t){return{fill:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$path:[`./${t}`,{$palette:"fill"},{$palette:"fills"}]},{$palette:`${e}.fill`}]},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$if:[{$or:[{$isGradient:[{$palette:`${e}.fill`}]},{$isPattern:[{$palette:`${e}.fill`}]},{$isImage:[{$palette:`${e}.fill`}]}]},{$map:[{$path:["./color",void 0,{$value:"$1"}]},{$path:["./colorStops",void 0,{$palette:`${e}.fill`}]}]},[{$mix:[{$palette:`${e}.fill`},"black",.15]},{$mix:[{$palette:`${e}.fill`},"white",.15]}]]},rotation:0,reverse:!1},fillPatternDefaults:n.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:n.n1.FILL_IMAGE_DEFAULTS,stroke:{$palette:`${e}.stroke`},strokeWidth:0,label:{enabled:!1,fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},formatter:void 0,placement:"outside-end"}}}var Kb={series:{item:{positive:$b("altUp",0),negative:$b("altDown",1),total:$b("neutral",2)},line:{stroke:{$palette:"neutral.stroke"},strokeOpacity:1,lineDash:[0],lineDashOffset:0,strokeWidth:2}},legend:{enabled:!0,toggleSeries:!1}},Yb={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"waterfall",solo:!0,moduleFactory:e=>new Ub(e),tooltipDefaults:{range:"exact"},defaultAxes:n.n1.DIRECTION_SWAP_AXES,themeTemplate:Kb},qb={type:"series",name:"waterfall",chartType:"cartesian",enterprise:!0,options:jb,create:e=>new Ub(e)},{NewAreaSeriesModule:Xb,NewBarSeriesModule:Zb,NewBubbleSeriesModule:Qb,NewHistogramSeriesModule:Jb,NewLineSeriesModule:eC,NewScatterSeriesModule:tC,numberFormatValidator:iC,without:nC}=n.n1,sC={width:s.Ly,height:s.Ly,grip:s.zM,fill:s.yW,stroke:s.yW,strokeWidth:s.Ly,cornerRadius:s.Ly},rC=["cursor","highlightStyle","listeners","nodeClickRange","showInLegend","showInMiniChart","tooltip","visible","xName","yName"],oC={enabled:s.zM,height:s.Ly,spacing:s.Ly,cornerRadius:s.ai,mask:{fill:s.yW,fillOpacity:s.CG,stroke:s.yW,strokeWidth:s.Ly},minHandle:sC,maxHandle:sC,miniChart:{enabled:s.zM,padding:{top:s.Ly,bottom:s.Ly},label:{enabled:s.zM,avoidCollisions:s.zM,spacing:s.Ly,format:iC,formatter:s.E2,interval:{minSpacing:s.Ly,maxSpacing:s.Ly,values:s.YO,step:s.ai},...s.LV},series:(0,s.J$)((0,s.is)({area:nC(Xb.options,rC),bar:nC(Zb.options,[...rC,"errorBar","label","legendItemName","direction"]),"box-plot":nC(Lg.options,[...rC,"direction","legendItemName","minName","q1Name","medianName","q3Name","maxName"]),bubble:nC(Qb.options,[...rC,"title","label","labelKey","labelName","sizeName"]),candlestick:nC(Zf.options,rC),heatmap:nC(Gm.options,[...rC,"title","label","colorName","textAlign","verticalAlign","itemPadding","colorRange"]),histogram:nC(Jb.options,[...rC,"label"]),line:nC(eC.options,[...rC,"errorBar","title","label"]),ohlc:nC(Km.options,rC),"range-area":nC(av.options,[...rC,"label","yLowName","yHighName"]),"range-bar":nC(Jv.options,[...rC,"direction","label","yLowName","yHighName"]),scatter:nC(tC.options,[...rC,"errorBar","title","label","labelKey","labelName"]),waterfall:nC(qb.options,[...rC,"direction"])},"miniChart series options"))}},{annotationOptionsDef:aC}=n.n1,lC={type:"plugin",name:"annotations",chartType:"cartesian",options:aC,create:()=>null},cC={type:"plugin",name:"navigator",chartType:"cartesian",options:oC,create:()=>null},hC={type:"plugin",name:"initialState",options:jp,create:()=>null};function uC(e,t,i){i||(t=function(e){const t=new Set;for(const i of e)dC(e,i,t,[]);return 0!==t.size&&s.Vy.warnOnce("Some links formed circular references. These will be removed from the output."),0===t.size?e:e.filter(e=>!t.has(e))}(t));const n=new Map;for(const t of e)n.set(t.id,{datum:t,linksBefore:[],linksAfter:[],maxPathLengthBefore:-1,maxPathLengthAfter:-1});let r=0;return n.forEach((e,i)=>{r=Math.max(r,pC(n,t,e,i,-1,[])+pC(n,t,e,i,1,[])+1)}),{links:t,nodeGraph:n,maxPathLength:r}}function dC(e,t,i,n){const s=n.indexOf(t);if(-1!==s){for(let e=s;e<n.length;e+=1)i.add(n[e]);return}n.push(t);const{toNode:r}=t;for(const t of e)t.fromNode===r&&dC(e,t,i,n);n.pop()}function pC(e,t,i,n,s,r){if(r.includes(n))return 1/0;let o=-1===s?i.maxPathLengthBefore:i.maxPathLengthAfter;if(-1===o){o=0;const a=-1===s?i.linksBefore:i.linksAfter;for(const i of t){const{fromNode:l,toNode:c}=i,h=-1===s?c.id:l.id,u=-1===s?l.id:c.id,d=n===h?e.get(u):void 0;null!=d&&(a.push({node:d,link:i}),r?.push(n),o=Math.max(o,pC(e,t,d,u,s,r)+1),r?.pop())}-1===s?i.maxPathLengthBefore=o:i.maxPathLengthAfter=o}return o}var{Series:gC,DataController:fC,keyProperty:mC,valueProperty:yC,Selection:vC,Group:bC,TransformableText:CC}=n.n1,wC=class extends n.n1.SeriesNodeEvent{constructor(e,t,i,n){super(e,t,i,n);const{datumIndex:s}=i,r=n.contextNodeData?.nodeData.find(e=>e.datumIndex.type===s.type&&e.datumIndex.index===s.index);this.size=r?.size,this.label=1===r?.type?r?.label:void 0}},SC=class extends gC{constructor(){super(...arguments),this.NodeEvent=wC,this._chartNodes=void 0,this.nodeCount=0,this.linkCount=0,this.linksDataModel=void 0,this.linksProcessedData=void 0,this.nodesDataModel=void 0,this.nodesProcessedData=void 0,this.processedNodes=new Map,this.linkGroup=this.contentGroup.appendChild(new bC({name:"linkGroup"})),this.nodeGroup=this.contentGroup.appendChild(new bC({name:"nodeGroup"})),this.focusLinkGroup=this.highlightNode.appendChild(new bC({name:"linkGroup"})),this.focusNodeGroup=this.highlightNode.appendChild(new bC({name:"nodeGroup"})),this.highlightLinkGroup=this.highlightNode.appendChild(new bC({name:"linkGroup"})),this.highlightNodeGroup=this.highlightNode.appendChild(new bC({name:"nodeGroup"})),this.labelSelection=vC.select(this.labelGroup,CC),this.linkSelection=vC.select(this.linkGroup,()=>this.linkFactory()),this.nodeSelection=vC.select(this.nodeGroup,()=>this.nodeFactory()),this.focusLinkSelection=vC.select(this.focusLinkGroup,()=>this.linkFactory()),this.focusNodeSelection=vC.select(this.focusNodeGroup,()=>this.nodeFactory()),this.highlightLinkSelection=vC.select(this.highlightLinkGroup,()=>this.linkFactory()),this.highlightNodeSelection=vC.select(this.highlightNodeGroup,()=>this.nodeFactory())}get nodes(){return this.properties.nodes??this._chartNodes}setChartNodes(e){this._chartNodes=e,this.nodes===e&&(this.nodeDataRefresh=!0)}async processData(e){const{data:t,nodes:i}=this;if(null==t)return;const{fromKey:n,toKey:s,sizeKey:r,idKey:o,labelKey:a}=this.properties,l=new fC("standalone",e.suppressFieldDotNotation),c=null!=i?l.request(this.id,i,{props:[mC(o,void 0,{id:"idValue",includeProperty:!1}),...null!=a?[yC(a,void 0,{id:"labelValue",includeProperty:!1})]:[]],groupByKeys:!0}):null,h=e.request(this.id,t,{props:[yC(n,void 0,{id:"fromValue",includeProperty:!1}),yC(s,void 0,{id:"toValue",includeProperty:!1}),...null!=r?[yC(r,void 0,{id:"sizeValue",includeProperty:!1,missingValue:0})]:[]],groupByKeys:!1});null!=i&&l.execute();const[u,d]=await Promise.all([c,h]);this.nodesDataModel=u?.dataModel,this.nodesProcessedData=u?.processedData,this.linksDataModel=d?.dataModel,this.linksProcessedData=d?.processedData;const p=new Map;if(null==u){const e=d.dataModel.resolveColumnById(this,"fromValue",d.processedData),t=d.dataModel.resolveColumnById(this,"toValue",d.processedData),i=e=>{const t=p.size;return{series:this,itemId:void 0,datum:{},datumIndex:{type:1,index:t},type:1,index:t,linksBefore:[],linksAfter:[],id:e,size:0,label:e}};d.processedData.dataSources.get(this.id)?.forEach((n,s)=>{const r=e[s],o=t[s];null!=r&&null!=o&&(p.has(r)||p.set(r,i(r)),p.has(o)||p.set(o,i(o)))})}else{const e=u.dataModel.resolveColumnById(this,"idValue",u.processedData),t=null!=a?u.dataModel.resolveColumnById(this,"labelValue",u.processedData):void 0;u.processedData.dataSources.get(this.id)?.forEach((i,n)=>{const s=e[n],r=t?.[n];p.set(s,{series:this,itemId:void 0,datum:i,datumIndex:{type:1,index:n},type:1,index:n,linksBefore:[],linksAfter:[],id:s,size:0,label:r})})}this.processedNodes=p}getNodeGraph(e,t,{includeCircularReferences:i}){const{linksDataModel:n,linksProcessedData:s}=this;if(null==n||null==s){const{links:e,nodeGraph:t,maxPathLength:n}=uC((new Map).values(),[],i);return this.nodeCount=0,this.linkCount=0,{nodeGraph:t,links:e,maxPathLength:n}}const{sizeKey:r}=this.properties,o=n.resolveColumnById(this,"fromValue",s),a=n.resolveColumnById(this,"toValue",s),l=null!=r?n.resolveColumnById(this,"sizeValue",s):void 0,c=new Map;this.processedNodes.forEach(t=>{const i=e(t);c.set(t.id,i)});const h=[];s.dataSources.get(this.id)?.forEach((e,i)=>{const n=o[i],s=a[i],r=null!=l?l[i]:1,u=c.get(n),d=c.get(s);if(r<=0||null==u||null==d)return;const p=t({series:this,itemId:void 0,datum:e,datumIndex:{type:0,index:i},type:0,index:i,fromNode:u,toNode:d,size:r});h.push(p)});const{links:u,nodeGraph:d,maxPathLength:p}=uC(c.values(),h,i);return d.forEach(e=>{e.datum.linksBefore=e.linksBefore.map(e=>e.link),e.datum.linksAfter=e.linksAfter.map(e=>e.link)}),this.nodeCount=d.size,this.linkCount=u.length,{nodeGraph:d,links:u,maxPathLength:p}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(e){const{seriesRect:t}=e,i={seriesRectWidth:t?.width??0,seriesRectHeight:t?.height??0};null!=this._nodeDataDependencies&&this._nodeDataDependencies.seriesRectWidth===i.seriesRectWidth&&this._nodeDataDependencies.seriesRectHeight===i.seriesRectHeight||(this._nodeDataDependencies=i),this.updateSelections();const n=this.contextNodeData?.nodeData??[],s=this.contextNodeData?.labelData??[];let r,o,a,l,c=this.ctx.highlightManager?.getActiveHighlight();if(c?.series===this&&null==c.type){const{itemId:e}=c;c=null!=e?n.find(t=>1===t.type&&t.id===e):void 0}else c?.series!==this&&(c=void 0);this.contentGroup.visible=this.visible,this.contentGroup.opacity=null!=c?this.properties.highlightStyle.series.dimOpacity??1:1,this.labelSelection=this.updateLabelSelection({labelData:s,labelSelection:this.labelSelection}),this.updateLabelNodes({labelSelection:this.labelSelection}),this.linkSelection=this.updateLinkSelection({nodeData:n.filter(e=>0===e.type),datumSelection:this.linkSelection}),this.updateLinkNodes({datumSelection:this.linkSelection,isHighlight:!1}),this.nodeSelection=this.updateNodeSelection({nodeData:n.filter(e=>1===e.type),datumSelection:this.nodeSelection}),this.updateNodeNodes({datumSelection:this.nodeSelection,isHighlight:!1}),1===c?.type?(r=n.filter(e=>0===e.type&&(e.toNode===c||e.fromNode===c)),o=r.map(e=>e.fromNode===c?e.toNode:e.fromNode),o.push(c),a=[],l=[c]):0===c?.type?(r=[c],o=[c.fromNode,c.toNode],a=[c],l=[]):(r=[],o=[],a=[],l=[]),this.focusLinkSelection=this.updateLinkSelection({nodeData:r,datumSelection:this.focusLinkSelection}),this.updateLinkNodes({datumSelection:this.focusLinkSelection,isHighlight:!1}),this.focusNodeSelection=this.updateNodeSelection({nodeData:o,datumSelection:this.focusNodeSelection}),this.updateNodeNodes({datumSelection:this.focusNodeSelection,isHighlight:!1}),this.highlightLinkSelection=this.updateLinkSelection({nodeData:a,datumSelection:this.highlightLinkSelection}),this.updateLinkNodes({datumSelection:this.highlightLinkSelection,isHighlight:!0}),this.highlightNodeSelection=this.updateNodeSelection({nodeData:l,datumSelection:this.highlightNodeSelection}),this.updateNodeNodes({datumSelection:this.highlightNodeSelection,isHighlight:!0})}resetAnimation(e){}getSeriesDomain(e){return[]}getSeriesRange(e,t){return[NaN,NaN]}legendItemSymbol(e,t,i={}){const{fills:n,strokes:s}=this.properties,{fill:r=n[t%n.length],fillOpacity:o=1,stroke:a=s[t%s.length],strokeWidth:l=0,strokeOpacity:c=1,lineDash:h=[0],lineDashOffset:u=0}=i;return{marker:{fill:r,fillOpacity:o,stroke:a,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:u}}}getLegendData(e){if("category"!==e)return[];const{showInLegend:t}=this.properties;return Array.from(this.processedNodes.values(),({id:e,label:i},n)=>({legendType:"category",id:this.id,itemId:e,seriesId:this.id,enabled:!0,label:{text:i??e},symbol:this.legendItemSymbol(1,n),hideInLegend:!t,isFixed:!0}))}pickNodeClosestDatum({x:e,y:t}){let i,n=1/0;return this.linkSelection.each((s,r)=>{const o=s.containsPoint(e,t)?0:1/0;o<n&&(n=o,i=r)}),this.nodeSelection.each((s,r)=>{const o=s.distanceSquared(e,t);o<n&&(n=o,i=r)}),null!=i?{datum:i,distance:Math.sqrt(n)}:void 0}getDatumAriaText(e,t){return 0===e.type?this.ctx.localeManager.t("ariaAnnounceFlowProportionLink",{index:e.index+1,count:this.linkCount,from:e.fromNode.id,to:e.toNode.id,size:e.size,sizeName:this.properties.sizeName??this.properties.sizeKey}):1===e.type?this.ctx.localeManager.t("ariaAnnounceFlowProportionNode",{index:e.index+1,count:this.nodeCount,description:t}):void 0}pickFocus(e){const{datumIndexDelta:t,otherIndexDelta:i}=e,n=this.contextNodeData?.nodeData[e.datumIndex-e.datumIndexDelta];let s=n;if(0!==i||0===t)return;if(0===n?.type){const e=Array.from(this.linkSelection,e=>e.datum),i=e.indexOf(n)+t;if(i>=0&&i<e.length)s=e[i];else if(i>0)s=e[e.length-1];else{const e=Array.from(this.nodeSelection,e=>e.datum);s=e[e.length-1]}}else if(1===n?.type){const e=Array.from(this.nodeSelection,e=>e.datum),i=e.indexOf(n)+t;if(i>=0&&i<e.length)s=e[i];else if(i<0)s=e[0];else{const e=Array.from(this.linkSelection,e=>e.datum);s=e[0]}}if(null==s)return;const r=1===s.type?Array.from(this.nodeSelection).find(e=>e.datum===s):Array.from(this.linkSelection).find(e=>e.datum===s);if(null==r)return;const o=this.computeFocusBounds(r.node);return null!=o?{datum:r.datum,datumIndex:this.contextNodeData?.nodeData.indexOf(r.datum)??0,otherIndex:0,bounds:o,clipFocusBox:!0}:void 0}getCategoryValue(e){}datumIndexForCategoryValue(e){}},{Path:xC,SceneChangeDetection:EC}=n.n1;function AC({radius:e,startAngle:t,endAngle:i,tension:n}){const s=e*Math.cos(t),r=e*Math.sin(t),o=e*Math.cos(i),a=e*Math.sin(i);return{x:[s,s*n,o*n,o],y:[r,r*n,a*n,a]}}var MC=class extends xC{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.radius=0,this.startAngle1=0,this.endAngle1=0,this.startAngle2=0,this.endAngle2=0,this.tension=1}tensionedCurveTo(e,t,i,n,s,r,o,a){const{path:l,tension:c}=this,h=1-c;l.cubicCurveTo((i-e)*h+e,(n-t)*h+t,(s-o)*h+o,(r-a)*h+a,o,a)}updatePath(){const{path:e,centerX:t,centerY:i,radius:n}=this;let{startAngle1:s,endAngle1:r,startAngle2:o,endAngle2:a}=this;s>o&&([s,o]=[o,s],[r,a]=[a,r]),e.clear();const l=t+n*Math.cos(s),c=i+n*Math.sin(s);e.moveTo(l,c),this.tensionedCurveTo(l,c,t,i,t,i,t+n*Math.cos(a),i+n*Math.sin(a)),e.arc(t,i,n,a,o,!0),this.tensionedCurveTo(t+n*Math.cos(o),i+n*Math.sin(o),t,i,t,i,t+n*Math.cos(r),i+n*Math.sin(r)),e.arc(t,i,n,r,s,!0),e.closePath()}};a([EC()],MC.prototype,"centerX",2),a([EC()],MC.prototype,"centerY",2),a([EC()],MC.prototype,"radius",2),a([EC()],MC.prototype,"startAngle1",2),a([EC()],MC.prototype,"endAngle1",2),a([EC()],MC.prototype,"startAngle2",2),a([EC()],MC.prototype,"endAngle2",2),a([EC()],MC.prototype,"tension",2);var{FillGradientDefaults:TC,FillPatternDefaults:DC,FillImageDefaults:IC,BaseProperties:RC,SeriesTooltip:kC,SeriesProperties:PC,Property:_C,Label:LC}=n.n1,NC=class extends LC{constructor(){super(...arguments),this.spacing=1,this.maxWidth=1}};a([_C],NC.prototype,"spacing",2),a([_C],NC.prototype,"maxWidth",2);var OC=class extends RC{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0,this.tension=0}};a([_C],OC.prototype,"fill",2),a([_C],OC.prototype,"fillOpacity",2),a([_C],OC.prototype,"stroke",2),a([_C],OC.prototype,"strokeOpacity",2),a([_C],OC.prototype,"strokeWidth",2),a([_C],OC.prototype,"lineDash",2),a([_C],OC.prototype,"lineDashOffset",2),a([_C],OC.prototype,"tension",2),a([_C],OC.prototype,"itemStyler",2);var FC=class extends RC{constructor(){super(...arguments),this.spacing=1,this.width=1,this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0}};a([_C],FC.prototype,"spacing",2),a([_C],FC.prototype,"width",2),a([_C],FC.prototype,"fill",2),a([_C],FC.prototype,"fillOpacity",2),a([_C],FC.prototype,"stroke",2),a([_C],FC.prototype,"strokeOpacity",2),a([_C],FC.prototype,"strokeWidth",2),a([_C],FC.prototype,"lineDash",2),a([_C],FC.prototype,"lineDashOffset",2),a([_C],FC.prototype,"itemStyler",2);var GC=class extends PC{constructor(){super(...arguments),this.idKey="",this.idName=void 0,this.labelKey=void 0,this.labelName=void 0,this.sizeKey=void 0,this.sizeName=void 0,this.nodes=void 0,this.fillGradientDefaults=new TC,this.fillPatternDefaults=new DC,this.fillImageDefaults=new IC,this.fills=[],this.strokes=[],this.label=new NC,this.link=new OC,this.node=new FC,this.tooltip=new kC}};a([_C],GC.prototype,"fromKey",2),a([_C],GC.prototype,"toKey",2),a([_C],GC.prototype,"idKey",2),a([_C],GC.prototype,"idName",2),a([_C],GC.prototype,"labelKey",2),a([_C],GC.prototype,"labelName",2),a([_C],GC.prototype,"sizeKey",2),a([_C],GC.prototype,"sizeName",2),a([_C],GC.prototype,"nodes",2),a([_C],GC.prototype,"fillGradientDefaults",2),a([_C],GC.prototype,"fillPatternDefaults",2),a([_C],GC.prototype,"fillImageDefaults",2),a([_C],GC.prototype,"fills",2),a([_C],GC.prototype,"strokes",2),a([_C],GC.prototype,"label",2),a([_C],GC.prototype,"link",2),a([_C],GC.prototype,"node",2),a([_C],GC.prototype,"tooltip",2);var{SeriesNodePickMode:BC,CachedTextMeasurerPool:VC,TextWrapper:HC,TextUtils:UC,createDatumId:zC,angleBetween:WC,normalizeAngle360:jC,isBetweenAngles:$C,Sector:KC,evaluateBezier:YC,applyShapeStyle:qC,getShapeStyle:XC,BBox:ZC}=n.n1,QC=e=>e.startAngle+WC(e.startAngle,e.endAngle)/2,JC=class extends SC{constructor(e){super({moduleCtx:e,pickModes:[BC.NEAREST_NODE,BC.EXACT_SHAPE_MATCH]}),this.properties=new GC}isLabelEnabled(){return(null!=this.properties.labelKey||null==this.nodes)&&this.properties.label.enabled}linkFactory(){return new MC}nodeFactory(){return new KC}createNodeData(){const{id:e,_nodeDataDependencies:{seriesRectWidth:t,seriesRectHeight:i}={seriesRectWidth:0,seriesRectHeight:0}}=this,{fromKey:n,toKey:r,sizeKey:o,label:{spacing:a,maxWidth:l,fontSize:c},node:{width:h,spacing:u}}=this.properties,d=t/2,p=i/2;let g=[];const{nodeGraph:f,links:m}=this.getNodeGraph(e=>({...e,centerX:d,centerY:p,innerRadius:NaN,outerRadius:NaN,startAngle:NaN,endAngle:NaN}),e=>({...e,centerX:d,centerY:p,radius:NaN,startAngle1:NaN,endAngle1:NaN,startAngle2:NaN,endAngle2:NaN}),{includeCircularReferences:!0});let y=0;f.forEach(({datum:e,linksBefore:t,linksAfter:i},s)=>{const a=t.reduce((e,{link:t})=>e+t.size,0)+i.reduce((e,{link:t})=>e+t.size,0);if(0===a)f.delete(s);else{e.size=a,y+=e.size;const t=this.getLabelText(this.properties.label,{datum:e.datum,value:e.label,fromKey:n,toKey:r,sizeKey:o,size:e.size});e.label=String(t)}});let v=0;if(this.isLabelEnabled()){const e=this.properties.label.getFont();let t=0;f.forEach(({datum:i})=>{const{id:n,label:s}=i;if(null==s)return;const r=HC.wrapText(s,{maxWidth:l,font:this.properties.label,textWrap:"never"}),{width:o}=VC.measureText(r,{font:e,textAlign:"left",textBaseline:"middle"});t=Math.max(o,t),g.push({id:n,text:r,centerX:d,centerY:p,angle:NaN,radius:NaN})}),v=t+a}const b=f.size;let C=Math.min(t,i)/2-h-v,w=u/C;if(0!==v&&(b*w>=1.5*Math.PI||C<=0)&&(g=[],C=Math.min(t,i)/2-h,w=u/C),b*w>=2*Math.PI||C<=0)return void s.Vy.warnOnce("There was insufficient space to display the Chord Series.");const S=C,x=C+h,E=Math.max((2*Math.PI-b*w)/y,0);let A=0;f.forEach(({datum:e})=>{e.innerRadius=S,e.outerRadius=x,e.startAngle=A,e.endAngle=A+e.size*E,A=e.endAngle+w;const t=(e.innerRadius+e.outerRadius)/2,i=QC(e);e.midPoint={x:e.centerX+t*Math.cos(i),y:e.centerY+t*Math.sin(i)}});const M=[];f.forEach(({datum:e,linksBefore:t,linksAfter:i})=>{const n=QC(e),s=[...t.map(e=>({link:e.link,distance:WC(QC(e.node.datum),n),after:!1})),...i.map(e=>({link:e.link,distance:WC(QC(e.node.datum),n),after:!0}))];let r=e.startAngle;s.toSorted((e,t)=>e.distance-t.distance).forEach(({link:e,after:t})=>{const i=e.size*E;t?(e.startAngle1=r,e.endAngle1=r+i):(e.startAngle2=r,e.endAngle2=r+i),r+=e.size*E}),M.push(e)});const{tension:T}=this.properties.link;m.forEach(e=>{e.radius=C;const t=AC({radius:C,startAngle:e.startAngle1,endAngle:e.endAngle2,tension:T}),i=AC({radius:C,startAngle:e.startAngle2,endAngle:e.endAngle1,tension:T}),n=YC(...t.x,.5),s=YC(...t.y,.5),r=YC(...i.x,.5),o=YC(...i.y,.5);e.midPoint={x:e.centerX+(n+r)/2,y:e.centerY+(s+o)/2},M.push(e)}),g.forEach(e=>{const t=f.get(e.id)?.datum;null!=t&&(e.radius=x+a,e.angle=jC(t.startAngle+WC(t.startAngle,t.endAngle)/2))}),g.sort((e,t)=>e.angle-t.angle);let D=1/0,I=-1/0;return g=g.filter(e=>{const t=UC.getLineHeight(c),i=Math.atan2(t/2,e.radius),n=e.angle-i,s=e.angle+i;return!$C(D,n,s)&&!$C(I,n,s)&&(D=Math.min(n,D),I=Math.max(s,I),!0)}),{itemId:e,nodeData:M,labelData:g}}updateLabelSelection(e){const t=this.isLabelEnabled()?e.labelData:[];return e.labelSelection.update(t)}updateLabelNodes(e){const{labelSelection:t}=e,{color:i,fontStyle:n,fontWeight:s,fontSize:r,fontFamily:o}=this.properties.label;t.each((e,{text:t,centerX:a,centerY:l,radius:c,angle:h})=>{e.visible=!0,e.translationX=a+c*Math.cos(h),e.translationY=l+c*Math.sin(h),e.text=t,e.fill=i,e.fontStyle=n,e.fontWeight=s,e.fontSize=r,e.fontFamily=o,e.textBaseline="middle",Math.cos(h)>=0?(e.textAlign="left",e.rotation=h):(e.textAlign="right",e.rotation=h-Math.PI)})}updateNodeSelection(e){return e.datumSelection.update(e.nodeData,void 0,e=>zC([e.type,e.id]))}getBaseNodeStyle(e){const{properties:t}=this,{fill:i,fillOpacity:n,stroke:s,strokeOpacity:r,lineDash:o,lineDashOffset:a}=t.node,l=e?t.highlightStyle.item:void 0;return XC({fill:l?.fill??i,fillOpacity:l?.fillOpacity??n,stroke:l?.stroke??s,strokeOpacity:l?.strokeOpacity??r,strokeWidth:l?.strokeWidth??this.getStrokeWidth(t.node.strokeWidth),lineDash:l?.lineDash??o,lineDashOffset:l?.lineDashOffset??a},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}getNodeStyleOverrides(e,t,i,n,s,r,o){const{id:a,properties:l}=this,{fills:c,strokes:h}=l,{itemStyler:u}=l.node,d=r.fill??c[i%c.length],p=r.stroke??h[i%h.length];let g;if(o||(g??(g={}),g.fill=d,g.stroke=p),null!=u){const i=this.cachedDatumCallback(zC(e,"node",o?"highlight":"node"),()=>{const{fillOpacity:e=1,strokeOpacity:i=1,strokeWidth:l=0,lineDash:c=[],lineDashOffset:h=0}=r;return this.callWithContext(u,{seriesId:a,datum:t,highlighted:o,label:s,size:n,fill:d,fillOpacity:e,stroke:p,strokeOpacity:i,strokeWidth:l,lineDash:c,lineDashOffset:h})});g??(g={}),Object.assign(g,i)}return XC(g,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}updateNodeNodes(e){const{datumSelection:t,isHighlight:i}=e,n=this.getBaseNodeStyle(i),s=this.getShapeFillBBox();t.each((e,t)=>{const{datumIndex:r,size:o,label:a}=t,l=this.getNodeStyleOverrides(String(r.index),t.datum,r.index,o,a,n,i);qC(e,n,l,s),e.centerX=t.centerX,e.centerY=t.centerY,e.innerRadius=t.innerRadius,e.outerRadius=t.outerRadius,e.startAngle=t.startAngle,e.endAngle=t.endAngle,e.inset=e.strokeWidth/2})}updateLinkSelection(e){return e.datumSelection.update(e.nodeData,void 0,e=>zC([e.type,e.index,e.fromNode.id,e.toNode.id]))}getBaseLinkStyle(e){const{properties:t}=this,{fill:i,fillOpacity:n,stroke:s,strokeOpacity:r,lineDash:o,lineDashOffset:a,tension:l}=t.link,c=e?t.highlightStyle.item:void 0;return XC({fill:c?.fill??i,fillOpacity:c?.fillOpacity??n,stroke:c?.stroke??s,strokeOpacity:c?.strokeOpacity??r,strokeWidth:c?.strokeWidth??this.getStrokeWidth(t.link.strokeWidth),lineDash:c?.lineDash??o,lineDashOffset:c?.lineDashOffset??a,tension:l},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}getLinkStyleOverrides(e,t,i,n,s){const{id:r,properties:o}=this,{fills:a,strokes:l}=o,{itemStyler:c}=o.link,h=n.fill??a[i%a.length],u=n.stroke??l[i%l.length];let d;if(s||(d??(d={}),d.fill=h,d.stroke=u),null!=c){const i=this.cachedDatumCallback(zC(e,"link",s?"highlight":"node"),()=>{const{fillOpacity:e=1,strokeOpacity:i=1,strokeWidth:o=0,lineDash:a=[],lineDashOffset:l=0,tension:d}=n;return this.callWithContext(c,{seriesId:r,datum:t,highlighted:s,tension:d,fill:h,fillOpacity:e,stroke:u,strokeOpacity:i,strokeWidth:o,lineDash:a,lineDashOffset:l})});d??(d={}),Object.assign(d,i)}return XC(d,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}updateLinkNodes(e){const{datumSelection:t,isHighlight:i}=e,n=this.getBaseLinkStyle(i),s=this.getShapeFillBBox();t.each((e,t)=>{const{datumIndex:r}=t,o=t.fromNode.datumIndex,a=this.getLinkStyleOverrides(String(r.index),t.datum,o.index,n,i);e.centerX=t.centerX,e.centerY=t.centerY,e.radius=t.radius,e.startAngle1=t.startAngle1,e.endAngle1=t.endAngle1,e.startAngle2=t.startAngle2,e.endAngle2=t.endAngle2,qC(e,n,a,s),e.tension=a?.tension??n.tension})}getShapeFillBBox(){const e=this._nodeDataDependencies?.seriesRectWidth??0,t=this._nodeDataDependencies?.seriesRectHeight??0,i=Math.min(e,t),n=new ZC((e-i)/2,(t-i)/2,e,t);return{series:n,axis:n}}getTooltipContent(e){const{id:t,linksProcessedData:i,nodesProcessedData:n,properties:s}=this,{fromKey:r,toKey:o,sizeKey:a,sizeName:l,tooltip:c}=s,h=this.contextNodeData?.nodeData.find(t=>t.datumIndex.type===e.type&&t.datumIndex.index===e.index);if(null==h)return;const u=0===h.type?h.fromNode.index:h.index,d=0===h.type?`${h.fromNode.label} - ${h.toNode.label}`:h.label,p=0===e.type?i?.dataSources.get(this.id)?.[e.index]:n?.dataSources.get(this.id)?.[e.index],g=h.size;let f;if(0===h.type){const t=h.fromNode.datumIndex,i=this.getBaseLinkStyle(!1);Object.assign(i,this.getLinkStyleOverrides(String(e.index),p,t.index,i,!1)),f=i}else{const t=h.label,i=this.getBaseNodeStyle(!1);Object.assign(i,this.getNodeStyleOverrides(String(e.index),p,e.index,g,t,i,!1)),f=i}return this.formatTooltipWithContext(c,{title:d,symbol:this.legendItemSymbol(h.type,u,f),data:null!=a?[{label:l,fallbackLabel:a,value:String(g)}]:[]},{seriesId:t,datum:p,title:d,fromKey:r,toKey:o,sizeKey:a,sizeName:l,size:g,...f})}computeFocusBounds(e){return e}};JC.className="ChordSeries",JC.type="chord";var{commonSeriesOptionsDefs:ew,chordSeriesThemeableOptionsDef:tw}=n.n1,iw={...tw,...ew,type:(0,s.mw)((0,s.dY)("chord")),fromKey:(0,s.mw)(s.Yj),toKey:(0,s.mw)(s.Yj),sizeKey:s.Yj,sizeName:s.Yj};iw.fillGradientDefaults=(0,s._L)(s.wi),iw.fillPatternDefaults=(0,s._L)(s.GY),iw.fillImageDefaults=(0,s._L)(s.Zd);var nw={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["flow-proportion"],solo:!0,identifier:"chord",tooltipDefaults:{range:"exact"},moduleFactory:e=>new JC(e),themeTemplate:{series:{fills:{$palette:"fills"},strokes:{$palette:"strokes"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:n.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:n.n1.FILL_IMAGE_DEFAULTS,highlightStyle:{series:{dimOpacity:.2}},label:{fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:5,maxWidth:100},node:{spacing:8,width:10,strokeWidth:0},link:{fillOpacity:.5,strokeWidth:0,tension:.4}},legend:{enabled:!1,toggleSeries:!1}}},sw={type:"series",name:"chord",chartType:"flow-proportion",enterprise:!0,options:iw,create:e=>new JC(e)},{ThemeConstants:{CARTESIAN_AXIS_TYPE:rw,CARTESIAN_POSITION:ow},ThemeSymbols:{DEFAULT_SHADOW_COLOUR:aw}}=n.n1,lw={$if:[{$eq:[{$path:["/direction",void 0]},"horizontal"]},[{type:rw.NUMBER,position:ow.LEFT},{type:rw.CATEGORY,position:{$if:[{$eq:[{$path:["/stageLabel/placement",void 0]},"before"]},ow.TOP,ow.BOTTOM]},label:{$omit:[["placement"],{$path:["/stageLabel",void 0]}]}}],[{type:rw.CATEGORY,position:{$if:[{$eq:[{$path:["/stageLabel/placement",void 0]},"after"]},ow.RIGHT,ow.LEFT]},label:{$omit:[["placement"],{$path:["/stageLabel",void 0]}]}},{type:rw.NUMBER,position:ow.BOTTOM}]]},cw={series:{direction:"vertical",strokeWidth:0,spacingRatio:.25,fills:[{$palette:"fill"}],strokes:[{$palette:"stroke"}],fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:n.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:n.n1.FILL_IMAGE_DEFAULTS,label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"}},dropOff:{enabled:!0,fillOpacity:.2,strokeWidth:0},shadow:{enabled:!1,color:aw,xOffset:3,yOffset:3,blur:5}},axes:{[rw.NUMBER]:{nice:!1,gridLine:{enabled:!1},crosshair:{enabled:!1},label:{enabled:!1,formatter:e=>Math.abs(e.value).toFixed(e.fractionDigits??0)}},[rw.CATEGORY]:{line:{enabled:!1}}}},{lineDistanceSquared:hw,BBox:uw,Path:dw,SceneChangeDetection:pw}=n.n1,gw=1e-6;function fw([e,t],[i,n]){return Math.abs(e-i)<=gw&&Math.abs(t-n)<=gw}var mw=class extends dw{constructor(){super(...arguments),this.x0=0,this.y0=0,this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.x3=0,this.y3=0}get midPoint(){const{x0:e,y0:t,x1:i,y1:n,x2:s,y2:r,x3:o,y3:a}=this;return{x:(e+i+s+o)/4,y:(t+n+r+a)/4}}distanceSquared(e,t){if(this.containsPoint(e,t))return 0;const{x0:i,y0:n,x1:s,y1:r,x2:o,y2:a,x3:l,y3:c}=this;return Math.min(hw(e,t,i,n,s,r,1/0),hw(e,t,s,r,o,a,1/0),hw(e,t,o,a,l,c,1/0),hw(e,t,l,c,i,n,1/0))}computeBBox(){const{x0:e,y0:t,x1:i,y1:n,x2:s,y2:r,x3:o,y3:a}=this,l=Math.min(e,i,s,o),c=Math.max(e,i,s,o)-l,h=Math.min(t,n,r,a),u=Math.max(t,n,r,a)-h;return new uw(l,h,c,u)}updatePath(){const{path:e,x0:t,y0:i,x1:n,y1:s,x2:r,y2:o,x3:a,y3:l}=this,c=[[t,i],[n,s],[r,o],[a,l]];let h,u;e.clear(),c.forEach(t=>{if(null!=h&&fw(h,t)||null!=u&&fw(u,t))return;const[i,n]=t;null==h?e.moveTo(i,n):e.lineTo(i,n),h??(h=t),u=t}),e.closePath()}};a([pw()],mw.prototype,"x0",2),a([pw()],mw.prototype,"y0",2),a([pw()],mw.prototype,"x1",2),a([pw()],mw.prototype,"y1",2),a([pw()],mw.prototype,"x2",2),a([pw()],mw.prototype,"y2",2),a([pw()],mw.prototype,"x3",2),a([pw()],mw.prototype,"y3",2);var{NODE_UPDATE_STATE_TO_PHASE_MAPPING:yw}=n.n1;function vw(e,t,i,n){const{x0:s,y0:r,x1:o,y1:a,x2:l,y2:c,x3:h,y3:u,opacity:d}=e;return i?{x0:(s+h)/2,y0:(r+u)/2,x1:(o+l)/2,y1:(a+c)/2,x2:(o+l)/2,y2:(a+c)/2,x3:(s+h)/2,y3:(r+u)/2,opacity:d}:{x0:(s+o)/2,y0:(r+a)/2,x1:(s+o)/2,y1:(r+a)/2,x2:(l+h)/2,y2:(c+u)/2,x3:(l+h)/2,y3:(c+u)/2,opacity:d}}function bw(e,t){const{x0:i,y0:n,x1:s,y1:r,x2:o,y2:a,x3:l,y3:c,opacity:h}=t;return{x0:i,y0:n,x1:s,y1:r,x2:o,y2:a,x3:l,y3:c,opacity:h}}var{SeriesNodePickMode:Cw,SeriesZIndexMap:ww,valueProperty:Sw,keyProperty:xw,ChartAxisDirection:Ew,updateLabelNode:Aw,SMALLEST_KEY_INTERVAL:Mw,LARGEST_KEY_INTERVAL:Tw,diff:Dw,fixNumericExtent:Iw,seriesLabelFadeInAnimation:Rw,resetMotion:kw,resetLabelFn:Pw,animationValidation:_w,computeBarFocusBounds:Lw,ContinuousScale:Nw,Group:Ow,Selection:Fw,PointerEvents:Gw,motion:Bw,checkCrisp:Vw,createDatumId:Hw,applyShapeStyle:Uw,getShapeStyle:zw,getShapeFill:Ww}=n.n1,jw=class extends n.n1.SeriesNodeEvent{constructor(e,t,i,n){super(e,t,i,n),this.xKey=n.properties.stageKey,this.yKey=n.properties.valueKey}},$w=class extends n.n1.AbstractBarSeries{constructor({moduleCtx:e,animationResetFns:t}){super({moduleCtx:e,pickModes:[Cw.AXIS_ALIGNED,Cw.EXACT_SHAPE_MATCH],hasHighlightedLabels:!0,directionKeys:{x:["stageKey"],y:["valueKey"]},directionNames:{x:[],y:[]},categoryKey:"xValue",datumSelectionGarbageCollection:!1,animationResetFns:{datum:t.datum,label:Pw}}),this.NodeEvent=jw,this.connectorNodeGroup=this.contentGroup.appendChild(new Ow({name:`${this.id}-series-connectorNodes`,zIndex:ww.BACKGROUND})),this.connectorSelection=Fw.select(this.connectorNodeGroup,()=>this.connectionFactory()),this.connectorNodeGroup.pointerEvents=Gw.None}get pickModeAxis(){return"main-category"}setSeriesIndex(e){return!!super.setSeriesIndex(e)&&(this.connectorNodeGroup.zIndex=[ww.BACKGROUND,e],!0)}isVertical(){return!super.isVertical()}connectionFactory(){return new mw}async processData(e){const{stageKey:t,valueKey:i}=this.properties,{visible:n,id:s}=this,r=this.getCategoryAxis()?.scale,o=this.getValueAxis()?.scale,{isContinuousX:a,xScaleType:l,yScaleType:c}=this.getScaleInformation({xScale:r,yScale:o}),h=[];this.ctx.animationManager.isSkipped()||(this.processedData&&h.push(Dw(this.id,this.processedData)),h.push(_w()));const u=this.visible?{}:{forceValue:0},{processedData:d}=await this.requestDataModel(e,this.data,{props:[xw(t,l,{id:"xValue"}),Sw(i,c,{id:"yValue",...u,validation:(e,t,i)=>n&&this.ctx.legendManager.getItemEnabled({seriesId:s,itemId:i}),invalidValue:0}),...a?[Mw,Tw]:[],...h],groupByKeys:!1});this.smallestDataInterval=d.reduced?.smallestKeyInterval,this.largestDataInterval=d.reduced?.largestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(e){const{processedData:t,dataModel:i,id:n,ctx:{legendManager:s}}=this;if(!t||!i)return[];const{keys:[r]}=t.domain;if(e===this.getCategoryDirection()){const e=i.resolveProcessedDataDefById(this,"xValue");return"key"===e?.def.type&&"category"===e?.def.valueType?this.hasData?r.filter((e,t)=>s.getItemEnabled({seriesId:n,itemId:t})):[]:this.padBandExtent(r)}{const t=this.domainForClippedRange(e,["yValue"],"xValue",!0),i=Math.max(...t);return Iw([-i,i])}}getSeriesRange(e,t){return[NaN,NaN]}createNodeData(){const{hasData:e,data:t,dataModel:i,groupScale:n,processedData:s,id:r,ctx:{legendManager:o}}=this,a=this.getCategoryAxis(),l=this.getValueAxis();if(!(e&&t&&a&&l&&i&&"ungrouped"===s?.type))return;const c=a.scale,h=l.scale,u=this.getBarDirection()===Ew.X,{stageKey:d,valueKey:p}=this.properties,{strokeWidth:g}=this.barStyle(),f=`${p}`,m={itemId:f,nodeData:[],labelData:[],connectorData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.groupScale),visible:this.visible},y=this.visible;if(!y)return m;const v=i.resolveKeysById(this,"xValue",s),b=i.resolveColumnById(this,"yValue",s),{barWidth:C,groupIndex:w}=this.updateGroupScale(a),S=Nw.is(c)?-.5*C:0,x=Vw(a?.scale,a?.visibleRange,this.smallestDataInterval,this.largestDataInterval);let E;return(s.dataSources.get(this.id)??[]).forEach((e,t)=>{const i=y&&o.getItemEnabled({seriesId:r,itemId:t}),s=v[t];if(null==s)return;const a=Math.round(c.convert(s))+n.convert(String(w))+S,l=b[t],A=Math.round(h.convert(-l)),M=Math.round(h.convert(l)),T=Math.max(g,Math.abs(M-A)),D={x:u?Math.min(M,A):a,y:u?a:Math.min(M,A),width:u?T:C,height:u?C:T},I={x:D.x+D.width/2,y:D.y+D.height/2},R=this.createLabelData({datumIndex:t,rect:D,barAlongX:u,yDatum:l,datum:e,visible:i}),k={index:t,series:this,itemId:f,datum:e,datumIndex:t,xValue:s,yValue:l,xKey:d,yKey:p,x:D.x,y:D.y,width:D.width,height:D.height,midPoint:I,strokeWidth:g,crisp:x,label:R,visible:i};if(m.nodeData.push(k),null!=R&&m.labelData.push(R),null!=E){const e=E.rect,t=E.nodeDatum,i=E.datumIndex;u?m.connectorData.push({datum:t,datumIndex:i,x0:e.x,y0:e.y+e.height,x1:e.x+e.width,y1:e.y+e.height,x2:D.x+D.width,y2:D.y,x3:D.x,y3:D.y,opacity:1}):m.connectorData.push({datum:t,datumIndex:i,x0:e.x+e.width,y0:e.y,x1:D.x,y1:D.y,x2:D.x,y2:D.y+D.height,x3:e.x+e.width,y3:e.y+e.height,opacity:1})}i&&(E={itemId:f,rect:D,nodeDatum:k,datumIndex:t})}),m}updateNodes(e,t,i){super.updateNodes(e,t,i);const{connectorSelection:n}=this,s=this.contextNodeData?.connectorData??[];this.connectorSelection=this.updateConnectorSelection({connectorSelection:n,connectorData:s}),this.updateConnectorNodes({connectorSelection:n})}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,n=t??[];return i.update(n,void 0,e=>this.getDatumId(e))}updateConnectorSelection(e){const{connectorData:t,connectorSelection:i}=e;return i.update(this.connectorEnabled()?t:[],void 0,e=>this.getDatumId(e.datum))}updateConnectorNodes(e){const{fills:t,strokes:i,fillGradientDefaults:n,fillPatternDefaults:s,fillImageDefaults:r}=this.properties,{fill:o,fillOpacity:a,stroke:l,strokeOpacity:c,strokeWidth:h,lineDash:u,lineDashOffset:d}=this.connectorStyle(),p=this.getShapeFillBBox();e.connectorSelection.each((e,g)=>{const{datumIndex:f}=g;e.setProperties(bw(0,g));const m=Ww(o??t[f%t.length],n,s,r);Uw(e,{fill:m,stroke:l??i[f%i.length],fillOpacity:a,strokeOpacity:c,strokeWidth:h,lineDash:u,lineDashOffset:d},void 0,p)})}getHighlightLabelData(e,t){const i=e.filter(e=>e.datum===t.datum);return i.length>0?i:void 0}updateLabelSelection(e){const t=this.properties.label.enabled?e.labelData:[];return e.labelSelection.update(t,e=>{e.pointerEvents=Gw.None})}updateLabelNodes(e){e.labelSelection.each((e,t)=>{Aw(e,this.properties.label,t)})}getTooltipContent(e){const{id:t,dataModel:i,processedData:n,properties:s}=this,{stageKey:r,valueKey:o,tooltip:a}=s,l=this.getCategoryAxis(),c=this.getValueAxis();if(!(i&&n&&l&&c))return;const h=n.dataSources.get(this.id)?.[e],u=i.resolveKeysById(this,"xValue",n)[e],d=i.resolveColumnById(this,"yValue",n)[e];return null!=u?this.formatTooltipWithContext(a,{symbol:this.legendItemSymbol(e),data:[{label:l.formatDatum(u),value:c.formatDatum(d)}]},{seriesId:t,datum:h,title:r,stageKey:r,valueKey:o,...this.tooltipStyle(h,e)}):void 0}resetAllAnimation(e){super.resetAllAnimation(e),kw([this.connectorSelection],bw)}animateEmptyUpdateReady({labelSelection:e}){const{connectorSelection:t}=this,i=function(e){const t=e=>null==e;return{fromFn:(i,n,s)=>{let r;"updated"===s&&t(n)?s="removed":"updated"===s&&t(i.previousDatum)&&(s="added"),"added"===s&&i.previousDatum,r="unknown"===s||"added"===s?vw(n,i.previousDatum,e):{x0:i.x0,y0:i.y0,x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2,x3:i.x3,y3:i.y3,opacity:i.opacity};const o=yw[s];return{...r,phase:o}},toFn:(i,n,s)=>{let r;return"removed"===s&&i.datum,r="removed"===s||t(n)?vw(n,i.previousDatum,e):bw(0,n),r}}}(this.isVertical());Bw.fromToMotion(this.id,"connectors",this.ctx.animationManager,[t],i),Rw(this,"labels",this.ctx.animationManager,e)}animateWaitingUpdateReady(e){const{labelSelection:t}=e;this.ctx.animationManager.stopByAnimationGroupId(this.id),Rw(this,"labels",this.ctx.animationManager,t)}getDatumId(e){return Hw(e.xValue)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e}){return Lw(this,this.contextNodeData?.nodeData[e])}legendItemSymbol(e){const{strokeWidth:t,fillOpacity:i,strokeOpacity:n,lineDash:s,lineDashOffset:r,fillGradientDefaults:o,fillPatternDefaults:a,fillImageDefaults:l}=this.barStyle(),{fills:c,strokes:h}=this.properties,u=c[e%c.length]??"black",d=h[e%h.length]??"black";return{marker:zw({fill:u,fillOpacity:i,stroke:d,strokeWidth:t,strokeOpacity:n,lineDash:s,lineDashOffset:r},o,a,l)}}getLegendData(e){const{id:t,processedData:i,dataModel:n,ctx:{legendManager:s},visible:r}=this;if(!n||!i||"category"!==e)return[];const{showInLegend:o}=this.properties,a=n.resolveKeysById(this,"xValue",i);return(i.dataSources.get(this.id)??[]).map((e,i)=>{const n=a[i];if(null!=n)return{legendType:"category",id:t,datum:e,itemId:i,seriesId:t,enabled:r&&s.getItemEnabled({seriesId:t,itemId:i}),label:{text:String(n)},symbol:this.legendItemSymbol(i),skipAnimations:!0,hideInLegend:!o}}).filter(e=>null!=e)}},{FillGradientDefaults:Kw,FillPatternDefaults:Yw,FillImageDefaults:qw,Label:Xw,AbstractBarSeriesProperties:Zw,SeriesTooltip:Qw,AxisLabel:Jw,Property:eS}=n.n1,tS=class extends Xw{constructor(){super(...arguments),this.spacing=0}};a([eS],tS.prototype,"placement",2),a([eS],tS.prototype,"spacing",2);var iS=class extends Jw{};a([eS],iS.prototype,"placement",2);var nS=class extends Zw{constructor(){super(...arguments),this.fills=[],this.fillGradientDefaults=new Kw,this.fillPatternDefaults=new Yw,this.fillImageDefaults=new qw,this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.label=new tS,this.stageLabel=new iS,this.tooltip=new Qw}};function sS(e,{x:t,y:i,width:n,height:s,opacity:r}){return{x1:t,y1:i,x2:t+n,y2:i+s,opacity:r}}a([eS],nS.prototype,"stageKey",2),a([eS],nS.prototype,"valueKey",2),a([eS],nS.prototype,"fills",2),a([eS],nS.prototype,"fillGradientDefaults",2),a([eS],nS.prototype,"fillPatternDefaults",2),a([eS],nS.prototype,"fillImageDefaults",2),a([eS],nS.prototype,"fillOpacity",2),a([eS],nS.prototype,"strokes",2),a([eS],nS.prototype,"strokeWidth",2),a([eS],nS.prototype,"strokeOpacity",2),a([eS],nS.prototype,"lineDash",2),a([eS],nS.prototype,"lineDashOffset",2),a([eS],nS.prototype,"label",2),a([eS],nS.prototype,"stageLabel",2),a([eS],nS.prototype,"tooltip",2);var{formatValue:rS,Line:oS}=n.n1,aS=class extends $w{constructor(e){super({moduleCtx:e,animationResetFns:{datum:sS}}),this.properties=new nS}get hasData(){const{id:e,ctx:{legendManager:t}}=this,i=this.data?.reduce((i,n,s)=>i+(t.getItemEnabled({seriesId:e,itemId:s})?1:0),0);return null!=i&&i>1}getBandScalePadding(){return{inner:1,outer:0}}connectorEnabled(){return!0}barStyle(){return{fillOpacity:1,strokeOpacity:1,strokeWidth:0,lineDash:[],lineDashOffset:0,fillGradientDefaults:this.properties.fillGradientDefaults,fillPatternDefaults:this.properties.fillPatternDefaults,fillImageDefaults:this.properties.fillImageDefaults}}connectorStyle(){const{fillOpacity:e,strokeOpacity:t,strokeWidth:i,lineDash:n,lineDashOffset:s,fillGradientDefaults:r,fillPatternDefaults:o,fillImageDefaults:a}=this.properties;return{fillOpacity:e,strokeOpacity:t,strokeWidth:i,lineDash:n,lineDashOffset:s,fillGradientDefaults:r,fillPatternDefaults:o,fillImageDefaults:a}}nodeFactory(){return new oS}createLabelData({datumIndex:e,rect:t,barAlongX:i,yDatum:n,datum:s,visible:r}){const{stageKey:o,valueKey:a,label:l}=this.properties,{spacing:c,placement:h}=l;let u,d,p,g;if(i)switch(u=t.x+t.width/2,p="center",h){case"before":d=t.y-c,g="bottom";break;case"after":d=t.y+t.height+c,g="top";break;default:d=t.y+t.height/2,g="middle"}else switch(d=t.y+t.height/2,g="middle",h){case"before":u=t.x-c,p="right";break;case"after":u=t.x+t.width+c,p="left";break;default:u=t.x+t.width/2,p="center"}return{x:u,y:d,textAlign:p,textBaseline:g,text:this.getLabelText(l,{itemId:a,value:n,datum:s,stageKey:o,valueKey:a},e=>rS(e,0)),itemId:a,datum:s,datumIndex:e,series:this,visible:r}}updateDatumNodes(e){const t=e.isHighlight?this.properties.highlightStyle.item:void 0;e.datumSelection.each((e,i)=>{e.setProperties(sS(0,i)),e.stroke=t?.stroke,e.strokeWidth=t?.strokeWidth??0,e.strokeOpacity=t?.strokeOpacity??1,e.lineDash=t?.lineDash,e.lineDashOffset=t?.lineDashOffset??0})}tooltipStyle(e,t){const{fills:i,strokes:n}=this.properties,s=i[t%i.length]??"black",r=n[t%n.length]??"black",{fillOpacity:o,strokeOpacity:a,strokeWidth:l,lineDash:c,lineDashOffset:h}=this.barStyle();return{fill:s,fillOpacity:o,stroke:r,strokeOpacity:a,strokeWidth:l,lineDash:c,lineDashOffset:h}}};aS.className="ConeFunnelSeries",aS.type="cone-funnel";var{commonSeriesOptionsDefs:lS,coneFunnelSeriesThemeableOptionsDef:cS}=n.n1,hS={...cS,...lS,type:(0,s.mw)((0,s.dY)("cone-funnel")),stageKey:(0,s.mw)(s.Yj),valueKey:(0,s.mw)(s.Yj)},{ThemeConstants:{CARTESIAN_AXIS_TYPE:uS}}=n.n1,dS={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"cone-funnel",moduleFactory:e=>new aS(e),solo:!0,tooltipDefaults:{range:"nearest"},defaultAxes:lw,themeTemplate:{series:{direction:"vertical",fills:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"secondSequentialColors"},n.n1.SAFE_RANGE2_OPERATION]},strokes:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"secondSequentialColors"},n.n1.SAFE_RANGE2_OPERATION]},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:n.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:n.n1.FILL_IMAGE_DEFAULTS,strokeWidth:0,label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},placement:"before",spacing:4}},seriesArea:{padding:{top:20,bottom:20}},axes:{[uS.NUMBER]:{nice:!1,gridLine:{enabled:!1},crosshair:{enabled:!1},label:{enabled:!1,formatter:e=>Math.abs(e.value).toFixed(e.fractionDigits??0)}},[uS.CATEGORY]:{line:{enabled:!1}}}}},pS={type:"series",name:"cone-funnel",chartType:"cartesian",enterprise:!0,options:hS,create:e=>new aS(e)},{FillGradientDefaults:gS,FillPatternDefaults:fS,FillImageDefaults:mS,Label:yS,DropShadow:vS,AbstractBarSeriesProperties:bS,BaseProperties:CS,SeriesTooltip:wS,AxisLabel:SS,Property:xS}=n.n1,ES=class extends yS{},AS=class extends SS{};a([xS],AS.prototype,"placement",2);var MS=class extends CS{constructor(){super(...arguments),this.enabled=!0,this.fill=void 0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};a([xS],MS.prototype,"enabled",2),a([xS],MS.prototype,"fill",2),a([xS],MS.prototype,"fillOpacity",2),a([xS],MS.prototype,"stroke",2),a([xS],MS.prototype,"strokeWidth",2),a([xS],MS.prototype,"strokeOpacity",2),a([xS],MS.prototype,"lineDash",2),a([xS],MS.prototype,"lineDashOffset",2);var TS=class extends bS{constructor(){super(...arguments),this.fills=[],this.fillGradientDefaults=new gS,this.fillPatternDefaults=new fS,this.fillImageDefaults=new mS,this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.spacingRatio=0,this.dropOff=new MS,this.shadow=(new vS).set({enabled:!1}),this.label=new ES,this.stageLabel=new AS,this.tooltip=new wS}};a([xS],TS.prototype,"stageKey",2),a([xS],TS.prototype,"valueKey",2),a([xS],TS.prototype,"fills",2),a([xS],TS.prototype,"fillGradientDefaults",2),a([xS],TS.prototype,"fillPatternDefaults",2),a([xS],TS.prototype,"fillImageDefaults",2),a([xS],TS.prototype,"fillOpacity",2),a([xS],TS.prototype,"strokes",2),a([xS],TS.prototype,"strokeWidth",2),a([xS],TS.prototype,"strokeOpacity",2),a([xS],TS.prototype,"lineDash",2),a([xS],TS.prototype,"lineDashOffset",2),a([xS],TS.prototype,"spacingRatio",2),a([xS],TS.prototype,"itemStyler",2),a([xS],TS.prototype,"dropOff",2),a([xS],TS.prototype,"shadow",2),a([xS],TS.prototype,"label",2),a([xS],TS.prototype,"stageLabel",2),a([xS],TS.prototype,"tooltip",2);var{ChartAxisDirection:DS,resetBarSelectionsFn:IS,prepareBarAnimationFunctions:RS,midpointStartingBarPosition:kS,createDatumId:PS,formatValue:_S,Rect:LS,motion:NS,applyShapeStyle:OS,getShapeStyle:FS}=n.n1,GS=class extends $w{constructor(e){super({moduleCtx:e,animationResetFns:{datum:IS}}),this.properties=new TS}getBandScalePadding(){return{inner:this.properties.spacingRatio,outer:0}}connectorEnabled(){return this.properties.dropOff.enabled}barStyle(){const{fillOpacity:e,strokeOpacity:t,strokeWidth:i,lineDash:n,lineDashOffset:s,fillGradientDefaults:r,fillPatternDefaults:o,fillImageDefaults:a}=this.properties;return{fillOpacity:e,strokeOpacity:t,strokeWidth:i,lineDash:n,lineDashOffset:s,fillGradientDefaults:r,fillPatternDefaults:o,fillImageDefaults:a}}connectorStyle(){const{fill:e,fillOpacity:t,stroke:i,strokeOpacity:n,strokeWidth:s,lineDash:r,lineDashOffset:o}=this.properties.dropOff;return{fill:e,fillOpacity:t,stroke:i,strokeOpacity:n,strokeWidth:s,lineDash:r,lineDashOffset:o,fillGradientDefaults:this.properties.fillGradientDefaults,fillPatternDefaults:this.properties.fillPatternDefaults,fillImageDefaults:this.properties.fillImageDefaults}}nodeFactory(){return new LS}createLabelData({datumIndex:e,rect:t,yDatum:i,datum:n,visible:s}){const{valueKey:r,stageKey:o,label:a}=this.properties;return{x:t.x+t.width/2,y:t.y+t.height/2,textAlign:"center",textBaseline:"middle",text:this.getLabelText(a,{itemId:o,value:i,datum:n,valueKey:r,stageKey:o},e=>_S(e,0)),itemId:o,datum:n,datumIndex:e,series:this,visible:s}}getItemBaseStyle(e){const{properties:t}=this,i=e?t.highlightStyle.item:void 0;return FS({fill:i?.fill,fillOpacity:i?.fillOpacity??t.fillOpacity,stroke:i?.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(t.strokeWidth),strokeOpacity:i?.strokeOpacity??t.strokeOpacity,lineDash:i?.lineDash??t.lineDash,lineDashOffset:i?.lineDashOffset??t.lineDashOffset},t.fillGradientDefaults,t.fillPatternDefaults,t.fillImageDefaults)}getItemStyleOverrides(e,t,i,n,s){const{id:r,properties:o}=this,{stageKey:a,valueKey:l,fills:c,strokes:h,itemStyler:u}=o,d=n.fill??c[i%c.length]??"black",p=n.stroke??h[i%h.length]??"black",g={};if(s||(g.fill=d,g.stroke=p),null!=u){const i=this.cachedDatumCallback(PS(e,s?"highlight":"node"),()=>{const{fillOpacity:e,strokeOpacity:i,strokeWidth:o,lineDash:c,lineDashOffset:h}=n;return this.callWithContext(u,{seriesId:r,datum:t,highlighted:s,stageKey:a,valueKey:l,fill:d,fillOpacity:e,stroke:p,strokeOpacity:i,strokeWidth:o,lineDash:c,lineDashOffset:h})});Object.assign(g,i)}return FS(g,o.fillGradientDefaults,o.fillPatternDefaults,o.fillImageDefaults)}updateDatumNodes(e){const{shadow:t}=this.properties,{datumSelection:i,isHighlight:n}=e,s=this.getCategoryDirection()===DS.X,r=this.getItemBaseStyle(n),o=this.getShapeFillBBox();i.each((e,i)=>{const{datumIndex:a}=i,l=this.getItemStyleOverrides(String(i.datumIndex),i.datum,a,r,n);OS(e,r,l,o),e.visible=s?i.width>0:i.height>0,e.crisp=i.crisp,e.fillShadow=t})}tooltipStyle(e,t){const i=this.getItemBaseStyle(!1);return Object.assign(i,this.getItemStyleOverrides(String(t),e,t,i,!1)),i}animateEmptyUpdateReady(e){super.animateEmptyUpdateReady(e);const{datumSelection:t}=e,i=this.isVertical(),n=RS(kS(i,"normal"));NS.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],n)}animateWaitingUpdateReady(e){super.animateWaitingUpdateReady(e);const{datumSelection:t}=e,{processedData:i}=this,n=i?.reduced?.diff?.[this.id],s=RS(kS(this.isVertical(),"fade"));NS.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],s,(e,t)=>t.xValue,n)}};GS.className="FunnelSeries",GS.type="funnel";var{commonSeriesOptionsDefs:BS,funnelSeriesThemeableOptionsDef:VS}=n.n1,HS={...VS,...BS,type:(0,s.mw)((0,s.dY)("funnel")),stageKey:(0,s.mw)(s.Yj),valueKey:(0,s.mw)(s.Yj)},US={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"funnel",moduleFactory:e=>new GS(e),solo:!0,tooltipDefaults:{range:"exact"},defaultAxes:lw,themeTemplate:cw},zS={type:"series",name:"funnel",chartType:"cartesian",enterprise:!0,options:HS,create:e=>new GS(e)},WS=class{*[Symbol.iterator](){const{node:e,datum:t}=this;e&&t&&(yield{node:e,datum:t})}nodes(){return this.node?[this.node]:[]}update(e,t,i,n){const s=e.nodes();if(0===s.length)this.node?.remove(),this.node=void 0;else{void 0===this.node&&(this.node=new i,this.node.fillOpacity=0,this.node.strokeOpacity=0,t.appendChild(this.node));const e=s[0],r=s.toReversed().find(e=>e.datum.datum.value>e.datum.datum.segmentStart)??s[s.length-1];this.node.datum=this.datum=e.datum,n(this.node,e,r)}}},jS={fromFn:()=>({opacity:0,phase:"initial"}),toFn:()=>({opacity:1})};function $S(e,t){if(null==e)return"";const{min:i,max:n}=t,s=0!==i?Math.ceil(Math.log10(Math.abs(i))):0,r=0!==n?Math.ceil(Math.log10(Math.abs(n))):0,o=Math.max(2-Math.max(s,r),0);return e.toFixed(o)}function KS(e,t,i,n){if(null!=i.text)return i.text;const s=n??i.value;let r;return null!=i?.formatter&&(r=YS(t,i.formatter,{seriesId:e,datum:void 0,value:s})),null!=r?String(r):void 0}function YS(e,t,i){return n.n1.callWithContext(e.chartService,void 0,t,[i])}function qS({path:e,x:t,y:i,size:n}){e.moveTo(t,i-n/2),e.lineTo(t,i+n/2)}function XS(e,t){const i=(0,s.nl)(e.datumUnion.nodes(),e.targetSelection.nodes());return e.pickNodeNearestDistantObject(t,i)}function ZS(e,t){const i=[{data:e.contextNodeData?.nodeData,selection:e.datumUnion},{data:e.contextNodeData?.targetData,selection:e.targetSelection}].filter(e=>e.data&&e.data.length>0),n=(0,s.qE)(0,t.otherIndex+t.otherIndexDelta,i.length-1);if(0===i.length)return;const{data:r,selection:o}=i[n];if(null==r||0===r.length)return;const a=(0,s.qE)(0,t.datumIndex,r.length-1),l=r[a];for(const e of o)if(e.datum===l)return{bounds:e.node,clipFocusBox:!0,datum:l,datumIndex:a,otherIndex:n}}var{BaseProperties:QS,Property:JS}=n.n1,ex=class extends QS{getSegments(e,t){const{values:i,step:n,count:r}=this,o=Math.min(...e.domain),a=Math.max(...e.domain);let l;if(null!=i){const e=i.filter(e=>e>o&&e<a).sort((e,t)=>e-t);l=[o,...e,a]}else if(null!=n){const e=[];for(let t=o;t<a;t+=n)e.push(t);e.push(a),l=e}else if(null!=r){const e=r+1;l=Array.from({length:e+1},(t,i)=>i/e*(a-o)+o)}else{const t=e.ticks({nice:!0,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.ticks?.filter(e=>e>o&&e<a);l=null!=t?[o,...t,a]:void 0}return null!=l&&l.length>t&&(s.Vy.warnOnce("the configured segmentation results in more than 1 item per pixel, ignoring. Supply a segmentation configuration that results in larger segments or omit this configuration"),l=void 0),l??(l=[o,a]),l}};a([JS],ex.prototype,"values",2),a([JS],ex.prototype,"step",2),a([JS],ex.prototype,"count",2);var tx=class extends QS{constructor(){super(...arguments),this.enabled=!1,this.interval=new ex,this.spacing=0}};a([JS],tx.prototype,"enabled",2),a([JS],tx.prototype,"interval",2),a([JS],tx.prototype,"spacing",2);var{BaseProperties:ix,SeriesTooltip:nx,SeriesProperties:sx,PropertiesArray:rx,Property:ox,Label:ax,AxisLabel:lx}=n.n1,cx=class extends ax{};a([ox],cx.prototype,"spacing",2);var hx=class extends ix{constructor(){super(...arguments),this.value=0,this.label=new cx}};a([ox],hx.prototype,"text",2),a([ox],hx.prototype,"value",2),a([ox],hx.prototype,"shape",2),a([ox],hx.prototype,"placement",2),a([ox],hx.prototype,"spacing",2),a([ox],hx.prototype,"size",2),a([ox],hx.prototype,"rotation",2),a([ox],hx.prototype,"fill",2),a([ox],hx.prototype,"fillOpacity",2),a([ox],hx.prototype,"stroke",2),a([ox],hx.prototype,"strokeWidth",2),a([ox],hx.prototype,"strokeOpacity",2),a([ox],hx.prototype,"lineDash",2),a([ox],hx.prototype,"lineDashOffset",2),a([ox],hx.prototype,"label",2);var ux=class extends ix{constructor(){super(...arguments),this.enabled=!0,this.thicknessRatio=1,this.fills=new rx(n.n1.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};a([ox],ux.prototype,"enabled",2),a([ox],ux.prototype,"thickness",2),a([ox],ux.prototype,"thicknessRatio",2),a([ox],ux.prototype,"fills",2),a([ox],ux.prototype,"fillMode",2),a([ox],ux.prototype,"fill",2),a([ox],ux.prototype,"fillOpacity",2),a([ox],ux.prototype,"stroke",2),a([ox],ux.prototype,"strokeWidth",2),a([ox],ux.prototype,"strokeOpacity",2),a([ox],ux.prototype,"lineDash",2),a([ox],ux.prototype,"lineDashOffset",2);var dx=class extends ix{constructor(){super(...arguments),this.values=void 0,this.step=void 0,this.minSpacing=0,this.maxSpacing=1e3}};a([ox],dx.prototype,"values",2),a([ox],dx.prototype,"step",2),a([ox],dx.prototype,"minSpacing",2),a([ox],dx.prototype,"maxSpacing",2);var px=class extends lx{constructor(){super(...arguments),this.placement=void 0}};a([ox],px.prototype,"placement",2);var gx=class extends ix{constructor(){super(...arguments),this.min=0,this.max=1,this.fills=new rx(n.n1.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.defaultFill="black",this.interval=new dx,this.label=new px}};a([ox],gx.prototype,"min",2),a([ox],gx.prototype,"max",2),a([ox],gx.prototype,"fills",2),a([ox],gx.prototype,"fillMode",2),a([ox],gx.prototype,"fill",2),a([ox],gx.prototype,"fillOpacity",2),a([ox],gx.prototype,"stroke",2),a([ox],gx.prototype,"strokeWidth",2),a([ox],gx.prototype,"strokeOpacity",2),a([ox],gx.prototype,"lineDash",2),a([ox],gx.prototype,"lineDashOffset",2),a([ox],gx.prototype,"defaultFill",2),a([ox],gx.prototype,"interval",2),a([ox],gx.prototype,"label",2);var fx=class extends cm{constructor(){super(...arguments),this.placement="inside-center",this.avoidCollisions=!0}};a([ox],fx.prototype,"text",2),a([ox],fx.prototype,"placement",2),a([ox],fx.prototype,"avoidCollisions",2);var mx=class extends sx{constructor(){super(...arguments),this.value=0,this.segmentation=new tx,this.defaultColorRange=[],this.targets=new rx(hx),this.defaultTarget=new hx,this.defaultScale=new gx,this.direction="vertical",this.thickness=1,this.cornerRadius=0,this.cornerMode="container",this.margin=0,this.scale=new gx,this.bar=new ux,this.label=new fx,this.tooltip=new nx}};a([ox],mx.prototype,"value",2),a([ox],mx.prototype,"segmentation",2),a([ox],mx.prototype,"defaultColorRange",2),a([ox],mx.prototype,"targets",2),a([ox],mx.prototype,"defaultTarget",2),a([ox],mx.prototype,"defaultScale",2),a([ox],mx.prototype,"direction",2),a([ox],mx.prototype,"thickness",2),a([ox],mx.prototype,"cornerRadius",2),a([ox],mx.prototype,"cornerMode",2),a([ox],mx.prototype,"margin",2),a([ox],mx.prototype,"scale",2),a([ox],mx.prototype,"bar",2),a([ox],mx.prototype,"label",2),a([ox],mx.prototype,"tooltip",2);var{CachedTextMeasurerPool:yx,BBox:vx}=n.n1;function bx(e){const{x0:t,y0:i,x1:n,y1:s,horizontalInset:r,verticalInset:o}=e;return{x:Math.min(t,n)+r,y:Math.min(i,s)+o,width:Math.max(Math.abs(n-t)-2*r,0),height:Math.max(Math.abs(s-i)-2*o,0)}}function Cx(e){const{clipX0:t,clipX1:i,clipY0:n,clipY1:s}=e;return null!=t&&null!=i||null!=n&&null!=s}function wx(e,t){const i=e?"initial":"update";return{node:{fromFn(n,s){const r=n.previousDatum;let{x0:o,y0:a,x1:l,y1:c,clipX0:h,clipY0:u,clipX1:d,clipY1:p}=r??s;const{horizontalInset:g,verticalInset:f}=s,m=null!=r&&Cx(r),y=Cx(s);return m&&y||(!m&&y?(({x0:o,y0:a,x1:l,y1:c,clipX0:h,clipY0:u,clipX1:d,clipY1:p}=s),e&&(t?d=s.clipX0:p=s.clipY0)):m&&!y?(({x0:o,y0:a,x1:l,y1:c}=s),h=void 0,u=void 0,d=void 0,p=void 0):e&&(t?l=o:c=a)),{x0:o,y0:a,x1:l,y1:c,clipX0:h,clipY0:u,clipX1:d,clipY1:p,horizontalInset:g,verticalInset:f,phase:i}},toFn(e,t){const{x0:i,y0:n,x1:s,y1:r,clipX0:o,clipY0:a,clipX1:l,clipY1:c,horizontalInset:h,verticalInset:u}=t;return{x0:i,y0:n,x1:s,y1:r,clipX0:o,clipY0:a,clipX1:l,clipY1:c,horizontalInset:h,verticalInset:u}},applyFn(e,t){e.setProperties(Sx(0,t))}}}}function Sx(e,t){const{x:i,y:n,width:s,height:r}=bx(t),o=function(e){if(!Cx(e))return;const{x0:t,y0:i,x1:n,y1:s}=e,{x:r,y:o,width:a,height:l}=bx(e);let{clipX0:c,clipX1:h,clipY0:u,clipY1:d}=e;null!=c&&null!=h||(c=t,h=n),null!=u&&null!=d||(u=i,d=s);const p=Math.min(c,h),g=Math.min(u,d),f=Math.abs(h-c),m=Math.abs(d-u);return c=Math.max(r,p),u=Math.max(o,g),h=Math.min(r+a,p+f),d=Math.min(o+l,g+m),new vx(Math.min(c,h),Math.min(u,d),Math.abs(h-c),Math.abs(d-u))}(t),a=function(e,t){if(null==t)return!0;const i=bx(e),n=1e-6,s=i.x+n,r=i.y+n,o=i.x+i.width-n,a=i.y+i.height-n,l=t.x,c=t.x+t.width,h=t.y,u=t.y+t.height;return Math.max(s,l)<=Math.min(o,c)&&Math.max(r,h)<=Math.min(a,u)}(t,o);return{x:i,y:n,width:s,height:r,clipBBox:o,visible:a}}var xx={Before:"right",Center:"center",After:"left"},Ex={Before:"top",Center:"middle",After:"bottom"},Ax={Before:-1,Center:-.5,After:0},Mx={Before:0,Center:-.5,After:-1},{fromToMotion:Tx,resetMotion:Dx,SeriesNodePickMode:Ix,StateMachine:Rx,createDatumId:kx,CachedTextMeasurerPool:Px,toRadians:_x,BBox:Lx,Group:Nx,PointerEvents:Ox,Selection:Fx,Rect:Gx,Text:Bx,TransformableText:Vx,Marker:Hx,LinearScale:Ux,AxisTickGenerator:zx,NiceMode:Wx,easing:jx,getColorStops:$x,findRangeExtent:Kx}=n.n1,Yx={before:180,middle:0,after:0},qx={before:90,middle:0,after:-90},Xx=class{constructor(e,t){this.gauge=e,this.ctx=t}get defaultTickMinSpacing(){return 0}get range(){return this.gauge.range}get reverse(){return!1}get scale(){return this.gauge.scale}get label(){return this.gauge.properties.scale.label}get interval(){return this.gauge.properties.scale.interval}formatTick(e,t,i,n,s,r){const{label:o}=this;return this.formatWithContext(e,t,i)??(null!=o.format?r?.(e):void 0)??this.gauge.formatLabel(e)}formatWithContext(e,t,i){let n;return this.label.formatter&&(n=YS(this.ctx,this.label.formatter,{value:e,index:t,domain:i,boundSeries:void 0})),n}inRange(){return!0}},Zx=class extends n.n1.Series{constructor(e){super({moduleCtx:e,useLabelLayer:!0,pickModes:[Ix.EXACT_SHAPE_MATCH,Ix.NEAREST_NODE]}),this.properties=new mx,this.seriesRect=Lx.NaN,this.gaugeRect=Lx.NaN,this.scale=new Ux,this.originX=0,this.originY=0,this.scaleGroup=this.contentGroup.appendChild(new Nx({name:"scaleGroup"})),this.itemGroup=this.contentGroup.appendChild(new Nx({name:"itemGroup"})),this.itemTargetGroup=this.contentGroup.appendChild(new Nx({name:"itemTargetGroup"})),this.itemTargetLabelGroup=this.contentGroup.appendChild(new Nx({name:"itemTargetLabelGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new Nx({name:"itemLabelGroup"})),this.highlightTargetGroup=this.highlightGroup.appendChild(new Nx({name:"itemTargetLabelGroup"})),this.tickGroup=this.contentGroup.appendChild(new Nx({name:"tickGroup"})),this.scaleSelection=Fx.select(this.scaleGroup,()=>this.nodeFactory()),this.datumSelection=Fx.select(this.itemGroup,()=>this.nodeFactory()),this.targetSelection=Fx.select(this.itemTargetGroup,()=>this.markerFactory()),this.targetLabelSelection=Fx.select(this.itemTargetLabelGroup,Bx),this.labelSelection=Fx.select(this.itemLabelGroup,Bx),this.highlightTargetSelection=Fx.select(this.highlightTargetGroup,()=>this.markerFactory()),this.tickSelection=Fx.select(this.tickGroup,Vx),this.datumUnion=new WS,this.axis=new Xx(this,e),this.tickGenerator=new zx(this.axis),this.animationState=new Rx("empty",{empty:{update:{target:"ready",action:()=>this.animateEmptyUpdateReady()},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",resize:()=>this.animateReadyResize(),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:()=>this.animateWaitingUpdateReady()},reset:"empty",skip:"ready"},clearing:{update:{target:"empty"},reset:"empty",skip:"ready"}}),this.scaleGroup.pointerEvents=Ox.None,this.tickGroup.pointerEvents=Ox.None}get range(){return this.horizontal?[0,this.gaugeRect.width]:[0,this.gaugeRect.height]}get horizontal(){return"horizontal"===this.properties.direction}get hasData(){return!0}nodeFactory(){const e=new Gx;return e.crisp=!0,e}markerFactory(){return new Hx}processData(){this.nodeDataRefresh=!0,this.animationState.transition("updateData")}formatLabel(e){return $S(e,this.properties.scale)}createLinearGradient(e,t,i){const{properties:n,horizontal:s}=this,{defaultColorRange:r}=n;return{type:"gradient",gradient:"linear",colorSpace:"oklch",colorStops:$x(t,r,e.domain,i),rotation:s?90:0}}getShapeFillBBox(){const{properties:e,originX:t,originY:i,horizontal:n,scale:s}=this,{thickness:r}=e,o=Kx(s.range);return new Lx(t,i,n?o:r,n?r:o)}getTargets(){const{properties:e}=this,t=e.defaultTarget;return Array.from(e.targets).map(e=>{const{text:i=t.text,value:n=t.value??0,shape:s=t.shape??"triangle",rotation:r=t.rotation??0,strokeWidth:o=t.strokeWidth??0,placement:a=t.placement??"middle",spacing:l=t.spacing??0,size:c=t.size??0,fill:h=t.fill??"black",fillOpacity:u=t.fillOpacity??1,stroke:d=t.stroke??"black",strokeOpacity:p=t.strokeOpacity??1,lineDash:g=t.lineDash??[0],lineDashOffset:f=t.lineDashOffset??0}=e,{enabled:m=t.label.enabled,color:y=t.label.color??"black",fontStyle:v=t.label.fontStyle??"normal",fontWeight:b=t.label.fontWeight??"normal",fontSize:C=t.label.fontSize,fontFamily:w=t.label.fontFamily,spacing:S=t.label.spacing??0}=e.label;return{text:i,value:n,shape:s,placement:a,spacing:l,size:c,rotation:r,fill:h,fillOpacity:u,stroke:d,strokeWidth:o,strokeOpacity:p,lineDash:g,lineDashOffset:f,label:{enabled:m,color:y,fontStyle:v,fontWeight:b,fontSize:C,fontFamily:w,spacing:S}}})}getTargetPoint(e){const{properties:t,originX:i,originY:n,horizontal:s,scale:r,gaugeRect:o}=this,{thickness:a}=t,{value:l,placement:c,spacing:h,size:u}=e,d=r.convert(l);let p;switch(c){case"before":p=-(h+u/2);break;case"after":p=a+h+u/2;break;default:p=a/2}return{x:i+o.x+(s?d:p),y:n+o.y+(s?p:d)}}getTargetLabel(e){const{size:t,placement:i,label:n}=e,{spacing:s,color:r,fontStyle:o,fontWeight:a,fontSize:l,fontFamily:c}=n,h=t/2+s;let u,d,p=0,g=0;return this.horizontal?(u="center","after"===i?(d="top",g=h):(d="bottom",g=-h)):(d="middle","before"===i?(u="right",p=-h):(u="left",p=h)),{offsetX:p,offsetY:g,fill:r,textAlign:u,textBaseline:d,fontStyle:o,fontWeight:a,fontSize:l,fontFamily:c,lineHeight:void 0}}labelDatum(e,t){const{placement:i,avoidCollisions:n,spacing:s,text:r,color:o,fontSize:a,minimumFontSize:l,fontStyle:c,fontWeight:h,fontFamily:u,lineHeight:d,wrapping:p,overflowStrategy:g,formatter:f=e=>this.formatLabel(e.value)}=e;return{placement:i,avoidCollisions:n,spacing:s,text:r,value:t,fill:o,fontSize:a,minimumFontSize:l,fontStyle:c,fontWeight:h,fontFamily:u,lineHeight:d,wrapping:p,overflowStrategy:g,formatter:f}}verticalLabelInset(){const{properties:e}=this,{label:t}=e,i=t.text?.split("\n"),n=tm(t,t.fontSize)*(i?.length??1);return t.spacing+n}horizontalLabelInset(){const{scale:e,properties:t}=this,{scale:i,label:n}=t,s=n.text?.split("\n"),r=n.getFont(),o=i.interval.values??e.ticks({nice:!1,interval:i.interval.step,minTickCount:0,maxTickCount:6,tickCount:5})?.ticks??[],a=(s??o?.map(e=>KS(this.id,this.ctx,this.labelDatum(n,e))??"")).reduce((e,t)=>{const{width:i}=Px.measureText(t,{font:r});return Math.max(e,i)},0);return n.spacing+a}createNodeData(){const{id:e,properties:t,horizontal:i,scale:n,seriesRect:s}=this,{value:r,segmentation:o,thickness:a,cornerRadius:l,cornerMode:c,bar:h,scale:u,label:d}=t;let p,g;n.domain=[u.min,u.max],n.range=i?[0,s.width]:[s.height,0],i?(g=1,p=Math.PI/2):"before"===u.label.placement?(g=1,p=0):(g=-1,p=0);const f=p-Math.PI/2;let m,y,v,b;i?(m=0,y=s.width,v=(s.height-a)/2,b=v+a,"outside-start"===d.placement?m+=this.horizontalLabelInset():"outside-end"===d.placement&&(y-=this.horizontalLabelInset())):(m=(s.width-a)/2,y=m+a,b=0,v=s.height,"outside-start"===d.placement?v-=this.verticalLabelInset():"outside-end"===d.placement&&(b+=this.verticalLabelInset())),this.gaugeRect=new Lx(Math.min(m,y),Math.min(v,b),Math.abs(y-m),Math.abs(b-v)),n.domain=[u.min,u.max],n.range=i?[m,y]:[v,b];const{ticks:C}=this.tickGenerator.generateTicks({domain:n.domain,primaryTickCount:void 0,visibleRange:[0,1],niceMode:Wx.Off,labelX:0,parallelFlipRotation:p,regularFlipRotation:f,sideFlag:g,removeOverflowLabels:!1}).tickData,w=this.getTargets(),S=[],x=[],E=[],A=[],[M,T]=n.range,D=Math.abs(T-M),I=i?n.convert(r):y,R=i?b:n.convert(r),k=o.enabled?o.spacing/2:0,P=i?k:0,_=i?0:k,L=Math.min(h.thickness??Math.round(h.thicknessRatio*a),a),N=-(a-L)/2,O=i?0:N,F=i?N:0,G="item"===c,B=Math.ceil(D);let V=o.enabled?o.interval.getSegments(n,B):void 0;const H=h.fill??this.createLinearGradient(n,h.fills,h.fillMode),U=u.fill??(h.enabled&&0===u.fills.length?u.defaultFill:void 0)??this.createLinearGradient(n,u.fills,u.fillMode);if(null==V&&G){const e={value:r,segmentStart:Math.min(...n.domain),segmentEnd:Math.max(...n.domain)};if(h.enabled){const t=1*Math.min(l,L/2,D/2),n=i?t:0,s=i?0:t;S.push({series:this,itemId:"value",datum:e,datumIndex:{type:0},type:0,x0:0+m-n-O,y0:0+v-s-F,x1:0+I+n+O,y1:0+R+s+F,clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:l,topRightCornerRadius:l,bottomRightCornerRadius:l,bottomLeftCornerRadius:l,fill:H,horizontalInset:P,verticalInset:_})}const t=1*Math.min(l,a/2,D/2),s=i?t:0,o=i?0:t;A.push({series:this,itemId:"scale",datum:e,datumIndex:{type:0},type:0,x0:0+m-s,y0:0+v-o,x1:0+y+s,y1:0+b+o,clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:l,topRightCornerRadius:l,bottomRightCornerRadius:l,bottomLeftCornerRadius:l,fill:U,horizontalInset:P,verticalInset:_})}else{V??(V=n.domain);const e=0+m-O,t=0+v-F,s=0+I+O,o=0+R+F;for(let a=0;a<V.length-1;a+=1){const c=V[a+0],u=V[a+1],d={value:r,segmentStart:c,segmentEnd:u},p=0===a,g=a===V.length-2,f=n.convert(c),C=n.convert(u),w=G||p?l:0,x=G||g?l:0,E=i?w:x,M=x,T=i?x:w,D=w;h.enabled&&S.push({series:this,itemId:`value-${a}`,datum:d,datumIndex:{type:0},type:0,x0:0+(i?f:m),y0:0+(i?v:f),x1:0+(i?C:y),y1:0+(i?b:C),clipX0:e,clipY0:t,clipX1:s,clipY1:o,topLeftCornerRadius:E,topRightCornerRadius:M,bottomRightCornerRadius:T,bottomLeftCornerRadius:D,fill:H,horizontalInset:P,verticalInset:_}),A.push({series:this,itemId:`scale-${a}`,datum:d,datumIndex:{type:0},type:0,x0:0+(i?f:m),y0:0+(i?v:f),x1:0+(i?C:y),y1:0+(i?b:C),clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:E,topRightCornerRadius:M,bottomRightCornerRadius:T,bottomLeftCornerRadius:D,fill:U,horizontalInset:P,verticalInset:_})}}d.enabled&&E.push(this.labelDatum(d,r));const z=i?Yx:qx;for(let e=0;e<w.length;e+=1){const t=w[e],{value:i,text:n,shape:s,size:r,fill:o,fillOpacity:a,stroke:l,strokeWidth:c,strokeOpacity:h,lineDash:u,lineDashOffset:d}=t,p=this.getTargetPoint(t),g=_x(t.rotation+z[t.placement]);x.push({series:this,itemId:`target-${e}`,midPoint:p,datum:{value:i},datumIndex:{type:1,index:e},type:1,value:i,text:n,x:p.x,y:p.y,shape:s,size:r,rotation:g,fill:o,fillOpacity:a,stroke:l,strokeOpacity:h,strokeWidth:c,lineDash:u,lineDashOffset:d,label:this.getTargetLabel(t)})}return{itemId:e,nodeData:S,tickData:C,targetData:x,labelData:E,scaleData:A}}updateSelections(e){(this.nodeDataRefresh||e)&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}highlightDatum(e){if(null!=e&&e.series===this&&1===e.type)return e}update({seriesRect:e}){const{datumSelection:t,labelSelection:i,targetSelection:n,targetLabelSelection:s,scaleSelection:r,highlightTargetSelection:o,tickSelection:a}=this;this.seriesRect=e??Lx.NaN;const l=this.checkResize(e);this.updateSelections(l),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();const c=this.contextNodeData?.nodeData??[],h=this.contextNodeData?.labelData??[],u=this.contextNodeData?.targetData??[],d=this.contextNodeData?.scaleData??[],p=this.contextNodeData?.tickData??[],g=this.highlightDatum(this.ctx.highlightManager.getActiveHighlight());this.scaleSelection=this.updateScaleSelection({scaleData:d,scaleSelection:r}),this.updateScaleNodes({scaleSelection:r}),this.targetSelection=this.updateTargetSelection({targetData:u,targetSelection:n}),this.updateTargetNodes({targetSelection:n,isHighlight:!1}),this.targetLabelSelection=this.updateTargetLabelSelection({targetData:u,targetLabelSelection:s}),this.updateTargetLabelNodes({targetLabelSelection:s}),this.datumSelection=this.updateDatumSelection({nodeData:c,datumSelection:t}),this.updateDatumNodes({datumSelection:t}),this.labelSelection=this.updateLabelSelection({labelData:h,labelSelection:i}),this.updateLabelNodes({labelSelection:i}),this.highlightTargetSelection=this.updateTargetSelection({targetData:null!=g?[g]:[],targetSelection:o}),this.updateTargetNodes({targetSelection:o,isHighlight:!0}),this.tickSelection=this.updateTickSelection({tickData:p,tickSelection:a}),this.updateTickNodes({tickSelection:a}),l&&this.animationState.transition("resize"),this.animationState.transition("update")}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>kx(e.nodeData.length,t.itemId))}updateDatumNodes(e){const{datumSelection:t}=e,{ctx:i,properties:s}=this,{bar:r}=s,{fillOpacity:o,stroke:a,strokeOpacity:l,lineDash:c,lineDashOffset:h}=r,u=this.getStrokeWidth(r.strokeWidth),d=i.animationManager.isSkipped(),p=this.getShapeFillBBox();t.each((e,t)=>{const{topLeftCornerRadius:i,topRightCornerRadius:s,bottomRightCornerRadius:r,bottomLeftCornerRadius:g,fill:f}=t;e.fill=f,e.fillBBox=p,e.fillOpacity=o,e.stroke=a,e.strokeOpacity=l,e.strokeWidth=u,e.lineDash=c,e.lineDashOffset=h,e.topLeftCornerRadius=i,e.topRightCornerRadius=s,e.bottomRightCornerRadius=r,e.bottomLeftCornerRadius=g,e.pointerEvents=this.properties.bar.enabled?n.n1.PointerEvents.All:n.n1.PointerEvents.None,(d||null==e.previousDatum)&&e.setProperties(Sx(0,t))}),this.datumUnion.update(t,this.itemGroup,n.n1.Rect,(e,t,i)=>{e.pointerEvents=n.n1.PointerEvents.None,e.clipBBox??(e.clipBBox=new Lx(NaN,NaN,NaN,NaN)),e.x=t.x,e.y=t.y,e.clipBBox.x=t.clipBBox?.x??t.x,e.clipBBox.y=t.clipBBox?.y??t.y,this.horizontal?(e.height=e.clipBBox.height=i.height,e.width=i===t?i.width:i.x+i.width,e.clipBBox.width=e.width-(i.width-(i.clipBBox?.width??i.width)),e.topLeftCornerRadius=t.topLeftCornerRadius,e.bottomLeftCornerRadius=t.bottomLeftCornerRadius,e.topRightCornerRadius=i.topRightCornerRadius,e.bottomRightCornerRadius=i.bottomRightCornerRadius):(e.width=e.clipBBox.width=i.width,e.height=i===t?i.height:i.x+i.height,e.clipBBox.height=e.height-(i.height-(i.clipBBox?.height??i.height)),e.topLeftCornerRadius=t.topLeftCornerRadius,e.topRightCornerRadius=t.topRightCornerRadius,e.bottomLeftCornerRadius=i.bottomLeftCornerRadius,e.bottomRightCornerRadius=i.bottomRightCornerRadius)})}updateScaleSelection(e){return e.scaleSelection.update(e.scaleData,void 0,t=>kx(e.scaleData.length,t.itemId))}updateScaleNodes(e){const{scaleSelection:t}=e,{scale:i}=this.properties,{fillOpacity:n,stroke:s,strokeOpacity:r,strokeWidth:o,lineDash:a,lineDashOffset:l}=i,c=this.getShapeFillBBox();t.each((e,t)=>{const{topLeftCornerRadius:i,topRightCornerRadius:h,bottomRightCornerRadius:u,bottomLeftCornerRadius:d,fill:p}=t;e.fill=p,e.fillBBox=c,e.fillOpacity=n,e.stroke=s,e.strokeOpacity=r,e.strokeWidth=o,e.lineDash=a,e.lineDashOffset=l,e.topLeftCornerRadius=i,e.topRightCornerRadius=h,e.bottomRightCornerRadius=u,e.bottomLeftCornerRadius=d,e.setProperties(Sx(0,t))})}updateTargetSelection(e){return e.targetSelection.update(e.targetData,void 0,e=>e.itemId)}updateTargetNodes(e){const{targetSelection:t,isHighlight:i}=e,n=i?this.properties.highlightStyle.item:void 0;t.each((e,t)=>{const{x:i,y:s,shape:r,size:o,rotation:a,fill:l,fillOpacity:c,stroke:h,strokeOpacity:u,strokeWidth:d,lineDash:p,lineDashOffset:g}=t;e.size=o,e.shape="line"===r?qS:r,e.fill=n?.fill??l,e.fillOpacity=n?.fillOpacity??c,e.stroke=n?.stroke??h,e.strokeOpacity=n?.strokeOpacity??u,e.strokeWidth=n?.strokeWidth??d,e.lineDash=n?.lineDash??p,e.lineDashOffset=n?.lineDashOffset??g,e.translationX=i,e.translationY=s,e.rotation=a})}updateTargetLabelSelection(e){return e.targetLabelSelection.update(e.targetData)}updateTargetLabelNodes(e){const{targetLabelSelection:t}=e;t.each((e,t)=>{const{x:i,y:n,text:s}=t,{offsetX:r,offsetY:o,fill:a,fontStyle:l,fontWeight:c,fontSize:h,fontFamily:u,textAlign:d,textBaseline:p}=t.label;e.visible=!0,e.x=i+r,e.y=n+o,e.text=s,e.fill=a,e.fontStyle=l,e.fontWeight=c,e.fontSize=h,e.fontFamily=u,e.textAlign=d,e.textBaseline=p})}updateTickSelection(e){return e.tickSelection.update(e.tickData,void 0,e=>e.tickId)}updateTickNodes(e){const{gaugeRect:t,properties:i}=this,n=i.defaultScale,{enabled:s,color:r,fontFamily:o=n.label.fontFamily,fontSize:a=n.label.fontSize,fontStyle:l,fontWeight:c=n.label.fontWeight,spacing:h}=i.scale.label;let{placement:u}=i.scale.label;const d=_x(i.scale.label.rotation??0);let p,g,f,m;this.horizontal?(u??(u="after"),p="center",g="before"===u?"bottom":"top",m=this.originY+t.y+("before"===u?-h:t.height+h)):(u??(u="before"),p="before"===u?"end":"start",g="middle",f=this.originX+t.x+("before"===u?-h:t.width+h)),e.tickSelection.each((e,t)=>{if(!s)return void(e.visible=!1);const i=f??t.translationY,n=m??t.translationY;e.visible=!0,e.text=t.tickLabel,e.fill=r,e.fontFamily=o,e.fontSize=a,e.fontStyle=l,e.fontWeight=c,e.textBaseline=g,e.textAlign=p,e.x=i,e.y=n,e.rotationCenterX=i,e.rotationCenterY=n,e.rotation=d})}updateLabelSelection(e){return e.labelSelection.update(e.labelData,void 0,e=>"primary")}updateLabelNodes(e){const{labelSelection:t}=e,i=this.ctx.animationManager.isSkipped();t.each((e,t)=>{e.fill=t.fill,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.fontFamily=t.fontFamily}),(i||this.labelsHaveExplicitText())&&this.formatLabelText()}labelsHaveExplicitText(){for(const{datum:e}of this.labelSelection)if(null==e.text)return!1;return!0}formatLabelText(e){const{labelSelection:t,horizontal:i,scale:n,seriesRect:s,gaugeRect:r}=this,{x:o,y:a,width:l,height:c}=r,h=e?.label??this.properties.value;let u;if(i){const e=n.convert(h);u=new Lx(o,a,e-o,c)}else{const e=n.convert(h);u=new Lx(o,e,l,c-e)}const d={seriesRect:s,gaugeRect:r,barRect:u},{margin:p}=this.properties;!function(e,t,i,n,s,r){const{seriesRect:o,gaugeRect:a,barRect:l}=s,{padding:c,horizontal:h}=n;i.each((i,n)=>{const s=KS(e.id,t,n,r?.label);let u,d,p;if("outside-start"===n.placement?h?(u=a.x,d=o.height):(u=o.width,d=o.height-(a.y+a.height)):"outside-end"===n.placement?h?(u=o.width-(a.x+a.width),d=o.height):(u=o.width,d=a.y):n.avoidCollisions&&(u=a.width,d=a.height),null==s)return;if(null!=u&&null!=d){const e=nm(s,n,{padding:c},()=>({width:u,height:d,meta:null}));p=e?.[0]}else{const e={fontSize:n.fontSize,fontStyle:n.fontStyle,fontWeight:n.fontWeight,fontFamily:n.fontFamily,lineHeight:n.lineHeight},{width:t,height:i}=yx.measureText(s,{font:e});p={text:s,fontSize:n.fontSize,lineHeight:tm(n,n.fontSize),width:t,height:i}}if(null==p)return void(i.visible=!1);const g=h?a.x:a.y+a.height,f=h?a.x+a.width:a.y,m=h?l.x:l.y+l.height,y=h?l.x+l.width:l.y,v=n.spacing*(h?1:-1);let b,C,w,S;switch(n.placement){case"outside-start":b=-1/0,C=1/0,w=g-v,S="Before";break;case"outside-end":b=-1/0,C=1/0,w=f+v,S="After";break;case"inside-start":b=g,C=y,w=g+v,S="After";break;case"inside-end":b=y,C=f,w=f-v,S="Before";break;case"inside-center":b=g,C=f,w=(g+f)/2,S="Center";break;case"bar-inside":b=m,C=y,w=(m+y)/2,S="Center";break;case"bar-inside-end":b=m,C=y,w=y-v,S="Before";break;case"bar-outside-end":b=y,C=f,w=y+v,S="After";break;case"bar-end":b=-1/0,C=1/0,w=y,S="Center"}const x=h?w:a.x+a.width/2,E=h?a.y+a.height/2:w;let A,M;h?(A=x+Ax[S]*p.width,M=A+p.width):(A=E+Mx[S]*p.height,M=A+p.height);const T=Math.min(A,M)>=Math.min(b,C)&&Math.max(A,M)<=Math.max(b,C);!n.avoidCollisions||T?(i.visible=!0,i.text=p.text,i.fontSize=p.fontSize,i.lineHeight=p.lineHeight,i.textAlign=h?xx[S]:"center",i.textBaseline=h?"middle":Ex[S],i.x=x,i.y=E):i.visible=!1})}(this,this.ctx,t,{padding:p,horizontal:i},d,e)}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),Dx([this.datumSelection],Sx),this.formatLabelText()}resetAnimation(e){"initial"===e?this.animationState.transition("reset"):"ready"===e&&this.animationState.transition("skip")}animateLabelText(e={}){const{animationManager:t}=this.ctx;let i=0,n=0;if(this.labelSelection.each((t,s)=>{t.opacity=1,i=t.previousDatum?.value??e.from??s.value,n=s.value}),this.labelsHaveExplicitText());else if(i===n)this.formatLabelText({label:n});else{const s=`${this.id}_labels`;t.animate({id:s,groupId:"label",from:{label:i},to:{label:n},phase:e.phase??"update",ease:jx.easeOut,onUpdate:e=>this.formatLabelText(e)})}}animateEmptyUpdateReady(){const{animationManager:e}=this.ctx,{node:t}=wx(!0,this.horizontal);Tx(this.id,"node",e,[this.datumSelection],t,(e,t)=>t.itemId),Tx(this.id,"label",e,[this.labelSelection],jS,()=>"primary"),this.animateLabelText({from:0,phase:"initial"})}animateWaitingUpdateReady(){const{animationManager:e}=this.ctx,{node:t}=wx(!1,this.horizontal);Tx(this.id,"node",e,[this.datumSelection],t,(e,t)=>t.itemId),this.animateLabelText()}animateReadyResize(){this.resetAllAnimation()}getSeriesDomain(){return[0,1]}getSeriesRange(e,t){return[NaN,NaN]}getLegendData(){return[]}getTooltipContent(e){const{id:t,properties:i}=this,{tooltip:n}=i;let s,r;if(0===e.type?(s=i.value,r=i.label.text):({value:s,text:r}=i.targets[e.index]),null!=s)return this.formatTooltipWithContext(n,{data:[{label:r,fallbackLabel:"Value",value:this.formatLabel(s)}]},{seriesId:t,title:void 0,datum:void 0,value:s})}pickNodeClosestDatum(e){return XS(this,e)}pickFocus(e){return ZS(this,e)}getCaptionText(){return this.formatLabel(this.properties.value)}getCategoryValue(e){}datumIndexForCategoryValue(e){}};Zx.className="LinearGaugeSeries",Zx.type="linear-gauge";var Qx={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["gauge"],identifier:"linear-gauge",moduleFactory:e=>new Zx(e),tooltipDefaults:{range:10},themeTemplate:{minWidth:200,minHeight:200,tooltip:{enabled:!1},series:{thickness:50,defaultColorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$interpolate:[{$palette:"secondDivergingColors"},5]},n.n1.SAFE_RANGE2_OPERATION]},scale:{defaultFill:{$path:["./1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["./2",n.n1.SAFE_STROKE_FILL_OPERATION,{$palette:"hierarchyColors"}]},label:{spacing:11}},bar:{strokeWidth:0},segmentation:{enabled:!1,interval:{},spacing:1},defaultTarget:{fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},size:10,shape:"triangle",placement:"after",spacing:5,label:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},spacing:5}},defaultScale:{label:{fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}}},label:{enabled:!1,placement:"inside-start",fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[2]},minimumFontSize:12,spacing:18,color:{$ref:"backgroundColor"}},margin:4}}},Jx={type:"series",name:"linear-gauge",chartType:"gauge",enterprise:!0,options:n.n1.linearGaugeSeriesOptionsDef,create:e=>new Zx(e)},eE={zoom:{axes:"xy",anchorPointX:"pointer",anchorPointY:"pointer",buttons:{anchorPointX:"middle",anchorPointY:"middle"}},legend:{enabled:!1},gradientLegend:{enabled:!1}};function tE(e,t,i,n){const[s,r]=e,[o,a]=t,l=o-s,c=a-r,h=l*l+c*c;let u,d;if(Math.abs(h)<1e-9)u=s,d=r;else{let e=((i-s)*l+(n-r)*c)/h;e=Math.max(0,Math.min(1,e)),u=s+e*(o-s),d=r+e*(a-r)}const p=i-u,g=n-d;return p*p+g*g}function iE(e,t,i){let n=1/0,s=e[e.length-1];for(const r of e)n=Math.min(n,tE(s,r,t,i)),s=r;return Math.sqrt(n)}function nE(e){let[t,i]=e[0],n=0;for(let s=1;s<e.length;s+=1){const[r,o]=e[s];n+=Math.hypot(r-t,o-i),t=r,i=o}return n}function sE(e){if(0===e.length)return;const t=nE(e)/2;let[i,n]=e[0],s=0;for(let r=1;r<e.length;r+=1){const[o,a]=e[r],l=Math.hypot(o-i,a-n),c=s+l;if(c>t){const e=(t-s)/l;return{point:[i+(o-i)*e,n+(a-n)*e],angle:Math.atan2(a-n,o-i)}}s=c,i=o,n=a}}var{LonLatBBox:rE}=n.n1;function oE(e,t,i,n,s){return null==e?e=new rE(t,i,n,s):(e.lon0=Math.min(e.lon0,t),e.lat0=Math.min(e.lat0,i),e.lon1=Math.max(e.lon1,n),e.lat1=Math.max(e.lat1,s)),e}function aE(e,t){return e.forEach(e=>{const[i,n]=e;t=oE(t,i,n,i,n)}),t}function lE(e,t,i){let n=!1,s=1/0;for(const r of e){let e=r[r.length-1],[o,a]=e;for(const l of r){const[r,c]=l;c>i!=a>i&&t<(o-r)*(i-c)/(a-c)+r&&(n=!n),s=Math.min(s,tE(e,l,t,i)),e=l,o=r,a=c}}return(n?-1:1)*Math.sqrt(s)}var{Path:cE,ExtendedPath2D:hE,BBox:uE,SceneChangeDetection:dE,SceneObjectChangeDetection:pE,objectsEqual:gE}=n.n1,fE=class extends cE{constructor(){super(...arguments),this.projectedGeometry=void 0,this.renderMode=3,this.strokePath=new hE}computeBBox(){return(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1),this.bbox?.clone()}updatePath(){const{projectedGeometry:e}=this;this.strokePath.clear(),this.path.clear(),this.bbox=null!=e?this.drawGeometry(e,void 0):void 0}drawPath(e){super.drawPath(e),this.renderStroke(e,this.strokePath.getPath2D())}containsPoint(e,t){const{projectedGeometry:i}=this;return null!=i&&!!this.getBBox().containsPoint(e,t)&&this.geometryDistance(i,e,t)<=0}distanceSquared(e,t){const{projectedGeometry:i}=this;if(null==i)return 1/0;const n=this.geometryDistance(i,e,t);return n>0?n*n:0}geometryDistance(e,t,i){const{renderMode:n,strokeWidth:s}=this,r=!!(1&n),o=!!(2&n),a=Math.max(s/2,1)+1;switch(e.type){case"GeometryCollection":return e.geometries.reduce((e,n)=>Math.min(e,this.geometryDistance(n,t,i)),1/0);case"MultiPolygon":return r?e.coordinates.reduce((e,n)=>Math.min(e,Math.max(lE(n,t,i),0)),1/0):1/0;case"Polygon":return r?Math.max(lE(e.coordinates,t,i),0):1/0;case"MultiLineString":return o?e.coordinates.reduce((e,n)=>Math.min(e,Math.max(iE(n,t,i)-a,0)),1/0):1/0;case"LineString":return o?Math.max(iE(e.coordinates,t,i)-a,0):1/0;default:return 1/0}}drawGeometry(e,t){const{renderMode:i,path:n,strokePath:s}=this,r=!!(1&i),o=!!(2&i);switch(e.type){case"GeometryCollection":e.geometries.forEach(e=>{t=this.drawGeometry(e,t)});break;case"MultiPolygon":r&&e.coordinates.forEach(e=>{t=this.drawPolygon(n,e,t)});break;case"Polygon":r&&(t=this.drawPolygon(n,e.coordinates,t));break;case"LineString":o&&(t=this.drawLineString(s,e.coordinates,t,!1));break;case"MultiLineString":o&&e.coordinates.forEach(e=>{t=this.drawLineString(s,e,t,!1)})}return t}drawPolygon(e,t,i){if(t.length<1)return i;i=this.drawLineString(e,t[0],i,!0);for(let i=1;i<t.length;i+=1){const n=t[i];this.drawLineString(e,n,void 0,!0)}return i}drawLineString(e,t,i,n){if(t.length<2)return i;const s=n?t.length-1:t.length;for(let n=0;n<s;n+=1){const[s,r]=t[n];if(0===n?e.moveTo(s,r):e.lineTo(s,r),null==i)i=new uE(s,r,0,0);else{const{x:e,y:t}=i,n=e+i.width,o=t+i.height;i.x=Math.min(e,s),i.y=Math.min(t,r),i.width=Math.max(n,s)-i.x,i.height=Math.max(o,r)-i.y}}return n&&e.closePath(),i}};function mE(e,t){if(null!=e.bbox){const[i,n,s,r]=e.bbox;return t=oE(t,i,n,s,r)}switch(e.type){case"GeometryCollection":e.geometries.forEach(e=>{t=mE(e,t)});break;case"MultiPolygon":e.coordinates.forEach(e=>{e.length>0&&(t=aE(e[0],t))});break;case"Polygon":e.coordinates.length>0&&(t=aE(e.coordinates[0],t));break;case"MultiLineString":e.coordinates.forEach(e=>{t=aE(e,t)});break;case"LineString":t=aE(e.coordinates,t);break;case"MultiPoint":e.coordinates.forEach(e=>{const[i,n]=e;t=oE(t,i,n,i,n)});break;case"Point":{const[i,n]=e.coordinates;t=oE(t,i,n,i,n);break}}return t}function yE(e){switch(e.type){case"GeometryCollection":{let t,i;return e.geometries.forEach(e=>{const n=yE(e);if(null==n)return;const s=aE(n[0],void 0);if(null==s)return;const r=Math.abs(s.lat1-s.lat0)*Math.abs(s.lon1-s.lon0);(null==t||r>t)&&(t=r,i=n)}),i}case"MultiPolygon":{let t,i;return e.coordinates.forEach(e=>{const n=aE(e[0],void 0);if(null==n)return;const s=Math.abs(n.lat1-n.lat0)*Math.abs(n.lon1-n.lon0);(null==t||s>t)&&(t=s,i=e)}),i}case"Polygon":return e.coordinates;case"MultiLineString":case"LineString":case"MultiPoint":case"Point":return}}function vE(e){switch(e.type){case"GeometryCollection":{let t,i;return e.geometries.forEach(e=>{const n=vE(e);if(null==n)return;const s=nE(n);null!=s&&(null==t||s>t)&&(t=s,i=n)}),i}case"MultiLineString":{let t,i=0;return e.coordinates.forEach(e=>{const n=nE(e);n>i&&(i=n,t=e)}),t}case"LineString":return e.coordinates;case"MultiPolygon":case"Polygon":case"MultiPoint":case"Point":return}}function bE(e,t){if(null==e)return!1;switch(e.type){case"GeometryCollection":return e.geometries.some(e=>bE(e,t));case"MultiPolygon":case"Polygon":return!!(1&t);case"MultiLineString":case"LineString":return!!(2&t);case"MultiPoint":case"Point":return!!(4&t)}}function CE(e,t){switch(e.type){case"GeometryCollection":return{type:"GeometryCollection",geometries:e.geometries.map(e=>CE(e,t))};case"Polygon":return{type:"Polygon",coordinates:SE(e.coordinates,t)};case"MultiPolygon":return{type:"MultiPolygon",coordinates:wE(e.coordinates,t)};case"MultiLineString":return{type:"MultiLineString",coordinates:SE(e.coordinates,t)};case"LineString":return{type:"LineString",coordinates:xE(e.coordinates,t)};case"MultiPoint":return{type:"MultiPoint",coordinates:xE(e.coordinates,t)};case"Point":return{type:"Point",coordinates:t.convert(e.coordinates)}}}function wE(e,t){return e.map(e=>SE(e,t))}function SE(e,t){return e.map(e=>xE(e,t))}function xE(e,t){return e.map(e=>t.convert(e))}function EE(e,t){const i=e.contextNodeData?.nodeData[t.datumIndex];if(void 0!==i)for(const t of e.datumSelection.nodes())if(t.datum===i)return t}a([pE({equals:gE})],fE.prototype,"projectedGeometry",2),a([dE()],fE.prototype,"renderMode",2),n.n1.SeriesProperties;var AE=class extends n.n1.DataModelSeries{addChartEventListeners(){this.destroyFns.push(this.ctx.chartEventManager.addListener("legend-item-click",e=>{this.onLegendItemClick(e)}),this.ctx.chartEventManager.addListener("legend-item-double-click",e=>{this.onLegendItemDoubleClick(e)}))}getSeriesDomain(){return[NaN,NaN]}getSeriesRange(e,t){return[NaN,NaN]}},{Property:ME,SeriesProperties:TE,SeriesTooltip:DE,Label:IE}=n.n1,RE=class extends TE{constructor(){super(...arguments),this.topology=void 0,this.idKey="",this.topologyIdKey="name",this.idName=void 0,this.labelKey=void 0,this.labelName=void 0,this.colorRange=void 0,this.maxStrokeWidth=void 0,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.label=new IE,this.tooltip=new DE}};a([ME],RE.prototype,"topology",2),a([ME],RE.prototype,"title",2),a([ME],RE.prototype,"legendItemName",2),a([ME],RE.prototype,"idKey",2),a([ME],RE.prototype,"topologyIdKey",2),a([ME],RE.prototype,"idName",2),a([ME],RE.prototype,"labelKey",2),a([ME],RE.prototype,"labelName",2),a([ME],RE.prototype,"sizeKey",2),a([ME],RE.prototype,"sizeName",2),a([ME],RE.prototype,"colorKey",2),a([ME],RE.prototype,"colorName",2),a([ME],RE.prototype,"sizeDomain",2),a([ME],RE.prototype,"colorRange",2),a([ME],RE.prototype,"maxStrokeWidth",2),a([ME],RE.prototype,"stroke",2),a([ME],RE.prototype,"strokeOpacity",2),a([ME],RE.prototype,"strokeWidth",2),a([ME],RE.prototype,"lineDash",2),a([ME],RE.prototype,"lineDashOffset",2),a([ME],RE.prototype,"itemStyler",2),a([ME],RE.prototype,"label",2),a([ME],RE.prototype,"tooltip",2);var{getMissCount:kE,createDatumId:PE,SeriesNodePickMode:_E,valueProperty:LE,CachedTextMeasurerPool:NE,ColorScale:OE,LinearScale:FE,Selection:GE,Text:BE,Transformable:VE}=n.n1,HE=class extends AE{constructor(e){super({moduleCtx:e,categoryKey:void 0,useLabelLayer:!0,pickModes:[_E.EXACT_SHAPE_MATCH,_E.NEAREST_NODE],usesPlacedLabels:!0}),this.properties=new RE,this._chartTopology=void 0,this.colorScale=new OE,this.sizeScale=new FE,this.datumSelection=GE.select(this.contentGroup,()=>this.nodeFactory()),this.labelSelection=GE.select(this.labelGroup,BE),this.highlightDatumSelection=GE.select(this.highlightNode,()=>this.nodeFactory()),this._previousDatumMidPoint=void 0}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get hasData(){return super.hasData&&null!=this.topology}renderToOffscreenCanvas(){return!0}setSeriesIndex(e){return!!super.setSeriesIndex(e)&&(this.contentGroup.zIndex=[1,e],this.highlightGroup.zIndex=[2,e],!0)}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}isLabelEnabled(){return null!=this.properties.labelKey&&this.properties.label.enabled}nodeFactory(){const e=new fE;return e.renderMode=2,e.lineJoin="round",e.lineCap="round",e}async processData(e){if(null==this.data)return;const{data:t,topology:i,sizeScale:n,colorScale:r}=this,{topologyIdKey:o,idKey:a,sizeKey:l,colorKey:c,labelKey:h,sizeDomain:u,colorRange:d}=this.properties,p=new Map;i?.features.forEach(e=>{const t=e.properties?.[o];null!=t&&bE(e.geometry,2)&&p.set(t,e)});const g=this.sizeScale.type,f=this.colorScale.type,m=this.scale?.type,{dataModel:y,processedData:v}=await this.requestDataModel(e,t,{props:[LE(a,m,{id:"idValue",includeProperty:!1}),LE(a,m,{id:"featureValue",includeProperty:!1,processor:()=>e=>p.get(e)}),...null!=h?[LE(h,"band",{id:"labelValue"})]:[],...null!=l?[LE(l,g,{id:"sizeValue"})]:[],...null!=c?[LE(c,f,{id:"colorValue"})]:[]]}),b=y.resolveColumnById(this,"featureValue",v);if(this.topologyBounds=b.reduce((e,t)=>{const i=t?.geometry;return null==i?e:mE(i,e)},void 0),null!=l){const e=y.resolveProcessedDataIndexById(this,"sizeValue"),t=v.domain.values[e]??[];n.domain=u??t}if(null!=d&&this.isColorScaleValid()){const e=y.resolveProcessedDataIndexById(this,"colorValue");r.domain=v.domain.values[e],r.range=d,r.update()}null==i&&s.Vy.warnOnce("no topology was provided for [MapLineSeries]; nothing will be rendered.")}isColorScaleValid(){const{colorKey:e}=this.properties;if(!e)return!1;const{dataModel:t,processedData:i}=this;if(!t||!i)return!1;const n=t.resolveProcessedDataIndexById(this,"colorValue"),s=i.input.count,r=kE(this,i.defs.values[n].missing);return!(0===s||s===r)}getLabelDatum(e,t,i,n){if(null==t||null==i)return;const s=vE(i);if(null==s)return;const{idKey:r,idName:o,sizeKey:a,sizeName:l,colorKey:c,colorName:h,labelKey:u,labelName:d,label:p}=this.properties,g=this.getLabelText(p,{value:t,datum:e,idKey:r,idName:o,sizeKey:a,sizeName:l,colorKey:c,colorName:h,labelKey:u,labelName:d});if(null==g)return;const f=NE.measureText(String(g),{font:n}),m=sE(s);if(null==m)return;const[y,v]=m.point,{width:b,height:C}=f;return{point:{x:y,y:v,size:0},label:{width:b,height:C,text:g},anchor:void 0,placement:void 0}}createNodeData(){const{id:e,dataModel:t,processedData:i,sizeScale:n,properties:r,scale:o}=this,{idKey:a,sizeKey:l,colorKey:c,labelKey:h,label:u}=r;if(null==t||null==i)return;const d=t.resolveColumnById(this,"idValue",i),p=t.resolveColumnById(this,"featureValue",i),g=null!=h?t.resolveColumnById(this,"labelValue",i):void 0,f=null!=l?t.resolveColumnById(this,"sizeValue",i):void 0,m=null!=c?t.resolveColumnById(this,"colorValue",i):void 0,y=r.maxStrokeWidth??r.strokeWidth;n.range=[Math.min(r.strokeWidth,y),y];const v=u.getFont(),b=new Map;i.dataSources.get(this.id)?.forEach((e,t)=>{const i=d[t],n=p[t]?.geometry??void 0,s=null!=n&&null!=o?CE(n,o):void 0;null!=i&&null!=s&&b.set(i,s)});const C=[],w=[],S=[];if((i.dataSources.get(this.id)??[]).forEach((e,t)=>{const i=d[t],n=m?.[t],s=f?.[t],r=g?.[t],o=b.get(i);null==o&&S.push(i);const l=this.getLabelDatum(e,r,o,v);null!=l&&w.push(l),C.push({series:this,itemId:a,datum:e,datumIndex:t,idValue:i,labelValue:r,colorValue:n,sizeValue:s,projectedGeometry:o})}),S.length>10){const e=S.length-10;S.length=10,S.push(`(+${e} more)`)}return S.length>0&&s.Vy.warnOnce("some data items do not have matches in the provided topology",S),{itemId:e,nodeData:C,labelData:w}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:e,highlightDatumSelection:t}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();let i=this.ctx.highlightManager?.getActiveHighlight();null==i||i.series===this&&null!=i.datum||(i=void 0);const n=this.contextNodeData?.nodeData??[];this.datumSelection=this.updateDatumSelection({nodeData:n,datumSelection:e}),this.updateDatumNodes({datumSelection:e,isHighlight:!1}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:null!=i?[i]:[],datumSelection:t}),this.updateDatumNodes({datumSelection:t,isHighlight:!0})}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,e=>PE(e.idValue))}getItemBaseStyle(e){const{properties:t}=this,i=e?t.highlightStyle.item:void 0;return{stroke:i?.stroke??t.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(t.strokeWidth),strokeOpacity:i?.strokeOpacity??t.strokeOpacity,lineDash:i?.lineDash??t.lineDash,lineDashOffset:i?.lineDashOffset??t.lineDashOffset}}getItemStyleOverrides(e,t,i,n,s,r){const{id:o,properties:a,colorScale:l,sizeScale:c}=this,{colorRange:h,itemStyler:u}=a;let d;if(r||null==i||(d??(d={}),d.stroke=this.isColorScaleValid()?l.convert(i):h?.[0]??a.stroke),null!=n&&(d??(d={}),d.strokeWidth=c.convert(n,{clamp:!0})),null!=u){const i=this.cachedDatumCallback(PE(e,r?"highlight":"node"),()=>this.callWithContext(u,{seriesId:o,datum:t,highlighted:r,...s,...d}));d??(d={}),Object.assign(d,i)}return d}updateDatumNodes(e){const{datumSelection:t,isHighlight:i}=e,n=this.getItemBaseStyle(i);t.each((e,t)=>{const{datum:s,datumIndex:r,colorValue:o,sizeValue:a,projectedGeometry:l}=t;if(null==l)return e.visible=!1,void(e.projectedGeometry=void 0);const c=this.getItemStyleOverrides(String(r),s,o,a,n,i);e.visible=!0,e.projectedGeometry=l,e.stroke=c?.stroke??n.stroke,e.strokeWidth=c?.strokeWidth??n.strokeWidth,e.strokeOpacity=c?.strokeOpacity??n.strokeOpacity,e.lineDash=c?.lineDash??n.lineDash,e.lineDashOffset=c?.lineDashOffset??n.lineDashOffset})}updatePlacedLabelData(e){this.labelSelection=this.labelSelection.update(e,e=>{e.pointerEvents=n.n1.PointerEvents.None}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(e){const{labelSelection:t}=e,{color:i,fontStyle:n,fontWeight:s,fontSize:r,fontFamily:o}=this.properties.label;t.each((e,{x:t,y:a,width:l,height:c,text:h})=>{e.visible=!0,e.x=t+l/2,e.y=a+c/2,e.text=h,e.fill=i,e.fontStyle=n,e.fontWeight=s,e.fontSize=r,e.fontFamily=o,e.textAlign="center",e.textBaseline="middle"})}resetAnimation(){}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}pickNodeClosestDatum({x:e,y:t}){let i,n=1/0;return this.datumSelection.each((s,r)=>{const o=s.distanceSquared(e,t);o<n&&(n=o,i=r)}),null!=i?{datum:i,distance:Math.sqrt(n)}:void 0}datumMidPoint(e){const{_previousDatumMidPoint:t}=this;if(t?.datum===e)return t.point;const i=e.projectedGeometry,n=null!=i?vE(i):void 0,s=null!=n?sE(n)?.point:void 0,r=null!=s?{x:s[0],y:s[1]}:void 0;return this._previousDatumMidPoint={datum:e,point:r},r}legendItemSymbol(e){const{dataModel:t,processedData:i,properties:n}=this,{strokeWidth:s,strokeOpacity:r,lineDash:o}=n;let{stroke:a}=n;if(null!=e&&this.isColorScaleValid()){const n=t.resolveColumnById(this,"colorValue",i)[e];a=this.colorScale.convert(n)}return{marker:{fill:void 0,fillOpacity:0,stroke:void 0,strokeWidth:0,strokeOpacity:0,lineDash:[0],lineDashOffset:0,enabled:!1},line:{stroke:a,strokeWidth:s,strokeOpacity:r,lineDash:o}}}getLegendData(e){const{processedData:t,dataModel:i}=this;if(null==t||null==i)return[];const{id:n,visible:s}=this,{title:r,legendItemName:o,idKey:a,idName:l,colorKey:c,colorName:h,colorRange:u,showInLegend:d}=this.properties;return"gradient"===e&&null!=c&&null!=u?[{legendType:"gradient",enabled:s,seriesId:n,colorName:h,colorRange:u,colorDomain:t.domain.values[i.resolveProcessedDataIndexById(this,"colorValue")]}]:"category"===e?[{legendType:"category",id:n,itemId:n,seriesId:n,enabled:s,label:{text:o??r??l??a},symbol:this.legendItemSymbol(),legendItemName:o,hideInLegend:!d}]:[]}getTooltipContent(e){const{id:t,dataModel:i,processedData:n,properties:s}=this,{idKey:r,idName:o,colorKey:a,colorName:l,sizeKey:c,sizeName:h,labelKey:u,labelName:d,title:p,legendItemName:g,tooltip:f}=s;if(!i||!n)return;const m=n.dataSources.get(this.id)?.[e],y=i.resolveColumnById(this,"idValue",n),v=[],b=null!=c?i.resolveColumnById(this,"sizeValue",n)[e]:void 0,C=null!=a?i.resolveColumnById(this,"colorValue",n)[e]:void 0;if(null!=c&&v.push({label:h,fallbackLabel:c,value:String(b)}),null!=a&&v.push({label:l,fallbackLabel:a,value:String(C)}),null!=u&&u!==r){const t=i.resolveColumnById(this,"labelValue",n)[e];v.push({label:d,fallbackLabel:u,value:t})}const w=this.getItemBaseStyle(!1);return Object.assign(w,this.getItemStyleOverrides(String(e),e,C,b,w,!1)),this.formatTooltipWithContext(f,{heading:y[e],title:p??g,symbol:this.legendItemSymbol(e),data:v},{seriesId:t,datum:m,title:p,idKey:r,idName:o,colorKey:a,colorName:l,sizeKey:c,sizeName:h,labelKey:u,labelName:d,...w})}computeFocusBounds(e){const t=EE(this,e);return t?VE.toCanvas(this.contentGroup,t.getBBox()):void 0}};HE.className="MapLineSeries",HE.type="map-line";var{commonSeriesOptionsDefs:UE,mapLineSeriesThemeableOptionsDef:zE,without:WE}=n.n1,jE={...zE,...WE(UE,["highlightStyle"]),type:(0,s.mw)((0,s.dY)("map-line")),idKey:(0,s.mw)(s.Yj),sizeKey:s.Yj,colorKey:s.Yj,labelKey:s.Yj,idName:s.Yj,sizeName:s.Yj,colorName:s.Yj,labelName:s.Yj,topology:s.eW,topologyIdKey:s.Yj,legendItemName:s.Yj,title:s.Yj};jE.colorRange=(0,s._L)((0,s.Uo)((0,s.jk)(s.yW),(0,s.O9)(1)));var $E={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-line",moduleFactory:e=>new HE(e),tooltipDefaults:{range:"exact"},themeTemplate:{...eE,series:{stroke:n.n1.SAFE_STROKE_FILL_OPERATION,colorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"divergingColors"},n.n1.SAFE_RANGE2_OPERATION]},strokeWidth:1,maxStrokeWidth:3,lineDash:[0],lineDashOffset:0,label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}},tooltip:{range:"exact"}}},KE={type:"series",name:"map-line",chartType:"topology",enterprise:!0,options:jE,create:e=>new HE(e)},{Property:YE,SeriesProperties:qE,SeriesTooltip:XE}=n.n1,ZE=class extends qE{constructor(){super(...arguments),this.topology=void 0,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.tooltip=new XE}};a([YE],ZE.prototype,"topology",2),a([YE],ZE.prototype,"stroke",2),a([YE],ZE.prototype,"strokeOpacity",2),a([YE],ZE.prototype,"strokeWidth",2),a([YE],ZE.prototype,"lineDash",2),a([YE],ZE.prototype,"lineDashOffset",2),a([YE],ZE.prototype,"tooltip",2);var{createDatumId:QE,SeriesNodePickMode:JE,Group:eA,Selection:tA,PointerEvents:iA}=n.n1,nA=class extends AE{constructor(e){super({moduleCtx:e,categoryKey:void 0,useLabelLayer:!0,pickModes:[JE.EXACT_SHAPE_MATCH]}),this.properties=new ZE,this._chartTopology=void 0,this.itemGroup=this.contentGroup.appendChild(new eA({name:"itemGroup"})),this.datumSelection=tA.select(this.itemGroup,()=>this.nodeFactory())}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get focusable(){return!1}setOptionsData(){}setChartData(){}get hasData(){return!1}renderToOffscreenCanvas(){return!0}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}setSeriesIndex(e){return!!super.setSeriesIndex(e)&&(this.contentGroup.zIndex=[0,e,0],this.highlightGroup.zIndex=[0,e,1],!0)}nodeFactory(){const e=new fE;return e.renderMode=2,e.lineJoin="round",e.lineCap="round",e.pointerEvents=iA.None,e}processData(){const{topology:e}=this;this.topologyBounds=e?.features.reduce((e,t)=>{const i=t.geometry;return null==i?e:mE(i,e)},void 0),null==e&&s.Vy.warnOnce("no topology was provided for [MapShapeBackgroundSeries]; nothing will be rendered.")}createNodeData(){const{id:e,topology:t,scale:i}=this;if(null==t)return;const n=[];return t.features.forEach((e,t)=>{const{geometry:s}=e,r=null!=s&&null!=i?CE(s,i):void 0;null!=r&&n.push({series:this,itemId:t,datum:e,datumIndex:0,index:t,projectedGeometry:r})}),{itemId:e,nodeData:n,labelData:[]}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:e}=this;this.updateSelections(),this.contentGroup.visible=this.visible;const{nodeData:t=[]}=this.contextNodeData??{};this.datumSelection=this.updateDatumSelection({nodeData:t,datumSelection:e}),this.updateDatumNodes({datumSelection:e})}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,e=>QE(e.index))}updateDatumNodes(e){const{properties:t}=this,{datumSelection:i}=e,{stroke:n,strokeOpacity:s,lineDash:r,lineDashOffset:o}=t,a=this.getStrokeWidth(t.strokeWidth);i.each((e,t)=>{const{projectedGeometry:i}=t;if(null==i)return e.visible=!1,void(e.projectedGeometry=void 0);e.visible=!0,e.projectedGeometry=i,e.stroke=n,e.strokeWidth=a,e.strokeOpacity=s,e.lineDash=r,e.lineDashOffset=o})}resetAnimation(){}getLegendData(){return[]}getTooltipContent(e){}computeFocusBounds(e){}};nA.className="MapLineBackgroundSeries",nA.type="map-line-background";var{mapLineBackgroundSeriesThemeableOptionsDef:sA}=n.n1,rA={...sA,type:(0,s.mw)((0,s.dY)("map-line-background")),topology:s.eW},oA={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-line-background",moduleFactory:e=>new nA(e),tooltipDefaults:{range:"exact"},themeTemplate:{...eE,series:{stroke:{$path:["./1",{$palette:"stroke"},{$palette:"secondHierarchyColors"}]},strokeWidth:1,lineDash:[0],lineDashOffset:0}}},aA={type:"series",name:"map-line-background",chartType:"topology",enterprise:!0,options:rA,create:e=>new nA(e)},lA=(e,t,i)=>{let n=e,s=n;for(const e of t)if(null==n||i(n.value,e)>0)n={value:e,next:n},s=n;else{for(;null!=s.next&&i(s.next.value,e)<=0;)s=s.next;s.next={value:e,next:s.next}}return n};function cA(e,t,i){const n=aE(e[0],void 0);if(null==n)return;const s=(n.lon0+n.lon1)/2,r=(n.lat0+n.lat1)/2,o=Math.abs(n.lon1-n.lon0),a=Math.abs(n.lat1-n.lat0),l=function(e){if(0===e.length)return;let t=0,i=0,n=0,[s,r]=e[e.length-1];for(const[o,a]of e){const e=s*a-o*r;n+=e,t+=(s+o)*e,i+=(r+a)*e,s=o,r=a}return n*=3,[t/n,i/n]}(e[0]),[c,h]=l,u=-lE(e,c,h);let d;const p=(e,t)=>e-.5*Math.max(t-u,0),g=(t,n,s)=>{const{distance:r,maxDistance:o}=i(e,t,n,s),a=Math.hypot(c-t,h-n),l=Math.min(Math.max(c,t-s/2),t+s/2),u=Math.min(Math.max(h,n-s/2),n+s/2),d=Math.hypot(c-l,h-u);return{distance:r,maxDistance:o,value:p(r,a),maxValue:p(o,d),x:t,y:n,stride:s}},f=(e,t,i,n)=>{const s=g(t,i,n);s.maxDistance>=0&&e.push(s)},m=Math.min(o,a)/2;let y={value:g(s,r,m),next:null};for(;null!=y;){const e=y.value,{distance:i,value:n,maxValue:s,x:r,y:o,stride:a}=e;if(y=y.next,i>0&&(null==d||n>d.value)&&(d=e),null!=d&&s-d.value<=t)continue;const l=a/2,c=[];f(c,r-l,o-l,l),f(c,r+l,o-l,l),f(c,r-l,o+l,l),f(c,r+l,o+l,l),c.sort(hA),y=lA(y,c,hA)}if(null==d)return;const{distance:v,x:b,y:C}=d;return{x:b,y:C,distance:v}}var hA=(e,t)=>t.maxValue-e.maxValue;function uA(e,t){const i=cA(e,t,(e,t,i,n)=>{const s=-lE(e,t,i);return{distance:s,maxDistance:s+n*Math.SQRT2}});if(null==i)return;const{x:n,y:s}=i;return[n,s]}function dA(e,t){let i;switch(e.type){case"GeometryCollection":return e.geometries.flatMap(e=>dA(e,t));case"MultiPoint":return e.coordinates;case"Point":return[e.coordinates];case"MultiPolygon":{const n=yE(e);i=null!=n?uA(n,t):void 0;break}case"Polygon":{const n=e.coordinates;i=null!=n?uA(n,t):void 0;break}case"MultiLineString":{const t=vE(e);i=null!=t?sE(t)?.point:void 0;break}case"LineString":{const t=e.coordinates;i=sE(t)?.point;break}}return null!=i?[i]:[]}var{BBox:pA}=n.n1;function gA(e){if(!e)return;const{range:t}=e,i=t[0][0],n=t[0][1],s=t[1][0]-i,r=t[1][1]-n,o=new pA(i,n,s,r);return{series:o,axis:o}}var{FillGradientDefaults:fA,FillPatternDefaults:mA,FillImageDefaults:yA,Property:vA,SeriesProperties:bA,SeriesTooltip:CA,Label:wA}=n.n1,SA=class extends wA{constructor(){super(...arguments),this.placement="bottom"}};a([vA],SA.prototype,"placement",2);var xA=class extends bA{constructor(){super(...arguments),this.topology=void 0,this.idKey=void 0,this.topologyIdKey="name",this.idName=void 0,this.latitudeKey=void 0,this.latitudeName=void 0,this.longitudeKey=void 0,this.longitudeName=void 0,this.labelKey=void 0,this.labelName=void 0,this.colorRange=void 0,this.shape="circle",this.size=6,this.fill="black",this.fillGradientDefaults=new fA,this.fillPatternDefaults=new mA,this.fillImageDefaults=new yA,this.fillOpacity=1,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.label=new SA,this.tooltip=new CA}};a([vA],xA.prototype,"topology",2),a([vA],xA.prototype,"title",2),a([vA],xA.prototype,"legendItemName",2),a([vA],xA.prototype,"idKey",2),a([vA],xA.prototype,"topologyIdKey",2),a([vA],xA.prototype,"idName",2),a([vA],xA.prototype,"latitudeKey",2),a([vA],xA.prototype,"latitudeName",2),a([vA],xA.prototype,"longitudeKey",2),a([vA],xA.prototype,"longitudeName",2),a([vA],xA.prototype,"labelKey",2),a([vA],xA.prototype,"labelName",2),a([vA],xA.prototype,"sizeKey",2),a([vA],xA.prototype,"sizeName",2),a([vA],xA.prototype,"colorKey",2),a([vA],xA.prototype,"colorName",2),a([vA],xA.prototype,"colorRange",2),a([vA],xA.prototype,"shape",2),a([vA],xA.prototype,"size",2),a([vA],xA.prototype,"maxSize",2),a([vA],xA.prototype,"sizeDomain",2),a([vA],xA.prototype,"fill",2),a([vA],xA.prototype,"fillGradientDefaults",2),a([vA],xA.prototype,"fillPatternDefaults",2),a([vA],xA.prototype,"fillImageDefaults",2),a([vA],xA.prototype,"fillOpacity",2),a([vA],xA.prototype,"stroke",2),a([vA],xA.prototype,"strokeWidth",2),a([vA],xA.prototype,"strokeOpacity",2),a([vA],xA.prototype,"lineDash",2),a([vA],xA.prototype,"lineDashOffset",2),a([vA],xA.prototype,"itemStyler",2),a([vA],xA.prototype,"label",2),a([vA],xA.prototype,"tooltip",2);var{CachedTextMeasurerPool:EA,fromToMotion:AA,StateMachine:MA,getMissCount:TA,createDatumId:DA,SeriesNodePickMode:IA,valueProperty:RA,computeMarkerFocusBounds:kA,ColorScale:PA,LinearScale:_A,Group:LA,Selection:NA,Text:OA,Marker:FA,applyShapeStyle:GA,getShapeStyle:BA}=n.n1,VA=class extends AE{constructor(e){super({moduleCtx:e,categoryKey:void 0,useLabelLayer:!0,pickModes:[IA.EXACT_SHAPE_MATCH,IA.NEAREST_NODE],usesPlacedLabels:!0}),this.properties=new xA,this._chartTopology=void 0,this.colorScale=new PA,this.sizeScale=new _A,this.markerGroup=this.contentGroup.appendChild(new LA({name:"markerGroup"})),this.labelSelection=NA.select(this.labelGroup,OA,!1),this.markerSelection=NA.select(this.markerGroup,FA,!1),this.highlightMarkerSelection=NA.select(this.highlightNode,FA),this.animationState=new MA("empty",{empty:{update:{target:"ready",action:()=>this.animateMarkers()},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",resize:()=>this.resetAllAnimation(),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:()=>this.animateMarkers()},resize:{target:"ready",action:()=>this.resetAllAnimation()},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:()=>this.resetAllAnimation()},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get hasData(){const e=null!=this.properties.latitudeKey&&null!=this.properties.longitudeKey;return super.hasData&&(null!=this.topology||e)}renderToOffscreenCanvas(){return!0}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}setSeriesIndex(e){return!!super.setSeriesIndex(e)&&(this.contentGroup.zIndex=[3,e],this.highlightGroup.zIndex=[4,e],!0)}isLabelEnabled(){return null!=this.properties.labelKey&&this.properties.label.enabled}async processData(e){if(null==this.data)return;const{data:t,topology:i,sizeScale:n,colorScale:s}=this,{topologyIdKey:r,idKey:o,latitudeKey:a,longitudeKey:l,sizeKey:c,colorKey:h,labelKey:u,sizeDomain:d,colorRange:p}=this.properties,g=new Map;i?.features.forEach(e=>{const t=e.properties?.[r];null!=t&&g.set(t,e)});const f=this.sizeScale.type,m=this.colorScale.type,y=this.scale?.type,v=null!=a&&null!=l,{dataModel:b,processedData:C}=await this.requestDataModel(e,t,{props:[...null!=o?[RA(o,y,{id:"idValue",includeProperty:!1}),RA(o,y,{id:"featureValue",includeProperty:!1,processor:()=>e=>g.get(e)})]:[],...v?[RA(a,y,{id:"latValue"}),RA(l,y,{id:"lonValue"})]:[],...u?[RA(u,"band",{id:"labelValue"})]:[],...c?[RA(c,f,{id:"sizeValue"})]:[],...h?[RA(h,m,{id:"colorValue"})]:[]]}),w=null!=o?b.resolveColumnById(this,"featureValue",C):void 0,S=v?b.resolveColumnById(this,"latValue",C):void 0,x=v?b.resolveColumnById(this,"lonValue",C):void 0;if(this.topologyBounds=C.dataSources.get(this.id)?.reduce((e,t,i)=>{const n=w?.[i],s=n?.geometry;if(null!=s&&(e=mE(s,e)),null!=S&&null!=x){const t=x[i],n=S[i];e=oE(e,t,n,t,n)}return e},void 0),null!=c){const e=b.resolveProcessedDataIndexById(this,"sizeValue"),t=C.domain.values[e]??[];n.domain=d??t}if(null!=p&&this.isColorScaleValid()){const e=b.resolveProcessedDataIndexById(this,"colorValue");s.domain=C.domain.values[e],s.range=p,s.update()}this.animationState.transition("updateData")}isColorScaleValid(){const{colorKey:e}=this.properties;if(!e)return!1;const{dataModel:t,processedData:i}=this;if(!t||!i)return!1;const n=t.resolveProcessedDataIndexById(this,"colorValue"),s=i.input.count,r=TA(this,i.defs.values[n].missing);return!(0===s||s===r)}getLabelDatum(e,t,i,n,s,r){if(null==t)return;const{idKey:o,idName:a,latitudeKey:l,latitudeName:c,longitudeKey:h,longitudeName:u,sizeKey:d,sizeName:p,colorKey:g,colorName:f,labelKey:m,labelName:y,label:v,shape:b}=this.properties,{placement:C}=v,w=this.getLabelText(v,{value:t,datum:e,idKey:o,idName:a,latitudeKey:l,latitudeName:c,longitudeKey:h,longitudeName:u,sizeKey:d,sizeName:p,colorKey:g,colorName:f,labelKey:m,labelName:y});if(null==w)return;const{width:S,height:x}=EA.measureText(String(w),{font:r});return{point:{x:i,y:n,size:s},label:{width:S,height:x,text:w},anchor:FA.anchor(b),placement:C}}createNodeData(){const{id:e,dataModel:t,processedData:i,sizeScale:n,properties:r,scale:o}=this,{idKey:a,latitudeKey:l,longitudeKey:c,sizeKey:h,colorKey:u,labelKey:d,label:p}=r;if(null==t||null==i||null==o)return;const g=null!=l&&null!=c,f=null!=a?t.resolveColumnById(this,"idValue",i):void 0,m=null!=a?t.resolveColumnById(this,"featureValue",i):void 0,y=g?t.resolveColumnById(this,"latValue",i):void 0,v=g?t.resolveColumnById(this,"lonValue",i):void 0,b=null!=d?t.resolveColumnById(this,"labelValue",i):void 0,C=null!=h?t.resolveColumnById(this,"sizeValue",i):void 0,w=null!=u?t.resolveColumnById(this,"colorValue",i):void 0,S=r.maxSize??r.size;n.range=[Math.min(r.size,S),S];const x=p.getFont();let E;null!=f&&null!=m&&(E=new Map,i.dataSources.get(this.id)?.forEach((e,t)=>{const i=f[t],n=m[t]?.geometry??void 0,s=null!=n&&null!=o?CE(n,o):void 0;null!=i&&null!=s&&E.set(i,s)}));const A=[],M=[],T=[];if((i.dataSources.get(this.id)??[]).forEach((e,t)=>{const i=f?.[t],s=v?.[t],a=y?.[t],c=w?.[t],h=C?.[t],u=b?.[t],d=null!=h?n.convert(h,{clamp:!0}):r.size,p=null!=i?E?.get(i):void 0;if(null!=i&&null==CE&&T.push(i),null!=s&&null!=a){const[n,r]=o.convert([s,a]),p=this.getLabelDatum(e,u,n,r,d,x);p&&M.push(p),A.push({series:this,itemId:l,datum:e,datumIndex:t,index:-1,idValue:i,lonValue:s,latValue:a,labelValue:u,sizeValue:h,colorValue:c,point:{x:n,y:r,size:d},midPoint:{x:n,y:r}})}else null!=p&&dA(p,1).forEach(([n,r],o)=>{const p=this.getLabelDatum(e,u,n,r,d,x);p&&M.push(p),A.push({series:this,itemId:l,datum:e,datumIndex:t,index:o,idValue:i,lonValue:s,latValue:a,labelValue:u,sizeValue:h,colorValue:c,point:{x:n,y:r,size:d},midPoint:{x:n,y:r}})})}),T.length>10){const e=T.length-10;T.length=10,T.push(`(+${e} more)`)}return T.length>0&&s.Vy.warnOnce("some data items do not have matches in the provided topology",T),{itemId:e,nodeData:A,labelData:M}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}checkScaleChange(){return this.previousScale!==this.scale&&(this.previousScale=this.scale,!0)}update({seriesRect:e}){const t=this.checkResize(e),i=this.checkScaleChange(),{markerSelection:n,highlightMarkerSelection:s}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();let r=this.ctx.highlightManager?.getActiveHighlight();null==r||r.series===this&&null!=r.datum||(r=void 0);const o=this.contextNodeData?.nodeData??[];this.markerSelection=this.updateMarkerSelection({markerData:o,markerSelection:n}),this.updateMarkerNodes({markerSelection:n,isHighlight:!1,highlightedDatum:r}),this.highlightMarkerSelection=this.updateMarkerSelection({markerData:null!=r?[r]:[],markerSelection:s}),this.updateMarkerNodes({markerSelection:s,isHighlight:!0,highlightedDatum:r}),(i||t)&&this.animationState.transition("resize"),this.animationState.transition("update")}updatePlacedLabelData(e){this.labelSelection=this.labelSelection.update(e,e=>{e.pointerEvents=n.n1.PointerEvents.None}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(e){const{labelSelection:t}=e,{color:i,fontStyle:n,fontWeight:s,fontSize:r,fontFamily:o}=this.properties.label;t.each((e,{x:t,y:a,width:l,height:c,text:h})=>{e.visible=!0,e.x=t+l/2,e.y=a+c/2,e.text=h,e.fill=i,e.fontStyle=n,e.fontWeight=s,e.fontSize=r,e.fontFamily=o,e.textAlign="center",e.textBaseline="middle"})}updateMarkerSelection(e){const{markerData:t,markerSelection:i}=e;return i.update(t,void 0,e=>DA([e.index,e.idValue,e.lonValue,e.latValue]))}getMarkerItemBaseStyle(e){const{properties:t}=this,i=e?t.highlightStyle.item:void 0;return BA({shape:t.shape,size:t.size,fill:i?.fill??t.fill,fillOpacity:i?.fillOpacity??t.fillOpacity,stroke:i?.stroke??t.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(t.strokeWidth),strokeOpacity:i?.strokeOpacity??t.strokeOpacity,lineDash:i?.lineDash??t.lineDash,lineDashOffset:i?.lineDashOffset??t.lineDashOffset},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}getMarkerItemStyleOverrides(e,t,i,n,s,r){const{id:o,properties:a,colorScale:l,sizeScale:c}=this,{colorRange:h,itemStyler:u}=a;let d;if(d??(d={}),r||null==i||(d.fill=this.isColorScaleValid()?l.convert(i):h?.[0]??a.fill),null!=n&&(d.size=c.convert(n,{clamp:!0})),null!=u){const i=this.cachedDatumCallback(DA(e,r?"highlight":"node"),()=>this.callWithContext(u,{seriesId:o,datum:t,highlighted:r,...s,...d}));d??(d={}),Object.assign(d,i)}return d}updateMarkerNodes(e){const{markerSelection:t,isHighlight:i,highlightedDatum:n}=e,s=this.getMarkerItemBaseStyle(i),r=gA(this.scale);t.each((e,t)=>{const{datumIndex:o,datum:a,point:l,colorValue:c,sizeValue:h}=t,u=this.getMarkerItemStyleOverrides(String(o),a,c,h,s,i);e.shape=u?.shape??s.shape,e.size=u?.size??s.size,GA(e,s,u,r),e.x=l.x,e.y=l.y,e.scalingCenterX=l.x,e.scalingCenterY=l.y,e.zIndex=i||null==n||a!==n.datum?0:1})}isProcessedDataAnimatable(){return!0}resetAnimation(e){"initial"===e?this.animationState.transition("reset"):"ready"===e&&this.animationState.transition("skip")}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),this.ctx.animationManager.skipCurrentBatch(),this.labelSelection.cleanup(),this.markerSelection.cleanup(),this.highlightMarkerSelection.cleanup()}animateMarkers(){const{animationManager:e}=this.ctx;AA(this.id,"markers",e,[this.markerSelection,this.highlightMarkerSelection],{fromFn:(e,t,i)=>"removed"===i?{scalingX:1,scalingY:1}:null==e.previousDatum?{scalingX:0,scalingY:0}:{scalingX:e.scalingX,scalingY:e.scalingY},toFn:(e,t,i)=>"removed"===i?{scalingX:0,scalingY:0}:{scalingX:1,scalingY:1}})}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}pickNodeClosestDatum(e){const{x:t,y:i}=e;let n,s=1/0;return this.contextNodeData?.nodeData.forEach(e=>{const{x:r,y:o,size:a}=e.point,l=Math.max(Math.abs(r-t)-a,0),c=Math.max(Math.abs(o-i)-a,0),h=l*l+c*c;h<s&&(s=h,n=e)}),null!=n?{datum:n,distance:Math.sqrt(s)}:void 0}legendItemSymbol(e){const{dataModel:t,processedData:i,properties:n}=this,{shape:s,fillOpacity:r,stroke:o,strokeWidth:a,strokeOpacity:l,lineDash:c,lineDashOffset:h}=n;let{fill:u}=n;if(null!=e&&this.isColorScaleValid()){const n=t.resolveColumnById(this,"colorValue",i)[e];u=this.colorScale.convert(n)}return{marker:BA({shape:s,fill:u,fillOpacity:r,stroke:o,strokeWidth:a,strokeOpacity:l,lineDash:c,lineDashOffset:h},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}}getLegendData(e){const{processedData:t,dataModel:i}=this;if(null==t||null==i)return[];const{id:n,visible:s}=this,{title:r,legendItemName:o,idName:a,idKey:l,colorKey:c,colorName:h,colorRange:u,showInLegend:d}=this.properties;return"gradient"===e&&null!=c&&null!=u?[{legendType:"gradient",enabled:s,seriesId:n,colorName:h,colorRange:u,colorDomain:t.domain.values[i.resolveProcessedDataIndexById(this,"colorValue")]}]:"category"===e?[{legendType:"category",id:n,itemId:n,seriesId:n,enabled:s,label:{text:o??r??a??l??n},symbol:this.legendItemSymbol(),legendItemName:o,hideInLegend:!d}]:[]}getTooltipContent(e){const{id:t,dataModel:i,processedData:n,properties:s}=this,{idKey:r,idName:o,latitudeKey:a,latitudeName:l,longitudeKey:c,longitudeName:h,colorKey:u,colorName:d,sizeKey:p,sizeName:g,labelKey:f,labelName:m,title:y,legendItemName:v,tooltip:b}=s;if(!i||!n)return;const C=n.dataSources.get(this.id)?.[e],w=null!=p?i.resolveColumnById(this,"sizeValue",n)[e]:void 0,S=null!=u?i.resolveColumnById(this,"colorValue",n)[e]:void 0,x=[];if(null!=w&&x.push({label:g,fallbackLabel:p,value:String(w)}),null!=S&&x.push({label:d,fallbackLabel:u,value:String(S)}),null!=f&&f!==r){const t=i.resolveColumnById(this,"labelValue",n)[e];x.push({label:m,fallbackLabel:f,value:t})}let E;if(null!=r)E=i.resolveColumnById(this,"idValue",n)[e];else if(null!=a&&null!=c){const t=i.resolveColumnById(this,"latValue",n)[e],s=i.resolveColumnById(this,"lonValue",n)[e];E=`${Math.abs(t).toFixed(4)}° ${t>=0?"N":"S"}, ${Math.abs(s).toFixed(4)}° ${s>=0?"W":"E"}`}const A=this.getMarkerItemBaseStyle(!1);return Object.assign(A,this.getMarkerItemStyleOverrides(String(e),e,S,w,A,!1)),this.formatTooltipWithContext(b,{heading:E,title:y??v,symbol:this.legendItemSymbol(e),data:x},{seriesId:t,datum:C,title:y,idKey:r,idName:o,latitudeKey:a,latitudeName:l,longitudeKey:c,longitudeName:h,colorKey:u,colorName:d,sizeKey:p,sizeName:g,labelKey:f,labelName:m,...A})}getFormattedMarkerStyle(e){const{datumIndex:t,colorValue:i,sizeValue:n}=e,s=this.getMarkerItemBaseStyle(!1);return Object.assign(s,this.getMarkerItemStyleOverrides(String(t),t,i,n,s,!1)),{size:s.size}}computeFocusBounds(e){return kA(this,e)}};VA.className="MapMarkerSeries",VA.type="map-marker";var{commonSeriesOptionsDefs:HA,mapMarkerSeriesThemeableOptionsDef:UA,without:zA}=n.n1,WA={...UA,...zA(HA,["highlightStyle"]),type:(0,s.mw)((0,s.dY)("map-marker")),idKey:s.Yj,latitudeKey:s.Yj,longitudeKey:s.Yj,sizeKey:s.Yj,colorKey:s.Yj,labelKey:s.Yj,idName:s.Yj,latitudeName:s.Yj,longitudeName:s.Yj,sizeName:s.Yj,colorName:s.Yj,labelName:s.Yj,topology:s.eW,topologyIdKey:s.Yj,legendItemName:s.Yj,title:s.Yj},jA={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-marker",moduleFactory:e=>new VA(e),tooltipDefaults:{range:"exact"},themeTemplate:{...eE,series:{shape:"circle",maxSize:30,fill:{$palette:"fill"},stroke:{$palette:"stroke"},colorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"divergingColors"},n.n1.SAFE_RANGE2_OPERATION]},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:n.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:n.n1.FILL_IMAGE_DEFAULTS,fillOpacity:.5,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}},tooltip:{range:"exact"}}},$A={type:"series",name:"map-marker",chartType:"topology",enterprise:!0,options:WA,create:e=>new VA(e),validate(e,t,i){const n=(0,s.tf)(e,t,i),{cleared:r,invalid:o}=n;if(null==r?.idKey&&(null==r?.latitudeKey||null==r?.longitudeKey)){const e=e=>i?`${i}.${e}`:e,t=`Either \`${e("idKey")}\` or both \`${e("latitudeKey")}\` and \`${e("longitudeKey")}\` are required.`;o.push(new s.yI("required",t,null,i))}return n}};function KA(e,t,i,n,s){const[r,o]=e,[a,l]=t,c=1/s,h=a-r,u=l-o,[d,p]=o<=l?e:t,[g,f]=r<=a?e:t,[m,y]=o<=l?t:e,[v,b]=r<=a?t:e;let C=1/0;if(0!==h){const e=u/h;for(let t=0;t<=1;t+=1){const s=0===t?c:-c,a=(e*r-o-s*i+n)/(e-s);if(a>=g&&a<=v){const e=2*Math.abs(i-a);C=Math.min(C,e)}}}else for(let e=0;e<=1;e+=1){const t=(0===e?c:-c)*(r-i)+n;if(t>=p&&t<=y){const e=2*Math.abs(n-t)*s;C=Math.min(C,e)}}const w=s,S=Math.abs((d-i)/(p-n)),x=Math.abs((m-i)/(y-n));if(y<n&&x<w){const e=2*Math.abs(n-y)*s;C=Math.min(C,e)}else if(p>n&&S<w){const e=2*Math.abs(n-p)*s;C=Math.min(C,e)}const E=Math.abs((f-n)/(g-i)),A=Math.abs((b-n)/(v-i));if(v<i&&A<c){const e=2*Math.abs(i-v);C=Math.min(C,e)}else if(g>i&&E<c){const e=2*Math.abs(i-g);C=Math.min(C,e)}return C}function YA(e,t,i){i>=t&&(e.maxX=Math.min(e.maxX,i-t)),i<=t&&(e.minX=Math.max(e.minX,i-t))}function qA(e,t,i,n,s,r){const o=s-r/2,a=s+r/2,[l,c]=t,[h,u]=i,d=h-l,p=u-c,[g,f]=l<=h?t:i,[m,y]=l<=h?i:t;if(0!==d){const t=p/d;for(let i=0;i<=1;i+=1){const s=((0===i?o:a)-c)/t+l;s>=g&&s<=m&&YA(e,n,s)}}else Math.max(o,Math.min(c,u))<=Math.min(a,Math.max(c,u))&&YA(e,n,l);return m<n&&y>=o&&y<=a?YA(e,n,m):g>n&&f>=o&&f<=a&&YA(e,n,g),e}var{Property:XA,SeriesProperties:ZA,SeriesTooltip:QA,FillGradientDefaults:JA,FillPatternDefaults:eM,FillImageDefaults:tM}=n.n1,iM=class extends ZA{constructor(){super(...arguments),this.topology=void 0,this.idKey="",this.idName=void 0,this.topologyIdKey="name",this.labelKey=void 0,this.labelName=void 0,this.colorRange=void 0,this.fill="black",this.fillGradientDefaults=new JA,this.fillPatternDefaults=new eM,this.fillImageDefaults=new tM,this.fillOpacity=1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.padding=0,this.label=new hm,this.tooltip=new QA}};a([XA],iM.prototype,"topology",2),a([XA],iM.prototype,"title",2),a([XA],iM.prototype,"legendItemName",2),a([XA],iM.prototype,"idKey",2),a([XA],iM.prototype,"idName",2),a([XA],iM.prototype,"topologyIdKey",2),a([XA],iM.prototype,"labelKey",2),a([XA],iM.prototype,"labelName",2),a([XA],iM.prototype,"colorKey",2),a([XA],iM.prototype,"colorName",2),a([XA],iM.prototype,"colorRange",2),a([XA],iM.prototype,"fill",2),a([XA],iM.prototype,"fillGradientDefaults",2),a([XA],iM.prototype,"fillPatternDefaults",2),a([XA],iM.prototype,"fillImageDefaults",2),a([XA],iM.prototype,"fillOpacity",2),a([XA],iM.prototype,"stroke",2),a([XA],iM.prototype,"strokeOpacity",2),a([XA],iM.prototype,"strokeWidth",2),a([XA],iM.prototype,"lineDash",2),a([XA],iM.prototype,"lineDashOffset",2),a([XA],iM.prototype,"padding",2),a([XA],iM.prototype,"itemStyler",2),a([XA],iM.prototype,"label",2),a([XA],iM.prototype,"tooltip",2);var{getMissCount:nM,createDatumId:sM,SeriesNodePickMode:rM,valueProperty:oM,CachedTextMeasurerPool:aM,TextUtils:lM,ColorScale:cM,Group:hM,Selection:uM,Text:dM,PointerEvents:pM,applyShapeStyle:gM,getShapeStyle:fM}=n.n1,mM=n.n1.MercatorScale.fixedScale(),yM=class extends AE{constructor(e){super({moduleCtx:e,categoryKey:void 0,useLabelLayer:!0,pickModes:[rM.EXACT_SHAPE_MATCH,rM.NEAREST_NODE]}),this.properties=new iM,this._chartTopology=void 0,this.colorScale=new cM,this.itemGroup=this.contentGroup.appendChild(new hM({name:"itemGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new hM({name:"itemLabelGroup"})),this.datumSelection=uM.select(this.itemGroup,()=>this.nodeFactory()),this.labelSelection=uM.select(this.itemLabelGroup,dM),this.highlightDatumSelection=uM.select(this.highlightNode,()=>this.nodeFactory()),this.previousLabelLayouts=void 0,this._previousDatumMidPoint=void 0,this.itemLabelGroup.pointerEvents=pM.None}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get hasData(){return super.hasData&&null!=this.topology}renderToOffscreenCanvas(){return!0}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}setSeriesIndex(e){return!!super.setSeriesIndex(e)&&(this.contentGroup.zIndex=[1,e],this.highlightGroup.zIndex=[2,e],!0)}isLabelEnabled(){return null!=this.properties.labelKey&&this.properties.label.enabled}nodeFactory(){const e=new fE;return e.renderMode=1,e.lineJoin="round",e}async processData(e){if(null==this.data)return;const{data:t,topology:i,colorScale:n}=this,{topologyIdKey:r,idKey:o,colorKey:a,labelKey:l,colorRange:c}=this.properties,h=new Map;i?.features.forEach(e=>{const t=e.properties?.[r];null!=t&&bE(e.geometry,1)&&h.set(t,e)});const u=this.colorScale.type,d=this.scale?.type,{dataModel:p,processedData:g}=await this.requestDataModel(e,t,{props:[oM(o,d,{id:"idValue",includeProperty:!1}),oM(o,d,{id:"featureValue",includeProperty:!1,processor:()=>e=>h.get(e)}),...l?[oM(l,"band",{id:"labelValue"})]:[],...a?[oM(a,u,{id:"colorValue"})]:[]]}),f=p.resolveColumnById(this,"featureValue",g);if(this.topologyBounds=f.reduce((e,t)=>{const i=t?.geometry;return null==i?e:mE(i,e)},void 0),null!=c&&this.isColorScaleValid()){const e=p.resolveProcessedDataIndexById(this,"colorValue");n.domain=g.domain.values[e],n.range=c,n.update()}null==i&&s.Vy.warnOnce("no topology was provided for [MapShapeSeries]; nothing will be rendered.")}isColorScaleValid(){const{colorKey:e}=this.properties;if(!e)return!1;const{dataModel:t,processedData:i}=this;if(!t||!i)return!1;const n=t.resolveProcessedDataIndexById(this,"colorValue"),s=i.input.count,r=nM(this,i.defs.values[n].missing);return!(0===s||s===r)}getLabelLayout(e,t,i,n,s){if(null==t||null==n)return;const{idKey:r,idName:o,colorKey:a,colorName:l,labelKey:c,labelName:h,padding:u,label:d}=this.properties,p=this.getLabelText(d,{value:t,datum:e,idKey:r,idName:o,colorKey:a,colorName:l,labelKey:c,labelName:h});if(null==p)return;const g=aM.measureText(String(p),{font:i}),f=p.split("\n").length,m=(g.width+2*u)/(f*lM.getLineHeight(d.fontSize)+2*u);if(s?.geometry===n&&s?.labelText===p&&s?.aspectRatio===m)return s;const y=yE(CE(n,mM));if(null==y)return;const v=function(e,{aspectRatio:t,precision:i}){const n=cA(e,i,(e,i,n,s)=>{const r=function(e,t,i,n){let s=!1,r=1/0;for(const o of e){let e=o[o.length-1],[a,l]=e;for(const c of o){const[o,h]=c;h>i!=l>i&&t<(a-o)*(i-h)/(l-h)+o&&(s=!s);const u=KA(e,c,t,i,n);r=Math.min(r,u),e=c,a=o,l=h}}return(s?1:-1)*r}(e,i,n,t),o=r+2*s*t;return{distance:r*Math.SQRT2,maxDistance:o*Math.SQRT2}});if(null==n)return;const{x:s,y:r,distance:o}=n;return{x:s,y:r,maxWidth:o/Math.SQRT2}}(y,{aspectRatio:m,precision:.001});if(null==v)return;const{x:b,y:C,maxWidth:w}=v;return{geometry:n,labelText:p,aspectRatio:m,x:b,y:C,maxWidth:w,fixedPolygon:y}}getLabelDatum(e,t){const{scale:i}=this;if(null==i)return;const{padding:n,label:s}=this.properties,{labelText:r,aspectRatio:o,x:a,y:l,maxWidth:c,fixedPolygon:h}=e,u={width:Math.ceil(c*t),height:Math.ceil(c*t/o),meta:a},d=nm(r,s,{padding:n},(e,i)=>{if(!i)return u;const n=function(e,t,i,n){const s={minX:-1/0,maxX:1/0};for(const r of e){let e=r[r.length-1];for(const o of r)qA(s,e,o,t,i,n),e=o}const{minX:r,maxX:o}=s;return Number.isFinite(r)&&Number.isFinite(o)?{x:t+(r+o)/2,width:o-r}:{x:t,width:0}}(h,a,l,e/t);return{width:n.width*t,height:e,meta:n.x}});if(null==d)return;const[{text:p,fontSize:g,lineHeight:f,width:m},y]=d;if(p===lM.EllipsisChar)return;const v=m<u.width?a:y,b=this.scale.convert(mM.invert([v,l]));return{x:b[0],y:b[1],text:p,fontSize:g,lineHeight:f}}createNodeData(){const{id:e,dataModel:t,processedData:i,properties:n,scale:r,previousLabelLayouts:o}=this,{idKey:a,colorKey:l,labelKey:c,label:h}=n;if(null==t||null==i)return;const u=null!=r?(r.range[1][0]-r.range[0][0])/r.bounds.width:NaN,d=t.resolveColumnById(this,"idValue",i),p=t.resolveColumnById(this,"featureValue",i),g=null!=c?t.resolveColumnById(this,"labelValue",i):void 0,f=null!=l?t.resolveColumnById(this,"colorValue",i):void 0,m=h.getFont(),y=new Map;this.previousLabelLayouts=y;const v=[],b=[],C=[];if((i.dataSources.get(this.id)??[]).forEach((e,t)=>{const i=d[t],n=f?.[t],s=g?.[t],l=p[t]?.geometry??void 0;null==l&&C.push(i);const c=this.getLabelLayout(e,s,m,l,o?.get(i));null!=c&&y.set(i,c);const h=null!=c&&null!=r?this.getLabelDatum(c,u):void 0;null!=h&&b.push(h);const w=null!=l&&null!=r?CE(l,r):void 0;v.push({series:this,itemId:a,datum:e,datumIndex:t,idValue:i,colorValue:n,labelValue:s,projectedGeometry:w})}),C.length>10){const e=C.length-10;C.length=10,C.push(`(+${e} more)`)}return C.length>0&&s.Vy.warnOnce("some data items do not have matches in the provided topology",C),{itemId:e,nodeData:v,labelData:b}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:e,labelSelection:t,highlightDatumSelection:i}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();let n=this.ctx.highlightManager?.getActiveHighlight();null==n||n.series===this&&null!=n.datum||(n=void 0);const s=this.contextNodeData?.nodeData??[],r=this.contextNodeData?.labelData??[];this.datumSelection=this.updateDatumSelection({nodeData:s,datumSelection:e}),this.updateDatumNodes({datumSelection:e,isHighlight:!1}),this.labelSelection=this.updateLabelSelection({labelData:r,labelSelection:t}),this.updateLabelNodes({labelSelection:t}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:null!=n?[n]:[],datumSelection:i}),this.updateDatumNodes({datumSelection:i,isHighlight:!0})}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,e=>sM(e.idValue))}getItemBaseStyle(e){const{properties:t}=this,i=e?t.highlightStyle.item:void 0;return fM({fill:i?.fill??t.fill,fillOpacity:i?.fillOpacity??t.fillOpacity,stroke:i?.stroke??t.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(t.strokeWidth),strokeOpacity:i?.strokeOpacity??t.strokeOpacity,lineDash:i?.lineDash??t.lineDash,lineDashOffset:i?.lineDashOffset??t.lineDashOffset},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}getItemStyleOverrides(e,t,i,n,s){const{id:r,properties:o,colorScale:a}=this,{colorRange:l,itemStyler:c}=o;let h;if(s||null==i||(h??(h={}),h.fill=this.isColorScaleValid()?a.convert(i):l?.[0]??o.fill),null!=c){const i=this.cachedDatumCallback(sM(e,s?"highlight":"node"),()=>this.callWithContext(c,{seriesId:r,datum:t,highlighted:s,...n,...h}));h??(h={}),Object.assign(h,i)}return fM(h,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}updateDatumNodes(e){const{datumSelection:t,isHighlight:i}=e,n=this.getItemBaseStyle(i),s=gA(this.scale);t.each((e,t)=>{const{datum:r,datumIndex:o,colorValue:a,projectedGeometry:l}=t;if(null==l)return e.visible=!1,void(e.projectedGeometry=void 0);const c=this.getItemStyleOverrides(String(o),r,a,n,i);e.visible=!0,e.projectedGeometry=l,gM(e,n,c,s)})}updateLabelSelection(e){const t=this.isLabelEnabled()?e.labelData:[];return e.labelSelection.update(t)}updateLabelNodes(e){const{labelSelection:t}=e,{color:i,fontStyle:n,fontWeight:s,fontFamily:r}=this.properties.label;t.each((e,{x:t,y:o,text:a,fontSize:l,lineHeight:c})=>{e.visible=!0,e.x=t,e.y=o,e.text=a,e.fill=i,e.fontStyle=n,e.fontWeight=s,e.fontSize=l,e.lineHeight=c,e.fontFamily=r,e.textAlign="center",e.textBaseline="middle"})}resetAnimation(){}pickNodeClosestDatum({x:e,y:t}){let i,n=1/0;return this.datumSelection.each((s,r)=>{const o=s.distanceSquared(e,t);o<n&&(n=o,i=r)}),null!=i?{datum:i,distance:Math.sqrt(n)}:void 0}datumMidPoint(e){const{_previousDatumMidPoint:t}=this;if(t?.datum===e)return t.point;const i=e.projectedGeometry,n=null!=i?yE(i):void 0,s=null!=n?uA(n,2):void 0,r=null!=s?{x:s[0],y:s[1]}:void 0;return this._previousDatumMidPoint={datum:e,point:r},r}legendItemSymbol(e){const{dataModel:t,processedData:i,properties:n}=this,{fillOpacity:s,stroke:r,strokeWidth:o,strokeOpacity:a,lineDash:l,lineDashOffset:c}=n;let{fill:h}=n;if(null!=e&&this.isColorScaleValid()){const n=t.resolveColumnById(this,"colorValue",i)[e];h=this.colorScale.convert(n)}return{marker:fM({fill:h,fillOpacity:s,stroke:r,strokeWidth:o,strokeOpacity:a,lineDash:l,lineDashOffset:c},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}}getLegendData(e){const{processedData:t,dataModel:i}=this;if(null==t||null==i)return[];const{id:n,visible:s}=this,{title:r,legendItemName:o,idKey:a,idName:l,colorKey:c,colorName:h,colorRange:u,showInLegend:d}=this.properties;return"gradient"===e&&null!=c&&null!=u?[{legendType:"gradient",enabled:s,seriesId:n,colorName:h,colorRange:u,colorDomain:t.domain.values[i.resolveProcessedDataIndexById(this,"colorValue")]}]:"category"===e?[{legendType:"category",id:n,itemId:n,seriesId:n,enabled:s,label:{text:o??r??l??a},symbol:this.legendItemSymbol(),legendItemName:o,hideInLegend:!d}]:[]}getTooltipContent(e){const{id:t,dataModel:i,processedData:n,properties:s}=this,{idKey:r,idName:o,colorKey:a,colorName:l,labelKey:c,labelName:h,legendItemName:u,title:d,tooltip:p}=s;if(!i||!n)return;const g=n.dataSources.get(this.id)?.[e],f=i.resolveColumnById(this,"idValue",n)[e],m=null!=a?i.resolveColumnById(this,"colorValue",n)[e]:void 0,y=[];if(null!=m&&y.push({label:l,fallbackLabel:a,value:String(m)}),null!=c&&c!==r){const t=i.resolveColumnById(this,"labelValue",n)[e];y.push({label:h,fallbackLabel:c,value:t})}const v=this.getItemBaseStyle(!1);return Object.assign(v,this.getItemStyleOverrides(String(e),e,m,v,!1)),this.formatTooltipWithContext(p,{heading:f,title:d??u,symbol:this.legendItemSymbol(e),data:y},{seriesId:t,datum:g,title:d,idKey:r,idName:o,colorKey:a,colorName:l,labelKey:c,labelName:h,...v})}computeFocusBounds(e){return EE(this,e)}};yM.className="MapShapeSeries",yM.type="map-shape";var{commonSeriesOptionsDefs:vM,mapShapeSeriesThemeableOptionsDef:bM,without:CM}=n.n1,wM={...bM,...CM(vM,["highlightStyle"]),type:(0,s.mw)((0,s.dY)("map-shape")),idKey:(0,s.mw)(s.Yj),colorKey:s.Yj,labelKey:s.Yj,idName:s.Yj,colorName:s.Yj,labelName:s.Yj,topology:s.eW,topologyIdKey:s.Yj,legendItemName:s.Yj,title:s.Yj},SM={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-shape",moduleFactory:e=>new yM(e),tooltipDefaults:{range:"exact"},themeTemplate:{...eE,series:{fill:{$palette:"fill"},stroke:{$ref:"backgroundColor"},colorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"divergingColors"},n.n1.SAFE_RANGE2_OPERATION]},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:n.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:n.n1.FILL_IMAGE_DEFAULTS,fillOpacity:1,strokeWidth:1,lineDash:[0],lineDashOffset:0,padding:2,label:{color:{$ref:"backgroundColor"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:"bold",overflowStrategy:"hide"}},tooltip:{range:"exact"}}},xM={type:"series",name:"map-shape",chartType:"topology",enterprise:!0,options:wM,create:e=>new yM(e)},{FillGradientDefaults:EM,FillPatternDefaults:AM,FillImageDefaults:MM,Property:TM,SeriesProperties:DM,SeriesTooltip:IM}=n.n1,RM=class extends DM{constructor(){super(...arguments),this.topology=void 0,this.fill="black",this.fillGradientDefaults=new EM,this.fillPatternDefaults=new AM,this.fillImageDefaults=new MM,this.fillOpacity=1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.tooltip=new IM}};a([TM],RM.prototype,"topology",2),a([TM],RM.prototype,"fill",2),a([TM],RM.prototype,"fillGradientDefaults",2),a([TM],RM.prototype,"fillPatternDefaults",2),a([TM],RM.prototype,"fillImageDefaults",2),a([TM],RM.prototype,"fillOpacity",2),a([TM],RM.prototype,"stroke",2),a([TM],RM.prototype,"strokeOpacity",2),a([TM],RM.prototype,"strokeWidth",2),a([TM],RM.prototype,"lineDash",2),a([TM],RM.prototype,"lineDashOffset",2),a([TM],RM.prototype,"tooltip",2);var{createDatumId:kM,SeriesNodePickMode:PM,Selection:_M,Group:LM,PointerEvents:NM,getShapeStyle:OM}=n.n1,FM=class extends AE{constructor(e){super({moduleCtx:e,categoryKey:void 0,useLabelLayer:!0,pickModes:[PM.EXACT_SHAPE_MATCH]}),this.properties=new RM,this._chartTopology=void 0,this.itemGroup=this.contentGroup.appendChild(new LM({name:"itemGroup"})),this.datumSelection=_M.select(this.itemGroup,()=>this.nodeFactory())}get topology(){return this.properties.topology??this._chartTopology}get focusable(){return!1}setOptionsData(){}setChartData(){}getNodeData(){}get hasData(){return!1}renderToOffscreenCanvas(){return!0}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}setSeriesIndex(e){return!!super.setSeriesIndex(e)&&(this.contentGroup.zIndex=[0,e,0],this.highlightGroup.zIndex=[0,e,1],!0)}nodeFactory(){const e=new fE;return e.renderMode=1,e.lineJoin="round",e.pointerEvents=NM.None,e}processData(){const{topology:e}=this;this.topologyBounds=e?.features.reduce((e,t)=>{const i=t.geometry;return null==i?e:mE(i,e)},void 0),null==e&&s.Vy.warnOnce("no topology was provided for [MapShapeBackgroundSeries]; nothing will be rendered.")}createNodeData(){const{id:e,topology:t,scale:i}=this;if(null==t)return;const n=[];return t.features.forEach((e,t)=>{const{geometry:s}=e,r=null!=s&&null!=i?CE(s,i):void 0;null!=r&&n.push({series:this,itemId:t,datum:e,datumIndex:0,index:t,projectedGeometry:r})}),{itemId:e,nodeData:n,labelData:[]}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:e}=this;this.updateSelections(),this.contentGroup.visible=this.visible;const{nodeData:t=[]}=this.contextNodeData??{};this.datumSelection=this.updateDatumSelection({nodeData:t,datumSelection:e}),this.updateDatumNodes({datumSelection:e})}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,e=>kM(e.index))}updateDatumNodes(e){const{properties:t}=this,{datumSelection:i}=e,{fill:n,fillOpacity:s,stroke:r,strokeOpacity:o,lineDash:a,lineDashOffset:l}=t,c=this.getStrokeWidth(t.strokeWidth);i.each((e,t)=>{const{projectedGeometry:i}=t;if(null==i)return e.visible=!1,void(e.projectedGeometry=void 0);e.visible=!0,e.projectedGeometry=i;const h=OM({fill:n,fillOpacity:s,stroke:r,strokeWidth:c,strokeOpacity:o,lineDash:a,lineDashOffset:l},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults);e.setProperties(h)})}resetAnimation(){}getLegendData(){return[]}getTooltipContent(e){}pickFocus(){}computeFocusBounds(e){}};FM.className="MapShapeBackgroundSeries",FM.type="map-shape-background";var{commonSeriesOptionsDefs:GM,mapShapeBackgroundSeriesThemeableOptionsDef:BM}=n.n1,VM={...BM,...GM,type:(0,s.mw)((0,s.dY)("map-shape-background")),topology:s.eW},HM={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-shape-background",moduleFactory:e=>new FM(e),tooltipDefaults:{range:"exact"},themeTemplate:{...eE,series:{fill:{$path:["./1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$ref:"backgroundColor"},strokeWidth:1,fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:[{$mix:[{$path:["./1",{$palette:"fill"},{$palette:"hierarchyColors"}]},"black",.15]},{$mix:[{$path:["./1",{$palette:"fill"},{$palette:"hierarchyColors"}]},"white",.15]}],rotation:0,reverse:!1},fillPatternDefaults:{...n.n1.FILL_PATTERN_DEFAULTS,fill:{$path:["./1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["./1",{$palette:"fill"},{$palette:"hierarchyColors"}]}},fillImageDefaults:n.n1.FILL_IMAGE_DEFAULTS}}},UM={type:"series",name:"map-shape-background",chartType:"topology",enterprise:!0,options:VM,create:e=>new FM(e)},{ChartAxisDirection:zM,PolarAxis:WM,diff:jM,fixNumericExtent:$M,groupAccumulativeValueProperty:KM,keyProperty:YM,normaliseGroupTo:qM,resetLabelFn:XM,seriesLabelFadeInAnimation:ZM,seriesLabelFadeOutAnimation:QM,valueProperty:JM,animationValidation:eT,createDatumId:tT,SeriesNodePickMode:iT,normalizeAngle360:nT,CategoryScale:sT,motion:rT,applyShapeStyle:oT,isGradientFill:aT,getShapeStyle:lT}=n.n1,cT=class extends n.n1.SeriesNodeEvent{constructor(e,t,i,n){super(e,t,i,n),this.angleKey=n.properties.angleKey,this.radiusKey=n.properties.radiusKey}},hT=class extends n.n1.PolarSeries{constructor(e,{animationResetFns:t}){super({moduleCtx:e,categoryKey:"angleValue",useLabelLayer:!0,canHaveAxes:!0,pickModes:[iT.NEAREST_NODE,iT.EXACT_SHAPE_MATCH],animationResetFns:{...t,label:XM}}),this.NodeEvent=cT,this.groupScale=new sT,this.circleCache={r:0,cx:0,cy:0}}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return[];if(e===zM.Angle)return t.getDomain(this,"angleValue","key",i);{const e=t.getDomain(this,"radiusValue-end","value",i),n=Number.isFinite(e[1]-e[0])?[e[0]>0?0:e[0],e[1]<0?0:e[1]]:[];return $M(n)}}async processData(e){const{angleKey:t,radiusKey:i,normalizedTo:n}=this.properties,r=!this.ctx.animationManager.isSkipped(),o=this.getStackId(),a=`${o}-trailing`,l=[];(0,s.vM)(n)&&l.push(qM([o,a],Math.abs(n))),r&&this.processedData&&l.push(jM(this.id,this.processedData)),r&&l.push(eT());const c=this.visible?{}:{forceValue:0},h=this.axes[zM.Radius]?.scale.type,u=this.axes[zM.Angle]?.scale.type;await this.requestDataModel(e,this.data,{props:[YM(t,u,{id:"angleValue"}),JM(i,h,{id:"radiusValue-raw",invalidValue:null,...c}),...KM(i,"normal","current",{id:"radiusValue-end",rangeId:"radiusValue-range",invalidValue:null,groupId:o,separateNegative:!0,...c},h),...KM(i,"trailing","current",{id:"radiusValue-start",invalidValue:null,groupId:a,separateNegative:!0,...c},h),...l],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")}didCircleChange(){const e=this.radius,t=this.centerX,i=this.centerY,n=this.circleCache;return(e!==n.r||t!==n.cx||i!==n.cy)&&(this.circleCache={r:e,cx:t,cy:i},!0)}isRadiusAxisReversed(){return this.axes[zM.Radius]?.isReversed()}maybeRefreshNodeData(){if(!this.didCircleChange()&&!this.nodeDataRefresh)return;const{nodeData:e=[]}=this.createNodeData()??{};this.nodeData=e,this.nodeDataRefresh=!1}getAxisInnerRadius(){const e=this.axes[zM.Radius];return e instanceof WM?this.radius*e.innerRadiusRatio:0}createNodeData(){const{processedData:e,dataModel:t,groupScale:i}=this;if(!t||!e||"grouped"!==e.type)return;const n=this.axes[zM.Angle],s=this.axes[zM.Radius],r=n?.scale,o=s?.scale;if(!r||!o)return;const a=t.resolveKeysById(this,"angleValue",e),l=t.resolveColumnById(this,"radiusValue-start",e),c=t.resolveColumnById(this,"radiusValue-end",e),h=t.resolveColumnById(this,"radiusValue-raw",e),u=t.resolveProcessedDataIndexById(this,"radiusValue-range");let d=0,p=0;n instanceof Z&&(d=n.groupPaddingInner,p=n.paddingInner);const g=(r.bandwidth??0)*(1-p),{index:f,visibleGroupCount:m}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);i.domain=Array.from({length:m}).map((e,t)=>String(t)),i.range=[-g/2,g/2],i.paddingInner=m>1?d:0;const y=this.isRadiusAxisReversed(),v=y?this.radius:this.getAxisInnerRadius(),b=y?this.getAxisInnerRadius():this.radius,C=b+v,{angleKey:w,radiusKey:S,angleName:x,radiusName:E,label:A}=this.properties,M=(e,t,i,n)=>{const s=this.getLabelText(A,{value:t,datum:e,angleKey:w,radiusKey:S,angleName:x,radiusName:E});if(s)return{x:i,y:n,text:s,textAlign:"center",textBaseline:"middle"}},T=[],D={itemId:S,nodeData:T,labelData:T};if(!this.visible)return D;const{dataSources:I}=e,R=I.get(this.id)??[];for(const{datumIndex:n,group:s}of t.forEachGroupDatum(this,e)){const e=R[n],t=a[n];if(null==t)return;const d=h[n],p=d>=0&&!Object.is(d,-0),g=l[n],m=c[n],w=s.aggregation[u][p?1:0]??0,S=p===y;if(void 0===g||void 0===m)return;let x,E;if(1===R.length)x=-.5*Math.PI,E=1.5*Math.PI;else{const e=r.convert(t);x=nT(e+i.convert(String(f))),E=nT(x+i.bandwidth)}const A=x+i.bandwidth/2,D=C-o.convert(g),I=C-o.convert(m),k=(D+I)/2,P=C-o.convert(0),_=C-o.convert(w),L=Math.cos(A)*k,N=Math.sin(A)*k,O=this.properties.label.enabled?M(e,d,L,N):void 0,F=this.getColumnWidth(x,E);T.push({series:this,datum:e,datumIndex:n,point:{x:L,y:N,size:0},midPoint:{x:L,y:N},label:O,angleValue:t,radiusValue:d,negative:S,innerRadius:D,outerRadius:I,stackInnerRadius:P,stackOuterRadius:_,startAngle:x,endAngle:E,midAngle:A,axisInnerRadius:v,axisOuterRadius:b,columnWidth:F,index:n})}return{itemId:S,nodeData:T,labelData:T}}getColumnWidth(e,t){return NaN}update({seriesRect:e}){const t=this.checkResize(e);this.maybeRefreshNodeData(),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),this.updateSectorSelection(this.itemSelection,!1),this.updateSectorSelection(this.highlightSelection,!0),this.updateLabels(),t&&this.animationState.transition("resize"),this.animationState.transition("update")}getItemBaseStyle(e){const{properties:t}=this,i=e?t.highlightStyle.item:void 0;return lT({fill:i?.fill??t.fill,fillOpacity:i?.fillOpacity??t.fillOpacity,stroke:i?.stroke??t.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(t.strokeWidth),strokeOpacity:i?.strokeOpacity??t.strokeOpacity,lineDash:i?.lineDash??t.lineDash,lineDashOffset:i?.lineDashOffset??t.lineDashOffset,cornerRadius:t.cornerRadius},t.fillGradientDefaults,t.fillPatternDefaults,t.fillImageDefaults)}getItemStyleOverrides(e,t,i,n){const{id:s,properties:r}=this,{angleKey:o,radiusKey:a,itemStyler:l,fillGradientDefaults:c,fillPatternDefaults:h,fillImageDefaults:u}=r;if(null==l)return;const d=this.cachedDatumCallback(tT(e,n?"highlight":"node"),()=>this.callWithContext(l,{seriesId:s,datum:t,highlighted:n,angleKey:o,radiusKey:a,...i}));return lT(d,c,h,u)}updateSectorSelection(e,t){let i=[];if(t){const e=this.ctx.highlightManager?.getActiveHighlight();e?.datum&&e.series===this&&i.push(e)}else i=this.nodeData;const n=this.isRadiusAxisReversed(),s=n?this.radius:this.getAxisInnerRadius(),r=n?this.getAxisInnerRadius():this.radius,o=this.getShapeFillBBox(),a=this.getItemBaseStyle(t);e.update(i,void 0,e=>this.getDatumId(e)).each((e,i)=>{const{datum:n,datumIndex:l,midPoint:c}=i,h=this.getItemStyleOverrides(String(l),n,a,t),u=h?.fill??a.fill,d=aT(u)&&"item"===u.bounds?{centerX:c?.x??0,centerY:c?.y??0}:{centerX:0,centerY:0,innerRadius:s,outerRadius:r};this.updateItemPath(e,i,t),oT(e,a,h,o,d),e.cornerRadius=h?.cornerRadius??a.cornerRadius,e.lineJoin="round"})}updateLabels(){const{label:e}=this.properties;this.labelSelection.update(this.nodeData).each((t,i)=>{e.enabled&&i.label?(t.x=i.label.x,t.y=i.label.y,t.fill=e.color,t.fontFamily=e.fontFamily,t.fontSize=e.fontSize,t.fontStyle=e.fontStyle,t.fontWeight=e.fontWeight,t.text=i.label.text,t.textAlign=i.label.textAlign,t.textBaseline=i.label.textBaseline,t.visible=!0):t.visible=!1})}animateEmptyUpdateReady(){const{labelSelection:e}=this,t=this.getColumnTransitionFunctions();rT.fromToMotion(this.id,"datums",this.ctx.animationManager,[this.itemSelection],t),ZM(this,"labels",this.ctx.animationManager,e)}animateClearingUpdateEmpty(){const{itemSelection:e}=this,{animationManager:t}=this.ctx,i=this.getColumnTransitionFunctions();rT.fromToMotion(this.id,"datums",t,[e],i),QM(this,"labels",t,this.labelSelection)}getTooltipContent(e){const{id:t,dataModel:i,processedData:n,axes:s,properties:r}=this,{angleKey:o,angleName:a,radiusKey:l,radiusName:c,tooltip:h}=r,u=s[zM.Angle],d=s[zM.Radius];if(!(i&&n&&u&&d))return;const p=n.dataSources.get(this.id)?.[e],g=i.resolveKeysById(this,"angleValue",n)[e],f=i.resolveColumnById(this,"radiusValue-raw",n)[e];if(null==g)return;const m=this.getItemBaseStyle(!1);return Object.assign(m,this.getItemStyleOverrides(String(e),e,m,!1)),this.formatTooltipWithContext(h,{heading:u.formatDatum(g),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:d.formatDatum(f)}]},{seriesId:t,datum:p,title:a,angleKey:o,angleName:a,radiusKey:l,radiusName:c,...m})}pickNodeClosestDatum(e){return this.pickNodeNearestDistantObject(e,this.itemSelection.nodes())}legendItemSymbol(){const{fill:e,stroke:t,fillOpacity:i,strokeOpacity:s,strokeWidth:r,lineDash:o,lineDashOffset:a,fillGradientDefaults:l,fillPatternDefaults:c,fillImageDefaults:h}=this.properties,u=lT({fill:e??"rgba(0, 0, 0, 0)",stroke:t??"rgba(0, 0, 0, 0)",fillOpacity:i,strokeOpacity:s,strokeWidth:r,lineDash:o,lineDashOffset:a},l,c,h);return n.n1.isGradientFill(u.fill)&&(u.fill={...u.fill,gradient:"linear",rotation:0,reverse:!1}),{marker:u}}getLegendData(e){if("category"!==e)return[];const{id:t,visible:i}=this,{radiusKey:n,radiusName:s,showInLegend:r}=this.properties;return[{legendType:"category",id:t,itemId:n,seriesId:t,enabled:i,label:{text:s??n},symbol:this.legendItemSymbol(),hideInLegend:!r}]}getDatumId(e){return tT(e.angleValue)}computeLabelsBBox(){return null}},{SeriesProperties:uT,FillGradientDefaults:dT,FillPatternDefaults:pT,FillImageDefaults:gT,SeriesTooltip:fT,Property:mT,Label:yT}=n.n1,vT=class extends uT{constructor(){super(...arguments),this.fill="black",this.fillGradientDefaults=new dT,this.fillPatternDefaults=new pT,this.fillImageDefaults=new gT,this.fillOpacity=1,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.label=new yT,this.tooltip=new fT}};a([mT],vT.prototype,"angleKey",2),a([mT],vT.prototype,"angleName",2),a([mT],vT.prototype,"radiusKey",2),a([mT],vT.prototype,"radiusName",2),a([mT],vT.prototype,"fill",2),a([mT],vT.prototype,"fillGradientDefaults",2),a([mT],vT.prototype,"fillPatternDefaults",2),a([mT],vT.prototype,"fillImageDefaults",2),a([mT],vT.prototype,"fillOpacity",2),a([mT],vT.prototype,"stroke",2),a([mT],vT.prototype,"strokeWidth",2),a([mT],vT.prototype,"strokeOpacity",2),a([mT],vT.prototype,"lineDash",2),a([mT],vT.prototype,"lineDashOffset",2),a([mT],vT.prototype,"cornerRadius",2),a([mT],vT.prototype,"itemStyler",2),a([mT],vT.prototype,"rotation",2),a([mT],vT.prototype,"stackGroup",2),a([mT],vT.prototype,"normalizedTo",2),a([mT],vT.prototype,"label",2),a([mT],vT.prototype,"tooltip",2);var{motion:bT}=n.n1;function CT(){const e={startAngle:new Map,endAngle:new Map},t=["startAngle","endAngle"],i=(t,i)=>({startAngle:e.startAngle.get(t)[i],endAngle:e.endAngle.get(t)[i]});return{calculate:(i,n,s)=>{t.forEach(t=>{const r=e[t];let o=("removed"===s||"updated"===s?i:n)[t],a=("removed"===s?i:n)[t];isNaN(a)&&(a=i.previousDatum?.[t]??NaN);const l=o-a;Math.abs(l)>Math.PI&&(o-=2*Math.sign(l)*Math.PI),r.set(n,{from:o,to:a})})},from:e=>i(e,"from"),to:e=>i(e,"to")}}function wT(e,t,i){if("updated"===i){if(null==e.previousDatum||isNaN(e.previousDatum.startAngle)||isNaN(e.previousDatum.endAngle))return"added";if(isNaN(t.startAngle)||isNaN(t.endAngle))return"removed"}return"added"===i&&null!=e.previousDatum?"updated":i}function ST(e,{innerRadius:t,outerRadius:i,columnWidth:n,axisInnerRadius:s,axisOuterRadius:r,startAngle:o,endAngle:a}){return{innerRadius:t,outerRadius:i,columnWidth:n,axisInnerRadius:s,axisOuterRadius:r,startAngle:o,endAngle:a}}var{SectorBox:xT,motion:ET}=n.n1;function AT(e){const{negative:t,innerRadius:i,outerRadius:n,stackInnerRadius:s,stackOuterRadius:r}=e;return{innerRadius:t?r:s,outerRadius:t?s:r,clipInnerRadius:t?n:i,clipOuterRadius:t?i:n}}function MT(e,t){const{startAngle:i,endAngle:n}=t,{innerRadius:s,outerRadius:r,clipInnerRadius:o,clipOuterRadius:a}=AT(t);return{innerRadius:s,outerRadius:r,startAngle:i,endAngle:n,clipSector:new xT(i,n,o,a)}}var{Sector:TT,SectorBox:DT,PolarZIndexMap:IT}=n.n1,RT=class extends hT{constructor(e){super(e,{animationResetFns:{item:MT}}),this.properties=new vT}setSeriesIndex(e){return!!super.setSeriesIndex(e)&&(this.contentGroup.zIndex=[0,IT.FOREGROUND,e],this.highlightGroup.zIndex=[0,IT.HIGHLIGHT,e],this.labelGroup.zIndex=[0,IT.LABEL,e],!0)}getStackId(){return`nightingale-stack-${this.seriesGrouping?.groupIndex??this.id}-yValues`}nodeFactory(){return new TT}updateItemPath(e,t,i){const{negative:n}=t;if(e.centerX=0,e.centerY=0,e.startOuterCornerRadius=n?0:this.properties.cornerRadius,e.endOuterCornerRadius=n?0:this.properties.cornerRadius,e.startInnerCornerRadius=n?this.properties.cornerRadius:0,e.endInnerCornerRadius=n?this.properties.cornerRadius:0,i){const{startAngle:i,endAngle:n}=t,{innerRadius:s,outerRadius:r,clipInnerRadius:o,clipOuterRadius:a}=AT(t);e.innerRadius=s,e.outerRadius=r,e.startAngle=i,e.endAngle=n,e.clipSector=new DT(i,n,o,a)}}getColumnTransitionFunctions(){return function(e){const t=CT();return{toFn:(i,n,s)=>{const{startAngle:r,endAngle:o}=t.to(n);let a,l,c;if("removed"===s)a=e,l=e,c=new xT(r,o,a,l);else{let t,i;({innerRadius:a,outerRadius:l,clipInnerRadius:t,clipOuterRadius:i}=AT(n)),isNaN(a)&&(a=e),isNaN(l)&&(l=e),isNaN(t)&&(t=e),isNaN(i)&&(i=e),c=new xT(r,o,t,i)}return{innerRadius:a,outerRadius:l,startAngle:r,endAngle:o,clipSector:c}},fromFn:(i,n,s)=>{s=wT(i,n,s),t.calculate(i,n,s);const{startAngle:r,endAngle:o}=t.from(n);let a,l,c;return"removed"===s||"updated"===s?(a=i.innerRadius,l=i.outerRadius,c=i.clipSector):(a=e,l=e),c??(c=new xT(r,o,a,l)),{innerRadius:a,outerRadius:l,startAngle:r,endAngle:o,clipSector:c,phase:ET.NODE_UPDATE_STATE_TO_PHASE_MAPPING[s]}}}}(this.isRadiusAxisReversed()?this.radius:this.getAxisInnerRadius())}};RT.className="NightingaleSeries",RT.type="nightingale";var{commonSeriesOptionsDefs:kT,nightingaleSeriesThemeableOptionsDef:PT}=n.n1,_T={...PT,...kT,type:(0,s.mw)((0,s.dY)("nightingale")),angleKey:(0,s.mw)(s.Yj),radiusKey:(0,s.mw)(s.Yj),angleName:s.Yj,radiusName:s.Yj,grouped:s.zM,stacked:s.zM,stackGroup:s.Yj,normalizedTo:s.ai},{ThemeConstants:{POLAR_AXIS_TYPE:LT,POLAR_AXIS_SHAPE:NT}}=n.n1,OT={$path:["./shape",NT.CIRCLE,{$find:[{$not:[{$isOperation:"./shape"}]},{$path:".."}]}]},FT={series:{fill:{$palette:"fill"},stroke:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$ref:"backgroundColor"},{$palette:"stroke"}]},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"series",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:n.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:n.n1.FILL_IMAGE_DEFAULTS,strokeWidth:1,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}},axes:{[LT.ANGLE_CATEGORY]:{shape:OT,groupPaddingInner:0,paddingInner:0,label:{spacing:10}},[LT.RADIUS_NUMBER]:{shape:OT}}},{ThemeConstants:{POLAR_AXIS_TYPE:GT}}=n.n1,BT={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"nightingale",moduleFactory:e=>new RT(e),tooltipDefaults:{range:"exact"},defaultAxes:[{type:GT.ANGLE_CATEGORY},{type:GT.RADIUS_NUMBER}],themeTemplate:FT,stackable:!0,groupable:!0,stackedByDefault:!0},VT={type:"series",name:"nightingale",chartType:"polar",enterprise:!0,options:_T,create:e=>new RT(e)},{SeriesProperties:HT,FillGradientDefaults:UT,FillPatternDefaults:zT,FillImageDefaults:WT,SeriesTooltip:jT,Property:$T,Label:KT,DropShadow:YT}=n.n1,qT=class extends KT{},XT=class extends KT{constructor(){super(...arguments),this.spacing=0}};a([$T],XT.prototype,"spacing",2),a([$T],XT.prototype,"placement",2);var ZT=class extends HT{constructor(){super(...arguments),this.fills=[],this.fillGradientDefaults=new UT,this.fillPatternDefaults=new zT,this.fillImageDefaults=new WT,this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.direction="vertical",this.reverse=void 0,this.spacing=0,this.aspectRatio=void 0,this.shadow=(new YT).set({enabled:!1}),this.label=new qT,this.stageLabel=new XT,this.tooltip=new jT}};function QT(e,{x:t,y:i,top:n,right:s,bottom:r,left:o}){e.x0=t-n/2,e.x1=t+n/2,e.x2=t+r/2,e.x3=t-r/2,e.y0=i-o/2,e.y1=i-s/2,e.y2=i+s/2,e.y3=i+o/2}a([$T],ZT.prototype,"stageKey",2),a([$T],ZT.prototype,"valueKey",2),a([$T],ZT.prototype,"fills",2),a([$T],ZT.prototype,"fillGradientDefaults",2),a([$T],ZT.prototype,"fillPatternDefaults",2),a([$T],ZT.prototype,"fillImageDefaults",2),a([$T],ZT.prototype,"fillOpacity",2),a([$T],ZT.prototype,"strokes",2),a([$T],ZT.prototype,"strokeWidth",2),a([$T],ZT.prototype,"strokeOpacity",2),a([$T],ZT.prototype,"lineDash",2),a([$T],ZT.prototype,"lineDashOffset",2),a([$T],ZT.prototype,"direction",2),a([$T],ZT.prototype,"reverse",2),a([$T],ZT.prototype,"spacing",2),a([$T],ZT.prototype,"aspectRatio",2),a([$T],ZT.prototype,"itemStyler",2),a([$T],ZT.prototype,"shadow",2),a([$T],ZT.prototype,"label",2),a([$T],ZT.prototype,"stageLabel",2),a([$T],ZT.prototype,"tooltip",2);var{StateMachine:JT,valueProperty:eD,SeriesNodePickMode:tD,CachedTextMeasurerPool:iD,TextUtils:nD,createDatumId:sD,BBox:rD,Group:oD,Selection:aD,Text:lD,PointerEvents:cD,applyShapeStyle:hD,fromToMotion:uD,seriesLabelFadeInAnimation:dD,getShapeStyle:pD}=n.n1,gD=class extends n.n1.DataModelSeries{constructor(e){super({moduleCtx:e,categoryKey:void 0,pickModes:[tD.EXACT_SHAPE_MATCH,tD.NEAREST_NODE]}),this.properties=new ZT,this.itemGroup=this.contentGroup.appendChild(new oD({name:"itemGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new oD({name:"itemLabelGroup"})),this.stageLabelGroup=this.contentGroup.appendChild(new oD({name:"stageLabelGroup"})),this.datumSelection=aD.select(this.itemGroup,()=>this.nodeFactory()),this.labelSelection=aD.select(this.itemLabelGroup,lD),this.stageLabelSelection=aD.select(this.stageLabelGroup,lD),this.highlightDatumSelection=aD.select(this.highlightNode,()=>this.nodeFactory()),this.animationState=new JT("empty",{empty:{update:{target:"ready",action:()=>this.animateEmptyUpdateReady()},reset:"empty",skip:"ready"},ready:{clear:"empty",reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable()),this.itemLabelGroup.pointerEvents=cD.None,this.stageLabelGroup.pointerEvents=cD.None}addChartEventListeners(){this.destroyFns.push(this.ctx.chartEventManager?.addListener("legend-item-click",e=>this.onLegendItemClick(e)))}nodeFactory(){return new mw}getNodeData(){return this.contextNodeData?.nodeData}resetAnimation(e){"initial"===e?this.animationState.transition("reset"):"ready"===e&&this.animationState.transition("skip")}async processData(e){if(null==this.data)return;const{id:t,visible:i,ctx:{legendManager:n}}=this,{stageKey:s,valueKey:r}=this.properties,o=this.visible?{}:{forceValue:0};await this.requestDataModel(e,this.data,{props:[eD(s,"band",{id:"xValue"}),eD(r,"number",{id:"yValue",...o,validation:(e,s,r)=>i&&n.getItemEnabled({seriesId:t,itemId:r}),invalidValue:0})]})}createNodeData(){const{id:e,dataModel:t,processedData:i,properties:n,visible:s,ctx:{legendManager:r}}=this,{stageKey:o,valueKey:a,direction:l,reverse:c="horizontal"===l,spacing:h,aspectRatio:u,label:d,stageLabel:p}=n;if(null==t||null==i)return;const g="horizontal"===l,f=t.resolveColumnById(this,"xValue",i),m=t.resolveColumnById(this,"yValue",i),y=iD.getMeasurer({font:p.getFont()});let v,b;g?(v="center",b="before"===p.placement?"bottom":"top"):(v="after"===p.placement?"left":"right",b="middle");const C=p.enabled?[]:void 0;let w=0,S=0,x=0;const E=i.dataSources.get(this.id)??[];E.forEach((t,i)=>{const n=f[i],l=m[i],c=s&&r.getItemEnabled({seriesId:e,itemId:i});if(x+=l,null==C)return;const h=this.getLabelText(this.properties.stageLabel,{datum:t,value:n,stageKey:o,valueKey:a}),{width:u}=y.measureText(h),p=h.split("\n").length*nD.getLineHeight(d.fontSize);w=Math.max(w,u),S=Math.max(S,p),C.push({x:NaN,y:NaN,text:h,textAlign:v,textBaseline:b,visible:c})});const A=this._nodeDataDependencies?.seriesRectWidth??0,M=this._nodeDataDependencies?.seriesRectHeight??0,T=h*(i.input.count-1);let D,I,R;if(g){const e=S+p.spacing;D=new rD(0,"before"===p.placement?e:0,A,M-e)}else{const e=w+p.spacing;D=new rD("after"===p.placement?0:e,0,A-e,M)}if(null!=u&&0!==u){const e="horizontal"===l?1/u:u,t=Math.min(D.width,D.height*e),i=t/e;D=new rD(D.x+(D.width-t)/2,D.y+(D.height-i)/2,t,i)}g?R="before"===p.placement?D.y-p.spacing:D.y+D.height+p.spacing:I="after"===p.placement?D.x+D.width+p.spacing:D.x-p.spacing;const k=D.width-(g?T:0),P=D.height-(g?0:T);if(k<0||P<0)return;const _=[],L=[];let N=0;return E.forEach((t,i)=>{const n=f[i],l=m[i],u=s&&r.getItemEnabled({seriesId:e,itemId:i}),p=N+l,y=(N+p)/(2*x),v=(p-N)/x,b=g?k*y+h*i:.5*k,w=g?.5*P:P*y+h*i,S=D.x+b,E=D.y+w;if(null!=C){const e=C[i];e.x=I??S,e.y=R??E}let A,M,T,O;if(g){const e=k*v;A=e,T=e;const t=(b+e/2)*(P/D.width),i=(b-e/2)*(P/D.width);M=c?D.height-t:t,O=c?D.height-i:i}else{const e=P*v;M=e,O=e;const t=(w-e/2)*(k/D.height),i=(w+e/2)*(k/D.height);A=c?D.width-t:t,T=c?D.width-i:i}const F={x:S,y:E,text:this.getLabelText(d,{datum:t,value:l,stageKey:o,valueKey:a}),textAlign:"center",textBaseline:"middle",visible:u};L.push(F),_.push({series:this,itemId:a,datum:t,datumIndex:i,index:i,xValue:n,yValue:l,x:S,y:E,top:A,right:M,bottom:T,left:O,label:F,enabled:u,midPoint:{x:S,y:E}}),N=p}),{itemId:e,nodeData:_,labelData:L,stageLabelData:C,bounds:D}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update({seriesRect:e}){this.checkResize(e);const{datumSelection:t,labelSelection:i,stageLabelSelection:n,highlightDatumSelection:s}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();let r=this.ctx.highlightManager?.getActiveHighlight();null==r||r.series===this&&null!=r.datum||(r=void 0);const o=this.contextNodeData?.nodeData??[],a=this.contextNodeData?.labelData??[],l=this.contextNodeData?.stageLabelData??[];this.datumSelection=this.updateDatumSelection({nodeData:o,datumSelection:t}),this.updateDatumNodes({datumSelection:t,isHighlight:!1}),this.labelSelection=this.updateLabelSelection({labelData:a,labelSelection:i}),this.updateLabelNodes({labelSelection:i,labelProperties:this.properties.label}),this.stageLabelSelection=this.updateStageLabelSelection({stageLabelData:l,stageLabelSelection:n}),this.updateLabelNodes({labelSelection:n,labelProperties:this.properties.stageLabel}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:null!=r?[r]:[],datumSelection:s}),this.updateDatumNodes({datumSelection:s,isHighlight:!0}),this.animationState.transition("update")}updateDatumSelection(e){return e.datumSelection.update(e.nodeData)}getItemBaseStyle(e){const{properties:t}=this,i=e?t.highlightStyle.item:void 0;return pD({fill:i?.fill,fillOpacity:i?.fillOpacity??t.fillOpacity,stroke:i?.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(t.strokeWidth),strokeOpacity:i?.strokeOpacity??t.strokeOpacity,lineDash:i?.lineDash??t.lineDash,lineDashOffset:i?.lineDashOffset??t.lineDashOffset},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}getItemStyleOverrides(e,t,i,n,s){const{id:r,properties:o}=this,{fills:a,strokes:l,stageKey:c,valueKey:h,itemStyler:u}=o,d=n.fill??a[i%a.length],p=n.stroke??l[i%l.length],g={};if(s||(g.fill=d,g.stroke=p),null!=u){const i=this.cachedDatumCallback(sD(e,s?"highlight":"node"),()=>this.callWithContext(u,{seriesId:r,datum:t,stageKey:c,valueKey:h,highlighted:s,fill:d,stroke:p,...n}));Object.assign(g,i)}return pD(g,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}updateDatumNodes(e){const{datumSelection:t,isHighlight:i}=e,{properties:n}=this,{shadow:s}=n,r=this.getItemBaseStyle(i),o=this.contextNodeData?.bounds,a=o?{series:o,axis:o}:void 0;t.each((e,t)=>{const{datumIndex:n,datum:o}=t,l=this.getItemStyleOverrides(String(n),o,n,r,i);hD(e,r,l,a),QT(e,t),e.fillShadow=s})}updateLabelSelection(e){return e.labelSelection.update(this.properties.label.enabled?e.labelData:[])}updateStageLabelSelection(e){return e.stageLabelSelection.update(e.stageLabelData)}updateLabelNodes(e){const{labelSelection:t,labelProperties:i}=e,{color:n,fontSize:s,fontStyle:r,fontWeight:o,fontFamily:a}=i;t.each((e,{visible:t,x:i,y:l,text:c,textAlign:h,textBaseline:u})=>{e.visible=t,e.x=i,e.y=l,e.text=c,e.fill=n,e.fontStyle=r,e.fontWeight=o,e.fontSize=s,e.fontFamily=a,e.textAlign=h,e.textBaseline=u})}computeFocusBounds(e){const t=this.getNodeData()?.[e.datumIndex];if(void 0!==t)for(const e of this.datumSelection)if(e.datum===t)return e.node}getTooltipContent(e){const{id:t,dataModel:i,processedData:n,properties:s}=this,{stageKey:r,valueKey:o,tooltip:a}=s;if(!i||!n)return;const l=n.dataSources.get(this.id)?.[e],c=i.resolveColumnById(this,"xValue",n)[e],h=i.resolveColumnById(this,"yValue",n)[e];if(null==c)return;const u=this.getLabelText(this.properties.stageLabel,{datum:n.dataSources.get(this.id)?.[e],value:h,stageKey:r,valueKey:o}),d=this.getItemBaseStyle(!1);return Object.assign(d,this.getItemStyleOverrides(String(e),e,e,d,!1)),this.formatTooltipWithContext(a,{symbol:this.legendItemSymbol(e),data:[{label:String(c),value:u}]},{seriesId:t,datum:l,title:void 0,stageKey:r,valueKey:o,...d})}getSeriesDomain(){return[NaN,NaN]}getSeriesRange(e,t){return[NaN,NaN]}pickNodeClosestDatum({x:e,y:t}){let i,n=1/0;return this.datumSelection.each((s,r)=>{const o=s.distanceSquared(e,t);o<n&&(n=o,i=r)}),null!=i?{datum:i,distance:Math.sqrt(n)}:void 0}legendItemSymbol(e){const{fills:t,strokes:i,strokeWidth:n,fillOpacity:s,strokeOpacity:r,lineDash:o,lineDashOffset:a}=this.properties,l=t[e%t.length]??"black",c=i[e%i.length]??"black";return{marker:pD({fill:l,fillOpacity:s,stroke:c,strokeWidth:n,strokeOpacity:r,lineDash:o,lineDashOffset:a},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}}getLegendData(e){const{processedData:t,dataModel:i,id:n,ctx:{legendManager:s},visible:r}=this;if(!i||!t||"category"!==e)return[];const{showInLegend:o}=this.properties,a=[],l=i.resolveColumnById(this,"xValue",t);return(t.dataSources.get(this.id)??[]).forEach((e,t)=>{const i=l[t];a.push({legendType:"category",id:n,itemId:t,seriesId:n,enabled:r&&s.getItemEnabled({seriesId:n,itemId:t}),label:{text:i},symbol:this.legendItemSymbol(t),hideInLegend:!o})}),a}animateReset(){this.ctx.animationManager.skipCurrentBatch(),this.ctx.animationManager.stopByAnimationGroupId(this.id)}animateEmptyUpdateReady(){const{datumSelection:e,labelSelection:t,properties:i}=this,n=(s=i.direction,{fromFn:(e,t)=>{const{x:i,y:n}=t;let{top:r,right:o,bottom:a,left:l}=t;return"vertical"===s?(r=0,a=0):(l=0,o=0),{x:i,y:n,top:r,right:o,bottom:a,left:l}},toFn:(e,t)=>{const{x:i,y:n,top:s,right:r,bottom:o,left:a}=t;return{x:i,y:n,top:s,right:r,bottom:o,left:a}},applyFn:QT});var s;uD(this.id,"nodes",this.ctx.animationManager,[e],n),dD(this,"labels",this.ctx.animationManager,t)}};gD.className="PyramidSeries",gD.type="pyramid";var{commonSeriesOptionsDefs:fD,pyramidSeriesThemeableOptionsDef:mD}=n.n1,yD={...mD,...fD,type:(0,s.mw)((0,s.dY)("pyramid")),stageKey:(0,s.mw)(s.Yj),valueKey:(0,s.mw)(s.Yj)},{ThemeSymbols:{DEFAULT_SHADOW_COLOUR:vD}}=n.n1,bD={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["standalone"],identifier:"pyramid",moduleFactory:e=>new gD(e),solo:!0,tooltipDefaults:{range:"exact"},themeTemplate:{series:{direction:"vertical",strokeWidth:0,spacing:2,fills:{$palette:"fills"},strokes:{$palette:"strokes"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:n.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:n.n1.FILL_IMAGE_DEFAULTS,label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"}},stageLabel:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:12},shadow:{enabled:!1,color:vD,xOffset:3,yOffset:3,blur:5}}}},CD={type:"series",name:"pyramid",chartType:"standalone",enterprise:!0,options:yD,create:e=>new gD(e)},{ThemeConstants:{POLAR_AXIS_TYPE:wD}}=n.n1,SD={series:{stroke:{$palette:"stroke"},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},marker:{enabled:!0,fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:n.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:n.n1.FILL_IMAGE_DEFAULTS,fillOpacity:1,shape:"circle",size:6,strokeOpacity:1,strokeWidth:0}},axes:{[wD.ANGLE_CATEGORY]:{label:{spacing:10}}}},xD=n.n1.mergeDefaults({series:{stroke:n.n1.SAFE_STROKE_FILL_OPERATION,strokeWidth:2}},SD),ED=n.n1.mergeDefaults({series:{fill:{$palette:"fill"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:n.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:n.n1.FILL_IMAGE_DEFAULTS,fillOpacity:.8,strokeWidth:2,marker:{enabled:!1,fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:n.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:n.n1.FILL_IMAGE_DEFAULTS}}},SD),{Label:AD,SeriesMarker:MD,SeriesProperties:TD,SeriesTooltip:DD,Property:ID}=n.n1,RD=class extends TD{constructor(){super(...arguments),this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.rotation=0,this.marker=new MD,this.label=new AD,this.tooltip=new DD,this.connectMissingData=!1}};a([ID],RD.prototype,"angleKey",2),a([ID],RD.prototype,"radiusKey",2),a([ID],RD.prototype,"angleName",2),a([ID],RD.prototype,"radiusName",2),a([ID],RD.prototype,"stroke",2),a([ID],RD.prototype,"strokeWidth",2),a([ID],RD.prototype,"strokeOpacity",2),a([ID],RD.prototype,"lineDash",2),a([ID],RD.prototype,"lineDashOffset",2),a([ID],RD.prototype,"rotation",2),a([ID],RD.prototype,"marker",2),a([ID],RD.prototype,"label",2),a([ID],RD.prototype,"tooltip",2),a([ID],RD.prototype,"connectMissingData",2);var{ChartAxisDirection:kD,PolarAxis:PD,SeriesNodePickMode:_D,valueProperty:LD,fixNumericExtent:ND,seriesLabelFadeInAnimation:OD,markerFadeInAnimation:FD,resetMarkerFn:GD,animationValidation:BD,computeMarkerFocusBounds:VD,extent:HD,BBox:UD,Group:zD,Path:WD,PointerEvents:jD,Selection:$D,Text:KD,Marker:YD,mergeDefaults:qD,getShapeStyle:XD}=n.n1,ZD=class extends n.n1.SeriesNodeEvent{constructor(e,t,i,n){super(e,t,i,n),this.angleKey=n.properties.angleKey,this.radiusKey=n.properties.radiusKey}},QD=class extends n.n1.PolarSeries{constructor(e){super({moduleCtx:e,categoryKey:"angleValue",useLabelLayer:!0,pickModes:[_D.NEAREST_NODE,_D.EXACT_SHAPE_MATCH],canHaveAxes:!0,animationResetFns:{item:GD},clipFocusBox:!1}),this.properties=new RD,this.NodeEvent=ZD,this.lineGroup=this.contentGroup.appendChild(new zD({name:"radar-line"})),this.lineSelection=$D.select(this.lineGroup,WD),this.resetInvalidToZero=!1,this.circleCache={r:0,cx:0,cy:0},this.lineGroup.zIndex=0,this.itemGroup.zIndex=1}nodeFactory(){return new YD}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return[];if(e===kD.Angle)return t.getDomain(this,"angleValue","value",i);{const e=t.getDomain(this,"radiusValue","value",i),n=HD(0===e.length?e:[0].concat(e));return ND(n)}}async processData(e){const{angleKey:t,radiusKey:i}=this.properties,n=[];this.ctx.animationManager.isSkipped()||n.push(BD());const s=this.axes[kD.Radius]?.scale.type,r=this.axes[kD.Angle]?.scale.type;await this.requestDataModel(e,this.data,{props:[LD(t,r,{id:"angleValue"}),LD(i,s,{id:"radiusValue",invalidValue:void 0}),...n]}),this.animationState.transition("updateData")}didCircleChange(){const e=this.radius,t=this.centerX,i=this.centerY,n=this.circleCache;return(e!==n.r||t!==n.cx||i!==n.cy)&&(this.circleCache={r:e,cx:t,cy:i},!0)}getAxisInnerRadius(){const e=this.axes[kD.Radius];return e instanceof PD?this.radius*e.innerRadiusRatio:0}maybeRefreshNodeData(){if(!this.didCircleChange()&&!this.nodeDataRefresh)return;const{nodeData:e=[]}=this.createNodeData()??{};this.nodeData=e,this.nodeDataRefresh=!1}createNodeData(){const{processedData:e,dataModel:t}=this;if(!e||!t)return;const{angleKey:i,radiusKey:n,angleName:r,radiusName:o,marker:a,label:l}=this.properties,c=this.axes[kD.Angle]?.scale,h=this.axes[kD.Radius]?.scale;if(!c||!h)return;const u=t.resolveColumnById(this,"angleValue",e),d=t.resolveColumnById(this,"radiusValue",e),p=this.getAxisInnerRadius(),g=(e.dataSources.get(this.id)??[]).map((e,t)=>{const g=u[t],f=d[t],m=c.convert(g),y=this.radius+p-h.convert(f),v=Math.cos(m),b=Math.sin(m),C=v*y,w=b*y;let S;if(l.enabled){const t=this.getLabelText(l,{value:f,datum:e,angleKey:i,radiusKey:n,angleName:r,radiusName:o});if(t){let e="right";(0,s.YX)(v,0)?e="center":v>0&&(e="left");let i="bottom";(0,s.YX)(b,0)?i="middle":b>0&&(i="top"),S={x:C+v*a.size,y:w+b*a.size,text:t,textAlign:e,textBaseline:i}}}return{series:this,datum:e,datumIndex:t,index:t,point:{x:C,y:w,size:a.size},midPoint:{x:C,y:w},label:S,angleValue:g,radiusValue:f,missing:!(0,s.Bf)(m)||!(0,s.Bf)(y)}});return{itemId:n,nodeData:g,labelData:g}}update({seriesRect:e}){const t=this.checkResize(e),i=!this.ctx.animationManager.isSkipped(),{series:n}=this.ctx.highlightManager?.getActiveHighlight()??{};this.highlightGroup.visible=(i||this.visible)&&n===this,this.maybeRefreshNodeData(),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),this.updatePathSelections(),this.updateMarkerSelection(),this.updateMarkers(this.itemSelection,!1),this.updateMarkers(this.highlightSelection,!0),this.updateLabels(),t&&this.animationState.transition("resize"),this.animationState.transition("update")}updatePathSelections(){const e=this.visible?[!0]:[];this.lineSelection.update(e)}updateMarkerSelection(){this.properties.marker.isDirty()&&(this.itemSelection.clear(),this.itemSelection.cleanup(),this.itemSelection=$D.select(this.itemGroup,()=>this.nodeFactory(),!1)),this.itemSelection.update(this.properties.marker.enabled?this.nodeData:[])}getMarkerFill(e){return e?.fill??this.properties.marker.fill}getDatumStylerProperties(e){const{id:t,properties:i}=this,{angleKey:n,radiusKey:s}=i;return{seriesId:t,datum:e,angleKey:n,radiusKey:s}}updateMarkers(e,t){const{visible:i}=this,{marker:n,stroke:s,strokeWidth:r,strokeOpacity:o,highlightStyle:a}=this.properties;let l=[];if(i&&n.shape&&n.enabled)if(t){const e=this.ctx.highlightManager?.getActiveHighlight();e?.datum&&(l=[e])}else l=this.nodeData;const c=qD(t&&a.item,n.getStyle(),{stroke:s,strokeWidth:r,strokeOpacity:o}),h=this.getShapeFillBBox();e.update(l).each((e,i)=>{this.updateMarkerStyle(n,e,i.datum,i.point,this.getDatumStylerProperties(i),t,c,h)})}updateLabels(){const{label:e}=this.properties;this.labelSelection.update(this.nodeData).each((t,i)=>{e.enabled&&i.label?(t.x=i.label.x,t.y=i.label.y,t.fill=e.color,t.fontFamily=e.fontFamily,t.fontSize=e.fontSize,t.fontStyle=e.fontStyle,t.fontWeight=e.fontWeight,t.text=i.label.text,t.textAlign=i.label.textAlign,t.textBaseline=i.label.textBaseline,t.visible=!0):t.visible=!1})}getTooltipContent(e){const{id:t,dataModel:i,processedData:n,axes:s,properties:r}=this,{angleKey:o,angleName:a,radiusKey:l,radiusName:c,tooltip:h,marker:u}=r,d=s[kD.Angle],p=s[kD.Radius];if(!(i&&n&&d&&p))return;const g=n.dataSources.get(this.id)?.[e],f=i.resolveColumnById(this,"angleValue",n)[e],m=i.resolveColumnById(this,"radiusValue",n)[e];if(null==f)return;const y=this.getMarkerStyle(u,g,this.getDatumStylerProperties(g),!1);return this.formatTooltipWithContext(h,{heading:d.formatDatum(f),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:p.formatDatum(m)}]},{seriesId:t,datum:g,title:a,angleKey:o,radiusKey:l,angleName:a,radiusName:c,...y})}legendItemSymbol(){const{stroke:e,strokeWidth:t,strokeOpacity:i,lineDash:n,marker:s}=this.properties;return{marker:XD({shape:s.shape,enabled:s.enabled||t<=0,fill:this.getMarkerFill()??s.stroke??e??"rgba(0, 0, 0, 0)",stroke:s.stroke??e??"rgba(0, 0, 0, 0)",fillOpacity:s.fillOpacity,strokeOpacity:s.strokeOpacity,strokeWidth:s.strokeWidth,lineDash:s.lineDash,lineDashOffset:s.lineDashOffset},s.fillGradientDefaults,s.fillPatternDefaults,s.fillImageDefaults),line:{stroke:e,strokeOpacity:i,strokeWidth:t,lineDash:n}}}getLegendData(e){if("category"!==e)return[];const{id:t,ctx:{legendManager:i},visible:n}=this,{radiusKey:s,radiusName:r,showInLegend:o}=this.properties;return[{legendType:"category",id:t,itemId:s,seriesId:t,enabled:n&&i.getItemEnabled({seriesId:t,itemId:s}),label:{text:r??s},symbol:this.legendItemSymbol(),hideInLegend:!o}]}pickNodeClosestDatum(e){const{nodeData:t,centerX:i,centerY:n}=this,{x:s,y:r}=e,o=this.radius;if(Math.sqrt((s-i)**2+(r-n)**2)>o+this.properties.marker.size)return;let a,l=1/0;for(const s of t){const{point:{x:t=NaN,y:r=NaN}={}}=s;if(isNaN(t)||isNaN(r))continue;const o=Math.sqrt((e.x-t-i)**2+(e.y-r-n)**2);o<l&&(l=o,a=s)}return a?{datum:a,distance:Math.max(l-(a.point?.size??0),0)}:void 0}computeLabelsBBox(){const{label:e}=this.properties;this.maybeRefreshNodeData();const t=[],i=new KD;return this.nodeData.forEach(n=>{if(!e.enabled||!n.label)return;i.text=n.label.text,i.x=n.label.x,i.y=n.label.y,i.setFont(e),i.setAlign(n.label);const s=i.getBBox();t.push(s)}),0===t.length?null:UD.merge(t)}getLineNode(){return this.lineSelection?.at(0)}beforePathAnimation(){const e=this.getLineNode();e&&(e.fill=void 0,e.lineJoin="round",e.lineCap="round",e.pointerEvents=jD.None,e.stroke=this.properties.stroke,e.strokeWidth=this.getStrokeWidth(this.properties.strokeWidth),e.strokeOpacity=this.properties.strokeOpacity,e.lineDash=this.properties.lineDash,e.lineDashOffset=this.properties.lineDashOffset)}getLinePoints(){const{nodeData:e,resetInvalidToZero:t}=this,{connectMissingData:i}=this.properties;if(0===e.length)return[];const n=this.axes[kD.Radius],s=this.axes[kD.Angle],r=s?.isReversed(),o=n?.isReversed(),a=o&&!r?[...e].reverse():e,l=[];let c,h=!1;return a.forEach((e,n)=>{let{x:s,y:r}=e.point;const o=isNaN(s)||isNaN(r);o||(c??(c=e)),o&&!i&&(s=0,r=0);const a=0===n||!t&&!i&&(o||h);l.push({x:s,y:r,moveTo:a}),h=o}),void 0!==c&&l.push({x:c.point.x,y:c.point.y,moveTo:!1}),l}animateSinglePath(e,t,i){const{path:n}=e;n.clear(!0);const s=this.getAxisInnerRadius(),r=this.axes[kD.Radius],o=r?.isReversed(),a=o?this.radius+s-r?.scale.convert(0):s;t.forEach(e=>{const{x:t,y:s,arc:r,radius:o=0,startAngle:l=0,endAngle:c=0,moveTo:h}=e,u=Math.atan2(s,t),d=a*Math.cos(u),p=a*Math.sin(u),g=d*(1-i)+t*i,f=p*(1-i)+s*i;r?n.arc(t,s,o,l,c):h?n.moveTo(g,f):n.lineTo(g,f)}),e.checkPathDirty()}animatePaths(e){const t=this.getLinePoints(),i=this.getLineNode();i&&this.animateSinglePath(i,t,e)}animateEmptyUpdateReady(){const{itemSelection:e,labelSelection:t}=this,{animationManager:i}=this.ctx;this.beforePathAnimation(),i.animate({id:`${this.id}_'path`,groupId:this.id,from:0,to:1,phase:"initial",collapsable:!1,onUpdate:e=>this.animatePaths(e),onStop:()=>this.animatePaths(1)}),FD(this,i,"added",e),OD(this,"labels",i,t)}animateWaitingUpdateReady(e){super.animateWaitingUpdateReady(e),this.resetPaths()}animateReadyResize(e){super.animateReadyResize(e),this.resetPaths()}resetPaths(){const e=this.getLineNode();if(e){const{path:t}=e,i=this.getLinePoints();e.fill=void 0,e.stroke=this.properties.stroke,e.strokeWidth=this.getStrokeWidth(this.properties.strokeWidth),e.strokeOpacity=this.properties.strokeOpacity,e.lineDash=this.properties.lineDash,e.lineDashOffset=this.properties.lineDashOffset,t.clear(!0);for(const{x:e,y:n,moveTo:s}of i)s?t.moveTo(e,n):t.lineTo(e,n);e.checkPathDirty()}}getFormattedMarkerStyle(e){const{angleKey:t,radiusKey:i}=this.properties;return this.getMarkerStyle(this.properties.marker,e.datum,{angleKey:t,radiusKey:i},!0)}computeFocusBounds(e){return VD(this,e)}};QD.className="RadarSeries";var{FillGradientDefaults:JD,FillPatternDefaults:eI,FillImageDefaults:tI,Property:iI}=n.n1,nI=class extends RD{constructor(){super(...arguments),this.fill="black",this.fillGradientDefaults=new JD,this.fillPatternDefaults=new eI,this.fillImageDefaults=new tI,this.fillOpacity=1}};a([iI],nI.prototype,"fill",2),a([iI],nI.prototype,"fillGradientDefaults",2),a([iI],nI.prototype,"fillPatternDefaults",2),a([iI],nI.prototype,"fillImageDefaults",2),a([iI],nI.prototype,"fillOpacity",2);var{Group:sI,Path:rI,PointerEvents:oI,Selection:aI,ChartAxisDirection:lI,applyShapeStyle:cI,getShapeFill:hI,getShapeStyle:uI}=n.n1,dI=class extends QD{constructor(e){super(e),this.properties=new nI,this.areaGroup=this.contentGroup.appendChild(new sI({name:"radar-area"})),this.areaSelection=aI.select(this.areaGroup,rI),this.resetInvalidToZero=!0,this.areaGroup.zIndex=-1}updatePathSelections(){const e=this.visible?[!0]:[];this.areaSelection.update(e),super.updatePathSelections()}getAreaNode(){return this.areaSelection.at(0)}getMarkerFill(e){return e?.fill??this.properties.marker.fill??this.properties.fill}beforePathAnimation(){super.beforePathAnimation();const e=this.getAreaNode(),{fillOpacity:t,fill:i}=this.properties,n=uI({fill:i,fillOpacity:t},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults);cI(e,n,void 0,this.getShapeFillBBox()),e.pointerEvents=oI.None,e.stroke=void 0}animatePaths(e){super.animatePaths(e),this.animateSinglePath(this.getAreaNode(),this.getAreaPoints(),e)}getAreaPoints(){const e=this.getLinePoints(),t=e=>{const t=this.axes[e];return t instanceof n.n1.PolarAxis?t:void 0},i=t(lI.Radius),s=t(lI.Angle),r=i?.isReversed();if(!r)return e;const o=s?.getAxisLinePoints()?.points??[];return e.concat(...o)}resetPaths(){super.resetPaths();const e=this.getAreaNode();if(e){const{path:t}=e,i=this.getAreaPoints(),n=hI(this.properties.fill,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults),s=this.getShapeFillBBox();cI(e,{fill:n,stroke:void 0,fillOpacity:this.properties.fillOpacity,lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset},void 0,s),e.lineJoin=e.lineCap="round",t.clear(!0),i.forEach(({x:e,y:i,moveTo:n,arc:s,radius:r=0,startAngle:o=0,endAngle:a=0})=>{s?t.arc(e,i,r,o,a):n?t.moveTo(e,i):t.lineTo(e,i)}),t.closePath(),e.checkPathDirty()}}};dI.className="RadarAreaSeries",dI.type="radar-area";var{commonSeriesOptionsDefs:pI,radarAreaSeriesThemeableOptionsDef:gI}=n.n1,fI={...gI,...pI,type:(0,s.mw)((0,s.dY)("radar-area")),angleKey:(0,s.mw)(s.Yj),radiusKey:(0,s.mw)(s.Yj),angleName:s.Yj,radiusName:s.Yj},{ThemeConstants:{POLAR_AXIS_TYPE:mI}}=n.n1,yI={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radar-area",moduleFactory:e=>new dI(e),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:mI.ANGLE_CATEGORY},{type:mI.RADIUS_NUMBER}],themeTemplate:ED},vI={type:"series",name:"radar-area",chartType:"polar",enterprise:!0,options:fI,create:e=>new dI(e)},bI=class extends QD{updatePathSelections(){this.lineSelection.update(this.visible?[!0]:[])}};bI.className="RadarLineSeries",bI.type="radar-line";var{commonSeriesOptionsDefs:CI,radarLineSeriesThemeableOptionsDef:wI}=n.n1,SI={...wI,...CI,type:(0,s.mw)((0,s.dY)("radar-line")),angleKey:(0,s.mw)(s.Yj),radiusKey:(0,s.mw)(s.Yj),angleName:s.Yj,radiusName:s.Yj},{POLAR_AXIS_TYPE:xI}=n.n1.ThemeConstants,EI={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radar-line",moduleFactory:e=>new bI(e),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:xI.ANGLE_CATEGORY},{type:xI.RADIUS_NUMBER}],themeTemplate:xD},AI={type:"series",name:"radar-line",chartType:"polar",enterprise:!0,options:SI,create:e=>new bI(e)},{SeriesProperties:MI,FillGradientDefaults:TI,FillPatternDefaults:DI,FillImageDefaults:II,SeriesTooltip:RI,Property:kI,Label:PI}=n.n1,_I=class extends MI{constructor(){super(...arguments),this.fill="black",this.fillGradientDefaults=new TI,this.fillPatternDefaults=new DI,this.fillImageDefaults=new II,this.fillOpacity=1,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.label=new PI,this.tooltip=new RI}};a([kI],_I.prototype,"angleKey",2),a([kI],_I.prototype,"radiusKey",2),a([kI],_I.prototype,"angleName",2),a([kI],_I.prototype,"radiusName",2),a([kI],_I.prototype,"fill",2),a([kI],_I.prototype,"fillGradientDefaults",2),a([kI],_I.prototype,"fillPatternDefaults",2),a([kI],_I.prototype,"fillImageDefaults",2),a([kI],_I.prototype,"fillOpacity",2),a([kI],_I.prototype,"stroke",2),a([kI],_I.prototype,"strokeWidth",2),a([kI],_I.prototype,"strokeOpacity",2),a([kI],_I.prototype,"lineDash",2),a([kI],_I.prototype,"lineDashOffset",2),a([kI],_I.prototype,"cornerRadius",2),a([kI],_I.prototype,"itemStyler",2),a([kI],_I.prototype,"rotation",2),a([kI],_I.prototype,"stackGroup",2),a([kI],_I.prototype,"normalizedTo",2),a([kI],_I.prototype,"label",2),a([kI],_I.prototype,"tooltip",2);var{SectorBox:LI,motion:NI}=n.n1;function OI(e){return{toFn:(t,i,n)=>{let s,r,o,a,l;return"removed"===n?(s=e,r=e,o=i.innerRadius,a=i.outerRadius,l=new LI(s,r,o,a)):(s=i.startAngle,r=i.endAngle,o=isNaN(i.innerRadius)?t.innerRadius:i.innerRadius,a=isNaN(i.outerRadius)?t.outerRadius:i.outerRadius,l=i.clipSector),{startAngle:s,endAngle:r,innerRadius:o,outerRadius:a,clipSector:l}},fromFn:(t,i,n)=>{let s,r,o,a,l;return n=function(e,t,i){if("updated"===i){if(null==e.previousDatum||isNaN(e.previousDatum.innerRadius)||isNaN(e.previousDatum.outerRadius))return"added";if(isNaN(t.innerRadius)||isNaN(t.outerRadius))return"removed"}return"added"===i&&null!=e.previousDatum?"updated":i}(t,i,n),"removed"===n||"updated"===n?(s=t.startAngle,r=t.endAngle,o=t.innerRadius,a=t.outerRadius,l=t.clipSector):(s=e,r=e,o=i.innerRadius,a=i.outerRadius),l??(l=new LI(s,r,o,a)),{startAngle:s,endAngle:r,innerRadius:o,outerRadius:a,clipSector:l,phase:NI.NODE_UPDATE_STATE_TO_PHASE_MAPPING[n]}}}}function FI(e,t){return{centerX:0,centerY:0,innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle,endAngle:t.endAngle,clipSector:t.clipSector}}var{ChartAxisDirection:GI,PolarAxis:BI,diff:VI,groupAccumulativeValueProperty:HI,keyProperty:UI,normaliseGroupTo:zI,valueProperty:WI,fixNumericExtent:jI,resetLabelFn:$I,seriesLabelFadeInAnimation:KI,seriesLabelFadeOutAnimation:YI,animationValidation:qI,angleBetween:XI,createDatumId:ZI,CategoryScale:QI,Sector:JI,SectorBox:eR,motion:tR,isGradientFill:iR,applyShapeStyle:nR,getShapeStyle:sR}=n.n1,rR=class extends n.n1.SeriesNodeEvent{constructor(e,t,i,n){super(e,t,i,n),this.angleKey=n.properties.angleKey,this.radiusKey=n.properties.radiusKey}},oR=class extends n.n1.PolarSeries{constructor(e){super({moduleCtx:e,categoryKey:"radiusValue",useLabelLayer:!0,canHaveAxes:!0,animationResetFns:{item:FI,label:$I}}),this.properties=new _I,this.NodeEvent=rR,this.groupScale=new QI,this.circleCache={r:0,cx:0,cy:0}}get defaultShapeStyle(){const e=this.axes[GI.Angle]?.scale;return{...this.properties.fillGradientDefaults.toJson(),rotation:n.n1.toDegrees(e.range[0])+90}}nodeFactory(){return new JI}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return[];if(e===GI.Angle){const e=t.getDomain(this,"angleValue-end","value",i),n=[e[0]>0?0:e[0],e[1]<0?0:e[1]];return jI(n)}return t.getDomain(this,"radiusValue","key",i)}async processData(e){const{angleKey:t,radiusKey:i,normalizedTo:n}=this.properties,r=!this.ctx.animationManager.isSkipped(),o=this.getStackId(),a=`${o}-trailing`,l=[];(0,s.vM)(n)&&l.push(zI([o,a],Math.abs(n))),r&&(this.processedData&&l.push(VI(this.id,this.processedData)),l.push(qI()));const c=this.visible?{}:{forceValue:0},h=this.axes[GI.Radius]?.scale.type,u=this.axes[GI.Angle]?.scale.type;await this.requestDataModel(e,this.data,{props:[UI(i,h,{id:"radiusValue"}),WI(t,u,{id:"angleValue-raw",invalidValue:null,...c}),...HI(t,"normal","current",{id:"angleValue-end",rangeId:"angleValue-range",invalidValue:null,groupId:o,separateNegative:!0,...c},u),...HI(t,"trailing","current",{id:"angleValue-start",invalidValue:null,groupId:a,separateNegative:!0,...c},u),...l],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")}didCircleChange(){const e=this.radius,t=this.centerX,i=this.centerY,n=this.circleCache;return(e!==n.r||t!==n.cx||i!==n.cy)&&(this.circleCache={r:e,cx:t,cy:i},!0)}maybeRefreshNodeData(){if(!this.didCircleChange()&&!this.nodeDataRefresh)return;const{nodeData:e=[]}=this.createNodeData()??{};this.nodeData=e,this.nodeDataRefresh=!1}getAxisInnerRadius(){const e=this.axes[GI.Radius];return e instanceof BI?this.radius*e.innerRadiusRatio:0}createNodeData(){const{processedData:e,dataModel:t}=this;if(!t||!e||"grouped"!==e.type)return;const i=this.axes[GI.Angle],n=this.axes[GI.Radius],s=i?.scale,r=n?.scale;if(!s||!r)return;const o=t.resolveKeysById(this,"radiusValue",e),a=t.resolveColumnById(this,"angleValue-start",e),l=t.resolveColumnById(this,"angleValue-end",e),c=t.resolveColumnById(this,"angleValue-raw",e),h=t.resolveProcessedDataIndexById(this,"angleValue-range");let u=0;n instanceof ze&&(u=n.groupPaddingInner);const{groupScale:d}=this,{index:p,visibleGroupCount:g}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);d.domain=Array.from({length:g}).map((e,t)=>String(t)),d.range=[0,Math.abs(r.bandwidth??0)],d.paddingInner=g>1?u:0;const f=d.bandwidth>=1?d.bandwidth:d.rawBandwidth,m=i.isReversed(),y=n.isReversed(),v=y?this.radius:this.getAxisInnerRadius(),b=(y?this.getAxisInnerRadius():this.radius)+v,{angleKey:C,radiusKey:w,angleName:S,radiusName:x,label:E}=this.properties,A=(e,t,i,n)=>{const s=this.getLabelText(E,{value:t,datum:e,angleKey:C,radiusKey:w,angleName:S,radiusName:x});if(s)return{x:i,y:n,text:s,textAlign:"center",textBaseline:"middle"}},M=[],T={itemId:w,nodeData:M,labelData:M};if(!this.visible)return T;const{dataSources:D}=e,I=D.get(this.id)??[];for(const{datumIndex:i,group:n}of t.forEachGroupDatum(this,e)){const e=I[i],t=o[i];if(null==t)return;const u=c[i],g=a[i],y=l[i],v=u>=0&&!Object.is(u,-0),C=n.aggregation[h][v?1:0],w=v===m;let S=s.convert(g,{clamp:!0}),x=s.convert(y,{clamp:!0}),E=s.convert(0,{clamp:!0}),T=s.convert(C,{clamp:!0});w&&([E,T]=[T,E],[S,x]=[x,S]);const D=b-r.convert(t)+d.convert(String(p)),R=D+f,k=(D+R)/2,P=S+XI(S,x)/2,_=Math.cos(P)*k,L=Math.sin(P)*k,N=this.properties.label.enabled?A(e,u,_,L):void 0,O=new eR(S,x,D,R);M.push({series:this,datum:e,datumIndex:i,point:{x:_,y:L,size:0},midPoint:{x:_,y:L},label:N,angleValue:u,radiusValue:t,innerRadius:D,outerRadius:R,startAngle:E,endAngle:T,clipSector:O,reversed:w,index:i})}return T}update({seriesRect:e}){const t=this.checkResize(e);this.maybeRefreshNodeData(),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),this.updateSectorSelection(this.itemSelection,!1),this.updateSectorSelection(this.highlightSelection,!0),this.updateLabels(),t&&this.animationState.transition("resize"),this.animationState.transition("update")}getItemBaseStyle(e){const{properties:t}=this,i=e?t.highlightStyle.item:void 0;return sR({fill:i?.fill??t.fill,fillOpacity:i?.fillOpacity??t.fillOpacity,stroke:i?.stroke??t.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(t.strokeWidth),strokeOpacity:i?.strokeOpacity??t.strokeOpacity,lineDash:i?.lineDash??t.lineDash,lineDashOffset:i?.lineDashOffset??t.lineDashOffset,cornerRadius:t.cornerRadius},this.defaultShapeStyle,t.fillPatternDefaults,t.fillImageDefaults)}getItemStyleOverrides(e,t,i,n){const{id:s,properties:r}=this,{angleKey:o,radiusKey:a,itemStyler:l}=r;let c;return null!=l&&(c=this.cachedDatumCallback(ZI(e,n?"highlight":"node"),()=>this.callWithContext(l,{seriesId:s,datum:t,highlighted:n,angleKey:o,radiusKey:a,...i}))),sR(c,this.defaultShapeStyle,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}updateSectorSelection(e,t){let i=[];if(t){const e=this.ctx.highlightManager?.getActiveHighlight();e?.datum&&e.series===this&&i.push(e)}else i=this.nodeData;const s=this.getItemBaseStyle(t),r=this.getShapeFillBBox();e.update(i,void 0,e=>this.getDatumId(e)).each((e,i)=>{const{datum:o,datumIndex:a}=i,l=this.getItemStyleOverrides(String(a),o,s,t),c=l?.cornerRadius??s.cornerRadius,h=l?.fill??s.fill,u=n.n1.isGradientFill(h)&&"item"!==h.bounds?{centerX:0,centerY:0}:void 0;nR(e,s,l,r,u),e.lineJoin="round",e.inset=null!=e.stroke?e.strokeWidth/2:0,e.startInnerCornerRadius=o.reversed?c:0,e.startOuterCornerRadius=o.reversed?c:0,e.endInnerCornerRadius=o.reversed?0:c,e.endOuterCornerRadius=o.reversed?0:c,t&&(e.startAngle=i.startAngle,e.endAngle=i.endAngle,e.clipSector=i.clipSector,e.innerRadius=i.innerRadius,e.outerRadius=i.outerRadius)})}updateLabels(){const{label:e}=this.properties;this.labelSelection.update(this.nodeData).each((t,i)=>{e.enabled&&i.label?(t.x=i.label.x,t.y=i.label.y,t.fill=e.color,t.fontFamily=e.fontFamily,t.fontSize=e.fontSize,t.fontStyle=e.fontStyle,t.fontWeight=e.fontWeight,t.text=i.label.text,t.textAlign=i.label.textAlign,t.textBaseline=i.label.textBaseline,t.visible=!0):t.visible=!1})}getBarTransitionFunctions(){const e=this.axes[GI.Angle]?.scale;let t=0;if(!e)return OI(t);const i=Math.min(e.domain[0],e.domain[1]),n=Math.max(e.domain[0],e.domain[1]);return i<=0&&n>=0&&(t=e.convert(0)),OI(t)}animateEmptyUpdateReady(){const{labelSelection:e}=this,t=this.getBarTransitionFunctions();tR.fromToMotion(this.id,"datums",this.ctx.animationManager,[this.itemSelection],t),KI(this,"labels",this.ctx.animationManager,e)}animateClearingUpdateEmpty(){const{itemSelection:e}=this,{animationManager:t}=this.ctx,i=this.getBarTransitionFunctions();tR.fromToMotion(this.id,"datums",t,[e],i),YI(this,"labels",t,this.labelSelection)}getTooltipContent(e){const{id:t,dataModel:i,processedData:n,axes:s,properties:r}=this,{angleKey:o,angleName:a,radiusKey:l,radiusName:c,tooltip:h}=r,u=s[GI.Angle],d=s[GI.Radius];if(!(i&&n&&u&&d))return;const p=n.dataSources.get(this.id)?.[e],g=i.resolveKeysById(this,"radiusValue",n)[e],f=i.resolveColumnById(this,"angleValue-raw",n)[e];if(null==g)return;const m=this.getItemBaseStyle(!1);return Object.assign(m,this.getItemStyleOverrides(String(e),e,m,!1)),this.formatTooltipWithContext(h,{heading:d.formatDatum(g),symbol:this.legendItemSymbol(),data:[{label:a,fallbackLabel:o,value:u.formatDatum(f)}]},{seriesId:t,datum:p,title:a,angleKey:o,angleName:a,radiusKey:l,radiusName:c,...m})}pickNodeClosestDatum(e){return this.pickNodeNearestDistantObject(e,this.itemSelection.nodes())}legendItemSymbol(){const{fill:e,stroke:t,fillOpacity:i,strokeOpacity:n,strokeWidth:s,lineDash:r,lineDashOffset:o,fillPatternDefaults:a,fillImageDefaults:l}=this.properties,c=sR({fill:e??"rgba(0, 0, 0, 0)",stroke:t??"rgba(0, 0, 0, 0)",fillOpacity:i,strokeOpacity:n,strokeWidth:s,lineDash:r,lineDashOffset:o},this.defaultShapeStyle,a,l);return iR(c.fill)&&(c.fill={...c.fill,gradient:"linear",rotation:0,reverse:!1}),{marker:c}}getLegendData(e){if("category"!==e)return[];const{id:t,visible:i}=this,{angleKey:n,angleName:s,showInLegend:r}=this.properties;return[{legendType:"category",id:t,itemId:n,seriesId:t,enabled:i,label:{text:s??n},symbol:this.legendItemSymbol(),hideInLegend:!r}]}getDatumId(e){return ZI(e.radiusValue)}computeLabelsBBox(){return null}getStackId(){return`radialBar-stack-${this.seriesGrouping?.groupIndex??this.id}-xValues`}};oR.className="RadialBarSeries",oR.type="radial-bar";var{commonSeriesOptionsDefs:aR,radialBarSeriesThemeableOptionsDef:lR}=n.n1,cR={...lR,...aR,type:(0,s.mw)((0,s.dY)("radial-bar")),angleKey:(0,s.mw)(s.Yj),radiusKey:(0,s.mw)(s.Yj),angleName:s.Yj,radiusName:s.Yj,grouped:s.zM,stacked:s.zM,stackGroup:s.Yj,normalizedTo:s.ai},{ThemeConstants:{POLAR_AXIS_TYPE:hR}}=n.n1,uR={series:{fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"conic",bounds:"series",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:n.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:n.n1.FILL_IMAGE_DEFAULTS,strokeWidth:0,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"}}},axes:{[hR.RADIUS_CATEGORY]:{innerRadiusRatio:.2,groupPaddingInner:.2,paddingInner:.2,paddingOuter:.1}}},{POLAR_AXIS_TYPE:dR}=n.n1.ThemeConstants,pR={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radial-bar",moduleFactory:e=>new oR(e),tooltipDefaults:{range:"exact"},defaultAxes:[{type:dR.ANGLE_NUMBER},{type:dR.RADIUS_CATEGORY}],themeTemplate:uR,stackable:!0,groupable:!0},gR={type:"series",name:"radial-bar",chartType:"polar",enterprise:!0,options:cR,create:e=>new oR(e)},{Property:fR}=n.n1,mR=class extends vT{};a([fR],mR.prototype,"columnWidthRatio",2),a([fR],mR.prototype,"maxColumnWidthRatio",2);var{ChartAxisDirection:yR,PolarAxis:vR,RadialColumnShape:bR,getRadialColumnWidth:CR}=n.n1,wR=class extends hT{constructor(e){super(e,{animationResetFns:{item:ST}}),this.properties=new mR}getStackId(){return`radarColumn-stack-${this.seriesGrouping?.groupIndex??this.id}-yValues`}nodeFactory(){return new bR}getColumnTransitionFunctions(){return function(e){const t=CT();return{toFn:(i,n,s)=>{const{startAngle:r,endAngle:o}=t.to(n);let a,l,c,h,u;return"removed"===s?(a=i.innerRadius,l=i.innerRadius,c=i.columnWidth,h=i.axisInnerRadius,u=i.axisOuterRadius):(a=isNaN(n.innerRadius)?e:n.innerRadius,l=isNaN(n.outerRadius)?e:n.outerRadius,c=isNaN(n.columnWidth)?i.columnWidth:n.columnWidth,h=n.axisInnerRadius,u=n.axisOuterRadius),{innerRadius:a,outerRadius:l,columnWidth:c,axisInnerRadius:h,axisOuterRadius:u,startAngle:r,endAngle:o}},fromFn:(i,n,s)=>{s=wT(i,n,s),t.calculate(i,n,s);const{startAngle:r,endAngle:o}=t.from(n);let a,l,c,h,u;return"removed"===s||"updated"===s?(a=i.innerRadius,l=i.outerRadius,c=i.columnWidth,h=i.axisInnerRadius,u=i.axisOuterRadius):(a=e,l=e,c=n.columnWidth,h=n.axisInnerRadius,u=n.axisOuterRadius),{innerRadius:a,outerRadius:l,columnWidth:c,axisInnerRadius:h,axisOuterRadius:u,startAngle:r,endAngle:o,phase:bT.NODE_UPDATE_STATE_TO_PHASE_MAPPING[s]}}}}(this.isRadiusAxisReversed()?this.radius:this.getAxisInnerRadius())}isRadiusAxisCircle(){const e=this.axes[yR.Radius];return e instanceof vR&&"circle"===e.shape}updateItemPath(e,t,i){e.isBeveled=this.isRadiusAxisCircle(),e.isRadiusAxisReversed=this.isRadiusAxisReversed(),i&&(e.innerRadius=t.innerRadius,e.outerRadius=t.outerRadius,e.startAngle=t.startAngle,e.endAngle=t.endAngle,e.columnWidth=t.columnWidth,e.axisInnerRadius=t.axisInnerRadius,e.axisOuterRadius=t.axisOuterRadius)}getColumnWidth(e,t){const{columnWidthRatio:i=.5,maxColumnWidthRatio:n=.5}=this.properties;return CR(e,t,this.radius,i,n)}};wR.className="RadialColumnSeries",wR.type="radial-column";var{commonSeriesOptionsDefs:SR,radialColumnSeriesThemeableOptionsDef:xR}=n.n1,ER={...xR,...SR,type:(0,s.mw)((0,s.dY)("radial-column")),angleKey:(0,s.mw)(s.Yj),radiusKey:(0,s.mw)(s.Yj),angleName:s.Yj,radiusName:s.Yj,grouped:s.zM,stacked:s.zM,stackGroup:s.Yj,normalizedTo:s.ai},{ThemeConstants:{POLAR_AXIS_TYPE:AR,POLAR_AXIS_SHAPE:MR}}=n.n1,TR={$path:["./shape",MR.CIRCLE,{$find:[{$not:[{$isOperation:"./shape"}]},{$path:".."}]}]},DR={series:{fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"series",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:n.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:n.n1.FILL_IMAGE_DEFAULTS,columnWidthRatio:.5,maxColumnWidthRatio:.5,strokeWidth:0,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}},axes:{[AR.ANGLE_CATEGORY]:{shape:TR,groupPaddingInner:0,paddingInner:0,label:{spacing:10}},[AR.RADIUS_NUMBER]:{shape:TR,innerRadiusRatio:.5}}},{POLAR_AXIS_TYPE:IR}=n.n1.ThemeConstants,RR={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radial-column",moduleFactory:e=>new wR(e),tooltipDefaults:{range:"exact"},defaultAxes:[{type:IR.ANGLE_CATEGORY},{type:IR.RADIUS_NUMBER}],themeTemplate:DR,stackable:!0,groupable:!0},kR={type:"series",name:"radial-column",chartType:"polar",enterprise:!0,options:ER,create:e=>new wR(e)},{SvgPath:PR,Rotatable:_R,Translatable:LR,Scalable:NR}=n.n1,OR=class extends(_R(NR(LR(PR)))){constructor(){super(...arguments),this.scalingCenterX=.5,this.scalingCenterY=.5,this.rotationCenterX=.5,this.rotationCenterY=.5}};OR.defaultPathData="M0.50245 0.53745C0.481767 0.53745 0.465 0.520683 0.465 0.5C0.465 0.479317 0.481767 0.46255 0.50245 0.46255L1 0.500012L0.50245 0.53745Z";var{BaseProperties:FR,SeriesTooltip:GR,SeriesProperties:BR,PropertiesArray:VR,AxisLabel:HR,Property:UR,Label:zR}=n.n1,WR=class extends zR{};a([UR],WR.prototype,"spacing",2);var jR=class extends FR{constructor(){super(...arguments),this.label=new WR}};a([UR],jR.prototype,"text",2),a([UR],jR.prototype,"value",2),a([UR],jR.prototype,"shape",2),a([UR],jR.prototype,"placement",2),a([UR],jR.prototype,"spacing",2),a([UR],jR.prototype,"size",2),a([UR],jR.prototype,"rotation",2),a([UR],jR.prototype,"fill",2),a([UR],jR.prototype,"fillOpacity",2),a([UR],jR.prototype,"stroke",2),a([UR],jR.prototype,"strokeWidth",2),a([UR],jR.prototype,"strokeOpacity",2),a([UR],jR.prototype,"lineDash",2),a([UR],jR.prototype,"lineDashOffset",2),a([UR],jR.prototype,"label",2);var $R=class extends FR{constructor(){super(...arguments),this.enabled=!0,this.fills=new VR(n.n1.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};a([UR],$R.prototype,"enabled",2),a([UR],$R.prototype,"fills",2),a([UR],$R.prototype,"fillMode",2),a([UR],$R.prototype,"fill",2),a([UR],$R.prototype,"fillOpacity",2),a([UR],$R.prototype,"stroke",2),a([UR],$R.prototype,"strokeWidth",2),a([UR],$R.prototype,"strokeOpacity",2),a([UR],$R.prototype,"lineDash",2),a([UR],$R.prototype,"lineDashOffset",2);var KR=class extends FR{constructor(){super(...arguments),this.values=void 0,this.step=void 0,this.minSpacing=0,this.maxSpacing=1e3}};a([UR],KR.prototype,"values",2),a([UR],KR.prototype,"step",2),a([UR],KR.prototype,"minSpacing",2),a([UR],KR.prototype,"maxSpacing",2);var YR=class extends HR{},qR=class extends FR{constructor(){super(...arguments),this.min=0,this.max=1,this.fills=new VR(n.n1.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.defaultFill="black",this.interval=new KR,this.label=new YR}};a([UR],qR.prototype,"min",2),a([UR],qR.prototype,"max",2),a([UR],qR.prototype,"fills",2),a([UR],qR.prototype,"fillMode",2),a([UR],qR.prototype,"fill",2),a([UR],qR.prototype,"fillOpacity",2),a([UR],qR.prototype,"stroke",2),a([UR],qR.prototype,"strokeWidth",2),a([UR],qR.prototype,"strokeOpacity",2),a([UR],qR.prototype,"lineDash",2),a([UR],qR.prototype,"lineDashOffset",2),a([UR],qR.prototype,"defaultFill",2),a([UR],qR.prototype,"interval",2),a([UR],qR.prototype,"label",2);var XR=class extends FR{constructor(){super(...arguments),this.enabled=!0,this.spacing=0,this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};a([UR],XR.prototype,"enabled",2),a([UR],XR.prototype,"radiusRatio",2),a([UR],XR.prototype,"spacing",2),a([UR],XR.prototype,"fill",2),a([UR],XR.prototype,"fillOpacity",2),a([UR],XR.prototype,"stroke",2),a([UR],XR.prototype,"strokeWidth",2),a([UR],XR.prototype,"strokeOpacity",2),a([UR],XR.prototype,"lineDash",2),a([UR],XR.prototype,"lineDashOffset",2);var ZR=class extends cm{};a([UR],ZR.prototype,"text",2);var QR=class extends hm{};a([UR],QR.prototype,"text",2);var JR=class extends BR{constructor(){super(...arguments),this.startAngle=0,this.endAngle=0,this.segmentation=new tx,this.defaultColorRange=[],this.targets=new VR(jR),this.defaultTarget=new jR,this.outerRadiusRatio=1,this.innerRadiusRatio=1,this.cornerRadius=0,this.cornerMode="container",this.spacing=0,this.scale=new qR,this.bar=new $R,this.needle=new XR,this.label=new ZR,this.secondaryLabel=new QR,this.tooltip=new GR}};a([UR],JR.prototype,"value",2),a([UR],JR.prototype,"startAngle",2),a([UR],JR.prototype,"endAngle",2),a([UR],JR.prototype,"segmentation",2),a([UR],JR.prototype,"defaultColorRange",2),a([UR],JR.prototype,"targets",2),a([UR],JR.prototype,"defaultTarget",2),a([UR],JR.prototype,"outerRadiusRatio",2),a([UR],JR.prototype,"innerRadiusRatio",2),a([UR],JR.prototype,"outerRadius",2),a([UR],JR.prototype,"innerRadius",2),a([UR],JR.prototype,"cornerRadius",2),a([UR],JR.prototype,"cornerMode",2),a([UR],JR.prototype,"spacing",2),a([UR],JR.prototype,"scale",2),a([UR],JR.prototype,"bar",2),a([UR],JR.prototype,"needle",2),a([UR],JR.prototype,"label",2),a([UR],JR.prototype,"secondaryLabel",2),a([UR],JR.prototype,"tooltip",2);var{SectorBox:ek}=n.n1;function tk(e,t,i){return Math.max(e,i.startAngle)<=Math.min(t,i.endAngle)}function ik(e){return null!=e.clipStartAngle&&null!=e.clipEndAngle}function nk(e,t){const{clipStartAngle:i,clipEndAngle:n,innerRadius:s,outerRadius:r}=e;return new ek(i,t?i:n,s,r)}function sk(e,t){const i=e?"initial":"update";return{node:{fromFn(t,n){const s=t.previousDatum;let{startAngle:r,endAngle:o}=s??n;const a=null!=s&&ik(s)?nk(s,e):void 0,l=ik(n)?nk(n,e):void 0;let c;return null!=a&&null!=l?c=a:null==a&&null!=l?(c=l,r=n.startAngle,o=n.endAngle):null!=a&&null==l?(c=void 0,r=n.startAngle,o=n.endAngle):e&&(o=r),{startAngle:r,endAngle:o,clipSector:c,phase:i}},toFn(e,t){const{startAngle:i,endAngle:n}=t;let s;return ik(t)&&(s=nk(t,!1)),{startAngle:i,endAngle:n,clipSector:s}},applyFn(e,t){const{startAngle:i,endAngle:n}=t;let{clipSector:s}=t;null!=s&&(s=new ek(Math.max(i,s.startAngle),Math.min(n,s.endAngle),s.innerRadius,s.outerRadius));const r=null==s||tk(i,n,s);e.startAngle=i,e.endAngle=n,e.clipSector=s,e.visible=r}},needle:{fromFn(n){let{angle:s}=n.previousDatum??n.datum;return e&&(s=t),{rotation:s,phase:i}},toFn(e,t){const{angle:i}=t;return{rotation:i}}}}}function rk(e,t){const{startAngle:i,endAngle:n}=t,s=function(e){const{startAngle:t,endAngle:i,clipStartAngle:n,clipEndAngle:s,innerRadius:r,outerRadius:o}=e;if(null!=n&&null!=s)return new ek(Math.max(n,t),Math.min(s,i),r,o)}(t);return{startAngle:i,endAngle:n,clipSector:s,visible:null==s||tk(i,n,s)}}function ok(e,t){const{angle:i}=t;return{rotation:i}}var ak={top:0,middle:.5,bottom:1},{fromToMotion:lk,resetMotion:ck,CachedTextMeasurerPool:hk,SeriesNodePickMode:uk,StateMachine:dk,createDatumId:pk,normalizeAngle360:gk,normalizeAngle360Inclusive:fk,isBetweenAngles:mk,sectorBox:yk,toDegrees:vk,toRadians:bk,BBox:Ck,Group:wk,PointerEvents:Sk,Selection:xk,Sector:Ek,SectorBox:Ak,Text:Mk,Marker:Tk,getColorStops:Dk}=n.n1,Ik={inside:90,middle:0,outside:-90},Rk=[{textAlign:"left",textBaseline:"top"},{textAlign:"right",textBaseline:"top"},{textAlign:"right",textBaseline:"bottom"},{textAlign:"left",textBaseline:"bottom"}],kk=[{textAlign:"right",textBaseline:"bottom"},{textAlign:"left",textBaseline:"bottom"},{textAlign:"left",textBaseline:"top"},{textAlign:"right",textBaseline:"top"}],Pk=class extends n.n1.Series{constructor(e){super({moduleCtx:e,useLabelLayer:!0,pickModes:[uk.EXACT_SHAPE_MATCH,uk.NEAREST_NODE]}),this.centerX=0,this.centerY=0,this.radius=0,this.textAlign="center",this.verticalAlign="middle",this.properties=new JR,this.scale=new ie,this.scaleGroup=this.contentGroup.appendChild(new wk({name:"scaleGroup"})),this.itemGroup=this.contentGroup.appendChild(new wk({name:"itemGroup"})),this.itemNeedleGroup=this.contentGroup.appendChild(new wk({name:"itemNeedleGroup"})),this.itemTargetGroup=this.contentGroup.appendChild(new wk({name:"itemTargetGroup"})),this.itemTargetLabelGroup=this.contentGroup.appendChild(new wk({name:"itemTargetLabelGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new wk({name:"itemLabelGroup"})),this.highlightTargetGroup=this.highlightGroup.appendChild(new wk({name:"itemTargetLabelGroup"})),this.tickGroup=this.contentGroup.appendChild(new wk({name:"tickGroup"})),this.scaleSelection=xk.select(this.scaleGroup,()=>this.nodeFactory()),this.datumSelection=xk.select(this.itemGroup,()=>this.nodeFactory()),this.needleSelection=xk.select(this.itemNeedleGroup,OR),this.targetSelection=xk.select(this.itemTargetGroup,()=>this.markerFactory()),this.targetLabelSelection=xk.select(this.itemTargetLabelGroup,Mk),this.labelSelection=xk.select(this.itemLabelGroup,Mk),this.highlightTargetSelection=xk.select(this.highlightTargetGroup,()=>this.markerFactory()),this.tickSelection=xk.select(this.tickGroup,n.n1.TransformableText),this.datumUnion=new WS,this.animationState=new dk("empty",{empty:{update:{target:"ready",action:()=>this.animateEmptyUpdateReady()},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",resize:()=>this.animateReadyResize(),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:()=>this.animateWaitingUpdateReady()},reset:"empty",skip:"ready"},clearing:{update:{target:"empty"},reset:"empty",skip:"ready"}}),this.scaleGroup.pointerEvents=Sk.None,this.tickGroup.pointerEvents=Sk.None,this.itemNeedleGroup.pointerEvents=Sk.None,this.itemLabelGroup.pointerEvents=Sk.None}get hasData(){return null!=this.properties.value}nodeFactory(){return new Ek}markerFactory(){const e=new Tk;return e.size=1,e}processData(){this.nodeDataRefresh=!0,this.animationState.transition("updateData")}formatLabel(e){const{min:t,max:i}=this.properties.scale;return $S(e,{min:t,max:i})}layoutScale(){const{scale:e,properties:t}=this,{seriesRectWidth:i,seriesRectHeight:n}=this.nodeDataDependencies,{scale:r,outerRadius:o}=this.properties,{min:a,max:l,label:c,interval:h}=r,u=bk(t.startAngle-90),d=bk(t.endAngle-90),p=fk(d-u)>Math.PI,g=p||mk(1.5*Math.PI,u,d),f=p||mk(0*Math.PI,u,d),m=p||mk(.5*Math.PI,u,d),y=p||mk(1*Math.PI,u,d);let v,b;v=y&&!f?"right":!y&&f?"left":"center",b=g&&!m?"bottom":!g&&m?"top":"middle";const C=yk({startAngle:u,endAngle:d,innerRadius:0,outerRadius:.5}),w=2*-(C.x+C.width/2),S=2*-(C.y+C.height/2),x=Math.min(i/C.width,n/C.height);e.domain=[a,l],e.range=[u,d],e.arcLength=x/2;const{maxSpacing:E,minSpacing:A}=h,{arcLength:M}=e,T=E?Math.floor(M/E):1,D=A?Math.floor(M/A):1/0,I=Math.floor(4/Math.PI*Math.abs(e.range[0]-e.range[1])),R=Math.max(T,Math.min(D,I)),k=h.values??e.ticks({nice:!1,interval:h.step,minTickCount:T,maxTickCount:D,tickCount:R})?.ticks??[],P=k.reduce((e,t)=>Math.max(e,"number"==typeof t?(0,s.o3)(t):0),0),_=e.tickFormatter({domain:e.domain,ticks:k,fractionDigits:P,specifier:"string"==typeof c.format?c.format:void 0}),L=c.getFont(),N=k.map((t,i)=>{let n;c.formatter&&(n=YS(this.ctx,c.formatter,{value:t,index:i,domain:e.domain,boundSeries:void 0})),void 0===n&&(n=_(t));const{width:s,height:r}=hk.measureText(n,{font:L});return{index:i,value:t,text:n,width:s,height:r}}),O=N.reduce((e,t)=>Math.max(e,t.width),0),F=N.reduce((e,t)=>Math.max(e,t.height),0),G=c.enabled?Math.max(O,F)+c.spacing:0,B=Math.max(.5*x-G,0),V=o??B;return this.centerX=i/2+w*V,this.centerY=n/2+S*V,this.radius=V,this.textAlign=v,this.verticalAlign=b,N}createConicGradient(e,t){const{scale:i}=this,{domain:n,range:s}=i,[r,o]=s,{defaultColorRange:a}=this.properties,l=gk((r+o)/2+Math.PI),c=fk(o-r);return{type:"gradient",gradient:"conic",colorSpace:"oklch",colorStops:Dk(e,a,n,t).map(({color:e,stop:t})=>(t=Math.min(Math.max(t,0),1),{stop:t=((t=(r+c*t-l)/(2*Math.PI))%1+1)%1,color:e})),rotation:vk(l)+90}}getShapeFillBBox(){const{centerX:e,centerY:t,radius:i}=this;return new Ck(e-i,t-i,2*i,2*i)}getTargets(){const{properties:e}=this,t=e.defaultTarget;return Array.from(e.targets).map(e=>{const{text:i=t.text,value:n=t.value??0,shape:s=t.shape??"triangle",rotation:r=t.rotation??0,strokeWidth:o=t.strokeWidth??0,placement:a=t.placement??"middle",spacing:l=t.spacing??0,size:c=t.size??0,fill:h=t.fill??"black",fillOpacity:u=t.fillOpacity??1,stroke:d=t.stroke??"black",strokeOpacity:p=t.strokeOpacity??1,lineDash:g=t.lineDash??[0],lineDashOffset:f=t.lineDashOffset??0}=e,{enabled:m=t.label.enabled,color:y=t.label.color??"black",fontStyle:v=t.label.fontStyle??"normal",fontWeight:b=t.label.fontWeight??"normal",fontSize:C=t.label.fontSize,fontFamily:w=t.label.fontFamily,spacing:S=t.label.spacing??0}=e.label;return{text:i,value:n,shape:s,placement:a,spacing:l,size:c,rotation:r,fill:h,fillOpacity:u,stroke:d,strokeWidth:o,strokeOpacity:p,lineDash:g,lineDashOffset:f,label:{enabled:m,color:y,fontStyle:v,fontWeight:b,fontSize:C,fontFamily:w,spacing:S}}})}getTargetRadius(e){const{radius:t,properties:i}=this,{innerRadiusRatio:n,outerRadiusRatio:s}=i,{placement:r,spacing:o,size:a}=e,l=t*s,c=t*n;switch(r){case"inside":return Math.max(c-o-a/2,0);case"outside":return l+o+a/2;default:return(c+l)/2}}getTargetLabel(e){const{scale:t}=this,{value:i,size:n,placement:s,label:r}=e,{spacing:o,color:a,fontStyle:l,fontWeight:c,fontSize:h,fontFamily:u}=r,d=t.convert(i),p=gk(d)/(Math.PI/2)|0,g=n/2+o;let f,m,y,v;switch(s){case"outside":({textAlign:f,textBaseline:m}=Rk[p]),y=g*Math.cos(d),v=g*Math.sin(d);break;case"inside":({textAlign:f,textBaseline:m}=kk[p]),y=-g*Math.cos(d),v=-g*Math.sin(d);break;default:f="center",m="bottom",y=0,v=-g}return{offsetX:y,offsetY:v,fill:a,textAlign:f,textBaseline:m,fontStyle:l,fontWeight:c,fontSize:h,fontFamily:u,lineHeight:void 0}}createNodeData(){const e=this.layoutScale(),{id:t,scale:i,properties:n,radius:s,centerX:r,centerY:o}=this,{value:a,innerRadiusRatio:l,outerRadiusRatio:c,segmentation:h,cornerRadius:u,cornerMode:d,needle:p,bar:g,scale:f,label:m,secondaryLabel:y}=n,{outerRadius:v=s*c,innerRadius:b=s*l}=n,C=this.getTargets(),w=[],S=[],x=[],E=[],A=[],M="item"===d,T=i.convert(i.domain[0]),D=i.convert(a),I=Math.ceil(fk(D-T)*s);let R=h.enabled?h.interval.getSegments(i,I):void 0;const k=g.enabled?g.fill??this.createConicGradient(g.fills,g.fillMode):"rgba(0,0,0,0)",P=f.fill??(g.enabled&&0===f.fills.length?f.defaultFill:void 0)??this.createConicGradient(f.fills,f.fillMode);if(null==R&&M){const e={value:a,segmentStart:Math.min(...i.domain),segmentEnd:Math.max(...i.domain)},t=Math.min(u,(v-b)/2)/((b+v)/2);w.push({series:this,itemId:"value",datum:e,datumIndex:{type:0},type:0,centerX:r,centerY:o,outerRadius:v,innerRadius:b,startAngle:T-t,endAngle:D+t,clipStartAngle:void 0,clipEndAngle:void 0,startCornerRadius:u,endCornerRadius:u,fill:k}),A.push({series:this,itemId:"scale",datum:e,datumIndex:{type:0},type:0,centerX:r,centerY:o,outerRadius:v,innerRadius:b,startAngle:i.range[0]-t,endAngle:i.range[1]+t,clipStartAngle:void 0,clipEndAngle:void 0,startCornerRadius:u,endCornerRadius:u,fill:P})}else{R??(R=i.domain);for(let e=0;e<R.length-1;e++){const t=R[e],n=R[e+1],s={value:a,segmentStart:t,segmentEnd:n},l=0===e,c=e===R.length-2,h=i.convert(t),d=i.convert(n);w.push({series:this,itemId:`value-${e}`,datum:s,datumIndex:{type:0},type:0,centerX:r,centerY:o,outerRadius:v,innerRadius:b,startAngle:h,endAngle:d,clipStartAngle:T,clipEndAngle:D,startCornerRadius:M||l?u:0,endCornerRadius:M||c?u:0,fill:k}),A.push({series:this,itemId:`scale-${e}`,datum:s,datumIndex:{type:0},type:0,centerX:r,centerY:o,outerRadius:v,innerRadius:b,startAngle:h,endAngle:d,clipStartAngle:void 0,clipEndAngle:void 0,startCornerRadius:M||l?u:0,endCornerRadius:M||c?u:0,fill:P})}}if(!p.enabled&&m.enabled){const{text:e,color:t,fontSize:i,minimumFontSize:n,fontStyle:s,fontWeight:l,fontFamily:c,lineHeight:h,formatter:u=e=>this.formatLabel(e.value)}=m;E.push({label:"primary",centerX:r,centerY:o,text:e,value:a,fill:t,fontSize:i,minimumFontSize:n,fontStyle:s,fontWeight:l,fontFamily:c,lineHeight:h,formatter:u})}if(!p.enabled&&y.enabled){const{text:e,color:t,fontSize:i,minimumFontSize:n,fontStyle:s,fontWeight:l,fontFamily:c,lineHeight:h,formatter:u}=y;E.push({label:"secondary",centerX:r,centerY:o,text:e,value:a,fill:t,fontSize:i,minimumFontSize:n,fontStyle:s,fontWeight:l,fontFamily:c,lineHeight:h,formatter:u})}if(p.enabled){let e=null!=p.radiusRatio?s*p.radiusRatio:b;e=Math.max(e-p.spacing,0);const t=i.convert(a);x.push({centerX:r,centerY:o,radius:e,angle:t,series:this})}for(let e=0;e<C.length;e+=1){const t=C[e],{value:n,text:s,size:a,shape:l,fill:c,fillOpacity:h,stroke:u,strokeWidth:d,strokeOpacity:p,lineDash:g,lineDashOffset:f}=t;if(n<Math.min(...i.domain)||n>Math.max(...i.domain))continue;const m=this.getTargetRadius(t),y=i.convert(n),v=bk(t.rotation+Ik[t.placement]);S.push({series:this,itemId:`target-${e}`,midPoint:{x:m*Math.cos(y)+r,y:m*Math.sin(y)+o},datum:{value:n},datumIndex:{type:1,index:e},type:1,value:n,text:s,centerX:r,centerY:o,shape:l,radius:m,angle:y,rotation:v,size:a,fill:c,fillOpacity:h,stroke:u,strokeOpacity:p,strokeWidth:d,lineDash:g,lineDashOffset:f,label:this.getTargetLabel(t)})}return{itemId:t,nodeData:w,needleData:x,targetData:S,labelData:E,scaleData:A,tickData:e}}updateSelections(e){(this.nodeDataRefresh||e)&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}highlightDatum(e){if(null!=e&&e.series===this&&1===e.type)return e}update({seriesRect:e}){const{datumSelection:t,labelSelection:i,needleSelection:n,targetSelection:s,targetLabelSelection:r,scaleSelection:o,highlightTargetSelection:a,tickSelection:l}=this,c=this.checkResize(e);this.updateSelections(c),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();const h=this.contextNodeData?.nodeData??[],u=this.contextNodeData?.labelData??[],d=this.contextNodeData?.needleData??[],p=this.contextNodeData?.targetData??[],g=this.contextNodeData?.scaleData??[],f=this.contextNodeData?.tickData??[],m=this.highlightDatum(this.ctx.highlightManager.getActiveHighlight());this.scaleSelection=this.updateScaleSelection({scaleData:g,scaleSelection:o}),this.updateScaleNodes({scaleSelection:o}),this.needleSelection=this.updateNeedleSelection({needleData:d,needleSelection:n}),this.updateNeedleNodes({needleSelection:n}),this.targetSelection=this.updateTargetSelection({targetData:p,targetSelection:s}),this.updateTargetNodes({targetSelection:s,isHighlight:!1}),this.targetLabelSelection=this.updateTargetLabelSelection({targetData:p,targetLabelSelection:r}),this.updateTargetLabelNodes({targetLabelSelection:r}),this.datumSelection=this.updateDatumSelection({nodeData:h,datumSelection:t}),this.updateDatumNodes({datumSelection:t}),this.labelSelection=this.updateLabelSelection({labelData:u,labelSelection:i}),this.updateLabelNodes({labelSelection:i}),this.highlightTargetSelection=this.updateTargetSelection({targetData:null!=m?[m]:[],targetSelection:a}),this.updateTargetNodes({targetSelection:a,isHighlight:!0}),this.tickSelection=this.updateTickSelection({tickData:f,tickSelection:l}),this.updateTickNodes({tickSelection:l}),c&&this.animationState.transition("resize"),this.animationState.transition("update")}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>pk(e.nodeData.length,t.itemId))}updateDatumNodes(e){const{datumSelection:t}=e,{ctx:i,properties:s}=this,{bar:r,segmentation:o}=s,a=o.spacing??0,{fillOpacity:l,stroke:c,strokeOpacity:h,lineDash:u,lineDashOffset:d}=r,p=this.getStrokeWidth(r.strokeWidth),g=i.animationManager.isSkipped(),f=this.getShapeFillBBox();t.each((e,t)=>{const{centerX:i,centerY:s,innerRadius:r,outerRadius:o,startCornerRadius:m,endCornerRadius:y,fill:v}=t;e.centerX=i,e.centerY=s,e.innerRadius=r,e.outerRadius=o,e.pointerEvents=this.properties.bar.enabled?n.n1.PointerEvents.All:n.n1.PointerEvents.None,e.fill=v,e.fillBBox=f,e.fillOpacity=l,e.stroke=c,e.strokeOpacity=h,e.strokeWidth=p,e.lineDash=u,e.lineDashOffset=d,e.startOuterCornerRadius=m,e.startInnerCornerRadius=m,e.endOuterCornerRadius=y,e.endInnerCornerRadius=y,e.radialEdgeInset=(a+e.strokeWidth)/2,e.concentricEdgeInset=e.strokeWidth/2,(g||null==e.previousDatum)&&e.setProperties(rk(0,t))}),this.datumUnion.update(t,this.itemGroup,n.n1.Sector,(e,t,i)=>{e.clipSector??(e.clipSector=new Ak(NaN,NaN,NaN,NaN)),e.centerX=t.centerX,e.centerY=t.centerY,e.outerRadius=e.clipSector.outerRadius=t.outerRadius,e.innerRadius=e.clipSector.innerRadius=t.innerRadius,e.startAngle=e.clipSector.startAngle=t.startAngle,e.startInnerCornerRadius=t.startInnerCornerRadius,e.startOuterCornerRadius=t.startOuterCornerRadius,e.endAngle=i.endAngle,e.clipSector.endAngle=i.clipSector?.endAngle??i.endAngle,e.endInnerCornerRadius=i.endInnerCornerRadius,e.endOuterCornerRadius=i.endOuterCornerRadius,e.pointerEvents=n.n1.PointerEvents.None})}updateScaleSelection(e){return e.scaleSelection.update(e.scaleData,void 0,t=>pk(e.scaleData.length,t.itemId))}updateScaleNodes(e){const{scaleSelection:t}=e,{scale:i,segmentation:n}=this.properties,s=n.spacing??0,{fillOpacity:r,stroke:o,strokeOpacity:a,strokeWidth:l,lineDash:c,lineDashOffset:h}=i,u=this.getShapeFillBBox();t.each((e,t)=>{const{centerX:i,centerY:n,innerRadius:d,outerRadius:p,startCornerRadius:g,endCornerRadius:f,fill:m}=t;e.centerX=i,e.centerY=n,e.innerRadius=d,e.outerRadius=p,e.fill=m,e.fillBBox=u,e.fillOpacity=r,e.stroke=o,e.strokeOpacity=a,e.strokeWidth=l,e.lineDash=c,e.lineDashOffset=h,e.startOuterCornerRadius=g,e.startInnerCornerRadius=g,e.endOuterCornerRadius=f,e.endInnerCornerRadius=f,e.radialEdgeInset=(s+e.strokeWidth)/2,e.concentricEdgeInset=e.strokeWidth/2,e.setProperties(rk(0,t))})}updateNeedleSelection(e){return e.needleSelection.update(e.needleData,void 0,()=>pk([]))}updateNeedleNodes(e){const{needleSelection:t}=e,{fill:i,fillOpacity:n,stroke:s,strokeOpacity:r,strokeWidth:o,lineDash:a,lineDashOffset:l}=this.properties.needle,c=this.ctx.animationManager.isSkipped();t.each((e,t)=>{const{centerX:h,centerY:u,radius:d}=t,p=2*d;e.d=OR.defaultPathData,e.fill=i,e.fillOpacity=n,e.stroke=s,e.strokeOpacity=r,e.strokeWidth=o/p,e.lineDash=a.map(e=>e/p),e.lineDashOffset=l/p,e.translationX=h,e.translationY=u,e.scalingX=p,e.scalingY=p,c&&e.setProperties(ok(0,t))})}updateTargetSelection(e){return e.targetSelection.update(e.targetData,void 0,e=>e.itemId)}updateTargetNodes(e){const{targetSelection:t,isHighlight:i}=e,n=i?this.properties.highlightStyle.item:void 0;t.each((e,t)=>{const{centerX:i,centerY:s,angle:r,radius:o,shape:a,size:l,rotation:c,fill:h,fillOpacity:u,stroke:d,strokeOpacity:p,strokeWidth:g,lineDash:f,lineDashOffset:m}=t;e.shape="line"===a?qS:a,e.size=l,e.fill=n?.fill??h,e.fillOpacity=n?.fillOpacity??u,e.stroke=n?.stroke??d,e.strokeOpacity=n?.strokeOpacity??p,e.strokeWidth=n?.strokeWidth??g,e.lineDash=n?.lineDash??f,e.lineDashOffset=n?.lineDashOffset??m,e.translationX=i+o*Math.cos(r),e.translationY=s+o*Math.sin(r),e.rotation=r+c})}updateTargetLabelSelection(e){return e.targetLabelSelection.update(e.targetData,void 0,e=>e.itemId)}updateTargetLabelNodes(e){const{targetLabelSelection:t}=e;t.each((e,t)=>{const{centerX:i,centerY:n,radius:s,angle:r,text:o}=t,{offsetX:a,offsetY:l,fill:c,fontStyle:h,fontWeight:u,fontSize:d,fontFamily:p,textAlign:g,textBaseline:f}=t.label;null!=o?(e.visible=!0,e.x=i+s*Math.cos(r)+a,e.y=n+s*Math.sin(r)+l,e.text=o,e.fill=c,e.fontStyle=h,e.fontWeight=u,e.fontSize=d,e.fontFamily=p,e.textAlign=g,e.textBaseline=f):e.visible=!1})}updateLabelSelection(e){return e.labelSelection.update(e.labelData,void 0,e=>e.label)}updateLabelNodes(e){const{labelSelection:t}=e,i=this.ctx.animationManager.isSkipped();t.each((e,t)=>{e.fill=t.fill,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.fontFamily=t.fontFamily}),(i||this.labelsHaveExplicitText())&&this.formatLabelText()}updateTickSelection(e){return e.tickSelection.update(e.tickData,void 0,e=>e.index)}updateTickNodes(e){const{scale:t,radius:i,centerX:n,centerY:s,properties:r}=this,{enabled:o,color:a,fontFamily:l,fontSize:c,fontStyle:h,fontWeight:u,spacing:d}=r.scale.label,p=bk(r.scale.label.rotation??0);e.tickSelection.each((e,r)=>{if(!o)return void(e.visible=!1);e.visible=!0,e.text=r.text,e.fill=a,e.fontFamily=l,e.fontSize=c,e.fontStyle=h,e.fontWeight=u,e.textAlign="center",e.textBaseline="middle";const g=t.convert(r.value),{width:f,height:m}=r,y=Math.abs(i*Math.cos(g)),v=Math.abs(i*Math.sin(g)),b=Math.min(Math.max(Math.abs(i/Math.tan(g)),y-f/2),y+f/2),C=Math.min(Math.max(Math.abs(i*Math.tan(g)),v-m/2),v+m/2),w=Math.hypot(b,C),S=n+(w+d)*Math.cos(g),x=s+(w+d)*Math.sin(g);e.x=S,e.y=x,e.rotationCenterX=S,e.rotationCenterY=x,e.rotation=p})}labelsHaveExplicitText(){for(const{datum:e}of this.labelSelection)if(null==e.text)return!1;return!0}formatLabelText(e){const{labelSelection:t,radius:i,textAlign:n,verticalAlign:s}=this,{spacing:r,innerRadiusRatio:o}=this.properties;!function(e,t,i,n,s,r){const{padding:o,textAlign:a,verticalAlign:l}=n;let c,h;if(i.each((e,t)=>{"primary"===t.label?c=t:"secondary"===t.label&&(h=t)}),null==c)return;const u=KS(e.id,t,c,r?.label);if(null==u)return;const d=null!=h?KS(e.id,t,h,r?.secondaryLabel):void 0,p={padding:o},g="center"===a?2:1,f="middle"===l?2:1,m=e=>({width:Math.sqrt(Math.max(s**2-(e/f)**2,0))*g,height:Math.min(e,f*s),meta:null});let y,v,b;if(null!=h&&null!=d){const e=im(u,c,d,h,p,m);y=e?.label,v=e?.secondaryLabel,b=e?.height??0}else{const e=nm(u,c,p,m);y=e?.[0],v=void 0,b=e?.[0].height??0}const C=b*ak[l];i.each((e,t)=>{let i;if("primary"===t.label?i=y:"secondary"===t.label&&(i=v),null==i)return void(e.visible=!1);e.visible=!0,e.text=i.text,e.fontSize=i.fontSize,e.lineHeight=i.lineHeight,e.textAlign=a,e.textBaseline="middle";const n="primary"===t.label?i.height/2:b-i.height/2;e.y=t.centerY+n-C,e.x=t.centerX})}(this,this.ctx,t,{padding:r,textAlign:n,verticalAlign:s},i*o,e)}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),ck([this.datumSelection],rk),ck([this.needleSelection],ok),this.formatLabelText()}resetAnimation(e){"initial"===e?this.animationState.transition("reset"):"ready"===e&&this.animationState.transition("skip")}animateLabelText(e={}){const{animationManager:t}=this.ctx;let i,n,s,r;if(this.labelSelection.each((t,o)=>{t.opacity=1,"primary"===o.label?(i=t.previousDatum?.value??e.from??o.value,n=o.value):"secondary"===o.label&&(s=t.previousDatum?.value??e.from??o.value,r=o.value)}),this.labelsHaveExplicitText());else if(null==n||null==r)this.formatLabelText();else if(i===n&&s===r)this.formatLabelText({label:n,secondaryLabel:r});else{const o=`${this.id}_labels`;t.animate({id:o,groupId:"label",from:{label:i,secondaryLabel:s},to:{label:n,secondaryLabel:r},phase:e.phase??"update",onUpdate:e=>this.formatLabelText(e)})}}animateEmptyUpdateReady(){const{animationManager:e}=this.ctx,{node:t,needle:i}=sk(!0,this.scale.range[0]);lk(this.id,"node",e,[this.datumSelection],t,(e,t)=>t.itemId),lk(this.id,"needle",e,[this.needleSelection],i,()=>"needle"),lk(this.id,"label",e,[this.labelSelection],jS,(e,t)=>t.label),this.animateLabelText({from:this.properties.scale.min,phase:"initial"})}animateWaitingUpdateReady(){const{animationManager:e}=this.ctx,{node:t,needle:i}=sk(!1,this.scale.range[0]);lk(this.id,"node",e,[this.datumSelection],t,(e,t)=>t.itemId),lk(this.id,"needle",e,[this.needleSelection],i,()=>"needle"),this.animateLabelText()}animateReadyResize(){this.resetAllAnimation()}getSeriesDomain(){return[NaN,NaN]}getSeriesRange(e,t){return[NaN,NaN]}getLegendData(){return[]}getTooltipContent(e){const{id:t,properties:i}=this,{tooltip:n}=i;let s,r;if(0===e.type?(s=i.value,r=i.label.text):({value:s,text:r}=i.targets[e.index]),null!=s)return this.formatTooltipWithContext(n,{data:[{label:r,fallbackLabel:"Value",value:this.formatLabel(s)}]},{seriesId:t,title:void 0,datum:void 0,value:s})}pickNodeClosestDatum(e){return XS(this,e)}pickFocus(e){return ZS(this,e)}getCaptionText(){const{value:e}=this.properties,t=[];return t.push(this.formatLabel(e)),this.labelSelection.each((e,i)=>{const n=KS(this.id,this.ctx,i);null!=n&&t.push(n)}),t.join(". ")}getCategoryValue(e){}datumIndexForCategoryValue(e){}};Pk.className="RadialGaugeSeries",Pk.type="radial-gauge";var{FONT_SIZE_RATIO:_k}=n.n1,Lk={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["gauge"],identifier:"radial-gauge",moduleFactory:e=>new Pk(e),tooltipDefaults:{range:10},themeTemplate:{minWidth:200,minHeight:200,tooltip:{enabled:!1},series:{outerRadiusRatio:1,innerRadiusRatio:.8,startAngle:270,endAngle:450,defaultColorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$interpolate:[{$palette:"secondDivergingColors"},5]},n.n1.SAFE_RANGE2_OPERATION]},scale:{defaultFill:{$path:["./1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["./2",n.n1.SAFE_STROKE_FILL_OPERATION,{$palette:"hierarchyColors"}]},label:{fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},spacing:12}},bar:{strokeWidth:0},segmentation:{enabled:!1,interval:{},spacing:2},defaultTarget:{fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},size:10,shape:"triangle",placement:"outside",spacing:5,label:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},spacing:5}},needle:{enabled:!1,fill:{$ref:"foregroundColor"},spacing:10},label:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:56,minimumFontSize:18/56,fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}},secondaryLabel:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[_k.LARGE]},minimumFontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"}}}}},Nk={type:"series",name:"radial-gauge",chartType:"gauge",enterprise:!0,options:n.n1.radialGaugeSeriesOptionsDef,create:e=>new Pk(e)};function Ok(e){e.nodes.sort((e,t)=>Math.round(100*(e.datum.y-t.datum.y))/100||-(e.datum.size-t.datum.size))}function Fk(e,t,i,n,s,r,o,a){const l=(i-e)/(n-t),c=(o-s)/(a-r),h=(l*c*(r-t)+e*c-s*l)/(c-l);return e<i?h>e&&h<Math.min(i,o):h<e&&h>Math.max(i,o)}function Gk(e,t){let i=!1;const n=e.nodes.filter(e=>1===t(e).length);let s=!0;for(let e=0;s&&e<n.length;e+=1){s=!1;for(let e=0;e<n.length-1;e+=1){const{datum:r}=n[e],o=t(n[e])[0].node.datum,{datum:a}=n[e+1],l=t(n[e+1])[0].node.datum;if(!(Fk(r.x,r.y,o.x,o.y,a.x,a.y,l.x,l.y)||Fk(r.x,r.y+r.height/2,o.x,o.y+o.height/2,a.x,a.y+a.height/2,l.x,l.y+l.height/2)||Fk(r.x,r.y+r.height,o.x,o.y+o.height,a.x,a.y+a.height,l.x,l.y+l.height)))continue;const c=n[e];n[e]=n[e+1],n[e+1]=c;const h=r.y;r.y=a.y+a.height-r.height,a.y=h,i=!0,s=!0}}return i}function Bk(e){let t=!1;return Ok(e),t=Gk(e,e=>e.linksBefore)||t,t=Gk(e,e=>e.linksAfter)||t,t}function Vk(e,t,i,n){return e.nodes.forEach(({datum:e,linksBefore:t,linksAfter:s})=>{const r=1===n?s:t,o=function(e){if(0===e.length)return;let t=0,i=0;for(const{node:{datum:n}}of e)t+=n.y*n.size,i+=n.size;return t/i}(1===n?t:s);if(null!=o){const t=0!==r.length?i:1;e.y=e.y+(o-e.y)*t}}),function(e,t){const{nodes:i}=e,{seriesRectHeight:n,nodeSpacing:s}=t;Ok(e);let r=0,o=0;for(const{datum:e}of i){const t=Math.max(o-e.y,0);e.y+=t,r+=t,o=e.y+e.height+s}if(o-s<n)return r>0;let a=n;for(let e=i.length-1;e>=0;e-=1){const{datum:t}=i[e],n=t.y+t.height,o=Math.min(a-n,0);t.y+=o,r+=o,a=t.y-s}return!0}(e,t)}function Hk(e,t,i){let n=!1;for(const s of e)n=Vk(s,t,i,1)||n;return n}function Uk(e,t,i){let n=!1;for(let s=e.length-1;s>=0;s-=1)n=Vk(e[s],t,i,-1)||n;return n}function zk(e){let t=!1;for(let i=e.length-1;i>=0;i-=1)t=Bk(e[i])||t;return t}var{BBox:Wk,Path:jk,SceneChangeDetection:$k,splitBezier:Kk}=n.n1;function Yk(e,t,i,n,s,r,o,a,l,c){let h,u;if(s!==i&&l!==o){const e=-(n-t)/(s-i),c=-(a-r)/(l-o);h=(o-i+e*t-c*r)/(e-c),u=e*(h-t)+i}else if(s===i&&l!==o)h=t,u=-(a-r)/(l-o)*(h-a)+l;else{if(s===i||l!==o)throw new Error("Offsetting flat bezier curve");h=a,u=-(n-t)/(s-i)*(h-t)+i}const d=Math.hypot(i-u,t-h),p=(d+c)/d,g=Math.hypot(l-u,a-h),f=(g+c)/g,m=h+(n-h)*p,y=u+(s-u)*p,v=h+(r-h)*f,b=u+(o-u)*f,C=h+(a-h)*f,w=u+(l-u)*f;e.cubicCurveTo(m,y,v,b,C,w)}var qk=class extends jk{constructor(){super(...arguments),this.x1=0,this.x2=0,this.y1=0,this.y2=0,this.height=0,this.inset=0}computeBBox(){const e=Math.min(this.x1,this.x2),t=Math.max(this.x1,this.x2)-e,i=Math.min(this.y1,this.y2),n=Math.max(this.y1,this.y2)-i+this.height;return new Wk(e,i,t,n)}updatePath(){const{path:e,inset:t}=this;e.clear();const i=this.x1+t,n=this.x2-t,s=this.y1+t,r=this.y2+t,o=this.height-2*t;if(o<0||i>n)return;const a=i,l=s+o/2,c=(i+n)/2,h=s+o/2,u=(i+n)/2,d=r+o/2,p=n,g=r+o/2;if(e.moveTo(a,l-o/2),Math.abs(this.y2-this.y1)<1||this.x2-this.x1<this.height*Math.SQRT2)e.cubicCurveTo(c,h-o/2,u,d-o/2,p,g-o/2),e.lineTo(p,g+o/2),e.cubicCurveTo(u,d+o/2,c,h+o/2,a,l+o/2);else{const[t,i]=Kk(a,l,c,h,u,d,p,g,.5),n=(r>s?1:-1)*o/2;Yk(e,t[0].x,t[0].y,t[1].x,t[1].y,t[2].x,t[2].y,t[3].x,t[3].y,n),Yk(e,i[0].x,i[0].y,i[1].x,i[1].y,i[2].x,i[2].y,i[3].x,i[3].y,-n),e.lineTo(p,g+o/2),Yk(e,i[3].x,i[3].y,i[2].x,i[2].y,i[1].x,i[1].y,i[0].x,i[0].y,n),Yk(e,t[3].x,t[3].y,t[2].x,t[2].y,t[1].x,t[1].y,t[0].x,t[0].y,-n)}e.closePath()}};a([$k()],qk.prototype,"x1",2),a([$k()],qk.prototype,"x2",2),a([$k()],qk.prototype,"y1",2),a([$k()],qk.prototype,"y2",2),a([$k()],qk.prototype,"height",2),a([$k()],qk.prototype,"inset",2);var{BaseProperties:Xk,FillGradientDefaults:Zk,FillPatternDefaults:Qk,FillImageDefaults:Jk,SeriesTooltip:eP,SeriesProperties:tP,Property:iP,Label:nP}=n.n1,sP=class extends nP{constructor(){super(...arguments),this.spacing=1}};a([iP],sP.prototype,"spacing",2);var rP=class extends Xk{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0}};a([iP],rP.prototype,"fill",2),a([iP],rP.prototype,"fillOpacity",2),a([iP],rP.prototype,"stroke",2),a([iP],rP.prototype,"strokeOpacity",2),a([iP],rP.prototype,"strokeWidth",2),a([iP],rP.prototype,"lineDash",2),a([iP],rP.prototype,"lineDashOffset",2),a([iP],rP.prototype,"itemStyler",2);var oP=class extends Xk{constructor(){super(...arguments),this.spacing=1,this.width=1,this.alignment="justify",this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0}};a([iP],oP.prototype,"spacing",2),a([iP],oP.prototype,"width",2),a([iP],oP.prototype,"alignment",2),a([iP],oP.prototype,"fill",2),a([iP],oP.prototype,"fillOpacity",2),a([iP],oP.prototype,"stroke",2),a([iP],oP.prototype,"strokeOpacity",2),a([iP],oP.prototype,"strokeWidth",2),a([iP],oP.prototype,"lineDash",2),a([iP],oP.prototype,"lineDashOffset",2),a([iP],oP.prototype,"itemStyler",2);var aP=class extends tP{constructor(){super(...arguments),this.nodes=void 0,this.idKey="",this.idName=void 0,this.labelKey=void 0,this.labelName=void 0,this.sizeKey=void 0,this.sizeName=void 0,this.fillGradientDefaults=new Zk,this.fillPatternDefaults=new Qk,this.fillImageDefaults=new Jk,this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=[],this.strokes=[],this.label=new sP,this.link=new rP,this.node=new oP,this.tooltip=new eP}};a([iP],aP.prototype,"nodes",2),a([iP],aP.prototype,"fromKey",2),a([iP],aP.prototype,"toKey",2),a([iP],aP.prototype,"idKey",2),a([iP],aP.prototype,"idName",2),a([iP],aP.prototype,"labelKey",2),a([iP],aP.prototype,"labelName",2),a([iP],aP.prototype,"sizeKey",2),a([iP],aP.prototype,"sizeName",2),a([iP],aP.prototype,"fillGradientDefaults",2),a([iP],aP.prototype,"fillPatternDefaults",2),a([iP],aP.prototype,"fillImageDefaults",2),a([iP],aP.prototype,"defaultColorRange",2),a([iP],aP.prototype,"defaultPatternFills",2),a([iP],aP.prototype,"fills",2),a([iP],aP.prototype,"strokes",2),a([iP],aP.prototype,"label",2),a([iP],aP.prototype,"link",2),a([iP],aP.prototype,"node",2),a([iP],aP.prototype,"tooltip",2);var{Transformable:lP,applyShapeStyle:cP,SeriesNodePickMode:hP,CachedTextMeasurerPool:uP,TextWrapper:dP,TextUtils:pP,createDatumId:gP,getShapeStyle:fP,Rect:mP,BBox:yP}=n.n1,vP=class extends SC{constructor(e){super({moduleCtx:e,pickModes:[hP.NEAREST_NODE,hP.EXACT_SHAPE_MATCH]}),this.properties=new aP}isLabelEnabled(){return(null!=this.properties.labelKey||null==this.nodes)&&this.properties.label.enabled}linkFactory(){return new qk}nodeFactory(){return new mP}createNodeData(){const{id:e,_nodeDataDependencies:{seriesRectWidth:t,seriesRectHeight:i}={seriesRectWidth:0,seriesRectHeight:0}}=this,{fromKey:n,toKey:r,sizeKey:o,label:{spacing:a},node:{spacing:l,width:c,alignment:h}}=this.properties,{nodeGraph:u,links:d,maxPathLength:p}=this.getNodeGraph(e=>({...e,x:NaN,y:NaN,width:c,height:NaN}),e=>({...e,x1:NaN,x2:NaN,y1:NaN,y2:NaN,height:NaN}),{includeCircularReferences:!1}),g=u,f=this.isLabelEnabled()?(t-c)*(1-p/(p+1)):0,m=(t-c-2*f)/(p-1),y=[];for(let e=0;e<p;e+=1){const t=f+e*m;y.push({index:e,size:0,nodes:[],x:t})}g.forEach(e=>{const{datum:t,linksBefore:i,linksAfter:s,maxPathLengthBefore:a,maxPathLengthAfter:l}=e,c=Math.max(i.reduce((e,{link:t})=>e+t.size,0),s.reduce((e,{link:t})=>e+t.size,0));if(0===i.length&&0===s.length||0===c)return void(e.columnIndex=-1);let u;switch(h){case"left":u=y[a];break;case"right":u=y[p-1-l];break;case"center":if(0!==i.length)u=y[a];else if(0!==s.length){const e=s.reduce((e,t)=>Math.min(e,t.node.maxPathLengthBefore),p)-1;u=y[e]}else u=y[0];break;case"justify":u=0===s.length?y[p-1]:y[a]}t.x=u.x,t.size=c;const d=this.getLabelText(this.properties.label,{datum:t.datum,value:t.label,fromKey:n,toKey:r,sizeKey:o,size:c});t.label=String(d),u.nodes.push(e),u.size+=c,e.columnIndex=u.index}),g.forEach(e=>{let t=1/0,i=0;e.linksAfter.forEach(e=>{const n=e.node,{columnIndex:s}=n;s<t?(t=s,i=n.datum.size):s===t&&(i=Math.max(i,n.datum.size))}),e.closestColumnIndex=t,e.maxSizeOfClosestNodesAfter=i});const v=y.reduce((e,{size:t,nodes:n})=>{const s=(1-(n.length-1)*(l/i))/t;return Math.min(e,s)},1/0);for(let e=y.length-1;e>=0;e-=1)y[e].nodes.sort((e,t)=>e.closestColumnIndex-t.closestColumnIndex||e.maxSizeOfClosestNodesAfter-t.maxSizeOfClosestNodesAfter||e.datum.size-t.datum.size);!function(e,t){e.forEach(e=>{!function({nodes:e,size:t},{seriesRectHeight:i,nodeSpacing:n,sizeScale:s}){let r=(i-(i*t*s+n*(e.length-1)))/2;e.forEach(({datum:e})=>{const t=i*e.size*s;e.y=r,e.height=t,r+=t+n})}(e,t)});let i=!1;for(let n=0;n<6;n+=1){const n=Hk(e,t,1);i=Uk(e,t,.5);const s=zk(e);if(!n&&!i&&!s)break}i&&(Hk(e,t,1),zk(e))}(y,{seriesRectHeight:i,nodeSpacing:l,sizeScale:v});let b=!1;if(g.forEach(({datum:e,linksBefore:t,linksAfter:n})=>{b||(b=e.height<0);const s=e.y+e.height,r=t=>t.sort((t,i)=>{const n=t.node.datum,r=i.node.datum,o=n.y+n.height,a=r.y+r.height;return Math.atan2(n.y-e.y,Math.abs(n.x-e.x))-Math.atan2(r.y-e.y,Math.abs(r.x-e.x))+(Math.atan2(o-s,Math.abs(n.x-e.x))-Math.atan2(a-s,Math.abs(r.x-e.x)))});let o=e.y;r(t).forEach(({link:e})=>{e.y2=o,o+=e.size*i*v});let a=e.y;r(n).forEach(({link:e})=>{e.y1=a,a+=e.size*i*v})}),b)return void s.Vy.warnOnce("There was insufficient space to display the Sankey Series. Reduce the node spacing, or provide a larger container.");const C=[],w=[],{fontSize:S}=this.properties.label,x=this.properties.label.getFont();return y.forEach((e,i)=>{const n=0===i,s=i===y.length-1;let r=-1/0;e.nodes.sort((e,t)=>e.datum.y-t.datum.y),e.nodes.forEach(({datum:e})=>{if(e.midPoint={x:e.x+e.width/2,y:e.y+e.height/2},C.push(e),null==e.label)return;const i=n?e.x-a:e.x+e.width+a,o=e.y+e.height/2;let l;if(!n&&!s){const i=o-pP.getLineHeight(S),n=o+pP.getLineHeight(S);let s=t;g.forEach(({datum:t})=>{t.x>e.x&&Math.max(t.y,i)<=Math.min(t.y+t.height,n)&&(s=Math.min(s,t.x-a))});const r=s-e.x-2*a;l=dP.wrapText(e.label,{maxWidth:r,maxHeight:e.height,font:this.properties.label,textWrap:"never",overflow:"hide"})}if(null==l||""===l){const t=n||s?a:2*a;l=dP.wrapText(e.label,{maxWidth:m-t,maxHeight:e.height,font:this.properties.label,textWrap:"never"})}if(""===l)return;const{height:c}=uP.measureText(l,{font:x,textAlign:"left",textBaseline:"middle"}),h=o+c/2;o-c/2>=r&&(w.push({x:i,y:o,leading:n,text:l}),r=h)})}),d.forEach(e=>{const{fromNode:t,toNode:n,size:s}=e;e.height=i*s*v,e.x1=t.x+c,e.x2=n.x,e.midPoint={x:(e.x1+e.x2)/2,y:(e.y1+e.y2)/2+e.height/2},C.push(e)}),{itemId:e,nodeData:C,labelData:w}}updateLabelSelection(e){const t=this.isLabelEnabled()?e.labelData:[];return e.labelSelection.update(t)}updateLabelNodes(e){const{labelSelection:t}=e,{color:i,fontStyle:n,fontWeight:s,fontSize:r,fontFamily:o}=this.properties.label;t.each((e,{x:t,y:a,leading:l,text:c})=>{e.visible=!0,e.x=t,e.y=a,e.text=c,e.fill=i,e.fontStyle=n,e.fontWeight=s,e.fontSize=r,e.fontFamily=o,e.textAlign=l?"right":"left",e.textBaseline="middle"})}updateNodeSelection(e){return e.datumSelection.update(e.nodeData,void 0,e=>gP([e.type,e.id]))}getBaseNodeStyle(e){const{properties:t}=this,{fill:i,fillOpacity:n,stroke:s,strokeOpacity:r,lineDash:o,lineDashOffset:a}=t.node,l=e?t.highlightStyle.item:void 0;return fP({fill:l?.fill??i,fillOpacity:l?.fillOpacity??n,stroke:l?.stroke??s,strokeOpacity:l?.strokeOpacity??r,strokeWidth:l?.strokeWidth??this.getStrokeWidth(t.node.strokeWidth),lineDash:l?.lineDash??o,lineDashOffset:l?.lineDashOffset??a},t.fillGradientDefaults,t.fillPatternDefaults,t.fillImageDefaults)}getNodeStyleOverrides(e,t,i,n,s,r,o){const{id:a,properties:l}=this,{fills:c,strokes:h,defaultColorRange:u,defaultPatternFills:d}=l,{itemStyler:p}=l.node,g=r.fill??c[i%c.length],f=r.stroke??h[i%h.length],m=u[i%u.length].map(e=>({color:e})),y=d[i%d.length];let v;if(o||(v??(v={}),v.fill=g,v.stroke=f),null!=p){const i=this.cachedDatumCallback(gP(e,"node",o?"highlight":"node"),()=>{const{fillOpacity:e=1,strokeOpacity:i=1,strokeWidth:l=0,lineDash:c=[],lineDashOffset:h=0}=r;return this.callWithContext(p,{seriesId:a,datum:t,highlighted:o,label:s,size:n,fill:g,fillOpacity:e,stroke:f,strokeOpacity:i,strokeWidth:l,lineDash:c,lineDashOffset:h})});v??(v={}),Object.assign(v,i)}return fP(v,{...this.properties.fillGradientDefaults.toJson(),colorStops:m},{...this.properties.fillPatternDefaults.toJson(),fill:y,stroke:y},this.properties.fillImageDefaults)}updateNodeNodes(e){const{datumSelection:t,isHighlight:i}=e,n=this.getBaseNodeStyle(i),s=this.getShapeFillBBox();t.each((e,t)=>{const{datumIndex:r,size:o,label:a}=t,l=this.getNodeStyleOverrides(String(r.index),t.datum,r.index,o,a,n,i);e.x=t.x,e.y=t.y,e.width=Math.max(t.width,0),e.height=Math.max(t.height,0),cP(e,n,l,s)})}getShapeFillBBox(){const e=this._nodeDataDependencies?.seriesRectWidth??0,t=this._nodeDataDependencies?.seriesRectHeight??0,i=new yP(0,0,e,t);return{series:i,axis:i}}updateLinkSelection(e){return e.datumSelection.update(e.nodeData,void 0,e=>gP([e.type,e.index,e.fromNode.id,e.toNode.id]))}getBaseLinkStyle(e){const{properties:t}=this,{fill:i,fillOpacity:n,stroke:s,strokeOpacity:r,lineDash:o,lineDashOffset:a}=t.link,l=e?t.highlightStyle.item:void 0;return fP({fill:l?.fill??i,fillOpacity:l?.fillOpacity??n,stroke:l?.stroke??s,strokeOpacity:l?.strokeOpacity??r,strokeWidth:l?.strokeWidth??this.getStrokeWidth(t.link.strokeWidth),lineDash:l?.lineDash??o,lineDashOffset:l?.lineDashOffset??a},t.fillGradientDefaults,t.fillPatternDefaults,t.fillImageDefaults)}getLinkStyleOverrides(e,t,i,n,s){const{id:r,properties:o}=this,{fills:a,strokes:l,defaultColorRange:c,defaultPatternFills:h}=o,{itemStyler:u}=o.link,d=n.fill??a[i%a.length],p=n.stroke??l[i%l.length],g=c[i%c.length].map(e=>({color:e})),f=h[i%h.length];let m;if(s||(m??(m={}),m.fill=d,m.stroke=p),null!=u){const i=this.cachedDatumCallback(gP(e,"link",s?"highlight":"node"),()=>{const{fillOpacity:e=1,strokeOpacity:i=1,strokeWidth:o=0,lineDash:a=[],lineDashOffset:l=0}=n;return this.callWithContext(u,{seriesId:r,datum:t,highlighted:s,fill:d,fillOpacity:e,stroke:p,strokeOpacity:i,strokeWidth:o,lineDash:a,lineDashOffset:l})});m??(m={}),Object.assign(m,i)}return fP(m,{...this.properties.fillGradientDefaults.toJson(),colorStops:g},{...this.properties.fillPatternDefaults.toJson(),fill:f,stroke:f},this.properties.fillImageDefaults)}updateLinkNodes(e){const{datumSelection:t,isHighlight:i}=e,n=this.getBaseLinkStyle(i),s=this.getShapeFillBBox();t.each((e,t)=>{const{datumIndex:r}=t,o=t.fromNode.datumIndex,a=this.getLinkStyleOverrides(String(r.index),t.datum,o.index,n,i);e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.height=t.height,cP(e,n,a,s),e.inset=e.strokeWidth/2})}getTooltipContent(e){const{id:t,linksProcessedData:i,nodesProcessedData:n,properties:s}=this,{fromKey:r,toKey:o,sizeKey:a,sizeName:l,tooltip:c}=s,h=this.contextNodeData?.nodeData.find(t=>t.datumIndex.type===e.type&&t.datumIndex.index===e.index);if(null==h)return;const u=0===h.type?h.fromNode.index:h.index,d=0===h.type?`${h.fromNode.label} - ${h.toNode.label}`:h.label,p=0===e.type?i?.dataSources.get(this.id)?.[e.index]:n?.dataSources.get(this.id)?.[e.index],g=h.size;let f;if(0===h.type){const t=h.fromNode.datumIndex,i=this.getBaseLinkStyle(!1);Object.assign(i,this.getLinkStyleOverrides(String(e.index),p,t.index,i,!1)),f=i}else{const t=h.label,i=this.getBaseNodeStyle(!1);Object.assign(i,this.getNodeStyleOverrides(String(e.index),p,e.index,g,t,i,!1)),f=i}return this.formatTooltipWithContext(c,{title:d,symbol:this.legendItemSymbol(h.type,u,f),data:null!=a?[{label:l,fallbackLabel:a,value:String(g)}]:[]},{seriesId:t,datum:p,title:d,fromKey:r,toKey:o,sizeKey:a,sizeName:l,size:g,...f})}computeFocusBounds(e){if(e instanceof mP){const{x:t,y:i,width:n,height:s}=e,r=new yP(t,i,n,s);return lP.toCanvas(this.contentGroup,r)}return e}};vP.className="SankeySeries",vP.type="sankey";var{commonSeriesOptionsDefs:bP,sankeySeriesThemeableOptionsDef:CP}=n.n1,wP={...CP,...bP,type:(0,s.mw)((0,s.dY)("sankey")),fromKey:(0,s.mw)(s.Yj),toKey:(0,s.mw)(s.Yj),sizeKey:s.Yj,sizeName:s.Yj};wP.fillGradientDefaults=(0,s._L)(s.wi),wP.fillPatternDefaults=(0,s._L)(s.GY),wP.fillImageDefaults=(0,s._L)(s.Zd),wP.defaultColorRange=(0,s._L)((0,s.jk)((0,s.jk)(s.yW))),wP.defaultPatternFills=(0,s._L)((0,s.jk)(s.yW));var SP={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["flow-proportion"],solo:!0,identifier:"sankey",moduleFactory:e=>new vP(e),tooltipDefaults:{range:"exact"},themeTemplate:{seriesArea:{padding:{top:10,bottom:10}},series:{fills:{$palette:"fills"},strokes:{$palette:"strokes"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:n.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:n.n1.FILL_IMAGE_DEFAULTS,defaultColorRange:{$palette:"gradients"},defaultPatternFills:n.n1.SAFE_FILLS_OPERATION,highlightStyle:{series:{dimOpacity:.2}},label:{fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:10},node:{spacing:20,width:10,strokeWidth:0},link:{fillOpacity:.5,strokeWidth:0}},legend:{enabled:!1,toggleSeries:!1}}},xP={type:"series",name:"sankey",chartType:"flow-proportion",enterprise:!0,options:wP,create:e=>new vP(e)},{HierarchySeriesProperties:EP,HighlightStyle:AP,SeriesTooltip:MP,Property:TP}=n.n1,DP=class extends AP{constructor(){super(...arguments),this.label=new cm,this.secondaryLabel=new cm}};a([TP],DP.prototype,"fill",2),a([TP],DP.prototype,"fillOpacity",2),a([TP],DP.prototype,"stroke",2),a([TP],DP.prototype,"strokeWidth",2),a([TP],DP.prototype,"strokeOpacity",2),a([TP],DP.prototype,"label",2),a([TP],DP.prototype,"secondaryLabel",2);var IP=class extends EP{constructor(){super(...arguments),this.fillOpacity=1,this.strokeWidth=0,this.strokeOpacity=1,this.cornerRadius=0,this.highlightStyle=new DP,this.label=new cm,this.secondaryLabel=new hm,this.tooltip=new MP}};a([TP],IP.prototype,"sizeName",2),a([TP],IP.prototype,"labelKey",2),a([TP],IP.prototype,"secondaryLabelKey",2),a([TP],IP.prototype,"fillOpacity",2),a([TP],IP.prototype,"strokeWidth",2),a([TP],IP.prototype,"strokeOpacity",2),a([TP],IP.prototype,"cornerRadius",2),a([TP],IP.prototype,"sectorSpacing",2),a([TP],IP.prototype,"padding",2),a([TP],IP.prototype,"itemStyler",2),a([TP],IP.prototype,"highlightStyle",2),a([TP],IP.prototype,"label",2),a([TP],IP.prototype,"secondaryLabel",2),a([TP],IP.prototype,"tooltip",2);var{fromToMotion:RP,normalizeAngle360:kP,createDatumId:PP,Sector:_P,Group:LP,ScalableGroup:NP,Selection:OP,TransformableText:FP,BBox:GP,applyShapeStyle:BP,getShapeStyle:VP}=n.n1,HP=class extends n.n1.HierarchyNode{constructor(){super(...arguments),this.label=void 0,this.secondaryLabel=void 0,this.contentHeight=0,this.bbox=void 0,this.startAngle=0,this.endAngle=0}};function UP(e,t=0,i=2*Math.PI/e.sumSize){for(const n of e.children){const e=t+n.sumSize*i;n.startAngle=t,n.endAngle=e,UP(n,t,i),t=e}}var zP=class extends n.n1.HierarchySeries{constructor(){super(...arguments),this.NodeClass=HP,this.properties=new IP,this.scalingGroup=this.contentGroup.appendChild(new NP),this.sectorGroup=this.scalingGroup.appendChild(new LP),this.sectorLabelGroup=this.scalingGroup.appendChild(new LP),this.highlightSectorGroup=this.scalingGroup.appendChild(new LP),this.datumSelection=OP.select(this.sectorGroup,_P),this.labelSelection=OP.select(this.sectorLabelGroup,LP),this.highlightSelection=OP.select(this.highlightSectorGroup,_P)}processData(){super.processData(),UP(this.rootNode)}updateSelections(){const e=this.ctx.highlightManager?.getActiveHighlight();if(this.highlightSelection.update(null!=e?[e]:[],void 0,e=>this.getDatumId(e)),!this.nodeDataRefresh)return;this.nodeDataRefresh=!1;const{chart:t}=this;if(null==t)return;if(null==t.seriesRect)return;const i=Array.from(this.rootNode);this.datumSelection.update(i,void 0,e=>this.getDatumId(e)),this.labelSelection.update(i,e=>{e.append([new FP({tag:0}),new FP({tag:1})])},e=>this.getDatumId(e))}getItemBaseStyle(e){const{properties:t}=this,i=e?t.highlightStyle:void 0;return VP({fill:i?.fill,fillOpacity:i?.fillOpacity??t.fillOpacity,stroke:i?.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(t.strokeWidth),strokeOpacity:i?.strokeOpacity??t.strokeOpacity},t.fillGradientDefaults,t.fillPatternDefaults,t.fillImageDefaults)}getItemStyleOverrides(e,t,i,n,s,r){const{id:o,properties:a,colorScale:l}=this,{fills:c,strokes:h,itemStyler:u}=a,d=e[0],p=s.fill??c[d%c.length],g=s.stroke??h[d%h.length],f={};if(r||(f.fill=null!=n?l.convert(n):p,f.stroke=g),null!=u){const n=this.cachedDatumCallback(PP(e.join(":"),r?"highlight":"node"),()=>this.callWithContext(u,{seriesId:o,datum:t,depth:i,highlighted:r,fill:p,stroke:g,...s}));Object.assign(f,n)}return VP(f,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}updateNodes(){const{chart:e,data:t,maxDepth:i}=this;if(null==e||null==t)return;const{width:s,height:r}=e.seriesRect,{sectorSpacing:o=0,padding:a=0,cornerRadius:l,childrenKey:c,colorKey:h,colorName:u,labelKey:d,secondaryLabelKey:p,sizeKey:g,sizeName:f}=this.properties;this.contentGroup.translationX=s/2,this.contentGroup.translationY=r/2;const m=.5*o,y=Math.min(s,r)/2,v=y/(i+1),b=-Math.PI/2,C={series:new GP(-y,-y,2*y,2*y),axis:new GP(-y,-y,2*y,2*y)};this.rootNode?.walk(e=>{const{startAngle:t,endAngle:i}=e;if(null!=e.depth){const n=(t+i)/2+b,s=(e.depth+.5)*v;e.midPoint.x=Math.cos(n)*s,e.midPoint.y=Math.sin(n)*s}}),this.rootNode?.walk(e=>{const{datum:t,depth:i,startAngle:n,endAngle:s,parent:r,sumSize:o}=e;let l,y;if(e.label=void 0,e.secondaryLabel=void 0,e.contentHeight=0,null!=t&&null!=i&&null!=d){const e=t[d];l=this.getLabelText(this.properties.label,{depth:i,datum:t,childrenKey:c,colorKey:h,colorName:u,labelKey:d,secondaryLabelKey:p,sizeKey:g,sizeName:f,value:e})}if(""===l&&(l=void 0),null!=t&&null!=i&&null!=p){const e=t[p];y=this.getLabelText(this.properties.secondaryLabel,{depth:i,datum:t,childrenKey:c,colorKey:h,colorName:u,labelKey:d,secondaryLabelKey:p,sizeKey:g,sizeName:f,value:e})}if(""===y&&(y=void 0),null==i)return;const C=i*v+m,w=(i+1)*v-m,S=C>m?m/C:m,x=w>m?m/w:m,E=s+S-(n+S),A=s+x-(n+x),M=rm(l,this.properties.label,y,this.properties.secondaryLabel,{padding:a},e=>{if(0===i&&r?.sumSize===o)return{width:2*Math.sqrt(w**2-(.5*e)**2),height:e,meta:0};const t=e,n=2*Math.sqrt(w**2-(C+t)**2),s=E<Math.PI?2*C*Math.tan(.5*E):1/0,a=Math.min(n,s),l=Math.PI/4;let c,h;return 0===i?(c=e,h=Math.sqrt(w**2-(c/2)**2)-e/(2*Math.tan(.5*A))):kP(E)<l?(c=2*C*Math.tan(.5*E),h=Math.sqrt(w**2-(c/2)**2)-C):(h=0,c=0),a>=h?{width:a,height:t,meta:1}:{width:h,height:c,meta:2}});if(null==M)return;const{width:T,height:D,meta:I,label:R,secondaryLabel:k}=M,P=b+(n+s)/2,_=(Math.sin(P)>=0?3:12)&(Math.cos(P)>=0?6:9);let L;switch(I){case 0:L=0;break;case 1:{const e=w-.58*(v-D),t=Math.sqrt((w-a)**2-(T/2)**2);L=Math.min(e,t);break}case 2:L=0===i?.5*(D/(2*Math.tan(.5*E))+.5*T+(Math.sqrt(w**2-(.5*D)**2)-.5*T)):.5*(C+w)}if(null!=R){const{fontStyle:t="normal",fontFamily:i,fontWeight:n="normal",color:s="black"}=this.properties.label;e.label={...R,fontStyle:t,fontFamily:i,fontWeight:n,color:s,labelPlacement:I,circleQuarter:_,radius:L,theta:P}}if(null!=k){const{fontStyle:t="normal",fontFamily:i,fontWeight:n="normal",color:s="black"}=this.properties.secondaryLabel;e.secondaryLabel={...k,fontStyle:t,fontFamily:i,fontWeight:n,color:s,labelPlacement:I,circleQuarter:_,radius:L,theta:P}}e.contentHeight=M.height});const w=(e,t,i,s)=>{const{datum:r,datumIndex:o,depth:a,colorValue:c,startAngle:h,endAngle:u}=e;if(null==a)return void(t.visible=!1);t.visible=!0;const d=this.getItemStyleOverrides(o,r,a,c,i,s),p=d.fill??i.fill,g=d.strokeWidth??i.strokeWidth,f=n.n1.isGradientFill(p)&&"item"!==p.bounds?C:void 0;BP(t,i,d,f),t.centerX=0,t.centerY=0,t.innerRadius=a*v,t.outerRadius=(a+1)*v,t.startAngle=h+b,t.endAngle=u+b,t.inset=m+.5*g,t.cornerRadius=l},S=this.getItemBaseStyle(!1);this.datumSelection.each((e,t)=>{w(t,e,S,!1)});const x=this.getItemBaseStyle(!0);this.highlightSelection.each((e,t)=>{w(t,e,x,!0)});const E=(e,t,i,n)=>{const{depth:s,contentHeight:r}=e,o=0===i,a=o?e.label:e.secondaryLabel;if(null==s||null==a)return void(t.visible=!1);const{labelPlacement:l,circleQuarter:c,radius:h,theta:u}=a;let d;switch(n&&(d=(o?this.properties.highlightStyle.label:this.properties.highlightStyle.secondaryLabel).color),t.text=a.text,t.fontSize=a.fontSize,t.lineHeight=a.lineHeight,t.fontStyle=a.fontStyle,t.fontFamily=a.fontFamily,t.fontWeight=a.fontWeight,t.fill=d??a.color,l){case 0:t.textAlign="center",t.textBaseline="top",t.translationX=0,t.translationY=(o?0:r-a.height)-.5*r,t.rotation=0;break;case 1:{const e=!!(3&c),i=o===!e?h:h-(r-a.height);t.textAlign="center",t.textBaseline=e?"bottom":"top",t.translationX=Math.cos(u)*i,t.translationY=Math.sin(u)*i,t.rotation=e?u-.5*Math.PI:u+.5*Math.PI;break}case 2:{const e=!!(6&c),i=o===!e?.5*(r-a.height):.5*(a.height-r);t.textAlign="center",t.textBaseline="middle",t.translationX=Math.cos(u)*h+Math.cos(u+Math.PI/2)*i,t.translationY=Math.sin(u)*h+Math.sin(u+Math.PI/2)*i,t.rotation=e?u:u+Math.PI;break}}t.visible=!0},A=this.ctx.highlightManager?.getActiveHighlight();this.labelSelection.selectByClass(FP).forEach(e=>{const t=e.closestDatum();E(t,e,e.tag,t===A)})}getTooltipContent(e){const{id:t,properties:i}=this,{labelKey:s,secondaryLabelKey:r,childrenKey:o,sizeKey:a,sizeName:l,colorKey:c,colorName:h,tooltip:u}=i,d=e.reduce((e,t)=>e?.children[t],this.rootNode);if(null==d)return;const{datum:p,depth:g}=d;if(null==p||null==g)return;const f=[],m=null!=a?p[a]:void 0;null!=m&&f.push({label:l,fallbackLabel:a,value:m});const y=null!=c?p[c]:void 0;null!=y&&f.push({label:h,fallbackLabel:c,value:y});const v=this.getItemBaseStyle(!1);Object.assign(v,this.getItemStyleOverrides(e,p,g,y,v,!1));const b=v.fill,C=VP({shape:"square",fill:b,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0},i.fillGradientDefaults,i.fillPatternDefaults,i.fillImageDefaults);return n.n1.isGradientFill(C.fill)&&(C.fill={...C.fill,gradient:"linear",rotation:0,reverse:!1}),this.formatTooltipWithContext(u,{title:null!=s?p[s]:void 0,symbol:{marker:C},data:f},{seriesId:t,datum:p,title:void 0,depth:g,labelKey:s,secondaryLabelKey:r,childrenKey:o,sizeKey:a,sizeName:l,colorKey:c,colorName:h,...v})}createNodeData(){}pickNodeClosestDatum(e){return this.pickNodeNearestDistantObject(e,this.datumSelection.selectByClass(_P))}animateEmptyUpdateReady(){RP(this.id,"nodes",this.ctx.animationManager,[this.scalingGroup],{toFn:()=>({scalingX:1,scalingY:1}),fromFn:()=>({scalingX:0,scalingY:0})})}computeFocusBounds(e){return e}};zP.className="SunburstSeries",zP.type="sunburst";var{commonSeriesOptionsDefs:WP,sunburstSeriesThemeableOptionsDef:jP,without:$P}=n.n1,KP={...jP,...$P(WP,["highlightStyle"]),type:(0,s.mw)((0,s.dY)("sunburst")),labelKey:s.Yj,secondaryLabelKey:s.Yj,childrenKey:s.Yj,sizeKey:s.Yj,colorKey:s.Yj,sizeName:s.Yj,colorName:s.Yj},{FONT_SIZE_RATIO:YP}=n.n1,qP={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["hierarchy"],identifier:"sunburst",moduleFactory:e=>new zP(e),tooltipDefaults:{range:"exact"},solo:!0,themeTemplate:{series:{fills:{$palette:"fills"},strokes:{$palette:"strokes"},colorRange:{$palette:"divergingColors"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"series",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:n.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:n.n1.FILL_IMAGE_DEFAULTS,label:{fontFamily:{$ref:"fontFamily"},fontSize:{$rem:[YP.LARGE]},minimumFontSize:{$round:[{$mul:[{$ref:"fontSize"},.75]}]},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"},overflowStrategy:"ellipsis",wrapping:"never",spacing:2},secondaryLabel:{fontFamily:{$ref:"fontFamily"},fontSize:{$rem:[YP.SMALLEST]},minimumFontSize:{$round:[{$mul:[{$ref:"fontSize"},7/12]}]},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"},overflowStrategy:"ellipsis",wrapping:"never"},sectorSpacing:2,padding:3,highlightStyle:{label:{color:{$ref:"backgroundColor"}},secondaryLabel:{color:{$ref:"backgroundColor"}},fill:"rgba(255,255,255, 0.33)",stroke:"rgba(0, 0, 0, 0.4)",strokeWidth:2}},gradientLegend:{enabled:!0}}},XP={type:"series",name:"sunburst",chartType:"hierarchy",enterprise:!0,options:KP,create:e=>new zP(e)},{BaseProperties:ZP,HierarchySeriesProperties:QP,HighlightStyle:JP,SeriesTooltip:e_,Property:t_,Label:i_}=n.n1,n_=class extends i_{constructor(){super(...arguments),this.spacing=0}};a([t_],n_.prototype,"spacing",2);var s_=class extends ZP{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.cornerRadius=0,this.textAlign="center",this.gap=0,this.padding=0,this.interactive=!0,this.label=new n_}};a([t_],s_.prototype,"fill",2),a([t_],s_.prototype,"fillOpacity",2),a([t_],s_.prototype,"stroke",2),a([t_],s_.prototype,"strokeWidth",2),a([t_],s_.prototype,"strokeOpacity",2),a([t_],s_.prototype,"cornerRadius",2),a([t_],s_.prototype,"textAlign",2),a([t_],s_.prototype,"gap",2),a([t_],s_.prototype,"padding",2),a([t_],s_.prototype,"interactive",2),a([t_],s_.prototype,"label",2);var r_=class extends ZP{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.cornerRadius=0,this.textAlign="center",this.verticalAlign="middle",this.gap=0,this.padding=0,this.label=new cm,this.secondaryLabel=new hm}};a([t_],r_.prototype,"fill",2),a([t_],r_.prototype,"fillOpacity",2),a([t_],r_.prototype,"stroke",2),a([t_],r_.prototype,"strokeWidth",2),a([t_],r_.prototype,"strokeOpacity",2),a([t_],r_.prototype,"cornerRadius",2),a([t_],r_.prototype,"textAlign",2),a([t_],r_.prototype,"verticalAlign",2),a([t_],r_.prototype,"gap",2),a([t_],r_.prototype,"padding",2),a([t_],r_.prototype,"label",2),a([t_],r_.prototype,"secondaryLabel",2);var o_=class extends ZP{constructor(){super(...arguments),this.label=new cm}};a([t_],o_.prototype,"fill",2),a([t_],o_.prototype,"fillOpacity",2),a([t_],o_.prototype,"stroke",2),a([t_],o_.prototype,"strokeWidth",2),a([t_],o_.prototype,"strokeOpacity",2),a([t_],o_.prototype,"label",2);var a_=class extends ZP{constructor(){super(...arguments),this.label=new cm,this.secondaryLabel=new hm}};a([t_],a_.prototype,"fill",2),a([t_],a_.prototype,"fillOpacity",2),a([t_],a_.prototype,"stroke",2),a([t_],a_.prototype,"strokeWidth",2),a([t_],a_.prototype,"strokeOpacity",2),a([t_],a_.prototype,"label",2),a([t_],a_.prototype,"secondaryLabel",2);var l_=class extends JP{constructor(){super(...arguments),this.group=new o_,this.tile=new a_}};a([t_],l_.prototype,"group",2),a([t_],l_.prototype,"tile",2);var c_=class extends QP{constructor(){super(...arguments),this.highlightStyle=new l_,this.tooltip=new e_,this.group=new s_,this.tile=new r_,this.undocumentedGroupFills=[],this.undocumentedGroupStrokes=[]}};a([t_],c_.prototype,"sizeName",2),a([t_],c_.prototype,"labelKey",2),a([t_],c_.prototype,"secondaryLabelKey",2),a([t_],c_.prototype,"itemStyler",2),a([t_],c_.prototype,"highlightStyle",2),a([t_],c_.prototype,"tooltip",2),a([t_],c_.prototype,"group",2),a([t_],c_.prototype,"tile",2),a([t_],c_.prototype,"undocumentedGroupFills",2),a([t_],c_.prototype,"undocumentedGroupStrokes",2);var{TextUtils:h_,TextWrapper:u_,createDatumId:d_,Rect:p_,Group:g_,BBox:f_,Selection:m_,Text:y_,Transformable:v_,applyShapeStyle:b_,getShapeStyle:C_}=n.n1,w_=class extends n.n1.HierarchyNode{constructor(){super(...arguments),this.labelValue=void 0,this.secondaryLabelValue=void 0,this.label=void 0,this.secondaryLabel=void 0,this.bbox=void 0,this.padding=void 0}},S_=new y_;function x_(e){return e.children.length>0?e.sumSize-e.sizeValue:e.sizeValue}var E_={left:0,center:.5,right:1},A_={top:0,middle:.5,bottom:1},M_=(n.n1.Group,class extends n.n1.HierarchySeries{constructor(){super(...arguments),this.NodeClass=w_,this.properties=new c_,this.rectGroup=this.contentGroup.appendChild(new g_),this.datumSelection=m_.select(this.rectGroup,p_),this.labelSelection=m_.select(this.labelGroup,g_),this.highlightSelection=m_.select(this.rectGroup,p_)}groupTitleHeight(e,t){const{labelValue:i}=e,{label:n}=this.properties.group;if(null!=i&&!(n.fontSize>t.width/3||n.fontSize>t.height/3)){const{height:e}=function(e,t){const{fontStyle:i,fontWeight:n,fontSize:s,fontFamily:r}=t;S_.setProperties({text:e,fontStyle:i,fontWeight:n,fontSize:s,fontFamily:r,textAlign:"left",textBaseline:"top"});const{width:o,height:a}=S_.getBBox();return{width:o,height:a}}(i,n);return Math.max(e,n.fontSize)}}getNodePadding(e,t){if(null==e.parent)return{top:0,right:0,bottom:0,left:0};if(0===e.children.length){const{padding:e}=this.properties.tile;return{top:e,right:e,bottom:e,left:e}}const{label:{spacing:i},padding:n}=this.properties.group,s=this.groupTitleHeight(e,t);return{top:n+(null!=s?s+i:0),right:n,bottom:n,left:n}}sortChildren({children:e}){const t=Array.from(e,(e,t)=>t).filter(t=>x_(e[t])>0).sort((t,i)=>x_(e[i])-x_(e[t]));return{sortedChildrenIndices:t,childAt:i=>{const n=t[i];return e[n]}}}squarify(e,t){const{datum:i,children:n}=e;if(t.width<=0||t.height<=0)return e.bbox=void 0,e.padding=void 0,e.midPoint.x=NaN,void(e.midPoint.y=NaN);const s=null!=i?this.getNodePadding(e,t):{top:0,right:0,bottom:0,left:0};null==e.parent?(e.bbox=void 0,e.padding=void 0,e.midPoint.x=NaN,e.midPoint.y=NaN):(e.bbox=t,e.padding=s,e.midPoint.x=t.x+t.width/2,e.midPoint.y=t.y);const{sortedChildrenIndices:r,childAt:o}=this.sortChildren(e),a=r.every(e=>0===n[e].children.length),l=t.width-s.left-s.right,c=t.height-s.top-s.bottom;if(l<=0||c<=0)return;const h=r.length;let u=0,d=0,p=1/0,g=r.reduce((e,t)=>e+x_(n[t]),0);const f=new f_(t.x+s.left,t.y+s.top,l,c),m=f.clone();let y=0;for(;y<h;){const e=x_(o(y)),t=x_(o(d)),i=m.width<m.height;u+=e;const n=i?m.height:m.width,s=i?m.width:m.height,r=s*t/u;let l=n*u/g;const c=Math.max(r,l)/Math.min(r,l),h=Math.abs(1-c);if(h<p){p=h,y++;continue}u-=e,l=n*u/g;let v=i?m.x:m.y;for(let e=d;e<y;e++){const t=o(e),n=x_(t),r=i?v:m.x,c=i?m.y:v,h=s*n/u,d=new f_(r,c,i?h:l,i?l:h);this.applyGap(f,d,a),this.squarify(t,d),g-=n,v+=h}i?(m.y+=l,m.height-=l):(m.x+=l,m.width-=l),d=y,u=0,p=1/0}const v=m.width<m.height;let b=v?m.x:m.y;for(let e=d;e<h;e++){const t=o(e),i=v?b:m.x,n=v?m.y:b,s=x_(t)/g,r=m.width*(v?s:1),l=m.height*(v?1:s),c=new f_(i,n,r,l);this.applyGap(f,c,a),this.squarify(t,c),b+=v?r:l}}applyGap(e,t,i){const n=i?.5*this.properties.tile.gap:.5*this.properties.group.gap,r=e=>({left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height}),o=r(e),a=r(t);["top","right","bottom","left"].forEach(e=>{(0,s.YX)(o[e],a[e])||t.shrink(n,e)})}createNodeData(){}getGroupBaseStyle(e){const{properties:t}=this,{group:i}=t,n=e?t.highlightStyle.group:void 0;return C_({fill:n?.fill??i.fill,fillOpacity:n?.fillOpacity??i.fillOpacity,stroke:n?.stroke??i.stroke,strokeWidth:n?.strokeWidth??i.strokeWidth,strokeOpacity:n?.strokeOpacity??i.strokeOpacity},t.fillGradientDefaults,t.fillPatternDefaults,t.fillImageDefaults)}getGroupStyleOverrides(e,t,i,n,s){const{id:r,properties:o}=this,{undocumentedGroupFills:a,undocumentedGroupStrokes:l,itemStyler:c}=o,h=n.fill??a[Math.min(i??0,a.length)],u=n.stroke??l[Math.min(i??0,l.length)],d={};if(s||(d.fill=h,d.stroke=u),null!=c){const o=this.cachedDatumCallback(d_(e.join(":"),s?"highlight":"node"),()=>this.callWithContext(c,{seriesId:r,datum:t,depth:i,highlighted:s,fill:h,stroke:u,...n}));Object.assign(d,o)}return C_(d,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}getTileBaseStyle(e){const{properties:t}=this,{tile:i}=t,n=e?t.highlightStyle.tile:void 0;return C_({fill:n?.fill??i.fill,fillOpacity:n?.fillOpacity??i.fillOpacity,stroke:n?.stroke??i.stroke,strokeWidth:n?.strokeWidth??i.strokeWidth,strokeOpacity:n?.strokeOpacity??i.strokeOpacity},t.fillGradientDefaults,t.fillPatternDefaults,t.fillImageDefaults)}getTileStyleOverrides(e,t,i,n,s,r){const{id:o,properties:a,colorScale:l}=this,{fills:c,strokes:h,itemStyler:u}=a,d=e[0],p=s.fill??c[d%c.length],g=s.stroke??h[d%h.length],f={};if(r||(f.fill=null!=n?l.convert(n):p,f.stroke=g),null!=u){const n=this.cachedDatumCallback(d_(e.join(":"),r?"highlight":"node"),()=>this.callWithContext(u,{seriesId:o,datum:t,depth:i,highlighted:r,fill:p,stroke:g,...s}));Object.assign(f,n)}return C_(f,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}updateSelections(){let e=this.ctx.highlightManager?.getActiveHighlight();if(null==e||this.properties.group.interactive||0===e.children.length||(e=void 0),this.highlightSelection.update(null!=e?[e]:[],void 0,e=>this.getDatumId(e)),!this.nodeDataRefresh)return;this.nodeDataRefresh=!1;const{seriesRect:t}=this.chart??{};if(!t)return;const i=Array.from(this.rootNode);this.datumSelection.update(i,void 0,e=>this.getDatumId(e)),this.labelSelection.update(i,e=>{e.append([new y_({tag:0}),new y_({tag:1})])},e=>this.getDatumId(e))}updateNodes(){const{rootNode:e,data:t}=this,{childrenKey:i,colorKey:n,colorName:s,labelKey:r,secondaryLabelKey:o,sizeKey:a,sizeName:l,highlightStyle:c,tile:h,group:u}=this.properties,{seriesRect:d}=this.chart??{};if(!d||!t)return;this.rootNode?.walk(e=>{const{datum:t,depth:c,children:d}=e,p=0===d.length,g=p?h.label:u.label;let f,m;if(null!=t&&null!=c&&null!=r){const e=t[r];f=this.getLabelText(g,{depth:c,datum:t,childrenKey:i,colorKey:n,colorName:s,labelKey:r,secondaryLabelKey:o,sizeKey:a,sizeName:l,value:e})}if(""===f&&(f=void 0),p&&null!=t&&null!=c&&null!=o){const e=t[o];m=this.getLabelText(h.secondaryLabel,{depth:c,datum:t,childrenKey:i,colorKey:n,colorName:s,labelKey:r,secondaryLabelKey:o,sizeKey:a,sizeName:l,value:e})}""===m&&(m=void 0),e.labelValue=f,e.secondaryLabelValue=m});const{width:p,height:g}=d;this.squarify(e,new f_(0,0,p,g)),this.rootNode?.walk(e=>{const{bbox:t,children:i,labelValue:n,secondaryLabelValue:s}=e;if(e.label=void 0,e.secondaryLabel=void 0,null!=t)if(0===i.length){const i={width:t.width,height:t.height,meta:null},r=rm(n,this.properties.tile.label,s,this.properties.tile.secondaryLabel,{padding:h.padding},()=>i);if(null==r)return;const{height:o,label:a,secondaryLabel:l}=r,{textAlign:c,verticalAlign:u,padding:d}=h,p=E_[c]??.5,g=t.x+d+(t.width-2*d)*p,f=A_[u]??.5,m=t.y+d+.5*o+(t.height-2*d-o)*f;if(null!=a){const{fontStyle:t="normal",fontFamily:i,fontWeight:n="normal",color:s="black"}=this.properties.tile.label;e.label={text:a.text,fontSize:a.fontSize,lineHeight:a.lineHeight,fontStyle:t,fontFamily:i,fontWeight:n,color:s,textAlign:c,verticalAlign:"middle",x:g,y:m-.5*(o-a.height)}}if(null!=l){const{fontStyle:t="normal",fontFamily:i,fontWeight:n="normal",color:s="black"}=this.properties.tile.secondaryLabel;e.secondaryLabel={text:l.text,fontSize:l.fontSize,lineHeight:l.fontSize,fontStyle:t,fontFamily:i,fontWeight:n,color:s,textAlign:c,verticalAlign:"middle",x:g,y:m+.5*(o-l.height)}}}else{if(null==n)return;{const{padding:i,textAlign:s}=u,r=this.groupTitleHeight(e,t);if(null==r)return;const o=t.width-2*i,a=u_.wrapText(n,{maxWidth:t.width-2*i,font:u.label,textWrap:"never"}),l=E_[s]??.5,{fontStyle:c="normal",fontFamily:h,fontWeight:d="normal",color:p="black"}=this.properties.group.label;e.label={text:a,fontSize:u.label.fontSize,lineHeight:h_.getLineHeight(u.label.fontSize),fontStyle:c,fontFamily:h,fontWeight:d,color:p,textAlign:s,verticalAlign:"middle",x:t.x+i+o*l,y:t.y+i+.5*r}}}});const f={series:new f_(0,0,p,g),axis:new f_(0,0,p,g)},m=(e,t,i,n,s)=>{const{bbox:r}=e;if(null==r)return void(t.visible=!1);const{datum:o,depth:a=-1,datumIndex:l,colorValue:c}=e,d=0===e.children.length,p=d?n:i,g=d?this.getTileStyleOverrides(l,o,a,c,p,s):this.getGroupStyleOverrides(l,o,a,p,s);t.crisp=!0,b_(t,p,g,f),t.cornerRadius=d?h.cornerRadius:u.cornerRadius,t.zIndex=[0,a,s?1:0];const m=e.parent?.children.every(e=>0===e.children.length),y=null!=e.parent?e.parent.bbox:void 0,v=null!=e.parent?e.parent.padding:void 0;!0===m&&null!=y&&null!=v?(t.clipBBox=r,t.x=y.x+v.left,t.y=y.y+v.top,t.width=y.width-(v.left+v.right),t.height=y.height-(v.top+v.bottom)):(t.clipBBox=void 0,t.x=r.x,t.y=r.y,t.width=r.width,t.height=r.height),t.visible=!0},y=this.getGroupBaseStyle(!1),v=this.getTileBaseStyle(!1);this.datumSelection.each((e,t)=>m(t,e,y,v,!1));const b=this.getGroupBaseStyle(!0),C=this.getTileBaseStyle(!0);this.highlightSelection.each((e,t)=>{m(t,e,b,C,!0)});const w=this.ctx.highlightManager?.getActiveHighlight();this.labelSelection.selectByClass(y_).forEach(e=>{const t=e.closestDatum();((e,t,i,n)=>{const s=0===e.children.length,r=0===i?e.label:e.secondaryLabel;if(null==r)return void(t.visible=!1);let o;if(n){const{tile:e,group:t}=c;o=e.secondaryLabel.color,s?0===i&&(o=e.label.color):o=t.label.color}t.text=r.text,t.fontSize=r.fontSize,t.lineHeight=r.lineHeight,t.fontStyle=r.fontStyle,t.fontFamily=r.fontFamily,t.fontWeight=r.fontWeight,t.fill=o??r.color,t.textAlign=r.textAlign,t.textBaseline=r.verticalAlign,t.x=r.x,t.y=r.y,t.visible=!0,t.zIndex=1})(t,e,e.tag,t===w)})}pickNodesExactShape(e){const t=super.pickNodesExactShape(e);return t.sort((e,t)=>t.datumIndex.length-e.datumIndex.length),t}pickNodeClosestDatum(e){const t=this.pickNodesExactShape(e);return 0!==t.length?{datum:t[0],distance:0}:this.pickNodeNearestDistantObject(e,this.datumSelection.nodes())}getTooltipContent(e){const{id:t,properties:i}=this,{labelKey:s,secondaryLabelKey:r,childrenKey:o,sizeKey:a,sizeName:l,colorKey:c,colorName:h,tooltip:u}=i,d=e.reduce((e,t)=>e?.children[t],this.rootNode);if(null==d)return;const{datum:p,depth:g,children:f}=d;if(null==p||null==g)return;const m=0===f.length,y=[],v=null!=a?p[a]:void 0;null!=v&&y.push({label:l,fallbackLabel:a,value:v});const b=null!=c?p[c]:void 0;let C;null!=b&&y.push({label:h,fallbackLabel:c,value:b}),m?(C=this.getTileBaseStyle(!1),Object.assign(C,this.getTileStyleOverrides(e,p,g,b,C,!1))):(C=this.getGroupBaseStyle(!1),Object.assign(C,this.getGroupStyleOverrides(e,p,g,C,!1)));const w=C.fill,S=C_({shape:"square",fill:w,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults);n.n1.isGradientFill(S.fill)&&(S.fill={...S.fill,gradient:"linear",rotation:0,reverse:!1});const x=m?{marker:S}:void 0;return this.formatTooltipWithContext(u,{title:null!=s?p[s]:void 0,symbol:x,data:y},{seriesId:t,datum:p,title:void 0,depth:g,labelKey:s,secondaryLabelKey:r,childrenKey:o,sizeKey:a,sizeName:l,colorKey:c,colorName:h,...C})}computeFocusBounds(e){return v_.toCanvas(this.contentGroup,e.getBBox())}});M_.className="TreemapSeries",M_.type="treemap";var{commonSeriesOptionsDefs:T_,treemapSeriesThemeableOptionsDef:D_,without:I_}=n.n1,R_={...D_,...I_(T_,["highlightStyle"]),type:(0,s.mw)((0,s.dY)("treemap")),labelKey:s.Yj,secondaryLabelKey:s.Yj,childrenKey:s.Yj,sizeKey:s.Yj,colorKey:s.Yj,sizeName:s.Yj,colorName:s.Yj};R_.fillGradientDefaults=(0,s._L)(s.wi),R_.fillPatternDefaults=(0,s._L)(s.GY),R_.fillImageDefaults=(0,s._L)(s.Zd),R_.undocumentedGroupFills=(0,s._L)((0,s.jk)(s.yW)),R_.undocumentedGroupStrokes=(0,s._L)((0,s.jk)(s.yW));var{FONT_SIZE_RATIO:k_}=n.n1,P_={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["hierarchy"],identifier:"treemap",moduleFactory:e=>new M_(e),tooltipDefaults:{range:"exact"},solo:!0,themeTemplate:{series:{fills:{$palette:"fills"},strokes:{$palette:"strokes"},colorRange:{$palette:"divergingColors"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:n.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:n.n1.FILL_IMAGE_DEFAULTS,undocumentedGroupFills:{$palette:"hierarchyColors"},undocumentedGroupStrokes:{$palette:"secondHierarchyColors"},group:{label:{enabled:!0,color:{$ref:"textColor"},fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},spacing:4},fill:void 0,stroke:void 0,strokeWidth:1,padding:4,gap:2,textAlign:"left"},tile:{label:{enabled:!0,color:{$ref:"backgroundColor"},fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.5]},minimumFontSize:{$rem:[k_.SMALLER]},fontFamily:{$ref:"fontFamily"},wrapping:"on-space",overflowStrategy:"ellipsis",spacing:2},secondaryLabel:{enabled:!0,color:{$ref:"backgroundColor"},fontStyle:void 0,fontWeight:void 0,fontSize:{$ref:"fontSize"},minimumFontSize:{$rem:[k_.SMALLER]},fontFamily:{$ref:"fontFamily"},wrapping:"never",overflowStrategy:"ellipsis"},fill:void 0,stroke:void 0,strokeWidth:0,padding:3,gap:1},highlightStyle:{group:{label:{color:{$ref:"textColor"}},fill:"rgba(255,255,255, 0.33)",stroke:"rgba(0, 0, 0, 0.4)",strokeWidth:2},tile:{label:{color:{$ref:"backgroundColor"}},secondaryLabel:{color:{$ref:"backgroundColor"}},fill:"rgba(255,255,255, 0.33)",stroke:"rgba(0, 0, 0, 0.4)",strokeWidth:2}}},gradientLegend:{enabled:!0}}},__={type:"series",name:"treemap",chartType:"hierarchy",enterprise:!0,options:R_,create:e=>new M_(e)},L_=(n.n1.ModuleRegistry,[Wd,Lg,Zf,pS,zS,Gm,Km,av,Jv,qb,jd,$d,Kd,Yd,VT,vI,AI,gR,kR,ep,sw,xP,rp,Jx,Nk,hp,XP,__,fp,CD,Ep,KE,aA,$A,xM,UM,lC,cC,hC]),N_={xMin:0,xMax:1,yMin:2,yMax:3,span:4};function O_(e,t){return Array.from({length:e},(e,i)=>{const n=4*i;return(t[n+0]+t[n+1])/2|0})}var{ChartAxisDirection:F_,ContinuousScale:G_,DiscreteTimeScale:B_}=n.n1,V_=class extends n.n1.BarSeries{aggregateData(e,t){if("ungrouped"!==t?.type)return;const i=this.axes[F_.X];if(null==i||!G_.is(i.scale)&&!B_.is(i.scale))return;const n=e.resolveKeysById(this,"xValue",t),s=e.resolveColumnById(this,"yValue-raw",t),{index:r}=e.resolveProcessedDataDefById(this,"xValue");return function(e,t,i){if(e.length<1e3)return;const[n,s]=Fg(i);let r=Og(e,5),{indexData:o,valueData:a}=Vg(e,t,t,n,s,r),l=O_(r,o);const c=[{maxRange:r,indexData:o,indices:l,indexes:N_}];for(;r>64;)({indexData:o,valueData:a,maxRange:r}=Hg(o,a,r)),l=O_(r,o),c.push({maxRange:r,indexData:o,indices:l,indexes:N_});return c.reverse(),c}(n,s,t.domain.keys[r])}},{BarSeriesModule:H_}=n.n1,U_={...H_,type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"bar",moduleFactory:e=>new V_(e)};function z_(e,t,i,n,s,r){const o=e[r];if(null==o)return!1;const a=Bg(Gg(o,t,i),s);return r===n[a+0]||r===n[a+1]||r===n[a+2]||r===n[a+3]}var{ChartAxisDirection:W_,ContinuousScale:j_,DiscreteTimeScale:$_}=n.n1,K_=class extends n.n1.LineSeries{aggregateData(e,t){const i=this.axes[W_.X];if(null!=i&&(j_.is(i.scale)||$_.is(i.scale)))return function(e,t,i){if(e.length<1e3)return;const[n,s]=Fg(i);let r=Og(e,10);const{indexData:o,valueData:a}=Vg(e,t,t,n,s,r);let l=[];for(let t=0;t<e.length;t+=1)z_(e,n,s,o,r,t)&&l.push(t);const c=[{maxRange:r,indices:l}];for(;l.length>10&&r>64;)({maxRange:r}=Hg(o,a,r,{inPlace:!0})),l=l.filter(z_.bind(null,e,n,s,o,r)),c.push({maxRange:r,indices:l});return c.reverse(),c}(e.resolveColumnById(this,"xValue",t),e.resolveColumnById(this,"yValueRaw",t),e.getDomain(this,"xValue","value",t))}},{LineSeriesModule:Y_}=n.n1,q_={...Y_,type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"line",moduleFactory:e=>new K_(e)};n.n1.ModuleRegistry.registerMany(L_),n.n1.moduleRegistry.register(Q,le,Je,Al,Nl,U_,jc,_g,Xf,nw,dS,US,$m,Ul,ic,yc,wc,Bc,Qx,q_,$E,oA,jA,SM,HM,Ah,nu,Fd,Fm,BT,pe,yI,EI,pR,RR,We,Lk,qe,Qv,ov,Fh,bD,SP,Vh,qP,vu,P_,Yb,Sd),n.n1.enterpriseModule.isEnterprise=!0,n.n1.enterpriseModule.styles='.ag-watermark{position:absolute;bottom:20px;right:25px;font-weight:700;font-family:Impact,sans-serif;font-size:19px;opacity:.7;animation:1s ease-out 3s ag-watermark-fadeout;color:#9b9b9b;pointer-events:none;&:before{content:"";display:block;height:40px;width:170px;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjU4IiBoZWlnaHQ9IjQwIiB2aWV3Qm94PSIwIDAgMjU4IDQwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjUuNzc5IDI4LjY1N0gxMy4zNTlMMTEuMTczIDM0LjAxMkg1LjY3Mjk3TDE3LjE4MiA3LjA1OTk5SDIxLjk1M0wzMy40NjIgMzQuMDEySDI3Ljk2MkwyNS43NzYgMjguNjU3SDI1Ljc3OVpNMjQuMDY4IDI0LjM5N0wxOS41ODggMTMuNDM0TDE1LjEwNyAyNC4zOTdIMjQuMDY4Wk02Mi4wOTIgMTguODIzSDQ5LjgxN1YyMy4wODZINTYuNzc1QzU2LjU1NSAyNS4yMjIgNTUuNzU1IDI2LjkyNyA1NC4zNzIgMjguMjAyQzUyLjk4OSAyOS40NzYgNTEuMTY2IDMwLjExNSA0OC45MDkgMzAuMTE1QzQ3LjYyMiAzMC4xMTUgNDYuNDUgMjkuODg1IDQ1LjM5MyAyOS40MjNDNDQuMzU4MyAyOC45NzgxIDQzLjQzMjYgMjguMzEzOCA0Mi42OCAyNy40NzZDNDEuOTI3IDI2LjYzOSA0MS4zNDQgMjUuNjMxIDQwLjkzMSAyNC40NTNDNDAuNTE5IDIzLjI3NSA0MC4zMTEgMjEuOTcgNDAuMzExIDIwLjUzN0M0MC4zMTEgMTkuMTA1IDQwLjUxNiAxNy44IDQwLjkzMSAxNi42MjFDNDEuMzQ0IDE1LjQ0MyA0MS45MjcgMTQuNDM2IDQyLjY4IDEzLjU5OEM0My40Mzc2IDEyLjc1NzcgNDQuMzY5NiAxMi4wOTMyIDQ1LjQxMSAxMS42NTFDNDYuNDc4IDExLjE4OSA0Ny42NTYgMTAuOTYgNDguOTQ2IDEwLjk2QzUxLjYxMiAxMC45NiA1My42MzcgMTEuNjAyIDU1LjAyIDEyLjg4NUw1OC4zIDkuNjA0OTlDNTUuODE3IDcuNjY5OTkgNTIuNjc2IDYuNjk5OTkgNDguODcyIDYuNjk5OTlDNDYuNzYgNi42OTk5OSA0NC44NTMgNy4wMzQ5OSA0My4xNTQgNy43MDA5OUM0MS40NTUgOC4zNjc5OSAzOS45OTggOS4zMDM5OSAzOC43ODMgMTAuNTA0QzM3LjU2NyAxMS43MDcgMzYuNjM0IDEzLjE1OCAzNS45NzcgMTQuODU3QzM1LjMxOSAxNi41NTYgMzQuOTk0IDE4LjQ1MSAzNC45OTQgMjAuNTRDMzQuOTk0IDIyLjYzIDM1LjMyOSAyNC40OTQgMzUuOTk1IDI2LjIwNUMzNi42NjIgMjcuOTE2IDM3LjYwNSAyOS4zNzQgMzguODE3IDMwLjU3N0M0MC4wMzIgMzEuNzggNDEuNDg2IDMyLjcxMyA0My4xODggMzMuMzgzQzQ0Ljg4OCAzNC4wNDkgNDYuNzgyIDM0LjM4NCA0OC44NzIgMzQuMzg0QzUwLjk2MSAzNC4zODQgNTIuNzUgMzQuMDQ5IDU0LjM5IDMzLjM4M0M1Ni4wMzEgMzIuNzE2IDU3LjQyNiAzMS43OCA1OC41NzkgMzAuNTc3QzU5LjczMyAyOS4zNzQgNjAuNjE5IDI3LjkxNiA2MS4yMzkgMjYuMjA1QzYxLjg2IDI0LjQ5NCA2Mi4xNyAyMi42MDUgNjIuMTcgMjAuNTRDNjIuMTY5NiAxOS45Njg4IDYyLjE0NDUgMTkuMzk4IDYyLjA5NSAxOC44MjlMNjIuMDkyIDE4LjgyM1pNMTUxLjgxIDE2Ljk4MUMxNTMuNDEgMTQuNjA5IDE1Ny40MTkgMTQuMzU4IDE1OS4wMjIgMTQuMzU4VjE4LjkxQzE1Ni45NTcgMTguOTEgMTU0Ljk4NSAxOC45OTYgMTUzLjc1NyAxOS44OTJDMTUyLjUyOSAyMC43OTIgMTUxLjkxOSAyMS45ODIgMTUxLjkxOSAyMy40NjRWMzMuOTlIMTQ2Ljk2NFYxNC4zNThIMTUxLjczNkwxNTEuODEgMTYuOTgxWk0xNDMuMDExIDE0LjM2MVYzNC4wMzFIMTM4LjI0TDEzOC4xMzEgMzEuMDQ1QzEzNy40NjYgMzIuMDc2IDEzNi41NTEgMzIuOTIxOSAxMzUuNDcxIDMzLjUwNEMxMzQuMzc2IDM0LjA5OSAxMzMuMDY4IDM0LjM5NiAxMzEuNTM2IDM0LjM5NkMxMzAuMiAzNC4zOTYgMTI4Ljk2MyAzNC4xNTIgMTI3LjgyMiAzMy42NjhDMTI2LjcgMzMuMTk2NCAxMjUuNjg5IDMyLjQ5NSAxMjQuODU1IDMxLjYwOUMxMjQuMDE4IDMwLjcyMiAxMjMuMzU0IDI5LjY2MiAxMjIuODcxIDI4LjQyMkMxMjIuMzg0IDI3LjE4NSAxMjIuMTQyIDI1LjgxMSAxMjIuMTQyIDI0LjMwNEMxMjIuMTQyIDIyLjc5OCAxMjIuMzg0IDIxLjM3OCAxMjIuODcxIDIwLjExNkMxMjMuMzU3IDE4Ljg1NCAxMjQuMDE4IDE3Ljc3MiAxMjQuODU1IDE2Ljg3M0MxMjUuNjg4IDE1Ljk3NjQgMTI2LjY5OCAxNS4yNjM2IDEyNy44MjIgMTQuNzhDMTI4Ljk2MyAxNC4yODEgMTMwLjIwMyAxNC4wMzMgMTMxLjUzNiAxNC4wMzNDMTMzLjA0MyAxNC4wMzMgMTM0LjMzIDE0LjMxOCAxMzUuMzk3IDE0Ljg4OEMxMzYuNDYyIDE1LjQ1ODkgMTM3LjM3NSAxNi4yNzggMTM4LjA1NyAxNy4yNzZWMTQuMzYxSDE0My4wMTFaTTEzMi42MzEgMzAuMTMzQzEzNC4yNTYgMzAuMTMzIDEzNS41NjcgMjkuNTk0IDEzNi41NjUgMjguNTEyQzEzNy41NjEgMjcuNDMgMTM4LjA2IDI1Ljk5MSAxMzguMDYgMjQuMTk2QzEzOC4wNiAyMi40MDEgMTM3LjU2MSAyMC45OSAxMzYuNTY1IDE5Ljg5OUMxMzUuNTcgMTguODA3IDEzNC4yNTkgMTguMjU4IDEzMi42MzEgMTguMjU4QzEzMS4wMDMgMTguMjU4IDEyOS43MjkgMTguODA0IDEyOC43MzQgMTkuODk5QzEyNy43MzggMjAuOTkzIDEyNy4yMzkgMjIuNDM4IDEyNy4yMzkgMjQuMjMzQzEyNy4yMzkgMjYuMDI4IDEyNy43MzUgMjcuNDMzIDEyOC43MzQgMjguNTE1QzEyOS43MjkgMjkuNTk0IDEzMS4wMjggMzAuMTM2IDEzMi42MzEgMzAuMTM2VjMwLjEzM1pNOTMuNjk4IDI3Ljg3NkM5My41Nzk1IDI4LjAwMjUgOTMuNDU2NCAyOC4xMjQ2IDkzLjMyOSAyOC4yNDJDOTEuOTQ3IDI5LjUxNiA5MC4xMjMgMzAuMTU1IDg3Ljg2NiAzMC4xNTVDODYuNTggMzAuMTU1IDg1LjQwOCAyOS45MjYgODQuMzUgMjkuNDY0QzgzLjMxNTUgMjkuMDE4OSA4Mi4zODk4IDI4LjM1NDYgODEuNjM3IDI3LjUxN0M4MC44ODQgMjYuNjc5IDgwLjMwMSAyNS42NzIgNzkuODg5IDI0LjQ5NEM3OS40NzYgMjMuMzE1IDc5LjI2OSAyMi4wMSA3OS4yNjkgMjAuNTc4Qzc5LjI2OSAxOS4xNDUgNzkuNDczIDE3Ljg0IDc5Ljg4OSAxNi42NjJDODAuMzAxIDE1LjQ4NCA4MC44ODQgMTQuNDc2IDgxLjYzNyAxMy42MzlDODIuMzk0OSAxMi43OTg3IDgzLjMyNzMgMTIuMTM0MiA4NC4zNjkgMTEuNjkyQzg1LjQzNiAxMS4yMyA4Ni42MTQgMTEgODcuOTAzIDExQzkwLjU3IDExIDkyLjU5NSAxMS42NDIgOTMuOTc3IDEyLjkyNkw5Ny4yNTggOS42NDQ5OUM5NC43NzQgNy43MTA5OSA5MS42MzMgNi43Mzk5OSA4Ny44MjkgNi43Mzk5OUM4NS43MTggNi43Mzk5OSA4My44MTEgNy4wNzQ5OSA4Mi4xMTIgNy43NDE5OUM4MC40MTMgOC40MDc5OSA3OC45NTYgOS4zNDQ5OSA3Ny43NCAxMC41NDVDNzYuNTI1IDExLjc0NyA3NS41OTIgMTMuMTk5IDc0LjkzNCAxNC44OThDNzQuMjc3IDE2LjU5NyA3My45NTEgMTguNDkxIDczLjk1MSAyMC41ODFDNzMuOTUxIDIyLjY3IDc0LjI4NiAyNC41MzQgNzQuOTUzIDI2LjI0NUM3NS42MTkgMjcuOTU3IDc2LjU2MiAyOS40MTQgNzcuNzc0IDMwLjYxN0M3OC45OSAzMS44MiA4MC40NDQgMzIuNzUzIDgyLjE0NiAzMy40MjNDODMuODQ1IDM0LjA5IDg1LjczOSAzNC40MjQgODcuODI5IDM0LjQyNEM4OS45MTkgMzQuNDI0IDkxLjcwOCAzNC4wOSA5My4zNDggMzMuNDIzQzk0LjcxOCAzMi44NjUgOTUuOTE4IDMyLjEyMSA5Ni45NDggMzEuMTkxQzk3LjE0OSAzMS4wMDggOTcuMzQ4IDMwLjgxNSA5Ny41MzcgMzAuNjJMOTMuNzAxIDI3Ljg4NUw5My42OTggMjcuODc2Wk0xMTAuODAyIDE0LjAxNUMxMDkuMTk5IDE0LjAxNSAxMDYuODM2IDE0LjQ3MSAxMDUuNjExIDE2LjE1OEwxMDUuNTM3IDYuMDE1OTlIMTAwLjc2NVYzMy45MzlIMTA1LjcyVjIyLjY0MUMxMDUuNzcxIDIxLjQ2MDcgMTA2LjI4OCAyMC4zNDg4IDEwNy4xNTcgMTkuNTQ4OUMxMDguMDI3IDE4Ljc0OTEgMTA5LjE3OCAxOC4zMjY2IDExMC4zNTggMTguMzc0QzExMy4zOTcgMTguMzc0IDExNC4yNjggMjEuMTU5IDExNC4yNjggMjIuNjQxVjMzLjkzOUgxMTkuMjIzVjIxLjA1OUMxMTkuMjIzIDIxLjA1OSAxMTkuMTQyIDE0LjAxNSAxMTAuODAyIDE0LjAxNVpNMTczLjc2MyAxNC4zNThIMTY5Ljk5OVY4LjcxNDk5SDE2NS4wNDhWMTQuMzU4SDE2MS4yODRWMTguOTE2SDE2NS4wNDhWMzQuMDAzSDE2OS45OTlWMTguOTE2SDE3My43NjNWMTQuMzU4Wk0xOTAuNzg3IDI1LjI2MkMxOTAuMTI5IDI0LjUwMTQgMTg5LjMwNyAyMy44OTk0IDE4OC4zODQgMjMuNTAxQzE4Ny40ODggMjMuMTE3IDE4Ni4zMzEgMjIuNzMyIDE4NC45NDggMjIuMzY0QzE4NC4xNjUgMjIuMTQzOSAxODMuMzkgMjEuODk3OCAxODIuNjIzIDIxLjYyNkMxODIuMTYzIDIxLjQ2MjEgMTgxLjc0MSAyMS4yMDY2IDE4MS4zODMgMjAuODc1QzE4MS4yMzUgMjAuNzQyMSAxODEuMTE4IDIwLjU3ODkgMTgxLjAzOSAyMC4zOTY0QzE4MC45NjEgMjAuMjE0IDE4MC45MjIgMjAuMDE2NiAxODAuOTI3IDE5LjgxOEMxODAuOTI3IDE5LjI3MiAxODEuMTU2IDE4Ljg0NCAxODEuNjI1IDE4LjUxQzE4Mi4xMjEgMTguMTU2IDE4Mi44NjIgMTcuOTc2IDE4My44MjYgMTcuOTc2QzE4NC43OSAxNy45NzYgMTg1LjU4NyAxOC4yMDkgMTg2LjE0OCAxOC42NjhDMTg2LjcwNiAxOS4xMjQgMTg3LjAwNyAxOS43MjUgMTg3LjA3MiAyMC41TDE4Ny4wOTQgMjAuNzgySDE5MS42MzNMMTkxLjYxNyAyMC40NkMxOTEuNTIxIDE4LjQ4NSAxOTAuNzcxIDE2LjkgMTg5LjM4NSAxNS43NUMxODguMDEyIDE0LjYxMiAxODYuMTg1IDE0LjAzMyAxODMuOTYyIDE0LjAzM0MxODIuNDc3IDE0LjAzMyAxODEuMTQxIDE0LjI4NyAxNzkuOTk0IDE0Ljc4NkMxNzguODMxIDE1LjI5MSAxNzcuOTI2IDE1Ljk5NSAxNzcuMjk2IDE2Ljg4MkMxNzYuNjczIDE3Ljc0NTUgMTc2LjMzOCAxOC43ODQgMTc2LjM0MSAxOS44NDlDMTc2LjM0MSAyMS4xNjcgMTc2LjY5OCAyMi4yNDkgMTc3LjM5OSAyMy4wNjRDMTc4LjA2IDIzLjg0MzIgMTc4Ljg5OCAyNC40NTM0IDE3OS44NDIgMjQuODQ0QzE4MC43NDQgMjUuMjE2IDE4MS45MjggMjUuNjA3IDE4My4zNjEgMjZDMTg0LjgwNiAyNi40MSAxODUuODcyIDI2Ljc4NSAxODYuNTMgMjcuMTIzQzE4Ny4xIDI3LjQxNCAxODcuMzc5IDI3Ljg0NSAxODcuMzc5IDI4LjQ0NEMxODcuMzc5IDI5LjA0MiAxODcuMTIyIDI5LjQ2NyAxODYuNTk1IDI5LjgzOUMxODYuMDQzIDMwLjIyNiAxODUuMjM3IDMwLjQyNSAxODQuMjAxIDMwLjQyNUMxODMuMTY2IDMwLjQyNSAxODIuMzk0IDMwLjE3NCAxODEuNzQ5IDI5LjY3NEMxODEuMTEzIDI5LjE4MSAxODAuNzcyIDI4LjU4OSAxODAuNzEgMjcuODY0TDE4MC42ODUgMjcuNTgySDE3Ni4wMTNMMTc2LjAyNSAyNy45MDFDMTc2LjA2NyAyOS4wOTU1IDE3Ni40NzIgMzAuMjQ4NyAxNzcuMTg4IDMxLjIwNkMxNzcuOTA3IDMyLjE4IDE3OC44OTMgMzIuOTU4IDE4MC4xMTggMzMuNTE5QzE4MS4zMzYgMzQuMDc3IDE4Mi43MzIgMzQuMzYyIDE4NC4yNjYgMzQuMzYyQzE4NS44MDEgMzQuMzYyIDE4Ny4xMDkgMzQuMTA4IDE4OC4yMzggMzMuNjA5QzE4OS4zNzYgMzMuMTA0IDE5MC4yNzIgMzIuMzk0IDE5MC45MDEgMzEuNDk0QzE5MS41MzQgMzAuNTkyIDE5MS44NTMgMjkuNTU0IDE5MS44NTMgMjguNDAzQzE5MS44MjggMjcuMTEgMTkxLjQ2NiAyNi4wNTMgMTkwLjc3NyAyNS4yNjJIMTkwLjc4N1oiIGZpbGw9IiM5QjlCOUIiLz4KPHBhdGggZD0iTTI0MS45ODIgMjUuNjU4MlYxNy43MTE3SDIyOC40NDFMMjIwLjQ5NCAyNS42NTgySDI0MS45ODJaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNTcuMjM5IDUuOTUwODFIMjQwLjI2NUwyMzIuMjU1IDEzLjg5NzNIMjU3LjIzOVY1Ljk1MDgxWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjEyLjYxMSAzMy42MDQ4TDIxNi42OCAyOS41MzYxSDIzMC40MTJWMzcuNDgyN0gyMTIuNjExVjMzLjYwNDhaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yMTUuNTk5IDIxLjc4MDNIMjI0LjM3MkwyMzIuMzgyIDEzLjgzMzdIMjE1LjU5OVYyMS43ODAzWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjA2IDMzLjYwNDdIMjEyLjYxMUwyMjAuNDk0IDI1LjY1ODJIMjA2VjMzLjYwNDdaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNDAuMjY1IDUuOTUwODFMMjM2LjE5NyAxMC4wMTk0SDIxMC4yNTlWMi4wNzI4OEgyNDAuMjY1VjUuOTUwODFaIiBmaWxsPSIjOUI5QjlCIi8+Cjwvc3ZnPgo=);background-repeat:no-repeat;background-size:170px 40px}>span{padding-left:.7rem}}@keyframes ag-watermark-fadeout{0%{opacity:.5}to{opacity:0}}.ag-charts-dialog{display:flex;flex-direction:column;font-size:var(--ag-charts-chrome-font-size-large)}.ag-charts-dialog__tabs{display:flex;flex-direction:column}.ag-charts-dialog__header{border-bottom:1px solid var(--ag-charts-border-color);display:flex}.ag-charts-dialog__tab-list{display:flex;gap:calc(var(--ag-charts-spacing) * 2)}.ag-charts-dialog__drag-handle{align-items:center;color:inherit;cursor:grab;display:flex;padding:1px 6px;text-align:center}.ag-charts-dialog__drag-handle--dragging{cursor:grabbing}.ag-charts-dialog__tab-button{background:none;border:0;border-bottom:2px solid transparent;border-radius:0;color:var(--ag-charts-chrome-subtle-text-color);margin-bottom:-1px;padding:var(--input-padding) calc(var(--input-padding) / 2)}.ag-charts-dialog__tab-button:hover{background:none}.ag-charts-dialog__tab-button--active{border-color:var(--ag-charts-accent-color);color:inherit}.ag-charts-dialog__drag-handle+.ag-charts-dialog__tab-button{margin-left:calc(var(--ag-charts-spacing) * -2)}.ag-charts-button.ag-charts-dialog__close-button{background:none;border:0;margin-left:auto;padding:1px 6px}.ag-charts-dialog__close-button:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:calc(var(--ag-charts-layer-ui-overlay) + 1)}.ag-charts-dialog__tab-panel{display:none;flex-direction:column;gap:calc(var(--ag-charts-spacing) * 4);margin:0 calc(var(--ag-charts-spacing) * 4);padding:calc(var(--ag-charts-spacing) * 4) 0}.ag-charts-dialog__tab-panel--active{display:flex}.ag-charts-dialog__input-group-line{display:flex;gap:16px 18px;flex-wrap:wrap}.ag-charts-dialog__input-group{align-items:center;display:flex;font-size:var(--ag-charts-chrome-font-size)}.ag-charts-dialog__input-group-label{color:var(--ag-charts-chrome-subtle-text-color);margin-right:5px}.ag-charts-dialog__input-group-label[for]{cursor:pointer}.ag-charts-dialog__button{border-radius:0;margin-right:-1px}.ag-charts-dialog__button.ag-charts-dialog__button--active{background:var(--ag-charts-button-focus-background-color);border-color:var(--ag-charts-input-focus-border-color);color:var(--ag-charts-input-focus-text-color);z-index:var(--input-layer-active)}.ag-charts-dialog__button:first-child,.ag-charts-dialog__input-group-label+.ag-charts-dialog__button{border-bottom-left-radius:var(--ag-charts-input-border-radius);border-top-left-radius:var(--ag-charts-input-border-radius)}.ag-charts-dialog__button:last-child{border-bottom-right-radius:var(--ag-charts-input-border-radius);border-top-right-radius:var(--ag-charts-input-border-radius)}.ag-charts-dialog__color-picker-button{--color: #000;background:var(--color);border:none;color:transparent;height:26px;width:26px}.ag-charts-dialog__color-picker-button:hover{background:var(--color)}.ag-charts-dialog__color-picker-button--multi-color,.ag-charts-dialog__color-picker-button--multi-color:hover{background:linear-gradient(135deg,red 0%,#ff0 calc(100% * 1 / 6),#0f0 calc(100% * 2 / 6),#0ff 50%,#00f calc(100% * 4 / 6),#f0f calc(100% * 5 / 6),red 100%)}.ag-charts-color-picker{width:190px;padding:8px;--h: 0;--s: 0;--v: 0;--a: 0;--color: #000;--color-a: #000;--thumb-size: 18px;--inner-width: 172px;--track-height: 12px;--palette-height: 136px;--checker: url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="4" height="4"><rect x="0" y="0" width="4" height="4" fill="%23fff"/><path d="M0 0H2V4H4V2H0Z" fill="%23b2b2b2"/></svg>\');--multi-color: linear-gradient( 135deg, #f00 0% , #ff0 calc(100% * 1 / 6), #0f0 calc(100% * 2 / 6), #0ff 50% , #00f calc(100% * 4 / 6), #f0f calc(100% * 5 / 6), #f00 100% )}.ag-charts-color-picker__content{display:flex;flex-direction:column}.ag-charts-color-picker__palette{position:relative;width:100%;height:var(--palette-height);margin-bottom:8px;background:linear-gradient(to bottom,#0000,#000),linear-gradient(to right,#fff,#fff0) hsl(var(--h),100%,50%);border-radius:calc(var(--ag-charts-border-radius) * 1.5);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__palette:after{content:"";position:absolute;display:block;top:calc(var(--thumb-size) * -.5 + (1 - var(--v)) * 100%);left:calc(var(--thumb-size) * -.5 + var(--s) * 100%);background:var(--color);width:var(--thumb-size);height:var(--thumb-size);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:var(--box-shadow);--box-shadow: inset 0 0 0 3px white, inset 0 0 1px 3px #0006, 0 0 5px #00000038}.ag-charts-color-picker__palette:focus-visible:after{outline:var(--ag-charts-focus-border);box-shadow:var(--box-shadow),0 0 0 2px #fff8,var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__color-row{display:flex;gap:8px;align-items:center;margin-bottom:4px;--inset: calc((var(--thumb-size) - var(--track-height)) / 2)}.ag-charts-color-picker__hue-input,.ag-charts-color-picker__alpha-input{-webkit-appearance:none;display:block;position:relative;padding:0;margin:0 calc(var(--inset) * -1);border:0;height:var(--thumb-size);width:auto;background:transparent;--inset: calc((var(--thumb-size) - var(--track-height)) / 2)}.ag-charts-color-picker__hue-input::-webkit-slider-thumb,.ag-charts-color-picker__alpha-input::-webkit-slider-thumb{-webkit-appearance:none;width:var(--thumb-size);height:var(--thumb-size);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:var(--box-shadow);--box-shadow: inset 0 0 0 3px white, inset 0 0 1px 3px #0006, 0 0 5px #00000038;transform:translateZ(0)}.ag-charts-color-picker__hue-input::-webkit-slider-thumb{background:hsl(var(--h),100%,50%)}.ag-charts-color-picker__alpha-input::-webkit-slider-thumb{background:transparent}.ag-charts-color-picker__alpha-input--opaque::-webkit-slider-thumb{background:var(--color)}.ag-charts-color-picker__hue-input:focus-visible::-webkit-slider-thumb,.ag-charts-color-picker__alpha-input:focus-visible::-webkit-slider-thumb{outline:var(--ag-charts-focus-border);box-shadow:var(--box-shadow),var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__hue-input:before,.ag-charts-color-picker__alpha-input:before{position:absolute;content:"";display:block;top:calc(50% - var(--track-height) / 2);left:var(--inset);right:var(--inset);height:var(--track-height);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__multi-color-button{width:36px;margin-left:var(--inset);height:var(--track-height);border-radius:calc(var(--ag-charts-border-radius) * 99);border:0;background:var(--multi-color);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__multi-color-button--hidden{display:none}.ag-charts-color-picker__multi-color-button--active{box-shadow:inset 0 0 0 1px #0003;outline-offset:1px;outline:2px solid #2196f3}.ag-charts-color-picker__hue-input{flex:1 0 0}.ag-charts-color-picker__hue-input:before{background:linear-gradient(to right,red,red calc((100% - var(--track-height)) * 0 / 6 + var(--track-height) / 2),#ff0 calc((100% - var(--track-height)) * 1 / 6 + var(--track-height) / 2),#0f0 calc((100% - var(--track-height)) * 2 / 6 + var(--track-height) / 2),#0ff calc((100% - var(--track-height)) * 3 / 6 + var(--track-height) / 2),#00f calc((100% - var(--track-height)) * 4 / 6 + var(--track-height) / 2),#f0f calc((100% - var(--track-height)) * 5 / 6 + var(--track-height) / 2),red calc((100% - var(--track-height)) * 6 / 6 + var(--track-height) / 2))}.ag-charts-color-picker__alpha-input{margin-bottom:7px}.ag-charts-color-picker__alpha-input:before{background:linear-gradient(to right,transparent,var(--color)),var(--checker) top left / 4px 4px}.ag-charts-color-picker__color-field{display:flex;border:var(--ag-charts-border);background:var(--ag-charts-background-color);border-radius:var(--ag-charts-border-radius);overflow:hidden}.ag-charts-color-picker__color-field:has(:focus-visible){border-color:var(--ag-charts-accent-color);box-shadow:var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__color-label{width:16px;height:16px;margin:7px 0 7px 7px;color:transparent;background:linear-gradient(to right,var(--color-a),var(--color-a)),var(--checker) top left / 4px 4px;border-radius:calc(var(--ag-charts-border-radius) / 2);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__color-label--multi-color{background:var(--multi-color)}.ag-charts-color-picker__color-input{flex:1;min-width:0;padding:7px 7px 7px 8px;border:0;margin:0;color:inherit;background:transparent;font-variant:tabular-nums}.ag-charts-color-picker__color-input:focus-visible{border:none;outline:none}.ag-charts-annotations__line-stroke-width-menu,.ag-charts-annotations__line-style-type-menu,.ag-charts-annotations__text-size-menu{border-top-left-radius:0;border-top-right-radius:0;.ag-charts-menu__row:first-child{border-radius:0}}.ag-charts-annotations__text-size-menu{--item-padding: 4px 8px;min-width:34px;text-align:center}.ag-charts-annotations__line-stroke-width-menu{--item-padding: 6px;column-gap:6px}.ag-charts-annotations__line-style-type-menu{--item-padding: 6px;column-gap:0}.ag-charts-annotations__stroke-width-button:before{background:var(--ag-charts-foreground-color);content:"";margin-right:var(--toolbar-button-padding);height:min(var(--stroke-width),20px);width:12px}.ag-charts-annotations__stroke-width-button[aria-disabled=true]:before{filter:grayscale(1);opacity:.5}.ag-charts-annotations__color-picker-button{--emblem: var(--color)}.ag-charts-annotations__color-picker-button--multi-color{--emblem: linear-gradient( to right, #f00 0% , #ff0 calc(100% * 1 / 6), #0f0 calc(100% * 2 / 6), #0ff 50% , #00f calc(100% * 4 / 6), #f0f calc(100% * 5 / 6), #f00 100% )}.ag-charts-annotations__color-picker-button:after{content:"";display:block;position:absolute;bottom:3px;left:5px;right:5px;height:4px;border-radius:99px;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--ag-charts-foreground-color) 10%,transparent);background:var(--emblem)}.ag-charts-annotations__color-picker-button[aria-disabled=true]:after{filter:grayscale(1);opacity:.5}.ag-charts-annotations__toolbar-menu{min-width:200px}.ag-charts-annotations__axis-button--hidden{display:none}.ag-charts-annotations__axis-button{background-color:var(--ag-charts-crosshair-label-background-color);border-radius:calc(var(--ag-charts-border-radius) / 2);border:none;box-sizing:border-box;color:var(--ag-charts-crosshair-label-text-color);cursor:pointer;font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);left:0;line-height:16px;overflow:hidden;padding:0;position:absolute;top:0;user-select:none;white-space:nowrap;z-index:var(--ag-charts-layer-annotations)}.ag-charts-annotations__axis-button:hover{opacity:.8;color:var(--ag-charts-background-color)}.ag-charts-dialog--annotation-settings{min-height:233px;width:289px}.ag-charts-dialog--annotation-settings .ag-charts-textarea{height:calc(10px * 2 + var(--textarea-line-height) * 1em * 3 + 2px);overflow-y:auto;resize:vertical}.ag-charts-context-menu{font-family:var(--ag-charts-chrome-font-family);font-size:calc(var(--ag-charts-chrome-font-size) * (13 / 12));font-weight:var(--ag-charts-chrome-font-weight);z-index:var(--ag-charts-layer-ui-overlay)}.ag-charts-context-menu__cover{position:fixed;left:0;top:0}.ag-charts-context-menu__menu{background:var(--ag-charts-chrome-background-color);border-radius:var(--ag-charts-border-radius);border:var(--ag-charts-border);box-shadow:var(--ag-charts-shadow);color:var(--ag-charts-chrome-text-color);display:table;flex-direction:column;padding:.5em 0;transition:transform .1s ease;white-space:nowrap}.ag-charts-context-menu__menu:focus{outline:none}.ag-charts-context-menu__item{align-items:center;background:none;border:none;box-sizing:border-box;color:inherit;display:table-row;font:inherit;justify-content:space-between;text-align:left;width:100%;-webkit-appearance:none;-moz-appearance:none}.ag-charts-context-menu__icon>img{width:var(--ag-charts-icon-size);height:var(--ag-charts-icon-size)}.ag-charts-context-menu__icon,.ag-charts-context-menu__label,.ag-charts-context-menu__rightarrowhead{display:table-cell;vertical-align:middle}.ag-charts-context-menu__cellpadding{padding:.5em 1em}.ag-charts-context-menu__icon{padding-right:0}.ag-charts-context-menu__item[data-focus-override=true],.ag-charts-context-menu__item:focus,.ag-charts-context-menu__item:active{background:var(--ag-charts-focus-color)}.ag-charts-context-menu__item[data-focus-visible-override=true]:focus,.ag-charts-context-menu__item:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:calc(var(--ag-charts-layer-ui-overlay) + 1)}.ag-charts-context-menu__item[data-focus-visible-override=false]{outline:inherit;box-shadow:inherit;z-index:inherit}.ag-charts-context-menu__item[aria-disabled=true]{border:none;color:color-mix(in srgb,var(--ag-charts-input-text-color) 50%,transparent);text-align:left}.ag-charts-context-menu__item[aria-disabled=true]:focus{background:inherit;cursor:inherit}.ag-charts-context-menu__divider{display:table-row}.ag-charts-context-menu__divider>div{padding:5px 0}.ag-charts-context-menu__divider>div:after{content:"";display:block;border-top:1px solid #babfc7}.ag-charts-context-menu__divider.ag-charts-dark-context-menu{background:#2196f31a}.ag-charts-crosshair-label{position:absolute;left:0;top:0;user-select:none;pointer-events:none;font-family:var(--ag-charts-font-family);font-size:var(--ag-charts-font-size);font-weight:var(--ag-charts-font-weight);overflow:hidden;white-space:nowrap;z-index:var(--ag-charts-layer-crosshair);box-sizing:border-box}.ag-charts-crosshair-label-content{padding:0 8px;border-radius:calc(var(--ag-charts-border-radius) / 2);line-height:calc(var(--ag-charts-font-size) + 8px);background-color:var(--ag-charts-crosshair-label-background-color);color:var(--ag-charts-crosshair-label-text-color)}.ag-charts-crosshair-label--hidden{visibility:hidden!important}.ag-charts-text-input{position:absolute}.ag-charts-text-input__textarea{--placeholder-text-color: var(--ag-charts-input-placeholder-text-color);display:block;height:100%;width:100%;border:0;background:none;line-height:1.38;outline:none;transform:translateY(.09em)}.ag-charts-text-input__textarea[placeholder]:empty:before{content:attr(placeholder);color:var(--placeholder-text-color);font-weight:400}.ag-charts-text-input__textarea[placeholder]:not(:empty):before{content:""}.ag-charts-chart-toolbar__menu{min-width:200px}.ag-charts-range-buttons .ag-charts-toolbar__button{padding:var(--toolbar-button-padding) calc(var(--toolbar-button-padding) * 1.5)}.ag-charts-zoom-buttons{align-items:center;display:flex;height:44px;justify-content:center;overflow:hidden;padding-bottom:10px;pointer-events:none;width:100%;.ag-charts-toolbar{--toolbar-size: 24px;--toolbar-button-padding: 1px;display:flex;font-size:var(--ag-charts-chrome-font-size);height:var(--toolbar-size);justify-content:center;opacity:1;pointer-events:auto;transition:opacity .2s ease-in-out,transform .4s ease-in-out;.ag-charts-toolbar__button--first{border-bottom-left-radius:var(--ag-charts-border-radius);border-top-left-radius:var(--ag-charts-border-radius)}.ag-charts-toolbar__button--last{border-bottom-right-radius:var(--ag-charts-border-radius);border-top-right-radius:var(--ag-charts-border-radius)}.ag-charts-toolbar__label{padding-left:var(--ag-charts-spacing);padding-right:var(--ag-charts-spacing)}.ag-charts-toolbar__icon+.ag-charts-toolbar__label{padding-left:0}.ag-charts-toolbar__button--gap{margin-left:var(--toolbar-gap)}&.ag-charts-zoom-buttons__toolbar--hidden{opacity:0;transition:opacity .4s ease-in-out,transform .4s ease-in-out}}}.ag-charts-shared-toolbar{gap:var(--toolbar-gap);.ag-charts-toolbar__button{border-radius:var(--ag-charts-border-radius);margin:0}}\n',n.n1.enterpriseModule.licenseManager=e=>new p(e.container?.ownerDocument??("undefined"==typeof document?void 0:document)),n.n1.enterpriseModule.injectWatermark=Gd;var X_={setLicenseKey(e){p.setLicenseKey(e)}};n.xv,n.Mo,n.LW,n.a9,n.ui.create.bind(n.ui),n.ui.__createSparkline.bind(n.ui),p.setGridContext.bind(p),p.setLicenseKey.bind(p)},25573(e,t,i){"use strict";i.d(t,{ui:()=>a});var n=i(22155),s=i(45401);function r(e,t){return{...e,container:t.current}}function o(e,t){const i=(0,n.forwardRef)(function(t,i){const{options:s,style:o,className:a}=t,l=(0,n.useRef)(null),c=(0,n.useRef)();(0,n.useLayoutEffect)(()=>{const t=e(r(s,l));return c.current=t,()=>{t.destroy()}},[]);const h=void 0===c.current;return(0,n.useEffect)(()=>{h||c.current?.update(r(s,l)).catch(e=>console.error(e))},[s]),(0,n.useImperativeHandle)(i,()=>c.current,[]),(0,n.useMemo)(()=>(0,n.createElement)("div",{ref:l,style:o,className:a}),[o,a])});return i.displayName=t,i}var a=o(e=>s.ui.create(e),"AgCharts")},65131(e,t,i){"use strict";i.d(t,{W6:()=>Td});var n=i(22155),s=Object.defineProperty,r=Object.defineProperties,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyDescriptors,l=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,u=(e,t,i)=>t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,d=(e,t)=>{for(var i in t||(t={}))c.call(t,i)&&u(e,i,t[i]);if(l)for(var i of l(t))h.call(t,i)&&u(e,i,t[i]);return e},p=(e,t)=>r(e,a(t)),g=(e,t)=>{for(var i in t)s(e,i,{get:t[i],enumerable:!0})},f=(e,t,i,n)=>{for(var r,a=n>1?void 0:n?o(t,i):t,l=e.length-1;l>=0;l--)(r=e[l])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&s(t,i,a),a},m=(e,t)=>(i,n)=>t(i,n,e),y={};function v(e){return null==e||""===e?null:e}function b(e,t=!1){return null!=e&&(""!==e||t)}function C(e){return!b(e)}function w(e){return null==e||0===e.length}function S(e){return null!=e&&"function"==typeof e.toString?e.toString():null}function x(e){if(void 0===e)return;if(null===e||""===e)return null;if("number"==typeof e)return isNaN(e)?void 0:e;const t=parseInt(e,10);return isNaN(t)?void 0:t}function E(e){if(void 0!==e)return null!==e&&""!==e&&("boolean"==typeof e?e:/true/i.test(e))}function A(e){if(null!=e&&""!==e)return e}function M(e,t){return(e?JSON.stringify(e):null)===(t?JSON.stringify(t):null)}function T(e,t,i=!1){const n=null==e,s=null==t;if(e&&e.toNumber&&(e=e.toNumber()),t&&t.toNumber&&(t=t.toNumber()),n&&s)return 0;if(n)return-1;if(s)return 1;function r(e,t){return e>t?1:e<t?-1:0}if("string"!=typeof e)return r(e,t);if(!i)return r(e,t);try{return e.localeCompare(t)}catch(i){return r(e,t)}}function D(e){if(e instanceof Set||e instanceof Map){const t=[];return e.forEach(e=>t.push(e)),t}return Object.values(e)}g(y,{attrToBoolean:()=>E,attrToNumber:()=>x,attrToString:()=>A,defaultComparator:()=>T,exists:()=>b,jsonEquals:()=>M,makeNull:()=>v,missing:()=>C,missingOrEmpty:()=>w,toStringOrNull:()=>S,values:()=>D});var I=class{constructor(){this.existingKeys={}}addExistingKeys(e){for(let t=0;t<e.length;t++)this.existingKeys[e[t]]=!0}getUniqueKey(e,t){e=S(e);let i=0;for(;;){let n;if(e?(n=e,0!==i&&(n+="_"+i)):t?(n=t,0!==i&&(n+="_"+i)):n=i,!this.existingKeys[n])return this.existingKeys[n]=!0,String(n);i++}}},R={};g(R,{SKIP_JS_BUILTINS:()=>k,cloneObject:()=>_,deepCloneDefinition:()=>L,getAllValuesInObject:()=>N,getValueUsingField:()=>F,isNonNullObject:()=>B,iterateObject:()=>P,mergeDeep:()=>O,removeAllReferences:()=>G});var k=new Set(["__proto__","constructor","prototype"]);function P(e,t){if(null!=e)if(Array.isArray(e))for(let i=0;i<e.length;i++)t(i.toString(),e[i]);else for(const[i,n]of Object.entries(e))t(i,n)}function _(e){const t={},i=Object.keys(e);for(let n=0;n<i.length;n++){if(k.has(i[n]))continue;const s=i[n],r=e[s];t[s]=r}return t}function L(e,t){if(!e)return;const i=e,n={};return Object.keys(i).forEach(e=>{if(t&&t.indexOf(e)>=0||k.has(e))return;const s=i[e],r=B(s)&&s.constructor===Object;n[e]=r?L(s):s}),n}function N(e){if(!e)return[];const t=Object;if("function"==typeof t.values)return t.values(e);const i=[];for(const t in e)e.hasOwnProperty(t)&&e.propertyIsEnumerable(t)&&i.push(e[t]);return i}function O(e,t,i=!0,n=!1){b(t)&&P(t,(t,s)=>{if(k.has(t))return;let r=e[t];r!==s&&(n&&null==r&&null!=s&&"object"==typeof s&&s.constructor===Object&&(r={},e[t]=r),B(s)&&B(r)&&!Array.isArray(r)?O(r,s,i,n):(i||void 0!==s)&&(e[t]=s))})}function F(e,t,i){if(!t||!e)return;if(!i)return e[t];const n=t.split(".");let s=e;for(let e=0;e<n.length;e++){if(null==s)return;s=s[n[e]]}return s}function G(e,t=[],i){Object.keys(e).forEach(i=>{"object"!=typeof e[i]||t.includes(i)||(e[i]=void 0)});const n=Object.getPrototypeOf(e),s={};Object.getOwnPropertyNames(n).forEach(e=>{if("function"==typeof n[e]&&!t.includes(e)){const t=()=>{console.warn((e=>`AG Grid: Grid API function ${e}() cannot be called as the grid has been destroyed.\n    It is recommended to remove local references to the grid api. Alternatively, check gridApi.isDestroyed() to avoid calling methods against a destroyed grid.\n    To run logic when the grid is about to be destroyed use the gridPreDestroy event. See: ${i}`)(e))};s[e]={value:t,writable:!0}}}),Object.defineProperties(e,s)}function B(e){return"object"==typeof e&&null!==e}var V={};g(V,{compose:()=>te,debounce:()=>Q,doOnce:()=>U,errorOnce:()=>W,executeAfter:()=>Z,executeInAWhile:()=>K,executeNextVMTurn:()=>X,getFunctionName:()=>j,isFunction:()=>$,noop:()=>ie,throttle:()=>J,waitUntil:()=>ee,warnOnce:()=>z});var H={};function U(e,t){H[t]||(e(),H[t]=!0)}function z(e){U(()=>console.warn("AG Grid: "+e),e)}function W(e){U(()=>console.error("AG Grid: "+e),e)}function j(e){if(e.name)return e.name;const t=/function\s+([^\(]+)/.exec(e.toString());return t&&2===t.length?t[1].trim():null}function $(e){return!!(e&&e.constructor&&e.call&&e.apply)}function K(e){Z(e,400)}var Y=[],q=!1;function X(e){Y.push(e),q||(q=!0,window.setTimeout(()=>{const e=Y.slice();Y.length=0,q=!1,e.forEach(e=>e())},0))}function Z(e,t=0){e.length>0&&window.setTimeout(()=>e.forEach(e=>e()),t)}function Q(e,t){let i;return function(...n){const s=this;window.clearTimeout(i),i=window.setTimeout(function(){e.apply(s,n)},t)}}function J(e,t){let i=0;return function(...n){const s=(new Date).getTime();s-i<t||(i=s,e.apply(this,n))}}function ee(e,t,i=100,n){const s=(new Date).getTime();let r=null,o=!1;const a=()=>{const a=(new Date).getTime()-s>i;(e()||a)&&(t(),o=!0,null!=r&&(window.clearInterval(r),r=null),a&&n&&console.warn(n))};a(),o||(r=window.setInterval(a,10))}function te(...e){return t=>e.reduce((e,t)=>t(e),t)}var ie=()=>{},ne=(e=>(e.CommunityCoreModule="@ag-grid-community/core",e.InfiniteRowModelModule="@ag-grid-community/infinite-row-model",e.ClientSideRowModelModule="@ag-grid-community/client-side-row-model",e.CsvExportModule="@ag-grid-community/csv-export",e.EnterpriseCoreModule="@ag-grid-enterprise/core",e.RowGroupingModule="@ag-grid-enterprise/row-grouping",e.ColumnsToolPanelModule="@ag-grid-enterprise/column-tool-panel",e.FiltersToolPanelModule="@ag-grid-enterprise/filter-tool-panel",e.MenuModule="@ag-grid-enterprise/menu",e.SetFilterModule="@ag-grid-enterprise/set-filter",e.MultiFilterModule="@ag-grid-enterprise/multi-filter",e.StatusBarModule="@ag-grid-enterprise/status-bar",e.SideBarModule="@ag-grid-enterprise/side-bar",e.RangeSelectionModule="@ag-grid-enterprise/range-selection",e.MasterDetailModule="@ag-grid-enterprise/master-detail",e.RichSelectModule="@ag-grid-enterprise/rich-select",e.GridChartsModule="@ag-grid-enterprise/charts",e.ViewportRowModelModule="@ag-grid-enterprise/viewport-row-model",e.ServerSideRowModelModule="@ag-grid-enterprise/server-side-row-model",e.ExcelExportModule="@ag-grid-enterprise/excel-export",e.ClipboardModule="@ag-grid-enterprise/clipboard",e.SparklinesModule="@ag-grid-enterprise/sparklines",e.AdvancedFilterModule="@ag-grid-enterprise/advanced-filter",e.AngularModule="@ag-grid-community/angular",e.ReactModule="@ag-grid-community/react",e.VueModule="@ag-grid-community/vue",e))(ne||{}),se=class e{static register(t){e.__register(t,!0,void 0)}static registerModules(t){e.__registerModules(t,!0,void 0)}static __register(t,i,n){e.runVersionChecks(t),void 0!==n?(e.areGridScopedModules=!0,void 0===e.gridModulesMap[n]&&(e.gridModulesMap[n]={}),e.gridModulesMap[n][t.moduleName]=t):e.globalModulesMap[t.moduleName]=t,e.setModuleBased(i)}static __unRegisterGridModules(t){delete e.gridModulesMap[t]}static __registerModules(t,i,n){e.setModuleBased(i),t&&t.forEach(t=>e.__register(t,i,n))}static isValidModuleVersion(t){const[i,n]=t.version.split(".")||[],[s,r]=e.currentModuleVersion.split(".")||[];return i===s&&n===r}static runVersionChecks(t){if(e.currentModuleVersion||(e.currentModuleVersion=t.version),t.version?e.isValidModuleVersion(t)||console.error(`AG Grid: You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. '${t.moduleName}' is version ${t.version} but the other modules are version ${this.currentModuleVersion}. Please update all modules to the same version.`):console.error(`AG Grid: You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. '${t.moduleName}' is incompatible. Please update all modules to the same version.`),t.validate){const e=t.validate();if(!e.isValid){const t=e;console.error(`AG Grid: ${t.message}`)}}}static setModuleBased(t){void 0===e.moduleBased?e.moduleBased=t:e.moduleBased!==t&&U(()=>{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(){e.isBundled=!0}static __assertRegistered(t,i,n){var s;if(this.__isRegistered(t,n))return!0;const r=i+t;let o;if(e.isBundled)o=`AG Grid: unable to use ${i} as 'ag-grid-enterprise' has not been loaded. Check you are using the Enterprise bundle:\n        \n        <script src="https://cdn.jsdelivr.net/npm/ag-grid-enterprise@AG_GRID_VERSION/dist/ag-grid-enterprise.min.js"><\/script>\n        \nFor more info see: https://ag-grid.com/javascript-data-grid/getting-started/#getting-started-with-ag-grid-enterprise`;else if(e.moduleBased||void 0===e.moduleBased){let r=null==(s=Object.entries(ne).find(([e,i])=>i===t))?void 0:s[0];o=`AG Grid: unable to use ${i} as the ${r} is not registered${e.areGridScopedModules?` for gridId: ${n}`:""}. Check if you have registered the module:\n           \n    import { ModuleRegistry } from '@ag-grid-community/core';\n    import { ${r} } from '${t}';\n    \n    ModuleRegistry.registerModules([ ${r} ]);\n\nFor more info see: https://www.ag-grid.com/javascript-grid/modules/`}else o=`AG Grid: unable to use ${i} as package 'ag-grid-enterprise' has not been imported. Check that you have imported the package:\n            \n    import 'ag-grid-enterprise';`;return U(()=>{console.warn(o)},r),!1}static __isRegistered(t,i){var n;return!!e.globalModulesMap[t]||!!(null==(n=e.gridModulesMap[i])?void 0:n[t])}static __getRegisteredModules(t){return[...D(e.globalModulesMap),...D(e.gridModulesMap[t]||{})]}static __getGridRegisteredModules(t){var i;return D(null!=(i=e.gridModulesMap[t])?i:{})||[]}static __isPackageBased(){return!e.moduleBased}};se.globalModulesMap={},se.gridModulesMap={},se.areGridScopedModules=!1;var re=se,oe=class{constructor(e,t){if(this.beanWrappers={},this.destroyed=!1,!e||!e.beanClasses)return;this.contextParams=e,this.logger=t,this.logger.log(">> creating ag-Application Context"),this.createBeans();const i=this.getBeanInstances();this.wireBeans(i),this.logger.log(">> ag-Application Context ready - component is alive")}getBeanInstances(){return D(this.beanWrappers).map(e=>e.beanInstance)}createBean(e,t){if(!e)throw Error("Can't wire to bean since it is null");return this.wireBeans([e],t),e}wireBeans(e,t){this.autoWireBeans(e),this.methodWireBeans(e),this.callLifeCycleMethods(e,"preConstructMethods"),b(t)&&e.forEach(t),this.callLifeCycleMethods(e,"postConstructMethods")}createBeans(){this.contextParams.beanClasses.forEach(this.createBeanWrapper.bind(this)),P(this.beanWrappers,(e,t)=>{let i;t.bean.__agBeanMetaData&&t.bean.__agBeanMetaData.autowireMethods&&t.bean.__agBeanMetaData.autowireMethods.agConstructor&&(i=t.bean.__agBeanMetaData.autowireMethods.agConstructor);const n=this.getBeansForParameters(i,t.bean.name),s=new(t.bean.bind.apply(t.bean,[null,...n]));t.beanInstance=s});const e=Object.keys(this.beanWrappers).join(", ");this.logger.log(`created beans: ${e}`)}createBeanWrapper(e){const t=e.__agBeanMetaData;if(!t){let t;return t=e.prototype.constructor?j(e.prototype.constructor):""+e,void console.error(`Context item ${t} is not a bean`)}const i={bean:e,beanInstance:null,beanName:t.beanName};this.beanWrappers[t.beanName]=i}autoWireBeans(e){e.forEach(e=>{this.forEachMetaDataInHierarchy(e,(t,i)=>{const n=t.agClassAttributes;n&&n.forEach(t=>{const n=this.lookupBeanInstance(i,t.beanName,t.optional);e[t.attributeName]=n})})})}methodWireBeans(e){e.forEach(e=>{this.forEachMetaDataInHierarchy(e,(t,i)=>{P(t.autowireMethods,(t,n)=>{if("agConstructor"===t)return;const s=this.getBeansForParameters(n,i);e[t].apply(e,s)})})})}forEachMetaDataInHierarchy(e,t){let i=Object.getPrototypeOf(e);for(;null!=i;){const e=i.constructor;e.hasOwnProperty("__agBeanMetaData")&&t(e.__agBeanMetaData,this.getBeanName(e)),i=Object.getPrototypeOf(i)}}getBeanName(e){if(e.__agBeanMetaData&&e.__agBeanMetaData.beanName)return e.__agBeanMetaData.beanName;const t=e.toString();return t.substring(9,t.indexOf("("))}getBeansForParameters(e,t){const i=[];return e&&P(e,(e,n)=>{const s=this.lookupBeanInstance(t,n);i[Number(e)]=s}),i}lookupBeanInstance(e,t,i=!1){if(this.destroyed)return this.logger.log(`AG Grid: bean reference ${t} is used after the grid is destroyed!`),null;if("context"===t)return this;if(this.contextParams.providedBeanInstances&&this.contextParams.providedBeanInstances.hasOwnProperty(t))return this.contextParams.providedBeanInstances[t];const n=this.beanWrappers[t];return n?n.beanInstance:(i||console.error(`AG Grid: unable to find bean reference ${t} while initialising ${e}`),null)}callLifeCycleMethods(e,t){e.forEach(e=>this.callLifeCycleMethodsOnBean(e,t))}callLifeCycleMethodsOnBean(e,t,i){const n={};this.forEachMetaDataInHierarchy(e,e=>{const s=e[t];s&&s.forEach(e=>{e!=i&&(n[e]=!0)})}),Object.keys(n).forEach(t=>e[t]())}getBean(e){return this.lookupBeanInstance("getBean",e,!0)}destroy(){if(this.destroyed)return;this.destroyed=!0,this.logger.log(">> Shutting down ag-Application Context");const e=this.getBeanInstances();this.destroyBeans(e),this.contextParams.providedBeanInstances=null,re.__unRegisterGridModules(this.contextParams.gridId),this.logger.log(">> ag-Application Context shut down - component is dead")}destroyBean(e){e&&this.destroyBeans([e])}destroyBeans(e){return e?(e.forEach(e=>{this.callLifeCycleMethodsOnBean(e,"preDestroyMethods","destroy");const t=e;"function"==typeof t.destroy&&t.destroy()}),[]):[]}isDestroyed(){return this.destroyed}getGridId(){return this.contextParams.gridId}};function ae(e,t,i){const n=fe(e.constructor);n.preConstructMethods||(n.preConstructMethods=[]),n.preConstructMethods.push(t)}function le(e,t,i){const n=fe(e.constructor);n.postConstructMethods||(n.postConstructMethods=[]),n.postConstructMethods.push(t)}function ce(e,t,i){const n=fe(e.constructor);n.preDestroyMethods||(n.preDestroyMethods=[]),n.preDestroyMethods.push(t)}function he(e){return t=>{fe(t).beanName=e}}function ue(e){return(t,i,n)=>{pe(t,e,!1,0,i,null)}}function de(e){return(t,i,n)=>{pe(t,e,!0,0,i,null)}}function pe(e,t,i,n,s,r){if(null===t)return void console.error("AG Grid: Autowired name should not be null");if("number"==typeof r)return void console.error("AG Grid: Autowired should be on an attribute");const o=fe(e.constructor);o.agClassAttributes||(o.agClassAttributes=[]),o.agClassAttributes.push({attributeName:s,beanName:t,optional:i})}function ge(e){return(t,i,n)=>{const s="function"==typeof t?t:t.constructor;let r;if("number"==typeof n){let t;i?(r=fe(s),t=i):(r=fe(s),t="agConstructor"),r.autowireMethods||(r.autowireMethods={}),r.autowireMethods[t]||(r.autowireMethods[t]={}),r.autowireMethods[t][n]=e}}}function fe(e){return e.hasOwnProperty("__agBeanMetaData")||(e.__agBeanMetaData={}),e.__agBeanMetaData}var me=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(e,t,i=null,n=null){if(this.frameworkOverrides=t,this.gos=e,i){const t=e.useAsyncEvents();this.addGlobalListener(i,t)}n&&this.addGlobalListener(n,!1)}setFrameworkOverrides(e){this.frameworkOverrides=e}getListeners(e,t,i){const n=t?this.allAsyncListeners:this.allSyncListeners;let s=n.get(e);return!s&&i&&(s=new Set,n.set(e,s)),s}noRegisteredListenersExist(){return 0===this.allSyncListeners.size&&0===this.allAsyncListeners.size&&0===this.globalSyncListeners.size&&0===this.globalAsyncListeners.size}addEventListener(e,t,i=!1){this.getListeners(e,i,!0).add(t)}removeEventListener(e,t,i=!1){const n=this.getListeners(e,i,!1);n&&(n.delete(t),0===n.size)&&(i?this.allAsyncListeners:this.allSyncListeners).delete(e)}addGlobalListener(e,t=!1){(t?this.globalAsyncListeners:this.globalSyncListeners).add(e)}removeGlobalListener(e,t=!1){(t?this.globalAsyncListeners:this.globalSyncListeners).delete(e)}dispatchEvent(e){let t=e;this.gos&&this.gos.addGridCommonParams(t),this.dispatchToListeners(t,!0),this.dispatchToListeners(t,!1),this.firedEvents[t.type]=!0}dispatchEventOnce(e){this.firedEvents[e.type]||this.dispatchEvent(e)}dispatchToListeners(e,t){var i;const n=e.type;if(t&&"event"in e){const t=e.event;t instanceof Event&&(e.eventPath=t.composedPath())}const s=null!=(i=this.getListeners(n,t,!1))?i:new Set,r=new Set(s);r.size>0&&((i,n)=>{i.forEach(i=>{if(!n.has(i))return;const s=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming(()=>i(e)):()=>i(e);t?this.dispatchAsync(s):s()})})(r,s),new Set(t?this.globalAsyncListeners:this.globalSyncListeners).forEach(i=>{const s=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming(()=>i(n,e)):()=>i(n,e);t?this.dispatchAsync(s):s()})}dispatchAsync(e){this.asyncFunctionsQueue.push(e),this.scheduled||(this.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(this.flushAsyncQueue.bind(this),0)}),this.scheduled=!0)}flushAsyncQueue(){this.scheduled=!1;const e=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[],e.forEach(e=>e())}};f([m(0,ge("gridOptionsService")),m(1,ge("frameworkOverrides")),m(2,ge("globalEventListener")),m(3,ge("globalSyncEventListener"))],me.prototype,"setBeans",1),me=f([he("eventService")],me);var ye=class{constructor(e){this.frameworkOverrides=e,this.wrappedListeners=new Map,this.wrappedGlobalListeners=new Map}wrap(e){let t=e;return this.frameworkOverrides.shouldWrapOutgoing&&(t=t=>{this.frameworkOverrides.wrapOutgoing(()=>e(t))},this.wrappedListeners.set(e,t)),t}wrapGlobal(e){let t=e;return this.frameworkOverrides.shouldWrapOutgoing&&(t=(t,i)=>{this.frameworkOverrides.wrapOutgoing(()=>e(t,i))},this.wrappedGlobalListeners.set(e,t)),t}unwrap(e){var t;return null!=(t=this.wrappedListeners.get(e))?t:e}unwrapGlobal(e){var t;return null!=(t=this.wrappedGlobalListeners.get(e))?t:e}},ve={resizable:!0,sortable:!0},be=0;function Ce(){return be++}var we=class e{constructor(e,t,i,n){this.instanceId=Ce(),this.autoHeaderHeight=null,this.moving=!1,this.menuVisible=!1,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.filterActive=!1,this.eventService=new me,this.tooltipEnabled=!1,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.colDef=e,this.userProvidedColDef=t,this.colId=i,this.primary=n,this.setState(e)}getInstanceId(){return this.instanceId}setState(e){void 0!==e.sort?"asc"!==e.sort&&"desc"!==e.sort||(this.sort=e.sort):"asc"!==e.initialSort&&"desc"!==e.initialSort||(this.sort=e.initialSort);const t=e.sortIndex,i=e.initialSortIndex;void 0!==t?null!==t&&(this.sortIndex=t):null!==i&&(this.sortIndex=i);const n=e.hide,s=e.initialHide;this.visible=void 0!==n?!n:!s,void 0!==e.pinned?this.setPinned(e.pinned):this.setPinned(e.initialPinned);const r=e.flex,o=e.initialFlex;void 0!==r?this.flex=r:void 0!==o&&(this.flex=o)}setColDef(e,t,i){this.colDef=e,this.userProvidedColDef=t,this.initMinAndMaxWidths(),this.initDotNotation(),this.initTooltip(),this.eventService.dispatchEvent(this.createColumnEvent("colDefChanged",i))}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=b(this.colDef.field)&&this.colDef.field.indexOf(".")>=0&&!e,this.tooltipFieldContainsDots=b(this.colDef.tooltipField)&&this.colDef.tooltipField.indexOf(".")>=0&&!e}initMinAndMaxWidths(){var e,t;const i=this.colDef;this.minWidth=null!=(e=i.minWidth)?e:this.environment.getMinColWidth(),this.maxWidth=null!=(t=i.maxWidth)?t:Number.MAX_SAFE_INTEGER}initTooltip(){this.tooltipEnabled=b(this.colDef.tooltipField)||b(this.colDef.tooltipValueGetter)||b(this.colDef.tooltipComponent)}resetActualWidth(e){const t=this.calculateColInitialWidth(this.colDef);this.setActualWidth(t,e,!0)}calculateColInitialWidth(e){var t,i;const n=null!=(t=e.minWidth)?t:this.environment.getMinColWidth(),s=null!=(i=e.maxWidth)?i:Number.MAX_SAFE_INTEGER;let r;const o=x(e.width),a=x(e.initialWidth);return r=null!=o?o:null!=a?a:200,Math.max(Math.min(r,s),n)}isEmptyGroup(){return!1}isRowGroupDisplayed(e){if(C(this.colDef)||C(this.colDef.showRowGroup))return!1;const t=!0===this.colDef.showRowGroup,i=this.colDef.showRowGroup===e;return t||i}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 i,n;this.frameworkOverrides.shouldWrapOutgoing&&!this.frameworkEventListenerService&&(this.eventService.setFrameworkOverrides(this.frameworkOverrides),this.frameworkEventListenerService=new ye(this.frameworkOverrides));const s=null!=(n=null==(i=this.frameworkEventListenerService)?void 0:i.wrap(t))?n:t;this.eventService.addEventListener(e,s)}removeEventListener(e,t){var i,n;const s=null!=(n=null==(i=this.frameworkEventListenerService)?void 0:i.unwrap(t))?n:t;this.eventService.removeEventListener(e,s)}createColumnFunctionCallbackParams(e){return this.gos.addGridCommonParams({node:e,data:e.data,column:this,colDef:this.colDef})}isSuppressNavigable(e){if("boolean"==typeof this.colDef.suppressNavigable)return this.colDef.suppressNavigable;if("function"==typeof this.colDef.suppressNavigable){const t=this.createColumnFunctionCallbackParams(e);return(0,this.colDef.suppressNavigable)(t)}return!1}isCellEditable(e){return!(e.group&&!this.gos.get("enableGroupEdit"))&&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 null!=(t=this.colDef[e])?t:ve[e]}isColumnFunc(e,t){return"boolean"==typeof t?t:"function"==typeof t&&t(this.createColumnFunctionCallbackParams(e))}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"asc"===this.sort}isSortDescending(){return"desc"===this.sort}isSortNone(){return C(this.sort)}isSorting(){return b(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,i){this.filterActive!==e&&(this.filterActive=e,this.eventService.dispatchEvent(this.createColumnEvent("filterActiveChanged",t)));const n=this.createColumnEvent("filterChanged",t);i&&O(n,i),this.eventService.dispatchEvent(n)}isHovered(){return this.columnHoverService.isHovered(this)}setPinned(e){this.pinned=!0===e||"left"===e?"left":"right"===e?"right":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"left"===this.pinned||"right"===this.pinned}isPinnedLeft(){return"left"===this.pinned}isPinnedRight(){return"right"===this.pinned}getPinned(){return this.pinned}setVisible(e,t){const i=!0===e;this.visible!==i&&(this.visible=i,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 i=!0;for(;e;){if(!e.isPadding()){i=!1;break}e=e.getParent()}return{numberOfParents:t,isSpanningTotal:i}}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(C(this.colDef.colSpan))return 1;const t=this.createBaseColDefParams(e),i=this.colDef.colSpan(t);return Math.max(i,1)}getRowSpan(e){if(C(this.colDef.rowSpan))return 1;const t=this.createBaseColDefParams(e),i=this.colDef.rowSpan(t);return Math.max(i,1)}setActualWidth(e,t,i=!1){null!=this.minWidth&&(e=Math.max(e,this.minWidth)),null!=this.maxWidth&&(e=Math.min(e,this.maxWidth)),this.actualWidth!==e&&(this.actualWidth=e,this.flex&&"flex"!==t&&"gridInitializing"!==t&&(this.flex=null),i||this.fireColumnWidthChangedEvent(t)),this.dispatchStateUpdatedEvent("width")}fireColumnWidthChangedEvent(e){this.eventService.dispatchEvent(this.createColumnEvent("widthChanged",e))}isGreaterThanMax(e){return null!=this.maxWidth&&e>this.maxWidth}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){b(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!0===this.colDef.enablePivot}isAllowValue(){return!0===this.colDef.enableValue}isAllowRowGroup(){return!0===this.colDef.enableRowGroup}getMenuTabs(e){z("As of v31.1, 'getMenuTabs' is deprecated. Use 'getColDef().menuTabs ?? defaultValues' instead.");let t=this.getColDef().menuTabs;return null==t&&(t=e),t}dispatchStateUpdatedEvent(t){this.eventService.dispatchEvent({type:e.EVENT_STATE_UPDATED,key:t})}};we.EVENT_MOVING_CHANGED="movingChanged",we.EVENT_LEFT_CHANGED="leftChanged",we.EVENT_WIDTH_CHANGED="widthChanged",we.EVENT_LAST_LEFT_PINNED_CHANGED="lastLeftPinnedChanged",we.EVENT_FIRST_RIGHT_PINNED_CHANGED="firstRightPinnedChanged",we.EVENT_VISIBLE_CHANGED="visibleChanged",we.EVENT_FILTER_CHANGED="filterChanged",we.EVENT_FILTER_ACTIVE_CHANGED="filterActiveChanged",we.EVENT_SORT_CHANGED="sortChanged",we.EVENT_COL_DEF_CHANGED="colDefChanged",we.EVENT_MENU_VISIBLE_CHANGED="menuVisibleChanged",we.EVENT_ROW_GROUP_CHANGED="columnRowGroupChanged",we.EVENT_PIVOT_CHANGED="columnPivotChanged",we.EVENT_VALUE_CHANGED="columnValueChanged",we.EVENT_STATE_UPDATED="columnStateUpdated",f([ue("gridOptionsService")],we.prototype,"gos",2),f([ue("environment")],we.prototype,"environment",2),f([ue("columnHoverService")],we.prototype,"columnHoverService",2),f([ue("frameworkOverrides")],we.prototype,"frameworkOverrides",2),f([le],we.prototype,"initialise",1);var Se=we,xe=class e{constructor(e,t,i,n){this.localEventService=new me,this.expandable=!1,this.instanceId=Ce(),this.expandableListenerRemoveCallback=null,this.colGroupDef=e,this.groupId=t,this.expanded=!!e&&!!e.openByDefault,this.padding=i,this.level=n}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())}isPadding(){return this.padding}setExpanded(t){this.expanded=void 0!==t&&t;const i={type:e.EVENT_EXPANDED_CHANGED};this.localEventService.dispatchEvent(i)}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(t){this.children&&this.children.forEach(i=>{i instanceof Se?t.push(i):i instanceof e&&i.addLeafColumns(t)})}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 t=!1,i=!1,n=!1;const s=this.findChildrenRemovingPadding();for(let e=0,r=s.length;e<r;e++){const r=s[e];if(!r.isVisible())continue;const o=r.getColumnGroupShow();"open"===o?(t=!0,n=!0):"closed"===o?(i=!0,n=!0):(t=!0,i=!0)}const r=t&&i&&n;if(this.expandable!==r){this.expandable=r;const t={type:e.EVENT_EXPANDABLE_CHANGED};this.localEventService.dispatchEvent(t)}}findChildrenRemovingPadding(){const t=[],i=n=>{n.forEach(n=>{n instanceof e&&n.isPadding()?i(n.children):t.push(n)})};return i(this.children),t}onColumnVisibilityChanged(){this.setExpandable()}addEventListener(e,t){this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService.removeEventListener(e,t)}};xe.EVENT_EXPANDED_CHANGED="expandedChanged",xe.EVENT_EXPANDABLE_CHANGED="expandableChanged",f([ce],xe.prototype,"destroy",1);var Ee=xe,Ae={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}},Me={};g(Me,{addSafePassiveEventListener:()=>it,createEventPath:()=>et,getCtrlForEventTarget:()=>Qe,getEventPath:()=>tt,isElementInEventPath:()=>Je,isEventSupported:()=>Ze,isStopPropagationForAgGrid:()=>Xe,stopPropagationForAgGrid:()=>qe});var Te={};function De(e){return null!=e&&e.length>0}function Ie(e){if(e&&e.length)return e[e.length-1]}function Re(e,t,i){return null==e&&null==t||null!=e&&null!=t&&e.length===t.length&&e.every((e,n)=>i?i(e,t[n]):t[n]===e)}function ke(e,t){return Re(e,t)}function Pe(e){return e.sort((e,t)=>e-t)}function _e(e,t){if(e)for(let i=e.length-2;i>=0;i--){const n=e[i]===t,s=e[i+1]===t;n&&s&&e.splice(i+1,1)}}function Le(e,t){const i=e.indexOf(t);i>=0&&(e[i]=e[e.length-1],e.pop())}function Ne(e,t){const i=e.indexOf(t);i>=0&&e.splice(i,1)}function Oe(e,t){for(let i=0;i<t.length;i++)Le(e,t[i])}function Fe(e,t){for(let i=0;i<t.length;i++)Ne(e,t[i])}function Ge(e,t,i){e.splice(i,0,t)}function Be(e,t,i){if(null!=e&&null!=t)for(let n=t.length-1;n>=0;n--)Ge(e,t[n],i)}function Ve(e,t,i){Fe(e,t),t.slice().reverse().forEach(t=>Ge(e,t,i))}function He(e,t){return e.indexOf(t)>-1}function Ue(e){return[].concat.apply([],e)}function ze(e,t){null!=t&&null!=e&&t.forEach(t=>e.push(t))}function We(e){return e.map(S)}function je(e,t){if(null!=e)for(let i=e.length-1;i>=0;i--)t(e[i],i)}g(Te,{areEqual:()=>Re,existsAndNotEmpty:()=>De,flatten:()=>Ue,forEachReverse:()=>je,includes:()=>He,insertArrayIntoArray:()=>Be,insertIntoArray:()=>Ge,last:()=>Ie,moveInArray:()=>Ve,pushAll:()=>ze,removeAllFromArray:()=>Fe,removeAllFromUnorderedArray:()=>Oe,removeFromArray:()=>Ne,removeFromUnorderedArray:()=>Le,removeRepeatsFromArray:()=>_e,shallowCompare:()=>ke,sortNumerically:()=>Pe,toStrings:()=>We});var $e="__ag_Grid_Stop_Propagation",Ke=["touchstart","touchend","touchmove","touchcancel","scroll"],Ye={};function qe(e){e[$e]=!0}function Xe(e){return!0===e[$e]}var Ze=(()=>{const e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return t=>{if("boolean"==typeof Ye[t])return Ye[t];const i=document.createElement(e[t]||"div");return Ye[t="on"+t]=t in i}})();function Qe(e,t,i){let n=t;for(;n;){const t=e.getDomData(n,i);if(t)return t;n=n.parentElement}return null}function Je(e,t){return!(!t||!e)&&tt(t).indexOf(e)>=0}function et(e){const t=[];let i=e.target;for(;i;)t.push(i),i=i.parentElement;return t}function tt(e){const t=e;return t.path?t.path:t.composedPath?t.composedPath():et(t)}function it(e,t,i,n){const s=He(Ke,i)?{passive:!0}:void 0;e&&e.addEventListener&&e.addEventListener(t,i,n,s)}var nt=class e{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:e.EVENT_DESTROYED})}addEventListener(e,t){this.localEventService||(this.localEventService=new me),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,i){if(this.destroyed)return;e instanceof HTMLElement?it(this.getFrameworkOverrides(),e,t,i):e.addEventListener(t,i);const n=()=>(e.removeEventListener(t,i),null);return this.destroyFunctions.push(n),()=>(n(),this.destroyFunctions=this.destroyFunctions.filter(e=>e!==n),null)}setupGridOptionListener(e,t){this.gos.addEventListener(e,t);const i=()=>(this.gos.removeEventListener(e,t),null);return this.destroyFunctions.push(i),()=>(i(),this.destroyFunctions=this.destroyFunctions.filter(e=>e!==i),null)}addManagedPropertyListener(e,t){return this.destroyed?()=>null:this.setupGridOptionListener(e,t)}addManagedPropertyListeners(e,t){if(this.destroyed)return;const i=e.join("-")+this.propertyListenerId++,n=e=>{if(e.changeSet){if(e.changeSet&&e.changeSet.id===this.lastChangeSetIdLookup[i])return;this.lastChangeSetIdLookup[i]=e.changeSet.id}const n={type:"gridPropertyChanged",changeSet:e.changeSet,source:e.source};t(n)};e.forEach(e=>this.setupGridOptionListener(e,n))}addDestroyFunc(e){this.isAlive()?this.destroyFunctions.push(e):e()}createManagedBean(e,t){const i=this.createBean(e,t);return this.addDestroyFunc(this.destroyBean.bind(this,e,t)),i}createBean(e,t,i){return(t||this.getContext()).createBean(e,i)}destroyBean(e,t){return(t||this.getContext()).destroyBean(e)}destroyBeans(e,t){if(e)for(let i=0;i<e.length;i++)this.destroyBean(e[i],t);return[]}};nt.EVENT_DESTROYED="destroyed",f([ue("frameworkOverrides")],nt.prototype,"frameworkOverrides",2),f([ue("context")],nt.prototype,"context",2),f([ue("eventService")],nt.prototype,"eventService",2),f([ue("gridOptionsService")],nt.prototype,"gos",2),f([ue("localeService")],nt.prototype,"localeService",2),f([ue("environment")],nt.prototype,"environment",2),f([ce],nt.prototype,"destroy",1);var st=nt,rt=class extends st{setBeans(e){this.logger=e.create("ColumnFactory")}createColumnTree(e,t,i,n){const s=new I,{existingCols:r,existingGroups:o,existingColKeys:a}=this.extractExistingTreeData(i);s.addExistingKeys(a);const l=this.recursivelyCreateColumns(e,0,t,r,s,o,n),c=this.findMaxDept(l,0);this.logger.log("Number of levels for grouped columns is "+c);const h=this.balanceColumnTree(l,0,c,s);return ot(null,h,(e,t)=>{e instanceof Ee&&e.setupExpandable(),e.setOriginalParent(t)}),{columnTree:h,treeDept:c}}extractExistingTreeData(e){const t=[],i=[],n=[];return e&&ot(null,e,e=>{if(e instanceof Ee){const t=e;i.push(t)}else{const i=e;n.push(i.getId()),t.push(i)}}),{existingCols:t,existingGroups:i,existingColKeys:n}}createForAutoGroups(e,t){return e.map(e=>this.createAutoGroupTreeItem(t,e))}createAutoGroupTreeItem(e,t){const i=this.findDepth(e);let n=t;for(let e=i-1;e>=0;e--){const i=new Ee(null,`FAKE_PATH_${t.getId()}}_${e}`,!0,e);this.createBean(i),i.setChildren([n]),n.setOriginalParent(i),n=i}return 0===i&&t.setOriginalParent(null),n}findDepth(e){let t=0,i=e;for(;i&&i[0]&&i[0]instanceof Ee;)t++,i=i[0].getChildren();return t}balanceColumnTree(e,t,i,n){const s=[];for(let r=0;r<e.length;r++){const o=e[r];if(o instanceof Ee){const e=o,r=this.balanceColumnTree(e.getChildren(),t+1,i,n);e.setChildren(r),s.push(e)}else{let r,a;for(let e=i-1;e>=t;e--){const e=n.getUniqueKey(null,null),i=this.createMergedColGroupDef(null),s=new Ee(i,e,!0,t);this.createBean(s),a&&a.setChildren([s]),a=s,r||(r=a)}if(r&&a){if(s.push(r),e.some(e=>e instanceof Ee)){a.setChildren([o]);continue}a.setChildren(e);break}s.push(o)}}return s}findMaxDept(e,t){let i=t;for(let n=0;n<e.length;n++){const s=e[n];if(s instanceof Ee){const e=s,n=this.findMaxDept(e.getChildren(),t+1);i<n&&(i=n)}}return i}recursivelyCreateColumns(e,t,i,n,s,r,o){if(!e)return[];const a=new Array(e.length);for(let l=0;l<a.length;l++){const c=e[l];this.isColumnGroup(c)?a[l]=this.createColumnGroup(i,c,t,n,s,r,o):a[l]=this.createColumn(i,c,n,s,o)}return a}createColumnGroup(e,t,i,n,s,r,o){const a=this.createMergedColGroupDef(t),l=s.getUniqueKey(a.groupId||null,null),c=new Ee(a,l,!1,i);this.createBean(c);const h=this.findExistingGroup(t,r);h&&r.splice(h.idx,1);let u=null==h?void 0:h.group;u&&c.setExpanded(u.isExpanded());const d=this.recursivelyCreateColumns(a.children,i+1,e,n,s,r,o);return c.setChildren(d),c}createMergedColGroupDef(e){const t={};return Object.assign(t,this.gos.get("defaultColGroupDef")),Object.assign(t,e),t}createColumn(e,t,i,n,s){const r=this.findExistingColumn(t,i);r&&(null==i||i.splice(r.idx,1));let o=null==r?void 0:r.column;if(o){const e=this.addColumnDefaultAndTypes(t,o.getColId());o.setColDef(e,t,s),this.applyColumnState(o,e,s)}else{const i=n.getUniqueKey(t.colId,t.field),s=this.addColumnDefaultAndTypes(t,i);o=new Se(s,t,i,e),this.context.createBean(o)}return this.dataTypeService.addColumnListeners(o),o}applyColumnState(e,t,i){const n=x(t.flex);if(void 0!==n&&e.setFlex(n),e.getFlex()<=0){const n=x(t.width);if(null!=n)e.setActualWidth(n,i);else{const t=e.getActualWidth();e.setActualWidth(t,i)}}void 0!==t.sort&&("asc"==t.sort||"desc"==t.sort?e.setSort(t.sort,i):e.setSort(void 0,i));const s=x(t.sortIndex);void 0!==s&&e.setSortIndex(s);const r=E(t.hide);void 0!==r&&e.setVisible(!r,i),void 0!==t.pinned&&e.setPinned(t.pinned)}findExistingColumn(e,t){if(t)for(let i=0;i<t.length;i++){const n=t[i].getUserProvidedColDef();if(n)if(null==e.colId){if(null!=e.field){if(n.field===e.field)return{idx:i,column:t[i]}}else if(n===e)return{idx:i,column:t[i]}}else if(t[i].getId()===e.colId)return{idx:i,column:t[i]}}}findExistingGroup(e,t){if(null!=e.groupId)for(let i=0;i<t.length;i++){const n=t[i];if(n.getColGroupDef()&&n.getId()===e.groupId)return{idx:i,group:n}}}addColumnDefaultAndTypes(e,t){const i={};O(i,this.gos.get("defaultColDef"),!1,!0);const n=this.dataTypeService.updateColDefAndGetColumnType(i,e,t);n&&this.assignColumnTypes(n,i),O(i,e,!1,!0);const s=this.gos.get("autoGroupColumnDef"),r=this.gos.isColumnsSortingCoupledToGroup();return e.rowGroup&&s&&r&&O(i,{sort:s.sort,initialSort:s.initialSort},!1,!0),this.dataTypeService.validateColDef(i),i}assignColumnTypes(e,t){if(!e.length)return;const i=Object.assign({},Ae);P(this.gos.get("columnTypes")||{},(e,t)=>{e in i?console.warn(`AG Grid: the column type '${e}' is a default column type and cannot be overridden.`):(t.type&&z("Column type definitions 'columnTypes' with a 'type' attribute are not supported because a column type cannot refer to another column type. Only column definitions 'columnDefs' can use the 'type' attribute to refer to a column type."),i[e]=t)}),e.forEach(e=>{const n=i[e.trim()];n?O(t,n,!1,!0):console.warn("AG Grid: colDef.type '"+e+"' does not correspond to defined gridOptions.columnTypes")})}isColumnGroup(e){return void 0!==e.children}};function ot(e,t,i){if(t)for(let n=0;n<t.length;n++){const s=t[n];s instanceof Ee&&ot(s,s.getChildren(),i),i(s,e)}}f([ue("dataTypeService")],rt.prototype,"dataTypeService",2),f([m(0,ge("loggerFactory"))],rt.prototype,"setBeans",1),rt=f([he("columnFactory")],rt);var at=class e{constructor(e,t,i,n){this.displayedChildren=[],this.localEventService=new me,this.groupId=t,this.partId=i,this.providedColumnGroup=e,this.pinned=n}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 e.createUniqueId(this.groupId,this.partId)}isEmptyGroup(){return 0===this.displayedChildren.length}isMoving(){const e=this.getProvidedColumnGroup().getLeafColumns();return!(!e||0===e.length)&&e.every(e=>e.isMoving())}checkLeft(){if(this.displayedChildren.forEach(t=>{t instanceof e&&t.checkLeft()}),this.displayedChildren.length>0)if(this.gos.get("enableRtl")){const e=Ie(this.displayedChildren).getLeft();this.setLeft(e)}else{const e=this.displayedChildren[0].getLeft();this.setLeft(e)}else this.setLeft(null)}getLeft(){return this.left}getOldLeft(){return this.oldLeft}setLeft(t){this.oldLeft=this.left,this.left!==t&&(this.left=t,this.localEventService.dispatchEvent(this.createAgEvent(e.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(t){let i=!1;return this.children.forEach(n=>{t===n&&(i=!0),n instanceof e&&n.isChildInThisGroupDeepSearch(t)&&(i=!0)}),i}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(t){this.displayedChildren.forEach(i=>{i instanceof Se?t.push(i):i instanceof e&&i.addDisplayedLeafColumns(t)})}addLeafColumns(t){this.children.forEach(i=>{i instanceof Se?t.push(i):i instanceof e&&i.addLeafColumns(t)})}getChildren(){return this.children}getColumnGroupShow(){return this.providedColumnGroup.getColumnGroupShow()}getProvidedColumnGroup(){return this.providedColumnGroup}getPaddingLevel(){const e=this.getParent();return this.isPadding()&&e&&e.isPadding()?1+e.getPaddingLevel():0}calculateDisplayedColumns(){this.displayedChildren=[];let t=this;for(;null!=t&&t.isPadding();)t=t.getParent();if(!t||!t.providedColumnGroup.isExpandable())return this.displayedChildren=this.children,void this.localEventService.dispatchEvent(this.createAgEvent(e.EVENT_DISPLAYED_CHILDREN_CHANGED));this.children.forEach(i=>{if(!(i instanceof e)||i.displayedChildren&&i.displayedChildren.length)switch(i.getColumnGroupShow()){case"open":t.providedColumnGroup.isExpanded()&&this.displayedChildren.push(i);break;case"closed":t.providedColumnGroup.isExpanded()||this.displayedChildren.push(i);break;default:this.displayedChildren.push(i)}}),this.localEventService.dispatchEvent(this.createAgEvent(e.EVENT_DISPLAYED_CHILDREN_CHANGED))}};at.EVENT_LEFT_CHANGED="leftChanged",at.EVENT_DISPLAYED_CHILDREN_CHANGED="displayedChildrenChanged",f([ue("gridOptionsService")],at.prototype,"gos",2);var lt=at,ct=class{};ct.EVENT_COLUMN_EVERYTHING_CHANGED="columnEverythingChanged",ct.EVENT_NEW_COLUMNS_LOADED="newColumnsLoaded",ct.EVENT_COLUMN_PIVOT_MODE_CHANGED="columnPivotModeChanged",ct.EVENT_PIVOT_MAX_COLUMNS_EXCEEDED="pivotMaxColumnsExceeded",ct.EVENT_COLUMN_ROW_GROUP_CHANGED="columnRowGroupChanged",ct.EVENT_EXPAND_COLLAPSE_ALL="expandOrCollapseAll",ct.EVENT_COLUMN_PIVOT_CHANGED="columnPivotChanged",ct.EVENT_GRID_COLUMNS_CHANGED="gridColumnsChanged",ct.EVENT_COLUMN_VALUE_CHANGED="columnValueChanged",ct.EVENT_COLUMN_MOVED="columnMoved",ct.EVENT_COLUMN_VISIBLE="columnVisible",ct.EVENT_COLUMN_PINNED="columnPinned",ct.EVENT_COLUMN_GROUP_OPENED="columnGroupOpened",ct.EVENT_COLUMN_RESIZED="columnResized",ct.EVENT_DISPLAYED_COLUMNS_CHANGED="displayedColumnsChanged",ct.EVENT_SUPPRESS_COLUMN_MOVE_CHANGED="suppressMovableColumns",ct.EVENT_SUPPRESS_MENU_HIDE_CHANGED="suppressMenuHide",ct.EVENT_SUPPRESS_FIELD_DOT_NOTATION="suppressFieldDotNotation",ct.EVENT_VIRTUAL_COLUMNS_CHANGED="virtualColumnsChanged",ct.EVENT_COLUMN_HEADER_MOUSE_OVER="columnHeaderMouseOver",ct.EVENT_COLUMN_HEADER_MOUSE_LEAVE="columnHeaderMouseLeave",ct.EVENT_COLUMN_HEADER_CLICKED="columnHeaderClicked",ct.EVENT_COLUMN_HEADER_CONTEXT_MENU="columnHeaderContextMenu",ct.EVENT_ASYNC_TRANSACTIONS_FLUSHED="asyncTransactionsFlushed",ct.EVENT_ROW_GROUP_OPENED="rowGroupOpened",ct.EVENT_ROW_DATA_UPDATED="rowDataUpdated",ct.EVENT_PINNED_ROW_DATA_CHANGED="pinnedRowDataChanged",ct.EVENT_RANGE_SELECTION_CHANGED="rangeSelectionChanged",ct.EVENT_CHART_CREATED="chartCreated",ct.EVENT_CHART_RANGE_SELECTION_CHANGED="chartRangeSelectionChanged",ct.EVENT_CHART_OPTIONS_CHANGED="chartOptionsChanged",ct.EVENT_CHART_DESTROYED="chartDestroyed",ct.EVENT_TOOL_PANEL_VISIBLE_CHANGED="toolPanelVisibleChanged",ct.EVENT_TOOL_PANEL_SIZE_CHANGED="toolPanelSizeChanged",ct.EVENT_COLUMN_PANEL_ITEM_DRAG_START="columnPanelItemDragStart",ct.EVENT_COLUMN_PANEL_ITEM_DRAG_END="columnPanelItemDragEnd",ct.EVENT_MODEL_UPDATED="modelUpdated",ct.EVENT_CUT_START="cutStart",ct.EVENT_CUT_END="cutEnd",ct.EVENT_PASTE_START="pasteStart",ct.EVENT_PASTE_END="pasteEnd",ct.EVENT_FILL_START="fillStart",ct.EVENT_FILL_END="fillEnd",ct.EVENT_RANGE_DELETE_START="rangeDeleteStart",ct.EVENT_RANGE_DELETE_END="rangeDeleteEnd",ct.EVENT_UNDO_STARTED="undoStarted",ct.EVENT_UNDO_ENDED="undoEnded",ct.EVENT_REDO_STARTED="redoStarted",ct.EVENT_REDO_ENDED="redoEnded",ct.EVENT_KEY_SHORTCUT_CHANGED_CELL_START="keyShortcutChangedCellStart",ct.EVENT_KEY_SHORTCUT_CHANGED_CELL_END="keyShortcutChangedCellEnd",ct.EVENT_CELL_CLICKED="cellClicked",ct.EVENT_CELL_DOUBLE_CLICKED="cellDoubleClicked",ct.EVENT_CELL_MOUSE_DOWN="cellMouseDown",ct.EVENT_CELL_CONTEXT_MENU="cellContextMenu",ct.EVENT_CELL_VALUE_CHANGED="cellValueChanged",ct.EVENT_CELL_EDIT_REQUEST="cellEditRequest",ct.EVENT_ROW_VALUE_CHANGED="rowValueChanged",ct.EVENT_CELL_FOCUSED="cellFocused",ct.EVENT_CELL_FOCUS_CLEARED="cellFocusCleared",ct.EVENT_FULL_WIDTH_ROW_FOCUSED="fullWidthRowFocused",ct.EVENT_ROW_SELECTED="rowSelected",ct.EVENT_SELECTION_CHANGED="selectionChanged",ct.EVENT_TOOLTIP_SHOW="tooltipShow",ct.EVENT_TOOLTIP_HIDE="tooltipHide",ct.EVENT_CELL_KEY_DOWN="cellKeyDown",ct.EVENT_CELL_MOUSE_OVER="cellMouseOver",ct.EVENT_CELL_MOUSE_OUT="cellMouseOut",ct.EVENT_FILTER_CHANGED="filterChanged",ct.EVENT_FILTER_MODIFIED="filterModified",ct.EVENT_FILTER_OPENED="filterOpened",ct.EVENT_ADVANCED_FILTER_BUILDER_VISIBLE_CHANGED="advancedFilterBuilderVisibleChanged",ct.EVENT_SORT_CHANGED="sortChanged",ct.EVENT_VIRTUAL_ROW_REMOVED="virtualRowRemoved",ct.EVENT_ROW_CLICKED="rowClicked",ct.EVENT_ROW_DOUBLE_CLICKED="rowDoubleClicked",ct.EVENT_GRID_READY="gridReady",ct.EVENT_GRID_PRE_DESTROYED="gridPreDestroyed",ct.EVENT_GRID_SIZE_CHANGED="gridSizeChanged",ct.EVENT_VIEWPORT_CHANGED="viewportChanged",ct.EVENT_SCROLLBAR_WIDTH_CHANGED="scrollbarWidthChanged",ct.EVENT_FIRST_DATA_RENDERED="firstDataRendered",ct.EVENT_DRAG_STARTED="dragStarted",ct.EVENT_DRAG_STOPPED="dragStopped",ct.EVENT_CHECKBOX_CHANGED="checkboxChanged",ct.EVENT_ROW_EDITING_STARTED="rowEditingStarted",ct.EVENT_ROW_EDITING_STOPPED="rowEditingStopped",ct.EVENT_CELL_EDITING_STARTED="cellEditingStarted",ct.EVENT_CELL_EDITING_STOPPED="cellEditingStopped",ct.EVENT_BODY_SCROLL="bodyScroll",ct.EVENT_BODY_SCROLL_END="bodyScrollEnd",ct.EVENT_HEIGHT_SCALE_CHANGED="heightScaleChanged",ct.EVENT_PAGINATION_CHANGED="paginationChanged",ct.EVENT_COMPONENT_STATE_CHANGED="componentStateChanged",ct.EVENT_STORE_REFRESHED="storeRefreshed",ct.EVENT_STATE_UPDATED="stateUpdated",ct.EVENT_COLUMN_MENU_VISIBLE_CHANGED="columnMenuVisibleChanged",ct.EVENT_CONTEXT_MENU_VISIBLE_CHANGED="contextMenuVisibleChanged",ct.EVENT_BODY_HEIGHT_CHANGED="bodyHeightChanged",ct.EVENT_COLUMN_CONTAINER_WIDTH_CHANGED="columnContainerWidthChanged",ct.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED="displayedColumnsWidthChanged",ct.EVENT_SCROLL_VISIBILITY_CHANGED="scrollVisibilityChanged",ct.EVENT_COLUMN_HOVER_CHANGED="columnHoverChanged",ct.EVENT_FLASH_CELLS="flashCells",ct.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED="paginationPixelOffsetChanged",ct.EVENT_DISPLAYED_ROWS_CHANGED="displayedRowsChanged",ct.EVENT_LEFT_PINNED_WIDTH_CHANGED="leftPinnedWidthChanged",ct.EVENT_RIGHT_PINNED_WIDTH_CHANGED="rightPinnedWidthChanged",ct.EVENT_ROW_CONTAINER_HEIGHT_CHANGED="rowContainerHeightChanged",ct.EVENT_HEADER_HEIGHT_CHANGED="headerHeightChanged",ct.EVENT_COLUMN_HEADER_HEIGHT_CHANGED="columnHeaderHeightChanged",ct.EVENT_ROW_DRAG_ENTER="rowDragEnter",ct.EVENT_ROW_DRAG_MOVE="rowDragMove",ct.EVENT_ROW_DRAG_LEAVE="rowDragLeave",ct.EVENT_ROW_DRAG_END="rowDragEnd",ct.EVENT_GRID_STYLES_CHANGED="gridStylesChanged",ct.EVENT_COLUMN_ROW_GROUP_CHANGE_REQUEST="columnRowGroupChangeRequest",ct.EVENT_COLUMN_PIVOT_CHANGE_REQUEST="columnPivotChangeRequest",ct.EVENT_COLUMN_VALUE_CHANGE_REQUEST="columnValueChangeRequest",ct.EVENT_COLUMN_AGG_FUNC_CHANGE_REQUEST="columnAggFuncChangeRequest",ct.EVENT_STORE_UPDATED="storeUpdated",ct.EVENT_FILTER_DESTROYED="filterDestroyed",ct.EVENT_ROW_DATA_UPDATE_STARTED="rowDataUpdateStarted",ct.EVENT_ROW_COUNT_READY="rowCountReady",ct.EVENT_ADVANCED_FILTER_ENABLED_CHANGED="advancedFilterEnabledChanged",ct.EVENT_DATA_TYPES_INFERRED="dataTypesInferred",ct.EVENT_FIELD_VALUE_CHANGED="fieldValueChanged",ct.EVENT_FIELD_PICKER_VALUE_SELECTED="fieldPickerValueSelected",ct.EVENT_SIDE_BAR_UPDATED="sideBarUpdated";var ht=new Set([ct.EVENT_GRID_PRE_DESTROYED,ct.EVENT_FILL_START]),ut=class{constructor(){this.existingIds={}}getInstanceIdForKey(e){const t=this.existingIds[e];let i;return i="number"!=typeof t?0:t+1,this.existingIds[e]=i,i}},dt="ag-Grid-AutoColumn",pt=class extends st{createAutoGroupColumns(e){const t=[],i=this.gos.get("treeData");let n=this.gos.isGroupMultiAutoColumn();return i&&n&&(console.warn('AG Grid: you cannot mix groupDisplayType = "multipleColumns" with treeData, only one column can be used to display groups when doing tree data'),n=!1),n?e.forEach((e,i)=>{t.push(this.createOneAutoGroupColumn(e,i))}):t.push(this.createOneAutoGroupColumn()),t}updateAutoGroupColumns(e,t){e.forEach((e,i)=>this.updateOneAutoGroupColumn(e,i,t))}createOneAutoGroupColumn(e,t){let i;i=e?`${dt}-${e.getId()}`:dt;const n=this.createAutoGroupColDef(i,e,t);n.colId=i;const s=new Se(n,null,i,!0);return this.context.createBean(s),s}updateOneAutoGroupColumn(e,t,i){const n=e.getColDef(),s="string"==typeof n.showRowGroup?n.showRowGroup:void 0,r=null!=s?this.columnModel.getPrimaryColumn(s):void 0,o=this.createAutoGroupColDef(e.getId(),null!=r?r:void 0,t);e.setColDef(o,null,i),this.columnFactory.applyColumnState(e,o,i)}createAutoGroupColDef(e,t,i){let n=this.createBaseColDef(t);O(n,this.gos.get("autoGroupColumnDef")),n=this.columnFactory.addColumnDefaultAndTypes(n,e),this.gos.get("treeData")||C(n.field)&&C(n.valueGetter)&&C(n.filterValueGetter)&&"agGroupColumnFilter"!==n.filter&&(n.filter=!1),i&&i>0&&(n.headerCheckboxSelection=!1);const s=this.gos.isColumnsSortingCoupledToGroup(),r=n.valueGetter||null!=n.field;return s&&!r&&(n.sortIndex=void 0,n.initialSort=void 0),n}createBaseColDef(e){const t=this.gos.get("autoGroupColumnDef"),i={headerName:this.localeService.getLocaleTextFunc()("group","Group")};if(t&&(t.cellRenderer||t.cellRendererSelector)||(i.cellRenderer="agGroupCellRenderer"),e){const t=e.getColDef();Object.assign(i,{headerName:this.columnModel.getDisplayNameForColumn(e,"header"),headerValueGetter:t.headerValueGetter}),t.cellRenderer&&Object.assign(i,{cellRendererParams:{innerRenderer:t.cellRenderer,innerRendererParams:t.cellRendererParams}}),i.showRowGroup=e.getColId()}else i.showRowGroup=!0;return i}};f([ue("columnModel")],pt.prototype,"columnModel",2),f([ue("columnFactory")],pt.prototype,"columnFactory",2),pt=f([he("autoGroupColService")],pt);var gt={};g(gt,{camelCaseToHumanText:()=>Ct,camelCaseToHyphenated:()=>wt,capitalise:()=>vt,escapeString:()=>bt,utf8_encode:()=>yt});var ft=/[&<>"']/g,mt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function yt(e){const t=String.fromCharCode;function i(e,i){return t(e>>i&63|128)}function n(e){if(e>=0&&e<=31&&10!==e)return`_x${e.toString(16).toUpperCase().padStart(4,"0")}_`;if(!(4294967168&e))return t(e);let n="";return 4294965248&e?4294901760&e?4292870144&e||(n=t(e>>18&7|240),n+=i(e,12),n+=i(e,6)):(function(e){if(e>=55296&&e<=57343)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value")}(e),n=t(e>>12&15|224),n+=i(e,6)):n=t(e>>6&31|192),n+=t(63&e|128),n}const s=function(e){const t=[];if(!e)return[];const i=e.length;let n,s,r=0;for(;r<i;)n=e.charCodeAt(r++),n>=55296&&n<=56319&&r<i?(s=e.charCodeAt(r++),56320==(64512&s)?t.push(((1023&n)<<10)+(1023&s)+65536):(t.push(n),r--)):t.push(n);return t}(e),r=s.length;let o,a=-1,l="";for(;++a<r;)o=s[a],l+=n(o);return l}function vt(e){return e[0].toUpperCase()+e.substring(1).toLowerCase()}function bt(e,t){if(null==e)return null;const i=e.toString().toString();return t?i:i.replace(ft,e=>mt[e])}function Ct(e){return e&&null!=e?e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z])([a-z])/g,"$1 $2$3").replace(/\./g," ").split(" ").map(e=>e.substring(0,1).toUpperCase()+(e.length>1?e.substring(1,e.length):"")).join(" "):null}function wt(e){return e.replace(/[A-Z]/g,e=>`-${e.toLocaleLowerCase()}`)}var St={};function xt(e){const t=new Map;return e.forEach(e=>t.set(e[0],e[1])),t}function Et(e,t){const i=new Map;return e.forEach(e=>i.set(t(e),e)),i}function At(e){const t=[];return e.forEach((e,i)=>t.push(i)),t}g(St,{convertToMap:()=>xt,keys:()=>At,mapById:()=>Et});var Mt=class extends st{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 e=this.gos.get("pivotMode");this.isPivotSettingAllowed(e)&&(this.pivotMode=e),this.addManagedPropertyListeners(["groupDisplayType","treeData","treeDataDisplayType","groupHideOpenParents"],e=>this.buildAutoGroupColumns(Tt(e.source))),this.addManagedPropertyListener("autoGroupColumnDef",e=>this.onAutoGroupColumnDefChanged(Tt(e.source))),this.addManagedPropertyListeners(["defaultColDef","columnTypes","suppressFieldDotNotation"],e=>this.onSharedColDefChanged(Tt(e.source))),this.addManagedPropertyListener("pivotMode",e=>this.setPivotMode(this.gos.get("pivotMode"),Tt(e.source))),this.addManagedListener(this.eventService,ct.EVENT_FIRST_DATA_RENDERED,()=>this.onFirstDataRendered())}buildAutoGroupColumns(e){this.columnDefs&&(this.autoGroupsNeedBuilding=!0,this.forceRecreateAutoGroups=!0,this.updateGridColumns(),this.updateDisplayedColumns(e))}onAutoGroupColumnDefChanged(e){this.groupAutoColumns&&this.autoGroupColService.updateAutoGroupColumns(this.groupAutoColumns,e)}onSharedColDefChanged(e){this.gridColumns&&(this.groupAutoColumns&&this.autoGroupColService.updateAutoGroupColumns(this.groupAutoColumns,e),this.createColumnsFromColumnDefs(!0,e))}setColumnDefs(e,t){const i=!!this.columnDefs;this.columnDefs=e,this.createColumnsFromColumnDefs(i,t)}recreateColumnDefs(e){this.onSharedColDefChanged(e)}destroyOldColumns(e,t){const i={};if(!e)return;ot(null,e,e=>{i[e.getInstanceId()]=e}),t&&ot(null,t,e=>{i[e.getInstanceId()]=null});const n=Object.values(i).filter(e=>null!=e);this.destroyBeans(n)}destroyColumns(){this.destroyOldColumns(this.primaryColumnTree),this.destroyOldColumns(this.secondaryBalancedTree),this.destroyOldColumns(this.groupAutoColsBalancedTree)}createColumnsFromColumnDefs(e,t){const i=e?this.compareColumnStatesAndDispatchEvents(t):void 0;this.valueCache.expire(),this.autoGroupsNeedBuilding=!0;const n=this.primaryColumns,s=this.primaryColumnTree,r=this.columnFactory.createColumnTree(this.columnDefs,!0,s,t);this.destroyOldColumns(this.primaryColumnTree,r.columnTree),this.primaryColumnTree=r.columnTree,this.primaryHeaderRowCount=r.treeDept+1,this.primaryColumns=this.getColumnsFromTree(this.primaryColumnTree),this.primaryColumnsMap={},this.primaryColumns.forEach(e=>this.primaryColumnsMap[e.getId()]=e),this.extractRowGroupColumns(t,n),this.extractPivotColumns(t,n),this.extractValueColumns(t,n),this.ready=!0;const o=void 0===this.gridColsArePrimary;(this.gridColsArePrimary||o||this.autoGroupsNeedBuilding)&&(this.updateGridColumns(),e&&this.gridColsArePrimary&&!this.gos.get("maintainColumnOrder")&&this.orderGridColumnsLikePrimary(),this.updateDisplayedColumns(t),this.checkViewportColumns()),this.dispatchEverythingChanged(t),this.changeEventsDispatching=!0,i&&i(),this.changeEventsDispatching=!1,this.dispatchNewColumnsLoaded(t)}shouldRowModelIgnoreRefresh(){return this.changeEventsDispatching}dispatchNewColumnsLoaded(e){const t={type:ct.EVENT_NEW_COLUMNS_LOADED,source:e};this.eventService.dispatchEvent(t),"gridInitializing"===e&&this.onColumnsReady()}dispatchEverythingChanged(e){const t={type:ct.EVENT_COLUMN_EVERYTHING_CHANGED,source:e};this.eventService.dispatchEvent(t)}orderGridColumnsLikePrimary(){const e=this.primaryColumns;if(!e)return;const t=e.filter(e=>this.gridColumns.indexOf(e)>=0),i=this.gridColumns.filter(e=>t.indexOf(e)<0);this.gridColumns=[...i,...t],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(e=!1){if(null==this.displayedColumnsCenter)return;if(!this.extractViewport())return;const t={type:ct.EVENT_VIRTUAL_COLUMNS_CHANGED,afterScroll:e};this.eventService.dispatchEvent(t)}setViewportPosition(e,t,i=!1){(e!==this.scrollWidth||t!==this.scrollPosition||this.bodyWidthDirty)&&(this.scrollWidth=e,this.scrollPosition=t,this.bodyWidthDirty=!0,this.setViewport(),this.ready&&this.checkViewportColumns(i))}isPivotMode(){return this.pivotMode}isPivotSettingAllowed(e){return!e||!this.gos.get("treeData")||(z("Pivot mode not available with treeData."),!1)}setPivotMode(e,t){if(e===this.pivotMode||!this.isPivotSettingAllowed(this.pivotMode))return;if(this.pivotMode=e,!this.gridColumns)return;this.autoGroupsNeedBuilding=!0,this.updateGridColumns(),this.updateDisplayedColumns(t);const i={type:ct.EVENT_COLUMN_PIVOT_MODE_CHANGED};this.eventService.dispatchEvent(i)}getSecondaryPivotColumn(e,t){if(C(this.secondaryColumns))return null;const i=this.getPrimaryColumn(t);let n=null;return this.secondaryColumns.forEach(t=>{const s=t.getColDef().pivotKeys,r=t.getColDef().pivotValueColumn;Re(s,e)&&r===i&&(n=t)}),n}setBeans(e){this.logger=e.create("columnModel")}setFirstRightAndLastLeftPinned(e){let t,i;this.gos.get("enableRtl")?(t=this.displayedColumnsLeft?this.displayedColumnsLeft[0]:null,i=this.displayedColumnsRight?Ie(this.displayedColumnsRight):null):(t=this.displayedColumnsLeft?Ie(this.displayedColumnsLeft):null,i=this.displayedColumnsRight?this.displayedColumnsRight[0]:null),this.gridColumns.forEach(n=>{n.setLastLeftPinned(n===t,e),n.setFirstRightPinned(n===i,e)})}autoSizeColumns(e){if(this.shouldQueueResizeOperations)return void this.resizeOperationQueue.push(()=>this.autoSizeColumns(e));const{columns:t,skipHeader:i,skipHeaderGroups:n,stopAtGroup:s,source:r="api"}=e;this.animationFrameService.flushAllFrames();const o=[];let a=-1;const l=null!=i?i:this.gos.get("skipHeaderOnAutoSize"),c=null!=n?n:l;for(;0!==a;)a=0,this.actionOnGridColumns(t,e=>{if(o.indexOf(e)>=0)return!1;const t=this.autoWidthCalculator.getPreferredWidthForColumn(e,l);if(t>0){const i=this.normaliseColumnWidth(e,t);e.setActualWidth(i,r),o.push(e),a++}return!0},r);c||this.autoSizeColumnGroupsByColumns(t,r,s),this.dispatchColumnResizedEvent(o,!0,"autosizeColumns")}dispatchColumnResizedEvent(e,t,i,n=null){if(e&&e.length){const s={type:ct.EVENT_COLUMN_RESIZED,columns:e,column:1===e.length?e[0]:null,flexColumns:n,finished:t,source:i};this.eventService.dispatchEvent(s)}}dispatchColumnChangedEvent(e,t,i){const n={type:e,columns:t,column:t&&1==t.length?t[0]:null,source:i};this.eventService.dispatchEvent(n)}dispatchColumnMovedEvent(e){const{movedColumns:t,source:i,toIndex:n,finished:s}=e,r={type:ct.EVENT_COLUMN_MOVED,columns:t,column:t&&1===t.length?t[0]:null,toIndex:n,finished:s,source:i};this.eventService.dispatchEvent(r)}dispatchColumnPinnedEvent(e,t){if(!e.length)return;const i=1===e.length?e[0]:null,n=this.getCommonValue(e,e=>e.getPinned()),s={type:ct.EVENT_COLUMN_PINNED,pinned:null!=n?n:null,columns:e,column:i,source:t};this.eventService.dispatchEvent(s)}dispatchColumnVisibleEvent(e,t){if(!e.length)return;const i=1===e.length?e[0]:null,n=this.getCommonValue(e,e=>e.isVisible()),s={type:ct.EVENT_COLUMN_VISIBLE,visible:n,columns:e,column:i,source:t};this.eventService.dispatchEvent(s)}autoSizeColumn(e,t,i){e&&this.autoSizeColumns({columns:[e],skipHeader:i,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,i){const n=new Set;let s;this.getGridColumns(e).forEach(e=>{let t=e.getParent();for(;t&&t!=i;)t.isPadding()||n.add(t),t=t.getParent()});for(const e of n){for(const t of this.ctrlsService.getHeaderRowContainerCtrls())if(s=t.getHeaderCtrlForColumn(e),s)break;s&&s.resizeLeafColumnsToFit(t)}return[]}autoSizeAllColumns(e,t){if(this.shouldQueueResizeOperations)return void this.resizeOperationQueue.push(()=>this.autoSizeAllColumns(e,t));const i=this.getAllDisplayedColumns();this.autoSizeColumns({columns:i,skipHeader:t,source:e})}getColumnsFromTree(e){const t=[],i=e=>{for(let n=0;n<e.length;n++){const s=e[n];s instanceof Se?t.push(s):s instanceof Ee&&i(s.getChildren())}};return i(e),t}getAllDisplayedTrees(){return this.displayedTreeLeft&&this.displayedTreeRight&&this.displayedTreeCentre?this.displayedTreeLeft.concat(this.displayedTreeCentre).concat(this.displayedTreeRight):null}getPrimaryColumnTree(){return this.primaryColumnTree}getHeaderRowCount(){return this.gridHeaderRowCount}getDisplayedTreeLeft(){return this.displayedTreeLeft}getDisplayedTreeRight(){return this.displayedTreeRight}getDisplayedTreeCentre(){return this.displayedTreeCentre}isColumnDisplayed(e){return this.getAllDisplayedColumns().indexOf(e)>=0}getAllDisplayedColumns(){return this.displayedColumns}getViewportColumns(){return this.viewportColumns}getDisplayedLeftColumnsForRow(e){return this.colSpanActive?this.getDisplayedColumnsForRow(e,this.displayedColumnsLeft):this.displayedColumnsLeft}getDisplayedRightColumnsForRow(e){return this.colSpanActive?this.getDisplayedColumnsForRow(e,this.displayedColumnsRight):this.displayedColumnsRight}isColSpanActive(){return this.colSpanActive}getDisplayedColumnsForRow(e,t,i,n){const s=[];let r=null;for(let o=0;o<t.length;o++){const a=t[o],l=t.length-o,c=Math.min(a.getColSpan(e),l),h=[a];if(c>1){const e=c-1;for(let i=1;i<=e;i++)h.push(t[o+i]);o+=e}let u;i?(u=!1,h.forEach(e=>{i(e)&&(u=!0)})):u=!0,u&&(0===s.length&&r&&n&&n(a)&&s.push(r),s.push(a)),r=a}return s}getViewportCenterColumnsForRow(e){if(!this.colSpanActive)return this.viewportColumnsCenter;const t=this.isColumnVirtualisationSuppressed()?null:this.isColumnInRowViewport.bind(this);return this.getDisplayedColumnsForRow(e,this.displayedColumnsCenter,t,e=>{const t=e.getLeft();return b(t)&&t>this.viewportLeft})}isColumnAtEdge(e,t){const i=this.getAllDisplayedColumns();if(!i.length)return!1;const n="first"===t;let s;if(e instanceof lt){const t=e.getDisplayedLeafColumns();if(!t.length)return!1;s=n?t[0]:Ie(t)}else s=e;return(n?i[0]:Ie(i))===s}getAriaColumnIndex(e){let t;return t=e instanceof lt?e.getLeafColumns()[0]:e,this.ariaOrderColumns.indexOf(t)+1}isColumnInHeaderViewport(e){return!!e.isAutoHeaderHeight()||this.isColumnInRowViewport(e)}isColumnInRowViewport(e){if(e.isAutoHeight())return!0;const t=e.getLeft()||0,i=t+e.getActualWidth(),n=this.viewportLeft-200,s=this.viewportRight+200;return!(t<n&&i<n||t>s&&i>s)}getDisplayedColumnsLeftWidth(){return this.getWidthOfColsInList(this.displayedColumnsLeft)}getDisplayedColumnsRightWidth(){return this.getWidthOfColsInList(this.displayedColumnsRight)}updatePrimaryColumnList(e,t,i,n,s,r){if(!e||w(e))return;let o=!1;if(e.forEach(e=>{if(!e)return;const s=this.getPrimaryColumn(e);if(s){if(i){if(t.indexOf(s)>=0)return;t.push(s)}else{if(t.indexOf(s)<0)return;Ne(t,s)}n(s),o=!0}}),!o)return;this.autoGroupsNeedBuilding&&this.updateGridColumns(),this.updateDisplayedColumns(r);const a={type:s,columns:t,column:1===t.length?t[0]:null,source:r};this.eventService.dispatchEvent(a)}setRowGroupColumns(e,t){this.autoGroupsNeedBuilding=!0,this.setPrimaryColumnList(e,this.rowGroupColumns,ct.EVENT_COLUMN_ROW_GROUP_CHANGED,!0,this.setRowGroupActive.bind(this),t)}setRowGroupActive(e,t,i){e!==t.isRowGroupActive()&&(t.setRowGroupActive(e,i),e&&!this.gos.get("suppressRowGroupHidesColumns")&&this.setColumnsVisible([t],!1,i),e||this.gos.get("suppressMakeColumnVisibleAfterUnGroup")||this.setColumnsVisible([t],!0,i))}addRowGroupColumns(e,t){this.autoGroupsNeedBuilding=!0,this.updatePrimaryColumnList(e,this.rowGroupColumns,!0,this.setRowGroupActive.bind(this,!0),ct.EVENT_COLUMN_ROW_GROUP_CHANGED,t)}removeRowGroupColumns(e,t){this.autoGroupsNeedBuilding=!0,this.updatePrimaryColumnList(e,this.rowGroupColumns,!1,this.setRowGroupActive.bind(this,!1),ct.EVENT_COLUMN_ROW_GROUP_CHANGED,t)}addPivotColumns(e,t){this.updatePrimaryColumnList(e,this.pivotColumns,!0,e=>e.setPivotActive(!0,t),ct.EVENT_COLUMN_PIVOT_CHANGED,t)}setPivotColumns(e,t){this.setPrimaryColumnList(e,this.pivotColumns,ct.EVENT_COLUMN_PIVOT_CHANGED,!0,(e,i)=>{i.setPivotActive(e,t)},t)}removePivotColumns(e,t){this.updatePrimaryColumnList(e,this.pivotColumns,!1,e=>e.setPivotActive(!1,t),ct.EVENT_COLUMN_PIVOT_CHANGED,t)}setPrimaryColumnList(e,t,i,n,s,r){if(!this.gridColumns)return;const o=new Map;t.forEach((e,t)=>o.set(e,t)),t.length=0,b(e)&&e.forEach(e=>{const i=this.getPrimaryColumn(e);i&&t.push(i)}),t.forEach((e,t)=>{const i=o.get(e);void 0!==i?n&&i!==t||o.delete(e):o.set(e,0)}),(this.primaryColumns||[]).forEach(e=>{const i=t.indexOf(e)>=0;s(i,e)}),this.autoGroupsNeedBuilding&&this.updateGridColumns(),this.updateDisplayedColumns(r),this.dispatchColumnChangedEvent(i,[...o.keys()],r)}setValueColumns(e,t){this.setPrimaryColumnList(e,this.valueColumns,ct.EVENT_COLUMN_VALUE_CHANGED,!1,this.setValueActive.bind(this),t)}setValueActive(e,t,i){if(e!==t.isValueActive()&&(t.setValueActive(e,i),e&&!t.getAggFunc()&&this.aggFuncService)){const e=this.aggFuncService.getDefaultAggFunc(t);t.setAggFunc(e)}}addValueColumns(e,t){this.updatePrimaryColumnList(e,this.valueColumns,!0,this.setValueActive.bind(this,!0),ct.EVENT_COLUMN_VALUE_CHANGED,t)}removeValueColumns(e,t){this.updatePrimaryColumnList(e,this.valueColumns,!1,this.setValueActive.bind(this,!1),ct.EVENT_COLUMN_VALUE_CHANGED,t)}normaliseColumnWidth(e,t){const i=e.getMinWidth();b(i)&&t<i&&(t=i);const n=e.getMaxWidth();return b(n)&&e.isGreaterThanMax(t)&&(t=n),t}getPrimaryOrGridColumn(e){return this.getPrimaryColumn(e)||this.getGridColumn(e)}setColumnWidths(e,t,i,n){const s=[];e.forEach(e=>{const i=this.getPrimaryOrGridColumn(e.key);if(i&&(s.push({width:e.newWidth,ratios:[1],columns:[i]}),"shift"===this.gos.get("colResizeDefault")&&(t=!t),t)){const t=this.getDisplayedColAfter(i);if(!t)return;const n=i.getActualWidth()-e.newWidth,r=t.getActualWidth()+n;s.push({width:r,ratios:[1],columns:[t]})}}),0!==s.length&&this.resizeColumnSets({resizeSets:s,finished:i,source:n})}checkMinAndMaxWidthsForSet(e){const{columns:t,width:i}=e;let n=0,s=0,r=!0;return t.forEach(e=>{const t=e.getMinWidth();n+=t||0;const i=e.getMaxWidth();b(i)&&i>0?s+=i:r=!1}),i>=n&&(!r||i<=s)}resizeColumnSets(e){const{resizeSets:t,finished:i,source:n}=e;if(t&&!t.every(e=>this.checkMinAndMaxWidthsForSet(e))){if(i){const e=t&&t.length>0?t[0].columns:null;this.dispatchColumnResizedEvent(e,i,n)}return}const s=[],r=[];t.forEach(e=>{const{width:t,columns:i,ratios:o}=e,a={},l={};i.forEach(e=>r.push(e));let c=!0,h=0;for(;c;){if(h++,h>1e3){console.error("AG Grid: infinite loop in resizeColumnSets");break}c=!1;const e=[];let n=0,s=t;i.forEach((t,i)=>{if(l[t.getId()])s-=a[t.getId()];else{e.push(t);const s=o[i];n+=s}});const r=1/n;e.forEach((i,n)=>{let h;n===e.length-1?h=s:(h=Math.round(o[n]*t*r),s-=h);const u=i.getMinWidth(),d=i.getMaxWidth();b(u)&&h<u?(h=u,l[i.getId()]=!0,c=!0):b(d)&&d>0&&h>d&&(h=d,l[i.getId()]=!0,c=!0),a[i.getId()]=h})}i.forEach(e=>{const t=a[e.getId()];e.getActualWidth()!==t&&(e.setActualWidth(t,n),s.push(e))})});const o=s.length>0;let a=[];o&&(a=this.refreshFlexedColumns({resizingCols:r,skipSetLeft:!0}),this.setLeftValues(n),this.updateBodyWidths(),this.checkViewportColumns());const l=r.concat(a);(o||i)&&this.dispatchColumnResizedEvent(l,i,n,a)}setColumnAggFunc(e,t,i){if(!e)return;const n=this.getPrimaryColumn(e);n&&(n.setAggFunc(t),this.dispatchColumnChangedEvent(ct.EVENT_COLUMN_VALUE_CHANGED,[n],i))}moveRowGroupColumn(e,t,i){if(this.isRowGroupEmpty())return;const n=this.rowGroupColumns[e],s=this.rowGroupColumns.slice(e,t);this.rowGroupColumns.splice(e,1),this.rowGroupColumns.splice(t,0,n);const r={type:ct.EVENT_COLUMN_ROW_GROUP_CHANGED,columns:s,column:1===s.length?s[0]:null,source:i};this.eventService.dispatchEvent(r)}moveColumns(e,t,i,n=!0){if(!this.gridColumns)return;if(this.columnAnimationService.start(),t>this.gridColumns.length-e.length)return console.warn("AG Grid: tried to insert columns in invalid location, toIndex = "+t),void console.warn("AG Grid: remember that you should not count the moving columns when calculating the new index");const s=this.getGridColumns(e);!this.doesMovePassRules(s,t)||(Ve(this.gridColumns,s,t),this.updateDisplayedColumns(i),this.dispatchColumnMovedEvent({movedColumns:s,source:i,toIndex:t,finished:n}),this.columnAnimationService.finish())}doesMovePassRules(e,t){const i=this.getProposedColumnOrder(e,t);return this.doesOrderPassRules(i)}doesOrderPassRules(e){return!!this.doesMovePassMarryChildren(e)&&!!this.doesMovePassLockedPositions(e)}getProposedColumnOrder(e,t){const i=this.gridColumns.slice();return Ve(i,e,t),i}sortColumnsLikeGridColumns(e){!e||e.length<=1||e.filter(e=>this.gridColumns.indexOf(e)<0).length>0||e.sort((e,t)=>this.gridColumns.indexOf(e)-this.gridColumns.indexOf(t))}doesMovePassLockedPositions(e){let t=0,i=!0;return e.forEach(e=>{const n=(s=e.getColDef().lockPosition)?!0===s||"left"===s?0:2:1;var s;n<t&&(i=!1),t=n}),i}doesMovePassMarryChildren(e){let t=!0;return ot(null,this.gridBalancedTree,i=>{if(!(i instanceof Ee))return;const n=i,s=n.getColGroupDef();if(!s||!s.marryChildren)return;const r=[];n.getLeafColumns().forEach(t=>{const i=e.indexOf(t);r.push(i)}),Math.max.apply(Math,r)-Math.min.apply(Math,r)>n.getLeafColumns().length-1&&(t=!1)}),t}moveColumnByIndex(e,t,i){if(!this.gridColumns)return;const n=this.gridColumns[e];this.moveColumns([n],t,i)}getColumnDefs(){if(!this.primaryColumns)return;const e=this.primaryColumns.slice();return this.gridColsArePrimary?e.sort((e,t)=>this.gridColumns.indexOf(e)-this.gridColumns.indexOf(t)):this.lastPrimaryOrder&&e.sort((e,t)=>this.lastPrimaryOrder.indexOf(e)-this.lastPrimaryOrder.indexOf(t)),this.columnDefFactory.buildColumnDefs(e,this.rowGroupColumns,this.pivotColumns)}getBodyContainerWidth(){return this.bodyWidth}getContainerWidth(e){switch(e){case"left":return this.leftWidth;case"right":return this.rightWidth;default:return this.bodyWidth}}updateBodyWidths(){const e=this.getWidthOfColsInList(this.displayedColumnsCenter),t=this.getWidthOfColsInList(this.displayedColumnsLeft),i=this.getWidthOfColsInList(this.displayedColumnsRight);if(this.bodyWidthDirty=this.bodyWidth!==e,this.bodyWidth!==e||this.leftWidth!==t||this.rightWidth!==i){this.bodyWidth=e,this.leftWidth=t,this.rightWidth=i;const n={type:ct.EVENT_COLUMN_CONTAINER_WIDTH_CHANGED};this.eventService.dispatchEvent(n);const s={type:ct.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED};this.eventService.dispatchEvent(s)}}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 e;return null!=(e=this.gridColumns)?e:[]}isRowGroupEmpty(){return w(this.rowGroupColumns)}setColumnsVisible(e,t=!1,i){this.applyColumnState({state:e.map(e=>({colId:"string"==typeof e?e:e.getColId(),hide:!t}))},i)}setColumnsPinned(e,t,i){if(!this.gridColumns)return;if(this.gos.isDomLayout("print"))return void console.warn("AG Grid: Changing the column pinning status is not allowed with domLayout='print'");let n;this.columnAnimationService.start(),n=!0===t||"left"===t?"left":"right"===t?"right":null,this.actionOnGridColumns(e,e=>e.getPinned()!==n&&(e.setPinned(n),!0),i,()=>({type:ct.EVENT_COLUMN_PINNED,pinned:n,column:null,columns:null,source:i})),this.columnAnimationService.finish()}actionOnGridColumns(e,t,i,n){if(w(e))return;const s=[];if(e.forEach(e=>{if(!e)return;const i=this.getGridColumn(e);i&&!1!==t(i)&&s.push(i)}),s.length&&(this.updateDisplayedColumns(i),b(n)&&n)){const e=n();e.columns=s,e.column=1===s.length?s[0]:null,this.eventService.dispatchEvent(e)}}getDisplayedColBefore(e){const t=this.getAllDisplayedColumns(),i=t.indexOf(e);return i>0?t[i-1]:null}getDisplayedColAfter(e){const t=this.getAllDisplayedColumns(),i=t.indexOf(e);return i<t.length-1?t[i+1]:null}getDisplayedGroupAtDirection(e,t){const i=e.getProvidedColumnGroup().getLevel()+e.getPaddingLevel(),n=e.getDisplayedLeafColumns(),s="After"===t?Ie(n):n[0],r=`getDisplayedCol${t}`;for(;;){const t=this[r](s);if(!t)return null;const n=this.getColumnGroupAtLevel(t,i);if(n!==e)return n}}getColumnGroupAtLevel(e,t){let i,n,s=e.getParent();for(;i=s.getProvidedColumnGroup().getLevel(),n=s.getPaddingLevel(),!(i+n<=t);)s=s.getParent();return s}isPinningLeft(){return this.displayedColumnsLeft.length>0}isPinningRight(){return this.displayedColumnsRight.length>0}getPrimaryAndSecondaryAndAutoColumns(){return[].concat(this.primaryColumns||[],this.groupAutoColumns||[],this.secondaryColumns||[])}createStateItemFromColumn(e){const t=e.isRowGroupActive()?this.rowGroupColumns.indexOf(e):null,i=e.isPivotActive()?this.pivotColumns.indexOf(e):null,n=e.isValueActive()?e.getAggFunc():null,s=null!=e.getSort()?e.getSort():null,r=null!=e.getSortIndex()?e.getSortIndex():null,o=null!=e.getFlex()&&e.getFlex()>0?e.getFlex():null;return{colId:e.getColId(),width:e.getActualWidth(),hide:!e.isVisible(),pinned:e.getPinned(),sort:s,sortIndex:r,aggFunc:n,rowGroup:e.isRowGroupActive(),rowGroupIndex:t,pivot:e.isPivotActive(),pivotIndex:i,flex:o}}getColumnState(){if(C(this.primaryColumns)||!this.isAlive())return[];const e=this.getPrimaryAndSecondaryAndAutoColumns().map(this.createStateItemFromColumn.bind(this));return this.orderColumnStateList(e),e}orderColumnStateList(e){const t=xt(this.gridColumns.map((e,t)=>[e.getColId(),t]));e.sort((e,i)=>(t.has(e.colId)?t.get(e.colId):-1)-(t.has(i.colId)?t.get(i.colId):-1))}resetColumnState(e){if(w(this.primaryColumns))return;const t=this.getColumnsFromTree(this.primaryColumnTree),i=[];let n=1e3,s=1e3,r=[];this.groupAutoColumns&&(r=r.concat(this.groupAutoColumns)),t&&(r=r.concat(t)),r.forEach(e=>{const t=this.getColumnStateFromColDef(e);C(t.rowGroupIndex)&&t.rowGroup&&(t.rowGroupIndex=n++),C(t.pivotIndex)&&t.pivot&&(t.pivotIndex=s++),i.push(t)}),this.applyColumnState({state:i,applyOrder:!0},e)}getColumnStateFromColDef(e){const t=(e,t)=>null!=e?e:null!=t?t:null,i=e.getColDef(),n=t(i.sort,i.initialSort),s=t(i.sortIndex,i.initialSortIndex),r=t(i.hide,i.initialHide),o=t(i.pinned,i.initialPinned),a=t(i.width,i.initialWidth),l=t(i.flex,i.initialFlex);let c=t(i.rowGroupIndex,i.initialRowGroupIndex),h=t(i.rowGroup,i.initialRowGroup);null!=c||null!=h&&0!=h||(c=null,h=null);let u=t(i.pivotIndex,i.initialPivotIndex),d=t(i.pivot,i.initialPivot);null!=u||null!=d&&0!=d||(u=null,d=null);const p=t(i.aggFunc,i.initialAggFunc);return{colId:e.getColId(),sort:n,sortIndex:s,hide:r,pinned:o,width:a,flex:l,rowGroup:h,rowGroupIndex:c,pivot:d,pivotIndex:u,aggFunc:p}}applyColumnState(e,t){if(w(this.primaryColumns))return!1;if(e&&e.state&&!e.state.forEach)return console.warn("AG Grid: applyColumnState() - the state attribute should be an array, however an array was not found. Please provide an array of items (one for each col you want to change) for state."),!1;const i=(i,n,s)=>{const r=this.compareColumnStatesAndDispatchEvents(t);this.autoGroupsNeedBuilding=!0;const o=n.slice(),a={},l={},c=[],h=[];let u=0;const d=this.rowGroupColumns.slice(),p=this.pivotColumns.slice();i.forEach(i=>{const n=i.colId||"";if(n.startsWith(dt))return c.push(i),void h.push(i);const r=s(n);r?(this.syncColumnWithStateItem(r,i,e.defaultState,a,l,!1,t),Ne(o,r)):(h.push(i),u+=1)});const g=i=>this.syncColumnWithStateItem(i,null,e.defaultState,a,l,!1,t);o.forEach(g);const f=(e,t,i,n)=>{const s=e[i.getId()],r=e[n.getId()],o=null!=s,a=null!=r;if(o&&a)return s-r;if(o)return-1;if(a)return 1;const l=t.indexOf(i),c=t.indexOf(n),h=l>=0;return h&&c>=0?l-c:h?-1:1};this.rowGroupColumns.sort(f.bind(this,a,d)),this.pivotColumns.sort(f.bind(this,l,p)),this.updateGridColumns();const m=this.groupAutoColumns?this.groupAutoColumns.slice():[];return c.forEach(i=>{const n=this.getAutoColumn(i.colId);Ne(m,n),this.syncColumnWithStateItem(n,i,e.defaultState,null,null,!0,t)}),m.forEach(g),this.applyOrderAfterApplyState(e),this.updateDisplayedColumns(t),this.dispatchEverythingChanged(t),r(),{unmatchedAndAutoStates:h,unmatchedCount:u}};this.columnAnimationService.start();let{unmatchedAndAutoStates:n,unmatchedCount:s}=i(e.state||[],this.primaryColumns||[],e=>this.getPrimaryColumn(e));return(n.length>0||b(e.defaultState))&&(s=i(n,this.secondaryColumns||[],e=>this.getSecondaryColumn(e)).unmatchedCount),this.columnAnimationService.finish(),0===s}applyOrderAfterApplyState(e){if(!e.applyOrder||!e.state)return;let t=[];const i={};e.state.forEach(e=>{if(!e.colId||i[e.colId])return;const n=this.gridColumnsMap[e.colId];n&&(t.push(n),i[e.colId]=!0)});let n=0;this.gridColumns.forEach(e=>{const s=e.getColId();null==i[s]&&(s.startsWith(dt)?Ge(t,e,n++):t.push(e))}),t=this.placeLockedColumns(t),this.doesMovePassMarryChildren(t)?this.gridColumns=t:console.warn("AG Grid: Applying column order broke a group where columns should be married together. Applying new order has been discarded.")}compareColumnStatesAndDispatchEvents(e){const t={rowGroupColumns:this.rowGroupColumns.slice(),pivotColumns:this.pivotColumns.slice(),valueColumns:this.valueColumns.slice()},i=this.getColumnState(),n={};return i.forEach(e=>{n[e.colId]=e}),()=>{const s=this.getPrimaryAndSecondaryAndAutoColumns(),r=(t,i,n,s)=>{if(Re(i.map(s),n.map(s)))return;const r=new Set(i);n.forEach(e=>{r.delete(e)||r.add(e)});const o=[...r],a={type:t,columns:o,column:1===o.length?o[0]:null,source:e};this.eventService.dispatchEvent(a)},o=e=>{const t=[];return s.forEach(i=>{const s=n[i.getColId()];s&&e(s,i)&&t.push(i)}),t},a=e=>e.getColId();r(ct.EVENT_COLUMN_ROW_GROUP_CHANGED,t.rowGroupColumns,this.rowGroupColumns,a),r(ct.EVENT_COLUMN_PIVOT_CHANGED,t.pivotColumns,this.pivotColumns,a);const l=o((e,t)=>{const i=null!=e.aggFunc,n=i!=t.isValueActive(),s=i&&e.aggFunc!=t.getAggFunc();return n||s});l.length>0&&this.dispatchColumnChangedEvent(ct.EVENT_COLUMN_VALUE_CHANGED,l,e),this.dispatchColumnResizedEvent(o((e,t)=>e.width!=t.getActualWidth()),!0,e),this.dispatchColumnPinnedEvent(o((e,t)=>e.pinned!=t.getPinned()),e),this.dispatchColumnVisibleEvent(o((e,t)=>e.hide==t.isVisible()),e);const c=o((e,t)=>e.sort!=t.getSort()||e.sortIndex!=t.getSortIndex());c.length>0&&this.sortController.dispatchSortChangedEvents(e,c),this.normaliseColumnMovedEventForColumnState(i,e)}}getCommonValue(e,t){if(!e||0==e.length)return;const i=t(e[0]);for(let n=1;n<e.length;n++)if(i!==t(e[n]))return;return i}normaliseColumnMovedEventForColumnState(e,t){const i=this.getColumnState(),n={};i.forEach(e=>n[e.colId]=e);const s={};e.forEach(e=>{n[e.colId]&&(s[e.colId]=!0)});const r=e.filter(e=>s[e.colId]),o=i.filter(e=>s[e.colId]),a=[];o.forEach((e,t)=>{const i=r&&r[t];if(i&&i.colId!==e.colId){const e=this.getGridColumn(i.colId);e&&a.push(e)}}),a.length&&this.dispatchColumnMovedEvent({movedColumns:a,source:t,finished:!0})}syncColumnWithStateItem(e,t,i,n,s,r,o){var a;if(!e)return;const l=(e,n)=>{const s={value1:void 0,value2:void 0};let r=!1;return t&&(void 0!==t[e]&&(s.value1=t[e],r=!0),b(n)&&void 0!==t[n]&&(s.value2=t[n],r=!0)),!r&&i&&(void 0!==i[e]&&(s.value1=i[e]),b(n)&&void 0!==i[n]&&(s.value2=i[n])),s},c=l("hide").value1;void 0!==c&&e.setVisible(!c,o);const h=l("pinned").value1;void 0!==h&&e.setPinned(h);const u=null!=(a=e.getColDef().minWidth)?a:this.environment.getMinColWidth(),d=l("flex").value1;if(void 0!==d&&e.setFlex(d),null==d){const t=l("width").value1;null!=t&&null!=u&&t>=u&&e.setActualWidth(t,o)}const p=l("sort").value1;void 0!==p&&("desc"===p||"asc"===p?e.setSort(p,o):e.setSort(void 0,o));const g=l("sortIndex").value1;if(void 0!==g&&e.setSortIndex(g),r||!e.isPrimary())return;const f=l("aggFunc").value1;void 0!==f&&("string"==typeof f?(e.setAggFunc(f),e.isValueActive()||(e.setValueActive(!0,o),this.valueColumns.push(e))):(b(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."),e.isValueActive()&&(e.setValueActive(!1,o),Ne(this.valueColumns,e))));const{value1:m,value2:y}=l("rowGroup","rowGroupIndex");void 0===m&&void 0===y||("number"==typeof y||m?(e.isRowGroupActive()||(e.setRowGroupActive(!0,o),this.rowGroupColumns.push(e)),n&&"number"==typeof y&&(n[e.getId()]=y)):e.isRowGroupActive()&&(e.setRowGroupActive(!1,o),Ne(this.rowGroupColumns,e)));const{value1:v,value2:C}=l("pivot","pivotIndex");void 0===v&&void 0===C||("number"==typeof C||v?(e.isPivotActive()||(e.setPivotActive(!0,o),this.pivotColumns.push(e)),s&&"number"==typeof C&&(s[e.getId()]=C)):e.isPivotActive()&&(e.setPivotActive(!1,o),Ne(this.pivotColumns,e)))}getGridColumns(e){return this.getColumns(e,this.getGridColumn.bind(this))}getColumns(e,t){const i=[];return e&&e.forEach(e=>{const n=t(e);n&&i.push(n)}),i}getColumnWithValidation(e){if(null==e)return null;const t=this.getGridColumn(e);return t||console.warn("AG Grid: could not find column "+e),t}getPrimaryColumn(e){return this.primaryColumns?this.getColumn(e,this.primaryColumns,this.primaryColumnsMap):null}getGridColumn(e){return this.getColumn(e,this.gridColumns,this.gridColumnsMap)}lookupGridColumn(e){return this.gridColumnsMap[e]}getSecondaryColumn(e){return this.secondaryColumns?this.getColumn(e,this.secondaryColumns,this.secondaryColumnsMap):null}getColumn(e,t,i){if(!e||!i)return null;if("string"==typeof e&&i[e])return i[e];for(let i=0;i<t.length;i++)if(this.columnsMatch(t[i],e))return t[i];return this.getAutoColumn(e)}getSourceColumnsForGroupColumn(e){const t=e.getColDef().showRowGroup;if(!t)return null;if(!0===t)return this.rowGroupColumns.slice(0);const i=this.getPrimaryColumn(t);return i?[i]:null}getAutoColumn(e){return this.groupAutoColumns&&b(this.groupAutoColumns)&&!C(this.groupAutoColumns)&&this.groupAutoColumns.find(t=>this.columnsMatch(t,e))||null}columnsMatch(e,t){const i=e===t,n=e.getColDef()===t,s=e.getColId()==t;return i||n||s}getDisplayNameForColumn(e,t,i=!1){if(!e)return null;const n=this.getHeaderName(e.getColDef(),e,null,null,t);return i?this.wrapHeaderNameWithAggFunc(e,n):n}getDisplayNameForProvidedColumnGroup(e,t,i){const n=t?t.getColGroupDef():null;return n?this.getHeaderName(n,null,e,t,i):null}getDisplayNameForColumnGroup(e,t){return this.getDisplayNameForProvidedColumnGroup(e,e.getProvidedColumnGroup(),t)}getHeaderName(e,t,i,n,s){const r=e.headerValueGetter;if(r){const o=this.gos.addGridCommonParams({colDef:e,column:t,columnGroup:i,providedColumnGroup:n,location:s});return"function"==typeof r?r(o):"string"==typeof r?this.expressionService.evaluate(r,o):(console.warn("AG Grid: headerValueGetter must be a function or a string"),"")}return null!=e.headerName?e.headerName:e.field?Ct(e.field):""}wrapHeaderNameWithAggFunc(e,t){if(this.gos.get("suppressAggFuncInHeader"))return t;const i=e.getColDef().pivotValueColumn;let n,s=null;if(b(i)){const r=this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&1===this.valueColumns.length,o=void 0!==e.getColDef().pivotTotalColumnIds;if(r&&!o)return t;s=i?i.getAggFunc():null,n=!0}else{const t=e.isValueActive(),i=this.pivotMode||!this.isRowGroupEmpty();t&&i?(s=e.getAggFunc(),n=!0):n=!1}if(n){const e="string"==typeof s?s:"func";return`${this.localeService.getLocaleTextFunc()(e,e)}(${t})`}return t}getColumnGroup(e,t){if(!e)return null;if(e instanceof lt)return e;const i=this.getAllDisplayedTrees(),n="number"==typeof t;let s=null;return Dt(i,!1,i=>{if(i instanceof lt){const r=i;let o;o=n?e===r.getGroupId()&&t===r.getPartId():e===r.getGroupId(),o&&(s=r)}}),s}isReady(){return this.ready}extractValueColumns(e,t){this.valueColumns=this.extractColumns(t,this.valueColumns,(t,i)=>t.setValueActive(i,e),()=>{},()=>{},e=>{const t=e.aggFunc;return null===t||""===t?null:void 0!==t?!!t:void 0},e=>null!=e.initialAggFunc&&""!=e.initialAggFunc),this.valueColumns.forEach(e=>{const t=e.getColDef();null!=t.aggFunc&&""!=t.aggFunc?e.setAggFunc(t.aggFunc):e.getAggFunc()||e.setAggFunc(t.initialAggFunc)})}extractRowGroupColumns(e,t){this.rowGroupColumns=this.extractColumns(t,this.rowGroupColumns,(t,i)=>t.setRowGroupActive(i,e),e=>e.rowGroupIndex,e=>e.initialRowGroupIndex,e=>e.rowGroup,e=>e.initialRowGroup)}extractColumns(e=[],t=[],i,n,s,r,o){const a=[],l=[];(this.primaryColumns||[]).forEach(i=>{const c=e.indexOf(i)<0,h=i.getColDef(),u=E(r(h)),d=E(o(h)),p=x(n(h)),g=x(s(h));let f;f=void 0!==u?u:void 0!==p?null!==p&&p>=0:c?void 0!==d?d:!(void 0===g)&&null!=g&&g>=0:t.indexOf(i)>=0,f&&((c?null!=p||null!=g:null!=p)?a.push(i):l.push(i))});const c=e=>{const t=n(e.getColDef()),i=s(e.getColDef());return null!=t?t:i};a.sort((e,t)=>{const i=c(e),n=c(t);return i===n?0:i<n?-1:1});const h=[].concat(a);return t.forEach(e=>{l.indexOf(e)>=0&&h.push(e)}),l.forEach(e=>{h.indexOf(e)<0&&h.push(e)}),t.forEach(e=>{h.indexOf(e)<0&&i(e,!1)}),h.forEach(e=>{t.indexOf(e)<0&&i(e,!0)}),h}extractPivotColumns(e,t){this.pivotColumns=this.extractColumns(t,this.pivotColumns,(t,i)=>t.setPivotActive(i,e),e=>e.pivotIndex,e=>e.initialPivotIndex,e=>e.pivot,e=>e.initialPivot)}resetColumnGroupState(e){if(!this.primaryColumnTree)return;const t=[];ot(null,this.primaryColumnTree,e=>{if(e instanceof Ee){const i=e.getColGroupDef(),n={groupId:e.getGroupId(),open:i?i.openByDefault:void 0};t.push(n)}}),this.setColumnGroupState(t,e)}getColumnGroupState(){const e=[];return ot(null,this.gridBalancedTree,t=>{t instanceof Ee&&e.push({groupId:t.getGroupId(),open:t.isExpanded()})}),e}setColumnGroupState(e,t){if(!this.gridBalancedTree)return;this.columnAnimationService.start();const i=[];if(e.forEach(e=>{const t=e.groupId,n=e.open,s=this.getProvidedColumnGroup(t);s&&s.isExpanded()!==n&&(this.logger.log("columnGroupOpened("+s.getGroupId()+","+n+")"),s.setExpanded(n),i.push(s))}),this.updateGroupsAndDisplayedColumns(t),this.setFirstRightAndLastLeftPinned(t),i.length){const e={type:ct.EVENT_COLUMN_GROUP_OPENED,columnGroup:1===Ee.length?i[0]:void 0,columnGroups:i};this.eventService.dispatchEvent(e)}this.columnAnimationService.finish()}setColumnGroupOpened(e,t,i){let n;n=e instanceof Ee?e.getId():e||"",this.setColumnGroupState([{groupId:n,open:t}],i)}getProvidedColumnGroup(e){"string"!=typeof e&&console.error("AG Grid: group key must be a string");let t=null;return ot(null,this.gridBalancedTree,i=>{i instanceof Ee&&i.getId()===e&&(t=i)}),t}calculateColumnsForDisplay(){let e;return e=this.pivotMode&&C(this.secondaryColumns)?this.gridColumns.filter(e=>{const t=this.groupAutoColumns&&He(this.groupAutoColumns,e),i=this.valueColumns&&He(this.valueColumns,e);return t||i}):this.gridColumns.filter(e=>this.groupAutoColumns&&He(this.groupAutoColumns,e)||e.isVisible()),e}checkColSpanActiveInCols(e){let t=!1;return e.forEach(e=>{b(e.getColDef().colSpan)&&(t=!0)}),t}calculateColumnsForGroupDisplay(){this.groupDisplayColumns=[],this.groupDisplayColumnsMap={},this.gridColumns.forEach(e=>{const t=e.getColDef(),i=t.showRowGroup;t&&b(i)&&(this.groupDisplayColumns.push(e),"string"==typeof i?this.groupDisplayColumnsMap[i]=e:!0===i&&this.getRowGroupColumns().forEach(t=>{this.groupDisplayColumnsMap[t.getId()]=e}))})}getGroupDisplayColumns(){return this.groupDisplayColumns}getGroupDisplayColumnForGroup(e){return this.groupDisplayColumnsMap[e]}updateDisplayedColumns(e){const t=this.calculateColumnsForDisplay();this.buildDisplayedTrees(t),this.updateGroupsAndDisplayedColumns(e),this.setFirstRightAndLastLeftPinned(e)}isSecondaryColumnsPresent(){return b(this.secondaryColumns)}setSecondaryColumns(e,t){if(!this.gridColumns)return;const i=e;if(i||!C(this.secondaryColumns)){if(i){this.processSecondaryColumnDefinitions(e);const i=this.columnFactory.createColumnTree(e,!1,this.secondaryBalancedTree||this.previousSecondaryColumns||void 0,t);this.destroyOldColumns(this.secondaryBalancedTree,i.columnTree),this.secondaryBalancedTree=i.columnTree,this.secondaryHeaderRowCount=i.treeDept+1,this.secondaryColumns=this.getColumnsFromTree(this.secondaryBalancedTree),this.secondaryColumnsMap={},this.secondaryColumns.forEach(e=>this.secondaryColumnsMap[e.getId()]=e),this.previousSecondaryColumns=null}else this.previousSecondaryColumns=this.secondaryBalancedTree,this.secondaryBalancedTree=null,this.secondaryHeaderRowCount=-1,this.secondaryColumns=null,this.secondaryColumnsMap={};this.updateGridColumns(),this.updateDisplayedColumns(t)}}processSecondaryColumnDefinitions(e){const t=this.gos.get("processPivotResultColDef"),i=this.gos.get("processPivotResultColGroupDef");if(!t&&!i)return;const n=e=>{e.forEach(e=>{if(b(e.children)){const t=e;i&&i(t),n(t.children)}else t&&t(e)})};e&&n(e)}updateGridColumns(){const e=this.gridBalancedTree;if(this.gridColsArePrimary?this.lastPrimaryOrder=this.gridColumns:this.lastSecondaryOrder=this.gridColumns,this.createGroupAutoColumnsIfNeeded()){const e=xt(this.groupAutoColumns.map(e=>[e,!0]));this.lastPrimaryOrder&&(this.lastPrimaryOrder=this.lastPrimaryOrder.filter(t=>!e.has(t)),this.lastPrimaryOrder=[...this.groupAutoColumns,...this.lastPrimaryOrder]),this.lastSecondaryOrder&&(this.lastSecondaryOrder=this.lastSecondaryOrder.filter(t=>!e.has(t)),this.lastSecondaryOrder=[...this.groupAutoColumns,...this.lastSecondaryOrder])}let t;if(this.secondaryColumns&&this.secondaryBalancedTree){const e=this.secondaryColumns.some(e=>void 0!==this.gridColumnsMap[e.getColId()]);this.gridBalancedTree=this.secondaryBalancedTree.slice(),this.gridHeaderRowCount=this.secondaryHeaderRowCount,this.gridColumns=this.secondaryColumns.slice(),this.gridColsArePrimary=!1,e&&(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(e=>this.gridColumnsMap[e.getId()]=e),this.setAutoHeightActive(),!Re(e,this.gridBalancedTree)){const e={type:ct.EVENT_GRID_COLUMNS_CHANGED};this.eventService.dispatchEvent(e)}}setAutoHeightActive(){this.autoHeightActive=this.gridColumns.filter(e=>e.isAutoHeight()).length>0,this.autoHeightActive&&(this.autoHeightActiveAtLeastOnce=!0,this.gos.isRowModelType("clientSide")||this.gos.isRowModelType("serverSide")||z("autoHeight columns only work with Client Side Row Model and Server Side Row Model."))}orderGridColsLike(e){if(C(e))return;const t=xt(e.map((e,t)=>[e,t]));let i=!0;if(this.gridColumns.forEach(e=>{t.has(e)&&(i=!1)}),i)return;const n=xt(this.gridColumns.map(e=>[e,!0])),s=e.filter(e=>n.has(e)),r=xt(s.map(e=>[e,!0])),o=this.gridColumns.filter(e=>!r.has(e)),a=s.slice();o.forEach(e=>{let t=e.getOriginalParent();if(!t)return void a.push(e);const i=[];for(;!i.length&&t;)t.getLeafColumns().forEach(e=>{const t=a.indexOf(e)>=0,n=i.indexOf(e)<0;t&&n&&i.push(e)}),t=t.getOriginalParent();if(!i.length)return void a.push(e);const n=i.map(e=>a.indexOf(e)),s=Math.max(...n);Ge(a,e,s+1)}),this.gridColumns=a}isPrimaryColumnGroupsPresent(){return this.primaryHeaderRowCount>1}refreshQuickFilterColumns(){var e;let t=null!=(e=this.isPivotMode()&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")?this.secondaryColumns:this.primaryColumns)?e:[];this.groupAutoColumns&&(t=t.concat(this.groupAutoColumns)),this.columnsForQuickFilter=this.gos.get("includeHiddenColumnsInQuickFilter")?t:t.filter(e=>e.isVisible()||e.isRowGroupActive())}placeLockedColumns(e){const t=[],i=[],n=[];return e.forEach(e=>{const s=e.getColDef().lockPosition;"right"===s?n.push(e):"left"===s||!0===s?t.push(e):i.push(e)}),[...t,...i,...n]}addAutoGroupToGridColumns(){if(C(this.groupAutoColumns))return this.destroyOldColumns(this.groupAutoColsBalancedTree),void(this.groupAutoColsBalancedTree=null);this.gridColumns=this.groupAutoColumns?this.groupAutoColumns.concat(this.gridColumns):this.gridColumns;const e=this.columnFactory.createForAutoGroups(this.groupAutoColumns,this.gridBalancedTree);this.destroyOldColumns(this.groupAutoColsBalancedTree,e),this.groupAutoColsBalancedTree=e,this.gridBalancedTree=e.concat(this.gridBalancedTree)}clearDisplayedAndViewportColumns(){this.viewportRowLeft={},this.viewportRowRight={},this.viewportRowCenter={},this.displayedColumnsLeft=[],this.displayedColumnsRight=[],this.displayedColumnsCenter=[],this.displayedColumns=[],this.ariaOrderColumns=[],this.viewportColumns=[],this.headerViewportColumns=[],this.viewportColumnsHash=""}updateGroupsAndDisplayedColumns(e){this.updateOpenClosedVisibilityInColumnGroups(),this.deriveDisplayedColumns(e),this.refreshFlexedColumns(),this.extractViewport(),this.updateBodyWidths();const t={type:ct.EVENT_DISPLAYED_COLUMNS_CHANGED};this.eventService.dispatchEvent(t)}deriveDisplayedColumns(e){this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeLeft,this.displayedColumnsLeft),this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeCentre,this.displayedColumnsCenter),this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeRight,this.displayedColumnsRight),this.joinColumnsAriaOrder(),this.joinDisplayedColumns(),this.setLeftValues(e),this.displayedAutoHeightCols=this.displayedColumns.filter(e=>e.isAutoHeight())}isAutoRowHeightActive(){return this.autoHeightActive}wasAutoRowHeightEverActive(){return this.autoHeightActiveAtLeastOnce}joinColumnsAriaOrder(){const e=this.getAllGridColumns(),t=[],i=[],n=[];for(const s of e){const e=s.getPinned();e?!0===e||"left"===e?t.push(s):n.push(s):i.push(s)}this.ariaOrderColumns=t.concat(i).concat(n)}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(e){this.setLeftValuesOfColumns(e),this.setLeftValuesOfGroups()}setLeftValuesOfColumns(e){if(!this.primaryColumns)return;const t=this.getPrimaryAndSecondaryAndAutoColumns().slice(0),i=this.gos.get("enableRtl");[this.displayedColumnsLeft,this.displayedColumnsRight,this.displayedColumnsCenter].forEach(n=>{if(i){let t=this.getWidthOfColsInList(n);n.forEach(i=>{t-=i.getActualWidth(),i.setLeft(t,e)})}else{let t=0;n.forEach(i=>{i.setLeft(t,e),t+=i.getActualWidth()})}Oe(t,n)}),t.forEach(t=>{t.setLeft(null,e)})}setLeftValuesOfGroups(){[this.displayedTreeLeft,this.displayedTreeRight,this.displayedTreeCentre].forEach(e=>{e.forEach(e=>{e instanceof lt&&e.checkLeft()})})}derivedDisplayedColumnsFromDisplayedTree(e,t){t.length=0,Dt(e,!0,e=>{e instanceof Se&&t.push(e)})}isColumnVirtualisationSuppressed(){return this.suppressColumnVirtualisation||0===this.viewportRight}extractViewportColumns(){this.isColumnVirtualisationSuppressed()?(this.viewportColumnsCenter=this.displayedColumnsCenter,this.headerViewportColumnsCenter=this.displayedColumnsCenter):(this.viewportColumnsCenter=this.displayedColumnsCenter.filter(this.isColumnInRowViewport.bind(this)),this.headerViewportColumnsCenter=this.displayedColumnsCenter.filter(this.isColumnInHeaderViewport.bind(this))),this.viewportColumns=this.viewportColumnsCenter.concat(this.displayedColumnsLeft).concat(this.displayedColumnsRight),this.headerViewportColumns=this.headerViewportColumnsCenter.concat(this.displayedColumnsLeft).concat(this.displayedColumnsRight)}getVirtualHeaderGroupRow(e,t){let i;switch(e){case"left":i=this.viewportRowLeft[t];break;case"right":i=this.viewportRowRight[t];break;default:i=this.viewportRowCenter[t]}return C(i)&&(i=[]),i}calculateHeaderRows(){this.viewportRowLeft={},this.viewportRowRight={},this.viewportRowCenter={};const e={};this.headerViewportColumns.forEach(t=>e[t.getId()]=!0);const t=(i,n,s)=>{let r=!1;for(let o=0;o<i.length;o++){const a=i[o];let l=!1;if(a instanceof Se)l=!0===e[a.getId()];else{const e=a.getDisplayedChildren();e&&(l=t(e,n,s+1))}l&&(r=!0,n[s]||(n[s]=[]),n[s].push(a))}return r};t(this.displayedTreeLeft,this.viewportRowLeft,0),t(this.displayedTreeRight,this.viewportRowRight,0),t(this.displayedTreeCentre,this.viewportRowCenter,0)}extractViewport(){this.extractViewportColumns();const e=this.viewportColumns.map(e=>`${e.getId()}-${e.getPinned()||"normal"}`).join("#"),t=this.viewportColumnsHash!==e;return t&&(this.viewportColumnsHash=e,this.calculateHeaderRows()),t}refreshFlexedColumns(e={}){var t;const i=e.source?e.source:"flex";if(null!=e.viewportWidth&&(this.flexViewportWidth=e.viewportWidth),!this.flexViewportWidth)return[];let n=-1;if(e.resizingCols){const t=new Set(e.resizingCols);let i=this.displayedColumnsCenter;for(let e=i.length-1;e>=0;e--)if(t.has(i[e])){n=e;break}}let s=0,r=[],o=0,a=0;for(let e=0;e<this.displayedColumnsCenter.length;e++)this.displayedColumnsCenter[e].getFlex()&&e>n?(r.push(this.displayedColumnsCenter[e]),a+=this.displayedColumnsCenter[e].getFlex(),o+=null!=(t=this.displayedColumnsCenter[e].getMinWidth())?t:0):s+=this.displayedColumnsCenter[e].getActualWidth();if(!r.length)return[];let l=[];s+o>this.flexViewportWidth&&(r.forEach(e=>{var t;return e.setActualWidth(null!=(t=e.getMinWidth())?t:0,i)}),l=r,r=[]);const c=[];let h;e:for(;;){h=this.flexViewportWidth-s;const e=h/a;for(let t=0;t<r.length;t++){const n=r[t],o=e*n.getFlex();let h=0;const u=n.getMinWidth(),d=n.getMaxWidth();if(b(u)&&o<u?h=u:b(d)&&o>d&&(h=d),h){n.setActualWidth(h,i),Le(r,n),a-=n.getFlex(),l.push(n),s+=n.getActualWidth();continue e}c[t]=Math.round(o)}break}let u=h;return r.forEach((e,t)=>{e.setActualWidth(Math.min(c[t],u),i),l.push(e),u-=c[t]}),e.skipSetLeft||this.setLeftValues(i),e.updateBodyWidths&&this.updateBodyWidths(),e.fireResizedEvent&&this.dispatchColumnResizedEvent(l,!0,i,r),r}sizeColumnsToFit(e,t="sizeColumnsToFit",i,n){var s,r,o,a,u;if(this.shouldQueueResizeOperations)return void this.resizeOperationQueue.push(()=>this.sizeColumnsToFit(e,t,i,n));const d={};n&&(null==(s=null==n?void 0:n.columnLimits)||s.forEach(e=>{var t=e,{key:i}=t,n=((e,t)=>{var i={};for(var n in e)c.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&l)for(var n of l(e))t.indexOf(n)<0&&h.call(e,n)&&(i[n]=e[n]);return i})(t,["key"]);d["string"==typeof i?i:i.getColId()]=n}));const p=this.getAllDisplayedColumns(),g=e===this.getWidthOfColsInList(p);if(e<=0||!p.length||g)return;const f=[],m=[];p.forEach(e=>{!0===e.getColDef().suppressSizeToFit?m.push(e):f.push(e)});const y=f.slice(0);let v=!1;const C=e=>{Ne(f,e),m.push(e)};for(f.forEach(e=>{var i,s;e.resetActualWidth(t);const r=null==d?void 0:d[e.getId()],o=null!=(i=null==r?void 0:r.minWidth)?i:null==n?void 0:n.defaultMinWidth,a=null!=(s=null==r?void 0:r.maxWidth)?s:null==n?void 0:n.defaultMaxWidth,l=e.getActualWidth();"number"==typeof o&&l<o?e.setActualWidth(o,t,!0):"number"==typeof a&&l>a&&e.setActualWidth(a,t,!0)});!v;){v=!0;const i=e-this.getWidthOfColsInList(m);if(i<=0)f.forEach(e=>{var i,s;const r=null!=(s=null==(i=null==d?void 0:d[e.getId()])?void 0:i.minWidth)?s:null==n?void 0:n.defaultMinWidth;"number"!=typeof r?e.setMinimum(t):e.setActualWidth(r,t,!0)});else{const e=i/this.getWidthOfColsInList(f);let s=i;for(let i=f.length-1;i>=0;i--){const l=f[i],c=null==d?void 0:d[l.getId()],h=null!=(r=null==c?void 0:c.minWidth)?r:null==n?void 0:n.defaultMinWidth,p=null!=(o=null==c?void 0:c.maxWidth)?o:null==n?void 0:n.defaultMaxWidth,g=null!=(a=l.getMinWidth())?a:0,m=null!=(u=l.getMaxWidth())?u:Number.MAX_VALUE,y="number"==typeof h&&h>g?h:l.getMinWidth(),w="number"==typeof p&&p<m?p:l.getMaxWidth();let S=Math.round(l.getActualWidth()*e);b(y)&&S<y?(S=y,C(l),v=!1):b(w)&&S>w?(S=w,C(l),v=!1):0===i&&(S=s),l.setActualWidth(S,t,!0),s-=S}}}y.forEach(e=>{e.fireColumnWidthChangedEvent(t)}),this.setLeftValues(t),this.updateBodyWidths(),i||this.dispatchColumnResizedEvent(y,!0,t)}buildDisplayedTrees(e){const t=[],i=[],n=[];e.forEach(e=>{switch(e.getPinned()){case"left":t.push(e);break;case"right":i.push(e);break;default:n.push(e)}});const s=new ut;this.displayedTreeLeft=this.displayedGroupCreator.createDisplayedGroups(t,s,"left",this.displayedTreeLeft),this.displayedTreeRight=this.displayedGroupCreator.createDisplayedGroups(i,s,"right",this.displayedTreeRight),this.displayedTreeCentre=this.displayedGroupCreator.createDisplayedGroups(n,s,null,this.displayedTreeCentre),this.updateDisplayedMap()}updateDisplayedMap(){this.displayedColumnsAndGroupsMap={};const e=e=>{this.displayedColumnsAndGroupsMap[e.getUniqueId()]=e};Dt(this.displayedTreeCentre,!1,e),Dt(this.displayedTreeLeft,!1,e),Dt(this.displayedTreeRight,!1,e)}isDisplayed(e){return this.displayedColumnsAndGroupsMap[e.getUniqueId()]===e}updateOpenClosedVisibilityInColumnGroups(){Dt(this.getAllDisplayedTrees(),!1,e=>{e instanceof lt&&e.calculateDisplayedColumns()})}getGroupAutoColumns(){return this.groupAutoColumns}createGroupAutoColumnsIfNeeded(){const e=this.forceRecreateAutoGroups;if(this.forceRecreateAutoGroups=!1,!this.autoGroupsNeedBuilding)return!1;this.autoGroupsNeedBuilding=!1;const t=this.gos.isGroupUseEntireRow(this.pivotMode),i=this.pivotMode?this.gos.get("pivotSuppressAutoColumn"):this.isGroupSuppressAutoColumn();if(!(this.rowGroupColumns.length>0||this.gos.get("treeData"))||i||t)this.groupAutoColumns=null;else{const t=this.autoGroupColService.createAutoGroupColumns(this.rowGroupColumns);if(!this.autoColsEqual(t,this.groupAutoColumns)||e)return this.groupAutoColumns=t,!0}return!1}isGroupSuppressAutoColumn(){return"custom"===this.gos.get("groupDisplayType")||"custom"===this.gos.get("treeDataDisplayType")}autoColsEqual(e,t){return Re(e,t,(e,t)=>e.getColId()===t.getColId())}getWidthOfColsInList(e){return e.reduce((e,t)=>e+t.getActualWidth(),0)}getFirstDisplayedColumn(){const e=this.gos.get("enableRtl"),t=["getDisplayedLeftColumns","getDisplayedCenterColumns","getDisplayedRightColumns"];e&&t.reverse();for(let i=0;i<t.length;i++){const n=this[t[i]]();if(n.length)return e?Ie(n):n[0]}return null}setColumnHeaderHeight(e,t){if(e.setAutoHeaderHeight(t)){const t={type:ct.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,column:e,columns:[e],source:"autosizeColumnHeaderHeight"};this.eventService.dispatchEvent(t)}}getColumnGroupHeaderRowHeight(){return this.isPivotMode()?this.getPivotGroupHeaderHeight():this.getGroupHeaderHeight()}getColumnHeaderRowHeight(){const e=this.isPivotMode()?this.getPivotHeaderHeight():this.getHeaderHeight(),t=this.getAllDisplayedColumns().filter(e=>e.isAutoHeaderHeight()).map(e=>e.getAutoHeaderHeight()||0);return Math.max(e,...t)}getHeaderHeight(){var e;return null!=(e=this.gos.get("headerHeight"))?e:this.environment.getFromTheme(25,"headerHeight")}getFloatingFiltersHeight(){var e;return null!=(e=this.gos.get("floatingFiltersHeight"))?e:this.getHeaderHeight()}getGroupHeaderHeight(){var e;return null!=(e=this.gos.get("groupHeaderHeight"))?e:this.getHeaderHeight()}getPivotHeaderHeight(){var e;return null!=(e=this.gos.get("pivotHeaderHeight"))?e:this.getHeaderHeight()}getPivotGroupHeaderHeight(){var e;return null!=(e=this.gos.get("pivotGroupHeaderHeight"))?e:this.getGroupHeaderHeight()}queueResizeOperations(){this.shouldQueueResizeOperations=!0}processResizeOperations(){this.shouldQueueResizeOperations=!1,this.resizeOperationQueue.forEach(e=>e()),this.resizeOperationQueue=[]}resetColumnDefIntoColumn(e,t){const i=e.getUserProvidedColDef();if(!i)return!1;const n=this.columnFactory.addColumnDefaultAndTypes(i,e.getColId());return e.setColDef(n,i,t),!0}isColumnGroupingLocked(e){const t=this.gos.get("groupLockGroupColumns");return!(!e.isRowGroupActive()||0===t)&&(-1===t||t>this.rowGroupColumns.findIndex(t=>t.getColId()===e.getColId()))}generateColumnStateForRowGroupAndPivotIndexes(e,t){let i={};const n=(e,t,n,s,r,o)=>{if(!t.length||!this.primaryColumns)return[];const a=Object.keys(e),l=new Set(a),c=new Set(a),h=new Set(t.map(e=>{const t=e.getColId();return c.delete(t),t}).concat(a)),u=[],d={};let p=0;for(let e=0;e<this.primaryColumns.length;e++){const t=this.primaryColumns[e].getColId();h.has(t)&&(u.push(t),d[t]=p++)}let g=1e3,f=!1,m=0;const y=t=>{const i=d[t];for(let t=m;t<i;t++){const i=u[t];c.has(i)&&(e[i][r]=g++,c.delete(i))}m=i};t.forEach(t=>{const a=t.getColId();if(l.has(a))y(a),e[a][r]=g++;else{const l=t.getColDef();(null===l[r]||void 0===l[r]&&null==l[o])&&(f||(l[n]||void 0===l[n]&&l[s]?y(a):(c.forEach(t=>{e[t][r]=g+d[t]}),g+=u.length,f=!0)),i[a]||(i[a]={colId:a}),i[a][r]=g++)}})};return n(e,this.rowGroupColumns,"rowGroup","initialRowGroup","rowGroupIndex","initialRowGroupIndex"),n(t,this.pivotColumns,"pivot","initialPivot","pivotIndex","initialPivotIndex"),Object.values(i)}onColumnsReady(){const e=this.gos.get("autoSizeStrategy");if(!e)return;const{type:t}=e;setTimeout(()=>{if("fitGridWidth"===t){const{columnLimits:t,defaultMinWidth:i,defaultMaxWidth:n}=e,s=null==t?void 0:t.map(({colId:e,minWidth:t,maxWidth:i})=>({key:e,minWidth:t,maxWidth:i}));this.ctrlsService.getGridBodyCtrl().sizeColumnsToFit({defaultMinWidth:i,defaultMaxWidth:n,columnLimits:s})}else"fitProvidedWidth"===t&&this.sizeColumnsToFit(e.width,"sizeColumnsToFit")})}onFirstDataRendered(){const e=this.gos.get("autoSizeStrategy");if("fitCellContents"!==(null==e?void 0:e.type))return;const{colIds:t,skipHeader:i}=e;setTimeout(()=>{t?this.autoSizeColumns({columns:t,skipHeader:i,source:"autosizeColumns"}):this.autoSizeAllColumns("autosizeColumns",i)})}};function Tt(e){return"gridOptionsUpdated"===e?"gridOptionsChanged":e}function Dt(e,t,i){if(e)for(let n=0;n<e.length;n++){const s=e[n];s instanceof lt&&Dt(t?s.getDisplayedChildren():s.getChildren(),t,i),i(s)}}f([ue("expressionService")],Mt.prototype,"expressionService",2),f([ue("columnFactory")],Mt.prototype,"columnFactory",2),f([ue("displayedGroupCreator")],Mt.prototype,"displayedGroupCreator",2),f([ue("ctrlsService")],Mt.prototype,"ctrlsService",2),f([ue("autoWidthCalculator")],Mt.prototype,"autoWidthCalculator",2),f([ue("columnAnimationService")],Mt.prototype,"columnAnimationService",2),f([ue("autoGroupColService")],Mt.prototype,"autoGroupColService",2),f([ue("valueCache")],Mt.prototype,"valueCache",2),f([ue("animationFrameService")],Mt.prototype,"animationFrameService",2),f([ue("sortController")],Mt.prototype,"sortController",2),f([ue("columnDefFactory")],Mt.prototype,"columnDefFactory",2),f([de("aggFuncService")],Mt.prototype,"aggFuncService",2),f([le],Mt.prototype,"init",1),f([ce],Mt.prototype,"destroyColumns",1),f([m(0,ge("loggerFactory"))],Mt.prototype,"setBeans",1),Mt=f([he("columnModel")],Mt);var It=class extends st{createDisplayedGroups(e,t,i,n){const s=this.mapOldGroupsById(n),r=[];let o=e;for(;o.length;){const e=o;o=[];let n=0;const a=a=>{const l=n;n=a;const c=e[l],h=(c instanceof lt?c.getProvidedColumnGroup():c).getOriginalParent();if(null==h){for(let t=l;t<a;t++)r.push(e[t]);return}const u=this.createColumnGroup(h,t,s,i);for(let t=l;t<a;t++)u.addChild(e[t]);o.push(u)};for(let t=1;t<e.length;t++){const i=e[t],s=(i instanceof lt?i.getProvidedColumnGroup():i).getOriginalParent(),r=e[n];s!==(r instanceof lt?r.getProvidedColumnGroup():r).getOriginalParent()&&a(t)}n<e.length&&a(e.length)}return this.setupParentsIntoColumns(r,null),r}createColumnGroup(e,t,i,n){const s=e.getGroupId(),r=t.getInstanceIdForKey(s);let o=i[lt.createUniqueId(s,r)];return o&&o.getProvidedColumnGroup()!==e&&(o=null),b(o)?o.reset():(o=new lt(e,s,r,n),this.context.createBean(o)),o}mapOldGroupsById(e){const t={},i=e=>{e.forEach(e=>{if(e instanceof lt){const n=e;t[e.getUniqueId()]=n,i(n.getChildren())}})};return e&&i(e),t}setupParentsIntoColumns(e,t){e.forEach(e=>{if(e.setParent(t),e instanceof lt){const t=e;this.setupParentsIntoColumns(t.getChildren(),t)}})}};It=f([he("displayedGroupCreator")],It);var Rt={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},kt=class{};kt.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"],kt.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"],kt.ARRAY_PROPERTIES=["sortingOrder","alignedGrids","rowData","columnDefs","excelStyles","pinnedTopRowData","pinnedBottomRowData","chartThemes","rowClass","paginationPageSizeSelector"],kt.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"],kt.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"],kt.OTHER_PROPERTIES=["suppressStickyTotalRow"],kt.FUNCTIONAL_PROPERTIES=["doesExternalFilterPass","processPivotResultColDef","processPivotResultColGroupDef","getBusinessKeyForNode","isRowSelectable","rowDragText","groupRowRenderer","fullWidthCellRenderer","loadingCellRenderer","loadingOverlayComponent","noRowsOverlayComponent","detailCellRenderer","quickFilterParser","quickFilterMatcher"],kt.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"],kt.FUNCTION_PROPERTIES=[...kt.FUNCTIONAL_PROPERTIES,...kt.CALLBACK_PROPERTIES],kt.ALL_PROPERTIES=[...kt.ARRAY_PROPERTIES,...kt.OBJECT_PROPERTIES,...kt.STRING_PROPERTIES,...kt.NUMBER_PROPERTIES,...kt.FUNCTION_PROPERTIES,...kt.BOOLEAN_PROPERTIES,...kt.OTHER_PROPERTIES];var Pt=kt,_t=class e{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(t,i){"object"!=typeof t&&(t={});const n=d({},t);return e.getGridOptionKeys().forEach(t=>{const s=i[t];void 0!==s&&s!==e.VUE_OMITTED_PROPERTY&&(n[t]=s)}),n}static processOnChange(t,i,n){if(!t)return;const s={};let r=!1;if(Object.keys(t).filter(t=>e.ALL_PROPERTIES_AND_CALLBACKS_SET.has(t)).forEach(e=>{s[e]=t[e],r=!0}),!r)return;i.__internalUpdateGridOptions(s,!0);const o={type:ct.EVENT_COMPONENT_STATE_CHANGED};P(s,(e,t)=>{o[e]=t}),i.dispatchEvent(o)}};_t.EVENTS=D(ct),_t.VUE_OMITTED_PROPERTY="AG-VUE-OMITTED-PROPERTY",_t.EXCLUDED_INTERNAL_EVENTS=[ct.EVENT_SCROLLBAR_WIDTH_CHANGED,ct.EVENT_CHECKBOX_CHANGED,ct.EVENT_HEIGHT_SCALE_CHANGED,ct.EVENT_BODY_HEIGHT_CHANGED,ct.EVENT_COLUMN_CONTAINER_WIDTH_CHANGED,ct.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,ct.EVENT_SCROLL_VISIBILITY_CHANGED,ct.EVENT_COLUMN_HOVER_CHANGED,ct.EVENT_FLASH_CELLS,ct.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED,ct.EVENT_DISPLAYED_ROWS_CHANGED,ct.EVENT_LEFT_PINNED_WIDTH_CHANGED,ct.EVENT_RIGHT_PINNED_WIDTH_CHANGED,ct.EVENT_ROW_CONTAINER_HEIGHT_CHANGED,ct.EVENT_STORE_UPDATED,ct.EVENT_COLUMN_PANEL_ITEM_DRAG_START,ct.EVENT_COLUMN_PANEL_ITEM_DRAG_END,ct.EVENT_KEY_SHORTCUT_CHANGED_CELL_START,ct.EVENT_KEY_SHORTCUT_CHANGED_CELL_END,ct.EVENT_FULL_WIDTH_ROW_FOCUSED,ct.EVENT_HEADER_HEIGHT_CHANGED,ct.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,ct.EVENT_CELL_FOCUS_CLEARED,ct.EVENT_GRID_STYLES_CHANGED,ct.EVENT_FILTER_DESTROYED,ct.EVENT_ROW_DATA_UPDATE_STARTED,ct.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,ct.EVENT_DATA_TYPES_INFERRED,ct.EVENT_FIELD_VALUE_CHANGED,ct.EVENT_FIELD_PICKER_VALUE_SELECTED,ct.EVENT_SUPPRESS_COLUMN_MOVE_CHANGED,ct.EVENT_SUPPRESS_MENU_HIDE_CHANGED,ct.EVENT_SUPPRESS_FIELD_DOT_NOTATION,ct.EVENT_ROW_COUNT_READY,ct.EVENT_SIDE_BAR_UPDATED],_t.PUBLIC_EVENTS=_t.EVENTS.filter(e=>!He(_t.EXCLUDED_INTERNAL_EVENTS,e)),_t.EVENT_CALLBACKS=_t.EVENTS.map(e=>_t.getCallbackForEvent(e)),_t.BOOLEAN_PROPERTIES=Pt.BOOLEAN_PROPERTIES,_t.ALL_PROPERTIES=Pt.ALL_PROPERTIES,_t.ALL_PROPERTIES_AND_CALLBACKS=[..._t.ALL_PROPERTIES,..._t.EVENT_CALLBACKS],_t.ALL_PROPERTIES_AND_CALLBACKS_SET=new Set(_t.ALL_PROPERTIES_AND_CALLBACKS);var Lt=_t,Nt=class extends st{constructor(){super(...arguments),this.componentsMappedByName={}}setupComponents(e){e&&e.forEach(e=>this.addComponent(e))}addComponent(e){const t=e.componentName.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase().toUpperCase();this.componentsMappedByName[t]=e.componentClass}getComponentClass(e){return this.componentsMappedByName[e]}};Nt=f([he("agStackComponentsRegistry")],Nt);var Ot={};function Ft(e,t,i){null==i||"string"==typeof i&&""==i?Bt(e,t):Gt(e,t,i)}function Gt(e,t,i){e.setAttribute(Vt(t),i.toString())}function Bt(e,t){e.removeAttribute(Vt(t))}function Vt(e){return`aria-${e}`}function Ht(e,t){t?e.setAttribute("role",t):e.removeAttribute("role")}function Ut(e){let t;return t="asc"===e?"ascending":"desc"===e?"descending":"mixed"===e?"other":"none",t}function zt(e){return parseInt(e.getAttribute("aria-level"),10)}function Wt(e){return parseInt(e.getAttribute("aria-posinset"),10)}function jt(e){return e.getAttribute("aria-label")}function $t(e,t){Ft(e,"label",t)}function Kt(e,t){Ft(e,"labelledby",t)}function Yt(e,t){Ft(e,"describedby",t)}function qt(e,t){Ft(e,"live",t)}function Xt(e,t){Ft(e,"atomic",t)}function Zt(e,t){Ft(e,"relevant",t)}function Qt(e,t){Ft(e,"level",t)}function Jt(e,t){Ft(e,"disabled",t)}function ei(e,t){Ft(e,"hidden",t)}function ti(e,t){Ft(e,"activedescendant",t)}function ii(e,t){Gt(e,"expanded",t)}function ni(e){Bt(e,"expanded")}function si(e,t){Gt(e,"setsize",t)}function ri(e,t){Gt(e,"posinset",t)}function oi(e,t){Gt(e,"multiselectable",t)}function ai(e,t){Gt(e,"rowcount",t)}function li(e,t){Gt(e,"rowindex",t)}function ci(e,t){Gt(e,"colcount",t)}function hi(e,t){Gt(e,"colindex",t)}function ui(e,t){Gt(e,"colspan",t)}function di(e,t){Gt(e,"sort",t)}function pi(e){Bt(e,"sort")}function gi(e,t){Ft(e,"selected",t)}function fi(e,t){Gt(e,"checked",void 0===t?"mixed":t)}function mi(e,t){Ft(e,"controls",t.id),Kt(t,e.id)}function yi(e,t){return void 0===t?e("ariaIndeterminate","indeterminate"):!0===t?e("ariaChecked","checked"):e("ariaUnchecked","unchecked")}g(Ot,{getAriaCheckboxStateName:()=>yi,getAriaLabel:()=>jt,getAriaLevel:()=>zt,getAriaPosInSet:()=>Wt,getAriaSortState:()=>Ut,removeAriaExpanded:()=>ni,removeAriaSort:()=>pi,setAriaActiveDescendant:()=>ti,setAriaAtomic:()=>Xt,setAriaChecked:()=>fi,setAriaColCount:()=>ci,setAriaColIndex:()=>hi,setAriaColSpan:()=>ui,setAriaControls:()=>mi,setAriaDescribedBy:()=>Yt,setAriaDisabled:()=>Jt,setAriaExpanded:()=>ii,setAriaHidden:()=>ei,setAriaLabel:()=>$t,setAriaLabelledBy:()=>Kt,setAriaLevel:()=>Qt,setAriaLive:()=>qt,setAriaMultiSelectable:()=>oi,setAriaPosInSet:()=>ri,setAriaRelevant:()=>Zt,setAriaRole:()=>Ht,setAriaRowCount:()=>ai,setAriaRowIndex:()=>li,setAriaSelected:()=>gi,setAriaSetSize:()=>si,setAriaSort:()=>di});var vi,bi,Ci,wi,Si,xi,Ei,Ai,Mi={};function Ti(){return void 0===vi&&(vi=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),vi}function Di(){if(void 0===bi)if(Ti()){const e=navigator.userAgent.match(/version\/(\d+)/i);e&&(bi=null!=e[1]?parseFloat(e[1]):0)}else bi=0;return bi}function Ii(){if(void 0===Ci){const e=window;Ci=!!e.chrome&&(!!e.chrome.webstore||!!e.chrome.runtime)||/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}return Ci}function Ri(){return void 0===wi&&(wi=/(firefox)/i.test(navigator.userAgent)),wi}function ki(){return void 0===Si&&(Si=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)),Si}function Pi(){return void 0===xi&&(xi=/iPad|iPhone|iPod/.test(navigator.platform)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1),xi}function _i(){return!Ti()||Di()>=15}function Li(e){if(!e)return null;const t=e.tabIndex,i=e.getAttribute("tabIndex");return-1!==t||null!==i&&(""!==i||Ri())?t.toString():null}function Ni(){if(!document.body)return-1;let e=1e6;const t=navigator.userAgent.toLowerCase().match(/firefox/)?6e6:1e9,i=document.createElement("div");for(document.body.appendChild(i);;){const n=2*e;if(i.style.height=n+"px",n>t||i.clientHeight!==n)break;e=n}return document.body.removeChild(i),e}function Oi(){var e,t,i;return null!=(i=null==(e=document.body)?void 0:e.clientWidth)?i:window.innerHeight||(null==(t=document.documentElement)?void 0:t.clientWidth)||-1}function Fi(){var e,t,i;return null!=(i=null==(e=document.body)?void 0:e.clientHeight)?i:window.innerHeight||(null==(t=document.documentElement)?void 0:t.clientHeight)||-1}function Gi(){return null==Ai&&Bi(),Ai}function Bi(){const e=document.body,t=document.createElement("div");t.style.width=t.style.height="100px",t.style.opacity="0",t.style.overflow="scroll",t.style.msOverflowStyle="scrollbar",t.style.position="absolute",e.appendChild(t);let i=t.offsetWidth-t.clientWidth;0===i&&0===t.clientWidth&&(i=null),t.parentNode&&t.parentNode.removeChild(t),null!=i&&(Ai=i,Ei=0===i)}function Vi(){return null==Ei&&Bi(),Ei}g(Mi,{browserSupportsPreventScroll:()=>_i,getBodyHeight:()=>Fi,getBodyWidth:()=>Oi,getMaxDivHeight:()=>Ni,getSafariVersion:()=>Di,getScrollbarWidth:()=>Gi,getTabIndex:()=>Li,isBrowserChrome:()=>Ii,isBrowserFirefox:()=>Ri,isBrowserSafari:()=>Ti,isIOSUserAgent:()=>Pi,isInvisibleScrollbar:()=>Vi,isMacOsUserAgent:()=>ki});var Hi={};g(Hi,{dateToFormattedString:()=>Qi,parseDateTimeFromString:()=>Ji,serialiseDate:()=>Xi});var Ui={};function zi(e,t){return e.toString().padStart(t,"0")}function Wi(e,t){const i=[];for(let n=e;n<=t;n++)i.push(n);return i}function ji(e){return"string"==typeof e&&(e=parseInt(e,10)),"number"==typeof e?Math.floor(e):null}function $i(e,t){let i="";for(let n=0;n<t;n++)i+=String.fromCharCode(255&e),e>>>=8;return i}function Ki(e,t,i){return"number"!=typeof e?"":Yi(Math.round(100*e)/100,t,i)}function Yi(e,t,i){return"number"!=typeof e?"":e.toString().replace(".",i).replace(/(\d)(?=(\d{3})+(?!\d))/g,`$1${t}`)}function qi(e){return null==e?null:e.reduce((e,t)=>e+t,0)}function Xi(e,t=!0,i="-"){if(!e)return null;let n=[e.getFullYear(),e.getMonth()+1,e.getDate()].map(e=>zi(e,2)).join(i);return t&&(n+=" "+[e.getHours(),e.getMinutes(),e.getSeconds()].map(e=>zi(e,2)).join(":")),n}g(Ui,{cleanNumber:()=>ji,createArrayOfNumbers:()=>Wi,decToHex:()=>$i,formatNumberCommas:()=>Yi,formatNumberTwoDecimalPlacesAndCommas:()=>Ki,padStartWidthZeros:()=>zi,sum:()=>qi});var Zi=e=>{if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd"}return"th"};function Qi(e,t="YYYY-MM-DD"){const i=zi(e.getFullYear(),4),n=["January","February","March","April","May","June","July","August","September","October","November","December"],s=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],r={YYYY:()=>i.slice(i.length-4,i.length),YY:()=>i.slice(i.length-2,i.length),Y:()=>`${e.getFullYear()}`,MMMM:()=>n[e.getMonth()],MMM:()=>n[e.getMonth()].slice(0,3),MM:()=>zi(e.getMonth()+1,2),Mo:()=>`${e.getMonth()+1}${Zi(e.getMonth()+1)}`,M:()=>`${e.getMonth()+1}`,Do:()=>`${e.getDate()}${Zi(e.getDate())}`,DD:()=>zi(e.getDate(),2),D:()=>`${e.getDate()}`,dddd:()=>s[e.getDay()],ddd:()=>s[e.getDay()].slice(0,3),dd:()=>s[e.getDay()].slice(0,2),do:()=>`${e.getDay()}${Zi(e.getDay())}`,d:()=>`${e.getDay()}`},o=new RegExp(Object.keys(r).join("|"),"g");return t.replace(o,e=>e in r?r[e]():e)}function Ji(e){if(!e)return null;const[t,i]=e.split(" ");if(!t)return null;const n=t.split("-").map(e=>parseInt(e,10));if(3!==n.filter(e=>!isNaN(e)).length)return null;const[s,r,o]=n,a=new Date(s,r-1,o);if(a.getFullYear()!==s||a.getMonth()!==r-1||a.getDate()!==o)return null;if(!i||"00:00:00"===i)return a;const[l,c,h]=i.split(":").map(e=>parseInt(e,10));return l>=0&&l<24&&a.setHours(l),c>=0&&c<60&&a.setMinutes(c),h>=0&&h<60&&a.setSeconds(h),a}var en,tn={};function nn(e,t,i){const n=e.parentElement;let s=n&&n.firstChild;for(;s;)t&&s.classList.toggle(t,s===e),i&&s.classList.toggle(i,s!==e),s=s.nextSibling}g(tn,{FOCUSABLE_EXCLUDE:()=>rn,FOCUSABLE_SELECTOR:()=>sn,addOrRemoveAttribute:()=>Bn,addStylesToElement:()=>Dn,bindCellRendererToHtmlElement:()=>Hn,clearElement:()=>Cn,copyNodeList:()=>Fn,ensureDomOrder:()=>An,formatSize:()=>Nn,getAbsoluteHeight:()=>gn,getAbsoluteWidth:()=>fn,getElementRectWithOffset:()=>mn,getElementSize:()=>un,getInnerHeight:()=>dn,getInnerWidth:()=>pn,getScrollLeft:()=>vn,insertWithDomOrder:()=>Tn,isElementChildOfClass:()=>hn,isFocusableFormField:()=>on,isHorizontalScrollShowing:()=>In,isInDOM:()=>Sn,isNodeOrElement:()=>On,isRtlNegativeScroll:()=>yn,isVerticalScrollShowing:()=>Rn,isVisible:()=>xn,iterateNamedNodeMap:()=>Gn,loadTemplate:()=>En,nodeListForEach:()=>Vn,radioCssClass:()=>nn,removeFromParent:()=>wn,setDisabled:()=>cn,setDisplayed:()=>an,setDomChildOrder:()=>Mn,setElementHeight:()=>_n,setElementWidth:()=>kn,setFixedHeight:()=>Ln,setFixedWidth:()=>Pn,setScrollLeft:()=>bn,setVisible:()=>ln});var sn="[tabindex], input, select, button, textarea, [href]",rn="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function on(e){const t=Element.prototype.matches||Element.prototype.msMatchesSelector,i=t.call(e,"input, select, button, textarea"),n=t.call(e,rn),s=xn(e);return i&&!n&&s}function an(e,t,i={}){const{skipAriaHidden:n}=i;e.classList.toggle("ag-hidden",!t),n||ei(e,!t)}function ln(e,t,i={}){const{skipAriaHidden:n}=i;e.classList.toggle("ag-invisible",!t),n||ei(e,!t)}function cn(e,t){const i="disabled",n=t?e=>e.setAttribute(i,""):e=>e.removeAttribute(i);n(e),Vn(e.querySelectorAll("input"),e=>n(e))}function hn(e,t,i){let n=0;for(;e;){if(e.classList.contains(t))return!0;if(e=e.parentElement,"number"==typeof i){if(++n>i)break}else if(e===i)break}return!1}function un(e){const{height:t,width:i,borderTopWidth:n,borderRightWidth:s,borderBottomWidth:r,borderLeftWidth:o,paddingTop:a,paddingRight:l,paddingBottom:c,paddingLeft:h,marginTop:u,marginRight:d,marginBottom:p,marginLeft:g,boxSizing:f}=window.getComputedStyle(e);return{height:parseFloat(t||"0"),width:parseFloat(i||"0"),borderTopWidth:parseFloat(n||"0"),borderRightWidth:parseFloat(s||"0"),borderBottomWidth:parseFloat(r||"0"),borderLeftWidth:parseFloat(o||"0"),paddingTop:parseFloat(a||"0"),paddingRight:parseFloat(l||"0"),paddingBottom:parseFloat(c||"0"),paddingLeft:parseFloat(h||"0"),marginTop:parseFloat(u||"0"),marginRight:parseFloat(d||"0"),marginBottom:parseFloat(p||"0"),marginLeft:parseFloat(g||"0"),boxSizing:f}}function dn(e){const t=un(e);return"border-box"===t.boxSizing?t.height-t.paddingTop-t.paddingBottom:t.height}function pn(e){const t=un(e);return"border-box"===t.boxSizing?t.width-t.paddingLeft-t.paddingRight:t.width}function gn(e){const t=un(e),i=t.marginBottom+t.marginTop;return Math.ceil(e.offsetHeight+i)}function fn(e){const t=un(e),i=t.marginLeft+t.marginRight;return Math.ceil(e.offsetWidth+i)}function mn(e){const t=e.getBoundingClientRect(),{borderTopWidth:i,borderLeftWidth:n,borderRightWidth:s,borderBottomWidth:r}=un(e);return{top:t.top+(i||0),left:t.left+(n||0),right:t.right+(s||0),bottom:t.bottom+(r||0)}}function yn(){if("boolean"==typeof en)return en;const e=document.createElement("div");return e.style.direction="rtl",e.style.width="1px",e.style.height="1px",e.style.position="fixed",e.style.top="0px",e.style.overflow="hidden",e.dir="rtl",e.innerHTML='<div style="width: 2px">\n            <span style="display: inline-block; width: 1px"></span>\n            <span style="display: inline-block; width: 1px"></span>\n        </div>',document.body.appendChild(e),e.scrollLeft=1,en=0===Math.floor(e.scrollLeft),document.body.removeChild(e),en}function vn(e,t){let i=e.scrollLeft;return t&&(i=Math.abs(i),Ii()&&!yn()&&(i=e.scrollWidth-e.clientWidth-i)),i}function bn(e,t,i){i&&(yn()?t*=-1:(Ti()||Ii())&&(t=e.scrollWidth-e.clientWidth-t)),e.scrollLeft=t}function Cn(e){for(;e&&e.firstChild;)e.removeChild(e.firstChild)}function wn(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Sn(e){return!!e.offsetParent}function xn(e){const t=e;return t.checkVisibility?t.checkVisibility({checkVisibilityCSS:!0}):!(!Sn(e)||"visible"!==window.getComputedStyle(e).visibility)}function En(e){const t=document.createElement("div");return t.innerHTML=(e||"").trim(),t.firstChild}function An(e,t,i){i&&i.nextSibling===t||(i?i.nextSibling?e.insertBefore(t,i.nextSibling):e.appendChild(t):e.firstChild&&e.firstChild!==t&&e.insertAdjacentElement("afterbegin",t))}function Mn(e,t){for(let i=0;i<t.length;i++){const n=t[i],s=e.children[i];s!==n&&e.insertBefore(n,s)}}function Tn(e,t,i){i?i.insertAdjacentElement("afterend",t):e.firstChild?e.insertAdjacentElement("afterbegin",t):e.appendChild(t)}function Dn(e,t){if(t)for(const[i,n]of Object.entries(t)){if(!i||!i.length||null==n)continue;const t=wt(i),s=n.toString(),r=s.replace(/\s*!important/g,""),o=r.length!=s.length?"important":void 0;e.style.setProperty(t,r,o)}}function In(e){return e.clientWidth<e.scrollWidth}function Rn(e){return e.clientHeight<e.scrollHeight}function kn(e,t){"flex"===t?(e.style.removeProperty("width"),e.style.removeProperty("minWidth"),e.style.removeProperty("maxWidth"),e.style.flex="1 1 auto"):Pn(e,t)}function Pn(e,t){t=Nn(t),e.style.width=t.toString(),e.style.maxWidth=t.toString(),e.style.minWidth=t.toString()}function _n(e,t){"flex"===t?(e.style.removeProperty("height"),e.style.removeProperty("minHeight"),e.style.removeProperty("maxHeight"),e.style.flex="1 1 auto"):Ln(e,t)}function Ln(e,t){t=Nn(t),e.style.height=t.toString(),e.style.maxHeight=t.toString(),e.style.minHeight=t.toString()}function Nn(e){return"number"==typeof e?`${e}px`:e}function On(e){return e instanceof Node||e instanceof HTMLElement}function Fn(e){if(null==e)return[];const t=[];return Vn(e,e=>t.push(e)),t}function Gn(e,t){if(e)for(let i=0;i<e.length;i++){const n=e[i];t(n.name,n.value)}}function Bn(e,t,i){null==i?e.removeAttribute(t):e.setAttribute(t,i.toString())}function Vn(e,t){if(null!=e)for(let i=0;i<e.length;i++)t(e[i])}function Hn(e,t){e.then(e=>{const i=e.getGui();null!=i&&("object"==typeof i?t.appendChild(i):t.innerHTML=i)})}var Un={};function zn(e,t,i){const n={},s=e.filter(e=>!t.some(t=>t===e));return s.length>0&&s.forEach(e=>n[e]=Wn(e,i).values),n}function Wn(e,t,i,n){let s=t.map((t,i)=>({value:t,relevance:jn(e.toLowerCase(),t.toLocaleLowerCase()),idx:i}));if(s.sort((e,t)=>t.relevance-e.relevance),i&&(s=s.filter(e=>0!==e.relevance)),s.length>0&&n&&n>0){const e=s[0].relevance*n;s=s.filter(t=>e-t.relevance<0)}const r=[],o=[];for(const e of s)r.push(e.value),o.push(e.idx);return{values:r,indices:o}}function jn(e,t){const i=e.replace(/\s/g,""),n=t.replace(/\s/g,"");let s=0,r=-1;for(let e=0;e<i.length;e++){const t=n.indexOf(i[e],r+1);-1!==t&&(r=t,s+=100-100*r/1e4*100)}return s}g(Un,{fuzzyCheckStrings:()=>zn,fuzzySuggestions:()=>Wn});var $n={};g($n,{createIcon:()=>Yn,createIconNoSpan:()=>qn,iconNameClassMap:()=>Kn});var Kn={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 Yn(e,t,i){const n=qn(e,t,i);if(n){const{className:e}=n;if("string"==typeof e&&e.indexOf("ag-icon")>-1||"object"==typeof e&&e["ag-icon"])return n}const s=document.createElement("span");return s.appendChild(n),s}function qn(e,t,i,n){let s=null;const r=i&&i.getColDef().icons;if(r&&(s=r[e]),t&&!s){const i=t.get("icons");i&&(s=i[e])}if(!s){const t=document.createElement("span");let i=Kn[e];return i||(n?i=e:(console.warn(`AG Grid: Did not find icon ${e}`),i="")),t.setAttribute("class",`ag-icon ag-icon-${i}`),t.setAttribute("unselectable","on"),Ht(t,"presentation"),t}{let e;if("function"==typeof s)e=s();else{if("string"!=typeof s)throw new Error("icon from grid options needs to be a string or a function");e=s}if("string"==typeof e)return En(e);if(On(e))return e;console.warn("AG Grid: iconRenderer should return back a string or a dom object")}}var Xn={};g(Xn,{isDeleteKey:()=>is,isEventFromPrintableCharacter:()=>Qn,isUserSuppressingHeaderKeyboardEvent:()=>es,isUserSuppressingKeyboardEvent:()=>Jn,normaliseQwertyAzerty:()=>ts});var Zn=class{};function Qn(e){return!(e.altKey||e.ctrlKey||e.metaKey)&&1===e.key.length}function Jn(e,t,i,n,s){const r=n?n.getColDef().suppressKeyboardEvent:void 0;if(!r)return!1;const o=e.addGridCommonParams({event:t,editing:s,column:n,node:i,data:i.data,colDef:n.getColDef()});return!(!r||!r(o))}function es(e,t,i,n){const s=n.getDefinition(),r=s&&s.suppressHeaderKeyboardEvent;return!!b(r)&&!!r(e.addGridCommonParams({colDef:s,column:n,headerRowIndex:i,event:t}))}function ts(e){const{keyCode:t}=e;let i;switch(t){case 65:i=Zn.A;break;case 67:i=Zn.C;break;case 86:i=Zn.V;break;case 68:i=Zn.D;break;case 90:i=Zn.Z;break;case 89:i=Zn.Y;break;default:i=e.code}return i}function is(e,t=!1){return e===Zn.DELETE||!t&&e===Zn.BACKSPACE&&ki()}Zn.BACKSPACE="Backspace",Zn.TAB="Tab",Zn.ENTER="Enter",Zn.ESCAPE="Escape",Zn.SPACE=" ",Zn.LEFT="ArrowLeft",Zn.UP="ArrowUp",Zn.RIGHT="ArrowRight",Zn.DOWN="ArrowDown",Zn.DELETE="Delete",Zn.F2="F2",Zn.PAGE_UP="PageUp",Zn.PAGE_DOWN="PageDown",Zn.PAGE_HOME="Home",Zn.PAGE_END="End",Zn.A="KeyA",Zn.C="KeyC",Zn.D="KeyD",Zn.V="KeyV",Zn.X="KeyX",Zn.Y="KeyY",Zn.Z="KeyZ";var ns={};function ss(e,t,i){if(0===i)return!1;const n=Math.abs(e.clientX-t.clientX),s=Math.abs(e.clientY-t.clientY);return Math.max(n,s)<=i}g(ns,{areEventsNear:()=>ss});var rs={};function os(e,t){if(!e)return!1;const i=(e,i)=>{const n=t[e.id],s=t[i.id],r=void 0!==n,o=void 0!==s;return r&&o?n-s:r||o?r?1:-1:e.__objectId-i.__objectId};let n,s,r=!1;for(let t=0;t<e.length-1;t++)if(n=e[t],s=e[t+1],i(n,s)>0){r=!0;break}return!!r&&(e.sort(i),!0)}g(rs,{sortRowNodesByOrder:()=>os});var as={};function ls(e){const t=new Set;return e.forEach(e=>t.add(e)),t}g(as,{convertToSet:()=>ls});var cs=d(d(d(d(d(d(d(d(d(d(d(d(d(d(d(d(d(d({},Ot),Te),Mi),Hi),tn),Me),V),Un),y),$n),Xn),St),ns),Ui),R),rs),as),gt),hs=class{constructor(e=0,t=1){this.nextValue=e,this.step=t}next(){const e=this.nextValue;return this.nextValue+=this.step,e}peek(){return this.nextValue}skip(e){this.nextValue+=e}},us=class e{constructor(e){this.status=0,this.resolution=null,this.waiters=[],e(e=>this.onDone(e),e=>this.onReject(e))}static all(t){return new e(e=>{let i=t.length;const n=new Array(i);t.forEach((t,s)=>{t.then(t=>{n[s]=t,i--,0===i&&e(n)})})})}static resolve(t=null){return new e(e=>e(t))}then(t){return new e(e=>{1===this.status?e(t(this.resolution)):this.waiters.push(i=>e(t(i)))})}resolveNow(e,t){return 1===this.status?t(this.resolution):e}onDone(e){this.status=1,this.resolution=e,this.waiters.forEach(t=>t(e))}onReject(e){console.warn("TBI")}},ds=class{constructor(e){this.cssClassStates={},this.getGui=e}addCssClass(e){const t=(e||"").split(" ");if(t.length>1)t.forEach(e=>this.addCssClass(e));else if(!0!==this.cssClassStates[e]&&e.length){const t=this.getGui();t&&t.classList.add(e),this.cssClassStates[e]=!0}}removeCssClass(e){const t=(e||"").split(" ");if(t.length>1)t.forEach(e=>this.removeCssClass(e));else if(!1!==this.cssClassStates[e]&&e.length){const t=this.getGui();t&&t.classList.remove(e),this.cssClassStates[e]=!1}}containsCssClass(e){const t=this.getGui();return!!t&&t.classList.contains(e)}addOrRemoveCssClass(e,t){if(e){if(e.indexOf(" ")>=0){const i=(e||"").split(" ");if(i.length>1)return void i.forEach(e=>this.addOrRemoveCssClass(e,t))}if(this.cssClassStates[e]!==t&&e.length){const i=this.getGui();i&&i.classList.toggle(e,t),this.cssClassStates[e]=t}}}},ps=class e extends st{constructor(e,t,i,n){super(),this.parentComp=e,this.tooltipShowDelayOverride=t,this.tooltipHideDelayOverride=i,this.shouldDisplayTooltip=n,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();0===this.tooltipTrigger&&(this.addManagedListener(e,"mouseenter",this.onMouseEnter.bind(this)),this.addManagedListener(e,"mouseleave",this.onMouseLeave.bind(this))),1===this.tooltipTrigger&&(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&&z(`${e} should not be lower than 0`),Math.max(200,t)}getTooltipDelay(e){var t,i;return"show"===e?null!=(t=this.tooltipShowDelayOverride)?t:this.getGridOptionsTooltipDelay("tooltipShowDelay"):null!=(i=this.tooltipHideDelayOverride)?i:this.getGridOptionsTooltipDelay("tooltipHideDelay")}destroy(){this.setToDoNothing(),super.destroy()}getTooltipTrigger(){const e=this.gos.get("tooltipTrigger");return e&&"hover"!==e?1:0}onMouseEnter(t){this.interactionEnabled&&this.interactiveTooltipTimeoutId&&(this.unlockService(),this.startHideTimeout()),Pi()||(e.isLocked?this.showTooltipTimeoutId=window.setTimeout(()=>{this.prepareToShowTooltip(t)},this.INTERACTIVE_HIDE_DELAY):this.prepareToShowTooltip(t))}onMouseMove(e){this.lastMouseEvent&&(this.lastMouseEvent=e),this.tooltipMouseTrack&&2===this.state&&this.tooltipComp&&this.positionTooltip()}onMouseDown(){this.setToDoNothing()}onMouseLeave(){this.interactionEnabled?this.lockService():this.setToDoNothing()}onFocusIn(){this.prepareToShowTooltip()}onFocusOut(e){var t;const i=e.relatedTarget,n=this.parentComp.getGui(),s=null==(t=this.tooltipComp)?void 0:t.getGui();this.isInteractingWithTooltip||n.contains(i)||this.interactionEnabled&&(null==s?void 0:s.contains(i))||this.setToDoNothing()}onKeyDown(){this.setToDoNothing()}prepareToShowTooltip(t){if(0!=this.state||e.isLocked)return;let i=0;t&&(i=this.isLastTooltipHiddenRecently()?200:this.getTooltipDelay("show")),this.lastMouseEvent=t||null,this.showTooltipTimeoutId=window.setTimeout(this.showTooltip.bind(this),i),this.state=1}isLastTooltipHiddenRecently(){return(new Date).getTime()-e.lastTooltipHideTime<this.SHOW_QUICK_TOOLTIP_DIFF}setToDoNothing(){2===this.state&&this.hideTooltip(),this.onBodyScrollEventCallback&&(this.onBodyScrollEventCallback(),this.onBodyScrollEventCallback=void 0),this.onColumnMovedEventCallback&&(this.onColumnMovedEventCallback(),this.onColumnMovedEventCallback=void 0),this.clearTimeouts(),this.state=0,this.lastMouseEvent=null}showTooltip(){const e=d({},this.parentComp.getTooltipParams());if(!b(e.value)||this.shouldDisplayTooltip&&!this.shouldDisplayTooltip())return void this.setToDoNothing();this.state=2,this.tooltipInstanceCount++;const t=this.newTooltipComponentCallback.bind(this,this.tooltipInstanceCount);this.userComponentFactory.getTooltipCompDetails(e).newAgStackInstance().then(t)}hideTooltip(t){if(!t&&this.isInteractingWithTooltip)return;this.tooltipComp&&(this.destroyTooltipComp(),e.lastTooltipHideTime=(new Date).getTime());const i={type:ct.EVENT_TOOLTIP_HIDE,parentGui:this.parentComp.getGui()};this.eventService.dispatchEvent(i),this.state=0}newTooltipComponentCallback(e,t){if(2!==this.state||this.tooltipInstanceCount!==e)return void this.getContext().destroyBean(t);const i=t.getGui();this.tooltipComp=t,i.classList.contains("ag-tooltip")||i.classList.add("ag-tooltip-custom"),0===this.tooltipTrigger&&i.classList.add("ag-tooltip-animate"),this.interactionEnabled&&i.classList.add("ag-tooltip-interactive");const n=this.localeService.getLocaleTextFunc(),s=this.popupService.addPopup({eChild:i,ariaLabel:n("ariaLabelTooltip","Tooltip")});s&&(this.tooltipPopupDestroyFunc=s.hideFunc),this.positionTooltip(),1===this.tooltipTrigger&&(this.onBodyScrollEventCallback=this.addManagedListener(this.eventService,ct.EVENT_BODY_SCROLL,this.setToDoNothing.bind(this)),this.onColumnMovedEventCallback=this.addManagedListener(this.eventService,ct.EVENT_COLUMN_MOVED,this.setToDoNothing.bind(this))),this.interactionEnabled&&(0===this.tooltipTrigger?(this.tooltipMouseEnterListener=this.addManagedListener(i,"mouseenter",this.onTooltipMouseEnter.bind(this))||null,this.tooltipMouseLeaveListener=this.addManagedListener(i,"mouseleave",this.onTooltipMouseLeave.bind(this))||null):(this.tooltipFocusInListener=this.addManagedListener(i,"focusin",this.onTooltipFocusIn.bind(this))||null,this.tooltipFocusOutListener=this.addManagedListener(i,"focusout",this.onTooltipFocusOut.bind(this))||null));const r={type:ct.EVENT_TOOLTIP_SHOW,tooltipGui:i,parentGui:this.parentComp.getGui()};this.eventService.dispatchEvent(r),this.startHideTimeout()}onTooltipMouseEnter(){this.isInteractingWithTooltip=!0,this.unlockService()}onTooltipMouseLeave(){this.isInteractingWithTooltip=!1,this.lockService()}onTooltipFocusIn(){this.isInteractingWithTooltip=!0}onTooltipFocusOut(e){var t;const i=this.parentComp.getGui(),n=null==(t=this.tooltipComp)?void 0:t.getGui(),s=e.relatedTarget;(null==n?void 0:n.contains(s))||(this.isInteractingWithTooltip=!1,i.contains(s)?this.startHideTimeout():this.hideTooltip())}positionTooltip(){const e={type:"tooltip",ePopup:this.tooltipComp.getGui(),nudgeY:18,skipObserver:this.tooltipMouseTrack};this.lastMouseEvent?this.popupService.positionPopupUnderMouseEvent(p(d({},e),{mouseEvent:this.lastMouseEvent})):this.popupService.positionPopupByComponent(p(d({},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,i=0===this.tooltipTrigger?this.FADE_OUT_TOOLTIP_TIMEOUT:0;window.setTimeout(()=>{e(),this.getContext().destroyBean(t)},i),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(){e.isLocked=!0,this.interactiveTooltipTimeoutId=window.setTimeout(()=>{this.unlockService(),this.setToDoNothing()},this.INTERACTIVE_HIDE_DELAY)}unlockService(){e.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()}};ps.isLocked=!1,f([ue("popupService")],ps.prototype,"popupService",2),f([ue("userComponentFactory")],ps.prototype,"userComponentFactory",2),f([le],ps.prototype,"postConstruct",1);var gs=ps,fs=class extends st{constructor(e,t){super(),this.ctrl=e,t&&(this.beans=t)}postConstruct(){this.refreshToolTip()}setBrowserTooltip(e){const t="title",i=this.ctrl.getGui();i&&(null!=e&&""!=e?i.setAttribute(t,e):i.removeAttribute(t))}updateTooltipText(){this.tooltip=this.ctrl.getTooltipValue()}createTooltipFeatureIfNeeded(){var e,t,i,n;if(null!=this.tooltipManager)return;const s={getTooltipParams:()=>this.getTooltipParams(),getGui:()=>this.ctrl.getGui()};this.tooltipManager=this.createBean(new gs(s,null==(t=(e=this.ctrl).getTooltipShowDelayOverride)?void 0:t.call(e),null==(n=(i=this.ctrl).getTooltipHideDelayOverride)?void 0:n.call(i),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 e=this.ctrl,t=e.getColumn?e.getColumn():void 0,i=e.getColDef?e.getColDef():void 0,n=e.getRowNode?e.getRowNode():void 0;return{location:e.getLocation(),colDef:i,column:t,rowIndex:e.getRowIndex?e.getRowIndex():void 0,node:n,data:n?n.data:void 0,value:this.getTooltipText(),valueFormatted:e.getValueFormatted?e.getValueFormatted():void 0,hideTooltipCallback:()=>{var e;return null==(e=this.tooltipManager)?void 0:e.hideTooltip(!0)}}}getTooltipText(){return this.tooltip}destroy(){this.tooltipManager&&(this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context)),super.destroy()}};f([ue("beans")],fs.prototype,"beans",2),f([le],fs.prototype,"postConstruct",1);var ms=new hs,ys=class e extends st{constructor(e){super(),this.displayed=!0,this.visible=!0,this.compId=ms.next(),this.cssClassManager=new ds(()=>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:i,hideDelayOverride:n,location:s,shouldDisplayTooltip:r}=e||{};this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),this.tooltipText!==t&&(this.tooltipText=t);null!=t&&(this.tooltipFeature=this.createBean(new fs({getTooltipValue:()=>this.tooltipText,getGui:()=>this.getGui(),getLocation:()=>null!=s?s:"UNKNOWN",getColDef:null==e?void 0:e.getColDef,getColumn:null==e?void 0:e.getColumn,getTooltipShowDelayOverride:null!=i?()=>i:void 0,getTooltipHideDelayOverride:null!=n?()=>n:void 0,shouldDisplayTooltip:r})))}createChildComponentsFromTags(e,t){Fn(e.childNodes).forEach(i=>{if(!(i instanceof HTMLElement))return;const n=this.createComponentFromElement(i,e=>{e.getGui()&&this.copyAttributesFromNode(i,e.getGui())},t);if(n){if(n.addItems&&i.children.length){this.createChildComponentsFromTags(i,t);const e=Array.prototype.slice.call(i.children);n.addItems(e)}this.swapComponentForNode(n,e,i)}else i.childNodes&&this.createChildComponentsFromTags(i,t)})}createComponentFromElement(t,i,n){const s=t.nodeName,r=n?n[t.getAttribute("ref")]:void 0,o=this.agStackComponentsRegistry.getComponentClass(s);if(o){e.elementGettingCreated=t;const n=new o(r);return n.setParentComponent(this),this.createBean(n,null,i),n}return null}copyAttributesFromNode(e,t){Gn(e.attributes,(e,i)=>t.setAttribute(e,i))}swapComponentForNode(e,t,i){const n=e.getGui();t.replaceChild(n,i),t.insertBefore(document.createComment(i.nodeName),n),this.addDestroyFunc(this.destroyBean.bind(this,e)),this.swapInComponentForQuerySelectors(e,i)}swapInComponentForQuerySelectors(e,t){const i=this;this.iterateOverQuerySelectors(n=>{i[n.attributeName]===t&&(i[n.attributeName]=e)})}iterateOverQuerySelectors(e){let t=Object.getPrototypeOf(this);for(;null!=t;){const i=t.__agComponentMetaData,n=j(t.constructor);i&&i[n]&&i[n].querySelectors&&i[n].querySelectors.forEach(t=>e(t)),t=Object.getPrototypeOf(t)}}activateTabIndex(e){const t=this.gos.get("tabIndex");e||(e=[]),e.length||e.push(this.getGui()),e.forEach(e=>e.setAttribute("tabindex",t.toString()))}setTemplate(e,t){const i=En(e);this.setTemplateFromElement(i,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 i=i=>e[t.attributeName]=i;if(t.refSelector&&this.getAttribute("ref")===t.refSelector)i(this.eGui);else{const e=this.eGui.querySelector(t.querySelector);e&&i(e.__agComponent||e)}})}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(null!=e)if(t||(t=this.eGui),On(e))t.appendChild(e);else{const i=e;t.appendChild(i.getGui())}}isDisplayed(){return this.displayed}setVisible(e,t={}){if(e!==this.visible){this.visible=e;const{skipAriaHidden:i}=t;ln(this.eGui,e,{skipAriaHidden:i})}}setDisplayed(t,i={}){if(t!==this.displayed){this.displayed=t;const{skipAriaHidden:n}=i;an(this.eGui,t,{skipAriaHidden:n});const s={type:e.EVENT_DISPLAYED_CHANGED,visible:this.displayed};this.dispatchEvent(s)}}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,i){this.eGui.addEventListener(e,t,i),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}"]`)}};ys.EVENT_DISPLAYED_CHANGED="displayedChanged",f([ue("agStackComponentsRegistry")],ys.prototype,"agStackComponentsRegistry",2),f([ae],ys.prototype,"preConstructOnComponent",1),f([ae],ys.prototype,"createChildComponentsPreConstruct",1);var vs=ys;function bs(e){return Cs.bind(this,`[ref=${e}]`,e)}function Cs(e,t,i,n,s){null!==e?"number"!=typeof s?function(e,t,i){const n=function(e,t){return e.__agComponentMetaData||(e.__agComponentMetaData={}),e.__agComponentMetaData[t]||(e.__agComponentMetaData[t]={}),e.__agComponentMetaData[t]}(e,j(e.constructor));n[t]||(n[t]=[]),n[t].push(i)}(i,"querySelectors",{attributeName:n,querySelector:e,refSelector:t}):console.error("AG Grid: QuerySelector should be on an attribute"):console.error("AG Grid: QuerySelector selector should not be null")}var ws=class extends vs{constructor(){super('\n            <div class="ag-floating-filter-input" role="presentation">\n                <ag-input-text-field ref="eFloatingFilterText"></ag-input-text-field>\n            </div>')}destroy(){super.destroy()}init(e){this.params=e;const t=this.columnModel.getDisplayNameForColumn(e.column,"header",!0),i=this.localeService.getLocaleTextFunc();this.eFloatingFilterText.setDisabled(!0).setInputAriaLabel(`${t} ${i("ariaFilterInput","Filter Input")}`)}onParentModelChanged(e){null!=e?this.params.parentFilterInstance(t=>{if(t.getModelAsString){const i=t.getModelAsString(e);this.eFloatingFilterText.setValue(i)}}):this.eFloatingFilterText.setValue("")}onParamsUpdated(e){this.refresh(e)}refresh(e){this.init(e)}};f([bs("eFloatingFilterText")],ws.prototype,"eFloatingFilterText",2),f([ue("columnModel")],ws.prototype,"columnModel",2);var Ss=class{constructor(e,t,i,n,s){this.alive=!0,this.context=e,this.eParent=n,t.getDateCompDetails(i).newAgStackInstance().then(t=>{this.alive?(this.dateComp=t,t&&(n.appendChild(t.getGui()),t.afterGuiAttached&&t.afterGuiAttached(),this.tempValue&&t.setDate(this.tempValue),null!=this.disabled&&this.setDateCompDisabled(this.disabled),null==s||s(this))):e.destroyBean(t)})}destroy(){this.alive=!1,this.dateComp=this.context.destroyBean(this.dateComp)}getDate(){return this.dateComp?this.dateComp.getDate():this.tempValue}setDate(e){this.dateComp?this.dateComp.setDate(e):this.tempValue=e}setDisabled(e){this.dateComp?this.setDateCompDisabled(e):this.disabled=e}setDisplayed(e){an(this.eParent,e)}setInputPlaceholder(e){this.dateComp&&this.dateComp.setInputPlaceholder&&this.dateComp.setInputPlaceholder(e)}setInputAriaLabel(e){this.dateComp&&this.dateComp.setInputAriaLabel&&this.dateComp.setInputAriaLabel(e)}afterGuiAttached(e){this.dateComp&&"function"==typeof this.dateComp.afterGuiAttached&&this.dateComp.afterGuiAttached(e)}updateParams(e){var t,i;let n=!1;(null==(t=this.dateComp)?void 0:t.refresh)&&"function"==typeof this.dateComp.refresh&&null!==this.dateComp.refresh(e)&&(n=!0),!n&&(null==(i=this.dateComp)?void 0:i.onParamsUpdated)&&"function"==typeof this.dateComp.onParamsUpdated&&null!==this.dateComp.onParamsUpdated(e)&&z("Custom date component method 'onParamsUpdated' is deprecated. Use 'refresh' instead.")}setDateCompDisabled(e){null!=this.dateComp&&null!=this.dateComp.setDisabled&&this.dateComp.setDisabled(e)}},xs=class{constructor(){this.customFilterOptions={}}init(e,t){this.filterOptions=e.filterOptions||t,this.mapCustomOptions(),this.selectDefaultItem(e)}getFilterOptions(){return this.filterOptions}mapCustomOptions(){this.filterOptions&&this.filterOptions.forEach(e=>{"string"!=typeof e&&([["displayKey"],["displayName"],["predicate","test"]].every(t=>!!t.some(t=>null!=e[t])||(console.warn(`AG Grid: ignoring FilterOptionDef as it doesn't contain one of '${t}'`),!1))?this.customFilterOptions[e.displayKey]=e:this.filterOptions=this.filterOptions.filter(t=>t===e)||[])})}selectDefaultItem(e){if(e.defaultOption)this.defaultOption=e.defaultOption;else if(this.filterOptions.length>=1){const e=this.filterOptions[0];"string"==typeof e?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(e){return this.customFilterOptions[e]}},Es={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"},As=class e extends st{constructor(e,t={}){super(),this.eFocusableElement=e,this.callbacks=t,this.callbacks=d({shouldStopEventPropagation:()=>!1,onTabKeyDown:e=>{if(e.defaultPrevented)return;const t=this.focusService.findNextFocusableElement(this.eFocusableElement,!1,e.shiftKey);t&&(t.focus(),e.preventDefault())}},t)}postConstruct(){this.eFocusableElement.classList.add(e.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",e=>{e.defaultPrevented||Xe(e)||(this.callbacks.shouldStopEventPropagation(e)?qe(e):e.key===Zn.TAB?this.callbacks.onTabKeyDown(e):this.callbacks.handleKeyDown&&this.callbacks.handleKeyDown(e))})}};As.FOCUS_MANAGED_CLASS="ag-focus-managed",f([ue("focusService")],As.prototype,"focusService",2),f([le],As.prototype,"postConstruct",1);var Ms=As,Ts="ag-resizer-wrapper",Ds=`<div class="${Ts}">\n        <div ref="eTopLeftResizer" class="ag-resizer ag-resizer-topLeft"></div>\n        <div ref="eTopResizer" class="ag-resizer ag-resizer-top"></div>\n        <div ref="eTopRightResizer" class="ag-resizer ag-resizer-topRight"></div>\n        <div ref="eRightResizer" class="ag-resizer ag-resizer-right"></div>\n        <div ref="eBottomRightResizer" class="ag-resizer ag-resizer-bottomRight"></div>\n        <div ref="eBottomResizer" class="ag-resizer ag-resizer-bottom"></div>\n        <div ref="eBottomLeftResizer" class="ag-resizer ag-resizer-bottomLeft"></div>\n        <div ref="eLeftResizer" class="ag-resizer ag-resizer-left"></div>\n    </div>`,Is=class extends st{constructor(e,t){super(),this.element=e,this.dragStartPosition={x:0,y:0},this.position={x:0,y:0},this.lastSize={width:-1,height:-1},this.positioned=!1,this.resizersAdded=!1,this.resizeListeners=[],this.boundaryEl=null,this.isResizing=!1,this.isMoving=!1,this.resizable={},this.movable=!1,this.currentResizer=null,this.config=Object.assign({},{popup:!1},t)}center(){const{clientHeight:e,clientWidth:t}=this.offsetParent,i=t/2-this.getWidth()/2,n=e/2-this.getHeight()/2;this.offsetElement(i,n)}initialisePosition(){if(this.positioned)return;const{centered:e,forcePopupParentAsOffsetParent:t,minWidth:i,width:n,minHeight:s,height:r,x:o,y:a}=this.config;this.offsetParent||this.setOffsetParent();let l=0,c=0;const h=xn(this.element);if(h){const e=this.findBoundaryElement(),t=window.getComputedStyle(e);if(null!=t.minWidth){const i=e.offsetWidth-this.element.offsetWidth;c=parseInt(t.minWidth,10)-i}if(null!=t.minHeight){const i=e.offsetHeight-this.element.offsetHeight;l=parseInt(t.minHeight,10)-i}}if(this.minHeight=s||l,this.minWidth=i||c,n&&this.setWidth(n),r&&this.setHeight(r),n&&r||this.refreshSize(),e)this.center();else if(o||a)this.offsetElement(o,a);else if(h&&t){let e=this.boundaryEl,t=!0;if(e||(e=this.findBoundaryElement(),t=!1),e){const i=parseFloat(e.style.top),n=parseFloat(e.style.left);t?this.offsetElement(isNaN(n)?0:n,isNaN(i)?0:i):this.setPosition(n,i)}}this.positioned=!!this.offsetParent}isPositioned(){return this.positioned}getPosition(){return this.position}setMovable(e,t){if(!this.config.popup||e===this.movable)return;this.movable=e;const i=this.moveElementDragListener||{eElement:t,onDragStart:this.onMoveStart.bind(this),onDragging:this.onMove.bind(this),onDragStop:this.onMoveEnd.bind(this)};e?(this.dragService.addDragSource(i),this.moveElementDragListener=i):(this.dragService.removeDragSource(i),this.moveElementDragListener=void 0)}setResizable(e){if(this.clearResizeListeners(),e?this.addResizers():this.removeResizers(),"boolean"==typeof e){if(!1===e)return;e={topLeft:e,top:e,topRight:e,right:e,bottomRight:e,bottom:e,bottomLeft:e,left:e}}Object.keys(e).forEach(t=>{const i=!!e[t],n=this.getResizerElement(t),s={dragStartPixels:0,eElement:n,onDragStart:e=>this.onResizeStart(e,t),onDragging:this.onResize.bind(this),onDragStop:e=>this.onResizeEnd(e,t)};(i||!this.isAlive()&&!i)&&(i?(this.dragService.addDragSource(s),this.resizeListeners.push(s),n.style.pointerEvents="all"):n.style.pointerEvents="none",this.resizable[t]=i)})}removeSizeFromEl(){this.element.style.removeProperty("height"),this.element.style.removeProperty("width"),this.element.style.removeProperty("flex")}restoreLastSize(){this.element.style.flex="0 0 auto";const{height:e,width:t}=this.lastSize;-1!==t&&(this.element.style.width=`${t}px`),-1!==e&&(this.element.style.height=`${e}px`)}getHeight(){return this.element.offsetHeight}setHeight(e){const{popup:t}=this.config,i=this.element;let n=!1;if("string"==typeof e&&-1!==e.indexOf("%"))Ln(i,e),e=gn(i),n=!0;else if(e=Math.max(this.minHeight,e),this.positioned){const t=this.getAvailableHeight();t&&e>t&&(e=t)}this.getHeight()!==e&&(n?(i.style.maxHeight="unset",i.style.minHeight="unset"):t?Ln(i,e):(i.style.height=`${e}px`,i.style.flex="0 0 auto",this.lastSize.height="number"==typeof e?e:parseFloat(e)))}getAvailableHeight(){const{popup:e,forcePopupParentAsOffsetParent:t}=this.config;this.positioned||this.initialisePosition();const{clientHeight:i}=this.offsetParent;if(!i)return null;const n=this.element.getBoundingClientRect(),s=this.offsetParent.getBoundingClientRect(),r=e?this.position.y:n.top,o=e?0:s.top;let a=0;if(t){const e=this.element.parentElement;if(e){const{bottom:t}=e.getBoundingClientRect();a=t-n.bottom}}return i+o-r-a}getWidth(){return this.element.offsetWidth}setWidth(e){const t=this.element,{popup:i}=this.config;let n=!1;if("string"==typeof e&&-1!==e.indexOf("%"))Pn(t,e),e=fn(t),n=!0;else if(this.positioned){e=Math.max(this.minWidth,e);const{clientWidth:t}=this.offsetParent,n=i?this.position.x:this.element.getBoundingClientRect().left;t&&e+n>t&&(e=t-n)}this.getWidth()!==e&&(n?(t.style.maxWidth="unset",t.style.minWidth="unset"):this.config.popup?Pn(t,e):(t.style.width=`${e}px`,t.style.flex=" unset",this.lastSize.width="number"==typeof e?e:parseFloat(e)))}offsetElement(e=0,t=0){const{forcePopupParentAsOffsetParent:i}=this.config,n=i?this.boundaryEl:this.element;n&&(this.popupService.positionPopup({ePopup:n,keepWithinBounds:!0,skipObserver:this.movable||this.isResizable(),updatePosition:()=>({x:e,y:t})}),this.setPosition(parseFloat(n.style.left),parseFloat(n.style.top)))}constrainSizeToAvailableHeight(e){if(!this.config.forcePopupParentAsOffsetParent)return;e?this.resizeObserverSubscriber=this.resizeObserverService.observeResize(this.popupService.getPopupParent(),()=>{const e=this.getAvailableHeight();this.element.style.setProperty("max-height",`${e}px`)}):(this.element.style.removeProperty("max-height"),this.resizeObserverSubscriber&&(this.resizeObserverSubscriber(),this.resizeObserverSubscriber=void 0))}setPosition(e,t){this.position.x=e,this.position.y=t}updateDragStartPosition(e,t){this.dragStartPosition={x:e,y:t}}calculateMouseMovement(e){const{e:t,isLeft:i,isTop:n,anywhereWithin:s,topBuffer:r}=e,o=t.clientX-this.dragStartPosition.x,a=t.clientY-this.dragStartPosition.y;return{movementX:this.shouldSkipX(t,!!i,!!s,o)?0:o,movementY:this.shouldSkipY(t,!!n,r,a)?0:a}}shouldSkipX(e,t,i,n){const s=this.element.getBoundingClientRect(),r=this.offsetParent.getBoundingClientRect(),o=this.boundaryEl.getBoundingClientRect(),a=this.config.popup?this.position.x:s.left;let l=a<=0&&r.left>=e.clientX||r.right<=e.clientX&&r.right<=o.right;return!!l||(l=t?n<0&&e.clientX>a+r.left||n>0&&e.clientX<a+r.left:i?n<0&&e.clientX>o.right||n>0&&e.clientX<a+r.left:n<0&&e.clientX>o.right||n>0&&e.clientX<o.right,l)}shouldSkipY(e,t,i=0,n){const s=this.element.getBoundingClientRect(),r=this.offsetParent.getBoundingClientRect(),o=this.boundaryEl.getBoundingClientRect(),a=this.config.popup?this.position.y:s.top;let l=a<=0&&r.top>=e.clientY||r.bottom<=e.clientY&&r.bottom<=o.bottom;return!!l||(l=t?n<0&&e.clientY>a+r.top+i||n>0&&e.clientY<a+r.top:n<0&&e.clientY>o.bottom||n>0&&e.clientY<o.bottom,l)}createResizeMap(){const e=this.element;this.resizerMap={topLeft:{element:e.querySelector("[ref=eTopLeftResizer]")},top:{element:e.querySelector("[ref=eTopResizer]")},topRight:{element:e.querySelector("[ref=eTopRightResizer]")},right:{element:e.querySelector("[ref=eRightResizer]")},bottomRight:{element:e.querySelector("[ref=eBottomRightResizer]")},bottom:{element:e.querySelector("[ref=eBottomResizer]")},bottomLeft:{element:e.querySelector("[ref=eBottomLeftResizer]")},left:{element:e.querySelector("[ref=eLeftResizer]")}}}addResizers(){if(this.resizersAdded)return;const e=this.element;if(!e)return;const t=(new DOMParser).parseFromString(Ds,"text/html").body;e.appendChild(t.firstChild),this.createResizeMap(),this.resizersAdded=!0}removeResizers(){this.resizerMap=void 0;const e=this.element.querySelector(`.${Ts}`);e&&this.element.removeChild(e),this.resizersAdded=!1}getResizerElement(e){return this.resizerMap[e].element}onResizeStart(e,t){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.currentResizer={isTop:!!t.match(/top/i),isRight:!!t.match(/right/i),isBottom:!!t.match(/bottom/i),isLeft:!!t.match(/left/i)},this.element.classList.add("ag-resizing"),this.resizerMap[t].element.classList.add("ag-active");const{popup:i,forcePopupParentAsOffsetParent:n}=this.config;i||n||this.applySizeToSiblings(this.currentResizer.isBottom||this.currentResizer.isTop),this.isResizing=!0,this.updateDragStartPosition(e.clientX,e.clientY)}getSiblings(){const e=this.element.parentElement;return e?Array.prototype.slice.call(e.children).filter(e=>!e.classList.contains("ag-hidden")):null}getMinSizeOfSiblings(){const e=this.getSiblings()||[];let t=0,i=0;for(let n=0;n<e.length;n++){const s=e[n],r=!!s.style.flex&&"0 0 auto"!==s.style.flex;if(s===this.element)continue;let o=this.minHeight||0,a=this.minWidth||0;if(r){const e=window.getComputedStyle(s);e.minHeight&&(o=parseInt(e.minHeight,10)),e.minWidth&&(a=parseInt(e.minWidth,10))}else o=s.offsetHeight,a=s.offsetWidth;t+=o,i+=a}return{height:t,width:i}}applySizeToSiblings(e){let t=null;const i=this.getSiblings();if(i){for(let n=0;n<i.length;n++){const s=i[n];s!==t&&(e?s.style.height=`${s.offsetHeight}px`:s.style.width=`${s.offsetWidth}px`,s.style.flex="0 0 auto",s===this.element&&(t=i[n+1]))}t&&(t.style.removeProperty("height"),t.style.removeProperty("min-height"),t.style.removeProperty("max-height"),t.style.flex="1 1 auto")}}isResizable(){return Object.values(this.resizable).some(e=>e)}onResize(e){if(!this.isResizing||!this.currentResizer)return;const{popup:t,forcePopupParentAsOffsetParent:i}=this.config,{isTop:n,isRight:s,isBottom:r,isLeft:o}=this.currentResizer,a=s||o,l=r||n,{movementX:c,movementY:h}=this.calculateMouseMovement({e,isLeft:o,isTop:n}),u=this.position.x,d=this.position.y;let p=0,g=0;if(a&&c){const e=o?-1:1,t=this.getWidth(),i=t+c*e;let n=!1;o&&(p=t-i,(u+p<=0||i<=this.minWidth)&&(n=!0,p=0)),n||this.setWidth(i)}if(l&&h){const e=n?-1:1,t=this.getHeight(),i=t+h*e;let s=!1;n?(g=t-i,(d+g<=0||i<=this.minHeight)&&(s=!0,g=0)):!this.config.popup&&!this.config.forcePopupParentAsOffsetParent&&t<i&&this.getMinSizeOfSiblings().height+i>this.element.parentElement.offsetHeight&&(s=!0),s||this.setHeight(i)}this.updateDragStartPosition(e.clientX,e.clientY),((t||i)&&p||g)&&this.offsetElement(u+p,d+g)}onResizeEnd(e,t){this.isResizing=!1,this.currentResizer=null,this.boundaryEl=null,this.element.classList.remove("ag-resizing"),this.resizerMap[t].element.classList.remove("ag-active"),this.dispatchEvent({type:"resize"})}refreshSize(){const e=this.element;this.config.popup&&(this.config.width||this.setWidth(e.offsetWidth),this.config.height||this.setHeight(e.offsetHeight))}onMoveStart(e){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.isMoving=!0,this.element.classList.add("ag-moving"),this.updateDragStartPosition(e.clientX,e.clientY)}onMove(e){if(!this.isMoving)return;const{x:t,y:i}=this.position;let n;this.config.calculateTopBuffer&&(n=this.config.calculateTopBuffer());const{movementX:s,movementY:r}=this.calculateMouseMovement({e,isTop:!0,anywhereWithin:!0,topBuffer:n});this.offsetElement(t+s,i+r),this.updateDragStartPosition(e.clientX,e.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 e=this.element;for(;e;){if("static"!==window.getComputedStyle(e).position)return e;e=e.parentElement}return this.element}clearResizeListeners(){for(;this.resizeListeners.length;){const e=this.resizeListeners.pop();this.dragService.removeDragSource(e)}}destroy(){super.destroy(),this.moveElementDragListener&&this.dragService.removeDragSource(this.moveElementDragListener),this.constrainSizeToAvailableHeight(!1),this.clearResizeListeners(),this.removeResizers()}};f([ue("popupService")],Is.prototype,"popupService",2),f([ue("resizeObserverService")],Is.prototype,"resizeObserverService",2),f([ue("dragService")],Is.prototype,"dragService",2);var Rs=class e extends vs{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 Ms(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.positionableFeature=new Is(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 i=`\n            <form class="ag-filter-wrapper">\n                <div class="ag-filter-body-wrapper ag-${this.getCssIdentifier()}-body-wrapper" ref="eFilterBody">\n                    ${this.createBodyTemplate()}\n                </div>\n            </form>`;this.setTemplate(i,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(t){this.providedFilterParams=t,this.applyActive=e.isUseApplyButton(t),this.resetButtonsPanel()}updateParams(t){this.providedFilterParams=t,this.applyActive=e.isUseApplyButton(t),this.resetUiToActiveModel(this.getModel(),()=>{this.updateUiVisibility(),this.setupOnBtApplyDebounce()})}resetButtonsPanel(){const{buttons:e}=this.providedFilterParams,t=e&&e.length>0&&!this.isReadOnly();if(this.eButtonsPanel?(Cn(this.eButtonsPanel),this.buttonListeners.forEach(e=>null==e?void 0:e()),this.buttonListeners=[]):t&&(this.eButtonsPanel=document.createElement("div"),this.eButtonsPanel.classList.add("ag-filter-apply-panel")),!t)return void(this.eButtonsPanel&&wn(this.eButtonsPanel));const i=document.createDocumentFragment(),n=e=>{let t,n;switch(e){case"apply":t=this.translate("applyFilter"),n=e=>this.onBtApply(!1,!1,e);break;case"clear":t=this.translate("clearFilter"),n=()=>this.onBtClear();break;case"reset":t=this.translate("resetFilter"),n=()=>this.onBtReset();break;case"cancel":t=this.translate("cancelFilter"),n=e=>{this.onBtCancel(e)};break;default:return void console.warn("AG Grid: Unknown button type specified")}const s=En(`<button\n                    type="${"apply"===e?"submit":"button"}"\n                    ref="${e}FilterButton"\n                    class="ag-button ag-standard-button ag-filter-apply-panel-button"\n                >${t}\n                </button>`);this.buttonListeners.push(this.addManagedListener(s,"click",n)),i.append(s)};ls(e).forEach(e=>n(e)),this.eButtonsPanel.append(i),this.getGui().appendChild(this.eButtonsPanel)}getDefaultDebounceMs(){return 0}setupOnBtApplyDebounce(){const t=e.getDebounceMs(this.providedFilterParams,this.getDefaultDebounceMs()),i=Q(this.checkApplyDebounce.bind(this),t);this.onBtApplyDebounce=()=>{this.debouncePending=!0,i()}}checkApplyDebounce(){this.debouncePending&&(this.debouncePending=!1,this.onBtApply())}getModel(){return this.appliedModel?this.appliedModel:null}setModel(e){return(null!=e?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 i=()=>{this.onUiChanged(!1,"prevent"),null==t||t()};null!=e?this.setModelIntoUi(e).then(i):this.resetUiToDefaults().then(i)}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 i=this.appliedModel;return this.appliedModel=t,!this.areModelsEqual(i,t)}isModelValid(e){return!0}onFormSubmit(e){e.preventDefault()}onBtApply(e=!1,t=!1,i){if(i&&i.preventDefault(),this.applyModel(t?"rowDataUpdated":"ui")){const i="columnFilter";this.providedFilterParams.filterChangedCallback({afterFloatingFilter:e,afterDataChange:t,source:i})}const{closeOnApply:n}=this.providedFilterParams;n&&this.applyActive&&!e&&!t&&this.close(i)}onNewRowsLoaded(){}close(e){if(!this.hidePopup)return;const t=e,i=t&&t.key;let n;"Enter"!==i&&"Space"!==i||(n={keyboardEvent:t}),this.hidePopup(n),this.hidePopup=null}onUiChanged(e=!1,t){if(this.updateUiVisibility(),this.providedFilterParams.filterModifiedCallback(),this.applyActive&&!this.isReadOnly()){const e=this.isModelValid(this.getModelFromUi()),t=this.getRefElement("applyFilterButton");t&&cn(t,!e)}e&&!t||"immediately"===t?this.onBtApply(e):(this.applyActive||t)&&"debounce"!==t||this.onBtApplyDebounce()}afterGuiAttached(e){e&&(this.hidePopup=e.hidePopup),this.refreshFilterResizer(null==e?void 0:e.container)}refreshFilterResizer(e){if(!this.positionableFeature||"toolPanel"===e)return;const t="floatingFilter"===e||"columnFilter"===e,{positionableFeature:i,gos:n}=this;t?(i.restoreLastSize(),i.setResizable(n.get("enableRtl")?{bottom:!0,bottomLeft:!0,left:!0}:{bottom:!0,bottomRight:!0,right:!0})):(this.positionableFeature.removeSizeFromEl(),this.positionableFeature.setResizable(!1)),this.positionableFeature.constrainSizeToAvailableHeight(!0)}afterGuiDetached(){this.checkApplyDebounce(),this.positionableFeature&&this.positionableFeature.constrainSizeToAvailableHeight(!1)}static getDebounceMs(t,i){return e.isUseApplyButton(t)?(null!=t.debounceMs&&console.warn("AG Grid: debounceMs is ignored when apply button is present"),0):null!=t.debounceMs?t.debounceMs:i}static isUseApplyButton(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,Es[e])}getCellValue(e){return this.providedFilterParams.getValue(e)}getPositionableElement(){return this.eFilterBody}};f([ue("rowModel")],Rs.prototype,"rowModel",2),f([bs("eFilterBody")],Rs.prototype,"eFilterBody",2),f([le],Rs.prototype,"postConstruct",1);var ks=Rs,Ps=class extends vs{constructor(e,t){super(t),this.labelSeparator="",this.labelAlignment="left",this.disabled=!1,this.label="",this.config=e||{}}postConstruct(){this.addCssClass("ag-labeled"),this.eLabel.classList.add("ag-label");const{labelSeparator:e,label:t,labelWidth:i,labelAlignment:n,disabled:s}=this.config;null!=s&&this.setDisabled(s),null!=e&&this.setLabelSeparator(e),null!=t&&this.setLabel(t),null!=i&&this.setLabelWidth(i),this.setLabelAlignment(n||this.labelAlignment),this.refreshLabel()}refreshLabel(){Cn(this.eLabel),"string"==typeof this.label?this.eLabel.innerText=this.label+this.labelSeparator:this.label&&this.eLabel.appendChild(this.label),""===this.label?(an(this.eLabel,!1),Ht(this.eLabel,"presentation")):(an(this.eLabel,!0),Ht(this.eLabel,null))}setLabelSeparator(e){return this.labelSeparator===e||(this.labelSeparator=e,null!=this.label&&this.refreshLabel()),this}getLabelId(){return this.eLabel.id=this.eLabel.id||`ag-${this.getCompId()}-label`,this.eLabel.id}getLabel(){return this.label}setLabel(e){return this.label===e||(this.label=e,this.refreshLabel()),this}setLabelAlignment(e){const t=this.getGui().classList;return t.toggle("ag-label-align-left","left"===e),t.toggle("ag-label-align-right","right"===e),t.toggle("ag-label-align-top","top"===e),this}setLabelEllipsis(e){return this.eLabel.classList.toggle("ag-label-ellipsis",e),this}setLabelWidth(e){return null==this.label||kn(this.eLabel,e),this}setDisabled(e){e=!!e;const t=this.getGui();return cn(t,e),t.classList.toggle("ag-disabled",e),this.disabled=e,this}isDisabled(){return!!this.disabled}};f([le],Ps.prototype,"postConstruct",1);var _s=class extends Ps{constructor(e,t,i){super(e,t),this.className=i}postConstruct(){super.postConstruct();const{width:e,value:t,onValueChange:i}=this.config;null!=e&&this.setWidth(e),null!=t&&this.setValue(t),null!=i&&this.onValueChange(i),this.className&&this.addCssClass(this.className),this.refreshAriaLabelledBy()}refreshAriaLabelledBy(){const e=this.getAriaElement(),t=this.getLabelId();null!==jt(e)?Kt(e,""):Kt(e,null!=t?t:"")}setAriaLabel(e){return $t(this.getAriaElement(),e),this.refreshAriaLabelledBy(),this}onValueChange(e){return this.addManagedListener(this,ct.EVENT_FIELD_VALUE_CHANGED,()=>e(this.getValue())),this}getWidth(){return this.getGui().clientWidth}setWidth(e){return Pn(this.getGui(),e),this}getPreviousValue(){return this.previousValue}getValue(){return this.value}setValue(e,t){return this.value===e||(this.previousValue=this.value,this.value=e,t||this.dispatchEvent({type:ct.EVENT_FIELD_VALUE_CHANGED})),this}},Ls=class extends _s{constructor(e){if(super(e,(null==e?void 0:e.template)||'\n    <div class="ag-picker-field" role="presentation">\n        <div ref="eLabel"></div>\n            <div ref="eWrapper" class="ag-wrapper ag-picker-field-wrapper ag-picker-collapsed">\n            <div ref="eDisplayField" class="ag-picker-field-display"></div>\n            <div ref="eIcon" class="ag-picker-field-icon" aria-hidden="true"></div>\n        </div>\n    </div>',null==e?void 0:e.className),this.isPickerDisplayed=!1,this.skipClick=!1,this.pickerGap=4,this.hideCurrentPicker=null,this.ariaRole=null==e?void 0:e.ariaRole,this.onPickerFocusIn=this.onPickerFocusIn.bind(this),this.onPickerFocusOut=this.onPickerFocusOut.bind(this),!e)return;const{pickerGap:t,maxPickerHeight:i,variableWidth:n,minPickerWidth:s,maxPickerWidth:r}=e;null!=t&&(this.pickerGap=t),this.variableWidth=!!n,null!=i&&this.setPickerMaxHeight(i),null!=s&&this.setPickerMinWidth(s),null!=r&&this.setPickerMaxWidth(r)}postConstruct(){super.postConstruct(),this.setupAria();const e=`ag-${this.getCompId()}-display`;this.eDisplayField.setAttribute("id",e);const t=this.getAriaElement();this.addManagedListener(t,"keydown",this.onKeyDown.bind(this)),this.addManagedListener(this.eLabel,"mousedown",this.onLabelOrWrapperMouseDown.bind(this)),this.addManagedListener(this.eWrapper,"mousedown",this.onLabelOrWrapperMouseDown.bind(this));const{pickerIcon:i,inputWidth:n}=this.config;if(i){const e=qn(i,this.gos);e&&this.eIcon.appendChild(e)}null!=n&&this.setInputWidth(n)}setupAria(){const e=this.getAriaElement();e.setAttribute("tabindex",this.gos.get("tabIndex").toString()),ii(e,!1),this.ariaRole&&Ht(e,this.ariaRole)}onLabelOrWrapperMouseDown(e){if(e){const t=this.getFocusableElement();if(t!==this.eWrapper&&(null==e?void 0:e.target)===t)return;e.preventDefault(),this.getFocusableElement().focus()}this.skipClick?this.skipClick=!1:this.isDisabled()||(this.isPickerDisplayed?this.hidePicker():this.showPicker())}onKeyDown(e){switch(e.key){case Zn.UP:case Zn.DOWN:case Zn.ENTER:case Zn.SPACE:e.preventDefault(),this.onLabelOrWrapperMouseDown();break;case Zn.ESCAPE:this.isPickerDisplayed&&(e.preventDefault(),e.stopPropagation(),this.hideCurrentPicker&&this.hideCurrentPicker())}}showPicker(){this.isPickerDisplayed=!0,this.pickerComponent||(this.pickerComponent=this.createPickerComponent());const e=this.pickerComponent.getGui();e.addEventListener("focusin",this.onPickerFocusIn),e.addEventListener("focusout",this.onPickerFocusOut),this.hideCurrentPicker=this.renderAndPositionPicker(),this.toggleExpandedStyles(!0)}renderAndPositionPicker(){const e=this.gos.getDocument(),t=this.pickerComponent.getGui();this.gos.get("suppressScrollWhenPopupsAreOpen")||(this.destroyMouseWheelFunc=this.addManagedListener(this.eventService,ct.EVENT_BODY_SCROLL,()=>{this.hidePicker()}));const i=this.localeService.getLocaleTextFunc(),{pickerAriaLabelKey:n,pickerAriaLabelValue:s,modalPicker:r=!0}=this.config,o={modal:r,eChild:t,closeOnEsc:!0,closedCallback:()=>{const t=this.gos.getActiveDomElement(),i=!t||t===e.body;this.beforeHidePicker(),i&&this.isAlive()&&this.getFocusableElement().focus()},ariaLabel:i(n,s)},a=this.popupService.addPopup(o),{maxPickerHeight:l,minPickerWidth:c,maxPickerWidth:h,variableWidth:u}=this;u?(c&&(t.style.minWidth=c),t.style.width=Nn(fn(this.eWrapper)),h&&(t.style.maxWidth=h)):kn(t,null!=h?h:fn(this.eWrapper));const d=null!=l?l:`${dn(this.popupService.getPopupParent())}px`;return t.style.setProperty("max-height",d),t.style.position="absolute",this.alignPickerToComponent(),a.hideFunc}alignPickerToComponent(){if(!this.pickerComponent)return;const{pickerType:e}=this.config,{pickerGap:t}=this,i=this.gos.get("enableRtl")?"right":"left";this.popupService.positionPopupByComponent({type:e,eventSource:this.eWrapper,ePopup:this.pickerComponent.getGui(),position:"under",alignSide:i,keepWithinBounds:!0,nudgeY:t})}beforeHidePicker(){this.destroyMouseWheelFunc&&(this.destroyMouseWheelFunc(),this.destroyMouseWheelFunc=void 0),this.toggleExpandedStyles(!1);const e=this.pickerComponent.getGui();e.removeEventListener("focusin",this.onPickerFocusIn),e.removeEventListener("focusout",this.onPickerFocusOut),this.isPickerDisplayed=!1,this.pickerComponent=void 0,this.hideCurrentPicker=null}toggleExpandedStyles(e){this.isAlive()&&(ii(this.getAriaElement(),e),this.eWrapper.classList.toggle("ag-picker-expanded",e),this.eWrapper.classList.toggle("ag-picker-collapsed",!e))}onPickerFocusIn(){this.togglePickerHasFocus(!0)}onPickerFocusOut(e){var t;(null==(t=this.pickerComponent)?void 0:t.getGui().contains(e.relatedTarget))||this.togglePickerHasFocus(!1)}togglePickerHasFocus(e){this.pickerComponent&&this.eWrapper.classList.toggle("ag-picker-has-focus",e)}hidePicker(){this.hideCurrentPicker&&this.hideCurrentPicker()}setInputWidth(e){return kn(this.eWrapper,e),this}getFocusableElement(){return this.eWrapper}setPickerGap(e){return this.pickerGap=e,this}setPickerMinWidth(e){return"number"==typeof e&&(e=`${e}px`),this.minPickerWidth=null==e?void 0:e,this}setPickerMaxWidth(e){return"number"==typeof e&&(e=`${e}px`),this.maxPickerWidth=null==e?void 0:e,this}setPickerMaxHeight(e){return"number"==typeof e&&(e=`${e}px`),this.maxPickerHeight=null==e?void 0:e,this}destroy(){this.hidePicker(),super.destroy()}};f([ue("popupService")],Ls.prototype,"popupService",2),f([bs("eLabel")],Ls.prototype,"eLabel",2),f([bs("eWrapper")],Ls.prototype,"eWrapper",2),f([bs("eDisplayField")],Ls.prototype,"eDisplayField",2),f([bs("eIcon")],Ls.prototype,"eIcon",2);var Ns=class e extends vs{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 Zn.ENTER:if(this.highlightedEl){const e=this.itemEls.indexOf(this.highlightedEl);this.setValueByIndex(e)}else this.setValue(this.getValue());break;case Zn.DOWN:case Zn.UP:e.preventDefault(),this.navigate(t);break;case Zn.PAGE_DOWN:case Zn.PAGE_UP:case Zn.PAGE_HOME:case Zn.PAGE_END:e.preventDefault(),this.navigateToPage(t)}}navigate(e){const t=e===Zn.DOWN;let i;if(this.highlightedEl){let e=this.itemEls.indexOf(this.highlightedEl)+(t?1:-1);e=Math.min(Math.max(e,0),this.itemEls.length-1),i=this.itemEls[e]}else i=this.itemEls[t?0:this.itemEls.length-1];this.highlightItem(i)}navigateToPage(e){if(!this.highlightedEl||0===this.itemEls.length)return;const t=this.itemEls.indexOf(this.highlightedEl),i=this.options.length-1,n=this.itemEls[0].clientHeight,s=Math.floor(this.getGui().clientHeight/n);let r=-1;e===Zn.PAGE_HOME?r=0:e===Zn.PAGE_END?r=i:e===Zn.PAGE_DOWN?r=Math.min(t+s,i):e===Zn.PAGE_UP&&(r=Math.max(t-s,0)),-1!==r&&this.highlightItem(this.itemEls[r])}addOptions(e){return e.forEach(e=>this.addOption(e)),this}addOption(e){const{value:t,text:i}=e,n=i||t;return this.options.push({value:t,text:n}),this.renderOption(t,n),this.updateIndices(),this}clearOptions(){this.options=[],this.reset(!0),this.itemEls.forEach(e=>{wn(e)}),this.itemEls=[]}updateIndices(){const e=this.getGui().querySelectorAll(".ag-list-item");e.forEach((t,i)=>{ri(t,i+1),si(t,e.length)})}renderOption(e,t){const i=this.gos.getDocument(),n=i.createElement("div");Ht(n,"option"),n.classList.add("ag-list-item",`ag-${this.cssIdentifier}-list-item`);const s=i.createElement("span");n.appendChild(s),s.textContent=t,this.unFocusable||(n.tabIndex=-1),this.itemEls.push(n),this.addManagedListener(n,"mousemove",()=>this.highlightItem(n)),this.addManagedListener(n,"mousedown",t=>{t.preventDefault(),this.setValue(e)}),this.createManagedBean(new fs({getTooltipValue:()=>t,getGui:()=>n,getLocation:()=>"UNKNOWN",shouldDisplayTooltip:()=>s.scrollWidth>s.clientWidth})),this.getGui().appendChild(n)}setValue(e,t){if(this.value===e)return this.fireItemSelected(),this;if(null==e)return this.reset(t),this;const i=this.options.findIndex(t=>t.value===e);if(-1!==i){const e=this.options[i];this.value=e.value,this.displayValue=e.text,this.highlightItem(this.itemEls[i]),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(e=>e.value===this.value);-1!==e&&this.highlightItem(this.itemEls[e])}reset(e){this.value=null,this.displayValue=null,this.clearHighlighted(),e||this.fireChangeEvent()}highlightItem(t){if(!xn(t))return;this.clearHighlighted(),this.highlightedEl=t,this.highlightedEl.classList.add(e.ACTIVE_CLASS),gi(this.highlightedEl,!0);const i=this.getGui(),{scrollTop:n,clientHeight:s}=i,{offsetTop:r,offsetHeight:o}=t;(r+o>n+s||r<n)&&this.highlightedEl.scrollIntoView({block:"nearest"}),this.unFocusable||this.highlightedEl.focus()}clearHighlighted(){this.highlightedEl&&xn(this.highlightedEl)&&(this.highlightedEl.classList.remove(e.ACTIVE_CLASS),gi(this.highlightedEl,!1),this.highlightedEl=null)}fireChangeEvent(){this.dispatchEvent({type:ct.EVENT_FIELD_VALUE_CHANGED}),this.fireItemSelected()}fireItemSelected(){this.dispatchEvent({type:e.EVENT_ITEM_SELECTED})}};Ns.EVENT_ITEM_SELECTED="selectedItem",Ns.ACTIVE_CLASS="ag-active-item",f([le],Ns.prototype,"init",1);var Os=Ns,Fs=class e extends Ls{constructor(e){super(d({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:i}=this.config;null!=e&&this.addOptions(e),null!=t&&this.setValue(t,!0),i&&null==t&&(this.eDisplayField.textContent=i),this.addManagedListener(this.eWrapper,"focusout",this.onWrapperFocusOut.bind(this))}onWrapperFocusOut(e){this.eWrapper.contains(e.relatedTarget)||this.hidePicker()}createListComponent(){this.listComponent=this.createBean(new Os("select",!0)),this.listComponent.setParentComponent(this);const t=this.listComponent.getAriaElement(),i=`ag-select-list-${this.listComponent.getCompId()}`;t.setAttribute("id",i),mi(this.getAriaElement(),t),this.listComponent.addManagedListener(this.listComponent,Os.EVENT_ITEM_SELECTED,()=>{this.hidePicker(),this.dispatchEvent({type:e.EVENT_ITEM_SELECTED})}),this.listComponent.addManagedListener(this.listComponent,ct.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:i}=e;switch(i===Zn.TAB&&this.hidePicker(),i){case Zn.ENTER:case Zn.UP:case Zn.DOWN:case Zn.PAGE_UP:case Zn.PAGE_DOWN:case Zn.PAGE_HOME:case Zn.PAGE_END:e.preventDefault(),this.isPickerDisplayed?null==(t=this.listComponent)||t.handleKeyDown(e):super.onKeyDown(e);break;case Zn.ESCAPE:super.onKeyDown(e)}}showPicker(){this.listComponent&&(super.showPicker(),this.listComponent.refreshHighlighted())}addOptions(e){return e.forEach(e=>this.addOption(e)),this}addOption(e){return this.listComponent.addOption(e),this}clearOptions(){var e;return null==(e=this.listComponent)||e.clearOptions(),this}setValue(e,t,i){if(this.value===e||!this.listComponent)return this;if(i||this.listComponent.setValue(e,!0),this.listComponent.getValue()===this.getValue())return this;let n=this.listComponent.getDisplayValue();return null==n&&this.config.placeholder&&(n=this.config.placeholder),this.eDisplayField.textContent=n,this.setTooltip({newTooltipText:null!=n?n: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()}};Fs.EVENT_ITEM_SELECTED="selectedItem";var Gs=Fs,Bs=class extends _s{constructor(e,t,i="text",n="input"){super(e,`\n            <div role="presentation">\n                <div ref="eLabel" class="ag-input-field-label"></div>\n                <div ref="eWrapper" class="ag-wrapper ag-input-wrapper" role="presentation">\n                    <${n} ref="eInput" class="ag-input-field-input"></${n}>\n                </div>\n            </div>`,t),this.inputType=i,this.displayFieldTag=n}postConstruct(){super.postConstruct(),this.setInputType(),this.eLabel.classList.add(`${this.className}-label`),this.eWrapper.classList.add(`${this.className}-input-wrapper`),this.eInput.classList.add(`${this.className}-input`),this.addCssClass("ag-input-field"),this.eInput.id=this.eInput.id||`ag-${this.getCompId()}-input`;const{inputName:e,inputWidth:t}=this.config;null!=e&&this.setInputName(e),null!=t&&this.setInputWidth(t),this.addInputListeners(),this.activateTabIndex([this.eInput])}addInputListeners(){this.addManagedListener(this.eInput,"input",e=>this.setValue(e.target.value))}setInputType(){"input"===this.displayFieldTag&&this.eInput.setAttribute("type",this.inputType)}getInputElement(){return this.eInput}setInputWidth(e){return kn(this.eWrapper,e),this}setInputName(e){return this.getInputElement().setAttribute("name",e),this}getFocusableElement(){return this.eInput}setMaxLength(e){return this.eInput.maxLength=e,this}setInputPlaceholder(e){return Bn(this.eInput,"placeholder",e),this}setInputAriaLabel(e){return $t(this.eInput,e),this.refreshAriaLabelledBy(),this}setDisabled(e){return cn(this.eInput,e),super.setDisabled(e)}setAutoComplete(e){if(!0===e)Bn(this.eInput,"autocomplete",null);else{const t="string"==typeof e?e:"off";Bn(this.eInput,"autocomplete",t)}return this}};f([bs("eLabel")],Bs.prototype,"eLabel",2),f([bs("eWrapper")],Bs.prototype,"eWrapper",2),f([bs("eInput")],Bs.prototype,"eInput",2);var Vs=class extends Bs{constructor(e,t="ag-checkbox",i="checkbox"){super(e,t,i),this.labelAlignment="right",this.selected=!1,this.readOnly=!1,this.passive=!1}postConstruct(){super.postConstruct();const{readOnly:e,passive:t}=this.config;"boolean"==typeof e&&this.setReadOnly(e),"boolean"==typeof t&&this.setPassive(t)}addInputListeners(){this.addManagedListener(this.eInput,"click",this.onCheckboxClick.bind(this)),this.addManagedListener(this.eLabel,"click",this.toggle.bind(this))}getNextValue(){return void 0===this.selected||!this.selected}setPassive(e){this.passive=e}isReadOnly(){return this.readOnly}setReadOnly(e){this.eWrapper.classList.toggle("ag-disabled",e),this.eInput.disabled=e,this.readOnly=e}setDisabled(e){return this.eWrapper.classList.toggle("ag-disabled",e),super.setDisabled(e)}toggle(){if(this.eInput.disabled)return;const e=this.isSelected(),t=this.getNextValue();this.passive?this.dispatchChange(t,e):this.setValue(t)}getValue(){return this.isSelected()}setValue(e,t){return this.refreshSelectedClass(e),this.setSelected(e,t),this}setName(e){return this.getInputElement().name=e,this}isSelected(){return this.selected}setSelected(e,t){this.isSelected()!==e&&(this.previousValue=this.isSelected(),e=this.selected="boolean"==typeof e?e:void 0,this.eInput.checked=e,this.eInput.indeterminate=void 0===e,t||this.dispatchChange(this.selected,this.previousValue))}dispatchChange(e,t,i){this.dispatchEvent({type:ct.EVENT_FIELD_VALUE_CHANGED,selected:e,previousValue:t,event:i});const n=this.getInputElement(),s={type:ct.EVENT_CHECKBOX_CHANGED,id:n.id,name:n.name,selected:e,previousValue:t};this.eventService.dispatchEvent(s)}onCheckboxClick(e){if(this.passive||this.eInput.disabled)return;const t=this.isSelected(),i=this.selected=e.target.checked;this.refreshSelectedClass(i),this.dispatchChange(i,t,e)}refreshSelectedClass(e){this.eWrapper.classList.toggle("ag-checked",!0===e),this.eWrapper.classList.toggle("ag-indeterminate",null==e)}},Hs=class extends Vs{constructor(e){super(e,"ag-radio-button","radio")}isSelected(){return this.eInput.checked}toggle(){this.eInput.disabled||this.isSelected()||this.setValue(!0)}addInputListeners(){super.addInputListeners(),this.addManagedListener(this.eventService,ct.EVENT_CHECKBOX_CHANGED,this.onChange.bind(this))}onChange(e){e.selected&&e.name&&this.eInput.name&&this.eInput.name===e.name&&e.id&&this.eInput.id!==e.id&&this.setValue(!1,!0)}},Us=class{constructor(e,t,i){this.localeService=e,this.optionsFactory=t,this.valueFormatter=i}getModelAsString(e){if(!e)return null;const t=null!=e.operator,i=this.localeService.getLocaleTextFunc();if(t){const t=e;let{conditions:n}=t;if(!n){const{condition1:e,condition2:i}=t;n=[e,i]}const s=n.map(e=>this.getModelAsString(e)),r="AND"===t.operator?"andCondition":"orCondition";return s.join(` ${i(r,Es[r])} `)}if(e.type===Ws.BLANK||e.type===Ws.NOT_BLANK)return i(e.type,e.type);{const t=e,n=this.optionsFactory.getCustomOption(t.type),{displayKey:s,displayName:r,numberOfInputs:o}=n||{};return s&&r&&0===o?(i(s,r),r):this.conditionToString(t,n)}}updateParams(e){this.optionsFactory=e.optionsFactory}formatValue(e){var t;return this.valueFormatter?null!=(t=this.valueFormatter(null!=e?e:null))?t:"":String(e)}},zs=class e extends ks{constructor(){super(...arguments),this.eTypes=[],this.eJoinOperatorPanels=[],this.eJoinOperatorsAnd=[],this.eJoinOperatorsOr=[],this.eConditionBodies=[],this.listener=()=>this.onUiChanged(),this.lastUiCompletePosition=null,this.joinOperatorId=0}getNumberOfInputs(t){const i=this.optionsFactory.getCustomOption(t);if(i){const{numberOfInputs:e}=i;return null!=e?e:1}const n=[e.EMPTY,e.NOT_BLANK,e.BLANK];return t&&n.indexOf(t)>=0?0:t===e.IN_RANGE?2:1}onFloatingFilterChanged(e,t){this.setTypeFromFloatingFilter(e),this.setValueFromFloatingFilter(t),this.onUiChanged(!0)}setTypeFromFloatingFilter(e){this.eTypes.forEach((t,i)=>{0===i?t.setValue(e,!0):t.setValue(this.optionsFactory.getDefaultOption(),!0)})}getModelFromUi(){const e=this.getUiCompleteConditions();return 0===e.length?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 0===this.eJoinOperatorsOr.length?this.defaultJoinOperator:!0===this.eJoinOperatorsOr[0].getValue()?"OR":"AND"}areModelsEqual(e,t){if(!e&&!t)return!0;if(!e&&t||e&&!t)return!1;const i=!e.operator,n=!t.operator;if(!i&&n||i&&!n)return!1;let s;if(i){const i=e,n=t;s=this.areSimpleModelsEqual(i,n)}else{const i=e,n=t;s=i.operator===n.operator&&Re(i.conditions,n.conditions,(e,t)=>this.areSimpleModelsEqual(e,t))}return s}shouldRefresh(e){var t,i,n;const s=this.getModel(),r=s?null!=(t=s.conditions)?t:[s]:null,o=null!=(n=null==(i=e.filterOptions)?void 0:i.map(e=>"string"==typeof e?e:e.displayKey))?n:this.getDefaultFilterOptions();return!(r&&!r.every(e=>void 0!==o.find(t=>t===e.type))||"number"==typeof e.maxNumConditions&&r&&r.length>e.maxNumConditions)}refresh(e){return!!this.shouldRefresh(e)&&(!!super.refresh(e)&&(this.setParams(e),this.removeConditionsAndOperators(0),this.createOption(),this.setModel(this.getModel()),!0))}setModelIntoUi(e){if(e.operator){let t=e;t.conditions||(t.conditions=[t.condition1,t.condition2]);const i=this.validateAndUpdateConditions(t.conditions),n=this.getNumConditions();if(i<n)this.removeConditionsAndOperators(i);else if(i>n)for(let e=n;e<i;e++)this.createJoinOperatorPanel(),this.createOption();const s="OR"===t.operator;this.eJoinOperatorsAnd.forEach(e=>e.setValue(!s,!0)),this.eJoinOperatorsOr.forEach(e=>e.setValue(s,!0)),t.conditions.forEach((e,t)=>{this.eTypes[t].setValue(e.type,!0),this.setConditionIntoUi(e,t)})}else{const t=e;this.getNumConditions()>1&&this.removeConditionsAndOperators(1),this.eTypes[0].setValue(t.type,!0),this.setConditionIntoUi(t,0)}return this.lastUiCompletePosition=this.getNumConditions()-1,this.createMissingConditionsAndOperators(),this.onUiChanged(),us.resolve()}validateAndUpdateConditions(e){let t=e.length;return t>this.maxNumConditions&&(e.splice(this.maxNumConditions),z('Filter Model contains more conditions than "filterParams.maxNumConditions". Additional conditions have been ignored.'),t=this.maxNumConditions),t}doesFilterPass(e){var t;const i=this.getModel();if(null==i)return!0;const{operator:n}=i,s=[];if(n){const e=i;s.push(...null!=(t=e.conditions)?t:[])}else s.push(i);return s[n&&"OR"===n?"some":"every"](t=>this.individualConditionPasses(e,t))}setParams(e){super.setParams(e),this.setNumConditions(e),this.defaultJoinOperator=this.getDefaultJoinOperator(e.defaultJoinOperator),this.filterPlaceholder=e.filterPlaceholder,this.optionsFactory=new xs,this.optionsFactory.init(e,this.getDefaultFilterOptions()),this.createFilterListOptions(),this.createOption(),this.createMissingConditionsAndOperators(),this.isReadOnly()&&this.eFilterBody.setAttribute("tabindex","-1")}setNumConditions(e){var t,i;null!=e.suppressAndOrCondition&&z('Since v29.2 "filterParams.suppressAndOrCondition" is deprecated. Use "filterParams.maxNumConditions = 1" instead.'),null!=e.alwaysShowBothConditions&&z('Since v29.2 "filterParams.alwaysShowBothConditions" is deprecated. Use "filterParams.numAlwaysVisibleConditions = 2" instead.'),this.maxNumConditions=null!=(t=e.maxNumConditions)?t:e.suppressAndOrCondition?1:2,this.maxNumConditions<1&&(z('"filterParams.maxNumConditions" must be greater than or equal to zero.'),this.maxNumConditions=1),this.numAlwaysVisibleConditions=null!=(i=e.numAlwaysVisibleConditions)?i:e.alwaysShowBothConditions?2:1,this.numAlwaysVisibleConditions<1&&(z('"filterParams.numAlwaysVisibleConditions" must be greater than or equal to zero.'),this.numAlwaysVisibleConditions=1),this.numAlwaysVisibleConditions>this.maxNumConditions&&(z('"filterParams.numAlwaysVisibleConditions" cannot be greater than "filterParams.maxNumConditions".'),this.numAlwaysVisibleConditions=this.maxNumConditions)}createOption(){const e=this.createManagedBean(new Gs);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 i=this.getNumConditions()-1;this.forEachPositionInput(i,e=>this.resetInput(e)),this.addChangedListeners(e,i)}createJoinOperatorPanel(){const e=document.createElement("div");this.eJoinOperatorPanels.push(e),e.classList.add("ag-filter-condition");const t=this.createJoinOperator(this.eJoinOperatorsAnd,e,"and"),i=this.createJoinOperator(this.eJoinOperatorsOr,e,"or");this.eFilterBody.appendChild(e);const n=this.eJoinOperatorPanels.length-1,s=this.joinOperatorId++;this.resetJoinOperatorAnd(t,n,s),this.resetJoinOperatorOr(i,n,s),this.isReadOnly()||(t.onValueChange(this.listener),i.onValueChange(this.listener))}createJoinOperator(e,t,i){const n=this.createManagedBean(new Hs);return e.push(n),n.addCssClass("ag-filter-condition-operator"),n.addCssClass(`ag-filter-condition-operator-${i}`),t.appendChild(n.getGui()),n}getDefaultJoinOperator(e){return"AND"===e||"OR"===e?e:"AND"}createFilterListOptions(){const e=this.optionsFactory.getFilterOptions();this.filterListOptions=e.map(e=>"string"==typeof e?this.createBoilerplateListOption(e):this.createCustomListOption(e))}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,i=this.optionsFactory.getCustomOption(e.displayKey);return{value:t,text:i?this.localeService.getLocaleTextFunc()(i.displayKey,i.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,i=!0;for(let e=0;e<this.getNumConditions();e++)this.isConditionUiComplete(e)?t=e:i=!1;if(this.shouldAddNewConditionAtEnd(i))this.createJoinOperatorPanel(),this.createOption();else{const i=null!=(e=this.lastUiCompletePosition)?e:this.getNumConditions()-2;if(t<i){this.removeConditionsAndOperators(i+1);const e=t+1,n=i-e;n>0&&this.removeConditionsAndOperators(e,n),this.createMissingConditionsAndOperators()}}this.lastUiCompletePosition=t}updateConditionStatusesAndValues(e,t){this.eTypes.forEach((t,i)=>{const n=this.isConditionDisabled(i,e);t.setDisabled(n||this.filterListOptions.length<=1),1===i&&(cn(this.eJoinOperatorPanels[0],n),this.eJoinOperatorsAnd[0].setDisabled(n),this.eJoinOperatorsOr[0].setDisabled(n))}),this.eConditionBodies.forEach((e,t)=>{an(e,this.isConditionBodyVisible(t))});const i="OR"===(null!=t?t:this.getJoinOperator());this.eJoinOperatorsAnd.forEach((e,t)=>{e.setValue(!i,!0)}),this.eJoinOperatorsOr.forEach((e,t)=>{e.setValue(i,!0)}),this.forEachInput((t,i,n,s)=>{this.setElementDisplayed(t,i<s),this.setElementDisabled(t,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 i=Math.max(e-1,0);this.removeElements(this.eJoinOperatorPanels,i,t),this.removeComponents(this.eJoinOperatorsAnd,i,t),this.removeComponents(this.eJoinOperatorsOr,i,t)}removeElements(e,t,i){this.removeItems(e,t,i).forEach(e=>wn(e))}removeComponents(e,t,i){this.removeItems(e,t,i).forEach(e=>{wn(e.getGui()),this.destroyBean(e)})}removeItems(e,t,i){return null==i?e.splice(t):e.splice(t,i)}afterGuiAttached(e){if(super.afterGuiAttached(e),this.resetPlaceholder(),!(null==e?void 0:e.suppressFocus))if(this.isReadOnly())this.eFilterBody.focus();else{const e=this.getInputs(0)[0];if(!e)return;e instanceof Bs&&e.getInputElement().focus()}}afterGuiDetached(){super.afterGuiDetached();const e=this.getModel();this.resetUiToActiveModel(e);let t=-1,i=-1,n=!1;const s=this.getJoinOperator();for(let e=this.getNumConditions()-1;e>=0;e--)if(this.isConditionUiComplete(e))-1===t&&(t=e,i=e);else{const s=e<t;(e>=this.numAlwaysVisibleConditions&&!this.isConditionUiComplete(e-1)||s)&&(this.removeConditionsAndOperators(e,1),n=!0,s&&i--)}let r=!1;this.getNumConditions()<this.numAlwaysVisibleConditions&&(this.createMissingConditionsAndOperators(),r=!0),this.shouldAddNewConditionAtEnd(i===this.getNumConditions()-1)&&(this.createJoinOperatorPanel(),this.createOption(),r=!0),r&&this.updateConditionStatusesAndValues(i,s),n&&this.updateJoinOperatorsDisabled(),this.lastUiCompletePosition=i}getPlaceholderText(e,t){let i=this.translate(e);if($(this.filterPlaceholder)){const e=this.filterPlaceholder,n=this.eTypes[t].getValue();i=e({filterOptionKey:n,filterOption:this.translate(n),placeholder:i})}else"string"==typeof this.filterPlaceholder&&(i=this.filterPlaceholder);return i}resetPlaceholder(){const e=this.localeService.getLocaleTextFunc();this.forEachInput((t,i,n,s)=>{if(!(t instanceof Bs))return;const r=0===i&&s>1?"inRangeStart":0===i?"filterOoo":"inRangeEnd",o=0===i&&s>1?e("ariaFilterFromValue","Filter from value"):0===i?e("ariaFilterValue","Filter Value"):e("ariaFilterToValue","Filter to Value");t.setInputPlaceholder(this.getPlaceholderText(r,n)),t.setInputAriaLabel(o)})}setElementValue(e,t,i){e instanceof Bs&&e.setValue(null!=t?String(t):null,!0)}setElementDisplayed(e,t){e instanceof vs&&an(e.getGui(),t)}setElementDisabled(e,t){e instanceof vs&&cn(e.getGui(),t)}attachElementOnChange(e,t){e instanceof Bs&&e.onValueChange(t)}forEachInput(e){this.getConditionTypes().forEach((t,i)=>{this.forEachPositionTypeInput(i,t,e)})}forEachPositionInput(e,t){const i=this.getConditionType(e);this.forEachPositionTypeInput(e,i,t)}forEachPositionTypeInput(e,t,i){const n=this.getNumberOfInputs(t),s=this.getInputs(e);for(let t=0;t<s.length;t++){const r=s[t];null!=r&&i(r,t,e,n)}}isConditionDisabled(e,t){return!!this.isReadOnly()||0!==e&&e>t+1}isConditionBodyVisible(e){const t=this.getConditionType(e);return this.getNumberOfInputs(t)>0}isConditionUiComplete(t){return!(t>=this.getNumConditions())&&(this.getConditionType(t)!==e.EMPTY&&!this.getValues(t).some(e=>null==e))}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(e=>this.resetType(e)),this.eJoinOperatorsAnd.forEach((e,t)=>this.resetJoinOperatorAnd(e,t,this.joinOperatorId+t)),this.eJoinOperatorsOr.forEach((e,t)=>this.resetJoinOperatorOr(e,t,this.joinOperatorId+t)),this.joinOperatorId++,this.forEachInput(e=>this.resetInput(e)),this.resetPlaceholder(),this.createMissingConditionsAndOperators(),this.lastUiCompletePosition=null,e||this.onUiChanged(),us.resolve()}resetType(e){const t=this.localeService.getLocaleTextFunc()("ariaFilteringOperator","Filtering operator");e.setValue(this.optionsFactory.getDefaultOption(),!0).setAriaLabel(t).setDisabled(this.isReadOnly()||this.filterListOptions.length<=1)}resetJoinOperatorAnd(e,t,i){this.resetJoinOperator(e,t,this.isDefaultOperator("AND"),this.translate("andCondition"),i)}resetJoinOperatorOr(e,t,i){this.resetJoinOperator(e,t,this.isDefaultOperator("OR"),this.translate("orCondition"),i)}resetJoinOperator(e,t,i,n,s){this.updateJoinOperatorDisabled(e.setValue(i,!0).setName(`ag-simple-filter-and-or-${this.getCompId()}-${s}`).setLabel(n),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 i=this.mapValuesFromModel(e);this.forEachInput((e,n,s,r)=>{s===t&&this.setElementValue(e,null!=i[n]?i[n]:null)})}setValueFromFloatingFilter(e){this.forEachInput((t,i,n,s)=>{this.setElementValue(t,0===i&&0===n?e:null,!0)})}isDefaultOperator(e){return e===this.defaultJoinOperator}addChangedListeners(e,t){this.isReadOnly()||(e.onValueChange(this.listener),this.forEachPositionInput(t,e=>{this.attachElementOnChange(e,this.listener)}))}individualConditionPasses(e,t){const i=this.getCellValue(e.node),n=this.mapValuesFromModel(t),s=this.optionsFactory.getCustomOption(t.type),r=this.evaluateCustomFilter(s,n,i);return null!=r?r:null==i?this.evaluateNullValue(t.type):this.evaluateNonNullValue(n,i,t,e)}evaluateCustomFilter(e,t,i){if(null==e)return;const{predicate:n}=e;return null==n||t.some(e=>null==e)?void 0:n(t,i)}isBlank(e){return null==e||"string"==typeof e&&0===e.trim().length}hasInvalidInputs(){return!1}};zs.EMPTY="empty",zs.BLANK="blank",zs.NOT_BLANK="notBlank",zs.EQUALS="equals",zs.NOT_EQUAL="notEqual",zs.LESS_THAN="lessThan",zs.LESS_THAN_OR_EQUAL="lessThanOrEqual",zs.GREATER_THAN="greaterThan",zs.GREATER_THAN_OR_EQUAL="greaterThanOrEqual",zs.IN_RANGE="inRange",zs.CONTAINS="contains",zs.NOT_CONTAINS="notContains",zs.STARTS_WITH="startsWith",zs.ENDS_WITH="endsWith";var Ws=zs,js=class e extends Ws{setParams(e){super.setParams(e),this.scalarFilterParams=e}evaluateNullValue(t){switch(t){case e.EQUALS:case e.NOT_EQUAL:if(this.scalarFilterParams.includeBlanksInEquals)return!0;break;case e.GREATER_THAN:case e.GREATER_THAN_OR_EQUAL:if(this.scalarFilterParams.includeBlanksInGreaterThan)return!0;break;case e.LESS_THAN:case e.LESS_THAN_OR_EQUAL:if(this.scalarFilterParams.includeBlanksInLessThan)return!0;break;case e.IN_RANGE:if(this.scalarFilterParams.includeBlanksInRange)return!0;break;case e.BLANK:return!0;case e.NOT_BLANK:return!1}return!1}evaluateNonNullValue(t,i,n){const s=this.comparator(),r=null!=t[0]?s(t[0],i):0;switch(n.type){case e.EQUALS:return 0===r;case e.NOT_EQUAL:return 0!==r;case e.GREATER_THAN:return r>0;case e.GREATER_THAN_OR_EQUAL:return r>=0;case e.LESS_THAN:return r<0;case e.LESS_THAN_OR_EQUAL:return r<=0;case e.IN_RANGE:{const e=s(t[1],i);return this.scalarFilterParams.inRangeInclusive?r>=0&&e<=0:r>0&&e<0}case e.BLANK:return this.isBlank(i);case e.NOT_BLANK:return!this.isBlank(i);default:return console.warn('AG Grid: Unexpected type of filter "'+n.type+'", it looks like the filter was configured with incorrect Filter Options'),!0}}},$s=1/0,Ks=class extends Us{constructor(e,t,i){super(t,i),this.dateFilterParams=e}conditionToString(e,t){const{type:i}=e,{numberOfInputs:n}=t||{},s=i==Ws.IN_RANGE||2===n,r=Ji(e.dateFrom),o=Ji(e.dateTo),a=this.dateFilterParams.inRangeFloatingFilterDateFormat;return s?`${null!==r?Qi(r,a):"null"}-${null!==o?Qi(o,a):"null"}`:null!=r?Qi(r,a):`${i}`}updateParams(e){super.updateParams(e),this.dateFilterParams=e.dateFilterParams}},Ys=class e extends js{constructor(){super("dateFilter"),this.eConditionPanelsFrom=[],this.eConditionPanelsTo=[],this.dateConditionFromComps=[],this.dateConditionToComps=[],this.minValidYear=1e3,this.maxValidYear=$s,this.minValidDate=null,this.maxValidDate=null}afterGuiAttached(e){super.afterGuiAttached(e),this.dateConditionFromComps[0].afterGuiAttached(e)}mapValuesFromModel(e){const{dateFrom:t,dateTo:i,type:n}=e||{};return[t&&Ji(t)||null,i&&Ji(i)||null].slice(0,this.getNumberOfInputs(n))}comparator(){return this.dateFilterParams.comparator?this.dateFilterParams.comparator:this.defaultComparator.bind(this)}defaultComparator(e,t){return null==t||t<e?-1:t>e?1:0}setParams(e){this.dateFilterParams=e,super.setParams(e);const t=(t,i)=>{if(null!=e[t]){if(!isNaN(e[t]))return null==e[t]?i:Number(e[t]);console.warn(`AG Grid: DateFilter ${t} is not a number`)}return i};this.minValidYear=t("minValidYear",1e3),this.maxValidYear=t("maxValidYear",$s),this.minValidYear>this.maxValidYear&&console.warn("AG Grid: DateFilter minValidYear should be <= maxValidYear"),e.minValidDate?this.minValidDate=e.minValidDate instanceof Date?e.minValidDate:Ji(e.minValidDate):this.minValidDate=null,e.maxValidDate?this.maxValidDate=e.maxValidDate instanceof Date?e.maxValidDate:Ji(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 Ks(this.dateFilterParams,this.localeService,this.optionsFactory)}createDateCompWrapper(e){const t=new Ss(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 e.DEFAULT_FILTER_OPTIONS}createValueElement(){const e=this.gos.getDocument().createElement("div");return e.classList.add("ag-filter-body"),this.createFromToElement(e,this.eConditionPanelsFrom,this.dateConditionFromComps,"from"),this.createFromToElement(e,this.eConditionPanelsTo,this.dateConditionToComps,"to"),e}createFromToElement(e,t,i,n){const s=this.gos.getDocument().createElement("div");s.classList.add(`ag-filter-${n}`),s.classList.add(`ag-filter-date-${n}`),t.push(s),e.appendChild(s),i.push(this.createDateCompWrapper(s))}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,i){this.removeItems(e,t,i).forEach(e=>e.destroy())}isValidDateValue(e){if(null===e)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((i,n,s,r)=>{s!==e||!t||n>=r||(t=t&&this.isValidDateValue(i.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),i={},n=this.getValues(e);return n.length>0&&(i.dateFrom=Xi(n[0])),n.length>1&&(i.dateTo=Xi(n[1])),d({dateFrom:null,dateTo:null,filterType:this.getFilterType(),type:t},i)}resetPlaceholder(){const e=this.localeService.getLocaleTextFunc(),t=this.translate("dateFormatOoo"),i=e("ariaFilterValue","Filter Value");this.forEachInput(e=>{e.setInputPlaceholder(t),e.setInputAriaLabel(i)})}getInputs(e){return e>=this.dateConditionFromComps.length?[null,null]:[this.dateConditionFromComps[e],this.dateConditionToComps[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(e,i,n,s)=>{i<s&&t.push(e.getDate())}),t}translate(e){return e===js.LESS_THAN?super.translate("before"):e===js.GREATER_THAN?super.translate("after"):super.translate(e)}getModelAsString(e){var t;return null!=(t=this.filterModelFormatter.getModelAsString(e))?t:""}};Ys.DEFAULT_FILTER_OPTIONS=[js.EQUALS,js.NOT_EQUAL,js.LESS_THAN,js.GREATER_THAN,js.IN_RANGE,js.BLANK,js.NOT_BLANK],f([ue("userComponentFactory")],Ys.prototype,"userComponentFactory",2);var qs=Ys,Xs=class extends vs{getDefaultDebounceMs(){return 0}destroy(){super.destroy()}isEventFromFloatingFilter(e){return e&&e.afterFloatingFilter}isEventFromDataChange(e){return null==e?void 0:e.afterDataChange}getLastType(){return this.lastType}isReadOnly(){return this.readOnly}setLastTypeFromModel(e){if(!e)return void(this.lastType=this.optionsFactory.getDefaultOption());let t;t=e.operator?e.conditions[0]:e,this.lastType=t.type}canWeEditAfterModelFromParentFilter(e){if(!e)return this.isTypeEditable(this.lastType);if(e.operator)return!1;const t=e;return this.isTypeEditable(t.type)}init(e){this.setSimpleParams(e,!1)}setSimpleParams(e,t=!0){this.optionsFactory=new xs,this.optionsFactory.init(e.filterParams,this.getDefaultFilterOptions()),t||(this.lastType=this.optionsFactory.getDefaultOption()),this.readOnly=!!e.filterParams.readOnly;const i=this.isTypeEditable(this.optionsFactory.getDefaultOption());this.setEditable(i)}onParamsUpdated(e){this.refresh(e)}refresh(e){this.setSimpleParams(e)}doesFilterHaveSingleInput(e){const t=this.optionsFactory.getCustomOption(e),{numberOfInputs:i}=t||{};return null==i||1==i}isTypeEditable(e){const t=[Ws.IN_RANGE,Ws.EMPTY,Ws.BLANK,Ws.NOT_BLANK];return!!e&&!this.isReadOnly()&&this.doesFilterHaveSingleInput(e)&&t.indexOf(e)<0}getAriaLabel(e){return`${this.columnModel.getDisplayNameForColumn(e.column,"header",!0)} ${this.localeService.getLocaleTextFunc()("ariaFilterInput","Filter Input")}`}};f([ue("columnModel")],Xs.prototype,"columnModel",2);var Zs=class extends Xs{constructor(){super('\n            <div class="ag-floating-filter-input" role="presentation">\n                <ag-input-text-field ref="eReadOnlyText"></ag-input-text-field>\n                <div ref="eDateWrapper" style="display: flex;"></div>\n            </div>')}getDefaultFilterOptions(){return qs.DEFAULT_FILTER_OPTIONS}init(e){super.init(e),this.params=e,this.filterParams=e.filterParams,this.createDateComponent(),this.filterModelFormatter=new Ks(this.filterParams,this.localeService,this.optionsFactory);const t=this.localeService.getLocaleTextFunc();this.eReadOnlyText.setDisabled(!0).setInputAriaLabel(t("ariaDateFilterInput","Date Filter Input"))}onParamsUpdated(e){this.refresh(e)}refresh(e){super.refresh(e),this.params=e,this.filterParams=e.filterParams,this.updateDateComponent(),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory,dateFilterParams:this.filterParams}),this.updateCompOnModelChange(e.currentParentModel())}updateCompOnModelChange(e){const t=!this.isReadOnly()&&this.canWeEditAfterModelFromParentFilter(e);if(this.setEditable(t),t){if(e){const t=e;this.dateComp.setDate(Ji(t.dateFrom))}else this.dateComp.setDate(null);this.eReadOnlyText.setValue("")}else this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(e)),this.dateComp.setDate(null)}setEditable(e){an(this.eDateWrapper,e),an(this.eReadOnlyText.getGui(),!e)}onParentModelChanged(e,t){this.isEventFromFloatingFilter(t)||this.isEventFromDataChange(t)||(super.setLastTypeFromModel(e),this.updateCompOnModelChange(e))}onDateChanged(){const e=Xi(this.dateComp.getDate());this.params.parentFilterInstance(t=>{if(t){const i=Ji(e);t.onFloatingFilterChanged(this.getLastType()||null,i)}})}getDateComponentParams(){const e=ks.getDebounceMs(this.params.filterParams,this.getDefaultDebounceMs());return{onDateChanged:Q(this.onDateChanged.bind(this),e),filterParams:this.params.column.getColDef().filterParams}}createDateComponent(){this.dateComp=new Ss(this.getContext(),this.userComponentFactory,this.getDateComponentParams(),this.eDateWrapper,e=>{e.setInputAriaLabel(this.getAriaLabel(this.params))}),this.addDestroyFunc(()=>this.dateComp.destroy())}updateDateComponent(){const e=this.gos.addGridCommonParams(this.getDateComponentParams());this.dateComp.updateParams(e)}getFilterModelFormatter(){return this.filterModelFormatter}};f([ue("userComponentFactory")],Zs.prototype,"userComponentFactory",2),f([bs("eReadOnlyText")],Zs.prototype,"eReadOnlyText",2),f([bs("eDateWrapper")],Zs.prototype,"eDateWrapper",2);var Qs=class extends vs{constructor(){super('\n            <div class="ag-filter-filter">\n                <ag-input-text-field class="ag-date-filter" ref="eDateInput"></ag-input-text-field>\n            </div>')}destroy(){super.destroy()}init(e){this.params=e,this.setParams(e);const t=this.eDateInput.getInputElement();this.addManagedListener(t,"mousedown",()=>{this.eDateInput.isDisabled()||this.usingSafariDatePicker||t.focus()}),this.addManagedListener(t,"input",e=>{e.target===this.gos.getActiveDomElement()&&(this.eDateInput.isDisabled()||this.params.onDateChanged())})}setParams(e){const t=this.eDateInput.getInputElement(),i=this.shouldUseBrowserDatePicker(e);this.usingSafariDatePicker=i&&Ti(),t.type=i?"date":"text";const{minValidYear:n,maxValidYear:s,minValidDate:r,maxValidDate:o}=e.filterParams||{};if(r&&n&&z("DateFilter should not have both minValidDate and minValidYear parameters set at the same time! minValidYear will be ignored."),o&&s&&z("DateFilter should not have both maxValidDate and maxValidYear parameters set at the same time! maxValidYear will be ignored."),r&&o){const[e,t]=[r,o].map(e=>e instanceof Date?e:Ji(e));e&&t&&e.getTime()>t.getTime()&&z("DateFilter parameter minValidDate should always be lower than or equal to parameter maxValidDate.")}r?r instanceof Date?t.min=Qi(r):t.min=r:n&&(t.min=`${n}-01-01`),o?o instanceof Date?t.max=Qi(o):t.max=o:s&&(t.max=`${s}-12-31`)}onParamsUpdated(e){this.refresh(e)}refresh(e){this.params=e,this.setParams(e)}getDate(){return Ji(this.eDateInput.getValue())}setDate(e){this.eDateInput.setValue(Xi(e,!1))}setInputPlaceholder(e){this.eDateInput.setInputPlaceholder(e)}setInputAriaLabel(e){this.eDateInput.setAriaLabel(e)}setDisabled(e){this.eDateInput.setDisabled(e)}afterGuiAttached(e){e&&e.suppressFocus||this.eDateInput.getInputElement().focus()}shouldUseBrowserDatePicker(e){return e.filterParams&&null!=e.filterParams.browserDatePicker?e.filterParams.browserDatePicker:Ii()||Ri()||Ti()&&Di()>=14.1}};f([bs("eDateInput")],Qs.prototype,"eDateInput",2);var Js=class extends Bs{constructor(e,t="ag-text-field",i="text"){super(e,t,i)}postConstruct(){super.postConstruct(),this.config.allowedCharPattern&&this.preventDisallowedCharacters()}setValue(e,t){return this.eInput.value!==e&&(this.eInput.value=b(e)?e:""),super.setValue(e,t)}setStartValue(e){this.setValue(e,!0)}preventDisallowedCharacters(){const e=new RegExp(`[${this.config.allowedCharPattern}]`);this.addManagedListener(this.eInput,"keydown",t=>{Qn(t)&&t.key&&!e.test(t.key)&&t.preventDefault()}),this.addManagedListener(this.eInput,"paste",t=>{var i;const n=null==(i=t.clipboardData)?void 0:i.getData("text");n&&n.split("").some(t=>!e.test(t))&&t.preventDefault()})}},er=class extends Js{constructor(e){super(e,"ag-number-field","number")}postConstruct(){super.postConstruct(),this.addManagedListener(this.eInput,"blur",()=>{const e=parseFloat(this.eInput.value),t=isNaN(e)?"":this.normalizeValue(e.toString());this.value!==t&&this.setValue(t)}),this.addManagedListener(this.eInput,"wheel",this.onWheel.bind(this)),this.eInput.step="any";const{precision:e,min:t,max:i,step:n}=this.config;"number"==typeof e&&this.setPrecision(e),"number"==typeof t&&this.setMin(t),"number"==typeof i&&this.setMax(i),"number"==typeof n&&this.setStep(n)}onWheel(e){this.gos.getActiveDomElement()===this.eInput&&e.preventDefault()}normalizeValue(e){if(""===e)return"";null!=this.precision&&(e=this.adjustPrecision(e));const t=parseFloat(e);return null!=this.min&&t<this.min?e=this.min.toString():null!=this.max&&t>this.max&&(e=this.max.toString()),e}adjustPrecision(e,t){if(null==this.precision)return e;if(t){const t=parseFloat(e).toFixed(this.precision);return parseFloat(t).toString()}const i=String(e).split(".");if(i.length>1){if(i[1].length<=this.precision)return e;if(this.precision>0)return`${i[0]}.${i[1].slice(0,this.precision)}`}return i[0]}setMin(e){return this.min===e||(this.min=e,Bn(this.eInput,"min",e)),this}setMax(e){return this.max===e||(this.max=e,Bn(this.eInput,"max",e)),this}setPrecision(e){return this.precision=e,this}setStep(e){return this.step===e||(this.step=e,Bn(this.eInput,"step",e)),this}setValue(e,t){return this.setValueOrInputValue(e=>super.setValue(e,t),()=>this,e)}setStartValue(e){return this.setValueOrInputValue(e=>super.setValue(e,!0),e=>{this.eInput.value=e},e)}setValueOrInputValue(e,t,i){if(b(i)){let n=this.isScientificNotation(i);if(n&&this.eInput.validity.valid)return e(i);if(n||(n=(i=this.adjustPrecision(i))!=this.normalizeValue(i)),n)return t(i)}return e(i)}getValue(){if(!this.eInput.validity.valid)return;const e=this.eInput.value;return this.isScientificNotation(e)?this.adjustPrecision(e,!0):super.getValue()}isScientificNotation(e){return"string"==typeof e&&e.includes("e")}},tr=class extends Us{conditionToString(e,t){const{numberOfInputs:i}=t||{};return e.type==Ws.IN_RANGE||2===i?`${this.formatValue(e.filter)}-${this.formatValue(e.filterTo)}`:null!=e.filter?this.formatValue(e.filter):`${e.type}`}};function ir(e){const{allowedCharPattern:t}=null!=e?e:{};return null!=t?t:null}var nr=class e extends js{constructor(){super("numberFilter"),this.eValuesFrom=[],this.eValuesTo=[]}refresh(e){return this.numberFilterParams.allowedCharPattern===e.allowedCharPattern&&super.refresh(e)}mapValuesFromModel(e){const{filter:t,filterTo:i,type:n}=e||{};return[this.processValue(t),this.processValue(i)].slice(0,this.getNumberOfInputs(n))}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 tr(this.localeService,this.optionsFactory,this.numberFilterParams.numberFormatter)}getDefaultFilterOptions(){return e.DEFAULT_FILTER_OPTIONS}setElementValue(e,t,i){const n=!i&&this.numberFilterParams.numberFormatter?this.numberFilterParams.numberFormatter(null!=t?t:null):t;super.setElementValue(e,n)}createValueElement(){const e=ir(this.numberFilterParams),t=document.createElement("div");return t.classList.add("ag-filter-body"),Ht(t,"presentation"),this.createFromToElement(t,this.eValuesFrom,"from",e),this.createFromToElement(t,this.eValuesTo,"to",e),t}createFromToElement(e,t,i,n){const s=this.createManagedBean(n?new Js({allowedCharPattern:n}):new er);s.addCssClass(`ag-filter-${i}`),s.addCssClass("ag-filter-filter"),t.push(s),e.appendChild(s.getGui())}removeValueElements(e,t){this.removeComponents(this.eValuesFrom,e,t),this.removeComponents(this.eValuesTo,e,t)}getValues(e){const t=[];return this.forEachPositionInput(e,(e,i,n,s)=>{i<s&&t.push(this.processValue(this.stringToFloat(e.getValue())))}),t}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getFilterType(){return"number"}processValue(e){return null==e||isNaN(e)?null:e}stringToFloat(e){if("number"==typeof e)return e;let t=v(e);return null!=t&&""===t.trim()&&(t=null),this.numberFilterParams.numberParser?this.numberFilterParams.numberParser(t):null==t||"-"===t.trim()?null:parseFloat(t)}createCondition(e){const t=this.getConditionType(e),i={filterType:this.getFilterType(),type:t},n=this.getValues(e);return n.length>0&&(i.filter=n[0]),n.length>1&&(i.filterTo=n[1]),i}getInputs(e){return e>=this.eValuesFrom.length?[null,null]:[this.eValuesFrom[e],this.eValuesTo[e]]}getModelAsString(e){var t;return null!=(t=this.filterModelFormatter.getModelAsString(e))?t:""}hasInvalidInputs(){let e=!1;return this.forEachInput(t=>{t.getInputElement().validity.valid||(e=!0)}),e}};nr.DEFAULT_FILTER_OPTIONS=[js.EQUALS,js.NOT_EQUAL,js.GREATER_THAN,js.GREATER_THAN_OR_EQUAL,js.LESS_THAN,js.LESS_THAN_OR_EQUAL,js.IN_RANGE,js.BLANK,js.NOT_BLANK];var sr=nr,rr=class extends Us{conditionToString(e,t){const{numberOfInputs:i}=t||{};return e.type==Ws.IN_RANGE||2===i?`${e.filter}-${e.filterTo}`:null!=e.filter?`${e.filter}`:`${e.type}`}},or=class e extends Ws{constructor(){super("textFilter"),this.eValuesFrom=[],this.eValuesTo=[]}static trimInput(e){const t=e&&e.trim();return""===t?e:t}getDefaultDebounceMs(){return 500}setParams(t){this.textFilterParams=t,super.setParams(t),this.matcher=this.getTextMatcher(),this.formatter=this.textFilterParams.textFormatter||(this.textFilterParams.caseSensitive?e.DEFAULT_FORMATTER:e.DEFAULT_LOWERCASE_FORMATTER),this.filterModelFormatter=new rr(this.localeService,this.optionsFactory)}getTextMatcher(){const t=this.textFilterParams.textCustomComparator;return t?(cs.warnOnce("textCustomComparator is deprecated, use textMatcher instead."),({filterOption:e,value:i,filterText:n})=>t(e,i,n)):this.textFilterParams.textMatcher||e.DEFAULT_MATCHER}createCondition(e){const t=this.getConditionType(e),i={filterType:this.getFilterType(),type:t},n=this.getValuesWithSideEffects(e,!0);return n.length>0&&(i.filter=n[0]),n.length>1&&(i.filterTo=n[1]),i}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(t,i){const n=[];return this.forEachPositionInput(t,(t,s,r,o)=>{var a;if(s<o){let s=v(t.getValue());i&&this.textFilterParams.trimInput&&(s=null!=(a=e.trimInput(s))?a:null,t.setValue(s,!0)),n.push(s)}}),n}getDefaultFilterOptions(){return e.DEFAULT_FILTER_OPTIONS}createValueElement(){const e=document.createElement("div");return e.classList.add("ag-filter-body"),Ht(e,"presentation"),this.createFromToElement(e,this.eValuesFrom,"from"),this.createFromToElement(e,this.eValuesTo,"to"),e}createFromToElement(e,t,i){const n=this.createManagedBean(new Js);n.addCssClass(`ag-filter-${i}`),n.addCssClass("ag-filter-filter"),t.push(n),e.appendChild(n.getGui())}removeValueElements(e,t){this.removeComponents(this.eValuesFrom,e,t),this.removeComponents(this.eValuesTo,e,t)}mapValuesFromModel(e){const{filter:t,filterTo:i,type:n}=e||{};return[t||null,i||null].slice(0,this.getNumberOfInputs(n))}evaluateNullValue(e){const t=[Ws.NOT_EQUAL,Ws.NOT_CONTAINS,Ws.BLANK];return!!e&&t.indexOf(e)>=0}evaluateNonNullValue(e,t,i,n){const s=e.map(e=>this.formatter(e))||[],r=this.formatter(t),{api:o,colDef:a,column:l,columnApi:c,context:h,textFormatter:u}=this.textFilterParams;if(i.type===Ws.BLANK)return this.isBlank(t);if(i.type===Ws.NOT_BLANK)return!this.isBlank(t);const g={api:o,colDef:a,column:l,columnApi:c,context:h,node:n.node,data:n.data,filterOption:i.type,value:r,textFormatter:u};return s.some(e=>this.matcher(p(d({},g),{filterText:e})))}getModelAsString(e){var t;return null!=(t=this.filterModelFormatter.getModelAsString(e))?t:""}};or.DEFAULT_FILTER_OPTIONS=[Ws.CONTAINS,Ws.NOT_CONTAINS,Ws.EQUALS,Ws.NOT_EQUAL,Ws.STARTS_WITH,Ws.ENDS_WITH,Ws.BLANK,Ws.NOT_BLANK],or.DEFAULT_FORMATTER=e=>e,or.DEFAULT_LOWERCASE_FORMATTER=e=>null==e?null:e.toString().toLowerCase(),or.DEFAULT_MATCHER=({filterOption:e,value:t,filterText:i})=>{if(null==i)return!1;switch(e){case or.CONTAINS:return t.indexOf(i)>=0;case or.NOT_CONTAINS:return t.indexOf(i)<0;case or.EQUALS:return t===i;case or.NOT_EQUAL:return t!=i;case or.STARTS_WITH:return 0===t.indexOf(i);case or.ENDS_WITH:const e=t.lastIndexOf(i);return e>=0&&e===t.length-i.length;default:return!1}};var ar=or,lr=class extends st{constructor(e){super(),this.params=e,this.valueChangedListener=()=>{}}setupGui(e){var t;this.eFloatingFilterTextInput=this.createManagedBean(new Js(null==(t=this.params)?void 0:t.config));const i=this.eFloatingFilterTextInput.getGui();e.appendChild(i),this.addManagedListener(i,"input",e=>this.valueChangedListener(e)),this.addManagedListener(i,"keydown",e=>this.valueChangedListener(e))}setEditable(e){this.eFloatingFilterTextInput.setDisabled(!e)}setAutoComplete(e){this.eFloatingFilterTextInput.setAutoComplete(e)}getValue(){return this.eFloatingFilterTextInput.getValue()}setValue(e,t){this.eFloatingFilterTextInput.setValue(e,t)}setValueChangedListener(e){this.valueChangedListener=e}setParams(e){this.setAriaLabel(e.ariaLabel),void 0!==e.autoComplete&&this.setAutoComplete(e.autoComplete)}setAriaLabel(e){this.eFloatingFilterTextInput.setInputAriaLabel(e)}},cr=class extends Xs{postConstruct(){this.setTemplate('\n            <div class="ag-floating-filter-input" role="presentation" ref="eFloatingFilterInputContainer"></div>\n        ')}getDefaultDebounceMs(){return 500}onParentModelChanged(e,t){this.isEventFromFloatingFilter(t)||this.isEventFromDataChange(t)||(this.setLastTypeFromModel(e),this.setEditable(this.canWeEditAfterModelFromParentFilter(e)),this.floatingFilterInputService.setValue(this.getFilterModelFormatter().getModelAsString(e)))}init(e){this.setupFloatingFilterInputService(e),super.init(e),this.setTextInputParams(e)}setupFloatingFilterInputService(e){this.floatingFilterInputService=this.createFloatingFilterInputService(e),this.floatingFilterInputService.setupGui(this.eFloatingFilterInputContainer)}setTextInputParams(e){var t;this.params=e;const i=null!=(t=e.browserAutoComplete)&&t;if(this.floatingFilterInputService.setParams({ariaLabel:this.getAriaLabel(e),autoComplete:i}),this.applyActive=ks.isUseApplyButton(this.params.filterParams),!this.isReadOnly()){const e=ks.getDebounceMs(this.params.filterParams,this.getDefaultDebounceMs()),t=Q(this.syncUpWithParentFilter.bind(this),e);this.floatingFilterInputService.setValueChangedListener(t)}}onParamsUpdated(e){this.refresh(e)}refresh(e){super.refresh(e),this.setTextInputParams(e)}recreateFloatingFilterInputService(e){const t=this.floatingFilterInputService.getValue();Cn(this.eFloatingFilterInputContainer),this.destroyBean(this.floatingFilterInputService),this.setupFloatingFilterInputService(e),this.floatingFilterInputService.setValue(t,!0)}syncUpWithParentFilter(e){const t=e.key===Zn.ENTER;if(this.applyActive&&!t)return;let i=this.floatingFilterInputService.getValue();this.params.filterParams.trimInput&&(i=ar.trimInput(i),this.floatingFilterInputService.setValue(i,!0)),this.params.parentFilterInstance(e=>{e&&e.onFloatingFilterChanged(this.getLastType()||null,i||null)})}setEditable(e){this.floatingFilterInputService.setEditable(e)}};f([bs("eFloatingFilterInputContainer")],cr.prototype,"eFloatingFilterInputContainer",2),f([le],cr.prototype,"postConstruct",1);var hr=class extends st{constructor(){super(...arguments),this.valueChangedListener=()=>{},this.numberInputActive=!0}setupGui(e){this.eFloatingFilterNumberInput=this.createManagedBean(new er),this.eFloatingFilterTextInput=this.createManagedBean(new Js),this.eFloatingFilterTextInput.setDisabled(!0);const t=this.eFloatingFilterNumberInput.getGui(),i=this.eFloatingFilterTextInput.getGui();e.appendChild(t),e.appendChild(i),this.setupListeners(t,e=>this.valueChangedListener(e)),this.setupListeners(i,e=>this.valueChangedListener(e))}setEditable(e){this.numberInputActive=e,this.eFloatingFilterNumberInput.setDisplayed(this.numberInputActive),this.eFloatingFilterTextInput.setDisplayed(!this.numberInputActive)}setAutoComplete(e){this.eFloatingFilterNumberInput.setAutoComplete(e),this.eFloatingFilterTextInput.setAutoComplete(e)}getValue(){return this.getActiveInputElement().getValue()}setValue(e,t){this.getActiveInputElement().setValue(e,t)}getActiveInputElement(){return this.numberInputActive?this.eFloatingFilterNumberInput:this.eFloatingFilterTextInput}setValueChangedListener(e){this.valueChangedListener=e}setupListeners(e,t){this.addManagedListener(e,"input",t),this.addManagedListener(e,"keydown",t)}setParams(e){this.setAriaLabel(e.ariaLabel),void 0!==e.autoComplete&&this.setAutoComplete(e.autoComplete)}setAriaLabel(e){this.eFloatingFilterNumberInput.setInputAriaLabel(e),this.eFloatingFilterTextInput.setInputAriaLabel(e)}},ur=class extends cr{init(e){var t;super.init(e),this.filterModelFormatter=new tr(this.localeService,this.optionsFactory,null==(t=e.filterParams)?void 0:t.numberFormatter)}onParamsUpdated(e){this.refresh(e)}refresh(e){ir(e.filterParams)!==this.allowedCharPattern&&this.recreateFloatingFilterInputService(e),super.refresh(e),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory})}getDefaultFilterOptions(){return sr.DEFAULT_FILTER_OPTIONS}getFilterModelFormatter(){return this.filterModelFormatter}createFloatingFilterInputService(e){return this.allowedCharPattern=ir(e.filterParams),this.allowedCharPattern?this.createManagedBean(new lr({config:{allowedCharPattern:this.allowedCharPattern}})):this.createManagedBean(new hr)}},dr=class extends cr{init(e){super.init(e),this.filterModelFormatter=new rr(this.localeService,this.optionsFactory)}onParamsUpdated(e){this.refresh(e)}refresh(e){super.refresh(e),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory})}getDefaultFilterOptions(){return ar.DEFAULT_FILTER_OPTIONS}getFilterModelFormatter(){return this.filterModelFormatter}createFloatingFilterInputService(){return this.createManagedBean(new lr)}},pr=class e{constructor(e,t=!1){this.destroyFuncs=[],this.touching=!1,this.eventService=new me,this.eElement=e,this.preventMouseClick=t;const i=this.onTouchStart.bind(this),n=this.onTouchMove.bind(this),s=this.onTouchEnd.bind(this);this.eElement.addEventListener("touchstart",i,{passive:!0}),this.eElement.addEventListener("touchmove",n,{passive:!0}),this.eElement.addEventListener("touchend",s,{passive:!1}),this.destroyFuncs.push(()=>{this.eElement.removeEventListener("touchstart",i,{passive:!0}),this.eElement.removeEventListener("touchmove",n,{passive:!0}),this.eElement.removeEventListener("touchend",s,{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(t){if(this.touching)return;this.touchStart=t.touches[0],this.touching=!0,this.moved=!1;const i=this.touchStart;window.setTimeout(()=>{const n=this.touchStart===i;if(this.touching&&n&&!this.moved){this.moved=!0;const i={type:e.EVENT_LONG_TAP,touchStart:this.touchStart,touchEvent:t};this.eventService.dispatchEvent(i)}},500)}onTouchMove(e){if(!this.touching)return;const t=this.getActiveTouch(e.touches);t&&!ss(t,this.touchStart,4)&&(this.moved=!0)}onTouchEnd(t){if(this.touching){if(!this.moved){const t={type:e.EVENT_TAP,touchStart:this.touchStart};this.eventService.dispatchEvent(t),this.checkForDoubleTap()}this.preventMouseClick&&t.cancelable&&t.preventDefault(),this.touching=!1}}checkForDoubleTap(){const t=(new Date).getTime();if(this.lastTapTime&&this.lastTapTime>0)if(t-this.lastTapTime>e.DOUBLE_TAP_MILLIS){const t={type:e.EVENT_DOUBLE_TAP,touchStart:this.touchStart};this.eventService.dispatchEvent(t),this.lastTapTime=null}else this.lastTapTime=t;else this.lastTapTime=t}destroy(){this.destroyFuncs.forEach(e=>e())}};pr.EVENT_TAP="tap",pr.EVENT_DOUBLE_TAP="doubleTap",pr.EVENT_LONG_TAP="longTap",pr.DOUBLE_TAP_MILLIS=500;var gr=pr,fr=class e extends vs{constructor(t){super(),t||this.setTemplate(e.TEMPLATE)}attachCustomElements(e,t,i,n,s){this.eSortOrder=e,this.eSortAsc=t,this.eSortDesc=i,this.eSortMixed=n,this.eSortNone=s}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,ct.EVENT_NEW_COLUMNS_LOADED,()=>this.updateIcons()),this.addManagedListener(this.eventService,ct.EVENT_SORT_CHANGED,()=>this.onSortChanged()),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.onSortChanged()),this.onSortChanged())}addInIcon(e,t,i){if(null==t)return;const n=qn(e,this.gos,i);n&&t.appendChild(n)}onSortChanged(){this.updateIcons(),this.suppressOrder||this.updateSortOrder()}updateIcons(){const e=this.sortController.getDisplaySortForColumn(this.column);if(this.eSortAsc){const t="asc"===e;an(this.eSortAsc,t,{skipAriaHidden:!0})}if(this.eSortDesc){const t="desc"===e;an(this.eSortDesc,t,{skipAriaHidden:!0})}if(this.eSortNone){const t=!this.column.getColDef().unSortIcon&&!this.gos.get("unSortIcon"),i=null==e;an(this.eSortNone,!t&&i,{skipAriaHidden:!0})}}setupMultiSortIndicator(){this.addInIcon("sortUnSort",this.eSortMixed,this.column);const e=this.column.getColDef().showRowGroup;this.gos.isColumnsSortingCoupledToGroup()&&e&&(this.addManagedListener(this.eventService,ct.EVENT_SORT_CHANGED,()=>this.updateMultiSortIndicator()),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.updateMultiSortIndicator()),this.updateMultiSortIndicator())}updateMultiSortIndicator(){if(this.eSortMixed){const e="mixed"===this.sortController.getDisplaySortForColumn(this.column);an(this.eSortMixed,e,{skipAriaHidden:!0})}}updateSortOrder(){var e;if(!this.eSortOrder)return;const t=this.sortController.getColumnsWithSortingOrdered(),i=null!=(e=this.sortController.getDisplaySortIndexForColumn(this.column))?e:-1,n=t.some(e=>{var t;return null!=(t=this.sortController.getDisplaySortIndexForColumn(e))&&t}),s=i>=0&&n;an(this.eSortOrder,s,{skipAriaHidden:!0}),i>=0?this.eSortOrder.textContent=(i+1).toString():Cn(this.eSortOrder)}};fr.TEMPLATE='<span class="ag-sort-indicator-container">\n            <span ref="eSortOrder" class="ag-sort-indicator-icon ag-sort-order ag-hidden" aria-hidden="true"></span>\n            <span ref="eSortAsc" class="ag-sort-indicator-icon ag-sort-ascending-icon ag-hidden" aria-hidden="true"></span>\n            <span ref="eSortDesc" class="ag-sort-indicator-icon ag-sort-descending-icon ag-hidden" aria-hidden="true"></span>\n            <span ref="eSortMixed" class="ag-sort-indicator-icon ag-sort-mixed-icon ag-hidden" aria-hidden="true"></span>\n            <span ref="eSortNone" class="ag-sort-indicator-icon ag-sort-none-icon ag-hidden" aria-hidden="true"></span>\n        </span>',f([bs("eSortOrder")],fr.prototype,"eSortOrder",2),f([bs("eSortAsc")],fr.prototype,"eSortAsc",2),f([bs("eSortDesc")],fr.prototype,"eSortDesc",2),f([bs("eSortMixed")],fr.prototype,"eSortMixed",2),f([bs("eSortNone")],fr.prototype,"eSortNone",2),f([ue("columnModel")],fr.prototype,"columnModel",2),f([ue("sortController")],fr.prototype,"sortController",2);var mr=fr,yr=class e extends vs{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&&(this.setDisplayName(e),!0)}workOutTemplate(){var t;let i=null!=(t=this.params.template)?t:e.TEMPLATE;return i=i&&i.trim?i.trim():i,i}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=bt(this.currentDisplayName,!0);this.eText&&(this.eText.textContent=t)}}addInIcon(e,t,i){if(null==t)return;const n=qn(e,this.gos,i);n&&t.appendChild(n)}setupTap(){const{gos:e}=this;if(e.get("suppressTouch"))return;const t=new gr(this.getGui(),!0),i=this.shouldSuppressMenuHide(),n=i&&b(this.eMenu),s=n?new gr(this.eMenu,!0):t;if(this.params.enableMenu){const e=n?"EVENT_TAP":"EVENT_LONG_TAP",t=e=>this.params.showColumnMenuAfterMouseClick(e.touchStart);this.addManagedListener(s,gr[e],t)}if(this.params.enableSorting){const e=e=>{var t,n;const s=e.touchStart.target;i&&((null==(t=this.eMenu)?void 0:t.contains(s))||(null==(n=this.eFilterButton)?void 0:n.contains(s)))||this.sortController.progressSort(this.params.column,!1,"uiColumnSorted")};this.addManagedListener(t,gr.EVENT_TAP,e)}if(this.params.enableFilterButton){const e=new gr(this.eFilterButton,!0);this.addManagedListener(e,"tap",()=>this.params.showFilter(this.eFilterButton)),this.addDestroyFunc(()=>e.destroy())}this.addDestroyFunc(()=>t.destroy()),n&&this.addDestroyFunc(()=>s.destroy())}workOutShowMenu(){return this.params.enableMenu&&this.menuService.isHeaderMenuButtonEnabled()}shouldSuppressMenuHide(){return this.menuService.isHeaderMenuButtonAlwaysShowEnabled()}setMenu(){if(!this.eMenu)return;if(this.currentShowMenu=this.workOutShowMenu(),!this.currentShowMenu)return wn(this.eMenu),void(this.eMenu=void 0);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,i,n,s;const{column:r}=this.params,o=this.menuService.isLegacyMenuEnabled();if(e&&!o){if(this.menuService.isFilterMenuInHeaderEnabled(r))return this.params.showFilter(null!=(i=null!=(t=this.eFilterButton)?t:this.eMenu)?i:this.getGui()),!0}else if(this.params.enableMenu)return this.params.showColumnMenu(null!=(s=null!=(n=this.eMenu)?n:this.eFilterButton)?s: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 mr(!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,Se.EVENT_MOVING_CHANGED,()=>{this.lastMovingChanged=(new Date).getTime()}),this.eLabel&&this.addManagedListener(this.eLabel,"click",e=>{const t=this.params.column.isMoving(),i=(new Date).getTime()-this.lastMovingChanged<50;if(!t&&!i){const t="ctrl"===this.gos.get("multiSortKey")?e.ctrlKey||e.metaKey:e.shiftKey;this.params.progressSort(t)}});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 e=this.columnModel.getSourceColumnsForGroupColumn(this.params.column),t=!(null==e?void 0:e.every(e=>this.params.column.getSort()==e.getSort()));this.addOrRemoveCssClass("ag-header-cell-sorted-mixed",t)}};this.addManagedListener(this.eventService,ct.EVENT_SORT_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_ROW_GROUP_CHANGED,e)}setupFilterIcon(){this.eFilter&&this.configureFilter(this.params.enableFilterIcon,this.eFilter,this.onFilterChangedIcon.bind(this))}setupFilterButton(){this.eFilterButton&&(this.configureFilter(this.params.enableFilterButton,this.eFilterButton,this.onFilterChangedButton.bind(this))?this.addManagedListener(this.eFilterButton,"click",()=>this.params.showFilter(this.eFilterButton)):this.eFilterButton=void 0)}configureFilter(e,t,i){if(!e)return wn(t),!1;const{column:n}=this.params;return this.addInIcon("filter",t,n),this.addManagedListener(n,Se.EVENT_FILTER_CHANGED,i),i(),!0}onFilterChangedIcon(){const e=this.params.column.isFilterActive();an(this.eFilter,e,{skipAriaHidden:!0})}onFilterChangedButton(){const e=this.params.column.isFilterActive();this.eFilterButton.classList.toggle("ag-filter-active",e)}getAnchorElementForMenu(e){var t,i,n,s;return e?null!=(i=null!=(t=this.eFilterButton)?t:this.eMenu)?i:this.getGui():null!=(s=null!=(n=this.eMenu)?n:this.eFilterButton)?s:this.getGui()}};yr.TEMPLATE='<div class="ag-cell-label-container" role="presentation">\n            <span ref="eMenu" class="ag-header-icon ag-header-cell-menu-button" aria-hidden="true"></span>\n            <span ref="eFilterButton" class="ag-header-icon ag-header-cell-filter-button" aria-hidden="true"></span>\n            <div ref="eLabel" class="ag-header-cell-label" role="presentation">\n                <span ref="eText" class="ag-header-cell-text"></span>\n                <span ref="eFilter" class="ag-header-icon ag-header-label-icon ag-filter-icon" aria-hidden="true"></span>\n                <ag-sort-indicator ref="eSortIndicator"></ag-sort-indicator>\n            </div>\n        </div>',f([ue("sortController")],yr.prototype,"sortController",2),f([ue("menuService")],yr.prototype,"menuService",2),f([ue("columnModel")],yr.prototype,"columnModel",2),f([bs("eFilter")],yr.prototype,"eFilter",2),f([bs("eFilterButton")],yr.prototype,"eFilterButton",2),f([bs("eSortIndicator")],yr.prototype,"eSortIndicator",2),f([bs("eMenu")],yr.prototype,"eMenu",2),f([bs("eLabel")],yr.prototype,"eLabel",2),f([bs("eText")],yr.prototype,"eText",2),f([bs("eSortOrder")],yr.prototype,"eSortOrder",2),f([bs("eSortAsc")],yr.prototype,"eSortAsc",2),f([bs("eSortDesc")],yr.prototype,"eSortDesc",2),f([bs("eSortMixed")],yr.prototype,"eSortMixed",2),f([bs("eSortNone")],yr.prototype,"eSortNone",2);var vr=yr,br=class e extends vs{constructor(){super(e.TEMPLATE)}destroy(){super.destroy()}init(e){this.params=e,this.checkWarnings(),this.setupLabel(),this.addGroupExpandIcon(),this.setupExpandIcons()}checkWarnings(){this.params.template&&z("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=e=>{if(Xe(e))return;const t=!this.params.columnGroup.isExpanded();this.columnModel.setColumnGroupOpened(this.params.columnGroup.getProvidedColumnGroup(),t,"uiColumnExpanded")};this.addTouchAndClickListeners(this.eCloseIcon,e),this.addTouchAndClickListeners(this.eOpenIcon,e);const t=e=>{qe(e)};this.addManagedListener(this.eCloseIcon,"dblclick",t),this.addManagedListener(this.eOpenIcon,"dblclick",t),this.addManagedListener(this.getGui(),"dblclick",e),this.updateIconVisibility();const i=this.params.columnGroup.getProvidedColumnGroup();this.addManagedListener(i,Ee.EVENT_EXPANDED_CHANGED,this.updateIconVisibility.bind(this)),this.addManagedListener(i,Ee.EVENT_EXPANDABLE_CHANGED,this.updateIconVisibility.bind(this))}addTouchAndClickListeners(e,t){const i=new gr(e,!0);this.addManagedListener(i,gr.EVENT_TAP,t),this.addDestroyFunc(()=>i.destroy()),this.addManagedListener(e,"click",t)}updateIconVisibility(){if(this.params.columnGroup.isExpandable()){const e=this.params.columnGroup.isExpanded();an(this.eOpenIcon,e),an(this.eCloseIcon,!e)}else an(this.eOpenIcon,!1),an(this.eCloseIcon,!1)}addInIcon(e,t){const i=qn(e,this.gos,null);i&&this.getRefElement(t).appendChild(i)}addGroupExpandIcon(){if(!this.params.columnGroup.isExpandable())return an(this.eOpenIcon,!1),void an(this.eCloseIcon,!1)}setupLabel(){var e;const{displayName:t,columnGroup:i}=this.params;if(b(t)){const e=bt(t,!0);this.getRefElement("agLabel").textContent=e}this.addOrRemoveCssClass("ag-sticky-label",!(null==(e=i.getColGroupDef())?void 0:e.suppressStickyLabel))}};br.TEMPLATE='<div class="ag-header-group-cell-label" ref="agContainer" role="presentation">\n            <span ref="agLabel" class="ag-header-group-text" role="presentation"></span>\n            <span ref="agOpened" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-expanded"></span>\n            <span ref="agClosed" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-collapsed"></span>\n        </div>',f([ue("columnModel")],br.prototype,"columnModel",2),f([bs("agOpened")],br.prototype,"eOpenIcon",2),f([bs("agClosed")],br.prototype,"eCloseIcon",2);var Cr=br,wr=class extends vs{isPopup(){return!0}setParentComponent(e){e.addCssClass("ag-has-popup"),super.setParentComponent(e)}destroy(){const e=this.parentComponent;e&&e.isAlive()&&e.getGui().classList.remove("ag-has-popup"),super.destroy()}},Sr=class e extends wr{constructor(){super(e.TEMPLATE)}init(e){this.params=e,this.focusAfterAttached=e.cellStartedEdit,this.eTextArea.setMaxLength(e.maxLength||200).setCols(e.cols||60).setRows(e.rows||10),b(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===Zn.LEFT||t===Zn.UP||t===Zn.RIGHT||t===Zn.DOWN||e.shiftKey&&t===Zn.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 b(e)||b(this.params.value)?this.params.parseValue(e):this.params.value}};Sr.TEMPLATE='<div class="ag-large-text">\n            <ag-input-text-area ref="eTextArea" class="ag-large-text-input"></ag-input-text-area>\n        </div>',f([bs("eTextArea")],Sr.prototype,"eTextArea",2);var xr=Sr,Er=class extends wr{constructor(){super('<div class="ag-cell-edit-wrapper">\n                <ag-select class="ag-cell-editor" ref="eSelect"></ag-select>\n            </div>'),this.startedByEnter=!1}init(e){this.focusAfterAttached=e.cellStartedEdit;const{eSelect:t,valueService:i,gos:n}=this,{values:s,value:r,eventKey:o}=e;if(C(s))return void console.warn("AG Grid: no values found for select cellEditor");this.startedByEnter=null!=o&&o===Zn.ENTER;let a=!1;s.forEach(n=>{const s={value:n},o=i.formatValue(e.column,null,n),l=null!=o;s.text=l?o:n,t.addOption(s),a=a||r===n}),a?t.setValue(e.value,!0):e.values.length&&t.setValue(e.values[0],!0);const{valueListGap:l,valueListMaxWidth:c,valueListMaxHeight:h}=e;null!=l&&t.setPickerGap(l),null!=h&&t.setPickerMaxHeight(h),null!=c&&t.setPickerMaxWidth(c),"fullRow"!==n.get("editType")&&this.addManagedListener(this.eSelect,Gs.EVENT_ITEM_SELECTED,()=>e.stopEditing())}afterGuiAttached(){this.focusAfterAttached&&this.eSelect.getFocusableElement().focus(),this.startedByEnter&&setTimeout(()=>{this.isAlive()&&this.eSelect.showPicker()})}focusIn(){this.eSelect.getFocusableElement().focus()}getValue(){return this.eSelect.getValue()}isPopup(){return!1}};f([ue("valueService")],Er.prototype,"valueService",2),f([bs("eSelect")],Er.prototype,"eSelect",2);var Ar=class extends wr{constructor(e){super(`\n            <div class="ag-cell-edit-wrapper">\n                ${e.getTemplate()}\n            </div>`),this.cellEditorInput=e}init(e){this.params=e;const t=this.eInput;let i;if(this.cellEditorInput.init(t,e),e.cellStartedEdit){this.focusAfterAttached=!0;const t=e.eventKey;t===Zn.BACKSPACE||e.eventKey===Zn.DELETE?i="":t&&1===t.length?i=t:(i=this.cellEditorInput.getStartValue(),t!==Zn.F2&&(this.highlightAllOnFocus=!0))}else this.focusAfterAttached=!1,i=this.cellEditorInput.getStartValue();null!=i&&t.setStartValue(i),this.addManagedListener(t.getGui(),"keydown",e=>{const{key:t}=e;t!==Zn.PAGE_UP&&t!==Zn.PAGE_DOWN||e.preventDefault()})}afterGuiAttached(){var e,t;const i=this.localeService.getLocaleTextFunc(),n=this.eInput;if(n.setInputAriaLabel(i("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;Ti()||n.getFocusableElement().focus();const s=n.getInputElement();this.highlightAllOnFocus?s.select():null==(t=(e=this.cellEditorInput).setCaret)||t.call(e)}focusIn(){const e=this.eInput,t=e.getFocusableElement(),i=e.getInputElement();t.focus(),i.select()}getValue(){return this.cellEditorInput.getValue()}isPopup(){return!1}};f([bs("eInput")],Ar.prototype,"eInput",2);var Mr=class{getTemplate(){return'<ag-input-text-field class="ag-cell-editor" ref="eInput"></ag-input-text-field>'}init(e,t){this.eInput=e,this.params=t,null!=t.maxLength&&e.setMaxLength(t.maxLength)}getValue(){const e=this.eInput.getValue();return b(e)||b(this.params.value)?this.params.parseValue(e):this.params.value}getStartValue(){return this.params.useFormatter||this.params.column.getColDef().refData?this.params.formatValue(this.params.value):this.params.value}setCaret(){const e=this.eInput.getValue(),t=b(e)&&e.length||0;t&&this.eInput.getInputElement().setSelectionRange(t,t)}},Tr=class extends Ar{constructor(){super(new Mr)}},Dr=class extends vs{constructor(){super(),this.refreshCount=0;const e=document.createElement("span"),t=document.createElement("span");t.setAttribute("class","ag-value-change-delta");const i=document.createElement("span");i.setAttribute("class","ag-value-change-value"),e.appendChild(t),e.appendChild(i),this.setTemplateFromElement(e)}init(e){this.eValue=this.queryForHtmlElement(".ag-value-change-value"),this.eDelta=this.queryForHtmlElement(".ag-value-change-delta"),this.refresh(e,!0)}showDelta(e,t){const i=Math.abs(t),n=e.formatValue(i),s=b(n)?n:i,r=t>=0;this.eDelta.textContent=r?"↑"+s:"↓"+s,this.eDelta.classList.toggle("ag-value-change-delta-up",r),this.eDelta.classList.toggle("ag-value-change-delta-down",!r)}setTimerToRemoveDelta(){this.refreshCount++;const e=this.refreshCount;this.getFrameworkOverrides().wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.hideDeltaValue()},2e3)})}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),Cn(this.eDelta)}refresh(e,t=!1){const i=e.value;if(i===this.lastValue)return!1;if(b(e.valueFormatted)?this.eValue.textContent=e.valueFormatted:b(e.value)?this.eValue.textContent=i:Cn(this.eValue),this.filterManager.isSuppressFlashingCellsBecauseFiltering())return!1;if("number"==typeof i&&"number"==typeof this.lastValue){const t=i-this.lastValue;this.showDelta(e,t)}return this.lastValue&&this.eValue.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=i,!0}};f([ue("filterManager")],Dr.prototype,"filterManager",2);var Ir=class extends vs{constructor(){super(),this.refreshCount=0;const e=document.createElement("span"),t=document.createElement("span");t.setAttribute("class","ag-value-slide-current"),e.appendChild(t),this.setTemplateFromElement(e),this.eCurrent=this.queryForHtmlElement(".ag-value-slide-current")}init(e){this.refresh(e,!0)}addSlideAnimation(){this.refreshCount++;const e=this.refreshCount;this.ePrevious&&this.getGui().removeChild(this.ePrevious);const t=document.createElement("span");t.setAttribute("class","ag-value-slide-previous ag-value-slide-out"),this.ePrevious=t,this.ePrevious.textContent=this.eCurrent.textContent,this.getGui().insertBefore(this.ePrevious,this.eCurrent),this.getFrameworkOverrides().wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{e===this.refreshCount&&(this.getGui().removeChild(this.ePrevious),this.ePrevious=null)},3e3)})}refresh(e,t=!1){let i=e.value;return C(i)&&(i=""),i!==this.lastValue&&!this.filterManager.isSuppressFlashingCellsBecauseFiltering()&&(t||this.addSlideAnimation(),this.lastValue=i,b(e.valueFormatted)?this.eCurrent.textContent=e.valueFormatted:b(e.value)?this.eCurrent.textContent=i:Cn(this.eCurrent),!0)}};f([ue("filterManager")],Ir.prototype,"filterManager",2);var Rr=class e{constructor(t){this.rowIndex=null,this.key=null,this.childrenMapped={},this.displayed=!1,this.rowTop=null,this.oldRowTop=null,this.selectable=!0,this.__objectId=e.OBJECT_ID_SEQUENCE++,this.__autoHeights={},this.alreadyRendered=!1,this.highlighted=null,this.hovered=!1,this.selected=!1,this.beans=t}setData(e){this.setDataCommon(e,!1)}updateData(e){this.setDataCommon(e,!0)}setDataCommon(e,t){const i=this.data;this.data=e,this.beans.valueCache.onDataChanged(),this.updateDataOnDetailNode(),this.checkRowSelectable(),this.resetQuickFilterAggregateText();const n=this.createDataChangedEvent(e,i,t);this.dispatchLocalEvent(n)}updateDataOnDetailNode(){this.detailNode&&(this.detailNode.data=this.data)}createDataChangedEvent(t,i,n){return{type:e.EVENT_DATA_CHANGED,node:this,oldData:i,newData:t,update:n}}createLocalRowEvent(e){return{type:e,node:this}}getRowIndexString(){return"top"===this.rowPinned?"t-"+this.rowIndex:"bottom"===this.rowPinned?"b-"+this.rowIndex:this.rowIndex.toString()}createDaemonNode(){const t=new e(this.beans);return t.id=this.id,t.data=this.data,t.__daemon=!0,t.selected=this.selected,t.level=this.level,t}setDataAndId(e,t){const i=b(this.id)?this.createDaemonNode():null,n=this.data;this.data=e,this.updateDataOnDetailNode(),this.setId(t),this.checkRowSelectable(),this.beans.selectionService.syncInRowNode(this,i);const s=this.createDataChangedEvent(e,n,!1);this.dispatchLocalEvent(s)}checkRowSelectable(){const e=this.beans.gos.get("isRowSelectable");this.setRowSelectable(!e||e(this))}setRowSelectable(t,i){if(this.selectable!==t){if(this.selectable=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_SELECTABLE_CHANGED)),i)return;if(this.beans.gos.get("groupSelectsChildren")){const e=this.calculateSelectedFromChildren();return void this.setSelectedParams({newValue:null!=e&&e,source:"selectableChanged"})}this.isSelected()&&!this.selectable&&this.setSelectedParams({newValue:!1,source:"selectableChanged"})}}setId(t){const i=this.beans.gos.getCallback("getRowId");if(i)if(this.data){const t=this.getGroupKeys(!0);this.id=i({data:this.data,parentKeys:t.length>0?t:void 0,level:this.level}),null!==this.id&&"string"==typeof this.id&&this.id.startsWith(e.ID_PREFIX_ROW_GROUP)&&console.error(`AG Grid: Row IDs cannot start with ${e.ID_PREFIX_ROW_GROUP}, this is a reserved prefix for AG Grid's row grouping feature.`),null!==this.id&&"string"!=typeof this.id&&(this.id=""+this.id)}else this.id=void 0;else this.id=t}getGroupKeys(e=!1){const t=[];let i=this;for(e&&(i=i.parent);i&&i.level>=0;)t.push(i.key),i=i.parent;return t.reverse(),t}isPixelInRange(e){return!(!b(this.rowTop)||!b(this.rowHeight))&&e>=this.rowTop&&e<this.rowTop+this.rowHeight}setFirstChild(t){this.firstChild!==t&&(this.firstChild=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_FIRST_CHILD_CHANGED)))}setLastChild(t){this.lastChild!==t&&(this.lastChild=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_LAST_CHILD_CHANGED)))}setChildIndex(t){this.childIndex!==t&&(this.childIndex=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_CHILD_INDEX_CHANGED)))}setRowTop(t){this.oldRowTop=this.rowTop,this.rowTop!==t&&(this.rowTop=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_TOP_CHANGED)),this.setDisplayed(null!==t))}clearRowTopAndRowIndex(){this.oldRowTop=null,this.setRowTop(null),this.setRowIndex(null)}setDisplayed(t){this.displayed!==t&&(this.displayed=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_DISPLAYED_CHANGED)))}setDragging(t){this.dragging!==t&&(this.dragging=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_DRAGGING_CHANGED)))}setHighlighted(t){t!==this.highlighted&&(this.highlighted=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_HIGHLIGHT_CHANGED)))}setHovered(e){this.hovered!==e&&(this.hovered=e)}isHovered(){return this.hovered}setAllChildrenCount(t){this.allChildrenCount!==t&&(this.allChildrenCount=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_ALL_CHILDREN_COUNT_CHANGED)))}setMaster(t){this.master!==t&&(this.master&&!t&&(this.expanded=!1),this.master=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_MASTER_CHANGED)))}setGroup(t){this.group!==t&&(this.group&&!t&&(this.expanded=!1),this.group=t,this.updateHasChildren(),this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_GROUP_CHANGED)))}setRowHeight(t,i=!1){this.rowHeight=t,this.rowHeightEstimated=i,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_HEIGHT_CHANGED))}setRowAutoHeight(e,t){this.__autoHeights||(this.__autoHeights={}),this.__autoHeights[t.getId()]=e,null!=e&&(null==this.checkAutoHeightsDebounced&&(this.checkAutoHeightsDebounced=Q(this.checkAutoHeights.bind(this),1)),this.checkAutoHeightsDebounced())}checkAutoHeights(){let e=!1,t=!0,i=0;const n=this.__autoHeights;if(null==n)return;if(this.beans.columnModel.getAllDisplayedAutoHeightCols().forEach(s=>{let r=n[s.getId()];if(null==r){if(!this.beans.columnModel.isColSpanActive())return void(e=!0);{let t=[];switch(s.getPinned()){case"left":t=this.beans.columnModel.getDisplayedLeftColumnsForRow(this);break;case"right":t=this.beans.columnModel.getDisplayedRightColumnsForRow(this);break;case null:t=this.beans.columnModel.getViewportCenterColumnsForRow(this)}if(t.includes(s))return void(e=!0);r=-1}}else t=!1;r>i&&(i=r)}),e)return;if((t||i<10)&&(i=this.beans.gos.getRowHeightForNode(this).height),i==this.rowHeight)return;this.setRowHeight(i);const s=this.beans.rowModel;s.onRowHeightChangedDebounced&&s.onRowHeightChangedDebounced()}setRowIndex(t){this.rowIndex!==t&&(this.rowIndex=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_ROW_INDEX_CHANGED)))}setUiLevel(t){this.uiLevel!==t&&(this.uiLevel=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_UI_LEVEL_CHANGED)))}setExpanded(t,i,n){if(this.expanded===t)return;this.expanded=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_EXPANDED_CHANGED));const s=Object.assign({},this.createGlobalRowEvent(ct.EVENT_ROW_GROUP_OPENED),{expanded:t,event:i||null});this.beans.rowNodeEventThrottle.dispatchExpanded(s,n),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,i){const n=(()=>{var t;return"string"!=typeof e?e:null!=(t=this.beans.columnModel.getGridColumn(e))?t:this.beans.columnModel.getPrimaryColumn(e)})(),s=this.getValueFromValueService(n);if(this.beans.gos.get("readOnlyEdit"))return this.dispatchEventForSaveValueReadOnly(n,s,t,i),!1;const r=this.beans.valueService.setValue(this,n,t,i);return this.dispatchCellChangedEvent(n,t,s),this.checkRowSelectable(),r}getValueFromValueService(e){var t,i;const n=this.leafGroup&&this.beans.columnModel.isPivotMode(),s=this.group&&this.expanded&&!this.footer&&!n;let r=!1;const o=null!=(t=this.beans.gos.get("groupTotalRow"))?t:this.beans.gos.get("groupIncludeFooter");r="function"!=typeof o?!!o:!!(null!=(i=this.beans.gos.getCallback("groupTotalRow"))?i:this.beans.gos.getCallback("groupIncludeFooter"))({node:this});const a=this.beans.gos.get("groupSuppressBlankHeader"),l=s&&r&&!a;return this.beans.valueService.getValue(e,this,!1,l)}dispatchEventForSaveValueReadOnly(e,t,i,n){const s=this.beans.gos.addGridCommonParams({type:ct.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:i,value:i,source:n});this.beans.eventService.dispatchEvent(s)}setGroupValue(e,t){const i=this.beans.columnModel.getGridColumn(e);C(this.groupData)&&(this.groupData={});const n=i.getColId(),s=this.groupData[n];s!==t&&(this.groupData[n]=t,this.dispatchCellChangedEvent(i,t,s))}setAggData(e){const t=this.aggData;if(this.aggData=e,this.eventService){const i=e=>{const i=this.aggData?this.aggData[e]:void 0,n=t?t[e]:void 0;if(i===n)return;const s=this.beans.columnModel.lookupGridColumn(e);s&&this.dispatchCellChangedEvent(s,i,n)};for(const e in this.aggData)i(e);for(const t in e)t in this.aggData||i(t)}}updateHasChildren(){let t=this.group&&!this.footer||this.childrenAfterGroup&&this.childrenAfterGroup.length>0;if(this.beans.gos.isRowModelType("serverSide")){const e=this.beans.gos.get("treeData"),i=this.beans.gos.get("isServerSideGroup");t=!this.stub&&!this.footer&&(e?!!i&&i(this.data):!!this.group)}t!==this.__hasChildren&&(this.__hasChildren=!!t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_HAS_CHILDREN_CHANGED)))}hasChildren(){return null==this.__hasChildren&&this.updateHasChildren(),this.__hasChildren}isEmptyRowGroupNode(){return this.group&&w(this.childrenAfterGroup)}dispatchCellChangedEvent(t,i,n){const s={type:e.EVENT_CELL_CHANGED,node:this,column:t,newValue:i,oldValue:n};this.dispatchLocalEvent(s)}resetQuickFilterAggregateText(){this.quickFilterAggregateText=null}isExpandable(){return!this.footer&&(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,i=!1,n=!1;if(!(null==(e=this.childrenAfterGroup)?void 0:e.length))return this.selectable?this.selected:null;for(let e=0;e<this.childrenAfterGroup.length;e++){const s=this.childrenAfterGroup[e];let r=s.isSelected();if(!s.selectable){const e=s.calculateSelectedFromChildren();if(null===e)continue;r=e}switch(r){case!0:t=!0;break;case!1:i=!0;break;default:n=!0}}return n||t&&i?void 0:!!t||!i&&(this.selectable?this.selected:null)}setSelectedInitialValue(e){this.selected=e}selectThisNode(t,i,n="api"){const s=!this.selectable&&t,r=this.selected===t;if(s||r)return!1;this.selected=t,this.eventService&&this.dispatchLocalEvent(this.createLocalRowEvent(e.EVENT_ROW_SELECTED));const o=this.sibling;o&&o.footer&&o.eventService&&o.dispatchLocalEvent(o.createLocalRowEvent(e.EVENT_ROW_SELECTED));const a=p(d({},this.createGlobalRowEvent(ct.EVENT_ROW_SELECTED)),{event:i||null,source:n});return this.beans.eventService.dispatchEvent(a),!0}setSelected(e,t=!1,i="api"){"boolean"!=typeof i?this.setSelectedParams({newValue:e,clearSelection:t,rangeSelect:!1,source:i}):console.warn("AG Grid: since version v30, rowNode.setSelected() property `suppressFinishActions` has been removed, please use `gridApi.setNodesSelected()` for bulk actions, and the event `source` property for ignoring events instead.")}setSelectedParams(e){return this.rowPinned?(console.warn("AG Grid: cannot select pinned rows"),0):void 0===this.id?(console.warn("AG Grid: cannot select node until id for node is known"),0):this.beans.selectionService.setNodesSelected(p(d({},e),{nodes:[this.footer?this.sibling:this]}))}isRowPinned(){return"top"===this.rowPinned||"bottom"===this.rowPinned}isParentOfNode(e){let t=this.parent;for(;t;){if(t===e)return!0;t=t.parent}return!1}addEventListener(e,t){var i,n;this.eventService||(this.eventService=new me),this.beans.frameworkOverrides.shouldWrapOutgoing&&!this.frameworkEventListenerService&&(this.eventService.setFrameworkOverrides(this.beans.frameworkOverrides),this.frameworkEventListenerService=new ye(this.beans.frameworkOverrides));const s=null!=(n=null==(i=this.frameworkEventListenerService)?void 0:i.wrap(t))?n:t;this.eventService.addEventListener(e,s)}removeEventListener(e,t){var i,n;if(!this.eventService)return;const s=null!=(n=null==(i=this.frameworkEventListenerService)?void 0:i.unwrap(t))?n:t;this.eventService.removeEventListener(e,s),this.eventService.noRegisteredListenersExist()&&(this.eventService=null)}onMouseEnter(){this.dispatchLocalEvent(this.createLocalRowEvent(e.EVENT_MOUSE_ENTER))}onMouseLeave(){this.dispatchLocalEvent(this.createLocalRowEvent(e.EVENT_MOUSE_LEAVE))}getFirstChildOfFirstChild(e){let t=this,i=!0,n=!1,s=null;for(;i&&!n;){const r=t.parent;b(r)&&t.firstChild?r.rowGroupColumn===e&&(n=!0,s=r):i=!1,t=r}return n?s:null}isFullWidthCell(){if(this.detail)return!0;const e=this.beans.gos.getCallback("isFullWidthRow");return!!e&&e({rowNode:this})}getRoute(){if(null==this.key)return;const e=[];let t=this;for(;null!=t.key;)e.push(t.key),t=t.parent;return e.reverse()}createFooter(){if(this.sibling)return;const t=new Set(["eventService","__objectId","sticky"]),i=new e(this.beans);Object.keys(this).forEach(e=>{t.has(e)||(i[e]=this[e])}),i.footer=!0,i.setRowTop(null),i.setRowIndex(null),i.oldRowTop=null,i.id="rowGroupFooter_"+this.id,i.sibling=this,this.sibling=i}destroyFooter(){this.sibling&&(this.sibling.setRowTop(null),this.sibling.setRowIndex(null),this.sibling=void 0)}};Rr.ID_PREFIX_ROW_GROUP="row-group-",Rr.ID_PREFIX_TOP_PINNED="t-",Rr.ID_PREFIX_BOTTOM_PINNED="b-",Rr.OBJECT_ID_SEQUENCE=0,Rr.EVENT_ROW_SELECTED="rowSelected",Rr.EVENT_DATA_CHANGED="dataChanged",Rr.EVENT_CELL_CHANGED="cellChanged",Rr.EVENT_ALL_CHILDREN_COUNT_CHANGED="allChildrenCountChanged",Rr.EVENT_MASTER_CHANGED="masterChanged",Rr.EVENT_GROUP_CHANGED="groupChanged",Rr.EVENT_MOUSE_ENTER="mouseEnter",Rr.EVENT_MOUSE_LEAVE="mouseLeave",Rr.EVENT_HEIGHT_CHANGED="heightChanged",Rr.EVENT_TOP_CHANGED="topChanged",Rr.EVENT_DISPLAYED_CHANGED="displayedChanged",Rr.EVENT_FIRST_CHILD_CHANGED="firstChildChanged",Rr.EVENT_LAST_CHILD_CHANGED="lastChildChanged",Rr.EVENT_CHILD_INDEX_CHANGED="childIndexChanged",Rr.EVENT_ROW_INDEX_CHANGED="rowIndexChanged",Rr.EVENT_EXPANDED_CHANGED="expandedChanged",Rr.EVENT_HAS_CHILDREN_CHANGED="hasChildrenChanged",Rr.EVENT_SELECTABLE_CHANGED="selectableChanged",Rr.EVENT_UI_LEVEL_CHANGED="uiLevelChanged",Rr.EVENT_HIGHLIGHT_CHANGED="rowHighlightChanged",Rr.EVENT_DRAGGING_CHANGED="draggingChanged";var kr=Rr,Pr=class extends vs{constructor(){super('\n            <div class="ag-selection-checkbox" role="presentation">\n                <ag-checkbox role="presentation" ref="eCheckbox"></ag-checkbox>\n            </div>')}postConstruct(){this.eCheckbox.setPassive(!0)}getCheckboxId(){return this.eCheckbox.getInputElement().id}onDataChanged(){this.onSelectionChanged()}onSelectableChanged(){this.showOrHideSelect()}onSelectionChanged(){const e=this.localeService.getLocaleTextFunc(),t=this.rowNode.isSelected(),i=yi(e,t),[n,s]=this.rowNode.selectable?["ariaRowToggleSelection","Press Space to toggle row selection"]:["ariaRowSelectionDisabled","Row Selection is disabled for this row"],r=e(n,s);this.eCheckbox.setValue(t,!0),this.eCheckbox.setInputAriaLabel(`${r} (${i})`)}onClicked(e,t,i){return this.rowNode.setSelectedParams({newValue:e,rangeSelect:i.shiftKey,groupSelectsFiltered:t,event:i,source:"checkboxSelected"})}init(e){if(this.rowNode=e.rowNode,this.column=e.column,this.overrides=e.overrides,this.onSelectionChanged(),this.addManagedListener(this.eCheckbox.getInputElement(),"dblclick",e=>{qe(e)}),this.addManagedListener(this.eCheckbox.getInputElement(),"click",e=>{qe(e);const t=this.gos.get("groupSelectsFiltered"),i=this.eCheckbox.getValue();this.shouldHandleIndeterminateState(i,t)?0===this.onClicked(!0,t,e||{})&&this.onClicked(!1,t,e):i?this.onClicked(!1,t,e):this.onClicked(!0,t,e||{})}),this.addManagedListener(this.rowNode,kr.EVENT_ROW_SELECTED,this.onSelectionChanged.bind(this)),this.addManagedListener(this.rowNode,kr.EVENT_DATA_CHANGED,this.onDataChanged.bind(this)),this.addManagedListener(this.rowNode,kr.EVENT_SELECTABLE_CHANGED,this.onSelectableChanged.bind(this)),this.gos.get("isRowSelectable")||"function"==typeof this.getIsVisible()){const e=this.showOrHideSelect.bind(this);this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.rowNode,kr.EVENT_DATA_CHANGED,e),this.addManagedListener(this.rowNode,kr.EVENT_CELL_CHANGED,e),this.showOrHideSelect()}this.eCheckbox.getInputElement().setAttribute("tabindex","-1")}shouldHandleIndeterminateState(e,t){return t&&(void 0===this.eCheckbox.getPreviousValue()||void 0===e)&&this.gos.isRowModelType("clientSide")}showOrHideSelect(){var e,t,i;let n=this.rowNode.selectable;const s=this.getIsVisible();if(n)if("function"==typeof s){const t=null==(e=this.overrides)?void 0:e.callbackParams;if(this.column){const e=this.column.createColumnFunctionCallbackParams(this.rowNode);n=s(d(d({},t),e))}else n=s(p(d({},t),{node:this.rowNode,data:this.rowNode.data}))}else n=null!=s&&s;if(null==(t=this.column)?void 0:t.getColDef().showDisabledCheckboxes)return this.eCheckbox.setDisabled(!n),this.setVisible(!0),void this.setDisplayed(!0);(null==(i=this.overrides)?void 0:i.removeHidden)?this.setDisplayed(n):this.setVisible(n)}getIsVisible(){var e,t;return this.overrides?this.overrides.isVisible:null==(t=null==(e=this.column)?void 0:e.getColDef())?void 0:t.checkboxSelection}};f([bs("eCheckbox")],Pr.prototype,"eCheckbox",2),f([le],Pr.prototype,"postConstruct",1);var _r=(e=>(e[e.Left=0]="Left",e[e.Right=1]="Right",e))(_r||{}),Lr=class extends st{constructor(){super(...arguments),this.dragSourceAndParamsList=[],this.dropTargets=[]}init(){this.ePinnedIcon=Yn("columnMovePin",this.gos,null),this.eHideIcon=Yn("columnMoveHide",this.gos,null),this.eMoveIcon=Yn("columnMoveMove",this.gos,null),this.eLeftIcon=Yn("columnMoveLeft",this.gos,null),this.eRightIcon=Yn("columnMoveRight",this.gos,null),this.eGroupIcon=Yn("columnMoveGroup",this.gos,null),this.eAggregateIcon=Yn("columnMoveValue",this.gos,null),this.ePivotIcon=Yn("columnMovePivot",this.gos,null),this.eDropNotAllowedIcon=Yn("dropNotAllowed",this.gos,null)}addDragSource(e,t=!1){const i={eElement:e.eElement,dragStartPixels:e.dragStartPixels,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this),onDragging:this.onDragging.bind(this),includeTouch:t};this.dragSourceAndParamsList.push({params:i,dragSource:e}),this.dragService.addDragSource(i)}removeDragSource(e){const t=this.dragSourceAndParamsList.find(t=>t.dragSource===e);t&&(this.dragService.removeDragSource(t.params),Ne(this.dragSourceAndParamsList,t))}clearDragSourceParamsList(){this.dragSourceAndParamsList.forEach(e=>this.dragService.removeDragSource(e.params)),this.dragSourceAndParamsList.length=0,this.dropTargets.length=0}nudge(){this.dragging&&this.onDragging(this.eventLastTime,!0)}onDragStart(e,t){this.dragging=!0,this.dragSource=e,this.eventLastTime=t,this.dragItem=this.dragSource.getDragItem(),this.lastDropTarget=void 0,this.dragSource.onDragStarted&&this.dragSource.onDragStarted(),this.createGhost()}onDragStop(e){if(this.eventLastTime=null,this.dragging=!1,this.dragSource.onDragStopped&&this.dragSource.onDragStopped(),this.lastDropTarget&&this.lastDropTarget.onDragStop){const t=this.createDropTargetEvent(this.lastDropTarget,e,null,null,!1);this.lastDropTarget.onDragStop(t)}this.lastDropTarget=null,this.dragItem=null,this.removeGhost()}onDragging(e,t){var i,n,s,r;const o=this.getHorizontalDirection(e),a=this.getVerticalDirection(e);this.eventLastTime=e,this.positionGhost(e);const l=this.dropTargets.filter(t=>this.isMouseOnDropTarget(e,t)),c=this.findCurrentDropTarget(e,l);if(c!==this.lastDropTarget)this.leaveLastTargetIfExists(e,o,a,t),null!==this.lastDropTarget&&null===c&&(null==(n=(i=this.dragSource).onGridExit)||n.call(i,this.dragItem)),null===this.lastDropTarget&&null!==c&&(null==(r=(s=this.dragSource).onGridEnter)||r.call(s,this.dragItem)),this.enterDragTargetIfExists(c,e,o,a,t),this.lastDropTarget=c;else if(c&&c.onDragging){const i=this.createDropTargetEvent(c,e,o,a,t);c.onDragging(i)}}getAllContainersFromDropTarget(e){const t=e.getSecondaryContainers?e.getSecondaryContainers():null,i=[[e.getContainer()]];return t?i.concat(t):i}allContainersIntersect(e,t){for(const i of t){const t=i.getBoundingClientRect();if(0===t.width||0===t.height)return!1;const n=e.clientX>=t.left&&e.clientX<t.right,s=e.clientY>=t.top&&e.clientY<t.bottom;if(!n||!s)return!1}return!0}isMouseOnDropTarget(e,t){const i=this.getAllContainersFromDropTarget(t);let n=!1;for(const t of i)if(this.allContainersIntersect(e,t)){n=!0;break}return!(t.targetContainsSource&&!t.getContainer().contains(this.dragSource.eElement))&&n&&t.isInterestedIn(this.dragSource.type,this.dragSource.eElement)}findCurrentDropTarget(e,t){const i=t.length;if(0===i)return null;if(1===i)return t[0];const n=this.gos.getRootNode().elementsFromPoint(e.clientX,e.clientY);for(const e of n)for(const i of t)if(-1!==Ue(this.getAllContainersFromDropTarget(i)).indexOf(e))return i;return null}enterDragTargetIfExists(e,t,i,n,s){if(e){if(e.onDragEnter){const r=this.createDropTargetEvent(e,t,i,n,s);e.onDragEnter(r)}this.setGhostIcon(e.getIconName?e.getIconName():null)}}leaveLastTargetIfExists(e,t,i,n){if(this.lastDropTarget){if(this.lastDropTarget.onDragLeave){const s=this.createDropTargetEvent(this.lastDropTarget,e,t,i,n);this.lastDropTarget.onDragLeave(s)}this.setGhostIcon(null)}}addDropTarget(e){this.dropTargets.push(e)}removeDropTarget(e){this.dropTargets=this.dropTargets.filter(t=>t.getContainer()!==e.getContainer())}hasExternalDropZones(){return this.dropTargets.some(e=>e.external)}findExternalZone(e){return this.dropTargets.filter(e=>e.external).find(t=>t.getContainer()===e.getContainer())||null}getHorizontalDirection(e){const t=this.eventLastTime&&this.eventLastTime.clientX,i=e.clientX;return t===i?null:t>i?0:1}getVerticalDirection(e){const t=this.eventLastTime&&this.eventLastTime.clientY,i=e.clientY;return t===i?null:t>i?0:1}createDropTargetEvent(e,t,i,n,s){const r=e.getContainer(),o=r.getBoundingClientRect(),{gridApi:a,columnApi:l,dragItem:c,dragSource:h}=this;return{event:t,x:t.clientX-o.left,y:t.clientY-o.top,vDirection:n,hDirection:i,dragSource:h,fromNudge:s,dragItem:c,api:a,columnApi:l,dropZoneTarget:r}}positionGhost(e){const t=this.eGhost;if(!t)return;const i=t.getBoundingClientRect().height,n=Oi()-2,s=Fi()-2,r=mn(t.offsetParent),{clientY:o,clientX:a}=e;let l=o-r.top-i/2,c=a-r.left-10;const h=this.gos.getDocument(),u=h.defaultView||window,d=u.pageYOffset||h.documentElement.scrollTop,p=u.pageXOffset||h.documentElement.scrollLeft;n>0&&c+t.clientWidth>n+p&&(c=n+p-t.clientWidth),c<0&&(c=0),s>0&&l+t.clientHeight>s+d&&(l=s+d-t.clientHeight),l<0&&(l=0),t.style.left=`${c}px`,t.style.top=`${l}px`}removeGhost(){this.eGhost&&this.eGhostParent&&this.eGhostParent.removeChild(this.eGhost),this.eGhost=null}createGhost(){this.eGhost=En(Lr.GHOST_TEMPLATE),this.mouseEventService.stampTopLevelGridCompWithGridInstance(this.eGhost);const{theme:e}=this.environment.getTheme();e&&this.eGhost.classList.add(e),this.eGhostIcon=this.eGhost.querySelector(".ag-dnd-ghost-icon"),this.setGhostIcon(null);const t=this.eGhost.querySelector(".ag-dnd-ghost-label");let i=this.dragSource.dragItemName;$(i)&&(i=i()),t.innerHTML=bt(i)||"",this.eGhost.style.height="25px",this.eGhost.style.top="20px",this.eGhost.style.left="20px";const n=this.gos.getDocument();let s=null,r=null;try{s=n.fullscreenElement}catch(e){}finally{s||(s=this.gos.getRootNode());r=s.querySelector("body")||(s instanceof ShadowRoot?s:s instanceof Document?null==s?void 0:s.documentElement:s)}this.eGhostParent=r,this.eGhostParent?this.eGhostParent.appendChild(this.eGhost):console.warn("AG Grid: could not find document body, it is needed for dragging columns")}setGhostIcon(e,t=!1){Cn(this.eGhostIcon);let i=null;switch(e||(e=this.dragSource.getDefaultIconName?this.dragSource.getDefaultIconName():Lr.ICON_NOT_ALLOWED),e){case Lr.ICON_PINNED:i=this.ePinnedIcon;break;case Lr.ICON_MOVE:i=this.eMoveIcon;break;case Lr.ICON_LEFT:i=this.eLeftIcon;break;case Lr.ICON_RIGHT:i=this.eRightIcon;break;case Lr.ICON_GROUP:i=this.eGroupIcon;break;case Lr.ICON_AGGREGATE:i=this.eAggregateIcon;break;case Lr.ICON_PIVOT:i=this.ePivotIcon;break;case Lr.ICON_NOT_ALLOWED:i=this.eDropNotAllowedIcon;break;case Lr.ICON_HIDE:i=this.eHideIcon}this.eGhostIcon.classList.toggle("ag-shake-left-to-right",t),i===this.eHideIcon&&this.gos.get("suppressDragLeaveHidesColumns")||i&&this.eGhostIcon.appendChild(i)}};Lr.ICON_PINNED="pinned",Lr.ICON_MOVE="move",Lr.ICON_LEFT="left",Lr.ICON_RIGHT="right",Lr.ICON_GROUP="group",Lr.ICON_AGGREGATE="aggregate",Lr.ICON_PIVOT="pivot",Lr.ICON_NOT_ALLOWED="notAllowed",Lr.ICON_HIDE="hide",Lr.GHOST_TEMPLATE='<div class="ag-dnd-ghost ag-unselectable">\n            <span class="ag-dnd-ghost-icon ag-shake-left-to-right"></span>\n            <div class="ag-dnd-ghost-label"></div>\n        </div>',f([ue("dragService")],Lr.prototype,"dragService",2),f([ue("mouseEventService")],Lr.prototype,"mouseEventService",2),f([ue("columnApi")],Lr.prototype,"columnApi",2),f([ue("gridApi")],Lr.prototype,"gridApi",2),f([le],Lr.prototype,"init",1),f([ce],Lr.prototype,"clearDragSourceParamsList",1),Lr=f([he("dragAndDropService")],Lr);var Nr=class extends vs{constructor(e,t,i,n,s,r){super(),this.cellValueFn=e,this.rowNode=t,this.column=i,this.customGui=n,this.dragStartPixels=s,this.suppressVisibilityChange=r,this.dragSource=null}isCustomGui(){return null!=this.customGui}postConstruct(){if(this.customGui?this.setDragElement(this.customGui,this.dragStartPixels):(this.setTemplate('<div class="ag-drag-handle ag-row-drag" aria-hidden="true"></div>'),this.getGui().appendChild(qn("rowDrag",this.gos,null)),this.addDragSource()),this.checkCompatibility(),!this.suppressVisibilityChange){const e=this.gos.get("rowDragManaged")?new Gr(this,this.beans,this.rowNode,this.column):new Fr(this,this.beans,this.rowNode,this.column);this.createManagedBean(e,this.beans.context)}}setDragElement(e,t){this.setTemplateFromElement(e),this.addDragSource(t)}getSelectedNodes(){if(!this.gos.get("rowDragMultiRow"))return[this.rowNode];const e=this.beans.selectionService.getSelectedNodes();return-1!==e.indexOf(this.rowNode)?e:[this.rowNode]}checkCompatibility(){const e=this.gos.get("rowDragManaged");this.gos.get("treeData")&&e&&z("If using row drag with tree data, you cannot have rowDragManaged=true")}getDragItem(){return{rowNode:this.rowNode,rowNodes:this.getSelectedNodes(),columns:this.column?[this.column]:void 0,defaultTextValue:this.cellValueFn()}}getRowDragText(e){if(e){const t=e.getColDef();if(t.rowDragText)return t.rowDragText}return this.gos.get("rowDragText")}addDragSource(e=4){this.dragSource&&this.removeDragSource();const t=this.localeService.getLocaleTextFunc();this.dragSource={type:2,eElement:this.getGui(),dragItemName:()=>{var e;const i=this.getDragItem(),n=(null==(e=i.rowNodes)?void 0:e.length)||1,s=this.getRowDragText(this.column);return s?s(i,n):1===n?this.cellValueFn():`${n} ${t("rowDragRows","rows")}`},getDragItem:()=>this.getDragItem(),dragStartPixels:e,dragSourceDomDataKey:this.gos.getDomDataKey()},this.beans.dragAndDropService.addDragSource(this.dragSource,!0)}removeDragSource(){this.dragSource&&this.beans.dragAndDropService.removeDragSource(this.dragSource),this.dragSource=null}};f([ue("beans")],Nr.prototype,"beans",2),f([le],Nr.prototype,"postConstruct",1),f([ce],Nr.prototype,"removeDragSource",1);var Or=class extends st{constructor(e,t,i){super(),this.parent=e,this.rowNode=t,this.column=i}setDisplayedOrVisible(e){const t={skipAriaHidden:!0};if(e)this.parent.setDisplayed(!1,t);else{let e=!0,i=!1;this.column&&(e=this.column.isRowDrag(this.rowNode)||this.parent.isCustomGui(),i=$(this.column.getColDef().rowDrag)),i?(this.parent.setDisplayed(!0,t),this.parent.setVisible(e,t)):(this.parent.setDisplayed(e,t),this.parent.setVisible(!0,t))}}},Fr=class extends Or{constructor(e,t,i,n){super(e,i,n),this.beans=t}postConstruct(){this.addManagedPropertyListener("suppressRowDrag",this.onSuppressRowDrag.bind(this)),this.addManagedListener(this.rowNode,kr.EVENT_DATA_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,kr.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,kr.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,ct.EVENT_NEW_COLUMNS_LOADED,this.workOutVisibility.bind(this)),this.workOutVisibility()}onSuppressRowDrag(){this.workOutVisibility()}workOutVisibility(){const e=this.gos.get("suppressRowDrag");this.setDisplayedOrVisible(e)}};f([le],Fr.prototype,"postConstruct",1);var Gr=class extends Or{constructor(e,t,i,n){super(e,i,n),this.beans=t}postConstruct(){this.addManagedListener(this.beans.eventService,ct.EVENT_SORT_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,ct.EVENT_FILTER_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,ct.EVENT_COLUMN_ROW_GROUP_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,ct.EVENT_NEW_COLUMNS_LOADED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,kr.EVENT_DATA_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,kr.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(),i=this.gos.get("suppressRowDrag"),n=this.beans.dragAndDropService.hasExternalDropZones(),s=t&&!n||i;this.setDisplayedOrVisible(s)}};f([le],Gr.prototype,"postConstruct",1);var Br=class extends st{init(e,t,i,n,s,r,o){var a,l,c,h;this.params=o,this.eGui=t,this.eCheckbox=i,this.eExpanded=n,this.eContracted=s,this.comp=e,this.compClass=r;const{node:u,value:d,colDef:p}=o,g=this.isTopLevelFooter();if(!g){if(this.isEmbeddedRowMismatch())return;if(u.footer&&this.gos.get("groupHideOpenParents")&&(p&&p.showRowGroup)!==(u.rowGroupColumn&&u.rowGroupColumn.getColId()))return}if(this.setupShowingValueForOpenedParent(),this.findDisplayedGroupNode(),!g){const e=o.node.footer&&o.node.rowGroupIndex===this.columnModel.getRowGroupColumns().findIndex(e=>{var t;return e.getColId()===(null==(t=o.colDef)?void 0:t.showRowGroup)}),t="multipleColumns"!=this.gos.get("groupDisplayType")||this.gos.get("treeData")||this.gos.get("showOpenedGroup")&&!o.node.footer&&(!o.node.group||null!=o.node.rowGroupIndex&&o.node.rowGroupIndex>this.columnModel.getRowGroupColumns().findIndex(e=>{var t;return e.getColId()===(null==(t=o.colDef)?void 0:t.showRowGroup)})),i=!u.group&&((null==(a=this.params.colDef)?void 0:a.field)||(null==(l=this.params.colDef)?void 0:l.valueGetter)),n=this.isExpandable(),s=this.columnModel.isPivotMode()&&u.leafGroup&&(null==(c=u.rowGroupColumn)?void 0:c.getColId())===(null==(h=o.column)?void 0:h.getColDef().showRowGroup);if(!(this.showingValueForOpenedParent||n||i||t||e||s))return}this.addExpandAndContract(),this.addFullWidthRowDraggerIfNeeded(),this.addCheckboxIfNeeded(),this.addValueElement(),this.setupIndent(),this.refreshAriaExpanded()}getCellAriaRole(){var e,t;const i=null==(e=this.params.colDef)?void 0:e.cellAriaRole,n=null==(t=this.params.column)?void 0:t.getColDef().cellAriaRole;return i||n||"gridcell"}destroy(){super.destroy(),this.expandListener=null}refreshAriaExpanded(){const{node:e,eGridCell:t}=this.params;if(this.expandListener&&(this.expandListener=this.expandListener()),!this.isExpandable())return void ni(t);const i=()=>{ii(t,!!e.expanded)};this.expandListener=this.addManagedListener(e,kr.EVENT_EXPANDED_CHANGED,i)||null,i()}isTopLevelFooter(){if(!this.gos.getGrandTotalRow())return!1;if(null!=this.params.value||-1!=this.params.node.level)return!1;const e=this.params.colDef;if(null==e)return!0;if(!0===e.showRowGroup)return!0;const t=this.columnModel.getRowGroupColumns();return!t||0===t.length||t[0].getId()===e.showRowGroup}isEmbeddedRowMismatch(){if(!this.params.fullWidth||!this.gos.get("embedFullWidthRows"))return!1;const e="left"===this.params.pinned,t="right"===this.params.pinned,i=!e&&!t;return this.gos.get("enableRtl")?this.columnModel.isPinningLeft()?!t:!i:this.columnModel.isPinningLeft()?!e:!i}findDisplayedGroupNode(){const e=this.params.column,t=this.params.node;if(this.showingValueForOpenedParent){let i=t.parent;for(;null!=i;){if(i.rowGroupColumn&&e.isRowGroupDisplayed(i.rowGroupColumn.getId())){this.displayedGroupNode=i;break}i=i.parent}}C(this.displayedGroupNode)&&(this.displayedGroupNode=t)}setupShowingValueForOpenedParent(){const e=this.params.node,t=this.params.column;if(!this.gos.get("groupHideOpenParents"))return void(this.showingValueForOpenedParent=!1);if(!e.groupData)return void(this.showingValueForOpenedParent=!1);if(null!=e.rowGroupColumn){const i=e.rowGroupColumn.getId();if(t.isRowGroupDisplayed(i))return void(this.showingValueForOpenedParent=!1)}const i=null!=e.groupData[t.getId()];this.showingValueForOpenedParent=i}addValueElement(){this.displayedGroupNode.footer?this.addFooterValue():(this.addGroupValue(),this.addChildCount())}addGroupValue(){var e;const t=this.adjustParamsWithDetailsFromRelatedColumn(),i=this.getInnerCompDetails(t),{valueFormatted:n,value:s}=t;let r=n;if(null==r){const t=this.displayedGroupNode.rowGroupColumn&&(null==(e=this.params.column)?void 0:e.isRowGroupDisplayed(this.displayedGroupNode.rowGroupColumn.getId()));r=""===this.displayedGroupNode.key&&this.displayedGroupNode.group&&t?this.localeService.getLocaleTextFunc()("blanks","(Blanks)"):null!=s?s:null}this.comp.setInnerRenderer(i,r)}adjustParamsWithDetailsFromRelatedColumn(){const e=this.displayedGroupNode.rowGroupColumn,t=this.params.column;if(!e)return this.params;if(null!=t&&!t.isRowGroupDisplayed(e.getId()))return this.params;const i=this.params,{value:n,node:s}=this.params,r=this.valueService.formatValue(e,s,n);return p(d({},i),{valueFormatted:r})}addFooterValue(){let e=this.params.totalValueGetter;if(!e){const t=this.params.footerValueGetter;t&&(e=t,z("As of v31.3, footerValueGetter is deprecated. Use `totalValueGetter` instead."))}let t="";if(e){const i=_(this.params);i.value=this.params.value,"function"==typeof e?t=e(i):"string"==typeof e?t=this.expressionService.evaluate(e,i):console.warn("AG Grid: footerValueGetter should be either a function or a string (expression)")}else t=this.localeService.getLocaleTextFunc()("footerTotal","Total")+" "+(null!=this.params.value?this.params.value:"");const i=this.getInnerCompDetails(this.params);this.comp.setInnerRenderer(i,t)}getInnerCompDetails(e){if(e.fullWidth)return this.userComponentFactory.getFullWidthGroupRowInnerCellRenderer(this.gos.get("groupRowRendererParams"),e);const t=this.userComponentFactory.getInnerRendererDetails(e,e),i=e=>e&&e.componentClass==this.compClass;if(t&&!i(t))return t;const n=this.displayedGroupNode.rowGroupColumn,s=n?n.getColDef():void 0;if(!s)return;const r=this.userComponentFactory.getCellRendererDetails(s,e);return r&&!i(r)?r:i(r)&&s.cellRendererParams&&s.cellRendererParams.innerRenderer?this.userComponentFactory.getInnerRendererDetails(s.cellRendererParams,e):void 0}addChildCount(){this.params.suppressCount||(this.addManagedListener(this.displayedGroupNode,kr.EVENT_ALL_CHILDREN_COUNT_CHANGED,this.updateChildCount.bind(this)),this.updateChildCount())}updateChildCount(){const e=this.displayedGroupNode.allChildrenCount,t=this.isShowRowGroupForThisRow()&&null!=e&&e>=0?`(${e})`:"";this.comp.setChildCount(t)}isShowRowGroupForThisRow(){if(this.gos.get("treeData"))return!0;const e=this.displayedGroupNode.rowGroupColumn;if(!e)return!1;const t=this.params.column;return null==t||t.isRowGroupDisplayed(e.getId())}addExpandAndContract(){var e;const t=this.params,i=qn("groupExpanded",this.gos,null),n=qn("groupContracted",this.gos,null);i&&this.eExpanded.appendChild(i),n&&this.eContracted.appendChild(n);const s=t.eGridCell;(null==(e=this.params.column)?void 0:e.isCellEditable(t.node))&&this.gos.get("enableGroupEdit")||!this.isExpandable()||t.suppressDoubleClickExpand||this.addManagedListener(s,"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(s,"keydown",this.onKeyDown.bind(this)),this.addManagedListener(t.node,kr.EVENT_EXPANDED_CHANGED,this.showExpandAndContractIcons.bind(this)),this.showExpandAndContractIcons();const r=this.onRowNodeIsExpandableChanged.bind(this);this.addManagedListener(this.displayedGroupNode,kr.EVENT_ALL_CHILDREN_COUNT_CHANGED,r),this.addManagedListener(this.displayedGroupNode,kr.EVENT_MASTER_CHANGED,r),this.addManagedListener(this.displayedGroupNode,kr.EVENT_GROUP_CHANGED,r),this.addManagedListener(this.displayedGroupNode,kr.EVENT_HAS_CHILDREN_CHANGED,r)}onExpandClicked(e){Xe(e)||(qe(e),this.onExpandOrContract(e))}onExpandOrContract(e){const t=this.displayedGroupNode,i=!t.expanded;!i&&t.sticky&&this.scrollToStickyNode(t),t.setExpanded(i,e)}scrollToStickyNode(e){this.ctrlsService.getGridBodyCtrl().getScrollFeature().setVerticalScrollPosition(e.rowTop-e.stickyRowTop)}isExpandable(){if(this.showingValueForOpenedParent)return!0;const e=this.displayedGroupNode,t=this.columnModel.isPivotMode()&&e.leafGroup;if(!e.isExpandable()||e.footer||t)return!1;const i=this.params.column;return null==i||"string"!=typeof i.getColDef().showRowGroup||this.isShowRowGroupForThisRow()}showExpandAndContractIcons(){const{params:e,displayedGroupNode:t,columnModel:i}=this,{node:n}=e,s=this.isExpandable();if(s){const e=!!this.showingValueForOpenedParent||n.expanded;this.comp.setExpandedDisplayed(e),this.comp.setContractedDisplayed(!e)}else this.comp.setExpandedDisplayed(!1),this.comp.setContractedDisplayed(!1);const r=i.isPivotMode(),o=r&&t.leafGroup,a=s&&!o,l=n.footer&&-1===n.level;this.comp.addOrRemoveCssClass("ag-cell-expandable",a),this.comp.addOrRemoveCssClass("ag-row-group",a),r?this.comp.addOrRemoveCssClass("ag-pivot-leaf-group",o):l||this.comp.addOrRemoveCssClass("ag-row-group-leaf-indent",!a)}onRowNodeIsExpandableChanged(){this.showExpandAndContractIcons(),this.setIndent(),this.refreshAriaExpanded()}setupIndent(){const e=this.params.node;this.params.suppressPadding||(this.addManagedListener(e,kr.EVENT_UI_LEVEL_CHANGED,this.setIndent.bind(this)),this.setIndent())}setIndent(){if(this.gos.get("groupHideOpenParents"))return;const e=this.params,t=e.node,i=!!e.colDef,n=this.gos.get("treeData"),s=!i||n||!0===e.colDef.showRowGroup?t.uiLevel:0;this.indentClass&&this.comp.addOrRemoveCssClass(this.indentClass,!1),this.indentClass="ag-row-group-indent-"+s,this.comp.addOrRemoveCssClass(this.indentClass,!0)}addFullWidthRowDraggerIfNeeded(){if(!this.params.fullWidth||!this.params.rowDrag)return;const e=new Nr(()=>this.params.value,this.params.node);this.createManagedBean(e,this.context),this.eGui.insertAdjacentElement("afterbegin",e.getGui())}isUserWantsSelected(){const e=this.params.checkbox;return"function"==typeof e||!0===e}addCheckboxIfNeeded(){const e=this.displayedGroupNode,t=this.isUserWantsSelected()&&!e.footer&&!e.rowPinned&&!e.detail;if(t){const e=new Pr;this.getContext().createBean(e),e.init({rowNode:this.params.node,column:this.params.column,overrides:{isVisible:this.params.checkbox,callbackParams:this.params,removeHidden:!0}}),this.eCheckbox.appendChild(e.getGui()),this.addDestroyFunc(()=>this.getContext().destroyBean(e))}this.comp.setCheckboxVisible(t)}onKeyDown(e){e.key!==Zn.ENTER||this.params.suppressEnterExpand||this.params.column&&this.params.column.isCellEditable(this.params.node)||this.onExpandOrContract(e)}onCellDblClicked(e){Xe(e)||Je(this.eExpanded,e)||Je(this.eContracted,e)||this.onExpandOrContract(e)}};f([ue("expressionService")],Br.prototype,"expressionService",2),f([ue("valueService")],Br.prototype,"valueService",2),f([ue("columnModel")],Br.prototype,"columnModel",2),f([ue("userComponentFactory")],Br.prototype,"userComponentFactory",2),f([ue("ctrlsService")],Br.prototype,"ctrlsService",2);var Vr=class e extends vs{constructor(){super(e.TEMPLATE)}init(e){const t={setInnerRenderer:(e,t)=>this.setRenderDetails(e,t),setChildCount:e=>this.eChildCount.textContent=e,addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setContractedDisplayed:e=>an(this.eContracted,e),setExpandedDisplayed:e=>an(this.eExpanded,e),setCheckboxVisible:e=>this.eCheckbox.classList.toggle("ag-invisible",!e)},i=this.createManagedBean(new Br),n=!e.colDef,s=this.getGui();i.init(t,s,this.eCheckbox,this.eExpanded,this.eContracted,this.constructor,e),n&&Ht(s,i.getCellAriaRole())}setRenderDetails(e,t){if(e){const t=e.newAgStackInstance();if(!t)return;t.then(e=>{if(!e)return;const t=()=>this.context.destroyBean(e);this.isAlive()?(this.eValue.appendChild(e.getGui()),this.addDestroyFunc(t)):t()})}else this.eValue.innerText=t}destroy(){this.getContext().destroyBean(this.innerCellRenderer),super.destroy()}refresh(){return!1}};Vr.TEMPLATE='<span class="ag-cell-wrapper">\n            <span class="ag-group-expanded" ref="eExpanded"></span>\n            <span class="ag-group-contracted" ref="eContracted"></span>\n            <span class="ag-group-checkbox ag-invisible" ref="eCheckbox"></span>\n            <span class="ag-group-value" ref="eValue"></span>\n            <span class="ag-group-child-count" ref="eChildCount"></span>\n        </span>',f([bs("eExpanded")],Vr.prototype,"eExpanded",2),f([bs("eContracted")],Vr.prototype,"eContracted",2),f([bs("eCheckbox")],Vr.prototype,"eCheckbox",2),f([bs("eValue")],Vr.prototype,"eValue",2),f([bs("eChildCount")],Vr.prototype,"eChildCount",2);var Hr=Vr,Ur=class e extends vs{constructor(){super(e.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=qn("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()}};Ur.TEMPLATE='<div class="ag-loading">\n            <span class="ag-loading-icon" ref="eLoadingIcon"></span>\n            <span class="ag-loading-text" ref="eLoadingText"></span>\n        </div>',f([bs("eLoadingIcon")],Ur.prototype,"eLoadingIcon",2),f([bs("eLoadingText")],Ur.prototype,"eLoadingText",2);var zr=Ur,Wr=class e extends vs{constructor(){super(e.TEMPLATE)}init(e){const t=`ag-cell-skeleton-renderer-${this.getCompId()}`;this.getGui().setAttribute("id",t),this.addDestroyFunc(()=>Kt(e.eParentOfValue)),Kt(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");$t(this.getGui(),t)}setupLoading(){const e=this.gos.getDocument().createElement("div");e.classList.add("ag-skeleton-effect"),this.getGui().appendChild(e);const t=this.localeService.getLocaleTextFunc()("ariaSkeletonCellLoading","Row data is loading");$t(this.getGui(),t)}refresh(e){return!1}destroy(){super.destroy()}};Wr.TEMPLATE='<div class="ag-skeleton-container"></div>';var jr=Wr,$r=class e extends vs{constructor(){super()}destroy(){super.destroy()}init(t){const i=this.gos.get("overlayLoadingTemplate");if(this.setTemplate(null!=i?i:e.DEFAULT_LOADING_OVERLAY_TEMPLATE),!i){const e=this.localeService.getLocaleTextFunc();setTimeout(()=>{this.getGui().textContent=e("loadingOoo","Loading...")})}}};$r.DEFAULT_LOADING_OVERLAY_TEMPLATE='<span aria-live="polite" aria-atomic="true" class="ag-overlay-loading-center"></span>';var Kr=$r,Yr=class e extends vs{constructor(){super()}destroy(){super.destroy()}init(t){const i=this.gos.get("overlayNoRowsTemplate");if(this.setTemplate(null!=i?i:e.DEFAULT_NO_ROWS_TEMPLATE),!i){const e=this.localeService.getLocaleTextFunc();setTimeout(()=>{this.getGui().textContent=e("noRowsToShow","No Rows To Show")})}}};Yr.DEFAULT_NO_ROWS_TEMPLATE='<span class="ag-overlay-no-rows-center"></span>';var qr=Yr,Xr=class extends wr{constructor(){super('<div class="ag-tooltip"></div>')}init(e){const{value:t}=e;this.getGui().textContent=bt(t,!0)}},Zr=class{getTemplate(){return'<ag-input-number-field class="ag-cell-editor" ref="eInput"></ag-input-number-field>'}init(e,t){this.eInput=e,this.params=t,null!=t.max&&e.setMax(t.max),null!=t.min&&e.setMin(t.min),null!=t.precision&&e.setPrecision(t.precision),null!=t.step&&e.setStep(t.step);const i=e.getInputElement();t.preventStepping?e.addManagedListener(i,"keydown",this.preventStepping):t.showStepperButtons&&i.classList.add("ag-number-field-input-stepper")}preventStepping(e){e.key!==Zn.UP&&e.key!==Zn.DOWN||e.preventDefault()}getValue(){const e=this.eInput.getValue();if(!b(e)&&!b(this.params.value))return this.params.value;let t=this.params.parseValue(e);if(null==t)return t;if("string"==typeof t){if(""===t)return null;t=Number(t)}return isNaN(t)?null:t}getStartValue(){return this.params.value}},Qr=class extends Ar{constructor(){super(new Zr)}},Jr=class{getTemplate(){return'<ag-input-date-field class="ag-cell-editor" ref="eInput"></ag-input-date-field>'}init(e,t){this.eInput=e,this.params=t,null!=t.min&&e.setMin(t.min),null!=t.max&&e.setMax(t.max),null!=t.step&&e.setStep(t.step)}getValue(){const e=this.eInput.getDate();return b(e)||b(this.params.value)?null!=e?e:null:this.params.value}getStartValue(){const{value:e}=this.params;if(e instanceof Date)return Xi(e,!1)}},eo=class extends Ar{constructor(){super(new Jr)}},to=class{constructor(e){this.getDataTypeService=e}getTemplate(){return'<ag-input-date-field class="ag-cell-editor" ref="eInput"></ag-input-date-field>'}init(e,t){this.eInput=e,this.params=t,null!=t.min&&e.setMin(t.min),null!=t.max&&e.setMax(t.max),null!=t.step&&e.setStep(t.step)}getValue(){const e=this.formatDate(this.eInput.getDate());return b(e)||b(this.params.value)?this.params.parseValue(null!=e?e:""):this.params.value}getStartValue(){var e,t;return Xi(null!=(t=this.parseDate(null!=(e=this.params.value)?e:void 0))?t:null,!1)}parseDate(e){return this.getDataTypeService().getDateParserFunction(this.params.column)(e)}formatDate(e){return this.getDataTypeService().getDateFormatterFunction(this.params.column)(e)}},io=class extends Ar{constructor(){super(new to(()=>this.dataTypeService))}};f([ue("dataTypeService")],io.prototype,"dataTypeService",2);var no=class e extends vs{constructor(){super(e.TEMPLATE)}init(e){this.params=e,this.updateCheckbox(e);const t=this.eCheckbox.getInputElement();t.setAttribute("tabindex","-1"),qt(t,"polite"),this.addManagedListener(t,"click",e=>{if(qe(e),this.eCheckbox.isDisabled())return;const t=this.eCheckbox.getValue();this.onCheckboxChanged(t)}),this.addManagedListener(t,"dblclick",e=>{qe(e)}),this.addManagedListener(this.params.eGridCell,"keydown",e=>{if(e.key===Zn.SPACE&&!this.eCheckbox.isDisabled()){this.params.eGridCell===this.gos.getActiveDomElement()&&this.eCheckbox.toggle();const t=this.eCheckbox.getValue();this.onCheckboxChanged(t),e.preventDefault()}})}refresh(e){return this.params=e,this.updateCheckbox(e),!0}updateCheckbox(e){var t,i,n;let s,r=!0;if(e.node.group&&e.column){const i=e.column.getColId();i.startsWith(dt)?s=null==e.value||""===e.value?void 0:"true"===e.value:e.node.aggData&&void 0!==e.node.aggData[i]?s=null!=(t=e.value)?t:void 0:r=!1}else s=null!=(i=e.value)?i:void 0;if(!r)return void this.eCheckbox.setDisplayed(!1);this.eCheckbox.setValue(s);const o=null!=e.disabled?e.disabled:!(null==(n=e.column)?void 0:n.isCellEditable(e.node));this.eCheckbox.setDisabled(o);const a=this.localeService.getLocaleTextFunc(),l=yi(a,s),c=o?l:`${a("ariaToggleCellValue","Press SPACE to toggle cell value")} (${l})`;this.eCheckbox.setInputAriaLabel(c)}onCheckboxChanged(e){const{column:t,node:i,rowIndex:n,value:s}=this.params,r={type:ct.EVENT_CELL_EDITING_STARTED,column:t,colDef:null==t?void 0:t.getColDef(),data:i.data,node:i,rowIndex:n,rowPinned:i.rowPinned,value:s};this.eventService.dispatchEvent(r);const o=this.params.node.setDataValue(this.params.column,e,"edit"),a={type:ct.EVENT_CELL_EDITING_STOPPED,column:t,colDef:null==t?void 0:t.getColDef(),data:i.data,node:i,rowIndex:n,rowPinned:i.rowPinned,value:s,oldValue:s,newValue:e,valueChanged:o};this.eventService.dispatchEvent(a)}};no.TEMPLATE='\n        <div class="ag-cell-wrapper ag-checkbox-cell" role="presentation">\n            <ag-checkbox role="presentation" ref="eCheckbox"></ag-checkbox>\n        </div>',f([bs("eCheckbox")],no.prototype,"eCheckbox",2);var so=no,ro=class extends wr{constructor(){super('\n            <div class="ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit">\n                <ag-checkbox role="presentation" ref="eCheckbox"></ag-checkbox>\n            </div>')}init(e){var t;this.params=e;const i=null!=(t=e.value)?t:void 0;this.eCheckbox.setValue(i),this.eCheckbox.getInputElement().setAttribute("tabindex","-1"),this.setAriaLabel(i),this.addManagedListener(this.eCheckbox,ct.EVENT_FIELD_VALUE_CHANGED,e=>this.setAriaLabel(e.selected))}getValue(){return this.eCheckbox.getValue()}focusIn(){this.eCheckbox.getFocusableElement().focus()}afterGuiAttached(){this.params.cellStartedEdit&&this.focusIn()}isPopup(){return!1}setAriaLabel(e){const t=this.localeService.getLocaleTextFunc(),i=yi(t,e),n=t("ariaToggleCellValue","Press SPACE to toggle cell value");this.eCheckbox.setInputAriaLabel(`${n} (${i})`)}};f([bs("eCheckbox")],ro.prototype,"eCheckbox",2);var oo=class extends vs{constructor(){super(),this.setTemplate("<div></div>")}init(e){var t;this.params=e,this.cssClassPrefix=null!=(t=this.params.cssClassPrefix)?t:"ag-menu-option",this.addIcon(),this.addName(),this.addShortcut(),this.addSubMenu()}configureDefaults(){return!0}addIcon(){if(this.params.isCompact)return;const e=En(`<span ref="eIcon" class="${this.getClassName("part")} ${this.getClassName("icon")}" role="presentation"></span>`);this.params.checked?e.appendChild(qn("check",this.gos)):this.params.icon&&(On(this.params.icon)?e.appendChild(this.params.icon):"string"==typeof this.params.icon?e.innerHTML=this.params.icon:console.warn("AG Grid: menu item icon must be DOM node or string")),this.getGui().appendChild(e)}addName(){const e=En(`<span ref="eName" class="${this.getClassName("part")} ${this.getClassName("text")}">${this.params.name||""}</span>`);this.getGui().appendChild(e)}addShortcut(){if(this.params.isCompact)return;const e=En(`<span ref="eShortcut" class="${this.getClassName("part")} ${this.getClassName("shortcut")}">${this.params.shortcut||""}</span>`);this.getGui().appendChild(e)}addSubMenu(){const e=En(`<span ref="ePopupPointer" class="${this.getClassName("part")} ${this.getClassName("popup-pointer")}"></span>`),t=this.getGui();if(this.params.subMenu){const i=this.gos.get("enableRtl")?"smallLeft":"smallRight";ii(t,!1),e.appendChild(qn(i,this.gos))}t.appendChild(e)}getClassName(e){return`${this.cssClassPrefix}-${e}`}destroy(){super.destroy()}},ao=class extends st{constructor(){super(...arguments),this.agGridDefaults={agDateInput:Qs,agColumnHeader:vr,agColumnGroupHeader:Cr,agSortIndicator:mr,agTextColumnFloatingFilter:dr,agNumberColumnFloatingFilter:ur,agDateColumnFloatingFilter:Zs,agReadOnlyFloatingFilter:ws,agAnimateShowChangeCellRenderer:Dr,agAnimateSlideCellRenderer:Ir,agGroupCellRenderer:Hr,agGroupRowRenderer:Hr,agLoadingCellRenderer:zr,agSkeletonCellRenderer:jr,agCheckboxCellRenderer:so,agCellEditor:Tr,agTextCellEditor:Tr,agNumberCellEditor:Qr,agDateCellEditor:eo,agDateStringCellEditor:io,agSelectCellEditor:Er,agLargeTextCellEditor:xr,agCheckboxCellEditor:ro,agTextColumnFilter:ar,agNumberColumnFilter:sr,agDateColumnFilter:qs,agLoadingOverlay:Kr,agNoRowsOverlay:qr,agTooltipComponent:Xr,agMenuItem:oo},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 e=this.gos.get("components");null!=e&&P(e,(e,t)=>this.registerJsComponent(e,t))}registerDefaultComponent(e,t){this.agGridDefaults[e]?console.error("Trying to overwrite a default component. You should call registerComponent"):this.agGridDefaults[e]=t}registerJsComponent(e,t){this.jsComps[e]=t}retrieve(e,t){const i=(e,t)=>({componentFromFramework:t,component:e}),n=this.getFrameworkOverrides().frameworkComponent(t,this.gos.get("components"));if(null!=n)return i(n,!0);const s=this.jsComps[t];if(s)return i(s,this.getFrameworkOverrides().isFrameworkComponent(s));const r=this.agGridDefaults[t];if(r)return i(r,!1);const o=this.enterpriseAgDefaultCompsModule[t];return o?re.__assertRegistered(o,`AG Grid '${e}' component: ${t}`,this.context.getGridId()):U(()=>{this.warnAboutMissingComponent(e,t)},"MissingComp"+t),null}warnAboutMissingComponent(e,t){const i=Wn(t,[...Object.keys(this.agGridDefaults).filter(e=>!["agCellEditor","agGroupRowRenderer","agSortIndicator"].includes(e)),...Object.keys(this.jsComps)],!0,.8).values;console.warn(`AG Grid: Could not find '${t}' component. It was configured as "${e}: '${t}'" but it wasn't found in the list of registered components.`),i.length>0&&console.warn(`         Did you mean: [${i.slice(0,3)}]?`),console.warn(`If using a custom component check it has been registered as described in: ${this.getFrameworkOverrides().getDocLink("components/")}`)}};f([le],ao.prototype,"init",1),ao=f([he("userComponentRegistry")],ao);var lo={propertyName:"dateComponent",cellRenderer:!1},co={propertyName:"headerComponent",cellRenderer:!1},ho={propertyName:"headerGroupComponent",cellRenderer:!1},uo={propertyName:"cellRenderer",cellRenderer:!0},po={propertyName:"loadingCellRenderer",cellRenderer:!0},go={propertyName:"cellEditor",cellRenderer:!1},fo={propertyName:"innerRenderer",cellRenderer:!0},mo={propertyName:"loadingOverlayComponent",cellRenderer:!1},yo={propertyName:"noRowsOverlayComponent",cellRenderer:!1},vo={propertyName:"tooltipComponent",cellRenderer:!1},bo={propertyName:"filter",cellRenderer:!1},Co={propertyName:"floatingFilterComponent",cellRenderer:!1},wo={propertyName:"toolPanel",cellRenderer:!1},So={propertyName:"statusPanel",cellRenderer:!1},xo={propertyName:"fullWidthCellRenderer",cellRenderer:!0},Eo={propertyName:"loadingCellRenderer",cellRenderer:!0},Ao={propertyName:"groupRowRenderer",cellRenderer:!0},Mo={propertyName:"detailCellRenderer",cellRenderer:!0},To={propertyName:"menuItem",cellRenderer:!1},Do=class{static getFloatingFilterType(e){return this.filterToFloatingFilterMapping[e]}};Do.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 Io=class extends st{getHeaderCompDetails(e,t){return this.getCompDetails(e,co,"agColumnHeader",t)}getHeaderGroupCompDetails(e){const t=e.columnGroup.getColGroupDef();return this.getCompDetails(t,ho,"agColumnGroupHeader",e)}getFullWidthCellRendererDetails(e){return this.getCompDetails(this.gridOptions,xo,null,e,!0)}getFullWidthLoadingCellRendererDetails(e){return this.getCompDetails(this.gridOptions,Eo,"agLoadingCellRenderer",e,!0)}getFullWidthGroupCellRendererDetails(e){return this.getCompDetails(this.gridOptions,Ao,"agGroupRowRenderer",e,!0)}getFullWidthDetailCellRendererDetails(e){return this.getCompDetails(this.gridOptions,Mo,"agDetailCellRenderer",e,!0)}getInnerRendererDetails(e,t){return this.getCompDetails(e,fo,null,t)}getFullWidthGroupRowInnerCellRenderer(e,t){return this.getCompDetails(e,fo,null,t)}getCellRendererDetails(e,t){return this.getCompDetails(e,uo,null,t)}getLoadingCellRendererDetails(e,t){return this.getCompDetails(e,po,"agSkeletonCellRenderer",t,!0)}getCellEditorDetails(e,t){return this.getCompDetails(e,go,"agCellEditor",t,!0)}getFilterDetails(e,t,i){return this.getCompDetails(e,bo,i,t,!0)}getDateCompDetails(e){return this.getCompDetails(this.gridOptions,lo,"agDateInput",e,!0)}getLoadingOverlayCompDetails(e){return this.getCompDetails(this.gridOptions,mo,"agLoadingOverlay",e,!0)}getNoRowsOverlayCompDetails(e){return this.getCompDetails(this.gridOptions,yo,"agNoRowsOverlay",e,!0)}getTooltipCompDetails(e){return this.getCompDetails(e.colDef,vo,"agTooltipComponent",e,!0)}getSetFilterCellRendererDetails(e,t){return this.getCompDetails(e,uo,null,t)}getFloatingFilterCompDetails(e,t,i){return this.getCompDetails(e,Co,i,t)}getToolPanelCompDetails(e,t){return this.getCompDetails(e,wo,null,t,!0)}getStatusPanelCompDetails(e,t){return this.getCompDetails(e,So,null,t,!0)}getMenuItemCompDetails(e,t){return this.getCompDetails(e,To,"agMenuItem",t,!0)}getCompDetails(e,t,i,n,s=!1){const{propertyName:r,cellRenderer:o}=t;let{compName:a,jsComp:l,fwComp:c,paramsFromSelector:h,popupFromSelector:u,popupPositionFromSelector:d}=this.getCompKeys(e,t,n);const p=e=>{const t=this.userComponentRegistry.retrieve(r,e);t&&(l=t.componentFromFramework?void 0:t.component,c=t.componentFromFramework?t.component:void 0)};if(null!=a&&p(a),null==l&&null==c&&null!=i&&p(i),l&&o&&!this.agComponentUtils.doesImplementIComponent(l)&&(l=this.agComponentUtils.adaptFunction(r,l)),!l&&!c)return void(s&&console.error(`AG Grid: Could not find component ${a}, did you forget to configure this component?`));const g=this.mergeParamsWithApplicationProvidedParams(e,t,n,h),f=null==l,m=l||c;return{componentFromFramework:f,componentClass:m,params:g,type:t,popupFromSelector:u,popupPositionFromSelector:d,newAgStackInstance:()=>this.newAgStackInstance(m,f,g,t)}}getCompKeys(e,t,i){const{propertyName:n}=t;let s,r,o,a,l,c;if(e){const t=e,h=t[n+"Selector"],u=h?h(i):null,d=e=>{"string"==typeof e?s=e:null!=e&&!0!==e&&(this.getFrameworkOverrides().isFrameworkComponent(e)?o=e:r=e)};u?(d(u.component),a=u.params,l=u.popup,c=u.popupPosition):d(t[n])}return{compName:s,jsComp:r,fwComp:o,paramsFromSelector:a,popupFromSelector:l,popupPositionFromSelector:c}}newAgStackInstance(e,t,i,n){const s=n.propertyName;let r;if(t){const t=this.componentMetadataProvider.retrieve(s);r=this.frameworkComponentWrapper.wrap(e,t.mandatoryMethodList,t.optionalMethodList,n)}else r=new e;const o=this.initComponent(r,i);return null==o?us.resolve(r):o.then(()=>r)}mergeParamsWithApplicationProvidedParams(e,t,i,n=null){const s=this.gos.getGridCommonParams();O(s,i);const r=e&&e[t.propertyName+"Params"];return"function"==typeof r?O(s,r(i)):"object"==typeof r&&O(s,r),O(s,n),s}initComponent(e,t){if(this.context.createBean(e),null!=e.init)return e.init(t)}getDefaultFloatingFilterType(e,t){if(null==e)return null;let i=null,{compName:n,jsComp:s,fwComp:r}=this.getCompKeys(e,bo);return n?i=Do.getFloatingFilterType(n):null==s&&null==r&&!0===e.filter&&(i=t()),i}};f([ue("gridOptions")],Io.prototype,"gridOptions",2),f([ue("agComponentUtils")],Io.prototype,"agComponentUtils",2),f([ue("componentMetadataProvider")],Io.prototype,"componentMetadataProvider",2),f([ue("userComponentRegistry")],Io.prototype,"userComponentRegistry",2),f([de("frameworkComponentWrapper")],Io.prototype,"frameworkComponentWrapper",2),Io=f([he("userComponentFactory")],Io);var Ro=class{constructor(e){this.tickingInterval=null,this.onScrollCallback=null,this.scrollContainer=e.scrollContainer,this.scrollHorizontally=-1!==e.scrollAxis.indexOf("x"),this.scrollVertically=-1!==e.scrollAxis.indexOf("y"),this.scrollByTick=null!=e.scrollByTick?e.scrollByTick:20,e.onScrollCallback&&(this.onScrollCallback=e.onScrollCallback),this.scrollVertically&&(this.getVerticalPosition=e.getVerticalPosition,this.setVerticalPosition=e.setVerticalPosition),this.scrollHorizontally&&(this.getHorizontalPosition=e.getHorizontalPosition,this.setHorizontalPosition=e.setHorizontalPosition),this.shouldSkipVerticalScroll=e.shouldSkipVerticalScroll||(()=>!1),this.shouldSkipHorizontalScroll=e.shouldSkipHorizontalScroll||(()=>!1)}check(e,t=!1){const i=t||this.shouldSkipVerticalScroll();if(i&&this.shouldSkipHorizontalScroll())return;const n=this.scrollContainer.getBoundingClientRect(),s=this.scrollByTick;this.tickLeft=e.clientX<n.left+s,this.tickRight=e.clientX>n.right-s,this.tickUp=e.clientY<n.top+s&&!i,this.tickDown=e.clientY>n.bottom-s&&!i,this.tickLeft||this.tickRight||this.tickUp||this.tickDown?this.ensureTickingStarted():this.ensureCleared()}ensureTickingStarted(){null===this.tickingInterval&&(this.tickingInterval=window.setInterval(this.doTick.bind(this),100),this.tickCount=0)}doTick(){let e;if(this.tickCount++,e=this.tickCount>20?200:this.tickCount>10?80:40,this.scrollVertically){const t=this.getVerticalPosition();this.tickUp&&this.setVerticalPosition(t-e),this.tickDown&&this.setVerticalPosition(t+e)}if(this.scrollHorizontally){const t=this.getHorizontalPosition();this.tickLeft&&this.setHorizontalPosition(t-e),this.tickRight&&this.setHorizontalPosition(t+e)}this.onScrollCallback&&this.onScrollCallback()}ensureCleared(){this.tickingInterval&&(window.clearInterval(this.tickingInterval),this.tickingInterval=null)}},ko=class extends st{constructor(e){super(),this.eContainer=e}postConstruct(){this.gos.isRowModelType("clientSide")&&(this.clientSideRowModel=this.rowModel),this.ctrlsService.whenReady(e=>{const t=e.gridBodyCtrl;this.autoScrollService=new Ro({scrollContainer:t.getBodyViewportElement(),scrollAxis:"y",getVerticalPosition:()=>t.getScrollFeature().getVScrollPosition().top,setVerticalPosition:e=>t.getScrollFeature().setVerticalScrollPosition(e),onScrollCallback:()=>{this.onDragging(this.lastDraggingEvent)}})})}getContainer(){return this.eContainer}isInterestedIn(e){return 2===e}getIconName(){return this.gos.get("rowDragManaged")&&this.shouldPreventRowMove()?Lr.ICON_NOT_ALLOWED:Lr.ICON_MOVE}shouldPreventRowMove(){return!!this.columnModel.getRowGroupColumns().length||(!!this.filterManager.isAnyFilterPresent()||!!this.sortController.isSortActive())}getRowNodes(e){if(!this.isFromThisGrid(e))return e.dragItem.rowNodes||[];const t=e.dragItem.rowNode;if(this.gos.get("rowDragMultiRow")){const e=[...this.selectionService.getSelectedNodes()].sort((e,t)=>null==e.rowIndex||null==t.rowIndex?0:this.getRowIndexNumber(e)-this.getRowIndexNumber(t));if(-1!==e.indexOf(t))return e}return[t]}onDragEnter(e){e.dragItem.rowNodes=this.getRowNodes(e),this.dispatchGridEvent(ct.EVENT_ROW_DRAG_ENTER,e),this.getRowNodes(e).forEach(e=>{e.setDragging(!0)}),this.onEnterOrDragging(e)}onDragging(e){this.onEnterOrDragging(e)}isFromThisGrid(e){const{dragSourceDomDataKey:t}=e.dragSource;return t===this.gos.getDomDataKey()}isDropZoneWithinThisGrid(e){const t=this.ctrlsService.getGridBodyCtrl().getGui(),{dropZoneTarget:i}=e;return!t.contains(i)}onEnterOrDragging(e){this.dispatchGridEvent(ct.EVENT_ROW_DRAG_MOVE,e),this.lastDraggingEvent=e;const t=this.mouseEventService.getNormalisedPosition(e).y;this.gos.get("rowDragManaged")&&this.doManagedDrag(e,t),this.autoScrollService.check(e.event)}doManagedDrag(e,t){const i=this.isFromThisGrid(e),n=this.gos.get("rowDragManaged"),s=e.dragItem.rowNodes;n&&this.shouldPreventRowMove()||(this.gos.get("suppressMoveWhenRowDragging")||!i?this.isDropZoneWithinThisGrid(e)||this.clientSideRowModel.highlightRowAtPixel(s[0],t):this.moveRows(s,t))}getRowIndexNumber(e){return parseInt(Ie(e.getRowIndexString().split("-")),10)}moveRowAndClearHighlight(e){const t=this.clientSideRowModel.getLastHighlightedRowNode(),i=t&&1===t.highlighted,n=this.mouseEventService.getNormalisedPosition(e).y,s=e.dragItem.rowNodes;let r=i?1:0;if(this.isFromThisGrid(e))s.forEach(e=>{e.rowTop<n&&(r-=1)}),this.moveRows(s,n,r);else{const e=this.gos.getCallback("getRowId");let t=this.clientSideRowModel.getRowIndexAtPixel(n)+1;0===this.clientSideRowModel.getHighlightPosition(n)&&t--,this.clientSideRowModel.updateRowData({add:s.map(e=>e.data).filter(t=>!this.clientSideRowModel.getRowNode(e?e({data:t,level:0}):t.id)),addIndex:t})}this.clearRowHighlight()}clearRowHighlight(){this.clientSideRowModel.highlightRowAtPixel(null)}moveRows(e,t,i=0){var n;this.clientSideRowModel.ensureRowsAtPixel(e,t,i)&&(this.focusService.clearFocusedCell(),null==(n=this.rangeService)||n.removeAllCellRanges())}addRowDropZone(e){if(!e.getContainer())return void z("addRowDropZone - A container target needs to be provided");if(this.dragAndDropService.findExternalZone(e))return void console.warn("AG Grid: addRowDropZone - target already exists in the list of DropZones. Use `removeRowDropZone` before adding it again.");let t={getContainer:e.getContainer};e.fromGrid?t=e:(e.onDragEnter&&(t.onDragEnter=t=>{e.onDragEnter(this.draggingToRowDragEvent(ct.EVENT_ROW_DRAG_ENTER,t))}),e.onDragLeave&&(t.onDragLeave=t=>{e.onDragLeave(this.draggingToRowDragEvent(ct.EVENT_ROW_DRAG_LEAVE,t))}),e.onDragging&&(t.onDragging=t=>{e.onDragging(this.draggingToRowDragEvent(ct.EVENT_ROW_DRAG_MOVE,t))}),e.onDragStop&&(t.onDragStop=t=>{e.onDragStop(this.draggingToRowDragEvent(ct.EVENT_ROW_DRAG_END,t))})),this.dragAndDropService.addDropTarget(d({isInterestedIn:e=>2===e,getIconName:()=>Lr.ICON_MOVE,external:!0},t))}getRowDropZone(e){const t=this.getContainer.bind(this),i=this.onDragEnter.bind(this),n=this.onDragLeave.bind(this),s=this.onDragging.bind(this),r=this.onDragStop.bind(this);return e?{getContainer:t,onDragEnter:e.onDragEnter?t=>{i(t),e.onDragEnter(this.draggingToRowDragEvent(ct.EVENT_ROW_DRAG_ENTER,t))}:i,onDragLeave:e.onDragLeave?t=>{n(t),e.onDragLeave(this.draggingToRowDragEvent(ct.EVENT_ROW_DRAG_LEAVE,t))}:n,onDragging:e.onDragging?t=>{s(t),e.onDragging(this.draggingToRowDragEvent(ct.EVENT_ROW_DRAG_MOVE,t))}:s,onDragStop:e.onDragStop?t=>{r(t),e.onDragStop(this.draggingToRowDragEvent(ct.EVENT_ROW_DRAG_END,t))}:r,fromGrid:!0}:{getContainer:t,onDragEnter:i,onDragLeave:n,onDragging:s,onDragStop:r,fromGrid:!0}}draggingToRowDragEvent(e,t){const i=this.mouseEventService.getNormalisedPosition(t).y;let n,s,r=-1;switch(i>this.paginationProxy.getCurrentPageHeight()||(r=this.rowModel.getRowIndexAtPixel(i),n=this.rowModel.getRow(r)),t.vDirection){case 1:s="down";break;case 0:s="up";break;default:s=null}return this.gos.addGridCommonParams({type:e,event:t.event,node:t.dragItem.rowNode,nodes:t.dragItem.rowNodes,overIndex:r,overNode:n,y:i,vDirection:s})}dispatchGridEvent(e,t){const i=this.draggingToRowDragEvent(e,t);this.eventService.dispatchEvent(i)}onDragLeave(e){this.dispatchGridEvent(ct.EVENT_ROW_DRAG_LEAVE,e),this.stopDragging(e),this.gos.get("rowDragManaged")&&this.clearRowHighlight()}onDragStop(e){this.dispatchGridEvent(ct.EVENT_ROW_DRAG_END,e),this.stopDragging(e),!this.gos.get("rowDragManaged")||!this.gos.get("suppressMoveWhenRowDragging")&&this.isFromThisGrid(e)||this.isDropZoneWithinThisGrid(e)||this.moveRowAndClearHighlight(e)}stopDragging(e){this.autoScrollService.ensureCleared(),this.getRowNodes(e).forEach(e=>{e.setDragging(!1)})}};f([ue("dragAndDropService")],ko.prototype,"dragAndDropService",2),f([ue("rowModel")],ko.prototype,"rowModel",2),f([ue("paginationProxy")],ko.prototype,"paginationProxy",2),f([ue("columnModel")],ko.prototype,"columnModel",2),f([ue("focusService")],ko.prototype,"focusService",2),f([ue("sortController")],ko.prototype,"sortController",2),f([ue("filterManager")],ko.prototype,"filterManager",2),f([ue("selectionService")],ko.prototype,"selectionService",2),f([ue("mouseEventService")],ko.prototype,"mouseEventService",2),f([ue("ctrlsService")],ko.prototype,"ctrlsService",2),f([de("rangeService")],ko.prototype,"rangeService",2),f([le],ko.prototype,"postConstruct",1);var Po=class extends st{constructor(){super(...arguments),this.dragEndFunctions=[],this.dragSources=[]}removeAllListeners(){this.dragSources.forEach(this.removeListener.bind(this)),this.dragSources.length=0}removeListener(e){const t=e.dragSource.eElement,i=e.mouseDownListener;if(t.removeEventListener("mousedown",i),e.touchEnabled){const i=e.touchStartListener;t.removeEventListener("touchstart",i,{passive:!0})}}removeDragSource(e){const t=this.dragSources.find(t=>t.dragSource===e);t&&(this.removeListener(t),Ne(this.dragSources,t))}isDragging(){return this.dragging}addDragSource(e){const t=this.onMouseDown.bind(this,e),{eElement:i,includeTouch:n,stopPropagationForTouch:s}=e;i.addEventListener("mousedown",t);let r=null;const o=this.gos.get("suppressTouch");n&&!o&&(r=t=>{on(t.target)||(t.cancelable&&(t.preventDefault(),s&&t.stopPropagation()),this.onTouchStart(e,t))},i.addEventListener("touchstart",r,{passive:!1})),this.dragSources.push({dragSource:e,mouseDownListener:t,touchStartListener:r,touchEnabled:!!n})}getStartTarget(){return this.startTarget}onTouchStart(e,t){this.currentDragParams=e,this.dragging=!1;const i=t.touches[0];this.touchLastTime=i,this.touchStart=i;const n=t=>this.onTouchUp(t,e.eElement),s=t.target,r=[{target:this.gos.getRootNode(),type:"touchmove",listener:e=>{e.cancelable&&e.preventDefault()},options:{passive:!1}},{target:s,type:"touchmove",listener:t=>this.onTouchMove(t,e.eElement),options:{passive:!0}},{target:s,type:"touchend",listener:n,options:{passive:!0}},{target:s,type:"touchcancel",listener:n,options:{passive:!0}}];this.addTemporaryEvents(r),0===e.dragStartPixels&&this.onCommonMove(i,this.touchStart,e.eElement)}onMouseDown(e,t){const i=t;if(e.skipMouseEvent&&e.skipMouseEvent(t))return;if(i._alreadyProcessedByDragService)return;if(i._alreadyProcessedByDragService=!0,0!==t.button)return;this.shouldPreventMouseEvent(t)&&t.preventDefault(),this.currentDragParams=e,this.dragging=!1,this.mouseStartEvent=t,this.startTarget=t.target;const n=this.gos.getRootNode(),s=[{target:n,type:"mousemove",listener:t=>this.onMouseMove(t,e.eElement)},{target:n,type:"mouseup",listener:t=>this.onMouseUp(t,e.eElement)},{target:n,type:"contextmenu",listener:e=>e.preventDefault()}];this.addTemporaryEvents(s),0===e.dragStartPixels&&this.onMouseMove(t,e.eElement)}addTemporaryEvents(e){e.forEach(e=>{const{target:t,type:i,listener:n,options:s}=e;t.addEventListener(i,n,s)}),this.dragEndFunctions.push(()=>{e.forEach(e=>{const{target:t,type:i,listener:n,options:s}=e;t.removeEventListener(i,n,s)})})}isEventNearStartEvent(e,t){const{dragStartPixels:i}=this.currentDragParams;return ss(e,t,b(i)?i:4)}getFirstActiveTouch(e){for(let t=0;t<e.length;t++)if(e[t].identifier===this.touchStart.identifier)return e[t];return null}onCommonMove(e,t,i){if(!this.dragging){if(!this.dragging&&this.isEventNearStartEvent(e,t))return;this.dragging=!0;const n={type:ct.EVENT_DRAG_STARTED,target:i};this.eventService.dispatchEvent(n),this.currentDragParams.onDragStart(t),this.currentDragParams.onDragging(t)}this.currentDragParams.onDragging(e)}onTouchMove(e,t){const i=this.getFirstActiveTouch(e.touches);i&&this.onCommonMove(i,this.touchStart,t)}onMouseMove(e,t){var i;Ti()&&(null==(i=this.gos.getDocument().getSelection())||i.removeAllRanges()),this.shouldPreventMouseEvent(e)&&e.preventDefault(),this.onCommonMove(e,this.mouseStartEvent,t)}shouldPreventMouseEvent(e){const t=this.gos.get("enableCellTextSelection"),i="mousemove"===e.type;return t&&i&&e.cancelable&&this.mouseEventService.isEventFromThisGrid(e)&&!this.isOverFormFieldElement(e)}isOverFormFieldElement(e){const t=e.target,i=null==t?void 0:t.tagName.toLocaleLowerCase();return!!(null==i?void 0:i.match("^a$|textarea|input|select|button"))}onTouchUp(e,t){let i=this.getFirstActiveTouch(e.changedTouches);i||(i=this.touchLastTime),this.onUpCommon(i,t)}onMouseUp(e,t){this.onUpCommon(e,t)}onUpCommon(e,t){if(this.dragging){this.dragging=!1,this.currentDragParams.onDragStop(e);const i={type:ct.EVENT_DRAG_STOPPED,target:t};this.eventService.dispatchEvent(i)}this.mouseStartEvent=null,this.startTarget=null,this.touchStart=null,this.touchLastTime=null,this.currentDragParams=null,this.dragEndFunctions.forEach(e=>e()),this.dragEndFunctions.length=0}};f([ue("mouseEventService")],Po.prototype,"mouseEventService",2),f([ce],Po.prototype,"removeAllListeners",1),Po=f([he("dragService")],Po);var _o="ag-list-item-hovered",Lo=class extends st{constructor(e,t,i){super(),this.comp=e,this.virtualList=t,this.params=i,this.currentDragValue=null,this.lastHoveredListItem=null}postConstruct(){this.addManagedListener(this.params.eventSource,this.params.listItemDragStartEvent,this.listItemDragStart.bind(this)),this.addManagedListener(this.params.eventSource,this.params.listItemDragEndEvent,this.listItemDragEnd.bind(this)),this.createDropTarget(),this.createAutoScrollService()}listItemDragStart(e){this.currentDragValue=this.params.getCurrentDragValue(e),this.moveBlocked=this.params.isMoveBlocked(this.currentDragValue)}listItemDragEnd(){window.setTimeout(()=>{this.currentDragValue=null,this.moveBlocked=!1},10)}createDropTarget(){const e={isInterestedIn:e=>e===this.params.dragSourceType,getIconName:()=>this.moveBlocked?Lr.ICON_PINNED:Lr.ICON_MOVE,getContainer:()=>this.comp.getGui(),onDragging:e=>this.onDragging(e),onDragStop:()=>this.onDragStop(),onDragLeave:()=>this.onDragLeave()};this.dragAndDropService.addDropTarget(e)}createAutoScrollService(){const e=this.virtualList.getGui();this.autoScrollService=new Ro({scrollContainer:e,scrollAxis:"y",getVerticalPosition:()=>e.scrollTop,setVerticalPosition:t=>e.scrollTop=t})}onDragging(e){if(!this.currentDragValue||this.moveBlocked)return;const t=this.getListDragItem(e),i=this.virtualList.getComponentAt(t.rowIndex);if(!i)return;const n=i.getGui().parentElement;this.lastHoveredListItem&&this.lastHoveredListItem.rowIndex===t.rowIndex&&this.lastHoveredListItem.position===t.position||(this.autoScrollService.check(e.event),this.clearHoveredItems(),this.lastHoveredListItem=t,nn(n,_o),nn(n,`ag-item-highlight-${t.position}`))}getListDragItem(e){const t=this.virtualList.getGui(),i=parseFloat(window.getComputedStyle(t).paddingTop),n=this.virtualList.getRowHeight(),s=this.virtualList.getScrollTop(),r=Math.max(0,(e.y-i+s)/n),o=this.params.getNumRows(this.comp)-1,a=0|Math.min(o,r);return{rowIndex:a,position:Math.round(r)>r||r>o?"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(`.${_o}`).forEach(e=>{[_o,"ag-item-highlight-top","ag-item-highlight-bottom"].forEach(t=>{e.classList.remove(t)})}),this.lastHoveredListItem=null}};function No(e){const t=e;return null!=t&&null!=t.getFrameworkComponentInstance?t.getFrameworkComponentInstance():e}f([ue("dragAndDropService")],Lo.prototype,"dragAndDropService",2),f([le],Lo.prototype,"postConstruct",1);var Oo=class{constructor(){this.detailGridInfoMap={},this.destroyCalled=!1}init(){switch(this.rowModel.getType()){case"clientSide":this.clientSideRowModel=this.rowModel;break;case"infinite":this.infiniteRowModel=this.rowModel;break;case"serverSide":this.serverSideRowModel=this.rowModel}this.ctrlsService.whenReady(e=>{this.gridBodyCtrl=e.gridBodyCtrl})}__getAlignedGridService(){return this.alignedGridsService}getGridId(){return this.context.getGridId()}addDetailGridInfo(e,t){this.detailGridInfoMap[e]=t}removeDetailGridInfo(e){delete this.detailGridInfoMap[e]}getDetailGridInfo(e){return this.detailGridInfoMap[e]}forEachDetailGridInfo(e){let t=0;P(this.detailGridInfoMap,(i,n)=>{b(n)&&(e(n,t),t++)})}getDataAsCsv(e){if(re.__assertRegistered("@ag-grid-community/csv-export","api.getDataAsCsv",this.context.getGridId()))return this.csvCreator.getDataAsCsv(e)}exportDataAsCsv(e){re.__assertRegistered("@ag-grid-community/csv-export","api.exportDataAsCsv",this.context.getGridId())&&this.csvCreator.exportDataAsCsv(e)}assertNotExcelMultiSheet(e,t){return!(!re.__assertRegistered("@ag-grid-enterprise/excel-export","api."+e,this.context.getGridId())||1===this.excelCreator.getFactoryMode()&&(console.warn("AG Grid: The Excel Exporter is currently on Multi Sheet mode. End that operation by calling 'api.getMultipleSheetAsExcel()' or 'api.exportMultipleSheetsAsExcel()'"),1))}getDataAsExcel(e){if(this.assertNotExcelMultiSheet("getDataAsExcel",e))return this.excelCreator.getDataAsExcel(e)}exportDataAsExcel(e){this.assertNotExcelMultiSheet("exportDataAsExcel",e)&&this.excelCreator.exportDataAsExcel(e)}getSheetDataForExcel(e){if(re.__assertRegistered("@ag-grid-enterprise/excel-export","api.getSheetDataForExcel",this.context.getGridId()))return this.excelCreator.setFactoryMode(1),this.excelCreator.getSheetDataForExcel(e)}getMultipleSheetsAsExcel(e){if(re.__assertRegistered("@ag-grid-enterprise/excel-export","api.getMultipleSheetsAsExcel",this.context.getGridId()))return this.excelCreator.getMultipleSheetsAsExcel(e)}exportMultipleSheetsAsExcel(e){re.__assertRegistered("@ag-grid-enterprise/excel-export","api.exportMultipleSheetsAsExcel",this.context.getGridId())&&this.excelCreator.exportMultipleSheetsAsExcel(e)}setGridAriaProperty(e,t){if(!e)return;const i=this.ctrlsService.getGridBodyCtrl().getGui(),n=`aria-${e}`;null===t?i.removeAttribute(n):i.setAttribute(n,t)}logMissingRowModel(e,...t){console.error(`AG Grid: api.${e} can only be called when gridOptions.rowModelType is ${t.join(" or ")}`)}logDeprecation(e,t,i,n){z(`Since ${e} api.${t} is deprecated. Please use ${i} instead. ${null!=n?n:""}`)}getPinnedTopRowCount(){return this.pinnedRowModel.getPinnedTopRowCount()}getPinnedBottomRowCount(){return this.pinnedRowModel.getPinnedBottomRowCount()}getPinnedTopRow(e){return this.pinnedRowModel.getPinnedTopRow(e)}getPinnedBottomRow(e){return this.pinnedRowModel.getPinnedBottomRow(e)}expireValueCache(){this.valueCache.expire()}getVerticalPixelRange(){return this.gridBodyCtrl.getScrollFeature().getVScrollPosition()}getHorizontalPixelRange(){return this.gridBodyCtrl.getScrollFeature().getHScrollPosition()}refreshCells(e={}){this.frameworkOverrides.wrapIncoming(()=>this.rowRenderer.refreshCells(e))}flashCells(e={}){const t=e=>z(`Since v31.1 api.flashCells parameter '${e}Delay' is deprecated. Please use '${e}Duration' instead.`);b(e.fadeDelay)&&t("fade"),b(e.flashDelay)&&t("flash"),this.frameworkOverrides.wrapIncoming(()=>this.rowRenderer.flashCells(e))}redrawRows(e={}){const t=e?e.rowNodes:void 0;this.frameworkOverrides.wrapIncoming(()=>this.rowRenderer.redrawRows(t))}refreshHeader(){this.frameworkOverrides.wrapIncoming(()=>this.ctrlsService.getHeaderRowContainerCtrls().forEach(e=>e.refresh()))}isAnyFilterPresent(){return this.filterManager.isAnyFilterPresent()}isColumnFilterPresent(){return this.filterManager.isColumnFilterPresent()||this.filterManager.isAggregateFilterPresent()}isQuickFilterPresent(){return this.filterManager.isQuickFilterPresent()}getModel(){return z("Since v31.1 getModel() is deprecated. Please use the appropriate grid API methods instead."),this.rowModel}setRowNodeExpanded(e,t,i,n){this.expansionService.setRowNodeExpanded(e,t,i,n)}onGroupExpandedOrCollapsed(){C(this.clientSideRowModel)?this.logMissingRowModel("onGroupExpandedOrCollapsed","clientSide"):this.expansionService.onGroupExpandedOrCollapsed()}refreshClientSideRowModel(e){C(this.clientSideRowModel)?this.logMissingRowModel("refreshClientSideRowModel","clientSide"):this.clientSideRowModel.refreshModel(e)}isAnimationFrameQueueEmpty(){return this.animationFrameService.isQueueEmpty()}flushAllAnimationFrames(){this.animationFrameService.flushAllFrames()}getRowNode(e){return this.rowModel.getRowNode(e)}getSizesForCurrentTheme(){return{rowHeight:this.gos.getRowHeightAsNumber(),headerHeight:this.columnModel.getHeaderHeight()}}expandAll(){this.clientSideRowModel||this.serverSideRowModel?this.expansionService.expandAll(!0):this.logMissingRowModel("expandAll","clientSide","serverSide")}collapseAll(){this.clientSideRowModel||this.serverSideRowModel?this.expansionService.expandAll(!1):this.logMissingRowModel("collapseAll","clientSide","serverSide")}addRenderedRowListener(e,t,i){this.rowRenderer.addRenderedRowListener(e,t,i)}getQuickFilter(){return this.gos.get("quickFilterText")}getAdvancedFilterModel(){return re.__assertRegistered("@ag-grid-enterprise/advanced-filter","api.getAdvancedFilterModel",this.context.getGridId())?this.filterManager.getAdvancedFilterModel():null}setAdvancedFilterModel(e){this.filterManager.setAdvancedFilterModel(e)}showAdvancedFilterBuilder(){re.__assertRegistered("@ag-grid-enterprise/advanced-filter","api.setAdvancedFilterModel",this.context.getGridId())&&this.filterManager.showAdvancedFilterBuilder("api")}setNodesSelected(e){if(!e.nodes.every(e=>e.rowPinned?(console.warn("AG Grid: cannot select pinned rows"),!1):void 0!==e.id||(console.warn("AG Grid: cannot select node until id for node is known"),!1)))return;const{nodes:t,source:i,newValue:n}=e,s=t;this.selectionService.setNodesSelected({nodes:s,source:null!=i?i:"api",newValue:n})}selectAll(e="apiSelectAll"){this.selectionService.selectAllRowNodes({source:e})}deselectAll(e="apiSelectAll"){this.selectionService.deselectAllRowNodes({source:e})}selectAllFiltered(e="apiSelectAllFiltered"){this.selectionService.selectAllRowNodes({source:e,justFiltered:!0})}deselectAllFiltered(e="apiSelectAllFiltered"){this.selectionService.deselectAllRowNodes({source:e,justFiltered:!0})}getServerSideSelectionState(){return C(this.serverSideRowModel)?(this.logMissingRowModel("getServerSideSelectionState","serverSide"),null):this.selectionService.getSelectionState()}setServerSideSelectionState(e){C(this.serverSideRowModel)?this.logMissingRowModel("setServerSideSelectionState","serverSide"):this.selectionService.setSelectionState(e,"api")}selectAllOnCurrentPage(e="apiSelectAllCurrentPage"){this.selectionService.selectAllRowNodes({source:e,justCurrentPage:!0})}deselectAllOnCurrentPage(e="apiSelectAllCurrentPage"){this.selectionService.deselectAllRowNodes({source:e,justCurrentPage:!0})}showLoadingOverlay(){this.overlayService.showLoadingOverlay()}showNoRowsOverlay(){this.overlayService.showNoRowsOverlay()}hideOverlay(){this.overlayService.hideOverlay()}getSelectedNodes(){return this.selectionService.getSelectedNodes()}getSelectedRows(){return this.selectionService.getSelectedRows()}getBestCostNodeSelection(){if(!C(this.clientSideRowModel))return this.selectionService.getBestCostNodeSelection();this.logMissingRowModel("getBestCostNodeSelection","clientSide")}getRenderedNodes(){return this.rowRenderer.getRenderedNodes()}ensureColumnVisible(e,t="auto"){this.frameworkOverrides.wrapIncoming(()=>this.gridBodyCtrl.getScrollFeature().ensureColumnVisible(e,t),"ensureVisible")}ensureIndexVisible(e,t){this.frameworkOverrides.wrapIncoming(()=>this.gridBodyCtrl.getScrollFeature().ensureIndexVisible(e,t),"ensureVisible")}ensureNodeVisible(e,t=null){this.frameworkOverrides.wrapIncoming(()=>this.gridBodyCtrl.getScrollFeature().ensureNodeVisible(e,t),"ensureVisible")}forEachLeafNode(e){C(this.clientSideRowModel)?this.logMissingRowModel("forEachLeafNode","clientSide"):this.clientSideRowModel.forEachLeafNode(e)}forEachNode(e,t){this.rowModel.forEachNode(e,t)}forEachNodeAfterFilter(e){C(this.clientSideRowModel)?this.logMissingRowModel("forEachNodeAfterFilter","clientSide"):this.clientSideRowModel.forEachNodeAfterFilter(e)}forEachNodeAfterFilterAndSort(e){C(this.clientSideRowModel)?this.logMissingRowModel("forEachNodeAfterFilterAndSort","clientSide"):this.clientSideRowModel.forEachNodeAfterFilterAndSort(e)}getFilterInstance(e,t){return z("'getFilterInstance' is deprecated. To get/set individual filter models, use 'getColumnFilterModel' or 'setColumnFilterModel' instead. To get hold of the filter instance, use 'getColumnFilterInstance' which returns the instance asynchronously."),this.filterManager.getFilterInstance(e,t)}getColumnFilterInstance(e){return this.filterManager.getColumnFilterInstance(e)}destroyFilter(e){const t=this.columnModel.getPrimaryColumn(e);if(t)return this.filterManager.destroyFilter(t,"api")}getStatusPanel(e){if(re.__assertRegistered("@ag-grid-enterprise/status-bar","api.getStatusPanel",this.context.getGridId()))return No(this.statusBarService.getStatusPanel(e))}getColumnDef(e){const t=this.columnModel.getPrimaryColumn(e);return t?t.getColDef():null}getColumnDefs(){return this.columnModel.getColumnDefs()}onFilterChanged(e="api"){this.filterManager.onFilterChanged({source:e})}onSortChanged(){this.sortController.onSortChanged("api")}setFilterModel(e){this.frameworkOverrides.wrapIncoming(()=>this.filterManager.setFilterModel(e))}getFilterModel(){return this.filterManager.getFilterModel()}getColumnFilterModel(e){return this.filterManager.getColumnFilterModel(e)}setColumnFilterModel(e,t){return this.filterManager.setColumnFilterModel(e,t)}getFocusedCell(){return this.focusService.getFocusedCell()}clearFocusedCell(){return this.focusService.clearFocusedCell()}setFocusedCell(e,t,i){this.focusService.setFocusedCell({rowIndex:e,column:t,rowPinned:i,forceBrowserFocus:!0})}addRowDropZone(e){this.gridBodyCtrl.getRowDragFeature().addRowDropZone(e)}removeRowDropZone(e){const t=this.dragAndDropService.findExternalZone(e);t&&this.dragAndDropService.removeDropTarget(t)}getRowDropZoneParams(e){return this.gridBodyCtrl.getRowDragFeature().getRowDropZone(e)}assertSideBarLoaded(e){return re.__assertRegistered("@ag-grid-enterprise/side-bar","api."+e,this.context.getGridId())}isSideBarVisible(){return this.assertSideBarLoaded("isSideBarVisible")&&this.sideBarService.getSideBarComp().isDisplayed()}setSideBarVisible(e){this.assertSideBarLoaded("setSideBarVisible")&&this.sideBarService.getSideBarComp().setDisplayed(e)}setSideBarPosition(e){this.assertSideBarLoaded("setSideBarPosition")&&this.sideBarService.getSideBarComp().setSideBarPosition(e)}openToolPanel(e){this.assertSideBarLoaded("openToolPanel")&&this.sideBarService.getSideBarComp().openToolPanel(e,"api")}closeToolPanel(){this.assertSideBarLoaded("closeToolPanel")&&this.sideBarService.getSideBarComp().close("api")}getOpenedToolPanel(){return this.assertSideBarLoaded("getOpenedToolPanel")?this.sideBarService.getSideBarComp().openedItem():null}refreshToolPanel(){this.assertSideBarLoaded("refreshToolPanel")&&this.sideBarService.getSideBarComp().refresh()}isToolPanelShowing(){return this.assertSideBarLoaded("isToolPanelShowing")&&this.sideBarService.getSideBarComp().isToolPanelShowing()}getToolPanelInstance(e){if(this.assertSideBarLoaded("getToolPanelInstance"))return No(this.sideBarService.getSideBarComp().getToolPanelInstance(e))}getSideBar(){if(this.assertSideBarLoaded("getSideBar"))return this.sideBarService.getSideBarComp().getDef()}resetRowHeights(){if(b(this.clientSideRowModel)){if(this.columnModel.isAutoRowHeightActive())return void console.warn("AG Grid: calling gridApi.resetRowHeights() makes no sense when using Auto Row Height.");this.clientSideRowModel.resetRowHeights()}}setRowCount(e,t){if(this.serverSideRowModel)return this.columnModel.isRowGroupEmpty()?void this.serverSideRowModel.setRowCount(e,t):void console.error("AG Grid: setRowCount cannot be used while using row grouping.");this.infiniteRowModel?this.infiniteRowModel.setRowCount(e,t):this.logMissingRowModel("setRowCount","infinite","serverSide")}onRowHeightChanged(){this.clientSideRowModel?this.clientSideRowModel.onRowHeightChanged():this.serverSideRowModel&&this.serverSideRowModel.onRowHeightChanged()}getValue(e,t){return this.logDeprecation("31.3","getValue","getCellValue"),this.getCellValue({colKey:e,rowNode:t})}getCellValue(e){var t;const{colKey:i,rowNode:n,useFormatter:s}=e;let r=null!=(t=this.columnModel.getPrimaryColumn(i))?t:this.columnModel.getGridColumn(i);if(C(r))return null;const o=this.valueService.getValue(r,n);if(s){const e=this.valueService.formatValue(r,n,o);return null!=e?e:bt(o,!0)}return o}addEventListener(e,t){this.apiEventService.addEventListener(e,t)}addGlobalListener(e){this.apiEventService.addGlobalListener(e)}removeEventListener(e,t){this.apiEventService.removeEventListener(e,t)}removeGlobalListener(e){this.apiEventService.removeGlobalListener(e)}dispatchEvent(e){this.eventService.dispatchEvent(e)}destroy(){var e;const t=`See ${this.frameworkOverrides.getDocLink("grid-lifecycle/#grid-pre-destroyed")}`;if(this.destroyCalled)return;const i={type:ct.EVENT_GRID_PRE_DESTROYED,state:this.getState()};this.dispatchEvent(i),this.destroyCalled=!0,null==(e=this.ctrlsService.get("gridCtrl"))||e.destroyGridUi(),this.context.destroy(),this.detailGridInfoMap={},G(this,["isDestroyed"],t)}isDestroyed(){return this.destroyCalled}resetQuickFilter(){this.filterManager.resetQuickFilterCache()}getCellRanges(){return this.rangeService?this.rangeService.getCellRanges():(re.__assertRegistered("@ag-grid-enterprise/range-selection","api.getCellRanges",this.context.getGridId()),null)}addCellRange(e){this.rangeService?this.rangeService.addCellRange(e):re.__assertRegistered("@ag-grid-enterprise/range-selection","api.addCellRange",this.context.getGridId())}clearRangeSelection(){this.rangeService&&this.rangeService.removeAllCellRanges(),re.__assertRegistered("@ag-grid-enterprise/range-selection","gridApi.clearRangeSelection",this.context.getGridId())}undoCellEditing(){this.undoRedoService.undo("api")}redoCellEditing(){this.undoRedoService.redo("api")}getCurrentUndoSize(){return this.undoRedoService.getCurrentUndoStackSize()}getCurrentRedoSize(){return this.undoRedoService.getCurrentRedoStackSize()}assertChart(e,t){if(re.__assertRegistered("@ag-grid-enterprise/charts","api."+e,this.context.getGridId()))return this.frameworkOverrides.wrapIncoming(()=>t())}getChartModels(){return this.assertChart("getChartModels",()=>this.chartService.getChartModels())}getChartRef(e){return this.assertChart("getChartRef",()=>this.chartService.getChartRef(e))}getChartImageDataURL(e){return this.assertChart("getChartImageDataURL",()=>this.chartService.getChartImageDataURL(e))}downloadChart(e){return this.assertChart("downloadChart",()=>this.chartService.downloadChart(e))}openChartToolPanel(e){return this.assertChart("openChartToolPanel",()=>this.chartService.openChartToolPanel(e))}closeChartToolPanel(e){return this.assertChart("closeChartToolPanel",()=>this.chartService.closeChartToolPanel(e.chartId))}createRangeChart(e){return this.assertChart("createRangeChart",()=>this.chartService.createRangeChart(e))}createPivotChart(e){return this.assertChart("createPivotChart",()=>this.chartService.createPivotChart(e))}createCrossFilterChart(e){return this.assertChart("createCrossFilterChart",()=>this.chartService.createCrossFilterChart(e))}updateChart(e){return this.assertChart("updateChart",()=>this.chartService.updateChart(e))}restoreChart(e,t){return this.assertChart("restoreChart",()=>this.chartService.restoreChart(e,t))}assertClipboard(e,t){re.__assertRegistered("@ag-grid-enterprise/clipboard","api"+e,this.context.getGridId())&&t()}copyToClipboard(e){this.assertClipboard("copyToClipboard",()=>this.clipboardService.copyToClipboard(e))}cutToClipboard(e){this.assertClipboard("cutToClipboard",()=>this.clipboardService.cutToClipboard(e))}copySelectedRowsToClipboard(e){this.assertClipboard("copySelectedRowsToClipboard",()=>this.clipboardService.copySelectedRowsToClipboard(e))}copySelectedRangeToClipboard(e){this.assertClipboard("copySelectedRangeToClipboard",()=>this.clipboardService.copySelectedRangeToClipboard(e))}copySelectedRangeDown(){this.assertClipboard("copySelectedRangeDown",()=>this.clipboardService.copyRangeDown())}pasteFromClipboard(){this.assertClipboard("pasteFromClipboard",()=>this.clipboardService.pasteFromClipboard())}showColumnMenuAfterButtonClick(e,t){z("'showColumnMenuAfterButtonClick' is deprecated. Use 'IHeaderParams.showColumnMenu' within a header component, or 'api.showColumnMenu' elsewhere.");const i=this.columnModel.getGridColumn(e);this.menuService.showColumnMenu({column:i,buttonElement:t,positionBy:"button"})}showColumnMenuAfterMouseClick(e,t){z("'showColumnMenuAfterMouseClick' is deprecated. Use 'IHeaderParams.showColumnMenuAfterMouseClick' within a header component, or 'api.showColumnMenu' elsewhere.");let i=this.columnModel.getGridColumn(e);i||(i=this.columnModel.getPrimaryColumn(e)),i?this.menuService.showColumnMenu({column:i,mouseEvent:t,positionBy:"mouse"}):console.error(`AG Grid: column '${e}' not found`)}showContextMenu(e){const{rowNode:t,column:i,value:n,x:s,y:r}=e||{};let{x:o,y:a}=this.menuService.getContextMenuPosition(t,i);null!=s&&(o=s),null!=r&&(a=r),this.menuService.showContextMenu({mouseEvent:new MouseEvent("mousedown",{clientX:o,clientY:a}),rowNode:t,column:i,value:n})}showColumnChooser(e){this.menuService.showColumnChooser({chooserParams:e})}showColumnFilter(e){const t=this.columnModel.getGridColumn(e);t?this.menuService.showFilterMenu({column:t,containerType:"columnFilter",positionBy:"auto"}):console.error(`AG Grid: column '${e}' not found`)}showColumnMenu(e){const t=this.columnModel.getGridColumn(e);t?this.menuService.showColumnMenu({column:t,positionBy:"auto"}):console.error(`AG Grid: column '${e}' not found`)}hidePopupMenu(){this.menuService.hidePopupMenu()}hideColumnChooser(){this.menuService.hideColumnChooser()}tabToNextCell(e){return this.navigationService.tabToNextCell(!1,e)}tabToPreviousCell(e){return this.navigationService.tabToNextCell(!0,e)}getCellRendererInstances(e={}){return this.rowRenderer.getCellRendererInstances(e).map(No)}getCellEditorInstances(e={}){return this.rowRenderer.getCellEditorInstances(e).map(No)}getEditingCells(){return this.rowRenderer.getEditingCells()}stopEditing(e=!1){this.rowRenderer.stopEditing(e)}startEditingCell(e){const t=this.columnModel.getGridColumn(e.colKey);if(!t)return void console.warn(`AG Grid: no column found for ${e.colKey}`);const i={rowIndex:e.rowIndex,rowPinned:e.rowPinned||null,column:t};null==e.rowPinned&&this.ensureIndexVisible(e.rowIndex),this.ensureColumnVisible(e.colKey);const n=this.navigationService.getCellByPosition(i);n&&(this.focusService.isCellFocused(i)||this.focusService.setFocusedCell(i),n.startRowOrCellEdit(e.key))}addAggFunc(e,t){this.logDeprecation("v31.1","addAggFunc(key, func)","addAggFuncs({ key: func })"),this.aggFuncService&&this.aggFuncService.addAggFuncs({key:t})}addAggFuncs(e){this.aggFuncService&&this.aggFuncService.addAggFuncs(e)}clearAggFuncs(){this.aggFuncService&&this.aggFuncService.clear()}applyServerSideTransaction(e){if(this.serverSideTransactionManager)return this.serverSideTransactionManager.applyTransaction(e);this.logMissingRowModel("applyServerSideTransaction","serverSide")}applyServerSideTransactionAsync(e,t){if(this.serverSideTransactionManager)return this.serverSideTransactionManager.applyTransactionAsync(e,t);this.logMissingRowModel("applyServerSideTransactionAsync","serverSide")}applyServerSideRowData(e){var t,i;const n=null!=(t=e.startRow)?t:0,s=null!=(i=e.route)?i:[];n<0?console.warn(`AG Grid: invalid value ${e.startRow} for startRow, the value should be >= 0`):this.serverSideRowModel?this.serverSideRowModel.applyRowData(e.successParams,n,s):this.logMissingRowModel("setServerSideDatasource","serverSide")}retryServerSideLoads(){this.serverSideRowModel?this.serverSideRowModel.retryLoads():this.logMissingRowModel("retryServerSideLoads","serverSide")}flushServerSideAsyncTransactions(){if(this.serverSideTransactionManager)return this.serverSideTransactionManager.flushAsyncTransactions();this.logMissingRowModel("flushServerSideAsyncTransactions","serverSide")}applyTransaction(e){if(this.clientSideRowModel)return this.frameworkOverrides.wrapIncoming(()=>this.clientSideRowModel.updateRowData(e));this.logMissingRowModel("applyTransaction","clientSide")}applyTransactionAsync(e,t){this.clientSideRowModel?this.frameworkOverrides.wrapIncoming(()=>this.clientSideRowModel.batchUpdateRowData(e,t)):this.logMissingRowModel("applyTransactionAsync","clientSide")}flushAsyncTransactions(){this.clientSideRowModel?this.frameworkOverrides.wrapIncoming(()=>this.clientSideRowModel.flushAsyncTransactions()):this.logMissingRowModel("flushAsyncTransactions","clientSide")}refreshInfiniteCache(){this.infiniteRowModel?this.infiniteRowModel.refreshCache():this.logMissingRowModel("refreshInfiniteCache","infinite")}purgeInfiniteCache(){this.infiniteRowModel?this.infiniteRowModel.purgeCache():this.logMissingRowModel("purgeInfiniteCache","infinite")}refreshServerSide(e){this.serverSideRowModel?this.serverSideRowModel.refreshStore(e):this.logMissingRowModel("refreshServerSide","serverSide")}getServerSideGroupLevelState(){return this.serverSideRowModel?this.serverSideRowModel.getStoreState():(this.logMissingRowModel("getServerSideGroupLevelState","serverSide"),[])}getInfiniteRowCount(){if(this.infiniteRowModel)return this.infiniteRowModel.getRowCount();this.logMissingRowModel("getInfiniteRowCount","infinite")}isLastRowIndexKnown(){if(this.infiniteRowModel)return this.infiniteRowModel.isLastRowIndexKnown();this.logMissingRowModel("isLastRowIndexKnown","infinite")}getCacheBlockState(){return this.rowNodeBlockLoader.getBlockState()}getFirstDisplayedRow(){return this.logDeprecation("v31.1","getFirstDisplayedRow","getFirstDisplayedRowIndex"),this.getFirstDisplayedRowIndex()}getFirstDisplayedRowIndex(){return this.rowRenderer.getFirstVirtualRenderedRow()}getLastDisplayedRow(){return this.logDeprecation("v31.1","getLastDisplayedRow","getLastDisplayedRowIndex"),this.getLastDisplayedRowIndex()}getLastDisplayedRowIndex(){return this.rowRenderer.getLastVirtualRenderedRow()}getDisplayedRowAtIndex(e){return this.rowModel.getRow(e)}getDisplayedRowCount(){return this.rowModel.getRowCount()}paginationIsLastPageFound(){return this.paginationProxy.isLastPageFound()}paginationGetPageSize(){return this.paginationProxy.getPageSize()}paginationGetCurrentPage(){return this.paginationProxy.getCurrentPage()}paginationGetTotalPages(){return this.paginationProxy.getTotalPages()}paginationGetRowCount(){return this.paginationProxy.getMasterRowCount()}paginationGoToNextPage(){this.paginationProxy.goToNextPage()}paginationGoToPreviousPage(){this.paginationProxy.goToPreviousPage()}paginationGoToFirstPage(){this.paginationProxy.goToFirstPage()}paginationGoToLastPage(){this.paginationProxy.goToLastPage()}paginationGoToPage(e){this.paginationProxy.goToPage(e)}sizeColumnsToFit(e){"number"==typeof e?this.columnModel.sizeColumnsToFit(e,"api"):this.gridBodyCtrl.sizeColumnsToFit(e)}setColumnGroupOpened(e,t){this.columnModel.setColumnGroupOpened(e,t,"api")}getColumnGroup(e,t){return this.columnModel.getColumnGroup(e,t)}getProvidedColumnGroup(e){return this.columnModel.getProvidedColumnGroup(e)}getDisplayNameForColumn(e,t){return this.columnModel.getDisplayNameForColumn(e,t)||""}getDisplayNameForColumnGroup(e,t){return this.columnModel.getDisplayNameForColumnGroup(e,t)||""}getColumn(e){return this.columnModel.getPrimaryColumn(e)}getColumns(){return this.columnModel.getAllPrimaryColumns()}applyColumnState(e){return this.columnModel.applyColumnState(e,"api")}getColumnState(){return this.columnModel.getColumnState()}resetColumnState(){this.columnModel.resetColumnState("api")}getColumnGroupState(){return this.columnModel.getColumnGroupState()}setColumnGroupState(e){this.columnModel.setColumnGroupState(e,"api")}resetColumnGroupState(){this.columnModel.resetColumnGroupState("api")}isPinning(){return this.columnModel.isPinningLeft()||this.columnModel.isPinningRight()}isPinningLeft(){return this.columnModel.isPinningLeft()}isPinningRight(){return this.columnModel.isPinningRight()}getDisplayedColAfter(e){return this.columnModel.getDisplayedColAfter(e)}getDisplayedColBefore(e){return this.columnModel.getDisplayedColBefore(e)}setColumnVisible(e,t){this.logDeprecation("v31.1","setColumnVisible(key,visible)","setColumnsVisible([key],visible)"),this.columnModel.setColumnsVisible([e],t,"api")}setColumnsVisible(e,t){this.columnModel.setColumnsVisible(e,t,"api")}setColumnPinned(e,t){this.logDeprecation("v31.1","setColumnPinned(key,pinned)","setColumnsPinned([key],pinned)"),this.columnModel.setColumnsPinned([e],t,"api")}setColumnsPinned(e,t){this.columnModel.setColumnsPinned(e,t,"api")}getAllGridColumns(){return this.columnModel.getAllGridColumns()}getDisplayedLeftColumns(){return this.columnModel.getDisplayedLeftColumns()}getDisplayedCenterColumns(){return this.columnModel.getDisplayedCenterColumns()}getDisplayedRightColumns(){return this.columnModel.getDisplayedRightColumns()}getAllDisplayedColumns(){return this.columnModel.getAllDisplayedColumns()}getAllDisplayedVirtualColumns(){return this.columnModel.getViewportColumns()}moveColumn(e,t){this.logDeprecation("v31.1","moveColumn(key, toIndex)","moveColumns([key], toIndex)"),this.columnModel.moveColumns([e],t,"api")}moveColumnByIndex(e,t){this.columnModel.moveColumnByIndex(e,t,"api")}moveColumns(e,t){this.columnModel.moveColumns(e,t,"api")}moveRowGroupColumn(e,t){this.columnModel.moveRowGroupColumn(e,t,"api")}setColumnAggFunc(e,t){this.columnModel.setColumnAggFunc(e,t,"api")}setColumnWidth(e,t,i=!0,n="api"){this.logDeprecation("v31.1","setColumnWidth(col, width)","setColumnWidths([{key: col, newWidth: width}])"),this.columnModel.setColumnWidths([{key:e,newWidth:t}],!1,i,n)}setColumnWidths(e,t=!0,i="api"){this.columnModel.setColumnWidths(e,!1,t,i)}isPivotMode(){return this.columnModel.isPivotMode()}getPivotResultColumn(e,t){return this.columnModel.getSecondaryPivotColumn(e,t)}setValueColumns(e){this.columnModel.setValueColumns(e,"api")}getValueColumns(){return this.columnModel.getValueColumns()}removeValueColumn(e){this.logDeprecation("v31.1","removeValueColumn(colKey)","removeValueColumns([colKey])"),this.columnModel.removeValueColumns([e],"api")}removeValueColumns(e){this.columnModel.removeValueColumns(e,"api")}addValueColumn(e){this.logDeprecation("v31.1","addValueColumn(colKey)","addValueColumns([colKey])"),this.columnModel.addValueColumns([e],"api")}addValueColumns(e){this.columnModel.addValueColumns(e,"api")}setRowGroupColumns(e){this.columnModel.setRowGroupColumns(e,"api")}removeRowGroupColumn(e){this.logDeprecation("v31.1","removeRowGroupColumn(colKey)","removeRowGroupColumns([colKey])"),this.columnModel.removeRowGroupColumns([e],"api")}removeRowGroupColumns(e){this.columnModel.removeRowGroupColumns(e,"api")}addRowGroupColumn(e){this.logDeprecation("v31.1","addRowGroupColumn(colKey)","addRowGroupColumns([colKey])"),this.columnModel.addRowGroupColumns([e],"api")}addRowGroupColumns(e){this.columnModel.addRowGroupColumns(e,"api")}getRowGroupColumns(){return this.columnModel.getRowGroupColumns()}setPivotColumns(e){this.columnModel.setPivotColumns(e,"api")}removePivotColumn(e){this.logDeprecation("v31.1","removePivotColumn(colKey)","removePivotColumns([colKey])"),this.columnModel.removePivotColumns([e],"api")}removePivotColumns(e){this.columnModel.removePivotColumns(e,"api")}addPivotColumn(e){this.logDeprecation("v31.1","addPivotColumn(colKey)","addPivotColumns([colKey])"),this.columnModel.addPivotColumns([e],"api")}addPivotColumns(e){this.columnModel.addPivotColumns(e,"api")}getPivotColumns(){return this.columnModel.getPivotColumns()}getLeftDisplayedColumnGroups(){return this.columnModel.getDisplayedTreeLeft()}getCenterDisplayedColumnGroups(){return this.columnModel.getDisplayedTreeCentre()}getRightDisplayedColumnGroups(){return this.columnModel.getDisplayedTreeRight()}getAllDisplayedColumnGroups(){return this.columnModel.getAllDisplayedTrees()}autoSizeColumn(e,t){return this.logDeprecation("v31.1","autoSizeColumn(key, skipHeader)","autoSizeColumns([key], skipHeader)"),this.columnModel.autoSizeColumns({columns:[e],skipHeader:t,source:"api"})}autoSizeColumns(e,t){this.columnModel.autoSizeColumns({columns:e,skipHeader:t,source:"api"})}autoSizeAllColumns(e){this.columnModel.autoSizeAllColumns("api",e)}setPivotResultColumns(e){this.columnModel.setSecondaryColumns(e,"api")}getPivotResultColumns(){return this.columnModel.getSecondaryColumns()}getState(){return this.stateService.getState()}getGridOption(e){return this.gos.get(e)}setGridOption(e,t){this.updateGridOptions({[e]:t})}updateGridOptions(e){this.gos.updateGridOptions({options:e})}__internalUpdateGridOptions(e,t){this.gos.updateGridOptions({options:e,force:t,source:"gridOptionsUpdated"})}deprecatedUpdateGridOption(e,t){z(`set${e.charAt(0).toUpperCase()}${e.slice(1,e.length)} is deprecated. Please use 'api.setGridOption('${e}', newValue)' or 'api.updateGridOptions({ ${e}: newValue })' instead.`),this.setGridOption(e,t)}setPivotMode(e){this.deprecatedUpdateGridOption("pivotMode",e)}setPinnedTopRowData(e){this.deprecatedUpdateGridOption("pinnedTopRowData",e)}setPinnedBottomRowData(e){this.deprecatedUpdateGridOption("pinnedBottomRowData",e)}setPopupParent(e){this.deprecatedUpdateGridOption("popupParent",e)}setSuppressModelUpdateAfterUpdateTransaction(e){this.deprecatedUpdateGridOption("suppressModelUpdateAfterUpdateTransaction",e)}setDataTypeDefinitions(e){this.deprecatedUpdateGridOption("dataTypeDefinitions",e)}setPagination(e){this.deprecatedUpdateGridOption("pagination",e)}paginationSetPageSize(e){this.deprecatedUpdateGridOption("paginationPageSize",e)}setSideBar(e){this.deprecatedUpdateGridOption("sideBar",e)}setSuppressClipboardPaste(e){this.deprecatedUpdateGridOption("suppressClipboardPaste",e)}setGroupRemoveSingleChildren(e){this.deprecatedUpdateGridOption("groupRemoveSingleChildren",e)}setGroupRemoveLowestSingleChildren(e){this.deprecatedUpdateGridOption("groupRemoveLowestSingleChildren",e)}setGroupDisplayType(e){this.deprecatedUpdateGridOption("groupDisplayType",e)}setGroupIncludeFooter(e){this.deprecatedUpdateGridOption("groupIncludeFooter",e)}setGroupIncludeTotalFooter(e){this.deprecatedUpdateGridOption("groupIncludeTotalFooter",e)}setRowClass(e){this.deprecatedUpdateGridOption("rowClass",e)}setDeltaSort(e){this.deprecatedUpdateGridOption("deltaSort",e)}setSuppressRowDrag(e){this.deprecatedUpdateGridOption("suppressRowDrag",e)}setSuppressMoveWhenRowDragging(e){this.deprecatedUpdateGridOption("suppressMoveWhenRowDragging",e)}setSuppressRowClickSelection(e){this.deprecatedUpdateGridOption("suppressRowClickSelection",e)}setEnableAdvancedFilter(e){this.deprecatedUpdateGridOption("enableAdvancedFilter",e)}setIncludeHiddenColumnsInAdvancedFilter(e){this.deprecatedUpdateGridOption("includeHiddenColumnsInAdvancedFilter",e)}setAdvancedFilterParent(e){this.deprecatedUpdateGridOption("advancedFilterParent",e)}setAdvancedFilterBuilderParams(e){this.deprecatedUpdateGridOption("advancedFilterBuilderParams",e)}setQuickFilter(e){z("setQuickFilter is deprecated. Please use 'api.setGridOption('quickFilterText', newValue)' or 'api.updateGridOptions({ quickFilterText: newValue })' instead."),this.gos.updateGridOptions({options:{quickFilterText:e}})}setExcludeHiddenColumnsFromQuickFilter(e){this.deprecatedUpdateGridOption("includeHiddenColumnsInQuickFilter",!e)}setIncludeHiddenColumnsInQuickFilter(e){this.deprecatedUpdateGridOption("includeHiddenColumnsInQuickFilter",e)}setQuickFilterParser(e){this.deprecatedUpdateGridOption("quickFilterParser",e)}setQuickFilterMatcher(e){this.deprecatedUpdateGridOption("quickFilterMatcher",e)}setAlwaysShowHorizontalScroll(e){this.deprecatedUpdateGridOption("alwaysShowHorizontalScroll",e)}setAlwaysShowVerticalScroll(e){this.deprecatedUpdateGridOption("alwaysShowVerticalScroll",e)}setFunctionsReadOnly(e){this.deprecatedUpdateGridOption("functionsReadOnly",e)}setColumnDefs(e,t="api"){z("setColumnDefs is deprecated. Please use 'api.setGridOption('columnDefs', newValue)' or 'api.updateGridOptions({ columnDefs: newValue })' instead."),this.gos.updateGridOptions({options:{columnDefs:e},source:t})}setAutoGroupColumnDef(e,t="api"){z("setAutoGroupColumnDef is deprecated. Please use 'api.setGridOption('autoGroupColumnDef', newValue)' or 'api.updateGridOptions({ autoGroupColumnDef: newValue })' instead."),this.gos.updateGridOptions({options:{autoGroupColumnDef:e},source:t})}setDefaultColDef(e,t="api"){z("setDefaultColDef is deprecated. Please use 'api.setGridOption('defaultColDef', newValue)' or 'api.updateGridOptions({ defaultColDef: newValue })' instead."),this.gos.updateGridOptions({options:{defaultColDef:e},source:t})}setColumnTypes(e,t="api"){z("setColumnTypes is deprecated. Please use 'api.setGridOption('columnTypes', newValue)' or 'api.updateGridOptions({ columnTypes: newValue })' instead."),this.gos.updateGridOptions({options:{columnTypes:e},source:t})}setTreeData(e){this.deprecatedUpdateGridOption("treeData",e)}setServerSideDatasource(e){this.deprecatedUpdateGridOption("serverSideDatasource",e)}setCacheBlockSize(e){this.deprecatedUpdateGridOption("cacheBlockSize",e)}setDatasource(e){this.deprecatedUpdateGridOption("datasource",e)}setViewportDatasource(e){this.deprecatedUpdateGridOption("viewportDatasource",e)}setRowData(e){this.deprecatedUpdateGridOption("rowData",e)}setEnableCellTextSelection(e){this.deprecatedUpdateGridOption("enableCellTextSelection",e)}setHeaderHeight(e){this.deprecatedUpdateGridOption("headerHeight",e)}setDomLayout(e){this.deprecatedUpdateGridOption("domLayout",e)}setFillHandleDirection(e){this.deprecatedUpdateGridOption("fillHandleDirection",e)}setGroupHeaderHeight(e){this.deprecatedUpdateGridOption("groupHeaderHeight",e)}setFloatingFiltersHeight(e){this.deprecatedUpdateGridOption("floatingFiltersHeight",e)}setPivotHeaderHeight(e){this.deprecatedUpdateGridOption("pivotHeaderHeight",e)}setPivotGroupHeaderHeight(e){this.deprecatedUpdateGridOption("pivotGroupHeaderHeight",e)}setAnimateRows(e){this.deprecatedUpdateGridOption("animateRows",e)}setIsExternalFilterPresent(e){this.deprecatedUpdateGridOption("isExternalFilterPresent",e)}setDoesExternalFilterPass(e){this.deprecatedUpdateGridOption("doesExternalFilterPass",e)}setNavigateToNextCell(e){this.deprecatedUpdateGridOption("navigateToNextCell",e)}setTabToNextCell(e){this.deprecatedUpdateGridOption("tabToNextCell",e)}setTabToNextHeader(e){this.deprecatedUpdateGridOption("tabToNextHeader",e)}setNavigateToNextHeader(e){this.deprecatedUpdateGridOption("navigateToNextHeader",e)}setRowGroupPanelShow(e){this.deprecatedUpdateGridOption("rowGroupPanelShow",e)}setGetGroupRowAgg(e){this.deprecatedUpdateGridOption("getGroupRowAgg",e)}setGetBusinessKeyForNode(e){this.deprecatedUpdateGridOption("getBusinessKeyForNode",e)}setGetChildCount(e){this.deprecatedUpdateGridOption("getChildCount",e)}setProcessRowPostCreate(e){this.deprecatedUpdateGridOption("processRowPostCreate",e)}setGetRowId(e){z("getRowId is a static property and can no longer be updated.")}setGetRowClass(e){this.deprecatedUpdateGridOption("getRowClass",e)}setIsFullWidthRow(e){this.deprecatedUpdateGridOption("isFullWidthRow",e)}setIsRowSelectable(e){this.deprecatedUpdateGridOption("isRowSelectable",e)}setIsRowMaster(e){this.deprecatedUpdateGridOption("isRowMaster",e)}setPostSortRows(e){this.deprecatedUpdateGridOption("postSortRows",e)}setGetDocument(e){this.deprecatedUpdateGridOption("getDocument",e)}setGetContextMenuItems(e){this.deprecatedUpdateGridOption("getContextMenuItems",e)}setGetMainMenuItems(e){this.deprecatedUpdateGridOption("getMainMenuItems",e)}setProcessCellForClipboard(e){this.deprecatedUpdateGridOption("processCellForClipboard",e)}setSendToClipboard(e){this.deprecatedUpdateGridOption("sendToClipboard",e)}setProcessCellFromClipboard(e){this.deprecatedUpdateGridOption("processCellFromClipboard",e)}setProcessPivotResultColDef(e){this.deprecatedUpdateGridOption("processPivotResultColDef",e)}setProcessPivotResultColGroupDef(e){this.deprecatedUpdateGridOption("processPivotResultColGroupDef",e)}setPostProcessPopup(e){this.deprecatedUpdateGridOption("postProcessPopup",e)}setInitialGroupOrderComparator(e){this.deprecatedUpdateGridOption("initialGroupOrderComparator",e)}setGetChartToolbarItems(e){this.deprecatedUpdateGridOption("getChartToolbarItems",e)}setPaginationNumberFormatter(e){this.deprecatedUpdateGridOption("paginationNumberFormatter",e)}setGetServerSideGroupLevelParams(e){this.deprecatedUpdateGridOption("getServerSideGroupLevelParams",e)}setIsServerSideGroupOpenByDefault(e){this.deprecatedUpdateGridOption("isServerSideGroupOpenByDefault",e)}setIsApplyServerSideTransaction(e){this.deprecatedUpdateGridOption("isApplyServerSideTransaction",e)}setIsServerSideGroup(e){this.deprecatedUpdateGridOption("isServerSideGroup",e)}setGetServerSideGroupKey(e){this.deprecatedUpdateGridOption("getServerSideGroupKey",e)}setGetRowStyle(e){this.deprecatedUpdateGridOption("getRowStyle",e)}setGetRowHeight(e){this.deprecatedUpdateGridOption("getRowHeight",e)}};f([ue("rowRenderer")],Oo.prototype,"rowRenderer",2),f([ue("navigationService")],Oo.prototype,"navigationService",2),f([ue("filterManager")],Oo.prototype,"filterManager",2),f([ue("columnModel")],Oo.prototype,"columnModel",2),f([ue("selectionService")],Oo.prototype,"selectionService",2),f([ue("gridOptionsService")],Oo.prototype,"gos",2),f([ue("valueService")],Oo.prototype,"valueService",2),f([ue("alignedGridsService")],Oo.prototype,"alignedGridsService",2),f([ue("eventService")],Oo.prototype,"eventService",2),f([ue("pinnedRowModel")],Oo.prototype,"pinnedRowModel",2),f([ue("context")],Oo.prototype,"context",2),f([ue("rowModel")],Oo.prototype,"rowModel",2),f([ue("sortController")],Oo.prototype,"sortController",2),f([ue("paginationProxy")],Oo.prototype,"paginationProxy",2),f([ue("focusService")],Oo.prototype,"focusService",2),f([ue("dragAndDropService")],Oo.prototype,"dragAndDropService",2),f([ue("menuService")],Oo.prototype,"menuService",2),f([ue("valueCache")],Oo.prototype,"valueCache",2),f([ue("animationFrameService")],Oo.prototype,"animationFrameService",2),f([ue("ctrlsService")],Oo.prototype,"ctrlsService",2),f([ue("overlayService")],Oo.prototype,"overlayService",2),f([ue("stateService")],Oo.prototype,"stateService",2),f([ue("expansionService")],Oo.prototype,"expansionService",2),f([ue("apiEventService")],Oo.prototype,"apiEventService",2),f([ue("frameworkOverrides")],Oo.prototype,"frameworkOverrides",2),f([ue("undoRedoService")],Oo.prototype,"undoRedoService",2),f([ue("rowNodeBlockLoader")],Oo.prototype,"rowNodeBlockLoader",2),f([de("csvCreator")],Oo.prototype,"csvCreator",2),f([de("excelCreator")],Oo.prototype,"excelCreator",2),f([de("rangeService")],Oo.prototype,"rangeService",2),f([de("clipboardService")],Oo.prototype,"clipboardService",2),f([de("aggFuncService")],Oo.prototype,"aggFuncService",2),f([de("statusBarService")],Oo.prototype,"statusBarService",2),f([de("chartService")],Oo.prototype,"chartService",2),f([de("ssrmTransactionManager")],Oo.prototype,"serverSideTransactionManager",2),f([de("sideBarService")],Oo.prototype,"sideBarService",2),f([le],Oo.prototype,"init",1),Oo=f([he("gridApi")],Oo);var Fo=class extends st{constructor(){super(...arguments),this.quickFilter=null,this.quickFilterParts=null}postConstruct(){this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PIVOT_MODE_CHANGED,()=>this.resetQuickFilterCache()),this.addManagedListener(this.eventService,ct.EVENT_NEW_COLUMNS_LOADED,()=>this.resetQuickFilterCache()),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.resetQuickFilterCache()),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_VISIBLE,()=>{this.gos.get("includeHiddenColumnsInQuickFilter")||this.resetQuickFilterCache()}),this.addManagedPropertyListener("quickFilterText",e=>this.setQuickFilter(e.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 null!==this.quickFilter}doesRowPassQuickFilter(e){const t=this.gos.get("cacheQuickFilter");return this.matcher?this.doesRowPassQuickFilterMatcher(t,e):this.quickFilterParts.every(i=>t?this.doesRowPassQuickFilterCache(e,i):this.doesRowPassQuickFilterNoCache(e,i))}resetQuickFilterCache(){this.rowModel.forEachNode(e=>e.quickFilterAggregateText=null)}setQuickFilterParts(){const{quickFilter:e,parser:t}=this;this.quickFilterParts=e?t?t(e):e.split(" "):null}parseQuickFilter(e){return b(e)?this.gos.isRowModelType("clientSide")?e.toUpperCase():(console.warn("AG Grid - Quick filtering only works with the Client-Side Row Model"),null):null}setQuickFilter(e){if(null!=e&&"string"!=typeof e)return void console.warn("AG Grid - Grid option quickFilterText only supports string inputs, received: "+typeof e);const t=this.parseQuickFilter(e);this.quickFilter!==t&&(this.quickFilter=t,this.setQuickFilterParts(),this.dispatchEvent({type:Fo.EVENT_QUICK_FILTER_CHANGED}))}setQuickFilterParserAndMatcher(){const e=this.gos.get("quickFilterParser"),t=this.gos.get("quickFilterMatcher"),i=e!==this.parser||t!==this.matcher;this.parser=e,this.matcher=t,i&&(this.setQuickFilterParts(),this.dispatchEvent({type:Fo.EVENT_QUICK_FILTER_CHANGED}))}onQuickFilterColumnConfigChanged(){this.columnModel.refreshQuickFilterColumns(),this.resetQuickFilterCache(),this.isQuickFilterPresent()&&this.dispatchEvent({type:Fo.EVENT_QUICK_FILTER_CHANGED})}doesRowPassQuickFilterNoCache(e,t){return this.columnModel.getAllColumnsForQuickFilter().some(i=>{const n=this.getQuickFilterTextForColumn(i,e);return b(n)&&n.indexOf(t)>=0})}doesRowPassQuickFilterCache(e,t){return this.checkGenerateQuickFilterAggregateText(e),e.quickFilterAggregateText.indexOf(t)>=0}doesRowPassQuickFilterMatcher(e,t){let i;e?(this.checkGenerateQuickFilterAggregateText(t),i=t.quickFilterAggregateText):i=this.getQuickFilterAggregateText(t);const{quickFilterParts:n,matcher:s}=this;return s(n,i)}checkGenerateQuickFilterAggregateText(e){e.quickFilterAggregateText||(e.quickFilterAggregateText=this.getQuickFilterAggregateText(e))}getQuickFilterTextForColumn(e,t){let i=this.valueService.getValue(e,t,!0);const n=e.getColDef();if(n.getQuickFilterText){const s=this.gos.addGridCommonParams({value:i,node:t,data:t.data,column:e,colDef:n});i=n.getQuickFilterText(s)}return b(i)?i.toString().toUpperCase():null}getQuickFilterAggregateText(e){const t=[];return this.columnModel.getAllColumnsForQuickFilter().forEach(i=>{const n=this.getQuickFilterTextForColumn(i,e);b(n)&&t.push(n)}),t.join(Fo.QUICK_FILTER_SEPARATOR)}};Fo.EVENT_QUICK_FILTER_CHANGED="quickFilterChanged",Fo.QUICK_FILTER_SEPARATOR="\n",f([ue("valueService")],Fo.prototype,"valueService",2),f([ue("columnModel")],Fo.prototype,"columnModel",2),f([ue("rowModel")],Fo.prototype,"rowModel",2),f([le],Fo.prototype,"postConstruct",1),Fo=f([he("quickFilterService")],Fo);var Go=class extends st{constructor(){super(...arguments),this.allColumnFilters=new Map,this.allColumnListeners=new Map,this.activeAggregateFilters=[],this.activeColumnFilters=[],this.processingFilterChange=!1,this.filterModelUpdateQueue=[],this.columnFilterModelUpdateQueue=[],this.advancedFilterModelUpdateQueue=[]}init(){var e,t,i;this.addManagedListener(this.eventService,ct.EVENT_GRID_COLUMNS_CHANGED,()=>this.onColumnsChanged()),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_VALUE_CHANGED,()=>this.refreshFiltersForAggregations()),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PIVOT_CHANGED,()=>this.refreshFiltersForAggregations()),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PIVOT_MODE_CHANGED,()=>this.refreshFiltersForAggregations()),this.addManagedListener(this.eventService,ct.EVENT_NEW_COLUMNS_LOADED,()=>this.updateAdvancedFilterColumns()),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_VISIBLE,()=>this.updateAdvancedFilterColumns()),this.addManagedListener(this.eventService,ct.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",e=>this.setAdvancedFilterModel(e.currentValue)),this.addManagedListener(this.eventService,ct.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,({enabled:e})=>this.onAdvancedFilterEnabledChanged(e)),this.addManagedListener(this.eventService,ct.EVENT_DATA_TYPES_INFERRED,()=>this.processFilterModelUpdateQueue()),this.addManagedListener(this.quickFilterService,Fo.EVENT_QUICK_FILTER_CHANGED,()=>this.onFilterChanged({source:"quickFilter"})),this.initialFilterModel=d({},null!=(i=null==(t=null==(e=this.gos.get("initialState"))?void 0:e.filter)?void 0:t.filterModel)?i:{})}isExternalFilterPresentCallback(){const e=this.gos.getCallback("isExternalFilterPresent");return"function"==typeof e&&e({})}doesExternalFilterPass(e){const t=this.gos.get("doesExternalFilterPass");return"function"==typeof t&&t(e)}setFilterModel(e,t="api"){if(this.isAdvancedFilterEnabled())return void this.warnAdvancedFilters();if(this.dataTypeService.isPendingInference())return void this.filterModelUpdateQueue.push({model:e,source:t});const i=[],n=this.getFilterModel();if(e){const t=ls(Object.keys(e));this.allColumnFilters.forEach((n,s)=>{const r=e[s];i.push(this.setModelOnFilterWrapper(n.filterPromise,r)),t.delete(s)}),t.forEach(t=>{const n=this.columnModel.getPrimaryColumn(t)||this.columnModel.getGridColumn(t);if(!n)return void console.warn("AG Grid: setFilterModel() - no column found for colId: "+t);if(!n.isFilterAllowed())return void console.warn("AG Grid: setFilterModel() - unable to fully apply model, filtering disabled for colId: "+t);const s=this.getOrCreateFilterWrapper(n,"NO_UI");s?i.push(this.setModelOnFilterWrapper(s.filterPromise,e[t])):console.warn("AG-Grid: setFilterModel() - unable to fully apply model, unable to create filter for colId: "+t)})}else this.allColumnFilters.forEach(e=>{i.push(this.setModelOnFilterWrapper(e.filterPromise,null))});us.all(i).then(()=>{const e=this.getFilterModel(),i=[];this.allColumnFilters.forEach((t,s)=>{const r=n?n[s]:null,o=e?e[s]:null;cs.jsonEquals(r,o)||i.push(t.column)}),i.length>0&&this.onFilterChanged({columns:i,source:t})})}setModelOnFilterWrapper(e,t){return new us(i=>{e.then(e=>{"function"!=typeof e.setModel&&(console.warn("AG Grid: filter missing setModel method, which is needed for setFilterModel"),i()),(e.setModel(t)||us.resolve()).then(()=>i())})})}getFilterModel(){const e={};return this.allColumnFilters.forEach((t,i)=>{const n=this.getModelFromFilterWrapper(t);b(n)&&(e[i]=n)}),e}getModelFromFilterWrapper(e){var t;const i=e.filterPromise.resolveNow(null,e=>e);return null==i?null!=(t=this.initialFilterModel[e.column.getColId()])?t:null:"function"!=typeof i.getModel?(console.warn("AG Grid: filter API missing getModel method, which is needed for getFilterModel"),null):i.getModel()}isColumnFilterPresent(){return this.activeColumnFilters.length>0}isAggregateFilterPresent(){return!!this.activeAggregateFilters.length}isExternalFilterPresent(){return this.externalFilterPresent}isChildFilterPresent(){return this.isColumnFilterPresent()||this.isQuickFilterPresent()||this.isExternalFilterPresent()||this.isAdvancedFilterPresent()}isAdvancedFilterPresent(){return this.isAdvancedFilterEnabled()&&this.advancedFilterService.isFilterPresent()}onAdvancedFilterEnabledChanged(e){var t;e?this.allColumnFilters.size&&(this.allColumnFilters.forEach(e=>this.disposeFilterWrapper(e,"advancedFilterEnabled")),this.onFilterChanged({source:"advancedFilter"})):(null==(t=this.advancedFilterService)?void 0:t.isFilterPresent())&&(this.advancedFilterService.setModel(null),this.onFilterChanged({source:"advancedFilter"}))}isAdvancedFilterEnabled(){var e;return!!(null==(e=this.advancedFilterService)?void 0:e.isEnabled())}isAdvancedFilterHeaderActive(){return this.isAdvancedFilterEnabled()&&this.advancedFilterService.isHeaderActive()}doAggregateFiltersPass(e,t){return this.doColumnFiltersPass(e,t,!0)}updateActiveFilters(){this.activeColumnFilters.length=0,this.activeAggregateFilters.length=0;const e=e=>!!e&&(e.isFilterActive?e.isFilterActive():(console.warn("AG Grid: Filter is missing isFilterActive() method"),!1)),t=!!this.gos.getGroupAggFiltering(),i=e=>{if(!e.isPrimary())return!0;const i=!this.columnModel.isPivotActive();return!(!e.isValueActive()||!i)&&(!!this.columnModel.isPivotMode()||t)};this.allColumnFilters.forEach(t=>{if(t.filterPromise.resolveNow(!1,e)){const e=t.filterPromise.resolveNow(null,e=>e);i(t.column)?this.activeAggregateFilters.push(e):this.activeColumnFilters.push(e)}})}updateFilterFlagInColumns(e,t){this.allColumnFilters.forEach(i=>{const n=i.filterPromise.resolveNow(!1,e=>e.isFilterActive());i.column.setFilterActive(n,e,t)})}isAnyFilterPresent(){return this.isQuickFilterPresent()||this.isColumnFilterPresent()||this.isAggregateFilterPresent()||this.isExternalFilterPresent()||this.isAdvancedFilterPresent()}doColumnFiltersPass(e,t,i){const{data:n,aggData:s}=e,r=i?this.activeAggregateFilters:this.activeColumnFilters,o=i?s:n;for(let i=0;i<r.length;i++){const n=r[i];if(null!=n&&n!==t){if("function"!=typeof n.doesFilterPass)throw new Error("Filter is missing method doesFilterPass");if(!n.doesFilterPass({node:e,data:o}))return!1}}return!0}resetQuickFilterCache(){this.quickFilterService.resetQuickFilterCache()}refreshFiltersForAggregations(){this.gos.getGroupAggFiltering()&&this.onFilterChanged()}callOnFilterChangedOutsideRenderCycle(e){const t=()=>this.onFilterChanged(e);this.rowRenderer.isRefreshInProgress()?setTimeout(t,0):t()}onFilterChanged(e={}){const{source:t,filterInstance:i,additionalEventAttributes:n,columns:s}=e;this.updateDependantFilters(),this.updateActiveFilters(),this.updateFilterFlagInColumns("filterChanged",n),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.allColumnFilters.forEach(e=>{e.filterPromise&&e.filterPromise.then(e=>{e&&e!==i&&e.onAnyFilterChanged&&e.onAnyFilterChanged()})});const r={source:t,type:ct.EVENT_FILTER_CHANGED,columns:s||[]};n&&O(r,n),this.processingFilterChange=!0,this.eventService.dispatchEvent(r),this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){var e;return!(null!=(e=this.gos.get("allowShowChangeAfterFilter"))&&e)&&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(e,t){return this.doesRowPassFilter({rowNode:t,filterInstanceToSkip:e})}doesRowPassAggregateFilters(e){return!(this.isAggregateQuickFilterPresent()&&!this.quickFilterService.doesRowPassQuickFilter(e.rowNode)||this.isAggregateFilterPresent()&&!this.doAggregateFiltersPass(e.rowNode,e.filterInstanceToSkip))}doesRowPassFilter(e){return!(this.isNonAggregateQuickFilterPresent()&&!this.quickFilterService.doesRowPassQuickFilter(e.rowNode)||this.isExternalFilterPresent()&&!this.doesExternalFilterPass(e.rowNode)||this.isColumnFilterPresent()&&!this.doColumnFiltersPass(e.rowNode,e.filterInstanceToSkip)||this.isAdvancedFilterPresent()&&!this.advancedFilterService.doesFilterPass(e.rowNode))}onNewRowsLoaded(e){this.allColumnFilters.forEach(e=>{e.filterPromise.then(e=>{e.onNewRowsLoaded&&e.onNewRowsLoaded()})}),this.updateFilterFlagInColumns(e,{afterDataChange:!0}),this.updateActiveFilters()}createValueGetter(e){return({node:t})=>this.valueService.getValue(e,t,!0)}createGetValue(e){return(t,i)=>{const n=i?this.columnModel.getGridColumn(i):e;return n?this.valueService.getValue(n,t,!0):void 0}}getFilterComponent(e,t,i=!0){var n;if(i)return(null==(n=this.getOrCreateFilterWrapper(e,t))?void 0:n.filterPromise)||null;const s=this.cachedFilter(e);return s?s.filterPromise:null}isFilterActive(e){const t=this.cachedFilter(e);return!!t&&t.filterPromise.resolveNow(!1,e=>e.isFilterActive())}getOrCreateFilterWrapper(e,t){if(!e.isFilterAllowed())return null;let i=this.cachedFilter(e);return i||(i=this.createFilterWrapper(e,t),this.setColumnFilterWrapper(e,i)),i}cachedFilter(e){return this.allColumnFilters.get(e.getColId())}getDefaultFilter(e){let t;if(re.__isRegistered("@ag-grid-enterprise/set-filter",this.context.getGridId()))t="agSetColumnFilter";else{const i=this.dataTypeService.getBaseDataType(e);t="number"===i?"agNumberColumnFilter":"date"===i||"dateString"===i?"agDateColumnFilter":"agTextColumnFilter"}return t}getDefaultFloatingFilter(e){let t;if(re.__isRegistered("@ag-grid-enterprise/set-filter",this.context.getGridId()))t="agSetColumnFloatingFilter";else{const i=this.dataTypeService.getBaseDataType(e);t="number"===i?"agNumberColumnFloatingFilter":"date"===i||"dateString"===i?"agDateColumnFloatingFilter":"agTextColumnFloatingFilter"}return t}createFilterInstance(e){const t=this.getDefaultFilter(e),i=e.getColDef();let n;const s=p(d({},this.createFilterParams(e,i)),{filterModifiedCallback:()=>this.filterModifiedCallbackFactory(n,e)(),filterChangedCallback:t=>this.filterChangedCallbackFactory(n,e)(t),doesRowPassOtherFilter:e=>this.doesRowPassOtherFilters(n,e)}),r=this.userComponentFactory.getFilterDetails(i,s,t);return r?{filterPromise:()=>{const e=r.newAgStackInstance();return e&&e.then(e=>n=e),e},compDetails:r}:{filterPromise:null,compDetails:null}}createFilterParams(e,t){return this.gos.addGridCommonParams({column:e,colDef:_(t),rowModel:this.rowModel,filterChangedCallback:()=>{},filterModifiedCallback:()=>{},valueGetter:this.createValueGetter(e),getValue:this.createGetValue(e),doesRowPassOtherFilter:()=>!0})}createFilterWrapper(e,t){var i;const n={column:e,filterPromise:null,compiledElement:null,compDetails:null},{filterPromise:s,compDetails:r}=this.createFilterInstance(e);return n.filterPromise=null!=(i=null==s?void 0:s())?i:null,n.compDetails=r,n}onColumnsChanged(){const e=[];this.allColumnFilters.forEach((t,i)=>{let n;n=t.column.isPrimary()?this.columnModel.getPrimaryColumn(i):this.columnModel.getGridColumn(i),n&&n===t.column||(e.push(t.column),this.disposeFilterWrapper(t,"columnChanged"),this.disposeColumnListener(i))}),e.length>0?this.onFilterChanged({columns:e,source:"api"}):this.updateDependantFilters()}updateDependantFilters(){const e=this.columnModel.getGroupAutoColumns();null==e||e.forEach(e=>{"agGroupColumnFilter"===e.getColDef().filter&&this.getOrCreateFilterWrapper(e,"NO_UI")})}isFilterAllowed(e){var t,i;if(this.isAdvancedFilterEnabled())return!1;if(!e.isFilterAllowed())return!1;const n=this.allColumnFilters.get(e.getColId());return null==(i=null==(t=null==n?void 0:n.filterPromise)?void 0:t.resolveNow(!0,e=>"function"!=typeof(null==e?void 0:e.isFilterAllowed)||(null==e?void 0:e.isFilterAllowed())))||i}getFloatingFilterCompDetails(e,t){const i=t=>{const i=this.getFilterComponent(e,"NO_UI");null!=i&&i.then(e=>{t(No(e))})},n=e.getColDef(),s=p(d({},this.createFilterParams(e,n)),{filterChangedCallback:()=>i(t=>this.filterChangedCallbackFactory(t,e)())}),r=this.userComponentFactory.mergeParamsWithApplicationProvidedParams(n,bo,s);let o=this.userComponentFactory.getDefaultFloatingFilterType(n,()=>this.getDefaultFloatingFilter(e));null==o&&(o="agReadOnlyFloatingFilter");const a={column:e,filterParams:r,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(e),parentFilterInstance:i,showParentFilter:t,suppressFilterButton:!1};return this.userComponentFactory.getFloatingFilterCompDetails(n,a,o)}getCurrentFloatingFilterParentModel(e){const t=this.getFilterComponent(e,"NO_UI",!1);return t?t.resolveNow(null,e=>e&&e.getModel()):null}destroyFilter(e,t="api"){const i=e.getColId(),n=this.allColumnFilters.get(i);this.disposeColumnListener(i),delete this.initialFilterModel[i],n&&(this.disposeFilterWrapper(n,t),this.onFilterChanged({columns:[e],source:"api"}))}disposeColumnListener(e){const t=this.allColumnListeners.get(e);t&&(this.allColumnListeners.delete(e),t())}disposeFilterWrapper(e,t){e.filterPromise.then(i=>{this.getContext().destroyBean(i),e.column.setFilterActive(!1,"filterDestroyed"),this.allColumnFilters.delete(e.column.getColId());const n={type:ct.EVENT_FILTER_DESTROYED,source:t,column:e.column};this.eventService.dispatchEvent(n)})}filterModifiedCallbackFactory(e,t){return()=>{const i={type:ct.EVENT_FILTER_MODIFIED,column:t,filterInstance:e};this.eventService.dispatchEvent(i)}}filterChangedCallbackFactory(e,t){return i=>{var n;const s=null!=(n=null==i?void 0:i.source)?n:"api",r={filter:e,additionalEventAttributes:i,columns:[t],source:s};this.callOnFilterChangedOutsideRenderCycle(r)}}checkDestroyFilter(e){const t=this.allColumnFilters.get(e);if(!t)return;const i=t.column,{compDetails:n}=i.isFilterAllowed()?this.createFilterInstance(i):{compDetails:null};if(this.areFilterCompsDifferent(t.compDetails,n))return void this.destroyFilter(i,"paramsUpdated");const s=i.getColDef().filterParams;t.filterPromise?t.filterPromise.then(e=>{!1===(!(null==e?void 0:e.refresh)||e.refresh(d(p(d({},this.createFilterParams(i,i.getColDef())),{filterModifiedCallback:this.filterModifiedCallbackFactory(e,i),filterChangedCallback:this.filterChangedCallbackFactory(e,i),doesRowPassOtherFilter:t=>this.doesRowPassOtherFilters(e,t)}),s)))&&this.destroyFilter(i,"paramsUpdated")}):this.destroyFilter(i,"paramsUpdated")}setColumnFilterWrapper(e,t){const i=e.getColId();this.allColumnFilters.set(i,t),this.allColumnListeners.set(i,this.addManagedListener(e,Se.EVENT_COL_DEF_CHANGED,()=>this.checkDestroyFilter(i)))}areFilterCompsDifferent(e,t){if(!t||!e)return!0;const{componentClass:i}=e,{componentClass:n}=t;return!(i===n||(null==i?void 0:i.render)&&(null==n?void 0:n.render)&&i.render===n.render)}getAdvancedFilterModel(){return this.isAdvancedFilterEnabled()?this.advancedFilterService.getModel():null}setAdvancedFilterModel(e){this.isAdvancedFilterEnabled()&&(this.dataTypeService.isPendingInference()?this.advancedFilterModelUpdateQueue.push(e):(this.advancedFilterService.setModel(null!=e?e:null),this.onFilterChanged({source:"advancedFilter"})))}showAdvancedFilterBuilder(e){this.isAdvancedFilterEnabled()&&this.advancedFilterService.getCtrl().toggleFilterBuilder(e,!0)}updateAdvancedFilterColumns(){this.isAdvancedFilterEnabled()&&this.advancedFilterService.updateValidity()&&this.onFilterChanged({source:"advancedFilter"})}hasFloatingFilters(){return!this.isAdvancedFilterEnabled()&&this.columnModel.getAllGridColumns().some(e=>e.getColDef().floatingFilter)}getFilterInstance(e,t){if(this.isAdvancedFilterEnabled())return void this.warnAdvancedFilters();const i=this.getFilterInstanceImpl(e,e=>{if(!t)return;const i=No(e);t(i)});return No(i)}getColumnFilterInstance(e){return new Promise(t=>{this.getFilterInstance(e,e=>{t(e)})})}getFilterInstanceImpl(e,t){const i=this.columnModel.getPrimaryColumn(e);if(!i)return;const n=this.getFilterComponent(i,"NO_UI"),s=n&&n.resolveNow(null,e=>e);return s?setTimeout(t,0,s):n&&n.then(e=>{t(e)}),s}warnAdvancedFilters(){z("Column Filter API methods have been disabled as Advanced Filters are enabled.")}setupAdvancedFilterHeaderComp(e){var t;null==(t=this.advancedFilterService)||t.getCtrl().setupHeaderComp(e)}getHeaderRowCount(){return this.isAdvancedFilterHeaderActive()?1:0}getHeaderHeight(){return this.isAdvancedFilterHeaderActive()?this.advancedFilterService.getCtrl().getHeaderHeight():0}processFilterModelUpdateQueue(){this.filterModelUpdateQueue.forEach(({model:e,source:t})=>this.setFilterModel(e,t)),this.filterModelUpdateQueue=[],this.columnFilterModelUpdateQueue.forEach(({key:e,model:t,resolve:i})=>{this.setColumnFilterModel(e,t).then(()=>i())}),this.columnFilterModelUpdateQueue=[],this.advancedFilterModelUpdateQueue.forEach(e=>this.setAdvancedFilterModel(e)),this.advancedFilterModelUpdateQueue=[]}getColumnFilterModel(e){const t=this.getFilterWrapper(e);return t?this.getModelFromFilterWrapper(t):null}setColumnFilterModel(e,t){if(this.isAdvancedFilterEnabled())return this.warnAdvancedFilters(),Promise.resolve();if(this.dataTypeService.isPendingInference()){let i=()=>{};const n=new Promise(e=>{i=e});return this.columnFilterModelUpdateQueue.push({key:e,model:t,resolve:i}),n}const i=this.columnModel.getPrimaryColumn(e),n=i?this.getOrCreateFilterWrapper(i,"NO_UI"):null;return n?(s=this.setModelOnFilterWrapper(n.filterPromise,t),new Promise(e=>{s.then(t=>e(t))})):Promise.resolve();var s}getFilterWrapper(e){var t;const i=this.columnModel.getPrimaryColumn(e);return i&&null!=(t=this.cachedFilter(i))?t:null}destroy(){super.destroy(),this.allColumnFilters.forEach(e=>this.disposeFilterWrapper(e,"gridDestroyed")),this.allColumnListeners.clear()}};f([ue("valueService")],Go.prototype,"valueService",2),f([ue("columnModel")],Go.prototype,"columnModel",2),f([ue("rowModel")],Go.prototype,"rowModel",2),f([ue("userComponentFactory")],Go.prototype,"userComponentFactory",2),f([ue("rowRenderer")],Go.prototype,"rowRenderer",2),f([ue("dataTypeService")],Go.prototype,"dataTypeService",2),f([ue("quickFilterService")],Go.prototype,"quickFilterService",2),f([de("advancedFilterService")],Go.prototype,"advancedFilterService",2),f([le],Go.prototype,"init",1),Go=f([he("filterManager")],Go);var Bo=class extends vs{constructor(e,t){super('<div class="ag-filter"></div>'),this.column=e,this.source=t,this.filterWrapper=null}postConstruct(){this.createFilter(!0),this.addManagedListener(this.eventService,ct.EVENT_FILTER_DESTROYED,this.onFilterDestroyed.bind(this))}hasFilter(){return!!this.filterWrapper}getFilter(){var e,t;return null!=(t=null==(e=this.filterWrapper)?void 0:e.filterPromise)?t:null}afterInit(){var e,t,i;return null!=(i=null==(t=null==(e=this.filterWrapper)?void 0:e.filterPromise)?void 0:t.then(()=>{}))?i:us.resolve()}afterGuiAttached(e){var t,i;null==(i=null==(t=this.filterWrapper)?void 0:t.filterPromise)||i.then(t=>{var i;null==(i=null==t?void 0:t.afterGuiAttached)||i.call(t,e)})}afterGuiDetached(){var e,t;null==(t=null==(e=this.filterWrapper)?void 0:e.filterPromise)||t.then(e=>{var t;null==(t=null==e?void 0:e.afterGuiDetached)||t.call(e)})}createFilter(e){var t;const{column:i,source:n}=this;this.filterWrapper=this.filterManager.getOrCreateFilterWrapper(i,n),(null==(t=this.filterWrapper)?void 0:t.filterPromise)&&this.filterWrapper.filterPromise.then(t=>{let s=t.getGui();if(b(s)||console.warn(`AG Grid: getGui method from filter returned ${s}, it should be a DOM element or an HTML template string.`),"string"==typeof s&&(s=En(s)),this.appendChild(s),e){const e={type:ct.EVENT_FILTER_OPENED,column:i,source:n,eGui:this.getGui()};this.eventService.dispatchEvent(e)}})}onFilterDestroyed(e){"api"!==e.source&&"paramsUpdated"!==e.source||e.column.getId()!==this.column.getId()||!this.columnModel.getPrimaryColumn(this.column)||(Cn(this.getGui()),this.createFilter())}destroy(){this.filterWrapper=null,super.destroy()}};f([ue("filterManager")],Bo.prototype,"filterManager",2),f([ue("columnModel")],Bo.prototype,"columnModel",2),f([le],Bo.prototype,"postConstruct",1);var Vo=class extends vs{constructor(e,t){super(e),this.ctrl=t}getCtrl(){return this.ctrl}},Ho=class e extends Vo{constructor(t){super(e.TEMPLATE,t)}postConstruct(){const e=this.getGui(),t={addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),addOrRemoveBodyCssClass:(e,t)=>this.eFloatingFilterBody.classList.toggle(e,t),setButtonWrapperDisplayed:e=>an(this.eButtonWrapper,e),setCompDetails:e=>this.setCompDetails(e),getFloatingFilterComp:()=>this.compPromise,setWidth:t=>e.style.width=t,setMenuIcon:e=>this.eButtonShowMainFilter.appendChild(e)};this.ctrl.setComp(t,e,this.eButtonShowMainFilter,this.eFloatingFilterBody)}setCompDetails(e){if(!e)return this.destroyFloatingFilterComp(),void(this.compPromise=null);this.compPromise=e.newAgStackInstance(),this.compPromise.then(e=>this.afterCompCreated(e))}destroyFloatingFilterComp(){this.floatingFilterComp&&(this.eFloatingFilterBody.removeChild(this.floatingFilterComp.getGui()),this.floatingFilterComp=this.destroyBean(this.floatingFilterComp))}afterCompCreated(e){e&&(this.isAlive()?(this.destroyFloatingFilterComp(),this.floatingFilterComp=e,this.eFloatingFilterBody.appendChild(e.getGui()),e.afterGuiAttached&&e.afterGuiAttached()):this.destroyBean(e))}};Ho.TEMPLATE='<div class="ag-header-cell ag-floating-filter" role="gridcell">\n            <div ref="eFloatingFilterBody" role="presentation"></div>\n            <div class="ag-floating-filter-button ag-hidden" ref="eButtonWrapper" role="presentation">\n                <button type="button" class="ag-button ag-floating-filter-button-button" ref="eButtonShowMainFilter" tabindex="-1"></button>\n            </div>\n        </div>',f([bs("eFloatingFilterBody")],Ho.prototype,"eFloatingFilterBody",2),f([bs("eButtonWrapper")],Ho.prototype,"eButtonWrapper",2),f([bs("eButtonShowMainFilter")],Ho.prototype,"eButtonShowMainFilter",2),f([le],Ho.prototype,"postConstruct",1),f([ce],Ho.prototype,"destroyFloatingFilterComp",1);var Uo=Ho,zo=class extends st{constructor(e){super(),this.view=e}postConstruct(){this.addManagedPropertyListener("domLayout",this.updateLayoutClasses.bind(this)),this.updateLayoutClasses()}updateLayoutClasses(){const e=this.getDomLayout(),t={autoHeight:"autoHeight"===e,normal:"normal"===e,print:"print"===e},i=t.autoHeight?"ag-layout-auto-height":t.print?"ag-layout-print":"ag-layout-normal";this.view.updateLayoutClasses(i,t)}getDomLayout(){var e;const t=null!=(e=this.gos.get("domLayout"))?e:"normal";return-1===["normal","print","autoHeight"].indexOf(t)?(z(`${t} is not valid for DOM Layout, valid values are 'normal', 'autoHeight', 'print'.`),"normal"):t}};f([le],zo.prototype,"postConstruct",1);var Wo=class extends st{constructor(e){super(),this.lastScrollSource=[null,null],this.scrollLeft=-1,this.nextScrollTop=-1,this.scrollTop=-1,this.lastOffsetHeight=-1,this.lastScrollTop=-1,this.eBodyViewport=e,this.resetLastHScrollDebounced=Q(()=>this.lastScrollSource[1]=null,500),this.resetLastVScrollDebounced=Q(()=>this.lastScrollSource[0]=null,500)}postConstruct(){this.enableRtl=this.gos.get("enableRtl"),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onDisplayedColumnsWidthChanged.bind(this)),this.ctrlsService.whenReady(e=>{this.centerRowsCtrl=e.center,this.onDisplayedColumnsWidthChanged(),this.addScrollListener()})}addScrollListener(){const{fakeHScrollComp:e,fakeVScrollComp:t}=this.ctrlsService.getParams();this.addManagedListener(this.centerRowsCtrl.getViewportElement(),"scroll",this.onHScroll.bind(this)),e.onScrollCallback(this.onFakeHScroll.bind(this));const i=this.gos.get("debounceVerticalScrollbar"),n=i?Q(this.onVScroll.bind(this),100):this.onVScroll.bind(this),s=i?Q(this.onFakeVScroll.bind(this),100):this.onFakeVScroll.bind(this);this.addManagedListener(this.eBodyViewport,"scroll",n),t.onScrollCallback(s)}onDisplayedColumnsWidthChanged(){this.enableRtl&&this.horizontallyScrollHeaderCenterAndFloatingCenter()}horizontallyScrollHeaderCenterAndFloatingCenter(e){if(null==this.centerRowsCtrl)return;void 0===e&&(e=this.centerRowsCtrl.getCenterViewportScrollLeft());const t=this.enableRtl?e:-e,{topCenter:i,stickyTopCenter:n,stickyBottomCenter:s,centerHeader:r,bottomCenter:o,fakeHScrollComp:a}=this.ctrlsService.getParams();r.setHorizontalScroll(-t),o.setContainerTranslateX(t),i.setContainerTranslateX(t),n.setContainerTranslateX(t),s.setContainerTranslateX(t);const l=this.centerRowsCtrl.getViewportElement(),c=0===this.lastScrollSource[1];e=Math.abs(e),c?a.setScrollPosition(e):bn(l,e,this.enableRtl)}isControllingScroll(e,t){return null==this.lastScrollSource[t]?(this.lastScrollSource[t]=e,!0):this.lastScrollSource[t]===e}onFakeHScroll(){this.isControllingScroll(1,1)&&this.onHScrollCommon(1)}onHScroll(){this.isControllingScroll(0,1)&&this.onHScrollCommon(0)}onHScrollCommon(e){const t=this.centerRowsCtrl.getViewportElement(),{scrollLeft:i}=t;if(this.shouldBlockScrollUpdate(1,i,!0))return;let n;n=0===e?vn(t,this.enableRtl):this.ctrlsService.get("fakeHScrollComp").getScrollPosition(),this.doHorizontalScroll(Math.round(n)),this.resetLastHScrollDebounced()}onFakeVScroll(){this.isControllingScroll(1,0)&&this.onVScrollCommon(1)}onVScroll(){this.isControllingScroll(0,0)&&this.onVScrollCommon(0)}onVScrollCommon(e){let t;t=0===e?this.eBodyViewport.scrollTop:this.ctrlsService.get("fakeVScrollComp").getScrollPosition(),this.shouldBlockScrollUpdate(0,t,!0)||(this.animationFrameService.setScrollTop(t),this.nextScrollTop=t,0===e?this.ctrlsService.get("fakeVScrollComp").setScrollPosition(t):this.eBodyViewport.scrollTop=t,this.gos.get("suppressAnimationFrame")?this.scrollGridIfNeeded():this.animationFrameService.schedule(),this.resetLastVScrollDebounced())}doHorizontalScroll(e){const t=this.ctrlsService.get("fakeHScrollComp").getScrollPosition();this.scrollLeft===e&&e===t||(this.scrollLeft=e,this.fireScrollEvent(1),this.horizontallyScrollHeaderCenterAndFloatingCenter(e),this.centerRowsCtrl.onHorizontalViewportChanged(!0))}fireScrollEvent(e){const t={type:ct.EVENT_BODY_SCROLL,direction:1===e?"horizontal":"vertical",left:this.scrollLeft,top:this.scrollTop};this.eventService.dispatchEvent(t),window.clearTimeout(this.scrollTimer),this.scrollTimer=void 0,this.scrollTimer=window.setTimeout(()=>{const e=p(d({},t),{type:ct.EVENT_BODY_SCROLL_END});this.eventService.dispatchEvent(e)},100)}shouldBlockScrollUpdate(e,t,i=!1){return!(i&&!Pi())&&(0===e?this.shouldBlockVerticalScroll(t):this.shouldBlockHorizontalScroll(t))}shouldBlockVerticalScroll(e){const t=dn(this.eBodyViewport),{scrollHeight:i}=this.eBodyViewport;return e<0||e+t>i}shouldBlockHorizontalScroll(e){const t=this.centerRowsCtrl.getCenterWidth(),{scrollWidth:i}=this.centerRowsCtrl.getViewportElement();if(this.enableRtl&&yn()){if(e>0)return!0}else if(e<0)return!0;return Math.abs(e)+t>i}redrawRowsAfterScroll(){this.fireScrollEvent(0)}checkScrollLeft(){this.scrollLeft!==this.centerRowsCtrl.getCenterViewportScrollLeft()&&this.onHScrollCommon(0)}scrollGridIfNeeded(){const e=this.scrollTop!=this.nextScrollTop;return e&&(this.scrollTop=this.nextScrollTop,this.redrawRowsAfterScroll()),e}setHorizontalScrollPosition(e,t=!1){const i=this.centerRowsCtrl.getViewportElement().scrollWidth-this.centerRowsCtrl.getCenterWidth();!t&&this.shouldBlockScrollUpdate(1,e)&&(e=this.enableRtl&&yn()?e>0?0:i:Math.min(Math.max(e,0),i)),bn(this.centerRowsCtrl.getViewportElement(),Math.abs(e),this.enableRtl),this.doHorizontalScroll(e)}setVerticalScrollPosition(e){this.eBodyViewport.scrollTop=e}getVScrollPosition(){return this.lastScrollTop=this.eBodyViewport.scrollTop,this.lastOffsetHeight=this.eBodyViewport.offsetHeight,{top:this.lastScrollTop,bottom:this.lastScrollTop+this.lastOffsetHeight}}getApproximateVScollPosition(){return this.lastScrollTop>=0&&this.lastOffsetHeight>=0?{top:this.scrollTop,bottom:this.scrollTop+this.lastOffsetHeight}:this.getVScrollPosition()}getHScrollPosition(){return this.centerRowsCtrl.getHScrollPosition()}isHorizontalScrollShowing(){return this.centerRowsCtrl.isHorizontalScrollShowing()}scrollHorizontally(e){const t=this.centerRowsCtrl.getViewportElement().scrollLeft;return this.setHorizontalScrollPosition(t+e),this.centerRowsCtrl.getViewportElement().scrollLeft-t}scrollToTop(){this.eBodyViewport.scrollTop=0}ensureNodeVisible(e,t=null){const i=this.rowModel.getRowCount();let n=-1;for(let t=0;t<i;t++){const i=this.rowModel.getRow(t);if("function"==typeof e){if(i&&e(i)){n=t;break}}else if(e===i||e===i.data){n=t;break}}n>=0&&this.ensureIndexVisible(n,t)}ensureIndexVisible(e,t){if(this.gos.isDomLayout("print"))return;const i=this.paginationProxy.getRowCount();if("number"!=typeof e||e<0||e>=i)return void console.warn("AG Grid: Invalid row index for ensureIndexVisible: "+e);const n=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.getFrameworkOverrides().wrapIncoming(()=>{n||this.paginationProxy.goToPageWithIndex(e);const i=this.ctrlsService.getGridBodyCtrl(),s=i.getStickyTopHeight(),r=i.getStickyBottomHeight(),o=this.paginationProxy.getRow(e);let a;do{const e=o.rowTop,i=o.rowHeight,n=this.paginationProxy.getPixelOffset(),l=o.rowTop-n,c=l+o.rowHeight,h=this.getVScrollPosition(),u=this.heightScaler.getDivStretchOffset(),d=h.top+u,p=h.bottom+u,g=p-d,f=this.heightScaler.getScrollPositionForPixel(l),m=this.heightScaler.getScrollPositionForPixel(c-g),y=Math.min((f+m)/2,l);let v=null;"top"===t?v=f:"bottom"===t?v=m:"middle"===t?v=y:d+s>l?v=f-s:p-r<c&&(v=m+r),null!==v&&(this.setVerticalScrollPosition(v),this.rowRenderer.redraw({afterScroll:!0})),a=e!==o.rowTop||i!==o.rowHeight}while(a);this.animationFrameService.flushAllFrames()})}ensureColumnVisible(e,t="auto"){const i=this.columnModel.getGridColumn(e);if(!i)return;if(i.isPinned())return;if(!this.columnModel.isColumnDisplayed(i))return;const n=this.getPositionedHorizontalScroll(i,t);this.getFrameworkOverrides().wrapIncoming(()=>{null!==n&&this.centerRowsCtrl.setCenterViewportScrollLeft(n),this.centerRowsCtrl.onHorizontalViewportChanged(),this.animationFrameService.flushAllFrames()})}setScrollPosition(e,t){this.getFrameworkOverrides().wrapIncoming(()=>{this.centerRowsCtrl.setCenterViewportScrollLeft(t),this.setVerticalScrollPosition(e),this.rowRenderer.redraw({afterScroll:!0}),this.animationFrameService.flushAllFrames()})}getPositionedHorizontalScroll(e,t){const{columnBeforeStart:i,columnAfterEnd:n}=this.isColumnOutsideViewport(e),s=this.centerRowsCtrl.getCenterWidth()<e.getActualWidth(),r=this.centerRowsCtrl.getCenterWidth(),o=this.enableRtl;let a=(o?i:n)||s,l=o?n:i;"auto"!==t&&(a="start"===t,l="end"===t);const c="middle"===t;if(a||l||c){const{colLeft:t,colMiddle:i,colRight:n}=this.getColumnBounds(e);return c?i-r/2:a?o?n:t:o?t-r:n-r}return null}isColumnOutsideViewport(e){const{start:t,end:i}=this.getViewportBounds(),{colLeft:n,colRight:s}=this.getColumnBounds(e),r=this.enableRtl;return{columnBeforeStart:r?t>s:i<s,columnAfterEnd:r?i<n:t>n}}getColumnBounds(e){const t=this.enableRtl,i=this.columnModel.getBodyContainerWidth(),n=e.getActualWidth(),s=e.getLeft(),r=t?-1:1,o=t?i-s:s;return{colLeft:o,colMiddle:o+n/2*r,colRight:o+n*r}}getViewportBounds(){const e=this.centerRowsCtrl.getCenterWidth(),t=this.centerRowsCtrl.getCenterViewportScrollLeft();return{start:t,end:e+t,width:e}}};f([ue("ctrlsService")],Wo.prototype,"ctrlsService",2),f([ue("animationFrameService")],Wo.prototype,"animationFrameService",2),f([ue("paginationProxy")],Wo.prototype,"paginationProxy",2),f([ue("rowModel")],Wo.prototype,"rowModel",2),f([ue("rowContainerHeightService")],Wo.prototype,"heightScaler",2),f([ue("rowRenderer")],Wo.prototype,"rowRenderer",2),f([ue("columnModel")],Wo.prototype,"columnModel",2),f([le],Wo.prototype,"postConstruct",1);var jo="ag-force-vertical-scroll",$o=class extends st{constructor(){super(...arguments),this.stickyTopHeight=0,this.stickyBottomHeight=0}getScrollFeature(){return this.bodyScrollFeature}getBodyViewportElement(){return this.eBodyViewport}setComp(e,t,i,n,s,r,o){this.comp=e,this.eGridBody=t,this.eBodyViewport=i,this.eTop=n,this.eBottom=s,this.eStickyTop=r,this.eStickyBottom=o,this.setCellTextSelection(this.gos.get("enableCellTextSelection")),this.addManagedPropertyListener("enableCellTextSelection",e=>this.setCellTextSelection(e.currentValue)),this.createManagedBean(new zo(this.comp)),this.bodyScrollFeature=this.createManagedBean(new Wo(this.eBodyViewport)),this.addRowDragListener(),this.setupRowAnimationCssClass(),this.addEventListeners(),this.addFocusListeners([n,i,s,r,o]),this.onGridColumnsChanged(),this.addBodyViewportListener(),this.setFloatingHeights(),this.disableBrowserDragging(),this.addStopEditingWhenGridLosesFocus(),this.filterManager.setupAdvancedFilterHeaderComp(n),this.ctrlsService.register("gridBodyCtrl",this)}getComp(){return this.comp}addEventListeners(){this.addManagedListener(this.eventService,ct.EVENT_GRID_COLUMNS_CHANGED,this.onGridColumnsChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_SCROLL_VISIBILITY_CHANGED,this.onScrollVisibilityChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_PINNED_ROW_DATA_CHANGED,this.onPinnedRowDataChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_HEADER_HEIGHT_CHANGED,this.onHeaderHeightChanged.bind(this))}addFocusListeners(e){e.forEach(e=>{this.addManagedListener(e,"focusin",t=>{const{target:i}=t,n=hn(i,"ag-root",e);e.classList.toggle("ag-has-focus",!n)}),this.addManagedListener(e,"focusout",t=>{const{target:i,relatedTarget:n}=t,s=e.contains(n),r=hn(n,"ag-root",e);hn(i,"ag-root",e)||s&&!r||e.classList.remove("ag-has-focus")})})}setColumnMovingCss(e){this.comp.setColumnMovingCss("ag-column-moving",e)}setCellTextSelection(e=!1){this.comp.setCellSelectableCss("ag-selectable",e)}onScrollVisibilityChanged(){const e=this.scrollVisibleService.isVerticalScrollShowing();this.setVerticalScrollPaddingVisible(e),this.setStickyWidth(e),this.setStickyBottomOffsetBottom();const t=`calc(100% + ${(e&&this.gos.getScrollbarWidth()||0)+(Vi()?16:0)}px)`;this.animationFrameService.requestAnimationFrame(()=>this.comp.setBodyViewportWidth(t))}onGridColumnsChanged(){const e=this.columnModel.getAllGridColumns();this.comp.setColumnCount(e.length)}disableBrowserDragging(){this.addManagedListener(this.eGridBody,"dragstart",e=>{if(e.target instanceof HTMLImageElement)return e.preventDefault(),!1})}addStopEditingWhenGridLosesFocus(){if(!this.gos.get("stopEditingWhenCellsLoseFocus"))return;const e=e=>{const i=e.relatedTarget;if(null===Li(i))return void this.rowRenderer.stopEditing();let n=t.some(e=>e.contains(i))&&this.mouseEventService.isElementInThisGrid(i);if(!n){const e=this.popupService;n=e.getActivePopups().some(e=>e.contains(i))||e.isElementWithinCustomPopup(i)}n||this.rowRenderer.stopEditing()},t=[this.eBodyViewport,this.eBottom,this.eTop,this.eStickyTop,this.eStickyBottom];t.forEach(t=>this.addManagedListener(t,"focusout",e))}updateRowCount(){const e=this.headerNavigationService.getHeaderRowCount()+this.filterManager.getHeaderRowCount(),t=this.rowModel.isLastRowIndexKnown()?this.rowModel.getRowCount():-1,i=-1===t?-1:e+t;this.comp.setRowCount(i)}registerBodyViewportResizeListener(e){this.comp.registerBodyViewportResizeListener(e)}setVerticalScrollPaddingVisible(e){const t=e?"scroll":"hidden";this.comp.setPinnedTopBottomOverflowY(t)}isVerticalScrollShowing(){const e=this.gos.get("alwaysShowVerticalScroll"),t=e?jo:null,i=this.gos.isDomLayout("normal");return this.comp.setAlwaysVerticalScrollClass(t,e),e||i&&Rn(this.eBodyViewport)}setupRowAnimationCssClass(){const e=()=>{const e=this.gos.isAnimateRows()&&!this.rowContainerHeightService.isStretching(),t=e?"ag-row-animation":"ag-row-no-animation";this.comp.setRowAnimationCssOnBodyViewport(t,e)};e(),this.addManagedListener(this.eventService,ct.EVENT_HEIGHT_SCALE_CHANGED,e),this.addManagedPropertyListener("animateRows",e)}getGridBodyElement(){return this.eGridBody}addBodyViewportListener(){const e=this.onBodyViewportContextMenu.bind(this);this.addManagedListener(this.eBodyViewport,"contextmenu",e),this.mockContextMenuForIPad(e),this.addManagedListener(this.eBodyViewport,"wheel",this.onBodyViewportWheel.bind(this)),this.addManagedListener(this.eStickyTop,"wheel",this.onStickyWheel.bind(this)),this.addManagedListener(this.eStickyBottom,"wheel",this.onStickyWheel.bind(this)),this.addFullWidthContainerWheelListener()}addFullWidthContainerWheelListener(){const e=this.eBodyViewport.querySelector(".ag-full-width-container"),t=this.eBodyViewport.querySelector(".ag-center-cols-viewport");e&&t&&this.addManagedListener(e,"wheel",e=>this.onFullWidthContainerWheel(e,t))}onFullWidthContainerWheel(e,t){!e.deltaX||Math.abs(e.deltaY)>Math.abs(e.deltaX)||!this.mouseEventService.isEventFromThisGrid(e)||(e.preventDefault(),t.scrollBy({left:e.deltaX}))}onBodyViewportContextMenu(e,t,i){if(!e&&!i)return;this.gos.get("preventDefaultOnContextMenu")&&(e||i).preventDefault();const{target:n}=e||t;n!==this.eBodyViewport&&n!==this.ctrlsService.get("center").getViewportElement()||this.menuService.showContextMenu({mouseEvent:e,touchEvent:i,value:null,anchorToElement:this.eGridBody})}mockContextMenuForIPad(e){if(!Pi())return;const t=new gr(this.eBodyViewport);this.addManagedListener(t,gr.EVENT_LONG_TAP,t=>{e(void 0,t.touchStart,t.touchEvent)}),this.addDestroyFunc(()=>t.destroy())}onBodyViewportWheel(e){this.gos.get("suppressScrollWhenPopupsAreOpen")&&this.popupService.hasAnchoredPopup()&&e.preventDefault()}onStickyWheel(e){e.preventDefault(),e.offsetY&&this.scrollVertically(e.deltaY)}getGui(){return this.eGridBody}scrollVertically(e){const t=this.eBodyViewport.scrollTop;return this.bodyScrollFeature.setVerticalScrollPosition(t+e),this.eBodyViewport.scrollTop-t}addRowDragListener(){this.rowDragFeature=this.createManagedBean(new ko(this.eBodyViewport)),this.dragAndDropService.addDropTarget(this.rowDragFeature)}getRowDragFeature(){return this.rowDragFeature}onPinnedRowDataChanged(){this.setFloatingHeights()}setFloatingHeights(){const{pinnedRowModel:e}=this;let t=e.getPinnedTopTotalHeight(),i=e.getPinnedBottomTotalHeight();this.comp.setTopHeight(t),this.comp.setBottomHeight(i),this.comp.setTopDisplay(t?"inherit":"none"),this.comp.setBottomDisplay(i?"inherit":"none"),this.setStickyTopOffsetTop(),this.setStickyBottomOffsetBottom()}setStickyTopHeight(e=0){this.comp.setStickyTopHeight(`${e}px`),this.stickyTopHeight=e}getStickyTopHeight(){return this.stickyTopHeight}setStickyBottomHeight(e=0){this.comp.setStickyBottomHeight(`${e}px`),this.stickyBottomHeight=e}getStickyBottomHeight(){return this.stickyBottomHeight}setStickyWidth(e){if(e){const e=this.gos.getScrollbarWidth();this.comp.setStickyTopWidth(`calc(100% - ${e}px)`),this.comp.setStickyBottomWidth(`calc(100% - ${e}px)`)}else this.comp.setStickyTopWidth("100%"),this.comp.setStickyBottomWidth("100%")}onHeaderHeightChanged(){this.setStickyTopOffsetTop()}setStickyTopOffsetTop(){const e=this.ctrlsService.get("gridHeaderCtrl").getHeaderHeight()+this.filterManager.getHeaderHeight(),t=this.pinnedRowModel.getPinnedTopTotalHeight();let i=0;e>0&&(i+=e),t>0&&(i+=t),i>0&&(i+=1),this.comp.setStickyTopTop(`${i}px`)}setStickyBottomOffsetBottom(){const e=this.pinnedRowModel.getPinnedBottomTotalHeight()+(this.scrollVisibleService.isHorizontalScrollShowing()&&this.gos.getScrollbarWidth()||0);this.comp.setStickyBottomBottom(`${e}px`)}sizeColumnsToFit(e,t){const i=this.isVerticalScrollShowing()?this.gos.getScrollbarWidth():0,n=pn(this.eGridBody)-i;n>0?this.columnModel.sizeColumnsToFit(n,"sizeColumnsToFit",!1,e):void 0===t?window.setTimeout(()=>{this.sizeColumnsToFit(e,100)},0):100===t?window.setTimeout(()=>{this.sizeColumnsToFit(e,500)},100):500===t?window.setTimeout(()=>{this.sizeColumnsToFit(e,-1)},500):console.warn("AG Grid: tried to call sizeColumnsToFit() but the grid is coming back with zero width, maybe the grid is not visible yet on the screen?")}addScrollEventListener(e){this.eBodyViewport.addEventListener("scroll",e,{passive:!0})}removeScrollEventListener(e){this.eBodyViewport.removeEventListener("scroll",e)}};f([ue("animationFrameService")],$o.prototype,"animationFrameService",2),f([ue("rowContainerHeightService")],$o.prototype,"rowContainerHeightService",2),f([ue("ctrlsService")],$o.prototype,"ctrlsService",2),f([ue("columnModel")],$o.prototype,"columnModel",2),f([ue("scrollVisibleService")],$o.prototype,"scrollVisibleService",2),f([ue("menuService")],$o.prototype,"menuService",2),f([ue("headerNavigationService")],$o.prototype,"headerNavigationService",2),f([ue("dragAndDropService")],$o.prototype,"dragAndDropService",2),f([ue("pinnedRowModel")],$o.prototype,"pinnedRowModel",2),f([ue("rowRenderer")],$o.prototype,"rowRenderer",2),f([ue("popupService")],$o.prototype,"popupService",2),f([ue("mouseEventService")],$o.prototype,"mouseEventService",2),f([ue("rowModel")],$o.prototype,"rowModel",2),f([ue("filterManager")],$o.prototype,"filterManager",2);var Ko="ag-cell-range-selected",Yo=class{constructor(e,t){this.beans=e,this.rangeService=e.rangeService,this.selectionHandleFactory=e.selectionHandleFactory,this.cellCtrl=t}setComp(e,t){this.cellComp=e,this.eGui=t,this.onRangeSelectionChanged()}onRangeSelectionChanged(){this.cellComp&&(this.rangeCount=this.rangeService.getCellRangeCount(this.cellCtrl.getCellPosition()),this.hasChartRange=this.getHasChartRange(),this.cellComp.addOrRemoveCssClass(Ko,0!==this.rangeCount),this.cellComp.addOrRemoveCssClass(`${Ko}-1`,1===this.rangeCount),this.cellComp.addOrRemoveCssClass(`${Ko}-2`,2===this.rangeCount),this.cellComp.addOrRemoveCssClass(`${Ko}-3`,3===this.rangeCount),this.cellComp.addOrRemoveCssClass(`${Ko}-4`,this.rangeCount>=4),this.cellComp.addOrRemoveCssClass("ag-cell-range-chart",this.hasChartRange),gi(this.eGui,this.rangeCount>0||void 0),this.cellComp.addOrRemoveCssClass("ag-cell-range-single-cell",this.isSingleCell()),this.updateRangeBorders(),this.refreshHandle())}updateRangeBorders(){const e=this.getRangeBorders(),t=this.isSingleCell(),i=!t&&e.top,n=!t&&e.right,s=!t&&e.bottom,r=!t&&e.left;this.cellComp.addOrRemoveCssClass("ag-cell-range-top",i),this.cellComp.addOrRemoveCssClass("ag-cell-range-right",n),this.cellComp.addOrRemoveCssClass("ag-cell-range-bottom",s),this.cellComp.addOrRemoveCssClass("ag-cell-range-left",r)}isSingleCell(){const{rangeService:e}=this.beans;return 1===this.rangeCount&&!!e&&!e.isMoreThanOneCell()}getHasChartRange(){const{rangeService:e}=this.beans;if(!this.rangeCount||!e)return!1;const t=e.getCellRanges();return t.length>0&&t.every(e=>He([1,0],e.type))}updateRangeBordersIfRangeCount(){this.rangeCount>0&&(this.updateRangeBorders(),this.refreshHandle())}getRangeBorders(){const e=this.beans.gos.get("enableRtl");let t=!1,i=!1,n=!1,s=!1;const r=this.cellCtrl.getCellPosition().column,o=this.beans.columnModel;let a,l;e?(a=o.getDisplayedColAfter(r),l=o.getDisplayedColBefore(r)):(a=o.getDisplayedColBefore(r),l=o.getDisplayedColAfter(r));const c=this.rangeService.getCellRanges().filter(e=>this.rangeService.isCellInSpecificRange(this.cellCtrl.getCellPosition(),e));a||(s=!0),l||(i=!0);for(let e=0;e<c.length&&!(t&&i&&n&&s);e++){const r=c[e],o=this.rangeService.getRangeStartRow(r),h=this.rangeService.getRangeEndRow(r);!t&&this.beans.rowPositionUtils.sameRow(o,this.cellCtrl.getCellPosition())&&(t=!0),!n&&this.beans.rowPositionUtils.sameRow(h,this.cellCtrl.getCellPosition())&&(n=!0),!s&&a&&r.columns.indexOf(a)<0&&(s=!0),!i&&l&&r.columns.indexOf(l)<0&&(i=!0)}return{top:t,right:i,bottom:n,left:s}}refreshHandle(){if(this.beans.context.isDestroyed())return;const e=this.shouldHaveSelectionHandle();this.selectionHandle&&!e&&(this.selectionHandle=this.beans.context.destroyBean(this.selectionHandle)),e&&this.addSelectionHandle(),this.cellComp.addOrRemoveCssClass("ag-cell-range-handle",!!this.selectionHandle)}shouldHaveSelectionHandle(){const e=this.beans.gos,t=this.rangeService.getCellRanges(),i=t.length;if(this.rangeCount<1||i<1)return!1;const n=Ie(t),s=this.cellCtrl.getCellPosition(),r=e.get("enableFillHandle")&&!this.cellCtrl.isSuppressFillHandle(),o=e.get("enableRangeHandle");let a=1===i&&!this.cellCtrl.isEditing()&&(r||o);if(this.hasChartRange){const e=1===t[0].type&&this.rangeService.isCellInSpecificRange(s,t[0]);this.cellComp.addOrRemoveCssClass("ag-cell-range-chart-category",e),a=0===n.type}return a&&null!=n.endRow&&this.rangeService.isContiguousRange(n)&&this.rangeService.isBottomRightCell(n,s)}addSelectionHandle(){const e=this.beans.gos,t=Ie(this.rangeService.getCellRanges()).type,i=e.get("enableFillHandle")&&C(t)?0:1;this.selectionHandle&&this.selectionHandle.getType()!==i&&(this.selectionHandle=this.beans.context.destroyBean(this.selectionHandle)),this.selectionHandle||(this.selectionHandle=this.selectionHandleFactory.createSelectionHandle(i)),this.selectionHandle.refresh(this.cellCtrl)}destroy(){this.beans.context.destroyBean(this.selectionHandle)}},qo=class extends st{constructor(e,t){super(),this.cellCtrl=e,this.beans=t,this.column=e.getColumn(),this.rowNode=e.getRowNode()}setupRowSpan(){this.rowSpan=this.column.getRowSpan(this.rowNode),this.addManagedListener(this.beans.eventService,ct.EVENT_NEW_COLUMNS_LOADED,()=>this.onNewColumnsLoaded())}setComp(e){this.eGui=e,this.setupColSpan(),this.setupRowSpan(),this.onLeftChanged(),this.onWidthChanged(),this.applyRowSpan()}onNewColumnsLoaded(){const e=this.column.getRowSpan(this.rowNode);this.rowSpan!==e&&(this.rowSpan=e,this.applyRowSpan(!0))}onDisplayColumnsChanged(){const e=this.getColSpanningList();Re(this.colsSpanning,e)||(this.colsSpanning=e,this.onWidthChanged(),this.onLeftChanged())}setupColSpan(){null!=this.column.getColDef().colSpan&&(this.colsSpanning=this.getColSpanningList(),this.addManagedListener(this.beans.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayColumnsChanged.bind(this)),this.addManagedListener(this.beans.eventService,ct.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onWidthChanged.bind(this)))}onWidthChanged(){if(!this.eGui)return;const e=this.getCellWidth();this.eGui.style.width=`${e}px`}getCellWidth(){return this.colsSpanning?this.colsSpanning.reduce((e,t)=>e+t.getActualWidth(),0):this.column.getActualWidth()}getColSpanningList(){const e=this.column.getColSpan(this.rowNode),t=[];if(1===e)t.push(this.column);else{let i=this.column;const n=this.column.getPinned();for(let s=0;i&&s<e&&(t.push(i),i=this.beans.columnModel.getDisplayedColAfter(i),i&&!C(i))&&n===i.getPinned();s++);}return t}onLeftChanged(){if(!this.eGui)return;const e=this.modifyLeftForPrintLayout(this.getCellLeft());this.eGui.style.left=e+"px"}getCellLeft(){let e;return e=this.beans.gos.get("enableRtl")&&this.colsSpanning?Ie(this.colsSpanning):this.column,e.getLeft()}modifyLeftForPrintLayout(e){if(!this.cellCtrl.isPrintLayout()||"left"===this.column.getPinned())return e;const t=this.beans.columnModel.getDisplayedColumnsLeftWidth();return"right"===this.column.getPinned()?t+this.beans.columnModel.getBodyContainerWidth()+(e||0):t+(e||0)}applyRowSpan(e){if(1===this.rowSpan&&!e)return;const t=this.beans.gos.getRowHeightAsNumber()*this.rowSpan;this.eGui.style.height=`${t}px`,this.eGui.style.zIndex="1"}destroy(){super.destroy()}},Xo=class extends st{constructor(e,t){super(),this.staticClasses=[],this.cellCtrl=e,this.beans=t,this.column=e.getColumn(),this.rowNode=e.getRowNode()}setComp(e){this.cellComp=e,this.applyUserStyles(),this.applyCellClassRules(),this.applyClassesFromColDef()}applyCellClassRules(){const e=this.column.getColDef(),{cellClassRules:t}=e,i=this.beans.gos.addGridCommonParams({value:this.cellCtrl.getValue(),data:this.rowNode.data,node:this.rowNode,colDef:e,column:this.column,rowIndex:this.rowNode.rowIndex});this.beans.stylingService.processClassRules(t===this.cellClassRules?void 0:this.cellClassRules,t,i,e=>this.cellComp.addOrRemoveCssClass(e,!0),e=>this.cellComp.addOrRemoveCssClass(e,!1)),this.cellClassRules=t}applyUserStyles(){const e=this.column.getColDef();if(!e.cellStyle)return;let t;if("function"==typeof e.cellStyle){const i=this.beans.gos.addGridCommonParams({column:this.column,value:this.cellCtrl.getValue(),colDef:e,data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex});t=(0,e.cellStyle)(i)}else t=e.cellStyle;t&&this.cellComp.setUserStyles(t)}applyClassesFromColDef(){const e=this.column.getColDef(),t=this.beans.gos.addGridCommonParams({value:this.cellCtrl.getValue(),data:this.rowNode.data,node:this.rowNode,column:this.column,colDef:e,rowIndex:this.rowNode.rowIndex});this.staticClasses.length&&this.staticClasses.forEach(e=>this.cellComp.addOrRemoveCssClass(e,!1)),this.staticClasses=this.beans.stylingService.getStaticCellClasses(e,t),this.staticClasses.length&&this.staticClasses.forEach(e=>this.cellComp.addOrRemoveCssClass(e,!0))}destroy(){super.destroy()}},Zo=class{postConstruct(){this.gos.isRowModelType("clientSide")&&(this.clientSideRowModel=this.rowModel),this.gos.isRowModelType("serverSide")&&(this.serverSideRowModel=this.rowModel)}};f([ue("resizeObserverService")],Zo.prototype,"resizeObserverService",2),f([ue("paginationProxy")],Zo.prototype,"paginationProxy",2),f([ue("context")],Zo.prototype,"context",2),f([ue("gridOptionsService")],Zo.prototype,"gos",2),f([ue("environment")],Zo.prototype,"environment",2),f([ue("rowRenderer")],Zo.prototype,"rowRenderer",2),f([ue("valueService")],Zo.prototype,"valueService",2),f([ue("eventService")],Zo.prototype,"eventService",2),f([ue("columnModel")],Zo.prototype,"columnModel",2),f([ue("headerNavigationService")],Zo.prototype,"headerNavigationService",2),f([ue("navigationService")],Zo.prototype,"navigationService",2),f([ue("columnAnimationService")],Zo.prototype,"columnAnimationService",2),f([ue("focusService")],Zo.prototype,"focusService",2),f([ue("popupService")],Zo.prototype,"popupService",2),f([ue("stylingService")],Zo.prototype,"stylingService",2),f([ue("columnHoverService")],Zo.prototype,"columnHoverService",2),f([ue("userComponentFactory")],Zo.prototype,"userComponentFactory",2),f([ue("userComponentRegistry")],Zo.prototype,"userComponentRegistry",2),f([ue("animationFrameService")],Zo.prototype,"animationFrameService",2),f([ue("dragService")],Zo.prototype,"dragService",2),f([ue("dragAndDropService")],Zo.prototype,"dragAndDropService",2),f([ue("sortController")],Zo.prototype,"sortController",2),f([ue("filterManager")],Zo.prototype,"filterManager",2),f([ue("rowContainerHeightService")],Zo.prototype,"rowContainerHeightService",2),f([ue("frameworkOverrides")],Zo.prototype,"frameworkOverrides",2),f([ue("cellPositionUtils")],Zo.prototype,"cellPositionUtils",2),f([ue("rowPositionUtils")],Zo.prototype,"rowPositionUtils",2),f([ue("selectionService")],Zo.prototype,"selectionService",2),f([ue("rowCssClassCalculator")],Zo.prototype,"rowCssClassCalculator",2),f([ue("rowModel")],Zo.prototype,"rowModel",2),f([ue("ctrlsService")],Zo.prototype,"ctrlsService",2),f([ue("ctrlsFactory")],Zo.prototype,"ctrlsFactory",2),f([ue("agStackComponentsRegistry")],Zo.prototype,"agStackComponentsRegistry",2),f([ue("valueCache")],Zo.prototype,"valueCache",2),f([ue("rowNodeEventThrottle")],Zo.prototype,"rowNodeEventThrottle",2),f([ue("localeService")],Zo.prototype,"localeService",2),f([ue("syncService")],Zo.prototype,"syncService",2),f([ue("ariaAnnouncementService")],Zo.prototype,"ariaAnnouncementService",2),f([de("rangeService")],Zo.prototype,"rangeService",2),f([de("selectionHandleFactory")],Zo.prototype,"selectionHandleFactory",2),f([le],Zo.prototype,"postConstruct",1),Zo=f([he("beans")],Zo);var Qo=class extends Zo{constructor(e,t,i){super(),this.cellCtrl=e,this.beans=t,this.column=i}onMouseEvent(e,t){if(!Xe(t))switch(e){case"click":this.onCellClicked(t);break;case"mousedown":case"touchstart":this.onMouseDown(t);break;case"dblclick":this.onCellDoubleClicked(t);break;case"mouseout":this.onMouseOut(t);break;case"mouseover":this.onMouseOver(t)}}onCellClicked(e){if(this.isDoubleClickOnIPad())return this.onCellDoubleClicked(e),void e.preventDefault();const{eventService:t,rangeService:i,gos:n}=this.beans,s=e.ctrlKey||e.metaKey;i&&s&&i.getCellRangeCount(this.cellCtrl.getCellPosition())>1&&i.intersectLastRange(!0);const r=this.cellCtrl.createEvent(e,ct.EVENT_CELL_CLICKED);t.dispatchEvent(r);const o=this.column.getColDef();o.onCellClicked&&window.setTimeout(()=>{this.beans.frameworkOverrides.wrapOutgoing(()=>{o.onCellClicked(r)})},0),!n.get("singleClickEdit")&&!o.singleClickEdit||n.get("suppressClickEdit")||e.shiftKey&&0!=(null==i?void 0:i.getCellRanges().length)||this.cellCtrl.startRowOrCellEdit()}isDoubleClickOnIPad(){if(!Pi()||Ze("dblclick"))return!1;const e=(new Date).getTime(),t=e-this.lastIPadMouseClickEvent<200;return this.lastIPadMouseClickEvent=e,t}onCellDoubleClicked(e){const t=this.column.getColDef(),i=this.cellCtrl.createEvent(e,ct.EVENT_CELL_DOUBLE_CLICKED);this.beans.eventService.dispatchEvent(i),"function"==typeof t.onCellDoubleClicked&&window.setTimeout(()=>{this.beans.frameworkOverrides.wrapOutgoing(()=>{t.onCellDoubleClicked(i)})},0),!this.beans.gos.get("singleClickEdit")&&!this.beans.gos.get("suppressClickEdit")&&this.cellCtrl.startRowOrCellEdit(null,e)}onMouseDown(e){const{ctrlKey:t,metaKey:i,shiftKey:n}=e,s=e.target,{cellCtrl:r,beans:o}=this,{eventService:a,rangeService:l,focusService:c}=o;if(this.isRightClickInExistingRange(e))return;const h=l&&0!=l.getCellRanges().length;if(!n||!h){const e=Ti()&&!r.isEditing()&&!on(s);r.focusCell(e)}if(n&&h&&!c.isCellFocused(r.getCellPosition())){e.preventDefault();const t=c.getFocusedCell();if(t){const{column:e,rowIndex:i,rowPinned:n}=t,s=o.rowRenderer.getRowByPosition({rowIndex:i,rowPinned:n}),r=null==s?void 0:s.getCellCtrl(e);(null==r?void 0:r.isEditing())&&r.stopEditing(),c.setFocusedCell({column:e,rowIndex:i,rowPinned:n,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}}if(!this.containsWidget(s)){if(l){const e=this.cellCtrl.getCellPosition();if(n)l.extendLatestRangeToCell(e);else{const n=t||i;l.setRangeToCell(e,n)}}a.dispatchEvent(this.cellCtrl.createEvent(e,ct.EVENT_CELL_MOUSE_DOWN))}}isRightClickInExistingRange(e){const{rangeService:t}=this.beans;if(t){const i=t.isCellInAnyRange(this.cellCtrl.getCellPosition()),n=2===e.button||e.ctrlKey&&this.beans.gos.get("allowContextMenuWithControlKey");if(i&&n)return!0}return!1}containsWidget(e){return hn(e,"ag-selection-checkbox",3)}onMouseOut(e){if(this.mouseStayingInsideCell(e))return;const t=this.cellCtrl.createEvent(e,ct.EVENT_CELL_MOUSE_OUT);this.beans.eventService.dispatchEvent(t),this.beans.columnHoverService.clearMouseOver()}onMouseOver(e){if(this.mouseStayingInsideCell(e))return;const t=this.cellCtrl.createEvent(e,ct.EVENT_CELL_MOUSE_OVER);this.beans.eventService.dispatchEvent(t),this.beans.columnHoverService.setMouseOver([this.column])}mouseStayingInsideCell(e){if(!e.target||!e.relatedTarget)return!1;const t=this.cellCtrl.getGui(),i=t.contains(e.target),n=t.contains(e.relatedTarget);return i&&n}destroy(){}},Jo=class extends st{constructor(e,t,i,n,s){super(),this.cellCtrl=e,this.beans=t,this.rowNode=n,this.rowCtrl=s}setComp(e){this.eGui=e}onKeyDown(e){const t=e.key;switch(t){case Zn.ENTER:this.onEnterKeyDown(e);break;case Zn.F2:this.onF2KeyDown(e);break;case Zn.ESCAPE:this.onEscapeKeyDown(e);break;case Zn.TAB:this.onTabKeyDown(e);break;case Zn.BACKSPACE:case Zn.DELETE:this.onBackspaceOrDeleteKeyDown(t,e);break;case Zn.DOWN:case Zn.UP:case Zn.RIGHT:case Zn.LEFT:this.onNavigationKeyDown(e,t)}}onNavigationKeyDown(e,t){this.cellCtrl.isEditing()||(e.shiftKey&&this.cellCtrl.isRangeSelectionEnabled()?this.onShiftRangeSelect(e):this.beans.navigationService.navigateToNextCell(e,t,this.cellCtrl.getCellPosition(),!0),e.preventDefault())}onShiftRangeSelect(e){if(!this.beans.rangeService)return;const t=this.beans.rangeService.extendLatestRangeInDirection(e);t&&this.beans.navigationService.ensureCellVisible(t)}onTabKeyDown(e){this.beans.navigationService.onTabKeyDown(this.cellCtrl,e)}onBackspaceOrDeleteKeyDown(e,t){var i;const{cellCtrl:n,beans:s,rowNode:r}=this,{gos:o,rangeService:a,eventService:l}=s;if(!n.isEditing()){if(l.dispatchEvent({type:ct.EVENT_KEY_SHORTCUT_CHANGED_CELL_START}),is(e,o.get("enableCellEditingOnBackspace"))){if(a&&o.get("enableRangeSelection"))a.clearCellRangeCellValues({dispatchWrapperEvents:!0,wrapperEventSource:"deleteKey"});else if(n.isCellEditable()){const e=n.getColumn(),t=null!=(i=this.beans.valueService.parseValue(e,r,"",r.getValueFromValueService(e)))?i:null;r.setDataValue(e,t,"cellClear")}}else n.startRowOrCellEdit(e,t);l.dispatchEvent({type:ct.EVENT_KEY_SHORTCUT_CHANGED_CELL_END})}}onEnterKeyDown(e){if(this.cellCtrl.isEditing()||this.rowCtrl.isEditing())this.cellCtrl.stopEditingAndFocus(!1,e.shiftKey);else if(this.beans.gos.get("enterNavigatesVertically")){const t=e.shiftKey?Zn.UP:Zn.DOWN;this.beans.navigationService.navigateToNextCell(null,t,this.cellCtrl.getCellPosition(),!1)}else this.cellCtrl.startRowOrCellEdit(Zn.ENTER,e),this.cellCtrl.isEditing()&&e.preventDefault()}onF2KeyDown(e){this.cellCtrl.isEditing()||this.cellCtrl.startRowOrCellEdit(Zn.F2,e)}onEscapeKeyDown(e){this.cellCtrl.isEditing()&&(this.cellCtrl.stopRowOrCellEdit(!0),this.cellCtrl.focusCell(!0))}processCharacter(e){if(e.target!==this.eGui||this.cellCtrl.isEditing())return;const t=e.key;" "===t?this.onSpaceKeyDown(e):(this.cellCtrl.startRowOrCellEdit(t,e),e.preventDefault())}onSpaceKeyDown(e){const{gos:t}=this.beans;if(!this.cellCtrl.isEditing()&&t.isRowSelection()){const i=this.rowNode.isSelected(),n=!i;if(n||!t.get("suppressRowDeselection")){const t=this.beans.gos.get("groupSelectsFiltered"),s=this.rowNode.setSelectedParams({newValue:n,rangeSelect:e.shiftKey,groupSelectsFiltered:t,event:e,source:"spaceKey"});void 0===i&&0===s&&this.rowNode.setSelectedParams({newValue:!1,rangeSelect:e.shiftKey,groupSelectsFiltered:t,event:e,source:"spaceKey"})}}e.preventDefault()}destroy(){super.destroy()}},ea=class extends vs{constructor(e,t,i){super('<div class="ag-drag-handle ag-row-drag" draggable="true"></div>'),this.rowNode=e,this.column=t,this.eCell=i}postConstruct(){this.getGui().appendChild(qn("rowDrag",this.gos,null)),this.addGuiEventListener("mousedown",e=>{e.stopPropagation()}),this.addDragSource(),this.checkVisibility()}addDragSource(){this.addGuiEventListener("dragstart",this.onDragStart.bind(this))}onDragStart(e){const t=this.column.getColDef().dndSourceOnRowDrag;e.dataTransfer.setDragImage(this.eCell,0,0);t?t(this.gos.addGridCommonParams({rowNode:this.rowNode,dragEvent:e})):(()=>{try{const t=JSON.stringify(this.rowNode.data);e.dataTransfer.setData("application/json",t),e.dataTransfer.setData("text/plain",t)}catch(e){}})()}checkVisibility(){const e=this.column.isDndSource(this.rowNode);this.setDisplayed(e)}};f([le],ea.prototype,"postConstruct",1);var ta=class{static getHeaderClassesFromColDef(e,t,i,n){return C(e)?[]:this.getColumnClassesFromCollDef(e.headerClass,e,t,i,n)}static getToolPanelClassesFromColDef(e,t,i,n){return C(e)?[]:this.getColumnClassesFromCollDef(e.toolPanelClass,e,t,i,n)}static refreshFirstAndLastStyles(e,t,i){e.addOrRemoveCssClass("ag-column-first",i.isColumnAtEdge(t,"first")),e.addOrRemoveCssClass("ag-column-last",i.isColumnAtEdge(t,"last"))}static getClassParams(e,t,i,n){return t.addGridCommonParams({colDef:e,column:i,columnGroup:n})}static getColumnClassesFromCollDef(e,t,i,n,s){if(C(e))return[];let r;return r="function"==typeof e?e(this.getClassParams(t,i,n,s)):e,"string"==typeof r?[r]:Array.isArray(r)?[...r]:[]}},ia=0,na=class e extends st{constructor(e,t,i,n){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=i,this.rowCtrl=n,this.instanceId=e.getId()+"-"+ia++,this.colIdSanitised=bt(this.column.getId()),i.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 qo(this,this.beans),this.addDestroyFunc(()=>{var e;null==(e=this.cellPositionFeature)||e.destroy(),this.cellPositionFeature=null}),this.cellCustomStyleFeature=new Xo(this,this.beans),this.addDestroyFunc(()=>{var e;null==(e=this.cellCustomStyleFeature)||e.destroy(),this.cellCustomStyleFeature=null}),this.cellMouseListenerFeature=new Qo(this,this.beans,this.column),this.addDestroyFunc(()=>{var e;null==(e=this.cellMouseListenerFeature)||e.destroy(),this.cellMouseListenerFeature=null}),this.cellKeyboardListenerFeature=new Jo(this,this.beans,this.column,this.rowNode,this.rowCtrl),this.addDestroyFunc(()=>{var e;null==(e=this.cellKeyboardListenerFeature)||e.destroy(),this.cellKeyboardListenerFeature=null}),this.column.isTooltipEnabled()&&(this.enableTooltipFeature(),this.addDestroyFunc(()=>{this.disableTooltipFeature()})),this.beans.rangeService&&this.beans.gos.get("enableRangeSelection")&&(this.cellRangeFeature=new Yo(this.beans,this),this.addDestroyFunc(()=>{var e;null==(e=this.cellRangeFeature)||e.destroy(),this.cellRangeFeature=null}))}enableTooltipFeature(e,t){const i="whenTruncated"===this.beans.gos.get("tooltipShowMode");t||!i||this.isCellRenderer()||(t=()=>{const e=this.getGui(),t=0===e.children.length?e:e.querySelector(".ag-cell-value");return!t||t.scrollWidth>t.clientWidth});const n={getColumn:()=>this.column,getColDef:()=>this.column.getColDef(),getRowIndex:()=>this.cellPosition.rowIndex,getRowNode:()=>this.rowNode,getGui:()=>this.getGui(),getLocation:()=>"cell",getTooltipValue:null!=e?()=>e:()=>{const e=this.column.getColDef(),t=this.rowNode.data;if(e.tooltipField&&b(t))return F(t,e.tooltipField,this.column.isTooltipFieldContainsDots());const i=e.tooltipValueGetter;return i?i(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},getValueFormatted:()=>this.valueFormatted,shouldDisplayTooltip:t};this.tooltipFeature=new fs(n,this.beans)}disableTooltipFeature(){this.tooltipFeature&&(this.tooltipFeature.destroy(),this.tooltipFeature=null)}setComp(e,t,i,n,s){var r,o,a,l;this.cellComp=e,this.eGui=t,this.printLayout=n,this.addDomData(),this.onCellFocused(this.focusEventToRestore),this.applyStaticCssClasses(),this.setWrapText(),this.onFirstRightPinnedChanged(),this.onLastLeftPinnedChanged(),this.onColumnHover(),this.setupControlComps(),this.setupAutoHeight(i),this.refreshFirstAndLastStyles(),this.refreshAriaColIndex(),null==(r=this.cellPositionFeature)||r.setComp(t),null==(o=this.cellCustomStyleFeature)||o.setComp(e),null==(a=this.tooltipFeature)||a.refreshToolTip(),null==(l=this.cellKeyboardListenerFeature)||l.setComp(this.eGui),this.cellRangeFeature&&this.cellRangeFeature.setComp(e,t),s&&this.isCellEditable()?this.startEditing():this.showValue(),this.onCellCompAttachedFuncs.length&&(this.onCellCompAttachedFuncs.forEach(e=>e()),this.onCellCompAttachedFuncs=[])}setupAutoHeight(e){if(this.isAutoHeight=this.column.isAutoHeight(),!this.isAutoHeight||!e)return;const t=e.parentElement,i=this.beans.gos.getRowHeightForNode(this.rowNode).height,n=s=>{if(this.editing)return;if(!this.isAlive())return;const{paddingTop:r,paddingBottom:o,borderBottomWidth:a,borderTopWidth:l}=un(t),c=r+o+a+l,h=e.offsetHeight+c;if(s<5){const t=this.beans.gos.getDocument();if(!t||!t.contains(e)||0==h)return void window.setTimeout(()=>n(s+1),0)}const u=Math.max(h,i);this.rowNode.setRowAutoHeight(u,this.column)},s=()=>n(0);s();const r=this.beans.resizeObserverService.observeResize(e,s);this.addDestroyFunc(()=>{r(),this.rowNode.setRowAutoHeight(void 0,this.column)})}getCellAriaRole(){var e;return null!=(e=this.column.getColDef().cellAriaRole)?e:"gridcell"}getInstanceId(){return this.instanceId}getColumnIdSanitised(){return this.colIdSanitised}getTabIndex(){return this.tabIndex}isCellRenderer(){const e=this.column.getColDef();return null!=e.cellRenderer||null!=e.cellRendererSelector}getValueToDisplay(){var e;return null!=(e=this.valueFormatted)?e:this.value}showValue(e=!1){var t;const i=this.getValueToDisplay();let n;if(this.rowNode.stub){const e=this.createCellRendererParams();n=this.beans.userComponentFactory.getLoadingCellRendererDetails(this.column.getColDef(),e)}else if(this.isCellRenderer()){const e=this.createCellRendererParams();n=this.beans.userComponentFactory.getCellRendererDetails(this.column.getColDef(),e)}this.cellComp.setRenderDetails(n,i,e),null==(t=this.cellRangeFeature)||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!(null!=this.rowNode.rowPinned||"function"!=typeof e&&!0!==e)}refreshShouldDestroy(){const e=this.column.getColDef(),t=this.includeSelection!=this.isIncludeControl(e.checkboxSelection),i=this.includeRowDrag!=this.isIncludeControl(e.rowDrag),n=this.includeDndSource!=this.isIncludeControl(e.dndSource),s=this.isAutoHeight!=this.column.isAutoHeight();return t||i||n||s}startEditing(e=null,t=!1,i=null){if(!this.isCellEditable()||this.editing)return;if(!this.cellComp)return void this.onCellCompAttachedFuncs.push(()=>{this.startEditing(e,t,i)});const n=this.createCellEditorParams(e,t),s=this.column.getColDef(),r=this.beans.userComponentFactory.getCellEditorDetails(s,n);this.editCompDetails=r;const o=null!=(null==r?void 0:r.popupFromSelector)?r.popupFromSelector:!!s.cellEditorPopup,a=null!=(null==r?void 0:r.popupPositionFromSelector)?r.popupPositionFromSelector:s.cellEditorPopupPosition;this.setEditing(!0),this.cellComp.setEditDetails(r,o,a,this.beans.gos.get("reactiveCustomComponents"));const l=this.createEvent(i,ct.EVENT_CELL_EDITING_STARTED);this.beans.eventService.dispatchEvent(l)}setEditing(e){var t;this.editing!==e&&(this.editing=e,null==(t=this.cellRangeFeature)||t.refreshHandle())}stopRowOrCellEdit(e=!1){"fullRow"===this.beans.gos.get("editType")?this.rowCtrl.stopEditing(e):this.stopEditing(e)}onPopupEditorClosed(){this.isEditing()&&this.stopEditingAndFocus()}takeValueFromCellEditor(e){const t={newValueExists:!1};if(e)return t;const i=this.cellComp.getCellEditor();return i?i.isCancelAfterEnd&&i.isCancelAfterEnd()?t:{newValue:i.getValue(),newValueExists:!0}:t}saveNewValue(e,t){if(t===e)return!1;this.suppressRefreshCell=!0;const i=this.rowNode.setDataValue(this.column,t,"edit");return this.suppressRefreshCell=!1,i}stopEditing(e=!1){if(!this.editing)return!1;const{newValue:t,newValueExists:i}=this.takeValueFromCellEditor(e),n=this.rowNode.getValueFromValueService(this.column);let s=!1;return i&&(s=this.saveNewValue(n,t)),this.setEditing(!1),this.cellComp.setEditDetails(),this.editCompDetails=void 0,this.updateAndFormatValue(!1),this.refreshCell({forceRefresh:!0,suppressFlash:!0}),this.dispatchEditingStoppedEvent(n,t,!e&&!!s),s}dispatchEditingStoppedEvent(e,t,i){const n=p(d({},this.createEvent(null,ct.EVENT_CELL_EDITING_STOPPED)),{oldValue:e,newValue:t,valueChanged:i});this.beans.eventService.dispatchEvent(n)}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:e=>this.beans.valueService.setValue(this.rowNode,this.column,e),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:(e,t,i,n)=>this.registerRowDragger(e,t,n),setTooltip:(e,t)=>{var i;this.tooltipFeature&&this.disableTooltipFeature(),this.enableTooltipFeature(e,t),null==(i=this.tooltipFeature)||i.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()?null==(t=this.rowCtrl)||t.recreateCell(this):this.refreshCell(e)}refreshCell(e){var t,i,n,s;if(this.suppressRefreshCell||this.editing)return;const r=this.column.getColDef(),o=null!=e&&!!e.newData,a=null!=e&&!!e.suppressFlash||!!r.suppressCellFlash,l=null==r.field&&null==r.valueGetter&&null==r.showRowGroup,c=e&&e.forceRefresh||l||o,h=!!this.cellComp,u=this.updateAndFormatValue(h);if(h){if(c||u){this.showValue(o);const e=this.beans.filterManager.isSuppressFlashingCellsBecauseFiltering();!a&&!e&&(this.beans.gos.get("enableCellChangeFlash")||r.enableCellChangeFlash)&&this.flashCell(),null==(t=this.cellCustomStyleFeature)||t.applyUserStyles(),null==(i=this.cellCustomStyleFeature)||i.applyClassesFromColDef()}null==(n=this.tooltipFeature)||n.refreshToolTip(),null==(s=this.cellCustomStyleFeature)||s.applyCellClassRules()}}stopEditingAndFocus(e=!1,t=!1){this.stopRowOrCellEdit(),this.focusCell(!0),e||this.navigateAfterEdit(t)}navigateAfterEdit(e){if(this.beans.gos.get("enterNavigatesVerticallyAfterEdit")){const t=e?Zn.UP:Zn.DOWN;this.beans.navigationService.navigateToNextCell(null,t,this.getCellPosition(),!1)}}flashCell(e){var t,i;const n=null!=(t=null==e?void 0:e.flashDuration)?t:null==e?void 0:e.flashDelay,s=null!=(i=null==e?void 0:e.fadeDuration)?i:null==e?void 0:e.fadeDelay;this.animateCell("data-changed",n,s)}animateCell(e,t,i){if(!this.cellComp)return;const n=`ag-cell-${e}`,s=`ag-cell-${e}-animation`,{gos:r}=this.beans;t||(t=r.get("cellFlashDuration")),b(i)||(i=r.get("cellFadeDuration")),this.cellComp.addOrRemoveCssClass(n,!0),this.cellComp.addOrRemoveCssClass(s,!1),this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{this.isAlive()&&(this.cellComp.addOrRemoveCssClass(n,!1),this.cellComp.addOrRemoveCssClass(s,!0),this.eGui.style.transition=`background-color ${i}ms`,window.setTimeout(()=>{this.isAlive()&&(this.cellComp.addOrRemoveCssClass(s,!1),this.eGui.style.transition="")},i))},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 null!=(t=this.callValueFormatter(e))?t:e}callValueFormatter(e){return this.beans.valueService.formatValue(this.column,this.rowNode,e)}updateAndFormatValue(e){const t=this.value,i=this.valueFormatted;return this.value=this.rowNode.getValueFromValueService(this.column),this.valueFormatted=this.callValueFormatter(this.value),!e||!this.valuesAreEqual(t,this.value)||this.valueFormatted!=i}valuesAreEqual(e,t){const i=this.column.getColDef();return i.equals?i.equals(e,t):e===t}getComp(){return this.cellComp}getValue(){return this.value}addDomData(){const t=this.getGui();this.beans.gos.setDomData(t,e.DOM_DATA_KEY_CELL_CTRL,this),this.addDestroyFunc(()=>this.beans.gos.setDomData(t,e.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;null==(t=this.cellKeyboardListenerFeature)||t.processCharacter(e)}onKeyDown(e){var t;null==(t=this.cellKeyboardListenerFeature)||t.onKeyDown(e)}onMouseEvent(e,t){var i;null==(i=this.cellMouseListenerFeature)||i.onMouseEvent(e,t)}getGui(){return this.eGui}getColSpanningList(){return this.cellPositionFeature.getColSpanningList()}onLeftChanged(){var e;this.cellComp&&(null==(e=this.cellPositionFeature)||e.onLeftChanged())}onDisplayedColumnsChanged(){this.eGui&&(this.refreshAriaColIndex(),this.refreshFirstAndLastStyles())}refreshFirstAndLastStyles(){const{cellComp:e,column:t,beans:i}=this;ta.refreshFirstAndLastStyles(e,t,i.columnModel)}refreshAriaColIndex(){const e=this.beans.columnModel.getAriaColumnIndex(this.column);hi(this.getGui(),e)}isSuppressNavigable(){return this.column.isSuppressNavigable(this.rowNode)}onWidthChanged(){var e;return null==(e=this.cellPositionFeature)?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){this.cellComp?"fullRow"===this.beans.gos.get("editType")?this.rowCtrl.startRowEditing(e,this):this.startEditing(e,!0,t):this.onCellCompAttachedFuncs.push(()=>{this.startRowOrCellEdit(e,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 null!=this.cellRangeFeature}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("ag-cell-first-right-pinned",e)}onLastLeftPinnedChanged(){if(!this.cellComp)return;const e=this.column.isLastLeftPinned();this.cellComp.addOrRemoveCssClass("ag-cell-last-left-pinned",e)}onCellFocused(e){if(this.beans.gos.get("suppressCellFocus"))return;const t=this.beans.focusService.isCellFocused(this.cellPosition);if(!this.cellComp)return void(t&&(null==e?void 0:e.forceBrowserFocus)&&(this.focusEventToRestore=e));this.focusEventToRestore=void 0,this.cellComp.addOrRemoveCssClass("ag-cell-focus",t),t&&e&&e.forceBrowserFocus&&this.cellComp.getFocusableElement().focus({preventScroll:!!e.preventScrollOnBrowserFocus});const i="fullRow"===this.beans.gos.get("editType");t||i||!this.editing||this.stopRowOrCellEdit(),t&&this.rowCtrl.announceDescription()}createCellPosition(){this.cellPosition={rowIndex:this.rowNode.rowIndex,rowPinned:v(this.rowNode.rowPinned),column:this.column}}applyStaticCssClasses(){this.cellComp.addOrRemoveCssClass("ag-cell",!0),this.cellComp.addOrRemoveCssClass("ag-cell-not-inline-editing",!0);const e=1==this.column.isAutoHeight();this.cellComp.addOrRemoveCssClass("ag-cell-auto-height",e),this.cellComp.addOrRemoveCssClass("ag-cell-normal-height",!e)}onColumnHover(){if(!this.cellComp)return;if(!this.beans.gos.get("columnHoverHighlight"))return;const e=this.beans.columnHoverService.isHovered(this.column);this.cellComp.addOrRemoveCssClass("ag-column-hover",e)}onColDefChanged(){if(this.cellComp)if(this.column.isTooltipEnabled()?(this.disableTooltipFeature(),this.enableTooltipFeature()):this.disableTooltipFeature(),this.setWrapText(),this.editing){const e=this.getCellEditor();if(null==e?void 0:e.refresh){const{eventKey:t,cellStartedEdit:i}=this.editCompDetails.params,n=this.createCellEditorParams(t,i),s=this.column.getColDef(),r=this.beans.userComponentFactory.getCellEditorDetails(s,n);e.refresh(r.params)}}else this.refreshOrDestroyCell({forceRefresh:!0,suppressFlash:!0})}setWrapText(){const e=1==this.column.getColDef().wrapText;this.cellComp.addOrRemoveCssClass("ag-cell-wrap-text",e)}dispatchCellContextMenuEvent(e){const t=this.column.getColDef(),i=this.createEvent(e,ct.EVENT_CELL_CONTEXT_MENU);this.beans.eventService.dispatchEvent(i),t.onCellContextMenu&&window.setTimeout(()=>{this.beans.frameworkOverrides.wrapOutgoing(()=>{t.onCellContextMenu(i)})},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 Pr;return this.beans.context.createBean(e),e.init({rowNode:this.rowNode,column:this.column}),e}createDndSource(){const e=new ea(this.rowNode,this.column,this.eGui);return this.beans.context.createBean(e),e}registerRowDragger(e,t,i){if(this.customRowDragComp)return void this.customRowDragComp.setDragElement(e,t);const n=this.createRowDragComp(e,t,i);n&&(this.customRowDragComp=n,this.addDestroyFunc(()=>{this.beans.context.destroyBean(n),this.customRowDragComp=null}))}createRowDragComp(e,t,i){const n=this.beans.gos.get("pagination"),s=this.beans.gos.get("rowDragManaged"),r=this.beans.gos.isRowModelType("clientSide");if(s){if(!r)return void z("managed row dragging is only allowed in the Client Side Row Model");if(n)return void z("managed row dragging is not possible when doing pagination")}const o=new Nr(()=>this.value,this.rowNode,this.column,e,t,i);return this.beans.context.createBean(o),o}};na.DOM_DATA_KEY_CELL_CTRL="cellCtrl";var sa=na,ra=0,oa=class e extends st{constructor(e,t,i,n,s){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=n,this.printLayout=s,this.suppressRowTransform=this.gos.get("suppressRowTransform"),this.instanceId=e.id+"-"+ra++,this.rowId=bt(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(i),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("function"!=typeof this.businessKeyForNodeFunc)return;const e=this.businessKeyForNodeFunc(this.rowNode);this.businessKeySanitised=bt(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,i){const n={rowComp:e,element:t,containerType:i};this.allRowGuis.push(n),"left"===i?this.leftGui=n:"right"===i?this.rightGui=n:"fullWidth"===i?this.fullWidthGui=n:this.centerGui=n,this.initialiseRowComp(n),"FullWidthLoading"===this.rowType||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}}isCacheable(){return"FullWidthDetail"===this.rowType&&this.gos.get("keepDetailRows")}setCached(e){const t=e?"none":"";this.allRowGuis.forEach(e=>e.element.style.display=t)}initialiseRowComp(t){const i=this.gos;this.listenOnDomOrder(t),this.beans.columnModel.wasAutoRowHeightEverActive()&&this.rowNode.checkAutoHeights(),this.onRowHeightChanged(t),this.updateRowIndexes(t),this.setFocusedClasses(t),this.setStylesFromGridOptions(!1,t),i.isRowSelection()&&this.rowNode.selectable&&this.onRowSelected(t),this.updateColumnLists(!this.useAnimationFrameForCreate);const n=t.rowComp;this.getInitialRowClasses(t.containerType).forEach(e=>n.addOrRemoveCssClass(e,!0)),this.executeSlideAndFadeAnimations(t),this.rowNode.group&&ii(t.element,1==this.rowNode.expanded),this.setRowCompRowId(n),this.setRowCompRowBusinessKey(n),i.setDomData(t.element,e.DOM_DATA_KEY_ROW_CTRL,this),this.addDestroyFunc(()=>i.setDomData(t.element,e.DOM_DATA_KEY_ROW_CTRL,null)),this.useAnimationFrameForCreate?this.beans.animationFrameService.createTask(this.addHoverFunctionality.bind(this,t.element),this.rowNode.rowIndex,"createTasksP2"):this.addHoverFunctionality(t.element),this.isFullWidth()&&this.setupFullWidth(t),i.get("rowDragEntireRow")&&this.addRowDraggerToRow(t),this.useAnimationFrameForCreate&&this.beans.animationFrameService.addDestroyTask(()=>{this.isAlive()&&t.rowComp.addOrRemoveCssClass("ag-after-created",!0)}),this.executeProcessRowPostCreateFunc()}setRowCompRowBusinessKey(e){null!=this.businessKeySanitised&&e.setRowBusinessKey(this.businessKeySanitised)}getBusinessKey(){return this.businessKeySanitised}setRowCompRowId(e){this.rowId=bt(this.rowNode.id),null!=this.rowId&&e.setRowId(this.rowId)}executeSlideAndFadeAnimations(e){const{containerType:t}=e;this.slideInAnimation[t]&&(X(()=>{this.onTopChanged()}),this.slideInAnimation[t]=!1),this.fadeInAnimation[t]&&(X(()=>{e.rowComp.addOrRemoveCssClass("ag-opacity-zero",!1)}),this.fadeInAnimation[t]=!1)}addRowDraggerToRow(e){if(this.gos.get("enableRangeSelection"))return void z("Setting `rowDragEntireRow: true` in the gridOptions doesn't work with `enableRangeSelection: true`");const t=this.beans.localeService.getLocaleTextFunc(),i=new Nr(()=>`1 ${t("rowDragRow","row")}`,this.rowNode,void 0,e.element,void 0,!0),n=this.createBean(i,this.beans.context);this.rowDragComps.push(n)}setupFullWidth(e){const t=this.getPinnedForContainer(e.containerType);if("FullWidthDetail"==this.rowType&&!re.__assertRegistered("@ag-grid-enterprise/master-detail","cell renderer 'agDetailCellRenderer' (for master detail)",this.beans.context.getGridId()))return;const i=this.createFullWidthCompDetails(e.element,t);e.rowComp.showFullWidth(i)}isPrintLayout(){return this.printLayout}getFullWidthCellRenderers(){var e,t;return this.gos.get("embedFullWidthRows")?this.allRowGuis.map(e=>{var t;return null==(t=null==e?void 0:e.rowComp)?void 0:t.getFullWidthCellRenderer()}):[null==(t=null==(e=this.fullWidthGui)?void 0:e.rowComp)?void 0:t.getFullWidthCellRenderer()]}getCellElement(e){const t=this.getCellCtrl(e);return t?t.getGui():null}executeProcessRowPostCreateFunc(){const e=this.gos.getCallback("processRowPostCreate");e&&this.areAllContainersReady()&&e({eRow:this.centerGui.element,ePinnedLeftRow:this.leftGui?this.leftGui.element:void 0,ePinnedRightRow:this.rightGui?this.rightGui.element:void 0,node:this.rowNode,rowIndex:this.rowNode.rowIndex,addRenderedRowListener:this.addEventListener.bind(this)})}areAllContainersReady(){const e=!!this.leftGui||!this.beans.columnModel.isPinningLeft(),t=!!this.centerGui,i=!!this.rightGui||!this.beans.columnModel.isPinningRight();return e&&t&&i}setRowType(){const e=this.rowNode.stub&&!this.gos.get("suppressServerSideFullWidthLoadingRow"),t=this.rowNode.isFullWidthCell(),i=this.gos.get("masterDetail")&&this.rowNode.detail,n=this.beans.columnModel.isPivotMode(),s=!!this.rowNode.group&&!this.rowNode.footer&&this.gos.isGroupUseEntireRow(n);this.rowType=e?"FullWidthLoading":i?"FullWidthDetail":t?"FullWidth":s?"FullWidthGroup":"Normal"}updateColumnLists(e=!1,t=!1){this.isFullWidth()||(e||this.gos.get("suppressAnimationFrame")||this.printLayout?this.updateColumnListsImpl(t):this.updateColumnListsPending||(this.beans.animationFrameService.createTask(()=>{this.active&&this.updateColumnListsImpl(!0)},this.rowNode.rowIndex,"createTasksP1"),this.updateColumnListsPending=!0))}createCellCtrls(e,t,i=null){const n={list:[],map:{}},s=(e,t)=>{n.list.push(t),n.map[e]=t};return t.forEach(t=>{const i=t.getInstanceId();let n=e.map[i];n||(n=new sa(t,this.rowNode,this.beans,this)),s(i,n)}),e.list.forEach(e=>{null==n.map[e.getColumn().getInstanceId()]&&(this.isCellEligibleToBeRemoved(e,i)?e.destroy():s(e.getColumn().getInstanceId(),e))}),n}updateColumnListsImpl(e){this.updateColumnListsPending=!1,this.createAllCellCtrls(),this.setCellCtrls(e)}setCellCtrls(e){this.allRowGuis.forEach(t=>{const i=this.getCellCtrlsForContainer(t.containerType);t.rowComp.setCellCtrls(i,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:throw new Error(`Unhandled case: ${e}`)}}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 i=e.getDisplayedLeftColumnsForRow(this.rowNode);this.leftCellCtrls=this.createCellCtrls(this.leftCellCtrls,i,"left");const n=e.getDisplayedRightColumnsForRow(this.rowNode);this.rightCellCtrls=this.createCellCtrls(this.rightCellCtrls,n,"right")}}isCellEligibleToBeRemoved(e,t){const i=!0;if(e.getColumn().getPinned()!=t)return i;const n=e.isEditing(),s=this.beans.focusService.isCellFocused(e.getCellPosition());if(n||s){const t=e.getColumn();return!(this.beans.columnModel.getAllDisplayedColumns().indexOf(t)>=0)&&i}return i}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=b(this.rowNode.oldRowTop),i=this.beans.columnModel.isPinningLeft(),n=this.beans.columnModel.isPinningRight();if(t){if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows"))return void(this.slideInAnimation.fullWidth=!0);this.slideInAnimation.center=!0,this.slideInAnimation.left=i,this.slideInAnimation.right=n}else{if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows"))return void(this.fadeInAnimation.fullWidth=!0);this.fadeInAnimation.center=!0,this.fadeInAnimation.left=i,this.fadeInAnimation.right=n}}isEditing(){return this.editingRow}isFullWidth(){return"Normal"!==this.rowType}refreshFullWidth(){const e=(e,t)=>!e||e.rowComp.refreshFullWidth(()=>this.createFullWidthCompDetails(e.element,t).params),t=e(this.fullWidthGui,null),i=e(this.centerGui,null),n=e(this.leftGui,"left"),s=e(this.rightGui,"right");return t&&i&&n&&s}addListeners(){this.addManagedListener(this.rowNode,kr.EVENT_HEIGHT_CHANGED,()=>this.onRowHeightChanged()),this.addManagedListener(this.rowNode,kr.EVENT_ROW_SELECTED,()=>this.onRowSelected()),this.addManagedListener(this.rowNode,kr.EVENT_ROW_INDEX_CHANGED,this.onRowIndexChanged.bind(this)),this.addManagedListener(this.rowNode,kr.EVENT_TOP_CHANGED,this.onTopChanged.bind(this)),this.addManagedListener(this.rowNode,kr.EVENT_EXPANDED_CHANGED,this.updateExpandedCss.bind(this)),this.addManagedListener(this.rowNode,kr.EVENT_HAS_CHILDREN_CHANGED,this.updateExpandedCss.bind(this)),this.rowNode.detail&&this.addManagedListener(this.rowNode.parent,kr.EVENT_DATA_CHANGED,this.onRowNodeDataChanged.bind(this)),this.addManagedListener(this.rowNode,kr.EVENT_DATA_CHANGED,this.onRowNodeDataChanged.bind(this)),this.addManagedListener(this.rowNode,kr.EVENT_CELL_CHANGED,this.postProcessCss.bind(this)),this.addManagedListener(this.rowNode,kr.EVENT_HIGHLIGHT_CHANGED,this.onRowNodeHighlightChanged.bind(this)),this.addManagedListener(this.rowNode,kr.EVENT_DRAGGING_CHANGED,this.postProcessRowDragging.bind(this)),this.addManagedListener(this.rowNode,kr.EVENT_UI_LEVEL_CHANGED,this.onUiLevelChanged.bind(this));const e=this.beans.eventService;this.addManagedListener(e,ct.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED,this.onPaginationPixelOffsetChanged.bind(this)),this.addManagedListener(e,ct.EVENT_HEIGHT_SCALE_CHANGED,this.onTopChanged.bind(this)),this.addManagedListener(e,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(e,ct.EVENT_VIRTUAL_COLUMNS_CHANGED,this.onVirtualColumnsChanged.bind(this)),this.addManagedListener(e,ct.EVENT_CELL_FOCUSED,this.onCellFocusChanged.bind(this)),this.addManagedListener(e,ct.EVENT_CELL_FOCUS_CLEARED,this.onCellFocusChanged.bind(this)),this.addManagedListener(e,ct.EVENT_PAGINATION_CHANGED,this.onPaginationChanged.bind(this)),this.addManagedListener(e,ct.EVENT_MODEL_UPDATED,this.refreshFirstAndLastRowStyles.bind(this)),this.addManagedListener(e,ct.EVENT_COLUMN_MOVED,this.updateColumnLists.bind(this)),this.addDestroyFunc(()=>{this.destroyBeans(this.rowDragComps,this.beans.context),this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature,this.beans.context))}),this.addManagedPropertyListeners(["rowDragEntireRow"],()=>{this.gos.get("rowDragEntireRow")?this.allRowGuis.forEach(e=>{this.addRowDraggerToRow(e)}):(this.destroyBeans(this.rowDragComps,this.beans.context),this.rowDragComps=[])}),this.addListenersForCellComps()}addListenersForCellComps(){this.addManagedListener(this.rowNode,kr.EVENT_ROW_INDEX_CHANGED,()=>{this.getAllCellCtrls().forEach(e=>e.onRowIndexChanged())}),this.addManagedListener(this.rowNode,kr.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);else{if(this.isFullWidth())return void(this.refreshFullWidth()||this.beans.rowRenderer.redrawRow(this.rowNode));this.getAllCellCtrls().forEach(t=>t.refreshCell({suppressFlash:!e.update,newData:!e.update})),this.allRowGuis.forEach(e=>{this.setRowCompRowId(e.rowComp),this.updateRowBusinessKey(),this.setRowCompRowBusinessKey(e.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 i=0===e,n=1===e;t.rowComp.addOrRemoveCssClass("ag-row-highlight-above",i),t.rowComp.addOrRemoveCssClass("ag-row-highlight-below",n)})}postProcessRowDragging(){const e=this.rowNode.dragging;this.allRowGuis.forEach(t=>t.rowComp.addOrRemoveCssClass("ag-row-dragging",e))}updateExpandedCss(){const e=this.rowNode.isExpandable(),t=1==this.rowNode.expanded;this.allRowGuis.forEach(i=>{i.rowComp.addOrRemoveCssClass("ag-row-group",e),i.rowComp.addOrRemoveCssClass("ag-row-group-expanded",e&&t),i.rowComp.addOrRemoveCssClass("ag-row-group-contracted",e&&!t),ii(i.element,e&&t)})}onDisplayedColumnsChanged(){this.updateColumnLists(!0),this.beans.columnModel.wasAutoRowHeightEverActive()&&this.rowNode.checkAutoHeights()}onVirtualColumnsChanged(){this.updateColumnLists(!1,!0)}getRowPosition(){return{rowPinned:v(this.rowNode.rowPinned),rowIndex:this.rowNode.rowIndex}}onKeyboardNavigate(e){const t=this.allRowGuis.find(t=>t.element.contains(e.target));if((t?t.element:null)!==e.target)return;const i=this.rowNode,n=this.beans.focusService.getFocusedCell(),s={rowIndex:i.rowIndex,rowPinned:i.rowPinned,column:n&&n.column};this.beans.navigationService.navigateToNextCell(e,e.key,s,!0),e.preventDefault()}onTabKeyDown(e){if(e.defaultPrevented||Xe(e))return;const t=this.allRowGuis.find(t=>t.element.contains(e.target)),i=t?t.element:null,n=i===e.target;let s=null;n||(s=this.beans.focusService.findNextFocusableElement(i,!1,e.shiftKey)),(this.isFullWidth()&&n||!s)&&this.beans.navigationService.onTabKeyDown(this,e)}getFullWidthElement(){return this.fullWidthGui?this.fullWidthGui.element:null}getRowYPosition(){var e;const t=null==(e=this.allRowGuis.find(e=>xn(e.element)))?void 0:e.element;return t?t.getBoundingClientRect().top:0}onFullWidthRowFocused(e){var t;const i=this.rowNode,n=!!e&&this.isFullWidth()&&e.rowIndex===i.rowIndex&&e.rowPinned==i.rowPinned,s=this.fullWidthGui?this.fullWidthGui.element:null==(t=this.centerGui)?void 0:t.element;s&&(s.classList.toggle("ag-full-width-focus",n),n&&s.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 i={list:[],map:{}};return e.list.forEach(e=>{e!==t&&(i.list.push(e),i.map[e.getColumn().getInstanceId()]=e)}),i}onMouseEvent(e,t){switch(e){case"dblclick":this.onRowDblClick(t);break;case"click":this.onRowClick(t);break;case"touchstart":case"mousedown":this.onRowMouseDown(t)}}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 i=this.createRowEvent(e,t);return i.source=this,i}onRowDblClick(e){if(Xe(e))return;const t=this.createRowEventWithSource(ct.EVENT_ROW_DOUBLE_CLICKED,e);this.beans.eventService.dispatchEvent(t)}onRowMouseDown(e){if(this.lastMouseDownOnDragger=hn(e.target,"ag-row-drag",3),!this.isFullWidth())return;const t=this.rowNode,i=this.beans.columnModel;this.beans.rangeService&&this.beans.rangeService.removeAllCellRanges(),this.beans.focusService.setFocusedCell({rowIndex:t.rowIndex,column:i.getAllDisplayedColumns()[0],rowPinned:t.rowPinned,forceBrowserFocus:!0})}onRowClick(e){if(Xe(e)||this.lastMouseDownOnDragger)return;const t=this.createRowEventWithSource(ct.EVENT_ROW_CLICKED,e);this.beans.eventService.dispatchEvent(t);const i=e.ctrlKey||e.metaKey,n=e.shiftKey;if(this.gos.get("groupSelectsChildren")&&this.rowNode.group||this.isRowSelectionBlocked()||this.gos.get("suppressRowClickSelection"))return;const s=this.gos.get("rowMultiSelectWithClick"),r=!this.gos.get("suppressRowDeselection"),o="rowClicked";if(this.rowNode.isSelected())s?this.rowNode.setSelectedParams({newValue:!1,event:e,source:o}):i?r&&this.rowNode.setSelectedParams({newValue:!1,event:e,source:o}):this.rowNode.setSelectedParams({newValue:!0,clearSelection:!n,rangeSelect:n,event:e,source:o});else{const t=!s&&!i;this.rowNode.setSelectedParams({newValue:!0,clearSelection:t,rangeSelect:n,event:e,source:o})}}isRowSelectionBlocked(){return!this.rowNode.selectable||!!this.rowNode.rowPinned||!this.gos.isRowSelection()}setupDetailRowAutoHeight(e){if("FullWidthDetail"!==this.rowType)return;if(!this.gos.get("detailRowAutoHeight"))return;const t=()=>{const t=e.clientHeight;if(null!=t&&t>0){const e=()=>{this.rowNode.setRowHeight(t),this.beans.clientSideRowModel?this.beans.clientSideRowModel.onRowHeightChanged():this.beans.serverSideRowModel&&this.beans.serverSideRowModel.onRowHeightChanged()};window.setTimeout(e,0)}},i=this.beans.resizeObserverService.observeResize(e,t);this.addDestroyFunc(i),t()}createFullWidthCompDetails(e,t){const i=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:(e,t,i,n)=>this.addFullWidthRowDragging(e,t,i,n),setTooltip:(e,t)=>this.refreshRowTooltip(e,t)});switch(this.rowType){case"FullWidthDetail":return this.beans.userComponentFactory.getFullWidthDetailCellRendererDetails(i);case"FullWidthGroup":return this.beans.userComponentFactory.getFullWidthGroupCellRendererDetails(i);case"FullWidthLoading":return this.beans.userComponentFactory.getFullWidthLoadingCellRendererDetails(i);default:return this.beans.userComponentFactory.getFullWidthCellRendererDetails(i)}}refreshRowTooltip(e,t){if(!this.fullWidthGui)return;const i={getGui:()=>this.fullWidthGui.element,getTooltipValue:()=>e,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:t};this.tooltipFeature&&this.destroyBean(this.tooltipFeature,this.beans.context),this.tooltipFeature=this.createBean(new fs(i,this.beans))}addFullWidthRowDragging(e,t,i="",n){if(!this.isFullWidth())return;const s=new Nr(()=>i,this.rowNode,void 0,e,t,n);this.createBean(s,this.beans.context),this.addDestroyFunc(()=>{this.destroyBean(s,this.beans.context)})}onUiLevelChanged(){const e=this.beans.rowCssClassCalculator.calculateRowLevel(this.rowNode);if(this.rowLevel!=e){const t="ag-row-level-"+e,i="ag-row-level-"+this.rowLevel;this.allRowGuis.forEach(e=>{e.rowComp.addOrRemoveCssClass(t,!0),e.rowComp.addOrRemoveCssClass(i,!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(t=>t.rowComp.addOrRemoveCssClass("ag-row-first",e))),this.lastRowOnPage!==t&&(this.lastRowOnPage=t,this.allRowGuis.forEach(e=>e.rowComp.addOrRemoveCssClass("ag-row-last",t)))}stopEditing(e=!1){if(this.stoppingRowEdit)return;const t=this.getAllCellCtrls(),i=this.editingRow;this.stoppingRowEdit=!0;let n=!1;for(const s of t){const t=s.stopEditing(e);i&&!e&&!n&&t&&(n=!0)}if(n){const e=this.createRowEvent(ct.EVENT_ROW_VALUE_CHANGED);this.beans.eventService.dispatchEvent(e)}i&&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(t=>t.rowComp.addOrRemoveCssClass("ag-row-editing",e));const t=e?this.createRowEvent(ct.EVENT_ROW_EDITING_STARTED):this.createRowEvent(ct.EVENT_ROW_EDITING_STOPPED);this.beans.eventService.dispatchEvent(t)}startRowEditing(e=null,t=null,i=null){this.editingRow||this.getAllCellCtrls().reduce((n,s)=>{const r=s===t;return r?s.startEditing(e,r,i):s.startEditing(null,r,i),!!n||s.isEditing()},!1)&&this.setEditingRow(!0)}getAllCellCtrls(){return 0===this.leftCellCtrls.list.length&&0===this.rightCellCtrls.list.length?this.centerCellCtrls.list:[...this.centerCellCtrls.list,...this.leftCellCtrls.list,...this.rightCellCtrls.list]}postProcessClassesFromGridOptions(){const e=this.beans.rowCssClassCalculator.processClassesFromGridOptions(this.rowNode);e&&e.length&&e.forEach(e=>{this.allRowGuis.forEach(t=>t.rowComp.addOrRemoveCssClass(e,!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,e=>e.rowComp.setUserStyles(this.rowStyles))}getPinnedForContainer(e){return"left"===e?"left":"right"===e?"right":null}getInitialRowClasses(e){const t=this.getPinnedForContainer(e),i={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(i)}processStylesFromGridOptions(){const e=this.gos.get("rowStyle");if(e&&"function"==typeof e)return void console.warn("AG Grid: rowStyle should be an object of key/value styles, not be a function, use getRowStyle() instead");const t=this.gos.getCallback("getRowStyle");let i;return t&&(i=t({data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex})),i||e?Object.assign({},e,i):this.emptyStyle}onRowSelected(e){const t=!!this.rowNode.isSelected();this.forEachGui(e,e=>{e.rowComp.addOrRemoveCssClass("ag-row-selected",t),gi(e.element,t),!e.element.contains(this.beans.gos.getActiveDomElement())||e!==this.centerGui&&e!==this.fullWidthGui||this.announceDescription()})}announceDescription(){if(this.isRowSelectionBlocked())return;const e=this.rowNode.isSelected();if(e&&this.beans.gos.get("suppressRowDeselection"))return;const t=this.beans.localeService.getLocaleTextFunc()(e?"ariaRowDeselect":"ariaRowSelect",`Press SPACE to ${e?"deselect":"select"} this row.`);this.beans.ariaAnnouncementService.announceValue(t)}addHoverFunctionality(e){this.active&&(this.addManagedListener(e,"mouseenter",()=>this.rowNode.onMouseEnter()),this.addManagedListener(e,"mouseleave",()=>this.rowNode.onMouseLeave()),this.addManagedListener(this.rowNode,kr.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,kr.EVENT_MOUSE_LEAVE,()=>{e.classList.remove("ag-row-hover"),this.rowNode.setHovered(!1)}))}roundRowTopToBounds(e){const t=this.beans.ctrlsService.getGridBodyCtrl().getScrollFeature().getApproximateVScollPosition(),i=this.applyPaginationOffset(t.top,!0)-100,n=this.applyPaginationOffset(t.bottom,!0)+100;return Math.min(Math.max(i,e),n)}getFrameworkOverrides(){return this.beans.frameworkOverrides}forEachGui(e,t){e?t(e):this.allRowGuis.forEach(t)}onRowHeightChanged(e){if(null==this.rowNode.rowHeight)return;const t=this.rowNode.rowHeight,i=this.beans.environment.getDefaultRowHeight(),n=this.gos.isGetRowHeightFunction()?this.gos.getRowHeightForNode(this.rowNode).height:void 0,s=n?Math.min(i,n)-2+"px":void 0;this.forEachGui(e,e=>{e.element.style.height=`${t}px`,s&&e.element.style.setProperty("--ag-line-height",s)})}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(null!=this.rowNode.rowTop){const e=this.roundRowTopToBounds(this.rowNode.rowTop);this.setRowTop(e)}else this.allRowGuis.forEach(e=>e.rowComp.addOrRemoveCssClass("ag-opacity-zero",!0));this.rowNode.setHovered(!1);const t=this.createRowEvent(ct.EVENT_VIRTUAL_ROW_REMOVED);this.dispatchEvent(t),this.beans.eventService.dispatchEvent(t),super.destroy()}destroySecondPass(){this.allRowGuis.length=0,this.stopEditing();const e=e=>(e.list.forEach(e=>e.destroy()),{list:[],map:{}});this.centerCellCtrls=e(this.centerCellCtrls),this.leftCellCtrls=e(this.leftCellCtrls),this.rightCellCtrls=e(this.rightCellCtrls)}setFocusedClasses(e){this.forEachGui(e,e=>{e.rowComp.addOrRemoveCssClass("ag-row-focus",this.rowFocused),e.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){return this.rowNode.isRowPinned()||this.rowNode.sticky?e:e+this.beans.paginationProxy.getPixelOffset()*(t?1:-1)}setRowTop(e){if(!this.printLayout&&b(e)){const t=this.applyPaginationOffset(e),i=`${this.rowNode.isRowPinned()||this.rowNode.sticky?t:this.beans.rowContainerHeightService.getRealPixelPosition(t)}px`;this.setRowTopStyle(i)}}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 i=this.slideInAnimation[e]?this.roundRowTopToBounds(this.rowNode.oldRowTop):this.rowNode.rowTop,n=this.applyPaginationOffset(i);t=this.rowNode.isRowPinned()?n:this.beans.rowContainerHeightService.getRealPixelPosition(n)}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(i=>{i.getColumn()==e&&(t=i)}),null!=t||this.getAllCellCtrls().forEach(i=>{i.getColSpanningList().indexOf(e)>=0&&(t=i)}),t}onRowIndexChanged(){null!=this.rowNode.rowIndex&&(this.onCellFocusChanged(),this.updateRowIndexes(),this.postProcessCss())}getRowIndex(){return this.rowNode.getRowIndexString()}updateRowIndexes(e){const t=this.rowNode.getRowIndexString(),i=this.beans.headerNavigationService.getHeaderRowCount()+this.beans.filterManager.getHeaderRowCount(),n=this.rowNode.rowIndex%2==0,s=i+this.rowNode.rowIndex+1;this.forEachGui(e,e=>{e.rowComp.setRowIndex(t),e.rowComp.addOrRemoveCssClass("ag-row-even",n),e.rowComp.addOrRemoveCssClass("ag-row-odd",!n),li(e.element,s)})}};oa.DOM_DATA_KEY_ROW_CTRL="renderedRow";var aa=oa,la=class extends st{constructor(e){super(),this.element=e}postConstruct(){this.addKeyboardListeners(),this.addMouseListeners(),this.mockContextMenuForIPad()}addKeyboardListeners(){const e="keydown",t=this.processKeyboardEvent.bind(this,e);this.addManagedListener(this.element,e,t)}addMouseListeners(){["dblclick","contextmenu","mouseover","mouseout","click",Ze("touchstart")?"touchstart":"mousedown"].forEach(e=>{const t=this.processMouseEvent.bind(this,e);this.addManagedListener(this.element,e,t)})}processMouseEvent(e,t){if(!this.mouseEventService.isEventFromThisGrid(t)||Xe(t))return;const i=this.getRowForEvent(t),n=this.mouseEventService.getRenderedCellForEvent(t);"contextmenu"===e?this.handleContextMenuMouseEvent(t,void 0,i,n):(n&&n.onMouseEvent(e,t),i&&i.onMouseEvent(e,t))}mockContextMenuForIPad(){if(!Pi())return;const e=new gr(this.element);this.addManagedListener(e,gr.EVENT_LONG_TAP,e=>{const t=this.getRowForEvent(e.touchEvent),i=this.mouseEventService.getRenderedCellForEvent(e.touchEvent);this.handleContextMenuMouseEvent(void 0,e.touchEvent,t,i)}),this.addDestroyFunc(()=>e.destroy())}getRowForEvent(e){let t=e.target;for(;t;){const e=this.gos.getDomData(t,aa.DOM_DATA_KEY_ROW_CTRL);if(e)return e;t=t.parentElement}return null}handleContextMenuMouseEvent(e,t,i,n){const s=i?i.getRowNode():null,r=n?n.getColumn():null;let o=null;if(r){const i=e||t;n.dispatchCellContextMenuEvent(null!=i?i:null),o=this.valueService.getValue(r,s)}const a=this.ctrlsService.getGridBodyCtrl(),l=n?n.getGui():a.getGridBodyElement();this.menuService.showContextMenu({mouseEvent:e,touchEvent:t,rowNode:s,column:r,value:o,anchorToElement:l})}getControlsForEventTarget(e){return{cellCtrl:Qe(this.gos,e,sa.DOM_DATA_KEY_CELL_CTRL),rowCtrl:Qe(this.gos,e,aa.DOM_DATA_KEY_ROW_CTRL)}}processKeyboardEvent(e,t){const{cellCtrl:i,rowCtrl:n}=this.getControlsForEventTarget(t.target);t.defaultPrevented||(i?this.processCellKeyboardEvent(i,e,t):n&&n.isFullWidth()&&this.processFullWidthRowKeyboardEvent(n,e,t))}processCellKeyboardEvent(e,t,i){const n=e.getRowNode(),s=e.getColumn(),r=e.isEditing();if(Jn(this.gos,i,n,s,r)||"keydown"!==t||(!r&&this.navigationService.handlePageScrollingKey(i)||e.onKeyDown(i),this.doGridOperations(i,e.isEditing()),Qn(i)&&e.processCharacter(i)),"keydown"===t){const t=e.createEvent(i,ct.EVENT_CELL_KEY_DOWN);this.eventService.dispatchEvent(t)}}processFullWidthRowKeyboardEvent(e,t,i){const n=e.getRowNode(),s=this.focusService.getFocusedCell(),r=s&&s.column;if(!Jn(this.gos,i,n,r,!1)){const n=i.key;if("keydown"===t)switch(n){case Zn.PAGE_HOME:case Zn.PAGE_END:case Zn.PAGE_UP:case Zn.PAGE_DOWN:this.navigationService.handlePageScrollingKey(i,!0);break;case Zn.UP:case Zn.DOWN:e.onKeyboardNavigate(i);break;case Zn.TAB:e.onTabKeyDown(i)}}if("keydown"===t){const t=e.createRowEvent(ct.EVENT_CELL_KEY_DOWN,i);this.eventService.dispatchEvent(t)}}doGridOperations(e,t){if(!e.ctrlKey&&!e.metaKey)return;if(t)return;if(!this.mouseEventService.isEventFromThisGrid(e))return;const i=ts(e);return i===Zn.A?this.onCtrlAndA(e):i===Zn.C?this.onCtrlAndC(e):i===Zn.D?this.onCtrlAndD(e):i===Zn.V?this.onCtrlAndV(e):i===Zn.X?this.onCtrlAndX(e):i===Zn.Y?this.onCtrlAndY():i===Zn.Z?this.onCtrlAndZ(e):void 0}onCtrlAndA(e){const{pinnedRowModel:t,paginationProxy:i,rangeService:n}=this;if(n&&i.isRowsToRender()){const[e,i]=[t.isEmpty("top"),t.isEmpty("bottom")],s=e?null:"top";let r,o;i?(r=null,o=this.paginationProxy.getRowCount()-1):(r="bottom",o=t.getPinnedBottomRowData().length-1);const a=this.columnModel.getAllDisplayedColumns();if(w(a))return;n.setCellRange({rowStartIndex:0,rowStartPinned:s,rowEndIndex:o,rowEndPinned:r,columnStart:a[0],columnEnd:Ie(a)})}e.preventDefault()}onCtrlAndC(e){if(!this.clipboardService||this.gos.get("enableCellTextSelection"))return;const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);(null==t?void 0:t.isEditing())||(null==i?void 0:i.isEditing())||(e.preventDefault(),this.clipboardService.copyToClipboard())}onCtrlAndX(e){if(!this.clipboardService||this.gos.get("enableCellTextSelection")||this.gos.get("suppressCutToClipboard"))return;const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);(null==t?void 0:t.isEditing())||(null==i?void 0:i.isEditing())||(e.preventDefault(),this.clipboardService.cutToClipboard(void 0,"ui"))}onCtrlAndV(e){const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);(null==t?void 0:t.isEditing())||(null==i?void 0:i.isEditing())||this.clipboardService&&!this.gos.get("suppressClipboardPaste")&&this.clipboardService.pasteFromClipboard()}onCtrlAndD(e){this.clipboardService&&!this.gos.get("suppressClipboardPaste")&&this.clipboardService.copyRangeDown(),e.preventDefault()}onCtrlAndZ(e){this.gos.get("undoRedoCellEditing")&&(e.preventDefault(),e.shiftKey?this.undoRedoService.redo("ui"):this.undoRedoService.undo("ui"))}onCtrlAndY(){this.undoRedoService.redo("ui")}};f([ue("mouseEventService")],la.prototype,"mouseEventService",2),f([ue("valueService")],la.prototype,"valueService",2),f([ue("menuService")],la.prototype,"menuService",2),f([ue("ctrlsService")],la.prototype,"ctrlsService",2),f([ue("navigationService")],la.prototype,"navigationService",2),f([ue("focusService")],la.prototype,"focusService",2),f([ue("undoRedoService")],la.prototype,"undoRedoService",2),f([ue("columnModel")],la.prototype,"columnModel",2),f([ue("paginationProxy")],la.prototype,"paginationProxy",2),f([ue("pinnedRowModel")],la.prototype,"pinnedRowModel",2),f([de("rangeService")],la.prototype,"rangeService",2),f([de("clipboardService")],la.prototype,"clipboardService",2),f([le],la.prototype,"postConstruct",1);var ca=class extends st{constructor(e){super(),this.centerContainerCtrl=e}postConstruct(){this.ctrlsService.whenReady(e=>{this.gridBodyCtrl=e.gridBodyCtrl,this.listenForResize()}),this.addManagedListener(this.eventService,ct.EVENT_SCROLLBAR_WIDTH_CHANGED,this.onScrollbarWidthChanged.bind(this)),this.addManagedPropertyListeners(["alwaysShowHorizontalScroll","alwaysShowVerticalScroll"],()=>{this.checkViewportAndScrolls()})}listenForResize(){const e=()=>this.onCenterViewportResized();this.centerContainerCtrl.registerViewportResizeListener(e),this.gridBodyCtrl.registerBodyViewportResizeListener(e)}onScrollbarWidthChanged(){this.checkViewportAndScrolls()}onCenterViewportResized(){if(this.centerContainerCtrl.isViewportInTheDOMTree()){this.keepPinnedColumnsNarrowerThanViewport(),this.checkViewportAndScrolls();const e=this.centerContainerCtrl.getCenterWidth();e!==this.centerWidth&&(this.centerWidth=e,this.columnModel.refreshFlexedColumns({viewportWidth:this.centerWidth,updateBodyWidths:!0,fireResizedEvent:!0}))}else this.bodyHeight=0}keepPinnedColumnsNarrowerThanViewport(){const e=pn(this.gridBodyCtrl.getBodyViewportElement());if(e<=50)return;let t=this.getPinnedColumnsOverflowingViewport(e-50);const i=this.gos.getCallback("processUnpinnedColumns");t.length&&(i&&(t=i({columns:t,viewportWidth:e})),this.columnModel.setColumnsPinned(t,null,"viewportSizeFeature"))}getPinnedColumnsOverflowingViewport(e){const t=this.pinnedWidthService.getPinnedRightWidth()+this.pinnedWidthService.getPinnedLeftWidth();if(t<e)return[];const i=[...this.columnModel.getDisplayedLeftColumns()],n=[...this.columnModel.getDisplayedRightColumns()];let s=0,r=0;const o=[];let a=t-0-e;for(;(r<i.length||s<n.length)&&a>0;){if(s<n.length){const e=n[s++];a-=e.getActualWidth(),o.push(e)}if(r<i.length&&a>0){const e=i[r++];a-=e.getActualWidth(),o.push(e)}}return o}checkViewportAndScrolls(){this.updateScrollVisibleService(),this.checkBodyHeight(),this.onHorizontalViewportChanged(),this.gridBodyCtrl.getScrollFeature().checkScrollLeft()}getBodyHeight(){return this.bodyHeight}checkBodyHeight(){const e=dn(this.gridBodyCtrl.getBodyViewportElement());if(this.bodyHeight!==e){this.bodyHeight=e;const t={type:ct.EVENT_BODY_HEIGHT_CHANGED};this.eventService.dispatchEvent(t)}}updateScrollVisibleService(){this.updateScrollVisibleServiceImpl(),setTimeout(this.updateScrollVisibleServiceImpl.bind(this),500)}updateScrollVisibleServiceImpl(){const e={horizontalScrollShowing:this.isHorizontalScrollShowing(),verticalScrollShowing:this.gridBodyCtrl.isVerticalScrollShowing()};this.scrollVisibleService.setScrollsVisible(e)}isHorizontalScrollShowing(){return this.centerContainerCtrl.isHorizontalScrollShowing()}onHorizontalViewportChanged(){const e=this.centerContainerCtrl.getCenterWidth(),t=this.centerContainerCtrl.getViewportScrollLeft();this.columnModel.setViewportPosition(e,t)}};f([ue("ctrlsService")],ca.prototype,"ctrlsService",2),f([ue("pinnedWidthService")],ca.prototype,"pinnedWidthService",2),f([ue("columnModel")],ca.prototype,"columnModel",2),f([ue("scrollVisibleService")],ca.prototype,"scrollVisibleService",2),f([le],ca.prototype,"postConstruct",1);var ha=class extends st{constructor(e){super(),this.element=e}postConstruct(){this.addManagedListener(this.eventService,ct.EVENT_LEFT_PINNED_WIDTH_CHANGED,this.onPinnedLeftWidthChanged.bind(this))}onPinnedLeftWidthChanged(){const e=this.pinnedWidthService.getPinnedLeftWidth(),t=e>0;an(this.element,t),Pn(this.element,e)}getWidth(){return this.pinnedWidthService.getPinnedLeftWidth()}};f([ue("pinnedWidthService")],ha.prototype,"pinnedWidthService",2),f([le],ha.prototype,"postConstruct",1);var ua=class extends st{constructor(e){super(),this.element=e}postConstruct(){this.addManagedListener(this.eventService,ct.EVENT_RIGHT_PINNED_WIDTH_CHANGED,this.onPinnedRightWidthChanged.bind(this))}onPinnedRightWidthChanged(){const e=this.pinnedWidthService.getPinnedRightWidth(),t=e>0;an(this.element,t),Pn(this.element,e)}getWidth(){return this.pinnedWidthService.getPinnedRightWidth()}};f([ue("pinnedWidthService")],ua.prototype,"pinnedWidthService",2),f([le],ua.prototype,"postConstruct",1);var da=class extends st{constructor(e,t){super(),this.eContainer=e,this.eViewport=t}postConstruct(){this.addManagedListener(this.eventService,ct.EVENT_ROW_CONTAINER_HEIGHT_CHANGED,this.onHeightChanged.bind(this))}onHeightChanged(){const e=this.maxDivHeightScaler.getUiContainerHeight(),t=null!=e?`${e}px`:"";this.eContainer.style.height=t,this.eViewport&&(this.eViewport.style.height=t)}};f([ue("rowContainerHeightService")],da.prototype,"maxDivHeightScaler",2),f([le],da.prototype,"postConstruct",1);var pa=class extends st{constructor(e){super(),this.eContainer=e}postConstruct(){this.rangeService&&(this.params={eElement:this.eContainer,onDragStart:this.rangeService.onDragStart.bind(this.rangeService),onDragStop:this.rangeService.onDragStop.bind(this.rangeService),onDragging:this.rangeService.onDragging.bind(this.rangeService)},this.addManagedPropertyListener("enableRangeSelection",e=>{e.currentValue?this.enableFeature():this.disableFeature()}),this.addDestroyFunc(()=>this.disableFeature()),this.gos.get("enableRangeSelection")&&this.enableFeature())}enableFeature(){this.dragService.addDragSource(this.params)}disableFeature(){this.dragService.removeDragSource(this.params)}};f([ue("dragService")],pa.prototype,"dragService",2),f([de("rangeService")],pa.prototype,"rangeService",2),f([le],pa.prototype,"postConstruct",1);var ga=class extends st{constructor(e,t=!1){super(),this.callback=e,this.addSpacer=t}postConstruct(){const e=this.setWidth.bind(this);this.addManagedPropertyListener("domLayout",e),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_CONTAINER_WIDTH_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_LEFT_PINNED_WIDTH_CHANGED,e),this.addSpacer&&(this.addManagedListener(this.eventService,ct.EVENT_RIGHT_PINNED_WIDTH_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_SCROLL_VISIBILITY_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_SCROLLBAR_WIDTH_CHANGED,e)),this.setWidth()}setWidth(){const{columnModel:e}=this,t=this.gos.isDomLayout("print"),i=e.getBodyContainerWidth(),n=e.getDisplayedColumnsLeftWidth(),s=e.getDisplayedColumnsRightWidth();let r;t?r=i+n+s:(r=i,this.addSpacer&&0===(this.gos.get("enableRtl")?n:s)&&this.scrollVisibleService.isVerticalScrollShowing()&&(r+=this.gos.getScrollbarWidth())),this.callback(r)}};f([ue("columnModel")],ga.prototype,"columnModel",2),f([ue("scrollVisibleService")],ga.prototype,"scrollVisibleService",2),f([le],ga.prototype,"postConstruct",1);var fa=(e=>(e.LEFT="left",e.RIGHT="right",e.CENTER="center",e.FULL_WIDTH="fullWidth",e.TOP_LEFT="topLeft",e.TOP_RIGHT="topRight",e.TOP_CENTER="topCenter",e.TOP_FULL_WIDTH="topFullWidth",e.STICKY_TOP_LEFT="stickyTopLeft",e.STICKY_TOP_RIGHT="stickyTopRight",e.STICKY_TOP_CENTER="stickyTopCenter",e.STICKY_TOP_FULL_WIDTH="stickyTopFullWidth",e.STICKY_BOTTOM_LEFT="stickyBottomLeft",e.STICKY_BOTTOM_RIGHT="stickyBottomRight",e.STICKY_BOTTOM_CENTER="stickyBottomCenter",e.STICKY_BOTTOM_FULL_WIDTH="stickyBottomFullWidth",e.BOTTOM_LEFT="bottomLeft",e.BOTTOM_RIGHT="bottomRight",e.BOTTOM_CENTER="bottomCenter",e.BOTTOM_FULL_WIDTH="bottomFullWidth",e))(fa||{});function ma(e){switch(e){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 ya=xt([["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"]]),va=xt([["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"]]),ba=class e extends st{constructor(e){super(),this.visible=!0,this.EMPTY_CTRLS=[],this.name=e,this.isFullWithContainer="topFullWidth"===this.name||"stickyTopFullWidth"===this.name||"stickyBottomFullWidth"===this.name||"bottomFullWidth"===this.name||"fullWidth"===this.name}static getRowContainerCssClasses(e){return{container:ya.get(e),viewport:va.get(e)}}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 ca(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,i){this.comp=e,this.eContainer=t,this.eViewport=i,this.createManagedBean(new la(this.eContainer)),this.addPreventScrollWhileDragging(),this.listenOnDomOrder(),this.stopHScrollOnPinnedRows();this.forContainers(["left","bottomLeft","topLeft","stickyTopLeft","stickyBottomLeft"],()=>{this.pinnedWidthFeature=this.createManagedBean(new ha(this.eContainer)),this.addManagedListener(this.eventService,ct.EVENT_LEFT_PINNED_WIDTH_CHANGED,()=>this.onPinnedWidthChanged())}),this.forContainers(["right","bottomRight","topRight","stickyTopRight","stickyBottomRight"],()=>{this.pinnedWidthFeature=this.createManagedBean(new ua(this.eContainer)),this.addManagedListener(this.eventService,ct.EVENT_RIGHT_PINNED_WIDTH_CHANGED,()=>this.onPinnedWidthChanged())}),this.forContainers(["center","left","right","fullWidth"],()=>this.createManagedBean(new da(this.eContainer,"center"===this.name?i:void 0))),this.forContainers(["topCenter","topLeft","topRight","bottomCenter","bottomLeft","bottomRight","center","left","right","stickyTopCenter","stickyTopLeft","stickyTopRight","stickyBottomCenter","stickyBottomLeft","stickyBottomRight"],()=>this.createManagedBean(new pa(this.eContainer))),this.forContainers(["center","topCenter","stickyTopCenter","bottomCenter","stickyBottomCenter"],()=>this.createManagedBean(new ga(e=>this.comp.setContainerWidth(`${e}px`)))),this.addListeners(),this.registerWithCtrlsService()}addListeners(){this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,()=>this.onDisplayedColumnsChanged()),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,()=>this.onDisplayedColumnsWidthChanged()),this.addManagedListener(this.eventService,ct.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)return void this.comp.setDomOrder(!0);const e=()=>{const e=this.gos.get("ensureDomOrder"),t=this.gos.isDomLayout("print");this.comp.setDomOrder(e||t)};this.addManagedPropertyListener("domLayout",e),e()}stopHScrollOnPinnedRows(){this.forContainers(["topCenter","stickyTopCenter","bottomCenter","stickyBottomCenter"],()=>{this.addManagedListener(this.eViewport,"scroll",()=>this.eViewport.scrollLeft=0)})}onDisplayedColumnsChanged(){this.forContainers(["center"],()=>this.onHorizontalViewportChanged())}onDisplayedColumnsWidthChanged(){this.forContainers(["center"],()=>this.onHorizontalViewportChanged())}addPreventScrollWhileDragging(){const e=e=>{this.dragService.isDragging()&&e.cancelable&&e.preventDefault()};this.eContainer.addEventListener("touchmove",e,{passive:!1}),this.addDestroyFunc(()=>this.eContainer.removeEventListener("touchmove",e))}onHorizontalViewportChanged(e=!1){const t=this.getCenterWidth(),i=this.getCenterViewportScrollLeft();this.columnModel.setViewportPosition(t,i,e)}getCenterWidth(){return pn(this.eViewport)}getCenterViewportScrollLeft(){return vn(this.eViewport,this.enableRtl)}registerViewportResizeListener(e){const t=this.resizeObserverService.observeResize(this.eViewport,e);this.addDestroyFunc(()=>t())}isViewportInTheDOMTree(){return Sn(this.eViewport)}getViewportScrollLeft(){return vn(this.eViewport,this.enableRtl)}isHorizontalScrollShowing(){return this.gos.get("alwaysShowHorizontalScroll")||In(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){bn(this.eViewport,e,this.enableRtl)}isContainerVisible(){return!e.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||0===t.length)return void this.comp.setRowCtrls({rowCtrls:this.EMPTY_CTRLS});const i=this.gos.isDomLayout("print"),n=this.gos.get("embedFullWidthRows")||i,s=t.filter(e=>{const t=e.isFullWidth();return this.isFullWithContainer?!n&&t:n||!t});this.comp.setRowCtrls({rowCtrls:s,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()}}};f([ue("dragService")],ba.prototype,"dragService",2),f([ue("ctrlsService")],ba.prototype,"ctrlsService",2),f([ue("columnModel")],ba.prototype,"columnModel",2),f([ue("resizeObserverService")],ba.prototype,"resizeObserverService",2),f([ue("rowRenderer")],ba.prototype,"rowRenderer",2),f([le],ba.prototype,"postConstruct",1);var Ca=ba,wa=class extends vs{constructor(){super('<div class="ag-root ag-unselectable" role="treegrid">\n        <ag-header-root ref="gridHeader"></ag-header-root>\n        <div class="ag-floating-top" ref="eTop" role="presentation">\n            <ag-row-container ref="topLeftContainer" name="topLeft"></ag-row-container>\n            <ag-row-container ref="topCenterContainer" name="topCenter"></ag-row-container>\n            <ag-row-container ref="topRightContainer" name="topRight"></ag-row-container>\n            <ag-row-container ref="topFullWidthContainer" name="topFullWidth"></ag-row-container>\n        </div>\n        <div class="ag-body" ref="eBody" role="presentation">\n            <div class="ag-body-viewport" ref="eBodyViewport" role="presentation">\n                <ag-row-container ref="leftContainer" name="left"></ag-row-container>\n                <ag-row-container ref="centerContainer" name="center"></ag-row-container>\n                <ag-row-container ref="rightContainer" name="right"></ag-row-container>\n                <ag-row-container ref="fullWidthContainer" name="fullWidth"></ag-row-container>\n            </div>\n            <ag-fake-vertical-scroll></ag-fake-vertical-scroll>\n        </div>\n        <div class="ag-sticky-top" ref="eStickyTop" role="presentation">\n            <ag-row-container ref="stickyTopLeftContainer" name="stickyTopLeft"></ag-row-container>\n            <ag-row-container ref="stickyTopCenterContainer" name="stickyTopCenter"></ag-row-container>\n            <ag-row-container ref="stickyTopRightContainer" name="stickyTopRight"></ag-row-container>\n            <ag-row-container ref="stickyTopFullWidthContainer" name="stickyTopFullWidth"></ag-row-container>\n        </div>\n        <div class="ag-sticky-bottom" ref="eStickyBottom" role="presentation">\n            <ag-row-container ref="stickyBottomLeftContainer" name="stickyBottomLeft"></ag-row-container>\n            <ag-row-container ref="stickyBottomCenterContainer" name="stickyBottomCenter"></ag-row-container>\n            <ag-row-container ref="stickyBottomRightContainer" name="stickyBottomRight"></ag-row-container>\n            <ag-row-container ref="stickyBottomFullWidthContainer" name="stickyBottomFullWidth"></ag-row-container>\n        </div>\n        <div class="ag-floating-bottom" ref="eBottom" role="presentation">\n            <ag-row-container ref="bottomLeftContainer" name="bottomLeft"></ag-row-container>\n            <ag-row-container ref="bottomCenterContainer" name="bottomCenter"></ag-row-container>\n            <ag-row-container ref="bottomRightContainer" name="bottomRight"></ag-row-container>\n            <ag-row-container ref="bottomFullWidthContainer" name="bottomFullWidth"></ag-row-container>\n        </div>\n        <ag-fake-horizontal-scroll></ag-fake-horizontal-scroll>\n        <ag-overlay-wrapper></ag-overlay-wrapper>\n    </div>')}init(){const e=(e,t)=>{const i=`${e}px`;t.style.minHeight=i,t.style.height=i},t={setRowAnimationCssOnBodyViewport:(e,t)=>this.setRowAnimationCssOnBodyViewport(e,t),setColumnCount:e=>ci(this.getGui(),e),setRowCount:e=>ai(this.getGui(),e),setTopHeight:t=>e(t,this.eTop),setBottomHeight:t=>e(t,this.eBottom),setTopDisplay:e=>this.eTop.style.display=e,setBottomDisplay:e=>this.eBottom.style.display=e,setStickyTopHeight:e=>this.eStickyTop.style.height=e,setStickyTopTop:e=>this.eStickyTop.style.top=e,setStickyTopWidth:e=>this.eStickyTop.style.width=e,setStickyBottomHeight:e=>this.eStickyBottom.style.height=e,setStickyBottomBottom:e=>this.eStickyBottom.style.bottom=e,setStickyBottomWidth:e=>this.eStickyBottom.style.width=e,setColumnMovingCss:(e,t)=>this.addOrRemoveCssClass(e,t),updateLayoutClasses:(e,t)=>{[this.eBodyViewport.classList,this.eBody.classList].forEach(e=>{e.toggle("ag-layout-auto-height",t.autoHeight),e.toggle("ag-layout-normal",t.normal),e.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)},setAlwaysVerticalScrollClass:(e,t)=>this.eBodyViewport.classList.toggle(jo,t),registerBodyViewportResizeListener:e=>{const t=this.resizeObserverService.observeResize(this.eBodyViewport,e);this.addDestroyFunc(()=>t())},setPinnedTopBottomOverflowY:e=>this.eTop.style.overflowY=this.eBottom.style.overflowY=e,setCellSelectableCss:(e,t)=>{[this.eTop,this.eBodyViewport,this.eBottom].forEach(i=>i.classList.toggle(e,t))},setBodyViewportWidth:e=>this.eBodyViewport.style.width=e};this.ctrl=this.createManagedBean(new $o),this.ctrl.setComp(t,this.getGui(),this.eBodyViewport,this.eTop,this.eBottom,this.eStickyTop,this.eStickyBottom),(this.rangeService&&this.gos.get("enableRangeSelection")||"multiple"===this.gos.get("rowSelection"))&&oi(this.getGui(),!0)}setRowAnimationCssOnBodyViewport(e,t){const i=this.eBodyViewport.classList;i.toggle("ag-row-animation",t),i.toggle("ag-row-no-animation",!t)}getFloatingTopBottom(){return[this.eTop,this.eBottom]}};f([ue("resizeObserverService")],wa.prototype,"resizeObserverService",2),f([de("rangeService")],wa.prototype,"rangeService",2),f([bs("eBodyViewport")],wa.prototype,"eBodyViewport",2),f([bs("eStickyTop")],wa.prototype,"eStickyTop",2),f([bs("eStickyBottom")],wa.prototype,"eStickyBottom",2),f([bs("eTop")],wa.prototype,"eTop",2),f([bs("eBottom")],wa.prototype,"eBottom",2),f([bs("gridHeader")],wa.prototype,"headerRootComp",2),f([bs("eBody")],wa.prototype,"eBody",2),f([le],wa.prototype,"init",1);var Sa=class extends st{postConstruct(){this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onDisplayedColumnsWidthChanged.bind(this))}onDisplayedColumnsChanged(){this.update()}onDisplayedColumnsWidthChanged(){this.update()}update(){this.columnAnimationService.isActive()?this.columnAnimationService.executeLaterVMTurn(()=>{this.columnAnimationService.executeLaterVMTurn(()=>this.updateImpl())}):this.updateImpl()}updateImpl(){const e=this.ctrlsService.get("center");if(!e||this.columnAnimationService.isActive())return;const t={horizontalScrollShowing:e.isHorizontalScrollShowing(),verticalScrollShowing:this.isVerticalScrollShowing()};this.setScrollsVisible(t)}setScrollsVisible(e){if(this.horizontalScrollShowing!==e.horizontalScrollShowing||this.verticalScrollShowing!==e.verticalScrollShowing){this.horizontalScrollShowing=e.horizontalScrollShowing,this.verticalScrollShowing=e.verticalScrollShowing;const t={type:ct.EVENT_SCROLL_VISIBILITY_CHANGED};this.eventService.dispatchEvent(t)}}isHorizontalScrollShowing(){return this.horizontalScrollShowing}isVerticalScrollShowing(){return this.verticalScrollShowing}};f([ue("ctrlsService")],Sa.prototype,"ctrlsService",2),f([ue("columnAnimationService")],Sa.prototype,"columnAnimationService",2),f([le],Sa.prototype,"postConstruct",1),Sa=f([he("scrollVisibleService")],Sa);var xa=class extends st{constructor(){super(...arguments),this.gridInstanceId=xa.gridInstanceSequence.next()}stampTopLevelGridCompWithGridInstance(e){e[xa.GRID_DOM_KEY]=this.gridInstanceId}getRenderedCellForEvent(e){return Qe(this.gos,e.target,sa.DOM_DATA_KEY_CELL_CTRL)}isEventFromThisGrid(e){return this.isElementInThisGrid(e.target)}isElementInThisGrid(e){let t=e;for(;t;){const e=t[xa.GRID_DOM_KEY];if(b(e))return e===this.gridInstanceId;t=t.parentElement}return!1}getCellPositionForEvent(e){const t=this.getRenderedCellForEvent(e);return t?t.getCellPosition():null}getNormalisedPosition(e){const t=this.gos.isDomLayout("normal"),i=e;let n,s;if(null!=i.clientX||null!=i.clientY?(n=i.clientX,s=i.clientY):(n=i.x,s=i.y),t){const e=this.ctrlsService.getGridBodyCtrl(),t=e.getScrollFeature().getVScrollPosition();n+=e.getScrollFeature().getHScrollPosition().left,s+=t.top}return{x:n,y:s}}};xa.gridInstanceSequence=new hs,xa.GRID_DOM_KEY="__ag_grid_instance",f([ue("ctrlsService")],xa.prototype,"ctrlsService",2),xa=f([he("mouseEventService")],xa);var Ea=class extends st{constructor(){super(),this.onPageDown=J(this.onPageDown,100),this.onPageUp=J(this.onPageUp,100)}postConstruct(){this.ctrlsService.whenReady(e=>{this.gridBodyCon=e.gridBodyCtrl})}handlePageScrollingKey(e,t=!1){const i=e.key,n=e.altKey,s=e.ctrlKey||e.metaKey,r=!!this.rangeService&&e.shiftKey,o=this.mouseEventService.getCellPositionForEvent(e);let a=!1;switch(i){case Zn.PAGE_HOME:case Zn.PAGE_END:s||n||(this.onHomeOrEndKey(i),a=!0);break;case Zn.LEFT:case Zn.RIGHT:case Zn.UP:case Zn.DOWN:if(!o)return!1;!s||n||r||(this.onCtrlUpDownLeftRight(i,o),a=!0);break;case Zn.PAGE_DOWN:case Zn.PAGE_UP:s||n||(a=this.handlePageUpDown(i,o,t))}return a&&e.preventDefault(),a}handlePageUpDown(e,t,i){return i&&(t=this.focusService.getFocusedCell()),!!t&&(e===Zn.PAGE_UP?this.onPageUp(t):this.onPageDown(t),!0)}navigateTo(e){var t;const{scrollIndex:i,scrollType:n,scrollColumn:s,focusIndex:r,focusColumn:o}=e;b(s)&&!s.isPinned()&&this.gridBodyCon.getScrollFeature().ensureColumnVisible(s),b(i)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(i,n),e.isAsync||this.gridBodyCon.getScrollFeature().ensureIndexVisible(r),this.focusService.setFocusedCell({rowIndex:r,column:o,rowPinned:null,forceBrowserFocus:!0}),null==(t=this.rangeService)||t.setRangeToCell({rowIndex:r,rowPinned:null,column:o})}onPageDown(e){const t=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),i=this.getViewportHeight(),n=this.paginationProxy.getPixelOffset(),s=t.top+i,r=this.paginationProxy.getRowIndexAtPixel(s+n);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(e,r):this.navigateToNextPage(e,r)}onPageUp(e){const t=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),i=this.paginationProxy.getPixelOffset(),n=t.top,s=this.paginationProxy.getRowIndexAtPixel(n+i);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(e,s,!0):this.navigateToNextPage(e,s,!0)}navigateToNextPage(e,t,i=!1){const n=this.getViewportHeight(),s=this.paginationProxy.getPageFirstRow(),r=this.paginationProxy.getPageLastRow(),o=this.paginationProxy.getPixelOffset(),a=this.paginationProxy.getRow(e.rowIndex),l=i?(null==a?void 0:a.rowHeight)-n-o:n-o,c=(null==a?void 0:a.rowTop)+l;let h,u=this.paginationProxy.getRowIndexAtPixel(c+o);if(u===e.rowIndex){const n=i?-1:1;t=u=e.rowIndex+n}i?(h="bottom",u<s&&(u=s),t<s&&(t=s)):(h="top",u>r&&(u=r),t>r&&(t=r)),this.isRowTallerThanView(u)&&(t=u,h="top"),this.navigateTo({scrollIndex:t,scrollType:h,scrollColumn:null,focusIndex:u,focusColumn:e.column})}navigateToNextPageWithAutoHeight(e,t,i=!1){this.navigateTo({scrollIndex:t,scrollType:i?"bottom":"top",scrollColumn:null,focusIndex:t,focusColumn:e.column}),setTimeout(()=>{const n=this.getNextFocusIndexForAutoHeight(e,i);this.navigateTo({scrollIndex:t,scrollType:i?"bottom":"top",scrollColumn:null,focusIndex:n,focusColumn:e.column,isAsync:!0})},50)}getNextFocusIndexForAutoHeight(e,t=!1){var i;const n=t?-1:1,s=this.getViewportHeight(),r=this.paginationProxy.getPageLastRow();let o=0,a=e.rowIndex;for(;a>=0&&a<=r;){const e=this.paginationProxy.getRow(a);if(e){const t=null!=(i=e.rowHeight)?i:0;if(o+t>s)break;o+=t}a+=n}return Math.max(0,Math.min(a,r))}getViewportHeight(){const{gridBodyCtrl:e,center:t}=this.ctrlsService.getParams(),i=e.getScrollFeature().getVScrollPosition(),n=this.gos.getScrollbarWidth();let s=i.bottom-i.top;return t.isHorizontalScrollShowing()&&(s-=n),s}isRowTallerThanView(e){const t=this.paginationProxy.getRow(e);if(!t)return!1;const i=t.rowHeight;return"number"==typeof i&&i>this.getViewportHeight()}onCtrlUpDownLeftRight(e,t){const i=this.cellNavigationService.getNextCellToFocus(e,t,!0),{rowIndex:n,column:s}=i;this.navigateTo({scrollIndex:n,scrollType:null,scrollColumn:s,focusIndex:n,focusColumn:s})}onHomeOrEndKey(e){const t=e===Zn.PAGE_HOME,i=this.columnModel.getAllDisplayedColumns(),n=t?i[0]:Ie(i),s=t?this.paginationProxy.getPageFirstRow():this.paginationProxy.getPageLastRow();this.navigateTo({scrollIndex:s,scrollType:null,scrollColumn:n,focusIndex:s,focusColumn:n})}onTabKeyDown(e,t){const i=t.shiftKey,n=this.tabToNextCellCommon(e,i,t);if(!1===n)if(i){const{rowIndex:i,rowPinned:n}=e.getRowPosition();(n?0===i:i===this.paginationProxy.getPageFirstRow())&&(0===this.gos.get("headerHeight")||this.gos.get("suppressHeaderFocus")?this.focusService.focusNextGridCoreContainer(!0,!0):(t.preventDefault(),this.focusService.focusPreviousFromFirstCell(t)))}else e instanceof sa&&e.focusCell(!0),this.focusService.focusNextGridCoreContainer(i)&&t.preventDefault();else n&&t.preventDefault()}tabToNextCell(e,t){const i=this.focusService.getFocusedCell();if(!i)return!1;let n=this.getCellByPosition(i);return!!(n||(n=this.rowRenderer.getRowByPosition(i),n&&n.isFullWidth()))&&!!this.tabToNextCellCommon(n,e,t)}tabToNextCellCommon(e,t,i){let n,s=e.isEditing();if(!s&&e instanceof sa){const t=e.getRowCtrl();t&&(s=t.isEditing())}return n=s?"fullRow"===this.gos.get("editType")?this.moveToNextEditingRow(e,t,i):this.moveToNextEditingCell(e,t,i):this.moveToNextCellNotEditing(e,t),null===n?n:n||!!this.focusService.getFocusedHeader()}moveToNextEditingCell(e,t,i=null){const n=e.getCellPosition();e.getGui().focus(),e.stopEditing();const s=this.findNextCellToFocusOn(n,t,!0);return!1===s?null:null!=s&&(s.startEditing(null,!0,i),s.focusCell(!1),!0)}moveToNextEditingRow(e,t,i=null){const n=e.getCellPosition(),s=this.findNextCellToFocusOn(n,t,!0);if(!1===s)return null;if(null==s)return!1;const r=s.getCellPosition(),o=this.isCellEditable(n),a=this.isCellEditable(r),l=r&&n.rowIndex===r.rowIndex&&n.rowPinned===r.rowPinned;return o&&e.setFocusOutOnEditor(),l||(e.getRowCtrl().stopEditing(),s.getRowCtrl().startRowEditing(void 0,void 0,i)),a?(s.setFocusInOnEditor(),s.focusCell()):s.focusCell(!0),!0}moveToNextCellNotEditing(e,t){const i=this.columnModel.getAllDisplayedColumns();let n;n=e instanceof aa?p(d({},e.getRowPosition()),{column:t?i[0]:Ie(i)}):e.getCellPosition();const s=this.findNextCellToFocusOn(n,t,!1);if(!1===s)return null;if(s instanceof sa)s.focusCell(!0);else if(s)return this.tryToFocusFullWidthRow(s.getRowPosition(),t);return b(s)}findNextCellToFocusOn(e,t,i){var n;let s=e;for(;;){e!==s&&(e=s),t||(s=this.getLastCellOfColSpan(s)),s=this.cellNavigationService.getNextTabbedCell(s,t);const r=this.gos.getCallback("tabToNextCell");if(b(r)){const n=r({backwards:t,editing:i,previousCellPosition:e,nextCellPosition:s||null});if(!0===n||null===n)null===n&&z("Returning `null` from tabToNextCell is deprecated. Return `true` to stay on the current cell, or `false` to let the browser handle the tab behaviour."),s=e;else{if(!1===n)return!1;n.floating&&(z("tabToNextCellFunc return type should have attributes: rowIndex, rowPinned, column. However you had 'floating', maybe you meant 'rowPinned'?"),n.rowPinned=n.floating),s={rowIndex:n.rowIndex,column:n.column,rowPinned:n.rowPinned}}}if(!s)return null;if(s.rowIndex<0){const e=this.headerNavigationService.getHeaderRowCount();return this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:e+s.rowIndex,column:s.column},fromCell:!0}),null}const o="fullRow"===this.gos.get("editType");if(i&&!o&&!this.isCellEditable(s))continue;this.ensureCellVisible(s);const a=this.getCellByPosition(s);if(!a){const e=this.rowRenderer.getRowByPosition(s);if(!e||!e.isFullWidth()||i)continue;return e}if(!a.isSuppressNavigable())return null==(n=this.rangeService)||n.setRangeToCell(s),a}}isCellEditable(e){const t=this.lookupRowNodeForCell(e);return!!t&&e.column.isCellEditable(t)}getCellByPosition(e){const t=this.rowRenderer.getRowByPosition(e);return t?t.getCellCtrl(e.column):null}lookupRowNodeForCell(e){return"top"===e.rowPinned?this.pinnedRowModel.getPinnedTopRow(e.rowIndex):"bottom"===e.rowPinned?this.pinnedRowModel.getPinnedBottomRow(e.rowIndex):this.paginationProxy.getRow(e.rowIndex)}navigateToNextCell(e,t,i,n){let s=i,r=!1;for(;s&&(s===i||!this.isValidNavigateCell(s));)this.gos.get("enableRtl")?t===Zn.LEFT&&(s=this.getLastCellOfColSpan(s)):t===Zn.RIGHT&&(s=this.getLastCellOfColSpan(s)),s=this.cellNavigationService.getNextCellToFocus(t,s),r=C(s);if(r&&e&&e.key===Zn.UP&&(s={rowIndex:-1,rowPinned:null,column:i.column}),n){const n=this.gos.getCallback("navigateToNextCell");if(b(n)){const r=n({key:t,previousCellPosition:i,nextCellPosition:s||null,event:e});b(r)?(r.floating&&(z("tabToNextCellFunc return type should have attributes: rowIndex, rowPinned, column. However you had 'floating', maybe you meant 'rowPinned'?"),r.rowPinned=r.floating),s={rowPinned:r.rowPinned,rowIndex:r.rowIndex,column:r.column}):s=null}}if(!s)return;if(s.rowIndex<0){const t=this.headerNavigationService.getHeaderRowCount();return void this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:t+s.rowIndex,column:i.column},event:e||void 0,fromCell:!0})}const o=this.getNormalisedPosition(s);o?this.focusPosition(o):this.tryToFocusFullWidthRow(s)}getNormalisedPosition(e){this.ensureCellVisible(e);const t=this.getCellByPosition(e);return t?(e=t.getCellPosition(),this.ensureCellVisible(e),e):null}tryToFocusFullWidthRow(e,t=!1){const i=this.columnModel.getAllDisplayedColumns(),n=this.rowRenderer.getRowByPosition(e);if(!n||!n.isFullWidth())return!1;const s=this.focusService.getFocusedCell(),r={rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:e.column||(t?Ie(i):i[0])};this.focusPosition(r);const o=null!=s&&this.rowPositionUtils.before(r,s),a={type:ct.EVENT_FULL_WIDTH_ROW_FOCUSED,rowIndex:r.rowIndex,rowPinned:r.rowPinned,column:r.column,isFullWidthCell:!0,floating:r.rowPinned,fromBelow:o};return this.eventService.dispatchEvent(a),!0}focusPosition(e){var t;this.focusService.setFocusedCell({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0}),null==(t=this.rangeService)||t.setRangeToCell(e)}isValidNavigateCell(e){return!!this.rowPositionUtils.getRowNode(e)}getLastCellOfColSpan(e){const t=this.getCellByPosition(e);if(!t)return e;const i=t.getColSpanningList();return 1===i.length?e:{rowIndex:e.rowIndex,column:Ie(i),rowPinned:e.rowPinned}}ensureCellVisible(e){const t=this.gos.isGroupRowsSticky(),i=this.rowModel.getRow(e.rowIndex);!(t&&(null==i?void 0:i.sticky))&&C(e.rowPinned)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(e.rowIndex),e.column.isPinned()||this.gridBodyCon.getScrollFeature().ensureColumnVisible(e.column)}};f([ue("mouseEventService")],Ea.prototype,"mouseEventService",2),f([ue("paginationProxy")],Ea.prototype,"paginationProxy",2),f([ue("focusService")],Ea.prototype,"focusService",2),f([ue("columnModel")],Ea.prototype,"columnModel",2),f([ue("rowModel")],Ea.prototype,"rowModel",2),f([ue("ctrlsService")],Ea.prototype,"ctrlsService",2),f([ue("rowRenderer")],Ea.prototype,"rowRenderer",2),f([ue("headerNavigationService")],Ea.prototype,"headerNavigationService",2),f([ue("rowPositionUtils")],Ea.prototype,"rowPositionUtils",2),f([ue("cellNavigationService")],Ea.prototype,"cellNavigationService",2),f([ue("pinnedRowModel")],Ea.prototype,"pinnedRowModel",2),f([de("rangeService")],Ea.prototype,"rangeService",2),f([le],Ea.prototype,"postConstruct",1),Ea=f([he("navigationService")],Ea);var Aa=class e extends wr{constructor(e){super('<div class="ag-popup-editor" tabindex="-1"/>'),this.params=e}postConstruct(){this.gos.setDomData(this.getGui(),e.DOM_KEY_POPUP_EDITOR_WRAPPER,!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),t=this.params;this.addManagedListener(e,"keydown",e=>{Jn(this.gos,e,t.node,t.column,!0)||t.onKeyDown(e)})}};Aa.DOM_KEY_POPUP_EDITOR_WRAPPER="popupEditorWrapper",f([le],Aa.prototype,"postConstruct",1);var Ma=Aa,Ta=class extends vs{constructor(e,t,i,n,s){super(),this.rendererVersion=0,this.editorVersion=0,this.beans=e,this.column=t.getColumn(),this.rowNode=t.getRowNode(),this.rowCtrl=t.getRowCtrl(),this.eRow=n,this.cellCtrl=t;const r=document.createElement("div");r.setAttribute("comp-id",`${this.getCompId()}`),this.setTemplateFromElement(r);const o=this.getGui();this.forceWrapper=t.isForceWrapper(),this.refreshWrapper(!1);const a=(e,t)=>{null!=t&&""!=t?o.setAttribute(e,t):o.removeAttribute(e)};Ht(o,t.getCellAriaRole()),a("col-id",t.getColumnIdSanitised());const l=t.getTabIndex();void 0!==l&&a("tabindex",l.toString());const c={addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setUserStyles:e=>Dn(o,e),getFocusableElement:()=>this.getFocusableElement(),setIncludeSelection:e=>this.includeSelection=e,setIncludeRowDrag:e=>this.includeRowDrag=e,setIncludeDndSource:e=>this.includeDndSource=e,setRenderDetails:(e,t,i)=>this.setRenderDetails(e,t,i),setEditDetails:(e,t,i)=>this.setEditDetails(e,t,i),getCellEditor:()=>this.cellEditor||null,getCellRenderer:()=>this.cellRenderer||null,getParentOfValue:()=>this.getParentOfValue()};t.setComp(c,this.getGui(),this.eCellWrapper,i,s)}getParentOfValue(){return this.eCellValue?this.eCellValue:this.eCellWrapper?this.eCellWrapper:this.getGui()}setRenderDetails(e,t,i){if(this.cellEditor&&!this.cellEditorPopupWrapper)return;this.firstRender=null==this.firstRender;const n=this.refreshWrapper(!1);this.refreshEditStyles(!1),e?!i&&!n&&this.refreshCellRenderer(e)||(this.destroyRenderer(),this.createCellRendererInstance(e)):(this.destroyRenderer(),this.insertValueWithoutCellRenderer(t))}setEditDetails(e,t,i){e?this.createCellEditorInstance(e,t,i):this.destroyEditor()}removeControls(){this.checkboxSelectionComp=this.beans.context.destroyBean(this.checkboxSelectionComp),this.dndSourceComp=this.beans.context.destroyBean(this.dndSourceComp),this.rowDraggingComp=this.beans.context.destroyBean(this.rowDraggingComp)}refreshWrapper(e){const t=this.includeRowDrag||this.includeDndSource||this.includeSelection,i=t||this.forceWrapper,n=i&&null==this.eCellWrapper;if(n){const e=document.createElement("div");e.setAttribute("role","presentation"),e.setAttribute("class","ag-cell-wrapper"),this.eCellWrapper=e,this.getGui().appendChild(this.eCellWrapper)}const s=!i&&null!=this.eCellWrapper;s&&(wn(this.eCellWrapper),this.eCellWrapper=void 0),this.addOrRemoveCssClass("ag-cell-value",!i);const r=!e&&i,o=r&&null==this.eCellValue;if(o){const e=document.createElement("span");e.setAttribute("role","presentation"),e.setAttribute("class","ag-cell-value"),this.eCellValue=e,this.eCellWrapper.appendChild(this.eCellValue)}const a=!r&&null!=this.eCellValue;a&&(wn(this.eCellValue),this.eCellValue=void 0);const l=n||s||o||a;return l&&this.removeControls(),e||t&&this.addControls(),l}addControls(){this.includeRowDrag&&null==this.rowDraggingComp&&(this.rowDraggingComp=this.cellCtrl.createRowDragComp(),this.rowDraggingComp&&this.eCellWrapper.insertBefore(this.rowDraggingComp.getGui(),this.eCellValue)),this.includeDndSource&&null==this.dndSourceComp&&(this.dndSourceComp=this.cellCtrl.createDndSource(),this.eCellWrapper.insertBefore(this.dndSourceComp.getGui(),this.eCellValue)),this.includeSelection&&null==this.checkboxSelectionComp&&(this.checkboxSelectionComp=this.cellCtrl.createSelectionCheckbox(),this.eCellWrapper.insertBefore(this.checkboxSelectionComp.getGui(),this.eCellValue))}createCellEditorInstance(e,t,i){const n=this.editorVersion,s=e.newAgStackInstance();if(!s)return;const{params:r}=e;s.then(e=>this.afterCellEditorCreated(n,e,r,t,i)),C(this.cellEditor)&&r.cellStartedEdit&&this.cellCtrl.focusCell(!0)}insertValueWithoutCellRenderer(e){const t=this.getParentOfValue();Cn(t);const i=null!=e?bt(e,!0):null;null!=i&&(t.textContent=i)}destroyEditorAndRenderer(){this.destroyRenderer(),this.destroyEditor()}destroyRenderer(){const{context:e}=this.beans;this.cellRenderer=e.destroyBean(this.cellRenderer),wn(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),wn(this.cellEditorGui),this.cellEditorGui=null,this.editorVersion++}refreshCellRenderer(e){if(null==this.cellRenderer||null==this.cellRenderer.refresh)return!1;if(this.cellRendererClass!==e.componentClass)return!1;const t=this.cellRenderer.refresh(e.params);return!0===t||void 0===t}createCellRendererInstance(e){const t=!this.beans.gos.get("suppressAnimationFrame"),i=this.rendererVersion,{componentClass:n}=e,s=()=>{if(this.rendererVersion!==i||!this.isAlive())return;const t=e.newAgStackInstance(),s=this.afterCellRendererCreated.bind(this,i,n);t&&t.then(s)};t&&this.firstRender?this.beans.animationFrameService.createTask(s,this.rowNode.rowIndex,"createTasksP2"):s()}getCtrl(){return this.cellCtrl}getRowCtrl(){return this.rowCtrl}getCellRenderer(){return this.cellRenderer}getCellEditor(){return this.cellEditor}afterCellRendererCreated(e,t,i){if(this.isAlive()&&e===this.rendererVersion){if(this.cellRenderer=i,this.cellRendererClass=t,this.cellRendererGui=this.cellRenderer.getGui(),null!=this.cellRendererGui){const e=this.getParentOfValue();Cn(e),e.appendChild(this.cellRendererGui)}}else this.beans.context.destroyBean(i)}afterCellEditorCreated(e,t,i,n,s){if(e!==this.editorVersion)return void this.beans.context.destroyBean(t);if(t.isCancelBeforeStart&&t.isCancelBeforeStart())return this.beans.context.destroyBean(t),void this.cellCtrl.stopEditing(!0);if(!t.getGui)return console.warn(`AG Grid: cellEditor for column ${this.column.getId()} is missing getGui() method`),void this.beans.context.destroyBean(t);this.cellEditor=t,this.cellEditorGui=t.getGui();const r=n||void 0!==t.isPopup&&t.isPopup();r?this.addPopupCellEditor(i,s):this.addInCellEditor(),this.refreshEditStyles(!0,r),t.afterGuiAttached&&t.afterGuiAttached()}refreshEditStyles(e,t){var i;this.addOrRemoveCssClass("ag-cell-inline-editing",e&&!t),this.addOrRemoveCssClass("ag-cell-popup-editing",e&&!!t),this.addOrRemoveCssClass("ag-cell-not-inline-editing",!e||!!t),null==(i=this.rowCtrl)||i.setInlineEditingCss(e)}addInCellEditor(){const e=this.getGui();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){"fullRow"===this.beans.gos.get("editType")&&console.warn("AG Grid: popup cellEditor does not work with fullRowEdit - you cannot use them both - either turn off fullRowEdit, or stop using popup editors.");const i=this.cellEditor;this.cellEditorPopupWrapper=this.beans.context.createBean(new Ma(e));const n=this.cellEditorPopupWrapper.getGui();this.cellEditorGui&&n.appendChild(this.cellEditorGui);const s=this.beans.popupService,r=this.beans.gos.get("stopEditingWhenCellsLoseFocus"),o=null!=t?t:i.getPopupPosition?i.getPopupPosition():"over",a=this.beans.gos.get("enableRtl"),l={ePopup:n,column:this.column,rowNode:this.rowNode,type:"popupCellEditor",eventSource:this.getGui(),position:o,alignSide:a?"right":"left",keepWithinBounds:!0},c=s.positionPopupByComponent.bind(s,l),h=this.beans.localeService.getLocaleTextFunc(),u=s.addPopup({modal:r,eChild:n,closeOnEsc:!0,closedCallback:()=>{this.cellCtrl.onPopupEditorClosed()},anchorToElement:this.getGui(),positionCallback:c,ariaLabel:h("ariaLabelCellEditor","Cell Editor")});u&&(this.hideEditorPopup=u.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())&&_i()&&e.focus({preventScroll:!0}),Cn(this.getParentOfValue())}},Da=class extends vs{constructor(e,t,i){super(),this.cellComps={},this.beans=t,this.rowCtrl=e;const n=document.createElement("div");n.setAttribute("comp-id",`${this.getCompId()}`),n.setAttribute("style",this.getInitialStyle(i)),this.setTemplateFromElement(n);const s=this.getGui(),r=s.style;this.domOrder=this.rowCtrl.getDomOrder(),Ht(s,"row");const o=this.rowCtrl.getTabIndex();null!=o&&s.setAttribute("tabindex",o.toString());const a={setDomOrder:e=>this.domOrder=e,setCellCtrls:e=>this.setCellCtrls(e),showFullWidth:e=>this.showFullWidth(e),getFullWidthCellRenderer:()=>this.getFullWidthCellRenderer(),addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setUserStyles:e=>Dn(s,e),setTop:e=>r.top=e,setTransform:e=>r.transform=e,setRowIndex:e=>s.setAttribute("row-index",e),setRowId:e=>s.setAttribute("row-id",e),setRowBusinessKey:e=>s.setAttribute("row-business-key",e),refreshFullWidth:e=>this.refreshFullWidth(e)};e.setComp(a,this.getGui(),i),this.addDestroyFunc(()=>{e.unsetComp(i)})}getInitialStyle(e){const t=this.rowCtrl.getInitialTransform(e);return t?`transform: ${t}`:`top: ${this.rowCtrl.getInitialRowTop(e)}`}showFullWidth(e){const t=e.newAgStackInstance();t&&t.then(e=>{if(this.isAlive()){const t=e.getGui();this.getGui().appendChild(t),this.rowCtrl.setupDetailRowAutoHeight(t),this.setFullWidthRowComp(e)}else this.beans.context.destroyBean(e)})}setCellCtrls(e){const t=Object.assign({},this.cellComps);e.forEach(e=>{const i=e.getInstanceId();null==this.cellComps[i]?this.newCellComp(e):t[i]=null});const i=N(t).filter(e=>null!=e);this.destroyCells(i),this.ensureDomOrder(e)}ensureDomOrder(e){if(!this.domOrder)return;const t=[];e.forEach(e=>{const i=this.cellComps[e.getInstanceId()];i&&t.push(i.getGui())}),Mn(this.getGui(),t)}newCellComp(e){const t=new Ta(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=N(this.cellComps).filter(e=>null!=e);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(e=>{if(!e)return;const t=e.getCtrl().getInstanceId();this.cellComps[t]===e&&(e.detach(),e.destroy(),this.cellComps[t]=null)})}refreshFullWidth(e){const{fullWidthCellRenderer:t}=this;if(!t||!t.refresh)return!1;const i=e();return t.refresh(i)}},Ia=class extends vs{constructor(){super(function(){const e=vs.elementGettingCreated.getAttribute("name"),t=Ca.getRowContainerCssClasses(e);let i;return i="center"===e||"topCenter"===e||"stickyTopCenter"===e||"bottomCenter"===e||"stickyBottomCenter"===e?`<div class="${t.viewport}" ref="eViewport" role="presentation">\n                <div class="${t.container}" ref="eContainer"></div>\n            </div>`:`<div class="${t.container}" ref="eContainer"></div>`,i}()),this.rowComps={},this.name=vs.elementGettingCreated.getAttribute("name"),this.type=ma(this.name)}postConstruct(){const e={setViewportHeight:e=>this.eViewport.style.height=e,setRowCtrls:({rowCtrls:e})=>this.setRowCtrls(e),setDomOrder:e=>{this.domOrder=e},setContainerWidth:e=>this.eContainer.style.width=e};this.createManagedBean(new Ca(this.name)).setComp(e,this.eContainer,this.eViewport)}preDestroy(){this.setRowCtrls([])}setRowCtrls(e){const t=d({},this.rowComps);this.rowComps={},this.lastPlacedElement=null,e.forEach(e=>{const i=e.getInstanceId(),n=t[i];if(n)this.rowComps[i]=n,delete t[i],this.ensureDomOrder(n.getGui());else{if(!e.getRowNode().displayed)return;const t=new Da(e,this.beans,this.type);this.rowComps[i]=t,this.appendRow(t.getGui())}}),N(t).forEach(e=>{this.eContainer.removeChild(e.getGui()),e.destroy()}),Ht(this.eContainer,"rowgroup")}appendRow(e){this.domOrder?Tn(this.eContainer,e,this.lastPlacedElement):this.eContainer.appendChild(e),this.lastPlacedElement=e}ensureDomOrder(e){this.domOrder&&(An(this.eContainer,e,this.lastPlacedElement),this.lastPlacedElement=e)}};f([ue("beans")],Ia.prototype,"beans",2),f([bs("eViewport")],Ia.prototype,"eViewport",2),f([bs("eContainer")],Ia.prototype,"eContainer",2),f([le],Ia.prototype,"postConstruct",1),f([ce],Ia.prototype,"preDestroy",1);var Ra=class{constructor(e){this.columnsToAggregate=[],this.columnsToGroup=[],this.columnsToPivot=[],this.pinned=e}onDragEnter(e){if(this.clearColumnsList(),this.gos.get("functionsReadOnly"))return;const t=e.dragItem.columns;t&&t.forEach(e=>{e.isPrimary()&&(e.isAnyFunctionActive()||(e.isAllowValue()?this.columnsToAggregate.push(e):e.isAllowRowGroup()?this.columnsToGroup.push(e):e.isAllowPivot()&&this.columnsToPivot.push(e)))})}getIconName(){return this.columnsToAggregate.length+this.columnsToGroup.length+this.columnsToPivot.length>0?this.pinned?Lr.ICON_PINNED:Lr.ICON_MOVE:null}onDragLeave(e){this.clearColumnsList()}clearColumnsList(){this.columnsToAggregate.length=0,this.columnsToGroup.length=0,this.columnsToPivot.length=0}onDragging(e){}onDragStop(e){this.columnsToAggregate.length>0&&this.columnModel.addValueColumns(this.columnsToAggregate,"toolPanelDragAndDrop"),this.columnsToGroup.length>0&&this.columnModel.addRowGroupColumns(this.columnsToGroup,"toolPanelDragAndDrop"),this.columnsToPivot.length>0&&this.columnModel.addPivotColumns(this.columnsToPivot,"toolPanelDragAndDrop")}};f([ue("columnModel")],Ra.prototype,"columnModel",2),f([ue("gridOptionsService")],Ra.prototype,"gos",2);var ka=class{static attemptMoveColumns(e){const{isFromHeader:t,hDirection:i,xPosition:n,fromEnter:s,fakeEvent:r,pinned:o,gos:a,columnModel:l}=e,c=0===i,h=1===i;let{allMovingColumns:u}=e;if(t){let e=[];u.forEach(t=>{var i;let n=null,s=t.getParent();for(;null!=s&&1===s.getDisplayedLeafColumns().length;)n=s,s=s.getParent();null!=n?((null==(i=n.getColGroupDef())?void 0:i.marryChildren)?n.getProvidedColumnGroup().getLeafColumns():n.getLeafColumns()).forEach(t=>{e.includes(t)||e.push(t)}):e.includes(t)||e.push(t)}),u=e}const d=u.slice();l.sortColumnsLikeGridColumns(d);const p=this.calculateValidMoves({movingCols:d,draggingRight:h,xPosition:n,pinned:o,gos:a,columnModel:l}),g=this.calculateOldIndex(d,l);if(0===p.length)return;const f=p[0];let m=null!==g&&!s;if(t&&(m=null!==g),m&&!r){if(c&&f>=g)return;if(h&&f<=g)return}const y=l.getAllDisplayedColumns();let v=[],b=null;for(let e=0;e<p.length;e++){const t=p[e],i=l.getProposedColumnOrder(d,t);if(!l.doesOrderPassRules(i))continue;const n=i.filter(e=>y.includes(e));if(null===b)b=n;else if(!Re(n,b))break;const s=this.groupFragCount(i);v.push({move:t,fragCount:s})}return 0!==v.length?(v.sort((e,t)=>e.fragCount-t.fragCount),this.moveColumns(u,v[0].move,"uiColumnMoved",!1,l)):void 0}static moveColumns(e,t,i,n,s){return s.moveColumns(e,t,i,n),n?null:{columns:e,toIndex:t}}static calculateOldIndex(e,t){const i=t.getAllGridColumns(),n=Pe(e.map(e=>i.indexOf(e))),s=n[0];return Ie(n)-s!==n.length-1?null:s}static groupFragCount(e){function t(e){let t=[],i=e.getOriginalParent();for(;null!=i;)t.push(i),i=i.getOriginalParent();return t}let i=0;for(let n=0;n<e.length-1;n++){let s=t(e[n]),r=t(e[n+1]);[s,r]=s.length>r.length?[s,r]:[r,s],s.forEach(e=>{-1===r.indexOf(e)&&i++})}return i}static getDisplayedColumns(e,t){switch(t){case"left":return e.getDisplayedLeftColumns();case"right":return e.getDisplayedRightColumns();default:return e.getDisplayedCenterColumns()}}static calculateValidMoves(e){const{movingCols:t,draggingRight:i,xPosition:n,pinned:s,gos:r,columnModel:o}=e;if(r.get("suppressMovableColumns")||t.some(e=>e.getColDef().suppressMovable))return[];const a=this.getDisplayedColumns(o,s),l=o.getAllGridColumns(),c=a.filter(e=>He(t,e)),h=a.filter(e=>!He(t,e)),u=l.filter(e=>!He(t,e));let d,p=0,g=n;if(i){let e=0;c.forEach(t=>e+=t.getActualWidth()),g-=e}if(g>0){for(let e=0;e<h.length&&(g-=h[e].getActualWidth(),!(g<0));e++)p++;i&&p++}if(p>0){const e=h[p-1];d=u.indexOf(e)+1}else d=u.indexOf(h[0]),-1===d&&(d=0);const f=[d],m=(e,t)=>e-t;if(i){let e=d+1;const t=l.length-1;for(;e<=t;)f.push(e),e++;f.sort(m)}else{let e=d;const t=l.length-1;let i=l[e];for(;e<=t&&a.indexOf(i)<0;)e++,f.push(e),i=l[e];e=d-1;const n=0;for(;e>=n;)f.push(e),e--;f.sort(m).reverse()}return f}static normaliseX(e,t,i,n,s){const r=s.getHeaderRowContainerCtrl(t).getViewport();return i&&(e-=r.getBoundingClientRect().left),n.get("enableRtl")&&(e=r.clientWidth-e),null==t&&(e+=s.get("center").getCenterViewportScrollLeft()),e}},Pa=class{constructor(e){this.needToMoveLeft=!1,this.needToMoveRight=!1,this.lastMovedInfo=null,this.pinned=e,this.isCenterContainer=!b(e)}init(){this.ctrlsService.whenReady(e=>{this.gridBodyCon=e.gridBodyCtrl})}getIconName(){return this.pinned?Lr.ICON_PINNED:Lr.ICON_MOVE}onDragEnter(e){const t=e.dragItem.columns;if(0===e.dragSource.type)this.setColumnsVisible(t,!0,"uiColumnDragged");else{const i=e.dragItem.visibleState,n=(t||[]).filter(e=>i[e.getId()]);this.setColumnsVisible(n,!0,"uiColumnDragged")}this.setColumnsPinned(t,this.pinned,"uiColumnDragged"),this.onDragging(e,!0,!0)}onDragLeave(){this.ensureIntervalCleared(),this.lastMovedInfo=null}setColumnsVisible(e,t,i){if(e){const n=e.filter(e=>!e.getColDef().lockVisible);this.columnModel.setColumnsVisible(n,t,i)}}setColumnsPinned(e,t,i){if(e){const n=e.filter(e=>!e.getColDef().lockPinned);this.columnModel.setColumnsPinned(n,t,i)}}onDragStop(){this.onDragging(this.lastDraggingEvent,!1,!0,!0),this.ensureIntervalCleared(),this.lastMovedInfo=null}checkCenterForScrolling(e){if(this.isCenterContainer){const t=this.ctrlsService.get("center"),i=t.getCenterViewportScrollLeft(),n=i+t.getCenterWidth();this.gos.get("enableRtl")?(this.needToMoveRight=e<i+50,this.needToMoveLeft=e>n-50):(this.needToMoveLeft=e<i+50,this.needToMoveRight=e>n-50),this.needToMoveLeft||this.needToMoveRight?this.ensureIntervalStarted():this.ensureIntervalCleared()}}onDragging(e=this.lastDraggingEvent,t=!1,i=!1,n=!1){var s;if(n){if(this.lastMovedInfo){const{columns:e,toIndex:t}=this.lastMovedInfo;ka.moveColumns(e,t,"uiColumnMoved",!0,this.columnModel)}return}if(this.lastDraggingEvent=e,C(e.hDirection))return;const r=ka.normaliseX(e.x,this.pinned,!1,this.gos,this.ctrlsService);t||this.checkCenterForScrolling(r);const o=this.normaliseDirection(e.hDirection),a=e.dragSource.type,l=(null==(s=e.dragSource.getDragItem().columns)?void 0:s.filter(e=>!e.getColDef().lockPinned||e.getPinned()==this.pinned))||[],c=ka.attemptMoveColumns({allMovingColumns:l,isFromHeader:1===a,hDirection:o,xPosition:r,pinned:this.pinned,fromEnter:t,fakeEvent:i,gos:this.gos,columnModel:this.columnModel});c&&(this.lastMovedInfo=c)}normaliseDirection(e){if(!this.gos.get("enableRtl"))return e;switch(e){case 0:return 1;case 1:return 0;default:console.error(`AG Grid: Unknown direction ${e}`)}}ensureIntervalStarted(){this.movingIntervalId||(this.intervalCount=0,this.failedMoveAttempts=0,this.movingIntervalId=window.setInterval(this.moveInterval.bind(this),100),this.needToMoveLeft?this.dragAndDropService.setGhostIcon(Lr.ICON_LEFT,!0):this.dragAndDropService.setGhostIcon(Lr.ICON_RIGHT,!0))}ensureIntervalCleared(){this.movingIntervalId&&(window.clearInterval(this.movingIntervalId),this.movingIntervalId=null,this.dragAndDropService.setGhostIcon(Lr.ICON_MOVE))}moveInterval(){let e;this.intervalCount++,e=10+5*this.intervalCount,e>100&&(e=100);let t=null;const i=this.gridBodyCon.getScrollFeature();if(this.needToMoveLeft?t=i.scrollHorizontally(-e):this.needToMoveRight&&(t=i.scrollHorizontally(e)),0!==t)this.onDragging(this.lastDraggingEvent),this.failedMoveAttempts=0;else{this.failedMoveAttempts++;const e=this.lastDraggingEvent.dragItem.columns.filter(e=>!e.getColDef().lockPinned);if(e.length>0&&(this.dragAndDropService.setGhostIcon(Lr.ICON_PINNED),this.failedMoveAttempts>7)){const t=this.needToMoveLeft?"left":"right";this.setColumnsPinned(e,t,"uiColumnDragged"),this.dragAndDropService.nudge()}}}};f([ue("columnModel")],Pa.prototype,"columnModel",2),f([ue("dragAndDropService")],Pa.prototype,"dragAndDropService",2),f([ue("gridOptionsService")],Pa.prototype,"gos",2),f([ue("ctrlsService")],Pa.prototype,"ctrlsService",2),f([le],Pa.prototype,"init",1);var _a=class extends st{constructor(e,t){super(),this.pinned=e,this.eContainer=t}postConstruct(){this.ctrlsService.whenReady(e=>{switch(this.pinned){case"left":this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.left.getContainerElement()],[e.bottomLeft.getContainerElement()],[e.topLeft.getContainerElement()]];break;case"right":this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.right.getContainerElement()],[e.bottomRight.getContainerElement()],[e.topRight.getContainerElement()]];break;default:this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.center.getViewportElement()],[e.bottomCenter.getViewportElement()],[e.topCenter.getViewportElement()]]}})}isInterestedIn(e){return 1===e||0===e&&this.gos.get("allowDragFromColumnsToolPanel")}getSecondaryContainers(){return this.eSecondaryContainers}getContainer(){return this.eContainer}init(){this.moveColumnFeature=this.createManagedBean(new Pa(this.pinned)),this.bodyDropPivotTarget=this.createManagedBean(new Ra(this.pinned)),this.dragAndDropService.addDropTarget(this)}getIconName(){return this.currentDropListener.getIconName()}isDropColumnInPivotMode(e){return this.columnModel.isPivotMode()&&0===e.dragSource.type}onDragEnter(e){this.currentDropListener=this.isDropColumnInPivotMode(e)?this.bodyDropPivotTarget:this.moveColumnFeature,this.currentDropListener.onDragEnter(e)}onDragLeave(e){this.currentDropListener.onDragLeave(e)}onDragging(e){this.currentDropListener.onDragging(e)}onDragStop(e){this.currentDropListener.onDragStop(e)}};f([ue("dragAndDropService")],_a.prototype,"dragAndDropService",2),f([ue("columnModel")],_a.prototype,"columnModel",2),f([ue("ctrlsService")],_a.prototype,"ctrlsService",2),f([le],_a.prototype,"postConstruct",1),f([le],_a.prototype,"init",1);var La=class e extends Vo{constructor(t){super(e.TEMPLATE,t),this.headerCompVersion=0,this.column=t.getColumnGroupChild(),this.pinned=t.getPinned()}postConstruct(){const e=this.getGui();var t,i;t="col-id",null!=(i=this.column.getColId())&&""!=i?e.setAttribute(t,i):e.removeAttribute(t);const n={setWidth:t=>e.style.width=t,addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setAriaSort:t=>t?di(e,t):pi(e),setUserCompDetails:e=>this.setUserCompDetails(e),getUserCompInstance:()=>this.headerComp};this.ctrl.setComp(n,this.getGui(),this.eResize,this.eHeaderCompWrapper);const s=this.ctrl.getSelectAllGui();this.eResize.insertAdjacentElement("afterend",s)}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(e=>this.afterCompCreated(t,e))}afterCompCreated(e,t){e==this.headerCompVersion&&this.isAlive()?(this.destroyHeaderComp(),this.headerComp=t,this.headerCompGui=t.getGui(),this.eHeaderCompWrapper.appendChild(this.headerCompGui),this.ctrl.setDragSource(this.getGui())):this.destroyBean(t)}};La.TEMPLATE='<div class="ag-header-cell" role="columnheader">\n            <div ref="eResize" class="ag-header-cell-resize" role="presentation"></div>\n            <div ref="eHeaderCompWrapper" class="ag-header-cell-comp-wrapper" role="presentation"></div>\n        </div>',f([bs("eResize")],La.prototype,"eResize",2),f([bs("eHeaderCompWrapper")],La.prototype,"eHeaderCompWrapper",2),f([le],La.prototype,"postConstruct",1),f([ce],La.prototype,"destroyHeaderComp",1);var Na=La,Oa=class e extends Vo{constructor(t){super(e.TEMPLATE,t)}postConstruct(){const e=this.getGui();e.setAttribute("col-id",this.ctrl.getColId());const t={addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setResizableDisplayed:e=>an(this.eResize,e),setWidth:t=>e.style.width=t,setAriaExpanded:t=>{return i="aria-expanded",null!=(n=t)?e.setAttribute(i,n):e.removeAttribute(i);var i,n},setUserCompDetails:e=>this.setUserCompDetails(e),getUserCompInstance:()=>this.headerGroupComp};this.ctrl.setComp(t,e,this.eResize)}setUserCompDetails(e){e.newAgStackInstance().then(e=>this.afterHeaderCompCreated(e))}afterHeaderCompCreated(e){const t=()=>this.destroyBean(e);if(!this.isAlive())return void t();const i=this.getGui(),n=e.getGui();i.appendChild(n),this.addDestroyFunc(t),this.headerGroupComp=e,this.ctrl.setDragSource(i)}};Oa.TEMPLATE='<div class="ag-header-group-cell" role="columnheader">\n            <div ref="eResize" class="ag-header-cell-resize" role="presentation"></div>\n        </div>',f([bs("eResize")],Oa.prototype,"eResize",2),f([le],Oa.prototype,"postConstruct",1);var Fa=Oa,Ga=(e=>(e.COLUMN_GROUP="group",e.COLUMN="column",e.FLOATING_FILTER="filter",e))(Ga||{}),Ba=class extends vs{constructor(e){super(),this.headerComps={},this.ctrl=e,this.setTemplate(`<div class="${this.ctrl.getHeaderRowClass()}" role="row"></div>`)}init(){li(this.getGui(),this.ctrl.getAriaRowIndex());const e={setHeight:e=>this.getGui().style.height=e,setTop:e=>this.getGui().style.top=e,setHeaderCtrls:(e,t)=>this.setHeaderCtrls(e,t),setWidth:e=>this.getGui().style.width=e};this.ctrl.setComp(e)}destroyHeaderCtrls(){this.setHeaderCtrls([],!1)}setHeaderCtrls(e,t){if(!this.isAlive())return;const i=this.headerComps;if(this.headerComps={},e.forEach(e=>{const t=e.getInstanceId();let n=i[t];delete i[t],null==n&&(n=this.createHeaderComp(e),this.getGui().appendChild(n.getGui())),this.headerComps[t]=n}),P(i,(e,t)=>{this.getGui().removeChild(t.getGui()),this.destroyBean(t)}),t){const e=N(this.headerComps);e.sort((e,t)=>e.getCtrl().getColumnGroupChild().getLeft()-t.getCtrl().getColumnGroupChild().getLeft());const t=e.map(e=>e.getGui());Mn(this.getGui(),t)}}createHeaderComp(e){let t;switch(this.ctrl.getType()){case"group":t=new Fa(e);break;case"filter":t=new Uo(e);break;default:t=new Na(e)}return this.createBean(t),t.setParentComponent(this),t}};f([le],Ba.prototype,"init",1),f([ce],Ba.prototype,"destroyHeaderCtrls",1);var Va=0,Ha=class e extends st{constructor(e,t,i){super(),this.resizeToggleTimeout=0,this.resizeMultiplier=1,this.resizeFeature=null,this.lastFocusEvent=null,this.dragSource=null,this.columnGroupChild=e,this.parentRowCtrl=i,this.beans=t,this.instanceId=e.getUniqueId()+"-"+Va++}postConstruct(){this.addManagedPropertyListeners(["suppressHeaderFocus"],()=>this.refreshTabIndex())}shouldStopEventPropagation(e){const{headerRowIndex:t,column:i}=this.focusService.getFocusedHeader();return es(this.gos,e,t,i)}getWrapperHasFocus(){return this.gos.getActiveDomElement()===this.eGui}setGui(e){this.eGui=e,this.addDomData(),this.addManagedListener(this.beans.eventService,ct.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:i}=this;ta.refreshFirstAndLastStyles(e,t,i.columnModel)}refreshAriaColIndex(){const{beans:e,column:t}=this,i=e.columnModel.getAriaColumnIndex(t);hi(this.eGui,i)}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 i=this.gos.getActiveDomElement(),n=e.key===Zn.LEFT||e.key===Zn.RIGHT;if(this.isResizing&&(e.preventDefault(),e.stopImmediatePropagation()),i!==this.eGui||!e.shiftKey&&!e.altKey)return;if((this.isResizing||n)&&(e.preventDefault(),e.stopImmediatePropagation()),!n)return;const s=e.key===Zn.LEFT!==this.gos.get("enableRtl"),r=_r[s?"Left":"Right"];if(e.altKey){this.isResizing=!0,this.resizeMultiplier+=1;const i=this.getViewportAdjustedResizeDiff(e);this.resizeHeader(i,e.shiftKey),null==(t=this.resizeFeature)||t.toggleColumnResizing(!0)}else this.moveHeader(r)}getViewportAdjustedResizeDiff(e){let t=this.getResizeDiff(e);if(this.column.getPinned()){const e=this.pinnedWidthService.getPinnedLeftWidth(),i=this.pinnedWidthService.getPinnedRightWidth(),n=pn(this.ctrlsService.getGridBodyCtrl().getBodyViewportElement())-50;if(e+i+t>n){if(!(n>e+i))return 0;t=n-e-i}}return t}getResizeDiff(e){let t=e.key===Zn.LEFT!==this.gos.get("enableRtl");const i=this.column.getPinned(),n=this.gos.get("enableRtl");return i&&n!==("right"===i)&&(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;null==(e=this.resizeFeature)||e.toggleColumnResizing(!1)},150))}handleKeyDown(e){const t=this.getWrapperHasFocus();switch(e.key){case Zn.PAGE_DOWN:case Zn.PAGE_UP:case Zn.PAGE_HOME:case Zn.PAGE_END:t&&e.preventDefault()}}addDomData(){const t=e.DOM_DATA_KEY_HEADER_CTRL;this.gos.setDomData(this.eGui,t,this),this.addDestroyFunc(()=>this.gos.setDomData(this.eGui,t,null))}getGui(){return this.eGui}focus(e){return!!this.eGui&&(this.lastFocusEvent=e||null,this.eGui.focus(),!0)}getRowIndex(){return this.parentRowCtrl.getRowIndex()}getParentRowCtrl(){return this.parentRowCtrl}getPinned(){return this.parentRowCtrl.getPinned()}getInstanceId(){return this.instanceId}getColumnGroupChild(){return this.columnGroupChild}removeDragSource(){this.dragSource&&(this.dragAndDropService.removeDragSource(this.dragSource),this.dragSource=null)}handleContextMenuMouseEvent(e,t,i){const n=null!=e?e:t;this.gos.get("preventDefaultOnContextMenu")&&n.preventDefault();const s=i instanceof Se?i:void 0;this.menuService.isHeaderContextMenuEnabled(s)&&this.menuService.showHeaderContextMenu(s,e,t),this.dispatchColumnMouseEvent(ct.EVENT_COLUMN_HEADER_CONTEXT_MENU,i)}dispatchColumnMouseEvent(e,t){const i={type:e,column:t};this.eventService.dispatchEvent(i)}destroy(){super.destroy(),this.removeDragSource(),this.comp=null,this.column=null,this.resizeFeature=null,this.lastFocusEvent=null,this.columnGroupChild=null,this.parentRowCtrl=null,this.eGui=null}};Ha.DOM_DATA_KEY_HEADER_CTRL="headerCtrl",f([ue("pinnedWidthService")],Ha.prototype,"pinnedWidthService",2),f([ue("focusService")],Ha.prototype,"focusService",2),f([ue("userComponentFactory")],Ha.prototype,"userComponentFactory",2),f([ue("ctrlsService")],Ha.prototype,"ctrlsService",2),f([ue("dragAndDropService")],Ha.prototype,"dragAndDropService",2),f([ue("menuService")],Ha.prototype,"menuService",2),f([le],Ha.prototype,"postConstruct",1);var Ua=Ha,za=class extends st{constructor(e,t,i,n){super(),this.columnOrGroup=e,this.eCell=t,this.ariaEl=this.eCell.querySelector("[role=columnheader]")||this.eCell,this.colsSpanning=n,this.beans=i}setColsSpanning(e){this.colsSpanning=e,this.onLeftChanged()}getColumnOrGroup(){return this.beans.gos.get("enableRtl")&&this.colsSpanning?Ie(this.colsSpanning):this.columnOrGroup}postConstruct(){this.addManagedListener(this.columnOrGroup,Se.EVENT_LEFT_CHANGED,this.onLeftChanged.bind(this)),this.setLeftFirstTime(),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onLeftChanged.bind(this)),this.addManagedPropertyListener("domLayout",this.onLeftChanged.bind(this))}setLeftFirstTime(){const e=this.beans.gos.get("suppressColumnMoveAnimation"),t=b(this.columnOrGroup.getOldLeft());this.beans.columnAnimationService.isActive()&&t&&!e?this.animateInLeft():this.onLeftChanged()}animateInLeft(){const e=this.getColumnOrGroup(),t=e.getLeft(),i=e.getOldLeft(),n=this.modifyLeftForPrintLayout(e,i),s=this.modifyLeftForPrintLayout(e,t);this.setLeft(n),this.actualLeft=s,this.beans.columnAnimationService.executeNextVMTurn(()=>{this.actualLeft===s&&this.setLeft(s)})}onLeftChanged(){const e=this.getColumnOrGroup(),t=e.getLeft();this.actualLeft=this.modifyLeftForPrintLayout(e,t),this.setLeft(this.actualLeft)}modifyLeftForPrintLayout(e,t){if(!this.beans.gos.isDomLayout("print"))return t;if("left"===e.getPinned())return t;const i=this.beans.columnModel.getDisplayedColumnsLeftWidth();return"right"===e.getPinned()?i+this.beans.columnModel.getBodyContainerWidth()+t:i+t}setLeft(e){let t;if(b(e)&&(this.eCell.style.left=`${e}px`),this.columnOrGroup instanceof Se)t=this.columnOrGroup;else{const e=this.columnOrGroup.getLeafColumns();if(!e.length)return;e.length>1&&ui(this.ariaEl,e.length),t=e[0]}}};f([le],za.prototype,"postConstruct",1);var Wa=class extends st{constructor(e,t){super(),this.columns=e,this.element=t}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)}};f([ue("columnHoverService")],Wa.prototype,"columnHoverService",2),f([le],Wa.prototype,"postConstruct",1);var ja=class extends Ua{constructor(e,t,i){super(e,t,i),this.iconCreated=!1,this.column=e}setComp(e,t,i,n){this.comp=e,this.eButtonShowMainFilter=i,this.eFloatingFilterBody=n,this.setGui(t),this.setupActive(),this.setupWidth(),this.setupLeft(),this.setupHover(),this.setupFocus(),this.setupAria(),this.setupFilterButton(),this.setupUserComp(),this.setupSyncWithFilter(),this.setupUi(),this.addManagedListener(this.eButtonShowMainFilter,"click",this.showParentFilter.bind(this)),this.setupFilterChangedListener(),this.addManagedListener(this.column,Se.EVENT_COL_DEF_CHANGED,this.onColDefChanged.bind(this))}resizeHeader(){}moveHeader(){}setupActive(){const e=this.column.getColDef(),t=!!e.filter,i=!!e.floatingFilter;this.active=t&&i}setupUi(){if(this.comp.setButtonWrapperDisplayed(!this.suppressFilterButton&&this.active),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-full-body",this.suppressFilterButton),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-body",!this.suppressFilterButton),!this.active||this.iconCreated)return;const e=qn("filter",this.gos,this.column);e&&(this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(e))}setupFocus(){this.createManagedBean(new Ms(this.eGui,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)}))}setupAria(){const e=this.localeService.getLocaleTextFunc();$t(this.eButtonShowMainFilter,e("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(e){if(this.gos.getActiveDomElement()===this.eGui)return;const t=this.focusService.findNextFocusableElement(this.eGui,null,e.shiftKey);if(t)return this.beans.headerNavigationService.scrollToColumn(this.column),e.preventDefault(),void t.focus();const i=this.findNextColumnWithFloatingFilter(e.shiftKey);i&&this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:this.getParentRowCtrl().getRowIndex(),column:i},event:e})&&e.preventDefault()}findNextColumnWithFloatingFilter(e){const t=this.beans.columnModel;let i=this.column;do{if(i=e?t.getDisplayedColBefore(i):t.getDisplayedColAfter(i),!i)break}while(!i.getColDef().filter||!i.getColDef().floatingFilter);return i}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();switch(e.key){case Zn.UP:case Zn.DOWN:t||e.preventDefault();case Zn.LEFT:case Zn.RIGHT:if(t)return;e.stopPropagation();case Zn.ENTER:t&&this.focusService.focusInto(this.eGui)&&e.preventDefault();break;case Zn.ESCAPE:t||this.eGui.focus()}}onFocusIn(e){if(this.eGui.contains(e.relatedTarget))return;const t=!!e.relatedTarget&&!e.relatedTarget.classList.contains("ag-floating-filter"),i=!!e.relatedTarget&&hn(e.relatedTarget,"ag-floating-filter");if(t&&i&&e.target===this.eGui){const e=this.lastFocusEvent,t=!(!e||e.key!==Zn.TAB);if(e&&t){const t=e.shiftKey;this.focusService.focusInto(this.eGui,t)}}const n=this.getRowIndex();this.beans.focusService.setFocusedHeader(n,this.column)}setupHover(){this.createManagedBean(new Wa([this.column],this.eGui));const e=()=>{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,ct.EVENT_COLUMN_HOVER_CHANGED,e),e()}setupLeft(){const e=new za(this.column,this.eGui,this.beans);this.createManagedBean(e)}setupFilterButton(){this.suppressFilterButton=!this.menuService.isFloatingFilterButtonEnabled(this.column),this.highlightFilterButtonWhenActive=!this.menuService.isLegacyMenuEnabled()}setupUserComp(){if(!this.active)return;const e=this.beans.filterManager.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter());e&&this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setCompDetails(e)}showParentFilter(){const e=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;this.menuService.showFilterMenu({column:this.column,buttonElement:e,containerType:"floatingFilter",positionBy:"button"})}setupSyncWithFilter(){if(!this.active)return;const{filterManager:e}=this.beans,t=t=>{if("filterDestroyed"===(null==t?void 0:t.source)&&this.context.isDestroyed())return;const i=this.comp.getFloatingFilterComp();i&&i.then(i=>{var n;if(i){const s=e.getCurrentFloatingFilterParentModel(this.column);i.onParentModelChanged(s,t?this.gos.addGridCommonParams({columns:null!=(n=t.columns)?n:[],type:ct.EVENT_FILTER_CHANGED,source:"api"===t.source?"api":"columnFilter"}):null)}})};this.destroySyncListener=this.addManagedListener(this.column,Se.EVENT_FILTER_CHANGED,t),e.isFilterActive(this.column)&&t(null)}setupWidth(){const e=()=>{const e=`${this.column.getActualWidth()}px`;this.comp.setWidth(e)};this.addManagedListener(this.column,Se.EVENT_WIDTH_CHANGED,e),e()}setupFilterChangedListener(){this.active&&(this.destroyFilterChangedListener=this.addManagedListener(this.column,Se.EVENT_FILTER_CHANGED,this.updateFilterButton.bind(this)),this.updateFilterButton())}updateFilterButton(){if(!this.suppressFilterButton&&this.comp){const e=this.beans.filterManager.isFilterAllowed(this.column);this.comp.setButtonWrapperDisplayed(e),this.highlightFilterButtonWhenActive&&e&&this.eButtonShowMainFilter.classList.toggle("ag-filter-active",this.column.isFilterActive())}}onColDefChanged(){var e,t;const i=this.active;this.setupActive();const n=!i&&this.active;i&&!this.active&&(null==(e=this.destroySyncListener)||e.call(this),null==(t=this.destroyFilterChangedListener)||t.call(this));const s=this.active?this.beans.filterManager.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter()):null,r=this.comp.getFloatingFilterComp();r&&s?r.then(e=>{var t;!e||this.beans.filterManager.areFilterCompsDifferent(null!=(t=this.userCompDetails)?t:null,s)?this.updateCompDetails(s,n):this.updateFloatingFilterParams(s)}):this.updateCompDetails(s,n)}updateCompDetails(e,t){this.isAlive()&&(this.setCompDetails(e),this.setupFilterButton(),this.setupUi(),t&&(this.setupSyncWithFilter(),this.setupFilterChangedListener()))}updateFloatingFilterParams(e){var t;if(!e)return;const i=e.params;null==(t=this.comp.getFloatingFilterComp())||t.then(e=>{let t=!1;(null==e?void 0:e.refresh)&&"function"==typeof e.refresh&&null!==e.refresh(i)&&(t=!0),!t&&(null==e?void 0:e.onParamsUpdated)&&"function"==typeof e.onParamsUpdated&&null!==e.onParamsUpdated(i)&&z("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}},$a=class extends st{constructor(e,t,i,n,s){super(),this.pinned=e,this.column=t,this.eResize=i,this.comp=n,this.ctrl=s}postConstruct(){const e=[];let t,i;const n=()=>{if(an(this.eResize,t),!t)return;const n=this.horizontalResizeService.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(e.push(n),i){const t=this.gos.get("skipHeaderOnAutoSize"),i=()=>{this.columnModel.autoSizeColumn(this.column,"uiColumnResized",t)};this.eResize.addEventListener("dblclick",i);const n=new gr(this.eResize);n.addEventListener(gr.EVENT_DOUBLE_TAP,i),e.push(()=>{this.eResize.removeEventListener("dblclick",i),n.removeEventListener(gr.EVENT_DOUBLE_TAP,i),n.destroy()})}},s=()=>{e.forEach(e=>e()),e.length=0},r=()=>{const e=this.column.isResizable(),r=!this.gos.get("suppressAutoSize")&&!this.column.getColDef().suppressAutoSize;(e!==t||r!==i)&&(t=e,i=r,s(),n())};r(),this.addDestroyFunc(s),this.ctrl.addRefreshFunction(r)}onResizing(e,t){const{column:i,lastResizeAmount:n,resizeStartWidth:s}=this,r=this.normaliseResizeAmount(t),o=[{key:i,newWidth:s+r}];this.column.getPinned()&&this.pinnedWidthService.getPinnedLeftWidth()+this.pinnedWidthService.getPinnedRightWidth()+(r-n)>pn(this.ctrlsService.getGridBodyCtrl().getBodyViewportElement())-50||(this.lastResizeAmount=r,this.columnModel.setColumnWidths(o,this.resizeWithShiftKey,e,"uiColumnResized"),e&&this.toggleColumnResizing(!1))}onResizeStart(e){this.resizeStartWidth=this.column.getActualWidth(),this.lastResizeAmount=0,this.resizeWithShiftKey=e,this.toggleColumnResizing(!0)}toggleColumnResizing(e){this.comp.addOrRemoveCssClass("ag-column-resizing",e)}normaliseResizeAmount(e){let t=e;const i="left"!==this.pinned,n="right"===this.pinned;return this.gos.get("enableRtl")?i&&(t*=-1):n&&(t*=-1),t}};f([ue("horizontalResizeService")],$a.prototype,"horizontalResizeService",2),f([ue("pinnedWidthService")],$a.prototype,"pinnedWidthService",2),f([ue("ctrlsService")],$a.prototype,"ctrlsService",2),f([ue("columnModel")],$a.prototype,"columnModel",2),f([le],$a.prototype,"postConstruct",1);var Ka=class extends st{constructor(e){super(),this.cbSelectAllVisible=!1,this.processingEventFromCheckbox=!1,this.column=e}onSpaceKeyDown(e){const t=this.cbSelectAll;t.isDisplayed()&&!t.getGui().contains(this.gos.getActiveDomElement())&&(e.preventDefault(),t.setValue(!t.getValue()))}getCheckboxGui(){return this.cbSelectAll.getGui()}setComp(e){this.headerCellCtrl=e,this.cbSelectAll=this.createManagedBean(new Vs),this.cbSelectAll.addCssClass("ag-header-select-all"),Ht(this.cbSelectAll.getGui(),"presentation"),this.showOrHideSelectAll(),this.addManagedListener(this.eventService,ct.EVENT_NEW_COLUMNS_LOADED,this.onNewColumnsLoaded.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_SELECTION_CHANGED,this.onSelectionChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_PAGINATION_CHANGED,this.onSelectionChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_MODEL_UPDATED,this.onModelChanged.bind(this)),this.addManagedListener(this.cbSelectAll,ct.EVENT_FIELD_VALUE_CHANGED,this.onCbSelectAll.bind(this)),ei(this.cbSelectAll.getGui(),!0),this.cbSelectAll.getInputElement().setAttribute("tabindex","-1"),this.refreshSelectAllLabel()}onNewColumnsLoaded(){this.showOrHideSelectAll()}onDisplayedColumnsChanged(){this.isAlive()&&this.showOrHideSelectAll()}showOrHideSelectAll(){this.cbSelectAllVisible=this.isCheckboxSelection(),this.cbSelectAll.setDisplayed(this.cbSelectAllVisible,{skipAriaHidden:!0}),this.cbSelectAllVisible&&(this.checkRightRowModelType("selectAllCheckbox"),this.checkSelectionType("selectAllCheckbox"),this.updateStateOfCheckbox()),this.refreshSelectAllLabel()}onModelChanged(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()}onSelectionChanged(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()}updateStateOfCheckbox(){if(this.processingEventFromCheckbox)return;this.processingEventFromCheckbox=!0;const e=this.selectionService.getSelectAllState(this.isFilteredOnly(),this.isCurrentPageOnly());this.cbSelectAll.setValue(e);const t=this.selectionService.hasNodesToSelect(this.isFilteredOnly(),this.isCurrentPageOnly());this.cbSelectAll.setDisabled(!t),this.refreshSelectAllLabel(),this.processingEventFromCheckbox=!1}refreshSelectAllLabel(){const e=this.localeService.getLocaleTextFunc(),t=this.cbSelectAll.getValue()?e("ariaChecked","checked"):e("ariaUnchecked","unchecked"),i=e("ariaRowSelectAll","Press Space to toggle all rows selection");this.cbSelectAllVisible?this.headerCellCtrl.setAriaDescriptionProperty("selectAll",`${i} (${t})`):this.headerCellCtrl.setAriaDescriptionProperty("selectAll",null),this.cbSelectAll.setInputAriaLabel(`${i} (${t})`),this.headerCellCtrl.announceAriaDescription()}checkSelectionType(e){return!("multiple"!==this.gos.get("rowSelection")&&(console.warn(`AG Grid: ${e} is only available if using 'multiple' rowSelection.`),1))}checkRightRowModelType(e){const t=this.rowModel.getType();return!("clientSide"!==t&&"serverSide"!==t&&(console.warn(`AG Grid: ${e} is only available if using 'clientSide' or 'serverSide' rowModelType, you are using ${t}.`),1))}onCbSelectAll(){if(this.processingEventFromCheckbox)return;if(!this.cbSelectAllVisible)return;const e=this.cbSelectAll.getValue(),t=this.isFilteredOnly(),i=this.isCurrentPageOnly();let n="uiSelectAll";i?n="uiSelectAllCurrentPage":t&&(n="uiSelectAllFiltered");const s={source:n,justFiltered:t,justCurrentPage:i};e?this.selectionService.selectAllRowNodes(s):this.selectionService.deselectAllRowNodes(s)}isCheckboxSelection(){let e=this.column.getColDef().headerCheckboxSelection;return"function"==typeof e&&(e=e(this.gos.addGridCommonParams({column:this.column,colDef:this.column.getColDef()}))),!!e&&this.checkRightRowModelType("headerCheckboxSelection")&&this.checkSelectionType("headerCheckboxSelection")}isFilteredOnly(){return!!this.column.getColDef().headerCheckboxSelectionFilteredOnly}isCurrentPageOnly(){return!!this.column.getColDef().headerCheckboxSelectionCurrentPageOnly}};f([ue("rowModel")],Ka.prototype,"rowModel",2),f([ue("selectionService")],Ka.prototype,"selectionService",2);var Ya=class extends Ua{constructor(e,t,i){super(e,t,i),this.refreshFunctions=[],this.userHeaderClasses=new Set,this.ariaDescriptionProperties=new Map,this.column=e}setComp(e,t,i,n){this.comp=e,this.setGui(t),this.updateState(),this.setupWidth(),this.setupMovingCss(),this.setupMenuClass(),this.setupSortableClass(),this.setupWrapTextClass(),this.refreshSpanHeaderHeight(),this.setupAutoHeight(n),this.addColumnHoverListener(),this.setupFilterClass(),this.setupClassesFromColDef(),this.setupTooltip(),this.addActiveHeaderMouseListeners(),this.setupSelectAll(),this.setupUserComp(),this.refreshAria(),this.resizeFeature=this.createManagedBean(new $a(this.getPinned(),this.column,i,e,this)),this.createManagedBean(new Wa([this.column],t)),this.createManagedBean(new za(this.column,t,this.beans)),this.createManagedBean(new Ms(t,{shouldStopEventPropagation:e=>this.shouldStopEventPropagation(e),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,Se.EVENT_COL_DEF_CHANGED,this.refresh.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_VALUE_CHANGED,this.onColumnValueChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_ROW_GROUP_CHANGED,this.onColumnRowGroupChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PIVOT_CHANGED,this.onColumnPivotChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_HEADER_HEIGHT_CHANGED,this.onHeaderHeightChanged.bind(this))}resizeHeader(e,t){var i,n;if(!this.column.isResizable())return;const s=this.column.getActualWidth(),r=null!=(i=this.column.getMinWidth())?i:0,o=null!=(n=this.column.getMaxWidth())?n:Number.MAX_SAFE_INTEGER,a=Math.min(Math.max(s+e,r),o);this.beans.columnModel.setColumnWidths([{key:this.column,newWidth:a}],t,!0,"uiColumnResized")}moveHeader(e){const{eGui:t,column:i,gos:n,ctrlsService:s}=this,r=this.getPinned(),o=t.getBoundingClientRect().left,a=i.getActualWidth(),l=0===e!==n.get("enableRtl"),c=ka.normaliseX(l?o-20:o+a+20,r,!0,n,s);ka.attemptMoveColumns({allMovingColumns:[i],isFromHeader:!0,hDirection:e,xPosition:c,pinned:r,fromEnter:!1,fakeEvent:!1,gos:n,columnModel:this.beans.columnModel}),s.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(i,"auto")}setupUserComp(){const e=this.lookupUserCompDetails();this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setUserCompDetails(e)}lookupUserCompDetails(){const e=this.createParams(),t=this.column.getColDef();return this.userComponentFactory.getHeaderCompDetails(t,e)}createParams(){return this.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 Ka(this.column)),this.selectAllFeature.setComp(this)}getSelectAllGui(){return this.selectAllFeature.getCheckboxGui()}handleKeyDown(e){super.handleKeyDown(e),e.key===Zn.SPACE&&this.selectAllFeature.onSpaceKeyDown(e),e.key===Zn.ENTER&&this.onEnterKeyDown(e),e.key===Zn.DOWN&&e.altKey&&this.showMenuOnKeyPress(e,!1)}onEnterKeyDown(e){if(e.ctrlKey||e.metaKey)this.showMenuOnKeyPress(e,!0);else if(this.sortable){const t=e.shiftKey;this.beans.sortController.progressSort(this.column,t,"uiColumnSorted")}}showMenuOnKeyPress(e,t){const i=this.comp.getUserCompInstance();i&&i instanceof vr&&i.onMenuKeyboardShortcut(t)&&e.preventDefault()}onFocusIn(e){if(!this.getGui().contains(e.relatedTarget)){const e=this.getRowIndex();this.focusService.setFocusedHeader(e,this.column),this.announceAriaDescription()}this.focusService.isKeyboardMode()&&this.setActiveHeader(!0)}onFocusOut(e){this.getGui().contains(e.relatedTarget)||this.setActiveHeader(!1)}setupTooltip(e,t){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature));const i="whenTruncated"===this.gos.get("tooltipShowMode"),n=this.eGui,s=this.column.getColDef();t||!i||s.headerComponent||(t=()=>{const e=n.querySelector(".ag-header-cell-text");return!e||e.scrollWidth>e.clientWidth});const r={getColumn:()=>this.column,getColDef:()=>this.column.getColDef(),getGui:()=>n,getLocation:()=>"header",getTooltipValue:()=>null!=e?e:this.column.getColDef().headerTooltip,shouldDisplayTooltip:t},o=this.createManagedBean(new fs(r));this.refreshFunctions.push(()=>o.refreshToolTip())}setupClassesFromColDef(){const e=()=>{const e=this.column.getColDef(),t=ta.getHeaderClassesFromColDef(e,this.gos,this.column,null),i=this.userHeaderClasses;this.userHeaderClasses=new Set(t),t.forEach(e=>{i.has(e)?i.delete(e):this.comp.addOrRemoveCssClass(e,!0)}),i.forEach(e=>this.comp.addOrRemoveCssClass(e,!1))};this.refreshFunctions.push(e),e()}setDragSource(e){if(this.dragSourceElement=e,this.removeDragSource(),!e||!this.draggable)return;const{column:t,beans:i,displayName:n,dragAndDropService:s,gos:r}=this,{columnModel:o}=i;let a=!this.gos.get("suppressDragLeaveHidesColumns");const l=this.dragSource={type:1,eElement:e,getDefaultIconName:()=>a?Lr.ICON_HIDE:Lr.ICON_NOT_ALLOWED,getDragItem:()=>this.createDragItem(t),dragItemName:n,onDragStarted:()=>{a=!r.get("suppressDragLeaveHidesColumns"),t.setMoving(!0,"uiColumnMoved")},onDragStopped:()=>t.setMoving(!1,"uiColumnMoved"),onGridEnter:e=>{var t;if(a){const i=(null==(t=null==e?void 0:e.columns)?void 0:t.filter(e=>!e.getColDef().lockVisible))||[];o.setColumnsVisible(i,!0,"uiColumnMoved")}},onGridExit:e=>{var t;if(a){const i=(null==(t=null==e?void 0:e.columns)?void 0:t.filter(e=>!e.getColDef().lockVisible))||[];o.setColumnsVisible(i,!1,"uiColumnMoved")}}};s.addDragSource(l,!0)}createDragItem(e){const t={};return t[e.getId()]=e.isVisible(),{columns:[e],visibleState:t}}updateState(){this.menuEnabled=this.menuService.isColumnMenuInHeaderEnabled(this.column),this.openFilterEnabled=this.menuService.isFilterMenuInHeaderEnabled(this.column),this.sortable=this.column.isSortable(),this.displayName=this.calculateDisplayName(),this.draggable=this.workOutDraggable()}addRefreshFunction(e){this.refreshFunctions.push(e)}refresh(){this.updateState(),this.refreshHeaderComp(),this.refreshAria(),this.refreshFunctions.forEach(e=>e())}refreshHeaderComp(){const e=this.lookupUserCompDetails();null!=this.comp.getUserCompInstance()&&this.userCompDetails.componentClass==e.componentClass&&this.attemptHeaderCompRefresh(e.params)?this.setDragSource(this.dragSourceElement):this.setCompDetails(e)}attemptHeaderCompRefresh(e){const t=this.comp.getUserCompInstance();return!!t&&(!!t.refresh&&t.refresh(e))}calculateDisplayName(){return this.beans.columnModel.getDisplayNameForColumn(this.column,"header",!0)}checkDisplayName(){this.displayName!==this.calculateDisplayName()&&this.refresh()}workOutDraggable(){const e=this.column.getColDef();return!(this.gos.get("suppressMovableColumns")||e.suppressMovable||e.lockPosition)||!!e.enableRowGroup||!!e.enablePivot}onColumnRowGroupChanged(){this.checkDisplayName()}onColumnPivotChanged(){this.checkDisplayName()}onColumnValueChanged(){this.checkDisplayName()}setupWidth(){const e=()=>{const e=this.column.getActualWidth();this.comp.setWidth(`${e}px`)};this.addManagedListener(this.column,Se.EVENT_WIDTH_CHANGED,e),e()}setupMovingCss(){const e=()=>{this.comp.addOrRemoveCssClass("ag-header-cell-moving",this.column.isMoving())};this.addManagedListener(this.column,Se.EVENT_MOVING_CHANGED,e),e()}setupMenuClass(){const e=()=>{this.comp.addOrRemoveCssClass("ag-column-menu-visible",this.column.isMenuVisible())};this.addManagedListener(this.column,Se.EVENT_MENU_VISIBLE_CHANGED,e),e()}setupSortableClass(){const e=()=>{this.comp.addOrRemoveCssClass("ag-header-cell-sortable",!!this.sortable)};e(),this.addRefreshFunction(e),this.addManagedListener(this.eventService,Se.EVENT_SORT_CHANGED,this.refreshAriaSort.bind(this))}setupFilterClass(){const e=()=>{const e=this.column.isFilterActive();this.comp.addOrRemoveCssClass("ag-header-cell-filtered",e),this.refreshAria()};this.addManagedListener(this.column,Se.EVENT_FILTER_ACTIVE_CHANGED,e),e()}setupWrapTextClass(){const e=()=>{const e=!!this.column.getColDef().wrapHeaderText;this.comp.addOrRemoveCssClass("ag-header-cell-wrap-text",e)};e(),this.addRefreshFunction(e)}onDisplayedColumnsChanged(){super.onDisplayedColumnsChanged(),this.isAlive()&&this.onHeaderHeightChanged()}onHeaderHeightChanged(){this.refreshSpanHeaderHeight()}refreshSpanHeaderHeight(){const{eGui:e,column:t,comp:i,beans:n}=this;if(!t.isSpanHeaderHeight())return e.style.removeProperty("top"),e.style.removeProperty("height"),i.addOrRemoveCssClass("ag-header-span-height",!1),void i.addOrRemoveCssClass("ag-header-span-total",!1);const{numberOfParents:s,isSpanningTotal:r}=this.column.getColumnGroupPaddingInfo();i.addOrRemoveCssClass("ag-header-span-height",s>0);const{columnModel:o}=n,a=o.getColumnHeaderRowHeight();if(0===s)return i.addOrRemoveCssClass("ag-header-span-total",!1),e.style.setProperty("top","0px"),void e.style.setProperty("height",`${a}px`);i.addOrRemoveCssClass("ag-header-span-total",r);const l=s*(o.isPivotMode()?o.getPivotGroupHeaderHeight():o.getGroupHeaderHeight());e.style.setProperty("top",-l+"px"),e.style.setProperty("height",`${a+l}px`)}setupAutoHeight(e){const{columnModel:t,resizeObserverService:i}=this.beans,n=i=>{if(!this.isAlive())return;const{paddingTop:s,paddingBottom:r,borderBottomWidth:o,borderTopWidth:a}=un(this.getGui()),l=s+r+o+a,c=e.offsetHeight+l;if(i<5){const t=this.beans.gos.getDocument();if(!t||!t.contains(e)||0==c)return void window.setTimeout(()=>n(i+1),0)}t.setColumnHeaderHeight(this.column,c)};let s,r=!1;const o=()=>{const e=this.column.isAutoHeaderHeight();e&&!r&&a(),!e&&r&&l()},a=()=>{r=!0,n(0),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!0),s=i.observeResize(e,()=>n(0))},l=()=>{r=!1,s&&s(),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!1),s=void 0};o(),this.addDestroyFunc(()=>l()),this.addManagedListener(this.column,Se.EVENT_WIDTH_CHANGED,()=>r&&n(0)),this.addManagedListener(this.eventService,Se.EVENT_SORT_CHANGED,()=>{r&&window.setTimeout(()=>n(0))}),this.addRefreshFunction(o)}refreshAriaSort(){if(this.sortable){const e=this.localeService.getLocaleTextFunc(),t=this.beans.sortController.getDisplaySortForColumn(this.column)||null;this.comp.setAriaSort(Ut(t)),this.setAriaDescriptionProperty("sort",e("ariaSortableColumn","Press ENTER to sort"))}else this.comp.setAriaSort(),this.setAriaDescriptionProperty("sort",null)}refreshAriaMenu(){if(this.menuEnabled){const e=this.localeService.getLocaleTextFunc();this.setAriaDescriptionProperty("menu",e("ariaMenuColumn","Press ALT DOWN to open column menu"))}else this.setAriaDescriptionProperty("menu",null)}refreshAriaFilterButton(){if(this.openFilterEnabled&&!this.menuService.isLegacyMenuEnabled()){const e=this.localeService.getLocaleTextFunc();this.setAriaDescriptionProperty("filterButton",e("ariaFilterColumn","Press CTRL ENTER to open filter"))}else this.setAriaDescriptionProperty("filterButton",null)}refreshAriaFiltered(){const e=this.localeService.getLocaleTextFunc();this.column.isFilterActive()?this.setAriaDescriptionProperty("filter",e("ariaColumnFiltered","Column Filtered")):this.setAriaDescriptionProperty("filter",null)}setAriaDescriptionProperty(e,t){null!=t?this.ariaDescriptionProperties.set(e,t):this.ariaDescriptionProperties.delete(e)}announceAriaDescription(){if(!this.eGui.contains(this.beans.gos.getActiveDomElement()))return;const e=Array.from(this.ariaDescriptionProperties.keys()).sort((e,t)=>"filter"===e?-1:t.charCodeAt(0)-e.charCodeAt(0)).map(e=>this.ariaDescriptionProperties.get(e)).join(". ");this.beans.ariaAnnouncementService.announceValue(e)}refreshAria(){this.refreshAriaSort(),this.refreshAriaMenu(),this.refreshAriaFilterButton(),this.refreshAriaFiltered()}addColumnHoverListener(){const e=()=>{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,ct.EVENT_COLUMN_HOVER_CHANGED,e),e()}getColId(){return this.column.getColId()}addActiveHeaderMouseListeners(){const e=e=>this.handleMouseOverChange("mouseenter"===e.type);this.addManagedListener(this.getGui(),"mouseenter",e),this.addManagedListener(this.getGui(),"mouseleave",e),this.addManagedListener(this.getGui(),"click",()=>this.dispatchColumnMouseEvent(ct.EVENT_COLUMN_HEADER_CLICKED,this.column)),this.addManagedListener(this.getGui(),"contextmenu",e=>this.handleContextMenuMouseEvent(e,void 0,this.column))}handleMouseOverChange(e){this.setActiveHeader(e);const t={type:e?ct.EVENT_COLUMN_HEADER_MOUSE_OVER:ct.EVENT_COLUMN_HEADER_MOUSE_LEAVE,column:this.column};this.eventService.dispatchEvent(t)}setActiveHeader(e){this.comp.addOrRemoveCssClass("ag-header-active",e)}getAnchorElementForMenu(e){const t=this.comp.getUserCompInstance();return t instanceof vr?t.getAnchorElementForMenu(e):this.getGui()}destroy(){super.destroy(),this.refreshFunctions=null,this.selectAllFeature=null,this.dragSourceElement=null,this.userCompDetails=null,this.userHeaderClasses=null,this.ariaDescriptionProperties=null}},qa=class extends st{constructor(e,t,i,n){super(),this.eResize=t,this.comp=e,this.pinned=i,this.columnGroup=n}postConstruct(){if(!this.columnGroup.isResizable())return void this.comp.setResizableDisplayed(!1);const e=this.horizontalResizeService.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(this.addDestroyFunc(e),!this.gos.get("suppressAutoSize")){const e=this.gos.get("skipHeaderOnAutoSize");this.eResize.addEventListener("dblclick",()=>{const t=[];this.columnGroup.getDisplayedLeafColumns().forEach(e=>{e.getColDef().suppressAutoSize||t.push(e.getColId())}),t.length>0&&this.columnModel.autoSizeColumns({columns:t,skipHeader:e,stopAtGroup:this.columnGroup,source:"uiColumnResized"}),this.resizeLeafColumnsToFit("uiColumnResized")})}}onResizeStart(e){const t=this.getInitialValues(e);this.storeLocalValues(t),this.toggleColumnResizing(!0)}onResizing(e,t,i="uiColumnResized"){const n=this.normaliseDragChange(t),s=this.resizeStartWidth+n;this.resizeColumnsFromLocalValues(s,i,e)}getInitialValues(e){const t=this.getColumnsToResize(),i=this.getInitialSizeOfColumns(t),n={columnsToResize:t,resizeStartWidth:i,resizeRatios:this.getSizeRatiosOfColumns(t,i)};let s=null;if(e&&(s=this.columnModel.getDisplayedGroupAtDirection(this.columnGroup,"After")),s){const e=s.getDisplayedLeafColumns(),t=n.groupAfterColumns=e.filter(e=>e.isResizable()),i=n.groupAfterStartWidth=this.getInitialSizeOfColumns(t);n.groupAfterRatios=this.getSizeRatiosOfColumns(t,i)}else n.groupAfterColumns=void 0,n.groupAfterStartWidth=void 0,n.groupAfterRatios=void 0;return n}storeLocalValues(e){const{columnsToResize:t,resizeStartWidth:i,resizeRatios:n,groupAfterColumns:s,groupAfterStartWidth:r,groupAfterRatios:o}=e;this.resizeCols=t,this.resizeStartWidth=i,this.resizeRatios=n,this.resizeTakeFromCols=s,this.resizeTakeFromStartWidth=r,this.resizeTakeFromRatios=o}clearLocalValues(){this.resizeCols=void 0,this.resizeRatios=void 0,this.resizeTakeFromCols=void 0,this.resizeTakeFromRatios=void 0}resizeLeafColumnsToFit(e){const t=this.autoWidthCalculator.getPreferredWidthForColumnGroup(this.columnGroup),i=this.getInitialValues();t>i.resizeStartWidth&&this.resizeColumns(i,t,e,!0)}resizeColumnsFromLocalValues(e,t,i=!0){var n,s,r;if(!this.resizeCols||!this.resizeRatios)return;const o={columnsToResize:this.resizeCols,resizeStartWidth:this.resizeStartWidth,resizeRatios:this.resizeRatios,groupAfterColumns:null!=(n=this.resizeTakeFromCols)?n:void 0,groupAfterStartWidth:null!=(s=this.resizeTakeFromStartWidth)?s:void 0,groupAfterRatios:null!=(r=this.resizeTakeFromRatios)?r:void 0};this.resizeColumns(o,e,t,i)}resizeColumns(e,t,i,n=!0){const{columnsToResize:s,resizeStartWidth:r,resizeRatios:o,groupAfterColumns:a,groupAfterStartWidth:l,groupAfterRatios:c}=e,h=[];if(h.push({columns:s,ratios:o,width:t}),a){const e=t-r;h.push({columns:a,ratios:c,width:l-e})}this.columnModel.resizeColumnSets({resizeSets:h,finished:n,source:i}),n&&this.toggleColumnResizing(!1)}toggleColumnResizing(e){this.comp.addOrRemoveCssClass("ag-column-resizing",e)}getColumnsToResize(){return this.columnGroup.getDisplayedLeafColumns().filter(e=>e.isResizable())}getInitialSizeOfColumns(e){return e.reduce((e,t)=>e+t.getActualWidth(),0)}getSizeRatiosOfColumns(e,t){return e.map(e=>e.getActualWidth()/t)}normaliseDragChange(e){let t=e;return this.gos.get("enableRtl")?"left"!==this.pinned&&(t*=-1):"right"===this.pinned&&(t*=-1),t}destroy(){super.destroy(),this.clearLocalValues()}};f([ue("horizontalResizeService")],qa.prototype,"horizontalResizeService",2),f([ue("autoWidthCalculator")],qa.prototype,"autoWidthCalculator",2),f([ue("columnModel")],qa.prototype,"columnModel",2),f([le],qa.prototype,"postConstruct",1);var Xa=class extends st{constructor(e,t){super(),this.removeChildListenersFuncs=[],this.columnGroup=t,this.comp=e}postConstruct(){this.addListenersToChildrenColumns(),this.addManagedListener(this.columnGroup,lt.EVENT_DISPLAYED_CHILDREN_CHANGED,this.onDisplayedChildrenChanged.bind(this)),this.onWidthChanged(),this.addDestroyFunc(this.removeListenersOnChildrenColumns.bind(this))}addListenersToChildrenColumns(){this.removeListenersOnChildrenColumns();const e=this.onWidthChanged.bind(this);this.columnGroup.getLeafColumns().forEach(t=>{t.addEventListener("widthChanged",e),t.addEventListener("visibleChanged",e),this.removeChildListenersFuncs.push(()=>{t.removeEventListener("widthChanged",e),t.removeEventListener("visibleChanged",e)})})}removeListenersOnChildrenColumns(){this.removeChildListenersFuncs.forEach(e=>e()),this.removeChildListenersFuncs=[]}onDisplayedChildrenChanged(){this.addListenersToChildrenColumns(),this.onWidthChanged()}onWidthChanged(){const e=this.columnGroup.getActualWidth();this.comp.setWidth(`${e}px`),this.comp.addOrRemoveCssClass("ag-hidden",0===e)}};f([le],Xa.prototype,"postConstruct",1);var Za=class extends Ua{constructor(e,t,i){super(e,t,i),this.onSuppressColMoveChange=()=>{if(!this.isAlive()||this.isSuppressMoving())this.removeDragSource();else if(!this.dragSource){const e=this.getGui();this.setDragSource(e)}},this.column=e}setComp(e,t,i){this.comp=e,this.setGui(t),this.displayName=this.beans.columnModel.getDisplayNameForColumnGroup(this.column,"header"),this.addClasses(),this.setupMovingCss(),this.setupExpandable(),this.setupTooltip(),this.addDestroyFunc(()=>{this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature))}),this.setupUserComp(),this.addHeaderMouseListeners();const n=this.getParentRowCtrl().getPinned(),s=this.column.getProvidedColumnGroup().getLeafColumns();this.createManagedBean(new Wa(s,t)),this.createManagedBean(new za(this.column,t,this.beans)),this.createManagedBean(new Xa(e,this.column)),this.resizeFeature=this.createManagedBean(new qa(e,i,n,this.column)),this.createManagedBean(new Ms(t,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:()=>{},handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)})),this.addManagedPropertyListener(ct.EVENT_SUPPRESS_COLUMN_MOVE_CHANGED,this.onSuppressColMoveChange),this.addResizeAndMoveKeyboardListeners()}resizeHeader(e,t){if(!this.resizeFeature)return;const i=this.resizeFeature.getInitialValues(t);this.resizeFeature.resizeColumns(i,i.resizeStartWidth+e,"uiColumnResized",!0)}moveHeader(e){const{beans:t,eGui:i,column:n,gos:s,ctrlsService:r}=this,o=s.get("enableRtl"),a=0===e,l=this.getPinned(),c=i.getBoundingClientRect(),h=c.left,u=c.width,d=ka.normaliseX(a!==o?h-20:h+u+20,l,!0,s,r),p=n.getGroupId(),g=this.focusService.getFocusedHeader();ka.attemptMoveColumns({allMovingColumns:this.column.getLeafColumns(),isFromHeader:!0,hDirection:e,xPosition:d,pinned:l,fromEnter:!1,fakeEvent:!1,gos:s,columnModel:t.columnModel});const f=n.getDisplayedLeafColumns(),m=a?f[0]:Ie(f);this.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(m,"auto"),!this.isAlive()&&g&&this.restoreFocus(p,n,g)}restoreFocus(e,t,i){const n=t.getLeafColumns();if(!n.length)return;const s=n[0].getParent();if(!s)return;const r=this.findGroupWidthId(s,e);r&&this.focusService.focusHeaderPosition({headerPosition:p(d({},i),{column:r})})}findGroupWidthId(e,t){for(;e;){if(e.getGroupId()===t)return e;e=e.getParent()}return null}resizeLeafColumnsToFit(e){this.resizeFeature&&this.resizeFeature.resizeLeafColumnsToFit(e)}setupUserComp(){const e=this.gos.addGridCommonParams({displayName:this.displayName,columnGroup:this.column,setExpanded:e=>{this.beans.columnModel.setColumnGroupOpened(this.column.getProvidedColumnGroup(),e,"gridInitializing")},setTooltip:(e,t)=>{this.setupTooltip(e,t)}}),t=this.userComponentFactory.getHeaderGroupCompDetails(e);this.comp.setUserCompDetails(t)}addHeaderMouseListeners(){const e=e=>this.handleMouseOverChange("mouseenter"===e.type);this.addManagedListener(this.getGui(),"mouseenter",e),this.addManagedListener(this.getGui(),"mouseleave",e),this.addManagedListener(this.getGui(),"click",()=>this.dispatchColumnMouseEvent(ct.EVENT_COLUMN_HEADER_CLICKED,this.column.getProvidedColumnGroup())),this.addManagedListener(this.getGui(),"contextmenu",e=>this.handleContextMenuMouseEvent(e,void 0,this.column.getProvidedColumnGroup()))}handleMouseOverChange(e){const t={type:e?ct.EVENT_COLUMN_HEADER_MOUSE_OVER:ct.EVENT_COLUMN_HEADER_MOUSE_LEAVE,column:this.column.getProvidedColumnGroup()};this.eventService.dispatchEvent(t)}setupTooltip(e,t){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature));const i=this.column.getColGroupDef(),n="whenTruncated"===this.gos.get("tooltipShowMode"),s=this.eGui;t||!n||(null==i?void 0:i.headerGroupComponent)||(t=()=>{const e=s.querySelector(".ag-header-group-text");return!e||e.scrollWidth>e.clientWidth});const r={getColumn:()=>this.column,getGui:()=>s,getLocation:()=>"headerGroup",getTooltipValue:()=>null!=e?e:i&&i.headerTooltip,shouldDisplayTooltip:t};i&&(r.getColDef=()=>i),this.createBean(new fs(r))}setupExpandable(){const e=this.column.getProvidedColumnGroup();this.refreshExpanded(),this.addManagedListener(e,Ee.EVENT_EXPANDABLE_CHANGED,this.refreshExpanded.bind(this)),this.addManagedListener(e,Ee.EVENT_EXPANDED_CHANGED,this.refreshExpanded.bind(this))}refreshExpanded(){const e=this.column;this.expandable=e.isExpandable();const t=e.isExpanded();this.expandable?this.comp.setAriaExpanded(t?"true":"false"):this.comp.setAriaExpanded(void 0)}getColId(){return this.column.getUniqueId()}addClasses(){const e=this.column.getColGroupDef(),t=ta.getHeaderClassesFromColDef(e,this.gos,null,this.column);this.column.isPadding()?(t.push("ag-header-group-cell-no-group"),this.column.getLeafColumns().every(e=>e.isSpanHeaderHeight())&&t.push("ag-header-span-height")):t.push("ag-header-group-cell-with-group"),t.forEach(e=>this.comp.addOrRemoveCssClass(e,!0))}setupMovingCss(){const e=this.column.getProvidedColumnGroup().getLeafColumns(),t=()=>this.comp.addOrRemoveCssClass("ag-header-cell-moving",this.column.isMoving());e.forEach(e=>{this.addManagedListener(e,Se.EVENT_MOVING_CHANGED,t)}),t()}onFocusIn(e){if(!this.eGui.contains(e.relatedTarget)){const e=this.getRowIndex();this.beans.focusService.setFocusedHeader(e,this.column)}}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();if(this.expandable&&t&&e.key===Zn.ENTER){const e=this.column,t=!e.isExpanded();this.beans.columnModel.setColumnGroupOpened(e.getProvidedColumnGroup(),t,"uiColumnExpanded")}}setDragSource(e){if(!this.isAlive()||this.isSuppressMoving())return;if(this.removeDragSource(),!e)return;const{beans:t,column:i,displayName:n,gos:s,dragAndDropService:r}=this,{columnModel:o}=t,a=i.getProvidedColumnGroup().getLeafColumns();let l=!s.get("suppressDragLeaveHidesColumns");const c=this.dragSource={type:1,eElement:e,getDefaultIconName:()=>l?Lr.ICON_HIDE:Lr.ICON_NOT_ALLOWED,dragItemName:n,getDragItem:()=>this.getDragItemForGroup(i),onDragStarted:()=>{l=!s.get("suppressDragLeaveHidesColumns"),a.forEach(e=>e.setMoving(!0,"uiColumnDragged"))},onDragStopped:()=>a.forEach(e=>e.setMoving(!1,"uiColumnDragged")),onGridEnter:e=>{var t;if(l){const i=(null==(t=null==e?void 0:e.columns)?void 0:t.filter(e=>!e.getColDef().lockVisible))||[];o.setColumnsVisible(i,!0,"uiColumnMoved")}},onGridExit:e=>{var t;if(l){const i=(null==(t=null==e?void 0:e.columns)?void 0:t.filter(e=>!e.getColDef().lockVisible))||[];o.setColumnsVisible(i,!1,"uiColumnMoved")}}};r.addDragSource(c,!0)}getDragItemForGroup(e){const t=e.getProvidedColumnGroup().getLeafColumns(),i={};t.forEach(e=>i[e.getId()]=e.isVisible());const n=[];return this.beans.columnModel.getAllDisplayedColumns().forEach(e=>{t.indexOf(e)>=0&&(n.push(e),Ne(t,e))}),t.forEach(e=>n.push(e)),{columns:n,visibleState:i}}isSuppressMoving(){let e=!1;return this.column.getLeafColumns().forEach(t=>{(t.getColDef().suppressMovable||t.getColDef().lockPosition)&&(e=!0)}),e||this.gos.get("suppressMovableColumns")}},Qa=0,Ja=class extends st{constructor(e,t,i){super(),this.instanceId=Qa++,this.rowIndex=e,this.pinned=t,this.type=i;const n="group"==i?"ag-header-row-column-group":"filter"==i?"ag-header-row-column-filter":"ag-header-row-column";this.headerRowClass=`ag-header-row ${n}`}postConstruct(){this.isPrintLayout=this.gos.isDomLayout("print"),this.isEnsureDomOrder=this.gos.get("ensureDomOrder")}getInstanceId(){return this.instanceId}setComp(e,t=!0){this.comp=e,t&&(this.onRowHeightChanged(),this.onVirtualColumnsChanged()),this.setWidth(),this.addEventListeners()}getHeaderRowClass(){return this.headerRowClass}getAriaRowIndex(){return this.rowIndex+1}addEventListeners(){this.addManagedListener(this.eventService,ct.EVENT_COLUMN_RESIZED,this.onColumnResized.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_VIRTUAL_COLUMNS_CHANGED,e=>this.onVirtualColumnsChanged(e.afterScroll)),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,this.onRowHeightChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_GRID_STYLES_CHANGED,this.onRowHeightChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("domLayout",this.onDisplayedColumnsChanged.bind(this)),this.addManagedPropertyListener("ensureDomOrder",e=>this.isEnsureDomOrder=e.currentValue),this.addManagedPropertyListener("headerHeight",this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("pivotHeaderHeight",this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("groupHeaderHeight",this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("pivotGroupHeaderHeight",this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("floatingFiltersHeight",this.onRowHeightChanged.bind(this))}getHeaderCellCtrl(e){if(this.headerCellCtrls)return D(this.headerCellCtrls).find(t=>t.getColumnGroupChild()===e)}onDisplayedColumnsChanged(){this.isPrintLayout=this.gos.isDomLayout("print"),this.onVirtualColumnsChanged(),this.setWidth(),this.onRowHeightChanged()}getType(){return this.type}onColumnResized(){this.setWidth()}setWidth(){const e=this.getWidthForRow();this.comp.setWidth(`${e}px`)}getWidthForRow(){const{columnModel:e}=this.beans;return this.isPrintLayout?null!=this.pinned?0:e.getContainerWidth("right")+e.getContainerWidth("left")+e.getContainerWidth(null):e.getContainerWidth(this.pinned)}onRowHeightChanged(){var{topOffset:e,rowHeight:t}=this.getTopAndHeight();this.comp.setTop(e+"px"),this.comp.setHeight(t+"px")}getTopAndHeight(){const{columnModel:e,filterManager:t}=this.beans;let i=e.getHeaderRowCount();const n=[];let s=0;t.hasFloatingFilters()&&(i++,s=1);const r=e.getColumnGroupHeaderRowHeight(),o=e.getColumnHeaderRowHeight(),a=i-(1+s);for(let e=0;e<a;e++)n.push(r);n.push(o);for(let t=0;t<s;t++)n.push(e.getFloatingFiltersHeight());let l=0;for(let e=0;e<this.rowIndex;e++)l+=n[e];return{topOffset:l,rowHeight:n[this.rowIndex]}}getPinned(){return this.pinned}getRowIndex(){return this.rowIndex}onVirtualColumnsChanged(e=!1){const t=this.getHeaderCtrls(),i=this.isEnsureDomOrder||this.isPrintLayout;this.comp.setHeaderCtrls(t,i,e)}getHeaderCtrls(){const e=this.headerCellCtrls;this.headerCellCtrls=new Map;const t=this.getColumnsInViewport();for(const i of t)this.recycleAndCreateHeaderCtrls(i,e);const i=e=>{const{focusService:t,columnModel:i}=this.beans;return!!t.isHeaderWrapperFocused(e)&&i.isDisplayed(e.getColumnGroupChild())};if(e)for(const[t,n]of e)i(n)?this.headerCellCtrls.set(t,n):this.destroyBean(n);return Array.from(this.headerCellCtrls.values())}recycleAndCreateHeaderCtrls(e,t){if(!this.headerCellCtrls)return;if(e.isEmptyGroup())return;const i=e.getUniqueId();let n;if(t&&(n=t.get(i),t.delete(i)),n&&n.getColumnGroupChild()!=e&&(this.destroyBean(n),n=void 0),null==n)switch(this.type){case"filter":n=this.createBean(new ja(e,this.beans,this));break;case"group":n=this.createBean(new Za(e,this.beans,this));break;default:n=this.createBean(new Ya(e,this.beans,this))}this.headerCellCtrls.set(i,n)}getColumnsInViewport(){return this.isPrintLayout?this.getColumnsInViewportPrintLayout():this.getColumnsInViewportNormalLayout()}getColumnsInViewportPrintLayout(){if(null!=this.pinned)return[];let e=[];const t=this.getActualDepth(),{columnModel:i}=this.beans;return["left",null,"right"].forEach(n=>{const s=i.getVirtualHeaderGroupRow(n,t);e=e.concat(s)}),e}getActualDepth(){return"filter"==this.type?this.rowIndex-1:this.rowIndex}getColumnsInViewportNormalLayout(){return this.beans.columnModel.getVirtualHeaderGroupRow(this.pinned,this.getActualDepth())}focusHeader(e,t){if(!this.headerCellCtrls)return!1;const i=Array.from(this.headerCellCtrls.values()).find(t=>t.getColumnGroupChild()==e);return!!i&&i.focus(t)}destroy(){this.headerCellCtrls&&this.headerCellCtrls.forEach(e=>{this.destroyBean(e)}),this.headerCellCtrls=void 0,super.destroy()}};f([ue("beans")],Ja.prototype,"beans",2),f([le],Ja.prototype,"postConstruct",1);var el=class extends st{constructor(e){super(),this.hidden=!1,this.includeFloatingFilter=!1,this.groupsRowCtrls=[],this.pinned=e}setComp(e,t){this.comp=e,this.eViewport=t,this.setupCenterWidth(),this.setupPinnedWidth(),this.setupDragAndDrop(this.eViewport),this.addManagedListener(this.eventService,ct.EVENT_GRID_COLUMNS_CHANGED,this.onGridColumnsChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.ctrlsService.registerHeaderContainer(this,this.pinned),this.columnModel.isReady()&&this.refresh()}setupDragAndDrop(e){const t=new _a(this.pinned,e);this.createManagedBean(t)}refresh(e=!1){const t=new hs,i=this.focusService.getFocusHeaderToUseAfterRefresh();(()=>{const e=this.columnModel.getHeaderRowCount()-1;this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls);for(let i=0;i<e;i++){const e=this.createBean(new Ja(t.next(),this.pinned,"group"));this.groupsRowCtrls.push(e)}})(),(()=>{const i=t.next(),n=!(this.hidden||null!=this.columnsRowCtrl&&e&&this.columnsRowCtrl.getRowIndex()===i);(n||this.hidden)&&(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl)),n&&(this.columnsRowCtrl=this.createBean(new Ja(i,this.pinned,"column")))})(),(()=>{this.includeFloatingFilter=this.filterManager.hasFloatingFilters()&&!this.hidden;const i=()=>{this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)};if(!this.includeFloatingFilter)return void i();const n=t.next();if(this.filtersRowCtrl){const t=this.filtersRowCtrl.getRowIndex()!==n;e&&!t||i()}this.filtersRowCtrl||(this.filtersRowCtrl=this.createBean(new Ja(n,this.pinned,"filter")))})();const n=this.getAllCtrls();this.comp.setCtrls(n),this.restoreFocusOnHeader(i)}restoreFocusOnHeader(e){null!=e&&e.column.getPinned()==this.pinned&&this.focusService.focusHeaderPosition({headerPosition:e})}getAllCtrls(){const e=[...this.groupsRowCtrls];return this.columnsRowCtrl&&e.push(this.columnsRowCtrl),this.filtersRowCtrl&&e.push(this.filtersRowCtrl),e}onGridColumnsChanged(){this.refresh(!0)}onDisplayedColumnsChanged(){const e=this.filterManager.hasFloatingFilters()&&!this.hidden;this.includeFloatingFilter!==e&&this.refresh(!0)}setupCenterWidth(){null==this.pinned&&this.createManagedBean(new ga(e=>this.comp.setCenterWidth(`${e}px`),!0))}setHorizontalScroll(e){this.comp.setViewportScrollLeft(e)}setupPinnedWidth(){if(null==this.pinned)return;const e="left"===this.pinned,t="right"===this.pinned;this.hidden=!0;const i=()=>{const i=e?this.pinnedWidthService.getPinnedLeftWidth():this.pinnedWidthService.getPinnedRightWidth();if(null==i)return;const n=0==i,s=this.hidden!==n,r=this.gos.get("enableRtl"),o=this.gos.getScrollbarWidth(),a=this.scrollVisibleService.isVerticalScrollShowing()&&(r&&e||!r&&t)?i+o:i;this.comp.setPinnedContainerWidth(`${a}px`),this.comp.setDisplayed(!n),s&&(this.hidden=n,this.refresh())};this.addManagedListener(this.eventService,ct.EVENT_LEFT_PINNED_WIDTH_CHANGED,i),this.addManagedListener(this.eventService,ct.EVENT_RIGHT_PINNED_WIDTH_CHANGED,i),this.addManagedListener(this.eventService,ct.EVENT_SCROLL_VISIBILITY_CHANGED,i),this.addManagedListener(this.eventService,ct.EVENT_SCROLLBAR_WIDTH_CHANGED,i)}getHeaderCtrlForColumn(e){if(e instanceof Se){if(!this.columnsRowCtrl)return;return this.columnsRowCtrl.getHeaderCellCtrl(e)}if(0!==this.groupsRowCtrls.length)for(let t=0;t<this.groupsRowCtrls.length;t++){const i=this.groupsRowCtrls[t].getHeaderCellCtrl(e);if(i)return i}}getHtmlElementForColumnHeader(e){const t=this.getHeaderCtrlForColumn(e);return t?t.getGui():null}getRowType(e){const t=this.getAllCtrls()[e];return t?t.getType():void 0}focusHeader(e,t,i){const n=this.getAllCtrls()[e];return!!n&&n.focusHeader(t,i)}getViewport(){return this.eViewport}getRowCount(){return this.groupsRowCtrls.length+(this.columnsRowCtrl?1:0)+(this.filtersRowCtrl?1:0)}destroy(){this.filtersRowCtrl&&(this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)),this.columnsRowCtrl&&(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl)),this.groupsRowCtrls&&this.groupsRowCtrls.length&&(this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls)),super.destroy()}};f([ue("ctrlsService")],el.prototype,"ctrlsService",2),f([ue("scrollVisibleService")],el.prototype,"scrollVisibleService",2),f([ue("pinnedWidthService")],el.prototype,"pinnedWidthService",2),f([ue("columnModel")],el.prototype,"columnModel",2),f([ue("focusService")],el.prototype,"focusService",2),f([ue("filterManager")],el.prototype,"filterManager",2);var tl=class e extends vs{constructor(e){super(),this.headerRowComps={},this.rowCompsList=[],this.pinned=e}init(){this.selectAndSetTemplate();const e={setDisplayed:e=>this.setDisplayed(e),setCtrls:e=>this.setCtrls(e),setCenterWidth:e=>this.eCenterContainer.style.width=e,setViewportScrollLeft:e=>this.getGui().scrollLeft=e,setPinnedContainerWidth:e=>{const t=this.getGui();t.style.width=e,t.style.maxWidth=e,t.style.minWidth=e}};this.createManagedBean(new el(this.pinned)).setComp(e,this.getGui())}selectAndSetTemplate(){const t="left"==this.pinned,i="right"==this.pinned,n=t?e.PINNED_LEFT_TEMPLATE:i?e.PINNED_RIGHT_TEMPLATE:e.CENTER_TEMPLATE;this.setTemplate(n),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;let i;this.headerRowComps={},this.rowCompsList=[];const n=e=>{const t=e.getGui();t.parentElement!=this.eRowContainer&&this.eRowContainer.appendChild(t),i&&An(this.eRowContainer,t,i),i=t};e.forEach(e=>{const i=e.getInstanceId(),s=t[i];delete t[i];const r=s||this.createBean(new Ba(e));this.headerRowComps[i]=r,this.rowCompsList.push(r),n(r)}),N(t).forEach(e=>this.destroyRowComp(e))}};tl.PINNED_LEFT_TEMPLATE='<div class="ag-pinned-left-header" role="rowgroup"></div>',tl.PINNED_RIGHT_TEMPLATE='<div class="ag-pinned-right-header" role="rowgroup"></div>',tl.CENTER_TEMPLATE='<div class="ag-header-viewport" role="presentation">\n            <div class="ag-header-container" ref="eCenterContainer" role="rowgroup"></div>\n        </div>',f([bs("eCenterContainer")],tl.prototype,"eCenterContainer",2),f([le],tl.prototype,"init",1),f([ce],tl.prototype,"destroyRowComps",1);var il=tl,nl=class extends st{constructor(){super(...arguments),this.currentHeaderRowWithoutSpan=-1}postConstruct(){this.ctrlsService.whenReady(e=>{this.gridBodyCon=e.gridBodyCtrl});const e=this.gos.getDocument();this.addManagedListener(e,"mousedown",()=>this.setCurrentHeaderRowWithoutSpan(-1))}getHeaderRowCount(){const e=this.ctrlsService.getHeaderRowContainerCtrl();return e?e.getRowCount():0}navigateVertically(e,t,i){if(t||(t=this.focusService.getFocusedHeader()),!t)return!1;const{headerRowIndex:n,column:s}=t,r=this.getHeaderRowCount(),o=0===e;let{headerRowIndex:a,column:l,headerRowIndexWithoutSpan:c}=o?this.headerPositionUtils.getColumnVisibleParent(s,n):this.headerPositionUtils.getColumnVisibleChild(s,n),h=!1;return a<0&&(a=0,l=s,h=!0),a>=r?(a=-1,this.setCurrentHeaderRowWithoutSpan(-1)):void 0!==c&&(this.currentHeaderRowWithoutSpan=c),!(!h&&!l)&&this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:a,column:l},allowUserOverride:!0,event:i})}setCurrentHeaderRowWithoutSpan(e){this.currentHeaderRowWithoutSpan=e}navigateHorizontally(e,t=!1,i){const n=this.focusService.getFocusedHeader(),s=2===e,r=this.gos.get("enableRtl");let o,a;if(-1!==this.currentHeaderRowWithoutSpan?n.headerRowIndex=this.currentHeaderRowWithoutSpan:this.currentHeaderRowWithoutSpan=n.headerRowIndex,s!==r?(a="Before",o=this.headerPositionUtils.findHeader(n,a)):(a="After",o=this.headerPositionUtils.findHeader(n,a)),o||!t)return this.focusService.focusHeaderPosition({headerPosition:o,direction:a,fromTab:t,allowUserOverride:!0,event:i});if(t){const e=this.gos.getCallback("tabToNextHeader");if(e)return this.focusService.focusHeaderPositionFromUserFunc({userFunc:e,headerPosition:o,direction:a})}return this.focusNextHeaderRow(n,a,i)}focusNextHeaderRow(e,t,i){const n=e.headerRowIndex;let s,r=null;if("Before"===t?n>0&&(s=n-1,this.currentHeaderRowWithoutSpan-=1,r=this.headerPositionUtils.findColAtEdgeForHeaderRow(s,"end")):(s=n+1,this.currentHeaderRowWithoutSpan<this.getHeaderRowCount()?this.currentHeaderRowWithoutSpan+=1:this.setCurrentHeaderRowWithoutSpan(-1),r=this.headerPositionUtils.findColAtEdgeForHeaderRow(s,"start")),!r)return!1;const{column:o,headerRowIndex:a}=this.headerPositionUtils.getHeaderIndexToFocus(r.column,null==r?void 0:r.headerRowIndex);return this.focusService.focusHeaderPosition({headerPosition:{column:o,headerRowIndex:a},direction:t,fromTab:!0,allowUserOverride:!0,event:i})}scrollToColumn(e,t="After"){if(e.getPinned())return;let i;if(e instanceof lt){const n=e.getDisplayedLeafColumns();i="Before"===t?Ie(n):n[0]}else i=e;this.gridBodyCon.getScrollFeature().ensureColumnVisible(i)}};f([ue("focusService")],nl.prototype,"focusService",2),f([ue("headerPositionUtils")],nl.prototype,"headerPositionUtils",2),f([ue("ctrlsService")],nl.prototype,"ctrlsService",2),f([le],nl.prototype,"postConstruct",1),nl=f([he("headerNavigationService")],nl);var sl=class extends st{setComp(e,t,i){this.comp=e,this.eGui=t,this.createManagedBean(new Ms(i,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.onPivotModeChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.onPivotModeChanged(),this.setupHeaderHeight();const n=this.onHeaderContextMenu.bind(this);this.addManagedListener(this.eGui,"contextmenu",n),this.mockContextMenuForIPad(n),this.ctrlsService.register("gridHeaderCtrl",this)}setupHeaderHeight(){const e=this.setHeaderHeight.bind(this);e(),this.addManagedPropertyListener("headerHeight",e),this.addManagedPropertyListener("pivotHeaderHeight",e),this.addManagedPropertyListener("groupHeaderHeight",e),this.addManagedPropertyListener("pivotGroupHeaderHeight",e),this.addManagedPropertyListener("floatingFiltersHeight",e),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_GRID_STYLES_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,e)}getHeaderHeight(){return this.headerHeight}setHeaderHeight(){const{columnModel:e}=this;let t,i=0,n=e.getHeaderRowCount();this.filterManager.hasFloatingFilters()&&(n++,i=1);const s=this.columnModel.getColumnGroupHeaderRowHeight(),r=this.columnModel.getColumnHeaderRowHeight(),o=n-(1+i);if(t=i*e.getFloatingFiltersHeight(),t+=o*s,t+=r,this.headerHeight===t)return;this.headerHeight=t;const a=`${t+1}px`;this.comp.setHeightAndMinHeight(a),this.eventService.dispatchEvent({type:ct.EVENT_HEADER_HEIGHT_CHANGED})}onPivotModeChanged(){const e=this.columnModel.isPivotMode();this.comp.addOrRemoveCssClass("ag-pivot-on",e),this.comp.addOrRemoveCssClass("ag-pivot-off",!e)}onDisplayedColumnsChanged(){const e=this.columnModel.getAllDisplayedColumns().some(e=>e.isSpanHeaderHeight());this.comp.addOrRemoveCssClass("ag-header-allow-overflow",e)}onTabKeyDown(e){const t=this.gos.get("enableRtl"),i=e.shiftKey!==t?2:3;(this.headerNavigationService.navigateHorizontally(i,!0,e)||this.focusService.focusNextGridCoreContainer(e.shiftKey))&&e.preventDefault()}handleKeyDown(e){let t=null;switch(e.key){case Zn.LEFT:t=2;case Zn.RIGHT:b(t)||(t=3),this.headerNavigationService.navigateHorizontally(t,!1,e);break;case Zn.UP:t=0;case Zn.DOWN:b(t)||(t=1),this.headerNavigationService.navigateVertically(t,null,e)&&e.preventDefault();break;default:return}}onFocusOut(e){const{relatedTarget:t}=e;!t&&this.eGui.contains(this.gos.getActiveDomElement())||this.eGui.contains(t)||this.focusService.clearFocusedHeader()}onHeaderContextMenu(e,t,i){if(!e&&!i||!this.menuService.isHeaderContextMenuEnabled())return;const{target:n}=null!=e?e:t;n!==this.eGui&&n!==this.ctrlsService.getHeaderRowContainerCtrl().getViewport()||this.menuService.showHeaderContextMenu(void 0,e,i)}mockContextMenuForIPad(e){if(!Pi())return;const t=new gr(this.eGui);this.addManagedListener(t,gr.EVENT_LONG_TAP,t=>{e(void 0,t.touchStart,t.touchEvent)}),this.addDestroyFunc(()=>t.destroy())}};f([ue("headerNavigationService")],sl.prototype,"headerNavigationService",2),f([ue("focusService")],sl.prototype,"focusService",2),f([ue("columnModel")],sl.prototype,"columnModel",2),f([ue("ctrlsService")],sl.prototype,"ctrlsService",2),f([ue("filterManager")],sl.prototype,"filterManager",2),f([ue("menuService")],sl.prototype,"menuService",2);var rl=class e extends vs{constructor(){super(e.TEMPLATE)}postConstruct(){const e={addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setHeightAndMinHeight:e=>{this.getGui().style.height=e,this.getGui().style.minHeight=e}};this.createManagedBean(new sl).setComp(e,this.getGui(),this.getFocusableElement());const t=e=>{this.createManagedBean(e),this.appendChild(e)};t(new il("left")),t(new il(null)),t(new il("right"))}};rl.TEMPLATE='<div class="ag-header" role="presentation"/>',f([le],rl.prototype,"postConstruct",1);var ol=rl,al=class extends st{addResizeBar(e){const t={dragStartPixels:e.dragStartPixels||0,eElement:e.eResizeBar,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this,e),onDragging:this.onDragging.bind(this,e),includeTouch:!0,stopPropagationForTouch:!0};return this.dragService.addDragSource(t),()=>this.dragService.removeDragSource(t)}onDragStart(e,t){this.dragStartX=t.clientX,this.setResizeIcons();const i=t instanceof MouseEvent&&!0===t.shiftKey;e.onResizeStart(i)}setResizeIcons(){const e=this.ctrlsService.get("gridCtrl");e.setResizeCursor(!0),e.disableUserSelect(!0)}onDragStop(e,t){e.onResizeEnd(this.resizeAmount),this.resetIcons()}resetIcons(){const e=this.ctrlsService.get("gridCtrl");e.setResizeCursor(!1),e.disableUserSelect(!1)}onDragging(e,t){this.resizeAmount=t.clientX-this.dragStartX,e.onResizing(this.resizeAmount)}};f([ue("dragService")],al.prototype,"dragService",2),f([ue("ctrlsService")],al.prototype,"ctrlsService",2),al=f([he("horizontalResizeService")],al);var ll=class extends st{hideActiveMenu(){this.hidePopup&&this.hidePopup()}showMenuAfterMouseEvent(e,t,i){this.showPopup(e,n=>{this.popupService.positionPopupUnderMouseEvent({column:e,type:i,mouseEvent:t,ePopup:n})},i,t.target,this.menuService.isLegacyMenuEnabled())}showMenuAfterButtonClick(e,t,i){let n=-1,s="left";const r=this.menuService.isLegacyMenuEnabled();!r&&this.gos.get("enableRtl")&&(n=1,s="right");let o=r?void 0:4*n,a=r?void 0:4;this.showPopup(e,n=>{this.popupService.positionPopupByComponent({type:i,eventSource:t,ePopup:n,nudgeX:o,nudgeY:a,alignSide:s,keepWithinBounds:!0,position:"under",column:e})},i,t,r)}showPopup(e,t,i,n,s){const r=e?this.createBean(new Bo(e,"COLUMN_MENU")):void 0;if(this.activeMenu=r,!(null==r?void 0:r.hasFilter())||!e)throw new Error("AG Grid - unable to show popup filter, filter instantiation failed");const o=document.createElement("div");let a;Ht(o,"presentation"),o.classList.add("ag-menu"),s||o.classList.add("ag-filter-menu"),this.tabListener=this.addManagedListener(o,"keydown",e=>this.trapFocusWithin(e,o)),o.appendChild(null==r?void 0:r.getGui());const l=this.menuService.isColumnMenuAnchoringEnabled()?null!=n?n:this.ctrlsService.getGridBodyCtrl().getGui():void 0,c=this.localeService.getLocaleTextFunc(),h=s&&"columnFilter"!==i?c("ariaLabelColumnMenu","Column Menu"):c("ariaLabelColumnFilter","Column Filter"),u=this.popupService.addPopup({modal:!0,eChild:o,closeOnEsc:!0,closedCallback:t=>{e.setMenuVisible(!1,"contextMenu");const s=t instanceof KeyboardEvent;if(this.tabListener&&(this.tabListener=this.tabListener()),s&&n&&xn(n)){const e=this.focusService.findTabbableParent(n);e&&e.focus()}null==r||r.afterGuiDetached(),this.destroyBean(this.activeMenu),this.dispatchVisibleChangedEvent(!1,i,e)},positionCallback:()=>t(o),anchorToElement:l,ariaLabel:h});u&&(this.hidePopup=a=u.hideFunc),r.afterInit().then(()=>{t(o),r.afterGuiAttached({container:i,hidePopup:a})}),e.setMenuVisible(!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,i,e)}trapFocusWithin(e,t){e.key!==Zn.TAB||e.defaultPrevented||this.focusService.findNextFocusableElement(t,!1,e.shiftKey)||(e.preventDefault(),this.focusService.focusInto(t,e.shiftKey))}dispatchVisibleChangedEvent(e,t,i){const n={type:ct.EVENT_COLUMN_MENU_VISIBLE_CHANGED,visible:e,switchingTab:!1,key:t,column:null!=i?i:null};this.eventService.dispatchEvent(n)}isMenuEnabled(e){var t;return e.isFilterAllowed()&&(null!=(t=e.getColDef().menuTabs)?t:["filterMenuTab"]).includes("filterMenuTab")}showMenuAfterContextMenuEvent(){}destroy(){this.destroyBean(this.activeMenu),super.destroy()}};f([ue("filterManager")],ll.prototype,"filterManager",2),f([ue("popupService")],ll.prototype,"popupService",2),f([ue("focusService")],ll.prototype,"focusService",2),f([ue("ctrlsService")],ll.prototype,"ctrlsService",2),f([ue("menuService")],ll.prototype,"menuService",2),ll=f([he("filterMenuFactory")],ll);var cl=(e=>(e.TAB_GUARD="ag-tab-guard",e.TAB_GUARD_TOP="ag-tab-guard-top",e.TAB_GUARD_BOTTOM="ag-tab-guard-bottom",e))(cl||{}),hl=class extends st{constructor(e){super(),this.skipTabGuardFocus=!1,this.forcingFocusOut=!1;const{comp:t,eTopGuard:i,eBottomGuard:n,focusTrapActive:s,forceFocusOutWhenTabGuardsAreEmpty:r,focusInnerElement:o,onFocusIn:a,onFocusOut:l,shouldStopEventPropagation:c,onTabKeyDown:h,handleKeyDown:u,eFocusableElement:d}=e;this.comp=t,this.eTopGuard=i,this.eBottomGuard=n,this.providedFocusInnerElement=o,this.eFocusableElement=d,this.focusTrapActive=!!s,this.forceFocusOutWhenTabGuardsAreEmpty=!!r,this.providedFocusIn=a,this.providedFocusOut=l,this.providedShouldStopEventPropagation=c,this.providedOnTabKeyDown=h,this.providedHandleKeyDown=u}postConstruct(){this.createManagedBean(new Ms(this.eFocusableElement,{shouldStopEventPropagation:()=>this.shouldStopEventPropagation(),onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e),onFocusIn:e=>this.onFocusIn(e),onFocusOut:e=>this.onFocusOut(e)})),this.activateTabGuards(),[this.eTopGuard,this.eBottomGuard].forEach(e=>this.addManagedListener(e,"focus",this.onFocus.bind(this)))}handleKeyDown(e){this.providedHandleKeyDown&&this.providedHandleKeyDown(e)}tabGuardsAreActive(){return!!this.eTopGuard&&this.eTopGuard.hasAttribute("tabIndex")}shouldStopEventPropagation(){return!!this.providedShouldStopEventPropagation&&this.providedShouldStopEventPropagation()}activateTabGuards(){if(this.forcingFocusOut)return;const e=this.gos.get("tabIndex");this.comp.setTabIndex(e.toString())}deactivateTabGuards(){this.comp.setTabIndex()}onFocus(e){if(this.skipTabGuardFocus)return void(this.skipTabGuardFocus=!1);if(this.forceFocusOutWhenTabGuardsAreEmpty&&0===this.focusService.findFocusableElements(this.eFocusableElement,".ag-tab-guard").length)return void this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard);const t=e.target===this.eBottomGuard;this.providedFocusInnerElement?this.providedFocusInnerElement(t):this.focusInnerElement(t)}findNextElementOutsideAndFocus(e){const t=this.gos.getDocument(),i=this.focusService.findFocusableElements(t.body,null,!0),n=i.indexOf(e?this.eTopGuard:this.eBottomGuard);if(-1===n)return;let s,r;e?(s=0,r=n):(s=n+1,r=i.length);const o=i.slice(s,r),a=this.gos.get("tabIndex");o.sort((e,t)=>{const i=parseInt(e.getAttribute("tabindex")||"0"),n=parseInt(t.getAttribute("tabindex")||"0");return n===a?1:i===a?-1:0===i?1:0===n?-1:i-n}),o[e?o.length-1:0].focus()}onFocusIn(e){this.focusTrapActive||(this.providedFocusIn&&this.providedFocusIn(e),this.deactivateTabGuards())}onFocusOut(e){this.focusTrapActive||(this.providedFocusOut&&this.providedFocusOut(e),this.eFocusableElement.contains(e.relatedTarget)||this.activateTabGuards())}onTabKeyDown(e){if(this.providedOnTabKeyDown)return void this.providedOnTabKeyDown(e);if(this.focusTrapActive)return;if(e.defaultPrevented)return;const t=this.tabGuardsAreActive();t&&this.deactivateTabGuards();const i=this.getNextFocusableElement(e.shiftKey);t&&setTimeout(()=>this.activateTabGuards(),0),i&&(i.focus(),e.preventDefault())}focusInnerElement(e=!1){const t=this.focusService.findFocusableElements(this.eFocusableElement);this.tabGuardsAreActive()&&(t.splice(0,1),t.splice(t.length-1,1)),t.length&&t[e?t.length-1:0].focus({preventScroll:!0})}getNextFocusableElement(e){return this.focusService.findNextFocusableElement(this.eFocusableElement,!1,e)}forceFocusOutOfContainer(e=!1){if(this.forcingFocusOut)return;const t=e?this.eTopGuard:this.eBottomGuard;this.activateTabGuards(),this.skipTabGuardFocus=!0,this.forcingFocusOut=!0,t.focus(),window.setTimeout(()=>{this.forcingFocusOut=!1,this.activateTabGuards()})}isTabGuard(e){return e===this.eTopGuard||e===this.eBottomGuard}};f([ue("focusService")],hl.prototype,"focusService",2),f([le],hl.prototype,"postConstruct",1);var ul=class extends vs{initialiseTabGuard(e){this.eTopGuard=this.createTabGuard("top"),this.eBottomGuard=this.createTabGuard("bottom"),this.eFocusableElement=this.getFocusableElement();const t=[this.eTopGuard,this.eBottomGuard],i={setTabIndex:e=>{t.forEach(t=>null!=e?t.setAttribute("tabindex",e):t.removeAttribute("tabindex"))}};this.addTabGuards(this.eTopGuard,this.eBottomGuard),this.tabGuardCtrl=this.createManagedBean(new hl({comp:i,focusTrapActive:!!e.focusTrapActive,eTopGuard:this.eTopGuard,eBottomGuard:this.eBottomGuard,eFocusableElement:this.eFocusableElement,onFocusIn:e.onFocusIn,onFocusOut:e.onFocusOut,focusInnerElement:e.focusInnerElement,handleKeyDown:e.handleKeyDown,onTabKeyDown:e.onTabKeyDown,shouldStopEventPropagation:e.shouldStopEventPropagation,forceFocusOutWhenTabGuardsAreEmpty:e.forceFocusOutWhenTabGuardsAreEmpty}))}createTabGuard(e){const t=document.createElement("div"),i="top"===e?"ag-tab-guard-top":"ag-tab-guard-bottom";return t.classList.add("ag-tab-guard",i),Ht(t,"presentation"),t}addTabGuards(e,t){this.eFocusableElement.insertAdjacentElement("afterbegin",e),this.eFocusableElement.insertAdjacentElement("beforeend",t)}removeAllChildrenExceptTabGuards(){const e=[this.eTopGuard,this.eBottomGuard];Cn(this.getFocusableElement()),this.addTabGuards(...e)}forceFocusOutOfContainer(e=!1){this.tabGuardCtrl.forceFocusOutOfContainer(e)}appendChild(e,t){On(e)||(e=e.getGui());const{eBottomGuard:i}=this;i?i.insertAdjacentElement("beforebegin",e):super.appendChild(e,t)}},dl=class e extends ul{constructor(t){super(e.getTemplate(t.cssClass)),this.items=[],this.tabbedItemScrollMap=new Map,this.params=t}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,i;return null==(i=null==(t=null==(e=this.activeItem)?void 0:e.tabbedItem)?void 0:t.afterDetachedCallback)?void 0:i.call(t)})}static getTemplate(e){return`<div class="ag-tabs ${e}">\n            <div ref="eHeader"></div>\n            <div ref="eBody" role="presentation" class="ag-tabs-body ${e?`${e}-body`:""}"></div>\n        </div>`}setupHeader(){const{enableCloseButton:e,cssClass:t}=this.params,i=(e,i)=>{e.classList.add(`ag-tabs-${i}`),t&&e.classList.add(`${t}-${i}`)};e?(this.setupCloseButton(i),this.eTabHeader=this.gos.getDocument().createElement("div"),i(this.eHeader,"header-wrapper"),Ht(this.eHeader,"presentation"),this.eHeader.appendChild(this.eTabHeader)):this.eTabHeader=this.eHeader,Ht(this.eTabHeader,"tablist"),i(this.eTabHeader,"header")}setupCloseButton(e){const t=this.gos.getDocument(),i=t.createElement("button");e(i,"close-button");const n=qn("close",this.gos,void 0,!0);$t(i,this.params.closeButtonAriaLabel),i.appendChild(n),this.addManagedListener(i,"click",()=>{var e,t;return null==(t=(e=this.params).onCloseClicked)?void 0:t.call(e)});const s=t.createElement("div");e(s,"close-button-wrapper"),Ht(s,"presentation"),s.appendChild(i),this.eHeader.appendChild(s),this.eCloseButton=i}handleKeyDown(e){switch(e.key){case Zn.RIGHT:case Zn.LEFT:if(!this.eTabHeader.contains(this.gos.getActiveDomElement()))return;const t=e.key===Zn.RIGHT,i=this.gos.get("enableRtl"),n=this.items.indexOf(this.activeItem),s=t!==i?Math.min(n+1,this.items.length-1):Math.max(n-1,0);if(n===s)return;e.preventDefault();const r=this.items[s];this.showItemWrapper(r),r.eHeaderButton.focus();break;case Zn.UP:case Zn.DOWN:e.stopPropagation()}}onTabKeyDown(e){var t,i,n,s;if(e.defaultPrevented)return;const{focusService:r,eHeader:o,eBody:a,activeItem:l,params:c}=this,{suppressTrapFocus:h,enableCloseButton:u}=c,d=this.gos.getActiveDomElement(),p=e.target,g=e.shiftKey;if(o.contains(d))return e.preventDefault(),void(u&&g&&!(null==(t=this.eCloseButton)?void 0:t.contains(d))?null==(i=this.eCloseButton)||i.focus():h&&g?null==(n=this.focusService.findFocusableElementBeforeTabGuard(this.gos.getDocument().body,p))||n.focus():this.focusBody(e.shiftKey));let f=null;if(r.isTargetUnderManagedComponent(a,p)&&(g&&(f=this.focusService.findFocusableElementBeforeTabGuard(a,p)),f||h||(f=l.eHeaderButton)),!f&&a.contains(d)&&(f=r.findNextFocusableElement(a,!1,g),!f))return e.preventDefault(),void(h&&!g?this.forceFocusOutOfContainer(g):u&&!g?null==(s=this.eCloseButton)||s.focus():this.focusHeader());f&&(e.preventDefault(),f.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");Ht(t,"tab"),t.setAttribute("tabindex","-1"),t.appendChild(e.title),t.classList.add("ag-tab"),this.eTabHeader.appendChild(t),$t(t,e.titleLabel);const i={tabbedItem:e,eHeaderButton:t};this.items.push(i),t.addEventListener("click",this.showItemWrapper.bind(this,i))}showItem(e){const t=this.items.find(t=>t.tabbedItem===e);t&&this.showItemWrapper(t)}showItemWrapper(e){var t,i,n,s,r,o;const{tabbedItem:a,eHeaderButton:l}=e;null==(i=(t=this.params).onItemClicked)||i.call(t,{item:a}),this.activeItem!==e?(this.lastScrollListener&&(this.lastScrollListener=this.lastScrollListener()),Cn(this.eBody),a.bodyPromise.then(e=>{this.eBody.appendChild(e);const t=!this.focusService.isKeyboardMode();if(this.params.suppressFocusBodyOnOpen||this.focusService.focusInto(this.eBody,!1,t),a.afterAttachedCallback&&a.afterAttachedCallback(this.afterAttachedParams),this.params.keepScrollPosition){const t=a.getScrollableContainer&&a.getScrollableContainer()||e;this.lastScrollListener=this.addManagedListener(t,"scroll",()=>{this.tabbedItemScrollMap.set(a.name,t.scrollTop)});const i=this.tabbedItemScrollMap.get(a.name);void 0!==i&&setTimeout(()=>{t.scrollTop=i},0)}}),this.activeItem&&(this.activeItem.eHeaderButton.classList.remove("ag-tab-selected"),null==(o=(r=this.activeItem.tabbedItem).afterDetachedCallback)||o.call(r)),l.classList.add("ag-tab-selected"),this.activeItem=e):null==(s=(n=this.params).onActiveItemClicked)||s.call(n)}};f([ue("focusService")],dl.prototype,"focusService",2),f([bs("eHeader")],dl.prototype,"eHeader",2),f([bs("eBody")],dl.prototype,"eBody",2),f([le],dl.prototype,"postConstruct",1);var pl=class extends st{constructor(){super(...arguments),this.polyfillFunctions=[]}observeResize(e,t){const i=this.gos.getWindow(),n=()=>{var i,n;let s=null!=(i=null==e?void 0:e.clientWidth)?i:0,r=null!=(n=null==e?void 0:e.clientHeight)?n:0,o=!0;const a=()=>{var i,n;if(o){const o=null!=(i=null==e?void 0:e.clientWidth)?i:0,l=null!=(n=null==e?void 0:e.clientHeight)?n:0;(o!==s||l!==r)&&(s=o,r=l,t()),this.doNextPolyfillTurn(a)}};return a(),()=>o=!1},s=this.gos.get("suppressBrowserResizeObserver");return i.ResizeObserver&&!s?(()=>{const n=new i.ResizeObserver(t);return n.observe(e),()=>n.disconnect()})():this.getFrameworkOverrides().wrapIncoming(()=>n(),"resize-observer")}doNextPolyfillTurn(e){this.polyfillFunctions.push(e),this.schedulePolyfill()}schedulePolyfill(){this.polyfillScheduled||(this.polyfillScheduled=!0,window.setTimeout(()=>{const e=this.polyfillFunctions;this.polyfillScheduled=!1,this.polyfillFunctions=[],e.forEach(e=>e())},50))}};pl=f([he("resizeObserverService")],pl);var gl=class extends st{constructor(){super(...arguments),this.createTasksP1={list:[],sorted:!1},this.createTasksP2={list:[],sorted:!1},this.destroyTasks=[],this.ticking=!1,this.scrollGoingDown=!0,this.lastPage=0,this.lastScrollTop=0,this.taskCount=0,this.cancelledTasks=new Set}setScrollTop(e){const t=this.gos.get("pagination");if(this.scrollGoingDown=e>=this.lastScrollTop,t&&0===e){const e=this.paginationProxy.getCurrentPage();e!==this.lastPage&&(this.lastPage=e,this.scrollGoingDown=!0)}this.lastScrollTop=e}init(){this.useAnimationFrame=!this.gos.get("suppressAnimationFrame")}isOn(){return this.useAnimationFrame}verifyAnimationFrameOn(e){!1===this.useAnimationFrame&&console.warn(`AG Grid: AnimationFrameService.${e} called but animation frames are off`)}createTask(e,t,i){this.verifyAnimationFrameOn(i);const n={task:e,index:t,createOrder:++this.taskCount};this.addTaskToList(this[i],n),this.schedule()}cancelTask(e){this.cancelledTasks.add(e)}addTaskToList(e,t){e.list.push(t),e.sorted=!1}sortTaskList(e){if(e.sorted)return;const t=this.scrollGoingDown?1:-1;e.list.sort((e,i)=>e.index!==i.index?t*(i.index-e.index):i.createOrder-e.createOrder),e.sorted=!0}addDestroyTask(e){this.verifyAnimationFrameOn("createTasksP3"),this.destroyTasks.push(e),this.schedule()}executeFrame(e){this.verifyAnimationFrameOn("executeFrame");const t=this.createTasksP1,i=t.list,n=this.createTasksP2,s=n.list,r=this.destroyTasks,o=(new Date).getTime();let a=(new Date).getTime()-o;const l=e<=0,c=this.ctrlsService.getGridBodyCtrl();for(;l||a<e;){if(!c.getScrollFeature().scrollGridIfNeeded()){let e;if(i.length)this.sortTaskList(t),e=i.pop().task;else if(s.length)this.sortTaskList(n),e=s.pop().task;else{if(!r.length){this.cancelledTasks.clear();break}e=r.pop()}this.cancelledTasks.has(e)||e()}a=(new Date).getTime()-o}i.length||s.length||r.length?this.requestFrame():this.stopTicking()}stopTicking(){this.ticking=!1}flushAllFrames(){this.useAnimationFrame&&this.executeFrame(-1)}schedule(){this.useAnimationFrame&&(this.ticking||(this.ticking=!0,this.requestFrame()))}requestFrame(){const e=this.executeFrame.bind(this,60);this.requestAnimationFrame(e)}requestAnimationFrame(e){const t=this.gos.getWindow();t.requestAnimationFrame?t.requestAnimationFrame(e):t.webkitRequestAnimationFrame?t.webkitRequestAnimationFrame(e):t.setTimeout(e,0)}isQueueEmpty(){return!this.ticking}debounce(e){let t=!1;return()=>{this.isOn()?t||(t=!0,this.addDestroyTask(()=>{t=!1,e()})):window.setTimeout(e,0)}}};f([ue("ctrlsService")],gl.prototype,"ctrlsService",2),f([ue("paginationProxy")],gl.prototype,"paginationProxy",2),f([le],gl.prototype,"init",1),gl=f([he("animationFrameService")],gl);var fl=class extends st{postConstruct(){this.isClientSideRowModel="clientSide"===this.rowModel.getType()}expandRows(e){if(!this.isClientSideRowModel)return;const t=new Set(e);this.rowModel.forEachNode(e=>{e.id&&t.has(e.id)&&(e.expanded=!0)}),this.onGroupExpandedOrCollapsed()}getExpandedRows(){const e=[];return this.rowModel.forEachNode(({expanded:t,id:i})=>{t&&i&&e.push(i)}),e}expandAll(e){this.isClientSideRowModel&&this.rowModel.expandOrCollapseAll(e)}setRowNodeExpanded(e,t,i,n){e&&(i&&e.parent&&-1!==e.parent.level&&this.setRowNodeExpanded(e.parent,t,i,n),e.setExpanded(t,void 0,n))}onGroupExpandedOrCollapsed(){this.isClientSideRowModel&&this.rowModel.refreshModel({step:"map"})}};f([ue("rowModel")],fl.prototype,"rowModel",2),f([le],fl.prototype,"postConstruct",1),fl=f([he("expansionService")],fl);var ml=class extends st{postConstruct(){var e;this.activeMenuFactory=null!=(e=this.enterpriseMenuFactory)?e:this.filterMenuFactory}showColumnMenu(e){this.showColumnMenuCommon(this.activeMenuFactory,e,"columnMenu")}showFilterMenu(e){const t=this.enterpriseMenuFactory&&this.isLegacyMenuEnabled()?this.enterpriseMenuFactory:this.filterMenuFactory;this.showColumnMenuCommon(t,e,e.containerType,!0)}showHeaderContextMenu(e,t,i){this.activeMenuFactory.showMenuAfterContextMenuEvent(e,t,i)}getContextMenuPosition(e,t){const i=this.getRowCtrl(e),n=this.getCellGui(i,t);if(!n)return i?{x:0,y:i.getRowYPosition()}:{x:0,y:0};const s=n.getBoundingClientRect();return{x:s.x+s.width/2,y:s.y+s.height/2}}showContextMenu(e){var t,i,n;const{column:s,rowNode:r}=e;let{anchorToElement:o,value:a}=e;r&&s&&null==a&&(a=r.getValueFromValueService(s)),null==o&&(o=this.getContextMenuAnchorElement(r,s)),null==(n=this.contextMenuFactory)||n.onContextMenu(null!=(t=e.mouseEvent)?t:null,null!=(i=e.touchEvent)?i:null,null!=r?r:null,null!=s?s:null,a,o)}showColumnChooser(e){var t;null==(t=this.columnChooserFactory)||t.showColumnChooser(e)}hidePopupMenu(){var e;null==(e=this.contextMenuFactory)||e.hideActiveMenu(),this.activeMenuFactory.hideActiveMenu()}hideColumnChooser(){var e;null==(e=this.columnChooserFactory)||e.hideActiveColumnChooser()}isColumnMenuInHeaderEnabled(e){const{suppressMenu:t,suppressHeaderMenuButton:i}=e.getColDef();return!(null!=i?i:t)&&this.activeMenuFactory.isMenuEnabled(e)&&(this.isLegacyMenuEnabled()||!!this.enterpriseMenuFactory)}isFilterMenuInHeaderEnabled(e){return!e.getColDef().suppressHeaderFilterButton&&this.filterManager.isFilterAllowed(e)}isHeaderContextMenuEnabled(e){return!(null==e?void 0:e.getColDef().suppressHeaderContextMenu)&&"new"===this.getColumnMenuType()}isHeaderMenuButtonAlwaysShowEnabled(){return this.isSuppressMenuHide()}isHeaderMenuButtonEnabled(){const e=!this.isSuppressMenuHide();return!(Pi()&&e)}isHeaderFilterButtonEnabled(e){return this.isFilterMenuInHeaderEnabled(e)&&!this.isLegacyMenuEnabled()&&!this.isFloatingFilterButtonDisplayed(e)}isFilterMenuItemEnabled(e){return this.filterManager.isFilterAllowed(e)&&!this.isLegacyMenuEnabled()&&!this.isFilterMenuInHeaderEnabled(e)&&!this.isFloatingFilterButtonDisplayed(e)}isColumnMenuAnchoringEnabled(){return!this.isLegacyMenuEnabled()}areAdditionalColumnMenuItemsEnabled(){return"new"===this.getColumnMenuType()}isLegacyMenuEnabled(){return"legacy"===this.getColumnMenuType()}isFloatingFilterButtonEnabled(e){var t;const i=e.getColDef(),n=null==(t=i.floatingFilterComponentParams)?void 0:t.suppressFilterButton;return null!=n&&z("As of v31.1, 'colDef.floatingFilterComponentParams.suppressFilterButton' is deprecated. Use 'colDef.suppressFloatingFilterButton' instead."),null==i.suppressFloatingFilterButton?!n:!i.suppressFloatingFilterButton}getColumnMenuType(){var e;return null!=(e=this.gos.get("columnMenu"))?e:"legacy"}isFloatingFilterButtonDisplayed(e){return!!e.getColDef().floatingFilter&&this.isFloatingFilterButtonEnabled(e)}isSuppressMenuHide(){const e=this.gos.get("suppressMenuHide");return this.isLegacyMenuEnabled()?e:!this.gos.exists("suppressMenuHide")||e}showColumnMenuCommon(e,t,i,n){const{column:s,positionBy:r}=t;if("button"===r){const{buttonElement:r}=t;e.showMenuAfterButtonClick(s,r,i,n)}else if("mouse"===r){const{mouseEvent:r}=t;e.showMenuAfterMouseEvent(s,r,i,n)}else s&&(this.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(s,"auto"),this.animationFrameService.requestAnimationFrame(()=>{const t=this.ctrlsService.getHeaderRowContainerCtrl(s.getPinned()).getHeaderCtrlForColumn(s);e.showMenuAfterButtonClick(s,t.getAnchorElementForMenu(n),i,!0)}))}getRowCtrl(e){const{rowIndex:t,rowPinned:i}=e||{};if(null!=t)return this.rowRenderer.getRowByPosition({rowIndex:t,rowPinned:i})||void 0}getCellGui(e,t){if(!e||!t)return;const i=e.getCellCtrl(t);return(null==i?void 0:i.getGui())||void 0}getContextMenuAnchorElement(e,t){const i=this.ctrlsService.getGridBodyCtrl().getGridBodyElement(),n=this.getRowCtrl(e);if(!n)return i;return this.getCellGui(n,t)||(n.isFullWidth()?n.getFullWidthElement():i)}};f([ue("filterMenuFactory")],ml.prototype,"filterMenuFactory",2),f([ue("ctrlsService")],ml.prototype,"ctrlsService",2),f([ue("animationFrameService")],ml.prototype,"animationFrameService",2),f([ue("filterManager")],ml.prototype,"filterManager",2),f([ue("rowRenderer")],ml.prototype,"rowRenderer",2),f([de("columnChooserFactory")],ml.prototype,"columnChooserFactory",2),f([de("contextMenuFactory")],ml.prototype,"contextMenuFactory",2),f([de("enterpriseMenuFactory")],ml.prototype,"enterpriseMenuFactory",2),f([le],ml.prototype,"postConstruct",1),ml=f([he("menuService")],ml);var yl=class extends st{postConstruct(){this.ctrlsService.whenReady(e=>{this.centerRowContainerCtrl=e.center})}getPreferredWidthForColumn(e,t){const i=this.getHeaderCellForColumn(e);if(!i)return-1;const n=this.rowRenderer.getAllCellsForColumn(e);return t||n.push(i),this.addElementsToContainerAndGetWidth(n)}getPreferredWidthForColumnGroup(e){const t=this.getHeaderCellForColumn(e);return t?this.addElementsToContainerAndGetWidth([t]):-1}addElementsToContainerAndGetWidth(e){const t=document.createElement("form");t.style.position="fixed";const i=this.centerRowContainerCtrl.getContainerElement();e.forEach(e=>this.cloneItemIntoDummy(e,t)),i.appendChild(t);const n=t.offsetWidth;return i.removeChild(t),n+this.getAutoSizePadding()}getAutoSizePadding(){return this.gos.get("autoSizePadding")}getHeaderCellForColumn(e){let t=null;return this.ctrlsService.getHeaderRowContainerCtrls().forEach(i=>{const n=i.getHtmlElementForColumnHeader(e);null!=n&&(t=n)}),t}cloneItemIntoDummy(e,t){const i=e.cloneNode(!0);i.style.width="",i.style.position="static",i.style.left="";const n=document.createElement("div"),s=n.classList;["ag-header-cell","ag-header-group-cell"].some(e=>i.classList.contains(e))?(s.add("ag-header","ag-header-row"),n.style.position="static"):s.add("ag-row");let r=e.parentElement;for(;r;){if(["ag-header-row","ag-row"].some(e=>r.classList.contains(e))){for(let e=0;e<r.classList.length;e++){const t=r.classList[e];"ag-row-position-absolute"!=t&&s.add(t)}break}r=r.parentElement}n.appendChild(i),t.appendChild(n)}};f([ue("rowRenderer")],yl.prototype,"rowRenderer",2),f([ue("ctrlsService")],yl.prototype,"ctrlsService",2),f([ue("rowCssClassCalculator")],yl.prototype,"rowCssClassCalculator",2),f([le],yl.prototype,"postConstruct",1),yl=f([he("autoWidthCalculator")],yl);var vl=class extends st{constructor(e,t){super(),this.createRowCon=e,this.destroyRowCtrls=t,this.stickyTopRowCtrls=[],this.stickyBottomRowCtrls=[],this.topContainerHeight=0,this.bottomContainerHeight=0}postConstruct(){this.isClientSide="clientSide"===this.rowModel.getType(),this.ctrlsService.whenReady(e=>{this.gridBodyCtrl=e.gridBodyCtrl})}getStickyTopRowCtrls(){return this.stickyTopRowCtrls}getStickyBottomRowCtrls(){return this.stickyBottomRowCtrls}getLastPixelOfGroup(e){return this.isClientSide?this.getClientSideLastPixelOfGroup(e):this.getServerSideLastPixelOfGroup(e)}getFirstPixelOfGroup(e){return e.footer?e.sibling.rowTop+e.sibling.rowHeight-1:e.hasChildren()?e.rowTop-1:0}getServerSideLastPixelOfGroup(e){var t,i,n,s;if(this.isClientSide)throw new Error("This func should only be called in server side row model.");if(e.isExpandable()||e.footer){if(e.master)return e.detailNode.rowTop+e.detailNode.rowHeight;if(!e.sibling||1===Math.abs(e.sibling.rowIndex-e.rowIndex)){let r=null==(t=e.childStore)?void 0:t.getStoreBounds();return e.footer&&(r=null==(i=e.sibling.childStore)?void 0:i.getStoreBounds()),(null!=(n=null==r?void 0:r.heightPx)?n:0)+(null!=(s=null==r?void 0:r.topPx)?s:0)}return e.footer?e.rowTop+e.rowHeight:e.sibling.rowTop+e.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}getClientSideLastPixelOfGroup(e){if(!this.isClientSide)throw new Error("This func should only be called in client side row model.");if(e.isExpandable()||e.footer){const t=e.footer&&0===e.rowIndex,i=!e.sibling||1===Math.abs(e.sibling.rowIndex-e.rowIndex);if(t||i){let t=e.footer?e.sibling:e;for(;t.isExpandable()&&t.expanded;)if(t.master)t=t.detailNode;else if(t.childrenAfterSort){if(0===t.childrenAfterSort.length)break;t=Ie(t.childrenAfterSort)}return t.rowTop+t.rowHeight}return e.footer?e.rowTop+e.rowHeight:e.sibling.rowTop+e.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}updateStickyRows(e){const t="top"===e;let i=0;if(!this.canRowsBeSticky())return this.refreshNodesAndContainerHeight(e,new Set,i);const n=t?this.rowRenderer.getFirstVisibleVerticalPixel():this.rowRenderer.getLastVisibleVerticalPixel(),s=new Set,r=e=>{if(s.add(e),t){const t=this.getLastPixelOfGroup(e),s=n+i+e.rowHeight;e.stickyRowTop=t<s?i+(t-s):i}else{const t=this.getFirstPixelOfGroup(e),s=n-(i+e.rowHeight);e.stickyRowTop=t>s?i-(t-s):i}i=0,s.forEach(e=>{const t=e.stickyRowTop+e.rowHeight;i<t&&(i=t)})},o=this.areFooterRowsStickySuppressed(),a=this.gos.get("suppressGroupRowsSticky"),l=e=>!!e.displayed&&(e.footer?!0!==o&&(("grand"!==o||-1!==e.level)&&(!("group"===o&&e.level>-1)&&!s.has(e))):!!e.isExpandable()&&(!0!==a&&(!s.has(e)&&e.expanded)));for(let e=0;e<100;e++){let e=n+i;t||(e=n-i);const s=this.rowModel.getRowIndexAtPixel(e),o=this.rowModel.getRow(s);if(null==o)break;const a=this.getStickyAncestors(o).find(e=>(t?e.rowIndex<s:e.rowIndex>s)&&l(e));if(a)r(a);else{if(!(t?o.rowTop<e:o.rowTop+o.rowHeight>e)||!l(o))break;r(o)}}return t||s.forEach(e=>{e.stickyRowTop=i-(e.stickyRowTop+e.rowHeight)}),this.refreshNodesAndContainerHeight(e,s,i)}areFooterRowsStickySuppressed(){const e=this.gos.get("suppressStickyTotalRow");if(!0===e)return!0;const t=!!this.gos.get("groupIncludeFooter")||"group"===e,i=!!this.gos.get("groupIncludeTotalFooter")||"grand"===e;return!(!t||!i)||(i?"grand":!!t&&"group")}canRowsBeSticky(){const e=this.gos.isGroupRowsSticky(),t=this.areFooterRowsStickySuppressed(),i=this.gos.get("suppressGroupRowsSticky");return e&&(!t||!i)}getStickyAncestors(e){const t=[];let i=e.footer?e.sibling:e.parent;for(;i;)i.sibling&&t.push(i.sibling),t.push(i),i=i.parent;return t.reverse()}checkStickyRows(){const e=this.updateStickyRows("top"),t=this.updateStickyRows("bottom");return e||t}destroyStickyCtrls(){this.refreshNodesAndContainerHeight("top",new Set,0),this.refreshNodesAndContainerHeight("bottom",new Set,0)}refreshStickyNode(e){const t=new Set;if(this.stickyTopRowCtrls.some(t=>t.getRowNode()===e)){for(let i=0;i<this.stickyTopRowCtrls.length;i++){const n=this.stickyTopRowCtrls[i].getRowNode();n!==e&&t.add(n)}this.refreshNodesAndContainerHeight("top",t,this.topContainerHeight)&&this.checkStickyRows()}else{for(let i=0;i<this.stickyBottomRowCtrls.length;i++){const n=this.stickyBottomRowCtrls[i].getRowNode();n!==e&&t.add(n)}this.refreshNodesAndContainerHeight("bottom",t,this.bottomContainerHeight)&&this.checkStickyRows()}}refreshNodesAndContainerHeight(e,t,i){const n="top"===e,s=n?this.stickyTopRowCtrls:this.stickyBottomRowCtrls,r={},o=[];for(let e=0;e<s.length;e++){const i=s[e].getRowNode();t.has(i)?o.push(s[e]):(r[i.id]=s[e],i.sticky=!1)}const a=new Set;for(let e=0;e<o.length;e++)a.add(o[e].getRowNode());const l=[];t.forEach(e=>{a.has(e)||(e.sticky=!0,l.push(this.createRowCon(e,!1,!1)))});let c=!!l.length||o.length!==s.length;n?this.topContainerHeight!==i&&(this.topContainerHeight=i,this.gridBodyCtrl.setStickyTopHeight(i),c=!0):this.bottomContainerHeight!==i&&(this.bottomContainerHeight=i,this.gridBodyCtrl.setStickyBottomHeight(i),c=!0),this.destroyRowCtrls(r,!1);const h=[...o,...l];return h.sort((e,t)=>t.getRowNode().rowIndex-e.getRowNode().rowIndex),n||h.reverse(),h.forEach(e=>e.setRowTop(e.getRowNode().stickyRowTop)),!!c&&(n?this.stickyTopRowCtrls=h:this.stickyBottomRowCtrls=h,!0)}};f([ue("rowModel")],vl.prototype,"rowModel",2),f([ue("rowRenderer")],vl.prototype,"rowRenderer",2),f([ue("ctrlsService")],vl.prototype,"ctrlsService",2),f([le],vl.prototype,"postConstruct",1);var bl=class extends st{constructor(){super(...arguments),this.destroyFuncsForColumnListeners=[],this.rowCtrlsByRowIndex={},this.zombieRowCtrls={},this.allRowCtrls=[],this.topRowCtrls=[],this.bottomRowCtrls=[],this.refreshInProgress=!1,this.dataFirstRenderedFired=!1,this.setupRangeSelectionListeners=()=>{const e=()=>{this.getAllCellCtrls().forEach(e=>e.onRangeSelectionChanged())},t=()=>{this.getAllCellCtrls().forEach(e=>e.updateRangeBordersIfRangeCount())},i=()=>{this.eventService.addEventListener(ct.EVENT_RANGE_SELECTION_CHANGED,e),this.eventService.addEventListener(ct.EVENT_COLUMN_MOVED,t),this.eventService.addEventListener(ct.EVENT_COLUMN_PINNED,t),this.eventService.addEventListener(ct.EVENT_COLUMN_VISIBLE,t)},n=()=>{this.eventService.removeEventListener(ct.EVENT_RANGE_SELECTION_CHANGED,e),this.eventService.removeEventListener(ct.EVENT_COLUMN_MOVED,t),this.eventService.removeEventListener(ct.EVENT_COLUMN_PINNED,t),this.eventService.removeEventListener(ct.EVENT_COLUMN_VISIBLE,t)};this.addDestroyFunc(()=>n()),this.addManagedPropertyListener("enableRangeSelection",e=>{e.currentValue?i():n()}),this.gos.get("enableRangeSelection")&&i()}}postConstruct(){this.ctrlsService.whenReady(e=>{this.gridBodyCtrl=e.gridBodyCtrl,this.initialise()})}initialise(){if(this.addManagedListener(this.eventService,ct.EVENT_PAGINATION_CHANGED,this.onPageLoaded.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_PINNED_ROW_DATA_CHANGED,this.onPinnedRowDataChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_BODY_SCROLL,this.onBodyScroll.bind(this)),this.addManagedListener(this.eventService,ct.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 e=this.rowModel.getType();"clientSide"!==e&&"serverSide"!==e||(this.stickyRowFeature=this.createManagedBean(new vl(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 e=this.getKeepDetailRowsCount(),t=null!=e?e:3;this.cachedRowCtrls=new Cl(t)}}getKeepDetailRowsCount(){return this.gos.get("keepDetailRowsCount")}getStickyTopRowCtrls(){return this.stickyRowFeature?this.stickyRowFeature.getStickyTopRowCtrls():[]}getStickyBottomRowCtrls(){return this.stickyRowFeature?this.stickyRowFeature.getStickyBottomRowCtrls():[]}updateAllRowCtrls(){const e=N(this.rowCtrlsByRowIndex),t=N(this.zombieRowCtrls),i=this.cachedRowCtrls?this.cachedRowCtrls.getEntries():[];t.length>0||i.length>0?this.allRowCtrls=[...e,...t,...i]:this.allRowCtrls=e}onCellFocusChanged(e){this.getAllCellCtrls().forEach(t=>t.onCellFocused(e)),this.getFullWidthRowCtrls().forEach(t=>t.onFullWidthRowFocused(e))}registerCellEventListeners(){this.addManagedListener(this.eventService,ct.EVENT_CELL_FOCUSED,e=>{this.onCellFocusChanged(e)}),this.addManagedListener(this.eventService,ct.EVENT_CELL_FOCUS_CLEARED,()=>{this.onCellFocusChanged()}),this.addManagedListener(this.eventService,ct.EVENT_FLASH_CELLS,e=>{this.getAllCellCtrls().forEach(t=>t.onFlashCells(e))}),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_HOVER_CHANGED,()=>{this.getAllCellCtrls().forEach(e=>e.onColumnHover())}),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,()=>{this.getAllCellCtrls().forEach(e=>e.onDisplayedColumnsChanged())}),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,()=>{this.printLayout&&this.getAllCellCtrls().forEach(e=>e.onLeftChanged())}),this.setupRangeSelectionListeners(),this.refreshListenersToColumnsForCellComps(),this.addManagedListener(this.eventService,ct.EVENT_GRID_COLUMNS_CHANGED,this.refreshListenersToColumnsForCellComps.bind(this)),this.addDestroyFunc(this.removeGridColumnListeners.bind(this))}removeGridColumnListeners(){this.destroyFuncsForColumnListeners.forEach(e=>e()),this.destroyFuncsForColumnListeners.length=0}refreshListenersToColumnsForCellComps(){this.removeGridColumnListeners(),this.columnModel.getAllGridColumns().forEach(e=>{const t=t=>{this.getAllCellCtrls().forEach(i=>{i.getColumn()===e&&t(i)})},i=()=>{t(e=>e.onLeftChanged())},n=()=>{t(e=>e.onWidthChanged())},s=()=>{t(e=>e.onFirstRightPinnedChanged())},r=()=>{t(e=>e.onLastLeftPinnedChanged())},o=()=>{t(e=>e.onColDefChanged())};e.addEventListener("leftChanged",i),e.addEventListener("widthChanged",n),e.addEventListener("firstRightPinnedChanged",s),e.addEventListener("lastLeftPinnedChanged",r),e.addEventListener("colDefChanged",o),this.destroyFuncsForColumnListeners.push(()=>{e.removeEventListener("leftChanged",i),e.removeEventListener("widthChanged",n),e.removeEventListener("firstRightPinnedChanged",s),e.removeEventListener("lastLeftPinnedChanged",r),e.removeEventListener("colDefChanged",o)})})}onDomLayoutChanged(){const e=this.gos.isDomLayout("print"),t=e||this.gos.get("embedFullWidthRows"),i=t!==this.embedFullWidthRows||this.printLayout!==e;this.printLayout=e,this.embedFullWidthRows=t,i&&this.redrawAfterModelUpdate({domLayoutChanged:!0})}datasourceChanged(){this.firstRenderedRow=0,this.lastRenderedRow=-1;const e=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(e)}onPageLoaded(e){const t={recycleRows:e.keepRenderedRows,animate:e.animate,newData:e.newData,newPage:e.newPage,onlyBody:!0};this.redrawAfterModelUpdate(t)}getAllCellsForColumn(e){const t=[];return this.getAllRowCtrls().forEach(i=>{const n=i.getCellElement(e);n&&t.push(n)}),t}refreshFloatingRowComps(){this.refreshFloatingRows(this.topRowCtrls,this.pinnedRowModel.getPinnedTopRowData()),this.refreshFloatingRows(this.bottomRowCtrls,this.pinnedRowModel.getPinnedBottomRowData())}getTopRowCtrls(){return this.topRowCtrls}getCentreRowCtrls(){return this.allRowCtrls}getBottomRowCtrls(){return this.bottomRowCtrls}refreshFloatingRows(e,t){e.forEach(e=>{e.destroyFirstPass(),e.destroySecondPass()}),e.length=0,t&&t.forEach(t=>{const i=new aa(t,this.beans,!1,!1,this.printLayout);e.push(i)})}onPinnedRowDataChanged(){this.redrawAfterModelUpdate({recycleRows:!0})}redrawRow(e,t=!1){var i;if(e.sticky)this.stickyRowFeature.refreshStickyNode(e);else{if(null==(i=this.cachedRowCtrls)?void 0:i.has(e))return void this.cachedRowCtrls.removeRow(e);{const t=t=>{const i=t[e.rowIndex];i&&i.getRowNode()===e&&(i.destroyFirstPass(),i.destroySecondPass(),t[e.rowIndex]=this.createRowCon(e,!1,!1))};switch(e.rowPinned){case"top":t(this.topRowCtrls);break;case"bottom":t(this.bottomRowCtrls);break;default:t(this.rowCtrlsByRowIndex),this.updateAllRowCtrls()}}}t||this.dispatchDisplayedRowsChanged(!1)}redrawRows(e){if(null!=e)return null==e||e.forEach(e=>this.redrawRow(e,!0)),void this.dispatchDisplayedRowsChanged(!1);this.redrawAfterModelUpdate()}getCellToRestoreFocusToAfterRefresh(e){const t=(null==e?void 0:e.suppressKeepFocus)?null:this.focusService.getFocusCellToUseAfterRefresh();if(null==t)return null;const i=this.gos.getActiveDomElement(),n=this.gos.getDomData(i,sa.DOM_DATA_KEY_CELL_CTRL),s=this.gos.getDomData(i,aa.DOM_DATA_KEY_ROW_CTRL);return n||s?t:null}redrawAfterModelUpdate(e={}){this.getLockOnRefresh();const t=this.getCellToRestoreFocusToAfterRefresh(e);this.updateContainerHeights(),this.scrollToTopIfNewData(e);const i=!e.domLayoutChanged&&!!e.recycleRows,n=e.animate&&this.gos.isAnimateRows(),s=i?this.getRowsToRecycle():null;i||this.removeAllRowComps(),this.workOutFirstAndLastRowsToRender(),this.stickyRowFeature&&this.stickyRowFeature.checkStickyRows(),this.recycleRows(s,n),this.gridBodyCtrl.updateRowCount(),e.onlyBody||this.refreshFloatingRowComps(),this.dispatchDisplayedRowsChanged(),null!=t&&this.restoreFocusedCell(t),this.releaseLockOnRefresh()}scrollToTopIfNewData(e){const t=e.newData||e.newPage,i=this.gos.get("suppressScrollOnNewData");t&&!i&&this.gridBodyCtrl.getScrollFeature().scrollToTop()}updateContainerHeights(){if(this.printLayout)return void this.rowContainerHeightService.setModelHeight(null);let e=this.paginationProxy.getCurrentPageHeight();0===e&&(e=1),this.rowContainerHeightService.setModelHeight(e)}getLockOnRefresh(){if(this.refreshInProgress)throw new Error("AG Grid: cannot get grid to draw rows when it is in the middle of drawing rows. Your code probably called a grid API method while the grid was in the render stage. To overcome this, put the API call into a timeout, e.g. instead of api.redrawRows(), call setTimeout(function() { api.redrawRows(); }, 0). To see what part of your code that caused the refresh check this stacktrace.");this.refreshInProgress=!0}releaseLockOnRefresh(){this.refreshInProgress=!1}isRefreshInProgress(){return this.refreshInProgress}restoreFocusedCell(e){e&&(this.focusService.setRestoreFocusedCell(e),this.onCellFocusChanged(this.beans.gos.addGridCommonParams({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0,type:"mock"})))}stopEditing(e=!1){this.getAllRowCtrls().forEach(t=>{t.stopEditing(e)})}getAllCellCtrls(){const e=[],t=this.getAllRowCtrls(),i=t.length;for(let n=0;n<i;n++){const i=t[n].getAllCellCtrls(),s=i.length;for(let t=0;t<s;t++)e.push(i[t])}return e}getAllRowCtrls(){const e=this.stickyRowFeature&&this.stickyRowFeature.getStickyTopRowCtrls()||[],t=this.stickyRowFeature&&this.stickyRowFeature.getStickyBottomRowCtrls()||[],i=[...this.topRowCtrls,...this.bottomRowCtrls,...e,...t];for(const e in this.rowCtrlsByRowIndex)i.push(this.rowCtrlsByRowIndex[e]);return i}addRenderedRowListener(e,t,i){const n=this.rowCtrlsByRowIndex[t];n&&n.addEventListener(e,i)}flashCells(e={}){this.getCellCtrls(e.rowNodes,e.columns).forEach(t=>t.flashCell(e))}refreshCells(e={}){const t={forceRefresh:e.force,newData:!1,suppressFlash:e.suppressFlash};this.getCellCtrls(e.rowNodes,e.columns).forEach(e=>e.refreshOrDestroyCell(t)),e.rowNodes&&(this.getRowCtrls(e.rowNodes).forEach(e=>{e.isFullWidth()&&(e.refreshFullWidth()||this.redrawRow(e.getRowNode(),!0))}),this.dispatchDisplayedRowsChanged(!1))}getCellRendererInstances(e){var t;const i=this.getCellCtrls(e.rowNodes,e.columns).map(e=>e.getCellRenderer()).filter(e=>null!=e);if(null==(t=e.columns)?void 0:t.length)return i;const n=[],s=this.mapRowNodes(e.rowNodes);return this.getAllRowCtrls().forEach(e=>{if(s&&!this.isRowInMap(e.getRowNode(),s))return;if(!e.isFullWidth())return;const t=e.getFullWidthCellRenderers();for(let e=0;e<t.length;e++){const i=t[e];null!=i&&n.push(i)}}),[...n,...i]}getCellEditorInstances(e){const t=[];return this.getCellCtrls(e.rowNodes,e.columns).forEach(e=>{const i=e.getCellEditor();i&&t.push(i)}),t}getEditingCells(){const e=[];return this.getAllCellCtrls().forEach(t=>{if(t.isEditing()){const i=t.getCellPosition();e.push(i)}}),e}mapRowNodes(e){if(!e)return;const t={top:{},bottom:{},normal:{}};return e.forEach(e=>{const i=e.id;switch(e.rowPinned){case"top":t.top[i]=e;break;case"bottom":t.bottom[i]=e;break;default:t.normal[i]=e}}),t}isRowInMap(e,t){const i=e.id;switch(e.rowPinned){case"top":return null!=t.top[i];case"bottom":return null!=t.bottom[i];default:return null!=t.normal[i]}}getRowCtrls(e){const t=this.mapRowNodes(e),i=this.getAllRowCtrls();return e&&t?i.filter(e=>{const i=e.getRowNode();return this.isRowInMap(i,t)}):i}getCellCtrls(e,t){let i;b(t)&&(i={},t.forEach(e=>{const t=this.columnModel.getGridColumn(e);b(t)&&(i[t.getId()]=!0)}));const n=[];return this.getRowCtrls(e).forEach(e=>{e.getAllCellCtrls().forEach(e=>{const t=e.getColumn().getId();i&&!i[t]||n.push(e)})}),n}destroy(){this.removeAllRowComps(),super.destroy()}removeAllRowComps(){const e=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(e),this.stickyRowFeature&&this.stickyRowFeature.destroyStickyCtrls()}getRowsToRecycle(){const e=[];P(this.rowCtrlsByRowIndex,(t,i)=>{null==i.getRowNode().id&&e.push(t)}),this.removeRowCtrls(e);const t={};return P(this.rowCtrlsByRowIndex,(e,i)=>{const n=i.getRowNode();t[n.id]=i}),this.rowCtrlsByRowIndex={},t}removeRowCtrls(e,t=!1){e.forEach(e=>{const i=this.rowCtrlsByRowIndex[e];i&&(i.destroyFirstPass(t),i.destroySecondPass()),delete this.rowCtrlsByRowIndex[e]})}onBodyScroll(e){"vertical"===e.direction&&this.redraw({afterScroll:!0})}redraw(e={}){const{afterScroll:t}=e;let i;this.stickyRowFeature&&_i()&&(i=this.getCellToRestoreFocusToAfterRefresh()||void 0);const n=this.firstRenderedRow,s=this.lastRenderedRow;this.workOutFirstAndLastRowsToRender();let r=!1;this.stickyRowFeature&&(r=this.stickyRowFeature.checkStickyRows());const o=this.firstRenderedRow!==n||this.lastRenderedRow!==s;if((!t||r||o)&&(this.getLockOnRefresh(),this.recycleRows(null,!1,t),this.releaseLockOnRefresh(),this.dispatchDisplayedRowsChanged(t&&!r),null!=i)){const e=this.getCellToRestoreFocusToAfterRefresh();null!=i&&null==e&&(this.animationFrameService.flushAllFrames(),this.restoreFocusedCell(i))}}removeRowCompsNotToDraw(e,t){const i={};e.forEach(e=>i[e]=!0);const n=Object.keys(this.rowCtrlsByRowIndex).filter(e=>!i[e]);this.removeRowCtrls(n,t)}calculateIndexesToDraw(e){let t=Wi(this.firstRenderedRow,this.lastRenderedRow);const i=(e,i)=>{const n=i.getRowNode().rowIndex;null!=n&&(n<this.firstRenderedRow||n>this.lastRenderedRow)&&this.doNotUnVirtualiseRow(i)&&t.push(n)};P(this.rowCtrlsByRowIndex,i),P(e,i),t.sort((e,t)=>e-t);const n=[];for(let e=0;e<t.length;e++){const i=t[e],s=this.paginationProxy.getRow(i);s&&!s.sticky&&n.push(i)}return n}recycleRows(e,t=!1,i=!1){const n=this.calculateIndexesToDraw(e);(this.printLayout||i)&&(t=!1),this.removeRowCompsNotToDraw(n,!t);const s=[];n.forEach(n=>{const r=this.createOrUpdateRowCtrl(n,e,t,i);b(r)&&s.push(r)}),e&&(!i||this.gos.get("suppressAnimationFrame")||this.printLayout?this.destroyRowCtrls(e,t):this.beans.animationFrameService.addDestroyTask(()=>{this.destroyRowCtrls(e,t),this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()})),this.updateAllRowCtrls()}dispatchDisplayedRowsChanged(e=!1){const t={type:ct.EVENT_DISPLAYED_ROWS_CHANGED,afterScroll:e};this.eventService.dispatchEvent(t)}onDisplayedColumnsChanged(){const e=this.columnModel.isPinningLeft(),t=this.columnModel.isPinningRight();(this.pinningLeft!==e||t!==this.pinningRight)&&(this.pinningLeft=e,this.pinningRight=t,this.embedFullWidthRows&&this.redrawFullWidthEmbeddedRows())}redrawFullWidthEmbeddedRows(){const e=[];this.getFullWidthRowCtrls().forEach(t=>{const i=t.getRowNode().rowIndex;e.push(i.toString())}),this.refreshFloatingRowComps(),this.removeRowCtrls(e),this.redraw({afterScroll:!0})}getFullWidthRowCtrls(e){const t=this.mapRowNodes(e);return this.getAllRowCtrls().filter(e=>{if(!e.isFullWidth())return!1;const i=e.getRowNode();return!(null!=t&&!this.isRowInMap(i,t))})}createOrUpdateRowCtrl(e,t,i,n){let s,r=this.rowCtrlsByRowIndex[e];if(r||(s=this.paginationProxy.getRow(e),b(s)&&b(t)&&t[s.id]&&s.alreadyRendered&&(r=t[s.id],t[s.id]=null)),!r){if(s||(s=this.paginationProxy.getRow(e)),!b(s))return;r=this.createRowCon(s,i,n)}return s&&(s.alreadyRendered=!0),this.rowCtrlsByRowIndex[e]=r,r}destroyRowCtrls(e,t){const i=[];P(e,(e,n)=>{n&&(this.cachedRowCtrls&&n.isCacheable()?this.cachedRowCtrls.addRow(n):(n.destroyFirstPass(!t),t?(this.zombieRowCtrls[n.getInstanceId()]=n,i.push(()=>{n.destroySecondPass(),delete this.zombieRowCtrls[n.getInstanceId()]})):n.destroySecondPass()))}),t&&(i.push(()=>{this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()}),K(i))}getRowBuffer(){return this.gos.get("rowBuffer")}getRowBufferInPixels(){return this.getRowBuffer()*this.gos.getRowHeightAsNumber()}workOutFirstAndLastRowsToRender(){let e,t;if(this.rowContainerHeightService.updateOffset(),this.paginationProxy.isRowsToRender())if(this.printLayout)this.environment.refreshRowHeightVariable(),e=this.paginationProxy.getPageFirstRow(),t=this.paginationProxy.getPageLastRow();else{const i=this.getRowBufferInPixels(),n=this.ctrlsService.getGridBodyCtrl(),s=this.gos.get("suppressRowVirtualisation");let r,o,a=!1;do{const e=this.paginationProxy.getPixelOffset(),{pageFirstPixel:t,pageLastPixel:l}=this.paginationProxy.getCurrentPagePixelRange(),c=this.rowContainerHeightService.getDivStretchOffset(),h=n.getScrollFeature().getVScrollPosition(),u=h.top,d=h.bottom;s?(r=t+c,o=l+c):(r=Math.max(u+e-i,t)+c,o=Math.min(d+e+i,l)+c),this.firstVisibleVPixel=Math.max(u+e,t)+c,this.lastVisibleVPixel=Math.min(d+e,l)+c,a=this.ensureAllRowsInRangeHaveHeightsCalculated(r,o)}while(a);let l=this.paginationProxy.getRowIndexAtPixel(r),c=this.paginationProxy.getRowIndexAtPixel(o);const h=this.paginationProxy.getPageFirstRow(),u=this.paginationProxy.getPageLastRow();l<h&&(l=h),c>u&&(c=u),e=l,t=c}else e=0,t=-1;const i=this.gos.isDomLayout("normal"),n=this.gos.get("suppressMaxRenderedRowRestriction"),s=Math.max(this.getRowBuffer(),500);i&&!n&&t-e>s&&(t=e+s);const r=e!==this.firstRenderedRow,o=t!==this.lastRenderedRow;if(r||o){this.firstRenderedRow=e,this.lastRenderedRow=t;const i={type:ct.EVENT_VIEWPORT_CHANGED,firstRow:e,lastRow:t};this.eventService.dispatchEvent(i)}}dispatchFirstDataRenderedEvent(){if(this.dataFirstRenderedFired)return;this.dataFirstRenderedFired=!0;const e={type:ct.EVENT_FIRST_DATA_RENDERED,firstRow:this.firstRenderedRow,lastRow:this.lastRenderedRow};window.requestAnimationFrame(()=>{this.beans.eventService.dispatchEvent(e)})}ensureAllRowsInRangeHaveHeightsCalculated(e,t){const i=this.paginationProxy.ensureRowHeightsValid(e,t,-1,-1);return i&&this.updateContainerHeights(),i}getFirstVisibleVerticalPixel(){return this.firstVisibleVPixel}getLastVisibleVerticalPixel(){return this.lastVisibleVPixel}getFirstVirtualRenderedRow(){return this.firstRenderedRow}getLastVirtualRenderedRow(){return this.lastRenderedRow}doNotUnVirtualiseRow(e){const t=!1,i=e.getRowNode(),n=this.focusService.isRowNodeFocused(i),s=e.isEditing(),r=i.detail;return(n||s||r)&&!!this.paginationProxy.isRowPresent(i)||t}createRowCon(e,t,i){const n=this.cachedRowCtrls?this.cachedRowCtrls.getRow(e):null;if(n)return n;const s=this.gos.get("suppressAnimationFrame"),r=i&&!s&&!this.printLayout;return new aa(e,this.beans,t,r,this.printLayout)}getRenderedNodes(){const e=this.rowCtrlsByRowIndex;return Object.values(e).map(e=>e.getRowNode())}getRowByPosition(e){let t;const{rowIndex:i}=e;switch(e.rowPinned){case"top":t=this.topRowCtrls[i];break;case"bottom":t=this.bottomRowCtrls[i];break;default:t=this.rowCtrlsByRowIndex[i],t||(t=this.getStickyTopRowCtrls().find(e=>e.getRowNode().rowIndex===i)||null,t||(t=this.getStickyBottomRowCtrls().find(e=>e.getRowNode().rowIndex===i)||null))}return t}isRangeInRenderedViewport(e,t){if(null==e||null==t)return!1;const i=e>this.lastRenderedRow;return!(t<this.firstRenderedRow||i)}};f([ue("animationFrameService")],bl.prototype,"animationFrameService",2),f([ue("paginationProxy")],bl.prototype,"paginationProxy",2),f([ue("columnModel")],bl.prototype,"columnModel",2),f([ue("pinnedRowModel")],bl.prototype,"pinnedRowModel",2),f([ue("rowModel")],bl.prototype,"rowModel",2),f([ue("focusService")],bl.prototype,"focusService",2),f([ue("beans")],bl.prototype,"beans",2),f([ue("rowContainerHeightService")],bl.prototype,"rowContainerHeightService",2),f([ue("ctrlsService")],bl.prototype,"ctrlsService",2),f([le],bl.prototype,"postConstruct",1),bl=f([he("rowRenderer")],bl);var Cl=class{constructor(e){this.entriesMap={},this.entriesList=[],this.maxCount=e}addRow(e){if(this.entriesMap[e.getRowNode().id]=e,this.entriesList.push(e),e.setCached(!0),this.entriesList.length>this.maxCount){const e=this.entriesList[0];e.destroyFirstPass(),e.destroySecondPass(),this.removeFromCache(e)}}getRow(e){if(null==e||null==e.id)return null;const t=this.entriesMap[e.id];return t?(this.removeFromCache(t),t.setCached(!1),t.getRowNode()!=e?null:t):null}has(e){return null!=this.entriesMap[e.id]}removeRow(e){const t=e.id,i=this.entriesMap[t];delete this.entriesMap[t],Ne(this.entriesList,i)}removeFromCache(e){const t=e.getRowNode().id;delete this.entriesMap[t],Ne(this.entriesList,e)}getEntries(){return this.entriesList}},wl=class extends st{init(){this.setPinnedTopRowData(),this.setPinnedBottomRowData(),this.addManagedPropertyListener("pinnedTopRowData",()=>this.setPinnedTopRowData()),this.addManagedPropertyListener("pinnedBottomRowData",()=>this.setPinnedBottomRowData())}isEmpty(e){return w("top"===e?this.pinnedTopRows:this.pinnedBottomRows)}isRowsToRender(e){return!this.isEmpty(e)}getRowAtPixel(e,t){const i="top"===t?this.pinnedTopRows:this.pinnedBottomRows;if(w(i))return 0;for(let t=0;t<i.length;t++){const n=i[t];if(n.rowTop+n.rowHeight-1>=e)return t}return i.length-1}setPinnedTopRowData(){const e=this.gos.get("pinnedTopRowData");this.pinnedTopRows=this.createNodesFromData(e,!0);const t={type:ct.EVENT_PINNED_ROW_DATA_CHANGED};this.eventService.dispatchEvent(t)}setPinnedBottomRowData(){const e=this.gos.get("pinnedBottomRowData");this.pinnedBottomRows=this.createNodesFromData(e,!1);const t={type:ct.EVENT_PINNED_ROW_DATA_CHANGED};this.eventService.dispatchEvent(t)}createNodesFromData(e,t){const i=[];if(e){let n=0;e.forEach((e,s)=>{const r=new kr(this.beans);r.data=e;const o=t?kr.ID_PREFIX_TOP_PINNED:kr.ID_PREFIX_BOTTOM_PINNED;r.id=o+s,r.rowPinned=t?"top":"bottom",r.setRowTop(n),r.setRowHeight(this.gos.getRowHeightForNode(r).height),r.setRowIndex(s),n+=r.rowHeight,i.push(r)})}return i}getPinnedTopRowData(){return this.pinnedTopRows}getPinnedBottomRowData(){return this.pinnedBottomRows}getPinnedTopTotalHeight(){return this.getTotalHeight(this.pinnedTopRows)}getPinnedTopRowCount(){return this.pinnedTopRows?this.pinnedTopRows.length:0}getPinnedBottomRowCount(){return this.pinnedBottomRows?this.pinnedBottomRows.length:0}getPinnedTopRow(e){return this.pinnedTopRows[e]}getPinnedBottomRow(e){return this.pinnedBottomRows[e]}forEachPinnedTopRow(e){w(this.pinnedTopRows)||this.pinnedTopRows.forEach(e)}forEachPinnedBottomRow(e){w(this.pinnedBottomRows)||this.pinnedBottomRows.forEach(e)}getPinnedBottomTotalHeight(){return this.getTotalHeight(this.pinnedBottomRows)}getTotalHeight(e){if(!e||0===e.length)return 0;const t=Ie(e);return t.rowTop+t.rowHeight}};f([ue("beans")],wl.prototype,"beans",2),f([le],wl.prototype,"init",1),wl=f([he("pinnedRowModel")],wl);var Sl=class{constructor(e,t){this.active=!0,this.nodeIdsToColumns={},this.mapToItems={},this.keepingColumns=e,this.pathRoot={rowNode:t,children:null},this.mapToItems[t.id]=this.pathRoot}setInactive(){this.active=!1}isActive(){return this.active}depthFirstSearchChangedPath(e,t){if(e.children)for(let i=0;i<e.children.length;i++)this.depthFirstSearchChangedPath(e.children[i],t);t(e.rowNode)}depthFirstSearchEverything(e,t,i){if(e.childrenAfterGroup)for(let n=0;n<e.childrenAfterGroup.length;n++){const s=e.childrenAfterGroup[n];s.childrenAfterGroup?this.depthFirstSearchEverything(e.childrenAfterGroup[n],t,i):i&&t(s)}t(e)}forEachChangedNodeDepthFirst(e,t=!1,i=!1){this.active&&!i?this.depthFirstSearchChangedPath(this.pathRoot,e):this.depthFirstSearchEverything(this.pathRoot.rowNode,e,t)}executeFromRootNode(e){e(this.pathRoot.rowNode)}createPathItems(e){let t=e,i=0;for(;!this.mapToItems[t.id];){const e={rowNode:t,children:null};this.mapToItems[t.id]=e,i++,t=t.parent}return i}populateColumnsMap(e,t){if(!this.keepingColumns||!t)return;let i=e;for(;i;)this.nodeIdsToColumns[i.id]||(this.nodeIdsToColumns[i.id]={}),t.forEach(e=>this.nodeIdsToColumns[i.id][e.getId()]=!0),i=i.parent}linkPathItems(e,t){let i=e;for(let e=0;e<t;e++){const e=this.mapToItems[i.id],t=this.mapToItems[i.parent.id];t.children||(t.children=[]),t.children.push(e),i=i.parent}}addParentNode(e,t){if(!e||e.isRowPinned())return;const i=this.createPathItems(e);this.linkPathItems(e,i),this.populateColumnsMap(e,t)}canSkip(e){return this.active&&!this.mapToItems[e.id]}getValueColumnsForNode(e,t){if(!this.keepingColumns)return t;const i=this.nodeIdsToColumns[e.id];return t.filter(e=>i[e.getId()])}getNotValueColumnsForNode(e,t){if(!this.keepingColumns)return null;const i=this.nodeIdsToColumns[e.id];return t.filter(e=>!i[e.getId()])}},xl=class e extends st{constructor(t){super(),this.state=e.STATE_WAITING_TO_LOAD,this.version=0,this.id=t}getId(){return this.id}load(){this.state=e.STATE_LOADING,this.loadFromDatasource()}getVersion(){return this.version}setStateWaitingToLoad(){this.version++,this.state=e.STATE_WAITING_TO_LOAD}getState(){return this.state}pageLoadFailed(t){this.isRequestMostRecentAndLive(t)&&(this.state=e.STATE_FAILED,this.processServerFail()),this.dispatchLoadCompleted(!1)}success(e,t){this.successCommon(e,t)}pageLoaded(e,t,i){this.successCommon(e,{rowData:t,rowCount:i})}isRequestMostRecentAndLive(e){const t=e===this.version,i=this.isAlive();return t&&i}successCommon(t,i){this.dispatchLoadCompleted(),this.isRequestMostRecentAndLive(t)&&(this.state=e.STATE_LOADED,this.processServerResult(i))}dispatchLoadCompleted(t=!0){const i={type:e.EVENT_LOAD_COMPLETE,success:t,block:this};this.dispatchEvent(i)}};xl.EVENT_LOAD_COMPLETE="loadComplete",xl.STATE_WAITING_TO_LOAD="needsLoading",xl.STATE_LOADING="loading",xl.STATE_LOADED="loaded",xl.STATE_FAILED="failed";var El=xl,Al=class extends st{constructor(){super(...arguments),this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=this.getMaxConcurrentDatasourceRequests();const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=cs.debounce(this.performCheckBlocksToLoad.bind(this),e))}setBeans(e){this.logger=e.create("RowNodeBlockLoader")}getMaxConcurrentDatasourceRequests(){const e=this.gos.get("maxConcurrentDatasourceRequests");return null==e?2:e<=0?void 0:e}addBlock(e){this.blocks.push(e),e.addEventListener(El.EVENT_LOAD_COMPLETE,this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){cs.removeFromArray(this.blocks,e)}destroy(){super.destroy(),this.active=!1}loadComplete(){this.activeBlockLoadsCount--,this.checkBlockToLoad(),this.dispatchEvent({type:Al.BLOCK_LOADED_EVENT}),0==this.activeBlockLoadsCount&&this.dispatchEvent({type:Al.BLOCK_LOADER_FINISHED_EVENT})}checkBlockToLoad(){this.checkBlockToLoadDebounce?this.checkBlockToLoadDebounce():this.performCheckBlocksToLoad()}performCheckBlocksToLoad(){if(!this.active)return;if(this.printCacheStatus(),null!=this.maxConcurrentRequests&&this.activeBlockLoadsCount>=this.maxConcurrentRequests)return void this.logger.log("checkBlockToLoad: max loads exceeded");const e=this.getAvailableLoadingCount(),t=this.blocks.filter(e=>e.getState()===El.STATE_WAITING_TO_LOAD).slice(0,e);this.registerLoads(t.length),t.forEach(e=>e.load()),this.printCacheStatus()}getBlockState(){if(this.gos.isRowModelType("serverSide"))return this.rowModel.getBlockStates();const e={};return this.blocks.forEach(t=>{const{id:i,state:n}=t.getBlockStateJson();e[i]=n}),e}printCacheStatus(){this.logger.isLogging()&&this.logger.log(`printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}isLoading(){return this.activeBlockLoadsCount>0}registerLoads(e){this.activeBlockLoadsCount+=e}getAvailableLoadingCount(){return void 0!==this.maxConcurrentRequests?this.maxConcurrentRequests-this.activeBlockLoadsCount:void 0}};Al.BLOCK_LOADED_EVENT="blockLoaded",Al.BLOCK_LOADER_FINISHED_EVENT="blockLoaderFinished",f([ue("rowModel")],Al.prototype,"rowModel",2),f([le],Al.prototype,"postConstruct",1),f([m(0,ge("loggerFactory"))],Al.prototype,"setBeans",1),Al=f([he("rowNodeBlockLoader")],Al);var Ml=class extends st{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,ct.EVENT_MODEL_UPDATED,this.onModelUpdated.bind(this)),this.addManagedPropertyListener("pagination",this.onPaginationGridOptionChanged.bind(this)),this.addManagedPropertyListener("paginationPageSize",this.onPageSizeGridOptionChanged.bind(this)),this.onModelUpdated()}ensureRowHeightsValid(e,t,i,n){const s=this.rowModel.ensureRowHeightsValid(e,t,this.getPageFirstRow(),this.getPageLastRow());return s&&this.calculatePages(),s}isPaginateChildRows(){return!(!this.gos.get("groupRemoveSingleChildren")&&!this.gos.get("groupRemoveLowestSingleChildren"))||this.gos.get("paginateChildRows")}onModelUpdated(e){this.calculatePages();const t={type:ct.EVENT_PAGINATION_CHANGED,animate:!!e&&e.animate,newData:!!e&&e.newData,newPage:!!e&&e.newPage,newPageSize:!!e&&e.newPageSize,keepRenderedRows:!!e&&e.keepRenderedRows};this.eventService.dispatchEvent(t)}onPaginationGridOptionChanged(){this.active=this.gos.get("pagination"),this.calculatePages();const e={type:ct.EVENT_PAGINATION_CHANGED,animate:!1,newData:!1,newPage:!1,newPageSize:!1,keepRenderedRows:!0};this.eventService.dispatchEvent(e)}onPageSizeGridOptionChanged(){this.setPageSize(this.gos.get("paginationPageSize"),"gridOptions")}goToPage(e){if(!this.active||this.currentPage===e||"number"!=typeof this.currentPage)return;this.currentPage=e,this.calculatePages();const t={type:ct.EVENT_PAGINATION_CHANGED,animate:!1,newData:!1,newPage:!0,newPageSize:!1,keepRenderedRows:!1};this.eventService.dispatchEvent(t)}getPixelOffset(){return this.pixelOffset}getRow(e){return this.rowModel.getRow(e)}getRowNode(e){return this.rowModel.getRowNode(e)}getRowIndexAtPixel(e){return this.rowModel.getRowIndexAtPixel(e)}getCurrentPageHeight(){return C(this.topRowBounds)||C(this.bottomRowBounds)?0:Math.max(this.bottomRowBounds.rowTop+this.bottomRowBounds.rowHeight-this.topRowBounds.rowTop,0)}getCurrentPagePixelRange(){return{pageFirstPixel:this.topRowBounds?this.topRowBounds.rowTop:0,pageLastPixel:this.bottomRowBounds?this.bottomRowBounds.rowTop+this.bottomRowBounds.rowHeight:0}}isRowPresent(e){return!!this.rowModel.isRowPresent(e)&&(e.rowIndex>=this.topDisplayedRowIndex&&e.rowIndex<=this.bottomDisplayedRowIndex)}isEmpty(){return this.rowModel.isEmpty()}isRowsToRender(){return this.rowModel.isRowsToRender()}forEachNode(e){return this.rowModel.forEachNode(e)}forEachNodeOnPage(e){const t=this.getPageFirstRow(),i=this.getPageLastRow();for(let n=t;n<=i;n++){const t=this.getRow(n);t&&e(t)}}getType(){return this.rowModel.getType()}getRowBounds(e){const t=this.rowModel.getRowBounds(e);return t.rowIndex=e,t}getPageFirstRow(){return this.topRowBounds?this.topRowBounds.rowIndex:-1}getPageLastRow(){return this.bottomRowBounds?this.bottomRowBounds.rowIndex:-1}getRowCount(){return this.rowModel.getRowCount()}getPageForIndex(e){return Math.floor(e/this.pageSize)}goToPageWithIndex(e){if(!this.active)return;const t=this.getPageForIndex(e);this.goToPage(t)}isRowInPage(e){return!this.active||this.getPageForIndex(e.rowIndex)===this.currentPage}isLastPageFound(){return this.rowModel.isLastRowIndexKnown()}getCurrentPage(){return this.currentPage}goToNextPage(){this.goToPage(this.currentPage+1)}goToPreviousPage(){this.goToPage(this.currentPage-1)}goToFirstPage(){this.goToPage(0)}goToLastPage(){const e=this.rowModel.getRowCount(),t=Math.floor(e/this.pageSize);this.goToPage(t)}getPageSize(){return this.pageSize}getTotalPages(){return this.totalPages}setPage(e){this.currentPage=e}get pageSize(){return b(this.pageSizeAutoCalculated)?this.pageSizeAutoCalculated:b(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:b(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:b(this.pageSizeFromGridOptions)?this.pageSizeFromGridOptions:this.defaultPageSize}unsetAutoCalculatedPageSize(){if(void 0===this.pageSizeAutoCalculated)return;const e=this.pageSizeAutoCalculated;if(this.pageSizeAutoCalculated=void 0,this.pageSize===e)return;this.calculatePages();const t={type:ct.EVENT_PAGINATION_CHANGED,animate:!1,newData:!1,newPage:!1,newPageSize:!0,keepRenderedRows:!1};this.eventService.dispatchEvent(t)}setPageSize(e,t){const i=this.pageSize;switch(t){case"autoCalculated":this.pageSizeAutoCalculated=e;break;case"pageSizeSelector":this.pageSizeFromPageSizeSelector=e,0!==this.currentPage&&this.goToFirstPage();break;case"initialState":this.pageSizeFromInitialState=e;break;case"gridOptions":this.pageSizeFromGridOptions=e,this.pageSizeFromInitialState=void 0,this.pageSizeFromPageSizeSelector=void 0,0!==this.currentPage&&this.goToFirstPage()}if(i!==this.pageSize){this.calculatePages();const e={type:ct.EVENT_PAGINATION_CHANGED,animate:!1,newData:!1,newPage:!1,newPageSize:!0,keepRenderedRows:!0};this.eventService.dispatchEvent(e)}}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(b(this.topRowBounds)?this.topRowBounds.rowTop:0)}setPixelOffset(e){this.pixelOffset!==e&&(this.pixelOffset=e,this.eventService.dispatchEvent({type:ct.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED}))}setZeroRows(){this.masterRowCount=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=-1,this.currentPage=0,this.totalPages=0}adjustCurrentPageIfInvalid(){this.currentPage>=this.totalPages&&(this.currentPage=this.totalPages-1),(!isFinite(this.currentPage)||isNaN(this.currentPage)||this.currentPage<0)&&(this.currentPage=0)}calculatePagesMasterRowsOnly(){if(this.masterRowCount=this.rowModel.getTopLevelRowCount(),this.masterRowCount<=0)return void this.setZeroRows();const e=this.masterRowCount-1;this.totalPages=Math.floor(e/this.pageSize)+1,this.adjustCurrentPageIfInvalid();const t=this.pageSize*this.currentPage;let i=this.pageSize*(this.currentPage+1)-1;if(i>e&&(i=e),this.topDisplayedRowIndex=this.rowModel.getTopLevelRowDisplayedIndex(t),i===e)this.bottomDisplayedRowIndex=this.rowModel.getRowCount()-1;else{const e=this.rowModel.getTopLevelRowDisplayedIndex(i+1);this.bottomDisplayedRowIndex=e-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){if(this.masterRowCount=this.rowModel.getRowCount(),0===this.masterRowCount)return void this.setZeroRows();const e=this.masterRowCount-1;this.totalPages=Math.floor(e/this.pageSize)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=this.pageSize*this.currentPage,this.bottomDisplayedRowIndex=this.pageSize*(this.currentPage+1)-1,this.bottomDisplayedRowIndex>e&&(this.bottomDisplayedRowIndex=e)}calculatedPagesNotActive(){this.setPageSize(void 0,"autoCalculated"),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.rowModel.getRowCount()-1}};f([ue("rowModel")],Ml.prototype,"rowModel",2),f([le],Ml.prototype,"postConstruct",1),Ml=f([he("paginationProxy")],Ml);var Tl=class extends st{processAllCellClasses(e,t,i,n){this.processClassRules(void 0,e.cellClassRules,t,i,n),this.processStaticCellClasses(e,t,i)}processClassRules(e,t,i,n,s){if(null==t&&null==e)return;const r={},o={},a=(e,t)=>{e.split(" ").forEach(e=>{""!=e.trim()&&t(e)})};if(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const s=e[n],l=t[s];let c;"string"==typeof l?c=this.expressionService.evaluate(l,i):"function"==typeof l&&(c=l(i)),a(s,e=>{c?r[e]=!0:o[e]=!0})}}e&&s&&Object.keys(e).forEach(e=>a(e,e=>{r[e]||(o[e]=!0)})),s&&Object.keys(o).forEach(s),Object.keys(r).forEach(n)}getStaticCellClasses(e,t){const{cellClass:i}=e;if(!i)return[];let n;return n="function"==typeof i?i(t):i,"string"==typeof n&&(n=[n]),n||[]}processStaticCellClasses(e,t,i){this.getStaticCellClasses(e,t).forEach(e=>{i(e)})}};f([ue("expressionService")],Tl.prototype,"expressionService",2),Tl=f([he("stylingService")],Tl);var Dl=class extends Vs{constructor(e){super(e,"ag-toggle-button")}setValue(e,t){return super.setValue(e,t),this.addOrRemoveCssClass("ag-selected",this.getValue()),this}},Il=class extends Bs{constructor(e){super(e,"ag-text-area",null,"textarea")}setValue(e,t){const i=super.setValue(e,t);return this.eInput.value=e,i}setCols(e){return this.eInput.cols=e,this}setRows(e){return this.eInput.rows=e,this}},Rl=class extends Js{constructor(e){super(e,"ag-date-field","date")}postConstruct(){super.postConstruct(),this.addManagedListener(this.eInput,"wheel",this.onWheel.bind(this));const e=Ti();this.addManagedListener(this.eInput,"mousedown",()=>{this.isDisabled()||e||this.eInput.focus()}),this.eInput.step="any"}onWheel(e){this.gos.getActiveDomElement()===this.eInput&&e.preventDefault()}setMin(e){var t;const i=e instanceof Date?null!=(t=Xi(null!=e?e:null,!1))?t:void 0:e;return this.min===i||(this.min=i,Bn(this.eInput,"min",i)),this}setMax(e){var t;const i=e instanceof Date?null!=(t=Xi(null!=e?e:null,!1))?t:void 0:e;return this.max===i||(this.max=i,Bn(this.eInput,"max",i)),this}setStep(e){return this.step===e||(this.step=e,Bn(this.eInput,"step",e)),this}getDate(){var e;if(this.eInput.validity.valid)return null!=(e=Ji(this.getValue()))?e:void 0}setDate(e,t){this.setValue(Xi(null!=e?e:null,!1),t)}},kl=class extends Bs{constructor(e){super(e,"ag-range-field","range")}postConstruct(){super.postConstruct();const{min:e,max:t,step:i}=this.config;null!=e&&this.setMinValue(e),null!=t&&this.setMaxValue(t),this.setStep(i||1)}addInputListeners(){this.addManagedListener(this.eInput,"input",e=>{const t=e.target.value;this.setValue(t)})}setMinValue(e){return this.min=e,this.eInput.setAttribute("min",e.toString()),this}setMaxValue(e){return this.max=e,this.eInput.setAttribute("max",e.toString()),this}setStep(e){return this.eInput.setAttribute("step",e.toString()),this}setValue(e,t){null!=this.min&&(e=Math.max(parseFloat(e),this.min).toString()),null!=this.max&&(e=Math.min(parseFloat(e),this.max).toString());const i=super.setValue(e,t);return this.eInput.value=e,i}},Pl=class extends vs{constructor(e,t){super('<div class="ag-rich-select-row" role="presentation"></div>'),this.params=e,this.wrapperEl=t}postConstruct(){this.addManagedListener(this.getGui(),"click",this.onClick.bind(this))}setState(e){let t="";this.params.valueFormatter&&(t=this.params.valueFormatter(e)),this.populateWithRenderer(e,t)||this.populateWithoutRenderer(e,t),this.value=e}highlightString(e){const{parsedValue:t}=this;if(this.params.cellRenderer||!b(t))return;let i=b(e);if(i){const n=null==t?void 0:t.toLocaleLowerCase().indexOf(e.toLocaleLowerCase());if(n>=0){const i=n+e.length,s=bt(t.slice(0,n),!0),r=bt(t.slice(n,i),!0),o=bt(t.slice(i));this.renderValueWithoutRenderer(`${s}<span class="ag-rich-select-row-text-highlight">${r}</span>${o}`)}else i=!1}i||this.renderValueWithoutRenderer(t)}updateHighlighted(e){var t;const i=this.getGui(),n=`ag-rich-select-row-${this.getCompId()}`;null==(t=i.parentElement)||t.setAttribute("id",n),e&&(ti(this.getParentComponent().getAriaElement(),n),this.wrapperEl.setAttribute("data-active-option",n)),gi(i.parentElement,e),this.addOrRemoveCssClass("ag-rich-select-row-selected",e)}populateWithoutRenderer(e,t){const i=this.gos.getDocument(),n=this.getGui(),s=i.createElement("span");s.style.overflow="hidden",s.style.textOverflow="ellipsis";const r=bt(b(t)?t:e,!0);this.parsedValue=b(r)?r:null,n.appendChild(s),this.renderValueWithoutRenderer(r),this.setTooltip({newTooltipText:this.parsedValue,shouldDisplayTooltip:()=>s.scrollWidth>s.clientWidth})}renderValueWithoutRenderer(e){const t=this.getGui().querySelector("span");t&&(t.innerHTML=b(e)?e:"&nbsp;")}populateWithRenderer(e,t){let i,n;return this.params.cellRenderer&&(n=this.userComponentFactory.getCellRendererDetails(this.params,{value:e,valueFormatted:t,setTooltip:(e,t)=>{this.setTooltip({newTooltipText:e,shouldDisplayTooltip:t})}})),n&&(i=n.newAgStackInstance()),i&&Hn(i,this.getGui()),!!i&&(i.then(e=>{this.addDestroyFunc(()=>{this.getContext().destroyBean(e)})}),!0)}onClick(){const e=this.getParentComponent(),t={type:ct.EVENT_FIELD_PICKER_VALUE_SELECTED,fromEnterKey:!1,value:this.value};null==e||e.dispatchEvent(t)}};f([ue("userComponentFactory")],Pl.prototype,"userComponentFactory",2),f([le],Pl.prototype,"postConstruct",1);var _l=class e extends ul{constructor(t){super(e.getTemplate((null==t?void 0:t.cssIdentifier)||"default")),this.renderedRows=new Map,this.rowHeight=20,this.pageSize=-1,this.isScrolling=!1,this.isHeightFromTheme=!0;const{cssIdentifier:i="default",ariaRole:n="listbox",listName:s}=t||{};this.cssIdentifier=i,this.ariaRole=n,this.listName=s}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,ct.EVENT_GRID_STYLES_CHANGED,this.onGridStylesChanged.bind(this))}onGridStylesChanged(){this.rowHeight=this.getItemHeight(),this.refresh()}setAriaProperties(){const e=this.localeService.getLocaleTextFunc()("ariaDefaultListName",this.listName||"List"),t=this.eContainer;Ht(t,this.ariaRole),$t(t,e)}addResizeObserver(){const e=this.resizeObserverService.observeResize(this.getGui(),()=>this.animationFrameService.requestAnimationFrame(()=>this.drawVirtualRows()));this.addDestroyFunc(e)}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=Wt(t)-1)}onFocusOut(e){this.getFocusableElement().contains(e.relatedTarget)||(this.lastFocusedRowIndex=null)}handleKeyDown(e){switch(e.key){case Zn.UP:case Zn.DOWN:this.navigate(e.key===Zn.UP)&&e.preventDefault();break;case Zn.PAGE_HOME:case Zn.PAGE_END:case Zn.PAGE_UP:case Zn.PAGE_DOWN:null!==this.navigateToPage(e.key)&&e.preventDefault()}}onTabKeyDown(e){this.navigate(e.shiftKey)?e.preventDefault():(qe(e),this.forceFocusOutOfContainer(e.shiftKey))}navigate(e){if(null==this.lastFocusedRowIndex)return!1;const t=this.lastFocusedRowIndex+(e?-1:1);return!(t<0||t>=this.model.getRowCount()||(this.focusRow(t),0))}navigateToPage(e,t="focused"){let i=!1;"focused"===t&&(t=this.getLastFocusedRow(),i=!0);const n=this.model.getRowCount()-1;let s=-1;return e===Zn.PAGE_HOME?s=0:e===Zn.PAGE_END?s=n:e===Zn.PAGE_DOWN?s=Math.min(t+this.pageSize,n):e===Zn.PAGE_UP&&(s=Math.max(t-this.pageSize,0)),-1===s?null:(i?this.focusRow(s):this.ensureIndexVisible(s),s)}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,i)=>e(t.rowComponent,i))}static getTemplate(e){return`<div class="ag-virtual-list-viewport ag-${e}-virtual-list-viewport" role="presentation">\n                <div class="ag-virtual-list-container ag-${e}-virtual-list-container" ref="eContainer"></div>\n            </div>`}getItemHeight(){return this.isHeightFromTheme?this.environment.getListItemHeight():this.rowHeight}ensureIndexVisible(e,t=!0){const i=this.model.getRowCount();if("number"!=typeof e||e<0||e>=i)return console.warn("AG Grid: invalid row index for ensureIndexVisible: "+e),!1;const n=e*this.rowHeight,s=n+this.rowHeight,r=this.getGui(),o=r.scrollTop,a=r.offsetHeight,l=o+a,c=t?0:this.rowHeight,h=l<s-c;if(o>n+c)return r.scrollTop=n,!0;if(h){const e=s-a;return r.scrollTop=e,!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(null==this.model||!this.isAlive())return;const t=this.model.getRowCount();this.eContainer.style.height=t*this.rowHeight+"px",ee(()=>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&&"function"==typeof this.model.areRowsEqual&&this.componentUpdater)}clearVirtualRows(){this.renderedRows.forEach((e,t)=>this.removeRow(t))}drawVirtualRows(e){if(!this.isAlive()||!this.model)return;const t=this.getGui(),i=t.scrollTop,n=i+t.offsetHeight,s=Math.floor(i/this.rowHeight),r=Math.floor(n/this.rowHeight);this.pageSize=Math.floor((n-i)/this.rowHeight),this.ensureRowsRendered(s,r,e)}ensureRowsRendered(e,t,i){this.renderedRows.forEach((i,n)=>{(n<e||n>t)&&n!==this.lastFocusedRowIndex&&this.removeRow(n)}),i&&this.refreshRows();for(let i=e;i<=t;i++)this.renderedRows.has(i)||i<this.model.getRowCount()&&this.insertRow(i)}insertRow(e){const t=this.model.getRow(e),i=document.createElement("div");i.classList.add("ag-virtual-list-item",`ag-${this.cssIdentifier}-virtual-list-item`),Ht(i,"tree"===this.ariaRole?"treeitem":"option"),si(i,this.model.getRowCount()),ri(i,e+1),i.setAttribute("tabindex","-1"),i.style.height=`${this.rowHeight}px`,i.style.top=this.rowHeight*e+"px";const n=this.componentCreator(t,i);n.addGuiEventListener("focusin",()=>this.lastFocusedRowIndex=e),i.appendChild(n.getGui()),this.renderedRows.has(e-1)?this.renderedRows.get(e-1).eDiv.insertAdjacentElement("afterend",i):this.renderedRows.has(e+1)?this.renderedRows.get(e+1).eDiv.insertAdjacentElement("beforebegin",i):this.eContainer.appendChild(i),this.renderedRows.set(e,{rowComponent:n,eDiv:i,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,i)=>{var n,s;if(i>=e)this.removeRow(i);else{const e=this.model.getRow(i);(null==(s=(n=this.model).areRowsEqual)?void 0:s.call(n,t.value,e))?this.componentUpdater(e,t.rowComponent):this.removeRow(i)}})}addScrollListener(){this.addGuiEventListener("scroll",()=>this.drawVirtualRows(),{passive:!0})}setModel(e){this.model=e}getAriaElement(){return this.eContainer}destroy(){this.isAlive()&&(this.clearVirtualRows(),super.destroy())}};f([ue("resizeObserverService")],_l.prototype,"resizeObserverService",2),f([ue("animationFrameService")],_l.prototype,"animationFrameService",2),f([bs("eContainer")],_l.prototype,"eContainer",2),f([le],_l.prototype,"postConstruct",1);var Ll=_l,Nl=class extends Ls{constructor(e){var t,i;super(p(d({pickerAriaLabelKey:"ariaLabelRichSelectField",pickerAriaLabelValue:"Rich Select Field",pickerType:"ag-list",className:"ag-rich-select",pickerIcon:"smallDown",ariaRole:"combobox",template:null!=(t=null==e?void 0:e.template)?t:'\n    <div class="ag-picker-field" role="presentation">\n        <div ref="eLabel"></div>\n            <div ref="eWrapper" class="ag-wrapper ag-picker-field-wrapper ag-rich-select-value ag-picker-collapsed">\n            <div ref="eDisplayField" class="ag-picker-field-display"></div>\n            <ag-input-text-field ref="eInput" class="ag-rich-select-field-input"></ag-input-text-field>\n            <div ref="eIcon" class="ag-picker-field-icon" aria-hidden="true"></div>\n        </div>\n    </div>',modalPicker:!1},e),{maxPickerHeight:null!=(i=null==e?void 0:e.maxPickerHeight)?i:"calc(var(--ag-row-height) * 6.5)"})),this.searchString="",this.highlightedItem=-1,this.lastRowHovered=-1,this.searchStringCreator=null;const{cellRowHeight:n,value:s,valueList:r,searchStringCreator:o}=e||{};null!=n&&(this.cellRowHeight=n),void 0!==s&&(this.value=s),null!=r&&(this.values=r),o&&(this.searchStringCreator=o)}postConstruct(){super.postConstruct(),this.createLoadingElement(),this.createListComponent();const{allowTyping:e,placeholder:t}=this.config;e?(this.eInput.setAutoComplete(!1).setInputPlaceholder(t),this.eDisplayField.classList.add("ag-hidden")):this.eInput.setDisplayed(!1),this.eWrapper.tabIndex=this.gos.get("tabIndex");const{searchDebounceDelay:i=300}=this.config;this.clearSearchString=Q(this.clearSearchString,i),this.renderSelectedValue(),e&&(this.eInput.onValueChange(e=>this.searchTextFromString(e)),this.addManagedListener(this.eWrapper,"focus",this.onWrapperFocus.bind(this))),this.addManagedListener(this.eWrapper,"focusout",this.onWrapperFocusOut.bind(this))}createLoadingElement(){const e=this.gos.getDocument(),t=this.localeService.getLocaleTextFunc(),i=e.createElement("div");i.classList.add("ag-loading-text"),i.innerText=t("loadingOoo","Loading..."),this.eLoading=i}createListComponent(){this.listComponent=this.createBean(new Ll({cssIdentifier:"rich-select"})),this.listComponent.setComponentCreator(this.createRowComponent.bind(this)),this.listComponent.setComponentUpdater((e,t)=>{}),this.listComponent.setParentComponent(this),this.addManagedListener(this.listComponent,ct.EVENT_FIELD_PICKER_VALUE_SELECTED,e=>{this.onListValueSelected(e.value,e.fromEnterKey)});const{cellRowHeight:e}=this;e&&this.listComponent.setRowHeight(e);const t=this.listComponent.getGui(),i=this.listComponent.getAriaElement();this.addManagedListener(t,"mousemove",this.onPickerMouseMove.bind(this)),this.addManagedListener(t,"mousedown",e=>e.preventDefault()),t.classList.add("ag-rich-select-list");const n=`ag-rich-select-list-${this.listComponent.getCompId()}`;i.setAttribute("id",n),$t(i,this.localeService.getLocaleTextFunc()(this.config.pickerAriaLabelKey,this.config.pickerAriaLabelValue)),mi(this.eWrapper,i)}renderSelectedValue(){const{value:e,eDisplayField:t,config:i}=this,{allowTyping:n,initialInputValue:s}=this.config,r=this.config.valueFormatter?this.config.valueFormatter(e):e;if(n)return void this.eInput.setValue(null!=s?s:r);let o,a;if(i.cellRenderer&&(o=this.userComponentFactory.getCellRendererDetails(this.config,{value:e,valueFormatted:r})),o&&(a=o.newAgStackInstance()),a)Cn(t),Hn(a,t),a.then(e=>{this.addDestroyFunc(()=>this.getContext().destroyBean(e))});else{if(b(this.value))t.innerText=r,t.classList.remove("ag-display-as-placeholder");else{const{placeholder:e}=i;b(e)?(t.innerHTML=`${bt(e)}`,t.classList.add("ag-display-as-placeholder")):Cn(t)}this.setTooltip({newTooltipText:null!=r?r:null,shouldDisplayTooltip:()=>this.eDisplayField.scrollWidth>this.eDisplayField.clientWidth})}}getCurrentValueIndex(){const{currentList:e,value:t}=this;if(null==t||!e)return-1;for(let i=0;i<e.length;i++)if(e[i]===t)return i;return-1}highlightFilterMatch(){var e;null==(e=this.listComponent)||e.forEachRenderedRow((e,t)=>{e.highlightString(this.searchString)})}highlightSelectedValue(e){var t;null==e&&(e=this.getCurrentValueIndex()),this.highlightedItem=e,null==(t=this.listComponent)||t.forEachRenderedRow((t,i)=>{const n=-1!==e&&this.highlightedItem===i;t.updateHighlighted(n)})}setRowHeight(e){e!==this.cellRowHeight&&(this.cellRowHeight=e),this.listComponent&&this.listComponent.setRowHeight(e)}createPickerComponent(){const{values:e}=this;return e&&this.setValueList({valueList:e}),this.listComponent}setSearchStringCreator(e){this.searchStringCreator=e}setValueList(e){const{valueList:t,refresh:i}=e;this.listComponent&&this.currentList!==t&&(this.currentList=t,this.listComponent.setModel({getRowCount:()=>t.length,getRow:e=>t[e],areRowsEqual:(e,t)=>e===t}),i&&(this.values?this.listComponent.refresh(!0):(this.values=t,this.isPickerDisplayed&&this.showCurrentValueInPicker())))}showPicker(){super.showPicker(),this.showCurrentValueInPicker(),this.displayOrHidePicker()}showCurrentValueInPicker(){var e,t;if(!this.listComponent)return;if(!this.currentList)return void(this.isPickerDisplayed&&this.eLoading&&this.listComponent.appendChild(this.eLoading));(null==(e=this.eLoading)?void 0:e.offsetParent)&&(null==(t=this.eLoading.parentElement)||t.removeChild(this.eLoading));const i=this.getCurrentValueIndex();-1!==i?(this.listComponent.refresh(),this.listComponent.ensureIndexVisible(i),this.listComponent.refresh(!0),this.highlightSelectedValue(i)):this.listComponent.refresh()}beforeHidePicker(){this.highlightedItem=-1,super.beforeHidePicker()}onWrapperFocus(){if(!this.eInput)return;const e=this.eInput.getFocusableElement();e.focus(),e.select()}onWrapperFocusOut(e){this.eWrapper.contains(e.relatedTarget)||this.hidePicker()}buildSearchStringFromKeyboardEvent(e){let{key:t}=e;if(t===Zn.BACKSPACE)this.searchString=this.searchString.slice(0,-1),t="";else if(!Qn(e))return;e.preventDefault(),this.searchTextFromCharacter(t)}searchTextFromCharacter(e){this.searchString+=e,this.runSearch(),this.clearSearchString()}searchTextFromString(e){null==e&&(e=""),this.searchString=e,this.runSearch()}buildSearchStrings(e){const{valueFormatter:t=e=>e}=this.config;let i;return"number"==typeof e[0]||"string"==typeof e[0]?i=e.map(e=>t(e)):"object"==typeof e[0]&&this.searchStringCreator&&(i=this.searchStringCreator(e)),i}getSuggestionsAndFilteredValues(e,t){let i=[],n=[];if(!e.length)return{suggestions:i,filteredValues:n};const{searchType:s="fuzzy",filterList:r}=this.config;if("fuzzy"===s){const e=Wn(this.searchString,t,!0);i=e.values;const s=e.indices;if(r&&s.length)for(let e=0;e<s.length;e++)n.push(this.values[s[e]])}else i=t.filter((e,t)=>{const i=e.toLocaleLowerCase(),o=this.searchString.toLocaleLowerCase(),a="match"===s?i.startsWith(o):-1!==i.indexOf(o);return r&&a&&n.push(this.values[t]),a});return{suggestions:i,filteredValues:n}}filterListModel(e){const{filterList:t}=this.config;t&&(this.setValueList({valueList:e,refresh:!0}),this.alignPickerToComponent())}runSearch(){var e,t;const{values:i}=this,n=this.buildSearchStrings(i);if(!n)return void this.highlightSelectedValue(-1);const{suggestions:s,filteredValues:r}=this.getSuggestionsAndFilteredValues(this.searchString,n),{filterList:o,highlightMatch:a,searchType:l="fuzzy"}=this.config,c=r.length,h=!(!o||""===this.searchString);if(this.filterListModel(h?r:i),s.length){const e=h?0:n.indexOf(s[0]);this.selectListItem(e)}else if(this.highlightSelectedValue(-1),!h||c)null==(e=this.listComponent)||e.ensureIndexVisible(0);else if(h){this.getAriaElement().removeAttribute("data-active-option");const e=null==(t=this.listComponent)?void 0:t.getAriaElement();e&&ti(e,null)}a&&"fuzzy"!==l&&this.highlightFilterMatch(),this.displayOrHidePicker()}displayOrHidePicker(){var e;const t=null==(e=this.listComponent)?void 0:e.getGui(),i=!!this.currentList&&0===this.currentList.length;null==t||t.classList.toggle("ag-hidden",i)}clearSearchString(){this.searchString=""}selectListItem(e,t){!this.isPickerDisplayed||!this.currentList||!this.listComponent||e<0||e>=this.currentList.length||(this.listComponent.ensureIndexVisible(e,!t)&&!t&&this.listComponent.refresh(!0),this.highlightSelectedValue(e))}setValue(e,t,i){const n=this.currentList?this.currentList.indexOf(e):-1;return-1===n?this:(this.value=e,i||this.selectListItem(n),this.renderSelectedValue(),super.setValue(e,t))}createRowComponent(e){const t=new Pl(this.config,this.eWrapper);t.setParentComponent(this.listComponent),this.getContext().createBean(t),t.setState(e);const{highlightMatch:i,searchType:n="fuzzy"}=this.config;return i&&"fuzzy"!==n&&t.highlightString(this.searchString),t}getRowForMouseEvent(e){const{listComponent:t}=this;if(!t)return-1;const i=(null==t?void 0:t.getGui()).getBoundingClientRect(),n=t.getScrollTop(),s=e.clientY-i.top+n;return Math.floor(s/t.getRowHeight())}onPickerMouseMove(e){if(!this.listComponent)return;const t=this.getRowForMouseEvent(e);-1!==t&&t!=this.lastRowHovered&&(this.lastRowHovered=t,this.selectListItem(t,!0))}onNavigationKeyDown(e,t){e.preventDefault();const i=t===Zn.DOWN;if(!this.isPickerDisplayed&&i)return void this.showPicker();const n=this.highlightedItem,s=-1===n?0:n+(i?1:-1);this.selectListItem(s)}onPageNavigation(e){var t;if(!this.isPickerDisplayed)return;const i=null==(t=this.listComponent)?void 0:t.navigateToPage(e,this.highlightedItem);null!=i&&this.animationFrameService.requestAnimationFrame(()=>{if(!this.isAlive())return null;this.highlightSelectedValue(i)})}onEnterKeyDown(e){this.isPickerDisplayed&&(e.preventDefault(),this.currentList&&this.onListValueSelected(this.currentList[this.highlightedItem],!0))}onTabKeyDown(){this.isPickerDisplayed&&this.currentList&&this.setValue(this.currentList[this.highlightedItem],!1,!0)}onListValueSelected(e,t){this.setValue(e,!1,!0),this.dispatchPickerEvent(e,t),this.hidePicker()}dispatchPickerEvent(e,t){const i={type:ct.EVENT_FIELD_PICKER_VALUE_SELECTED,fromEnterKey:t,value:e};this.dispatchEvent(i)}getFocusableElement(){const{allowTyping:e}=this.config;return e?this.eInput.getFocusableElement():super.getFocusableElement()}onKeyDown(e){const t=e.key,{allowTyping:i}=this.config;switch(t){case Zn.LEFT:case Zn.RIGHT:i||e.preventDefault();break;case Zn.PAGE_HOME:case Zn.PAGE_END:if(i){e.preventDefault();const i=this.eInput.getInputElement(),n=t===Zn.PAGE_HOME?0:i.value.length;i.setSelectionRange(n,n);break}case Zn.PAGE_UP:case Zn.PAGE_DOWN:e.preventDefault(),this.onPageNavigation(t);break;case Zn.DOWN:case Zn.UP:this.onNavigationKeyDown(e,t);break;case Zn.ESCAPE:this.isPickerDisplayed&&(xn(this.listComponent.getGui())&&(e.preventDefault(),qe(e)),this.hidePicker());break;case Zn.ENTER:this.onEnterKeyDown(e);break;case Zn.TAB:this.onTabKeyDown();break;default:i||this.buildSearchStringFromKeyboardEvent(e)}}destroy(){this.listComponent&&(this.destroyBean(this.listComponent),this.listComponent=void 0),this.eLoading=void 0,super.destroy()}};f([ue("userComponentFactory")],Nl.prototype,"userComponentFactory",2),f([ue("animationFrameService")],Nl.prototype,"animationFrameService",2),f([bs("eInput")],Nl.prototype,"eInput",2);var Ol=class e extends Ps{constructor(t){super(t,e.TEMPLATE),this.labelAlignment="top"}init(){this.eSlider.addCssClass("ag-slider-field");const{minValue:e,maxValue:t,textFieldWidth:i,step:n,value:s,onValueChange:r}=this.config;null!=e&&this.setMinValue(e),null!=t&&this.setMaxValue(t),null!=i&&this.setTextFieldWidth(i),null!=n&&this.setStep(n),null!=s&&this.setValue(s),null!=r&&this.onValueChange(r)}onValueChange(e){const t=ct.EVENT_FIELD_VALUE_CHANGED;return this.addManagedListener(this.eText,t,()=>{const t=parseFloat(this.eText.getValue());this.eSlider.setValue(t.toString(),!0),e(t||0)}),this.addManagedListener(this.eSlider,t,()=>{const t=this.eSlider.getValue();this.eText.setValue(t,!0),e(parseFloat(t))}),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.eText.setValue(e,!0),this.eSlider.setValue(e,!0),t||this.dispatchEvent({type:ct.EVENT_FIELD_VALUE_CHANGED})),this}setStep(e){return this.eSlider.setStep(e),this.eText.setStep(e),this}};Ol.TEMPLATE='<div class="ag-slider">\n            <label ref="eLabel"></label>\n            <div class="ag-wrapper ag-slider-wrapper">\n                <ag-input-range ref="eSlider"></ag-input-range>\n                <ag-input-number-field ref="eText"></ag-input-number-field>\n            </div>\n        </div>',f([bs("eLabel")],Ol.prototype,"eLabel",2),f([bs("eSlider")],Ol.prototype,"eSlider",2),f([bs("eText")],Ol.prototype,"eText",2),f([le],Ol.prototype,"init",1);var Fl=Ol,Gl=class e extends vs{constructor(t={}){super(e.getTemplate(t)),this.params=t,this.suppressEnabledCheckbox=!0,this.suppressToggleExpandOnEnableChange=!1;const{enabled:i,items:n,suppressEnabledCheckbox:s,expanded:r,suppressToggleExpandOnEnableChange:o,useToggle:a}=t;this.cssIdentifier=t.cssIdentifier||"default",this.enabled=null==i||i,this.items=n||[],this.useToggle=null!=a&&a,this.alignItems=t.alignItems||"center",this.expanded=null==r||r,null!=s&&(this.suppressEnabledCheckbox=s),null!=o&&(this.suppressToggleExpandOnEnableChange=o)}static getTemplate(e){const t=e.cssIdentifier||"default";return`\n            <div class="ag-group ag-${t}-group" role="presentation">\n                <div ref="eToolbar" class="ag-group-toolbar ag-${t}-group-toolbar">\n                    <ag-checkbox ref="cbGroupEnabled"></ag-checkbox>\n                </div>\n                <div ref="eContainer" class="ag-group-container ag-group-container-${e.direction||"vertical"} ag-${t}-group-container"></div>\n            </div>\n        `}postConstruct(){if(this.setupTitleBar(),this.items.length){const e=this.items;this.items=[],this.addItems(e)}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:i}=this.params;this.hideEnabledCheckbox(this.suppressEnabledCheckbox),this.hideOpenCloseIcons(null!=i&&i),this.refreshChildDisplay(),an(this.eContainer,this.expanded),this.cbGroupEnabled.onValueChange(e=>{this.setEnabled(e,!0,this.suppressToggleExpandOnEnableChange),this.dispatchEnableChangeEvent(e)}),null!=t&&this.onEnableChange(t)}refreshChildDisplay(){var e;an(this.eToolbar,this.expanded&&!this.suppressEnabledCheckbox),null==(e=this.eTitleBar)||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(t){var i;let n=!1;if((null==(i=this.eTitleBar)?void 0:i.isSuppressCollapse())&&!this.useToggle)t=!0,n=!0;else if(t=null!=t?t:!this.expanded,this.expanded===t)return this;return this.expanded=t,this.refreshChildDisplay(),an(this.eContainer,t),n||this.dispatchEvent({type:t?e.EVENT_EXPANDED:e.EVENT_COLLAPSED}),this}addItems(e){e.forEach(e=>this.addItem(e))}prependItem(e){this.insertItem(e,!0)}addItem(e){this.insertItem(e,!1)}insertItem(e,t){const i=this.eContainer,n=e instanceof vs?e.getGui():e;n.classList.add("ag-group-item",`ag-${this.cssIdentifier}-group-item`),t?(i.insertAdjacentElement("afterbegin",n),this.items.unshift(n)):(i.appendChild(n),this.items.push(n))}hideItem(e,t){an(this.items[t],!e)}getItemIndex(e){const t=e instanceof vs?e.getGui():e;return this.items.indexOf(t)}setTitle(e){var t;return null==(t=this.eTitleBar)||t.setTitle(e),this}addTitleBarWidget(e){var t;return null==(t=this.eTitleBar)||t.addWidget(e),this}addCssClassToTitleBar(e){var t;null==(t=this.eTitleBar)||t.addCssClass(e)}dispatchEnableChangeEvent(t){const i={type:e.EVENT_ENABLE_CHANGE,enabled:t};this.dispatchEvent(i)}setEnabled(e,t,i){var n;return this.enabled=e,this.refreshDisabledStyles(),i||this.toggleGroupExpand(e),t||(this.cbGroupEnabled.setValue(e),null==(n=this.eToggle)||n.setValue(e)),this}isEnabled(){return this.enabled}onEnableChange(t){return this.addManagedListener(this,e.EVENT_ENABLE_CHANGE,e=>t(e.enabled)),this}hideEnabledCheckbox(e){return this.suppressEnabledCheckbox=e,this.refreshChildDisplay(),this.refreshDisabledStyles(),this}hideOpenCloseIcons(e){var t;return null==(t=this.eTitleBar)||t.hideOpenCloseIcons(e),this}refreshDisabledStyles(){var e;const t=!this.enabled;this.eContainer.classList.toggle("ag-disabled",t),null==(e=this.eTitleBar)||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 Ul(this.params));return this.eTitleBar=e,e.refreshOnExpand(this.expanded),this.addManagedListener(e,Ul.EVENT_EXPAND_CHANGED,e=>this.toggleGroupExpand(e.expanded)),e}createToggleTitleBar(){var e;const t=this.createManagedBean(new Dl({value:this.enabled,label:this.params.title,labelAlignment:"left",labelWidth:"flex",onValueChange:e=>{this.setEnabled(e,!0),this.dispatchEnableChangeEvent(e)}}));return t.addCssClass("ag-group-title-bar"),t.addCssClass(`ag-${null!=(e=this.params.cssIdentifier)?e:"default"}-group-title-bar ag-unselectable`),this.eToggle=t,this.toggleGroupExpand(this.enabled),t}};Gl.EVENT_EXPANDED="expanded",Gl.EVENT_COLLAPSED="collapsed",Gl.EVENT_ENABLE_CHANGE="enableChange",f([bs("eToolbar")],Gl.prototype,"eToolbar",2),f([bs("cbGroupEnabled")],Gl.prototype,"cbGroupEnabled",2),f([bs("eContainer")],Gl.prototype,"eContainer",2),f([le],Gl.prototype,"postConstruct",1);var Bl=Gl,Vl="ag-disabled-group-title-bar",Hl=class e extends vs{constructor(t={}){super(e.getTemplate(t)),this.suppressOpenCloseIcons=!1;const{title:i,suppressOpenCloseIcons:n}=t;i&&i.length>0&&(this.title=i),null!=n&&(this.suppressOpenCloseIcons=n)}static getTemplate(e){var t;const i=null!=(t=e.cssIdentifier)?t:"default";return`\n            <div class="ag-group-title-bar ag-${i}-group-title-bar ag-unselectable" role="button">\n                <span class="ag-group-title-bar-icon ag-${i}-group-title-bar-icon" ref="eGroupOpenedIcon" role="presentation"></span>\n                <span class="ag-group-title-bar-icon ag-${i}-group-title-bar-icon" ref="eGroupClosedIcon" role="presentation"></span>\n                <span ref="eTitle" class="ag-group-title ag-${i}-group-title"></span>\n            </div>\n        `}postConstruct(){this.setTitle(this.title),this.hideOpenCloseIcons(this.suppressOpenCloseIcons),this.setupExpandContract()}setupExpandContract(){this.eGroupClosedIcon.appendChild(Yn("columnSelectClosed",this.gos,null)),this.eGroupOpenedIcon.appendChild(Yn("columnSelectOpen",this.gos,null)),this.addManagedListener(this.getGui(),"click",()=>this.dispatchExpandChanged()),this.addManagedListener(this.getGui(),"keydown",e=>{switch(e.key){case Zn.ENTER:case Zn.SPACE:e.preventDefault(),this.dispatchExpandChanged();break;case Zn.RIGHT:case Zn.LEFT:e.preventDefault(),this.dispatchExpandChanged(e.key===Zn.RIGHT)}})}refreshOnExpand(e){this.refreshAriaStatus(e),this.refreshOpenCloseIcons(e)}refreshAriaStatus(e){this.suppressOpenCloseIcons||ii(this.getGui(),e)}refreshOpenCloseIcons(e){const t=!this.suppressOpenCloseIcons;an(this.eGroupOpenedIcon,t&&e),an(this.eGroupClosedIcon,t&&!e)}isSuppressCollapse(){return this.suppressOpenCloseIcons}dispatchExpandChanged(t){const i={type:e.EVENT_EXPAND_CHANGED,expanded:t};this.dispatchEvent(i)}setTitle(e){const t=this.getGui(),i=!!e&&e.length>0;e=i?e:void 0,this.eTitle.textContent=null!=e?e:"",an(t,i),e!==this.title&&(this.title=e);const n=t.classList.contains(Vl);return this.refreshDisabledStyles(n),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(Vl),t.removeAttribute("tabindex")):(t.classList.remove(Vl),"string"==typeof this.title?t.setAttribute("tabindex","0"):t.removeAttribute("tabindex"))}};Hl.EVENT_EXPAND_CHANGED="expandedChanged",f([bs("eGroupOpenedIcon")],Hl.prototype,"eGroupOpenedIcon",2),f([bs("eGroupClosedIcon")],Hl.prototype,"eGroupClosedIcon",2),f([bs("eTitle")],Hl.prototype,"eTitle",2),f([le],Hl.prototype,"postConstruct",1);var Ul=Hl,zl=class extends ul{constructor(e=0,t){super('<div class="ag-menu-list" role="tree"></div>'),this.level=e,this.menuItems=[],this.params=null!=t?t:{column:null,node:null,value:null}}postConstruct(){this.initialiseTabGuard({onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e),onFocusIn:e=>this.handleFocusIn(e),onFocusOut:e=>this.handleFocusOut(e)})}onTabKeyDown(e){const t=this.getParentComponent(),i=t&&t.getGui();i&&i.classList.contains("ag-focus-managed")||e.preventDefault(),e.shiftKey&&this.closeIfIsChild(e)}handleKeyDown(e){switch(e.key){case Zn.UP:case Zn.RIGHT:case Zn.DOWN:case Zn.LEFT:e.preventDefault(),this.handleNavKey(e.key);break;case Zn.ESCAPE:this.closeIfIsChild()&&qe(e)}}handleFocusIn(e){var t,i;const n=e.relatedTarget;(this.tabGuardCtrl.isTabGuard(n)||!this.getGui().contains(n)&&!(null==(i=null==(t=this.activeMenuItem)?void 0:t.getSubMenuGui())?void 0:i.contains(n)))&&(this.activeMenuItem?this.activeMenuItem.activate():this.activateFirstItem())}handleFocusOut(e){var t;const i=e.relatedTarget;!this.activeMenuItem||this.getGui().contains(i)||(null==(t=this.activeMenuItem.getSubMenuGui())?void 0:t.contains(i))||this.activeMenuItem.isSubMenuOpening()||this.activeMenuItem.deactivate()}clearActiveItem(){this.activeMenuItem&&(this.activeMenuItem.deactivate(),this.activeMenuItem=null)}addMenuItems(e){null!=e&&us.all(e.map(e=>"separator"===e?us.resolve({eGui:this.createSeparator()}):"string"==typeof e?(console.warn(`AG Grid: unrecognised menu item ${e}`),us.resolve({eGui:null})):this.addItem(e))).then(e=>{e.forEach(e=>{(null==e?void 0:e.eGui)&&(this.appendChild(e.eGui),e.comp&&this.menuItems.push(e.comp))})})}addItem(e){const t=this.createManagedBean(new $l);return t.init({menuItemDef:e,isAnotherSubMenuOpen:()=>this.menuItems.some(e=>e.isSubMenuOpen()),level:this.level,contextParams:this.params}).then(()=>(t.setParentComponent(this),this.addManagedListener(t,$l.EVENT_CLOSE_MENU,e=>{this.dispatchEvent(e)}),this.addManagedListener(t,$l.EVENT_MENU_ITEM_ACTIVATED,e=>{this.activeMenuItem&&this.activeMenuItem!==e.menuItem&&this.activeMenuItem.deactivate(),this.activeMenuItem=e.menuItem}),{comp:t,eGui:t.getGui()}))}activateFirstItem(){const e=this.menuItems.filter(e=>!e.isDisabled())[0];e&&e.activate()}createSeparator(){return En('\n            <div class="ag-menu-separator" aria-hidden="true">\n                <div class="ag-menu-separator-part"></div>\n                <div class="ag-menu-separator-part"></div>\n                <div class="ag-menu-separator-part"></div>\n                <div class="ag-menu-separator-part"></div>\n            </div>')}handleNavKey(e){switch(e){case Zn.UP:case Zn.DOWN:const t=this.findNextItem(e===Zn.UP);return void(t&&t!==this.activeMenuItem&&t.activate())}e===(this.gos.get("enableRtl")?Zn.RIGHT:Zn.LEFT)?this.closeIfIsChild():this.openChild()}closeIfIsChild(e){const t=this.getParentComponent();return!!(t&&t instanceof $l)&&(e&&e.preventDefault(),t.closeSubMenu(),t.getGui().focus(),!0)}openChild(){this.activeMenuItem&&this.activeMenuItem.openSubMenu(!0)}findNextItem(e){const t=this.menuItems.filter(e=>!e.isDisabled());if(!t.length)return;if(!this.activeMenuItem)return e?Ie(t):t[0];let i;e&&t.reverse();let n=!1;for(let e=0;e<t.length;e++){const s=t[e];if(n){i=s;break}s===this.activeMenuItem&&(n=!0)}return n&&!i?t[0]:i||this.activeMenuItem}destroy(){this.clearActiveItem(),super.destroy()}};f([ue("focusService")],zl.prototype,"focusService",2),f([le],zl.prototype,"postConstruct",1);var Wl=class extends ul{constructor(e){super(),this.wrappedComponent=e,this.setTemplateFromElement(e.getGui())}postConstruct(){this.initialiseTabGuard({onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e)})}handleKeyDown(e){e.key===Zn.ESCAPE&&this.closePanel()}onTabKeyDown(e){e.defaultPrevented||(this.closePanel(),e.preventDefault())}closePanel(){const e=this.parentComponent;e.closeSubMenu(),setTimeout(()=>e.getGui().focus(),0)}};f([le],Wl.prototype,"postConstruct",1);var jl=class e extends st{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,i;const{menuItemDef:n,isAnotherSubMenuOpen:s,level:r,childComponent:o,contextParams:a}=e;return this.params=e.menuItemDef,this.level=r,this.isAnotherSubMenuOpen=s,this.childComponent=o,this.contextParams=a,this.cssClassPrefix=null!=(i=null==(t=this.params.menuItemParams)?void 0:t.cssClassPrefix)?i:"ag-menu-option",this.userComponentFactory.getMenuItemCompDetails(this.params,p(d({},n),{level:r,isAnotherSubMenuOpen:s,openSubMenu:e=>this.openSubMenu(e),closeSubMenu:()=>this.closeSubMenu(),closeMenu:e=>this.closeMenu(e),updateTooltip:(e,t)=>this.refreshTooltip(e,t),onItemActivated:()=>this.onItemActivated()})).newAgStackInstance().then(e=>{var t;this.menuItemComp=e;const i=null==(t=e.configureDefaults)?void 0:t.call(e);i&&this.configureDefaults(!0===i?void 0:i)})}addListeners(e,t){(null==t?void 0:t.suppressClick)||this.addManagedListener(e,"click",e=>this.onItemSelected(e)),(null==t?void 0:t.suppressKeyboardSelect)||this.addManagedListener(e,"keydown",e=>{e.key!==Zn.ENTER&&e.key!==Zn.SPACE||(e.preventDefault(),this.onItemSelected(e))}),(null==t?void 0:t.suppressMouseDown)||this.addManagedListener(e,"mousedown",e=>{e.stopPropagation(),e.preventDefault()}),(null==t?void 0:t.suppressMouseOver)||(this.addManagedListener(e,"mouseenter",()=>this.onMouseEnter()),this.addManagedListener(e,"mouseleave",()=>this.onMouseLeave()))}isDisabled(){return!!this.params.disabled}openSubMenu(t=!1){var i,n;if(this.closeSubMenu(),!this.params.subMenu)return;this.subMenuIsOpening=!0;const s=En('<div class="ag-menu" role="presentation"></div>');let r;this.eSubMenuGui=s;let o=()=>{this.subMenuIsOpening=!1};if(this.childComponent){const e=this.createBean(new Wl(this.childComponent));e.setParentComponent(this);const t=e.getGui(),i="mouseenter",n=()=>this.cancelDeactivate();t.addEventListener(i,n),r=()=>t.removeEventListener(i,n),s.appendChild(t),this.childComponent.afterGuiAttached&&(o=()=>{this.childComponent.afterGuiAttached(),this.subMenuIsOpening=!1})}else if(this.params.subMenu){const i=this.createBean(new zl(this.level+1,this.contextParams));i.setParentComponent(this),i.addMenuItems(this.params.subMenu),s.appendChild(i.getGui()),this.addManagedListener(i,e.EVENT_CLOSE_MENU,e=>this.dispatchEvent(e)),i.addGuiEventListener("mouseenter",()=>this.cancelDeactivate()),r=()=>this.destroyBean(i),t&&(o=()=>{i.activateFirstItem(),this.subMenuIsOpening=!1})}const a=this.popupService.positionPopupForMenu.bind(this.popupService,{eventSource:this.eGui,ePopup:s}),l=this.localeService.getLocaleTextFunc(),c=this.popupService.addPopup({modal:!0,eChild:s,positionCallback:a,anchorToElement:this.eGui,ariaLabel:l("ariaLabelSubMenu","SubMenu"),afterGuiAttached:o});this.subMenuIsOpen=!0,this.setAriaExpanded(!0),this.hideSubMenu=()=>{var e,t;c&&c.hideFunc(),this.subMenuIsOpen=!1,this.setAriaExpanded(!1),r(),null==(t=(e=this.menuItemComp).setExpanded)||t.call(e,!1),this.eSubMenuGui=void 0},null==(n=(i=this.menuItemComp).setExpanded)||n.call(i,!0)}setAriaExpanded(e){this.suppressAria||ii(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,i;this.cancelActivate(),this.params.disabled||(this.isActive=!0,this.suppressRootStyles||this.eGui.classList.add(`${this.cssClassPrefix}-active`),null==(i=(t=this.menuItemComp).setActive)||i.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`),null==(t=(e=this.menuItemComp).setActive)||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,i;null==(i=(t=this.menuItemComp).select)||i.call(t),this.params.action?this.getFrameworkOverrides().wrapOutgoing(()=>this.params.action(this.gos.addGridCommonParams(d({},this.contextParams)))):this.openSubMenu(e&&"keydown"===e.type),this.params.subMenu&&!this.params.action||this.params.suppressCloseOnSelect||this.closeMenu(e)}closeMenu(t){const i={type:e.EVENT_CLOSE_MENU};t&&(t instanceof MouseEvent?i.mouseEvent=t:i.keyboardEvent=t),this.dispatchEvent(i)}onItemActivated(){const t={type:e.EVENT_MENU_ITEM_ACTIVATED,menuItem:this};this.dispatchEvent(t)}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),e.ACTIVATION_DELAY):this.activate(!0)}onMouseLeave(){this.cancelActivate(),this.isSubMenuOpen()?this.deactivateTimeoutId=window.setTimeout(()=>this.deactivate(),e.ACTIVATION_DELAY):this.deactivate()}configureDefaults(e){var t,i,n;if(!this.menuItemComp)return void setTimeout(()=>this.configureDefaults(e));let s=this.menuItemComp.getGui();const r=null==(i=(t=this.menuItemComp).getRootElement)?void 0:i.call(t);r&&((null==e?void 0:e.suppressRootStyles)||s.classList.add("ag-menu-option-custom"),s=r),this.eGui=s,this.suppressRootStyles=!!(null==e?void 0:e.suppressRootStyles),this.suppressRootStyles||(s.classList.add(this.cssClassPrefix),null==(n=this.params.cssClasses)||n.forEach(e=>s.classList.add(e)),this.params.disabled&&s.classList.add(`${this.cssClassPrefix}-disabled`)),(null==e?void 0:e.suppressTooltip)||this.refreshTooltip(this.params.tooltip),this.suppressAria=!!(null==e?void 0:e.suppressAria),this.suppressAria||(Ht(s,"treeitem"),Qt(s,this.level+1),this.params.disabled&&Jt(s,!0)),(null==e?void 0:e.suppressTabIndex)||s.setAttribute("tabindex","-1"),this.params.disabled||this.addListeners(s,e),this.suppressFocus=!!(null==e?void 0:e.suppressFocus)}refreshTooltip(e,t){this.tooltip=e,this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),e&&this.menuItemComp&&(this.tooltipFeature=this.createBean(new fs({getGui:()=>this.getGui(),getTooltipValue:()=>this.tooltip,getLocation:()=>"menu",shouldDisplayTooltip:t})))}destroy(){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),super.destroy()}};jl.EVENT_CLOSE_MENU="closeMenu",jl.EVENT_MENU_ITEM_ACTIVATED="menuItemActivated",jl.ACTIVATION_DELAY=80,f([ue("popupService")],jl.prototype,"popupService",2),f([ue("userComponentFactory")],jl.prototype,"userComponentFactory",2);var $l=jl,Kl=class e extends vs{constructor(t){super(e.getTemplate(t)),this.config=t,this.closable=!0}static getTemplate(e){const t=e.cssIdentifier||"default";return`<div class="ag-panel ag-${t}-panel" tabindex="-1">\n            <div ref="eTitleBar" class="ag-panel-title-bar ag-${t}-panel-title-bar ag-unselectable">\n                <span ref="eTitle" class="ag-panel-title-bar-title ag-${t}-panel-title-bar-title"></span>\n                <div ref="eTitleBarButtons" class="ag-panel-title-bar-buttons ag-${t}-panel-title-bar-buttons"></div>\n            </div>\n            <div ref="eContentWrapper" class="ag-panel-content-wrapper ag-${t}-panel-content-wrapper"></div>\n        </div>`}postConstruct(){const{component:e,closable:t,hideTitleBar:i,title:n,minWidth:s=250,width:r,minHeight:o=250,height:a,centered:l,popup:c,x:h,y:u}=this.config;this.positionableFeature=new Is(this.getGui(),{minWidth:s,width:r,minHeight:o,height:a,centered:l,x:h,y:u,popup:c,calculateTopBuffer:()=>this.positionableFeature.getHeight()-this.getBodyHeight()}),this.createManagedBean(this.positionableFeature);const d=this.getGui();e&&this.setBodyComponent(e),i?an(this.eTitleBar,!1):(n&&this.setTitle(n),this.setClosable(null!=t?t:this.closable)),this.addManagedListener(this.eTitleBar,"mousedown",e=>{if(d.contains(e.relatedTarget)||d.contains(this.gos.getActiveDomElement())||this.eTitleBarButtons.contains(e.target))return void e.preventDefault();const t=this.eContentWrapper.querySelector("button, [href], input, select, textarea, [tabindex]");t&&t.focus()}),c&&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(t){if(t!==this.closable&&(this.closable=t),t){const t=this.closeButtonComp=new vs(e.CLOSE_BTN_TEMPLATE);this.getContext().createBean(t);const i=t.getGui(),n=qn("close",this.gos);n.classList.add("ag-panel-title-bar-button-icon"),i.appendChild(n),this.addTitleBarButton(t),t.addManagedListener(i,"click",this.onBtClose.bind(this))}else if(this.closeButtonComp){const e=this.closeButtonComp.getGui();e.parentElement.removeChild(e),this.closeButtonComp=this.destroyBean(this.closeButtonComp)}}setBodyComponent(e){e.setParentComponent(this),this.eContentWrapper.appendChild(e.getGui())}addTitleBarButton(e,t){const i=this.eTitleBarButtons,n=i.children,s=n.length;null==t&&(t=s),t=Math.max(0,Math.min(t,s)),e.addCssClass("ag-panel-title-bar-button");const r=e.getGui();0===t?i.insertAdjacentElement("afterbegin",r):t===s?i.insertAdjacentElement("beforeend",r):n[t-1].insertAdjacentElement("afterend",r),e.setParentComponent(this)}getBodyHeight(){return dn(this.eContentWrapper)}getBodyWidth(){return pn(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&&xn(e)&&this.close(),super.destroy()}};Kl.CLOSE_BTN_TEMPLATE='<div class="ag-button"></div>',f([bs("eContentWrapper")],Kl.prototype,"eContentWrapper",2),f([bs("eTitleBar")],Kl.prototype,"eTitleBar",2),f([bs("eTitleBarButtons")],Kl.prototype,"eTitleBarButtons",2),f([bs("eTitle")],Kl.prototype,"eTitle",2),f([le],Kl.prototype,"postConstruct",1);var Yl=Kl;f([ue("popupService")],class extends Yl{constructor(e){super(p(d({},e),{popup:!0})),this.isMaximizable=!1,this.isMaximized=!1,this.maximizeListeners=[],this.resizeListenerDestroy=null,this.lastPosition={x:0,y:0,width:0,height:0}}postConstruct(){const e=this.getGui(),{movable:t,resizable:i,maximizable:n}=this.config;this.addCssClass("ag-dialog"),super.postConstruct(),this.addManagedListener(e,"focusin",t=>{this.popupService.bringPopupToFront(e)}),t&&this.setMovable(t),n&&this.setMaximizable(n),i&&this.setResizable(i)}renderComponent(){const e=this.getGui(),{alwaysOnTop:t,modal:i,title:n,afterGuiAttached:s}=this.config,r=this.localeService.getLocaleTextFunc(),o=this.popupService.addPopup({modal:i,eChild:e,closeOnEsc:!0,closedCallback:this.onClosed.bind(this),alwaysOnTop:t,ariaLabel:n||r("ariaLabelDialog","Dialog"),afterGuiAttached:s});o&&(this.close=o.hideFunc)}onClosed(e){var t,i;this.destroy(),null==(i=(t=this.config).closedCallback)||i.call(t,e)}toggleMaximize(){const e=this.positionableFeature.getPosition();if(this.isMaximized){const{x:e,y:t,width:i,height:n}=this.lastPosition;this.setWidth(i),this.setHeight(n),this.positionableFeature.offsetElement(e,t)}else this.lastPosition.width=this.getWidth(),this.lastPosition.height=this.getHeight(),this.lastPosition.x=e.x,this.lastPosition.y=e.y,this.positionableFeature.offsetElement(0,0),this.setHeight("100%"),this.setWidth("100%");this.isMaximized=!this.isMaximized,this.refreshMaximizeIcon()}refreshMaximizeIcon(){an(this.maximizeIcon,!this.isMaximized),an(this.minimizeIcon,this.isMaximized)}clearMaximizebleListeners(){this.maximizeListeners.length&&(this.maximizeListeners.forEach(e=>e()),this.maximizeListeners.length=0),this.resizeListenerDestroy&&(this.resizeListenerDestroy(),this.resizeListenerDestroy=null)}destroy(){this.maximizeButtonComp=this.destroyBean(this.maximizeButtonComp),this.clearMaximizebleListeners(),super.destroy()}setResizable(e){this.positionableFeature.setResizable(e)}setMovable(e){this.positionableFeature.setMovable(e,this.eTitleBar)}setMaximizable(e){if(!e)return this.clearMaximizebleListeners(),void(this.maximizeButtonComp&&(this.destroyBean(this.maximizeButtonComp),this.maximizeButtonComp=this.maximizeIcon=this.minimizeIcon=void 0));const t=this.eTitleBar;if(!t||e===this.isMaximizable)return;const i=this.buildMaximizeAndMinimizeElements();this.refreshMaximizeIcon(),i.addManagedListener(i.getGui(),"click",this.toggleMaximize.bind(this)),this.addTitleBarButton(i,0),this.maximizeListeners.push(this.addManagedListener(t,"dblclick",this.toggleMaximize.bind(this))),this.resizeListenerDestroy=this.addManagedListener(this,"resize",()=>{this.isMaximized=!1,this.refreshMaximizeIcon()})}buildMaximizeAndMinimizeElements(){const e=this.maximizeButtonComp=this.createBean(new vs('<div class="ag-dialog-button"></span>')),t=e.getGui();return this.maximizeIcon=qn("maximize",this.gos),t.appendChild(this.maximizeIcon),this.maximizeIcon.classList.add("ag-panel-title-bar-button-icon"),this.minimizeIcon=qn("minimize",this.gos),t.appendChild(this.minimizeIcon),this.minimizeIcon.classList.add("ag-panel-title-bar-button-icon"),e}}.prototype,"popupService",2);var ql=0,Xl=class extends st{constructor(){super(...arguments),this.popupList=[]}postConstruct(){this.ctrlsService.whenReady(e=>{this.gridCtrl=e.gridCtrl}),this.addManagedListener(this.eventService,ct.EVENT_GRID_STYLES_CHANGED,this.handleThemeChange.bind(this))}getPopupParent(){return this.gos.get("popupParent")||this.gridCtrl.getGui()}positionPopupForMenu(e){const{eventSource:t,ePopup:i}=e,n=this.getPopupIndex(i);-1!==n&&(this.popupList[n].alignedToElement=t);const s=t.getBoundingClientRect(),r=this.getParentRect(),o=this.keepXYWithinBounds(i,s.top-r.top,0),a=i.clientWidth>0?i.clientWidth:200;i.style.minWidth=`${a}px`;const l=r.right-r.left-a;let c;function h(){return s.right-r.left-2}function u(){return s.left-r.left-a}this.gos.get("enableRtl")?(c=u(),c<0&&(c=h(),this.setAlignedStyles(i,"left")),c>l&&(c=0,this.setAlignedStyles(i,"right"))):(c=h(),c>l&&(c=u(),this.setAlignedStyles(i,"right")),c<0&&(c=0,this.setAlignedStyles(i,"left"))),i.style.left=`${c}px`,i.style.top=`${o}px`}positionPopupUnderMouseEvent(e){const{ePopup:t,nudgeX:i,nudgeY:n,skipObserver:s}=e;this.positionPopup({ePopup:t,nudgeX:i,nudgeY:n,keepWithinBounds:!0,skipObserver:s,updatePosition:()=>this.calculatePointerAlign(e.mouseEvent),postProcessCallback:()=>this.callPostProcessPopup(e.type,e.ePopup,null,e.mouseEvent,e.column,e.rowNode)})}calculatePointerAlign(e){const t=this.getParentRect();return{x:e.clientX-t.left,y:e.clientY-t.top}}positionPopupByComponent(e){const{ePopup:t,nudgeX:i,nudgeY:n,keepWithinBounds:s,eventSource:r,alignSide:o="left",position:a="over",column:l,rowNode:c,type:h}=e,u=r.getBoundingClientRect(),d=this.getParentRect(),p=this.getPopupIndex(t);-1!==p&&(this.popupList[p].alignedToElement=r),this.positionPopup({ePopup:t,nudgeX:i,nudgeY:n,keepWithinBounds:s,updatePosition:()=>{let i,s=u.left-d.left;return"right"===o&&(s-=t.offsetWidth-u.width),"over"===a?(i=u.top-d.top,this.setAlignedStyles(t,"over")):(this.setAlignedStyles(t,"under"),i="under"===this.shouldRenderUnderOrAbove(t,u,d,e.nudgeY||0)?u.top-d.top+u.height:u.top-t.offsetHeight-2*(n||0)-d.top),{x:s,y:i}},postProcessCallback:()=>this.callPostProcessPopup(h,t,r,null,l,c)})}shouldRenderUnderOrAbove(e,t,i,n){const s=i.bottom-t.bottom,r=t.top-i.top,o=e.offsetHeight+n;return s>o?"under":r>o||r>s?"above":"under"}setAlignedStyles(e,t){const i=this.getPopupIndex(e);if(-1===i)return;const n=this.popupList[i],{alignedToElement:s}=n;s&&(["right","left","over","above","under"].forEach(t=>{s.classList.remove(`ag-has-popup-positioned-${t}`),e.classList.remove(`ag-popup-positioned-${t}`)}),t&&(s.classList.add(`ag-has-popup-positioned-${t}`),e.classList.add(`ag-popup-positioned-${t}`)))}callPostProcessPopup(e,t,i,n,s,r){const o=this.gos.getCallback("postProcessPopup");o&&o({column:s,rowNode:r,ePopup:t,type:e,eventSource:i,mouseEvent:n})}positionPopup(e){const{ePopup:t,keepWithinBounds:i,nudgeX:n,nudgeY:s,skipObserver:r,updatePosition:o}=e,a={width:0,height:0},l=(r=!1)=>{let{x:l,y:c}=o();r&&t.clientWidth===a.width&&t.clientHeight===a.height||(a.width=t.clientWidth,a.height=t.clientHeight,n&&(l+=n),s&&(c+=s),i&&(l=this.keepXYWithinBounds(t,l,1),c=this.keepXYWithinBounds(t,c,0)),t.style.left=`${l}px`,t.style.top=`${c}px`,e.postProcessCallback&&e.postProcessCallback())};if(l(),!r){const e=this.resizeObserverService.observeResize(t,()=>l(!0));setTimeout(()=>e(),Xl.WAIT_FOR_POPUP_CONTENT_RESIZE)}}getActivePopups(){return this.popupList.map(e=>e.element)}getPopupList(){return this.popupList}getParentRect(){const e=this.gos.getDocument();let t=this.getPopupParent();return t===e.body?t=e.documentElement:"static"===getComputedStyle(t).position&&(t=t.offsetParent),mn(t)}keepXYWithinBounds(e,t,i){const n=0===i,s=n?"clientHeight":"clientWidth",r=n?"top":"left",o=n?"offsetHeight":"offsetWidth",a=n?"scrollTop":"scrollLeft",l=this.gos.getDocument(),c=l.documentElement,h=this.getPopupParent(),u=h.getBoundingClientRect(),d=l.documentElement.getBoundingClientRect(),p=h===l.body,g=e[o];let f=p?(n?gn:fn)(c)+c[a]:h[s];p&&(f-=Math.abs(d[r]-u[r]));const m=f-g;return Math.min(Math.max(t,0),Math.abs(m))}addPopup(e){const t=this.gos.getDocument(),{eChild:i,ariaLabel:n,alwaysOnTop:s,positionCallback:r,anchorToElement:o}=e;if(!t)return console.warn("AG Grid: could not find the document, document is empty"),{hideFunc:()=>{}};const a=this.getPopupIndex(i);if(-1!==a)return{hideFunc:this.popupList[a].hideFunc};this.initialisePopupPosition(i);const l=this.createPopupWrapper(i,n,!!s),c=this.addEventListenersToPopup(p(d({},e),{wrapperEl:l}));return r&&r(),this.addPopupToPopupList(i,l,c,o),{hideFunc:c}}initialisePopupPosition(e){const t=this.getPopupParent().getBoundingClientRect();b(e.style.top)||(e.style.top=-1*t.top+"px"),b(e.style.left)||(e.style.left=-1*t.left+"px")}createPopupWrapper(e,t,i){const n=this.getPopupParent(),s=document.createElement("div"),{allThemes:r}=this.environment.getTheme();return r.length&&s.classList.add(...r),s.classList.add("ag-popup"),e.classList.add(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr","ag-popup-child"),e.hasAttribute("role")||Ht(e,"dialog"),$t(e,t),s.appendChild(e),n.appendChild(s),i?this.setAlwaysOnTop(e,!0):this.bringPopupToFront(e),s}handleThemeChange(){const{allThemes:e}=this.environment.getTheme();for(const t of this.popupList){for(const e of Array.from(t.wrapper.classList))e.startsWith("ag-theme-")&&t.wrapper.classList.remove(e);e.length&&t.wrapper.classList.add(...e)}}addEventListenersToPopup(e){const t=this.gos.getDocument(),i=this.getPopupParent(),{wrapperEl:n,eChild:s,closedCallback:r,afterGuiAttached:o,closeOnEsc:a,modal:l}=e;let c=!1;const h=e=>{n.contains(this.gos.getActiveDomElement())&&(e.key!==Zn.ESCAPE||Xe(e)||p({keyboardEvent:e}))},u=e=>p({mouseEvent:e}),d=e=>p({touchEvent:e}),p=(e={})=>{const{mouseEvent:o,touchEvent:a,keyboardEvent:l,forceHide:p}=e;(p||!this.isEventFromCurrentPopup({mouseEvent:o,touchEvent:a},s)&&!c)&&(c=!0,i.removeChild(n),t.removeEventListener("keydown",h),t.removeEventListener("mousedown",u),t.removeEventListener("touchstart",d),t.removeEventListener("contextmenu",u),this.eventService.removeEventListener(ct.EVENT_DRAG_STARTED,u),r&&r(o||a||l),this.removePopupFromPopupList(s))};return o&&o({hidePopup:p}),window.setTimeout(()=>{a&&t.addEventListener("keydown",h),l&&(t.addEventListener("mousedown",u),this.eventService.addEventListener(ct.EVENT_DRAG_STARTED,u),t.addEventListener("touchstart",d),t.addEventListener("contextmenu",u))},0),p}addPopupToPopupList(e,t,i,n){this.popupList.push({element:e,wrapper:t,hideFunc:i,instanceId:ql++,isAnchored:!!n}),n&&this.setPopupPositionRelatedToElement(e,n)}getPopupIndex(e){return this.popupList.findIndex(t=>t.element===e)}setPopupPositionRelatedToElement(e,t){const i=this.getPopupIndex(e);if(-1===i)return;const n=this.popupList[i];if(n.stopAnchoringPromise&&n.stopAnchoringPromise.then(e=>e&&e()),n.stopAnchoringPromise=void 0,n.isAnchored=!1,!t)return;const s=this.keepPopupPositionedRelativeTo({element:t,ePopup:e,hidePopup:n.hideFunc});return n.stopAnchoringPromise=s,n.isAnchored=!0,s}removePopupFromPopupList(e){this.setAlignedStyles(e,null),this.setPopupPositionRelatedToElement(e,null),this.popupList=this.popupList.filter(t=>t.element!==e)}keepPopupPositionedRelativeTo(e){const t=this.getPopupParent(),i=t.getBoundingClientRect(),{element:n,ePopup:s}=e,r=n.getBoundingClientRect(),o=i.top-r.top,a=i.left-r.left;let l=o,c=a;const h=s.style.top,u=parseInt(h.substring(0,h.length-1),10),d=s.style.left,p=parseInt(d.substring(0,d.length-1),10);return new us(i=>{this.getFrameworkOverrides().setInterval(()=>{const i=t.getBoundingClientRect(),r=n.getBoundingClientRect();if(0==r.top&&0==r.left&&0==r.height&&0==r.width)return void e.hidePopup();const h=i.top-r.top;if(h!=l){const e=this.keepXYWithinBounds(s,u+o-h,0);s.style.top=`${e}px`}l=h;const d=i.left-r.left;if(d!=c){const e=this.keepXYWithinBounds(s,p+a-d,1);s.style.left=`${e}px`}c=d},200).then(e=>{i(()=>{null!=e&&window.clearInterval(e)})})})}hasAnchoredPopup(){return this.popupList.some(e=>e.isAnchored)}isEventFromCurrentPopup(e,t){const{mouseEvent:i,touchEvent:n}=e,s=i||n;if(!s)return!1;const r=this.getPopupIndex(t);if(-1===r)return!1;for(let e=r;e<this.popupList.length;e++)if(Je(this.popupList[e].element,s))return!0;return this.isElementWithinCustomPopup(s.target)}isElementWithinCustomPopup(e){const t=this.gos.getDocument();for(;e&&e!==t.body;){if(e.classList.contains("ag-custom-component-popup")||null===e.parentElement)return!0;e=e.parentElement}return!1}getWrapper(e){for(;!e.classList.contains("ag-popup")&&e.parentElement;)e=e.parentElement;return e.classList.contains("ag-popup")?e:null}setAlwaysOnTop(e,t){const i=this.getWrapper(e);i&&(i.classList.toggle("ag-always-on-top",!!t),t&&this.bringPopupToFront(i))}bringPopupToFront(e){const t=this.getPopupParent(),i=Array.prototype.slice.call(t.querySelectorAll(".ag-popup")),n=i.length,s=Array.prototype.slice.call(t.querySelectorAll(".ag-popup.ag-always-on-top")),r=s.length,o=this.getWrapper(e);if(!o||n<=1||!t.contains(e))return;const a=i.indexOf(o),l=o.querySelectorAll("div"),c=[];for(l.forEach(e=>{0!==e.scrollTop&&c.push([e,e.scrollTop])}),r?o.classList.contains("ag-always-on-top")?a!==n-1&&Ie(s).insertAdjacentElement("afterend",o):a!==n-r-1&&s[0].insertAdjacentElement("beforebegin",o):a!==n-1&&Ie(i).insertAdjacentElement("afterend",o);c.length;){const e=c.pop();e[0].scrollTop=e[1]}}};Xl.WAIT_FOR_POPUP_CONTENT_RESIZE=200,f([ue("focusService")],Xl.prototype,"focusService",2),f([ue("ctrlsService")],Xl.prototype,"ctrlsService",2),f([ue("resizeObserverService")],Xl.prototype,"resizeObserverService",2),f([le],Xl.prototype,"postConstruct",1),Xl=f([he("popupService")],Xl);var Zl=class extends vs{constructor(){super('\n        <div class="ag-autocomplete-row" role="presentation">\n            <div class="ag-autocomplete-row-label"></div>\n        </div>'),this.hasHighlighting=!1}setState(e,t){this.value=e,this.render(),this.updateSelected(t)}updateSelected(e){this.addOrRemoveCssClass("ag-autocomplete-row-selected",e)}setSearchString(e){var t;let i=!1;if(b(e)){const n=null==(t=this.value)?void 0:t.toLocaleLowerCase().indexOf(e.toLocaleLowerCase());if(n>=0){i=!0,this.hasHighlighting=!0;const t=n+e.length,s=bt(this.value.slice(0,n)),r=bt(this.value.slice(n,t)),o=bt(this.value.slice(t));this.getGui().lastElementChild.innerHTML=`${s}<b>${r}</b>${o}`}}!i&&this.hasHighlighting&&(this.hasHighlighting=!1,this.render())}render(){var e;this.getGui().lastElementChild.innerHTML=null!=(e=bt(this.value))?e:"&nbsp;"}},Ql=class e extends wr{constructor(t){super(e.TEMPLATE),this.params=t,this.searchString=""}destroy(){super.destroy()}init(){this.autocompleteEntries=this.params.autocompleteEntries,this.virtualList=this.createManagedBean(new Ll({cssIdentifier:"autocomplete"})),this.virtualList.setComponentCreator(this.createRowComponent.bind(this)),this.eList.appendChild(this.virtualList.getGui()),this.virtualList.setModel({getRowCount:()=>this.autocompleteEntries.length,getRow:e=>this.autocompleteEntries[e]});const e=this.virtualList.getGui();this.addManagedListener(e,"click",()=>this.params.onConfirmed()),this.addManagedListener(e,"mousemove",this.onMouseMove.bind(this)),this.addManagedListener(e,"mousedown",e=>e.preventDefault()),this.setSelectedValue(0)}onNavigationKeyDown(e,t){e.preventDefault();const i=this.autocompleteEntries.indexOf(this.selectedValue),n=t===Zn.UP?i-1:i+1;this.checkSetSelectedValue(n)}setSearch(e){this.searchString=e,b(e)?this.runSearch():(this.autocompleteEntries=this.params.autocompleteEntries,this.virtualList.refresh(),this.checkSetSelectedValue(0)),this.updateSearchInList()}runContainsSearch(e,t){let i,n=!1;const s=e.toLocaleLowerCase(),r=t.filter(e=>{const t=e.toLocaleLowerCase().indexOf(s),r=0===t,o=t>=0;return o&&(!i||!n&&r||n===r&&e.length<i.length)&&(i=e,n=r),o});return!i&&r.length&&(i=r[0]),{topMatch:i,allMatches:r}}runSearch(){var e,t;const{autocompleteEntries:i}=this.params,n=i.map(e=>{var t;return null!=(t=e.displayValue)?t:e.key});let s,r;if(this.params.useFuzzySearch)s=Wn(this.searchString,n,!0).values,r=s.length?s[0]:void 0;else{const e=this.runContainsSearch(this.searchString,n);s=e.allMatches,r=e.topMatch}let o=i.filter(({key:e,displayValue:t})=>s.includes(null!=t?t:e));if(!o.length&&this.selectedValue&&(null==(t=null==(e=this.params)?void 0:e.forceLastSelection)?void 0:t.call(e,this.selectedValue,this.searchString))&&(o=[this.selectedValue]),this.autocompleteEntries=o,this.virtualList.refresh(),!r)return;const a=s.indexOf(r);this.checkSetSelectedValue(a)}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((t,i)=>{t.updateSelected(e===i)}))}createRowComponent(e){var t;const i=new Zl;return this.getContext().createBean(i),i.setState(null!=(t=e.displayValue)?t:e.key,e===this.selectedValue),i}onMouseMove(e){const t=this.virtualList.getGui().getBoundingClientRect(),i=this.virtualList.getScrollTop(),n=e.clientY-t.top+i,s=Math.floor(n/this.virtualList.getRowHeight());this.checkSetSelectedValue(s)}afterGuiAttached(){this.virtualList.refresh()}getSelectedValue(){var e;return this.autocompleteEntries.length&&null!=(e=this.selectedValue)?e:null}};Ql.TEMPLATE='<div class="ag-autocomplete-list-popup">\n            <div ref="eList" class="ag-autocomplete-list"></div>\n        <div>',f([bs("eList")],Ql.prototype,"eList",2),f([le],Ql.prototype,"init",1);var Jl=Ql,ec=class e extends vs{constructor(){super('\n            <div class="ag-autocomplete" role="presentation">\n                <ag-input-text-field ref="eAutocompleteInput"></ag-input-text-field>\n            </div>'),this.isListOpen=!1,this.lastPosition=0,this.valid=!0}postConstruct(){this.eAutocompleteInput.onValueChange(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=v(e);this.updateValue(t),this.updateAutocompleteList(t)}updateValue(t){this.updateLastPosition(),this.dispatchEvent({type:e.EVENT_VALUE_CHANGED,value:t}),this.validate(t)}updateAutocompleteList(e){var t,i,n,s;const r=null!=(i=null==(t=this.listGenerator)?void 0:t.call(this,e,this.lastPosition))?i:{enabled:!1};if(r.type&&r.type===(null==(n=this.autocompleteListParams)?void 0:n.type)||this.isListOpen&&this.closeList(),this.autocompleteListParams=r,null==(s=this.autocompleteListParams)?void 0:s.enabled){this.isListOpen||this.openList();const{searchString:e}=this.autocompleteListParams;this.autocompleteList.setSearch(null!=e?e:"")}else this.isListOpen&&this.closeList()}onKeyDown(e){const t=e.key;switch(this.updateLastPosition(),t){case Zn.ENTER:this.onEnterKeyDown(e);break;case Zn.TAB:this.onTabKeyDown(e);break;case Zn.DOWN:case Zn.UP:this.onUpDownKeyDown(e,t);break;case Zn.LEFT:case Zn.RIGHT:case Zn.PAGE_HOME:case Zn.PAGE_END:setTimeout(()=>{this.updatePositionAndList()});break;case Zn.ESCAPE:this.onEscapeKeyDown(e);break;case Zn.SPACE:e.ctrlKey&&!this.isListOpen&&(e.preventDefault(),this.forceOpenList())}}confirmSelection(){var t;const i=null==(t=this.autocompleteList)?void 0:t.getSelectedValue();i&&(this.closeList(),this.dispatchEvent({type:e.EVENT_OPTION_SELECTED,value:this.getValue(),position:this.lastPosition,updateEntry:i,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 i;e.preventDefault(),this.isListOpen?null==(i=this.autocompleteList)||i.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(null!=(e=this.eAutocompleteInput.getValue())?e:null)}setCaret(e,t){const i=this.gos.getDocument(),n=this.gos.getActiveDomElement();!t||n&&n!==i.body||this.eAutocompleteInput.getFocusableElement().focus();const s=this.eAutocompleteInput.getInputElement();s.setSelectionRange(e,e),e===s.value.length&&(s.scrollLeft=s.scrollWidth)}forceOpenList(){this.onValueChanged(this.eAutocompleteInput.getValue())}updateLastPosition(){var e;this.lastPosition=null!=(e=this.eAutocompleteInput.getInputElement().selectionStart)?e:0}validate(t){var i;this.validator&&(this.validationMessage=this.validator(t),this.eAutocompleteInput.getInputElement().setCustomValidity(null!=(i=this.validationMessage)?i:""),this.valid=!this.validationMessage,this.dispatchEvent({type:e.EVENT_VALID_CHANGED,isValid:this.valid,validationMessage:this.validationMessage}))}openList(){this.isListOpen=!0,this.autocompleteList=this.createBean(new Jl({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},i=this.popupService.addPopup({eChild:e,anchorToElement:this.getGui(),positionCallback:()=>this.popupService.positionPopupByComponent(t),ariaLabel:this.listAriaLabel});this.hidePopup=i.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:e.EVENT_VALUE_CONFIRMED,value:this.getValue(),isValid:this.isValid()})}getValue(){return v(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:i,silent:n,updateListOnlyIfOpen:s,restoreFocus:r}=e;this.eAutocompleteInput.setValue(t,!0),this.setCaret(null!=i?i:this.lastPosition,r),n||this.updateValue(t),s&&!this.isListOpen||this.updateAutocompleteList(t)}setForceLastSelection(e){return this.forceLastSelection=e,this}setInputDisabled(e){return this.eAutocompleteInput.setDisabled(e),this}};ec.EVENT_VALUE_CHANGED="eventValueChanged",ec.EVENT_VALUE_CONFIRMED="eventValueConfirmed",ec.EVENT_OPTION_SELECTED="eventOptionSelected",ec.EVENT_VALID_CHANGED="eventValidChanged",f([ue("popupService")],ec.prototype,"popupService",2),f([bs("eAutocompleteInput")],ec.prototype,"eAutocompleteInput",2),f([le],ec.prototype,"postConstruct",1);var tc=ec,ic=class e extends vs{constructor(e,t,i,n){super(),this.dragSourceDropTarget=e,this.ghost=t,this.horizontal=i,this.template=n}init(){var t;this.setTemplate(null!=(t=this.template)?t:e.TEMPLATE);const i=this.getGui();this.addElementClasses(i),this.addElementClasses(this.eDragHandle,"drag-handle"),this.addElementClasses(this.eText,"text"),this.addElementClasses(this.eButton,"button"),this.eDragHandle.appendChild(qn("columnDrag",this.gos)),this.eButton.appendChild(qn("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),$t(this.getGui(),t.join(". "))}addAdditionalAriaInstructions(e,t){if(this.isRemovable()){const i=t("ariaDropZoneColumnComponentDescription","Press DELETE to remove");e.push(i)}}setupTooltip(){const e=()=>{const e=this.getTooltip();this.setTooltip({newTooltipText:e})};e(),this.addManagedListener(this.eventService,ct.EVENT_NEW_COLUMNS_LOADED,e)}getDragSourceId(){}getDefaultIconName(){return Lr.ICON_NOT_ALLOWED}addDragSource(){const{dragAndDropService:e,eDragHandle:t}=this,i=this.createGetDragItem(),n=this.getDefaultIconName(),s={type:this.getDragSourceType(),sourceId:this.getDragSourceId(),eElement:t,getDefaultIconName:()=>n,getDragItem:i,dragItemName:this.getDisplayName()};e.addDragSource(s,!0),this.addDestroyFunc(()=>e.removeDragSource(s))}setupComponents(){this.setTextValue(),this.setupRemove(),this.ghost&&this.addCssClass("ag-column-drop-cell-ghost")}isRemovable(){return!0}refreshRemove(){an(this.eButton,this.isRemovable())}setupRemove(){this.refreshRemove();const t={type:e.EVENT_COLUMN_REMOVE};this.addGuiEventListener("keydown",e=>this.onKeyDown(e)),this.addManagedListener(this.eButton,"click",e=>{this.dispatchEvent(t),e.stopPropagation()});const i=new gr(this.eButton);this.addManagedListener(i,gr.EVENT_TAP,()=>{this.dispatchEvent(t)}),this.addDestroyFunc(i.destroy.bind(i))}onKeyDown(t){t.key===Zn.DELETE&&this.isRemovable()&&(t.preventDefault(),this.dispatchEvent({type:e.EVENT_COLUMN_REMOVE}))}getDisplayValue(){return this.getDisplayName()}setTextValue(){const e=bt(this.getDisplayValue());this.eText.innerHTML=e}addElementClasses(e,t){t=t?`-${t}`:"";const i=this.horizontal?"horizontal":"vertical";e.classList.add(`ag-column-drop-cell${t}`,`ag-column-drop-${i}-cell${t}`)}destroy(){super.destroy(),this.dragSourceDropTarget=null}};ic.EVENT_COLUMN_REMOVE="columnRemove",ic.TEMPLATE='<span role="option">\n          <span ref="eDragHandle" class="ag-drag-handle ag-column-drop-cell-drag-handle" role="presentation"></span>\n          <span ref="eText" class="ag-column-drop-cell-text" aria-hidden="true"></span>\n          <span ref="eButton" class="ag-column-drop-cell-button" role="presentation"></span>\n        </span>',f([ue("dragAndDropService")],ic.prototype,"dragAndDropService",2),f([bs("eText")],ic.prototype,"eText",2),f([bs("eDragHandle")],ic.prototype,"eDragHandle",2),f([bs("eButton")],ic.prototype,"eButton",2),f([le],ic.prototype,"init",1);var nc=ic,sc=class e extends vs{constructor(t){super('<div class="ag-unselectable" role="presentation"></div>'),this.horizontal=t,this.state=e.STATE_NOT_DRAGGING,this.guiDestroyFunctions=[],this.childPillComponents=[],this.resizeEnabled=!1,this.addElementClasses(this.getGui()),this.ePillDropList=document.createElement("div"),this.addElementClasses(this.ePillDropList,"list"),Ht(this.ePillDropList,"listbox")}isHorizontal(){return this.horizontal}toggleResizable(e){this.positionableFeature.setResizable(!!e&&{bottom:!0}),this.resizeEnabled=e}isSourceEventFromTarget(e){const{dropZoneTarget:t,dragSource:i}=e;return t.contains(i.eElement)}destroy(){this.destroyGui(),super.destroy()}destroyGui(){this.guiDestroyFunctions.forEach(e=>e()),this.guiDestroyFunctions.length=0,this.childPillComponents.length=0,Cn(this.getGui()),Cn(this.ePillDropList)}init(e){this.params=null!=e?e:{},this.createManagedBean(new Ms(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.setupDropTarget(),this.positionableFeature=new Is(this.getGui(),{minHeight:100}),this.createManagedBean(this.positionableFeature),this.refreshGui(),$t(this.ePillDropList,this.getAriaLabel())}handleKeyDown(e){const t=!this.horizontal;let i=e.key===Zn.DOWN,n=e.key===Zn.UP;if(!t){const t=this.gos.get("enableRtl");i=!t&&e.key===Zn.RIGHT||t&&e.key===Zn.LEFT,n=!t&&e.key===Zn.LEFT||t&&e.key===Zn.RIGHT}if(!i&&!n)return;const s=this.focusService.findNextFocusableElement(this.getFocusableElement(),!1,n);s&&(e.preventDefault(),s.focus())}addElementClasses(e,t){t=t?`-${t}`:"";const i=this.horizontal?"horizontal":"vertical";e.classList.add(`ag-column-drop${t}`,`ag-column-drop-${i}${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 i=this.minimumAllowedNewInsertIndex(),n=Math.max(i,t),s=n!==this.insertIndex;return s&&(this.insertIndex=n),s}getNewInsertIndex(e){const t=e.event,i=this.horizontal?t.clientX:t.clientY,n=this.childPillComponents.map(e=>e.getGui().getBoundingClientRect()),s=n.findIndex(e=>this.horizontal?e.right>i&&e.left<i:e.top<i&&e.bottom>i);if(-1===s){const e=this.gos.get("enableRtl");return n.every(e=>i>(this.horizontal?e.right:e.bottom))?e&&this.horizontal?0:this.childPillComponents.length:n.every(e=>i<(this.horizontal?e.left:e.top))?e&&this.horizontal?this.childPillComponents.length:0:this.insertIndex}return this.insertIndex<=s?s+1:s}checkDragStartedBySelf(t){this.state===e.STATE_NOT_DRAGGING&&(this.state=e.STATE_REARRANGE_ITEMS,this.potentialDndItems=this.getItems(t.dragSource.getDragItem()),this.refreshGui(),this.checkInsertIndex(t),this.refreshGui())}onDragging(e){this.checkDragStartedBySelf(e),this.checkInsertIndex(e)&&this.refreshGui()}handleDragEnterEnd(e){}onDragEnter(t){const i=this.getItems(t.dragSource.getDragItem());this.state=e.STATE_NEW_ITEMS_IN;const n=i.filter(e=>this.isItemDroppable(e,t)),s=n.every(e=>-1!==this.childPillComponents.map(e=>e.getItem()).indexOf(e));0!==n.length&&(this.potentialDndItems=n,s?this.state=e.STATE_NOT_DRAGGING:(this.handleDragEnterEnd(t),this.checkInsertIndex(t),this.refreshGui()))}isPotentialDndItems(){return De(this.potentialDndItems)}handleDragLeaveEnd(e){}onDragLeave(t){if(this.state===e.STATE_REARRANGE_ITEMS){const e=this.getItems(t.dragSource.getDragItem());this.removeItems(e)}this.isPotentialDndItems()&&(this.handleDragLeaveEnd(t),this.potentialDndItems=[],this.refreshGui()),this.state=e.STATE_NOT_DRAGGING}refreshOnDragStop(){return!0}onDragStop(){if(this.isPotentialDndItems()){let t=!1;this.state===e.STATE_NEW_ITEMS_IN?(this.addItems(this.potentialDndItems),t=!0):t=this.rearrangeItems(this.potentialDndItems),this.potentialDndItems=[],!this.refreshOnDragStop()&&t||this.refreshGui()}this.state=e.STATE_NOT_DRAGGING}removeItems(e){const t=this.getExistingItems().filter(t=>!He(e,t));this.updateItems(t)}addItems(e){if(!e)return;const t=this.getExistingItems().slice(),i=e.filter(e=>t.indexOf(e)<0);Be(t,i,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 Be(t,e,this.insertIndex),!Re(t,this.getExistingItems())&&(this.updateItems(t),!0)}refreshGui(){const e=this.ePillDropList.scrollTop,t=this.resizeEnabled,i=this.getFocusedItem();let n=this.focusService.findNextFocusableElement();n||(n=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(i,n)}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 i=this.getGui(),n=Array.from(i.querySelectorAll(".ag-column-drop-cell"));if(-1===e)return;0===n.length&&t.focus();const s=n[Math.min(n.length-1,e)];s&&s.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(e=>!He(this.potentialDndItems,e)):e}addItemsToGui(){const e=this.getNonGhostItems().map(e=>this.createItemComponent(e,!1));if(this.isPotentialDndItems()){const t=this.potentialDndItems.map(e=>this.createItemComponent(e,!0));this.insertIndex>=e.length?e.push(...t):e.splice(this.insertIndex,0,...t)}this.appendChild(this.ePillDropList),e.forEach((e,t)=>{t>0&&this.addArrow(this.ePillDropList),this.ePillDropList.appendChild(e.getGui())}),this.addAriaLabelsToComponents()}addAriaLabelsToComponents(){this.childPillComponents.forEach((e,t)=>{const i=e.getGui();ri(i,t+1),si(i,this.childPillComponents.length)})}createItemComponent(e,t){const i=this.createPillComponent(e,this.dropTarget,t,this.horizontal);return i.addEventListener(nc.EVENT_COLUMN_REMOVE,this.removeItems.bind(this,[e])),this.context.createBean(i),this.guiDestroyFunctions.push(()=>this.destroyBean(i)),t||this.childPillComponents.push(i),i}addIconAndTitleToGui(){const{title:e,icon:t}=this.params;if(!e||!t)return;const i=document.createElement("div");if(ei(i,!0),this.addElementClasses(i,"title-bar"),this.addElementClasses(t,"icon"),this.addOrRemoveCssClass("ag-column-drop-empty",this.isExistingItemsEmpty()),i.appendChild(t),!this.horizontal){const t=document.createElement("span");this.addElementClasses(t,"title"),t.innerHTML=e,i.appendChild(t)}this.appendChild(i)}isExistingItemsEmpty(){return 0===this.getExistingItems().length}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=qn(this.gos.get("enableRtl")?"smallLeft":"smallRight",this.gos);this.addElementClasses(t,"cell-separator"),e.appendChild(t)}}};sc.STATE_NOT_DRAGGING="notDragging",sc.STATE_NEW_ITEMS_IN="newItemsIn",sc.STATE_REARRANGE_ITEMS="rearrangeItems",f([ue("focusService")],sc.prototype,"focusService",2),f([ue("dragAndDropService")],sc.prototype,"dragAndDropService",2);var rc=["touchstart","touchend","touchmove","touchcancel"],oc=class{constructor(e="javascript"){this.frameworkName=e,this.renderingEngine="vanilla",this.wrapIncoming=e=>e(),this.wrapOutgoing=e=>e()}setInterval(e,t){return new us(i=>{i(window.setInterval(e,t))})}addEventListener(e,t,i,n){const s=He(rc,t);e.addEventListener(t,i,{capture:!!n,passive:s})}get shouldWrapOutgoing(){return!1}frameworkComponent(e){return null}isFrameworkComponent(e){return!1}getDocLink(e){return`https://www.ag-grid.com/${"solid"===this.frameworkName?"react":this.frameworkName}-data-grid${e?`/${e}`:""}`}},ac=class extends st{getNextCellToFocus(e,t,i=!1){return i?this.getNextCellToFocusWithCtrlPressed(e,t):this.getNextCellToFocusWithoutCtrlPressed(e,t)}getNextCellToFocusWithCtrlPressed(e,t){const i=e===Zn.UP,n=e===Zn.DOWN,s=e===Zn.LEFT;let r,o;if(i||n)o=i?this.paginationProxy.getPageFirstRow():this.paginationProxy.getPageLastRow(),r=t.column;else{const e=this.columnModel.getAllDisplayedColumns(),i=this.gos.get("enableRtl");o=t.rowIndex,r=s!==i?e[0]:Ie(e)}return{rowIndex:o,rowPinned:null,column:r}}getNextCellToFocusWithoutCtrlPressed(e,t){let i=t,n=!1;for(;!n;){switch(e){case Zn.UP:i=this.getCellAbove(i);break;case Zn.DOWN:i=this.getCellBelow(i);break;case Zn.RIGHT:i=this.gos.get("enableRtl")?this.getCellToLeft(i):this.getCellToRight(i);break;case Zn.LEFT:i=this.gos.get("enableRtl")?this.getCellToRight(i):this.getCellToLeft(i);break;default:i=null,console.warn("AG Grid: unknown key for navigation "+e)}n=!i||this.isCellGoodToFocusOn(i)}return i}isCellGoodToFocusOn(e){const t=e.column;let i;switch(e.rowPinned){case"top":i=this.pinnedRowModel.getPinnedTopRow(e.rowIndex);break;case"bottom":i=this.pinnedRowModel.getPinnedBottomRow(e.rowIndex);break;default:i=this.rowModel.getRow(e.rowIndex)}return!!i&&!t.isSuppressNavigable(i)}getCellToLeft(e){if(!e)return null;const t=this.columnModel.getDisplayedColBefore(e.column);return t?{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}:null}getCellToRight(e){if(!e)return null;const t=this.columnModel.getDisplayedColAfter(e.column);return t?{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}:null}getRowBelow(e){const t=e.rowIndex,i=e.rowPinned;if(this.isLastRowInContainer(e))switch(i){case"bottom":return null;case"top":return this.rowModel.isRowsToRender()?{rowIndex:this.paginationProxy.getPageFirstRow(),rowPinned:null}:this.pinnedRowModel.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null;default:return this.pinnedRowModel.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null}const n=this.rowModel.getRow(e.rowIndex);return this.getNextStickyPosition(n)||{rowIndex:t+1,rowPinned:i}}getNextStickyPosition(e,t){if(!this.gos.isGroupRowsSticky()||!e||!e.sticky)return;let i=[];i=this.rowRenderer.getStickyTopRowCtrls().some(t=>t.getRowNode().rowIndex===e.rowIndex)?[...this.rowRenderer.getStickyTopRowCtrls()].sort((e,t)=>e.getRowNode().rowIndex-t.getRowNode().rowIndex):[...this.rowRenderer.getStickyBottomRowCtrls()].sort((e,t)=>t.getRowNode().rowIndex-e.getRowNode().rowIndex);const n=t?-1:1,s=i.findIndex(t=>t.getRowNode().rowIndex===e.rowIndex),r=i[s+n];return r?{rowIndex:r.getRowNode().rowIndex,rowPinned:null}:void 0}getCellBelow(e){if(!e)return null;const t=this.getRowBelow(e);return t?{rowIndex:t.rowIndex,column:e.column,rowPinned:t.rowPinned}:null}isLastRowInContainer(e){const t=e.rowPinned,i=e.rowIndex;return"top"===t?this.pinnedRowModel.getPinnedTopRowData().length-1<=i:"bottom"===t?this.pinnedRowModel.getPinnedBottomRowData().length-1<=i:this.paginationProxy.getPageLastRow()<=i}getRowAbove(e){const t=e.rowIndex,i=e.rowPinned;if(i?0===t:t===this.paginationProxy.getPageFirstRow())return"top"===i?null:i&&this.rowModel.isRowsToRender()?this.getLastBodyCell():this.pinnedRowModel.isRowsToRender("top")?this.getLastFloatingTopRow():null;const n=this.rowModel.getRow(e.rowIndex);return this.getNextStickyPosition(n,!0)||{rowIndex:t-1,rowPinned:i}}getCellAbove(e){if(!e)return null;const t=this.getRowAbove({rowIndex:e.rowIndex,rowPinned:e.rowPinned});return t?{rowIndex:t.rowIndex,column:e.column,rowPinned:t.rowPinned}:null}getLastBodyCell(){return{rowIndex:this.paginationProxy.getPageLastRow(),rowPinned:null}}getLastFloatingTopRow(){return{rowIndex:this.pinnedRowModel.getPinnedTopRowData().length-1,rowPinned:"top"}}getNextTabbedCell(e,t){return t?this.getNextTabbedCellBackwards(e):this.getNextTabbedCellForwards(e)}getNextTabbedCellForwards(e){const t=this.columnModel.getAllDisplayedColumns();let i=e.rowIndex,n=e.rowPinned,s=this.columnModel.getDisplayedColAfter(e.column);if(!s){s=t[0];const r=this.getRowBelow(e);if(C(r))return null;if(!r.rowPinned&&!this.paginationProxy.isRowInPage(r))return null;i=r?r.rowIndex:null,n=r?r.rowPinned:null}return{rowIndex:i,column:s,rowPinned:n}}getNextTabbedCellBackwards(e){const t=this.columnModel.getAllDisplayedColumns();let i=e.rowIndex,n=e.rowPinned,s=this.columnModel.getDisplayedColBefore(e.column);if(!s){s=Ie(t);const r=this.getRowAbove({rowIndex:e.rowIndex,rowPinned:e.rowPinned});if(C(r))return null;if(!r.rowPinned&&!this.paginationProxy.isRowInPage(r))return null;i=r?r.rowIndex:null,n=r?r.rowPinned:null}return{rowIndex:i,column:s,rowPinned:n}}};f([ue("columnModel")],ac.prototype,"columnModel",2),f([ue("rowModel")],ac.prototype,"rowModel",2),f([ue("rowRenderer")],ac.prototype,"rowRenderer",2),f([ue("pinnedRowModel")],ac.prototype,"pinnedRowModel",2),f([ue("paginationProxy")],ac.prototype,"paginationProxy",2),ac=f([he("cellNavigationService")],ac);var lc=class extends st{constructor(){super(...arguments),this.consuming=!1}setBeans(e){this.logger=e.create("AlignedGridsService")}getAlignedGridApis(){var e;let t=null!=(e=this.gos.get("alignedGrids"))?e:[];const i="function"==typeof t;"function"==typeof t&&(t=t());const n=()=>`See ${this.getFrameworkOverrides().getDocLink("aligned-grids")}`;return t.map(e=>{var t;if(!e)return W("alignedGrids contains an undefined option."),i||W('You may want to configure via a callback to avoid setup race conditions:\n                     "alignedGrids: () => [linkedGrid]"'),void W(n());if(e instanceof Oo)return e;const s=e;return"current"in s?null==(t=s.current)?void 0:t.api:(s.api||W(`alignedGrids - No api found on the linked grid. If you are passing gridOptions to alignedGrids since v31 this is no longer valid. ${n()}`),s.api)}).filter(e=>!!e&&!e.isDestroyed())}init(){this.addManagedListener(this.eventService,ct.EVENT_COLUMN_MOVED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_VISIBLE,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PINNED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_GROUP_OPENED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_RESIZED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_BODY_SCROLL,this.fireScrollEvent.bind(this))}fireEvent(e){this.consuming||this.getAlignedGridApis().forEach(t=>{if(t.isDestroyed())return;const i=t.__getAlignedGridService();e(i)})}onEvent(e){this.consuming=!0,e(),this.consuming=!1}fireColumnEvent(e){this.fireEvent(t=>{t.onColumnEvent(e)})}fireScrollEvent(e){"horizontal"===e.direction&&this.fireEvent(t=>{t.onScrollEvent(e)})}onScrollEvent(e){this.onEvent(()=>{this.ctrlsService.getGridBodyCtrl().getScrollFeature().setHorizontalScrollPosition(e.left,!0)})}getMasterColumns(e){const t=[];return e.columns?e.columns.forEach(e=>{t.push(e)}):e.column&&t.push(e.column),t}getColumnIds(e){const t=[];return e.columns?e.columns.forEach(e=>{t.push(e.getColId())}):e.column&&t.push(e.column.getColId()),t}onColumnEvent(e){this.onEvent(()=>{switch(e.type){case ct.EVENT_COLUMN_MOVED:case ct.EVENT_COLUMN_VISIBLE:case ct.EVENT_COLUMN_PINNED:case ct.EVENT_COLUMN_RESIZED:const t=e;this.processColumnEvent(t);break;case ct.EVENT_COLUMN_GROUP_OPENED:const i=e;this.processGroupOpenedEvent(i);break;case ct.EVENT_COLUMN_PIVOT_CHANGED:console.warn("AG Grid: pivoting is not supported with aligned grids. You can only use one of these features at a time in a grid.")}})}processGroupOpenedEvent(e){e.columnGroups.forEach(t=>{let i=null;if(t){const e=t.getGroupId();i=this.columnModel.getProvidedColumnGroup(e)}t&&!i||(this.logger.log("onColumnEvent-> processing "+e+" expanded = "+t.isExpanded()),this.columnModel.setColumnGroupOpened(i,t.isExpanded(),"alignedGridChanged"))})}processColumnEvent(e){var t;const i=e.column;let n=null;if(i&&(n=this.columnModel.getPrimaryColumn(i.getColId())),i&&!n)return;const s=this.getMasterColumns(e);switch(e.type){case ct.EVENT_COLUMN_MOVED:{const t=e,i=e.api.getColumnState().map(e=>({colId:e.colId}));this.columnModel.applyColumnState({state:i,applyOrder:!0},"alignedGridChanged"),this.logger.log(`onColumnEvent-> processing ${e.type} toIndex = ${t.toIndex}`)}break;case ct.EVENT_COLUMN_VISIBLE:{const t=e,i=e.api.getColumnState().map(e=>({colId:e.colId,hide:e.hide}));this.columnModel.applyColumnState({state:i},"alignedGridChanged"),this.logger.log(`onColumnEvent-> processing ${e.type} visible = ${t.visible}`)}break;case ct.EVENT_COLUMN_PINNED:{const t=e,i=e.api.getColumnState().map(e=>({colId:e.colId,pinned:e.pinned}));this.columnModel.applyColumnState({state:i},"alignedGridChanged"),this.logger.log(`onColumnEvent-> processing ${e.type} pinned = ${t.pinned}`)}break;case ct.EVENT_COLUMN_RESIZED:const i=e,n={};s.forEach(t=>{this.logger.log(`onColumnEvent-> processing ${e.type} actualWidth = ${t.getActualWidth()}`),n[t.getId()]={key:t.getColId(),newWidth:t.getActualWidth()}}),null==(t=i.flexColumns)||t.forEach(e=>{n[e.getId()]&&delete n[e.getId()]}),this.columnModel.setColumnWidths(Object.values(n),!1,i.finished,"alignedGridChanged")}const r=this.ctrlsService.getGridBodyCtrl().isVerticalScrollShowing();this.getAlignedGridApis().forEach(e=>{e.setGridOption("alwaysShowVerticalScroll",r)})}};f([ue("columnModel")],lc.prototype,"columnModel",2),f([ue("ctrlsService")],lc.prototype,"ctrlsService",2),f([m(0,ge("loggerFactory"))],lc.prototype,"setBeans",1),f([le],lc.prototype,"init",1),lc=f([he("alignedGridsService")],lc);var cc=class extends st{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,ct.EVENT_ROW_SELECTED,this.onRowSelected.bind(this))}destroy(){super.destroy(),this.resetNodes(),this.lastRowNode=null}isMultiselect(){return"multiple"===this.rowSelection}setNodesSelected(e){var t;const{newValue:i,clearSelection:n,suppressFinishActions:s,rangeSelect:r,nodes:o,event:a,source:l="api"}=e;if(0===o.length)return 0;if(o.length>1&&!this.isMultiselect())return console.warn("AG Grid: cannot multi select while rowSelection='single'"),0;const c=this.groupSelectsChildren&&!0===e.groupSelectsFiltered,h=o.map(e=>e.footer?e.sibling:e);if(r){if(o.length>1)return console.warn("AG Grid: cannot range select while selecting multiple rows"),0;let e=null;if("checkboxSelected"===l&&!1===i&&this.lastRowNode&&(this.lastRowNode.id?e=this.lastRowNode:this.lastRowNode=null),null==e&&(e=this.getLastSelectedNode()),e){const t=h[0];if(t!==e&&this.isMultiselect())return this.selectRange(t,e,i,l)}}this.lastRowNode=i?null:h[0];let u=0;for(let e=0;e<h.length;e++){const n=h[e];c&&n.group||n.selectThisNode(i,a,l)&&u++,this.groupSelectsChildren&&(null==(t=n.childrenAfterGroup)?void 0:t.length)&&(u+=this.selectChildren(n,i,c,l))}if(!s&&(i&&(n||!this.isMultiselect())&&(u+=this.clearOtherNodes(h[0],l)),u>0)){this.updateGroupsFromChildrenSelections(l);const e={type:ct.EVENT_SELECTION_CHANGED,source:l};this.eventService.dispatchEvent(e)}return u}selectRange(e,t,i=!0,n){const s=this.rowModel.getNodesInRangeForSelection(e,t);let r=0;s.forEach(e=>{e.group&&this.groupSelectsChildren||e.selectThisNode(i,void 0,n)&&r++}),this.updateGroupsFromChildrenSelections(n);const o={type:ct.EVENT_SELECTION_CHANGED,source:n};return this.eventService.dispatchEvent(o),r}selectChildren(e,t,i,n){const s=i?e.childrenAfterAggFilter:e.childrenAfterGroup;return C(s)?0:this.setNodesSelected({newValue:t,clearSelection:!1,suppressFinishActions:!0,groupSelectsFiltered:i,source:n,nodes:s})}getLastSelectedNode(){const e=Array.from(this.selectedNodes.keys());if(0==e.length)return null;return this.selectedNodes.get(Ie(e))||null}getSelectedNodes(){const e=[];return this.selectedNodes.forEach(t=>{t&&e.push(t)}),e}getSelectedRows(){const e=[];return this.selectedNodes.forEach(t=>{t&&t.data&&e.push(t.data)}),e}getSelectionCount(){return this.selectedNodes.size}filterFromSelection(e){const t=new Map;this.selectedNodes.forEach((i,n)=>{i&&e(i)&&t.set(n,i)}),this.selectedNodes=t}updateGroupsFromChildrenSelections(e,t){if(!this.groupSelectsChildren)return!1;if("clientSide"!==this.rowModel.getType())return!1;const i=this.rowModel.getRootNode();t||(t=new Sl(!0,i)).setInactive();let n=!1;return t.forEachChangedNodeDepthFirst(t=>{if(t!==i){const i=t.calculateSelectedFromChildren();n=t.selectThisNode(null!==i&&i,void 0,e)||n}}),n}clearOtherNodes(e,t){const i=new Map;let n=0;return this.selectedNodes.forEach(s=>{if(s&&s.id!==e.id){const e=this.selectedNodes.get(s.id);n+=e.setSelectedParams({newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:t}),this.groupSelectsChildren&&s.parent&&i.set(s.parent.id,s.parent)}}),i.forEach(e=>{const i=e.calculateSelectedFromChildren();e.selectThisNode(null!==i&&i,void 0,t)}),n}onRowSelected(e){const t=e.node;this.groupSelectsChildren&&t.group||(t.isSelected()?this.selectedNodes.set(t.id,t):this.selectedNodes.delete(t.id))}syncInRowNode(e,t){this.syncInOldRowNode(e,t),this.syncInNewRowNode(e)}syncInOldRowNode(e,t){if(b(t)&&e.id!==t.id&&t){const i=t.id;this.selectedNodes.get(i)==e&&this.selectedNodes.set(t.id,t)}}syncInNewRowNode(e){this.selectedNodes.has(e.id)?(e.setSelectedInitialValue(!0),this.selectedNodes.set(e.id,e)):e.setSelectedInitialValue(!1)}reset(e){const t=this.getSelectionCount();if(this.resetNodes(),t){const t={type:ct.EVENT_SELECTION_CHANGED,source:e};this.eventService.dispatchEvent(t)}}resetNodes(){var e;null==(e=this.selectedNodes)||e.clear()}getBestCostNodeSelection(){if("clientSide"!==this.rowModel.getType())return;const e=this.rowModel.getTopLevelNodes();if(null===e)return;const t=[];return function e(i){for(let n=0,s=i.length;n<s;n++){const s=i[n];if(s.isSelected())t.push(s);else{const t=s;t.group&&t.children&&e(t.children)}}}(e),t}isEmpty(){let e=0;return this.selectedNodes.forEach(t=>{t&&e++}),0===e}deselectAllRowNodes(e){const t=e=>e.selectThisNode(!1,void 0,n),i="clientSide"===this.rowModel.getType(),{source:n,justFiltered:s,justCurrentPage:r}=e;if(r||s){if(!i)return void console.error("AG Grid: selecting just filtered only works when gridOptions.rowModelType='clientSide'");this.getNodesToSelect(s,r).forEach(t)}else this.selectedNodes.forEach(e=>{e&&t(e)}),this.reset(n);i&&this.groupSelectsChildren&&this.updateGroupsFromChildrenSelections(n);const o={type:ct.EVENT_SELECTION_CHANGED,source:n};this.eventService.dispatchEvent(o)}getSelectedCounts(e,t){let i=0,n=0;return this.getNodesToSelect(e,t).forEach(e=>{this.groupSelectsChildren&&e.group||(e.isSelected()?i++:e.selectable&&n++)}),{selectedCount:i,notSelectedCount:n}}getSelectAllState(e,t){const{selectedCount:i,notSelectedCount:n}=this.getSelectedCounts(e,t);return(0!==i||0!==n)&&(i>0&&n>0?null:i>0)}hasNodesToSelect(e=!1,t=!1){return this.getNodesToSelect(e,t).filter(e=>e.selectable).length>0}getNodesToSelect(e=!1,t=!1){if("clientSide"!==this.rowModel.getType())throw new Error(`selectAll only available when rowModelType='clientSide', ie not ${this.rowModel.getType()}`);const i=[];if(t)return this.paginationProxy.forEachNodeOnPage(e=>{if(e.group){if(!e.expanded){const t=e=>{var n;i.push(e),(null==(n=e.childrenAfterFilter)?void 0:n.length)&&e.childrenAfterFilter.forEach(t)};return void t(e)}this.groupSelectsChildren||i.push(e)}else i.push(e)}),i;const n=this.rowModel;return e?(n.forEachNodeAfterFilter(e=>{i.push(e)}),i):(n.forEachNode(e=>{i.push(e)}),i)}selectAllRowNodes(e){if("clientSide"!==this.rowModel.getType())throw new Error(`selectAll only available when rowModelType='clientSide', ie not ${this.rowModel.getType()}`);const{source:t,justFiltered:i,justCurrentPage:n}=e;this.getNodesToSelect(i,n).forEach(e=>e.selectThisNode(!0,void 0,t)),"clientSide"===this.rowModel.getType()&&this.groupSelectsChildren&&this.updateGroupsFromChildrenSelections(t);const s={type:ct.EVENT_SELECTION_CHANGED,source:t};this.eventService.dispatchEvent(s)}getSelectionState(){const e=[];return this.selectedNodes.forEach(t=>{(null==t?void 0:t.id)&&e.push(t.id)}),e.length?e:null}setSelectionState(e,t){if(!Array.isArray(e))return;const i=new Set(e),n=[];this.rowModel.forEachNode(e=>{i.has(e.id)&&n.push(e)}),this.setNodesSelected({newValue:!0,nodes:n,source:t})}};f([ue("rowModel")],cc.prototype,"rowModel",2),f([ue("paginationProxy")],cc.prototype,"paginationProxy",2),f([le],cc.prototype,"init",1),cc=f([he("selectionService")],cc);var hc=class{constructor(e){this.viaApi=(e,...t)=>(z(`Since v31, 'columnApi.${e}' is deprecated and moved to 'api.${e}'.`),this.api[e](...t)),this.api=e}sizeColumnsToFit(e){this.viaApi("sizeColumnsToFit",e)}setColumnGroupOpened(e,t){this.viaApi("setColumnGroupOpened",e,t)}getColumnGroup(e,t){return this.viaApi("getColumnGroup",e,t)}getProvidedColumnGroup(e){return this.viaApi("getProvidedColumnGroup",e)}getDisplayNameForColumn(e,t){return this.viaApi("getDisplayNameForColumn",e,t)}getDisplayNameForColumnGroup(e,t){return this.viaApi("getDisplayNameForColumnGroup",e,t)}getColumn(e){return this.viaApi("getColumn",e)}getColumns(){return this.viaApi("getColumns")}applyColumnState(e){return this.viaApi("applyColumnState",e)}getColumnState(){return this.viaApi("getColumnState")}resetColumnState(){this.viaApi("resetColumnState")}getColumnGroupState(){return this.viaApi("getColumnGroupState")}setColumnGroupState(e){this.viaApi("setColumnGroupState",e)}resetColumnGroupState(){this.viaApi("resetColumnGroupState")}isPinning(){return this.viaApi("isPinning")}isPinningLeft(){return this.viaApi("isPinningLeft")}isPinningRight(){return this.viaApi("isPinningRight")}getDisplayedColAfter(e){return this.viaApi("getDisplayedColAfter",e)}getDisplayedColBefore(e){return this.viaApi("getDisplayedColBefore",e)}setColumnVisible(e,t){this.viaApi("setColumnVisible",e,t)}setColumnsVisible(e,t){this.viaApi("setColumnsVisible",e,t)}setColumnPinned(e,t){this.viaApi("setColumnPinned",e,t)}setColumnsPinned(e,t){this.viaApi("setColumnsPinned",e,t)}getAllGridColumns(){return this.viaApi("getAllGridColumns")}getDisplayedLeftColumns(){return this.viaApi("getDisplayedLeftColumns")}getDisplayedCenterColumns(){return this.viaApi("getDisplayedCenterColumns")}getDisplayedRightColumns(){return this.viaApi("getDisplayedRightColumns")}getAllDisplayedColumns(){return this.viaApi("getAllDisplayedColumns")}getAllDisplayedVirtualColumns(){return this.viaApi("getAllDisplayedVirtualColumns")}moveColumn(e,t){this.viaApi("moveColumn",e,t)}moveColumnByIndex(e,t){this.viaApi("moveColumnByIndex",e,t)}moveColumns(e,t){this.viaApi("moveColumns",e,t)}moveRowGroupColumn(e,t){this.viaApi("moveRowGroupColumn",e,t)}setColumnAggFunc(e,t){this.viaApi("setColumnAggFunc",e,t)}setColumnWidth(e,t,i=!0,n){this.viaApi("setColumnWidth",e,t,i,n)}setColumnWidths(e,t=!0,i){this.viaApi("setColumnWidths",e,t,i)}setPivotMode(e){this.viaApi("setPivotMode",e)}isPivotMode(){return this.viaApi("isPivotMode")}getPivotResultColumn(e,t){return this.viaApi("getPivotResultColumn",e,t)}setValueColumns(e){this.viaApi("setValueColumns",e)}getValueColumns(){return this.viaApi("getValueColumns")}removeValueColumn(e){this.viaApi("removeValueColumn",e)}removeValueColumns(e){this.viaApi("removeValueColumns",e)}addValueColumn(e){this.viaApi("addValueColumn",e)}addValueColumns(e){this.viaApi("addValueColumns",e)}setRowGroupColumns(e){this.viaApi("setRowGroupColumns",e)}removeRowGroupColumn(e){this.viaApi("removeRowGroupColumn",e)}removeRowGroupColumns(e){this.viaApi("removeRowGroupColumns",e)}addRowGroupColumn(e){this.viaApi("addRowGroupColumn",e)}addRowGroupColumns(e){this.viaApi("addRowGroupColumns",e)}getRowGroupColumns(){return this.viaApi("getRowGroupColumns")}setPivotColumns(e){this.viaApi("setPivotColumns",e)}removePivotColumn(e){this.viaApi("removePivotColumn",e)}removePivotColumns(e){this.viaApi("removePivotColumns",e)}addPivotColumn(e){this.viaApi("addPivotColumn",e)}addPivotColumns(e){this.viaApi("addPivotColumns",e)}getPivotColumns(){return this.viaApi("getPivotColumns")}getLeftDisplayedColumnGroups(){return this.viaApi("getLeftDisplayedColumnGroups")}getCenterDisplayedColumnGroups(){return this.viaApi("getCenterDisplayedColumnGroups")}getRightDisplayedColumnGroups(){return this.viaApi("getRightDisplayedColumnGroups")}getAllDisplayedColumnGroups(){return this.viaApi("getAllDisplayedColumnGroups")}autoSizeColumn(e,t){return this.viaApi("autoSizeColumn",e,t)}autoSizeColumns(e,t){this.viaApi("autoSizeColumns",e,t)}autoSizeAllColumns(e){this.viaApi("autoSizeAllColumns",e)}setPivotResultColumns(e){this.viaApi("setPivotResultColumns",e)}getPivotResultColumns(){return this.viaApi("getPivotResultColumns")}};f([ue("gridApi")],hc.prototype,"api",2),hc=f([he("columnApi")],hc);var uc=class extends st{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 e=e=>this.callColumnCellValueChangedHandler(e),t=this.gos.useAsyncEvents();this.eventService.addEventListener(ct.EVENT_CELL_VALUE_CHANGED,e,t),this.addDestroyFunc(()=>this.eventService.removeEventListener(ct.EVENT_CELL_VALUE_CHANGED,e,t)),this.addManagedPropertyListener("treeData",e=>this.isTreeData=e.currentValue)}getValue(e,t,i=!1,n=!1){if(this.initialised||this.init(),!t)return;const s=e.getColDef(),r=s.field,o=e.getColId(),a=t.data;let l;const c=t.groupData&&void 0!==t.groupData[o],h=!n&&t.aggData&&void 0!==t.aggData[o],u=this.isSsrm&&n&&!!e.getColDef().aggFunc,d=this.isSsrm&&t.footer&&t.field&&(!0===e.getColDef().showRowGroup||e.getColDef().showRowGroup===t.field);if(i&&s.filterValueGetter?l=this.executeFilterValueGetter(s.filterValueGetter,a,e,t):this.isTreeData&&h?l=t.aggData[o]:this.isTreeData&&s.valueGetter?l=this.executeValueGetter(s.valueGetter,a,e,t):this.isTreeData&&r&&a?l=F(a,r,e.isFieldContainsDots()):c?l=t.groupData[o]:h?l=t.aggData[o]:s.valueGetter?l=this.executeValueGetter(s.valueGetter,a,e,t):d?l=F(a,t.field,e.isFieldContainsDots()):r&&a&&!u&&(l=F(a,r,e.isFieldContainsDots())),this.cellExpressions&&"string"==typeof l&&0===l.indexOf("=")){const i=l.substring(1);l=this.executeValueGetter(i,a,e,t)}if(null==l){const i=this.getOpenedGroup(t,e);if(null!=i)return i}return l}parseValue(e,t,i,n){const s=e.getColDef(),r=this.gos.addGridCommonParams({node:t,data:null==t?void 0:t.data,oldValue:n,newValue:i,colDef:s,column:e}),o=s.valueParser;return b(o)?"function"==typeof o?o(r):this.expressionService.evaluate(o,r):i}formatValue(e,t,i,n,s=!0){let r,o=null;const a=e.getColDef();if(n?r=n:s&&(r=a.valueFormatter),r){const n=this.gos.addGridCommonParams({value:i,node:t,data:t?t.data:null,colDef:a,column:e});o="function"==typeof r?r(n):this.expressionService.evaluate(r,n)}else if(a.refData)return a.refData[i]||"";return null==o&&Array.isArray(i)&&(o=i.join(", ")),o}getOpenedGroup(e,t){if(!this.gos.get("showOpenedGroup"))return;if(!t.getColDef().showRowGroup)return;const i=t.getColDef().showRowGroup;let n=e.parent;for(;null!=n;){if(n.rowGroupColumn&&(!0===i||i===n.rowGroupColumn.getColId()))return n.key;n=n.parent}}setValue(e,t,i,n){const s=this.columnModel.getPrimaryColumn(t);if(!e||!s)return!1;C(e.data)&&(e.data={});const{field:r,valueSetter:o}=s.getColDef();if(C(r)&&C(o))return console.warn("AG Grid: you need either field or valueSetter set on colDef for editing to work"),!1;if(!this.dataTypeService.checkType(s,i))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:e,data:e.data,oldValue:this.getValue(s,e),newValue:i,colDef:s.getColDef(),column:s});let l;if(a.newValue=i,l=b(o)?"function"==typeof o?o(a):this.expressionService.evaluate(o,a):this.setValueUsingField(e.data,r,i,s.isFieldContainsDots()),void 0===l&&(l=!0),!l)return!1;e.resetQuickFilterAggregateText(),this.valueCache.onDataChanged(),a.newValue=this.getValue(s,e);const c={type:ct.EVENT_CELL_VALUE_CHANGED,event:null,rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:a.column,api:a.api,columnApi:a.columnApi,colDef:a.colDef,context:a.context,data:e.data,node:e,oldValue:a.oldValue,newValue:a.newValue,value:a.newValue,source:n};return this.eventService.dispatchEvent(c),!0}callColumnCellValueChangedHandler(e){const t=e.colDef.onCellValueChanged;"function"==typeof t&&this.getFrameworkOverrides().wrapOutgoing(()=>{t({node:e.node,data:e.data,oldValue:e.oldValue,newValue:e.newValue,colDef:e.colDef,column:e.column,api:e.api,columnApi:e.columnApi,context:e.context})})}setValueUsingField(e,t,i,n){if(!t)return!1;let s=!1;if(n){const n=t.split(".");let r=e;for(;n.length>0&&r;){const e=n.shift();0===n.length?(s=r[e]===i,s||(r[e]=i)):r=r[e]}}else s=e[t]===i,s||(e[t]=i);return!s}executeFilterValueGetter(e,t,i,n){const s=this.gos.addGridCommonParams({data:t,node:n,column:i,colDef:i.getColDef(),getValue:this.getValueCallback.bind(this,n)});return"function"==typeof e?e(s):this.expressionService.evaluate(e,s)}executeValueGetter(e,t,i,n){const s=i.getColId(),r=this.valueCache.getValue(n,s);if(void 0!==r)return r;const o=this.gos.addGridCommonParams({data:t,node:n,column:i,colDef:i.getColDef(),getValue:this.getValueCallback.bind(this,n)});let a;return a="function"==typeof e?e(o):this.expressionService.evaluate(e,o),this.valueCache.setValue(n,s,a),a}getValueCallback(e,t){const i=this.columnModel.getPrimaryColumn(t);return i?this.getValue(i,e):null}getKeyForNode(e,t){const i=this.getValue(e,t),n=e.getColDef().keyCreator;let s=i;return n&&(s=n(this.gos.addGridCommonParams({value:i,colDef:e.getColDef(),column:e,node:t,data:t.data}))),"string"==typeof s||null==s||(s=String(s),"[object Object]"===s&&z("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")),s}};f([ue("expressionService")],uc.prototype,"expressionService",2),f([ue("columnModel")],uc.prototype,"columnModel",2),f([ue("valueCache")],uc.prototype,"valueCache",2),f([ue("dataTypeService")],uc.prototype,"dataTypeService",2),f([le],uc.prototype,"init",1),uc=f([he("valueService")],uc);var dc=class extends st{constructor(){super(...arguments),this.expressionToFunctionCache={}}setBeans(e){this.logger=e.create("ExpressionService")}evaluate(e,t){if("string"==typeof e)return this.evaluateExpression(e,t);console.error("AG Grid: value should be either a string or a function",e)}evaluateExpression(e,t){try{return this.createExpressionFunction(e)(t.value,t.context,t.oldValue,t.newValue,t.value,t.node,t.data,t.colDef,t.rowIndex,t.api,t.columnApi,t.getValue,t.column,t.columnGroup)}catch(i){return console.log("Processing of the expression failed"),console.log("Expression = "+e),console.log("Params =",t),console.log("Exception = "+i),null}}createExpressionFunction(e){if(this.expressionToFunctionCache[e])return this.expressionToFunctionCache[e];const t=this.createFunctionBody(e),i=new Function("x, ctx, oldValue, newValue, value, node, data, colDef, rowIndex, api, columnApi, getValue, column, columnGroup",t);return this.expressionToFunctionCache[e]=i,i}createFunctionBody(e){return e.indexOf("return")>=0?e:"return "+e+";"}};f([m(0,ge("loggerFactory"))],dc.prototype,"setBeans",1),dc=f([he("expressionService")],dc);var pc=class extends st{setBeans(e){this.logging=e.get("debug")}create(e){return new gc(e,this.isLogging.bind(this))}isLogging(){return this.logging}};f([m(0,ge("gridOptionsService"))],pc.prototype,"setBeans",1),pc=f([he("loggerFactory")],pc);var gc=class{constructor(e,t){this.name=e,this.isLoggingFunc=t}isLogging(){return this.isLoggingFunc()}log(e){this.isLoggingFunc()&&console.log("AG Grid."+this.name+": "+e)}},fc=class extends st{setComp(e,t,i){this.view=e,this.eGridHostDiv=t,this.eGui=i,this.eGui.setAttribute("grid-id",this.context.getGridId()),this.dragAndDropService.addDropTarget({getContainer:()=>this.eGui,isInterestedIn:e=>1===e||0===e,getIconName:()=>Lr.ICON_NOT_ALLOWED}),this.mouseEventService.stampTopLevelGridCompWithGridInstance(t),this.createManagedBean(new zo(this.view)),this.addRtlSupport();const n=this.resizeObserverService.observeResize(this.eGridHostDiv,this.onGridSizeChanged.bind(this));this.addDestroyFunc(()=>n()),this.ctrlsService.register("gridCtrl",this)}isDetailGrid(){var e;const t=this.focusService.findTabbableParent(this.getGui());return(null==(e=null==t?void 0:t.getAttribute("row-id"))?void 0:e.startsWith("detail"))||!1}showDropZones(){return re.__isRegistered("@ag-grid-enterprise/row-grouping",this.context.getGridId())}showSideBar(){return re.__isRegistered("@ag-grid-enterprise/side-bar",this.context.getGridId())}showStatusBar(){return re.__isRegistered("@ag-grid-enterprise/status-bar",this.context.getGridId())}showWatermark(){return re.__isRegistered("@ag-grid-enterprise/core",this.context.getGridId())}onGridSizeChanged(){const e={type:ct.EVENT_GRID_SIZE_CHANGED,clientWidth:this.eGridHostDiv.clientWidth,clientHeight:this.eGridHostDiv.clientHeight};this.eventService.dispatchEvent(e)}addRtlSupport(){const e=this.gos.get("enableRtl")?"ag-rtl":"ag-ltr";this.view.setRtlClass(e)}destroyGridUi(){this.view.destroyGridUi()}getGui(){return this.eGui}setResizeCursor(e){this.view.setCursor(e?"ew-resize":null)}disableUserSelect(e){this.view.setUserSelect(e?"none":null)}focusNextInnerContainer(e){const t=this.view.getFocusableContainers(),i=this.gos.getActiveDomElement(),n=t.findIndex(e=>e.contains(i))+(e?-1:1);return!(n<=0||n>=t.length)&&this.focusService.focusInto(t[n])}focusInnerElement(e){const t=this.view.getFocusableContainers(),i=this.columnModel.getAllDisplayedColumns();if(e){if(t.length>1)return this.focusService.focusInto(Ie(t),!0);const e=Ie(i);if(this.focusService.focusGridView(e,!0))return!0}if(0===this.gos.get("headerHeight")||this.gos.get("suppressHeaderFocus")){if(this.focusService.focusGridView(i[0]))return!0;for(let e=1;e<t.length;e++)if(this.focusService.focusInto(t[e]))return!0;return!1}return this.focusService.focusFirstHeader()}forceFocusOutOfContainer(e=!1){this.view.forceFocusOutOfContainer(e)}};f([ue("focusService")],fc.prototype,"focusService",2),f([ue("resizeObserverService")],fc.prototype,"resizeObserverService",2),f([ue("columnModel")],fc.prototype,"columnModel",2),f([ue("ctrlsService")],fc.prototype,"ctrlsService",2),f([ue("mouseEventService")],fc.prototype,"mouseEventService",2),f([ue("dragAndDropService")],fc.prototype,"dragAndDropService",2);var mc=class extends ul{constructor(e){super(),this.eGridDiv=e}postConstruct(){this.logger=this.loggerFactory.create("GridComp");const e={destroyGridUi:()=>this.destroyBean(this),setRtlClass:e=>this.addCssClass(e),forceFocusOutOfContainer:this.forceFocusOutOfContainer.bind(this),updateLayoutClasses:this.updateLayoutClasses.bind(this),getFocusableContainers:this.getFocusableContainers.bind(this),setUserSelect:e=>{this.getGui().style.userSelect=null!=e?e:"",this.getGui().style.webkitUserSelect=null!=e?e:""},setCursor:e=>{this.getGui().style.cursor=null!=e?e:""}};this.ctrl=this.createManagedBean(new fc);const t=this.createTemplate();this.setTemplate(t),this.ctrl.setComp(e,this.eGridDiv,this.getGui()),this.insertGridIntoDom(),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:e=>this.ctrl.focusInnerElement(e),forceFocusOutWhenTabGuardsAreEmpty:!0})}insertGridIntoDom(){const e=this.getGui();this.eGridDiv.appendChild(e),this.addDestroyFunc(()=>{this.eGridDiv.removeChild(e),this.logger.log("Grid removed from DOM")})}updateLayoutClasses(e,t){const i=this.eRootWrapperBody.classList;i.toggle("ag-layout-auto-height",t.autoHeight),i.toggle("ag-layout-normal",t.normal),i.toggle("ag-layout-print",t.print),this.addOrRemoveCssClass("ag-layout-auto-height",t.autoHeight),this.addOrRemoveCssClass("ag-layout-normal",t.normal),this.addOrRemoveCssClass("ag-layout-print",t.print)}createTemplate(){return`<div class="ag-root-wrapper" role="presentation">\n                ${this.ctrl.showDropZones()?"<ag-grid-header-drop-zones></ag-grid-header-drop-zones>":""}\n                <div class="ag-root-wrapper-body" ref="rootWrapperBody" role="presentation">\n                    <ag-grid-body ref="gridBody"></ag-grid-body>\n                    ${this.ctrl.showSideBar()?'<ag-side-bar ref="sideBar"></ag-side-bar>':""}\n                </div>\n                ${this.ctrl.showStatusBar()?'<ag-status-bar ref="statusBar"></ag-status-bar>':""}\n                <ag-pagination></ag-pagination>\n                ${this.ctrl.showWatermark()?"<ag-watermark></ag-watermark>":""}\n            </div>`}getFocusableElement(){return this.eRootWrapperBody}getFocusableContainers(){const e=[this.gridBodyComp.getGui()];return this.sideBarComp&&e.push(this.sideBarComp.getGui()),e.filter(e=>xn(e))}};f([ue("loggerFactory")],mc.prototype,"loggerFactory",2),f([bs("gridBody")],mc.prototype,"gridBodyComp",2),f([bs("sideBar")],mc.prototype,"sideBarComp",2),f([bs("rootWrapperBody")],mc.prototype,"eRootWrapperBody",2),f([le],mc.prototype,"postConstruct",1);var yc=class extends st{progressSort(e,t,i){const n=this.getNextSortDirection(e);this.setSortForColumn(e,n,t,i)}setSortForColumn(e,t,i,n){"asc"!==t&&"desc"!==t&&(t=null);let s=[e];if(this.gos.isColumnsSortingCoupledToGroup()&&e.getColDef().showRowGroup){const t=this.columnModel.getSourceColumnsForGroupColumn(e),i=null==t?void 0:t.filter(e=>e.isSortable());i&&(s=[e,...i])}s.forEach(e=>e.setSort(t,n));const r=[];if(!i&&!this.gos.get("alwaysMultiSort")||this.gos.get("suppressMultiSort")){const e=this.clearSortBarTheseColumns(s,n);r.push(...e)}this.updateSortIndex(e),r.push(...s),this.dispatchSortChangedEvents(n,r)}updateSortIndex(e){const t=this.gos.isColumnsSortingCoupledToGroup(),i=this.columnModel.getGroupDisplayColumnForGroup(e.getId()),n=t&&i||e,s=this.getColumnsWithSortingOrdered();this.columnModel.getPrimaryAndSecondaryAndAutoColumns().forEach(e=>e.setSortIndex(null));const r=s.filter(e=>!(t&&e.getColDef().showRowGroup||e===n));(n.getSort()?[...r,n]:r).forEach((e,t)=>{e.setSortIndex(t)})}onSortChanged(e,t){this.dispatchSortChangedEvents(e,t)}isSortActive(){const e=this.columnModel.getPrimaryAndSecondaryAndAutoColumns().filter(e=>!!e.getSort());return e&&e.length>0}dispatchSortChangedEvents(e,t){const i={type:ct.EVENT_SORT_CHANGED,source:e};t&&(i.columns=t),this.eventService.dispatchEvent(i)}clearSortBarTheseColumns(e,t){const i=[];return this.columnModel.getPrimaryAndSecondaryAndAutoColumns().forEach(n=>{e.includes(n)||(n.getSort()&&i.push(n),n.setSort(void 0,t))}),i}getNextSortDirection(e){let t;if(t=e.getColDef().sortingOrder?e.getColDef().sortingOrder:this.gos.get("sortingOrder")?this.gos.get("sortingOrder"):yc.DEFAULT_SORTING_ORDER,!Array.isArray(t)||t.length<=0)return console.warn(`AG Grid: sortingOrder must be an array with at least one element, currently it's ${t}`),null;const i=t.indexOf(e.getSort()),n=i<0,s=i==t.length-1;let r;return r=n||s?t[0]:t[i+1],yc.DEFAULT_SORTING_ORDER.indexOf(r)<0?(console.warn("AG Grid: invalid sort type "+r),null):r}getIndexedSortMap(){let e=this.columnModel.getPrimaryAndSecondaryAndAutoColumns().filter(e=>!!e.getSort());if(this.columnModel.isPivotMode()){const t=this.gos.isColumnsSortingCoupledToGroup();e=e.filter(e=>{const i=!!e.getAggFunc(),n=!e.isPrimary(),s=t?this.columnModel.getGroupDisplayColumnForGroup(e.getId()):e.getColDef().showRowGroup;return i||n||s})}const t=this.columnModel.getRowGroupColumns().filter(e=>!!e.getSort()),i={};e.forEach((e,t)=>i[e.getId()]=t),e.sort((e,t)=>{const n=e.getSortIndex(),s=t.getSortIndex();return null!=n&&null!=s?n-s:null==n&&null==s?i[e.getId()]>i[t.getId()]?1:-1:null==s?-1:1});const n=this.gos.isColumnsSortingCoupledToGroup()&&!!t.length;n&&(e=[...new Set(e.map(e=>{var t;return null!=(t=this.columnModel.getGroupDisplayColumnForGroup(e.getId()))?t:e}))]);const s=new Map;return e.forEach((e,t)=>s.set(e,t)),n&&t.forEach(e=>{const t=this.columnModel.getGroupDisplayColumnForGroup(e.getId());s.set(e,s.get(t))}),s}getColumnsWithSortingOrdered(){return[...this.getIndexedSortMap().entries()].sort(([e,t],[i,n])=>t-n).map(([e])=>e)}getSortModel(){return this.getColumnsWithSortingOrdered().filter(e=>e.getSort()).map(e=>({sort:e.getSort(),colId:e.getId()}))}getSortOptions(){return this.getColumnsWithSortingOrdered().filter(e=>e.getSort()).map(e=>({sort:e.getSort(),column:e}))}canColumnDisplayMixedSort(e){const t=this.gos.isColumnsSortingCoupledToGroup(),i=!!e.getColDef().showRowGroup;return t&&i}getDisplaySortForColumn(e){const t=this.columnModel.getSourceColumnsForGroupColumn(e);if(!this.canColumnDisplayMixedSort(e)||!(null==t?void 0:t.length))return e.getSort();const i=null!=e.getColDef().field||e.getColDef().valueGetter?[e,...t]:t,n=i[0].getSort();return i.every(e=>e.getSort()==n)?n:"mixed"}getDisplaySortIndexForColumn(e){return this.getIndexedSortMap().get(e)}};yc.DEFAULT_SORTING_ORDER=["asc","desc",null],f([ue("columnModel")],yc.prototype,"columnModel",2),yc=f([he("sortController")],yc);var vc=class extends st{static addKeyboardModeEvents(e){this.instanceCount>0||(e.addEventListener("keydown",vc.toggleKeyboardMode),e.addEventListener("mousedown",vc.toggleKeyboardMode))}static removeKeyboardModeEvents(e){this.instanceCount>0||(e.addEventListener("keydown",vc.toggleKeyboardMode),e.addEventListener("mousedown",vc.toggleKeyboardMode))}static toggleKeyboardMode(e){const t=vc.keyboardModeActive,i="keydown"===e.type;i&&(e.ctrlKey||e.metaKey||e.altKey)||t!==i&&(vc.keyboardModeActive=i)}static unregisterGridCompController(e){vc.removeKeyboardModeEvents(e)}init(){const e=this.clearFocusedCell.bind(this);this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PIVOT_MODE_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_NEW_COLUMNS_LOADED,this.onColumnEverythingChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_GROUP_OPENED,e),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_ROW_GROUP_CHANGED,e),this.registerKeyboardFocusEvents(),this.ctrlsService.whenReady(e=>{this.gridCtrl=e.gridCtrl})}registerKeyboardFocusEvents(){const e=this.gos.getDocument();vc.addKeyboardModeEvents(e),vc.instanceCount++,this.addDestroyFunc(()=>{vc.instanceCount--,vc.unregisterGridCompController(e)})}onColumnEverythingChanged(){if(!this.focusedCellPosition)return;const e=this.focusedCellPosition.column,t=this.columnModel.getGridColumn(e.getId());e!==t&&this.clearFocusedCell()}isKeyboardMode(){return vc.keyboardModeActive}getFocusCellToUseAfterRefresh(){return this.gos.get("suppressFocusAfterRefresh")||!this.focusedCellPosition||this.isDomDataMissingInHierarchy(this.gos.getActiveDomElement(),aa.DOM_DATA_KEY_ROW_CTRL)?null:this.focusedCellPosition}getFocusHeaderToUseAfterRefresh(){return this.gos.get("suppressFocusAfterRefresh")||!this.focusedHeaderPosition||this.isDomDataMissingInHierarchy(this.gos.getActiveDomElement(),Ua.DOM_DATA_KEY_HEADER_CTRL)?null:this.focusedHeaderPosition}isDomDataMissingInHierarchy(e,t){let i=e;for(;i;){if(this.gos.getDomData(i,t))return!1;i=i.parentNode}return!0}getFocusedCell(){return this.focusedCellPosition}shouldRestoreFocus(e){return!!this.isCellRestoreFocused(e)&&(setTimeout(()=>{this.restoredFocusedCellPosition=null},0),!0)}isCellRestoreFocused(e){return null!=this.restoredFocusedCellPosition&&this.cellPositionUtils.equals(e,this.restoredFocusedCellPosition)}setRestoreFocusedCell(e){"react"===this.getFrameworkOverrides().renderingEngine&&(this.restoredFocusedCellPosition=e)}getFocusEventParams(){const{rowIndex:e,rowPinned:t,column:i}=this.focusedCellPosition,n={rowIndex:e,rowPinned:t,column:i,isFullWidthCell:!1},s=this.rowRenderer.getRowByPosition({rowIndex:e,rowPinned:t});return s&&(n.isFullWidthCell=s.isFullWidth()),n}clearFocusedCell(){if(this.restoredFocusedCellPosition=null,null==this.focusedCellPosition)return;const e=d({type:ct.EVENT_CELL_FOCUS_CLEARED},this.getFocusEventParams());this.focusedCellPosition=null,this.eventService.dispatchEvent(e)}setFocusedCell(e){const{column:t,rowIndex:i,rowPinned:n,forceBrowserFocus:s=!1,preventScrollOnBrowserFocus:r=!1}=e,o=this.columnModel.getGridColumn(t);if(!o)return void(this.focusedCellPosition=null);this.focusedCellPosition=o?{rowIndex:i,rowPinned:v(n),column:o}:null;const a=p(d({type:ct.EVENT_CELL_FOCUSED},this.getFocusEventParams()),{forceBrowserFocus:s,preventScrollOnBrowserFocus:r,floating:null});this.eventService.dispatchEvent(a)}isCellFocused(e){return null!=this.focusedCellPosition&&this.cellPositionUtils.equals(e,this.focusedCellPosition)}isRowNodeFocused(e){return this.isRowFocused(e.rowIndex,e.rowPinned)}isHeaderWrapperFocused(e){if(null==this.focusedHeaderPosition)return!1;const t=e.getColumnGroupChild(),i=e.getRowIndex(),n=e.getPinned(),{column:s,headerRowIndex:r}=this.focusedHeaderPosition;return t===s&&i===r&&n==s.getPinned()}clearFocusedHeader(){this.focusedHeaderPosition=null}getFocusedHeader(){return this.focusedHeaderPosition}setFocusedHeader(e,t){this.focusedHeaderPosition={headerRowIndex:e,column:t}}focusHeaderPosition(e){if(this.gos.get("suppressHeaderFocus"))return!1;const{direction:t,fromTab:i,allowUserOverride:n,event:s,fromCell:r,rowWithoutSpanValue:o}=e;let{headerPosition:a}=e;if(r&&this.filterManager.isAdvancedFilterHeaderActive())return this.focusAdvancedFilter(a);if(n){const e=this.getFocusedHeader(),n=this.headerNavigationService.getHeaderRowCount();if(i){const i=this.gos.getCallback("tabToNextHeader");i&&(a=this.getHeaderPositionFromUserFunc({userFunc:i,direction:t,currentPosition:e,headerPosition:a,headerRowCount:n}))}else{const t=this.gos.getCallback("navigateToNextHeader");t&&s&&(a=t({key:s.key,previousHeaderPosition:e,nextHeaderPosition:a,headerRowCount:n,event:s}))}}return!!a&&this.focusProvidedHeaderPosition({headerPosition:a,direction:t,event:s,fromCell:r,rowWithoutSpanValue:o})}focusHeaderPositionFromUserFunc(e){if(this.gos.get("suppressHeaderFocus"))return!1;const{userFunc:t,headerPosition:i,direction:n,event:s}=e,r=this.getFocusedHeader(),o=this.headerNavigationService.getHeaderRowCount(),a=this.getHeaderPositionFromUserFunc({userFunc:t,direction:n,currentPosition:r,headerPosition:i,headerRowCount:o});return!!a&&this.focusProvidedHeaderPosition({headerPosition:a,direction:n,event:s})}getHeaderPositionFromUserFunc(e){const{userFunc:t,direction:i,currentPosition:n,headerPosition:s,headerRowCount:r}=e,o=t({backwards:"Before"===i,previousHeaderPosition:n,nextHeaderPosition:s,headerRowCount:r});return!0===o||null===o?(null===o&&z("Returning `null` from tabToNextHeader is deprecated. Return `true` to stay on the current header, or `false` to let the browser handle the tab behaviour."),n):!1===o?null:o}focusProvidedHeaderPosition(e){const{headerPosition:t,direction:i,fromCell:n,rowWithoutSpanValue:s,event:r}=e;if(-1===t.headerRowIndex)return this.filterManager.isAdvancedFilterHeaderActive()?this.focusAdvancedFilter(t):this.focusGridView(t.column);this.headerNavigationService.scrollToColumn(t.column,i);const o=this.ctrlsService.getHeaderRowContainerCtrl(t.column.getPinned()).focusHeader(t.headerRowIndex,t.column,r);return o&&(null!=s||n)&&this.headerNavigationService.setCurrentHeaderRowWithoutSpan(null!=s?s:-1),o}focusFirstHeader(){let e=this.columnModel.getAllDisplayedColumns()[0];if(!e)return!1;e.getParent()&&(e=this.columnModel.getColumnGroupAtLevel(e,0));const t=this.headerPositionUtils.getHeaderIndexToFocus(e,0);return this.focusHeaderPosition({headerPosition:t,rowWithoutSpanValue:0})}focusLastHeader(e){const t=this.headerNavigationService.getHeaderRowCount()-1,i=Ie(this.columnModel.getAllDisplayedColumns());return this.focusHeaderPosition({headerPosition:{headerRowIndex:t,column:i},rowWithoutSpanValue:-1,event:e})}focusPreviousFromFirstCell(e){return this.filterManager.isAdvancedFilterHeaderActive()?this.focusAdvancedFilter(null):this.focusLastHeader(e)}isAnyCellFocused(){return!!this.focusedCellPosition}isRowFocused(e,t){return null!=this.focusedCellPosition&&this.focusedCellPosition.rowIndex===e&&this.focusedCellPosition.rowPinned===v(t)}findFocusableElements(e,t,i=!1){const n=sn;let s=rn;t&&(s+=", "+t),i&&(s+=', [tabindex="-1"]');const r=Array.prototype.slice.apply(e.querySelectorAll(n)).filter(e=>xn(e)),o=Array.prototype.slice.apply(e.querySelectorAll(s));return o.length?(a=o,r.filter(e=>-1===a.indexOf(e))):r;var a}focusInto(e,t=!1,i=!1){const n=this.findFocusableElements(e,null,i),s=t?Ie(n):n[0];return!!s&&(s.focus({preventScroll:!0}),!0)}findFocusableElementBeforeTabGuard(e,t){if(!t)return null;const i=this.findFocusableElements(e),n=i.indexOf(t);if(-1===n)return null;let s=-1;for(let e=n-1;e>=0;e--)if(i[e].classList.contains("ag-tab-guard-top")){s=e;break}return s<=0?null:i[s-1]}findNextFocusableElement(e=this.eGridDiv,t,i){const n=this.findFocusableElements(e,t?':not([tabindex="-1"])':null),s=this.gos.getActiveDomElement();let r;r=t?n.findIndex(e=>e.contains(s)):n.indexOf(s);const o=r+(i?-1:1);return o<0||o>=n.length?null:n[o]}isTargetUnderManagedComponent(e,t){if(!t)return!1;const i=e.querySelectorAll(`.${Ms.FOCUS_MANAGED_CLASS}`);if(!i.length)return!1;for(let e=0;e<i.length;e++)if(i[e].contains(t))return!0;return!1}findTabbableParent(e,t=5){let i=0;for(;e&&null===Li(e)&&++i<=t;)e=e.parentElement;return null===Li(e)?null:e}focusGridView(e,t){var i;if(this.gos.get("suppressCellFocus"))return t?this.gos.get("suppressHeaderFocus")?this.focusNextGridCoreContainer(!0,!0):this.focusLastHeader():this.focusNextGridCoreContainer(!1);const n=t?this.rowPositionUtils.getLastRow():this.rowPositionUtils.getFirstRow();if(!n)return!1;const{rowIndex:s,rowPinned:r}=n,o=this.getFocusedHeader();return!e&&o&&(e=o.column),!(null==s||!e||(this.navigationService.ensureCellVisible({rowIndex:s,column:e,rowPinned:r}),this.setFocusedCell({rowIndex:s,column:e,rowPinned:v(r),forceBrowserFocus:!0}),null==(i=this.rangeService)||i.setRangeToCell({rowIndex:s,rowPinned:r,column:e}),0))}focusNextGridCoreContainer(e,t=!1){return!(t||!this.gridCtrl.focusNextInnerContainer(e))||((t||!e&&!this.gridCtrl.isDetailGrid())&&this.gridCtrl.forceFocusOutOfContainer(e),!1)}focusAdvancedFilter(e){var t,i;return this.advancedFilterFocusColumn=null==e?void 0:e.column,null!=(i=null==(t=this.advancedFilterService)?void 0:t.getCtrl().focusHeaderComp())&&i}focusNextFromAdvancedFilter(e,t){var i,n;const s=null!=(n=t?void 0:this.advancedFilterFocusColumn)?n:null==(i=this.columnModel.getAllDisplayedColumns())?void 0:i[0];return e?this.focusHeaderPosition({headerPosition:{column:s,headerRowIndex:this.headerNavigationService.getHeaderRowCount()-1}}):this.focusGridView(s)}clearAdvancedFilterColumn(){this.advancedFilterFocusColumn=void 0}};vc.keyboardModeActive=!1,vc.instanceCount=0,f([ue("eGridDiv")],vc.prototype,"eGridDiv",2),f([ue("columnModel")],vc.prototype,"columnModel",2),f([ue("headerNavigationService")],vc.prototype,"headerNavigationService",2),f([ue("headerPositionUtils")],vc.prototype,"headerPositionUtils",2),f([ue("rowRenderer")],vc.prototype,"rowRenderer",2),f([ue("rowPositionUtils")],vc.prototype,"rowPositionUtils",2),f([ue("cellPositionUtils")],vc.prototype,"cellPositionUtils",2),f([ue("navigationService")],vc.prototype,"navigationService",2),f([ue("ctrlsService")],vc.prototype,"ctrlsService",2),f([ue("filterManager")],vc.prototype,"filterManager",2),f([de("rangeService")],vc.prototype,"rangeService",2),f([de("advancedFilterService")],vc.prototype,"advancedFilterService",2),f([le],vc.prototype,"init",1),vc=f([he("focusService")],vc);var bc=class extends st{setMouseOver(e){this.selectedColumns=e;const t={type:ct.EVENT_COLUMN_HOVER_CHANGED};this.eventService.dispatchEvent(t)}clearMouseOver(){this.selectedColumns=null;const e={type:ct.EVENT_COLUMN_HOVER_CHANGED};this.eventService.dispatchEvent(e)}isHovered(e){return!!this.selectedColumns&&this.selectedColumns.indexOf(e)>=0}};bc=f([he("columnHoverService")],bc);var Cc=class extends st{constructor(){super(...arguments),this.executeNextFuncs=[],this.executeLaterFuncs=[],this.active=!1,this.suppressAnimation=!1,this.animationThreadCount=0}postConstruct(){this.ctrlsService.whenReady(e=>this.gridBodyCtrl=e.gridBodyCtrl)}isActive(){return this.active&&!this.suppressAnimation}setSuppressAnimation(e){this.suppressAnimation=e}start(){this.active||this.gos.get("suppressColumnMoveAnimation")||this.gos.get("enableRtl")||(this.ensureAnimationCssClassPresent(),this.active=!0)}finish(){this.active&&this.flush(()=>{this.active=!1})}executeNextVMTurn(e){this.active?this.executeNextFuncs.push(e):e()}executeLaterVMTurn(e){this.active?this.executeLaterFuncs.push(e):e()}ensureAnimationCssClassPresent(){this.animationThreadCount++;const e=this.animationThreadCount;this.gridBodyCtrl.setColumnMovingCss(!0),this.executeLaterFuncs.push(()=>{this.animationThreadCount===e&&this.gridBodyCtrl.setColumnMovingCss(!1)})}flush(e){if(0===this.executeNextFuncs.length&&0===this.executeLaterFuncs.length)return void e();const t=e=>{for(;e.length;){const t=e.pop();t&&t()}};this.getFrameworkOverrides().wrapIncoming(()=>{window.setTimeout(()=>t(this.executeNextFuncs),0),window.setTimeout(()=>{e(),t(this.executeLaterFuncs)},200)})}};f([ue("ctrlsService")],Cc.prototype,"ctrlsService",2),f([le],Cc.prototype,"postConstruct",1),Cc=f([he("columnAnimationService")],Cc);var wc=class extends st{postConstruct(){this.ctrlsService.whenReady(e=>{this.centerRowsCtrl=e.center,this.addManagedListener(this.eventService,ct.EVENT_BODY_HEIGHT_CHANGED,this.checkPageSize.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_SCROLL_VISIBILITY_CHANGED,this.checkPageSize.bind(this)),this.addManagedPropertyListener("paginationAutoPageSize",this.onPaginationAutoSizeChanged.bind(this)),this.checkPageSize()})}notActive(){return!this.gos.get("paginationAutoPageSize")||null==this.centerRowsCtrl}onPaginationAutoSizeChanged(){this.notActive()?this.paginationProxy.unsetAutoCalculatedPageSize():this.checkPageSize()}checkPageSize(){if(this.notActive())return;const e=this.centerRowsCtrl.getViewportSizeFeature().getBodyHeight();if(e>0){const t=()=>{const t=this.gos.getRowHeightAsNumber(),i=Math.floor(e/t);this.paginationProxy.setPageSize(i,"autoCalculated")};this.isBodyRendered?Q(()=>t(),50)():(t(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}};f([ue("ctrlsService")],wc.prototype,"ctrlsService",2),f([ue("paginationProxy")],wc.prototype,"paginationProxy",2),f([le],wc.prototype,"postConstruct",1),wc=f([he("paginationAutoPageSizeService")],wc);var Sc=class extends st{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(e,t,i){this.active&&(e.__cacheVersion!==this.cacheVersion&&(e.__cacheVersion=this.cacheVersion,e.__cacheData={}),e.__cacheData[t]=i)}getValue(e,t){if(this.active&&e.__cacheVersion===this.cacheVersion)return e.__cacheData[t]}};f([le],Sc.prototype,"init",1),Sc=f([he("valueCache")],Sc);var xc=class extends st{init(){"clientSide"===this.rowModel.getType()&&(this.clientSideRowModel=this.rowModel),this.addManagedListener(this.eventService,ct.EVENT_CELL_VALUE_CHANGED,this.onCellValueChanged.bind(this))}onCellValueChanged(e){"paste"!==e.source&&this.doChangeDetection(e.node,e.column)}doChangeDetection(e,t){if(this.gos.get("suppressChangeDetection"))return;const i=[e];if(this.clientSideRowModel&&!e.isRowPinned()){const n=this.gos.get("aggregateOnlyChangedColumns"),s=new Sl(n,this.clientSideRowModel.getRootNode());s.addParentNode(e.parent,[t]),this.clientSideRowModel.doAggregate(s),s.forEachChangedNodeDepthFirst(e=>{i.push(e)})}this.rowRenderer.refreshCells({rowNodes:i})}};f([ue("rowModel")],xc.prototype,"rowModel",2),f([ue("rowRenderer")],xc.prototype,"rowRenderer",2),f([le],xc.prototype,"init",1),xc=f([he("changeDetectionService")],xc);var Ec=class extends st{adaptFunction(e,t){const i=this.componentMetadataProvider.retrieve(e);return i&&i.functionAdapter?i.functionAdapter(t):null}adaptCellRendererFunction(e){return class{refresh(e){return!1}getGui(){return this.eGui}init(t){const i=e(t),n=typeof i;this.eGui="string"!==n&&"number"!==n&&"boolean"!==n?null!=i?i:En("<span></span>"):En("<span>"+i+"</span>")}}}doesImplementIComponent(e){return!!e&&e.prototype&&"getGui"in e.prototype}};f([ue("componentMetadataProvider")],Ec.prototype,"componentMetadataProvider",2),Ec=f([he("agComponentUtils")],Ec);var Ac=class extends st{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(e){return this.componentMetaData[e]}};f([ue("agComponentUtils")],Ac.prototype,"agComponentUtils",2),f([le],Ac.prototype,"postConstruct",1),Ac=f([he("componentMetadataProvider")],Ac);var Mc={"ag-theme-custom":{headerHeight:25,headerCellMinWidth:24,listItemHeight:20,rowHeight:25,chartMenuPanelWidth:220},"ag-theme-material":{headerHeight:56,headerCellMinWidth:48,listItemHeight:32,rowHeight:48,chartMenuPanelWidth:240},"ag-theme-balham":{headerHeight:32,headerCellMinWidth:24,listItemHeight:24,rowHeight:28,chartMenuPanelWidth:220},"ag-theme-alpine":{headerHeight:48,headerCellMinWidth:36,listItemHeight:24,rowHeight:42,chartMenuPanelWidth:240},"ag-theme-quartz":{headerHeight:48,headerCellMinWidth:36,listItemHeight:24,rowHeight:42,chartMenuPanelWidth:260}},Tc={headerHeight:["ag-header-row"],headerCellMinWidth:["ag-header-cell"],listItemHeight:["ag-virtual-list-item"],rowHeight:["ag-row"],chartMenuPanelWidth:["ag-chart-docked-container"]},Dc=class extends st{constructor(){super(...arguments),this.calculatedSizes={},this.calculatedTheme=null}postConstruct(){var e;const t=null!=(e=this.getTheme().el)?e:this.eGridDiv;this.addManagedPropertyListener("rowHeight",()=>this.refreshRowHeightVariable()),this.mutationObserver=new MutationObserver(()=>{this.calculatedSizes={},this.calculatedTheme=null,this.calculatedTheme=this.getTheme(),this.fireGridStylesChangedEvent()}),this.mutationObserver.observe(t||this.eGridDiv,{attributes:!0,attributeFilter:["class"]})}fireGridStylesChangedEvent(){const e={type:ct.EVENT_GRID_STYLES_CHANGED};this.eventService.dispatchEvent(e)}getSassVariable(e){const{themeFamily:t,el:i}=this.getTheme();if(!t||0!==t.indexOf("ag-theme"))return;this.calculatedSizes||(this.calculatedSizes={}),this.calculatedSizes[t]||(this.calculatedSizes[t]={});const n=this.calculatedSizes[t][e];return null!=n?n:(this.calculatedSizes[t][e]=this.calculateValueForSassProperty(e,t,i),this.calculatedSizes[t][e])}calculateValueForSassProperty(e,t,i){const n="ag-theme-"+(t.match("material")?"material":t.match("balham")?"balham":t.match("alpine")?"alpine":"custom"),s=Mc[n][e],r=this.gos.getDocument();if(i||(i=this.eGridDiv),!Tc[e])return s;const o=Tc[e],a=r.createElement("div"),l=Array.from(i.classList);a.classList.add(t,...l),a.style.position="absolute";const c=o.reduce((e,t)=>{const i=r.createElement("div");return i.style.position="static",i.classList.add(t),e.appendChild(i),i},a);let h=0;if(r.body){r.body.appendChild(a);const t=-1!==e.toLowerCase().indexOf("height")?"height":"width";h=parseInt(window.getComputedStyle(c)[t],10),r.body.removeChild(a)}return h||s}isThemeDark(){const{theme:e}=this.getTheme();return!!e&&e.indexOf("dark")>=0}chartMenuPanelWidth(){return this.getSassVariable("chartMenuPanelWidth")}getTheme(){if(this.calculatedTheme)return this.calculatedTheme;const e=/\bag-(material|(?:theme-([\w\-]*)))\b/g;let t=this.eGridDiv,i=null,n=[];for(;t;){if(i=e.exec(t.className),i){const i=t.className.match(e);i&&(n=i);break}t=t.parentElement||void 0}if(!i)return{allThemes:n};const s=i[0];return this.calculatedTheme={theme:s,el:t,themeFamily:s.replace(/-dark$/,""),allThemes:n},this.calculatedTheme}getFromTheme(e,t){var i;return null!=(i=this.getSassVariable(t))?i:e}getDefaultRowHeight(){return this.getFromTheme(25,"rowHeight")}getListItemHeight(){return this.getFromTheme(20,"listItemHeight")}refreshRowHeightVariable(){const e=this.eGridDiv.style.getPropertyValue("--ag-line-height").trim(),t=this.gos.get("rowHeight");if(null==t||isNaN(t)||!isFinite(t))return null!==e&&this.eGridDiv.style.setProperty("--ag-line-height",null),-1;const i=`${t}px`;return e!=i?(this.eGridDiv.style.setProperty("--ag-line-height",i),t):""!=e?parseFloat(e):-1}getMinColWidth(){const e=this.getFromTheme(null,"headerCellMinWidth");return b(e)?Math.max(e,10):10}destroy(){this.calculatedSizes=null,this.mutationObserver&&this.mutationObserver.disconnect(),super.destroy()}};f([ue("eGridDiv")],Dc.prototype,"eGridDiv",2),f([le],Dc.prototype,"postConstruct",1),Dc=f([he("environment")],Dc);var Ic=class extends st{constructor(){super(...arguments),this.scrollY=0,this.uiBodyHeight=0}agWire(e){this.logger=e.create("RowContainerHeightService")}postConstruct(){this.addManagedListener(this.eventService,ct.EVENT_BODY_HEIGHT_CHANGED,this.updateOffset.bind(this)),this.maxDivHeight=Ni(),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 e=this.scrollY/this.maxScrollY,t=e*this.pixelsToShave;this.logger.log(`Div Stretch Offset = ${t} (${this.pixelsToShave} * ${e})`),this.setDivStretchOffset(t)}setUiContainerHeight(e){e!==this.uiContainerHeight&&(this.uiContainerHeight=e,this.eventService.dispatchEvent({type:ct.EVENT_ROW_CONTAINER_HEIGHT_CHANGED}))}clearOffset(){this.setUiContainerHeight(this.modelHeight),this.pixelsToShave=0,this.setDivStretchOffset(0)}setDivStretchOffset(e){const t="number"==typeof e?Math.floor(e):null;this.divStretchOffset!==t&&(this.divStretchOffset=t,this.eventService.dispatchEvent({type:ct.EVENT_HEIGHT_SCALE_CHANGED}))}setModelHeight(e){this.modelHeight=e,this.stretching=null!=e&&this.maxDivHeight>0&&e>this.maxDivHeight,this.stretching?this.calculateOffset():this.clearOffset()}getUiContainerHeight(){return this.uiContainerHeight}getRealPixelPosition(e){return e-this.divStretchOffset}getUiBodyHeight(){const e=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition();return e.bottom-e.top}getScrollPositionForPixel(e){if(this.pixelsToShave<=0)return e;const t=e/(this.modelHeight-this.getUiBodyHeight());return this.maxScrollY*t}};f([ue("ctrlsService")],Ic.prototype,"ctrlsService",2),f([m(0,ge("loggerFactory"))],Ic.prototype,"agWire",1),f([le],Ic.prototype,"postConstruct",1),Ic=f([he("rowContainerHeightService")],Ic);var Rc=class extends st{init(){this.addManagedPropertyListener("isRowSelectable",()=>this.updateSelectable())}updateSelectableAfterGrouping(){this.updateSelectable(!0)}updateSelectable(e=!1){const t=!!this.gos.get("rowSelection"),i=this.gos.get("isRowSelectable");if(!t||!i)return;const n=this.gos.get("groupSelectsChildren"),s="clientSide"===this.rowModel.getType()&&n,r=[],o=t=>{if(e&&!t.group)return;if(s&&t.group){const e=t.childrenAfterGroup.some(e=>!0===e.selectable);return void t.setRowSelectable(e,!0)}const n=!i||i(t);t.setRowSelectable(n,!0),!n&&t.isSelected()&&r.push(t)};if(s){const e=this.rowModel;new Sl(!1,e.getRootNode()).forEachChangedNodeDepthFirst(o,!0,!0)}else this.rowModel.forEachNode(o);r.length&&this.selectionService.setNodesSelected({nodes:r,newValue:!1,source:"selectableChanged"}),s&&this.selectionService instanceof cc&&this.selectionService.updateGroupsFromChildrenSelections("selectableChanged")}};f([ue("rowModel")],Rc.prototype,"rowModel",2),f([ue("selectionService")],Rc.prototype,"selectionService",2),f([le],Rc.prototype,"init",1),Rc=f([he("selectableService")],Rc);var kc=class extends vs{constructor(){super(),this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1}postConstruct(){const e=this.gos.get("enableRtl");this.setTemplate(this.getTemplate());const{btFirst:t,btPrevious:i,btNext:n,btLast:s,pageSizeComp:r}=this;this.activateTabIndex([t,i,n,s]),t.insertAdjacentElement("afterbegin",qn(e?"last":"first",this.gos)),i.insertAdjacentElement("afterbegin",qn(e?"next":"previous",this.gos)),n.insertAdjacentElement("afterbegin",qn(e?"previous":"next",this.gos)),s.insertAdjacentElement("afterbegin",qn(e?"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,ct.EVENT_PAGINATION_CHANGED,this.onPaginationChanged.bind(this)),[{el:this.btFirst,fn:this.onBtFirst.bind(this)},{el:this.btPrevious,fn:this.onBtPrevious.bind(this)},{el:this.btNext,fn:this.onBtNext.bind(this)},{el:this.btLast,fn:this.onBtLast.bind(this)}].forEach(e=>{const{el:t,fn:i}=e;this.addManagedListener(t,"click",i),this.addManagedListener(t,"keydown",e=>{e.key!==Zn.ENTER&&e.key!==Zn.SPACE||(e.preventDefault(),i())})}),this.areListenersSetup=!0)}onBtFirst(){this.previousAndFirstButtonsDisabled||this.paginationProxy.goToFirstPage()}setCurrentPageLabel(){const e=this.paginationProxy.getTotalPages()>0,t=this.paginationProxy.getCurrentPage(),i=e?t+1:0;this.lbCurrent.textContent=this.formatNumber(i)}formatNumber(e){const t=this.gos.getCallback("paginationNumberFormatter");if(t)return t({value:e});const i=this.localeService.getLocaleTextFunc();return Yi(e,i("thousandSeparator",","),i("decimalSeparator","."))}getTemplate(){const e=this.localeService.getLocaleTextFunc(),t=e("page","Page"),i=e("to","to"),n=e("of","of"),s=e("firstPage","First Page"),r=e("previousPage","Previous Page"),o=e("nextPage","Next Page"),a=e("lastPage","Last Page"),l=this.getCompId();return`<div class="ag-paging-panel ag-unselectable" id="ag-${l}">\n                <ag-page-size-selector ref="pageSizeComp"></ag-page-size-selector>\n                <span class="ag-paging-row-summary-panel" role="status">\n                    <span id="ag-${l}-first-row" ref="lbFirstRowOnPage" class="ag-paging-row-summary-panel-number"></span>\n                    <span id="ag-${l}-to">${i}</span>\n                    <span id="ag-${l}-last-row" ref="lbLastRowOnPage" class="ag-paging-row-summary-panel-number"></span>\n                    <span id="ag-${l}-of">${n}</span>\n                    <span id="ag-${l}-row-count" ref="lbRecordCount" class="ag-paging-row-summary-panel-number"></span>\n                </span>\n                <span class="ag-paging-page-summary-panel" role="presentation">\n                    <div ref="btFirst" class="ag-button ag-paging-button" role="button" aria-label="${s}"></div>\n                    <div ref="btPrevious" class="ag-button ag-paging-button" role="button" aria-label="${r}"></div>\n                    <span class="ag-paging-description" role="status">\n                        <span id="ag-${l}-start-page">${t}</span>\n                        <span id="ag-${l}-start-page-number" ref="lbCurrent" class="ag-paging-number"></span>\n                        <span id="ag-${l}-of-page">${n}</span>\n                        <span id="ag-${l}-of-page-number" ref="lbTotal" class="ag-paging-number"></span>\n                    </span>\n                    <div ref="btNext" class="ag-button ag-paging-button" role="button" aria-label="${o}"></div>\n                    <div ref="btLast" class="ag-button ag-paging-button" role="button" aria-label="${a}"></div>\n                </span>\n            </div>`}onBtNext(){this.nextButtonDisabled||this.paginationProxy.goToNextPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.paginationProxy.goToPreviousPage()}onBtLast(){this.lastButtonDisabled||this.paginationProxy.goToLastPage()}enableOrDisableButtons(){const e=this.paginationProxy.getCurrentPage(),t=this.paginationProxy.isLastPageFound(),i=this.paginationProxy.getTotalPages();this.previousAndFirstButtonsDisabled=0===e,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const n=this.isZeroPagesToDisplay(),s=e===i-1;this.nextButtonDisabled=s||n,this.lastButtonDisabled=!t||n||e===i-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){Jt(e,t),e.classList.toggle("ag-disabled",t)}updateRowLabels(){const e=this.paginationProxy.getCurrentPage(),t=this.paginationProxy.getPageSize(),i=this.paginationProxy.isLastPageFound(),n=this.paginationProxy.isLastPageFound()?this.paginationProxy.getMasterRowCount():null;let s,r;if(this.isZeroPagesToDisplay()?s=r=0:(s=t*e+1,r=s+t-1,i&&r>n&&(r=n)),this.lbFirstRowOnPage.textContent=this.formatNumber(s),this.rowNodeBlockLoader.isLoading()){const e=this.localeService.getLocaleTextFunc();this.lbLastRowOnPage.innerHTML=e("pageLastRowUnknown","?")}else this.lbLastRowOnPage.textContent=this.formatNumber(r)}isZeroPagesToDisplay(){const e=this.paginationProxy.isLastPageFound(),t=this.paginationProxy.getTotalPages();return e&&0===t}setTotalLabels(){const e=this.paginationProxy.isLastPageFound(),t=this.paginationProxy.getTotalPages(),i=e?this.paginationProxy.getMasterRowCount():null;if(1===i){const e=this.paginationProxy.getRow(0);if(e&&e.group&&!e.groupData&&!e.aggData)return void this.setTotalLabelsToZero()}if(e)this.lbTotal.textContent=this.formatNumber(t),this.lbRecordCount.textContent=this.formatNumber(i);else{const e=this.localeService.getLocaleTextFunc()("more","more");this.lbTotal.innerHTML=e,this.lbRecordCount.innerHTML=e}}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)}};f([ue("paginationProxy")],kc.prototype,"paginationProxy",2),f([ue("rowNodeBlockLoader")],kc.prototype,"rowNodeBlockLoader",2),f([bs("btFirst")],kc.prototype,"btFirst",2),f([bs("btPrevious")],kc.prototype,"btPrevious",2),f([bs("btNext")],kc.prototype,"btNext",2),f([bs("btLast")],kc.prototype,"btLast",2),f([bs("lbRecordCount")],kc.prototype,"lbRecordCount",2),f([bs("lbFirstRowOnPage")],kc.prototype,"lbFirstRowOnPage",2),f([bs("lbLastRowOnPage")],kc.prototype,"lbLastRowOnPage",2),f([bs("lbCurrent")],kc.prototype,"lbCurrent",2),f([bs("lbTotal")],kc.prototype,"lbTotal",2),f([bs("pageSizeComp")],kc.prototype,"pageSizeComp",2),f([le],kc.prototype,"postConstruct",1);var Pc=class e extends vs{constructor(){super(e.TEMPLATE),this.inProgress=!1,this.destroyRequested=!1}updateLayoutClasses(e,t){const i=this.eOverlayWrapper.classList;i.toggle("ag-layout-auto-height",t.autoHeight),i.toggle("ag-layout-normal",t.normal),i.toggle("ag-layout-print",t.print)}postConstruct(){this.createManagedBean(new zo(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,i){this.inProgress||(this.setWrapperTypeClass(t),this.destroyActiveOverlay(),this.inProgress=!0,e&&e.then(e=>{this.inProgress=!1,this.eOverlayWrapper.appendChild(e.getGui()),this.activeOverlay=e,this.updateListenerDestroyFunc=i,this.destroyRequested&&(this.destroyRequested=!1,this.destroyActiveOverlay())}),this.setDisplayed(!0,{skipAriaHidden:!0}))}destroyActiveOverlay(){var e;this.inProgress?this.destroyRequested=!0:this.activeOverlay&&(this.activeOverlay=this.getContext().destroyBean(this.activeOverlay),null==(e=this.updateListenerDestroyFunc)||e.call(this),Cn(this.eOverlayWrapper))}hideOverlay(){this.destroyActiveOverlay(),this.setDisplayed(!1,{skipAriaHidden:!0})}destroy(){this.destroyActiveOverlay(),super.destroy()}};Pc.TEMPLATE='\n        <div class="ag-overlay" role="presentation">\n            <div class="ag-overlay-panel" role="presentation">\n                <div class="ag-overlay-wrapper" ref="eOverlayWrapper" role="presentation"></div>\n            </div>\n        </div>',f([ue("overlayService")],Pc.prototype,"overlayService",2),f([bs("eOverlayWrapper")],Pc.prototype,"eOverlayWrapper",2),f([le],Pc.prototype,"postConstruct",1);var _c=Pc,Lc=class extends st{getFirstRow(){let e,t=0;return this.pinnedRowModel.getPinnedTopRowCount()?e="top":this.rowModel.getRowCount()?(e=null,t=this.paginationProxy.getPageFirstRow()):this.pinnedRowModel.getPinnedBottomRowCount()&&(e="bottom"),void 0===e?null:{rowIndex:t,rowPinned:e}}getLastRow(){let e,t=null;const i=this.pinnedRowModel.getPinnedBottomRowCount(),n=this.pinnedRowModel.getPinnedTopRowCount();return i?(t="bottom",e=i-1):this.rowModel.getRowCount()?(t=null,e=this.paginationProxy.getPageLastRow()):n&&(t="top",e=n-1),void 0===e?null:{rowIndex:e,rowPinned:t}}getRowNode(e){switch(e.rowPinned){case"top":return this.pinnedRowModel.getPinnedTopRowData()[e.rowIndex];case"bottom":return this.pinnedRowModel.getPinnedBottomRowData()[e.rowIndex];default:return this.rowModel.getRow(e.rowIndex)}}sameRow(e,t){return!e&&!t||!(e&&!t||!e&&t)&&e.rowIndex===t.rowIndex&&e.rowPinned==t.rowPinned}before(e,t){switch(e.rowPinned){case"top":if("top"!==t.rowPinned)return!0;break;case"bottom":if("bottom"!==t.rowPinned)return!1;break;default:if(b(t.rowPinned))return"top"!==t.rowPinned}return e.rowIndex<t.rowIndex}};f([ue("rowModel")],Lc.prototype,"rowModel",2),f([ue("pinnedRowModel")],Lc.prototype,"pinnedRowModel",2),f([ue("paginationProxy")],Lc.prototype,"paginationProxy",2),Lc=f([he("rowPositionUtils")],Lc);var Nc=class extends st{createId(e){const{rowIndex:t,rowPinned:i,column:n}=e;return this.createIdFromValues({rowIndex:t,column:n,rowPinned:i})}createIdFromValues(e){const{rowIndex:t,rowPinned:i,column:n}=e;return`${t}.${null==i?"null":i}.${n.getId()}`}equals(e,t){const i=e.column===t.column,n=e.rowPinned===t.rowPinned,s=e.rowIndex===t.rowIndex;return i&&n&&s}};Nc=f([he("cellPositionUtils")],Nc);var Oc=class{constructor(e){this.cellValueChanges=e}},Fc=class extends Oc{constructor(e,t,i,n){super(e),this.initialRange=t,this.finalRange=i,this.ranges=n}},Gc=class e{constructor(t){this.actionStack=[],this.maxStackSize=t||e.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}};Gc.DEFAULT_STACK_SIZE=10;var Bc=Gc,Vc=class extends st{constructor(){super(...arguments),this.cellValueChanges=[],this.activeCellEdit=null,this.activeRowEdit=null,this.isPasting=!1,this.isRangeInAction=!1,this.onCellValueChanged=e=>{const t={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned},i=null!==this.activeCellEdit&&this.cellPositionUtils.equals(this.activeCellEdit,t),n=null!==this.activeRowEdit&&this.rowPositionUtils.sameRow(this.activeRowEdit,t);if(!(i||n||this.isPasting||this.isRangeInAction))return;const{rowPinned:s,rowIndex:r,column:o,oldValue:a,value:l}=e,c={rowPinned:s,rowIndex:r,columnId:o.getColId(),newValue:l,oldValue:a};this.cellValueChanges.push(c)},this.clearStacks=()=>{this.undoStack.clear(),this.redoStack.clear()}}init(){if(!this.gos.get("undoRedoCellEditing"))return;const e=this.gos.get("undoRedoCellEditingLimit");e<=0||(this.undoStack=new Bc(e),this.redoStack=new Bc(e),this.addRowEditingListeners(),this.addCellEditingListeners(),this.addPasteListeners(),this.addFillListeners(),this.addCellKeyListeners(),this.addManagedListener(this.eventService,ct.EVENT_CELL_VALUE_CHANGED,this.onCellValueChanged),this.addManagedListener(this.eventService,ct.EVENT_MODEL_UPDATED,e=>{e.keepUndoRedoStack||this.clearStacks()}),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.clearStacks),this.addManagedListener(this.eventService,ct.EVENT_NEW_COLUMNS_LOADED,this.clearStacks),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_GROUP_OPENED,this.clearStacks),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_ROW_GROUP_CHANGED,this.clearStacks),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_MOVED,this.clearStacks),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PINNED,this.clearStacks),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_VISIBLE,this.clearStacks),this.addManagedListener(this.eventService,ct.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(e){const t={type:ct.EVENT_UNDO_STARTED,source:e};this.eventService.dispatchEvent(t);const i=this.undoRedo(this.undoStack,this.redoStack,"initialRange","oldValue","undo"),n={type:ct.EVENT_UNDO_ENDED,source:e,operationPerformed:i};this.eventService.dispatchEvent(n)}redo(e){const t={type:ct.EVENT_REDO_STARTED,source:e};this.eventService.dispatchEvent(t);const i=this.undoRedo(this.redoStack,this.undoStack,"finalRange","newValue","redo"),n={type:ct.EVENT_REDO_ENDED,source:e,operationPerformed:i};this.eventService.dispatchEvent(n)}undoRedo(e,t,i,n,s){if(!e)return!1;const r=e.pop();return!(!r||!r.cellValueChanges||(this.processAction(r,e=>e[n],s),r instanceof Fc?this.processRange(this.rangeService,r.ranges||[r[i]]):this.processCell(r.cellValueChanges),t.push(r),0))}processAction(e,t,i){e.cellValueChanges.forEach(e=>{const{rowIndex:n,rowPinned:s,columnId:r}=e,o={rowIndex:n,rowPinned:s},a=this.rowPositionUtils.getRowNode(o);a.displayed&&a.setDataValue(r,t(e),i)})}processRange(e,t){let i;e.removeAllCellRanges(!0),t.forEach((n,s)=>{if(!n)return;const r=n.startRow,o=n.endRow;s===t.length-1&&(i={rowPinned:r.rowPinned,rowIndex:r.rowIndex,columnId:n.startColumn.getColId()},this.setLastFocusedCell(i));const a={rowStartIndex:r.rowIndex,rowStartPinned:r.rowPinned,rowEndIndex:o.rowIndex,rowEndPinned:o.rowPinned,columnStart:n.startColumn,columns:n.columns};e.addCellRange(a)})}processCell(e){const t=e[0],{rowIndex:i,rowPinned:n}=t,s={rowIndex:i,rowPinned:n},r=this.rowPositionUtils.getRowNode(s),o={rowPinned:t.rowPinned,rowIndex:r.rowIndex,columnId:t.columnId};this.setLastFocusedCell(o,this.rangeService)}setLastFocusedCell(e,t){const{rowIndex:i,columnId:n,rowPinned:s}=e,r=this.gridBodyCtrl.getScrollFeature(),o=this.columnModel.getGridColumn(n);if(!o)return;r.ensureIndexVisible(i),r.ensureColumnVisible(o);const a={rowIndex:i,column:o,rowPinned:s};this.focusService.setFocusedCell(p(d({},a),{forceBrowserFocus:!0})),null==t||t.setRangeToCell(a)}addRowEditingListeners(){this.addManagedListener(this.eventService,ct.EVENT_ROW_EDITING_STARTED,e=>{this.activeRowEdit={rowIndex:e.rowIndex,rowPinned:e.rowPinned}}),this.addManagedListener(this.eventService,ct.EVENT_ROW_EDITING_STOPPED,()=>{const e=new Oc(this.cellValueChanges);this.pushActionsToUndoStack(e),this.activeRowEdit=null})}addCellEditingListeners(){this.addManagedListener(this.eventService,ct.EVENT_CELL_EDITING_STARTED,e=>{this.activeCellEdit={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned}}),this.addManagedListener(this.eventService,ct.EVENT_CELL_EDITING_STOPPED,e=>{if(this.activeCellEdit=null,e.valueChanged&&!this.activeRowEdit&&!this.isPasting&&!this.isRangeInAction){const e=new Oc(this.cellValueChanges);this.pushActionsToUndoStack(e)}})}addPasteListeners(){this.addManagedListener(this.eventService,ct.EVENT_PASTE_START,()=>{this.isPasting=!0}),this.addManagedListener(this.eventService,ct.EVENT_PASTE_END,()=>{const e=new Oc(this.cellValueChanges);this.pushActionsToUndoStack(e),this.isPasting=!1})}addFillListeners(){this.addManagedListener(this.eventService,ct.EVENT_FILL_START,()=>{this.isRangeInAction=!0}),this.addManagedListener(this.eventService,ct.EVENT_FILL_END,e=>{const t=new Fc(this.cellValueChanges,e.initialRange,e.finalRange);this.pushActionsToUndoStack(t),this.isRangeInAction=!1})}addCellKeyListeners(){this.addManagedListener(this.eventService,ct.EVENT_KEY_SHORTCUT_CHANGED_CELL_START,()=>{this.isRangeInAction=!0}),this.addManagedListener(this.eventService,ct.EVENT_KEY_SHORTCUT_CHANGED_CELL_END,()=>{let e;e=this.rangeService&&this.gos.get("enableRangeSelection")?new Fc(this.cellValueChanges,void 0,void 0,[...this.rangeService.getCellRanges()]):new Oc(this.cellValueChanges),this.pushActionsToUndoStack(e),this.isRangeInAction=!1})}pushActionsToUndoStack(e){this.undoStack.push(e),this.cellValueChanges=[],this.redoStack.clear()}};f([ue("focusService")],Vc.prototype,"focusService",2),f([ue("ctrlsService")],Vc.prototype,"ctrlsService",2),f([ue("cellPositionUtils")],Vc.prototype,"cellPositionUtils",2),f([ue("rowPositionUtils")],Vc.prototype,"rowPositionUtils",2),f([ue("columnModel")],Vc.prototype,"columnModel",2),f([de("rangeService")],Vc.prototype,"rangeService",2),f([le],Vc.prototype,"init",1),Vc=f([he("undoRedoService")],Vc);var Hc=class extends st{findHeader(e,t){let i,n;if(e.column instanceof lt?i=this.columnModel.getDisplayedGroupAtDirection(e.column,t):(n=`getDisplayedCol${t}`,i=this.columnModel[n](e.column)),!i)return;let{headerRowIndex:s}=e;if("filter"!==this.getHeaderRowType(s)){const e=[i];for(;i.getParent();)i=i.getParent(),e.push(i);i=e[e.length-1-s]}const{column:r,headerRowIndex:o}=this.getHeaderIndexToFocus(i,s);return{column:r,headerRowIndex:o}}getHeaderIndexToFocus(e,t){let i;if(e instanceof lt&&this.isAnyChildSpanningHeaderHeight(e)&&e.isPadding()){const n=e;i=n.getLeafColumns()[0];let s=i;for(;s!==n;)t++,s=s.getParent()}return{column:i||e,headerRowIndex:t}}isAnyChildSpanningHeaderHeight(e){return!!e&&e.getLeafColumns().some(e=>e.isSpanHeaderHeight())}getColumnVisibleParent(e,t){const i=this.getHeaderRowType(t),n="column"===i;let s="filter"===i?e:e.getParent(),r=t-1,o=r;if(n&&this.isAnyChildSpanningHeaderHeight(e.getParent())){for(;s&&s.isPadding();)s=s.getParent(),r--;o=r,r<0&&(s=e,r=t,o=void 0)}return{column:s,headerRowIndex:r,headerRowIndexWithoutSpan:o}}getColumnVisibleChild(e,t,i="After"){let n=e,s=t+1,r=s;if("group"===this.getHeaderRowType(t)){const t=e.getDisplayedLeafColumns(),r="After"===i?t[0]:Ie(t),o=[];let a=r;for(;a.getParent()!==e;)a=a.getParent(),o.push(a);if(n=r,r.isSpanHeaderHeight())for(let e=o.length-1;e>=0;e--){const t=o[e];if(!t.isPadding()){n=t;break}s++}else n=Ie(o),n||(n=r)}return{column:n,headerRowIndex:s,headerRowIndexWithoutSpan:r}}getHeaderRowType(e){const t=this.ctrlsService.getHeaderRowContainerCtrl();if(t)return t.getRowType(e)}findColAtEdgeForHeaderRow(e,t){const i=this.columnModel.getAllDisplayedColumns(),n=i["start"===t?0:i.length-1];if(!n)return;const s=this.ctrlsService.getHeaderRowContainerCtrl(n.getPinned()).getRowType(e);return"group"==s?{headerRowIndex:e,column:this.columnModel.getColumnGroupAtLevel(n,e)}:{headerRowIndex:null==s?-1:e,column:n}}};f([ue("columnModel")],Hc.prototype,"columnModel",2),f([ue("ctrlsService")],Hc.prototype,"ctrlsService",2),Hc=f([he("headerPositionUtils")],Hc);var Uc=class{buildColumnDefs(e,t,i){const n=[],s={};return e.forEach(e=>{let r=!0,o=this.createDefFromColumn(e,t,i),a=e.getOriginalParent(),l=null;for(;a;){let e=null;if(a.isPadding()){a=a.getOriginalParent();continue}const t=s[a.getGroupId()];if(t){t.children.push(o),r=!1;break}if(e=this.createDefFromGroup(a),e&&(e.children=[o],s[e.groupId]=e,o=e,a=a.getOriginalParent()),null!=a&&l===a){r=!1;break}l=a}r&&n.push(o)}),n}createDefFromGroup(e){const t=L(e.getColGroupDef(),["children"]);return t&&(t.groupId=e.getGroupId()),t}createDefFromColumn(e,t,i){const n=L(e.getColDef());return n.colId=e.getColId(),n.width=e.getActualWidth(),n.rowGroup=e.isRowGroupActive(),n.rowGroupIndex=e.isRowGroupActive()?t.indexOf(e):null,n.pivot=e.isPivotActive(),n.pivotIndex=e.isPivotActive()?i.indexOf(e):null,n.aggFunc=e.isValueActive()?e.getAggFunc():null,n.hide=!e.isVisible()||void 0,n.pinned=e.isPinned()?e.getPinned():null,n.sort=e.getSort()?e.getSort():null,n.sortIndex=null!=e.getSortIndex()?e.getSortIndex():null,n}};Uc=f([he("columnDefFactory")],Uc);var zc=class{getInitialRowClasses(e){const t=[];return b(e.extraCssClass)&&t.push(e.extraCssClass),t.push("ag-row"),t.push(e.rowFocused?"ag-row-focus":"ag-row-no-focus"),e.fadeRowIn&&t.push("ag-opacity-zero"),t.push(e.rowIsEven?"ag-row-even":"ag-row-odd"),e.rowNode.isRowPinned()&&t.push("ag-row-pinned"),e.rowNode.isSelected()&&t.push("ag-row-selected"),e.rowNode.footer&&t.push("ag-row-footer"),t.push("ag-row-level-"+e.rowLevel),e.rowNode.stub&&t.push("ag-row-loading"),e.fullWidthRow&&t.push("ag-full-width-row"),e.expandable&&(t.push("ag-row-group"),t.push(e.rowNode.expanded?"ag-row-group-expanded":"ag-row-group-contracted")),e.rowNode.dragging&&t.push("ag-row-dragging"),ze(t,this.processClassesFromGridOptions(e.rowNode)),ze(t,this.preProcessRowClassRules(e.rowNode)),t.push(e.printLayout?"ag-row-position-relative":"ag-row-position-absolute"),e.firstRowOnPage&&t.push("ag-row-first"),e.lastRowOnPage&&t.push("ag-row-last"),e.fullWidthRow&&("left"===e.pinned&&t.push("ag-cell-last-left-pinned"),"right"===e.pinned&&t.push("ag-cell-first-right-pinned")),t}processClassesFromGridOptions(e){const t=[],i=e=>{"string"==typeof e?t.push(e):Array.isArray(e)&&e.forEach(e=>t.push(e))},n=this.gos.get("rowClass");if(n){if("function"==typeof n)return console.warn("AG Grid: rowClass should not be a function, please use getRowClass instead"),[];i(n)}const s=this.gos.getCallback("getRowClass");return s&&i(s({data:e.data,node:e,rowIndex:e.rowIndex})),t}preProcessRowClassRules(e){const t=[];return this.processRowClassRules(e,e=>{t.push(e)},e=>{}),t}processRowClassRules(e,t,i){const n=this.gos.addGridCommonParams({data:e.data,node:e,rowIndex:e.rowIndex});this.stylingService.processClassRules(void 0,this.gos.get("rowClassRules"),n,t,i)}calculateRowLevel(e){return e.group?e.level:e.parent?e.parent.level+1:0}};f([ue("stylingService")],zc.prototype,"stylingService",2),f([ue("gridOptionsService")],zc.prototype,"gos",2),zc=f([he("rowCssClassCalculator")],zc);var Wc=class extends st{init(){this.isAccentedSort=this.gos.get("accentedSort"),this.primaryColumnsSortGroups=this.gos.isColumnsSortingCoupledToGroup(),this.addManagedPropertyListener("accentedSort",e=>this.isAccentedSort=e.currentValue),this.addManagedPropertyListener("autoGroupColumnDef",()=>this.primaryColumnsSortGroups=this.gos.isColumnsSortingCoupledToGroup())}doFullSort(e,t){const i=e.map((e,t)=>({currentPos:t,rowNode:e}));return i.sort(this.compareRowNodes.bind(this,t)),i.map(e=>e.rowNode)}compareRowNodes(e,t,i){const n=t.rowNode,s=i.rowNode;for(let t=0,i=e.length;t<i;t++){const i=e[t],r="desc"===i.sort,o=this.getValue(n,i.column),a=this.getValue(s,i.column);let l;const c=this.getComparator(i,n);if(l=c?c(o,a,n,s,r):cs.defaultComparator(o,a,this.isAccentedSort),!isNaN(l)&&0!==l)return"asc"===i.sort?l:-1*l}return t.currentPos-i.currentPos}getComparator(e,t){const i=e.column,n=i.getColDef().comparator;if(null!=n)return n;if(!i.getColDef().showRowGroup)return;const s=!t.group&&i.getColDef().field;if(!s)return;const r=this.columnModel.getPrimaryColumn(s);return r?r.getColDef().comparator:void 0}getValue(e,t){var i,n;if(!this.primaryColumnsSortGroups)return this.valueService.getValue(t,e,!1,!1);if(e.rowGroupColumn===t){if(this.gos.isGroupUseEntireRow(this.columnModel.isPivotActive())){const n=null==(i=e.allLeafChildren)?void 0:i[0];return n?this.valueService.getValue(t,n,!1,!1):void 0}const s=this.columnModel.getGroupDisplayColumnForGroup(t.getId());if(!s)return;return null==(n=e.groupData)?void 0:n[s.getId()]}return e.group&&t.getColDef().showRowGroup?void 0:this.valueService.getValue(t,e,!1,!1)}};f([ue("valueService")],Wc.prototype,"valueService",2),f([ue("columnModel")],Wc.prototype,"columnModel",2),f([le],Wc.prototype,"init",1),Wc=f([he("rowNodeSorter")],Wc);var jc=class extends st{constructor(){super(...arguments),this.params={},this.ready=!1,this.readyCallbacks=[]}checkReady(){const e=this.params;this.ready=null!=e.gridCtrl&&null!=e.gridBodyCtrl&&null!=e.center&&null!=e.left&&null!=e.right&&null!=e.bottomCenter&&null!=e.bottomLeft&&null!=e.bottomRight&&null!=e.topCenter&&null!=e.topLeft&&null!=e.topRight&&null!=e.stickyTopCenter&&null!=e.stickyTopLeft&&null!=e.stickyTopRight&&null!=e.stickyBottomCenter&&null!=e.stickyBottomLeft&&null!=e.stickyBottomRight&&null!=e.centerHeader&&null!=e.leftHeader&&null!=e.rightHeader&&null!=e.fakeHScrollComp&&null!=e.fakeVScrollComp&&null!=e.gridHeaderCtrl,this.ready&&(this.readyCallbacks.forEach(t=>t(e)),this.readyCallbacks.length=0)}whenReady(e){this.ready?e(this.params):this.readyCallbacks.push(e)}register(e,t){this.params[e]=t,this.checkReady()}registerHeaderContainer(e,t){switch(t){case"left":this.params.leftHeader=e;break;case"right":this.params.rightHeader=e;break;default:this.params.centerHeader=e}this.checkReady()}get(e){return this.params[e]}getParams(){return this.params}getGridBodyCtrl(){return this.params.gridBodyCtrl}getHeaderRowContainerCtrls(){return[this.params.leftHeader,this.params.rightHeader,this.params.centerHeader]}getHeaderRowContainerCtrl(e){switch(e){case"left":return this.params.leftHeader;case"right":return this.params.rightHeader;default:return this.params.centerHeader}}};jc.NAME="ctrlsService",jc=f([he(jc.NAME)],jc);var $c=class extends st{constructor(){super(...arguments),this.registry={}}register(e){this.registry[e.controllerName]=e.controllerClass}getInstance(e){const t=this.registry[e];if(null!=t)return new t}};$c=f([he("ctrlsFactory")],$c);var Kc=class extends vs{constructor(e,t){super(e),this.direction=t,this.hideTimeout=null}postConstruct(){this.addManagedListener(this.eventService,ct.EVENT_SCROLL_VISIBILITY_CHANGED,this.onScrollVisibilityChanged.bind(this)),this.onScrollVisibilityChanged(),this.addOrRemoveCssClass("ag-apple-scrollbar",ki()||Pi())}initialiseInvisibleScrollbar(){void 0===this.invisibleScrollbar&&(this.invisibleScrollbar=Vi(),this.invisibleScrollbar&&(this.hideAndShowInvisibleScrollAsNeeded(),this.addActiveListenerToggles()))}addActiveListenerToggles(){const e=this.getGui();["mouseenter","mousedown","touchstart"].forEach(t=>this.addManagedListener(e,t,()=>this.addOrRemoveCssClass("ag-scrollbar-active",!0))),["mouseleave","touchend"].forEach(t=>this.addManagedListener(e,t,()=>this.addOrRemoveCssClass("ag-scrollbar-active",!1)))}onScrollVisibilityChanged(){void 0===this.invisibleScrollbar&&this.initialiseInvisibleScrollbar(),this.animationFrameService.requestAnimationFrame(()=>this.setScrollVisible())}hideAndShowInvisibleScrollAsNeeded(){this.addManagedListener(this.eventService,ct.EVENT_BODY_SCROLL,e=>{e.direction===this.direction&&(null!==this.hideTimeout&&(window.clearTimeout(this.hideTimeout),this.hideTimeout=null),this.addOrRemoveCssClass("ag-scrollbar-scrolling",!0))}),this.addManagedListener(this.eventService,ct.EVENT_BODY_SCROLL_END,()=>{this.hideTimeout=window.setTimeout(()=>{this.addOrRemoveCssClass("ag-scrollbar-scrolling",!1),this.hideTimeout=null},400)})}attemptSettingScrollPosition(e){const t=this.getViewport();ee(()=>xn(t),()=>this.setScrollPosition(e),100)}getViewport(){return this.eViewport}getContainer(){return this.eContainer}onScrollCallback(e){this.addManagedListener(this.getViewport(),"scroll",e)}};f([bs("eViewport")],Kc.prototype,"eViewport",2),f([bs("eContainer")],Kc.prototype,"eContainer",2),f([ue("scrollVisibleService")],Kc.prototype,"scrollVisibleService",2),f([ue("ctrlsService")],Kc.prototype,"ctrlsService",2),f([ue("animationFrameService")],Kc.prototype,"animationFrameService",2);var Yc=class e extends Kc{constructor(){super(e.TEMPLATE,"horizontal")}postConstruct(){super.postConstruct();const e=this.setFakeHScrollSpacerWidths.bind(this);this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_PINNED_ROW_DATA_CHANGED,this.onPinnedRowDataChanged.bind(this)),this.addManagedPropertyListener("domLayout",e),this.ctrlsService.register("fakeHScrollComp",this),this.createManagedBean(new ga(e=>this.eContainer.style.width=`${e}px`)),this.addManagedPropertyListeners(["suppressHorizontalScroll"],this.onScrollVisibilityChanged.bind(this))}initialiseInvisibleScrollbar(){void 0===this.invisibleScrollbar&&(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 i=!this.enableRtl&&e,n=this.gos.getScrollbarWidth();i&&(t+=n),Pn(this.eRightSpacer,t),this.eRightSpacer.classList.toggle("ag-scroller-corner",t<=n);let s=this.columnModel.getDisplayedColumnsLeftWidth();this.enableRtl&&e&&(s+=n),Pn(this.eLeftSpacer,s),this.eLeftSpacer.classList.toggle("ag-scroller-corner",s<=n)}setScrollVisible(){const e=this.scrollVisibleService.isHorizontalScrollShowing(),t=this.invisibleScrollbar,i=this.gos.get("suppressHorizontalScroll"),n=e&&this.gos.getScrollbarWidth()||0,s=i?0:0===n&&t?16:n;this.addOrRemoveCssClass("ag-scrollbar-invisible",t),Ln(this.getGui(),s),Ln(this.eViewport,s),Ln(this.eContainer,s),this.setDisplayed(e,{skipAriaHidden:!0})}getScrollPosition(){return vn(this.getViewport(),this.enableRtl)}setScrollPosition(e){xn(this.getViewport())||this.attemptSettingScrollPosition(e),bn(this.getViewport(),e,this.enableRtl)}};Yc.TEMPLATE='<div class="ag-body-horizontal-scroll" aria-hidden="true">\n            <div class="ag-horizontal-left-spacer" ref="eLeftSpacer"></div>\n            <div class="ag-body-horizontal-scroll-viewport" ref="eViewport">\n                <div class="ag-body-horizontal-scroll-container" ref="eContainer"></div>\n            </div>\n            <div class="ag-horizontal-right-spacer" ref="eRightSpacer"></div>\n        </div>',f([bs("eLeftSpacer")],Yc.prototype,"eLeftSpacer",2),f([bs("eRightSpacer")],Yc.prototype,"eRightSpacer",2),f([ue("columnModel")],Yc.prototype,"columnModel",2),f([ue("pinnedRowModel")],Yc.prototype,"pinnedRowModel",2),f([le],Yc.prototype,"postConstruct",1);var qc=Yc,Xc=class extends st{postConstruct(){const e=this.checkContainerWidths.bind(this);this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,e),this.addManagedPropertyListener("domLayout",e)}checkContainerWidths(){const e=this.gos.isDomLayout("print"),t=e?0:this.columnModel.getDisplayedColumnsLeftWidth(),i=e?0:this.columnModel.getDisplayedColumnsRightWidth();t!=this.leftWidth&&(this.leftWidth=t,this.eventService.dispatchEvent({type:ct.EVENT_LEFT_PINNED_WIDTH_CHANGED})),i!=this.rightWidth&&(this.rightWidth=i,this.eventService.dispatchEvent({type:ct.EVENT_RIGHT_PINNED_WIDTH_CHANGED}))}getPinnedRightWidth(){return this.rightWidth}getPinnedLeftWidth(){return this.leftWidth}};f([ue("columnModel")],Xc.prototype,"columnModel",2),f([le],Xc.prototype,"postConstruct",1),Xc=f([he("pinnedWidthService")],Xc);var Zc=class extends st{constructor(){super(...arguments),this.events=[]}postConstruct(){"clientSide"==this.rowModel.getType()&&(this.clientSideRowModel=this.rowModel)}dispatchExpanded(e,t){if(null==this.clientSideRowModel)return void this.eventService.dispatchEvent(e);this.events.push(e);const i=()=>{this.clientSideRowModel&&this.clientSideRowModel.onRowGroupOpened(),this.events.forEach(e=>this.eventService.dispatchEvent(e)),this.events=[]};t?i():(null==this.dispatchExpandedDebounced&&(this.dispatchExpandedDebounced=this.animationFrameService.debounce(i)),this.dispatchExpandedDebounced())}};f([ue("animationFrameService")],Zc.prototype,"animationFrameService",2),f([ue("rowModel")],Zc.prototype,"rowModel",2),f([le],Zc.prototype,"postConstruct",1),Zc=f([he("rowNodeEventThrottle")],Zc);var Qc=(e,t)=>{var i;return"clientSide"===(null!=(i=t.rowModelType)?i:"clientSide")?{module:"@ag-grid-enterprise/row-grouping"}:null},Jc={enableRowGroup:Qc,rowGroup:Qc,rowGroupIndex:Qc,enablePivot:Qc,enableValue:Qc,pivot:Qc,pivotIndex:Qc,aggFunc:Qc,cellEditor:e=>"agRichSelect"===e.cellEditor||"agRichSelectCellEditor"===e.cellEditor?{module:"@ag-grid-enterprise/rich-select"}:null,menuTabs:e=>{var t;const i=["columnsMenuTab","generalMenuTab"];return(null==(t=e.menuTabs)?void 0:t.some(e=>i.includes(e)))?{module:"@ag-grid-enterprise/menu"}:null},columnsMenuParams:{module:["@ag-grid-enterprise/menu","@ag-grid-enterprise/column-tool-panel"]},columnChooserParams:{module:["@ag-grid-enterprise/menu","@ag-grid-enterprise/column-tool-panel"]},headerCheckboxSelection:{supportedRowModels:["clientSide","serverSide"],dependencies:(e,{rowSelection:t})=>"multiple"===t?null:"headerCheckboxSelection is only supported with rowSelection=multiple"},headerCheckboxSelectionFilteredOnly:{supportedRowModels:["clientSide"],dependencies:(e,{rowSelection:t})=>"multiple"===t?null:"headerCheckboxSelectionFilteredOnly is only supported with rowSelection=multiple"},headerCheckboxSelectionCurrentPageOnly:{supportedRowModels:["clientSide"],dependencies:(e,{rowSelection:t})=>"multiple"===t?null:"headerCheckboxSelectionCurrentPageOnly is only supported with rowSelection=multiple"},children:()=>eh},eh={objectName:"colDef",allProperties:Object.keys({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}),docsUrl:"column-properties/",deprecations:{columnsMenuParams:{version:"31.1",message:"Use `columnChooserParams` instead."},suppressMenu:{version:"31.1",message:"Use `suppressHeaderMenuButton` instead."},suppressCellFlash:{version:"31.2",message:"Use `enableCellChangeFlash={false}` in the ColDef"},dndSource:{version:"31.2",message:"This feature has been replaced by `Row Dragging to an External DropZone`."},dndSourceOnRowDrag:{version:"31.2",message:"This feature has been replaced by `Row Dragging to an External DropZone`."}},validations:Jc},th={suppressContextMenu:!1,preventDefaultOnContextMenu:!1,allowContextMenuWithControlKey:!1,suppressMenuHide:!1,enableBrowserTooltips:!1,tooltipTrigger:"hover",tooltipShowDelay:2e3,tooltipHideDelay:1e4,tooltipMouseTrack:!1,tooltipShowMode:"standard",tooltipInteraction:!1,copyHeadersToClipboard:!1,copyGroupHeadersToClipboard:!1,clipboardDelimiter:"\t",suppressCopyRowsToClipboard:!1,suppressCopySingleCellRanges:!1,suppressLastEmptyLineOnPaste:!1,suppressClipboardPaste:!1,suppressClipboardApi:!1,suppressCutToClipboard:!1,maintainColumnOrder:!1,suppressFieldDotNotation:!1,allowDragFromColumnsToolPanel:!1,suppressMovableColumns:!1,suppressColumnMoveAnimation:!1,suppressDragLeaveHidesColumns:!1,suppressRowGroupHidesColumns:!1,suppressAutoSize:!1,autoSizePadding:20,skipHeaderOnAutoSize:!1,singleClickEdit:!1,suppressClickEdit:!1,readOnlyEdit:!1,stopEditingWhenCellsLoseFocus:!1,enterNavigatesVertically:!1,enterNavigatesVerticallyAfterEdit:!1,enableCellEditingOnBackspace:!1,undoRedoCellEditing:!1,undoRedoCellEditingLimit:10,suppressCsvExport:!1,suppressExcelExport:!1,cacheQuickFilter:!1,includeHiddenColumnsInQuickFilter:!1,excludeChildrenWhenTreeDataFiltering:!1,enableAdvancedFilter:!1,includeHiddenColumnsInAdvancedFilter:!1,enableCharts:!1,suppressChartToolPanelsButton:!1,masterDetail:!1,keepDetailRows:!1,keepDetailRowsCount:10,detailRowAutoHeight:!1,tabIndex:0,rowBuffer:10,valueCache:!1,valueCacheNeverExpires:!1,enableCellExpressions:!1,suppressTouch:!1,suppressFocusAfterRefresh:!1,suppressAsyncEvents:!1,suppressBrowserResizeObserver:!1,suppressPropertyNamesCheck:!1,suppressChangeDetection:!1,debug:!1,suppressLoadingOverlay:!1,suppressNoRowsOverlay:!1,pagination:!1,paginationPageSize:100,paginationPageSizeSelector:!0,paginationAutoPageSize:!1,paginateChildRows:!1,suppressPaginationPanel:!1,pivotMode:!1,pivotPanelShow:"never",pivotDefaultExpanded:0,pivotSuppressAutoColumn:!1,suppressExpandablePivotGroups:!1,functionsReadOnly:!1,suppressAggFuncInHeader:!1,alwaysAggregateAtRootLevel:!1,aggregateOnlyChangedColumns:!1,suppressAggFilteredOnly:!1,removePivotHeaderRowWhenSingleValueColumn:!1,animateRows:!0,enableCellChangeFlash:!1,cellFlashDelay:500,cellFlashDuration:500,cellFadeDelay:1e3,cellFadeDuration:1e3,allowShowChangeAfterFilter:!1,domLayout:"normal",ensureDomOrder:!1,enableRtl:!1,suppressColumnVirtualisation:!1,suppressMaxRenderedRowRestriction:!1,suppressRowVirtualisation:!1,rowDragManaged:!1,suppressRowDrag:!1,suppressMoveWhenRowDragging:!1,rowDragEntireRow:!1,rowDragMultiRow:!1,embedFullWidthRows:!1,groupDisplayType:"singleColumn",groupDefaultExpanded:0,groupMaintainOrder:!1,groupSelectsChildren:!1,groupIncludeTotalFooter:!1,groupSuppressBlankHeader:!1,groupSelectsFiltered:!1,showOpenedGroup:!1,groupRemoveSingleChildren:!1,groupRemoveLowestSingleChildren:!1,groupHideOpenParents:!1,groupAllowUnbalanced:!1,rowGroupPanelShow:"never",suppressMakeColumnVisibleAfterUnGroup:!1,treeData:!1,rowGroupPanelSuppressSort:!1,suppressGroupRowsSticky:!1,rowModelType:"clientSide",asyncTransactionWaitMillis:50,suppressModelUpdateAfterUpdateTransaction:!1,cacheOverflowSize:1,infiniteInitialRowCount:1,serverSideInitialRowCount:1,suppressServerSideInfiniteScroll:!1,cacheBlockSize:100,maxBlocksInCache:-1,maxConcurrentDatasourceRequests:2,blockLoadDebounceMillis:0,purgeClosedRowNodes:!1,serverSideSortAllLevels:!1,serverSideOnlyRefreshFilteredGroups:!1,serverSideSortOnServer:!1,serverSideFilterOnServer:!1,serverSidePivotResultFieldSeparator:"_",viewportRowModelPageSize:5,viewportRowModelBufferSize:5,alwaysShowHorizontalScroll:!1,alwaysShowVerticalScroll:!1,debounceVerticalScrollbar:!1,suppressHorizontalScroll:!1,suppressScrollOnNewData:!1,suppressScrollWhenPopupsAreOpen:!1,suppressAnimationFrame:!1,suppressMiddleClickScrolls:!1,suppressPreventDefaultOnMouseWheel:!1,rowMultiSelectWithClick:!1,suppressRowDeselection:!1,suppressRowClickSelection:!1,suppressCellFocus:!1,suppressHeaderFocus:!1,suppressMultiRangeSelection:!1,enableCellTextSelection:!1,enableRangeSelection:!1,enableRangeHandle:!1,enableFillHandle:!1,fillHandleDirection:"xy",suppressClearOnFillReduction:!1,accentedSort:!1,unSortIcon:!1,suppressMultiSort:!1,alwaysMultiSort:!1,suppressMaintainUnsortedOrder:!1,suppressRowHoverHighlight:!1,suppressRowTransform:!1,columnHoverHighlight:!1,deltaSort:!1,enableGroupEdit:!1,suppressGroupMaintainValueType:!1,functionsPassive:!1,groupLockGroupColumns:0,serverSideEnableClientSideSort:!1,suppressServerSideFullWidthLoadingRow:!1,pivotMaxGeneratedColumns:-1},ih={sideBar:{module:"@ag-grid-enterprise/side-bar"},statusBar:{module:"@ag-grid-enterprise/status-bar"},enableCharts:{module:"@ag-grid-enterprise/charts"},getMainMenuItems:{module:"@ag-grid-enterprise/menu"},getContextMenuItems:{module:"@ag-grid-enterprise/menu"},allowContextMenuWithControlKey:{module:"@ag-grid-enterprise/menu"},enableAdvancedFilter:{module:"@ag-grid-enterprise/advanced-filter"},treeData:{supportedRowModels:["clientSide","serverSide"],module:"@ag-grid-enterprise/row-grouping",dependencies:e=>{var t;const i=null!=(t=e.rowModelType)?t:"clientSide";switch(i){case"clientSide":const t=`treeData requires 'getDataPath' in the ${i} row model.`;return e.getDataPath?null:t;case"serverSide":const n=`treeData requires 'isServerSideGroup' and 'getServerSideGroupKey' in the ${i} row model.`;return e.isServerSideGroup&&e.getServerSideGroupKey?null:n}return null}},masterDetail:{module:"@ag-grid-enterprise/master-detail"},enableRangeSelection:{module:"@ag-grid-enterprise/range-selection"},enableRangeHandle:{dependencies:{enableRangeSelection:[!0]}},enableFillHandle:{dependencies:{enableRangeSelection:[!0]}},groupDefaultExpanded:{supportedRowModels:["clientSide"]},groupIncludeFooter:{supportedRowModels:["clientSide","serverSide"],dependencies:e=>{var t;switch(null!=(t=e.rowModelType)?t:"clientSide"){case"clientSide":return null;case"serverSide":const t="groupIncludeFooter is not supported alongside suppressServerSideInfiniteScroll";return e.suppressServerSideInfiniteScroll?t: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:()=>eh,defaultColDef:()=>eh,defaultColGroupDef:()=>eh,autoGroupColumnDef:()=>eh},nh={objectName:"gridOptions",allProperties:[...Pt.ALL_PROPERTIES,...Lt.EVENT_CALLBACKS],propertyExceptions:["api","columnApi"],docsUrl:"grid-options/",deprecations:{enableChartToolPanelsButton:{version:"29"},functionsPassive:{version:"29.2"},onColumnRowGroupChangeRequest:{version:"29.2"},onColumnPivotChangeRequest:{version:"29.2"},onColumnValueChangeRequest:{version:"29.2"},onColumnAggFuncChangeRequest:{version:"29.2"},serverSideFilterAllLevels:{version:"30",message:"All server-side group levels are now filtered by default. This can be toggled using `serverSideOnlyRefreshFilteredGroups`."},suppressAggAtRootLevel:{version:"30",message:"The root level aggregation is now suppressed by default. This can be toggled using  `alwaysAggregateAtRootLevel`."},excludeHiddenColumnsFromQuickFilter:{version:"30",message:"Hidden columns are now excluded from the Quick Filter by default. This can be toggled using `includeHiddenColumnsInQuickFilter`."},enterMovesDown:{version:"30",renamed:"enterNavigatesVertically"},enterMovesDownAfterEdit:{version:"30",renamed:"enterNavigatesVerticallyAfterEdit"},suppressParentsInRowNodes:{version:"30.2",message:"Using suppressParentsInRowNodes is no longer recommended. To serialize nodes it is now recommended to instead remove the parent node reference before serialization."},advancedFilterModel:{version:"31",message:"Use `initialState.filter.advancedFilterModel` instead."},suppressAsyncEvents:{version:"31",message:"Events should be handled asynchronously."},cellFadeDelay:{version:"31.1",renamed:"cellFadeDuration"},cellFlashDelay:{version:"31.1",renamed:"cellFlashDuration"},suppressServerSideInfiniteScroll:{version:"31.1"},serverSideSortOnServer:{version:"31.1"},serverSideFilterOnServer:{version:"31.1"},enableCellChangeFlash:{version:"31.2",message:"Use `enableCellChangeFlash` in the `ColDef` or `defaultColDef` for all columns."},groupIncludeFooter:{version:"31.3",message:"Use `groupTotalRow` instead."},groupIncludeTotalFooter:{version:"31.3",message:"Use `grandTotalRow` instead."}},validations:ih},sh=class{constructor(){this.destroyed=!1,this.domDataKey="__AG_"+Math.random().toString(),this.propertyEventService=new me,this.globalEventHandlerFactory=e=>(t,i)=>{if(this.destroyed)return;const n=ht.has(t);if(n&&!e||!n&&e)return;const s=Lt.getCallbackForEvent(t),r=this.gridOptions[s];"function"==typeof r&&this.frameworkOverrides.wrapOutgoing(()=>{r(i)})}}get context(){return this.gridOptions.context}init(){this.columnApi=new hc(this.api);const e=!this.get("suppressAsyncEvents");this.eventService.addGlobalListener(this.globalEventHandlerFactory().bind(this),e),this.eventService.addGlobalListener(this.globalEventHandlerFactory(!0).bind(this),!1),this.propertyEventService.setFrameworkOverrides(this.frameworkOverrides),this.getScrollbarWidth()}destroy(){this.destroyed=!0,this.columnApi=void 0}get(e){var t;return null!=(t=this.gridOptions[e])?t:th[e]}getCallback(e){return this.mergeGridCommonParams(this.gridOptions[e])}exists(e){return b(this.gridOptions[e])}mergeGridCommonParams(e){return e?t=>{const i=t;return i.api=this.api,i.columnApi=this.columnApi,i.context=this.context,e(i)}:e}static toBoolean(e){return"boolean"==typeof e?e:"string"==typeof e&&("TRUE"===e.toUpperCase()||""==e)}static toNumber(e){if("number"==typeof e)return e;if("string"==typeof e){const t=parseInt(e);if(isNaN(t))return;return t}}static toConstrainedNum(e,t){return i=>{const n=sh.toNumber(i);if(!(null==n||n<e||n>t))return n}}static getCoercedValue(e,t){const i=sh.PROPERTY_COERCIONS.get(e);return i?i(t):t}static getCoercedGridOptions(e){const t={};return Object.entries(e).forEach(([e,i])=>{const n=sh.getCoercedValue(e,i);t[e]=n}),t}updateGridOptions({options:e,force:t,source:i="api"}){const n={id:sh.changeSetId++,properties:[]},s=[];Object.entries(e).forEach(([e,r])=>{"api"===i&&Rt[e]&&z(`${e} is an initial property and cannot be updated.`);const o=sh.getCoercedValue(e,r),a=t||"object"==typeof o&&"api"===i,l=this.gridOptions[e];if(a||l!==o){this.gridOptions[e]=o;const t={type:e,currentValue:o,previousValue:l,changeSet:n,source:i};s.push(t)}}),this.validationService.processGridOptions(this.gridOptions),n.properties=s.map(e=>e.type),s.forEach(e=>{this.gridOptions.debug&&console.log(`AG Grid: Updated property ${e.type} from `,e.previousValue," to  ",e.currentValue),this.propertyEventService.dispatchEvent(e)})}addEventListener(e,t){this.propertyEventService.addEventListener(e,t)}removeEventListener(e,t){this.propertyEventService.removeEventListener(e,t)}getScrollbarWidth(){if(null==this.scrollbarWidth){const e="number"==typeof this.gridOptions.scrollbarWidth&&this.gridOptions.scrollbarWidth>=0?this.gridOptions.scrollbarWidth:Gi();null!=e&&(this.scrollbarWidth=e,this.eventService.dispatchEvent({type:ct.EVENT_SCROLLBAR_WIDTH_CHANGED}))}return this.scrollbarWidth}isRowModelType(e){return this.gridOptions.rowModelType===e||"clientSide"===e&&C(this.gridOptions.rowModelType)}isDomLayout(e){var t;return(null!=(t=this.gridOptions.domLayout)?t:"normal")===e}isRowSelection(){return"single"===this.gridOptions.rowSelection||"multiple"===this.gridOptions.rowSelection}useAsyncEvents(){return!this.get("suppressAsyncEvents")}isGetRowHeightFunction(){return"function"==typeof this.gridOptions.getRowHeight}getRowHeightForNode(e,t=!1,i){if(null==i&&(i=this.environment.getDefaultRowHeight()),this.isGetRowHeightFunction()){if(t)return{height:i,estimated:!0};const n={node:e,data:e.data},s=this.getCallback("getRowHeight")(n);if(this.isNumeric(s))return 0===s&&z("The return of `getRowHeight` cannot be zero. If the intention is to hide rows, use a filter instead."),{height:Math.max(1,s),estimated:!1}}return e.detail&&this.get("masterDetail")?this.getMasterDetailRowHeight():{height:this.gridOptions.rowHeight&&this.isNumeric(this.gridOptions.rowHeight)?this.gridOptions.rowHeight:i,estimated:!1}}getMasterDetailRowHeight(){return this.get("detailRowAutoHeight")?{height:1,estimated:!1}:this.isNumeric(this.gridOptions.detailRowHeight)?{height:this.gridOptions.detailRowHeight,estimated:!1}:{height:300,estimated:!1}}getRowHeightAsNumber(){if(!this.gridOptions.rowHeight||C(this.gridOptions.rowHeight))return this.environment.getDefaultRowHeight();const e=this.environment.refreshRowHeightVariable();return-1!==e?e:(console.warn("AG Grid row height must be a number if not using standard row model"),this.environment.getDefaultRowHeight())}isNumeric(e){return!isNaN(e)&&"number"==typeof e&&isFinite(e)}getDomDataKey(){return this.domDataKey}getDomData(e,t){const i=e[this.getDomDataKey()];return i?i[t]:void 0}setDomData(e,t,i){const n=this.getDomDataKey();let s=e[n];C(s)&&(s={},e[n]=s),s[t]=i}getDocument(){let e=null;return this.gridOptions.getDocument&&b(this.gridOptions.getDocument)?e=this.gridOptions.getDocument():this.eGridDiv&&(e=this.eGridDiv.ownerDocument),e&&b(e)?e:document}getWindow(){return this.getDocument().defaultView||window}getRootNode(){return this.eGridDiv.getRootNode()}getActiveDomElement(){return this.getRootNode().activeElement}getAsyncTransactionWaitMillis(){return b(this.gridOptions.asyncTransactionWaitMillis)?this.gridOptions.asyncTransactionWaitMillis:50}isAnimateRows(){return!this.get("ensureDomOrder")&&this.get("animateRows")}isGroupRowsSticky(){return!(this.get("paginateChildRows")||this.get("groupHideOpenParents")||this.isDomLayout("print"))}isColumnsSortingCoupledToGroup(){const e=this.gridOptions.autoGroupColumnDef;return!(null==e?void 0:e.comparator)&&!this.get("treeData")}getGroupAggFiltering(){const e=this.gridOptions.groupAggFiltering;return"function"==typeof e?this.getCallback("groupAggFiltering"):!0===e?()=>!0:void 0}getGrandTotalRow(){const e=this.gridOptions.grandTotalRow;return e||(this.gridOptions.groupIncludeTotalFooter?"bottom":void 0)}getGroupTotalRowCallback(){const e=this.get("groupTotalRow");if("function"==typeof e)return this.getCallback("groupTotalRow");if(e)return()=>e;const t=this.get("groupIncludeFooter");if("function"==typeof t){const e=this.getCallback("groupIncludeFooter");return t=>e(t)?"bottom":void 0}return()=>t?"bottom":void 0}isGroupMultiAutoColumn(){return this.gridOptions.groupDisplayType?"multipleColumns"===this.gridOptions.groupDisplayType:this.get("groupHideOpenParents")}isGroupUseEntireRow(e){return!e&&"groupRows"===this.gridOptions.groupDisplayType}getGridCommonParams(){return{api:this.api,columnApi:this.columnApi,context:this.context}}addGridCommonParams(e){const t=e;return t.api=this.api,t.columnApi=this.columnApi,t.context=this.context,t}};sh.PROPERTY_COERCIONS=new Map([...Pt.BOOLEAN_PROPERTIES.map(e=>[e,sh.toBoolean]),...Pt.NUMBER_PROPERTIES.map(e=>[e,sh.toNumber]),["groupAggFiltering",e=>"function"==typeof e?e:sh.toBoolean(e)],["pageSize",sh.toConstrainedNum(1,Number.MAX_VALUE)],["autoSizePadding",sh.toConstrainedNum(0,Number.MAX_VALUE)],["keepDetailRowsCount",sh.toConstrainedNum(1,Number.MAX_VALUE)],["rowBuffer",sh.toConstrainedNum(0,Number.MAX_VALUE)],["infiniteInitialRowCount",sh.toConstrainedNum(1,Number.MAX_VALUE)],["cacheOverflowSize",sh.toConstrainedNum(1,Number.MAX_VALUE)],["cacheBlockSize",sh.toConstrainedNum(1,Number.MAX_VALUE)],["serverSideInitialRowCount",sh.toConstrainedNum(1,Number.MAX_VALUE)],["viewportRowModelPageSize",sh.toConstrainedNum(1,Number.MAX_VALUE)],["viewportRowModelBufferSize",sh.toConstrainedNum(0,Number.MAX_VALUE)]]),sh.changeSetId=0,f([ue("gridOptions")],sh.prototype,"gridOptions",2),f([ue("eventService")],sh.prototype,"eventService",2),f([ue("environment")],sh.prototype,"environment",2),f([ue("frameworkOverrides")],sh.prototype,"frameworkOverrides",2),f([ue("eGridDiv")],sh.prototype,"eGridDiv",2),f([ue("validationService")],sh.prototype,"validationService",2),f([ue("gridApi")],sh.prototype,"api",2),f([le],sh.prototype,"init",1),f([ce],sh.prototype,"destroy",1),sh=f([he("gridOptionsService")],sh);var rh=class extends st{getLocaleTextFunc(){const e=this.gos.getCallback("getLocaleText");if(e)return(t,i,n)=>e({key:t,defaultValue:i,variableValues:n});const t=this.gos.get("localeText");return(e,i,n)=>{let s=t&&t[e];if(s&&n&&n.length){let e=0;for(;!(e>=n.length)&&-1!==s.indexOf("${variable}");)s=s.replace("${variable}",n[e++])}return null!=s?s:i}}};rh=f([he("localeService")],rh);var oh=class e extends Kc{constructor(){super(e.TEMPLATE,"vertical")}postConstruct(){super.postConstruct(),this.createManagedBean(new da(this.eContainer)),this.ctrlsService.register("fakeVScrollComp",this),this.addManagedListener(this.eventService,ct.EVENT_ROW_CONTAINER_HEIGHT_CHANGED,this.onRowContainerHeightChanged.bind(this))}setScrollVisible(){const e=this.scrollVisibleService.isVerticalScrollShowing(),t=this.invisibleScrollbar,i=e&&this.gos.getScrollbarWidth()||0,n=0===i&&t?16:i;this.addOrRemoveCssClass("ag-scrollbar-invisible",t),Pn(this.getGui(),n),Pn(this.eViewport,n),Pn(this.eContainer,n),this.setDisplayed(e,{skipAriaHidden:!0})}onRowContainerHeightChanged(){const{ctrlsService:e}=this,t=e.getGridBodyCtrl().getBodyViewportElement(),i=this.getScrollPosition(),n=t.scrollTop;i!=n&&this.setScrollPosition(n,!0)}getScrollPosition(){return this.getViewport().scrollTop}setScrollPosition(e,t){t||xn(this.getViewport())||this.attemptSettingScrollPosition(e),this.getViewport().scrollTop=e}};oh.TEMPLATE='<div class="ag-body-vertical-scroll" aria-hidden="true">\n            <div class="ag-body-vertical-scroll-viewport" ref="eViewport">\n                <div class="ag-body-vertical-scroll-container" ref="eContainer"></div>\n            </div>\n        </div>',f([le],oh.prototype,"postConstruct",1);var ah=oh,lh={january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},ch=["january","february","march","april","may","june","july","august","september","october","november","december"],hh=class extends st{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",e=>{this.processDataTypeDefinitions(),this.columnModel.recreateColumnDefs(Tt(e.source))})}processDataTypeDefinitions(){var e;const t=this.getDefaultDataTypes();this.dataTypeDefinitions={},Object.entries(t).forEach(([e,t])=>{this.dataTypeDefinitions[e]=p(d({},t),{groupSafeValueFormatter:this.createGroupSafeValueFormatter(t)})});const i=null!=(e=this.gos.get("dataTypeDefinitions"))?e:{};this.dataTypeMatchers={},Object.entries(i).forEach(([e,n])=>{const s=this.processDataTypeDefinition(n,i,[e],t);s&&(this.dataTypeDefinitions[e]=s,n.dataTypeMatcher&&(this.dataTypeMatchers[e]=n.dataTypeMatcher))}),this.checkObjectValueHandlers(t),["dateString","text","number","boolean","date"].forEach(e=>{const i=this.dataTypeMatchers[e];i&&delete this.dataTypeMatchers[e],this.dataTypeMatchers[e]=null!=i?i:t[e].dataTypeMatcher})}mergeDataTypeDefinitions(e,t){const i=d(d({},e),t);return e.columnTypes&&t.columnTypes&&t.appendColumnTypes&&(i.columnTypes=[...this.convertColumnTypes(e.columnTypes),...this.convertColumnTypes(t.columnTypes)]),i}processDataTypeDefinition(e,t,i,n){let s;const r=e.extendsDataType;if(e.columnTypes&&(this.isColumnTypeOverrideInDataTypeDefinitions=!0),e.extendsDataType===e.baseDataType){let i=n[r];const o=t[r];if(i&&o&&(i=o),!this.validateDataTypeDefinition(e,i,r))return;s=this.mergeDataTypeDefinitions(i,e)}else{if(i.includes(r))return void z('Data type definition hierarchies (via the "extendsDataType" property) cannot contain circular references.');const o=t[r];if(!this.validateDataTypeDefinition(e,o,r))return;const a=this.processDataTypeDefinition(o,t,[...i,r],n);if(!a)return;s=this.mergeDataTypeDefinitions(a,e)}return p(d({},s),{groupSafeValueFormatter:this.createGroupSafeValueFormatter(s)})}validateDataTypeDefinition(e,t,i){return t?t.baseDataType===e.baseDataType||(z('The "baseDataType" property of a data type definition must match that of its parent.'),!1):(z(`The data type definition ${i} does not exist.`),!1)}createGroupSafeValueFormatter(e){if(e.valueFormatter)return t=>{var i,n;if(null==(i=t.node)?void 0:i.group){const i=t.column.getAggFunc();if(i){if("first"===i||"last"===i)return e.valueFormatter(t);if("number"===e.baseDataType&&"count"!==i){if("number"==typeof t.value)return e.valueFormatter(t);if("object"==typeof t.value){if(!t.value)return;if("toNumber"in t.value)return e.valueFormatter(p(d({},t),{value:t.value.toNumber()}));if("value"in t.value)return e.valueFormatter(p(d({},t),{value:t.value.value}))}}}if(!this.gos.get("suppressGroupMaintainValueType"))return}else if(this.groupHideOpenParents&&t.column.isRowGroupActive()){if("string"!=typeof t.value||(null==(n=e.dataTypeMatcher)?void 0:n.call(e,t.value)))return e.valueFormatter(t);if(!this.gos.get("suppressGroupMaintainValueType"))return}return e.valueFormatter(t)}}updateColDefAndGetDataTypeDefinitionColumnType(e,t,i){let{cellDataType:n}=t;const{field:s}=t;if(void 0===n&&(n=e.cellDataType),null!=n&&!0!==n||(n=!!this.canInferCellDataType(e,t)&&this.inferCellDataType(s,i)),!n)return void(e.cellDataType=!1);const r=this.dataTypeDefinitions[n];if(r)return e.cellDataType=n,r.groupSafeValueFormatter&&(e.valueFormatter=r.groupSafeValueFormatter),r.valueParser&&(e.valueParser=r.valueParser),r.suppressDefaultProperties||this.setColDefPropertiesForBaseDataType(e,r,i),r.columnTypes;z(`Missing data type definition - "${n}"`)}updateColDefAndGetColumnType(e,t,i){var n,s;const r=this.updateColDefAndGetDataTypeDefinitionColumnType(e,t,i),o=null!=(s=null!=(n=t.type)?n:r)?s:e.type;return e.type=o,o?this.convertColumnTypes(o):void 0}addColumnListeners(e){if(!this.isWaitingForRowData)return;const t=this.columnStateUpdatesPendingInference[e.getColId()];if(!t)return;const i=e=>{t.add(e.key)};e.addEventListener(Se.EVENT_STATE_UPDATED,i),this.columnStateUpdateListenerDestroyFuncs.push(()=>e.removeEventListener(Se.EVENT_STATE_UPDATED,i))}canInferCellDataType(e,t){var i;if("clientSide"!==this.rowModel.getType())return!1;const n={cellRenderer:!0,valueGetter:!0,valueParser:!0,refData:!0};if(this.doColDefPropsPreventInference(t,n))return!1;const s=null===t.type?e.type:t.type;if(s){const e=null!=(i=this.gos.get("columnTypes"))?i:{};if(this.convertColumnTypes(s).some(t=>{const i=e[t.trim()];return i&&this.doColDefPropsPreventInference(i,n)}))return!1}return!this.doColDefPropsPreventInference(e,n)}doColDefPropsPreventInference(e,t){return[["cellRenderer","agSparklineCellRenderer"],["valueGetter",void 0],["valueParser",void 0],["refData",void 0]].some(([i,n])=>this.doesColDefPropPreventInference(e,t,i,n))}doesColDefPropPreventInference(e,t,i,n){if(!t[i])return!1;const s=e[i];return null===s?(t[i]=!1,!1):void 0===n?!!s:s===n}inferCellDataType(e,t){var i;if(!e)return;let n;const s=this.getInitialData();if(s){const t=e.indexOf(".")>=0&&!this.gos.get("suppressFieldDotNotation");n=F(s,e,t)}else this.initWaitForRowData(t);if(null==n)return;const[r]=null!=(i=Object.entries(this.dataTypeMatchers).find(([e,t])=>t(n)))?i:["object"];return r}getInitialData(){const e=this.gos.get("rowData");if(null==e?void 0:e.length)return e[0];if(this.initialData)return this.initialData;{const e=this.rowModel.getRootNode().allLeafChildren;if(null==e?void 0:e.length)return e[0].data}return null}initWaitForRowData(e){if(this.columnStateUpdatesPendingInference[e]=new Set,this.isWaitingForRowData)return;this.isWaitingForRowData=!0;const t=this.isColumnTypeOverrideInDataTypeDefinitions;t&&this.columnModel.queueResizeOperations();const i=this.addManagedListener(this.eventService,ct.EVENT_ROW_DATA_UPDATE_STARTED,e=>{const{firstRowData:n}=e;if(!n)return;null==i||i(),this.isWaitingForRowData=!1,this.processColumnsPendingInference(n,t),this.columnStateUpdatesPendingInference={},t&&this.columnModel.processResizeOperations();const s={type:ct.EVENT_DATA_TYPES_INFERRED};this.eventService.dispatchEvent(s)})}isPendingInference(){return this.isWaitingForRowData}processColumnsPendingInference(e,t){this.initialData=e;const i=[];this.columnStateUpdateListenerDestroyFuncs.forEach(e=>e()),this.columnStateUpdateListenerDestroyFuncs=[];const n={},s={};Object.entries(this.columnStateUpdatesPendingInference).forEach(([e,r])=>{const o=this.columnModel.getGridColumn(e);if(!o)return;const a=o.getColDef();if(!this.columnModel.resetColumnDefIntoColumn(o,"cellDataTypeInferred"))return;const l=o.getColDef();if(t&&l.type&&l.type!==a.type){const t=this.getUpdatedColumnState(o,r);t.rowGroup&&null==t.rowGroupIndex&&(n[e]=t),t.pivot&&null==t.pivotIndex&&(s[e]=t),i.push(t)}}),t&&i.push(...this.columnModel.generateColumnStateForRowGroupAndPivotIndexes(n,s)),i.length&&this.columnModel.applyColumnState({state:i},"cellDataTypeInferred"),this.initialData=null}getUpdatedColumnState(e,t){const i=this.columnModel.getColumnStateFromColDef(e);return t.forEach(e=>{delete i[e],"rowGroup"===e?delete i.rowGroupIndex:"pivot"===e&&delete i.pivotIndex}),i}checkObjectValueHandlers(e){const t=this.dataTypeDefinitions.object,i=e.object;this.hasObjectValueParser=t.valueParser!==i.valueParser,this.hasObjectValueFormatter=t.valueFormatter!==i.valueFormatter}convertColumnTypes(e){let t=[];return e instanceof Array?e.some(e=>"string"!=typeof e)?console.warn("if colDef.type is supplied an array it should be of type 'string[]'"):t=e:"string"==typeof e?t=e.split(","):console.warn("colDef.type should be of type 'string' | 'string[]'"),t}getDateStringTypeDefinition(e){var t;return e&&null!=(t=this.getDataTypeDefinition(e))?t:this.dataTypeDefinitions.dateString}getDateParserFunction(e){return this.getDateStringTypeDefinition(e).dateParser}getDateFormatterFunction(e){return this.getDateStringTypeDefinition(e).dateFormatter}getDataTypeDefinition(e){const t=e.getColDef();if(t.cellDataType)return this.dataTypeDefinitions[t.cellDataType]}getBaseDataType(e){var t;return null==(t=this.getDataTypeDefinition(e))?void 0:t.baseDataType}checkType(e,t){var i;if(null==t)return!0;const n=null==(i=this.getDataTypeDefinition(e))?void 0:i.dataTypeMatcher;return!n||n(t)}validateColDef(e){"object"===e.cellDataType&&(e.valueFormatter!==this.dataTypeDefinitions.object.groupSafeValueFormatter||this.hasObjectValueFormatter||z('Cell data type is "object" but no value formatter has been provided. Please either provide an object data type definition with a value formatter, or set "colDef.valueFormatter"'),e.editable&&e.valueParser===this.dataTypeDefinitions.object.valueParser&&!this.hasObjectValueParser&&z('Cell data type is "object" but no value parser has been provided. Please either provide an object data type definition with a value parser, or set "colDef.valueParser"'))}setColDefPropertiesForBaseDataType(e,t,i){const n=(e,i,n)=>{let s=e.getColDef().valueFormatter;return s===t.groupSafeValueFormatter&&(s=t.valueFormatter),this.valueService.formatValue(e,i,n,s)},s=re.__isRegistered("@ag-grid-enterprise/set-filter",this.context.getGridId()),r=this.localeService.getLocaleTextFunc(),o=t=>{const{filterParams:i}=e;e.filterParams="object"==typeof i?d(d({},i),t):t};switch(t.baseDataType){case"number":e.cellEditor="agNumberCellEditor",s&&o({comparator:(e,t)=>{const i=null==e?0:parseInt(e),n=null==t?0:parseInt(t);return i===n?0:i>n?1:-1}});break;case"boolean":e.cellEditor="agCheckboxCellEditor",e.cellRenderer="agCheckboxCellRenderer",e.suppressKeyboardEvent=e=>!!e.colDef.editable&&e.event.key===Zn.SPACE,o(s?{valueFormatter:e=>b(e.value)?r(String(e.value),e.value?"True":"False"):r("blanks","(Blanks)")}:{maxNumConditions:1,debounceMs:0,filterOptions:["empty",{displayKey:"true",displayName:"True",predicate:(e,t)=>t,numberOfInputs:0},{displayKey:"false",displayName:"False",predicate:(e,t)=>!1===t,numberOfInputs:0}]});break;case"date":e.cellEditor="agDateCellEditor",e.keyCreator=e=>n(e.column,e.node,e.value),s&&o({valueFormatter:e=>{const t=n(e.column,e.node,e.value);return b(t)?t:r("blanks","(Blanks)")},treeList:!0,treeListFormatter:(e,t)=>{if(1===t&&null!=e){const t=ch[Number(e)-1];return r(t,lh[t])}return null!=e?e:r("blanks","(Blanks)")}});break;case"dateString":{e.cellEditor="agDateStringCellEditor",e.keyCreator=e=>n(e.column,e.node,e.value);const i=t.dateParser;o(s?{valueFormatter:e=>{const t=n(e.column,e.node,e.value);return b(t)?t:r("blanks","(Blanks)")},treeList:!0,treeListPathGetter:e=>{const t=i(null!=e?e:void 0);return t?[String(t.getFullYear()),String(t.getMonth()+1),String(t.getDate())]:null},treeListFormatter:(e,t)=>{if(1===t&&null!=e){const t=ch[Number(e)-1];return r(t,lh[t])}return null!=e?e:r("blanks","(Blanks)")}}:{comparator:(e,t)=>{const n=i(t);return null==t||n<e?-1:n>e?1:0}});break}case"object":e.cellEditorParams={useFormatter:!0},e.comparator=(e,t)=>{const s=this.columnModel.getPrimaryColumn(i),r=null==s?void 0:s.getColDef();if(!s||!r)return 0;const o=null==e?"":n(s,null,e),a=null==t?"":n(s,null,t);return o===a?0:o>a?1:-1},e.keyCreator=e=>n(e.column,e.node,e.value),s?o({valueFormatter:e=>{const t=n(e.column,e.node,e.value);return b(t)?t:r("blanks","(Blanks)")}}):e.filterValueGetter=e=>n(e.column,e.node,this.valueService.getValue(e.column,e.node))}}getDefaultDataTypes(){const e=e=>!!e.match("^\\d{4}-\\d{2}-\\d{2}$"),t=this.localeService.getLocaleTextFunc();return{number:{baseDataType:"number",valueParser:e=>{var t,i;return""===(null==(i=null==(t=e.newValue)?void 0:t.trim)?void 0:i.call(t))?null:Number(e.newValue)},valueFormatter:e=>null==e.value?"":"number"!=typeof e.value||isNaN(e.value)?t("invalidNumber","Invalid Number"):String(e.value),dataTypeMatcher:e=>"number"==typeof e},text:{baseDataType:"text",valueParser:e=>""===e.newValue?null:S(e.newValue),dataTypeMatcher:e=>"string"==typeof e},boolean:{baseDataType:"boolean",valueParser:e=>{var t,i;return null==e.newValue?e.newValue:""===(null==(i=null==(t=e.newValue)?void 0:t.trim)?void 0:i.call(t))?null:"true"===String(e.newValue).toLowerCase()},valueFormatter:e=>null==e.value?"":String(e.value),dataTypeMatcher:e=>"boolean"==typeof e},date:{baseDataType:"date",valueParser:e=>Ji(null==e.newValue?null:String(e.newValue)),valueFormatter:e=>{var i;return null==e.value?"":e.value instanceof Date&&!isNaN(e.value.getTime())?null!=(i=Xi(e.value,!1))?i:"":t("invalidDate","Invalid Date")},dataTypeMatcher:e=>e instanceof Date},dateString:{baseDataType:"dateString",dateParser:e=>{var t;return null!=(t=Ji(e))?t:void 0},dateFormatter:e=>{var t;return null!=(t=Xi(null!=e?e:null,!1))?t:void 0},valueParser:t=>e(String(t.newValue))?t.newValue:null,valueFormatter:t=>e(String(t.value))?t.value:"",dataTypeMatcher:t=>"string"==typeof t&&e(t)},object:{baseDataType:"object",valueParser:()=>null,valueFormatter:e=>{var t;return null!=(t=S(e.value))?t:""}}}}};f([ue("rowModel")],hh.prototype,"rowModel",2),f([ue("columnModel")],hh.prototype,"columnModel",2),f([ue("valueService")],hh.prototype,"valueService",2),f([le],hh.prototype,"init",1),hh=f([he("dataTypeService")],hh);var uh=class extends st{constructor(){super(...arguments),this.waitingForColumns=!1}postConstruct(){this.addManagedPropertyListener("columnDefs",e=>this.setColumnDefs(e))}start(){this.ctrlsService.whenReady(()=>{const e=this.gos.get("columnDefs");e?this.setColumnsAndData(e):this.waitingForColumns=!0,this.gridReady()})}setColumnsAndData(e){this.columnModel.setColumnDefs(null!=e?e:[],"gridInitializing"),this.rowModel.start()}gridReady(){this.dispatchGridReadyEvent();const e=re.__isRegistered("@ag-grid-enterprise/core",this.context.getGridId());new gc("AG Grid",()=>this.gos.get("debug")).log(`initialised successfully, enterprise = ${e}`)}dispatchGridReadyEvent(){const e={type:ct.EVENT_GRID_READY};this.eventService.dispatchEvent(e)}setColumnDefs(e){const t=this.gos.get("columnDefs");if(t)return this.waitingForColumns?(this.waitingForColumns=!1,void this.setColumnsAndData(t)):void this.columnModel.setColumnDefs(t,Tt(e.source))}};f([ue("ctrlsService")],uh.prototype,"ctrlsService",2),f([ue("columnModel")],uh.prototype,"columnModel",2),f([ue("rowModel")],uh.prototype,"rowModel",2),f([le],uh.prototype,"postConstruct",1),uh=f([he("syncService")],uh);var dh=class extends st{constructor(){super(...arguments),this.manuallyDisplayed=!1}postConstruct(){this.addManagedListener(this.eventService,ct.EVENT_ROW_DATA_UPDATED,()=>this.onRowDataUpdated()),this.addManagedListener(this.eventService,ct.EVENT_NEW_COLUMNS_LOADED,()=>this.onNewColumnsLoaded())}registerOverlayWrapperComp(e){this.overlayWrapperComp=e,(!this.gos.get("columnDefs")||this.gos.isRowModelType("clientSide")&&!this.gos.get("rowData"))&&this.showLoadingOverlay()}showLoadingOverlay(){if(this.gos.get("suppressLoadingOverlay"))return;const e=this.userComponentFactory.getLoadingOverlayCompDetails({});this.showOverlay(e,"ag-overlay-loading-wrapper","loadingOverlayComponentParams")}showNoRowsOverlay(){if(this.gos.get("suppressNoRowsOverlay"))return;const e=this.userComponentFactory.getNoRowsOverlayCompDetails({});this.showOverlay(e,"ag-overlay-no-rows-wrapper","noRowsOverlayComponentParams")}showOverlay(e,t,i){const n=e.newAgStackInstance(),s=this.addManagedPropertyListener(i,({currentValue:e})=>{n.then(t=>{t.refresh&&t.refresh(this.gos.addGridCommonParams(d({},null!=e?e:{})))})});this.manuallyDisplayed=this.columnModel.isReady()&&!this.paginationProxy.isEmpty(),this.overlayWrapperComp.showOverlay(n,t,s)}hideOverlay(){this.manuallyDisplayed=!1,this.overlayWrapperComp.hideOverlay()}showOrHideOverlay(){const e=this.paginationProxy.isEmpty(),t=this.gos.get("suppressNoRowsOverlay");e&&!t?this.showNoRowsOverlay():this.hideOverlay()}onRowDataUpdated(){this.showOrHideOverlay()}onNewColumnsLoaded(){!this.columnModel.isReady()||this.paginationProxy.isEmpty()||this.manuallyDisplayed||this.hideOverlay()}};f([ue("userComponentFactory")],dh.prototype,"userComponentFactory",2),f([ue("paginationProxy")],dh.prototype,"paginationProxy",2),f([ue("columnModel")],dh.prototype,"columnModel",2),f([le],dh.prototype,"postConstruct",1),dh=f([he("overlayService")],dh);var ph=class extends st{constructor(){super(...arguments),this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=Q(()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=Q(()=>this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),0),this.onRowSelectedDebounced=Q(()=>{this.staleStateKeys.delete("rowSelection"),this.updateCachedState("rowSelection",this.getRowSelectionState())},0),this.staleStateKeys=new Set}postConstruct(){var e;this.isClientSideRowModel="clientSide"===this.rowModel.getType(),this.cachedState=null!=(e=this.gos.get("initialState"))?e:{},this.ctrlsService.whenReady(()=>this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnGridReady()));const t=this.addManagedListener(this.eventService,ct.EVENT_NEW_COLUMNS_LOADED,({source:e})=>{"gridInitializing"===e&&(null==t||t(),this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnColumnsInitialised()))}),i=this.addManagedListener(this.eventService,ct.EVENT_ROW_COUNT_READY,()=>{null==i||i(),this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnRowCountReady())}),n=this.addManagedListener(this.eventService,ct.EVENT_FIRST_DATA_RENDERED,()=>{null==n||n(),this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnFirstDataRendered())})}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setupStateOnGridReady(){this.updateCachedState("sideBar",this.getSideBarState()),this.addManagedListener(this.eventService,ct.EVENT_TOOL_PANEL_VISIBLE_CHANGED,()=>this.updateCachedState("sideBar",this.getSideBarState())),this.addManagedListener(this.eventService,ct.EVENT_SIDE_BAR_UPDATED,()=>this.updateCachedState("sideBar",this.getSideBarState()))}setupStateOnColumnsInitialised(){var e;const t=null!=(e=this.gos.get("initialState"))?e:{};this.setColumnState(t),this.setColumnGroupState(t),this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","pivot","rowGroup","sort"]),this.updateCachedState("columnGroup",this.getColumnGroupState()),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_VALUE_CHANGED,()=>this.updateColumnState(["aggregation"])),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_MOVED,()=>this.updateColumnState(["columnOrder"])),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PINNED,()=>this.updateColumnState(["columnPinning"])),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_RESIZED,()=>this.updateColumnState(["columnSizing"])),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_VISIBLE,()=>this.updateColumnState(["columnVisibility"])),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PIVOT_CHANGED,()=>this.updateColumnState(["pivot"])),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PIVOT_MODE_CHANGED,()=>this.updateColumnState(["pivot"])),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.updateColumnState(["rowGroup"])),this.addManagedListener(this.eventService,ct.EVENT_SORT_CHANGED,()=>this.updateColumnState(["sort"])),this.addManagedListener(this.eventService,ct.EVENT_NEW_COLUMNS_LOADED,()=>this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","pivot","rowGroup","sort"])),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_GROUP_OPENED,()=>this.updateCachedState("columnGroup",this.getColumnGroupState()))}setupStateOnRowCountReady(){var e;const{filter:t,rowGroupExpansion:i,rowSelection:n,pagination:s}=null!=(e=this.gos.get("initialState"))?e:{},r=this.gos.get("advancedFilterModel");(t||r)&&this.setFilterState(t,r),i&&this.setRowGroupExpansionState(i),n&&this.setRowSelectionState(n),s&&this.setPaginationState(s),this.updateCachedState("filter",this.getFilterState()),this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("rowSelection",this.getRowSelectionState()),this.updateCachedState("pagination",this.getPaginationState()),this.addManagedListener(this.eventService,ct.EVENT_FILTER_CHANGED,()=>this.updateCachedState("filter",this.getFilterState())),this.addManagedListener(this.eventService,ct.EVENT_ROW_GROUP_OPENED,()=>this.onRowGroupOpenedDebounced()),this.addManagedListener(this.eventService,ct.EVENT_EXPAND_COLLAPSE_ALL,()=>this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState())),this.addManagedListener(this.eventService,ct.EVENT_SELECTION_CHANGED,()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()}),this.addManagedListener(this.eventService,ct.EVENT_PAGINATION_CHANGED,e=>{(e.newPage||e.newPageSize)&&this.updateCachedState("pagination",this.getPaginationState())})}setupStateOnFirstDataRendered(){var e;const{scroll:t,rangeSelection:i,focusedCell:n,columnOrder:s}=null!=(e=this.gos.get("initialState"))?e:{};n&&this.setFocusedCellState(n),i&&this.setRangeSelectionState(i),t&&this.setScrollState(t),this.setColumnPivotState(!!(null==s?void 0:s.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,ct.EVENT_CELL_FOCUSED,()=>this.updateCachedState("focusedCell",this.getFocusedCellState())),this.addManagedListener(this.eventService,ct.EVENT_RANGE_SELECTION_CHANGED,e=>{e.finished&&this.updateCachedState("rangeSelection",this.getRangeSelectionState())}),this.addManagedListener(this.eventService,ct.EVENT_BODY_SCROLL_END,()=>this.updateCachedState("scroll",this.getScrollState()))}getColumnState(){const e=this.columnModel.isPivotMode(),t=[],i=[],n=[],s=[],r=[],o=[],a=[],l=[],c=[],h=this.columnModel.getColumnState();for(let e=0;e<h.length;e++){const{colId:u,sort:d,sortIndex:p,rowGroup:g,rowGroupIndex:f,aggFunc:m,pivot:y,pivotIndex:v,pinned:b,hide:C,width:w,flex:S}=h[e];c.push(u),d&&(t[null!=p?p:0]={colId:u,sort:d}),g&&(i[null!=f?f:0]=u),"string"==typeof m&&n.push({colId:u,aggFunc:m}),y&&(s[null!=v?v:0]=u),b&&("right"===b?o:r).push(u),C&&a.push(u),(S||w)&&l.push({colId:u,flex:null!=S?S:void 0,width:w})}return{sort:t.length?{sortModel:t}:void 0,rowGroup:i.length?{groupColIds:i}:void 0,aggregation:n.length?{aggregationModel:n}:void 0,pivot:s.length||e?{pivotMode:e,pivotColIds:s}:void 0,columnPinning:r.length||o.length?{leftColIds:r,rightColIds:o}:void 0,columnVisibility:a.length?{hiddenColIds:a}:void 0,columnSizing:l.length?{columnSizingModel:l}:void 0,columnOrder:c.length?{orderedColIds:c}:void 0}}setColumnState(e){const{sort:t,rowGroup:i,aggregation:n,pivot:s,columnPinning:r,columnVisibility:o,columnSizing:a,columnOrder:l}=e,c={},h=e=>{let t=c[e];return t||(t={colId:e},c[e]=t,t)};t&&t.sortModel.forEach(({colId:e,sort:t},i)=>{const n=h(e);n.sort=t,n.sortIndex=i}),i&&i.groupColIds.forEach((e,t)=>{const i=h(e);i.rowGroup=!0,i.rowGroupIndex=t}),n&&n.aggregationModel.forEach(({colId:e,aggFunc:t})=>{h(e).aggFunc=t}),s&&(s.pivotColIds.forEach((e,t)=>{const i=h(e);i.pivot=!0,i.pivotIndex=t}),this.gos.updateGridOptions({options:{pivotMode:s.pivotMode},source:"gridInitializing"})),r&&(r.leftColIds.forEach(e=>{h(e).pinned="left"}),r.rightColIds.forEach(e=>{h(e).pinned="right"})),o&&o.hiddenColIds.forEach(e=>{h(e).hide=!0}),a&&a.columnSizingModel.forEach(({colId:e,flex:t,width:i})=>{const n=h(e);n.flex=null!=t?t:null,n.width=i});const u=null==l?void 0:l.orderedColIds,d=!!(null==u?void 0:u.length),p=d?u.map(e=>h(e)):Object.values(c);if(p.length){this.columnStates=p;const e={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:d,defaultState:e},"gridInitializing")}}setColumnPivotState(e){const t=this.columnStates;this.columnStates=void 0;const i=this.columnGroupStates;if(this.columnGroupStates=void 0,this.columnModel.isSecondaryColumnsPresent()){if(t){let i=[];for(const e of t)this.columnModel.getSecondaryColumn(e.colId)&&i.push(e);this.columnModel.applyColumnState({state:i,applyOrder:e},"gridInitializing")}i&&this.columnModel.setColumnGroupState(i,"gridInitializing")}}getColumnGroupState(){const e=this.columnModel.getColumnGroupState(),t=[];return e.forEach(({groupId:e,open:i})=>{i&&t.push(e)}),t.length?{openColumnGroupIds:t}:void 0}setColumnGroupState(e){var t;if(!e.hasOwnProperty("columnGroup"))return;const i=new Set(null==(t=e.columnGroup)?void 0:t.openColumnGroupIds),n=this.columnModel.getColumnGroupState().map(({groupId:e})=>{const t=i.has(e);return t&&i.delete(e),{groupId:e,open:t}});i.forEach(e=>{n.push({groupId:e,open:!0})}),n.length&&(this.columnGroupStates=n),this.columnModel.setColumnGroupState(n,"gridInitializing")}getFilterState(){var e;let t=this.filterManager.getFilterModel();t&&0===Object.keys(t).length&&(t=void 0);const i=null!=(e=this.filterManager.getAdvancedFilterModel())?e:void 0;return t||i?{filterModel:t,advancedFilterModel:i}:void 0}setFilterState(e,t){const{filterModel:i,advancedFilterModel:n}=null!=e?e:{advancedFilterModel:t};i&&this.filterManager.setFilterModel(i,"columnFilter"),n&&this.filterManager.setAdvancedFilterModel(n)}getRangeSelectionState(){var e;const t=null==(e=this.rangeService)?void 0:e.getCellRanges().map(e=>{const{id:t,type:i,startRow:n,endRow:s,columns:r,startColumn:o}=e;return{id:t,type:i,startRow:n,endRow:s,colIds:r.map(e=>e.getColId()),startColId:o.getColId()}});return(null==t?void 0:t.length)?{cellRanges:t}:void 0}setRangeSelectionState(e){if(!this.gos.get("enableRangeSelection")||!this.rangeService)return;const t=[];e.cellRanges.forEach(e=>{const i=[];if(e.colIds.forEach(e=>{const t=this.columnModel.getGridColumn(e);t&&i.push(t)}),!i.length)return;let n=this.columnModel.getGridColumn(e.startColId);if(!n){const e=this.columnModel.getAllDisplayedColumns(),t=new Set(i);n=e.find(e=>t.has(e))}t.push(p(d({},e),{columns:i,startColumn:n}))}),this.rangeService.setCellRanges(t)}getScrollState(){var e,t,i;if(!this.isClientSideRowModel)return;const n=null==(e=this.ctrlsService.getGridBodyCtrl())?void 0:e.getScrollFeature(),{left:s}=null!=(t=null==n?void 0:n.getHScrollPosition())?t:{left:0},{top:r}=null!=(i=null==n?void 0:n.getVScrollPosition())?i:{top:0};return r||s?{top:r,left:s}:void 0}setScrollState(e){var t;if(!this.isClientSideRowModel)return;const{top:i,left:n}=e;null==(t=this.ctrlsService.getGridBodyCtrl())||t.getScrollFeature().setScrollPosition(i,n)}getSideBarState(){var e,t;return null==(t=null==(e=this.sideBarService)?void 0:e.getSideBarComp())?void 0:t.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.focusService.getFocusedCell();if(e){const{column:t,rowIndex:i,rowPinned:n}=e;return{colId:t.getColId(),rowIndex:i,rowPinned:n}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{colId:t,rowIndex:i,rowPinned:n}=e;this.focusService.setFocusedCell({column:this.columnModel.getGridColumn(t),rowIndex:i,rowPinned:n,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const e=this.paginationProxy.getCurrentPage(),t=this.gos.get("paginationAutoPageSize")?void 0:this.paginationProxy.getPageSize();if(e||t)return{page:e,pageSize:t}}setPaginationState(e){e.pageSize&&!this.gos.get("paginationAutoPageSize")&&this.paginationProxy.setPageSize(e.pageSize,"initialState"),"number"==typeof e.page&&this.paginationProxy.setPage(e.page)}getRowSelectionState(){var e;const t=this.selectionService.getSelectionState();return t&&(Array.isArray(t)||!1!==t.selectAll&&!1!==t.selectAllChildren||(null==(e=null==t?void 0:t.toggledNodes)?void 0:e.length))?t:void 0}setRowSelectionState(e){this.selectionService.setSelectionState(e,"gridInitializing")}getRowGroupExpansionState(){const e=this.expansionService.getExpandedRows();return e.length?{expandedRowGroupIds:e}:void 0}setRowGroupExpansionState(e){this.expansionService.expandRows(e.expandedRowGroupIds)}updateColumnState(e){const t=this.getColumnState();let i=!1;Object.entries(t).forEach(([e,t])=>{M(t,this.cachedState[e])||(i=!0)}),this.cachedState=d(d({},this.cachedState),t),i&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const i=this.cachedState[e];this.setCachedStateValue(e,t),M(t,i)||this.dispatchStateUpdateEvent([e])}setCachedStateValue(e,t){this.cachedState=p(d({},this.cachedState),{[e]:t})}refreshStaleState(){this.staleStateKeys.forEach(e=>{"rowSelection"===e&&this.setCachedStateValue(e,this.getRowSelectionState())}),this.staleStateKeys.clear()}dispatchStateUpdateEvent(e){this.suppressEvents||(e.forEach(e=>this.queuedUpdateSources.add(e)),this.dispatchStateUpdateEventDebounced())}dispatchQueuedStateUpdateEvents(){const e=Array.from(this.queuedUpdateSources);this.queuedUpdateSources.clear();const t={type:ct.EVENT_STATE_UPDATED,sources:e,state:this.cachedState};this.eventService.dispatchEvent(t)}suppressEventsAndDispatchInitEvent(e){this.suppressEvents=!0,this.columnAnimationService.setSuppressAnimation(!0),e(),setTimeout(()=>{this.suppressEvents=!1,this.queuedUpdateSources.clear(),this.isAlive()&&(this.columnAnimationService.setSuppressAnimation(!1),this.dispatchStateUpdateEvent(["gridInitializing"]))})}};f([ue("filterManager")],ph.prototype,"filterManager",2),f([ue("ctrlsService")],ph.prototype,"ctrlsService",2),f([ue("focusService")],ph.prototype,"focusService",2),f([ue("columnModel")],ph.prototype,"columnModel",2),f([ue("paginationProxy")],ph.prototype,"paginationProxy",2),f([ue("rowModel")],ph.prototype,"rowModel",2),f([ue("selectionService")],ph.prototype,"selectionService",2),f([ue("expansionService")],ph.prototype,"expansionService",2),f([ue("columnAnimationService")],ph.prototype,"columnAnimationService",2),f([de("sideBarService")],ph.prototype,"sideBarService",2),f([de("rangeService")],ph.prototype,"rangeService",2),f([le],ph.prototype,"postConstruct",1),ph=f([he("stateService")],ph);var gh=class extends st{init(){this.processGridOptions(this.gridOptions)}processGridOptions(e){this.processOptions(e,nh)}processColumnDefs(e){this.processOptions(e,eh)}processOptions(e,t){const{validations:i,deprecations:n,allProperties:s,propertyExceptions:r,objectName:o,docsUrl:a}=t;s&&!0!==this.gridOptions.suppressPropertyNamesCheck&&this.checkProperties(e,[...null!=r?r:[],...Object.keys(n)],s,o,a);const l=new Set;Object.keys(e).forEach(t=>{var s;const r=n[t];if(r)if("renamed"in r){const{renamed:i,version:n}=r;l.add(`As of v${n}, ${String(t)} is deprecated. Please use ${String(i)} instead.`),e[i]=e[t]}else{const{message:e,version:i}=r;l.add(`As of v${i}, ${String(t)} is deprecated. ${null!=e?e:""}`)}const o=e[t];if(null==o||!1===o)return;const a=i[t];let c;if(!a)return;if("function"==typeof a){const i=a(e,this.gridOptions);if(!i)return;if("objectName"in i){const n=e[t];return Array.isArray(n)?void n.forEach(e=>{this.processOptions(e,i)}):void this.processOptions(e[t],i)}c=i}else c=a;const{module:h,dependencies:u,supportedRowModels:d}=c;if(d){const e=null!=(s=this.gridOptions.rowModelType)?s:"clientSide";if(!d.includes(e))return void l.add(`${String(t)} is not supported with the '${e}' row model.`)}if(h){const e=Array.isArray(h)?h:[h];let i=!0;if(e.forEach(e=>{re.__assertRegistered(e,String(t),this.context.getGridId())||(i=!1,l.add(`${String(t)} is only available when ${e} is loaded.`))}),!i)return}if(u){const i=this.checkForWarning(t,u,e);if(i)return void l.add(i)}}),l.size>0&&l.forEach(e=>{z(e)})}checkForWarning(e,t,i){if("function"==typeof t)return t(i,this.gridOptions);const n=Object.entries(t).find(([e,t])=>{const n=i[e];return!t.includes(n)});if(!n)return null;const[s,r]=n;return r.length>1?`'${String(e)}' requires '${s}' to be one of [${r.join(", ")}].`:`'${String(e)}' requires '${s}' to be ${r[0]}.`}checkProperties(e,t,i,n,s){const r=zn(Object.getOwnPropertyNames(e),["__ob__","__v_skip","__metadata__",...t,...i],i);if(P(r,(e,t)=>{z(`invalid ${n} property '${e}' did you mean any of these: ${t.slice(0,8).join(", ")}`)}),Object.keys(r).length>0&&s){const e=this.getFrameworkOverrides().getDocLink(s);z(`to see all the valid ${n} properties please check: ${e}`)}}};f([ue("gridOptions")],gh.prototype,"gridOptions",2),f([le],gh.prototype,"init",1),gh=f([he("validationService")],gh);var fh=class extends st{constructor(){super(...arguments),this.syncEventListeners=new Map,this.asyncEventListeners=new Map,this.syncGlobalEventListeners=new Set,this.globalEventListenerPairs=new Map}postConstruct(){this.frameworkEventWrappingService=new ye(this.getFrameworkOverrides())}addEventListener(e,t){const i=this.frameworkEventWrappingService.wrap(t),n=this.gos.useAsyncEvents()&&!ht.has(e),s=n?this.asyncEventListeners:this.syncEventListeners;s.has(e)||s.set(e,new Set),s.get(e).add(i),this.eventService.addEventListener(e,i,n)}removeEventListener(e,t){var i;const n=this.frameworkEventWrappingService.unwrap(t),s=this.asyncEventListeners.get(e),r=!!(null==s?void 0:s.delete(n));r||null==(i=this.syncEventListeners.get(e))||i.delete(n),this.eventService.removeEventListener(e,n,r)}addGlobalListener(e){const t=this.frameworkEventWrappingService.wrapGlobal(e);if(this.gos.useAsyncEvents()){const i=(e,i)=>{ht.has(e)&&t(e,i)},n=(e,i)=>{ht.has(e)||t(e,i)};this.globalEventListenerPairs.set(e,{syncListener:i,asyncListener:n}),this.eventService.addGlobalListener(i,!1),this.eventService.addGlobalListener(n,!0)}else this.syncGlobalEventListeners.add(t),this.eventService.addGlobalListener(t,!1)}removeGlobalListener(e){const t=this.frameworkEventWrappingService.unwrapGlobal(e);if(this.globalEventListenerPairs.has(t)){const{syncListener:i,asyncListener:n}=this.globalEventListenerPairs.get(t);this.eventService.removeGlobalListener(i,!1),this.eventService.removeGlobalListener(n,!0),this.globalEventListenerPairs.delete(e)}else this.syncGlobalEventListeners.delete(t),this.eventService.removeGlobalListener(t,!1)}destroyEventListeners(e,t){e.forEach((e,i)=>{e.forEach(e=>this.eventService.removeEventListener(i,e,t)),e.clear()}),e.clear()}destroyGlobalListeners(e,t){e.forEach(e=>this.eventService.removeGlobalListener(e,t)),e.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncEventListeners,!1),this.destroyEventListeners(this.asyncEventListeners,!0),this.destroyGlobalListeners(this.syncGlobalEventListeners,!1),this.globalEventListenerPairs.forEach(({syncListener:e,asyncListener:t})=>{this.eventService.removeGlobalListener(e,!1),this.eventService.removeGlobalListener(t,!0)}),this.globalEventListenerPairs.clear()}};f([le],fh.prototype,"postConstruct",1),fh=f([he("apiEventService")],fh);var mh=class extends vs{constructor(){super('<span class="ag-paging-page-size"></span>'),this.hasEmptyOption=!1,this.handlePageSizeItemSelected=()=>{if(!this.selectPageSizeComp)return;const e=this.selectPageSizeComp.getValue();if(!e)return;const t=Number(e);isNaN(t)||t<1||t===this.paginationProxy.getPageSize()||(this.paginationProxy.setPageSize(t,"pageSizeSelector"),this.hasEmptyOption&&this.toggleSelectDisplay(!0),this.selectPageSizeComp.getFocusableElement().focus())}}init(){this.addManagedPropertyListener("paginationPageSizeSelector",()=>{this.onPageSizeSelectorValuesChange()}),this.addManagedListener(this.eventService,ct.EVENT_PAGINATION_CHANGED,e=>this.handlePaginationChanged(e))}handlePaginationChanged(e){if(!this.selectPageSizeComp||!(null==e?void 0:e.newPageSize))return;const t=this.paginationProxy.getPageSize();this.getPageSizeSelectorValues().includes(t)?this.selectPageSizeComp.setValue(t.toString()):this.hasEmptyOption?this.selectPageSizeComp.setValue(""):this.toggleSelectDisplay(!0)}toggleSelectDisplay(e){this.selectPageSizeComp&&this.reset(),e&&(this.reloadPageSizesSelector(),this.selectPageSizeComp&&this.appendChild(this.selectPageSizeComp))}reset(){Cn(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")&&!1!==this.gos.get("paginationPageSizeSelector")}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.paginationProxy.getPageSize(),i=!t||!e.includes(t);i&&(e.unshift(""),z("The paginationPageSize grid option is set to a value that is not in the list of page size options.\n                Please make sure that the paginationPageSize grid option is set to one of the values in the \n                paginationPageSizeSelector array, or set the paginationPageSizeSelector to false to hide the page size selector.")),this.selectPageSizeComp&&(this.destroyBean(this.selectPageSizeComp),this.selectPageSizeComp=void 0);const n=this.localeService.getLocaleTextFunc(),s=n("pageSizeSelectorLabel","Page Size:"),r=e.map(e=>({value:String(e),text:String(e)})),o=n("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new Gs).addOptions(r).setValue(String(i?"":t)).setAriaLabel(o).setLabel(s).onValueChange(()=>this.handlePageSizeItemSelected()),this.hasEmptyOption=i}getPageSizeSelectorValues(){const e=this.gos.get("paginationPageSizeSelector");return Array.isArray(e)&&this.validateValues(e)?[...e].sort((e,t)=>e-t):[20,50,100]}validateValues(e){if(!e.length)return z("The paginationPageSizeSelector grid option is an empty array. This is most likely a mistake.\n                If you want to hide the page size selector, please set the paginationPageSizeSelector to false."),!1;for(let t=0;t<e.length;t++){const i=e[t],n=i>0;if("number"!=typeof i)return z("The paginationPageSizeSelector grid option contains a non-numeric value.\n                    Please make sure that all values in the paginationPageSizeSelector array are numbers."),!1;if(!n)return z("The paginationPageSizeSelector grid option contains a negative number or zero.\n                    Please make sure that all values in the paginationPageSizeSelector array are positive."),!1}return!0}destroy(){this.toggleSelectDisplay(!1),super.destroy()}};f([ue("paginationProxy")],mh.prototype,"paginationProxy",2),f([le],mh.prototype,"init",1);var yh=class extends st{constructor(){super(),this.descriptionContainer=null,this.announceValue=Q(this.announceValue.bind(this),200)}postConstruct(){const e=this.gos.getDocument(),t=this.descriptionContainer=e.createElement("div");t.classList.add("ag-aria-description-container"),qt(t,"polite"),Zt(t,"additions text"),Xt(t,!0),this.eGridDiv.appendChild(t)}announceValue(e){this.descriptionContainer&&(this.descriptionContainer.textContent="",setTimeout(()=>{this.isAlive()&&this.descriptionContainer&&(this.descriptionContainer.textContent=e)},50))}destroy(){super.destroy();const{descriptionContainer:e}=this;e&&(Cn(e),e.parentElement&&e.parentElement.removeChild(e)),this.descriptionContainer=null,this.eGridDiv=null}};f([ue("eGridDiv")],yh.prototype,"eGridDiv",2),f([le],yh.prototype,"postConstruct",1),yh=f([he("ariaAnnouncementService")],yh);var vh=class{};vh.gridOptions=void 0;var bh=1,Ch=class{create(e,t,i,n,s){var r;let o={};vh.gridOptions?(O(o,vh.gridOptions,!0,!0),o=d(d({},o),t)):o=t;const a=sh.getCoercedGridOptions(o),l=!!a.debug,c=null!=(r=a.gridId)?r:String(bh++),h=this.getRegisteredModules(s,c),u=this.createBeansList(a.rowModelType,h,c),p=this.createProvidedBeans(e,a,s);if(!u)return void W("Failed to create grid.");const g={providedBeanInstances:p,beanClasses:u,debug:l,gridId:c},f=new gc("Context",()=>g.debug),m=new oe(g,f),y=m.getBean("beans");return this.registerModuleUserComponents(y,h),this.registerStackComponents(y,h),this.registerControllers(y,h),i(m),y.syncService.start(),n&&n(m),m.getBean("gridApi")}registerControllers(e,t){t.forEach(t=>{t.controllers&&t.controllers.forEach(t=>e.ctrlsFactory.register(t))})}registerStackComponents(e,t){const i=this.createAgStackComponentsList(t);e.agStackComponentsRegistry.setupComponents(i)}getRegisteredModules(e,t){const i=e?e.modules:null,n=re.__getRegisteredModules(t),s=[],r={},o=(e,t,i)=>{var n;r[(n=t).moduleName]||(r[n.moduleName]=!0,s.push(n),re.__register(n,e,i)),t.dependantModules&&t.dependantModules.forEach(t=>o(e,t,i))};return i&&i.forEach(e=>o(!0,e,t)),n&&n.forEach(e=>o(!re.__isPackageBased(),e,void 0)),s}registerModuleUserComponents(e,t){this.extractModuleEntity(t,e=>e.userComponents?e.userComponents:[]).forEach(t=>{e.userComponentRegistry.registerDefaultComponent(t.componentName,t.componentClass)})}createProvidedBeans(e,t,i){let n=i?i.frameworkOverrides:null;C(n)&&(n=new oc);const s={gridOptions:t,eGridDiv:e,globalEventListener:i?i.globalEventListener:null,globalSyncEventListener:i?i.globalSyncEventListener:null,frameworkOverrides:n};return i&&i.providedBeanInstances&&Object.assign(s,i.providedBeanInstances),s}createAgStackComponentsList(e){let t=[{componentName:"AgCheckbox",componentClass:Vs},{componentName:"AgRadioButton",componentClass:Hs},{componentName:"AgToggleButton",componentClass:Dl},{componentName:"AgInputTextField",componentClass:Js},{componentName:"AgInputTextArea",componentClass:Il},{componentName:"AgInputNumberField",componentClass:er},{componentName:"AgInputDateField",componentClass:Rl},{componentName:"AgInputRange",componentClass:kl},{componentName:"AgRichSelect",componentClass:Nl},{componentName:"AgSelect",componentClass:Gs},{componentName:"AgSlider",componentClass:Fl},{componentName:"AgGridBody",componentClass:wa},{componentName:"AgHeaderRoot",componentClass:ol},{componentName:"AgSortIndicator",componentClass:mr},{componentName:"AgPagination",componentClass:kc},{componentName:"AgPageSizeSelector",componentClass:mh},{componentName:"AgOverlayWrapper",componentClass:_c},{componentName:"AgGroupComponent",componentClass:Bl},{componentName:"AgRowContainer",componentClass:Ia},{componentName:"AgFakeHorizontalScroll",componentClass:qc},{componentName:"AgFakeVerticalScroll",componentClass:ah},{componentName:"AgAutocomplete",componentClass:tc}];const i=this.extractModuleEntity(e,e=>e.agStackComponents?e.agStackComponents:[]);return t=t.concat(i),t}createBeansList(e="clientSide",t,i){const n=t.filter(t=>!t.rowModel||t.rowModel===e),s={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(!s[e])return void W("Could not find row model for rowModelType = "+e);if(!re.__assertRegistered(s[e],`rowModelType = '${e}'`,i))return;const r=[Zo,Lc,Nc,Hc,wc,Oo,ao,Ec,Ac,pl,Io,Ic,al,rh,gh,wl,Po,It,me,sh,Xl,cc,Go,Mt,nl,Ml,bl,dc,rt,lc,Ea,Sc,uc,pc,yl,ll,Lr,hc,vc,xa,Dc,ac,Tl,Sa,yc,bc,Cc,Rc,pt,xc,gl,Vc,Nt,Uc,zc,Al,Wc,jc,Xc,Zc,$c,hh,Fo,uh,dh,ph,fl,fh,yh,ml],o=this.extractModuleEntity(n,e=>e.beans?e.beans:[]);r.push(...o);const a=[];return r.forEach(e=>{a.indexOf(e)<0&&a.push(e)}),a}extractModuleEntity(e,t){return[].concat(...e.map(t))}},wh=class{wrap(e,t,i=[],n){const s=this.createWrapper(e,n);return t.forEach(e=>{this.createMethod(s,e,!0)}),i.forEach(e=>{this.createMethod(s,e,!1)}),s}unwrap(e){return e}createMethod(e,t,i){e.addMethod(t,this.createMethodProxy(e,t,i))}createMethodProxy(e,t,i){return function(){return e.hasMethod(t)?e.callMethod(t,arguments):(i&&console.warn("AG Grid: Framework component is missing the method "+t+"()"),null)}}},Sh=class{};Sh.CHART_TYPE_TO_SERIES_TYPE={column:"bar",groupedColumn:"bar",stackedColumn:"bar",normalizedColumn:"bar",bar:"bar",groupedBar:"bar",stackedBar:"bar",normalizedBar:"bar",line:"line",scatter:"scatter",bubble:"bubble",pie:"pie",donut:"donut",doughnut:"donut",area:"area",stackedArea:"area",normalizedArea:"area",histogram:"histogram",radarLine:"radar-line",radarArea:"radar-area",nightingale:"nightingale",radialColumn:"radial-column",radialBar:"radial-bar",sunburst:"sunburst",rangeBar:"range-bar",rangeArea:"range-area",boxPlot:"box-plot",treemap:"treemap",heatmap:"heatmap",waterfall:"waterfall"},Sh.COMBO_CHART_TYPES=["columnLineCombo","areaColumnCombo","customCombo"],Sh.SERIES_GROUP_TYPES=["grouped","stacked","normalized"];var xh="undefined"==typeof globalThis?{}:globalThis;xh.HTMLElement="undefined"==typeof HTMLElement?{}:HTMLElement,xh.HTMLButtonElement="undefined"==typeof HTMLButtonElement?{}:HTMLButtonElement,xh.HTMLSelectElement="undefined"==typeof HTMLSelectElement?{}:HTMLSelectElement,xh.HTMLInputElement="undefined"==typeof HTMLInputElement?{}:HTMLInputElement,xh.Node="undefined"==typeof Node?{}:Node,xh.MouseEvent="undefined"==typeof MouseEvent?{}:MouseEvent;var Eh=class e{constructor(t,i,n,s,r,o){this.nextId=0,this.rowCountReady=!1,this.allNodesMap={},this.rootNode=t,this.gos=i,this.eventService=n,this.columnModel=s,this.beans=o,this.selectionService=r,this.rootNode.group=!0,this.rootNode.level=-1,this.rootNode.id=e.ROOT_NODE_ID,this.rootNode.allLeafChildren=[],this.rootNode.childrenAfterGroup=[],this.rootNode.childrenAfterSort=[],this.rootNode.childrenAfterAggFilter=[],this.rootNode.childrenAfterFilter=[]}getCopyOfNodesMap(){return cs.cloneObject(this.allNodesMap)}getRowNode(e){return this.allNodesMap[e]}setRowData(t){if("string"==typeof t)return void console.warn("AG Grid: rowData must be an array.");this.rowCountReady=!0,this.dispatchRowDataUpdateStartedEvent(t);const i=this.rootNode,n=this.rootNode.sibling;i.childrenAfterFilter=null,i.childrenAfterGroup=null,i.childrenAfterAggFilter=null,i.childrenAfterSort=null,i.childrenMapped=null,i.updateHasChildren(),this.nextId=0,this.allNodesMap={},t?i.allLeafChildren=t.map(t=>this.createNode(t,this.rootNode,e.TOP_LEVEL)):(i.allLeafChildren=[],i.childrenAfterGroup=[]),n&&(n.childrenAfterFilter=i.childrenAfterFilter,n.childrenAfterGroup=i.childrenAfterGroup,n.childrenAfterAggFilter=i.childrenAfterAggFilter,n.childrenAfterSort=i.childrenAfterSort,n.childrenMapped=i.childrenMapped,n.allLeafChildren=i.allLeafChildren)}updateRowData(e,t){this.rowCountReady=!0,this.dispatchRowDataUpdateStartedEvent(e.add);const i={remove:[],update:[],add:[]},n=[];return this.executeRemove(e,i,n),this.executeUpdate(e,i,n),this.executeAdd(e,i),this.updateSelection(n,"rowDataChanged"),t&&cs.sortRowNodesByOrder(this.rootNode.allLeafChildren,t),i}isRowCountReady(){return this.rowCountReady}dispatchRowDataUpdateStartedEvent(e){const t={type:ct.EVENT_ROW_DATA_UPDATE_STARTED,firstRowData:(null==e?void 0:e.length)?e[0]:null};this.eventService.dispatchEvent(t)}updateSelection(e,t){const i=e.length>0;if(i&&this.selectionService.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,source:t}),this.selectionService.updateGroupsFromChildrenSelections(t),i){const e={type:ct.EVENT_SELECTION_CHANGED,source:t};this.eventService.dispatchEvent(e)}}executeAdd(t,i){var n;const{add:s,addIndex:r}=t;if(cs.missingOrEmpty(s))return;const o=s.map(t=>this.createNode(t,this.rootNode,e.TOP_LEVEL));if("number"==typeof r&&r>=0){const{allLeafChildren:e}=this.rootNode,t=e.length;let i=r;if(this.gos.get("treeData")&&r>0&&t>0)for(let s=0;s<t;s++)if((null==(n=e[s])?void 0:n.rowIndex)==r-1){i=s+1;break}const s=e.slice(0,i),a=e.slice(i,e.length);this.rootNode.allLeafChildren=[...s,...o,...a]}else this.rootNode.allLeafChildren=[...this.rootNode.allLeafChildren,...o];this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren),i.add=o}executeRemove(e,t,i){const{remove:n}=e;if(cs.missingOrEmpty(n))return;const s={};n.forEach(e=>{const n=this.lookupRowNode(e);n&&(n.isSelected()&&i.push(n),n.clearRowTopAndRowIndex(),s[n.id]=!0,delete this.allNodesMap[n.id],t.remove.push(n))}),this.rootNode.allLeafChildren=this.rootNode.allLeafChildren.filter(e=>!s[e.id]),this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren)}executeUpdate(t,i,n){const{update:s}=t;cs.missingOrEmpty(s)||s.forEach(t=>{const s=this.lookupRowNode(t);s&&(s.updateData(t),!s.selectable&&s.isSelected()&&n.push(s),this.setMasterForRow(s,t,e.TOP_LEVEL,!1),i.update.push(s))})}lookupRowNode(e){const t=this.gos.getCallback("getRowId");let i;if(t){const n=t({data:e,level:0});if(i=this.allNodesMap[n],!i)return console.error(`AG Grid: could not find row id=${n}, data item was not found for this id`),null}else if(i=this.rootNode.allLeafChildren.find(t=>t.data===e),!i)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 i||null}createNode(e,t,i){const n=new kr(this.beans);n.group=!1,this.setMasterForRow(n,e,i,!0);const s=this.gos.get("suppressParentsInRowNodes");return t&&!s&&(n.parent=t),n.level=i,n.setDataAndId(e,this.nextId.toString()),this.allNodesMap[n.id]&&console.warn(`AG Grid: duplicate node id '${n.id}' detected from getRowId callback, this could cause issues in your grid.`),this.allNodesMap[n.id]=n,this.nextId++,n}setMasterForRow(e,t,i,n){if(this.gos.get("treeData"))e.setMaster(!1),n&&(e.expanded=!1);else{if(this.gos.get("masterDetail")){const i=this.gos.get("isRowMaster");i?e.setMaster(i(t)):e.setMaster(!0)}else e.setMaster(!1);if(n){const t=this.columnModel.getRowGroupColumns(),n=i+(t?t.length:0);e.expanded=!!e.master&&this.isExpanded(n)}}}isExpanded(e){const t=this.gos.get("groupDefaultExpanded");return-1===t||e<t}};Eh.TOP_LEVEL=0,Eh.ROOT_NODE_ID="ROOT_NODE_ID";var Ah=Eh,Mh=class extends st{constructor(){super(...arguments),this.onRowHeightChanged_debounced=cs.debounce(this.onRowHeightChanged.bind(this),100),this.rowsToDisplay=[],this.hasStarted=!1,this.shouldSkipSettingDataOnStart=!1,this.isRefreshingModel=!1,this.rowCountReady=!1}init(){const e=this.refreshModel.bind(this,{step:"group"}),t=!this.gos.get("suppressAnimationFrame"),i=this.refreshModel.bind(this,{step:"group",afterColumnsChanged:!0,keepRenderedRows:!0,animate:t});this.addManagedListener(this.eventService,ct.EVENT_NEW_COLUMNS_LOADED,i),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_ROW_GROUP_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_VALUE_CHANGED,this.onValueChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PIVOT_CHANGED,this.refreshModel.bind(this,{step:"pivot"})),this.addManagedListener(this.eventService,ct.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_SORT_CHANGED,this.onSortChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_COLUMN_PIVOT_MODE_CHANGED,e),this.addManagedListener(this.eventService,ct.EVENT_GRID_STYLES_CHANGED,this.onGridStylesChanges.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_GRID_READY,()=>this.onGridReady()),this.addPropertyListeners(),this.rootNode=new kr(this.beans),this.nodeManager=new Ah(this.rootNode,this.gos,this.eventService,this.columnModel,this.selectionService,this.beans)}addPropertyListeners(){const e=new Set(["treeData","masterDetail"]),t=new Set(["suppressParentsInRowNodes","groupDefaultExpanded","groupAllowUnbalanced","initialGroupOrderComparator","groupHideOpenParents","groupDisplayType"]),i=new Set(["excludeChildrenWhenTreeDataFiltering"]),n=new Set(["removePivotHeaderRowWhenSingleValueColumn","pivotRowTotals","pivotColumnGroupTotals","suppressExpandablePivotGroups"]),s=new Set(["getGroupRowAgg","alwaysAggregateAtRootLevel","groupIncludeTotalFooter","suppressAggFilteredOnly","grandTotalRow"]),r=new Set(["postSortRows","groupDisplayType","accentedSort"]),o=new Set([]),a=new Set(["groupRemoveSingleChildren","groupRemoveLowestSingleChildren","groupIncludeFooter","groupTotalRow"]),l=[...e,...t,...i,...n,...n,...s,...r,...o,...a];this.addManagedPropertyListeners(l,l=>{var c;const h=null==(c=l.changeSet)?void 0:c.properties;if(!h)return;const u=e=>h.some(t=>e.has(t));u(e)?this.setRowData(this.rootNode.allLeafChildren.map(e=>e.data)):u(t)?this.refreshModel({step:"group"}):u(i)?this.refreshModel({step:"filter"}):u(n)?this.refreshModel({step:"pivot"}):u(s)?this.refreshModel({step:"aggregate"}):u(r)?this.refreshModel({step:"sort"}):u(o)?this.refreshModel({step:"filter_aggregates"}):u(a)&&this.refreshModel({step:"map"})}),this.addManagedPropertyListener("rowHeight",()=>this.resetRowHeights())}start(){this.hasStarted=!0,this.shouldSkipSettingDataOnStart?this.dispatchUpdateEventsAndRefresh():this.setInitialData()}setInitialData(){const e=this.gos.get("rowData");e&&(this.shouldSkipSettingDataOnStart=!0,this.setRowData(e))}ensureRowHeightsValid(e,t,i,n){let s,r=!1;do{s=!1;const o=this.getRowIndexAtPixel(e),a=this.getRowIndexAtPixel(t),l=Math.max(o,i),c=Math.min(a,n);for(let e=l;e<=c;e++){const t=this.getRow(e);if(t.rowHeightEstimated){const e=this.gos.getRowHeightForNode(t);t.setRowHeight(e.height),s=!0,r=!0}}s&&this.setRowTopAndRowIndex()}while(s);return r}setRowTopAndRowIndex(){const e=this.environment.getDefaultRowHeight();let t=0;const i=new Set,n=this.gos.isDomLayout("normal");for(let s=0;s<this.rowsToDisplay.length;s++){const r=this.rowsToDisplay[s];if(null!=r.id&&i.add(r.id),null==r.rowHeight){const t=this.gos.getRowHeightForNode(r,n,e);r.setRowHeight(t.height,t.estimated)}r.setRowTop(t),r.setRowIndex(s),t+=r.rowHeight}return i}clearRowTopAndRowIndex(e,t){const i=e.isActive(),n=e=>{e&&null!=e.id&&!t.has(e.id)&&e.clearRowTopAndRowIndex()},s=e=>{if(n(e),n(e.detailNode),n(e.sibling),e.hasChildren()&&e.childrenAfterGroup){const t=-1==e.level;i&&!t&&!e.expanded||e.childrenAfterGroup.forEach(s)}};s(this.rootNode)}ensureRowsAtPixel(e,t,i=0){const n=this.getRowIndexAtPixel(t),s=this.getRow(n),r=!this.gos.get("suppressAnimationFrame");return s!==e[0]&&(e.forEach(e=>{cs.removeFromArray(this.rootNode.allLeafChildren,e)}),e.forEach((e,t)=>{cs.insertIntoArray(this.rootNode.allLeafChildren,e,Math.max(n+i,0)+t)}),this.refreshModel({step:"group",keepRenderedRows:!0,keepEditingRows:!0,animate:r}),!0)}highlightRowAtPixel(e,t){const i=null!=t?this.getRowIndexAtPixel(t):null,n=null!=i?this.getRow(i):null;if(!n||!e||n===e||null==t)return void(this.lastHighlightedRow&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null));const s=this.getHighlightPosition(t,n);this.lastHighlightedRow&&this.lastHighlightedRow!==n&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null),n.setHighlighted(s),this.lastHighlightedRow=n}getHighlightPosition(e,t){if(!t){const i=this.getRowIndexAtPixel(e);if(!(t=this.getRow(i||0)))return 1}const{rowTop:i,rowHeight:n}=t;return e-i<n/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(e){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return e;let t=this.rootNode.childrenAfterSort[e];if(this.gos.get("groupHideOpenParents"))for(;t.expanded&&t.childrenAfterSort&&t.childrenAfterSort.length>0;)t=t.childrenAfterSort[0];return t.rowIndex}getRowBounds(e){if(cs.missing(this.rowsToDisplay))return null;const t=this.rowsToDisplay[e];return t?{rowTop:t.rowTop,rowHeight:t.rowHeight}:null}onRowGroupOpened(){const e=this.gos.isAnimateRows();this.refreshModel({step:"map",keepRenderedRows:!0,animate:e})}onFilterChanged(e){if(e.afterDataChange)return;const t=this.gos.isAnimateRows(),i=0===e.columns.length||e.columns.some(e=>e.isPrimary())?"filter":"filter_aggregates";this.refreshModel({step:i,keepRenderedRows:!0,animate:t})}onSortChanged(){const e=this.gos.isAnimateRows();this.refreshModel({step:"sort",keepRenderedRows:!0,animate:e,keepEditingRows:!0})}getType(){return"clientSide"}onValueChanged(){this.columnModel.isPivotActive()?this.refreshModel({step:"pivot"}):this.refreshModel({step:"aggregate"})}createChangePath(e){const t=cs.missingOrEmpty(e),i=new Sl(!1,this.rootNode);return(t||this.gos.get("treeData"))&&i.setInactive(),i}isSuppressModelUpdateAfterUpdateTransaction(e){if(!this.gos.get("suppressModelUpdateAfterUpdateTransaction"))return!1;if(null==e.rowNodeTransactions)return!1;const t=e.rowNodeTransactions.filter(e=>null!=e.add&&e.add.length>0||null!=e.remove&&e.remove.length>0);return null==t||0==t.length}buildRefreshModelParams(e){let t="group";const i={everything:"group",group:"group",filter:"filter",map:"map",aggregate:"aggregate",sort:"sort",pivot:"pivot"};if(cs.exists(e)&&(t=i[e]),!cs.missing(t))return{step:t,keepRenderedRows:!0,keepEditingRows:!0,animate:!this.gos.get("suppressAnimationFrame")};console.error(`AG Grid: invalid step ${e}, available steps are ${Object.keys(i).join(", ")}`)}refreshModel(e){if(!this.hasStarted||this.isRefreshingModel||this.columnModel.shouldRowModelIgnoreRefresh())return;let t="object"==typeof e&&"step"in e?e:this.buildRefreshModelParams(e);if(!t)return;if(this.isSuppressModelUpdateAfterUpdateTransaction(t))return;const i=this.createChangePath(t.rowNodeTransactions);switch(this.isRefreshingModel=!0,t.step){case"group":this.doRowGrouping(t.rowNodeTransactions,t.rowNodeOrder,i,!!t.afterColumnsChanged);case"filter":this.doFilter(i);case"pivot":this.doPivot(i);case"aggregate":this.doAggregate(i);case"filter_aggregates":this.doFilterAggregates(i);case"sort":this.doSort(t.rowNodeTransactions,i);case"map":this.doRowsToDisplay()}const n=this.setRowTopAndRowIndex();this.clearRowTopAndRowIndex(i,n),this.isRefreshingModel=!1;const s={type:ct.EVENT_MODEL_UPDATED,animate:t.animate,keepRenderedRows:t.keepRenderedRows,newData:t.newData,newPage:!1,keepUndoRedoStack:t.keepUndoRedoStack};this.eventService.dispatchEvent(s)}isEmpty(){const e=cs.missing(this.rootNode.allLeafChildren)||0===this.rootNode.allLeafChildren.length;return cs.missing(this.rootNode)||e||!this.columnModel.isReady()}isRowsToRender(){return cs.exists(this.rowsToDisplay)&&this.rowsToDisplay.length>0}getNodesInRangeForSelection(e,t){let i=!t,n=!1;const s=[],r=this.gos.get("groupSelectsChildren");return this.forEachNodeAfterFilterAndSort(o=>{if(!n)if(i&&(o===t||o===e)&&(n=!0,o.group&&r))s.push(...o.allLeafChildren);else{if(!i){if(o!==t&&o!==e)return;i=!0}(!o.group||!r)&&s.push(o)}}),s}setDatasource(e){console.error("AG Grid: should never call setDatasource on clientSideRowController")}getTopLevelNodes(){return this.rootNode?this.rootNode.childrenAfterGroup:null}getRootNode(){return this.rootNode}getRow(e){return this.rowsToDisplay[e]}isRowPresent(e){return this.rowsToDisplay.indexOf(e)>=0}getRowIndexAtPixel(e){if(this.isEmpty()||0===this.rowsToDisplay.length)return-1;let t=0,i=this.rowsToDisplay.length-1;if(e<=0)return 0;if(cs.last(this.rowsToDisplay).rowTop<=e)return this.rowsToDisplay.length-1;let n=-1,s=-1;for(;;){const r=Math.floor((t+i)/2),o=this.rowsToDisplay[r];if(this.isRowInPixel(o,e))return r;if(o.rowTop<e?t=r+1:o.rowTop>e&&(i=r-1),n===t&&s===i)return r;n=t,s=i}}isRowInPixel(e,t){const i=e.rowTop,n=e.rowTop+e.rowHeight;return i<=t&&n>t}forEachLeafNode(e){this.rootNode.allLeafChildren&&this.rootNode.allLeafChildren.forEach((t,i)=>e(t,i))}forEachNode(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterGroup||[]],callback:e,recursionType:0,index:0,includeFooterNodes:t})}forEachNodeAfterFilter(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterAggFilter||[]],callback:e,recursionType:1,index:0,includeFooterNodes:t})}forEachNodeAfterFilterAndSort(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterSort||[]],callback:e,recursionType:2,index:0,includeFooterNodes:t})}forEachPivotNode(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[this.rootNode],callback:e,recursionType:3,index:0,includeFooterNodes:t})}recursivelyWalkNodesAndCallback(e){const{nodes:t,callback:i,recursionType:n,includeFooterNodes:s}=e;let{index:r}=e;const o=e=>{var n;const o=null==(n=t[0])?void 0:n.parent;if(!o)return;const a=s&&this.gos.getGrandTotalRow(),l=this.gos.getGroupTotalRowCallback(),c=s&&l({node:o});o===this.rootNode?a===e&&(o.createFooter(),i(o.sibling,r++)):c===e&&(o.createFooter(),i(o.sibling,r++))};o("top");for(let e=0;e<t.length;e++){const o=t[e];if(i(o,r++),o.hasChildren()&&!o.footer){let e=null;switch(n){case 0:e=o.childrenAfterGroup;break;case 1:e=o.childrenAfterAggFilter;break;case 2:e=o.childrenAfterSort;break;case 3:e=o.leafGroup?null:o.childrenAfterSort}e&&(r=this.recursivelyWalkNodesAndCallback({nodes:[...e],callback:i,recursionType:n,index:r,includeFooterNodes:s}))}}return o("bottom"),r}doAggregate(e){var t;null==(t=this.aggregationStage)||t.execute({rowNode:this.rootNode,changedPath:e})}doFilterAggregates(e){this.filterAggregatesStage?this.filterAggregatesStage.execute({rowNode:this.rootNode,changedPath:e}):this.rootNode.childrenAfterAggFilter=this.rootNode.childrenAfterFilter}expandOrCollapseAll(e){const t=this.gos.get("treeData"),i=this.columnModel.isPivotActive(),n=s=>{s&&s.forEach(s=>{const r=()=>{s.expanded=e,n(s.childrenAfterGroup)};t?cs.exists(s.childrenAfterGroup)&&r():i?!s.leafGroup&&r():s.group&&r()})};this.rootNode&&n(this.rootNode.childrenAfterGroup),this.refreshModel({step:"map"});const s=e?"expandAll":"collapseAll",r={type:ct.EVENT_EXPAND_COLLAPSE_ALL,source:s};this.eventService.dispatchEvent(r)}doSort(e,t){this.sortStage.execute({rowNode:this.rootNode,rowNodeTransactions:e,changedPath:t})}doRowGrouping(e,t,i,n){if(this.groupStage){if(e?this.groupStage.execute({rowNode:this.rootNode,rowNodeTransactions:e,rowNodeOrder:t,changedPath:i}):this.groupStage.execute({rowNode:this.rootNode,changedPath:i,afterColumnsChanged:n}),this.gos.get("groupSelectsChildren")&&this.selectionService.updateGroupsFromChildrenSelections("rowGroupChanged",i)){const e={type:ct.EVENT_SELECTION_CHANGED,source:"rowGroupChanged"};this.eventService.dispatchEvent(e)}}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:ct.EVENT_ROW_COUNT_READY}))}doFilter(e){this.filterStage.execute({rowNode:this.rootNode,changedPath:e})}doPivot(e){var t;null==(t=this.pivotStage)||t.execute({rowNode:this.rootNode,changedPath:e})}getCopyOfNodesMap(){return this.nodeManager.getCopyOfNodesMap()}getRowNode(e){if("string"==typeof e&&0==e.indexOf(kr.ID_PREFIX_ROW_GROUP)){let t;return this.forEachNode(i=>{i.id===e&&(t=i)}),t}return this.nodeManager.getRowNode(e)}setRowData(e){this.selectionService.reset("rowDataChanged"),this.nodeManager.setRowData(e),this.hasStarted&&this.dispatchUpdateEventsAndRefresh()}dispatchUpdateEventsAndRefresh(){const e={type:ct.EVENT_ROW_DATA_UPDATED};this.eventService.dispatchEvent(e),this.refreshModel({step:"group",newData:!0})}batchUpdateRowData(e,t){if(null==this.applyAsyncTransactionsTimeout){this.rowDataTransactionBatch=[];const e=this.gos.getAsyncTransactionWaitMillis();this.applyAsyncTransactionsTimeout=window.setTimeout(()=>{this.executeBatchUpdateRowData()},e)}this.rowDataTransactionBatch.push({rowDataTransaction:e,callback:t})}flushAsyncTransactions(){null!=this.applyAsyncTransactionsTimeout&&(clearTimeout(this.applyAsyncTransactionsTimeout),this.executeBatchUpdateRowData())}executeBatchUpdateRowData(){this.valueCache.onDataChanged();const e=[],t=[];let i=!1;if(this.rowDataTransactionBatch&&this.rowDataTransactionBatch.forEach(n=>{const s=this.nodeManager.updateRowData(n.rowDataTransaction,void 0);t.push(s),n.callback&&e.push(n.callback.bind(null,s)),"number"==typeof n.rowDataTransaction.addIndex&&(i=!0)}),this.commonUpdateRowData(t,void 0,i),e.length>0&&window.setTimeout(()=>{e.forEach(e=>e())},0),t.length>0){const e={type:ct.EVENT_ASYNC_TRANSACTIONS_FLUSHED,results:t};this.eventService.dispatchEvent(e)}this.rowDataTransactionBatch=null,this.applyAsyncTransactionsTimeout=void 0}updateRowData(e,t){this.valueCache.onDataChanged();const i=this.nodeManager.updateRowData(e,t),n="number"==typeof e.addIndex;return this.commonUpdateRowData([i],t,n),i}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++)e[this.rootNode.allLeafChildren[t].id]=t;return e}commonUpdateRowData(e,t,i){if(!this.hasStarted)return;const n=!this.gos.get("suppressAnimationFrame");i&&(t=this.createRowNodeOrder());const s={type:ct.EVENT_ROW_DATA_UPDATED};this.eventService.dispatchEvent(s),this.refreshModel({step:"group",rowNodeTransactions:e,rowNodeOrder:t,keepRenderedRows:!0,keepEditingRows:!0,animate:n})}doRowsToDisplay(){this.rowsToDisplay=this.flattenStage.execute({rowNode:this.rootNode})}onRowHeightChanged(){this.refreshModel({step:"map",keepRenderedRows:!0,keepEditingRows:!0,keepUndoRedoStack:!0})}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}resetRowHeights(){const e=this.resetRowHeightsForAllRowNodes();this.rootNode.setRowHeight(this.rootNode.rowHeight,!0),this.rootNode.sibling&&this.rootNode.sibling.setRowHeight(this.rootNode.sibling.rowHeight,!0),e&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let e=!1;return this.forEachNode(t=>{t.setRowHeight(t.rowHeight,!0);const i=t.detailNode;i&&i.setRowHeight(i.rowHeight,!0),t.sibling&&t.sibling.setRowHeight(t.sibling.rowHeight,!0),e=!0}),e}onGridStylesChanges(){this.columnModel.isAutoRowHeightActive()||this.resetRowHeights()}onGridReady(){this.hasStarted||this.setInitialData()}isRowDataLoaded(){return this.rowCountReady}};f([ue("columnModel")],Mh.prototype,"columnModel",2),f([ue("selectionService")],Mh.prototype,"selectionService",2),f([ue("valueCache")],Mh.prototype,"valueCache",2),f([ue("beans")],Mh.prototype,"beans",2),f([ue("filterStage")],Mh.prototype,"filterStage",2),f([ue("sortStage")],Mh.prototype,"sortStage",2),f([ue("flattenStage")],Mh.prototype,"flattenStage",2),f([de("groupStage")],Mh.prototype,"groupStage",2),f([de("aggregationStage")],Mh.prototype,"aggregationStage",2),f([de("pivotStage")],Mh.prototype,"pivotStage",2),f([de("filterAggregatesStage")],Mh.prototype,"filterAggregatesStage",2),f([le],Mh.prototype,"init",1),Mh=f([he("rowModel")],Mh);var Th=class extends st{execute(e){const{changedPath:t}=e;this.filterService.filter(t)}};f([ue("filterService")],Th.prototype,"filterService",2),Th=f([he("filterStage")],Th);var Dh=class extends st{execute(e){const t=this.sortController.getSortOptions(),i=cs.exists(t)&&t.length>0,n=i&&cs.exists(e.rowNodeTransactions)&&this.gos.get("deltaSort"),s=t.some(e=>this.gos.isColumnsSortingCoupledToGroup()?e.column.isPrimary()&&e.column.isRowGroupActive():!!e.column.getColDef().showRowGroup);this.sortService.sort(t,i,n,e.rowNodeTransactions,e.changedPath,s)}};f([ue("sortService")],Dh.prototype,"sortService",2),f([ue("sortController")],Dh.prototype,"sortController",2),Dh=f([he("sortStage")],Dh);var Ih=class extends st{execute(e){const t=e.rowNode,i=[],n=this.beans.columnModel.isPivotMode(),s=n&&t.leafGroup,r=s?[t]:t.childrenAfterSort,o=this.getFlattenDetails();if(this.recursivelyAddToRowsToDisplay(o,r,i,n,0),!s&&i.length>0&&o.grandTotalRow){t.createFooter();const e="top"===o.grandTotalRow;this.addRowNodeToRowsToDisplay(o,t.sibling,i,0,e)}return i}getFlattenDetails(){const e=this.gos.get("groupRemoveSingleChildren");return{groupRemoveLowestSingleChildren:!e&&this.gos.get("groupRemoveLowestSingleChildren"),groupRemoveSingleChildren:e,isGroupMultiAutoColumn:this.gos.isGroupMultiAutoColumn(),hideOpenParents:this.gos.get("groupHideOpenParents"),grandTotalRow:this.gos.getGrandTotalRow(),groupTotalRow:this.gos.getGroupTotalRowCallback()}}recursivelyAddToRowsToDisplay(e,t,i,n,s){if(!cs.missingOrEmpty(t))for(let r=0;r<t.length;r++){const o=t[r],a=o.hasChildren(),l=n&&!a,c=e.groupRemoveSingleChildren&&a&&1===o.childrenAfterGroup.length,h=e.groupRemoveLowestSingleChildren&&a&&o.leafGroup&&1===o.childrenAfterGroup.length,u=n&&o.leafGroup,d=e.hideOpenParents&&o.expanded&&!o.master&&!u;if(!(l||d||c||h)&&this.addRowNodeToRowsToDisplay(e,o,i,s),!n||!o.leafGroup)if(a){const t=c||h;if(o.expanded||t){const r=e.groupTotalRow({node:o});r||o.destroyFooter();const a=t?s:s+1;"top"===r&&(o.createFooter(),this.addRowNodeToRowsToDisplay(e,o.sibling,i,a)),this.recursivelyAddToRowsToDisplay(e,o.childrenAfterSort,i,n,a),"bottom"===r&&(o.createFooter(),this.addRowNodeToRowsToDisplay(e,o.sibling,i,a))}}else if(o.master&&o.expanded){const t=this.createDetailNode(o);this.addRowNodeToRowsToDisplay(e,t,i,s)}}}addRowNodeToRowsToDisplay(e,t,i,n,s){s?i.unshift(t):i.push(t),t.setUiLevel(e.isGroupMultiAutoColumn?0:n)}createDetailNode(e){if(cs.exists(e.detailNode))return e.detailNode;const t=new kr(this.beans);return t.detail=!0,t.selectable=!1,t.parent=e,cs.exists(e.id)&&(t.id="detail_"+e.id),t.data=e.data,t.level=e.level+1,e.detailNode=t,t}};f([ue("beans")],Ih.prototype,"beans",2),Ih=f([he("flattenStage")],Ih);var Rh=class extends st{sort(e,t,i,n,s,r){const o=this.gos.get("groupMaintainOrder"),a=this.columnModel.getAllGridColumns().some(e=>e.isRowGroupActive());let l={};i&&n&&(l=this.calculateDirtyNodes(n));const c=this.columnModel.isPivotMode(),h=this.gos.getCallback("postSortRows");s&&s.forEachChangedNodeDepthFirst(n=>{var u;this.pullDownGroupDataForHideOpenParents(n.childrenAfterAggFilter,!0);const d=c&&n.leafGroup;if(o&&a&&!n.leafGroup&&!r){const e=null==(u=this.columnModel.getRowGroupColumns())?void 0:u[n.level+1],t=null===(null==e?void 0:e.getSort()),i=n.childrenAfterAggFilter.slice(0);if(n.childrenAfterSort&&!t){const e={};n.childrenAfterSort.forEach((t,i)=>{e[t.id]=i}),i.sort((t,i)=>{var n,s;return(null!=(n=e[t.id])?n:0)-(null!=(s=e[i.id])?s:0)})}n.childrenAfterSort=i}else n.childrenAfterSort=!t||d?n.childrenAfterAggFilter.slice(0):i?this.doDeltaSort(n,l,s,e):this.rowNodeSorter.doFullSort(n.childrenAfterAggFilter,e);if(n.sibling&&(n.sibling.childrenAfterSort=n.childrenAfterSort),this.updateChildIndexes(n),h){const e={nodes:n.childrenAfterSort};h(e)}}),this.updateGroupDataForHideOpenParents(s)}calculateDirtyNodes(e){const t={},i=e=>{e&&e.forEach(e=>t[e.id]=!0)};return e&&e.forEach(e=>{i(e.add),i(e.update),i(e.remove)}),t}doDeltaSort(e,t,i,n){const s=e.childrenAfterAggFilter,r=e.childrenAfterSort;if(!r)return this.rowNodeSorter.doFullSort(s,n);const o={},a=[];s.forEach(e=>{t[e.id]||!i.canSkip(e)?a.push(e):o[e.id]=!0});const l=r.filter(e=>o[e.id]),c=(e,t)=>({currentPos:t,rowNode:e}),h=a.map(c).sort((e,t)=>this.rowNodeSorter.compareRowNodes(n,e,t));return this.mergeSortedArrays(n,h,l.map(c)).map(({rowNode:e})=>e)}mergeSortedArrays(e,t,i){const n=[];let s=0,r=0;for(;s<t.length&&r<i.length;)this.rowNodeSorter.compareRowNodes(e,t[s],i[r])<0?n.push(t[s++]):n.push(i[r++]);for(;s<t.length;)n.push(t[s++]);for(;r<i.length;)n.push(i[r++]);return n}updateChildIndexes(e){if(cs.missing(e.childrenAfterSort))return;const t=e.childrenAfterSort;for(let i=0;i<t.length;i++){const n=t[i],s=0===i,r=i===e.childrenAfterSort.length-1;n.setFirstChild(s),n.setLastChild(r),n.setChildIndex(i)}}updateGroupDataForHideOpenParents(e){if(!this.gos.get("groupHideOpenParents"))return;if(this.gos.get("treeData"))return cs.warnOnce("The property hideOpenParents dose not work with Tree Data. This is because Tree Data has values at the group level, it doesn't make sense to hide them."),!1;const t=e=>{this.pullDownGroupDataForHideOpenParents(e.childrenAfterSort,!1),e.childrenAfterSort.forEach(e=>{e.hasChildren()&&t(e)})};e&&e.executeFromRootNode(e=>t(e))}pullDownGroupDataForHideOpenParents(e,t){this.gos.get("groupHideOpenParents")&&!cs.missing(e)&&e.forEach(e=>{this.columnModel.getGroupDisplayColumns().forEach(i=>{const n=i.getColDef().showRowGroup;if("string"!=typeof n)return void console.error("AG Grid: groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup");const s=n,r=this.columnModel.getPrimaryColumn(s);if(r!==e.rowGroupColumn)if(t)e.setGroupValue(i.getId(),void 0);else{const t=e.getFirstChildOfFirstChild(r);t&&e.setGroupValue(i.getId(),t.key)}})})}};f([ue("columnModel")],Rh.prototype,"columnModel",2),f([ue("rowNodeSorter")],Rh.prototype,"rowNodeSorter",2),Rh=f([he("sortService")],Rh);var kh=class extends st{filter(e){const t=this.filterManager.isChildFilterPresent();this.filterNodes(t,e)}filterNodes(e,t){const i=(t,i)=>{t.hasChildren()?t.childrenAfterFilter=e&&!i?t.childrenAfterGroup.filter(e=>{const t=e.childrenAfterFilter&&e.childrenAfterFilter.length>0,i=e.data&&this.filterManager.doesRowPassFilter({rowNode:e});return t||i}):t.childrenAfterGroup:t.childrenAfterFilter=t.childrenAfterGroup,t.sibling&&(t.sibling.childrenAfterFilter=t.childrenAfterFilter)};if(this.doingTreeDataFiltering()){const e=(t,n)=>{if(t.childrenAfterGroup)for(let s=0;s<t.childrenAfterGroup.length;s++){const r=t.childrenAfterGroup[s],o=n||this.filterManager.doesRowPassFilter({rowNode:r});r.childrenAfterGroup?e(t.childrenAfterGroup[s],o):i(r,o)}i(t,n)},n=t=>e(t,!1);t.executeFromRootNode(n)}else{const e=e=>i(e,!1);t.forEachChangedNodeDepthFirst(e,!0)}}doingTreeDataFiltering(){return this.gos.get("treeData")&&!this.gos.get("excludeChildrenWhenTreeDataFiltering")}};f([ue("filterManager")],kh.prototype,"filterManager",2),kh=f([he("filterService")],kh);var Ph=class extends st{postConstruct(){"clientSide"===this.rowModel.getType()&&(this.clientSideRowModel=this.rowModel,this.addManagedPropertyListener("rowData",()=>this.onRowDataUpdated()))}isActive(){const e=this.gos.exists("getRowId");return!this.gos.get("resetRowDataOnUpdate")&&e}setRowData(e){const t=this.createTransactionForRowData(e);if(!t)return;const[i,n]=t;this.clientSideRowModel.updateRowData(i,n)}createTransactionForRowData(e){if(cs.missing(this.clientSideRowModel))return void console.error("AG Grid: ImmutableService only works with ClientSideRowModel");const t=this.gos.getCallback("getRowId");if(null==t)return void console.error("AG Grid: ImmutableService requires getRowId() callback to be implemented, your row data needs IDs!");const i={remove:[],update:[],add:[]},n=this.clientSideRowModel.getCopyOfNodesMap(),s=this.gos.get("suppressMaintainUnsortedOrder")?void 0:{};return cs.exists(e)&&e.forEach((e,r)=>{const o=t({data:e,level:0}),a=n[o];s&&(s[o]=r),a?(a.data!==e&&i.update.push(e),n[o]=void 0):i.add.push(e)}),cs.iterateObject(n,(e,t)=>{t&&i.remove.push(t.data)}),[i,s]}onRowDataUpdated(){const e=this.gos.get("rowData");e&&(this.isActive()?this.setRowData(e):(this.selectionService.reset("rowDataChanged"),this.clientSideRowModel.setRowData(e)))}};f([ue("rowModel")],Ph.prototype,"rowModel",2),f([ue("rowRenderer")],Ph.prototype,"rowRenderer",2),f([ue("selectionService")],Ph.prototype,"selectionService",2),f([le],Ph.prototype,"postConstruct",1);var _h={version:"31.3.4",moduleName:"@ag-grid-community/client-side-row-model",rowModel:"clientSide",beans:[Mh,Th,Dh,Ih,Rh,kh,Ph=f([he("immutableService")],Ph)]},Lh=Object.defineProperty,Nh=Object.getOwnPropertyDescriptor,Oh=(e,t,i,n)=>{for(var s,r=n>1?void 0:n?Nh(t,i):t,o=e.length-1;o>=0;o--)(s=e[o])&&(r=(n?s(t,i,r):s(r))||r);return n&&r&&Lh(t,i,r),r},Fh=class extends El{constructor(e,t,i){super(e),this.parentCache=t,this.params=i,this.startRow=e*i.blockSize,this.endRow=this.startRow+i.blockSize}postConstruct(){this.createRowNodes()}getBlockStateJson(){return{id:""+this.getId(),state:{blockNumber:this.getId(),startRow:this.getStartRow(),endRow:this.getEndRow(),pageStatus:this.getState()}}}setDataAndId(e,t,i){cs.exists(t)?e.setDataAndId(t,i.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();cs.missing(this.params.datasource.getRows)?console.warn("AG Grid: datasource is missing getRows method"):window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}processServerFail(){}createLoadParams(){return{startRow:this.getStartRow(),endRow:this.getEndRow(),successCallback:this.pageLoaded.bind(this,this.getVersion()),failCallback:this.pageLoadFailed.bind(this,this.getVersion()),sortModel:this.params.sortModel,filterModel:this.params.filterModel,context:this.gos.getGridCommonParams().context}}forEachNode(e,t,i){this.rowNodes.forEach((n,s)=>{this.startRow+s<i&&e(n,t.next())})}getLastAccessed(){return this.lastAccessed}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.next());const i=e-this.startRow;return this.rowNodes[i]}getStartRow(){return this.startRow}getEndRow(){return this.endRow}createRowNodes(){this.rowNodes=[];for(let e=0;e<this.params.blockSize;e++){const t=this.startRow+e,i=new kr(this.beans);i.setRowHeight(this.params.rowHeight),i.uiLevel=0,i.setRowIndex(t),i.setRowTop(this.params.rowHeight*t),this.rowNodes.push(i)}}processServerResult(e){this.rowNodes.forEach((t,i)=>{const n=e.rowData?e.rowData[i]:void 0;!t.id&&t.alreadyRendered&&n&&(this.rowNodes[i]=new kr(this.beans),this.rowNodes[i].setRowIndex(t.rowIndex),this.rowNodes[i].setRowTop(t.rowTop),this.rowNodes[i].setRowHeight(t.rowHeight),t.clearRowTopAndRowIndex()),this.setDataAndId(this.rowNodes[i],n,this.startRow+i)});const t=null!=e.rowCount&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,t)}destroyRowNodes(){this.rowNodes.forEach(e=>{e.clearRowTopAndRowIndex()})}};Oh([ue("beans")],Fh.prototype,"beans",2),Oh([le],Fh.prototype,"postConstruct",1),Oh([ce],Fh.prototype,"destroyRowNodes",1);var Gh,Bh=class e extends st{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 i=Math.floor(e/this.params.blockSize);let n=this.blocks[i];if(!n){if(t)return;n=this.createBlock(i)}return n.getRow(e)}createBlock(e){const t=this.createBean(new Fh(e,this,this.params));return this.blocks[t.getId()]=t,this.blockCount++,this.purgeBlocksIfNeeded(t),this.params.rowNodeBlockLoader.addBlock(t),t}refreshCache(){0==this.blockCount?this.purgeCache():(this.getBlocksInOrder().forEach(e=>e.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(t){const i=this.getBlocksInOrder().filter(e=>e!=t);i.sort((e,t)=>t.getLastAccessed()-e.getLastAccessed());const n=this.params.maxBlocksInCache>0,s=n?this.params.maxBlocksInCache-1:null,r=e.MAX_EMPTY_BLOCKS_TO_KEEP-1;i.forEach((e,t)=>{if(e.getState()===Fh.STATE_WAITING_TO_LOAD&&t>=r||n&&t>=s){if(this.isBlockCurrentlyDisplayed(e))return;if(this.isBlockFocused(e))return;this.removeBlockFromCache(e)}})}isBlockFocused(e){const t=this.focusService.getFocusCellToUseAfterRefresh();if(!t)return!1;if(null!=t.rowPinned)return!1;const i=e.getStartRow(),n=e.getEndRow();return t.rowIndex>=i&&t.rowIndex<n}isBlockCurrentlyDisplayed(e){const t=e.getStartRow(),i=e.getEndRow()-1;return this.rowRenderer.isRangeInRenderedViewport(t,i)}removeBlockFromCache(e){e&&this.destroyBlock(e)}checkRowCount(e,t){if("number"==typeof t&&t>=0)this.rowCount=t,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){const t=(e.getId()+1)*this.params.blockSize+this.params.overflowSize;this.rowCount<t&&(this.rowCount=t)}}setRowCount(e,t){this.rowCount=e,cs.exists(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize===0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t=new hs;this.getBlocksInOrder().forEach(i=>i.forEachNode(e,t,this.rowCount))}getBlocksInOrder(){return cs.getAllValuesInObject(this.blocks).sort((e,t)=>e.getId()-t.getId())}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:ct.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(e=>this.destroyBlock(e))}purgeCache(){this.getBlocksInOrder().forEach(e=>this.removeBlockFromCache(e)),this.lastRowIndexKnown=!1,0===this.rowCount&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()}getRowNodesInRange(e,t){const i=[];let n=-1,s=!1;const r=new hs;cs.missing(e)&&(s=!0);let o=!1;return this.getBlocksInOrder().forEach(a=>{o||(s&&n+1!==a.getId()?o=!0:(n=a.getId(),a.forEachNode(n=>{const r=n===e||n===t;(s||r)&&i.push(n),r&&(s=!s)},r,this.rowCount)))}),o||s?[]:i}};Bh.MAX_EMPTY_BLOCKS_TO_KEEP=2,Oh([ue("rowRenderer")],Bh.prototype,"rowRenderer",2),Oh([ue("focusService")],Bh.prototype,"focusService",2),Oh([(Gh=ge("loggerFactory"),(e,t)=>Gh(e,t,0))],Bh.prototype,"setBeans",1),Oh([ce],Bh.prototype,"destroyAllBlocks",1);var Vh=Bh,Hh=class extends st{getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}ensureRowHeightsValid(e,t,i,n){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")&&cs.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,ct.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_SORT_CHANGED,this.onSortChanged.bind(this)),this.addManagedListener(this.eventService,ct.EVENT_NEW_COLUMNS_LOADED,this.onColumnEverything.bind(this)),this.addManagedListener(this.eventService,ct.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 e;e=!this.cacheParams||this.isSortModelDifferent(),e&&this.reset()}isSortModelDifferent(){return!cs.jsonEquals(this.cacheParams.sortModel,this.sortController.getSortModel())}getType(){return"infinite"}setDatasource(e){this.destroyDatasource(),this.datasource=e,e&&this.reset()}isEmpty(){return!this.infiniteCache}isRowsToRender(){return!!this.infiniteCache}getNodesInRangeForSelection(e,t){return this.infiniteCache?this.infiniteCache.getRowNodesInRange(e,t):[]}reset(){this.datasource&&(null!=this.gos.getCallback("getRowId")||this.selectionService.reset("rowDataChanged"),this.resetCache())}createModelUpdatedEvent(){return{type:ct.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 hs},this.infiniteCache=this.createBean(new Vh(this.cacheParams)),this.eventService.dispatchEventOnce({type:ct.EVENT_ROW_COUNT_READY});const e=this.createModelUpdatedEvent();this.eventService.dispatchEvent(e)}updateRowHeights(){this.forEachNode(e=>{e.setRowHeight(this.rowHeight),e.setRowTop(this.rowHeight*e.rowIndex)});const e=this.createModelUpdatedEvent();this.eventService.dispatchEvent(e)}destroyCache(){this.infiniteCache&&(this.infiniteCache=this.destroyBean(this.infiniteCache))}onCacheUpdated(){const e=this.createModelUpdatedEvent();this.eventService.dispatchEvent(e)}getRow(e){if(this.infiniteCache&&!(e>=this.infiniteCache.getRowCount()))return this.infiniteCache.getRow(e)}getRowNode(e){let t;return this.forEachNode(i=>{i.id===e&&(t=i)}),t}forEachNode(e){this.infiniteCache&&this.infiniteCache.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(0!==this.rowHeight){const t=Math.floor(e/this.rowHeight),i=this.getRowCount()-1;return t>i?i:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){this.infiniteCache&&this.infiniteCache.refreshCache()}purgeCache(){this.infiniteCache&&this.infiniteCache.purgeCache()}isLastRowIndexKnown(){return!!this.infiniteCache&&this.infiniteCache.isLastRowIndexKnown()}setRowCount(e,t){this.infiniteCache&&this.infiniteCache.setRowCount(e,t)}};Oh([ue("filterManager")],Hh.prototype,"filterManager",2),Oh([ue("sortController")],Hh.prototype,"sortController",2),Oh([ue("selectionService")],Hh.prototype,"selectionService",2),Oh([ue("rowRenderer")],Hh.prototype,"rowRenderer",2),Oh([ue("rowNodeBlockLoader")],Hh.prototype,"rowNodeBlockLoader",2),Oh([le],Hh.prototype,"init",1),Oh([ce],Hh.prototype,"destroyDatasource",1);var Uh={version:"31.3.4",moduleName:"@ag-grid-community/infinite-row-model",rowModel:"infinite",beans:[Hh=Oh([he("rowModel")],Hh)]},zh=Object.defineProperty,Wh=Object.defineProperties,jh=Object.getOwnPropertyDescriptor,$h=Object.getOwnPropertyDescriptors,Kh=Object.getOwnPropertySymbols,Yh=Object.prototype.hasOwnProperty,qh=Object.prototype.propertyIsEnumerable,Xh=(e,t,i)=>t in e?zh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Zh=(e,t)=>{for(var i in t||(t={}))Yh.call(t,i)&&Xh(e,i,t[i]);if(Kh)for(var i of Kh(t))qh.call(t,i)&&Xh(e,i,t[i]);return e},Qh=(e,t)=>Wh(e,$h(t)),Jh=(e,t,i,n)=>{for(var s,r=n>1?void 0:n?jh(t,i):t,o=e.length-1;o>=0;o--)(s=e[o])&&(r=(n?s(t,i,r):s(r))||r);return n&&r&&zh(t,i,r),r},eu=(e,t,i)=>new Promise((n,s)=>{var r=e=>{try{a(i.next(e))}catch(e){s(e)}},o=e=>{try{a(i.throw(e))}catch(e){s(e)}},a=e=>e.done?n(e.value):Promise.resolve(e.value).then(r,o);a((i=i.apply(e,t)).next())}),tu=class{setBeans(e){this.beans=e}getFileName(e){const t=this.getDefaultFileExtension();return null!=e&&e.length||(e=this.getDefaultFileName()),-1===e.indexOf(".")?`${e}.${t}`:e}getData(e){const t=this.createSerializingSession(e);return this.beans.gridSerializer.serialize(t,e)}getDefaultFileName(){return`export.${this.getDefaultFileExtension()}`}},iu=class{constructor(e){this.groupColumns=[];const{columnModel:t,valueService:i,gos:n,processCellCallback:s,processHeaderCallback:r,processGroupHeaderCallback:o,processRowGroupCallback:a}=e;this.columnModel=t,this.valueService=i,this.gos=n,this.processCellCallback=s,this.processHeaderCallback=r,this.processGroupHeaderCallback=o,this.processRowGroupCallback=a}prepare(e){this.groupColumns=e.filter(e=>!!e.getColDef().showRowGroup)}extractHeaderValue(e){const t=this.getHeaderName(this.processHeaderCallback,e);return null!=t?t:""}extractRowCellValue(e,t,i,n,s){const r=this.gos.get("groupHideOpenParents")&&!s.footer||!this.shouldRenderGroupSummaryCell(s,e,t)?this.valueService.getValue(e,s):this.createValueForGroupNode(e,s);return this.processCell({accumulatedRowIndex:i,rowNode:s,column:e,value:r,processCellCallback:this.processCellCallback,type:n})}shouldRenderGroupSummaryCell(e,t,i){var n;if(!e||!e.group)return!1;if(-1!==this.groupColumns.indexOf(t)){if(null!=(null==(n=e.groupData)?void 0:n[t.getId()]))return!0;if(this.gos.isRowModelType("serverSide")&&e.group)return!0;if(e.footer&&-1===e.level){const e=t.getColDef();return null==e||!0===e.showRowGroup||e.showRowGroup===this.columnModel.getRowGroupColumns()[0].getId()}}const s=this.gos.isGroupUseEntireRow(this.columnModel.isPivotMode());return 0===i&&s}getHeaderName(e,t){return e?e(this.gos.addGridCommonParams({column:t})):this.columnModel.getDisplayNameForColumn(t,"csv",!0)}createValueForGroupNode(e,t){if(this.processRowGroupCallback)return this.processRowGroupCallback(this.gos.addGridCommonParams({column:e,node:t}));const i=this.gos.get("treeData"),n=this.gos.get("suppressGroupMaintainValueType"),s=t=>{var s,r;if(i||n)return t.key;const o=null==(s=t.groupData)?void 0:s[e.getId()];return o&&t.rowGroupColumn&&!1!==t.rowGroupColumn.getColDef().useValueFormatterForExport&&null!=(r=this.valueService.formatValue(t.rowGroupColumn,t,o))?r:o},r=t.footer,o=[s(t)];if(!this.gos.isGroupMultiAutoColumn())for(;t.parent;)t=t.parent,o.push(s(t));const a=o.reverse().join(" -> ");return r?`Total ${a}`:a}processCell(e){var t;const{accumulatedRowIndex:i,rowNode:n,column:s,value:r,processCellCallback:o,type:a}=e;return o?{value:null!=(t=o(this.gos.addGridCommonParams({accumulatedRowIndex:i,column:s,node:n,value:r,type:a,parseValue:e=>this.valueService.parseValue(s,n,e,this.valueService.getValue(s,n)),formatValue:e=>{var t;return null!=(t=this.valueService.formatValue(s,n,e))?t:e}})))?t:""}:!1!==s.getColDef().useValueFormatterForExport?{value:null!=r?r:"",valueFormatted:this.valueService.formatValue(s,n,r)}:{value:null!=r?r:""}}},nu=class{static download(e,t){const i=document.defaultView||window;if(!i)return void console.warn("AG Grid: There is no `window` associated with the current `document`");const n=document.createElement("a"),s=i.URL.createObjectURL(t);n.setAttribute("href",s),n.setAttribute("download",e),n.style.display="none",document.body.appendChild(n),n.dispatchEvent(new MouseEvent("click",{bubbles:!1,cancelable:!0,view:i})),document.body.removeChild(n),i.setTimeout(()=>{i.URL.revokeObjectURL(s)},0)}},su=class extends iu{constructor(e){super(e),this.isFirstLine=!0,this.result="";const{suppressQuotes:t,columnSeparator:i}=e;this.suppressQuotes=t,this.columnSeparator=i}addCustomContent(e){e&&("string"==typeof e?(/^\s*\n/.test(e)||this.beginNewLine(),e=e.replace(/\r?\n/g,"\r\n"),this.result+=e):e.forEach(e=>{this.beginNewLine(),e.forEach((e,t)=>{0!==t&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(e.data.value||""),e.mergeAcross&&this.appendEmptyCells(e.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,i,n){0!=i&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(n)}appendEmptyCells(e){for(let t=1;t<=e;t++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(e,t){0!=t&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(e))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(e,t,i){var n;0!=t&&(this.result+=this.columnSeparator);const s=this.extractRowCellValue(e,t,t,"csv",i);this.result+=this.putInQuotes(null!=(n=s.valueFormatted)?n:s.value)}putInQuotes(e){if(this.suppressQuotes)return e;if(null==e)return'""';let t;return"string"==typeof e?t=e:"function"==typeof e.toString?t=e.toString():(console.warn("AG Grid: unknown value type during csv conversion"),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+="\r\n"),this.isFirstLine=!1}},ru=class extends tu{postConstruct(){this.setBeans({gridSerializer:this.gridSerializer,gos:this.gos})}getMergedParams(e){const t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed())return void console.warn("AG Grid: Export cancelled. Export is not allowed as per your configuration.");const t=this.getMergedParams(e),i=this.getData(t),n=new Blob(["\ufeff",i],{type:"text/plain"}),s="function"==typeof t.fileName?t.fileName(this.gos.getGridCommonParams()):t.fileName;nu.download(this.getFileName(s),n)}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const i=t?Object.assign({},e):this.getMergedParams(e);return this.getData(i)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{columnModel:t,valueService:i,gos:n}=this,{processCellCallback:s,processHeaderCallback:r,processGroupHeaderCallback:o,processRowGroupCallback:a,suppressQuotes:l,columnSeparator:c}=e;return new su({columnModel:t,valueService:i,gos:n,processCellCallback:s||void 0,processHeaderCallback:r||void 0,processGroupHeaderCallback:o||void 0,processRowGroupCallback:a||void 0,suppressQuotes:l||!1,columnSeparator:c||","})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};Jh([ue("columnModel")],ru.prototype,"columnModel",2),Jh([ue("valueService")],ru.prototype,"valueService",2),Jh([ue("gridSerializer")],ru.prototype,"gridSerializer",2),Jh([ue("gridOptionsService")],ru.prototype,"gos",2),Jh([le],ru.prototype,"postConstruct",1),ru=Jh([he("csvCreator")],ru);var ou=class extends st{serialize(e,t={}){const{allColumns:i,columnKeys:n,skipRowGroups:s}=t,r=this.getColumnsToExport(i,s,n);return cs.compose(this.prepareSession(r),this.prependContent(t),this.exportColumnGroups(t,r),this.exportHeaders(t,r),this.processPinnedTopRows(t,r),this.processRows(t,r),this.processPinnedBottomRows(t,r),this.appendContent(t))(e).parse()}processRow(e,t,i,n){const s=t.shouldRowBeSkipped||(()=>!1),r=this.gos.get("groupRemoveSingleChildren"),o=this.gos.get("groupRemoveLowestSingleChildren"),a=null!=t.rowPositions||!!t.onlySelected,l=this.gos.get("groupHideOpenParents")&&!a,c=this.columnModel.isPivotMode()?n.leafGroup:!n.group,h=!!n.footer,u=(t.skipRowGroups,o&&n.leafGroup),d=1===n.allChildrenCount&&(r||u);if(!c&&!h&&(t.skipRowGroups||d||l)||t.onlySelected&&!n.isSelected()||t.skipPinnedTop&&"top"===n.rowPinned||t.skipPinnedBottom&&"bottom"===n.rowPinned)return;if(-1===n.level&&!c&&!h)return;if(s(this.gos.addGridCommonParams({node:n})))return;const p=e.onNewBodyRow(n);if(i.forEach((e,t)=>{p.onColumn(e,t,n)}),t.getCustomContentBelowRow){const i=t.getCustomContentBelowRow(this.gos.addGridCommonParams({node:n}));i&&e.addCustomContent(i)}}appendContent(e){return t=>{const i=e.appendContent;return i&&t.addCustomContent(i),t}}prependContent(e){return t=>{const i=e.prependContent;return i&&t.addCustomContent(i),t}}prepareSession(e){return t=>(t.prepare(e),t)}exportColumnGroups(e,t){return i=>{if(!e.skipColumnGroupHeaders){const n=new ut,s=this.displayedGroupCreator.createDisplayedGroups(t,n,null);this.recursivelyAddHeaderGroups(s,i,e.processGroupHeaderCallback)}return i}}exportHeaders(e,t){return i=>{if(!e.skipColumnHeaders){const e=i.onNewHeaderRow();t.forEach((t,i)=>{e.onColumn(t,i,void 0)})}return i}}processPinnedTopRows(e,t){return i=>{const n=this.processRow.bind(this,i,e,t);return e.rowPositions?e.rowPositions.filter(e=>"top"===e.rowPinned).sort((e,t)=>e.rowIndex-t.rowIndex).map(e=>this.pinnedRowModel.getPinnedTopRow(e.rowIndex)).forEach(n):this.pinnedRowModel.forEachPinnedTopRow(n),i}}processRows(e,t){return i=>{const n=this.rowModel,s=n.getType(),r="clientSide"===s,o="serverSide"===s,a=!r&&e.onlySelected,l=this.processRow.bind(this,i,e,t),{exportedRows:c="filteredAndSorted"}=e;if(e.rowPositions)e.rowPositions.filter(e=>null==e.rowPinned).sort((e,t)=>e.rowIndex-t.rowIndex).map(e=>n.getRow(e.rowIndex)).forEach(l);else if(this.columnModel.isPivotMode())r?n.forEachPivotNode(l,!0):o?n.forEachNodeAfterFilterAndSort(l,!0):n.forEachNode(l);else if(e.onlySelectedAllPages||a){const e=this.selectionService.getSelectedNodes();this.replicateSortedOrder(e),e.forEach(l)}else"all"===c?n.forEachNode(l):r||o?n.forEachNodeAfterFilterAndSort(l,!0):n.forEachNode(l);return i}}replicateSortedOrder(e){const t=this.sortController.getSortOptions(),i=(e,n)=>{var s,r,o,a;return null!=e.rowIndex&&null!=n.rowIndex?e.rowIndex-n.rowIndex:e.level===n.level?(null==(s=e.parent)?void 0:s.id)===(null==(r=n.parent)?void 0:r.id)?this.rowNodeSorter.compareRowNodes(t,{rowNode:e,currentPos:null!=(o=e.rowIndex)?o:-1},{rowNode:n,currentPos:null!=(a=n.rowIndex)?a:-1}):i(e.parent,n.parent):e.level>n.level?i(e.parent,n):i(e,n.parent)};e.sort(i)}processPinnedBottomRows(e,t){return i=>{const n=this.processRow.bind(this,i,e,t);return e.rowPositions?e.rowPositions.filter(e=>"bottom"===e.rowPinned).sort((e,t)=>e.rowIndex-t.rowIndex).map(e=>this.pinnedRowModel.getPinnedBottomRow(e.rowIndex)).forEach(n):this.pinnedRowModel.forEachPinnedBottomRow(n),i}}getColumnsToExport(e=!1,t=!1,i){const n=this.columnModel.isPivotMode();if(i&&i.length)return this.columnModel.getGridColumns(i);const s=this.gos.get("treeData");let r=[];return r=e&&!n?this.columnModel.getAllGridColumns():this.columnModel.getAllDisplayedColumns(),t&&!s&&(r=r.filter(e=>e.getColId()!==dt)),r}recursivelyAddHeaderGroups(e,t,i){const n=[];e.forEach(e=>{const t=e;t.getChildren&&t.getChildren().forEach(e=>n.push(e))}),e.length>0&&e[0]instanceof lt&&this.doAddHeaderHeader(t,e,i),n&&n.length>0&&this.recursivelyAddHeaderGroups(n,t,i)}doAddHeaderHeader(e,t,i){const n=e.onNewHeaderGroupingRow();let s=0;t.forEach(e=>{const t=e;let r;r=i?i(this.gos.addGridCommonParams({columnGroup:t})):this.columnModel.getDisplayNameForColumnGroup(t,"header");const o=t.getLeafColumns().reduce((e,t,i,n)=>{let s=cs.last(e);return"open"===t.getColumnGroupShow()?s&&null==s[1]||(s=[i],e.push(s)):s&&null==s[1]&&(s[1]=i-1),i===n.length-1&&s&&null==s[1]&&(s[1]=i),e},[]);n.onColumn(t,r||"",s++,t.getLeafColumns().length-1,o)})}};Jh([ue("displayedGroupCreator")],ou.prototype,"displayedGroupCreator",2),Jh([ue("columnModel")],ou.prototype,"columnModel",2),Jh([ue("rowModel")],ou.prototype,"rowModel",2),Jh([ue("pinnedRowModel")],ou.prototype,"pinnedRowModel",2),Jh([ue("selectionService")],ou.prototype,"selectionService",2),Jh([ue("rowNodeSorter")],ou.prototype,"rowNodeSorter",2),Jh([ue("sortController")],ou.prototype,"sortController",2);var au={version:"31.3.4",moduleName:"@ag-grid-community/csv-export",beans:[ru,ou=Jh([he("gridSerializer")],ou)]};function lu(e,t){let i="";for(let n=0;n<t;n++)i+=String.fromCharCode(255&e),e>>>=8;return i}var cu=e=>e.length?(e=>{if(!e.length)return 0;let t=-1,i=0,n=0,s=0;for(let r=0;r<e.length;r++)i=e[r],n=255&(t^i),s=hu[n],t=t>>>8^s;return-1^t})("string"==typeof e?(new TextEncoder).encode(e):e):0,hu=new Uint32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]),{utf8_encode:uu}=cs,du=(e,t)=>eu(void 0,null,function*(){const{content:i}=e,{size:n,content:s}=i?fu(i):{size:0,content:Uint8Array.from([])};let r,o,a=!1;if("file"===e.type&&s&&n>0){const e=yield(e=>eu(void 0,null,function*(){const t=new Blob([e]),{size:i,content:n}=yield(s=t,eu(void 0,null,function*(){let e=0;const t=[],i=new WritableStream({write:i=>{t.push(i),e+=i.length}}),n=new ReadableStream({start:e=>{const t=new FileReader;t.onload=t=>{var i;(null==(i=t.target)?void 0:i.result)&&e.enqueue(t.target.result),e.close()},t.readAsArrayBuffer(s)}}),r=new window.CompressionStream("deflate-raw");return yield n.pipeThrough(r).pipeTo(i),{size:e,content:new Blob(t)}}));var s;return{size:i,content:new Uint8Array(yield n.arrayBuffer())}}))(s);r=e.content,o=e.size,a=!0}const l=gu(e,a,t,n,s,o);return Qh(Zh({},l),{content:r||s,isCompressed:a})}),pu=(e,t)=>{const{content:i}=e,{content:n}=i?fu(i):{content:Uint8Array.from([])},s=gu(e,!1,t,n.length,n,void 0);return Qh(Zh({},s),{content:n,isCompressed:!1})},gu=(e,t,i,n,s,r)=>{const{content:o,path:a,created:l}=e,c=(e=>{let t=e.getHours();return t<<=6,t|=e.getMinutes(),t<<=5,t|=e.getSeconds()/2,t})(l),h=(e=>{let t=e.getFullYear()-1980;return t<<=4,t|=e.getMonth()+1,t<<=5,t|=e.getDate(),t})(l),u=cu(s),d=void 0!==r?r:n,p=uu(a),g=p!==a;let f="";if(g){const e=lu(1,1)+lu(cu(p),4)+p;f="up"+lu(e.length,2)+e}const m="\0"+(g?"\0\b":"\0\0")+lu(t?8:0,2)+lu(c,2)+lu(h,2)+lu(d?u:0,4)+lu(null!=r?r:n,4)+lu(n,4)+lu(p.length,2)+lu(f.length,2),y="PK"+m+p+f,v="PK\0"+m+"\0\0\0\0\0\0"+(o?"\0\0\0\0":"\0\0\0")+lu(i,4)+p+f;return{localFileHeader:Uint8Array.from(y,e=>e.charCodeAt(0)),centralDirectoryHeader:Uint8Array.from(v,e=>e.charCodeAt(0))}},fu=e=>{let t;return t="string"==typeof e?(e=>{const t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t})(atob(e.split(";base64,")[1])):e,{size:t.length,content:t}},mu=class{static addFolders(e){e.forEach(this.addFolder.bind(this))}static addFolder(e){this.folders.push({path:e,created:new Date,isBase64:!1,type:"folder"})}static addFile(e,t,i=!1){this.files.push({path:e,created:new Date,content:i?t:(new TextEncoder).encode(t),isBase64:i,type:"file"})}static getZipFile(e="application/zip"){return eu(this,null,function*(){const t=yield this.buildCompressedFileStream();return this.clearStream(),new Blob([t],{type:e})})}static getUncompressedZipFile(e="application/zip"){const t=this.buildFileStream();return this.clearStream(),new Blob([t],{type:e})}static clearStream(){this.folders=[],this.files=[]}static packageFiles(e){let t=new Uint8Array(0),i=new Uint8Array(0),n=0,s=0;for(const r of e){const{localFileHeader:e,centralDirectoryHeader:o,content:a}=r,l=new Uint8Array(t.length+e.length);l.set(t),l.set(e,t.length),t=l;const c=new Uint8Array(t.length+a.length);c.set(t),c.set(a,t.length),t=c;const h=new Uint8Array(i.length+o.length);h.set(i),h.set(o,i.length),i=h,n+=e.length+a.length,s+=o.length}const r=((e,t,i)=>{const n="PK\0\0\0\0"+lu(e,2)+lu(e,2)+lu(t,4)+lu(i,4)+"\0\0";return Uint8Array.from(n,e=>e.charCodeAt(0))})(e.length,s,n),o=new Uint8Array(t.length+i.length+r.length);return o.set(t),o.set(i,t.length),o.set(r,t.length+i.length),o}static buildCompressedFileStream(){return eu(this,null,function*(){const e=[...this.folders,...this.files],t=[];let i=0;for(const n of e){const e=yield du(n,i),{localFileHeader:s,content:r}=e;t.push(e),i+=s.length+r.length}return this.packageFiles(t)})}static buildFileStream(){const e=[...this.folders,...this.files],t=[];let i=0;for(const n of e){const e=pu(n,i),{localFileHeader:s,content:r}=e;t.push(e),i+=s.length+r.length}return this.packageFiles(t)}};mu.folders=[],mu.files=[],re.__registerModules([_h,Uh,au],!1,void 0);var yu=i(70316),vu=i(32431),bu=Object.defineProperty,Cu=Object.defineProperties,wu=Object.getOwnPropertyDescriptors,Su=Object.getOwnPropertySymbols,xu=Object.prototype.hasOwnProperty,Eu=Object.prototype.propertyIsEnumerable,Au=(e,t,i)=>t in e?bu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Mu=(e,t)=>{for(var i in t||(t={}))xu.call(t,i)&&Au(e,i,t[i]);if(Su)for(var i of Su(t))Eu.call(t,i)&&Au(e,i,t[i]);return e},Tu=(e,t)=>Cu(e,wu(t)),Du=(0,n.createContext)({setMethods:()=>{}}),Iu=(0,n.memo)(e=>{const{initialProps:t,addUpdateCallback:i,CustomComponentClass:s,setMethods:r}=e,[o,a]=(0,n.useState)(t);return(0,n.useEffect)(()=>{i(e=>a(e))},[]),n.createElement(Du.Provider,{value:{setMethods:r}},n.createElement(s,Mu({},o)))}),Ru=0;function ku(){return"agPortalKey_"+ ++Ru}var Pu=class{constructor(e,t,i,n){this.portal=null,this.oldPortal=null,this.reactComponent=e,this.portalManager=t,this.componentType=i,this.suppressFallbackMethods=!!n,this.statelessComponent=this.isStateless(this.reactComponent),this.key=ku(),this.portalKey=ku(),this.instanceCreated=this.isStatelessComponent()?us.resolve(!1):new us(e=>{this.resolveInstanceCreated=e})}getGui(){return this.eParentElement}getRootElement(){return this.eParentElement.firstChild}destroy(){return this.componentInstance&&"function"==typeof this.componentInstance.destroy&&this.componentInstance.destroy(),this.portalManager.destroyPortal(this.portal)}createParentElement(e){const t=this.portalManager.getComponentWrappingElement(),i=document.createElement(t||"div");return i.classList.add("ag-react-container"),e.reactContainer=i,i}addParentContainerStyleAndClasses(){this.componentInstance&&(this.componentInstance.getReactContainerStyle&&this.componentInstance.getReactContainerStyle()&&(cs.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())&&(cs.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"function"==typeof Symbol&&Symbol.for}isStateless(e){return"function"==typeof e&&!(e.prototype&&e.prototype.isReactComponent)||"object"==typeof e&&e.$$typeof===this.getMemoType()}hasMethod(e){const t=this.getFrameworkComponentInstance();return!!t&&null!=t[e]||this.fallbackMethodAvailable(e)}callMethod(e,t){const i=this.getFrameworkComponentInstance();if(this.isStatelessComponent())return this.fallbackMethod(e,t&&t[0]?t[0]:{});if(!i)return void setTimeout(()=>this.callMethod(e,t));const n=i[e];return n?n.apply(i,t):this.fallbackMethodAvailable(e)?this.fallbackMethod(e,t&&t[0]?t[0]:{}):void 0}addMethod(e,t){this[e]=t}init(e){return this.eParentElement=this.createParentElement(e),this.params=e,this.createOrUpdatePortal(e),new us(e=>this.createReactComponent(e))}createOrUpdatePortal(e){this.isStatelessComponent()||(this.ref=e=>{var t;this.componentInstance=e,this.addParentContainerStyleAndClasses(),null==(t=this.resolveInstanceCreated)||t.call(this,!0),this.resolveInstanceCreated=void 0},e.ref=this.ref),this.reactElement=this.createElement(this.reactComponent,Tu(Mu({},e),{key:this.key})),this.portal=(0,yu.createPortal)(this.reactElement,this.eParentElement,this.portalKey)}createElement(e,t){return(0,n.createElement)(e,t)}createReactComponent(e){this.portalManager.mountReactPortal(this.portal,this,t=>{e(t)})}isNullValue(){return this.valueRenderedIsNull(this.params)}rendered(){return this.isStatelessComponent()&&this.statelessComponentRendered()||!(this.isStatelessComponent()||!this.getFrameworkComponentInstance())}valueRenderedIsNull(e){if(!this.componentType.cellRenderer)return!1;const t=console.error;try{return console.error=()=>{},""===(0,vu.renderToStaticMarkup)((0,n.createElement)(this.reactComponent,e))}catch(e){}finally{console.error=t}return!1}refreshComponent(e){this.oldPortal=this.portal,this.createOrUpdatePortal(e),this.portalManager.updateReactPortal(this.oldPortal,this.portal)}fallbackMethod(e,t){const i=this[`${e}Component`];if(!this.suppressFallbackMethods&&i)return i.bind(this)(t)}fallbackMethodAvailable(e){return!this.suppressFallbackMethods&&!!this[`${e}Component`]}};function _u(e,t,i){e.forEach(e=>{const n=t[e];n&&(i[e]=n)})}var Lu=class extends Pu{constructor(){super(...arguments),this.awaitUpdateCallback=new us(e=>{this.resolveUpdateCallback=e}),this.wrapperComponent=Iu}init(e){return this.sourceParams=e,super.init(this.getProps())}addMethod(){}getInstance(){return this.instanceCreated.then(()=>this.componentInstance)}getFrameworkComponentInstance(){return this}createElement(e,t){return super.createElement(this.wrapperComponent,{initialProps:t,CustomComponentClass:e,setMethods:e=>this.setMethods(e),addUpdateCallback:e=>{this.updateCallback=()=>(e(this.getProps()),new us(e=>{setTimeout(()=>{e()})})),this.resolveUpdateCallback()}})}setMethods(e){this.providedMethods=e,_u(this.getOptionalMethods(),this.providedMethods,this)}getOptionalMethods(){return[]}getProps(){return Tu(Mu({},this.sourceParams),{key:this.key,ref:this.ref})}refreshProps(){return this.updateCallback?this.updateCallback():new us(e=>this.awaitUpdateCallback.then(()=>{this.updateCallback().then(()=>e())}))}},Nu=class extends Lu{constructor(){super(...arguments),this.date=null,this.onDateChange=e=>this.updateDate(e)}getDate(){return this.date}setDate(e){this.date=e,this.refreshProps()}refresh(e){this.sourceParams=e,this.refreshProps()}getOptionalMethods(){return["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled"]}updateDate(e){this.setDate(e),this.sourceParams.onDateChanged()}getProps(){const e=super.getProps();return e.date=this.date,e.onDateChange=this.onDateChange,delete e.onDateChanged,e}},Ou=class extends Lu{constructor(){super(...arguments),this.model=null,this.onModelChange=e=>this.updateModel(e),this.onUiChange=()=>this.sourceParams.filterChangedCallback()}isFilterActive(){return null!=this.model}doesFilterPass(e){return this.providedMethods.doesFilterPass(e)}getModel(){return this.model}setModel(e){return this.model=e,this.refreshProps()}refresh(e){return this.sourceParams=e,this.refreshProps(),!0}getOptionalMethods(){return["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onAnyFilterChanged"]}updateModel(e){this.setModel(e).then(()=>this.sourceParams.filterChangedCallback())}getProps(){const e=super.getProps();return e.model=this.model,e.onModelChange=this.onModelChange,e.onUiChange=this.onUiChange,delete e.filterChangedCallback,delete e.filterModifiedCallback,delete e.valueGetter,e}};function Fu(e,t){e.parentFilterInstance(i=>{(i.setModel(t)||us.resolve()).then(()=>{e.filterParams.filterChangedCallback()})})}var Gu=class{constructor(e,t){this.floatingFilterParams=e,this.refreshProps=t,this.model=null,this.onModelChange=e=>this.updateModel(e)}getProps(){return Tu(Mu({},this.floatingFilterParams),{model:this.model,onModelChange:this.onModelChange})}onParentModelChanged(e){this.model=e,this.refreshProps()}refresh(e){this.floatingFilterParams=e,this.refreshProps()}setMethods(e){_u(this.getOptionalMethods(),e,this)}getOptionalMethods(){return["afterGuiAttached"]}updateModel(e){this.model=e,this.refreshProps(),Fu(this.floatingFilterParams,e)}},Bu=class extends Lu{constructor(){super(...arguments),this.model=null,this.onModelChange=e=>this.updateModel(e)}onParentModelChanged(e){this.model=e,this.refreshProps()}refresh(e){this.sourceParams=e,this.refreshProps()}getOptionalMethods(){return["afterGuiAttached"]}updateModel(e){this.model=e,this.refreshProps(),Fu(this.sourceParams,e)}getProps(){const e=super.getProps();return e.model=this.model,e.onModelChange=this.onModelChange,e}},Vu=class extends Lu{refresh(e){this.sourceParams=e,this.refreshProps()}},Hu=class extends Lu{constructor(){super(...arguments),this.active=!1,this.expanded=!1,this.onActiveChange=e=>this.updateActive(e)}setActive(e){this.awaitSetActive(e)}setExpanded(e){this.expanded=e,this.refreshProps()}getOptionalMethods(){return["select","configureDefaults"]}awaitSetActive(e){return this.active=e,this.refreshProps()}updateActive(e){const t=this.awaitSetActive(e);e&&t.then(()=>this.sourceParams.onItemActivated())}getProps(){const e=super.getProps();return e.active=this.active,e.expanded=this.expanded,e.onActiveChange=this.onActiveChange,delete e.onItemActivated,e}},Uu=class extends Lu{refresh(e){this.sourceParams=e,this.refreshProps()}},zu=class extends Lu{refresh(e){return this.sourceParams=e,this.refreshProps(),!0}},Wu=class extends Lu{constructor(){super(...arguments),this.onStateChange=e=>this.updateState(e)}refresh(e){return this.sourceParams=e,this.refreshProps(),!0}getState(){return this.state}updateState(e){this.state=e,this.refreshProps(),this.sourceParams.onStateUpdated()}getProps(){const e=super.getProps();return e.state=this.state,e.onStateChange=this.onStateChange,e}},ju=class e{constructor(t,i,n){this.destroyed=!1,this.portals=[],this.hasPendingPortalUpdate=!1,this.wrappingElement=i||"div",this.refresher=t,this.maxComponentCreationTimeMs=n||e.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,i){this.portals=[...this.portals,e],this.waitForInstance(t,i),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,i=Date.now()){if(this.destroyed)t(null);else if(e.rendered())t(e);else{if(Date.now()-i>=this.maxComponentCreationTimeMs&&!this.hasPendingPortalUpdate)return e.isNullValue()?void t(e):(console.error(`AG Grid: React Component '${e.getReactComponentName()}' not created within ${this.maxComponentCreationTimeMs}ms.`),void console.error("    If the component is using `forwardRef` but not `useImperativeHandle`, add the following: `useImperativeHandle(ref, () => ({}));`"));window.setTimeout(()=>{this.waitForInstance(e,t,i)})}}};ju.MAX_COMPONENT_CREATION_TIME_IN_MS=1e3;var $u=ju,Ku=n.createContext({}),Yu=(...e)=>e.filter(e=>null!=e&&""!==e).join(" "),qu=class e{constructor(...e){this.classesMap={},e.forEach(e=>{this.classesMap[e]=!0})}setClass(t,i){if(!!this.classesMap[t]==i)return this;const n=new e;return n.classesMap=Mu({},this.classesMap),n.classesMap[t]=i,n}toString(){return Object.keys(this.classesMap).filter(e=>this.classesMap[e]).join(" ")}},Xu=e=>"function"==typeof e&&!(e.prototype&&e.prototype.isReactComponent)||"object"==typeof e&&e.$$typeof===("function"==typeof Symbol&&Symbol.for?Symbol.for("react.memo"):60115),Zu=null!=yu.createRoot&&null!=yu.flushSync,Qu=!1,Ju=(e,t)=>{Zu&&e&&!Qu?yu.flushSync(t):t()};function ed(e,t,i){if(null==t||null==e)return t;if(e===t||0===t.length&&0===e.length)return e;if(i||0===e.length&&t.length>0||e.length>0&&0===t.length)return t;const n=[],s=[],r=new Map,o=new Map;for(let e=0;e<t.length;e++){const i=t[e];o.set(i.getInstanceId(),i)}for(let t=0;t<e.length;t++){const i=e[t];r.set(i.getInstanceId(),i),o.has(i.getInstanceId())&&n.push(i)}for(let e=0;e<t.length;e++){const i=t[e],n=i.getInstanceId();r.has(n)||s.push(i)}return n.length===e.length&&0===s.length?e:0===n.length&&s.length===t.length?t:0===n.length?s:0===s.length?n:[...n,...s]}var td=(e,t,i,n)=>{if(!e||e.componentFromFramework||t.isDestroyed())return;const s=e.newAgStackInstance();if(!s)return;let r,o,a=!1;return s.then(e=>{a?t.destroyBean(e):(r=e,o=r.getGui(),i.appendChild(o),id(n,r))}),()=>{a=!0,r&&(o&&o.parentElement&&o.parentElement.removeChild(o),t.destroyBean(r),n&&id(n,void 0))}},id=(e,t)=>{e&&(e instanceof Function?e(t):e.current=t)},nd=(0,n.forwardRef)((e,t)=>{var i;const s=(0,n.useContext)(Ku).context,r=(0,n.useRef)(null),o=(0,n.useRef)(null),a=(0,n.useRef)(null),l=(0,n.useRef)(null),c=(0,n.useRef)(null),h=(0,n.useRef)(),[u,d]=(0,n.useState)(),[p,g]=(0,n.useState)(),[f,m]=(0,n.useState)(),[y,v]=(0,n.useState)(()=>new qu),[b,C]=(0,n.useState)(()=>new qu("ag-hidden")),[w,S]=(0,n.useState)(()=>new qu("ag-hidden")),[x,E]=(0,n.useState)(()=>new qu("ag-invisible"));(0,n.useImperativeHandle)(t,()=>({refresh:()=>!1})),(0,n.useLayoutEffect)(()=>td(u,s,o.current),[u]);const A=(0,n.useCallback)(t=>{if(r.current=t,!r.current)return s.destroyBean(h.current),void(h.current=null);const i={setInnerRenderer:(e,t)=>{d(e),m(t)},setChildCount:e=>g(e),addOrRemoveCssClass:(e,t)=>v(i=>i.setClass(e,t)),setContractedDisplayed:e=>S(t=>t.setClass("ag-hidden",!e)),setExpandedDisplayed:e=>C(t=>t.setClass("ag-hidden",!e)),setCheckboxVisible:e=>E(t=>t.setClass("ag-invisible",!e))};h.current=s.createBean(new Br),h.current.init(i,r.current,a.current,l.current,c.current,nd,e)},[]),M=(0,n.useMemo)(()=>`ag-cell-wrapper ${y.toString()}`,[y]),T=(0,n.useMemo)(()=>`ag-group-expanded ${b.toString()}`,[b]),D=(0,n.useMemo)(()=>`ag-group-contracted ${w.toString()}`,[w]),I=(0,n.useMemo)(()=>`ag-group-checkbox ${x.toString()}`,[x]),R=u&&u.componentFromFramework,k=R?u.componentClass:void 0,P=null==u&&null!=f,_=cs.escapeString(f,!0);return n.createElement("span",Mu({className:M,ref:A},e.colDef?{}:{role:null==(i=h.current)?void 0:i.getCellAriaRole()}),n.createElement("span",{className:T,ref:l}),n.createElement("span",{className:D,ref:c}),n.createElement("span",{className:I,ref:a}),n.createElement("span",{className:"ag-group-value",ref:o},P&&n.createElement(n.Fragment,null,_),R&&n.createElement(k,Mu({},u.params))),n.createElement("span",{className:"ag-group-child-count"},p))}),sd=nd,rd=(0,n.memo)(e=>{const{ctrl:t}=e,i=t.isAlive(),{context:s}=(0,n.useContext)(Ku),r=i?t.getColId():void 0,[o,a]=(0,n.useState)(),l=(0,n.useRef)(null),c=(0,n.useRef)(null),h=(0,n.useRef)(null),u=(0,n.useRef)();let d=(0,n.useRef)();i&&!d.current&&(d.current=new ds(()=>l.current));const p=(0,n.useCallback)(e=>{var n;if(l.current=e,!l.current||!i)return;const s={setWidth:e=>{l.current&&(l.current.style.width=e)},addOrRemoveCssClass:(e,t)=>d.current.addOrRemoveCssClass(e,t),setAriaSort:e=>{l.current&&(e?cs.setAriaSort(l.current,e):cs.removeAriaSort(l.current))},setUserCompDetails:e=>a(e),getUserCompInstance:()=>u.current||void 0};t.setComp(s,l.current,c.current,h.current);const r=t.getSelectAllGui();null==(n=c.current)||n.insertAdjacentElement("afterend",r)},[]);(0,n.useLayoutEffect)(()=>td(o,s,h.current,u),[o]),(0,n.useEffect)(()=>{t.setDragSource(l.current)},[o]);const g=(0,n.useMemo)(()=>!(!(null==o?void 0:o.componentFromFramework)||!Xu(o.componentClass)),[o]),f=o&&o.componentFromFramework,m=o&&o.componentClass;return n.createElement("div",{ref:p,className:"ag-header-cell","col-id":r,role:"columnheader"},n.createElement("div",{ref:c,className:"ag-header-cell-resize",role:"presentation"}),n.createElement("div",{ref:h,className:"ag-header-cell-comp-wrapper",role:"presentation"},f&&g&&n.createElement(m,Mu({},o.params)),f&&!g&&n.createElement(m,Tu(Mu({},o.params),{ref:u}))))}),od=(0,n.memo)(e=>{const{context:t}=(0,n.useContext)(Ku),{ctrl:i}=e,[s,r]=(0,n.useState)(()=>new qu),[o,a]=(0,n.useState)(()=>new qu),[l,c]=(0,n.useState)("false"),[h,u]=(0,n.useState)(),[d,p]=(0,n.useState)(),g=(0,n.useMemo)(()=>i.getColId(),[]),f=(0,n.useRef)(null),m=(0,n.useRef)(null),y=(0,n.useRef)(),v=(0,n.useCallback)(e=>{if(f.current=e,!f.current)return;const t={setWidth:e=>{f.current&&(f.current.style.width=e)},addOrRemoveCssClass:(e,t)=>r(i=>i.setClass(e,t)),setUserCompDetails:e=>p(e),setResizableDisplayed:e=>{a(t=>t.setClass("ag-hidden",!e)),c(e?"false":"true")},setAriaExpanded:e=>u(e),getUserCompInstance:()=>y.current||void 0};i.setComp(t,f.current,m.current)},[]);(0,n.useLayoutEffect)(()=>td(d,t,f.current),[d]),(0,n.useEffect)(()=>{f.current&&i.setDragSource(f.current)},[d]);const b=(0,n.useMemo)(()=>!(!(null==d?void 0:d.componentFromFramework)||!Xu(d.componentClass)),[d]),C=(0,n.useMemo)(()=>"ag-header-group-cell "+s.toString(),[s]),w=(0,n.useMemo)(()=>"ag-header-cell-resize "+o.toString(),[o]),S=d&&d.componentFromFramework,x=d&&d.componentClass;return n.createElement("div",{ref:v,className:C,"col-id":g,role:"columnheader","aria-expanded":h},S&&b&&n.createElement(x,Mu({},d.params)),S&&!b&&n.createElement(x,Tu(Mu({},d.params),{ref:y})),n.createElement("div",{ref:m,"aria-hidden":l,className:w}))});function ad(){cs.warnOnce("Using custom components without `reactiveCustomComponents = true` is deprecated.")}var ld=(0,n.memo)(e=>{const{context:t,gos:i}=(0,n.useContext)(Ku),[s,r]=(0,n.useState)(()=>new qu("ag-header-cell","ag-floating-filter")),[o,a]=(0,n.useState)(()=>new qu),[l,c]=(0,n.useState)(()=>new qu("ag-floating-filter-button","ag-hidden")),[h,u]=(0,n.useState)("false"),[d,p]=(0,n.useState)(),[g,f]=(0,n.useState)(1),m=(0,n.useRef)(null),y=(0,n.useRef)(null),v=(0,n.useRef)(null),b=(0,n.useRef)(null),C=(0,n.useRef)(),w=(0,n.useRef)(),S=e=>{null!=e&&C.current&&C.current(e)},{ctrl:x}=e,E=(0,n.useCallback)(e=>{if(m.current=e,!m.current)return;w.current=new us(e=>{C.current=e});const t={addOrRemoveCssClass:(e,t)=>r(i=>i.setClass(e,t)),addOrRemoveBodyCssClass:(e,t)=>a(i=>i.setClass(e,t)),setButtonWrapperDisplayed:e=>{c(t=>t.setClass("ag-hidden",!e)),u(e?"false":"true")},setWidth:e=>{m.current&&(m.current.style.width=e)},setCompDetails:e=>p(e),getFloatingFilterComp:()=>w.current?w.current:null,setMenuIcon:e=>{var t;return null==(t=b.current)?void 0:t.appendChild(e)}};x.setComp(t,m.current,b.current,y.current)},[]);(0,n.useLayoutEffect)(()=>td(d,t,y.current,S),[d]);const A=(0,n.useMemo)(()=>s.toString(),[s]),M=(0,n.useMemo)(()=>o.toString(),[o]),T=(0,n.useMemo)(()=>l.toString(),[l]),D=(0,n.useMemo)(()=>!!(d&&d.componentFromFramework&&Xu(d.componentClass)),[d]),I=(0,n.useMemo)(()=>i.get("reactiveCustomComponents"),[]),R=(0,n.useMemo)(()=>{if(d){if(I){const e=new Gu(d.params,()=>f(e=>e+1));return S(e),e}d.componentFromFramework&&ad()}},[d]),k=null==R?void 0:R.getProps(),P=d&&d.componentFromFramework,_=d&&d.componentClass;return n.createElement("div",{ref:E,className:A,role:"gridcell"},n.createElement("div",{ref:y,className:M,role:"presentation"},P&&!I&&n.createElement(_,Tu(Mu({},d.params),{ref:D?()=>{}:S})),P&&I&&n.createElement(Du.Provider,{value:{setMethods:e=>R.setMethods(e)}},n.createElement(_,Mu({},k)))),n.createElement("div",{ref:v,"aria-hidden":h,className:T,role:"presentation"},n.createElement("button",{ref:b,type:"button",className:"ag-button ag-floating-filter-button-button",tabIndex:-1})))}),cd=(0,n.memo)(e=>{const{ctrl:t}=e,{topOffset:i,rowHeight:s}=(0,n.useMemo)(()=>t.getTopAndHeight(),[]),r=t.getAriaRowIndex(),o=t.getHeaderRowClass(),[a,l]=(0,n.useState)(()=>s+"px"),[c,h]=(0,n.useState)(()=>i+"px"),u=(0,n.useRef)(null),d=(0,n.useRef)(null),[p,g]=(0,n.useState)(()=>t.getHeaderCtrls()),f=(0,n.useRef)(null),m=(0,n.useCallback)(e=>{if(f.current=e,!e)return;const i={setHeight:e=>l(e),setTop:e=>h(e),setHeaderCtrls:(e,t,i)=>{d.current=u.current,u.current=e;const n=ed(d.current,e,t);n!==d.current&&Ju(i,()=>g(n))},setWidth:e=>{f.current&&(f.current.style.width=e)}};t.setComp(i,!1)},[]),y=(0,n.useMemo)(()=>({height:a,top:c}),[a,c]),v=(0,n.useCallback)(e=>{switch(t.getType()){case Ga.COLUMN_GROUP:return n.createElement(od,{ctrl:e,key:e.getInstanceId()});case Ga.FLOATING_FILTER:return n.createElement(ld,{ctrl:e,key:e.getInstanceId()});default:return n.createElement(rd,{ctrl:e,key:e.getInstanceId()})}},[]);return n.createElement("div",{ref:m,className:o,role:"row",style:y,"aria-rowindex":r},p.map(v))}),hd=(0,n.memo)(e=>{const[t,i]=(0,n.useState)(!0),[s,r]=(0,n.useState)([]),{context:o}=(0,n.useContext)(Ku),a=(0,n.useRef)(null),l=(0,n.useRef)(null),c=(0,n.useRef)(null),h="left"===e.pinned,u="right"===e.pinned,d=!h&&!u,p=(0,n.useCallback)(t=>{if(a.current=t,!a.current)return o.destroyBean(c.current),void(c.current=null);const n={setDisplayed:i,setCtrls:e=>r(e),setCenterWidth:e=>{l.current&&(l.current.style.width=e)},setViewportScrollLeft:e=>{a.current&&(a.current.scrollLeft=e)},setPinnedContainerWidth:e=>{a.current&&(a.current.style.width=e,a.current.style.minWidth=e,a.current.style.maxWidth=e)}};c.current=o.createBean(new el(e.pinned)),c.current.setComp(n,a.current)},[]),g=t?"":"ag-hidden",f=()=>s.map(e=>n.createElement(cd,{ctrl:e,key:e.getInstanceId()}));return n.createElement(n.Fragment,null,h&&n.createElement("div",{ref:p,className:"ag-pinned-left-header "+g,"aria-hidden":!t,role:"rowgroup"},f()),u&&n.createElement("div",{ref:p,className:"ag-pinned-right-header "+g,"aria-hidden":!t,role:"rowgroup"},f()),d&&n.createElement("div",{ref:p,className:"ag-header-viewport "+g,role:"presentation"},n.createElement("div",{ref:l,className:"ag-header-container",role:"rowgroup"},f())))}),ud=(0,n.memo)(()=>{const[e,t]=(0,n.useState)(()=>new qu),[i,s]=(0,n.useState)(),{context:r}=(0,n.useContext)(Ku),o=(0,n.useRef)(null),a=(0,n.useRef)(null),l=(0,n.useCallback)(e=>{if(o.current=e,!e)return r.destroyBean(a.current),void(a.current=null);const i={addOrRemoveCssClass:(e,i)=>t(t=>t.setClass(e,i)),setHeightAndMinHeight:e=>s(e)};a.current=r.createBean(new sl),a.current.setComp(i,o.current,o.current)},[]),c=(0,n.useMemo)(()=>"ag-header "+e.toString(),[e]),h=(0,n.useMemo)(()=>({height:i,minHeight:i}),[i]);return n.createElement("div",{ref:l,className:c,style:h,role:"presentation"},n.createElement(hd,{pinned:"left"}),n.createElement(hd,{pinned:null}),n.createElement(hd,{pinned:"right"}))}),dd=(e,t)=>{(0,n.useEffect)(()=>{const i=t.current;if(i){const t=i.parentElement;if(t){const n=document.createComment(e);return t.insertBefore(n,i),()=>{t.removeChild(n)}}}},[e])},pd=(0,n.memo)(e=>{const[t,i]=(0,n.useState)(),{context:s,popupService:r,localeService:o,gos:a}=(0,n.useContext)(Ku);return(()=>{const t=(0,n.useRef)(()=>{const{editDetails:t,cellCtrl:n,eParentCell:l}=e,{compDetails:c}=t,h=a.get("stopEditingWhenCellsLoseFocus"),u=s.createBean(new Ma(c.params)),d=u.getGui();if(e.jsChildComp){const t=e.jsChildComp.getGui();t&&d.appendChild(t)}const p={column:n.getColumn(),rowNode:n.getRowNode(),type:"popupCellEditor",eventSource:l,ePopup:d,position:t.popupPosition,keepWithinBounds:!0},g=r.positionPopupByComponent.bind(r,p),f=o.getLocaleTextFunc(),m=r.addPopup({modal:h,eChild:d,closeOnEsc:!0,closedCallback:()=>{n.onPopupEditorClosed()},anchorToElement:l,positionCallback:g,ariaLabel:f("ariaLabelCellEditor","Cell Editor")}),y=m?m.hideFunc:void 0;return i(u),e.jsChildComp&&e.jsChildComp.afterGuiAttached&&e.jsChildComp.afterGuiAttached(),()=>{null!=y&&y(),s.destroyBean(u)}}),l=(0,n.useRef)(),c=(0,n.useRef)(!1),h=(0,n.useRef)(!1),[,u]=(0,n.useState)(0);c.current&&(h.current=!0),(0,n.useEffect)(()=>(c.current||(l.current=t.current(),c.current=!0),u(e=>e+1),()=>{h.current&&l.current&&l.current()}),[])})(),n.createElement(n.Fragment,null,t&&e.wrappedContent&&(0,yu.createPortal)(e.wrappedContent,t.getGui()))}),gd=class{constructor(e,t){this.cellEditorParams=e,this.refreshProps=t,this.instanceCreated=new us(e=>{this.resolveInstanceCreated=e}),this.onValueChange=e=>this.updateValue(e),this.value=e.value}getProps(){return Tu(Mu({},this.cellEditorParams),{initialValue:this.cellEditorParams.value,value:this.value,onValueChange:this.onValueChange})}getValue(){return this.value}refresh(e){this.cellEditorParams=e,this.refreshProps()}setMethods(e){_u(this.getOptionalMethods(),e,this)}getInstance(){return this.instanceCreated.then(()=>this.componentInstance)}setRef(e){var t;this.componentInstance=e,null==(t=this.resolveInstanceCreated)||t.call(this),this.resolveInstanceCreated=void 0}getOptionalMethods(){return["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached"]}updateValue(e){this.value=e,this.refreshProps()}},fd=(e,t,i)=>{const s=e.compProxy;return n.createElement(n.Fragment,null,!s&&n.createElement(t,Tu(Mu({},e.compDetails.params),{ref:i})),s&&((e,t,i)=>{const{compProxy:s}=e;i(s);const r=s.getProps(),o=Xu(t);return n.createElement(Du.Provider,{value:{setMethods:e=>s.setMethods(e)}},o&&n.createElement(t,Mu({},r)),!o&&n.createElement(t,Tu(Mu({},r),{ref:e=>s.setRef(e)})))})(e,t,i))},md=(0,n.memo)(e=>{const{context:t}=(0,n.useContext)(Ku),{cellCtrl:i,printLayout:s,editingRow:r}=e,o=i.getTabIndex(),a=i.getColumnIdSanitised(),l=i.getInstanceId(),[c,h]=(0,n.useState)(()=>i.isCellRenderer()?void 0:{compDetails:void 0,value:i.getValueToDisplay(),force:!1}),[u,d]=(0,n.useState)(),[p,g]=(0,n.useState)(1),[f,m]=(0,n.useState)(),[y,v]=(0,n.useState)(!1),[b,C]=(0,n.useState)(!1),[w,S]=(0,n.useState)(!1),[x,E]=(0,n.useState)(),A=(0,n.useMemo)(()=>i.isForceWrapper(),[i]),M=(0,n.useMemo)(()=>i.getCellAriaRole(),[i]),T=(0,n.useRef)(null),D=(0,n.useRef)(null),I=(0,n.useRef)(),R=(0,n.useRef)(),k=(0,n.useRef)(),P=(0,n.useRef)([]),_=(0,n.useRef)(),[L,N]=(0,n.useState)(0),O=(0,n.useCallback)(e=>{_.current=e,N(e=>e+1)},[]),F=A||null!=c&&(y||w||b),G=(0,n.useCallback)((e,t)=>{R.current=t,t&&(((e,t,i)=>{const n=i.getColumn();if(!e&&t.isPopup&&t.isPopup()){const e=`AG Grid: Found an issue in column ${n.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.`;cs.doOnce(()=>console.warn(e),"jsEditorComp-isPopup-"+i.getColumn().getColId())}if(e&&t.getPopupPosition&&null!=t.getPopupPosition()){const e=`AG Grid: Found an issue in column ${n.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.`;cs.doOnce(()=>console.warn(e),"jsEditorComp-getPopupPosition-"+i.getColumn().getColId())}})(e,t,i),t.isCancelBeforeStart&&t.isCancelBeforeStart()&&setTimeout(()=>{i.stopEditing(!0),i.focusCell(!0)}))},[i]),B=(0,n.useCallback)(e=>G(!0,e),[G]),V=(0,n.useCallback)(e=>G(!1,e),[G]);let H=(0,n.useRef)();H.current||(H.current=new ds(()=>T.current)),((e,t,i,s,r,o)=>{const{context:a}=(0,n.useContext)(Ku),l=(0,n.useCallback)(()=>{const e=r.current;if(!e)return;const t=e.getGui();t&&t.parentElement&&t.parentElement.removeChild(t),a.destroyBean(e),r.current=void 0},[]);(0,n.useEffect)(()=>{const n=null!=e,s=e&&e.compDetails&&!e.compDetails.componentFromFramework;if(!n||!s||t&&null==i)return void l();const a=e.compDetails;if(r.current){const t=r.current,i=!(null==t.refresh||0!=e.force)&&t.refresh(a.params);if(!0===i||void 0===i)return;l()}const c=a.newAgStackInstance();if(!c)return;const h=c.resolveNow(null,e=>e);if(!h)return;const u=h.getGui();u&&((t?i:o.current).appendChild(u),r.current=h)},[e,t,s]),(0,n.useEffect)(()=>l,[])})(c,F,_.current,L,I,T);const U=(0,n.useRef)();(0,n.useLayoutEffect)(()=>{const e=U.current,t=c;if(U.current=c,null==e||null==e.compDetails||null==t||null==t.compDetails)return;const i=e.compDetails,n=t.compDetails;i.componentClass==n.componentClass&&null!=D.current&&null!=D.current.refresh&&1!=D.current.refresh(n.params)&&g(e=>e+1)},[c]),(0,n.useLayoutEffect)(()=>{if(!u||u.compDetails.componentFromFramework)return;const e=u.compDetails,i=!0===u.popup,n=(e=>{const t=e.newAgStackInstance();if(t)return t.resolveNow(null,e=>e)})(e);if(!n)return;const s=n.getGui();if(G(i,n),!i){const e=(A?k:T).current;null==e||e.appendChild(s),n.afterGuiAttached&&n.afterGuiAttached()}return E(n),()=>{t.destroyBean(n),G(i,void 0),E(void 0),s&&s.parentElement&&s.parentElement.removeChild(s)}},[u]);const z=(0,n.useCallback)(e=>{if(k.current=e,!k.current)return P.current.forEach(e=>e()),void(P.current=[]);const n=e=>{var i;if(e){const n=e.getGui();null==(i=k.current)||i.insertAdjacentElement("afterbegin",n),P.current.push(()=>{t.destroyBean(e),cs.removeFromParent(n)})}return e};y&&n(i.createSelectionCheckbox()),w&&n(i.createDndSource()),b&&n(i.createRowDragComp())},[i,t,w,b,y]),W=(0,n.useCallback)(e=>{if(T.current=e,!T.current)return;if(!i)return;const t={addOrRemoveCssClass:(e,t)=>H.current.addOrRemoveCssClass(e,t),setUserStyles:e=>m(e),getFocusableElement:()=>T.current,setIncludeSelection:e=>v(e),setIncludeRowDrag:e=>C(e),setIncludeDndSource:e=>S(e),getCellEditor:()=>R.current||null,getCellRenderer:()=>D.current?D.current:I.current,getParentOfValue:()=>_.current?_.current:k.current?k.current:T.current,setRenderDetails:(e,t,i)=>{h(n=>(null==n?void 0:n.compDetails)!==e||(null==n?void 0:n.value)!==t||(null==n?void 0:n.force)!==i?{value:t,compDetails:e,force:i}:n)},setEditDetails:(e,t,i,n)=>{if(e){let s;n?s=new gd(e.params,()=>g(e=>e+1)):e.componentFromFramework&&ad(),d({compDetails:e,popup:t,popupPosition:i,compProxy:s}),t||h(void 0)}else d(e=>{(null==e?void 0:e.compProxy)&&(R.current=void 0)})}},n=k.current||void 0;i.setComp(t,T.current,n,s,r)},[]),j=(0,n.useMemo)(()=>!!(c&&c.compDetails&&c.compDetails.componentFromFramework&&Xu(c.compDetails.componentClass)),[c]);(0,n.useLayoutEffect)(()=>{var e;T.current&&(H.current.addOrRemoveCssClass("ag-cell-value",!F),H.current.addOrRemoveCssClass("ag-cell-inline-editing",!!u&&!u.popup),H.current.addOrRemoveCssClass("ag-cell-popup-editing",!!u&&!!u.popup),H.current.addOrRemoveCssClass("ag-cell-not-inline-editing",!u||!!u.popup),null==(e=i.getRowCtrl())||e.setInlineEditingCss(!!u),i.shouldRestoreFocus()&&!i.isEditing()&&T.current.focus({preventScroll:!0}))});const $=()=>n.createElement(n.Fragment,null,null!=c&&((e,t,i,s,r,o,a)=>{const{compDetails:l,value:c}=e,h=!l,u=l&&l.componentFromFramework,d=l&&l.componentClass,p=(null==c?void 0:c.toString)?c.toString():c,g=()=>n.createElement(n.Fragment,null,h&&n.createElement(n.Fragment,null,p),u&&!o&&n.createElement(d,Tu(Mu({},l.params),{key:t,ref:s})),u&&o&&n.createElement(d,Tu(Mu({},l.params),{key:t})));return n.createElement(n.Fragment,null,r?n.createElement("span",{role:"presentation",id:`cell-${i}`,className:"ag-cell-value",ref:a},g()):g())})(c,p,l,D,F,j,O),null!=u&&((e,t,i,s,r,o)=>{const a=e.compDetails,l=a.componentClass,c=a.componentFromFramework&&!e.popup,h=a.componentFromFramework&&e.popup,u=!a.componentFromFramework&&e.popup;return n.createElement(n.Fragment,null,c&&fd(e,l,t),h&&n.createElement(pd,{editDetails:e,cellCtrl:r,eParentCell:s,wrappedContent:fd(e,l,i)}),u&&o&&n.createElement(pd,{editDetails:e,cellCtrl:r,eParentCell:s,jsChildComp:o}))})(u,V,B,T.current,i,x));return n.createElement("div",{ref:W,style:f,tabIndex:o,role:M,"col-id":a},F?n.createElement("div",{className:"ag-cell-wrapper",role:"presentation",ref:z},$()):$())}),yd=(0,n.memo)(e=>{const{context:t,gos:i}=(0,n.useContext)(Ku),{rowCtrl:s,containerType:r}=e,o=s.getTabIndex(),a=(0,n.useRef)(s.getDomOrder()),l=s.isFullWidth(),c=s.getRowNode().displayed,[h,u]=(0,n.useState)(()=>c?s.getRowIndex():null),[d,p]=(0,n.useState)(()=>s.getRowId()),[g,f]=(0,n.useState)(()=>s.getBusinessKey()),[m,y]=(0,n.useState)(()=>s.getRowStyles()),v=(0,n.useRef)(null),b=(0,n.useRef)(null),[C,w]=(0,n.useState)(()=>null),[S,x]=(0,n.useState)(),[E,A]=(0,n.useState)(()=>c?s.getInitialRowTop(r):void 0),[M,T]=(0,n.useState)(()=>c?s.getInitialTransform(r):void 0),D=(0,n.useRef)(null),I=(0,n.useRef)(),R=(0,n.useRef)(!1),[k,P]=(0,n.useState)(0);(0,n.useEffect)(()=>{var e;if(R.current)return;if(!S)return;if(k>10)return;const t=null==(e=D.current)?void 0:e.firstChild;t?(s.setupDetailRowAutoHeight(t),R.current=!0):P(e=>e+1)},[S,k]);let _=(0,n.useRef)();_.current||(_.current=new ds(()=>D.current));const L=(0,n.useCallback)(e=>{if(D.current=e,!D.current)return void s.unsetComp(r);if(!s.isAlive())return;const t={setTop:A,setTransform:T,addOrRemoveCssClass:(e,t)=>_.current.addOrRemoveCssClass(e,t),setDomOrder:e=>a.current=e,setRowIndex:u,setRowId:p,setRowBusinessKey:f,setUserStyles:y,setCellCtrls:(e,t)=>{b.current=v.current,v.current=e;const i=ed(b.current,e,a.current);i!==b.current&&Ju(t,()=>w(i))},showFullWidth:e=>x(e),getFullWidthCellRenderer:()=>I.current,refreshFullWidth:e=>B.current?(x(t=>Tu(Mu({},t),{params:e()})),!0):!(!I.current||!I.current.refresh)&&I.current.refresh(e())};s.setComp(t,D.current,r)},[]);(0,n.useLayoutEffect)(()=>td(S,t,D.current,I),[S]);const N=(0,n.useMemo)(()=>{const e={top:E,transform:M};return Object.assign(e,m),e},[E,M,m]),O=l&&S&&S.componentFromFramework,F=!l&&null!=C,G=(0,n.useMemo)(()=>!(!(null==S?void 0:S.componentFromFramework)||!Xu(S.componentClass)),[S]),B=(0,n.useRef)(!1);return(0,n.useEffect)(()=>{B.current=G&&!!S&&!!i.get("reactiveCustomComponents")},[G,S]),n.createElement("div",{ref:L,role:"row",style:N,"row-index":h,"row-id":d,"row-business-key":g,tabIndex:o},F&&(null==C?void 0:C.map(e=>n.createElement(md,{cellCtrl:e,editingRow:s.isEditing(),printLayout:s.isPrintLayout(),key:e.getInstanceId()}))),O&&(()=>{const e=S.componentClass;return n.createElement(n.Fragment,null,G&&n.createElement(e,Mu({},S.params)),!G&&n.createElement(e,Tu(Mu({},S.params),{ref:I})))})())}),vd=(0,n.memo)(e=>{const{context:t}=(0,n.useContext)(Ku),{name:i}=e,s=(0,n.useMemo)(()=>ma(i),[i]),r=(0,n.useRef)(null),o=(0,n.useRef)(null),a=(0,n.useRef)([]),l=(0,n.useRef)([]),[c,h]=(0,n.useState)(()=>[]),u=(0,n.useRef)(!1),d=(0,n.useRef)(),p=(0,n.useMemo)(()=>Ca.getRowContainerCssClasses(i),[i]),g=(0,n.useMemo)(()=>Yu(p.viewport),[p]),f=(0,n.useMemo)(()=>Yu(p.container),[p]),m=i===fa.CENTER||i===fa.TOP_CENTER||i===fa.BOTTOM_CENTER||i===fa.STICKY_TOP_CENTER||i===fa.STICKY_BOTTOM_CENTER;dd(" AG Row Container "+i+" ",m?r:o);const y=(0,n.useCallback)(()=>m?null!=r.current&&null!=o.current:null!=o.current,[]),v=(0,n.useCallback)(()=>m?null==r.current&&null==o.current:null==o.current,[]),b=(0,n.useCallback)(()=>{if(v()&&(t.destroyBean(d.current),d.current=null),y()){const e=e=>{const t=ed(l.current,a.current,u.current);t!==l.current&&(l.current=t,Ju(e,()=>h(t)))},n={setViewportHeight:e=>{r.current&&(r.current.style.height=e)},setRowCtrls:({rowCtrls:t,useFlushSync:i})=>{const n=!!i&&a.current.length>0&&t.length>0;a.current=t,e(n)},setDomOrder:t=>{u.current!=t&&(u.current=t,e(!1))},setContainerWidth:e=>{o.current&&(o.current.style.width=e)}};d.current=t.createBean(new Ca(i)),d.current.setComp(n,o.current,r.current)}},[y,v]),C=(0,n.useCallback)(e=>{o.current=e,b()},[b]),w=(0,n.useCallback)(e=>{r.current=e,b()},[b]),S=()=>n.createElement("div",{className:f,ref:C,role:"rowgroup"},c.map(e=>n.createElement(yd,{rowCtrl:e,containerType:s,key:e.getInstanceId()})));return n.createElement(n.Fragment,null,m?n.createElement("div",{className:g,ref:w,role:"presentation"},S()):S())}),bd=(0,n.memo)(()=>{const{context:e,agStackComponentsRegistry:t,resizeObserverService:i}=(0,n.useContext)(Ku),[s,r]=(0,n.useState)(""),[o,a]=(0,n.useState)(0),[l,c]=(0,n.useState)(0),[h,u]=(0,n.useState)("0px"),[d,p]=(0,n.useState)("0px"),[g,f]=(0,n.useState)("100%"),[m,y]=(0,n.useState)("0px"),[v,b]=(0,n.useState)("0px"),[C,w]=(0,n.useState)("100%"),[S,x]=(0,n.useState)(""),[E,A]=(0,n.useState)(""),[M,T]=(0,n.useState)(null),[D,I]=(0,n.useState)(""),[R,k]=(0,n.useState)(null),[P,_]=(0,n.useState)("ag-layout-normal");let L=(0,n.useRef)();L.current||(L.current=new ds(()=>N.current));const N=(0,n.useRef)(null),O=(0,n.useRef)(null),F=(0,n.useRef)(null),G=(0,n.useRef)(null),B=(0,n.useRef)(null),V=(0,n.useRef)(null),H=(0,n.useRef)(null),U=(0,n.useRef)([]),z=(0,n.useRef)([]);dd(" AG Grid Body ",N),dd(" AG Pinned Top ",O),dd(" AG Sticky Top ",F),dd(" AG Middle ",V),dd(" AG Pinned Bottom ",H);const W=(0,n.useCallback)(n=>{if(N.current=n,!N.current)return e.destroyBeans(U.current),z.current.forEach(e=>e()),U.current=[],void(z.current=[]);if(!e)return;const s=i=>{const n=t.getComponentClass(i),s=e.createBean(new n);return U.current.push(s),s},o=(e,t)=>{e.appendChild(t),z.current.push(()=>e.removeChild(t))};o(N.current,document.createComment(" AG Fake Horizontal Scroll ")),o(N.current,s("AG-FAKE-HORIZONTAL-SCROLL").getGui()),o(N.current,document.createComment(" AG Overlay Wrapper ")),o(N.current,s("AG-OVERLAY-WRAPPER").getGui()),B.current&&(o(B.current,document.createComment(" AG Fake Vertical Scroll ")),o(B.current,s("AG-FAKE-VERTICAL-SCROLL").getGui()));const l={setRowAnimationCssOnBodyViewport:r,setColumnCount:e=>{N.current&&cs.setAriaColCount(N.current,e)},setRowCount:e=>{N.current&&cs.setAriaRowCount(N.current,e)},setTopHeight:a,setBottomHeight:c,setStickyTopHeight:u,setStickyTopTop:p,setStickyTopWidth:f,setTopDisplay:x,setBottomDisplay:A,setColumnMovingCss:(e,t)=>L.current.addOrRemoveCssClass(e,t),updateLayoutClasses:_,setAlwaysVerticalScrollClass:T,setPinnedTopBottomOverflowY:I,setCellSelectableCss:(e,t)=>k(t?e:null),setBodyViewportWidth:e=>{V.current&&(V.current.style.width=e)},registerBodyViewportResizeListener:e=>{if(V.current){const t=i.observeResize(V.current,e);z.current.push(()=>t())}},setStickyBottomHeight:y,setStickyBottomBottom:b,setStickyBottomWidth:w},h=e.createBean(new $o);U.current.push(h),h.setComp(l,N.current,V.current,O.current,H.current,F.current,G.current)},[]),j=(0,n.useMemo)(()=>Yu("ag-root","ag-unselectable",P),[P]),$=(0,n.useMemo)(()=>Yu("ag-body-viewport",s,P,M,R),[s,P,M,R]),K=(0,n.useMemo)(()=>Yu("ag-body",P),[P]),Y=(0,n.useMemo)(()=>Yu("ag-floating-top",R),[R]),q=(0,n.useMemo)(()=>Yu("ag-sticky-top",R),[R]),X=(0,n.useMemo)(()=>Yu("ag-sticky-bottom",R),[R]),Z=(0,n.useMemo)(()=>Yu("ag-floating-bottom",R),[R]),Q=(0,n.useMemo)(()=>({height:o,minHeight:o,display:S,overflowY:D}),[o,S,D]),J=(0,n.useMemo)(()=>({height:h,top:d,width:g}),[h,d,g]),ee=(0,n.useMemo)(()=>({height:m,bottom:v,width:C}),[m,v,C]),te=(0,n.useMemo)(()=>({height:l,minHeight:l,display:E,overflowY:D}),[l,E,D]),ie=e=>n.createElement(vd,{name:e,key:`${e}-container`}),ne=({section:e,children:t,className:i,style:s})=>n.createElement("div",{ref:e,className:i,role:"presentation",style:s},t.map(ie));return n.createElement("div",{ref:W,className:j,role:"treegrid"},n.createElement(ud,null),ne({section:O,className:Y,style:Q,children:[fa.TOP_LEFT,fa.TOP_CENTER,fa.TOP_RIGHT,fa.TOP_FULL_WIDTH]}),n.createElement("div",{className:K,ref:B,role:"presentation"},ne({section:V,className:$,children:[fa.LEFT,fa.CENTER,fa.RIGHT,fa.FULL_WIDTH]})),ne({section:F,className:q,style:J,children:[fa.STICKY_TOP_LEFT,fa.STICKY_TOP_CENTER,fa.STICKY_TOP_RIGHT,fa.STICKY_TOP_FULL_WIDTH]}),ne({section:G,className:X,style:ee,children:[fa.STICKY_BOTTOM_LEFT,fa.STICKY_BOTTOM_CENTER,fa.STICKY_BOTTOM_RIGHT,fa.STICKY_BOTTOM_FULL_WIDTH]}),ne({section:H,className:Z,style:te,children:[fa.BOTTOM_LEFT,fa.BOTTOM_CENTER,fa.BOTTOM_RIGHT,fa.BOTTOM_FULL_WIDTH]}))}),Cd=(0,n.forwardRef)((e,t)=>{const{children:i,eFocusableElement:s,onTabKeyDown:r,gridCtrl:o,forceFocusOutWhenTabGuardsAreEmpty:a}=e,{context:l}=(0,n.useContext)(Ku),c=(0,n.useRef)(null),h=(0,n.useRef)(null),u=(0,n.useRef)(),d=e=>{const t=null==e?void 0:parseInt(e,10).toString();[c,h].forEach(e=>{var i,n;void 0===t?null==(i=e.current)||i.removeAttribute("tabindex"):null==(n=e.current)||n.setAttribute("tabindex",t)})};(0,n.useImperativeHandle)(t,()=>({forceFocusOutOfContainer(e){var t;null==(t=u.current)||t.forceFocusOutOfContainer(e)}}));const p=(0,n.useCallback)(()=>{if(!c.current&&!h.current)return l.destroyBean(u.current),void(u.current=null);if(c.current&&h.current){const e={setTabIndex:d};u.current=l.createBean(new hl({comp:e,eTopGuard:c.current,eBottomGuard:h.current,eFocusableElement:s,onTabKeyDown:r,forceFocusOutWhenTabGuardsAreEmpty:a,focusInnerElement:e=>o.focusInnerElement(e)}))}},[]),g=(0,n.useCallback)(e=>{c.current=e,p()},[p]),f=(0,n.useCallback)(e=>{h.current=e,p()},[p]),m=e=>{const t="top"===e?cl.TAB_GUARD_TOP:cl.TAB_GUARD_BOTTOM;return n.createElement("div",{className:`${cl.TAB_GUARD} ${t}`,role:"presentation",ref:"top"===e?g:f})};return n.createElement(n.Fragment,null,m("top"),i,m("bottom"))}),wd=(0,n.memo)(Cd),Sd=(0,n.memo)(({context:e})=>{const[t,i]=(0,n.useState)(""),[s,r]=(0,n.useState)(""),[o,a]=(0,n.useState)(""),[l,c]=(0,n.useState)(null),[h,u]=(0,n.useState)(null),[d,p]=(0,n.useState)(!1),[g,f]=(0,n.useState)(),m=(0,n.useRef)(null),y=(0,n.useRef)(null),v=(0,n.useRef)(),[b,C]=(0,n.useState)(null),w=(0,n.useRef)(()=>{}),S=(0,n.useCallback)(()=>{},[]),x=(0,n.useMemo)(()=>e.isDestroyed()?null:e.getBean("beans"),[e]);dd(" AG Grid ",y);const E=(0,n.useCallback)(t=>{if(y.current=t,!y.current)return e.destroyBean(m.current),void(m.current=null);if(e.isDestroyed())return;m.current=e.createBean(new fc);const n=m.current;w.current=n.focusInnerElement.bind(n);const s={destroyGridUi:()=>{},setRtlClass:i,forceFocusOutOfContainer:e=>{var t;null==(t=v.current)||t.forceFocusOutOfContainer(e)},updateLayoutClasses:a,getFocusableContainers:()=>{var e,t;const i=[],n=null==(e=y.current)?void 0:e.querySelector(".ag-root"),s=null==(t=y.current)?void 0:t.querySelector(".ag-side-bar:not(.ag-hidden)");return n&&i.push(n),s&&i.push(s),i},setCursor:c,setUserSelect:u};n.setComp(s,y.current,y.current),p(!0)},[]);(0,n.useEffect)(()=>{if(!(g&&x&&m.current&&b&&y.current))return;const t=m.current,i=[],{agStackComponentsRegistry:n}=x,s=n.getComponentClass("AG-GRID-HEADER-DROP-ZONES"),r=n.getComponentClass("AG-SIDE-BAR"),o=n.getComponentClass("AG-STATUS-BAR"),a=n.getComponentClass("AG-WATERMARK"),l=n.getComponentClass("AG-PAGINATION"),c=[],h=y.current;if(t.showDropZones()&&s){const t=e.createBean(new s),n=t.getGui();h.insertAdjacentElement("afterbegin",n),c.push(n),i.push(t)}if(t.showSideBar()&&r){const t=e.createBean(new r),n=t.getGui(),s=b.querySelector(".ag-tab-guard-bottom");s&&(s.insertAdjacentElement("beforebegin",n),c.push(n)),i.push(t)}if(t.showStatusBar()&&o){const t=e.createBean(new o),n=t.getGui();h.insertAdjacentElement("beforeend",n),c.push(n),i.push(t)}if(l){const t=e.createBean(new l),n=t.getGui();h.insertAdjacentElement("beforeend",n),c.push(n),i.push(t)}if(t.showWatermark()&&a){const t=e.createBean(new a),n=t.getGui();h.insertAdjacentElement("beforeend",n),c.push(n),i.push(t)}return()=>{e.destroyBeans(i),c.forEach(e=>{e.parentElement&&e.parentElement.removeChild(e)})}},[g,b,x]);const A=(0,n.useMemo)(()=>Yu("ag-root-wrapper",t,s,o),[t,s,o]),M=(0,n.useMemo)(()=>Yu("ag-root-wrapper-body","ag-focus-managed",o),[o]),T=(0,n.useMemo)(()=>({userSelect:null!=h?h:"",WebkitUserSelect:null!=h?h:"",cursor:null!=l?l:""}),[h,l]),D=(0,n.useCallback)(e=>{v.current=e,f(null!==e)},[]);return n.createElement("div",{ref:E,className:A,style:T,role:"presentation"},n.createElement("div",{className:M,ref:C,role:"presentation"},d&&b&&x&&n.createElement(Ku.Provider,{value:x},n.createElement(wd,{ref:D,eFocusableElement:b,onTabKeyDown:S,gridCtrl:m.current,forceFocusOutWhenTabGuardsAreEmpty:!0},n.createElement(bd,null)))))}),xd=e=>{var t,i;const s=(0,n.useRef)(),r=(0,n.useRef)(null),o=(0,n.useRef)(null),a=(0,n.useRef)([]),l=(0,n.useRef)([]),c=(0,n.useRef)(e),h=(0,n.useRef)(!1),[u,d]=(0,n.useState)(void 0),[,p]=(0,n.useState)(0),g=(0,n.useCallback)(t=>{if(r.current=t,!r.current)return a.current.forEach(e=>e()),void(a.current.length=0);const i=e.modules||[];o.current||(o.current=new $u(()=>p(e=>e+1),e.componentWrappingElement,e.maxComponentCreationTimeMs),a.current.push(()=>{var e;null==(e=o.current)||e.destroy(),o.current=null}));const n=Lt.combineAttributesAndGridOptions(e.gridOptions,e),c={providedBeanInstances:{frameworkComponentWrapper:new Ed(o.current,!!n.reactiveCustomComponents)},modules:i,frameworkOverrides:new Md},u=new Ch;s.current=u.create(r.current,n,t=>{d(t),a.current.push(()=>{t.destroy()}),t.getBean(jc.NAME).whenReady(()=>{if(t.isDestroyed())return;const i=s.current;i&&e.setGridApi&&e.setGridApi(i,new hc(i))})},e=>{e.getBean(jc.NAME).whenReady(()=>{l.current.forEach(e=>e()),l.current.length=0,h.current=!0})},c)},[]),f=(0,n.useMemo)(()=>Mu({height:"100%"},e.containerStyle||{}),[e.containerStyle]),m=(0,n.useCallback)(e=>{h.current?e():l.current.push(e)},[]);return(0,n.useEffect)(()=>{const t=function(e,t){const i={};return Object.keys(t).forEach(n=>{const s=t[n];e[n]!==s&&(i[n]=s)}),i}(c.current,e);c.current=e,m(()=>{s.current&&Lt.processOnChange(t,s.current)})},[e]),n.createElement("div",{style:f,className:e.className,ref:g},u&&!u.isDestroyed()?n.createElement(Sd,{context:u}):null,null!=(i=null==(t=o.current)?void 0:t.getPortals())?i:null)},Ed=class extends wh{constructor(e,t){super(),this.parent=e,this.reactiveCustomComponents=t}createWrapper(e,t){if(this.reactiveCustomComponents){const i=(e=>{switch(e){case"filter":return Ou;case"floatingFilterComponent":return Bu;case"dateComponent":return Nu;case"loadingOverlayComponent":return Vu;case"noRowsOverlayComponent":return Uu;case"statusPanel":return zu;case"toolPanel":return Wu;case"menuItem":return Hu}})(t.propertyName);if(i)return new i(e,this.parent,t)}else switch(t.propertyName){case"filter":case"floatingFilterComponent":case"dateComponent":case"loadingOverlayComponent":case"noRowsOverlayComponent":case"statusPanel":case"toolPanel":case"menuItem":ad()}const i=!t.cellRenderer&&"toolPanel"!==t.propertyName;return new Pu(e,this.parent,t,i)}},Ad=(0,n.forwardRef)((e,t)=>{const{ctrlsFactory:i,context:s,gos:r,resizeObserverService:o,clientSideRowModel:a,serverSideRowModel:l}=(0,n.useContext)(Ku),[c,h]=(0,n.useState)(()=>new qu),[u,d]=(0,n.useState)(()=>new qu),[p,g]=(0,n.useState)(),[f,m]=(0,n.useState)(),y=(0,n.useRef)(),v=(0,n.useRef)(null),b=(0,n.useRef)(),C=(0,n.useMemo)(()=>re.__getGridRegisteredModules(e.api.getGridId()),[e]),w=(0,n.useMemo)(()=>c.toString()+" ag-details-row",[c]),S=(0,n.useMemo)(()=>u.toString()+" ag-details-grid",[u]);t&&(0,n.useImperativeHandle)(t,()=>({refresh(){var e,t;return null!=(t=null==(e=y.current)?void 0:e.refresh())&&t}})),e.template&&cs.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 x=(0,n.useCallback)(t=>{if(v.current=t,!v.current)return s.destroyBean(y.current),void(b.current&&b.current());const n={addOrRemoveCssClass:(e,t)=>h(i=>i.setClass(e,t)),addOrRemoveDetailGridCssClass:(e,t)=>d(i=>i.setClass(e,t)),setDetailGrid:e=>g(e),setRowData:e=>m(e),getGui:()=>v.current},c=i.getInstance("detailCellRenderer");if(c&&(s.createBean(c),c.init(n,e),y.current=c,r.get("detailRowAutoHeight"))){const t=()=>{if(null==v.current)return;const t=v.current.clientHeight;null!=t&&t>0&&setTimeout(()=>{e.node.setRowHeight(t),a?a.onRowHeightChanged():l&&l.onRowHeightChanged()},0)};b.current=o.observeResize(v.current,t),t()}},[]),E=(0,n.useCallback)((e,t)=>{var i;null==(i=y.current)||i.registerDetailWithMaster(e,t)},[]);return n.createElement("div",{className:w,ref:x},p&&n.createElement(xd,Tu(Mu({className:S},p),{modules:C,rowData:f,setGridApi:E})))}),Md=class extends oc{constructor(){super("react"),this.frameworkComponents={agGroupCellRenderer:sd,agGroupRowRenderer:sd,agDetailCellRenderer:Ad},this.wrapIncoming=(e,t)=>{return"ensureVisible"===t?(i=e,Qu||setTimeout(()=>Qu=!1,0),Qu=!0,i()):e();var i},this.renderingEngine="react"}frameworkComponent(e){return this.frameworkComponents[e]}isFrameworkComponent(e){if(!e)return!1;const t=e.prototype;return!(t&&"getGui"in t)}},Td=class extends n.Component{constructor(){super(...arguments),this.apiListeners=[],this.setGridApi=(e,t)=>{this.api=e,this.columnApi=t,this.apiListeners.forEach(t=>t(e))}}registerApiListener(e){this.apiListeners.push(e)}componentWillUnmount(){this.apiListeners.length=0}render(){return n.createElement(xd,Tu(Mu({},this.props),{setGridApi:this.setGridApi}))}}},80183(e,t,i){"use strict";i.d(t,{A:()=>St});var n={};function s(e,t){return function(){return e.apply(t,arguments)}}i.r(n),i.d(n,{hasBrowserEnv:()=>Ae,hasStandardBrowserEnv:()=>Te,hasStandardBrowserWebWorkerEnv:()=>De,navigator:()=>Me,origin:()=>Ie});var r=i(85409);const{toString:o}=Object.prototype,{getPrototypeOf:a}=Object,{iterator:l,toStringTag:c}=Symbol,h=(u=Object.create(null),e=>{const t=o.call(e);return u[t]||(u[t]=t.slice(8,-1).toLowerCase())});var u;const d=e=>(e=e.toLowerCase(),t=>h(t)===e),p=e=>t=>typeof t===e,{isArray:g}=Array,f=p("undefined");function m(e){return null!==e&&!f(e)&&null!==e.constructor&&!f(e.constructor)&&b(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const y=d("ArrayBuffer"),v=p("string"),b=p("function"),C=p("number"),w=e=>null!==e&&"object"==typeof e,S=e=>{if("object"!==h(e))return!1;const t=a(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||c in e||l in e)},x=d("Date"),E=d("File"),A=d("Blob"),M=d("FileList"),T="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:{},D=void 0!==T.FormData?T.FormData:void 0,I=d("URLSearchParams"),[R,k,P,_]=["ReadableStream","Request","Response","Headers"].map(d);function L(e,t,{allOwnKeys:i=!1}={}){if(null==e)return;let n,s;if("object"!=typeof e&&(e=[e]),g(e))for(n=0,s=e.length;n<s;n++)t.call(null,e[n],n,e);else{if(m(e))return;const s=i?Object.getOwnPropertyNames(e):Object.keys(e),r=s.length;let o;for(n=0;n<r;n++)o=s[n],t.call(null,e[o],o,e)}}function N(e,t){if(m(e))return null;t=t.toLowerCase();const i=Object.keys(e);let n,s=i.length;for(;s-- >0;)if(n=i[s],t===n.toLowerCase())return n;return null}const O="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:globalThis,F=e=>!f(e)&&e!==O,G=(B="undefined"!=typeof Uint8Array&&a(Uint8Array),e=>B&&e instanceof B);var B;const V=d("HTMLFormElement"),H=(({hasOwnProperty:e})=>(t,i)=>e.call(t,i))(Object.prototype),U=d("RegExp"),z=(e,t)=>{const i=Object.getOwnPropertyDescriptors(e),n={};L(i,(i,s)=>{let r;!1!==(r=t(i,s,e))&&(n[s]=r||i)}),Object.defineProperties(e,n)},W=d("AsyncFunction"),j=($="function"==typeof setImmediate,K=b(O.postMessage),$?setImmediate:K?(Y=`axios@${Math.random()}`,q=[],O.addEventListener("message",({source:e,data:t})=>{e===O&&t===Y&&q.length&&q.shift()()},!1),e=>{q.push(e),O.postMessage(Y,"*")}):e=>setTimeout(e));var $,K,Y,q;const X="undefined"!=typeof queueMicrotask?queueMicrotask.bind(O):void 0!==r&&r.nextTick||j,Z={isArray:g,isArrayBuffer:y,isBuffer:m,isFormData:e=>{if(!e)return!1;if(D&&e instanceof D)return!0;const t=a(e);if(!t||t===Object.prototype)return!1;if(!b(e.append))return!1;const i=h(e);return"formdata"===i||"object"===i&&b(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&y(e.buffer),t},isString:v,isNumber:C,isBoolean:e=>!0===e||!1===e,isObject:w,isPlainObject:S,isEmptyObject:e=>{if(!w(e)||m(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:R,isRequest:k,isResponse:P,isHeaders:_,isUndefined:f,isDate:x,isFile:E,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:A,isRegExp:U,isFunction:b,isStream:e=>w(e)&&b(e.pipe),isURLSearchParams:I,isTypedArray:G,isFileList:M,forEach:L,merge:function e(...t){const{caseless:i,skipUndefined:n}=F(this)&&this||{},s={},r=(t,r)=>{if("__proto__"===r||"constructor"===r||"prototype"===r)return;const o=i&&N(s,r)||r,a=H(s,o)?s[o]:void 0;S(a)&&S(t)?s[o]=e(a,t):S(t)?s[o]=e({},t):g(t)?s[o]=t.slice():n&&f(t)||(s[o]=t)};for(let e=0,i=t.length;e<i;e++)t[e]&&L(t[e],r);return s},extend:(e,t,i,{allOwnKeys:n}={})=>(L(t,(t,n)=>{i&&b(t)?Object.defineProperty(e,n,{__proto__:null,value:s(t,i),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,n,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,i,n)=>{e.prototype=Object.create(t.prototype,n),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),i&&Object.assign(e.prototype,i)},toFlatObject:(e,t,i,n)=>{let s,r,o;const l={};if(t=t||{},null==e)return t;do{for(s=Object.getOwnPropertyNames(e),r=s.length;r-- >0;)o=s[r],n&&!n(o,e,t)||l[o]||(t[o]=e[o],l[o]=!0);e=!1!==i&&a(e)}while(e&&(!i||i(e,t))&&e!==Object.prototype);return t},kindOf:h,kindOfTest:d,endsWith:(e,t,i)=>{e=String(e),(void 0===i||i>e.length)&&(i=e.length),i-=t.length;const n=e.indexOf(t,i);return-1!==n&&n===i},toArray:e=>{if(!e)return null;if(g(e))return e;let t=e.length;if(!C(t))return null;const i=new Array(t);for(;t-- >0;)i[t]=e[t];return i},forEachEntry:(e,t)=>{const i=(e&&e[l]).call(e);let n;for(;(n=i.next())&&!n.done;){const i=n.value;t.call(e,i[0],i[1])}},matchAll:(e,t)=>{let i;const n=[];for(;null!==(i=e.exec(t));)n.push(i);return n},isHTMLForm:V,hasOwnProperty:H,hasOwnProp:H,reduceDescriptors:z,freezeMethods:e=>{z(e,(t,i)=>{if(b(e)&&["arguments","caller","callee"].includes(i))return!1;const n=e[i];b(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")}))})},toObjectSet:(e,t)=>{const i={},n=e=>{e.forEach(e=>{i[e]=!0})};return g(e)?n(e):n(String(e).split(t)),i},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,i){return t.toUpperCase()+i}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:N,global:O,isContextDefined:F,isSpecCompliantForm:function(e){return!!(e&&b(e.append)&&"FormData"===e[c]&&e[l])},toJSONObject:e=>{const t=new WeakSet,i=e=>{if(w(e)){if(t.has(e))return;if(m(e))return e;if(!("toJSON"in e)){t.add(e);const n=g(e)?[]:{};return L(e,(e,t)=>{const s=i(e);!f(s)&&(n[t]=s)}),t.delete(e),n}}return e};return i(e)},isAsyncFn:W,isThenable:e=>e&&(w(e)||b(e))&&b(e.then)&&b(e.catch),setImmediate:j,asap:X,isIterable:e=>null!=e&&b(e[l])},Q=Z.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),J=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),ee=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function te(e,t){return Z.isArray(e)?e.map(e=>te(e,t)):function(e){let t=0,i=e.length;for(;t<i;){const i=e.charCodeAt(t);if(9!==i&&32!==i)break;t+=1}for(;i>t;){const t=e.charCodeAt(i-1);if(9!==t&&32!==t)break;i-=1}return 0===t&&i===e.length?e:e.slice(t,i)}(String(e).replace(t,""))}function ie(e){const t=Object.create(null);return Z.forEach(e.toJSON(),(e,i)=>{t[i]=(e=>te(e,ee))(e)}),t}const ne=Symbol("internals");function se(e){return e&&String(e).trim().toLowerCase()}function re(e){return!1===e||null==e?e:Z.isArray(e)?e.map(re):(e=>te(e,J))(String(e))}function oe(e,t,i,n,s){return Z.isFunction(n)?n.call(this,t,i):(s&&(t=i),Z.isString(t)?Z.isString(n)?-1!==t.indexOf(n):Z.isRegExp(n)?n.test(t):void 0:void 0)}class ae{constructor(e){e&&this.set(e)}set(e,t,i){const n=this;function s(e,t,i){const s=se(t);if(!s)throw new Error("header name must be a non-empty string");const r=Z.findKey(n,s);(!r||void 0===n[r]||!0===i||void 0===i&&!1!==n[r])&&(n[r||t]=re(e))}const r=(e,t)=>Z.forEach(e,(e,i)=>s(e,i,t));if(Z.isPlainObject(e)||e instanceof this.constructor)r(e,t);else if(Z.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))r((e=>{const t={};let i,n,s;return e&&e.split("\n").forEach(function(e){s=e.indexOf(":"),i=e.substring(0,s).trim().toLowerCase(),n=e.substring(s+1).trim(),!i||t[i]&&Q[i]||("set-cookie"===i?t[i]?t[i].push(n):t[i]=[n]:t[i]=t[i]?t[i]+", "+n:n)}),t})(e),t);else if(Z.isObject(e)&&Z.isIterable(e)){let i,n,s={};for(const t of e){if(!Z.isArray(t))throw TypeError("Object iterator must return a key-value pair");s[n=t[0]]=(i=s[n])?Z.isArray(i)?[...i,t[1]]:[i,t[1]]:t[1]}r(s,t)}else null!=e&&s(t,e,i);return this}get(e,t){if(e=se(e)){const i=Z.findKey(this,e);if(i){const e=this[i];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=i.exec(e);)t[n[1]]=n[2];return t}(e);if(Z.isFunction(t))return t.call(this,e,i);if(Z.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=se(e)){const i=Z.findKey(this,e);return!(!i||void 0===this[i]||t&&!oe(0,this[i],i,t))}return!1}delete(e,t){const i=this;let n=!1;function s(e){if(e=se(e)){const s=Z.findKey(i,e);!s||t&&!oe(0,i[s],s,t)||(delete i[s],n=!0)}}return Z.isArray(e)?e.forEach(s):s(e),n}clear(e){const t=Object.keys(this);let i=t.length,n=!1;for(;i--;){const s=t[i];e&&!oe(0,this[s],s,e,!0)||(delete this[s],n=!0)}return n}normalize(e){const t=this,i={};return Z.forEach(this,(n,s)=>{const r=Z.findKey(i,s);if(r)return t[r]=re(n),void delete t[s];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,i)=>t.toUpperCase()+i)}(s):String(s).trim();o!==s&&delete t[s],t[o]=re(n),i[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Z.forEach(this,(i,n)=>{null!=i&&!1!==i&&(t[n]=e&&Z.isArray(i)?i.join(", "):i)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const i=new this(e);return t.forEach(e=>i.set(e)),i}static accessor(e){const t=(this[ne]=this[ne]={accessors:{}}).accessors,i=this.prototype;function n(e){const n=se(e);t[n]||(function(e,t){const i=Z.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+i,{__proto__:null,value:function(e,i,s){return this[n].call(this,t,e,i,s)},configurable:!0})})}(i,e),t[n]=!0)}return Z.isArray(e)?e.forEach(n):n(e),this}}ae.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Z.reduceDescriptors(ae.prototype,({value:e},t)=>{let i=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[i]=e}}}),Z.freezeMethods(ae);const le=ae;class ce extends Error{static from(e,t,i,n,s,r){const o=new ce(e.message,t||e.code,i,n,s);return o.cause=e,o.name=e.name,null!=e.status&&null==o.status&&(o.status=e.status),r&&Object.assign(o,r),o}constructor(e,t,i,n,s){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),i&&(this.config=i),n&&(this.request=n),s&&(this.response=s,this.status=s.status)}toJSON(){const e=this.config,t=e&&Z.hasOwnProp(e,"redact")?e.redact:void 0,i=Z.isArray(t)&&t.length>0?function(e,t){const i=new Set(t.map(e=>String(e).toLowerCase())),n=[],s=e=>{if(null===e||"object"!=typeof e)return e;if(Z.isBuffer(e))return e;if(-1!==n.indexOf(e))return;let t;if(e instanceof le&&(e=e.toJSON()),n.push(e),Z.isArray(e))t=[],e.forEach((e,i)=>{const n=s(e);Z.isUndefined(n)||(t[i]=n)});else{if(!Z.isPlainObject(e)&&function(e){if(Z.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(Z.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(e))return n.pop(),e;t=Object.create(null);for(const[n,r]of Object.entries(e)){const e=i.has(n.toLowerCase())?"[REDACTED ****]":s(r);Z.isUndefined(e)||(t[n]=e)}}return n.pop(),t};return s(e)}(e,t):Z.toJSONObject(e);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:i,code:this.code,status:this.status}}}ce.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",ce.ERR_BAD_OPTION="ERR_BAD_OPTION",ce.ECONNABORTED="ECONNABORTED",ce.ETIMEDOUT="ETIMEDOUT",ce.ECONNREFUSED="ECONNREFUSED",ce.ERR_NETWORK="ERR_NETWORK",ce.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",ce.ERR_DEPRECATED="ERR_DEPRECATED",ce.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",ce.ERR_BAD_REQUEST="ERR_BAD_REQUEST",ce.ERR_CANCELED="ERR_CANCELED",ce.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",ce.ERR_INVALID_URL="ERR_INVALID_URL",ce.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const he=ce;function ue(e){return Z.isPlainObject(e)||Z.isArray(e)}function de(e){return Z.endsWith(e,"[]")?e.slice(0,-2):e}function pe(e,t,i){return e?e.concat(t).map(function(e,t){return e=de(e),!i&&t?"["+e+"]":e}).join(i?".":""):t}const ge=Z.toFlatObject(Z,{},null,function(e){return/^is[A-Z]/.test(e)}),fe=function(e,t,i){if(!Z.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(i=Z.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Z.isUndefined(t[e])})).metaTokens,s=i.visitor||u,r=i.dots,o=i.indexes,a=i.Blob||"undefined"!=typeof Blob&&Blob,l=void 0===i.maxDepth?100:i.maxDepth,c=a&&Z.isSpecCompliantForm(t);if(!Z.isFunction(s))throw new TypeError("visitor must be a function");function h(e){if(null===e)return"";if(Z.isDate(e))return e.toISOString();if(Z.isBoolean(e))return e.toString();if(!c&&Z.isBlob(e))throw new he("Blob is not supported. Use a Buffer instead.");return Z.isArrayBuffer(e)||Z.isTypedArray(e)?c&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,i,s){let a=e;if(Z.isReactNative(t)&&Z.isReactNativeBlob(e))return t.append(pe(s,i,r),h(e)),!1;if(e&&!s&&"object"==typeof e)if(Z.endsWith(i,"{}"))i=n?i:i.slice(0,-2),e=JSON.stringify(e);else if(Z.isArray(e)&&function(e){return Z.isArray(e)&&!e.some(ue)}(e)||(Z.isFileList(e)||Z.endsWith(i,"[]"))&&(a=Z.toArray(e)))return i=de(i),a.forEach(function(e,n){!Z.isUndefined(e)&&null!==e&&t.append(!0===o?pe([i],n,r):null===o?i:i+"[]",h(e))}),!1;return!!ue(e)||(t.append(pe(s,i,r),h(e)),!1)}const d=[],p=Object.assign(ge,{defaultVisitor:u,convertValue:h,isVisitable:ue});if(!Z.isObject(e))throw new TypeError("data must be an object");return function e(i,n,r=0){if(!Z.isUndefined(i)){if(r>l)throw new he("Object is too deeply nested ("+r+" levels). Max depth: "+l,he.ERR_FORM_DATA_DEPTH_EXCEEDED);if(-1!==d.indexOf(i))throw Error("Circular reference detected in "+n.join("."));d.push(i),Z.forEach(i,function(i,o){!0===(!(Z.isUndefined(i)||null===i)&&s.call(t,i,Z.isString(o)?o.trim():o,n,p))&&e(i,n?n.concat(o):[o],r+1)}),d.pop()}}(e),t};function me(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function ye(e,t){this._pairs=[],e&&fe(e,this,t)}const ve=ye.prototype;ve.append=function(e,t){this._pairs.push([e,t])},ve.toString=function(e){const t=e?function(t){return e.call(this,t,me)}:me;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const be=ye;function Ce(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function we(e,t,i){if(!t)return e;const n=i&&i.encode||Ce,s=Z.isFunction(i)?{serialize:i}:i,r=s&&s.serialize;let o;if(o=r?r(t,s):Z.isURLSearchParams(t)?t.toString():new be(t,s).toString(n),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}const Se=class{constructor(){this.handlers=[]}use(e,t,i){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!i&&i.synchronous,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Z.forEach(this.handlers,function(t){null!==t&&e(t)})}},xe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},Ee={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:be,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Ae="undefined"!=typeof window&&"undefined"!=typeof document,Me="object"==typeof navigator&&navigator||void 0,Te=Ae&&(!Me||["ReactNative","NativeScript","NS"].indexOf(Me.product)<0),De="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Ie=Ae&&window.location.href||"http://localhost",Re={...n,...Ee},ke=function(e){function t(e,i,n,s){let r=e[s++];if("__proto__"===r)return!0;const o=Number.isFinite(+r),a=s>=e.length;return r=!r&&Z.isArray(n)?n.length:r,a?(Z.hasOwnProp(n,r)?n[r]=Z.isArray(n[r])?n[r].concat(i):[n[r],i]:n[r]=i,!o):(Z.hasOwnProp(n,r)&&Z.isObject(n[r])||(n[r]=[]),t(e,i,n[r],s)&&Z.isArray(n[r])&&(n[r]=function(e){const t={},i=Object.keys(e);let n;const s=i.length;let r;for(n=0;n<s;n++)r=i[n],t[r]=e[r];return t}(n[r])),!o)}if(Z.isFormData(e)&&Z.isFunction(e.entries)){const i={};return Z.forEachEntry(e,(e,n)=>{t(function(e){return Z.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),n,i,0)}),i}return null},Pe=(e,t)=>null!=e&&Z.hasOwnProp(e,t)?e[t]:void 0,_e={transitional:xe,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const i=t.getContentType()||"",n=i.indexOf("application/json")>-1,s=Z.isObject(e);if(s&&Z.isHTMLForm(e)&&(e=new FormData(e)),Z.isFormData(e))return n?JSON.stringify(ke(e)):e;if(Z.isArrayBuffer(e)||Z.isBuffer(e)||Z.isStream(e)||Z.isFile(e)||Z.isBlob(e)||Z.isReadableStream(e))return e;if(Z.isArrayBufferView(e))return e.buffer;if(Z.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let r;if(s){const t=Pe(this,"formSerializer");if(i.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return fe(e,new Re.classes.URLSearchParams,{visitor:function(e,t,i,n){return Re.isNode&&Z.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...t})}(e,t).toString();if((r=Z.isFileList(e))||i.indexOf("multipart/form-data")>-1){const i=Pe(this,"env"),n=i&&i.FormData;return fe(r?{"files[]":e}:e,n&&new n,t)}}return s||n?(t.setContentType("application/json",!1),function(e){if(Z.isString(e))try{return(0,JSON.parse)(e),Z.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=Pe(this,"transitional")||_e.transitional,i=t&&t.forcedJSONParsing,n=Pe(this,"responseType"),s="json"===n;if(Z.isResponse(e)||Z.isReadableStream(e))return e;if(e&&Z.isString(e)&&(i&&!n||s)){const i=!(t&&t.silentJSONParsing)&&s;try{return JSON.parse(e,Pe(this,"parseReviver"))}catch(e){if(i){if("SyntaxError"===e.name)throw he.from(e,he.ERR_BAD_RESPONSE,this,null,Pe(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Re.classes.FormData,Blob:Re.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Z.forEach(["delete","get","head","post","put","patch","query"],e=>{_e.headers[e]={}});const Le=_e;function Ne(e,t){const i=this||Le,n=t||i,s=le.from(n.headers);let r=n.data;return Z.forEach(e,function(e){r=e.call(i,r,s.normalize(),t?t.status:void 0)}),s.normalize(),r}function Oe(e){return!(!e||!e.__CANCEL__)}const Fe=class extends he{constructor(e,t,i){super(null==e?"canceled":e,he.ERR_CANCELED,t,i),this.name="CanceledError",this.__CANCEL__=!0}};function Ge(e,t,i){const n=i.config.validateStatus;i.status&&n&&!n(i.status)?t(new he("Request failed with status code "+i.status,i.status>=400&&i.status<500?he.ERR_BAD_REQUEST:he.ERR_BAD_RESPONSE,i.config,i.request,i)):e(i)}const Be=(e,t,i=3)=>{let n=0;const s=function(e,t){e=e||10;const i=new Array(e),n=new Array(e);let s,r=0,o=0;return t=void 0!==t?t:1e3,function(a){const l=Date.now(),c=n[o];s||(s=l),i[r]=a,n[r]=l;let h=o,u=0;for(;h!==r;)u+=i[h++],h%=e;if(r=(r+1)%e,r===o&&(o=(o+1)%e),l-s<t)return;const d=c&&l-c;return d?Math.round(1e3*u/d):void 0}}(50,250);return function(e,t){let i,n,s=0,r=1e3/t;const o=(t,r=Date.now())=>{s=r,i=null,n&&(clearTimeout(n),n=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-s;a>=r?o(e,t):(i=e,n||(n=setTimeout(()=>{n=null,o(i)},r-a)))},()=>i&&o(i)]}(i=>{if(!i||"number"!=typeof i.loaded)return;const r=i.loaded,o=i.lengthComputable?i.total:void 0,a=null!=o?Math.min(r,o):r,l=Math.max(0,a-n),c=s(l);n=Math.max(n,a),e({loaded:a,total:o,progress:o?a/o:void 0,bytes:l,rate:c||void 0,estimated:c&&o?(o-a)/c:void 0,event:i,lengthComputable:null!=o,[t?"download":"upload"]:!0})},i)},Ve=(e,t)=>{const i=null!=e;return[n=>t[0]({lengthComputable:i,total:e,loaded:n}),t[1]]},He=e=>(...t)=>Z.asap(()=>e(...t)),Ue=Re.hasStandardBrowserEnv?((e,t)=>i=>(i=new URL(i,Re.origin),e.protocol===i.protocol&&e.host===i.host&&(t||e.port===i.port)))(new URL(Re.origin),Re.navigator&&/(msie|trident)/i.test(Re.navigator.userAgent)):()=>!0,ze=Re.hasStandardBrowserEnv?{write(e,t,i,n,s,r,o){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];Z.isNumber(i)&&a.push(`expires=${new Date(i).toUTCString()}`),Z.isString(n)&&a.push(`path=${n}`),Z.isString(s)&&a.push(`domain=${s}`),!0===r&&a.push("secure"),Z.isString(o)&&a.push(`SameSite=${o}`),document.cookie=a.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.split(";");for(let i=0;i<t.length;i++){const n=t[i].replace(/^\s+/,""),s=n.indexOf("=");if(-1!==s&&n.slice(0,s)===e)return decodeURIComponent(n.slice(s+1))}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function We(e,t,i){let n=!("string"==typeof(s=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(s));var s;return e&&(n||!1===i)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const je=e=>e instanceof le?{...e}:e;function $e(e,t){t=t||{};const i=Object.create(null);function n(e,t,i,n){return Z.isPlainObject(e)&&Z.isPlainObject(t)?Z.merge.call({caseless:n},e,t):Z.isPlainObject(t)?Z.merge({},t):Z.isArray(t)?t.slice():t}function s(e,t,i,s){return Z.isUndefined(t)?Z.isUndefined(e)?void 0:n(void 0,e,0,s):n(e,t,0,s)}function r(e,t){if(!Z.isUndefined(t))return n(void 0,t)}function o(e,t){return Z.isUndefined(t)?Z.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function a(i,s,r){return Z.hasOwnProp(t,r)?n(i,s):Z.hasOwnProp(e,r)?n(void 0,i):void 0}Object.defineProperty(i,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});const l={url:r,method:r,data:r,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,allowedSocketPaths:o,responseEncoding:o,validateStatus:a,headers:(e,t,i)=>s(je(e),je(t),0,!0)};return Z.forEach(Object.keys({...e,...t}),function(n){if("__proto__"===n||"constructor"===n||"prototype"===n)return;const r=Z.hasOwnProp(l,n)?l[n]:s,o=r(Z.hasOwnProp(e,n)?e[n]:void 0,Z.hasOwnProp(t,n)?t[n]:void 0,n);Z.isUndefined(o)&&r!==a||(i[n]=o)}),i}const Ke=["content-type","content-length"],Ye=e=>{const t=$e({},e),i=e=>Z.hasOwnProp(t,e)?t[e]:void 0,n=i("data");let s=i("withXSRFToken");const r=i("xsrfHeaderName"),o=i("xsrfCookieName");let a=i("headers");const l=i("auth"),c=i("baseURL"),h=i("allowAbsoluteUrls"),u=i("url");var d;if(t.headers=a=le.from(a),t.url=we(We(c,u,h),e.params,e.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?(d=l.password,encodeURIComponent(d).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16)))):""))),Z.isFormData(n)&&(Re.hasStandardBrowserEnv||Re.hasStandardBrowserWebWorkerEnv?a.setContentType(void 0):Z.isFunction(n.getHeaders)&&function(e,t,i){"content-only"===i?Object.entries(t).forEach(([t,i])=>{Ke.includes(t.toLowerCase())&&e.set(t,i)}):e.set(t)}(a,n.getHeaders(),i("formDataHeaderPolicy"))),Re.hasStandardBrowserEnv&&(Z.isFunction(s)&&(s=s(t)),!0===s||null==s&&Ue(t.url))){const e=r&&o&&ze.read(o);e&&a.set(r,e)}return t},qe="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,i){const n=Ye(e);let s=n.data;const r=le.from(n.headers).normalize();let o,a,l,c,h,{responseType:u,onUploadProgress:d,onDownloadProgress:p}=n;function g(){c&&c(),h&&h(),n.cancelToken&&n.cancelToken.unsubscribe(o),n.signal&&n.signal.removeEventListener("abort",o)}let f=new XMLHttpRequest;function m(){if(!f)return;const n=le.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders());Ge(function(e){t(e),g()},function(e){i(e),g()},{data:u&&"text"!==u&&"json"!==u?f.response:f.responseText,status:f.status,statusText:f.statusText,headers:n,config:e,request:f}),f=null}f.open(n.method.toUpperCase(),n.url,!0),f.timeout=n.timeout,"onloadend"in f?f.onloadend=m:f.onreadystatechange=function(){f&&4===f.readyState&&(0!==f.status||f.responseURL&&f.responseURL.startsWith("file:"))&&setTimeout(m)},f.onabort=function(){f&&(i(new he("Request aborted",he.ECONNABORTED,e,f)),g(),f=null)},f.onerror=function(t){const n=t&&t.message?t.message:"Network Error",s=new he(n,he.ERR_NETWORK,e,f);s.event=t||null,i(s),g(),f=null},f.ontimeout=function(){let t=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const s=n.transitional||xe;n.timeoutErrorMessage&&(t=n.timeoutErrorMessage),i(new he(t,s.clarifyTimeoutError?he.ETIMEDOUT:he.ECONNABORTED,e,f)),g(),f=null},void 0===s&&r.setContentType(null),"setRequestHeader"in f&&Z.forEach(ie(r),function(e,t){f.setRequestHeader(t,e)}),Z.isUndefined(n.withCredentials)||(f.withCredentials=!!n.withCredentials),u&&"json"!==u&&(f.responseType=n.responseType),p&&([l,h]=Be(p,!0),f.addEventListener("progress",l)),d&&f.upload&&([a,c]=Be(d),f.upload.addEventListener("progress",a),f.upload.addEventListener("loadend",c)),(n.cancelToken||n.signal)&&(o=t=>{f&&(i(!t||t.type?new Fe(null,e,f):t),f.abort(),g(),f=null)},n.cancelToken&&n.cancelToken.subscribe(o),n.signal&&(n.signal.aborted?o():n.signal.addEventListener("abort",o)));const y=function(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}(n.url);!y||Re.protocols.includes(y)?f.send(s||null):i(new he("Unsupported protocol "+y+":",he.ERR_BAD_REQUEST,e))})},Xe=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const i=new AbortController;let n=!1;const s=function(e){if(!n){n=!0,o();const t=e instanceof Error?e:this.reason;i.abort(t instanceof he?t:new Fe(t instanceof Error?t.message:t))}};let r=t&&setTimeout(()=>{r=null,s(new he(`timeout of ${t}ms exceeded`,he.ETIMEDOUT))},t);const o=()=>{e&&(r&&clearTimeout(r),r=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(s):e.removeEventListener("abort",s)}),e=null)};e.forEach(e=>e.addEventListener("abort",s));const{signal:a}=i;return a.unsubscribe=()=>Z.asap(o),a},Ze=function*(e,t){let i=e.byteLength;if(!t||i<t)return void(yield e);let n,s=0;for(;s<i;)n=s+t,yield e.slice(s,n),s=n},Qe=(e,t,i,n)=>{const s=async function*(e,t){for await(const i of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:i}=await t.read();if(e)break;yield i}}finally{await t.cancel()}}(e))yield*Ze(i,t)}(e,t);let r,o=0,a=e=>{r||(r=!0,n&&n(e))};return new ReadableStream({async pull(e){try{const{done:t,value:n}=await s.next();if(t)return a(),void e.close();let r=n.byteLength;if(i){let e=o+=r;i(e)}e.enqueue(new Uint8Array(n))}catch(e){throw a(e),e}},cancel:e=>(a(e),s.return())},{highWaterMark:2})},Je="1.16.1",{isFunction:et}=Z,tt=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},it=e=>{const t=void 0!==Z.global&&null!==Z.global?Z.global:globalThis,{ReadableStream:i,TextEncoder:n}=t;e=Z.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:s,Request:r,Response:o}=e,a=s?et(s):"function"==typeof fetch,l=et(r),c=et(o);if(!a)return!1;const h=a&&et(i),u=a&&("function"==typeof n?(d=new n,e=>d.encode(e)):async e=>new Uint8Array(await new r(e).arrayBuffer()));var d;const p=l&&h&&tt(()=>{let e=!1;const t=new r(Re.origin,{body:new i,method:"POST",get duplex(){return e=!0,"half"}}),n=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!n}),g=c&&h&&tt(()=>Z.isReadableStream(new o("").body)),f={stream:g&&(e=>e.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!f[e]&&(f[e]=(t,i)=>{let n=t&&t[e];if(n)return n.call(t);throw new he(`Response type '${e}' is not supported`,he.ERR_NOT_SUPPORT,i)})});const m=async(e,t)=>{const i=Z.toFiniteNumber(e.getContentLength());return null==i?(async e=>{if(null==e)return 0;if(Z.isBlob(e))return e.size;if(Z.isSpecCompliantForm(e)){const t=new r(Re.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Z.isArrayBufferView(e)||Z.isArrayBuffer(e)?e.byteLength:(Z.isURLSearchParams(e)&&(e+=""),Z.isString(e)?(await u(e)).byteLength:void 0)})(t):i};return async e=>{let{url:t,method:i,data:a,signal:c,cancelToken:h,timeout:u,onDownloadProgress:d,onUploadProgress:y,responseType:v,headers:b,withCredentials:C="same-origin",fetchOptions:w,maxContentLength:S,maxBodyLength:x}=Ye(e);const E=Z.isNumber(S)&&S>-1,A=Z.isNumber(x)&&x>-1;let M=s||fetch;v=v?(v+"").toLowerCase():"text";let T=Xe([c,h&&h.toAbortSignal()],u),D=null;const I=T&&T.unsubscribe&&(()=>{T.unsubscribe()});let R;try{if(E&&"string"==typeof t&&t.startsWith("data:")){const i=function(e){if(!e||"string"!=typeof e)return 0;if(!e.startsWith("data:"))return 0;const t=e.indexOf(",");if(t<0)return 0;const i=e.slice(5,t),n=e.slice(t+1);if(/;base64/i.test(i)){let e=n.length;const t=n.length;for(let i=0;i<t;i++)if(37===n.charCodeAt(i)&&i+2<t){const t=n.charCodeAt(i+1),s=n.charCodeAt(i+2);(t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102)&&(s>=48&&s<=57||s>=65&&s<=70||s>=97&&s<=102)&&(e-=2,i+=2)}let i=0,s=t-1;const r=e=>e>=2&&37===n.charCodeAt(e-2)&&51===n.charCodeAt(e-1)&&(68===n.charCodeAt(e)||100===n.charCodeAt(e));s>=0&&(61===n.charCodeAt(s)?(i++,s--):r(s)&&(i++,s-=3)),1===i&&s>=0&&(61===n.charCodeAt(s)||r(s))&&i++;const o=3*Math.floor(e/4)-(i||0);return o>0?o:0}if("undefined"!=typeof Buffer&&"function"==typeof Buffer.byteLength)return Buffer.byteLength(n,"utf8");let s=0;for(let e=0,t=n.length;e<t;e++){const i=n.charCodeAt(e);if(i<128)s+=1;else if(i<2048)s+=2;else if(i>=55296&&i<=56319&&e+1<t){const t=n.charCodeAt(e+1);t>=56320&&t<=57343?(s+=4,e++):s+=3}else s+=3}return s}(t);if(i>S)throw new he("maxContentLength size of "+S+" exceeded",he.ERR_BAD_RESPONSE,e,D)}if(A&&"get"!==i&&"head"!==i){const t=await m(b,a);if("number"==typeof t&&isFinite(t)&&t>x)throw new he("Request body larger than maxBodyLength limit",he.ERR_BAD_REQUEST,e,D)}if(y&&p&&"get"!==i&&"head"!==i&&0!==(R=await m(b,a))){let e,i=new r(t,{method:"POST",body:a,duplex:"half"});if(Z.isFormData(a)&&(e=i.headers.get("content-type"))&&b.setContentType(e),i.body){const[e,t]=Ve(R,Be(He(y)));a=Qe(i.body,65536,e,t)}}Z.isString(C)||(C=C?"include":"omit");const s=l&&"credentials"in r.prototype;if(Z.isFormData(a)){const e=b.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&b.delete("content-type")}b.set("User-Agent","axios/"+Je,!1);const c={...w,signal:T,method:i.toUpperCase(),headers:ie(b.normalize()),body:a,duplex:"half",credentials:s?C:void 0};D=l&&new r(t,c);let h=await(l?M(D,w):M(t,c));if(E){const t=Z.toFiniteNumber(h.headers.get("content-length"));if(null!=t&&t>S)throw new he("maxContentLength size of "+S+" exceeded",he.ERR_BAD_RESPONSE,e,D)}const u=g&&("stream"===v||"response"===v);if(g&&h.body&&(d||E||u&&I)){const t={};["status","statusText","headers"].forEach(e=>{t[e]=h[e]});const i=Z.toFiniteNumber(h.headers.get("content-length")),[n,s]=d&&Ve(i,Be(He(d),!0))||[];let r=0;const a=t=>{if(E&&(r=t,r>S))throw new he("maxContentLength size of "+S+" exceeded",he.ERR_BAD_RESPONSE,e,D);n&&n(t)};h=new o(Qe(h.body,65536,a,()=>{s&&s(),I&&I()}),t)}v=v||"text";let k=await f[Z.findKey(f,v)||"text"](h,e);if(E&&!g&&!u){let t;if(null!=k&&("number"==typeof k.byteLength?t=k.byteLength:"number"==typeof k.size?t=k.size:"string"==typeof k&&(t="function"==typeof n?(new n).encode(k).byteLength:k.length)),"number"==typeof t&&t>S)throw new he("maxContentLength size of "+S+" exceeded",he.ERR_BAD_RESPONSE,e,D)}return!u&&I&&I(),await new Promise((t,i)=>{Ge(t,i,{data:k,headers:le.from(h.headers),status:h.status,statusText:h.statusText,config:e,request:D})})}catch(t){if(I&&I(),T&&T.aborted&&T.reason instanceof he){const i=T.reason;throw i.config=e,D&&(i.request=D),t!==i&&(i.cause=t),i}if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new he("Network Error",he.ERR_NETWORK,e,D,t&&t.response),{cause:t.cause||t});throw he.from(t,t&&t.code,e,D,t&&t.response)}}},nt=new Map,st=e=>{let t=e&&e.env||{};const{fetch:i,Request:n,Response:s}=t,r=[n,s,i];let o,a,l=r.length,c=nt;for(;l--;)o=r[l],a=c.get(o),void 0===a&&c.set(o,a=l?new Map:it(t)),c=a;return a},rt=(st(),{http:null,xhr:qe,fetch:{get:st}});Z.forEach(rt,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const ot=e=>`- ${e}`,at=e=>Z.isFunction(e)||null===e||!1===e,lt=function(e,t){e=Z.isArray(e)?e:[e];const{length:i}=e;let n,s;const r={};for(let o=0;o<i;o++){let i;if(n=e[o],s=n,!at(n)&&(s=rt[(i=String(n)).toLowerCase()],void 0===s))throw new he(`Unknown adapter '${i}'`);if(s&&(Z.isFunction(s)||(s=s.get(t))))break;r[i||"#"+o]=s}if(!s){const e=Object.entries(r).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=i?e.length>1?"since :\n"+e.map(ot).join("\n"):" "+ot(e[0]):"as no adapter specified";throw new he("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return s};function ct(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Fe(null,e)}function ht(e){return ct(e),e.headers=le.from(e.headers),e.data=Ne.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),lt(e.adapter||Le.adapter,e)(e).then(function(t){ct(e),e.response=t;try{t.data=Ne.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=le.from(t.headers),t},function(t){if(!Oe(t)&&(ct(e),t&&t.response)){e.response=t.response;try{t.response.data=Ne.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=le.from(t.response.headers)}return Promise.reject(t)})}const ut={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ut[e]=function(i){return typeof i===e||"a"+(t<1?"n ":" ")+e}});const dt={};ut.transitional=function(e,t,i){function n(e,t){return"[Axios v"+Je+"] Transitional option '"+e+"'"+t+(i?". "+i:"")}return(i,s,r)=>{if(!1===e)throw new he(n(s," has been removed"+(t?" in "+t:"")),he.ERR_DEPRECATED);return t&&!dt[s]&&(dt[s]=!0,console.warn(n(s," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(i,s,r)}},ut.spelling=function(e){return(t,i)=>(console.warn(`${i} is likely a misspelling of ${e}`),!0)};const pt={assertOptions:function(e,t,i){if("object"!=typeof e)throw new he("options must be an object",he.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let s=n.length;for(;s-- >0;){const r=n[s],o=Object.prototype.hasOwnProperty.call(t,r)?t[r]:void 0;if(o){const t=e[r],i=void 0===t||o(t,r,e);if(!0!==i)throw new he("option "+r+" must be "+i,he.ERR_BAD_OPTION_VALUE);continue}if(!0!==i)throw new he("Unknown option "+r,he.ERR_BAD_OPTION)}},validators:ut},gt=pt.validators;class ft{constructor(e){this.defaults=e||{},this.interceptors={request:new Se,response:new Se}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const i=(()=>{if(!t.stack)return"";const e=t.stack.indexOf("\n");return-1===e?"":t.stack.slice(e+1)})();try{if(e.stack){if(i){const t=i.indexOf("\n"),n=-1===t?-1:i.indexOf("\n",t+1),s=-1===n?"":i.slice(n+1);String(e.stack).endsWith(s)||(e.stack+="\n"+i)}}else e.stack=i}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=$e(this.defaults,t);const{transitional:i,paramsSerializer:n,headers:s}=t;void 0!==i&&pt.assertOptions(i,{silentJSONParsing:gt.transitional(gt.boolean),forcedJSONParsing:gt.transitional(gt.boolean),clarifyTimeoutError:gt.transitional(gt.boolean),legacyInterceptorReqResOrdering:gt.transitional(gt.boolean)},!1),null!=n&&(Z.isFunction(n)?t.paramsSerializer={serialize:n}:pt.assertOptions(n,{encode:gt.function,serialize:gt.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),pt.assertOptions(t,{baseUrl:gt.spelling("baseURL"),withXsrfToken:gt.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let r=s&&Z.merge(s.common,s[t.method]);s&&Z.forEach(["delete","get","head","post","put","patch","query","common"],e=>{delete s[e]}),t.headers=le.concat(r,s);const o=[];let a=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;a=a&&e.synchronous;const i=t.transitional||xe;i&&i.legacyInterceptorReqResOrdering?o.unshift(e.fulfilled,e.rejected):o.push(e.fulfilled,e.rejected)});const l=[];let c;this.interceptors.response.forEach(function(e){l.push(e.fulfilled,e.rejected)});let h,u=0;if(!a){const e=[ht.bind(this),void 0];for(e.unshift(...o),e.push(...l),h=e.length,c=Promise.resolve(t);u<h;)c=c.then(e[u++],e[u++]);return c}h=o.length;let d=t;for(;u<h;){const e=o[u++],t=o[u++];try{d=e(d)}catch(e){t.call(this,e);break}}try{c=ht.call(this,d)}catch(e){return Promise.reject(e)}for(u=0,h=l.length;u<h;)c=c.then(l[u++],l[u++]);return c}getUri(e){return we(We((e=$e(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}Z.forEach(["delete","get","head","options"],function(e){ft.prototype[e]=function(t,i){return this.request($e(i||{},{method:e,url:t,data:(i||{}).data}))}}),Z.forEach(["post","put","patch","query"],function(e){function t(t){return function(i,n,s){return this.request($e(s||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:i,data:n}))}}ft.prototype[e]=t(),"query"!==e&&(ft.prototype[e+"Form"]=t(!0))});const mt=ft;class yt{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const i=this;this.promise.then(e=>{if(!i._listeners)return;let t=i._listeners.length;for(;t-- >0;)i._listeners[t](e);i._listeners=null}),this.promise.then=e=>{let t;const n=new Promise(e=>{i.subscribe(e),t=e}).then(e);return n.cancel=function(){i.unsubscribe(t)},n},e(function(e,n,s){i.reason||(i.reason=new Fe(e,n,s),t(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new yt(function(t){e=t}),cancel:e}}}const vt=yt,bt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(bt).forEach(([e,t])=>{bt[t]=e});const Ct=bt,wt=function e(t){const i=new mt(t),n=s(mt.prototype.request,i);return Z.extend(n,mt.prototype,i,{allOwnKeys:!0}),Z.extend(n,i,null,{allOwnKeys:!0}),n.create=function(i){return e($e(t,i))},n}(Le);wt.Axios=mt,wt.CanceledError=Fe,wt.CancelToken=vt,wt.isCancel=Oe,wt.VERSION=Je,wt.toFormData=fe,wt.AxiosError=he,wt.Cancel=wt.CanceledError,wt.all=function(e){return Promise.all(e)},wt.spread=function(e){return function(t){return e.apply(null,t)}},wt.isAxiosError=function(e){return Z.isObject(e)&&!0===e.isAxiosError},wt.mergeConfig=$e,wt.AxiosHeaders=le,wt.formToJSON=e=>ke(Z.isHTMLForm(e)?new FormData(e):e),wt.getAdapter=lt,wt.HttpStatusCode=Ct,wt.default=wt;const St=wt},67723(e,t,i){"use strict";function n(e){if(e)throw e}i.d(t,{V:()=>n})},29942(e,t,i){"use strict";function n(e,t){const i=String(e);if("string"!=typeof t)throw new TypeError("Expected character");let n=0,s=i.indexOf(t);for(;-1!==s;)n++,s=i.indexOf(t,s+t.length);return n}i.d(t,{D:()=>n})},21454(e,t,i){"use strict";i.d(t,{K:()=>n});const n=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"]},92298(e,t,i){"use strict";i.d(t,{_:()=>n});const n={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"}},5779(e,t,i){"use strict";function n(e){if("string"==typeof e||"number"==typeof e)return""+e;let t="";if(Array.isArray(e))for(let i,s=0;s<e.length;s++)""!==(i=n(e[s]))&&(t+=(t&&" ")+i);else for(let i in e)e[i]&&(t+=(t&&" ")+i);return t}i.d(t,{A:()=>n})},70851(e,t,i){"use strict";function n(e){var t,i,s="";if("string"==typeof e||"number"==typeof e)s+=e;else if("object"==typeof e)if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(i=n(e[t]))&&(s&&(s+=" "),s+=i)}else for(i in e)e[i]&&(s&&(s+=" "),s+=i);return s}i.d(t,{A:()=>s});const s=function(){for(var e,t,i=0,s="",r=arguments.length;i<r;i++)(e=arguments[i])&&(t=n(e))&&(s&&(s+=" "),s+=t);return s}},22422(e,t,i){"use strict";i.d(t,{tZ:()=>M});var n=i(51104),s=i(62388),r=i(60214);const o="#2e3440",a="#3b4252",l="#434c5e",c="#4c566a",h="#e5e9f0",u="#eceff4",d="#8fbcbb",p="#88c0d0",g="#5e81ac",f="#d08770",m="#ebcb8b",y="#a3be8c",v="#d30102",b=u,C=b,w=a,S=b,x=a,E=n.Lz.theme({"&":{color:o,backgroundColor:"#ffffff"},".cm-content":{caretColor:x},".cm-cursor, .cm-dropCursor":{borderLeftColor:x},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:S},".cm-panels":{backgroundColor:b,color:c},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:`1px solid ${c}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:h},".cm-activeLine":{backgroundColor:C},".cm-selectionMatch":{backgroundColor:h},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{outline:`1px solid ${c}`},"&.cm-focused .cm-matchingBracket":{backgroundColor:u},".cm-gutters":{backgroundColor:u,color:o,border:"none"},".cm-activeLineGutter":{backgroundColor:C},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:w},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:w,borderBottomColor:w},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:C,color:c}}},{dark:!1}),A=s.cr.define([{tag:r._A.keyword,color:g},{tag:[r._A.name,r._A.deleted,r._A.character,r._A.propertyName,r._A.macroName],color:f},{tag:[r._A.variableName],color:f},{tag:[r._A.function(r._A.variableName)],color:g},{tag:[r._A.labelName],color:"#81a1c1"},{tag:[r._A.color,r._A.constant(r._A.name),r._A.standard(r._A.name)],color:g},{tag:[r._A.definition(r._A.name),r._A.separator],color:y},{tag:[r._A.brace],color:d},{tag:[r._A.annotation],color:v},{tag:[r._A.number,r._A.changed,r._A.annotation,r._A.modifier,r._A.self,r._A.namespace],color:p},{tag:[r._A.typeName,r._A.className],color:m},{tag:[r._A.operator,r._A.operatorKeyword],color:y},{tag:[r._A.tagName],color:"#b48ead"},{tag:[r._A.squareBracket],color:"#bf616a"},{tag:[r._A.angleBracket],color:f},{tag:[r._A.attributeName],color:m},{tag:[r._A.regexp],color:g},{tag:[r._A.quote],color:a},{tag:[r._A.string],color:f},{tag:r._A.link,color:d,textDecoration:"underline",textUnderlinePosition:"under"},{tag:[r._A.url,r._A.escape,r._A.special(r._A.string)],color:f},{tag:[r._A.meta],color:p},{tag:[r._A.comment],color:l,fontStyle:"italic"},{tag:r._A.strong,fontWeight:"bold",color:g},{tag:r._A.emphasis,fontStyle:"italic",color:g},{tag:r._A.strikethrough,textDecoration:"line-through"},{tag:r._A.heading,fontWeight:"bold",color:g},{tag:r._A.special(r._A.heading1),fontWeight:"bold",color:g},{tag:r._A.heading1,fontWeight:"bold",color:g},{tag:[r._A.heading2,r._A.heading3,r._A.heading4],fontWeight:"bold",color:g},{tag:[r._A.heading5,r._A.heading6],color:g},{tag:[r._A.atom,r._A.bool,r._A.special(r._A.variableName)],color:f},{tag:[r._A.processingInstruction,r._A.inserted],color:d},{tag:[r._A.contentSeparator],color:m},{tag:r._A.invalid,color:l,borderBottom:`1px dotted ${v}`}]),M=[E,(0,s.y9)(A)]},97727(e,t,i){"use strict";i.d(t,{oQ:()=>Pe});var n=i(51104),s=i(1993),r=i(62388),o=i(78633),a=i(61145);const l="function"==typeof String.prototype.normalize?e=>e.normalize("NFKD"):e=>e;class c{constructor(e,t,i=0,n=e.length,s,r){this.test=r,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(i,n),this.bufferStart=i,this.normalize=s?e=>s(l(e)):l,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return(0,s.vS)(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=(0,s.MK)(e),i=this.bufferStart+this.bufferPos;this.bufferPos+=(0,s.Fh)(e);let n=this.normalize(t);if(n.length)for(let e=0,s=i,r=!0;;e++){let i=n.charCodeAt(e),o=this.match(i,s,r,this.bufferPos+this.bufferStart,e==n.length-1);if(o)return this.value=o,this;if(e==n.length-1)break;r&&e<t.length&&t.charCodeAt(e)==i?s++:r=!1}}}match(e,t,i,n,s){let r=null;for(let t=0;t<this.matches.length;){let i=this.matches[t],o=!1;this.query.charCodeAt(i.index)==e&&(i.index==this.query.length-1?r={from:i.from,to:n,precise:s&&i.precise}:(i.index++,o=!0)),o?t++:this.matches.splice(t,1)}return this.query.charCodeAt(0)==e&&(1==this.query.length?r={from:t,to:n,precise:i&&s}:this.matches.push({from:t,index:1,precise:i})),r&&this.test&&!this.test(r.from,r.to,this.buffer,this.bufferStart)&&(r=null),r}}"undefined"!=typeof Symbol&&(c.prototype[Symbol.iterator]=function(){return this});const h={from:-1,to:-1,match:/.*/.exec(""),precise:!0},u="gm"+(null==/x/.unicode?"":"u");class d{constructor(e,t,i,n=0,s=e.length){if(this.text=e,this.to=s,this.curLine="",this.done=!1,this.value=h,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new f(e,t,i,n,s);this.re=new RegExp(t,u+((null==i?void 0:i.ignoreCase)?"i":"")),this.test=null==i?void 0:i.test,this.iter=e.iter();let r=e.lineAt(n);this.curLineStart=r.from,this.matchPos=m(e,n),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let i=this.curLineStart+t.index,n=i+t[0].length;if(this.matchPos=m(this.text,n+(i==n?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(i<n||i>this.value.to)&&(!this.test||this.test(i,n,t)))return this.value={from:i,to:n,precise:!0,match:t},this;e=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length<this.to))return this.done=!0,this;this.nextLine(),e=0}}}}const p=new WeakMap;class g{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,i){let n=p.get(e);if(!n||n.from>=i||n.to<=t){let n=new g(t,e.sliceString(t,i));return p.set(e,n),n}if(n.from==t&&n.to==i)return n;let{text:s,from:r}=n;return r>t&&(s=e.sliceString(t,r)+s,r=t),n.to<i&&(s+=e.sliceString(n.to,i)),p.set(e,new g(r,s)),new g(t,s.slice(t-r,i-r))}}class f{constructor(e,t,i,n,s){this.text=e,this.to=s,this.done=!1,this.value=h,this.matchPos=m(e,n),this.re=new RegExp(t,u+((null==i?void 0:i.ignoreCase)?"i":"")),this.test=null==i?void 0:i.test,this.flat=g.get(e,n,this.chunkEnd(n+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,i=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,i,t)))return this.value={from:e,to:i,precise:!0,match:t},this.matchPos=m(this.text,i+(e==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=g.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function m(e,t){if(t>=e.length)return t;let i,n=e.lineAt(t);for(;t<n.to&&(i=n.text.charCodeAt(t-n.from))>=56320&&i<57344;)t++;return t}"undefined"!=typeof Symbol&&(d.prototype[Symbol.iterator]=f.prototype[Symbol.iterator]=function(){return this});const y={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},v=s.sj.define({combine:e=>(0,s.QR)(e,y,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})});function b(e){let t=[E,x];return e&&t.push(v.of(e)),t}const C=n.NZ.mark({class:"cm-selectionMatch"}),w=n.NZ.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function S(e,t,i,n){return!(0!=i&&e(t.sliceDoc(i-1,i))==s.Je.Word||n!=t.doc.length&&e(t.sliceDoc(n,n+1))==s.Je.Word)}const x=n.Z9.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(v),{state:i}=e,r=i.selection;if(r.ranges.length>1)return n.NZ.none;let o,a=r.main,l=null;if(a.empty){if(!t.highlightWordAroundCursor)return n.NZ.none;let e=i.wordAt(a.head);if(!e)return n.NZ.none;l=i.charCategorizer(a.head),o=i.sliceDoc(e.from,e.to)}else{let e=a.to-a.from;if(e<t.minSelectionLength||e>200)return n.NZ.none;if(t.wholeWords){if(o=i.sliceDoc(a.from,a.to),l=i.charCategorizer(a.head),!S(l,i,a.from,a.to)||!function(e,t,i,n){return e(t.sliceDoc(i,i+1))==s.Je.Word&&e(t.sliceDoc(n-1,n))==s.Je.Word}(l,i,a.from,a.to))return n.NZ.none}else if(o=i.sliceDoc(a.from,a.to),!o)return n.NZ.none}let h=[];for(let s of e.visibleRanges){let e=new c(i.doc,o,s.from,s.to);for(;!e.next().done;){let{from:s,to:r}=e.value;if((!l||S(l,i,s,r))&&(a.empty&&s<=a.from&&r>=a.to?h.push(w.range(s,r)):(s>=a.to||r<=a.from)&&h.push(C.range(s,r)),h.length>t.maxMatches))return n.NZ.none}}return n.NZ.set(h)}},{decorations:e=>e.decorations}),E=n.Lz.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),A=s.sj.define({combine:e=>(0,s.QR)(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new ee(e),scrollToMatch:e=>n.Lz.scrollIntoView(e)})});class M{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||function(e){try{return new RegExp(e,u),!0}catch(e){return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>"n"==t?"\n":"r"==t?"\r":"t"==t?"\t":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new _(this):new I(this)}getCursor(e,t=0,i){let n=e.doc?e:s.$t.create({doc:e});return null==i&&(i=n.doc.length),this.regexp?R(this,n,t,i):D(this,n,t,i)}}class T{constructor(e){this.spec=e}}function D(e,t,i,n){let r;var o,a;return e.wholeWord&&(o=t.doc,a=t.charCategorizer(t.selection.main.head),r=(e,t,i,n)=>((n>e||n+i.length<t)&&(n=Math.max(0,e-2),i=o.sliceString(n,Math.min(o.length,t+2))),!(a(k(i,e-n))==s.Je.Word&&a(P(i,e-n))==s.Je.Word||a(P(i,t-n))==s.Je.Word&&a(k(i,t-n))==s.Je.Word))),e.test&&(r=function(e,t,i){return(n,s,r,o)=>{if(i&&!i(n,s,r,o))return!1;let a=n>=o&&s<=o+r.length?r.slice(n-o,s-o):t.doc.sliceString(n,s);return e(a,t,n,s)}}(e.test,t,r)),new c(t.doc,e.unquoted,i,n,e.caseSensitive?void 0:e=>e.toLowerCase(),r)}class I extends T{constructor(e){super(e)}nextMatch(e,t,i){let n=D(this.spec,e,i,e.doc.length).nextOverlapping();if(n.done){let i=Math.min(e.doc.length,t+this.spec.unquoted.length);n=D(this.spec,e,0,i).nextOverlapping()}return n.done||n.value.from==t&&n.value.to==i?null:n.value}prevMatchInRange(e,t,i){for(let n=i;;){let i=Math.max(t,n-1e4-this.spec.unquoted.length),s=D(this.spec,e,i,n),r=null;for(;!s.nextOverlapping().done;)r=s.value;if(r)return r;if(i==t)return null;n-=1e4}}prevMatch(e,t,i){let n=this.prevMatchInRange(e,0,t);return n||(n=this.prevMatchInRange(e,Math.max(0,i-this.spec.unquoted.length),e.doc.length)),!n||n.from==t&&n.to==i?null:n}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let i=D(this.spec,e,0,e.doc.length),n=[];for(;!i.next().done;){if(n.length>=t)return null;n.push(i.value)}return n}highlight(e,t,i,n){let s=D(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)n(s.value.from,s.value.to)}}function R(e,t,i,n){let r;var o;return e.wholeWord&&(o=t.charCategorizer(t.selection.main.head),r=(e,t,i)=>!i[0].length||(o(k(i.input,i.index))!=s.Je.Word||o(P(i.input,i.index))!=s.Je.Word)&&(o(P(i.input,i.index+i[0].length))!=s.Je.Word||o(k(i.input,i.index+i[0].length))!=s.Je.Word)),e.test&&(r=function(e,t,i){return(n,s,r)=>(!i||i(n,s,r))&&e(r[0],t,n,s)}(e.test,t,r)),new d(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:r},i,n)}function k(e,t){return e.slice((0,s.zK)(e,t,!1),t)}function P(e,t){return e.slice(t,(0,s.zK)(e,t))}class _ extends T{nextMatch(e,t,i){let n=R(this.spec,e,i,e.doc.length).next();return n.done&&(n=R(this.spec,e,0,t).next()),n.done?null:n.value}prevMatchInRange(e,t,i){for(let n=1;;n++){let s=Math.max(t,i-1e4*n),r=R(this.spec,e,s,i),o=null;for(;!r.next().done;)o=r.value;if(o&&(s==t||o.from>s+10))return o;if(s==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,i)=>{if("&"==i)return e.match[0];if("$"==i)return"$";for(let t=i.length;t>0;t--){let n=+i.slice(0,t);if(n>0&&n<e.match.length)return e.match[n]+i.slice(t)}return t})}matchAll(e,t){let i=R(this.spec,e,0,e.doc.length),n=[];for(;!i.next().done;){if(n.length>=t)return null;n.push(i.value)}return n}highlight(e,t,i,n){let s=R(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!s.next().done;)n(s.value.from,s.value.to)}}const L=s.Pe.define(),N=s.Pe.define(),O=s.sU.define({create:e=>new F(Y(e).create(),null),update(e,t){for(let i of t.effects)i.is(L)?e=new F(i.value.create(),e.panel):i.is(N)&&(e=new F(e.query,i.value?K:null));return e},provide:e=>n.S7.from(e,e=>e.panel)});class F{constructor(e,t){this.query=e,this.panel=t}}const G=n.NZ.mark({class:"cm-searchMatch"}),B=n.NZ.mark({class:"cm-searchMatch cm-searchMatch-selected"}),V=n.Z9.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(O))}update(e){let t=e.state.field(O);(t!=e.startState.field(O)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return n.NZ.none;let{view:i}=this,r=new s.vB;for(let t=0,n=i.visibleRanges,s=n.length;t<s;t++){let{from:o,to:a}=n[t];for(;t<s-1&&a>n[t+1].from-500;)a=n[++t].to;e.highlight(i.state,o,a,(e,t)=>{let n=i.state.selection.ranges.some(i=>i.from==e&&i.to==t);r.add(e,t,n?B:G)})}return r.finish()}},{decorations:e=>e.decorations});function H(e){return t=>{let i=t.state.field(O,!1);return i&&i.query.spec.valid?e(t,i):Z(t)}}const U=H((e,{query:t})=>{let{to:i}=e.state.selection.main,n=t.nextMatch(e.state,i,i);if(!n)return!1;let r=s.OF.single(n.from,n.to),o=e.state.facet(A);return e.dispatch({selection:r,effects:[ne(e,n),o.scrollToMatch(r.main,e)],userEvent:"select.search"}),X(e),!0}),z=H((e,{query:t})=>{let{state:i}=e,{from:n}=i.selection.main,r=t.prevMatch(i,n,n);if(!r)return!1;let o=s.OF.single(r.from,r.to),a=e.state.facet(A);return e.dispatch({selection:o,effects:[ne(e,r),a.scrollToMatch(o.main,e)],userEvent:"select.search"}),X(e),!0}),W=H((e,{query:t})=>{let i=t.matchAll(e.state,1e3);return!(!i||!i.length||(e.dispatch({selection:s.OF.create(i.map(e=>s.OF.range(e.from,e.to))),userEvent:"select.search.matches"}),0))}),j=H((e,{query:t})=>{let{state:i}=e,{from:r,to:o}=i.selection.main;if(i.readOnly)return!1;let a=t.nextMatch(i,r,r);if(!a)return!1;let l,c,h=a,u=[],d=[];h.precise?h.from==r&&h.to==o&&(c=i.toText(t.getReplacement(h)),u.push({from:h.from,to:h.to,insert:c}),h=t.nextMatch(i,h.from,h.to),d.push(n.Lz.announce.of(i.phrase("replaced match on line $",i.doc.lineAt(r).number)+"."))):h=t.nextMatch(i,h.from,h.to);let p=e.state.changes(u);return h&&(l=s.OF.single(h.from,h.to).map(p),d.push(ne(e,h)),d.push(i.facet(A).scrollToMatch(l.main,e))),e.dispatch({changes:p,selection:l,effects:d,userEvent:"input.replace"}),!0}),$=H((e,{query:t})=>{if(e.state.readOnly)return!1;let i=[];for(let n of t.matchAll(e.state,1e9)){let{from:e,to:s,precise:r}=n;r&&i.push({from:e,to:s,insert:t.getReplacement(n)})}if(!i.length)return!1;let s=e.state.phrase("replaced $ matches",i.length)+".";return e.dispatch({changes:i,effects:n.Lz.announce.of(s),userEvent:"input.replace.all"}),!0});function K(e){return e.state.facet(A).createPanel(e)}function Y(e,t){var i,n,s,r,o;let a=e.selection.main,l=a.empty||a.to>a.from+100?"":e.sliceDoc(a.from,a.to);if(t&&!l)return t;let c=e.facet(A);return new M({search:(null!==(i=null==t?void 0:t.literal)&&void 0!==i?i:c.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:null!==(n=null==t?void 0:t.caseSensitive)&&void 0!==n?n:c.caseSensitive,literal:null!==(s=null==t?void 0:t.literal)&&void 0!==s?s:c.literal,regexp:null!==(r=null==t?void 0:t.regexp)&&void 0!==r?r:c.regexp,wholeWord:null!==(o=null==t?void 0:t.wholeWord)&&void 0!==o?o:c.wholeWord})}function q(e){let t=(0,n.ld)(e,K);return t&&t.dom.querySelector("[main-field]")}function X(e){let t=q(e);t&&t==e.root.activeElement&&t.select()}const Z=e=>{let t=e.state.field(O,!1);if(t&&t.panel){let i=q(e);if(i&&i!=e.root.activeElement){let n=Y(e.state,t.query.spec);n.valid&&e.dispatch({effects:L.of(n)}),i.focus(),i.select()}}else e.dispatch({effects:[N.of(!0),t?L.of(Y(e.state,t.query.spec)):s.Pe.appendConfig.of(re)]});return!0},Q=e=>{let t=e.state.field(O,!1);if(!t||!t.panel)return!1;let i=(0,n.ld)(e,K);return i&&i.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:N.of(!1)}),!0},J=[{key:"Mod-f",run:Z,scope:"editor search-panel"},{key:"F3",run:U,shift:z,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:U,shift:z,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Q,scope:"editor search-panel"},{key:"Mod-Shift-l",run:({state:e,dispatch:t})=>{let i=e.selection;if(i.ranges.length>1||i.main.empty)return!1;let{from:n,to:r}=i.main,o=[],a=0;for(let t=new c(e.doc,e.sliceDoc(n,r));!t.next().done;){if(o.length>1e3)return!1;t.value.from==n&&(a=o.length),o.push(s.OF.range(t.value.from,t.value.to))}return t(e.update({selection:s.OF.create(o,a),userEvent:"select.search.matches"})),!0}},{key:"Mod-Alt-g",run:e=>{let t=(0,n.rC)(e,"cm-goto-line");if(t){let e=t.dom.querySelector("input[type=text]");return e&&e.select(),!0}let{state:i}=e,r=String(i.doc.lineAt(e.state.selection.main.head).number),{close:o,result:a}=(0,n.ui)(e,{class:"cm-goto-line",label:i.phrase("Go to line"),input:{type:"text",name:"line",value:r},focus:!0,submitLabel:i.phrase("go")});return a.then(t=>{let r=t&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.elements.line.value);if(!r)return void e.dispatch({effects:o});let a=i.doc.lineAt(i.selection.main.head),[,l,c,h,u]=r,d=h?+h.slice(1):0,p=c?+c:a.number;if(c&&u){let e=p/100;l&&(e=e*("-"==l?-1:1)+a.number/i.doc.lines),p=Math.round(i.doc.lines*e)}else c&&l&&(p=p*("-"==l?-1:1)+a.number);let g=i.doc.line(Math.max(1,Math.min(i.doc.lines,p))),f=s.OF.cursor(g.from+Math.max(0,Math.min(d,g.length)));e.dispatch({effects:[o,n.Lz.scrollIntoView(f.from,{y:"center"})],selection:f})}),!0}},{key:"Mod-d",run:({state:e,dispatch:t})=>{let{ranges:i}=e.selection;if(i.some(e=>e.from===e.to))return(({state:e,dispatch:t})=>{let{selection:i}=e,n=s.OF.create(i.ranges.map(t=>e.wordAt(t.head)||s.OF.cursor(t.head)),i.mainIndex);return!n.eq(i)&&(t(e.update({selection:n})),!0)})({state:e,dispatch:t});let r=e.sliceDoc(i[0].from,i[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let o=function(e,t){let{main:i,ranges:n}=e.selection,s=e.wordAt(i.head),r=s&&s.from==i.from&&s.to==i.to;for(let i=!1,s=new c(e.doc,t,n[n.length-1].to);;){if(s.next(),!s.done){if(i&&n.some(e=>e.from==s.value.from))continue;if(r){let t=e.wordAt(s.value.from);if(!t||t.from!=s.value.from||t.to!=s.value.to)continue}return s.value}if(i)return null;s=new c(e.doc,t,0,Math.max(0,n[n.length-1].from-1)),i=!0}}(e,r);return!!o&&(t(e.update({selection:e.selection.addRange(s.OF.range(o.from,o.to),!1),effects:n.Lz.scrollIntoView(o.to)})),!0)},preventDefault:!0}];class ee{constructor(e){this.view=e;let t=this.query=e.state.field(O).query.spec;function i(e,t,i){return(0,a.A)("button",{class:"cm-button",name:e,onclick:t,type:"button"},i)}this.commit=this.commit.bind(this),this.searchField=(0,a.A)("input",{value:t.search,placeholder:te(e,"Find"),"aria-label":te(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=(0,a.A)("input",{value:t.replace,placeholder:te(e,"Replace"),"aria-label":te(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=(0,a.A)("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=(0,a.A)("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=(0,a.A)("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit}),this.dom=(0,a.A)("div",{onkeydown:e=>this.keydown(e),class:"cm-search"},[this.searchField,i("next",()=>U(e),[te(e,"next")]),i("prev",()=>z(e),[te(e,"previous")]),i("select",()=>W(e),[te(e,"all")]),(0,a.A)("label",null,[this.caseField,te(e,"match case")]),(0,a.A)("label",null,[this.reField,te(e,"regexp")]),(0,a.A)("label",null,[this.wordField,te(e,"by word")]),...e.state.readOnly?[]:[(0,a.A)("br"),this.replaceField,i("replace",()=>j(e),[te(e,"replace")]),i("replaceAll",()=>$(e),[te(e,"replace all")])],(0,a.A)("button",{name:"close",onclick:()=>Q(e),"aria-label":te(e,"close"),type:"button"},["×"])])}commit(){let e=new M({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:L.of(e)}))}keydown(e){(0,n.TS)(this.view,e,"search-panel")?e.preventDefault():13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?z:U)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),j(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(L)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(A).top}}function te(e,t){return e.state.phrase(t)}const ie=/[\s\.,:;?!]/;function ne(e,{from:t,to:i}){let s=e.state.doc.lineAt(t),r=e.state.doc.lineAt(i).to,o=Math.max(s.from,t-30),a=Math.min(r,i+30),l=e.state.sliceDoc(o,a);if(o!=s.from)for(let e=0;e<30;e++)if(!ie.test(l[e+1])&&ie.test(l[e])){l=l.slice(e);break}if(a!=r)for(let e=l.length-1;e>l.length-30;e--)if(!ie.test(l[e-1])&&ie.test(l[e])){l=l.slice(0,e);break}return n.Lz.announce.of(`${e.state.phrase("current match")}. ${l} ${e.state.phrase("on line")} ${s.number}.`)}const se=n.Lz.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),re=[O,s.Nb.low(V),se];var oe=i(15115);class ae{constructor(e,t,i){this.from=e,this.to=t,this.diagnostic=i}}class le{constructor(e,t,i){this.diagnostics=e,this.panel=t,this.selected=i}static init(e,t,i){let r=i.facet(be).markerFilter;r&&(e=r(e,i));let o=e.slice().sort((e,t)=>e.from-t.from||e.to-t.to),a=new s.vB,l=[],c=0,h=i.doc.iter(),u=0,d=i.doc.length;for(let e=0;;){let t,i,s=e==o.length?null:o[e];if(!s&&!l.length)break;if(l.length)t=c,i=l.reduce((e,t)=>Math.min(e,t.to),s&&s.from>t?s.from:1e8);else{if(t=s.from,t>d)break;i=s.to,l.push(s),e++}for(;e<o.length;){let n=o[e];if(n.from!=t||!(n.to>n.from||n.to==t)){i=Math.min(n.from,i);break}l.push(n),e++,i=Math.min(n.to,i)}i=Math.min(i,d);let r=!1;if(l.some(e=>e.from==t&&(e.to==i||i==d))&&(r=t==i,!r&&i-t<10)){let e=t-(u+h.value.length);e>0&&(h.next(e),u=t);for(let e=t;;){if(e>=i){r=!0;break}if(!h.lineBreak&&u+h.value.length>e)break;e=u+h.value.length,u+=h.value.length,h.next()}}let p=Ie(l);if(r)a.add(t,t,n.NZ.widget({widget:new xe(p),diagnostics:l.slice()}));else{let e=l.reduce((e,t)=>t.markClass?e+" "+t.markClass:e,"");a.add(t,i,n.NZ.mark({class:"cm-lintRange cm-lintRange-"+p+e,diagnostics:l.slice(),inclusiveEnd:l.some(e=>e.to>i)}))}if(c=i,c==d)break;for(let e=0;e<l.length;e++)l[e].to<=c&&l.splice(e--,1)}let p=a.finish();return new le(p,t,ce(p))}}function ce(e,t=null,i=0){let n=null;return e.between(i,1e9,(e,i,{spec:s})=>{if(!(t&&s.diagnostics.indexOf(t)<0))if(n){if(s.diagnostics.indexOf(n.diagnostic)<0)return!1;n=new ae(n.from,i,n.diagnostic)}else n=new ae(e,i,t||s.diagnostics[0])}),n}const he=s.Pe.define(),ue=s.Pe.define(),de=s.Pe.define(),pe=s.sU.define({create:()=>new le(n.NZ.none,null,null),update(e,t){if(t.docChanged&&e.diagnostics.size){let i=e.diagnostics.map(t.changes),n=null,s=e.panel;if(e.selected){let s=t.changes.mapPos(e.selected.from,1);n=ce(i,e.selected.diagnostic,s)||ce(i,null,s)}!i.size&&s&&t.state.facet(be).autoPanel&&(s=null),e=new le(i,s,n)}for(let i of t.effects)if(i.is(he)){let n=t.state.facet(be).autoPanel?i.value.length?Ae.open:null:e.panel;e=le.init(i.value,n,t.state)}else i.is(ue)?e=new le(e.diagnostics,i.value?Ae.open:null,e.selected):i.is(de)&&(e=new le(e.diagnostics,e.panel,i.value));return e},provide:e=>[n.S7.from(e,e=>e.panel),n.Lz.decorations.from(e,e=>e.diagnostics)]}),ge=n.NZ.mark({class:"cm-lintRange cm-lintRange-active"});function fe(e,t,i){let n,{diagnostics:s}=e.state.field(pe),r=-1,o=-1;s.between(t-(i<0?1:0),t+(i>0?1:0),(e,s,{spec:a})=>{if(t>=e&&t<=s&&(e==s||(t>e||i>0)&&(t<s||i<0)))return n=a.diagnostics,r=e,o=s,!1});let a=e.state.facet(be).tooltipFilter;return n&&a&&(n=a(n,e.state)),n?{pos:r,end:o,above:!0,create:()=>({dom:me(e,n)})}:null}function me(e,t){return(0,a.A)("ul",{class:"cm-tooltip-lint"},t.map(t=>Se(e,t,!1)))}const ye=e=>{let t=e.state.field(pe,!1);return!(!t||!t.panel||(e.dispatch({effects:ue.of(!1)}),0))},ve=[{key:"Mod-Shift-m",run:e=>{let t=e.state.field(pe,!1);var i,r;t&&t.panel||e.dispatch({effects:(i=e.state,r=[ue.of(!0)],i.field(pe,!1)?r:r.concat(s.Pe.appendConfig.of(ke)))});let o=(0,n.ld)(e,Ae.open);return o&&o.dom.querySelector(".cm-panel-lint ul").focus(),!0},preventDefault:!0},{key:"F8",run:e=>{let t=e.state.field(pe,!1);if(!t)return!1;let i=e.state.selection.main,s=ce(t.diagnostics,null,i.to+1);return!(!s&&(s=ce(t.diagnostics,null,0),!s||s.from==i.from&&s.to==i.to)||(e.dispatch({selection:{anchor:s.from,head:s.to},scrollIntoView:!0}),(0,n.ab)(e,s.from,1,{tooltip:Re,until:e=>e.docChanged||e.newSelection.main.head<s.from||e.newSelection.main.head>s.to}),0))}}],be=s.sj.define({combine:e=>({sources:e.map(e=>e.source).filter(e=>null!=e),...(0,s.QR)(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:Ce,tooltipFilter:Ce,needsRefresh:(e,t)=>e?t?i=>e(i)||t(i):e:t,hideOn:(e,t)=>e?t?(i,n,s)=>e(i,n,s)||t(i,n,s):e:t,autoPanel:(e,t)=>e||t})})});function Ce(e,t){return e?t?(i,n)=>t(e(i,n),n):e:t}function we(e){let t=[];if(e)e:for(let{name:i}of e){for(let e=0;e<i.length;e++){let n=i[e];if(/[a-zA-Z]/.test(n)&&!t.some(e=>e.toLowerCase()==n.toLowerCase())){t.push(n);continue e}}t.push("")}return t}function Se(e,t,i){var n;let s=i?we(t.actions):[];return(0,a.A)("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},(0,a.A)("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),null===(n=t.actions)||void 0===n?void 0:n.map((i,n)=>{let r=!1,o=n=>{if(n.preventDefault(),r)return;r=!0;let s=ce(e.state.field(pe).diagnostics,t);s&&i.apply(e,s.from,s.to)},{name:l}=i,c=s[n]?l.indexOf(s[n]):-1,h=c<0?l:[l.slice(0,c),(0,a.A)("u",l.slice(c,c+1)),l.slice(c+1)],u=i.markClass?" "+i.markClass:"";return(0,a.A)("button",{type:"button",class:"cm-diagnosticAction"+u,onclick:o,onmousedown:o,"aria-label":` Action: ${l}${c<0?"":` (access key "${s[n]})"`}.`},h)}),t.source&&(0,a.A)("div",{class:"cm-diagnosticSource"},t.source))}class xe extends n.xO{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return(0,a.A)("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class Ee{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(4294967295*Math.random()).toString(16),this.dom=Se(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Ae{constructor(e){this.view=e,this.items=[],this.list=(0,a.A)("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t=>{if(!(t.ctrlKey||t.altKey||t.metaKey)){if(27==t.keyCode)ye(this.view),this.view.focus();else if(38==t.keyCode||33==t.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==t.keyCode||34==t.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==t.keyCode)this.moveSelection(0);else if(35==t.keyCode)this.moveSelection(this.items.length-1);else if(13==t.keyCode)this.view.focus();else{if(!(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0))return;{let{diagnostic:i}=this.items[this.selectedIndex],n=we(i.actions);for(let s=0;s<n.length;s++)if(n[s].toUpperCase().charCodeAt(0)==t.keyCode){let t=ce(this.view.state.field(pe).diagnostics,i);t&&i.actions[s].apply(e,t.from,t.to)}}}t.preventDefault()}},onclick:e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)}}),this.dom=(0,a.A)("div",{class:"cm-panel-lint"},this.list,(0,a.A)("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>ye(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(pe).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(pe),i=0,n=!1,s=null,r=new Set;for(e.between(0,this.view.state.doc.length,(e,o,{spec:a})=>{for(let e of a.diagnostics){if(r.has(e))continue;r.add(e);let o,a=-1;for(let t=i;t<this.items.length;t++)if(this.items[t].diagnostic==e){a=t;break}a<0?(o=new Ee(this.view,e),this.items.splice(i,0,o),n=!0):(o=this.items[a],a>i&&(this.items.splice(i,a-i),n=!0)),t&&o.diagnostic==t.diagnostic?o.dom.hasAttribute("aria-selected")||(o.dom.setAttribute("aria-selected","true"),s=o):o.dom.hasAttribute("aria-selected")&&o.dom.removeAttribute("aria-selected"),i++}});i<this.items.length&&!(1==this.items.length&&this.items[0].diagnostic.from<0);)n=!0,this.items.pop();0==this.items.length&&(this.items.push(new Ee(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),n=!0),s?(this.list.setAttribute("aria-activedescendant",s.id),this.view.requestMeasure({key:this,read:()=>({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let i=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/i:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/i)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),n&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;e!=i.dom;)t();e=i.dom.nextSibling}else this.list.insertBefore(i.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=ce(this.view.state.field(pe).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:de.of(t)})}static open(e){return new Ae(e)}}function Me(e){return function(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const Te=n.Lz.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:Me("#f11")},".cm-lintRange-warning":{backgroundImage:Me("orange")},".cm-lintRange-info":{backgroundImage:Me("#999")},".cm-lintRange-hint":{backgroundImage:Me("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function De(e){return"error"==e?4:"warning"==e?3:"info"==e?2:1}function Ie(e){let t="hint",i=1;for(let n of e){let e=De(n.severity);e>i&&(i=e,t=n.severity)}return t}n.wJ;const Re=(0,n.Ux)(fe,{hideOn:function(e,t){let i=t.pos,n=t.end||i,s=e.state.facet(be).hideOn(e,i,n);if(null!=s)return s;let r=e.startState.doc.lineAt(t.pos);return!(!e.effects.some(e=>e.is(he))&&!e.changes.touchesRange(r.from,Math.max(r.to,n)))}}),ke=[pe,n.Lz.decorations.compute([pe],e=>{let{selected:t,panel:i}=e.field(pe);return t&&i&&t.from!=t.to?n.NZ.set([ge.range(t.from,t.to)]):n.NZ.none}),Re,Te],Pe=(()=>[(0,n.$K)(),(0,n.Wu)(),(0,n.N$)(),(0,o.b6)(),(0,r.Lv)(),(0,n.VH)(),(0,n.A)(),s.$t.allowMultipleSelections.of(!0),(0,r.WD)(),(0,r.y9)(r.Zt,{fallback:!0}),(0,r.SG)(),(0,oe.wm)(),(0,oe.yU)(),(0,n.D4)(),(0,n.HJ)(),(0,n.dz)(),b(),n.w4.of([...oe.Bc,...o.pw,...J,...o.cL,...r.f7,...oe.OO,...ve])])()},12172(e,t,i){"use strict";function n(e,t){const i=t||{};return(""===e[e.length-1]?[...e,""]:e).join((i.padRight?" ":"")+","+(!1===i.padLeft?"":" ")).trim()}i.d(t,{A:()=>n})},61145(e,t,i){"use strict";function n(){var e=arguments[0];"string"==typeof e&&(e=document.createElement(e));var t=1,i=arguments[1];if(i&&"object"==typeof i&&null==i.nodeType&&!Array.isArray(i)){for(var n in i)if(Object.prototype.hasOwnProperty.call(i,n)){var r=i[n];"string"==typeof r?e.setAttribute(n,r):null!=r&&(e[n]=r)}t++}for(;t<arguments.length;t++)s(e,arguments[t]);return e}function s(e,t){if("string"==typeof t)e.appendChild(document.createTextNode(t));else if(null==t);else if(null!=t.nodeType)e.appendChild(t);else{if(!Array.isArray(t))throw new RangeError("Unsupported child node: "+t);for(var i=0;i<t.length;i++)s(e,t[i])}}i.d(t,{A:()=>n})},18600(e,t,i){"use strict";var n;function s(){}function r(){r.init.call(this)}function o(e){return void 0===e._maxListeners?r.defaultMaxListeners:e._maxListeners}function a(e,t,i,n){var r,a,l,c;if("function"!=typeof i)throw new TypeError('"listener" argument must be a function');if((a=e._events)?(a.newListener&&(e.emit("newListener",t,i.listener?i.listener:i),a=e._events),l=a[t]):(a=e._events=new s,e._eventsCount=0),l){if("function"==typeof l?l=a[t]=n?[i,l]:[l,i]:n?l.unshift(i):l.push(i),!l.warned&&(r=o(e))&&r>0&&l.length>r){l.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=e,h.type=t,h.count=l.length,c=h,"function"==typeof console.warn?console.warn(c):console.log(c)}}else l=a[t]=i,++e._eventsCount;return e}function l(e,t,i){var n=!1;function s(){e.removeListener(t,s),n||(n=!0,i.apply(e,arguments))}return s.listener=i,s}function c(e){var t=this._events;if(t){var i=t[e];if("function"==typeof i)return 1;if(i)return i.length}return 0}function h(e,t){for(var i=new Array(t);t--;)i[t]=e[t];return i}i.d(t,{As:()=>ti}),s.prototype=Object.create(null),r.EventEmitter=r,r.usingDomains=!1,r.prototype.domain=void 0,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.init=function(){this.domain=null,r.usingDomains&&(!n.active||this instanceof n.Domain||(this.domain=n.active)),this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new s,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},r.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},r.prototype.getMaxListeners=function(){return o(this)},r.prototype.emit=function(e){var t,i,n,s,r,o,a,l="error"===e;if(o=this._events)l=l&&null==o.error;else if(!l)return!1;if(a=this.domain,l){if(t=arguments[1],!a){if(t instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=a,t.domainThrown=!1,a.emit("error",t),!1}if(!(i=o[e]))return!1;var u="function"==typeof i;switch(n=arguments.length){case 1:!function(e,t,i){if(t)e.call(i);else for(var n=e.length,s=h(e,n),r=0;r<n;++r)s[r].call(i)}(i,u,this);break;case 2:!function(e,t,i,n){if(t)e.call(i,n);else for(var s=e.length,r=h(e,s),o=0;o<s;++o)r[o].call(i,n)}(i,u,this,arguments[1]);break;case 3:!function(e,t,i,n,s){if(t)e.call(i,n,s);else for(var r=e.length,o=h(e,r),a=0;a<r;++a)o[a].call(i,n,s)}(i,u,this,arguments[1],arguments[2]);break;case 4:!function(e,t,i,n,s,r){if(t)e.call(i,n,s,r);else for(var o=e.length,a=h(e,o),l=0;l<o;++l)a[l].call(i,n,s,r)}(i,u,this,arguments[1],arguments[2],arguments[3]);break;default:for(s=new Array(n-1),r=1;r<n;r++)s[r-1]=arguments[r];!function(e,t,i,n){if(t)e.apply(i,n);else for(var s=e.length,r=h(e,s),o=0;o<s;++o)r[o].apply(i,n)}(i,u,this,s)}return!0},r.prototype.addListener=function(e,t){return a(this,e,t,!1)},r.prototype.on=r.prototype.addListener,r.prototype.prependListener=function(e,t){return a(this,e,t,!0)},r.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.on(e,l(this,e,t)),this},r.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.prependListener(e,l(this,e,t)),this},r.prototype.removeListener=function(e,t){var i,n,r,o,a;if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');if(!(n=this._events))return this;if(!(i=n[e]))return this;if(i===t||i.listener&&i.listener===t)0===--this._eventsCount?this._events=new s:(delete n[e],n.removeListener&&this.emit("removeListener",e,i.listener||t));else if("function"!=typeof i){for(r=-1,o=i.length;o-- >0;)if(i[o]===t||i[o].listener&&i[o].listener===t){a=i[o].listener,r=o;break}if(r<0)return this;if(1===i.length){if(i[0]=void 0,0===--this._eventsCount)return this._events=new s,this;delete n[e]}else!function(e,t){for(var i=t,n=i+1,s=e.length;n<s;i+=1,n+=1)e[i]=e[n];e.pop()}(i,r);n.removeListener&&this.emit("removeListener",e,a||t)}return this},r.prototype.removeAllListeners=function(e){var t,i;if(!(i=this._events))return this;if(!i.removeListener)return 0===arguments.length?(this._events=new s,this._eventsCount=0):i[e]&&(0===--this._eventsCount?this._events=new s:delete i[e]),this;if(0===arguments.length){for(var n,r=Object.keys(i),o=0;o<r.length;++o)"removeListener"!==(n=r[o])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=new s,this._eventsCount=0,this}if("function"==typeof(t=i[e]))this.removeListener(e,t);else if(t)do{this.removeListener(e,t[t.length-1])}while(t[0]);return this},r.prototype.listeners=function(e){var t,i=this._events;return i&&(t=i[e])?"function"==typeof t?[t.listener||t]:function(e){for(var t=new Array(e.length),i=0;i<t.length;++i)t[i]=e[i].listener||e[i];return t}(t):[]},r.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):c.call(e,t)},r.prototype.listenerCount=c,r.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};var u="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},d=[],p=[],g="undefined"!=typeof Uint8Array?Uint8Array:Array,f=!1;function m(){f=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)d[t]=e[t],p[e.charCodeAt(t)]=t;p["-".charCodeAt(0)]=62,p["_".charCodeAt(0)]=63}function y(e){return d[e>>18&63]+d[e>>12&63]+d[e>>6&63]+d[63&e]}function v(e,t,i){for(var n,s=[],r=t;r<i;r+=3)n=(e[r]<<16)+(e[r+1]<<8)+e[r+2],s.push(y(n));return s.join("")}function b(e){var t;f||m();for(var i=e.length,n=i%3,s="",r=[],o=16383,a=0,l=i-n;a<l;a+=o)r.push(v(e,a,a+o>l?l:a+o));return 1===n?(t=e[i-1],s+=d[t>>2],s+=d[t<<4&63],s+="=="):2===n&&(t=(e[i-2]<<8)+e[i-1],s+=d[t>>10],s+=d[t>>4&63],s+=d[t<<2&63],s+="="),r.push(s),r.join("")}function C(e,t,i,n,s){var r,o,a=8*s-n-1,l=(1<<a)-1,c=l>>1,h=-7,u=i?s-1:0,d=i?-1:1,p=e[t+u];for(u+=d,r=p&(1<<-h)-1,p>>=-h,h+=a;h>0;r=256*r+e[t+u],u+=d,h-=8);for(o=r&(1<<-h)-1,r>>=-h,h+=n;h>0;o=256*o+e[t+u],u+=d,h-=8);if(0===r)r=1-c;else{if(r===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),r-=c}return(p?-1:1)*o*Math.pow(2,r-n)}function w(e,t,i,n,s,r){var o,a,l,c=8*r-s-1,h=(1<<c)-1,u=h>>1,d=23===s?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:r-1,g=n?1:-1,f=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=h):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+u>=1?d/l:d*Math.pow(2,1-u))*l>=2&&(o++,l/=2),o+u>=h?(a=0,o=h):o+u>=1?(a=(t*l-1)*Math.pow(2,s),o+=u):(a=t*Math.pow(2,u-1)*Math.pow(2,s),o=0));s>=8;e[i+p]=255&a,p+=g,a/=256,s-=8);for(o=o<<s|a,c+=s;c>0;e[i+p]=255&o,p+=g,o/=256,c-=8);e[i+p-g]|=128*f}var S={}.toString,x=Array.isArray||function(e){return"[object Array]"==S.call(e)};function E(){return M.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function A(e,t){if(E()<t)throw new RangeError("Invalid typed array length");return M.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=M.prototype:(null===e&&(e=new M(t)),e.length=t),e}function M(e,t,i){if(!(M.TYPED_ARRAY_SUPPORT||this instanceof M))return new M(e,t,i);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return I(this,e)}return T(this,e,t,i)}function T(e,t,i,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,i,n){if(t.byteLength,i<0||t.byteLength<i)throw new RangeError("'offset' is out of bounds");if(t.byteLength<i+(n||0))throw new RangeError("'length' is out of bounds");return t=void 0===i&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,i):new Uint8Array(t,i,n),M.TYPED_ARRAY_SUPPORT?(e=t).__proto__=M.prototype:e=R(e,t),e}(e,t,i,n):"string"==typeof t?function(e,t,i){if("string"==typeof i&&""!==i||(i="utf8"),!M.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var n=0|_(t,i),s=(e=A(e,n)).write(t,i);return s!==n&&(e=e.slice(0,s)),e}(e,t,i):function(e,t){if(P(t)){var i=0|k(t.length);return 0===(e=A(e,i)).length||t.copy(e,0,0,i),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?A(e,0):R(e,t);if("Buffer"===t.type&&x(t.data))return R(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function D(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function I(e,t){if(D(t),e=A(e,t<0?0:0|k(t)),!M.TYPED_ARRAY_SUPPORT)for(var i=0;i<t;++i)e[i]=0;return e}function R(e,t){var i=t.length<0?0:0|k(t.length);e=A(e,i);for(var n=0;n<i;n+=1)e[n]=255&t[n];return e}function k(e){if(e>=E())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+E().toString(16)+" bytes");return 0|e}function P(e){return!(null==e||!e._isBuffer)}function _(e,t){if(P(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var i=e.length;if(0===i)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return oe(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return ae(e).length;default:if(n)return oe(e).length;t=(""+t).toLowerCase(),n=!0}}function L(e,t,i){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return q(this,t,i);case"utf8":case"utf-8":return j(this,t,i);case"ascii":return K(this,t,i);case"latin1":case"binary":return Y(this,t,i);case"base64":return W(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return X(this,t,i);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function N(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function O(e,t,i,n,s){if(0===e.length)return-1;if("string"==typeof i?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=s?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(s)return-1;i=e.length-1}else if(i<0){if(!s)return-1;i=0}if("string"==typeof t&&(t=M.from(t,n)),P(t))return 0===t.length?-1:F(e,t,i,n,s);if("number"==typeof t)return t&=255,M.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?s?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):F(e,[t],i,n,s);throw new TypeError("val must be string, number or Buffer")}function F(e,t,i,n,s){var r,o=1,a=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,a/=2,l/=2,i/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(s){var h=-1;for(r=i;r<a;r++)if(c(e,r)===c(t,-1===h?0:r-h)){if(-1===h&&(h=r),r-h+1===l)return h*o}else-1!==h&&(r-=r-h),h=-1}else for(i+l>a&&(i=a-l),r=i;r>=0;r--){for(var u=!0,d=0;d<l;d++)if(c(e,r+d)!==c(t,d)){u=!1;break}if(u)return r}return-1}function G(e,t,i,n){i=Number(i)||0;var s=e.length-i;n?(n=Number(n))>s&&(n=s):n=s;var r=t.length;if(r%2!=0)throw new TypeError("Invalid hex string");n>r/2&&(n=r/2);for(var o=0;o<n;++o){var a=parseInt(t.substr(2*o,2),16);if(isNaN(a))return o;e[i+o]=a}return o}function B(e,t,i,n){return le(oe(t,e.length-i),e,i,n)}function V(e,t,i,n){return le(function(e){for(var t=[],i=0;i<e.length;++i)t.push(255&e.charCodeAt(i));return t}(t),e,i,n)}function H(e,t,i,n){return V(e,t,i,n)}function U(e,t,i,n){return le(ae(t),e,i,n)}function z(e,t,i,n){return le(function(e,t){for(var i,n,s,r=[],o=0;o<e.length&&!((t-=2)<0);++o)n=(i=e.charCodeAt(o))>>8,s=i%256,r.push(s),r.push(n);return r}(t,e.length-i),e,i,n)}function W(e,t,i){return 0===t&&i===e.length?b(e):b(e.slice(t,i))}function j(e,t,i){i=Math.min(e.length,i);for(var n=[],s=t;s<i;){var r,o,a,l,c=e[s],h=null,u=c>239?4:c>223?3:c>191?2:1;if(s+u<=i)switch(u){case 1:c<128&&(h=c);break;case 2:128==(192&(r=e[s+1]))&&(l=(31&c)<<6|63&r)>127&&(h=l);break;case 3:r=e[s+1],o=e[s+2],128==(192&r)&&128==(192&o)&&(l=(15&c)<<12|(63&r)<<6|63&o)>2047&&(l<55296||l>57343)&&(h=l);break;case 4:r=e[s+1],o=e[s+2],a=e[s+3],128==(192&r)&&128==(192&o)&&128==(192&a)&&(l=(15&c)<<18|(63&r)<<12|(63&o)<<6|63&a)>65535&&l<1114112&&(h=l)}null===h?(h=65533,u=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),s+=u}return function(e){var t=e.length;if(t<=$)return String.fromCharCode.apply(String,e);for(var i="",n=0;n<t;)i+=String.fromCharCode.apply(String,e.slice(n,n+=$));return i}(n)}M.TYPED_ARRAY_SUPPORT=void 0===u.TYPED_ARRAY_SUPPORT||u.TYPED_ARRAY_SUPPORT,E(),M.poolSize=8192,M._augment=function(e){return e.__proto__=M.prototype,e},M.from=function(e,t,i){return T(null,e,t,i)},M.TYPED_ARRAY_SUPPORT&&(M.prototype.__proto__=Uint8Array.prototype,M.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&M[Symbol.species]),M.alloc=function(e,t,i){return function(e,t,i,n){return D(t),t<=0?A(e,t):void 0!==i?"string"==typeof n?A(e,t).fill(i,n):A(e,t).fill(i):A(e,t)}(null,e,t,i)},M.allocUnsafe=function(e){return I(null,e)},M.allocUnsafeSlow=function(e){return I(null,e)},M.isBuffer=ce,M.compare=function(e,t){if(!P(e)||!P(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var i=e.length,n=t.length,s=0,r=Math.min(i,n);s<r;++s)if(e[s]!==t[s]){i=e[s],n=t[s];break}return i<n?-1:n<i?1:0},M.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},M.concat=function(e,t){if(!x(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return M.alloc(0);var i;if(void 0===t)for(t=0,i=0;i<e.length;++i)t+=e[i].length;var n=M.allocUnsafe(t),s=0;for(i=0;i<e.length;++i){var r=e[i];if(!P(r))throw new TypeError('"list" argument must be an Array of Buffers');r.copy(n,s),s+=r.length}return n},M.byteLength=_,M.prototype._isBuffer=!0,M.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)N(this,t,t+1);return this},M.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)N(this,t,t+3),N(this,t+1,t+2);return this},M.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)N(this,t,t+7),N(this,t+1,t+6),N(this,t+2,t+5),N(this,t+3,t+4);return this},M.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?j(this,0,e):L.apply(this,arguments)},M.prototype.equals=function(e){if(!P(e))throw new TypeError("Argument must be a Buffer");return this===e||0===M.compare(this,e)},M.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},M.prototype.compare=function(e,t,i,n,s){if(!P(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===i&&(i=e?e.length:0),void 0===n&&(n=0),void 0===s&&(s=this.length),t<0||i>e.length||n<0||s>this.length)throw new RangeError("out of range index");if(n>=s&&t>=i)return 0;if(n>=s)return-1;if(t>=i)return 1;if(this===e)return 0;for(var r=(s>>>=0)-(n>>>=0),o=(i>>>=0)-(t>>>=0),a=Math.min(r,o),l=this.slice(n,s),c=e.slice(t,i),h=0;h<a;++h)if(l[h]!==c[h]){r=l[h],o=c[h];break}return r<o?-1:o<r?1:0},M.prototype.includes=function(e,t,i){return-1!==this.indexOf(e,t,i)},M.prototype.indexOf=function(e,t,i){return O(this,e,t,i,!0)},M.prototype.lastIndexOf=function(e,t,i){return O(this,e,t,i,!1)},M.prototype.write=function(e,t,i,n){if(void 0===t)n="utf8",i=this.length,t=0;else if(void 0===i&&"string"==typeof t)n=t,i=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(i)?(i|=0,void 0===n&&(n="utf8")):(n=i,i=void 0)}var s=this.length-t;if((void 0===i||i>s)&&(i=s),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var r=!1;;)switch(n){case"hex":return G(this,e,t,i);case"utf8":case"utf-8":return B(this,e,t,i);case"ascii":return V(this,e,t,i);case"latin1":case"binary":return H(this,e,t,i);case"base64":return U(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z(this,e,t,i);default:if(r)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),r=!0}},M.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var $=4096;function K(e,t,i){var n="";i=Math.min(e.length,i);for(var s=t;s<i;++s)n+=String.fromCharCode(127&e[s]);return n}function Y(e,t,i){var n="";i=Math.min(e.length,i);for(var s=t;s<i;++s)n+=String.fromCharCode(e[s]);return n}function q(e,t,i){var n=e.length;(!t||t<0)&&(t=0),(!i||i<0||i>n)&&(i=n);for(var s="",r=t;r<i;++r)s+=re(e[r]);return s}function X(e,t,i){for(var n=e.slice(t,i),s="",r=0;r<n.length;r+=2)s+=String.fromCharCode(n[r]+256*n[r+1]);return s}function Z(e,t,i){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>i)throw new RangeError("Trying to access beyond buffer length")}function Q(e,t,i,n,s,r){if(!P(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>s||t<r)throw new RangeError('"value" argument is out of bounds');if(i+n>e.length)throw new RangeError("Index out of range")}function J(e,t,i,n){t<0&&(t=65535+t+1);for(var s=0,r=Math.min(e.length-i,2);s<r;++s)e[i+s]=(t&255<<8*(n?s:1-s))>>>8*(n?s:1-s)}function ee(e,t,i,n){t<0&&(t=4294967295+t+1);for(var s=0,r=Math.min(e.length-i,4);s<r;++s)e[i+s]=t>>>8*(n?s:3-s)&255}function te(e,t,i,n,s,r){if(i+n>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function ie(e,t,i,n,s){return s||te(e,0,i,4),w(e,t,i,n,23,4),i+4}function ne(e,t,i,n,s){return s||te(e,0,i,8),w(e,t,i,n,52,8),i+8}M.prototype.slice=function(e,t){var i,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),M.TYPED_ARRAY_SUPPORT)(i=this.subarray(e,t)).__proto__=M.prototype;else{var s=t-e;i=new M(s,void 0);for(var r=0;r<s;++r)i[r]=this[r+e]}return i},M.prototype.readUIntLE=function(e,t,i){e|=0,t|=0,i||Z(e,t,this.length);for(var n=this[e],s=1,r=0;++r<t&&(s*=256);)n+=this[e+r]*s;return n},M.prototype.readUIntBE=function(e,t,i){e|=0,t|=0,i||Z(e,t,this.length);for(var n=this[e+--t],s=1;t>0&&(s*=256);)n+=this[e+--t]*s;return n},M.prototype.readUInt8=function(e,t){return t||Z(e,1,this.length),this[e]},M.prototype.readUInt16LE=function(e,t){return t||Z(e,2,this.length),this[e]|this[e+1]<<8},M.prototype.readUInt16BE=function(e,t){return t||Z(e,2,this.length),this[e]<<8|this[e+1]},M.prototype.readUInt32LE=function(e,t){return t||Z(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},M.prototype.readUInt32BE=function(e,t){return t||Z(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},M.prototype.readIntLE=function(e,t,i){e|=0,t|=0,i||Z(e,t,this.length);for(var n=this[e],s=1,r=0;++r<t&&(s*=256);)n+=this[e+r]*s;return n>=(s*=128)&&(n-=Math.pow(2,8*t)),n},M.prototype.readIntBE=function(e,t,i){e|=0,t|=0,i||Z(e,t,this.length);for(var n=t,s=1,r=this[e+--n];n>0&&(s*=256);)r+=this[e+--n]*s;return r>=(s*=128)&&(r-=Math.pow(2,8*t)),r},M.prototype.readInt8=function(e,t){return t||Z(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},M.prototype.readInt16LE=function(e,t){t||Z(e,2,this.length);var i=this[e]|this[e+1]<<8;return 32768&i?4294901760|i:i},M.prototype.readInt16BE=function(e,t){t||Z(e,2,this.length);var i=this[e+1]|this[e]<<8;return 32768&i?4294901760|i:i},M.prototype.readInt32LE=function(e,t){return t||Z(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},M.prototype.readInt32BE=function(e,t){return t||Z(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},M.prototype.readFloatLE=function(e,t){return t||Z(e,4,this.length),C(this,e,!0,23,4)},M.prototype.readFloatBE=function(e,t){return t||Z(e,4,this.length),C(this,e,!1,23,4)},M.prototype.readDoubleLE=function(e,t){return t||Z(e,8,this.length),C(this,e,!0,52,8)},M.prototype.readDoubleBE=function(e,t){return t||Z(e,8,this.length),C(this,e,!1,52,8)},M.prototype.writeUIntLE=function(e,t,i,n){e=+e,t|=0,i|=0,n||Q(this,e,t,i,Math.pow(2,8*i)-1,0);var s=1,r=0;for(this[t]=255&e;++r<i&&(s*=256);)this[t+r]=e/s&255;return t+i},M.prototype.writeUIntBE=function(e,t,i,n){e=+e,t|=0,i|=0,n||Q(this,e,t,i,Math.pow(2,8*i)-1,0);var s=i-1,r=1;for(this[t+s]=255&e;--s>=0&&(r*=256);)this[t+s]=e/r&255;return t+i},M.prototype.writeUInt8=function(e,t,i){return e=+e,t|=0,i||Q(this,e,t,1,255,0),M.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},M.prototype.writeUInt16LE=function(e,t,i){return e=+e,t|=0,i||Q(this,e,t,2,65535,0),M.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):J(this,e,t,!0),t+2},M.prototype.writeUInt16BE=function(e,t,i){return e=+e,t|=0,i||Q(this,e,t,2,65535,0),M.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):J(this,e,t,!1),t+2},M.prototype.writeUInt32LE=function(e,t,i){return e=+e,t|=0,i||Q(this,e,t,4,4294967295,0),M.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):ee(this,e,t,!0),t+4},M.prototype.writeUInt32BE=function(e,t,i){return e=+e,t|=0,i||Q(this,e,t,4,4294967295,0),M.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):ee(this,e,t,!1),t+4},M.prototype.writeIntLE=function(e,t,i,n){if(e=+e,t|=0,!n){var s=Math.pow(2,8*i-1);Q(this,e,t,i,s-1,-s)}var r=0,o=1,a=0;for(this[t]=255&e;++r<i&&(o*=256);)e<0&&0===a&&0!==this[t+r-1]&&(a=1),this[t+r]=(e/o|0)-a&255;return t+i},M.prototype.writeIntBE=function(e,t,i,n){if(e=+e,t|=0,!n){var s=Math.pow(2,8*i-1);Q(this,e,t,i,s-1,-s)}var r=i-1,o=1,a=0;for(this[t+r]=255&e;--r>=0&&(o*=256);)e<0&&0===a&&0!==this[t+r+1]&&(a=1),this[t+r]=(e/o|0)-a&255;return t+i},M.prototype.writeInt8=function(e,t,i){return e=+e,t|=0,i||Q(this,e,t,1,127,-128),M.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},M.prototype.writeInt16LE=function(e,t,i){return e=+e,t|=0,i||Q(this,e,t,2,32767,-32768),M.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):J(this,e,t,!0),t+2},M.prototype.writeInt16BE=function(e,t,i){return e=+e,t|=0,i||Q(this,e,t,2,32767,-32768),M.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):J(this,e,t,!1),t+2},M.prototype.writeInt32LE=function(e,t,i){return e=+e,t|=0,i||Q(this,e,t,4,2147483647,-2147483648),M.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):ee(this,e,t,!0),t+4},M.prototype.writeInt32BE=function(e,t,i){return e=+e,t|=0,i||Q(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),M.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):ee(this,e,t,!1),t+4},M.prototype.writeFloatLE=function(e,t,i){return ie(this,e,t,!0,i)},M.prototype.writeFloatBE=function(e,t,i){return ie(this,e,t,!1,i)},M.prototype.writeDoubleLE=function(e,t,i){return ne(this,e,t,!0,i)},M.prototype.writeDoubleBE=function(e,t,i){return ne(this,e,t,!1,i)},M.prototype.copy=function(e,t,i,n){if(i||(i=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<i&&(n=i),n===i)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-i&&(n=e.length-t+i);var s,r=n-i;if(this===e&&i<t&&t<n)for(s=r-1;s>=0;--s)e[s+t]=this[s+i];else if(r<1e3||!M.TYPED_ARRAY_SUPPORT)for(s=0;s<r;++s)e[s+t]=this[s+i];else Uint8Array.prototype.set.call(e,this.subarray(i,i+r),t);return r},M.prototype.fill=function(e,t,i,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,i=this.length):"string"==typeof i&&(n=i,i=this.length),1===e.length){var s=e.charCodeAt(0);s<256&&(e=s)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!M.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;var r;if(t>>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"==typeof e)for(r=t;r<i;++r)this[r]=e;else{var o=P(e)?e:oe(new M(e,n).toString()),a=o.length;for(r=0;r<i-t;++r)this[r+t]=o[r%a]}return this};var se=/[^+\/0-9A-Za-z-_]/g;function re(e){return e<16?"0"+e.toString(16):e.toString(16)}function oe(e,t){var i;t=t||1/0;for(var n=e.length,s=null,r=[],o=0;o<n;++o){if((i=e.charCodeAt(o))>55295&&i<57344){if(!s){if(i>56319){(t-=3)>-1&&r.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&r.push(239,191,189);continue}s=i;continue}if(i<56320){(t-=3)>-1&&r.push(239,191,189),s=i;continue}i=65536+(s-55296<<10|i-56320)}else s&&(t-=3)>-1&&r.push(239,191,189);if(s=null,i<128){if((t-=1)<0)break;r.push(i)}else if(i<2048){if((t-=2)<0)break;r.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;r.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;r.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return r}function ae(e){return function(e){var t,i,n,s,r,o;f||m();var a=e.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");r="="===e[a-2]?2:"="===e[a-1]?1:0,o=new g(3*a/4-r),n=r>0?a-4:a;var l=0;for(t=0,i=0;t<n;t+=4,i+=3)s=p[e.charCodeAt(t)]<<18|p[e.charCodeAt(t+1)]<<12|p[e.charCodeAt(t+2)]<<6|p[e.charCodeAt(t+3)],o[l++]=s>>16&255,o[l++]=s>>8&255,o[l++]=255&s;return 2===r?(s=p[e.charCodeAt(t)]<<2|p[e.charCodeAt(t+1)]>>4,o[l++]=255&s):1===r&&(s=p[e.charCodeAt(t)]<<10|p[e.charCodeAt(t+1)]<<4|p[e.charCodeAt(t+2)]>>2,o[l++]=s>>8&255,o[l++]=255&s),o}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(se,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function le(e,t,i,n){for(var s=0;s<n&&!(s+i>=t.length||s>=e.length);++s)t[s+i]=e[s];return s}function ce(e){return null!=e&&(!!e._isBuffer||he(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&he(e.slice(0,0))}(e))}function he(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function ue(){throw new Error("setTimeout has not been defined")}function de(){throw new Error("clearTimeout has not been defined")}var pe=ue,ge=de;function fe(e){if(pe===setTimeout)return setTimeout(e,0);if((pe===ue||!pe)&&setTimeout)return pe=setTimeout,setTimeout(e,0);try{return pe(e,0)}catch(t){try{return pe.call(null,e,0)}catch(t){return pe.call(this,e,0)}}}"function"==typeof u.setTimeout&&(pe=setTimeout),"function"==typeof u.clearTimeout&&(ge=clearTimeout);var me,ye=[],ve=!1,be=-1;function Ce(){ve&&me&&(ve=!1,me.length?ye=me.concat(ye):be=-1,ye.length&&we())}function we(){if(!ve){var e=fe(Ce);ve=!0;for(var t=ye.length;t;){for(me=ye,ye=[];++be<t;)me&&me[be].run();be=-1,t=ye.length}me=null,ve=!1,function(e){if(ge===clearTimeout)return clearTimeout(e);if((ge===de||!ge)&&clearTimeout)return ge=clearTimeout,clearTimeout(e);try{return ge(e)}catch(t){try{return ge.call(null,e)}catch(t){return ge.call(this,e)}}}(e)}}function Se(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)t[i-1]=arguments[i];ye.push(new xe(e,t)),1!==ye.length||ve||fe(we)}function xe(e,t){this.fun=e,this.array=t}xe.prototype.run=function(){this.fun.apply(null,this.array)};var Ee=u.performance||{};Ee.now||Ee.mozNow||Ee.msNow||Ee.oNow||Ee.webkitNow;var Ae={env:{}},Me="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e},Te=/%[sdj%]/g;function De(e){if(!Ve(e)){for(var t=[],i=0;i<arguments.length;i++)t.push(Pe(arguments[i]));return t.join(" ")}i=1;for(var n=arguments,s=n.length,r=String(e).replace(Te,function(e){if("%%"===e)return"%";if(i>=s)return e;switch(e){case"%s":return String(n[i++]);case"%d":return Number(n[i++]);case"%j":try{return JSON.stringify(n[i++])}catch(e){return"[Circular]"}default:return e}}),o=n[i];i<s;o=n[++i])Be(o)||!ze(o)?r+=" "+o:r+=" "+Pe(o);return r}function Ie(e,t){if(He(u.process))return function(){return Ie(e,t).apply(this,arguments)};if(!0===Ae.noDeprecation)return e;var i=!1;return function(){if(!i){if(Ae.throwDeprecation)throw new Error(t);Ae.traceDeprecation?console.trace(t):console.error(t),i=!0}return e.apply(this,arguments)}}var Re,ke={};function Pe(e,t){var i={seen:[],stylize:Le};return arguments.length>=3&&(i.depth=arguments[2]),arguments.length>=4&&(i.colors=arguments[3]),Ge(t)?i.showHidden=t:t&&function(e,t){if(!t||!ze(t))return e;for(var i=Object.keys(t),n=i.length;n--;)e[i[n]]=t[i[n]]}(i,t),He(i.showHidden)&&(i.showHidden=!1),He(i.depth)&&(i.depth=2),He(i.colors)&&(i.colors=!1),He(i.customInspect)&&(i.customInspect=!0),i.colors&&(i.stylize=_e),Ne(i,e,i.depth)}function _e(e,t){var i=Pe.styles[t];return i?"["+Pe.colors[i][0]+"m"+e+"["+Pe.colors[i][1]+"m":e}function Le(e,t){return e}function Ne(e,t,i){if(e.customInspect&&t&&$e(t.inspect)&&t.inspect!==Pe&&(!t.constructor||t.constructor.prototype!==t)){var n=t.inspect(i,e);return Ve(n)||(n=Ne(e,n,i)),n}var s=function(e,t){if(He(t))return e.stylize("undefined","undefined");if(Ve(t)){var i="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(i,"string")}return"number"==typeof t?e.stylize(""+t,"number"):Ge(t)?e.stylize(""+t,"boolean"):Be(t)?e.stylize("null","null"):void 0}(e,t);if(s)return s;var r=Object.keys(t),o=function(e){var t={};return e.forEach(function(e,i){t[e]=!0}),t}(r);if(e.showHidden&&(r=Object.getOwnPropertyNames(t)),je(t)&&(r.indexOf("message")>=0||r.indexOf("description")>=0))return Oe(t);if(0===r.length){if($e(t)){var a=t.name?": "+t.name:"";return e.stylize("[Function"+a+"]","special")}if(Ue(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(We(t))return e.stylize(Date.prototype.toString.call(t),"date");if(je(t))return Oe(t)}var l,c,h="",u=!1,d=["{","}"];return l=t,Array.isArray(l)&&(u=!0,d=["[","]"]),$e(t)&&(h=" [Function"+(t.name?": "+t.name:"")+"]"),Ue(t)&&(h=" "+RegExp.prototype.toString.call(t)),We(t)&&(h=" "+Date.prototype.toUTCString.call(t)),je(t)&&(h=" "+Oe(t)),0!==r.length||u&&0!=t.length?i<0?Ue(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),c=u?function(e,t,i,n,s){for(var r=[],o=0,a=t.length;o<a;++o)Ye(t,String(o))?r.push(Fe(e,t,i,n,String(o),!0)):r.push("");return s.forEach(function(s){s.match(/^\d+$/)||r.push(Fe(e,t,i,n,s,!0))}),r}(e,t,i,o,r):r.map(function(n){return Fe(e,t,i,o,n,u)}),e.seen.pop(),function(e,t,i){return e.reduce(function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?i[0]+(""===t?"":t+"\n ")+" "+e.join(",\n  ")+" "+i[1]:i[0]+t+" "+e.join(", ")+" "+i[1]}(c,h,d)):d[0]+h+d[1]}function Oe(e){return"["+Error.prototype.toString.call(e)+"]"}function Fe(e,t,i,n,s,r){var o,a,l;if((l=Object.getOwnPropertyDescriptor(t,s)||{value:t[s]}).get?a=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(a=e.stylize("[Setter]","special")),Ye(n,s)||(o="["+s+"]"),a||(e.seen.indexOf(l.value)<0?(a=Be(i)?Ne(e,l.value,null):Ne(e,l.value,i-1)).indexOf("\n")>-1&&(a=r?a.split("\n").map(function(e){return"  "+e}).join("\n").substr(2):"\n"+a.split("\n").map(function(e){return"   "+e}).join("\n")):a=e.stylize("[Circular]","special")),He(o)){if(r&&s.match(/^\d+$/))return a;(o=JSON.stringify(""+s)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+a}function Ge(e){return"boolean"==typeof e}function Be(e){return null===e}function Ve(e){return"string"==typeof e}function He(e){return void 0===e}function Ue(e){return ze(e)&&"[object RegExp]"===Ke(e)}function ze(e){return"object"==typeof e&&null!==e}function We(e){return ze(e)&&"[object Date]"===Ke(e)}function je(e){return ze(e)&&("[object Error]"===Ke(e)||e instanceof Error)}function $e(e){return"function"==typeof e}function Ke(e){return Object.prototype.toString.call(e)}function Ye(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function qe(){this.head=null,this.tail=null,this.length=0}Pe.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},Pe.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},qe.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},qe.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},qe.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},qe.prototype.clear=function(){this.head=this.tail=null,this.length=0},qe.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,i=""+t.data;t=t.next;)i+=e+t.data;return i},qe.prototype.concat=function(e){if(0===this.length)return M.alloc(0);if(1===this.length)return this.head.data;for(var t=M.allocUnsafe(e>>>0),i=this.head,n=0;i;)i.data.copy(t,n),n+=i.data.length,i=i.next;return t};var Xe=M.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Ze(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!Xe(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=Je;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=et;break;default:return void(this.write=Qe)}this.charBuffer=new M(6),this.charReceived=0,this.charLength=0}function Qe(e){return e.toString(this.encoding)}function Je(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function et(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}Ze.prototype.write=function(e){for(var t="";this.charLength;){var i=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,i),this.charReceived+=i,this.charReceived<this.charLength)return"";if(e=e.slice(i,e.length),!((n=(t=this.charBuffer.slice(0,this.charLength).toString(this.encoding)).charCodeAt(t.length-1))>=55296&&n<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var n,s=e.length;if(this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,s),s-=this.charReceived),s=(t+=e.toString(this.encoding,0,s)).length-1,(n=t.charCodeAt(s))>=55296&&n<=56319){var r=this.surrogateSize;return this.charLength+=r,this.charReceived+=r,this.charBuffer.copy(this.charBuffer,r,0,r),e.copy(this.charBuffer,0,0,r),t.substring(0,s)}return t},Ze.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var i=e[e.length-t];if(1==t&&i>>5==6){this.charLength=2;break}if(t<=2&&i>>4==14){this.charLength=3;break}if(t<=3&&i>>3==30){this.charLength=4;break}}this.charReceived=t},Ze.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var i=this.charReceived,n=this.charBuffer,s=this.encoding;t+=n.slice(0,i).toString(s)}return t},st.ReadableState=nt;var tt,it=(tt="stream",He(Re)&&(Re=Ae.env.NODE_DEBUG||""),tt=tt.toUpperCase(),ke[tt]||(new RegExp("\\b"+tt+"\\b","i").test(Re)?ke[tt]=function(){var e=De.apply(null,arguments);console.error("%s %d: %s",tt,0,e)}:ke[tt]=function(){}),ke[tt]);function nt(e,t){e=e||{},this.objectMode=!!e.objectMode,t instanceof Pt&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,n=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n,this.highWaterMark=~~this.highWaterMark,this.buffer=new qe,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(this.decoder=new Ze(e.encoding),this.encoding=e.encoding)}function st(e){if(!(this instanceof st))return new st(e);this._readableState=new nt(e,this),this.readable=!0,e&&"function"==typeof e.read&&(this._read=e.read),r.call(this)}function rt(e,t,i,n,s){var r=function(e,t){var i=null;return ce(t)||"string"==typeof t||null==t||e.objectMode||(i=new TypeError("Invalid non-string/buffer chunk")),i}(t,i);if(r)e.emit("error",r);else if(null===i)t.reading=!1,function(e,t){if(!t.ended){if(t.decoder){var i=t.decoder.end();i&&i.length&&(t.buffer.push(i),t.length+=t.objectMode?1:i.length)}t.ended=!0,lt(e)}}(e,t);else if(t.objectMode||i&&i.length>0)if(t.ended&&!s){var o=new Error("stream.push() after EOF");e.emit("error",o)}else if(t.endEmitted&&s){var a=new Error("stream.unshift() after end event");e.emit("error",a)}else{var l;!t.decoder||s||n||(i=t.decoder.write(i),l=!t.objectMode&&0===i.length),s||(t.reading=!1),l||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",i),e.read(0)):(t.length+=t.objectMode?1:i.length,s?t.buffer.unshift(i):t.buffer.push(i),t.needReadable&&lt(e))),function(e,t){t.readingMore||(t.readingMore=!0,Se(ht,e,t))}(e,t)}else s||(t.reading=!1);return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(t)}Me(st,r),st.prototype.push=function(e,t){var i=this._readableState;return i.objectMode||"string"!=typeof e||(t=t||i.defaultEncoding)!==i.encoding&&(e=M.from(e,t),t=""),rt(this,i,e,t,!1)},st.prototype.unshift=function(e){return rt(this,this._readableState,e,"",!0)},st.prototype.isPaused=function(){return!1===this._readableState.flowing},st.prototype.setEncoding=function(e){return this._readableState.decoder=new Ze(e),this._readableState.encoding=e,this};var ot=8388608;function at(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=ot?e=ot:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function lt(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(it("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?Se(ct,e):ct(e))}function ct(e){it("emit readable"),e.emit("readable"),pt(e)}function ht(e,t){for(var i=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(it("maybeReadMore read 0"),e.read(0),i!==t.length);)i=t.length;t.readingMore=!1}function ut(e){it("readable nexttick read 0"),e.read(0)}function dt(e,t){t.reading||(it("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),pt(e),t.flowing&&!t.reading&&e.read(0)}function pt(e){var t=e._readableState;for(it("flow",t.flowing);t.flowing&&null!==e.read(););}function gt(e,t){return 0===t.length?null:(t.objectMode?i=t.buffer.shift():!e||e>=t.length?(i=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):i=function(e,t,i){var n;return e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):n=e===t.head.data.length?t.shift():i?function(e,t){var i=t.head,n=1,s=i.data;for(e-=s.length;i=i.next;){var r=i.data,o=e>r.length?r.length:e;if(o===r.length?s+=r:s+=r.slice(0,e),0===(e-=o)){o===r.length?(++n,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i,i.data=r.slice(o));break}++n}return t.length-=n,s}(e,t):function(e,t){var i=M.allocUnsafe(e),n=t.head,s=1;for(n.data.copy(i),e-=n.data.length;n=n.next;){var r=n.data,o=e>r.length?r.length:e;if(r.copy(i,i.length-e,0,o),0===(e-=o)){o===r.length?(++s,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=r.slice(o));break}++s}return t.length-=s,i}(e,t),n}(e,t.buffer,t.decoder),i);var i}function ft(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,Se(mt,t,e))}function mt(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function yt(e,t){for(var i=0,n=e.length;i<n;i++)if(e[i]===t)return i;return-1}function vt(){}function bt(e,t,i){this.chunk=e,this.encoding=t,this.callback=i,this.next=null}function Ct(e,t){Object.defineProperty(this,"buffer",{get:Ie(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")}),e=e||{},this.objectMode=!!e.objectMode,t instanceof Pt&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,n=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var s=!1===e.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var i=e._writableState,n=i.sync,s=i.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(i),t)!function(e,t,i,n,s){--t.pendingcb,i?Se(s,n):s(n),e._writableState.errorEmitted=!0,e.emit("error",n)}(e,i,n,t,s);else{var r=At(i);r||i.corked||i.bufferProcessing||!i.bufferedRequest||Et(e,i),n?Se(xt,e,i,r,s):xt(e,i,r,s)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new Dt(this)}function wt(e){if(!(this instanceof wt||this instanceof Pt))return new wt(e);this._writableState=new Ct(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev)),r.call(this)}function St(e,t,i,n,s,r,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,i?e._writev(s,t.onwrite):e._write(s,r,t.onwrite),t.sync=!1}function xt(e,t,i,n){i||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),Tt(e,t)}function Et(e,t){t.bufferProcessing=!0;var i=t.bufferedRequest;if(e._writev&&i&&i.next){var n=t.bufferedRequestCount,s=new Array(n),r=t.corkedRequestsFree;r.entry=i;for(var o=0;i;)s[o]=i,i=i.next,o+=1;St(e,t,!0,t.length,s,"",r.finish),t.pendingcb++,t.lastBufferedRequest=null,r.next?(t.corkedRequestsFree=r.next,r.next=null):t.corkedRequestsFree=new Dt(t)}else{for(;i;){var a=i.chunk,l=i.encoding,c=i.callback;if(St(e,t,!1,t.objectMode?1:a.length,a,l,c),i=i.next,t.writing)break}null===i&&(t.lastBufferedRequest=null)}t.bufferedRequestCount=0,t.bufferedRequest=i,t.bufferProcessing=!1}function At(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function Mt(e,t){t.prefinished||(t.prefinished=!0,e.emit("prefinish"))}function Tt(e,t){var i=At(t);return i&&(0===t.pendingcb?(Mt(e,t),t.finished=!0,e.emit("finish")):Mt(e,t)),i}function Dt(e){var t=this;this.next=null,this.entry=null,this.finish=function(i){var n=t.entry;for(t.entry=null;n;){var s=n.callback;e.pendingcb--,s(i),n=n.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}}st.prototype.read=function(e){it("read",e),e=parseInt(e,10);var t=this._readableState,i=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return it("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?ft(this):lt(this),null;if(0===(e=at(e,t))&&t.ended)return 0===t.length&&ft(this),null;var n,s=t.needReadable;return it("need readable",s),(0===t.length||t.length-e<t.highWaterMark)&&it("length less than watermark",s=!0),t.ended||t.reading?it("reading or ended",s=!1):s&&(it("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=at(i,t))),null===(n=e>0?gt(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),i!==e&&t.ended&&ft(this)),null!==n&&this.emit("data",n),n},st.prototype._read=function(e){this.emit("error",new Error("not implemented"))},st.prototype.pipe=function(e,t){var i=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,it("pipe count=%d opts=%j",n.pipesCount,t);var s=t&&!1===t.end?c:o;function r(e){it("onunpipe"),e===i&&c()}function o(){it("onend"),e.end()}n.endEmitted?Se(s):i.once("end",s),e.on("unpipe",r);var a=function(e){return function(){var t=e._readableState;it("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&e.listeners("data").length&&(t.flowing=!0,pt(e))}}(i);e.on("drain",a);var l=!1;function c(){it("cleanup"),e.removeListener("close",p),e.removeListener("finish",g),e.removeListener("drain",a),e.removeListener("error",d),e.removeListener("unpipe",r),i.removeListener("end",o),i.removeListener("end",c),i.removeListener("data",u),l=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||a()}var h=!1;function u(t){it("ondata"),h=!1,!1!==e.write(t)||h||((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==yt(n.pipes,e))&&!l&&(it("false write response, pause",i._readableState.awaitDrain),i._readableState.awaitDrain++,h=!0),i.pause())}function d(t){it("onerror",t),f(),e.removeListener("error",d),0===e.listeners("error").length&&e.emit("error",t)}function p(){e.removeListener("finish",g),f()}function g(){it("onfinish"),e.removeListener("close",p),f()}function f(){it("unpipe"),i.unpipe(e)}return i.on("data",u),function(e,t,i){if("function"==typeof e.prependListener)return e.prependListener(t,i);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(i):e._events[t]=[i,e._events[t]]:e.on(t,i)}(e,"error",d),e.once("close",p),e.once("finish",g),e.emit("pipe",i),n.flowing||(it("pipe resume"),i.resume()),e},st.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this)),this;if(!e){var i=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var s=0;s<n;s++)i[s].emit("unpipe",this);return this}var r=yt(t.pipes,e);return-1===r||(t.pipes.splice(r,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this)),this},st.prototype.on=function(e,t){var i=r.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var n=this._readableState;n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&lt(this):Se(ut,this))}return i},st.prototype.addListener=st.prototype.on,st.prototype.resume=function(){var e=this._readableState;return e.flowing||(it("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,Se(dt,e,t))}(this,e)),this},st.prototype.pause=function(){return it("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(it("pause"),this._readableState.flowing=!1,this.emit("pause")),this},st.prototype.wrap=function(e){var t=this._readableState,i=!1,n=this;for(var s in e.on("end",function(){if(it("wrapped end"),t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&n.push(e)}n.push(null)}),e.on("data",function(s){it("wrapped data"),t.decoder&&(s=t.decoder.write(s)),t.objectMode&&null==s||(t.objectMode||s&&s.length)&&(n.push(s)||(i=!0,e.pause()))}),e)void 0===this[s]&&"function"==typeof e[s]&&(this[s]=function(t){return function(){return e[t].apply(e,arguments)}}(s));return function(e,t){for(var i=0,n=e.length;i<n;i++)t(e[i])}(["error","close","destroy","pause","resume"],function(t){e.on(t,n.emit.bind(n,t))}),n._read=function(t){it("wrapped _read",t),i&&(i=!1,e.resume())},n},st._fromList=gt,wt.WritableState=Ct,Me(wt,r),Ct.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},wt.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},wt.prototype.write=function(e,t,i){var n=this._writableState,s=!1;return"function"==typeof t&&(i=t,t=null),M.isBuffer(e)?t="buffer":t||(t=n.defaultEncoding),"function"!=typeof i&&(i=vt),n.ended?function(e,t){var i=new Error("write after end");e.emit("error",i),Se(t,i)}(this,i):function(e,t,i,n){var s=!0,r=!1;return null===i?r=new TypeError("May not write null values to stream"):M.isBuffer(i)||"string"==typeof i||void 0===i||t.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r&&(e.emit("error",r),Se(n,r),s=!1),s}(this,n,e,i)&&(n.pendingcb++,s=function(e,t,i,n,s){i=function(e,t,i){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=M.from(t,i)),t}(t,i,n),M.isBuffer(i)&&(n="buffer");var r=t.objectMode?1:i.length;t.length+=r;var o=t.length<t.highWaterMark;if(o||(t.needDrain=!0),t.writing||t.corked){var a=t.lastBufferedRequest;t.lastBufferedRequest=new bt(i,n,s),a?a.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else St(e,t,!1,r,i,n,s);return o}(this,n,e,t,i)),s},wt.prototype.cork=function(){this._writableState.corked++},wt.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||Et(this,e))},wt.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},wt.prototype._write=function(e,t,i){i(new Error("not implemented"))},wt.prototype._writev=null,wt.prototype.end=function(e,t,i){var n=this._writableState;"function"==typeof e?(i=e,e=null,t=null):"function"==typeof t&&(i=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,i){t.ending=!0,Tt(e,t),i&&(t.finished?Se(i):e.once("finish",i)),t.ended=!0,e.writable=!1}(this,n,i)},Me(Pt,st);for(var It=Object.keys(wt.prototype),Rt=0;Rt<It.length;Rt++){var kt=It[Rt];Pt.prototype[kt]||(Pt.prototype[kt]=wt.prototype[kt])}function Pt(e){if(!(this instanceof Pt))return new Pt(e);st.call(this,e),wt.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",_t)}function _t(){this.allowHalfOpen||this._writableState.ended||Se(Lt,this)}function Lt(e){e.end()}function Nt(e){this.afterTransform=function(t,i){return function(e,t,i){var n=e._transformState;n.transforming=!1;var s=n.writecb;if(!s)return e.emit("error",new Error("no writecb in Transform class"));n.writechunk=null,n.writecb=null,null!=i&&e.push(i),s(t);var r=e._readableState;r.reading=!1,(r.needReadable||r.length<r.highWaterMark)&&e._read(r.highWaterMark)}(e,t,i)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function Ot(e){if(!(this instanceof Ot))return new Ot(e);Pt.call(this,e),this._transformState=new Nt(this);var t=this;this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.once("prefinish",function(){"function"==typeof this._flush?this._flush(function(e){Ft(t,e)}):Ft(t)})}function Ft(e,t){if(t)return e.emit("error",t);var i=e._writableState,n=e._transformState;if(i.length)throw new Error("Calling transform done when ws.length != 0");if(n.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}function Gt(e){if(!(this instanceof Gt))return new Gt(e);Ot.call(this,e)}function Bt(){r.call(this)}Me(Ot,Pt),Ot.prototype.push=function(e,t){return this._transformState.needTransform=!1,Pt.prototype.push.call(this,e,t)},Ot.prototype._transform=function(e,t,i){throw new Error("Not implemented")},Ot.prototype._write=function(e,t,i){var n=this._transformState;if(n.writecb=i,n.writechunk=e,n.writeencoding=t,!n.transforming){var s=this._readableState;(n.needTransform||s.needReadable||s.length<s.highWaterMark)&&this._read(s.highWaterMark)}},Ot.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},Me(Gt,Ot),Gt.prototype._transform=function(e,t,i){i(null,e)},Me(Bt,r),Bt.Readable=st,Bt.Writable=wt,Bt.Duplex=Pt,Bt.Transform=Ot,Bt.PassThrough=Gt,Bt.Stream=Bt,Bt.prototype.pipe=function(e,t){var i=this;function n(t){e.writable&&!1===e.write(t)&&i.pause&&i.pause()}function s(){i.readable&&i.resume&&i.resume()}i.on("data",n),e.on("drain",s),e._isStdio||t&&!1===t.end||(i.on("end",a),i.on("close",l));var o=!1;function a(){o||(o=!0,e.end())}function l(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){if(h(),0===r.listenerCount(this,"error"))throw e}function h(){i.removeListener("data",n),e.removeListener("drain",s),i.removeListener("end",a),i.removeListener("close",l),i.removeListener("error",c),e.removeListener("error",c),i.removeListener("end",h),i.removeListener("close",h),e.removeListener("close",h)}return i.on("error",c),e.on("error",c),i.on("end",h),i.on("close",h),e.on("close",h),e.emit("pipe",i),e};class Vt extends Error{constructor(e,t,...i){Array.isArray(t)&&(t=t.join(" ")),super(t),void 0!==Error.captureStackTrace&&Error.captureStackTrace(this,Vt),this.code=e;for(const e of i)for(const t in e){const i=e[t];this[t]=ce(i)?i.toString():null==i?i:JSON.parse(JSON.stringify(i))}}}const Ht=function(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)},Ut=".".charCodeAt(0),zt=/\\(\\)?/g,Wt=RegExp("[^.[\\]]+|\\[(?:([^\"'][^[]*)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))","g"),jt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$t=/^\w*$/,Kt=function(e){const t=typeof e;return"symbol"===t||"object"===t&&e&&"[object Symbol]"===function(e){return Object.prototype.toString.call(e)}(e)},Yt=function(e){if("string"==typeof e||Kt(e))return e;const t=`${e}`;return"0"==t&&1/e==-INFINITY?"-0":t},qt=function(e,t){let i=0;const n=(t=function(e,t){return Array.isArray(e)?e:function(e,t){if(Array.isArray(e))return!1;const i=typeof e;return!("number"!==i&&"symbol"!==i&&"boolean"!==i&&e&&!Kt(e))||$t.test(e)||!jt.test(e)||null!=t&&e in Object(t)}(e,t)?[e]:function(e){const t=[];return e.charCodeAt(0)===Ut&&t.push(""),e.replace(Wt,function(e,i,n,s){let r=e;n?r=s.replace(zt,"$1"):i&&(r=i.trim()),t.push(r)}),t}(e)}(t,e)).length;for(;null!=e&&i<n;)e=e[Yt(t[i++])];return i&&i===n?e:void 0},Xt=function(e){if(null==e)return[void 0,void 0];if("object"!=typeof e)return[Error('Invalid option "columns": expect an array or an object')];if(Array.isArray(e)){const t=[];for(const i of e)if("string"==typeof i)t.push({key:i,header:i});else{if("object"!=typeof i||null===i||Array.isArray(i))return[Error("Invalid column definition: expect a string or an object")];if(!i.key)return[Error('Invalid column definition: property "key" is required')];void 0===i.header&&(i.header=i.key),t.push(i)}e=t}else{const t=[];for(const i in e)t.push({key:i,header:e[i]});e=t}return[void 0,e]},Zt=function(e){return e.replace(/([A-Z])/g,function(e,t){return"_"+t.toLowerCase()})},Qt=function(e){const t={};for(const i in e)t[Zt(i)]=e[i];if(void 0===t.bom||null===t.bom||!1===t.bom)t.bom=!1;else if(!0!==t.bom)return[new Vt("CSV_OPTION_BOOLEAN_INVALID_TYPE",["option `bom` is optional and must be a boolean value,",`got ${JSON.stringify(t.bom)}`])];if(void 0===t.delimiter||null===t.delimiter)t.delimiter=",";else if(ce(t.delimiter))t.delimiter=t.delimiter.toString();else if("string"!=typeof t.delimiter)return[new Vt("CSV_OPTION_DELIMITER_INVALID_TYPE",["option `delimiter` must be a buffer or a string,",`got ${JSON.stringify(t.delimiter)}`])];if(void 0===t.quote||null===t.quote)t.quote='"';else if(!0===t.quote)t.quote='"';else if(!1===t.quote)t.quote="";else if(ce(t.quote))t.quote=t.quote.toString();else if("string"!=typeof t.quote)return[new Vt("CSV_OPTION_QUOTE_INVALID_TYPE",["option `quote` must be a boolean, a buffer or a string,",`got ${JSON.stringify(t.quote)}`])];if(void 0!==t.quoted&&null!==t.quoted||(t.quoted=!1),void 0===t.escape_formulas||null===t.escape_formulas)t.escape_formulas=!1;else if("boolean"!=typeof t.escape_formulas)return[new Vt("CSV_OPTION_ESCAPE_FORMULAS_INVALID_TYPE",["option `escape_formulas` must be a boolean,",`got ${JSON.stringify(t.escape_formulas)}`])];if(void 0!==t.quoted_empty&&null!==t.quoted_empty||(t.quoted_empty=void 0),void 0===t.quoted_match||null===t.quoted_match||!1===t.quoted_match?t.quoted_match=null:Array.isArray(t.quoted_match)||(t.quoted_match=[t.quoted_match]),t.quoted_match)for(const e of t.quoted_match){const t=e instanceof RegExp;if("string"!=typeof e&&!t)return[Error(`Invalid Option: quoted_match must be a string or a regex, got ${JSON.stringify(e)}`)]}if(void 0!==t.quoted_string&&null!==t.quoted_string||(t.quoted_string=!1),void 0!==t.eof&&null!==t.eof||(t.eof=!0),void 0===t.escape||null===t.escape)t.escape='"';else if(ce(t.escape))t.escape=t.escape.toString();else if("string"!=typeof t.escape)return[Error(`Invalid Option: escape must be a buffer or a string, got ${JSON.stringify(t.escape)}`)];if(t.escape.length>1)return[Error(`Invalid Option: escape must be one character, got ${t.escape.length} characters`)];void 0!==t.header&&null!==t.header||(t.header=!1);const[i,n]=Xt(t.columns);if(void 0!==i)return[i];if(t.columns=n,void 0!==t.quoted&&null!==t.quoted||(t.quoted=!1),void 0!==t.cast&&null!==t.cast||(t.cast={}),void 0!==t.cast.bigint&&null!==t.cast.bigint||(t.cast.bigint=e=>""+e),void 0!==t.cast.boolean&&null!==t.cast.boolean||(t.cast.boolean=e=>e?"1":""),void 0!==t.cast.date&&null!==t.cast.date||(t.cast.date=e=>""+e.getTime()),void 0!==t.cast.number&&null!==t.cast.number||(t.cast.number=e=>""+e),void 0!==t.cast.object&&null!==t.cast.object||(t.cast.object=e=>JSON.stringify(e)),void 0!==t.cast.string&&null!==t.cast.string||(t.cast.string=function(e){return e}),void 0!==t.on_record&&"function"!=typeof t.on_record)return[Error('Invalid Option: "on_record" must be a function.')];if(void 0===t.record_delimiter||null===t.record_delimiter)t.record_delimiter="\n";else if(ce(t.record_delimiter))t.record_delimiter=t.record_delimiter.toString();else if("string"!=typeof t.record_delimiter)return[Error(`Invalid Option: record_delimiter must be a buffer or a string, got ${JSON.stringify(t.record_delimiter)}`)];switch(t.record_delimiter){case"unix":t.record_delimiter="\n";break;case"mac":t.record_delimiter="\r";break;case"windows":t.record_delimiter="\r\n";break;case"ascii":t.record_delimiter="";break;case"unicode":t.record_delimiter="\u2028"}return[void 0,t]},Jt=M.from([239,187,191]);class ei extends Ot{constructor(e={}){super({writableObjectMode:!0,...e});const[t,i]=Qt(e);if(void 0!==t)throw t;this.options=i,this.state={stop:!1},this.info={records:0},this.api=function(e,t,i){return{options:e,state:t,info:i,__transform:function(e,t){if(!Array.isArray(e)&&"object"!=typeof e)return Error(`Invalid Record: expect an array or an object, got ${JSON.stringify(e)}`);if(0===this.info.records)if(Array.isArray(e)){if(!0===this.options.header&&void 0===this.options.columns)return Error("Undiscoverable Columns: header option requires column option or object records")}else if(void 0===this.options.columns){const[t,i]=Xt(Object.keys(e));if(t)return;this.options.columns=i}if(0===this.info.records){this.bom(t);const e=this.headers(t);if(e)return e}try{this.options.on_record&&this.options.on_record(e,this.info.records)}catch(i){return i}let i,n;if(this.options.eof){if([i,n]=this.stringify(e),i)return i;if(void 0===n)return;n+=this.options.record_delimiter}else{if([i,n]=this.stringify(e),i)return i;if(void 0===n)return;(this.options.header||this.info.records)&&(n=this.options.record_delimiter+n)}this.info.records++,t(n)},stringify:function(e,t=!1){if("object"!=typeof e)return[void 0,e];const{columns:i}=this.options,n=[];if(Array.isArray(e)){i&&e.splice(i.length);for(let i=0;i<e.length;i++){const s=e[i],[r,o]=this.__cast(s,{index:i,column:i,records:this.info.records,header:t});if(r)return[r];n[i]=[o,s]}}else for(let s=0;s<i.length;s++){const r=qt(e,i[s].key),[o,a]=this.__cast(r,{index:s,column:i[s].key,records:this.info.records,header:t});if(o)return[o];n[s]=[a,r]}let s="";for(let e=0;e<n.length;e++){let t,i,[r,o]=n[e];if("string"==typeof r)t=this.options;else if(Ht(r)){if(t=r,r=t.value,delete t.value,"string"!=typeof r&&null!=r&&i)return[Error(`Invalid Casting Value: returned value must return a string, null or undefined, got ${JSON.stringify(r)}`)];if(t={...this.options,...t},[i,t]=Qt(t),void 0!==i)return[i]}else{if(null!=r)return[Error(`Invalid Casting Value: returned value must return a string, an object, null or undefined, got ${JSON.stringify(r)}`)];t=this.options}const{delimiter:a,escape:l,quote:c,quoted:h,quoted_empty:u,quoted_string:d,quoted_match:p,record_delimiter:g,escape_formulas:f}=t;if(""===r&&""===o){let e=p&&p.filter(e=>"string"==typeof e?-1!==r.indexOf(e):e.test(r));e=e&&e.length>0,!0===(e||!0===u||!0===d&&!1!==u)&&(r=c+r+c),s+=r}else if(r){if("string"!=typeof r)return[Error(`Formatter must return a string, null or undefined, got ${JSON.stringify(r)}`)];const e=a.length&&r.indexOf(a)>=0,t=""!==c&&r.indexOf(c)>=0,i=r.indexOf(l)>=0&&l!==c,n=r.indexOf(g)>=0,u=d&&"string"==typeof o;let m=p&&p.filter(e=>"string"==typeof e?-1!==r.indexOf(e):e.test(r));if(m=m&&m.length>0,f)switch(r[0]){case"=":case"+":case"-":case"@":case"\t":case"\r":case"＝":case"＋":case"－":case"＠":r=`'${r}`}const y=!0===t||e||n||h||u||m;if(!0===y&&!0===i){const e="\\"===l?new RegExp(l+l,"g"):new RegExp(l,"g");r=r.replace(e,l+l)}if(!0===t){const e=new RegExp(c,"g");r=r.replace(e,l+c)}!0===y&&(r=c+r+c),s+=r}else(!0===u||""===o&&!0===d&&!1!==u)&&(s+=c+c);e!==n.length-1&&(s+=a)}return[void 0,s]},bom:function(e){!0===this.options.bom&&e(Jt)},headers:function(e){if(!1===this.options.header)return;if(void 0===this.options.columns)return;let t,i=this.options.columns.map(e=>e.header);if(this.options.eof?([t,i]=this.stringify(i,!0),i+=this.options.record_delimiter):[t,i]=this.stringify(i),t)return t;e(i)},__cast:function(e,t){const i=typeof e;try{return"string"===i?[void 0,this.options.cast.string(e,t)]:"bigint"===i?[void 0,this.options.cast.bigint(e,t)]:"number"===i?[void 0,this.options.cast.number(e,t)]:"boolean"===i?[void 0,this.options.cast.boolean(e,t)]:e instanceof Date?[void 0,this.options.cast.date(e,t)]:"object"===i&&null!==e?[void 0,this.options.cast.object(e,t)]:[void 0,e,e]}catch(e){return[e]}}}}(this.options,this.state,this.info),this.api.options.on_record=(...e)=>{this.emit("record",...e)}}_transform(e,t,i){if(!0===this.state.stop)return;const n=this.api.__transform(e,this.push.bind(this));void 0!==n&&(this.state.stop=!0),i(n)}_flush(e){if(!0!==this.state.stop){if(0===this.info.records){this.api.bom(this.push.bind(this));const t=this.api.headers(this.push.bind(this));t&&e(t)}e()}}}const ti=function(){let e,t,i;for(const n in arguments){const s=arguments[n],r=typeof s;if(void 0===e&&Array.isArray(s))e=s;else if(void 0===t&&Ht(s))t=s;else{if(void 0!==i||"function"!==r)throw new Vt("CSV_INVALID_ARGUMENT",["Invalid argument:",`got ${JSON.stringify(s)} at index ${n}`]);i=s}}const n=new ei(t);if(i){const e=[];n.on("readable",function(){let t;for(;null!==(t=this.read());)e.push(t)}),n.on("error",function(e){i(e)}),n.on("end",function(){try{i(void 0,e.join(""))}catch(e){return void i(e)}})}if(void 0!==e){const t=function(){for(const t of e)n.write(t);n.end()};"function"==typeof setImmediate?setImmediate(t):setTimeout(t,0)}return n}},52413(e,t,i){"use strict";function n(e,t,i){e.prototype=t.prototype=i,i.constructor=e}function s(e,t){var i=Object.create(e.prototype);for(var n in t)i[n]=t[n];return i}function r(){}i.d(t,{Ay:()=>w,Qh:()=>E});var o=.7,a=1/o,l="\\s*([+-]?\\d+)\\s*",c="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",h="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",u=/^#([0-9a-f]{3,8})$/,d=new RegExp(`^rgb\\(${l},${l},${l}\\)$`),p=new RegExp(`^rgb\\(${h},${h},${h}\\)$`),g=new RegExp(`^rgba\\(${l},${l},${l},${c}\\)$`),f=new RegExp(`^rgba\\(${h},${h},${h},${c}\\)$`),m=new RegExp(`^hsl\\(${c},${h},${h}\\)$`),y=new RegExp(`^hsla\\(${c},${h},${h},${c}\\)$`),v={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function b(){return this.rgb().formatHex()}function C(){return this.rgb().formatRgb()}function w(e){var t,i;return e=(e+"").trim().toLowerCase(),(t=u.exec(e))?(i=t[1].length,t=parseInt(t[1],16),6===i?S(t):3===i?new A(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===i?x(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===i?x(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=d.exec(e))?new A(t[1],t[2],t[3],1):(t=p.exec(e))?new A(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=g.exec(e))?x(t[1],t[2],t[3],t[4]):(t=f.exec(e))?x(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=m.exec(e))?k(t[1],t[2]/100,t[3]/100,1):(t=y.exec(e))?k(t[1],t[2]/100,t[3]/100,t[4]):v.hasOwnProperty(e)?S(v[e]):"transparent"===e?new A(NaN,NaN,NaN,0):null}function S(e){return new A(e>>16&255,e>>8&255,255&e,1)}function x(e,t,i,n){return n<=0&&(e=t=i=NaN),new A(e,t,i,n)}function E(e,t,i,n){return 1===arguments.length?((s=e)instanceof r||(s=w(s)),s?new A((s=s.rgb()).r,s.g,s.b,s.opacity):new A):new A(e,t,i,null==n?1:n);var s}function A(e,t,i,n){this.r=+e,this.g=+t,this.b=+i,this.opacity=+n}function M(){return`#${R(this.r)}${R(this.g)}${R(this.b)}`}function T(){const e=D(this.opacity);return`${1===e?"rgb(":"rgba("}${I(this.r)}, ${I(this.g)}, ${I(this.b)}${1===e?")":`, ${e})`}`}function D(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function I(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function R(e){return((e=I(e))<16?"0":"")+e.toString(16)}function k(e,t,i,n){return n<=0?e=t=i=NaN:i<=0||i>=1?e=t=NaN:t<=0&&(e=NaN),new _(e,t,i,n)}function P(e){if(e instanceof _)return new _(e.h,e.s,e.l,e.opacity);if(e instanceof r||(e=w(e)),!e)return new _;if(e instanceof _)return e;var t=(e=e.rgb()).r/255,i=e.g/255,n=e.b/255,s=Math.min(t,i,n),o=Math.max(t,i,n),a=NaN,l=o-s,c=(o+s)/2;return l?(a=t===o?(i-n)/l+6*(i<n):i===o?(n-t)/l+2:(t-i)/l+4,l/=c<.5?o+s:2-o-s,a*=60):l=c>0&&c<1?0:a,new _(a,l,c,e.opacity)}function _(e,t,i,n){this.h=+e,this.s=+t,this.l=+i,this.opacity=+n}function L(e){return(e=(e||0)%360)<0?e+360:e}function N(e){return Math.max(0,Math.min(1,e||0))}function O(e,t,i){return 255*(e<60?t+(i-t)*e/60:e<180?i:e<240?t+(i-t)*(240-e)/60:t)}n(r,w,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:b,formatHex:b,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return P(this).formatHsl()},formatRgb:C,toString:C}),n(A,E,s(r,{brighter(e){return e=null==e?a:Math.pow(a,e),new A(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?o:Math.pow(o,e),new A(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new A(I(this.r),I(this.g),I(this.b),D(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:M,formatHex:M,formatHex8:function(){return`#${R(this.r)}${R(this.g)}${R(this.b)}${R(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:T,toString:T})),n(_,function(e,t,i,n){return 1===arguments.length?P(e):new _(e,t,i,null==n?1:n)},s(r,{brighter(e){return e=null==e?a:Math.pow(a,e),new _(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?o:Math.pow(o,e),new _(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,i=this.l,n=i+(i<.5?i:1-i)*t,s=2*i-n;return new A(O(e>=240?e-240:e+120,s,n),O(e,s,n),O(e<120?e+240:e-120,s,n),this.opacity)},clamp(){return new _(L(this.h),N(this.s),N(this.l),D(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=D(this.opacity);return`${1===e?"hsl(":"hsla("}${L(this.h)}, ${100*N(this.s)}%, ${100*N(this.l)}%${1===e?")":`, ${e})`}`}}))},54560(e,t,i){"use strict";i.d(t,{A:()=>l});var n={value:()=>{}};function s(){for(var e,t=0,i=arguments.length,n={};t<i;++t){if(!(e=arguments[t]+"")||e in n||/[\s.]/.test(e))throw new Error("illegal type: "+e);n[e]=[]}return new r(n)}function r(e){this._=e}function o(e,t){for(var i,n=0,s=e.length;n<s;++n)if((i=e[n]).name===t)return i.value}function a(e,t,i){for(var s=0,r=e.length;s<r;++s)if(e[s].name===t){e[s]=n,e=e.slice(0,s).concat(e.slice(s+1));break}return null!=i&&e.push({name:t,value:i}),e}r.prototype=s.prototype={constructor:r,on:function(e,t){var i,n,s=this._,r=(n=s,(e+"").trim().split(/^|\s+/).map(function(e){var t="",i=e.indexOf(".");if(i>=0&&(t=e.slice(i+1),e=e.slice(0,i)),e&&!n.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:t}})),l=-1,c=r.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++l<c;)if(i=(e=r[l]).type)s[i]=a(s[i],e.name,t);else if(null==t)for(i in s)s[i]=a(s[i],e.name,null);return this}for(;++l<c;)if((i=(e=r[l]).type)&&(i=o(s[i],e.name)))return i},copy:function(){var e={},t=this._;for(var i in t)e[i]=t[i].slice();return new r(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var i,n,s=new Array(i),r=0;r<i;++r)s[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(r=0,i=(n=this._[e]).length;r<i;++r)n[r].value.apply(t,s)},apply:function(e,t,i){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var n=this._[e],s=0,r=n.length;s<r;++s)n[s].value.apply(t,i)}};const l=s},83971(e,t,i){"use strict";i.d(t,{A:()=>g});var n=i(54560),s=i(6063),r=i(60616),o=i(37572),a=i(7240);const l=e=>()=>e;function c(e,{sourceEvent:t,subject:i,target:n,identifier:s,active:r,x:o,y:a,dx:l,dy:c,dispatch:h}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:r,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:h}})}function h(e){return!e.ctrlKey&&!e.button}function u(){return this.parentNode}function d(e,t){return null==t?{x:e.x,y:e.y}:t}function p(){return navigator.maxTouchPoints||"ontouchstart"in this}function g(){var e,t,i,g,f=h,m=u,y=d,v=p,b={},C=(0,n.A)("start","drag","end"),w=0,S=0;function x(e){e.on("mousedown.drag",E).filter(v).on("touchstart.drag",T).on("touchmove.drag",D,a.vr).on("touchend.drag touchcancel.drag",I).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function E(n,r){if(!g&&f.call(this,n,r)){var l=R(this,m.call(this,n,r),n,r,"mouse");l&&((0,s.A)(n.view).on("mousemove.drag",A,a.Rw).on("mouseup.drag",M,a.Rw),(0,o.A)(n.view),(0,a.GK)(n),i=!1,e=n.clientX,t=n.clientY,l("start",n))}}function A(n){if((0,a.Ay)(n),!i){var s=n.clientX-e,r=n.clientY-t;i=s*s+r*r>S}b.mouse("drag",n)}function M(e){(0,s.A)(e.view).on("mousemove.drag mouseup.drag",null),(0,o.y)(e.view,i),(0,a.Ay)(e),b.mouse("end",e)}function T(e,t){if(f.call(this,e,t)){var i,n,s=e.changedTouches,r=m.call(this,e,t),o=s.length;for(i=0;i<o;++i)(n=R(this,r,e,t,s[i].identifier,s[i]))&&((0,a.GK)(e),n("start",e,s[i]))}}function D(e){var t,i,n=e.changedTouches,s=n.length;for(t=0;t<s;++t)(i=b[n[t].identifier])&&((0,a.Ay)(e),i("drag",e,n[t]))}function I(e){var t,i,n=e.changedTouches,s=n.length;for(g&&clearTimeout(g),g=setTimeout(function(){g=null},500),t=0;t<s;++t)(i=b[n[t].identifier])&&((0,a.GK)(e),i("end",e,n[t]))}function R(e,t,i,n,s,o){var a,l,h,u=C.copy(),d=(0,r.A)(o||i,t);if(null!=(h=y.call(e,new c("beforestart",{sourceEvent:i,target:x,identifier:s,active:w,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),n)))return a=h.x-d[0]||0,l=h.y-d[1]||0,function i(o,p,g){var f,m=d;switch(o){case"start":b[s]=i,f=w++;break;case"end":delete b[s],--w;case"drag":d=(0,r.A)(g||p,t),f=w}u.call(o,e,new c(o,{sourceEvent:p,subject:h,target:x,identifier:s,active:f,x:d[0]+a,y:d[1]+l,dx:d[0]-m[0],dy:d[1]-m[1],dispatch:u}),n)}}return x.filter=function(e){return arguments.length?(f="function"==typeof e?e:l(!!e),x):f},x.container=function(e){return arguments.length?(m="function"==typeof e?e:l(e),x):m},x.subject=function(e){return arguments.length?(y="function"==typeof e?e:l(e),x):y},x.touchable=function(e){return arguments.length?(v="function"==typeof e?e:l(!!e),x):v},x.on=function(){var e=C.on.apply(C,arguments);return e===C?x:e},x.clickDistance=function(e){return arguments.length?(S=(e=+e)*e,x):Math.sqrt(S)},x}c.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e}},37572(e,t,i){"use strict";i.d(t,{A:()=>r,y:()=>o});var n=i(6063),s=i(7240);function r(e){var t=e.document.documentElement,i=(0,n.A)(e).on("dragstart.drag",s.Ay,s.Rw);"onselectstart"in t?i.on("selectstart.drag",s.Ay,s.Rw):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function o(e,t){var i=e.document.documentElement,r=(0,n.A)(e).on("dragstart.drag",null);t&&(r.on("click.drag",s.Ay,s.Rw),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in i?r.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}},7240(e,t,i){"use strict";i.d(t,{Ay:()=>o,GK:()=>r,Rw:()=>s,vr:()=>n});const n={passive:!1},s={capture:!0,passive:!1};function r(e){e.stopImmediatePropagation()}function o(e){e.preventDefault(),e.stopImmediatePropagation()}},59394(e,t,i){"use strict";i.d(t,{A:()=>n});const n=e=>()=>e},77419(e,t,i){"use strict";function n(e,t){return e=+e,t=+t,function(i){return e*(1-i)+t*i}}i.d(t,{A:()=>n})},92795(e,t,i){"use strict";i.d(t,{Ay:()=>a});var n=i(52413);function s(e,t,i,n,s){var r=e*e,o=r*e;return((1-3*e+3*r-o)*t+(4-6*r+3*o)*i+(1+3*e+3*r-3*o)*n+o*s)/6}var r=i(59394);function o(e,t){var i=t-e;return i?function(e,t){return function(i){return e+i*t}}(e,i):(0,r.A)(isNaN(e)?t:e)}const a=function e(t){var i=function(e){return 1===(e=+e)?o:function(t,i){return i-t?function(e,t,i){return e=Math.pow(e,i),t=Math.pow(t,i)-e,i=1/i,function(n){return Math.pow(e+n*t,i)}}(t,i,e):(0,r.A)(isNaN(t)?i:t)}}(t);function s(e,t){var s=i((e=(0,n.Qh)(e)).r,(t=(0,n.Qh)(t)).r),r=i(e.g,t.g),a=i(e.b,t.b),l=o(e.opacity,t.opacity);return function(t){return e.r=s(t),e.g=r(t),e.b=a(t),e.opacity=l(t),e+""}}return s.gamma=e,s}(1);function l(e){return function(t){var i,s,r=t.length,o=new Array(r),a=new Array(r),l=new Array(r);for(i=0;i<r;++i)s=(0,n.Qh)(t[i]),o[i]=s.r||0,a[i]=s.g||0,l[i]=s.b||0;return o=e(o),a=e(a),l=e(l),s.opacity=1,function(e){return s.r=o(e),s.g=a(e),s.b=l(e),s+""}}}l(function(e){var t=e.length-1;return function(i){var n=i<=0?i=0:i>=1?(i=1,t-1):Math.floor(i*t),r=e[n],o=e[n+1],a=n>0?e[n-1]:2*r-o,l=n<t-1?e[n+2]:2*o-r;return s((i-n/t)*t,a,r,o,l)}}),l(function(e){var t=e.length;return function(i){var n=Math.floor(((i%=1)<0?++i:i)*t),r=e[(n+t-1)%t],o=e[n%t],a=e[(n+1)%t],l=e[(n+2)%t];return s((i-n/t)*t,r,o,a,l)}})},20835(e,t,i){"use strict";i.d(t,{A:()=>o});var n=i(77419),s=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,r=new RegExp(s.source,"g");function o(e,t){var i,o,a,l=s.lastIndex=r.lastIndex=0,c=-1,h=[],u=[];for(e+="",t+="";(i=s.exec(e))&&(o=r.exec(t));)(a=o.index)>l&&(a=t.slice(l,a),h[c]?h[c]+=a:h[++c]=a),(i=i[0])===(o=o[0])?h[c]?h[c]+=o:h[++c]=o:(h[++c]=null,u.push({i:c,x:(0,n.A)(i,o)})),l=r.lastIndex;return l<t.length&&(a=t.slice(l),h[c]?h[c]+=a:h[++c]=a),h.length<2?u[0]?function(e){return function(t){return e(t)+""}}(u[0].x):function(e){return function(){return e}}(t):(t=u.length,function(e){for(var i,n=0;n<t;++n)h[(i=u[n]).i]=i.x(e);return h.join("")})}},32262(e,t,i){"use strict";i.d(t,{A:()=>d});var n=i(52413),s=i(92795);function r(e,t){var i,n=t?t.length:0,s=e?Math.min(n,e.length):0,r=new Array(s),o=new Array(n);for(i=0;i<s;++i)r[i]=d(e[i],t[i]);for(;i<n;++i)o[i]=t[i];return function(e){for(i=0;i<s;++i)o[i]=r[i](e);return o}}function o(e,t){var i=new Date;return e=+e,t=+t,function(n){return i.setTime(e*(1-n)+t*n),i}}var a=i(77419);function l(e,t){var i,n={},s={};for(i in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)i in e?n[i]=d(e[i],t[i]):s[i]=t[i];return function(e){for(i in n)s[i]=n[i](e);return s}}var c=i(20835),h=i(59394);function u(e,t){t||(t=[]);var i,n=e?Math.min(t.length,e.length):0,s=t.slice();return function(r){for(i=0;i<n;++i)s[i]=e[i]*(1-r)+t[i]*r;return s}}function d(e,t){var i,d,p=typeof t;return null==t||"boolean"===p?(0,h.A)(t):("number"===p?a.A:"string"===p?(i=(0,n.Ay)(t))?(t=i,s.Ay):c.A:t instanceof n.Ay?s.Ay:t instanceof Date?o:(d=t,!ArrayBuffer.isView(d)||d instanceof DataView?Array.isArray(t)?r:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?l:a.A:u))(e,t)}},96785(e,t,i){"use strict";function n(e){return((e=Math.exp(e))+1/e)/2}i.d(t,{A:()=>s});const s=function e(t,i,s){function r(e,r){var o,a,l=e[0],c=e[1],h=e[2],u=r[0],d=r[1],p=r[2],g=u-l,f=d-c,m=g*g+f*f;if(m<1e-12)a=Math.log(p/h)/t,o=function(e){return[l+e*g,c+e*f,h*Math.exp(t*e*a)]};else{var y=Math.sqrt(m),v=(p*p-h*h+s*m)/(2*h*i*y),b=(p*p-h*h-s*m)/(2*p*i*y),C=Math.log(Math.sqrt(v*v+1)-v),w=Math.log(Math.sqrt(b*b+1)-b);a=(w-C)/t,o=function(e){var s,r=e*a,o=n(C),u=h/(i*y)*(o*(s=t*r+C,((s=Math.exp(2*s))-1)/(s+1))-function(e){return((e=Math.exp(e))-1/e)/2}(C));return[l+u*g,c+u*f,h*o/n(t*r+C)]}}return o.duration=1e3*a*t/Math.SQRT2,o}return r.rho=function(t){var i=Math.max(.001,+t),n=i*i;return e(i,n,n*n)},r}(Math.SQRT2,2,4)},99269(e,t,i){"use strict";function n(e){return function(){return this.matches(e)}}function s(e){return function(t){return t.matches(e)}}i.d(t,{A:()=>n,j:()=>s})},39276(e,t,i){"use strict";i.d(t,{A:()=>s});var n=i(27683);function s(e){var t=e+="",i=t.indexOf(":");return i>=0&&"xmlns"!==(t=e.slice(0,i))&&(e=e.slice(i+1)),n.A.hasOwnProperty(t)?{space:n.A[t],local:e}:e}},27683(e,t,i){"use strict";i.d(t,{A:()=>s,g:()=>n});var n="http://www.w3.org/1999/xhtml";const s={svg:"http://www.w3.org/2000/svg",xhtml:n,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"}},60616(e,t,i){"use strict";function n(e,t){if(e=function(e){let t;for(;t=e.sourceEvent;)e=t;return e}(e),void 0===t&&(t=e.currentTarget),t){var i=t.ownerSVGElement||t;if(i.createSVGPoint){var n=i.createSVGPoint();return n.x=e.clientX,n.y=e.clientY,[(n=n.matrixTransform(t.getScreenCTM().inverse())).x,n.y]}if(t.getBoundingClientRect){var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}}return[e.pageX,e.pageY]}i.d(t,{A:()=>n})},6063(e,t,i){"use strict";i.d(t,{A:()=>s});var n=i(64155);function s(e){return"string"==typeof e?new n.LN([[document.querySelector(e)]],[document.documentElement]):new n.LN([[e]],n.zr)}},64155(e,t,i){"use strict";i.d(t,{LN:()=>re,Ay:()=>ae,zr:()=>se});var n=i(68166),s=i(54355);var r=i(99269),o=Array.prototype.find;function a(){return this.firstElementChild}var l=Array.prototype.filter;function c(){return Array.from(this.children)}function h(e){return new Array(e.length)}function u(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function d(e,t,i,n,s,r){for(var o,a=0,l=t.length,c=r.length;a<c;++a)(o=t[a])?(o.__data__=r[a],n[a]=o):i[a]=new u(e,r[a]);for(;a<l;++a)(o=t[a])&&(s[a]=o)}function p(e,t,i,n,s,r,o){var a,l,c,h=new Map,d=t.length,p=r.length,g=new Array(d);for(a=0;a<d;++a)(l=t[a])&&(g[a]=c=o.call(l,l.__data__,a,t)+"",h.has(c)?s[a]=l:h.set(c,l));for(a=0;a<p;++a)c=o.call(e,r[a],a,r)+"",(l=h.get(c))?(n[a]=l,l.__data__=r[a],h.delete(c)):i[a]=new u(e,r[a]);for(a=0;a<d;++a)(l=t[a])&&h.get(g[a])===l&&(s[a]=l)}function g(e){return e.__data__}function f(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function m(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}u.prototype={constructor:u,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};var y=i(39276);function v(e){return function(){this.removeAttribute(e)}}function b(e){return function(){this.removeAttributeNS(e.space,e.local)}}function C(e,t){return function(){this.setAttribute(e,t)}}function w(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function S(e,t){return function(){var i=t.apply(this,arguments);null==i?this.removeAttribute(e):this.setAttribute(e,i)}}function x(e,t){return function(){var i=t.apply(this,arguments);null==i?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,i)}}var E=i(37915);function A(e){return function(){delete this[e]}}function M(e,t){return function(){this[e]=t}}function T(e,t){return function(){var i=t.apply(this,arguments);null==i?delete this[e]:this[e]=i}}function D(e){return e.trim().split(/^|\s+/)}function I(e){return e.classList||new R(e)}function R(e){this._node=e,this._names=D(e.getAttribute("class")||"")}function k(e,t){for(var i=I(e),n=-1,s=t.length;++n<s;)i.add(t[n])}function P(e,t){for(var i=I(e),n=-1,s=t.length;++n<s;)i.remove(t[n])}function _(e){return function(){k(this,e)}}function L(e){return function(){P(this,e)}}function N(e,t){return function(){(t.apply(this,arguments)?k:P)(this,e)}}function O(){this.textContent=""}function F(e){return function(){this.textContent=e}}function G(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function B(){this.innerHTML=""}function V(e){return function(){this.innerHTML=e}}function H(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function U(){this.nextSibling&&this.parentNode.appendChild(this)}function z(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}R.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var W=i(27683);function j(e){return function(){var t=this.ownerDocument,i=this.namespaceURI;return i===W.g&&t.documentElement.namespaceURI===W.g?t.createElement(e):t.createElementNS(i,e)}}function $(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function K(e){var t=(0,y.A)(e);return(t.local?$:j)(t)}function Y(){return null}function q(){var e=this.parentNode;e&&e.removeChild(this)}function X(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Z(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Q(e){return function(){var t=this.__on;if(t){for(var i,n=0,s=-1,r=t.length;n<r;++n)i=t[n],e.type&&i.type!==e.type||i.name!==e.name?t[++s]=i:this.removeEventListener(i.type,i.listener,i.options);++s?t.length=s:delete this.__on}}}function J(e,t,i){return function(){var n,s=this.__on,r=function(e){return function(t){e.call(this,t,this.__data__)}}(t);if(s)for(var o=0,a=s.length;o<a;++o)if((n=s[o]).type===e.type&&n.name===e.name)return this.removeEventListener(n.type,n.listener,n.options),this.addEventListener(n.type,n.listener=r,n.options=i),void(n.value=t);this.addEventListener(e.type,r,i),n={type:e.type,name:e.name,value:t,listener:r,options:i},s?s.push(n):this.__on=[n]}}var ee=i(46515);function te(e,t,i){var n=(0,ee.A)(e),s=n.CustomEvent;"function"==typeof s?s=new s(t,i):(s=n.document.createEvent("Event"),i?(s.initEvent(t,i.bubbles,i.cancelable),s.detail=i.detail):s.initEvent(t,!1,!1)),e.dispatchEvent(s)}function ie(e,t){return function(){return te(this,e,t)}}function ne(e,t){return function(){return te(this,e,t.apply(this,arguments))}}var se=[null];function re(e,t){this._groups=e,this._parents=t}function oe(){return new re([[document.documentElement]],se)}re.prototype=oe.prototype={constructor:re,select:function(e){"function"!=typeof e&&(e=(0,n.A)(e));for(var t=this._groups,i=t.length,s=new Array(i),r=0;r<i;++r)for(var o,a,l=t[r],c=l.length,h=s[r]=new Array(c),u=0;u<c;++u)(o=l[u])&&(a=e.call(o,o.__data__,u,l))&&("__data__"in o&&(a.__data__=o.__data__),h[u]=a);return new re(s,this._parents)},selectAll:function(e){e="function"==typeof e?function(e){return function(){return null==(t=e.apply(this,arguments))?[]:Array.isArray(t)?t:Array.from(t);var t}}(e):(0,s.A)(e);for(var t=this._groups,i=t.length,n=[],r=[],o=0;o<i;++o)for(var a,l=t[o],c=l.length,h=0;h<c;++h)(a=l[h])&&(n.push(e.call(a,a.__data__,h,l)),r.push(a));return new re(n,r)},selectChild:function(e){return this.select(null==e?a:function(e){return function(){return o.call(this.children,e)}}("function"==typeof e?e:(0,r.j)(e)))},selectChildren:function(e){return this.selectAll(null==e?c:function(e){return function(){return l.call(this.children,e)}}("function"==typeof e?e:(0,r.j)(e)))},filter:function(e){"function"!=typeof e&&(e=(0,r.A)(e));for(var t=this._groups,i=t.length,n=new Array(i),s=0;s<i;++s)for(var o,a=t[s],l=a.length,c=n[s]=[],h=0;h<l;++h)(o=a[h])&&e.call(o,o.__data__,h,a)&&c.push(o);return new re(n,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,g);var i,n=t?p:d,s=this._parents,r=this._groups;"function"!=typeof e&&(i=e,e=function(){return i});for(var o=r.length,a=new Array(o),l=new Array(o),c=new Array(o),h=0;h<o;++h){var u=s[h],m=r[h],y=m.length,v=f(e.call(u,u&&u.__data__,h,s)),b=v.length,C=l[h]=new Array(b),w=a[h]=new Array(b);n(u,m,C,w,c[h]=new Array(y),v,t);for(var S,x,E=0,A=0;E<b;++E)if(S=C[E]){for(E>=A&&(A=E+1);!(x=w[A])&&++A<b;);S._next=x||null}}return(a=new re(a,s))._enter=l,a._exit=c,a},enter:function(){return new re(this._enter||this._groups.map(h),this._parents)},exit:function(){return new re(this._exit||this._groups.map(h),this._parents)},join:function(e,t,i){var n=this.enter(),s=this,r=this.exit();return"function"==typeof e?(n=e(n))&&(n=n.selection()):n=n.append(e+""),null!=t&&(s=t(s))&&(s=s.selection()),null==i?r.remove():i(r),n&&s?n.merge(s).order():s},merge:function(e){for(var t=e.selection?e.selection():e,i=this._groups,n=t._groups,s=i.length,r=n.length,o=Math.min(s,r),a=new Array(s),l=0;l<o;++l)for(var c,h=i[l],u=n[l],d=h.length,p=a[l]=new Array(d),g=0;g<d;++g)(c=h[g]||u[g])&&(p[g]=c);for(;l<s;++l)a[l]=i[l];return new re(a,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,i=e.length;++t<i;)for(var n,s=e[t],r=s.length-1,o=s[r];--r>=0;)(n=s[r])&&(o&&4^n.compareDocumentPosition(o)&&o.parentNode.insertBefore(n,o),o=n);return this},sort:function(e){function t(t,i){return t&&i?e(t.__data__,i.__data__):!t-!i}e||(e=m);for(var i=this._groups,n=i.length,s=new Array(n),r=0;r<n;++r){for(var o,a=i[r],l=a.length,c=s[r]=new Array(l),h=0;h<l;++h)(o=a[h])&&(c[h]=o);c.sort(t)}return new re(s,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,i=e.length;t<i;++t)for(var n=e[t],s=0,r=n.length;s<r;++s){var o=n[s];if(o)return o}return null},size:function(){let e=0;for(const t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,i=0,n=t.length;i<n;++i)for(var s,r=t[i],o=0,a=r.length;o<a;++o)(s=r[o])&&e.call(s,s.__data__,o,r);return this},attr:function(e,t){var i=(0,y.A)(e);if(arguments.length<2){var n=this.node();return i.local?n.getAttributeNS(i.space,i.local):n.getAttribute(i)}return this.each((null==t?i.local?b:v:"function"==typeof t?i.local?x:S:i.local?w:C)(i,t))},style:E.A,property:function(e,t){return arguments.length>1?this.each((null==t?A:"function"==typeof t?T:M)(e,t)):this.node()[e]},classed:function(e,t){var i=D(e+"");if(arguments.length<2){for(var n=I(this.node()),s=-1,r=i.length;++s<r;)if(!n.contains(i[s]))return!1;return!0}return this.each(("function"==typeof t?N:t?_:L)(i,t))},text:function(e){return arguments.length?this.each(null==e?O:("function"==typeof e?G:F)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?B:("function"==typeof e?H:V)(e)):this.node().innerHTML},raise:function(){return this.each(U)},lower:function(){return this.each(z)},append:function(e){var t="function"==typeof e?e:K(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})},insert:function(e,t){var i="function"==typeof e?e:K(e),s=null==t?Y:"function"==typeof t?t:(0,n.A)(t);return this.select(function(){return this.insertBefore(i.apply(this,arguments),s.apply(this,arguments)||null)})},remove:function(){return this.each(q)},clone:function(e){return this.select(e?Z:X)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,i){var n,s,r=function(e){return e.trim().split(/^|\s+/).map(function(e){var t="",i=e.indexOf(".");return i>=0&&(t=e.slice(i+1),e=e.slice(0,i)),{type:e,name:t}})}(e+""),o=r.length;if(!(arguments.length<2)){for(a=t?J:Q,n=0;n<o;++n)this.each(a(r[n],t,i));return this}var a=this.node().__on;if(a)for(var l,c=0,h=a.length;c<h;++c)for(n=0,l=a[c];n<o;++n)if((s=r[n]).type===l.type&&s.name===l.name)return l.value},dispatch:function(e,t){return this.each(("function"==typeof t?ne:ie)(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,i=e.length;t<i;++t)for(var n,s=e[t],r=0,o=s.length;r<o;++r)(n=s[r])&&(yield n)}};const ae=oe},37915(e,t,i){"use strict";i.d(t,{A:()=>a,j:()=>l});var n=i(46515);function s(e){return function(){this.style.removeProperty(e)}}function r(e,t,i){return function(){this.style.setProperty(e,t,i)}}function o(e,t,i){return function(){var n=t.apply(this,arguments);null==n?this.style.removeProperty(e):this.style.setProperty(e,n,i)}}function a(e,t,i){return arguments.length>1?this.each((null==t?s:"function"==typeof t?o:r)(e,t,null==i?"":i)):l(this.node(),e)}function l(e,t){return e.style.getPropertyValue(t)||(0,n.A)(e).getComputedStyle(e,null).getPropertyValue(t)}},68166(e,t,i){"use strict";function n(){}function s(e){return null==e?n:function(){return this.querySelector(e)}}i.d(t,{A:()=>s})},54355(e,t,i){"use strict";function n(){return[]}function s(e){return null==e?n:function(){return this.querySelectorAll(e)}}i.d(t,{A:()=>s})},46515(e,t,i){"use strict";function n(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}i.d(t,{A:()=>n})},17076(e,t,i){"use strict";i.d(t,{s_:()=>_e,GS:()=>xe,_V:()=>Ee});var n,s,r=i(54560),o=i(37572),a=i(96785),l=i(6063),c=i(60616),h=i(64155),u=0,d=0,p=0,g=0,f=0,m=0,y="object"==typeof performance&&performance.now?performance:Date,v="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function b(){return f||(v(C),f=y.now()+m)}function C(){f=0}function w(){this._call=this._time=this._next=null}function S(e,t,i){var n=new w;return n.restart(e,t,i),n}function x(){f=(g=y.now())+m,u=d=0;try{!function(){b(),++u;for(var e,t=n;t;)(e=f-t._time)>=0&&t._call.call(void 0,e),t=t._next;--u}()}finally{u=0,function(){for(var e,t,i=n,r=1/0;i;)i._call?(r>i._time&&(r=i._time),e=i,i=i._next):(t=i._next,i._next=null,i=e?e._next=t:n=t);s=e,A(r)}(),f=0}}function E(){var e=y.now(),t=e-g;t>1e3&&(m-=t,g=e)}function A(e){u||(d&&(d=clearTimeout(d)),e-f>24?(e<1/0&&(d=setTimeout(x,e-y.now()-m)),p&&(p=clearInterval(p))):(p||(g=y.now(),p=setInterval(E,1e3)),u=1,v(x)))}function M(e,t,i){var n=new w;return t=null==t?0:+t,n.restart(i=>{n.stop(),e(i+t)},t,i),n}w.prototype=S.prototype={constructor:w,restart:function(e,t,i){if("function"!=typeof e)throw new TypeError("callback is not a function");i=(null==i?b():+i)+(null==t?0:+t),this._next||s===this||(s?s._next=this:n=this,s=this),this._call=e,this._time=i,A()},stop:function(){this._call&&(this._call=null,this._time=1/0,A())}};var T=(0,r.A)("start","end","cancel","interrupt"),D=[];function I(e,t,i,n,s,r){var o=e.__transition;if(o){if(i in o)return}else e.__transition={};!function(e,t,i){var n,s=e.__transition;function r(l){var c,h,u,d;if(1!==i.state)return a();for(c in s)if((d=s[c]).name===i.name){if(3===d.state)return M(r);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",e,e.__data__,d.index,d.group),delete s[c]):+c<t&&(d.state=6,d.timer.stop(),d.on.call("cancel",e,e.__data__,d.index,d.group),delete s[c])}if(M(function(){3===i.state&&(i.state=4,i.timer.restart(o,i.delay,i.time),o(l))}),i.state=2,i.on.call("start",e,e.__data__,i.index,i.group),2===i.state){for(i.state=3,n=new Array(u=i.tween.length),c=0,h=-1;c<u;++c)(d=i.tween[c].value.call(e,e.__data__,i.index,i.group))&&(n[++h]=d);n.length=h+1}}function o(t){for(var s=t<i.duration?i.ease.call(null,t/i.duration):(i.timer.restart(a),i.state=5,1),r=-1,o=n.length;++r<o;)n[r].call(e,s);5===i.state&&(i.on.call("end",e,e.__data__,i.index,i.group),a())}function a(){for(var n in i.state=6,i.timer.stop(),delete s[t],s)return;delete e.__transition}s[t]=i,i.timer=S(function(e){i.state=1,i.timer.restart(r,i.delay,i.time),i.delay<=e&&r(e-i.delay)},0,i.time)}(e,i,{name:t,index:n,group:s,on:T,tween:D,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:0})}function R(e,t){var i=P(e,t);if(i.state>0)throw new Error("too late; already scheduled");return i}function k(e,t){var i=P(e,t);if(i.state>3)throw new Error("too late; already running");return i}function P(e,t){var i=e.__transition;if(!i||!(i=i[t]))throw new Error("transition not found");return i}function _(e,t){var i,n,s,r=e.__transition,o=!0;if(r){for(s in t=null==t?null:t+"",r)(i=r[s]).name===t?(n=i.state>2&&i.state<5,i.state=6,i.timer.stop(),i.on.call(n?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete r[s]):o=!1;o&&delete e.__transition}}var L,N=i(77419),O=180/Math.PI,F={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function G(e,t,i,n,s,r){var o,a,l;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(l=e*i+t*n)&&(i-=e*l,n-=t*l),(a=Math.sqrt(i*i+n*n))&&(i/=a,n/=a,l/=a),e*n<t*i&&(e=-e,t=-t,l=-l,o=-o),{translateX:s,translateY:r,rotate:Math.atan2(t,e)*O,skewX:Math.atan(l)*O,scaleX:o,scaleY:a}}function B(e,t,i,n){function s(e){return e.length?e.pop()+" ":""}return function(r,o){var a=[],l=[];return r=e(r),o=e(o),function(e,n,s,r,o,a){if(e!==s||n!==r){var l=o.push("translate(",null,t,null,i);a.push({i:l-4,x:(0,N.A)(e,s)},{i:l-2,x:(0,N.A)(n,r)})}else(s||r)&&o.push("translate("+s+t+r+i)}(r.translateX,r.translateY,o.translateX,o.translateY,a,l),function(e,t,i,r){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),r.push({i:i.push(s(i)+"rotate(",null,n)-2,x:(0,N.A)(e,t)})):t&&i.push(s(i)+"rotate("+t+n)}(r.rotate,o.rotate,a,l),function(e,t,i,r){e!==t?r.push({i:i.push(s(i)+"skewX(",null,n)-2,x:(0,N.A)(e,t)}):t&&i.push(s(i)+"skewX("+t+n)}(r.skewX,o.skewX,a,l),function(e,t,i,n,r,o){if(e!==i||t!==n){var a=r.push(s(r)+"scale(",null,",",null,")");o.push({i:a-4,x:(0,N.A)(e,i)},{i:a-2,x:(0,N.A)(t,n)})}else 1===i&&1===n||r.push(s(r)+"scale("+i+","+n+")")}(r.scaleX,r.scaleY,o.scaleX,o.scaleY,a,l),r=o=null,function(e){for(var t,i=-1,n=l.length;++i<n;)a[(t=l[i]).i]=t.x(e);return a.join("")}}}var V=B(function(e){const t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?F:G(t.a,t.b,t.c,t.d,t.e,t.f)},"px, ","px)","deg)"),H=B(function(e){return null==e?F:(L||(L=document.createElementNS("http://www.w3.org/2000/svg","g")),L.setAttribute("transform",e),(e=L.transform.baseVal.consolidate())?G((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):F)},", ",")",")"),U=i(39276);function z(e,t){var i,n;return function(){var s=k(this,e),r=s.tween;if(r!==i)for(var o=0,a=(n=i=r).length;o<a;++o)if(n[o].name===t){(n=n.slice()).splice(o,1);break}s.tween=n}}function W(e,t,i){var n,s;if("function"!=typeof i)throw new Error;return function(){var r=k(this,e),o=r.tween;if(o!==n){s=(n=o).slice();for(var a={name:t,value:i},l=0,c=s.length;l<c;++l)if(s[l].name===t){s[l]=a;break}l===c&&s.push(a)}r.tween=s}}function j(e,t,i){var n=e._id;return e.each(function(){var e=k(this,n);(e.value||(e.value={}))[t]=i.apply(this,arguments)}),function(e){return P(e,n).value[t]}}var $=i(52413),K=i(92795),Y=i(20835);function q(e,t){var i;return("number"==typeof t?N.A:t instanceof $.Ay?K.Ay:(i=(0,$.Ay)(t))?(t=i,K.Ay):Y.A)(e,t)}function X(e){return function(){this.removeAttribute(e)}}function Z(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Q(e,t,i){var n,s,r=i+"";return function(){var o=this.getAttribute(e);return o===r?null:o===n?s:s=t(n=o,i)}}function J(e,t,i){var n,s,r=i+"";return function(){var o=this.getAttributeNS(e.space,e.local);return o===r?null:o===n?s:s=t(n=o,i)}}function ee(e,t,i){var n,s,r;return function(){var o,a,l=i(this);if(null!=l)return(o=this.getAttribute(e))===(a=l+"")?null:o===n&&a===s?r:(s=a,r=t(n=o,l));this.removeAttribute(e)}}function te(e,t,i){var n,s,r;return function(){var o,a,l=i(this);if(null!=l)return(o=this.getAttributeNS(e.space,e.local))===(a=l+"")?null:o===n&&a===s?r:(s=a,r=t(n=o,l));this.removeAttributeNS(e.space,e.local)}}function ie(e,t){var i,n;function s(){var s=t.apply(this,arguments);return s!==n&&(i=(n=s)&&function(e,t){return function(i){this.setAttributeNS(e.space,e.local,t.call(this,i))}}(e,s)),i}return s._value=t,s}function ne(e,t){var i,n;function s(){var s=t.apply(this,arguments);return s!==n&&(i=(n=s)&&function(e,t){return function(i){this.setAttribute(e,t.call(this,i))}}(e,s)),i}return s._value=t,s}function se(e,t){return function(){R(this,e).delay=+t.apply(this,arguments)}}function re(e,t){return t=+t,function(){R(this,e).delay=t}}function oe(e,t){return function(){k(this,e).duration=+t.apply(this,arguments)}}function ae(e,t){return t=+t,function(){k(this,e).duration=t}}var le=i(99269),ce=i(68166),he=i(54355),ue=h.Ay.prototype.constructor,de=i(37915);function pe(e){return function(){this.style.removeProperty(e)}}var ge=0;function fe(e,t,i,n){this._groups=e,this._parents=t,this._name=i,this._id=n}function me(){return++ge}var ye=h.Ay.prototype;fe.prototype=function(e){return(0,h.Ay)().transition(e)}.prototype={constructor:fe,select:function(e){var t=this._name,i=this._id;"function"!=typeof e&&(e=(0,ce.A)(e));for(var n=this._groups,s=n.length,r=new Array(s),o=0;o<s;++o)for(var a,l,c=n[o],h=c.length,u=r[o]=new Array(h),d=0;d<h;++d)(a=c[d])&&(l=e.call(a,a.__data__,d,c))&&("__data__"in a&&(l.__data__=a.__data__),u[d]=l,I(u[d],t,i,d,u,P(a,i)));return new fe(r,this._parents,t,i)},selectAll:function(e){var t=this._name,i=this._id;"function"!=typeof e&&(e=(0,he.A)(e));for(var n=this._groups,s=n.length,r=[],o=[],a=0;a<s;++a)for(var l,c=n[a],h=c.length,u=0;u<h;++u)if(l=c[u]){for(var d,p=e.call(l,l.__data__,u,c),g=P(l,i),f=0,m=p.length;f<m;++f)(d=p[f])&&I(d,t,i,f,p,g);r.push(p),o.push(l)}return new fe(r,o,t,i)},selectChild:ye.selectChild,selectChildren:ye.selectChildren,filter:function(e){"function"!=typeof e&&(e=(0,le.A)(e));for(var t=this._groups,i=t.length,n=new Array(i),s=0;s<i;++s)for(var r,o=t[s],a=o.length,l=n[s]=[],c=0;c<a;++c)(r=o[c])&&e.call(r,r.__data__,c,o)&&l.push(r);return new fe(n,this._parents,this._name,this._id)},merge:function(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,i=e._groups,n=t.length,s=i.length,r=Math.min(n,s),o=new Array(n),a=0;a<r;++a)for(var l,c=t[a],h=i[a],u=c.length,d=o[a]=new Array(u),p=0;p<u;++p)(l=c[p]||h[p])&&(d[p]=l);for(;a<n;++a)o[a]=t[a];return new fe(o,this._parents,this._name,this._id)},selection:function(){return new ue(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,i=me(),n=this._groups,s=n.length,r=0;r<s;++r)for(var o,a=n[r],l=a.length,c=0;c<l;++c)if(o=a[c]){var h=P(o,t);I(o,e,i,c,a,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new fe(n,this._parents,e,i)},call:ye.call,nodes:ye.nodes,node:ye.node,size:ye.size,empty:ye.empty,each:ye.each,on:function(e,t){var i=this._id;return arguments.length<2?P(this.node(),i).on.on(e):this.each(function(e,t,i){var n,s,r=function(e){return(e+"").trim().split(/^|\s+/).every(function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||"start"===e})}(t)?R:k;return function(){var o=r(this,e),a=o.on;a!==n&&(s=(n=a).copy()).on(t,i),o.on=s}}(i,e,t))},attr:function(e,t){var i=(0,U.A)(e),n="transform"===i?H:q;return this.attrTween(e,"function"==typeof t?(i.local?te:ee)(i,n,j(this,"attr."+e,t)):null==t?(i.local?Z:X)(i):(i.local?J:Q)(i,n,t))},attrTween:function(e,t){var i="attr."+e;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==t)return this.tween(i,null);if("function"!=typeof t)throw new Error;var n=(0,U.A)(e);return this.tween(i,(n.local?ie:ne)(n,t))},style:function(e,t,i){var n="transform"==(e+="")?V:q;return null==t?this.styleTween(e,function(e,t){var i,n,s;return function(){var r=(0,de.j)(this,e),o=(this.style.removeProperty(e),(0,de.j)(this,e));return r===o?null:r===i&&o===n?s:s=t(i=r,n=o)}}(e,n)).on("end.style."+e,pe(e)):"function"==typeof t?this.styleTween(e,function(e,t,i){var n,s,r;return function(){var o=(0,de.j)(this,e),a=i(this),l=a+"";return null==a&&(this.style.removeProperty(e),l=a=(0,de.j)(this,e)),o===l?null:o===n&&l===s?r:(s=l,r=t(n=o,a))}}(e,n,j(this,"style."+e,t))).each(function(e,t){var i,n,s,r,o="style."+t,a="end."+o;return function(){var l=k(this,e),c=l.on,h=null==l.value[o]?r||(r=pe(t)):void 0;c===i&&s===h||(n=(i=c).copy()).on(a,s=h),l.on=n}}(this._id,e)):this.styleTween(e,function(e,t,i){var n,s,r=i+"";return function(){var o=(0,de.j)(this,e);return o===r?null:o===n?s:s=t(n=o,i)}}(e,n,t),i).on("end.style."+e,null)},styleTween:function(e,t,i){var n="style."+(e+="");if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;return this.tween(n,function(e,t,i){var n,s;function r(){var r=t.apply(this,arguments);return r!==s&&(n=(s=r)&&function(e,t,i){return function(n){this.style.setProperty(e,t.call(this,n),i)}}(e,r,i)),n}return r._value=t,r}(e,t,null==i?"":i))},text:function(e){return this.tween("text","function"==typeof e?function(e){return function(){var t=e(this);this.textContent=null==t?"":t}}(j(this,"text",e)):function(e){return function(){this.textContent=e}}(null==e?"":e+""))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw new Error;return this.tween(t,function(e){var t,i;function n(){var n=e.apply(this,arguments);return n!==i&&(t=(i=n)&&function(e){return function(t){this.textContent=e.call(this,t)}}(n)),t}return n._value=e,n}(e))},remove:function(){return this.on("end.remove",function(e){return function(){var t=this.parentNode;for(var i in this.__transition)if(+i!==e)return;t&&t.removeChild(this)}}(this._id))},tween:function(e,t){var i=this._id;if(e+="",arguments.length<2){for(var n,s=P(this.node(),i).tween,r=0,o=s.length;r<o;++r)if((n=s[r]).name===e)return n.value;return null}return this.each((null==t?z:W)(i,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?se:re)(t,e)):P(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?oe:ae)(t,e)):P(this.node(),t).duration},ease:function(e){var t=this._id;return arguments.length?this.each(function(e,t){if("function"!=typeof t)throw new Error;return function(){k(this,e).ease=t}}(t,e)):P(this.node(),t).ease},easeVarying:function(e){if("function"!=typeof e)throw new Error;return this.each(function(e,t){return function(){var i=t.apply(this,arguments);if("function"!=typeof i)throw new Error;k(this,e).ease=i}}(this._id,e))},end:function(){var e,t,i=this,n=i._id,s=i.size();return new Promise(function(r,o){var a={value:o},l={value:function(){0===--s&&r()}};i.each(function(){var i=k(this,n),s=i.on;s!==e&&((t=(e=s).copy())._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),i.on=t}),0===s&&r()})},[Symbol.iterator]:ye[Symbol.iterator]};var ve={time:null,delay:0,duration:250,ease:function(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}};function be(e,t){for(var i;!(i=e.__transition)||!(i=i[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return i}h.Ay.prototype.interrupt=function(e){return this.each(function(){_(this,e)})},h.Ay.prototype.transition=function(e){var t,i;e instanceof fe?(t=e._id,e=e._name):(t=me(),(i=ve).time=b(),e=null==e?null:e+"");for(var n=this._groups,s=n.length,r=0;r<s;++r)for(var o,a=n[r],l=a.length,c=0;c<l;++c)(o=a[c])&&I(o,e,t,c,a,i||be(o,t));return new fe(n,this._parents,e,t)};const Ce=e=>()=>e;function we(e,{sourceEvent:t,target:i,transform:n,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:n,enumerable:!0,configurable:!0},_:{value:s}})}function Se(e,t,i){this.k=e,this.x=t,this.y=i}Se.prototype={constructor:Se,scale:function(e){return 1===e?this:new Se(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new Se(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var xe=new Se(1,0,0);function Ee(e){for(;!e.__zoom;)if(!(e=e.parentNode))return xe;return e.__zoom}function Ae(e){e.stopImmediatePropagation()}function Me(e){e.preventDefault(),e.stopImmediatePropagation()}function Te(e){return!(e.ctrlKey&&"wheel"!==e.type||e.button)}function De(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e).hasAttribute("viewBox")?[[(e=e.viewBox.baseVal).x,e.y],[e.x+e.width,e.y+e.height]]:[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]:[[0,0],[e.clientWidth,e.clientHeight]]}function Ie(){return this.__zoom||xe}function Re(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function ke(){return navigator.maxTouchPoints||"ontouchstart"in this}function Pe(e,t,i){var n=e.invertX(t[0][0])-i[0][0],s=e.invertX(t[1][0])-i[1][0],r=e.invertY(t[0][1])-i[0][1],o=e.invertY(t[1][1])-i[1][1];return e.translate(s>n?(n+s)/2:Math.min(0,n)||Math.max(0,s),o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o))}function _e(){var e,t,i,n=Te,s=De,h=Pe,u=Re,d=ke,p=[0,1/0],g=[[-1/0,-1/0],[1/0,1/0]],f=250,m=a.A,y=(0,r.A)("start","zoom","end"),v=0,b=10;function C(e){e.property("__zoom",Ie).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",D).on("dblclick.zoom",I).filter(d).on("touchstart.zoom",R).on("touchmove.zoom",k).on("touchend.zoom touchcancel.zoom",P).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function w(e,t){return(t=Math.max(p[0],Math.min(p[1],t)))===e.k?e:new Se(t,e.x,e.y)}function S(e,t,i){var n=t[0]-i[0]*e.k,s=t[1]-i[1]*e.k;return n===e.x&&s===e.y?e:new Se(e.k,n,s)}function x(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function E(e,t,i,n){e.on("start.zoom",function(){A(this,arguments).event(n).start()}).on("interrupt.zoom end.zoom",function(){A(this,arguments).event(n).end()}).tween("zoom",function(){var e=this,r=arguments,o=A(e,r).event(n),a=s.apply(e,r),l=null==i?x(a):"function"==typeof i?i.apply(e,r):i,c=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),h=e.__zoom,u="function"==typeof t?t.apply(e,r):t,d=m(h.invert(l).concat(c/h.k),u.invert(l).concat(c/u.k));return function(e){if(1===e)e=u;else{var t=d(e),i=c/t[2];e=new Se(i,l[0]-t[0]*i,l[1]-t[1]*i)}o.zoom(null,e)}})}function A(e,t,i){return!i&&e.__zooming||new M(e,t)}function M(e,t){this.that=e,this.args=t,this.active=0,this.sourceEvent=null,this.extent=s.apply(e,t),this.taps=0}function T(e,...t){if(n.apply(this,arguments)){var i=A(this,t).event(e),s=this.__zoom,r=Math.max(p[0],Math.min(p[1],s.k*Math.pow(2,u.apply(this,arguments)))),o=(0,c.A)(e);if(i.wheel)i.mouse[0][0]===o[0]&&i.mouse[0][1]===o[1]||(i.mouse[1]=s.invert(i.mouse[0]=o)),clearTimeout(i.wheel);else{if(s.k===r)return;i.mouse=[o,s.invert(o)],_(this),i.start()}Me(e),i.wheel=setTimeout(function(){i.wheel=null,i.end()},150),i.zoom("mouse",h(S(w(s,r),i.mouse[0],i.mouse[1]),i.extent,g))}}function D(e,...t){if(!i&&n.apply(this,arguments)){var s=e.currentTarget,r=A(this,t,!0).event(e),a=(0,l.A)(e.view).on("mousemove.zoom",function(e){if(Me(e),!r.moved){var t=e.clientX-d,i=e.clientY-p;r.moved=t*t+i*i>v}r.event(e).zoom("mouse",h(S(r.that.__zoom,r.mouse[0]=(0,c.A)(e,s),r.mouse[1]),r.extent,g))},!0).on("mouseup.zoom",function(e){a.on("mousemove.zoom mouseup.zoom",null),(0,o.y)(e.view,r.moved),Me(e),r.event(e).end()},!0),u=(0,c.A)(e,s),d=e.clientX,p=e.clientY;(0,o.A)(e.view),Ae(e),r.mouse=[u,this.__zoom.invert(u)],_(this),r.start()}}function I(e,...t){if(n.apply(this,arguments)){var i=this.__zoom,r=(0,c.A)(e.changedTouches?e.changedTouches[0]:e,this),o=i.invert(r),a=i.k*(e.shiftKey?.5:2),u=h(S(w(i,a),r,o),s.apply(this,t),g);Me(e),f>0?(0,l.A)(this).transition().duration(f).call(E,u,r,e):(0,l.A)(this).call(C.transform,u,r,e)}}function R(i,...s){if(n.apply(this,arguments)){var r,o,a,l,h=i.touches,u=h.length,d=A(this,s,i.changedTouches.length===u).event(i);for(Ae(i),o=0;o<u;++o)a=h[o],l=[l=(0,c.A)(a,this),this.__zoom.invert(l),a.identifier],d.touch0?d.touch1||d.touch0[2]===l[2]||(d.touch1=l,d.taps=0):(d.touch0=l,r=!0,d.taps=1+!!e);e&&(e=clearTimeout(e)),r&&(d.taps<2&&(t=l[0],e=setTimeout(function(){e=null},500)),_(this),d.start())}}function k(e,...t){if(this.__zooming){var i,n,s,r,o=A(this,t).event(e),a=e.changedTouches,l=a.length;for(Me(e),i=0;i<l;++i)n=a[i],s=(0,c.A)(n,this),o.touch0&&o.touch0[2]===n.identifier?o.touch0[0]=s:o.touch1&&o.touch1[2]===n.identifier&&(o.touch1[0]=s);if(n=o.that.__zoom,o.touch1){var u=o.touch0[0],d=o.touch0[1],p=o.touch1[0],f=o.touch1[1],m=(m=p[0]-u[0])*m+(m=p[1]-u[1])*m,y=(y=f[0]-d[0])*y+(y=f[1]-d[1])*y;n=w(n,Math.sqrt(m/y)),s=[(u[0]+p[0])/2,(u[1]+p[1])/2],r=[(d[0]+f[0])/2,(d[1]+f[1])/2]}else{if(!o.touch0)return;s=o.touch0[0],r=o.touch0[1]}o.zoom("touch",h(S(n,s,r),o.extent,g))}}function P(e,...n){if(this.__zooming){var s,r,o=A(this,n).event(e),a=e.changedTouches,h=a.length;for(Ae(e),i&&clearTimeout(i),i=setTimeout(function(){i=null},500),s=0;s<h;++s)r=a[s],o.touch0&&o.touch0[2]===r.identifier?delete o.touch0:o.touch1&&o.touch1[2]===r.identifier&&delete o.touch1;if(o.touch1&&!o.touch0&&(o.touch0=o.touch1,delete o.touch1),o.touch0)o.touch0[1]=this.__zoom.invert(o.touch0[0]);else if(o.end(),2===o.taps&&(r=(0,c.A)(r,this),Math.hypot(t[0]-r[0],t[1]-r[1])<b)){var u=(0,l.A)(this).on("dblclick.zoom");u&&u.apply(this,arguments)}}}return C.transform=function(e,t,i,n){var s=e.selection?e.selection():e;s.property("__zoom",Ie),e!==s?E(e,t,i,n):s.interrupt().each(function(){A(this,arguments).event(n).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()})},C.scaleBy=function(e,t,i,n){C.scaleTo(e,function(){return this.__zoom.k*("function"==typeof t?t.apply(this,arguments):t)},i,n)},C.scaleTo=function(e,t,i,n){C.transform(e,function(){var e=s.apply(this,arguments),n=this.__zoom,r=null==i?x(e):"function"==typeof i?i.apply(this,arguments):i,o=n.invert(r),a="function"==typeof t?t.apply(this,arguments):t;return h(S(w(n,a),r,o),e,g)},i,n)},C.translateBy=function(e,t,i,n){C.transform(e,function(){return h(this.__zoom.translate("function"==typeof t?t.apply(this,arguments):t,"function"==typeof i?i.apply(this,arguments):i),s.apply(this,arguments),g)},null,n)},C.translateTo=function(e,t,i,n,r){C.transform(e,function(){var e=s.apply(this,arguments),r=this.__zoom,o=null==n?x(e):"function"==typeof n?n.apply(this,arguments):n;return h(xe.translate(o[0],o[1]).scale(r.k).translate("function"==typeof t?-t.apply(this,arguments):-t,"function"==typeof i?-i.apply(this,arguments):-i),e,g)},n,r)},M.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return 1===++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(e,t){return this.mouse&&"mouse"!==e&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&"touch"!==e&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&"touch"!==e&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit("zoom"),this},end:function(){return 0===--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(e){var t=(0,l.A)(this.that).datum();y.call(e,this.that,new we(e,{sourceEvent:this.sourceEvent,target:C,type:e,transform:this.that.__zoom,dispatch:y}),t)}},C.wheelDelta=function(e){return arguments.length?(u="function"==typeof e?e:Ce(+e),C):u},C.filter=function(e){return arguments.length?(n="function"==typeof e?e:Ce(!!e),C):n},C.touchable=function(e){return arguments.length?(d="function"==typeof e?e:Ce(!!e),C):d},C.extent=function(e){return arguments.length?(s="function"==typeof e?e:Ce([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),C):s},C.scaleExtent=function(e){return arguments.length?(p[0]=+e[0],p[1]=+e[1],C):[p[0],p[1]]},C.translateExtent=function(e){return arguments.length?(g[0][0]=+e[0][0],g[1][0]=+e[1][0],g[0][1]=+e[0][1],g[1][1]=+e[1][1],C):[[g[0][0],g[0][1]],[g[1][0],g[1][1]]]},C.constrain=function(e){return arguments.length?(h=e,C):h},C.duration=function(e){return arguments.length?(f=+e,C):f},C.interpolate=function(e){return arguments.length?(m=e,C):m},C.on=function(){var e=y.on.apply(y,arguments);return e===y?C:e},C.clickDistance=function(e){return arguments.length?(v=(e=+e)*e,C):Math.sqrt(v)},C.tapDistance=function(e){return arguments.length?(b=+e,C):b},C}Ee.prototype=Se.prototype},67543(e,t,i){"use strict";i.d(t,{s:()=>s});const n=document.createElement("i");function s(e){const t="&"+e+";";n.innerHTML=t;const i=n.textContent;return(59!==i.charCodeAt(i.length-1)||"semi"===e)&&i!==t&&i}},9996(e,t,i){"use strict";i.d(t,{j:()=>r});var n=Object.prototype.hasOwnProperty;function s(e,t,i){for(i of e.keys())if(r(i,t))return i}function r(e,t){var i,o,a;if(e===t)return!0;if(e&&t&&(i=e.constructor)===t.constructor){if(i===Date)return e.getTime()===t.getTime();if(i===RegExp)return e.toString()===t.toString();if(i===Array){if((o=e.length)===t.length)for(;o--&&r(e[o],t[o]););return-1===o}if(i===Set){if(e.size!==t.size)return!1;for(o of e){if((a=o)&&"object"==typeof a&&!(a=s(t,a)))return!1;if(!t.has(a))return!1}return!0}if(i===Map){if(e.size!==t.size)return!1;for(o of e){if((a=o[0])&&"object"==typeof a&&!(a=s(t,a)))return!1;if(!r(o[1],t.get(a)))return!1}return!0}if(i===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(i===DataView){if((o=e.byteLength)===t.byteLength)for(;o--&&e.getInt8(o)===t.getInt8(o););return-1===o}if(ArrayBuffer.isView(e)){if((o=e.byteLength)===t.byteLength)for(;o--&&e[o]===t[o];);return-1===o}if(!i||"object"==typeof e){for(i in o=0,e){if(n.call(e,i)&&++o&&!n.call(t,i))return!1;if(!(i in t)||!r(e[i],t[i]))return!1}return Object.keys(t).length===o}}return e!=e&&t!=t}},40562(e,t,i){"use strict";function n(){}function s(){}i.d(t,{HB:()=>s,ok:()=>n})},71143(e,t,i){"use strict";function n(){}function s(e,t,i,n,s){for(var r,o=[];t;)o.push(t),r=t.previousComponent,delete t.previousComponent,t=r;o.reverse();for(var a=0,l=o.length,c=0,h=0;a<l;a++){var u=o[a];if(u.removed){if(u.value=e.join(n.slice(h,h+u.count)),h+=u.count,a&&o[a-1].added){var d=o[a-1];o[a-1]=o[a],o[a]=d}}else{if(!u.added&&s){var p=i.slice(c,c+u.count);p=p.map(function(e,t){var i=n[h+t];return i.length>e.length?i:e}),u.value=e.join(p)}else u.value=e.join(i.slice(c,c+u.count));c+=u.count,u.added||(h+=u.count)}}var g=o[l-1];return l>1&&"string"==typeof g.value&&(g.added||g.removed)&&e.equals("",g.value)&&(o[l-2].value+=g.value,o.pop()),o}i.d(t,{E3:()=>y,JJ:()=>o,Pp:()=>u}),n.prototype={diff:function(e,t){var i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.callback;"function"==typeof n&&(r=n,n={}),this.options=n;var o=this;function a(e){return r?(setTimeout(function(){r(void 0,e)},0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e));var l=(t=this.removeEmpty(this.tokenize(t))).length,c=e.length,h=1,u=l+c;n.maxEditLength&&(u=Math.min(u,n.maxEditLength));var d=null!==(i=n.timeout)&&void 0!==i?i:1/0,p=Date.now()+d,g=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(g[0],t,e,0);if(g[0].oldPos+1>=c&&f+1>=l)return a([{value:this.join(t),count:t.length}]);var m=-1/0,y=1/0;function v(){for(var i=Math.max(m,-h);i<=Math.min(y,h);i+=2){var n=void 0,r=g[i-1],u=g[i+1];r&&(g[i-1]=void 0);var d=!1;if(u){var p=u.oldPos-i;d=u&&0<=p&&p<l}var v=r&&r.oldPos+1<c;if(d||v){if(n=!v||d&&r.oldPos+1<u.oldPos?o.addToPath(u,!0,void 0,0):o.addToPath(r,void 0,!0,1),f=o.extractCommon(n,t,e,i),n.oldPos+1>=c&&f+1>=l)return a(s(o,n.lastComponent,t,e,o.useLongestToken));g[i]=n,n.oldPos+1>=c&&(y=Math.min(y,i-1)),f+1>=l&&(m=Math.max(m,i+1))}else g[i]=void 0}h++}if(r)!function e(){setTimeout(function(){if(h>u||Date.now()>p)return r();v()||e()},0)}();else for(;h<=u&&Date.now()<=p;){var b=v();if(b)return b}},addToPath:function(e,t,i,n){var s=e.lastComponent;return s&&s.added===t&&s.removed===i?{oldPos:e.oldPos+n,lastComponent:{count:s.count+1,added:t,removed:i,previousComponent:s.previousComponent}}:{oldPos:e.oldPos+n,lastComponent:{count:1,added:t,removed:i,previousComponent:s}}},extractCommon:function(e,t,i,n){for(var s=t.length,r=i.length,o=e.oldPos,a=o-n,l=0;a+1<s&&o+1<r&&this.equals(t[a+1],i[o+1]);)a++,o++,l++;return l&&(e.lastComponent={count:l,previousComponent:e.lastComponent}),e.oldPos=o,a},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],i=0;i<e.length;i++)e[i]&&t.push(e[i]);return t},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}};var r=new n;function o(e,t,i){return r.diff(e,t,i)}var a=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,l=/\S/,c=new n;c.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!l.test(e)&&!l.test(t)},c.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),i=0;i<t.length-1;i++)!t[i+1]&&t[i+2]&&a.test(t[i])&&a.test(t[i+2])&&(t[i]+=t[i+2],t.splice(i+1,2),i--);return t};var h=new n;function u(e,t,i){return h.diff(e,t,i)}function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}h.tokenize=function(e){this.options.stripTrailingCr&&(e=e.replace(/\r\n/g,"\n"));var t=[],i=e.split(/(\n|\r\n)/);i[i.length-1]||i.pop();for(var n=0;n<i.length;n++){var s=i[n];n%2&&!this.options.newlineIsToken?t[t.length-1]+=s:(this.options.ignoreWhitespace&&(s=s.trim()),t.push(s))}return t},(new n).tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)},(new n).tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};var p=Object.prototype.toString,g=new n;function f(e,t,i,n,s){var r,o;for(t=t||[],i=i||[],n&&(e=n(s,e)),r=0;r<t.length;r+=1)if(t[r]===e)return i[r];if("[object Array]"===p.call(e)){for(t.push(e),o=new Array(e.length),i.push(o),r=0;r<e.length;r+=1)o[r]=f(e[r],t,i,n,s);return t.pop(),i.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),"object"===d(e)&&null!==e){t.push(e),o={},i.push(o);var a,l=[];for(a in e)e.hasOwnProperty(a)&&l.push(a);for(l.sort(),r=0;r<l.length;r+=1)o[a=l[r]]=f(e[a],t,i,n,a);t.pop(),i.pop()}else o=e;return o}g.useLongestToken=!0,g.tokenize=h.tokenize,g.castInput=function(e){var t=this.options,i=t.undefinedReplacement,n=t.stringifyReplacer,s=void 0===n?function(e,t){return void 0===t?i:t}:n;return"string"==typeof e?e:JSON.stringify(f(e,null,null,s),s,"  ")},g.equals=function(e,t){return n.prototype.equals.call(g,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"))};var m=new n;function y(e,t,i){return m.diff(e,t,i)}m.tokenize=function(e){return e.slice()},m.join=m.removeEmpty=function(e){return e}},36464(e,t,i){"use strict";function n(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}i.d(t,{A:()=>n})},10150(e,t,i){"use strict";i.d(t,{UU:()=>u,jD:()=>h,ni:()=>c});const n=/[$_\p{ID_Start}]/u,s=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,r=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,o=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,a=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,l={};function c(e){return!!e&&n.test(String.fromCodePoint(e))}function h(e,t){const i=(t||l).jsx?r:s;return!!e&&i.test(String.fromCodePoint(e))}function u(e,t){return((t||l).jsx?a:o).test(e)}},38867(e,t,i){"use strict";i.d(t,{YR:()=>a});const n={}.hasOwnProperty,s=Symbol("continue"),r=Symbol("exit"),o=Symbol("skip");function a(e,t){let i,s;"function"==typeof t?i=t:t&&"object"==typeof t&&(t.enter&&(i=t.enter),t.leave&&(s=t.leave)),function e(t,a,h,u){return c(t)&&(d.displayName="node ("+t.type+")"),d;function d(){const d=i?l(i(t,a,h,u)):[];if(d[0]===r)return d;if(d[0]!==o){let i;for(i in t)if(n.call(t,i)&&t[i]&&"object"==typeof t[i]&&"data"!==i&&"position"!==i){const n=u.concat(t),s=t[i];if(Array.isArray(s)){const t=s;let o=0;for(;o>-1&&o<t.length;){const s=t[o];if(c(s)){const t=e(s,i,o,n)();if(t[0]===r)return t;o="number"==typeof t[1]?t[1]:o+1}else o++}}else if(c(s)){const t=e(s,i,void 0,n)();if(t[0]===r)return t}}}return s?l(s(t,a,h,u)):d}}(e,void 0,void 0,[])()}function l(e){return Array.isArray(e)?e:"number"==typeof e?[s,e]:[e]}function c(e){return Boolean(e&&"object"==typeof e&&"type"in e&&"string"==typeof e.type&&e.type.length>0)}},25372(e,t,i){"use strict";i.d(t,{D:()=>s});var n=i(1987);const s=Object.assign(r(Error),{eval:r(EvalError),range:r(RangeError),reference:r(ReferenceError),syntax:r(SyntaxError),type:r(TypeError),uri:r(URIError)});function r(e){return t.displayName=e.displayName||e.name,t;function t(t,...i){const s=t?n(t,...i):t;return new e(s)}}},94531(e,t,i){"use strict";i.d(t,{AH:()=>d});let n={data:""},s=e=>{if("object"==typeof window){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||n},r=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,o=/\/\*[^]*?\*\/|  +/g,a=/\n+/g,l=(e,t)=>{let i="",n="",s="";for(let r in e){let o=e[r];"@"==r[0]?"i"==r[1]?i=r+" "+o+";":n+="f"==r[1]?l(o,r):r+"{"+l(o,"k"==r[1]?"":t)+"}":"object"==typeof o?n+=l(o,t?t.replace(/([^,])+/g,e=>r.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)):r):null!=o&&(r=/^--/.test(r)?r:r.replace(/[A-Z]/g,"-$&").toLowerCase(),s+=l.p?l.p(r,o):r+":"+o+";")}return i+(t&&s?t+"{"+s+"}":s)+n},c={},h=e=>{if("object"==typeof e){let t="";for(let i in e)t+=i+h(e[i]);return t}return e},u=(e,t,i,n,s)=>{let u=h(e),d=c[u]||(c[u]=(e=>{let t=0,i=11;for(;t<e.length;)i=101*i+e.charCodeAt(t++)>>>0;return"go"+i})(u));if(!c[d]){let t=u!==e?e:(e=>{let t,i,n=[{}];for(;t=r.exec(e.replace(o,""));)t[4]?n.shift():t[3]?(i=t[3].replace(a," ").trim(),n.unshift(n[0][i]=n[0][i]||{})):n[0][t[1]]=t[2].replace(a," ").trim();return n[0]})(e);c[d]=l(s?{["@keyframes "+d]:t}:t,i?"":"."+d)}let p=i&&c.g?c.g:null;return i&&(c.g=c[d]),((e,t,i,n)=>{n?t.data=t.data.replace(n,e):-1===t.data.indexOf(e)&&(t.data=i?e+t.data:t.data+e)})(c[d],t,n,p),d};function d(e){let t=this||{},i=e.call?e(t.p):e;return u(i.unshift?i.raw?((e,t,i)=>e.reduce((e,n,s)=>{let r=t[s];if(r&&r.call){let e=r(i),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;r=t?"."+t:e&&"object"==typeof e?e.props?"":l(e,""):!1===e?"":e}return e+n+(null==r?"":r)},""))(i,[].slice.call(arguments,1),t.p):i.reduce((e,i)=>Object.assign(e,i&&i.call?i(t.p):i),{}):i,s(t.target),t.g,t.o,t.k)}d.bind({g:1}),d.bind({k:1})},10114(e){"use strict";e.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},85075(e){"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},15926(e){"use strict";e.exports=JSON.parse('{"name":"aws-appsync-auth-link","version":"3.0.7","main":"lib/index.js","license":"Apache-2.0","description":"AWS Mobile AppSync Auth Link for JavaScript","author":{"name":"Amazon Web Services","url":"https://aws.amazon.com/"},"homepage":"https://github.com/awslabs/aws-mobile-appsync-sdk-js.git","repository":{"type":"git","url":"https://github.com/awslabs/aws-mobile-appsync-sdk-js.git"},"scripts":{"prepare":"tsc","test":"jest --coverage --coverageReporters=text --passWithNoTests","test-watch":"jest --watch"},"dependencies":{"@aws-crypto/sha256-js":"^1.2.0","@aws-sdk/types":"^3.25.0","@aws-sdk/util-hex-encoding":"^3.29.0","debug":"2.6.9"},"devDependencies":{"@apollo/client":"^3.2.0"},"peerDependencies":{"@apollo/client":"3.x"}}')},25730(e){"use strict";e.exports=JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}')},8049(e){"use strict";e.exports=JSON.parse('{"sha224WithRSAEncryption":{"sign":"rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"RSA-SHA224":{"sign":"ecdsa/rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"sha256WithRSAEncryption":{"sign":"rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"RSA-SHA256":{"sign":"ecdsa/rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"sha384WithRSAEncryption":{"sign":"rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"RSA-SHA384":{"sign":"ecdsa/rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"sha512WithRSAEncryption":{"sign":"rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA512":{"sign":"ecdsa/rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA1":{"sign":"rsa","hash":"sha1","id":"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{"sign":"ecdsa","hash":"sha1","id":""},"sha256":{"sign":"ecdsa","hash":"sha256","id":""},"sha224":{"sign":"ecdsa","hash":"sha224","id":""},"sha384":{"sign":"ecdsa","hash":"sha384","id":""},"sha512":{"sign":"ecdsa","hash":"sha512","id":""},"DSA-SHA":{"sign":"dsa","hash":"sha1","id":""},"DSA-SHA1":{"sign":"dsa","hash":"sha1","id":""},"DSA":{"sign":"dsa","hash":"sha1","id":""},"DSA-WITH-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-WITH-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-WITH-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-WITH-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-RIPEMD160":{"sign":"dsa","hash":"rmd160","id":""},"ripemd160WithRSA":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"RSA-RIPEMD160":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"md5WithRSAEncryption":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"},"RSA-MD5":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"}}')},32279(e){"use strict";e.exports=JSON.parse('{"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}')},37821(e){"use strict";e.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},23718(e){"use strict";e.exports={rE:"6.6.1"}}}]);
//# sourceMappingURL=1273.fa73758b99e56c899c4b.js.map